prisma 6.9.0-dev.20 → 6.9.0-dev.22

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.
@@ -1,33 +1,33 @@
1
- "use strict";var mc=Object.create;var Br=Object.defineProperty;var fc=Object.getOwnPropertyDescriptor;var gc=Object.getOwnPropertyNames;var hc=Object.getPrototypeOf,yc=Object.prototype.hasOwnProperty;var Fo=(e,t)=>()=>(e&&(t=e(e=0)),t);var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),st=(e,t)=>{for(var r in t)Br(e,r,{get:t[r],enumerable:!0})},Lo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gc(t))!yc.call(e,i)&&i!==r&&Br(e,i,{get:()=>t[i],enumerable:!(n=fc(t,i))||n.enumerable});return e};var q=(e,t,r)=>(r=e!=null?mc(hc(e)):{},Lo(t||!e||!e.__esModule?Br(r,"default",{value:e,enumerable:!0}):r,e)),wc=e=>Lo(Br({},"__esModule",{value:!0}),e);var Yo=G((Jg,qc)=>{qc.exports={name:"@prisma/internals",version:"6.9.0-dev.20",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","!**/libquery_engine*","!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":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.5.0",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"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","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","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.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/schema-engine-wasm":"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var Xo=G((Yg,Zo)=>{"use strict";Zo.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var ns=G((eh,rs)=>{"use strict";rs.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 ss=G((rh,os)=>{"use strict";os.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var ci=G((nh,as)=>{"use strict";var Jc=ss();as.exports=e=>typeof e=="string"?e.replace(Jc(),""):e});var ls=G((sh,Kc)=>{Kc.exports={name:"dotenv",version:"16.5.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var ms=G((ah,Ae)=>{"use strict";var di=require("node:fs"),mi=require("node:path"),zc=require("node:os"),Yc=require("node:crypto"),Zc=ls(),cs=Zc.version,Xc=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ep(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
- `);let n;for(;(n=Xc.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
3
- `),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function tp(e){let t=ds(e),r=j.configDotenv({path:t});if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=ps(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=np(r,a);o=j.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return j.parse(o)}function rp(e){console.log(`[dotenv@${cs}][WARN] ${e}`)}function Jt(e){console.log(`[dotenv@${cs}][DEBUG] ${e}`)}function ps(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function np(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function ds(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)di.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=mi.resolve(process.cwd(),".env.vault");return di.existsSync(t)?t:null}function us(e){return e[0]==="~"?mi.join(zc.homedir(),e.slice(1)):e}function ip(e){!!(e&&e.debug)&&Jt("Loading env from encrypted .env.vault");let r=j._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),j.populate(n,r,e),{parsed:r}}function op(e){let t=mi.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&Jt("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[us(e.path)];else{i=[];for(let l of e.path)i.push(us(l))}let o,s={};for(let l of i)try{let u=j.parse(di.readFileSync(l,{encoding:r}));j.populate(s,u,e)}catch(u){n&&Jt(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),j.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function sp(e){if(ps(e).length===0)return j.configDotenv(e);let t=ds(e);return t?j._configVault(e):(rp(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),j.configDotenv(e))}function ap(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=Yc.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||l){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw s}}function lp(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override);if(typeof t!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o]),n&&Jt(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var j={configDotenv:op,_configVault:ip,_parseVault:tp,config:sp,decrypt:ap,parse:ep,populate:lp};Ae.exports.configDotenv=j.configDotenv;Ae.exports._configVault=j._configVault;Ae.exports._parseVault=j._parseVault;Ae.exports.config=j.config;Ae.exports.decrypt=j.decrypt;Ae.exports.parse=j.parse;Ae.exports.populate=j.populate;Ae.exports=j});var ys=G((mh,Jr)=>{"use strict";Jr.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()};Jr.exports.default=Jr.exports});var Ti=G((Uy,js)=>{"use strict";js.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,u,c,p,d,m,g,h,R,T,C,w,k=[];for(l=0;l<i;l++)k.push(l+1),k.push(t.charCodeAt(s+l));for(var pe=k.length-1;a<o-3;)for(R=r.charCodeAt(s+(u=a)),T=r.charCodeAt(s+(c=a+1)),C=r.charCodeAt(s+(p=a+2)),w=r.charCodeAt(s+(d=a+3)),m=a+=4,l=0;l<pe;l+=2)g=k[l],h=k[l+1],u=e(g,u,c,R,h),c=e(u,c,p,T,h),p=e(c,p,d,C,h),m=e(p,d,m,w,h),k[l]=m,d=p,p=c,c=u,u=g;for(;a<o;)for(R=r.charCodeAt(s+(u=a)),m=++a,l=0;l<pe;l+=2)g=k[l],k[l]=m=e(g,u,m,R,k[l+1]),u=g;return m}}()});var Gs=Fo(()=>{"use strict"});var Ws=Fo(()=>{"use strict"});var ya=G((yx,rm)=>{rm.exports={name:"@prisma/engines-version",version:"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"2060c79ba17c6bb9f5823312b6f6b7f4a845738e"},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 zi=G(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.anumber=Ki;ze.abytes=ul;ze.ahash=tf;ze.aexists=rf;ze.aoutput=nf;function Ki(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function ef(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ul(e,...t){if(!ef(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 tf(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ki(e.outputLen),Ki(e.blockLen)}function rf(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 nf(e,t){ul(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Ol=G(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.add5L=P.add5H=P.add4H=P.add4L=P.add3H=P.add3L=P.rotlBL=P.rotlBH=P.rotlSL=P.rotlSH=P.rotr32L=P.rotr32H=P.rotrBL=P.rotrBH=P.rotrSL=P.rotrSH=P.shrSL=P.shrSH=P.toBig=void 0;P.fromBig=Zi;P.split=cl;P.add=Tl;var On=BigInt(2**32-1),Yi=BigInt(32);function Zi(e,t=!1){return t?{h:Number(e&On),l:Number(e>>Yi&On)}:{h:Number(e>>Yi&On)|0,l:Number(e&On)|0}}function cl(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}=Zi(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var pl=(e,t)=>BigInt(e>>>0)<<Yi|BigInt(t>>>0);P.toBig=pl;var dl=(e,t,r)=>e>>>r;P.shrSH=dl;var ml=(e,t,r)=>e<<32-r|t>>>r;P.shrSL=ml;var fl=(e,t,r)=>e>>>r|t<<32-r;P.rotrSH=fl;var gl=(e,t,r)=>e<<32-r|t>>>r;P.rotrSL=gl;var hl=(e,t,r)=>e<<64-r|t>>>r-32;P.rotrBH=hl;var yl=(e,t,r)=>e>>>r-32|t<<64-r;P.rotrBL=yl;var wl=(e,t)=>t;P.rotr32H=wl;var El=(e,t)=>e;P.rotr32L=El;var xl=(e,t,r)=>e<<r|t>>>32-r;P.rotlSH=xl;var bl=(e,t,r)=>t<<r|e>>>32-r;P.rotlSL=bl;var Pl=(e,t,r)=>t<<r-32|e>>>64-r;P.rotlBH=Pl;var vl=(e,t,r)=>e<<r-32|t>>>64-r;P.rotlBL=vl;function Tl(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Cl=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);P.add3L=Cl;var Al=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;P.add3H=Al;var Sl=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);P.add4L=Sl;var Rl=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;P.add4H=Rl;var Il=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);P.add5L=Il;var kl=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;P.add5H=kl;var of={fromBig:Zi,split:cl,toBig:pl,shrSH:dl,shrSL:ml,rotrSH:fl,rotrSL:gl,rotrBH:hl,rotrBL:yl,rotr32H:wl,rotr32L:El,rotlSH:xl,rotlSL:bl,rotlBH:Pl,rotlBL:vl,add:Tl,add3L:Cl,add3H:Al,add4L:Sl,add4H:Rl,add5H:kl,add5L:Il};P.default=of});var Dl=G(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.crypto=void 0;var qe=require("node:crypto");Dn.crypto=qe&&typeof qe=="object"&&"webcrypto"in qe?qe.webcrypto:qe&&typeof qe=="object"&&"randomBytes"in qe?qe:void 0});var Ml=G(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.Hash=S.nextTick=S.byteSwapIfBE=S.isLE=void 0;S.isBytes=sf;S.u8=af;S.u32=lf;S.createView=uf;S.rotr=cf;S.rotl=pf;S.byteSwap=to;S.byteSwap32=df;S.bytesToHex=ff;S.hexToBytes=gf;S.asyncLoop=yf;S.utf8ToBytes=Nl;S.toBytes=_n;S.concatBytes=wf;S.checkOpts=Ef;S.wrapConstructor=xf;S.wrapConstructorWithOpts=bf;S.wrapXOFConstructorWithOpts=Pf;S.randomBytes=vf;var St=Dl(),eo=zi();function sf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function af(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function lf(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function uf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function cf(e,t){return e<<32-t|e>>>t}function pf(e,t){return e<<t|e>>>32-t>>>0}S.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function to(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}S.byteSwapIfBE=S.isLE?e=>e:e=>to(e);function df(e){for(let t=0;t<e.length;t++)e[t]=to(e[t])}var mf=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ff(e){(0,eo.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=mf[e[r]];return t}var Ie={_0:48,_9:57,A:65,F:70,a:97,f:102};function _l(e){if(e>=Ie._0&&e<=Ie._9)return e-Ie._0;if(e>=Ie.A&&e<=Ie.F)return e-(Ie.A-10);if(e>=Ie.a&&e<=Ie.f)return e-(Ie.a-10)}function gf(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=_l(e.charCodeAt(o)),a=_l(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 hf=async()=>{};S.nextTick=hf;async function yf(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,S.nextTick)(),n+=o)}}function Nl(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function _n(e){return typeof e=="string"&&(e=Nl(e)),(0,eo.abytes)(e),e}function wf(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,eo.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 Xi=class{clone(){return this._cloneInto()}};S.Hash=Xi;function Ef(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 xf(e){let t=n=>e().update(_n(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function bf(e){let t=(n,i)=>e(i).update(_n(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Pf(e){let t=(n,i)=>e(i).update(_n(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function vf(e=32){if(St.crypto&&typeof St.crypto.getRandomValues=="function")return St.crypto.getRandomValues(new Uint8Array(e));if(St.crypto&&typeof St.crypto.randomBytes=="function")return St.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var Bl=G(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.shake256=F.shake128=F.keccak_512=F.keccak_384=F.keccak_256=F.keccak_224=F.sha3_512=F.sha3_384=F.sha3_256=F.sha3_224=F.Keccak=void 0;F.keccakP=jl;var Rt=zi(),wr=Ol(),ke=Ml(),$l=[],Vl=[],ql=[],Tf=BigInt(0),yr=BigInt(1),Cf=BigInt(2),Af=BigInt(7),Sf=BigInt(256),Rf=BigInt(113);for(let e=0,t=yr,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],$l.push(2*(5*n+r)),Vl.push((e+1)*(e+2)/2%64);let i=Tf;for(let o=0;o<7;o++)t=(t<<yr^(t>>Af)*Rf)%Sf,t&Cf&&(i^=yr<<(yr<<BigInt(o))-yr);ql.push(i)}var[If,kf]=(0,wr.split)(ql,!0),Fl=(e,t,r)=>r>32?(0,wr.rotlBH)(e,t,r):(0,wr.rotlSH)(e,t,r),Ll=(e,t,r)=>r>32?(0,wr.rotlBL)(e,t,r):(0,wr.rotlSL)(e,t,r);function jl(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,u=r[l],c=r[l+1],p=Fl(u,c,1)^r[a],d=Ll(u,c,1)^r[a+1];for(let m=0;m<50;m+=10)e[s+m]^=p,e[s+m+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=Vl[s],l=Fl(i,o,a),u=Ll(i,o,a),c=$l[s];i=e[c],o=e[c+1],e[c]=l,e[c+1]=u}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]^=If[n],e[1]^=kf[n]}r.fill(0)}var Er=class e extends ke.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,Rt.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,ke.u32)(this.state)}keccak(){ke.isLE||(0,ke.byteSwap32)(this.state32),jl(this.state32,this.rounds),ke.isLE||(0,ke.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Rt.aexists)(this);let{blockLen:r,state:n}=this;t=(0,ke.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,Rt.aexists)(this,!1),(0,Rt.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,Rt.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Rt.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}};F.Keccak=Er;var je=(e,t,r)=>(0,ke.wrapConstructor)(()=>new Er(t,e,r));F.sha3_224=je(6,144,224/8);F.sha3_256=je(6,136,256/8);F.sha3_384=je(6,104,384/8);F.sha3_512=je(6,72,512/8);F.keccak_224=je(1,144,224/8);F.keccak_256=je(1,136,256/8);F.keccak_384=je(1,104,384/8);F.keccak_512=je(1,72,512/8);var Ul=(e,t,r)=>(0,ke.wrapXOFConstructorWithOpts)((n={})=>new Er(t,e,n.dkLen===void 0?r:n.dkLen,!0));F.shake128=Ul(31,168,128/8);F.shake256=Ul(31,136,256/8)});var Yl=G((H0,Ue)=>{"use strict";var{sha3_512:Of}=Bl(),Hl=24,xr=32,ro=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Gl(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var Wl=(e="")=>Gl(Of(e)).toString(36).slice(1),Ql=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),Df=e=>Ql[Math.floor(e()*Ql.length)],Jl=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+ro(xr,t):ro(xr,t);return Wl(n).substring(0,xr)},Kl=e=>()=>e++,_f=476782367,zl=({random:e=Math.random,counter:t=Kl(Math.floor(e()*_f)),length:r=Hl,fingerprint:n=Jl({random:e})}={})=>function(){let o=Df(e),s=Date.now().toString(36),a=t().toString(36),l=ro(r,e),u=`${s+l+a+n}`;return`${o+Wl(u).substring(1,r)}`},Nf=zl(),Mf=(e,{minLength:t=2,maxLength:r=xr}={})=>{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};Ue.exports.getConstants=()=>({defaultLength:Hl,bigLength:xr});Ue.exports.init=zl;Ue.exports.createId=Nf;Ue.exports.bufToBigInt=Gl;Ue.exports.createCounter=Kl;Ue.exports.createFingerprint=Jl;Ue.exports.isCuid=Mf});var Zl=G((G0,br)=>{"use strict";var{createId:Ff,init:Lf,getConstants:$f,isCuid:Vf}=Yl();br.exports.createId=Ff;br.exports.init=Lf;br.exports.getConstants=$f;br.exports.isCuid=Vf});var Fg={};st(Fg,{DMMF:()=>Xt,Debug:()=>L,Decimal:()=>Q,Extensions:()=>ri,MetricsClient:()=>vt,PrismaClientInitializationError:()=>I,PrismaClientKnownRequestError:()=>U,PrismaClientRustPanicError:()=>te,PrismaClientUnknownRequestError:()=>Y,PrismaClientValidationError:()=>Z,Public:()=>ni,Sql:()=>se,createParam:()=>ua,defineDmmfProperty:()=>ga,deserializeJsonResponse:()=>dt,deserializeRawResult:()=>Zn,dmmfToRuntimeDataModel:()=>Ms,empty:()=>Ea,getPrismaClient:()=>cc,getRuntime:()=>In,join:()=>wa,makeStrictEnum:()=>pc,makeTypedQueryFactory:()=>ha,objectEnumValues:()=>fn,raw:()=>_i,serializeJsonQuery:()=>bn,skip:()=>xn,sqltag:()=>Ni,warnEnvConflicts:()=>dc,warnOnce:()=>zt});module.exports=wc(Fg);var ri={};st(ri,{defineExtension:()=>$o,getExtensionContext:()=>Vo});function $o(e){return typeof e=="function"?e:t=>t.$extends(e)}function Vo(e){return e}var ni={};st(ni,{validator:()=>qo});function qo(...e){return t=>t}var Qr={};st(Qr,{$:()=>Ho,bgBlack:()=>Rc,bgBlue:()=>Dc,bgCyan:()=>Nc,bgGreen:()=>kc,bgMagenta:()=>_c,bgRed:()=>Ic,bgWhite:()=>Mc,bgYellow:()=>Oc,black:()=>Tc,blue:()=>Ge,bold:()=>ee,cyan:()=>Ce,dim:()=>Qe,gray:()=>Ut,green:()=>jt,grey:()=>Sc,hidden:()=>Pc,inverse:()=>bc,italic:()=>xc,magenta:()=>Cc,red:()=>Te,reset:()=>Ec,strikethrough:()=>vc,underline:()=>ie,white:()=>Ac,yellow:()=>He});var ii,jo,Uo,Bo,Qo=!0;typeof process<"u"&&({FORCE_COLOR:ii,NODE_DISABLE_COLORS:jo,NO_COLOR:Uo,TERM:Bo}=process.env||{},Qo=process.stdout&&process.stdout.isTTY);var Ho={enabled:!jo&&Uo==null&&Bo!=="dumb"&&(ii!=null&&ii!=="0"||Qo)};function N(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ho.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Ec=N(0,0),ee=N(1,22),Qe=N(2,22),xc=N(3,23),ie=N(4,24),bc=N(7,27),Pc=N(8,28),vc=N(9,29),Tc=N(30,39),Te=N(31,39),jt=N(32,39),He=N(33,39),Ge=N(34,39),Cc=N(35,39),Ce=N(36,39),Ac=N(37,39),Ut=N(90,39),Sc=N(90,39),Rc=N(40,49),Ic=N(41,49),kc=N(42,49),Oc=N(43,49),Dc=N(44,49),_c=N(45,49),Nc=N(46,49),Mc=N(47,49);var Fc=100,Go=["green","yellow","blue","magenta","cyan","red"],Bt=[],Wo=Date.now(),Lc=0,oi=typeof process<"u"?process.env:{};globalThis.DEBUG??=oi.DEBUG??"";globalThis.DEBUG_COLORS??=oi.DEBUG_COLORS?oi.DEBUG_COLORS==="true":!0;var Qt={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 $c(e){let t={color:Go[Lc++%Go.length],enabled:Qt.enabled(e),namespace:e,log:Qt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Bt.push([o,...n]),Bt.length>Fc&&Bt.shift(),Qt.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Vc(c)),u=`+${Date.now()-Wo}ms`;Wo=Date.now(),globalThis.DEBUG_COLORS?a(Qr[s](ee(o)),...l,Qr[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var L=new Proxy($c,{get:(e,t)=>Qt[t],set:(e,t,r)=>Qt[t]=r});function Vc(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 Jo(e=7500){let t=Bt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
4
- `);return t.length<e?t:t.slice(-e)}function Ko(){Bt.length=0}var zo=L;var jc=Yo(),si=jc.version;function at(e){let t=Uc();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":Bc(e))}function Uc(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function Bc(e){return e?.previewFeatures.includes("queryCompiler")?"client":"library"}var es=q(Xo(),1);function ai(e){let t=(0,es.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var ts="prisma+postgres",Hr=`${ts}:`;function Gr(e){return e?.toString().startsWith(`${Hr}//`)??!1}function li(e){if(!Gr(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")}var Gt={};st(Gt,{error:()=>Gc,info:()=>Hc,log:()=>Qc,query:()=>Wc,should:()=>is,tags:()=>Ht,warn:()=>ui});var Ht={error:Te("prisma:error"),warn:He("prisma:warn"),info:Ce("prisma:info"),query:Ge("prisma:query")},is={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Qc(...e){console.log(...e)}function ui(e,...t){is.warn()&&console.warn(`${Ht.warn} ${e}`,...t)}function Hc(e,...t){console.info(`${Ht.info} ${e}`,...t)}function Gc(e,...t){console.error(`${Ht.error} ${e}`,...t)}function Wc(e,...t){console.log(`${Ht.query} ${e}`,...t)}function de(e,t){throw new Error(t)}var Wt=q(require("node:path"));function pi(e){return Wt.default.sep===Wt.default.posix.sep?e:e.split(Wt.default.sep).join(Wt.default.posix.sep)}var gi=q(ms()),Wr=q(require("node:fs"));var lt=q(require("node:path"));function fs(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",u=r(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var fi=zo("prisma:tryLoadEnv");function Kt({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=gs(e);r.conflictCheck!=="none"&&up(n,t,r.conflictCheck);let i=null;return hs(n?.path,t)||(i=gs(t)),!n&&!i&&fi("No Environment variables loaded"),i?.dotenvResult.error?console.error(Te(ee("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
5
- `),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function up(e,t,r){let n=e?.dotenvResult.parsed,i=!hs(e?.path,t);if(n&&t&&i&&Wr.default.existsSync(t)){let o=gi.default.parse(Wr.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=lt.default.relative(process.cwd(),e.path),l=lt.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${ie(a)} and ${ie(l)}
1
+ "use strict";var hc=Object.create;var Qr=Object.defineProperty;var yc=Object.getOwnPropertyDescriptor;var wc=Object.getOwnPropertyNames;var Ec=Object.getPrototypeOf,bc=Object.prototype.hasOwnProperty;var Vo=(e,t)=>()=>(e&&(t=e(e=0)),t);var W=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),at=(e,t)=>{for(var r in t)Qr(e,r,{get:t[r],enumerable:!0})},qo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of wc(t))!bc.call(e,i)&&i!==r&&Qr(e,i,{get:()=>t[i],enumerable:!(n=yc(t,i))||n.enumerable});return e};var U=(e,t,r)=>(r=e!=null?hc(Ec(e)):{},qo(t||!e||!e.__esModule?Qr(r,"default",{value:e,enumerable:!0}):r,e)),xc=e=>qo(Qr({},"__esModule",{value:!0}),e);var es=W((th,Bc)=>{Bc.exports={name:"@prisma/internals",version:"6.9.0-dev.22",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","!**/libquery_engine*","!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":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.5.0",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"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","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","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.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/schema-engine-wasm":"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var rs=W((ih,ts)=>{"use strict";ts.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var ss=W((ah,os)=>{"use strict";os.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 us=W((uh,ls)=>{"use strict";ls.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var di=W((ch,cs)=>{"use strict";var Yc=us();cs.exports=e=>typeof e=="string"?e.replace(Yc(),""):e});var ps=W((mh,Zc)=>{Zc.exports={name:"dotenv",version:"16.5.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var hs=W((fh,Se)=>{"use strict";var fi=require("node:fs"),gi=require("node:path"),Xc=require("node:os"),ep=require("node:crypto"),tp=ps(),ms=tp.version,rp=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function np(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
+ `);let n;for(;(n=rp.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
3
+ `),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function ip(e){let t=gs(e),r=j.configDotenv({path:t});if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=fs(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=sp(r,a);o=j.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return j.parse(o)}function op(e){console.log(`[dotenv@${ms}][WARN] ${e}`)}function Kt(e){console.log(`[dotenv@${ms}][DEBUG] ${e}`)}function fs(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function sp(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function gs(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)fi.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=gi.resolve(process.cwd(),".env.vault");return fi.existsSync(t)?t:null}function ds(e){return e[0]==="~"?gi.join(Xc.homedir(),e.slice(1)):e}function ap(e){!!(e&&e.debug)&&Kt("Loading env from encrypted .env.vault");let r=j._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),j.populate(n,r,e),{parsed:r}}function lp(e){let t=gi.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&Kt("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[ds(e.path)];else{i=[];for(let l of e.path)i.push(ds(l))}let o,s={};for(let l of i)try{let u=j.parse(fi.readFileSync(l,{encoding:r}));j.populate(s,u,e)}catch(u){n&&Kt(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),j.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function up(e){if(fs(e).length===0)return j.configDotenv(e);let t=gs(e);return t?j._configVault(e):(op(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),j.configDotenv(e))}function cp(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=ep.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||l){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw s}}function pp(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override);if(typeof t!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o]),n&&Kt(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var j={configDotenv:lp,_configVault:ap,_parseVault:ip,config:up,decrypt:cp,parse:np,populate:pp};Se.exports.configDotenv=j.configDotenv;Se.exports._configVault=j._configVault;Se.exports._parseVault=j._parseVault;Se.exports.config=j.config;Se.exports.decrypt=j.decrypt;Se.exports.parse=j.parse;Se.exports.populate=j.populate;Se.exports=j});var bs=W((bh,Kr)=>{"use strict";Kr.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()};Kr.exports.default=Kr.exports});var Ci=W((Ky,Qs)=>{"use strict";Qs.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,u,c,p,d,m,g,h,I,T,C,w,O=[];for(l=0;l<i;l++)O.push(l+1),O.push(t.charCodeAt(s+l));for(var de=O.length-1;a<o-3;)for(I=r.charCodeAt(s+(u=a)),T=r.charCodeAt(s+(c=a+1)),C=r.charCodeAt(s+(p=a+2)),w=r.charCodeAt(s+(d=a+3)),m=a+=4,l=0;l<de;l+=2)g=O[l],h=O[l+1],u=e(g,u,c,I,h),c=e(u,c,p,T,h),p=e(c,p,d,C,h),m=e(p,d,m,w,h),O[l]=m,d=p,p=c,c=u,u=g;for(;a<o;)for(I=r.charCodeAt(s+(u=a)),m=++a,l=0;l<de;l+=2)g=O[l],O[l]=m=e(g,u,m,I,O[l+1]),u=g;return m}}()});var Ks=Vo(()=>{"use strict"});var zs=Vo(()=>{"use strict"});var ba=W((Tb,om)=>{om.exports={name:"@prisma/engines-version",version:"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"2060c79ba17c6bb9f5823312b6f6b7f4a845738e"},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 Xi=W(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.anumber=Zi;Ye.abytes=pl;Ye.ahash=sf;Ye.aexists=af;Ye.aoutput=lf;function Zi(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function of(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function pl(e,...t){if(!of(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 sf(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Zi(e.outputLen),Zi(e.blockLen)}function af(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 lf(e,t){pl(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var _l=W(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.add5L=P.add5H=P.add4H=P.add4L=P.add3H=P.add3L=P.rotlBL=P.rotlBH=P.rotlSL=P.rotlSH=P.rotr32L=P.rotr32H=P.rotrBL=P.rotrBH=P.rotrSL=P.rotrSH=P.shrSL=P.shrSH=P.toBig=void 0;P.fromBig=to;P.split=dl;P.add=Cl;var _n=BigInt(2**32-1),eo=BigInt(32);function to(e,t=!1){return t?{h:Number(e&_n),l:Number(e>>eo&_n)}:{h:Number(e>>eo&_n)|0,l:Number(e&_n)|0}}function dl(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}=to(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var ml=(e,t)=>BigInt(e>>>0)<<eo|BigInt(t>>>0);P.toBig=ml;var fl=(e,t,r)=>e>>>r;P.shrSH=fl;var gl=(e,t,r)=>e<<32-r|t>>>r;P.shrSL=gl;var hl=(e,t,r)=>e>>>r|t<<32-r;P.rotrSH=hl;var yl=(e,t,r)=>e<<32-r|t>>>r;P.rotrSL=yl;var wl=(e,t,r)=>e<<64-r|t>>>r-32;P.rotrBH=wl;var El=(e,t,r)=>e>>>r-32|t<<64-r;P.rotrBL=El;var bl=(e,t)=>t;P.rotr32H=bl;var xl=(e,t)=>e;P.rotr32L=xl;var Pl=(e,t,r)=>e<<r|t>>>32-r;P.rotlSH=Pl;var vl=(e,t,r)=>t<<r|e>>>32-r;P.rotlSL=vl;var Tl=(e,t,r)=>t<<r-32|e>>>64-r;P.rotlBH=Tl;var Al=(e,t,r)=>e<<r-32|t>>>64-r;P.rotlBL=Al;function Cl(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Sl=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);P.add3L=Sl;var Rl=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;P.add3H=Rl;var Il=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);P.add4L=Il;var kl=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;P.add4H=kl;var Ol=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);P.add5L=Ol;var Dl=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;P.add5H=Dl;var uf={fromBig:to,split:dl,toBig:ml,shrSH:fl,shrSL:gl,rotrSH:hl,rotrSL:yl,rotrBH:wl,rotrBL:El,rotr32H:bl,rotr32L:xl,rotlSH:Pl,rotlSL:vl,rotlBH:Tl,rotlBL:Al,add:Cl,add3L:Sl,add3H:Rl,add4L:Il,add4H:kl,add5H:Dl,add5L:Ol};P.default=uf});var Nl=W(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.crypto=void 0;var Ue=require("node:crypto");Nn.crypto=Ue&&typeof Ue=="object"&&"webcrypto"in Ue?Ue.webcrypto:Ue&&typeof Ue=="object"&&"randomBytes"in Ue?Ue:void 0});var Ll=W(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.Hash=R.nextTick=R.byteSwapIfBE=R.isLE=void 0;R.isBytes=cf;R.u8=pf;R.u32=df;R.createView=mf;R.rotr=ff;R.rotl=gf;R.byteSwap=io;R.byteSwap32=hf;R.bytesToHex=wf;R.hexToBytes=Ef;R.asyncLoop=xf;R.utf8ToBytes=Fl;R.toBytes=Mn;R.concatBytes=Pf;R.checkOpts=vf;R.wrapConstructor=Tf;R.wrapConstructorWithOpts=Af;R.wrapXOFConstructorWithOpts=Cf;R.randomBytes=Sf;var Rt=Nl(),no=Xi();function cf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function pf(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function df(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function mf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ff(e,t){return e<<32-t|e>>>t}function gf(e,t){return e<<t|e>>>32-t>>>0}R.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function io(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}R.byteSwapIfBE=R.isLE?e=>e:e=>io(e);function hf(e){for(let t=0;t<e.length;t++)e[t]=io(e[t])}var yf=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function wf(e){(0,no.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=yf[e[r]];return t}var ke={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ml(e){if(e>=ke._0&&e<=ke._9)return e-ke._0;if(e>=ke.A&&e<=ke.F)return e-(ke.A-10);if(e>=ke.a&&e<=ke.f)return e-(ke.a-10)}function Ef(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=Ml(e.charCodeAt(o)),a=Ml(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 bf=async()=>{};R.nextTick=bf;async function xf(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,R.nextTick)(),n+=o)}}function Fl(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Mn(e){return typeof e=="string"&&(e=Fl(e)),(0,no.abytes)(e),e}function Pf(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,no.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 ro=class{clone(){return this._cloneInto()}};R.Hash=ro;function vf(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 Tf(e){let t=n=>e().update(Mn(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Af(e){let t=(n,i)=>e(i).update(Mn(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Cf(e){let t=(n,i)=>e(i).update(Mn(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Sf(e=32){if(Rt.crypto&&typeof Rt.crypto.getRandomValues=="function")return Rt.crypto.getRandomValues(new Uint8Array(e));if(Rt.crypto&&typeof Rt.crypto.randomBytes=="function")return Rt.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var Hl=W(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.shake256=L.shake128=L.keccak_512=L.keccak_384=L.keccak_256=L.keccak_224=L.sha3_512=L.sha3_384=L.sha3_256=L.sha3_224=L.Keccak=void 0;L.keccakP=Bl;var It=Xi(),Er=_l(),Oe=Ll(),ql=[],Ul=[],jl=[],Rf=BigInt(0),wr=BigInt(1),If=BigInt(2),kf=BigInt(7),Of=BigInt(256),Df=BigInt(113);for(let e=0,t=wr,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],ql.push(2*(5*n+r)),Ul.push((e+1)*(e+2)/2%64);let i=Rf;for(let o=0;o<7;o++)t=(t<<wr^(t>>kf)*Df)%Of,t&If&&(i^=wr<<(wr<<BigInt(o))-wr);jl.push(i)}var[_f,Nf]=(0,Er.split)(jl,!0),$l=(e,t,r)=>r>32?(0,Er.rotlBH)(e,t,r):(0,Er.rotlSH)(e,t,r),Vl=(e,t,r)=>r>32?(0,Er.rotlBL)(e,t,r):(0,Er.rotlSL)(e,t,r);function Bl(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,u=r[l],c=r[l+1],p=$l(u,c,1)^r[a],d=Vl(u,c,1)^r[a+1];for(let m=0;m<50;m+=10)e[s+m]^=p,e[s+m+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=Ul[s],l=$l(i,o,a),u=Vl(i,o,a),c=ql[s];i=e[c],o=e[c+1],e[c]=l,e[c+1]=u}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]^=_f[n],e[1]^=Nf[n]}r.fill(0)}var br=class e extends Oe.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,It.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,Oe.u32)(this.state)}keccak(){Oe.isLE||(0,Oe.byteSwap32)(this.state32),Bl(this.state32,this.rounds),Oe.isLE||(0,Oe.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,It.aexists)(this);let{blockLen:r,state:n}=this;t=(0,Oe.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,It.aexists)(this,!1),(0,It.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,It.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,It.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}};L.Keccak=br;var je=(e,t,r)=>(0,Oe.wrapConstructor)(()=>new br(t,e,r));L.sha3_224=je(6,144,224/8);L.sha3_256=je(6,136,256/8);L.sha3_384=je(6,104,384/8);L.sha3_512=je(6,72,512/8);L.keccak_224=je(1,144,224/8);L.keccak_256=je(1,136,256/8);L.keccak_384=je(1,104,384/8);L.keccak_512=je(1,72,512/8);var Ql=(e,t,r)=>(0,Oe.wrapXOFConstructorWithOpts)((n={})=>new br(t,e,n.dkLen===void 0?r:n.dkLen,!0));L.shake128=Ql(31,168,128/8);L.shake256=Ql(31,136,256/8)});var Xl=W((tP,Be)=>{"use strict";var{sha3_512:Mf}=Hl(),Wl=24,xr=32,oo=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Jl(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var Kl=(e="")=>Jl(Mf(e)).toString(36).slice(1),Gl=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),Ff=e=>Gl[Math.floor(e()*Gl.length)],zl=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+oo(xr,t):oo(xr,t);return Kl(n).substring(0,xr)},Yl=e=>()=>e++,Lf=476782367,Zl=({random:e=Math.random,counter:t=Yl(Math.floor(e()*Lf)),length:r=Wl,fingerprint:n=zl({random:e})}={})=>function(){let o=Ff(e),s=Date.now().toString(36),a=t().toString(36),l=oo(r,e),u=`${s+l+a+n}`;return`${o+Kl(u).substring(1,r)}`},$f=Zl(),Vf=(e,{minLength:t=2,maxLength:r=xr}={})=>{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};Be.exports.getConstants=()=>({defaultLength:Wl,bigLength:xr});Be.exports.init=Zl;Be.exports.createId=$f;Be.exports.bufToBigInt=Jl;Be.exports.createCounter=Yl;Be.exports.createFingerprint=zl;Be.exports.isCuid=Vf});var eu=W((rP,Pr)=>{"use strict";var{createId:qf,init:Uf,getConstants:jf,isCuid:Bf}=Xl();Pr.exports.createId=qf;Pr.exports.init=Uf;Pr.exports.getConstants=jf;Pr.exports.isCuid=Bf});var Bg={};at(Bg,{DMMF:()=>er,Debug:()=>V,Decimal:()=>H,Extensions:()=>ii,MetricsClient:()=>Tt,PrismaClientInitializationError:()=>k,PrismaClientKnownRequestError:()=>B,PrismaClientRustPanicError:()=>re,PrismaClientUnknownRequestError:()=>Z,PrismaClientValidationError:()=>X,Public:()=>oi,Sql:()=>ae,createParam:()=>da,defineDmmfProperty:()=>wa,deserializeJsonResponse:()=>mt,deserializeRawResult:()=>ei,dmmfToRuntimeDataModel:()=>$s,empty:()=>Pa,getPrismaClient:()=>mc,getRuntime:()=>kn,join:()=>xa,makeStrictEnum:()=>fc,makeTypedQueryFactory:()=>Ea,objectEnumValues:()=>gn,raw:()=>Mi,serializeJsonQuery:()=>Pn,skip:()=>xn,sqltag:()=>Fi,warnEnvConflicts:()=>gc,warnOnce:()=>Yt});module.exports=xc(Bg);var ii={};at(ii,{defineExtension:()=>Uo,getExtensionContext:()=>jo});function Uo(e){return typeof e=="function"?e:t=>t.$extends(e)}function jo(e){return e}var oi={};at(oi,{validator:()=>Bo});function Bo(...e){return t=>t}var Hr={};at(Hr,{$:()=>Jo,bgBlack:()=>Oc,bgBlue:()=>Mc,bgCyan:()=>Lc,bgGreen:()=>_c,bgMagenta:()=>Fc,bgRed:()=>Dc,bgWhite:()=>$c,bgYellow:()=>Nc,black:()=>Sc,blue:()=>We,bold:()=>te,cyan:()=>Ce,dim:()=>He,gray:()=>Bt,green:()=>jt,grey:()=>kc,hidden:()=>Ac,inverse:()=>Tc,italic:()=>vc,magenta:()=>Rc,red:()=>Ae,reset:()=>Pc,strikethrough:()=>Cc,underline:()=>oe,white:()=>Ic,yellow:()=>Ge});var si,Qo,Ho,Go,Wo=!0;typeof process<"u"&&({FORCE_COLOR:si,NODE_DISABLE_COLORS:Qo,NO_COLOR:Ho,TERM:Go}=process.env||{},Wo=process.stdout&&process.stdout.isTTY);var Jo={enabled:!Qo&&Ho==null&&Go!=="dumb"&&(si!=null&&si!=="0"||Wo)};function M(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Jo.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Pc=M(0,0),te=M(1,22),He=M(2,22),vc=M(3,23),oe=M(4,24),Tc=M(7,27),Ac=M(8,28),Cc=M(9,29),Sc=M(30,39),Ae=M(31,39),jt=M(32,39),Ge=M(33,39),We=M(34,39),Rc=M(35,39),Ce=M(36,39),Ic=M(37,39),Bt=M(90,39),kc=M(90,39),Oc=M(40,49),Dc=M(41,49),_c=M(42,49),Nc=M(43,49),Mc=M(44,49),Fc=M(45,49),Lc=M(46,49),$c=M(47,49);var Vc=100,Ko=["green","yellow","blue","magenta","cyan","red"],Qt=[],zo=Date.now(),qc=0,ai=typeof process<"u"?process.env:{};globalThis.DEBUG??=ai.DEBUG??"";globalThis.DEBUG_COLORS??=ai.DEBUG_COLORS?ai.DEBUG_COLORS==="true":!0;var Ht={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 Uc(e){let t={color:Ko[qc++%Ko.length],enabled:Ht.enabled(e),namespace:e,log:Ht.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Qt.push([o,...n]),Qt.length>Vc&&Qt.shift(),Ht.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:jc(c)),u=`+${Date.now()-zo}ms`;zo=Date.now(),globalThis.DEBUG_COLORS?a(Hr[s](te(o)),...l,Hr[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var V=new Proxy(Uc,{get:(e,t)=>Ht[t],set:(e,t,r)=>Ht[t]=r});function jc(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 Yo(e=7500){let t=Qt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
4
+ `);return t.length<e?t:t.slice(-e)}function Zo(){Qt.length=0}var Xo=V;var Qc=es(),li=Qc.version;function lt(e){let t=Hc();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":Gc(e))}function Hc(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function Gc(e){return e?.previewFeatures.includes("queryCompiler")?"client":"library"}var ns=U(rs(),1);function ui(e){let t=(0,ns.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var is="prisma+postgres",Gr=`${is}:`;function Wr(e){return e?.toString().startsWith(`${Gr}//`)??!1}function ci(e){if(!Wr(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")}var Wt={};at(Wt,{error:()=>Kc,info:()=>Jc,log:()=>Wc,query:()=>zc,should:()=>as,tags:()=>Gt,warn:()=>pi});var Gt={error:Ae("prisma:error"),warn:Ge("prisma:warn"),info:Ce("prisma:info"),query:We("prisma:query")},as={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Wc(...e){console.log(...e)}function pi(e,...t){as.warn()&&console.warn(`${Gt.warn} ${e}`,...t)}function Jc(e,...t){console.info(`${Gt.info} ${e}`,...t)}function Kc(e,...t){console.error(`${Gt.error} ${e}`,...t)}function zc(e,...t){console.log(`${Gt.query} ${e}`,...t)}function me(e,t){throw new Error(t)}var Jt=U(require("node:path"));function mi(e){return Jt.default.sep===Jt.default.posix.sep?e:e.split(Jt.default.sep).join(Jt.default.posix.sep)}var yi=U(hs()),Jr=U(require("node:fs"));var ut=U(require("node:path"));function ys(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",u=r(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var hi=Xo("prisma:tryLoadEnv");function zt({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=ws(e);r.conflictCheck!=="none"&&dp(n,t,r.conflictCheck);let i=null;return Es(n?.path,t)||(i=ws(t)),!n&&!i&&hi("No Environment variables loaded"),i?.dotenvResult.error?console.error(Ae(te("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
5
+ `),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function dp(e,t,r){let n=e?.dotenvResult.parsed,i=!Es(e?.path,t);if(n&&t&&i&&Jr.default.existsSync(t)){let o=yi.default.parse(Jr.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=ut.default.relative(process.cwd(),e.path),l=ut.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${oe(a)} and ${oe(l)}
6
6
  Conflicting env vars:
7
- ${s.map(c=>` ${ee(c)}`).join(`
7
+ ${s.map(c=>` ${te(c)}`).join(`
8
8
  `)}
9
9
 
10
- We suggest to move the contents of ${ie(l)} to ${ie(a)} to consolidate your env vars.
11
- `;throw new Error(u)}else if(r==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>ee(c)).join(", ")} in ${ie(a)} and ${ie(l)}
12
- Env vars from ${ie(l)} overwrite the ones from ${ie(a)}
13
- `;console.warn(`${He("warn(prisma)")} ${u}`)}}}}function gs(e){if(cp(e)){fi(`Environment variables loaded from ${e}`);let t=gi.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:fs(t),message:Qe(`Environment variables loaded from ${lt.default.relative(process.cwd(),e)}`),path:e}}else fi(`Environment variables not found at ${e}`);return null}function hs(e,t){return e&&t&&lt.default.resolve(e)===lt.default.resolve(t)}function cp(e){return!!(e&&Wr.default.existsSync(e))}function hi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ut(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function yi(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 b(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var ws=new Set,zt=(e,t,...r)=>{ws.has(e)||(ws.add(e),ui(t,...r))};var I=class e extends Error{clientVersion;errorCode;retryable;constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};b(I,"PrismaClientInitializationError");var U=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};b(U,"PrismaClientKnownRequestError");var te=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};b(te,"PrismaClientRustPanicError");var Y=class extends Error{clientVersion;batchRequestIdx;constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};b(Y,"PrismaClientUnknownRequestError");var Z=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};b(Z,"PrismaClientValidationError");var ct=9e15,Me=1e9,wi="0123456789abcdef",Yr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Zr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ei={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ct,maxE:ct,crypto:!1},vs,Se,x=!0,en="[DecimalError] ",Ne=en+"Invalid argument: ",Ts=en+"Precision limit exceeded",Cs=en+"crypto unavailable",As="[object Decimal]",X=Math.floor,B=Math.pow,pp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,dp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,mp=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ss=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,me=1e7,E=7,fp=9007199254740991,gp=Yr.length-1,xi=Zr.length-1,f={toStringTag:As};f.absoluteValue=f.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};f.ceil=function(){return y(new this.constructor(this),this.e+1,2)};f.clampedTo=f.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Ne+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};f.comparedTo=f.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};f.cosine=f.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+E,n.rounding=1,r=hp(n,Ds(n,r)),n.precision=e,n.rounding=t,y(Se==2||Se==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};f.cubeRoot=f.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(x=!1,o=c.s*B(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=W(c.d),e=c.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=B(r,1/3),e=X((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=_(u.plus(c).times(a),u.plus(l),s+2,1),W(a.d).slice(0,s)===(r=W(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return x=!0,y(n,e,p.rounding,t)};f.decimalPlaces=f.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-X(this.e/E))*E,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};f.dividedBy=f.div=function(e){return _(this,new this.constructor(e))};f.dividedToIntegerBy=f.divToInt=function(e){var t=this,r=t.constructor;return y(_(t,new r(e),0,1,1),r.precision,r.rounding)};f.equals=f.eq=function(e){return this.cmp(e)===0};f.floor=function(){return y(new this.constructor(this),this.e+1,3)};f.greaterThan=f.gt=function(e){return this.cmp(e)>0};f.greaterThanOrEqualTo=f.gte=function(e){var t=this.cmp(e);return t==1||t===0};f.hyperbolicCosine=f.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/rn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=pt(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return y(o,s.precision=r,s.rounding=n,!0)};f.hyperbolicSine=f.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=pt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/rn(5,e)),i=pt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,y(i,t,r,!0)};f.hyperbolicTangent=f.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,_(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};f.inverseCosine=f.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?he(t,n,i):new t(0):new t(NaN):e.isZero()?he(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};f.inverseHyperbolicCosine=f.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,x=!1,r=r.times(r).minus(1).sqrt().plus(r),x=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};f.inverseHyperbolicSine=f.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,x=!1,r=r.times(r).plus(1).sqrt().plus(r),x=!0,n.precision=e,n.rounding=t,r.ln())};f.inverseHyperbolicTangent=f.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?y(new o(i),e,t,!0):(o.precision=r=n-i.e,i=_(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};f.inverseSine=f.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=he(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};f.inverseTangent=f.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=xi)return s=he(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=xi)return s=he(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,r=Math.min(28,a/E+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(x=!1,t=Math.ceil(a/E),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),x=!0,y(s,c.precision=p,c.rounding=d,!0)};f.isFinite=function(){return!!this.d};f.isInteger=f.isInt=function(){return!!this.d&&X(this.e/E)>this.d.length-2};f.isNaN=function(){return!this.s};f.isNegative=f.isNeg=function(){return this.s<0};f.isPositive=f.isPos=function(){return this.s>0};f.isZero=function(){return!!this.d&&this.d[0]===0};f.lessThan=f.lt=function(e){return this.cmp(e)<0};f.lessThanOrEqualTo=f.lte=function(e){return this.cmp(e)<1};f.logarithm=f.log=function(e){var t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding,m=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(x=!1,a=p+m,s=_e(u,a),n=t?Xr(c,a+10):_e(e,a),l=_(s,n,a,1),Yt(l.d,i=p,d))do if(a+=10,s=_e(u,a),n=t?Xr(c,a+10):_e(e,a),l=_(s,n,a,1),!o){+W(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(Yt(l.d,i+=10,d));return x=!0,y(l,p,d)};f.minus=f.sub=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,m=this,g=m.constructor;if(e=new g(e),!m.d||!e.d)return!m.s||!e.s?e=new g(NaN):m.d?e.s=-e.s:e=new g(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(u=m.d,d=e.d,a=g.precision,l=g.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new g(m);else return new g(l===3?-0:0);return x?y(e,a,l):e}if(r=X(e.e/E),c=X(m.e/E),u=u.slice(),o=c-r,o){for(p=o<0,p?(t=u,o=-o,s=d.length):(t=d,r=c,s=u.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=d.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(u[n]!=d[n]){p=u[n]<d[n];break}o=0}for(p&&(t=u,u=d,d=t,e.s=-e.s),s=u.length,n=d.length-s;n>0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]<d[n]){for(i=n;i&&u[--i]===0;)u[i]=me-1;--u[i],u[n]+=me}u[n]-=d[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(e.d=u,e.e=tn(u,r),x?y(e,a,l):e):new g(l===3?-0:0)};f.modulo=f.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?y(new n(r),n.precision,n.rounding):(x=!1,n.modulo==9?(t=_(r,e.abs(),0,3,1),t.s*=e.s):t=_(r,e,0,n.modulo,1),t=t.times(e),x=!0,r.minus(t))};f.naturalExponential=f.exp=function(){return bi(this)};f.naturalLogarithm=f.ln=function(){return _e(this)};f.negated=f.neg=function(){var e=new this.constructor(this);return e.s=-e.s,y(e)};f.plus=f.add=function(e){var t,r,n,i,o,s,a,l,u,c,p=this,d=p.constructor;if(e=new d(e),!p.d||!e.d)return!p.s||!e.s?e=new d(NaN):p.d||(e=new d(e.d||p.s===e.s?p:NaN)),e;if(p.s!=e.s)return e.s=-e.s,p.minus(e);if(u=p.d,c=e.d,a=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(p)),x?y(e,a,l):e;if(o=X(p.e/E),n=X(e.e/E),u=u.slice(),i=o-n,i){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=o,s=u.length),o=Math.ceil(a/E),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/me|0,u[i]%=me;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=tn(u,n),x?y(e,a,l):e};f.precision=f.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ne+e);return r.d?(t=Rs(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};f.round=function(){var e=this,t=e.constructor;return y(new t(e),e.e+1,t.rounding)};f.sine=f.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+E,n.rounding=1,r=wp(n,Ds(n,r)),n.precision=e,n.rounding=t,y(Se>2?r.neg():r,e,t,!0)):new n(NaN)};f.squareRoot=f.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(x=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=W(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=X((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new c(t)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(o=n,n=o.plus(_(s,o,r+2,1)).times(.5),W(o.d).slice(0,r)===(t=W(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return x=!0,y(n,l,c.rounding,e)};f.tangent=f.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=_(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,y(Se==2||Se==4?r.neg():r,e,t,!0)):new n(NaN)};f.times=f.mul=function(e){var t,r,n,i,o,s,a,l,u,c=this,p=c.constructor,d=c.d,m=(e=new p(e)).d;if(e.s*=c.s,!d||!d[0]||!m||!m[0])return new p(!e.s||d&&!d[0]&&!m||m&&!m[0]&&!d?NaN:!d||!m?e.s/0:e.s*0);for(r=X(c.e/E)+X(e.e/E),l=d.length,u=m.length,l<u&&(o=d,d=m,m=o,s=l,l=u,u=s),o=[],s=l+u,n=s;n--;)o.push(0);for(n=u;--n>=0;){for(t=0,i=l+n;i>n;)a=o[i]+m[n]*d[i-n-1]+t,o[i--]=a%me|0,t=a/me|0;o[i]=(o[i]+t)%me|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=tn(o,r),x?y(e,p.precision,p.rounding):e};f.toBinary=function(e,t){return Pi(this,2,e,t)};f.toDecimalPlaces=f.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(oe(e,0,Me),t===void 0?t=n.rounding:oe(t,0,8),y(r,e+r.e+1,t))};f.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ye(n,!0):(oe(e,0,Me),t===void 0?t=i.rounding:oe(t,0,8),n=y(new i(n),e+1,t),r=ye(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};f.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=ye(i):(oe(e,0,Me),t===void 0?t=o.rounding:oe(t,0,8),n=y(new o(i),e+i.e+1,t),r=ye(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};f.toFraction=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,m=this,g=m.d,h=m.constructor;if(!g)return new h(m);if(u=r=new h(1),n=l=new h(0),t=new h(n),o=t.e=Rs(g)-m.e-1,s=o%E,t.d[0]=B(10,s<0?E+s:s),e==null)e=o>0?t:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error(Ne+a);e=a.gt(t)?o>0?t:u:a}for(x=!1,a=new h(W(g)),c=h.precision,h.precision=o=g.length*E*2;p=_(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=_(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=m.s,d=_(u,n,o,1).minus(m).abs().cmp(_(l,r,o,1).minus(m).abs())<1?[u,n]:[l,r],h.precision=c,x=!0,d};f.toHexadecimal=f.toHex=function(e,t){return Pi(this,16,e,t)};f.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:oe(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(x=!1,r=_(r,e,0,t,1).times(e),x=!0,y(r)):(e.s=r.s,r=e),r};f.toNumber=function(){return+this};f.toOctal=function(e,t){return Pi(this,8,e,t)};f.toPower=f.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(B(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(t=X(e.e/E),t>=e.d.length-1&&(r=u<0?-u:u)<=fp)return i=Is(l,a,r,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new l(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=B(+a,u),t=r==0||!isFinite(r)?X(u*(Math.log("0."+W(a.d))/Math.LN10+a.e+1)):new l(r+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(x=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=bi(e.times(_e(a,n+r)),n),i.d&&(i=y(i,n+5,1),Yt(i.d,n,o)&&(t=n+10,i=y(bi(e.times(_e(a,t+r)),t),t+5,1),+W(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,x=!0,l.rounding=o,y(i,n,o))};f.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ye(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,Me),t===void 0?t=i.rounding:oe(t,0,8),n=y(new i(n),e,t),r=ye(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};f.toSignificantDigits=f.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(oe(e,1,Me),t===void 0?t=n.rounding:oe(t,0,8)),y(new n(r),e,t)};f.toString=function(){var e=this,t=e.constructor,r=ye(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};f.truncated=f.trunc=function(){return y(new this.constructor(this),this.e+1,1)};f.valueOf=f.toJSON=function(){var e=this,t=e.constructor,r=ye(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function W(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=E-n.length,r&&(o+=De(r)),o+=n;s=e[t],n=s+"",r=E-n.length,r&&(o+=De(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function oe(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Ne+e)}function Yt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=E,i=0):(i=Math.ceil((t+1)/E),t%=E),o=B(10,E-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==B(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==B(10,t-3)-1,s}function Kr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=wi.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function hp(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/rn(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=pt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var _=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;a<o;a++)if(n[a]!=i[a]){l=n[a]>i[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,d,m,g,h,R,T,C,w,k,pe,le,qt,V,ne,ve,K,ot,Ur=n.constructor,ti=n.s==i.s?1:-1,z=n.d,D=i.d;if(!z||!z[0]||!D||!D[0])return new Ur(!n.s||!i.s||(z?D&&z[0]==D[0]:!D)?NaN:z&&z[0]==0||!D?ti*0:ti/0);for(l?(m=1,c=n.e-i.e):(l=me,m=E,c=X(n.e/m)-X(i.e/m)),K=D.length,ne=z.length,T=new Ur(ti),C=T.d=[],p=0;D[p]==(z[p]||0);p++);if(D[p]>(z[p]||0)&&c--,o==null?(le=o=Ur.precision,s=Ur.rounding):a?le=o+(n.e-i.e)+1:le=o,le<0)C.push(1),g=!0;else{if(le=le/m+2|0,p=0,K==1){for(d=0,D=D[0],le++;(p<ne||d)&&le--;p++)qt=d*l+(z[p]||0),C[p]=qt/D|0,d=qt%D|0;g=d||p<ne}else{for(d=l/(D[0]+1)|0,d>1&&(D=e(D,d,l),z=e(z,d,l),K=D.length,ne=z.length),V=K,w=z.slice(0,K),k=w.length;k<K;)w[k++]=0;ot=D.slice(),ot.unshift(0),ve=D[0],D[1]>=l/2&&++ve;do d=0,u=t(D,w,K,k),u<0?(pe=w[0],K!=k&&(pe=pe*l+(w[1]||0)),d=pe/ve|0,d>1?(d>=l&&(d=l-1),h=e(D,d,l),R=h.length,k=w.length,u=t(h,w,R,k),u==1&&(d--,r(h,K<R?ot:D,R,l))):(d==0&&(u=d=1),h=D.slice()),R=h.length,R<k&&h.unshift(0),r(w,h,k,l),u==-1&&(k=w.length,u=t(D,w,K,k),u<1&&(d++,r(w,K<k?ot:D,k,l))),k=w.length):u===0&&(d++,w=[0]),C[p++]=d,u&&w[0]?w[k++]=z[V]||0:(w=[z[V]],k=1);while((V++<ne||w[0]!==void 0)&&le--);g=w[0]!==void 0}C[0]||C.shift()}if(m==1)T.e=c,vs=g;else{for(p=1,d=C[0];d>=10;d/=10)p++;T.e=p+c*m-1,y(T,a?o+T.e+1:o,s,g)}return T}}();function y(e,t,r,n){var i,o,s,a,l,u,c,p,d,m=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=E,s=t,c=p[d=0],l=c/B(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/E),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);c=l=0,i=1,o%=E,s=o-E+1}else break e;else{for(c=a=p[d],i=1;a>=10;a/=10)i++;o%=E,s=o-E+i,l=s<0?0:c/B(10,i-s-1)%10|0}if(n=n||t<0||p[d+1]!==void 0||(s<0?c:c%B(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?c/B(10,i-s):0:p[d-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,u?(t-=e.e+1,p[0]=B(10,(E-t%E)%E),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=B(10,E-o),p[d]=s>0?(c/B(10,i-s)%B(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==me&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=me)break;p[d--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return x&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function ye(e,t,r){if(!e.isFinite())return Os(e);var n,i=e.e,o=W(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+De(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+De(-i-1)+o,r&&(n=r-s)>0&&(o+=De(n))):i>=s?(o+=De(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+De(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=De(n))),o}function tn(e,t){var r=e[0];for(t*=E;r>=10;r/=10)t++;return t}function Xr(e,t,r){if(t>gp)throw x=!0,r&&(e.precision=r),Error(Ts);return y(new e(Yr),t,1,!0)}function he(e,t,r){if(t>xi)throw Error(Ts);return y(new e(Zr),t,r,!0)}function Rs(e){var t=e.length-1,r=t*E+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function De(e){for(var t="";e--;)t+="0";return t}function Is(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/E+4);for(x=!1;;){if(r%2&&(o=o.times(t),bs(o.d,s)&&(i=!0)),r=X(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),bs(t.d,s)}return x=!0,o}function xs(e){return e.d[e.d.length-1]&1}function ks(e,t,r){for(var n,i,o=new e(t[0]),s=0;++s<t.length;){if(i=new e(t[s]),!i.s){o=i;break}n=o.cmp(i),(n===r||n===0&&o.s===r)&&(o=i)}return o}function bi(e,t){var r,n,i,o,s,a,l,u=0,c=0,p=0,d=e.constructor,m=d.rounding,g=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(x=!1,l=g):l=t,a=new d(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(B(2,p))/Math.LN10*2+5|0,l+=n,r=o=s=new d(1),d.precision=l;;){if(o=y(o.times(e),l,1),r=r.times(++c),a=s.plus(_(o,r,l,1)),W(a.d).slice(0,l)===W(s.d).slice(0,l)){for(i=p;i--;)s=y(s.times(s),l,1);if(t==null)if(u<3&&Yt(s.d,l-n,m,u))d.precision=l+=10,r=o=a=new d(1),c=0,u++;else return y(s,d.precision=g,m,x=!0);else return d.precision=g,s}s=a}}function _e(e,t){var r,n,i,o,s,a,l,u,c,p,d,m=1,g=10,h=e,R=h.d,T=h.constructor,C=T.rounding,w=T.precision;if(h.s<0||!R||!R[0]||!h.e&&R[0]==1&&R.length==1)return new T(R&&!R[0]?-1/0:h.s!=1?NaN:R?0:h);if(t==null?(x=!1,c=w):c=t,T.precision=c+=g,r=W(R),n=r.charAt(0),Math.abs(o=h.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=W(h.d),n=r.charAt(0),m++;o=h.e,n>1?(h=new T("0."+r),o++):h=new T(n+"."+r.slice(1))}else return u=Xr(T,c+2,w).times(o+""),h=_e(new T(n+"."+r.slice(1)),c-g).plus(u),T.precision=w,t==null?y(h,w,C,x=!0):h;for(p=h,l=s=h=_(h.minus(1),h.plus(1),c,1),d=y(h.times(h),c,1),i=3;;){if(s=y(s.times(d),c,1),u=l.plus(_(s,new T(i),c,1)),W(u.d).slice(0,c)===W(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(Xr(T,c+2,w).times(o+""))),l=_(l,new T(m),c,1),t==null)if(Yt(l.d,c-g,C,a))T.precision=c+=g,u=s=h=_(p.minus(1),p.plus(1),c,1),d=y(h.times(h),c,1),i=a=1;else return y(l,T.precision=w,C,x=!0);else return T.precision=w,l;l=u,i+=2}}function Os(e){return String(e.s*e.s/0)}function zr(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%E,r<0&&(n+=E),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=E;n<i;)e.d.push(+t.slice(n,n+=E));t=t.slice(n),n=E-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),x&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function yp(e,t){var r,n,i,o,s,a,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Ss.test(t))return zr(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(dp.test(t))r=16,t=t.toLowerCase();else if(pp.test(t))r=2;else if(mp.test(t))r=8;else throw Error(Ne+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Is(n,new n(r),o,o*2)),u=Kr(t,r,me),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=tn(u,c),e.d=u,x=!1,s&&(e=_(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?B(2,l):We.pow(2,l))),x=!0,e)}function wp(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:pt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/rn(5,r)),t=pt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function pt(e,t,r,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/E);for(x=!1,l=r.times(r),a=new e(n);;){if(s=_(a.times(l),new e(t++*t++),c,1),a=i?n.plus(s):n.minus(s),n=_(s.times(l),new e(t++*t++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return x=!0,s.d.length=p+1,s}function rn(e,t){for(var r=e;--t;)r*=e;return r}function Ds(e,t){var r,n=t.s<0,i=he(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Se=n?4:1,t;if(r=t.divToInt(i),r.isZero())Se=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Se=xs(r)?n?2:3:n?4:1,t;Se=xs(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Pi(e,t,r,n){var i,o,s,a,l,u,c,p,d,m=e.constructor,g=r!==void 0;if(g?(oe(r,1,Me),n===void 0?n=m.rounding:oe(n,0,8)):(r=m.precision,n=m.rounding),!e.isFinite())c=Os(e);else{for(c=ye(e),s=c.indexOf("."),g?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(c=c.replace(".",""),d=new m(1),d.e=c.length-s,d.d=Kr(ye(d),10,i),d.e=d.d.length),p=Kr(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new m(e),e.d=p,e.e=o,e=_(e,d,r,n,0,i),p=e.d,o=e.e,u=vs),s=p[r],a=i/2,u=u||p[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,u)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s<l;s++)c+=wi.charAt(p[s]);if(g){if(l>1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)c+="0";for(p=Kr(c,i,t),l=p.length;!p[l-1];--l);for(s=1,c="1.";s<l;s++)c+=wi.charAt(p[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}c=(t==16?"0x":t==2?"0b":t==8?"0o":"")+c}return e.s<0?"-"+c:c}function bs(e,t){if(e.length>t)return e.length=t,!0}function Ep(e){return new this(e).abs()}function xp(e){return new this(e).acos()}function bp(e){return new this(e).acosh()}function Pp(e,t){return new this(e).plus(t)}function vp(e){return new this(e).asin()}function Tp(e){return new this(e).asinh()}function Cp(e){return new this(e).atan()}function Ap(e){return new this(e).atanh()}function Sp(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=he(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?he(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=he(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(_(e,t,o,1)),t=he(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(_(e,t,o,1)),r}function Rp(e){return new this(e).cbrt()}function Ip(e){return y(e=new this(e),e.e+1,2)}function kp(e,t,r){return new this(e).clamp(t,r)}function Op(e){if(!e||typeof e!="object")throw Error(en+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Me,"rounding",0,8,"toExpNeg",-ct,0,"toExpPos",0,ct,"maxE",0,ct,"minE",-ct,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=Ei[r]),(n=e[r])!==void 0)if(X(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Ne+r+": "+n);if(r="crypto",i&&(this[r]=Ei[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Cs);else this[r]=!1;else throw Error(Ne+r+": "+n);return this}function Dp(e){return new this(e).cos()}function _p(e){return new this(e).cosh()}function _s(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,Ps(o)){u.s=o.s,x?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e<i.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(l=typeof o,l==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;x?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[o]):(u.e=s,u.d=[o]);return}if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return zr(u,o.toString())}if(l==="string")return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),Ss.test(o)?zr(u,o):yp(u,o);if(l==="bigint")return o<0?(o=-o,u.s=-1):u.s=1,zr(u,o.toString());throw Error(Ne+o)}if(i.prototype=f,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Op,i.clone=_s,i.isDecimal=Ps,i.abs=Ep,i.acos=xp,i.acosh=bp,i.add=Pp,i.asin=vp,i.asinh=Tp,i.atan=Cp,i.atanh=Ap,i.atan2=Sp,i.cbrt=Rp,i.ceil=Ip,i.clamp=kp,i.cos=Dp,i.cosh=_p,i.div=Np,i.exp=Mp,i.floor=Fp,i.hypot=Lp,i.ln=$p,i.log=Vp,i.log10=jp,i.log2=qp,i.max=Up,i.min=Bp,i.mod=Qp,i.mul=Hp,i.pow=Gp,i.random=Wp,i.round=Jp,i.sign=Kp,i.sin=zp,i.sinh=Yp,i.sqrt=Zp,i.sub=Xp,i.sum=ed,i.tan=td,i.tanh=rd,i.trunc=nd,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function Np(e,t){return new this(e).div(t)}function Mp(e){return new this(e).exp()}function Fp(e){return y(e=new this(e),e.e+1,3)}function Lp(){var e,t,r=new this(0);for(x=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return x=!0,new this(1/0);r=t}return x=!0,r.sqrt()}function Ps(e){return e instanceof We||e&&e.toStringTag===As||!1}function $p(e){return new this(e).ln()}function Vp(e,t){return new this(e).log(t)}function qp(e){return new this(e).log(2)}function jp(e){return new this(e).log(10)}function Up(){return ks(this,arguments,-1)}function Bp(){return ks(this,arguments,1)}function Qp(e,t){return new this(e).mod(t)}function Hp(e,t){return new this(e).mul(t)}function Gp(e,t){return new this(e).pow(t)}function Wp(e){var t,r,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:oe(e,1,Me),n=Math.ceil(e/E),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Cs);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=E,n&&e&&(i=B(10,E-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=E)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<E&&(r-=E-n)}return s.e=r,s.d=a,s}function Jp(e){return y(e=new this(e),e.e+1,this.rounding)}function Kp(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function zp(e){return new this(e).sin()}function Yp(e){return new this(e).sinh()}function Zp(e){return new this(e).sqrt()}function Xp(e,t){return new this(e).sub(t)}function ed(){var e=0,t=arguments,r=new this(t[e]);for(x=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return x=!0,y(r,this.precision,this.rounding)}function td(e){return new this(e).tan()}function rd(e){return new this(e).tanh()}function nd(e){return y(e=new this(e),e.e+1,1)}f[Symbol.for("nodejs.util.inspect.custom")]=f.toString;f[Symbol.toStringTag]="Decimal";var We=f.constructor=_s(Ei);Yr=new We(Yr);Zr=new We(Zr);var Q=We;function dt(e){return e===null?e:Array.isArray(e)?e.map(dt):typeof e=="object"?id(e)?od(e):typeof e=="bigint"||e instanceof Date||e instanceof Uint8Array||e instanceof Q?e:ut(e,dt):e}function id(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function od({$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 Q(t);case"Json":return JSON.parse(t);default:de(t,"Unknown tagged value")}}var we=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 Fe(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Ns(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function Zt(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Ms(e){return{models:vi(e.models),enums:vi(e.enums),types:vi(e.types)}}function vi(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function mt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function nn(e){return e.toString()!=="Invalid Date"}function ft(e){return We.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 Xt={};st(Xt,{ModelAction:()=>gt,datamodelEnumToSchemaEnum:()=>sd});function sd(e){return{name:e.name,values:e.values.map(t=>t.name)}}var gt=(w=>(w.findUnique="findUnique",w.findUniqueOrThrow="findUniqueOrThrow",w.findFirst="findFirst",w.findFirstOrThrow="findFirstOrThrow",w.findMany="findMany",w.create="create",w.createMany="createMany",w.createManyAndReturn="createManyAndReturn",w.update="update",w.updateMany="updateMany",w.updateManyAndReturn="updateManyAndReturn",w.upsert="upsert",w.delete="delete",w.deleteMany="deleteMany",w.groupBy="groupBy",w.count="count",w.aggregate="aggregate",w.findRaw="findRaw",w.aggregateRaw="aggregateRaw",w))(gt||{});var qs=q(ns());var Vs=q(require("node:fs"));var Fs={keyword:Ce,entity:Ce,value:e=>ee(Ge(e)),punctuation:Ge,directive:Ce,function:Ce,variable:e=>ee(Ge(e)),string:e=>ee(jt(e)),boolean:He,number:Ce,comment:Ut};var ad=e=>e,on={},ld=0,v={manual:on.Prism&&on.Prism.manual,disableWorkerMessageHandler:on.Prism&&on.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof fe){let t=e;return new fe(t.type,v.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(v.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:++ld}),e.__id},clone:function e(t,r){let n,i,o=v.util.type(t);switch(r=r||{},o){case"Object":if(i=v.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=v.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=v.util.clone(v.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||v.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,v.languages.DFS(v.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=v.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=v.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 v.hooks.run("before-tokenize",n),n.tokens=v.tokenize(n.code,n.grammar),v.hooks.run("after-tokenize",n),fe.stringify(v.util.encode(n.tokens),n.language)},matchGrammar:function(e,t,r,n,i,o,s){for(let h in r){if(!r.hasOwnProperty(h)||!r[h])continue;if(h==s)return;let R=r[h];R=v.util.type(R)==="Array"?R:[R];for(let T=0;T<R.length;++T){let C=R[T],w=C.inside,k=!!C.lookbehind,pe=!!C.greedy,le=0,qt=C.alias;if(pe&&!C.pattern.global){let V=C.pattern.toString().match(/[imuy]*$/)[0];C.pattern=RegExp(C.pattern.source,V+"g")}C=C.pattern||C;for(let V=n,ne=i;V<t.length;ne+=t[V].length,++V){let ve=t[V];if(t.length>e.length)return;if(ve instanceof fe)continue;if(pe&&V!=t.length-1){C.lastIndex=ne;var p=C.exec(e);if(!p)break;var c=p.index+(k?p[1].length:0),d=p.index+p[0].length,a=V,l=ne;for(let D=t.length;a<D&&(l<d||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++V,ne=l);if(t[V]instanceof fe)continue;u=a-V,ve=e.slice(ne,l),p.index-=ne}else{C.lastIndex=0;var p=C.exec(ve),u=1}if(!p){if(o)break;continue}k&&(le=p[1]?p[1].length:0);var c=p.index+le,p=p[0].slice(le),d=c+p.length,m=ve.slice(0,c),g=ve.slice(d);let K=[V,u];m&&(++V,ne+=m.length,K.push(m));let ot=new fe(h,w?v.tokenize(p,w):p,qt,p,pe);if(K.push(ot),g&&K.push(g),Array.prototype.splice.apply(t,K),u!=1&&v.matchGrammar(e,t,r,V,ne,!0,h),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 v.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=v.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=v.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:fe};v.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:/[{}[\];(),.:]/};v.languages.javascript=v.languages.extend("clike",{"class-name":[v.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}/});v.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;v.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:v.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:v.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:v.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:v.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});v.languages.markup&&v.languages.markup.tag.addInlined("script","javascript");v.languages.js=v.languages.javascript;v.languages.typescript=v.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/});v.languages.ts=v.languages.typescript;function fe(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}fe.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return fe.stringify(r,t)}).join(""):ud(e.type)(e.content)};function ud(e){return Fs[e]||ad}function Ls(e){return cd(e,v.languages.javascript)}function cd(e,t){return v.tokenize(e,t).map(n=>fe.stringify(n)).join("")}function $s(e){return ai(e)}var sn=class e{firstLineNumber;lines;static read(t){let r;try{r=Vs.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(`
14
- `);return new e(t,$s(n).split(`
15
- `))}highlight(){let t=Ls(this.toString());return new e(this.firstLineNumber,t.split(`
10
+ We suggest to move the contents of ${oe(l)} to ${oe(a)} to consolidate your env vars.
11
+ `;throw new Error(u)}else if(r==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>te(c)).join(", ")} in ${oe(a)} and ${oe(l)}
12
+ Env vars from ${oe(l)} overwrite the ones from ${oe(a)}
13
+ `;console.warn(`${Ge("warn(prisma)")} ${u}`)}}}}function ws(e){if(mp(e)){hi(`Environment variables loaded from ${e}`);let t=yi.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:ys(t),message:He(`Environment variables loaded from ${ut.default.relative(process.cwd(),e)}`),path:e}}else hi(`Environment variables not found at ${e}`);return null}function Es(e,t){return e&&t&&ut.default.resolve(e)===ut.default.resolve(t)}function mp(e){return!!(e&&Jr.default.existsSync(e))}function wi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ct(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function Ei(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 x(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var xs=new Set,Yt=(e,t,...r)=>{xs.has(e)||(xs.add(e),pi(t,...r))};var k=class e extends Error{clientVersion;errorCode;retryable;constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};x(k,"PrismaClientInitializationError");var B=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};x(B,"PrismaClientKnownRequestError");var re=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};x(re,"PrismaClientRustPanicError");var Z=class extends Error{clientVersion;batchRequestIdx;constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};x(Z,"PrismaClientUnknownRequestError");var X=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};x(X,"PrismaClientValidationError");var pt=9e15,Fe=1e9,bi="0123456789abcdef",Zr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Xr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-pt,maxE:pt,crypto:!1},Cs,Re,b=!0,tn="[DecimalError] ",Me=tn+"Invalid argument: ",Ss=tn+"Precision limit exceeded",Rs=tn+"crypto unavailable",Is="[object Decimal]",ee=Math.floor,Q=Math.pow,fp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,gp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,hp=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ks=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe=1e7,E=7,yp=9007199254740991,wp=Zr.length-1,Pi=Xr.length-1,f={toStringTag:Is};f.absoluteValue=f.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};f.ceil=function(){return y(new this.constructor(this),this.e+1,2)};f.clampedTo=f.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Me+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};f.comparedTo=f.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};f.cosine=f.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+E,n.rounding=1,r=Ep(n,Ms(n,r)),n.precision=e,n.rounding=t,y(Re==2||Re==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};f.cubeRoot=f.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(b=!1,o=c.s*Q(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=J(c.d),e=c.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=Q(r,1/3),e=ee((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=N(u.plus(c).times(a),u.plus(l),s+2,1),J(a.d).slice(0,s)===(r=J(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return b=!0,y(n,e,p.rounding,t)};f.decimalPlaces=f.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ee(this.e/E))*E,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};f.dividedBy=f.div=function(e){return N(this,new this.constructor(e))};f.dividedToIntegerBy=f.divToInt=function(e){var t=this,r=t.constructor;return y(N(t,new r(e),0,1,1),r.precision,r.rounding)};f.equals=f.eq=function(e){return this.cmp(e)===0};f.floor=function(){return y(new this.constructor(this),this.e+1,3)};f.greaterThan=f.gt=function(e){return this.cmp(e)>0};f.greaterThanOrEqualTo=f.gte=function(e){var t=this.cmp(e);return t==1||t===0};f.hyperbolicCosine=f.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/nn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=dt(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return y(o,s.precision=r,s.rounding=n,!0)};f.hyperbolicSine=f.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=dt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/nn(5,e)),i=dt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,y(i,t,r,!0)};f.hyperbolicTangent=f.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,N(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};f.inverseCosine=f.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?ye(t,n,i):new t(0):new t(NaN):e.isZero()?ye(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};f.inverseHyperbolicCosine=f.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,b=!1,r=r.times(r).minus(1).sqrt().plus(r),b=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};f.inverseHyperbolicSine=f.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,b=!1,r=r.times(r).plus(1).sqrt().plus(r),b=!0,n.precision=e,n.rounding=t,r.ln())};f.inverseHyperbolicTangent=f.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?y(new o(i),e,t,!0):(o.precision=r=n-i.e,i=N(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};f.inverseSine=f.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ye(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};f.inverseTangent=f.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=Pi)return s=ye(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=Pi)return s=ye(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,r=Math.min(28,a/E+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(b=!1,t=Math.ceil(a/E),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),b=!0,y(s,c.precision=p,c.rounding=d,!0)};f.isFinite=function(){return!!this.d};f.isInteger=f.isInt=function(){return!!this.d&&ee(this.e/E)>this.d.length-2};f.isNaN=function(){return!this.s};f.isNegative=f.isNeg=function(){return this.s<0};f.isPositive=f.isPos=function(){return this.s>0};f.isZero=function(){return!!this.d&&this.d[0]===0};f.lessThan=f.lt=function(e){return this.cmp(e)<0};f.lessThanOrEqualTo=f.lte=function(e){return this.cmp(e)<1};f.logarithm=f.log=function(e){var t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding,m=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(b=!1,a=p+m,s=Ne(u,a),n=t?en(c,a+10):Ne(e,a),l=N(s,n,a,1),Zt(l.d,i=p,d))do if(a+=10,s=Ne(u,a),n=t?en(c,a+10):Ne(e,a),l=N(s,n,a,1),!o){+J(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(Zt(l.d,i+=10,d));return b=!0,y(l,p,d)};f.minus=f.sub=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,m=this,g=m.constructor;if(e=new g(e),!m.d||!e.d)return!m.s||!e.s?e=new g(NaN):m.d?e.s=-e.s:e=new g(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(u=m.d,d=e.d,a=g.precision,l=g.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new g(m);else return new g(l===3?-0:0);return b?y(e,a,l):e}if(r=ee(e.e/E),c=ee(m.e/E),u=u.slice(),o=c-r,o){for(p=o<0,p?(t=u,o=-o,s=d.length):(t=d,r=c,s=u.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=d.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(u[n]!=d[n]){p=u[n]<d[n];break}o=0}for(p&&(t=u,u=d,d=t,e.s=-e.s),s=u.length,n=d.length-s;n>0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]<d[n]){for(i=n;i&&u[--i]===0;)u[i]=fe-1;--u[i],u[n]+=fe}u[n]-=d[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(e.d=u,e.e=rn(u,r),b?y(e,a,l):e):new g(l===3?-0:0)};f.modulo=f.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?y(new n(r),n.precision,n.rounding):(b=!1,n.modulo==9?(t=N(r,e.abs(),0,3,1),t.s*=e.s):t=N(r,e,0,n.modulo,1),t=t.times(e),b=!0,r.minus(t))};f.naturalExponential=f.exp=function(){return vi(this)};f.naturalLogarithm=f.ln=function(){return Ne(this)};f.negated=f.neg=function(){var e=new this.constructor(this);return e.s=-e.s,y(e)};f.plus=f.add=function(e){var t,r,n,i,o,s,a,l,u,c,p=this,d=p.constructor;if(e=new d(e),!p.d||!e.d)return!p.s||!e.s?e=new d(NaN):p.d||(e=new d(e.d||p.s===e.s?p:NaN)),e;if(p.s!=e.s)return e.s=-e.s,p.minus(e);if(u=p.d,c=e.d,a=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(p)),b?y(e,a,l):e;if(o=ee(p.e/E),n=ee(e.e/E),u=u.slice(),i=o-n,i){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=o,s=u.length),o=Math.ceil(a/E),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/fe|0,u[i]%=fe;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=rn(u,n),b?y(e,a,l):e};f.precision=f.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Me+e);return r.d?(t=Os(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};f.round=function(){var e=this,t=e.constructor;return y(new t(e),e.e+1,t.rounding)};f.sine=f.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+E,n.rounding=1,r=xp(n,Ms(n,r)),n.precision=e,n.rounding=t,y(Re>2?r.neg():r,e,t,!0)):new n(NaN)};f.squareRoot=f.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(b=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=J(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=ee((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new c(t)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(o=n,n=o.plus(N(s,o,r+2,1)).times(.5),J(o.d).slice(0,r)===(t=J(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return b=!0,y(n,l,c.rounding,e)};f.tangent=f.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=N(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,y(Re==2||Re==4?r.neg():r,e,t,!0)):new n(NaN)};f.times=f.mul=function(e){var t,r,n,i,o,s,a,l,u,c=this,p=c.constructor,d=c.d,m=(e=new p(e)).d;if(e.s*=c.s,!d||!d[0]||!m||!m[0])return new p(!e.s||d&&!d[0]&&!m||m&&!m[0]&&!d?NaN:!d||!m?e.s/0:e.s*0);for(r=ee(c.e/E)+ee(e.e/E),l=d.length,u=m.length,l<u&&(o=d,d=m,m=o,s=l,l=u,u=s),o=[],s=l+u,n=s;n--;)o.push(0);for(n=u;--n>=0;){for(t=0,i=l+n;i>n;)a=o[i]+m[n]*d[i-n-1]+t,o[i--]=a%fe|0,t=a/fe|0;o[i]=(o[i]+t)%fe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=rn(o,r),b?y(e,p.precision,p.rounding):e};f.toBinary=function(e,t){return Ti(this,2,e,t)};f.toDecimalPlaces=f.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(se(e,0,Fe),t===void 0?t=n.rounding:se(t,0,8),y(r,e+r.e+1,t))};f.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=we(n,!0):(se(e,0,Fe),t===void 0?t=i.rounding:se(t,0,8),n=y(new i(n),e+1,t),r=we(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};f.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=we(i):(se(e,0,Fe),t===void 0?t=o.rounding:se(t,0,8),n=y(new o(i),e+i.e+1,t),r=we(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};f.toFraction=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,m=this,g=m.d,h=m.constructor;if(!g)return new h(m);if(u=r=new h(1),n=l=new h(0),t=new h(n),o=t.e=Os(g)-m.e-1,s=o%E,t.d[0]=Q(10,s<0?E+s:s),e==null)e=o>0?t:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error(Me+a);e=a.gt(t)?o>0?t:u:a}for(b=!1,a=new h(J(g)),c=h.precision,h.precision=o=g.length*E*2;p=N(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=N(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=m.s,d=N(u,n,o,1).minus(m).abs().cmp(N(l,r,o,1).minus(m).abs())<1?[u,n]:[l,r],h.precision=c,b=!0,d};f.toHexadecimal=f.toHex=function(e,t){return Ti(this,16,e,t)};f.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:se(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(b=!1,r=N(r,e,0,t,1).times(e),b=!0,y(r)):(e.s=r.s,r=e),r};f.toNumber=function(){return+this};f.toOctal=function(e,t){return Ti(this,8,e,t)};f.toPower=f.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Q(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(t=ee(e.e/E),t>=e.d.length-1&&(r=u<0?-u:u)<=yp)return i=Ds(l,a,r,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new l(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=Q(+a,u),t=r==0||!isFinite(r)?ee(u*(Math.log("0."+J(a.d))/Math.LN10+a.e+1)):new l(r+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(b=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=vi(e.times(Ne(a,n+r)),n),i.d&&(i=y(i,n+5,1),Zt(i.d,n,o)&&(t=n+10,i=y(vi(e.times(Ne(a,t+r)),t),t+5,1),+J(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,b=!0,l.rounding=o,y(i,n,o))};f.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=we(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(se(e,1,Fe),t===void 0?t=i.rounding:se(t,0,8),n=y(new i(n),e,t),r=we(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};f.toSignificantDigits=f.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(se(e,1,Fe),t===void 0?t=n.rounding:se(t,0,8)),y(new n(r),e,t)};f.toString=function(){var e=this,t=e.constructor,r=we(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};f.truncated=f.trunc=function(){return y(new this.constructor(this),this.e+1,1)};f.valueOf=f.toJSON=function(){var e=this,t=e.constructor,r=we(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function J(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=E-n.length,r&&(o+=_e(r)),o+=n;s=e[t],n=s+"",r=E-n.length,r&&(o+=_e(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function se(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Me+e)}function Zt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=E,i=0):(i=Math.ceil((t+1)/E),t%=E),o=Q(10,E-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==Q(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==Q(10,t-3)-1,s}function zr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=bi.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Ep(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/nn(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=dt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var N=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;a<o;a++)if(n[a]!=i[a]){l=n[a]>i[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,d,m,g,h,I,T,C,w,O,de,ue,Ut,q,ie,Te,z,st,Br=n.constructor,ni=n.s==i.s?1:-1,Y=n.d,_=i.d;if(!Y||!Y[0]||!_||!_[0])return new Br(!n.s||!i.s||(Y?_&&Y[0]==_[0]:!_)?NaN:Y&&Y[0]==0||!_?ni*0:ni/0);for(l?(m=1,c=n.e-i.e):(l=fe,m=E,c=ee(n.e/m)-ee(i.e/m)),z=_.length,ie=Y.length,T=new Br(ni),C=T.d=[],p=0;_[p]==(Y[p]||0);p++);if(_[p]>(Y[p]||0)&&c--,o==null?(ue=o=Br.precision,s=Br.rounding):a?ue=o+(n.e-i.e)+1:ue=o,ue<0)C.push(1),g=!0;else{if(ue=ue/m+2|0,p=0,z==1){for(d=0,_=_[0],ue++;(p<ie||d)&&ue--;p++)Ut=d*l+(Y[p]||0),C[p]=Ut/_|0,d=Ut%_|0;g=d||p<ie}else{for(d=l/(_[0]+1)|0,d>1&&(_=e(_,d,l),Y=e(Y,d,l),z=_.length,ie=Y.length),q=z,w=Y.slice(0,z),O=w.length;O<z;)w[O++]=0;st=_.slice(),st.unshift(0),Te=_[0],_[1]>=l/2&&++Te;do d=0,u=t(_,w,z,O),u<0?(de=w[0],z!=O&&(de=de*l+(w[1]||0)),d=de/Te|0,d>1?(d>=l&&(d=l-1),h=e(_,d,l),I=h.length,O=w.length,u=t(h,w,I,O),u==1&&(d--,r(h,z<I?st:_,I,l))):(d==0&&(u=d=1),h=_.slice()),I=h.length,I<O&&h.unshift(0),r(w,h,O,l),u==-1&&(O=w.length,u=t(_,w,z,O),u<1&&(d++,r(w,z<O?st:_,O,l))),O=w.length):u===0&&(d++,w=[0]),C[p++]=d,u&&w[0]?w[O++]=Y[q]||0:(w=[Y[q]],O=1);while((q++<ie||w[0]!==void 0)&&ue--);g=w[0]!==void 0}C[0]||C.shift()}if(m==1)T.e=c,Cs=g;else{for(p=1,d=C[0];d>=10;d/=10)p++;T.e=p+c*m-1,y(T,a?o+T.e+1:o,s,g)}return T}}();function y(e,t,r,n){var i,o,s,a,l,u,c,p,d,m=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=E,s=t,c=p[d=0],l=c/Q(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/E),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);c=l=0,i=1,o%=E,s=o-E+1}else break e;else{for(c=a=p[d],i=1;a>=10;a/=10)i++;o%=E,s=o-E+i,l=s<0?0:c/Q(10,i-s-1)%10|0}if(n=n||t<0||p[d+1]!==void 0||(s<0?c:c%Q(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?c/Q(10,i-s):0:p[d-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,u?(t-=e.e+1,p[0]=Q(10,(E-t%E)%E),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=Q(10,E-o),p[d]=s>0?(c/Q(10,i-s)%Q(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==fe&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=fe)break;p[d--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return b&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function we(e,t,r){if(!e.isFinite())return Ns(e);var n,i=e.e,o=J(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+_e(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+_e(-i-1)+o,r&&(n=r-s)>0&&(o+=_e(n))):i>=s?(o+=_e(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+_e(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=_e(n))),o}function rn(e,t){var r=e[0];for(t*=E;r>=10;r/=10)t++;return t}function en(e,t,r){if(t>wp)throw b=!0,r&&(e.precision=r),Error(Ss);return y(new e(Zr),t,1,!0)}function ye(e,t,r){if(t>Pi)throw Error(Ss);return y(new e(Xr),t,r,!0)}function Os(e){var t=e.length-1,r=t*E+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function _e(e){for(var t="";e--;)t+="0";return t}function Ds(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/E+4);for(b=!1;;){if(r%2&&(o=o.times(t),Ts(o.d,s)&&(i=!0)),r=ee(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),Ts(t.d,s)}return b=!0,o}function vs(e){return e.d[e.d.length-1]&1}function _s(e,t,r){for(var n,i,o=new e(t[0]),s=0;++s<t.length;){if(i=new e(t[s]),!i.s){o=i;break}n=o.cmp(i),(n===r||n===0&&o.s===r)&&(o=i)}return o}function vi(e,t){var r,n,i,o,s,a,l,u=0,c=0,p=0,d=e.constructor,m=d.rounding,g=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(b=!1,l=g):l=t,a=new d(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(Q(2,p))/Math.LN10*2+5|0,l+=n,r=o=s=new d(1),d.precision=l;;){if(o=y(o.times(e),l,1),r=r.times(++c),a=s.plus(N(o,r,l,1)),J(a.d).slice(0,l)===J(s.d).slice(0,l)){for(i=p;i--;)s=y(s.times(s),l,1);if(t==null)if(u<3&&Zt(s.d,l-n,m,u))d.precision=l+=10,r=o=a=new d(1),c=0,u++;else return y(s,d.precision=g,m,b=!0);else return d.precision=g,s}s=a}}function Ne(e,t){var r,n,i,o,s,a,l,u,c,p,d,m=1,g=10,h=e,I=h.d,T=h.constructor,C=T.rounding,w=T.precision;if(h.s<0||!I||!I[0]||!h.e&&I[0]==1&&I.length==1)return new T(I&&!I[0]?-1/0:h.s!=1?NaN:I?0:h);if(t==null?(b=!1,c=w):c=t,T.precision=c+=g,r=J(I),n=r.charAt(0),Math.abs(o=h.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=J(h.d),n=r.charAt(0),m++;o=h.e,n>1?(h=new T("0."+r),o++):h=new T(n+"."+r.slice(1))}else return u=en(T,c+2,w).times(o+""),h=Ne(new T(n+"."+r.slice(1)),c-g).plus(u),T.precision=w,t==null?y(h,w,C,b=!0):h;for(p=h,l=s=h=N(h.minus(1),h.plus(1),c,1),d=y(h.times(h),c,1),i=3;;){if(s=y(s.times(d),c,1),u=l.plus(N(s,new T(i),c,1)),J(u.d).slice(0,c)===J(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(en(T,c+2,w).times(o+""))),l=N(l,new T(m),c,1),t==null)if(Zt(l.d,c-g,C,a))T.precision=c+=g,u=s=h=N(p.minus(1),p.plus(1),c,1),d=y(h.times(h),c,1),i=a=1;else return y(l,T.precision=w,C,b=!0);else return T.precision=w,l;l=u,i+=2}}function Ns(e){return String(e.s*e.s/0)}function Yr(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%E,r<0&&(n+=E),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=E;n<i;)e.d.push(+t.slice(n,n+=E));t=t.slice(n),n=E-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),b&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function bp(e,t){var r,n,i,o,s,a,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ks.test(t))return Yr(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(gp.test(t))r=16,t=t.toLowerCase();else if(fp.test(t))r=2;else if(hp.test(t))r=8;else throw Error(Me+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Ds(n,new n(r),o,o*2)),u=zr(t,r,fe),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=rn(u,c),e.d=u,b=!1,s&&(e=N(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?Q(2,l):Je.pow(2,l))),b=!0,e)}function xp(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:dt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/nn(5,r)),t=dt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function dt(e,t,r,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/E);for(b=!1,l=r.times(r),a=new e(n);;){if(s=N(a.times(l),new e(t++*t++),c,1),a=i?n.plus(s):n.minus(s),n=N(s.times(l),new e(t++*t++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return b=!0,s.d.length=p+1,s}function nn(e,t){for(var r=e;--t;)r*=e;return r}function Ms(e,t){var r,n=t.s<0,i=ye(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Re=n?4:1,t;if(r=t.divToInt(i),r.isZero())Re=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Re=vs(r)?n?2:3:n?4:1,t;Re=vs(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Ti(e,t,r,n){var i,o,s,a,l,u,c,p,d,m=e.constructor,g=r!==void 0;if(g?(se(r,1,Fe),n===void 0?n=m.rounding:se(n,0,8)):(r=m.precision,n=m.rounding),!e.isFinite())c=Ns(e);else{for(c=we(e),s=c.indexOf("."),g?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(c=c.replace(".",""),d=new m(1),d.e=c.length-s,d.d=zr(we(d),10,i),d.e=d.d.length),p=zr(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new m(e),e.d=p,e.e=o,e=N(e,d,r,n,0,i),p=e.d,o=e.e,u=Cs),s=p[r],a=i/2,u=u||p[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,u)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s<l;s++)c+=bi.charAt(p[s]);if(g){if(l>1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)c+="0";for(p=zr(c,i,t),l=p.length;!p[l-1];--l);for(s=1,c="1.";s<l;s++)c+=bi.charAt(p[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}c=(t==16?"0x":t==2?"0b":t==8?"0o":"")+c}return e.s<0?"-"+c:c}function Ts(e,t){if(e.length>t)return e.length=t,!0}function Pp(e){return new this(e).abs()}function vp(e){return new this(e).acos()}function Tp(e){return new this(e).acosh()}function Ap(e,t){return new this(e).plus(t)}function Cp(e){return new this(e).asin()}function Sp(e){return new this(e).asinh()}function Rp(e){return new this(e).atan()}function Ip(e){return new this(e).atanh()}function kp(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ye(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ye(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ye(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(N(e,t,o,1)),t=ye(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(N(e,t,o,1)),r}function Op(e){return new this(e).cbrt()}function Dp(e){return y(e=new this(e),e.e+1,2)}function _p(e,t,r){return new this(e).clamp(t,r)}function Np(e){if(!e||typeof e!="object")throw Error(tn+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Fe,"rounding",0,8,"toExpNeg",-pt,0,"toExpPos",0,pt,"maxE",0,pt,"minE",-pt,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=xi[r]),(n=e[r])!==void 0)if(ee(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Me+r+": "+n);if(r="crypto",i&&(this[r]=xi[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Rs);else this[r]=!1;else throw Error(Me+r+": "+n);return this}function Mp(e){return new this(e).cos()}function Fp(e){return new this(e).cosh()}function Fs(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,As(o)){u.s=o.s,b?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e<i.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(l=typeof o,l==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;b?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[o]):(u.e=s,u.d=[o]);return}if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return Yr(u,o.toString())}if(l==="string")return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),ks.test(o)?Yr(u,o):bp(u,o);if(l==="bigint")return o<0?(o=-o,u.s=-1):u.s=1,Yr(u,o.toString());throw Error(Me+o)}if(i.prototype=f,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Np,i.clone=Fs,i.isDecimal=As,i.abs=Pp,i.acos=vp,i.acosh=Tp,i.add=Ap,i.asin=Cp,i.asinh=Sp,i.atan=Rp,i.atanh=Ip,i.atan2=kp,i.cbrt=Op,i.ceil=Dp,i.clamp=_p,i.cos=Mp,i.cosh=Fp,i.div=Lp,i.exp=$p,i.floor=Vp,i.hypot=qp,i.ln=Up,i.log=jp,i.log10=Qp,i.log2=Bp,i.max=Hp,i.min=Gp,i.mod=Wp,i.mul=Jp,i.pow=Kp,i.random=zp,i.round=Yp,i.sign=Zp,i.sin=Xp,i.sinh=ed,i.sqrt=td,i.sub=rd,i.sum=nd,i.tan=id,i.tanh=od,i.trunc=sd,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function Lp(e,t){return new this(e).div(t)}function $p(e){return new this(e).exp()}function Vp(e){return y(e=new this(e),e.e+1,3)}function qp(){var e,t,r=new this(0);for(b=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return b=!0,new this(1/0);r=t}return b=!0,r.sqrt()}function As(e){return e instanceof Je||e&&e.toStringTag===Is||!1}function Up(e){return new this(e).ln()}function jp(e,t){return new this(e).log(t)}function Bp(e){return new this(e).log(2)}function Qp(e){return new this(e).log(10)}function Hp(){return _s(this,arguments,-1)}function Gp(){return _s(this,arguments,1)}function Wp(e,t){return new this(e).mod(t)}function Jp(e,t){return new this(e).mul(t)}function Kp(e,t){return new this(e).pow(t)}function zp(e){var t,r,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:se(e,1,Fe),n=Math.ceil(e/E),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Rs);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=E,n&&e&&(i=Q(10,E-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=E)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<E&&(r-=E-n)}return s.e=r,s.d=a,s}function Yp(e){return y(e=new this(e),e.e+1,this.rounding)}function Zp(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Xp(e){return new this(e).sin()}function ed(e){return new this(e).sinh()}function td(e){return new this(e).sqrt()}function rd(e,t){return new this(e).sub(t)}function nd(){var e=0,t=arguments,r=new this(t[e]);for(b=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return b=!0,y(r,this.precision,this.rounding)}function id(e){return new this(e).tan()}function od(e){return new this(e).tanh()}function sd(e){return y(e=new this(e),e.e+1,1)}f[Symbol.for("nodejs.util.inspect.custom")]=f.toString;f[Symbol.toStringTag]="Decimal";var Je=f.constructor=Fs(xi);Zr=new Je(Zr);Xr=new Je(Xr);var H=Je;function mt(e){return e===null?e:Array.isArray(e)?e.map(mt):typeof e=="object"?ad(e)?ld(e):typeof e=="bigint"||e instanceof Date||e instanceof Uint8Array||e instanceof H?e:ct(e,mt):e}function ad(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function ld({$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 H(t);case"Json":return JSON.parse(t);default:me(t,"Unknown tagged value")}}var Ee=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 Le(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Ls(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function Xt(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function $s(e){return{models:Ai(e.models),enums:Ai(e.enums),types:Ai(e.types)}}function Ai(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function ft(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function on(e){return e.toString()!=="Invalid Date"}function gt(e){return Je.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 er={};at(er,{ModelAction:()=>ht,datamodelEnumToSchemaEnum:()=>ud});function ud(e){return{name:e.name,values:e.values.map(t=>t.name)}}var ht=(w=>(w.findUnique="findUnique",w.findUniqueOrThrow="findUniqueOrThrow",w.findFirst="findFirst",w.findFirstOrThrow="findFirstOrThrow",w.findMany="findMany",w.create="create",w.createMany="createMany",w.createManyAndReturn="createManyAndReturn",w.update="update",w.updateMany="updateMany",w.updateManyAndReturn="updateManyAndReturn",w.upsert="upsert",w.delete="delete",w.deleteMany="deleteMany",w.groupBy="groupBy",w.count="count",w.aggregate="aggregate",w.findRaw="findRaw",w.aggregateRaw="aggregateRaw",w))(ht||{});var Bs=U(ss());var js=U(require("node:fs"));var Vs={keyword:Ce,entity:Ce,value:e=>te(We(e)),punctuation:We,directive:Ce,function:Ce,variable:e=>te(We(e)),string:e=>te(jt(e)),boolean:Ge,number:Ce,comment:Bt};var cd=e=>e,sn={},pd=0,v={manual:sn.Prism&&sn.Prism.manual,disableWorkerMessageHandler:sn.Prism&&sn.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof ge){let t=e;return new ge(t.type,v.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(v.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:++pd}),e.__id},clone:function e(t,r){let n,i,o=v.util.type(t);switch(r=r||{},o){case"Object":if(i=v.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=v.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=v.util.clone(v.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||v.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,v.languages.DFS(v.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=v.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=v.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 v.hooks.run("before-tokenize",n),n.tokens=v.tokenize(n.code,n.grammar),v.hooks.run("after-tokenize",n),ge.stringify(v.util.encode(n.tokens),n.language)},matchGrammar:function(e,t,r,n,i,o,s){for(let h in r){if(!r.hasOwnProperty(h)||!r[h])continue;if(h==s)return;let I=r[h];I=v.util.type(I)==="Array"?I:[I];for(let T=0;T<I.length;++T){let C=I[T],w=C.inside,O=!!C.lookbehind,de=!!C.greedy,ue=0,Ut=C.alias;if(de&&!C.pattern.global){let q=C.pattern.toString().match(/[imuy]*$/)[0];C.pattern=RegExp(C.pattern.source,q+"g")}C=C.pattern||C;for(let q=n,ie=i;q<t.length;ie+=t[q].length,++q){let Te=t[q];if(t.length>e.length)return;if(Te instanceof ge)continue;if(de&&q!=t.length-1){C.lastIndex=ie;var p=C.exec(e);if(!p)break;var c=p.index+(O?p[1].length:0),d=p.index+p[0].length,a=q,l=ie;for(let _=t.length;a<_&&(l<d||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++q,ie=l);if(t[q]instanceof ge)continue;u=a-q,Te=e.slice(ie,l),p.index-=ie}else{C.lastIndex=0;var p=C.exec(Te),u=1}if(!p){if(o)break;continue}O&&(ue=p[1]?p[1].length:0);var c=p.index+ue,p=p[0].slice(ue),d=c+p.length,m=Te.slice(0,c),g=Te.slice(d);let z=[q,u];m&&(++q,ie+=m.length,z.push(m));let st=new ge(h,w?v.tokenize(p,w):p,Ut,p,de);if(z.push(st),g&&z.push(g),Array.prototype.splice.apply(t,z),u!=1&&v.matchGrammar(e,t,r,q,ie,!0,h),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 v.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=v.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=v.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:ge};v.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:/[{}[\];(),.:]/};v.languages.javascript=v.languages.extend("clike",{"class-name":[v.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}/});v.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;v.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:v.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:v.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:v.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:v.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});v.languages.markup&&v.languages.markup.tag.addInlined("script","javascript");v.languages.js=v.languages.javascript;v.languages.typescript=v.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/});v.languages.ts=v.languages.typescript;function ge(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}ge.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return ge.stringify(r,t)}).join(""):dd(e.type)(e.content)};function dd(e){return Vs[e]||cd}function qs(e){return md(e,v.languages.javascript)}function md(e,t){return v.tokenize(e,t).map(n=>ge.stringify(n)).join("")}function Us(e){return ui(e)}var an=class e{firstLineNumber;lines;static read(t){let r;try{r=js.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(`
14
+ `);return new e(t,Us(n).split(`
15
+ `))}highlight(){let t=qs(this.toString());return new e(this.firstLineNumber,t.split(`
16
16
  `))}toString(){return this.lines.join(`
17
- `)}};var pd={red:Te,gray:Ut,dim:Qe,bold:ee,underline:ie,highlightSource:e=>e.highlight()},dd={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function md({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function fd({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=md({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),u=sn.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=hd(c),d=gd(c);if(!d)return s;s.functionName=`${d.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,g=>g.slice(0,d.openingBraceIndex))),u=o.highlightSource(u);let m=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,h)=>o.gray(String(h).padStart(m))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+m+1;g+=2,s.callArguments=(0,qs.default)(i,g).slice(g)}}return s}function gd(e){let t=Object.keys(gt).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 hd(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function yd({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(wd(t))),i){a.push("");let u=[i.toString()];o&&(u.push(o),u.push(s.dim(")"))),a.push(u.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(`
18
- `)}function wd(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function an(e){let t=e.showColors?pd:dd,r;return r=fd(e,t),yd(r,t)}var Ks=q(Ti());function Qs(e,t,r){let n=Hs(e),i=Ed(n),o=bd(i);o?ln(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Hs(e){return e.errors.flatMap(t=>t.kind==="Union"?Hs(t):[t])}function Ed(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:xd(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function xd(e,t){return[...new Set(e.concat(t))]}function bd(e){return yi(e,(t,r)=>{let n=Us(t),i=Us(r);return n!==i?n-i:Bs(t)-Bs(r)})}function Us(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Bs(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var ue=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)}};Ws();var ht=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(`
19
- `)}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}};Gs();var un=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var cn=e=>e,pn={bold:cn,red:cn,green:cn,dim:cn,enabled:!1},Js={bold:ee,red:Te,green:jt,dim:Qe,enabled:!0},yt={write(e){e.writeLine(",")}};var Ee=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 Le=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var wt=class extends Le{items=[];addItem(t){return this.items.push(new un(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 Ee("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(yt,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Et=class e extends Le{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 wt&&(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 Ee("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(yt,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var H=class extends Le{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Ee(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var er=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(yt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function ln(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Pd(e,t);break;case"IncludeOnScalar":vd(e,t);break;case"EmptySelection":Td(e,t,r);break;case"UnknownSelectionField":Rd(e,t);break;case"InvalidSelectionValue":Id(e,t);break;case"UnknownArgument":kd(e,t);break;case"UnknownInputField":Od(e,t);break;case"RequiredArgumentMissing":Dd(e,t);break;case"InvalidArgumentType":_d(e,t);break;case"InvalidArgumentValue":Nd(e,t);break;case"ValueTooLarge":Md(e,t);break;case"SomeFieldsMissing":Fd(e,t);break;case"TooManyFieldsGiven":Ld(e,t);break;case"Union":Qs(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Pd(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 vd(e,t){let[r,n]=tr(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 ue(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)}. ${rr(s)}`:a+=".",a+=`
20
- Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Td(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Cd(e,t,i);return}if(n.hasField("select")){Ad(e,t);return}}if(r?.[Fe(e.outputType.name)]){Sd(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Cd(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new ue(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 Ad(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Zs(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${rr(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Sd(e,t){let r=new er;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new ue("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=tr(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new Et;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 Rd(e,t){let r=Xs(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":Zs(n,e.outputType);break;case"include":$d(n,e.outputType);break;case"omit":Vd(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(rr(n)),i.join(" ")})}function Id(e,t){let r=Xs(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 kd(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),qd(n,e.arguments)),t.addErrorMessage(i=>zs(i,r,e.arguments.map(o=>o.name)))}function Od(e,t){let[r,n]=tr(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&ea(o,e.inputType)}t.addErrorMessage(o=>zs(o,n,e.inputType.fields.map(s=>s.name)))}function zs(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Ud(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(rr(e)),n.join(" ")}function Dd(e,t){let r;t.addErrorMessage(l=>r?.value instanceof H&&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]=tr(e.argumentPath),s=new er,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 ue(o,s).makeRequired())}else{let l=e.inputTypes.map(Ys).join(" | ");a.addSuggestion(new ue(o,l).makeRequired())}}function Ys(e){return e.kind==="list"?`${Ys(e.elementType)}[]`:e.name}function _d(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=dn("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 Nd(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=dn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Md(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 H&&(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 Fd(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&&ea(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")} ${dn("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(rr(i)),o.join(" ")})}function Ld(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 ${dn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Zs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ue(r.name,"true"))}function $d(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new ue(r.name,"true"))}function Vd(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new ue(r.name,"true"))}function qd(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new ue(r.name,r.typeNames.join(" | ")))}function Xs(e,t){let[r,n]=tr(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 ea(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ue(r.name,r.typeNames.join(" | ")))}function tr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function rr({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function dn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var jd=3;function Ud(e,t){let r=1/0,n;for(let i of t){let o=(0,Ks.default)(e,i);o>jd||o<r&&(r=o,n=i)}return n}var nr=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 xt(e){return e instanceof nr}var mn=Symbol(),Ai=new WeakMap,Re=class{constructor(t){t===mn?Ai.set(this,`Prisma.${this._getName()}`):Ai.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Ai.get(this)}},ir=class extends Re{_getNamespace(){return"NullTypes"}},or=class extends ir{#e};Si(or,"DbNull");var sr=class extends ir{#e};Si(sr,"JsonNull");var ar=class extends ir{#e};Si(ar,"AnyNull");var fn={classes:{DbNull:or,JsonNull:sr,AnyNull:ar},instances:{DbNull:new or(mn),JsonNull:new sr(mn),AnyNull:new ar(mn)}};function Si(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var ta=": ",gn=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+ta.length}write(t){let r=new Ee(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(ta).write(this.value)}};var Ri=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(`
21
- `)}};function bt(e){return new Ri(ra(e))}function ra(e){let t=new Et;for(let[r,n]of Object.entries(e)){let i=new gn(r,na(n));t.addField(i)}return t}function na(e){if(typeof e=="string")return new H(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new H(String(e));if(typeof e=="bigint")return new H(`${e}n`);if(e===null)return new H("null");if(e===void 0)return new H("undefined");if(ft(e))return new H(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new H(`Buffer.alloc(${e.byteLength})`):new H(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=nn(e)?e.toISOString():"Invalid Date";return new H(`new Date("${t}")`)}return e instanceof Re?new H(`Prisma.${e._getName()}`):xt(e)?new H(`prisma.${Fe(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Bd(e):typeof e=="object"?ra(e):new H(Object.prototype.toString.call(e))}function Bd(e){let t=new wt;for(let r of e)t.addItem(na(r));return t}function hn(e,t){let r=t==="pretty"?Js:pn,n=e.renderAllMessages(r),i=new ht(0,{colors:r}).write(e).toString();return{message:n,args:i}}function yn({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=bt(e);for(let p of t)ln(p,a,s);let{message:l,args:u}=hn(a,r),c=an({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new Z(c,{clientVersion:o})}function xe(e){return e.replace(/^./,t=>t.toLowerCase())}function oa(e,t,r){let n=xe(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Qd({...e,...ia(t.name,e,t.result.$allModels),...ia(t.name,e,t.result[n])})}function Qd(e){let t=new we,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 ut(e,n=>({...n,needs:r(n.name,new Set)}))}function ia(e,t,r){return r?ut(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Hd(t,o,i)})):{}}function Hd(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function sa(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 aa(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 wn=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new we;modelExtensionsCache=new we;queryCallbacksCache=new we;clientExtensions=Zt(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=Zt(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>oa(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=xe(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()}},Pt=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new wn(t))}isEmpty(){return this.head===void 0}append(t){return new e(new wn(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 En=class{constructor(t){this.name=t}};function la(e){return e instanceof En}function ua(e){return new En(e)}var ca=Symbol(),lr=class{constructor(t){if(t!==ca)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?xn:t}},xn=new lr(ca);function be(e){return e instanceof lr}var Gd={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"},pa="explicitly `undefined` values are not allowed";function bn({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=Pt.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c}){let p=new Ii({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c});return{modelName:e,action:Gd[t],query:ur(r,p)}}function ur({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:ma(r,n),selection:Wd(e,t,i,n)}}function Wd(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()}),Yd(e,n)):Jd(n,t,r)}function Jd(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&Kd(n,t,e),zd(n,r,e),n}function Kd(e,t,r){for(let[n,i]of Object.entries(t)){if(be(i))continue;let o=r.nestSelection(n);if(ki(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]=ur(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=ur(i,o)}}function zd(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=aa(i,n);for(let[s,a]of Object.entries(o)){if(be(a))continue;ki(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function Yd(e,t){let r={},n=t.getComputedFields(),i=sa(e,n);for(let[o,s]of Object.entries(i)){if(be(s))continue;let a=t.nestSelection(o);ki(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||be(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=ur({},a):r[o]=!0;continue}r[o]=ur(s,a)}}return r}function da(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(mt(e)){if(nn(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(la(e))return{$type:"Param",value:e.name};if(xt(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return Zd(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(Xd(e))return e.values;if(ft(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof Re){if(e!==fn.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(em(e))return e.toJSON();if(typeof e=="object")return ma(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 ma(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);be(i)||(i!==void 0?r[n]=da(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:pa}))}return r}function Zd(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||be(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(da(o,i))}return r}function Xd(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function em(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function ki(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:pa})}var Ii=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){yn({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?.[Fe(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:de(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};function fa(e){if(!e._hasPreviewFlag("metrics"))throw new Z("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var vt=class{_client;constructor(t){this._client=t}prometheus(t){return fa(this._client),this._client._engine.metrics({format:"prometheus",...t})}json(t){return fa(this._client),this._client._engine.metrics({format:"json",...t})}};function ga(e,t){let r=Zt(()=>tm(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function tm(e){return{datamodel:{models:Oi(e.models),enums:Oi(e.enums),types:Oi(e.types)}}}function Oi(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var Di=new WeakMap,Pn="$$PrismaTypedSql",cr=class{constructor(t,r){Di.set(this,{sql:t,values:r}),Object.defineProperty(this,Pn,{value:Pn})}get sql(){return Di.get(this).sql}get values(){return Di.get(this).values}};function ha(e){return(...t)=>new cr(e,t)}function vn(e){return e!=null&&e[Pn]===Pn}var sc=q(ya());var ac=require("node:async_hooks"),lc=require("node:events"),uc=q(require("node:fs")),ei=q(require("node:path"));var se=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;i<r.length;){let s=r[i++],a=t[i];if(s instanceof e){this.strings[o]+=s.strings[0];let l=0;for(;l<s.values.length;)this.values[o++]=s.values[l++],this.strings[o]=s.strings[l];this.strings[o]+=a}else this.values[o++]=s,this.strings[o]=a}}get sql(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`?${this.strings[r++]}`;return n}get statement(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`:${r}${this.strings[r++]}`;return n}get text(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`$${r}${this.strings[r++]}`;return n}inspect(){return{sql:this.sql,statement:this.statement,text:this.text,values:this.values}}};function wa(e,t=",",r="",n=""){if(e.length===0)throw new TypeError("Expected `join([])` to be called with an array of multiple elements, but got an empty array");return new se([r,...Array(e.length-1).fill(t),n],e)}function _i(e){return new se([e],[])}var Ea=_i("");function Ni(e,...t){return new se(e,t)}function pr(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function re(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function Je(e){let t=new we;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var Tn={enumerable:!0,configurable:!0,writable:!0};function Cn(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>Tn,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var xa=Symbol.for("nodejs.util.inspect.custom");function ge(e,t){let r=nm(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=ba(Reflect.ownKeys(o),r),a=ba(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?{...Tn,...l?.getPropertyDescriptor(s)}:Tn:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[xa]=function(){let o={...this};return delete o[xa],o},i}function nm(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 ba(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Tt(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Ct(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Pa(e){if(e===void 0)return"";let t=bt(e);return new ht(0,{colors:pn}).write(t).toString()}var im="P2037";function An({error:e,user_facing_error:t},r,n){return t.error_code?new U(om(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new Y(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function om(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===im&&(r+=`
22
- Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}var dr="<unknown>";function va(e){var t=e.split(`
23
- `);return t.reduce(function(r,n){var i=lm(n)||cm(n)||mm(n)||ym(n)||gm(n);return i&&r.push(i),r},[])}var sm=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,am=/\((\S*)(?::(\d+))(?::(\d+))\)/;function lm(e){var t=sm.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=am.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]||dr,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var um=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function cm(e){var t=um.exec(e);return t?{file:t[2],methodName:t[1]||dr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var pm=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,dm=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function mm(e){var t=pm.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=dm.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||dr,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var fm=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function gm(e){var t=fm.exec(e);return t?{file:t[3],methodName:t[1]||dr,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var hm=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function ym(e){var t=hm.exec(e);return t?{file:t[2],methodName:t[1]||dr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Mi=class{getLocation(){return null}},Fi=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=va(t).find(i=>{if(!i.file)return!1;let o=pi(i.file);return o!=="<anonymous>"&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.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 $e(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Mi:new Fi}var Ta={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function At(e={}){let t=Em(e);return Object.entries(t).reduce((n,[i,o])=>(Ta[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Em(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Sn(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Ca(e,t){let r=Sn(e);return t({action:"aggregate",unpacker:r,argsMapper:At})(e)}function xm(e={}){let{select:t,...r}=e;return typeof t=="object"?At({...r,_count:t}):At({...r,_count:{_all:!0}})}function bm(e={}){return typeof e.select=="object"?t=>Sn(e)(t)._count:t=>Sn(e)(t)._count._all}function Aa(e,t){return t({action:"count",unpacker:bm(e),argsMapper:xm})(e)}function Pm(e={}){let t=At(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 vm(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Sa(e,t){return t({action:"groupBy",unpacker:vm(e),argsMapper:Pm})(e)}function Ra(e,t,r){if(t==="aggregate")return n=>Ca(n,r);if(t==="count")return n=>Aa(n,r);if(t==="groupBy")return n=>Sa(n,r)}function Ia(e,t){let r=t.fields.filter(i=>!i.relationName),n=Ns(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 nr(e,o,s.type,s.isList,s.kind==="enum")},...Cn(Object.keys(n))})}var ka=e=>Array.isArray(e)?e:e.split("."),Li=(e,t)=>ka(t).reduce((r,n)=>r&&r[n],e),Oa=(e,t,r)=>ka(t).reduceRight((n,i,o,s)=>Object.assign({},Li(e,s.slice(0,o)),{[i]:n}),r);function Tm(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Cm(e,t,r){return t===void 0?e??{}:Oa(t,r,e||!0)}function $i(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=$e(e._errorFormat),c=Tm(n,i),p=Cm(l,o,c),d=r({dataPath:c,callsite:u})(p),m=Am(e,t);return new Proxy(d,{get(g,h){if(!m.includes(h))return g[h];let T=[a[h].type,r,h],C=[c,p];return $i(e,...T,...C)},...Cn([...m,...Object.getOwnPropertyNames(d)])})}}function Am(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Sm=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Rm=["aggregate","count","groupBy"];function Vi(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Im(e,t),Om(e,t),pr(r),re("name",()=>t),re("$name",()=>t),re("$parent",()=>e._appliedParent)];return ge({},n)}function Im(e,t){let r=xe(t),n=Object.keys(gt).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=$e(e._errorFormat);return e._createPrismaPromise(c=>{let p={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:c,callsite:u};return e._request({...p,...a})},{action:o,args:l,model:t})};return Sm.includes(o)?$i(e,t,s):km(i)?Ra(e,i,s):s({})}}}function km(e){return Rm.includes(e)}function Om(e,t){return Je(re("fields",()=>{let r=e._runtimeDataModel.models[t];return Ia(t,r)}))}function Da(e){return e.replace(/^./,t=>t.toUpperCase())}var qi=Symbol();function mr(e){let t=[Dm(e),_m(e),re(qi,()=>e),re("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(pr(r)),ge(e,t)}function Dm(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function _m(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(xe),n=[...new Set(t.concat(r))];return Je({getKeys(){return n},getPropertyValue(i){let o=Da(i);if(e._runtimeDataModel.models[o]!==void 0)return Vi(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Vi(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function _a(e){return e[qi]?e[qi]:e}function Na(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return mr(t)}function Ma({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 u=l.needs.filter(c=>n[c]);u.length>0&&a.push(Tt(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(c=>!r[c]);u.length>0&&a.push(Tt(u))}Nm(e,l.needs)&&s.push(Mm(l,ge(e,s)))}return s.length>0||a.length>0?ge(e,[...s,...a]):e}function Nm(e,t){return t.every(r=>hi(e,r))}function Mm(e,t){return Je(re(e.name,()=>e.compute(t)))}function Rn({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=Rn({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&Fa({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&Fa({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function Fa({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||be(s))continue;let l=n.models[r].fields.find(c=>c.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=Rn({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function La({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Rn({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=xe(l);return Ma({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}var Fm=["$connect","$disconnect","$on","$transaction","$use","$extends"],$a=Fm;function Va(e){if(e instanceof se)return Lm(e);if(vn(e))return $m(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=fr(e[n]);return r}let t={};for(let r in e)t[r]=fr(e[r]);return t}function Lm(e){return new se(e.strings,e.values)}function $m(e){return new cr(e.sql,e.values)}function fr(e){if(typeof e!="object"||e==null||e instanceof Re||xt(e))return e;if(ft(e))return new Q(e.toFixed());if(mt(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]=fr(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:fr(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=fr(e[r]);return t}de(e,"Unknown value")}function ja(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:Va(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Ha(o,l),a.args=s,ja(e,a,r,n+1)}})})}function Ua(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 ja(e,t,s)}function Ba(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Qa(r,n,0,e):e(r)}}function Qa(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=Ha(i,l),Qa(a,t,r+1,n)}})}var qa=e=>e;function Ha(e=qa,t=qa){return r=>e(t(r))}var Ga=L("prisma:client"),Wa={Vercel:"vercel","Netlify CI":"netlify"};function Ja({postinstall:e,ciName:t,clientVersion:r}){if(Ga("checkPlatformCaching:postinstall",e),Ga("checkPlatformCaching:ciName",t),e===!0&&t&&t in Wa){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process.
24
-
25
- Learn how: https://pris.ly/d/${Wa[t]}-build`;throw console.error(n),new I(n,r)}}function Ka(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}var Vm=()=>globalThis.process?.release?.name==="node",qm=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,jm=()=>!!globalThis.Deno,Um=()=>typeof globalThis.Netlify=="object",Bm=()=>typeof globalThis.EdgeRuntime=="object",Qm=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Hm(){return[[Um,"netlify"],[Bm,"edge-light"],[Qm,"workerd"],[jm,"deno"],[qm,"bun"],[Vm,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var Gm={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 In(){let e=Hm();return{id:e,prettyName:Gm[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var ji=q(ci());function za(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function Ya(e){return e.split(`
17
+ `)}};var fd={red:Ae,gray:Bt,dim:He,bold:te,underline:oe,highlightSource:e=>e.highlight()},gd={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function hd({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function yd({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=hd({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),u=an.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=Ed(c),d=wd(c);if(!d)return s;s.functionName=`${d.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,g=>g.slice(0,d.openingBraceIndex))),u=o.highlightSource(u);let m=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,h)=>o.gray(String(h).padStart(m))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+m+1;g+=2,s.callArguments=(0,Bs.default)(i,g).slice(g)}}return s}function wd(e){let t=Object.keys(ht).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 Ed(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function bd({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(xd(t))),i){a.push("");let u=[i.toString()];o&&(u.push(o),u.push(s.dim(")"))),a.push(u.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(`
18
+ `)}function xd(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function ln(e){let t=e.showColors?fd:gd,r;return r=yd(e,t),bd(r,t)}var Zs=U(Ci());function Ws(e,t,r){let n=Js(e),i=Pd(n),o=Td(i);o?un(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Js(e){return e.errors.flatMap(t=>t.kind==="Union"?Js(t):[t])}function Pd(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:vd(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function vd(e,t){return[...new Set(e.concat(t))]}function Td(e){return Ei(e,(t,r)=>{let n=Hs(t),i=Hs(r);return n!==i?n-i:Gs(t)-Gs(r)})}function Hs(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Gs(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var ce=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)}};zs();var yt=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(`
19
+ `)}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}};Ks();var cn=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var pn=e=>e,dn={bold:pn,red:pn,green:pn,dim:pn,enabled:!1},Ys={bold:te,red:Ae,green:jt,dim:He,enabled:!0},wt={write(e){e.writeLine(",")}};var be=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 $e=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var Et=class extends $e{items=[];addItem(t){return this.items.push(new cn(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 be("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(wt,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var bt=class e extends $e{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 Et&&(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 be("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(wt,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var G=class extends $e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new be(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var tr=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(wt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function un(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Ad(e,t);break;case"IncludeOnScalar":Cd(e,t);break;case"EmptySelection":Sd(e,t,r);break;case"UnknownSelectionField":Od(e,t);break;case"InvalidSelectionValue":Dd(e,t);break;case"UnknownArgument":_d(e,t);break;case"UnknownInputField":Nd(e,t);break;case"RequiredArgumentMissing":Md(e,t);break;case"InvalidArgumentType":Fd(e,t);break;case"InvalidArgumentValue":Ld(e,t);break;case"ValueTooLarge":$d(e,t);break;case"SomeFieldsMissing":Vd(e,t);break;case"TooManyFieldsGiven":qd(e,t);break;case"Union":Ws(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Ad(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 Cd(e,t){let[r,n]=rr(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 ce(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)}. ${nr(s)}`:a+=".",a+=`
20
+ Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Sd(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Rd(e,t,i);return}if(n.hasField("select")){Id(e,t);return}}if(r?.[Le(e.outputType.name)]){kd(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Rd(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new ce(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 Id(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),ta(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${nr(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function kd(e,t){let r=new tr;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new ce("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=rr(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new bt;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 Od(e,t){let r=ra(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":ta(n,e.outputType);break;case"include":Ud(n,e.outputType);break;case"omit":jd(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(nr(n)),i.join(" ")})}function Dd(e,t){let r=ra(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 _d(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Bd(n,e.arguments)),t.addErrorMessage(i=>Xs(i,r,e.arguments.map(o=>o.name)))}function Nd(e,t){let[r,n]=rr(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&na(o,e.inputType)}t.addErrorMessage(o=>Xs(o,n,e.inputType.fields.map(s=>s.name)))}function Xs(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Hd(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(nr(e)),n.join(" ")}function Md(e,t){let r;t.addErrorMessage(l=>r?.value instanceof G&&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]=rr(e.argumentPath),s=new tr,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 ce(o,s).makeRequired())}else{let l=e.inputTypes.map(ea).join(" | ");a.addSuggestion(new ce(o,l).makeRequired())}}function ea(e){return e.kind==="list"?`${ea(e.elementType)}[]`:e.name}function Fd(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=mn("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 Ld(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=mn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function $d(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 G&&(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 Vd(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&&na(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")} ${mn("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(nr(i)),o.join(" ")})}function qd(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 ${mn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function ta(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ce(r.name,"true"))}function Ud(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new ce(r.name,"true"))}function jd(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new ce(r.name,"true"))}function Bd(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new ce(r.name,r.typeNames.join(" | ")))}function ra(e,t){let[r,n]=rr(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 na(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ce(r.name,r.typeNames.join(" | ")))}function rr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function nr({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function mn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Qd=3;function Hd(e,t){let r=1/0,n;for(let i of t){let o=(0,Zs.default)(e,i);o>Qd||o<r&&(r=o,n=i)}return n}var ir=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 xt(e){return e instanceof ir}var fn=Symbol(),Ri=new WeakMap,Ie=class{constructor(t){t===fn?Ri.set(this,`Prisma.${this._getName()}`):Ri.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Ri.get(this)}},or=class extends Ie{_getNamespace(){return"NullTypes"}},sr=class extends or{#e};Ii(sr,"DbNull");var ar=class extends or{#e};Ii(ar,"JsonNull");var lr=class extends or{#e};Ii(lr,"AnyNull");var gn={classes:{DbNull:sr,JsonNull:ar,AnyNull:lr},instances:{DbNull:new sr(fn),JsonNull:new ar(fn),AnyNull:new lr(fn)}};function Ii(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var ia=": ",hn=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+ia.length}write(t){let r=new be(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(ia).write(this.value)}};var ki=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(`
21
+ `)}};function Pt(e){return new ki(oa(e))}function oa(e){let t=new bt;for(let[r,n]of Object.entries(e)){let i=new hn(r,sa(n));t.addField(i)}return t}function sa(e){if(typeof e=="string")return new G(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new G(String(e));if(typeof e=="bigint")return new G(`${e}n`);if(e===null)return new G("null");if(e===void 0)return new G("undefined");if(gt(e))return new G(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new G(`Buffer.alloc(${e.byteLength})`):new G(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=on(e)?e.toISOString():"Invalid Date";return new G(`new Date("${t}")`)}return e instanceof Ie?new G(`Prisma.${e._getName()}`):xt(e)?new G(`prisma.${Le(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Gd(e):typeof e=="object"?oa(e):new G(Object.prototype.toString.call(e))}function Gd(e){let t=new Et;for(let r of e)t.addItem(sa(r));return t}function yn(e,t){let r=t==="pretty"?Ys:dn,n=e.renderAllMessages(r),i=new yt(0,{colors:r}).write(e).toString();return{message:n,args:i}}function wn({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=Pt(e);for(let p of t)un(p,a,s);let{message:l,args:u}=yn(a,r),c=ln({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new X(c,{clientVersion:o})}function xe(e){return e.replace(/^./,t=>t.toLowerCase())}function la(e,t,r){let n=xe(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Wd({...e,...aa(t.name,e,t.result.$allModels),...aa(t.name,e,t.result[n])})}function Wd(e){let t=new Ee,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 ct(e,n=>({...n,needs:r(n.name,new Set)}))}function aa(e,t,r){return r?ct(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Jd(t,o,i)})):{}}function Jd(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function ua(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 ca(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 En=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new Ee;modelExtensionsCache=new Ee;queryCallbacksCache=new Ee;clientExtensions=Xt(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=Xt(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>la(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=xe(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()}},vt=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new En(t))}isEmpty(){return this.head===void 0}append(t){return new e(new En(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 bn=class{constructor(t){this.name=t}};function pa(e){return e instanceof bn}function da(e){return new bn(e)}var ma=Symbol(),ur=class{constructor(t){if(t!==ma)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?xn:t}},xn=new ur(ma);function Pe(e){return e instanceof ur}var Kd={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"},fa="explicitly `undefined` values are not allowed";function Pn({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=vt.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c}){let p=new Oi({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c});return{modelName:e,action:Kd[t],query:cr(r,p)}}function cr({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:ha(r,n),selection:zd(e,t,i,n)}}function zd(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()}),em(e,n)):Yd(n,t,r)}function Yd(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&Zd(n,t,e),Xd(n,r,e),n}function Zd(e,t,r){for(let[n,i]of Object.entries(t)){if(Pe(i))continue;let o=r.nestSelection(n);if(Di(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]=cr(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=cr(i,o)}}function Xd(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=ca(i,n);for(let[s,a]of Object.entries(o)){if(Pe(a))continue;Di(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function em(e,t){let r={},n=t.getComputedFields(),i=ua(e,n);for(let[o,s]of Object.entries(i)){if(Pe(s))continue;let a=t.nestSelection(o);Di(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||Pe(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=cr({},a):r[o]=!0;continue}r[o]=cr(s,a)}}return r}function ga(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(ft(e)){if(on(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(pa(e))return{$type:"Param",value:e.name};if(xt(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return tm(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(rm(e))return e.values;if(gt(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof Ie){if(e!==gn.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(nm(e))return e.toJSON();if(typeof e=="object")return ha(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 ha(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);Pe(i)||(i!==void 0?r[n]=ga(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:fa}))}return r}function tm(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||Pe(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(ga(o,i))}return r}function rm(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function nm(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function Di(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:fa})}var Oi=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){wn({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?.[Le(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:me(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};function ya(e){if(!e._hasPreviewFlag("metrics"))throw new X("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var Tt=class{_client;constructor(t){this._client=t}prometheus(t){return ya(this._client),this._client._engine.metrics({format:"prometheus",...t})}json(t){return ya(this._client),this._client._engine.metrics({format:"json",...t})}};function wa(e,t){let r=Xt(()=>im(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function im(e){return{datamodel:{models:_i(e.models),enums:_i(e.enums),types:_i(e.types)}}}function _i(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var Ni=new WeakMap,vn="$$PrismaTypedSql",pr=class{constructor(t,r){Ni.set(this,{sql:t,values:r}),Object.defineProperty(this,vn,{value:vn})}get sql(){return Ni.get(this).sql}get values(){return Ni.get(this).values}};function Ea(e){return(...t)=>new pr(e,t)}function Tn(e){return e!=null&&e[vn]===vn}var uc=U(ba());var cc=require("node:async_hooks"),pc=require("node:events"),dc=U(require("node:fs")),ri=U(require("node:path"));var ae=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;i<r.length;){let s=r[i++],a=t[i];if(s instanceof e){this.strings[o]+=s.strings[0];let l=0;for(;l<s.values.length;)this.values[o++]=s.values[l++],this.strings[o]=s.strings[l];this.strings[o]+=a}else this.values[o++]=s,this.strings[o]=a}}get sql(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`?${this.strings[r++]}`;return n}get statement(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`:${r}${this.strings[r++]}`;return n}get text(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`$${r}${this.strings[r++]}`;return n}inspect(){return{sql:this.sql,statement:this.statement,text:this.text,values:this.values}}};function xa(e,t=",",r="",n=""){if(e.length===0)throw new TypeError("Expected `join([])` to be called with an array of multiple elements, but got an empty array");return new ae([r,...Array(e.length-1).fill(t),n],e)}function Mi(e){return new ae([e],[])}var Pa=Mi("");function Fi(e,...t){return new ae(e,t)}function dr(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function ne(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function Ke(e){let t=new Ee;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var An={enumerable:!0,configurable:!0,writable:!0};function Cn(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>An,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var va=Symbol.for("nodejs.util.inspect.custom");function he(e,t){let r=sm(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=Ta(Reflect.ownKeys(o),r),a=Ta(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?{...An,...l?.getPropertyDescriptor(s)}:An:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[va]=function(){let o={...this};return delete o[va],o},i}function sm(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 Ta(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function At(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Ct(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Aa(e){if(e===void 0)return"";let t=Pt(e);return new yt(0,{colors:dn}).write(t).toString()}var am="P2037";function Sn({error:e,user_facing_error:t},r,n){return t.error_code?new B(lm(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new Z(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function lm(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===am&&(r+=`
22
+ Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}var mr="<unknown>";function Ca(e){var t=e.split(`
23
+ `);return t.reduce(function(r,n){var i=pm(n)||mm(n)||hm(n)||bm(n)||wm(n);return i&&r.push(i),r},[])}var um=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,cm=/\((\S*)(?::(\d+))(?::(\d+))\)/;function pm(e){var t=um.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=cm.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]||mr,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var dm=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function mm(e){var t=dm.exec(e);return t?{file:t[2],methodName:t[1]||mr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var fm=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,gm=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function hm(e){var t=fm.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=gm.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||mr,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var ym=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function wm(e){var t=ym.exec(e);return t?{file:t[3],methodName:t[1]||mr,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Em=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function bm(e){var t=Em.exec(e);return t?{file:t[2],methodName:t[1]||mr,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Li=class{getLocation(){return null}},$i=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=Ca(t).find(i=>{if(!i.file)return!1;let o=mi(i.file);return o!=="<anonymous>"&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.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 Ve(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Li:new $i}var Sa={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function St(e={}){let t=Pm(e);return Object.entries(t).reduce((n,[i,o])=>(Sa[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Pm(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Rn(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Ra(e,t){let r=Rn(e);return t({action:"aggregate",unpacker:r,argsMapper:St})(e)}function vm(e={}){let{select:t,...r}=e;return typeof t=="object"?St({...r,_count:t}):St({...r,_count:{_all:!0}})}function Tm(e={}){return typeof e.select=="object"?t=>Rn(e)(t)._count:t=>Rn(e)(t)._count._all}function Ia(e,t){return t({action:"count",unpacker:Tm(e),argsMapper:vm})(e)}function Am(e={}){let t=St(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 Cm(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function ka(e,t){return t({action:"groupBy",unpacker:Cm(e),argsMapper:Am})(e)}function Oa(e,t,r){if(t==="aggregate")return n=>Ra(n,r);if(t==="count")return n=>Ia(n,r);if(t==="groupBy")return n=>ka(n,r)}function Da(e,t){let r=t.fields.filter(i=>!i.relationName),n=Ls(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 ir(e,o,s.type,s.isList,s.kind==="enum")},...Cn(Object.keys(n))})}var _a=e=>Array.isArray(e)?e:e.split("."),Vi=(e,t)=>_a(t).reduce((r,n)=>r&&r[n],e),Na=(e,t,r)=>_a(t).reduceRight((n,i,o,s)=>Object.assign({},Vi(e,s.slice(0,o)),{[i]:n}),r);function Sm(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Rm(e,t,r){return t===void 0?e??{}:Na(t,r,e||!0)}function qi(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Ve(e._errorFormat),c=Sm(n,i),p=Rm(l,o,c),d=r({dataPath:c,callsite:u})(p),m=Im(e,t);return new Proxy(d,{get(g,h){if(!m.includes(h))return g[h];let T=[a[h].type,r,h],C=[c,p];return qi(e,...T,...C)},...Cn([...m,...Object.getOwnPropertyNames(d)])})}}function Im(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var km=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Om=["aggregate","count","groupBy"];function Ui(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Dm(e,t),Nm(e,t),dr(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return he({},n)}function Dm(e,t){let r=xe(t),n=Object.keys(ht).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=Ve(e._errorFormat);return e._createPrismaPromise(c=>{let p={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:c,callsite:u};return e._request({...p,...a})},{action:o,args:l,model:t})};return km.includes(o)?qi(e,t,s):_m(i)?Oa(e,i,s):s({})}}}function _m(e){return Om.includes(e)}function Nm(e,t){return Ke(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return Da(t,r)}))}function Ma(e){return e.replace(/^./,t=>t.toUpperCase())}var ji=Symbol();function fr(e){let t=[Mm(e),Fm(e),ne(ji,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(dr(r)),he(e,t)}function Mm(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function Fm(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(xe),n=[...new Set(t.concat(r))];return Ke({getKeys(){return n},getPropertyValue(i){let o=Ma(i);if(e._runtimeDataModel.models[o]!==void 0)return Ui(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Ui(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Fa(e){return e[ji]?e[ji]:e}function La(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return fr(t)}function $a({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 u=l.needs.filter(c=>n[c]);u.length>0&&a.push(At(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(c=>!r[c]);u.length>0&&a.push(At(u))}Lm(e,l.needs)&&s.push($m(l,he(e,s)))}return s.length>0||a.length>0?he(e,[...s,...a]):e}function Lm(e,t){return t.every(r=>wi(e,r))}function $m(e,t){return Ke(ne(e.name,()=>e.compute(t)))}function In({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=In({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&Va({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&Va({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function Va({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||Pe(s))continue;let l=n.models[r].fields.find(c=>c.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=In({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function qa({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:In({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=xe(l);return $a({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}var Vm=["$connect","$disconnect","$on","$transaction","$use","$extends"],Ua=Vm;function ja(e){if(e instanceof ae)return qm(e);if(Tn(e))return Um(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=gr(e[n]);return r}let t={};for(let r in e)t[r]=gr(e[r]);return t}function qm(e){return new ae(e.strings,e.values)}function Um(e){return new pr(e.sql,e.values)}function gr(e){if(typeof e!="object"||e==null||e instanceof Ie||xt(e))return e;if(gt(e))return new H(e.toFixed());if(ft(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]=gr(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:gr(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=gr(e[r]);return t}me(e,"Unknown value")}function Qa(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:ja(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Ja(o,l),a.args=s,Qa(e,a,r,n+1)}})})}function Ha(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 Qa(e,t,s)}function Ga(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Wa(r,n,0,e):e(r)}}function Wa(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=Ja(i,l),Wa(a,t,r+1,n)}})}var Ba=e=>e;function Ja(e=Ba,t=Ba){return r=>e(t(r))}var Ka=V("prisma:client"),za={Vercel:"vercel","Netlify CI":"netlify"};function Ya({postinstall:e,ciName:t,clientVersion:r}){if(Ka("checkPlatformCaching:postinstall",e),Ka("checkPlatformCaching:ciName",t),e===!0&&t&&t in za){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process.
24
+
25
+ Learn how: https://pris.ly/d/${za[t]}-build`;throw console.error(n),new k(n,r)}}function Za(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}var jm=()=>globalThis.process?.release?.name==="node",Bm=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,Qm=()=>!!globalThis.Deno,Hm=()=>typeof globalThis.Netlify=="object",Gm=()=>typeof globalThis.EdgeRuntime=="object",Wm=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Jm(){return[[Hm,"netlify"],[Gm,"edge-light"],[Wm,"workerd"],[Qm,"deno"],[Bm,"bun"],[jm,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var Km={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 kn(){let e=Jm();return{id:e,prettyName:Km[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var Bi=U(di());function Xa(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function el(e){return e.split(`
26
26
  `).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(`
27
- `)}var Za=q(ys());function Xa({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,Za.default)({user:t,repo:r,template:n,title:e,body:i})}function el({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=Jo(6e3-(s?.length??0)),l=Ya((0,ji.default)(a)),u=n?`# Description
27
+ `)}var tl=U(bs());function rl({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,tl.default)({user:t,repo:r,template:n,title:e,body:i})}function nl({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=Yo(6e3-(s?.length??0)),l=el((0,Bi.default)(a)),u=n?`# Description
28
28
  \`\`\`
29
29
  ${n}
30
- \`\`\``:"",c=(0,ji.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report:
30
+ \`\`\``:"",c=(0,Bi.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report:
31
31
  ## Versions
32
32
 
33
33
  | Name | Version |
@@ -57,38 +57,38 @@ ${l}
57
57
 
58
58
  ## Prisma Engine Query
59
59
  \`\`\`
60
- ${s?za(s):""}
60
+ ${s?Xa(s):""}
61
61
  \`\`\`
62
- `),p=Xa({title:r,body:c});return`${r}
62
+ `),p=rl({title:r,body:c});return`${r}
63
63
 
64
64
  This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.
65
65
 
66
- ${ie(p)}
66
+ ${oe(p)}
67
67
 
68
68
  If you want the Prisma team to look into it, please open the link above \u{1F64F}
69
69
  To increase the chance of success, please post your schema and a snippet of
70
70
  how you used Prisma Client in the issue.
71
- `}function $(e,t){throw new Error(t)}function Ui(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=>Ui(e[r],t[r]))}function gr(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]){if(typeof e[o]=="number"||typeof t[o]=="number")return`${e[o]}`==`${t[o]}`;if(typeof e[o]=="bigint"||typeof t[o]=="bigint")return BigInt(`${e[o]}`.replace(/n$/,""))===BigInt(`${t[o]}`.replace(/n$/,""));if(e[o]instanceof Date||t[o]instanceof Date)return new Date(`${e[o]}`).getTime()===new Date(`${t[o]}`).getTime();if(Q.isDecimal(e[o])||Q.isDecimal(t[o]))return new Q(`${e[o]}`).equals(new Q(`${t[o]}`))}return Ui(e[o],t[o])})}var Ve=class extends Error{name="DataMapperError"};function rl(e,t){switch(t.type){case"Object":return Bi(e,t.fields);case"Value":return Qi(e,t.resultType);default:$(t,`Invalid data mapping type: '${t.type}'`)}}function Bi(e,t){if(e===null)return null;if(Array.isArray(e))return e.map(n=>tl(n,t));if(typeof e=="object")return tl(e,t);if(typeof e=="string"){let r;try{r=JSON.parse(e)}catch(n){throw new Ve("Expected an array or object, got a string that is not valid JSON",{cause:n})}return Bi(r,t)}throw new Ve(`Expected an array or an object, got: ${typeof e}`)}function tl(e,t){if(typeof e!="object")throw new Ve(`Expected an object, but got '${typeof e}'`);let r={};for(let[n,i]of Object.entries(t))switch(i.type){case"Object":{if(!i.flattened&&!Object.hasOwn(e,n))throw new Ve(`Missing data field (Object): '${n}'; node: ${JSON.stringify(i)}; data: ${JSON.stringify(e)}`);let o=i.flattened?e:e[n];r[n]=Bi(o,i.fields);break}case"Value":{let o=i.dbName;if(Object.hasOwn(e,o))r[n]=Qi(e[o],i.resultType);else throw new Ve(`Missing data field (Value): '${o}'; node: ${JSON.stringify(i)}; data: ${JSON.stringify(e)}`)}break;default:$(i,`DataMapper: Invalid data mapping node type: '${i.type}'`)}return r}function Qi(e,t){if(e===null)return null;switch(t.type){case"Any":return e;case"String":return typeof e=="string"?e:`${e}`;case"Int":return typeof e=="number"?e:parseInt(`${e}`,10);case"BigInt":return typeof e=="bigint"?e:BigInt(`${e}`);case"Float":return typeof e=="number"?e:parseFloat(`${e}`);case"Boolean":return typeof e=="boolean"?e:e!=="0";case"Decimal":return typeof e=="number"?new Q(e):new Q(`${e}`);case"Date":return e instanceof Date?e:new Date(`${e}`);case"Array":return e.map(n=>Qi(n,t.inner));case"Object":return typeof e=="string"?e:JSON.stringify(e);case"Bytes":{if(!Array.isArray(e))throw new Ve(`Bytes data is invalid, got: ${typeof e}`);return new Uint8Array(e)}default:$(t,`DataMapper: Unknown result type: ${t.type}`)}}var hr;(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"})(hr||(hr={}));function nl(e){switch(e){case"postgres":return"postgresql";case"mysql":return"mysql";case"sqlite":return"sqlite";default:$(e,`Unknown provider: ${e}`)}}function Hi(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var Pe=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 il(e){if(!Hi(e))throw e;let t=Wm(e),r=Jm(e);throw!t||!r?e:new Pe(r,t,{driverAdapterError:e})}function Wm(e){switch(e.cause.kind){case"AuthenticationFailed":return"P1000";case"DatabaseDoesNotExist":return"P1003";case"SocketTimeout":return"P1008";case"DatabaseAlreadyExists":return"P1009";case"DatabaseAccessDenied":return"P1010";case"LengthMismatch":return"P2000";case"UniqueConstraintViolation":return"P2002";case"ForeignKeyConstraintViolation":return"P2003";case"UnsupportedNativeDataType":return"P2010";case"NullConstraintViolation":return"P2011";case"TableDoesNotExist":return"P2021";case"ColumnNotFound":return"P2022";case"InvalidIsolationLevel":return"P2023";case"TransactionWriteConflict":return"P2034";case"GenericJs":return"P2036";case"TooManyConnections":return"P2037";case"postgres":case"sqlite":case"mysql":return;default:$(e.cause,`Unknown error: ${e.cause}`)}}function Jm(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"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"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 ${Gi({fields:e.cause.fields})}`;case"ForeignKeyConstraintViolation":return`Foreign key constraint violated on the ${Gi(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 ${Gi({fields:e.cause.fields})}`;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`Invalid isolation level \`${e.cause.level}\``;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":return;default:$(e.cause,`Unknown error: ${e.cause}`)}}function Gi(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 Ke(e,t){var r="000000000"+e;return r.substr(r.length-t)}var ol=q(require("node:os"),1);function Km(){try{return ol.default.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var sl=2,zm=Ke(process.pid.toString(36),sl),al=Km(),Ym=al.length,Zm=Ke(al.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+Ym+36).toString(36),sl);function Wi(){return zm+Zm}function kn(e){return typeof e=="string"&&/^c[a-z0-9]{20,32}$/.test(e)}function Ji(e){let n=Math.pow(36,4),i=0;function o(){return Ke((Math.random()*n<<0).toString(36),4)}function s(){return i=i<n?i:0,i++,i-1}function a(){var l="c",u=new Date().getTime().toString(36),c=Ke(s().toString(36),4),p=e(),d=o()+o();return l+u+c+p+d}return a.fingerprint=e,a.isCuid=kn,a}var Xm=Ji(Wi);var ll=Xm;var au=q(Zl());var no=require("node:crypto");var Xl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var qf=128,Ye,It;function jf(e){!Ye||Ye.length<e?(Ye=Buffer.allocUnsafe(e*qf),no.webcrypto.getRandomValues(Ye),It=0):It+e>Ye.length&&(no.webcrypto.getRandomValues(Ye),It=0),It+=e}function io(e=21){jf(e|=0);let t="";for(let r=It-e;r<It;r++)t+=Xl[Ye[r]&63];return t}var Pr=q(require("node:crypto"),1);var tu="0123456789ABCDEFGHJKMNPQRSTVWXYZ",vr=32;var Uf=16,ru=10,eu=0xffffffffffff;var Ze;(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"})(Ze||(Ze={}));var Xe=class extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}};function Bf(e){let t=Math.floor(e()*vr);return t===vr&&(t=vr-1),tu.charAt(t)}function Qf(e){let t=Hf(),r=t&&(t.crypto||t.msCrypto)||(typeof Pr.default<"u"?Pr.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(Pr.default?.randomBytes)return()=>Pr.default.randomBytes(1).readUInt8()/255;throw new Xe(Ze.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Hf(){return Jf()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Gf(e,t){let r="";for(;e>0;e--)r=Bf(t)+r;return r}function Wf(e,t=ru){if(isNaN(e))throw new Xe(Ze.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>eu)throw new Xe(Ze.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${eu}: ${e}`);if(e<0)throw new Xe(Ze.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Xe(Ze.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%vr,n=tu.charAt(r)+n,e=(e-r)/vr;return n}function Jf(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function nu(e,t){let r=t||Qf(),n=!e||isNaN(e)?Date.now():e;return Wf(n,ru)+Gf(Uf,r)}var J=[];for(let e=0;e<256;++e)J.push((e+256).toString(16).slice(1));function Nn(e,t=0){return(J[e[t+0]]+J[e[t+1]]+J[e[t+2]]+J[e[t+3]]+"-"+J[e[t+4]]+J[e[t+5]]+"-"+J[e[t+6]]+J[e[t+7]]+"-"+J[e[t+8]]+J[e[t+9]]+"-"+J[e[t+10]]+J[e[t+11]]+J[e[t+12]]+J[e[t+13]]+J[e[t+14]]+J[e[t+15]]).toLowerCase()}var iu=require("node:crypto"),Fn=new Uint8Array(256),Mn=Fn.length;function kt(){return Mn>Fn.length-16&&((0,iu.randomFillSync)(Fn),Mn=0),Fn.slice(Mn,Mn+=16)}var ou=require("node:crypto"),oo={randomUUID:ou.randomUUID};function Kf(e,t,r){if(oo.randomUUID&&!t&&!e)return oo.randomUUID();e=e||{};let n=e.random??e.rng?.()??kt();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 Nn(n)}var so=Kf;var ao={};function zf(e,t,r){let n;if(e)n=su(e.random??e.rng?.()??kt(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=kt();Yf(ao,i,o),n=su(o,ao.msecs,ao.seq,t,r)}return t??Nn(n)}function Yf(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 su(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 lo=zf;var Ln=class{#e={};constructor(){this.register("now",new $n),this.register("uuid",new uo),this.register("cuid",new co),this.register("ulid",new po),this.register("nanoid",new mo),this.register("product",new fo)}snapshot(){return Object.create(this.#e,{now:{value:new $n}})}register(t,r){this.#e[t]=r}},$n=class{#e=new Date;generate(){return this.#e.toISOString()}},uo=class{generate(t){if(t===4)return so();if(t===7)return lo();throw new Error("Invalid UUID generator arguments")}},co=class{generate(t){if(t===1)return ll();if(t===2)return(0,au.createId)();throw new Error("Invalid CUID generator arguments")}},po=class{generate(){return nu()}},mo=class{generate(t){if(typeof t=="number")return io(t);if(t===void 0)return io();throw new Error("Invalid Nanoid generator arguments")}},fo=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 go(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}function ho(e){return typeof e=="object"&&e!==null&&e.prisma__type==="generatorCall"}function lu(e){return typeof e=="object"&&e!==null&&e.prisma__type==="bytes"}function uu(e){return typeof e=="object"&&e!==null&&e.prisma__type==="bigint"}function Eo(e,t,r){let n=e.type;switch(n){case"rawSql":return pu(e.sql,cu(e.params,t,r));case"templateSql":return Zf(e.fragments,e.placeholderFormat,cu(e.params,t,r));default:$(n,"Invalid query type")}}function cu(e,t,r){return e.map(n=>wo(n,t,r))}function wo(e,t,r){let n=e;for(;eg(n);)if(go(n)){let i=t[n.prisma__value.name];if(i===void 0)throw new Error(`Missing value for query variable ${n.prisma__value.name}`);n=i}else if(ho(n)){let{name:i,args:o}=n.prisma__value,s=r[i];if(!s)throw new Error(`Encountered an unknown generator '${i}'`);n=s.generate(...o.map(a=>wo(a,t,r)))}else $(n,`Unexpected unevaluated value type: ${n}`);return Array.isArray(n)?n=n.map(i=>wo(i,t,r)):lu(n)?n=Buffer.from(n.prisma__value,"base64"):uu(n)&&(n=BigInt(n.prisma__value)),n}function Zf(e,t,r){let n=0,i=1,o=[],s=e.map(a=>{let l=a.type;switch(l){case"parameter":if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);return o.push(r[n++]),yo(t,i++);case"stringChunk":return a.value;case"parameterTuple":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++],c=Array.isArray(u)?u:[u];return`(${c.length==0?"NULL":c.map(d=>(o.push(d),yo(t,i++))).join(",")})`}case"parameterTupleList":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++];if(!Array.isArray(u))throw new Error("Malformed query template. Tuple list expected.");if(u.length===0)throw new Error("Malformed query template. Tuple list cannot be empty.");return u.map(p=>{if(!Array.isArray(p))throw new Error("Malformed query template. Tuple expected.");return`(${p.map(m=>(o.push(m),yo(t,i++))).join(",")})`}).join(",")}default:$(l,"Invalid fragment type")}}).join("");return pu(s,o)}function yo(e,t){return e.hasNumbering?`${e.prefix}${t}`:e.prefix}function pu(e,t){let r=t.map(n=>Xf(n));return{sql:e,args:t,argTypes:r}}function Xf(e){return typeof e=="string"?"Text":typeof e=="number"?"Numeric":typeof e=="boolean"?"Boolean":Array.isArray(e)?"Array":Buffer.isBuffer(e)?"Bytes":"Unknown"}function eg(e){return go(e)||ho(e)}function du(e){return e.rows.map(t=>t.reduce((r,n,i)=>{let o=e.columnNames[i].split("."),s=r;for(let a=0;a<o.length;a++){let l=o[a];a===o.length-1?s[l]=n:(s[l]===void 0&&(s[l]={}),s=s[l])}return r},{}))}function mu(e,t,r){if(!t.every(n=>xo(e,n))){let n=tg(e,r),i=rg(r);throw new Pe(n,i,r.context)}}function xo(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:$(t,`Unknown rule type: ${t.type}`)}}function tg(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:$(t,`Unknown error identifier: ${t}`)}}function rg(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:$(e,`Unknown error identifier: ${e}`)}}var Ot=class e{#e;#i;#t;#o=new Ln;#r;#s;constructor({transactionManager:t,placeholderValues:r,onQuery:n,tracingHelper:i,serializer:o}){this.#e=t,this.#i=r,this.#t=n,this.#r=i,this.#s=o}static forSql(t){return new e({transactionManager:t.transactionManager,placeholderValues:t.placeholderValues,onQuery:t.onQuery,tracingHelper:t.tracingHelper,serializer:du})}async run(t,r){return this.interpretNode(t,r,this.#i,this.#o.snapshot()).catch(n=>il(n))}async interpretNode(t,r,n,i){switch(t.type){case"seq":{let o;for(let s of t.args)o=await this.interpretNode(s,r,n,i);return o}case"get":return n[t.args.name];case"let":{let o=Object.create(n);for(let s of t.args.bindings)o[s.name]=await this.interpretNode(s.expr,r,o,i);return this.interpretNode(t.args.expr,r,o,i)}case"getFirstNonEmpty":{for(let o of t.args.names){let s=n[o];if(!fu(s))return s}return[]}case"concat":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i)));return o.length>0?o.reduce((s,a)=>s.concat(Tr(a)),[]):[]}case"sum":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i)));return o.length>0?o.reduce((s,a)=>gu(s)+gu(a)):0}case"execute":{let o=Eo(t.args,n,i);return this.#n(o,r,async()=>await r.executeRaw(o))}case"query":{let o=Eo(t.args,n,i);return this.#n(o,r,async()=>this.#s(await r.queryRaw(o)))}case"reverse":{let o=await this.interpretNode(t.args,r,n,i);return Array.isArray(o)?o.reverse():o}case"unique":{let o=await this.interpretNode(t.args,r,n,i);if(!Array.isArray(o))return o;if(o.length>1)throw new Error(`Expected zero or one element, got ${o.length}`);return o[0]??null}case"required":{let o=await this.interpretNode(t.args,r,n,i);if(fu(o))throw new Error("Required value is empty");return o}case"mapField":{let o=await this.interpretNode(t.args.records,r,n,i);return xu(o,t.args.field)}case"join":{let o=await this.interpretNode(t.args.parent,r,n,i);if(o===null)return null;let s=await Promise.all(t.args.children.map(async a=>({joinExpr:a,childRecords:await this.interpretNode(a.child,r,n,i)})));if(Array.isArray(o)){for(let a of o)hu(Vn(a),s);return o}return hu(Vn(o),s)}case"transaction":{if(!this.#e.enabled)return this.interpretNode(t.args,r,n,i);let o=this.#e.manager,s=await o.startTransaction(),a=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 o=await this.interpretNode(t.args.expr,r,n,i);return rl(o,t.args.structure)}case"validate":{let o=await this.interpretNode(t.args.expr,r,n,i);return mu(o,t.args.rules,t.args),o}case"if":{let o=await this.interpretNode(t.args.value,r,n,i);return xo(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;case"diff":{let o=await this.interpretNode(t.args.from,r,n,i),s=await this.interpretNode(t.args.to,r,n,i),a=new Set(Tr(s));return Tr(o).filter(l=>!a.has(l))}case"distinctBy":{let o=await this.interpretNode(t.args.expr,r,n,i),s=new Set,a=[];for(let l of Tr(o)){let u=Eu(l,t.args.fields);s.has(u)||(s.add(u),a.push(l))}return a}case"paginate":{let o=await this.interpretNode(t.args.expr,r,n,i),s=Tr(o),a=t.args.pagination.linkingFields;if(a!==null){let l=new Map;for(let c of s){let p=Eu(c,a);l.has(p)||l.set(p,[]),l.get(p).push(c)}let u=Array.from(l.entries());return u.sort(([c],[p])=>c<p?-1:c>p?1:0),u.flatMap(([,c])=>wu(c,t.args.pagination))}return wu(s,t.args.pagination)}default:$(t,`Unexpected node type: ${t.type}`)}}#n(t,r,n){return this.#r.runInChildSpan({name:"db_query",kind:hr.CLIENT,attributes:{"db.query.text":t.sql,"db.system.name":nl(r.provider)}},async()=>{let i=new Date,o=performance.now(),s=await n(),a=performance.now();return this.#t?.({timestamp:i,duration:a-o,query:t.sql,params:t.args}),s})}};function fu(e){return Array.isArray(e)?e.length===0:e==null}function Tr(e){return Array.isArray(e)?e:[e]}function gu(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function Vn(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Expected object, got ${typeof e}`)}function xu(e,t){return Array.isArray(e)?e.map(r=>xu(r,t)):typeof e=="object"&&e!==null?e[t]??null:e}function hu(e,t){for(let{joinExpr:r,childRecords:n}of t)e[r.parentField]=ng(n,e,r);return e}function ng(e,t,r){if(Array.isArray(e)){let n=e.filter(i=>yu(Vn(i),t,r));return r.isRelationUnique?n.length>0?n[0]:null:n}else{if(e===null)return null;{let n=Vn(e);return yu(n,t,r)?n:null}}}function yu(e,t,r){for(let[n,i]of r.on)if(t[n]!==e[i])return!1;return!0}function wu(e,{cursor:t,skip:r,take:n}){let i=t!==null?e.findIndex(a=>gr(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 Eu(e,t){return JSON.stringify(t.map(r=>e[r]))}async function ig(){return globalThis.crypto??await import("node:crypto")}async function bu(){return(await ig()).randomUUID()}var ce=class extends Pe{name="TransactionManagerError";constructor(t,r){super("Transaction API error: "+t,"P2028",r)}},Cr=class extends ce{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.")}},qn=class extends ce{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction.`)}},jn=class extends ce{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back.`)}},Un=class extends ce{constructor(){super("Unable to start a transaction in the given time.")}},Bn=class extends ce{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})}},Dt=class extends ce{constructor(t){super(`Internal Consistency Error: ${t}`)}},Qn=class extends ce{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var og=100,Ar=L("prisma:client:transactionManager"),sg=()=>({sql:"COMMIT",args:[],argTypes:[]}),ag=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),Sr=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n}async startTransaction(t){return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#e(t))}async#e(t){let r=t!==void 0?this.validateOptions(t):this.transactionOptions,n={id:await bu(),status:"waiting",timer:void 0,timeout:r.timeout,startedAt:Date.now(),transaction:void 0};this.transactions.set(n.id,n),n.timer=this.startTransactionTimeout(n.id,r.maxWait);let i=await this.driverAdapter.startTransaction(r.isolationLevel);switch(n.status){case"waiting":return n.transaction=i,clearTimeout(n.timer),n.timer=void 0,n.status="running",n.timer=this.startTransactionTimeout(n.id,r.timeout),{id:n.id};case"timed_out":throw new Un;case"running":case"committed":case"rolled_back":throw new Dt(`Transaction in invalid state ${n.status} although it just finished startup.`);default:$(n.status,"Unknown transaction status.")}}async commitTransaction(t){return await this.tracingHelper.runInChildSpan("commit_transaction",async()=>{let r=this.getActiveTransaction(t,"commit");await this.closeTransaction(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.getActiveTransaction(t,"rollback");await this.closeTransaction(r,"rolled_back")})}getTransaction(t,r){let n=this.getActiveTransaction(t.id,r);if(!n.transaction)throw new Cr;return n.transaction}getActiveTransaction(t,r){let n=this.transactions.get(t);if(!n){let i=this.closedTransactions.find(o=>o.id===t);if(i)switch(Ar("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"waiting":case"running":throw new Dt("Active transaction found in closed transactions list.");case"committed":throw new qn(r);case"rolled_back":throw new jn(r);case"timed_out":throw new Bn(r,{timeout:i.timeout,timeTaken:Date.now()-i.startedAt})}else throw Ar("Transaction not found.",t),new Cr}if(["committed","rolled_back","timed_out"].includes(n.status))throw new Dt("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.closeTransaction(t,"rolled_back")))}startTransactionTimeout(t,r){let n=Date.now();return setTimeout(async()=>{Ar("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let i=this.transactions.get(t);i&&["running","waiting"].includes(i.status)?await this.closeTransaction(i,"timed_out"):Ar("Transaction already committed or rolled back when timeout happened.",t)},r)}async closeTransaction(t,r){Ar("Closing transaction.",{transactionId:t.id,status:r}),t.status=r,t.transaction&&r==="committed"?(await t.transaction.commit(),t.transaction.options.usePhantomQuery||await t.transaction.executeRaw(sg())):t.transaction&&(await t.transaction.rollback(),t.transaction.options.usePhantomQuery||await t.transaction.executeRaw(ag())),clearTimeout(t.timer),t.timer=void 0,this.transactions.delete(t.id),this.closedTransactions.push(t),this.closedTransactions.length>og&&this.closedTransactions.shift()}validateOptions(t){if(!t.timeout)throw new ce("timeout is required");if(!t.maxWait)throw new ce("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new Qn(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}};var Hn="6.9.0-dev.20";var bo,Pu={async loadQueryCompiler(e){let{clientVersion:t,adapter:r,compilerWasm:n}=e;if(r===void 0)throw new I(`The \`adapter\` option for \`PrismaClient\` is required in this context (${In().prettyName})`,t);if(n===void 0)throw new I("WASM query compiler was unexpectedly `undefined`",t);return bo===void 0&&(bo=(async()=>{let i=await n.getRuntime(),o=await n.getQueryCompilerWasmModule();if(o==null)throw new I("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})()),await bo}};var vu="P2038",Gn=L("prisma:client:clientEngine"),Cu=globalThis;Cu.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new te(e,Hn)}};var _t=class{name="ClientEngine";queryCompiler;instantiateQueryCompilerPromise;QueryCompilerConstructor;queryCompilerLoader;adapterPromise;transactionManagerPromise;config;provider;datamodel;logEmitter;logQueries;logLevel;lastStartedQuery;tracingHelper;#e;constructor(t,r){if(!t.previewFeatures?.includes("driverAdapters"))throw new I("EngineType `client` requires the driverAdapters preview feature to be enabled.",t.clientVersion,vu);if(t.adapter)this.adapterPromise=t.adapter.connect(),this.provider=t.adapter.provider,Gn("Using driver adapter: %O",t.adapter);else throw new I("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,vu);this.queryCompilerLoader=r??Pu,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.#e=n=>{this.logEmitter.emit("query",{...n,params:JSON.stringify(n.params),target:"ClientEngine"})}),this.transactionManagerPromise=this.adapterPromise.then(n=>new Sr({driverAdapter:n,transactionOptions:{...this.config.transactionOptions,isolationLevel:this.#n(this.config.transactionOptions.isolationLevel)},tracingHelper:this.tracingHelper})),this.instantiateQueryCompilerPromise=this.instantiateQueryCompiler()}applyPendingMigrations(){throw new Error("Cannot call applyPendingMigrations on engine type client.")}async instantiateQueryCompiler(){if(!this.queryCompiler){this.QueryCompilerConstructor||(this.QueryCompilerConstructor=await this.queryCompilerLoader.loadQueryCompiler(this.config));try{this.#r(()=>{this.queryCompiler=new this.QueryCompilerConstructor({datamodel:this.datamodel,provider:this.provider,connectionInfo:{}})})}catch(t){throw this.#i(t)}}}#i(t){if(t instanceof te)return t;try{let r=JSON.parse(t.message);return new I(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#t(t){if(t instanceof I)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new te(Tu(this,t.message),this.config.clientVersion);if(t instanceof Pe)return new U(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let r=JSON.parse(t);return new Y(`${r.message}
72
- ${r.backtrace}`,{clientVersion:this.config.clientVersion})}catch{return t}}#o(t){return t instanceof te?t:typeof t.message=="string"&&typeof t.code=="string"?new U(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion}):t}#r(t){let r=Cu.PRISMA_WASM_PANIC_REGISTRY.set_message,n;global.PRISMA_WASM_PANIC_REGISTRY.set_message=i=>{n=i};try{return t()}finally{if(global.PRISMA_WASM_PANIC_REGISTRY.set_message=r,n)throw new te(Tu(this,n),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.tracingHelper.runInChildSpan("connect",()=>this.ensureStarted())}async stop(){await this.tracingHelper.runInChildSpan("disconnect",async()=>{await this.instantiateQueryCompilerPromise,await(await this.transactionManagerPromise)?.cancelAllTransactions(),await(await this.adapterPromise).dispose()})}async ensureStarted(){let t=await this.adapterPromise,r=await this.transactionManagerPromise;return await this.instantiateQueryCompilerPromise,[t,r]}version(){return"unknown"}async transaction(t,r,n){let i,o=await this.transactionManagerPromise;try{if(t==="start"){let s=n;i=await o.startTransaction({...s,isolationLevel:this.#n(s.isolationLevel)})}else if(t==="commit"){let s=n;await o.commitTransaction(s.id)}else if(t==="rollback"){let s=n;await o.rollbackTransaction(s.id)}else de(t,"Invalid transaction action.")}catch(s){throw this.#t(s)}return i?{id:i.id,payload:void 0}:void 0}async request(t,{traceparent:r,interactiveTransaction:n}){Gn("sending request");let i=JSON.stringify(t);this.lastStartedQuery=i;let[o,s]=await this.ensureStarted().catch(l=>{throw this.#t(l)}),a;try{a=this.#r(()=>this.queryCompiler.compile(i))}catch(l){throw this.#o(l)}try{let l=JSON.parse(a);Gn("query plan created",a);let u=n?s.getTransaction(n,"query"):o,c=n?{enabled:!1}:{enabled:!0,manager:s},p={},m=await Ot.forSql({transactionManager:c,placeholderValues:p,onQuery:this.#e,tracingHelper:this.tracingHelper}).run(l,u);return Gn("query plan executed"),{data:{[t.action]:m}}}catch(l){throw this.#t(l)}}async requestBatch(t,{transaction:r,traceparent:n}){if(t.length===0)return[];let i=t[0].action,o=JSON.stringify(Ct(t,r));this.lastStartedQuery=o;let[,s]=await this.ensureStarted().catch(l=>{throw this.#t(l)}),a;try{a=this.queryCompiler.compileBatch(o)}catch(l){throw this.#o(l)}try{let l;if(r?.kind==="itx")l=r.options;else{let m=r?.options.isolationLevel?{...this.config.transactionOptions,isolationLevel:r.options.isolationLevel}:this.config.transactionOptions;l=await this.transaction("start",{},m)}let u={},c=Ot.forSql({transactionManager:{enabled:!1},placeholderValues:u,onQuery:this.#e,tracingHelper:this.tracingHelper}),p=s.getTransaction(l,"batch query"),d=[];switch(a.type){case"multi":{d=await Promise.all(a.plans.map((m,g)=>c.run(m,p).then(h=>({data:{[t[g].action]:h}}),h=>h)));break}case"compacted":{if(!t.every(g=>g.action===i))throw new Error("All queries in a batch must have the same action");let m=await c.run(a.plan,p);d=this.#s(m,a,i);break}}return r?.kind!=="itx"&&await this.transaction("commit",{},l),d}catch(l){throw this.#t(l)}}metrics(t){throw new Error("Method not implemented.")}#s(t,r,n){let i=t.map(s=>r.keys.reduce((a,l)=>(a[l]=s[l],a),{})),o=new Set(r.nestedSelection);return r.arguments.map(s=>{let a=i.findIndex(l=>gr(l,s));if(a===-1)return r.expectNonEmpty?new U("An operation failed because it depends on one or more records that were required but not found",{code:"P2025",clientVersion:this.config.clientVersion}):{data:{[n]:null}};{let l=Object.entries(t[a]).filter(([u])=>o.has(u));return{data:{[n]:Object.fromEntries(l)}}}})}#n(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 U(`Inconsistent column data: Conversion failed: Invalid isolation level \`${t}\``,{code:"P2023",clientVersion:this.config.clientVersion,meta:{providedIsolationLevel:t}})}}};function Tu(e,t){return el({binaryTarget:void 0,title:t,version:e.config.clientVersion,engineVersion:"unknown",database:e.config.activeProvider,query:e.lastStartedQuery})}function Nt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new I(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new I("error: Missing URL environment variable, value, or override.",n);return i}var Wn=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 ae=class extends Wn{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function A(e,t){return{...e,isRetryable:t}}var Mt=class extends ae{name="ForcedRetryError";code="P5001";constructor(t){super("This request must be retried",A(t,!0))}};b(Mt,"ForcedRetryError");var et=class extends ae{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,A(r,!1))}};b(et,"InvalidDatasourceError");var tt=class extends ae{name="NotImplementedYetError";code="P5004";constructor(t,r){super(t,A(r,!1))}};b(tt,"NotImplementedYetError");var M=class extends ae{response;constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var rt=class extends M{name="SchemaMissingError";code="P5005";constructor(t){super("Schema needs to be uploaded",A(t,!0))}};b(rt,"SchemaMissingError");var Po="This request could not be understood by the server",Rr=class extends M{name="BadRequestError";code="P5000";constructor(t,r,n){super(r||Po,A(t,!1)),n&&(this.code=n)}};b(Rr,"BadRequestError");var Ir=class extends M{name="HealthcheckTimeoutError";code="P5013";logs;constructor(t,r){super("Engine not started: healthcheck timeout",A(t,!0)),this.logs=r}};b(Ir,"HealthcheckTimeoutError");var kr=class extends M{name="EngineStartupError";code="P5014";logs;constructor(t,r,n){super(r,A(t,!0)),this.logs=n}};b(kr,"EngineStartupError");var Or=class extends M{name="EngineVersionNotSupportedError";code="P5012";constructor(t){super("Engine version is not supported",A(t,!1))}};b(Or,"EngineVersionNotSupportedError");var vo="Request timed out",Dr=class extends M{name="GatewayTimeoutError";code="P5009";constructor(t,r=vo){super(r,A(t,!1))}};b(Dr,"GatewayTimeoutError");var ug="Interactive transaction error",_r=class extends M{name="InteractiveTransactionError";code="P5015";constructor(t,r=ug){super(r,A(t,!1))}};b(_r,"InteractiveTransactionError");var cg="Request parameters are invalid",Nr=class extends M{name="InvalidRequestError";code="P5011";constructor(t,r=cg){super(r,A(t,!1))}};b(Nr,"InvalidRequestError");var To="Requested resource does not exist",Mr=class extends M{name="NotFoundError";code="P5003";constructor(t,r=To){super(r,A(t,!1))}};b(Mr,"NotFoundError");var Co="Unknown server error",Ft=class extends M{name="ServerError";code="P5006";logs;constructor(t,r,n){super(r||Co,A(t,!0)),this.logs=n}};b(Ft,"ServerError");var Ao="Unauthorized, check your connection string",Fr=class extends M{name="UnauthorizedError";code="P5007";constructor(t,r=Ao){super(r,A(t,!1))}};b(Fr,"UnauthorizedError");var So="Usage exceeded, retry again later",Lr=class extends M{name="UsageExceededError";code="P5008";constructor(t,r=So){super(r,A(t,!0))}};b(Lr,"UsageExceededError");async function pg(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function $r(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await pg(e);if(n.type==="QueryEngineError")throw new U(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Ft(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new rt(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Or(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new kr(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new I(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Ir(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new _r(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Nr(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Fr(r,Lt(Ao,n));if(e.status===404)return new Mr(r,Lt(To,n));if(e.status===429)throw new Lr(r,Lt(So,n));if(e.status===504)throw new Dr(r,Lt(vo,n));if(e.status>=500)throw new Ft(r,Lt(Co,n));if(e.status>=400)throw new Rr(r,Lt(Po,n))}function Lt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}function Au(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}var Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Su(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=t[p]<<16|t[p+1]<<8|t[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,r+=Oe[s]+Oe[a]+Oe[l]+Oe[u];return i==1?(c=t[o],s=(c&252)>>2,a=(c&3)<<4,r+=Oe[s]+Oe[a]+"=="):i==2&&(c=t[o]<<8|t[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,r+=Oe[s]+Oe[a]+Oe[l]+"="),r}function Ru(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new I("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function dg(e){return e[0]*1e3+e[1]/1e6}function Ro(e){return new Date(dg(e))}var Iu={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Vr=class extends ae{name="RequestError";code="P5010";constructor(t,r){super(`Cannot fetch data from service:
73
- ${t}`,A(r,!0))}};b(Vr,"RequestError");async function nt(e,t,r=n=>n){let{clientVersion:n,...i}=t,o=r(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new Vr(a,{clientVersion:n,cause:s})}}var fg=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,ku=L("prisma:client:dataproxyEngine");async function gg(e,t){let r=Iu["@prisma/engines-version"],n=t.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION||globalThis.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION||globalThis.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&fg.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){let[s]=r.split("-")??[],[a,l,u]=s.split("."),c=hg(`<=${a}.${l}.${u}`),p=await nt(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||"<empty body>"}`);let d=await p.text();ku("length of body fetched from unpkg.com",d.length);let m;try{m=JSON.parse(d)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),g}return m.version}throw new tt("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Ou(e,t){let r=await gg(e,t);return ku("version",r),r}function hg(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Du=3,qr=L("prisma:client:dataproxyEngine"),Io=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,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},jr=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;protocol;constructor(t){Ru(t),this.config=t,this.env={...t.env,...typeof process<"u"?process.env:{}},this.inlineSchema=Su(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let{apiKey:t,url:r}=this.getURLAndAPIKey();this.host=r.host,this.headerBuilder=new Io({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.protocol=li(r)?"http":"https",this.remoteClientVersion=await Ou(this.host,this.config),qr("host",this.host),qr("protocol",this.protocol)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"trace":qr(r);break;case"error":case"warn":case"info":{this.logEmitter.emit(r.level,{timestamp:Ro(r.timestamp),message:r.attributes.message??"",target:r.target});break}case"query":{this.logEmitter.emit("query",{query:r.attributes.query??"",timestamp:Ro(r.timestamp),duration:r.attributes.duration_ms??0,params:r.attributes.params??"",target:r.target});break}default:r.level}}),t?.traces?.length&&this.tracingHelper.dispatchEngineSpans(t.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`${this.protocol}://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await nt(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||qr("schema response status",r.status);let n=await $r(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Ct(t,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await nt(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||qr("graphql response status",a.status),await this.handleError(await $r(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await nt(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await $r(l,this.clientVersion));let u=await l.json(),{extensions:c}=u;c&&this.propagateResponseExtensions(c);let p=u.id,d=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:d}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await nt(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await $r(a,this.clientVersion));let l=await a.json(),{extensions:u}=l;u&&this.propagateResponseExtensions(u);return}}})}getURLAndAPIKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=Nt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new et(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,searchParams:s}=i;if(o!=="prisma:"&&o!==Hr)throw new et(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\` or \`prisma+postgres://\``,t);let a=s.get("api_key");if(a===null||a.length<1)throw new et(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return{apiKey:a,url:i}}metrics(){throw new tt("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof ae)||!i.isRetryable)throw i;if(r>=Du)throw i instanceof Mt?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${Du} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await Au(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof rt)throw await this.uploadSchema(),new Mt({clientVersion:this.clientVersion,cause:t});if(t)throw t}convertProtocolErrorsToClientError(t){return t.length===1?An(t[0],this.config.clientVersion,this.config.activeProvider):new Y(JSON.stringify(t),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function _u({copyEngine:e=!0},t){let r;try{r=Nt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||Gr(r));e&&n&&zt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=at(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary",u=i==="client";if(o&&s||s&&!1){let c;throw e?r?.startsWith("prisma://")?c=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:c=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:c=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new Z(c.join(`
74
- `),{clientVersion:t.clientVersion})}return o?new jr(t):u?new _t(t):new _t(t)}function Jn({generator:e}){return e?.previewFeatures??[]}var Nu=e=>({command:e});var Mu=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);function $t(e){try{return Fu(e,"fast")}catch{return Fu(e,"slow")}}function Fu(e,t){return JSON.stringify(e.map(r=>$u(r,t)))}function $u(e,t){if(Array.isArray(e))return e.map(r=>$u(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(mt(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(Q.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(yg(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"?Vu(e):e}function yg(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Vu(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Lu);let t={};for(let r of Object.keys(e))t[r]=Lu(e[r]);return t}function Lu(e){return typeof e=="bigint"?e.toString():Vu(e)}var wg=/^(\s*alter\s)/i,qu=L("prisma:client");function ko(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&wg.exec(t))throw new Error(`Running ALTER using ${n} is not supported
71
+ `}function $(e,t){throw new Error(t)}function Qi(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=>Qi(e[r],t[r]))}function hr(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]){if(typeof e[o]=="number"||typeof t[o]=="number")return`${e[o]}`==`${t[o]}`;if(typeof e[o]=="bigint"||typeof t[o]=="bigint")return BigInt(`${e[o]}`.replace(/n$/,""))===BigInt(`${t[o]}`.replace(/n$/,""));if(e[o]instanceof Date||t[o]instanceof Date)return new Date(`${e[o]}`).getTime()===new Date(`${t[o]}`).getTime();if(H.isDecimal(e[o])||H.isDecimal(t[o]))return new H(`${e[o]}`).equals(new H(`${t[o]}`))}return Qi(e[o],t[o])})}function Hi(e){return JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():r instanceof Uint8Array?Buffer.from(r).toString("base64"):r)}var qe=class extends Error{name="DataMapperError"};function ol(e,t){switch(t.type){case"Object":return Gi(e,t.fields);case"Value":return Wi(e,t.resultType);default:$(t,`Invalid data mapping type: '${t.type}'`)}}function Gi(e,t){if(e===null)return null;if(Array.isArray(e))return e.map(n=>il(n,t));if(typeof e=="object")return il(e,t);if(typeof e=="string"){let r;try{r=JSON.parse(e)}catch(n){throw new qe("Expected an array or object, got a string that is not valid JSON",{cause:n})}return Gi(r,t)}throw new qe(`Expected an array or an object, got: ${typeof e}`)}function il(e,t){if(typeof e!="object")throw new qe(`Expected an object, but got '${typeof e}'`);let r={};for(let[n,i]of Object.entries(t))switch(i.type){case"Object":{if(!i.flattened&&!Object.hasOwn(e,n))throw new qe(`Missing data field (Object): '${n}'; node: ${JSON.stringify(i)}; data: ${JSON.stringify(e)}`);let o=i.flattened?e:e[n];r[n]=Gi(o,i.fields);break}case"Value":{let o=i.dbName;if(Object.hasOwn(e,o))r[n]=Wi(e[o],i.resultType);else throw new qe(`Missing data field (Value): '${o}'; node: ${JSON.stringify(i)}; data: ${JSON.stringify(e)}`)}break;default:$(i,`DataMapper: Invalid data mapping node type: '${i.type}'`)}return r}function Wi(e,t){if(e===null)return null;switch(t.type){case"Any":return e;case"String":return typeof e=="string"?e:`${e}`;case"Int":return typeof e=="number"?e:parseInt(`${e}`,10);case"BigInt":return typeof e=="bigint"?e:BigInt(`${e}`);case"Float":return typeof e=="number"?e:parseFloat(`${e}`);case"Boolean":return typeof e=="boolean"?e:e!=="0";case"Decimal":return typeof e=="number"?new H(e):new H(`${e}`);case"Date":return e instanceof Date?e:new Date(`${e}`);case"Array":return e.map(n=>Wi(n,t.inner));case"Object":return typeof e=="string"?e:JSON.stringify(e);case"Bytes":{if(!Array.isArray(e))throw new qe(`Bytes data is invalid, got: ${typeof e}`);return new Uint8Array(e)}default:$(t,`DataMapper: Unknown result type: ${t.type}`)}}var yr;(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"})(yr||(yr={}));function zm(e){switch(e){case"postgres":return"postgresql";case"mysql":return"mysql";case"sqlite":return"sqlite";default:$(e,`Unknown provider: ${e}`)}}async function On({query:e,queryable:t,tracingHelper:r,onQuery:n,execute:i}){return await r.runInChildSpan({name:"db_query",kind:yr.CLIENT,attributes:{"db.query.text":e.sql,"db.system.name":zm(t.provider)}},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 Ji(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var A={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 ve=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 sl(e){if(!Ji(e))throw e;let t=Ym(e),r=Zm(e);throw!t||!r?e:new ve(r,t,{driverAdapterError:e})}function Ym(e){switch(e.cause.kind){case"AuthenticationFailed":return"P1000";case"DatabaseDoesNotExist":return"P1003";case"SocketTimeout":return"P1008";case"DatabaseAlreadyExists":return"P1009";case"DatabaseAccessDenied":return"P1010";case"LengthMismatch":return"P2000";case"UniqueConstraintViolation":return"P2002";case"ForeignKeyConstraintViolation":return"P2003";case"UnsupportedNativeDataType":return"P2010";case"NullConstraintViolation":return"P2011";case"TableDoesNotExist":return"P2021";case"ColumnNotFound":return"P2022";case"InvalidIsolationLevel":return"P2023";case"TransactionWriteConflict":return"P2034";case"GenericJs":return"P2036";case"TooManyConnections":return"P2037";case"postgres":case"sqlite":case"mysql":return;default:$(e.cause,`Unknown error: ${e.cause}`)}}function Zm(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"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"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 ${Ki({fields:e.cause.fields})}`;case"ForeignKeyConstraintViolation":return`Foreign key constraint violated on the ${Ki(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 ${Ki({fields:e.cause.fields})}`;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`Invalid isolation level \`${e.cause.level}\``;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":return;default:$(e.cause,`Unknown error: ${e.cause}`)}}function Ki(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 ze(e,t){var r="000000000"+e;return r.substr(r.length-t)}var al=U(require("node:os"),1);function Xm(){try{return al.default.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var ll=2,ef=ze(process.pid.toString(36),ll),ul=Xm(),tf=ul.length,rf=ze(ul.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+tf+36).toString(36),ll);function zi(){return ef+rf}function Dn(e){return typeof e=="string"&&/^c[a-z0-9]{20,32}$/.test(e)}function Yi(e){let n=Math.pow(36,4),i=0;function o(){return ze((Math.random()*n<<0).toString(36),4)}function s(){return i=i<n?i:0,i++,i-1}function a(){var l="c",u=new Date().getTime().toString(36),c=ze(s().toString(36),4),p=e(),d=o()+o();return l+u+c+p+d}return a.fingerprint=e,a.isCuid=Dn,a}var nf=Yi(zi);var cl=nf;var uu=U(eu());var so=require("node:crypto");var tu="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Qf=128,Ze,kt;function Hf(e){!Ze||Ze.length<e?(Ze=Buffer.allocUnsafe(e*Qf),so.webcrypto.getRandomValues(Ze),kt=0):kt+e>Ze.length&&(so.webcrypto.getRandomValues(Ze),kt=0),kt+=e}function ao(e=21){Hf(e|=0);let t="";for(let r=kt-e;r<kt;r++)t+=tu[Ze[r]&63];return t}var vr=U(require("node:crypto"),1);var nu="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Tr=32;var Gf=16,iu=10,ru=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 et=class extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}};function Wf(e){let t=Math.floor(e()*Tr);return t===Tr&&(t=Tr-1),nu.charAt(t)}function Jf(e){let t=Kf(),r=t&&(t.crypto||t.msCrypto)||(typeof vr.default<"u"?vr.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(vr.default?.randomBytes)return()=>vr.default.randomBytes(1).readUInt8()/255;throw new et(Xe.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Kf(){return Zf()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function zf(e,t){let r="";for(;e>0;e--)r=Wf(t)+r;return r}function Yf(e,t=iu){if(isNaN(e))throw new et(Xe.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>ru)throw new et(Xe.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${ru}: ${e}`);if(e<0)throw new et(Xe.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new et(Xe.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%Tr,n=nu.charAt(r)+n,e=(e-r)/Tr;return n}function Zf(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function ou(e,t){let r=t||Jf(),n=!e||isNaN(e)?Date.now():e;return Yf(n,iu)+zf(Gf,r)}var K=[];for(let e=0;e<256;++e)K.push((e+256).toString(16).slice(1));function Fn(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 su=require("node:crypto"),$n=new Uint8Array(256),Ln=$n.length;function Ot(){return Ln>$n.length-16&&((0,su.randomFillSync)($n),Ln=0),$n.slice(Ln,Ln+=16)}var au=require("node:crypto"),lo={randomUUID:au.randomUUID};function Xf(e,t,r){if(lo.randomUUID&&!t&&!e)return lo.randomUUID();e=e||{};let n=e.random??e.rng?.()??Ot();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 Fn(n)}var uo=Xf;var co={};function eg(e,t,r){let n;if(e)n=lu(e.random??e.rng?.()??Ot(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=Ot();tg(co,i,o),n=lu(o,co.msecs,co.seq,t,r)}return t??Fn(n)}function tg(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 lu(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 po=eg;var Vn=class{#e={};constructor(){this.register("now",new qn),this.register("uuid",new mo),this.register("cuid",new fo),this.register("ulid",new go),this.register("nanoid",new ho),this.register("product",new yo)}snapshot(){return Object.create(this.#e,{now:{value:new qn}})}register(t,r){this.#e[t]=r}},qn=class{#e=new Date;generate(){return this.#e.toISOString()}},mo=class{generate(t){if(t===4)return uo();if(t===7)return po();throw new Error("Invalid UUID generator arguments")}},fo=class{generate(t){if(t===1)return cl();if(t===2)return(0,uu.createId)();throw new Error("Invalid CUID generator arguments")}},go=class{generate(){return ou()}},ho=class{generate(t){if(typeof t=="number")return ao(t);if(t===void 0)return ao();throw new Error("Invalid Nanoid generator arguments")}},yo=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 wo(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}function Eo(e){return typeof e=="object"&&e!==null&&e.prisma__type==="generatorCall"}function cu(e){return typeof e=="object"&&e!==null&&e.prisma__type==="bytes"}function pu(e){return typeof e=="object"&&e!==null&&e.prisma__type==="bigint"}function Po(e,t,r){let n=e.type;switch(n){case"rawSql":return mu(e.sql,du(e.params,t,r));case"templateSql":return rg(e.fragments,e.placeholderFormat,du(e.params,t,r));default:$(n,"Invalid query type")}}function du(e,t,r){return e.map(n=>xo(n,t,r))}function xo(e,t,r){let n=e;for(;ig(n);)if(wo(n)){let i=t[n.prisma__value.name];if(i===void 0)throw new Error(`Missing value for query variable ${n.prisma__value.name}`);n=i}else if(Eo(n)){let{name:i,args:o}=n.prisma__value,s=r[i];if(!s)throw new Error(`Encountered an unknown generator '${i}'`);n=s.generate(...o.map(a=>xo(a,t,r)))}else $(n,`Unexpected unevaluated value type: ${n}`);return Array.isArray(n)?n=n.map(i=>xo(i,t,r)):cu(n)?n=Buffer.from(n.prisma__value,"base64"):pu(n)&&(n=BigInt(n.prisma__value)),n}function rg(e,t,r){let n=0,i=1,o=[],s=e.map(a=>{let l=a.type;switch(l){case"parameter":if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);return o.push(r[n++]),bo(t,i++);case"stringChunk":return a.value;case"parameterTuple":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++],c=Array.isArray(u)?u:[u];return`(${c.length==0?"NULL":c.map(d=>(o.push(d),bo(t,i++))).join(",")})`}case"parameterTupleList":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++];if(!Array.isArray(u))throw new Error("Malformed query template. Tuple list expected.");if(u.length===0)throw new Error("Malformed query template. Tuple list cannot be empty.");return u.map(p=>{if(!Array.isArray(p))throw new Error("Malformed query template. Tuple expected.");return`(${p.map(m=>(o.push(m),bo(t,i++))).join(",")})`}).join(",")}default:$(l,"Invalid fragment type")}}).join("");return mu(s,o)}function bo(e,t){return e.hasNumbering?`${e.prefix}${t}`:e.prefix}function mu(e,t){let r=t.map(n=>ng(n));return{sql:e,args:t,argTypes:r}}function ng(e){return typeof e=="string"?"Text":typeof e=="number"?"Numeric":typeof e=="boolean"?"Boolean":Array.isArray(e)?"Array":Buffer.isBuffer(e)?"Bytes":"Unknown"}function ig(e){return wo(e)||Eo(e)}function fu(e){return e.rows.map(t=>t.reduce((r,n,i)=>{let o=e.columnNames[i].split("."),s=r;for(let a=0;a<o.length;a++){let l=o[a];a===o.length-1?s[l]=n:(s[l]===void 0&&(s[l]={}),s=s[l])}return r},{}))}function gu(e){return{columns:e.columnNames,types:e.columnTypes.map(t=>og(t)),rows:e.rows}}function og(e){switch(e){case A.Int32:return"int";case A.Int64:return"bigint";case A.Float:return"float";case A.Double:return"double";case A.Text:return"string";case A.Enum:return"enum";case A.Bytes:return"bytes";case A.Boolean:return"bool";case A.Character:return"char";case A.Numeric:return"decimal";case A.Json:return"json";case A.Uuid:return"uuid";case A.DateTime:return"datetime";case A.Date:return"date";case A.Time:return"time";case A.Int32Array:return"int-array";case A.Int64Array:return"bigint-array";case A.FloatArray:return"float-array";case A.DoubleArray:return"double-array";case A.TextArray:return"string-array";case A.EnumArray:return"string-array";case A.BytesArray:return"bytes-array";case A.BooleanArray:return"bool-array";case A.CharacterArray:return"char-array";case A.NumericArray:return"decimal-array";case A.JsonArray:return"json-array";case A.UuidArray:return"uuid-array";case A.DateTimeArray:return"datetime-array";case A.DateArray:return"date-array";case A.TimeArray:return"time-array";case A.UnknownNumber:return"unknown";case A.Set:return"string";default:$(e,`Unexpected column type: ${e}`)}}function hu(e,t,r){if(!t.every(n=>vo(e,n))){let n=sg(e,r),i=ag(r);throw new ve(n,i,r.context)}}function vo(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:$(t,`Unknown rule type: ${t.type}`)}}function sg(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:$(t,`Unknown error identifier: ${t}`)}}function ag(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:$(e,`Unknown error identifier: ${e}`)}}var Dt=class e{#e;#r;#t;#o=new Vn;#n;#s;#i;constructor({transactionManager:t,placeholderValues:r,onQuery:n,tracingHelper:i,serializer:o,rawSerializer:s}){this.#e=t,this.#r=r,this.#t=n,this.#n=i,this.#s=o,this.#i=s??o}static forSql(t){return new e({transactionManager:t.transactionManager,placeholderValues:t.placeholderValues,onQuery:t.onQuery,tracingHelper:t.tracingHelper,serializer:fu,rawSerializer:gu})}async run(t,r){return this.interpretNode(t,r,this.#r,this.#o.snapshot()).catch(n=>sl(n))}async interpretNode(t,r,n,i){switch(t.type){case"seq":{let o;for(let s of t.args)o=await this.interpretNode(s,r,n,i);return o}case"get":return n[t.args.name];case"let":{let o=Object.create(n);for(let s of t.args.bindings)o[s.name]=await this.interpretNode(s.expr,r,o,i);return this.interpretNode(t.args.expr,r,o,i)}case"getFirstNonEmpty":{for(let o of t.args.names){let s=n[o];if(!yu(s))return s}return[]}case"concat":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i)));return o.length>0?o.reduce((s,a)=>s.concat(Ar(a)),[]):[]}case"sum":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i)));return o.length>0?o.reduce((s,a)=>wu(s)+wu(a)):0}case"execute":{let o=Po(t.args,n,i);return this.#a(o,r,async()=>await r.executeRaw(o))}case"query":{let o=Po(t.args,n,i);return this.#a(o,r,async()=>t.args.type==="rawSql"?this.#i(await r.queryRaw(o)):this.#s(await r.queryRaw(o)))}case"reverse":{let o=await this.interpretNode(t.args,r,n,i);return Array.isArray(o)?o.reverse():o}case"unique":{let o=await this.interpretNode(t.args,r,n,i);if(!Array.isArray(o))return o;if(o.length>1)throw new Error(`Expected zero or one element, got ${o.length}`);return o[0]??null}case"required":{let o=await this.interpretNode(t.args,r,n,i);if(yu(o))throw new Error("Required value is empty");return o}case"mapField":{let o=await this.interpretNode(t.args.records,r,n,i);return vu(o,t.args.field)}case"join":{let o=await this.interpretNode(t.args.parent,r,n,i);if(o===null)return null;let s=await Promise.all(t.args.children.map(async a=>({joinExpr:a,childRecords:await this.interpretNode(a.child,r,n,i)})));if(Array.isArray(o)){for(let a of o)Eu(Un(a),s);return o}return Eu(Un(o),s)}case"transaction":{if(!this.#e.enabled)return this.interpretNode(t.args,r,n,i);let o=this.#e.manager,s=await o.startTransaction(),a=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 o=await this.interpretNode(t.args.expr,r,n,i);return ol(o,t.args.structure)}case"validate":{let o=await this.interpretNode(t.args.expr,r,n,i);return hu(o,t.args.rules,t.args),o}case"if":{let o=await this.interpretNode(t.args.value,r,n,i);return vo(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;case"diff":{let o=await this.interpretNode(t.args.from,r,n,i),s=await this.interpretNode(t.args.to,r,n,i),a=new Set(Ar(s));return Ar(o).filter(l=>!a.has(l))}case"distinctBy":{let o=await this.interpretNode(t.args.expr,r,n,i),s=new Set,a=[];for(let l of Ar(o)){let u=Pu(l,t.args.fields);s.has(u)||(s.add(u),a.push(l))}return a}case"paginate":{let o=await this.interpretNode(t.args.expr,r,n,i),s=Ar(o),a=t.args.pagination.linkingFields;if(a!==null){let l=new Map;for(let c of s){let p=Pu(c,a);l.has(p)||l.set(p,[]),l.get(p).push(c)}let u=Array.from(l.entries());return u.sort(([c],[p])=>c<p?-1:c>p?1:0),u.flatMap(([,c])=>xu(c,t.args.pagination))}return xu(s,t.args.pagination)}default:$(t,`Unexpected node type: ${t.type}`)}}#a(t,r,n){return On({query:t,queryable:r,execute:n,tracingHelper:this.#n,onQuery:this.#t})}};function yu(e){return Array.isArray(e)?e.length===0:e==null}function Ar(e){return Array.isArray(e)?e:[e]}function wu(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function Un(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Expected object, got ${typeof e}`)}function vu(e,t){return Array.isArray(e)?e.map(r=>vu(r,t)):typeof e=="object"&&e!==null?e[t]??null:e}function Eu(e,t){for(let{joinExpr:r,childRecords:n}of t)e[r.parentField]=lg(n,e,r);return e}function lg(e,t,r){if(Array.isArray(e)){let n=e.filter(i=>bu(Un(i),t,r));return r.isRelationUnique?n.length>0?n[0]:null:n}else{if(e===null)return null;{let n=Un(e);return bu(n,t,r)?n:null}}}function bu(e,t,r){for(let[n,i]of r.on)if(t[n]!==e[i])return!1;return!0}function xu(e,{cursor:t,skip:r,take:n}){let i=t!==null?e.findIndex(a=>hr(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 Pu(e,t){return JSON.stringify(t.map(r=>e[r]))}async function ug(){return globalThis.crypto??await import("node:crypto")}async function Tu(){return(await ug()).randomUUID()}var pe=class extends ve{name="TransactionManagerError";constructor(t,r){super("Transaction API error: "+t,"P2028",r)}},Cr=class extends pe{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.")}},jn=class extends pe{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction.`)}},Bn=class extends pe{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back.`)}},Qn=class extends pe{constructor(){super("Unable to start a transaction in the given time.")}},Hn=class extends pe{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})}},_t=class extends pe{constructor(t){super(`Internal Consistency Error: ${t}`)}},Gn=class extends pe{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var cg=100,Sr=V("prisma:client:transactionManager"),pg=()=>({sql:"COMMIT",args:[],argTypes:[]}),dg=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),mg=()=>({sql:'-- Implicit "COMMIT" query via underlying driver',args:[],argTypes:[]}),fg=()=>({sql:'-- Implicit "ROLLBACK" query via underlying driver',args:[],argTypes:[]}),Rr=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;#e;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n,onQuery:i}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n,this.#e=i}async startTransaction(t){return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(t))}async#r(t){let r=t!==void 0?this.validateOptions(t):this.transactionOptions,n={id:await Tu(),status:"waiting",timer:void 0,timeout:r.timeout,startedAt:Date.now(),transaction:void 0};this.transactions.set(n.id,n),n.timer=this.startTransactionTimeout(n.id,r.maxWait);let i=await this.driverAdapter.startTransaction(r.isolationLevel);switch(n.status){case"waiting":return n.transaction=i,clearTimeout(n.timer),n.timer=void 0,n.status="running",n.timer=this.startTransactionTimeout(n.id,r.timeout),{id:n.id};case"timed_out":throw new Qn;case"running":case"committed":case"rolled_back":throw new _t(`Transaction in invalid state ${n.status} although it just finished startup.`);default:$(n.status,"Unknown transaction status.")}}async commitTransaction(t){return await this.tracingHelper.runInChildSpan("commit_transaction",async()=>{let r=this.getActiveTransaction(t,"commit");await this.closeTransaction(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.getActiveTransaction(t,"rollback");await this.closeTransaction(r,"rolled_back")})}getTransaction(t,r){let n=this.getActiveTransaction(t.id,r);if(!n.transaction)throw new Cr;return n.transaction}getActiveTransaction(t,r){let n=this.transactions.get(t);if(!n){let i=this.closedTransactions.find(o=>o.id===t);if(i)switch(Sr("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"waiting":case"running":throw new _t("Active transaction found in closed transactions list.");case"committed":throw new jn(r);case"rolled_back":throw new Bn(r);case"timed_out":throw new Hn(r,{timeout:i.timeout,timeTaken:Date.now()-i.startedAt})}else throw Sr("Transaction not found.",t),new Cr}if(["committed","rolled_back","timed_out"].includes(n.status))throw new _t("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.closeTransaction(t,"rolled_back")))}startTransactionTimeout(t,r){let n=Date.now();return setTimeout(async()=>{Sr("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let i=this.transactions.get(t);i&&["running","waiting"].includes(i.status)?await this.closeTransaction(i,"timed_out"):Sr("Transaction already committed or rolled back when timeout happened.",t)},r)}async closeTransaction(t,r){if(Sr("Closing transaction.",{transactionId:t.id,status:r}),t.status=r,t.transaction&&r==="committed")if(t.transaction.options.usePhantomQuery)await this.#t(mg(),t.transaction,()=>t.transaction.commit());else{await t.transaction.commit();let n=pg();await this.#t(n,t.transaction,()=>t.transaction.executeRaw(n))}else if(t.transaction)if(t.transaction.options.usePhantomQuery)await this.#t(fg(),t.transaction,()=>t.transaction.rollback());else{await t.transaction.rollback();let n=dg();await this.#t(n,t.transaction,()=>t.transaction.executeRaw(n))}clearTimeout(t.timer),t.timer=void 0,this.transactions.delete(t.id),this.closedTransactions.push(t),this.closedTransactions.length>cg&&this.closedTransactions.shift()}validateOptions(t){if(!t.timeout)throw new pe("timeout is required");if(!t.maxWait)throw new pe("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new Gn(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}#t(t,r,n){return On({query:t,queryable:r,execute:n,tracingHelper:this.tracingHelper,onQuery:this.#e})}};var Wn="6.9.0-dev.22";var To,Au={async loadQueryCompiler(e){let{clientVersion:t,adapter:r,compilerWasm:n}=e;if(r===void 0)throw new k(`The \`adapter\` option for \`PrismaClient\` is required in this context (${kn().prettyName})`,t);if(n===void 0)throw new k("WASM query compiler was unexpectedly `undefined`",t);return To===void 0&&(To=(async()=>{let i=await n.getRuntime(),o=await n.getQueryCompilerWasmModule();if(o==null)throw new k("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})()),await To}};var Cu="P2038",Jn=V("prisma:client:clientEngine"),Ru=globalThis;Ru.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new re(e,Wn)}};var Nt=class{name="ClientEngine";queryCompiler;instantiateQueryCompilerPromise;QueryCompilerConstructor;queryCompilerLoader;adapterPromise;transactionManagerPromise;config;provider;datamodel;logEmitter;logQueries;logLevel;lastStartedQuery;tracingHelper;#e;constructor(t,r){if(!t.previewFeatures?.includes("driverAdapters"))throw new k("EngineType `client` requires the driverAdapters preview feature to be enabled.",t.clientVersion,Cu);if(t.adapter)this.adapterPromise=t.adapter.connect(),this.provider=t.adapter.provider,Jn("Using driver adapter: %O",t.adapter);else throw new k("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,Cu);this.queryCompilerLoader=r??Au,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.#e=n=>{this.logEmitter.emit("query",{...n,params:Hi(n.params),target:"ClientEngine"})}),this.transactionManagerPromise=this.adapterPromise.then(n=>new Rr({driverAdapter:n,transactionOptions:{...this.config.transactionOptions,isolationLevel:this.#i(this.config.transactionOptions.isolationLevel)},tracingHelper:this.tracingHelper,onQuery:this.#e})),this.instantiateQueryCompilerPromise=this.instantiateQueryCompiler()}applyPendingMigrations(){throw new Error("Cannot call applyPendingMigrations on engine type client.")}async instantiateQueryCompiler(){if(!this.queryCompiler){this.QueryCompilerConstructor||(this.QueryCompilerConstructor=await this.queryCompilerLoader.loadQueryCompiler(this.config));try{this.#n(()=>{this.queryCompiler=new this.QueryCompilerConstructor({datamodel:this.datamodel,provider:this.provider,connectionInfo:{}})})}catch(t){throw this.#r(t)}}}#r(t){if(t instanceof re)return t;try{let r=JSON.parse(t.message);return new k(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#t(t){if(t instanceof k)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new re(Su(this,t.message),this.config.clientVersion);if(t instanceof ve)return new B(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let r=JSON.parse(t);return new Z(`${r.message}
72
+ ${r.backtrace}`,{clientVersion:this.config.clientVersion})}catch{return t}}#o(t){return t instanceof re?t:typeof t.message=="string"&&typeof t.code=="string"?new B(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion}):t}#n(t){let r=Ru.PRISMA_WASM_PANIC_REGISTRY.set_message,n;global.PRISMA_WASM_PANIC_REGISTRY.set_message=i=>{n=i};try{return t()}finally{if(global.PRISMA_WASM_PANIC_REGISTRY.set_message=r,n)throw new re(Su(this,n),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.tracingHelper.runInChildSpan("connect",()=>this.ensureStarted())}async stop(){await this.tracingHelper.runInChildSpan("disconnect",async()=>{await this.instantiateQueryCompilerPromise,await(await this.transactionManagerPromise)?.cancelAllTransactions(),await(await this.adapterPromise).dispose()})}async ensureStarted(){let t=await this.adapterPromise,r=await this.transactionManagerPromise;return await this.instantiateQueryCompilerPromise,[t,r]}version(){return"unknown"}async transaction(t,r,n){let i,o=await this.transactionManagerPromise;try{if(t==="start"){let s=n;i=await o.startTransaction({...s,isolationLevel:this.#i(s.isolationLevel)})}else if(t==="commit"){let s=n;await o.commitTransaction(s.id)}else if(t==="rollback"){let s=n;await o.rollbackTransaction(s.id)}else me(t,"Invalid transaction action.")}catch(s){throw this.#t(s)}return i?{id:i.id,payload:void 0}:void 0}async request(t,{traceparent:r,interactiveTransaction:n}){Jn("sending request");let i=JSON.stringify(t);this.lastStartedQuery=i;let[o,s]=await this.ensureStarted().catch(l=>{throw this.#t(l)}),a;try{a=this.#n(()=>this.queryCompiler.compile(i))}catch(l){throw this.#o(l)}try{let l=JSON.parse(a);Jn("query plan created",a);let u=n?s.getTransaction(n,"query"):o,c=n?{enabled:!1}:{enabled:!0,manager:s},p={},m=await Dt.forSql({transactionManager:c,placeholderValues:p,onQuery:this.#e,tracingHelper:this.tracingHelper}).run(l,u);return Jn("query plan executed"),{data:{[t.action]:m}}}catch(l){throw this.#t(l)}}async requestBatch(t,{transaction:r,traceparent:n}){if(t.length===0)return[];let i=t[0].action,o=JSON.stringify(Ct(t,r));this.lastStartedQuery=o;let[,s]=await this.ensureStarted().catch(l=>{throw this.#t(l)}),a;try{a=this.queryCompiler.compileBatch(o)}catch(l){throw this.#o(l)}try{let l;if(r?.kind==="itx")l=r.options;else{let m=r?.options.isolationLevel?{...this.config.transactionOptions,isolationLevel:r.options.isolationLevel}:this.config.transactionOptions;l=await this.transaction("start",{},m)}let u={},c=Dt.forSql({transactionManager:{enabled:!1},placeholderValues:u,onQuery:this.#e,tracingHelper:this.tracingHelper}),p=s.getTransaction(l,"batch query"),d=[];switch(a.type){case"multi":{d=await Promise.all(a.plans.map((m,g)=>c.run(m,p).then(h=>({data:{[t[g].action]:h}}),h=>h)));break}case"compacted":{if(!t.every(g=>g.action===i))throw new Error("All queries in a batch must have the same action");let m=await c.run(a.plan,p);d=this.#s(m,a,i);break}}return r?.kind!=="itx"&&await this.transaction("commit",{},l),d}catch(l){throw this.#t(l)}}metrics(t){throw new Error("Method not implemented.")}#s(t,r,n){let i=t.map(s=>r.keys.reduce((a,l)=>(a[l]=s[l],a),{})),o=new Set(r.nestedSelection);return r.arguments.map(s=>{let a=i.findIndex(l=>hr(l,s));if(a===-1)return r.expectNonEmpty?new B("An operation failed because it depends on one or more records that were required but not found",{code:"P2025",clientVersion:this.config.clientVersion}):{data:{[n]:null}};{let l=Object.entries(t[a]).filter(([u])=>o.has(u));return{data:{[n]:Object.fromEntries(l)}}}})}#i(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 B(`Inconsistent column data: Conversion failed: Invalid isolation level \`${t}\``,{code:"P2023",clientVersion:this.config.clientVersion,meta:{providedIsolationLevel:t}})}}};function Su(e,t){return nl({binaryTarget:void 0,title:t,version:e.config.clientVersion,engineVersion:"unknown",database:e.config.activeProvider,query:e.lastStartedQuery})}function Mt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new k(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new k("error: Missing URL environment variable, value, or override.",n);return i}var Kn=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 le=class extends Kn{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function S(e,t){return{...e,isRetryable:t}}var Ft=class extends le{name="ForcedRetryError";code="P5001";constructor(t){super("This request must be retried",S(t,!0))}};x(Ft,"ForcedRetryError");var tt=class extends le{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,S(r,!1))}};x(tt,"InvalidDatasourceError");var rt=class extends le{name="NotImplementedYetError";code="P5004";constructor(t,r){super(t,S(r,!1))}};x(rt,"NotImplementedYetError");var F=class extends le{response;constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var nt=class extends F{name="SchemaMissingError";code="P5005";constructor(t){super("Schema needs to be uploaded",S(t,!0))}};x(nt,"SchemaMissingError");var Ao="This request could not be understood by the server",Ir=class extends F{name="BadRequestError";code="P5000";constructor(t,r,n){super(r||Ao,S(t,!1)),n&&(this.code=n)}};x(Ir,"BadRequestError");var kr=class extends F{name="HealthcheckTimeoutError";code="P5013";logs;constructor(t,r){super("Engine not started: healthcheck timeout",S(t,!0)),this.logs=r}};x(kr,"HealthcheckTimeoutError");var Or=class extends F{name="EngineStartupError";code="P5014";logs;constructor(t,r,n){super(r,S(t,!0)),this.logs=n}};x(Or,"EngineStartupError");var Dr=class extends F{name="EngineVersionNotSupportedError";code="P5012";constructor(t){super("Engine version is not supported",S(t,!1))}};x(Dr,"EngineVersionNotSupportedError");var Co="Request timed out",_r=class extends F{name="GatewayTimeoutError";code="P5009";constructor(t,r=Co){super(r,S(t,!1))}};x(_r,"GatewayTimeoutError");var hg="Interactive transaction error",Nr=class extends F{name="InteractiveTransactionError";code="P5015";constructor(t,r=hg){super(r,S(t,!1))}};x(Nr,"InteractiveTransactionError");var yg="Request parameters are invalid",Mr=class extends F{name="InvalidRequestError";code="P5011";constructor(t,r=yg){super(r,S(t,!1))}};x(Mr,"InvalidRequestError");var So="Requested resource does not exist",Fr=class extends F{name="NotFoundError";code="P5003";constructor(t,r=So){super(r,S(t,!1))}};x(Fr,"NotFoundError");var Ro="Unknown server error",Lt=class extends F{name="ServerError";code="P5006";logs;constructor(t,r,n){super(r||Ro,S(t,!0)),this.logs=n}};x(Lt,"ServerError");var Io="Unauthorized, check your connection string",Lr=class extends F{name="UnauthorizedError";code="P5007";constructor(t,r=Io){super(r,S(t,!1))}};x(Lr,"UnauthorizedError");var ko="Usage exceeded, retry again later",$r=class extends F{name="UsageExceededError";code="P5008";constructor(t,r=ko){super(r,S(t,!0))}};x($r,"UsageExceededError");async function wg(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Vr(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await wg(e);if(n.type==="QueryEngineError")throw new B(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Lt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new nt(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Dr(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Or(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new k(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new kr(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Nr(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Mr(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Lr(r,$t(Io,n));if(e.status===404)return new Fr(r,$t(So,n));if(e.status===429)throw new $r(r,$t(ko,n));if(e.status===504)throw new _r(r,$t(Co,n));if(e.status>=500)throw new Lt(r,$t(Ro,n));if(e.status>=400)throw new Ir(r,$t(Ao,n))}function $t(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}function Iu(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}var De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function ku(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=t[p]<<16|t[p+1]<<8|t[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,r+=De[s]+De[a]+De[l]+De[u];return i==1?(c=t[o],s=(c&252)>>2,a=(c&3)<<4,r+=De[s]+De[a]+"=="):i==2&&(c=t[o]<<8|t[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,r+=De[s]+De[a]+De[l]+"="),r}function Ou(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new k("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function Eg(e){return e[0]*1e3+e[1]/1e6}function Oo(e){return new Date(Eg(e))}var Du={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var qr=class extends le{name="RequestError";code="P5010";constructor(t,r){super(`Cannot fetch data from service:
73
+ ${t}`,S(r,!0))}};x(qr,"RequestError");async function it(e,t,r=n=>n){let{clientVersion:n,...i}=t,o=r(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new qr(a,{clientVersion:n,cause:s})}}var xg=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,_u=V("prisma:client:dataproxyEngine");async function Pg(e,t){let r=Du["@prisma/engines-version"],n=t.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION||globalThis.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION||globalThis.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&xg.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){let[s]=r.split("-")??[],[a,l,u]=s.split("."),c=vg(`<=${a}.${l}.${u}`),p=await it(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||"<empty body>"}`);let d=await p.text();_u("length of body fetched from unpkg.com",d.length);let m;try{m=JSON.parse(d)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),g}return m.version}throw new rt("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Nu(e,t){let r=await Pg(e,t);return _u("version",r),r}function vg(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Mu=3,Ur=V("prisma:client:dataproxyEngine"),Do=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,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},jr=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;protocol;constructor(t){Ou(t),this.config=t,this.env={...t.env,...typeof process<"u"?process.env:{}},this.inlineSchema=ku(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let{apiKey:t,url:r}=this.getURLAndAPIKey();this.host=r.host,this.headerBuilder=new Do({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.protocol=ci(r)?"http":"https",this.remoteClientVersion=await Nu(this.host,this.config),Ur("host",this.host),Ur("protocol",this.protocol)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"trace":Ur(r);break;case"error":case"warn":case"info":{this.logEmitter.emit(r.level,{timestamp:Oo(r.timestamp),message:r.attributes.message??"",target:r.target});break}case"query":{this.logEmitter.emit("query",{query:r.attributes.query??"",timestamp:Oo(r.timestamp),duration:r.attributes.duration_ms??0,params:r.attributes.params??"",target:r.target});break}default:r.level}}),t?.traces?.length&&this.tracingHelper.dispatchEngineSpans(t.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`${this.protocol}://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await it(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Ur("schema response status",r.status);let n=await Vr(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Ct(t,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await it(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Ur("graphql response status",a.status),await this.handleError(await Vr(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await it(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Vr(l,this.clientVersion));let u=await l.json(),{extensions:c}=u;c&&this.propagateResponseExtensions(c);let p=u.id,d=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:d}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await it(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Vr(a,this.clientVersion));let l=await a.json(),{extensions:u}=l;u&&this.propagateResponseExtensions(u);return}}})}getURLAndAPIKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=Mt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new tt(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,searchParams:s}=i;if(o!=="prisma:"&&o!==Gr)throw new tt(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\` or \`prisma+postgres://\``,t);let a=s.get("api_key");if(a===null||a.length<1)throw new tt(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return{apiKey:a,url:i}}metrics(){throw new rt("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof le)||!i.isRetryable)throw i;if(r>=Mu)throw i instanceof Ft?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${Mu} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await Iu(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof nt)throw await this.uploadSchema(),new Ft({clientVersion:this.clientVersion,cause:t});if(t)throw t}convertProtocolErrorsToClientError(t){return t.length===1?Sn(t[0],this.config.clientVersion,this.config.activeProvider):new Z(JSON.stringify(t),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Fu({copyEngine:e=!0},t){let r;try{r=Mt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||Wr(r));e&&n&&Yt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=lt(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary",u=i==="client";if(o&&s||s&&!1){let c;throw e?r?.startsWith("prisma://")?c=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:c=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:c=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new X(c.join(`
74
+ `),{clientVersion:t.clientVersion})}return o?new jr(t):u?new Nt(t):new Nt(t)}function zn({generator:e}){return e?.previewFeatures??[]}var Lu=e=>({command:e});var $u=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);function Vt(e){try{return Vu(e,"fast")}catch{return Vu(e,"slow")}}function Vu(e,t){return JSON.stringify(e.map(r=>Uu(r,t)))}function Uu(e,t){if(Array.isArray(e))return e.map(r=>Uu(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(ft(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(H.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(Tg(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"?ju(e):e}function Tg(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function ju(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(qu);let t={};for(let r of Object.keys(e))t[r]=qu(e[r]);return t}function qu(e){return typeof e=="bigint"?e.toString():ju(e)}var Ag=/^(\s*alter\s)/i,Bu=V("prisma:client");function _o(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Ag.exec(t))throw new Error(`Running ALTER using ${n} is not supported
75
75
  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.
76
76
 
77
77
  Example:
78
78
  await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
79
79
 
80
80
  More Information: https://pris.ly/d/execute-raw
81
- `)}var Oo=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(vn(r))n=r.sql,i={values:$t(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:$t(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:$t(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:$t(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Mu(r),i={values:$t(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?qu(`prisma.${e}(${n}, ${i.values})`):qu(`prisma.${e}(${n})`),{query:n,parameters:i}},ju={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Uu={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Do(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Bu(r(s)):Bu(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 Bu(e){return typeof e.then=="function"?e:Promise.resolve(e)}var Eg=si.split(".")[0],xg={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},_o=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${Eg}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??xg}};function Qu(){return new _o}function Hu(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function Gu(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 Kn=class{_middlewares=[];use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};var Ju=q(ci());function zn(e){return typeof e.batchRequestIdx=="number"}function Wu(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(No(e.query.arguments)),t.push(No(e.query.selection)),t.join("")}function No(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${No(n)})`:r}).join(" ")})`}var bg={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 Mo(e){return bg[e]}var Yn=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"}};function it(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 Q(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=>it("bigint",r));case"bytes-array":return t.map(r=>it("bytes",r));case"decimal-array":return t.map(r=>it("decimal",r));case"datetime-array":return t.map(r=>it("datetime",r));case"date-array":return t.map(r=>it("date",r));case"time-array":return t.map(r=>it("time",r));default:return t}}function Zn(e){let t=[],r=Pg(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]]=it(e.types[s],i[s]);t.push(o)}return t}function Pg(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var vg=L("prisma:client:request_handler"),Xn=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new Yn({batchLoader:Ba(async({requests:n,customDataProxyFetch:i})=>{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>Mo(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Tg(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(m){return m}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ku(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Mo(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Wu(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(vg(t),Cg(t,i))throw t;if(t instanceof U&&Ag(t)){let u=zu(t.meta);yn({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=an({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new U(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new te(l,this.client._clientVersion);if(t instanceof Y)throw new Y(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof I)throw new I(l,this.client._clientVersion);if(t instanceof te)throw new te(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Ju.default)(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(u=>u!=="select"&&u!=="include"),a=Li(o,s),l=i==="queryRaw"?Zn(a):dt(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Tg(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ku(e)};de(e,"Unknown transaction kind")}}function Ku(e){return{id:e.id,payload:e.payload}}function Cg(e,t){return zn(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Ag(e){return e.code==="P2009"||e.code==="P2012"}function zu(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(zu)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var Yu=Hn;var rc=q(Ti());var O=class extends Error{constructor(t){super(t+`
82
- Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};b(O,"PrismaClientConstructorValidationError");var Zu=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Xu=["pretty","colorless","minimal"],ec=["info","query","warn","error"],Sg={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new O(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=Vt(r,t)||` Available datasources: ${t.join(", ")}`;throw new O(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new O(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
83
- It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new O(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
84
- It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new O(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor.
85
- It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&at(t.generator)==="client")throw new O('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e===null)return;if(e===void 0)throw new O('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Jn(t).includes("driverAdapters"))throw new O('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(at(t.generator)==="binary")throw new O('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new O(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor.
86
- Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new O(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Xu.includes(e)){let t=Vt(e,Xu);throw new O(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new O(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!ec.includes(r)){let n=Vt(r,ec);throw new O(`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=Vt(i,o);throw new O(`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 O(`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 O(`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 O(`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 O('"omit" option is expected to be an object.');if(e===null)throw new O('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Ig(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(u=>u.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 O(kg(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new O(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Vt(r,t);throw new O(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function nc(e,t){for(let[r,n]of Object.entries(e)){if(!Zu.includes(r)){let i=Vt(r,Zu);throw new O(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Sg[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new O('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Vt(e,t){if(t.length===0||typeof e!="string")return"";let r=Rg(e,t);return r?` Did you mean "${r}"?`:""}function Rg(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,rc.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 Ig(e,t){return tc(t.models,e)??tc(t.types,e)}function tc(e,t){let r=Object.keys(e).find(n=>Fe(n)===t);if(r)return e[r]}function kg(e,t){let r=bt(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}=hn(r,"colorless");return`Error validating "omit" option:
81
+ `)}var No=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Tn(r))n=r.sql,i={values:Vt(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:Vt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:Vt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:Vt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=$u(r),i={values:Vt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Bu(`prisma.${e}(${n}, ${i.values})`):Bu(`prisma.${e}(${n})`),{query:n,parameters:i}},Qu={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new ae(t,r)}},Hu={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Mo(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Gu(r(s)):Gu(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 Gu(e){return typeof e.then=="function"?e:Promise.resolve(e)}var Cg=li.split(".")[0],Sg={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Fo=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${Cg}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??Sg}};function Wu(){return new Fo}function Ju(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function Ku(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 Yn=class{_middlewares=[];use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};var Yu=U(di());function Zn(e){return typeof e.batchRequestIdx=="number"}function zu(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Lo(e.query.arguments)),t.push(Lo(e.query.selection)),t.join("")}function Lo(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Lo(n)})`:r}).join(" ")})`}var Rg={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 $o(e){return Rg[e]}var Xn=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"}};function ot(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 H(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=>ot("bigint",r));case"bytes-array":return t.map(r=>ot("bytes",r));case"decimal-array":return t.map(r=>ot("decimal",r));case"datetime-array":return t.map(r=>ot("datetime",r));case"date-array":return t.map(r=>ot("date",r));case"time-array":return t.map(r=>ot("time",r));default:return t}}function ei(e){let t=[],r=Ig(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]]=ot(e.types[s],i[s]);t.push(o)}return t}function Ig(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var kg=V("prisma:client:request_handler"),ti=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new Xn({batchLoader:Ga(async({requests:n,customDataProxyFetch:i})=>{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>$o(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Og(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(m){return m}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Zu(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:$o(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:zu(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(kg(t),Dg(t,i))throw t;if(t instanceof B&&_g(t)){let u=Xu(t.meta);wn({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=ln({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new B(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new re(l,this.client._clientVersion);if(t instanceof Z)throw new Z(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof k)throw new k(l,this.client._clientVersion);if(t instanceof re)throw new re(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Yu.default)(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(u=>u!=="select"&&u!=="include"),a=Vi(o,s),l=i==="queryRaw"?ei(a):mt(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Og(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Zu(e)};me(e,"Unknown transaction kind")}}function Zu(e){return{id:e.id,payload:e.payload}}function Dg(e,t){return Zn(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function _g(e){return e.code==="P2009"||e.code==="P2012"}function Xu(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Xu)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var ec=Wn;var oc=U(Ci());var D=class extends Error{constructor(t){super(t+`
82
+ Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};x(D,"PrismaClientConstructorValidationError");var tc=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],rc=["pretty","colorless","minimal"],nc=["info","query","warn","error"],Ng={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=qt(r,t)||` Available datasources: ${t.join(", ")}`;throw new D(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
83
+ It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
84
+ It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new D(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor.
85
+ It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&lt(t.generator)==="client")throw new D('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e===null)return;if(e===void 0)throw new D('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!zn(t).includes("driverAdapters"))throw new D('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(lt(t.generator)==="binary")throw new D('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new D(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor.
86
+ Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new D(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!rc.includes(e)){let t=qt(e,rc);throw new D(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!nc.includes(r)){let n=qt(r,nc);throw new D(`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=qt(i,o);throw new D(`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 D(`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 D(`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 D(`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 D('"omit" option is expected to be an object.');if(e===null)throw new D('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Fg(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(u=>u.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 D(Lg(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new D(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=qt(r,t);throw new D(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function sc(e,t){for(let[r,n]of Object.entries(e)){if(!tc.includes(r)){let i=qt(r,tc);throw new D(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Ng[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new D('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function qt(e,t){if(t.length===0||typeof e!="string")return"";let r=Mg(e,t);return r?` Did you mean "${r}"?`:""}function Mg(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,oc.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 Fg(e,t){return ic(t.models,e)??ic(t.types,e)}function ic(e,t){let r=Object.keys(e).find(n=>Le(n)===t);if(r)return e[r]}function Lg(e,t){let r=Pt(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}=yn(r,"colorless");return`Error validating "omit" option:
87
87
 
88
88
  ${i}
89
89
 
90
- ${n}`}function ic(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=u=>{o||(o=!0,r(u))};for(let u=0;u<e.length;u++)e[u].then(c=>{n[u]=c,a()},c=>{if(!zn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var Be=L("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Og={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Dg=Symbol.for("prisma.client.transaction.id"),_g={id:0,nextId(){return++this.id}};function cc(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new Kn;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=Do();constructor(n){e=n?.__internal?.configOverride?.(e)??e,Ja(e),n&&nc(n,e);let i=new lc.EventEmitter().on("error",()=>{});this._extensions=Pt.empty(),this._previewFeatures=Jn(e),this._clientVersion=e.clientVersion??Yu,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Qu();let o=e.relativeEnvPaths&&{rootEnvPath:e.relativeEnvPaths.rootEnvPath&&ei.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&ei.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new I(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new I("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=!s&&o&&Kt(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&L.enable("prisma:client");let p=ei.default.resolve(e.dirname,e.relativePath);uc.default.existsSync(p)||(p=e.dirname),Be("dirname",e.dirname),Be("relativePath",e.relativePath),Be("cwd",p);let d=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:d.allowTriggerPanic,prismaPath:d.binaryPath??void 0,engineEndpoint:d.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Gu(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(m=>typeof m=="string"?m==="query":m.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Ka(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Nt,getBatchRequestPayload:Ct,prismaGraphQLToJSError:An,PrismaClientUnknownRequestError:Y,PrismaClientInitializationError:I,PrismaClientKnownRequestError:U,debug:L("prisma:client:accelerateEngine"),engineVersion:sc.version,clientVersion:e.clientVersion}},Be("clientVersion",e.clientVersion),this._engine=_u(e,this._engineConfig),this._requestHandler=new Xn(this,i),l.log)for(let m of l.log){let g=typeof m=="string"?m:m.emit==="stdout"?m.level:null;g&&this.$on(g,h=>{Gt.log(`${Gt.tags[g]??""}`,h.message||h.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=mr(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$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{Ko()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Oo({clientMethod:i,activeProvider:a}),callsite:$e(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=oc(n,i);return ko(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Z("`$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=>(ko(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Z(`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:Nu,callsite:$e(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:Oo({clientMethod:i,activeProvider:a}),callsite:$e(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",...oc(n,i));throw new Z("`$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 Z("`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=_g.nextId(),s=Hu(n.length),a=n.map((l,u)=>{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 c=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return ic(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 u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return ge(mr(ge(_a(this),[re("_appliedParent",()=>this._appliedParent._createItxClient(n)),re("_createPrismaPromise",()=>Do(n)),re(Dg,()=>n.id)])),[Tt($a)])}$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??Og,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,R=>c(u,T=>(R?.end(),l(T))));let{runInTransaction:p,args:d,...m}=u,g={...n,...m};d&&(g.args=i.middlewareArgsToRequestArgs(d)),n.transaction!==void 0&&p===!1&&delete g.transaction;let h=await Ua(this,g);return g.model?La({result:h,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):h};return this._tracingHelper.runInChildSpan(s.operation,()=>new ac.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:d,customDataProxyFetch:m}){try{n=u?u(n):n;let g={name:"serialize"},h=this._tracingHelper.runInChildSpan(g,()=>bn({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 L.enabled("prisma:client")&&(Be("Prisma Client call:"),Be(`prisma.${i}(${Pa(n)})`),Be("Generated request:"),Be(JSON.stringify(h,null,2)+`
91
- `)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:h,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:d,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:m})}catch(g){throw g.clientVersion=this._clientVersion,g}}$metrics=new vt(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=Na}return t}function oc(e,t){return Ng(e)?[new se(e,t),ju]:[e,Uu]}function Ng(e){return Array.isArray(e)&&Array.isArray(e.raw)}var Mg=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function pc(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Mg.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}function dc(e){Kt(e,{conflictCheck:"warn"})}0&&(module.exports={DMMF,Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce});
90
+ ${n}`}function ac(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=u=>{o||(o=!0,r(u))};for(let u=0;u<e.length;u++)e[u].then(c=>{n[u]=c,a()},c=>{if(!Zn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var Qe=V("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var $g={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Vg=Symbol.for("prisma.client.transaction.id"),qg={id:0,nextId(){return++this.id}};function mc(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new Yn;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=Mo();constructor(n){e=n?.__internal?.configOverride?.(e)??e,Ya(e),n&&sc(n,e);let i=new pc.EventEmitter().on("error",()=>{});this._extensions=vt.empty(),this._previewFeatures=zn(e),this._clientVersion=e.clientVersion??ec,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Wu();let o=e.relativeEnvPaths&&{rootEnvPath:e.relativeEnvPaths.rootEnvPath&&ri.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&ri.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new k(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new k("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=!s&&o&&zt(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&V.enable("prisma:client");let p=ri.default.resolve(e.dirname,e.relativePath);dc.default.existsSync(p)||(p=e.dirname),Qe("dirname",e.dirname),Qe("relativePath",e.relativePath),Qe("cwd",p);let d=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:d.allowTriggerPanic,prismaPath:d.binaryPath??void 0,engineEndpoint:d.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Ku(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(m=>typeof m=="string"?m==="query":m.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Za(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Mt,getBatchRequestPayload:Ct,prismaGraphQLToJSError:Sn,PrismaClientUnknownRequestError:Z,PrismaClientInitializationError:k,PrismaClientKnownRequestError:B,debug:V("prisma:client:accelerateEngine"),engineVersion:uc.version,clientVersion:e.clientVersion}},Qe("clientVersion",e.clientVersion),this._engine=Fu(e,this._engineConfig),this._requestHandler=new ti(this,i),l.log)for(let m of l.log){let g=typeof m=="string"?m:m.emit==="stdout"?m.level:null;g&&this.$on(g,h=>{Wt.log(`${Wt.tags[g]??""}`,h.message||h.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=fr(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$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{Zo()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:No({clientMethod:i,activeProvider:a}),callsite:Ve(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=lc(n,i);return _o(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new X("`$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=>(_o(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new X(`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:Lu,callsite:Ve(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:No({clientMethod:i,activeProvider:a}),callsite:Ve(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",...lc(n,i));throw new X("`$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 X("`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=qg.nextId(),s=Ju(n.length),a=n.map((l,u)=>{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 c=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return ac(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 u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return he(fr(he(Fa(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>Mo(n)),ne(Vg,()=>n.id)])),[At(Ua)])}$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??$g,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,I=>c(u,T=>(I?.end(),l(T))));let{runInTransaction:p,args:d,...m}=u,g={...n,...m};d&&(g.args=i.middlewareArgsToRequestArgs(d)),n.transaction!==void 0&&p===!1&&delete g.transaction;let h=await Ha(this,g);return g.model?qa({result:h,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):h};return this._tracingHelper.runInChildSpan(s.operation,()=>new cc.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:d,customDataProxyFetch:m}){try{n=u?u(n):n;let g={name:"serialize"},h=this._tracingHelper.runInChildSpan(g,()=>Pn({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 V.enabled("prisma:client")&&(Qe("Prisma Client call:"),Qe(`prisma.${i}(${Aa(n)})`),Qe("Generated request:"),Qe(JSON.stringify(h,null,2)+`
91
+ `)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:h,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:d,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:m})}catch(g){throw g.clientVersion=this._clientVersion,g}}$metrics=new Tt(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=La}return t}function lc(e,t){return Ug(e)?[new ae(e,t),Qu]:[e,Hu]}function Ug(e){return Array.isArray(e)&&Array.isArray(e.raw)}var jg=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function fc(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!jg.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}function gc(e){zt(e,{conflictCheck:"warn"})}0&&(module.exports={DMMF,Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce});
92
92
  /*! Bundled license information:
93
93
 
94
94
  @noble/hashes/utils.js: