@prisma/client 6.19.0-integration-next.6 → 6.19.0-integration-feat-remove-binary-engine.1

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,72 +1,40 @@
1
- "use strict";var Ia=Object.create;var It=Object.defineProperty;var Fa=Object.getOwnPropertyDescriptor;var La=Object.getOwnPropertyNames;var Ma=Object.getPrototypeOf,$a=Object.prototype.hasOwnProperty;var Jn=(e,t)=>()=>(e&&(t=e(e=0)),t);var V=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Te=(e,t)=>{for(var r in t)It(e,r,{get:t[r],enumerable:!0})},Kn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of La(t))!$a.call(e,i)&&i!==r&&It(e,i,{get:()=>t[i],enumerable:!(n=Fa(t,i))||n.enumerable});return e};var x=(e,t,r)=>(r=e!=null?Ia(Ma(e)):{},Kn(t||!e||!e.__esModule?It(r,"default",{value:e,enumerable:!0}):r,e)),Na=e=>Kn(It({},"__esModule",{value:!0}),e);var Kr=V((fm,Pi)=>{"use strict";Pi.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var Ci=V((gm,Si)=>{"use strict";var Zl=require("node:os"),Ti=require("node:tty"),Q=Kr(),{env:O}=process,he;Q("no-color")||Q("no-colors")||Q("color=false")||Q("color=never")?he=0:(Q("color")||Q("colors")||Q("color=true")||Q("color=always"))&&(he=1);"FORCE_COLOR"in O&&(O.FORCE_COLOR==="true"?he=1:O.FORCE_COLOR==="false"?he=0:he=O.FORCE_COLOR.length===0?1:Math.min(parseInt(O.FORCE_COLOR,10),3));function Hr(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function zr(e,t){if(he===0)return 0;if(Q("color=16m")||Q("color=full")||Q("color=truecolor"))return 3;if(Q("color=256"))return 2;if(e&&!t&&he===void 0)return 0;let r=he||0;if(O.TERM==="dumb")return r;if(process.platform==="win32"){let n=Zl.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in O)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in O)||O.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in O)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(O.TEAMCITY_VERSION)?1:0;if(O.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in O){let n=parseInt((O.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(O.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(O.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(O.TERM)||"COLORTERM"in O?1:r}function Xl(e){let t=zr(e,e&&e.isTTY);return Hr(t)}Si.exports={supportsColor:Xl,stdout:Hr(zr(!0,Ti.isatty(1))),stderr:Hr(zr(!0,Ti.isatty(2)))}});var Oi=V((ym,Ri)=>{"use strict";var eu=Ci(),$e=Kr();function Ai(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e)||[];return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function Yr(e){let{CI:t,FORCE_HYPERLINK:r,NETLIFY:n,TEAMCITY_VERSION:i,TERM_PROGRAM:o,TERM_PROGRAM_VERSION:s,VTE_VERSION:a,TERM:l}=process.env;if(r)return!(r.length>0&&parseInt(r,10)===0);if($e("no-hyperlink")||$e("no-hyperlinks")||$e("hyperlink=false")||$e("hyperlink=never"))return!1;if($e("hyperlink=true")||$e("hyperlink=always")||n)return!0;if(!eu.supportsColor(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in process.env)return!0;if(process.platform==="win32"||t||i)return!1;if(o){let u=Ai(s||"");switch(o){case"iTerm.app":return u.major===3?u.minor>=1:u.major>3;case"WezTerm":return u.major>=20200620;case"vscode":return u.major>1||u.major===1&&u.minor>=72;case"ghostty":return!0}}if(a){if(a==="0.50.0")return!1;let u=Ai(a);return u.major>0||u.minor>=50}switch(l){case"alacritty":return!0}return!1}Ri.exports={supportsHyperlink:Yr,stdout:Yr(process.stdout),stderr:Yr(process.stderr)}});var ki=V((Om,tu)=>{tu.exports={name:"@prisma/internals",version:"6.19.0-integration-next.6",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":"~20.19.0","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.5.0",empathic:"2.0.0","escape-string-regexp":"5.0.0",execa:"8.0.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","global-directory":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f","@prisma/schema-engine-wasm":"6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.4.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var Di=V((Mm,ou)=>{ou.exports={name:"@prisma/engines-version",version:"6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"34b5a692b7bd79939a9a2c3ef97d816e749cda2f"},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 en=V(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.enginesVersion=void 0;Jt.enginesVersion=Di().prisma.enginesVersion});var Li=V((zm,Fi)=>{"use strict";Fi.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var an=V((Xm,ji)=>{"use strict";ji.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 Bi=V((uf,yu)=>{yu.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 Ji=V((cf,se)=>{"use strict";var mn=require("node:fs"),fn=require("node:path"),hu=require("node:os"),bu=require("node:crypto"),xu=Bi(),Qi=xu.version,wu=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Eu(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
- `);let n;for(;(n=wu.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 vu(e){let t=Gi(e),r=R.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=Wi(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=Tu(r,a);o=R.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return R.parse(o)}function Pu(e){console.log(`[dotenv@${Qi}][WARN] ${e}`)}function ht(e){console.log(`[dotenv@${Qi}][DEBUG] ${e}`)}function Wi(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 Tu(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 Gi(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)mn.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=fn.resolve(process.cwd(),".env.vault");return mn.existsSync(t)?t:null}function Ui(e){return e[0]==="~"?fn.join(hu.homedir(),e.slice(1)):e}function Su(e){!!(e&&e.debug)&&ht("Loading env from encrypted .env.vault");let r=R._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),R.populate(n,r,e),{parsed:r}}function Cu(e){let t=fn.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&ht("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[Ui(e.path)];else{i=[];for(let l of e.path)i.push(Ui(l))}let o,s={};for(let l of i)try{let u=R.parse(mn.readFileSync(l,{encoding:r}));R.populate(s,u,e)}catch(u){n&&ht(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),R.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function Au(e){if(Wi(e).length===0)return R.configDotenv(e);let t=Gi(e);return t?R._configVault(e):(Pu(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),R.configDotenv(e))}function Ru(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=bu.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 Ou(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&&ht(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var R={configDotenv:Cu,_configVault:Su,_parseVault:vu,config:Au,decrypt:Ru,parse:Eu,populate:Ou};se.exports.configDotenv=R.configDotenv;se.exports._configVault=R._configVault;se.exports._parseVault=R._parseVault;se.exports.config=R.config;se.exports.decrypt=R.decrypt;se.exports.parse=R.parse;se.exports.populate=R.populate;se.exports=R});var Yi=V((yf,zt)=>{"use strict";zt.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()};zt.exports.default=zt.exports});var wn=V((fg,oo)=>{"use strict";oo.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,m,f,b,P,j,le,A,T,q=[];for(l=0;l<i;l++)q.push(l+1),q.push(t.charCodeAt(s+l));for(var Ie=q.length-1;a<o-3;)for(j=r.charCodeAt(s+(u=a)),le=r.charCodeAt(s+(c=a+1)),A=r.charCodeAt(s+(p=a+2)),T=r.charCodeAt(s+(m=a+3)),f=a+=4,l=0;l<Ie;l+=2)b=q[l],P=q[l+1],u=e(b,u,c,j,P),c=e(u,c,p,le,P),p=e(c,p,m,A,P),f=e(p,m,f,T,P),q[l]=f,m=p,p=c,c=u,u=b;for(;a<o;)for(j=r.charCodeAt(s+(u=a)),f=++a,l=0;l<Ie;l+=2)b=q[l],q[l]=f=e(b,u,f,j,q[l+1]),u=b;return f}}()});var co=Jn(()=>{"use strict"});var po=Jn(()=>{"use strict"});var nd={};Te(nd,{AnyNull:()=>F.AnyNull,DMMF:()=>wt,DbNull:()=>F.DbNull,Debug:()=>C,Decimal:()=>Oa.Decimal,Extensions:()=>Fr,JsonNull:()=>F.JsonNull,MetricsClient:()=>Ze,NullTypes:()=>F.NullTypes,ObjectEnumValue:()=>F.ObjectEnumValue,PrismaClientInitializationError:()=>h.PrismaClientInitializationError,PrismaClientKnownRequestError:()=>h.PrismaClientKnownRequestError,PrismaClientRustPanicError:()=>h.PrismaClientRustPanicError,PrismaClientUnknownRequestError:()=>h.PrismaClientUnknownRequestError,PrismaClientValidationError:()=>h.PrismaClientValidationError,Public:()=>Lr,Sql:()=>te.Sql,createParam:()=>ko,defineDmmfProperty:()=>$o,deserializeJsonResponse:()=>tt,deserializeRawResult:()=>kr,dmmfToRuntimeDataModel:()=>Xn,empty:()=>te.empty,getPrismaClient:()=>Ca,getRuntime:()=>Ar,isAnyNull:()=>F.isAnyNull,isDbNull:()=>F.isDbNull,isJsonNull:()=>F.isJsonNull,join:()=>te.join,makeStrictEnum:()=>Aa,makeTypedQueryFactory:()=>No,raw:()=>te.raw,serializeJsonQuery:()=>fr,skip:()=>mr,sqltag:()=>te.sql,warnEnvConflicts:()=>Ra,warnOnce:()=>xt});module.exports=Na(nd);var Fr={};Te(Fr,{defineExtension:()=>Hn,getExtensionContext:()=>zn});function Hn(e){return typeof e=="function"?e:t=>t.$extends(e)}function zn(e){return e}var Lr={};Te(Lr,{validator:()=>Yn});function Yn(...e){return t=>t}var J=class{_map=new Map;get(t){return this._map.get(t)?.value}set(t,r){this._map.set(t,{value:r})}getOrCreate(t,r){let n=this._map.get(t);if(n)return n.value;let i=r();return this.set(t,i),i}};function ce(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Zn(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function st(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Xn(e){return{models:Mr(e.models),enums:Mr(e.enums),types:Mr(e.types)}}function Mr(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}var xe=require("@prisma/client-runtime-utils");var Ft={};Te(Ft,{$:()=>ii,bgBlack:()=>Ka,bgBlue:()=>Za,bgCyan:()=>el,bgGreen:()=>za,bgMagenta:()=>Xa,bgRed:()=>Ha,bgWhite:()=>tl,bgYellow:()=>Ya,black:()=>Qa,blue:()=>Se,bold:()=>_,cyan:()=>ie,dim:()=>re,gray:()=>at,green:()=>pe,grey:()=>Ja,hidden:()=>Ba,inverse:()=>Va,italic:()=>qa,magenta:()=>Wa,red:()=>B,reset:()=>ja,strikethrough:()=>Ua,underline:()=>I,white:()=>Ga,yellow:()=>ne});var $r,ei,ti,ri,ni=!0;typeof process<"u"&&({FORCE_COLOR:$r,NODE_DISABLE_COLORS:ei,NO_COLOR:ti,TERM:ri}=process.env||{},ni=process.stdout&&process.stdout.isTTY);var ii={enabled:!ei&&ti==null&&ri!=="dumb"&&($r!=null&&$r!=="0"||ni)};function w(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!ii.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var ja=w(0,0),_=w(1,22),re=w(2,22),qa=w(3,23),I=w(4,24),Va=w(7,27),Ba=w(8,28),Ua=w(9,29),Qa=w(30,39),B=w(31,39),pe=w(32,39),ne=w(33,39),Se=w(34,39),Wa=w(35,39),ie=w(36,39),Ga=w(37,39),at=w(90,39),Ja=w(90,39),Ka=w(40,49),Ha=w(41,49),za=w(42,49),Ya=w(43,49),Za=w(44,49),Xa=w(45,49),el=w(46,49),tl=w(47,49);var rl=100,oi=["green","yellow","blue","magenta","cyan","red"],lt=[],si=Date.now(),nl=0,Nr=typeof process<"u"?process.env:{};globalThis.DEBUG??=Nr.DEBUG??"";globalThis.DEBUG_COLORS??=Nr.DEBUG_COLORS?Nr.DEBUG_COLORS==="true":!0;var ut={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 il(e){let t={color:oi[nl++%oi.length],enabled:ut.enabled(e),namespace:e,log:ut.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&lt.push([o,...n]),lt.length>rl&&lt.shift(),ut.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:ol(c)),u=`+${Date.now()-si}ms`;si=Date.now(),globalThis.DEBUG_COLORS?a(Ft[s](_(o)),...l,Ft[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var C=new Proxy(il,{get:(e,t)=>ut[t],set:(e,t,r)=>ut[t]=r});function ol(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 ai(e=7500){let t=lt.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 li(){lt.length=0}var Fe=C;var ui=x(require("node:fs"));function jr(){let e=process.env.PRISMA_QUERY_ENGINE_LIBRARY;if(!(e&&ui.default.existsSync(e))&&process.arch==="ia32")throw new Error('The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set `engineType = "binary"` in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)')}var qr=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];var Lt="libquery_engine";function Mt(e,t){let r=t==="url";return e.includes("windows")?r?"query_engine.dll.node":`query_engine-${e}.dll.node`:e.includes("darwin")?r?`${Lt}.dylib.node`:`${Lt}-${e}.dylib.node`:r?`${Lt}.so.node`:`${Lt}-${e}.so.node`}var mi=x(require("node:child_process")),Wr=x(require("node:fs/promises")),Vt=x(require("node:os"));var oe=Symbol.for("@ts-pattern/matcher"),sl=Symbol.for("@ts-pattern/isVariadic"),Nt="@ts-pattern/anonymous-select-key",Vr=e=>!!(e&&typeof e=="object"),$t=e=>e&&!!e[oe],z=(e,t,r)=>{if($t(e)){let n=e[oe](),{matched:i,selections:o}=n.match(t);return i&&o&&Object.keys(o).forEach(s=>r(s,o[s])),i}if(Vr(e)){if(!Vr(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];$t(a)&&a[sl]?o.push(a):o.length?i.push(a):n.push(a)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let s=t.slice(0,n.length),a=i.length===0?[]:t.slice(-i.length),l=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((u,c)=>z(u,s[c],r))&&i.every((u,c)=>z(u,a[c],r))&&(o.length===0||z(o[0],l,r))}return e.length===t.length&&e.every((s,a)=>z(s,t[a],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||$t(o=i)&&o[oe]().matcherType==="optional")&&z(i,t[n],r);var o})}return Object.is(t,e)},ye=e=>{var t,r,n;return Vr(e)?$t(e)?(t=(r=(n=e[oe]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?ct(e,ye):ct(Object.values(e),ye):[]},ct=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function U(e){return Object.assign(e,{optional:()=>al(e),and:t=>S(e,t),or:t=>ll(e,t),select:t=>t===void 0?ci(e):ci(t,e)})}function al(e){return U({[oe]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return t===void 0?(ye(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:z(e,t,n),selections:r}},getSelectionKeys:()=>ye(e),matcherType:"optional"})})}function S(...e){return U({[oe]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return{matched:e.every(i=>z(i,t,n)),selections:r}},getSelectionKeys:()=>ct(e,ye),matcherType:"and"})})}function ll(...e){return U({[oe]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return ct(e,ye).forEach(i=>n(i,void 0)),{matched:e.some(i=>z(i,t,n)),selections:r}},getSelectionKeys:()=>ct(e,ye),matcherType:"or"})})}function g(e){return{[oe]:()=>({match:t=>({matched:!!e(t)})})}}function ci(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return U({[oe]:()=>({match:n=>{let i={[t??Nt]:n};return{matched:r===void 0||z(r,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[t??Nt].concat(r===void 0?[]:ye(r))})})}function K(e){return typeof e=="number"}function de(e){return typeof e=="string"}function me(e){return typeof e=="bigint"}var Ld=U(g(function(e){return!0}));var fe=e=>Object.assign(U(e),{startsWith:t=>{return fe(S(e,(r=t,g(n=>de(n)&&n.startsWith(r)))));var r},endsWith:t=>{return fe(S(e,(r=t,g(n=>de(n)&&n.endsWith(r)))));var r},minLength:t=>fe(S(e,(r=>g(n=>de(n)&&n.length>=r))(t))),length:t=>fe(S(e,(r=>g(n=>de(n)&&n.length===r))(t))),maxLength:t=>fe(S(e,(r=>g(n=>de(n)&&n.length<=r))(t))),includes:t=>{return fe(S(e,(r=t,g(n=>de(n)&&n.includes(r)))));var r},regex:t=>{return fe(S(e,(r=t,g(n=>de(n)&&!!n.match(r)))));var r}}),Md=fe(g(de)),H=e=>Object.assign(U(e),{between:(t,r)=>H(S(e,((n,i)=>g(o=>K(o)&&n<=o&&i>=o))(t,r))),lt:t=>H(S(e,(r=>g(n=>K(n)&&n<r))(t))),gt:t=>H(S(e,(r=>g(n=>K(n)&&n>r))(t))),lte:t=>H(S(e,(r=>g(n=>K(n)&&n<=r))(t))),gte:t=>H(S(e,(r=>g(n=>K(n)&&n>=r))(t))),int:()=>H(S(e,g(t=>K(t)&&Number.isInteger(t)))),finite:()=>H(S(e,g(t=>K(t)&&Number.isFinite(t)))),positive:()=>H(S(e,g(t=>K(t)&&t>0))),negative:()=>H(S(e,g(t=>K(t)&&t<0)))}),$d=H(g(K)),ge=e=>Object.assign(U(e),{between:(t,r)=>ge(S(e,((n,i)=>g(o=>me(o)&&n<=o&&i>=o))(t,r))),lt:t=>ge(S(e,(r=>g(n=>me(n)&&n<r))(t))),gt:t=>ge(S(e,(r=>g(n=>me(n)&&n>r))(t))),lte:t=>ge(S(e,(r=>g(n=>me(n)&&n<=r))(t))),gte:t=>ge(S(e,(r=>g(n=>me(n)&&n>=r))(t))),positive:()=>ge(S(e,g(t=>me(t)&&t>0))),negative:()=>ge(S(e,g(t=>me(t)&&t<0)))}),Nd=ge(g(me)),jd=U(g(function(e){return typeof e=="boolean"})),qd=U(g(function(e){return typeof e=="symbol"})),Vd=U(g(function(e){return e==null})),Bd=U(g(function(e){return e!=null}));var Br=class extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}},Ur={matched:!1,value:void 0};function Le(e){return new Qr(e,Ur)}var Qr=class e{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>z(u,this.input,a))||i&&!i(this.input)?Ur:{matched:!0,value:r(o?Nt in s?s[Nt]:s:this.input,this.input)};return new e(this.input,l)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new e(this.input,n?{matched:!0,value:r(this.input,this.input)}:Ur)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Br(this.input)}run(){return this.exhaustive()}returnType(){return this}};var fi=require("node:util");var ul={warn:ne("prisma:warn")},cl={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function jt(e,...t){cl.warn()&&console.warn(`${ul.warn} ${e}`,...t)}var pl=(0,fi.promisify)(mi.default.exec),L=Fe("prisma:get-platform"),dl=["1.0.x","1.1.x","3.0.x"];async function gi(){let e=Vt.default.platform(),t=process.arch;if(e==="freebsd"){let s=await Bt("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:t}}}if(e!=="linux")return{platform:e,arch:t};let r=await fl(),n=await vl(),i=yl({arch:t,archFromUname:n,familyDistro:r.familyDistro}),{libssl:o}=await hl(i);return{platform:"linux",libssl:o,arch:t,archFromUname:n,...r}}function ml(e){let t=/^ID="?([^"\n]*)"?$/im,r=/^ID_LIKE="?([^"\n]*)"?$/im,n=t.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=r.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=Le({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return L(`Found distro info:
5
- ${JSON.stringify(a,null,2)}`),a}async function fl(){let e="/etc/os-release";try{let t=await Wr.default.readFile(e,{encoding:"utf-8"});return ml(t)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function gl(e){let t=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(t){let r=`${t[1]}.x`;return yi(r)}}function pi(e){let t=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(t){let r=`${t[1]}${t[2]??".0"}.x`;return yi(r)}}function yi(e){let t=(()=>{if(bi(e))return e;let r=e.split(".");return r[1]="0",r.join(".")})();if(dl.includes(t))return t}function yl(e){return Le(e).with({familyDistro:"musl"},()=>(L('Trying platform-specific paths for "alpine"'),["/lib","/usr/lib"])).with({familyDistro:"debian"},({archFromUname:t})=>(L('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${t}-linux-gnu`,`/lib/${t}-linux-gnu`])).with({familyDistro:"rhel"},()=>(L('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:t,arch:r,archFromUname:n})=>(L(`Don't know any platform-specific paths for "${t}" on ${r} (${n})`),[]))}async function hl(e){let t='grep -v "libssl.so.0"',r=await di(e);if(r){L(`Found libssl.so file using platform-specific paths: ${r}`);let o=pi(r);if(L(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}L('Falling back to "ldconfig" and other generic paths');let n=await Bt(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${t}`);if(n||(n=await di(["/lib64","/usr/lib64","/lib","/usr/lib"])),n){L(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=pi(n);if(L(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Bt("openssl version -v");if(i){L(`Found openssl binary with version: ${i}`);let o=gl(i);if(L(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return L("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function di(e){for(let t of e){let r=await bl(t);if(r)return r}}async function bl(e){try{return(await Wr.default.readdir(e)).find(r=>r.startsWith("libssl.so.")&&!r.startsWith("libssl.so.0"))}catch(t){if(t.code==="ENOENT")return;throw t}}async function Ce(){let{binaryTarget:e}=await hi();return e}function xl(e){return e.binaryTarget!==void 0}async function Gr(){let{memoized:e,...t}=await hi();return t}var qt={};async function hi(){if(xl(qt))return Promise.resolve({...qt,memoized:!0});let e=await gi(),t=wl(e);return qt={...e,binaryTarget:t},{...qt,memoized:!1}}function wl(e){let{platform:t,arch:r,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;t==="linux"&&!["x64","arm64"].includes(r)&&jt(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${r}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${n}".`);let l="1.1.x";if(t==="linux"&&i===void 0){let c=Le({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");jt(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}".
6
- ${c}`)}let u="debian";if(t==="linux"&&o===void 0&&L(`Distro is "${a}". Falling back to Prisma engines built for "${u}".`),t==="darwin"&&r==="arm64")return"darwin-arm64";if(t==="darwin")return"darwin";if(t==="win32")return"windows";if(t==="freebsd")return o;if(t==="openbsd")return"openbsd";if(t==="netbsd")return"netbsd";if(t==="linux"&&o==="nixos")return"linux-nixos";if(t==="linux"&&r==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(t==="linux"&&r==="arm")return`linux-arm-openssl-${i||l}`;if(t==="linux"&&o==="musl"){let c="linux-musl";return!i||bi(i)?c:`${c}-openssl-${i}`}return t==="linux"&&o&&i?`${o}-openssl-${i}`:(t!=="linux"&&jt(`Prisma detected unknown OS "${t}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function El(e){try{return await e()}catch{return}}function Bt(e){return El(async()=>{let t=await pl(e);return L(`Command "${e}" successfully returned "${t.stdout}"`),t.stdout})}async function vl(){return typeof Vt.default.machine=="function"?Vt.default.machine():(await Bt("uname -m"))?.trim()}function bi(e){return e.startsWith("1.")}var Wt={};Te(Wt,{beep:()=>Kl,clearScreen:()=>Ql,clearTerminal:()=>Wl,cursorBackward:()=>Ol,cursorDown:()=>Al,cursorForward:()=>Rl,cursorGetPosition:()=>_l,cursorHide:()=>Ll,cursorLeft:()=>Ei,cursorMove:()=>Cl,cursorNextLine:()=>Il,cursorPrevLine:()=>Fl,cursorRestorePosition:()=>Dl,cursorSavePosition:()=>kl,cursorShow:()=>Ml,cursorTo:()=>Sl,cursorUp:()=>wi,enterAlternativeScreen:()=>Gl,eraseDown:()=>ql,eraseEndLine:()=>Nl,eraseLine:()=>vi,eraseLines:()=>$l,eraseScreen:()=>Jr,eraseStartLine:()=>jl,eraseUp:()=>Vl,exitAlternativeScreen:()=>Jl,iTerm:()=>Yl,image:()=>zl,link:()=>Hl,scrollDown:()=>Ul,scrollUp:()=>Bl});var Qt=x(require("node:process"),1);var Ut=globalThis.window?.document!==void 0,zd=globalThis.process?.versions?.node!==void 0,Yd=globalThis.process?.versions?.bun!==void 0,Zd=globalThis.Deno?.version?.deno!==void 0,Xd=globalThis.process?.versions?.electron!==void 0,em=globalThis.navigator?.userAgent?.includes("jsdom")===!0,tm=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,rm=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,nm=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,im=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,pt=globalThis.navigator?.userAgentData?.platform,om=pt==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",sm=pt==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",am=pt==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",lm=pt==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),um=pt==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var y="\x1B[",mt="\x1B]",Me="\x07",dt=";",xi=!Ut&&Qt.default.env.TERM_PROGRAM==="Apple_Terminal",Pl=!Ut&&Qt.default.platform==="win32",Tl=Ut?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:Qt.default.cwd,Sl=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?y+(e+1)+"G":y+(t+1)+dt+(e+1)+"H"},Cl=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=y+-e+"D":e>0&&(r+=y+e+"C"),t<0?r+=y+-t+"A":t>0&&(r+=y+t+"B"),r},wi=(e=1)=>y+e+"A",Al=(e=1)=>y+e+"B",Rl=(e=1)=>y+e+"C",Ol=(e=1)=>y+e+"D",Ei=y+"G",kl=xi?"\x1B7":y+"s",Dl=xi?"\x1B8":y+"u",_l=y+"6n",Il=y+"E",Fl=y+"F",Ll=y+"?25l",Ml=y+"?25h",$l=e=>{let t="";for(let r=0;r<e;r++)t+=vi+(r<e-1?wi():"");return e&&(t+=Ei),t},Nl=y+"K",jl=y+"1K",vi=y+"2K",ql=y+"J",Vl=y+"1J",Jr=y+"2J",Bl=y+"S",Ul=y+"T",Ql="\x1Bc",Wl=Pl?`${Jr}${y}0f`:`${Jr}${y}3J${y}H`,Gl=y+"?1049h",Jl=y+"?1049l",Kl=Me,Hl=(e,t)=>[mt,"8",dt,dt,t,Me,e,mt,"8",dt,dt,Me].join(""),zl=(e,t={})=>{let r=`${mt}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+Buffer.from(e).toString("base64")+Me},Yl={setCwd:(e=Tl())=>`${mt}50;CurrentDir=${e}${Me}`,annotation(e,t={}){let r=`${mt}1337;`,n=t.x!==void 0,i=t.y!==void 0;if((n||i)&&!(n&&i&&t.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replaceAll("|",""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(n?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+Me}};var Gt=x(Oi(),1);function Ae(e,t,{target:r="stdout",...n}={}){return Gt.default[r]?Wt.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`}Ae.isSupported=Gt.default.stdout;Ae.stderr=(e,t,r={})=>Ae(e,t,{target:"stderr",...r});Ae.stderr.isSupported=Gt.default.stderr;function Zr(e){return Ae(e,e,{fallback:I})}var ru=ki(),Xr=ru.version;function Ne(e){let t=nu();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":iu())}function nu(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function iu(){return"library"}var su=x(en());var E=x(require("node:path")),au=x(en()),Vm=C("prisma:engines");function _i(){return E.default.join(__dirname,"../")}var Bm="libquery-engine";E.default.join(__dirname,"../query-engine-darwin");E.default.join(__dirname,"../query-engine-darwin-arm64");E.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");E.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");E.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");E.default.join(__dirname,"../query-engine-linux-static-x64");E.default.join(__dirname,"../query-engine-linux-static-arm64");E.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");E.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");E.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");E.default.join(__dirname,"../libquery_engine-darwin.dylib.node");E.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");E.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");E.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");E.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");E.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");E.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");E.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");E.default.join(__dirname,"../libquery_engine-linux-musl.so.node");E.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");E.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");E.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");E.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");E.default.join(__dirname,"../query_engine-windows.dll.node");var tn=x(require("node:fs")),Ii=Fe("chmodPlusX");function rn(e){if(process.platform==="win32")return;let t=tn.default.statSync(e),r=t.mode|64|8|1;if(t.mode===r){Ii(`Execution permissions of ${e} are fine`);return}let n=r.toString(8).slice(-3);Ii(`Have to call chmodPlusX on ${e}`),tn.default.chmodSync(e,n)}function nn(e){let t=e.e,r=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=t.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${Zr("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${re(e.id)}\`).`,s=Le({message:t.message,code:t.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${r("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${r("libgcc_s")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libssl"),()=>{let a=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${r("libssl")}. Please install ${a} and try again.`}).when(({message:a})=>a.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${i}`).when(({message:a})=>e.platformInfo.platform==="linux"&&a.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${i}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${i}`);return`${o}
1
+ "use strict";var ka=Object.create;var _t=Object.defineProperty;var Da=Object.getOwnPropertyDescriptor;var _a=Object.getOwnPropertyNames;var Fa=Object.getPrototypeOf,Ia=Object.prototype.hasOwnProperty;var Qn=(e,t)=>()=>(e&&(t=e(e=0)),t);var V=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Te=(e,t)=>{for(var r in t)_t(e,r,{get:t[r],enumerable:!0})},Gn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _a(t))!Ia.call(e,i)&&i!==r&&_t(e,i,{get:()=>t[i],enumerable:!(n=Da(t,i))||n.enumerable});return e};var x=(e,t,r)=>(r=e!=null?ka(Fa(e)):{},Gn(t||!e||!e.__esModule?_t(r,"default",{value:e,enumerable:!0}):r,e)),La=e=>Gn(_t({},"__esModule",{value:!0}),e);var Kr=V((pm,Ei)=>{"use strict";Ei.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var Ti=V((dm,Pi)=>{"use strict";var Hl=require("node:os"),vi=require("node:tty"),W=Kr(),{env:O}=process,he;W("no-color")||W("no-colors")||W("color=false")||W("color=never")?he=0:(W("color")||W("colors")||W("color=true")||W("color=always"))&&(he=1);"FORCE_COLOR"in O&&(O.FORCE_COLOR==="true"?he=1:O.FORCE_COLOR==="false"?he=0:he=O.FORCE_COLOR.length===0?1:Math.min(parseInt(O.FORCE_COLOR,10),3));function Hr(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function zr(e,t){if(he===0)return 0;if(W("color=16m")||W("color=full")||W("color=truecolor"))return 3;if(W("color=256"))return 2;if(e&&!t&&he===void 0)return 0;let r=he||0;if(O.TERM==="dumb")return r;if(process.platform==="win32"){let n=Hl.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in O)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in O)||O.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in O)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(O.TEAMCITY_VERSION)?1:0;if(O.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in O){let n=parseInt((O.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(O.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(O.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(O.TERM)||"COLORTERM"in O?1:r}function zl(e){let t=zr(e,e&&e.isTTY);return Hr(t)}Pi.exports={supportsColor:zl,stdout:Hr(zr(!0,vi.isatty(1))),stderr:Hr(zr(!0,vi.isatty(2)))}});var Ai=V((mm,Ci)=>{"use strict";var Yl=Ti(),Me=Kr();function Si(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e)||[];return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function Yr(e){let{CI:t,FORCE_HYPERLINK:r,NETLIFY:n,TEAMCITY_VERSION:i,TERM_PROGRAM:o,TERM_PROGRAM_VERSION:s,VTE_VERSION:a,TERM:l}=process.env;if(r)return!(r.length>0&&parseInt(r,10)===0);if(Me("no-hyperlink")||Me("no-hyperlinks")||Me("hyperlink=false")||Me("hyperlink=never"))return!1;if(Me("hyperlink=true")||Me("hyperlink=always")||n)return!0;if(!Yl.supportsColor(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in process.env)return!0;if(process.platform==="win32"||t||i)return!1;if(o){let u=Si(s||"");switch(o){case"iTerm.app":return u.major===3?u.minor>=1:u.major>3;case"WezTerm":return u.major>=20200620;case"vscode":return u.major>1||u.major===1&&u.minor>=72;case"ghostty":return!0}}if(a){if(a==="0.50.0")return!1;let u=Si(a);return u.major>0||u.minor>=50}switch(l){case"alacritty":return!0}return!1}Ci.exports={supportsHyperlink:Yr,stdout:Yr(process.stdout),stderr:Yr(process.stderr)}});var Ri=V((Cm,Zl)=>{Zl.exports={name:"@prisma/internals",version:"6.19.0-integration-feat-remove-binary-engine.1",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":"~20.19.0","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.5.0",empathic:"2.0.0","escape-string-regexp":"5.0.0",execa:"8.0.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","global-directory":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f","@prisma/schema-engine-wasm":"6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.4.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var Oi=V((_m,eu)=>{eu.exports={name:"@prisma/engines-version",version:"6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"34b5a692b7bd79939a9a2c3ef97d816e749cda2f"},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 en=V(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.enginesVersion=void 0;Jt.enginesVersion=Oi().prisma.enginesVersion});var _i=V((Um,Di)=>{"use strict";Di.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var on=V((Jm,Mi)=>{"use strict";Mi.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 ji=V((rf,mu)=>{mu.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 Wi=V((nf,se)=>{"use strict";var pn=require("node:fs"),dn=require("node:path"),fu=require("node:os"),gu=require("node:crypto"),yu=ji(),Vi=yu.version,hu=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function bu(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
+ `);let n;for(;(n=hu.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 xu(e){let t=Ui(e),r=R.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=Bi(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=Eu(r,a);o=R.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return R.parse(o)}function wu(e){console.log(`[dotenv@${Vi}][WARN] ${e}`)}function yt(e){console.log(`[dotenv@${Vi}][DEBUG] ${e}`)}function Bi(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 Eu(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 Ui(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)pn.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=dn.resolve(process.cwd(),".env.vault");return pn.existsSync(t)?t:null}function qi(e){return e[0]==="~"?dn.join(fu.homedir(),e.slice(1)):e}function vu(e){!!(e&&e.debug)&&yt("Loading env from encrypted .env.vault");let r=R._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),R.populate(n,r,e),{parsed:r}}function Pu(e){let t=dn.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&yt("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[qi(e.path)];else{i=[];for(let l of e.path)i.push(qi(l))}let o,s={};for(let l of i)try{let u=R.parse(pn.readFileSync(l,{encoding:r}));R.populate(s,u,e)}catch(u){n&&yt(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),R.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function Tu(e){if(Bi(e).length===0)return R.configDotenv(e);let t=Ui(e);return t?R._configVault(e):(wu(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),R.configDotenv(e))}function Su(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=gu.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 Cu(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&&yt(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var R={configDotenv:Pu,_configVault:vu,_parseVault:xu,config:Tu,decrypt:Su,parse:bu,populate:Cu};se.exports.configDotenv=R.configDotenv;se.exports._configVault=R._configVault;se.exports._parseVault=R._parseVault;se.exports.config=R.config;se.exports.decrypt=R.decrypt;se.exports.parse=R.parse;se.exports.populate=R.populate;se.exports=R});var Ki=V((cf,zt)=>{"use strict";zt.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()};zt.exports.default=zt.exports});var bn=V((ag,ro)=>{"use strict";ro.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,m,f,b,v,j,le,A,P,q=[];for(l=0;l<i;l++)q.push(l+1),q.push(t.charCodeAt(s+l));for(var Fe=q.length-1;a<o-3;)for(j=r.charCodeAt(s+(u=a)),le=r.charCodeAt(s+(c=a+1)),A=r.charCodeAt(s+(p=a+2)),P=r.charCodeAt(s+(m=a+3)),f=a+=4,l=0;l<Fe;l+=2)b=q[l],v=q[l+1],u=e(b,u,c,j,v),c=e(u,c,p,le,v),p=e(c,p,m,A,v),f=e(p,m,f,P,v),q[l]=f,m=p,p=c,c=u,u=b;for(;a<o;)for(j=r.charCodeAt(s+(u=a)),f=++a,l=0;l<Fe;l+=2)b=q[l],q[l]=f=e(b,u,f,j,q[l+1]),u=b;return f}}()});var ao=Qn(()=>{"use strict"});var lo=Qn(()=>{"use strict"});var ed={};Te(ed,{AnyNull:()=>I.AnyNull,DMMF:()=>xt,DbNull:()=>I.DbNull,Debug:()=>C,Decimal:()=>Ca.Decimal,Extensions:()=>Ir,JsonNull:()=>I.JsonNull,MetricsClient:()=>ze,NullTypes:()=>I.NullTypes,ObjectEnumValue:()=>I.ObjectEnumValue,PrismaClientInitializationError:()=>h.PrismaClientInitializationError,PrismaClientKnownRequestError:()=>h.PrismaClientKnownRequestError,PrismaClientRustPanicError:()=>h.PrismaClientRustPanicError,PrismaClientUnknownRequestError:()=>h.PrismaClientUnknownRequestError,PrismaClientValidationError:()=>h.PrismaClientValidationError,Public:()=>Lr,Sql:()=>te.Sql,createParam:()=>Ao,defineDmmfProperty:()=>Io,deserializeJsonResponse:()=>Xe,deserializeRawResult:()=>kr,dmmfToRuntimeDataModel:()=>Yn,empty:()=>te.empty,getPrismaClient:()=>Pa,getRuntime:()=>Pr,isAnyNull:()=>I.isAnyNull,isDbNull:()=>I.isDbNull,isJsonNull:()=>I.isJsonNull,join:()=>te.join,makeStrictEnum:()=>Ta,makeTypedQueryFactory:()=>Lo,raw:()=>te.raw,serializeJsonQuery:()=>fr,skip:()=>mr,sqltag:()=>te.sql,warnEnvConflicts:()=>Sa,warnOnce:()=>bt});module.exports=La(ed);var Ir={};Te(Ir,{defineExtension:()=>Jn,getExtensionContext:()=>Kn});function Jn(e){return typeof e=="function"?e:t=>t.$extends(e)}function Kn(e){return e}var Lr={};Te(Lr,{validator:()=>Hn});function Hn(...e){return t=>t}var J=class{_map=new Map;get(t){return this._map.get(t)?.value}set(t,r){this._map.set(t,{value:r})}getOrCreate(t,r){let n=this._map.get(t);if(n)return n.value;let i=r();return this.set(t,i),i}};function ce(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function zn(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function it(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Yn(e){return{models:Mr(e.models),enums:Mr(e.enums),types:Mr(e.types)}}function Mr(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}var xe=require("@prisma/client-runtime-utils");var Ft={};Te(Ft,{$:()=>ri,bgBlack:()=>Qa,bgBlue:()=>Ha,bgCyan:()=>Ya,bgGreen:()=>Ja,bgMagenta:()=>za,bgRed:()=>Ga,bgWhite:()=>Za,bgYellow:()=>Ka,black:()=>Va,blue:()=>Se,bold:()=>_,cyan:()=>ie,dim:()=>re,gray:()=>ot,green:()=>pe,grey:()=>Wa,hidden:()=>ja,inverse:()=>Na,italic:()=>$a,magenta:()=>Ba,red:()=>B,reset:()=>Ma,strikethrough:()=>qa,underline:()=>F,white:()=>Ua,yellow:()=>ne});var $r,Zn,Xn,ei,ti=!0;typeof process<"u"&&({FORCE_COLOR:$r,NODE_DISABLE_COLORS:Zn,NO_COLOR:Xn,TERM:ei}=process.env||{},ti=process.stdout&&process.stdout.isTTY);var ri={enabled:!Zn&&Xn==null&&ei!=="dumb"&&($r!=null&&$r!=="0"||ti)};function w(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!ri.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Ma=w(0,0),_=w(1,22),re=w(2,22),$a=w(3,23),F=w(4,24),Na=w(7,27),ja=w(8,28),qa=w(9,29),Va=w(30,39),B=w(31,39),pe=w(32,39),ne=w(33,39),Se=w(34,39),Ba=w(35,39),ie=w(36,39),Ua=w(37,39),ot=w(90,39),Wa=w(90,39),Qa=w(40,49),Ga=w(41,49),Ja=w(42,49),Ka=w(43,49),Ha=w(44,49),za=w(45,49),Ya=w(46,49),Za=w(47,49);var Xa=100,ni=["green","yellow","blue","magenta","cyan","red"],st=[],ii=Date.now(),el=0,Nr=typeof process<"u"?process.env:{};globalThis.DEBUG??=Nr.DEBUG??"";globalThis.DEBUG_COLORS??=Nr.DEBUG_COLORS?Nr.DEBUG_COLORS==="true":!0;var at={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 tl(e){let t={color:ni[el++%ni.length],enabled:at.enabled(e),namespace:e,log:at.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&st.push([o,...n]),st.length>Xa&&st.shift(),at.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:rl(c)),u=`+${Date.now()-ii}ms`;ii=Date.now(),globalThis.DEBUG_COLORS?a(Ft[s](_(o)),...l,Ft[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var C=new Proxy(tl,{get:(e,t)=>at[t],set:(e,t,r)=>at[t]=r});function rl(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 oi(e=7500){let t=st.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 si(){st.length=0}var It=C;var ai=x(require("node:fs"));function jr(){let e=process.env.PRISMA_QUERY_ENGINE_LIBRARY;if(!(e&&ai.default.existsSync(e))&&process.arch==="ia32")throw new Error('The default query engine type (Node-API, "library") is currently not supported for 32bit Node.)')}var qr=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];var Lt="libquery_engine";function Mt(e,t){let r=t==="url";return e.includes("windows")?r?"query_engine.dll.node":`query_engine-${e}.dll.node`:e.includes("darwin")?r?`${Lt}.dylib.node`:`${Lt}-${e}.dylib.node`:r?`${Lt}.so.node`:`${Lt}-${e}.so.node`}var pi=x(require("node:child_process")),Qr=x(require("node:fs/promises")),Vt=x(require("node:os"));var oe=Symbol.for("@ts-pattern/matcher"),nl=Symbol.for("@ts-pattern/isVariadic"),Nt="@ts-pattern/anonymous-select-key",Vr=e=>!!(e&&typeof e=="object"),$t=e=>e&&!!e[oe],z=(e,t,r)=>{if($t(e)){let n=e[oe](),{matched:i,selections:o}=n.match(t);return i&&o&&Object.keys(o).forEach(s=>r(s,o[s])),i}if(Vr(e)){if(!Vr(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];$t(a)&&a[nl]?o.push(a):o.length?i.push(a):n.push(a)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let s=t.slice(0,n.length),a=i.length===0?[]:t.slice(-i.length),l=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((u,c)=>z(u,s[c],r))&&i.every((u,c)=>z(u,a[c],r))&&(o.length===0||z(o[0],l,r))}return e.length===t.length&&e.every((s,a)=>z(s,t[a],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||$t(o=i)&&o[oe]().matcherType==="optional")&&z(i,t[n],r);var o})}return Object.is(t,e)},ye=e=>{var t,r,n;return Vr(e)?$t(e)?(t=(r=(n=e[oe]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?lt(e,ye):lt(Object.values(e),ye):[]},lt=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function U(e){return Object.assign(e,{optional:()=>il(e),and:t=>S(e,t),or:t=>ol(e,t),select:t=>t===void 0?li(e):li(t,e)})}function il(e){return U({[oe]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return t===void 0?(ye(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:z(e,t,n),selections:r}},getSelectionKeys:()=>ye(e),matcherType:"optional"})})}function S(...e){return U({[oe]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return{matched:e.every(i=>z(i,t,n)),selections:r}},getSelectionKeys:()=>lt(e,ye),matcherType:"and"})})}function ol(...e){return U({[oe]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return lt(e,ye).forEach(i=>n(i,void 0)),{matched:e.some(i=>z(i,t,n)),selections:r}},getSelectionKeys:()=>lt(e,ye),matcherType:"or"})})}function g(e){return{[oe]:()=>({match:t=>({matched:!!e(t)})})}}function li(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return U({[oe]:()=>({match:n=>{let i={[t??Nt]:n};return{matched:r===void 0||z(r,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[t??Nt].concat(r===void 0?[]:ye(r))})})}function K(e){return typeof e=="number"}function de(e){return typeof e=="string"}function me(e){return typeof e=="bigint"}var _d=U(g(function(e){return!0}));var fe=e=>Object.assign(U(e),{startsWith:t=>{return fe(S(e,(r=t,g(n=>de(n)&&n.startsWith(r)))));var r},endsWith:t=>{return fe(S(e,(r=t,g(n=>de(n)&&n.endsWith(r)))));var r},minLength:t=>fe(S(e,(r=>g(n=>de(n)&&n.length>=r))(t))),length:t=>fe(S(e,(r=>g(n=>de(n)&&n.length===r))(t))),maxLength:t=>fe(S(e,(r=>g(n=>de(n)&&n.length<=r))(t))),includes:t=>{return fe(S(e,(r=t,g(n=>de(n)&&n.includes(r)))));var r},regex:t=>{return fe(S(e,(r=t,g(n=>de(n)&&!!n.match(r)))));var r}}),Fd=fe(g(de)),H=e=>Object.assign(U(e),{between:(t,r)=>H(S(e,((n,i)=>g(o=>K(o)&&n<=o&&i>=o))(t,r))),lt:t=>H(S(e,(r=>g(n=>K(n)&&n<r))(t))),gt:t=>H(S(e,(r=>g(n=>K(n)&&n>r))(t))),lte:t=>H(S(e,(r=>g(n=>K(n)&&n<=r))(t))),gte:t=>H(S(e,(r=>g(n=>K(n)&&n>=r))(t))),int:()=>H(S(e,g(t=>K(t)&&Number.isInteger(t)))),finite:()=>H(S(e,g(t=>K(t)&&Number.isFinite(t)))),positive:()=>H(S(e,g(t=>K(t)&&t>0))),negative:()=>H(S(e,g(t=>K(t)&&t<0)))}),Id=H(g(K)),ge=e=>Object.assign(U(e),{between:(t,r)=>ge(S(e,((n,i)=>g(o=>me(o)&&n<=o&&i>=o))(t,r))),lt:t=>ge(S(e,(r=>g(n=>me(n)&&n<r))(t))),gt:t=>ge(S(e,(r=>g(n=>me(n)&&n>r))(t))),lte:t=>ge(S(e,(r=>g(n=>me(n)&&n<=r))(t))),gte:t=>ge(S(e,(r=>g(n=>me(n)&&n>=r))(t))),positive:()=>ge(S(e,g(t=>me(t)&&t>0))),negative:()=>ge(S(e,g(t=>me(t)&&t<0)))}),Ld=ge(g(me)),Md=U(g(function(e){return typeof e=="boolean"})),$d=U(g(function(e){return typeof e=="symbol"})),Nd=U(g(function(e){return e==null})),jd=U(g(function(e){return e!=null}));var Br=class extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}},Ur={matched:!1,value:void 0};function Ie(e){return new Wr(e,Ur)}var Wr=class e{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>z(u,this.input,a))||i&&!i(this.input)?Ur:{matched:!0,value:r(o?Nt in s?s[Nt]:s:this.input,this.input)};return new e(this.input,l)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new e(this.input,n?{matched:!0,value:r(this.input,this.input)}:Ur)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Br(this.input)}run(){return this.exhaustive()}returnType(){return this}};var di=require("node:util");var sl={warn:ne("prisma:warn")},al={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function jt(e,...t){al.warn()&&console.warn(`${sl.warn} ${e}`,...t)}var ll=(0,di.promisify)(pi.default.exec),L=It("prisma:get-platform"),ul=["1.0.x","1.1.x","3.0.x"];async function mi(){let e=Vt.default.platform(),t=process.arch;if(e==="freebsd"){let s=await Bt("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:t}}}if(e!=="linux")return{platform:e,arch:t};let r=await pl(),n=await xl(),i=ml({arch:t,archFromUname:n,familyDistro:r.familyDistro}),{libssl:o}=await fl(i);return{platform:"linux",libssl:o,arch:t,archFromUname:n,...r}}function cl(e){let t=/^ID="?([^"\n]*)"?$/im,r=/^ID_LIKE="?([^"\n]*)"?$/im,n=t.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=r.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=Ie({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return L(`Found distro info:
5
+ ${JSON.stringify(a,null,2)}`),a}async function pl(){let e="/etc/os-release";try{let t=await Qr.default.readFile(e,{encoding:"utf-8"});return cl(t)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function dl(e){let t=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(t){let r=`${t[1]}.x`;return fi(r)}}function ui(e){let t=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(t){let r=`${t[1]}${t[2]??".0"}.x`;return fi(r)}}function fi(e){let t=(()=>{if(yi(e))return e;let r=e.split(".");return r[1]="0",r.join(".")})();if(ul.includes(t))return t}function ml(e){return Ie(e).with({familyDistro:"musl"},()=>(L('Trying platform-specific paths for "alpine"'),["/lib","/usr/lib"])).with({familyDistro:"debian"},({archFromUname:t})=>(L('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${t}-linux-gnu`,`/lib/${t}-linux-gnu`])).with({familyDistro:"rhel"},()=>(L('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:t,arch:r,archFromUname:n})=>(L(`Don't know any platform-specific paths for "${t}" on ${r} (${n})`),[]))}async function fl(e){let t='grep -v "libssl.so.0"',r=await ci(e);if(r){L(`Found libssl.so file using platform-specific paths: ${r}`);let o=ui(r);if(L(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}L('Falling back to "ldconfig" and other generic paths');let n=await Bt(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${t}`);if(n||(n=await ci(["/lib64","/usr/lib64","/lib","/usr/lib"])),n){L(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=ui(n);if(L(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Bt("openssl version -v");if(i){L(`Found openssl binary with version: ${i}`);let o=dl(i);if(L(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return L("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function ci(e){for(let t of e){let r=await gl(t);if(r)return r}}async function gl(e){try{return(await Qr.default.readdir(e)).find(r=>r.startsWith("libssl.so.")&&!r.startsWith("libssl.so.0"))}catch(t){if(t.code==="ENOENT")return;throw t}}async function Ce(){let{binaryTarget:e}=await gi();return e}function yl(e){return e.binaryTarget!==void 0}async function Gr(){let{memoized:e,...t}=await gi();return t}var qt={};async function gi(){if(yl(qt))return Promise.resolve({...qt,memoized:!0});let e=await mi(),t=hl(e);return qt={...e,binaryTarget:t},{...qt,memoized:!1}}function hl(e){let{platform:t,arch:r,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;t==="linux"&&!["x64","arm64"].includes(r)&&jt(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${r}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${n}".`);let l="1.1.x";if(t==="linux"&&i===void 0){let c=Ie({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");jt(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}".
6
+ ${c}`)}let u="debian";if(t==="linux"&&o===void 0&&L(`Distro is "${a}". Falling back to Prisma engines built for "${u}".`),t==="darwin"&&r==="arm64")return"darwin-arm64";if(t==="darwin")return"darwin";if(t==="win32")return"windows";if(t==="freebsd")return o;if(t==="openbsd")return"openbsd";if(t==="netbsd")return"netbsd";if(t==="linux"&&o==="nixos")return"linux-nixos";if(t==="linux"&&r==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(t==="linux"&&r==="arm")return`linux-arm-openssl-${i||l}`;if(t==="linux"&&o==="musl"){let c="linux-musl";return!i||yi(i)?c:`${c}-openssl-${i}`}return t==="linux"&&o&&i?`${o}-openssl-${i}`:(t!=="linux"&&jt(`Prisma detected unknown OS "${t}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function bl(e){try{return await e()}catch{return}}function Bt(e){return bl(async()=>{let t=await ll(e);return L(`Command "${e}" successfully returned "${t.stdout}"`),t.stdout})}async function xl(){return typeof Vt.default.machine=="function"?Vt.default.machine():(await Bt("uname -m"))?.trim()}function yi(e){return e.startsWith("1.")}var Qt={};Te(Qt,{beep:()=>Ql,clearScreen:()=>Vl,clearTerminal:()=>Bl,cursorBackward:()=>Cl,cursorDown:()=>Tl,cursorForward:()=>Sl,cursorGetPosition:()=>Ol,cursorHide:()=>_l,cursorLeft:()=>xi,cursorMove:()=>Pl,cursorNextLine:()=>kl,cursorPrevLine:()=>Dl,cursorRestorePosition:()=>Rl,cursorSavePosition:()=>Al,cursorShow:()=>Fl,cursorTo:()=>vl,cursorUp:()=>bi,enterAlternativeScreen:()=>Ul,eraseDown:()=>$l,eraseEndLine:()=>Ll,eraseLine:()=>wi,eraseLines:()=>Il,eraseScreen:()=>Jr,eraseStartLine:()=>Ml,eraseUp:()=>Nl,exitAlternativeScreen:()=>Wl,iTerm:()=>Kl,image:()=>Jl,link:()=>Gl,scrollDown:()=>ql,scrollUp:()=>jl});var Wt=x(require("node:process"),1);var Ut=globalThis.window?.document!==void 0,Jd=globalThis.process?.versions?.node!==void 0,Kd=globalThis.process?.versions?.bun!==void 0,Hd=globalThis.Deno?.version?.deno!==void 0,zd=globalThis.process?.versions?.electron!==void 0,Yd=globalThis.navigator?.userAgent?.includes("jsdom")===!0,Zd=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,Xd=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,em=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,tm=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,ut=globalThis.navigator?.userAgentData?.platform,rm=ut==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",nm=ut==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",im=ut==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",om=ut==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),sm=ut==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var y="\x1B[",pt="\x1B]",Le="\x07",ct=";",hi=!Ut&&Wt.default.env.TERM_PROGRAM==="Apple_Terminal",wl=!Ut&&Wt.default.platform==="win32",El=Ut?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:Wt.default.cwd,vl=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?y+(e+1)+"G":y+(t+1)+ct+(e+1)+"H"},Pl=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=y+-e+"D":e>0&&(r+=y+e+"C"),t<0?r+=y+-t+"A":t>0&&(r+=y+t+"B"),r},bi=(e=1)=>y+e+"A",Tl=(e=1)=>y+e+"B",Sl=(e=1)=>y+e+"C",Cl=(e=1)=>y+e+"D",xi=y+"G",Al=hi?"\x1B7":y+"s",Rl=hi?"\x1B8":y+"u",Ol=y+"6n",kl=y+"E",Dl=y+"F",_l=y+"?25l",Fl=y+"?25h",Il=e=>{let t="";for(let r=0;r<e;r++)t+=wi+(r<e-1?bi():"");return e&&(t+=xi),t},Ll=y+"K",Ml=y+"1K",wi=y+"2K",$l=y+"J",Nl=y+"1J",Jr=y+"2J",jl=y+"S",ql=y+"T",Vl="\x1Bc",Bl=wl?`${Jr}${y}0f`:`${Jr}${y}3J${y}H`,Ul=y+"?1049h",Wl=y+"?1049l",Ql=Le,Gl=(e,t)=>[pt,"8",ct,ct,t,Le,e,pt,"8",ct,ct,Le].join(""),Jl=(e,t={})=>{let r=`${pt}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+Buffer.from(e).toString("base64")+Le},Kl={setCwd:(e=El())=>`${pt}50;CurrentDir=${e}${Le}`,annotation(e,t={}){let r=`${pt}1337;`,n=t.x!==void 0,i=t.y!==void 0;if((n||i)&&!(n&&i&&t.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replaceAll("|",""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(n?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+Le}};var Gt=x(Ai(),1);function Ae(e,t,{target:r="stdout",...n}={}){return Gt.default[r]?Qt.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`}Ae.isSupported=Gt.default.stdout;Ae.stderr=(e,t,r={})=>Ae(e,t,{target:"stderr",...r});Ae.stderr.isSupported=Gt.default.stderr;function Zr(e){return Ae(e,e,{fallback:F})}var Xl=Ri(),Xr=Xl.version;var tu=x(en());var E=x(require("node:path")),ru=x(en()),$m=C("prisma:engines");function ki(){return E.default.join(__dirname,"../")}E.default.join(__dirname,"../query-engine-darwin");E.default.join(__dirname,"../query-engine-darwin-arm64");E.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");E.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");E.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");E.default.join(__dirname,"../query-engine-linux-static-x64");E.default.join(__dirname,"../query-engine-linux-static-arm64");E.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");E.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");E.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");E.default.join(__dirname,"../libquery_engine-darwin.dylib.node");E.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");E.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");E.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");E.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");E.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");E.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");E.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");E.default.join(__dirname,"../libquery_engine-linux-musl.so.node");E.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");E.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");E.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");E.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");E.default.join(__dirname,"../query_engine-windows.dll.node");function tn(e){let t=e.e,r=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=t.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${Zr("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${re(e.id)}\`).`,s=Ie({message:t.message,code:t.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${r("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${r("libgcc_s")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libssl"),()=>{let a=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${r("libssl")}. Please install ${a} and try again.`}).when(({message:a})=>a.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${i}`).when(({message:a})=>e.platformInfo.platform==="linux"&&a.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${i}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${i}`);return`${o}
7
7
  ${s}
8
8
 
9
- Details: ${t.message}`}var Mi=x(Li(),1);function on(e){let t=(0,Mi.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var $i="prisma+postgres",Ni=`${$i}:`;function sn(e){return e?.toString().startsWith(`${Ni}//`)??!1}var qi=x(an());function un(e){return String(new ln(e))}var ln=class{constructor(t){this.config=t}toString(){let{config:t}=this,r=t.provider.fromEnvVar?`env("${t.provider.fromEnvVar}")`:t.provider.value,n=JSON.parse(JSON.stringify({provider:r,binaryTargets:lu(t.binaryTargets)}));return`generator ${t.name} {
10
- ${(0,qi.default)(uu(n),2)}
11
- }`}};function lu(e){let t;if(e.length>0){let r=e.find(n=>n.fromEnvVar!==null);r?t=`env("${r.fromEnvVar}")`:t=e.map(n=>n.native?"native":n.value)}else t=void 0;return t}function uu(e){let t=Object.keys(e).reduce((r,n)=>Math.max(r,n.length),0);return Object.entries(e).map(([r,n])=>`${r.padEnd(t)} = ${cu(n)}`).join(`
12
- `)}function cu(e){return JSON.parse(JSON.stringify(e,(t,r)=>Array.isArray(r)?`[${r.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(r)))}var gt={};Te(gt,{error:()=>mu,info:()=>du,log:()=>pu,query:()=>fu,should:()=>Vi,tags:()=>ft,warn:()=>cn});var ft={error:B("prisma:error"),warn:ne("prisma:warn"),info:ie("prisma:info"),query:Se("prisma:query")},Vi={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function pu(...e){console.log(...e)}function cn(e,...t){Vi.warn()&&console.warn(`${ft.warn} ${e}`,...t)}function du(e,...t){console.info(`${ft.info} ${e}`,...t)}function mu(e,...t){console.error(`${ft.error} ${e}`,...t)}function fu(e,...t){console.log(`${ft.query} ${e}`,...t)}function Kt(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function Re(e,t){throw new Error(t)}function pn({onlyFirst:e=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}var gu=pn();function je(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(gu,"")}var yt=x(require("node:path"));function dn(e){return yt.default.sep===yt.default.posix.sep?e:e.split(yt.default.sep).join(yt.default.posix.sep)}var yn=x(Ji()),Ht=x(require("node:fs"));var qe=x(require("node:path"));function Ki(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 gn=Fe("prisma:tryLoadEnv");function bt({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=Hi(e);r.conflictCheck!=="none"&&ku(n,t,r.conflictCheck);let i=null;return zi(n?.path,t)||(i=Hi(t)),!n&&!i&&gn("No Environment variables loaded"),i?.dotenvResult.error?console.error(B(_("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
13
- `),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function ku(e,t,r){let n=e?.dotenvResult.parsed,i=!zi(e?.path,t);if(n&&t&&i&&Ht.default.existsSync(t)){let o=yn.default.parse(Ht.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=qe.default.relative(process.cwd(),e.path),l=qe.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${I(a)} and ${I(l)}
9
+ Details: ${t.message}`}var Fi=x(_i(),1);function rn(e){let t=(0,Fi.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}function dt(e){let t=nu();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="client"?"client":iu())}function nu(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="client"?"client":void 0}function iu(){return"library"}var Ii="prisma+postgres",Li=`${Ii}:`;function nn(e){return e?.toString().startsWith(`${Li}//`)??!1}var $i=x(on());function an(e){return String(new sn(e))}var sn=class{constructor(t){this.config=t}toString(){let{config:t}=this,r=t.provider.fromEnvVar?`env("${t.provider.fromEnvVar}")`:t.provider.value,n=JSON.parse(JSON.stringify({provider:r,binaryTargets:ou(t.binaryTargets)}));return`generator ${t.name} {
10
+ ${(0,$i.default)(su(n),2)}
11
+ }`}};function ou(e){let t;if(e.length>0){let r=e.find(n=>n.fromEnvVar!==null);r?t=`env("${r.fromEnvVar}")`:t=e.map(n=>n.native?"native":n.value)}else t=void 0;return t}function su(e){let t=Object.keys(e).reduce((r,n)=>Math.max(r,n.length),0);return Object.entries(e).map(([r,n])=>`${r.padEnd(t)} = ${au(n)}`).join(`
12
+ `)}function au(e){return JSON.parse(JSON.stringify(e,(t,r)=>Array.isArray(r)?`[${r.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(r)))}var ft={};Te(ft,{error:()=>cu,info:()=>uu,log:()=>lu,query:()=>pu,should:()=>Ni,tags:()=>mt,warn:()=>ln});var mt={error:B("prisma:error"),warn:ne("prisma:warn"),info:ie("prisma:info"),query:Se("prisma:query")},Ni={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function lu(...e){console.log(...e)}function ln(e,...t){Ni.warn()&&console.warn(`${mt.warn} ${e}`,...t)}function uu(e,...t){console.info(`${mt.info} ${e}`,...t)}function cu(e,...t){console.error(`${mt.error} ${e}`,...t)}function pu(e,...t){console.log(`${mt.query} ${e}`,...t)}function Kt(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function Re(e,t){throw new Error(t)}function un({onlyFirst:e=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}var du=un();function $e(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(du,"")}var gt=x(require("node:path"));function cn(e){return gt.default.sep===gt.default.posix.sep?e:e.split(gt.default.sep).join(gt.default.posix.sep)}var fn=x(Wi()),Ht=x(require("node:fs"));var Ne=x(require("node:path"));function Qi(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 mn=It("prisma:tryLoadEnv");function ht({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=Gi(e);r.conflictCheck!=="none"&&Au(n,t,r.conflictCheck);let i=null;return Ji(n?.path,t)||(i=Gi(t)),!n&&!i&&mn("No Environment variables loaded"),i?.dotenvResult.error?console.error(B(_("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
13
+ `),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function Au(e,t,r){let n=e?.dotenvResult.parsed,i=!Ji(e?.path,t);if(n&&t&&i&&Ht.default.existsSync(t)){let o=fn.default.parse(Ht.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=Ne.default.relative(process.cwd(),e.path),l=Ne.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${F(a)} and ${F(l)}
14
14
  Conflicting env vars:
15
15
  ${s.map(c=>` ${_(c)}`).join(`
16
16
  `)}
17
17
 
18
- We suggest to move the contents of ${I(l)} to ${I(a)} to consolidate your env vars.
19
- `;throw new Error(u)}else if(r==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>_(c)).join(", ")} in ${I(a)} and ${I(l)}
20
- Env vars from ${I(l)} overwrite the ones from ${I(a)}
21
- `;console.warn(`${ne("warn(prisma)")} ${u}`)}}}}function Hi(e){if(Du(e)){gn(`Environment variables loaded from ${e}`);let t=yn.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Ki(t),message:re(`Environment variables loaded from ${qe.default.relative(process.cwd(),e)}`),path:e}}else gn(`Environment variables not found at ${e}`);return null}function zi(e,t){return e&&t&&qe.default.resolve(e)===qe.default.resolve(t)}function Du(e){return!!(e&&Ht.default.existsSync(e))}function hn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Yt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function bn(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 xn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var Zi=new Set,xt=(e,t,...r)=>{Zi.has(e)||(Zi.add(e),cn(t,...r))};function Ve(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Xt(e){return e.toString()!=="Invalid Date"}var Xi=require("@prisma/client-runtime-utils");function Be(e){return Xi.Decimal.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}var To=require("@prisma/client-runtime-utils");var wt={};Te(wt,{ModelAction:()=>Ue,datamodelEnumToSchemaEnum:()=>_u,datamodelSchemaEnumToSchemaEnum:()=>Iu});function _u(e){return{name:e.name,data:e.values.map(t=>({key:t.name,value:t.dbName??t.name}))}}function Iu(e){return{name:e.name,data:e.values.map(t=>({key:t,value:t}))}}var Ue=(T=>(T.findUnique="findUnique",T.findUniqueOrThrow="findUniqueOrThrow",T.findFirst="findFirst",T.findFirstOrThrow="findFirstOrThrow",T.findMany="findMany",T.create="create",T.createMany="createMany",T.createManyAndReturn="createManyAndReturn",T.update="update",T.updateMany="updateMany",T.updateManyAndReturn="updateManyAndReturn",T.upsert="upsert",T.delete="delete",T.deleteMany="deleteMany",T.groupBy="groupBy",T.count="count",T.aggregate="aggregate",T.findRaw="findRaw",T.aggregateRaw="aggregateRaw",T))(Ue||{});var io=x(an());var no=x(require("node:fs"));var eo={keyword:ie,entity:ie,value:e=>_(Se(e)),punctuation:Se,directive:ie,function:ie,variable:e=>_(Se(e)),string:e=>_(pe(e)),boolean:ne,number:ie,comment:at};var Fu=e=>e,er={},Lu=0,d={manual:er.Prism&&er.Prism.manual,disableWorkerMessageHandler:er.Prism&&er.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof W){let t=e;return new W(t.type,d.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(d.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:++Lu}),e.__id},clone:function e(t,r){let n,i,o=d.util.type(t);switch(r=r||{},o){case"Object":if(i=d.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=d.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=d.util.clone(d.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||d.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,d.languages.DFS(d.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=d.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=d.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 d.hooks.run("before-tokenize",n),n.tokens=d.tokenize(n.code,n.grammar),d.hooks.run("after-tokenize",n),W.stringify(d.util.encode(n.tokens),n.language)},matchGrammar:function(e,t,r,n,i,o,s){for(let P in r){if(!r.hasOwnProperty(P)||!r[P])continue;if(P==s)return;let j=r[P];j=d.util.type(j)==="Array"?j:[j];for(let le=0;le<j.length;++le){let A=j[le],T=A.inside,q=!!A.lookbehind,Ie=!!A.greedy,Ir=0,ka=A.alias;if(Ie&&!A.pattern.global){let $=A.pattern.toString().match(/[imuy]*$/)[0];A.pattern=RegExp(A.pattern.source,$+"g")}A=A.pattern||A;for(let $=n,ue=i;$<t.length;ue+=t[$].length,++$){let ot=t[$];if(t.length>e.length)return;if(ot instanceof W)continue;if(Ie&&$!=t.length-1){A.lastIndex=ue;var p=A.exec(e);if(!p)break;var c=p.index+(q?p[1].length:0),m=p.index+p[0].length,a=$,l=ue;for(let _a=t.length;a<_a&&(l<m||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++$,ue=l);if(t[$]instanceof W)continue;u=a-$,ot=e.slice(ue,l),p.index-=ue}else{A.lastIndex=0;var p=A.exec(ot),u=1}if(!p){if(o)break;continue}q&&(Ir=p[1]?p[1].length:0);var c=p.index+Ir,p=p[0].slice(Ir),m=c+p.length,f=ot.slice(0,c),b=ot.slice(m);let _t=[$,u];f&&(++$,ue+=f.length,_t.push(f));let Da=new W(P,T?d.tokenize(p,T):p,ka,p,Ie);if(_t.push(Da),b&&_t.push(b),Array.prototype.splice.apply(t,_t),u!=1&&d.matchGrammar(e,t,r,$,ue,!0,P),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 d.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=d.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=d.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:W};d.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:/[{}[\];(),.:]/};d.languages.javascript=d.languages.extend("clike",{"class-name":[d.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}/});d.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;d.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:d.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:d.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:d.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:d.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});d.languages.markup&&d.languages.markup.tag.addInlined("script","javascript");d.languages.js=d.languages.javascript;d.languages.typescript=d.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/});d.languages.ts=d.languages.typescript;function W(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}W.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return W.stringify(r,t)}).join(""):Mu(e.type)(e.content)};function Mu(e){return eo[e]||Fu}function to(e){return $u(e,d.languages.javascript)}function $u(e,t){return d.tokenize(e,t).map(n=>W.stringify(n)).join("")}function ro(e){return on(e)}var tr=class e{firstLineNumber;lines;static read(t){let r;try{r=no.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(`
22
- `);return new e(t,ro(n).split(`
23
- `))}highlight(){let t=to(this.toString());return new e(this.firstLineNumber,t.split(`
18
+ We suggest to move the contents of ${F(l)} to ${F(a)} to consolidate your env vars.
19
+ `;throw new Error(u)}else if(r==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>_(c)).join(", ")} in ${F(a)} and ${F(l)}
20
+ Env vars from ${F(l)} overwrite the ones from ${F(a)}
21
+ `;console.warn(`${ne("warn(prisma)")} ${u}`)}}}}function Gi(e){if(Ru(e)){mn(`Environment variables loaded from ${e}`);let t=fn.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Qi(t),message:re(`Environment variables loaded from ${Ne.default.relative(process.cwd(),e)}`),path:e}}else mn(`Environment variables not found at ${e}`);return null}function Ji(e,t){return e&&t&&Ne.default.resolve(e)===Ne.default.resolve(t)}function Ru(e){return!!(e&&Ht.default.existsSync(e))}function gn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Yt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function yn(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 hn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var Hi=new Set,bt=(e,t,...r)=>{Hi.has(e)||(Hi.add(e),ln(t,...r))};function je(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Xt(e){return e.toString()!=="Invalid Date"}var zi=require("@prisma/client-runtime-utils");function qe(e){return zi.Decimal.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}var Eo=require("@prisma/client-runtime-utils");var xt={};Te(xt,{ModelAction:()=>Ve,datamodelEnumToSchemaEnum:()=>Ou,datamodelSchemaEnumToSchemaEnum:()=>ku});function Ou(e){return{name:e.name,data:e.values.map(t=>({key:t.name,value:t.dbName??t.name}))}}function ku(e){return{name:e.name,data:e.values.map(t=>({key:t,value:t}))}}var Ve=(P=>(P.findUnique="findUnique",P.findUniqueOrThrow="findUniqueOrThrow",P.findFirst="findFirst",P.findFirstOrThrow="findFirstOrThrow",P.findMany="findMany",P.create="create",P.createMany="createMany",P.createManyAndReturn="createManyAndReturn",P.update="update",P.updateMany="updateMany",P.updateManyAndReturn="updateManyAndReturn",P.upsert="upsert",P.delete="delete",P.deleteMany="deleteMany",P.groupBy="groupBy",P.count="count",P.aggregate="aggregate",P.findRaw="findRaw",P.aggregateRaw="aggregateRaw",P))(Ve||{});var to=x(on());var eo=x(require("node:fs"));var Yi={keyword:ie,entity:ie,value:e=>_(Se(e)),punctuation:Se,directive:ie,function:ie,variable:e=>_(Se(e)),string:e=>_(pe(e)),boolean:ne,number:ie,comment:ot};var Du=e=>e,er={},_u=0,d={manual:er.Prism&&er.Prism.manual,disableWorkerMessageHandler:er.Prism&&er.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof Q){let t=e;return new Q(t.type,d.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(d.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:++_u}),e.__id},clone:function e(t,r){let n,i,o=d.util.type(t);switch(r=r||{},o){case"Object":if(i=d.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=d.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=d.util.clone(d.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||d.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,d.languages.DFS(d.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=d.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=d.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 d.hooks.run("before-tokenize",n),n.tokens=d.tokenize(n.code,n.grammar),d.hooks.run("after-tokenize",n),Q.stringify(d.util.encode(n.tokens),n.language)},matchGrammar:function(e,t,r,n,i,o,s){for(let v in r){if(!r.hasOwnProperty(v)||!r[v])continue;if(v==s)return;let j=r[v];j=d.util.type(j)==="Array"?j:[j];for(let le=0;le<j.length;++le){let A=j[le],P=A.inside,q=!!A.lookbehind,Fe=!!A.greedy,Fr=0,Aa=A.alias;if(Fe&&!A.pattern.global){let $=A.pattern.toString().match(/[imuy]*$/)[0];A.pattern=RegExp(A.pattern.source,$+"g")}A=A.pattern||A;for(let $=n,ue=i;$<t.length;ue+=t[$].length,++$){let nt=t[$];if(t.length>e.length)return;if(nt instanceof Q)continue;if(Fe&&$!=t.length-1){A.lastIndex=ue;var p=A.exec(e);if(!p)break;var c=p.index+(q?p[1].length:0),m=p.index+p[0].length,a=$,l=ue;for(let Oa=t.length;a<Oa&&(l<m||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++$,ue=l);if(t[$]instanceof Q)continue;u=a-$,nt=e.slice(ue,l),p.index-=ue}else{A.lastIndex=0;var p=A.exec(nt),u=1}if(!p){if(o)break;continue}q&&(Fr=p[1]?p[1].length:0);var c=p.index+Fr,p=p[0].slice(Fr),m=c+p.length,f=nt.slice(0,c),b=nt.slice(m);let Dt=[$,u];f&&(++$,ue+=f.length,Dt.push(f));let Ra=new Q(v,P?d.tokenize(p,P):p,Aa,p,Fe);if(Dt.push(Ra),b&&Dt.push(b),Array.prototype.splice.apply(t,Dt),u!=1&&d.matchGrammar(e,t,r,$,ue,!0,v),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 d.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=d.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=d.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:Q};d.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:/[{}[\];(),.:]/};d.languages.javascript=d.languages.extend("clike",{"class-name":[d.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}/});d.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;d.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:d.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:d.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:d.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:d.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});d.languages.markup&&d.languages.markup.tag.addInlined("script","javascript");d.languages.js=d.languages.javascript;d.languages.typescript=d.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/});d.languages.ts=d.languages.typescript;function Q(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}Q.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return Q.stringify(r,t)}).join(""):Fu(e.type)(e.content)};function Fu(e){return Yi[e]||Du}function Zi(e){return Iu(e,d.languages.javascript)}function Iu(e,t){return d.tokenize(e,t).map(n=>Q.stringify(n)).join("")}function Xi(e){return rn(e)}var tr=class e{firstLineNumber;lines;static read(t){let r;try{r=eo.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(`
22
+ `);return new e(t,Xi(n).split(`
23
+ `))}highlight(){let t=Zi(this.toString());return new e(this.firstLineNumber,t.split(`
24
24
  `))}toString(){return this.lines.join(`
25
- `)}};var Nu={red:B,gray:at,dim:re,bold:_,underline:I,highlightSource:e=>e.highlight()},ju={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function qu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Vu({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=qu({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=tr.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=Uu(c),m=Bu(c);if(!m)return s;s.functionName=`${m.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,b=>b.slice(0,m.openingBraceIndex))),u=o.highlightSource(u);let f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((b,P)=>o.gray(String(P).padStart(f))+" "+b).mapLines(b=>o.dim(b)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let b=p+f+1;b+=2,s.callArguments=(0,io.default)(i,b).slice(b)}}return s}function Bu(e){let t=Object.keys(Ue).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 Uu(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function Qu({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(Wu(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(`
26
- `)}function Wu(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function rr(e){let t=e.showColors?Nu:ju,r;return r=Vu(e,t),Qu(r,t)}var fo=x(wn());function lo(e,t,r){let n=uo(e),i=Gu(n),o=Ku(i);o?nr(o,t,r):t.addErrorMessage(()=>"Unknown error")}function uo(e){return e.errors.flatMap(t=>t.kind==="Union"?uo(t):[t])}function Gu(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:Ju(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Ju(e,t){return[...new Set(e.concat(t))]}function Ku(e){return bn(e,(t,r)=>{let n=so(t),i=so(r);return n!==i?n-i:ao(t)-ao(r)})}function so(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function ao(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var N=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)}};po();var Qe=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(`
27
- `)}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}};co();var ir=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var or=e=>e,sr={bold:or,red:or,green:or,dim:or,enabled:!1},mo={bold:_,red:B,green:pe,dim:re,enabled:!0},We={write(e){e.writeLine(",")}};var Y=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 be=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var Ge=class extends be{items=[];addItem(t){return this.items.push(new ir(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 Y("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(We,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Je=class e extends be{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 Ge&&(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 Y("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(We,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var k=class extends be{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Y(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var Et=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(We,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function nr(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Hu(e,t);break;case"IncludeOnScalar":zu(e,t);break;case"EmptySelection":Yu(e,t,r);break;case"UnknownSelectionField":tc(e,t);break;case"InvalidSelectionValue":rc(e,t);break;case"UnknownArgument":nc(e,t);break;case"UnknownInputField":ic(e,t);break;case"RequiredArgumentMissing":oc(e,t);break;case"InvalidArgumentType":sc(e,t);break;case"InvalidArgumentValue":ac(e,t);break;case"ValueTooLarge":lc(e,t);break;case"SomeFieldsMissing":uc(e,t);break;case"TooManyFieldsGiven":cc(e,t);break;case"Union":lo(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Hu(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 zu(e,t){let[r,n]=Ke(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 N(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)}. ${vt(s)}`:a+=".",a+=`
28
- Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Yu(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Zu(e,t,i);return}if(n.hasField("select")){Xu(e,t);return}}if(r?.[ce(e.outputType.name)]){ec(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Zu(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new N(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 Xu(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),ho(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${vt(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function ec(e,t){let r=new Et;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new N("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=Ke(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new Je;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 tc(e,t){let r=bo(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":ho(n,e.outputType);break;case"include":pc(n,e.outputType);break;case"omit":dc(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(vt(n)),i.join(" ")})}function rc(e,t){let r=bo(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 nc(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),mc(n,e.arguments)),t.addErrorMessage(i=>go(i,r,e.arguments.map(o=>o.name)))}function ic(e,t){let[r,n]=Ke(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&xo(o,e.inputType)}t.addErrorMessage(o=>go(o,n,e.inputType.fields.map(s=>s.name)))}function go(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=gc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(vt(e)),n.join(" ")}function oc(e,t){let r;t.addErrorMessage(l=>r?.value instanceof k&&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]=Ke(e.argumentPath),s=new Et,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 N(o,s).makeRequired())}else{let l=e.inputTypes.map(yo).join(" | ");a.addSuggestion(new N(o,l).makeRequired())}if(e.dependentArgumentPath){n.getDeepField(e.dependentArgumentPath)?.markAsError();let[,l]=Ke(e.dependentArgumentPath);t.addErrorMessage(u=>`Argument \`${u.green(o)}\` is required because argument \`${u.green(l)}\` was provided.`)}}}function yo(e){return e.kind==="list"?`${yo(e.elementType)}[]`:e.name}function sc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=ar("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 ac(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=ar("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function lc(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 k&&(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 uc(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&&xo(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")} ${ar("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(vt(i)),o.join(" ")})}function cc(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 ${ar("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function ho(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new N(r.name,"true"))}function pc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new N(r.name,"true"))}function dc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new N(r.name,"true"))}function mc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new N(r.name,r.typeNames.join(" | ")))}function bo(e,t){let[r,n]=Ke(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 xo(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new N(r.name,r.typeNames.join(" | ")))}function Ke(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function vt({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function ar(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var fc=3;function gc(e,t){let r=1/0,n;for(let i of t){let o=(0,fo.default)(e,i);o>fc||o<r&&(r=o,n=i)}return n}var Eo=require("@prisma/client-runtime-utils");var Pt=class{modelName;name;typeName;isList;isEnum;constructor(t,r,n,i,o){this.modelName=t,this.name=r,this.typeName=n,this.isList=i,this.isEnum=o}_toGraphQLInputType(){let t=this.isList?"List":"",r=this.isEnum?"Enum":"";return`${t}${r}${this.typeName}FieldRefInput<${this.modelName}>`}};function He(e){return e instanceof Pt}var wo=": ",lr=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+wo.length}write(t){let r=new Y(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(wo).write(this.value)}};var vn=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(`
29
- `)}};function ze(e){return new vn(vo(e))}function vo(e){let t=new Je;for(let[r,n]of Object.entries(e)){let i=new lr(r,Po(n));t.addField(i)}return t}function Po(e){if(typeof e=="string")return new k(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new k(String(e));if(typeof e=="bigint")return new k(`${e}n`);if(e===null)return new k("null");if(e===void 0)return new k("undefined");if(Be(e))return new k(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new k(`Buffer.alloc(${e.byteLength})`):new k(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Xt(e)?e.toISOString():"Invalid Date";return new k(`new Date("${t}")`)}return e instanceof Eo.ObjectEnumValue?new k(`Prisma.${e._getName()}`):He(e)?new k(`prisma.${ce(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?yc(e):typeof e=="object"?vo(e):new k(Object.prototype.toString.call(e))}function yc(e){let t=new Ge;for(let r of e)t.addItem(Po(r));return t}function ur(e,t){let r=t==="pretty"?mo:sr,n=e.renderAllMessages(r),i=new Qe(0,{colors:r}).write(e).toString();return{message:n,args:i}}function cr({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=ze(e);for(let p of t)nr(p,a,s);let{message:l,args:u}=ur(a,r),c=rr({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new To.PrismaClientValidationError(c,{clientVersion:o})}function Z(e){return e.replace(/^./,t=>t.toLowerCase())}function Co(e,t,r){let n=Z(r);return!t.result||!(t.result.$allModels||t.result[n])?e:hc({...e,...So(t.name,e,t.result.$allModels),...So(t.name,e,t.result[n])})}function hc(e){let t=new J,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Yt(e,n=>({...n,needs:r(n.name,new Set)}))}function So(e,t,r){return r?Yt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:bc(t,o,i)})):{}}function bc(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Ao(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function Ro(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 pr=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new J;modelExtensionsCache=new J;queryCallbacksCache=new J;clientExtensions=st(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=st(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Co(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Z(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()}},Ye=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new pr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new pr(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 dr=class{constructor(t){this.name=t}};function Oo(e){return e instanceof dr}function ko(e){return new dr(e)}var Do=Symbol(),Tt=class{constructor(t){if(t!==Do)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?mr:t}},mr=new Tt(Do);function X(e){return e instanceof Tt}var xc={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"},_o="explicitly `undefined` values are not allowed";function fr({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=Ye.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c}){let p=new Pn({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:xc[t],query:St(r,p)}}function St({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:Fo(r,n),selection:wc(e,t,i,n)}}function wc(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()}),Tc(e,n)):Ec(n,t,r)}function Ec(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&vc(n,t,e),Pc(n,r,e),n}function vc(e,t,r){for(let[n,i]of Object.entries(t)){if(X(i))continue;let o=r.nestSelection(n);if(Tn(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]=St(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=St(i,o)}}function Pc(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=Ro(i,n);for(let[s,a]of Object.entries(o)){if(X(a))continue;Tn(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function Tc(e,t){let r={},n=t.getComputedFields(),i=Ao(e,n);for(let[o,s]of Object.entries(i)){if(X(s))continue;let a=t.nestSelection(o);Tn(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||X(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=St({},a):r[o]=!0;continue}r[o]=St(s,a)}}return r}function Io(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(Ve(e)){if(Xt(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(Oo(e))return{$type:"Param",value:e.name};if(He(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return Sc(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(Cc(e))return e.values;if(Be(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof xe.ObjectEnumValue){if(!(0,xe.isDbNull)(e)&&!(0,xe.isJsonNull)(e)&&!(0,xe.isAnyNull)(e))throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(Ac(e))return e.toJSON();if(typeof e=="object")return Fo(e,t);t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function Fo(e,t){if(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);X(i)||(i!==void 0?r[n]=Io(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:_o}))}return r}function Sc(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||X(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(Io(o,i))}return r}function Cc(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function Ac(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function Tn(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:_o})}var Pn=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){cr({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?.[ce(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:Re(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};var Mo=require("@prisma/client-runtime-utils");function Lo(e){if(!e._hasPreviewFlag("metrics"))throw new Mo.PrismaClientValidationError("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var Ze=class{_client;constructor(t){this._client=t}prometheus(t){return Lo(this._client),this._client._engine.metrics({format:"prometheus",...t})}json(t){return Lo(this._client),this._client._engine.metrics({format:"json",...t})}};function $o(e,t){let r=st(()=>Rc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function Rc(e){return{datamodel:{models:Sn(e.models),enums:Sn(e.enums),types:Sn(e.types)}}}function Sn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var Cn=new WeakMap,gr="$$PrismaTypedSql",Ct=class{constructor(t,r){Cn.set(this,{sql:t,values:r}),Object.defineProperty(this,gr,{value:gr})}get sql(){return Cn.get(this).sql}get values(){return Cn.get(this).values}};function No(e){return(...t)=>new Ct(e,t)}function yr(e){return e!=null&&e[gr]===gr}var va=require("@prisma/client-runtime-utils");var Pa=require("node:async_hooks"),Ta=require("node:events"),Sa=x(require("node:fs")),_r=x(require("node:path"));function At(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function M(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function Oe(e){let t=new J;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var hr={enumerable:!0,configurable:!0,writable:!0};function br(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>hr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var jo=Symbol.for("nodejs.util.inspect.custom");function G(e,t){let r=Oc(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=qo(Reflect.ownKeys(o),r),a=qo(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?{...hr,...l?.getPropertyDescriptor(s)}:hr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[jo]=function(){let o={...this};return delete o[jo],o},i}function Oc(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 qo(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Xe(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Vo(e){if(e===void 0)return"";let t=ze(e);return new Qe(0,{colors:sr}).write(t).toString()}var Rt="<unknown>";function Bo(e){var t=e.split(`
30
- `);return t.reduce(function(r,n){var i=_c(n)||Fc(n)||$c(n)||Vc(n)||jc(n);return i&&r.push(i),r},[])}var kc=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Dc=/\((\S*)(?::(\d+))(?::(\d+))\)/;function _c(e){var t=kc.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=Dc.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]||Rt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Ic=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Fc(e){var t=Ic.exec(e);return t?{file:t[2],methodName:t[1]||Rt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Lc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Mc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function $c(e){var t=Lc.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Mc.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||Rt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Nc=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function jc(e){var t=Nc.exec(e);return t?{file:t[3],methodName:t[1]||Rt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var qc=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Vc(e){var t=qc.exec(e);return t?{file:t[2],methodName:t[1]||Rt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var An=class{getLocation(){return null}},Rn=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=Bo(t).find(i=>{if(!i.file)return!1;let o=dn(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.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 we(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new An:new Rn}var Uo={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function et(e={}){let t=Uc(e);return Object.entries(t).reduce((n,[i,o])=>(Uo[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Uc(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function xr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Qo(e,t){let r=xr(e);return t({action:"aggregate",unpacker:r,argsMapper:et})(e)}function Qc(e={}){let{select:t,...r}=e;return typeof t=="object"?et({...r,_count:t}):et({...r,_count:{_all:!0}})}function Wc(e={}){return typeof e.select=="object"?t=>xr(e)(t)._count:t=>xr(e)(t)._count._all}function Wo(e,t){return t({action:"count",unpacker:Wc(e),argsMapper:Qc})(e)}function Gc(e={}){let t=et(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 Jc(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Go(e,t){return t({action:"groupBy",unpacker:Jc(e),argsMapper:Gc})(e)}function Jo(e,t,r){if(t==="aggregate")return n=>Qo(n,r);if(t==="count")return n=>Wo(n,r);if(t==="groupBy")return n=>Go(n,r)}function Ko(e,t){let r=t.fields.filter(i=>!i.relationName),n=Zn(r,"name");return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Pt(e,o,s.type,s.isList,s.kind==="enum")},...br(Object.keys(n))})}var Ho=e=>Array.isArray(e)?e:e.split("."),On=(e,t)=>Ho(t).reduce((r,n)=>r&&r[n],e),zo=(e,t,r)=>Ho(t).reduceRight((n,i,o,s)=>Object.assign({},On(e,s.slice(0,o)),{[i]:n}),r);function Kc(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Hc(e,t,r){return t===void 0?e??{}:zo(t,r,e||!0)}function kn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=we(e._errorFormat),c=Kc(n,i),p=Hc(l,o,c),m=r({dataPath:c,callsite:u})(p),f=zc(e,t);return new Proxy(m,{get(b,P){if(!f.includes(P))return b[P];let le=[a[P].type,r,P],A=[c,p];return kn(e,...le,...A)},...br([...f,...Object.getOwnPropertyNames(m)])})}}function zc(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Yc=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Zc=["aggregate","count","groupBy"];function Dn(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Xc(e,t),tp(e,t),At(r),M("name",()=>t),M("$name",()=>t),M("$parent",()=>e._appliedParent)];return G({},n)}function Xc(e,t){let r=Z(t),n=Object.keys(Ue).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=we(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 Yc.includes(o)?kn(e,t,s):ep(i)?Jo(e,i,s):s({})}}}function ep(e){return Zc.includes(e)}function tp(e,t){return Oe(M("fields",()=>{let r=e._runtimeDataModel.models[t];return Ko(t,r)}))}function Yo(e){return e.replace(/^./,t=>t.toUpperCase())}var _n=Symbol();function Ot(e){let t=[rp(e),np(e),M(_n,()=>e),M("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(At(r)),G(e,t)}function rp(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function np(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Z),n=[...new Set(t.concat(r))];return Oe({getKeys(){return n},getPropertyValue(i){let o=Yo(i);if(e._runtimeDataModel.models[o]!==void 0)return Dn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Dn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Zo(e){return e[_n]?e[_n]:e}function Xo(e){if(typeof e=="function")return e(this);let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$on:{value:void 0}});return Ot(t)}function es({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(Xe(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(c=>!r[c]);u.length>0&&a.push(Xe(u))}ip(e,l.needs)&&s.push(op(l,G(e,s)))}return s.length>0||a.length>0?G(e,[...s,...a]):e}function ip(e,t){return t.every(r=>hn(e,r))}function op(e,t){return Oe(M(e.name,()=>e.compute(t)))}function wr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=wr({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&ts({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&ts({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function ts({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||X(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]=wr({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function rs({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:wr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=Z(l);return es({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}var ke=require("@prisma/client-runtime-utils");var sp=["$connect","$disconnect","$on","$transaction","$extends"],ns=sp;function is(e){if(e instanceof ke.Sql)return ap(e);if(yr(e))return lp(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=kt(e[n]);return r}let t={};for(let r in e)t[r]=kt(e[r]);return t}function ap(e){return new ke.Sql(e.strings,e.values)}function lp(e){return new Ct(e.sql,e.values)}function kt(e){if(typeof e!="object"||e==null||e instanceof ke.ObjectEnumValue||He(e))return e;if(Be(e))return new ke.Decimal(e.toFixed());if(Ve(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]=kt(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:kt(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=kt(e[r]);return t}Re(e,"Unknown value")}function ss(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:is(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=cs(o,l),a.args=s,ss(e,a,r,n+1)}})})}function as(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 ss(e,t,s)}function ls(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?us(r,n,0,e):e(r)}}function us(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=cs(i,l),us(a,t,r+1,n)}})}var os=e=>e;function cs(e=os,t=os){return r=>e(t(r))}var ms=require("@prisma/client-runtime-utils");var ps=C("prisma:client"),ds={Vercel:"vercel","Netlify CI":"netlify"};function fs({postinstall:e,ciName:t,clientVersion:r,generator:n}){if(ps("checkPlatformCaching:postinstall",e),ps("checkPlatformCaching:ciName",t),e===!0&&!(n?.output&&typeof(n.output.fromEnvVar??n.output.value)=="string")&&t&&t in ds){let i=`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.
31
-
32
- Learn how: https://pris.ly/d/${ds[t]}-build`;throw console.error(i),new ms.PrismaClientInitializationError(i,r)}}function gs(e){return e?e.datasources?e.datasources:{}:{}}var Us=require("@prisma/client-runtime-utils");var Er=require("@prisma/client-runtime-utils"),up="P2037";function ys({error:e,user_facing_error:t},r,n){return t.error_code?new Er.PrismaClientKnownRequestError(cp(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new Er.PrismaClientUnknownRequestError(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function cp(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===up&&(r+=`
33
- Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}var Es=require("@prisma/client-runtime-utils");var vs=x(require("node:fs")),Dt=x(require("node:path"));function vr(e){let{runtimeBinaryTarget:t}=e;return`Add "${t}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it:
34
-
35
- ${pp(e)}`}function pp(e){let{generator:t,generatorBinaryTargets:r,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...r,i];return un({...t,binaryTargets:o})}function Ee(e){let{runtimeBinaryTarget:t}=e;return`Prisma Client could not locate the Query Engine for runtime "${t}".`}function ve(e){let{searchedLocations:t}=e;return`The following locations have been searched:
36
- ${[...new Set(t)].map(i=>` ${i}`).join(`
37
- `)}`}function hs(e){let{runtimeBinaryTarget:t}=e;return`${Ee(e)}
38
-
39
- This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${t}".
40
- ${vr(e)}
41
-
42
- ${ve(e)}`}function Pr(e){return`We would appreciate if you could take the time to share some information with us.
43
- Please help us by answering a few questions: https://pris.ly/${e}`}function Tr(e){let{errorStack:t}=e;return t?.match(/\/\.next|\/next@|\/next\//)?`
44
-
45
- We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function bs(e){let{queryEngineName:t}=e;return`${Ee(e)}${Tr(e)}
46
-
47
- This is likely caused by a bundler that has not copied "${t}" next to the resulting bundle.
48
- Ensure that "${t}" has been copied next to the bundle or in "${e.expectedLocation}".
49
-
50
- ${Pr("engine-not-found-bundler-investigation")}
51
-
52
- ${ve(e)}`}function xs(e){let{runtimeBinaryTarget:t,generatorBinaryTargets:r}=e,n=r.find(i=>i.native);return`${Ee(e)}
53
-
54
- This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${t}".
55
- ${vr(e)}
56
-
57
- ${ve(e)}`}function ws(e){let{queryEngineName:t}=e;return`${Ee(e)}${Tr(e)}
58
-
59
- This is likely caused by tooling that has not copied "${t}" to the deployment folder.
60
- Ensure that you ran \`prisma generate\` and that "${t}" has been copied to "${e.expectedLocation}".
61
-
62
- ${Pr("engine-not-found-tooling-investigation")}
63
-
64
- ${ve(e)}`}var dp=C("prisma:client:engines:resolveEnginePath"),mp=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function Ps(e,t){let r={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??t.prismaPath;if(r!==void 0)return r;let{enginePath:n,searchedLocations:i}=await fp(e,t);if(dp("enginePath",n),n!==void 0&&e==="binary"&&rn(n),n!==void 0)return t.prismaPath=n;let o=await Ce(),s=t.generator?.binaryTargets??[],a=s.some(m=>m.native),l=!s.some(m=>m.value===o),u=__filename.match(mp())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:t.generator,runtimeBinaryTarget:o,queryEngineName:Ts(e,o),expectedLocation:Dt.default.relative(process.cwd(),t.dirname),errorStack:new Error().stack},p;throw a&&l?p=xs(c):l?p=hs(c):u?p=bs(c):p=ws(c),new Es.PrismaClientInitializationError(p,t.clientVersion)}async function fp(e,t){let r=await Ce(),n=[],i=[t.dirname,Dt.default.resolve(__dirname,".."),t.generator?.output?.value??__dirname,Dt.default.resolve(__dirname,"../../../.prisma/client"),"/tmp/prisma-engines",t.cwd];__filename.includes("resolveEnginePath")&&i.push(_i());for(let o of i){let s=Ts(e,r),a=Dt.default.join(o,s);if(n.push(o),vs.default.existsSync(a))return{enginePath:a,searchedLocations:n}}return{enginePath:void 0,searchedLocations:n}}function Ts(e,t){return e==="library"?Mt(t,"fs"):`query-engine-${t}${t==="windows"?".exe":""}`}function Ss(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Cs(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function As(e){return e.split(`
25
+ `)}};var Lu={red:B,gray:ot,dim:re,bold:_,underline:F,highlightSource:e=>e.highlight()},Mu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function $u({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Nu({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=$u({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=tr.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=qu(c),m=ju(c);if(!m)return s;s.functionName=`${m.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,b=>b.slice(0,m.openingBraceIndex))),u=o.highlightSource(u);let f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((b,v)=>o.gray(String(v).padStart(f))+" "+b).mapLines(b=>o.dim(b)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let b=p+f+1;b+=2,s.callArguments=(0,to.default)(i,b).slice(b)}}return s}function ju(e){let t=Object.keys(Ve).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 qu(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function Vu({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(Bu(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(`
26
+ `)}function Bu(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function rr(e){let t=e.showColors?Lu:Mu,r;return r=Nu(e,t),Vu(r,t)}var co=x(bn());function oo(e,t,r){let n=so(e),i=Uu(n),o=Qu(i);o?nr(o,t,r):t.addErrorMessage(()=>"Unknown error")}function so(e){return e.errors.flatMap(t=>t.kind==="Union"?so(t):[t])}function Uu(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:Wu(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Wu(e,t){return[...new Set(e.concat(t))]}function Qu(e){return yn(e,(t,r)=>{let n=no(t),i=no(r);return n!==i?n-i:io(t)-io(r)})}function no(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function io(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var N=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)}};lo();var Be=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(`
27
+ `)}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}};ao();var ir=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var or=e=>e,sr={bold:or,red:or,green:or,dim:or,enabled:!1},uo={bold:_,red:B,green:pe,dim:re,enabled:!0},Ue={write(e){e.writeLine(",")}};var Y=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 be=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var We=class extends be{items=[];addItem(t){return this.items.push(new ir(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 Y("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(Ue,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Qe=class e extends be{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 We&&(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 Y("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(Ue,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var k=class extends be{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Y(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var wt=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(Ue,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function nr(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Gu(e,t);break;case"IncludeOnScalar":Ju(e,t);break;case"EmptySelection":Ku(e,t,r);break;case"UnknownSelectionField":Zu(e,t);break;case"InvalidSelectionValue":Xu(e,t);break;case"UnknownArgument":ec(e,t);break;case"UnknownInputField":tc(e,t);break;case"RequiredArgumentMissing":rc(e,t);break;case"InvalidArgumentType":nc(e,t);break;case"InvalidArgumentValue":ic(e,t);break;case"ValueTooLarge":oc(e,t);break;case"SomeFieldsMissing":sc(e,t);break;case"TooManyFieldsGiven":ac(e,t);break;case"Union":oo(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Gu(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 Ju(e,t){let[r,n]=Ge(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 N(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)}. ${Et(s)}`:a+=".",a+=`
28
+ Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Ku(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Hu(e,t,i);return}if(n.hasField("select")){zu(e,t);return}}if(r?.[ce(e.outputType.name)]){Yu(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Hu(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new N(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 zu(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),fo(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${Et(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Yu(e,t){let r=new wt;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new N("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=Ge(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new Qe;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 Zu(e,t){let r=go(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":fo(n,e.outputType);break;case"include":lc(n,e.outputType);break;case"omit":uc(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(Et(n)),i.join(" ")})}function Xu(e,t){let r=go(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 ec(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),cc(n,e.arguments)),t.addErrorMessage(i=>po(i,r,e.arguments.map(o=>o.name)))}function tc(e,t){let[r,n]=Ge(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&yo(o,e.inputType)}t.addErrorMessage(o=>po(o,n,e.inputType.fields.map(s=>s.name)))}function po(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=dc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(Et(e)),n.join(" ")}function rc(e,t){let r;t.addErrorMessage(l=>r?.value instanceof k&&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]=Ge(e.argumentPath),s=new wt,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 N(o,s).makeRequired())}else{let l=e.inputTypes.map(mo).join(" | ");a.addSuggestion(new N(o,l).makeRequired())}if(e.dependentArgumentPath){n.getDeepField(e.dependentArgumentPath)?.markAsError();let[,l]=Ge(e.dependentArgumentPath);t.addErrorMessage(u=>`Argument \`${u.green(o)}\` is required because argument \`${u.green(l)}\` was provided.`)}}}function mo(e){return e.kind==="list"?`${mo(e.elementType)}[]`:e.name}function nc(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=ar("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 ic(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=ar("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function oc(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 k&&(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 sc(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&&yo(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")} ${ar("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(Et(i)),o.join(" ")})}function ac(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 ${ar("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function fo(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new N(r.name,"true"))}function lc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new N(r.name,"true"))}function uc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new N(r.name,"true"))}function cc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new N(r.name,r.typeNames.join(" | ")))}function go(e,t){let[r,n]=Ge(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 yo(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new N(r.name,r.typeNames.join(" | ")))}function Ge(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function Et({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function ar(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var pc=3;function dc(e,t){let r=1/0,n;for(let i of t){let o=(0,co.default)(e,i);o>pc||o<r&&(r=o,n=i)}return n}var bo=require("@prisma/client-runtime-utils");var vt=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 Je(e){return e instanceof vt}var ho=": ",lr=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+ho.length}write(t){let r=new Y(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(ho).write(this.value)}};var wn=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(`
29
+ `)}};function Ke(e){return new wn(xo(e))}function xo(e){let t=new Qe;for(let[r,n]of Object.entries(e)){let i=new lr(r,wo(n));t.addField(i)}return t}function wo(e){if(typeof e=="string")return new k(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new k(String(e));if(typeof e=="bigint")return new k(`${e}n`);if(e===null)return new k("null");if(e===void 0)return new k("undefined");if(qe(e))return new k(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new k(`Buffer.alloc(${e.byteLength})`):new k(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Xt(e)?e.toISOString():"Invalid Date";return new k(`new Date("${t}")`)}return e instanceof bo.ObjectEnumValue?new k(`Prisma.${e._getName()}`):Je(e)?new k(`prisma.${ce(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?mc(e):typeof e=="object"?xo(e):new k(Object.prototype.toString.call(e))}function mc(e){let t=new We;for(let r of e)t.addItem(wo(r));return t}function ur(e,t){let r=t==="pretty"?uo:sr,n=e.renderAllMessages(r),i=new Be(0,{colors:r}).write(e).toString();return{message:n,args:i}}function cr({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=Ke(e);for(let p of t)nr(p,a,s);let{message:l,args:u}=ur(a,r),c=rr({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new Eo.PrismaClientValidationError(c,{clientVersion:o})}function Z(e){return e.replace(/^./,t=>t.toLowerCase())}function Po(e,t,r){let n=Z(r);return!t.result||!(t.result.$allModels||t.result[n])?e:fc({...e,...vo(t.name,e,t.result.$allModels),...vo(t.name,e,t.result[n])})}function fc(e){let t=new J,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Yt(e,n=>({...n,needs:r(n.name,new Set)}))}function vo(e,t,r){return r?Yt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:gc(t,o,i)})):{}}function gc(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function To(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 So(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var pr=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new J;modelExtensionsCache=new J;queryCallbacksCache=new J;clientExtensions=it(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=it(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Po(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Z(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()}},He=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new pr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new pr(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 dr=class{constructor(t){this.name=t}};function Co(e){return e instanceof dr}function Ao(e){return new dr(e)}var Ro=Symbol(),Pt=class{constructor(t){if(t!==Ro)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?mr:t}},mr=new Pt(Ro);function X(e){return e instanceof Pt}var yc={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"},Oo="explicitly `undefined` values are not allowed";function fr({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=He.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c}){let p=new En({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:yc[t],query:Tt(r,p)}}function Tt({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:Do(r,n),selection:hc(e,t,i,n)}}function hc(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()}),Ec(e,n)):bc(n,t,r)}function bc(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&xc(n,t,e),wc(n,r,e),n}function xc(e,t,r){for(let[n,i]of Object.entries(t)){if(X(i))continue;let o=r.nestSelection(n);if(vn(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]=Tt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=Tt(i,o)}}function wc(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=So(i,n);for(let[s,a]of Object.entries(o)){if(X(a))continue;vn(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function Ec(e,t){let r={},n=t.getComputedFields(),i=To(e,n);for(let[o,s]of Object.entries(i)){if(X(s))continue;let a=t.nestSelection(o);vn(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||X(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=Tt({},a):r[o]=!0;continue}r[o]=Tt(s,a)}}return r}function ko(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(je(e)){if(Xt(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(Co(e))return{$type:"Param",value:e.name};if(Je(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return vc(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(Pc(e))return e.values;if(qe(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof xe.ObjectEnumValue){if(!(0,xe.isDbNull)(e)&&!(0,xe.isJsonNull)(e)&&!(0,xe.isAnyNull)(e))throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(Tc(e))return e.toJSON();if(typeof e=="object")return Do(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 Do(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);X(i)||(i!==void 0?r[n]=ko(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:Oo}))}return r}function vc(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||X(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(ko(o,i))}return r}function Pc(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function Tc(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function vn(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:Oo})}var En=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){cr({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?.[ce(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:Re(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};var Fo=require("@prisma/client-runtime-utils");function _o(e){if(!e._hasPreviewFlag("metrics"))throw new Fo.PrismaClientValidationError("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var ze=class{_client;constructor(t){this._client=t}prometheus(t){return _o(this._client),this._client._engine.metrics({format:"prometheus",...t})}json(t){return _o(this._client),this._client._engine.metrics({format:"json",...t})}};function Io(e,t){let r=it(()=>Sc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function Sc(e){return{datamodel:{models:Pn(e.models),enums:Pn(e.enums),types:Pn(e.types)}}}function Pn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var Tn=new WeakMap,gr="$$PrismaTypedSql",St=class{constructor(t,r){Tn.set(this,{sql:t,values:r}),Object.defineProperty(this,gr,{value:gr})}get sql(){return Tn.get(this).sql}get values(){return Tn.get(this).values}};function Lo(e){return(...t)=>new St(e,t)}function yr(e){return e!=null&&e[gr]===gr}var xa=require("@prisma/client-runtime-utils");var wa=require("node:async_hooks"),Ea=require("node:events"),va=x(require("node:fs")),_r=x(require("node:path"));function Ct(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function M(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function Oe(e){let t=new J;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var hr={enumerable:!0,configurable:!0,writable:!0};function br(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>hr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Mo=Symbol.for("nodejs.util.inspect.custom");function G(e,t){let r=Cc(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=$o(Reflect.ownKeys(o),r),a=$o(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?{...hr,...l?.getPropertyDescriptor(s)}:hr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[Mo]=function(){let o={...this};return delete o[Mo],o},i}function Cc(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 $o(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Ye(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function No(e){if(e===void 0)return"";let t=Ke(e);return new Be(0,{colors:sr}).write(t).toString()}var At="<unknown>";function jo(e){var t=e.split(`
30
+ `);return t.reduce(function(r,n){var i=Oc(n)||Dc(n)||Ic(n)||Nc(n)||Mc(n);return i&&r.push(i),r},[])}var Ac=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Rc=/\((\S*)(?::(\d+))(?::(\d+))\)/;function Oc(e){var t=Ac.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=Rc.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]||At,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var kc=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Dc(e){var t=kc.exec(e);return t?{file:t[2],methodName:t[1]||At,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var _c=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Fc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ic(e){var t=_c.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Fc.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||At,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Lc=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Mc(e){var t=Lc.exec(e);return t?{file:t[3],methodName:t[1]||At,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var $c=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Nc(e){var t=$c.exec(e);return t?{file:t[2],methodName:t[1]||At,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Sn=class{getLocation(){return null}},Cn=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=jo(t).find(i=>{if(!i.file)return!1;let o=cn(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.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 we(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Sn:new Cn}var qo={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Ze(e={}){let t=qc(e);return Object.entries(t).reduce((n,[i,o])=>(qo[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function qc(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function xr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Vo(e,t){let r=xr(e);return t({action:"aggregate",unpacker:r,argsMapper:Ze})(e)}function Vc(e={}){let{select:t,...r}=e;return typeof t=="object"?Ze({...r,_count:t}):Ze({...r,_count:{_all:!0}})}function Bc(e={}){return typeof e.select=="object"?t=>xr(e)(t)._count:t=>xr(e)(t)._count._all}function Bo(e,t){return t({action:"count",unpacker:Bc(e),argsMapper:Vc})(e)}function Uc(e={}){let t=Ze(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 Wc(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Uo(e,t){return t({action:"groupBy",unpacker:Wc(e),argsMapper:Uc})(e)}function Wo(e,t,r){if(t==="aggregate")return n=>Vo(n,r);if(t==="count")return n=>Bo(n,r);if(t==="groupBy")return n=>Uo(n,r)}function Qo(e,t){let r=t.fields.filter(i=>!i.relationName),n=zn(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 vt(e,o,s.type,s.isList,s.kind==="enum")},...br(Object.keys(n))})}var Go=e=>Array.isArray(e)?e:e.split("."),An=(e,t)=>Go(t).reduce((r,n)=>r&&r[n],e),Jo=(e,t,r)=>Go(t).reduceRight((n,i,o,s)=>Object.assign({},An(e,s.slice(0,o)),{[i]:n}),r);function Qc(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Gc(e,t,r){return t===void 0?e??{}:Jo(t,r,e||!0)}function Rn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=we(e._errorFormat),c=Qc(n,i),p=Gc(l,o,c),m=r({dataPath:c,callsite:u})(p),f=Jc(e,t);return new Proxy(m,{get(b,v){if(!f.includes(v))return b[v];let le=[a[v].type,r,v],A=[c,p];return Rn(e,...le,...A)},...br([...f,...Object.getOwnPropertyNames(m)])})}}function Jc(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Kc=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Hc=["aggregate","count","groupBy"];function On(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[zc(e,t),Zc(e,t),Ct(r),M("name",()=>t),M("$name",()=>t),M("$parent",()=>e._appliedParent)];return G({},n)}function zc(e,t){let r=Z(t),n=Object.keys(Ve).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=we(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 Kc.includes(o)?Rn(e,t,s):Yc(i)?Wo(e,i,s):s({})}}}function Yc(e){return Hc.includes(e)}function Zc(e,t){return Oe(M("fields",()=>{let r=e._runtimeDataModel.models[t];return Qo(t,r)}))}function Ko(e){return e.replace(/^./,t=>t.toUpperCase())}var kn=Symbol();function Rt(e){let t=[Xc(e),ep(e),M(kn,()=>e),M("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Ct(r)),G(e,t)}function Xc(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function ep(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Z),n=[...new Set(t.concat(r))];return Oe({getKeys(){return n},getPropertyValue(i){let o=Ko(i);if(e._runtimeDataModel.models[o]!==void 0)return On(e,o);if(e._runtimeDataModel.models[i]!==void 0)return On(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Ho(e){return e[kn]?e[kn]:e}function zo(e){if(typeof e=="function")return e(this);let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$on:{value:void 0}});return Rt(t)}function Yo({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(Ye(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(c=>!r[c]);u.length>0&&a.push(Ye(u))}tp(e,l.needs)&&s.push(rp(l,G(e,s)))}return s.length>0||a.length>0?G(e,[...s,...a]):e}function tp(e,t){return t.every(r=>gn(e,r))}function rp(e,t){return Oe(M(e.name,()=>e.compute(t)))}function wr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=wr({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&Zo({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&Zo({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function Zo({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||X(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]=wr({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Xo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:wr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=Z(l);return Yo({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}var ke=require("@prisma/client-runtime-utils");var np=["$connect","$disconnect","$on","$transaction","$extends"],es=np;function ts(e){if(e instanceof ke.Sql)return ip(e);if(yr(e))return op(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=Ot(e[n]);return r}let t={};for(let r in e)t[r]=Ot(e[r]);return t}function ip(e){return new ke.Sql(e.strings,e.values)}function op(e){return new St(e.sql,e.values)}function Ot(e){if(typeof e!="object"||e==null||e instanceof ke.ObjectEnumValue||Je(e))return e;if(qe(e))return new ke.Decimal(e.toFixed());if(je(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]=Ot(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:Ot(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=Ot(e[r]);return t}Re(e,"Unknown value")}function ns(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:ts(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=as(o,l),a.args=s,ns(e,a,r,n+1)}})})}function is(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 ns(e,t,s)}function os(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?ss(r,n,0,e):e(r)}}function ss(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=as(i,l),ss(a,t,r+1,n)}})}var rs=e=>e;function as(e=rs,t=rs){return r=>e(t(r))}var cs=require("@prisma/client-runtime-utils");var ls=C("prisma:client"),us={Vercel:"vercel","Netlify CI":"netlify"};function ps({postinstall:e,ciName:t,clientVersion:r,generator:n}){if(ls("checkPlatformCaching:postinstall",e),ls("checkPlatformCaching:ciName",t),e===!0&&!(n?.output&&typeof(n.output.fromEnvVar??n.output.value)=="string")&&t&&t in us){let i=`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.
31
+
32
+ Learn how: https://pris.ly/d/${us[t]}-build`;throw console.error(i),new cs.PrismaClientInitializationError(i,r)}}function ds(e){return e?e.datasources?e.datasources:{}:{}}var qs=require("@prisma/client-runtime-utils");var fs=require("@prisma/client-runtime-utils");var sp=require("@prisma/client-runtime-utils");function ms(e,t){throw new Error(t)}function ap(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function lp(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function Xe(e){return e===null?e:Array.isArray(e)?e.map(Xe):typeof e=="object"?ap(e)?up(e):e.constructor!==null&&e.constructor.name!=="Object"?e:lp(e,Xe):e}function up({$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 fs.Decimal(t);case"Json":return JSON.parse(t);default:ms(t,"Unknown tagged value")}}function Dn(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}function Er(e){return{ok:!0,value:e,map(t){return Er(t(e))},flatMap(t){return t(e)}}}function De(e){return{ok:!1,error:e,map(){return De(e)},flatMap(){return De(e)}}}var gs=C("driver-adapter-utils"),_n=class{registeredErrors=[];consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}};var vr=(e,t=new _n)=>{let r={adapterName:e.adapterName,errorRegistry:t,queryRaw:ae(t,e.queryRaw.bind(e)),executeRaw:ae(t,e.executeRaw.bind(e)),executeScript:ae(t,e.executeScript.bind(e)),dispose:ae(t,e.dispose.bind(e)),provider:e.provider,startTransaction:async(...n)=>(await ae(t,e.startTransaction.bind(e))(...n)).map(o=>cp(t,o))};return e.getConnectionInfo&&(r.getConnectionInfo=pp(t,e.getConnectionInfo.bind(e))),r},cp=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:ae(e,t.queryRaw.bind(t)),executeRaw:ae(e,t.executeRaw.bind(t)),commit:ae(e,t.commit.bind(t)),rollback:ae(e,t.rollback.bind(t))});function ae(e,t){return async(...r)=>{try{return Er(await t(...r))}catch(n){if(gs("[error@wrapAsync]",n),Dn(n))return De(n.cause);let i=e.registerNewError(n);return De({kind:"GenericJs",id:i})}}}function pp(e,t){return(...r)=>{try{return Er(t(...r))}catch(n){if(gs("[error@wrapSync]",n),Dn(n))return De(n.cause);let i=e.registerNewError(n);return De({kind:"GenericJs",id:i})}}}var ys="6.19.0-integration-feat-remove-binary-engine.1";function hs(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function bs(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function xs(e){return e.split(`
65
33
  `).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(`
66
- `)}var Rs=x(Yi());function Os({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,Rs.default)({user:t,repo:r,template:n,title:e,body:i})}function ks({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=ai(6e3-(s?.length??0)),l=As(je(a)),u=n?`# Description
34
+ `)}var ws=x(Ki());function Es({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,ws.default)({user:t,repo:r,template:n,title:e,body:i})}function vs({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=oi(6e3-(s?.length??0)),l=xs($e(a)),u=n?`# Description
67
35
  \`\`\`
68
36
  ${n}
69
- \`\`\``:"",c=je(`Hi Prisma Team! My Prisma Client just crashed. This is the report:
37
+ \`\`\``:"",c=$e(`Hi Prisma Team! My Prisma Client just crashed. This is the report:
70
38
  ## Versions
71
39
 
72
40
  | Name | Version |
@@ -96,35 +64,67 @@ ${l}
96
64
 
97
65
  ## Prisma Engine Query
98
66
  \`\`\`
99
- ${s?Cs(s):""}
67
+ ${s?bs(s):""}
100
68
  \`\`\`
101
- `),p=Os({title:r,body:c});return`${r}
69
+ `),p=Es({title:r,body:c});return`${r}
102
70
 
103
71
  This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.
104
72
 
105
- ${I(p)}
73
+ ${F(p)}
106
74
 
107
75
  If you want the Prisma team to look into it, please open the link above \u{1F64F}
108
76
  To increase the chance of success, please post your schema and a snippet of
109
77
  how you used Prisma Client in the issue.
110
- `}var _s=require("@prisma/client-runtime-utils");var gp=require("@prisma/client-runtime-utils");function Ds(e,t){throw new Error(t)}function yp(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function hp(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function tt(e){return e===null?e:Array.isArray(e)?e.map(tt):typeof e=="object"?yp(e)?bp(e):e.constructor!==null&&e.constructor.name!=="Object"?e:hp(e,tt):e}function bp({$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 _s.Decimal(t);case"Json":return JSON.parse(t);default:Ds(t,"Unknown tagged value")}}function In(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}function Sr(e){return{ok:!0,value:e,map(t){return Sr(t(e))},flatMap(t){return t(e)}}}function De(e){return{ok:!1,error:e,map(){return De(e)},flatMap(){return De(e)}}}var Is=C("driver-adapter-utils"),Fn=class{registeredErrors=[];consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}};var Cr=(e,t=new Fn)=>{let r={adapterName:e.adapterName,errorRegistry:t,queryRaw:ae(t,e.queryRaw.bind(e)),executeRaw:ae(t,e.executeRaw.bind(e)),executeScript:ae(t,e.executeScript.bind(e)),dispose:ae(t,e.dispose.bind(e)),provider:e.provider,startTransaction:async(...n)=>(await ae(t,e.startTransaction.bind(e))(...n)).map(o=>xp(t,o))};return e.getConnectionInfo&&(r.getConnectionInfo=wp(t,e.getConnectionInfo.bind(e))),r},xp=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:ae(e,t.queryRaw.bind(t)),executeRaw:ae(e,t.executeRaw.bind(t)),commit:ae(e,t.commit.bind(t)),rollback:ae(e,t.rollback.bind(t))});function ae(e,t){return async(...r)=>{try{return Sr(await t(...r))}catch(n){if(Is("[error@wrapAsync]",n),In(n))return De(n.cause);let i=e.registerNewError(n);return De({kind:"GenericJs",id:i})}}}function wp(e,t){return(...r)=>{try{return Sr(t(...r))}catch(n){if(Is("[error@wrapSync]",n),In(n))return De(n.cause);let i=e.registerNewError(n);return De({kind:"GenericJs",id:i})}}}var Fs="6.19.0-integration-next.6";var Ln=require("@prisma/client-runtime-utils");var vp=()=>globalThis.process?.release?.name==="node",Pp=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,Tp=()=>!!globalThis.Deno,Sp=()=>typeof globalThis.Netlify=="object",Cp=()=>typeof globalThis.EdgeRuntime=="object",Ap=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Rp(){return[[Sp,"netlify"],[Cp,"edge-light"],[Ap,"workerd"],[Tp,"deno"],[Pp,"bun"],[vp,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var Op={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 Ar(){let e=Rp();return{id:e,prettyName:Op[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}function Ls({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 Ln.PrismaClientInitializationError(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new Ln.PrismaClientInitializationError("error: Missing URL environment variable, value, or override.",n);return i}var D=require("@prisma/client-runtime-utils");function Ms(e){if(e?.kind==="itx")return e.options.id}var $s=require("@prisma/client-runtime-utils");var $n=x(require("node:os")),Ns=x(require("node:path"));var Mn=Symbol("PrismaLibraryEngineCache");function kp(){let e=globalThis;return e[Mn]===void 0&&(e[Mn]={}),e[Mn]}function Dp(e){let t=kp();if(t[e]!==void 0)return t[e];let r=Ns.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=$n.default.constants.dlopen.RTLD_LAZY|$n.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,r,i),t[e]=n.exports,n.exports}var js={async loadLibrary(e){let t=await Gr(),r=await Ps("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>Dp(r))}catch(n){let i=nn({e:n,platformInfo:t,id:r});throw new $s.PrismaClientInitializationError(i,e.clientVersion)}}};var Rr=require("@prisma/client-runtime-utils");var Nn,qs={async loadLibrary(e){let{clientVersion:t,adapter:r,engineWasm:n}=e;if(r===void 0)throw new Rr.PrismaClientInitializationError(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Ar().prettyName})`,t);if(n===void 0)throw new Rr.PrismaClientInitializationError("WASM engine was unexpectedly `undefined`",t);Nn===void 0&&(Nn=(async()=>{let o=await n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new Rr.PrismaClientInitializationError("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let a={"./query_engine_bg.js":o},l=new WebAssembly.Instance(s,a),u=l.exports.__wbindgen_start;return o.__wbg_set_wasm(l.exports),u(),o.QueryEngine})());let i=await Nn;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var _p="P2036",ee=C("prisma:client:libraryEngine");function Ip(e){return e.item_type==="query"&&"query"in e}function Fp(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var Vs=[...qr,"native"],Lp=0xffffffffffffffffn,jn=1n;function Mp(){let e=jn++;return jn>Lp&&(jn=1n),e}var rt=class{name="LibraryEngine";engine;libraryInstantiationPromise;libraryStartingPromise;libraryStoppingPromise;libraryStarted;executingQueryPromise;config;QueryEngineConstructor;libraryLoader;library;logEmitter;libQueryEnginePath;binaryTarget;datasourceOverrides;datamodel;logQueries;logLevel;lastQuery;loggerRustPanic;tracingHelper;adapterPromise;versionInfo;constructor(t,r){this.libraryLoader=r??js,t.engineWasm!==void 0&&(this.libraryLoader=r??qs),this.config=t,this.libraryStarted=!1,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");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}wrapEngine(t){return{commitTransaction:this.withRequestId(t.commitTransaction.bind(t)),connect:this.withRequestId(t.connect.bind(t)),disconnect:this.withRequestId(t.disconnect.bind(t)),metrics:t.metrics?.bind(t),query:this.withRequestId(t.query.bind(t)),rollbackTransaction:this.withRequestId(t.rollbackTransaction.bind(t)),sdlSchema:t.sdlSchema?.bind(t),startTransaction:this.withRequestId(t.startTransaction.bind(t)),trace:t.trace.bind(t),free:t.free?.bind(t)}}withRequestId(t){return async(...r)=>{let n=Mp().toString();try{return await t(...r,n)}finally{if(this.tracingHelper.isEnabled()){let i=await this.engine?.trace(n);if(i){let o=JSON.parse(i);this.tracingHelper.dispatchEngineSpans(o.spans)}}}}}async transaction(t,r,n){await this.start();let i=await this.adapterPromise,o=JSON.stringify(r),s;if(t==="start"){let l=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});s=await this.engine?.startTransaction(l,o)}else t==="commit"?s=await this.engine?.commitTransaction(n.id,o):t==="rollback"&&(s=await this.engine?.rollbackTransaction(n.id,o));let a=this.parseEngineResponse(s);if($p(a)){let l=this.getExternalAdapterError(a,i?.errorRegistry);throw l?l.error:new D.PrismaClientKnownRequestError(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta})}else if(typeof a.message=="string")throw new D.PrismaClientUnknownRequestError(a.message,{clientVersion:this.config.clientVersion});return a}async instantiateLibrary(){if(ee("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;jr(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let t=await this.tracingHelper.runInChildSpan("detect_platform",()=>Ce());if(!Vs.includes(t))throw new D.PrismaClientInitializationError(`Unknown ${B("PRISMA_QUERY_ENGINE_LIBRARY")} ${B(_(t))}. Possible binaryTargets: ${pe(Vs.join(", "))} or a path to the query engine library.
111
- You may have to run ${pe("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return t}}parseEngineResponse(t){if(!t)throw new D.PrismaClientUnknownRequestError("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new D.PrismaClientUnknownRequestError("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new WeakRef(this);this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(Cr));let r=await this.adapterPromise;r&&ee("Using driver adapter: %O",r),this.engine=this.wrapEngine(new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json",enableTracing:this.tracingHelper.isEnabled()},n=>{t.deref()?.logger(n)},r))}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new D.PrismaClientInitializationError(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);r&&(r.level=r?.level.toLowerCase()??"unknown",Ip(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):Fp(r)?this.loggerRustPanic=new D.PrismaClientRustPanicError(qn(this,`${r.message}: ${r.reason} in ${r.file}:${r.line}:${r.column}`),this.config.clientVersion):this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path}))}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(this.libraryInstantiationPromise||(this.libraryInstantiationPromise=this.instantiateLibrary()),await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return ee(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{ee("library starting");try{let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(Cr)),await this.adapterPromise,ee("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new D.PrismaClientInitializationError(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryInstantiationPromise,await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return ee("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted){await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0;return}let t=async()=>{await new Promise(n=>setImmediate(n)),ee("library stopping");let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.engine?.free&&this.engine.free(),this.engine=void 0,this.libraryStarted=!1,this.libraryStoppingPromise=void 0,this.libraryInstantiationPromise=void 0,await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0,ee("library stopped")};return this.libraryStoppingPromise=this.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){ee(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start();let s=await this.adapterPromise;this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let a=this.parseEngineResponse(await this.executingQueryPromise);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],s?.errorRegistry):new D.PrismaClientUnknownRequestError(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a}}catch(s){if(s instanceof D.PrismaClientInitializationError)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new D.PrismaClientRustPanicError(qn(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new D.PrismaClientUnknownRequestError(`${a.message}
112
- ${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){ee("requestBatch");let i=Ss(t,r);await this.start();let o=await this.adapterPromise;this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine?.query(this.lastQuery,JSON.stringify({traceparent:n}),Ms(r));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],o?.errorRegistry):new D.PrismaClientUnknownRequestError(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});let{batchResult:l,errors:u}=a;if(Array.isArray(l))return l.map(c=>c.errors&&c.errors.length>0?this.loggerRustPanic??this.buildQueryError(c.errors[0],o?.errorRegistry):{data:c});throw u&&u.length===1?new Error(u[0].error):new Error(JSON.stringify(a))}buildQueryError(t,r){if(t.user_facing_error.is_panic)return new D.PrismaClientRustPanicError(qn(this,t.user_facing_error.message),this.config.clientVersion);let n=this.getExternalAdapterError(t.user_facing_error,r);return n?n.error:ys(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t,r){if(t.error_code===_p&&r){let n=t.meta?.id;Kt(typeof n=="number","Malformed external JS error received from the engine");let i=r.consumeError(n);return Kt(i,"External error with reported id was not registered"),i}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function $p(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function qn(e,t){return ks({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function Bs({url:e,adapter:t}){let r=[],n=[],i=p=>{let m=p.join(`
113
- `);n.push({_tag:"error",value:m})},o=!!e?.startsWith("prisma://"),s=sn(e),a=!!t,l=o||s;a&&l&&i(["You've provided both a driver adapter and an Accelerate database URL. Driver adapters currently cannot connect to Accelerate.","Please provide either a driver adapter with a direct database URL or an Accelerate URL and no driver adapter."]);let u={accelerate:l,ppg:s,driverAdapters:a};function c(p){return p.length>0}return c(n)?{ok:!1,diagnostics:{warnings:r,errors:n},isUsing:u}:{ok:!0,diagnostics:{warnings:r},isUsing:u}}function Qs(e,t){let r;try{r=Ls({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}let{ok:n,isUsing:i,diagnostics:o}=Bs({url:r,adapter:t.adapter});for(let p of o.warnings)xt(...p.value);if(!n){let p=o.errors[0];throw new Us.PrismaClientValidationError(p.value,{clientVersion:t.clientVersion})}let s=Ne(t.generator),a=s==="library",l=s==="binary",u=s==="client",c=(i.accelerate||i.ppg)&&!i.driverAdapters;return a?new rt(t):new rt(t)}function Ws({generator:e}){return e?.previewFeatures??[]}var Gs=e=>({command:e});var ea=require("@prisma/client-runtime-utils");var Js=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);var zs=require("@prisma/client-runtime-utils");function nt(e){try{return Ks(e,"fast")}catch{return Ks(e,"slow")}}function Ks(e,t){return JSON.stringify(e.map(r=>Ys(r,t)))}function Ys(e,t){if(Array.isArray(e))return e.map(r=>Ys(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(Ve(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(zs.Decimal.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(Np(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"?Zs(e):e}function Np(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Zs(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Hs);let t={};for(let r of Object.keys(e))t[r]=Hs(e[r]);return t}function Hs(e){return typeof e=="bigint"?e.toString():Zs(e)}var jp=/^(\s*alter\s)/i,Xs=C("prisma:client");function Vn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&jp.exec(t))throw new Error(`Running ALTER using ${n} is not supported
78
+ `}var Fn=require("@prisma/client-runtime-utils");var mp=()=>globalThis.process?.release?.name==="node",fp=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,gp=()=>!!globalThis.Deno,yp=()=>typeof globalThis.Netlify=="object",hp=()=>typeof globalThis.EdgeRuntime=="object",bp=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function xp(){return[[yp,"netlify"],[hp,"edge-light"],[bp,"workerd"],[gp,"deno"],[fp,"bun"],[mp,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var wp={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 Pr(){let e=xp();return{id:e,prettyName:wp[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}function Ps({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 Fn.PrismaClientInitializationError(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new Fn.PrismaClientInitializationError("error: Missing URL environment variable, value, or override.",n);return i}var D=require("@prisma/client-runtime-utils");var Tr=require("@prisma/client-runtime-utils"),Ep="P2037";function Ts({error:e,user_facing_error:t},r,n){return t.error_code?new Tr.PrismaClientKnownRequestError(vp(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new Tr.PrismaClientUnknownRequestError(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function vp(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===Ep&&(r+=`
79
+ Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}function Ss(e){if(e?.kind==="itx")return e.options.id}var Is=require("@prisma/client-runtime-utils");var Ln=x(require("node:os")),Ls=x(require("node:path"));var ks=require("@prisma/client-runtime-utils");var Ds=x(require("node:fs")),kt=x(require("node:path"));function Sr(e){let{runtimeBinaryTarget:t}=e;return`Add "${t}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it:
80
+
81
+ ${Pp(e)}`}function Pp(e){let{generator:t,generatorBinaryTargets:r,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...r,i];return an({...t,binaryTargets:o})}function Ee(e){let{runtimeBinaryTarget:t}=e;return`Prisma Client could not locate the Query Engine for runtime "${t}".`}function ve(e){let{searchedLocations:t}=e;return`The following locations have been searched:
82
+ ${[...new Set(t)].map(i=>` ${i}`).join(`
83
+ `)}`}function Cs(e){let{runtimeBinaryTarget:t}=e;return`${Ee(e)}
84
+
85
+ This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${t}".
86
+ ${Sr(e)}
87
+
88
+ ${ve(e)}`}function Cr(e){return`We would appreciate if you could take the time to share some information with us.
89
+ Please help us by answering a few questions: https://pris.ly/${e}`}function Ar(e){let{errorStack:t}=e;return t?.match(/\/\.next|\/next@|\/next\//)?`
90
+
91
+ We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function As(e){let{queryEngineName:t}=e;return`${Ee(e)}${Ar(e)}
92
+
93
+ This is likely caused by a bundler that has not copied "${t}" next to the resulting bundle.
94
+ Ensure that "${t}" has been copied next to the bundle or in "${e.expectedLocation}".
95
+
96
+ ${Cr("engine-not-found-bundler-investigation")}
97
+
98
+ ${ve(e)}`}function Rs(e){let{runtimeBinaryTarget:t,generatorBinaryTargets:r}=e,n=r.find(i=>i.native);return`${Ee(e)}
99
+
100
+ This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${t}".
101
+ ${Sr(e)}
102
+
103
+ ${ve(e)}`}function Os(e){let{queryEngineName:t}=e;return`${Ee(e)}${Ar(e)}
104
+
105
+ This is likely caused by tooling that has not copied "${t}" to the deployment folder.
106
+ Ensure that you ran \`prisma generate\` and that "${t}" has been copied to "${e.expectedLocation}".
107
+
108
+ ${Cr("engine-not-found-tooling-investigation")}
109
+
110
+ ${ve(e)}`}var Tp=C("prisma:client:engines:resolveEnginePath"),Sp=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function _s(e,t){let r={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??t.prismaPath;if(r!==void 0)return r;let{enginePath:n,searchedLocations:i}=await Cp(e,t);if(Tp("enginePath",n),n!==void 0)return t.prismaPath=n;let o=await Ce(),s=t.generator?.binaryTargets??[],a=s.some(m=>m.native),l=!s.some(m=>m.value===o),u=__filename.match(Sp())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:t.generator,runtimeBinaryTarget:o,queryEngineName:Fs(e,o),expectedLocation:kt.default.relative(process.cwd(),t.dirname),errorStack:new Error().stack},p;throw a&&l?p=Rs(c):l?p=Cs(c):u?p=As(c):p=Os(c),new ks.PrismaClientInitializationError(p,t.clientVersion)}async function Cp(e,t){let r=await Ce(),n=[],i=[t.dirname,kt.default.resolve(__dirname,".."),t.generator?.output?.value??__dirname,kt.default.resolve(__dirname,"../../../.prisma/client"),"/tmp/prisma-engines",t.cwd];__filename.includes("resolveEnginePath")&&i.push(ki());for(let o of i){let s=Fs(e,r),a=kt.default.join(o,s);if(n.push(o),Ds.default.existsSync(a))return{enginePath:a,searchedLocations:n}}return{enginePath:void 0,searchedLocations:n}}function Fs(e,t){return e==="library"?Mt(t,"fs"):`query-engine-${t}${t==="windows"?".exe":""}`}var In=Symbol("PrismaLibraryEngineCache");function Ap(){let e=globalThis;return e[In]===void 0&&(e[In]={}),e[In]}function Rp(e){let t=Ap();if(t[e]!==void 0)return t[e];let r=Ls.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=Ln.default.constants.dlopen.RTLD_LAZY|Ln.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,r,i),t[e]=n.exports,n.exports}var Ms={async loadLibrary(e){let t=await Gr(),r=await _s("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>Rp(r))}catch(n){let i=tn({e:n,platformInfo:t,id:r});throw new Is.PrismaClientInitializationError(i,e.clientVersion)}}};var Rr=require("@prisma/client-runtime-utils");var Mn,$s={async loadLibrary(e){let{clientVersion:t,adapter:r,engineWasm:n}=e;if(r===void 0)throw new Rr.PrismaClientInitializationError(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Pr().prettyName})`,t);if(n===void 0)throw new Rr.PrismaClientInitializationError("WASM engine was unexpectedly `undefined`",t);Mn===void 0&&(Mn=(async()=>{let o=await n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new Rr.PrismaClientInitializationError("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let a={"./query_engine_bg.js":o},l=new WebAssembly.Instance(s,a),u=l.exports.__wbindgen_start;return o.__wbg_set_wasm(l.exports),u(),o.QueryEngine})());let i=await Mn;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var Op="P2036",ee=C("prisma:client:libraryEngine");function kp(e){return e.item_type==="query"&&"query"in e}function Dp(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var Ns=[...qr,"native"],_p=0xffffffffffffffffn,$n=1n;function Fp(){let e=$n++;return $n>_p&&($n=1n),e}var et=class{name="LibraryEngine";engine;libraryInstantiationPromise;libraryStartingPromise;libraryStoppingPromise;libraryStarted;executingQueryPromise;config;QueryEngineConstructor;libraryLoader;library;logEmitter;libQueryEnginePath;binaryTarget;datasourceOverrides;datamodel;logQueries;logLevel;lastQuery;loggerRustPanic;tracingHelper;adapterPromise;versionInfo;constructor(t,r){this.libraryLoader=r??Ms,t.engineWasm!==void 0&&(this.libraryLoader=r??$s),this.config=t,this.libraryStarted=!1,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");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}wrapEngine(t){return{commitTransaction:this.withRequestId(t.commitTransaction.bind(t)),connect:this.withRequestId(t.connect.bind(t)),disconnect:this.withRequestId(t.disconnect.bind(t)),metrics:t.metrics?.bind(t),query:this.withRequestId(t.query.bind(t)),rollbackTransaction:this.withRequestId(t.rollbackTransaction.bind(t)),sdlSchema:t.sdlSchema?.bind(t),startTransaction:this.withRequestId(t.startTransaction.bind(t)),trace:t.trace.bind(t),free:t.free?.bind(t)}}withRequestId(t){return async(...r)=>{let n=Fp().toString();try{return await t(...r,n)}finally{if(this.tracingHelper.isEnabled()){let i=await this.engine?.trace(n);if(i){let o=JSON.parse(i);this.tracingHelper.dispatchEngineSpans(o.spans)}}}}}async transaction(t,r,n){await this.start();let i=await this.adapterPromise,o=JSON.stringify(r),s;if(t==="start"){let l=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});s=await this.engine?.startTransaction(l,o)}else t==="commit"?s=await this.engine?.commitTransaction(n.id,o):t==="rollback"&&(s=await this.engine?.rollbackTransaction(n.id,o));let a=this.parseEngineResponse(s);if(Ip(a)){let l=this.getExternalAdapterError(a,i?.errorRegistry);throw l?l.error:new D.PrismaClientKnownRequestError(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta})}else if(typeof a.message=="string")throw new D.PrismaClientUnknownRequestError(a.message,{clientVersion:this.config.clientVersion});return a}async instantiateLibrary(){if(ee("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;jr(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let t=await this.tracingHelper.runInChildSpan("detect_platform",()=>Ce());if(!Ns.includes(t))throw new D.PrismaClientInitializationError(`Unknown ${B("PRISMA_QUERY_ENGINE_LIBRARY")} ${B(_(t))}. Possible binaryTargets: ${pe(Ns.join(", "))} or a path to the query engine library.
111
+ You may have to run ${pe("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return t}}parseEngineResponse(t){if(!t)throw new D.PrismaClientUnknownRequestError("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new D.PrismaClientUnknownRequestError("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new WeakRef(this);this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(vr));let r=await this.adapterPromise;r&&ee("Using driver adapter: %O",r),this.engine=this.wrapEngine(new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json",enableTracing:this.tracingHelper.isEnabled()},n=>{t.deref()?.logger(n)},r))}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new D.PrismaClientInitializationError(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);r&&(r.level=r?.level.toLowerCase()??"unknown",kp(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):Dp(r)?this.loggerRustPanic=new D.PrismaClientRustPanicError(Nn(this,`${r.message}: ${r.reason} in ${r.file}:${r.line}:${r.column}`),this.config.clientVersion):this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path}))}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(this.libraryInstantiationPromise||(this.libraryInstantiationPromise=this.instantiateLibrary()),await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return ee(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{ee("library starting");try{let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(vr)),await this.adapterPromise,ee("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new D.PrismaClientInitializationError(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryInstantiationPromise,await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return ee("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted){await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0;return}let t=async()=>{await new Promise(n=>setImmediate(n)),ee("library stopping");let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.engine?.free&&this.engine.free(),this.engine=void 0,this.libraryStarted=!1,this.libraryStoppingPromise=void 0,this.libraryInstantiationPromise=void 0,await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0,ee("library stopped")};return this.libraryStoppingPromise=this.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){ee(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start();let s=await this.adapterPromise;this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let a=this.parseEngineResponse(await this.executingQueryPromise);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],s?.errorRegistry):new D.PrismaClientUnknownRequestError(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a}}catch(s){if(s instanceof D.PrismaClientInitializationError)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new D.PrismaClientRustPanicError(Nn(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new D.PrismaClientUnknownRequestError(`${a.message}
112
+ ${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){ee("requestBatch");let i=hs(t,r);await this.start();let o=await this.adapterPromise;this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine?.query(this.lastQuery,JSON.stringify({traceparent:n}),Ss(r));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],o?.errorRegistry):new D.PrismaClientUnknownRequestError(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});let{batchResult:l,errors:u}=a;if(Array.isArray(l))return l.map(c=>c.errors&&c.errors.length>0?this.loggerRustPanic??this.buildQueryError(c.errors[0],o?.errorRegistry):{data:c});throw u&&u.length===1?new Error(u[0].error):new Error(JSON.stringify(a))}buildQueryError(t,r){if(t.user_facing_error.is_panic)return new D.PrismaClientRustPanicError(Nn(this,t.user_facing_error.message),this.config.clientVersion);let n=this.getExternalAdapterError(t.user_facing_error,r);return n?n.error:Ts(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t,r){if(t.error_code===Op&&r){let n=t.meta?.id;Kt(typeof n=="number","Malformed external JS error received from the engine");let i=r.consumeError(n);return Kt(i,"External error with reported id was not registered"),i}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function Ip(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function Nn(e,t){return vs({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function js({url:e,adapter:t}){let r=[],n=[],i=p=>{let m=p.join(`
113
+ `);n.push({_tag:"error",value:m})},o=!!e?.startsWith("prisma://"),s=nn(e),a=!!t,l=o||s;a&&l&&i(["You've provided both a driver adapter and an Accelerate database URL. Driver adapters currently cannot connect to Accelerate.","Please provide either a driver adapter with a direct database URL or an Accelerate URL and no driver adapter."]);let u={accelerate:l,ppg:s,driverAdapters:a};function c(p){return p.length>0}return c(n)?{ok:!1,diagnostics:{warnings:r,errors:n},isUsing:u}:{ok:!0,diagnostics:{warnings:r},isUsing:u}}function Vs(e,t){let r;try{r=Ps({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}let{ok:n,isUsing:i,diagnostics:o}=js({url:r,adapter:t.adapter});for(let c of o.warnings)bt(...c.value);if(!n){let c=o.errors[0];throw new qs.PrismaClientValidationError(c.value,{clientVersion:t.clientVersion})}let s=dt(t.generator),a=s==="library",l=s==="client",u=(i.accelerate||i.ppg)&&!i.driverAdapters;return a?new et(t):new et(t)}function Bs({generator:e}){return e?.previewFeatures??[]}var Us=e=>({command:e});var Ys=require("@prisma/client-runtime-utils");var Ws=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);var Js=require("@prisma/client-runtime-utils");function tt(e){try{return Qs(e,"fast")}catch{return Qs(e,"slow")}}function Qs(e,t){return JSON.stringify(e.map(r=>Ks(r,t)))}function Ks(e,t){if(Array.isArray(e))return e.map(r=>Ks(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(je(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(Js.Decimal.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(Lp(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"?Hs(e):e}function Lp(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Hs(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Gs);let t={};for(let r of Object.keys(e))t[r]=Gs(e[r]);return t}function Gs(e){return typeof e=="bigint"?e.toString():Hs(e)}var Mp=/^(\s*alter\s)/i,zs=C("prisma:client");function jn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Mp.exec(t))throw new Error(`Running ALTER using ${n} is not supported
114
114
  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.
115
115
 
116
116
  Example:
117
117
  await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
118
118
 
119
119
  More Information: https://pris.ly/d/execute-raw
120
- `)}var Bn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(yr(r))n=r.sql,i={values:nt(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:nt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:nt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:nt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Js(r),i={values:nt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Xs(`prisma.${e}(${n}, ${i.values})`):Xs(`prisma.${e}(${n})`),{query:n,parameters:i}},ta={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new ea.Sql(t,r)}},ra={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Un(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=na(r(s)):na(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 na(e){return typeof e.then=="function"?e:Promise.resolve(e)}var qp=Xr.split(".")[0],Vp={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Qn=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${qp}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??Vp}};function ia(){return new Qn}function oa(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function sa(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 ua=require("@prisma/client-runtime-utils");function aa(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Wn(e.query.arguments)),t.push(Wn(e.query.selection)),t.join("")}function Wn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Wn(n)})`:r}).join(" ")})`}var Bp={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 Gn(e){return Bp[e]}var Or=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i<r.length;i++)r[i].reject(n);else for(let i=0;i<r.length;i++){let o=n[i];o instanceof Error?r[i].reject(o):r[i].resolve(o)}}).catch(n=>{for(let i=0;i<r.length;i++)r[i].reject(n)}))}}get[Symbol.toStringTag](){return"DataLoader"}};var la=require("@prisma/client-runtime-utils");function _e(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 la.Decimal(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"bigint-array":return t.map(r=>_e("bigint",r));case"bytes-array":return t.map(r=>_e("bytes",r));case"decimal-array":return t.map(r=>_e("decimal",r));case"datetime-array":return t.map(r=>_e("datetime",r));case"date-array":return t.map(r=>_e("date",r));case"time-array":return t.map(r=>_e("time",r));default:return t}}function kr(e){let t=[],r=Up(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]]=_e(e.types[s],i[s]);t.push(o)}return t}function Up(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var Qp=C("prisma:client:request_handler"),Dr=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new Or({batchLoader:ls(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=>Gn(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Wp(o),containsWrite:u,customDataProxyFetch:i})).map((p,m)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[m],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?ca(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Gn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:aa(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(Qp(t),Gp(t,i))throw t;if(t instanceof h.PrismaClientKnownRequestError&&Jp(t)){let u=pa(t.meta);cr({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=rr({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 h.PrismaClientKnownRequestError(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new h.PrismaClientRustPanicError(l,this.client._clientVersion);if(t instanceof h.PrismaClientUnknownRequestError)throw new h.PrismaClientUnknownRequestError(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof h.PrismaClientInitializationError)throw new h.PrismaClientInitializationError(l,this.client._clientVersion);if(t instanceof h.PrismaClientRustPanicError)throw new h.PrismaClientRustPanicError(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?je(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=On(o,s),l=i==="queryRaw"?kr(a):tt(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Wp(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:ca(e)};Re(e,"Unknown transaction kind")}}function ca(e){return{id:e.id,payload:e.payload}}function Gp(e,t){return(0,ua.hasBatchIndex)(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Jp(e){return e.code==="P2009"||e.code==="P2012"}function pa(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(pa)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var da=Fs;var ha=x(wn());var v=class extends Error{constructor(t){super(t+`
121
- Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};xn(v,"PrismaClientConstructorValidationError");var ma=["datasources","errorFormat","adapter","log","transactionOptions","omit","__internal"],fa=["pretty","colorless","minimal"],ga=["info","query","warn","error"],Kp={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new v(`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=it(r,t)||` Available datasources: ${t.join(", ")}`;throw new v(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new v(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
122
- 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 v(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
123
- It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new v(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor.
124
- It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&Ne(t.generator)==="client")throw new v('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e!==null){if(e===void 0)throw new v('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(Ne(t.generator)==="binary")throw new v('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')}},errorFormat:e=>{if(e){if(typeof e!="string")throw new v(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!fa.includes(e)){let t=it(e,fa);throw new v(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new v(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!ga.includes(r)){let n=it(r,ga);throw new v(`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=it(i,o);throw new v(`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 v(`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 v(`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 v(`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 v('"omit" option is expected to be an object.');if(e===null)throw new v('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=zp(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 v(Yp(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new v(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=it(r,t);throw new v(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ba(e,t){for(let[r,n]of Object.entries(e)){if(!ma.includes(r)){let i=it(r,ma);throw new v(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Kp[r](n,t)}}function it(e,t){if(t.length===0||typeof e!="string")return"";let r=Hp(e,t);return r?` Did you mean "${r}"?`:""}function Hp(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,ha.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 zp(e,t){return ya(t.models,e)??ya(t.types,e)}function ya(e,t){let r=Object.keys(e).find(n=>ce(n)===t);if(r)return e[r]}function Yp(e,t){let r=ze(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}=ur(r,"colorless");return`Error validating "omit" option:
120
+ `)}var qn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(yr(r))n=r.sql,i={values:tt(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:tt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:tt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:tt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Ws(r),i={values:tt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?zs(`prisma.${e}(${n}, ${i.values})`):zs(`prisma.${e}(${n})`),{query:n,parameters:i}},Zs={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new Ys.Sql(t,r)}},Xs={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Vn(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=ea(r(s)):ea(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 ea(e){return typeof e.then=="function"?e:Promise.resolve(e)}var $p=Xr.split(".")[0],Np={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Bn=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${$p}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??Np}};function ta(){return new Bn}function ra(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function na(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 sa=require("@prisma/client-runtime-utils");function ia(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Un(e.query.arguments)),t.push(Un(e.query.selection)),t.join("")}function Un(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Un(n)})`:r}).join(" ")})`}var jp={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 Wn(e){return jp[e]}var Or=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i<r.length;i++)r[i].reject(n);else for(let i=0;i<r.length;i++){let o=n[i];o instanceof Error?r[i].reject(o):r[i].resolve(o)}}).catch(n=>{for(let i=0;i<r.length;i++)r[i].reject(n)}))}}get[Symbol.toStringTag](){return"DataLoader"}};var oa=require("@prisma/client-runtime-utils");function _e(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 oa.Decimal(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"bigint-array":return t.map(r=>_e("bigint",r));case"bytes-array":return t.map(r=>_e("bytes",r));case"decimal-array":return t.map(r=>_e("decimal",r));case"datetime-array":return t.map(r=>_e("datetime",r));case"date-array":return t.map(r=>_e("date",r));case"time-array":return t.map(r=>_e("time",r));default:return t}}function kr(e){let t=[],r=qp(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]]=_e(e.types[s],i[s]);t.push(o)}return t}function qp(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var Vp=C("prisma:client:request_handler"),Dr=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new Or({batchLoader:os(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=>Wn(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Bp(o),containsWrite:u,customDataProxyFetch:i})).map((p,m)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[m],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?aa(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Wn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:ia(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(Vp(t),Up(t,i))throw t;if(t instanceof h.PrismaClientKnownRequestError&&Wp(t)){let u=la(t.meta);cr({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=rr({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 h.PrismaClientKnownRequestError(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new h.PrismaClientRustPanicError(l,this.client._clientVersion);if(t instanceof h.PrismaClientUnknownRequestError)throw new h.PrismaClientUnknownRequestError(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof h.PrismaClientInitializationError)throw new h.PrismaClientInitializationError(l,this.client._clientVersion);if(t instanceof h.PrismaClientRustPanicError)throw new h.PrismaClientRustPanicError(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?$e(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=An(o,s),l=i==="queryRaw"?kr(a):Xe(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Bp(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:aa(e)};Re(e,"Unknown transaction kind")}}function aa(e){return{id:e.id,payload:e.payload}}function Up(e,t){return(0,sa.hasBatchIndex)(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Wp(e){return e.code==="P2009"||e.code==="P2012"}function la(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(la)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var ua=ys;var fa=x(bn());var T=class extends Error{constructor(t){super(t+`
121
+ Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};hn(T,"PrismaClientConstructorValidationError");var ca=["datasources","errorFormat","adapter","log","transactionOptions","omit","__internal"],pa=["pretty","colorless","minimal"],da=["info","query","warn","error"],Qp={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new T(`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=rt(r,t)||` Available datasources: ${t.join(", ")}`;throw new T(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new T(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
122
+ 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 T(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
123
+ It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new T(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor.
124
+ It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&dt(t.generator)==="client")throw new T('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e!==null&&e===void 0)throw new T('"adapter" property must not be undefined, use null to conditionally disable driver adapters.')},errorFormat:e=>{if(e){if(typeof e!="string")throw new T(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!pa.includes(e)){let t=rt(e,pa);throw new T(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new T(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!da.includes(r)){let n=rt(r,da);throw new T(`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=rt(i,o);throw new T(`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 T(`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 T(`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 T(`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 T('"omit" option is expected to be an object.');if(e===null)throw new T('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Jp(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 T(Kp(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new T(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=rt(r,t);throw new T(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ga(e,t){for(let[r,n]of Object.entries(e)){if(!ca.includes(r)){let i=rt(r,ca);throw new T(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Qp[r](n,t)}}function rt(e,t){if(t.length===0||typeof e!="string")return"";let r=Gp(e,t);return r?` Did you mean "${r}"?`:""}function Gp(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,fa.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 Jp(e,t){return ma(t.models,e)??ma(t.types,e)}function ma(e,t){let r=Object.keys(e).find(n=>ce(n)===t);if(r)return e[r]}function Kp(e,t){let r=Ke(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}=ur(r,"colorless");return`Error validating "omit" option:
125
125
 
126
126
  ${i}
127
127
 
128
- ${n}`}var xa=require("@prisma/client-runtime-utils");function wa(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(!(0,xa.hasBatchIndex)(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var Pe=C("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Zp={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Xp=Symbol.for("prisma.client.transaction.id"),ed={id:0,nextId(){return++this.id}};function Ca(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_clientVersion;_errorFormat;_tracingHelper;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=Un();constructor(n){e=n?.__internal?.configOverride?.(e)??e,fs(e),n&&ba(n,e);let i=new Ta.EventEmitter().on("error",()=>{});this._extensions=Ye.empty(),this._previewFeatures=Ws(e),this._clientVersion=e.clientVersion??da,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=ia();let o=e.relativeEnvPaths&&{rootEnvPath:e.relativeEnvPaths.rootEnvPath&&_r.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&_r.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"||e.activeProvider==="cockroachdb"?"postgres":e.activeProvider;if(s.provider!==l)throw new h.PrismaClientInitializationError(`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)throw new h.PrismaClientInitializationError("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&&bt(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&C.enable("prisma:client");let p=_r.default.resolve(e.dirname,e.relativePath);Sa.default.existsSync(p)||(p=e.dirname),Pe("dirname",e.dirname),Pe("relativePath",e.relativePath),Pe("cwd",p);let m=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:m.allowTriggerPanic,prismaPath:m.binaryPath??void 0,engineEndpoint:m.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&sa(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(f=>typeof f=="string"?f==="query":f.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:gs(l),inlineDatasources:e.inlineDatasources,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},Pe("clientVersion",e.clientVersion),this._engine=Qs(e,this._engineConfig),this._requestHandler=new Dr(this,i),l.log)for(let f of l.log){let b=typeof f=="string"?f:f.emit==="stdout"?f.level:null;b&&this.$on(b,P=>{gt.log(`${gt.tags[b]??""}`,P.message||P.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=Ot(this)}get[Symbol.toStringTag](){return"PrismaClient"}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{li()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Bn({clientMethod:i,activeProvider:a}),callsite:we(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Ea(n,i);return Vn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new h.PrismaClientValidationError("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Vn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new h.PrismaClientValidationError(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Gs,callsite:we(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:Bn({clientMethod:i,activeProvider:a}),callsite:we(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",...Ea(n,i));throw new h.PrismaClientValidationError("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new h.PrismaClientValidationError("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=ed.nextId(),s=oa(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 wa(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 G(Ot(G(Zo(this),[M("_appliedParent",()=>this._appliedParent._createItxClient(n)),M("_createPrismaPromise",()=>Un(n)),M(Xp,()=>n.id)])),[Xe(ns)])}$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??Zp,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=async l=>{let{runInTransaction:u,args:c,...p}=l,m={...n,...p};c&&(m.args=i.middlewareArgsToRequestArgs(c)),n.transaction!==void 0&&u===!1&&delete m.transaction;let f=await as(this,m);return m.model?rs({result:f,modelName:m.model,args:m.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):f};return this._tracingHelper.runInChildSpan(s.operation,()=>new Pa.AsyncResource("prisma-client-request").runInAsyncScope(()=>a(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:m,customDataProxyFetch:f}){try{n=u?u(n):n;let b={name:"serialize"},P=this._tracingHelper.runInChildSpan(b,()=>fr({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 C.enabled("prisma:client")&&(Pe("Prisma Client call:"),Pe(`prisma.${i}(${Vo(n)})`),Pe("Generated request:"),Pe(JSON.stringify(P,null,2)+`
129
- `)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:P,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:m,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:f})}catch(b){throw b.clientVersion=this._clientVersion,b}}$metrics=new Ze(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$extends=Xo}return t}function Ea(e,t){return td(e)?[new va.Sql(e,t),ta]:[e,ra]}function td(e){return Array.isArray(e)&&Array.isArray(e.raw)}var rd=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Aa(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!rd.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}function Ra(e){bt(e,{conflictCheck:"warn"})}var h=require("@prisma/client-runtime-utils"),te=require("@prisma/client-runtime-utils"),F=require("@prisma/client-runtime-utils"),Oa=require("@prisma/client-runtime-utils");0&&(module.exports={AnyNull,DMMF,DbNull,Debug,Decimal,Extensions,JsonNull,MetricsClient,NullTypes,ObjectEnumValue,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,isAnyNull,isDbNull,isJsonNull,join,makeStrictEnum,makeTypedQueryFactory,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce});
128
+ ${n}`}var ya=require("@prisma/client-runtime-utils");function ha(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(!(0,ya.hasBatchIndex)(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var Pe=C("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Hp={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},zp=Symbol.for("prisma.client.transaction.id"),Yp={id:0,nextId(){return++this.id}};function Pa(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_clientVersion;_errorFormat;_tracingHelper;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=Vn();constructor(n){e=n?.__internal?.configOverride?.(e)??e,ps(e),n&&ga(n,e);let i=new Ea.EventEmitter().on("error",()=>{});this._extensions=He.empty(),this._previewFeatures=Bs(e),this._clientVersion=e.clientVersion??ua,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=ta();let o=e.relativeEnvPaths&&{rootEnvPath:e.relativeEnvPaths.rootEnvPath&&_r.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&_r.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"||e.activeProvider==="cockroachdb"?"postgres":e.activeProvider;if(s.provider!==l)throw new h.PrismaClientInitializationError(`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)throw new h.PrismaClientInitializationError("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&&ht(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&C.enable("prisma:client");let p=_r.default.resolve(e.dirname,e.relativePath);va.default.existsSync(p)||(p=e.dirname),Pe("dirname",e.dirname),Pe("relativePath",e.relativePath),Pe("cwd",p);let m=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:m.allowTriggerPanic,prismaPath:m.binaryPath??void 0,engineEndpoint:m.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&na(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(f=>typeof f=="string"?f==="query":f.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:ds(l),inlineDatasources:e.inlineDatasources,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},Pe("clientVersion",e.clientVersion),this._engine=Vs(e,this._engineConfig),this._requestHandler=new Dr(this,i),l.log)for(let f of l.log){let b=typeof f=="string"?f:f.emit==="stdout"?f.level:null;b&&this.$on(b,v=>{ft.log(`${ft.tags[b]??""}`,v.message||v.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=Rt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{si()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:qn({clientMethod:i,activeProvider:a}),callsite:we(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=ba(n,i);return jn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new h.PrismaClientValidationError("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(jn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new h.PrismaClientValidationError(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Us,callsite:we(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:qn({clientMethod:i,activeProvider:a}),callsite:we(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",...ba(n,i));throw new h.PrismaClientValidationError("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new h.PrismaClientValidationError("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Yp.nextId(),s=ra(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 ha(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 G(Rt(G(Ho(this),[M("_appliedParent",()=>this._appliedParent._createItxClient(n)),M("_createPrismaPromise",()=>Vn(n)),M(zp,()=>n.id)])),[Ye(es)])}$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??Hp,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=async l=>{let{runInTransaction:u,args:c,...p}=l,m={...n,...p};c&&(m.args=i.middlewareArgsToRequestArgs(c)),n.transaction!==void 0&&u===!1&&delete m.transaction;let f=await is(this,m);return m.model?Xo({result:f,modelName:m.model,args:m.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):f};return this._tracingHelper.runInChildSpan(s.operation,()=>new wa.AsyncResource("prisma-client-request").runInAsyncScope(()=>a(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:m,customDataProxyFetch:f}){try{n=u?u(n):n;let b={name:"serialize"},v=this._tracingHelper.runInChildSpan(b,()=>fr({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 C.enabled("prisma:client")&&(Pe("Prisma Client call:"),Pe(`prisma.${i}(${No(n)})`),Pe("Generated request:"),Pe(JSON.stringify(v,null,2)+`
129
+ `)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:v,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:m,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:f})}catch(b){throw b.clientVersion=this._clientVersion,b}}$metrics=new ze(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$extends=zo}return t}function ba(e,t){return Zp(e)?[new xa.Sql(e,t),Zs]:[e,Xs]}function Zp(e){return Array.isArray(e)&&Array.isArray(e.raw)}var Xp=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Ta(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Xp.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}function Sa(e){ht(e,{conflictCheck:"warn"})}var h=require("@prisma/client-runtime-utils"),te=require("@prisma/client-runtime-utils"),I=require("@prisma/client-runtime-utils"),Ca=require("@prisma/client-runtime-utils");0&&(module.exports={AnyNull,DMMF,DbNull,Debug,Decimal,Extensions,JsonNull,MetricsClient,NullTypes,ObjectEnumValue,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,isAnyNull,isDbNull,isJsonNull,join,makeStrictEnum,makeTypedQueryFactory,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce});
130
130
  //# sourceMappingURL=library.js.map