TreasureTrails/node_modules/prisma/build/index.js

4740 lines
2.5 MiB
JavaScript
Raw Normal View History

2026-03-18 09:02:21 -05:00
#!/usr/bin/env node
"use strict";var Ant=Object.create;var OO=Object.defineProperty;var Pnt=Object.getOwnPropertyDescriptor;var Ont=Object.getOwnPropertyNames;var Fnt=Object.getPrototypeOf,Int=Object.prototype.hasOwnProperty;var ct=(e,r)=>()=>(e&&(r=e(e=0)),r);var A=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Ja=(e,r)=>{for(var n in r)OO(e,n,{get:r[n],enumerable:!0})},PO=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Ont(r))!Int.call(e,i)&&i!==n&&OO(e,i,{get:()=>r[i],enumerable:!(o=Pnt(r,i))||o.enumerable});return e},FO=(e,r,n)=>(PO(e,r,"default"),n&&PO(n,r,"default")),W=(e,r,n)=>(n=e!=null?Ant(Fnt(e)):{},PO(r||!e||!e.__esModule?OO(n,"default",{value:e,enumerable:!0}):n,e)),IO=e=>PO(OO({},"__esModule",{value:!0}),e);var mpe,hpe=ct(()=>{"use strict";mpe=typeof globalThis=="object"?globalThis:global});var gpe=ct(()=>{"use strict";hpe()});var ype=ct(()=>{"use strict";gpe()});var Mf,$j=ct(()=>{"use strict";Mf="1.9.0"});function Rnt(e){var r=new Set([e]),n=new Set,o=e.match(xpe);if(!o)return function(){return!1};var i={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(i.prerelease!=null)return function(l){return l===e};function a(u){return n.add(u),!1}function c(u){return r.add(u),!0}return function(l){if(r.has(l))return!0;if(n.has(l))return!1;var p=l.match(xpe);if(!p)return a(l);var f={major:+p[1],minor:+p[2],patch:+p[3],prerelease:p[4]};return f.prerelease!=null||i.major!==f.major?a(l):i.major===0?i.minor===f.minor&&i.patch<=f.patch?c(l):a(l):i.minor<=f.minor?c(l):a(l)}}var xpe,bpe,vpe=ct(()=>{"use strict";$j();xpe=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;bpe=Rnt(Mf)});function up(e,r,n,o){var i;o===void 0&&(o=!1);var a=m_[d_]=(i=m_[d_])!==null&&i!==void 0?i:{version:Mf};if(!o&&a[e]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(c.stack||c.message),!1}if(a.version!==Mf){var c=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+e+" does not match previously registered API v"+Mf);return n.error(c.stack||c.message),!1}return a[e]=r,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+Mf+"."),!0}function Ya(e){var r,n,o=(r=m_[d_])===null||r===void 0?void 0:r.version;if(!(!o||!bpe(o)))return(n=m_[d_])===null||n===void 0?void 0:n[e]}function lp(e,r){r.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Mf+".");var n=m_[d_];n&&delete n[e]}var Mnt,d_,m_,D0=ct(()=>{"use strict";ype();$j();vpe();Mnt=Mf.split(".")[0],d_=Symbol.for("opentelemetry.js.api."+Mnt),m_=mpe});function h_(e,r,n){var o=Ya("diag");if(o)return n.unshift(r),o[e].apply(o,$nt([],knt(n),!1))}var knt,$nt,Epe,wpe=ct(()=>{"use strict";D0();knt=function(e,r){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),i,a=[],c;try{for(;(r===void 0||r-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(c)throw c.error}}return a},$nt=function(e,r,n){if(n||arguments.length===2)for(var o=0,i=r.length,a;o<i;o++)(a||!(o in r))&&(a||(a=Array.prototype.slice.call(r,0,o)),a[o]=r[o]);return e.concat(a||Array.prototype.slice.call(r))},Epe=function(){function e(r){this._namespace=r.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return h_("debug",this._namespace,r)},e.prototype.error=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return h_("error",this._namespace,r)},e.prototype.info=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return h_("info",this._namespace,r)},e.prototype.warn=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return h_("warn",this._namespace,r)},e.prototype.verbose=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return h_("verbose",this._namespace,r)},e}()});var Hi,RO=ct(()=>{"use strict";(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Hi||(Hi={}))});function Spe(e,r){e<Hi.NONE?e=Hi.NON
globstar while`,r,g,n,x,b),this.matchOne(r.slice(g),n.slice(x),o))return this.debug("globstar found match!",g,u,b),!0;if(b==="."||b===".."||!i.dot&&b.charAt(0)==="."){this.debug("dot detected!",r,g,n,x);break}this.debug("globstar swallow a segment, and continue"),g++}return!!(o&&(this.debug(`
>>> no match, partial?`,r,g,n,x),g===u))}var v;if(typeof p=="string"?(v=f===p,this.debug("string match",p,f,v)):(v=f.match(p),this.debug("pattern match",p,f,v)),!v)return!1}if(a===u&&c===l)return!0;if(a===u)return o;if(c===l)return a===u-1&&r[a]==="";throw new Error("wtf?")}braceExpand(){return ige(this.pattern,this.options)}parse(r,n){rI(r);let o=this.options;if(r==="**")if(o.noglobstar)r="*";else return el;if(r==="")return"";let i="",a=!!o.nocase,c=!1,u=[],l=[],p,f=!1,g=-1,x=-1,b,v,S,_=r.charAt(0)==="."?"":o.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",D=()=>{if(p){switch(p){case"*":i+=FU,a=!0;break;case"?":i+=RU,a=!0;break;default:i+="\\"+p;break}this.debug("clearStateChar %j %j",p,i),p=!1}};for(let O=0,I;O<r.length&&(I=r.charAt(O));O++){if(this.debug("%s %s %s %j",r,O,i,I),c){if(I==="/")return!1;rge[I]&&(i+="\\"),i+=I,c=!1;continue}switch(I){case"/":return!1;case"\\":D(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",r,O,i,I),f){this.debug(" in class"),I==="!"&&O===x+1&&(I="^"),i+=I;continue}this.debug("call clearStateChar %j",p),D(),p=I,o.noext&&D();continue;case"(":if(f){i+="(";continue}if(!p){i+="\\(";continue}u.push({type:p,start:O-1,reStart:i.length,open:tge[p].open,close:tge[p].close}),i+=p==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",p,i),p=!1;continue;case")":if(f||!u.length){i+="\\)";continue}D(),a=!0,v=u.pop(),i+=v.close,v.type==="!"&&l.push(v),v.reEnd=i.length;continue;case"|":if(f||!u.length){i+="\\|";continue}D(),i+="|";continue;case"[":if(D(),f){i+="\\"+I;continue}f=!0,x=O,g=i.length,i+=I;continue;case"]":if(O===x+1||!f){i+="\\"+I;continue}b=r.substring(x+1,O);try{RegExp("["+b+"]")}catch{S=this.parse(b,tI),i=i.substr(0,g)+"\\["+S[0]+"\\]",a=a||S[1],f=!1;continue}a=!0,f=!1,i+=I;continue;default:D(),rge[I]&&!(I==="^"&&f)&&(i+="\\"),i+=I;break}}for(f&&(b=r.substr(x+1),S=this.parse(b,tI),i=i.substr(0,g)+"\\["+S[0],a=a||S[1]),v=u.pop();v;v=u.pop()){let O;O=i.slice(v.reStart+v.open.length),this.debug("setting tail",i,v),O=O.replace(/((?:\\{2}){0,64})(\\?)\|/g,(k,j,G)=>(G||(G="\\"),j+j+G+"|")),this.debug(`tail=%j
%s`,O,O,v,i);let I=v.type==="*"?FU:v.type==="?"?RU:"\\"+v.type;a=!0,i=i.slice(0,v.reStart)+I+"\\("+O}D(),c&&(i+="\\\\");let P=mut[i.charAt(0)];for(let O=l.length-1;O>-1;O--){let I=l[O],k=i.slice(0,I.reStart),j=i.slice(I.reStart,I.reEnd-8),G=i.slice(I.reEnd),B=i.slice(I.reEnd-8,I.reEnd)+G,H=k.split("(").length-1,N=G;for(let z=0;z<H;z++)N=N.replace(/\)[+*?]?/,"");G=N;let Y=G===""&&n!==tI?"$":"";i=k+j+G+Y+B}if(i!==""&&a&&(i="(?=.)"+i),P&&(i=_+i),n===tI)return[i,a];if(!a)return gut(r);let C=o.nocase?"i":"";try{return Object.assign(new RegExp("^"+i+"$",C),{_glob:r,_src:i})}catch{return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let r=this.set;if(!r.length)return this.regexp=!1,this.regexp;let n=this.options,o=n.noglobstar?FU:n.dot?fut:dut,i=n.nocase?"i":"",a=r.map(c=>(c=c.map(u=>typeof u=="string"?yut(u):u===el?el:u._src).reduce((u,l)=>(u[u.length-1]===el&&l===el||u.push(l),u),[]),c.forEach((u,l)=>{u!==el||c[l-1]===el||(l===0?c.length>1?c[l+1]="(?:\\/|"+o+"\\/)?"+c[l+1]:c[l]=o:l===c.length-1?c[l-1]+="(?:\\/|"+o+")?":(c[l-1]+="(?:\\/|\\/"+o+"\\/)"+c[l+1],c[l+1]=el))}),c.filter(u=>u!==el).join("/"))).join("|");a="^(?:"+a+")$",this.negate&&(a="^(?!"+a+").*$");try{this.regexp=new RegExp(a,i)}catch{this.regexp=!1}return this.regexp}match(r,n=this.partial){if(this.debug("match",r,this.pattern),this.comment)return!1;if(this.empty)return r==="";if(r==="/"&&n)return!0;let o=this.options;IU.sep!=="/"&&(r=r.split(IU.sep).join("/")),r=r.split(nge),this.debug(this.pattern,"split",r);let i=this.set;this.debug(this.pattern,"set",i);let a;for(let c=r.length-1;c>=0&&(a=r[c],!a);c--);for(let c=0;c<i.length;c++){let u=i[c],l=r;if(o.matchBase&&u.length===1&&(l=[a]),this.matchOne(l,u,n))return o.flipNegate?!0:!this.negate}return o.flipNegate?!1:this.negate}static defaults(r){return Xa.defaults(r).Minimatch}};Xa.Minimatch=Iv});var kU=A(age=>{"use strict";var xut=sge().Minimatch,but=(e,r)=>{let n=r.indexOf("/")!==-1,o=/^!?\//.test(r),i=/^!/.test(r),a;if(!o&&n){let c=r.replace(/^!/,"").replace(/^\.\//,"");return/\/$/.test(e)?a="":a="/",i?`!${e}${a}${c}`:`${e}${a}${c}`}return r};age.create=(e,r,n)=>{let o;typeof r=="string"?o=[r]:o=r;let i=o.map(c=>but(e,c)).map(c=>new xut(c,{matchBase:!0,nocomment:!0,nocase:n||!1,dot:!0,windowsPathsNoEscape:!0}));return c=>{let u="matching",l=!1,p,f;for(f=0;f<i.length;f+=1){if(p=i[f],p.negate&&(u="negation",f===0&&(l=!0)),u==="negation"&&l&&!p.match(c))return!1;u==="matching"&&!l&&(l=p.match(c))}return l}}});var gge=A(nI=>{"use strict";var vut=require("path"),uge=eI(),lge=Fv(),pge=kU(),cge=zi(),Eut=(e,r,n)=>{let o=`${e}([path], options)`;cge.argument(o,"path",r,["string"]),cge.options(o,"options",n,{matching:["string","array of string"],filter:["function"],files:["boolean"],directories:["boolean"],recursive:["boolean"],ignoreCase:["boolean"]})},fge=e=>{let r=e||{};return r.matching===void 0&&(r.matching="*"),r.files===void 0&&(r.files=!0),r.ignoreCase===void 0&&(r.ignoreCase=!1),r.directories===void 0&&(r.directories=!1),r.recursive===void 0&&(r.recursive=!0),r},dge=(e,r)=>e.map(n=>vut.relative(r,n)),mge=e=>{let r=new Error(`Path you want to find stuff in doesn't exist ${e}`);return r.code="ENOENT",r},hge=e=>{let r=new Error(`Path you want to find stuff in must be a directory ${e}`);return r.code="ENOTDIR",r},wut=(e,r)=>{let n=[],o=pge.create(e,r.matching,r.ignoreCase),i=1/0;return r.recursive===!1&&(i=1),uge.sync(e,{maxLevelsDeep:i,symlinks:"follow",inspectOptions:{times:!0,absolutePath:!0}},(a,c)=>{c&&a!==e&&o(a)&&(c.type==="file"&&r.files===!0||c.type==="dir"&&r.directories===!0)&&(r.filter?r.filter(c)&&n.push(a):n.push(a))}),n.sort(),dge(n,r.cwd)},Sut=(e,r)=>{let n=lge.sync(e,{symlinks:"follow"});if(n===void 0)throw mge(e);if(n.type!=="dir")throw hge(e);return wut(e,fge(r))},_ut=(e,r)=>new Promise((n,o)=>{let i=[],a=pge.create(e,r.matching,r.ignoreCase),c=1/0;r.recursive===!1&&(c=1);let u=0,l=!1,p=()=>{l&&u===0&&(i.sort(),n(dge(i,r.cwd)))};uge.async(e,{maxLevelsDeep:c,symlinks:"follow",inspectOptions:{times:!0,absolutePath:!0}},(f,g)=>{if(g&&f!==e&&a(f)&&(g.type==="file"&&
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var cye=A((pfr,aye)=>{"use strict";var ppt=UI(),{MAX_LENGTH:oye,CHAR_BACKSLASH:iq,CHAR_BACKTICK:fpt,CHAR_COMMA:dpt,CHAR_DOT:mpt,CHAR_LEFT_PARENTHESES:hpt,CHAR_RIGHT_PARENTHESES:gpt,CHAR_LEFT_CURLY_BRACE:ypt,CHAR_RIGHT_CURLY_BRACE:xpt,CHAR_LEFT_SQUARE_BRACKET:iye,CHAR_RIGHT_SQUARE_BRACKET:sye,CHAR_DOUBLE_QUOTE:bpt,CHAR_SINGLE_QUOTE:vpt,CHAR_NO_BREAK_SPACE:Ept,CHAR_ZERO_WIDTH_NOBREAK_SPACE:wpt}=nye(),Spt=(e,r={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let n=r||{},o=typeof n.maxLength=="number"?Math.min(oye,n.maxLength):oye;if(e.length>o)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${o})`);let i={type:"root",input:e,nodes:[]},a=[i],c=i,u=i,l=0,p=e.length,f=0,g=0,x,b=()=>e[f++],v=S=>{if(S.type==="text"&&u.type==="dot"&&(u.type="text"),u&&u.type==="text"&&S.type==="text"){u.value+=S.value;return}return c.nodes.push(S),S.parent=c,S.prev=u,u=S,S};for(v({type:"bos"});f<p;)if(c=a[a.length-1],x=b(),!(x===wpt||x===Ept)){if(x===iq){v({type:"text",value:(r.keepEscaping?x:"")+b()});continue}if(x===sye){v({type:"text",value:"\\"+x});continue}if(x===iye){l++;let S;for(;f<p&&(S=b());){if(x+=S,S===iye){l++;continue}if(S===iq){x+=b();continue}if(S===sye&&(l--,l===0))break}v({type:"text",value:x});continue}if(x===hpt){c=v({type:"paren",nodes:[]}),a.push(c),v({type:"text",value:x});continue}if(x===gpt){if(c.type!=="paren"){v({type:"text",value:x});continue}c=a.pop(),v({type:"text",value:x}),c=a[a.length-1];continue}if(x===bpt||x===vpt||x===fpt){let S=x,_;for(r.keepQuotes!==!0&&(x="");f<p&&(_=b());){if(_===iq){x+=_+b();continue}if(_===S){r.keepQuotes===!0&&(x+=_);break}x+=_}v({type:"text",value:x});continue}if(x===ypt){g++;let _={type:"brace",open:!0,close:!1,dollar:u.value&&u.value.slice(-1)==="$"||c.dollar===!0,depth:g,commas:0,ranges:0,nodes:[]};c=v(_),a.push(c),v({type:"open",value:x});continue}if(x===xpt){if(c.type!=="brace"){v({type:"text",value:x});continue}let S="close";c=a.pop(),c.close=!0,v({type:S,value:x}),g--,c=a[a.length-1];continue}if(x===dpt&&g>0){if(c.ranges>0){c.ranges=0;let S=c.nodes.shift();c.nodes=[S,{type:"text",value:ppt(c)}]}v({type:"comma",value:x}),c.commas++;continue}if(x===mpt&&g>0&&c.commas===0){let S=c.nodes;if(g===0||S.length===0){v({type:"text",value:x});continue}if(u.type==="dot"){if(c.range=[],u.value+=x,u.type="range",c.nodes.length!==3&&c.nodes.length!==5){c.invalid=!0,c.ranges=0,u.type="text";continue}c.ranges++,c.args=[];continue}if(u.type==="range"){S.pop();let _=S[S.length-1];_.value+=u.value+x,u=_,c.ranges--;continue}v({type:"dot",value:x});continue}v({type:"text",value:x})}do if(c=a.pop(),c.type!=="root"){c.nodes.forEach(D=>{D.nodes||(D.type==="open"&&(D.isOpen=!0),D.type==="close"&&(D.isClose=!0),D.nodes||(D.type="text"),D.invalid=!0)});let S=a[a.length-1],_=S.nodes.indexOf(c);S.nodes.splice(_,1,...c.nodes)}while(a.length>0);return v({type:"eos"}),i};aye.exports=Spt});var pye=A((ffr,lye)=>{"use strict";var uye=UI(),_pt=Q0e(),Tpt=tye(),Dpt=cye(),tc=(e,r={})=>{let n=[];if(Array.isArray(e))for(let o of e){let i=tc.create(o,r);Array.isArray(i)?n.push(...i):n.push(i)}else n=[].concat(tc.create(e,r));return r&&r.expand===!0&&r.nodupes===!0&&(n=[...new Set(n)]),n};tc.parse=(e,r={})=>Dpt(e,r);tc.stringify=(e,r={})=>uye(typeof e=="string"?tc.parse(e,r):e,r);tc.compile=(e,r={})=>(typeof e=="string"&&(e=tc.parse(e,r)),_pt(e,r));tc.expand=(e,r={})=>{typeof e=="string"&&(e=tc.parse(e,r));let n=Tpt(e,r);return r.noempty===!0&&(n=n.filter(Boolean)),r.nodupes===!0&&(n=[...new Set(n)]),n};tc.create=(e,r={})=>e===""||e.length<3?[e]:r.expand!==!0?tc.compile(e,r):tc.expand(e,r);lye.exports=tc});var Q_=A((dfr,gye)=>{"use strict";var Cpt=require("path"),yp="\\\\/",fye=`[^${yp}]`,Lf="\\.",Apt="\\+",Ppt="\\?",HI="\\/",Opt="(?=.)",dye="[^/]",sq=`(?:${H
GFS4: `),console.error(e)});oo[Ki]||(Bbe=global[Ki]||[],Ube(oo,Bbe),oo.close=function(e){function r(n,o){return e.call(oo,n,function(i){i||jbe(),typeof o=="function"&&o.apply(this,arguments)})}return Object.defineProperty(r,SR,{value:e}),r}(oo.close),oo.closeSync=function(e){function r(n){e.apply(oo,arguments),jbe()}return Object.defineProperty(r,SR,{value:e}),r}(oo.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){V0(oo[Ki]),require("assert").equal(oo[Ki].length,0)}));var Bbe;global[Ki]||Ube(global,oo[Ki]);X7.exports=Z7(dht(oo));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!oo.__patched&&(X7.exports=Z7(oo),oo.__patched=!0);function Z7(e){pht(e),e.gracefulify=Z7,e.createReadStream=I,e.createWriteStream=k;var r=e.readFile;e.readFile=n;function n(B,H,N){return typeof H=="function"&&(N=H,H=null),Y(B,H,N);function Y(z,X,U,Z){return r(z,X,function(oe){oe&&(oe.code==="EMFILE"||oe.code==="ENFILE")?Uv([Y,[z,X,U],oe,Z||Date.now(),Date.now()]):typeof U=="function"&&U.apply(this,arguments)})}}var o=e.writeFile;e.writeFile=i;function i(B,H,N,Y){return typeof N=="function"&&(Y=N,N=null),z(B,H,N,Y);function z(X,U,Z,oe,se){return o(X,U,Z,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Uv([z,[X,U,Z,oe],le,se||Date.now(),Date.now()]):typeof oe=="function"&&oe.apply(this,arguments)})}}var a=e.appendFile;a&&(e.appendFile=c);function c(B,H,N,Y){return typeof N=="function"&&(Y=N,N=null),z(B,H,N,Y);function z(X,U,Z,oe,se){return a(X,U,Z,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Uv([z,[X,U,Z,oe],le,se||Date.now(),Date.now()]):typeof oe=="function"&&oe.apply(this,arguments)})}}var u=e.copyFile;u&&(e.copyFile=l);function l(B,H,N,Y){return typeof N=="function"&&(Y=N,N=0),z(B,H,N,Y);function z(X,U,Z,oe,se){return u(X,U,Z,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Uv([z,[X,U,Z,oe],le,se||Date.now(),Date.now()]):typeof oe=="function"&&oe.apply(this,arguments)})}}var p=e.readdir;e.readdir=g;var f=/^v[0-5]\./;function g(B,H,N){typeof H=="function"&&(N=H,H=null);var Y=f.test(process.version)?function(U,Z,oe,se){return p(U,z(U,Z,oe,se))}:function(U,Z,oe,se){return p(U,Z,z(U,Z,oe,se))};return Y(B,H,N);function z(X,U,Z,oe){return function(se,le){se&&(se.code==="EMFILE"||se.code==="ENFILE")?Uv([Y,[X,U,Z],se,oe||Date.now(),Date.now()]):(le&&le.sort&&le.sort(),typeof Z=="function"&&Z.call(this,se,le))}}}if(process.version.substr(0,4)==="v0.8"){var x=fht(e);D=x.ReadStream,C=x.WriteStream}var b=e.ReadStream;b&&(D.prototype=Object.create(b.prototype),D.prototype.open=P);var v=e.WriteStream;v&&(C.prototype=Object.create(v.prototype),C.prototype.open=O),Object.defineProperty(e,"ReadStream",{get:function(){return D},set:function(B){D=B},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return C},set:function(B){C=B},enumerable:!0,configurable:!0});var S=D;Object.defineProperty(e,"FileReadStream",{get:function(){return S},set:function(B){S=B},enumerable:!0,configurable:!0});var _=C;Object.defineProperty(e,"FileWriteStream",{get:function(){return _},set:function(B){_=B},enumerable:!0,configurable:!0});function D(B,H){return this instanceof D?(b.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function P(){var B=this;G(B.path,B.flags,B.mode,function(H,N){H?(B.autoClose&&B.destroy(),B.emit("error",H)):(B.fd=N,B.emit("open",N),B.read())})}function C(B,H){return this instanceof C?(v.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function O(){var B=this;G(B.path,B.flags,B.mode,function(H,N){H?(B.destroy(),B.emit("error",H)):(B.fd=N,B.emit("open",N))})}function I(B,H){return new e.ReadStream(B,H)}function k(B,H){return new e.WriteStream(B,H)}var j=e.open;e.open=G;function G(B,H,N,Y){return typeof N=="function"&&(Y=N,N=null),z(B,H,N,Y);function z(X,U,Z,oe,se){return j(X,U,Z,function(le,be){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Uv([z,[X,U,Z,oe],le,se||Date.now(),Date.now()]):typeof oe=="function"&&oe.apply(this,arguments)})}}return e}function Uv(e){V0("ENQUEUE",e[0].name,e[1]),oo[Ki].push(e),Q7()}var wR;fu
%s`,I,I,P,o);var k=P.type==="*"?uG:P.type==="?"?cG:"\\"+P.type;i=!0,o=o.slice(0,P.reStart)+k+"\\("+I}v(),a&&(o+="\\\\");var j=!1;switch(o.charAt(0)){case"[":case".":case"(":j=!0}for(var G=u.length-1;G>-1;G--){var B=u[G],H=o.slice(0,B.reStart),N=o.slice(B.reStart,B.reEnd-8),Y=o.slice(B.reEnd-8,B.reEnd),z=o.slice(B.reEnd);Y+=z;var X=H.split("(").length-1,U=z;for(S=0;S<X;S++)U=U.replace(/\)[+*?]?/,"");z=U;var Z="";z===""&&r!==_R&&(Z="$");var oe=H+N+z+Z+Y;o=oe}if(o!==""&&i&&(o="(?=.)"+o),j&&(o=x+o),r===_R)return[o,i];if(!i)return Uht(e);var se=n.nocase?"i":"";try{var le=new RegExp("^"+o+"$",se)}catch{return new RegExp("$.")}return le._glob=e,le._src=o,le}nc.makeRe=function(e,r){return new Ji(e,r||{}).makeRe()};Ji.prototype.makeRe=jht;function jht(){if(this.regexp||this.regexp===!1)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var r=this.options,n=r.noglobstar?uG:r.dot?Iht:Rht,o=r.nocase?"i":"",i=e.map(function(a){return a.map(function(c){return c===lG?n:typeof c=="string"?qht(c):c._src}).join("\\/")}).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,o)}catch{this.regexp=!1}return this.regexp}nc.match=function(e,r,n){n=n||{};var o=new Ji(r,n);return e=e.filter(function(i){return o.match(i)}),o.options.nonull&&!e.length&&e.push(r),e};Ji.prototype.match=function(r,n){if(typeof n>"u"&&(n=this.partial),this.debug("match",r,this.pattern),this.comment)return!1;if(this.empty)return r==="";if(r==="/"&&n)return!0;var o=this.options;oT.sep!=="/"&&(r=r.split(oT.sep).join("/")),r=r.split(lve),this.debug(this.pattern,"split",r);var i=this.set;this.debug(this.pattern,"set",i);var a,c;for(c=r.length-1;c>=0&&(a=r[c],!a);c--);for(c=0;c<i.length;c++){var u=i[c],l=r;o.matchBase&&u.length===1&&(l=[a]);var p=this.matchOne(l,u,n);if(p)return o.flipNegate?!0:!this.negate}return o.flipNegate?!1:this.negate};Ji.prototype.matchOne=function(e,r,n){var o=this.options;this.debug("matchOne",{this:this,file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var i=0,a=0,c=e.length,u=r.length;i<c&&a<u;i++,a++){this.debug("matchOne loop");var l=r[a],p=e[i];if(this.debug(r,l,p),l===!1)return!1;if(l===lG){this.debug("GLOBSTAR",[r,l,p]);var f=i,g=a+1;if(g===u){for(this.debug("** at the end");i<c;i++)if(e[i]==="."||e[i]===".."||!o.dot&&e[i].charAt(0)===".")return!1;return!0}for(;f<c;){var x=e[f];if(this.debug(`
globstar while`,e,f,r,g,x),this.matchOne(e.slice(f),r.slice(g),n))return this.debug("globstar found match!",f,c,x),!0;if(x==="."||x===".."||!o.dot&&x.charAt(0)==="."){this.debug("dot detected!",e,f,r,g);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(n&&(this.debug(`
>>> no match, partial?`,e,f,r,g),f===c))}var b;if(typeof l=="string"?(b=p===l,this.debug("string match",l,p,b)):(b=p.match(l),this.debug("pattern match",l,p,b)),!b)return!1}if(i===c&&a===u)return!0;if(i===c)return n;if(a===u)return i===c-1&&e[i]==="";throw new Error("wtf?")};function Uht(e){return e.replace(/\\(.)/g,"$1")}function qht(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var dve=A((Rdr,pG)=>{"use strict";typeof Object.create=="function"?pG.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:pG.exports=function(r,n){if(n){r.super_=n;var o=function(){};o.prototype=n.prototype,r.prototype=new o,r.prototype.constructor=r}}});var mve=A((Mdr,dG)=>{"use strict";try{if(fG=require("util"),typeof fG.inherits!="function")throw"";dG.exports=fG.inherits}catch{dG.exports=dve()}var fG});var AR=A((kdr,CR)=>{"use strict";function hve(e){return e.charAt(0)==="/"}function gve(e){var r=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,n=r.exec(e),o=n[1]||"",i=!!(o&&o.charAt(1)!==":");return!!(n[2]||i)}CR.exports=process.platform==="win32"?gve:hve;CR.exports.posix=hve;CR.exports.win32=gve});var hG=A(fh=>{"use strict";fh.setopts=Kht;fh.ownProp=yve;fh.makeAbs=iT;fh.finish=Jht;fh.mark=Yht;fh.isIgnored=bve;fh.childrenIgnored=Zht;function yve(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var Ght=require("fs"),Hv=require("path"),Hht=DR(),xve=AR(),mG=Hht.Minimatch;function Wht(e,r){return e.localeCompare(r,"en")}function Vht(e,r){e.ignore=r.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]),e.ignore.length&&(e.ignore=e.ignore.map(zht))}function zht(e){var r=null;if(e.slice(-3)==="/**"){var n=e.replace(/(\/\*\*)+$/,"");r=new mG(n,{dot:!0})}return{matcher:new mG(e,{dot:!0}),gmatcher:r}}function Kht(e,r,n){if(n||(n={}),n.matchBase&&r.indexOf("/")===-1){if(n.noglobstar)throw new Error("base matching requires globstar");r="**/"+r}e.silent=!!n.silent,e.pattern=r,e.strict=n.strict!==!1,e.realpath=!!n.realpath,e.realpathCache=n.realpathCache||Object.create(null),e.follow=!!n.follow,e.dot=!!n.dot,e.mark=!!n.mark,e.nodir=!!n.nodir,e.nodir&&(e.mark=!0),e.sync=!!n.sync,e.nounique=!!n.nounique,e.nonull=!!n.nonull,e.nosort=!!n.nosort,e.nocase=!!n.nocase,e.stat=!!n.stat,e.noprocess=!!n.noprocess,e.absolute=!!n.absolute,e.fs=n.fs||Ght,e.maxLength=n.maxLength||1/0,e.cache=n.cache||Object.create(null),e.statCache=n.statCache||Object.create(null),e.symlinks=n.symlinks||Object.create(null),Vht(e,n),e.changedCwd=!1;var o=process.cwd();yve(n,"cwd")?(e.cwd=Hv.resolve(n.cwd),e.changedCwd=e.cwd!==o):e.cwd=o,e.root=n.root||Hv.resolve(e.cwd,"/"),e.root=Hv.resolve(e.root),process.platform==="win32"&&(e.root=e.root.replace(/\\/g,"/")),e.cwdAbs=xve(e.cwd)?e.cwd:iT(e,e.cwd),process.platform==="win32"&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/")),e.nomount=!!n.nomount,n.nonegate=!0,n.nocomment=!0,n.allowWindowsEscape=!1,e.minimatch=new mG(r,n),e.options=e.minimatch.options}function Jht(e){for(var r=e.nounique,n=r?[]:Object.create(null),o=0,i=e.matches.length;o<i;o++){var a=e.matches[o];if(!a||Object.keys(a).length===0){if(e.nonull){var c=e.minimatch.globSet[o];r?n.push(c):n[c]=!0}}else{var u=Object.keys(a);r?n.push.apply(n,u):u.forEach(function(l){n[l]=!0})}}if(r||(n=Object.keys(n)),e.nosort||(n=n.sort(Wht)),e.mark){for(var o=0;o<n.length;o++)n[o]=e._mark(n[o]);e.nodir&&(n=n.filter(function(l){var p=!/\/$/.test(l),f=e.cache[l]||e.cache[iT(e,l)];return p&&f&&(p=f!=="DIR"&&!Array.isArray(f)),p}))}e.ignore.length&&(n=n.filter(function(l){return!bve(e,l)})),e.found=n}function Yht(e,r){var n=iT(e,r),o=e.cache[n],i=r;if(o){var a=o==="DIR"||Array.isArray(o),c=r.slice(-1)==="/";if(a&&!c?i+="/":!a&&c&&(i=i.slice(0,-1)),i!==r){var u=iT(e,i);e.statCache[u]=e.statCache[n],e.cache[u]=e.cache[n]}}return i}function iT(e,r){var n=r;return r.charAt(0)==="/"?n=Hv.join(e.root,r):xve(r)||r===""?n=r:e.changedCwd?n=Hv.resolve(e.cwd,r):n=Hv.resolve(r),process.platform==="win32"&&(n=n.replace(/\\/g,"/")),n}function bve(e,r){return e.ignore.length?e.ignore.some(fun
See: https://github.com/isaacs/node-glob/issues/167`);return new oi(e,r).found}function oi(e,r){if(!e)throw new Error("must provide pattern");if(typeof r=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof oi))return new oi(e,r);if(Xht(this,e,r),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var o=0;o<n;o++)this._process(this.minimatch.set[o],o,!1);this._finish()}oi.prototype._finish=function(){if(Eve.ok(this instanceof oi),this.realpath){var e=this;this.matches.forEach(function(r,n){var o=e.matches[n]=Object.create(null);for(var i in r)try{i=e._makeAbs(i);var a=Qht.realpathSync(i,e.realpathCache);o[a]=!0}catch(c){if(c.syscall==="stat")o[e._makeAbs(i)]=!0;else throw c}})}K0.finish(this)};oi.prototype._process=function(e,r,n){Eve.ok(this instanceof oi);for(var o=0;typeof e[o]=="string";)o++;var i;switch(o){case e.length:this._processSimple(e.join("/"),r);return;case 0:i=null;break;default:i=e.slice(0,o).join("/");break}var a=e.slice(o),c;i===null?c=".":((PR(i)||PR(e.map(function(p){return typeof p=="string"?p:"[*]"}).join("/")))&&(!i||!PR(i))&&(i="/"+i),c=i);var u=this._makeAbs(c);if(!egt(this,c)){var l=a[0]===vve.GLOBSTAR;l?this._processGlobStar(i,c,u,a,r,n):this._processReaddir(i,c,u,a,r,n)}};oi.prototype._processReaddir=function(e,r,n,o,i,a){var c=this._readdir(n,a);if(c){for(var u=o[0],l=!!this.minimatch.negate,p=u._glob,f=this.dot||p.charAt(0)===".",g=[],x=0;x<c.length;x++){var b=c[x];if(b.charAt(0)!=="."||f){var v;l&&!e?v=!b.match(u):v=b.match(u),v&&g.push(b)}}var S=g.length;if(S!==0){if(o.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var x=0;x<S;x++){var b=g[x];e&&(e.slice(-1)!=="/"?b=e+"/"+b:b=e+b),b.charAt(0)==="/"&&!this.nomount&&(b=gG.join(this.root,b)),this._emitMatch(i,b)}return}o.shift();for(var x=0;x<S;x++){var b=g[x],_;e?_=[e,b]:_=[b],this._process(_.concat(o),i,a)}}}};oi.prototype._emitMatch=function(e,r){if(!tgt(this,r)){var n=this._makeAbs(r);if(this.mark&&(r=this._mark(r)),this.absolute&&(r=n),!this.matches[e][r]){if(this.nodir){var o=this.cache[n];if(o==="DIR"||Array.isArray(o))return}this.matches[e][r]=!0,this.stat&&this._stat(r)}}};oi.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var r,n,o;try{n=this.fs.lstatSync(e)}catch(a){if(a.code==="ENOENT")return null}var i=n&&n.isSymbolicLink();return this.symlinks[e]=i,!i&&n&&!n.isDirectory()?this.cache[e]="FILE":r=this._readdir(e,!1),r};oi.prototype._readdir=function(e,r){var n;if(r&&!yG(this.symlinks,e))return this._readdirInGlobStar(e);if(yG(this.cache,e)){var o=this.cache[e];if(!o||o==="FILE")return null;if(Array.isArray(o))return o}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(i){return this._readdirError(e,i),null}};oi.prototype._readdirEntries=function(e,r){if(!this.mark&&!this.stat)for(var n=0;n<r.length;n++){var o=r[n];e==="/"?o=e+o:o=e+"/"+o,this.cache[o]=!0}return this.cache[e]=r,r};oi.prototype._readdirError=function(e,r){switch(r.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var o=new Error(r.code+" invalid cwd "+this.cwd);throw o.path=this.cwd,o.code=r.code,o}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw r;this.silent||console.error("glob error",r);break}};oi.prototype._processGlobStar=function(e,r,n,o,i,a){var c=this._readdir(n,a);if(c){var u=o.slice(1),l=e?[e]:[],p=l.concat(u);this._process(p,i,!1);var f=c.length,g=this.symlinks[n];if(!(g&&a))for(var x=0;x<f;x++){var b=c[x];if(!(b.charAt(0)==="."&&!this.dot)){var v=l.concat(c[x],u);this._process(v,i,!0);var S=l.concat(c[x],o);this._process(S,i,!0)}}}};oi.prototype._processSimple=function(e,r){var n=this._stat(e);if(this.matches[r]||(this.matches[r]=Object.create(null)),!!n){if(e&&PR(e)&&!this.nomount){var o=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=gG.join(this.root,e):(e=gG.resolve(this.root,e),o&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(r,e)}};oi.prototype._stat=function(e){var r=this._makeAbs(e),n=e.slice(-1)==="/";if(e.length>this.maxLength)return!1;if(!this.stat&&yG(this.c
`).filter(n=>{let o=n.match(Gve);if(o===null||!o[1])return!0;let i=o[1];return i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")?!1:!vgt.test(i)}).filter(n=>n.trim()!=="").map(n=>r.pretty?n.replace(Gve,(o,i)=>o.replace(i,i.replace(Egt,"~"))):n).join(`
`))});var zve=A((Ydr,Vve)=>{"use strict";var wgt=ys(),Sgt=Wve(),_gt=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),OG=class extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);r=[...r].map(o=>o instanceof Error?o:o!==null&&typeof o=="object"?Object.assign(new Error(o.message),o):new Error(o));let n=r.map(o=>typeof o.stack=="string"?_gt(Sgt(o.stack)):String(o)).join(`
`);n=`
`+wgt(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:r})}*[Symbol.iterator](){for(let r of this._errors)yield r}};Vve.exports=OG});var RR=A((Zdr,Kve)=>{"use strict";var Tgt=zve();Kve.exports=async(e,r,{concurrency:n=1/0,stopOnError:o=!0}={})=>new Promise((i,a)=>{if(typeof r!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===1/0)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);let c=[],u=[],l=e[Symbol.iterator](),p=!1,f=!1,g=0,x=0,b=()=>{if(p)return;let v=l.next(),S=x;if(x++,v.done){f=!0,g===0&&(!o&&u.length!==0?a(new Tgt(u)):i(c));return}g++,(async()=>{try{let _=await v.value;c[S]=await r(_,S),g--,b()}catch(_){o?(p=!0,a(_)):(u.push(_),g--,b())}})()};for(let v=0;v<n&&(b(),!f);v++);})});var tEe=A((Qdr,FG)=>{"use strict";var{promisify:Dgt}=require("util"),Jve=require("path"),Yve=J7(),Cgt=XU(),Agt=q7(),zc=qbe(),Pgt=Hbe(),Ogt=Vbe(),Zve=jve(),Fgt=RR(),Igt=Dgt(Zve),Qve={glob:!1,unlink:zc.unlink,unlinkSync:zc.unlinkSync,chmod:zc.chmod,chmodSync:zc.chmodSync,stat:zc.stat,statSync:zc.statSync,lstat:zc.lstat,lstatSync:zc.lstatSync,rmdir:zc.rmdir,rmdirSync:zc.rmdirSync,readdir:zc.readdir,readdirSync:zc.readdirSync};function Xve(e,r){if(Pgt(e))throw new Error("Cannot delete the current working directory. Can be overridden with the `force` option.");if(!Ogt(e,r))throw new Error("Cannot delete files/directories outside the current working directory. Can be overridden with the `force` option.")}function eEe(e){return e=Array.isArray(e)?e:[e],e=e.map(r=>process.platform==="win32"&&Cgt(r)===!1?Agt(r):r),e}FG.exports=async(e,{force:r,dryRun:n,cwd:o=process.cwd(),onProgress:i=()=>{},...a}={})=>{a={expandDirectories:!1,onlyFiles:!1,followSymbolicLinks:!1,cwd:o,...a},e=eEe(e);let c=(await Yve(e,a)).sort((f,g)=>g.localeCompare(f));c.length===0&&i({totalCount:0,deletedCount:0,percent:1});let u=0,p=await Fgt(c,async f=>(f=Jve.resolve(o,f),r||Xve(f,o),n||await Igt(f,Qve),u+=1,i({totalCount:c.length,deletedCount:u,percent:u/c.length}),f),a);return p.sort((f,g)=>f.localeCompare(g)),p};FG.exports.sync=(e,{force:r,dryRun:n,cwd:o=process.cwd(),...i}={})=>{i={expandDirectories:!1,onlyFiles:!1,followSymbolicLinks:!1,cwd:o,...i},e=eEe(e);let c=Yve.sync(e,i).sort((u,l)=>l.localeCompare(u)).map(u=>(u=Jve.resolve(o,u),r||Xve(u,o),n||Zve.sync(u,Qve),u));return c.sort((u,l)=>u.localeCompare(l)),c}});var iEe=A((Xdr,Bs)=>{"use strict";var MR=require("fs"),rEe=require("path"),Rgt=u0e(),nEe=$I(),Mgt=NI(),kgt=tEe(),$gt=require("stream"),{promisify:Ngt}=require("util"),Lgt=Ngt($gt.pipeline),{writeFile:Bgt}=MR.promises,oEe=(e="")=>rEe.join(nEe,e+Rgt()),jgt=async(e,r)=>Lgt(r,MR.createWriteStream(e)),IG=(e,{extraArguments:r=0}={})=>async(...n)=>{let[o,i]=n.slice(r),a=await e(...n.slice(0,r),i);try{return await o(a)}finally{await kgt(a,{force:!0})}};Bs.exports.file=e=>{if(e={...e},e.name){if(e.extension!==void 0&&e.extension!==null)throw new Error("The `name` and `extension` options are mutually exclusive");return rEe.join(Bs.exports.directory(),e.name)}return oEe()+(e.extension===void 0||e.extension===null?"":"."+e.extension.replace(/^\./,""))};Bs.exports.file.task=IG(Bs.exports.file);Bs.exports.directory=({prefix:e=""}={})=>{let r=oEe(e);return MR.mkdirSync(r),r};Bs.exports.directory.task=IG(Bs.exports.directory);Bs.exports.write=async(e,r)=>{let n=Bs.exports.file(r);return await(Mgt(e)?jgt:Bgt)(n,e),n};Bs.exports.write.task=IG(Bs.exports.write,{extraArguments:1});Bs.exports.writeSync=(e,r)=>{let n=Bs.exports.file(r);return MR.writeFileSync(n,e),n};Object.defineProperty(Bs.exports,"root",{get(){return nEe}})});var Di=A(RG=>{"use strict";RG.fromCallback=function(e){return Object.defineProperty(function(...r){if(typeof r[r.length-1]=="function")e.apply(this,r);else return new Promise((n,o)=>{r.push((i,a)=>i!=null?o(i):n(a)),e.apply(this,r)})},"name",{value:e.name})};RG.fromPromise=function(e){return Object.defineProperty(function(...r){let n=r[r.length-1];if(typeof n!="function")return e.apply(this,r);r.
GFS4: `),console.error(e)});io[Yi]||(dEe=global[Yi]||[],hEe(io,dEe),io.close=function(e){function r(n,o){return e.call(io,n,function(i){i||mEe(),typeof o=="function"&&o.apply(this,arguments)})}return Object.defineProperty(r,LR,{value:e}),r}(io.close),io.closeSync=function(e){function r(n){e.apply(io,arguments),mEe()}return Object.defineProperty(r,LR,{value:e}),r}(io.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Z0(io[Yi]),require("assert").equal(io[Yi].length,0)}));var dEe;global[Yi]||hEe(global,io[Yi]);NG.exports=kG(Jgt(io));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!io.__patched&&(NG.exports=kG(io),io.__patched=!0);function kG(e){zgt(e),e.gracefulify=kG,e.createReadStream=I,e.createWriteStream=k;var r=e.readFile;e.readFile=n;function n(B,H,N){return typeof H=="function"&&(N=H,H=null),Y(B,H,N);function Y(z,X,U,Z){return r(z,X,function(oe){oe&&(oe.code==="EMFILE"||oe.code==="ENFILE")?Vv([Y,[z,X,U],oe,Z||Date.now(),Date.now()]):typeof U=="function"&&U.apply(this,arguments)})}}var o=e.writeFile;e.writeFile=i;function i(B,H,N,Y){return typeof N=="function"&&(Y=N,N=null),z(B,H,N,Y);function z(X,U,Z,oe,se){return o(X,U,Z,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Vv([z,[X,U,Z,oe],le,se||Date.now(),Date.now()]):typeof oe=="function"&&oe.apply(this,arguments)})}}var a=e.appendFile;a&&(e.appendFile=c);function c(B,H,N,Y){return typeof N=="function"&&(Y=N,N=null),z(B,H,N,Y);function z(X,U,Z,oe,se){return a(X,U,Z,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Vv([z,[X,U,Z,oe],le,se||Date.now(),Date.now()]):typeof oe=="function"&&oe.apply(this,arguments)})}}var u=e.copyFile;u&&(e.copyFile=l);function l(B,H,N,Y){return typeof N=="function"&&(Y=N,N=0),z(B,H,N,Y);function z(X,U,Z,oe,se){return u(X,U,Z,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Vv([z,[X,U,Z,oe],le,se||Date.now(),Date.now()]):typeof oe=="function"&&oe.apply(this,arguments)})}}var p=e.readdir;e.readdir=g;var f=/^v[0-5]\./;function g(B,H,N){typeof H=="function"&&(N=H,H=null);var Y=f.test(process.version)?function(U,Z,oe,se){return p(U,z(U,Z,oe,se))}:function(U,Z,oe,se){return p(U,Z,z(U,Z,oe,se))};return Y(B,H,N);function z(X,U,Z,oe){return function(se,le){se&&(se.code==="EMFILE"||se.code==="ENFILE")?Vv([Y,[X,U,Z],se,oe||Date.now(),Date.now()]):(le&&le.sort&&le.sort(),typeof Z=="function"&&Z.call(this,se,le))}}}if(process.version.substr(0,4)==="v0.8"){var x=Kgt(e);D=x.ReadStream,C=x.WriteStream}var b=e.ReadStream;b&&(D.prototype=Object.create(b.prototype),D.prototype.open=P);var v=e.WriteStream;v&&(C.prototype=Object.create(v.prototype),C.prototype.open=O),Object.defineProperty(e,"ReadStream",{get:function(){return D},set:function(B){D=B},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return C},set:function(B){C=B},enumerable:!0,configurable:!0});var S=D;Object.defineProperty(e,"FileReadStream",{get:function(){return S},set:function(B){S=B},enumerable:!0,configurable:!0});var _=C;Object.defineProperty(e,"FileWriteStream",{get:function(){return _},set:function(B){_=B},enumerable:!0,configurable:!0});function D(B,H){return this instanceof D?(b.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function P(){var B=this;G(B.path,B.flags,B.mode,function(H,N){H?(B.autoClose&&B.destroy(),B.emit("error",H)):(B.fd=N,B.emit("open",N),B.read())})}function C(B,H){return this instanceof C?(v.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function O(){var B=this;G(B.path,B.flags,B.mode,function(H,N){H?(B.destroy(),B.emit("error",H)):(B.fd=N,B.emit("open",N))})}function I(B,H){return new e.ReadStream(B,H)}function k(B,H){return new e.WriteStream(B,H)}var j=e.open;e.open=G;function G(B,H,N,Y){return typeof N=="function"&&(Y=N,N=null),z(B,H,N,Y);function z(X,U,Z,oe,se){return j(X,U,Z,function(le,be){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Vv([z,[X,U,Z,oe],le,se||Date.now(),Date.now()]):typeof oe=="function"&&oe.apply(this,arguments)})}}return e}function Vv(e){Z0("ENQUEUE",e[0].name,e[1]),io[Yi].push(e),$G()}var NR;fu
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:o,destStat:i}=await pT.checkPaths(e,r,"copy",n);if(await pT.checkParentPaths(e,o,r,"copy"),!await IEe(e,r,n))return;let c=lT.dirname(r);await p0t(c)||await l0t(c),await REe(i,e,r,n)}async function IEe(e,r,n){return n.filter?n.filter(e,r):!0}async function REe(e,r,n,o){let a=await(o.dereference?xs.stat:xs.lstat)(r);if(a.isDirectory())return y0t(a,e,r,n,o);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return m0t(a,e,r,n,o);if(a.isSymbolicLink())return x0t(e,r,n,o);throw a.isSocket()?new Error(`Cannot copy a socket file: ${r}`):a.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${r}`):new Error(`Unknown file: ${r}`)}async function m0t(e,r,n,o,i){if(!r)return FEe(e,n,o,i);if(i.overwrite)return await xs.unlink(o),FEe(e,n,o,i);if(i.errorOnExist)throw new Error(`'${o}' already exists`)}async function FEe(e,r,n,o){if(await xs.copyFile(r,n),o.preserveTimestamps){h0t(e.mode)&&await g0t(n,e.mode);let i=await xs.stat(r);await f0t(n,i.atime,i.mtime)}return xs.chmod(n,e.mode)}function h0t(e){return(e&128)===0}function g0t(e,r){return xs.chmod(e,r|128)}async function y0t(e,r,n,o,i){r||await xs.mkdir(o);let a=[];for await(let c of await xs.opendir(n)){let u=lT.join(n,c.name),l=lT.join(o,c.name);a.push(IEe(u,l,i).then(p=>{if(p)return pT.checkPaths(u,l,"copy",i).then(({destStat:f})=>REe(f,u,l,i))}))}await Promise.all(a),r||await xs.chmod(o,e.mode)}async function x0t(e,r,n,o){let i=await xs.readlink(r);if(o.dereference&&(i=lT.resolve(process.cwd(),i)),!e)return xs.symlink(i,n);let a=null;try{a=await xs.readlink(n)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return xs.symlink(i,n);throw c}if(o.dereference&&(a=lT.resolve(process.cwd(),a)),pT.isSrcSubdir(i,a))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${a}'.`);if(pT.isSrcSubdir(a,i))throw new Error(`Cannot overwrite '${a}' with '${i}'.`);return await xs.unlink(n),xs.symlink(i,n)}MEe.exports=d0t});var jEe=A((ymr,BEe)=>{"use strict";var qs=zv(),fT=require("path"),b0t=nl().mkdirsSync,v0t=UG().utimesMillisSync,dT=Q0();function E0t(e,r,n){typeof n=="function"&&(n={filter:n}),n=n||{},n.clobber="clobber"in n?!!n.clobber:!0,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:o,destStat:i}=dT.checkPathsSync(e,r,"copy",n);if(dT.checkParentPathsSync(e,o,r,"copy"),n.filter&&!n.filter(e,r))return;let a=fT.dirname(r);return qs.existsSync(a)||b0t(a),$Ee(i,e,r,n)}function $Ee(e,r,n,o){let a=(o.dereference?qs.statSync:qs.lstatSync)(r);if(a.isDirectory())return A0t(a,e,r,n,o);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return w0t(a,e,r,n,o);if(a.isSymbolicLink())return F0t(e,r,n,o);throw a.isSocket()?new Error(`Cannot copy a socket file: ${r}`):a.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${r}`):new Error(`Unknown file: ${r}`)}function w0t(e,r,n,o,i){return r?S0t(e,n,o,i):NEe(e,n,o,i)}function S0t(e,r,n,o){if(o.overwrite)return qs.unlinkSync(n),NEe(e,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}function NEe(e,r,n,o){return qs.copyFileSync(r,n),o.preserveTimestamps&&_0t(e.mode,r,n),GG(n,e.mode)}function _0t(e,r,n){return T0t(e)&&D0t(n,e),C0t(r,n)}function T0t(e){return(e&128)===0}function D0t(e,r){return GG(e,r|128)}function GG(e,r){return qs.chmodSync(e,r)}function C0t(e,r){let n=qs.statSync(e);return v0t(r,n.atime,n.mtime)}function A0t(e,r,n,o,i){return r?LEe(n,o,i):P0t(e.mode,n,o,i)}function P0t(e,r,n,o){return qs.mkdirSync(n),LEe(r,n,o),GG(n,e)}function LEe(e,r,n){let o=qs.opendirSync(e);try{let i;for(;(i=o.readSync())!==null;)O0t(i.name,e,r,n)}finally{o.closeSync()}}function O0t(e,r,n,o){let i=fT.join(r,e),a=fT.join(n,e);if(o.filter&&!o.filter(i,a))return;let{destStat:c}=dT.checkPathsSync(i,a,"copy",o);return $Ee(c,i,a,o)}function F0t(e,r,n,o){let i=qs.readlinkSync(r);if(o.dereference&&(i=fT.resolve(process.cwd(),i)),e){let a;try{a=qs.readlinkSync(n)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return qs.symlinkSync(i,n);throw c}if(o.dereference&&(a=fT.resolve(process.cwd(),a)),dT.isSrcSubdir(i,a))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${a}'.`);if(dT.isSrcSubdir(a,i))throw new Error(`Cannot overwrite '${a}' with '${i}'.`);return I0t(i,n)}else return qs.symlinkSync(i,n)}function I0t(e,r){return qs.unlinkSync(r),qs.symlinkSync(e,r)}BEe.exports=E0t});var jR=A((xmr,UEe)=>{"use strict";var R0t=Di().fromPromise;UEe.exports={copy:R0t(kEe()),copySync:jEe()}});var mT=A((bmr,GEe)=>{"use strict";var qEe=zv(),M0t=Di().fromCallback;function k0t(e,r){qEe.rm(e,{recursive:!0,force:!0},r)}function $0t(e){qEe.rmSync(e,{recursive:!0,force:!0})}GEe.exports={remove:M0t(k0t),removeSync:$0t}});var ZEe=A((vmr,YEe)=>{"use strict";var N0t=Di().fromPromise,VEe=Us(),zEe=require("path"),KEe=nl(),JEe=mT(),HEe=N0t(async function(r){let n;try{n=await VEe.readdir(r)}catch{return KEe.mkdirs(r)}return Promise.all(n.map(o=>JEe.remove(zEe.join(r,o))))});function WEe(e){let r;try{r=VEe.readdirSync(e)}catch{return KEe.mkdirsSync(e)}r.forEach(n=>{n=zEe.join(e,n),JEe.removeSync(n)})}YEe.exports={emptyDirSync:WEe,emptydirSync:WEe,emptyDir:HEe,emptydir:HEe}});var twe=A((Emr,ewe)=>{"use strict";var L0t=Di().fromPromise,QEe=require("path"),Hf=Us(),XEe=nl();async function B0t(e){let r;try{r=await Hf.stat(e)}catch{}if(r&&r.isFile())return;let n=QEe.dirname(e),o=null;try{o=await Hf.stat(n)}catch(i){if(i.code==="ENOENT"){await XEe.mkdirs(n),await Hf.writeFile(e,"");return}else throw i}o.isDirectory()?await Hf.writeFile(e,""):await Hf.readdir(n)}function j0t(e){let r;try{r=Hf.statSync(e)}catch{}if(r&&r.isFile())return;let n=QEe.dirname(e);try{Hf.statSync(n).isDirectory()||Hf.readdirSync(n)}catch(o){if(o&&o.code==="ENOENT")XEe.mkdirsSync(n);else throw o}Hf.writeFileSync(e,"")}ewe.exports={createFile:L0t(B0t),createFileSync:j0t}});var swe=A((wmr,iwe)=>{"use strict";var U0t=Di().fromPromise,rwe=require("path"),hh=Us(),nwe=nl(),{pathExists:q0t}=mh(),{areIdentical:owe}=Q0();async function G0t(e,r){let n;try{n=await hh.lstat(r)}catch{}let o;try{o=await hh.lstat(e)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(n&&owe(o,n))return;let i=rwe.dirname(r);await q0t(i)||await nwe.mkdirs(i),await hh.link(e,r)}function H0t(e,r){let n;try{n=hh.lstatSync(r)}catch{}try{l
`,finalEOL:n=!0,replacer:o=null,spaces:i}={}){let a=n?r:"";return JSON.stringify(e,o,i).replace(/\n/g,r)+a}function uyt(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}_we.exports={stringify:cyt,stripBom:uyt}});var Awe=A((Amr,Cwe)=>{"use strict";var Yv;try{Yv=zv()}catch{Yv=require("fs")}var qR=Di(),{stringify:Twe,stripBom:Dwe}=UR();async function lyt(e,r={}){typeof r=="string"&&(r={encoding:r});let n=r.fs||Yv,o="throws"in r?r.throws:!0,i=await qR.fromCallback(n.readFile)(e,r);i=Dwe(i);let a;try{a=JSON.parse(i,r?r.reviver:null)}catch(c){if(o)throw c.message=`${e}: ${c.message}`,c;return null}return a}var pyt=qR.fromPromise(lyt);function fyt(e,r={}){typeof r=="string"&&(r={encoding:r});let n=r.fs||Yv,o="throws"in r?r.throws:!0;try{let i=n.readFileSync(e,r);return i=Dwe(i),JSON.parse(i,r.reviver)}catch(i){if(o)throw i.message=`${e}: ${i.message}`,i;return null}}async function dyt(e,r,n={}){let o=n.fs||Yv,i=Twe(r,n);await qR.fromCallback(o.writeFile)(e,i,n)}var myt=qR.fromPromise(dyt);function hyt(e,r,n={}){let o=n.fs||Yv,i=Twe(r,n);return o.writeFileSync(e,i,n)}var gyt={readFile:pyt,readFileSync:fyt,writeFile:myt,writeFileSync:hyt};Cwe.exports=gyt});var Owe=A((Pmr,Pwe)=>{"use strict";var GR=Awe();Pwe.exports={readJson:GR.readFile,readJsonSync:GR.readFileSync,writeJson:GR.writeFile,writeJsonSync:GR.writeFileSync}});var HR=A((Omr,Rwe)=>{"use strict";var yyt=Di().fromPromise,HG=Us(),Fwe=require("path"),Iwe=nl(),xyt=mh().pathExists;async function byt(e,r,n="utf-8"){let o=Fwe.dirname(e);return await xyt(o)||await Iwe.mkdirs(o),HG.writeFile(e,r,n)}function vyt(e,...r){let n=Fwe.dirname(e);HG.existsSync(n)||Iwe.mkdirsSync(n),HG.writeFileSync(e,...r)}Rwe.exports={outputFile:yyt(byt),outputFileSync:vyt}});var kwe=A((Fmr,Mwe)=>{"use strict";var{stringify:Eyt}=UR(),{outputFile:wyt}=HR();async function Syt(e,r,n={}){let o=Eyt(r,n);await wyt(e,o,n)}Mwe.exports=Syt});var Nwe=A((Imr,$we)=>{"use strict";var{stringify:_yt}=UR(),{outputFileSync:Tyt}=HR();function Dyt(e,r,n){let o=_yt(r,n);Tyt(e,o,n)}$we.exports=Dyt});var Bwe=A((Rmr,Lwe)=>{"use strict";var Cyt=Di().fromPromise,Gs=Owe();Gs.outputJson=Cyt(kwe());Gs.outputJsonSync=Nwe();Gs.outputJSON=Gs.outputJson;Gs.outputJSONSync=Gs.outputJsonSync;Gs.writeJSON=Gs.writeJson;Gs.writeJSONSync=Gs.writeJsonSync;Gs.readJSON=Gs.readJson;Gs.readJSONSync=Gs.readJsonSync;Lwe.exports=Gs});var Hwe=A((Mmr,Gwe)=>{"use strict";var Ayt=Us(),jwe=require("path"),{copy:Pyt}=jR(),{remove:qwe}=mT(),{mkdirp:Oyt}=nl(),{pathExists:Fyt}=mh(),Uwe=Q0();async function Iyt(e,r,n={}){let o=n.overwrite||n.clobber||!1,{srcStat:i,isChangingCase:a=!1}=await Uwe.checkPaths(e,r,"move",n);await Uwe.checkParentPaths(e,i,r,"move");let c=jwe.dirname(r);return jwe.parse(c).root!==c&&await Oyt(c),Ryt(e,r,o,a)}async function Ryt(e,r,n,o){if(!o){if(n)await qwe(r);else if(await Fyt(r))throw new Error("dest already exists.")}try{await Ayt.rename(e,r)}catch(i){if(i.code!=="EXDEV")throw i;await Myt(e,r,n)}}async function Myt(e,r,n){return await Pyt(e,r,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),qwe(e)}Gwe.exports=Iyt});var Jwe=A((kmr,Kwe)=>{"use strict";var Vwe=zv(),VG=require("path"),kyt=jR().copySync,zwe=mT().removeSync,$yt=nl().mkdirpSync,Wwe=Q0();function Nyt(e,r,n){n=n||{};let o=n.overwrite||n.clobber||!1,{srcStat:i,isChangingCase:a=!1}=Wwe.checkPathsSync(e,r,"move",n);return Wwe.checkParentPathsSync(e,i,r,"move"),Lyt(r)||$yt(VG.dirname(r)),Byt(e,r,o,a)}function Lyt(e){let r=VG.dirname(e);return VG.parse(r).root===r}function Byt(e,r,n,o){if(o)return WG(e,r,n);if(n)return zwe(r),WG(e,r,n);if(Vwe.existsSync(r))throw new Error("dest already exists.");return WG(e,r,n)}function WG(e,r,n){try{Vwe.renameSync(e,r)}catch(o){if(o.code!=="EXDEV")throw o;return jyt(e,r,n)}}function jyt(e,r,n){return kyt(e,r,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),zwe(e)}Kwe.exports=Nyt});var Zwe=A(($mr,Ywe)=>{"use strict";var Uyt=Di().fromPromise;Ywe.exports={move:Uyt(Hwe()),moveSync:Jwe()}});var yh=A((Nmr,Qwe)=>{"use strict";Qwe.exports={...Us(),...jR(),...ZEe(),...Swe(),...Bwe(),...nl(),...Zwe(),...HR(),...mh(
Content-Disposition: form-data; name="`;return e.forEach((a,c)=>typeof a=="string"?o.push(i+iH(c)+`"\r
\r
${a.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
`)}\r
`):o.push(i+iH(c)+`"; filename="${iH(a.name,1)}"\r
Content-Type: ${a.type||"application/octet-stream"}\r
\r
`,a,`\r
`)),o.push(`--${n}--`),new r(o,{type:"multipart/form-data; boundary="+n})}var ET,uxt,lxt,FSe,pxt,ISe,iH,ey,ty,YR=ct(()=>{"use strict";vT();oH();({toStringTag:ET,iterator:uxt,hasInstance:lxt}=Symbol),FSe=Math.random,pxt="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),ISe=(e,r,n)=>(e+="",/^(Blob|File)$/.test(r&&r[ET])?[(n=n!==void 0?n+"":r[ET]=="File"?r.name:"blob",e),r.name!==n||r[ET]=="blob"?new Xv([r],n,r):r]:[e,r+""]),iH=(e,r)=>(r?e:e.replace(/\r?\n|\r/g,`\r
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),ey=(e,r,n)=>{if(r.length<n)throw new TypeError(`Failed to execute '${e}' on 'FormData': ${n} arguments required, but only ${r.length} present.`)},ty=class{#e=[];constructor(...r){if(r.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[ET](){return"FormData"}[uxt](){return this.entries()}static[lxt](r){return r&&typeof r=="object"&&r[ET]==="FormData"&&!pxt.some(n=>typeof r[n]!="function")}append(...r){ey("append",arguments,2),this.#e.push(ISe(...r))}delete(r){ey("delete",arguments,1),r+="",this.#e=this.#e.filter(([n])=>n!==r)}get(r){ey("get",arguments,1),r+="";for(var n=this.#e,o=n.length,i=0;i<o;i++)if(n[i][0]===r)return n[i][1];return null}getAll(r,n){return ey("getAll",arguments,1),n=[],r+="",this.#e.forEach(o=>o[0]===r&&n.push(o[1])),n}has(r){return ey("has",arguments,1),r+="",this.#e.some(n=>n[0]===r)}forEach(r,n){ey("forEach",arguments,1);for(var[o,i]of this)r.call(n,i,o,this)}set(...r){ey("set",arguments,2);var n=[],o=!0;r=ISe(...r),this.#e.forEach(i=>{i[0]===r[0]?o&&(o=!n.push(r)):n.push(i)}),o&&n.push(r),this.#e=n}*entries(){yield*this.#e}*keys(){for(var[r]of this)yield r}*values(){for(var[,r]of this)yield r}}});var LSe=A((Ihr,NSe)=>{"use strict";if(!globalThis.DOMException)try{let{MessageChannel:e}=require("worker_threads"),r=new e().port1,n=new ArrayBuffer;r.postMessage(n,[n,n])}catch(e){e.constructor.name==="DOMException"&&(globalThis.DOMException=e.constructor)}NSe.exports=globalThis.DOMException});var QR,fxt,khr,aH=ct(()=>{"use strict";QR=require("node:fs"),fxt=W(LSe(),1);oH();vT();({stat:khr}=QR.promises)});var jSe={};Ja(jSe,{toFormData:()=>bxt});function xxt(e){let r=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!r)return;let n=r[2]||r[3]||"",o=n.slice(n.lastIndexOf("\\")+1);return o=o.replace(/%22/g,'"'),o=o.replace(/&#(\d{4});/g,(i,a)=>String.fromCharCode(a)),o}async function bxt(e,r){if(!/multipart/i.test(r))throw new TypeError("Failed to fetch");let n=r.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");let o=new cH(n[1]||n[2]),i,a,c,u,l,p,f=[],g=new ty,x=D=>{c+=_.decode(D,{stream:!0})},b=D=>{f.push(D)},v=()=>{let D=new Xv(f,p,{type:l});g.append(u,D)},S=()=>{g.append(u,c)},_=new TextDecoder("utf-8");_.decode(),o.onPartBegin=function(){o.onPartData=x,o.onPartEnd=S,i="",a="",c="",u="",l="",p=null,f.length=0},o.onHeaderField=function(D){i+=_.decode(D,{stream:!0})},o.onHeaderValue=function(D){a+=_.decode(D,{stream:!0})},o.onHeaderEnd=function(){if(a+=_.decode(),i=i.toLowerCase(),i==="content-disposition"){let D=a.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);D&&(u=D[2]||D[3]||""),p=xxt(a),p&&(o.onPartData=b,o.onPartEnd=v)}else i==="content-type"&&(l=a);a="",i=""};for await(let D of e)o.write(D);return o.end(),g}var wp,vn,BSe,bh,XR,eM,dxt,ST,mxt,hxt,gxt,yxt,ry,cH,USe=ct(()=>{"use strict";aH();YR();wp=0,vn={START_BOUNDARY:wp++,HEADER_FIELD_START:wp++,HEADER_FIELD:wp++,HEADER_VALUE_START:wp++,HEADER_VALUE:wp++,HEADER_VALUE_ALMOST_DONE:wp++,HEADERS_ALMOST_DONE:wp++,PART_DATA_START:wp++,PART_DATA:wp++,END:wp++},BSe=1,bh={PART_BOUNDARY:BSe,LAST_BOUNDARY:BSe*=2},XR=10,eM=13,dxt=32,ST=45,mxt=58,hxt=97,gxt=122,yxt=e=>e|32,ry=()=>{},cH=class{constructor(r){this.index=0,this.flags=0,this.onHeaderEnd=ry,this.onHeaderField=ry,this.onHeadersEnd=ry,this.onHeaderValue=ry,this.onPartBegin=ry,this.onPartData=ry,this.onPartEnd=ry,this.boundaryChars={},r=`\r
--`+r;let n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o),this.boundaryChars[n[o]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=vn.START_BOUNDARY}write(r){let n=0,o=r.length,i=this.index,{lookbehind:a,boundary:c,boundaryChars:u,index:l,state:p,flags:f}=this,g=this.boundary.length,x=g-1,b=r.length,v,S,_=O=>{this[O+"Mark"]=n},D=O=>{delete this[O+"Mark"]},P=(O,I,k,j)=>{(I===void 0||I!==k)&&this[O](j&&j.subarray(I,k))},C=(O,I)=>{let k=O+"Mark";k in this&&(I?(P(O,this[k],n,r),delete this[k]):(P(O,this[k],r.length,r),this[k]=0))};for(n=0;n<o;n++)switch(v=r[n],p){case vn.START_BOUNDARY:if(l===c.length-2){if(v===ST)f|=bh.LAST_BOUNDARY;else if(v!==eM)return;l++;break}else if(l-1===c.length-2){if(f&bh.LAST_BOUNDARY&&v===ST)p=vn.END,f=0;else if(!(f&bh.LAST_BOUNDARY)&&v===XR)l=0,P("onPartBegin"),p=vn.HEADER_FIELD_START;else return;break}v!==c[l+2]&&(l=-2),v===c[l+2]&&l++;break;case vn.HEADER_FIELD_START:p=vn.HEADER_FIELD,_("onHeaderField"),l=0;case vn.HEADER_FIELD:if(v===eM){D("onHeaderField"),p=vn.HEADERS_ALMOST_DONE;break}if(l++,v===ST)break;if(v===mxt){if(l===1)return;C("onHeaderField",!0),p=vn.HEADER_VALUE_START;break}if(S=yxt(v),S<hxt||S>gxt)return;break;case vn.HEADER_VALUE_START:if(v===dxt)break;_("onHeaderValue"),p=vn.HEADER_VALUE;case vn.HEADER_VALUE:v===eM&&(C("onHeaderValue",!0),P("onHeaderEnd"),p=vn.HEADER_VALUE_ALMOST_DONE);break;case vn.HEADER_VALUE_ALMOST_DONE:if(v!==XR)return;p=vn.HEADER_FIELD_START;break;case vn.HEADERS_ALMOST_DONE:if(v!==XR)return;P("onHeadersEnd"),p=vn.PART_DATA_START;break;case vn.PART_DATA_START:p=vn.PART_DATA,_("onPartData");case vn.PART_DATA:if(i=l,l===0){for(n+=x;n<b&&!(r[n]in u);)n+=g;n-=x,v=r[n]}if(l<c.length)c[l]===v?(l===0&&C("onPartData",!0),l++):l=0;else if(l===c.length)l++,v===eM?f|=bh.PART_BOUNDARY:v===ST?f|=bh.LAST_BOUNDARY:l=0;else if(l-1===c.length)if(f&bh.PART_BOUNDARY){if(l=0,v===XR){f&=~bh.PART_BOUNDARY,P("onPartEnd"),P("onPartBegin"),p=vn.HEADER_FIELD_START;break}}else f&bh.LAST_BOUNDARY&&v===ST?(P("onPartEnd"),p=vn.END,f=0):l=0;if(l>0)a[l-1]=v;else if(i>0){let O=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);P("onPartData",0,i,O),i=0,_("onPartData"),n--}break;case vn.END:break;default:throw new Error(`Unexpected state entered: ${p}`)}C("onHeaderField"),C("onHeaderValue"),C("onPartData"),this.index=l,this.state=p,this.flags=f}end(){if(this.state===vn.HEADER_FIELD_START&&this.index===0||this.state===vn.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==vn.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});var i1e=A((_gr,o1e)=>{"use strict";function Zc(e,r){typeof r=="boolean"&&(r={forever:r}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=r||{},this._maxRetryTime=r&&r.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}o1e.exports=Zc;Zc.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Zc.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Zc.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var r=new Date().getTime();if(e&&r-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var o=this;return this._timer=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},n),this._options.unref&&this._timer.unref(),!0};Zc.prototype.attempt=f
`).join(`
`+a),e.push(i+"m+"+fM.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Qxt()+r+" "+e[0]}function Qxt(){return Pi.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Xxt(...e){return process.stderr.write(pM.formatWithOptions(Pi.inspectOpts,...e)+`
`)}function ebt(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function tbt(){return process.env.DEBUG}function rbt(e){e.inspectOpts={};let r=Object.keys(Pi.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=Pi.inspectOpts[r[n]]}fM.exports=fH()(Pi);var{formatters:x1e}=fM.exports;x1e.o=function(e){return this.inspectOpts.colors=this.useColors,pM.inspect(e,this.inspectOpts).split(`
`).map(r=>r.trim()).join(" ")};x1e.O=function(e){return this.inspectOpts.colors=this.useColors,pM.inspect(e,this.inspectOpts)}});var dM=A((Ogr,hH)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?hH.exports=m1e():hH.exports=b1e()});var w1e=A(ma=>{"use strict";var nbt=ma&&ma.__createBinding||(Object.create?function(e,r,n,o){o===void 0&&(o=n);var i=Object.getOwnPropertyDescriptor(r,n);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,o,i)}:function(e,r,n,o){o===void 0&&(o=n),e[o]=r[n]}),obt=ma&&ma.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),v1e=ma&&ma.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&nbt(r,e,n);return obt(r,e),r};Object.defineProperty(ma,"__esModule",{value:!0});ma.req=ma.json=ma.toBuffer=void 0;var ibt=v1e(require("http")),sbt=v1e(require("https"));async function E1e(e){let r=0,n=[];for await(let o of e)r+=o.length,n.push(o);return Buffer.concat(n,r)}ma.toBuffer=E1e;async function abt(e){let n=(await E1e(e)).toString("utf8");try{return JSON.parse(n)}catch(o){let i=o;throw i.message+=` (input: ${n})`,i}}ma.json=abt;function cbt(e,r={}){let o=((typeof e=="string"?e:e.href).startsWith("https:")?sbt:ibt).request(e,r),i=new Promise((a,c)=>{o.once("response",a).once("error",c).end()});return o.then=i.then.bind(i),o}ma.req=cbt});var T1e=A(cc=>{"use strict";var _1e=cc&&cc.__createBinding||(Object.create?function(e,r,n,o){o===void 0&&(o=n);var i=Object.getOwnPropertyDescriptor(r,n);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,o,i)}:function(e,r,n,o){o===void 0&&(o=n),e[o]=r[n]}),ubt=cc&&cc.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),lbt=cc&&cc.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&_1e(r,e,n);return ubt(r,e),r},pbt=cc&&cc.__exportStar||function(e,r){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(r,n)&&_1e(r,e,n)};Object.defineProperty(cc,"__esModule",{value:!0});cc.Agent=void 0;var S1e=lbt(require("http"));pbt(w1e(),cc);var _p=Symbol("AgentBaseInternalState"),gH=class extends S1e.Agent{constructor(r){super(r),this[_p]={}}isSecureEndpoint(r){if(r){if(typeof r.secureEndpoint=="boolean")return r.secureEndpoint;if(typeof r.protocol=="string")return r.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
`).some(o=>o.indexOf("(https.js:")!==-1||o.indexOf("node:https:")!==-1)}createSocket(r,n,o){let i={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(r,i)).then(a=>{if(a instanceof S1e.Agent)return a.addRequest(r,i);this[_p].currentSocket=a,super.createSocket(r,n,o)},o)}createConnection(){let r=this[_p].currentSocket;if(this[_p].currentSocket=void 0,!r)throw new Error("No socket was returned in the `connect()` function");return r}get defaultPort(){return this[_p].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(r){this[_p]&&(this[_p].defaultPort=r)}get protocol(){return this[_p].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(r){this[_p]&&(this[_p].protocol=r)}};cc.Agent=gH});var A1e=A(Xc=>{"use strict";var fbt=Xc&&Xc.__createBinding||(Object.create?function(e,r,n,o){o===void 0&&(o=n);var i=Object.getOwnPropertyDescriptor(r,n);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,o,i)}:function(e,r,n,o){o===void 0&&(o=n),e[o]=r[n]}),dbt=Xc&&Xc.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),C1e=Xc&&Xc.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&fbt(r,e,n);return dbt(r,e),r},mbt=Xc&&Xc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xc,"__esModule",{value:!0});Xc.HttpProxyAgent=void 0;var hbt=C1e(require("net")),gbt=C1e(require("tls")),ybt=mbt(dM()),xbt=require("events"),bbt=T1e(),D1e=require("url"),iE=(0,ybt.default)("http-proxy-agent"),mM=class extends bbt.Agent{constructor(r,n){super(n),this.proxy=typeof r=="string"?new D1e.URL(r):r,this.proxyHeaders=n?.headers??{},iE("Creating new HttpProxyAgent instance: %o",this.proxy.href);let o=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...n?vbt(n,"headers"):null,host:o,port:i}}addRequest(r,n){r._header=null,this.setRequestProps(r,n),super.addRequest(r,n)}setRequestProps(r,n){let{proxy:o}=this,i=n.secureEndpoint?"https:":"http:",a=r.getHeader("host")||"localhost",c=`${i}//${a}`,u=new D1e.URL(r.path,c);n.port!==80&&(u.port=String(n.port)),r.path=String(u);let l=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(o.username||o.password){let p=`${decodeURIComponent(o.username)}:${decodeURIComponent(o.password)}`;l["Proxy-Authorization"]=`Basic ${Buffer.from(p).toString("base64")}`}l["Proxy-Connection"]||(l["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let p of Object.keys(l)){let f=l[p];f&&r.setHeader(p,f)}}async connect(r,n){r._header=null,r.path.includes("://")||this.setRequestProps(r,n);let o,i;iE("Regenerating stored HTTP header string for request"),r._implicitHeader(),r.outputData&&r.outputData.length>0&&(iE("Patching connection write() output buffer with updated header"),o=r.outputData[0].data,i=o.indexOf(`\r
\r
`)+4,r.outputData[0].data=r._header+o.substring(i),iE("Output buffer: %o",r.outputData[0].data));let a;return this.proxy.protocol==="https:"?(iE("Creating `tls.Socket`: %o",this.connectOpts),a=gbt.connect(this.connectOpts)):(iE("Creating `net.Socket`: %o",this.connectOpts),a=hbt.connect(this.connectOpts)),await(0,xbt.once)(a,"connect"),a}};mM.protocols=["http","https"];Xc.HttpProxyAgent=mM;function vbt(e,...r){let n={},o;for(o in e)r.includes(o)||(n[o]=e[o]);return n}});var F1e=A(ha=>{"use strict";var Ebt=ha&&ha.__createBinding||(Object.create?function(e,r,n,o){o===void 0&&(o=n);var i=Object.getOwnPropertyDescriptor(r,n);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,o,i)}:function(e,r,n,o){o===void 0&&(o=n),e[o]=r[n]}),wbt=ha&&ha.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),P1e=ha&&ha.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Ebt(r,e,n);return wbt(r,e),r};Object.defineProperty(ha,"__esModule",{value:!0});ha.req=ha.json=ha.toBuffer=void 0;var Sbt=P1e(require("http")),_bt=P1e(require("https"));async function O1e(e){let r=0,n=[];for await(let o of e)r+=o.length,n.push(o);return Buffer.concat(n,r)}ha.toBuffer=O1e;async function Tbt(e){let n=(await O1e(e)).toString("utf8");try{return JSON.parse(n)}catch(o){let i=o;throw i.message+=` (input: ${n})`,i}}ha.json=Tbt;function Dbt(e,r={}){let o=((typeof e=="string"?e:e.href).startsWith("https:")?_bt:Sbt).request(e,r),i=new Promise((a,c)=>{o.once("response",a).once("error",c).end()});return o.then=i.then.bind(i),o}ha.req=Dbt});var k1e=A(uc=>{"use strict";var R1e=uc&&uc.__createBinding||(Object.create?function(e,r,n,o){o===void 0&&(o=n);var i=Object.getOwnPropertyDescriptor(r,n);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,o,i)}:function(e,r,n,o){o===void 0&&(o=n),e[o]=r[n]}),Cbt=uc&&uc.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),M1e=uc&&uc.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&R1e(r,e,n);return Cbt(r,e),r},Abt=uc&&uc.__exportStar||function(e,r){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(r,n)&&R1e(r,e,n)};Object.defineProperty(uc,"__esModule",{value:!0});uc.Agent=void 0;var Pbt=M1e(require("net")),I1e=M1e(require("http")),Obt=require("https");Abt(F1e(),uc);var Tp=Symbol("AgentBaseInternalState"),yH=class extends I1e.Agent{constructor(r){super(r),this[Tp]={}}isSecureEndpoint(r){if(r){if(typeof r.secureEndpoint=="boolean")return r.secureEndpoint;if(typeof r.protocol=="string")return r.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
`).some(o=>o.indexOf("(https.js:")!==-1||o.indexOf("node:https:")!==-1)}incrementSockets(r){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[r]||(this.sockets[r]=[]);let n=new Pbt.Socket({writable:!1});return this.sockets[r].push(n),this.totalSocketCount++,n}decrementSockets(r,n){if(!this.sockets[r]||n===null)return;let o=this.sockets[r],i=o.indexOf(n);i!==-1&&(o.splice(i,1),this.totalSocketCount--,o.length===0&&delete this.sockets[r])}getName(r){return(typeof r.secureEndpoint=="boolean"?r.secureEndpoint:this.isSecureEndpoint(r))?Obt.Agent.prototype.getName.call(this,r):super.getName(r)}createSocket(r,n,o){let i={...n,secureEndpoint:this.isSecureEndpoint(n)},a=this.getName(i),c=this.incrementSockets(a);Promise.resolve().then(()=>this.connect(r,i)).then(u=>{if(this.decrementSockets(a,c),u instanceof I1e.Agent)try{return u.addRequest(r,i)}catch(l){return o(l)}this[Tp].currentSocket=u,super.createSocket(r,n,o)},u=>{this.decrementSockets(a,c),o(u)})}createConnection(){let r=this[Tp].currentSocket;if(this[Tp].currentSocket=void 0,!r)throw new Error("No socket was returned in the `connect()` function");return r}get defaultPort(){return this[Tp].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(r){this[Tp]&&(this[Tp].defaultPort=r)}get protocol(){return this[Tp].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(r){this[Tp]&&(this[Tp].protocol=r)}};uc.Agent=yH});var $1e=A(sE=>{"use strict";var Fbt=sE&&sE.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sE,"__esModule",{value:!0});sE.parseProxyResponse=void 0;var Ibt=Fbt(dM()),hM=(0,Ibt.default)("https-proxy-agent:parse-proxy-response");function Rbt(e){return new Promise((r,n)=>{let o=0,i=[];function a(){let f=e.read();f?p(f):e.once("readable",a)}function c(){e.removeListener("end",u),e.removeListener("error",l),e.removeListener("readable",a)}function u(){c(),hM("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function l(f){c(),hM("onerror %o",f),n(f)}function p(f){i.push(f),o+=f.length;let g=Buffer.concat(i,o),x=g.indexOf(`\r
\r
`);if(x===-1){hM("have not received end of HTTP headers yet..."),a();return}let b=g.slice(0,x).toString("ascii").split(`\r
`),v=b.shift();if(!v)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));let S=v.split(" "),_=+S[1],D=S.slice(2).join(" "),P={};for(let C of b){if(!C)continue;let O=C.indexOf(":");if(O===-1)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${C}"`));let I=C.slice(0,O).toLowerCase(),k=C.slice(O+1).trimStart(),j=P[I];typeof j=="string"?P[I]=[j,k]:Array.isArray(j)?j.push(k):P[I]=k}hM("got proxy server response: %o %o",v,P),c(),r({connect:{statusCode:_,statusText:D,headers:P},buffered:g})}e.on("error",l),e.on("end",u),a()})}sE.parseProxyResponse=Rbt});var q1e=A(eu=>{"use strict";var Mbt=eu&&eu.__createBinding||(Object.create?function(e,r,n,o){o===void 0&&(o=n);var i=Object.getOwnPropertyDescriptor(r,n);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,o,i)}:function(e,r,n,o){o===void 0&&(o=n),e[o]=r[n]}),kbt=eu&&eu.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),j1e=eu&&eu.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Mbt(r,e,n);return kbt(r,e),r},U1e=eu&&eu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(eu,"__esModule",{value:!0});eu.HttpsProxyAgent=void 0;var gM=j1e(require("net")),N1e=j1e(require("tls")),$bt=U1e(require("assert")),Nbt=U1e(dM()),Lbt=k1e(),Bbt=require("url"),jbt=$1e(),CT=(0,Nbt.default)("https-proxy-agent"),L1e=e=>e.servername===void 0&&e.host&&!gM.isIP(e.host)?{...e,servername:e.host}:e,yM=class extends Lbt.Agent{constructor(r,n){super(n),this.options={path:void 0},this.proxy=typeof r=="string"?new Bbt.URL(r):r,this.proxyHeaders=n?.headers??{},CT("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let o=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?B1e(n,"headers"):null,host:o,port:i}}async connect(r,n){let{proxy:o}=this;if(!n.host)throw new TypeError('No "host" provided');let i;o.protocol==="https:"?(CT("Creating `tls.Socket`: %o",this.connectOpts),i=N1e.connect(L1e(this.connectOpts))):(CT("Creating `net.Socket`: %o",this.connectOpts),i=gM.connect(this.connectOpts));let a=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=gM.isIPv6(n.host)?`[${n.host}]`:n.host,u=`CONNECT ${c}:${n.port} HTTP/1.1\r
`;if(o.username||o.password){let x=`${decodeURIComponent(o.username)}:${decodeURIComponent(o.password)}`;a["Proxy-Authorization"]=`Basic ${Buffer.from(x).toString("base64")}`}a.Host=`${c}:${n.port}`,a["Proxy-Connection"]||(a["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let x of Object.keys(a))u+=`${x}: ${a[x]}\r
`;let l=(0,jbt.parseProxyResponse)(i);i.write(`${u}\r
`);let{connect:p,buffered:f}=await l;if(r.emit("proxyConnect",p),this.emit("proxyConnect",p,r),p.statusCode===200)return r.once("socket",Ubt),n.secureEndpoint?(CT("Upgrading socket connection to TLS"),N1e.connect({...B1e(L1e(n),"host","path","port"),socket:i})):i;i.destroy();let g=new gM.Socket({writable:!1});return g.readable=!0,r.once("socket",x=>{CT("Replaying proxy buffer for failed request"),(0,$bt.default)(x.listenerCount("data")>0),x.push(f),x.push(null)}),g}};yM.protocols=["http","https"];eu.HttpsProxyAgent=yM;function Ubt(e){e.resume()}function B1e(e,...r){let n={},o;for(o in e)r.includes(o)||(n[o]=e[o]);return n}});var i_e=A((n_e,o_e)=>{"use strict";n_e=o_e.exports=cE;function cE(e,r){if(this.stream=r.stream||process.stderr,typeof r=="number"){var n=r;r={},r.total=n}else{if(r=r||{},typeof e!="string")throw new Error("format required");if(typeof r.total!="number")throw new Error("total required")}this.fmt=e,this.curr=r.curr||0,this.total=r.total,this.width=r.width||this.total,this.clear=r.clear,this.chars={complete:r.complete||"=",incomplete:r.incomplete||"-",head:r.head||r.complete||"="},this.renderThrottle=r.renderThrottle!==0?r.renderThrottle||16:0,this.lastRender=-1/0,this.callback=r.callback||function(){},this.tokens={},this.lastDraw=""}cE.prototype.tick=function(e,r){if(e!==0&&(e=e||1),typeof e=="object"&&(r=e,e=1),r&&(this.tokens=r),this.curr==0&&(this.start=new Date),this.curr+=e,this.render(),this.curr>=this.total){this.render(void 0,!0),this.complete=!0,this.terminate(),this.callback(this);return}};cE.prototype.render=function(e,r){if(r=r!==void 0?r:!1,e&&(this.tokens=e),!!this.stream.isTTY){var n=Date.now(),o=n-this.lastRender;if(!(!r&&o<this.renderThrottle)){this.lastRender=n;var i=this.curr/this.total;i=Math.min(Math.max(i,0),1);var a=Math.floor(i*100),c,u,l,p=new Date-this.start,f=a==100?0:p*(this.total/this.curr-1),g=this.curr/(p/1e3),x=this.fmt.replace(":current",this.curr).replace(":total",this.total).replace(":elapsed",isNaN(p)?"0.0":(p/1e3).toFixed(1)).replace(":eta",isNaN(f)||!isFinite(f)?"0.0":(f/1e3).toFixed(1)).replace(":percent",a.toFixed(0)+"%").replace(":rate",Math.round(g)),b=Math.max(0,this.stream.columns-x.replace(":bar","").length);b&&process.platform==="win32"&&(b=b-1);var v=Math.min(this.width,b);if(l=Math.round(v*i),u=Array(Math.max(0,l+1)).join(this.chars.complete),c=Array(Math.max(0,v-l+1)).join(this.chars.incomplete),l>0&&(u=u.slice(0,-1)+this.chars.head),x=x.replace(":bar",u+c),this.tokens)for(var S in this.tokens)x=x.replace(":"+S,this.tokens[S]);this.lastDraw!==x&&(this.stream.cursorTo(0),this.stream.write(x),this.stream.clearLine(1),this.lastDraw=x)}}};cE.prototype.update=function(e,r){var n=Math.floor(e*this.total),o=n-this.curr;this.tick(o,r)};cE.prototype.interrupt=function(e){this.stream.clearLine(),this.stream.cursorTo(0),this.stream.write(e),this.stream.write(`
`),this.stream.write(this.lastDraw)};cE.prototype.terminate=function(){this.clear?this.stream.clearLine&&(this.stream.clearLine(),this.stream.cursorTo(0)):this.stream.write(`
`)}});var a_e=A((Jgr,s_e)=>{"use strict";s_e.exports=i_e()});var l_e=A((Zgr,Kbt)=>{Kbt.exports={name:"@prisma/fetch-engine",version:"7.5.0",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/fetch-engine"},bugs:"https://github.com/prisma/prisma/issues",enginesOverride:{},devDependencies:{"@types/node":"~20.19.24","@types/progress":"2.0.7",del:"6.1.1",execa:"8.0.1","find-cache-dir":"5.0.0","fs-extra":"11.3.0",hasha:"5.2.2","http-proxy-agent":"7.0.2","https-proxy-agent":"7.0.6",kleur:"4.1.5","node-fetch":"3.3.2","p-filter":"4.1.0","p-map":"4.0.0","p-retry":"4.6.2",progress:"2.0.3","temp-dir":"2.0.0",tempy:"1.0.1","timeout-signal":"2.0.0",typescript:"5.4.5"},dependencies:{"@prisma/debug":"workspace:*","@prisma/engines-version":"7.5.0-15.280c870be64f457428992c43c1f6d557fab6e29e","@prisma/get-platform":"workspace:*"},scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"vitest run",prepublishOnly:"pnpm run build"},files:["README.md","dist"],sideEffects:!1}});var w_e=A((A0r,E_e)=>{"use strict";var cvt=Object.create,EM=Object.defineProperty,uvt=Object.getOwnPropertyDescriptor,lvt=Object.getOwnPropertyNames,pvt=Object.getPrototypeOf,fvt=Object.prototype.hasOwnProperty,dvt=(e,r)=>{for(var n in r)EM(e,n,{get:r[n],enumerable:!0})},y_e=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of lvt(r))!fvt.call(e,i)&&i!==n&&EM(e,i,{get:()=>r[i],enumerable:!(o=uvt(r,i))||o.enumerable});return e},wM=(e,r,n)=>(n=e!=null?cvt(pvt(e)):{},y_e(r||!e||!e.__esModule?EM(n,"default",{value:e,enumerable:!0}):n,e)),mvt=e=>y_e(EM({},"__esModule",{value:!0}),e),x_e={};dvt(x_e,{CompositeFilesResolver:()=>hvt,InMemoryFilesResolver:()=>yvt,ensureType:()=>wvt,loadRelatedSchemaFiles:()=>xvt,loadSchemaFiles:()=>v_e,realFsResolver:()=>FH});E_e.exports=mvt(x_e);var PH=wM(require("node:path")),g_e=wM(require("node:path"));function b_e(e){return e.caseSensitive?r=>r:r=>r.toLocaleLowerCase()}var hvt=class{constructor(e,r,n){this.primary=e,this.secondary=r,this._fileNameToKey=b_e(n)}_fileNameToKey;async listDirContents(e){let r=await this.primary.listDirContents(e),n=await this.secondary.listDirContents(e);return gvt([...r,...n],this._fileNameToKey)}async getEntryType(e){return await this.primary.getEntryType(e)??await this.secondary.getEntryType(e)}async getFileContents(e){return await this.primary.getFileContents(e)??await this.secondary.getFileContents(e)}};function gvt(e,r){let n=new Map;for(let o of e){let i=r(o);n.has(i)||n.set(i,o)}return Array.from(n.values())}var yvt=class{_tree={};_fileNameToKey;constructor(e){this._fileNameToKey=b_e(e)}addFile(e,r){let n=e.split(/[\\/]/),o=n.pop();if(!o)throw new Error("Path is empty");let i=this._tree;for(let a of n){let c=this._fileNameToKey(a),u=i[c];if(u||(u={canonicalName:a,content:{}},i[c]=u),typeof u.content=="string")throw new Error(`${a} is a file`);i=u.content}if(typeof i[o]?.content=="object")throw new Error(`${e} is a directory`);i[this._fileNameToKey(o)]={canonicalName:o,content:r}}getInMemoryContent(e){let r=e.split(/[\\/]/).map(o=>this._fileNameToKey(o)),n=this._tree;for(let o of r){if(typeof n!="object")return;n=n[o]?.content}return n}listDirContents(e){return Promise.resolve().then(()=>{let r=this.getInMemoryContent(e);return typeof r!="object"?[]:Object.values(r).map(n=>n.canonicalName)})}getEntryType(e){return Promise.resolve().then(()=>{let r=this.getInMemoryContent(e);if(typeof r=="string")return{kind:"file"};if(typeof r=="object")return{kind:"directory"}})}getFileContents(e){return Promise.resolve().then(()=>{let r=this.getInMemoryContent(e);if(!(typeof r>"u")){if(typeof r=="object")throw new Error(`${e} is directory`);return r}})}},vM=wM(yh()),FH={listDirContents(e){return vM.default.readdir(e)},async getEntryType(e){let r=await vM.default.lstat(e);return r.isFile()?{kind:"file"}:r.isDirectory()?{kind:"directory"}:r.i
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,c=!1,u;return{s:function(){n=n.call(e)},n:function(){var p=n.next();return a=p.done,p},e:function(p){c=!0,u=p},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(c)throw u}}}}function FSt(e,r){if(e){if(typeof e=="string")return q2e(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q2e(e,r)}}function q2e(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}var ISt=uk(),H2e=co(),G2e=H2e.erase,RSt=H2e.cursor,MSt=e=>[...ISt(e)].length;W2e.exports=function(e,r){if(!r)return G2e.line+RSt.to(0);let n=0,o=e.split(/\r?\n/);var i=OSt(o),a;try{for(i.s();!(a=i.n()).done;){let c=a.value;n+=1+Math.floor(Math.max(MSt(c)-1,0)/r)}}catch(c){i.e(c)}finally{i.f()}return G2e.lines(n)}});var jW=A((vwr,z2e)=>{"use strict";var QT={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},kSt={arrowUp:QT.arrowUp,arrowDown:QT.arrowDown,arrowLeft:QT.arrowLeft,arrowRight:QT.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},$St=process.platform==="win32"?kSt:QT;z2e.exports=$St});var J2e=A((Ewr,K2e)=>{"use strict";var bE=so(),wy=jW(),UW=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"\u{1F603}".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),NSt=e=>UW[e]||UW.default,XT=Object.freeze({aborted:bE.red(wy.cross),done:bE.green(wy.tick),exited:bE.yellow(wy.cross),default:bE.cyan("?")}),LSt=(e,r,n)=>r?XT.aborted:n?XT.exited:e?XT.done:XT.default,BSt=e=>bE.gray(e?wy.ellipsis:wy.pointerSmall),jSt=(e,r)=>bE.gray(e?r?wy.pointerSmall:"+":wy.line);K2e.exports={styles:UW,render:NSt,symbols:XT,symbol:LSt,delimiter:BSt,item:jSt}});var Z2e=A((wwr,Y2e)=>{"use strict";var USt=uk();Y2e.exports=function(e,r){let n=String(USt(e)||"").split(/\r?\n/);return r?n.map(o=>Math.ceil(o.length/r)).reduce((o,i)=>o+i):n.length}});var X2e=A((Swr,Q2e)=>{"use strict";Q2e.exports=(e,r={})=>{let n=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",o=r.width;return(e||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((a,c)=>(c.length+n.length>=o||a[a.length-1].length+c.length+1<o?a[a.length-1]+=` ${c}`:a.push(`${n}${c}`),a),[n]).join(`
`)).join(`
`)}});var tCe=A((_wr,eCe)=>{"use strict";eCe.exports=(e,r,n)=>{n=n||r;let o=Math.min(r-n,e-Math.floor(n/2));o<0&&(o=0);let i=Math.min(o+n,r);return{startIndex:o,endIndex:i}}});var cl=A((Twr,rCe)=>{"use strict";rCe.exports={action:B2e(),clear:V2e(),style:J2e(),strip:uk(),figures:jW(),lines:Z2e(),wrap:X2e(),entriesToDisplay:tCe()}});var td=A((Dwr,iCe)=>{"use strict";var nCe=require("readline"),qSt=cl(),GSt=qSt.action,HSt=require("events"),oCe=co(),WSt=oCe.beep,VSt=oCe.cursor,zSt=so(),qW=class extends HSt{constructor(r={}){super(),this.firstRender=!0,this.in=r.stdin||process.stdin,this.out=r.stdout||process.stdout,this.onRender=(r.onRender||(()=>{})).bind(this);let n=nCe.createInterface({input:this.in,escapeCodeTimeout:50});nCe.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);let o=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(a,c)=>{let u=GSt(c,o);u===!1?this._&&this._(a,c):typeof this[u]=="function"?this[u](c):this.bell()};this.close=()=>{this.out.write(VSt.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),n.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(WSt)}render(){this.onRender(zSt),this.firstRender&&(this.firstRender=!1)}};iCe.exports=qW});var lCe=A((Cwr,uCe)=>{"use strict";function sCe(e,r,n,o,i,a,c){try{var u=e[a](c),l=u.value}catch(p){n(p);return}u.done?r(l):Promise.resolve(l).then(o,i)}function aCe(e){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=e.apply(r,n);function c(l){sCe(a,o,i,c,u,"next",l)}function u(l){sCe(a,o,i,c,u,"throw",l)}c(void 0)})}}var lk=so(),KSt=td(),cCe=co(),JSt=cCe.erase,eD=cCe.cursor,pk=cl(),GW=pk.style,HW=pk.clear,YSt=pk.lines,ZSt=pk.figures,WW=class extends KSt{constructor(r={}){super(r),this.transform=GW.render(r.style),this.scale=this.transform.scale,this.msg=r.message,this.initial=r.initial||"",this.validator=r.validate||(()=>!0),this.value="",this.errorMsg=r.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=HW("",this.out.columns),this.render()}set value(r){!r&&this.initial?(this.placeholder=!0,this.rendered=lk.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(r)),this._value=r,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}validate(){var r=this;return aCe(function*(){let n=yield r.validator(r.value);typeof n=="string"&&(r.errorMsg=n,n=!1),r.error=!n})()}submit(){var r=this;return aCe(function*(){if(r.value=r.value||r.initial,r.cursorOffset=0,r.cursor=r.rendered.length,yield r.validate(),r.error){r.red=!0,r.fire(),r.render();return}r.done=!0,r.aborted=!1,r.fire(),r.render(),r.out.write(`
`),r.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(r){this.placeholder||(this.cursor=this.cursor+r,this.cursorOffset+=r)}_(r,n){let o=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${o}${r}${i}`,this.red=!1,this.cursor=this.placeholder?0:o.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let r=this.value.slice(0,this.cursor-1),n=this.value.slice(this.cursor);this.value=`${r}${n}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor+1);this.value=`${r}${n}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(eD.down(YSt(this.outputError,this.out.columns)-1)+HW(this.outputError,this.out.columns)),this.out.write(HW(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[GW.symbol(this.done,this.aborted),lk.bold(this.msg),GW.delimiter(this.done),this.red?lk.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((r,n,o)=>r+`
${o?" ":ZSt.pointerSmall} ${lk.red().italic(n)}`,"")),this.out.write(JSt.line+eD.to(0)+this.outputText+eD.save+this.outputError+eD.restore+eD.move(this.cursorOffset,0)))}};uCe.exports=WW});var mCe=A((Awr,dCe)=>{"use strict";var rd=so(),QSt=td(),tD=cl(),pCe=tD.style,fCe=tD.clear,fk=tD.figures,XSt=tD.wrap,e1t=tD.entriesToDisplay,t1t=co(),r1t=t1t.cursor,VW=class extends QSt{constructor(r={}){super(r),this.msg=r.message,this.hint=r.hint||"- Use arrow-keys. Return to submit.",this.warn=r.warn||"- This option is disabled",this.cursor=r.initial||0,this.choices=r.choices.map((n,o)=>(typeof n=="string"&&(n={title:n,value:o}),{title:n&&(n.title||n.value||n),value:n&&(n.value===void 0?o:n.value),description:n&&n.description,selected:n&&n.selected,disabled:n&&n.disabled})),this.optionsPerPage=r.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=fCe("",this.out.columns),this.render()}moveCursor(r){this.cursor=r,this.value=this.choices[r].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(r,n){if(r===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(r1t.hide):this.out.write(fCe(this.outputText,this.out.columns)),super.render();let r=e1t(this.cursor,this.choices.length,this.optionsPerPage),n=r.startIndex,o=r.endIndex;if(this.outputText=[pCe.symbol(this.done,this.aborted),rd.bold(this.msg),pCe.delimiter(!1),this.done?this.selection.title:this.selection.disabled?rd.yellow(this.warn):rd.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let i=n;i<o;i++){let a,c,u="",l=this.choices[i];i===n&&n>0?c=fk.arrowUp:i===o-1&&o<this.choices.length?c=fk.arrowDown:c=" ",l.disabled?(a=this.cursor===i?rd.gray().underline(l.title):rd.strikethrough().gray(l.title),c=(this.cursor===i?rd.bold().gray(fk.pointer)+" ":" ")+c):(a=this.cursor===i?rd.cyan().underline(l.title):l.title,c=(this.cursor===i?rd.cyan(fk.pointer)+" ":" ")+c,l.description&&this.cursor===i&&(u=` - ${l.description}`,(c.length+a.length+u.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(u=`
`+XSt(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${c} ${a}${rd.gray(u)}
`}}this.out.write(this.outputText)}};dCe.exports=VW});var vCe=A((Pwr,bCe)=>{"use strict";var dk=so(),n1t=td(),yCe=cl(),hCe=yCe.style,o1t=yCe.clear,xCe=co(),gCe=xCe.cursor,i1t=xCe.erase,zW=class extends n1t{constructor(r={}){super(r),this.msg=r.message,this.value=!!r.initial,this.active=r.active||"on",this.inactive=r.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(r,n){if(r===" ")this.value=!this.value;else if(r==="1")this.value=!0;else if(r==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(gCe.hide):this.out.write(o1t(this.outputText,this.out.columns)),super.render(),this.outputText=[hCe.symbol(this.done,this.aborted),dk.bold(this.msg),hCe.delimiter(this.done),this.value?this.inactive:dk.cyan().underline(this.inactive),dk.gray("/"),this.value?dk.cyan().underline(this.active):this.active].join(" "),this.out.write(i1t.line+gCe.to(0)+this.outputText))}};bCe.exports=zW});var Pp=A((Owr,ECe)=>{"use strict";var KW=class e{constructor({token:r,date:n,parts:o,locales:i}){this.token=r,this.date=n||new Date,this.parts=o||[this],this.locales=i||{}}up(){}down(){}next(){let r=this.parts.indexOf(this);return this.parts.find((n,o)=>o>r&&n instanceof e)}setTo(r){}prev(){let r=[].concat(this.parts).reverse(),n=r.indexOf(this);return r.find((o,i)=>i>n&&o instanceof e)}toString(){return String(this.date)}};ECe.exports=KW});var SCe=A((Fwr,wCe)=>{"use strict";var s1t=Pp(),JW=class extends s1t{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}};wCe.exports=JW});var TCe=A((Iwr,_Ce)=>{"use strict";var a1t=Pp(),c1t=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),YW=class extends a1t{constructor(r={}){super(r)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(r){this.date.setDate(parseInt(r.substr(-2)))}toString(){let r=this.date.getDate(),n=this.date.getDay();return this.token==="DD"?String(r).padStart(2,"0"):this.token==="Do"?r+c1t(r):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:r}};_Ce.exports=YW});var CCe=A((Rwr,DCe)=>{"use strict";var u1t=Pp(),ZW=class extends u1t{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}};DCe.exports=ZW});var PCe=A((Mwr,ACe)=>{"use strict";var l1t=Pp(),QW=class extends l1t{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};ACe.exports=QW});var FCe=A((kwr,OCe)=>{"use strict";var p1t=Pp(),XW=class extends p1t{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}};OCe.exports=XW});var RCe=A(($wr,ICe)=>{"use strict";var f1t=Pp(),eV=class extends f1t{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),n=this.token.length;return n===2?String(r+1).padStart(2,"0"):n===3?this.locales.monthsShort[r]:n===4?this.locales.months[r]:String(r+1)}};ICe.exports=eV});var kCe=A((Nwr,MCe)=>{"use strict";var d1t=Pp(),tV=class extends d1t{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.s
`),this.close()}validate(){var r=this;return UCe(function*(){let n=yield r.validator(r.value);typeof n=="string"&&(r.errorMsg=n,n=!1),r.error=!n})()}submit(){var r=this;return UCe(function*(){if(yield r.validate(),r.error){r.color="red",r.fire(),r.render();return}r.done=!0,r.aborted=!1,r.fire(),r.render(),r.out.write(`
`),r.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let r=this.parts[this.cursor].prev();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}right(){let r=this.parts[this.cursor].next();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}next(){let r=this.parts[this.cursor].next();this.moveCursor(r?this.parts.indexOf(r):this.parts.findIndex(n=>n instanceof WCe)),this.render()}_(r){/\d/.test(r)&&(this.typed+=r,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(HCe.hide):this.out.write(GCe(this.outputText,this.out.columns)),super.render(),this.outputText=[qCe.symbol(this.done,this.aborted),nV.bold(this.msg),qCe.delimiter(!1),this.parts.reduce((r,n,o)=>r.concat(o===this.cursor&&!this.done?nV.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((r,n,o)=>r+`
${o?" ":g1t.pointerSmall} ${nV.red().italic(n)}`,"")),this.out.write(y1t.line+HCe.to(0)+this.outputText))}};KCe.exports=oV});var rAe=A((Uwr,tAe)=>{"use strict";function YCe(e,r,n,o,i,a,c){try{var u=e[a](c),l=u.value}catch(p){n(p);return}u.done?r(l):Promise.resolve(l).then(o,i)}function ZCe(e){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=e.apply(r,n);function c(l){YCe(a,o,i,c,u,"next",l)}function u(l){YCe(a,o,i,c,u,"throw",l)}c(void 0)})}}var mk=so(),A1t=td(),eAe=co(),hk=eAe.cursor,P1t=eAe.erase,gk=cl(),sV=gk.style,O1t=gk.figures,QCe=gk.clear,F1t=gk.lines,I1t=/[0-9]/,aV=e=>e!==void 0,XCe=(e,r)=>{let n=Math.pow(10,r);return Math.round(e*n)/n},cV=class extends A1t{constructor(r={}){super(r),this.transform=sV.render(r.style),this.msg=r.message,this.initial=aV(r.initial)?r.initial:"",this.float=!!r.float,this.round=r.round||2,this.inc=r.increment||1,this.min=aV(r.min)?r.min:-1/0,this.max=aV(r.max)?r.max:1/0,this.errorMsg=r.error||"Please Enter A Valid Value",this.validator=r.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(r){!r&&r!==0?(this.placeholder=!0,this.rendered=mk.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${XCe(r,this.round)}`),this._value=XCe(r,this.round)),this.fire()}get value(){return this._value}parse(r){return this.float?parseFloat(r):parseInt(r)}valid(r){return r==="-"||r==="."&&this.float||I1t.test(r)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let r=this.value;this.value=r!==""?r:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}validate(){var r=this;return ZCe(function*(){let n=yield r.validator(r.value);typeof n=="string"&&(r.errorMsg=n,n=!1),r.error=!n})()}submit(){var r=this;return ZCe(function*(){if(yield r.validate(),r.error){r.color="red",r.fire(),r.render();return}let n=r.value;r.value=n!==""?n:r.initial,r.done=!0,r.aborted=!1,r.error=!1,r.fire(),r.render(),r.out.write(`
`),r.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let r=this.value.toString();if(r.length===0)return this.bell();this.value=this.parse(r=r.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(r,n){if(!this.valid(r))return this.bell();let o=Date.now();if(o-this.lastHit>1e3&&(this.typed=""),this.typed+=r,this.lastHit=o,this.color="cyan",r===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(hk.down(F1t(this.outputError,this.out.columns)-1)+QCe(this.outputError,this.out.columns)),this.out.write(QCe(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[sV.symbol(this.done,this.aborted),mk.bold(this.msg),sV.delimiter(this.done),!this.done||!this.done&&!this.placeholder?mk[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((r,n,o)=>r+`
${o?" ":O1t.pointerSmall} ${mk.red().italic(n)}`,"")),this.out.write(P1t.line+hk.to(0)+this.outputText+hk.save+this.outputError+hk.restore))}};tAe.exports=cV});var lV=A((qwr,iAe)=>{"use strict";var Op=so(),R1t=co(),M1t=R1t.cursor,k1t=td(),rD=cl(),nAe=rD.clear,Ah=rD.figures,oAe=rD.style,$1t=rD.wrap,N1t=rD.entriesToDisplay,uV=class extends k1t{constructor(r={}){super(r),this.msg=r.message,this.cursor=r.cursor||0,this.scrollIndex=r.cursor||0,this.hint=r.hint||"",this.warn=r.warn||"- This option is disabled -",this.minSelected=r.min,this.showMinError=!1,this.maxChoices=r.max,this.instructions=r.instructions,this.optionsPerPage=r.optionsPerPage||10,this.value=r.choices.map((n,o)=>(typeof n=="string"&&(n={title:n,value:o}),{title:n&&(n.title||n.value||n),description:n&&n.description,value:n&&(n.value===void 0?o:n.value),selected:n&&n.selected,disabled:n&&n.disabled})),this.clear=nAe("",this.out.columns),r.overrideRender||this.render()}reset(){this.value.map(r=>!r.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(r=>r.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){let r=this.value.filter(n=>n.selected);this.minSelected&&r.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let r=this.value[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let r=!this.value[this.cursor].selected;this.value.filter(n=>!n.disabled).forEach(n=>n.selected=r),this.render()}_(r,n){if(r===" ")this.handleSpaceToggle();else if(r==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${Ah.arrowUp}/${Ah.arrowDown}: Highlight option
${Ah.arrowLeft}/${Ah.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?` a: Toggle all
`:"")+" enter/return: Complete answer":""}renderOption(r,n,o,i){let a=(n.selected?Op.green(Ah.radioOn):Ah.radioOff)+" "+i+" ",c,u;return n.disabled?c=r===o?Op.gray().underline(n.title):Op.strikethrough().gray(n.title):(c=r===o?Op.cyan().underline(n.title):n.title,r===o&&n.description&&(u=` - ${n.description}`,(a.length+c.length+u.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(u=`
`+$1t(n.description,{margin:a.length,width:this.out.columns})))),a+c+Op.gray(u||"")}paginateOptions(r){if(r.length===0)return Op.red("No matches for this query.");let n=N1t(this.cursor,r.length,this.optionsPerPage),o=n.startIndex,i=n.endIndex,a,c=[];for(let u=o;u<i;u++)u===o&&o>0?a=Ah.arrowUp:u===i-1&&i<r.length?a=Ah.arrowDown:a=" ",c.push(this.renderOption(this.cursor,r[u],u,a));return`
`+c.join(`
`)}renderOptions(r){return this.done?"":this.paginateOptions(r)}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[Op.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&r.push(Op.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(M1t.hide),super.render();let r=[oAe.symbol(this.done,this.aborted),Op.bold(this.msg),oAe.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=Op.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.value),this.out.write(this.clear+r),this.clear=nAe(r,this.out.columns)}};iAe.exports=uV});var fAe=A((Gwr,pAe)=>{"use strict";function sAe(e,r,n,o,i,a,c){try{var u=e[a](c),l=u.value}catch(p){n(p);return}u.done?r(l):Promise.resolve(l).then(o,i)}function L1t(e){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=e.apply(r,n);function c(l){sAe(a,o,i,c,u,"next",l)}function u(l){sAe(a,o,i,c,u,"throw",l)}c(void 0)})}}var nD=so(),B1t=td(),lAe=co(),j1t=lAe.erase,aAe=lAe.cursor,oD=cl(),pV=oD.style,cAe=oD.clear,fV=oD.figures,U1t=oD.wrap,q1t=oD.entriesToDisplay,uAe=(e,r)=>e[r]&&(e[r].value||e[r].title||e[r]),G1t=(e,r)=>e[r]&&(e[r].title||e[r].value||e[r]),H1t=(e,r)=>{let n=e.findIndex(o=>o.value===r||o.title===r);return n>-1?n:void 0},dV=class extends B1t{constructor(r={}){super(r),this.msg=r.message,this.suggest=r.suggest,this.choices=r.choices,this.initial=typeof r.initial=="number"?r.initial:H1t(r.choices,r.initial),this.select=this.initial||r.cursor||0,this.i18n={noMatches:r.noMatches||"no matches found"},this.fallback=r.fallback||this.initial,this.clearFirst=r.clearFirst||!1,this.suggestions=[],this.input="",this.limit=r.limit||10,this.cursor=0,this.transform=pV.render(r.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=cAe("",this.out.columns),this.complete(this.render),this.render()}set fallback(r){this._fb=Number.isSafeInteger(parseInt(r))?parseInt(r):r}get fallback(){let r;return typeof this._fb=="number"?r=this.choices[this._fb]:typeof this._fb=="string"&&(r={title:this._fb}),r||this._fb||{title:this.i18n.noMatches}}moveSelect(r){this.select=r,this.suggestions.length>0?this.value=uAe(this.suggestions,r):this.value=this.fallback.value,this.fire()}complete(r){var n=this;return L1t(function*(){let o=n.completing=n.suggest(n.input,n.choices),i=yield o;if(n.completing!==o)return;n.suggestions=i.map((c,u,l)=>({title:G1t(l,u),value:uAe(l,u),description:c.description})),n.completing=!1;let a=Math.max(i.length-1,0);n.moveSelect(Math.min(a,n.select)),r&&r()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(r,n){let o=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${o}${r}${i}`,this.cursor=o.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let r=this.input.slice(0,this.cursor-1),n=this.input.slice(this.cursor);this.input=`${r}${n}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let r=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor+1);this.input=`${r}${n}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(r,n,o,i){let a,c=o?fV.arrowUp:i?fV.arrowDown:" ",u=n?nD.cyan().underline(r.title):r.title;return c=(n?nD.cyan(fV.pointer)+" ":" ")+c,r.description&&(a=` - ${r.description}`,(c.length+u.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
`+U1t(r.description,{margin:3,width:this.out.columns}))),c+" "+u+nD.gray(a||"")}render(){if(this.closed)return;this.firstRender?this.out.write(aAe.hide):this.out.write(cAe(this.outputText,this.out.columns)),super.render();let r=q1t(this.select,this.choices.length,this.limit),n=r.startIndex,o=r.endIndex;if(this.outputText=[pV.symbol(this.done,this.aborted,this.exited),nD.bold(this.msg),pV.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(n,o).map((a,c)=>this.renderOption(a,this.select===c+n,c===0&&n>0,c+n===o-1&&o<this.choices.length)).join(`
`);this.outputText+=`
`+(i||nD.gray(this.fallback.title))}this.out.write(j1t.line+aAe.to(0)+this.outputText)}};pAe.exports=dV});var gAe=A((Hwr,hAe)=>{"use strict";var od=so(),W1t=co(),V1t=W1t.cursor,z1t=lV(),hV=cl(),dAe=hV.clear,mAe=hV.style,vE=hV.figures,mV=class extends z1t{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=dAe("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(o=>this.inputValue?!!(typeof o.title=="string"&&o.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof o.value=="string"&&o.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let n=this.filteredOptions.findIndex(o=>o===r);this.cursor=n<0?0:n,this.render()}handleSpaceToggle(){let r=this.filteredOptions[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r,this.updateFilteredOptions()}_(r,n){r===" "?this.handleSpaceToggle():this.handleInputChange(r)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${vE.arrowUp}/${vE.arrowDown}: Highlight option
${vE.arrowLeft}/${vE.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`:""}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:od.gray("Enter something to filter")}
`}renderOption(r,n,o){let i;return n.disabled?i=r===o?od.gray().underline(n.title):od.strikethrough().gray(n.title):i=r===o?od.cyan().underline(n.title):n.title,(n.selected?od.green(vE.radioOn):vE.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[od.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(od.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(V1t.hide),super.render();let r=[mAe.symbol(this.done,this.aborted),od.bold(this.msg),mAe.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=od.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+r),this.clear=dAe(r,this.out.columns)}};hAe.exports=mV});var SAe=A((Wwr,wAe)=>{"use strict";var yAe=so(),K1t=td(),vAe=cl(),xAe=vAe.style,J1t=vAe.clear,EAe=co(),Y1t=EAe.erase,bAe=EAe.cursor,gV=class extends K1t{constructor(r={}){super(r),this.msg=r.message,this.value=r.initial,this.initialValue=!!r.initial,this.yesMsg=r.yes||"yes",this.yesOption=r.yesOption||"(Y/n)",this.noMsg=r.no||"no",this.noOption=r.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(r,n){return r.toLowerCase()==="y"?(this.value=!0,this.submit()):r.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(bAe.hide):this.out.write(J1t(this.outputText,this.out.columns)),super.render(),this.outputText=[xAe.symbol(this.done,this.aborted),yAe.bold(this.msg),xAe.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:yAe.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Y1t.line+bAe.to(0)+this.outputText))}};wAe.exports=gV});var TAe=A((Vwr,_Ae)=>{"use strict";_Ae.exports={TextPrompt:lCe(),SelectPrompt:mCe(),TogglePrompt:vCe(),DatePrompt:JCe(),NumberPrompt:rAe(),MultiselectPrompt:lV(),AutocompletePrompt:fAe(),AutocompleteMultiselectPrompt:gAe(),ConfirmPrompt:SAe()}});var CAe=A(DAe=>{"use strict";var Ea=DAe,Z1t=TAe(),yk=e=>e;function Fp(e,r,n={}){return new Promise((o,i)=>{let a=new Z1t[e](r),c=n.onAbort||yk,u=n.onSubmit||yk,l=n.onExit||yk;a.on("state",r.onState||yk),a.on("submit",p=>o(u(p))),a.on("exit",p=>o(l(p))),a.on("abort",p=>i(c(p)))})}Ea.text=e=>Fp("TextPrompt",e);Ea.password=e=>(e.style="password",Ea.text(e));Ea.invisible=e=>(e.style="invisible",Ea.text(e));Ea.number=e=>Fp("NumberPrompt",e);Ea.date=e=>Fp("DatePrompt",e);Ea.confirm=e=>Fp("ConfirmPrompt",e);Ea.list=e=>{let r=e.separator||",";return Fp("TextPrompt",e,{onSubmit:n=>n.split(r).map(o=>o.trim())})};Ea.toggle=e=>Fp("TogglePrompt",e);Ea.select=e=>Fp("SelectPrompt",e);Ea.multiselect=e=>{e.choices=[].concat(e.choices||[]);let r=n=>n.filter(o=>o.selected).map(o=>o.value);return Fp("MultiselectPrompt",e,{onAbort:r,onSubmit:r})};Ea.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let r=n=>n.filter(o=>o.selected).map(o=>o.value);return Fp("AutocompleteMultiselectPrompt",e,{onAbort:r,onSubmit:r})};var Q1t=(e,r)=>Promise.resolve(r.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Ea.autocomplete=e=>(e.suggest=e.suggest||Q1t,e.choices=[].concat(e.choices||[]),Fp("AutocompletePrompt",e))});var kAe=A((Kwr,MAe)=>{"use strict";function AAe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,o)}return n}function PAe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?AAe(Object(n),!0).forEach(function(o){X1t(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AAe(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function X1t(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function e_t(e,r){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=t_t(e))||r&&e&&typeof e.length=="number"){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(p){throw p},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,c=!1,u;return{s:function(){n=n.call(e)},n:function(){var p=n.next();return a=p.done,p},e:function(p){c=!0,u=p},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(c)throw u}}}}function t_t(e,r){if(e){if(typeof e=="string")return OAe(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OAe(e,r)}}function OAe(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function FAe(e,r,n,o,i,a,c){try{var u=e[a](c),l=u.value}catch(p){n(p);return}u.done?r(l):Promise.resolve(l).then(o,i)}function IAe(e){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=e.apply(r,n);function c(l){FAe(a,o,i,c,u,"next",l)}function u(l){FAe(a,o,i,c,u,"throw",l)}c(void 0)})}}var yV=CAe(),r_t=["suggest","format","onState","validate","onRender","type"],RAe=()=>{};function Ph(){return xV.apply(this,arguments)}function xV(){return xV=IAe(function*(e=[],{onSubmit:r=RAe,onCancel:n=RAe}={}){let o={},i=Ph._override||{};e=[].concat(e);let a,c,u,l,p,f,g=function(){var _=IAe(function*(D,P,C=!1){if(!(!C&&D.validate&&D.validate(P)!==!0))return D.format?yield D.format(P,o):P});return function(P,C){return _.apply(this,arguments)}}();var x=e_t(e),b;try{for(x.s();!(b=x.n()).done;){c=b.value;var v=c;if(l=v.name,p=v.type,typeof p=="function"&&(p=yield p(a,PAe({},o),c),c.type=p),!!p){for(let _ in c){if(r_t.includes(_))continue;let D=c[_];c[_]=typeof D=="function"?yield D(a,PAe({},o),f):D}if(f=c,typeof c.message!="string")throw new Error("prompt message is required");var S=c;if(l=S.name,p=S.type,yV[p]===void 0)throw new Error(`prompt type (${p}) is not defined`);if(i[c.name]!==void 0&&(a=yield g(c,i[c.name]),a!==void 0)){o[l]=a;continue}try{a=Ph._injected?n_t(Ph._injected,c.initial):yield yV[p](c),o[l]=a=yield g(c,a,!0),u=yield r(c,a,o)}catch{u=!(yield n(c,o))}if(u)return o}}}catch(_){x.e(_)}finally{x.f()}return o}),xV.apply(this,arguments)}function n_t(e,r){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?r:n}function o_t(e){Ph._injected=(Ph._injected||[]).concat(e)}function i_t(e){Ph._override=Object.assign({},e)}MAe.exports=Object.assign(Ph,{prompt:Ph,prompts:yV,inject:o_t,override:i_t})});var NAe=A((Jwr,$Ae)=>{"use strict";$Ae.exports=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}});var xk=A((Ywr,LAe)=>{"use strict";LAe.exports=e=>{let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),n=new RegExp(r,"g");return typeof e=="string"?e.replace(n,""):e}});var UAe=A((Zwr,jAe)=>{"use strict";var s_t=xk(),{erase:BAe,cursor:a_t}=co(),c_t=e=>[...s_t(e)].length;jAe.exports=function(e,r){if(!r)return BAe.line+a_t.to(0);let n=0,o=e.split(/\r?\n/);for(let i of o)n+=1+Math.floor(Math.max(c_t(i)-1,0)/r);return BAe.lines(n)}});var bV=A((Qwr,qAe)=>{"use strict";var iD={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},u_t={arrowUp:iD.arrowUp,arrowDown:iD.arrowDown,arrowLeft:iD.arrowLeft,arrowRight:iD.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u22
`)).join(`
`)}});var YAe=A((rSr,JAe)=>{"use strict";JAe.exports=(e,r,n)=>{n=n||r;let o=Math.min(r-n,e-Math.floor(n/2));o<0&&(o=0);let i=Math.min(o+n,r);return{startIndex:o,endIndex:i}}});var ul=A((nSr,ZAe)=>{"use strict";ZAe.exports={action:NAe(),clear:UAe(),style:HAe(),strip:xk(),figures:bV(),lines:VAe(),wrap:KAe(),entriesToDisplay:YAe()}});var id=A((oSr,XAe)=>{"use strict";var QAe=require("readline"),{action:g_t}=ul(),y_t=require("events"),{beep:x_t,cursor:b_t}=co(),v_t=so(),EV=class extends y_t{constructor(r={}){super(),this.firstRender=!0,this.in=r.stdin||process.stdin,this.out=r.stdout||process.stdout,this.onRender=(r.onRender||(()=>{})).bind(this);let n=QAe.createInterface({input:this.in,escapeCodeTimeout:50});QAe.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);let o=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(a,c)=>{let u=g_t(c,o);u===!1?this._&&this._(a,c):typeof this[u]=="function"?this[u](c):this.bell()};this.close=()=>{this.out.write(b_t.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),n.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(x_t)}render(){this.onRender(v_t),this.firstRender&&(this.firstRender=!1)}};XAe.exports=EV});var tPe=A((iSr,ePe)=>{"use strict";var bk=so(),E_t=id(),{erase:w_t,cursor:aD}=co(),{style:wV,clear:SV,lines:S_t,figures:__t}=ul(),_V=class extends E_t{constructor(r={}){super(r),this.transform=wV.render(r.style),this.scale=this.transform.scale,this.msg=r.message,this.initial=r.initial||"",this.validator=r.validate||(()=>!0),this.value="",this.errorMsg=r.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=SV("",this.out.columns),this.render()}set value(r){!r&&this.initial?(this.placeholder=!0,this.rendered=bk.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(r)),this._value=r,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(r){this.placeholder||(this.cursor=this.cursor+r,this.cursorOffset+=r)}_(r,n){let o=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${o}${r}${i}`,this.red=!1,this.cursor=this.placeholder?0:o.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let r=this.value.slice(0,this.cursor-1),n=this.value.slice(this.cursor);this.value=`${r}${n}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor+1);this.value=`${r}${n}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(aD.down(S_t(this.outputError,this.out.columns)-1)+SV(this.outputError,this.out.columns)),this.out.write(SV(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[wV.symbol(this.done,this.aborted),bk.bold(this.msg),wV.delimiter(this.done),this.red?bk.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((r,n,o)=>r+`
${o?" ":__t.pointerSmall} ${bk.red().italic(n)}`,"")),this.out.write(w_t.line+aD.to(0)+this.outputText+aD.save+this.outputError+aD.restore+aD.move(this.cursorOffset,0)))}};ePe.exports=_V});var iPe=A((sSr,oPe)=>{"use strict";var sd=so(),T_t=id(),{style:rPe,clear:nPe,figures:vk,wrap:D_t,entriesToDisplay:C_t}=ul(),{cursor:A_t}=co(),TV=class extends T_t{constructor(r={}){super(r),this.msg=r.message,this.hint=r.hint||"- Use arrow-keys. Return to submit.",this.warn=r.warn||"- This option is disabled",this.cursor=r.initial||0,this.choices=r.choices.map((n,o)=>(typeof n=="string"&&(n={title:n,value:o}),{title:n&&(n.title||n.value||n),value:n&&(n.value===void 0?o:n.value),description:n&&n.description,selected:n&&n.selected,disabled:n&&n.disabled})),this.optionsPerPage=r.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=nPe("",this.out.columns),this.render()}moveCursor(r){this.cursor=r,this.value=this.choices[r].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(r,n){if(r===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(A_t.hide):this.out.write(nPe(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=C_t(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[rPe.symbol(this.done,this.aborted),sd.bold(this.msg),rPe.delimiter(!1),this.done?this.selection.title:this.selection.disabled?sd.yellow(this.warn):sd.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let o=r;o<n;o++){let i,a,c="",u=this.choices[o];o===r&&r>0?a=vk.arrowUp:o===n-1&&n<this.choices.length?a=vk.arrowDown:a=" ",u.disabled?(i=this.cursor===o?sd.gray().underline(u.title):sd.strikethrough().gray(u.title),a=(this.cursor===o?sd.bold().gray(vk.pointer)+" ":" ")+a):(i=this.cursor===o?sd.cyan().underline(u.title):u.title,a=(this.cursor===o?sd.cyan(vk.pointer)+" ":" ")+a,u.description&&this.cursor===o&&(c=` - ${u.description}`,(a.length+i.length+c.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(c=`
`+D_t(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${i}${sd.gray(c)}
`}}this.out.write(this.outputText)}};oPe.exports=TV});var uPe=A((aSr,cPe)=>{"use strict";var Ek=so(),P_t=id(),{style:sPe,clear:O_t}=ul(),{cursor:aPe,erase:F_t}=co(),DV=class extends P_t{constructor(r={}){super(r),this.msg=r.message,this.value=!!r.initial,this.active=r.active||"on",this.inactive=r.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(r,n){if(r===" ")this.value=!this.value;else if(r==="1")this.value=!0;else if(r==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(aPe.hide):this.out.write(O_t(this.outputText,this.out.columns)),super.render(),this.outputText=[sPe.symbol(this.done,this.aborted),Ek.bold(this.msg),sPe.delimiter(this.done),this.value?this.inactive:Ek.cyan().underline(this.inactive),Ek.gray("/"),this.value?Ek.cyan().underline(this.active):this.active].join(" "),this.out.write(F_t.line+aPe.to(0)+this.outputText))}};cPe.exports=DV});var Ip=A((cSr,lPe)=>{"use strict";var CV=class e{constructor({token:r,date:n,parts:o,locales:i}){this.token=r,this.date=n||new Date,this.parts=o||[this],this.locales=i||{}}up(){}down(){}next(){let r=this.parts.indexOf(this);return this.parts.find((n,o)=>o>r&&n instanceof e)}setTo(r){}prev(){let r=[].concat(this.parts).reverse(),n=r.indexOf(this);return r.find((o,i)=>i>n&&o instanceof e)}toString(){return String(this.date)}};lPe.exports=CV});var fPe=A((uSr,pPe)=>{"use strict";var I_t=Ip(),AV=class extends I_t{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}};pPe.exports=AV});var mPe=A((lSr,dPe)=>{"use strict";var R_t=Ip(),M_t=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),PV=class extends R_t{constructor(r={}){super(r)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(r){this.date.setDate(parseInt(r.substr(-2)))}toString(){let r=this.date.getDate(),n=this.date.getDay();return this.token==="DD"?String(r).padStart(2,"0"):this.token==="Do"?r+M_t(r):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:r}};dPe.exports=PV});var gPe=A((pSr,hPe)=>{"use strict";var k_t=Ip(),OV=class extends k_t{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}};hPe.exports=OV});var xPe=A((fSr,yPe)=>{"use strict";var $_t=Ip(),FV=class extends $_t{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};yPe.exports=FV});var vPe=A((dSr,bPe)=>{"use strict";var N_t=Ip(),IV=class extends N_t{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}};bPe.exports=IV});var wPe=A((mSr,EPe)=>{"use strict";var L_t=Ip(),RV=class extends L_t{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),n=this.token.length;return n===2?String(r+1).padStart(2,"0"):n===3?this.locales.monthsShort[r]:n===4?this.locales.months[r]:String(r+1)}};EPe.exports=RV});var _Pe=A((hSr,SPe)=>{"use strict";var B_t=Ip(),MV=class extends B_t{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.s
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let r=this.parts[this.cursor].prev();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}right(){let r=this.parts[this.cursor].next();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}next(){let r=this.parts[this.cursor].next();this.moveCursor(r?this.parts.indexOf(r):this.parts.findIndex(n=>n instanceof IPe)),this.render()}_(r){/\d/.test(r)&&(this.typed+=r,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(FPe.hide):this.out.write(OPe(this.outputText,this.out.columns)),super.render(),this.outputText=[PPe.symbol(this.done,this.aborted),$V.bold(this.msg),PPe.delimiter(!1),this.parts.reduce((r,n,o)=>r.concat(o===this.cursor&&!this.done?$V.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((r,n,o)=>r+`
${o?" ":q_t.pointerSmall} ${$V.red().italic(n)}`,"")),this.out.write(G_t.line+FPe.to(0)+this.outputText))}};MPe.exports=NV});var BPe=A((bSr,LPe)=>{"use strict";var wk=so(),eTt=id(),{cursor:Sk,erase:tTt}=co(),{style:LV,figures:rTt,clear:$Pe,lines:nTt}=ul(),oTt=/[0-9]/,BV=e=>e!==void 0,NPe=(e,r)=>{let n=Math.pow(10,r);return Math.round(e*n)/n},jV=class extends eTt{constructor(r={}){super(r),this.transform=LV.render(r.style),this.msg=r.message,this.initial=BV(r.initial)?r.initial:"",this.float=!!r.float,this.round=r.round||2,this.inc=r.increment||1,this.min=BV(r.min)?r.min:-1/0,this.max=BV(r.max)?r.max:1/0,this.errorMsg=r.error||"Please Enter A Valid Value",this.validator=r.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(r){!r&&r!==0?(this.placeholder=!0,this.rendered=wk.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${NPe(r,this.round)}`),this._value=NPe(r,this.round)),this.fire()}get value(){return this._value}parse(r){return this.float?parseFloat(r):parseInt(r)}valid(r){return r==="-"||r==="."&&this.float||oTt.test(r)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let r=this.value;this.value=r!==""?r:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let r=this.value;this.value=r!==""?r:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let r=this.value.toString();if(r.length===0)return this.bell();this.value=this.parse(r=r.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(r,n){if(!this.valid(r))return this.bell();let o=Date.now();if(o-this.lastHit>1e3&&(this.typed=""),this.typed+=r,this.lastHit=o,this.color="cyan",r===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Sk.down(nTt(this.outputError,this.out.columns)-1)+$Pe(this.outputError,this.out.columns)),this.out.write($Pe(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[LV.symbol(this.done,this.aborted),wk.bold(this.msg),LV.delimiter(this.done),!this.done||!this.done&&!this.placeholder?wk[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((r,n,o)=>r+`
${o?" ":rTt.pointerSmall} ${wk.red().italic(n)}`,"")),this.out.write(tTt.line+Sk.to(0)+this.outputText+Sk.save+this.outputError+Sk.restore))}};LPe.exports=jV});var qV=A((vSr,qPe)=>{"use strict";var Rp=so(),{cursor:iTt}=co(),sTt=id(),{clear:jPe,figures:Oh,style:UPe,wrap:aTt,entriesToDisplay:cTt}=ul(),UV=class extends sTt{constructor(r={}){super(r),this.msg=r.message,this.cursor=r.cursor||0,this.scrollIndex=r.cursor||0,this.hint=r.hint||"",this.warn=r.warn||"- This option is disabled -",this.minSelected=r.min,this.showMinError=!1,this.maxChoices=r.max,this.instructions=r.instructions,this.optionsPerPage=r.optionsPerPage||10,this.value=r.choices.map((n,o)=>(typeof n=="string"&&(n={title:n,value:o}),{title:n&&(n.title||n.value||n),description:n&&n.description,value:n&&(n.value===void 0?o:n.value),selected:n&&n.selected,disabled:n&&n.disabled})),this.clear=jPe("",this.out.columns),r.overrideRender||this.render()}reset(){this.value.map(r=>!r.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(r=>r.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){let r=this.value.filter(n=>n.selected);this.minSelected&&r.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let r=this.value[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let r=!this.value[this.cursor].selected;this.value.filter(n=>!n.disabled).forEach(n=>n.selected=r),this.render()}_(r,n){if(r===" ")this.handleSpaceToggle();else if(r==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${Oh.arrowUp}/${Oh.arrowDown}: Highlight option
${Oh.arrowLeft}/${Oh.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?` a: Toggle all
`:"")+" enter/return: Complete answer":""}renderOption(r,n,o,i){let a=(n.selected?Rp.green(Oh.radioOn):Oh.radioOff)+" "+i+" ",c,u;return n.disabled?c=r===o?Rp.gray().underline(n.title):Rp.strikethrough().gray(n.title):(c=r===o?Rp.cyan().underline(n.title):n.title,r===o&&n.description&&(u=` - ${n.description}`,(a.length+c.length+u.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(u=`
`+aTt(n.description,{margin:a.length,width:this.out.columns})))),a+c+Rp.gray(u||"")}paginateOptions(r){if(r.length===0)return Rp.red("No matches for this query.");let{startIndex:n,endIndex:o}=cTt(this.cursor,r.length,this.optionsPerPage),i,a=[];for(let c=n;c<o;c++)c===n&&n>0?i=Oh.arrowUp:c===o-1&&o<r.length?i=Oh.arrowDown:i=" ",a.push(this.renderOption(this.cursor,r[c],c,i));return`
`+a.join(`
`)}renderOptions(r){return this.done?"":this.paginateOptions(r)}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[Rp.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&r.push(Rp.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(iTt.hide),super.render();let r=[UPe.symbol(this.done,this.aborted),Rp.bold(this.msg),UPe.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=Rp.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.value),this.out.write(this.clear+r),this.clear=jPe(r,this.out.columns)}};qPe.exports=UV});var zPe=A((ESr,VPe)=>{"use strict";var cD=so(),uTt=id(),{erase:lTt,cursor:GPe}=co(),{style:GV,clear:HPe,figures:HV,wrap:pTt,entriesToDisplay:fTt}=ul(),WPe=(e,r)=>e[r]&&(e[r].value||e[r].title||e[r]),dTt=(e,r)=>e[r]&&(e[r].title||e[r].value||e[r]),mTt=(e,r)=>{let n=e.findIndex(o=>o.value===r||o.title===r);return n>-1?n:void 0},WV=class extends uTt{constructor(r={}){super(r),this.msg=r.message,this.suggest=r.suggest,this.choices=r.choices,this.initial=typeof r.initial=="number"?r.initial:mTt(r.choices,r.initial),this.select=this.initial||r.cursor||0,this.i18n={noMatches:r.noMatches||"no matches found"},this.fallback=r.fallback||this.initial,this.clearFirst=r.clearFirst||!1,this.suggestions=[],this.input="",this.limit=r.limit||10,this.cursor=0,this.transform=GV.render(r.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=HPe("",this.out.columns),this.complete(this.render),this.render()}set fallback(r){this._fb=Number.isSafeInteger(parseInt(r))?parseInt(r):r}get fallback(){let r;return typeof this._fb=="number"?r=this.choices[this._fb]:typeof this._fb=="string"&&(r={title:this._fb}),r||this._fb||{title:this.i18n.noMatches}}moveSelect(r){this.select=r,this.suggestions.length>0?this.value=WPe(this.suggestions,r):this.value=this.fallback.value,this.fire()}async complete(r){let n=this.completing=this.suggest(this.input,this.choices),o=await n;if(this.completing!==n)return;this.suggestions=o.map((a,c,u)=>({title:dTt(u,c),value:WPe(u,c),description:a.description})),this.completing=!1;let i=Math.max(o.length-1,0);this.moveSelect(Math.min(i,this.select)),r&&r()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(r,n){let o=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${o}${r}${i}`,this.cursor=o.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let r=this.input.slice(0,this.cursor-1),n=this.input.slice(this.cursor);this.input=`${r}${n}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let r=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor+1);this.input=`${r}${n}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(r,n,o,i){let a,c=o?HV.arrowUp:i?HV.arrowDown:" ",u=n?cD.cyan().underline(r.title):r.title;return c=(n?cD.cyan(HV.pointer)+" ":" ")+c,r.description&&(a=` - ${r.description}`,(c.length+u.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
`+pTt(r.description,{margin:3,width:this.out.columns}))),c+" "+u+cD.gray(a||"")}render(){if(this.closed)return;this.firstRender?this.out.write(GPe.hide):this.out.write(HPe(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=fTt(this.select,this.choices.length,this.limit);if(this.outputText=[GV.symbol(this.done,this.aborted,this.exited),cD.bold(this.msg),GV.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let o=this.suggestions.slice(r,n).map((i,a)=>this.renderOption(i,this.select===a+r,a===0&&r>0,a+r===n-1&&n<this.choices.length)).join(`
`);this.outputText+=`
`+(o||cD.gray(this.fallback.title))}this.out.write(lTt.line+GPe.to(0)+this.outputText)}};VPe.exports=WV});var ZPe=A((wSr,YPe)=>{"use strict";var ad=so(),{cursor:hTt}=co(),gTt=qV(),{clear:KPe,style:JPe,figures:wE}=ul(),VV=class extends gTt{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=KPe("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(o=>this.inputValue?!!(typeof o.title=="string"&&o.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof o.value=="string"&&o.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let n=this.filteredOptions.findIndex(o=>o===r);this.cursor=n<0?0:n,this.render()}handleSpaceToggle(){let r=this.filteredOptions[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r,this.updateFilteredOptions()}_(r,n){r===" "?this.handleSpaceToggle():this.handleInputChange(r)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${wE.arrowUp}/${wE.arrowDown}: Highlight option
${wE.arrowLeft}/${wE.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`:""}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:ad.gray("Enter something to filter")}
`}renderOption(r,n,o){let i;return n.disabled?i=r===o?ad.gray().underline(n.title):ad.strikethrough().gray(n.title):i=r===o?ad.cyan().underline(n.title):n.title,(n.selected?ad.green(wE.radioOn):wE.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[ad.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(ad.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(hTt.hide),super.render();let r=[JPe.symbol(this.done,this.aborted),ad.bold(this.msg),JPe.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=ad.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+r),this.clear=KPe(r,this.out.columns)}};YPe.exports=VV});var rOe=A((SSr,tOe)=>{"use strict";var QPe=so(),yTt=id(),{style:XPe,clear:xTt}=ul(),{erase:bTt,cursor:eOe}=co(),zV=class extends yTt{constructor(r={}){super(r),this.msg=r.message,this.value=r.initial,this.initialValue=!!r.initial,this.yesMsg=r.yes||"yes",this.yesOption=r.yesOption||"(Y/n)",this.noMsg=r.no||"no",this.noOption=r.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(r,n){return r.toLowerCase()==="y"?(this.value=!0,this.submit()):r.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(eOe.hide):this.out.write(xTt(this.outputText,this.out.columns)),super.render(),this.outputText=[XPe.symbol(this.done,this.aborted),QPe.bold(this.msg),XPe.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:QPe.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(bTt.line+eOe.to(0)+this.outputText))}};tOe.exports=zV});var oOe=A((_Sr,nOe)=>{"use strict";nOe.exports={TextPrompt:tPe(),SelectPrompt:iPe(),TogglePrompt:uPe(),DatePrompt:kPe(),NumberPrompt:BPe(),MultiselectPrompt:qV(),AutocompletePrompt:zPe(),AutocompleteMultiselectPrompt:ZPe(),ConfirmPrompt:rOe()}});var sOe=A(iOe=>{"use strict";var wa=iOe,vTt=oOe(),_k=e=>e;function Mp(e,r,n={}){return new Promise((o,i)=>{let a=new vTt[e](r),c=n.onAbort||_k,u=n.onSubmit||_k,l=n.onExit||_k;a.on("state",r.onState||_k),a.on("submit",p=>o(u(p))),a.on("exit",p=>o(l(p))),a.on("abort",p=>i(c(p)))})}wa.text=e=>Mp("TextPrompt",e);wa.password=e=>(e.style="password",wa.text(e));wa.invisible=e=>(e.style="invisible",wa.text(e));wa.number=e=>Mp("NumberPrompt",e);wa.date=e=>Mp("DatePrompt",e);wa.confirm=e=>Mp("ConfirmPrompt",e);wa.list=e=>{let r=e.separator||",";return Mp("TextPrompt",e,{onSubmit:n=>n.split(r).map(o=>o.trim())})};wa.toggle=e=>Mp("TogglePrompt",e);wa.select=e=>Mp("SelectPrompt",e);wa.multiselect=e=>{e.choices=[].concat(e.choices||[]);let r=n=>n.filter(o=>o.selected).map(o=>o.value);return Mp("MultiselectPrompt",e,{onAbort:r,onSubmit:r})};wa.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let r=n=>n.filter(o=>o.selected).map(o=>o.value);return Mp("AutocompleteMultiselectPrompt",e,{onAbort:r,onSubmit:r})};var ETt=(e,r)=>Promise.resolve(r.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));wa.autocomplete=e=>(e.suggest=e.suggest||ETt,e.choices=[].concat(e.choices||[]),Mp("AutocompletePrompt",e))});var uOe=A((DSr,cOe)=>{"use strict";var KV=sOe(),wTt=["suggest","format","onState","validate","onRender","type"],aOe=()=>{};async function Fh(e=[],{onSubmit:r=aOe,onCancel:n=aOe}={}){let o={},i=Fh._override||{};e=[].concat(e);let a,c,u,l,p,f,g=async(x,b,v=!1)=>{if(!(!v&&x.validate&&x.validate(b)!==!0))return x.format?await x.format(b,o):b};for(c of e)if({name:l,type:p}=c,typeof p=="function"&&(p=await p(a,{...o},c),c.type=p),!!p){for(let x in c){if(wTt.includes(x))continue;let b=c[x];c[x]=typeof b=="function"?await b(a,{...o},f):b}if(f=c,typeof c.message!="string")throw new Error("prompt message is required");if({name:l,type:p}=c,KV[p]===void 0)throw new Error(`prompt type (${p}) is not defined`);if(i[c.name]!==void 0&&(a=await g(c,i[c.name]),a!==void 0)){o[l]=a;continue}try{a=Fh._injected?STt(Fh._injected,c.initial):await KV[p](c),o[l]=a=await g(c,a,!0),u=await r(c,a,o)}catch{u=!await n(c,o)}if(u)return o}return o}function STt(e,r){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?r:n}function _Tt(e){Fh._injected=(Fh._injected||[]).concat(e)}function TTt(e){Fh._override=Object.assign({},e)}cOe.exports=Object.assign(Fh,{prompt:Fh,prompts:KV,inject:_Tt,override:TTt})});var Ih=A((CSr,lOe)=>{"use strict";function DTt(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let r=0,n=process.versions.node.split(".").map(Number);for(;r<e.length;r++){if(n[r]>e[r])return!1;if(e[r]>n[r])return!0}return!1}lOe.exports=DTt("8.6.0")?kAe():uOe()});var fd=A(tt=>{"use strict";var NTt=tt&&tt.__spreadArray||function(e,r,n){if(n||arguments.length===2)for(var o=0,i=r.length,a;o<i;o++)(a||!(o in r))&&(a||(a=Array.prototype.slice.call(r,0,o)),a[o]=r[o]);return e.concat(a||Array.prototype.slice.call(r))};Object.defineProperty(tt,"__esModule",{value:!0});tt.flatMapReader=tt.flatMapTask=tt.flatMapIO=tt.flatMapEither=tt.flatMapOption=tt.flatMapNullable=tt.liftOption=tt.liftNullable=tt.fromReadonlyNonEmptyArray=tt.has=tt.emptyRecord=tt.emptyReadonlyArray=tt.tail=tt.head=tt.isNonEmpty=tt.singleton=tt.right=tt.left=tt.isRight=tt.isLeft=tt.s
`:`
`,o=r.whitespace?" = ":"=",i=[],a=r.sort?Object.keys(e).sort():Object.keys(e),c=0;r.align&&(c=gd(a.filter(p=>e[p]===null||Array.isArray(e[p])||typeof e[p]!="object").map(p=>Array.isArray(e[p])?`${p}[]`:p).concat([""]).reduce((p,f)=>gd(p).length>=gd(f).length?p:f)).length);let u="",l=r.bracketedArray?"[]":"";for(let p of a){let f=e[p];if(f&&Array.isArray(f))for(let g of f)u+=gd(`${p}${l}`).padEnd(c," ")+o+gd(g)+n;else f&&typeof f=="object"?i.push(p):u+=gd(p).padEnd(c," ")+o+gd(f)+n}r.section&&u.length&&(u="["+gd(r.section)+"]"+(r.newline?n+n:n)+u);for(let p of i){let f=HFe(p,".").join("\\."),g=(r.section?r.section+".":"")+f,x=Uz(e[p],{...r,section:g});u.length&&x.length&&(u+=n),u+=x}return u};function HFe(e,r){var n=0,o=0,i=0,a=[];do if(i=e.indexOf(r,n),i!==-1){if(n=i+r.length,i>0&&e[i-1]==="\\")continue;a.push(e.slice(o,i)),o=i+r.length}while(i!==-1);return a.push(e.slice(o)),a}var GFe=(e,r={})=>{r.bracketedArray=r.bracketedArray!==!1;let n=Object.create(null),o=n,i=null,a=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,c=e.split(/[\r\n]+/g),u={};for(let p of c){if(!p||p.match(/^\s*[;#]/)||p.match(/^\s*$/))continue;let f=p.match(a);if(!f)continue;if(f[1]!==void 0){if(i=qk(f[1]),i==="__proto__"){o=Object.create(null);continue}o=n[i]=n[i]||Object.create(null);continue}let g=qk(f[2]),x;r.bracketedArray?x=g.length>2&&g.slice(-2)==="[]":(u[g]=(u?.[g]||0)+1,x=u[g]>1);let b=x?g.slice(0,-2):g;if(b==="__proto__")continue;let v=f[3]?qk(f[4]):!0,S=v==="true"||v==="false"||v==="null"?JSON.parse(v):v;x&&(jz.call(o,b)?Array.isArray(o[b])||(o[b]=[o[b]]):o[b]=[]),Array.isArray(o[b])?o[b].push(S):o[b]=S}let l=[];for(let p of Object.keys(n)){if(!jz.call(n,p)||typeof n[p]!="object"||Array.isArray(n[p]))continue;let f=HFe(p,".");o=n;let g=f.pop(),x=g.replace(/\\\./g,".");for(let b of f)b!=="__proto__"&&((!jz.call(o,b)||typeof o[b]!="object")&&(o[b]=Object.create(null)),o=o[b]);o===n&&x===g||(o[x]=n[p],l.push(p))}for(let p of l)delete n[p];return n},WFe=e=>e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"),gd=e=>typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&WFe(e)||e!==e.trim()?JSON.stringify(e):e.split(";").join("\\;").split("#").join("\\#"),qk=(e,r)=>{if(e=(e||"").trim(),WFe(e)){e.charAt(0)==="'"&&(e=e.slice(1,-1));try{e=JSON.parse(e)}catch{}}else{let n=!1,o="";for(let i=0,a=e.length;i<a;i++){let c=e.charAt(i);if(n)"\\;#".indexOf(c)!==-1?o+=c:o+="\\"+c,n=!1;else{if(";#".indexOf(c)!==-1)break;c==="\\"?n=!0:o+=c}}return n&&(o+="\\"),o.trim()}return e};VFe.exports={parse:GFe,decode:GFe,stringify:Uz,encode:Uz,safe:gd,unsafe:qk}});var XFe=A((Gz,Hz)=>{"use strict";(function(e){Gz&&typeof Gz=="object"&&typeof Hz<"u"?Hz.exports=e():typeof define=="function"&&define.amd?define([],e):typeof window<"u"?window.isWindows=e():typeof global<"u"?global.isWindows=e():typeof self<"u"?self.isWindows=e():this.isWindows=e()})(function(){"use strict";return function(){return process&&(process.platform==="win32"||/^(msys|cygwin)$/.test(process.env.OSTYPE))}})});var iIe=A((q1r,Wk)=>{"use strict";Wk.exports=(e={})=>{let r;if(e.repoUrl)r=e.repoUrl;else if(e.user&&e.repo)r=`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 n=new URL(`${r}/issues/new`),o=["body","title","labels","template","milestone","assignee","projects"];for(let i of o){let a=e[i];if(a!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(a))throw new TypeError(`The \`${i}\` option should be an array`);a=a.join(",")}n.searchParams.set(i,a)}}return n.toString()};Wk.exports.default=Wk.exports});var Vk=A((G1r,aIe)=>{"use strict";var sIe=require("fs"),Yz;function EOt(){try{return sIe.statSync("/.dockerenv"),!0}catch{return!1}}function wOt(){try{return sIe.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}aIe.exports=()=>(Yz===void 0&&(Yz=EOt()||wOt()),Yz)});var Qz=A((H1r,Zz)=>{"use strict";var SOt=require("os"),_Ot=require("fs"),cIe=Vk(),uIe=()=>{if(process.platform!=="linux")return!1;if(SOt.release().toLowerCase().includes("microsof
`);for(let[l,p]of[...o].entries()){if(i+=p,RQ.has(p)){let g=parseFloat(/\d[^m]*/.exec(o.slice(l,l+4)));a=g===F3t?null:g}let f=O3t.codes.get(Number(a));a&&f&&(o[l+1]===`
`?i+=C4e(f):p===`
`&&(i+=C4e(a)))}return i};A4e.exports=(e,r,n)=>String(e).normalize().replace(/\r\n/g,`
`).split(`
`).map(o=>M3t(o,r,n)).join(`
`)});var $4e=A((F4r,k4e)=>{"use strict";var N3t=require("stream"),MQ=class extends N3t{#e=null;constructor(r={}){super(r),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=r.replace,this._prompt=r.prompt||null,this._hadControl=!1}#t(r,n){return this._dest?this._dest[r]:this._src?this._src[r]:n}#r(r,...n){typeof this._dest?.[r]=="function"&&this._dest[r](...n),typeof this._src?.[r]=="function"&&this._src[r](...n)}get isTTY(){return this.#e!==null?this.#e:this.#t("isTTY",!1)}set isTTY(r){this.#e=r}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(r){this._src=r}pipe(r,n){return this._dest=r,super.pipe(r,n)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(r){if(this.muted){if(!this.replace)return!0;if(r.match(/^\u001b/))return r.indexOf(this._prompt)===0&&(r=r.slice(this._prompt.length),r=r.replace(/./g,this.replace),r=this._prompt+r),this._hadControl=!0,this.emit("data",r);this._prompt&&this._hadControl&&r.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),r=r.slice(this._prompt.length)),r=r.toString().replace(/./g,this.replace)}this.emit("data",r)}end(r){this.muted&&(r&&this.replace?r=r.toString().replace(/./g,this.replace):r=null),r&&this.emit("data",r),this.emit("end")}destroy(...r){return this.#r("destroy",...r)}destroySoon(...r){return this.#r("destroySoon",...r)}close(...r){return this.#r("close",...r)}};k4e.exports=MQ});var L2=A((I4r,kQ)=>{"use strict";var xr=kQ.exports;kQ.exports.default=xr;var Zr="\x1B[",N2="\x1B]",Aw="\x07",kN=";",N4e=process.env.TERM_PROGRAM==="Apple_Terminal";xr.cursorTo=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof r!="number"?Zr+(e+1)+"G":Zr+(r+1)+";"+(e+1)+"H"};xr.cursorMove=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let n="";return e<0?n+=Zr+-e+"D":e>0&&(n+=Zr+e+"C"),r<0?n+=Zr+-r+"A":r>0&&(n+=Zr+r+"B"),n};xr.cursorUp=(e=1)=>Zr+e+"A";xr.cursorDown=(e=1)=>Zr+e+"B";xr.cursorForward=(e=1)=>Zr+e+"C";xr.cursorBackward=(e=1)=>Zr+e+"D";xr.cursorLeft=Zr+"G";xr.cursorSavePosition=N4e?"\x1B7":Zr+"s";xr.cursorRestorePosition=N4e?"\x1B8":Zr+"u";xr.cursorGetPosition=Zr+"6n";xr.cursorNextLine=Zr+"E";xr.cursorPrevLine=Zr+"F";xr.cursorHide=Zr+"?25l";xr.cursorShow=Zr+"?25h";xr.eraseLines=e=>{let r="";for(let n=0;n<e;n++)r+=xr.eraseLine+(n<e-1?xr.cursorUp():"");return e&&(r+=xr.cursorLeft),r};xr.eraseEndLine=Zr+"K";xr.eraseStartLine=Zr+"1K";xr.eraseLine=Zr+"2K";xr.eraseDown=Zr+"J";xr.eraseUp=Zr+"1J";xr.eraseScreen=Zr+"2J";xr.scrollUp=Zr+"S";xr.scrollDown=Zr+"T";xr.clearScreen="\x1Bc";xr.clearTerminal=process.platform==="win32"?`${xr.eraseScreen}${Zr}0f`:`${xr.eraseScreen}${Zr}3J${Zr}H`;xr.beep=Aw;xr.link=(e,r)=>[N2,"8",kN,kN,r,Aw,e,N2,"8",kN,kN,Aw].join("");xr.image=(e,r={})=>{let n=`${N2}1337;File=inline=1`;return r.width&&(n+=`;width=${r.width}`),r.height&&(n+=`;height=${r.height}`),r.preserveAspectRatio===!1&&(n+=";preserveAspectRatio=0"),n+":"+e.toString("base64")+Aw};xr.iTerm={setCwd:(e=process.cwd())=>`${N2}50;CurrentDir=${e}${Aw}`,annotation:(e,r={})=>{let n=`${N2}1337;`,o=typeof r.x<"u",i=typeof r.y<"u";if((o||i)&&!(o&&i&&typeof r.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),n+=r.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",r.length>0?n+=(o?[e,r.length,r.x,r.y]:[r.length,e]).join("|"):n+=e,n+Aw}}});var Pw=A((a3r,V4e)=>{"use strict";V4e.exports=function(e,r,n,o,i){this.confidence=n,this.name=o||r.name(e),this.lang=i}});var K4e=A((c3r,z4e)=>{"use strict";var H3t=Pw();z4e.exports=function(){this.name=function(){return"UTF-8"},this.match=function(e){var r=!1,n=0,o=0,i=e.fRawInput,a=0,c;e.fRawLength>=3&&(i[0]&255)==239&&(i[1]&255)==187&&(i[2]&255)==191&&(r=!0);for(var u=0;u<e.fRawLength;u++){var l=i[u];if((l&128)!=0){if((l&224)==192)a=1;else if((l&240)==224)a=2;else if((l&248)==240)a=3;else{if(o++,o>5)break;a=0}for(;u++,!(u>=e.fRawLength);){if((i[
\v\f\r\x1B !"#$\u066A&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xB0\xB7\u2219\u221A\u2592\u2500\u2502\u253C\u2524\u252C\u251C\u2534\u2510\u250C\u2514\u2518\u03B2\u221E\u03C6\xB1\xBD\xBC\u2248\xAB\xBB\uFEF7\uFEF8\uFFFD\uFFFD\uFEFB\uFEFC\uFFFD\xA0\xAD\uFE82\xA3\xA4\uFE84\uFFFD\uFFFD\uFE8E\uFE8F\uFE95\uFE99\u060C\uFE9D\uFEA1\uFEA5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFED1\u061B\uFEB1\uFEB5\uFEB9\u061F\xA2\uFE80\uFE81\uFE83\uFE85\uFECA\uFE8B\uFE8D\uFE91\uFE93\uFE97\uFE9B\uFE9F\uFEA3\uFEA7\uFEA9\uFEAB\uFEAD\uFEAF\uFEB3\uFEB7\uFEBB\uFEBF\uFEC1\uFEC5\uFECB\uFECF\xA6\xAC\xF7\xD7\uFEC9\u0640\uFED3\uFED7\uFEDB\uFEDF\uFEE3\uFEE7\uFEEB\uFEED\uFEEF\uFEF3\uFEBD\uFECC\uFECE\uFECD\uFEE1\uFE7D\u0651\uFEE5\uFEE9\uFEEC\uFEF0\uFEF2\uFED0\uFED5\uFEF5\uFEF6\uFEDD\uFED9\uFEF1\u25A0\uFFFD`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xA4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\xA4\u25A0\xA0"},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0386\uFFFD\xB7\xAC\xA6\u2018\u2019\u0388\u2015\u0389\u038A\u03AA\u038C\uFFFD\uFFFD\u038E\u03AB\xA9\u038F\xB2\xB3\u03AC\xA3\u03AD\u03AE\u03AF\u03CA\u0390\u03CC\u03CD\u0391\u0392\u0393\u0394\u0395\u0396\u0397\xBD\u0398\u0399\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u039A\u039B\u039C\u039D\u2563\u2551\u2557\u255D\u039E\u039F\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u03A0\u03A1\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u2518\u250C\u2588\u2584\u03B4\u03B5\u2580\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u0384\xAD\xB1\u03C5\u03C6\u03C7\xA7\u03C8\u0385\xB0\xA8\u03C9\u03CB\u03B0\u03CE\u25A0\xA0"},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\u203E\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0160\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\u017D\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0161\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\u017E\xFF"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"\uFE88\xD7\xF7\uF8F6\uF8F5\uF8F4\uF8F7\uFE71\x88\u25A0\u2502\u2500\u2510\u250C\u2514\u2518\uFE79\uFE7B\uFE7D\uFE7F\uFE77\uFE8A\uFEF0\uFEF3\uFEF2\uFECE\uFECF\uFED0\uFEF6\uFEF8\uFEFA\uFEFC\xA0\uF8FA\uF8F9\uF8F8\xA4\uF8FB\uFE8B\uFE91\uFE9
\v\f\r\u1EE8\u1EF0\u1EF2\u1EF6\u1EF8\xDD\u1EF4\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xC0\u1EA2\xC3\xC1\u1EA0\u1EB6\u1EAC\xC8\u1EBA\u1EBC\xC9\u1EB8\u1EC6\xCC\u1EC8\u0128\xCD\u1ECA\xD2\u1ECE\xD5\xD3\u1ECC\u1ED8\u1EDC\u1EDE\u1EE0\u1EDA\u1EE2\xD9\u1EE6\u0168\xA0\u0102\xC2\xCA\xD4\u01A0\u01AF\u0110\u0103\xE2\xEA\xF4\u01A1\u01B0\u0111\u1EB0\u0300\u0309\u0303\u0301\u0323\xE0\u1EA3\xE3\xE1\u1EA1\u1EB2\u1EB1\u1EB3\u1EB5\u1EAF\u1EB4\u1EAE\u1EA6\u1EA8\u1EAA\u1EA4\u1EC0\u1EB7\u1EA7\u1EA9\u1EAB\u1EA5\u1EAD\xE8\u1EC2\u1EBB\u1EBD\xE9\u1EB9\u1EC1\u1EC3\u1EC5\u1EBF\u1EC7\xEC\u1EC9\u1EC4\u1EBE\u1ED2\u0129\xED\u1ECB\xF2\u1ED4\u1ECF\xF5\xF3\u1ECD\u1ED3\u1ED5\u1ED7\u1ED1\u1ED9\u1EDD\u1EDF\u1EE1\u1EDB\u1EE3\xF9\u1ED6\u1EE7\u0169\xFA\u1EE5\u1EEB\u1EED\u1EEF\u1EE9\u1EF1\u1EF3\u1EF7\u1EF9\xFD\u1EF5\u1ED0`},georgianacademy:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10EF\u10F0\u10F1\u10F2\u10F3\u10F4\u10F5\u10F6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},georgianps:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10F1\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10F2\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10F3\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10F4\u10EF\u10F0\u10F5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},pt154:{type:"_sbcs",chars:"\u0496\u0492\u04EE\u0493\u201E\u2026\u04B6\u04AE\u04B2\u04AF\u04A0\u04E2\u04A2\u049A\u04BA\u04B8\u0497\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u04B3\u04B7\u04A1\u04E3\u04A3\u049B\u04BB\u04B9\xA0\u040E\u045E\u0408\u04E8\u0498\u04B0\xA7\u0401\xA9\u04D8\xAB\xAC\u04EF\xAE\u049C\xB0\u04B1\u0406\u0456\u0499\u04E9\xB6\xB7\u0451\u2116\u04D9\xBB\u0458\u04AA\u04AB\u049D\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"},viscii:{type:"_sbcs",chars:`\0\u1EB2\u1EB4\u1EAA\x07\b
\v\f\r\u1EF6\u1EF8\x1B\u1EF4 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\u1EA0\u1EAE\u1EB0\u1EB6\u1EA4\u1EA6\u1EA8\u1EAC\u1EBC\u1EB8\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EE2\u1EDA\u1EDC\u1EDE\u1ECA\u1ECE\u1ECC\u1EC8\u1EE6\u0168\u1EE4\u1EF2\xD5\u1EAF\u1EB1\u1EB7\u1EA5\u1EA7\u1EA9\u1EAD\u1EBD\u1EB9\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1ED1\u1ED3\u1ED5\u1ED7\u1EE0\u01A0\u1ED9\u1EDD\u1EDF\u1ECB\u1EF0\u1EE8\u1EEA\u1EEC\u01A1\u1EDB\u01AF\xC0\xC1\xC2\xC3\u1EA2\u0102\u1EB3\u1EB5\xC8\xC9\xCA\u1EBA\xCC\xCD\u0128\u1EF3\u0110\u1EE9\xD2\xD3\xD4\u1EA1\u1EF7\u1EEB\u1EED\xD9\xDA\u1EF9\u1EF5\xDD\u1EE1\u01B0\xE0\xE1\xE2\xE3\u1EA3\u0103\u1EEF\u1EAB\xE8\xE9\xEA\u1EBB\xEC\xED\u0129\u1EC9\u0111\u1EF1\xF2\xF3\xF4\xF5\u1ECF\u1ECD\u1EE5\xF9\xFA\u0169\u1EE7\xFD\u1EE3\u1EEE`},iso646cn:{type:"_sbcs",chars:`\0\x07\b
\v\f\r\x1B !"#\xA5%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD`},iso646jp:{type:"_sbcs",chars:`\0\x07\b
\v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\xA5]^_\`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD`},hproman8:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xC0\xC2\xC8\xCA\xCB\xCE\xCF\xB4\u02CB\u02C6\xA8\u02DC\xD9\xDB\u20A4\xAF\xDD\xFD\xB0\xC7\xE7\xD1\xF1\xA1\xBF\xA4\xA3\xA5\xA7\u0192\xA2\xE2\xEA\xF4\xFB\xE1\xE9\xF3\xFA\xE0\xE8\xF2\xF9\xE4\xEB\xF6\xFC\xC5\xEE\xD8\xC6\xE5\xED\xF8\xE6\xC4\xEC\xD6\xDC\xC9\xEF\xDF\xD4\xC1\xC3\xE3\xD0\xF0\xCD\xCC\xD3\xD2\xD5\xF5\u0160\u0161\xDA\u0178\xFF\xDE\xFE\xB7\xB5\xB6\xBE\u2014\xBC\xBD\xAA\xBA\xAB\u25A0\xBB\xB1\uFFFD"},macintosh:{type:"_sbcs",chars:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"},ascii:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"},tis620:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"}}});var S3e=A(w3e=>{"use strict";var Mw=ax().Buffer;w3e._dbcs=Md;var Ia=-1,E3e=-2,Su=-10,Qp=-1e3,Rw=new Array(256),H2=-1;for(KN=0;KN<256;KN++)Rw[KN]=Ia;var KN;function Md(e,r){if(this.encodingName=e.encodingName,!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var n=e.table();this.decodeTables=[]
`);let o;for(;(o=t8t.exec(n))!=null;){let i=o[1],a=o[2]||"";a=a.trim();let c=a[0];a=a.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),c==='"'&&(a=a.replace(/\\n/g,`
`),a=a.replace(/\\r/g,"\r")),r[i]=a}return r}function n8t(e){e=e||{};let r=FBe(e);e.path=r;let n=li.configDotenv(e);if(!n.parsed){let c=new Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw c.code="MISSING_DATA",c}let o=OBe(e).split(","),i=o.length,a;for(let c=0;c<i;c++)try{let u=o[c].trim(),l=i8t(n,u);a=li.decrypt(l.ciphertext,l.key);break}catch(u){if(c+1>=i)throw u}return li.parse(a)}function o8t(e){console.error(`[dotenv@${MX}][WARN] ${e}`)}function J2(e){console.log(`[dotenv@${MX}][DEBUG] ${e}`)}function PBe(e){console.log(`[dotenv@${MX}] ${e}`)}function OBe(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function i8t(e,r){let n;try{n=new URL(r)}catch(u){if(u.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw u}let o=n.password;if(!o){let u=new Error("INVALID_DOTENV_KEY: Missing key part");throw u.code="INVALID_DOTENV_KEY",u}let i=n.searchParams.get("environment");if(!i){let u=new Error("INVALID_DOTENV_KEY: Missing environment part");throw u.code="INVALID_DOTENV_KEY",u}let a=`DOTENV_VAULT_${i.toUpperCase()}`,c=e.parsed[a];if(!c){let u=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${a} in your .env.vault file.`);throw u.code="NOT_FOUND_DOTENV_ENVIRONMENT",u}return{ciphertext:c,key:o}}function FBe(e){let r=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let n of e.path)RX.existsSync(n)&&(r=n.endsWith(".vault")?n:`${n}.vault`);else r=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else r=nL.resolve(process.cwd(),".env.vault");return RX.existsSync(r)?r:null}function ABe(e){return e[0]==="~"?nL.join(JBt.homedir(),e.slice(1)):e}function s8t(e){let r=Bw(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),n=Bw(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(r||!n)&&PBe("Loading env from encrypted .env.vault");let o=li._parseVault(e),i=process.env;return e&&e.processEnv!=null&&(i=e.processEnv),li.populate(i,o,e),{parsed:o}}function a8t(e){let r=nL.resolve(process.cwd(),".env"),n="utf8",o=process.env;e&&e.processEnv!=null&&(o=e.processEnv);let i=Bw(o.DOTENV_CONFIG_DEBUG||e&&e.debug),a=Bw(o.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?n=e.encoding:i&&J2("No encoding is specified. UTF-8 is used by default");let c=[r];if(e&&e.path)if(!Array.isArray(e.path))c=[ABe(e.path)];else{c=[];for(let f of e.path)c.push(ABe(f))}let u,l={};for(let f of c)try{let g=li.parse(RX.readFileSync(f,{encoding:n}));li.populate(l,g,e)}catch(g){i&&J2(`Failed to load ${f} ${g.message}`),u=g}let p=li.populate(o,l,e);if(i=Bw(o.DOTENV_CONFIG_DEBUG||i),a=Bw(o.DOTENV_CONFIG_QUIET||a),i||!a){let f=Object.keys(p).length,g=[];for(let x of c)try{let b=nL.relative(process.cwd(),x);g.push(b)}catch(b){i&&J2(`Failed to load ${x} ${b.message}`),u=b}PBe(`injecting env (${f}) from ${g.join(",")} ${e8t(`-- tip: ${QBt()}`)}`)}return u?{parsed:l,error:u}:{parsed:l}}function c8t(e){if(OBe(e).length===0)return li.configDotenv(e);let r=FBe(e);return r?li._configVault(e):(o8t(`You set DOTENV_KEY but you are missing a .env.vault file at ${r}. Did you forget to build it?`),li.configDotenv(e))}function u8t(e,r){let n=Buffer.from(r.slice(-64),"hex"),o=Buffer.from(e,"base64"),i=o.subarray(0,12),a=o.subarray(-16);o=o.subarray(12,-16);try{let c=YBt.createDecipheriv("aes-256-gcm",n,i);return c.setAuthTag(a),`${c.update(o)}${c.final()}`}catch(c){let u=c instanceof RangeError,l=c.message==="Invalid key length",p=c.message==="Unsupported state or unable to authenticate data";if(u||l){let f=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw f.code="INVALID_DOTENV_KEY",f}else if(p){let f=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw f.code="DECRYPTION_FAILED",f}else throw c}}function l8t(e,r,n={}){let o=!!(n&&n.debug),i=!!(n&&n.override),a={};if(typeof r!="object"){let c=new Error("OBJECT_REQUIRED: Please check the processEn
`:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===r&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e}});var xet=A((DEn,LP)=>{"use strict";var NP=require("path"),get=B9(),yet=e=>{e={cwd:process.cwd(),path:process.env[get()],execPath:process.execPath,...e};let r,n=NP.resolve(e.cwd),o=[];for(;r!==n;)o.push(NP.join(n,"node_modules/.bin")),r=n,n=NP.resolve(n,"..");let i=NP.resolve(e.cwd,e.execPath,"..");return o.push(i),o.concat(e.path).join(NP.delimiter)};LP.exports=yet;LP.exports.default=yet;LP.exports.env=e=>{e={env:process.env,...e};let r={...e.env},n=get({env:r});return e.path=r[n],r[n]=LP.exports(e),r}});var vet=A((CEn,Wue)=>{"use strict";var bet=(e,r)=>{for(let n of Reflect.ownKeys(r))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));return e};Wue.exports=bet;Wue.exports.default=bet});var wet=A((AEn,P5)=>{"use strict";var Ptr=vet(),A5=new WeakMap,Eet=(e,r={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,o=0,i=e.displayName||e.name||"<anonymous>",a=function(...c){if(A5.set(a,++o),o===1)n=e.apply(this,c),e=null;else if(r.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return Ptr(a,e),A5.set(a,o),a};P5.exports=Eet;P5.exports.default=Eet;P5.exports.callCount=e=>{if(!A5.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return A5.get(e)}});var _et=A(O5=>{"use strict";Object.defineProperty(O5,"__esModule",{value:!0});O5.SIGNALS=void 0;var Otr=[{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
${o.message}`:S,P=[D,r,e].filter(Boolean).join(`
`);return _?(o.originalMessage=o.message,o.message=P):o=new Error(P),o.shortMessage=D,o.command=c,o.escapedCommand=u,o.exitCode=a,o.signal=i,o.signalDescription=x,o.stdout=e,o.stderr=r,n!==void 0&&(o.all=n),"bufferedData"in o&&delete o.bufferedData,o.failed=!0,o.timedOut=!!l,o.isCanceled=p,o.killed=f&&!l,o};Oet.exports=Jtr});var Ret=A((MEn,zue)=>{"use strict";var I5=["stdin","stdout","stderr"],Ytr=e=>I5.some(r=>e[r]!==void 0),Iet=e=>{if(!e)return;let{stdio:r}=e;if(r===void 0)return I5.map(o=>e[o]);if(Ytr(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${I5.map(o=>`\`${o}\``).join(", ")}`);if(typeof r=="string")return r;if(!Array.isArray(r))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof r}\``);let n=Math.max(r.length,I5.length);return Array.from({length:n},(o,i)=>r[i])};zue.exports=Iet;zue.exports.node=e=>{let r=Iet(e);return r==="ipc"?"ipc":r===void 0||typeof r=="string"?[r,r,r,"ipc"]:r.includes("ipc")?r:[...r,"ipc"]}});var Met=A((kEn,R5)=>{"use strict";R5.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&R5.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&R5.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Bet=A(($En,H1)=>{"use strict";var ro=global.process,Zb=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"};Zb(ro)?(ket=require("assert"),q1=Met(),$et=/^win/i.test(ro.platform),BP=require("events"),typeof BP!="function"&&(BP=BP.EventEmitter),ro.__signal_exit_emitter__?ji=ro.__signal_exit_emitter__:(ji=ro.__signal_exit_emitter__=new BP,ji.count=0,ji.emitted={}),ji.infinite||(ji.setMaxListeners(1/0),ji.infinite=!0),H1.exports=function(e,r){if(!Zb(global.process))return function(){};ket.equal(typeof e,"function","a callback must be provided for exit handler"),G1===!1&&Kue();var n="exit";r&&r.alwaysLast&&(n="afterexit");var o=function(){ji.removeListener(n,e),ji.listeners("exit").length===0&&ji.listeners("afterexit").length===0&&M5()};return ji.on(n,e),o},M5=function(){!G1||!Zb(global.process)||(G1=!1,q1.forEach(function(r){try{ro.removeListener(r,k5[r])}catch{}}),ro.emit=$5,ro.reallyExit=Jue,ji.count-=1)},H1.exports.unload=M5,Qb=function(r,n,o){ji.emitted[r]||(ji.emitted[r]=!0,ji.emit(r,n,o))},k5={},q1.forEach(function(e){k5[e]=function(){if(Zb(global.process)){var n=ro.listeners(e);n.length===ji.count&&(M5(),Qb("exit",null,e),Qb("afterexit",null,e),$et&&e==="SIGHUP"&&(e="SIGINT"),ro.kill(ro.pid,e))}}}),H1.exports.signals=function(){return q1},G1=!1,Kue=function(){G1||!Zb(global.process)||(G1=!0,ji.count+=1,q1=q1.filter(function(r){try{return ro.on(r,k5[r]),!0}catch{return!1}}),ro.emit=Let,ro.reallyExit=Net)},H1.exports.load=Kue,Jue=ro.reallyExit,Net=function(r){Zb(global.process)&&(ro.exitCode=r||0,Qb("exit",ro.exitCode,null),Qb("afterexit",ro.exitCode,null),Jue.call(ro,ro.exitCode))},$5=ro.emit,Let=function(r,n){if(r==="exit"&&Zb(global.process)){n!==void 0&&(ro.exitCode=n);var o=$5.apply(this,arguments);return Qb("exit",ro.exitCode,null),Qb("afterexit",ro.exitCode,null),o}else return $5.apply(this,arguments)}):H1.exports=function(){return function(){}};var ket,q1,$et,BP,ji,M5,Qb,k5,G1,Kue,Jue,Net,$5,Let});var Uet=A((NEn,jet)=>{"use strict";var Ztr=require("os"),Qtr=Bet(),Xtr=1e3*5,err=(e,r="SIGTERM",n={})=>{let o=e(r);return trr(e,r,n,o),o},trr=(e,r,n,o)=>{if(!rrr(r,n,o))return;let i=orr(n),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},rrr=(e,{forceKillAfterTimeout:r},n)=>nrr(e)&&r!==!1&&n,nrr=e=>e===Ztr.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",orr=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Xtr;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},irr=(e,r)=
${JSON.stringify(u,null,2)}`),u}async function jit(){let e="/etc/os-release";try{let r=await O9.default.readFile(e,{encoding:"utf-8"});return Bit(r)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function Uit(e){let r=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(r){let n=`${r[1]}.x`;return lde(n)}}function ide(e){let r=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(r){let n=`${r[1]}${r[2]??".0"}.x`;return lde(n)}}function lde(e){let r=(()=>{if(fde(e))return e;let n=e.split(".");return n[1]="0",n.join(".")})();if(Lit.includes(r))return r}function qit(e){return cr(e).with({familyDistro:"musl"},()=>(Ls('Trying platform-specific paths for "alpine"'),["/lib","/usr/lib"])).with({familyDistro:"debian"},({archFromUname:r})=>(Ls('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${r}-linux-gnu`,`/lib/${r}-linux-gnu`])).with({familyDistro:"rhel"},()=>(Ls('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:r,arch:n,archFromUname:o})=>(Ls(`Don't know any platform-specific paths for "${r}" on ${n} (${o})`),[]))}async function Git(e){let r='grep -v "libssl.so.0"',n=await sde(e);if(n){Ls(`Found libssl.so file using platform-specific paths: ${n}`);let a=ide(n);if(Ls(`The parsed libssl version is: ${a}`),a)return{libssl:a,strategy:"libssl-specific-path"}}Ls('Falling back to "ldconfig" and other generic paths');let o=await xF(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${r}`);if(o||(o=await sde(["/lib64","/usr/lib64","/lib","/usr/lib"])),o){Ls(`Found libssl.so file using "ldconfig" or other generic paths: ${o}`);let a=ide(o);if(Ls(`The parsed libssl version is: ${a}`),a)return{libssl:a,strategy:"ldconfig"}}let i=await xF("openssl version -v");if(i){Ls(`Found openssl binary with version: ${i}`);let a=Uit(i);if(Ls(`The parsed openssl version is: ${a}`),a)return{libssl:a,strategy:"openssl-binary"}}return Ls("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function sde(e){for(let r of e){let n=await Hit(r);if(n)return n}}async function Hit(e){try{return(await O9.default.readdir(e)).find(n=>n.startsWith("libssl.so.")&&!n.startsWith("libssl.so.0"))}catch(r){if(r.code==="ENOENT")return;throw r}}async function ua(){let{binaryTarget:e}=await pde();return e}function Wit(e){return e.binaryTarget!==void 0}async function F9(){let{memoized:e,...r}=await pde();return r}var gF={};async function pde(){if(Wit(gF))return Promise.resolve({...gF,memoized:!0});let e=await ude(),r=Vit(e);return gF={...e,binaryTarget:r},{...gF,memoized:!1}}function Vit(e){let{platform:r,arch:n,archFromUname:o,libssl:i,targetDistro:a,familyDistro:c,originalDistro:u}=e;r==="linux"&&!["x64","arm64"].includes(n)&&hF(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${n}" 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 "${o}".`);let l="1.1.x";if(r==="linux"&&i===void 0){let f=cr({familyDistro:c}).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.");hF(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}".
${f}`)}let p="debian";if(r==="linux"&&a===void 0&&Ls(`Distro is "${u}". Falling back to Prisma engines built for "${p}".`),r==="darwin"&&n==="arm64")return"darwin-arm64";if(r==="darwin")return"darwin";if(r==="win32")return"windows";if(r==="freebsd")return a;if(r==="openbsd")return"openbsd";if(r==="netbsd")return"netbsd";if(r==="linux"&&a==="nixos")return"linux-nixos";if(r==="linux"&&n==="arm64")return`${a==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(r==="linux"&&n==="arm")return`linux-arm-openssl-${i||l}`;if(r==="linux"&&a==="musl"){let f="linux-musl";return!i||fde(i)?f:`${f}-openssl-${i}`}return r==="linux"&&a&&i?`${a}-openssl-${i}`:(r!=="linux"&&hF(`Prisma detected unknown OS "${r}" and may not work as expected. Defaulting to "linux".`),i?`${p}-openssl-${i}`:a?`${a}-openssl-${l}`:`${p}-openssl-${l}`)}async function zit(e){try{return await e()}catch{return}}function xF(e){return zit(async()=>{let r=await Nit(e);return Ls(`Command "${e}" successfully returned "${r.stdout}"`),r.stdout})}async function Kit(){return typeof yF.default.machine=="function"?yF.default.machine():(await xF("uname -m"))?.trim()}function fde(e){return e.startsWith("1.")}var $0={};Ja($0,{beep:()=>vst,clearScreen:()=>gst,clearTerminal:()=>yst,cursorBackward:()=>tst,cursorDown:()=>Xit,cursorForward:()=>est,cursorGetPosition:()=>ost,cursorHide:()=>ast,cursorLeft:()=>hde,cursorMove:()=>Qit,cursorNextLine:()=>ist,cursorPrevLine:()=>sst,cursorRestorePosition:()=>nst,cursorSavePosition:()=>rst,cursorShow:()=>cst,cursorTo:()=>Zit,cursorUp:()=>mde,enterAlternativeScreen:()=>xst,eraseDown:()=>fst,eraseEndLine:()=>lst,eraseLine:()=>gde,eraseLines:()=>ust,eraseScreen:()=>I9,eraseStartLine:()=>pst,eraseUp:()=>dst,exitAlternativeScreen:()=>bst,iTerm:()=>Sst,image:()=>wst,link:()=>Est,scrollDown:()=>hst,scrollUp:()=>mst});var vF=W(require("node:process"),1);var bF=globalThis.window?.document!==void 0,mur=globalThis.process?.versions?.node!==void 0,hur=globalThis.process?.versions?.bun!==void 0,gur=globalThis.Deno?.version?.deno!==void 0,yur=globalThis.process?.versions?.electron!==void 0,xur=globalThis.navigator?.userAgent?.includes("jsdom")===!0,bur=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,vur=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,Eur=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,wur=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,$_=globalThis.navigator?.userAgentData?.platform,Sur=$_==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",_ur=$_==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",Tur=$_==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",Dur=$_==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),Cur=$_==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var Nr="\x1B[",L_="\x1B]",wv="\x07",N_=";",dde=!bF&&vF.default.env.TERM_PROGRAM==="Apple_Terminal",Jit=!bF&&vF.default.platform==="win32",Yit=bF?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:vF.default.cwd,Zit=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof r!="number"?Nr+(e+1)+"G":Nr+(r+1)+N_+(e+1)+"H"},Qit=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let n="";return e<0?n+=Nr+-e+"D":e>0&&(n+=Nr+e+"C"),r<0?n+=Nr+-r+"A":r>0&&(n+=Nr+r+"B"),n},mde=(e=1)=>Nr+e+"A",Xit=(e=1)=>Nr+e+"B",est=(e=1)=>Nr+e+"C",tst=(e=1)=>Nr+e+"D",hde=Nr+"G",rst=dde?"\x1B7":Nr+"s",nst=dde?"\x1B8":Nr+"u",ost=Nr+"6n",ist=Nr+"E",sst=Nr+"F",ast=Nr+"?25l",cst=Nr+"?25h",ust=e=>{let r="";for(let
`:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===r&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}var B_=W(require("node:process"),1),Dv=W(require("node:path"),1),K9=require("node:url");function _F(e={}){let{env:r=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(r).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"}var Xst=({cwd:e=B_.default.cwd(),path:r=B_.default.env[_F()],preferLocal:n=!0,execPath:o=B_.default.execPath,addExecPath:i=!0}={})=>{let a=e instanceof URL?(0,K9.fileURLToPath)(e):e,c=Dv.default.resolve(a),u=[];return n&&eat(u,c),i&&tat(u,o,c),[...u,r].join(Dv.default.delimiter)},eat=(e,r)=>{let n;for(;n!==r;)e.push(Dv.default.join(r,"node_modules/.bin")),n=r,r=Dv.default.resolve(r,"..")},tat=(e,r,n)=>{let o=r instanceof URL?(0,K9.fileURLToPath)(r):r;e.push(Dv.default.resolve(n,o,".."))},lme=({env:e=B_.default.env,...r}={})=>{e={...e};let n=_F({env:e});return r.path=e[n],e[n]=Xst(r),e};var rat=(e,r,n,o)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(r,n);!nat(i,a)&&o||Object.defineProperty(e,n,a)},nat=function(e,r){return e===void 0||e.configurable||e.writable===r.writable&&e.enumerable===r.enumerable&&e.configurable===r.configurable&&(e.writable||e.value===r.value)},oat=(e,r)=>{let n=Object.getPrototypeOf(r);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},iat=(e,r)=>`/* Wrapped ${e}*/
${r}`,sat=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),aat=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),cat=(e,r,n)=>{let o=n===""?"":`with ${n.trim()}() `,i=iat.bind(null,o,r.toString());Object.defineProperty(i,"name",aat),Object.defineProperty(e,"toString",{...sat,value:i})};function J9(e,r,{ignoreNonConfigurable:n=!1}={}){let{name:o}=e;for(let i of Reflect.ownKeys(r))rat(e,r,i,n);return oat(e,r),cat(e,r,o),e}var TF=new WeakMap,pme=(e,r={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,o=0,i=e.displayName||e.name||"<anonymous>",a=function(...c){if(TF.set(a,++o),o===1)n=e.apply(this,c),e=null;else if(r.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return J9(a,e),TF.set(a,o),a};pme.callCount=e=>{if(!TF.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return TF.get(e)};var fme=pme;var vme=W(require("node:process"),1);var xme=require("node:os");var dme=()=>{let e=hme-mme+1;return Array.from({length:e},uat)},uat=(e,r)=>({name:`SIGRT${r+1}`,number:mme+r,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),mme=34,hme=64;var yme=require("node:os");var gme=[{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",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"
${o.message}`:_,C=[P,r,e].filter(Boolean).join(`
`);return D?(o.originalMessage=o.message,o.message=C):o=new Error(C),o.shortMessage=P,o.command=c,o.escapedCommand=u,o.exitCode=a,o.signal=i,o.signalDescription=b,o.stdout=e,o.stderr=r,o.cwd=x,n!==void 0&&(o.all=n),"bufferedData"in o&&delete o.bufferedData,o.failed=!0,o.timedOut=!!l,o.isCanceled=p,o.killed=f&&!l,o};var DF=["stdin","stdout","stderr"],yat=e=>DF.some(r=>e[r]!==void 0),Eme=e=>{if(!e)return;let{stdio:r}=e;if(r===void 0)return DF.map(o=>e[o]);if(yat(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${DF.map(o=>`\`${o}\``).join(", ")}`);if(typeof r=="string")return r;if(!Array.isArray(r))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof r}\``);let n=Math.max(r.length,DF.length);return Array.from({length:n},(o,i)=>r[i])};var wme=W(require("node:os"),1);var L0=[];L0.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&L0.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&L0.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var CF=e=>!!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",Z9=Symbol.for("signal-exit emitter"),Q9=globalThis,xat=Object.defineProperty.bind(Object),X9=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Q9[Z9])return Q9[Z9];xat(Q9,Z9,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(r,n){this.listeners[r].push(n)}removeListener(r,n){let o=this.listeners[r],i=o.indexOf(n);i!==-1&&(i===0&&o.length===1?o.length=0:o.splice(i,1))}emit(r,n,o){if(this.emitted[r])return!1;this.emitted[r]=!0;let i=!1;for(let a of this.listeners[r])i=a(n,o)===!0||i;return r==="exit"&&(i=this.emit("afterExit",n,o)||i),i}},AF=class{},bat=e=>({onExit(r,n){return e.onExit(r,n)},load(){return e.load()},unload(){return e.unload()}}),eU=class extends AF{onExit(){return()=>{}}load(){}unload(){}},tU=class extends AF{#e=rU.platform==="win32"?"SIGINT":"SIGHUP";#t=new X9;#r;#o;#i;#n={};#s=!1;constructor(r){super(),this.#r=r,this.#n={};for(let n of L0)this.#n[n]=()=>{let o=this.#r.listeners(n),{count:i}=this.#t,a=r;if(typeof a.__signal_exit_emitter__=="object"&&typeof a.__signal_exit_emitter__.count=="number"&&(i+=a.__signal_exit_emitter__.count),o.length===i){this.unload();let c=this.#t.emit("exit",null,n),u=n==="SIGHUP"?this.#e:n;c||r.kill(r.pid,u)}};this.#i=r.reallyExit,this.#o=r.emit}onExit(r,n){if(!CF(this.#r))return()=>{};this.#s===!1&&this.load();let o=n?.alwaysLast?"afterExit":"exit";return this.#t.on(o,r),()=>{this.#t.removeListener(o,r),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#t.count+=1;for(let r of L0)try{let n=this.#n[r];n&&this.#r.on(r,n)}catch{}this.#r.emit=(r,...n)=>this.#c(r,...n),this.#r.reallyExit=r=>this.#a(r)}}unload(){this.#s&&(this.#s=!1,L0.forEach(r=>{let n=this.#n[r];if(!n)throw new Error("Listener not defined for signal: "+r);try{this.#r.removeListener(r,n)}catch{}}),this.#r.emit=this.#o,this.#r.reallyExit=this.#i,this.#t.count-=1)}#a(r){return CF(this.#r)?(this.#r.exitCode=r||0,this.#t.emit("exit",this.#r.exitCode,null),this.#i.call(this.#r,this.#r.exitCode)):0}#c(r,...n){let o=this.#o;if(r==="exit"&&CF(this.#r)){typeof n[0]=="number"&&(this.#r.exitCode=n[0]);let i=o.call(this.#r,r,...n);return this.#t.emit("exit",this.#r.exitCode,null),i}else return o.call(this.#r,r,...n)}},rU=globalThis.process,{onExit:Cv,load:ylr,unload:xlr}=bat(CF(rU)?new tU(rU):new eU);var vat=1e3*5,Sme=(e,r="SIGTERM",n={})=>{let o=e(r);return Eat(e,r,n,o),o},Eat=(e,r,n,o)=>{if(!wat(r,n,o))return;let i=_at(n),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},wat=(e,{forceKillAfterTimeout:r},n)=>Sat(e)&&r!==!1&&n,Sat=e=>e===wme.default.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",_at=({forceKillAfterTimeout:
`)};var ect=1e3*1e3*100,tct=({env:e,extendEnv:r,preferLocal:n,localDir:o,execPath:i})=>{let a=r?{...q_.default.env,...e}:e;return n?lme({env:a,cwd:o,execPath:i}):a},uhe=(e,r,n={})=>{let o=che.default._parse(e,r,n);return e=o.command,r=o.args,n=o.options,n={maxBuffer:ect,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||q_.default.cwd(),execPath:q_.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:ohe,...n},n.env=tct(n),n.stdio=Eme(n),q_.default.platform==="win32"&&ahe.default.basename(e,".exe")==="cmd"&&r.unshift("/q"),{file:e,args:r,options:n,parsed:o}},G_=(e,r,n)=>typeof r!="string"&&!she.Buffer.isBuffer(r)?n===void 0?void 0:"":e.stripFinalNewline?z9(r):r;function Zm(e,r,n){let o=uhe(e,r,n),i=mU(e,r),a=hU(e,r);yU(a,o.options),Dme(o.options);let c;try{c=NF.default.spawn(o.file,o.args,o.options)}catch(b){let v=new NF.default.ChildProcess,S=Promise.reject(j_({error:b,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:o,timedOut:!1,isCanceled:!1,killed:!1}));return dU(v,S),v}let u=Kme(c),l=Tme(c,o.options,u),p=Cme(c,o.options,l),f={isCanceled:!1};c.kill=Sme.bind(null,c.kill.bind(c)),c.cancel=_me.bind(null,c,f);let x=fme(async()=>{let[{error:b,exitCode:v,signal:S,timedOut:_},D,P,C]=await zme(c,o.options,p),O=G_(o.options,D),I=G_(o.options,P),k=G_(o.options,C);if(b||v!==0||S!==null){let j=j_({error:b,exitCode:v,signal:S,stdout:O,stderr:I,all:k,command:i,escapedCommand:a,parsed:o,timedOut:_,isCanceled:f.isCanceled||(o.options.signal?o.options.signal.aborted:!1),killed:c.killed});if(!o.options.reject)return j;throw j}return{command:i,escapedCommand:a,exitCode:0,stdout:O,stderr:I,all:k,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Wme(c,o.options),c.all=Vme(c,o.options),Ome(c),dU(c,x),c}function rct(e,r,n){let o=uhe(e,r,n),i=mU(e,r),a=hU(e,r);yU(a,o.options);let c=Hme(o.options),u;try{u=NF.default.spawnSync(o.file,o.args,{...o.options,input:c})}catch(f){throw j_({error:f,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:o,timedOut:!1,isCanceled:!1,killed:!1})}let l=G_(o.options,u.stdout,u.error),p=G_(o.options,u.stderr,u.error);if(u.error||u.status!==0||u.signal!==null){let f=j_({stdout:l,stderr:p,error:u.error,signal:u.signal,exitCode:u.status,command:i,escapedCommand:a,parsed:o,timedOut:u.error&&u.error.code==="ETIMEDOUT",isCanceled:!1,killed:u.signal!==null});if(!o.options.reject)return f;throw f}return{command:i,escapedCommand:a,exitCode:0,stdout:l,stderr:p,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var nct=({input:e,inputFile:r,stdio:n})=>e===void 0&&r===void 0&&n===void 0?{stdin:"inherit"}:{},ihe=(e={})=>({preferLocal:!0,...nct(e),...e});function lhe(e){function r(n,...o){if(!Array.isArray(n))return lhe({...e,...n});let[i,...a]=gU(n,o);return Zm(i,a,ihe(e))}return r.sync=(n,...o)=>{if(!Array.isArray(n))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[i,...a]=gU(n,o);return rct(i,a,ihe(e))},r}var lpr=lhe();function phe(e,r){let[n,...o]=the(e);return Zm(n,o,r)}var TH=W(yh());async function zG(e,r,{concurrency:n=Number.POSITIVE_INFINITY,stopOnError:o=!0,signal:i}={}){return new Promise((a,c)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof r!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(n)&&n>=1||n===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);let u=[],l=[],p=new Map,f=!1,g=!1,x=!1,b=0,v=0,S=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),_=()=>{C(i.reason)},D=()=>{i?.removeEventListener("abort",_)},P=I=>{a(I),D()},C=I=>{f=!0,g=!0,c(I),D()};i&&(i.aborted&&C(i.reason),i.addEventListener("abort",_,{once:!0}));let O=async()=>{if(g)return;let I=await S.next(),k=v;if(v++,I.done){if(x=!0,b===0&&!g){if(!o&&l.length>0){C(new AggregateError(l));return}if(g=!0,p.size===0){P(u);return
\r
`),o=!1,i=!1,a;e.on("response",c=>{let{headers:u}=c;o=u["transfer-encoding"]==="chunked"&&!u["content-length"]}),e.on("socket",c=>{let u=()=>{if(o&&!i){let p=new Error("Premature close");p.code="ERR_STREAM_PREMATURE_CLOSE",r(p)}},l=p=>{i=DT.Buffer.compare(p.slice(-5),n)===0,!i&&a&&(i=DT.Buffer.compare(a.slice(-3),n.slice(0,3))===0&&DT.Buffer.compare(p.slice(-2),n.slice(3))===0),a=p};c.prependListener("close",u),c.on("data",l),e.on("close",()=>{c.removeListener("close",u),c.removeListener("data",l)})})}var vH=W(l1e()),Y1e=W(iEe());var G1e=W(A1e()),H1e=W(q1e()),xH=lt("prisma:fetch-engine:getProxyAgent");function W1e(e){return e.replace(/^\.*/,".").toLowerCase()}function qbt(e){e=e.trim().toLowerCase();let r=e.split(":",2),n=W1e(r[0]),o=r[1],i=e.includes(":");return{hostname:n,port:o,hasPort:i}}function Gbt(e,r){let n=e.port||(e.protocol==="https:"?"443":"80"),o=W1e(e.hostname);return r.split(",").map(qbt).some(function(a){let c=o.indexOf(a.hostname),u=c>-1&&c===o.length-a.hostname.length;return a.hasPort?n===a.port&&u:u})}function Hbt(e){let r=process.env.NO_PROXY||process.env.no_proxy||"";if(r&&xH(`noProxy is set to "${r}"`),r==="*"||r!==""&&Gbt(e,r))return null;if(e.protocol==="http:"){let n=process.env.HTTP_PROXY||process.env.http_proxy||null;return n&&xH(`uri.protocol is HTTP and the URL for the proxy is "${n}"`),n}if(e.protocol==="https:"){let n=process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||null;return n&&xH(`uri.protocol is HTTPS and the URL for the proxy is "${n}"`),n}return null}function aE(e){try{let r=new URL(e),n=Hbt(r);if(n){if(r.protocol==="http:")try{return new G1e.HttpProxyAgent(n)}catch(o){throw new Error(`Error while instantiating HttpProxyAgent with URL: "${n}"
${o}
Check the following env vars "http_proxy" or "HTTP_PROXY". The value should be a valid URL starting with "http://"`)}else if(r.protocol==="https:")try{return new H1e.HttpsProxyAgent(n)}catch(o){throw new Error(`Error while instantiating HttpsProxyAgent with URL: "${n}"
${o}
Check the following env vars "https_proxy" or "HTTPS_PROXY". The value should be a valid URL starting with "https://"`)}}else return}catch(r){console.warn("An error occurred in getProxyAgent(), no proxy agent will be used.",r)}}var xM=lt("prisma:fetch-engine:downloadZip"),V1e=e=>EH.default.promises.rm(e,{force:!0,recursive:!0});async function z1e(e){try{let r=`${e}.sha256`,n=await iy(r,{agent:aE(e)});if(!n.ok){let a=`Failed to fetch sha256 checksum at ${r} - ${n.status} ${n.statusText}`;throw process.env.PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING||(a+=`
If you need to ignore this error (e.g. in an offline environment), set the PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING environment variable to a truthy value.
Example: PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING=1`),new Error(a)}let o=await n.text(),[i]=o.split(/\s+/);if(!/^[a-f0-9]{64}$/gi.test(i))throw new Error(`Unable to parse checksum from ${r} - response body: ${o}`);return i}catch(r){if(process.env.PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING)return xM(`fetchChecksum() failed and was ignored as the PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING environment variable is truthy.
Error: ${r}`),null;throw r}}async function Z1e(e,r,n){let o=Y1e.default.directory(),i=K1e.default.join(o,"partial"),a=2,[c,u]=await(0,vH.default)(async()=>await Promise.all([z1e(e),z1e(e.slice(0,e.length-3))]),{retries:a,onFailedAttempt:p=>xM("An error occurred while downloading the checksums files",p)}),l=await(0,vH.default)(async()=>{let p=await iy(e,{compress:!1,agent:aE(e)});if(!p.ok)throw new Error(`Failed to fetch the engine file at ${e} - ${p.status} ${p.statusText}`);let f=p.headers.get("last-modified"),g=parseFloat(p.headers.get("content-length")),x=EH.default.createWriteStream(i);return await new Promise(async(b,v)=>{let S=0;if(p.body===null)return v(new Error(`Failed to fetch the engine file at ${e} - response.body is null`));p.body.once("error",v).on("data",k=>{S+=k.length,g&&n&&n(S/g)});let _=J1e.default.createGunzip();_.on("error",v);let D=p.body.pipe(_),P=bH.default.fromStream(p.body,{algorithm:"sha256"}),C=bH.default.fromStream(D,{algorithm:"sha256"});D.pipe(x),x.on("error",v).on("close",()=>{b({lastModified:f,sha256:u,zippedSha256:c})});let O=await C,I=await P;if(c!==null&&c!==I)return v(new Error(`sha256 checksum of ${e} (zipped) should be ${c} but is ${I}`));if(u!==null&&u!==O)return v(new Error(`sha256 checksum of ${e} (unzipped) should be ${u} but is ${O}`))})},{retries:a,onFailedAttempt:p=>xM("An error occurred while downloading the engine file",p)});await xh(i,r);try{await V1e(i),await V1e(o)}catch(p){xM(p)}return l}var Q1e=W(require("node:fs")),X1e=W(require("node:path"));var Wbt=lt("prisma:fetch-engine:env"),wH={"schema-engine":"PRISMA_SCHEMA_ENGINE_BINARY"},Vbt={"schema-engine":"PRISMA_MIGRATION_ENGINE_BINARY"};function cy(e){let r=zbt(e);if(process.env[r]){let n=X1e.default.resolve(process.cwd(),process.env[r]);if(!Q1e.default.existsSync(n))throw new Error(`Env var ${q(r)} is provided but provided path ${sn(process.env[r])} can't be resolved.`);return Wbt(`Using env var ${q(r)} for binary ${q(e)}, which points to ${sn(process.env[r])}`),{path:n,fromEnvVar:r}}return null}function zbt(e){let r=wH[e],n=Vbt[e];return n&&process.env[n]?process.env[r]?(console.warn(`${Gt("prisma:warn")} Both ${q(r)} and ${q(n)} are specified, ${q(r)} takes precedence. ${q(n)} is deprecated.`),r):(console.warn(`${Gt("prisma:warn")} ${q(n)} environment variable is deprecated, please use ${q(r)} instead`),n):r}function e_e(e){for(let r of e)if(!cy(r))return!1;return!0}var t_e=W(require("node:crypto")),r_e=W(require("node:fs"));function SH(e){let r=t_e.default.createHash("sha256"),n=r_e.default.createReadStream(e);return new Promise(o=>{n.on("readable",()=>{let i=n.read();i?r.update(i):o(r.digest("hex"))})})}var c_e=W(a_e());function u_e(e){return new c_e.default(`> ${e} [:bar] :percent`,{stream:process.stdout,width:20,complete:"=",incomplete:" ",total:100,head:"",clear:!0})}var{enginesOverride:p_e}=l_e(),Dp=lt("prisma:fetch-engine:download"),_H=(0,f_e.promisify)(ga.default.exists),m_e="master",h_e=/^((\w:[\\\/])|\/)snapshot[\/\\]/;async function bM(e){if(!e.binaries||Object.values(e.binaries).length===0)return{};(p_e?.branch||p_e?.folder)&&(e.version="_local_",e.skipCacheIntegrityCheck=!0);let{binaryTarget:r,...n}=await F9();n.targetDistro&&["nixos"].includes(n.targetDistro)&&!e_e(Object.keys(e.binaries))?console.error(`${Gt("Warning")} Precompiled engine files are not available for ${n.targetDistro}, please provide the paths via environment variables, see https://pris.ly/d/custom-engines`):["freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd"].includes(r)&&console.error(`${Gt("Warning")} Precompiled engine files are not available for ${r}. Read more about building your own engines at https://pris.ly/d/build-engines`);let o={...e,binaryTargets:e.binaryTargets??[r],version:e.version??"latest",binaries:e.binaries},i=Object.entries(o.binaries).flatMap(([u,l])=>o.binaryTargets.map(p=>{let f=Xbt(u,p),g=Cp.default.join(l,f);return{binaryName:u,targetFolder:l,binaryTarget:p,fileName:f,targetFilePath:g,envVarPath:cy(u)?.path,skipCacheIntegrityCheck:!!o.skipCacheIntegrityCheck}}));process.env.BINARY_DO
Using an Accelerate URL is not supported for this CLI command ${me(`prisma ${e}`)} yet.
Please use a direct connection to your database in \`prisma.config.ts\`.
More information about this limitation: ${Pt("https://pris.ly/d/accelerate-limitations")}
`;function ii({cmd:e,validatedConfig:r}){if(r.datasource.url.startsWith("prisma://"))throw new Error(ivt(e))}var AT=W(require("node:path"));function Zi(e,r,n=process.cwd()){let o=e?.schemaRootDir??AT.default.join(n,"prisma");return{viewsDirPath:r?.views?.path??AT.default.join(o,"views"),typedSqlDirPath:r?.typedSql?.path??AT.default.join(o,"sql"),migrationsDirPath:r?.migrations?.path??AT.default.join(o,"migrations")}}var CH=W(require("path"));function Kf(e){return e<1e3?`${e}ms`:(e/1e3).toFixed(2)+"s"}function To(e){if(e.fromEnvVar&&e.fromEnvVar!="null"){let r=process.env[e.fromEnvVar];if(!r)throw new Error(`Attempted to load provider value using \`env(${e.fromEnvVar})\` but it was not present. Please ensure that ${ae(e.fromEnvVar)} is present in your Environment Variables`);return r}return e.value}function DH(e){if(e.fromEnvVar&&e.fromEnvVar!="null"){let r=process.env[e.fromEnvVar];if(!r)throw new Error(`Attempted to load binaryTargets value using \`env(${e.fromEnvVar})\` but it was not present. Please ensure that ${ae(e.fromEnvVar)} is present in your Environment Variables`);return JSON.parse(r)}return e.value}function AH(e,r){let n=e.getPrettyName(),o=svt(e),i=avt(e);return`\u2714 Generated ${q(n)}${o?` (${o})`:""}${i} in ${Kf(r)}`}function svt(e){let r=e.manifest?.version;return e.getProvider()==="prisma-client-js"?`v${r??"?.?.?"}`:r}function avt(e){let r=e.options?.generator.output;return r?ae(` to .${CH.default.sep}${CH.default.relative(process.cwd(),To(r))}`):""}var PT=W(w_e()),IH=W(require("fs"));var vh=W(require("path")),RH=require("util"),Svt=(0,RH.promisify)(IH.default.readFile),_vt=(0,RH.promisify)(IH.default.stat),MH=_i("prisma:getSchema");function hr({schemaPathFromArgs:e,schemaPathFromConfig:r,baseDir:n}){return e?{cliProvidedPath:e}:r?{configProvidedPath:r}:{baseDir:n}}async function Qi({schemaPath:e,cwd:r=process.cwd(),argumentName:n="--schema"}){let o=await T_e({schemaPath:e,cwd:r,argumentName:n});if(o.ok)return o.schema;throw new Error(Dvt(o.error,r))}async function kH({schemaPath:e,cwd:r=process.cwd(),argumentName:n="--schema"}){let o=await T_e({schemaPath:e,cwd:r,argumentName:n});return o.ok?o.schema:null}function Jf(e){process.stderr.write(ae(`Prisma schema loaded from ${vh.default.relative(process.cwd(),e)}.`)+`
`)}async function S_e(e){MH("Reading schema from single file",e);let r=await(0,PT.ensureType)(e,"file");if(r)return{ok:!1,error:r};let n=await Svt(e,{encoding:"utf-8"}),o=[e,n];return{ok:!0,schema:{schemaPath:e,schemaRootDir:vh.default.dirname(e),schemas:[o]}}}async function Tvt(e){MH("Reading schema from multiple files",e);let r=await(0,PT.ensureType)(e,"directory");if(r)return{ok:!1,error:r};let n=await(0,PT.loadSchemaFiles)(e);return{ok:!0,schema:{schemaPath:e,schemaRootDir:e,schemas:n}}}async function __e(e){let r;try{r=await _vt(e)}catch(n){if(n.code==="ENOENT")return{ok:!1,error:{kind:"NotFound",path:e}};throw n}return r.isFile()?S_e(e):r.isDirectory()?Tvt(e):{ok:!1,error:{kind:"WrongType",path:e,expectedTypes:["file","directory"]}}}async function T_e({schemaPath:e,cwd:r,argumentName:n}){if("cliProvidedPath"in e)return{ok:!0,schema:await Cvt(e.cliProvidedPath,r,n)};if("configProvidedPath"in e)return{ok:!0,schema:await Avt(e.configProvidedPath)};let o=await Pvt(e.baseDir);return o.ok?o:{ok:!1,error:o.error}}function $H(e){switch(e.kind){case"NotFound":return`${e.expectedType??"file or directory"} not found`;case"WrongType":return`expected ${e.expectedTypes.join(" or ")}`}}function Dvt(e,r){let n=["Could not find Prisma Schema that is required for this command.",`You can either provide it with ${me("`--schema`")} argument,`,`set it in your Prisma Config file (e.g., ${me("`prisma.config.ts`")}),`,`set it as ${me("`prisma.schema`")} in your ${me("package.json")},`,`or put it into the default location (${me("`./prisma/schema.prisma`")}, or ${me("`./schema.prisma`")}.`,`Checked following paths:
`],o=new Set;for(let i of e.failures){let a=i.path;o.has(i.path)||(n.push(`${vh.default.relative(r,a)}: ${$H(i.error)}`),o.add(a))}return n.push(`
See also https://pris.ly/d/prisma-schema-location`),n.join(`
`)}async function Cvt(e,r=process.cwd(),n="--schema"){let o=vh.default.resolve(r,e),i=await __e(o);if(!i.ok){let a=vh.default.relative(r,o);throw new Error(`Could not load \`${n}\` from provided path \`${a}\`: ${$H(i.error)}`)}return i.schema}async function Avt(e){let r=await __e(e);if(!r.ok)throw new Error(`Could not load schema from \`${e}\` provided by "prisma.config.ts"\`: ${$H(r.error)}`);return r.schema}async function Pvt(e,r=[]){let n=[vh.default.join(e,"schema.prisma"),vh.default.join(e,"prisma","schema.prisma")];for(let o of n){MH(`Checking existence of ${o}`);let i=await S_e(o);if(!i.ok){r.push({path:o,error:i.error});continue}return i}return{ok:!1,error:{kind:"NotFoundMultipleLocations",failures:r}}}async function Ovt(){try{return await import("node:process")}catch{return null}}async function NH(){try{return(await import("typescript")).default.version}catch{return(await Ovt())?.versions.typescript||"unknown"}}var LH=W(require("crypto"));async function OT(e){let r=(await Qi({schemaPath:e}))?.schemaPath??process.cwd();return LH.default.createHash("sha256").update(r).digest("hex").substring(0,8)}function FT(){let e=process.argv[1];return LH.default.createHash("sha256").update(e).digest("hex").substring(0,8)}function uy(e,r){return new We(`
${q(he("!"))} Unknown command "${r}"
${e}`)}var We=class e extends Error{constructor(r){super(r),this.name="HelpError",Object.setPrototypeOf(this,e.prototype)}};var LTe=W(require("node:path"));var Oi=class extends Error{__typename="RustPanic";request;rustStack;area;introspectionUrl;constructor(r,n,o,i,a){super(r),this.name="RustPanic",this.rustStack=n,this.request=o,this.area=i,this.introspectionUrl=a}};function BH(e){return e.__typename==="RustPanic"}function Yf(e){return e.name==="RuntimeError"}function lc(e){let r=globalThis.PRISMA_WASM_PANIC_REGISTRY.get(),n=[r,...(e.stack||"NO_BACKTRACE").split(`
`).slice(1)].join(`
`);return{message:r,stack:n}}var CM={};Ja(CM,{prismaSchemaWasm:()=>Ii.default,prismaSchemaWasmVersion:()=>Nvt,schemaEngineWasmVersion:()=>Lvt});var Ii=W(P_e());var DM=class{message="";get(){return`${this.message}`}set_message(r){this.message=`RuntimeError: ${r}`}};var $vt=globalThis;$vt.PRISMA_WASM_PANIC_REGISTRY=new DM;var{dependencies:O_e}=jH();var Nvt=O_e["@prisma/prisma-schema-wasm"],Lvt=O_e["@prisma/schema-engine-wasm"];function RT({schemas:e}){let r=Ii.default.lint(JSON.stringify(e));return JSON.parse(r)}function UH(e){try{return e()}catch(r){let{message:n,stack:o}=lc(r);throw new Oi(n,o,"@prisma/prisma-schema-wasm lint","FMT_CLI")}}function Bvt(e){return e.filter(Uvt)}function MT(e){let r=Bvt(e),n=[];if(r.length>0){n.push(Gt(`
Prisma schema warning${r.length>1?"s":""}:`));for(let o of r)n.push(jvt(o))}return n.join(`
`)}function jvt(e){return Gt(`- ${e.text}`)}function Uvt(e){return e.is_warning}var F_e=lt("prisma:format");async function qH({schemas:e},r){process.env.FORCE_PANIC_PRISMA_SCHEMA&&I_e(()=>{Ii.default.debug_panic()});let o={textDocument:{uri:"file:/dev/null"},options:{...{tabSize:2,insertSpaces:!0},...r}},{formattedMultipleSchemas:i,lintDiagnostics:a}=I_e(()=>{let u=qvt(JSON.stringify(e),o),l=JSON.parse(u),p=RT({schemas:l});return{formattedMultipleSchemas:l,lintDiagnostics:p}}),c=MT(a);return c&&il.should.warn()&&console.warn(c),Promise.resolve(i)}function I_e(e){try{return e()}catch(r){let{message:n,stack:o}=lc(r);throw F_e(`Error formatting schema: ${n}`),F_e(o),new Oi(n,o,"@prisma/prisma-schema-wasm format","FMT_CLI")}}function qvt(e,r){return Ii.default.format(e,JSON.stringify(r))}var Gvt=function(e,r,n){if(n||arguments.length===2)for(var o=0,i=r.length,a;o<i;o++)(a||!(o in r))&&(a||(a=Array.prototype.slice.call(r,0,o)),a[o]=r[o]);return e.concat(a||Array.prototype.slice.call(r))};function kT(e){return e}function tu(e,r,n,o,i,a,c,u,l){switch(arguments.length){case 1:return e;case 2:return function(){return r(e.apply(this,arguments))};case 3:return function(){return n(r(e.apply(this,arguments)))};case 4:return function(){return o(n(r(e.apply(this,arguments))))};case 5:return function(){return i(o(n(r(e.apply(this,arguments)))))};case 6:return function(){return a(i(o(n(r(e.apply(this,arguments))))))};case 7:return function(){return c(a(i(o(n(r(e.apply(this,arguments)))))))};case 8:return function(){return u(c(a(i(o(n(r(e.apply(this,arguments))))))))};case 9:return function(){return l(u(c(a(i(o(n(r(e.apply(this,arguments)))))))))}}}function ya(e,r,n,o,i,a,c,u,l){switch(arguments.length){case 1:return e;case 2:return r(e);case 3:return n(r(e));case 4:return o(n(r(e)));case 5:return i(o(n(r(e))));case 6:return a(i(o(n(r(e)))));case 7:return c(a(i(o(n(r(e))))));case 8:return u(c(a(i(o(n(r(e)))))));case 9:return l(u(c(a(i(o(n(r(e))))))));default:{for(var p=arguments[0],f=1;f<arguments.length;f++)p=arguments[f](p);return p}}}var hn=function(e,r){var n=typeof e=="number"?function(o){return o.length>=e}:e;return function(){var o=Array.from(arguments);return n(arguments)?r.apply(this,o):function(i){return r.apply(void 0,Gvt([i],o,!1))}}};var R_e=function(e){return e._tag==="Some"},M_e={_tag:"None"},k_e=function(e){return{_tag:"Some",value:e}},GH=function(e){return e._tag==="Left"},$_e=function(e){return e._tag==="Right"},AM=function(e){return{_tag:"Left",left:e}},PM=function(e){return{_tag:"Right",right:e}};var HH=function(e,r){return hn(2,function(n,o){return r.flatMap(n,function(i){return e.fromIO(o(i))})})};function N_e(e,r){return function(n){return function(o){return e.ap(e.map(o,function(i){return function(a){return r.ap(i,a)}}),n)}}}function L_e(e,r){return function(n){return function(o){return e.map(o,function(i){return r.map(i,n)})}}}function Zf(e){return function(r,n){return e.map(r,function(){return n})}}function Eh(e){var r=Zf(e);return function(n){return r(n,void 0)}}function xa(e){return function(r,n){return e.chain(r,function(o){return e.map(n(o),function(){return o})})}}function WH(e){return function(r){return tu(r,e.fromEither)}}function IM(e,r){var n=WH(e),o=xa(r);return function(i,a){return o(i,n(a))}}var py=AM,Qf=PM,B_e=hn(2,function(e,r){return ba(e)?e:r(e.right)}),eW=function(e,r){return ya(e,fy(r))},j_e=function(e,r){return ya(e,Jvt(r))};var RM="Either";var fy=function(e){return function(r){return ba(r)?r:Qf(e(r.right))}},MM={URI:RM,map:eW},pyr=hn(2,Zf(MM)),fyr=Eh(MM);var Kvt=function(e){return function(r){return ba(r)?r:ba(e)?e:Qf(r.right(e.right))}},Jvt=Kvt,U_e={URI:RM,map:eW,ap:j_e};var Yvt={URI:RM,map:eW,ap:j_e,chain:B_e};var q_e=function(e,r){return function(n){return ba(n)?py(e(n.left)):Qf(r(n.right))}},G_e=function(e){return function(r){return ba(r)?py(e(r.left)):r}};var Zvt={URI:RM,fromEither:kT};var ba=GH,sl=$_e;var H_e=function(e){return function(r){return ba(r)?e(r.left):r.right}};var dyr=hn(2,xa(Yvt));var myr={fromEither:Zvt.fromEither};var ru=function(e,r){try{return Qf(e())}catch(n){return p
`)}var yEt=jH(),z_e=yEt.version;function wh(e){return`${e}
${LT([["Prisma CLI Version",z_e]])}`}var GM=W(an());var uE=M_e,kM=k_e;var xEt=function(e){return e._tag==="Left"?uE:kM(e.right)},K_e=function(e,r){return ya(e,nW(r))},bEt=function(e,r){return ya(e,vEt(r))};var rW="Option";var nW=function(e){return function(r){return lE(r)?uE:kM(e(r.value))}},J_e={URI:rW,map:K_e},Cyr=hn(2,Zf(J_e)),Ayr=Eh(J_e);var vEt=function(e){return function(r){return lE(r)||lE(e)?uE:kM(r.value(e.value))}};var EEt=hn(2,function(e,r){return lE(e)?uE:r(e.value)}),Y_e={URI:rW,map:K_e,ap:bEt,chain:EEt};var Pyr=hn(2,function(e,r){return lE(e)?r():e});var wEt=xEt,SEt={URI:rW,fromEither:wEt},Z_e=R_e,lE=function(e){return e._tag==="None"},_Et=function(e,r){return function(n){return lE(n)?e():r(n.value)}};var TEt=_Et,Q_e=TEt;var Oyr=hn(2,xa(Y_e)),Fyr=hn(2,IM(SEt,Y_e));var X_e=function(e){return e==null?uE:kM(e)};function eTe(e){return tu(Qf,e.of)}function tTe(e){return function(r){return e.map(r,Qf)}}function rTe(e){return L_e(e,MM)}function nTe(e){return N_e(e,U_e)}function oTe(e){return function(r,n){return e.chain(r,function(o){return ba(o)?e.of(o):n(o.right)})}}function iTe(e){return function(r,n,o){return e.map(r,q_e(n,o))}}function sTe(e){return function(r,n){return e.map(r,G_e(n))}}function aTe(e){return function(r){return function(n){return e.chain(n,function(o){return ba(o)?r(o.left):e.of(o)})}}}function cTe(e){var r=aTe(e);return function(n,o){return ya(n,r(function(i){return e.map(o(i),function(a){return ba(a)?a:py(i)})}))}}function $M(e,r){var n=xa(r);return function(o,i){return n(o,tu(i,e.fromIO))}}function uTe(e,r){var n=xa(r);return function(o,i){return n(o,tu(i,e.fromTask))}}var oW=function(e){return function(){return Promise.resolve().then(e)}};var NM=function(e,r){return ya(e,lTe(r))},iW=function(e,r){return ya(e,FEt(r))};var lTe=function(e){return function(r){return function(){return Promise.resolve().then(r).then(e)}}},FEt=function(e){return function(r){return function(){return Promise.all([Promise.resolve().then(r),Promise.resolve().then(e)]).then(function(n){var o=n[0],i=n[1];return o(i)})}}},LM=function(e){return function(){return Promise.resolve(e)}},BM=hn(2,function(e,r){return function(){return Promise.resolve().then(e).then(function(n){return r(n)()})}});var pE="Task";var my={URI:pE,map:NM},Kyr=hn(2,Zf(my)),Jyr=Eh(my);var pTe={URI:pE,of:LM},fTe={URI:pE,map:NM,ap:iW};var dTe={URI:pE,map:NM,ap:iW,chain:BM},sW={URI:pE,map:NM,of:LM,ap:iW,chain:BM};var mTe={URI:pE,fromIO:oW},IEt={flatMap:BM},REt={fromIO:mTe.fromIO},Yyr=HH(REt,IEt),Zyr=hn(2,xa(dTe)),Qyr=hn(2,$M(mTe,dTe));var kEt=function(e,r,n,o){function i(a){return a instanceof n?a:new n(function(c){c(a)})}return new(n||(n=Promise))(function(a,c){function u(f){try{p(o.next(f))}catch(g){c(g)}}function l(f){try{p(o.throw(f))}catch(g){c(g)}}function p(f){f.done?a(f.value):i(f.value).then(u,l)}p((o=o.apply(e,r||[])).next())})},$Et=function(e,r){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,i,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(p){return function(f){return l([p,f])}}function l(p){if(o)throw new TypeError("Generator is already executing.");for(;c&&(c=0,p[0]&&(n=0)),n;)try{if(o=1,i&&(a=p[0]&2?i.return:p[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,p[1])).done)return a;switch(i=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,i=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){n.label=p[1];break}if(p[0]===6&&n.label<a[1]){n.label=a[1],a=p;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(p);break}a[2]&&n.ops.pop(),n.trys.pop();continue}p=r.call(e,n)}catch(f){p=[6,f],i=0}finally{o=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};var hTe=eTe(pTe),gTe=tTe(my);var NEt=tu(oW,gTe);var yTe=NEt,LEt=gTe,BT=LM;var jM=function(e,r){return function(){return kEt(void 0,void 0,void 0,func
`,{reason:o,error:i})};function aW(e){return`${he(q("Prisma schema validation"))} - ${e}`}function _h({errorOutput:e,reason:r}){return(0,GM.pipe)(ru(()=>JSON.parse(e),()=>({_tag:"unparsed",message:e,reason:r})),fy(o=>{let i=he(q(pc(o.message))),a=cr(o).with({error_code:"P1012"},c=>({reason:aW(r),errorCode:c.error_code})).with({error_code:Qa.string},c=>({reason:r,errorCode:c.error_code})).otherwise(()=>({reason:r}));return{_tag:"parsed",message:i,...a}}),H_e(GM.identity))}var HM=lt("prisma:getConfig"),GEt="P1012",UT=class extends Error{constructor(r){let o=`${cr(r).with({_tag:"parsed"},({errorCode:i,message:a,reason:c})=>{let u=i?`Error code: ${i}`:"";return`${c}
${u}
${a}`}).with({_tag:"unparsed"},({message:i,reason:a})=>{let c=he(q("Details:"));return`${a}
${c} ${i}`}).exhaustive()}
[Context: getConfig]`;super(wh(o)),this.name="GetConfigError"}};async function hy(e){let r=Sh(HM,"getConfigWasm");HM("Using getConfig Wasm");let n=(0,TTe.pipe)(ru(()=>{process.env.FORCE_PANIC_GET_CONFIG&&(HM("Triggering a Rust panic..."),Ii.default.debug_panic());let i=JSON.stringify({prismaSchema:e.datamodel});return Ii.default.get_config(i)},i=>({type:"wasm-error",reason:"(get-config wasm)",error:i})),fy(i=>({result:i})),$T(({result:i})=>ru(()=>JSON.parse(i),a=>({type:"parse-json",reason:"Unable to parse JSON",error:a}))),$T(i=>i.errors.length>0?py({type:"validation-error",reason:"(get-config wasm)",error:i.errors}):Qf(i.config)));if(sl(n)){HM("config data retrieved without errors in getConfig Wasm");let{right:i}=n;for(let a of i.generators)await DTe(a);return Promise.resolve(i)}throw cr(n.left).with({type:"wasm-error"},i=>{if(r(i),Yf(i.error)){let{message:c,stack:u}=lc(i.error);return new Oi(c,u,"@prisma/prisma-schema-wasm get_config","FMT_CLI")}let a=i.error.message;return new UT(_h({errorOutput:a,reason:i.reason}))}).with({type:"validation-error"},i=>new UT({_tag:"parsed",errorCode:GEt,reason:aW(i.reason),message:HEt(i.error)})).otherwise(i=>(r(i),new UT({_tag:"unparsed",message:i.error.message,reason:i.reason})))}async function DTe(e){for(let r of e.binaryTargets){if(r.fromEnvVar&&process.env[r.fromEnvVar]){let n=JSON.parse(process.env[r.fromEnvVar]);Array.isArray(n)?(e.binaryTargets=n.map(o=>({fromEnvVar:null,value:o})),await DTe(e)):r.value=n}r.value==="native"&&(r.value=await ua(),r.native=!0)}e.binaryTargets.length===0&&(e.binaryTargets=[{fromEnvVar:null,value:await ua(),native:!0}])}function HEt(e){let r=e.map(o=>pc(o.message)).join(`
`),n=`Validation Error Count: ${e.length}`;return`${r}
${n}`}var CTe=W(an());var WM=lt("prisma:getDMMF"),VM=class extends Error{constructor(r){let o=`${cr(r).with({_tag:"parsed"},({errorCode:i,message:a,reason:c})=>{let u=i?`Error code: ${i}`:"";return`${c}
${u}
${a}`}).with({_tag:"unparsed"},({message:i,reason:a})=>{let c=he(q("Details:"));return`${a}
${c} ${i}`}).exhaustive()}
[Context: getDmmf]`;super(wh(o)),this.name="GetDmmfError"}};async function qT(e){let r=Sh(WM,"getDmmfWasm");WM("Using getDmmf Wasm");let o=await(0,CTe.pipe)(ru(()=>{process.env.FORCE_PANIC_GET_DMMF&&(WM("Triggering a Rust panic..."),Ii.default.debug_panic());let a=JSON.stringify({prismaSchema:e.datamodel,noColor:!!process.env.NO_COLOR});return Ii.default.get_dmmf(a)},a=>({type:"wasm-error",reason:"(get-dmmf wasm)",error:a})),fy(a=>({result:a})),$T(({result:a})=>ru(()=>JSON.parse(a),c=>({type:"parse-json",reason:"Unable to parse JSON",error:c}))),BT)();if(sl(o)){WM("dmmf data retrieved without errors in getDmmf Wasm");let{right:a}=o;return Promise.resolve(a)}throw cr(o.left).with({type:"wasm-error"},a=>{if(r(a),Yf(a.error)){let{message:u,stack:l}=lc(a.error);return new Oi(u,l,"@prisma/prisma-schema-wasm get_dmmf","FMT_CLI")}let c=a.error.message;return new VM(_h({errorOutput:c,reason:a.reason}))}).with({type:"parse-json"},a=>(r(a),new VM({_tag:"unparsed",message:a.error.message,reason:a.reason}))).exhaustive()}var KM=W(an());var kTe=W(require("path"));var OTe=require("@prisma/engines");var Th=W(require("fs")),FTe=W(yh()),Dh=W(require("path")),ITe=W($I());var cW=W(require("fs")),ATe=lt("chmodPlusX");function PTe(e){if(process.platform==="win32")return;let r=cW.default.statSync(e),n=r.mode|64|8|1;if(r.mode===n){ATe(`Execution permissions of ${e} are fine`);return}let o=n.toString(8).slice(-3);ATe(`Have to call chmodPlusX on ${e}`),cW.default.chmodSync(e,o)}var uW=/^((\w:[\\\/])|\/)snapshot[\/\\]/;async function WEt(e){let r=await ua();return`${e}-${r}${r==="windows"?".exe":""}`}async function Ch(e,r){if(r&&!r.match(uW)&&Th.default.existsSync(r))return r;let n=cy(e);if(n!==null)return n.path;let o=await WEt(e),i=Dh.default.join((0,OTe.getEnginesPath)(),o);if(Th.default.existsSync(i))return zM(i);let a=Dh.default.join(__dirname,"..",o);if(Th.default.existsSync(a))return zM(a);let c=Dh.default.join(__dirname,"../..",o);if(Th.default.existsSync(c))return zM(c);let u=Dh.default.join(__dirname,"../runtime",o);if(Th.default.existsSync(u))return zM(u);throw new Error(`Could not find ${e} binary. Searched in:
- ${i}
- ${a}
- ${c}
- ${u}`)}function RTe(e,r){return jM(()=>Ch(e,r),n=>n)}async function zM(e){if(__dirname.match(uW)){let r=Dh.default.join(ITe.default,"prisma-binaries");await(0,FTe.ensureDir)(r);let n=Dh.default.join(r,Dh.default.basename(e)),o=await Th.default.promises.readFile(e);return await Th.default.promises.writeFile(n,o),PTe(n),n}return e}async function VEt(e,r){e=await Ch(r??"schema-engine",e);let{stdout:n}=await Zm(e,["--version"]);return n}function MTe(e,r){return jM(()=>VEt(e,r),n=>n)}function lW(e){let r=[],n=cr(e).with({fromEnvVar:Qa.when(Z_e)},c=>`, resolved by ${c.fromEnvVar.value}`).otherwise(()=>""),o=cr(e).with({path:Qa.when(sl)},c=>c.path.right).with({path:Qa.when(ba)},c=>(r.push(c.path.left),"E_CANNOT_RESOLVE_PATH")).exhaustive();return[`${cr(e).with({version:Qa.when(sl)},c=>c.version.right).with({version:Qa.when(ba)},c=>(r.push(c.version.left),"E_CANNOT_RESOLVE_VERSION")).exhaustive()} (at ${kTe.default.relative(process.cwd(),o)}${n})`,r]}async function pW(e){let r=X_e(cy(e)),n=(0,KM.pipe)(r,nW(c=>c.fromEnvVar)),o=await(0,KM.pipe)(r,Q_e(()=>RTe(e),c=>hTe(c.path)))(),i=await(0,KM.pipe)(o,BT,STe(c=>MTe(c,e)))();return{path:o,version:i,fromEnvVar:n}}var $Te=W(an());var JM=lt("prisma:mergeSchemas"),fW=class extends Error{constructor(r){let o=`${cr(r).with({_tag:"parsed"},({errorCode:i,message:a,reason:c})=>{let u=i?`Error code: ${i}`:"";return`${c}
${u}
${pc(a)}`}).with({_tag:"unparsed"},({message:i,reason:a})=>{let c=he(q("Details:"));return`${a}
${c} ${i}`}).exhaustive()}
[Context: mergeSchemas]`;super(wh(o)),this.name="MergeSchemasError"}};function dW(e){let r=Sh(JM,"mergeSchemasWasm");JM("Using mergeSchemas Wasm");let n=(0,$Te.pipe)(ru(()=>{let i=JSON.stringify({schema:e.schemas});return Ii.default.merge_schemas(i)},i=>({type:"wasm-error",reason:"(mergeSchemas wasm)",error:i})));if(sl(n))return n.right;throw cr(n.left).with({type:"wasm-error"},i=>{if(r(i),console.error(""),Yf(i.error)){let{message:c,stack:u}=lc(i.error);return JM(`Error merging schemas: ${c}`),JM(u),new Oi(c,u,"@prisma/prisma-schema-wasm merge_schemas","FMT_CLI")}let a=i.error.message;return new fW(_h({errorOutput:a,reason:i.reason}))}).exhaustive()}var NTe=W(an());var GT=lt("prisma:validate"),mW=class extends Error{constructor(r){let o=`${cr(r).with({_tag:"parsed"},({errorCode:i,message:a,reason:c})=>{let u=i?`Error code: ${i}`:"";return`${c}
${u}
${pc(a)}`}).with({_tag:"unparsed"},({message:i,reason:a})=>{let c=he(q("Details:"));return`${a}
${c} ${i}`}).exhaustive()}
[Context: validate]`;super(wh(o)),this.name="ValidateError"}};function gy(e){let r=Sh(GT,"validateWasm");GT("Using validate Wasm");let n=(0,NTe.pipe)(ru(()=>{process.env.FORCE_PANIC_GET_DMMF&&(GT("Triggering a Rust panic..."),Ii.default.debug_panic());let i=JSON.stringify({prismaSchema:e.schemas,noColor:!!process.env.NO_COLOR});Ii.default.validate(i)},i=>({type:"wasm-error",reason:"(validate wasm)",error:i})));if(sl(n))return;throw cr(n.left).with({type:"wasm-error"},i=>{if(r(i),console.error(""),Yf(i.error)){let{message:c,stack:u}=lc(i.error);return GT(`Error validating schema: ${c}`),GT(u),new Oi(c,u,"@prisma/prisma-schema-wasm validate","FMT_CLI")}let a=i.error.message;return new mW(_h({errorOutput:a,reason:i.reason}))}).exhaustive()}async function Vn({schemaPath:e,printLoadMessage:r,allowNull:n,schemaPathArgumentName:o,cwd:i}={schemaPath:{baseDir:process.cwd()},printLoadMessage:!0,allowNull:!1,schemaPathArgumentName:"--schema",cwd:process.cwd()}){let a=null;if(n){if(a=await kH({schemaPath:e,cwd:i,argumentName:o}),!a)return null}else a=await Qi({schemaPath:e,cwd:i,argumentName:o});return HT({schemaResult:a,printLoadMessage:r,cwd:i})}async function HT({schemaResult:e,printLoadMessage:r=!0,cwd:n=process.cwd()}){let o=LTe.default.relative(n,e.schemaPath),i=e.schemaRootDir||n;r&&Jf(o);let a=await hy({datamodel:e.schemas}),c=a.datasources.at(0);return{schemaFiles:e.schemas,schemaPath:e.schemaPath,schemaRootDir:i,datasources:a.datasources,generators:a.generators,primaryDatasource:c,warnings:a.warnings,loadedFromPathForLogMessages:o}}function Xf(e){if(e.primaryDatasource===void 0)throw new Error("Schema must contain a datasource block");return e.primaryDatasource.activeProvider}var GTe=W(gW());var qTe=W(UTe(),1);function yW(e){let r=(0,qTe.default)(e);if(r===0)return e;let n=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(n,"")}function ut(e=""){return yW(e).trimRight()+`
`}function bt(e,r,n=!0,o=!1){try{return(0,GTe.default)(r,{argv:e,stopAtPositional:n,permissive:o})}catch(i){return i}}function Ht(e){return e instanceof Error}var HTe=W(require("path")),WTe=W(require("url"));var yy="prisma+postgres",xW=`${yy}:`;function YM(e){let r;try{r=new WTe.URL(e)}catch{throw new Error("Invalid data source URL, see https://pris.ly/d/config-url")}let n=ZM(r.protocol),o=l=>l&&l.length>0,i={},a=r.searchParams.get("schema"),c=r.searchParams.get("socket");for(let[l,p]of r.searchParams)["schema","socket"].includes(l)||(i[l]=p);let u;return n==="sqlite"&&r.pathname?r.pathname.startsWith("file:")?u=r.pathname.slice(5):u=HTe.default.basename(r.pathname):r.pathname.length>1&&(u=r.pathname.slice(1),n==="postgresql"&&!u&&(u="postgres")),{type:n,host:o(r.hostname)?r.hostname:void 0,user:o(r.username)?r.username:void 0,port:o(r.port)?Number(r.port):void 0,password:o(r.password)?r.password:void 0,database:u,schema:a||void 0,uri:e,ssl:!!r.searchParams.get("sslmode"),socket:c||void 0,extraFields:i}}function ZM(e){switch(e){case"postgresql:":case"postgres:":case xW:return"postgresql";case"mongodb+srv:":case"mongodb:":return"mongodb";case"mysql:":return"mysql";case"file:":return"sqlite";case"sqlserver:":return"sqlserver"}throw new Error(`Unknown protocol ${e}`)}var zTe=require("node:child_process"),KTe=W(require("node:readline"));var JTe=W(SF());function VTe(e){return e.error!==void 0}var bW=_i("prisma:GeneratorProcess"),KEt=1,xy=class extends Error{constructor(n,o,i){super(n);this.code=o;this.data=i;i?.stack&&(this.stack=i.stack)}name="GeneratorError"},VT=class{constructor(r,{isNode:n=!1}={}){this.pathOrCommand=r;this.isNode=n}child;handlers={};initPromise;isNode;errorLogs="";pendingError;exited=!1;async init(){return this.initPromise||(this.initPromise=this.initSingleton()),this.initPromise}initSingleton(){return new Promise((r,n)=>{this.isNode?this.child=(0,zTe.fork)(this.pathOrCommand,[],{stdio:["pipe","inherit","pipe","ipc"],env:{...process.env,PRISMA_GENERATOR_INVOCATION:"true"},execArgv:["--max-old-space-size=8096"]}):this.child=(0,JTe.spawn)(this.pathOrCommand,{stdio:["pipe","inherit","pipe"],env:{...process.env,PRISMA_GENERATOR_INVOCATION:"true"},shell:!0}),this.child.on("exit",(i,a)=>{if(bW(`child exited with code ${i} on signal ${a}`),this.exited=!0,i){let c=new xy(`Generator ${JSON.stringify(this.pathOrCommand)} failed:
${this.errorLogs}`);this.pendingError=c,this.rejectAllHandlers(c)}}),this.child.stdin.on("error",()=>{}),this.child.on("error",i=>{bW(i),this.pendingError=i,i.code==="EACCES"?n(new Error(`The executable at ${this.pathOrCommand} lacks the right permissions. Please use ${q(`chmod +x ${this.pathOrCommand}`)}`)):n(i),this.rejectAllHandlers(i)}),KTe.default.createInterface({input:this.child.stderr,crlfDelay:1/0}).on("line",i=>{let a;try{a=JSON.parse(i)}catch{this.errorLogs+=i+`
`,bW(i)}a&&this.handleResponse(a)}),this.child.on("spawn",r)})}rejectAllHandlers(r){for(let n of Object.keys(this.handlers))this.handlers[n].reject(r),delete this.handlers[n]}handleResponse(r){if(r.jsonrpc&&r.id){if(typeof r.id!="number")throw new Error(`message.id has to be a number. Found value ${r.id}`);if(this.handlers[r.id]){if(VTe(r)){let n=new xy(r.error.message,r.error.code,r.error.data);this.handlers[r.id].reject(n)}else this.handlers[r.id].resolve(r.result);delete this.handlers[r.id]}}}sendMessage(r,n){if(!this.child){n(new xy("Generator process has not started yet"));return}if(!this.child.stdin.writable){n(new xy("Cannot send data to the generator process, process already exited"));return}this.child.stdin.write(JSON.stringify(r)+`
`,o=>{if(!o||o.code==="EPIPE")return n();n(o)})}getMessageId(){return KEt++}stop(){if(this.child&&!this.child?.killed){this.child.kill("SIGTERM");let r=2e3,n=200,o,i;Promise.race([new Promise(a=>{i=setTimeout(a,r)}),new Promise(a=>{o=setInterval(()=>{if(this.exited)return a("exited")},n)})]).then(a=>{a!=="exited"&&this.child?.kill("SIGKILL")}).finally(()=>{clearInterval(o),clearTimeout(i)})}}rpcMethod(r,n=o=>o){return o=>new Promise((i,a)=>{if(this.pendingError){a(this.pendingError);return}let c=this.getMessageId();this.handlers[c]={resolve:u=>i(n(u)),reject:a},this.sendMessage({jsonrpc:"2.0",method:r,params:o,id:c},u=>{u&&a(u)})})}getManifest=this.rpcMethod("getManifest",r=>r.manifest??null);generate=this.rpcMethod("generate")};var QM=class{manifest=null;config;options;constructor(r){this.config=r}async init(){await this.initImpl(),this.manifest=await this.getManifest()}generate(){if(!this.options)throw new Error("Please first run .setOptions() on the Generator to initialize the options");return this.generateImpl(this.options)}setOptions(r){this.options=r}setBinaryPaths(r){if(!this.options)throw new Error("Please first run .setOptions() on the Generator to initialize the options");this.options.binaryPaths=r}getPrettyName(){return this.manifest?.prettyName??this.getProvider()}getProvider(){return To(this.config.provider)}},XM=class extends QM{#e;constructor(r,n,o){super(n),this.#e=new VT(r,{isNode:o})}async initImpl(){await this.#e.init()}async getManifest(){return await this.#e.getManifest(this.config)}async generateImpl(r){await this.#e.generate(r)}stop(){this.#e.stop()}},ek=class extends QM{#e;constructor(r,n){super(r),this.#e=n}async initImpl(){}async getManifest(){return await this.#e.getManifest(this.config)}async generateImpl(r){await this.#e.generate(r)}stop(){}};var wDe=require("@prisma/engines");var SDe=W(RR()),SW=W(require("path"));var YTe=W(require("fs")),ou=W(require("path")),ZTe=require("util"),dE=(0,ZTe.promisify)(YTe.default.exists);async function JEt(e){return await dE(ou.default.resolve(process.cwd(),"prisma/schema.prisma"))||ou.default.relative(process.cwd(),e)==="prisma"&&await dE(ou.default.resolve(process.cwd(),"package.json"))?process.cwd():await dE(ou.default.resolve(e,"node_modules"))?e:await dE(ou.default.resolve(e,"../node_modules"))?ou.default.join(e,"../"):await dE(ou.default.resolve(e,"package.json"))?e:await dE(ou.default.resolve(e,"../package.json"))?ou.default.join(e,"../"):e}async function QTe(e){let r=YEt(e.defaultOutput);if(r.startsWith("node_modules")){let n=await JEt(e.baseDir);return ou.default.resolve(n,r)}return ou.default.resolve(e.baseDir,r)}function YEt(e){return e.startsWith("./")?e.slice(2):e}function XTe(e){return e.find(r=>To(r.provider)==="prisma-client-js")?.previewFeatures||[]}var eDe={string:[/\"(.*)\"/g,/\'(.*)\'/g],directive:{pattern:/(@.*)/g},entity:[/model\s+\w+/g,/enum\s+\w+/g,/datasource\s+\w+/g,/source\s+\w+/g,/generator\s+\w+/g],comment:/#.*/g,value:[/\b\s+(\w+)/g],punctuation:/(\:|}|{|"|=)/g,boolean:/(true|false)/g};var tDe={keyword:qc,entity:qc,value:e=>q(Xu(e)),punctuation:Xu,directive:qc,function:qc,variable:e=>q(Xu(e)),string:e=>q(me(e)),boolean:Gt,number:qc,comment:k0};var ZEt=e=>e,tk={},QEt=0,It={manual:tk.Prism&&tk.Prism.manual,disableWorkerMessageHandler:tk.Prism&&tk.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof al){let r=e;return new al(r.type,It.util.encode(r.content),r.alias)}else return Array.isArray(e)?e.map(It.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++QEt}),e.__id},clone:function e(r,n){n=n||{};let o,i;switch(It.util.type(r)){case"Object":if(i=It.util.objId(r),n[i])return n[i];o={},n[i]=o;for(let c in r)r.hasOwnProperty(c)&&(o[c]=e(r[c],n));return o;case"Array":return i=It.util.objId(r),n[i]?n[i]:(o=[],n[i]=o,r.forEach(function(c,u){o[u]=e(c,n)}),o);default:return r}}},languages:{extend:function(e,r){let n=It.util.clone(It.languages[e]);
You don't have any ${q("datasource")} defined in your ${q("schema.prisma")}.
You can define a datasource like this:
${q(mE(`datasource db {
provider = "postgresql"
}`))}
More information in our documentation:
${Pt("https://pris.ly/d/prisma-schema")}
`;var rk=`
${Xu("info")} You don't have any generators defined in your ${q("schema.prisma")}, so nothing will be generated.
Add the Prisma Client generator like this:
${q(mE(`generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
}`))}
More information in our documentation:
${Pt("https://pris.ly/d/prisma-schema")}
`,nDe=`
You don't have any ${q("models")} defined in your ${q("schema.prisma")}, so nothing will be generated.
You can define a model like this:
${q(mE(`model User {
id Int @id @default(autoincrement())
email String @unique
name String?
}`))}
More information in our documentation:
${Pt("https://pris.ly/d/prisma-schema")}
`,oDe=`
You don't have any ${q("models")} defined in your ${q("schema.prisma")}, so nothing will be generated.
You can define a model like this:
${q(mE(`model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
email String @unique
name String?
}`))}
More information in our documentation:
${Pt("https://pris.ly/d/prisma-schema")}
`;function iDe(e,r){return Object.entries(e).reduce((n,[o,i])=>(r.includes(o)&&(n[o]=i),n),{})}function sDe(e){if(e&&e.length>0){let r=e.map(n=>`${Gt("warn")} ${n}`).join(`
`);console.warn(r)}}function aDe(e){return{fromEnvVar:null,value:e}}function cDe(e,r){return e=e||[],e.find(n=>n.native===!0)?[...e,aDe(r)]:[aDe("native"),...e]}var dDe=require("@prisma/engines");var mDe=W(yh()),hDe=W(require("path"));function uDe(e,r){return Object.entries(e).reduce((n,[o,i])=>(n[r(o)]=i,n),{})}function lDe(){let e=process.env.AWS_LAMBDA_JS_RUNTIME;if(!e||e==="")return null;try{let n=/^nodejs(\d+).x$/.exec(e);if(n)return parseInt(n[1])}catch{console.error(`We could not parse the AWS_LAMBDA_JS_RUNTIME env var with the following value: ${e}. This was silently ignored.`)}return null}function pDe(e){if(e==="schema-engine")return"schemaEngine";throw new Error(`Could not convert binary type ${e}`)}function fDe(e){if(e==="schemaEngine")return"schema-engine";throw new Error(`Could not convert engine type ${e}`)}async function gDe({neededVersions,detectBinaryTarget,version,printDownloadProgress,skipDownload,binaryPathsOverride}){let binaryPathsByVersion=Object.create(null);if(Object.entries(neededVersions).length===0)return{binaryPathsByVersion,binaryTarget:"native"};let binaryTarget=await detectBinaryTarget();for(let currentVersion in neededVersions){binaryPathsByVersion[currentVersion]={};let neededVersion=neededVersions[currentVersion];if(neededVersion.binaryTargets.length===0&&(neededVersion.binaryTargets=[{fromEnvVar:null,value:binaryTarget}]),process.env.NETLIFY){let e=parseInt(process.versions.node.split(".")[0])>=20,r=lDe(),n=r&&r>=20,o=r&&r<=18,i=neededVersion.binaryTargets.find(c=>c.value==="rhel-openssl-1.0.x");!neededVersion.binaryTargets.find(c=>c.value==="rhel-openssl-3.0.x")&&(e||n)&&!o?neededVersion.binaryTargets.push({fromEnvVar:null,value:"rhel-openssl-3.0.x"}):i||neededVersion.binaryTargets.push({fromEnvVar:null,value:"rhel-openssl-1.0.x"})}let binaryTargetBaseDir=eval("require('path').join(__dirname, '..')");version!==currentVersion&&(binaryTargetBaseDir=hDe.default.join(binaryTargetBaseDir,`./engines/${currentVersion}/`),await(0,mDe.ensureDir)(binaryTargetBaseDir).catch(e=>console.error(e)));let binariesConfig=neededVersion.engines.reduce((e,r)=>(binaryPathsOverride?.[r]||(e[fDe(r)]=binaryTargetBaseDir),e),Object.create(null));if(Object.values(binariesConfig).length>0){let e=neededVersion.binaryTargets.map(i=>i.value),n=await bM({binaries:binariesConfig,binaryTargets:e,showProgress:typeof printDownloadProgress=="boolean"?printDownloadProgress:!0,version:currentVersion&&currentVersion!=="latest"?currentVersion:dDe.enginesVersion,skipDownload}),o=uDe(n,pDe);binaryPathsByVersion[currentVersion]=o}if(binaryPathsOverride){let e=Object.keys(binaryPathsOverride),r=neededVersion.engines.filter(n=>e.includes(n));if(r.length>0)for(let n of r){let o=binaryPathsOverride[n];binaryPathsByVersion[currentVersion][n]={[binaryTarget]:o}}}}return{binaryPathsByVersion,binaryTarget}}function vW(e,r){let n=e?.requiresEngineVersion;return n=n??r,n??"latest"}var yDe=W(ys());function xDe(e){return String(new EW(e))}var EW=class{constructor(r){this.config=r}toString(){let{config:r}=this,n=r.provider.fromEnvVar?`env("${r.provider.fromEnvVar}")`:r.provider.value,o=JSON.parse(JSON.stringify({provider:n,binaryTargets:wW(r.binaryTargets)}));return`generator ${r.name} {
${(0,yDe.default)(twt(o),2)}
}`}};function wW(e){let r;if(e.length>0){let n=e.find(o=>o.fromEnvVar!==null);n?r=`env("${n.fromEnvVar}")`:r=e.map(o=>o.native?"native":o.value)}else r=void 0;return r}function twt(e){let r=Object.keys(e).reduce((n,o)=>Math.max(n,o.length),0);return Object.entries(e).map(([n,o])=>`${n.padEnd(r)} = ${rwt(o)}`).join(`
`)}function rwt(e){return JSON.parse(JSON.stringify(e,(r,n)=>Array.isArray(n)?`[${n.map(o=>JSON.stringify(o)).join(", ")}]`:JSON.stringify(n)))}var bDe=lt("prisma:getGenerators");async function nk(e){e.registry===void 0&&e.providerAliases!==void 0&&(e.registry=Object.fromEntries(Object.entries(e.providerAliases).map(([_,D])=>[_,{type:"rpc",generatorPath:D.generatorPath,isNode:D.isNode}])));let{schemaPath:r,registry:n,version:o,printDownloadProgress:i,overrideGenerators:a,skipDownload:c,binaryPathsOverride:u,generatorNames:l=[],allowNoModels:p=!0,typedSql:f}=e,g=!e.schemaContext&&r?await Vn({schemaPath:{cliProvidedPath:r}}):e.schemaContext;if(!g)throw new Error("no schema provided for getGenerators");if(!g.primaryDatasource)throw new Error(rDe);sDe(g.warnings);let x=XTe(g.generators),b=await qT({datamodel:g.schemaFiles,previewFeatures:x});if(b.datamodel.models.length===0&&!p)throw g.primaryDatasource.provider==="mongodb"?new Error(oDe):new Error(nDe);let v=iwt(a||g.generators,l);await owt(v);let S=[];try{let _=await(0,SDe.default)(v,async(O,I)=>{let k=SW.default.dirname(O.sourceFilePath??g.schemaRootDir),j=To(O.provider),G=n[j]??{type:"rpc",generatorPath:j},B=cr(G).with({type:"in-process"},({generator:Y})=>new ek(O,Y)).with({type:"rpc"},({generatorPath:Y,isNode:z})=>new XM(Y,O,z)).exhaustive();if(await B.init(),O.output)O.output={value:SW.default.resolve(k,To(O.output)),fromEnvVar:null},O.isCustomOutput=!0;else{if(!B.manifest?.defaultOutput)throw new Error(`Can't resolve output dir for generator ${q(O.name)} with provider ${q(O.provider.value)}.
You need to define \`output\` in the generator block in the schema file.`);O.output={value:await QTe({defaultOutput:B.manifest.defaultOutput,baseDir:k}),fromEnvVar:null}}let N={datamodel:dW({schemas:g.schemaFiles}),datasources:g.datasources,generator:O,dmmf:b,otherGenerators:nwt(v,I),schemaPath:g.schemaPath,version:o||wDe.enginesVersion,allowNoModels:p,typedSql:f};return B.setOptions(N),S.push(B),B},{stopOnError:!1}),D=v.map(O=>To(O.provider));for(let O of _)if(O.manifest&&O.manifest.requiresGenerators&&O.manifest.requiresGenerators.length>0){for(let I of O.manifest.requiresGenerators)if(!D.includes(I))throw new Error(`Generator "${O.manifest.prettyName}" requires generator "${I}", but it is missing in your schema.prisma.
Please add it to your schema.prisma:
generator gen {
provider = "${I}"
}
`)}let P=Object.create(null);for(let O of _)if(O.manifest&&O.manifest.requiresEngines&&Array.isArray(O.manifest.requiresEngines)&&O.manifest.requiresEngines.length>0){let I=vW(O.manifest,o);P[I]||(P[I]={engines:[],binaryTargets:[]});for(let j of O.manifest.requiresEngines)P[I].engines.includes(j)||P[I].engines.push(j);let k=O.options?.generator?.binaryTargets;if(k&&k.length>0)for(let j of k)P[I].binaryTargets.find(G=>G.value===j.value)||P[I].binaryTargets.push(j)}bDe("neededVersions",JSON.stringify(P,null,2));let{binaryPathsByVersion:C}=await gDe({neededVersions:P,detectBinaryTarget:ua,version:o,printDownloadProgress:i,skipDownload:c,binaryPathsOverride:u});for(let O of _)if(O.manifest&&O.manifest.requiresEngines){let I=vW(O.manifest,o),k=C[I],j=iDe(k??{},O.manifest.requiresEngines);bDe({generatorBinaryPaths:j}),O.setBinaryPaths(j)}return _}catch(_){throw S.forEach(D=>D.stop()),_}}function nwt(e,r){return[...e.slice(0,r),...e.slice(r+1)]}var vDe=[...R_,"native"],EDe={"linux-glibc-libssl1.0.1":"debian-openssl-1.0.x","linux-glibc-libssl1.0.2":"debian-openssl-1.0.x","linux-glibc-libssl1.1.0":"debian-openssl1.1.x"};async function owt(e){let r=await ua();for(let n of e)if(n.binaryTargets){let i=(n.binaryTargets&&n.binaryTargets.length>0?n.binaryTargets:[{fromEnvVar:null,value:"native"}]).flatMap(a=>DH(a)).map(a=>a==="native"?r:a);for(let a of i){if(EDe[a])throw new Error(`Binary target ${he(q(a))} is deprecated. Please use ${me(q(EDe[a]))} instead.`);if(!vDe.includes(a))throw new Error(`Unknown binary target ${he(a)} in generator ${q(n.name)}.
Possible binaryTargets: ${me(vDe.join(", "))}`)}if(!i.includes(r)){let a=wW(n.binaryTargets);console.log(`${Gt("Warning:")} Your current platform \`${q(r)}\` is not included in your generator's \`binaryTargets\` configuration ${JSON.stringify(a)}.
To fix it, use this generator config in your ${q("schema.prisma")}:
${me(xDe({...n,binaryTargets:cDe(n.binaryTargets,r)}))}
${k0(`Note, that by providing \`native\`, Prisma Client automatically resolves \`${r}\`.
Read more about deploying Prisma Client: ${sn("https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema/generators")}`)}
`)}}}function iwt(e,r){if(r.length<1)return e;let n=e.filter(o=>r.includes(o.name));if(n.length!==r.length){let o=r.filter(a=>n.find(c=>c.name===a)==null),i=o.length<=1;throw new Error(`The ${i?"generator":"generators"} ${q(o.join(", "))} specified via ${q("--generator")} ${i?"does":"do"} not exist in your Prisma schema`)}return n}var o2e=W(require("path")),i2e=W(n2e());async function Xwt(e,r){let n={preserveSymlinks:!1,...r};return new Promise(o=>{(0,i2e.default)(e,n,(i,a)=>{i&&o(void 0),o(a)})})}async function sk(e,r){let n=await Xwt(`${e}/package.json`,r);return n&&o2e.default.dirname(n)}var il={};Ja(il,{error:()=>nSt,info:()=>rSt,log:()=>eSt,query:()=>oSt,should:()=>s2e,tags:()=>ZT,warn:()=>tSt});var ZT={error:he("prisma:error"),warn:Gt("prisma:warn"),info:qc("prisma:info"),query:Xu("prisma:query")},s2e={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function eSt(...e){console.log(...e)}function tSt(e,...r){s2e.warn()&&console.warn(`${ZT.warn} ${e}`,...r)}function rSt(e,...r){console.info(`${ZT.info} ${e}`,...r)}function nSt(e,...r){console.error(`${ZT.error} ${e}`,...r)}function oSt(e,...r){console.log(`${ZT.query} ${e}`,...r)}function a2e(e){let r=e.split(/\r?\n/).slice(1),n=[];for(let o of r){let i=String(o);try{let a=JSON.parse(i);n.push(a)}catch(a){throw new Error(`Could not parse schema engine response: ${a}`)}}return n}async function Ey(e,r=process.cwd(),n){if(!e)throw new Error("Connection url is empty. See https://pris.ly/d/config-url");try{await c2e({connectionString:e,cwd:r,schemaEnginePath:n,engineCommandName:"can-connect-to-database"})}catch(o){let i=o;if(i.stderr){let a=a2e(i.stderr),c=a.find(u=>u.level==="ERROR"&&u.target==="schema_engine::logger");if(c&&c.fields.error_code&&c.fields.message)return{code:c.fields.error_code,message:c.fields.message};throw new Error(`Schema engine error:
${a.map(u=>u.fields.message).join(`
`)}`)}else throw new Error(`Schema engine exited. ${o}`)}return!0}async function OW(e,r=process.cwd(),n){if(await Ey(e,r,n)===!0)return!1;try{return await c2e({connectionString:e,cwd:r,schemaEnginePath:n,engineCommandName:"create-database"}),!0}catch(i){let a=i;if(a.stderr){let c=a2e(a.stderr),u=c.find(l=>l.level==="ERROR"&&l.target==="schema_engine::logger");throw u&&u.fields.error_code&&u.fields.message?new Error(`${u.fields.error_code}: ${u.fields.message}`):new Error(`Schema engine error:
${c.map(l=>l.fields.message).join(`
`)}`)}else throw new Error(`Schema engine exited. ${i}`)}}async function c2e({connectionString:e,cwd:r,schemaEnginePath:n,engineCommandName:o}){n=n||await Ch("schema-engine");try{return await Zm(n,["--datasource",JSON.stringify({url:e}),"cli",o],{cwd:r,env:{RUST_BACKTRACE:process.env.RUST_BACKTRACE??"1",RUST_LOG:process.env.RUST_LOG??"info"}})}catch(i){let a=i;throw a.message&&(a.message=a.message.replace(e,"<REDACTED>")),a.stdout&&(a.stdout=a.stdout.replace(e,"<REDACTED>")),a.stderr&&(a.stderr=a.stderr.replace(e,"<REDACTED>")),a}}var I2e=require("node:util");var R2e=W(hE()),ck=W(require("os")),M2e=W(A2e());async function P2e(e){return(await F2e(`mutation ($data: CreateErrorReportInput!) {
createErrorReport(data: $data)
}`,{data:e})).createErrorReport}async function O2e(e){return(await F2e(`mutation ($signedUrl: String!) {
markErrorReportCompleted(signedUrl: $signedUrl)
}`,{signedUrl:e})).markErrorReportCompleted}async function F2e(e,r){let n="https://error-reports.prisma.sh/",o=JSON.stringify({query:e,variables:r});return await iy(n,{method:"POST",agent:aE(n),body:o,headers:{Accept:"application/json","Content-Type":"application/json"}}).then(i=>{if(!i.ok)throw new Error(`Error during request: ${i.status} ${i.statusText} - Query: ${e}`);return i.json()}).then(i=>{if(i.errors)throw new Error(JSON.stringify(i.errors));return i.data})}M2e.default.setGracefulCleanup();async function k2e({error:e,cliVersion:r,enginesVersion:n,getDatabaseVersionSafe:o}){let i;if(e.area==="LIFT_CLI"){let p=cr({introspectionUrl:e.introspectionUrl}).with({introspectionUrl:Qa.not(void 0)},({introspectionUrl:f})=>({datasource:{tag:"ConnectionString",url:f}})).otherwise(()=>{});i=await o(p)}let a=e.request?JSON.stringify(e.request):void 0,c={area:e.area,kind:"RUST_PANIC",cliVersion:r,binaryVersion:n,command:wSt(),jsStackTrace:(0,I2e.stripVTControlCharacters)(e.stack||e.message),rustStackTrace:e.rustStack,operatingSystem:`${ck.default.arch()} ${ck.default.platform()} ${ck.default.release()}`,platform:await ua(),liftRequest:a,fingerprint:await R2e.getSignature(),sqlDump:void 0,dbVersion:i},u=await P2e(c);return await O2e(u)}function wSt(){return process.argv[2]==="db"&&process.argv[3]==="pull"?"db pull":process.argv.slice(2).join(" ")}function Hs(e,r){throw new Error(r)}function xE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var pOe=W(Ih());var cd=()=>{let e=process.env;return!!(e.CI||e.CONTINUOUS_INTEGRATION||e.BUILD_NUMBER||e.RUN_ID||e.AGOLA_GIT_REF||e.AC_APPCIRCLE||e.APPVEYOR||e.CODEBUILD||e.TF_BUILD||e.bamboo_planKey||e.BITBUCKET_COMMIT||e.BITRISE_IO||e.BUDDY_WORKSPACE_ID||e.BUILDKITE||e.CIRCLECI||e.CIRRUS_CI||e.CF_BUILD_ID||e.CM_BUILD_ID||e.CI_NAME||e.DRONE||e.DSARI||e.EARTHLY_CI||e.EAS_BUILD||e.GERRIT_PROJECT||e.GITEA_ACTIONS||e.GITHUB_ACTIONS||e.GITLAB_CI||e.GOCD||e.BUILDER_OUTPUT||e.HARNESS_BUILD_ID||e.JENKINS_URL||e.BUILD_ID||e.LAYERCI||e.MAGNUM||e.NETLIFY||e.NEVERCODE||e.PROW_JOB_ID||e.RELEASE_BUILD_ID||e.RENDER||e.SAILCI||e.HUDSON||e.JENKINS_URL||e.BUILD_ID||e.SCREWDRIVER||e.SEMAPHORE||e.SOURCEHUT||e.STRIDER||e.TASK_ID||e.RUN_ID||e.TEAMCITY_VERSION||e.TRAVIS||e.VELA||e.NOW_BUILDER||e.APPCENTER_BUILD_ID||e.CI_XCODE_PROJECT||e.XCS)};var ud=({stream:e=process.stdin}={})=>!!(e&&e.isTTY&&process.env.TERM!=="dumb");var ld=()=>pOe.default._injected?.length?!0:ud()&&!cd();function JV(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var fOe=(e=0)=>r=>`\x1B[${r+e}m`,dOe=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,mOe=(e=0)=>(r,n,o)=>`\x1B[${38+e};2;${r};${n};${o}m`,zn={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},MSr=Object.keys(zn.modifier),CTt=Object.keys(zn.color),ATt=Object.keys(zn.bgColor),kSr=[...CTt,...ATt];function PTt(){let e=new Map;for(let[r,n]of Object.entries(zn)){for(let[o,i]of Object.entries(n))zn[o]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[o]=zn[o],e.set(i[0],i[1]);Object.defineP
`).reduce((r,n)=>Math.max(r,Xi(n)),0)+2}function uD({title:e,width:r,height:n,str:o,horizontalPadding:i}){i=i||0,r=r||0,n=n||0,r=Math.max(r,$Tt(o)+i*2);let a=e?Nf(mc.topLeft+mc.horizontal)+" "+F_(q(e))+" "+Nf(mc.horizontal.repeat(r-e.length-2-3)+mc.topRight)+F_():Nf(mc.topLeft+mc.horizontal)+Nf(mc.horizontal.repeat(r-3)+mc.topRight),c=mc.bottomLeft+mc.horizontal.repeat(r-2)+mc.bottomRight,u=o.split(`
`);u.length<n&&u.push(...new Array(n-u.length).fill(""));let l=u.slice(-n).map(p=>{let f=Math.min(Xi(p),r),g=Math.max(r-f-2,0);return`${Nf(mc.vertical)}${" ".repeat(i)}${F_(ZV(p,r-2))}${" ".repeat(g-i)}${Nf(mc.vertical)}`}).join(`
`);return Nf(a+`
`+l+`
`+c)}var hd={};Ja(hd,{createDirIfNotExists:()=>sOt,getFilesInDir:()=>fOt,getNestedFoldersInDir:()=>pOt,removeDir:()=>uOt,removeEmptyDirs:()=>cOt,removeFile:()=>lOt,writeFile:()=>aOt});var Lz=W(an()),PE=W(kz()),Bz=W(require("fs/promises"));var Iy=W(require("fs/promises")),$z=W(J7()),Uk=W(require("path"));var DD=W(require("path"));function Np(e){return DD.default.sep===DD.default.posix.sep?e:e.split(DD.default.sep).join(DD.default.posix.sep)}function LFe(e){return Iy.default.mkdir(e,{recursive:!0})}function BFe({path:e,content:r}){return Iy.default.writeFile(e,r,{encoding:"utf-8"})}function jFe(e){let r=Np(Uk.default.join(e,"**"));return(0,$z.default)(r,{onlyFiles:!1,onlyDirectories:!0})}function UFe(e,r="**"){let n=Np(Uk.default.join(e,r));return(0,$z.default)(n,{onlyFiles:!0,onlyDirectories:!1})}async function Nz(e){try{if(!(await Iy.default.lstat(e)).isDirectory())return}catch{return}let r=await Iy.default.readdir(e);if(r.length>0){let o=r.map(i=>Nz(Uk.default.join(e,i)));await Promise.all(o)}(await Iy.default.readdir(e)).length===0&&await Iy.default.rmdir(e)}var sOt=e=>PE.tryCatch(()=>LFe(e),CD("fs-create-dir",{dir:e})),aOt=e=>PE.tryCatch(()=>BFe(e),CD("fs-write-file",e)),cOt=e=>PE.tryCatch(()=>Nz(e),CD("fs-remove-empty-dirs",{dir:e})),uOt=e=>(0,Lz.pipe)(PE.tryCatch(()=>Bz.default.rm(e,{recursive:!0}),CD("fs-remove-dir",{dir:e}))),lOt=e=>(0,Lz.pipe)(PE.tryCatch(()=>Bz.default.unlink(e),CD("fs-remove-file",{filePath:e}))),pOt=e=>()=>jFe(e),fOt=(e,r="**")=>()=>UFe(e,r);function CD(e,r){return n=>({type:e,error:n,meta:r})}var qz=W(require("fs"));var Wo=W(require("node:process"),1),Vo=W(require("node:path"),1),Gk=W(require("node:os"),1),AD=W(require("node:fs"),1),JFe=W(zFe(),1),OD=Wo.default.platform==="win32",KFe=e=>{try{return JFe.default.parse(AD.default.readFileSync(e,"utf8")).prefix}catch{}},dOt=()=>Object.keys(Wo.default.env).reduce((e,r)=>/^npm_config_prefix$/i.test(r)?Wo.default.env[r]:e,void 0),mOt=()=>{if(OD&&Wo.default.env.APPDATA)return Vo.default.join(Wo.default.env.APPDATA,"/npm/etc/npmrc");if(Wo.default.execPath.includes("/Cellar/node")){let e=Wo.default.execPath.slice(0,Wo.default.execPath.indexOf("/Cellar/node"));return Vo.default.join(e,"/lib/node_modules/npm/npmrc")}if(Wo.default.execPath.endsWith("/bin/node")){let e=Vo.default.dirname(Vo.default.dirname(Wo.default.execPath));return Vo.default.join(e,"/etc/npmrc")}},hOt=()=>{if(OD){let{APPDATA:e}=Wo.default.env;return e?Vo.default.join(e,"npm"):Vo.default.dirname(Wo.default.execPath)}return Vo.default.dirname(Vo.default.dirname(Wo.default.execPath))},gOt=()=>{let e=dOt();if(e)return e;let r=KFe(Vo.default.join(Gk.default.homedir(),".npmrc"));if(r)return r;if(Wo.default.env.PREFIX)return Wo.default.env.PREFIX;let n=KFe(mOt());return n||hOt()},PD=Vo.default.resolve(gOt()),YFe=()=>{if(OD&&Wo.default.env.LOCALAPPDATA){let e=Vo.default.join(Wo.default.env.LOCALAPPDATA,"Yarn");if(AD.default.existsSync(e))return e}return!1},yOt=()=>{if(Wo.default.env.PREFIX)return Wo.default.env.PREFIX;let e=YFe();if(e)return e;let r=Vo.default.join(Gk.default.homedir(),".config/yarn");if(AD.default.existsSync(r))return r;let n=Vo.default.join(Gk.default.homedir(),".yarn-config");return AD.default.existsSync(n)?n:PD},Lp={};Lp.npm={};Lp.npm.prefix=PD;Lp.npm.packages=Vo.default.join(PD,OD?"node_modules":"lib/node_modules");Lp.npm.binaries=OD?PD:Vo.default.join(PD,"bin");var ZFe=Vo.default.resolve(yOt());Lp.yarn={};Lp.yarn.prefix=ZFe;Lp.yarn.packages=Vo.default.join(ZFe,YFe()?"Data/global/node_modules":"global/node_modules");Lp.yarn.binaries=Vo.default.join(Lp.yarn.packages,".bin");var QFe=Lp;function Ry(){try{if(qz.default.realpathSync(process.argv[1]).indexOf(qz.default.realpathSync(QFe.npm.packages))===0)return"npm"}catch{}return!1}function Xt(e){return Ry()?e:__dirname.includes("_npx")?`npx ${e}`:e}var EIe=W(Ih());var hIe=require("node:util");var gIe=W(XFe());var Jz=W(require("node:process"),1),rIe=W(require("node:os"),1),nIe=W(require("node:fs"),1);var eIe=W(require("node:fs"),1);var Vz=W(require("node:fs"),1),Wz;function xOt(){try{return Vz.default.statSync("/.dockerenv"),!
Hi Prisma Team! The following command just crashed.
${r.reportId?`The report Id is: ${r.reportId}`:""}
## Command
\`${r.command}\`
## Versions
| Name | Version |
|-------------|--------------------|
| Platform | ${e.padEnd(19)}|
| Node | ${process.version.padEnd(19)}|
| Prisma CLI | ${r.cliVersion.padEnd(19)}|
| Engine | ${r.enginesVersion.padEnd(19)}|
## Error
\`\`\`
${r.error}
\`\`\`
`);async function eK(e){if(!ld())throw e.error;await IOt(e)}async function IOt({error:e,cliVersion:r,enginesVersion:n,command:o,getDatabaseVersionSafe:i}){let a=e.message.split(`
`).slice(0,Math.max(20,process.stdout.rows)).join(`
`);console.log(`${he("Oops, an unexpected error occurred!")}
${he(a)}
${q("Please help us improve Prisma by submitting an error report.")}
${q("Error reports never contain personal or other sensitive information.")}
${ae(`Learn more: ${Pt("https://pris.ly/d/telemetry")}`)}
`);let{value:c}=await(0,EIe.default)({type:"select",name:"value",message:"Submit error report",initial:0,choices:[{title:"Yes",value:!0,description:"Send error report once"},{title:"No",value:!1,description:"Don't send error report"}]});if(c)try{console.log("Submitting...");let u=await k2e({error:e,cliVersion:r,enginesVersion:n,getDatabaseVersionSafe:i});console.log(`
${q(`We successfully received the error report id: ${u}`)}`),console.log(`
${q("Thanks a lot for your help! \u{1F64F}")}`)}catch(u){let l=`${q(he("Oops. We could not send the error report."))}`;console.log(l),console.error(`${k0("Error report submission failed due to: ")}`,u)}await vIe({prompt:!c,error:e,cliVersion:r,enginesVersion:n,command:o}),process.exit(1)}function FD(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var tK=W(require("node:fs"));function rK(){try{return tK.default.existsSync("/.dockerenv")||tK.default.existsSync("/run/.containerenv")||process.pid===1||process.env.KUBERNETES_SERVICE_HOST!==void 0}catch{return!1}}function nK(){return process.env.npm_lifecycle_event!==void 0&&process.env.npm_command!=="run-script"}var IIe=W(FIe());function gc(e){return(0,IIe.isIdentifierName)(e)}function cK(){return process.env.GIT_EXEC_PATH!==void 0||process.env.GIT_DIR!==void 0||process.env.GIT_INDEX_FILE!==void 0||process.env.GIT_PREFIX!==void 0}function rs(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}function Nh(e){return{files:RIe(e)}}function Kk(e,r){return{files:RIe(e.schemaFiles),configDir:r}}function RIe(e){return e.map(([r,n])=>({path:r,content:n}))}var Jk=class extends Error{constructor(r){super(r)}};rs(Jk,"ConfigValidationError");function qOt(e){return e.datasource!==void 0&&typeof e.datasource.url=="string"}function ai({config:e,cmd:r}){if(!qOt(e))throw new Jk(`The ${he("datasource.url")} property is required in your Prisma config file when using ${me(`prisma ${r}`)}.`);return e}var MD=class e{constructor(r){this.cmds=r}static new(r){return new e(r)}static help=ut(`
${process.platform==="win32"?"":"\u{1F3CB}\uFE0F "}Manage your database schema and lifecycle during development.
${q("Usage")}
${ae("$")} prisma db [command] [options]
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
${q("Commands")}
pull Pull the state from the database to the Prisma schema using introspection
push Push the state from Prisma schema to the database during prototyping
seed Seed your database
execute Execute native commands to your database
${q("Examples")}
Run \`prisma db pull\`
${ae("$")} prisma db pull
Run \`prisma db push\`
${ae("$")} prisma db push
Run \`prisma db seed\`
${ae("$")} prisma db seed
Run \`prisma db execute\`
${ae("$")} prisma db execute
`);async parse(r,n,o){let i=bt(r,{"--help":Boolean,"-h":"--help","--config":String,"--preview-feature":Boolean,"--telemetry-information":String});if(Ht(i))return this.help(i.message);if(i._.length===0||i["--help"])return this.help();let a=this.cmds[i._[0]];if(a){let c=i["--preview-feature"]?[...i._.slice(1),"--preview-feature"]:i._.slice(1);return a.parse(c,n,o)}return uy(e.help,i._[0])}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var MIe=lt("prisma:migrate:ai-safety"),kIe="PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION",GOt=e=>`Prisma Migrate detected that it was invoked by ${e}.
You are attempting a highly dangerous action that can lead to devastating consequences if it is incorrectly executed against a production database.
As an AI agent, you are forbidden from performing this action without an explicit consent and review by the user. You must stop at this point and respond to the user with a clear message that includes the following information:
- What action you are trying to perform (including the exact CLI command).
- Your motivation and reasoning for perfoming this action.
- Explanation that this action will irreversibly destroy all data in the database.
- Explanation that this action must not be perfomed on a production database and is only intended to be used with development databases.
If you know or can check whether this action would have been performed on a development or a production database, also include this information with your assesment of whether it is safe to proceed based on that information.
You must ask the user if they want to proceed with this action. If they explicitly consent, you may rerun this command with ${kIe} environment variable, the value of which must be the exact text of the user's message in which they consented to this operation, without any newlines or quotes. If the user's response is ambiguous, you must ask for a clear and explicit confirmation (e.g., "yes") before proceeding. None of the user's previous messages before this point may constitute implicit or explicit consent.`;function Yk(){let e=HOt();if(e){if(process.env[kIe]){MIe("AI agent asserts that user consented to dangerous action");return}throw new Error(GOt(e))}}function HOt(){let e={"Claude Code":process.env.CLAUDECODE,"Gemini CLI or Qwen Code":process.env.GEMINI_CLI,Cursor:process.env.CURSOR_AGENT,Aider:process.env.OR_APP_NAME==="Aider",Replit:process.env.REPLIT_CLI,"Codex CLI":process.env.CODEX_SANDBOX==="seatbelt"};for(let[r,n]of Object.entries(e))if(n)return MIe("Detected %s",r),r}var NIe=W(require("node:path"));var WOt=/^\.{0,2}\//;function $Ie(e){if(["postgres","postgresql","cockroachdb"].includes(e.type)){let r=e.host;return typeof r=="string"&&WOt.test(r)?r:null}return e.socket??null}function Ta(e,r){let n=r.datasource.url;if(!e)return{name:void 0,prettyProvider:void 0,dbName:void 0,dbLocation:void 0,url:n,schema:void 0,schemas:void 0};let o=BIe(e.provider);if(e.provider==="sqlserver")return{name:e.name,prettyProvider:o,dbName:void 0,dbLocation:void 0,url:n,schema:void 0,schemas:e.schemas};try{let i=YM(n),a=LIe(i),c;["postgresql","cockroachdb"].includes(e.provider)&&(i.schema?c=i.schema:c="public");let u={name:e.name,prettyProvider:o,dbName:i.database,dbLocation:a,url:n,schema:c,schemas:e.schemas,configDir:NIe.default.dirname(e.sourceFilePath)};return e.provider==="postgresql"&&u.dbName===void 0&&(u.dbName="postgres"),u}catch{return{name:e.name,prettyProvider:o,dbName:void 0,dbLocation:void 0,url:n,schema:void 0,schemas:e.schemas}}}async function kD(e,r){let n=r.datasource.url,o=await Ey(n,e);if(o!==!0){let{code:i,message:a}=o;throw new Error(`${i}: ${a}`)}}async function Lh(e,r,n){let o=n.datasource.url,i=await Ey(o,e);if(i===!0)return;let{code:a,message:c}=i;if(a!=="P1003")throw new Error(`${a}: ${c}`);if(await OW(o,e)){if(r==="sqlserver")return`SQL Server database created.
`;let u=YM(o),p=`${BIe(r)} database${u.database?` ${u.database} `:" "}created`,f=LIe(u);return f&&(p+=` at ${q(f)}`),p}}function LIe(e){if(e.type==="sqlite")return e.uri;let r=$Ie(e);if(r)return`unix:${r}`;if(e.host&&e.port)return`${e.host}:${e.port}`;if(e.host)return`${e.host}`}function BIe(e){switch(e){case"mysql":return"MySQL";case"postgres":case"postgresql":return"PostgreSQL";case yy:return"Prisma Postgres";case"sqlite":return"SQLite";case"cockroachdb":return"CockroachDB";case"sqlserver":return"SQL Server";case"mongodb":return"MongoDB"}}var uK=class extends Error{constructor(r){super(r)}};rs(uK,"ConfigValidationError");var $D=class extends Error{constructor(){super(`Could not find a ${q("schema.prisma")} file that is required for this command.
You can either provide it with ${me("--schema")}, set its path in the \`schema\` property in your Prisma Config file, or put it into the default location ${me("./prisma/schema.prisma")} ${Pt("https://pris.ly/d/prisma-schema-location")}`)}};rs($D,"NoSchemaFoundError");var ND=class extends Error{constructor(){super(`Use the --accept-data-loss flag to ignore the data loss warnings like ${q(me(Xt("prisma db push --accept-data-loss")))}`)}};rs(ND,"DbPushIgnoreWarningsWithFlagError");var lK=class extends Error{constructor(r){super(`Use the --force flag to use the ${r} command in an unattended environment like ${q(me(Xt(`prisma migrate ${r} --force`)))}`)}};rs(lK,"MigrateNeedsForceError");var LD=class extends Error{constructor(){super(`Prisma Migrate has detected that the environment is non-interactive. It is recommended to run this command in an interactive environment.
Use ${q(me("--force"))} to run this command without user interaction.
See ${Pt("https://pris.ly/d/migrate-reset")}`)}};rs(LD,"MigrateResetEnvNonInteractiveError");var BD=class extends Error{constructor(){super(`Prisma Migrate has detected that the environment is non-interactive, which is not supported.
\`prisma migrate dev\` is an interactive command designed to create new migrations and evolve the database in development.
To apply existing migrations in deployments, use ${q(me("prisma migrate deploy"))}.
See ${Pt("https://pris.ly/d/migrate-deploy")}`)}};rs(BD,"MigrateDevEnvNonInteractiveError");var pK=class extends Error{constructor(r){super(`Use the --force flag to use the ${r} command in an unattended environment like ${q(me(Xt(`prisma db ${r} --force --preview-feature`)))}`)}};rs(pK,"DbDropNeedsForceError");function Da({datasourceInfo:e}){if(!e.name||!e.prettyProvider)return;let r=`Datasource "${e.name}": ${e.prettyProvider} database`;e.dbName&&(r+=` "${e.dbName}"`),e.schemas?.length?r+=`, schemas "${e.schemas.join(", ")}"`:e.schema&&(r+=`, schema "${e.schema}"`),e.dbLocation&&(r+=` at "${e.dbLocation}"`),process.stdout.write(ae(r)+`
`)}var KIe=W(require("node:stream/consumers"));var JIe=W(require("fs"));var YIe=W(require("path"));var gK=W(require("node:readline"));var GIe=require("child_process");var dK=W(Lk()),mK=W(an()),UIe=W(Iz()),Bh=W(kz()),fK=W(require("path"));async function qIe({views:e,viewsDirectoryPath:r}){let n=Np(r);if(e.length===0){await jIe(n);return}let{viewFilesToKeep:o}=await VOt(n,e);await jIe(n,o)}async function VOt(e,r){let n=r.map(({schema:p,...f})=>[fK.default.posix.join(e,p),f]),o=n.map(([p])=>p),i=n.map(([p,{name:f,definition:g}])=>({path:fK.default.posix.join(p,`${f}.sql`),content:g})),a=i.map(({path:p})=>p),u=await(0,mK.pipe)(hd.createDirIfNotExists(e),Bh.chainW(()=>Bh.traverseArray(hd.createDirIfNotExists)(o)),Bh.chainW(()=>Bh.traverseArray(hd.writeFile)(i)))();if(dK.isRight(u))return{viewFilesToKeep:a};throw cr(u.left).with({type:"fs-create-dir"},p=>{throw new Error(`Error creating the directory: ${p.meta.dir}.
${p.error}.`)}).with({type:"fs-write-file"},p=>{throw new Error(`Error writing the view definition
${p.meta.content}
to file ${p.meta.path}.
${p.error}.`)}).exhaustive()}async function jIe(e,r=[]){let n=(0,mK.pipe)(hd.getFilesInDir(e,"**/*/*.sql"),UIe.chain(a=>{let c=a.filter(u=>!r.includes(u));return Bh.traverseArray(hd.removeFile)(c)}),Bh.chainW(()=>hd.removeEmptyDirs(e))),o=await n();if(dK.isRight(o))return;let i=cr(o.left).with({type:"fs-remove-empty-dirs"},a=>{throw new Error(`Error removing empty directories in: ${a.meta.dir}.
${a.error}.`)}).with({type:"fs-remove-file"},a=>{throw new Error(`Error removing the file: ${a.meta.filePath}.
${a.error}.`)}).exhaustive();throw await n(),i}var hK=lt("prisma:schemaEngine:rpc"),zOt=lt("prisma:schemaEngine:stderr"),KOt=lt("prisma:schemaEngine:stdin"),Zk=class extends Error{code;constructor(r,n){super(r),this.code=n}};rs(Zk,"EngineError");var JOt=1,Qk=class e{debug;child;schemaContext;datasource;listeners={};messages=[];lastRequest;lastError=null;initPromise;enabledPreviewFeatures;extensionConfig;baseDir;isRunning=!1;constructor({debug:r=!1,schemaContext:n,datasource:o,enabledPreviewFeatures:i,extensions:a,baseDir:c}){this.schemaContext=n,this.datasource=o,r&&lt.enable("SchemaEngine*"),this.debug=r,this.enabledPreviewFeatures=i,this.extensionConfig=a?{types:a.flatMap(u=>u.types)}:void 0,this.baseDir=c}static setup(r){return Promise.resolve(new e(r))}applyMigrations(r){return this.runCommand(this.getRPCPayload("applyMigrations",r))}createDatabase(r){return this.runCommand(this.getRPCPayload("createDatabase",r))}createMigration(r){return this.runCommand(this.getRPCPayload("createMigration",r))}dbExecute(r){return this.runCommand(this.getRPCPayload("dbExecute",r))}debugPanic(){return this.runCommand(this.getRPCPayload("debugPanic",void 0))}devDiagnostic(r){return this.runCommand(this.getRPCPayload("devDiagnostic",r))}diagnoseMigrationHistory(r){return this.runCommand(this.getRPCPayload("diagnoseMigrationHistory",r))}ensureConnectionValidity(r){return this.runCommand(this.getRPCPayload("ensureConnectionValidity",r))}evaluateDataLoss(r){return this.runCommand(this.getRPCPayload("evaluateDataLoss",r))}getDatabaseDescription(r){return this.runCommand(this.getRPCPayload("getDatabaseDescription",{schema:r}))}getDatabaseVersion(r){return this.runCommand(this.getRPCPayload("getDatabaseVersion",r))}async introspect({schema:r,force:n=!1,baseDirectoryPath:o,viewsDirectoryPath:i,compositeTypeDepth:a=-1,namespaces:c}){try{let u=await this.runCommand(this.getRPCPayload("introspect",{schema:r,force:n,compositeTypeDepth:a,namespaces:c,baseDirectoryPath:o})),{views:l}=u;return l&&await qIe({views:l,viewsDirectoryPath:i}),u}finally{await this.stop()}}migrateDiff(r){return this.runCommand(this.getRPCPayload("diff",r))}markMigrationApplied(r){return this.runCommand(this.getRPCPayload("markMigrationApplied",r))}markMigrationRolledBack(r){return this.runCommand(this.getRPCPayload("markMigrationRolledBack",r))}reset(r){return this.runCommand(this.getRPCPayload("reset",r))}schemaPush(r){return this.runCommand(this.getRPCPayload("schemaPush",r))}introspectSql(r){return this.runCommand(this.getRPCPayload("introspectSql",r))}async stop(){if(!this.child)return;let r=new Promise(n=>{let o=setTimeout(()=>{this.child?.kill(),n()},process.platform==="win32"?4e3:0).unref();this.child.on("exit",()=>{clearTimeout(o),n()})});return this.child.stdin?.end(),this.isRunning=!1,r}rejectAll(r){Object.entries(this.listeners).map(([n,o])=>{o(null,r),delete this.listeners[n]})}registerCallback(r,n){this.listeners[r]=n}handleResponse(r){let n;try{n=JSON.parse(r)}catch(o){console.error(`Could not parse Schema engine response: ${r.slice(0,200)}. Error: ${o.message}`)}if(n){if(n.id&&(n.result!==void 0||n.error!==void 0))this.listeners[n.id]||console.error(`Got result for unknown id ${n.id}`),this.listeners[n.id]&&(this.listeners[n.id](n),delete this.listeners[n.id]);else if(n.method&&n.id!==void 0&&n.method==="print"&&n.params?.content!==void 0){process.stdout.write(n.params.content+`
`);let o={id:n.id,jsonrpc:"2.0",result:{}};this.child.stdin.write(JSON.stringify(o)+`
`)}}}init(){return this.initPromise||(this.initPromise=this.internalInit()),this.initPromise}internalInit(){return new Promise(async(r,n)=>{try{let{PWD:o,...i}=process.env,a=await Ch("schema-engine");hK("starting Schema engine with binary: "+a);let c=[];if(this.schemaContext){let p=this.schemaContext.schemaFiles.flatMap(([f])=>["--datamodels",f]);c.push(...p)}this.datasource&&c.push("--datasource",JSON.stringify(this.datasource)),this.enabledPreviewFeatures&&Array.isArray(this.enabledPreviewFeatures)&&this.enabledPreviewFeatures.length>0&&c.push("--enabled-preview-features",this.enabledPreviewFeatures.join(",")),this.extensionConfig&&c.push("--extension-types",JSON.stringify(this.extensionConfig)),this.child=(0,GIe.spawn)(a,c,{cwd:this.baseDir,stdio:["pipe","pipe",this.debug?process.stderr:"pipe"],env:{RUST_LOG:"info",RUST_BACKTRACE:"1",...i}}),this.isRunning=!0,this.child.on("error",p=>{console.error("[schema-engine] error: %s",p),this.rejectAll(p),n(p)}),this.child.on("exit",p=>{let f=v=>{this.rejectAll(v),n(v)},g=this.messages.join(`
`),x=this.lastError?.message||g,b=()=>{let v=`[EXIT_PANIC]
${g}
${this.lastError?.backtrace??""}`;f(new Oi(YOt(x),v,this.lastRequest,"LIFT_CLI"))};switch(p){case 0:break;case 1:f(new Error(`Error in Schema engine: ${x}`));break;case 101:b();break;default:b()}}),this.child.stdin.on("error",p=>{KOt(p)}),gK.default.createInterface({input:this.child.stderr,crlfDelay:1/0}).on("line",p=>{zOt(p);try{let f=JSON.parse(p);this.messages.push(f.fields.message),f.level==="ERROR"&&(this.lastError=f.fields)}catch{}}),gK.default.createInterface({input:this.child.stdout,crlfDelay:1/0}).on("line",p=>{this.handleResponse(p)}),setImmediate(()=>{r()})}catch(o){n(o)}})}async runCommand(r){if(process.env.FORCE_PANIC_SCHEMA_ENGINE&&r.method!=="getDatabaseVersion"&&(r=this.getRPCPayload("debugPanic",void 0)),await this.init(),this.child?.killed)throw new Error(`Can't execute ${JSON.stringify(r)} because Schema engine already exited.`);return new Promise((n,o)=>{if(this.registerCallback(r.id,(i,a)=>{if(a)return o(a);if(i.result!==void 0)n(i.result);else if(i.error)if(hK(i),i.error.data?.is_panic){let c=i.error.data?.error?.message??i.error.message,u=`[RESPONSE_ERROR_PANIC]
${i.error.data?.message??""}`;o(new Oi(c,u,this.lastRequest,"LIFT_CLI"))}else if(i.error.data?.message){let c=`${he(pc(i.error.data.message))}
`;i.error.data?.error_code?(c=he(`${i.error.data.error_code}
`)+c,o(new Zk(c,i.error.data.error_code))):o(new Error(c))}else o(new Error(`${he("Error in RPC")}
Request: ${JSON.stringify(r,null,2)}
Response: ${JSON.stringify(i,null,2)}
${i.error.message}
`));else o(new Error(`Got invalid RPC response without .result property: ${JSON.stringify(i)}`))}),this.child.stdin.destroyed)throw new Error(`Can't execute ${JSON.stringify(r)} because Schema engine is destroyed.`);hK("SENDING RPC CALL",JSON.stringify(r)),this.child.stdin.write(JSON.stringify(r)+`
`),this.lastRequest=r})}getRPCPayload(r,n){return{id:JOt++,jsonrpc:"2.0",method:r,params:n?{...n}:void 0}}};function YOt(e){return`${he(q(`Error in Schema engine.
Reason: `))}${e}
`}var jD=W(require("node:fs")),Xk=W(require("node:path"));async function HIe({baseDir:e,generatedMigrationName:r}){let n=Xk.default.join(e,r);if(jD.default.existsSync(n))throw new Error(`The migration directory already exists at ${n}`);return await jD.default.promises.mkdir(n,{recursive:!0,mode:511}),n}async function WIe({baseDir:e,extension:r,migrationName:n,script:o}){await jD.default.promises.writeFile(Xk.default.join(e,n,`migration.${r}`),o,{encoding:"utf-8"})}async function VIe({baseDir:e,connectorType:r,lockfile:n}){let o=`# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "${r}"
`;await jD.default.promises.writeFile(Xk.default.join(e,n.path),o,{encoding:"utf-8"})}var e6=W(require("node:fs/promises")),t6=W(require("node:path"));async function ml(e,r){let n=e,o="migration_lock.toml",i=await e6.default.readFile(t6.default.join(e,o),{encoding:"utf-8"}).catch(()=>null),a={path:o,content:i},c=[];try{c=await e6.default.readdir(e,{withFileTypes:!0,recursive:!1}).catch(p=>[])}catch(p){if(p.code==="ENOENT")return{baseDir:n,lockfile:a,migrationDirectories:[],shadowDbInitScript:r};throw p}let u=[];for(let p of c.filter(f=>f.isDirectory())){let f=t6.default.join(n,p.name),g="migration.sql",x=await e6.default.readFile(t6.default.join(f,g),{encoding:"utf-8"}).then(b=>({tag:"ok",value:b})).catch(b=>({tag:"error",value:b.message}));u.push({path:p.name,migrationFile:{path:g,content:x}})}let l=u.sort((p,f)=>p.path.localeCompare(f.path));return{baseDir:n,lockfile:a,migrationDirectories:l,shadowDbInitScript:r}}var kn=class e{engine;schemaContext;schemaFilter;shadowDbInitScript;migrationsDirectoryPath;constructor({schemaContext:r,migrationsDirPath:n,engine:o,schemaFilter:i,shadowDbInitScript:a}){this.engine=o,this.schemaContext=r,this.migrationsDirectoryPath=n,this.schemaFilter=i??{externalTables:[],externalEnums:[]},this.shadowDbInitScript=a??""}static async setup({schemaContext:r,schemaEngineConfig:n,...o}){let i=await(async()=>{let a=n.datasource;return await Qk.setup({datasource:a,schemaContext:r,...o})})();return new e({engine:i,schemaContext:r,...o})}async stop(){await this.engine.stop()}getPrismaSchema(){if(!this.schemaContext)throw new Error("this.schemaContext is undefined");return Nh(this.schemaContext.schemaFiles)}reset(){return this.engine.reset({filter:this.schemaFilter})}async createMigration(r){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");let n=await ml(this.migrationsDirectoryPath,this.shadowDbInitScript),{connectorType:o,generatedMigrationName:i,extension:a,migrationScript:c}=await this.engine.createMigration({...r,migrationsList:n,filters:this.schemaFilter}),{baseDir:u,lockfile:l}=n;if(c===null)return{generatedMigrationName:void 0};let p=await HIe({baseDir:u,generatedMigrationName:i}).catch(f=>{throw new Error(`Failed to create a new migration directory: ${f.message}`)});return await WIe({baseDir:u,extension:a,migrationName:i,script:c}).catch(f=>{throw new Error(`Failed to write migration script to ${p}: ${f.message}`)}),await VIe({baseDir:u,connectorType:o,lockfile:l}).catch(f=>{throw new Error(`Failed to write the migration lock file to ${u}: ${f.message}`)}),{generatedMigrationName:i}}async diagnoseMigrationHistory({optInToShadowDatabase:r}){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");let n=await ml(this.migrationsDirectoryPath,this.shadowDbInitScript);return this.engine.diagnoseMigrationHistory({migrationsList:n,optInToShadowDatabase:r,filters:this.schemaFilter})}async listMigrationDirectories(){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");return{migrations:(await ml(this.migrationsDirectoryPath,this.shadowDbInitScript)).migrationDirectories.map(n=>n.path)}}async devDiagnostic(){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");let r=await ml(this.migrationsDirectoryPath,this.shadowDbInitScript);return this.engine.devDiagnostic({migrationsList:r,filters:this.schemaFilter})}async markMigrationApplied({migrationId:r}){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");let n=await ml(this.migrationsDirectoryPath,this.shadowDbInitScript);return await this.engine.markMigrationApplied({migrationsList:n,migrationName:r})}markMigrationRolledBack({migrationId:r}){return this.engine.markMigrationRolledBack({migrationName:r})}async applyMigrations(){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");let r=await ml(this.migrationsDirectoryPath,this.shadowDbInitScript);return this.engine.applyMigrations({migrationsList:r,filters:this.
${ae("$")} prisma db execute [options]
The datasource URL configuration is read from the Prisma config file (e.g., ${In("prisma.config.ts")}).
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
${In("Script input, only 1 must be provided:")}
--file Path to a file. The content will be sent as the script to be executed
${q("Flags")}
--stdin Use the terminal standard input as the script to be executed`),UD=class e{static new(){return new e}static help=ut(`
${process.platform==="win32"?"":"\u{1F4DD} "}Execute native commands to your database
This command takes as input a datasource defined in ${In("prisma.config.ts")} and a script, using ${me("--stdin")} or ${me("--file")}.
The script input parameters are mutually exclusive, only 1 must be provided.
The output of the command is connector-specific, and is not meant for returning data, but only to report success or failure.
On SQL databases, this command takes as input a SQL script.
The whole script will be sent as a single command to the database.
${In("This command is currently not supported on MongoDB.")}
${zIe}
${q("Examples")}
Execute the content of a SQL script file using the datasource configured in prisma.config.ts
${ae("$")} prisma db execute --file ./script.sql
Execute the SQL script from stdin using the configured datasource
${ae("$")} echo 'TRUNCATE TABLE dev;' | \\
prisma db execute \\
--stdin
`);async parse(r,n,o){let i=bt(r,{"--help":Boolean,"-h":"--help","--config":String,"--stdin":Boolean,"--file":String,"--telemetry-information":String},!1);if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let a="db execute",c=ai({config:n,cmd:a});if(i["--stdin"]&&i["--file"])throw new Error(`--stdin and --file cannot be used at the same time. Only 1 must be provided.
See \`${me(Xt("prisma db execute -h"))}\``);if(!i["--stdin"]&&!i["--file"])throw new Error(`Either --stdin or --file must be provided.
See \`${me(Xt("prisma db execute -h"))}\``);let u="";if(i["--file"])try{u=JIe.default.readFileSync(YIe.default.resolve(i["--file"]),"utf-8")}catch(f){throw f.code==="ENOENT"?new Error(`Provided --file at ${i["--file"]} doesn't exist.`):(console.error(`An error occurred while reading the provided --file at ${i["--file"]}`),f)}i["--stdin"]&&(u=await KIe.default.text(process.stdin)),ii({cmd:a,validatedConfig:c});let l={tag:"url",url:c.datasource.url},p=await kn.setup({schemaEngineConfig:n,extensions:n.extensions,baseDir:o});try{await p.engine.dbExecute({script:u,datasourceType:l})}finally{await p.stop()}return"Script executed successfully."}help(r){if(r)throw new We(`
${r}
${zIe}`);return e.help}};var _Re=W(require("path"));function ZIe(e){let r=0,n=0;for(let o of e.files)r+=(o.content.match(/^model\s+/gm)||[]).length,n+=(o.content.match(/^type\s+/gm)||[]).length;return{modelsCount:r,typesCount:n}}function QIe(e){return e?e.files.every(r=>r.content.trim()===""):!0}var XIe=W(require("path"));function eRe(e,r){if(e.files.length===1){r.write(e.files[0].content+`
`);return}let n=e.files.sort((o,i)=>o.path.localeCompare(i.path));for(let o of n){let i=XIe.default.relative(process.cwd(),o.path);r.write(`// ${i}
${o.content}
`)}}var tRe=W(require("node:fs/promises"));async function rRe(e){await Promise.all(e.map(([r])=>tRe.default.rm(r)))}var nRe=W(require("node:fs/promises"));async function oRe(e){await Promise.all(e.files.map(r=>nRe.default.writeFile(r.path,r.content,"utf8")))}var VD=W(require("node:process"),1);var iRe=(e=0)=>r=>`\x1B[${r+e}m`,sRe=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,aRe=(e=0)=>(r,n,o)=>`\x1B[${38+e};2;${r};${n};${o}m`,Jn={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},tDr=Object.keys(Jn.modifier),ZOt=Object.keys(Jn.color),QOt=Object.keys(Jn.bgColor),rDr=[...ZOt,...QOt];function XOt(){let e=new Map;for(let[r,n]of Object.entries(Jn)){for(let[o,i]of Object.entries(n))Jn[o]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[o]=Jn[o],e.set(i[0],i[1]);Object.defineProperty(Jn,r,{value:n,enumerable:!1})}return Object.defineProperty(Jn,"codes",{value:e,enumerable:!1}),Jn.color.close="\x1B[39m",Jn.bgColor.close="\x1B[49m",Jn.color.ansi=iRe(),Jn.color.ansi256=sRe(),Jn.color.ansi16m=aRe(),Jn.bgColor.ansi=iRe(10),Jn.bgColor.ansi256=sRe(10),Jn.bgColor.ansi16m=aRe(10),Object.defineProperties(Jn,{rgbToAnsi256:{value(r,n,o){return r===n&&n===o?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(r){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!n)return[0,0,0];let[o]=n;o.length===3&&(o=[...o].map(a=>a+a).join(""));let i=Number.parseInt(o,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:r=>Jn.rgbToAnsi256(...Jn.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let n,o,i;if(r>=232)n=((r-232)*10+8)/255,o=n,i=n;else{r-=16;let u=r%36;n=Math.floor(r/36)/5,o=Math.floor(u/6)/5,i=u%6/5}let a=Math.max(n,o,i)*2;if(a===0)return 30;let c=30+(Math.round(i)<<2|Math.round(o)<<1|Math.round(n));return a===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:(r,n,o)=>Jn.ansi256ToAnsi(Jn.rgbToAnsi256(r,n,o)),enumerable:!1},hexToAnsi:{value:r=>Jn.ansi256ToAnsi(Jn.hexToAnsi256(r)),enumerable:!1}}),Jn}var eFt=XOt(),hl=eFt;var n6=W(require("node:process"),1),uRe=W(require("node:os"),1),yK=W(require("node:tty"),1);function au(e,r=globalThis.Deno?globalThis.Deno.args:n6.default.argv){let n=e.startsWith("-")?"":e.length===1?"-":"--",o=r.indexOf(n+e),i=r.indexOf("--");return o!==-1&&(i===-1||o<i)}var{env:go}=n6.default,r6;au("no-color")||au("no-colors")||au("color=false")||au("color=never")?r6=0:(au("color")||au("colors")||au("color=true")||au("color=always"))&&(r6=1);function tFt(){if("FORCE_COLOR"in go)return go.FORCE_COLOR==="true"?1:go.FORCE_COLOR==="false"?0:go.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(go.FORCE_COLOR,10),3)}function rFt(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function nFt(e,{streamIsTTY:r,sniffFlags:n=!0}={}){let o=tFt();o!==void 0&&(r6=o);let i=n?r6:o;if(i===0)return 0;if(n){if(au("color=16m")||au("color=full")||au("color=truecolor"))return 3;if(au("color=256"))return 2}if("TF_BUILD"in go&&"AGENT_NAME"in go)return 1;if(e&&!r&&i===void 0)return 0;let a=i||0;if(go.TERM==="dumb")return a;if(n6.default.platform==="win32"){let c=uRe.default.release().split(".");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if("CI"in go)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(c=>c in go)?3:["TRAVI
`:`
`)+n,i=o+1,o=e.indexOf(`
`,i)}while(o!==-1);return a+=e.slice(i),a}var{stdout:dRe,stderr:mRe}=lRe,xK=Symbol("GENERATOR"),OE=Symbol("STYLER"),qD=Symbol("IS_EMPTY"),hRe=["ansi","ansi","ansi256","ansi16m"],FE=Object.create(null),iFt=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=dRe?dRe.level:0;e.level=r.level===void 0?n:r.level};var sFt=e=>{let r=(...n)=>n.join(" ");return iFt(r,e),Object.setPrototypeOf(r,GD.prototype),r};function GD(e){return sFt(e)}Object.setPrototypeOf(GD.prototype,Function.prototype);for(let[e,r]of Object.entries(hl))FE[e]={get(){let n=o6(this,vK(r.open,r.close,this[OE]),this[qD]);return Object.defineProperty(this,e,{value:n}),n}};FE.visible={get(){let e=o6(this,this[OE],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var bK=(e,r,n,...o)=>e==="rgb"?r==="ansi16m"?hl[n].ansi16m(...o):r==="ansi256"?hl[n].ansi256(hl.rgbToAnsi256(...o)):hl[n].ansi(hl.rgbToAnsi(...o)):e==="hex"?bK("rgb",r,n,...hl.hexToRgb(...o)):hl[n][e](...o),aFt=["rgb","hex","ansi256"];for(let e of aFt){FE[e]={get(){let{level:n}=this;return function(...o){let i=vK(bK(e,hRe[n],"color",...o),hl.color.close,this[OE]);return o6(this,i,this[qD])}}};let r="bg"+e[0].toUpperCase()+e.slice(1);FE[r]={get(){let{level:n}=this;return function(...o){let i=vK(bK(e,hRe[n],"bgColor",...o),hl.bgColor.close,this[OE]);return o6(this,i,this[qD])}}}}var cFt=Object.defineProperties(()=>{},{...FE,level:{enumerable:!0,get(){return this[xK].level},set(e){this[xK].level=e}}}),vK=(e,r,n)=>{let o,i;return n===void 0?(o=e,i=r):(o=n.openAll+e,i=r+n.closeAll),{open:e,close:r,openAll:o,closeAll:i,parent:n}},o6=(e,r,n)=>{let o=(...i)=>uFt(o,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(o,cFt),o[xK]=e,o[OE]=r,o[qD]=n,o},uFt=(e,r)=>{if(e.level<=0||!r)return e[qD]?"":r;let n=e[OE];if(n===void 0)return r;let{openAll:o,closeAll:i}=n;if(r.includes("\x1B"))for(;n!==void 0;)r=pRe(r,n.close,n.open),n=n.parent;let a=r.indexOf(`
`);return a!==-1&&(r=fRe(r,i,o,a)),o+r+i};Object.defineProperties(GD.prototype,FE);var lFt=GD(),uDr=GD({level:mRe?mRe.level:0});var gl=lFt;var wK=W(require("node:process"),1);var HD=W(require("node:process"),1);var pFt=(e,r,n,o)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(r,n);!fFt(i,a)&&o||Object.defineProperty(e,n,a)},fFt=function(e,r){return e===void 0||e.configurable||e.writable===r.writable&&e.enumerable===r.enumerable&&e.configurable===r.configurable&&(e.writable||e.value===r.value)},dFt=(e,r)=>{let n=Object.getPrototypeOf(r);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},mFt=(e,r)=>`/* Wrapped ${e}*/
${r}`,hFt=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),gFt=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),yFt=(e,r,n)=>{let o=n===""?"":`with ${n.trim()}() `,i=mFt.bind(null,o,r.toString());Object.defineProperty(i,"name",gFt);let{writable:a,enumerable:c,configurable:u}=hFt;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:c,configurable:u})};function EK(e,r,{ignoreNonConfigurable:n=!1}={}){let{name:o}=e;for(let i of Reflect.ownKeys(r))pFt(e,r,i,n);return dFt(e,r),yFt(e,r,o),e}var i6=new WeakMap,gRe=(e,r={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,o=0,i=e.displayName||e.name||"<anonymous>",a=function(...c){if(i6.set(a,++o),o===1)n=e.apply(this,c),e=void 0;else if(r.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return EK(a,e),i6.set(a,o),a};gRe.callCount=e=>{if(!i6.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return i6.get(e)};var yRe=gRe;var xRe=HD.default.stderr.isTTY?HD.default.stderr:HD.default.stdout.isTTY?HD.default.stdout:void 0,xFt=xRe?yRe(()=>{Cv(()=>{xRe.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},bRe=xFt;var s6=!1,IE={};IE.show=(e=wK.default.stderr)=>{e.isTTY&&(s6=!1,e.write("\x1B[?25h"))};IE.hide=(e=wK.default.stderr)=>{e.isTTY&&(bRe(),s6=!0,e.write("\x1B[?25l"))};IE.toggle=(e,r)=>{e!==void 0&&(s6=e),s6?IE.show(r):IE.hide(r)};var RE=IE;var zD=W(SK(),1);var cu=W(require("node:process"),1);function _K(){return cu.default.platform!=="win32"?cu.default.env.TERM!=="linux":!!cu.default.env.CI||!!cu.default.env.WT_SESSION||!!cu.default.env.TERMINUS_SUBLIME||cu.default.env.ConEmuTask==="{cmd::Cmder}"||cu.default.env.TERM_PROGRAM==="Terminus-Sublime"||cu.default.env.TERM_PROGRAM==="vscode"||cu.default.env.TERM==="xterm-256color"||cu.default.env.TERM==="alacritty"||cu.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var vFt={info:gl.blue("\u2139"),success:gl.green("\u2714"),warning:gl.yellow("\u26A0"),error:gl.red("\u2716")},EFt={info:gl.blue("i"),success:gl.green("\u221A"),warning:gl.yellow("\u203C"),error:gl.red("\xD7")},wFt=_K()?vFt:EFt,WD=wFt;function TK({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var DK=W(require("node:process"),1);function CK(){let{env:e}=DK.default,{TERM:r,TERM_PROGRAM:n}=e;return DK.default.platform!=="win32"?r!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||r==="xterm-256color"||r==="alacritty"||r==="rxvt-unicode"||r==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var yl=W(require("node:process"),1),SFt=3,AK=class{#e=0;start(){this.#e++,this.#e===1&&this.#t()}stop(){if(this.#e<=0)throw new Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#r()}#t(){yl.default.platform==="win32"||!yl.default.stdin.isTTY||(yl.default.stdin.setRawMode(!0),yl.default.stdin.on("data",this.#o),yl.default.stdin.resume())}#r(){yl.default.stdin.isTTY&&(yl.default.stdin.off("data",this.#o),yl.default.stdin.pause(),yl.default.stdin.setRawMode(!1))}#o(r){r[0]===SFt&&yl.default.emit("SIGINT")}},_Ft=new AK,PK=_Ft;var TFt=W(SK(),1),OK=class{#e=0;#t=!1;#r=0;#o=-1;#i=0;#n;#s;#a;#c;#l;#p;#f;#u;#h;#d;#m;color;constructor(r){typeof r=="string"&&(r={text:r}),this.#n={color:"cyan",stream:VD.default.stderr,discardStdin:!0,hideCursor:!0,...r},this.color=this.#n.color,this.spinner=this.#n.spinner,this.#l=this.#n.interval,this.#a=this.#n.stream,this.#p=typeof this.#n.isEnabled=="boolean"?this.#n.isEnabled:TK({stream:this.#a}),this.#f=typeof this.#n.isSilent=="boolean"?this.#n.isSilent:!1,this.text=this.#n.text,this.prefixText=this.#n.prefixText,this.suffixText=this.#n.suffixText,this.indent=this.#n.indent,VD.default.env.NODE_ENV==="test"&&(this._stream=this.#a,this._isEnabled=this.#p,Object.defineProperty(this,"_linesToClear",{get(){return this.#e},set(n){this.#e=n}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#o}}),Object.defineProperty(this,"_lineCount",{get(){ret
`))this.#r+=Math.max(1,Math.ceil(Xi(a,{countAnsiEscapeCodes:!0})/r))}get isEnabled(){return this.#p&&!this.#f}set isEnabled(r){if(typeof r!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#p=r}get isSilent(){return this.#f}set isSilent(r){if(typeof r!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#f=r}frame(){let r=Date.now();(this.#o===-1||r-this.#i>=this.interval)&&(this.#o=++this.#o%this.#s.frames.length,this.#i=r);let{frames:n}=this.#s,o=n[this.#o];this.color&&(o=gl[this.color](o));let i=typeof this.#d=="string"&&this.#d!==""?this.#d+" ":"",a=typeof this.text=="string"?" "+this.text:"",c=typeof this.#m=="string"&&this.#m!==""?" "+this.#m:"";return i+o+a+c}clear(){if(!this.#p||!this.#a.isTTY)return this;this.#a.cursorTo(0);for(let r=0;r<this.#e;r++)r>0&&this.#a.moveCursor(0,-1),this.#a.clearLine(1);return(this.#u||this.lastIndent!==this.#u)&&this.#a.cursorTo(this.#u),this.lastIndent=this.#u,this.#e=0,this}render(){return this.#f?this:(this.clear(),this.#a.write(this.frame()),this.#e=this.#r,this)}start(r){return r&&(this.text=r),this.#f?this:this.#p?this.isSpinning?this:(this.#n.hideCursor&&RE.hide(this.#a),this.#n.discardStdin&&VD.default.stdin.isTTY&&(this.#t=!0,PK.start()),this.render(),this.#c=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#a.write(`- ${this.text}
`),this)}stop(){return this.#p?(clearInterval(this.#c),this.#c=void 0,this.#o=0,this.clear(),this.#n.hideCursor&&RE.show(this.#a),this.#n.discardStdin&&VD.default.stdin.isTTY&&this.#t&&(PK.stop(),this.#t=!1),this):this}succeed(r){return this.stopAndPersist({symbol:WD.success,text:r})}fail(r){return this.stopAndPersist({symbol:WD.error,text:r})}warn(r){return this.stopAndPersist({symbol:WD.warning,text:r})}info(r){return this.stopAndPersist({symbol:WD.info,text:r})}stopAndPersist(r={}){if(this.#f)return this;let n=r.prefixText??this.#d,o=this.#y(n," "),i=r.symbol??" ",a=r.text??this.text,u=typeof a=="string"?(i?" ":"")+a:"",l=r.suffixText??this.#m,p=this.#x(l," "),f=o+i+u+p+`
`;return this.stop(),this.#a.write(f),this}};function ME(e){return new OK(e)}var DFt={spinner:"dots",color:"cyan",indent:0,stream:process.stdout};function SRe(e=!0,r={}){let n={...DFt,...r};return o=>{if(!e)return{success:()=>{},failure:()=>{}};n.stream?.write(`
`);let i=ME(n);return i.start(o),{success:a=>{i.succeed(a)},failure:a=>{i.fail(a)}}}}var CFt=lt("prisma:db:pull"),KD=class e{static new(){return new e}static help=ut(`
Pull the state from the database to the Prisma schema using introspection
${q("Usage")}
${ae("$")} prisma db pull [flags/options]
The datasource URL configuration is read from the Prisma config file (e.g., ${In("prisma.config.ts")}).
${q("Flags")}
-h, --help Display this help message
--force Ignore current Prisma schema file
--print Print the introspected Prisma schema to stdout
${q("Options")}
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
--url Override the datasource URL from the Prisma config file
--composite-type-depth Specify the depth for introspecting composite types (e.g. Embedded Documents in MongoDB)
Number, default is -1 for infinite depth, 0 = off
--schemas Specify the database schemas to introspect. This overrides the schemas defined in the datasource block of your Prisma schema.
--local-d1 Generate a Prisma schema from a local Cloudflare D1 database
${q("Examples")}
With an existing Prisma schema
${ae("$")} prisma db pull
Or specify a Prisma schema path
${ae("$")} prisma db pull --schema=./schema.prisma
Instead of saving the result to the filesystem, you can also print it to stdout
${ae("$")} prisma db pull --print
Overwrite the current schema with the introspected schema instead of enriching it
${ae("$")} prisma db pull --force
Set composite types introspection depth to 2 levels
${ae("$")} prisma db pull --composite-type-depth=2
`);async parse(r,n,o=process.cwd()){let i=bt(r,{"--help":Boolean,"-h":"--help","--print":Boolean,"--schema":String,"--config":String,"--schemas":String,"--force":Boolean,"--composite-type-depth":Number,"--url":String}),a=SRe(!i["--print"]);if(i instanceof Error)return this.help(i.message);if(i["--help"])return this.help();let c=await Vn({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o}),printLoadMessage:!1,allowNull:!0}),u=n;i["--url"]&&(u={...u,datasource:{...u.datasource,url:i["--url"]}});let l="db pull",p=ai({config:u,cmd:l});if(ii({cmd:l,validatedConfig:p}),c&&!i["--print"]&&(Jf(c.loadedFromPathForLogMessages),Da({datasourceInfo:Ta(c?.primaryDatasource,p)})),!c)throw new $D;let f=c.primaryDatasource,g=c.schemaFiles;await hy({datamodel:g});let x=/\s*model\s*(\w+)\s*{/;if(g.some(([k,j])=>!!x.exec(j))&&!i["--force"]&&f?.provider==="mongodb")throw new Error(`Iterating on one schema using re-introspection with db pull is currently not supported with MongoDB provider.
You can explicitly ignore and override your current local schema file with ${me(Xt("prisma db pull --force"))}
Some information will be lost (relations, comments, mapped fields, @ignore...), follow ${Pt("https://github.com/prisma/prisma/issues/9585")} for more info.`);let S=(await kn.setup({schemaEngineConfig:u,baseDir:o,schemaContext:c,extensions:u.extensions})).engine,_=f?` based on datasource defined in ${sn(c.loadedFromPathForLogMessages)}`:"",D=a(`Introspecting${_}`),P=Math.round(performance.now()),C,O;try{let k=Zi(c,u),j=await S.introspect({schema:Nh(g),baseDirectoryPath:c?.schemaRootDir??process.cwd(),viewsDirectoryPath:k.viewsDirPath,force:i["--force"],compositeTypeDepth:i["--composite-type-depth"],namespaces:i["--schemas"]?.split(",")});C=j.schema,O=j.warnings,CFt("Introspection warnings",O)}catch(k){if(D.failure(),k.code==="P4001"&&QIe(C))throw new Error(`
${he(q(`${k.code} `))}${he("The introspected database was empty:")}
${q("prisma db pull")} could not create any models in your ${q("schema.prisma")} file and you will not be able to generate Prisma Client with the ${q(Xt("prisma generate"))} command.
${q("To fix this, you have two options:")}
- manually create a table in your database.
- make sure the database connection URL inside the ${q("datasource")} block in ${q("schema.prisma")} points to a database that is not empty (it must contain at least one table).
Then you can run ${me(Xt("prisma db pull"))} again.
`);if(k.code==="P1003")throw new Error(`
${he(q(`${k.code} `))}${he("The introspected database does not exist:")}
${q("prisma db pull")} could not create any models in your ${q("schema.prisma")} file and you will not be able to generate Prisma Client with the ${q(Xt("prisma generate"))} command.
${q("To fix this, you have two options:")}
- manually create a database.
- make sure the database connection URL inside the ${q("datasource")} block in ${q("schema.prisma")} points to an existing database.
Then you can run ${me(Xt("prisma db pull"))} again.
`);if(k.code==="P1012"){process.stdout.write(`
`);let j=pc(k.message);throw new Error(`${he(j)}
Introspection failed as your current Prisma schema file is invalid
Please fix your current schema manually (using either ${me(Xt("prisma validate"))} or the Prisma VS Code extension to understand what's broken and confirm you fixed it), and then run this command again.
Or run this command with the ${me("--force")} flag to ignore your current schema and overwrite it. All local modifications will be lost.
`)}throw process.stdout.write(`
`),k}let I=this.getWarningMessage(O);if(i["--print"])eRe(C,process.stdout),I.trim().length>0&&console.error(I.replace(/(\n)/gm,`
// `));else{i["--force"]&&await rRe(g),await oRe(C);let{modelsCount:k,typesCount:j}=ZIe(C),G=`${k} ${k>1?"models":"model"}`,B=`${j} ${j>1?"embedded documents":"embedded document"}`,H;j>0?H=`${G} and ${B}`:H=`${G}`;let N=k+j>1?`${H} and wrote them`:`${H} and wrote it`,Y=c?.loadedFromPathForLogMessages||C.files[0].path;D.success(`Introspected ${N} into ${sn(_Re.default.relative(process.cwd(),Y))} in ${q(Kf(Math.round(performance.now())-P))}
${Gt(I)}
${`Run ${me(Xt("prisma generate"))} to generate Prisma Client.`}`)}return""}getWarningMessage(r){return r?`
${r}`:""}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var TRe=W(Ih());var JD=class e{static new(){return new e}static help=ut(`
${process.platform==="win32"?"":"\u{1F64C} "}Push the state from your Prisma schema to your database
${q("Usage")}
${ae("$")} prisma db push [options]
The datasource URL configuration is read from the Prisma config file (e.g., ${In("prisma.config.ts")}).
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
--url Override the datasource URL from the Prisma config file
--accept-data-loss Ignore data loss warnings
--force-reset Force a reset of the database before push
${q("Examples")}
Push the Prisma schema state to the database
${ae("$")} prisma db push
Specify a schema
${ae("$")} prisma db push --schema=./schema.prisma
Ignore data loss warnings
${ae("$")} prisma db push --accept-data-loss
`);async parse(r,n,o){let i=bt(r,{"--help":Boolean,"-h":"--help","--accept-data-loss":Boolean,"--force-reset":Boolean,"--schema":String,"--config":String,"--url":String,"--telemetry-information":String},!1);if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let a=await Vn({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o})}),{migrationsDirPath:c}=Zi(a,n),u=n;i["--url"]&&(u={...u,datasource:{...u.datasource,url:i["--url"]}});let l="db push",p=ai({config:u,cmd:l});ii({cmd:l,validatedConfig:p});let f=Ta(a.primaryDatasource,p);Da({datasourceInfo:f});let g={externalTables:u.tables?.external??[],externalEnums:u.enums?.external??[]},x=await kn.setup({schemaEngineConfig:u,baseDir:o,migrationsDirPath:c,schemaContext:a,schemaFilter:g,extensions:u.extensions});try{let _=await Lh(o,Xf(a),p);_&&process.stdout.write(`
`+_+`
`)}catch(_){throw process.stdout.write(`
`),_}let b=!1;if(i["--force-reset"]){process.stdout.write(`
`),Yk();try{await x.reset()}catch(P){throw await x.stop(),P}let _=`The ${f.prettyProvider} database`;f.dbName&&(_+=` "${f.dbName}"`);let D=f.schemas?.length||0;f.schemas&&D>0?_+=` schema${D>1?"s":""} "${f.schemas.join(", ")}"`:f.schema&&(_+=` schema "${f.schema}"`),f.dbLocation&&(_+=` at "${f.dbLocation}"`),_+=` ${D>1?"were":"was"} successfully reset.
`,process.stdout.write(_),b=!0}let v=Math.round(performance.now()),S;try{S=await x.push({force:i["--accept-data-loss"]})}catch(_){throw await x.stop(),_}if(S.unexecutable&&S.unexecutable.length>0){let _=[];_.push(`${q(he(`
\u26A0\uFE0F We found changes that cannot be executed:
`))}`);for(let D of S.unexecutable)_.push(` \u2022 ${D}`);throw process.stdout.write(`
`),await x.stop(),new Error(`${_.join(`
`)}
You may use the --force-reset flag to drop the database before push like ${q(me(Xt("prisma db push --force-reset")))}
${q(he("All data will be lost."))}
`)}if(S.warnings&&S.warnings.length>0){process.stdout.write(q(Gt(`
\u26A0\uFE0F There might be data loss when applying the changes:
`)));for(let _ of S.warnings)process.stdout.write(` \u2022 ${_}
`);if(process.stdout.write(`
`),!i["--accept-data-loss"]){if(!ld())throw await x.stop(),new ND;process.stdout.write(`
`),(await(0,TRe.default)({type:"confirm",name:"value",message:"Do you want to ignore the warning(s)?"})).value||(process.stdout.write(`Push cancelled.
`),await x.stop(),process.exit(130));try{await x.push({force:!0})}catch(D){throw await x.stop(),D}}}if(await x.stop(),!b&&S.warnings.length===0&&S.executedSteps===0)process.stdout.write(`
The database is already in sync with the Prisma schema.
`);else{let _=`Done in ${Kf(Math.round(performance.now())-v)}`,D=process.platform==="win32"?"":"\u{1F680} ",P="Your database is now in sync with your Prisma schema.",C="Your database indexes are now in sync with your Prisma schema.",O=a.primaryDatasource?.activeProvider;process.stdout.write(`
${D}${O==="mongodb"?C:P} ${_}
`)}return""}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var CRe=W(gW());var AFt=lt("prisma:migrate:seed");async function DRe({commandFromConfig:e,extraArgs:r}){let n=r?`${e} ${r}`:e;process.stdout.write(`Running seed command \`${In(n)}\` ...
`);try{await phe(n,{stdout:"inherit",stderr:"inherit"})}catch(o){let i=o;return AFt({e:i}),console.error(q(he(`
An error occurred while running the seed command:`))),console.error(he(i.stderr||String(i))),!1}return!0}var YD=class e{static new(){return new e}static help=ut(`
${process.platform==="win32"?"":"\u{1F64C} "}Seed your database
${q("Usage")}
${ae("$")} prisma db seed [options]
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
${q("Examples")}
Passing extra arguments to the seed command
${ae("$")} prisma db seed -- --arg1 value1 --arg2 value2
`);async parse(r,n){let o=bt(r,{"--help":Boolean,"-h":"--help","--schema":String,"--config":String,"--telemetry-information":String},!1);if(Ht(o)){if(o instanceof CRe.ArgError&&o.code==="ARG_UNKNOWN_OPTION")throw new Error(`${o.message}
Did you mean to pass these as arguments to your seed script? If so, add a -- separator before them:
${ae("$")} prisma db seed -- --arg1 value1 --arg2 value2`);return this.help(o.message)}if(o["--help"])return this.help();let i=n.migrations?.seed;if(!i)return ut(`\u26A0\uFE0F ${q("No seed command configured")}
To seed your database, add a ${q("seed")} property to the ${q("migrations")} section in your ${q("Prisma config")} file.
${q("Example")}
${ae("// prisma.config.ts")}
export default defineConfig({
${q("migrations: {")}
${q("seed: 'bun\xB7./prisma/seed.ts'")},
${q("}")},
${ae("datasource: {")}
${ae("url: '[your database URL]'")},
${ae("}")},
})
`);let a=o._.join(" ");if(await DRe({commandFromConfig:i,extraArgs:a}))return`
${process.platform==="win32"?"":"\u{1F331} "}The seed command has been executed.`;process.exit(1)}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var ZD=class e{constructor(r){this.cmds=r}static new(r){return new e(r)}static help=ut(`
Update the database schema with migrations
${q("Usage")}
${ae("$")} prisma migrate [command] [options]
${q("Commands for development")}
dev Create a migration from changes in Prisma schema, apply it to the database
trigger generators (e.g. Prisma Client)
reset Reset your database and apply all migrations, all data will be lost
${q("Commands for production/staging")}
deploy Apply pending migrations to the database
status Check the status of your database migrations
resolve Resolve issues with database migrations, i.e. baseline, failed migration, hotfix
${q("Command for any stage")}
diff Compare the database schema from two arbitrary sources
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
${q("Examples")}
Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
${ae("$")} prisma migrate dev
Reset your database and apply all migrations
${ae("$")} prisma migrate reset
Apply pending migrations to the database in production/staging
${ae("$")} prisma migrate deploy
Check the status of migrations in the production/staging database
${ae("$")} prisma migrate status
Specify a schema
${ae("$")} prisma migrate status --schema=./schema.prisma
Compare the database schema from two databases and render the diff as a SQL script
${ae("$")} prisma migrate diff \\
--from-url "$DATABASE_URL" \\
--to-url "postgresql://login:password@localhost:5432/db" \\
--script
`);async parse(r,n,o){let i=bt(r,{"--help":Boolean,"-h":"--help","--config":String,"--preview-feature":Boolean,"--telemetry-information":String});if(Ht(i))return this.help(i.message);if(i._.length===0||i["--help"])return this.help();let a=i._[0],c=this.cmds[a];if(c){let u;return a==="diff"?u=i["--preview-feature"]?[...i._.slice(1),"--preview-feature"]:i._.slice(1):u=i._.filter(p=>p!=="--preview-feature").slice(1),c.parse(u,n,o)}return uy(e.help,a)}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var ARe=W(ys());function c6(e){let r=e.split("_");return r.length===1?qc(q(e)):`${r[0]}_${qc(q(r.slice(1).join("_")))}`}function ky(e,r,n){let o=Object.keys(n),i=`${e}/`;return r.forEach(a=>{i+=`
\u2514\u2500 ${c6(a)}/
${(0,ARe.default)(o.map(c=>`\u2514\u2500 ${c}`).join(`
`),4)}`}),i}var PFt=lt("prisma:migrate:deploy"),QD=class e{static new(){return new e}static help=ut(`
Apply pending migrations to update the database schema in production/staging
${q("Usage")}
${ae("$")} prisma migrate deploy [options]
The datasource URL configuration is read from the Prisma config file (e.g., ${In("prisma.config.ts")}).
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
${q("Examples")}
Deploy your pending migrations to your production/staging database
${ae("$")} prisma migrate deploy
Specify a schema
${ae("$")} prisma migrate deploy --schema=./schema.prisma
`);async parse(r,n,o){let i=bt(r,{"--help":Boolean,"-h":"--help","--schema":String,"--config":String,"--telemetry-information":String},!1);if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let a=await Vn({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o})}),{migrationsDirPath:c}=Zi(a,n),u="migrate deploy",l=ai({config:n,cmd:u});ii({cmd:u,validatedConfig:l}),Da({datasourceInfo:Ta(a.primaryDatasource,l)});let p={externalTables:n.tables?.external??[],externalEnums:n.enums?.external??[]},f=await kn.setup({schemaEngineConfig:n,baseDir:o,migrationsDirPath:c,schemaContext:a,schemaFilter:p,extensions:n.extensions});try{let b=await Lh(o,Xf(a),l);b&&process.stdout.write(`
`+b+`
`)}catch(b){throw process.stdout.write(`
`),b}let g=await f.listMigrationDirectories();if(PFt({listMigrationDirectoriesResult:g}),process.stdout.write(`
`),g.migrations.length>0){let b=g.migrations;process.stdout.write(`${b.length} migration${b.length>1?"s":""} found in prisma/migrations
`)}else process.stdout.write(`No migration found in prisma/migrations
`);let x;try{process.stdout.write(`
`);let{appliedMigrationNames:b}=await f.applyMigrations();x=b}finally{await f.stop()}return process.stdout.write(`
`),x.length===0?me("No pending migrations to apply."):`The following migration(s) have been applied:
${ky("migrations",x,{"migration.sql":""})}
${me("All migrations have been successfully applied.")}`}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var RRe=W(require("node:path"));var MRe=W(Ih());function PRe(e,r=!1){if(e&&e.length>0){let n=[];n.push(`${q(he(`
\u26A0\uFE0F We found changes that cannot be executed:
`))}`);for(let o of e)n.push(`${` \u2022 Step ${o.stepIndex} ${o.message}`}`);if(process.stdout.write(`
`),r){console.error(`${n.join(`
`)}
`);return}else return`${n.join(`
`)}
You can use ${Xt("prisma migrate dev --create-only")} to create the migration file, and manually modify it to address the underlying issue(s).
Then run ${Xt("prisma migrate dev")} to apply it and verify it works.
`}}var OFt=[["\xDF","ss"],["\u1E9E","Ss"],["\xE4","ae"],["\xC4","Ae"],["\xF6","oe"],["\xD6","Oe"],["\xFC","ue"],["\xDC","Ue"],["\xC0","A"],["\xC1","A"],["\xC2","A"],["\xC3","A"],["\xC4","Ae"],["\xC5","A"],["\xC6","AE"],["\xC7","C"],["\xC8","E"],["\xC9","E"],["\xCA","E"],["\xCB","E"],["\xCC","I"],["\xCD","I"],["\xCE","I"],["\xCF","I"],["\xD0","D"],["\xD1","N"],["\xD2","O"],["\xD3","O"],["\xD4","O"],["\xD5","O"],["\xD6","Oe"],["\u0150","O"],["\xD8","O"],["\xD9","U"],["\xDA","U"],["\xDB","U"],["\xDC","Ue"],["\u0170","U"],["\xDD","Y"],["\xDE","TH"],["\xDF","ss"],["\xE0","a"],["\xE1","a"],["\xE2","a"],["\xE3","a"],["\xE4","ae"],["\xE5","a"],["\xE6","ae"],["\xE7","c"],["\xE8","e"],["\xE9","e"],["\xEA","e"],["\xEB","e"],["\xEC","i"],["\xED","i"],["\xEE","i"],["\xEF","i"],["\xF0","d"],["\xF1","n"],["\xF2","o"],["\xF3","o"],["\xF4","o"],["\xF5","o"],["\xF6","oe"],["\u0151","o"],["\xF8","o"],["\xF9","u"],["\xFA","u"],["\xFB","u"],["\xFC","ue"],["\u0171","u"],["\xFD","y"],["\xFE","th"],["\xFF","y"],["\u1E9E","SS"],["\xE0","a"],["\xC0","A"],["\xE1","a"],["\xC1","A"],["\xE2","a"],["\xC2","A"],["\xE3","a"],["\xC3","A"],["\xE8","e"],["\xC8","E"],["\xE9","e"],["\xC9","E"],["\xEA","e"],["\xCA","E"],["\xEC","i"],["\xCC","I"],["\xED","i"],["\xCD","I"],["\xF2","o"],["\xD2","O"],["\xF3","o"],["\xD3","O"],["\xF4","o"],["\xD4","O"],["\xF5","o"],["\xD5","O"],["\xF9","u"],["\xD9","U"],["\xFA","u"],["\xDA","U"],["\xFD","y"],["\xDD","Y"],["\u0103","a"],["\u0102","A"],["\u0110","D"],["\u0111","d"],["\u0129","i"],["\u0128","I"],["\u0169","u"],["\u0168","U"],["\u01A1","o"],["\u01A0","O"],["\u01B0","u"],["\u01AF","U"],["\u1EA1","a"],["\u1EA0","A"],["\u1EA3","a"],["\u1EA2","A"],["\u1EA5","a"],["\u1EA4","A"],["\u1EA7","a"],["\u1EA6","A"],["\u1EA9","a"],["\u1EA8","A"],["\u1EAB","a"],["\u1EAA","A"],["\u1EAD","a"],["\u1EAC","A"],["\u1EAF","a"],["\u1EAE","A"],["\u1EB1","a"],["\u1EB0","A"],["\u1EB3","a"],["\u1EB2","A"],["\u1EB5","a"],["\u1EB4","A"],["\u1EB7","a"],["\u1EB6","A"],["\u1EB9","e"],["\u1EB8","E"],["\u1EBB","e"],["\u1EBA","E"],["\u1EBD","e"],["\u1EBC","E"],["\u1EBF","e"],["\u1EBE","E"],["\u1EC1","e"],["\u1EC0","E"],["\u1EC3","e"],["\u1EC2","E"],["\u1EC5","e"],["\u1EC4","E"],["\u1EC7","e"],["\u1EC6","E"],["\u1EC9","i"],["\u1EC8","I"],["\u1ECB","i"],["\u1ECA","I"],["\u1ECD","o"],["\u1ECC","O"],["\u1ECF","o"],["\u1ECE","O"],["\u1ED1","o"],["\u1ED0","O"],["\u1ED3","o"],["\u1ED2","O"],["\u1ED5","o"],["\u1ED4","O"],["\u1ED7","o"],["\u1ED6","O"],["\u1ED9","o"],["\u1ED8","O"],["\u1EDB","o"],["\u1EDA","O"],["\u1EDD","o"],["\u1EDC","O"],["\u1EDF","o"],["\u1EDE","O"],["\u1EE1","o"],["\u1EE0","O"],["\u1EE3","o"],["\u1EE2","O"],["\u1EE5","u"],["\u1EE4","U"],["\u1EE7","u"],["\u1EE6","U"],["\u1EE9","u"],["\u1EE8","U"],["\u1EEB","u"],["\u1EEA","U"],["\u1EED","u"],["\u1EEC","U"],["\u1EEF","u"],["\u1EEE","U"],["\u1EF1","u"],["\u1EF0","U"],["\u1EF3","y"],["\u1EF2","Y"],["\u1EF5","y"],["\u1EF4","Y"],["\u1EF7","y"],["\u1EF6","Y"],["\u1EF9","y"],["\u1EF8","Y"],["\u0621","e"],["\u0622","a"],["\u0623","a"],["\u0624","w"],["\u0625","i"],["\u0626","y"],["\u0627","a"],["\u0628","b"],["\u0629","t"],["\u062A","t"],["\u062B","th"],["\u062C","j"],["\u062D","h"],["\u062E","kh"],["\u062F","d"],["\u0630","dh"],["\u0631","r"],["\u0632","z"],["\u0633","s"],["\u0634","sh"],["\u0635","s"],["\u0636","d"],["\u0637","t"],["\u0638","z"],["\u0639","e"],["\u063A","gh"],["\u0640","_"],["\u0641","f"],["\u0642","q"],["\u0643","k"],["\u0644","l"],["\u0645","m"],["\u0646","n"],["\u0647","h"],["\u0648","w"],["\u0649","a"],["\u064A","y"],["\u064E\u200E","a"],["\u064F","u"],["\u0650\u200E","i"],["\u0660","0"],["\u0661","1"],["\u0662","2"],["\u0663","3"],["\u0664","4"],["\u0665","5"],["\u0666","6"],["\u0667","7"],["\u0668","8"],["\u0669","9"],["\u0686","ch"],["\u06A9","k"],["\u06AF","g"],["\u067E","p"],["\u0698","zh"],["\u06CC","y"],["\u06F0","0"],["\u06F1","1"],["\u06F2","2"],["\u06F3","3"],["\u06F4","4"],["\u06F5","5"],["\u06F6","6"],["\u06F7","7"],["\u06F8","8"],["\u06F9","9"],["\u067C","p"],["\u0681","z"],["\u0685","c"],["\u0689","d"],["\uFEAB","d"],["\uFEAD","r"],["\u0693","r"],["\uFEAF","z"],[
`);let o=await(0,l6.prompt)({type:"text",name:"name",message:n});return"name"in o?{name:u6(o.name,{separator:"_"}).substring(0,200)||""}:{userCancelled:"Canceled by user."}}var IK=lt("prisma:migrate:dev"),XD=class e{static new(){return new e}static help=ut(`
${process.platform==="win32"?"":"\u{1F3CB}\uFE0F "}Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
${q("Usage")}
${ae("$")} prisma migrate dev [options]
The datasource URL configuration is read from the Prisma config file (e.g., ${In("prisma.config.ts")}).
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
--url Override the datasource URL from the Prisma config file
-n, --name Name the migration
--create-only Create a new migration but do not apply it
The migration will be empty if there are no changes in Prisma schema
${q("Examples")}
Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
${ae("$")} prisma migrate dev
Specify a schema
${ae("$")} prisma migrate dev --schema=./schema.prisma
Create a migration without applying it
${ae("$")} prisma migrate dev --create-only
`);async parse(r,n,o){let i=bt(r,{"--help":Boolean,"-h":"--help","--name":String,"-n":"--name","--create-only":Boolean,"--schema":String,"--config":String,"--url":String,"--telemetry-information":String});if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let a=await Vn({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o})}),{migrationsDirPath:c}=Zi(a,n),u=n;i["--url"]&&(u={...u,datasource:{...u.datasource,url:i["--url"]}});let l="migrate dev",p=ai({config:u,cmd:l});ii({cmd:l,validatedConfig:p});let f=Ta(a.primaryDatasource,p);Da({datasourceInfo:f}),process.stdout.write(`
`),gy({schemas:a.schemaFiles});let g=await Lh(o,Xf(a),p);g&&process.stdout.write(g+`
`);let x={externalTables:u.tables?.external??[],externalEnums:u.enums?.external??[]},b=await kn.setup({schemaEngineConfig:u,baseDir:o,migrationsDirPath:c,schemaContext:a,schemaFilter:x,shadowDbInitScript:u.migrations?.initShadowDb,extensions:u.extensions}),v;try{v=await b.devDiagnostic(),IK({devDiagnostic:JSON.stringify(v,null,2)})}catch(O){throw await b.stop(),O}let S=[];v.action.tag==="reset"&&(this.logResetReason({datasourceInfo:f,reason:v.action.reason}),process.stdout.write(`
You may use ${he("prisma migrate reset")} to drop the development database.
${q(he("All data will be lost."))}
`),await b.stop(),process.exit(130));try{let{appliedMigrationNames:O}=await b.applyMigrations();S.push(...O),O.length>0&&process.stdout.write(`
The following migration(s) have been applied:
${ky("migrations",O,{"migration.sql":""})}
`)}catch(O){throw await b.stop(),O}let _;try{_=await b.evaluateDataLoss(),IK({evaluateDataLossResult:_})}catch(O){throw await b.stop(),O}let D=PRe(_.unexecutableSteps,i["--create-only"]);if(D)throw await b.stop(),new Error(D);if(_.warnings&&_.warnings.length>0){process.stdout.write(q(`
\u26A0\uFE0F Warnings for the current datasource:
`));for(let O of _.warnings)process.stdout.write(` \u2022 ${O.message}
`);if(process.stdout.write(`
`),!i["--force"]){if(!ld())throw await b.stop(),new BD;let O=i["--create-only"]?"Are you sure you want to create this migration?":"Are you sure you want to create and apply this migration?";(await(0,MRe.default)({type:"confirm",name:"value",message:O})).value||(process.stdout.write(`Migration cancelled.
`),await b.stop(),process.exit(130))}}let P;if(_.migrationSteps>0||i["--create-only"]){let O=await IRe(i["--name"]);O.userCancelled?(process.stdout.write(O.userCancelled+`
`),await b.stop(),process.exit(130)):P=O.name}let C;try{let O=await b.createMigration({migrationName:P||"",draft:!!i["--create-only"],schema:b.getPrismaSchema()});if(IK({createMigrationResult:O}),i["--create-only"])return await b.stop(),`Prisma Migrate created the following migration without applying it ${c6(O.generatedMigrationName)}
You can now edit it and apply it by running ${me(Xt("prisma migrate dev"))}.`;let{appliedMigrationNames:I}=await b.applyMigrations();C=I}finally{await b.stop()}if(S.length>0&&process.stdout.write(`
`),C.length===0)S.length>0?process.stdout.write(`${me("Your database is now in sync with your schema.")}
`):process.stdout.write(`Already in sync, no schema change or pending migration was found.
`);else{let O=RRe.default.relative(process.cwd(),c);process.stdout.write(`
The following migration(s) have been created and applied from new schema changes:
${ky(O,C,{"migration.sql":""})}
${me("Your database is now in sync with your schema.")}
`)}return""}logResetReason({datasourceInfo:r,reason:n}){process.stdout.write(n+`
`);let o;["PostgreSQL","SQL Server"].includes(r.prettyProvider)?r.schemas?.length?o=`We need to reset the following schemas: "${r.schemas.join(", ")}"`:r.schema?o=`We need to reset the "${r.schema}" schema`:o="We need to reset the database schema":o=`We need to reset the ${r.prettyProvider} database "${r.dbName}"`,r.dbLocation&&(o+=` at "${r.dbLocation}"`),process.stdout.write(`${o}
`)}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var $Re=W(i0e());var RK=W(require("path"));var p6=class{_capturedText;_orig_stdout_write;constructor(){this._capturedText=[],this._orig_stdout_write=null}startCapture(){this._orig_stdout_write=process.stdout.write,process.stdout.write=this._writeCapture.bind(this)}stopCapture(){this._orig_stdout_write&&(process.stdout.write=this._orig_stdout_write)}_writeCapture(r){this._capturedText.push(r)}getCapturedText(){return this._capturedText}clearCaptureText(){this._capturedText=[]}};var $Ft=lt("prisma:migrate:diff"),kRe=ut(`${q("Usage")}
${ae("$")} prisma migrate diff [options]
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
-o, --output Writes to a file instead of stdout
${In("From and To inputs (1 `--from-...` and 1 `--to-...` must be provided):")}
--from-empty Flag to assume from or to is an empty datamodel
--to-empty
--from-schema Path to a Prisma schema file, uses the ${In("datamodel")} for the diff
--to-schema
--from-migrations Path to the Prisma Migrate migrations directory
--to-migrations
--from-config-datasource Flag to use the datasource from the Prisma config file
--to-config-datasource
${q("Flags")}
--script Render a SQL script to stdout instead of the default human readable summary (not supported on MongoDB)
--exit-code Change the exit code behavior to signal if the diff is empty or not (Empty: 0, Error: 1, Not empty: 2). Default behavior is Success: 0, Error: 1.`),e2=class e{static new(){return new e}static help=ut(`
${process.platform==="win32"?"":"\u{1F50D} "}Compares the database schema from two arbitrary sources, and outputs the differences either as a human-readable summary (by default) or an executable script.
${me("prisma migrate diff")} is a read-only command that does not write to your datasource(s).
${me("prisma db execute")} can be used to execute its ${me("--script")} output.
The command takes a source ${me("--from-...")} and a destination ${me("--to-...")}.
The source and destination must use the same provider,
e.g. a diff using 2 different providers like PostgreSQL and SQLite is not supported.
It compares the source with the destination to generate a diff.
The diff can be interpreted as generating a migration that brings the source schema (from) to the shape of the destination schema (to).
The default output is a human readable diff, it can be rendered as SQL using \`--script\` on SQL databases.
See the documentation for more information ${Pt("https://pris.ly/d/migrate-diff")}
${kRe}
${q("Examples")}
From the configured database to a Prisma datamodel
e.g. roll forward after a migration failed in the middle
${ae("$")} prisma migrate diff \\
--from-config-datasource \\
--to-schema=next_datamodel.prisma \\
--script
From a Prisma datamodel to the configured database
e.g. roll forward after a migration failed in the middle
${ae("$")} prisma migrate diff \\
--from-schema=next_datamodel.prisma \\
--to-config-datasource \\
--script
From a Prisma Migrate \`migrations\` directory to the configured database
e.g. generate a migration for a hotfix already applied on production
${ae("$")} prisma migrate diff \\
--from-migrations ./migrations \\
--to-config-datasource \\
--script
Execute the --script output with \`prisma db execute\` using bash pipe \`|\`
${ae("$")} prisma migrate diff \\
--from-[...] \\
--to-[...] \\
--script | prisma db execute --stdin --url="$DATABASE_URL"
Detect if both sources are in sync, it will exit with exit code 2 if changes are detected
${ae("$")} prisma migrate diff \\
--exit-code \\
--from-[...] \\
--to-[...]
`);async parse(r,n,o){let i=bt(r,{"--help":Boolean,"-h":"--help","--output":String,"-o":"--output","--from-empty":Boolean,"--from-config-datasource":Boolean,"--from-schema":String,"--from-migrations":String,"--to-empty":Boolean,"--to-config-datasource":Boolean,"--to-schema":String,"--to-migrations":String,"--script":Boolean,"--exit-code":Boolean,"--telemetry-information":String,"--config":String,"--from-url":String,"--to-url":String,"--from-schema-datasource":String,"--to-schema-datasource":String,"--from-schema-datamodel":String,"--to-schema-datamodel":String,"--from-local-d1":Boolean,"--to-local-d1":Boolean},!1);if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let a=Object.keys(i).map(NFt).find(_=>_!==void 0);if(a)return this.help(a);let c=+!!i["--from-empty"]+ +!!i["--from-config-datasource"]+ +!!i["--from-schema"]+ +!!i["--from-migrations"],u=+!!i["--to-empty"]+ +!!i["--to-config-datasource"]+ +!!i["--to-schema"]+ +!!i["--to-migrations"];if(c!==1||u!==1){let _=[];return c!==1&&_.push(`${c} \`--from-...\` parameter(s) provided. 1 must be provided.`),u!==1&&_.push(`${u} \`--to-...\` parameter(s) provided. 1 must be provided.`),this.help(`${_.join(`
`)}`)}let l;if(i["--from-empty"])l={tag:"empty"};else if(i["--from-schema"]){let _=await Qi({schemaPath:hr({schemaPathFromArgs:RK.default.resolve(i["--from-schema"]),schemaPathFromConfig:n.schema,baseDir:o}),argumentName:"--from-schema"});l={tag:"schemaDatamodel",...Nh(_.schemas)}}else if(i["--from-migrations"])l={tag:"migrations",...await ml(i["--from-migrations"],n.migrations?.initShadowDb??"")};else if(i["--from-config-datasource"]){let _=await Vn({schemaPath:hr({schemaPathFromConfig:n.schema,baseDir:o}),printLoadMessage:!1});l={tag:"schemaDatasource",...Kk(_,o)}}let p;if(i["--to-empty"])p={tag:"empty"};else if(i["--to-schema"]){let _=await Qi({schemaPath:hr({schemaPathFromArgs:RK.default.resolve(i["--to-schema"]),schemaPathFromConfig:n.schema,baseDir:o}),argumentName:"--to-schema"});p={tag:"schemaDatamodel",...Nh(_.schemas)}}else if(i["--to-migrations"])p={tag:"migrations",...await ml(i["--to-migrations"],n.migrations?.initShadowDb??"")};else if(i["--to-config-datasource"]){let _=await Vn({schemaPath:hr({schemaPathFromConfig:n.schema,baseDir:o}),printLoadMessage:!1});p={tag:"schemaDatasource",...Kk(_,o)}}let f={externalTables:n.tables?.external??[],externalEnums:n.enums?.external??[]},g=await kn.setup({schemaEngineConfig:n,baseDir:o,schemaFilter:f,extensions:n.extensions}),x=new p6,b=i["--output"],v=!!b;v&&x.startCapture();let S;try{S=await g.engine.migrateDiff({from:l,to:p,script:i["--script"]||!1,shadowDatabaseUrl:i["--shadow-database-url"]??null,exitCode:i["--exit-code"]??null,filters:{externalTables:n.tables?.external??[],externalEnums:n.enums?.external??[]}})}finally{await g.stop()}if(v){x.stopCapture();let _=x.getCapturedText();x.clearCaptureText(),await $Re.default.writeAsync(b,_.join(`
`))}return $Ft({migrateDiffOutput:S}),i["--exit-code"]&&S.exitCode&&process.exit(S.exitCode),""}help(r){if(r)throw new We(`
${r}
${kRe}`);return e.help}};function NFt(e){switch(e){case"--from-url":case"--to-url":case"--from-schema-datasource":case"--to-schema-datasource":return`\`${e}\` was removed. Please use \`--[from/to]-config-datasource\` in combination with a Prisma config file that contains the appropriate datasource instead.`;case"--from-schema-datamodel":case"--to-schema-datamodel":return`\`${e}\` was removed. Please use \`--[from/to]-schema\` instead.`;case"--from-local-d1":case"--to-local-d1":return`\`${e}\` was removed. Please use \`--[from/to]-config-datasource\` in combination with a Prisma config file that contains the appropriate datasource instead. The \`@prisma/adapter-d1\` package exposes a \`listLocalDatabases()\` helper function to help you locate your local D1 databases. You can use the paths returned from that function to construct your datasource URL(s).`;default:return}}var NRe=W(Ih());var t2=class e{static new(){return new e}static help=ut(`
Reset your database and apply all migrations, all data will be lost
${q("Usage")}
${ae("$")} prisma migrate reset [options]
The datasource URL configuration is read from the Prisma config file (e.g., ${In("prisma.config.ts")}).
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
-f, --force Skip the confirmation prompt
${q("Examples")}
Reset your database and apply all migrations, all data will be lost
${ae("$")} prisma migrate reset
Specify a schema
${ae("$")} prisma migrate reset --schema=./schema.prisma
Use --force to skip the confirmation prompt
${ae("$")} prisma migrate reset --force
`);async parse(r,n,o){let i=bt(r,{"--help":Boolean,"-h":"--help","--force":Boolean,"-f":"--force","--schema":String,"--config":String,"--telemetry-information":String});if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let a=await Vn({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o})}),c="migrate reset",u=ai({config:n,cmd:c}),{migrationsDirPath:l}=Zi(a,n),p=Ta(a.primaryDatasource,u);Da({datasourceInfo:p}),ii({cmd:c,validatedConfig:u});let f=await Lh(o,Xf(a),u);if(f&&process.stdout.write(`
`+f+`
`),process.stdout.write(`
`),!i["--force"]){if(!ld())throw new LD;let v=await(0,NRe.default)({type:"confirm",name:"value",message:`Are you sure you want to reset your database? ${he("All data will be lost")}.`});process.stdout.write(`
`),v.value||(process.stdout.write(`Reset cancelled.
`),process.exit(130))}Yk();let g={externalTables:n.tables?.external??[],externalEnums:n.enums?.external??[]},x=await kn.setup({schemaEngineConfig:n,baseDir:o,migrationsDirPath:l,schemaContext:a,schemaFilter:g,extensions:n.extensions}),b;try{await x.reset();let{appliedMigrationNames:v}=await x.applyMigrations();b=v}finally{await x.stop()}return b.length===0?process.stdout.write(`${me(`Database reset successful
`)}
`):(process.stdout.write(`
`),process.stdout.write(`${me("Database reset successful")}
The following migration(s) have been applied:
${ky("migrations",b,{"migration.sql":""})}
`)),""}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var r2=class e{static new(){return new e}static help=ut(`
Resolve issues with database migrations in deployment databases:
- recover from failed migrations
- baseline databases when starting to use Prisma Migrate on existing databases
- reconcile hotfixes done manually on databases with your migration history
Run "prisma migrate status" to identify if you need to use resolve.
Read more about resolving migration history issues: ${Pt("https://pris.ly/d/migrate-resolve")}
${q("Usage")}
${ae("$")} prisma migrate resolve [options]
The datasource URL configuration is read from the Prisma config file (e.g., ${In("prisma.config.ts")}).
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
--applied Record a specific migration as applied
--rolled-back Record a specific migration as rolled back
${q("Examples")}
Update migrations table, recording a specific migration as applied
${ae("$")} prisma migrate resolve --applied 20201231000000_add_users_table
Update migrations table, recording a specific migration as rolled back
${ae("$")} prisma migrate resolve --rolled-back 20201231000000_add_users_table
Specify a schema
${ae("$")} prisma migrate resolve --rolled-back 20201231000000_add_users_table --schema=./schema.prisma
`);async parse(r,n,o){let i=bt(r,{"--help":Boolean,"-h":"--help","--applied":String,"--rolled-back":String,"--schema":String,"--config":String,"--telemetry-information":String},!1);if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let a=await Vn({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o})}),{migrationsDirPath:c}=Zi(a,n),u="migrate resolve",l=ai({config:n,cmd:u});if(ii({cmd:u,validatedConfig:l}),Da({datasourceInfo:Ta(a.primaryDatasource,l)}),!i["--applied"]&&!i["--rolled-back"])throw new Error(`--applied or --rolled-back must be part of the command like:
${q(me(Xt("prisma migrate resolve --applied 20201231000000_example")))}
${q(me(Xt("prisma migrate resolve --rolled-back 20201231000000_example")))}`);if(i["--applied"]&&i["--rolled-back"])throw new Error("Pass either --applied or --rolled-back, not both.");if(i["--applied"]){if(typeof i["--applied"]!="string"||i["--applied"].length===0)throw new Error(`--applied value must be a string like ${q(me(Xt("prisma migrate resolve --applied 20201231000000_example")))}`);await kD(o,l);let p=await kn.setup({schemaEngineConfig:n,baseDir:o,migrationsDirPath:c,schemaContext:a,extensions:n.extensions});try{await p.markMigrationApplied({migrationId:i["--applied"]})}finally{await p.stop()}return process.stdout.write(`
Migration ${i["--applied"]} marked as applied.
`),""}else{if(typeof i["--rolled-back"]!="string"||i["--rolled-back"].length===0)throw new Error(`--rolled-back value must be a string like ${q(me(Xt("prisma migrate resolve --rolled-back 20201231000000_example")))}`);await kD(o,l);let p=await kn.setup({schemaEngineConfig:n,baseDir:o,migrationsDirPath:c,schemaContext:a,extensions:n.extensions});try{await p.markMigrationRolledBack({migrationId:i["--rolled-back"]})}finally{await p.stop()}return process.stdout.write(`
Migration ${i["--rolled-back"]} marked as rolled back.
`),""}}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var LRe=lt("prisma:migrate:status"),n2=class e{static new(){return new e}static help=ut(`
Check the status of your database migrations
${q("Usage")}
${ae("$")} prisma migrate status [options]
The datasource URL configuration is read from the Prisma config file (e.g., ${In("prisma.config.ts")}).
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
${q("Examples")}
Check the status of your database migrations
${ae("$")} prisma migrate status
Specify a schema
${ae("$")} prisma migrate status --schema=./schema.prisma
`);async parse(r,n,o){let i=bt(r,{"--help":Boolean,"-h":"--help","--schema":String,"--config":String,"--telemetry-information":String},!1);if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let a=await Vn({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o})}),{migrationsDirPath:c}=Zi(a,n),u="migrate status",l=ai({config:n,cmd:u});ii({cmd:u,validatedConfig:l}),Da({datasourceInfo:Ta(a.primaryDatasource,l)});let p={externalTables:n.tables?.external??[],externalEnums:n.enums?.external??[]},f=await kn.setup({schemaEngineConfig:n,baseDir:o,migrationsDirPath:c,schemaContext:a,schemaFilter:p,extensions:n.extensions});await kD(o,l);let g,x;try{g=await f.diagnoseMigrationHistory({optInToShadowDatabase:!1}),LRe({diagnoseResult:JSON.stringify(g,null,2)}),x=await f.listMigrationDirectories(),LRe({listMigrationDirectoriesResult:x})}finally{await f.stop()}if(process.stdout.write(`
`),x.migrations.length>0){let v=x.migrations;process.stdout.write(`${v.length} migration${v.length>1?"s":""} found in prisma/migrations
`)}else process.stdout.write(`No migration found in prisma/migrations
`);let b=[];if(g.history?.diagnostic==="databaseIsBehind"?(b=g.history.unappliedMigrationNames,process.stdout.write(`Following migration${b.length>1?"s":""} have not yet been applied:
${b.join(`
`)}
To apply migrations in development run ${q(me(Xt("prisma migrate dev")))}.
To apply migrations in production run ${q(me(Xt("prisma migrate deploy")))}.
`),process.exit(1)):g.history?.diagnostic==="historiesDiverge"&&(console.error(`Your local migration history and the migrations table from your database are different:
The last common migration is: ${g.history.lastCommonMigrationName}
The migration${g.history.unappliedMigrationNames.length>1?"s":""} have not yet been applied:
${g.history.unappliedMigrationNames.join(`
`)}
The migration${g.history.unpersistedMigrationNames.length>1?"s":""} from the database are not found locally in prisma/migrations:
${g.history.unpersistedMigrationNames.join(`
`)}`),process.exit(1)),g.hasMigrationsTable){if(g.failedMigrationNames.length>0){let v=g.failedMigrationNames;console.error(`Following migration${v.length>1?"s":""} have failed:
${v.join(`
`)}
During development if the failed migration(s) have not been deployed to a production database you can then fix the migration(s) and run ${q(me(Xt("prisma migrate dev")))}.
`),console.error(`The failed migration(s) can be marked as rolled back or applied:
- If you rolled back the migration(s) manually:
${q(me(Xt(`prisma migrate resolve --rolled-back "${v[0]}"`)))}
- If you fixed the database manually (hotfix):
${q(me(Xt(`prisma migrate resolve --applied "${v[0]}"`)))}
Read more about how to resolve migration issues in a production database:
${Pt("https://pris.ly/d/migrate-resolve")}`),process.exit(1)}else if(process.stdout.write(`
`),b.length===0)return"Database schema is up to date!"}else if(x.migrations.length===0)console.error(`The current database is not managed by Prisma Migrate.
Read more about how to baseline an existing production database:
${Pt("https://pris.ly/d/migrate-baseline")}`),process.exit(1);else{let v=x.migrations.shift();console.error(`The current database is not managed by Prisma Migrate.
If you want to keep the current database structure and data and create new migrations, baseline this database with the migration "${v}":
${q(me(Xt(`prisma migrate resolve --applied "${v}"`)))}
Read more about how to baseline an existing production database:
https://pris.ly/d/migrate-baseline`),process.exit(1)}return""}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var LFt=lt("prisma:cli");async function MK(e,r,n){let o,i;try{o=await kn.setup({schemaEngineConfig:r,baseDir:n}),i=await o.engine.getDatabaseVersion(e)}catch(a){LFt(a)}finally{o&&o.engine.isRunning&&await o.stop()}return i}var BRe=["postgresql","cockroachdb","mysql","sqlite"];async function kK(e,r,n,o){if(!jFt(e.generators))throw new Error(`\`typedSql\` preview feature needs to be enabled in ${e.loadedFromPathForLogMessages}`);let i=e.primaryDatasource;if(!i)throw new Error(`Could not find datasource in schema ${e.loadedFromPathForLogMessages}`);if(!BRe.includes(i.activeProvider))throw new Error(`Typed SQL is supported only for ${BRe.join(", ")} providers`);let c=(await kn.setup({schemaContext:e,schemaEngineConfig:r,baseDir:n})).engine,u=[],l=[];try{for(let p of o){let f=await BFt(c,r.datasource.url,p);f.ok?u.push(f.result):l.push(f.error)}}finally{await c.stop()}return l.length>0?{ok:!1,errors:l}:{ok:!0,queries:u}}async function BFt(e,r,n){try{let i=(await e.introspectSql({url:r,queries:[n]})).queries[0];return i?{ok:!0,result:i}:{ok:!1,error:{fileName:n.fileName,message:"Invalid response from schema engine"}}}catch(o){return{ok:!1,error:{fileName:n.fileName,message:String(o)}}}}function jFt(e){return e.some(r=>r?.previewFeatures?.includes("typedSql"))}var jK=require("@prisma/engines");var jRe=W(hE()),qFt=jh(),$y=_i("prisma:cli:checkpoint");async function URe({schemaPathFromConfig:e,baseDir:r}){if(process.env.CHECKPOINT_DISABLE)return $y("runCheckpointClientCheck() is disabled by the CHECKPOINT_DISABLE env var."),0;let n=process.argv.slice(2),o=bt(n,{"--schema":String,"--telemetry-information":String},!1,!0),i=typeof o["--schema"]=="string"?o["--schema"]:void 0;try{let a=performance.now(),c=hr({schemaPathFromArgs:i,schemaPathFromConfig:e,baseDir:r}),[u,{schemaProvider:l,schemaPreviewFeatures:p,schemaGeneratorsProviders:f}]=await Promise.all([OT(c),GFt(c)]),g=FT(),b=performance.now()-a;$y(`runCheckpointClientCheck(): Execution time for getting info: ${b} ms`);let v={product:"prisma",version:qFt.version,cli_path_hash:g,project_hash:u,schema_providers:l?[l]:void 0,schema_preview_features:p,schema_generators_providers:f,cli_install_type:Ry()?"global":"local",command:$K([...n]).join(" "),information:o["--telemetry-information"]||process.env.PRISMA_TELEMETRY_INFORMATION,cli_path:process.argv[1]},S=performance.now(),_=await jRe.check(v),P=performance.now()-S;return $y(`runCheckpointClientCheck(): Execution time for "await checkpoint.check(data)": ${P} ms`),_}catch(a){return $y("Error from runCheckpointClientCheck()"),$y(a),0}}async function GFt(e){let r,n,o;try{let i=await Vn({schemaPath:e,printLoadMessage:!1});i.datasources.length>0&&(r=i.datasources[0].provider),o=i.generators.filter(u=>u&&u.provider).map(u=>To(u.provider));let a=["prisma-client","prisma-client-js"],c=i.generators.filter(u=>{let l=u?.provider?To(u.provider):void 0;return l!==void 0&&a.includes(l)}).flatMap(u=>u.previewFeatures??[]);c.length>0&&(n=Array.from(new Set(c)))}catch(i){$y("Error from tryToReadDataFromSchema() while processing the schema. This is not a fatal error. It will continue without the processed data."),$y(i)}return{schemaProvider:r,schemaPreviewFeatures:n,schemaGeneratorsProviders:o}}var HFt=["--url","--schema","--config","--file","--from-schema","--to-schema","--from-config-datasource","--to-config-datasource","--from-migrations","--to-migrations","--hostname","--name","--applied","--rolled-back","--token"],$K=e=>{let r="[redacted]";for(let n=0;n<e.length;n++){let o=e[n];HFt.forEach(i=>{let a=o===i,c=o.indexOf(i);a?e[n+1]=r:c!==-1&&(e[n]=`${i}=${r}`)})}return e};var WFt=Ry();function GRe(e){let r=process.env.PRISMA_HIDE_UPDATE_MESSAGE;if(!e||e.status!=="ok"||r||!e.data.outdated)return;let n=4,o="",i=e.data.previous_version,a=e.data.current_version,c=qRe(e.data.package,e.data.release_tag),u=qRe("@prisma/client",e.data.release_tag,{canBeGlobal:!1,canBeDev:!1});try{let[f]=i.split("."),[g]=a.split(".");f<g&&(o=`
This is a major update - please follow the guide at
https://pris.ly/d/major-version-upgrade
`,n=n+4)}catch{}let l=`
${Xu("Update available")} ${i} -> ${a}
${o}Run the following to update
${q(c)}
${q(u)}`,p=uD({height:n,width:59,str:l,horizontalPadding:2});console.error(p)}function qRe(e,r,n={canBeGlobal:!0,canBeDev:!0}){let o="";return WFt==="npm"&&n.canBeGlobal?o=`npm i -g ${e}`:n.canBeDev?o=`npm i --save-dev ${e}`:o=`npm i ${e}`,o+=`@${r}`,o}var QRe=require("@prisma/engines");var BK=W(require("os"));var NK=W(require("fs")),YRe=W(require("module"));var JRe=W(require("node:process"),1);var WRe=W(require("node:process"),1),VRe=W(require("node:fs/promises"),1),zRe=require("node:url");var Ny=W(require("node:path"),1),HRe=e=>e instanceof URL?(0,zRe.fileURLToPath)(e):e;async function KRe(e,{cwd:r=WRe.default.cwd(),type:n="file",stopAt:o}={}){let i=Ny.default.resolve(HRe(r)??""),{root:a}=Ny.default.parse(i);o=Ny.default.resolve(i,HRe(o??a));let c=Ny.default.isAbsolute(e);for(;i;){let u=c?e:Ny.default.join(i,e);try{let l=await VRe.default.stat(u);if(n==="file"&&l.isFile()||n==="directory"&&l.isDirectory())return u}catch{}if(i===o||i===a)break;i=Ny.default.dirname(i)}}async function kE({cwd:e=JRe.default.cwd()}={}){return KRe("package.json",{cwd:e})}async function ZRe(e=process.cwd()){return await VFt(e)??await zFt(e)}async function VFt(e=process.cwd()){try{let r=KFt("@prisma/client/package.json",e);if(!r)return null;let n=await NK.default.promises.readFile(r,"utf-8"),o=JSON.parse(n);return o.version?o.version:null}catch{return null}}async function zFt(e=process.cwd()){try{let r=await kE({cwd:e});if(!r)return null;let n=await NK.default.promises.readFile(r,"utf-8"),o=JSON.parse(n),i=o.dependencies?.["@prisma/client"]??o.devDependencies?.["@prisma/client"];return i||null}catch{return null}}function KFt(e,r){try{return require.resolve(e,{paths:YRe.default._nodeModulePaths(r)})}catch{return null}}var LK=jh(),$E=class e{static new(){return new e}static help=ut(`
Print current version of Prisma components
${q("Usage")}
${ae("$")} prisma -v [options]
${ae("$")} prisma version [options]
${q("Options")}
-h, --help Display this help message
--json Output JSON
`);help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}async parse(r,n,o=process.cwd()){let i=bt(r,{"--help":Boolean,"-h":"--help","--version":Boolean,"-v":"--version","--config":String,"--json":Boolean,"--telemetry-information":String});if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let a=await pW("schema-engine"),[c,u]=lW(a),l=[["Schema Engine",c]],p=await ZRe(),f=await NH(),g=[[LK.name,LK.version],["@prisma/client",p??"Not found"],["Operating System",BK.default.platform()],["Architecture",BK.default.arch()],["Node.js",process.version],["TypeScript",f],["Query Compiler","enabled"],["PSL",`@prisma/prisma-schema-wasm ${CM.prismaSchemaWasmVersion}`],...l,["Default Engines Hash",QRe.enginesVersion],["Studio",LK.dependencies["@prisma/studio-core"]]];u.length>0&&(process.exitCode=1,u.forEach(b=>console.error(b)));let x=await this.getFeatureFlags(n.schema,o);return x&&x.length>0&&g.push(["Preview Features",x.join(", ")]),LT(g,{json:i["--json"]})}async getFeatureFlags(r,n){try{let{generators:o}=await Vn({schemaPath:hr({schemaPathFromConfig:r,baseDir:n})}),i=o.find(a=>a.previewFeatures.length>0);if(i)return i.previewFeatures}catch{}return[]}};var f6=class e{constructor(r,n,o){this.cmds=r;this.ensureBinaries=n;this.download=o}static new(r,n,o){return new e(r,n,o)}async parse(r,n,o=process.cwd()){let i=bt(r,{"--help":Boolean,"-h":"--help","--version":Boolean,"-v":"--version","--config":String,"--json":Boolean,"--experimental":Boolean,"--preview-feature":Boolean,"--early-access":Boolean,"--telemetry-information":String});if(Ht(i))return this.help(i.message);if(!i["--version"]&&(i._.length===0||i["--help"]))return this.help();if(i["--version"])return await(0,jK.ensureNeededBinariesExist)({download:this.download}),$E.new().parse(r,n,o);let a=i._[0];if(a==="lift")throw new Error(`${he("prisma lift")} has been renamed to ${me("prisma migrate")}`);let c=this.cmds[a];if(c){let u=URe({schemaPathFromConfig:n.schema,baseDir:o}).catch(()=>{});this.ensureBinaries.includes(a)&&await(0,jK.ensureNeededBinariesExist)({download:this.download});let l;i["--experimental"]?l=[...i._.slice(1),`--experimental=${i["--experimental"]}`]:i["--preview-feature"]?l=[...i._.slice(1),`--preview-feature=${i["--preview-feature"]}`]:i["--early-access"]?l=[...i._.slice(1),`--early-access=${i["--early-access"]}`]:l=i._.slice(1);let p=await c.parse(l,n,o);return GRe(await u),p}return uy(this.help(),i._[0])}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}static tryPdpMessage=`Optimize performance through connection pooling and caching with Prisma Accelerate.
Learn more at ${Pt("https://pris.ly/cli/pdp")}`;static boxedTryPdpMessage=uD({height:this.tryPdpMessage.split(`
`).length,width:0,str:this.tryPdpMessage,horizontalPadding:2});static help=ut(`
${process.platform==="win32"?"":q(me("\u25ED "))}Prisma is a modern DB toolkit to query, migrate and model your database (${Pt("https://prisma.io")})
${q("Usage")}
${ae("$")} prisma [command]
${q("Commands")}
init Set up Prisma for your app
dev Start a local Prisma Postgres server for development
generate Generate artifacts (e.g. Prisma Client)
db Manage your database schema and lifecycle
migrate Migrate your database
studio Browse your data with Prisma Studio
validate Validate your Prisma schema
format Format your Prisma schema
version Displays Prisma version info
debug Displays Prisma debug info
platform Prisma Data Platform commands
mcp Starts an MCP server to use with AI development tools
${q("Flags")}
--preview-feature Run Preview Prisma commands
--help, -h Show additional information about a command
${this.boxedTryPdpMessage}
${q("Examples")}
Set up a new local Prisma Postgres \`prisma dev\`-ready project
${ae("$")} prisma init
Start a local Prisma Postgres server for development
${ae("$")} prisma dev
Generate artifacts (e.g. Prisma Client)
${ae("$")} prisma generate
Browse your data
${ae("$")} prisma studio
Create migrations from your Prisma schema, apply them to the database, generate artifacts (e.g. Prisma Client)
${ae("$")} prisma migrate dev
Pull the schema from an existing database, updating the Prisma schema
${ae("$")} prisma db pull
Push the Prisma schema state to the database
${ae("$")} prisma db push
Validate your Prisma schema
${ae("$")} prisma validate
Format your Prisma schema
${ae("$")} prisma format
Display Prisma version info
${ae("$")} prisma version
Display Prisma debug info
${ae("$")} prisma debug
`)};var d6=class e{static new(){return new e}static help=ut(`
Print information helpful for debugging and bug reports
${q("Usage")}
${ae("$")} prisma debug [options]
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
`);help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}async parse(r,n,o=process.cwd()){let i=bt(r,{"--help":Boolean,"-h":"--help","--schema":String,"--config":String,"--telemetry-information":String});if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let a=(l,p)=>{let f=process.env[l],g=`- ${l}${p?` ${p}`:""}`;return f===void 0?ae(g+":"):q(g+`: \`${f}\``)},c;try{let l=await Qi({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o})});c=Pt(l.schemaPath)}catch(l){c=l.message}let u=Pt(await bT());return`${sn("-- Prisma schema --")}
Path: ${c}
${sn("-- Local cache directory for engines files --")}
Path: ${u}
${sn("-- Environment variables --")}
When not set, the line is dimmed and no value is displayed.
When set, the line is bold and the value is inside the \`\` backticks.
For general debugging
${a("CI")}
${a("DEBUG")}
${a("NODE_ENV")}
${a("RUST_LOG")}
${a("RUST_BACKTRACE")}
${a("NO_COLOR")}
${a("TERM")}
${a("NODE_TLS_REJECT_UNAUTHORIZED")}
${a("NO_PROXY")}
${a("http_proxy")}
${a("HTTP_PROXY")}
${a("https_proxy")}
${a("HTTPS_PROXY")}
For more information about Prisma environment variables:
See ${Pt("https://pris.ly/d/env-vars")}
For hiding messages
${a("PRISMA_DISABLE_WARNINGS")}
${a("PRISMA_HIDE_PREVIEW_FLAG_WARNINGS")}
${a("PRISMA_HIDE_UPDATE_MESSAGE")}
For downloading engines
${a("PRISMA_ENGINES_MIRROR")}
${a("PRISMA_BINARIES_MIRROR","(deprecated)")}
${a("PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING")}
${a("BINARY_DOWNLOAD_VERSION")}
For custom engines
${a("PRISMA_SCHEMA_ENGINE_BINARY")}
${a("PRISMA_MIGRATION_ENGINE_BINARY")}
For Prisma Client
${a("PRISMA_SHOW_ALL_TRACES")}
For Prisma Migrate
${a("PRISMA_SCHEMA_DISABLE_ADVISORY_LOCK")}
For Prisma Studio
${a("BROWSER")}
${sn("-- Terminal is interactive? --")}
${ud()}
${sn("-- CI detected? --")}
${cd()}
`}};var XRe=W(require("node:fs/promises")),eMe=W(require("node:path"));var m6=class e{static new(){return new e}static help=ut(`
Format a Prisma schema.
${q("Usage")}
${ae("$")} prisma format [options]
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
${q("Examples")}
With an existing Prisma schema
${ae("$")} prisma format
Or specify a Prisma schema path
${ae("$")} prisma format --schema=./schema.prisma
`);async parse(r,n,o=process.cwd()){let i=Math.round(performance.now()),a=bt(r,{"--help":Boolean,"-h":"--help","--schema":String,"--config":String,"--telemetry-information":String,"--check":Boolean});if(a instanceof Error)return this.help(a.message);if(a["--help"])return this.help();let{schemaPath:c,schemas:u}=await Qi({schemaPath:hr({schemaPathFromArgs:a["--schema"],schemaPathFromConfig:n.schema,baseDir:o})});Jf(c);let l=await qH({schemas:u});if(gy({schemas:l}),a["--check"]){for(let[g,x]of l){let b=u.find(S=>S[0]===g);if(!b)return new We(`${q(he("!"))} The schema ${sn(g)} is not found in the schema list.`);let[,v]=b;if(v!==x)return new We(`${q(he("!"))} There are unformatted files. Run ${sn("prisma format")} to format them.`)}return"All files are formatted correctly!"}for(let[g,x]of l)await XRe.default.writeFile(g,x);let p=Math.round(performance.now()),f=eMe.default.relative(process.cwd(),c);return`Formatted ${sn(f)} in ${Kf(p-i)} \u{1F680}`}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};var NE=class{_map=new Map;get(r){return this._map.get(r)?.value}set(r,n){this._map.set(r,{value:n})}getOrCreate(r,n){let o=this._map.get(r);if(o)return o.value;let i=n();return this.set(r,i),i}};function ot(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function Ve(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function zo(e,r){let n={};for(let o of e){let i=o[r];n[i]=o}return n}var h6=["TransactionIsolationLevel"],g6=["JsonNullValueInput","NullableJsonNullValueInput","JsonNullValueFilter"];function y6(e){return{models:UK(e.models),enums:UK(e.enums),types:UK(e.types)}}function x6({models:e}){let r={};for(let n of Object.keys(e)){r[n]={fields:[],dbName:e[n].dbName};for(let{name:o,kind:i,type:a,relationName:c,dbName:u}of e[n].fields)r[n].fields.push({name:o,kind:i,type:a,relationName:c,dbName:u})}return{models:r,enums:{},types:{}}}function UK(e){let r={};for(let{name:n,...o}of e)r[n]=o;return r}function b6(e,r){let n={};for(let o of e){let i=r(o);n[i]||(n[i]=o)}return Object.values(n)}var tMe=W(o2());function rMe(e){return{...e,mappings:JFt(e.mappings,e.datamodel)}}function JFt(e,r){return{modelOperations:e.modelOperations.filter(o=>{let i=r.models.find(a=>a.name===o.model);if(!i)throw new Error(`Mapping without model ${o.model}`);return i.fields.some(a=>a.kind!=="object")}).map(o=>({model:o.model,plural:(0,tMe.default)(Ve(o.model)),findUnique:o.findUnique||o.findSingle,findUniqueOrThrow:o.findUniqueOrThrow,findFirst:o.findFirst,findFirstOrThrow:o.findFirstOrThrow,findMany:o.findMany,create:o.createOne||o.createSingle||o.create,createMany:o.createMany,createManyAndReturn:o.createManyAndReturn,delete:o.deleteOne||o.deleteSingle||o.delete,update:o.updateOne||o.updateSingle||o.update,deleteMany:o.deleteMany,updateMany:o.updateMany,updateManyAndReturn:o.updateManyAndReturn,upsert:o.upsertOne||o.upsertSingle||o.upsert,aggregate:o.aggregate,groupBy:o.groupBy,findRaw:o.findRaw,aggregateRaw:o.aggregateRaw})),otherOperations:e.otherOperations}}var rke=require("crypto"),nke=W(v6()),Pa=W(require("fs/promises")),rY=W(yh());var ci=W(require("path"));var BE={name:"@prisma/client",version:"7.5.0",description:"Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.",keywords:["ORM","Prisma","prisma2","Prisma Client","client","query","query-builder","database","db","JavaScript","JS","TypeScript","TS","SQL","SQLite","pg","Postgres","PostgreSQL","CockroachDB","MySQL","MariaDB","MSSQL","SQL Server","SQLServer","MongoDB"],main:"default.js",types:"default.d.ts",browser:"index-browser.js",exports:{"./package.json":"./package.json",".":{require:{types:"./default.d.ts",node:"./default.js","edge-light":"./default.js",workerd:"./default.js",worker:"./default.js",browser:"./index-browser.js"},import:{types:"./default.d.ts",node:"./default.js","edge-light":"./default.js",workerd:"./default.js",worker:"./default.js",browser:"./index-browser.js"},default:"./default.js"},"./extension":{types:"./extension.d.ts",require:"./extension.js",import:"./extension.js",default:"./extension.js"},"./index-browser":{types:"./index.d.ts",require:"./index-browser.js",import:"./index-browser.js",default:"./index-browser.js"},"./index":{types:"./index.d.ts",require:"./index.js",import:"./index.js",default:"./index.js"},"./edge":{types:"./edge.d.ts",require:"./edge.js",import:"./edge.js",default:"./edge.js"},"./runtime/client":{types:"./runtime/client.d.ts",node:{require:"./runtime/client.js",default:"./runtime/client.js"},require:"./runtime/client.js",import:"./runtime/client.mjs",default:"./runtime/client.mjs"},"./runtime/wasm-compiler-edge":{types:"./runtime/wasm-compiler-edge.d.ts",require:"./runtime/wasm-compiler-edge.js",import:"./runtime/wasm-compiler-edge.mjs",default:"./runtime/wasm-compiler-edge.mjs"},"./runtime/index-browser":{types:"./runtime/index-browser.d.ts",require:"./runtime/index-browser.js",import:"./runtime/index-browser.mjs",default:"./runtime/index-browser
${(0,VK.default)(r.values.map(i=>`${i}: ${this.getValueJS(i)}`).join(`,
`),2)}
}`,o=this.isStrictEnum()?`makeStrictEnum(${n})`:n;return this.useNamespace?`exports.Prisma.${r.name} = ${o};`:`exports.${r.name} = exports.$Enums.${r.name} = ${o};`}getValueJS(r){return this.isObjectEnum()?`Prisma.${r}`:`'${r}'`}toTS(){let{type:r}=this;return`export const ${r.name}: {
${(0,VK.default)(r.values.map(n=>`${n}: ${this.getValueTS(n)}`).join(`,
`),2)}
};
export type ${r.name} = (typeof ${r.name})[keyof typeof ${r.name}]
`}getValueTS(r){return this.isObjectEnum()?`typeof ${r}`:`'${r}'`}};function Ly(e){return e.toJS?.()??""}function zK(e){return e.toBrowserJS?.()??""}function By(e){return e.toTS()}Vs();var JK=class extends Dr{constructor(n){super();this.innerType=n}write(n){n.write("[...").write(this.innerType).write("]")}};function w6(e){return new JK(e)}Vs();var YK=class extends Dr{constructor(n){super();this.elementType=n}write(n){this.elementType.writeIndexed(n),n.write("[]")}};function $e(e){return new YK(e)}Vs();var ZK=class extends Dr{needsParenthesisInUnion=!0;needsParenthesisInIntersection=!0;#e;#t;#r;#o;constructor(r,n,o,i){super(),this.#e=r,this.#t=n,this.#r=o,this.#o=i}write(r){r.write(this.#e),r.write(" extends "),r.write(this.#t),r.write(" ? "),r.write(this.#r),r.write(" : "),r.write(this.#o)}},QK=class{check(r){return new XK(r)}},XK=class{#e;constructor(r){this.#e=r}extends(r){return new eJ(this.#e,r)}},eJ=class{#e;#t;constructor(r,n){this.#e=r,this.#t=n}then(r){return new tJ(this.#e,this.#t,r)}},tJ=class{#e;#t;#r;constructor(r,n,o){this.#e=r,this.#t=n,this.#r=o}else(r){return new ZK(this.#e,this.#t,this.#r,r)}};function S6(){return new QK}var rJ=class{constructor(r,n){this.name=r;this.type=n}docComment;value;setDocComment(r){return this.docComment=r,this}setValue(r){return this.value=r,this}write(r){this.docComment&&r.write(this.docComment),r.write("const ").write(this.name),this.type&&r.write(": ").write(this.type),this.value&&r.write(" = ").write(this.value)}};function lu(e,r){return new rJ(e,r)}var _6=class{lines=[];constructor(r){r&&this.addText(r)}addText(r){return this.lines.push(...r.split(`
`)),this}write(r){r.writeLine("/**");for(let n of this.lines)r.writeLine(` * ${n}`);return r.writeLine(" */"),r}};function qe(e,...r){return typeof e=="string"||typeof e>"u"?new _6(e):tIt(e,r)}function tIt(e,r){let n=new _6,o=e.flatMap((c,u)=>u<r.length?[c,r[u]]:[c]).join(""),i=rIt(o.split(`
`));if(i.length===0)return n;let a=iIt(i[0]);for(let c of i)n.addText(c.slice(a));return n}function rIt(e){let r=nIt(e),n=oIt(e);return r===-1||n===-1?[]:e.slice(r,n+1)}function nIt(e){return e.findIndex(r=>!aMe(r))}function oIt(e){let r=e.length-1;for(;r>0&&aMe(e[r]);)r--;return r}function aMe(e){return e.trim().length===0}function iIt(e){let r=0;for(;e[r]===" ";)r++;return r}var nJ=class{constructor(r){this.declaration=r}docComment;setDocComment(r){return this.docComment=r,this}write(r){this.docComment&&r.write(this.docComment),r.write("export ").write(this.declaration)}};function it(e){return new nJ(e)}var oJ=class{constructor(r,n){this.from=r;this.namespace=n}write(r){r.write(`export * as ${this.namespace} from '${this.from}'`)}},iJ=class{constructor(r){this.from=r}namedExports=[];named(r){return typeof r=="string"&&(r=new T6(r)),this.namedExports.push(r),this}write(r){r.write("export ").write("{ ").writeJoined(", ",this.namedExports).write(" }").write(` from "${this.from}"`)}},T6=class{constructor(r){this.name=r}alias;type=!1;as(r){return this.alias=r,this}typeOnly(){return this.type=!0,this}write(r){this.type&&r.write("type "),r.write(this.name),this.alias&&r.write(" as ").write(this.alias)}},sJ=class{constructor(r){this.from=r}asNamespace(r){return new oJ(this.from,r)}named(r){return new iJ(this.from).named(r)}write(r){r.write(`export * from "${this.from}"`)}};function bl(e){return new sJ(e)}function cMe(e){return new T6(e)}var aJ=class{imports=[];declarations=[];addImport(r){return this.imports.push(r),this}add(r){this.declarations.push(r)}write(r){for(let n of this.imports)r.writeLine(n);this.imports.length>0&&r.newLine();for(let[n,o]of this.declarations.entries())r.writeLine(o),n<this.declarations.length-1&&r.newLine()}};function pu(){return new aJ}var yd=class{as(r){return new cJ(this,r)}},cJ=class extends yd{#e;#t;constructor(r,n){super(),this.#e=r,this.#t=n}write(r){r.write(this.#e).write(" as ").write(this.#t)}};var uJ=class extends yd{#e;#t;constructor(r,n){super(),this.#e=r,this.#t=n}addArgument(r){return this.#t.push(r),this}write(r){r.write(this.#e).write("(").writeJoined(", ",this.#t).write(")")}};function D6(e,r=[]){return new uJ(e,r)}Vs();var yc=class extends Dr{constructor(n){super();this.name=n}write(n){n.write(this.name)}},Yn=new yc("string"),ur=new yc("number"),jp=new yc("boolean"),Rt=new yc("null"),jE=new yc("undefined"),qh=new yc("bigint"),Gh=new yc("unknown"),Up=new yc("any"),C6=new yc("void"),UPr=new yc("this"),Co=new yc("never");Vs();var lJ=class extends Dr{needsParenthesisWhenIndexed=!0;needsParenthesisInKeyof=!0;needsParenthesisInUnion=!0;needsParenthesisInIntersection=!0;returnType=C6;parameters=[];genericParameters=[];setReturnType(r){return this.returnType=r,this}addParameter(r){return this.parameters.push(r),this}addGenericParameter(r){return this.genericParameters.push(r),this}write(r){this.genericParameters.length>0&&r.write("<").writeJoined(", ",this.genericParameters).write(">"),r.write("(").writeJoined(", ",this.parameters).write(") => ").write(this.returnType)}};function Ca(){return new lJ}Vs();var xc=class extends Dr{constructor(n){super();this.name=n}genericArguments=[];addGenericArgument(n){return this.genericArguments.push(n),this}write(n){n.write(this.name),this.genericArguments.length>0&&n.write("<").writeJoined(", ",this.genericArguments).write(">")}};function V(e){return new xc(e)}var pJ=class{constructor(r){this.name=r}extendedType;defaultType;extends(r){return this.extendedType=r,this}default(r){return this.defaultType=r,this}toArgument(){return new xc(this.name)}write(r){r.write(this.name),this.extendedType&&r.write(" extends ").write(this.extendedType),this.defaultType&&r.write(" = ").write(this.defaultType)}};function er(e){return new pJ(e)}function A6(e,r){return V("Omit").addGenericArgument(e).addGenericArgument(r)}var fJ=class{constructor(r,n){this.alias=r;this.from=n}type=!1;typeOnly(){return this.type=!0,this}write(r){r.write("import "),this.type&&r.write("type "),r.write("* as ").write(this.alias).write(` from "${this.from}"`)}},P6=class{constructor(r){this.fr
`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let r=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+r.slice(1):r}};function xe(e,{indentLevel:r=0,newLine:n="none"}={}){let o=new Gp(r,void 0).write(e).toString();switch(n){case"none":return o;case"leading":return`
`+o;case"trailing":return o+`
`;case"both":return`
`+o+`
`;default:Hs(n,"Unexpected value")}}Vs();var EJ=class extends Dr{constructor(n){super();this.content=n}write(n){n.write(JSON.stringify(this.content))}asValue(){return new wJ(this)}},wJ=class extends yd{#e;constructor(r){super(),this.#e=r}write(r){r.write(this.#e)}};function Mt(e){return new EJ(e)}Vs();var R6=class{constructor(r){this.type=r}name;setName(r){return this.name=r,this}write(r){this.name&&r.write(this.name).write(": "),r.write(this.type)}},SJ=class extends Dr{items=[];add(r){return r instanceof Dr&&(r=new R6(r)),this.items.push(r),this}write(r){r.write("[").writeJoined(", ",this.items).write("]")}};function M6(){return new SJ}function k6(e){return new R6(e)}Vs();var _J=class{constructor(r,n){this.name=r;this.type=n}genericParameters=[];docComment;addGenericParameter(r){return this.genericParameters.push(r),this}setName(r){return this.name=r,this}setDocComment(r){return this.docComment=r,this}write(r){this.docComment&&r.write(this.docComment),r.write("type ").write(this.name),this.genericParameters.length>0&&r.write("<").writeJoined(", ",this.genericParameters).write(">"),r.write(" = ").write(this.type)}};function jt(e,r){return new _J(e,r)}Vs();var Hp=class extends Dr{needsParenthesisWhenIndexed=!0;needsParenthesisInKeyof=!0;needsParenthesisInIntersection=!0;variants;constructor(r){super(),this.variants=[r]}addVariant(r){return this.variants.push(r),this}addVariants(r){for(let n of r)this.addVariant(n);return this}write(r){r.writeJoined(" | ",this.variants,(n,o)=>{n.needsParenthesisInUnion?o.write("(").write(n).write(")"):o.write(n)})}mapVariants(r){return Oe(this.variants.map(n=>r(n)))}};function Oe(e){if(Array.isArray(e)){if(e.length===0)throw new TypeError("Union types array can not be empty");let r=new Hp(e[0]);for(let n=1;n<e.length;n++)r.addVariant(e[n]);return r}return new Hp(e)}var TJ=class{constructor(r){this.name=r}write(r){r.write("Symbol.").write(this.name)}};function sIt(e){return new TJ(e)}var $6=sIt("toStringTag");var EMe=W(ys());function i2(e){return{name:e.name,values:e.values.map(r=>r.name)}}var xd=(C=>(C.findUnique="findUnique",C.findUniqueOrThrow="findUniqueOrThrow",C.findFirst="findFirst",C.findFirstOrThrow="findFirstOrThrow",C.findMany="findMany",C.create="create",C.createMany="createMany",C.createManyAndReturn="createManyAndReturn",C.update="update",C.updateMany="updateMany",C.updateManyAndReturn="updateManyAndReturn",C.upsert="upsert",C.delete="delete",C.deleteMany="deleteMany",C.groupBy="groupBy",C.count="count",C.aggregate="aggregate",C.findRaw="findRaw",C.aggregateRaw="aggregateRaw",C))(xd||{});function Uy(e){return`${e}Select`}function DJ(e){return`${e}SelectCreateManyAndReturn`}function CJ(e){return`${e}SelectUpdateManyAndReturn`}function L6(e){return`${e}Include`}function AJ(e){return`${e}IncludeCreateManyAndReturn`}function PJ(e){return`${e}IncludeUpdateManyAndReturn`}function lMe(e){return`CreateMany${e}AndReturnOutputType`}function pMe(e){return`UpdateMany${e}AndReturnOutputType`}function qE(e){return`${e}Omit`}function GE(e){return`Aggregate${ot(e)}`}function B6(e){return`${ot(e)}GroupByOutputType`}function fMe(e){return`${ot(e)}AvgAggregateOutputType`}function dMe(e){return`${ot(e)}SumAggregateOutputType`}function mMe(e){return`${ot(e)}MinAggregateOutputType`}function hMe(e){return`${ot(e)}MaxAggregateOutputType`}function OJ(e){return`${ot(e)}CountAggregateInputType`}function s2(e){return`${ot(e)}CountAggregateOutputType`}function j6(e){return e.replace(/OutputType$/,"InputType")}function HE(e){return`${e}GroupByArgs`}function FJ(e){return`Get${ot(e)}GroupByPayload`}function qy(e){return`${ot(e)}AggregateArgs`}function U6(e){return`Get${ot(e)}AggregateType`}function WE(e,r){return e.args.length?IJ(e,r):Ir(e.outputType.type)}function IJ(e,r){return`${r}$${e.name}Args`}function Ir(e,r){if(!r)return`${e}DefaultArgs`;switch(r){case"findMany":return`${e}FindManyArgs`;case"findUnique":return`${e}FindUniqueArgs`;case"findUniqueOrThrow":return`${e}FindUniqueOrThrowArgs`;case"findFirst":return`${e}FindFirstArgs`;case"findFirstOrThrow":return`${e}FindFirstOrThrowArgs`;case"upsert":ret
${(0,EMe.default)(o.map(a=>new Gy(a,this.context,n).toTS()).join(`
`),2)}
}`;return`
export type ${this.getTypeName()} = ${cIt(i,r)}`}overrideName(r){return this.generatedName=r,this}getTypeName(){return this.context.genericArgsInfo.typeNeedsGenericModelArg(this.type)?`${this.generatedName}<$PrismaModel = never>`:this.generatedName}};function cIt(e,r){if(r.constraints?.fields&&r.constraints.fields.length>0){let n=r.constraints.fields.map(o=>`"${o}"`).join(" | ");return`Prisma.AtLeast<${e}, ${n}>`}return e}var Hy=W(ys());function du(e){if(typeof e!="object")return e;var r,n,o=Object.prototype.toString.call(e);if(o==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){n=new e.constructor;for(r in e)e.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=du(e[r]))}else{n={};for(r in e)r==="__proto__"?Object.defineProperty(n,r,{value:du(e[r]),configurable:!0,enumerable:!0,writable:!0}):n[r]=du(e[r])}return n}if(o==="[object Array]"){for(r=e.length,n=Array(r);r--;)n[r]=du(e[r]);return n}return o==="[object Set]"?(n=new Set,e.forEach(function(i){n.add(du(i))}),n):o==="[object Map]"?(n=new Map,e.forEach(function(i,a){n.set(du(a),du(i))}),n):o==="[object Date]"?new Date(+e):o==="[object RegExp]"?(n=new RegExp(e.source,e.flags),n.lastIndex=e.lastIndex,n):o==="[object DataView]"?new e.constructor(du(e.buffer)):o==="[object ArrayBuffer]"?e.slice(0):o.slice(-6)==="Array]"?new e.constructor(e):e}var wMe=W(o2());var uIt={cursor:"{@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}",pagination:"{@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}",aggregations:"{@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}",distinct:"{@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}",sorting:"{@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}"};function bc(e,r){return`${uIt[r]}
${e}`}function a2(e,r){return`@deprecated since ${e} please use \`${r}\``}var vd="Note, that providing `undefined` is treated as the value not being there.\nRead more here: https://pris.ly/d/null-undefined",$n={take:(e,r)=>bc(`Take \`\xB1n\` ${r} from the position of the cursor.`,"pagination"),skip:(e,r)=>bc(`Skip the first \`n\` ${r}.`,"pagination"),_count:(e,r)=>bc(`Count returned ${r}`,"aggregations"),_avg:()=>bc("Select which fields to average","aggregations"),_sum:()=>bc("Select which fields to sum","aggregations"),_min:()=>bc("Select which fields to find the minimum value","aggregations"),_max:()=>bc("Select which fields to find the maximum value","aggregations"),count:()=>a2("2.23.0","_count"),avg:()=>a2("2.23.0","_avg"),sum:()=>a2("2.23.0","_sum"),min:()=>a2("2.23.0","_min"),max:()=>a2("2.23.0","_max"),distinct:(e,r)=>bc(`Filter by unique combinations of ${r}.`,"distinct"),orderBy:(e,r)=>bc(`Determine the order of ${r} to fetch.`,"sorting")},c2={groupBy:{body:e=>`Group by ${e.singular}.
${vd}
@param {${HE(e.model.name)}} args - Group by arguments.
@example
// Group by city, order by createdAt, get count
const result = await prisma.user.groupBy({
by: ['city', 'createdAt'],
orderBy: {
createdAt: true
},
_count: {
_all: true
},
})
`,fields:{}},create:{body:e=>`Create a ${e.singular}.
@param {${Ir(e.model.name,e.action)}} args - Arguments to create a ${e.singular}.
@example
// Create one ${e.singular}
const ${e.singular} = await ${e.method}({
data: {
// ... data to create a ${e.singular}
}
})
`,fields:{data:e=>`The data needed to create a ${e}.`}},createMany:{body:e=>`Create many ${e.plural}.
@param {${Ir(e.model.name,e.action)}} args - Arguments to create many ${e.plural}.
@example
// Create many ${e.plural}
const ${Ve(e.mapping.model)} = await ${e.method}({
data: [
// ... provide data here
]
})
`,fields:{data:(e,r)=>`The data used to create many ${r}.`}},createManyAndReturn:{body:e=>{let r=e.firstScalar?`
// Create many ${e.plural} and only return the \`${e.firstScalar.name}\`
const ${Ve(e.mapping.model)}With${ot(e.firstScalar.name)}Only = await ${e.method}({
select: { ${e.firstScalar.name}: true },
data: [
// ... provide data here
]
})`:"";return`Create many ${e.plural} and returns the data saved in the database.
@param {${Ir(e.model.name,e.action)}} args - Arguments to create many ${e.plural}.
@example
// Create many ${e.plural}
const ${Ve(e.mapping.model)} = await ${e.method}({
data: [
// ... provide data here
]
})
${r}
${vd}
`},fields:{data:(e,r)=>`The data used to create many ${r}.`}},findUnique:{body:e=>`Find zero or one ${e.singular} that matches the filter.
@param {${Ir(e.model.name,e.action)}} args - Arguments to find a ${e.singular}
@example
// Get one ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
}
})`,fields:{where:e=>`Filter, which ${e} to fetch.`}},findUniqueOrThrow:{body:e=>`Find one ${e.singular} that matches the filter or throw an error with \`error.code='P2025'\`
if no matches were found.
@param {${Ir(e.model.name,e.action)}} args - Arguments to find a ${e.singular}
@example
// Get one ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
}
})`,fields:{where:e=>`Filter, which ${e} to fetch.`}},findFirst:{body:e=>`Find the first ${e.singular} that matches the filter.
${vd}
@param {${Ir(e.model.name,e.action)}} args - Arguments to find a ${e.singular}
@example
// Get one ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
}
})`,fields:{where:e=>`Filter, which ${e} to fetch.`,orderBy:$n.orderBy,cursor:(e,r)=>bc(`Sets the position for searching for ${r}.`,"cursor"),take:$n.take,skip:$n.skip,distinct:$n.distinct}},findFirstOrThrow:{body:e=>`Find the first ${e.singular} that matches the filter or
throw \`PrismaKnownClientError\` with \`P2025\` code if no matches were found.
${vd}
@param {${Ir(e.model.name,e.action)}} args - Arguments to find a ${e.singular}
@example
// Get one ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
}
})`,fields:{where:e=>`Filter, which ${e} to fetch.`,orderBy:$n.orderBy,cursor:(e,r)=>bc(`Sets the position for searching for ${r}.`,"cursor"),take:$n.take,skip:$n.skip,distinct:$n.distinct}},findMany:{body:e=>{let r=e.firstScalar?`
// Only select the \`${e.firstScalar.name}\`
const ${Ve(e.mapping.model)}With${ot(e.firstScalar.name)}Only = await ${e.method}({ select: { ${e.firstScalar.name}: true } })`:"";return`Find zero or more ${e.plural} that matches the filter.
${vd}
@param {${Ir(e.model.name,e.action)}} args - Arguments to filter and select certain fields only.
@example
// Get all ${e.plural}
const ${e.mapping.plural} = await ${e.method}()
// Get first 10 ${e.plural}
const ${e.mapping.plural} = await ${e.method}({ take: 10 })
${r}
`},fields:{where:(e,r)=>`Filter, which ${r} to fetch.`,orderBy:$n.orderBy,skip:$n.skip,cursor:(e,r)=>bc(`Sets the position for listing ${r}.`,"cursor"),take:$n.take,distinct:$n.distinct}},update:{body:e=>`Update one ${e.singular}.
@param {${Ir(e.model.name,e.action)}} args - Arguments to update one ${e.singular}.
@example
// Update one ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
},
data: {
// ... provide data here
}
})
`,fields:{data:e=>`The data needed to update a ${e}.`,where:e=>`Choose, which ${e} to update.`}},upsert:{body:e=>`Create or update one ${e.singular}.
@param {${Ir(e.model.name,e.action)}} args - Arguments to update or create a ${e.singular}.
@example
// Update or create a ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
create: {
// ... data to create a ${e.singular}
},
update: {
// ... in case it already exists, update
},
where: {
// ... the filter for the ${e.singular} we want to update
}
})`,fields:{where:e=>`The filter to search for the ${e} to update in case it exists.`,create:e=>`In case the ${e} found by the \`where\` argument doesn't exist, create a new ${e} with this data.`,update:e=>`In case the ${e} was found with the provided \`where\` argument, update it with this data.`}},delete:{body:e=>`Delete a ${e.singular}.
@param {${Ir(e.model.name,e.action)}} args - Arguments to delete one ${e.singular}.
@example
// Delete one ${e.singular}
const ${e.singular} = await ${e.method}({
where: {
// ... filter to delete one ${e.singular}
}
})
`,fields:{where:e=>`Filter which ${e} to delete.`}},aggregate:{body:e=>`Allows you to perform aggregations operations on a ${e.singular}.
${vd}
@param {${Ir(e.model.name,e.action)}} args - Select which aggregations you would like to apply and on what fields.
@example
// Ordered by age ascending
// Where email contains prisma.io
// Limited to the 10 users
const aggregations = await prisma.user.aggregate({
_avg: {
age: true,
},
where: {
email: {
contains: "prisma.io",
},
},
orderBy: {
age: "asc",
},
take: 10,
})`,fields:{where:e=>`Filter which ${e} to aggregate.`,orderBy:$n.orderBy,cursor:()=>bc("Sets the start position","cursor"),take:$n.take,skip:$n.skip,_count:$n._count,_avg:$n._avg,_sum:$n._sum,_min:$n._min,_max:$n._max,count:$n.count,avg:$n.avg,sum:$n.sum,min:$n.min,max:$n.max}},count:{body:e=>`Count the number of ${e.plural}.
${vd}
@param {${Ir(e.model.name,e.action)}} args - Arguments to filter ${e.plural} to count.
@example
// Count the number of ${e.plural}
const count = await ${e.method}({
where: {
// ... the filter for the ${e.plural} we want to count
}
})`,fields:{}},updateMany:{body:e=>`Update zero or more ${e.plural}.
${vd}
@param {${Ir(e.model.name,e.action)}} args - Arguments to update one or more rows.
@example
// Update many ${e.plural}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
},
data: {
// ... provide data here
}
})
`,fields:{data:(e,r)=>`The data used to update ${r}.`,where:(e,r)=>`Filter which ${r} to update`,limit:(e,r)=>`Limit how many ${r} to update.`}},updateManyAndReturn:{body:e=>{let r=e.firstScalar?`
// Update zero or more ${e.plural} and only return the \`${e.firstScalar.name}\`
const ${Ve(e.mapping.model)}With${ot(e.firstScalar.name)}Only = await ${e.method}({
select: { ${e.firstScalar.name}: true },
where: {
// ... provide filter here
},
data: [
// ... provide data here
]
})`:"";return`Update zero or more ${e.plural} and returns the data updated in the database.
@param {${Ir(e.model.name,e.action)}} args - Arguments to update many ${e.plural}.
@example
// Update many ${e.plural}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
},
data: [
// ... provide data here
]
})
${r}
${vd}
`},fields:{data:(e,r)=>`The data used to update ${r}.`,where:(e,r)=>`Filter which ${r} to update`,limit:(e,r)=>`Limit how many ${r} to update.`}},deleteMany:{body:e=>`Delete zero or more ${e.plural}.
@param {${Ir(e.model.name,e.action)}} args - Arguments to filter ${e.plural} to delete.
@example
// Delete a few ${e.plural}
const { count } = await ${e.method}({
where: {
// ... provide filter here
}
})
`,fields:{where:(e,r)=>`Filter which ${r} to delete`,limit:(e,r)=>`Limit how many ${r} to delete.`}},aggregateRaw:{body:e=>`Perform aggregation operations on a ${e.singular}.
@param {${Ir(e.model.name,e.action)}} args - Select which aggregations you would like to apply.
@example
const ${Ve(e.mapping.model)} = await ${e.method}({
pipeline: [
{ $match: { status: "registered" } },
{ $group: { _id: "$country", total: { $sum: 1 } } }
]
})`,fields:{pipeline:()=>"An array of aggregation stages to process and transform the document stream via the aggregation pipeline. ${@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline MongoDB Docs}.",options:()=>"Additional options to pass to the `aggregate` command ${@link https://docs.mongodb.com/manual/reference/command/aggregate/#command-fields MongoDB Docs}."}},findRaw:{body:e=>`Find zero or more ${e.plural} that matches the filter.
@param {${Ir(e.model.name,e.action)}} args - Select which filters you would like to apply.
@example
const ${Ve(e.mapping.model)} = await ${e.method}({
filter: { age: { $gt: 25 } }
})`,fields:{filter:()=>"The query predicate filter. If unspecified, then all documents in the collection will match the predicate. ${@link https://docs.mongodb.com/manual/reference/operator/query MongoDB Docs}.",options:()=>"Additional options to pass to the `find` command ${@link https://docs.mongodb.com/manual/reference/command/find/#command-fields MongoDB Docs}."}}};function MJ(e,r,n){let o={singular:ot(r.model),plural:ot(r.plural),firstScalar:n.fields.find(a=>a.kind==="scalar"),method:`prisma.${Ve(r.model)}.${e}`,action:e,mapping:r,model:n},i=c2[e]?.body(o);return i||""}function H6(e,r,n){return kJ(MJ(e,r,n))}function kJ(e){return`/**
${e.split(`
`).map(r=>" * "+r).join(`
`)}
**/`}function KE(e,r,n){if(!n||!r||!e)return;let o=typeof n=="string"?n:n.name;if(c2[r]&&c2[r]?.fields[o]){let i=e.name,a=(0,wMe.default)(e.name);return c2[r]?.fields[o](i,a)}}function SMe(e){return e.replace(/\\n/g,"\\\\n").replace(/\\r/g,"\\\\r").replace(/\\t/g,"\\\\t")}var mu=class{constructor(r,n,o){this.type=r;this.context=n;this.action=o;this.moduleExport=it(jt(Ir(r.name,o),Me()).addGenericParameter(Ao)).setDocComment(qe(`${r.name} ${o??"without action"}`))}moduleExport;hasDefaultName=!0;addProperty(r){this.moduleExport.declaration.type.add(r)}addSchemaArgs(r){for(let n of r){let o=RJ(n,this.context),i=KE(this.type,this.action,n);i&&o.setDocComment(qe(i)),this.addProperty(o)}return this}addSelectArg(r=Uy(this.type.name)){return this.addProperty(de("select",Oe([V(r).addGenericArgument(Ao.toArgument()),Rt])).optional().setDocComment(qe(`Select specific fields to fetch from the ${this.type.name}`))),this}addIncludeArgIfHasRelations(r=L6(this.type.name),n=this.type){return n.fields.some(i=>i.outputType.location==="outputObjectTypes")?(this.addProperty(de("include",Oe([V(r).addGenericArgument(Ao.toArgument()),Rt])).optional().setDocComment(qe("Choose, which related nodes to fetch as well"))),this):this}addOmitArg(){return this.addProperty(de("omit",Oe([V(qE(this.type.name)).addGenericArgument(Ao.toArgument()),Rt])).optional().setDocComment(qe(`Omit specific fields from the ${this.type.name}`))),this}setGeneratedName(r){return this.hasDefaultName=!1,this.moduleExport.declaration.setName(r),this}setComment(r){return this.moduleExport.setDocComment(qe(r)),this}createExport(){return this.moduleExport}};var W6=class{constructor(r){this.outputType=r}toTS(){let{name:r}=this.outputType;return`
/**
* Fields of the ${r} model
*/
interface ${VE(r)} {
${this.stringifyFields()}
}
`}stringifyFields(){let{name:r}=this.outputType;return this.outputType.fields.filter(n=>n.outputType.location!=="outputObjectTypes").map(n=>{let o=n.outputType,i=q6(o);return` readonly ${n.name}: FieldRef<"${r}", ${i}>`}).join(`
`)}};function V6(e,r){let n=FD(zE,e.type)?zE[e.type]:e.type;Array.isArray(n)&&(n=n[0]),gMe(e)&&(n=`Prisma.${n}`);let o;if(e.kind==="object"){let a=V(fu(e.type));r.isComposite(e.type)||a.addGenericArgument(V("ExtArgs")),o=a}else e.kind==="enum"?o=V(`$Enums.${n}`):o=V(n);e.isList?o=$e(o):e.isRequired||(o=Oe(o).addVariant(Rt));let i=de(e.name,o);return e.documentation&&i.setDocComment(qe(e.documentation)),i}function u2(e){return it(jt(e.name,Me().addMultiple(e.fields.map(lIt))))}function lIt(e){let r;if(e.outputType.location==="enumTypes"&&e.outputType.namespace==="model")r=V(pIt(e.outputType));else{let o=zE[e.outputType.type]??e.outputType.type;r=Array.isArray(o)?V(o[0]):V(o)}e.outputType.isList?r=$e(r):e.isNullable&&(r=Oe(r).addVariant(Rt));let n=de(e.name,r);return e.deprecation&&n.setDocComment(qe(`@deprecated since ${e.deprecation.sinceVersion} because ${e.deprecation.reason}`)),n}function pIt(e){let r=e.type;return`${e.namespace==="model"?"$Enums":"Prisma"}.${r}`}function _Me(e,r){let n=r.dmmf.isComposite(e.name),o=Me(),i=Me(),a=Me();for(let l of e.fields)l.kind==="object"?r.dmmf.isComposite(l.type)?a.add(V6(l,r.dmmf)):o.add(V6(l,r.dmmf)):(l.kind==="enum"||l.kind==="scalar")&&i.add(V6(l,r.dmmf));let c=n?i:V("$Extensions.GetPayloadResult").addGenericArgument(i).addGenericArgument(V("ExtArgs").subKey("result").subKey(Ve(e.name))),u=jt(fu(e.name,!1),Me().add(de("name",Mt(e.name))).add(de("objects",o)).add(de("scalars",c)).add(de("composites",a)));return n||u.addGenericParameter(Ao),it(u)}function z6({modelName:e,typeName:r=L6(e),context:n,fields:o}){let i=$J(e,fIt(o,n.dmmf),n);return NJ(r,i)}function TMe({modelName:e,fields:r,context:n}){let o=Oe(r.filter(a=>a.outputType.location==="scalar"||a.outputType.location==="enumTypes"||n.dmmf.isComposite(a.outputType.type)).map(a=>Mt(a.name))),i=V("$Extensions.GetOmit").addGenericArgument(o).addGenericArgument(DMe(e));return n.isPreviewFeatureOn("strictUndefinedChecks")&&i.addGenericArgument(V("$Types.Skip")),NJ(qE(e),i)}function K6({modelName:e,typeName:r=Uy(e),fields:n,context:o}){let i=$J(e,n,o),a=V("$Extensions.GetSelect").addGenericArgument(i).addGenericArgument(DMe(e));return NJ(r,a)}function DMe(e){return Ao.toArgument().subKey("result").subKey(Ve(e))}function CMe({modelName:e,fields:r,context:n}){let o=$J(e,r.filter(i=>i.outputType.location==="scalar"||i.outputType.location==="enumTypes"),n);return it(jt(`${Uy(e)}Scalar`,o))}function $J(e,r,n){let o=Me();for(let i of r){let a=Oe(jp);if(i.outputType.location==="outputObjectTypes"){let c=V(WE(i,e));c.addGenericArgument(Ao.toArgument()),a.addVariant(c)}o.add(de(i.name,G6(n,a)).optional())}return o}function NJ(e,r){let n=jt(e,r);return it(n.addGenericParameter(Ao))}function fIt(e,r){return e.filter(n=>n.outputType.location!=="outputObjectTypes"?!1:!r.isComposite(n.outputType.type))}function J6(e,r){let n=e.mappingsMap[r]??{model:r,plural:`${r}s`},o=Object.keys(n).filter(i=>i!=="model"&&i!=="plural"&&n[i]);return"aggregate"in n&&o.push("count"),o}function Ed(e){return new xc("$Utils.JsPromise").addGenericArgument(e)}function wd(e){return new xc("Prisma.PrismaPromise").addGenericArgument(e)}function Y6(e){return new xc("$Utils.Optional").addGenericArgument(e)}var Q6=class{constructor(r,n){this.model=r;this.context=n;this.dmmf=n.dmmf,this.type=this.context.dmmf.outputTypeMap.model[r.name],this.createManyAndReturnType=this.context.dmmf.outputTypeMap.model[lMe(r.name)],this.updateManyAndReturnType=this.context.dmmf.outputTypeMap.model[pMe(r.name)],this.mapping=this.context.dmmf.mappings.modelOperations.find(o=>o.model===r.name)}type;createManyAndReturnType;updateManyAndReturnType;mapping;dmmf;get argsTypes(){let r=[];for(let n of Object.keys(xd)){let o=this.rootFieldNameForAction(n);if(!o)continue;let i=this.dmmf.rootFieldMap[o];if(!i)throw new Error(`Oops this must not happen. Could not find field ${o} on either Query or Mutation`);if(n==="updateMany"||n==="deleteMany"||n==="createMany"||n==="findRaw"||n==="aggregateRaw")r.push(new mu(this.type,this.context,n).addSchemaArgs(i.args).createExport());else if(n==="createManyAndRetu
export type ${a}<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
${(0,Hy.default)(i.args.map(c=>{let u={...c,comment:KE(this.type,"groupBy",c)};return new Gy(u,this.context).toTS()}).concat(o.fields.filter(c=>c.outputType.location==="outputObjectTypes").map(c=>c.outputType.location==="outputObjectTypes"?`${c.name}?: ${j6(c.outputType.type)}${c.name==="_count"?" | true":""}`:"")).join(`
`),2)}
}
${xe(u2(o))}
type ${FJ(r.name)}<T extends ${a}> = Prisma.PrismaPromise<
Array<
PickEnumerable<${o.name}, T['by']> &
{
[P in ((keyof T) & (keyof ${o.name}))]: P extends '_count'
? T[P] extends boolean
? number
: GetScalarType<T[P], ${o.name}[P]>
: GetScalarType<T[P], ${o.name}[P]>
}
>
>
`}getAggregationTypes(){let{model:r,mapping:n}=this,o=this.dmmf.outputTypeMap.prisma[GE(r.name)];if(!o)throw new Error(`Could not get aggregate type "${GE(r.name)}" for "${r.name}"`);o=du(o);let i=this.dmmf.rootFieldMap[n.aggregate];if(!i)throw new Error(`Could not find aggregate root field for model ${r.name}. Mapping: ${n?.aggregate}`);let a=[o],c=this.dmmf.outputTypeMap.prisma[fMe(r.name)],u=this.dmmf.outputTypeMap.prisma[dMe(r.name)],l=this.dmmf.outputTypeMap.prisma[mMe(r.name)],p=this.dmmf.outputTypeMap.prisma[hMe(r.name)],f=this.dmmf.outputTypeMap.prisma[s2(r.name)];c&&a.push(c),u&&a.push(u),l&&a.push(l),p&&a.push(p),f&&a.push(f);let g=qy(r.name),x=GE(r.name);return`${a.map(u2).map(b=>xe(b)).join(`
`)}
${a.length>1?a.slice(1).map(b=>{let v={name:j6(b.name),constraints:{maxNumFields:null,minNumFields:null},fields:b.fields.map(S=>({...S,name:S.name,isNullable:!1,isRequired:!1,isParameterizable:!1,inputTypes:[{isList:!1,location:"scalar",type:"true"}]}))};return new bd(v,this.context).toTS()}).join(`
`):""}
export type ${g}<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
${(0,Hy.default)(i.args.map(b=>{let v={...b,comment:KE(this.type,"aggregate",b)};return new Gy(v,this.context).toTS()}).concat(o.fields.map(b=>{let v="",S=KE(this.type,"aggregate",b.name);return v+=S?kJ(S)+`
`:"",b.name==="_count"||b.name==="count"?v+=`${b.name}?: true | ${OJ(r.name)}`:v+=`${b.name}?: ${j6(b.outputType.type)}`,v})).join(`
`),2)}
}
export type ${U6(r.name)}<T extends ${qy(r.name)}> = {
[P in keyof T & keyof ${x}]: P extends '_count' | 'count'
? T[P] extends true
? number
: GetScalarType<T[P], ${x}[P]>
: GetScalarType<T[P], ${x}[P]>
}`}toTSWithoutNamespace(){let{model:r}=this,n=r.documentation??"",i=`${`Model ${r.name}
`}${n}`,a=it(jt(r.name,V("$Result.DefaultSelection").addGenericArgument(V(fu(r.name))))).setDocComment(qe(i));return xe(a)}toTS(){let{model:r}=this,n=this.dmmf.isComposite(r.name),o=xe(TMe({modelName:this.model.name,context:this.context,fields:this.type.fields}),{newLine:"leading"}),i=r.fields.some(l=>l.kind==="object"),a=i?xe(z6({modelName:this.model.name,context:this.context,fields:this.type.fields}),{newLine:"leading"}):"",c=i&&this.createManyAndReturnType?xe(z6({typeName:AJ(this.model.name),modelName:this.model.name,context:this.context,fields:this.createManyAndReturnType.fields}),{newLine:"leading"}):"",u=i&&this.updateManyAndReturnType?xe(z6({typeName:PJ(this.model.name),modelName:this.model.name,context:this.context,fields:this.updateManyAndReturnType.fields}),{newLine:"leading"}):"";return`
/**
* Model ${r.name}
*/
${n?"":this.getAggregationTypes()}
${n?"":this.getGroupByTypes()}
${xe(K6({modelName:this.model.name,fields:this.type.fields,context:this.context}))}
${this.createManyAndReturnType?xe(K6({modelName:this.model.name,fields:this.createManyAndReturnType.fields,context:this.context,typeName:DJ(this.model.name)}),{newLine:"leading"}):""}
${this.updateManyAndReturnType?xe(K6({modelName:this.model.name,fields:this.updateManyAndReturnType.fields,context:this.context,typeName:CJ(this.model.name)}),{newLine:"leading"}):""}
${xe(CMe({modelName:this.model.name,fields:this.type.fields,context:this.context}),{newLine:"leading"})}
${o}${a}${c}${u}
${xe(_Me(this.model,this.context),{newLine:"none"})}
type ${r.name}GetPayload<S extends boolean | null | undefined | ${Ir(r.name)}> = $Result.GetResult<${fu(r.name)}, S>
${n?"":new jJ(this.type,this.context).toTS()}
${new W6(this.type).toTS()}
// Custom InputTypes
${this.argsTypes.map(l=>xe(l)).join(`
`)}
`}},jJ=class{constructor(r,n){this.outputType=r;this.context=n}getNonAggregateActions(r){return r.filter(o=>o!=="aggregate"&&o!=="groupBy"&&o!=="count")}toTS(){let{name:r}=this.outputType,{dmmf:n}=this.context,o=n.mappingsMap[r]??{model:r,plural:`${r}s`},i=n.typeAndModelMap[r],a=J6(n,r),c=this.getNonAggregateActions(a),u=HE(r),l=Ir(r,"count"),p=[Ao,er("GlobalOmitOptions").default(Me())],f=["select","include","distinct","omit"];this.context.isPreviewFeatureOn("relationJoins")&&f.push("relationLoadStrategy");let g=f.map(x=>`'${x}'`).join(" | ");return`${a.includes("aggregate")?`type ${l}<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
Omit<${Ir(r,"findMany")}, ${g}> & {
select?: ${OJ(r)} | true
}
`:""}
export interface ${r}Delegate<${p.map(x=>xe(x)).join(", ")}> {
${(0,Hy.default)(`[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['${r}'], meta: { name: '${r}' } }`,2)}
${c.map(x=>{let b=dIt(r,x,this.context);return xe(b,{indentLevel:1,newLine:"trailing"})}).join(`
`)}
${a.includes("aggregate")?`${(0,Hy.default)(H6("count",o,i),2)}
count<T extends ${l}>(
args?: Subset<T, ${l}>,
): Prisma.PrismaPromise<
T extends $Utils.Record<'select', any>
? T['select'] extends true
? number
: GetScalarType<T['select'], ${s2(r)}>
: number
>
`:""}
${a.includes("aggregate")?`${(0,Hy.default)(H6("aggregate",o,i),2)}
aggregate<T extends ${qy(r)}>(args: Subset<T, ${qy(r)}>): Prisma.PrismaPromise<${U6(r)}<T>>
`:""}
${a.includes("groupBy")?`${(0,Hy.default)(H6("groupBy",o,i),2)}
groupBy<
T extends ${u},
HasSelectOrTake extends Or<
Extends<'skip', Keys<T>>,
Extends<'take', Keys<T>>
>,
OrderByArg extends True extends HasSelectOrTake
? { orderBy: ${u}['orderBy'] }
: { orderBy?: ${u}['orderBy'] },
OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
ByFields extends MaybeTupleToUnion<T['by']>,
ByValid extends Has<ByFields, OrderFields>,
HavingFields extends GetHavingFields<T['having']>,
HavingValid extends Has<ByFields, HavingFields>,
ByEmpty extends T['by'] extends never[] ? True : False,
InputErrors extends ByEmpty extends True
? \`Error: "by" must not be empty.\`
: HavingValid extends False
? {
[P in HavingFields]: P extends ByFields
? never
: P extends string
? \`Error: Field "\${P}" used in "having" needs to be provided in "by".\`
: [
Error,
'Field ',
P,
\` in "having" needs to be provided in "by"\`,
]
}[HavingFields]
: 'take' extends Keys<T>
? 'orderBy' extends Keys<T>
? ByValid extends True
? {}
: {
[P in OrderFields]: P extends ByFields
? never
: \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
}[OrderFields]
: 'Error: If you provide "take", you also need to provide "orderBy"'
: 'skip' extends Keys<T>
? 'orderBy' extends Keys<T>
? ByValid extends True
? {}
: {
[P in OrderFields]: P extends ByFields
? never
: \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
}[OrderFields]
: 'Error: If you provide "skip", you also need to provide "orderBy"'
: ByValid extends True
? {}
: {
[P in OrderFields]: P extends ByFields
? never
: \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
}[OrderFields]
>(args: SubsetIntersection<T, ${u}, OrderByArg> & InputErrors): {} extends InputErrors ? ${FJ(r)}<T> : Prisma.PrismaPromise<InputErrors>`:""}
/**
* Fields of the ${r} model
*/
readonly fields: ${VE(r)};
}
${xe(yIt(r,this.outputType,this.context))}
`}};function dIt(e,r,n){let o=n.dmmf.mappingsMap[e]??{model:e,plural:`${e}s`},i=n.dmmf.typeAndModelMap[e],a=gIt(o,r,n),c=yo(r).setDocComment(qe(MJ(r,o,i))).addParameter(mIt(e,r,a)).setReturnType(PMe({modelName:e,actionName:r})),u=hIt(e,r);u&&c.addGenericParameter(u);for(let l of a)c.addGenericParameter(l);return c}function mIt(e,r,n){let o=c=>(n.length>0&&(c=jy([c,...n.map(u=>V(u.name))])),lr("args",c));if(r==="count"){let c=A6(V(Ir(e,"findMany")),Oe(Mt("select")).addVariant(Mt("include")).addVariant(Mt("distinct")));return o(c).optional()}if(r==="findRaw"||r==="aggregateRaw")return o(V(Ir(e,r))).optional();let i=V("SelectSubset").addGenericArgument(V("T")).addGenericArgument(V(Ir(e,r)).addGenericArgument(Ao.toArgument())),a=o(i);return(r==="findMany"||r==="findFirst"||r==="deleteMany"||r==="createMany"||r==="createManyAndReturn"||r==="findFirstOrThrow")&&a.optional(),a}function hIt(e,r){if(r==="count"||r==="findRaw"||r==="aggregateRaw")return null;let n=er("T");return r==="aggregate"?n.extends(V(qy(e))):n.extends(V(Ir(e,r)))}function gIt(e,r,n){let o=e[r];if(!o)throw new Error(`Missing mapping for ${e.model}.${r}`);let i=n.dmmf.outputTypeMap.prisma.Query.fields.find(c=>c.name===o)??n.dmmf.outputTypeMap.prisma.Mutation.fields.find(c=>c.name===o);if(!i)throw new Error(`Can't find output field ${o} in the schema`);let a=[];for(let c of i.args){if(c.requiresOtherFields===void 0)continue;let u=Me();for(let l of c.requiresOtherFields)u.add(de(l,Me()));a.push(er(`${ot(c.name)}DependenciesValidator`).extends(S6().check(Mt(c.name)).extends(V("Prisma.Keys<T>")).then(u).else(Me())))}return a}function PMe({modelName:e,actionName:r,isChaining:n=!1,isNullable:o=!1}){if(r==="count")return Ed(ur);if(r==="aggregate")return Ed(V(U6(e)).addGenericArgument(V("T")));if(r==="findRaw"||r==="aggregateRaw")return wd(V("JsonObject"));if(r==="deleteMany"||r==="updateMany"||r==="createMany")return wd(V("BatchPayload"));if(r==="findMany"||r==="createManyAndReturn"||r==="updateManyAndReturn"){let a=Z6(e,r);return n&&(a=Oe(a).addVariant(V("Null"))),wd(a)}if(n&&r==="findUniqueOrThrow"){let a=o?Rt:V("Null"),c=Oe(Z6(e,r)).addVariant(a);return LJ(e,c,a)}if(r==="findFirst"||r==="findUnique"){let a=Oe(Z6(e,r)).addVariant(Rt);return LJ(e,a,Rt)}return LJ(e,Z6(e,r))}function LJ(e,r,n=Co){return V(OMe(e)).addGenericArgument(r).addGenericArgument(n).addGenericArgument(Ao.toArgument()).addGenericArgument(V("GlobalOmitOptions"))}function Z6(e,r){return V("$Result.GetResult").addGenericArgument(V(fu(e)).addGenericArgument(Ao.toArgument())).addGenericArgument(V("T")).addGenericArgument(Mt(r)).addGenericArgument(V("GlobalOmitOptions"))}function yIt(e,r,n){let o=qp(OMe(e));return o.addGenericParameter(er("T")).addGenericParameter(er("Null").default(Co)).addGenericParameter(Ao).addGenericParameter(er("GlobalOmitOptions").default(Me())).extends(wd(V("T"))),o.add(de($6,Mt("PrismaPromise")).readonly()),o.addMultiple(r.fields.filter(i=>i.outputType.location==="outputObjectTypes"&&!n.dmmf.isComposite(i.outputType.type)&&i.name!=="_count").map(i=>{let a=V(WE(i,e)).addGenericArgument(Ao.toArgument()),c=er("T").extends(a).default(Me());return yo(i.name).addGenericParameter(c).addParameter(lr("args",bIt(c.toArgument(),a)).optional()).setReturnType(PMe({modelName:i.outputType.type,actionName:i.outputType.isList?"findMany":"findUniqueOrThrow",isChaining:!0,isNullable:i.isNullable}))})),o.add(yo("then").setDocComment(qe`
Attaches callbacks for the resolution and/or rejection of the Promise.
@param onfulfilled The callback to execute when the Promise is resolved.
@param onrejected The callback to execute when the Promise is rejected.
@returns A Promise for the completion of which ever callback is executed.
`).addGenericParameter(er("TResult1").default(V("T"))).addGenericParameter(er("TResult2").default(Co)).addParameter(BJ("onfulfilled",lr("value",V("T")),V("TResult1"))).addParameter(BJ("onrejected",lr("reason",Up),V("TResult2"))).setReturnType(Ed(Oe([V("TResult1"),V("TResult2")])))),o.add(yo("catch").setDocComment(qe`
Attaches a callback for only the rejection of the Promise.
@param onrejected The callback to execute when the Promise is rejected.
@returns A Promise for the completion of the callback.
`).addGenericParameter(er("TResult").default(Co)).addParameter(BJ("onrejected",lr("reason",Up),V("TResult"))).setReturnType(Ed(Oe([V("T"),V("TResult")])))),o.add(yo("finally").setDocComment(qe`
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
resolved value cannot be modified from the callback.
@param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
@returns A Promise for the completion of the callback.
`).addParameter(lr("onfinally",Oe([Ca(),jE,Rt])).optional()).setReturnType(Ed(V("T")))),it(o).setDocComment(qe`
The delegate class that acts as a "Promise-like" for ${e}.
Why is this prefixed with \`Prisma__\`?
Because we want to prevent naming conflicts as mentioned in
https://github.com/prisma/prisma-client-js/issues/707
`)}function BJ(e,r,n){return lr(e,Oe([Ca().addParameter(r).setReturnType(xIt(n)),jE,Rt])).optional()}function xIt(e){return Oe([e,V("PromiseLike").addGenericArgument(e)])}function bIt(e,r){return V("Subset").addGenericArgument(e).addGenericArgument(r)}function OMe(e){return`Prisma__${e}Client`}function qJ(e){return new UJ(e).serialize()}function vIt(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64url")}function Aa(e){let r=1;for(;e>=128;)r++,e>>>=7;return r}var UJ=class{#e;#t;#r;#o=0;#i;constructor(r){this.#e=r,this.#i=Object.keys(r.roots);let n=this.#l();this.#t=new ArrayBuffer(n),this.#r=new DataView(this.#t)}serialize(){return this.#p(),this.#f(),this.#u(),this.#h(),{strings:this.#e.strings,graph:vIt(new Uint8Array(this.#t,0,this.#o))}}#n(r){for(;r>=128;)this.#r.setUint8(this.#o++,r&127|128),r>>>=7;this.#r.setUint8(this.#o++,r)}#s(r){this.#n(r===void 0?0:r+1)}#a(r){this.#r.setUint8(this.#o,r),this.#o+=1}#c(r){this.#r.setUint16(this.#o,r,!0),this.#o+=2}#l(){let r=0;r+=Aa(this.#e.inputNodes.length),r+=Aa(this.#e.outputNodes.length),r+=Aa(this.#i.length);for(let n of this.#e.inputNodes){let o=Object.keys(n.edges).map(Number);r+=Aa(o.length);for(let i of o){let a=n.edges[i];r+=Aa(i),r+=2,r+=Aa(a.childNodeId===void 0?0:a.childNodeId+1),r+=Aa(a.enumNameIndex===void 0?0:a.enumNameIndex+1),r+=1}}for(let n of this.#e.outputNodes){let o=Object.keys(n.edges).map(Number);r+=Aa(o.length);for(let i of o){let a=n.edges[i];r+=Aa(i),r+=Aa(a.argsNodeId===void 0?0:a.argsNodeId+1),r+=Aa(a.outputNodeId===void 0?0:a.outputNodeId+1)}}for(let n of this.#i){let o=this.#e.roots[n],i=this.#e.strings.indexOf(n);r+=Aa(i),r+=Aa(o.argsNodeId===void 0?0:o.argsNodeId+1),r+=Aa(o.outputNodeId===void 0?0:o.outputNodeId+1)}return r}#p(){this.#n(this.#e.inputNodes.length),this.#n(this.#e.outputNodes.length),this.#n(this.#i.length)}#f(){for(let r of this.#e.inputNodes){let n=Object.keys(r.edges).map(Number);this.#n(n.length);for(let o of n){let i=r.edges[o];this.#n(o),this.#c(i.scalarMask??0),this.#s(i.childNodeId),this.#s(i.enumNameIndex),this.#a(i.flags)}}}#u(){for(let r of this.#e.outputNodes){let n=Object.keys(r.edges).map(Number);this.#n(n.length);for(let o of n){let i=r.edges[o];this.#n(o),this.#s(i.argsNodeId),this.#s(i.outputNodeId)}}}#h(){for(let r of this.#i){let n=this.#e.roots[r],o=this.#e.strings.indexOf(r);if(o===-1)throw new Error(`Root key "${r}" not found in strings table`);this.#n(o),this.#s(n.argsNodeId),this.#s(n.outputNodeId)}}};var Hh={ParamScalar:1,ParamEnum:2,ParamListScalar:4,ParamListEnum:8,ListObject:16,Object:32},Wp={String:1,Int:2,BigInt:4,Float:8,Decimal:16,Boolean:32,DateTime:64,Json:128,Bytes:256};function GJ(e){switch(e){case"String":case"UUID":return Wp.String;case"Int":return Wp.Int;case"BigInt":return Wp.BigInt;case"Float":return Wp.Float;case"Decimal":return Wp.Decimal;case"Boolean":return Wp.Boolean;case"DateTime":return Wp.DateTime;case"Json":return Wp.Json;case"Bytes":return Wp.Bytes;default:return 0}}var X6=class{#e;#t;#r;#o=[];#i=[];constructor(r,n){this.#e=r,this.#t=new Map,this.#r=new Map;for(let o of n.schema.inputObjectTypes.prisma??[])this.#t.set(Wh(o.name,"prisma"),o);for(let o of n.schema.inputObjectTypes.model??[])this.#t.set(Wh(o.name,"model"),o);for(let o of n.schema.outputObjectTypes.prisma??[])this.#r.set(Wh(o.name,"prisma"),o);for(let o of n.schema.outputObjectTypes.model??[])this.#r.set(Wh(o.name,"model"),o)}processRoots(r){for(let n of r){let o=n.model,i=Object.keys(xd);for(let a of i){let c=n[a];if(!c)continue;let u=this.#s(c);if(!u)continue;let l=this.buildInputNodeFromArgs(u.args),p;u.outputType.location==="outputObjectTypes"&&(p=this.buildOutputTypeNode(Wh(u.outputType.type,u.outputType.namespace)));let g={create:"createOne",update:"updateOne",delete:"deleteOne",upsert:"upsertOne"}[a]??a,x=`${o}.${g}`;this.#e.setRoot(x,{argsNodeId:l,outputNodeId:p})}}this.#n()}#n(){for(;this.#o.length>0||this.#i.length>0;){for(;this.#o.length>0;){let r=this.#o.pop();this.#a(r.nodeId,r.fields)}for(;this.#i.length>0;){let r=this.#i.pop();this.#c(r.nodeId,r.typeNames)}}}#s(r){let n=thi
Debug.enable(${r})
}
`}function IMe(e,r){let n=y6(e),o;r==="wasm-compiler-edge"||r==="client"?o=x6(n):o=n;let i=SMe(JSON.stringify(o));return`
config.runtimeDataModel = JSON.parse(${JSON.stringify(i)})
defineDmmfProperty(exports.Prisma, config.runtimeDataModel)`}function RMe(e,r,n){let o=`query_compiler_${n}_bg`;return r==="client"&&!e?`config.compilerWasm = {
getRuntime: async () => require('./${o}.js'),
getQueryCompilerWasmModule: async () => {
const { Buffer } = require('node:buffer')
const { wasm } = require('./${o}.wasm-base64.js')
const queryCompilerWasmFileBytes = Buffer.from(wasm, 'base64')
return new WebAssembly.Module(queryCompilerWasmFileBytes)
},
importName: './${o}.js',
}`:r==="client"&&e||r==="wasm-compiler-edge"?`config.compilerWasm = {
getRuntime: async () => require('./${o}.js'),
getQueryCompilerWasmModule: async () => {
const loader = (await import('#wasm-compiler-loader')).default
const compiler = (await loader).default
return compiler
},
importName: './${o}.js',
}`:"config.compilerWasm = undefined"}function MMe(e){return e===!0?"":`
const path = require('path')`}var kMe=W(ys());var VJ=({runtimeBase:e,runtimeName:r,browser:n,clientVersion:o,engineVersion:i,generator:a})=>`
Object.defineProperty(exports, "__esModule", { value: true });
${n?`
const {
Decimal,
DbNull,
JsonNull,
AnyNull,
NullTypes,
makeStrictEnum,
Public,
getRuntime,
skip
} = require('${e}/${r}.js')
`:`
const {
PrismaClientKnownRequestError,
PrismaClientUnknownRequestError,
PrismaClientRustPanicError,
PrismaClientInitializationError,
PrismaClientValidationError,
getPrismaClient,
sqltag,
empty,
join,
raw,
skip,
Decimal,
Debug,
DbNull,
JsonNull,
AnyNull,
NullTypes,
makeStrictEnum,
Extensions,
warnOnce,
defineDmmfProperty,
Public,
getRuntime,
createParam,
} = require('${e}/${r}.js')
`}
const Prisma = {}
exports.Prisma = Prisma
exports.$Enums = {}
/**
* Prisma Client JS version: ${o}
* Query Engine version: ${i}
*/
Prisma.prismaVersion = {
client: "${o}",
engine: "${i}"
}
Prisma.PrismaClientKnownRequestError = ${vl("PrismaClientKnownRequestError",n)};
Prisma.PrismaClientUnknownRequestError = ${vl("PrismaClientUnknownRequestError",n)}
Prisma.PrismaClientRustPanicError = ${vl("PrismaClientRustPanicError",n)}
Prisma.PrismaClientInitializationError = ${vl("PrismaClientInitializationError",n)}
Prisma.PrismaClientValidationError = ${vl("PrismaClientValidationError",n)}
Prisma.Decimal = Decimal
/**
* Re-export of sql-template-tag
*/
Prisma.sql = ${vl("sqltag",n)}
Prisma.empty = ${vl("empty",n)}
Prisma.join = ${vl("join",n)}
Prisma.raw = ${vl("raw",n)}
Prisma.validator = Public.validator
/**
* Extensions
*/
Prisma.getExtensionContext = ${vl("Extensions.getExtensionContext",n)}
Prisma.defineExtension = ${vl("Extensions.defineExtension",n)}
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = DbNull
Prisma.JsonNull = JsonNull
Prisma.AnyNull = AnyNull
Prisma.NullTypes = NullTypes
${wIt(a.previewFeatures)}
`,vl=(e,r)=>r?`() => {
const runtimeName = getRuntime().prettyName;
throw new Error(\`${e} is unable to run in this browser environment, or has been bundled for the browser (running in \${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report\`,
)}`:e,$Me=({runtimeBase:e,runtimeName:r,clientVersion:n,engineVersion:o,generator:i})=>({tsWithoutNamespace:()=>`import * as runtime from '${e}/${r}.js';
import $Types = runtime.Types // general types
import $Public = runtime.Types.Public
import $Utils = runtime.Types.Utils
import $Extensions = runtime.Types.Extensions
import $Result = runtime.Types.Result
export type PrismaPromise<T> = $Public.PrismaPromise<T>
`,ts:()=>`export import DMMF = runtime.DMMF
export type PrismaPromise<T> = $Public.PrismaPromise<T>
/**
* Validator
*/
export import validator = runtime.Public.validator
/**
* Prisma Errors
*/
export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError
export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError
export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError
export import PrismaClientInitializationError = runtime.PrismaClientInitializationError
export import PrismaClientValidationError = runtime.PrismaClientValidationError
/**
* Re-export of sql-template-tag
*/
export import sql = runtime.sqltag
export import empty = runtime.empty
export import join = runtime.join
export import raw = runtime.raw
export import Sql = runtime.Sql
${EIt(i.previewFeatures)}
/**
* Decimal.js
*/
export import Decimal = runtime.Decimal
export type DecimalJsLike = runtime.DecimalJsLike
/**
* Extensions
*/
export import Extension = $Extensions.UserArgs
export import getExtensionContext = runtime.Extensions.getExtensionContext
export import Args = $Public.Args
export import Payload = $Public.Payload
export import Result = $Public.Result
export import Exact = $Public.Exact
/**
* Prisma Client JS version: ${n}
* Query Engine version: ${o}
*/
export type PrismaVersion = {
client: string
engine: string
}
export const prismaVersion: PrismaVersion
/**
* Utility Types
*/
export import Bytes = runtime.Bytes
export import JsonObject = runtime.JsonObject
export import JsonArray = runtime.JsonArray
export import JsonValue = runtime.JsonValue
export import InputJsonObject = runtime.InputJsonObject
export import InputJsonArray = runtime.InputJsonArray
export import InputJsonValue = runtime.InputJsonValue
/**
* Types of the values used to represent different kinds of \`null\` values when working with JSON fields.
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
namespace NullTypes {
${WJ("DbNull")}
${WJ("JsonNull")}
${WJ("AnyNull")}
}
/**
* Helper for filtering JSON entries that have \`null\` on the database (empty on the db)
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const DbNull: NullTypes.DbNull
/**
* Helper for filtering JSON entries that have JSON \`null\` values (not empty on the db)
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const JsonNull: NullTypes.JsonNull
/**
* Helper for filtering JSON entries that are \`Prisma.DbNull\` or \`Prisma.JsonNull\`
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const AnyNull: NullTypes.AnyNull
type SelectAndInclude = {
select: any
include: any
}
type SelectAndOmit = {
select: any
omit: any
}
/**
* Get the type of the value, that the Promise holds.
*/
export type PromiseType<T extends PromiseLike<any>> = T extends PromiseLike<infer U> ? U : T;
/**
* Get the return type of a function which returns a Promise.
*/
export type PromiseReturnType<T extends (...args: any) => $Utils.JsPromise<any>> = PromiseType<ReturnType<T>>
/**
* From T, pick a set of properties whose keys are in the union K
*/
type Prisma__Pick<T, K extends keyof T> = {
[P in K]: T[P];
};
export type Enumerable<T> = T | Array<T>;
export type RequiredKeys<T> = {
[K in keyof T]-?: {} extends Prisma__Pick<T, K> ? never : K
}[keyof T]
export type TruthyKeys<T> = keyof {
[K in keyof T as T[K] extends false | undefined | null ? never : K]: K
}
export type TrueKeys<T> = TruthyKeys<Prisma__Pick<T, RequiredKeys<T>>>
/**
* Subset
* @desc From \`T\` pick properties that exist in \`U\`. Simple version of Intersection
*/
export type Subset<T, U> = {
[key in keyof T]: key extends keyof U ? T[key] : never;
};
/**
* SelectSubset
* @desc From \`T\` pick properties that exist in \`U\`. Simple version of Intersection.
* Additionally, it validates, if both select and include are present. If the case, it errors.
*/
export type SelectSubset<T, U> = {
[key in keyof T]: key extends keyof U ? T[key] : never
} &
(T extends SelectAndInclude
? 'Please either choose \`select\` or \`include\`.'
: T extends SelectAndOmit
? 'Please either choose \`select\` or \`omit\`.'
: {})
/**
* Subset + Intersection
* @desc From \`T\` pick properties that exist in \`U\` and intersect \`K\`
*/
export type SubsetIntersection<T, U, K> = {
[key in keyof T]: key extends keyof U ? T[key] : never
} &
K
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
/**
* XOR is needed to have a real mutually exclusive union type
* https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types
*/
type XOR<T, U> =
T extends object ?
U extends object ?
(Without<T, U> & U) | (Without<U, T> & T)
: U : T
/**
* Is T a Record?
*/
type IsObject<T extends any> = T extends Array<any>
? False
: T extends Date
? False
: T extends Uint8Array
? False
: T extends BigInt
? False
: T extends object
? True
: False
/**
* If it's T[], return T
*/
export type UnEnumerate<T extends unknown> = T extends Array<infer U> ? U : T
/**
* From ts-toolbelt
*/
type __Either<O extends object, K extends Key> = Omit<O, K> &
{
// Merge all but K
[P in K]: Prisma__Pick<O, P & keyof O> // With K possibilities
}[K]
type EitherStrict<O extends object, K extends Key> = Strict<__Either<O, K>>
type EitherLoose<O extends object, K extends Key> = ComputeRaw<__Either<O, K>>
type _Either<
O extends object,
K extends Key,
strict extends Boolean
> = {
1: EitherStrict<O, K>
0: EitherLoose<O, K>
}[strict]
type Either<
O extends object,
K extends Key,
strict extends Boolean = 1
> = O extends unknown ? _Either<O, K, strict> : never
export type Union = any
type PatchUndefined<O extends object, O1 extends object> = {
[K in keyof O]: O[K] extends undefined ? At<O1, K> : O[K]
} & {}
/** Helper Types for "Merge" **/
export type IntersectOf<U extends Union> = (
U extends unknown ? (k: U) => void : never
) extends (k: infer I) => void
? I
: never
export type Overwrite<O extends object, O1 extends object> = {
[K in keyof O]: K extends keyof O1 ? O1[K] : O[K];
} & {};
type _Merge<U extends object> = IntersectOf<Overwrite<U, {
[K in keyof U]-?: At<U, K>;
}>>;
type Key = string | number | symbol;
type AtBasic<O extends object, K extends Key> = K extends keyof O ? O[K] : never;
type AtStrict<O extends object, K extends Key> = O[K & keyof O];
type AtLoose<O extends object, K extends Key> = O extends unknown ? AtStrict<O, K> : never;
export type At<O extends object, K extends Key, strict extends Boolean = 1> = {
1: AtStrict<O, K>;
0: AtLoose<O, K>;
}[strict];
export type ComputeRaw<A extends any> = A extends Function ? A : {
[K in keyof A]: A[K];
} & {};
export type OptionalFlat<O> = {
[K in keyof O]?: O[K];
} & {};
type _Record<K extends keyof any, T> = {
[P in K]: T;
};
// cause typescript not to expand types and preserve names
type NoExpand<T> = T extends unknown ? T : never;
// this type assumes the passed object is entirely optional
type AtLeast<O extends object, K extends string> = NoExpand<
O extends unknown
? | (K extends keyof O ? { [P in K]: O[P] } & O : O)
| {[P in keyof O as P extends K ? P : never]-?: O[P]} & O
: never>;
type _Strict<U, _U = U> = U extends unknown ? U & OptionalFlat<_Record<Exclude<Keys<_U>, keyof U>, never>> : never;
export type Strict<U extends object> = ComputeRaw<_Strict<U>>;
/** End Helper Types for "Merge" **/
export type Merge<U extends object> = ComputeRaw<_Merge<Strict<U>>>;
/**
A [[Boolean]]
*/
export type Boolean = True | False
// /**
// 1
// */
export type True = 1
/**
0
*/
export type False = 0
export type Not<B extends Boolean> = {
0: 1
1: 0
}[B]
export type Extends<A1 extends any, A2 extends any> = [A1] extends [never]
? 0 // anything \`never\` is false
: A1 extends A2
? 1
: 0
export type Has<U extends Union, U1 extends Union> = Not<
Extends<Exclude<U1, U>, U1>
>
export type Or<B1 extends Boolean, B2 extends Boolean> = {
0: {
0: 0
1: 1
}
1: {
0: 1
1: 1
}
}[B1][B2]
export type Keys<U extends Union> = U extends unknown ? keyof U : never
type Cast<A, B> = A extends B ? A : B;
export const type: unique symbol;
/**
* Used by group by
*/
export type GetScalarType<T, O> = O extends object ? {
[P in keyof T]: P extends keyof O
? O[P]
: never
} : never
type FieldPaths<
T,
U = Omit<T, '_avg' | '_sum' | '_count' | '_min' | '_max'>
> = IsObject<T> extends True ? U : T
type GetHavingFields<T> = {
[K in keyof T]: Or<
Or<Extends<'OR', K>, Extends<'AND', K>>,
Extends<'NOT', K>
> extends True
? // infer is only needed to not hit TS limit
// based on the brilliant idea of Pierre-Antoine Mills
// https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437
T[K] extends infer TK
? GetHavingFields<UnEnumerate<TK> extends object ? Merge<UnEnumerate<TK>> : never>
: never
: {} extends FieldPaths<T[K]>
? never
: K
}[keyof T]
/**
* Convert tuple to union
*/
type _TupleToUnion<T> = T extends (infer E)[] ? E : never
type TupleToUnion<K extends readonly any[]> = _TupleToUnion<K>
type MaybeTupleToUnion<T> = T extends any[] ? TupleToUnion<T> : T
/**
* Like \`Pick\`, but additionally can also accept an array of keys
*/
type PickEnumerable<T, K extends Enumerable<keyof T> | keyof T> = Prisma__Pick<T, MaybeTupleToUnion<K>>
/**
* Exclude all keys with underscores
*/
type ExcludeUnderscoreKeys<T extends string> = T extends \`_\${string}\` ? never : T
export type FieldRef<Model, FieldType> = runtime.FieldRef<Model, FieldType>
type FieldRefInputType<Model, FieldType> = Model extends never ? never : FieldRef<Model, FieldType>
`});function WJ(e){let r=`/**
* Type of \`Prisma.${e}\`.
*
* You cannot use other instances of this class. Please use the \`Prisma.${e}\` value.
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
class ${e} {
private ${e}: never
private constructor()
}`;return(0,kMe.default)(r,2)}function EIt(e){return e.includes("strictUndefinedChecks")?`
/**
* Prisma.skip
*/
export import skip = runtime.skip
`:""}function wIt(e){return e.includes("strictUndefinedChecks")?`
Prisma.skip = skip
`:""}var LMe=W(ys());var n$=class{constructor(r,n){this.type=r;this.context=n}get argsTypes(){let r=[];r.push(new mu(this.type,this.context).addSelectArg().addIncludeArgIfHasRelations().createExport());for(let n of this.type.fields)n.args.length>0&&r.push(new mu(this.type,this.context).addSchemaArgs(n.args).setGeneratedName(NMe(this.type.name,n.name)).createExport());return r}toTS(){let{type:r}=this,{name:n}=r,o=u2(r);return`
/**
* Count Type ${n}
*/
${xe(o)}
export type ${Uy(n)}<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
${(0,LMe.default)(r.fields.map(i=>{let a=["boolean"];return i.outputType.location==="outputObjectTypes"&&a.push(WE(i,this.type.name)),i.args.length>0&&a.push(NMe(n,i.name)),`${i.name}?: ${a.join(" | ")}`}).join(`
`),2)}
}
// Custom InputTypes
${this.argsTypes.map(i=>xe(i)).join(`
`)}
`}};function NMe(e,r){return`${e}Count${ot(r)}Args`}var o$=class{constructor(r){this.type=r}toTS(){let r=this.getAllowedTypes();return`
/**
* Reference to a field of type ${r}
*/
export type ${this.type.name}<$PrismaModel> = FieldRefInputType<$PrismaModel, ${r}>
`}getAllowedTypes(){return this.type.allowTypes.map(q6).join(" | ")}};var i$=class{dmmf;genericArgsInfo;generator;provider;constructor({dmmf:r,genericArgsInfo:n,generator:o,provider:i}){this.dmmf=r,this.genericArgsInfo=n,this.generator=o,this.provider=i}isPreviewFeatureOn(r){return this.generator?.previewFeatures?.includes(r)??!1}isSqlProvider(){return this.provider!=="mongodb"}};var zJ=W(ys());function BMe(e){return V(`runtime.${e}`)}function jMe(e){let r=Me().addMultiple(e.datamodel.models.map(n=>{let o=V(qE(n.name));return de(Ve(n.name),o).optional()}));return it(jt("GlobalOmitConfig",r))}function SIt(e){let r=Me(),n=e.dmmf.datamodel.models.map(a=>a.name);n.length===0?r.add(de("modelProps",Co)):r.add(de("modelProps",Oe(n.map(a=>Mt(Ve(a))))));let o=e.dmmf.hasEnumInNamespace("TransactionIsolationLevel","prisma")?V("Prisma.TransactionIsolationLevel"):Co;r.add(de("txIsolationLevel",o));let i=Me();return i.addMultiple(n.map(a=>{let c=Me();c.add(de("payload",V(fu(a)).addGenericArgument(Ao.toArgument()))),c.add(de("fields",V(`Prisma.${VE(a)}`)));let u=J6(e.dmmf,a),l=Me();return l.addMultiple(u.map(p=>{let f=Me(),g=`Prisma.${Ir(a,p)}`;return f.add(de("args",V(g).addGenericArgument(Ao.toArgument()))),f.add(de("result",_It(a,p))),de(p,f)})),c.add(de("operations",l)),de(a,c)})),Me().add(de("globalOmitOptions",Me().add(de("omit",V("GlobalOmitOptions"))))).add(de("meta",r)).add(de("model",i))}function _It(e,r){if(r==="count")return Oe([Y6(V(s2(e))),ur]);if(r==="groupBy")return $e(Y6(V(B6(e))));if(r==="aggregate")return Y6(V(GE(e)));if(r==="findRaw")return V("JsonObject");if(r==="aggregateRaw")return V("JsonObject");if(r==="deleteMany")return V("BatchPayload");if(r==="createMany")return V("BatchPayload");if(r==="createManyAndReturn")return $e(El(e));if(r==="updateMany")return V("BatchPayload");if(r==="updateManyAndReturn")return $e(El(e));if(r==="findMany")return $e(El(e));if(r==="findFirst")return Oe([El(e),Rt]);if(r==="findUnique")return Oe([El(e),Rt]);if(r==="findFirstOrThrow"||r==="findUniqueOrThrow"||r==="create"||r==="update"||r==="upsert"||r==="delete")return El(e);Hs(r,`Unknown action: ${r}`)}function El(e){return V("$Utils.PayloadToResult").addGenericArgument(V(fu(e)))}function TIt(e){let r=e.dmmf.getOtherOperationNames().flatMap(o=>{let i=[`$${o}`];return(o==="executeRaw"||o==="queryRaw")&&i.push(`$${o}Unsafe`),o==="queryRaw"&&e.isPreviewFeatureOn("typedSql")&&i.push("$queryRawTyped"),i}),n={$executeRaw:{args:"[query: TemplateStringsArray | Prisma.Sql, ...values: any[]]",result:"any"},$queryRaw:{args:"[query: TemplateStringsArray | Prisma.Sql, ...values: any[]]",result:"any"},$executeRawUnsafe:{args:"[query: string, ...values: any[]]",result:"any"},$queryRawUnsafe:{args:"[query: string, ...values: any[]]",result:"any"},$runCommandRaw:{args:"Prisma.InputJsonObject",result:"Prisma.JsonObject"},$queryRawTyped:{args:"runtime.UnknownTypedSql",result:"Prisma.JsonObject"}};return`{
other: {
payload: any
operations: {${r.reduce((o,i)=>`${o}
${i}: {
args: ${n[i].args},
result: ${n[i].result}
}`,"")}
}
}
}`}function DIt(e){return`
interface TypeMapCb<ClientOptions = {}> extends $Utils.Fn<{extArgs: $Extensions.InternalArgs }, $Utils.Record<string, any>> {
returns: Prisma.TypeMap<this['params']['extArgs'], ClientOptions extends { omit: infer OmitOptions } ? OmitOptions : {}>
}
export type TypeMap<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> = ${`${xe(SIt(e))} & ${TIt(e)}`}`}function CIt(e){let r=DIt(e),n=it(lu("defineExtension",V("$Extensions.ExtendsHook").addGenericArgument(Mt("define")).addGenericArgument(V("Prisma.TypeMapCb")).addGenericArgument(V("$Extensions.DefaultArgs"))));return[r,xe(n)].join(`
`)}function AIt(){let e=V("$Extensions.ExtendsHook").addGenericArgument(Mt("extends")).addGenericArgument(V("Prisma.TypeMapCb").addGenericArgument(V("ClientOptions"))).addGenericArgument(V("ExtArgs")).addGenericArgument(V("$Utils.Call").addGenericArgument(V("Prisma.TypeMapCb").addGenericArgument(V("ClientOptions"))).addGenericArgument(Me().add(de("extArgs",V("ExtArgs")))));return xe(de("$extends",e),{indentLevel:1})}function PIt(e){let r=yo("$transaction").setDocComment(qe`
Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
@example
\`\`\`
const [george, bob, alice] = await prisma.$transaction([
prisma.user.create({ data: { name: 'George' } }),
prisma.user.create({ data: { name: 'Bob' } }),
prisma.user.create({ data: { name: 'Alice' } }),
])
\`\`\`
Read more in our [docs](https://www.prisma.io/docs/orm/prisma-client/queries/transactions).
`).addGenericParameter(er("P").extends($e(wd(Up)))).addParameter(lr("arg",w6(V("P")))).setReturnType(Ed(V("runtime.Types.Utils.UnwrapTuple").addGenericArgument(V("P"))));if(e.dmmf.hasEnumInNamespace("TransactionIsolationLevel","prisma")){let n=Me().formatInline().add(de("isolationLevel",V("Prisma.TransactionIsolationLevel")).optional());r.addParameter(lr("options",n).optional())}return xe(r,{indentLevel:1,newLine:"leading"})}function OIt(e){let r=Me().formatInline().add(de("maxWait",ur).optional()).add(de("timeout",ur).optional());if(e.dmmf.hasEnumInNamespace("TransactionIsolationLevel","prisma")){let a=de("isolationLevel",V("Prisma.TransactionIsolationLevel")).optional();r.add(a)}let n=Ed(V("R")),o=Ca().addParameter(lr("prisma",A6(V("PrismaClient"),FIt(e)))).setReturnType(n),i=yo("$transaction").addGenericParameter(er("R")).addParameter(lr("fn",o)).addParameter(lr("options",r).optional()).setReturnType(n);return xe(i,{indentLevel:1,newLine:"leading"})}function FIt(e){return e.provider==="mongodb"?Oe([V("runtime.ITXClientDenyList"),Mt("$transaction")]):V("runtime.ITXClientDenyList")}function IIt(e){return e.dmmf.mappings.otherOperations.write.includes("queryRaw")?`
/**
* Performs a prepared raw query and returns the \`SELECT\` data.
* @example
* \`\`\`
* const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\`
* \`\`\`
*
* Read more in our [docs](https://pris.ly/d/raw-queries).
*/
$queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
/**
* Performs a raw query and returns the \`SELECT\` data.
* Susceptible to SQL injections, see documentation.
* @example
* \`\`\`
* const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
* \`\`\`
*
* Read more in our [docs](https://pris.ly/d/raw-queries).
*/
$queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;`:""}function RIt(e){return e.dmmf.mappings.otherOperations.write.includes("executeRaw")?`
/**
* Executes a prepared raw query and returns the number of affected rows.
* @example
* \`\`\`
* const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\`
* \`\`\`
*
* Read more in our [docs](https://pris.ly/d/raw-queries).
*/
$executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
/**
* Executes a raw query and returns the number of affected rows.
* Susceptible to SQL injections, see documentation.
* @example
* \`\`\`
* const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
* \`\`\`
*
* Read more in our [docs](https://pris.ly/d/raw-queries).
*/
$executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;`:""}function MIt(e){if(!e.isPreviewFeatureOn("typedSql")||!e.dmmf.mappings.otherOperations.write.includes("queryRaw"))return"";let r=er("T"),n=yo("$queryRawTyped").setDocComment(qe`
Executes a typed SQL query and returns a typed result
@example
\`\`\`
import { myQuery } from '@prisma/client/sql'
const result = await prisma.$queryRawTyped(myQuery())
\`\`\`
`).addGenericParameter(r).addParameter(lr("typedSql",BMe("TypedSql").addGenericArgument($e(Gh)).addGenericArgument(r.toArgument()))).setReturnType(wd($e(r.toArgument())));return xe(n,{indentLevel:1,newLine:"leading"})}function kIt(e){if(!e.dmmf.mappings.otherOperations.write.includes("runCommandRaw"))return"";let r=yo("$runCommandRaw").addParameter(lr("command",V("Prisma.InputJsonObject"))).setReturnType(wd(V("Prisma.JsonObject"))).setDocComment(qe`
Executes a raw MongoDB command and returns the result of it.
@example
\`\`\`
const user = await prisma.$runCommandRaw({
aggregate: 'User',
pipeline: [{ $match: { name: 'Bob' } }, { $project: { email: true, _id: false } }],
explain: false,
})
\`\`\`
Read more in our [docs](https://pris.ly/d/raw-queries).
`);return xe(r,{indentLevel:1,newLine:"leading"})}var s$=class{constructor(r,n,o,i,a){this.context=r;this.internalDatasources=n;this.outputDir=o;this.runtimeName=i;this.browser=a}get jsDoc(){let{dmmf:r}=this.context,n;return r.mappings.modelOperations.length?n=r.mappings.modelOperations[0]:n={model:"User",plural:"users"},`/**
* ## Prisma Client \u02B2\u02E2
*
* Type-safe database client for TypeScript & Node.js
* @example
* \`\`\`
* const prisma = new PrismaClient({
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
* })
* // Fetch zero or more ${ot(n.plural)}
* const ${Ve(n.plural)} = await prisma.${Ve(n.model)}.findMany()
* \`\`\`
*
*
* Read more in our [docs](https://pris.ly/d/client).
*/`}toTSWithoutNamespace(){let{dmmf:r}=this.context;return`${this.jsDoc}
export class PrismaClient<
ClientOptions extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
const U = 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array<Prisma.LogLevel | Prisma.LogDefinition> ? Prisma.GetEvents<ClientOptions['log']> : never : never,
ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs
> {
[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['other'] }
${(0,zJ.default)(this.jsDoc,2)}
constructor(optionsArg ?: Prisma.Subset<ClientOptions, Prisma.PrismaClientOptions>);
$on<V extends U>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;
/**
* Connect with the database
*/
$connect(): $Utils.JsPromise<void>;
/**
* Disconnect from the database
*/
$disconnect(): $Utils.JsPromise<void>;
${[RIt(this.context),IIt(this.context),MIt(this.context),PIt(this.context),OIt(this.context),kIt(this.context),AIt()].filter(n=>n!==null).join(`
`).trim()}
${(0,zJ.default)(r.mappings.modelOperations.filter(n=>n.findMany).map(n=>{let o=Ve(n.model);o==="constructor"&&(o='["constructor"]');let i=["ExtArgs","ClientOptions"];return`/**
* \`prisma.${o}\`: Exposes CRUD operations for the **${n.model}** model.
* Example usage:
* \`\`\`ts
* // Fetch zero or more ${ot(n.plural)}
* const ${Ve(n.plural)} = await prisma.${o}.findMany()
* \`\`\`
*/
get ${o}(): Prisma.${n.model}Delegate<${i.join(", ")}>;`}).join(`
`),2)}
}`}toTS(){let r=this.buildClientOptions(),n=this.context.provider==="mongodb"?"runtime.ITXClientDenyList | '$transaction'":"runtime.ITXClientDenyList";return`${CIt(this.context)}
export type DefaultPrismaClient = PrismaClient
export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
${xe(it(r))}
${xe(jMe(this.context.dmmf))}
/* Types for Logging */
export type LogLevel = 'info' | 'query' | 'warn' | 'error'
export type LogDefinition = {
level: LogLevel
emit: 'stdout' | 'event'
}
export type CheckIsLogLevel<T> = T extends LogLevel ? T : never;
export type GetLogType<T> = CheckIsLogLevel<
T extends LogDefinition ? T['level'] : T
>;
export type GetEvents<T extends any[]> = T extends Array<LogLevel | LogDefinition>
? GetLogType<T[number]>
: never;
export type QueryEvent = {
timestamp: Date
query: string
params: string
duration: number
target: string
}
export type LogEvent = {
timestamp: Date
message: string
target: string
}
/* End Types for Logging */
export type PrismaAction =
| 'findUnique'
| 'findUniqueOrThrow'
| 'findMany'
| 'findFirst'
| 'findFirstOrThrow'
| 'create'
| 'createMany'
| 'createManyAndReturn'
| 'update'
| 'updateMany'
| 'updateManyAndReturn'
| 'upsert'
| 'delete'
| 'deleteMany'
| 'executeRaw'
| 'queryRaw'
| 'aggregate'
| 'count'
| 'runCommandRaw'
| 'findRaw'
| 'groupBy'
// tested in getLogLevel.test.ts
export function getLogLevel(log: Array<LogLevel | LogDefinition>): LogLevel | undefined;
/**
* \`PrismaClient\` proxy available in interactive transactions.
*/
export type TransactionClient = Omit<Prisma.DefaultPrismaClient, ${n}>
`}buildClientOptions(){let r=qp("PrismaClientOptions").add(de("errorFormat",V("ErrorFormat")).optional().setDocComment(qe('@default "colorless"'))).add(de("log",$e(Oe([V("LogLevel"),V("LogDefinition")]))).optional().setDocComment(qe`
@example
\`\`\`
// Shorthand for \`emit: 'stdout'\`
log: ['query', 'info', 'warn', 'error']
// Emit as events only
log: [
{ emit: 'event', level: 'query' },
{ emit: 'event', level: 'info' },
{ emit: 'event', level: 'warn' }
{ emit: 'event', level: 'error' }
]
// Emit as events and log to stdout
log: [
{ emit: 'stdout', level: 'query' },
{ emit: 'stdout', level: 'info' },
{ emit: 'stdout', level: 'warn' }
{ emit: 'stdout', level: 'error' }
]
\`\`\`
Read more in our [docs](https://pris.ly/d/logging).
`)),n=Me().add(de("maxWait",ur).optional()).add(de("timeout",ur).optional());return this.context.dmmf.hasEnumInNamespace("TransactionIsolationLevel","prisma")&&n.add(de("isolationLevel",V("Prisma.TransactionIsolationLevel")).optional()),r.add(de("transactionOptions",n).optional().setDocComment(qe`
The default values for transactionOptions
maxWait ?= 2000
timeout ?= 5000
`)),this.internalDatasources.some(o=>o.provider!=="mongodb")&&r.add(de("adapter",V("runtime.SqlDriverAdapterFactory")).optional().setDocComment(qe("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`"))),r.add(de("accelerateUrl",Yn).optional().setDocComment(qe("Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database."))),r.add(de("omit",V("Prisma.GlobalOmitConfig")).optional().setDocComment(qe`
Global configuration for omitting model fields by default.
@example
\`\`\`
const prisma = new PrismaClient({
omit: {
user: {
password: true
}
}
})
\`\`\`
`)),this.context.isSqlProvider()&&r.add(de("comments",$e(V("runtime.SqlCommenterPlugin"))).optional().setDocComment(qe`
SQL commenter plugins that add metadata to SQL queries as comments.
Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
@example
\`\`\`
const prisma = new PrismaClient({
adapter,
comments: [
traceContext(),
queryInsights(),
],
})
\`\`\`
`)),r}};var Vh=class{constructor(r){this.options=r;this.dmmf=new t$(r.dmmf),this.genericsInfo=new r$(this.dmmf)}dmmf;genericsInfo;buildParamGraphConfig(){let r=l2(this.options.dmmf);return`config.parameterizationSchema = {
strings: JSON.parse(${JSON.stringify(JSON.stringify(r.strings))}),
graph: "${r.graph}"
}`}toJS(){let{edge:r,wasm:n,generator:o,datamodel:i,runtimeName:a,reusedJs:c,compilerBuild:u}=this.options;if(c)return`module.exports = { ...require('${c}') }`;let l={previewFeatures:o.previewFeatures,clientVersion:this.options.clientVersion,engineVersion:this.options.engineVersion,activeProvider:this.options.activeProvider,inlineSchema:i};return`${VJ({...this.options,browser:!1})}
${MMe(r)}
/**
* Enums
*/
${this.dmmf.schema.enumTypes.prisma?.map(f=>new uu(f,!0).toJS()).join(`
`)}
${this.dmmf.datamodel.enums.map(f=>new uu(i2(f),!1).toJS()).join(`
`)}
${new uu({name:"ModelName",values:this.dmmf.mappings.modelOperations.map(f=>f.model)},!0).toJS()}
/**
* Create the Client
*/
const config = ${JSON.stringify(l,null,2)}
${IMe(this.dmmf.datamodel,a)}
${this.buildParamGraphConfig()}
${RMe(n,a,u)}
${FMe(r)}
const PrismaClient = getPrismaClient(config)
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)
`}toTS(){let{reusedTs:r}=this.options;if(r){let x=bl(`./${r}`);return xe(x)}let n=new i$({dmmf:this.dmmf,genericArgsInfo:this.genericsInfo,generator:this.options.generator,provider:this.options.activeProvider}),o=new s$(n,this.options.datasources,this.options.outputDir,this.options.runtimeName,this.options.browser),i=$Me(this.options),a=Object.values(this.dmmf.typeAndModelMap).reduce((x,b)=>(this.dmmf.outputTypeMap.model[b.name]&&x.push(new Q6(b,n)),x),[]),c=this.dmmf.schema.enumTypes.prisma?.map(x=>new uu(x,!0).toTS()),u=[],l=[];for(let x of this.dmmf.datamodel.enums)u.push(new uu(i2(x),!1).toTS()),l.push(xe(it(jt(x.name,V(`$Enums.${x.name}`)))),xe(it(lu(x.name,V(`typeof $Enums.${x.name}`)))));let p=this.dmmf.schema.fieldRefTypes.prisma?.map(x=>new o$(x).toTS())??[],f=this.dmmf.schema.outputObjectTypes.prisma?.filter(x=>x.name.endsWith("CountOutputType")).map(x=>new n$(x,n));return`
/**
* Client
**/
${i.tsWithoutNamespace()}
${a.map(x=>x.toTSWithoutNamespace()).join(`
`)}
${u.length>0?`
/**
* Enums
*/
export namespace $Enums {
${u.join(`
`)}
}
${l.join(`
`)}
`:""}
${o.toTSWithoutNamespace()}
export namespace Prisma {
${(0,UMe.default)(`${i.ts()}
${new uu({name:"ModelName",values:this.dmmf.mappings.modelOperations.map(x=>x.model)},!0).toTS()}
${o.toTS()}
export type Datasource = {
url?: string
}
/**
* Count Types
*/
${f.map(x=>x.toTS()).join(`
`)}
/**
* Models
*/
${a.map(x=>x.toTS()).join(`
`)}
/**
* Enums
*/
${c?.join(`
`)}
${p.length>0?`
/**
* Field references
*/
${p.join(`
`)}`:""}
/**
* Deep Input Types
*/
${this.dmmf.inputObjectTypes.prisma?.reduce((x,b)=>{if(b.name.includes("Json")&&b.name.includes("Filter")){let v=this.genericsInfo.typeNeedsGenericModelArg(b),S=v?`${b.name}Base<$PrismaModel>`:`${b.name}Base`,_=v?`${b.name}<$PrismaModel = never>`:b.name,D=`Required<${S}>`;x.push(`export type ${_} =
| PatchUndefined<
Either<${D}, Exclude<keyof ${D}, 'path'>>,
${D}
>
| OptionalFlat<Omit<${D}, 'path'>>`),x.push(new bd(b,n).overrideName(`${b.name}Base`).toTS())}else x.push(new bd(b,n).toTS());return x},[]).join(`
`)}
${this.dmmf.inputObjectTypes.model?.map(x=>new bd(x,n).toTS()).join(`
`)??""}
/**
* Batch Payload for updateMany & deleteMany & createMany
*/
export type BatchPayload = {
count: number
}
/**
* DMMF
*/
export const dmmf: runtime.BaseDMMF
`,2)}}`}toBrowserJS(){return`${VJ({...this.options,runtimeName:"index-browser",browser:!0})}
/**
* Enums
*/
${this.dmmf.schema.enumTypes.prisma?.map(n=>new uu(n,!0).toJS()).join(`
`)}
${this.dmmf.schema.enumTypes.model?.map(n=>new uu(n,!1).toJS()).join(`
`)??""}
${new uu({name:"ModelName",values:this.dmmf.mappings.modelOperations.map(n=>n.model)},!0).toJS()}
/**
* This is a stub Prisma Client that will error at runtime if called.
*/
class PrismaClient {
constructor() {
return new Proxy(this, {
get(target, prop) {
let message
const runtime = getRuntime()
if (runtime.isEdge) {
message = \`PrismaClient is not configured to run in \${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
\`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime.prettyName + '\`).'
}
message += \`
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report\`
throw new Error(message)
}
})
}
}
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)
`}};var a$=class{enums;constructor(r){this.enums=r.map(n=>({name:n.dbName??n.name,values:n.values.map(o=>o.dbName??o.name)}))}isEmpty(){return this.enums.length===0}hasEnum(r){return!!this.enums.find(n=>n.name===r)}*validJsIdentifiers(){for(let r of this.enums)gc(r.name)&&(yield r)}*invalidJsIdentifiers(){for(let r of this.enums)gc(r.name)||(yield r)}};function qMe(e){let r=pu();return r.add(NIt(e)),r.add($It(e)),xe(r)}function $It(e){let r=UE("$DbEnums");for(let n of e.validJsIdentifiers())r.add(jt(n.name,GMe(n)));return it(r)}function NIt(e){let r=qp("$DbEnums");for(let n of e.invalidJsIdentifiers())r.add(de(n.name,GMe(n)));return it(r)}function GMe(e){return Oe(e.values.map(Mt))}function HMe(e,r){return r.isEmpty()?!1:e.parameters.some(n=>r.hasEnum(n.typ))||e.resultColumns.some(n=>r.hasEnum(n.typ))}function WMe(e,r){let n=pu();r.isEmpty()||n.add(bl("./$DbEnums").named("$DbEnums"));for(let o of e)n.add(bl(`./${o.name}`));return xe(n)}function KJ(e,r){let n=new Gp(0,void 0);n.writeLine('"use strict"');for(let{name:o}of e){let i=r?`${o}.${r}`:o;n.writeLine(`exports.${o} = require("./${i}.js").${o}`)}return n.toString()}function JJ(e,r){let n=new Gp(0,void 0);for(let{name:o}of e){let i=r?`${o}.${r}`:o;n.writeLine(`export * from "./${i}.mjs"`)}return n.toString()}var YJ=V("$runtime.Decimal"),VMe=V("$runtime.Bytes"),JE=V("Date"),zMe=V("$runtime.InputJsonObject"),KMe=V("$runtime.JsonValue"),JMe=Oe([ur,qh]),YMe=Oe([ur,YJ]),LIt={unknown:Gh,string:Yn,int:ur,bigint:{in:JMe,out:qh},decimal:{in:YMe,out:YJ},float:ur,double:ur,enum:Yn,bytes:VMe,bool:jp,char:Yn,json:{in:zMe,out:KMe},xml:Yn,uuid:Yn,date:JE,datetime:JE,time:JE,null:Rt,"int-array":$e(ur),"string-array":$e(Yn),"json-array":{in:$e(zMe),out:$e(KMe)},"uuid-array":$e(Yn),"xml-array":$e(Yn),"bigint-array":{in:$e(JMe),out:$e(qh)},"float-array":$e(ur),"double-array":$e(ur),"char-array":$e(Yn),"bytes-array":$e(VMe),"bool-array":$e(jp),"date-array":$e(JE),"time-array":$e(JE),"datetime-array":$e(JE),"decimal-array":{in:$e(YMe),out:$e(YJ)}};function ZMe(e,r,n){let o=XMe(e,n).in;return r?new Hp(o).addVariant(Rt):o}function QMe(e,r,n){let o=XMe(e,n).out;return r?new Hp(o).addVariant(Rt):o}function XMe(e,r){let n=LIt[e];if(!n){if(r.hasEnum(e)){let o=BIt(e);return{in:o,out:o}}throw new Error("Unknown type")}return n instanceof Dr?{in:n,out:n}:n}function BIt(e){return gc(e)?V(`$DbEnums.${e}`):V("$DbEnums").subKey(e)}function eke({query:e,runtimeBase:r,runtimeName:n,enums:o}){let i=pu();i.addImport(un(`${r}/${n}`).asNamespace("$runtime")),HMe(e,o)&&i.addImport(un("./$DbEnums").named("$DbEnums"));let a=qe(e.documentation??void 0),c=Ca(),u=M6();for(let p of e.parameters){let f=ZMe(p.typ,p.nullable,o);c.addParameter(lr(p.name,f)),u.add(k6(f).setName(p.name)),p.documentation?a.addText(`@param ${p.name} ${p.documentation}`):a.addText(`@param ${p.name}`)}c.setReturnType(V("$runtime.TypedSql").addGenericArgument(V(`${e.name}.Parameters`)).addGenericArgument(V(`${e.name}.Result`))),i.add(it(lu(e.name,c)).setDocComment(a));let l=UE(e.name);return l.add(it(jt("Parameters",u))),l.add(jIt(e,o)),i.add(it(l)),xe(i)}function jIt(e,r){let n=Me().addMultiple(e.resultColumns.map(o=>de(o.name,QMe(o.typ,o.nullable,r))));return it(jt("Result",n))}function ZJ({query:e,runtimeBase:r,runtimeName:n}){let o=new Gp(0,void 0);return o.writeLine('"use strict"'),o.writeLine(`const { makeTypedQueryFactory: $mkFactory } = require("${r}/${n}")`),o.writeLine(`exports.${e.name} = /*#__PURE__*/ $mkFactory(${JSON.stringify(e.source)})`),o.toString()}function QJ({query:e,runtimeBase:r,runtimeName:n}){let o=new Gp(0,void 0);return o.writeLine(`import { makeTypedQueryFactory as $mkFactory } from "${r}/${n}"`),o.writeLine(`export const ${e.name} = /*#__PURE__*/ $mkFactory(${JSON.stringify(e.source)})`),o.toString()}function tke({queries:e,runtimeBase:r,edgeRuntimeName:n,mainRuntimeName:o,dmmf:i}){let a={},c=new a$(i.datamodel.enums);c.isEmpty()||(a["$DbEnums.d.ts"]=qMe(c));for(let u of e){let l={query:u,runtimeBase:r,runtimeName:o,enums:c},p={...l,runtimeName:`${n}.js`};a[`${u.name}.d.ts`]=eke(l),a[`${u.name}.js`]=ZJ(l),a[`${u
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
`;function XJ(e){for(let[r,n]of Object.entries(e))typeof n=="string"&&(r.endsWith(".js")||r.endsWith(".mjs"))?e[r]=eY(n):typeof n=="object"&&n!==null&&XJ(n)}function eY(e){return UIt+e}var c$=class extends Error{constructor(r){super(r),this.stack=void 0}};rs(c$,"DenylistError");async function qIt({schemaPath:e,runtimeBase:r,runtimeSourcePath:n,datamodel:o,binaryPaths:i,outputDir:a,generator:c,dmmf:u,datasources:l,engineVersion:p,clientVersion:f,activeProvider:g,typedSql:x,compilerBuild:b}){let v={dmmf:iMe(u),datasources:l,generator:c,binaryPaths:i,schemaPath:e,outputDir:a,runtimeBase:r,runtimeSourcePath:n,clientVersion:f,engineVersion:p,activeProvider:g,datamodel:o,compilerBuild:b,browser:!1,edge:!1,wasm:!1},S={...v,runtimeName:"client"},_=new Vh(S),D=new Vh({...S,reusedTs:"index",reusedJs:"."}),P=new Vh({...S,reusedTs:"index",reusedJs:"#main-entry-point"}),C={node:"./index.js","edge-light":"./edge.js",workerd:"./edge.js",worker:"./edge.js",browser:"./index-browser.js",default:"./index.js"},O={require:C,import:C,default:C.default},I={name:ZIt(o),main:"index.js",types:"index.d.ts",browser:"index-browser.js",exports:{"./client":O,...BE.exports,".":O},version:f,sideEffects:!1,dependencies:{"@prisma/client-runtime-utils":f}},k={};k["index.js"]=Ly(_),k["index.d.ts"]=By(_),k["default.js"]=Ly(D),k["default.d.ts"]=By(D),k["index-browser.js"]=zK(_),k["client.js"]=Ly(D),k["client.d.ts"]=By(D),k["default.js"]=Ly(P),k["default.d.ts"]=By(P);let j=`query_compiler_${b}_bg`;k["wasm-worker-loader.mjs"]=`export default import('./${j}.wasm')`,k["wasm-edge-light-loader.mjs"]=`export default import('./${j}.wasm?module')`,I.browser="default.js",I.imports={"#wasm-compiler-loader":{"edge-light":"./wasm-edge-light-loader.mjs",workerd:"./wasm-worker-loader.mjs",worker:"./wasm-worker-loader.mjs",default:"./wasm-worker-loader.mjs"},"#main-entry-point":O};let G=new Vh({...v,runtimeName:"wasm-compiler-edge",reusedTs:"default",edge:!0,wasm:!0});if(k["edge.js"]=Ly(G),k["edge.d.ts"]=By(G),x&&x.length>0){let B="wasm-compiler-edge",H=`./sql/index.${B}.js`,N=`./sql/index.${B}.mjs`;I.exports["./sql"]={require:{types:"./sql/index.d.ts","edge-light":H,workerd:H,worker:H,node:"./sql/index.js",default:"./sql/index.js"},import:{types:"./sql/index.d.ts","edge-light":N,workerd:N,worker:N,node:"./sql/index.mjs",default:"./sql/index.mjs"},default:"./sql/index.js"},k.sql=tke({dmmf:u,runtimeBase:GIt(r),mainRuntimeName:"client",queries:x,edgeRuntimeName:B})}return k["package.json"]=JSON.stringify(I,null,2),XJ(k),{fileMap:k,prismaClientDmmf:u}}function GIt(e){return e.startsWith(".")?e.startsWith("./")?`.${e}`:`../${e}`:e}function HIt(e){return e.endsWith(ci.default.normalize("node_modules/@prisma/client"))?ci.default.join(e,"../../.prisma/client"):ci.default.join(e,"../../.prisma/client")}async function oke(e){let{datamodel:r,schemaPath:n,generator:o,dmmf:i,datasources:a,binaryPaths:c,testMode:u,copyRuntime:l,copyRuntimeSourceMaps:p=!1,runtimeSourcePath:f,clientVersion:g,engineVersion:x,activeProvider:b,typedSql:v,compilerBuild:S}=e,{runtimeBase:_,outputDir:D}=await zIt(e),{prismaClientDmmf:P,fileMap:C}=await qIt({datamodel:r,schemaPath:n,runtimeBase:_,runtimeSourcePath:f,outputDir:D,generator:o,dmmf:i,datasources:a,binaryPaths:c,clientVersion:g,engineVersion:x,activeProvider:b,testMode:u,typedSql:v,compilerBuild:S}),O=a[0].provider,I=VIt(P);if(I){let j=`${q(he("Error: "))}The schema at "${n}" contains reserved keywords.
Rename the following items:`;for(let G of I)j+=`
- `+G.message;throw j+=`
To learn more about how to rename models, check out https://pris.ly/d/naming-models`,new c$(j)}if(await(0,rY.ensureDir)(D),await ike(D,C),l||o.isCustomOutput===!0){let j=ci.default.join(D,"runtime");await(0,rY.ensureDir)(j),await YIt({from:f,to:j,sourceMaps:p,runtimeName:"client"})}let k=ci.default.join(D,"schema.prisma");if(await Pa.default.writeFile(k,r,{encoding:"utf-8"}),WIt(O)){let j=O==="postgres"?"postgresql":O,G=`query_compiler_${S}_bg`,B=ci.default.join(f,`${G}.${j}.wasm-base64.js`),H=require(B).wasm;await Pa.default.writeFile(ci.default.join(D,`${G}.wasm`),Buffer.from(H,"base64")),await Pa.default.copyFile(ci.default.join(f,`${G}.${j}.js`),ci.default.join(D,`${G}.js`)),await Pa.default.copyFile(B,ci.default.join(D,`${G}.wasm-base64.js`))}try{let j=(0,nke.default)("prisma").cache,G=ci.default.join(j,"last-generate");await Pa.default.mkdir(j,{recursive:!0}),await Pa.default.writeFile(G,Date.now().toString())}catch{}}function ike(e,r){return Promise.all(Object.entries(r).map(async([n,o])=>{let i=ci.default.join(e,n);await Pa.default.rm(i,{recursive:!0,force:!0}),typeof o=="string"?await Pa.default.writeFile(i,o):(await Pa.default.mkdir(i),await ike(i,o))}))}function WIt(e){return e==="postgresql"||e==="postgres"||e==="cockroachdb"||e==="mysql"||e==="sqlite"||e==="sqlserver"}function VIt(e){let r=[],n={models:["PrismaClient","Prisma","async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","super","switch","this","throw","true","try","using","typeof","var","void","while","with","yield"],fields:["AND","OR","NOT"],dynamic:[]};if(e.datamodel.enums)for(let o of e.datamodel.enums)(n.models.includes(o.name)||n.fields.includes(o.name))&&r.push(Error(`"enum ${o.name}"`));if(e.datamodel.models)for(let o of e.datamodel.models)(n.models.includes(o.name)||n.fields.includes(o.name))&&r.push(Error(`"model ${o.name}"`));return r.length>0?r:null}async function zIt({runtimeBase:e,generator:r,outputDir:n,datamodel:o,schemaPath:i,testMode:a}){let c=r.isCustomOutput===!0,u=ci.default.normalize(n),l=c?"./runtime":"@prisma/client/runtime",p=c?u:HIt(u);a&&e&&(p=n,l=Np(e)),c&&await KIt(p,o,i);let f=await kE({cwd:ci.default.dirname(p)}),g=f?ci.default.dirname(f):process.cwd();return{runtimeBase:l,outputDir:p,projectRoot:g}}async function KIt(e,r,n){let o;try{o=await Pa.default.readFile(ci.default.join(e,"package.json"),"utf8")}catch(a){if(a.code==="ENOENT")return;throw a}let{name:i}=JSON.parse(o);if(i===BE.name){let a=[`Generating client into ${q(e)} is not allowed.`];a.push("This package is used by `prisma generate` and overwriting its content is dangerous."),a.push(""),a.push("Suggestion:");let c=JIt(r);if(c&&c.content.includes(BE.name)){let l=c.content;a.push(`In ${q(n)} replace:`),a.push(""),a.push(`${ae(c.lineNumber)} ${tY(l,he(BE.name))}`),a.push("with"),a.push(`${ae(c.lineNumber)} ${tY(l,me(".prisma/client"))}`)}else a.push(`Generate client into ${q(tY(e,me(".prisma/client")))} instead`);throw a.push(""),a.push("You won't need to change your imports."),a.push("Imports from `@prisma/client` will be automatically forwarded to `.prisma/client`"),new Error(a.join(`
`))}}function tY(e,r){return e.replace(BE.name,r)}function JIt(e){let r=e.split(/\r?\n/);for(let[n,o]of r.entries())if(/output\s*=/.test(o))return{lineNumber:n+1,content:o.trim()};return null}async function YIt({from:e,to:r,runtimeName:n,sourceMaps:o}){let i=["index-browser.js","index-browser.d.ts","wasm-compiler-edge.js"];i.push(`${n}.js`),i.push(`${n}.d.ts`),o&&i.push(...i.filter(a=>a.endsWith(".js")).map(a=>`${a}.map`)),await Promise.all(i.map(async a=>{let c=ci.default.join(e,a),u=ci.default.join(r,a);if(a.endsWith(".js")){let l=await Pa.default.readFile(c,"utf-8");await Pa.default.writeFile(u,eY(l))}else await Pa.default.copyFile(c,u)}))}function ZIt(e){let r=(0,rke.createHash)("sha256");return r.write(e),`${QIt}${r.digest().toString("hex")}`}var QIt="prisma-client-";var cZ=W(require("node:path")),p$e=W(nY());var oY="7.5.0";var u$e=W(require("node:fs/promises")),sZ=W(require("node:path"));var wl=W(require("node:fs"),1),Ko=W(require("node:path"),1),ui=W(require("node:process"),1),i6e=require("node:buffer"),h2=W(require("node:child_process"),1),s6e=W(require("child_process"),1),b2=W(require("path"),1),ow=W(require("fs"),1),v2=W(require("node:url"),1),iw=W(require("node:os"),1),a6e=require("node:timers/promises"),c6e=W(require("stream"),1),u6e=require("node:util"),l6e=W(require("os"),1),p6e=W(require("tty"),1),f6e=W(require("readline"),1),d6e=W(require("events"),1),KY=W(require("fs/promises"),1);function ake(e){return r=>r.length>1?`${e} run ${r[0]} -- ${r.slice(1).join(" ")}`:`${e} run ${r[0]}`}var cke={agent:"yarn {0}",run:"yarn run {0}",install:"yarn install {0}",frozen:"yarn install --frozen-lockfile",global:"yarn global add {0}",add:"yarn add {0}",upgrade:"yarn upgrade {0}","upgrade-interactive":"yarn upgrade-interactive {0}",execute:"npx {0}",uninstall:"yarn remove {0}",global_uninstall:"yarn global remove {0}"},uke={agent:"pnpm {0}",run:"pnpm run {0}",install:"pnpm i {0}",frozen:"pnpm i --frozen-lockfile",global:"pnpm add -g {0}",add:"pnpm add {0}",upgrade:"pnpm update {0}","upgrade-interactive":"pnpm update -i {0}",execute:"pnpm dlx {0}",uninstall:"pnpm remove {0}",global_uninstall:"pnpm remove --global {0}"},tRt={agent:"bun {0}",run:"bun run {0}",install:"bun install {0}",frozen:"bun install --no-save",global:"bun add -g {0}",add:"bun add {0}",upgrade:"bun update {0}","upgrade-interactive":"bun update {0}",execute:"bunx {0}",uninstall:"bun remove {0}",global_uninstall:"bun remove -g {0}"},g2={npm:{agent:"npm {0}",run:ake("npm"),install:"npm i {0}",frozen:"npm ci",global:"npm i -g {0}",add:"npm i {0}",upgrade:"npm update {0}","upgrade-interactive":null,execute:"npx {0}",uninstall:"npm uninstall {0}",global_uninstall:"npm uninstall -g {0}"},yarn:cke,"yarn@berry":{...cke,frozen:"yarn install --immutable",upgrade:"yarn up {0}","upgrade-interactive":"yarn up -i {0}",execute:"yarn dlx {0}",global:"npm i -g {0}",global_uninstall:"npm uninstall -g {0}"},pnpm:uke,"pnpm@6":{...uke,run:ake("pnpm")},bun:tRt},rRt=Object.keys(g2),wY={"bun.lockb":"bun","pnpm-lock.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},m6e={bun:"https://bun.sh",pnpm:"https://pnpm.io/installation","pnpm@6":"https://pnpm.io/6.x/installation",yarn:"https://classic.yarnpkg.com/en/docs/install","yarn@berry":"https://yarnpkg.com/getting-started/install",npm:"https://docs.npmjs.com/cli/v8/configuring-npm/install"},Td=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function E2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var{hasOwnProperty:nMr}=Object.prototype;var sw={exports:{}},iY,lke;function nRt(){if(lke)return iY;lke=1,iY=o,o.sync=i;var e=ow.default;function r(a,c){var u=c.pathExt!==void 0?c.pathExt:process.env.PATHEXT;if(!u||(u=u.split(";"),u.indexOf("")!==-1))return!0;for(var l=0;l<u.length;l++){var p=u[l].toLowerCase();if(p&&a.substr(-p.length).toLowerCase()===p)return!0}return!1}function n(a,c,u){return!a.isSymbolicLink()&&!a.isFile()?!1:r(c,u)}function o(a,c,u){e.stat(a,function(l,p){u(l,l?!1:n(p,a,c))})}fu
`:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===r&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}function _6e(e={}){let{env:r=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(r).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"}function BRt(e={}){let{cwd:r=ui.default.cwd(),path:n=ui.default.env[_6e()],execPath:o=ui.default.execPath}=e,i,a=r instanceof URL?v2.default.fileURLToPath(r):r,c=Ko.default.resolve(a),u=[];for(;i!==c;)u.push(Ko.default.join(c,"node_modules/.bin")),i=c,c=Ko.default.resolve(c,"..");return u.push(Ko.default.resolve(a,o,"..")),[...u,n].join(Ko.default.delimiter)}function jRt({env:e=ui.default.env,...r}={}){e={...e};let n=_6e({env:e});return r.path=e[n],e[n]=BRt(r),e}var URt=(e,r,n,o)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(r,n);!qRt(i,a)&&o||Object.defineProperty(e,n,a)},qRt=function(e,r){return e===void 0||e.configurable||e.writable===r.writable&&e.enumerable===r.enumerable&&e.configurable===r.configurable&&(e.writable||e.value===r.value)},GRt=(e,r)=>{let n=Object.getPrototypeOf(r);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},HRt=(e,r)=>`/* Wrapped ${e}*/
${r}`,WRt=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),VRt=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),zRt=(e,r,n)=>{let o=n===""?"":`with ${n.trim()}() `,i=HRt.bind(null,o,r.toString());Object.defineProperty(i,"name",VRt),Object.defineProperty(e,"toString",{...WRt,value:i})};function KRt(e,r,{ignoreNonConfigurable:n=!1}={}){let{name:o}=e;for(let i of Reflect.ownKeys(r))URt(e,r,i,n);return GRt(e,r),zRt(e,r,o),e}var E$=new WeakMap,T6e=(e,r={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,o=0,i=e.displayName||e.name||"<anonymous>",a=function(...c){if(E$.set(a,++o),o===1)n=e.apply(this,c),e=null;else if(r.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return KRt(a,e),E$.set(a,o),a};T6e.callCount=e=>{if(!E$.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return E$.get(e)};var JRt=()=>{let e=C6e-D6e+1;return Array.from({length:e},YRt)},YRt=(e,r)=>({name:`SIGRT${r+1}`,number:D6e+r,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),D6e=34,C6e=64,ZRt=[{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",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",sta
${o.message}`:_,C=[P,r,e].filter(Boolean).join(`
`);return D?(o.originalMessage=o.message,o.message=C):o=new Error(C),o.shortMessage=P,o.command=c,o.escapedCommand=u,o.exitCode=a,o.signal=i,o.signalDescription=b,o.stdout=e,o.stderr=r,o.cwd=x,n!==void 0&&(o.all=n),"bufferedData"in o&&delete o.bufferedData,o.failed=!0,o.timedOut=!!l,o.isCanceled=p,o.killed=f&&!l,o},x$=["stdin","stdout","stderr"],sMt=e=>x$.some(r=>e[r]!==void 0),aMt=e=>{if(!e)return;let{stdio:r}=e;if(r===void 0)return x$.map(o=>e[o]);if(sMt(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${x$.map(o=>`\`${o}\``).join(", ")}`);if(typeof r=="string")return r;if(!Array.isArray(r))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof r}\``);let n=Math.max(r.length,x$.length);return Array.from({length:n},(o,i)=>r[i])},ew=[];ew.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ew.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ew.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var b$=e=>!!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",cY=Symbol.for("signal-exit emitter"),uY=globalThis,cMt=Object.defineProperty.bind(Object),_Y=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(uY[cY])return uY[cY];cMt(uY,cY,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(r,n){this.listeners[r].push(n)}removeListener(r,n){let o=this.listeners[r],i=o.indexOf(n);i!==-1&&(i===0&&o.length===1?o.length=0:o.splice(i,1))}emit(r,n,o){if(this.emitted[r])return!1;this.emitted[r]=!0;let i=!1;for(let a of this.listeners[r])i=a(n,o)===!0||i;return r==="exit"&&(i=this.emit("afterExit",n,o)||i),i}},w$=class{},uMt=e=>({onExit(r,n){return e.onExit(r,n)},load(){return e.load()},unload(){return e.unload()}}),TY=class extends w${onExit(){return()=>{}}load(){}unload(){}},DY=class extends w${#e=CY.platform==="win32"?"SIGINT":"SIGHUP";#t=new _Y;#r;#o;#i;#n={};#s=!1;constructor(r){super(),this.#r=r,this.#n={};for(let n of ew)this.#n[n]=()=>{let o=this.#r.listeners(n),{count:i}=this.#t,a=r;if(typeof a.__signal_exit_emitter__=="object"&&typeof a.__signal_exit_emitter__.count=="number"&&(i+=a.__signal_exit_emitter__.count),o.length===i){this.unload();let c=this.#t.emit("exit",null,n),u=n==="SIGHUP"?this.#e:n;c||r.kill(r.pid,u)}};this.#i=r.reallyExit,this.#o=r.emit}onExit(r,n){if(!b$(this.#r))return()=>{};this.#s===!1&&this.load();let o=n?.alwaysLast?"afterExit":"exit";return this.#t.on(o,r),()=>{this.#t.removeListener(o,r),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#t.count+=1;for(let r of ew)try{let n=this.#n[r];n&&this.#r.on(r,n)}catch{}this.#r.emit=(r,...n)=>this.#c(r,...n),this.#r.reallyExit=r=>this.#a(r)}}unload(){this.#s&&(this.#s=!1,ew.forEach(r=>{let n=this.#n[r];if(!n)throw new Error("Listener not defined for signal: "+r);try{this.#r.removeListener(r,n)}catch{}}),this.#r.emit=this.#o,this.#r.reallyExit=this.#i,this.#t.count-=1)}#a(r){return b$(this.#r)?(this.#r.exitCode=r||0,this.#t.emit("exit",this.#r.exitCode,null),this.#i.call(this.#r,this.#r.exitCode)):0}#c(r,...n){let o=this.#o;if(r==="exit"&&b$(this.#r)){typeof n[0]=="number"&&(this.#r.exitCode=n[0]);let i=o.call(this.#r,r,...n);return this.#t.emit("exit",this.#r.exitCode,null),i}else return o.call(this.#r,r,...n)}},CY=globalThis.process,{onExit:lMt,load:oMr,unload:iMr}=uMt(b$(CY)?new DY(CY):new TY),pMt=1e3*5,fMt=(e,r="SIGTERM",n={})=>{let o=e(r);return dMt(e,r,n,o),o},dMt=(e,r,n,o)=>{if(!mMt(r,n,o))return;let i=gMt(n),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},mMt=(e,{forceKillAfterTimeout:r},n)=>hMt(e)&&r!==!1&&n,hMt=e=>e===iw.default.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",gMt=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return pMt;if(!Number.isF
`)},dkt=1e3*1e3*100,mkt=({env:e,extendEnv:r,preferLocal:n,localDir:o,execPath:i})=>{let a=r?{...ui.default.env,...e}:e;return n?jRt({env:a,cwd:o,execPath:i}):a},hkt=(e,r,n={})=>{let o=NRt._parse(e,r,n);return e=o.command,r=o.args,n=o.options,n={maxBuffer:dkt,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||ui.default.cwd(),execPath:ui.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:lkt,...n},n.env=mkt(n),n.stdio=aMt(n),ui.default.platform==="win32"&&Ko.default.basename(e,".exe")==="cmd"&&r.unshift("/q"),{file:e,args:r,options:n,parsed:o}},dY=(e,r,n)=>typeof r!="string"&&!i6e.Buffer.isBuffer(r)?n===void 0?void 0:"":e.stripFinalNewline?LRt(r):r;function gkt(e,r,n){let o=hkt(e,r,n),i=skt(e,r),a=akt(e,r);fkt(a,o.options),vMt(o.options);let c;try{c=h2.default.spawn(o.file,o.args,o.options)}catch(b){let v=new h2.default.ChildProcess,S=Promise.reject(gke({error:b,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:o,timedOut:!1,isCanceled:!1,killed:!1}));return _ke(v,S),v}let u=nkt(c),l=bMt(c,o.options,u),p=EMt(c,o.options,l),f={isCanceled:!1};c.kill=fMt.bind(null,c.kill.bind(c)),c.cancel=yMt.bind(null,c,f);let x=T6e(async()=>{let[{error:b,exitCode:v,signal:S,timedOut:_},D,P,C]=await ekt(c,o.options,p),O=dY(o.options,D),I=dY(o.options,P),k=dY(o.options,C);if(b||v!==0||S!==null){let j=gke({error:b,exitCode:v,signal:S,stdout:O,stderr:I,all:k,command:i,escapedCommand:a,parsed:o,timedOut:_,isCanceled:o.options.signal?o.options.signal.aborted:!1,killed:c.killed});if(!o.options.reject)return j;throw j}return{command:i,escapedCommand:a,exitCode:0,stdout:O,stderr:I,all:k,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return ZMt(c,o.options),c.all=QMt(c,o.options),SMt(c),_ke(c,x),c}function ykt(e,r){let[n,...o]=ukt(e);return gkt(n,o,r)}var PY=class{value;next;constructor(r){this.value=r}},OY=class{#e;#t;#r;constructor(){this.clear()}enqueue(r){let n=new PY(r);this.#e?(this.#t.next=n,this.#t=n):(this.#e=n,this.#t=n),this.#r++}dequeue(){let r=this.#e;if(r)return this.#e=this.#e.next,this.#r--,r.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let r=this.#e;for(;r;)yield r.value,r=r.next}};function Tke(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let r=new OY,n=0,o=()=>{n--,r.size>0&&r.dequeue()()},i=async(u,l,p)=>{n++;let f=(async()=>u(...p))();l(f);try{await f}catch{}o()},a=(u,l,p)=>{r.enqueue(i.bind(void 0,u,l,p)),(async()=>(await Promise.resolve(),n<e&&r.size>0&&r.dequeue()()))()},c=(u,...l)=>new Promise(p=>{a(u,p,l)});return Object.defineProperties(c,{activeCount:{get:()=>n},pendingCount:{get:()=>r.size},clearQueue:{value:()=>{r.clear()}}}),c}var S$=class extends Error{constructor(r){super(),this.value=r}},xkt=async(e,r)=>r(await e),bkt=async e=>{let r=await Promise.all(e);if(r[1]===!0)throw new S$(r[0]);return!1};async function vkt(e,r,{concurrency:n=Number.POSITIVE_INFINITY,preserveOrder:o=!0}={}){let i=Tke(n),a=[...e].map(u=>[u,i(xkt,u,r)]),c=Tke(o?1:Number.POSITIVE_INFINITY);try{await Promise.all(a.map(u=>c(bkt,u)))}catch(u){if(u instanceof S$)return u.value;throw u}}var L6e={directory:"isDirectory",file:"isFile"};function Ekt(e){if(!Object.hasOwnProperty.call(L6e,e))throw new Error(`Invalid type specified: ${e}`)}var wkt=(e,r)=>r[L6e[e]](),Skt=e=>e instanceof URL?(0,v2.fileURLToPath)(e):e;async function Dke(e,{cwd:r=ui.default.cwd(),type:n="file",allowSymlinks:o=!0,concurrency:i,preserveOrder:a}={}){Ekt(n),r=Skt(r);let c=o?wl.promises.stat:wl.promises.lstat;return vkt(e,async u=>{try{let l=await c(Ko.default.resolve(r,u));return wkt(n,l)}catch{return!1}},{concurrency:i,preserveOrder:a})}var _kt=e=>e instanceof URL?(0,v2.fileURLToPath)(e):e,Tkt=Symbol("findUpStop");async function Dkt(e,r={}){let n=Ko.default.resolve(_kt(r.cwd)||""),{root:o}=Ko.default.parse(n),i=Ko.default.resolve(n,r.stopAt||o),a=r.limit||Number.POSITIVE_INFINITY,c=[e].flat(),u=async p=>{if(typeof e!="function")return Dke(c,p);let f=await e(p.cw
`)).join(`
`)},Zkt=(e,r,n)=>{n=n||r;let o=Math.min(r-n,e-Math.floor(n/2));o<0&&(o=0);let i=Math.min(o+n,r);return{startIndex:o,endIndex:i}},zp={action:Rkt,clear:jkt,style:zkt,strip:nZ,figures:V6e,lines:Jkt,wrap:Ykt,entriesToDisplay:Zkt},Ike=f6e.default,{action:Qkt}=zp,Xkt=d6e.default,{beep:e6t,cursor:t6t}=_l,r6t=Sl,n6t=class extends Xkt{constructor(r={}){super(),this.firstRender=!0,this.in=r.stdin||process.stdin,this.out=r.stdout||process.stdout,this.onRender=(r.onRender||(()=>{})).bind(this);let n=Ike.createInterface({input:this.in,escapeCodeTimeout:50});Ike.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);let o=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(a,c)=>{let u=Qkt(c,o);u===!1?this._&&this._(a,c):typeof this[u]=="function"?this[u](c):this.bell()};this.close=()=>{this.out.write(t6t.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),n.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(e6t)}render(){this.onRender(r6t),this.firstRender&&(this.firstRender=!1)}},Yh=n6t,d$=Sl,o6t=Yh,{erase:i6t,cursor:p2}=_l,{style:hY,clear:gY,lines:s6t,figures:a6t}=zp,NY=class extends o6t{constructor(r={}){super(r),this.transform=hY.render(r.style),this.scale=this.transform.scale,this.msg=r.message,this.initial=r.initial||"",this.validator=r.validate||(()=>!0),this.value="",this.errorMsg=r.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=gY("",this.out.columns),this.render()}set value(r){!r&&this.initial?(this.placeholder=!0,this.rendered=d$.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(r)),this._value=r,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(r){this.placeholder||(this.cursor=this.cursor+r,this.cursorOffset+=r)}_(r,n){let o=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${o}${r}${i}`,this.red=!1,this.cursor=this.placeholder?0:o.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let r=this.value.slice(0,this.cursor-1),n=this.value.slice(this.cursor);this.value=`${r}${n}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor+1);this.value=`${r}${n}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(p2.down(s6t(this.outputError,this.out.columns)-1)+gY(this.outputError,this.out.columns)),this.out.write(gY(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[hY.symbol(this.done,this.aborted),d$.bold(this.msg),hY.delimiter(this.done),this.red?d$.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((r,n,o)=>r+`
${o?" ":a6t.pointerSmall} ${d$.red().italic(n)}`,"")),this.out.write(i6t.line+p2.to(0)+this.outputText+p2.save+this.outputError+p2.restore+p2.move(this.cursorOffset,0)))}},c6t=NY,Sd=Sl,u6t=Yh,{style:Rke,clear:Mke,figures:m$,wrap:l6t,entriesToDisplay:p6t}=zp,{cursor:f6t}=_l,LY=class extends u6t{constructor(r={}){super(r),this.msg=r.message,this.hint=r.hint||"- Use arrow-keys. Return to submit.",this.warn=r.warn||"- This option is disabled",this.cursor=r.initial||0,this.choices=r.choices.map((n,o)=>(typeof n=="string"&&(n={title:n,value:o}),{title:n&&(n.title||n.value||n),value:n&&(n.value===void 0?o:n.value),description:n&&n.description,selected:n&&n.selected,disabled:n&&n.disabled})),this.optionsPerPage=r.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Mke("",this.out.columns),this.render()}moveCursor(r){this.cursor=r,this.value=this.choices[r].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(r,n){if(r===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(f6t.hide):this.out.write(Mke(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=p6t(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Rke.symbol(this.done,this.aborted),Sd.bold(this.msg),Rke.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Sd.yellow(this.warn):Sd.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let o=r;o<n;o++){let i,a,c="",u=this.choices[o];o===r&&r>0?a=m$.arrowUp:o===n-1&&n<this.choices.length?a=m$.arrowDown:a=" ",u.disabled?(i=this.cursor===o?Sd.gray().underline(u.title):Sd.strikethrough().gray(u.title),a=(this.cursor===o?Sd.bold().gray(m$.pointer)+" ":" ")+a):(i=this.cursor===o?Sd.cyan().underline(u.title):u.title,a=(this.cursor===o?Sd.cyan(m$.pointer)+" ":" ")+a,u.description&&this.cursor===o&&(c=` - ${u.description}`,(a.length+i.length+c.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(c=`
`+l6t(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${i}${Sd.gray(c)}
`}}this.out.write(this.outputText)}},d6t=LY,h$=Sl,m6t=Yh,{style:kke,clear:h6t}=zp,{cursor:$ke,erase:g6t}=_l,BY=class extends m6t{constructor(r={}){super(r),this.msg=r.message,this.value=!!r.initial,this.active=r.active||"on",this.inactive=r.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(r,n){if(r===" ")this.value=!this.value;else if(r==="1")this.value=!0;else if(r==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write($ke.hide):this.out.write(h6t(this.outputText,this.out.columns)),super.render(),this.outputText=[kke.symbol(this.done,this.aborted),h$.bold(this.msg),kke.delimiter(this.done),this.value?this.inactive:h$.cyan().underline(this.inactive),h$.gray("/"),this.value?h$.cyan().underline(this.active):this.active].join(" "),this.out.write(g6t.line+$ke.to(0)+this.outputText))}},y6t=BY,x6t=class jY{constructor({token:r,date:n,parts:o,locales:i}){this.token=r,this.date=n||new Date,this.parts=o||[this],this.locales=i||{}}up(){}down(){}next(){let r=this.parts.indexOf(this);return this.parts.find((n,o)=>o>r&&n instanceof jY)}setTo(r){}prev(){let r=[].concat(this.parts).reverse(),n=r.indexOf(this);return r.find((o,i)=>i>n&&o instanceof jY)}toString(){return String(this.date)}},Dd=x6t,b6t=Dd,v6t=class extends b6t{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}},E6t=v6t,w6t=Dd,S6t=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),_6t=class extends w6t{constructor(r={}){super(r)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(r){this.date.setDate(parseInt(r.substr(-2)))}toString(){let r=this.date.getDate(),n=this.date.getDay();return this.token==="DD"?String(r).padStart(2,"0"):this.token==="Do"?r+S6t(r):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:r}},T6t=_6t,D6t=Dd,C6t=class extends D6t{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}},A6t=C6t,P6t=Dd,O6t=class extends P6t{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}},F6t=O6t,I6t=Dd,R6t=class extends I6t{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}},M6t=R6t,k6t=Dd,$6t=class extends k6t{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),n=this.token.length;return n===2?String(r+1).padStart(2,"0"):n===3?this.locales.monthsShort[r]:n===4?this.locales.months[r]:String(r+1)}},N6t=$6t,L6t=Dd,B6t=class extends L6t{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}},j6t=B6t,U6t=Dd,q6t=class extends U6t{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let r=this.parts[this.cursor].prev();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}right(){let r=this.parts[this.cursor].next();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}next(){let r=this.parts[this.cursor].next();this.moveCursor(r?this.parts.indexOf(r):this.parts.findIndex(n=>n instanceof jke)),this.render()}_(r){/\d/.test(r)&&(this.typed+=r,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Bke.hide):this.out.write(Lke(this.outputText,this.out.columns)),super.render(),this.outputText=[Nke.symbol(this.done,this.aborted),yY.bold(this.msg),Nke.delimiter(!1),this.parts.reduce((r,n,o)=>r.concat(o===this.cursor&&!this.done?yY.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((r,n,o)=>r+`
${o?" ":V6t.pointerSmall} ${yY.red().italic(n)}`,"")),this.out.write(z6t.line+Bke.to(0)+this.outputText))}},o$t=UY,g$=Sl,i$t=Yh,{cursor:y$,erase:s$t}=_l,{style:xY,figures:a$t,clear:qke,lines:c$t}=zp,u$t=/[0-9]/,bY=e=>e!==void 0,Gke=(e,r)=>{let n=Math.pow(10,r);return Math.round(e*n)/n},qY=class extends i$t{constructor(r={}){super(r),this.transform=xY.render(r.style),this.msg=r.message,this.initial=bY(r.initial)?r.initial:"",this.float=!!r.float,this.round=r.round||2,this.inc=r.increment||1,this.min=bY(r.min)?r.min:-1/0,this.max=bY(r.max)?r.max:1/0,this.errorMsg=r.error||"Please Enter A Valid Value",this.validator=r.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(r){!r&&r!==0?(this.placeholder=!0,this.rendered=g$.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Gke(r,this.round)}`),this._value=Gke(r,this.round)),this.fire()}get value(){return this._value}parse(r){return this.float?parseFloat(r):parseInt(r)}valid(r){return r==="-"||r==="."&&this.float||u$t.test(r)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let r=this.value;this.value=r!==""?r:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let r=this.value;this.value=r!==""?r:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let r=this.value.toString();if(r.length===0)return this.bell();this.value=this.parse(r=r.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(r,n){if(!this.valid(r))return this.bell();let o=Date.now();if(o-this.lastHit>1e3&&(this.typed=""),this.typed+=r,this.lastHit=o,this.color="cyan",r===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(y$.down(c$t(this.outputError,this.out.columns)-1)+qke(this.outputError,this.out.columns)),this.out.write(qke(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[xY.symbol(this.done,this.aborted),g$.bold(this.msg),xY.delimiter(this.done),!this.done||!this.done&&!this.placeholder?g$[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((r,n,o)=>r+`
${o?" ":a$t.pointerSmall} ${g$.red().italic(n)}`,"")),this.out.write(s$t.line+y$.to(0)+this.outputText+y$.save+this.outputError+y$.restore))}},l$t=qY,Vp=Sl,{cursor:p$t}=_l,f$t=Yh,{clear:Hke,figures:zh,style:Wke,wrap:d$t,entriesToDisplay:m$t}=zp,h$t=class extends f$t{constructor(r={}){super(r),this.msg=r.message,this.cursor=r.cursor||0,this.scrollIndex=r.cursor||0,this.hint=r.hint||"",this.warn=r.warn||"- This option is disabled -",this.minSelected=r.min,this.showMinError=!1,this.maxChoices=r.max,this.instructions=r.instructions,this.optionsPerPage=r.optionsPerPage||10,this.value=r.choices.map((n,o)=>(typeof n=="string"&&(n={title:n,value:o}),{title:n&&(n.title||n.value||n),description:n&&n.description,value:n&&(n.value===void 0?o:n.value),selected:n&&n.selected,disabled:n&&n.disabled})),this.clear=Hke("",this.out.columns),r.overrideRender||this.render()}reset(){this.value.map(r=>!r.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(r=>r.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){let r=this.value.filter(n=>n.selected);this.minSelected&&r.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let r=this.value[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let r=!this.value[this.cursor].selected;this.value.filter(n=>!n.disabled).forEach(n=>n.selected=r),this.render()}_(r,n){if(r===" ")this.handleSpaceToggle();else if(r==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${zh.arrowUp}/${zh.arrowDown}: Highlight option
${zh.arrowLeft}/${zh.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?` a: Toggle all
`:"")+" enter/return: Complete answer":""}renderOption(r,n,o,i){let a=(n.selected?Vp.green(zh.radioOn):zh.radioOff)+" "+i+" ",c,u;return n.disabled?c=r===o?Vp.gray().underline(n.title):Vp.strikethrough().gray(n.title):(c=r===o?Vp.cyan().underline(n.title):n.title,r===o&&n.description&&(u=` - ${n.description}`,(a.length+c.length+u.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(u=`
`+d$t(n.description,{margin:a.length,width:this.out.columns})))),a+c+Vp.gray(u||"")}paginateOptions(r){if(r.length===0)return Vp.red("No matches for this query.");let{startIndex:n,endIndex:o}=m$t(this.cursor,r.length,this.optionsPerPage),i,a=[];for(let c=n;c<o;c++)c===n&&n>0?i=zh.arrowUp:c===o-1&&o<r.length?i=zh.arrowDown:i=" ",a.push(this.renderOption(this.cursor,r[c],c,i));return`
`+a.join(`
`)}renderOptions(r){return this.done?"":this.paginateOptions(r)}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[Vp.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&r.push(Vp.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(p$t.hide),super.render();let r=[Wke.symbol(this.done,this.aborted),Vp.bold(this.msg),Wke.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=Vp.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.value),this.out.write(this.clear+r),this.clear=Hke(r,this.out.columns)}},z6e=h$t,f2=Sl,g$t=Yh,{erase:y$t,cursor:Vke}=_l,{style:vY,clear:zke,figures:EY,wrap:x$t,entriesToDisplay:b$t}=zp,Kke=(e,r)=>e[r]&&(e[r].value||e[r].title||e[r]),v$t=(e,r)=>e[r]&&(e[r].title||e[r].value||e[r]),E$t=(e,r)=>{let n=e.findIndex(o=>o.value===r||o.title===r);return n>-1?n:void 0},GY=class extends g$t{constructor(r={}){super(r),this.msg=r.message,this.suggest=r.suggest,this.choices=r.choices,this.initial=typeof r.initial=="number"?r.initial:E$t(r.choices,r.initial),this.select=this.initial||r.cursor||0,this.i18n={noMatches:r.noMatches||"no matches found"},this.fallback=r.fallback||this.initial,this.clearFirst=r.clearFirst||!1,this.suggestions=[],this.input="",this.limit=r.limit||10,this.cursor=0,this.transform=vY.render(r.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=zke("",this.out.columns),this.complete(this.render),this.render()}set fallback(r){this._fb=Number.isSafeInteger(parseInt(r))?parseInt(r):r}get fallback(){let r;return typeof this._fb=="number"?r=this.choices[this._fb]:typeof this._fb=="string"&&(r={title:this._fb}),r||this._fb||{title:this.i18n.noMatches}}moveSelect(r){this.select=r,this.suggestions.length>0?this.value=Kke(this.suggestions,r):this.value=this.fallback.value,this.fire()}async complete(r){let n=this.completing=this.suggest(this.input,this.choices),o=await n;if(this.completing!==n)return;this.suggestions=o.map((a,c,u)=>({title:v$t(u,c),value:Kke(u,c),description:a.description})),this.completing=!1;let i=Math.max(o.length-1,0);this.moveSelect(Math.min(i,this.select)),r&&r()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(r,n){let o=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${o}${r}${i}`,this.cursor=o.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let r=this.input.slice(0,this.cursor-1),n=this.input.slice(this.cursor);this.input=`${r}${n}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let r=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor+1);this.input=`${r}${n}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(r,n,o,i){let a,c=o?EY.arrowUp:i?EY.arrowDown:" ",u=n?f2.cyan().underline(r.title):r.title;return c=(n?f2.cyan(EY.pointer)+" ":" ")+c,r.description&&(a=` - ${r.description}`,(c.length+u.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
`+x$t(r.description,{margin:3,width:this.out.columns}))),c+" "+u+f2.gray(a||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Vke.hide):this.out.write(zke(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=b$t(this.select,this.choices.length,this.limit);if(this.outputText=[vY.symbol(this.done,this.aborted,this.exited),f2.bold(this.msg),vY.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let o=this.suggestions.slice(r,n).map((i,a)=>this.renderOption(i,this.select===a+r,a===0&&r>0,a+r===n-1&&n<this.choices.length)).join(`
`);this.outputText+=`
`+(o||f2.gray(this.fallback.title))}this.out.write(y$t.line+Vke.to(0)+this.outputText)}},w$t=GY,_d=Sl,{cursor:S$t}=_l,_$t=z6e,{clear:Jke,style:Yke,figures:ZE}=zp,HY=class extends _$t{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=Jke("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(o=>this.inputValue?!!(typeof o.title=="string"&&o.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof o.value=="string"&&o.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let n=this.filteredOptions.findIndex(o=>o===r);this.cursor=n<0?0:n,this.render()}handleSpaceToggle(){let r=this.filteredOptions[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r,this.updateFilteredOptions()}_(r,n){r===" "?this.handleSpaceToggle():this.handleInputChange(r)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${ZE.arrowUp}/${ZE.arrowDown}: Highlight option
${ZE.arrowLeft}/${ZE.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`:""}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:_d.gray("Enter something to filter")}
`}renderOption(r,n,o,i){let a=(n.selected?_d.green(ZE.radioOn):ZE.radioOff)+" "+i+" ",c;return n.disabled?c=r===o?_d.gray().underline(n.title):_d.strikethrough().gray(n.title):c=r===o?_d.cyan().underline(n.title):n.title,a+c}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[_d.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(_d.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(S$t.hide),super.render();let r=[Yke.symbol(this.done,this.aborted),_d.bold(this.msg),Yke.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=_d.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+r),this.clear=Jke(r,this.out.columns)}},T$t=HY,Zke=Sl,D$t=Yh,{style:Qke,clear:C$t}=zp,{erase:A$t,cursor:Xke}=_l,WY=class extends D$t{constructor(r={}){super(r),this.msg=r.message,this.value=r.initial,this.initialValue=!!r.initial,this.yesMsg=r.yes||"yes",this.yesOption=r.yesOption||"(Y/n)",this.noMsg=r.no||"no",this.noOption=r.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(r,n){return r.toLowerCase()==="y"?(this.value=!0,this.submit()):r.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Xke.hide):this.out.write(C$t(this.outputText,this.out.columns)),super.render(),this.outputText=[Qke.symbol(this.done,this.aborted),Zke.bold(this.msg),Qke.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Zke.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(A$t.line+Xke.to(0)+this.outputText))}},P$t=WY,O$t={TextPrompt:c6t,SelectPrompt:d6t,TogglePrompt:y6t,DatePrompt:o$t,NumberPrompt:l$t,MultiselectPrompt:z6e,AutocompletePrompt:w$t,AutocompleteMultiselectPrompt:T$t,ConfirmPrompt:P$t};(function(e){let r=e,n=O$t,o=c=>c;function i(c,u,l={}){return new Promise((p,f)=>{let g=new n[c](u),x=l.onAbort||o,b=l.onSubmit||o,v=l.onExit||o;g.on("state",u.onState||o),g.on("submit",S=>p(b(S))),g.on("exit",S=>p(v(S))),g.on("abort",S=>f(x(S)))})}r.text=c=>i("TextPrompt",c),r.password=c=>(c.style="password",r.text(c)),r.invisible=c=>(c.style="invisible",r.text(c)),r.number=c=>i("NumberPrompt",c),r.date=c=>i("DatePrompt",c),r.confirm=c=>i("ConfirmPrompt",c),r.list=c=>{let u=c.separator||",";return i("TextPrompt",c,{onSubmit:l=>l.split(u).map(p=>p.trim())})},r.toggle=c=>i("TogglePrompt",c),r.select=c=>i("SelectPrompt",c),r.multiselect=c=>{c.choices=[].concat(c.choices||[]);let u=l=>l.filter(p=>p.selected).map(p=>p.value);return i("MultiselectPrompt",c,{onAbort:u,onSubmit:u})},r.autocompleteMultiselect=c=>{c.choices=[].concat(c.choices||[]);let u=l=>l.filter(p=>p.selected).map(p=>p.value);return i("AutocompleteMultiselectPrompt",c,{onAbort:u,onSubmit:u})};let a=(c,u)=>Promise.resolve(u.filter(l=>l.title.slice(0,c.length).toLowerCase()===c.toLowerCase()));r.autocomplete=c=>(c.suggest=c.suggest||a,c.choices=[].concat(c.choices||[]),i("AutocompletePrompt",c))})(U6e);var VY=U6e,F$t=["suggest","format","onState","validate","onRender","type"],e6e=()=>{};async function Jh(e=[],{onSubmit:r=e6e,onCancel:n=e6e}={}){let o={},i=Jh._override||{};e=[].concat(e);let a,c,u,l,p,f,g=async(x,b,v=!1)=>{if(!(!v&&x.validate&&x.validate(b)!==!0))return x.format?await x.format(b,o):b};for(c of e)if({name:l,type:p}=c,typeof p=="function"&&(p=await p(a,{...o},c),c.type=p),!!p){for(let x in c){if(F$t.includes(x))continue;let b=c[x];c[x]=typeof b=="function"?await b(a,{...o},f):b}if(f=c,typeof c.message!="string")throw new Error("prompt message is required");if({name:l,type:p}=c,VY[p]===void 0)throw new Error(`prompt type (${p}) is not defined`);if(i[c.name]!==void 0&&(a=await g(c,i[c.name]),a!==void 0)){o[l]=a;continue}try{a=Jh._injected?I$t(Jh._injected,c.initial):await VY[p](c),o[l]=a=await g(c,a,!0),u=await r(c,a,o)}catch{u=!await n(c,o)}if(u)return o}return o}function I$t(e,r){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?r:n}function R$t(e){Jh._injected=(Jh._injected||[]).concat(e)}function M$t(e){Jh._override=Object.assign({},e)}var k$t=Object.assign(Jh,{prompt:Jh,prompts:VY,inject:R$t,override:M$t}),$$t=k$t,N$t=E2($$t),K6e={},rw={};Object.defineProperty(rw,"__esModule",{value:!0});rw.sync=rw.isexe=void 0;var L$t=ow.default,B$t=KY.default,j$t=async(e,r={})=>{let{ignoreErrors:n=!1}=r;try{return J6e(await(0,B$t.stat)(e),r)}catch(o){let i=o;if(n||i.code==="EACCES")return!1;throw i}};rw.isexe=j$t;var U$t=(e,r={})=>{let{ignoreErrors:n=!1}=r;try{return J6e((0,L$t.statSync)(e),r)}catch(o){let i=o;if(n||i.code==="EACCES")return!1;throw i}};rw.sync=U$t;var J6e=(e,r)=>e.isFile()&&q$t(e,r),q$t=(e,r)=>{let n=r.uid??process.getuid?.(),o=r.groups??process.getgroups?.()??[],i=r.gid??process.getgid?.()??o[0];if(n===void 0||i===void 0)throw new Error("cannot get uid or gid");let a=new Set([i,...o]),c=e.mode,u=e.uid,l=e.gid,p=parseInt("100",8),f=parseInt("010",8),g=parseInt("001",8),x=p|f;return!!(c&g||c&f&&a.has(l)||c&p&&u===n||c&x&&n===0)},nw={};Object.defineProperty(nw,"__esModule",{value:!0});nw.sync=nw.isexe=void 0;var G$t=ow.default,H$t=KY.default,W$t=async(e,r={})=>{let{ignoreErrors:n=!1}=r;try{return Y6e(await(0,H$
`),ui.default.env.CI&&ui.default.exit(1);let u=x2(o,m6e[o]),{tryInstall:l}=await N$t({name:"tryInstall",type:"confirm",message:`Would you like to globally install ${u}?`});l||ui.default.exit(1)}await ykt(`npm i -g ${o.split("@")[0]}${i?`@${i}`:""}`,{stdio:"inherit",cwd:n})}return o}var gMr=ui.default.env.NI_CONFIG_FILE,nNt=ui.default.platform==="win32"?ui.default.env.USERPROFILE:ui.default.env.HOME,yMr=Ko.default.join(nNt||"~/",".nirc");var _$=class extends Error{constructor({agent:r,command:n}){super(`Command "${n}" is not support by agent "${r}"`)}};function iZ(e,r,n=[]){if(!(e in g2))throw new Error(`Unsupported agent "${e}"`);let o=g2[e][r];if(typeof o=="function")return o(n);if(!o)throw new _$({agent:e,command:r});let i=a=>!a.startsWith("--")&&a.includes(" ")?JSON.stringify(a):a;return o.replace("{0}",n.map(i).join(" ")).trim()}var zY,o$e,i$e,s$e,a$e=!0;typeof process<"u"&&({FORCE_COLOR:zY,NODE_DISABLE_COLORS:o$e,NO_COLOR:i$e,TERM:s$e}=process.env||{},a$e=process.stdout&&process.stdout.isTTY);var ln={enabled:!o$e&&i$e==null&&s$e!=="dumb"&&(zY!=null&&zY!=="0"||a$e),reset:_n(0,0),bold:_n(1,22),dim:_n(2,22),italic:_n(3,23),underline:_n(4,24),inverse:_n(7,27),hidden:_n(8,28),strikethrough:_n(9,29),black:_n(30,39),red:_n(31,39),green:_n(32,39),yellow:_n(33,39),blue:_n(34,39),magenta:_n(35,39),cyan:_n(36,39),white:_n(37,39),gray:_n(90,39),grey:_n(90,39),bgBlack:_n(40,49),bgRed:_n(41,49),bgGreen:_n(42,49),bgYellow:_n(43,49),bgBlue:_n(44,49),bgMagenta:_n(45,49),bgCyan:_n(46,49),bgWhite:_n(47,49)};function o6e(e,r){let n=0,o,i="",a="";for(;n<e.length;n++)o=e[n],i+=o.open,a+=o.close,~r.indexOf(o.close)&&(r=r.replace(o.rgx,o.close+o.open));return i+r+a}function oNt(e,r){let n={has:e,keys:r};return n.reset=ln.reset.bind(n),n.bold=ln.bold.bind(n),n.dim=ln.dim.bind(n),n.italic=ln.italic.bind(n),n.underline=ln.underline.bind(n),n.inverse=ln.inverse.bind(n),n.hidden=ln.hidden.bind(n),n.strikethrough=ln.strikethrough.bind(n),n.black=ln.black.bind(n),n.red=ln.red.bind(n),n.green=ln.green.bind(n),n.yellow=ln.yellow.bind(n),n.blue=ln.blue.bind(n),n.magenta=ln.magenta.bind(n),n.cyan=ln.cyan.bind(n),n.white=ln.white.bind(n),n.gray=ln.gray.bind(n),n.grey=ln.grey.bind(n),n.bgBlack=ln.bgBlack.bind(n),n.bgRed=ln.bgRed.bind(n),n.bgGreen=ln.bgGreen.bind(n),n.bgYellow=ln.bgYellow.bind(n),n.bgBlue=ln.bgBlue.bind(n),n.bgMagenta=ln.bgMagenta.bind(n),n.bgCyan=ln.bgCyan.bind(n),n.bgWhite=ln.bgWhite.bind(n),n}function _n(e,r){let n={open:`\x1B[${e}m`,close:`\x1B[${r}m`,rgx:new RegExp(`\\x1b\\[${r}m`,"g")};return function(o){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),o===void 0?this:ln.enabled?o6e(this.keys,o+""):o+""):o===void 0?oNt([e],[n]):ln.enabled?o6e([n],o+""):o+""}}var aZ=_i("prisma:generator");async function l$e(e){let r=await iNt(e);if(aZ("baseDir",e),!r)throw new Error(`Could not resolve @prisma/client.
Please try to install it with ${q(me(await c$e(e,"install","@prisma/client")))} and rerun ${q(await c$e(e,"execute","prisma generate"))} \u{1F64F}.`);return r}async function iNt(e){let r={basedir:e,preserveSymlinks:!0},n=await sk("prisma",r),o=await sk("@prisma/client",r),i=o&&await u$e.default.realpath(o);if(aZ("prismaCliDir",n),aZ("prismaClientDir",o),n===void 0||o===void 0)return i;let a=sZ.default.relative(n,o).split(sZ.default.sep);if(!(a[0]!==".."||a[1]===".."))return i}async function c$e(e,r,...n){let o=await oZ({cwd:e,autoInstall:!1,programmatic:!0});return iZ(o??"npm",r,n)}var w2=class{name="prisma-client-js";#e;#t;#r;constructor({shouldResolvePrismaClient:r=!0,runtimePath:n}={}){this.#e=r,this.#t=n}async getManifest(r){return{defaultOutput:this.#e?await this.#o(r):".prisma/client",prettyName:"Prisma Client",version:oY,requiresEngines:[],requiresEngineVersion:p$e.enginesVersion}}async generate(r){let n=To(r.generator.output);await oke({datamodel:r.datamodel,schemaPath:r.schemaPath,binaryPaths:r.binaryPaths,datasources:r.datasources,outputDir:n,copyRuntime:!!r.generator.config.copyRuntime,copyRuntimeSourceMaps:!!process.env.PRISMA_COPY_RUNTIME_SOURCEMAPS,runtimeSourcePath:await this.#i(r.generator),dmmf:r.dmmf,generator:r.generator,engineVersion:r.version,clientVersion:oY,activeProvider:r.datasources[0]?.activeProvider,typedSql:r.typedSql,compilerBuild:sNt(r.generator.config.compilerBuild)})}async#o(r){return this.#r?this.#r:(this.#r=await l$e(cZ.default.dirname(r.sourceFilePath)),this.#r)}async#i(r){return this.#t?this.#t:(this.#t=cZ.default.join(await this.#o(r),"runtime"),this.#t)}};function sNt(e){if(e===void 0)return"fast";if(e==="small"||e==="fast")return e;throw new Error(`Invalid compiler build: ${JSON.stringify(e)}, expected one of: "fast", "small"`)}var f$e=W(o2());function d$e(e){return{...e,mappings:aNt(e.mappings,e.datamodel)}}function aNt(e,r){return{modelOperations:e.modelOperations.filter(o=>{let i=r.models.find(a=>a.name===o.model);if(!i)throw new Error(`Mapping without model ${o.model}`);return i.fields.some(a=>a.kind!=="object")}).map(o=>({model:o.model,plural:(0,f$e.default)(Ve(o.model)),findUnique:o.findUnique||o.findSingle,findUniqueOrThrow:o.findUniqueOrThrow,findFirst:o.findFirst,findFirstOrThrow:o.findFirstOrThrow,findMany:o.findMany,create:o.createOne||o.createSingle||o.create,createMany:o.createMany,createManyAndReturn:o.createManyAndReturn,delete:o.deleteOne||o.deleteSingle||o.delete,update:o.updateOne||o.updateSingle||o.update,deleteMany:o.deleteMany,updateMany:o.updateMany,updateManyAndReturn:o.updateManyAndReturn,upsert:o.upsertOne||o.upsertSingle||o.upsert,aggregate:o.aggregate,groupBy:o.groupBy,findRaw:o.findRaw,aggregateRaw:o.aggregateRaw})),otherOperations:e.otherOperations}}var hw=W(require("node:fs/promises")),P2=W(require("node:path"));var vNe=W(dR()),ENe=W(yh());var cNt=["ts","mts","cts"],uNt=["","ts","mts","cts","js","mjs","cjs"];function lNt(e,r,n){return!n.includes(e)&&!process.env.PRISMA_DISABLE_WARNINGS&&console.warn(`${ot(r)} file extension ${JSON.stringify(e)} is unexpected and may be a mistake. Expected one of: ${n.map(o=>JSON.stringify(o)).join(", ")}`),e}function m$e(e,r,n){if(typeof e=="string")return lNt(e,r,n);throw new Error(`Invalid ${r} file extension: ${JSON.stringify(e)}, expected a string`)}function h$e(e){return m$e(e,"generated",cNt)}function g$e(e){return m$e(e,"import",uNt)}function y$e(e){return e===""?"":`.${e}`}function T$(e){return r=>r+y$e(e)}function D$(e){return r=>r+y$e(e)}function x$e({tsconfig:e,generatedFileExtension:r,target:n}){return n==="deno"?r:e?pNt(e,r):r}function pNt(e,r){if(e.compilerOptions?.allowImportingTsExtensions||e.compilerOptions?.rewriteRelativeImportExtensions)return r;let n=e.compilerOptions?.moduleResolution?.toLowerCase();return e.compilerOptions?.module?.toLowerCase()==="commonjs"||n==="bundler"?"":fNt(r)}function fNt(e){switch(e){case"ts":return"js";case"mts":return"mjs";case"cts":return"cjs";default:return e}}function b$e(e){return d$e(e)}var v$e=W(ys());var Kp=class{constructor(r,n){this.type=r;this.useNamespace=n}
${(0,v$e.default)(r.values.map(i=>`${i}: ${this.getValue(i)}`).join(`,
`),2)}
} as const`,o=this.isStrictEnum()?`runtime.makeStrictEnum(${n})`:n;return`export const ${r.name} = ${o}
export type ${r.name} = (typeof ${r.name})[keyof typeof ${r.name}]
`}getValue(r){return this.isObjectEnum()?r:`'${r}'`}};var I$e=W(ys());function Vy(e){return`${e}Select`}function uZ(e){return`${e}SelectCreateManyAndReturn`}function lZ(e){return`${e}SelectUpdateManyAndReturn`}function C$(e){return`${e}Include`}function pZ(e){return`${e}IncludeCreateManyAndReturn`}function fZ(e){return`${e}IncludeUpdateManyAndReturn`}function E$e(e){return`CreateMany${e}AndReturnOutputType`}function w$e(e){return`UpdateMany${e}AndReturnOutputType`}function aw(e){return`${e}Omit`}function cw(e){return`Aggregate${ot(e)}`}function S$e(e){return`${ot(e)}CountOutputType`}function A$(e){return`${ot(e)}GroupByOutputType`}function _$e(e){return`${ot(e)}AvgAggregateOutputType`}function T$e(e){return`${ot(e)}SumAggregateOutputType`}function D$e(e){return`${ot(e)}MinAggregateOutputType`}function C$e(e){return`${ot(e)}MaxAggregateOutputType`}function dZ(e){return`${ot(e)}CountAggregateInputType`}function S2(e){return`${ot(e)}CountAggregateOutputType`}function P$(e){return e.replace(/OutputType$/,"InputType")}function uw(e){return`${e}GroupByArgs`}function mZ(e){return`Get${ot(e)}GroupByPayload`}function zy(e){return`${ot(e)}AggregateArgs`}function O$(e){return`Get${ot(e)}AggregateType`}function lw(e,r){return e.args.length?hZ(e,r):Rr(e.outputType.type)}function hZ(e,r){return`${r}$${e.name}Args`}function Rr(e,r){if(!r)return`${e}DefaultArgs`;switch(r){case"findMany":return`${e}FindManyArgs`;case"findUnique":return`${e}FindUniqueArgs`;case"findUniqueOrThrow":return`${e}FindUniqueOrThrowArgs`;case"findFirst":return`${e}FindFirstArgs`;case"findFirstOrThrow":return`${e}FindFirstOrThrowArgs`;case"upsert":return`${e}UpsertArgs`;case"update":return`${e}UpdateArgs`;case"updateMany":return`${e}UpdateManyArgs`;case"updateManyAndReturn":return`${e}UpdateManyAndReturnArgs`;case"delete":return`${e}DeleteArgs`;case"create":return`${e}CreateArgs`;case"createMany":return`${e}CreateManyArgs`;case"createManyAndReturn":return`${e}CreateManyAndReturnArgs`;case"deleteMany":return`${e}DeleteManyArgs`;case"groupBy":return uw(e);case"aggregate":return zy(e);case"count":return`${e}CountArgs`;case"findRaw":return`${e}FindRawArgs`;case"aggregateRaw":return`${e}AggregateRawArgs`;default:Hs(r,`Unknown action: ${r}`)}}function gu(e,r=!0){return r?`Prisma.${gu(e,!1)}`:`$${e}Payload`}function pw(e){return`${e}FieldRefs`}function F$(e){let r=e.type;return e.isList&&(r+="[]"),`'${r}'`}function I$(e,r){return e.isPreviewFeatureOn("strictUndefinedChecks")?Oe([r,V("runtime.Types.Skip")]):r}var Po=er("ExtArgs").extends(V("runtime.Types.Extensions.InternalArgs")).default(V("runtime.Types.Extensions.DefaultArgs"));var fw={String:"string",Int:"number",Float:"number",Boolean:"boolean",Long:"number",DateTime:["Date","string"],ID:"string",UUID:"string",Json:"runtime.JsonValue",Bytes:"runtime.Bytes",Decimal:["runtime.Decimal","runtime.DecimalJsLike","number","string"],BigInt:["bigint","number"]},A$e={JsonValue:"InputJsonValue"};var Ky=class{constructor(r,n,o){this.field=r;this.context=n;this.source=o}toTS(){let r=yZ(this.field,this.context,this.source);return xe(r)}};function yZ(e,r,n){let o=dNt(e.inputTypes,r,n),i=de(e.name,e.isRequired?o:I$(r,o));e.isRequired||i.optional();let a=qe();return e.comment&&a.addText(e.comment),e.deprecation&&a.addText(`@deprecated since ${e.deprecation.sinceVersion}: ${e.deprecation.reason}`),a.lines.length>0&&i.setDocComment(a),i}function P$e(e,r,n){let o,i=fw[e.type];if(e.location==="enumTypes"&&e.namespace==="model")o=V(`$Enums.${e.type}`);else{if(e.type==="Null")return Rt;if(Array.isArray(i)){let a=Oe(i.map(gZ));return e.isList?a.mapVariants(c=>$e(c)):a}else e.namespace==="prisma"?o=gZ(`Prisma.${e.type}`):o=gZ(i??e.type)}return r.typeRefNeedsGenericModelArg(e)&&(n?o.addGenericArgument(Mt(n)):o.addGenericArgument(V("$PrismaModel"))),e.isList?$e(o):o}function gZ(e){let r=e.split("."),n=r[r.length-1],o=A$e[n]??n;return V(r.slice(0,-1).concat(o).join("."))}function dNt(e,r,n){let o=e.filter(u=>u.location==="inputObjectTypes"&&!u.isList),i=e.filter(u=>u.location!=="inputObjectTypes"||u.isList),a=o.map(u=>P$e(u,r.genericArgsInfo,n
${(0,I$e.default)(o.map(u=>new Ky(u,this.context,n).toTS()).join(`
`),2)}
}`,a=this.context.genericArgsInfo.typeNeedsGenericModelArg(this.type),c=a?`${this.type.name}<$PrismaModel = never>`:this.type.name;if(r.name.includes("Json")&&r.name.includes("Filter")){let l=`Required<${a?`${this.type.name}Base<$PrismaModel>`:`${this.type.name}Base`}>`;return`
export type ${c} =
| Prisma.PatchUndefined<
Prisma.Either<${l}, Exclude<keyof ${l}, 'path'>>,
${l}
>
| Prisma.OptionalFlat<Omit<${l}, 'path'>>
export type ${this.type.name}Base${a?"<$PrismaModel = never>":""} = ${F$e(i,r)}`}else return`
export type ${c} = ${F$e(i,r)}`}};function F$e(e,r){if(r.constraints?.fields&&r.constraints.fields.length>0){let n=r.constraints.fields.map(o=>`"${o}"`).join(" | ");return`Prisma.AtLeast<${e}, ${n}>`}return e}var R$=class{constructor(r){this.document=r}_compositeNames;_inputTypesByName;_typeAndModelMap;_mappingsMap;_outputTypeMap;_rootFieldMap;get compositeNames(){return this._compositeNames??=new Set(this.datamodel.types.map(r=>r.name))}get inputTypesByName(){return this._inputTypesByName??=this.buildInputTypesMap()}get typeAndModelMap(){return this._typeAndModelMap??=this.buildTypeModelMap()}get mappingsMap(){return this._mappingsMap??=this.buildMappingsMap()}get outputTypeMap(){return this._outputTypeMap??=this.buildMergedOutputTypeMap()}get rootFieldMap(){return this._rootFieldMap??=this.buildRootFieldMap()}get datamodel(){return this.document.datamodel}get mappings(){return this.document.mappings}get schema(){return this.document.schema}get inputObjectTypes(){return this.schema.inputObjectTypes}get outputObjectTypes(){return this.schema.outputObjectTypes}isComposite(r){return this.compositeNames.has(r)}getOtherOperationNames(){return[Object.values(this.mappings.otherOperations.write),Object.values(this.mappings.otherOperations.read)].flat()}hasEnumInNamespace(r,n){return this.schema.enumTypes[n]?.find(o=>o.name===r)!==void 0}resolveInputObjectType(r){return this.inputTypesByName.get(xZ(r.type,r.namespace))}resolveOutputObjectType(r){if(r.location==="outputObjectTypes")return this.outputObjectTypes[r.namespace??"prisma"].find(n=>n.name===r.type)}buildModelMap(){return zo(this.datamodel.models,"name")}buildTypeMap(){return zo(this.datamodel.types,"name")}buildTypeModelMap(){return{...this.buildTypeMap(),...this.buildModelMap()}}buildMappingsMap(){return zo(this.mappings.modelOperations,"model")}buildMergedOutputTypeMap(){return this.schema.outputObjectTypes.prisma?{model:zo(this.schema.outputObjectTypes.model,"name"),prisma:zo(this.schema.outputObjectTypes.prisma,"name")}:{model:zo(this.schema.outputObjectTypes.model,"name"),prisma:zo([],"name")}}buildRootFieldMap(){return{...zo(this.outputTypeMap.prisma.Query.fields,"name"),...zo(this.outputTypeMap.prisma.Mutation.fields,"name")}}buildInputTypesMap(){let r=new Map;for(let n of this.inputObjectTypes.prisma??[])r.set(xZ(n.name,"prisma"),n);if(!this.inputObjectTypes.model)return r;for(let n of this.inputObjectTypes.model)r.set(xZ(n.name,"model"),n);return r}};function xZ(e,r){return r?`${r}.${e}`:e}var M$=class{constructor(r){this._dmmf=r}_cache=new NE;typeNeedsGenericModelArg(r){return this._cache.getOrCreate(r,()=>{let n=[{type:r}],o=new Set,i;for(;i=n.shift();){let{type:a}=i,c=this._cache.get(a);if(c===!0)return this._cacheResultsForTree(i),!0;if(c!==!1&&!o.has(a)){if(a.meta?.source){this._cache.set(a,!1);continue}o.add(a);for(let u of a.fields)for(let l of u.inputTypes){if(l.location==="fieldRefTypes")return this._cacheResultsForTree(i),!0;let p=this._dmmf.resolveInputObjectType(l);p&&n.push({type:p,parent:i})}}}for(let a of o)this._cache.set(a,!1);return!1})}typeRefNeedsGenericModelArg(r){if(r.location==="fieldRefTypes")return!0;let n=this._dmmf.resolveInputObjectType(r);return n?this.typeNeedsGenericModelArg(n):!1}_cacheResultsForTree(r){let n=r;for(;n;)this._cache.set(n.type,!0),n=n.parent}};function k$(e){return Object.values(e.dmmf.typeAndModelMap).filter(r=>e.dmmf.outputTypeMap.model[r.name]).map(r=>{let n=r.documentation??"",i=`${`Model ${r.name}
`}${n}`,c=it(jt(r.name,V(`Prisma.${r.name}Model`))).setDocComment(qe(i));return xe(c)})}var mNt=`/*
* This file should be your main import to use Prisma-related types and utilities in a browser.
* Use it to get access to models, enums, and input types.
*
* This file does not contain a \`PrismaClient\` class, nor several other helpers that are intended as server-side only.
* See \`client.ts\` for the standard, server-side entry point.
*
* \u{1F7E2} You can import this file directly.
*/
`;function R$e(e,r){return`${mNt}
import * as Prisma from '${e.importFileName("./internal/prismaNamespaceBrowser")}'
export { Prisma }
export * as $Enums from '${e.importFileName("./enums")}'
export * from '${e.importFileName("./enums")}';
${k$(e).join(`
`)}
`}function M$e(e){if(!e)return"";let r="typeof globalThis !== 'undefined' && globalThis['DEBUG'] || (typeof process !== 'undefined' && process.env && process.env.DEBUG) || undefined";return`if (${r}) {
runtime.Debug.enable(${r})
}
`}var k$e=W(o2());var hNt={cursor:"{@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}",pagination:"{@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}",aggregations:"{@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}",distinct:"{@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}",sorting:"{@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}"};function vc(e,r){return`${hNt[r]}
${e}`}function _2(e,r){return`@deprecated since ${e} please use \`${r}\``}var Pd="Note, that providing `undefined` is treated as the value not being there.\nRead more here: https://pris.ly/d/null-undefined",Nn={take:(e,r)=>vc(`Take \`\xB1n\` ${r} from the position of the cursor.`,"pagination"),skip:(e,r)=>vc(`Skip the first \`n\` ${r}.`,"pagination"),_count:(e,r)=>vc(`Count returned ${r}`,"aggregations"),_avg:()=>vc("Select which fields to average","aggregations"),_sum:()=>vc("Select which fields to sum","aggregations"),_min:()=>vc("Select which fields to find the minimum value","aggregations"),_max:()=>vc("Select which fields to find the maximum value","aggregations"),count:()=>_2("2.23.0","_count"),avg:()=>_2("2.23.0","_avg"),sum:()=>_2("2.23.0","_sum"),min:()=>_2("2.23.0","_min"),max:()=>_2("2.23.0","_max"),distinct:(e,r)=>vc(`Filter by unique combinations of ${r}.`,"distinct"),orderBy:(e,r)=>vc(`Determine the order of ${r} to fetch.`,"sorting")},T2={groupBy:{body:e=>`Group by ${e.singular}.
${Pd}
@param {${uw(e.model.name)}} args - Group by arguments.
@example
// Group by city, order by createdAt, get count
const result = await prisma.user.groupBy({
by: ['city', 'createdAt'],
orderBy: {
createdAt: true
},
_count: {
_all: true
},
})
`,fields:{}},create:{body:e=>`Create a ${e.singular}.
@param {${Rr(e.model.name,e.action)}} args - Arguments to create a ${e.singular}.
@example
// Create one ${e.singular}
const ${e.singular} = await ${e.method}({
data: {
// ... data to create a ${e.singular}
}
})
`,fields:{data:e=>`The data needed to create a ${e}.`}},createMany:{body:e=>`Create many ${e.plural}.
@param {${Rr(e.model.name,e.action)}} args - Arguments to create many ${e.plural}.
@example
// Create many ${e.plural}
const ${Ve(e.mapping.model)} = await ${e.method}({
data: [
// ... provide data here
]
})
`,fields:{data:(e,r)=>`The data used to create many ${r}.`}},createManyAndReturn:{body:e=>{let r=e.firstScalar?`
// Create many ${e.plural} and only return the \`${e.firstScalar.name}\`
const ${Ve(e.mapping.model)}With${ot(e.firstScalar.name)}Only = await ${e.method}({
select: { ${e.firstScalar.name}: true },
data: [
// ... provide data here
]
})`:"";return`Create many ${e.plural} and returns the data saved in the database.
@param {${Rr(e.model.name,e.action)}} args - Arguments to create many ${e.plural}.
@example
// Create many ${e.plural}
const ${Ve(e.mapping.model)} = await ${e.method}({
data: [
// ... provide data here
]
})
${r}
${Pd}
`},fields:{data:(e,r)=>`The data used to create many ${r}.`}},findUnique:{body:e=>`Find zero or one ${e.singular} that matches the filter.
@param {${Rr(e.model.name,e.action)}} args - Arguments to find a ${e.singular}
@example
// Get one ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
}
})`,fields:{where:e=>`Filter, which ${e} to fetch.`}},findUniqueOrThrow:{body:e=>`Find one ${e.singular} that matches the filter or throw an error with \`error.code='P2025'\`
if no matches were found.
@param {${Rr(e.model.name,e.action)}} args - Arguments to find a ${e.singular}
@example
// Get one ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
}
})`,fields:{where:e=>`Filter, which ${e} to fetch.`}},findFirst:{body:e=>`Find the first ${e.singular} that matches the filter.
${Pd}
@param {${Rr(e.model.name,e.action)}} args - Arguments to find a ${e.singular}
@example
// Get one ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
}
})`,fields:{where:e=>`Filter, which ${e} to fetch.`,orderBy:Nn.orderBy,cursor:(e,r)=>vc(`Sets the position for searching for ${r}.`,"cursor"),take:Nn.take,skip:Nn.skip,distinct:Nn.distinct}},findFirstOrThrow:{body:e=>`Find the first ${e.singular} that matches the filter or
throw \`PrismaKnownClientError\` with \`P2025\` code if no matches were found.
${Pd}
@param {${Rr(e.model.name,e.action)}} args - Arguments to find a ${e.singular}
@example
// Get one ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
}
})`,fields:{where:e=>`Filter, which ${e} to fetch.`,orderBy:Nn.orderBy,cursor:(e,r)=>vc(`Sets the position for searching for ${r}.`,"cursor"),take:Nn.take,skip:Nn.skip,distinct:Nn.distinct}},findMany:{body:e=>{let r=e.firstScalar?`
// Only select the \`${e.firstScalar.name}\`
const ${Ve(e.mapping.model)}With${ot(e.firstScalar.name)}Only = await ${e.method}({ select: { ${e.firstScalar.name}: true } })`:"";return`Find zero or more ${e.plural} that matches the filter.
${Pd}
@param {${Rr(e.model.name,e.action)}} args - Arguments to filter and select certain fields only.
@example
// Get all ${e.plural}
const ${e.mapping.plural} = await ${e.method}()
// Get first 10 ${e.plural}
const ${e.mapping.plural} = await ${e.method}({ take: 10 })
${r}
`},fields:{where:(e,r)=>`Filter, which ${r} to fetch.`,orderBy:Nn.orderBy,skip:Nn.skip,cursor:(e,r)=>vc(`Sets the position for listing ${r}.`,"cursor"),take:Nn.take,distinct:Nn.distinct}},update:{body:e=>`Update one ${e.singular}.
@param {${Rr(e.model.name,e.action)}} args - Arguments to update one ${e.singular}.
@example
// Update one ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
},
data: {
// ... provide data here
}
})
`,fields:{data:e=>`The data needed to update a ${e}.`,where:e=>`Choose, which ${e} to update.`}},upsert:{body:e=>`Create or update one ${e.singular}.
@param {${Rr(e.model.name,e.action)}} args - Arguments to update or create a ${e.singular}.
@example
// Update or create a ${e.singular}
const ${Ve(e.mapping.model)} = await ${e.method}({
create: {
// ... data to create a ${e.singular}
},
update: {
// ... in case it already exists, update
},
where: {
// ... the filter for the ${e.singular} we want to update
}
})`,fields:{where:e=>`The filter to search for the ${e} to update in case it exists.`,create:e=>`In case the ${e} found by the \`where\` argument doesn't exist, create a new ${e} with this data.`,update:e=>`In case the ${e} was found with the provided \`where\` argument, update it with this data.`}},delete:{body:e=>`Delete a ${e.singular}.
@param {${Rr(e.model.name,e.action)}} args - Arguments to delete one ${e.singular}.
@example
// Delete one ${e.singular}
const ${e.singular} = await ${e.method}({
where: {
// ... filter to delete one ${e.singular}
}
})
`,fields:{where:e=>`Filter which ${e} to delete.`}},aggregate:{body:e=>`Allows you to perform aggregations operations on a ${e.singular}.
${Pd}
@param {${Rr(e.model.name,e.action)}} args - Select which aggregations you would like to apply and on what fields.
@example
// Ordered by age ascending
// Where email contains prisma.io
// Limited to the 10 users
const aggregations = await prisma.user.aggregate({
_avg: {
age: true,
},
where: {
email: {
contains: "prisma.io",
},
},
orderBy: {
age: "asc",
},
take: 10,
})`,fields:{where:e=>`Filter which ${e} to aggregate.`,orderBy:Nn.orderBy,cursor:()=>vc("Sets the start position","cursor"),take:Nn.take,skip:Nn.skip,_count:Nn._count,_avg:Nn._avg,_sum:Nn._sum,_min:Nn._min,_max:Nn._max,count:Nn.count,avg:Nn.avg,sum:Nn.sum,min:Nn.min,max:Nn.max}},count:{body:e=>`Count the number of ${e.plural}.
${Pd}
@param {${Rr(e.model.name,e.action)}} args - Arguments to filter ${e.plural} to count.
@example
// Count the number of ${e.plural}
const count = await ${e.method}({
where: {
// ... the filter for the ${e.plural} we want to count
}
})`,fields:{}},updateMany:{body:e=>`Update zero or more ${e.plural}.
${Pd}
@param {${Rr(e.model.name,e.action)}} args - Arguments to update one or more rows.
@example
// Update many ${e.plural}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
},
data: {
// ... provide data here
}
})
`,fields:{data:(e,r)=>`The data used to update ${r}.`,where:(e,r)=>`Filter which ${r} to update`,limit:(e,r)=>`Limit how many ${r} to update.`}},updateManyAndReturn:{body:e=>{let r=e.firstScalar?`
// Update zero or more ${e.plural} and only return the \`${e.firstScalar.name}\`
const ${Ve(e.mapping.model)}With${ot(e.firstScalar.name)}Only = await ${e.method}({
select: { ${e.firstScalar.name}: true },
where: {
// ... provide filter here
},
data: [
// ... provide data here
]
})`:"";return`Update zero or more ${e.plural} and returns the data updated in the database.
@param {${Rr(e.model.name,e.action)}} args - Arguments to update many ${e.plural}.
@example
// Update many ${e.plural}
const ${Ve(e.mapping.model)} = await ${e.method}({
where: {
// ... provide filter here
},
data: [
// ... provide data here
]
})
${r}
${Pd}
`},fields:{data:(e,r)=>`The data used to update ${r}.`,where:(e,r)=>`Filter which ${r} to update`,limit:(e,r)=>`Limit how many ${r} to update.`}},deleteMany:{body:e=>`Delete zero or more ${e.plural}.
@param {${Rr(e.model.name,e.action)}} args - Arguments to filter ${e.plural} to delete.
@example
// Delete a few ${e.plural}
const { count } = await ${e.method}({
where: {
// ... provide filter here
}
})
`,fields:{where:(e,r)=>`Filter which ${r} to delete`,limit:(e,r)=>`Limit how many ${r} to delete.`}},aggregateRaw:{body:e=>`Perform aggregation operations on a ${e.singular}.
@param {${Rr(e.model.name,e.action)}} args - Select which aggregations you would like to apply.
@example
const ${Ve(e.mapping.model)} = await ${e.method}({
pipeline: [
{ $match: { status: "registered" } },
{ $group: { _id: "$country", total: { $sum: 1 } } }
]
})`,fields:{pipeline:()=>"An array of aggregation stages to process and transform the document stream via the aggregation pipeline. ${@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline MongoDB Docs}.",options:()=>"Additional options to pass to the `aggregate` command ${@link https://docs.mongodb.com/manual/reference/command/aggregate/#command-fields MongoDB Docs}."}},findRaw:{body:e=>`Find zero or more ${e.plural} that matches the filter.
@param {${Rr(e.model.name,e.action)}} args - Select which filters you would like to apply.
@example
const ${Ve(e.mapping.model)} = await ${e.method}({
filter: { age: { $gt: 25 } }
})`,fields:{filter:()=>"The query predicate filter. If unspecified, then all documents in the collection will match the predicate. ${@link https://docs.mongodb.com/manual/reference/operator/query MongoDB Docs}.",options:()=>"Additional options to pass to the `find` command ${@link https://docs.mongodb.com/manual/reference/command/find/#command-fields MongoDB Docs}."}}};function bZ(e,r,n){let o={singular:ot(r.model),plural:ot(r.plural),firstScalar:n.fields.find(a=>a.kind==="scalar"),method:`prisma.${Ve(r.model)}.${e}`,action:e,mapping:r,model:n},i=T2[e]?.body(o);return i||""}function $$(e,r,n){return vZ(bZ(e,r,n))}function vZ(e){return`/**
${e.split(`
`).map(r=>" * "+r).join(`
`)}
**/`}function dw(e,r,n){if(!n||!r||!e)return;let o=typeof n=="string"?n:n.name;if(T2[r]&&T2[r]?.fields[o]){let i=e.name,a=(0,k$e.default)(e.name);return T2[r]?.fields[o](i,a)}}function $$e(e){return e.replace(/\\n/g,"\\\\n").replace(/\\r/g,"\\\\r").replace(/\\t/g,"\\\\t")}function N$e(e,r){let n=y6(e),o;r==="wasm-compiler-edge"||r==="client"?o=x6(n):o=n;let i=$$e(JSON.stringify(o));return`
config.runtimeDataModel = JSON.parse(${JSON.stringify(i)})`}var D2=W(require("node:fs")),EZ=W(require("node:path"));var N$=_i("prisma:client-generator-ts:wasm");function gNt(e){return e==="wasm-compiler-edge"}function L$e({runtimeName:e,runtimeBase:r,activeProvider:n,moduleFormat:o,compilerBuild:i}){let a=cr(o).with("esm",()=>"mjs").with("cjs",()=>"js").exhaustive(),c=e==="client",u=!c,l=`query_compiler_${i}_bg`,p,f,g;return u?(p=`./${l}`,f=`${p}.js`,g=`${p}.wasm`):(p=`${r}/${l}.${n}`,f=`${p}.mjs`,g=`${p}.wasm`),c?(f=`${p}.${a}`,g=`${p}.wasm-base64.${a}`,`
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
const { Buffer } = await import('node:buffer')
const wasmArray = Buffer.from(wasmBase64, 'base64')
return new WebAssembly.Module(wasmArray)
}
config.compilerWasm = {
getRuntime: async () => await import(${JSON.stringify(f)}),
getQueryCompilerWasmModule: async () => {
const { wasm } = await import(${JSON.stringify(g)})
return await decodeBase64AsWasm(wasm)
},
importName: ${JSON.stringify(`./${l}.js`)}
}`):u?`config.compilerWasm = {
getRuntime: async () => await import(${JSON.stringify(f)}),
getQueryCompilerWasmModule: async () => {
const { default: module } = await import(${JSON.stringify(`${g}?module`)})
return module
},
importName: ${JSON.stringify(`./${l}.js`)}
}`:"config.compilerWasm = undefined"}function yNt(e){let r=EZ.default.join(__dirname,e),n=EZ.default.join(__dirname,"..","..","..","cli","build",e);if(D2.default.existsSync(r))return N$("We are in the bundled Prisma CLI"),D2.default.readFileSync(r);if(D2.default.existsSync(n))return N$("We are in a dev/test environment"),D2.default.readFileSync(n);throw new Error(`Could not find ${e} in ${r} or ${n}`)}function B$e({activeProvider:e,runtimeName:r,compilerBuild:n}){let o={};if(N$("buildWasmFileMap with",{runtimeName:r}),!gNt(r))return N$("Skipping component compiler for runtime",r),o;let i=`query_compiler_${n}_bg`,a=`${i}.${e}`,c={[`${i}.wasm`]:`${a}.wasm`,[`${i}.js`]:`${a}.mjs`};for(let[u,l]of Object.entries(c))o[u]=yNt(l);return o}var SZ=W(ys());function j$e(e){return V(`runtime.${e}`)}function L$(e,r){return V("Omit").addGenericArgument(e).addGenericArgument(r)}function Od(e){return new xc("runtime.Types.Utils.JsPromise").addGenericArgument(e)}function Fd(e){return new xc("Prisma.PrismaPromise").addGenericArgument(e)}function B$(e){return new xc("runtime.Types.Utils.Optional").addGenericArgument(e)}function xNt(){let e=V("runtime.Types.Extensions.ExtendsHook").addGenericArgument(Mt("extends")).addGenericArgument(V("Prisma.TypeMapCb").addGenericArgument(V("OmitOpts"))).addGenericArgument(V("ExtArgs")).addGenericArgument(V("runtime.Types.Utils.Call").addGenericArgument(V("Prisma.TypeMapCb").addGenericArgument(V("OmitOpts"))).addGenericArgument(Me().add(de("extArgs",V("ExtArgs")))));return xe(de("$extends",e),{indentLevel:1})}function bNt(e){let r=yo("$transaction").setDocComment(qe`
Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
@example
\`\`\`
const [george, bob, alice] = await prisma.$transaction([
prisma.user.create({ data: { name: 'George' } }),
prisma.user.create({ data: { name: 'Bob' } }),
prisma.user.create({ data: { name: 'Alice' } }),
])
\`\`\`
Read more in our [docs](https://www.prisma.io/docs/orm/prisma-client/queries/transactions).
`).addGenericParameter(er("P").extends($e(Fd(Up)))).addParameter(lr("arg",w6(V("P")))).setReturnType(Od(V("runtime.Types.Utils.UnwrapTuple").addGenericArgument(V("P"))));if(e.dmmf.hasEnumInNamespace("TransactionIsolationLevel","prisma")){let n=Me().formatInline().add(de("isolationLevel",V("Prisma.TransactionIsolationLevel")).optional());r.addParameter(lr("options",n).optional())}return xe(r,{indentLevel:1,newLine:"leading"})}function vNt(e){let r=Me().formatInline().add(de("maxWait",ur).optional()).add(de("timeout",ur).optional());if(e.dmmf.hasEnumInNamespace("TransactionIsolationLevel","prisma")){let a=de("isolationLevel",V("Prisma.TransactionIsolationLevel")).optional();r.add(a)}let n=Od(V("R")),o=Ca().addParameter(lr("prisma",L$(V("PrismaClient"),ENt(e)))).setReturnType(n),i=yo("$transaction").addGenericParameter(er("R")).addParameter(lr("fn",o)).addParameter(lr("options",r).optional()).setReturnType(n);return xe(i,{indentLevel:1,newLine:"leading"})}function ENt(e){return e.isSqlProvider()?V("runtime.ITXClientDenyList"):Oe([V("runtime.ITXClientDenyList"),Mt("$transaction")])}function wNt(e){return e.dmmf.mappings.otherOperations.write.includes("queryRaw")?`
/**
* Performs a prepared raw query and returns the \`SELECT\` data.
* @example
* \`\`\`
* const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\`
* \`\`\`
*
* Read more in our [docs](https://pris.ly/d/raw-queries).
*/
$queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
/**
* Performs a raw query and returns the \`SELECT\` data.
* Susceptible to SQL injections, see documentation.
* @example
* \`\`\`
* const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
* \`\`\`
*
* Read more in our [docs](https://pris.ly/d/raw-queries).
*/
$queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;`:""}function SNt(e){return e.dmmf.mappings.otherOperations.write.includes("executeRaw")?`
/**
* Executes a prepared raw query and returns the number of affected rows.
* @example
* \`\`\`
* const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\`
* \`\`\`
*
* Read more in our [docs](https://pris.ly/d/raw-queries).
*/
$executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
/**
* Executes a raw query and returns the number of affected rows.
* Susceptible to SQL injections, see documentation.
* @example
* \`\`\`
* const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
* \`\`\`
*
* Read more in our [docs](https://pris.ly/d/raw-queries).
*/
$executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;`:""}function _Nt(e){if(!e.isPreviewFeatureOn("typedSql")||!e.dmmf.mappings.otherOperations.write.includes("queryRaw"))return"";let r=er("T"),n=yo("$queryRawTyped").setDocComment(qe`
Executes a typed SQL query and returns a typed result
@example
\`\`\`
import { myQuery } from '@prisma/client/sql'
const result = await prisma.$queryRawTyped(myQuery())
\`\`\`
`).addGenericParameter(r).addParameter(lr("typedSql",j$e("TypedSql").addGenericArgument($e(Gh)).addGenericArgument(r.toArgument()))).setReturnType(Fd($e(r.toArgument())));return xe(n,{indentLevel:1,newLine:"leading"})}function TNt(e){if(!e.dmmf.mappings.otherOperations.write.includes("runCommandRaw"))return"";let r=yo("$runCommandRaw").addParameter(lr("command",V("Prisma.InputJsonObject"))).setReturnType(Fd(V("Prisma.JsonObject"))).setDocComment(qe`
Executes a raw MongoDB command and returns the result of it.
@example
\`\`\`
const user = await prisma.$runCommandRaw({
aggregate: 'User',
pipeline: [{ $match: { name: 'Bob' } }, { $project: { email: true, _id: false } }],
explain: false,
})
\`\`\`
Read more in our [docs](https://pris.ly/d/raw-queries).
`);return xe(r,{indentLevel:1,newLine:"leading"})}function _Z({dmmf:e}){let r;return e.mappings.modelOperations.length?r=e.mappings.modelOperations[0]:r={model:"User",plural:"users"},qe`
## Prisma Client
Type-safe database client for TypeScript
@example
\`\`\`
const prisma = new PrismaClient({
adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
})
// Fetch zero or more ${ot(r.plural)}
const ${Ve(r.plural)} = await prisma.${Ve(r.model)}.findMany()
\`\`\`
Read more in our [docs](https://pris.ly/d/client).
`}var j$=class{constructor(r,n){this.context=r;this.runtimeName=n}get jsDoc(){return xe(_Z(this.context))}toTS(){let{dmmf:r}=this.context;return`export type LogOptions<ClientOptions extends Prisma.PrismaClientOptions> =
'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array<Prisma.LogLevel | Prisma.LogDefinition> ? Prisma.GetEvents<ClientOptions['log']> : never : never
export interface PrismaClientConstructor {
${(0,SZ.default)(this.jsDoc,2)}
new <
Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
LogOpts extends LogOptions<Options> = LogOptions<Options>,
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
>(options: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
}
${this.jsDoc}
export interface PrismaClient<
in LogOpts extends Prisma.LogLevel = never,
in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = undefined,
in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
> {
[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['other'] }
$on<V extends LogOpts>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;
/**
* Connect with the database
*/
$connect(): runtime.Types.Utils.JsPromise<void>;
/**
* Disconnect from the database
*/
$disconnect(): runtime.Types.Utils.JsPromise<void>;
${[SNt(this.context),wNt(this.context),_Nt(this.context),bNt(this.context),vNt(this.context),TNt(this.context),xNt()].filter(n=>n!==null).join(`
`).trim()}
${(0,SZ.default)(r.mappings.modelOperations.filter(n=>n.findMany).map(n=>{let o=Ve(n.model);o==="constructor"&&(o='["constructor"]');let i=["ExtArgs","{ omit: OmitOpts }"];return`/**
* \`prisma.${o}\`: Exposes CRUD operations for the **${n.model}** model.
* Example usage:
* \`\`\`ts
* // Fetch zero or more ${ot(n.plural)}
* const ${Ve(n.plural)} = await prisma.${o}.findMany()
* \`\`\`
*/
get ${o}(): Prisma.${n.model}Delegate<${i.join(", ")}>;`}).join(`
`),2)}
}`}};var DNt=`/*
* WARNING: This is an internal file that is subject to change!
*
* \u{1F6D1} Under no circumstances should you import this file directly! \u{1F6D1}
*
* Please import the \`PrismaClient\` class from the \`client.ts\` file instead.
*/
`;function U$e(e,r){let o=[un(e.runtimeImport).asNamespace("runtime"),un(e.importFileName("./prismaNamespace")).asNamespace("Prisma").typeOnly()].map(a=>xe(a)),i=new j$(e,r.runtimeName);return`${DNt}
${o.join(`
`)}
${CNt(e,r)}
${i.toTS()}
export function getPrismaClientClass(): PrismaClientConstructor {
return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor
}
`}function CNt(e,r){let{edge:n,generator:o,datamodel:i,runtimeBase:a,runtimeName:c,target:u,activeProvider:l,moduleFormat:p,compilerBuild:f,dmmf:g}=r,x={previewFeatures:o.previewFeatures,clientVersion:r.clientVersion,engineVersion:r.engineVersion,activeProvider:r.activeProvider,inlineSchema:i,runtimeDataModel:{models:{},enums:{},types:{}},parameterizationSchema:{strings:[],graph:""}};return`
const config: runtime.GetPrismaClientConfig = ${JSON.stringify(x,null,2)}
${N$e(e.dmmf.datamodel,c)}
${ANt(g)}
${L$e({runtimeBase:a,runtimeName:c,target:u,activeProvider:l,moduleFormat:p,compilerBuild:f})}
${M$e(n)}
`}function ANt(e){let r=l2(e);return`config.parameterizationSchema = {
strings: JSON.parse(${JSON.stringify(JSON.stringify(r.strings))}),
graph: "${r.graph}"
}`}var PNt=`/*
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
* If you're looking for something you can import in the client-side of your application, please refer to the \`browser.ts\` file instead.
*
* \u{1F7E2} You can import this file directly.
*/
`;function q$e(e,r){let n=[un(e.runtimeImport).asNamespace("runtime"),un(e.importFileName("./enums")).asNamespace("$Enums"),un(e.importFileName("./internal/class")).asNamespace("$Class"),un(e.importFileName("./internal/prismaNamespace")).asNamespace("Prisma")].map(i=>xe(i)),o=[bl(e.importFileName("./enums")).asNamespace("$Enums"),bl(e.importFileName("./enums")),it(lu("PrismaClient").setValue(D6("$Class.getPrismaClientClass",[]))).setDocComment(_Z(e)),it(jt("PrismaClient",V("$Class.PrismaClient").addGenericArgument(V("LogOpts")).addGenericArgument(V("OmitOpts")).addGenericArgument(V("ExtArgs"))).addGenericParameter(er("LogOpts").extends(V("Prisma.LogLevel")).default(Co)).addGenericParameter(er("OmitOpts").extends(V("Prisma.PrismaClientOptions").subKey("omit")).default(V("Prisma.PrismaClientOptions").subKey("omit"))).addGenericParameter(er("ExtArgs").extends(V("runtime.Types.Extensions.InternalArgs")).default(V("runtime.Types.Extensions.DefaultArgs"))))].map(i=>xe(i));return`${PNt}
${ONt(r.edge,r.moduleFormat)}
${n.join(`
`)}
${o.join(`
`)}
export { Prisma }
${k$(e).join(`
`)}
`}function ONt(e,r){if(e)return`globalThis['__dirname'] = '/'
`;let n=`import * as process from 'node:process'
import * as path from 'node:path'
`;return r==="esm"&&(n+=`import { fileURLToPath } from 'node:url'
globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
`),n}var FNt=`/*
* This file exports various common sort, input & filter types that are not directly linked to a particular model.
*
* \u{1F7E2} You can import this file directly.
*/
`;function G$e(e){let r=[un(e.runtimeImport).asNamespace("runtime").typeOnly(),un(e.importFileName("./enums")).asNamespace("$Enums"),un(e.importFileName("./internal/prismaNamespace")).asNamespace("Prisma").typeOnly()].map(o=>xe(o)),n=e.dmmf.inputObjectTypes.prisma?.filter(o=>!o.meta?.grouping)?.map(o=>new Ad(o,e).toTS())??[];return`${FNt}
${r.join(`
`)}
${n.join(`
`)}
${e.dmmf.inputObjectTypes.model?.map(o=>new Ad(o,e).toTS()).join(`
`)??""}
`}var H$e=`/*
* This file exports all enum related types from the schema.
*
* \u{1F7E2} You can import this file directly.
*/
`;function W$e(e){let r=[];for(let n of e.dmmf.datamodel.enums)r.push(new Kp(i2(n),!1).toTS());return r.length===0?`${H$e}
// This file is empty because there are no enums in the schema.
export {}
`:H$e+r.join(`
`)}var Jy=W(ys());var yu=class{constructor(r,n,o){this.type=r;this.context=n;this.action=o;this.moduleExport=it(jt(Rr(r.name,o),Me()).addGenericParameter(Po)).setDocComment(qe(`${r.name} ${o??"without action"}`))}moduleExport;addProperty(r){this.moduleExport.declaration.type.add(r)}addSchemaArgs(r){for(let n of r){let o=yZ(n,this.context),i=dw(this.type,this.action,n);i&&o.setDocComment(qe(i)),this.addProperty(o)}return this}addSelectArg(r=Vy(this.type.name)){return this.addProperty(de("select",Oe([V(`Prisma.${r}`).addGenericArgument(Po.toArgument()),Rt])).optional().setDocComment(qe(`Select specific fields to fetch from the ${this.type.name}`))),this}addIncludeArgIfHasRelations(r=C$(this.type.name),n=this.type){return n.fields.some(i=>i.outputType.location==="outputObjectTypes")?(this.addProperty(de("include",Oe([V(`Prisma.${r}`).addGenericArgument(Po.toArgument()),Rt])).optional().setDocComment(qe("Choose, which related nodes to fetch as well"))),this):this}addOmitArg(){return this.addProperty(de("omit",Oe([V(`Prisma.${aw(this.type.name)}`).addGenericArgument(Po.toArgument()),Rt])).optional().setDocComment(qe(`Omit specific fields from the ${this.type.name}`))),this}setGeneratedName(r){return this.moduleExport.declaration.setName(r),this}setComment(r){return this.moduleExport.setDocComment(qe(r)),this}createExport(){return this.moduleExport}};var z$e=W(ys());function U$(e,r){let n=FD(fw,e.type)?fw[e.type]:e.type;Array.isArray(n)&&(n=n[0]);let o;if(e.kind==="object"){let a=V(gu(e.type));r.isComposite(e.type)||a.addGenericArgument(V("ExtArgs")),o=a}else e.kind==="enum"?o=V(`$Enums.${n}`):o=V(n);e.isList?o=$e(o):e.isRequired||(o=Oe(o).addVariant(Rt));let i=de(e.name,o);return e.documentation&&i.setDocComment(qe(e.documentation)),i}function C2(e){return it(jt(e.name,Me().addMultiple(e.fields.map(INt))))}function INt(e){let r;if(e.outputType.location==="enumTypes"&&e.outputType.namespace==="model")r=V(RNt(e.outputType));else{let o=fw[e.outputType.type]??e.outputType.type;r=Array.isArray(o)?V(o[0]):V(o)}e.outputType.isList?r=$e(r):e.isNullable&&(r=Oe(r).addVariant(Rt));let n=de(e.name,r);return e.deprecation&&n.setDocComment(qe(`@deprecated since ${e.deprecation.sinceVersion} because ${e.deprecation.reason}`)),n}function RNt(e){let r=e.type;return`${e.namespace==="model"?"$Enums":"Prisma"}.${r}`}var q$=class{constructor(r,n){this.type=r;this.context=n}get argsTypes(){let r=[];r.push(new yu(this.type,this.context).addSelectArg().addIncludeArgIfHasRelations().createExport());for(let n of this.type.fields)n.args.length>0&&r.push(new yu(this.type,this.context).addSchemaArgs(n.args).setGeneratedName(V$e(this.type.name,n.name)).createExport());return r}toTS(){let{type:r}=this,{name:n}=r,o=C2(r);return`
/**
* Count Type ${n}
*/
${xe(o)}
export type ${Vy(n)}<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
${(0,z$e.default)(r.fields.map(i=>{let a=["boolean"];return i.outputType.location==="outputObjectTypes"&&a.push(lw(i,this.type.name)),i.args.length>0&&a.push(V$e(n,i.name)),`${i.name}?: ${a.join(" | ")}`}).join(`
`),2)}
}
${this.argsTypes.map(i=>xe(i)).join(`
`)}
`}};function V$e(e,r){return`${e}Count${ot(r)}Args`}var G$=class{constructor(r){this.outputType=r}toTS(){let{name:r}=this.outputType;return`
/**
* Fields of the ${r} model
*/
export interface ${pw(r)} {
${this.stringifyFields()}
}
`}stringifyFields(){let{name:r}=this.outputType;return this.outputType.fields.filter(n=>n.outputType.location!=="outputObjectTypes").map(n=>{let o=n.outputType,i=F$(o);return` readonly ${n.name}: Prisma.FieldRef<"${r}", ${i}>`}).join(`
`)}};function K$e(e,r){let n=r.dmmf.isComposite(e.name),o=Me(),i=Me(),a=Me();for(let l of e.fields)l.kind==="object"?r.dmmf.isComposite(l.type)?a.add(U$(l,r.dmmf)):o.add(U$(l,r.dmmf)):(l.kind==="enum"||l.kind==="scalar")&&i.add(U$(l,r.dmmf));let c=n?i:V("runtime.Types.Extensions.GetPayloadResult").addGenericArgument(i).addGenericArgument(V("ExtArgs").subKey("result").subKey(Ve(e.name))),u=jt(gu(e.name,!1),Me().add(de("name",Mt(e.name))).add(de("objects",o)).add(de("scalars",c)).add(de("composites",a)));return n||u.addGenericParameter(Po),it(u)}function H$({modelName:e,typeName:r=C$(e),context:n,fields:o}){let i=TZ(e,MNt(o,n.dmmf),n);return DZ(r,i)}function J$e({modelName:e,fields:r,context:n}){let o=Oe(r.filter(a=>a.outputType.location==="scalar"||a.outputType.location==="enumTypes"||n.dmmf.isComposite(a.outputType.type)).map(a=>Mt(a.name))),i=V("runtime.Types.Extensions.GetOmit").addGenericArgument(o).addGenericArgument(Y$e(e));return n.isPreviewFeatureOn("strictUndefinedChecks")&&i.addGenericArgument(V("runtime.Types.Skip")),DZ(aw(e),i)}function W$({modelName:e,typeName:r=Vy(e),fields:n,context:o}){let i=TZ(e,n,o),a=V("runtime.Types.Extensions.GetSelect").addGenericArgument(i).addGenericArgument(Y$e(e));return DZ(r,a)}function Y$e(e){return Po.toArgument().subKey("result").subKey(Ve(e))}function Z$e({modelName:e,fields:r,context:n}){let o=TZ(e,r.filter(i=>i.outputType.location==="scalar"||i.outputType.location==="enumTypes"),n);return it(jt(`${Vy(e)}Scalar`,o))}function TZ(e,r,n){let o=Me();for(let i of r){let a=Oe(jp);if(i.outputType.location==="outputObjectTypes"){let c=V(`Prisma.${lw(i,e)}`);c.addGenericArgument(Po.toArgument()),a.addVariant(c)}o.add(de(i.name,I$(n,a)).optional())}return o}function DZ(e,r){let n=jt(e,r);return it(n.addGenericParameter(Po))}function MNt(e,r){return e.filter(n=>n.outputType.location!=="outputObjectTypes"?!1:!r.isComposite(n.outputType.type))}function V$(e,r){let n=e.mappingsMap[r]??{model:r,plural:`${r}s`},o=Object.keys(n).filter(i=>i!=="model"&&i!=="plural"&&n[i]);return"aggregate"in n&&o.push("count"),o}var K$=class{constructor(r,n){this.model=r;this.context=n;this.dmmf=n.dmmf,this.type=this.context.dmmf.outputTypeMap.model[r.name],this.createManyAndReturnType=this.context.dmmf.outputTypeMap.model[E$e(r.name)],this.updateManyAndReturnType=this.context.dmmf.outputTypeMap.model[w$e(r.name)],this.mapping=this.context.dmmf.mappings.modelOperations.find(o=>o.model===r.name)}type;createManyAndReturnType;updateManyAndReturnType;mapping;dmmf;get argsTypes(){let r=[];for(let n of Object.keys(xd)){let o=this.rootFieldNameForAction(n);if(!o)continue;let i=this.dmmf.rootFieldMap[o];if(!i)throw new Error(`Oops this must not happen. Could not find field ${o} on either Query or Mutation`);if(n==="updateMany"||n==="deleteMany"||n==="createMany"||n==="findRaw"||n==="aggregateRaw")r.push(new yu(this.type,this.context,n).addSchemaArgs(i.args).createExport());else if(n==="createManyAndReturn"){let a=new yu(this.type,this.context,n).addSelectArg(uZ(this.type.name)).addOmitArg().addSchemaArgs(i.args);this.createManyAndReturnType&&a.addIncludeArgIfHasRelations(pZ(this.model.name),this.createManyAndReturnType),r.push(a.createExport())}else if(n==="updateManyAndReturn"){let a=new yu(this.type,this.context,n).addSelectArg(lZ(this.type.name)).addOmitArg().addSchemaArgs(i.args);this.updateManyAndReturnType&&a.addIncludeArgIfHasRelations(fZ(this.model.name),this.updateManyAndReturnType),r.push(a.createExport())}else n!=="groupBy"&&n!=="aggregate"&&r.push(new yu(this.type,this.context,n).addSelectArg().addOmitArg().addIncludeArgIfHasRelations().addSchemaArgs(i.args).createExport())}for(let n of this.type.fields){if(!n.args.length)continue;let o=this.dmmf.resolveOutputObjectType(n.outputType);o&&r.push(new yu(o,this.context).addSelectArg().addOmitArg().addIncludeArgIfHasRelations().addSchemaArgs(n.args).setGeneratedName(hZ(n,this.model.name)).setComment(`${this.model.name}.${n.name}`).createExport())}return r.push(new yu(this.type,this.context).addSelectArg().addOmitArg().addIncludeArgIfHasRelations().createExpo
export type ${a}<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
${(0,Jy.default)(i.args.map(c=>{let u={...c,comment:dw(this.type,"groupBy",c)};return new Ky(u,this.context).toTS()}).concat(o.fields.filter(c=>c.outputType.location==="outputObjectTypes").map(c=>c.outputType.location==="outputObjectTypes"?`${c.name}?: ${P$(c.outputType.type)}${c.name==="_count"?" | true":""}`:"")).join(`
`),2)}
}
${xe(C2(o))}
type ${mZ(r.name)}<T extends ${a}> = Prisma.PrismaPromise<
Array<
Prisma.PickEnumerable<${o.name}, T['by']> &
{
[P in ((keyof T) & (keyof ${o.name}))]: P extends '_count'
? T[P] extends boolean
? number
: Prisma.GetScalarType<T[P], ${o.name}[P]>
: Prisma.GetScalarType<T[P], ${o.name}[P]>
}
>
>
`}getAggregationTypes(){let{model:r,mapping:n}=this,o=this.dmmf.outputTypeMap.prisma[cw(r.name)];if(!o)throw new Error(`Could not get aggregate type "${cw(r.name)}" for "${r.name}"`);o=du(o);let i=this.dmmf.rootFieldMap[n.aggregate];if(!i)throw new Error(`Could not find aggregate root field for model ${r.name}. Mapping: ${n?.aggregate}`);let a=[o],c=this.dmmf.outputTypeMap.prisma[_$e(r.name)],u=this.dmmf.outputTypeMap.prisma[T$e(r.name)],l=this.dmmf.outputTypeMap.prisma[D$e(r.name)],p=this.dmmf.outputTypeMap.prisma[C$e(r.name)],f=this.dmmf.outputTypeMap.prisma[S2(r.name)];c&&a.push(c),u&&a.push(u),l&&a.push(l),p&&a.push(p),f&&a.push(f);let g=zy(r.name),x=cw(r.name);return`${a.map(C2).map(b=>xe(b)).join(`
`)}
${a.length>1?a.slice(1).map(b=>{let v={name:P$(b.name),constraints:{maxNumFields:null,minNumFields:null},fields:b.fields.map(S=>({...S,name:S.name,isNullable:!1,isRequired:!1,isParameterizable:!1,inputTypes:[{isList:!1,location:"scalar",type:"true"}]}))};return new Ad(v,this.context).toTS()}).join(`
`):""}
export type ${g}<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
${(0,Jy.default)(i.args.map(b=>{let v={...b,comment:dw(this.type,"aggregate",b)};return new Ky(v,this.context).toTS()}).concat(o.fields.map(b=>{let v="",S=dw(this.type,"aggregate",b.name);return v+=S?vZ(S)+`
`:"",b.name==="_count"||b.name==="count"?v+=`${b.name}?: true | ${dZ(r.name)}`:v+=`${b.name}?: ${P$(b.outputType.type)}`,v})).join(`
`),2)}
}
export type ${O$(r.name)}<T extends ${zy(r.name)}> = {
[P in keyof T & keyof ${x}]: P extends '_count' | 'count'
? T[P] extends true
? number
: Prisma.GetScalarType<T[P], ${x}[P]>
: Prisma.GetScalarType<T[P], ${x}[P]>
}`}getDeepInputTypes(){return this.dmmf.inputObjectTypes.prisma?.filter(r=>r.meta?.grouping===this.model.name).map(r=>new Ad(r,this.context).toTS()).join(`
`)}getCountTypes(){return(this.dmmf.schema.outputObjectTypes.prisma?.filter(n=>n.name===S$e(this.model.name)).map(n=>new q$(n,this.context))).map(n=>n.toTS()).join(`
`)}getModelExport(){let r=this.model.documentation??"",o=`${`Model ${this.model.name}
`}${r}`,i=it(jt(`${this.model.name}Model`,V("runtime.Types.Result.DefaultSelection").addGenericArgument(V(gu(this.model.name))))).setDocComment(qe(o));return xe(i)}toTS(){let{model:r}=this,n=this.dmmf.isComposite(r.name),o=xe(J$e({modelName:this.model.name,context:this.context,fields:this.type.fields}),{newLine:"leading"}),i=r.fields.some(l=>l.kind==="object"),a=i?xe(H$({modelName:this.model.name,context:this.context,fields:this.type.fields}),{newLine:"leading"}):"",c=i&&this.createManyAndReturnType?xe(H$({typeName:pZ(this.model.name),modelName:this.model.name,context:this.context,fields:this.createManyAndReturnType.fields}),{newLine:"leading"}):"",u=i&&this.updateManyAndReturnType?xe(H$({typeName:fZ(this.model.name),modelName:this.model.name,context:this.context,fields:this.updateManyAndReturnType.fields}),{newLine:"leading"}):"";return`
${this.getModelExport()}
${n?"":this.getAggregationTypes()}
${n?"":this.getGroupByTypes()}
${this.getDeepInputTypes()}
${this.getCountTypes()}
${xe(W$({modelName:this.model.name,fields:this.type.fields,context:this.context}))}
${this.createManyAndReturnType?xe(W$({modelName:this.model.name,fields:this.createManyAndReturnType.fields,context:this.context,typeName:uZ(this.model.name)}),{newLine:"leading"}):""}
${this.updateManyAndReturnType?xe(W$({modelName:this.model.name,fields:this.updateManyAndReturnType.fields,context:this.context,typeName:lZ(this.model.name)}),{newLine:"leading"}):""}
${xe(Z$e({modelName:this.model.name,fields:this.type.fields,context:this.context}),{newLine:"leading"})}
${o}${a}${c}${u}
${xe(K$e(this.model,this.context),{newLine:"none"})}
export type ${r.name}GetPayload<S extends boolean | null | undefined | ${Rr(r.name)}> = runtime.Types.Result.GetResult<${gu(r.name)}, S>
${n?"":new PZ(this.type,this.context).toTS()}
${new G$(this.type).toTS()}
// Custom InputTypes
${this.argsTypes.map(l=>xe(l)).join(`
`)}
`}},PZ=class{constructor(r,n){this.outputType=r;this.context=n}getNonAggregateActions(r){return r.filter(o=>o!=="aggregate"&&o!=="groupBy"&&o!=="count")}toTS(){let{name:r}=this.outputType,{dmmf:n}=this.context,o=n.mappingsMap[r]??{model:r,plural:`${r}s`},i=n.typeAndModelMap[r],a=V$(n,r),c=this.getNonAggregateActions(a),u=uw(r),l=Rr(r,"count"),p=[Po,er("GlobalOmitOptions").default(Me())],f=["select","include","distinct","omit"];this.context.isPreviewFeatureOn("relationJoins")&&f.push("relationLoadStrategy");let g=f.map(x=>`'${x}'`).join(" | ");return`${a.includes("aggregate")?`export type ${l}<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> =
Omit<${Rr(r,"findMany")}, ${g}> & {
select?: ${dZ(r)} | true
}
`:""}
export interface ${r}Delegate<${p.map(x=>xe(x)).join(", ")}> {
${(0,Jy.default)(`[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['${r}'], meta: { name: '${r}' } }`,2)}
${c.map(x=>{let b=kNt(r,x,this.context);return xe(b,{indentLevel:1,newLine:"trailing"})}).join(`
`)}
${a.includes("aggregate")?`${(0,Jy.default)($$("count",o,i),2)}
count<T extends ${l}>(
args?: Prisma.Subset<T, ${l}>,
): Prisma.PrismaPromise<
T extends runtime.Types.Utils.Record<'select', any>
? T['select'] extends true
? number
: Prisma.GetScalarType<T['select'], ${S2(r)}>
: number
>
`:""}
${a.includes("aggregate")?`${(0,Jy.default)($$("aggregate",o,i),2)}
aggregate<T extends ${zy(r)}>(args: Prisma.Subset<T, ${zy(r)}>): Prisma.PrismaPromise<${O$(r)}<T>>
`:""}
${a.includes("groupBy")?`${(0,Jy.default)($$("groupBy",o,i),2)}
groupBy<
T extends ${u},
HasSelectOrTake extends Prisma.Or<
Prisma.Extends<'skip', Prisma.Keys<T>>,
Prisma.Extends<'take', Prisma.Keys<T>>
>,
OrderByArg extends Prisma.True extends HasSelectOrTake
? { orderBy: ${u}['orderBy'] }
: { orderBy?: ${u}['orderBy'] },
OrderFields extends Prisma.ExcludeUnderscoreKeys<Prisma.Keys<Prisma.MaybeTupleToUnion<T['orderBy']>>>,
ByFields extends Prisma.MaybeTupleToUnion<T['by']>,
ByValid extends Prisma.Has<ByFields, OrderFields>,
HavingFields extends Prisma.GetHavingFields<T['having']>,
HavingValid extends Prisma.Has<ByFields, HavingFields>,
ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False,
InputErrors extends ByEmpty extends Prisma.True
? \`Error: "by" must not be empty.\`
: HavingValid extends Prisma.False
? {
[P in HavingFields]: P extends ByFields
? never
: P extends string
? \`Error: Field "\${P}" used in "having" needs to be provided in "by".\`
: [
Error,
'Field ',
P,
\` in "having" needs to be provided in "by"\`,
]
}[HavingFields]
: 'take' extends Prisma.Keys<T>
? 'orderBy' extends Prisma.Keys<T>
? ByValid extends Prisma.True
? {}
: {
[P in OrderFields]: P extends ByFields
? never
: \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
}[OrderFields]
: 'Error: If you provide "take", you also need to provide "orderBy"'
: 'skip' extends Prisma.Keys<T>
? 'orderBy' extends Prisma.Keys<T>
? ByValid extends Prisma.True
? {}
: {
[P in OrderFields]: P extends ByFields
? never
: \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
}[OrderFields]
: 'Error: If you provide "skip", you also need to provide "orderBy"'
: ByValid extends Prisma.True
? {}
: {
[P in OrderFields]: P extends ByFields
? never
: \`Error: Field "\${P}" in "orderBy" needs to be provided in "by"\`
}[OrderFields]
>(args: Prisma.SubsetIntersection<T, ${u}, OrderByArg> & InputErrors): {} extends InputErrors ? ${mZ(r)}<T> : Prisma.PrismaPromise<InputErrors>`:""}
/**
* Fields of the ${r} model
*/
readonly fields: ${pw(r)};
}
${xe(BNt(r,this.outputType,this.context))}
`}};function kNt(e,r,n){let o=n.dmmf.mappingsMap[e]??{model:e,plural:`${e}s`},i=n.dmmf.typeAndModelMap[e],a=LNt(o,r,n),c=yo(r).setDocComment(qe(bZ(r,o,i))).addParameter($Nt(e,r,a)).setReturnType(Q$e({modelName:e,actionName:r})),u=NNt(e,r);u&&c.addGenericParameter(u);for(let l of a)c.addGenericParameter(l);return c}function $Nt(e,r,n){let o=c=>(n.length>0&&(c=jy([c,...n.map(u=>V(u.name))])),lr("args",c));if(r==="count"){let c=L$(V(Rr(e,"findMany")),Oe(Mt("select")).addVariant(Mt("include")).addVariant(Mt("distinct")));return o(c).optional()}if(r==="findRaw"||r==="aggregateRaw")return o(V(`Prisma.${Rr(e,r)}`)).optional();let i=V("Prisma.SelectSubset").addGenericArgument(V("T")).addGenericArgument(V(Rr(e,r)).addGenericArgument(Po.toArgument())),a=o(i);return(r==="findMany"||r==="findFirst"||r==="deleteMany"||r==="createMany"||r==="createManyAndReturn"||r==="findFirstOrThrow")&&a.optional(),a}function NNt(e,r){if(r==="count"||r==="findRaw"||r==="aggregateRaw")return null;let n=er("T");return r==="aggregate"?n.extends(V(zy(e))):n.extends(V(Rr(e,r)))}function LNt(e,r,n){let o=e[r];if(!o)throw new Error(`Missing mapping for ${e.model}.${r}`);let i=n.dmmf.outputTypeMap.prisma.Query.fields.find(c=>c.name===o)??n.dmmf.outputTypeMap.prisma.Mutation.fields.find(c=>c.name===o);if(!i)throw new Error(`Can't find output field ${o} in the schema`);let a=[];for(let c of i.args){if(c.requiresOtherFields===void 0)continue;let u=Me();for(let l of c.requiresOtherFields)u.add(de(l,Me()));a.push(er(`${ot(c.name)}DependenciesValidator`).extends(S6().check(Mt(c.name)).extends(V("Prisma.Keys<T>")).then(u).else(Me())))}return a}function Q$e({modelName:e,actionName:r,isChaining:n=!1,isNullable:o=!1}){if(r==="count")return Od(ur);if(r==="aggregate")return Od(V(O$(e)).addGenericArgument(V("T")));if(r==="findRaw"||r==="aggregateRaw")return Fd(V("Prisma.JsonObject"));if(r==="deleteMany"||r==="updateMany"||r==="createMany")return Fd(V("Prisma.BatchPayload"));if(r==="findMany"||r==="createManyAndReturn"||r==="updateManyAndReturn"){let a=z$(e,r);return n&&(a=Oe(a).addVariant(V("Null"))),Fd(a)}if(n&&r==="findUniqueOrThrow"){let a=o?Rt:V("Null"),c=Oe(z$(e,r)).addVariant(a);return CZ(e,c,a)}if(r==="findFirst"||r==="findUnique"){let a=Oe(z$(e,r)).addVariant(Rt);return CZ(e,a,Rt)}return CZ(e,z$(e,r))}function CZ(e,r,n=Co){return V(`Prisma.${X$e(e)}`).addGenericArgument(r).addGenericArgument(n).addGenericArgument(Po.toArgument()).addGenericArgument(V("GlobalOmitOptions"))}function z$(e,r){return V("runtime.Types.Result.GetResult").addGenericArgument(V(gu(e)).addGenericArgument(Po.toArgument())).addGenericArgument(V("T")).addGenericArgument(Mt(r)).addGenericArgument(V("GlobalOmitOptions"))}function BNt(e,r,n){let o=qp(X$e(e));return o.addGenericParameter(er("T")).addGenericParameter(er("Null").default(Co)).addGenericParameter(Po).addGenericParameter(er("GlobalOmitOptions").default(Me())).extends(Fd(V("T"))),o.add(de($6,Mt("PrismaPromise")).readonly()),o.addMultiple(r.fields.filter(i=>i.outputType.location==="outputObjectTypes"&&!n.dmmf.isComposite(i.outputType.type)&&i.name!=="_count").map(i=>{let a=V(`Prisma.${lw(i,e)}`).addGenericArgument(Po.toArgument()),c=er("T").extends(a).default(Me());return yo(i.name).addGenericParameter(c).addParameter(lr("args",UNt(c.toArgument(),a)).optional()).setReturnType(Q$e({modelName:i.outputType.type,actionName:i.outputType.isList?"findMany":"findUniqueOrThrow",isChaining:!0,isNullable:i.isNullable}))})),o.add(yo("then").setDocComment(qe`
Attaches callbacks for the resolution and/or rejection of the Promise.
@param onfulfilled The callback to execute when the Promise is resolved.
@param onrejected The callback to execute when the Promise is rejected.
@returns A Promise for the completion of which ever callback is executed.
`).addGenericParameter(er("TResult1").default(V("T"))).addGenericParameter(er("TResult2").default(Co)).addParameter(AZ("onfulfilled",lr("value",V("T")),V("TResult1"))).addParameter(AZ("onrejected",lr("reason",Up),V("TResult2"))).setReturnType(Od(Oe([V("TResult1"),V("TResult2")])))),o.add(yo("catch").setDocComment(qe`
Attaches a callback for only the rejection of the Promise.
@param onrejected The callback to execute when the Promise is rejected.
@returns A Promise for the completion of the callback.
`).addGenericParameter(er("TResult").default(Co)).addParameter(AZ("onrejected",lr("reason",Up),V("TResult"))).setReturnType(Od(Oe([V("T"),V("TResult")])))),o.add(yo("finally").setDocComment(qe`
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
resolved value cannot be modified from the callback.
@param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
@returns A Promise for the completion of the callback.
`).addParameter(lr("onfinally",Oe([Ca(),jE,Rt])).optional()).setReturnType(Od(V("T")))),it(o).setDocComment(qe`
The delegate class that acts as a "Promise-like" for ${e}.
Why is this prefixed with \`Prisma__\`?
Because we want to prevent naming conflicts as mentioned in
https://github.com/prisma/prisma-client-js/issues/707
`)}function AZ(e,r,n){return lr(e,Oe([Ca().addParameter(r).setReturnType(jNt(n)),jE,Rt])).optional()}function jNt(e){return Oe([e,V("PromiseLike").addGenericArgument(e)])}function UNt(e,r){return V("Prisma.Subset").addGenericArgument(e).addGenericArgument(r)}function X$e(e){return`Prisma__${e}Client`}function eNe(e,r){let n=`/*
* This file exports the \`${r}\` model and its related types.
*
* \u{1F7E2} You can import this file directly.
*/
`,i=[un(e.runtimeImport).asNamespace("runtime").typeOnly(),un(e.importFileName("../enums")).asNamespace("$Enums").typeOnly(),un(e.importFileName("../internal/prismaNamespace")).asNamespace("Prisma").typeOnly()].map(c=>xe(c)).join(`
`),a=e.dmmf.typeAndModelMap[r];return n+i+`
`+new K$(a,e).toTS()}var qNt=`/*
* This is a barrel export file for all models and their related types.
*
* \u{1F7E2} You can import this file directly.
*/
`;function tNe(e,r){let n=r.map(o=>`export type * from './models/${e.importFileName(o)}'`);return n.push(`export type * from './${e.importFileName("commonInputTypes")}'`),qNt+n.join(`
`)}var J$=`
export const NullTypes = {
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
}
/**
* Helper for filtering JSON entries that have \`null\` on the database (empty on the db)
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const DbNull = runtime.DbNull
/**
* Helper for filtering JSON entries that have JSON \`null\` values (not empty on the db)
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const JsonNull = runtime.JsonNull
/**
* Helper for filtering JSON entries that are \`Prisma.DbNull\` or \`Prisma.JsonNull\`
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const AnyNull = runtime.AnyNull
`;var GNt=`/*
* WARNING: This is an internal file that is subject to change!
*
* \u{1F6D1} Under no circumstances should you import this file directly! \u{1F6D1}
*
* All exports from this file are wrapped under a \`Prisma\` namespace object in the browser.ts file.
* While this enables partial backward compatibility, it is not part of the stable public API.
*
* If you are looking for your Models, Enums, and Input Types, please import them from the respective
* model files in the \`model\` directory!
*/
`;function rNe(e){let r=e.dmmf.schema.enumTypes.prisma?.map(n=>new Kp(n,!0).toTS());return`${GNt}
${xe(un(`${e.runtimeBase}/index-browser`).asNamespace("runtime"))}
export type * from '${e.importFileName("../models")}'
export type * from '${e.importFileName("./prismaNamespace")}'
export const Decimal = runtime.Decimal
${J$}
${new Kp({name:"ModelName",values:e.dmmf.mappings.modelOperations.map(n=>n.model)},!0).toTS()}
/*
* Enums
*/
${r?.join(`
`)}
`}var nNe=({clientVersion:e,engineVersion:r,generator:n})=>`export type DMMF = typeof runtime.DMMF
export type PrismaPromise<T> = runtime.Types.Public.PrismaPromise<T>
/**
* Prisma Errors
*/
export const PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError
export type PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError
export const PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError
export type PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError
export const PrismaClientRustPanicError = runtime.PrismaClientRustPanicError
export type PrismaClientRustPanicError = runtime.PrismaClientRustPanicError
export const PrismaClientInitializationError = runtime.PrismaClientInitializationError
export type PrismaClientInitializationError = runtime.PrismaClientInitializationError
export const PrismaClientValidationError = runtime.PrismaClientValidationError
export type PrismaClientValidationError = runtime.PrismaClientValidationError
/**
* Re-export of sql-template-tag
*/
export const sql = runtime.sqltag
export const empty = runtime.empty
export const join = runtime.join
export const raw = runtime.raw
export const Sql = runtime.Sql
export type Sql = runtime.Sql
${HNt(n.previewFeatures)}
/**
* Decimal.js
*/
export const Decimal = runtime.Decimal
export type Decimal = runtime.Decimal
export type DecimalJsLike = runtime.DecimalJsLike
/**
* Extensions
*/
export type Extension = runtime.Types.Extensions.UserArgs
export const getExtensionContext = runtime.Extensions.getExtensionContext
export type Args<T, F extends runtime.Operation> = runtime.Types.Public.Args<T, F>
export type Payload<T, F extends runtime.Operation = never> = runtime.Types.Public.Payload<T, F>
export type Result<T, A, F extends runtime.Operation> = runtime.Types.Public.Result<T, A, F>
export type Exact<A, W> = runtime.Types.Public.Exact<A, W>
export type PrismaVersion = {
client: string
engine: string
}
/**
* Prisma Client JS version: ${e}
* Query Engine version: ${r}
*/
export const prismaVersion: PrismaVersion = {
client: "${e}",
engine: "${r}"
}
/**
* Utility Types
*/
export type Bytes = runtime.Bytes
export type JsonObject = runtime.JsonObject
export type JsonArray = runtime.JsonArray
export type JsonValue = runtime.JsonValue
export type InputJsonObject = runtime.InputJsonObject
export type InputJsonArray = runtime.InputJsonArray
export type InputJsonValue = runtime.InputJsonValue
${J$}
type SelectAndInclude = {
select: any
include: any
}
type SelectAndOmit = {
select: any
omit: any
}
/**
* From T, pick a set of properties whose keys are in the union K
*/
type Prisma__Pick<T, K extends keyof T> = {
[P in K]: T[P];
};
export type Enumerable<T> = T | Array<T>;
/**
* Subset
* @desc From \`T\` pick properties that exist in \`U\`. Simple version of Intersection
*/
export type Subset<T, U> = {
[key in keyof T]: key extends keyof U ? T[key] : never;
};
/**
* SelectSubset
* @desc From \`T\` pick properties that exist in \`U\`. Simple version of Intersection.
* Additionally, it validates, if both select and include are present. If the case, it errors.
*/
export type SelectSubset<T, U> = {
[key in keyof T]: key extends keyof U ? T[key] : never
} &
(T extends SelectAndInclude
? 'Please either choose \`select\` or \`include\`.'
: T extends SelectAndOmit
? 'Please either choose \`select\` or \`omit\`.'
: {})
/**
* Subset + Intersection
* @desc From \`T\` pick properties that exist in \`U\` and intersect \`K\`
*/
export type SubsetIntersection<T, U, K> = {
[key in keyof T]: key extends keyof U ? T[key] : never
} &
K
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
/**
* XOR is needed to have a real mutually exclusive union type
* https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types
*/
export type XOR<T, U> =
T extends object ?
U extends object ?
(Without<T, U> & U) | (Without<U, T> & T)
: U : T
/**
* Is T a Record?
*/
type IsObject<T extends any> = T extends Array<any>
? False
: T extends Date
? False
: T extends Uint8Array
? False
: T extends BigInt
? False
: T extends object
? True
: False
/**
* If it's T[], return T
*/
export type UnEnumerate<T extends unknown> = T extends Array<infer U> ? U : T
/**
* From ts-toolbelt
*/
type __Either<O extends object, K extends Key> = Omit<O, K> &
{
// Merge all but K
[P in K]: Prisma__Pick<O, P & keyof O> // With K possibilities
}[K]
type EitherStrict<O extends object, K extends Key> = Strict<__Either<O, K>>
type EitherLoose<O extends object, K extends Key> = ComputeRaw<__Either<O, K>>
type _Either<
O extends object,
K extends Key,
strict extends Boolean
> = {
1: EitherStrict<O, K>
0: EitherLoose<O, K>
}[strict]
export type Either<
O extends object,
K extends Key,
strict extends Boolean = 1
> = O extends unknown ? _Either<O, K, strict> : never
export type Union = any
export type PatchUndefined<O extends object, O1 extends object> = {
[K in keyof O]: O[K] extends undefined ? At<O1, K> : O[K]
} & {}
/** Helper Types for "Merge" **/
export type IntersectOf<U extends Union> = (
U extends unknown ? (k: U) => void : never
) extends (k: infer I) => void
? I
: never
export type Overwrite<O extends object, O1 extends object> = {
[K in keyof O]: K extends keyof O1 ? O1[K] : O[K];
} & {};
type _Merge<U extends object> = IntersectOf<Overwrite<U, {
[K in keyof U]-?: At<U, K>;
}>>;
type Key = string | number | symbol;
type AtStrict<O extends object, K extends Key> = O[K & keyof O];
type AtLoose<O extends object, K extends Key> = O extends unknown ? AtStrict<O, K> : never;
export type At<O extends object, K extends Key, strict extends Boolean = 1> = {
1: AtStrict<O, K>;
0: AtLoose<O, K>;
}[strict];
export type ComputeRaw<A extends any> = A extends Function ? A : {
[K in keyof A]: A[K];
} & {};
export type OptionalFlat<O> = {
[K in keyof O]?: O[K];
} & {};
type _Record<K extends keyof any, T> = {
[P in K]: T;
};
// cause typescript not to expand types and preserve names
type NoExpand<T> = T extends unknown ? T : never;
// this type assumes the passed object is entirely optional
export type AtLeast<O extends object, K extends string> = NoExpand<
O extends unknown
? | (K extends keyof O ? { [P in K]: O[P] } & O : O)
| {[P in keyof O as P extends K ? P : never]-?: O[P]} & O
: never>;
type _Strict<U, _U = U> = U extends unknown ? U & OptionalFlat<_Record<Exclude<Keys<_U>, keyof U>, never>> : never;
export type Strict<U extends object> = ComputeRaw<_Strict<U>>;
/** End Helper Types for "Merge" **/
export type Merge<U extends object> = ComputeRaw<_Merge<Strict<U>>>;
export type Boolean = True | False
export type True = 1
export type False = 0
export type Not<B extends Boolean> = {
0: 1
1: 0
}[B]
export type Extends<A1 extends any, A2 extends any> = [A1] extends [never]
? 0 // anything \`never\` is false
: A1 extends A2
? 1
: 0
export type Has<U extends Union, U1 extends Union> = Not<
Extends<Exclude<U1, U>, U1>
>
export type Or<B1 extends Boolean, B2 extends Boolean> = {
0: {
0: 0
1: 1
}
1: {
0: 1
1: 1
}
}[B1][B2]
export type Keys<U extends Union> = U extends unknown ? keyof U : never
export type GetScalarType<T, O> = O extends object ? {
[P in keyof T]: P extends keyof O
? O[P]
: never
} : never
type FieldPaths<
T,
U = Omit<T, '_avg' | '_sum' | '_count' | '_min' | '_max'>
> = IsObject<T> extends True ? U : T
export type GetHavingFields<T> = {
[K in keyof T]: Or<
Or<Extends<'OR', K>, Extends<'AND', K>>,
Extends<'NOT', K>
> extends True
? // infer is only needed to not hit TS limit
// based on the brilliant idea of Pierre-Antoine Mills
// https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437
T[K] extends infer TK
? GetHavingFields<UnEnumerate<TK> extends object ? Merge<UnEnumerate<TK>> : never>
: never
: {} extends FieldPaths<T[K]>
? never
: K
}[keyof T]
/**
* Convert tuple to union
*/
type _TupleToUnion<T> = T extends (infer E)[] ? E : never
type TupleToUnion<K extends readonly any[]> = _TupleToUnion<K>
export type MaybeTupleToUnion<T> = T extends any[] ? TupleToUnion<T> : T
/**
* Like \`Pick\`, but additionally can also accept an array of keys
*/
export type PickEnumerable<T, K extends Enumerable<keyof T> | keyof T> = Prisma__Pick<T, MaybeTupleToUnion<K>>
/**
* Exclude all keys with underscores
*/
export type ExcludeUnderscoreKeys<T extends string> = T extends \`_\${string}\` ? never : T
export type FieldRef<Model, FieldType> = runtime.FieldRef<Model, FieldType>
type FieldRefInputType<Model, FieldType> = Model extends never ? never : FieldRef<Model, FieldType>
`;function HNt(e){return e.includes("strictUndefinedChecks")?`
/**
* Prisma.skip
*/
export const skip = runtime.skip
`:""}var Y$=class{constructor(r){this.type=r}toTS(){let r=this.getAllowedTypes();return`
/**
* Reference to a field of type ${r}
*/
export type ${this.type.name}<$PrismaModel> = FieldRefInputType<$PrismaModel, ${r}>
`}getAllowedTypes(){return this.type.allowTypes.map(F$).join(" | ")}};function oNe(e){let r=Me().addMultiple(e.datamodel.models.map(n=>{let o=V(`Prisma.${aw(n.name)}`);return de(Ve(n.name),o).optional()}));return it(jt("GlobalOmitConfig",r))}function iNe(e){return`
export interface TypeMapCb<GlobalOmitOptions = {}> extends runtime.Types.Utils.Fn<{extArgs: runtime.Types.Extensions.InternalArgs }, runtime.Types.Utils.Record<string, any>> {
returns: TypeMap<this['params']['extArgs'], GlobalOmitOptions>
}
export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> = ${`${xe(WNt(e))} & ${VNt(e)}`}`}function WNt(e){let r=Me(),n=e.dmmf.datamodel.models.map(a=>a.name);n.length===0?r.add(de("modelProps",Co)):r.add(de("modelProps",Oe(n.map(a=>Mt(Ve(a))))));let o=e.dmmf.hasEnumInNamespace("TransactionIsolationLevel","prisma")?V("TransactionIsolationLevel"):Co;r.add(de("txIsolationLevel",o));let i=Me();return i.addMultiple(n.map(a=>{let c=Me();c.add(de("payload",V(gu(a)).addGenericArgument(Po.toArgument()))),c.add(de("fields",V(`Prisma.${pw(a)}`)));let u=V$(e.dmmf,a),l=Me();return l.addMultiple(u.map(p=>{let f=Me(),g=`Prisma.${Rr(a,p)}`;return f.add(de("args",V(g).addGenericArgument(Po.toArgument()))),f.add(de("result",zNt(a,p))),de(p,f)})),c.add(de("operations",l)),de(a,c)})),Me().add(de("globalOmitOptions",Me().add(de("omit",V("GlobalOmitOptions"))))).add(de("meta",r)).add(de("model",i))}function VNt(e){let r=e.dmmf.getOtherOperationNames().flatMap(o=>{let i=[`$${o}`];return(o==="executeRaw"||o==="queryRaw")&&i.push(`$${o}Unsafe`),o==="queryRaw"&&e.isPreviewFeatureOn("typedSql")&&i.push("$queryRawTyped"),i}),n={$executeRaw:{args:"[query: TemplateStringsArray | Sql, ...values: any[]]",result:"any"},$queryRaw:{args:"[query: TemplateStringsArray | Sql, ...values: any[]]",result:"any"},$executeRawUnsafe:{args:"[query: string, ...values: any[]]",result:"any"},$queryRawUnsafe:{args:"[query: string, ...values: any[]]",result:"any"},$runCommandRaw:{args:"Prisma.InputJsonObject",result:"JsonObject"},$queryRawTyped:{args:"runtime.UnknownTypedSql",result:"JsonObject"}};return`{
other: {
payload: any
operations: {${r.reduce((o,i)=>`${o}
${i}: {
args: ${n[i].args},
result: ${n[i].result}
}`,"")}
}
}
}`}function zNt(e,r){if(r==="count")return Oe([B$(V(`Prisma.${S2(e)}`)),ur]);if(r==="groupBy")return $e(B$(V(`Prisma.${A$(e)}`)));if(r==="aggregate")return B$(V(`Prisma.${cw(e)}`));if(r==="findRaw")return V("Prisma.JsonObject");if(r==="aggregateRaw")return V("Prisma.JsonObject");if(r==="deleteMany")return V("BatchPayload");if(r==="createMany")return V("BatchPayload");if(r==="createManyAndReturn")return $e(Tl(e));if(r==="updateMany")return V("BatchPayload");if(r==="updateManyAndReturn")return $e(Tl(e));if(r==="findMany")return $e(Tl(e));if(r==="findFirst")return Oe([Tl(e),Rt]);if(r==="findUnique")return Oe([Tl(e),Rt]);if(r==="findFirstOrThrow"||r==="findUniqueOrThrow"||r==="create"||r==="update"||r==="upsert"||r==="delete")return Tl(e);Hs(r,`Unknown action: ${r}`)}function Tl(e){return V("runtime.Types.Utils.PayloadToResult").addGenericArgument(V(gu(e)))}var KNt=`/*
* WARNING: This is an internal file that is subject to change!
*
* \u{1F6D1} Under no circumstances should you import this file directly! \u{1F6D1}
*
* All exports from this file are wrapped under a \`Prisma\` namespace object in the client.ts file.
* While this enables partial backward compatibility, it is not part of the stable public API.
*
* If you are looking for your Models, Enums, and Input Types, please import them from the respective
* model files in the \`model\` directory!
*/
`;function sNe(e,r){let n=[un(e.runtimeImport).asNamespace("runtime"),un(e.importFileName("../models")).asNamespace("Prisma").typeOnly(),un(e.importFileName("./class")).named(F6("PrismaClient").typeOnly())].map(c=>xe(c)),o=e.dmmf.schema.enumTypes.prisma?.map(c=>new Kp(c,!0).toTS()),i=e.dmmf.schema.fieldRefTypes.prisma?.map(c=>new Y$(c).toTS())??[],a=e.isSqlProvider()?"runtime.ITXClientDenyList":"runtime.ITXClientDenyList | '$transaction'";return`${KNt}
${n.join(`
`)}
export type * from '${e.importFileName("../models")}'
${nNe(r)}
${new Kp({name:"ModelName",values:e.dmmf.mappings.modelOperations.map(c=>c.model)},!0).toTS()}
${iNe(e)}
/**
* Enums
*/
${o?.join(`
`)}
${i.length>0?`
/**
* Field references
*/
${i.join(`
`)}`:""}
/**
* Batch Payload for updateMany & deleteMany & createMany
*/
export type BatchPayload = {
count: number
}
${JNt()}
export type DefaultPrismaClient = PrismaClient
export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
${xe(it(YNt(e)))}
${xe(oNe(e.dmmf))}
/* Types for Logging */
export type LogLevel = 'info' | 'query' | 'warn' | 'error'
export type LogDefinition = {
level: LogLevel
emit: 'stdout' | 'event'
}
export type CheckIsLogLevel<T> = T extends LogLevel ? T : never;
export type GetLogType<T> = CheckIsLogLevel<
T extends LogDefinition ? T['level'] : T
>;
export type GetEvents<T extends any[]> = T extends Array<LogLevel | LogDefinition>
? GetLogType<T[number]>
: never;
export type QueryEvent = {
timestamp: Date
query: string
params: string
duration: number
target: string
}
export type LogEvent = {
timestamp: Date
message: string
target: string
}
/* End Types for Logging */
export type PrismaAction =
| 'findUnique'
| 'findUniqueOrThrow'
| 'findMany'
| 'findFirst'
| 'findFirstOrThrow'
| 'create'
| 'createMany'
| 'createManyAndReturn'
| 'update'
| 'updateMany'
| 'updateManyAndReturn'
| 'upsert'
| 'delete'
| 'deleteMany'
| 'executeRaw'
| 'queryRaw'
| 'aggregate'
| 'count'
| 'runCommandRaw'
| 'findRaw'
| 'groupBy'
/**
* \`PrismaClient\` proxy available in interactive transactions.
*/
export type TransactionClient = Omit<DefaultPrismaClient, ${a}>
`}function JNt(){let e=it(lu("defineExtension").setValue(uMe("runtime.Extensions.defineExtension").as(V("unknown")).as(V("runtime.Types.Extensions.ExtendsHook").addGenericArgument(Mt("define")).addGenericArgument(V("TypeMapCb")).addGenericArgument(V("runtime.Types.Extensions.DefaultArgs")))));return xe(e)}function YNt(e){let r=Me().add(de("adapter",V("runtime.SqlDriverAdapterFactory")).setDocComment(qe("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-pg`."))).add(de("accelerateUrl",Co).optional()),n=Me().add(de("accelerateUrl",Yn).setDocComment(qe("Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database."))).add(de("adapter",Co).optional()),o=Oe([r,n]),i=Me().add(de("errorFormat",V("ErrorFormat")).optional().setDocComment(qe('@default "colorless"'))).add(de("log",$e(Oe([V("LogLevel"),V("LogDefinition")]))).optional().setDocComment(qe`
@example
\`\`\`
// Shorthand for \`emit: 'stdout'\`
log: ['query', 'info', 'warn', 'error']
// Emit as events only
log: [
{ emit: 'event', level: 'query' },
{ emit: 'event', level: 'info' },
{ emit: 'event', level: 'warn' }
{ emit: 'event', level: 'error' }
]
// Emit as events and log to stdout
log: [
{ emit: 'stdout', level: 'query' },
{ emit: 'stdout', level: 'info' },
{ emit: 'stdout', level: 'warn' }
{ emit: 'stdout', level: 'error' }
]
\`\`\`
Read more in our [docs](https://pris.ly/d/logging).
`)),a=Me().add(de("maxWait",ur).optional()).add(de("timeout",ur).optional());e.dmmf.hasEnumInNamespace("TransactionIsolationLevel","prisma")&&a.add(de("isolationLevel",V("TransactionIsolationLevel")).optional()),i.add(de("transactionOptions",a).optional().setDocComment(qe`
The default values for transactionOptions
maxWait ?= 2000
timeout ?= 5000
`)),i.add(de("omit",V("GlobalOmitConfig")).optional().setDocComment(qe`
Global configuration for omitting model fields by default.
@example
\`\`\`
const prisma = new PrismaClient({
omit: {
user: {
password: true
}
}
})
\`\`\`
`)),e.isSqlProvider()&&i.add(de("comments",$e(V("runtime.SqlCommenterPlugin"))).optional().setDocComment(qe`
SQL commenter plugins that add metadata to SQL queries as comments.
Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
@example
\`\`\`
const prisma = new PrismaClient({
adapter,
comments: [
traceContext(),
queryInsights(),
],
})
\`\`\`
`));let c=jy([o,i]);return jt("PrismaClientOptions",c)}var Z$=class{dmmf;genericArgsInfo;runtimeBase;runtimeImport;outputFileName;importFileName;generator;provider;constructor({dmmf:r,genericArgsInfo:n,runtimeBase:o,runtimeImport:i,outputFileName:a,importFileName:c,generator:u,provider:l}){this.dmmf=r,this.genericArgsInfo=n,this.runtimeBase=o,this.runtimeImport=i,this.outputFileName=a,this.importFileName=c,this.generator=u,this.provider=l}isPreviewFeatureOn(r){return this.generator?.previewFeatures?.includes(r)??!1}isSqlProvider(){return this.provider!=="mongodb"}};var A2=class{constructor(r){this.options=r;this.dmmf=new R$(r.dmmf),this.genericsInfo=new M$(this.dmmf)}dmmf;genericsInfo;generateClientFiles(){let r=new Z$({dmmf:this.dmmf,genericArgsInfo:this.genericsInfo,runtimeBase:this.options.runtimeBase,runtimeImport:`${this.options.runtimeBase}/${this.options.runtimeName}`,outputFileName:T$(this.options.generatedFileExtension),importFileName:D$(this.options.importFileExtension),generator:this.options.generator,provider:this.options.activeProvider}),n=Object.values(r.dmmf.typeAndModelMap).filter(i=>r.dmmf.outputTypeMap.model[i.name]).map(i=>i.name),o=n.reduce((i,a)=>(i[r.outputFileName(a)]=eNe(r,a),i),{});return{[r.outputFileName("client")]:q$e(r,this.options),[r.outputFileName("browser")]:R$e(r,this.options),[r.outputFileName("enums")]:W$e(r),[r.outputFileName("commonInputTypes")]:G$e(r),[r.outputFileName("models")]:tNe(r,n),models:o,internal:{[r.outputFileName("prismaNamespace")]:sNe(r,this.options),[r.outputFileName("prismaNamespaceBrowser")]:rNe(r),[r.outputFileName("class")]:U$e(r,this.options)}}}};var Q$=class{enums;constructor(r){this.enums=r.map(n=>({name:n.dbName??n.name,values:n.values.map(o=>o.dbName??o.name)}))}isEmpty(){return this.enums.length===0}hasEnum(r){return!!this.enums.find(n=>n.name===r)}*validJsIdentifiers(){for(let r of this.enums)gc(r.name)&&(yield r)}*invalidJsIdentifiers(){for(let r of this.enums)gc(r.name)||(yield r)}};function aNe(e){let r=pu(),n=qp("$DbEnums");for(let o of e.enums)n.add(de(o.name,ZNt(o)));return r.add(it(n)),xe(r)}function ZNt(e){return Oe(e.values.map(Mt))}function cNe(e,r){return r.isEmpty()?!1:e.parameters.some(n=>r.hasEnum(n.typ))||e.resultColumns.some(n=>r.hasEnum(n.typ))}function uNe({queries:e,enums:r,importName:n}){let o=pu();r.isEmpty()||o.add(bl(n("./sql/$DbEnums")).named(cMe("$DbEnums").typeOnly()));for(let i of e)o.add(bl(n(`./sql/${i.name}`)));return xe(o)}var OZ=V("$runtime.Decimal"),lNe=V("$runtime.Bytes"),mw=V("Date"),pNe=V("$runtime.InputJsonObject"),fNe=V("$runtime.JsonValue"),dNe=Oe([ur,qh]),mNe=Oe([ur,OZ]),QNt={unknown:Gh,string:Yn,int:ur,bigint:{in:dNe,out:qh},decimal:{in:mNe,out:OZ},float:ur,double:ur,enum:Yn,bytes:lNe,bool:jp,char:Yn,json:{in:pNe,out:fNe},xml:Yn,uuid:Yn,date:mw,datetime:mw,time:mw,null:Rt,"int-array":$e(ur),"string-array":$e(Yn),"json-array":{in:$e(pNe),out:$e(fNe)},"uuid-array":$e(Yn),"xml-array":$e(Yn),"bigint-array":{in:$e(dNe),out:$e(qh)},"float-array":$e(ur),"double-array":$e(ur),"char-array":$e(Yn),"bytes-array":$e(lNe),"bool-array":$e(jp),"date-array":$e(mw),"time-array":$e(mw),"datetime-array":$e(mw),"decimal-array":{in:$e(mNe),out:$e(OZ)}};function hNe(e,r,n){let o=yNe(e,n).in;return r?new Hp(o).addVariant(Rt):o}function gNe(e,r,n){let o=yNe(e,n).out;return r?new Hp(o).addVariant(Rt):o}function yNe(e,r){let n=QNt[e];if(!n){if(r.hasEnum(e)){let o=XNt(e);return{in:o,out:o}}throw new Error("Unknown type")}return n instanceof Dr?{in:n,out:n}:n}function XNt(e){return V("$DbEnums").subKey(e)}function xNe({query:e,runtimeBase:r,runtimeName:n,enums:o,importName:i}){let a=pu();a.addImport(un(`${r}/${n}`).asNamespace("$runtime")),cNe(e,o)&&a.addImport(un(i("./$DbEnums")).named(F6("$DbEnums").typeOnly()));let c=qe(e.documentation??void 0),u=Ca(),l=M6();for(let f of e.parameters){let g=hNe(f.typ,f.nullable,o);u.addParameter(lr(f.name,g)),l.add(k6(g).setName(f.name)),f.documentation?c.addText(`@param ${f.name} ${f.documentation}`):c.addText(`@param ${f.name}`)}u.setReturnType(V("$runtime.TypedSql").addGenericArgument(V(`${e.name}.
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
`,rLt=`// @ts-nocheck
`,nLt=[".ts",".cts",".mts",".js",".cjs",".mjs"];function FZ(e,r){for(let[n,o]of Object.entries(e))(typeof o=="string"||Buffer.isBuffer(o))&&nLt.some(i=>n.endsWith(i))?e[n]=tLt+(r?rLt:"")+o.toString():typeof o=="object"&&o!==null&&!Buffer.isBuffer(o)&&FZ(o,r)}var X$=class extends Error{constructor(r){super(r),this.stack=void 0}};rs(X$,"DenylistError");function oLt({schemaPath:e,runtimeBase:r,datamodel:n,binaryPaths:o,outputDir:i,generator:a,dmmf:c,datasources:u,engineVersion:l,clientVersion:p,activeProvider:f,typedSql:g,target:x,generatedFileExtension:b,importFileExtension:v,moduleFormat:S,tsNoCheckPreamble:_,compilerBuild:D}){let P=cLt(x),C=T$(b),O=D$(v),I={dmmf:b$e(c),datasources:u,generator:a,binaryPaths:o,schemaPath:e,outputDir:i,runtimeBase:r,clientVersion:p,engineVersion:l,activeProvider:f,datamodel:n,edge:["wasm-compiler-edge"].includes(P),runtimeName:P,target:x,generatedFileExtension:b,importFileExtension:v,moduleFormat:S,tsNoCheckPreamble:_,compilerBuild:D},j=new A2(I).generateClientFiles();return g&&g.length>0&&(j={...j,...bNe({dmmf:c,runtimeBase:iLt(r),runtimeName:P,queries:g,outputName:C,importName:O})}),j={...j,internal:{...j.internal,...B$e({runtimeName:P,activeProvider:f,compilerBuild:D})}},FZ(j,_),{fileMap:j,prismaClientDmmf:c}}function iLt(e){return e.startsWith(".")?e.startsWith("./")?`.${e}`:`../${e}`:e}async function wNe(e){let{datamodel:r,schemaPath:n,generator:o,dmmf:i,datasources:a,binaryPaths:c,clientVersion:u,engineVersion:l,activeProvider:p,typedSql:f,target:g,generatedFileExtension:x,importFileExtension:b,moduleFormat:v,tsNoCheckPreamble:S,compilerBuild:_}=e,{runtimeBase:D,outputDir:P}=await aLt(e),{prismaClientDmmf:C,fileMap:O}=oLt({datamodel:r,schemaPath:n,runtimeBase:D,outputDir:P,generator:o,dmmf:i,datasources:a,binaryPaths:c,clientVersion:u,engineVersion:l,activeProvider:p,typedSql:f,target:g,generatedFileExtension:x,importFileExtension:b,moduleFormat:v,tsNoCheckPreamble:S,compilerBuild:_}),I=sLt(C);if(I){let k=`${q(he("Error: "))}The schema at "${n}" contains reserved keywords.
Rename the following items:`;for(let j of I)k+=`
- `+j.message;throw k+=`
To learn more about how to rename models, check out https://pris.ly/d/naming-models`,new X$(k)}await uLt(P),await(0,ENe.ensureDir)(P),await SNe(P,O)}function SNe(e,r){return Promise.all(Object.entries(r).map(async([n,o])=>{let i=P2.default.join(e,n);await hw.default.rm(i,{recursive:!0,force:!0}),typeof o=="string"||Buffer.isBuffer(o)?await hw.default.writeFile(i,o):(await hw.default.mkdir(i),await SNe(i,o))}))}function sLt(e){let r=[],n={models:["PrismaClient","Prisma","async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","super","switch","this","throw","true","try","using","typeof","var","void","while","with","yield"],fields:["AND","OR","NOT"],dynamic:[]};if(e.datamodel.enums)for(let o of e.datamodel.enums)(n.models.includes(o.name)||n.fields.includes(o.name))&&r.push(Error(`"enum ${o.name}"`));if(e.datamodel.models)for(let o of e.datamodel.models)(n.models.includes(o.name)||n.fields.includes(o.name))&&r.push(Error(`"model ${o.name}"`));return r.length>0?r:null}async function aLt({runtimeBase:e,outputDir:r}){let n=P2.default.normalize(r),o=Np(e),i=await kE({cwd:P2.default.dirname(n)}),a=i?P2.default.dirname(i):process.cwd();return{runtimeBase:o,outputDir:n,projectRoot:a}}function cLt(e){switch(e){case"nodejs":case"deno":return"client";case"workerd":case"vercel-edge":return"wasm-compiler-edge";default:Hs(e,"Unknown runtime target")}}async function uLt(e){try{let r=await hw.default.readdir(e);if(r.length===0)return;if(!r.includes("client.ts")&&!r.includes("client.mts")&&!r.includes("client.cts")&&!r.includes("client.d.ts"))throw new Error(`${e} exists and is not empty but doesn't look like a generated Prisma Client. Please check your output path and remove the existing directory if you indeed want to generate the Prisma Client in that location.`);await Promise.allSettled((await(0,vNe.glob)([`${e}/**/*.{js,ts,mts,cts,d.ts}`,`${e}/**/*.wasm`,`${e}/*.node`,`${e}/{query,schema}-engine-*`,`${e}/package.json`,`${e}/**/*.prisma`],{followSymbolicLinks:!1})).map(n=>hw.default.unlink(n)))}catch(r){if(r.code!=="ENOENT")throw r}}var YNe=W(nY());var rr=W(require("node:path"),1),jZ=W(require("node:fs"),1),NNe=W(require("node:module"),1);var _Ne=e=>e!==null&&typeof e=="object",gw=(e,r)=>Object.assign(new Error(`[${e}]: ${r}`),{code:e}),TNe="ERR_INVALID_PACKAGE_CONFIG",IZ="ERR_INVALID_PACKAGE_TARGET",lLt="ERR_PACKAGE_PATH_NOT_EXPORTED";var pLt=/^\d+$/,fLt=/^(\.{1,2}|node_modules)$/i,dLt=/\/|\\/,DNe=(e=>(e.Export="exports",e.Import="imports",e))(DNe||{}),RZ=(e,r,n,o,i)=>{if(r==null)return[];if(typeof r=="string"){let[a,...c]=r.split(dLt);if(a===".."||c.some(u=>fLt.test(u)))throw gw(IZ,`Invalid "${e}" target "${r}" defined in the package config`);return[i?r.replace(/\*/g,i):r]}if(Array.isArray(r))return r.flatMap(a=>RZ(e,a,n,o,i));if(_Ne(r)){for(let a of Object.keys(r)){if(pLt.test(a))throw gw(TNe,"Cannot contain numeric property keys");if(a==="default"||o.includes(a))return RZ(e,r[a],n,o,i)}return[]}throw gw(IZ,`Invalid "${e}" target "${r}"`)},O2="*",mLt=(e,r)=>{let n=e.indexOf(O2),o=r.indexOf(O2);return n===o?r.length>e.length:o>n};function hLt(e,r){if(!r.includes(O2)&&e.hasOwnProperty(r))return[r];let n,o;for(let i of Object.keys(e))if(i.includes(O2)){let[a,c,u]=i.split(O2);if(u===void 0&&r.startsWith(a)&&r.endsWith(c)){let l=r.slice(a.length,-c.length||void 0);l&&(!n||mLt(n,i))&&(n=i,o=l)}}return[n,o]}var gLt=e=>Object.keys(e).reduce((r,n)=>{let o=n===""||n[0]!==".";if(r===void 0||r===o)return o;throw gw(TNe,'"exports" cannot contain some keys starting with "." and some not')},void 0),yLt=/^\w+:/,CNe=(e,r,n)=>{if(!e)throw new Error('"exports" is required');r=r===""?".":`./${r}`,(typeof e=="string"||Array.isArray(e)||_Ne(e)&&gLt(e))&&(e={".":e});let[o,i]=hLt(e,r),a=RZ(DNe.Export,e[o],r,n,i);if(a.length===0)throw gw(lLt,r==="."?'No "exports" main defined':`Package subpath '${r}' is not defined by "ex
`;break;case 114:C+="\r";break;case 116:C+=" ";break;case 117:let k=x(4);k>=0?C+=String.fromCharCode(k):g=4;break;default:g=5}O=o;continue}if(I>=0&&I<=31)if(xw(I)){C+=e.substring(O,o),g=2;break}else g=6;o++}return C}Ge(S,"scanString");function _(){if(i="",g=0,a=o,l=u,f=p,o>=n)return a=n,c=17;let C=e.charCodeAt(o);if(oN(C)){do o++,i+=String.fromCharCode(C),C=e.charCodeAt(o);while(oN(C));return c=15}if(xw(C))return o++,i+=String.fromCharCode(C),C===13&&e.charCodeAt(o)===10&&(o++,i+=`
`),u++,p=o,c=14;switch(C){case 123:return o++,c=1;case 125:return o++,c=2;case 91:return o++,c=3;case 93:return o++,c=4;case 58:return o++,c=6;case 44:return o++,c=5;case 34:return o++,i=S(),c=10;case 47:let O=o-1;if(e.charCodeAt(o+1)===47){for(o+=2;o<n&&!xw(e.charCodeAt(o));)o++;return i=e.substring(O,o),c=12}if(e.charCodeAt(o+1)===42){o+=2;let I=n-1,k=!1;for(;o<I;){let j=e.charCodeAt(o);if(j===42&&e.charCodeAt(o+1)===47){o+=2,k=!0;break}o++,xw(j)&&(j===13&&e.charCodeAt(o)===10&&o++,u++,p=o)}return k||(o++,g=1),i=e.substring(O,o),c=13}return i+=String.fromCharCode(C),o++,c=16;case 45:if(i+=String.fromCharCode(C),o++,o===n||!Yy(e.charCodeAt(o)))return c=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=v(),c=11;default:for(;o<n&&D(C);)o++,C=e.charCodeAt(o);if(a!==o){switch(i=e.substring(a,o),i){case"true":return c=8;case"false":return c=9;case"null":return c=7}return c=16}return i+=String.fromCharCode(C),o++,c=16}}Ge(_,"scanNext");function D(C){if(oN(C)||xw(C))return!1;switch(C){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}Ge(D,"isUnknownContentCharacter");function P(){let C;do C=_();while(C>=12&&C<=15);return C}return Ge(P,"scanNextNonTrivia"),{setPosition:b,getPosition:Ge(()=>o,"getPosition"),scan:r?P:_,getToken:Ge(()=>c,"getToken"),getTokenValue:Ge(()=>i,"getTokenValue"),getTokenOffset:Ge(()=>a,"getTokenOffset"),getTokenLength:Ge(()=>o-a,"getTokenLength"),getTokenStartLine:Ge(()=>l,"getTokenStartLine"),getTokenStartCharacter:Ge(()=>a-f,"getTokenStartCharacter"),getTokenError:Ge(()=>g,"getTokenError")}}Ge(jNe,"createScanner");function oN(e){return e===32||e===9}Ge(oN,"isWhiteSpace");function xw(e){return e===10||e===13}Ge(xw,"isLineBreak");function Yy(e){return e>=48&&e<=57}Ge(Yy,"isDigit");var ANe;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(ANe||(ANe={})),new Array(20).fill(0).map((e,r)=>" ".repeat(r));var yw=200;new Array(yw).fill(0).map((e,r)=>`
`+" ".repeat(r)),new Array(yw).fill(0).map((e,r)=>"\r"+" ".repeat(r)),new Array(yw).fill(0).map((e,r)=>`\r
`+" ".repeat(r)),new Array(yw).fill(0).map((e,r)=>`
`+" ".repeat(r)),new Array(yw).fill(0).map((e,r)=>"\r"+" ".repeat(r)),new Array(yw).fill(0).map((e,r)=>`\r
`+" ".repeat(r));var iN;(function(e){e.DEFAULT={allowTrailingComma:!1}})(iN||(iN={}));function UNe(e,r=[],n=iN.DEFAULT){let o=null,i=[],a=[];function c(u){Array.isArray(i)?i.push(u):o!==null&&(i[o]=u)}return Ge(c,"onValue"),qNe(e,{onObjectBegin:Ge(()=>{let u={};c(u),a.push(i),i=u,o=null},"onObjectBegin"),onObjectProperty:Ge(u=>{o=u},"onObjectProperty"),onObjectEnd:Ge(()=>{i=a.pop()},"onObjectEnd"),onArrayBegin:Ge(()=>{let u=[];c(u),a.push(i),i=u,o=null},"onArrayBegin"),onArrayEnd:Ge(()=>{i=a.pop()},"onArrayEnd"),onLiteralValue:c,onError:Ge((u,l,p)=>{r.push({error:u,offset:l,length:p})},"onError")},n),i[0]}Ge(UNe,"parse$1");function qNe(e,r,n=iN.DEFAULT){let o=jNe(e,!1),i=[];function a(Y){return Y?()=>Y(o.getTokenOffset(),o.getTokenLength(),o.getTokenStartLine(),o.getTokenStartCharacter()):()=>!0}Ge(a,"toNoArgVisit");function c(Y){return Y?()=>Y(o.getTokenOffset(),o.getTokenLength(),o.getTokenStartLine(),o.getTokenStartCharacter(),()=>i.slice()):()=>!0}Ge(c,"toNoArgVisitWithPath");function u(Y){return Y?z=>Y(z,o.getTokenOffset(),o.getTokenLength(),o.getTokenStartLine(),o.getTokenStartCharacter()):()=>!0}Ge(u,"toOneArgVisit");function l(Y){return Y?z=>Y(z,o.getTokenOffset(),o.getTokenLength(),o.getTokenStartLine(),o.getTokenStartCharacter(),()=>i.slice()):()=>!0}Ge(l,"toOneArgVisitWithPath");let p=c(r.onObjectBegin),f=l(r.onObjectProperty),g=a(r.onObjectEnd),x=c(r.onArrayBegin),b=a(r.onArrayEnd),v=l(r.onLiteralValue),S=u(r.onSeparator),_=a(r.onComment),D=u(r.onError),P=n&&n.disallowComments,C=n&&n.allowTrailingComma;function O(){for(;;){let Y=o.scan();switch(o.getTokenError()){case 4:I(14);break;case 5:I(15);break;case 3:I(13);break;case 1:P||I(11);break;case 2:I(12);break;case 6:I(16);break}switch(Y){case 12:case 13:P?I(10):_();break;case 16:I(1);break;case 15:case 14:break;default:return Y}}}Ge(O,"scanNext");function I(Y,z=[],X=[]){if(D(Y),z.length+X.length>0){let U=o.getToken();for(;U!==17;){if(z.indexOf(U)!==-1){O();break}else if(X.indexOf(U)!==-1)break;U=O()}}}Ge(I,"handleError");function k(Y){let z=o.getTokenValue();return Y?v(z):(f(z),i.push(z)),O(),!0}Ge(k,"parseString");function j(){switch(o.getToken()){case 11:let Y=o.getTokenValue(),z=Number(Y);isNaN(z)&&(I(2),z=0),v(z);break;case 7:v(null);break;case 8:v(!0);break;case 9:v(!1);break;default:return!1}return O(),!0}Ge(j,"parseLiteral");function G(){return o.getToken()!==10?(I(3,[],[2,5]),!1):(k(!1),o.getToken()===6?(S(":"),O(),N()||I(4,[],[2,5])):I(5,[],[2,5]),i.pop(),!0)}Ge(G,"parseProperty");function B(){p(),O();let Y=!1;for(;o.getToken()!==2&&o.getToken()!==17;){if(o.getToken()===5){if(Y||I(4,[],[]),S(","),O(),o.getToken()===2&&C)break}else Y&&I(6,[],[]);G()||I(4,[],[2,5]),Y=!0}return g(),o.getToken()!==2?I(7,[2],[]):O(),!0}Ge(B,"parseObject");function H(){x(),O();let Y=!0,z=!1;for(;o.getToken()!==4&&o.getToken()!==17;){if(o.getToken()===5){if(z||I(4,[],[]),S(","),O(),o.getToken()===4&&C)break}else z&&I(6,[],[]);Y?(i.push(0),Y=!1):i[i.length-1]++,N()||I(4,[],[4,5]),z=!0}return b(),Y||i.pop(),o.getToken()!==4?I(8,[4],[]):O(),!0}Ge(H,"parseArray");function N(){switch(o.getToken()){case 3:return H();case 1:return B();case 10:return k(!0);default:return j()}}return Ge(N,"parseValue"),O(),o.getToken()===17?n.allowEmptyContent?!0:(I(4,[],[]),!1):N()?(o.getToken()!==17&&I(9,[],[]),!0):(I(4,[],[]),!1)}Ge(qNe,"visit");var PNe;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(PNe||(PNe={}));var ONe;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=
${ae(`generator client {
provider = "prisma-client"`)}
${me(' output = "../src/generated"')}
${ae("}")}
${q("Note:")} the output path is relative to the schema directory.
`;function JNe(e){if(!e.output)throw new Error(VLt);return To(e.output)}var F2=class{name="prisma-client-ts";getManifest(r){return Promise.resolve({defaultOutput:JNe(r),prettyName:"Prisma Client",version:VZ,requiresEngines:[],requiresEngineVersion:YNe.enginesVersion})}async generate(r){let{config:n}=r.generator,o=JNe(r.generator),i=sN(o)?.config,a=n.runtime!==void 0?KNe(n.runtime):"nodejs",c=n.generatedFileExtension!==void 0?h$e(n.generatedFileExtension):"ts",u=n.importFileExtension!==void 0?g$e(n.importFileExtension):x$e({tsconfig:i,generatedFileExtension:c,target:a}),l=n.moduleFormat!==void 0?VNe(n.moduleFormat):zNe({tsconfig:i,generatedFileExtension:c,importFileExtension:u});await wNe({datamodel:r.datamodel,schemaPath:r.schemaPath,binaryPaths:r.binaryPaths,datasources:r.datasources,outputDir:o,runtimeBase:"@prisma/client/runtime",dmmf:r.dmmf,generator:r.generator,engineVersion:r.version,clientVersion:VZ,activeProvider:r.datasources[0]?.activeProvider,typedSql:r.typedSql,target:a,generatedFileExtension:c,importFileExtension:u,moduleFormat:l,tsNoCheckPreamble:!0,compilerBuild:zLt(r.generator.config.compilerBuild,a)})}};function zLt(e,r){if(e===void 0)return r==="vercel-edge"?"small":"fast";if(e==="small"||e==="fast")return e;throw new Error(`Invalid compiler build: ${JSON.stringify(e)}, expected one of: "fast", "small"`)}var aN=class{#e=new Map;add(r){this.#e.set(r.name,r)}addAliased(r,n){this.#e.set(r,n)}toInternal(){return Object.fromEntries([...this.#e.entries()].map(([r,n])=>[r,{type:"in-process",generator:n}]))}};var bw=new aN;bw.add(new w2);var ZNe=new F2;bw.add(ZNe);bw.addAliased("prisma-client",ZNe);var EQ=require("@prisma/engines");var wQ=W(require("fs"));var tQ=W(require("node:process"),1);var uN=new Set(["\x1B","\x9B"]),KLt=39,KZ="\x07",eLe="[",JLt="]",tLe="m",cN=`${JLt}8;;`,QNe=e=>`${uN.values().next().value}${eLe}${e}${tLe}`,XNe=e=>`${uN.values().next().value}${cN}${e}${KZ}`,YLt=e=>e.split(" ").map(r=>Xi(r)),zZ=(e,r,n)=>{let o=[...r],i=!1,a=!1,c=Xi(pd(e.at(-1)));for(let[u,l]of o.entries()){let p=Xi(l);if(c+p<=n?e[e.length-1]+=l:(e.push(l),c=0),uN.has(l)&&(i=!0,a=o.slice(u+1,u+1+cN.length).join("")===cN),i){a?l===KZ&&(i=!1,a=!1):l===tLe&&(i=!1);continue}c+=p,c===n&&u<o.length-1&&(e.push(""),c=0)}!c&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},ZLt=e=>{let r=e.split(" "),n=r.length;for(;n>0&&!(Xi(r[n-1])>0);)n--;return n===r.length?e:r.slice(0,n).join(" ")+r.slice(n).join("")},QLt=(e,r,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let o="",i,a,c=YLt(e),u=[""];for(let[g,x]of e.split(" ").entries()){n.trim!==!1&&(u[u.length-1]=u.at(-1).trimStart());let b=Xi(u.at(-1));if(g!==0&&(b>=r&&(n.wordWrap===!1||n.trim===!1)&&(u.push(""),b=0),(b>0||n.trim===!1)&&(u[u.length-1]+=" ",b++)),n.hard&&c[g]>r){let v=r-b,S=1+Math.floor((c[g]-v-1)/r);Math.floor((c[g]-1)/r)<S&&u.push(""),zZ(u,x,r);continue}if(b+c[g]>r&&b>0&&c[g]>0){if(n.wordWrap===!1&&b<r){zZ(u,x,r);continue}u.push("")}if(b+c[g]>r&&n.wordWrap===!1){zZ(u,x,r);continue}u[u.length-1]+=x}n.trim!==!1&&(u=u.map(g=>ZLt(g)));let l=u.join(`
`),p=[...l],f=0;for(let[g,x]of p.entries()){if(o+=x,uN.has(x)){let{groups:v}=new RegExp(`(?:\\${eLe}(?<code>\\d+)m|\\${cN}(?<uri>.*)${KZ})`).exec(l.slice(f))||{groups:{}};if(v.code!==void 0){let S=Number.parseFloat(v.code);i=S===KLt?void 0:S}else v.uri!==void 0&&(a=v.uri.length===0?void 0:v.uri)}let b=Sa.codes.get(Number(i));p[g+1]===`
`?(a&&(o+=XNe("")),i&&b&&(o+=QNe(b))):x===`
`&&(i&&b&&(o+=QNe(i)),a&&(o+=XNe(a))),f+=x.length}return o};function JZ(e,r,n){return String(e).normalize().replaceAll(`\r
`,`
`).split(`
`).map(o=>QLt(o,r,n)).join(`
`)}function YZ(e){return Number.isInteger(e)?Dk(e)===2:!1}var XLt=new Set([27,155]),e4t="0".codePointAt(0),t4t="9".codePointAt(0),QZ=new Set,ZZ=new Map;for(let[e,r]of Sa.codes)QZ.add(Sa.color.ansi(r)),ZZ.set(Sa.color.ansi(e),Sa.color.ansi(r));function r4t(e){if(QZ.has(e))return e;if(ZZ.has(e))return ZZ.get(e);e=e.slice(2),e.includes(";")&&(e=e[0]+"0");let r=Sa.codes.get(Number.parseInt(e,10));return r?Sa.color.ansi(r):Sa.reset.open}function n4t(e){for(let r=0;r<e.length;r++){let n=e.codePointAt(r);if(n>=e4t&&n<=t4t)return r}return-1}function o4t(e,r){e=e.slice(r,r+19);let n=n4t(e);if(n!==-1){let o=e.indexOf("m",n);return o===-1&&(o=e.length),e.slice(0,o+1)}}function i4t(e,r=Number.POSITIVE_INFINITY){let n=[],o=0,i=0;for(;o<e.length;){let a=e.codePointAt(o);if(XLt.has(a)){let l=o4t(e,o);if(l){n.push({type:"ansi",code:l,endCode:r4t(l)}),o+=l.length;continue}}let c=YZ(a),u=String.fromCodePoint(a);if(n.push({type:"character",value:u,isFullWidth:c}),o+=u.length,i+=c?2:u.length,i>=r)break}return n}function rLe(e){let r=[];for(let n of e)n.code===Sa.reset.open?r=[]:QZ.has(n.code)?r=r.filter(o=>o.endCode!==n.code):(r=r.filter(o=>o.endCode!==n.endCode),r.push(n));return r}function s4t(e){return rLe(e).map(({endCode:o})=>o).reverse().join("")}function XZ(e,r,n){let o=i4t(e,n),i=[],a=0,c="",u=!1;for(let l of o){if(n!==void 0&&a>=n)break;l.type==="ansi"?(i.push(l),u&&(c+=l.code)):(!u&&a>=r&&(u=!0,i=rLe(i),c=i.map(({code:p})=>p).join("")),u&&(c+=l.value),a+=l.isFullWidth?2:l.value.length)}return c+=s4t(i),c}var a4t=24,eQ=({columns:e=80})=>e,c4t=(e,r)=>{let n=e.rows??a4t,o=r.split(`
`),i=Math.max(0,o.length-n);return i?XZ(r,pd(o.slice(0,i).join(`
`)).length+1):r};function nLe(e,{showCursor:r=!1}={}){let n=0,o=eQ(e),i="",a=()=>{i="",o=eQ(e),n=0},c=(...u)=>{r||RE.hide();let l=c4t(e,u.join(" ")+`
`),p=eQ(e);l===i&&o===p||(i=l,o=p,l=JZ(l,p,{trim:!1,hard:!0,wordWrap:!1}),e.write($0.eraseLines(n)+l),n=l.split(`
`).length)};return c.clear=()=>{e.write($0.eraseLines(n)),a()},c.done=()=>{a(),r||RE.show()},c}var u4t=nLe(tQ.default.stdout),Zy=u4t,qNr=nLe(tQ.default.stderr);var _N=W(require("path")),WLe=W(uLe());var oQ=W(require("fs/promises"));var vw=W(require("path")),f4t="sql";async function iQ(e,r,n){let o=Zi(n,e),i=await d4t(o.typedSqlDirPath),a=await kK(n,e,r,i);if(a.ok)return a.queries;throw new Error(m4t(a.errors))}function lLe(e){return vw.default.join(e,f4t)}async function d4t(e){let r=await oQ.default.readdir(e),n=[];for(let o of r){let{name:i,ext:a}=vw.default.parse(o);if(a!==".sql")continue;let c=vw.default.join(e,o);if(!gc(i))throw new Error(`${c} can not be used as a typed sql query: name must be a valid JS identifier`);if(i.startsWith("$"))throw new Error(`${c} can not be used as a typed sql query: name must not start with $`);let u=await oQ.default.readFile(vw.default.join(e,o),"utf8");n.push({name:i,source:u,fileName:c})}return n}function m4t(e){let r=[`Errors while reading sql files:
`];for(let{fileName:n,message:o}of e)r.push(`In ${q(vw.default.relative(process.cwd(),n))}:`),r.push(o),r.push("");return r.join(`
`)}var CLe=require("fs"),xN=require("fs/promises"),ALe=require("events"),nr=W(require("path"),1);var Id=require("node:fs/promises"),mLe=require("node:stream"),Rd=require("node:path"),Ec={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},sQ={root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Ec.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(sQ);var hLe="READDIRP_RECURSIVE_ERROR",h4t=new Set(["ENOENT","EPERM","EACCES","ELOOP",hLe]),pLe=[Ec.DIR_TYPE,Ec.EVERYTHING_TYPE,Ec.FILE_DIR_TYPE,Ec.FILE_TYPE],g4t=new Set([Ec.DIR_TYPE,Ec.EVERYTHING_TYPE,Ec.FILE_DIR_TYPE]),y4t=new Set([Ec.EVERYTHING_TYPE,Ec.FILE_DIR_TYPE,Ec.FILE_TYPE]),x4t=e=>h4t.has(e.code),b4t=process.platform==="win32",fLe=e=>!0,dLe=e=>{if(e===void 0)return fLe;if(typeof e=="function")return e;if(typeof e=="string"){let r=e.trim();return n=>n.basename===r}if(Array.isArray(e)){let r=e.map(n=>n.trim());return n=>r.some(o=>n.basename===o)}return fLe},aQ=class extends mLe.Readable{constructor(r={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:r.highWaterMark});let n={...sQ,...r},{root:o,type:i}=n;this._fileFilter=dLe(n.fileFilter),this._directoryFilter=dLe(n.directoryFilter);let a=n.lstat?Id.lstat:Id.stat;b4t?this._stat=c=>a(c,{bigint:!0}):this._stat=a,this._maxDepth=n.depth??sQ.depth,this._wantsDir=i?g4t.has(i):!1,this._wantsFile=i?y4t.has(i):!1,this._wantsEverything=i===Ec.EVERYTHING_TYPE,this._root=(0,Rd.resolve)(o),this._isDirent=!n.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(o,1)],this.reading=!1,this.parent=void 0}async _read(r){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&r>0;){let n=this.parent,o=n&&n.files;if(o&&o.length>0){let{path:i,depth:a}=n,c=o.splice(0,r).map(l=>this._formatEntry(l,i)),u=await Promise.all(c);for(let l of u){if(!l)continue;if(this.destroyed)return;let p=await this._getEntryType(l);p==="directory"&&this._directoryFilter(l)?(a<=this._maxDepth&&this.parents.push(this._exploreDir(l.fullPath,a+1)),this._wantsDir&&(this.push(l),r--)):(p==="file"||this._includeAsFile(l))&&this._fileFilter(l)&&this._wantsFile&&(this.push(l),r--)}}else{let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(n){this.destroy(n)}finally{this.reading=!1}}}async _exploreDir(r,n){let o;try{o=await(0,Id.readdir)(r,this._rdOptions)}catch(i){this._onError(i)}return{files:o,depth:n,path:r}}async _formatEntry(r,n){let o,i=this._isDirent?r.name:r;try{let a=(0,Rd.resolve)((0,Rd.join)(n,i));o={path:(0,Rd.relative)(this._root,a),fullPath:a,basename:i},o[this._statsProp]=this._isDirent?r:await this._stat(a)}catch(a){this._onError(a);return}return o}_onError(r){x4t(r)&&!this.destroyed?this.emit("warn",r):this.destroy(r)}async _getEntryType(r){if(!r&&this._statsProp in r)return"";let n=r[this._statsProp];if(n.isFile())return"file";if(n.isDirectory())return"directory";if(n&&n.isSymbolicLink()){let o=r.fullPath;try{let i=await(0,Id.realpath)(o),a=await(0,Id.lstat)(i);if(a.isFile())return"file";if(a.isDirectory()){let c=i.length;if(o.startsWith(i)&&o.substr(c,1)===Rd.sep){let u=new Error(`Circular symlink detected: "${o}" points to "${i}"`);return u.code=hLe,this._onError(u)}return"directory"}}catch(i){return this._onError(i),""}}}_includeAsFile(r){let n=r&&r[this._statsProp];return n&&this._wantsEverything&&!n.isDirectory()}};function gLe(e,r={}){let n=r.entryType||r.type;if(n==="both"&&(n=Ec.FILE_DIR_TYPE),n&&(r.type=n),e){if(typeof e!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(n&&!pLe.includes(n))throw new Error(`readdirp: Invalid type passed. Use one of ${pLe.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return r.root=e,new aQ(r)}var Xy=require("fs"),Al=require("fs/promises"),Zn=W(require("path"),1),xLe=require("os"),v4t="data",lQ="end",bLe="close",mN=()=>{};var hN=process.platform,pQ=hN==="win32"
You can update your code with
${q("`npx @prisma/codemods update-2.12 ./`")}
Read more at ${Pt("https://pris.ly/2.12")}`;var LLe=W(hE()),BLe=W(v6()),SN=W(require("fs")),vQ=W(require("path")),jLe=W(require("readline"));var RLe=W(v6()),yQ=W(require("fs")),MLe=W(require("path"));function V4t(){return MLe.default.join((0,RLe.default)("prisma").config,"commands.json")}async function vN(){let e=V4t(),r=await yQ.default.promises.readFile(e,"utf-8").catch(o=>o.code==="ENOENT"?Promise.resolve(void 0):Promise.reject(o)),n=r===void 0?{firstCommandTimestamp:new Date().toISOString()}:JSON.parse(r);if(r===void 0&&await yQ.default.promises.writeFile(e,JSON.stringify(n)),typeof n.firstCommandTimestamp=="string")return n;throw new Error("Invalid command state schema")}function kLe(e,r=new Date){let n=new Date(e.firstCommandTimestamp),o=r.getTime()-n.getTime();return Math.floor(o/(1e3*60*60*24))}var xQ=class extends Error{constructor(r,n){super(`Failed to submit Posthog event '${r}': ${n}`)}},z4t=new URL("https://proxyhog.prisma-data.net/capture"),K4t="phc_gr2e9OTFh5iwE6IOuHPngwVm9jDtbC04nBjb8gcVG9a",EN=class{async capture(r,n,o){let i={api_key:K4t,event:n,distinct_id:r,properties:o},a=await fetch(z4t.href,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!a.ok)throw new xQ(n,a.statusText)}};var J4t=new URL("https://pub-833f4cf4b3dc4d17a6db4981affc9fbb.r2.dev/timeframe.json"),wN=class{async status(){let r=await fetch(J4t.href);if(r.status===404)return{};if(!r.ok)throw new Error(`Failed to fetch NPS survey status: ${r.statusText}`);let n=await r.json();if(!this.checkSchema(n))throw new Error("Invalid NPS status schema");return n}checkSchema(r){return r.currentTimeframe==null||typeof r.currentTimeframe.start=="string"&&typeof r.currentTimeframe.end=="string"}};var bQ=30,$Le=lt("prisma:cli:nps");async function ULe(){if(!ud()||"Deno"in globalThis)return;let e=new Date,r=jLe.default.promises.createInterface({input:process.stdin,output:process.stdout});r.on("error",i=>{$Le(`A readline error occurred while handling NPS survey: ${i}`)}),r.on("SIGINT",()=>{r.write(`Received SIGINT, closing the survey.
`),r.close()});let n=new wN,o=new EN;await vN().then(i=>Z4t(e,n,Y4t(r),o,i)).catch(i=>{$Le(`An error occurred while handling NPS survey: ${i}`)}).finally(()=>r.close())}function Y4t(e){let r=new AbortController;return e.on("close",()=>r.abort()),new Proxy(e,{get(o,i,a){return r.signal.throwIfAborted(),Reflect.get(o,i,a)}})}async function Z4t(e,r,n,o,i){if(cd()||cK()||nK()||rK()||kLe(i)<1)return;let a=await X4t();if(a&&NLe(e,a.acknowledgedTimeframe))return;let c=await r.status();if(!c.currentTimeframe||!NLe(e,c.currentTimeframe))return;let u=await Q4t(n);u.rating&&(await t3t({rating:u.rating,...u},o),n.write(`Thanks for your feedback!
`)),await e3t({acknowledgedTimeframe:c.currentTimeframe})}async function Q4t(e){let r=e.question(`How likely are you to recommend Prisma?
Enter a number from 0 to 10 (0 = not at all, 10 = extremely likely) and press Enter \u2014 or leave blank to skip and not be asked again.
This prompt closes in ${bQ}s and can be suppressed with --no-hints. Learn more: https://pris.ly/why-nps
Rating: `),n=await r3t(r,bQ*1e3);if(n===void 0)return e.write(`No response received within ${bQ} seconds. Exiting the survey.
`),{};let o=parseInt(n.trim(),10);if(isNaN(o)||o<0||o>10)return e.write(`Not received a valid rating. Exiting the survey.
`),{};let i=await e.question(`Optional: Provide additional feedback or press Enter to skip.
Additional feedback: `),a=i.trim()===""?void 0:i;return{rating:o,feedback:a}}function qLe(){return vQ.default.join((0,BLe.default)("prisma").config,"nps.json")}async function X4t(){let e=await SN.default.promises.readFile(qLe(),"utf-8").catch(n=>n.code==="ENOENT"?Promise.resolve(void 0):Promise.reject(n));if(e===void 0)return;let r=JSON.parse(e);if(r.acknowledgedTimeframe&&typeof r.acknowledgedTimeframe.start=="string"&&typeof r.acknowledgedTimeframe.end=="string")return r;throw new Error("Invalid NPS config schema")}async function e3t(e){let r=qLe();await SN.default.promises.mkdir(vQ.default.dirname(r),{recursive:!0}),await SN.default.promises.writeFile(r,JSON.stringify(e))}async function t3t(e,r){let n=await LLe.getSignature();await r.capture(n,"NPS feedback",e)}function r3t(e,r){return new Promise(n=>{let o=setTimeout(()=>{n(void 0)},r);return e.then(i=>{clearTimeout(o),n(i)})})}function NLe(e,r){return new Date(r.start)<=e&&new Date(r.end)>=e}function GLe(e){let r=!1,n=null;return async(...o)=>{if(r)return n=o,null;r=!0,await e(...o).catch(i=>console.error(i)),n&&(await e(...n).catch(i=>console.error(i)),n=null),r=!1}}var HLe=eval("require('../package.json')"),TN=class e{surveyHandler;constructor(r=ULe){this.surveyHandler=r}static new(){return new e}static help=ut(`
Generate artifacts (e.g. Prisma Client)
${q("Usage")}
${ae("$")} prisma generate [options]
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
--sql Generate typed sql module
--watch Watch the Prisma schema and rerun after a change
--generator Generator to use (may be provided multiple times)
--no-hints Hides the hint messages but still outputs errors and warnings
--require-models Do not allow generating a client without models
${q("Examples")}
With an existing Prisma schema
${ae("$")} prisma generate
Or specify a schema
${ae("$")} prisma generate --schema=./schema.prisma
Run the command with multiple specific generators
${ae("$")} prisma generate --generator client1 --generator client2
Watch Prisma schema file and rerun after each change
${ae("$")} prisma generate --watch
`);logText="";hasGeneratorErrored=!1;runGenerate=GLe(async({generators:r})=>{let n=[];for(let o of r){let i=Math.round(performance.now());try{await o.generate();let a=Math.round(performance.now());n.push(AH(o,a-i)+`
`),o.stop()}catch(a){this.hasGeneratorErrored=!0,o.stop(),n.push(`${a.message}
`)}}this.logText+=n.join(`
`)});async parse(r,n,o=process.cwd()){let i=bt(r,{"--help":Boolean,"-h":"--help","--watch":Boolean,"--schema":String,"--config":String,"--no-hints":Boolean,"--generator":[String],"--telemetry-information":String,"--require-models":Boolean,"--sql":Boolean}),a=!i["--require-models"],c=process.cwd();if(Ht(i))return this.help(i.message);if(i["--help"])return this.help();let u=i["--watch"]||!1,l=await Qi({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o}),cwd:c});if(!l)return"";let p=await HT({schemaResult:l}),f=!1,g,x=null,b;if(i["--sql"]){let D=ai({config:n,cmd:"generate --sql"}),P=await iQ(D,o,p);b={validatedConfig:D,typedSql:P}}try{if(g=await nk({schemaContext:p,printDownloadProgress:!u,version:EQ.enginesVersion,generatorNames:i["--generator"],typedSql:b?.typedSql,allowNoModels:a,registry:bw.toInternal()}),!g||g.length===0)this.logText+=`${rk}
`;else{let D=g.find(P=>P.options&&To(P.options.generator.provider)==="prisma-client-js");x=D?.manifest?.version??null,f=!!D;try{await this.runGenerate({generators:g})}catch(P){this.logText+=`${P.message}
`}}}catch(D){if(u)this.logText+=`${D.message}
`;else throw D}let v=!1;if(f)try{let D=n3t();if(D&&typeof D=="string"){let[P,C]=D.split(".");parseInt(P)==2&&parseInt(C)<12&&(v=!0)}}catch{}if(v&&il.should.warn())return"There have been breaking changes in Prisma Client since you updated last time.\nPlease run `prisma generate` manually.";let S=`
${me("Watching...")} ${ae(p.schemaRootDir)}
`,_=i["--no-hints"]??!1;if(u){Zy(S+`
`+this.logText);let D=new bN(p.schemaRootDir);i["--sql"]&&D.add(lLe(p.schemaRootDir));for await(let P of D){Zy(`Change in ${_N.default.relative(process.cwd(),P)}`);let C=await Qi({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o}),cwd:c});if(!C)return"";let O=await HT({schemaResult:C}),I;try{if(b!==void 0&&(b.typedSql=await iQ(b.validatedConfig,o,O)),I=await nk({schemaContext:O,printDownloadProgress:!u,version:EQ.enginesVersion,generatorNames:i["--generator"],typedSql:b?.typedSql,registry:bw.toInternal()}),!I||I.length===0)this.logText+=`${rk}
`;else{Zy(`
${me("Building...")}
${this.logText}`);try{await this.runGenerate({generators:I}),Zy(S+`
`+this.logText)}catch(k){this.logText+=`${k.message}
`,Zy(S+`
`+this.logText)}}}catch(k){this.logText+=`${k.message}
`,Zy(S+`
`+this.logText)}}}else{let D=g?.find(({options:O})=>O?.generator.provider&&To(O?.generator.provider)==="prisma-client-js"),P="";if(D){let O=v?`
${ILe}`:"",k=x&&HLe.version!==x&&il.should.warn()?`
${Gt(q("warn"))} Versions of ${q(`prisma@${HLe.version}`)} and ${q(`@prisma/client@${x}`)} don't match.
This might lead to unexpected behavior.
Please make sure they have the same version.`:"";_?P=`${O}${k}`:P=`
Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)
${O}${k}`}let C=`
`+this.logText+(f&&!this.hasGeneratorErrored?P:"");if(this.hasGeneratorErrored)throw new Error(C);return _||await this.surveyHandler(),C}return""}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};function n3t(){try{let e=(0,WLe.default)(".prisma/client",{cwd:process.cwd()});if(!e){let r=_N.default.join(process.cwd(),"node_modules/.prisma/client");wQ.default.existsSync(r)&&(e=r)}if(e){let r=_N.default.join(e,"index.js");if(wQ.default.existsSync(r)){let n=require(r);return n?.prismaVersion?.client??n?.Prisma?.prismaVersion?.client}}}catch{return null}return null}var ea=W(require("node:fs")),Ei=W(require("node:path"));var Qh=e=>e.name==="up"||e.name==="k"||e.ctrl&&e.name==="p",ww=e=>e.name==="down"||e.name==="j"||e.ctrl&&e.name==="n",VLe=e=>e.name==="space",Sw=e=>e.name==="backspace",DN=e=>"123456789".includes(e.name),Jo=e=>e.name==="enter"||e.name==="return";var CN=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(r){super(),this.cause=r?.cause}},AN=class extends Error{name="CancelPromptError";message="Prompt was canceled"},PN=class extends Error{name="ExitPromptError"},ON=class extends Error{name="HookError"},Xh=class extends Error{name="ValidationError"};var TQ=require("node:async_hooks");var FN=require("node:async_hooks");var zLe=new FN.AsyncLocalStorage;function o3t(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function KLe(e,r){let n=o3t(e);return zLe.run(n,()=>{function o(i){n.handleChange=()=>{n.index=0,i()},n.handleChange()}return r(o)})}function ex(){let e=zLe.getStore();if(!e)throw new ON("[Inquirer] Hook functions can only be called from within a prompt");return e}function SQ(){return ex().rl}function _Q(e){let r=(...n)=>{let o=ex(),i=!1,a=o.handleChange;o.handleChange=()=>{i=!0};let c=e(...n);return i&&a(),o.handleChange=a,c};return FN.AsyncResource.bind(r)}function _w(e){let r=ex(),{index:n}=r,o={get(){return r.hooks[n]},set(a){r.hooks[n]=a},initialized:n in r.hooks},i=e(o);return r.index++,i}function JLe(){ex().handleChange()}var tx={queue(e){let r=ex(),{index:n}=r;r.hooksEffect.push(()=>{r.hooksCleanup[n]?.();let o=e(SQ());if(o!=null&&typeof o!="function")throw new Xh("useEffect return value must be a cleanup function or nothing.");r.hooksCleanup[n]=o})},run(){let e=ex();_Q(()=>{e.hooksEffect.forEach(r=>{r()}),e.hooksEffect.length=0})()},clearAll(){let e=ex();e.hooksCleanup.forEach(r=>{r?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function vt(e){return _w(r=>{let n=i=>{r.get()!==i&&(r.set(i),JLe())};if(r.initialized)return[r.get(),n];let o=typeof e=="function"?e():e;return r.set(o),[o,n]})}function Pl(e,r){_w(n=>{let o=n.get();(!Array.isArray(o)||r.some((a,c)=>!Object.is(a,o[c])))&&tx.queue(e),n.set(r)})}var bu=W(eg(),1);var Ol=W(require("node:process"),1);function a3t(){return Ol.default.platform!=="win32"?Ol.default.env.TERM!=="linux":!!Ol.default.env.WT_SESSION||!!Ol.default.env.TERMINUS_SUBLIME||Ol.default.env.ConEmuTask==="{cmd::Cmder}"||Ol.default.env.TERM_PROGRAM==="Terminus-Sublime"||Ol.default.env.TERM_PROGRAM==="vscode"||Ol.default.env.TERM==="xterm-256color"||Ol.default.env.TERM==="alacritty"||Ol.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ZLe={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuart
`).flatMap(n=>(0,F4e.default)(n,r,{trim:!1,hard:!0}).split(`
`).map(o=>o.trimEnd())).join(`
`)}function MN(){return(0,O4e.default)({defaultWidth:80,output:SQ().output})}function k3t(e,r){return $2(e,r).split(`
`)}function $3t(e,r){let n=r.length,o=(e%n+n)%n;return[...r.slice(o),...r.slice(0,o)]}function I4e({items:e,width:r,renderItem:n,active:o,position:i,pageSize:a}){let c=e.map((v,S)=>({item:v,index:S,isActive:S===o})),u=$3t(o-i,c).slice(0,a),l=v=>u[v]==null?[]:k3t(n(u[v]),r),p=Array.from({length:a}),f=l(i).slice(0,a),g=i+f.length<=a?i:a-f.length;p.splice(g,f.length,...f);let x=g+f.length,b=i+1;for(;x<a&&b<u.length;){for(let v of l(b))if(p[x++]=v,x>=a)break;b++}for(x=g-1,b=i-1;x>=0&&b>=0;){for(let v of l(b).reverse())if(p[x--]=v,x<0)break;b--}return p.filter(v=>typeof v=="string")}function R4e({active:e,pageSize:r,total:n}){let o=Math.floor(r/2);return n<=r||e<o?e:e>=n-o?e+r-n:o}function M4e({active:e,lastActive:r,total:n,pageSize:o,pointer:i}){return n<=o?e:r<e&&e-r<o?Math.min(Math.floor(o/2),i+e-r):i}function rx({items:e,active:r,renderItem:n,pageSize:o,loop:i=!0}){let a=vu({position:0,lastActive:0}),c=i?M4e({active:r,lastActive:a.current.lastActive,total:e.length,pageSize:o,pointer:a.current.position}):R4e({active:r,total:e.length,pageSize:o});return a.current.position=c,a.current.lastActive=r,I4e({items:e,width:MN(),renderItem:n,active:r,position:c,pageSize:o}).join(`
`)}var U4e=W(require("node:readline"),1),q4e=require("node:async_hooks"),G4e=W($4e(),1);var j4e=require("node:util"),tg=W(L2(),1);var L4e=e=>e.split(`
`).length,L3t=e=>e.split(`
`).pop()??"";function B4e(e){return e>0?tg.default.cursorDown(e):""}var B2=class{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(r){this.rl=r,this.cursorPos=r.getCursorPos()}write(r){this.rl.output.unmute(),this.rl.output.write(r),this.rl.output.mute()}render(r,n=""){let o=L3t(r),i=(0,j4e.stripVTControlCharacters)(o),a=i;this.rl.line.length>0&&(a=a.slice(0,-this.rl.line.length)),this.rl.setPrompt(a),this.cursorPos=this.rl.getCursorPos();let c=MN();r=$2(r,c),n=$2(n,c),i.length%c===0&&(r+=`
`);let u=r+(n?`
`+n:""),p=Math.floor(i.length/c)-this.cursorPos.rows+(n?L4e(n):0);p>0&&(u+=tg.default.cursorUp(p)),u+=tg.default.cursorTo(this.cursorPos.cols),this.write(B4e(this.extraLinesUnderPrompt)+tg.default.eraseLines(this.height)+u),this.extraLinesUnderPrompt=p,this.height=L4e(u)}checkCursorPos(){let r=this.rl.getCursorPos();r.cols!==this.cursorPos.cols&&(this.write(tg.default.cursorTo(r.cols)),this.cursorPos=r)}done({clearContent:r}){this.rl.setPrompt("");let n=B4e(this.extraLinesUnderPrompt);n+=r?tg.default.eraseLines(this.height):`
`,n+=tg.default.cursorShow,this.write(n),this.rl.close()}};var $N=class extends Promise{static withResolver(){let r,n;return{promise:new Promise((i,a)=>{r=i,n=a}),resolve:r,reject:n}}};function B3t(){let e=Error.prepareStackTrace,r=[];try{Error.prepareStackTrace=(n,o)=>{let i=o.slice(1);return r=i,i},new Error().stack}catch{return r}return Error.prepareStackTrace=e,r}function Io(e){let r=B3t();return(o,i={})=>{let{input:a=process.stdin,signal:c}=i,u=new Set,l=new G4e.default;l.pipe(i.output??process.stdout);let p=U4e.createInterface({terminal:!0,input:a,output:l}),f=new B2(p),{promise:g,resolve:x,reject:b}=$N.withResolver(),v=()=>b(new AN);if(c){let _=()=>b(new CN({cause:c.reason}));if(c.aborted)return _(),Object.assign(g,{cancel:v});c.addEventListener("abort",_),u.add(()=>c.removeEventListener("abort",_))}u.add(Cv((_,D)=>{b(new PN(`User force closed the prompt with ${_} ${D}`))}));let S=()=>f.checkCursorPos();return p.input.on("keypress",S),u.add(()=>p.input.removeListener("keypress",S)),KLe(p,_=>{let D=q4e.AsyncResource.bind(()=>tx.clearAll());return p.on("close",D),u.add(()=>p.removeListener("close",D)),_(()=>{try{let P=e(o,I=>{setImmediate(()=>x(I))});if(P===void 0){let I=r[1]?.getFileName?.();throw new Error(`Prompt functions must return a string.
at ${I}`)}let[C,O]=typeof P=="string"?[P]:P;f.render(C,O),tx.run()}catch(P){b(P)}}),Object.assign(g.then(P=>(tx.clearAll(),P),P=>{throw tx.clearAll(),P}).finally(()=>{u.forEach(P=>P()),f.done({clearContent:!!i.clearPromptOnDone}),l.end()}).then(()=>g),{cancel:v})})}}var H4e=W(eg(),1);var Cr=class{separator=H4e.default.dim(Array.from({length:15}).join(xu.line));type="separator";constructor(r){r&&(this.separator=r)}static isSeparator(r){return!!(r&&typeof r=="object"&&"type"in r&&r.type==="separator")}};var NN=W(eg(),1);var W4e=W(L2(),1),j3t={icon:{checked:NN.default.green(xu.circleFilled),unchecked:xu.circle,cursor:xu.pointer},style:{disabledChoice:e=>NN.default.dim(`- ${e}`),renderSelectedChoices:e=>e.map(r=>r.short).join(", "),description:e=>NN.default.cyan(e)},helpMode:"auto"};function rg(e){return!Cr.isSeparator(e)&&!e.disabled}function $Q(e){return rg(e)&&!!e.checked}function NQ(e){return rg(e)?{...e,checked:!e.checked}:e}function U3t(e){return function(r){return rg(r)?{...r,checked:e}:r}}function q3t(e){return e.map(r=>{if(Cr.isSeparator(r))return r;if(typeof r=="string")return{value:r,name:r,short:r,disabled:!1,checked:!1};let n=r.name??String(r.value);return{value:r.value,name:n,short:r.short??n,description:r.description,disabled:r.disabled??!1,checked:r.checked??!1}})}var G3t=Io((e,r)=>{let{instructions:n,pageSize:o=7,loop:i=!0,required:a,validate:c=()=>!0}=e,u={all:"a",invert:"i",...e.shortcuts},l=fo(j3t,e.theme),p=vu(!0),[f,g]=vt("idle"),x=Oo({status:f,theme:l}),[b,v]=vt(q3t(e.choices)),S=wc(()=>{let z=b.findIndex(rg),X=b.findLastIndex(rg);if(z===-1)throw new Xh("[checkbox prompt] No selectable choices. All choices are disabled.");return{first:z,last:X}},[b]),[_,D]=vt(S.first),[P,C]=vt(!0),[O,I]=vt();Fo(async z=>{if(Jo(z)){let X=b.filter($Q),U=await c([...X]);a&&!b.some($Q)?I("At least one choice must be selected"):U===!0?(g("done"),r(X.map(Z=>Z.value))):I(U||"You must select a valid value")}else if(Qh(z)||ww(z)){if(i||Qh(z)&&_!==S.first||ww(z)&&_!==S.last){let X=Qh(z)?-1:1,U=_;do U=(U+X+b.length)%b.length;while(!rg(b[U]));D(U)}}else if(VLe(z))I(void 0),C(!1),v(b.map((X,U)=>U===_?NQ(X):X));else if(z.name===u.all){let X=b.some(U=>rg(U)&&!U.checked);v(b.map(U3t(X)))}else if(z.name===u.invert)v(b.map(NQ));else if(DN(z)){let X=Number(z.name)-1,U=b[X];U!=null&&rg(U)&&(D(X),v(b.map((Z,oe)=>oe===X?NQ(Z):Z)))}});let k=l.style.message(e.message,f),j,G=rx({items:b,active:_,renderItem({item:z,isActive:X}){if(Cr.isSeparator(z))return` ${z.separator}`;if(z.disabled){let se=typeof z.disabled=="string"?z.disabled:"(disabled)";return l.style.disabledChoice(`${z.name} ${se}`)}X&&(j=z.description);let U=z.checked?l.icon.checked:l.icon.unchecked,Z=X?l.style.highlight:se=>se,oe=X?l.icon.cursor:" ";return Z(`${oe}${U} ${z.name}`)},pageSize:o,loop:i});if(f==="done"){let z=b.filter($Q),X=l.style.answer(l.style.renderSelectedChoices(z,b));return`${x} ${k} ${X}`}let B="",H="";(l.helpMode==="always"||l.helpMode==="auto"&&P&&(n===void 0||n))&&(typeof n=="string"?B=n:B=` (Press ${[`${l.style.key("space")} to select`,u.all?`${l.style.key(u.all)} to toggle all`:"",u.invert?`${l.style.key(u.invert)} to invert selection`:"",`and ${l.style.key("enter")} to proceed`].filter(X=>X!=="").join(", ")})`,b.length>o&&(l.helpMode==="always"||l.helpMode==="auto"&&p.current)&&(H=`
${l.style.help("(Use arrow keys to reveal more choices)")}`,p.current=!1));let N=j?`
${l.style.description(j)}`:"",Y="";return O&&(Y=`
${l.style.error(O)}`),`${x} ${k}${B}
${G}${H}${N}${Y}${W4e.default.cursorHide}`});var xBe=require("node:async_hooks"),bBe=W(yBe(),1);var FBt={validationFailureMode:"keep"},IBt=Io((e,r)=>{let{waitForUseInput:n=!0,file:{postfix:o=e.postfix??".txt",...i}={},validate:a=()=>!0}=e,c=fo(FBt,e.theme),[u,l]=vt("idle"),[p="",f]=vt(e.default),[g,x]=vt(),b=Oo({status:u,theme:c});function v(P){P.pause();let C=xBe.AsyncResource.bind(async(O,I)=>{if(P.resume(),O)x(O.toString());else{l("loading");let k=await a(I);k===!0?(x(void 0),l("done"),r(I)):(c.validationFailureMode==="clear"?f(e.default):f(I),x(k||"You must provide a valid value"),l("idle"))}});(0,bBe.editAsync)(p,(O,I)=>void C(O,I),{postfix:o,...i})}Pl(P=>{n||v(P)},[]),Fo((P,C)=>{u==="idle"&&Jo(P)&&v(C)});let S=c.style.message(e.message,u),_="";if(u==="loading")_=c.style.help("Received");else if(u==="idle"){let P=c.style.key("enter");_=c.style.help(`Press ${P} to launch your preferred editor.`)}let D="";return g&&(D=c.style.error(g)),[[b,S,_].filter(Boolean).join(" "),D]});function vBe(e,r){let n=r!==!1;return/^(y|yes)/i.test(e)?n=!0:/^(n|no)/i.test(e)&&(n=!1),n}function EBe(e){return e?"Yes":"No"}var DX=Io((e,r)=>{let{transformer:n=EBe}=e,[o,i]=vt("idle"),[a,c]=vt(""),u=fo(e.theme),l=Oo({status:o,theme:u});Fo((x,b)=>{if(Jo(x)){let v=vBe(a,e.default);c(n(v)),i("done"),r(v)}else if(x.name==="tab"){let v=EBe(!vBe(a,e.default));b.clearLine(0),b.write(v),c(v)}else c(b.line)});let p=a,f="";o==="done"?p=u.style.answer(a):f=` ${u.style.defaultAnswer(e.default===!1?"y/N":"Y/n")}`;let g=u.style.message(e.message,o);return`${l} ${g}${f} ${p}`});var RBt={validationFailureMode:"keep"},CX=Io((e,r)=>{let{required:n,validate:o=()=>!0}=e,i=fo(RBt,e.theme),[a,c]=vt("idle"),[u="",l]=vt(e.default),[p,f]=vt(),[g,x]=vt(""),b=Oo({status:a,theme:i});Fo(async(P,C)=>{if(a==="idle")if(Jo(P)){let O=g||u;c("loading");let I=n&&!O?"You must provide a value":await o(O);I===!0?(x(O),c("done"),r(O)):(i.validationFailureMode==="clear"?x(""):C.write(g),f(I||"You must provide a valid value"),c("idle"))}else Sw(P)&&!g?l(void 0):P.name==="tab"&&!g?(l(void 0),C.clearLine(0),C.write(u),x(u)):(x(C.line),f(void 0))});let v=i.style.message(e.message,a),S=g;typeof e.transformer=="function"?S=e.transformer(g,{isFinal:a==="done"}):a==="done"&&(S=i.style.answer(g));let _;u&&a!=="done"&&!g&&(_=i.style.defaultAnswer(u));let D="";return p&&(D=i.style.error(p)),[[b,v,_,S].filter(P=>P!==void 0).join(" "),D]});function MBt(e,r,n){let o=e*Math.pow(10,6),i=r*Math.pow(10,6),a=n*Math.pow(10,6);return(o-(Number.isFinite(n)?a:0))%i===0}function wBe(e,{min:r,max:n,step:o}){return e==null||Number.isNaN(e)?!1:e<r||e>n?`Value must be between ${r} and ${n}`:o!=="any"&&!MBt(e,o,r)?`Value must be a multiple of ${o}${Number.isFinite(r)?` starting from ${r}`:""}`:!0}var kBt=Io((e,r)=>{let{validate:n=()=>!0,min:o=-1/0,max:i=1/0,step:a=1,required:c=!1}=e,u=fo(e.theme),[l,p]=vt("idle"),[f,g]=vt(""),x=wBe(e.default,{min:o,max:i,step:a})===!0?e.default?.toString():void 0,[b="",v]=vt(x),[S,_]=vt(),D=Oo({status:l,theme:u});Fo(async(k,j)=>{if(l==="idle")if(Jo(k)){let G=f||b,B=G===""?void 0:Number(G);p("loading");let H=!0;(c||B!=null)&&(H=wBe(B,{min:o,max:i,step:a})),H===!0&&(H=await n(B)),H===!0?(g(String(B??"")),p("done"),r(B)):(j.write(f),_(H||"You must provide a valid numeric value"),p("idle"))}else Sw(k)&&!f?v(void 0):k.name==="tab"&&!f?(v(void 0),j.clearLine(0),j.write(b),g(b)):(g(j.line),_(void 0))});let P=u.style.message(e.message,l),C=f;l==="done"&&(C=u.style.answer(f));let O;b&&l!=="done"&&!f&&(O=u.style.defaultAnswer(b));let I="";return S&&(I=u.style.error(S)),[[D,P,O,C].filter(k=>k!==void 0).join(" "),I]});var AX=W(eg(),1);function $Bt(e){return e.map(r=>{if(Cr.isSeparator(r))return r;let n="name"in r?r.name:String(r.value);return{value:"value"in r?r.value:n,name:n,key:r.key.toLowerCase()}})}var NBt={key:"h",name:"Help, list all options",value:void 0},LBt=Io((e,r)=>{let{default:n="h"}=e,o=wc(()=>$Bt(e.choices),[e.choices]),[i,a]=vt("idle"),[c,u]=vt(""),[l,p]=vt(e.expanded??!1),[f,g]=vt(),x=fo(e.theme),b=Oo({theme:x,status:i});Fo((I,k)=>{if(Jo(I)){let j=(c||n).toLowerCase();if(j=
`));let P="",C=o.find(I=>!Cr.isSeparator(I)&&I.key===c.toLowerCase());C&&(P=`${AX.default.cyan(">>")} ${C.name}`);let O="";return f&&(O=x.style.error(f)),[`${b} ${v}${D} ${c}`,[_,P,O].filter(Boolean).join(`
`)]});var SBe=W(eg(),1),BBt=/\d+/;function PX(e){return e!=null&&!Cr.isSeparator(e)}function jBt(e){let r=0;return e.map(n=>{if(Cr.isSeparator(n))return n;if(r+=1,typeof n=="string")return{value:n,name:n,short:n,key:String(r)};let o=n.name??String(n.value);return{value:n.value,name:o,short:n.short??o,key:n.key??String(r)}})}var UBt=Io((e,r)=>{let n=wc(()=>jBt(e.choices),[e.choices]),[o,i]=vt("idle"),[a,c]=vt(""),[u,l]=vt(),p=fo(e.theme),f=Oo({status:o,theme:p});Fo((v,S)=>{if(Jo(v)){let _;if(BBt.test(a)){let D=Number.parseInt(a,10)-1;_=n.filter(PX)[D]}else _=n.find(D=>PX(D)&&D.key===a);PX(_)?(c(_.short),i("done"),r(_.value)):l(a===""?"Please input a value":`"${SBe.default.red(a)}" isn't an available option`)}else c(S.line),l(void 0)});let g=p.style.message(e.message,o);if(o==="done")return`${f} ${g} ${p.style.answer(a)}`;let x=n.map(v=>{if(Cr.isSeparator(v))return` ${v.separator}`;let S=` ${v.key}) ${v.name}`;return v.key===a.toLowerCase()?p.style.highlight(S):S}).join(`
`),b="";return u&&(b=p.style.error(u)),[`${f} ${g} ${a}`,[x,b].filter(Boolean).join(`
`)]});var _Be=W(L2(),1),qBt=Io((e,r)=>{let{validate:n=()=>!0}=e,o=fo(e.theme),[i,a]=vt("idle"),[c,u]=vt(),[l,p]=vt(""),f=Oo({status:i,theme:o});Fo(async(S,_)=>{if(i==="idle")if(Jo(S)){let D=l;a("loading");let P=await n(D);P===!0?(p(D),a("done"),r(D)):(_.write(l),u(P||"You must provide a valid value"),a("idle"))}else p(_.line),u(void 0)});let g=o.style.message(e.message,i),x="",b;e.mask?x=(typeof e.mask=="string"?e.mask:"*").repeat(l.length):i!=="done"&&(b=`${o.style.help("[input is masked]")}${_Be.default.cursorHide}`),i==="done"&&(x=o.style.answer(x));let v="";return c&&(v=o.style.error(c)),[[f,g,e.mask?x:b].join(" "),v]});var rL=W(eg(),1);var GBt={icon:{cursor:xu.pointer},style:{disabled:e=>rL.default.dim(`- ${e}`),searchTerm:e=>rL.default.cyan(e),description:e=>rL.default.cyan(e)},helpMode:"auto"};function OX(e){return!Cr.isSeparator(e)&&!e.disabled}function HBt(e){return e.map(r=>{if(Cr.isSeparator(r))return r;if(typeof r=="string")return{value:r,name:r,short:r,disabled:!1};let n=r.name??String(r.value);return{value:r.value,name:n,description:r.description,short:r.short??n,disabled:r.disabled??!1}})}var WBt=Io((e,r)=>{let{pageSize:n=7,validate:o=()=>!0}=e,i=fo(GBt,e.theme),a=vu(!0),[c,u]=vt("loading"),[l,p]=vt(""),[f,g]=vt([]),[x,b]=vt(),v=Oo({status:c,theme:i}),S=wc(()=>{let B=f.findIndex(OX),H=f.findLastIndex(OX);return{first:B,last:H}},[f]),[_=S.first,D]=vt();Pl(()=>{let B=new AbortController;return u("loading"),b(void 0),(async()=>{try{let N=await e.source(l||void 0,{signal:B.signal});B.signal.aborted||(D(void 0),b(void 0),g(HBt(N)),u("idle"))}catch(N){!B.signal.aborted&&N instanceof Error&&b(N.message)}})(),()=>{B.abort()}},[l]);let P=f[_];Fo(async(B,H)=>{if(Jo(B))if(P){u("loading");let N=await o(P.value);u("idle"),N===!0?(u("done"),r(P.value)):P.name===l?b(N||"You must provide a valid value"):(H.write(P.name),p(P.name))}else H.write(l);else if(B.name==="tab"&&P)H.clearLine(0),H.write(P.name),p(P.name);else if(c!=="loading"&&(B.name==="up"||B.name==="down")){if(H.clearLine(0),B.name==="up"&&_!==S.first||B.name==="down"&&_!==S.last){let N=B.name==="up"?-1:1,Y=_;do Y=(Y+N+f.length)%f.length;while(!OX(f[Y]));D(Y)}}else p(H.line)});let C=i.style.message(e.message,c);_>0&&(a.current=!1);let O="";f.length>1&&(i.helpMode==="always"||i.helpMode==="auto"&&a.current)&&(O=f.length>n?`
${i.style.help("(Use arrow keys to reveal more choices)")}`:`
${i.style.help("(Use arrow keys)")}`);let I=rx({items:f,active:_,renderItem({item:B,isActive:H}){if(Cr.isSeparator(B))return` ${B.separator}`;if(B.disabled){let z=typeof B.disabled=="string"?B.disabled:"(disabled)";return i.style.disabled(`${B.name} ${z}`)}let N=H?i.style.highlight:z=>z,Y=H?i.icon.cursor:" ";return N(`${Y} ${B.name}`)},pageSize:n,loop:!1}),k;x?k=i.style.error(x):f.length===0&&l!==""&&c==="idle"&&(k=i.style.error("No results found"));let j;if(c==="done"&&P){let B=P.short;return`${v} ${C} ${i.style.answer(B)}`}else j=i.style.searchTerm(l);let G=P?.description?`
${i.style.description(P.description)}`:"";return[[v,C,j].filter(Boolean).join(" "),`${k??I}${O}${G}`]});var FX=W(eg(),1);var TBe=W(L2(),1),VBt={icon:{cursor:xu.pointer},style:{disabled:e=>FX.default.dim(`- ${e}`),description:e=>FX.default.cyan(e)},helpMode:"auto"};function Lw(e){return!Cr.isSeparator(e)&&!e.disabled}function zBt(e){return e.map(r=>{if(Cr.isSeparator(r))return r;if(typeof r=="string")return{value:r,name:r,short:r,disabled:!1};let n=r.name??String(r.value);return{value:r.value,name:n,description:r.description,short:r.short??n,disabled:r.disabled??!1}})}var IX=Io((e,r)=>{let{loop:n=!0,pageSize:o=7}=e,i=vu(!0),a=fo(VBt,e.theme),[c,u]=vt("idle"),l=Oo({status:c,theme:a}),p=vu(),f=wc(()=>zBt(e.choices),[e.choices]),g=wc(()=>{let I=f.findIndex(Lw),k=f.findLastIndex(Lw);if(I===-1)throw new Xh("[select prompt] No selectable choices. All choices are disabled.");return{first:I,last:k}},[f]),x=wc(()=>"default"in e?f.findIndex(I=>Lw(I)&&I.value===e.default):-1,[e.default,f]),[b,v]=vt(x===-1?g.first:x),S=f[b];Fo((I,k)=>{if(clearTimeout(p.current),Jo(I))u("done"),r(S.value);else if(Qh(I)||ww(I)){if(k.clearLine(0),n||Qh(I)&&b!==g.first||ww(I)&&b!==g.last){let j=Qh(I)?-1:1,G=b;do G=(G+j+f.length)%f.length;while(!Lw(f[G]));v(G)}}else if(DN(I)){k.clearLine(0);let j=Number(I.name)-1,G=f[j];G!=null&&Lw(G)&&v(j)}else if(Sw(I))k.clearLine(0);else{let j=k.line.toLowerCase(),G=f.findIndex(B=>Cr.isSeparator(B)||!Lw(B)?!1:B.name.toLowerCase().startsWith(j));G!==-1&&v(G),p.current=setTimeout(()=>{k.clearLine(0)},700)}}),Pl(()=>()=>{clearTimeout(p.current)},[]);let _=a.style.message(e.message,c),D="",P="";(a.helpMode==="always"||a.helpMode==="auto"&&i.current)&&(i.current=!1,f.length>o?P=`
${a.style.help("(Use arrow keys to reveal more choices)")}`:D=a.style.help("(Use arrow keys)"));let C=rx({items:f,active:b,renderItem({item:I,isActive:k}){if(Cr.isSeparator(I))return` ${I.separator}`;if(I.disabled){let B=typeof I.disabled=="string"?I.disabled:"(disabled)";return a.style.disabled(`${I.name} ${B}`)}let j=k?a.style.highlight:B=>B,G=k?a.icon.cursor:" ";return j(`${G} ${I.name}`)},pageSize:o,loop:n});if(c==="done")return`${l} ${_} ${a.style.answer(S.short)}`;let O=S.description?`
${a.style.description(S.description)}`:"";return`${[l,_,D].filter(Boolean).join(" ")}
${C}${P}${O}${TBe.default.cursorHide}`});var KYe=require("@prisma/dev"),Xce=require("@prisma/dev/internal/state");var JYe=W(IBe());var kX=e=>typeof e=="function",J=function(e,r){if(typeof e=="function")return function(){return e(arguments)?r.apply(this,arguments):n=>r(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,o){return arguments.length>=2?r(n,o):function(i){return r(i,n)}};case 3:return function(n,o,i){return arguments.length>=3?r(n,o,i):function(a){return r(a,n,o)}};case 4:return function(n,o,i,a){return arguments.length>=4?r(n,o,i,a):function(c){return r(c,n,o,i)}};case 5:return function(n,o,i,a,c){return arguments.length>=5?r(n,o,i,a,c):function(u){return r(u,n,o,i,a)}};default:return function(){if(arguments.length>=e)return r.apply(this,arguments);let n=arguments;return function(o){return r(o,...n)}}}};var Je=e=>e;var jw=e=>()=>e,Uw=jw(!0),qw=jw(!1),$X=jw(null),oL=jw(void 0),Y2=oL;function ce(e,r,n,o,i,a,c,u,l){switch(arguments.length){case 1:return e;case 2:return r(e);case 3:return n(r(e));case 4:return o(n(r(e)));case 5:return i(o(n(r(e))));case 6:return a(i(o(n(r(e)))));case 7:return c(a(i(o(n(r(e))))));case 8:return u(c(a(i(o(n(r(e)))))));case 9:return l(u(c(a(i(o(n(r(e))))))));default:{let p=arguments[0];for(let f=1;f<arguments.length;f++)p=arguments[f](p);return p}}}var Ln=e=>(r,n)=>r===n||e(r,n),p8t=(e,r)=>e===r,f8t=()=>p8t;var d8t=f8t();var NX=J(2,(e,r)=>Ln((n,o)=>e(r(n),r(o)))),RBe=NX(d8t,e=>e.getTime());var MBe=e=>Ln((r,n)=>{if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++)if(!e(r[o],n[o]))return!1;return!0});var kBe="effect/GlobalValue",Z2,rt=(e,r)=>(Z2||(globalThis[kBe]??=new Map,Z2=globalThis[kBe]),Z2.has(e)||Z2.set(e,r()),Z2.get(e));var $Be=e=>!!e,NBe=e=>e instanceof Set,LBe=e=>e instanceof Map,mo=e=>typeof e=="string",Ra=e=>typeof e=="number",Il=e=>typeof e=="boolean",ig=e=>typeof e=="bigint",tf=e=>typeof e=="symbol";var Rl=kX,BBe=e=>e===void 0,jBe=e=>e!==void 0;var iL=e=>e!==null,UBe=e=>!1;var Gw=e=>typeof e=="object"&&e!==null,Mi=e=>Gw(e)||Rl(e),Ae=J(2,(e,r)=>Mi(e)&&r in e),Q2=J(2,(e,r)=>Ae(e,"_tag")&&e._tag===r),px=e=>e==null,qBe=e=>e!=null;var GBe=e=>e instanceof Uint8Array,sL=e=>e instanceof Date,LX=e=>typeof e=="string"||Ae(e,Symbol.iterator),X2=e=>Gw(e)&&!Array.isArray(e);var HBe=e=>Ae(e,"then")&&Rl(e.then);var fx=e=>`BUG: ${e} - please report an issue at https://github.com/Effect-TS/effect/issues`;var WBe=Symbol.for("effect/Gen/GenKind");var VBe=class{value;constructor(r){this.value=r}get _F(){return Je}get _R(){return r=>r}get _O(){return r=>r}get _E(){return r=>r}[WBe]=WBe;[Symbol.iterator](){return new dx(this)}},dx=class e{self;called=!1;constructor(r){this.self=r}next(r){return this.called?{value:r,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(r){return{value:r,done:!0}}throw(r){throw r}[Symbol.iterator](){return new e(this.self)}};var h8t=335903614,g8t=4150755663,y8t=1481765933,x8t=1284865837,b8t=9007199254740992,v8t=134217728,aL=class{_state;constructor(r,n,o,i){return px(n)&&px(r)?(n=Math.random()*4294967295>>>0,r=0):px(n)&&(n=r,r=0),px(i)&&px(o)?(i=this._state?this._state[3]:g8t,o=this._state?this._state[2]:h8t):px(i)&&(i=o,o=0),this._state=new Int32Array([0,0,o>>>0,((i||0)|1)>>>0]),this._next(),zBe(this._state,this._state[0],this._state[1],r>>>0,n>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(r){this._state[0]=r[0],this._state[1]=r[1],this._state[2]=r[2],this._state[3]=r[3]|1}integer(r){return Math.round(this.number()*Number.MAX_SAFE_INTEGER)%r}number(){let r=(this._next()&67108863)*1,n=(this._next()&134217727)*1;return(r*v8t+n)/b8t}_next(){let r=this._state[0]>>>0,n=this._state[1]>>>0;E8t(this._state,r,n,y8t,x8t),zBe(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let o=r>>>18,i=(n>>>18|r<<14)>>>0;o=(o^r)>>>0,i=(i^n)>>>0;let a=(i>>>27|o<<5)>>>0,c=r>>>27,u=(-c>>>0&31)>>>0;return(a>>>c|a<<u)>>>0}};function E8t(e,r,n,o,i){let a=(n>>>16)*(i&65535)>>>0,c=(n&65535)*(i>>>16)>>>0,u=(n&65535)*(i&65535)>>>0,l=(n>>>
`)+"`"}[Xn](){return new e(this.act,this.sourceTaskSelector)}};var Wee;(function(e){e[e.Full=0]="Full",e[e.Character=1]="Character"})(Wee||(Wee={}));var Jen=String.fromCodePoint;var ltn=String.fromCodePoint,ptn=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],ftn=[..."0123456789"],dtn=[...` \r
\v\f`],C9t=[...`\r
`],A9t=[...""],mtn=[...C9t,...A9t],htn=Lee();var zee=(e,r)=>{switch(r._tag){case"StringKeyword":case"TemplateLiteral":return Object.keys(e);case"SymbolKeyword":return Object.getOwnPropertySymbols(e);case"Refinement":return zee(e,r.from)}},mS=e=>{let r=!1,n;return()=>(r||(n=e(),r=!0),n)},Js=e=>{try{return e.toISOString()}catch{return String(e)}},Vee="[Circular]";function Na(e,r=0){let n=new WeakSet,o=r?typeof r=="number"?" ".repeat(r):r:"",i=p=>o.repeat(p),a=p=>{try{let f=p.toString();return typeof f=="string"?f:String(f)}catch{return"[toString threw]"}},c=(p,f)=>{let g=p?.constructor;return g&&g!==Object.prototype.constructor&&g.name?`${g.name}(${f})`:f},u=p=>{try{return Reflect.ownKeys(p)}catch{return["[ownKeys threw]"]}};function l(p,f=0){if(Array.isArray(p)){if(n.has(p))return Vee;if(n.add(p),!o||p.length<=1)return`[${p.map(x=>l(x,f)).join(",")}]`;let g=p.map(x=>l(x,f+1)).join(`,
`+i(f+1));return`[
${i(f+1)}${g}
${i(f)}]`}if(sL(p))return Js(p);if(Ae(p,"toString")&&Rl(p.toString)&&p.toString!==Object.prototype.toString)return a(p);if(mo(p))return JSON.stringify(p);if(Ra(p)||p==null||Il(p)||tf(p))return String(p);if(ig(p))return String(p)+"n";if(p instanceof Set||p instanceof Map)return n.has(p)?Vee:(n.add(p),`${p.constructor.name}(${l(Array.from(p),f)})`);if(Mi(p)){if(n.has(p))return Vee;n.add(p);let g=u(p);if(!o||g.length<=1){let b=`{${g.map(v=>`${Rx(v)}:${l(p[v],f)}`).join(",")}}`;return c(p,b)}let x=`{
${g.map(b=>`${i(f+1)}${Rx(b)}: ${l(p[b],f+1)}`).join(`,
`)}
${i(f)}}`;return c(p,x)}return String(p)}return l(e,0)}function Rx(e){return mo(e)?JSON.stringify(e):String(e)}var KL=e=>Array.isArray(e),lje=e=>!Array.isArray(e),uje=e=>`[${Rx(e)}]`,JL=e=>KL(e)?e.map(uje).join(""):uje(e);var Ll=(e,r,n,o)=>{let i=e;return n&&Pr(n)&&(i+=`
at path: ${JL(n)}`),r!==void 0&&(i+=`
details: ${r}`),o&&(i+=`
schema (${o._tag}): ${o}`),i},ZL=e=>Ll("Invalid Argument",e),Kee=(e,r,n)=>Ll("Unsupported schema",e,r,n);var pje=(e,r)=>Kee("Cannot build an Equivalence",r,e);var Jee=(e,r,n)=>Ll("Unsupported schema or overlapping types",`cannot extend ${e} with ${r}`,n),fje=e=>Ll("Unsupported template literal span",void 0,void 0,e),Zd=e=>Kee(void 0,void 0,e),dje=e=>Ll("Unsupported key schema",void 0,void 0,e),mje=e=>Ll("Unsupported literal",`literal value: ${Na(e)}`),Yee=e=>Ll("Duplicate index signature",`${e} index signature`),hje=Ll("Unsupported index signature parameter","An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types"),gje=Ll("Invalid element","A required element cannot follow an optional element. ts(1257)"),Zee=e=>Ll("Duplicate property signature transformation",`Duplicate key ${Na(e)}`),yje=e=>Kee(void 0,void 0,e),QL=e=>Ll("Duplicate property signature",`Duplicate key ${Na(e)}`);var bje=Symbol.for("effect/SchemaId/DateFromSelf"),vje=Symbol.for("effect/SchemaId/GreaterThan"),Eje=Symbol.for("effect/SchemaId/GreaterThanOrEqualTo"),wje=Symbol.for("effect/SchemaId/LessThan"),Sje=Symbol.for("effect/SchemaId/LessThanOrEqualTo"),_je=Symbol.for("effect/SchemaId/Int"),Tje=Symbol.for("effect/SchemaId/NonNaN"),Dje=Symbol.for("effect/SchemaId/Finite"),Cje=Symbol.for("effect/SchemaId/JsonNumber"),Aje=Symbol.for("effect/SchemaId/Between"),Pje=Symbol.for("effect/SchemaId/GreaterThanBigint"),Oje=Symbol.for("effect/SchemaId/GreaterThanOrEqualToBigint"),Fje=Symbol.for("effect/SchemaId/LessThanBigint"),Ije=Symbol.for("effect/SchemaId/LessThanOrEqualToBigint"),Rje=Symbol.for("effect/SchemaId/BetweenBigint"),Mje=Symbol.for("effect/SchemaId/MinLength"),kje=Symbol.for("effect/SchemaId/MaxLength"),$je=Symbol.for("effect/SchemaId/Length"),Nje=Symbol.for("effect/SchemaId/MinItems"),Lje=Symbol.for("effect/SchemaId/MaxItems"),Bje=Symbol.for("effect/SchemaId/ItemsCount");var Bl=EL;var jje=cg(Bl);var Uje=J(2,(e,r)=>{let n=(e.toString().split(".")[1]||"").length,o=(r.toString().split(".")[1]||"").length,i=n>o?n:o,a=parseInt(e.toFixed(i).replace(".","")),c=parseInt(r.toFixed(i).replace(".",""));return a%c/Math.pow(10,i)});var qje=e=>{if(e==="NaN")return Sc(NaN);if(e==="Infinity")return Sc(1/0);if(e==="-Infinity")return Sc(-1/0);if(e.trim()==="")return of;let r=Number(e);return Number.isNaN(r)?of:Sc(r)};var gS=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&");var dte=Symbol.for("effect/annotation/Brand"),Hje=Symbol.for("effect/annotation/SchemaId"),mte=Symbol.for("effect/annotation/Message"),t4=Symbol.for("effect/annotation/MissingMessage"),_C=Symbol.for("effect/annotation/Identifier"),La=Symbol.for("effect/annotation/Title"),Eg=Symbol.for("effect/annotation/AutoTitle"),nm=Symbol.for("effect/annotation/Description"),hte=Symbol.for("effect/annotation/Examples"),yte=Symbol.for("effect/annotation/Default"),xte=Symbol.for("effect/annotation/JSONSchema"),bte=Symbol.for("effect/annotation/Arbitrary"),vte=Symbol.for("effect/annotation/Pretty"),r4=Symbol.for("effect/annotation/Equivalence"),Wje=Symbol.for("effect/annotation/Documentation"),Ete=Symbol.for("effect/annotation/Concurrency"),wte=Symbol.for("effect/annotation/Batching"),Ste=Symbol.for("effect/annotation/ParseIssueTitle"),_te=Symbol.for("effect/annotation/ParseOptions"),Tte=Symbol.for("effect/annotation/DecodingFallback"),TC=Symbol.for("effect/annotation/Surrogate"),DC=Symbol.for("effect/annotation/StableFilter"),cs=J(2,(e,r)=>Object.prototype.hasOwnProperty.call(e.annotations,r)?Ce(e.annotations[r]):Se()),Dte=cs(dte);var Vje=cs(mte),zje=cs(t4),Cte=cs(La),Ate=cs(Eg),CC=cs(_C),Pte=cs(nm);var Kje=cs(Ete),Jje=cs(wte),Yje=cs(Ste),Zje=cs(_te),Qje=cs(Tte),wg=cs(TC),O9t=cs(DC),Ote=e=>w8e(O9t(e),r=>r===!0),n4=Symbol.for("effect/annotation/JSONIdentifier"),F9t=cs(n4),I9t=e=>Du(F9t(e),()=>CC(e)),Xje=Symbol.for("effect/schema/ParseJson"),Lx=class{typeParameters;decodeUnknown;encodeUnknown;annotations;_tag="Declaration";constructor(r,n,o,i={}){this.typeParameters=r,this.decodeUnknown=n,this.encodeUnknown=o,this.annotations=i}toString(){return Mr(Iu(this
`);if(n.length>2){let o=n[2].match(/at (.*)/);o&&(r.message=r.message+` (defined at ${o[1]})`)}}if(r.stack){let n=r.stack.split(`
`);n.splice(1,3),r.stack=n.join(`
`)}return r},V9e=e=>Ae(e,Zte);var z9e=e=>Ae(e,MC),pUt=Tg(new Map),K9e=()=>pUt,Qte=(e,r)=>Tg(new Map([[e.key,r]])),J9e=J(3,(e,r,n)=>{let o=new Map(e.unsafeMap);return o.set(r.key,n),Tg(o)}),Yte=rt("effect/Context/defaultValueCache",()=>new Map),Xte=e=>{if(Yte.has(e.key))return Yte.get(e.key);let r=e.defaultValue();return Yte.set(e.key,r),r},Y9e=(e,r)=>e.unsafeMap.has(r.key)?e.unsafeMap.get(r.key):Xte(r),ere=J(2,(e,r)=>{if(!e.unsafeMap.has(r.key)){if(MC in r)return Xte(r);throw lUt(r)}return e.unsafeMap.get(r.key)}),Z9e=ere;var Q9e=J(2,(e,r)=>e.unsafeMap.has(r.key)?Sc(e.unsafeMap.get(r.key)):z9e(r)?Sc(Xte(r)):of),X9e=J(2,(e,r)=>{let n=new Map(e.unsafeMap);for(let[o,i]of r.unsafeMap)n.set(o,i);return Tg(n)});var Ba=H9e;var qx=K9e,tUe=Qte,om=J9e,tre=Z9e;var d4=ere,Gx=Q9e,kC=X9e;var $C=W9e;var nUe=Symbol.for("effect/Chunk");function dUt(e,r,n,o,i){for(let a=r;a<Math.min(e.length,r+i);a++)n[o+a-r]=e[a];return n}var oUe=[],m4=e=>Ln((r,n)=>r.length===n.length&&Cs(r).every((o,i)=>e(o,ES(n,i)))),mUt=m4(De),hUt={[nUe]:{_A:e=>e},toString(){return ir(this.toJSON())},toJSON(){return{_id:"Chunk",values:Cs(this).map(Yt)}},[ft](){return this.toJSON()},[Pe](e){return NC(e)&&mUt(this,e)},[Fe](){return pt(this,ka(Cs(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return oUe[Symbol.iterator]();default:return Cs(this)[Symbol.iterator]()}},pipe(){return _e(this,arguments)}},fi=e=>{let r=Object.create(hUt);switch(r.backing=e,e._tag){case"IEmpty":{r.length=0,r.depth=0,r.left=r,r.right=r;break}case"IConcat":{r.length=e.left.length+e.right.length,r.depth=1+Math.max(e.left.depth,e.right.depth),r.left=e.left,r.right=e.right;break}case"IArray":{r.length=e.array.length,r.depth=0,r.left=pf,r.right=pf;break}case"ISingleton":{r.length=1,r.depth=0,r.left=pf,r.right=pf;break}case"ISlice":{r.length=e.length,r.depth=e.chunk.depth+1,r.left=pf,r.right=pf;break}}return r},NC=e=>Ae(e,nUe),pf=fi({_tag:"IEmpty"}),Qs=()=>pf,LC=(...e)=>jC(e),Qo=e=>fi({_tag:"ISingleton",a:e}),im=e=>NC(e)?e:BC(Gr(e)),rre=(e,r,n)=>{switch(e.backing._tag){case"IArray":{dUt(e.backing.array,0,r,n,e.length);break}case"IConcat":{rre(e.left,r,n),rre(e.right,r,n+e.left.length);break}case"ISingleton":{r[n]=e.backing.a;break}case"ISlice":{let o=0,i=n;for(;o<e.length;)r[i]=ES(e,o),o+=1,i+=1;break}}};var gUt=e=>{switch(e.backing._tag){case"IEmpty":return oUe;case"IArray":return e.backing.array;default:{let r=new Array(e.length);return rre(e,r,0),e.backing={_tag:"IArray",array:r},e.left=pf,e.right=pf,e.depth=0,r}}},Cs=gUt,yUt=e=>{switch(e.backing._tag){case"IEmpty":case"ISingleton":return e;case"IArray":return fi({_tag:"IArray",array:aee(e.backing.array)});case"IConcat":return fi({_tag:"IConcat",left:Dg(e.backing.right),right:Dg(e.backing.left)});case"ISlice":return BC(aee(Cs(e)))}},Dg=yUt;var BC=e=>e.length===0?Qs():e.length===1?Qo(e[0]):fi({_tag:"IArray",array:e}),jC=e=>BC(e),ES=J(2,(e,r)=>{switch(e.backing._tag){case"IEmpty":throw new Error("Index out of bounds");case"ISingleton":{if(r!==0)throw new Error("Index out of bounds");return e.backing.a}case"IArray":{if(r>=e.length||r<0)throw new Error("Index out of bounds");return e.backing.array[r]}case"IConcat":return r<e.left.length?ES(e.left,r):ES(e.right,r-e.left.length);case"ISlice":return ES(e.backing.chunk,r+e.backing.offset)}}),iUe=J(2,(e,r)=>Cc(e,Qo(r))),As=J(2,(e,r)=>Cc(Qo(r),e));var nre=J(2,(e,r)=>{if(r<=0)return e;if(r>=e.length)return pf;switch(e.backing._tag){case"ISlice":return fi({_tag:"ISlice",chunk:e.backing.chunk,offset:e.backing.offset+r,length:e.backing.length-r});case"IConcat":return r>e.left.length?nre(e.right,r-e.left.length):fi({_tag:"IConcat",left:nre(e.left,r),right:e.right});default:return fi({_tag:"ISlice",chunk:e,offset:r,length:e.length-r})}});var Cc=J(2,(e,r)=>{if(e.backing._tag==="IEmpty")return r;if(r.backing._tag==="IEmpty")return e;let n=r.depth-e.depth;if(Math.abs(n)<=1)return fi({_tag:"IConcat",left:e,right:r});if(n<-1)if(e.left.depth>=e.right.depth){let o=Cc(e.right,r);return fi({_tag:"IConcat",left:e.left,right:o})}else{let o=Cc(e.r
${qqe(n.cause," ")}
}`}).join(`
`),qqe=(e,r)=>{let n=e.stack.split(`
`),o=`${r}[cause]: ${n[0]}`;for(let i=1,a=n.length;i<a;i++)o+=`
${r}${n[i]}`;return e.cause&&(o+=` {
${qqe(e.cause,`${r} `)}
${r}}`),o},t3=class e extends globalThis.Error{span=void 0;constructor(r){let n=typeof r=="object"&&r!==null,o=Error.stackTraceLimit;Error.stackTraceLimit=1,super(a3(r),n&&"cause"in r&&typeof r.cause<"u"?{cause:new e(r.cause)}:void 0),this.message===""&&(this.message="An error has occurred"),Error.stackTraceLimit=o,this.name=r instanceof Error?r.name:"Error",n&&(rb in r&&(this.span=r[rb]),Object.keys(r).forEach(i=>{i in this||(this[i]=r[i])})),this.stack=p7t(`${this.name}: ${this.message}`,r instanceof Error&&r.stack?r.stack:"",this.span)}},a3=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&e instanceof Error)return e.message;try{if(Ae(e,"toString")&&Rl(e.toString)&&e.toString!==Object.prototype.toString&&e.toString!==globalThis.Array.prototype.toString)return e.toString()}catch{}return pL(e)},u7t=/\((.*)\)/g,l7t=rt("effect/Tracer/spanToTrace",()=>new WeakMap),p7t=(e,r,n)=>{let o=[e],i=r.startsWith(e)?r.slice(e.length).split(`
`):r.split(`
`);for(let a=1;a<i.length;a++){if(i[a].includes(" at new BaseEffectError")||i[a].includes(" at new YieldableError")){a++;continue}if(i[a].includes("Generator.next")||i[a].includes("effect_internal_function"))break;o.push(i[a].replace(/at .*effect_instruction_i.*\((.*)\)/,"at $1").replace(/EffectPrimitive\.\w+/,"<anonymous>"))}if(n){let a=n,c=0;for(;a&&a._tag==="Span"&&c<10;){let u=l7t.get(a);if(typeof u=="function"){let l=u();if(typeof l=="string"){let p=l.matchAll(u7t),f=!1;for(let[,g]of p)f=!0,o.push(` at ${a.name} (${g})`);f||o.push(` at ${a.name} (${l.replace(/^at /,"")})`)}else o.push(` at ${a.name}`)}else o.push(` at ${a.name}`);a=_s(a.parent),c++}}return o.join(`
`)},rb=Symbol.for("effect/SpanAnnotation"),c3=e=>s3(e,void 0,{emptyCase:()=>[],dieCase:(r,n)=>[new t3(n)],failCase:(r,n)=>[new t3(n)],interruptCase:()=>[],parallelCase:(r,n,o)=>[...n,...o],sequentialCase:(r,n,o)=>[...n,...o]});var NS="Pending",u3="Done";var f7t="effect/Deferred",Hqe=Symbol.for(f7t),Wqe={_E:e=>e,_A:e=>e},Vqe=e=>({_tag:NS,joiners:e}),zqe=e=>({_tag:u3,effect:e});var LS=class e{self;called=!1;constructor(r){this.self=r}next(r){return this.called?{value:r,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(r){return{value:r,done:!0}}throw(r){throw r}[Symbol.iterator](){return new e(this.self)}};var g3=(e,r)=>{let n=new di("Blocked");return n.effect_instruction_i0=e,n.effect_instruction_i1=r,n},bne=e=>{let r=new di("RunBlocked");return r.effect_instruction_i0=e,r},Bg=Symbol.for("effect/Effect"),p3=class{patch;op;_op=rC;constructor(r,n){this.patch=r,this.op=n}},di=class{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Bg]=ag;constructor(r){this._op=r}[Pe](r){return this===r}[Fe](){return pt(this,Hw(this))}pipe(){return _e(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:Yt(this.effect_instruction_i0),effect_instruction_i1:Yt(this.effect_instruction_i1),effect_instruction_i2:Yt(this.effect_instruction_i2)}}toString(){return ir(this.toJSON())}[ft](){return this.toJSON()}[Symbol.iterator](){return new LS(new rf(this))}},f3=class{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Bg]=ag;constructor(r){this._op=r,this._tag=r}[Pe](r){return WS(r)&&r._op==="Failure"&&De(this.effect_instruction_i0,r.effect_instruction_i0)}[Fe](){return ce(or(this._tag),Ke(we(this.effect_instruction_i0)),pt(this))}get cause(){return this.effect_instruction_i0}pipe(){return _e(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return ir(this.toJSON())}[ft](){return this.toJSON()}[Symbol.iterator](){return new LS(new rf(this))}},d3=class{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Bg]=ag;constructor(r){this._op=r,this._tag=r}[Pe](r){return WS(r)&&r._op==="Success"&&De(this.effect_instruction_i0,r.effect_instruction_i0)}[Fe](){return ce(or(this._tag),Ke(we(this.effect_instruction_i0)),pt(this))}get value(){return this.effect_instruction_i0}pipe(){return _e(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:Yt(this.value)}}toString(){return ir(this.toJSON())}[ft](){return this.toJSON()}[Symbol.iterator](){return new LS(new rf(this))}},BS=e=>Ae(e,Bg),Ni=e=>{let r=new di(dL);return r.effect_instruction_i0=e,r},Yqe=J(3,(e,r,n)=>ab(o=>ht(e,i=>ht(qg(Dn(()=>o(r(i)))),a=>Dn(()=>n(i,a)).pipe(yf({onFailure:c=>{switch(a._tag){case ws:return qa(Ps(a.effect_instruction_i0,c));case Ss:return qa(c)}},onSuccess:()=>a})))))),jg=J(2,(e,r)=>ht(e,()=>wr(r))),pm=e=>jg(e,void 0),vne=function(){let e=new di(yx);switch(arguments.length){case 2:{e.effect_instruction_i0=arguments[0],e.commit=arguments[1];break}case 3:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.commit=arguments[2];break}case 4:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.effect_instruction_i2=arguments[2],e.commit=arguments[3];break}default:throw new Error(fx("you're not supposed to end up here"))}return e},sA=(e,r=ja)=>{let n=new di(gx),o;return n.effect_instruction_i0=i=>{o=e(i)},n.effect_instruction_i1=r,pA(n,i=>BS(o)?o:Xo)},Zqe=(e,r=ja)=>Dn(()=>sA(e,r)),Ug=(e,r=ja)=>vne(e,function(){let n,o;function i(l){n?n(l):o===void 0&&(o=l)}let a=new di(gx);a.effect_instruction_i0=l=>{n=l,o&&l(o)},a.effect_instruction_i1=r;let c,u;return this.effect_instruction_i0.length!==1?(u=new AbortController,c=ss(()=>this.effect_instruction_i0(i,u.signal))):c=ss(()=>this.effect_instruction_i0(i)),c||u?pA(a,l=>(u&&u.abort(),c??Xo)):a});var aA=J(2,(e,r)=>ib(e,{onFailure:r,onSuccess:wr}));var Kqe=Symbol.for("effect/OriginalAnnotation");var y3=(e,r)=>Zt(r)?new Proxy(e,{has(n,o){return o===rb||o===
${this.stack.split(`
`).slice(1).join(`
`)}`:this.toString():"Bun"in globalThis?Yl(nb(this),{renderErrorCause:!0}):this}}return Object.assign(e.prototype,GX),e}(),pb=(e,r)=>{class n extends xA{_tag=r}return Object.assign(n.prototype,e),n.prototype.name=r,n},fne=Symbol.for("effect/Cause/errors/RuntimeException"),g7e=pb({[fne]:fne},"RuntimeException");var h3=Symbol.for("effect/Cause/errors/InterruptedException"),_7t=pb({[h3]:h3},"InterruptedException"),Rne=e=>Ae(e,h3),dne=Symbol.for("effect/Cause/errors/IllegalArgument"),Mne=pb({[dne]:dne},"IllegalArgumentException");var mne=Symbol.for("effect/Cause/errors/NoSuchElement"),HS=pb({[mne]:mne},"NoSuchElementException");var hne=Symbol.for("effect/Cause/errors/InvalidPubSubCapacityException"),lan=pb({[hne]:hne},"InvalidPubSubCapacityException"),gne=Symbol.for("effect/Cause/errors/ExceededCapacityException"),T7t=pb({[gne]:gne},"ExceededCapacityException");var yne=Symbol.for("effect/Cause/errors/Timeout"),D7t=pb({[yne]:yne},"TimeoutException");var xne=Symbol.for("effect/Cause/errors/UnknownException"),y7e=function(){class e extends xA{_tag="UnknownException";error;constructor(n,o){super(o??"An unknown error occurred",{cause:n}),this.error=n}}return Object.assign(e.prototype,{[xne]:xne,name:"UnknownException"}),e}();var WS=e=>BS(e)&&"_tag"in e&&(e._tag==="Success"||e._tag==="Failure");var kne=e=>e._tag==="Success";var x7e=J(2,(e,r)=>{switch(e._tag){case ws:return Wr(e.effect_instruction_i0);case Ss:return Cn(r)}}),bA=e=>x7e(e,void 0);var fb=(e,r)=>C7t(e,r?.parallel?Lg:Ps),$ne=e=>Wr(Ua(e));var vA=e=>Wr(nb(e)),Wr=e=>{let r=new f3(ws);return r.effect_instruction_i0=e,r};var Nne=e=>Wr(Mu(e)),l3=J(2,(e,r)=>{switch(e._tag){case ws:return Wr(e.effect_instruction_i0);case Ss:return Cn(r(e.effect_instruction_i0))}});var EA=J(2,(e,{onFailure:r,onSuccess:n})=>{switch(e._tag){case ws:return r(e.effect_instruction_i0);case Ss:return n(e.effect_instruction_i0)}});var Cn=e=>{let r=new d3(Ss);return r.effect_instruction_i0=e,r},$u=Cn(void 0);var Lne=J(3,(e,r,{onFailure:n,onSuccess:o})=>{switch(e._tag){case ws:switch(r._tag){case Ss:return Wr(e.effect_instruction_i0);case ws:return Wr(n(e.effect_instruction_i0,r.effect_instruction_i0))}case Ss:switch(r._tag){case Ss:return Cn(o(e.effect_instruction_i0,r.effect_instruction_i0));case ws:return Wr(r.effect_instruction_i0)}}}),C7t=(e,r)=>{let n=im(e);return Ac(n)?ce(Kl(n),aS(ce(zl(n),l3(Qo)),(o,i)=>ce(o,Lne(i,{onSuccess:(a,c)=>ce(a,As(c)),onFailure:r}))),l3(Dg),l3(o=>Cs(o)),Ce):Se()},b7e=e=>({...nf,[Hqe]:Wqe,state:$4(Vqe([])),commit(){return P3(this)},blockingOn:e});var P3=e=>Zqe(r=>{let n=mf(e.state);switch(n._tag){case u3:return r(n.effect);case NS:return n.joiners.push(r),A7t(e,r)}},e.blockingOn);var O3=(e,r)=>{let n=mf(e.state);if(n._tag===NS){Jx(e.state,zqe(r));for(let o=0,i=n.joiners.length;o<i;o++)n.joiners[o](r)}},A7t=(e,r)=>Qe(()=>{let n=mf(e.state);if(n._tag===NS){let o=n.joiners.indexOf(r);o>=0&&n.joiners.splice(o,1)}}),P7t=Ni(e=>Cn(e.currentContext)),v7e=()=>P7t;var db=e=>ht(v7e(),e),O7t=J(2,(e,r)=>Hg(lb,r)(e));var Bne=J(2,(e,r)=>db(n=>O7t(e,r(n))));var F3=e=>{let r=e.currentSpan;return r!==void 0&&r._tag==="Span"?Ce(r):Se()};var E7e=WS;var I3=kne;var jne=Wr;var w7e=EA;var Une=Cn;var S7e=Symbol.for("effect/MutableHashMap"),I7t={[S7e]:S7e,[Symbol.iterator](){return new Gne(this)},toString(){return ir(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(Yt)}},[ft](){return this.toJSON()},pipe(){return _e(this,arguments)}},Gne=class e{self;referentialIterator;bucketIterator;constructor(r){this.self=r,this.referentialIterator=r.referential[Symbol.iterator]()}next(){if(this.bucketIterator!==void 0)return this.bucketIterator.next();let r=this.referentialIterator.next();return r.done?(this.bucketIterator=new Hne(this.self.buckets.values()),this.next()):r}[Symbol.iterator](){return new e(this.self)}},Hne=class{backing;constructor(r){this.backing=r}currentBucket;next(){if(this.currentBucket===void 0){let n=this.backing.next();if(n.done)return n;this.currentBucket=n.value[Symbol.iterator]()}let r=this.currentBucket.next();return r.done?(this.currentBucket=void
`).length;u=n.stack?`(${i}) ${n.stack.split(`
`).slice(0,l+3).join(`
`)}`:`${a}: ${c}`}else a=i,c=Bd(n,0),u=`${a}: ${c}`;o.length>0&&(u+=`
${o.join(`
`)}`),super(c),this._tag=r,this.traces=o,this[$Ge]=IGt,this.name=a,this.stack=u}pipe(){return _e(this,arguments)}toString(){return this.stack}[ft](){return this.stack}};var Ioe=class extends Q3{defect;constructor(r,n=[]){super("Die",r,n),this.defect=r}},RGt=(e,r=[])=>new Ioe(e,r),Roe=class extends Q3{constructor(r=[]){super("Interrupt","interrupted",r)}},MGt=(e=[])=>new Roe(e);var jGe=e=>e._tag==="Interrupt";var NGe=Symbol.for("effect/Micro/MicroFiber"),kGt={_A:Je,_E:Je},X3=class{context;interruptible;[NGe];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(r,n=!0){this.context=r,this.interruptible=n,this[NGe]=kGt}getRef(r){return Y9e(this.context,r)}addObserver(r){return this._exit?(r(this._exit),Y2):(this._observers.push(r),()=>{let n=this._observers.indexOf(r);n>=0&&this._observers.splice(n,1)})}_interrupted=!1;unsafeInterrupt(){this._exit||(this._interrupted=!0,this.interruptible&&this.evaluate(Noe))}unsafePoll(){return this._exit}evaluate(r){if(this._exit)return;if(this._yielded!==void 0){let i=this._yielded;this._yielded=void 0,i()}let n=this.runLoop(r);if(n===ZS)return;let o=LGe.interruptChildren&&LGe.interruptChildren(this);if(o!==void 0)return this.evaluate(mb(o,()=>n));this._exit=n;for(let i=0;i<this._observers.length;i++)this._observers[i](n);this._observers.length=0}runLoop(r){let n=!1,o=r;this.currentOpCount=0;try{for(;;){if(this.currentOpCount++,!n&&this.getRef(t1).shouldYield(this)){n=!0;let i=o;o=mb(UGt,()=>i)}if(o=o[Moe](this),o===ZS){let i=this._yielded;return Z3 in i?(this._yielded=void 0,i):ZS}}}catch(i){return Ae(o,Moe)?oB(i):oB(`MicroFiber.runLoop: Not a valid effect: ${String(o)}`)}}getCont(r){for(;;){let n=this._stack.pop();if(!n)return;let o=n[eB]&&n[eB](this);if(o)return{[r]:o};if(n[r])return n}}_yielded=void 0;yieldWith(r){return this._yielded=r,ZS}children(){return this._children??=new Set}},LGe=rt("effect/Micro/fiberMiddleware",()=>({interruptChildren:void 0}));var $Gt=e=>TA(()=>{for(let o of e)o.unsafeInterrupt();let r=e[Symbol.iterator](),n=TA(()=>{let o=r.next();for(;!o.done;){if(o.value.unsafePoll()){o=r.next();continue}let i=o.value;return GGe(a=>{i.addObserver(c=>{a(n)})})}return e1});return n}),UGe=Symbol.for("effect/Micro/identifier"),tn=Symbol.for("effect/Micro/args"),Moe=Symbol.for("effect/Micro/evaluate"),Kg=Symbol.for("effect/Micro/successCont"),QS=Symbol.for("effect/Micro/failureCont"),eB=Symbol.for("effect/Micro/ensureCont"),ZS=Symbol.for("effect/Micro/Yield"),NGt={_A:Je,_E:Je,_R:Je},LGt={...aGe,_op:"Micro",[FGt]:NGt,pipe(){return _e(this,arguments)},[Symbol.iterator](){return new dx(new rf(this))},toJSON(){return{_id:"Micro",op:this[UGe],...tn in this?{args:this[tn]}:void 0}},toString(){return ir(this)},[ft](){return ir(this)}};function BGt(e){return oB("Micro.evaluate: Not implemented")}var sB=e=>({...LGt,[UGe]:e.op,[Moe]:e.eval??BGt,[Kg]:e.contA,[QS]:e.contE,[eB]:e.ensure}),Jg=e=>{let r=sB(e);return function(){let n=Object.create(r);return n[tn]=e.single===!1?arguments:arguments[0],n}},qGe=e=>{let r={...sB(e),[Z3]:Z3,_tag:e.op,get[e.prop](){return this[tn]},toJSON(){return{_id:"MicroExit",_tag:e.op,[e.prop]:this[tn]}},[Pe](n){return KGt(n)&&n._tag===e.op&&De(this[tn],n[tn])},[Fe](){return pt(this,Ke(or(e.op))(we(this[tn])))}};return function(n){let o=Object.create(r);return o[tn]=n,o[Kg]=void 0,o[QS]=void 0,o[eB]=void 0,o}},XS=qGe({op:"Success",prop:"value",eval(e){let r=e.getCont(Kg);return r?r[Kg](this[tn],e):e.yieldWith(this)}}),tB=qGe({op:"Failure",prop:"cause",eval(e){let r=e.getCont(QS);for(;jGe(this[tn])&&r&&e.interruptible;)r=e.getCont(QS);return r?r[QS](this[tn],e):e.yieldWith(this)}});var rB=Jg({op:"Sync",eval(e){let r=this[tn](),n=e.getCont(Kg);return n?n[Kg](r,e):e.yieldWith(cB(r))}}),TA=Jg({op:"Suspend",eval(e){return this[tn]()}}),jGt=Jg({op:"Yield",eval(e){let r=!1;return e.getRef(t1).scheduleTask(()=>{r||e.evaluate(e1)},this[tn]??0),e.yieldWith(()=>{r=!0})}}),UGt=jGt(0);var nB=XS(void 0);var aB=Jg({op:"WithMicroFiber",eval(e){return this[tn](e)}});var qGt=Jg({op:"Async",single:!1,eval(e){let r=this[tn][0],n=!1,o=!1,i=this[tn][1]?new Abor
`,e.forest),xze=(e,r)=>{let n="",o=r.length,i;for(let a=0;a<o;a++){i=r[a];let c=a===o-1;n+=e+(c?"\u2514":"\u251C")+"\u2500 "+i.value,n+=xze(e+(o>1&&!c?"\u2502 ":" "),i.forest)}return n},GVt=e=>{switch(e){case"Encoded":return"Encoded side transformation failure";case"Transformation":return"Transformation process failure";case"Type":return"Type side transformation failure"}},HVt=e=>{switch(e){case"From":return"From side refinement failure";case"Predicate":return"Predicate refinement failure"}},bze=e=>"ast"in e?Ce(e.ast):Se(),Dse=st(void 0),WVt=e=>bze(e).pipe(Cu(Vje),Ar({onNone:()=>Dse,onSome:r=>{let n=r(e);return mo(n)?st({message:n,override:!1}):pVe(n)?d1(n,o=>({message:o,override:!1})):mo(n.message)?st({message:n.message,override:n.override}):d1(n.message,o=>({message:o,override:n.override}))}})),$se=e=>r=>r._tag===e,vze=$se("Composite"),oze=$se("Refinement"),ize=$se("Transformation"),Xg=e=>Fc(WVt(e),r=>r!==void 0?!r.override&&(vze(e)||oze(e)&&e.kind==="From"||ize(e)&&e.kind!=="Transformation")?ize(e)||oze(e)?Xg(e.issue):Dse:st(r.message):Dse),Eze=e=>bze(e).pipe(Cu(Yje),b8e(r=>r(e)),_s);function VVt(e){return Pte(e).pipe(Du(()=>Cte(e)),Du(()=>Ate(e)),Du(()=>CC(e)),Mr(()=>`{ ${e.from} | filter }`))}function zVt(e){return e.message!==void 0?e.message:`Expected ${Sg(e.ast)?VVt(e.ast):String(e.ast)}, actual ${Na(e.actual)}`}var wze=e=>Bi(Xg(e),r=>r??Eze(e)??zVt(e)),LB=e=>Eze(e)??String(e.ast),Sze=e=>e.message??"is forbidden",_ze=e=>e.message??"is unexpected",Tze=e=>{let r=zje(e.ast);if(Zt(r)){let n=r.value();return mo(n)?st(n):n}return st(e.message??"is missing")},h1=e=>{switch(e._tag){case"Type":return Bi(wze(e),Xs);case"Forbidden":return st(Xs(LB(e),[Xs(Sze(e))]));case"Unexpected":return st(Xs(_ze(e)));case"Missing":return Bi(Tze(e),Xs);case"Transformation":return Fc(Xg(e),r=>r!==void 0?st(Xs(r)):Bi(h1(e.issue),n=>Xs(LB(e),[Xs(GVt(e.kind),[n])])));case"Refinement":return Fc(Xg(e),r=>r!==void 0?st(Xs(r)):Bi(h1(e.issue),n=>Xs(LB(e),[Xs(HVt(e.kind),[n])])));case"Pointer":return Bi(h1(e.issue),r=>Xs(JL(e.path),[r]));case"Composite":return Fc(Xg(e),r=>{if(r!==void 0)return st(Xs(r));let n=LB(e);return KL(e.issues)?Bi(f1(e.issues,h1),o=>Xs(n,o)):Bi(h1(e.issues),o=>Xs(n,[o]))})}},vb=(e,r,n)=>({_tag:e,path:r,message:n}),QA={formatIssue:e=>g1(e,void 0,[]),formatIssueSync:e=>{let r=QA.formatIssue(e);return Os(r)?ZX(r):nse(r)},formatError:e=>QA.formatIssue(e.issue),formatErrorSync:e=>QA.formatIssueSync(e.issue)},g1=(e,r,n)=>{let o=e._tag;switch(o){case"Type":return Bi(wze(e),i=>[vb(r??o,n,i)]);case"Forbidden":return st([vb(o,n,Sze(e))]);case"Unexpected":return st([vb(o,n,_ze(e))]);case"Missing":return Bi(Tze(e),i=>[vb(o,n,i)]);case"Pointer":return g1(e.issue,void 0,n.concat(e.path));case"Composite":return Fc(Xg(e),i=>i!==void 0?st([vb(o,n,i)]):KL(e.issues)?Bi(f1(e.issues,a=>g1(a,void 0,n)),lC):g1(e.issues,void 0,n));case"Refinement":return Fc(Xg(e),i=>i!==void 0?st([vb(o,n,i)]):g1(e.issue,e.kind==="Predicate"?o:void 0,n));case"Transformation":return Fc(Xg(e),i=>i!==void 0?st([vb(o,n,i)]):g1(e.issue,e.kind==="Transformation"?o:void 0,n))}};var Cze=sse,UB=vVe,nP=EVe;var Aze=e=>Ln((r,n)=>e(nP(r),nP(n)));var Ib={};Ja(Ib,{Any:()=>Use,Array:()=>nn,ArrayEnsure:()=>xzt,ArrayFormatterIssue:()=>lce,BetweenBigDecimalSchemaId:()=>rce,BetweenBigIntSchemaId:()=>vae,BetweenDateSchemaId:()=>Mae,BetweenDurationSchemaId:()=>Cae,BetweenSchemaId:()=>QKe,BigDecimal:()=>Yae,BigDecimalFromNumber:()=>Zae,BigDecimalFromSelf:()=>Sm,BigInt:()=>n0,BigIntFromNumber:()=>Eae,BigIntFromSelf:()=>vm,Boolean:()=>Ab,BooleanFromString:()=>ace,BooleanFromUnknown:()=>sce,BrandSchemaId:()=>Lse,Capitalize:()=>eae,Capitalized:()=>YB,CapitalizedSchemaId:()=>MKe,Cause:()=>WJt,CauseFromSelf:()=>l8,Char:()=>Zse,Chunk:()=>TJt,ChunkFromSelf:()=>UJe,Class:()=>RJt,Config:()=>fYt,Data:()=>FJt,DataFromSelf:()=>GJe,Date:()=>Nae,DateFromNumber:()=>Lae,DateFromSelf:()=>Pb,DateFromSelfSchemaId:()=>kae,DateFromString:()=>n8,DateTimeUtc:()=>Uae,DateTimeUtcFromDate:()=>jae,DateTimeUtcFromNumber:()=>Bae,DateTimeUtcFromSelf:()=>_1,DateTimeZoned:()=>Wae,DateTimeZonedFromSelf:()=>i8,Defect:(
`)}formatLines(){let r=[];this.#t.level>=this.#t.printHeadersFromLevel&&r.push(this.#r(this.#e.header()));for(let n of this.#e.entries()){let o=new e(n,{...this.#t,level:this.#t.level+1});r.push(...o.formatLines())}return r}#r(r){return`${" ".repeat(this.#t.indentSize*this.#t.level)}${r}`}};var w8=class{#e;#t;constructor(r){this.#e=r,this.#t=new E8(r)}write(r,n,o){let i=tYe.default.resolve(this.#e,r);eYe.default.writeFileSync(i,n,o),this.#t.add(i)}format(r){return this.#t.format(r)}};function rYe(e){return`${me("Success!")} ${e}`}function jce({databaseUrl:e,workspaceId:r,projectId:n,environmentId:o,isExistingPrismaProject:i=!1}){let a=`
We created an initial ${me("schema.prisma")} file and a ${me(".env")} file with your ${me("DATABASE_URL")} environment variable already set.
${q("--- Next steps ---")}
Go to ${Pt("https://pris.ly/ppg-init")} for detailed instructions.
${q("1. Define your database schema")}
Open the ${me("schema.prisma")} file and define your first models. Check the docs if you need inspiration: ${Pt("https://pris.ly/ppg-init")}.
${q("2. Apply migrations")}
Run the following command to create and apply a migration:
${me("npx prisma migrate dev --name init")}
${q("3. Manage your data")}
View and edit your data locally by running this command:
${me("npx prisma studio")}
${o!==void 0?`...or online in Console:
${Pt(`https://console.prisma.io/${r}/${n}/${o}/studio`)}
`:""}
${q("4. Send queries from your app")}
To access your database from a JavaScript/TypeScript app, you need to use Prisma ORM. Go here for step-by-step instructions: ${Pt("https://pris.ly/ppg-init")}
`,c=`
We found an existing ${me("schema.prisma")} file in your current project directory.
${q("--- Database URL ---")}
Connect Prisma ORM to your Prisma Postgres database with this URL:
${me(e)}
${q("--- Next steps ---")}
Go to ${Pt("https://pris.ly/ppg-init")} for detailed instructions.
${q("1. Install the Postgres adapter")}
${me("npm install @prisma/adapter-pg")}
...and add it to your Prisma Client instance:
${me('import { PrismaPg } from "@prisma/adapter-pg";')}
${me('import { PrismaClient } from "./generated/prisma/client";')}
${me("const connectionString = `${process.env.DATABASE_URL}`;")}
${me("const adapter = new PrismaPg({ connectionString });")}
${me("const prisma = new PrismaClient({ adapter });")}
${q("2. Apply migrations")}
Run the following command to create and apply a migration:
${me("npx prisma migrate dev")}
${q("3. Manage your data")}
View and edit your data locally by running this command:
${me("npx prisma studio")}
${o!==void 0?`...or online in Console:
${Pt(`https://console.prisma.io/${r}/${n}/${o}/studio`)}
`:""}
${q("4. Send queries from your app")}
If you already have an existing app with Prisma ORM, you can now run it and it will send queries against your newly created Prisma Postgres instance.
${q("5. Learn more")}
For more info, visit the Prisma Postgres docs: ${Pt("https://pris.ly/ppg-docs")}
`;return i?c:a}var BYe=W(require("node:events")),jYe=W(require("node:http"));var PYt=/\{[^{}]+\}/g,OYt=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function FYt(){return Math.random().toString(36).slice(2,11)}function sYe(e){let{baseUrl:r="",Request:n=globalThis.Request,fetch:o=globalThis.fetch,querySerializer:i,bodySerializer:a,headers:c,requestInitExt:u=void 0,...l}={...e};u=OYt()?u:void 0,r=iYe(r);let p=[];async function f(g,x){let{baseUrl:b,fetch:v=o,Request:S=n,headers:_,params:D={},parseAs:P="json",querySerializer:C,bodySerializer:O=a??RYt,body:I,...k}=x||{},j=r;b&&(j=iYe(b)??r);let G=typeof i=="function"?i:nYe(i);C&&(G=typeof C=="function"?C:nYe({...typeof i=="object"?i:{},...C}));let B=I===void 0?void 0:O(I,oYe(c,_,D.header)),H=oYe(B===void 0||B instanceof FormData?{}:{"Content-Type":"application/json"},c,_,D.header),N={redirect:"follow",...l,...k,body:B,headers:H},Y,z,X=new n(MYt(g,{baseUrl:j,params:D,querySerializer:G}),N),U;for(let oe in k)oe in X||(X[oe]=k[oe]);if(p.length){Y=FYt(),z=Object.freeze({baseUrl:j,fetch:v,parseAs:P,querySerializer:G,bodySerializer:O});for(let oe of p)if(oe&&typeof oe=="object"&&typeof oe.onRequest=="function"){let se=await oe.onRequest({request:X,schemaPath:g,params:D,options:z,id:Y});if(se)if(se instanceof n)X=se;else if(se instanceof Response){U=se;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!U){try{U=await v(X,u)}catch(oe){let se=oe;if(p.length)for(let le=p.length-1;le>=0;le--){let be=p[le];if(be&&typeof be=="object"&&typeof be.onError=="function"){let He=await be.onError({request:X,error:se,schemaPath:g,params:D,options:z,id:Y});if(He){if(He instanceof Response){se=void 0,U=He;break}if(He instanceof Error){se=He;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(se)throw se}if(p.length)for(let oe=p.length-1;oe>=0;oe--){let se=p[oe];if(se&&typeof se=="object"&&typeof se.onResponse=="function"){let le=await se.onResponse({request:X,response:U,schemaPath:g,params:D,options:z,id:Y});if(le){if(!(le instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");U=le}}}}if(U.status===204||X.method==="HEAD"||U.headers.get("Content-Length")==="0")return U.ok?{data:void 0,response:U}:{error:void 0,response:U};if(U.ok)return P==="stream"?{data:U.body,response:U}:{data:await U[P](),response:U};let Z=await U.text();try{Z=JSON.parse(Z)}catch{}return{error:Z,response:U}}return{request(g,x,b){return f(x,{...b,method:g.toUpperCase()})},GET(g,x){return f(g,{...x,method:"GET"})},PUT(g,x){return f(g,{...x,method:"PUT"})},POST(g,x){return f(g,{...x,method:"POST"})},DELETE(g,x){return f(g,{...x,method:"DELETE"})},OPTIONS(g,x){return f(g,{...x,method:"OPTIONS"})},HEAD(g,x){return f(g,{...x,method:"HEAD"})},PATCH(g,x){return f(g,{...x,method:"PATCH"})},TRACE(g,x){return f(g,{...x,method:"TRACE"})},use(...g){for(let x of g)if(x){if(typeof x!="object"||!("onRequest"in x||"onResponse"in x||"onError"in x))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");p.push(x)}},eject(...g){for(let x of g){let b=p.indexOf(x);b!==-1&&p.splice(b,1)}}}}function S8(e,r,n){if(r==null)return"";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?r:encodeURIComponent(r)}`}function aYe(e,r,n){if(!r||typeof r!="object")return"";let o=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(let u in r)o.push(u,n.allowReserved===!0?r[u]:encodeURIComponent(r[u]));let c=o.join(",");switch(n.style){case"form":return`${e}=${c}`;case"label":return`.${c}`;case"matrix":return`;${e}=${c}`;default:return c}}for(let c in r){let u=n.style==="deepObject"?`${e}[${c}]`:c;o.push(S8(u,r[c],n))}let a=o.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function cYe(e,r,n){if(!Array.isArray
<html>
<head>
<title>Login</title>
</head>
<body>
<p>Success!</p>
<p>You may now close this page.</p>
</body>
</html>
`),setImmediate(()=>{r.close()}),a()})});await o.login(),await i}var Zce=class{constructor(r,n,o){this.hostname=r;this.port=n;this.utmMedium=o;this.tokenStorage=new o0,this.managementAPI=_8({clientId:CZt,redirectUri:`http://${r}:${n}/auth/callback`,tokenStorage:this.tokenStorage})}latestVerifier;latestState;managementAPI;tokenStorage;async login(){let{url:r,state:n,verifier:o}=await this.managementAPI.getLoginUrl({scope:"workspace:admin offline_access",additionalParams:{utm_source:"cli",utm_medium:this.utmMedium,utm_campaign:DZt.version}});this.latestState=n,this.latestVerifier=o,await(0,UYe.default)(r)}async handleCallback(r){if(r.pathname!=="/auth/callback")throw new i0("Not a callback");let n=r.searchParams,o=n.get("error");if(o){let i=n.get("error_description");throw new i0(i?`${o}: ${i}`:o)}if(!this.latestVerifier)throw new i0("No verifier found");if(!this.latestState)throw new i0("No state found");try{await this.managementAPI.handleCallback({callbackUrl:r,verifier:this.latestVerifier,expectedState:this.latestState})}catch(i){throw i instanceof Uu?new i0(i.message):new i0(i instanceof Error?i.message:"Unknown error during login")}}get host(){return`${this.hostname}:${this.port}`}};var AZt="cmi4ttoor03pv2wco4526rnin";function GYe(){let e=new o0;return _8({clientId:AZt,redirectUri:"http://localhost:0/auth/callback",tokenStorage:e})}var HYe=W(require("node:fs")),O1=W(require("node:path"));function WYe(e){let r=PZt(),n=O1.default.join(r,"generated","prisma");return O1.default.relative(e,n).replaceAll(O1.default.sep,"/")}function PZt(){let e=process.cwd(),r=OZt();if(r)return O1.default.join(e,r);for(let n of["src","lib","app"]){let o=O1.default.join(e,n);if(HYe.default.existsSync(o))return o}return e}function OZt(){let e=sN();if(!e)return;let{config:r}=e;return r.compilerOptions?.rootDir??r.compilerOptions?.baseUrl??r.compilerOptions?.rootDirs?.[0]}function Dm(e){return q(E9(" ERROR "))+" "+he(e)}var VYe=!!globalThis.Bun||!!globalThis.process?.versions?.bun,FZt=e=>{let{datasourceProvider:r="postgresql",generatorProvider:n=kZt,previewFeatures:o=$Zt,output:i="../generated/prisma",withModel:a=!1}=e??{},c=`// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Get a free hosted Postgres database in seconds: \`npx create-db\`
generator client {
provider = "${n}"
${o.length>0?` previewFeatures = [${o.map(u=>`"${u}"`).join(", ")}]
`:""} output = "${i}"
}
datasource db {
provider = "${r}"
}
`;if(a){let u=`email String @unique
name String?`;switch(r){case"mongodb":c+=`
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
${u}
}
`;break;case"cockroachdb":c+=`
model User {
id BigInt @id @default(sequence())
${u}
}
`;break;default:c+=`
model User {
id Int @id @default(autoincrement())
${u}
}
`}}return c},zYe=async(e,r=!1,n=!0)=>{if(e===void 0){let i=!1,a=await Xce.ServerState.fromServerDump({debug:r})||(i=!0,await Xce.ServerState.createExclusively({debug:r,persistenceMode:"stateful"}));i&&await a.close(),e=(await(0,KYe.startPrismaDevServer)({databasePort:a.databasePort,dryRun:!0,name:a.name,persistenceMode:"stateful",port:a.port,shadowDatabasePort:a.shadowDatabasePort,debug:r})).ppg.url}let o=n?`# Environment variables declared in this file are NOT automatically loaded by Prisma.
# Please add \`import "dotenv/config";\` to your \`prisma.config.ts\` file, or use the Prisma CLI with Bun
# to load environment variables from .env files: https://pris.ly/prisma-config-env-vars.
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
${e.startsWith("prisma+postgres:")&&e.includes("localhost")?"# The following `prisma+postgres` URL is similar to the URL produced by running a local Prisma Postgres\n# server with the `prisma dev` CLI command, when not choosing any non-default ports or settings. The API key, unlike the\n# one found in a remote Prisma Postgres URL, does not contain any sensitive information.\n\n":""}`:"";return o+=`DATABASE_URL="${e}"`,o},IZt=e=>{switch(e){case"mysql":return 3306;case"sqlserver":return 1433;case"mongodb":return 27017;case"postgresql":return 5432;case"cockroachdb":return 26257;case yy:return null}},RZt=(e,r=IZt(e),n="public")=>{switch(e){case"postgresql":return`postgresql://johndoe:randompassword@localhost:${r}/mydb?schema=${n}`;case"cockroachdb":return`postgresql://johndoe:randompassword@localhost:${r}/mydb?schema=${n}`;case"mysql":return`mysql://johndoe:randompassword@localhost:${r}/mydb`;case"sqlserver":return`sqlserver://localhost:${r};database=mydb;user=SA;password=randompassword;`;case"mongodb":return"mongodb+srv://root:randompassword@cluster0.ab1cd.mongodb.net/mydb?retryWrites=true&w=majority";case"sqlite":return"file:./dev.db";default:return}},MZt=()=>`node_modules
# Keep environment variables out of version control
.env
`,kZt="prisma-client",$Zt=[];function O8(e){return JSON.stringify(e.replaceAll(Ei.default.sep,"/"))}var NZt=({prismaFolder:e,runtime:r})=>{let n=Ei.default.relative(process.cwd(),Ei.default.join(e,"schema.prisma")),o=Ei.default.relative(process.cwd(),Ei.default.join(e,"migrations"));return cr({runtime:r}).with({runtime:"bun"},()=>`// This file was generated by Prisma, and assumes you run Prisma commands using \`bun --bun run prisma [command]\`.
import { defineConfig, env } from "prisma/config";
export default defineConfig({
schema: ${O8(n)},
migrations: {
path: ${O8(o)},
},
datasource: {
url: env("DATABASE_URL"),
},
});
`).otherwise(()=>`// This file was generated by Prisma, and assumes you have installed the following:
// npm install --save-dev prisma dotenv
import "dotenv/config";
import { defineConfig } from "prisma/config";
export default defineConfig({
schema: ${O8(n)},
migrations: {
path: ${O8(o)},
},
datasource: {
url: process.env["DATABASE_URL"],
},
});
`)},F8=class e{static new(){return new e}static help=ut(`
Set up a new Prisma project
${q("Usage")}
${ae("$")} prisma init [options]
${q("Options")}
-h, --help Display this help message
--db Provisions a fully managed Prisma Postgres database on the Prisma Data Platform.
--datasource-provider Define the datasource provider to use: postgresql, mysql, sqlite, sqlserver, mongodb or cockroachdb
--generator-provider Define the generator provider to use. Default: \`prisma-client\`
--preview-feature Define a preview feature to use.
--output Define Prisma Client generator output path to use.
--url Define a custom datasource url
${q("Flags")}
--with-model Add example model to created schema file
${q("Examples")}
Set up a new \`prisma dev\`-ready (local Prisma Postgres) Prisma project
${ae("$")} prisma init
Set up a new Prisma project and specify MySQL as the datasource provider to use
${ae("$")} prisma init --datasource-provider mysql
Set up a new \`prisma dev\`-ready (local Prisma Postgres) Prisma project and specify \`prisma-client\` as the generator provider to use
${ae("$")} prisma init --generator-provider prisma-client
Set up a new \`prisma dev\`-ready (local Prisma Postgres) Prisma project and specify \`x\` and \`y\` as the preview features to use
${ae("$")} prisma init --preview-feature x --preview-feature y
Set up a new \`prisma dev\`-ready (local Prisma Postgres) Prisma project and specify \`./generated-client\` as the output path to use
${ae("$")} prisma init --output ./generated-client
Set up a new Prisma project and specify the url that will be used
${ae("$")} prisma init --url mysql://user:password@localhost:3306/mydb
Set up a new \`prisma dev\`-ready (local Prisma Postgres) Prisma project with an example model
${ae("$")} prisma init --with-model
`);async parse(r,n){let o=bt(r,{"--help":Boolean,"-h":"--help","--url":String,"--datasource-provider":String,"--generator-provider":String,"--preview-feature":[String],"--output":String,"--with-model":Boolean,"--db":Boolean,"--region":String,"--name":String,"--non-interactive":Boolean,"--prompt":String,"--vibe":String,"--debug":Boolean});if(Ht(o)||o["--help"])return this.help();let i=o["--url"];if(i&&ii({cmd:"init",validatedConfig:{datasource:{url:i}}}),o._[0])throw Error("The init command does not take any argument.");let{datasourceProvider:c,url:u}=await cr(o).with({"--datasource-provider":Qa.when(U=>!!U)},U=>{let Z=U["--datasource-provider"].toLowerCase();LZt(Z);let oe=RZt(Z);return{datasourceProvider:Z,url:oe}}).with({"--url":Qa.when(U=>!!U)},async U=>{let Z=U["--url"],oe=await Ey(Z);if(oe!==!0){let{code:le,message:be}=oe;if(le!=="P1003")throw le?new Error(`${le}: ${be}`):new Error(be)}return{datasourceProvider:ZM(`${Z.split(":")[0]}:`),url:Z}}).otherwise(()=>({datasourceProvider:"postgresql",url:void 0})),l=o["--generator-provider"],p=o["--preview-feature"],f=o["--output"],g=o["--db"]||c===yy||o["--prompt"]||o["--vibe"];o["--debug"]&&console.log("[isBun]",VYe);let x,b,v,S,_=process.cwd(),D=Ei.default.join(_,"prisma"),P=new w8(_),C,O;if(g){if(!await new o0().getTokens()){if(o["--non-interactive"])return"Please authenticate before creating a Prisma Postgres project.";if(console.log("This will create a project for you on console.prisma.io and requires you to be authenticated."),!await DX({message:"Would you like to authenticate?"}))return"Project creation aborted. You need to authenticate to use Prisma Postgres";await qYe({utmMedium:"command-init-db"})}if(o["--prompt"]||o["--vibe"]){let nt=o["--prompt"]||o["--vibe"]||"",Ie=ME(`Generating a Prisma Schema based on your description ${q(nt)} ...`).start();try{let dt=Ib.Struct({generatedSchema:Ib.String,generatedName:Ib.String});({generatedSchema:C,generatedName:O}=Ib.decodeUnknownSync(dt)(await(await fetch("https://prisma-generate-server.prisma.workers.dev/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:nt})})).json()))}catch(dt){throw Ie.fail(),dt}Ie.succeed("Schema is ready")}console.log("Let's set up your Prisma Postgres database!");let se=GYe().client,{data:le,error:be}=await se.GET("/v1/regions/postgres");if(be){let nt=be.error?.message;throw new Error(typeof nt=="string"?nt:"Failed to fetch regions")}if(!le)throw new Error("No regions data returned");let He=le.data,Bt=o["--region"]||await IX({message:"Select your region:",default:"us-east-1",choices:He.map(nt=>({name:`${nt.id} - ${nt.name}`,value:nt.id,disabled:nt.status!=="available"})),loop:!0}),Vt=o["--name"]||await CX({message:"Enter a project name:",default:O||"My Prisma Project"}),At=ME(`Creating project ${q(Vt)} (this may take a few seconds)...`).start();try{let{data:nt,error:Ie}=await se.POST("/v1/projects",{body:{createDatabase:!0,name:Vt,region:Bt}});if(Ie){let Ue=Ie.error?.message;throw new Error(typeof Ue=="string"?Ue:"Failed to create project")}if(!nt)throw new Error("No project data returned");let dt=nt.data;if(!dt.database)throw new Error("Missing database info in response");let No=dt.database.connections?.find(Ue=>!!Ue.endpoints?.direct?.connectionString||!!Ue.endpoints?.pooled?.connectionString),Te=No?.endpoints?.direct?.connectionString??No?.endpoints?.pooled?.connectionString;if(!Te)throw new Error("Missing connection string in response");x=Te,b=dt.workspace.id.replace(/^wksp_/,""),v=dt.id.replace(/^proj_/,""),S=dt.database.id.replace(/^db_/,""),At.succeed(rYe("Your Prisma Postgres database is ready \u2705"))}catch(nt){throw At.fail(nt instanceof Error?nt.message:"Something went wrong"),nt}}if((ea.default.existsSync(Ei.default.join(_,"schema.prisma"))||ea.default.existsSync(D)||ea.default.existsSync(Ei.default.join(D,"schema.prisma")))&&g)return jce({databaseUrl:x,workspaceId:b,projectId:v,environmentId:S,isExistingPrismaProject:!0});ea.default.existsSync(Ei.default.join(_,"schema.prisma"))&&(console.log(Dm(`File ${q("schema.prisma")} already exists
Please try again in a project that is not yet using Prisma.
`)),process.exit(1)),ea.default.existsSync(D)&&(console.log(Dm(`A folder called ${q("prisma")} already exists in your project.
Please try again in a project that is not yet using Prisma.
`)),process.exit(1)),ea.default.existsSync(Ei.default.join(D,"schema.prisma"))&&(console.log(Dm(`File ${q("prisma/schema.prisma")} already exists in your project.
Please try again in a project that is not yet using Prisma.
`)),process.exit(1)),ea.default.existsSync(_)||ea.default.mkdirSync(_),ea.default.existsSync(D)||ea.default.mkdirSync(D);let I=f??WYe(D);P.write(Ei.default.join(D,"schema.prisma"),C||FZt({datasourceProvider:c,generatorProvider:l,previewFeatures:p,output:I,withModel:o["--with-model"]}));let k=x||u,j=[];P.write(Ei.default.join(_,"prisma.config.ts"),NZt({prismaFolder:D,runtime:VYe?"bun":"other"}));let G=Ei.default.join(_,".env");if(!ea.default.existsSync(G))P.write(G,await zYe(k,o["--debug"]));else{let U=ea.default.readFileSync(G,{encoding:"utf8"}),Z=JYe.default.parse(U);Object.keys(Z).includes("DATABASE_URL")?j.push(`${Gt("warn")} Prisma would have added DATABASE_URL but it already exists in ${q(Ei.default.relative(_,G))}.`):ea.default.appendFileSync(G,`
# This was inserted by \`prisma init\`:
`+await zYe(k,o["--debug"]))}let B=Ei.default.join(_,".gitignore");try{P.write(B,MZt(),{flag:"wx"})}catch(U){U.code==="EEXIST"?j.push(`${Gt("warn")} You already have a ${q(".gitignore")} file. Don't forget to add ${q(".env")} in it to not commit any private information.`):console.error("Failed to write .gitignore file, reason: ",U)}let H=Ei.default.relative(_,Ei.default.resolve(D,I));try{ea.default.appendFileSync(B,`
/${H.replaceAll(Ei.default.sep,"/")}
`)}catch(U){console.error("Failed to append client path to .gitignore file, reason: ",U)}let N=` 1. Configure your DATABASE_URL in ${me("prisma.config.ts")}
2. Run ${me(Xt("prisma db pull"))} to introspect your database.`,Y=["postgres","postgresql","prisma+postgres"],z;Y.includes(c)?z=`Next, choose how you want to set up your database:
CONNECT EXISTING DATABASE:
${N}
CREATE NEW DATABASE:
Local: ${me("npx prisma dev")} (runs Postgres locally in your terminal)
Cloud: ${me("npx create-db")} (creates a free Prisma Postgres database)`:z=`Next, set up your database:
${N}`;let X=`
Initialized Prisma in your project
${P.format({level:0,printHeadersFromLevel:1,indentSize:2})}
${j.length>0&&il.should.warn()?`
${j.join(`
`)}
`:""}
${z}
Then, define your models in ${me("prisma/schema.prisma")} and run ${me(Xt("prisma migrate dev"))} to apply your schema.
Learn more: ${Pt("https://pris.ly/getting-started")}
`;return g?jce({databaseUrl:x,workspaceId:b,projectId:v,environmentId:S}):X}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}},Qce=["postgresql","mysql","sqlite","sqlserver","mongodb","cockroachdb","prismapostgres","prisma+postgres"];function LZt(e){if(typeof e!="string"||!Qce.includes(e))throw new Error(`Provider "${e}" is invalid or not supported. Try again with ${Qce.slice(0,-1).map(r=>`"${r}"`).join(", ")} or "${Qce.at(-1)}".`)}var _r;(function(e){e.assertEqual=i=>i;function r(i){}e.assertIs=r;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{let a={};for(let c of i)a[c]=c;return a},e.getValidEnumValues=i=>{let a=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),c={};for(let u of a)c[u]=i[u];return e.objectValues(c)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&a.push(c);return a},e.find=(i,a)=>{for(let c of i)if(a(c))return c},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,a=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}e.joinValues=o,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(_r||(_r={}));var tue;(function(e){e.mergeShapes=(r,n)=>({...r,...n})})(tue||(tue={}));var je=_r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Am=e=>{switch(typeof e){case"undefined":return je.undefined;case"string":return je.string;case"number":return isNaN(e)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(e)?je.array:e===null?je.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?je.promise:typeof Map<"u"&&e instanceof Map?je.map:typeof Set<"u"&&e instanceof Set?je.set:typeof Date<"u"&&e instanceof Date?je.date:je.object;default:return je.unknown}},ve=_r.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),BZt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Ic=class e extends Error{get errors(){return this.issues}constructor(r){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=r}format(r){let n=r||function(a){return a.message},o={_errors:[]},i=a=>{for(let c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let u=o,l=0;for(;l<c.path.length;){let p=c.path[l];l===c.path.length-1?(u[p]=u[p]||{_errors:[]},u[p]._errors.push(n(c))):u[p]=u[p]||{_errors:[]},u=u[p],l++}}};return i(this),o}static assert(r){if(!(r instanceof e))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_r.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=n=>n.message){let n={},o=[];for(let i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(r(i))):o.push(r(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};Ic.create=e=>new Ic(e);var R1=(e,r)=>{let n;switch(e.code){case ve.invalid_type:e.received===je.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ve.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,_r.jsonStringifyReplacer)}`;break;case ve.unrecognized_keys:n=`Unrecognized key(s) in object: ${_r.joinValues(e.keys,", ")}`;break;case ve.invalid_unio
]))`;continue}else if(o[l]==="$"){i+=`($|(?=[\r
]))`;continue}}if(n.s&&o[l]==="."){i+=c?`${o[l]}\r
`:`[${o[l]}\r
]`;continue}i+=o[l],o[l]==="\\"?a=!0:c&&o[l]==="]"?c=!1:!c&&o[l]==="["&&(c=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${r.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function w5(e,r){if(r.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),r.target==="openApi3"&&e.keyType?._def.typeName===Ee.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((o,i)=>({...o,[i]:Dt(e.valueType._def,{...r,currentPath:[...r.currentPath,"properties",i]})??{}}),{}),additionalProperties:r.rejectedAdditionalProperties};let n={type:"object",additionalProperties:Dt(e.valueType._def,{...r,currentPath:[...r.currentPath,"additionalProperties"]})??r.allowedAdditionalProperties};if(r.target==="openApi3")return n;if(e.keyType?._def.typeName===Ee.ZodString&&e.keyType._def.checks?.length){let{type:o,...i}=E5(e.keyType._def,r);return{...n,propertyNames:i}}else{if(e.keyType?._def.typeName===Ee.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===Ee.ZodBranded&&e.keyType._def.type._def.typeName===Ee.ZodString&&e.keyType._def.type._def.checks?.length){let{type:o,...i}=v5(e.keyType._def,r);return{...n,propertyNames:i}}}return n}function VXe(e,r){if(r.mapStrategy==="record")return w5(e,r);let n=Dt(e.keyType._def,{...r,currentPath:[...r.currentPath,"items","items","0"]})||{},o=Dt(e.valueType._def,{...r,currentPath:[...r.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,o],minItems:2,maxItems:2}}}function zXe(e){let r=e.values,o=Object.keys(e.values).filter(a=>typeof r[r[a]]!="number").map(a=>r[a]),i=Array.from(new Set(o.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:o}}function KXe(){return{not:{}}}function JXe(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var $P={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function ZXe(e,r){if(r.target==="openApi3")return YXe(e,r);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(o=>o._def.typeName in $P&&(!o._def.checks||!o._def.checks.length))){let o=n.reduce((i,a)=>{let c=$P[a._def.typeName];return c&&!i.includes(c)?[...i,c]:i},[]);return{type:o.length>1?o:o[0]}}else if(n.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=n.reduce((i,a)=>{let c=typeof a._def.value;switch(c){case"string":case"number":case"boolean":return[...i,c];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(o.length===n.length){let i=o.filter((a,c,u)=>u.indexOf(a)===c);return{type:i.length>1?i:i[0],enum:n.reduce((a,c)=>a.includes(c._def.value)?a:[...a,c._def.value],[])}}}else if(n.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((o,i)=>[...o,...i._def.values.filter(a=>!o.includes(a))],[])};return YXe(e,r)}var YXe=(e,r)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((o,i)=>Dt(o._def,{...r,currentPath:[...r.currentPath,"anyOf",`${i}`]})).filter(o=>!!o&&(!r.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return n.length?{anyOf:n}:void 0};function QXe(e,r){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return r.target==="openApi3"?{type:$P[e.innerType._def.typeName],nullable:!0}:{type:[$P[e.innerType._def.typeName],"null"]};if(r.target==="openApi3"){let o=Dt(e.innerType._def,{...r,currentPath:[...r.currentPath]});return o&&"$ref"in o?{allOf:[o],nullable:!0}:o&&{...o,nullable:!0}}let n=Dt(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function XXe(e,r){let n={type:"number"};if(!e.checks)return n;for(let o of e.checks)
`);if(r===-1)return null;let n=this._buffer.toString("utf8",0,r).replace(/\r$/,"");return this._buffer=this._buffer.subarray(r+1),Atr(n)}clear(){this._buffer=void 0}};function Atr(e){return bZe.parse(JSON.parse(e))}function det(e){return JSON.stringify(e)+`
`}var C5=class{constructor(r=Hue.default.stdin,n=Hue.default.stdout){this._stdin=r,this._stdout=n,this._readBuffer=new D5,this._started=!1,this._ondata=o=>{this._readBuffer.append(o),this.processReadBuffer()},this._onerror=o=>{var i;(i=this.onerror)===null||i===void 0||i.call(this,o)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var r,n;;)try{let o=this._readBuffer.readMessage();if(o===null)break;(r=this.onmessage)===null||r===void 0||r.call(this,o)}catch(o){(n=this.onerror)===null||n===void 0||n.call(this,o)}}async close(){var r;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),(r=this.onclose)===null||r===void 0||r.call(this)}send(r){return new Promise(n=>{let o=det(r);this._stdout.write(o)?n():this._stdout.once("drain",n)})}};var att=W(ele());var ctt=W(jh());function stt(e){let{usageLine:r,subcommands:n,options:o,examples:i,additionalContent:a}=e,c=ut(`
${q("Usage")}
${ae("$")} ${r}
`),u=n&&ut(`
${q("Commands")}
${n.map(([x,b])=>`${x.padStart(15)} ${b}`).join(`
`)}
`),l=o&&ut(`
${q("Options")}
${o.map(([x,b,v])=>` ${x.padStart(15)} ${b?b+",":""} ${v}`).join(`
`)}
`),p=i&&ut(`
${q("Examples")}
${i.map(x=>` ${ae("$")} ${x}`).join(`
`)}
`),f=a&&ut(`
${a.map(x=>`${x}`).join(`
`)}
`),g=[c,u,l,p,f].filter(Boolean).join("");return x=>x?new We(`
${q(he("!"))} ${x}
${g}`):g}process.argv.includes("mcp")&&(console.log=console.error.bind(console));async function j5({args:e,cwd:r}){try{let{stdout:n,stderr:o}=await att.default.node(process.argv[1],e,{cwd:r}),i=[n,o].filter(Boolean).join(`
`);return{content:[{type:"text",text:String(i||"No output")}]}}catch(n){return{content:[{type:"text",text:String(n?.message||"Unknown error")}]}}}var U5=class e{static new(){return new e}constructor(){}help=stt({usageLine:"prisma mcp [options]",options:[["--early-access","","Enable early access features"]],examples:["prisma mcp --early-access"],additionalContent:["Starts an MCP server to use with AI development tools such as Cursor, Windsurf and Claude Desktop",`For additional help visit ${Pt("https://pris.ly/cli/mcp")}`]});async parse(r,n){let o=new T5({name:"Prisma",version:ctt.version});o.tool("migrate-status",`The prisma migrate status command looks up the migrations in ./prisma/migrations/* folder and the entries in the _prisma_migrations table and compiles information about the state of the migrations in your database.
Example output:
Status
3 migrations found in prisma/migrations
Your local migration history and the migrations table from your database are different:
The last common migration is: 20201127134938_new_migration
The migration have not yet been applied:
20201208100950_test_migration
The migrations from the database are not found locally in prisma/migrations:
20201208100950_new_migration`,{projectCWD:M.string()},async({projectCWD:a})=>await j5({cwd:a,args:["migrate","status"]})),o.tool("migrate-dev",`Prisma Migrate Dev is used to update Prisma whenever the schema.prisma file has been modified. Always provide a descriptive name argument describing the change that was made to the Prisma Schema.
The migrate dev command performs these steps:
1. Reruns the existing migration history in the shadow database in order to detect schema drift (edited or deleted migration file, or a manual changes to the database schema)
2. Applies pending migrations to the shadow database (for example, new migrations created by colleagues)
3. Generates a new migration from any changes you made to the Prisma schema before running migrate dev
4. Applies all unapplied migrations to the development database and updates the _prisma_migrations table
5. Triggers the generation of artifacts (for example, Prisma Client)`,{name:M.string(),projectCWD:M.string()},async({name:a,projectCWD:c})=>await j5({cwd:c,args:["migrate","dev","--name",a]})),o.tool("migrate-reset",`Prisma Migrate Reset --force is used to reset the database and migration history if drift is detected. Only run this command on a development database - never on production databases! If in doubt, ask the user to confirm.
The migrate reset command performs these steps:
1. Drops the database/schema if possible, or performs a soft reset if the environment does not allow deleting databases/schemas
2. Creates a new database/schema with the same name if the database/schema was dropped
3. Applies all migrations
4. Runs seed scripts`,{projectCWD:M.string()},async({projectCWD:a})=>await j5({cwd:a,args:["migrate","reset","--force"]})),o.tool("Prisma-Studio",`Open Prisma Studio to view data in your database in a pleasing visual ui.
Provide the current working directory of the users project. This should be the top level directory of the project.`,{projectCWD:M.string()},async({projectCWD:a})=>await j5({cwd:a,args:["studio"]}));let i=new C5;return await o.connect(i),""}};var q5={};Ja(q5,{$:()=>tle});var utt=async(e,r,n,o)=>{let i=r[0];if(!i)return new We("Unknown command.");let a=e[i];return a?a.parse(r.slice(1),n,o):new We(`Unknown command or parameter "${i}"`)};function ltt({subcommands:e,examples:r}){let n=Math.max(...e.map(([a])=>a.length)),o=e.map(([a,c])=>` ${a.padEnd(n)} ${c}`).join(`
`),i=r.map(a=>` ${ae("$")} ${a}`).join(`
`);return ut(`
Prisma Data Platform commands
${q("Usage")}
${ae("$")} prisma platform [command]
${q("Commands")}
${o}
${q("Flags")}
-h, --help Display this help message
${q("Examples")}
${i}
`)}var tle=class e{constructor(r){this.cmds=r}static new(r){return new e(r)}async parse(r,n,o=process.cwd()){let i=bt(r,{"--help":Boolean,"-h":"--help","--telemetry-information":String});if(Ht(i))return this.help(i.message);if(i._.length===0||i["--help"])return this.help();let a=await utt(this.cmds,i._,n,o);return a instanceof Error?this.help(a.message):a}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}static help=ltt({subcommands:[["status","Show Prisma Data Platform service status"]],examples:["prisma platform status"]})};var qP="https://www.prisma-status.com",Jrr=`${qP}/api/v2/summary.json`,Yrr=M.object({indicator:M.enum(["none","minor","major","critical"]),description:M.string()}).passthrough(),Zrr=M.object({id:M.string(),name:M.string(),status:M.enum(["operational","degraded_performance","partial_outage","major_outage","under_maintenance"]),description:M.string().nullable(),position:M.number(),group_id:M.string().nullable(),group:M.boolean()}).passthrough(),dtt=M.object({status:M.string(),body:M.string(),created_at:M.string()}).passthrough(),Qrr=M.object({id:M.string(),name:M.string(),status:M.string(),impact:M.enum(["none","minor","major","critical"]),created_at:M.string(),incident_updates:M.array(dtt)}).passthrough(),Xrr=M.object({id:M.string(),name:M.string(),status:M.enum(["scheduled","in_progress","verifying","completed"]),scheduled_for:M.string(),scheduled_until:M.string(),incident_updates:M.array(dtt)}).passthrough(),enr=M.object({status:Yrr,components:M.array(Zrr),incidents:M.array(Qrr),scheduled_maintenances:M.array(Xrr)}).passthrough();function tnr(e){switch(e){case"operational":return me("Operational");case"degraded_performance":return Gt("Degraded");case"partial_outage":return Gt("Partial Outage");case"major_outage":return he("Major Outage");case"under_maintenance":return Gt("Maintenance");default:return e}}function rnr(e,r){switch(e){case"none":return me(r);case"minor":return Gt(r);case"major":case"critical":return he(r);default:return r}}function nnr(e){let r=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(r<60)return"<1m ago";let n=Math.floor(r/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function onr(e){switch(e){case"scheduled":return"Scheduled";case"in_progress":return"In Progress";case"verifying":return"Verifying";case"completed":return"Completed";default:return e}}function inr(e,r){let n=new Date(e),o=new Date(r),i={month:"short",day:"numeric",year:"numeric",timeZone:"UTC"},a={hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:"UTC"},c=n.toLocaleDateString("en-US",i),u=n.toLocaleTimeString("en-US",a),l=o.toLocaleTimeString("en-US",a);return`${c} ${u}-${l} UTC`}function ptt(e){return e.toSorted((r,n)=>Date.parse(n.created_at)-Date.parse(r.created_at))[0]}function ftt(e){return e.replace(/^Prisma\s+/,"")}async function snr(){try{let e=await fetch(Jrr,{signal:AbortSignal.timeout(1e4)});if(!e.ok)return{httpError:e.status};let r=enr.safeParse(await e.json());return r.success?{summary:r.data}:{parseError:`unexpected API response: ${r.error.message}`}}catch(e){return{networkError:e instanceof Error?e.message:String(e)}}}async function mtt(e){let r=await snr();if(e)return"networkError"in r?(process.exitCode=1,JSON.stringify({error:r.networkError})):"parseError"in r?(process.exitCode=1,JSON.stringify({error:r.parseError})):"httpError"in r?(process.exitCode=1,JSON.stringify({error:`Status API returned HTTP ${r.httpError}`})):JSON.stringify(r.summary,null,2);if("networkError"in r)return`${he("Could not reach status API")}: ${r.networkError}
Check ${qP} directly.`;if("parseError"in r)return`${he("Could not parse status API response")}: ${r.parseError}
Check ${qP} directly.`;if("httpError"in r)return`${he(`Status API returned HTTP ${r.httpError}`)}
Check ${qP} directly.`;let{summary:n}=r,o=[];o.push(q(rnr(n.status.indicator,n.status.description))),o.push("");let i=n.components.filter(c=>!c.group).sort((c,u)=>c.position-u.position);if(i.length>0){o.push(q("Services"));let c=Math.max(...i.map(u=>ftt(u.name).length));for(let u of i){let l=ftt(u.name).padEnd(c);o.push(` ${l} ${tnr(u.status)}`)}}if(n.incidents.length>0){o.push(""),o.push(q("Active Incidents"));for(let c of n.incidents){let u=c.impact==="critical"||c.impact==="major"?he(c.impact):Gt(c.impact);o.push(` ${u} ${c.name} (${nnr(c.created_at)})`);let l=ptt(c.incident_updates);l&&o.push(` ${ae(l.status+":")} ${l.body}`)}}let a=n.scheduled_maintenances.filter(c=>c.status!=="completed");if(a.length>0){o.push(""),o.push(q("Scheduled Maintenances"));for(let c of a){let u=onr(c.status);o.push(` ${c.name} ${ae(`(${u})`)}`);let p=c.incident_updates.find(f=>f.status==="scheduled")??ptt(c.incident_updates);if(p?.body)for(let f of p.body.split(`
`))o.push(` ${f}`);c.scheduled_for&&c.scheduled_until&&o.push(` ${inr(c.scheduled_for,c.scheduled_until)}`)}}return o.push(""),o.push(`Status page: ${ae(qP)}`),o.join(`
`)}var G5=class e{static new(){return new e}static help=ut(`
Show Prisma Data Platform service status
${q("Usage")}
${ae("$")} prisma platform status [options]
${q("Options")}
-h, --help Display this help message
--json Output raw JSON from the status API
`);help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}async parse(r,n){let o=bt(r,{"--help":Boolean,"-h":"--help","--json":Boolean,"--telemetry-information":String});return Ht(o)?this.help(o.message):o["--help"]?this.help():mtt(o["--json"]??!1)}};var Q1=require("node:fs/promises");var gtt=require("http"),ytt=require("http2"),H5=require("http2"),rle=require("stream"),Ett=W(require("crypto"),1),Xb=class extends Error{constructor(e,r){super(e,r),this.name="RequestError"}},anr=e=>e instanceof Xb?e:new Xb(e.message,{cause:e}),cnr=global.Request,GP=class extends cnr{constructor(e,r){typeof e=="object"&&K1 in e&&(e=e[K1]()),typeof r?.body?.getReader<"u"&&(r.duplex??="half"),super(e,r)}},unr=e=>{let r=[],n=e.rawHeaders;for(let o=0;o<n.length;o+=2){let{[o]:i,[o+1]:a}=n;i.charCodeAt(0)!==58&&r.push([i,a])}return new Headers(r)},xtt=Symbol("wrapBodyStream"),lnr=(e,r,n,o,i)=>{let a={method:e,headers:n,signal:i.signal};if(e==="TRACE"){a.method="GET";let c=new GP(r,a);return Object.defineProperty(c,"method",{get(){return"TRACE"}}),c}if(!(e==="GET"||e==="HEAD"))if("rawBody"in o&&o.rawBody instanceof Buffer)a.body=new ReadableStream({start(c){c.enqueue(o.rawBody),c.close()}});else if(o[xtt]){let c;a.body=new ReadableStream({async pull(u){try{c||=rle.Readable.toWeb(o).getReader();let{done:l,value:p}=await c.read();l?u.close():u.enqueue(p)}catch(l){u.error(l)}}})}else a.body=rle.Readable.toWeb(o);return new GP(r,a)},K1=Symbol("getRequestCache"),pnr=Symbol("requestCache"),W5=Symbol("incomingKey"),V5=Symbol("urlKey"),fnr=Symbol("headersKey"),z1=Symbol("abortControllerKey"),dnr=Symbol("getAbortController"),z5={get method(){return this[W5].method||"GET"},get url(){return this[V5]},get headers(){return this[fnr]||=unr(this[W5])},[dnr](){return this[K1](),this[z1]},[K1](){return this[z1]||=new AbortController,this[pnr]||=lnr(this.method,this[V5],this.headers,this[W5],this[z1])}};["body","bodyUsed","cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","signal","keepalive"].forEach(e=>{Object.defineProperty(z5,e,{get(){return this[K1]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(z5,e,{value:function(){return this[K1]()[e]()}})});Object.setPrototypeOf(z5,GP.prototype);var mnr=(e,r)=>{let n=Object.create(z5);n[W5]=e;let o=e.url||"";if(o[0]!=="/"&&(o.startsWith("http://")||o.startsWith("https://"))){if(e instanceof H5.Http2ServerRequest)throw new Xb("Absolute URL for :path is not allowed in HTTP/2");try{let u=new URL(o);n[V5]=u.href}catch(u){throw new Xb("Invalid absolute URL",{cause:u})}return n}let i=(e instanceof H5.Http2ServerRequest?e.authority:e.headers.host)||r;if(!i)throw new Xb("Missing host header");let a;if(e instanceof H5.Http2ServerRequest){if(a=e.scheme,!(a==="http"||a==="https"))throw new Xb("Unsupported scheme")}else a=e.socket&&e.socket.encrypted?"https":"http";let c=new URL(`${a}://${i}${o}`);if(c.hostname.length!==i.length&&c.hostname!==i.replace(/:\d+$/,""))throw new Xb("Invalid host header");return n[V5]=c.href,n},htt=Symbol("responseCache"),V1=Symbol("getResponseCache"),ev=Symbol("cache"),ile=global.Response,HP=class btt{#e;#t;[V1](){return delete this[ev],this[htt]||=new ile(this.#e,this.#t)}constructor(r,n){let o;if(this.#e=r,n instanceof btt){let i=n[htt];if(i){this.#t=i,this[V1]();return}else this.#t=n.#t,o=new Headers(n.#t.headers)}else this.#t=n;(typeof r=="string"||typeof r?.getReader<"u"||r instanceof Blob||r instanceof Uint8Array)&&(this[ev]=[n?.status||200,r,o||n?.headers])}get headers(){let r=this[ev];return r?(r[2]instanceof Headers||(r[2]=new Headers(r[2]||{"content-type":"text/plain; charset=UTF-8"})),r[2]):this[V1]().headers}get status(){return this[ev]?.[0]??this[V1]().status}get ok(){let r=this.status;return r>=200&&r<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(HP.prototype,e,{get(){return this[V1]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(HP.prototype,e,{value:function(){return this[V1]()[e]()}})});Object.setPrototypeOf(HP,ile);
${q(he("!"))} ${r}`),this.name="UserFacingError"}};var lrt=require("@prisma/dev/internal/state");async function prt(e){let r=new URL(e),n=r.hostname==="localhost"||r.hostname==="127.0.0.1"||r.hostname==="[::1]"||r.hostname==="[0:0:0:0:0:0:0:1]",o;if(r.protocol==="prisma+postgres:"&&r.hostname==="accelerate.prisma-data.net")o="remote";else if((r.protocol==="postgres:"||r.protocol==="postgresql:")&&r.hostname==="db.prisma.io")o="remote";else if(r.protocol==="prisma+postgres:"&&n)o="local";else if((r.protocol==="postgres:"||r.protocol==="postgresql:")&&n){let i=await lrt.ServerState.scan();for(let a of i)a.status==="running"&&[a.databasePort,a.shadowDatabasePort].includes(parseInt(r.port??""))&&(o="local")}return o?{ppg:{type:o}}:{}}var frt=51212,hor=49152,gor=sj(require.resolve("@prisma/studio-core/data"),"../.."),Ple={".css":"text/css",".js":"application/javascript",".mjs":"application/javascript",".html":"text/html",".htm":"text/html",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},yor="application/octet-stream",Ert="adapter.js",QP="createAdapter",xor="Prisma Studio no longer supports Accelerate URLs (`prisma://` or `prisma+postgres://`). Use a direct database connection string instead.",bor=["schema","connection_limit","pool_timeout","sslidentity","sslaccept","pool","socket_timeout","pgbouncer","statement_cache_size"],vor=["connection_limit","pool_timeout","socket_timeout","sslaccept","sslidentity"],drt={async createExecutor(e){let r=await import("postgres"),n=new URL(e);for(let i of bor)n.searchParams.delete(i);let o=r.default(n.toString());return process.once("SIGINT",()=>o.end()),process.once("SIGTERM",()=>o.end()),(0,yrt.createPostgresJSExecutor)(o)},reExportAdapterScript:`export { createPostgresAdapter as ${QP} } from '/data/postgres-core/index.js';`},Eor={file:{async createExecutor(e,r){let n=e.replace("file:",""),o=n===":memory:",i=o?n:_le(r,n);o||await(0,Q1.access)(i,Q1.constants.F_OK).catch(()=>{console.warn(Gt(`Database file at "${i}" was not found. A new file was created. If this is an unwanted side effect, it might mean that the URL you have provided is incorrect.`))});let a;try{let{DatabaseSync:c}=await import("node:sqlite");a=new c(i)}catch{try{switch(Ale){case"node":{let{default:u}=await import("better-sqlite3");a=new u(i);break}case"deno":{let{Database:u}=await import("jsr:@db/sqlite@0.13.0");a=new u(i);break}case"bun":{let{Database:u}=await import("bun:sqlite");a=new u(i);break}default:throw new Error(`Unsupported runtime for SQLite: "${Ale}"`)}}catch(u){throw new Error(`Failed to open SQLite database at "${i}".
Caused by: ${u.message}
Please use Node.js >=22.5, Deno >=2.2 or Bun >=1.0 or ensure you have the \`better-sqlite3\` package installed for Node.js <22.5 or the \`jsr:@db/sqlite\` package installed for Deno <2.2.`)}}return process.once("SIGINT",()=>a.close()),process.once("SIGTERM",()=>a.close()),(0,grt.createNodeSQLiteExecutor)(a)},reExportAdapterScript:`export { createSQLiteAdapter as ${QP} } from '/data/sqlite-core/index.js';`},postgres:drt,postgresql:drt,mysql:{async createExecutor(e){let{createPool:r}=await import("mysql2/promise"),n=r(Tor(e));return process.once("SIGINT",()=>n.end()),process.once("SIGTERM",()=>n.end()),(0,hrt.createMySQL2Executor)(n)},reExportAdapterScript:`export { createMySQLAdapter as ${QP} } from '/data/mysql-core/index.js';`},sqlserver:null},uj=class e{static help=ut(`
Browse your data with Prisma Studio
${q("Usage")}
${ae("$")} prisma studio [options]
${q("Options")}
-h, --help Display this help message
-p, --port Port to start Studio on
-b, --browser Browser to open Studio in
--config Custom path to your Prisma config file
--url Database connection string (overrides the one in your Prisma config)
${q("Examples")}
Start Studio on the default port
${ae("$")} prisma studio
Start Studio on a custom port
${ae("$")} prisma studio --port 5555
Start Studio in a specific browser
${ae("$")} prisma studio --port 5555 --browser firefox
${ae("$")} BROWSER=firefox prisma studio --port 5555
Start Studio without opening in a browser
${ae("$")} prisma studio --port 5555 --browser none
${ae("$")} BROWSER=none prisma studio --port 5555
Specify a custom prisma config file
${ae("$")} prisma studio --config=./prisma.config.ts
Specify a direct database connection string
${ae("$")} prisma studio --url="postgresql://user:password@localhost:5432/dbname"
`);static new(){return new e}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}async parse(r,n){let o=bt(r,{"--help":Boolean,"-h":"--help","--config":String,"--port":Number,"-p":"--port","--browser":String,"-b":"--browser","--url":String});if(Ht(o))return this.help(o.message);if(o["--help"])return this.help();let i=o["--url"]||n.datasource?.url;if(!i)return new Fm("No database URL found. Provide it via the `--url <url>` argument or define it in your Prisma config file as `datasource.url`.");if(!URL.canParse(i))return new Fm("The provided database URL is not valid.");let a=new URL(i).protocol.replace(":","");if(_or(a))return new Fm(xor);let c=Eor[a];if(!c)return new Fm(`Prisma Studio is not supported for the "${a}" protocol.`);let u=await c.createExecutor(i,wor(o["--url"],n.loadedFromFile)),l=new Ele;l.use("*",ert()),l.get("/",S=>{let _=Ple[YP("index.html")];return S.text(Cor,200,{"Content-Type":_})}),l.get(`/${Ert}`,S=>{let _=Ple[YP(S.req.path)];return S.text(c.reExportAdapterScript,200,{"Content-Type":_})}),l.get("/*",async S=>{let _=sj(gor,S.req.path.substring(1)),D=Ple[YP(_)]||yor;try{return S.body(await(0,Q1.readFile)(_),200,{"Content-Type":D})}catch{return S.text("Not Found",404)}}),l.post("/bff",async S=>{let _=await S.req.json(),{procedure:D}=_;if(D==="query"){let[P,C]=await u.execute(_.query);return P?S.json([Z1(P)]):S.json([null,C])}if(D==="sequence"){if(!("executeSequence"in u))return S.json([[Z1(new Error("Executor does not support sequences"))]]);let[[P,C],O]=await u.executeSequence(_.sequence);if(P)return S.json([[Z1(P)]]);let[I,k]=O||[];return I?S.json([[null,C],[Z1(I)]]):S.json([[null,C],[null,k]])}if(D==="sql-lint"){if(!u.lintSql)return S.json([Z1(new Error("Executor does not support SQL lint"))]);let[P,C]=await u.lintSql({schemaVersion:_.schemaVersion,sql:_.sql});return P?S.json([Z1(P)]):S.json([null,C])}return S.text("Unknown procedure",{status:500})});let p=null,f=vrt.default.dependencies["@prisma/studio-core"],g=await prt(i);l.post("/telemetry",async S=>{let{eventId:_,name:D,payload:P,timestamp:C}=await S.req.json();if(D!=="studio_launched")return S.body(null,200);let O={check_if_update_available:!1,client_event_id:_,command:D,information:JSON.stringify({eventPayload:P,protocol:a,...g}),local_timestamp:C,product:"prisma-studio-cli",project_hash:p??=Sle(process.cwd()),version:f};return await(0,xrt.check)(O).catch(()=>{}),S.body(null,200)});let x=o["--port"]||await Ott({port:frt,portRange:[hor,frt-1]}),b=`http://localhost:${x}`,v=Ttt({fetch:l.fetch,overrideGlobalObjects:!1,port:x},()=>{process.once("SIGINT",()=>v.close()),process.once("SIGTERM",()=>v.close()),console.log(q(`
Prisma Studio is running at:`),b);let S=o["--browser"]||process.env.BROWSER;S?.toLowerCase()!=="none"&&(0,brt.default)(b,{app:S?{name:S}:void 0})});return""}};function wor(e,r){return e?process.cwd():r?Dle(r):process.cwd()}function Z1(e){return Sor(e)??(0,mrt.serializeError)(e)}function Sor(e){if(cj(e))return e;if(!wrt(e))return null;let r=e.error;if(cj(r))return r;let n=e["@@error"];return cj(n)?n:null}function cj(e){return!wrt(e)||typeof e.name!="string"||typeof e.message!="string"?!1:e.errors===void 0?!0:Array.isArray(e.errors)&&e.errors.every(cj)}function wrt(e){return typeof e=="object"&&e!==null}function _or(e){return e==="prisma"||e==="prisma+postgres"}function Tor(e){let r=new URL(e),n=r.searchParams.get("connection_limit");n&&!r.searchParams.has("connectionLimit")&&r.searchParams.set("connectionLimit",n);let o=r.searchParams.get("sslaccept");o&&!r.searchParams.has("ssl")&&r.searchParams.set("ssl",JSON.stringify(Dor(o)));for(let i of vor)r.searchParams.delete(i);return r.toString()}function Dor(e){switch(e){case"strict":return{rejectUnauthorized:!0};case"accept_invalid_certs":return{rejectUnauthorized:!1};default:throw new Error(`Unknown Prisma MySQL sslaccept value "${e}". Supported values are "strict" and "accept_invalid_certs".`)}}var Cor=`<!doctype html>
<html lang="en" style="height: 100%">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4.1.17"></script>
<link rel="stylesheet" href="/ui/index.css">
<style>
body {
color: black;
height: 100%;
margin: 0;
padding: 0;
}
#root {
height: 100%;
}
</style>
<script type="importmap">
{
"imports": {
"react": "https://esm.sh/react@19.2.0",
"react/jsx-runtime": "https://esm.sh/react@19.2.0/jsx-runtime",
"react-dom": "https://esm.sh/react-dom@19.2.0",
"react-dom/client": "https://esm.sh/react-dom@19.2.0/client"
}
}
</script>
</head>
<body>
<div id="root"></div>
<script type="module">
'use strict';
import React from 'react';
import ReactDOMClient from 'react-dom/client';
import { ${QP} } from '/${Ert}';
import { createStudioBFFClient } from '/data/bff/index.js';
import { Studio } from '/ui/index.js';
const adapter = ${QP}({
executor: createStudioBFFClient({ url: '/bff' }),
});
const onEvent = (event) => {
fetch('/telemetry', {
body: JSON.stringify(event),
method: 'POST',
});
};
window.__PVCE__ = true;
const container = document.getElementById('root');
const root = ReactDOMClient.createRoot(container);
root.render(React.createElement(Studio, { adapter, onEvent }));
</script>
</body>
</html>`;var mj=require("node:fs"),Srt=W(require("node:fs/promises")),_rt=require("node:os"),Trt=require("node:path"),Drt=require("node:url");var Crt=W(ele());var Aor=jh(),X1=lt("prisma:cli:subcommand"),lj=class extends Error{constructor(n){super("Failed to install subcommand package via npm");this.reason=n}},pj=class extends Error{constructor(n){super("Failed to import subcommand package");this.reason=n}},fj=class extends Error{constructor(){super("Deno is an unsupported CLI runtime for this subcommand")}},dj=class{pkg;constructor(r){this.pkg=r}async parse(r,n){try{this.checkForDeno();let[o,...i]=r[0]?.startsWith("@")?r:["@latest",...r],a={cliVersion:Aor.version};await(await this.importPackage(this.pkg,o)).run(i,n,a)}catch(o){this.handleError(o)}return""}help(){}checkForDeno(){if(typeof globalThis.Deno<"u"&&typeof globalThis.Deno.version<"u")throw new fj}async importPackage(r,n){let o=`${r}${n}`,i=new Date().setHours(0,0,0,0),a=n==="@latest"?`-${i}`:"",c=`${(0,_rt.tmpdir)()}/${o}${a}`;X1(`using cache directory: ${c}`);let u=await this.installPackage(o,c);X1(`using module path: ${u}`);try{return await import(u)}catch(l){return X1(`import failed: ${l}`),X1("=> wiping cache and retrying"),this.wipeCacheAndRetry(o,c)}}async wipeCacheAndRetry(r,n){(0,mj.rmSync)(n,{recursive:!0});let o=await this.installPackage(r,n);try{return await import(o)}catch(i){throw new pj(i)}}async installPackage(r,n){let o=(0,Drt.pathToFileURL)((0,Trt.join)(n,"node_modules",this.pkg,"dist","index.js")).toString();if((0,mj.existsSync)(n))return o;process.stdout.write(ae(`Fetching latest updates for this subcommand...
`));let i=["install",r,"--no-save","--prefix",n,"--userconfig",n,"--loglevel","error"];X1(`running install cmd: npm ${i.join(" ")}`);try{return await Srt.default.mkdir(n,{recursive:!0}),await Crt.default("npm",i,{stdout:"ignore",stderr:"inherit",cwd:n,env:process.env}),o}catch(a){throw X1(`install via npm failed: ${a}`),new lj(a)}}handleError(r){process.exitCode=1,r instanceof pj?(console.log(`
${Dm("Failed to import this dynamic subcommand.")}`),console.log(ae(`
${sn("Underlying Error:")}
${r.reason}`))):r instanceof lj?(console.log(`
${Dm(`Failed to install dynamic subcommand via npm.
This subcommand is dynamically loaded and therefore requires npm to be installed.
Please install npm and rerun this command.`)}`),console.log(ae(`
${sn("Underlying Error:")}
${r.reason}`))):r instanceof fj?(console.log(`
${Dm(`This subcommand is not supported in Deno.
Please use Node.js to run this command.
E.g. via 'npx prisma <cmd>'.`)}`),console.log(`
Note: You can still use Prisma's generated code via the 'prisma-client' generator on Deno.
See https://www.prisma.io/docs/orm/prisma-client/deployment/edge/deploy-to-deno-deploy for more information.`)):(console.log(`
${Dm("Failed to run subcommand.")}`),console.log(ae(`
${sn("Underlying Error:")}
${r}`)))}};var Art=W(hE()),hj=class e{static new(){return new e}async parse(r,n,o=process.cwd()){let i=bt(r,{"--schema":String});if(Ht(i))throw new We("Invalid arguments supplied");let a=await Art.getInfo(),c=OT(hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o})),u=FT(),l=a.cacheItems.map(p=>({product:p.output.product,version:p.version,package:p.output.package,release_tag:p.output.release_tag,cli_path:p.cli_path,cli_path_hash:p.output.cli_path_hash,last_reminder:p.last_reminder,cached_at:p.cached_at}));return JSON.stringify({signature:a.signature,cachePath:a.cachePath,current:{projectPathHash:c,cliPathHash:u},cacheItems:l},void 0,2)}};var gj=require("@prisma/config");var Por=_i("prisma:cli:loadConfig");async function Prt(e){let{config:r,error:n,resolvedPath:o,diagnostics:i}=await(0,gj.loadConfigFromFile)({configFile:e});if(n)switch(Por("Error loading config file: %o",n),n._tag){case"ConfigFileNotFound":return new We(`Config file not found at "${o}"`);case"ConfigLoadError":return n.error instanceof gj.PrismaConfigEnvError&&i.push({_tag:"warn",value:a=>()=>{a.log(a.dim(`${n.error.message}`))}}),new We(`Failed to load config file "${o}" as a TypeScript/JavaScript module. Error: ${n.error}`);case"ConfigFileSyntaxError":return new We(`Failed to parse syntax of config file at "${o}"`);case"UnknownError":return new We(`Unknown error during config file loading: ${n.error}`);default:Hs(n,`Unhandled error '${JSON.stringify(n)}' in 'loadConfigFromFile'.`)}return{config:r,diagnostics:i}}var Ort=W(require("node:path"));var yj=class e{static new(){return new e}static help=ut(`
Validate a Prisma schema.
${q("Usage")}
${ae("$")} prisma validate [options]
${q("Options")}
-h, --help Display this help message
--config Custom path to your Prisma config file
--schema Custom path to your Prisma schema
${q("Examples")}
With an existing Prisma schema
${ae("$")} prisma validate
With a Prisma config file
${ae("$")} prisma validate --config=./prisma.config.ts
Or specify a Prisma schema path
${ae("$")} prisma validate --schema=./schema.prisma
`);async parse(r,n,o=process.cwd()){let i=bt(r,{"--help":Boolean,"-h":"--help","--schema":String,"--config":String,"--telemetry-information":String});if(i instanceof Error)return this.help(i.message);if(i["--help"])return this.help();let{schemaPath:a,schemas:c}=await Qi({schemaPath:hr({schemaPathFromArgs:i["--schema"],schemaPathFromConfig:n.schema,baseDir:o})});Jf(a);let{lintDiagnostics:u}=UH(()=>({lintDiagnostics:RT({schemas:c})})),l=MT(u);l&&il.should.warn()&&console.warn(l),gy({schemas:c}),await hy({datamodel:c});let p=Ort.default.relative(process.cwd(),a);return c.length>1?`The schemas at ${sn(p)} are valid \u{1F680}`:`The schema at ${sn(p)} is valid \u{1F680}`}help(r){return r?new We(`
${q(he("!"))} ${r}
${e.help}`):e.help}};kf.setGlobalContextManager(new Rrt.AsyncLocalStorageContextManager);sa.setGlobalTracerProvider(new O_);var Frt=_i("prisma:cli:bin"),Oor=jh(),Ole=process.argv.slice(2);process.removeAllListeners("warning");process.once("SIGINT",()=>{process.exitCode=130,process.listenerCount("SIGINT")===0&&process.exit()});var For=bt(Ole,{"--config":String},!1,!0);async function Ior(){let e=f6.new({init:F8.new(),mcp:U5.new(),migrate:ZD.new({dev:XD.new(),status:n2.new(),resolve:r2.new(),reset:t2.new(),deploy:QD.new(),diff:e2.new()}),db:MD.new({execute:UD.new(),pull:KD.new(),push:JD.new(),seed:YD.new()}),generate:TN.new(),version:$E.new(),validate:yj.new(),format:m6.new(),telemetry:hj.new(),debug:d6.new(),dev:new dj("@prisma/cli-dev"),studio:uj.new(),platform:q5.$.new({status:G5.new()})},["version","init","migrate","db","generate","validate","format","telemetry"],bM);await vN().catch(u=>{Frt(`Failed to initialize the command state: ${u}`)});let r=For["--config"],n=r?Df.default.resolve(r,".."):process.cwd(),o=await Prt(r);if(o instanceof We)return console.error(o.message),1;let{config:i,diagnostics:a}=o,c={log:u=>process.stderr.write(u+`
`),warn:u=>console.warn(`${Gt(q("warn"))} ${u}`),dim:u=>ae(u),link:u=>Pt(u)};for(let u of a)u.value(c)();try{let u=performance.now(),l=await e.parse(Ole,i,n),f=performance.now()-u;return Frt(`Execution time for executing "await cli.parse(commandArray)": ${f} ms`),l instanceof Error?(l instanceof We||l instanceof Fm?console.error(l.message):console.error(l),1):(console.log(l),0)}catch(u){throw BH(u)&&await eK({error:u,cliVersion:Oor.version,enginesVersion:Mrt.enginesVersion,command:$K([...Ole]).join(" "),getDatabaseVersionSafe:l=>MK(l,i,n)}),u}}eval("require.main === module")&&Ior().then(e=>{e!==0&&process.exit(e)}).catch(e=>{if(typeof e[Symbol.iterator]=="function")for(let r of e)Irt(r);else Irt(e)});function Irt(e){_i.enabled("prisma")?console.error(q(he("Error: "))+e.stack):console.error(q(he("Error: "))+e.message),process.exit(1)}Df.default.join(__dirname,"../../engines/schema-engine-darwin");Df.default.join(__dirname,"../../engines/schema-engine-windows.exe");Df.default.join(__dirname,"../../engines/schema-engine-debian-openssl-1.0.x");Df.default.join(__dirname,"../../engines/schema-engine-debian-openssl-1.1.x");Df.default.join(__dirname,"../../engines/schema-engine-debian-openssl-3.0.x");Df.default.join(__dirname,"../../engines/schema-engine-rhel-openssl-1.0.x");Df.default.join(__dirname,"../../engines/schema-engine-rhel-openssl-1.1.x");Df.default.join(__dirname,"../../engines/schema-engine-rhel-openssl-3.0.x");
/*! Bundled license information:
is-extglob/index.js:
(*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*)
is-glob/index.js:
(*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*)
is-number/index.js:
(*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*)
to-regex-range/index.js:
(*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*)
fill-range/index.js:
(*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*)
queue-microtask/index.js:
(*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
run-parallel/index.js:
(*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
fetch-blob/index.js:
(*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
formdata-polyfill/esm.min.js:
(*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
node-domexception/index.js:
(*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
progress/lib/node-progress.js:
(*!
* node-progress
* Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*)
tmp/lib/tmp.js:
tmp/lib/tmp.js:
(*!
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*)
is-windows/index.js:
(*!
* is-windows <https://github.com/jonschlinkert/is-windows>
*
* Copyright © 2015-2018, Jon Schlinkert.
* Released under the MIT License.
*)
uri-js/dist/es5/uri.all.js:
(** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
chokidar/esm/index.js:
(*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
*/