efiber-prisma-schema 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,86 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ "use strict";var yl=Object.create;var $t=Object.defineProperty;var hl=Object.getOwnPropertyDescriptor;var wl=Object.getOwnPropertyNames;var xl=Object.getPrototypeOf,bl=Object.prototype.hasOwnProperty;var ii=(e,t)=>()=>(e&&(t=e(e=0)),t);var N=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ae=(e,t)=>{for(var r in t)$t(e,r,{get:t[r],enumerable:!0})},oi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of wl(t))!bl.call(e,i)&&i!==r&&$t(e,i,{get:()=>t[i],enumerable:!(n=hl(t,i))||n.enumerable});return e};var q=(e,t,r)=>(r=e!=null?yl(xl(e)):{},oi(t||!e||!e.__esModule?$t(r,"default",{value:e,enumerable:!0}):r,e)),El=e=>oi($t({},"__esModule",{value:!0}),e);var bi=N((ym,Bl)=>{Bl.exports={name:"@prisma/internals",version:"7.0.0",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"~20.19.24","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",empathic:"2.0.0","escape-string-regexp":"5.0.0",execa:"8.0.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","global-directory":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513","@prisma/schema-engine-wasm":"6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.4.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var Ei=N((wm,Hl)=>{Hl.exports={name:"@prisma/engines-version",version:"6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"0c19ccc313cf9911a90d99d2ac2eb0280c76c513"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Ti=N(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.enginesVersion=void 0;qt.enginesVersion=Ei().prisma.enginesVersion});var Ai=N((bm,Pi)=>{"use strict";Pi.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var ki=N((Pm,Ri)=>{"use strict";Ri.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var Ii=N((Om,jt)=>{"use strict";jt.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`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 r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};jt.exports.default=jt.exports});var en=N((Af,Vi)=>{"use strict";Vi.exports=function(){function e(t,r,n,i,o){return t<r||n<r?t>n?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&t.charCodeAt(s)===r.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,c,u,p,y,g,b,E,$,re,C,P,V=[];for(l=0;l<i;l++)V.push(l+1),V.push(t.charCodeAt(s+l));for(var Pe=V.length-1;a<o-3;)for($=r.charCodeAt(s+(c=a)),re=r.charCodeAt(s+(u=a+1)),C=r.charCodeAt(s+(p=a+2)),P=r.charCodeAt(s+(y=a+3)),g=a+=4,l=0;l<Pe;l+=2)b=V[l],E=V[l+1],c=e(b,c,u,$,E),u=e(c,u,p,re,E),p=e(u,p,y,C,E),g=e(p,y,g,P,E),V[l]=g,y=p,p=u,u=c,c=b;for(;a<o;)for($=r.charCodeAt(s+(c=a)),g=++a,l=0;l<Pe;l+=2)b=V[l],V[l]=g=e(b,c,g,$,V[l+1]),c=b;return g}}()});var Qi=ii(()=>{"use strict"});var Hi=ii(()=>{"use strict"});var Tn=N(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.anumber=En;he.abytes=is;he.ahash=ju;he.aexists=Bu;he.aoutput=Qu;function En(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Uu(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function is(e,...t){if(!Uu(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function ju(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");En(e.outputLen),En(e.blockLen)}function Bu(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Qu(e,t){is(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Ss=N(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.add5L=m.add5H=m.add4H=m.add4L=m.add3H=m.add3L=m.rotlBL=m.rotlBH=m.rotlSL=m.rotlSH=m.rotr32L=m.rotr32H=m.rotrBL=m.rotrBH=m.rotrSL=m.rotrSH=m.shrSL=m.shrSH=m.toBig=void 0;m.fromBig=An;m.split=os;m.add=xs;var gr=BigInt(2**32-1),Pn=BigInt(32);function An(e,t=!1){return t?{h:Number(e&gr),l:Number(e>>Pn&gr)}:{h:Number(e>>Pn&gr)|0,l:Number(e&gr)|0}}function os(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=An(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var ss=(e,t)=>BigInt(e>>>0)<<Pn|BigInt(t>>>0);m.toBig=ss;var as=(e,t,r)=>e>>>r;m.shrSH=as;var ls=(e,t,r)=>e<<32-r|t>>>r;m.shrSL=ls;var cs=(e,t,r)=>e>>>r|t<<32-r;m.rotrSH=cs;var us=(e,t,r)=>e<<32-r|t>>>r;m.rotrSL=us;var ps=(e,t,r)=>e<<64-r|t>>>r-32;m.rotrBH=ps;var ds=(e,t,r)=>e>>>r-32|t<<64-r;m.rotrBL=ds;var ms=(e,t)=>t;m.rotr32H=ms;var fs=(e,t)=>e;m.rotr32L=fs;var gs=(e,t,r)=>e<<r|t>>>32-r;m.rotlSH=gs;var ys=(e,t,r)=>t<<r|e>>>32-r;m.rotlSL=ys;var hs=(e,t,r)=>t<<r-32|e>>>64-r;m.rotlBH=hs;var ws=(e,t,r)=>e<<r-32|t>>>64-r;m.rotlBL=ws;function xs(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var bs=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);m.add3L=bs;var Es=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;m.add3H=Es;var Ts=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);m.add4L=Ts;var Ps=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;m.add4H=Ps;var As=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);m.add5L=As;var vs=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;m.add5H=vs;var Hu={fromBig:An,split:os,toBig:ss,shrSH:as,shrSL:ls,rotrSH:cs,rotrSL:us,rotrBH:ps,rotrBL:ds,rotr32H:ms,rotr32L:fs,rotlSH:gs,rotlSL:ys,rotlBH:hs,rotlBL:ws,add:xs,add3L:bs,add3H:Es,add4L:Ts,add4H:Ps,add5H:vs,add5L:As};m.default=Hu});var Cs=N(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.crypto=void 0;var ce=require("node:crypto");yr.crypto=ce&&typeof ce=="object"&&"webcrypto"in ce?ce.webcrypto:ce&&typeof ce=="object"&&"randomBytes"in ce?ce:void 0});var Os=N(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});h.Hash=h.nextTick=h.byteSwapIfBE=h.isLE=void 0;h.isBytes=Ju;h.u8=Wu;h.u32=Gu;h.createView=Ku;h.rotr=zu;h.rotl=Zu;h.byteSwap=Cn;h.byteSwap32=Xu;h.bytesToHex=ep;h.hexToBytes=tp;h.asyncLoop=np;h.utf8ToBytes=ks;h.toBytes=hr;h.concatBytes=ip;h.checkOpts=op;h.wrapConstructor=sp;h.wrapConstructorWithOpts=ap;h.wrapXOFConstructorWithOpts=lp;h.randomBytes=cp;var Ue=Cs(),Sn=Tn();function Ju(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Wu(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Gu(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Ku(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function zu(e,t){return e<<32-t|e>>>t}function Zu(e,t){return e<<t|e>>>32-t>>>0}h.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Cn(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}h.byteSwapIfBE=h.isLE?e=>e:e=>Cn(e);function Xu(e){for(let t=0;t<e.length;t++)e[t]=Cn(e[t])}var Yu=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ep(e){(0,Sn.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=Yu[e[r]];return t}var ee={_0:48,_9:57,A:65,F:70,a:97,f:102};function Rs(e){if(e>=ee._0&&e<=ee._9)return e-ee._0;if(e>=ee.A&&e<=ee.F)return e-(ee.A-10);if(e>=ee.a&&e<=ee.f)return e-(ee.a-10)}function tp(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let s=Rs(e.charCodeAt(o)),a=Rs(e.charCodeAt(o+1));if(s===void 0||a===void 0){let l=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}n[i]=s*16+a}return n}var rp=async()=>{};h.nextTick=rp;async function np(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);let o=Date.now()-n;o>=0&&o<t||(await(0,h.nextTick)(),n+=o)}}function ks(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function hr(e){return typeof e=="string"&&(e=ks(e)),(0,Sn.abytes)(e),e}function ip(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,Sn.abytes)(i),t+=i.length}let r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return r}var vn=class{clone(){return this._cloneInto()}};h.Hash=vn;function op(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function sp(e){let t=n=>e().update(hr(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function ap(e){let t=(n,i)=>e(i).update(hr(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function lp(e){let t=(n,i)=>e(i).update(hr(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function cp(e=32){if(Ue.crypto&&typeof Ue.crypto.getRandomValues=="function")return Ue.crypto.getRandomValues(new Uint8Array(e));if(Ue.crypto&&typeof Ue.crypto.randomBytes=="function")return Ue.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var $s=N(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.shake256=v.shake128=v.keccak_512=v.keccak_384=v.keccak_256=v.keccak_224=v.sha3_512=v.sha3_384=v.sha3_256=v.sha3_224=v.Keccak=void 0;v.keccakP=Ns;var je=Tn(),Pt=Ss(),te=Os(),Ms=[],Ds=[],_s=[],up=BigInt(0),Tt=BigInt(1),pp=BigInt(2),dp=BigInt(7),mp=BigInt(256),fp=BigInt(113);for(let e=0,t=Tt,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Ms.push(2*(5*n+r)),Ds.push((e+1)*(e+2)/2%64);let i=up;for(let o=0;o<7;o++)t=(t<<Tt^(t>>dp)*fp)%mp,t&pp&&(i^=Tt<<(Tt<<BigInt(o))-Tt);_s.push(i)}var[gp,yp]=(0,Pt.split)(_s,!0),Is=(e,t,r)=>r>32?(0,Pt.rotlBH)(e,t,r):(0,Pt.rotlSH)(e,t,r),Fs=(e,t,r)=>r>32?(0,Pt.rotlBL)(e,t,r):(0,Pt.rotlSL)(e,t,r);function Ns(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,l=(s+2)%10,c=r[l],u=r[l+1],p=Is(c,u,1)^r[a],y=Fs(c,u,1)^r[a+1];for(let g=0;g<50;g+=10)e[s+g]^=p,e[s+g+1]^=y}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=Ds[s],l=Is(i,o,a),c=Fs(i,o,a),u=Ms[s];i=e[u],o=e[u+1],e[u]=l,e[u+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=gp[n],e[1]^=yp[n]}r.fill(0)}var At=class e extends te.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,je.anumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,te.u32)(this.state)}keccak(){te.isLE||(0,te.byteSwap32)(this.state32),Ns(this.state32,this.rounds),te.isLE||(0,te.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,je.aexists)(this);let{blockLen:r,state:n}=this;t=(0,te.toBytes)(t);let i=t.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);for(let a=0;a<s;a++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){(0,je.aexists)(this,!1),(0,je.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,je.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,je.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new e(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}};v.Keccak=At;var ue=(e,t,r)=>(0,te.wrapConstructor)(()=>new At(t,e,r));v.sha3_224=ue(6,144,224/8);v.sha3_256=ue(6,136,256/8);v.sha3_384=ue(6,104,384/8);v.sha3_512=ue(6,72,512/8);v.keccak_224=ue(1,144,224/8);v.keccak_256=ue(1,136,256/8);v.keccak_384=ue(1,104,384/8);v.keccak_512=ue(1,72,512/8);var Ls=(e,t,r)=>(0,te.wrapXOFConstructorWithOpts)((n={})=>new At(t,e,n.dkLen===void 0?r:n.dkLen,!0));v.shake128=Ls(31,168,128/8);v.shake256=Ls(31,136,256/8)});var Js=N((ax,pe)=>{"use strict";var{sha3_512:hp}=$s(),qs=24,vt=32,Rn=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Us(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var js=(e="")=>Us(hp(e)).toString(36).slice(1),Vs=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),wp=e=>Vs[Math.floor(e()*Vs.length)],Bs=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+Rn(vt,t):Rn(vt,t);return js(n).substring(0,vt)},Qs=e=>()=>e++,xp=476782367,Hs=({random:e=Math.random,counter:t=Qs(Math.floor(e()*xp)),length:r=qs,fingerprint:n=Bs({random:e})}={})=>function(){let o=wp(e),s=Date.now().toString(36),a=t().toString(36),l=Rn(r,e),c=`${s+l+a+n}`;return`${o+js(c).substring(1,r)}`},bp=Hs(),Ep=(e,{minLength:t=2,maxLength:r=vt}={})=>{let n=e.length,i=/^[0-9a-z]+$/;try{if(typeof e=="string"&&n>=t&&n<=r&&i.test(e))return!0}finally{}return!1};pe.exports.getConstants=()=>({defaultLength:qs,bigLength:vt});pe.exports.init=Hs;pe.exports.createId=bp;pe.exports.bufToBigInt=Us;pe.exports.createCounter=Qs;pe.exports.createFingerprint=Bs;pe.exports.isCuid=Ep});var Ws=N((lx,St)=>{"use strict";var{createId:Tp,init:Pp,getConstants:Ap,isCuid:vp}=Js();St.exports.createId=Tp;St.exports.init=Pp;St.exports.getConstants=Ap;St.exports.isCuid=vp});var Vd={};Ae(Vd,{AnyNull:()=>F.AnyNull,DMMF:()=>lt,DbNull:()=>F.DbNull,Debug:()=>I,Decimal:()=>dl.Decimal,Extensions:()=>qr,JsonNull:()=>F.JsonNull,NullTypes:()=>F.NullTypes,ObjectEnumValue:()=>F.ObjectEnumValue,PrismaClientInitializationError:()=>w.PrismaClientInitializationError,PrismaClientKnownRequestError:()=>w.PrismaClientKnownRequestError,PrismaClientRustPanicError:()=>w.PrismaClientRustPanicError,PrismaClientUnknownRequestError:()=>w.PrismaClientUnknownRequestError,PrismaClientValidationError:()=>w.PrismaClientValidationError,Public:()=>Ur,Sql:()=>Z.Sql,createParam:()=>co,defineDmmfProperty:()=>go,deserializeJsonResponse:()=>le,deserializeRawResult:()=>Lr,dmmfToRuntimeDataModel:()=>ui,empty:()=>Z.empty,getPrismaClient:()=>cl,getRuntime:()=>pl,isAnyNull:()=>F.isAnyNull,isDbNull:()=>F.isDbNull,isJsonNull:()=>F.isJsonNull,join:()=>Z.join,makeStrictEnum:()=>ul,makeTypedQueryFactory:()=>yo,raw:()=>Z.raw,serializeJsonQuery:()=>or,skip:()=>ir,sqltag:()=>Z.sql,warnOnce:()=>Yr});module.exports=El(Vd);var qr={};Ae(qr,{defineExtension:()=>si,getExtensionContext:()=>ai});function si(e){return typeof e=="function"?e:t=>t.$extends(e)}function ai(e){return e}var Ur={};Ae(Ur,{validator:()=>li});function li(...e){return t=>t}var J=class{_map=new Map;get(t){return this._map.get(t)?.value}set(t,r){this._map.set(t,{value:r})}getOrCreate(t,r){let n=this._map.get(t);if(n)return n.value;let i=r();return this.set(t,i),i}};function ie(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function ci(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function ze(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function ui(e){return{models:jr(e.models),enums:jr(e.enums),types:jr(e.types)}}function jr(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}var se=require("@prisma/client-runtime-utils");var Vt={};Ae(Vt,{$:()=>gi,bgBlack:()=>Il,bgBlue:()=>_l,bgCyan:()=>Ll,bgGreen:()=>Ml,bgMagenta:()=>Nl,bgRed:()=>Fl,bgWhite:()=>$l,bgYellow:()=>Dl,black:()=>Cl,blue:()=>me,bold:()=>j,cyan:()=>X,dim:()=>Ze,gray:()=>tt,green:()=>Ye,grey:()=>Ol,hidden:()=>vl,inverse:()=>Al,italic:()=>Pl,magenta:()=>Rl,red:()=>de,reset:()=>Tl,strikethrough:()=>Sl,underline:()=>Xe,white:()=>kl,yellow:()=>et});var Br,pi,di,mi,fi=!0;typeof process<"u"&&({FORCE_COLOR:Br,NODE_DISABLE_COLORS:pi,NO_COLOR:di,TERM:mi}=process.env||{},fi=process.stdout&&process.stdout.isTTY);var gi={enabled:!pi&&di==null&&mi!=="dumb"&&(Br!=null&&Br!=="0"||fi)};function T(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!gi.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Tl=T(0,0),j=T(1,22),Ze=T(2,22),Pl=T(3,23),Xe=T(4,24),Al=T(7,27),vl=T(8,28),Sl=T(9,29),Cl=T(30,39),de=T(31,39),Ye=T(32,39),et=T(33,39),me=T(34,39),Rl=T(35,39),X=T(36,39),kl=T(37,39),tt=T(90,39),Ol=T(90,39),Il=T(40,49),Fl=T(41,49),Ml=T(42,49),Dl=T(43,49),_l=T(44,49),Nl=T(45,49),Ll=T(46,49),$l=T(47,49);var Vl=100,yi=["green","yellow","blue","magenta","cyan","red"],rt=[],hi=Date.now(),ql=0,Qr=typeof process<"u"?process.env:{};globalThis.DEBUG??=Qr.DEBUG??"";globalThis.DEBUG_COLORS??=Qr.DEBUG_COLORS?Qr.DEBUG_COLORS==="true":!0;var nt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function Ul(e){let t={color:yi[ql++%yi.length],enabled:nt.enabled(e),namespace:e,log:nt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&rt.push([o,...n]),rt.length>Vl&&rt.shift(),nt.enabled(o)||i){let l=n.map(u=>typeof u=="string"?u:jl(u)),c=`+${Date.now()-hi}ms`;hi=Date.now(),globalThis.DEBUG_COLORS?a(Vt[s](j(o)),...l,Vt[s](c)):a(o,...l,c)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var I=new Proxy(Ul,{get:(e,t)=>nt[t],set:(e,t,r)=>nt[t]=r});function jl(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function wi(e=7500){let t=rt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
6
+ `);return t.length<e?t:t.slice(-e)}function xi(){rt.length=0}var Ql=bi(),Hr=Ql.version;var vi=q(Ai(),1);function Jr(e){let t=(0,vi.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var Si="prisma+postgres",Ut=`${Si}:`;function Ci(e){return e?.toString().startsWith(`${Ut}//`)??!1}function Wr(e){if(!Ci(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")||t.includes("[::1]")}var ot={};Ae(ot,{error:()=>Gl,info:()=>Wl,log:()=>Jl,query:()=>Kl,should:()=>Oi,tags:()=>it,warn:()=>Gr});var it={error:de("prisma:error"),warn:et("prisma:warn"),info:X("prisma:info"),query:me("prisma:query")},Oi={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Jl(...e){console.log(...e)}function Gr(e,...t){Oi.warn()&&console.warn(`${it.warn} ${e}`,...t)}function Wl(e,...t){console.info(`${it.info} ${e}`,...t)}function Gl(e,...t){console.error(`${it.error} ${e}`,...t)}function Kl(e,...t){console.log(`${it.query} ${e}`,...t)}function Y(e,t){throw new Error(t)}function Kr({onlyFirst:e=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}var zl=Kr();function ve(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(zl,"")}var st=q(require("node:path"));function zr(e){return st.default.sep===st.default.posix.sep?e:e.split(st.default.sep).join(st.default.posix.sep)}function Zr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Bt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function Xr(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n<e.length;n++)t(r,e[n])<0&&(r=e[n]);return r}function at(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var Fi=new Set,Yr=(e,t,...r)=>{Fi.has(e)||(Fi.add(e),Gr(t,...r))};function Se(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Qt(e){return e.toString()!=="Invalid Date"}var Mi=require("@prisma/client-runtime-utils");function Ce(e){return Mi.Decimal.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}var no=require("@prisma/client-runtime-utils");var lt={};Ae(lt,{ModelAction:()=>Re,datamodelEnumToSchemaEnum:()=>Zl,datamodelSchemaEnumToSchemaEnum:()=>Xl});function Zl(e){return{name:e.name,data:e.values.map(t=>({key:t.name,value:t.dbName??t.name}))}}function Xl(e){return{name:e.name,data:e.values.map(t=>({key:t,value:t}))}}var Re=(P=>(P.findUnique="findUnique",P.findUniqueOrThrow="findUniqueOrThrow",P.findFirst="findFirst",P.findFirstOrThrow="findFirstOrThrow",P.findMany="findMany",P.create="create",P.createMany="createMany",P.createManyAndReturn="createManyAndReturn",P.update="update",P.updateMany="updateMany",P.updateManyAndReturn="updateManyAndReturn",P.upsert="upsert",P.delete="delete",P.deleteMany="deleteMany",P.groupBy="groupBy",P.count="count",P.aggregate="aggregate",P.findRaw="findRaw",P.aggregateRaw="aggregateRaw",P))(Re||{});var $i=q(ki());var Li=q(require("node:fs"));var Di={keyword:X,entity:X,value:e=>j(me(e)),punctuation:me,directive:X,function:X,variable:e=>j(me(e)),string:e=>j(Ye(e)),boolean:et,number:X,comment:tt};var Yl=e=>e,Ht={},ec=0,f={manual:Ht.Prism&&Ht.Prism.manual,disableWorkerMessageHandler:Ht.Prism&&Ht.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof B){let t=e;return new B(t.type,f.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(f.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:++ec}),e.__id},clone:function e(t,r){let n,i,o=f.util.type(t);switch(r=r||{},o){case"Object":if(i=f.util.objId(t),r[i])return r[i];n={},r[i]=n;for(let s in t)t.hasOwnProperty(s)&&(n[s]=e(t[s],r));return n;case"Array":return i=f.util.objId(t),r[i]?r[i]:(n=[],r[i]=n,t.forEach(function(s,a){n[a]=e(s,r)}),n);default:return t}}},languages:{extend:function(e,t){let r=f.util.clone(f.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||f.languages;let i=n[e],o={};for(let a in i)if(i.hasOwnProperty(a)){if(a==t)for(let l in r)r.hasOwnProperty(l)&&(o[l]=r[l]);r.hasOwnProperty(a)||(o[a]=i[a])}let s=n[e];return n[e]=o,f.languages.DFS(f.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=f.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=f.util.type(a);l==="Object"&&!i[o(a)]?(i[o(a)]=!0,e(a,r,null,i)):l==="Array"&&!i[o(a)]&&(i[o(a)]=!0,e(a,r,s,i))}}},plugins:{},highlight:function(e,t,r){let n={code:e,grammar:t,language:r};return f.hooks.run("before-tokenize",n),n.tokens=f.tokenize(n.code,n.grammar),f.hooks.run("after-tokenize",n),B.stringify(f.util.encode(n.tokens),n.language)},matchGrammar:function(e,t,r,n,i,o,s){for(let E in r){if(!r.hasOwnProperty(E)||!r[E])continue;if(E==s)return;let $=r[E];$=f.util.type($)==="Array"?$:[$];for(let re=0;re<$.length;++re){let C=$[re],P=C.inside,V=!!C.lookbehind,Pe=!!C.greedy,Vr=0,ml=C.alias;if(Pe&&!C.pattern.global){let _=C.pattern.toString().match(/[imuy]*$/)[0];C.pattern=RegExp(C.pattern.source,_+"g")}C=C.pattern||C;for(let _=n,ne=i;_<t.length;ne+=t[_].length,++_){let Ke=t[_];if(t.length>e.length)return;if(Ke instanceof B)continue;if(Pe&&_!=t.length-1){C.lastIndex=ne;var p=C.exec(e);if(!p)break;var u=p.index+(V?p[1].length:0),y=p.index+p[0].length,a=_,l=ne;for(let gl=t.length;a<gl&&(l<y||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,u>=l&&(++_,ne=l);if(t[_]instanceof B)continue;c=a-_,Ke=e.slice(ne,l),p.index-=ne}else{C.lastIndex=0;var p=C.exec(Ke),c=1}if(!p){if(o)break;continue}V&&(Vr=p[1]?p[1].length:0);var u=p.index+Vr,p=p[0].slice(Vr),y=u+p.length,g=Ke.slice(0,u),b=Ke.slice(y);let Lt=[_,c];g&&(++_,ne+=g.length,Lt.push(g));let fl=new B(E,P?f.tokenize(p,P):p,ml,p,Pe);if(Lt.push(fl),b&&Lt.push(b),Array.prototype.splice.apply(t,Lt),c!=1&&f.matchGrammar(e,t,r,_,ne,!0,E),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return f.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=f.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=f.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:B};f.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};f.languages.javascript=f.languages.extend("clike",{"class-name":[f.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});f.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;f.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:f.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:f.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:f.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:f.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});f.languages.markup&&f.languages.markup.tag.addInlined("script","javascript");f.languages.js=f.languages.javascript;f.languages.typescript=f.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});f.languages.ts=f.languages.typescript;function B(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}B.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return B.stringify(r,t)}).join(""):tc(e.type)(e.content)};function tc(e){return Di[e]||Yl}function _i(e){return rc(e,f.languages.javascript)}function rc(e,t){return f.tokenize(e,t).map(n=>B.stringify(n)).join("")}function Ni(e){return Jr(e)}var Jt=class e{firstLineNumber;lines;static read(t){let r;try{r=Li.default.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(t<this.firstLineNumber||t>this.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(`
7
+ `);return new e(t,Ni(n).split(`
8
+ `))}highlight(){let t=_i(this.toString());return new e(this.firstLineNumber,t.split(`
9
+ `))}toString(){return this.lines.join(`
10
+ `)}};var nc={red:de,gray:tt,dim:Ze,bold:j,underline:Xe,highlightSource:e=>e.highlight()},ic={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function oc({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function sc({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=oc({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),c=Jt.read(a.fileName)?.slice(l,a.lineNumber),u=c?.lineAt(a.lineNumber);if(c&&u){let p=lc(u),y=ac(u);if(!y)return s;s.functionName=`${y.code})`,s.location=a,n||(c=c.mapLineAt(a.lineNumber,b=>b.slice(0,y.openingBraceIndex))),c=o.highlightSource(c);let g=String(c.lastLineNumber).length;if(s.contextLines=c.mapLines((b,E)=>o.gray(String(E).padStart(g))+" "+b).mapLines(b=>o.dim(b)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let b=p+g+1;b+=2,s.callArguments=(0,$i.default)(i,b).slice(b)}}return s}function ac(e){let t=Object.keys(Re).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function lc(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function cc({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],l=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${l}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${l}`)),t&&a.push(s.underline(uc(t))),i){a.push("");let c=[i.toString()];o&&(c.push(o),c.push(s.dim(")"))),a.push(c.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(`
11
+ `)}function uc(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function Wt(e){let t=e.showColors?nc:ic,r;return r=sc(e,t),cc(r,t)}var Wi=q(en());function ji(e,t,r){let n=Bi(e),i=pc(n),o=mc(i);o?Gt(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Bi(e){return e.errors.flatMap(t=>t.kind==="Union"?Bi(t):[t])}function pc(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:dc(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function dc(e,t){return[...new Set(e.concat(t))]}function mc(e){return Xr(e,(t,r)=>{let n=qi(t),i=qi(r);return n!==i?n-i:Ui(t)-Ui(r)})}function qi(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Ui(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var L=class{constructor(t,r){this.name=t;this.value=r}isRequired=!1;makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};Hi();var ke=class{constructor(t=0,r){this.context=r;this.currentIndent=t}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=r.length-1;for(let o=0;o<r.length;o++)n(r[o],this),o!==i&&this.write(t);return this}writeLine(t){return this.write(t).newLine()}newLine(){this.lines.push(this.indentedCurrentLine()),this.currentLine="",this.marginSymbol=void 0;let t=this.afterNextNewLineCallback;return this.afterNextNewLineCallback=void 0,t?.(),this}withIndent(t){return this.indent(),t(this),this.unindent(),this}afterNextNewline(t){return this.afterNextNewLineCallback=t,this}indent(){return this.currentIndent++,this}unindent(){return this.currentIndent>0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(`
12
+ `)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};Qi();var Kt=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var zt=e=>e,Zt={bold:zt,red:zt,green:zt,dim:zt,enabled:!1},Ji={bold:j,red:de,green:Ye,dim:Ze,enabled:!0},Oe={write(e){e.writeLine(",")}};var W=class{constructor(t){this.contents=t}isUnderlined=!1;color=t=>t;underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};var oe=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var Ie=class extends oe{items=[];addItem(t){return this.items.push(new Kt(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(r=>r.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let r=new W("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(Oe,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Fe=class e extends oe{fields={};suggestions=[];addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[r,...n]=t,i=this.getField(r);if(!i)return;let o=i;for(let s of n){let a;if(o.value instanceof e?a=o.value.getField(s):o.value instanceof Ie&&(a=o.value.getField(Number(s))),!a)return;o=a}return o}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let r=this;for(let n of t){if(!(r instanceof e))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(t){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of t){let o=n.value.getFieldValue(i);if(!o||!(o instanceof e))return;let s=o.getSelectionParent();if(!s)return;n=s}return n}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(n=>n.getPrintWidth()))+2}write(t){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,r)}asObject(){return this}writeEmpty(t){let r=new W("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(Oe,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var R=class extends oe{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new W(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var ct=class{fields=[];addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(Oe,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Gt(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":fc(e,t);break;case"IncludeOnScalar":gc(e,t);break;case"EmptySelection":yc(e,t,r);break;case"UnknownSelectionField":bc(e,t);break;case"InvalidSelectionValue":Ec(e,t);break;case"UnknownArgument":Tc(e,t);break;case"UnknownInputField":Pc(e,t);break;case"RequiredArgumentMissing":Ac(e,t);break;case"InvalidArgumentType":vc(e,t);break;case"InvalidArgumentValue":Sc(e,t);break;case"ValueTooLarge":Cc(e,t);break;case"SomeFieldsMissing":Rc(e,t);break;case"TooManyFieldsGiven":kc(e,t);break;case"Union":ji(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function fc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function gc(e,t){let[r,n]=Me(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new L(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${ut(s)}`:a+=".",a+=`
13
+ Note that ${s.bold("include")} statements only accept relation fields.`,a})}function yc(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){hc(e,t,i);return}if(n.hasField("select")){wc(e,t);return}}if(r?.[ie(e.outputType.name)]){xc(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function hc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new L(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function wc(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),zi(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${ut(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function xc(e,t){let r=new ct;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new L("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=Me(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new Fe;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function bc(e,t){let r=Zi(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":zi(n,e.outputType);break;case"include":Oc(n,e.outputType);break;case"omit":Ic(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(ut(n)),i.join(" ")})}function Ec(e,t){let r=Zi(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function Tc(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Fc(n,e.arguments)),t.addErrorMessage(i=>Gi(i,r,e.arguments.map(o=>o.name)))}function Pc(e,t){let[r,n]=Me(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&Xi(o,e.inputType)}t.addErrorMessage(o=>Gi(o,n,e.inputType.fields.map(s=>s.name)))}function Gi(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Dc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(ut(e)),n.join(" ")}function Ac(e,t){let r;t.addErrorMessage(l=>r?.value instanceof R&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Me(e.argumentPath),s=new ct,a=n.getDeepFieldValue(i)?.asObject();if(a){if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new L(o,s).makeRequired())}else{let l=e.inputTypes.map(Ki).join(" | ");a.addSuggestion(new L(o,l).makeRequired())}if(e.dependentArgumentPath){n.getDeepField(e.dependentArgumentPath)?.markAsError();let[,l]=Me(e.dependentArgumentPath);t.addErrorMessage(c=>`Argument \`${c.green(o)}\` is required because argument \`${c.green(l)}\` was provided.`)}}}function Ki(e){return e.kind==="list"?`${Ki(e.elementType)}[]`:e.name}function vc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Xt("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function Sc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=Xt("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Cc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof R&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function Rc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&Xi(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Xt("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(ut(i)),o.join(" ")})}function kc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Xt("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function zi(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new L(r.name,"true"))}function Oc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new L(r.name,"true"))}function Ic(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new L(r.name,"true"))}function Fc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new L(r.name,r.typeNames.join(" | ")))}function Zi(e,t){let[r,n]=Me(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function Xi(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new L(r.name,r.typeNames.join(" | ")))}function Me(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function ut({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Xt(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Mc=3;function Dc(e,t){let r=1/0,n;for(let i of t){let o=(0,Wi.default)(e,i);o>Mc||o<r&&(r=o,n=i)}return n}var eo=require("@prisma/client-runtime-utils");var pt=class{modelName;name;typeName;isList;isEnum;constructor(t,r,n,i,o){this.modelName=t,this.name=r,this.typeName=n,this.isList=i,this.isEnum=o}_toGraphQLInputType(){let t=this.isList?"List":"",r=this.isEnum?"Enum":"";return`${t}${r}${this.typeName}FieldRefInput<${this.modelName}>`}};function De(e){return e instanceof pt}var Yi=": ",Yt=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Yi.length}write(t){let r=new W(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Yi).write(this.value)}};var rn=class{arguments;errorMessages=[];constructor(t){this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(`
14
+ `)}};function _e(e){return new rn(to(e))}function to(e){let t=new Fe;for(let[r,n]of Object.entries(e)){let i=new Yt(r,ro(n));t.addField(i)}return t}function ro(e){if(typeof e=="string")return new R(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new R(String(e));if(typeof e=="bigint")return new R(`${e}n`);if(e===null)return new R("null");if(e===void 0)return new R("undefined");if(Ce(e))return new R(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new R(`Buffer.alloc(${e.byteLength})`):new R(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Qt(e)?e.toISOString():"Invalid Date";return new R(`new Date("${t}")`)}return e instanceof eo.ObjectEnumValue?new R(`Prisma.${e._getName()}`):De(e)?new R(`prisma.${ie(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?_c(e):typeof e=="object"?to(e):new R(Object.prototype.toString.call(e))}function _c(e){let t=new Ie;for(let r of e)t.addItem(ro(r));return t}function er(e,t){let r=t==="pretty"?Ji:Zt,n=e.renderAllMessages(r),i=new ke(0,{colors:r}).write(e).toString();return{message:n,args:i}}function tr({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=_e(e);for(let p of t)Gt(p,a,s);let{message:l,args:c}=er(a,r),u=Wt({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:c});throw new no.PrismaClientValidationError(u,{clientVersion:o})}function G(e){return e.replace(/^./,t=>t.toLowerCase())}function oo(e,t,r){let n=G(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Nc({...e,...io(t.name,e,t.result.$allModels),...io(t.name,e,t.result[n])})}function Nc(e){let t=new J,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Bt(e,n=>({...n,needs:r(n.name,new Set)}))}function io(e,t,r){return r?Bt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Lc(t,o,i)})):{}}function Lc(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function so(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function ao(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var rr=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new J;modelExtensionsCache=new J;queryCallbacksCache=new J;clientExtensions=ze(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=ze(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>oo(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=G(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Ne=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new rr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new rr(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var nr=class{constructor(t){this.name=t}};function lo(e){return e instanceof nr}function co(e){return new nr(e)}var uo=Symbol(),dt=class{constructor(t){if(t!==uo)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?ir:t}},ir=new dt(uo);function K(e){return e instanceof dt}var $c={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},po="explicitly `undefined` values are not allowed";function or({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=Ne.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:c,globalOmit:u}){let p=new nn({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:c,globalOmit:u});return{modelName:e,action:$c[t],query:mt(r,p)}}function mt({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:fo(r,n),selection:Vc(e,t,i,n)}}function Vc(e,t,r,n){return e?(t?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):r&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),Bc(e,n)):qc(n,t,r)}function qc(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&Uc(n,t,e),jc(n,r,e),n}function Uc(e,t,r){for(let[n,i]of Object.entries(t)){if(K(i))continue;let o=r.nestSelection(n);if(on(i,o),i===!1||i===void 0){e[n]=!1;continue}let s=r.findField(n);if(s&&s.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),s){e[n]=mt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=mt(i,o)}}function jc(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=ao(i,n);for(let[s,a]of Object.entries(o)){if(K(a))continue;on(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function Bc(e,t){let r={},n=t.getComputedFields(),i=so(e,n);for(let[o,s]of Object.entries(i)){if(K(s))continue;let a=t.nestSelection(o);on(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||K(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=mt({},a):r[o]=!0;continue}r[o]=mt(s,a)}}return r}function mo(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(Se(e)){if(Qt(e))return{$type:"DateTime",value:e.toISOString()};t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(lo(e))return{$type:"Param",value:e.name};if(De(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return Qc(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:Buffer.from(r,n,i).toString("base64")}}if(Hc(e))return e.values;if(Ce(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof se.ObjectEnumValue){if(!(0,se.isDbNull)(e)&&!(0,se.isJsonNull)(e)&&!(0,se.isAnyNull)(e))throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(Jc(e))return e.toJSON();if(typeof e=="object")return fo(e,t);t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function fo(e,t){if(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);K(i)||(i!==void 0?r[n]=mo(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:po}))}return r}function Qc(e,t){let r=[];for(let n=0;n<e.length;n++){let i=t.nestArgument(String(n)),o=e[n];if(o===void 0||K(o)){let s=o===void 0?"undefined":"Prisma.skip";t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:i.getSelectionPath(),argumentPath:i.getArgumentPath(),argument:{name:`${t.getArgumentName()}[${n}]`,typeNames:[]},underlyingError:`Can not use \`${s}\` value within array. Use \`null\` or filter out \`${s}\` values`})}r.push(mo(o,i))}return r}function Hc(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function Jc(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function on(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:po})}var nn=class e{constructor(t){this.params=t;this.params.modelName&&(this.modelOrType=this.params.runtimeDataModel.models[this.params.modelName]??this.params.runtimeDataModel.types[this.params.modelName])}modelOrType;throwValidationError(t){tr({errors:[t],originalMethod:this.params.originalMethod,args:this.params.rootArgs??{},callsite:this.params.callsite,errorFormat:this.params.errorFormat,clientVersion:this.params.clientVersion,globalOmit:this.params.globalOmit})}getSelectionPath(){return this.params.selectionPath}getArgumentPath(){return this.params.argumentPath}getArgumentName(){return this.params.argumentPath[this.params.argumentPath.length-1]}getOutputTypeDescription(){if(!(!this.params.modelName||!this.modelOrType))return{name:this.params.modelName,fields:this.modelOrType.fields.map(t=>({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[ie(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:Y(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};function go(e,t){let r=ze(()=>Wc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function Wc(e){return{datamodel:{models:sn(e.models),enums:sn(e.enums),types:sn(e.types)}}}function sn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var an=new WeakMap,sr="$$PrismaTypedSql",ft=class{constructor(t,r){an.set(this,{sql:t,values:r}),Object.defineProperty(this,sr,{value:sr})}get sql(){return an.get(this).sql}get values(){return an.get(this).values}};function yo(e){return(...t)=>new ft(e,t)}function ar(e){return e!=null&&e[sr]===sr}var sl=require("@prisma/client-runtime-utils");var al=require("node:async_hooks"),ll=require("node:events");function gt(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function M(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function fe(e){let t=new J;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var lr={enumerable:!0,configurable:!0,writable:!0};function cr(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>lr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var ho=Symbol.for("nodejs.util.inspect.custom");function Q(e,t){let r=Gc(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=wo(Reflect.ownKeys(o),r),a=wo(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...lr,...l?.getPropertyDescriptor(s)}:lr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[ho]=function(){let o={...this};return delete o[ho],o},i}function Gc(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function wo(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Le(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function xo(e){if(e===void 0)return"";let t=_e(e);return new ke(0,{colors:Zt}).write(t).toString()}var yt="<unknown>";function bo(e){var t=e.split(`
15
+ `);return t.reduce(function(r,n){var i=Zc(n)||Yc(n)||ru(n)||su(n)||iu(n);return i&&r.push(i),r},[])}var Kc=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,zc=/\((\S*)(?::(\d+))(?::(\d+))\)/;function Zc(e){var t=Kc.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=zc.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||yt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Xc=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Yc(e){var t=Xc.exec(e);return t?{file:t[2],methodName:t[1]||yt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var eu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,tu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function ru(e){var t=eu.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=tu.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||yt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var nu=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function iu(e){var t=nu.exec(e);return t?{file:t[3],methodName:t[1]||yt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var ou=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function su(e){var t=ou.exec(e);return t?{file:t[2],methodName:t[1]||yt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var ln=class{getLocation(){return null}},cn=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=bo(t).find(i=>{if(!i.file)return!1;let o=zr(i.file);return o!=="<anonymous>"&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/client.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function ae(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new ln:new cn}var Eo={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function $e(e={}){let t=lu(e);return Object.entries(t).reduce((n,[i,o])=>(Eo[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function lu(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function ur(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function To(e,t){let r=ur(e);return t({action:"aggregate",unpacker:r,argsMapper:$e})(e)}function cu(e={}){let{select:t,...r}=e;return typeof t=="object"?$e({...r,_count:t}):$e({...r,_count:{_all:!0}})}function uu(e={}){return typeof e.select=="object"?t=>ur(e)(t)._count:t=>ur(e)(t)._count._all}function Po(e,t){return t({action:"count",unpacker:uu(e),argsMapper:cu})(e)}function pu(e={}){let t=$e(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function du(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Ao(e,t){return t({action:"groupBy",unpacker:du(e),argsMapper:pu})(e)}function vo(e,t,r){if(t==="aggregate")return n=>To(n,r);if(t==="count")return n=>Po(n,r);if(t==="groupBy")return n=>Ao(n,r)}function So(e,t){let r=t.fields.filter(i=>!i.relationName),n=ci(r,"name");return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new pt(e,o,s.type,s.isList,s.kind==="enum")},...cr(Object.keys(n))})}var Co=e=>Array.isArray(e)?e:e.split("."),un=(e,t)=>Co(t).reduce((r,n)=>r&&r[n],e),Ro=(e,t,r)=>Co(t).reduceRight((n,i,o,s)=>Object.assign({},un(e,s.slice(0,o)),{[i]:n}),r);function mu(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function fu(e,t,r){return t===void 0?e??{}:Ro(t,r,e||!0)}function pn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,c)=>({...l,[c.name]:c}),{});return l=>{let c=ae(e._errorFormat),u=mu(n,i),p=fu(l,o,u),y=r({dataPath:u,callsite:c})(p),g=gu(e,t);return new Proxy(y,{get(b,E){if(!g.includes(E))return b[E];let re=[a[E].type,r,E],C=[u,p];return pn(e,...re,...C)},...cr([...g,...Object.getOwnPropertyNames(y)])})}}function gu(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var yu=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],hu=["aggregate","count","groupBy"];function dn(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[wu(e,t),bu(e,t),gt(r),M("name",()=>t),M("$name",()=>t),M("$parent",()=>e._appliedParent)];return Q({},n)}function wu(e,t){let r=G(t),n=Object.keys(Re).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let c=ae(e._errorFormat);return e._createPrismaPromise(u=>{let p={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:u,callsite:c};return e._request({...p,...a})},{action:o,args:l,model:t})};return yu.includes(o)?pn(e,t,s):xu(i)?vo(e,i,s):s({})}}}function xu(e){return hu.includes(e)}function bu(e,t){return fe(M("fields",()=>{let r=e._runtimeDataModel.models[t];return So(t,r)}))}function ko(e){return e.replace(/^./,t=>t.toUpperCase())}var mn=Symbol();function ht(e){let t=[Eu(e),Tu(e),M(mn,()=>e),M("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(gt(r)),Q(e,t)}function Eu(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function Tu(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(G),n=[...new Set(t.concat(r))];return fe({getKeys(){return n},getPropertyValue(i){let o=ko(i);if(e._runtimeDataModel.models[o]!==void 0)return dn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return dn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Oo(e){return e[mn]?e[mn]:e}function Io(e){if(typeof e=="function")return e(this);let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$on:{value:void 0}});return ht(t)}function Fo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let c=l.needs.filter(u=>n[u]);c.length>0&&a.push(Le(c))}else if(r){if(!r[l.name])continue;let c=l.needs.filter(u=>!r[u]);c.length>0&&a.push(Le(c))}Pu(e,l.needs)&&s.push(Au(l,Q(e,s)))}return s.length>0||a.length>0?Q(e,[...s,...a]):e}function Pu(e,t){return t.every(r=>Zr(e,r))}function Au(e,t){return fe(M(e.name,()=>e.compute(t)))}function pr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=pr({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&Mo({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&Mo({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function Mo({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||K(s))continue;let l=n.models[r].fields.find(u=>u.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let c=typeof s=="object"?s:{};t[o]=pr({visitor:i,result:t[o],args:c,modelName:l.type,runtimeDataModel:n})}}function Do({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:pr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,c)=>{let u=G(l);return Fo({result:a,modelName:u,select:c.select,omit:c.select?void 0:{...o?.[u],...c.omit},extensions:n})}})}var ge=require("@prisma/client-runtime-utils");var vu=["$connect","$disconnect","$on","$transaction","$extends"],_o=vu;function No(e){if(e instanceof ge.Sql)return Su(e);if(ar(e))return Cu(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=wt(e[n]);return r}let t={};for(let r in e)t[r]=wt(e[r]);return t}function Su(e){return new ge.Sql(e.strings,e.values)}function Cu(e){return new ft(e.sql,e.values)}function wt(e){if(typeof e!="object"||e==null||e instanceof ge.ObjectEnumValue||De(e))return e;if(Ce(e))return new ge.Decimal(e.toFixed());if(Se(e))return new Date(+e);if(ArrayBuffer.isView(e))return e.slice(0);if(Array.isArray(e)){let t=e.length,r;for(r=Array(t);t--;)r[t]=wt(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:wt(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=wt(e[r]);return t}Y(e,"Unknown value")}function $o(e,t,r,n=0){return e._createPrismaPromise(i=>{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:No(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=jo(o,l),a.args=s,$o(e,a,r,n+1)}})})}function Vo(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return $o(e,t,s)}function qo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Uo(r,n,0,e):e(r)}}function Uo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=jo(i,l),Uo(a,t,r+1,n)}})}var Lo=e=>e;function jo(e=Lo,t=Lo){return r=>e(t(r))}var Go=require("@prisma/client-runtime-utils");var xt=require("@prisma/client-runtime-utils");function x(e,t){throw new Error(t)}function fn(e,t){return e===t||e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>fn(e[r],t[r]))}function Ve(e,t){let r=Object.keys(e),n=Object.keys(t);return(r.length<n.length?r:n).every(o=>{if(typeof e[o]==typeof t[o]&&typeof e[o]!="object")return e[o]===t[o];if(xt.Decimal.isDecimal(e[o])||xt.Decimal.isDecimal(t[o])){let s=Bo(e[o]),a=Bo(t[o]);return s&&a&&s.equals(a)}else if(e[o]instanceof Uint8Array||t[o]instanceof Uint8Array){let s=Qo(e[o]),a=Qo(t[o]);return s&&a&&s.equals(a)}else{if(e[o]instanceof Date||t[o]instanceof Date)return Ho(e[o])?.getTime()===Ho(t[o])?.getTime();if(typeof e[o]=="bigint"||typeof t[o]=="bigint")return Jo(e[o])===Jo(t[o]);if(typeof e[o]=="number"||typeof t[o]=="number")return Wo(e[o])===Wo(t[o])}return fn(e[o],t[o])})}function Bo(e){return xt.Decimal.isDecimal(e)?e:typeof e=="number"||typeof e=="string"?new xt.Decimal(e):void 0}function Qo(e){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e.buffer,e.byteOffset,e.byteLength):typeof e=="string"?Buffer.from(e,"base64"):void 0}function Ho(e){return e instanceof Date?e:typeof e=="string"||typeof e=="number"?new Date(e):void 0}function Jo(e){return typeof e=="bigint"?e:typeof e=="number"||typeof e=="string"?BigInt(e):void 0}function Wo(e){return typeof e=="number"?e:typeof e=="string"?Number(e):void 0}function bt(e){return JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():ArrayBuffer.isView(r)?Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("base64"):r)}function Ru(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function ku(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function le(e){return e===null?e:Array.isArray(e)?e.map(le):typeof e=="object"?Ru(e)?Ou(e):e.constructor!==null&&e.constructor.name!=="Object"?e:ku(e,le):e}function Ou({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"DateTime":return new Date(t);case"Decimal":return new Go.Decimal(t);case"Json":return JSON.parse(t);default:x(t,"Unknown tagged value")}}function dr(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var d={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Character:6,Text:7,Date:8,Time:9,DateTime:10,Json:11,Enum:12,Bytes:13,Set:14,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,EnumArray:76,BytesArray:77,UuidArray:78,UnknownNumber:128};var D=class extends Error{name="UserFacingError";code;meta;constructor(t,r,n){super(t),this.code=r,this.meta=n??{}}toQueryResponseErrorObject(){return{error:this.message,user_facing_error:{is_panic:!1,message:this.message,meta:this.meta,error_code:this.code}}}};function qe(e){if(!dr(e))throw e;let t=Iu(e),r=Ko(e);throw!t||!r?e:new D(r,t,{driverAdapterError:e})}function yn(e){throw dr(e)?new D(`Raw query failed. Code: \`${e.cause.originalCode??"N/A"}\`. Message: \`${e.cause.originalMessage??Ko(e)}\``,"P2010",{driverAdapterError:e}):e}function Iu(e){switch(e.cause.kind){case"AuthenticationFailed":return"P1000";case"DatabaseNotReachable":return"P1001";case"DatabaseDoesNotExist":return"P1003";case"SocketTimeout":return"P1008";case"DatabaseAlreadyExists":return"P1009";case"DatabaseAccessDenied":return"P1010";case"TlsConnectionError":return"P1011";case"ConnectionClosed":return"P1017";case"TransactionAlreadyClosed":return"P1018";case"LengthMismatch":return"P2000";case"UniqueConstraintViolation":return"P2002";case"ForeignKeyConstraintViolation":return"P2003";case"UnsupportedNativeDataType":return"P2010";case"NullConstraintViolation":return"P2011";case"ValueOutOfRange":return"P2020";case"TableDoesNotExist":return"P2021";case"ColumnNotFound":return"P2022";case"InvalidIsolationLevel":case"InconsistentColumnData":return"P2023";case"MissingFullTextSearchIndex":return"P2030";case"TransactionWriteConflict":return"P2034";case"GenericJs":return"P2036";case"TooManyConnections":return"P2037";case"postgres":case"sqlite":case"mysql":case"mssql":return;default:x(e.cause,`Unknown error: ${e.cause}`)}}function Ko(e){switch(e.cause.kind){case"AuthenticationFailed":return`Authentication failed against the database server, the provided database credentials for \`${e.cause.user??"(not available)"}\` are not valid`;case"DatabaseNotReachable":{let t=e.cause.host&&e.cause.port?`${e.cause.host}:${e.cause.port}`:e.cause.host;return`Can't reach database server${t?` at ${t}`:""}`}case"DatabaseDoesNotExist":return`Database \`${e.cause.db??"(not available)"}\` does not exist on the database server`;case"SocketTimeout":return"Operation has timed out";case"DatabaseAlreadyExists":return`Database \`${e.cause.db??"(not available)"}\` already exists on the database server`;case"DatabaseAccessDenied":return`User was denied access on the database \`${e.cause.db??"(not available)"}\``;case"TlsConnectionError":return`Error opening a TLS connection: ${e.cause.reason}`;case"ConnectionClosed":return"Server has closed the connection.";case"TransactionAlreadyClosed":return e.cause.cause;case"LengthMismatch":return`The provided value for the column is too long for the column's type. Column: ${e.cause.column??"(not available)"}`;case"UniqueConstraintViolation":return`Unique constraint failed on the ${gn(e.cause.constraint)}`;case"ForeignKeyConstraintViolation":return`Foreign key constraint violated on the ${gn(e.cause.constraint)}`;case"UnsupportedNativeDataType":return`Failed to deserialize column of type '${e.cause.type}'. If you're using $queryRaw and this column is explicitly marked as \`Unsupported\` in your Prisma schema, try casting this column to any supported Prisma type such as \`String\`.`;case"NullConstraintViolation":return`Null constraint violation on the ${gn(e.cause.constraint)}`;case"ValueOutOfRange":return`Value out of range for the type: ${e.cause.cause}`;case"TableDoesNotExist":return`The table \`${e.cause.table??"(not available)"}\` does not exist in the current database.`;case"ColumnNotFound":return`The column \`${e.cause.column??"(not available)"}\` does not exist in the current database.`;case"InvalidIsolationLevel":return`Error in connector: Conversion error: ${e.cause.level}`;case"InconsistentColumnData":return`Inconsistent column data: ${e.cause.cause}`;case"MissingFullTextSearchIndex":return"Cannot find a fulltext index to use for the native search, try adding a @@fulltext([Fields...]) to your schema";case"TransactionWriteConflict":return"Transaction failed due to a write conflict or a deadlock. Please retry your transaction";case"GenericJs":return`Error in external connector (id ${e.cause.id})`;case"TooManyConnections":return`Too many database connections opened: ${e.cause.cause}`;case"sqlite":case"postgres":case"mysql":case"mssql":return;default:x(e.cause,`Unknown error: ${e.cause}`)}}function gn(e){return e&&"fields"in e?`fields: (${e.fields.map(t=>`\`${t}\``).join(", ")})`:e&&"index"in e?`constraint: \`${e.index}\``:e&&"foreignKey"in e?"foreign key":"(not available)"}function zo(e,t){let r=e.map(i=>t.keys.reduce((o,s)=>(o[s]=le(i[s]),o),{})),n=new Set(t.nestedSelection);return t.arguments.map(i=>{let o=r.findIndex(s=>Ve(s,i));if(o===-1)return t.expectNonEmpty?new D("An operation failed because it depends on one or more records that were required but not found","P2025"):null;{let s=Object.entries(e[o]).filter(([a])=>n.has(a));return Object.fromEntries(s)}})}var Xo=require("@prisma/client-runtime-utils");var A=class extends Error{name="DataMapperError"};function Yo(e,t,r){switch(t.type){case"affectedRows":if(typeof e!="number")throw new A(`Expected an affected rows count, got: ${typeof e} (${e})`);return{count:e};case"object":return wn(e,t.fields,r,t.skipNulls);case"field":return hn(e,"<result>",t.fieldType,r);default:x(t,`Invalid data mapping type: '${t.type}'`)}}function wn(e,t,r,n){if(e===null)return null;if(Array.isArray(e)){let i=e;return n&&(i=i.filter(o=>o!==null)),i.map(o=>Zo(o,t,r))}if(typeof e=="object")return Zo(e,t,r);if(typeof e=="string"){let i;try{i=JSON.parse(e)}catch(o){throw new A("Expected an array or object, got a string that is not valid JSON",{cause:o})}return wn(i,t,r,n)}throw new A(`Expected an array or an object, got: ${typeof e}`)}function Zo(e,t,r){if(typeof e!="object")throw new A(`Expected an object, but got '${typeof e}'`);let n={};for(let[i,o]of Object.entries(t))switch(o.type){case"affectedRows":throw new A(`Unexpected 'AffectedRows' node in data mapping for field '${i}'`);case"object":{if(o.serializedName!==null&&!Object.hasOwn(e,o.serializedName))throw new A(`Missing data field (Object): '${i}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`);let s=o.serializedName!==null?e[o.serializedName]:e;n[i]=wn(s,o.fields,r,o.skipNulls);break}case"field":{let s=o.dbName;if(Object.hasOwn(e,s))n[i]=Fu(e[s],s,o.fieldType,r);else throw new A(`Missing data field (Value): '${s}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`)}break;default:x(o,`DataMapper: Invalid data mapping node type: '${o.type}'`)}return n}function Fu(e,t,r,n){return e===null?r.arity==="list"?[]:null:r.arity==="list"?e.map((o,s)=>hn(o,`${t}[${s}]`,r,n)):hn(e,t,r,n)}function hn(e,t,r,n){switch(r.type){case"unsupported":return e;case"string":{if(typeof e!="string")throw new A(`Expected a string in column '${t}', got ${typeof e}: ${e}`);return e}case"int":switch(typeof e){case"number":return Math.trunc(e);case"string":{let i=Math.trunc(Number(e));if(Number.isNaN(i)||!Number.isFinite(i))throw new A(`Expected an integer in column '${t}', got string: ${e}`);if(!Number.isSafeInteger(i))throw new A(`Integer value in column '${t}' is too large to represent as a JavaScript number without loss of precision, got: ${e}. Consider using BigInt type.`);return i}default:throw new A(`Expected an integer in column '${t}', got ${typeof e}: ${e}`)}case"bigint":{if(typeof e!="number"&&typeof e!="string")throw new A(`Expected a bigint in column '${t}', got ${typeof e}: ${e}`);return{$type:"BigInt",value:e}}case"float":{if(typeof e=="number")return e;if(typeof e=="string"){let i=Number(e);if(Number.isNaN(i)&&!/^[-+]?nan$/.test(e.toLowerCase()))throw new A(`Expected a float in column '${t}', got string: ${e}`);return i}throw new A(`Expected a float in column '${t}', got ${typeof e}: ${e}`)}case"boolean":{if(typeof e=="boolean")return e;if(typeof e=="number")return e===1;if(typeof e=="string"){if(e==="true"||e==="TRUE"||e==="1")return!0;if(e==="false"||e==="FALSE"||e==="0")return!1;throw new A(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`)}if(Array.isArray(e)){for(let i of e)if(i!==0)return!0;return!1}throw new A(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`)}case"decimal":if(typeof e!="number"&&typeof e!="string"&&!Xo.Decimal.isDecimal(e))throw new A(`Expected a decimal in column '${t}', got ${typeof e}: ${e}`);return{$type:"Decimal",value:e};case"datetime":{if(typeof e=="string")return{$type:"DateTime",value:Du(e)};if(typeof e=="number"||e instanceof Date)return{$type:"DateTime",value:e};throw new A(`Expected a date in column '${t}', got ${typeof e}: ${e}`)}case"object":return{$type:"Json",value:bt(e)};case"json":return{$type:"Json",value:`${e}`};case"bytes":{switch(r.encoding){case"base64":if(typeof e!="string")throw new A(`Expected a base64-encoded byte array in column '${t}', got ${typeof e}: ${e}`);return{$type:"Bytes",value:e};case"hex":if(typeof e!="string"||!e.startsWith("\\x"))throw new A(`Expected a hex-encoded byte array in column '${t}', got ${typeof e}: ${e}`);return{$type:"Bytes",value:Buffer.from(e.slice(2),"hex").toString("base64")};case"array":if(Array.isArray(e))return{$type:"Bytes",value:Buffer.from(e).toString("base64")};if(e instanceof Uint8Array)return{$type:"Bytes",value:Buffer.from(e).toString("base64")};throw new A(`Expected a byte array in column '${t}', got ${typeof e}: ${e}`);default:x(r.encoding,`DataMapper: Unknown bytes encoding: ${r.encoding}`)}break}case"enum":{let i=n[r.name];if(i===void 0)throw new A(`Unknown enum '${r.name}'`);let o=i[`${e}`];if(o===void 0)throw new A(`Value '${e}' not found in enum '${r.name}'`);return o}default:x(r,`DataMapper: Unknown result type: ${r.type}`)}}var Mu=/\d{2}:\d{2}:\d{2}(?:\.\d+)?(Z|[+-]\d{2}(:?\d{2})?)?$/;function Du(e){let t=Mu.exec(e);if(t===null)return`${e}T00:00:00Z`;let r=e,[n,i,o]=t;if(i!==void 0&&i!=="Z"&&o===void 0?r=`${e}:00`:i===void 0&&(r=`${e}Z`),n.length===e.length)return`1970-01-01T${r}`;let s=t.index-1;return r[s]===" "&&(r=`${r.slice(0,s)}T${r.slice(s+1)}`),r}var Et;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(Et||(Et={}));function _u(e){switch(e){case"postgresql":case"postgres":case"prisma+postgres":return"postgresql";case"sqlserver":return"mssql";case"mysql":case"sqlite":case"cockroachdb":case"mongodb":return e;default:x(e,`Unknown provider: ${e}`)}}async function mr({query:e,tracingHelper:t,provider:r,onQuery:n,execute:i}){return await t.runInChildSpan({name:"db_query",kind:Et.CLIENT,attributes:{"db.query.text":e.sql,"db.system.name":_u(r)}},async()=>{let o=new Date,s=performance.now(),a=await i(),l=performance.now();return n?.({timestamp:o,duration:l-s,query:e.sql,params:e.args}),a})}function ye(e,t){var r="000000000"+e;return r.substr(r.length-t)}var es=q(require("node:os"),1);function Nu(){try{return es.default.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var ts=2,Lu=ye(process.pid.toString(36),ts),rs=Nu(),$u=rs.length,Vu=ye(rs.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+$u+36).toString(36),ts);function xn(){return Lu+Vu}function fr(e){return typeof e=="string"&&/^c[a-z0-9]{20,32}$/.test(e)}function bn(e){let n=Math.pow(36,4),i=0;function o(){return ye((Math.random()*n<<0).toString(36),4)}function s(){return i=i<n?i:0,i++,i-1}function a(){var l="c",c=new Date().getTime().toString(36),u=ye(s().toString(36),4),p=e(),y=o()+o();return l+c+u+p+y}return a.fingerprint=e,a.isCuid=fr,a}var qu=bn(xn);var ns=qu;var ra=q(Ws());var kn=require("node:crypto");var Gs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Sp=128,we,Be;function Cp(e){!we||we.length<e?(we=Buffer.allocUnsafe(e*Sp),kn.webcrypto.getRandomValues(we),Be=0):Be+e>we.length&&(kn.webcrypto.getRandomValues(we),Be=0),Be+=e}function On(e=21){Cp(e|=0);let t="";for(let r=Be-e;r<Be;r++)t+=Gs[we[r]&63];return t}var Ct=q(require("node:crypto"),1);var zs="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Rt=32;var Rp=16,Zs=10,Ks=0xffffffffffff;var xe;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(xe||(xe={}));var be=class extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}};function kp(e){let t=Math.floor(e()*Rt);return t===Rt&&(t=Rt-1),zs.charAt(t)}function Op(e){let t=Ip(),r=t&&(t.crypto||t.msCrypto)||(typeof Ct.default<"u"?Ct.default:null);if(typeof r?.getRandomValues=="function")return()=>{let n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof r?.randomBytes=="function")return()=>r.randomBytes(1).readUInt8()/255;if(Ct.default?.randomBytes)return()=>Ct.default.randomBytes(1).readUInt8()/255;throw new be(xe.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Ip(){return Dp()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Fp(e,t){let r="";for(;e>0;e--)r=kp(t)+r;return r}function Mp(e,t=Zs){if(isNaN(e))throw new be(xe.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Ks)throw new be(xe.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Ks}: ${e}`);if(e<0)throw new be(xe.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new be(xe.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%Rt,n=zs.charAt(r)+n,e=(e-r)/Rt;return n}function Dp(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Xs(e,t){let r=t||Op(),n=!e||isNaN(e)?Date.now():e;return Mp(n,Zs)+Fp(Rp,r)}var k=[];for(let e=0;e<256;++e)k.push((e+256).toString(16).slice(1));function wr(e,t=0){return(k[e[t+0]]+k[e[t+1]]+k[e[t+2]]+k[e[t+3]]+"-"+k[e[t+4]]+k[e[t+5]]+"-"+k[e[t+6]]+k[e[t+7]]+"-"+k[e[t+8]]+k[e[t+9]]+"-"+k[e[t+10]]+k[e[t+11]]+k[e[t+12]]+k[e[t+13]]+k[e[t+14]]+k[e[t+15]]).toLowerCase()}var Ys=require("node:crypto"),br=new Uint8Array(256),xr=br.length;function Qe(){return xr>br.length-16&&((0,Ys.randomFillSync)(br),xr=0),br.slice(xr,xr+=16)}var ea=require("node:crypto"),In={randomUUID:ea.randomUUID};function _p(e,t,r){if(In.randomUUID&&!t&&!e)return In.randomUUID();e=e||{};let n=e.random??e.rng?.()??Qe();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return wr(n)}var Fn=_p;var Mn={};function Np(e,t,r){let n;if(e)n=ta(e.random??e.rng?.()??Qe(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=Qe();Lp(Mn,i,o),n=ta(o,Mn.msecs,Mn.seq,t,r)}return t??wr(n)}function Lp(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function ta(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}var Dn=Np;var Er=class{#t={};constructor(){this.register("uuid",new Nn),this.register("cuid",new Ln),this.register("ulid",new $n),this.register("nanoid",new Vn),this.register("product",new qn)}snapshot(){return Object.create(this.#t,{now:{value:new _n}})}register(t,r){this.#t[t]=r}},_n=class{#t=new Date;generate(){return this.#t.toISOString()}},Nn=class{generate(t){if(t===4)return Fn();if(t===7)return Dn();throw new Error("Invalid UUID generator arguments")}},Ln=class{generate(t){if(t===1)return ns();if(t===2)return(0,ra.createId)();throw new Error("Invalid CUID generator arguments")}},$n=class{generate(){return Xs()}},Vn=class{generate(t){if(typeof t=="number")return On(t);if(t===void 0)return On();throw new Error("Invalid Nanoid generator arguments")}},qn=class{generate(t,r){if(t===void 0||r===void 0)throw new Error("Invalid Product generator arguments");return Array.isArray(t)&&Array.isArray(r)?t.flatMap(n=>r.map(i=>[n,i])):Array.isArray(t)?t.map(n=>[n,r]):Array.isArray(r)?r.map(n=>[t,n]):[[t,r]]}};function Tr(e,t){return e==null?e:typeof e=="string"?Tr(JSON.parse(e),t):Array.isArray(e)?Vp(e,t):$p(e,t)}function $p(e,t){if(t.pagination){let{skip:r,take:n,cursor:i}=t.pagination;if(r!==null&&r>0||n===0||i!==null&&!Ve(e,i))return null}return ia(e,t.nested)}function ia(e,t){for(let[r,n]of Object.entries(t))e[r]=Tr(e[r],n);return e}function Vp(e,t){if(t.distinct!==null){let r=t.linkingFields!==null?[...t.distinct,...t.linkingFields]:t.distinct;e=qp(e,r)}return t.pagination&&(e=Up(e,t.pagination,t.linkingFields)),t.reverse&&e.reverse(),Object.keys(t.nested).length===0?e:e.map(r=>ia(r,t.nested))}function qp(e,t){let r=new Set,n=[];for(let i of e){let o=He(i,t);r.has(o)||(r.add(o),n.push(i))}return n}function Up(e,t,r){if(r===null)return na(e,t);let n=new Map;for(let o of e){let s=He(o,r);n.has(s)||n.set(s,[]),n.get(s).push(o)}let i=Array.from(n.entries());return i.sort(([o],[s])=>o<s?-1:o>s?1:0),i.flatMap(([,o])=>na(o,t))}function na(e,{cursor:t,skip:r,take:n}){let i=t!==null?e.findIndex(a=>Ve(a,t)):0;if(i===-1)return[];let o=i+(r??0),s=n!==null?o+n:e.length;return e.slice(o,s)}function He(e,t){return JSON.stringify(t.map(r=>e[r]))}function Un(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}function jn(e){return typeof e=="object"&&e!==null&&e.prisma__type==="generatorCall"}function Hn(e,t,r,n){let i=e.args.map(o=>H(o,t,r));switch(e.type){case"rawSql":return[Qp(e.sql,i,e.argTypes)];case"templateSql":return(e.chunkable?Jp(e.fragments,i,n):[i]).map(s=>{if(n!==void 0&&s.length>n)throw new D("The query parameter limit supported by your database is exceeded.","P2029");return jp(e.fragments,e.placeholderFormat,s,e.argTypes)});default:x(e.type,"Invalid query type")}}function H(e,t,r){for(;Hp(e);)if(Un(e)){let n=t[e.prisma__value.name];if(n===void 0)throw new Error(`Missing value for query variable ${e.prisma__value.name}`);e=n}else if(jn(e)){let{name:n,args:i}=e.prisma__value,o=r[n];if(!o)throw new Error(`Encountered an unknown generator '${n}'`);e=o.generate(...i.map(s=>H(s,t,r)))}else x(e,`Unexpected unevaluated value type: ${e}`);return Array.isArray(e)&&(e=e.map(n=>H(n,t,r))),e}function jp(e,t,r,n){let i="",o={placeholderNumber:1},s=[],a=[];for(let l of Qn(e,r,n)){if(i+=Bp(l,t,o),l.type==="stringChunk")continue;let c=s.length,u=s.push(...oa(l))-c;if(l.argType.arity==="tuple"){if(u%l.argType.elements.length!==0)throw new Error(`Malformed query template. Expected the number of parameters to match the tuple arity, but got ${u} parameters for a tuple of arity ${l.argType.elements.length}.`);for(let p=0;p<u/l.argType.elements.length;p++)a.push(...l.argType.elements)}else for(let p=0;p<u;p++)a.push(l.argType)}return{sql:i,args:s,argTypes:a}}function Bp(e,t,r){let n=e.type;switch(n){case"parameter":return Bn(t,r.placeholderNumber++);case"stringChunk":return e.chunk;case"parameterTuple":return`(${e.value.length==0?"NULL":e.value.map(()=>Bn(t,r.placeholderNumber++)).join(",")})`;case"parameterTupleList":return e.value.map(i=>{let o=i.map(()=>Bn(t,r.placeholderNumber++)).join(e.itemSeparator);return`${e.itemPrefix}${o}${e.itemSuffix}`}).join(e.groupSeparator);default:x(n,"Invalid fragment type")}}function Bn(e,t){return e.hasNumbering?`${e.prefix}${t}`:e.prefix}function Qp(e,t,r){return{sql:e,args:t,argTypes:r}}function Hp(e){return Un(e)||jn(e)}function*Qn(e,t,r){let n=0;for(let i of e)switch(i.type){case"parameter":{if(n>=t.length)throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);yield{...i,value:t[n],argType:r?.[n]},n++;break}case"stringChunk":{yield i;break}case"parameterTuple":{if(n>=t.length)throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);let o=t[n];yield{...i,value:Array.isArray(o)?o:[o],argType:r?.[n]},n++;break}case"parameterTupleList":{if(n>=t.length)throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);let o=t[n];if(!Array.isArray(o))throw new Error("Malformed query template. Tuple list expected.");if(o.length===0)throw new Error("Malformed query template. Tuple list cannot be empty.");for(let s of o)if(!Array.isArray(s))throw new Error("Malformed query template. Tuple expected.");yield{...i,value:o,argType:r?.[n]},n++;break}}}function*oa(e){switch(e.type){case"parameter":yield e.value;break;case"stringChunk":break;case"parameterTuple":yield*e.value;break;case"parameterTupleList":for(let t of e.value)yield*t;break}}function Jp(e,t,r){let n=0,i=0;for(let s of Qn(e,t,void 0)){let a=0;for(let l of oa(s))a++;i=Math.max(i,a),n+=a}let o=[[]];for(let s of Qn(e,t,void 0))switch(s.type){case"parameter":{for(let a of o)a.push(s.value);break}case"stringChunk":break;case"parameterTuple":{let a=s.value.length,l=[];if(r&&o.length===1&&a===i&&n>r&&n-a<r){let c=r-(n-a);l=Wp(s.value,c)}else l=[s.value];o=o.flatMap(c=>l.map(u=>[...c,u]));break}case"parameterTupleList":{let a=s.value.reduce((p,y)=>p+y.length,0),l=[],c=[],u=0;for(let p of s.value)r&&o.length===1&&a===i&&c.length>0&&n-a+u+p.length>r&&(l.push(c),c=[],u=0),c.push(p),u+=p.length;c.length>0&&l.push(c),o=o.flatMap(p=>l.map(y=>[...p,y]));break}}return o}function Wp(e,t){let r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function sa(e){return e.rows.map(t=>t.reduce((r,n,i)=>(r[e.columnNames[i]]=n,r),{}))}function aa(e){return{columns:e.columnNames,types:e.columnTypes.map(t=>Gp(t)),rows:e.rows.map(t=>t.map((r,n)=>Je(r,e.columnTypes[n])))}}function Je(e,t){if(e===null)return null;switch(t){case d.Int32:switch(typeof e){case"number":return Math.trunc(e);case"string":return Math.trunc(Number(e));default:throw new Error(`Cannot serialize value of type ${typeof e} as Int32`)}case d.Int32Array:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as Int32Array`);return e.map(r=>Je(r,d.Int32));case d.Int64:switch(typeof e){case"number":return BigInt(Math.trunc(e));case"string":return e;default:throw new Error(`Cannot serialize value of type ${typeof e} as Int64`)}case d.Int64Array:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as Int64Array`);return e.map(r=>Je(r,d.Int64));case d.Json:switch(typeof e){case"string":return JSON.parse(e);default:throw new Error(`Cannot serialize value of type ${typeof e} as Json`)}case d.JsonArray:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as JsonArray`);return e.map(r=>Je(r,d.Json));case d.Bytes:if(Array.isArray(e))return new Uint8Array(e);throw new Error(`Cannot serialize value of type ${typeof e} as Bytes`);case d.BytesArray:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as BytesArray`);return e.map(r=>Je(r,d.Bytes));case d.Boolean:switch(typeof e){case"boolean":return e;case"string":return e==="true"||e==="1";case"number":return e===1;default:throw new Error(`Cannot serialize value of type ${typeof e} as Boolean`)}case d.BooleanArray:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as BooleanArray`);return e.map(r=>Je(r,d.Boolean));default:return e}}function Gp(e){switch(e){case d.Int32:return"int";case d.Int64:return"bigint";case d.Float:return"float";case d.Double:return"double";case d.Text:return"string";case d.Enum:return"enum";case d.Bytes:return"bytes";case d.Boolean:return"bool";case d.Character:return"char";case d.Numeric:return"decimal";case d.Json:return"json";case d.Uuid:return"uuid";case d.DateTime:return"datetime";case d.Date:return"date";case d.Time:return"time";case d.Int32Array:return"int-array";case d.Int64Array:return"bigint-array";case d.FloatArray:return"float-array";case d.DoubleArray:return"double-array";case d.TextArray:return"string-array";case d.EnumArray:return"string-array";case d.BytesArray:return"bytes-array";case d.BooleanArray:return"bool-array";case d.CharacterArray:return"char-array";case d.NumericArray:return"decimal-array";case d.JsonArray:return"json-array";case d.UuidArray:return"uuid-array";case d.DateTimeArray:return"datetime-array";case d.DateArray:return"date-array";case d.TimeArray:return"time-array";case d.UnknownNumber:return"unknown";case d.Set:return"string";default:x(e,`Unexpected column type: ${e}`)}}function la(e,t,r){if(!t.every(n=>Jn(e,n))){let n=Kp(e,r),i=zp(r);throw new D(n,i,r.context)}}function Jn(e,t){switch(t.type){case"rowCountEq":return Array.isArray(e)?e.length===t.args:e===null?t.args===0:t.args===1;case"rowCountNeq":return Array.isArray(e)?e.length!==t.args:e===null?t.args!==0:t.args!==1;case"affectedRowCountEq":return e===t.args;case"never":return!1;default:x(t,`Unknown rule type: ${t.type}`)}}function Kp(e,t){switch(t.error_identifier){case"RELATION_VIOLATION":return`The change you are trying to make would violate the required relation '${t.context.relation}' between the \`${t.context.modelA}\` and \`${t.context.modelB}\` models.`;case"MISSING_RECORD":return`An operation failed because it depends on one or more records that were required but not found. No record was found for ${t.context.operation}.`;case"MISSING_RELATED_RECORD":{let r=t.context.neededFor?` (needed to ${t.context.neededFor})`:"";return`An operation failed because it depends on one or more records that were required but not found. No '${t.context.model}' record${r} was found for ${t.context.operation} on ${t.context.relationType} relation '${t.context.relation}'.`}case"INCOMPLETE_CONNECT_INPUT":return`An operation failed because it depends on one or more records that were required but not found. Expected ${t.context.expectedRows} records to be connected, found only ${Array.isArray(e)?e.length:e}.`;case"INCOMPLETE_CONNECT_OUTPUT":return`The required connected records were not found. Expected ${t.context.expectedRows} records to be connected after connect operation on ${t.context.relationType} relation '${t.context.relation}', found ${Array.isArray(e)?e.length:e}.`;case"RECORDS_NOT_CONNECTED":return`The records for relation \`${t.context.relation}\` between the \`${t.context.parent}\` and \`${t.context.child}\` models are not connected.`;default:x(t,`Unknown error identifier: ${t}`)}}function zp(e){switch(e.error_identifier){case"RELATION_VIOLATION":return"P2014";case"RECORDS_NOT_CONNECTED":return"P2017";case"INCOMPLETE_CONNECT_OUTPUT":return"P2018";case"MISSING_RECORD":case"MISSING_RELATED_RECORD":case"INCOMPLETE_CONNECT_INPUT":return"P2025";default:x(e,`Unknown error identifier: ${e}`)}}var kt=class e{#t;#e;#r;#n=new Er;#s;#i;#a;#o;#c;constructor({transactionManager:t,placeholderValues:r,onQuery:n,tracingHelper:i,serializer:o,rawSerializer:s,provider:a,connectionInfo:l}){this.#t=t,this.#e=r,this.#r=n,this.#s=i,this.#i=o,this.#a=s??o,this.#o=a,this.#c=l}static forSql(t){return new e({transactionManager:t.transactionManager,placeholderValues:t.placeholderValues,onQuery:t.onQuery,tracingHelper:t.tracingHelper,serializer:sa,rawSerializer:aa,provider:t.provider,connectionInfo:t.connectionInfo})}async run(t,r){let{value:n}=await this.interpretNode(t,r,this.#e,this.#n.snapshot()).catch(i=>qe(i));return n}async interpretNode(t,r,n,i){switch(t.type){case"value":return{value:H(t.args,n,i)};case"seq":{let o;for(let s of t.args)o=await this.interpretNode(s,r,n,i);return o??{value:void 0}}case"get":return{value:n[t.args.name]};case"let":{let o=Object.create(n);for(let s of t.args.bindings){let{value:a}=await this.interpretNode(s.expr,r,o,i);o[s.name]=a}return this.interpretNode(t.args.expr,r,o,i)}case"getFirstNonEmpty":{for(let o of t.args.names){let s=n[o];if(!ca(s))return{value:s}}return{value:[]}}case"concat":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i).then(a=>a.value)));return{value:o.length>0?o.reduce((s,a)=>s.concat(Wn(a)),[]):[]}}case"sum":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i).then(a=>a.value)));return{value:o.length>0?o.reduce((s,a)=>z(s)+z(a)):0}}case"execute":{let o=Hn(t.args,n,i,this.#l()),s=0;for(let a of o)s+=await this.#u(a,r,()=>r.executeRaw(a).catch(l=>t.args.type==="rawSql"?yn(l):qe(l)));return{value:s}}case"query":{let o=Hn(t.args,n,i,this.#l()),s;for(let a of o){let l=await this.#u(a,r,()=>r.queryRaw(a).catch(c=>t.args.type==="rawSql"?yn(c):qe(c)));s===void 0?s=l:(s.rows.push(...l.rows),s.lastInsertId=l.lastInsertId)}return{value:t.args.type==="rawSql"?this.#a(s):this.#i(s),lastInsertId:s?.lastInsertId}}case"reverse":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args,r,n,i);return{value:Array.isArray(o)?o.reverse():o,lastInsertId:s}}case"unique":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args,r,n,i);if(!Array.isArray(o))return{value:o,lastInsertId:s};if(o.length>1)throw new Error(`Expected zero or one element, got ${o.length}`);return{value:o[0]??null,lastInsertId:s}}case"required":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args,r,n,i);if(ca(o))throw new Error("Required value is empty");return{value:o,lastInsertId:s}}case"mapField":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.records,r,n,i);return{value:ua(o,t.args.field),lastInsertId:s}}case"join":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.parent,r,n,i);if(o===null)return{value:null,lastInsertId:s};let a=await Promise.all(t.args.children.map(async l=>({joinExpr:l,childRecords:(await this.interpretNode(l.child,r,n,i)).value})));return{value:Zp(o,a),lastInsertId:s}}case"transaction":{if(!this.#t.enabled)return this.interpretNode(t.args,r,n,i);let o=this.#t.manager,s=await o.startInternalTransaction(),a=await o.getTransaction(s,"query");try{let l=await this.interpretNode(t.args,a,n,i);return await o.commitTransaction(s.id),l}catch(l){throw await o.rollbackTransaction(s.id),l}}case"dataMap":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i);return{value:Yo(o,t.args.structure,t.args.enums),lastInsertId:s}}case"validate":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i);return la(o,t.args.rules,t.args),{value:o,lastInsertId:s}}case"if":{let{value:o}=await this.interpretNode(t.args.value,r,n,i);return Jn(o,t.args.rule)?await this.interpretNode(t.args.then,r,n,i):await this.interpretNode(t.args.else,r,n,i)}case"unit":return{value:void 0};case"diff":{let{value:o}=await this.interpretNode(t.args.from,r,n,i),{value:s}=await this.interpretNode(t.args.to,r,n,i),a=c=>c!==null?He(Pr(c),t.args.fields):null,l=new Set(Wn(s).map(a));return{value:Wn(o).filter(c=>!l.has(a(c)))}}case"process":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i);return{value:Tr(o,t.args.operations),lastInsertId:s}}case"initializeRecord":{let{lastInsertId:o}=await this.interpretNode(t.args.expr,r,n,i),s={};for(let[a,l]of Object.entries(t.args.fields))s[a]=Xp(l,o,n,i);return{value:s,lastInsertId:o}}case"mapRecord":{let{value:o,lastInsertId:s}=await this.interpretNode(t.args.expr,r,n,i),a=o===null?{}:Pr(o);for(let[l,c]of Object.entries(t.args.fields))a[l]=Yp(c,a[l],n,i);return{value:a,lastInsertId:s}}default:x(t,`Unexpected node type: ${t.type}`)}}#l(){return this.#c?.maxBindValues!==void 0?this.#c.maxBindValues:this.#p()}#p(){if(this.#o!==void 0)switch(this.#o){case"cockroachdb":case"postgres":case"postgresql":case"prisma+postgres":return 32766;case"mysql":return 65535;case"sqlite":return 999;case"sqlserver":return 2098;case"mongodb":return;default:x(this.#o,`Unexpected provider: ${this.#o}`)}}#u(t,r,n){return mr({query:t,execute:n,provider:this.#o??r.provider,tracingHelper:this.#s,onQuery:this.#r})}};function ca(e){return Array.isArray(e)?e.length===0:e==null}function Wn(e){return Array.isArray(e)?e:[e]}function z(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function Pr(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Expected object, got ${typeof e}`)}function ua(e,t){return Array.isArray(e)?e.map(r=>ua(r,t)):typeof e=="object"&&e!==null?e[t]??null:e}function Zp(e,t){for(let{joinExpr:r,childRecords:n}of t){let i=r.on.map(([a])=>a),o=r.on.map(([,a])=>a),s={};for(let a of Array.isArray(e)?e:[e]){let l=Pr(a),c=He(l,i);s[c]||(s[c]=[]),s[c].push(l),r.isRelationUnique?l[r.parentField]=null:l[r.parentField]=[]}for(let a of Array.isArray(n)?n:[n]){if(a===null)continue;let l=He(Pr(a),o);for(let c of s[l]??[])r.isRelationUnique?c[r.parentField]=a:c[r.parentField].push(a)}}return e}function Xp(e,t,r,n){switch(e.type){case"value":return H(e.value,r,n);case"lastInsertId":return t;default:x(e,`Unexpected field initializer type: ${e.type}`)}}function Yp(e,t,r,n){switch(e.type){case"set":return H(e.value,r,n);case"add":return z(t)+z(H(e.value,r,n));case"subtract":return z(t)-z(H(e.value,r,n));case"multiply":return z(t)*z(H(e.value,r,n));case"divide":{let i=z(t),o=z(H(e.value,r,n));return o===0?null:i/o}default:x(e,`Unexpected field operation type: ${e.type}`)}}async function ed(){return globalThis.crypto??await import("node:crypto")}async function pa(){return(await ed()).randomUUID()}var U=class extends D{name="TransactionManagerError";constructor(t,r){super("Transaction API error: "+t,"P2028",r)}},Ot=class extends U{constructor(){super("Transaction not found. Transaction ID is invalid, refers to an old closed transaction Prisma doesn't have information about anymore, or was obtained before disconnecting.")}},Ar=class extends U{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction.`)}},vr=class extends U{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back.`)}},Sr=class extends U{constructor(){super("Unable to start a transaction in the given time.")}},Cr=class extends U{constructor(t,{timeout:r,timeTaken:n}){super(`A ${t} cannot be executed on an expired transaction. The timeout for this transaction was ${r} ms, however ${n} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction.`,{operation:t,timeout:r,timeTaken:n})}},We=class extends U{constructor(t){super(`Internal Consistency Error: ${t}`)}},Rr=class extends U{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var td=100,It=I("prisma:client:transactionManager"),rd=()=>({sql:"COMMIT",args:[],argTypes:[]}),nd=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),id=()=>({sql:'-- Implicit "COMMIT" query via underlying driver',args:[],argTypes:[]}),od=()=>({sql:'-- Implicit "ROLLBACK" query via underlying driver',args:[],argTypes:[]}),Ft=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;#t;#e;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n,onQuery:i,provider:o}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n,this.#t=i,this.#e=o}async startInternalTransaction(t){let r=t!==void 0?this.#a(t):{};return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(r))}async startTransaction(t){let r=t!==void 0?this.#a(t):this.transactionOptions;return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(r))}async#r(t){let r={id:await pa(),status:"waiting",timer:void 0,timeout:t.timeout,startedAt:Date.now(),transaction:void 0};this.transactions.set(r.id,r);let n=!1,i=da(()=>n=!0,t.maxWait);switch(i?.unref?.(),r.transaction=await this.driverAdapter.startTransaction(t.isolationLevel).catch(qe),clearTimeout(i),r.status){case"waiting":if(n)throw await this.#i(r,"timed_out"),new Sr;return r.status="running",r.timer=this.#s(r.id,t.timeout),{id:r.id};case"timed_out":case"running":case"committed":case"rolled_back":throw new We(`Transaction in invalid state ${r.status} although it just finished startup.`);default:x(r.status,"Unknown transaction status.")}}async commitTransaction(t){return await this.tracingHelper.runInChildSpan("commit_transaction",async()=>{let r=this.#n(t,"commit");await this.#i(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.#n(t,"rollback");await this.#i(r,"rolled_back")})}async getTransaction(t,r){let n=this.#n(t.id,r);if(n.status==="closing"&&(await n.closing,n=this.#n(t.id,r)),!n.transaction)throw new Ot;return n.transaction}#n(t,r){let n=this.transactions.get(t);if(!n){let i=this.closedTransactions.find(o=>o.id===t);if(i)switch(It("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"closing":case"waiting":case"running":throw new We("Active transaction found in closed transactions list.");case"committed":throw new Ar(r);case"rolled_back":throw new vr(r);case"timed_out":throw new Cr(r,{timeout:i.timeout,timeTaken:Date.now()-i.startedAt})}else throw It("Transaction not found.",t),new Ot}if(["committed","rolled_back","timed_out"].includes(n.status))throw new We("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.#i(t,"rolled_back")))}#s(t,r){let n=Date.now(),i=da(async()=>{It("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let o=this.transactions.get(t);o&&["running","waiting"].includes(o.status)?await this.#i(o,"timed_out"):It("Transaction already committed or rolled back when timeout happened.",t)},r);return i?.unref?.(),i}async#i(t,r){let n=async()=>{It("Closing transaction.",{transactionId:t.id,status:r});try{if(t.transaction&&r==="committed")if(t.transaction.options.usePhantomQuery)await this.#o(id(),t.transaction,()=>t.transaction.commit());else{let i=rd();await this.#o(i,t.transaction,()=>t.transaction.executeRaw(i)).then(()=>t.transaction.commit(),o=>{let s=()=>Promise.reject(o);return t.transaction.rollback().then(s,s)})}else if(t.transaction)if(t.transaction.options.usePhantomQuery)await this.#o(od(),t.transaction,()=>t.transaction.rollback());else{let i=nd();try{await this.#o(i,t.transaction,()=>t.transaction.executeRaw(i))}finally{await t.transaction.rollback()}}}finally{t.status=r,clearTimeout(t.timer),t.timer=void 0,this.transactions.delete(t.id),this.closedTransactions.push(t),this.closedTransactions.length>td&&this.closedTransactions.shift()}};t.status==="closing"?(await t.closing,this.#n(t.id,r==="committed"?"commit":"rollback")):await Object.assign(t,{status:"closing",reason:r,closing:n()}).closing}#a(t){if(!t.timeout)throw new U("timeout is required");if(!t.maxWait)throw new U("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new Rr(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}#o(t,r,n){return mr({query:t,execute:n,provider:this.#e??r.provider,tracingHelper:this.tracingHelper,onQuery:this.#t})}};function da(e,t){return t!==void 0?setTimeout(e,t):void 0}var O=require("@prisma/client-runtime-utils");var kr="7.0.0";function ma(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function fa(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function ga(e){return e.split(`
16
+ `).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(`
17
+ `)}var ya=q(Ii());function ha({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,ya.default)({user:t,repo:r,template:n,title:e,body:i})}function wa({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=wi(6e3-(s?.length??0)),l=ga(ve(a)),c=n?`# Description
18
+ \`\`\`
19
+ ${n}
20
+ \`\`\``:"",u=ve(`Hi Prisma Team! My Prisma Client just crashed. This is the report:
21
+ ## Versions
22
+
23
+ | Name | Version |
24
+ |-----------------|--------------------|
25
+ | Node | ${process.version?.padEnd(19)}|
26
+ | OS | ${t?.padEnd(19)}|
27
+ | Prisma Client | ${e?.padEnd(19)}|
28
+ | Query Engine | ${i?.padEnd(19)}|
29
+ | Database | ${o?.padEnd(19)}|
30
+
31
+ ${c}
32
+
33
+ ## Logs
34
+ \`\`\`
35
+ ${l}
36
+ \`\`\`
37
+
38
+ ## Client Snippet
39
+ \`\`\`ts
40
+ // PLEASE FILL YOUR CODE SNIPPET HERE
41
+ \`\`\`
42
+
43
+ ## Schema
44
+ \`\`\`prisma
45
+ // PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE
46
+ \`\`\`
47
+
48
+ ## Prisma Engine Query
49
+ \`\`\`
50
+ ${s?fa(s):""}
51
+ \`\`\`
52
+ `),p=ha({title:r,body:u});return`${r}
53
+
54
+ This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.
55
+
56
+ ${Xe(p)}
57
+
58
+ If you want the Prisma team to look into it, please open the link above \u{1F64F}
59
+ To increase the chance of success, please post your schema and a snippet of
60
+ how you used Prisma Client in the issue.
61
+ `}var Or=class e{#t;#e;#r;#n;constructor(t,r,n){this.#t=t,this.#e=r,this.#r=n,this.#n=r.getConnectionInfo?.()}static async connect(t){let r,n;try{r=await t.driverAdapterFactory.connect(),n=new Ft({driverAdapter:r,transactionOptions:t.transactionOptions,tracingHelper:t.tracingHelper,onQuery:t.onQuery,provider:t.provider})}catch(i){throw await r?.dispose(),i}return new e(t,r,n)}getConnectionInfo(){let t=this.#n??{supportsRelationJoins:!1};return Promise.resolve({provider:this.#e.provider,connectionInfo:t})}async execute({plan:t,placeholderValues:r,transaction:n,batchIndex:i}){let o=n?await this.#r.getTransaction(n,i!==void 0?"batch query":"query"):this.#e;return await kt.forSql({transactionManager:n?{enabled:!1}:{enabled:!0,manager:this.#r},placeholderValues:r,onQuery:this.#t.onQuery,tracingHelper:this.#t.tracingHelper,provider:this.#t.provider,connectionInfo:this.#n}).run(t,o)}async startTransaction(t){return{...await this.#r.startTransaction(t),payload:void 0}}async commitTransaction(t){await this.#r.commitTransaction(t.id)}async rollbackTransaction(t){await this.#r.rollbackTransaction(t.id)}async disconnect(){try{await this.#r.cancelAllTransactions()}finally{await this.#e.dispose()}}apiKey(){return null}};var Aa=require("@prisma/client-runtime-utils");var Ir=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function xa(e,t,r){let n=r||{},i=n.encode||encodeURIComponent;if(typeof i!="function")throw new TypeError("option encode is invalid");if(!Ir.test(e))throw new TypeError("argument name is invalid");let o=i(t);if(o&&!Ir.test(o))throw new TypeError("argument val is invalid");let s=e+"="+o;if(n.maxAge!==void 0&&n.maxAge!==null){let a=n.maxAge-0;if(Number.isNaN(a)||!Number.isFinite(a))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(a)}if(n.domain){if(!Ir.test(n.domain))throw new TypeError("option domain is invalid");s+="; Domain="+n.domain}if(n.path){if(!Ir.test(n.path))throw new TypeError("option path is invalid");s+="; Path="+n.path}if(n.expires){if(!ad(n.expires)||Number.isNaN(n.expires.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():n.priority){case"low":{s+="; Priority=Low";break}case"medium":{s+="; Priority=Medium";break}case"high":{s+="; Priority=High";break}default:throw new TypeError("option priority is invalid")}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:{s+="; SameSite=Strict";break}case"lax":{s+="; SameSite=Lax";break}case"strict":{s+="; SameSite=Strict";break}case"none":{s+="; SameSite=None";break}default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(s+="; Partitioned"),s}function ad(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}function ba(e,t){let r=(e||"").split(";").filter(l=>typeof l=="string"&&!!l.trim()),n=r.shift()||"",i=ld(n),o=i.name,s=i.value;try{s=t?.decode===!1?s:(t?.decode||decodeURIComponent)(s)}catch{}let a={name:o,value:s};for(let l of r){let c=l.split("="),u=(c.shift()||"").trimStart().toLowerCase(),p=c.join("=");switch(u){case"expires":{a.expires=new Date(p);break}case"max-age":{a.maxAge=Number.parseInt(p,10);break}case"secure":{a.secure=!0;break}case"httponly":{a.httpOnly=!0;break}case"samesite":{a.sameSite=p;break}default:a[u]=p}}return a}function ld(e){let t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}var Fr=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var Mr=class extends Fr{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function Ea(e,t){return{...e,isRetryable:t}}var Ee=class extends Mr{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,Ea(r,!1))}};at(Ee,"InvalidDatasourceError");function Ta(e){let t={clientVersion:e.clientVersion},r;try{r=new URL(e.accelerateUrl)}catch(l){let c=l.message;throw new Ee(`Error validating \`accelerateUrl\`, the URL cannot be parsed, reason: ${c}`,t)}let{protocol:n,searchParams:i}=r;if(n!=="prisma:"&&n!==Ut)throw new Ee("Error validating `accelerateUrl`: the URL must start with the protocol `prisma://` or `prisma+postgres://`",t);let o=i.get("api_key");if(o===null||o.length<1)throw new Ee("Error validating `accelerateUrl`: the URL must contain a valid API key",t);let s=Wr(r)?"http:":"https:";process.env.TEST_CLIENT_ENGINE_REMOTE_EXECUTOR&&r.searchParams.has("use_http")&&(s="http:");let a=new URL(r.href.replace(n,s));return{apiKey:o,url:a}}var Pa=q(Ti()),Dr=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,transactionId:r}={}){let n={Accept:"application/json",Authorization:`Bearer ${this.apiKey}`,"Content-Type":"application/json","Prisma-Engine-Hash":this.engineHash,"Prisma-Engine-Version":Pa.enginesVersion};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-Transaction-Id"]=r);let i=this.#t();return i.length>0&&(n["X-Capture-Telemetry"]=i.join(", ")),n}#t(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}};function cd(e){return e[0]*1e3+e[1]/1e6}function Gn(e){return new Date(cd(e))}var va=I("prisma:client:clientEngine:remoteExecutor"),_r=class{#t;#e;#r;#n;#s;constructor(t){this.#t=t.clientVersion,this.#n=t.logEmitter,this.#s=t.tracingHelper;let{url:r,apiKey:n}=Ta({clientVersion:t.clientVersion,accelerateUrl:t.accelerateUrl});this.#r=new Kn(r),this.#e=new Dr({apiKey:n,engineHash:t.clientVersion,logLevel:t.logLevel,logQueries:t.logQueries,tracingHelper:t.tracingHelper})}async getConnectionInfo(){return await this.#i({path:"/connection-info",method:"GET"})}async execute({plan:t,placeholderValues:r,batchIndex:n,model:i,operation:o,transaction:s,customFetch:a}){return(await this.#i({path:s?`/transaction/${s.id}/query`:"/query",method:"POST",body:{model:i,operation:o,plan:t,params:r},batchRequestIdx:n,fetch:a})).data}async startTransaction(t){return{...await this.#i({path:"/transaction/start",method:"POST",body:t}),payload:void 0}}async commitTransaction(t){await this.#i({path:`/transaction/${t.id}/commit`,method:"POST"})}async rollbackTransaction(t){await this.#i({path:`/transaction/${t.id}/rollback`,method:"POST"})}disconnect(){return Promise.resolve()}apiKey(){return this.#e.apiKey}async#i({path:t,method:r,body:n,fetch:i=globalThis.fetch,batchRequestIdx:o}){let s=await this.#r.request({method:r,path:t,headers:this.#e.build(),body:n,fetch:i});s.ok||await this.#a(s,o);let a=await s.json();return typeof a.extensions=="object"&&a.extensions!==null&&this.#o(a.extensions),a}async#a(t,r){let n=t.headers.get("Prisma-Error-Code"),i=await t.text(),o,s=i;try{o=JSON.parse(i)}catch{o={}}typeof o.code=="string"&&(n=o.code),typeof o.error=="string"?s=o.error:typeof o.message=="string"?s=o.message:typeof o.InvalidRequestError=="object"&&o.InvalidRequestError!==null&&typeof o.InvalidRequestError.reason=="string"&&(s=o.InvalidRequestError.reason),s=s||`HTTP ${t.status}: ${t.statusText}`;let a=typeof o.meta=="object"&&o.meta!==null?o.meta:o;throw new Aa.PrismaClientKnownRequestError(s,{clientVersion:this.#t,code:n??"P6000",batchRequestIdx:r,meta:a})}#o(t){if(t.logs)for(let r of t.logs)this.#c(r);t.traces&&this.#s.dispatchEngineSpans(t.traces)}#c(t){switch(t.level){case"debug":case"trace":va(t);break;case"error":case"warn":case"info":{this.#n.emit(t.level,{timestamp:Gn(t.timestamp),message:t.attributes.message??"",target:t.target??"RemoteExecutor"});break}case"query":{this.#n.emit("query",{query:t.attributes.query??"",timestamp:Gn(t.timestamp),duration:t.attributes.duration_ms??0,params:t.attributes.params??"",target:t.target??"RemoteExecutor"});break}default:throw new Error(`Unexpected log level: ${t.level}`)}}},Kn=class{#t;#e;#r;constructor(t){this.#t=t,this.#e=new Map}async request({method:t,path:r,headers:n,body:i,fetch:o}){let s=new URL(r,this.#t),a=this.#n(s);a&&(n.Cookie=a),this.#r&&(n["Accelerate-Query-Engine-Jwt"]=this.#r);let l=await o(s.href,{method:t,body:i!==void 0?JSON.stringify(i):void 0,headers:n});return va(t,s,l.status,l.statusText),this.#r=l.headers.get("Accelerate-Query-Engine-Jwt")??void 0,this.#s(s,l),l}#n(t){let r=[],n=new Date;for(let[i,o]of this.#e){if(o.expires&&o.expires<n){this.#e.delete(i);continue}let s=o.domain??t.hostname,a=o.path??"/";t.hostname.endsWith(s)&&t.pathname.startsWith(a)&&r.push(xa(o.name,o.value))}return r.length>0?r.join("; "):void 0}#s(t,r){let n=r.headers.getSetCookie?.()||[];if(n.length===0){let i=r.headers.get("Set-Cookie");i&&n.push(i)}for(let i of n){let o=ba(i),s=o.domain??t.hostname,a=o.path??"/",l=`${s}:${a}:${o.name}`;this.#e.set(l,{name:o.name,value:o.value,domain:s,path:a,expires:o.expires})}}};var Zn=require("@prisma/client-runtime-utils"),zn={},Sa={async loadQueryCompiler(e){let{clientVersion:t,compilerWasm:r}=e;if(r===void 0)throw new Zn.PrismaClientInitializationError("WASM query compiler was unexpectedly `undefined`",t);let n;return e.activeProvider===void 0||zn[e.activeProvider]===void 0?(n=(async()=>{let i=await r.getRuntime(),o=await r.getQueryCompilerWasmModule();if(o==null)throw new Zn.PrismaClientInitializationError("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let s={"./query_compiler_bg.js":i},a=new WebAssembly.Instance(o,s),l=a.exports.__wbindgen_start;return i.__wbg_set_wasm(a.exports),l(),i.QueryCompiler})(),e.activeProvider!==void 0&&(zn[e.activeProvider]=n)):n=zn[e.activeProvider],await n}};var ud="P2038",Mt=I("prisma:client:clientEngine"),Ra=globalThis;Ra.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new O.PrismaClientRustPanicError(e,kr)}};var Dt=class{name="ClientEngine";#t;#e={type:"disconnected"};#r;#n;config;datamodel;logEmitter;logQueries;logLevel;tracingHelper;#s;constructor(t,r){if(t.accelerateUrl!==void 0)this.#n={remote:!0,accelerateUrl:t.accelerateUrl};else if(t.adapter)this.#n={remote:!1,driverAdapterFactory:t.adapter},Mt("Using driver adapter: %O",t.adapter);else throw new O.PrismaClientInitializationError("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,ud);this.#r=r??Sa,this.config=t,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,t.enableDebugLogs&&(this.logLevel="debug"),this.logQueries&&(this.#s=n=>{this.logEmitter.emit("query",{...n,params:bt(n.params),target:"ClientEngine"})})}async#i(){switch(this.#e.type){case"disconnected":{let t=this.tracingHelper.runInChildSpan("connect",async()=>{let r,n;try{r=await this.#a(),n=await this.#o(r)}catch(o){throw this.#e={type:"disconnected"},n?.free(),await r?.disconnect(),o}let i={executor:r,queryCompiler:n};return this.#e={type:"connected",engine:i},i});return this.#e={type:"connecting",promise:t},await t}case"connecting":return await this.#e.promise;case"connected":return this.#e.engine;case"disconnecting":return await this.#e.promise,await this.#i()}}async#a(){return this.#n.remote?new _r({clientVersion:this.config.clientVersion,accelerateUrl:this.#n.accelerateUrl,logEmitter:this.logEmitter,logLevel:this.logLevel,logQueries:this.logQueries,tracingHelper:this.tracingHelper}):await Or.connect({driverAdapterFactory:this.#n.driverAdapterFactory,tracingHelper:this.tracingHelper,transactionOptions:{...this.config.transactionOptions,isolationLevel:this.#d(this.config.transactionOptions.isolationLevel)},onQuery:this.#s,provider:this.config.activeProvider})}async#o(t){let r=this.#t;r===void 0&&(r=await this.#r.loadQueryCompiler(this.config),this.#t=r);let{provider:n,connectionInfo:i}=await t.getConnectionInfo();try{return this.#u(()=>new r({datamodel:this.datamodel,provider:n,connectionInfo:i}),void 0,!1)}catch(o){throw this.#c(o)}}#c(t){if(t instanceof O.PrismaClientRustPanicError)return t;try{let r=JSON.parse(t.message);return new O.PrismaClientInitializationError(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#l(t,r){if(t instanceof O.PrismaClientInitializationError)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new O.PrismaClientRustPanicError(Ca(this,t.message,r),this.config.clientVersion);if(t instanceof D)return new O.PrismaClientKnownRequestError(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let n=JSON.parse(t);return new O.PrismaClientUnknownRequestError(`${n.message}
62
+ ${n.backtrace}`,{clientVersion:this.config.clientVersion})}catch{return t}}#p(t){return t instanceof O.PrismaClientRustPanicError?t:typeof t.message=="string"&&typeof t.code=="string"?new O.PrismaClientKnownRequestError(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion}):typeof t.message=="string"?new O.PrismaClientUnknownRequestError(t.message,{clientVersion:this.config.clientVersion}):t}#u(t,r,n=!0){let i=Ra.PRISMA_WASM_PANIC_REGISTRY.set_message,o;global.PRISMA_WASM_PANIC_REGISTRY.set_message=s=>{o=s};try{return t()}finally{if(global.PRISMA_WASM_PANIC_REGISTRY.set_message=i,o)throw this.#t=void 0,n&&this.stop().catch(s=>Mt("failed to disconnect:",s)),new O.PrismaClientRustPanicError(Ca(this,o,r),this.config.clientVersion)}}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the client engine, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){await this.#i()}async stop(){switch(this.#e.type){case"disconnected":return;case"connecting":return await this.#e.promise,await this.stop();case"connected":{let t=this.#e.engine,r=this.tracingHelper.runInChildSpan("disconnect",async()=>{try{await t.executor.disconnect(),t.queryCompiler.free()}finally{this.#e={type:"disconnected"}}});return this.#e={type:"disconnecting",promise:r},await r}case"disconnecting":return await this.#e.promise}}version(){return"unknown"}async transaction(t,r,n){let i,{executor:o}=await this.#i();try{if(t==="start"){let s=n;i=await o.startTransaction({...s,isolationLevel:this.#d(s.isolationLevel)})}else if(t==="commit"){let s=n;await o.commitTransaction(s)}else if(t==="rollback"){let s=n;await o.rollbackTransaction(s)}else Y(t,"Invalid transaction action.")}catch(s){throw this.#l(s)}return i?{id:i.id,payload:void 0}:void 0}async request(t,{interactiveTransaction:r,customDataProxyFetch:n}){Mt("sending request");let i=JSON.stringify(t),{executor:o,queryCompiler:s}=await this.#i().catch(l=>{throw this.#l(l,i)}),a;try{a=this.#u(()=>this.#m({queries:[t],execute:()=>s.compile(i)}))}catch(l){throw this.#p(l)}try{Mt("query plan created",a);let l={},c=await o.execute({plan:a,model:t.modelName,operation:t.action,placeholderValues:l,transaction:r,batchIndex:void 0,customFetch:n?.(globalThis.fetch)});return Mt("query plan executed"),{data:{[t.action]:c}}}catch(l){throw this.#l(l,i)}}async requestBatch(t,{transaction:r,customDataProxyFetch:n}){if(t.length===0)return[];let i=t[0].action,o=JSON.stringify(ma(t,r)),{executor:s,queryCompiler:a}=await this.#i().catch(c=>{throw this.#l(c,o)}),l;try{l=this.#u(()=>this.#m({queries:t,execute:()=>a.compileBatch(o)}))}catch(c){throw this.#p(c)}try{let c;r?.kind==="itx"&&(c=r.options);let u={};switch(l.type){case"multi":{if(r?.kind!=="itx"){let g=r?.options.isolationLevel?{...this.config.transactionOptions,isolationLevel:r.options.isolationLevel}:this.config.transactionOptions;c=await this.transaction("start",{},g)}let p=[],y=!1;for(let[g,b]of l.plans.entries())try{let E=await s.execute({plan:b,placeholderValues:u,model:t[g].modelName,operation:t[g].action,batchIndex:g,transaction:c,customFetch:n?.(globalThis.fetch)});p.push({data:{[t[g].action]:E}})}catch(E){p.push(E),y=!0;break}return c!==void 0&&r?.kind!=="itx"&&(y?await this.transaction("rollback",{},c):await this.transaction("commit",{},c)),p}case"compacted":{if(!t.every(g=>g.action===i))throw new Error("All queries in a batch must have the same action");let p=await s.execute({plan:l.plan,placeholderValues:u,model:t[0].modelName,operation:i,batchIndex:void 0,transaction:c,customFetch:n?.(globalThis.fetch)});return zo(p,l).map(g=>({data:{[i]:g}}))}}}catch(c){throw this.#l(c,o)}}async apiKey(){let{executor:t}=await this.#i();return t.apiKey()}#d(t){switch(t){case void 0:return;case"ReadUncommitted":return"READ UNCOMMITTED";case"ReadCommitted":return"READ COMMITTED";case"RepeatableRead":return"REPEATABLE READ";case"Serializable":return"SERIALIZABLE";case"Snapshot":return"SNAPSHOT";default:throw new O.PrismaClientKnownRequestError(`Inconsistent column data: Conversion failed: Invalid isolation level \`${t}\``,{code:"P2023",clientVersion:this.config.clientVersion,meta:{providedIsolationLevel:t}})}}#m({queries:t,execute:r}){return this.tracingHelper.runInChildSpan({name:"compile",attributes:{models:t.map(n=>n.modelName).filter(n=>n!==void 0),actions:t.map(n=>n.action)}},r)}};function Ca(e,t,r){return wa({binaryTarget:void 0,title:t,version:e.config.clientVersion,engineVersion:"unknown",database:e.config.activeProvider,query:r})}function ka(e){return new Dt(e)}var Oa=e=>({command:e});var $a=require("@prisma/client-runtime-utils");var Ia=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);var Da=require("@prisma/client-runtime-utils");function Ge(e){try{return Fa(e,"fast")}catch{return Fa(e,"slow")}}function Fa(e,t){return JSON.stringify(e.map(r=>_a(r,t)))}function _a(e,t){if(Array.isArray(e))return e.map(r=>_a(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(Se(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(Da.Decimal.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(pd(e))return{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:Buffer.from(r,n,i).toString("base64")}}return typeof e=="object"&&t==="slow"?Na(e):e}function pd(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Na(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ma);let t={};for(let r of Object.keys(e))t[r]=Ma(e[r]);return t}function Ma(e){return typeof e=="bigint"?e.toString():Na(e)}var dd=/^(\s*alter\s)/i,La=I("prisma:client");function Xn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&dd.exec(t))throw new Error(`Running ALTER using ${n} is not supported
63
+ Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization.
64
+
65
+ Example:
66
+ await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
67
+
68
+ More Information: https://pris.ly/d/execute-raw
69
+ `)}var Yn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(ar(r))n=r.sql,i={values:Ge(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:Ge(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:Ge(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:Ge(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Ia(r),i={values:Ge(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?La(`prisma.${e}(${n}, ${i.values})`):La(`prisma.${e}(${n})`),{query:n,parameters:i}},Va={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new $a.Sql(t,r)}},qa={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function ei(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Ua(r(s)):Ua(r(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function Ua(e){return typeof e.then=="function"?e:Promise.resolve(e)}var md=Hr.split(".")[0],fd={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},ti=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getGlobalTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){let t=globalThis[`V${md}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??fd}};function ja(){return new ti}function Ba(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function Qa(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}var Wa=require("@prisma/client-runtime-utils");function Ha(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(ri(e.query.arguments)),t.push(ri(e.query.selection)),t.join("")}function ri(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${ri(n)})`:r}).join(" ")})`}var gd={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function ni(e){return gd[e]}var Nr=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i<r.length;i++)r[i].reject(n);else for(let i=0;i<r.length;i++){let o=n[i];o instanceof Error?r[i].reject(o):r[i].resolve(o)}}).catch(n=>{for(let i=0;i<r.length;i++)r[i].reject(n)}))}}get[Symbol.toStringTag](){return"DataLoader"}};var Ja=require("@prisma/client-runtime-utils");function Te(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"decimal":return new Ja.Decimal(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"bigint-array":return t.map(r=>Te("bigint",r));case"bytes-array":return t.map(r=>Te("bytes",r));case"decimal-array":return t.map(r=>Te("decimal",r));case"datetime-array":return t.map(r=>Te("datetime",r));case"date-array":return t.map(r=>Te("date",r));case"time-array":return t.map(r=>Te("time",r));default:return t}}function Lr(e){let t=[],r=yd(e);for(let n=0;n<e.rows.length;n++){let i=e.rows[n],o={...r};for(let s=0;s<i.length;s++)o[e.columns[s]]=Te(e.types[s],i[s]);t.push(o)}return t}function yd(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var hd=I("prisma:client:request_handler"),$r=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new Nr({batchLoader:qo(async({requests:n,customDataProxyFetch:i})=>{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),c=n.some(p=>ni(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:wd(o),containsWrite:c,customDataProxyFetch:i})).map((p,y)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[y],p)}catch(g){return g}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ga(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:ni(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Ha(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=this.unpack(i,t,r);return process.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(hd(t),xd(t,i))throw t;if(t instanceof w.PrismaClientKnownRequestError&&bd(t)){let c=Ka(t.meta);tr({args:o,errors:[c],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=Wt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let c=s?{modelName:s,...t.meta}:t.meta;throw new w.PrismaClientKnownRequestError(l,{code:t.code,clientVersion:this.client._clientVersion,meta:c,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new w.PrismaClientRustPanicError(l,this.client._clientVersion);if(t instanceof w.PrismaClientUnknownRequestError)throw new w.PrismaClientUnknownRequestError(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof w.PrismaClientInitializationError)throw new w.PrismaClientInitializationError(l,this.client._clientVersion);if(t instanceof w.PrismaClientRustPanicError)throw new w.PrismaClientRustPanicError(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?ve(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(c=>c!=="select"&&c!=="include"),a=un(o,s),l=i==="queryRaw"?Lr(a):le(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function wd(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ga(e)};Y(e,"Unknown transaction kind")}}function Ga(e){return{id:e.id,payload:e.payload}}function xd(e,t){return(0,Wa.hasBatchIndex)(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function bd(e){return e.code==="P2009"||e.code==="P2012"}function Ka(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Ka)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var za=kr;var tl=q(en());var S=class extends Error{constructor(t){super(t+`
70
+ Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};at(S,"PrismaClientConstructorValidationError");var Za=["errorFormat","adapter","accelerateUrl","log","transactionOptions","omit","__internal"],Xa=["pretty","colorless","minimal"],Ya=["info","query","warn","error"],Ed={adapter:()=>{},accelerateUrl:e=>{if(e!==void 0){if(typeof e!="string")throw new S(`Invalid value ${JSON.stringify(e)} for "accelerateUrl" provided to PrismaClient constructor.`);if(e.trim().length===0)throw new S('"accelerateUrl" provided to PrismaClient constructor must be a non-empty string.')}},errorFormat:e=>{if(e){if(typeof e!="string")throw new S(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Xa.includes(e)){let t=_t(e,Xa);throw new S(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new S(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Ya.includes(r)){let n=_t(r,Ya);throw new S(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=_t(i,o);throw new S(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new S(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new S(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new S(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new S('"omit" option is expected to be an object.');if(e===null)throw new S('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Ad(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(c=>c.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new S(vd(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new S(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=_t(r,t);throw new S(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Td(e){let t=e.adapter!==void 0,r=e.accelerateUrl!==void 0;if(t&&r)throw new S('The "adapter" and "accelerateUrl" options are mutually exclusive. Please provide only one of them.');if(!t&&!r)throw new S('Using engine type "client" requires either "adapter" or "accelerateUrl" to be provided to PrismaClient constructor.')}function rl(e,t){for(let[r,n]of Object.entries(e)){if(!Za.includes(r)){let i=_t(r,Za);throw new S(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Ed[r](n,t)}Td(e)}function _t(e,t){if(t.length===0||typeof e!="string")return"";let r=Pd(e,t);return r?` Did you mean "${r}"?`:""}function Pd(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,tl.default)(e,i)}));r.sort((i,o)=>i.distance<o.distance?-1:1);let n=r[0];return n.distance<3?n.value:null}function Ad(e,t){return el(t.models,e)??el(t.types,e)}function el(e,t){let r=Object.keys(e).find(n=>ie(n)===t);if(r)return e[r]}function vd(e,t){let r=_e(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=er(r,"colorless");return`Error validating "omit" option:
71
+
72
+ ${i}
73
+
74
+ ${n}`}var nl=require("@prisma/client-runtime-utils");function il(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=c=>{o||(o=!0,r(c))};for(let c=0;c<e.length;c++)e[c].then(u=>{n[c]=u,a()},u=>{if(!(0,nl.hasBatchIndex)(u)){l(u);return}u.batchRequestIdx===c?l(u):(i||(i=u),a())})})}var Nt=I("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Sd={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Cd=Symbol.for("prisma.client.transaction.id"),Rd={id:0,nextId(){return++this.id}};function cl(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=ei();constructor(n){e=n.__internal?.configOverride?.(e)??e,n&&rl(n,e);let i=new ll.EventEmitter().on("error",()=>{});this._extensions=Ne.empty(),this._previewFeatures=e.previewFeatures,this._clientVersion=e.clientVersion??za,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=ja();let o;if(n?.adapter){o=n.adapter;let s=e.activeProvider==="postgresql"||e.activeProvider==="cockroachdb"?"postgres":e.activeProvider;if(o.provider!==s)throw new w.PrismaClientInitializationError(`The Driver Adapter \`${o.adapterName}\`, based on \`${o.provider}\`, is not compatible with the provider \`${s}\` specified in the Prisma schema.`,this._clientVersion)}try{let s=n??{},l=(s.__internal??{}).debug===!0;if(l&&I.enable("prisma:client"),s.errorFormat?this._errorFormat=s.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={enableDebugLogs:l,logLevel:s.log&&Qa(s.log),logQueries:s.log&&!!(typeof s.log=="string"?s.log==="query":s.log.find(c=>typeof c=="string"?c==="query":c.level==="query")),compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:s.transactionOptions?.maxWait??2e3,timeout:s.transactionOptions?.timeout??5e3,isolationLevel:s.transactionOptions?.isolationLevel},logEmitter:i,adapter:o,accelerateUrl:s.accelerateUrl},this._accelerateEngineConfig=Object.create(this._engineConfig),this._accelerateEngineConfig.accelerateUtils={resolveDatasourceUrl:()=>{if(s.accelerateUrl)return s.accelerateUrl;throw new w.PrismaClientInitializationError(`\`accelerateUrl\` is required when using \`@prisma/extension-accelerate\`:
75
+
76
+ new PrismaClient({
77
+ accelerateUrl: "prisma://...",
78
+ }).$extends(withAccelerate())
79
+ `,e.clientVersion)}},Nt("clientVersion",e.clientVersion),this._engine=ka(this._engineConfig),this._requestHandler=new $r(this,i),s.log)for(let c of s.log){let u=typeof c=="string"?c:c.emit==="stdout"?c.level:null;u&&this.$on(u,p=>{ot.log(`${ot.tags[u]??""}`,p.message||p.query)})}}catch(s){throw s.clientVersion=this._clientVersion,s}return this._appliedParent=ht(this)}get[Symbol.toStringTag](){return"PrismaClient"}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{xi()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Yn({clientMethod:i,activeProvider:a}),callsite:ae(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=ol(n,i);return Xn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new w.PrismaClientValidationError("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Xn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new w.PrismaClientValidationError(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Oa,callsite:ae(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Yn({clientMethod:i,activeProvider:a}),callsite:ae(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...ol(n,i));throw new w.PrismaClientValidationError("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new w.PrismaClientValidationError("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Rd.nextId(),s=Ba(n.length),a=n.map((l,c)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let u=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:c,isolationLevel:u,lock:s};return l.requestTransaction?.(p)??l});return il(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let c={kind:"itx",...a};l=await n(this._createItxClient(c)),await this._engine.transaction("commit",o,a)}catch(c){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),c}return l}_createItxClient(n){return Q(ht(Q(Oo(this),[M("_appliedParent",()=>this._appliedParent._createItxClient(n)),M("_createPrismaPromise",()=>ei(n)),M(Cd,()=>n.id)])),[Le(_o)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Sd,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=async l=>{let{runInTransaction:c,args:u,...p}=l,y={...n,...p};u&&(y.args=i.middlewareArgsToRequestArgs(u)),n.transaction!==void 0&&c===!1&&delete y.transaction;let g=await Vo(this,y);return y.model?Do({result:g,modelName:y.model,args:y.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):g};return this._tracingHelper.runInChildSpan(s.operation,()=>new al.AsyncResource("prisma-client-request").runInAsyncScope(()=>a(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:c,transaction:u,unpacker:p,otelParentCtx:y,customDataProxyFetch:g}){try{n=c?c(n):n;let b={name:"serialize"},E=this._tracingHelper.runInChildSpan(b,()=>or({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return I.enabled("prisma:client")&&(Nt("Prisma Client call:"),Nt(`prisma.${i}(${xo(n)})`),Nt("Generated request:"),Nt(JSON.stringify(E,null,2)+`
80
+ `)),u?.kind==="batch"&&await u.lock,this._requestHandler.request({protocolQuery:E,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:u,unpacker:p,otelParentCtx:y,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:g})}catch(b){throw b.clientVersion=this._clientVersion,b}}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$extends=Io}return t}function ol(e,t){return kd(e)?[new sl.Sql(e,t),Va]:[e,qa]}function kd(e){return Array.isArray(e)&&Array.isArray(e.raw)}var Od=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function ul(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Od.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}var Id=()=>globalThis.process?.release?.name==="node",Fd=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,Md=()=>!!globalThis.Deno,Dd=()=>typeof globalThis.Netlify=="object",_d=()=>typeof globalThis.EdgeRuntime=="object",Nd=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Ld(){return[[Dd,"netlify"],[_d,"edge-light"],[Nd,"workerd"],[Md,"deno"],[Fd,"bun"],[Id,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var $d={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function pl(){let e=Ld();return{id:e,prettyName:$d[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var w=require("@prisma/client-runtime-utils"),Z=require("@prisma/client-runtime-utils"),F=require("@prisma/client-runtime-utils"),dl=require("@prisma/client-runtime-utils");0&&(module.exports={AnyNull,DMMF,DbNull,Debug,Decimal,Extensions,JsonNull,NullTypes,ObjectEnumValue,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,isAnyNull,isDbNull,isJsonNull,join,makeStrictEnum,makeTypedQueryFactory,raw,serializeJsonQuery,skip,sqltag,warnOnce});
81
+ /*! Bundled license information:
82
+
83
+ @noble/hashes/utils.js:
84
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
85
+ */
86
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,87 @@
1
+ import { AnyNull } from '@prisma/client-runtime-utils';
2
+ import { DbNull } from '@prisma/client-runtime-utils';
3
+ import { Decimal } from '@prisma/client-runtime-utils';
4
+ import { isAnyNull } from '@prisma/client-runtime-utils';
5
+ import { isDbNull } from '@prisma/client-runtime-utils';
6
+ import { isJsonNull } from '@prisma/client-runtime-utils';
7
+ import { JsonNull } from '@prisma/client-runtime-utils';
8
+ import { NullTypes } from '@prisma/client-runtime-utils';
9
+
10
+ export { AnyNull }
11
+
12
+ declare type Args<T, F extends Operation> = T extends {
13
+ [K: symbol]: {
14
+ types: {
15
+ operations: {
16
+ [K in F]: {
17
+ args: any;
18
+ };
19
+ };
20
+ };
21
+ };
22
+ } ? T[symbol]['types']['operations'][F]['args'] : any;
23
+
24
+ export { DbNull }
25
+
26
+ export { Decimal }
27
+
28
+ declare type Exact<A, W> = (A extends unknown ? (W extends A ? {
29
+ [K in keyof A]: Exact<A[K], W[K]>;
30
+ } : W) : never) | (A extends Narrowable ? A : never);
31
+
32
+ export declare function getRuntime(): GetRuntimeOutput;
33
+
34
+ declare type GetRuntimeOutput = {
35
+ id: RuntimeName;
36
+ prettyName: string;
37
+ isEdge: boolean;
38
+ };
39
+
40
+ export { isAnyNull }
41
+
42
+ export { isDbNull }
43
+
44
+ export { isJsonNull }
45
+
46
+ export { JsonNull }
47
+
48
+ /**
49
+ * Generates more strict variant of an enum which, unlike regular enum,
50
+ * throws on non-existing property access. This can be useful in following situations:
51
+ * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input
52
+ * - enum values are generated dynamically from DMMF.
53
+ *
54
+ * In that case, if using normal enums and no compile-time typechecking, using non-existing property
55
+ * will result in `undefined` value being used, which will be accepted. Using strict enum
56
+ * in this case will help to have a runtime exception, telling you that you are probably doing something wrong.
57
+ *
58
+ * Note: if you need to check for existence of a value in the enum you can still use either
59
+ * `in` operator or `hasOwnProperty` function.
60
+ *
61
+ * @param definition
62
+ * @returns
63
+ */
64
+ export declare function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T;
65
+
66
+ declare type Narrowable = string | number | bigint | boolean | [];
67
+
68
+ export { NullTypes }
69
+
70
+ declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw';
71
+
72
+ declare namespace Public {
73
+ export {
74
+ validator
75
+ }
76
+ }
77
+ export { Public }
78
+
79
+ declare type RuntimeName = 'workerd' | 'deno' | 'netlify' | 'node' | 'bun' | 'edge-light' | '';
80
+
81
+ declare function validator<V>(): <S>(select: Exact<S, V>) => S;
82
+
83
+ declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): <S>(select: Exact<S, Args<C[M], O>>) => S;
84
+
85
+ declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation, P extends keyof Args<C[M], O>>(client: C, model: M, operation: O, prop: P): <S>(select: Exact<S, Args<C[M], O>[P]>) => S;
86
+
87
+ export { }
@@ -0,0 +1,6 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ "use strict";var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var a=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},y=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of p(t))!f.call(e,i)&&i!==n&&s(e,i,{get:()=>t[i],enumerable:!(r=g(t,i))||r.enumerable});return e};var x=e=>y(s({},"__esModule",{value:!0}),e);var O={};a(O,{AnyNull:()=>o.AnyNull,DbNull:()=>o.DbNull,Decimal:()=>m.Decimal,JsonNull:()=>o.JsonNull,NullTypes:()=>o.NullTypes,Public:()=>l,getRuntime:()=>c,isAnyNull:()=>o.isAnyNull,isDbNull:()=>o.isDbNull,isJsonNull:()=>o.isJsonNull,makeStrictEnum:()=>u});module.exports=x(O);var l={};a(l,{validator:()=>d});function d(...e){return t=>t}var b=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function u(e){return new Proxy(e,{get(t,n){if(n in t)return t[n];if(!b.has(n))throw new TypeError("Invalid enum value: ".concat(String(n)))}})}var N=()=>{var e,t;return((t=(e=globalThis.process)==null?void 0:e.release)==null?void 0:t.name)==="node"},S=()=>{var e,t;return!!globalThis.Bun||!!((t=(e=globalThis.process)==null?void 0:e.versions)!=null&&t.bun)},E=()=>!!globalThis.Deno,R=()=>typeof globalThis.Netlify=="object",h=()=>typeof globalThis.EdgeRuntime=="object",C=()=>{var e;return((e=globalThis.navigator)==null?void 0:e.userAgent)==="Cloudflare-Workers"};function k(){var n;return(n=[[R,"netlify"],[h,"edge-light"],[C,"workerd"],[E,"deno"],[S,"bun"],[N,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0))!=null?n:""}var M={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function c(){let e=k();return{id:e,prettyName:M[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var o=require("@prisma/client-runtime-utils"),m=require("@prisma/client-runtime-utils");0&&(module.exports={AnyNull,DbNull,Decimal,JsonNull,NullTypes,Public,getRuntime,isAnyNull,isDbNull,isJsonNull,makeStrictEnum});
6
+ //# sourceMappingURL=index-browser.js.map