@prisma/client 6.19.0-integration-next.1 → 6.19.0-integration-next.2

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,4 +1,4 @@
1
- "use strict";var Rl=Object.create;var lt=Object.defineProperty;var Cl=Object.getOwnPropertyDescriptor;var Dl=Object.getOwnPropertyNames;var Il=Object.getPrototypeOf,Ol=Object.prototype.hasOwnProperty;var Li=(e,r)=>()=>(e&&(r=e(e=0)),r);var Q=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),De=(e,r)=>{for(var t in r)lt(e,t,{get:r[t],enumerable:!0})},Fi=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Dl(r))!Ol.call(e,i)&&i!==t&&lt(e,i,{get:()=>r[i],enumerable:!(n=Cl(r,i))||n.enumerable});return e};var P=(e,r,t)=>(t=e!=null?Rl(Il(e)):{},Fi(r||!e||!e.__esModule?lt(t,"default",{value:e,enumerable:!0}):t,e)),kl=e=>Fi(lt({},"__esModule",{value:!0}),e);var In=Q((hf,co)=>{"use strict";co.exports=(e,r=process.argv)=>{let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),i=r.indexOf("--");return n!==-1&&(i===-1||n<i)}});var fo=Q((bf,mo)=>{"use strict";var Ju=require("node:os"),po=require("node:tty"),K=In(),{env:k}=process,Pe;K("no-color")||K("no-colors")||K("color=false")||K("color=never")?Pe=0:(K("color")||K("colors")||K("color=true")||K("color=always"))&&(Pe=1);"FORCE_COLOR"in k&&(k.FORCE_COLOR==="true"?Pe=1:k.FORCE_COLOR==="false"?Pe=0:Pe=k.FORCE_COLOR.length===0?1:Math.min(parseInt(k.FORCE_COLOR,10),3));function On(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function kn(e,r){if(Pe===0)return 0;if(K("color=16m")||K("color=full")||K("color=truecolor"))return 3;if(K("color=256"))return 2;if(e&&!r&&Pe===void 0)return 0;let t=Pe||0;if(k.TERM==="dumb")return t;if(process.platform==="win32"){let n=Ju.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in k)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in k)||k.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in k)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(k.TEAMCITY_VERSION)?1:0;if(k.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in k){let n=parseInt((k.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(k.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(k.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(k.TERM)||"COLORTERM"in k?1:t}function Wu(e){let r=kn(e,e&&e.isTTY);return On(r)}mo.exports={supportsColor:Wu,stdout:On(kn(!0,po.isatty(1))),stderr:On(kn(!0,po.isatty(2)))}});var ho=Q((Ef,yo)=>{"use strict";var Ku=fo(),Je=In();function go(e){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e)||[];return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let r=(e||"").split(".").map(t=>parseInt(t,10));return{major:r[0],minor:r[1],patch:r[2]}}function _n(e){let{CI:r,FORCE_HYPERLINK:t,NETLIFY:n,TEAMCITY_VERSION:i,TERM_PROGRAM:o,TERM_PROGRAM_VERSION:s,VTE_VERSION:a,TERM:l}=process.env;if(t)return!(t.length>0&&parseInt(t,10)===0);if(Je("no-hyperlink")||Je("no-hyperlinks")||Je("hyperlink=false")||Je("hyperlink=never"))return!1;if(Je("hyperlink=true")||Je("hyperlink=always")||n)return!0;if(!Ku.supportsColor(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in process.env)return!0;if(process.platform==="win32"||r||i)return!1;if(o){let u=go(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=go(a);return u.major>0||u.minor>=50}switch(l){case"alacritty":return!0}return!1}yo.exports={supportsHyperlink:_n,stdout:_n(process.stdout),stderr:_n(process.stderr)}});var bo=Q((kf,Hu)=>{Hu.exports={name:"@prisma/internals",version:"6.19.0-integration-next.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 Mn=Q((qf,Zu)=>{Zu.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 vt=Q(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.enginesVersion=void 0;Pt.enginesVersion=Mn().prisma.enginesVersion});var Po=Q((Zf,wo)=>{"use strict";wo.exports=e=>{let r=e.match(/^[ \t]*(?=\S)/gm);return r?r.reduce((t,n)=>Math.min(t,n.length),1/0):0}});var Bn=Q((tg,So)=>{"use strict";So.exports=(e,r=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof r!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``);if(typeof t.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(r===0)return e;let n=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,t.indent.repeat(r))}});var Co=Q((pg,cc)=>{cc.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 _o=Q((mg,ce)=>{"use strict";var Kn=require("node:fs"),Hn=require("node:path"),pc=require("node:os"),mc=require("node:crypto"),dc=Co(),Io=dc.version,fc=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function gc(e){let r={},t=e.toString();t=t.replace(/\r\n?/mg,`
1
+ "use strict";var Rl=Object.create;var lt=Object.defineProperty;var Cl=Object.getOwnPropertyDescriptor;var Dl=Object.getOwnPropertyNames;var Il=Object.getPrototypeOf,Ol=Object.prototype.hasOwnProperty;var Li=(e,r)=>()=>(e&&(r=e(e=0)),r);var Q=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),De=(e,r)=>{for(var t in r)lt(e,t,{get:r[t],enumerable:!0})},Fi=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Dl(r))!Ol.call(e,i)&&i!==t&&lt(e,i,{get:()=>r[i],enumerable:!(n=Cl(r,i))||n.enumerable});return e};var P=(e,r,t)=>(t=e!=null?Rl(Il(e)):{},Fi(r||!e||!e.__esModule?lt(t,"default",{value:e,enumerable:!0}):t,e)),kl=e=>Fi(lt({},"__esModule",{value:!0}),e);var In=Q((hf,co)=>{"use strict";co.exports=(e,r=process.argv)=>{let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),i=r.indexOf("--");return n!==-1&&(i===-1||n<i)}});var fo=Q((bf,mo)=>{"use strict";var Ju=require("node:os"),po=require("node:tty"),K=In(),{env:k}=process,Pe;K("no-color")||K("no-colors")||K("color=false")||K("color=never")?Pe=0:(K("color")||K("colors")||K("color=true")||K("color=always"))&&(Pe=1);"FORCE_COLOR"in k&&(k.FORCE_COLOR==="true"?Pe=1:k.FORCE_COLOR==="false"?Pe=0:Pe=k.FORCE_COLOR.length===0?1:Math.min(parseInt(k.FORCE_COLOR,10),3));function On(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function kn(e,r){if(Pe===0)return 0;if(K("color=16m")||K("color=full")||K("color=truecolor"))return 3;if(K("color=256"))return 2;if(e&&!r&&Pe===void 0)return 0;let t=Pe||0;if(k.TERM==="dumb")return t;if(process.platform==="win32"){let n=Ju.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in k)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in k)||k.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in k)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(k.TEAMCITY_VERSION)?1:0;if(k.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in k){let n=parseInt((k.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(k.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(k.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(k.TERM)||"COLORTERM"in k?1:t}function Wu(e){let r=kn(e,e&&e.isTTY);return On(r)}mo.exports={supportsColor:Wu,stdout:On(kn(!0,po.isatty(1))),stderr:On(kn(!0,po.isatty(2)))}});var ho=Q((Ef,yo)=>{"use strict";var Ku=fo(),Je=In();function go(e){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e)||[];return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let r=(e||"").split(".").map(t=>parseInt(t,10));return{major:r[0],minor:r[1],patch:r[2]}}function _n(e){let{CI:r,FORCE_HYPERLINK:t,NETLIFY:n,TEAMCITY_VERSION:i,TERM_PROGRAM:o,TERM_PROGRAM_VERSION:s,VTE_VERSION:a,TERM:l}=process.env;if(t)return!(t.length>0&&parseInt(t,10)===0);if(Je("no-hyperlink")||Je("no-hyperlinks")||Je("hyperlink=false")||Je("hyperlink=never"))return!1;if(Je("hyperlink=true")||Je("hyperlink=always")||n)return!0;if(!Ku.supportsColor(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in process.env)return!0;if(process.platform==="win32"||r||i)return!1;if(o){let u=go(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=go(a);return u.major>0||u.minor>=50}switch(l){case"alacritty":return!0}return!1}yo.exports={supportsHyperlink:_n,stdout:_n(process.stdout),stderr:_n(process.stderr)}});var bo=Q((kf,Hu)=>{Hu.exports={name:"@prisma/internals",version:"6.19.0-integration-next.2",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 Mn=Q((qf,Zu)=>{Zu.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 vt=Q(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.enginesVersion=void 0;Pt.enginesVersion=Mn().prisma.enginesVersion});var Po=Q((Zf,wo)=>{"use strict";wo.exports=e=>{let r=e.match(/^[ \t]*(?=\S)/gm);return r?r.reduce((t,n)=>Math.min(t,n.length),1/0):0}});var Bn=Q((tg,So)=>{"use strict";So.exports=(e,r=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof r!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``);if(typeof t.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(r===0)return e;let n=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,t.indent.repeat(r))}});var Co=Q((pg,cc)=>{cc.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 _o=Q((mg,ce)=>{"use strict";var Kn=require("node:fs"),Hn=require("node:path"),pc=require("node:os"),mc=require("node:crypto"),dc=Co(),Io=dc.version,fc=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function gc(e){let r={},t=e.toString();t=t.replace(/\r\n?/mg,`
2
2
  `);let n;for(;(n=fc.exec(t))!=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
3
  `),o=o.replace(/\\r/g,"\r")),r[i]=o}return r}function yc(e){let r=ko(e),t=O.configDotenv({path:r});if(!t.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=Oo(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=bc(t,a);o=O.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return O.parse(o)}function hc(e){console.log(`[dotenv@${Io}][WARN] ${e}`)}function kr(e){console.log(`[dotenv@${Io}][DEBUG] ${e}`)}function Oo(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 bc(e,r){let t;try{t=new URL(r)}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=t.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=t.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 ko(e){let r=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let t of e.path)Kn.existsSync(t)&&(r=t.endsWith(".vault")?t:`${t}.vault`);else r=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else r=Hn.resolve(process.cwd(),".env.vault");return Kn.existsSync(r)?r:null}function Do(e){return e[0]==="~"?Hn.join(pc.homedir(),e.slice(1)):e}function Ec(e){!!(e&&e.debug)&&kr("Loading env from encrypted .env.vault");let t=O._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),O.populate(n,t,e),{parsed:t}}function xc(e){let r=Hn.resolve(process.cwd(),".env"),t="utf8",n=!!(e&&e.debug);e&&e.encoding?t=e.encoding:n&&kr("No encoding is specified. UTF-8 is used by default");let i=[r];if(e&&e.path)if(!Array.isArray(e.path))i=[Do(e.path)];else{i=[];for(let l of e.path)i.push(Do(l))}let o,s={};for(let l of i)try{let u=O.parse(Kn.readFileSync(l,{encoding:t}));O.populate(s,u,e)}catch(u){n&&kr(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),O.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function wc(e){if(Oo(e).length===0)return O.configDotenv(e);let r=ko(e);return r?O._configVault(e):(hc(`You set DOTENV_KEY but you are missing a .env.vault file at ${r}. Did you forget to build it?`),O.configDotenv(e))}function Pc(e,r){let t=Buffer.from(r.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=mc.createDecipheriv("aes-256-gcm",t,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 vc(e,r,t={}){let n=!!(t&&t.debug),i=!!(t&&t.override);if(typeof r!="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(r))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=r[o]),n&&kr(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=r[o]}var O={configDotenv:xc,_configVault:Ec,_parseVault:yc,config:wc,decrypt:Pc,parse:gc,populate:vc};ce.exports.configDotenv=O.configDotenv;ce.exports._configVault=O._configVault;ce.exports._parseVault=O._parseVault;ce.exports.config=O.config;ce.exports.decrypt=O.decrypt;ce.exports.parse=O.parse;ce.exports.populate=O.populate;ce.exports=O});var No=Q((bg,Ct)=>{"use strict";Ct.exports=(e={})=>{let r;if(e.repoUrl)r=e.repoUrl;else if(e.user&&e.repo)r=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let t=new URL(`${r}/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(",")}t.searchParams.set(i,o)}}return t.toString()};Ct.exports.default=Ct.exports});var ei=Q((gy,Qo)=>{"use strict";Qo.exports=function(){function e(r,t,n,i,o){return r<t||n<t?r>n?n+1:r+1:i===o?t:t+1}return function(r,t){if(r===t)return 0;if(r.length>t.length){var n=r;r=t,t=n}for(var i=r.length,o=t.length;i>0&&r.charCodeAt(i-1)===t.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&r.charCodeAt(s)===t.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,u,c,p,m,f,h,E,j,de,I,C,G=[];for(l=0;l<i;l++)G.push(l+1),G.push(r.charCodeAt(s+l));for(var Be=G.length-1;a<o-3;)for(j=t.charCodeAt(s+(u=a)),de=t.charCodeAt(s+(c=a+1)),I=t.charCodeAt(s+(p=a+2)),C=t.charCodeAt(s+(m=a+3)),f=a+=4,l=0;l<Be;l+=2)h=G[l],E=G[l+1],u=e(h,u,c,j,E),c=e(u,c,p,de,E),p=e(c,p,m,I,E),f=e(p,m,f,C,E),G[l]=f,m=p,p=c,c=u,u=h;for(;a<o;)for(j=t.charCodeAt(s+(u=a)),f=++a,l=0;l<Be;l+=2)h=G[l],G[l]=f=e(h,u,f,j,G[l+1]),u=h;return f}}()});var Yo=Li(()=>{"use strict"});var zo=Li(()=>{"use strict"});var od={};De(od,{AnyNull:()=>N.AnyNull,DMMF:()=>Fr,DbNull:()=>N.DbNull,Debug:()=>v,Decimal:()=>vl.Decimal,Extensions:()=>yn,JsonNull:()=>N.JsonNull,MetricsClient:()=>ar,NullTypes:()=>N.NullTypes,ObjectEnumValue:()=>N.ObjectEnumValue,PrismaClientInitializationError:()=>g.PrismaClientInitializationError,PrismaClientKnownRequestError:()=>g.PrismaClientKnownRequestError,PrismaClientRustPanicError:()=>g.PrismaClientRustPanicError,PrismaClientUnknownRequestError:()=>g.PrismaClientUnknownRequestError,PrismaClientValidationError:()=>g.PrismaClientValidationError,Public:()=>hn,Sql:()=>oe.Sql,createParam:()=>gs,defineDmmfProperty:()=>Ps,deserializeJsonResponse:()=>mr,deserializeRawResult:()=>mn,dmmfToRuntimeDataModel:()=>ji,empty:()=>oe.empty,getPrismaClient:()=>xl,getRuntime:()=>sn,isAnyNull:()=>N.isAnyNull,isDbNull:()=>N.isDbNull,isJsonNull:()=>N.isJsonNull,join:()=>oe.join,makeStrictEnum:()=>wl,makeTypedQueryFactory:()=>vs,raw:()=>oe.raw,serializeJsonQuery:()=>Jt,skip:()=>Qt,sqltag:()=>oe.sql,warnEnvConflicts:()=>Pl,warnOnce:()=>Lr});module.exports=kl(od);var yn={};De(yn,{defineExtension:()=>Mi,getExtensionContext:()=>Ni});function Mi(e){return typeof e=="function"?e:r=>r.$extends(e)}function Ni(e){return e}var hn={};De(hn,{validator:()=>$i});function $i(...e){return r=>r}var z=class{_map=new Map;get(r){return this._map.get(r)?.value}set(r,t){this._map.set(r,{value:t})}getOrCreate(r,t){let n=this._map.get(r);if(n)return n.value;let i=t();return this.set(r,i),i}};function ge(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function qi(e,r){let t={};for(let n of e){let i=n[r];t[i]=n}return t}function wr(e){let r;return{get(){return r||(r={value:e()}),r.value}}}function ji(e){return{models:bn(e.models),enums:bn(e.enums),types:bn(e.types)}}function bn(e){let r={};for(let{name:t,...n}of e)r[t]=n;return r}var Te=require("@prisma/client-runtime-utils");var ut={};De(ut,{$:()=>Qi,bgBlack:()=>Bl,bgBlue:()=>Jl,bgCyan:()=>Kl,bgGreen:()=>Gl,bgMagenta:()=>Wl,bgRed:()=>Ul,bgWhite:()=>Hl,bgYellow:()=>Ql,black:()=>$l,blue:()=>Ie,bold:()=>F,cyan:()=>le,dim:()=>se,gray:()=>Pr,green:()=>ye,grey:()=>Vl,hidden:()=>Ml,inverse:()=>Fl,italic:()=>Ll,magenta:()=>ql,red:()=>J,reset:()=>_l,strikethrough:()=>Nl,underline:()=>M,white:()=>jl,yellow:()=>ae});var En,Vi,Bi,Ui,Gi=!0;typeof process<"u"&&({FORCE_COLOR:En,NODE_DISABLE_COLORS:Vi,NO_COLOR:Bi,TERM:Ui}=process.env||{},Gi=process.stdout&&process.stdout.isTTY);var Qi={enabled:!Vi&&Bi==null&&Ui!=="dumb"&&(En!=null&&En!=="0"||Gi)};function T(e,r){let t=new RegExp(`\\x1b\\[${r}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${r}m`;return function(o){return!Qi.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(t,i+n):o)+i}}var _l=T(0,0),F=T(1,22),se=T(2,22),Ll=T(3,23),M=T(4,24),Fl=T(7,27),Ml=T(8,28),Nl=T(9,29),$l=T(30,39),J=T(31,39),ye=T(32,39),ae=T(33,39),Ie=T(34,39),ql=T(35,39),le=T(36,39),jl=T(37,39),Pr=T(90,39),Vl=T(90,39),Bl=T(40,49),Ul=T(41,49),Gl=T(42,49),Ql=T(43,49),Jl=T(44,49),Wl=T(45,49),Kl=T(46,49),Hl=T(47,49);var Yl=100,Ji=["green","yellow","blue","magenta","cyan","red"],vr=[],Wi=Date.now(),zl=0,xn=typeof process<"u"?process.env:{};globalThis.DEBUG??=xn.DEBUG??"";globalThis.DEBUG_COLORS??=xn.DEBUG_COLORS?xn.DEBUG_COLORS==="true":!0;var Tr={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let r=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),t=r.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=r.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return t&&!n},log:(...e)=>{let[r,t,...n]=e;(console.warn??console.log)(`${r} ${t}`,...n)},formatters:{}};function Xl(e){let r={color:Ji[zl++%Ji.length],enabled:Tr.enabled(e),namespace:e,log:Tr.log,extend:()=>{}},t=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=r;if(n.length!==0&&vr.push([o,...n]),vr.length>Yl&&vr.shift(),Tr.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Zl(c)),u=`+${Date.now()-Wi}ms`;Wi=Date.now(),globalThis.DEBUG_COLORS?a(ut[s](F(o)),...l,ut[s](u)):a(o,...l,u)}};return new Proxy(t,{get:(n,i)=>r[i],set:(n,i,o)=>r[i]=o})}var v=new Proxy(Xl,{get:(e,r)=>Tr[r],set:(e,r,t)=>Tr[r]=t});function Zl(e,r=2){let t=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(t.has(i))return"[Circular *]";t.add(i)}else if(typeof i=="bigint")return i.toString();return i},r)}function Ki(e=7500){let r=vr.map(([t,...n])=>`${t} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
4
4
  `);return r.length<e?r:r.slice(-e)}function Hi(){vr.length=0}var Ue=v;var Yi=P(require("node:fs"));function wn(){let e=process.env.PRISMA_QUERY_ENGINE_LIBRARY;if(!(e&&Yi.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 Pn=["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 ct="libquery_engine";function pt(e,r){let t=r==="url";return e.includes("windows")?t?"query_engine.dll.node":`query_engine-${e}.dll.node`:e.includes("darwin")?t?`${ct}.dylib.node`:`${ct}-${e}.dylib.node`:t?`${ct}.so.node`:`${ct}-${e}.so.node`}var eo=P(require("node:child_process")),Rn=P(require("node:fs/promises")),yt=P(require("node:os"));var ue=Symbol.for("@ts-pattern/matcher"),eu=Symbol.for("@ts-pattern/isVariadic"),dt="@ts-pattern/anonymous-select-key",vn=e=>!!(e&&typeof e=="object"),mt=e=>e&&!!e[ue],ee=(e,r,t)=>{if(mt(e)){let n=e[ue](),{matched:i,selections:o}=n.match(r);return i&&o&&Object.keys(o).forEach(s=>t(s,o[s])),i}if(vn(e)){if(!vn(r))return!1;if(Array.isArray(e)){if(!Array.isArray(r))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];mt(a)&&a[eu]?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(r.length<n.length+i.length)return!1;let s=r.slice(0,n.length),a=i.length===0?[]:r.slice(-i.length),l=r.slice(n.length,i.length===0?1/0:-i.length);return n.every((u,c)=>ee(u,s[c],t))&&i.every((u,c)=>ee(u,a[c],t))&&(o.length===0||ee(o[0],l,t))}return e.length===r.length&&e.every((s,a)=>ee(s,r[a],t))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in r||mt(o=i)&&o[ue]().matcherType==="optional")&&ee(i,r[n],t);var o})}return Object.is(r,e)},we=e=>{var r,t,n;return vn(e)?mt(e)?(r=(t=(n=e[ue]()).getSelectionKeys)==null?void 0:t.call(n))!=null?r:[]:Array.isArray(e)?Sr(e,we):Sr(Object.values(e),we):[]},Sr=(e,r)=>e.reduce((t,n)=>t.concat(r(n)),[]);function W(e){return Object.assign(e,{optional:()=>ru(e),and:r=>D(e,r),or:r=>tu(e,r),select:r=>r===void 0?zi(e):zi(r,e)})}function ru(e){return W({[ue]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return r===void 0?(we(e).forEach(i=>n(i,void 0)),{matched:!0,selections:t}):{matched:ee(e,r,n),selections:t}},getSelectionKeys:()=>we(e),matcherType:"optional"})})}function D(...e){return W({[ue]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return{matched:e.every(i=>ee(i,r,n)),selections:t}},getSelectionKeys:()=>Sr(e,we),matcherType:"and"})})}function tu(...e){return W({[ue]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return Sr(e,we).forEach(i=>n(i,void 0)),{matched:e.some(i=>ee(i,r,n)),selections:t}},getSelectionKeys:()=>Sr(e,we),matcherType:"or"})})}function x(e){return{[ue]:()=>({match:r=>({matched:!!e(r)})})}}function zi(...e){let r=typeof e[0]=="string"?e[0]:void 0,t=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return W({[ue]:()=>({match:n=>{let i={[r??dt]:n};return{matched:t===void 0||ee(t,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[r??dt].concat(t===void 0?[]:we(t))})})}function X(e){return typeof e=="number"}function he(e){return typeof e=="string"}function be(e){return typeof e=="bigint"}var Nd=W(x(function(e){return!0}));var Ee=e=>Object.assign(W(e),{startsWith:r=>{return Ee(D(e,(t=r,x(n=>he(n)&&n.startsWith(t)))));var t},endsWith:r=>{return Ee(D(e,(t=r,x(n=>he(n)&&n.endsWith(t)))));var t},minLength:r=>Ee(D(e,(t=>x(n=>he(n)&&n.length>=t))(r))),length:r=>Ee(D(e,(t=>x(n=>he(n)&&n.length===t))(r))),maxLength:r=>Ee(D(e,(t=>x(n=>he(n)&&n.length<=t))(r))),includes:r=>{return Ee(D(e,(t=r,x(n=>he(n)&&n.includes(t)))));var t},regex:r=>{return Ee(D(e,(t=r,x(n=>he(n)&&!!n.match(t)))));var t}}),$d=Ee(x(he)),Z=e=>Object.assign(W(e),{between:(r,t)=>Z(D(e,((n,i)=>x(o=>X(o)&&n<=o&&i>=o))(r,t))),lt:r=>Z(D(e,(t=>x(n=>X(n)&&n<t))(r))),gt:r=>Z(D(e,(t=>x(n=>X(n)&&n>t))(r))),lte:r=>Z(D(e,(t=>x(n=>X(n)&&n<=t))(r))),gte:r=>Z(D(e,(t=>x(n=>X(n)&&n>=t))(r))),int:()=>Z(D(e,x(r=>X(r)&&Number.isInteger(r)))),finite:()=>Z(D(e,x(r=>X(r)&&Number.isFinite(r)))),positive:()=>Z(D(e,x(r=>X(r)&&r>0))),negative:()=>Z(D(e,x(r=>X(r)&&r<0)))}),qd=Z(x(X)),xe=e=>Object.assign(W(e),{between:(r,t)=>xe(D(e,((n,i)=>x(o=>be(o)&&n<=o&&i>=o))(r,t))),lt:r=>xe(D(e,(t=>x(n=>be(n)&&n<t))(r))),gt:r=>xe(D(e,(t=>x(n=>be(n)&&n>t))(r))),lte:r=>xe(D(e,(t=>x(n=>be(n)&&n<=t))(r))),gte:r=>xe(D(e,(t=>x(n=>be(n)&&n>=t))(r))),positive:()=>xe(D(e,x(r=>be(r)&&r>0))),negative:()=>xe(D(e,x(r=>be(r)&&r<0)))}),jd=xe(x(be)),Vd=W(x(function(e){return typeof e=="boolean"})),Bd=W(x(function(e){return typeof e=="symbol"})),Ud=W(x(function(e){return e==null})),Gd=W(x(function(e){return e!=null}));var Tn=class extends Error{constructor(r){let t;try{t=JSON.stringify(r)}catch{t=r}super(`Pattern matching error: no pattern matches value ${t}`),this.input=void 0,this.input=r}},Sn={matched:!1,value:void 0};function Ge(e){return new An(e,Sn)}var An=class e{constructor(r,t){this.input=void 0,this.state=void 0,this.input=r,this.state=t}with(...r){if(this.state.matched)return this;let t=r[r.length-1],n=[r[0]],i;r.length===3&&typeof r[1]=="function"?i=r[1]:r.length>2&&n.push(...r.slice(1,r.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>ee(u,this.input,a))||i&&!i(this.input)?Sn:{matched:!0,value:t(o?dt in s?s[dt]:s:this.input,this.input)};return new e(this.input,l)}when(r,t){if(this.state.matched)return this;let n=!!r(this.input);return new e(this.input,n?{matched:!0,value:t(this.input,this.input)}:Sn)}otherwise(r){return this.state.matched?this.state.value:r(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Tn(this.input)}run(){return this.exhaustive()}returnType(){return this}};var ro=require("node:util");var nu={warn:ae("prisma:warn")},iu={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function ft(e,...r){iu.warn()&&console.warn(`${nu.warn} ${e}`,...r)}var ou=(0,ro.promisify)(eo.default.exec),$=Ue("prisma:get-platform"),su=["1.0.x","1.1.x","3.0.x"];async function to(){let e=yt.default.platform(),r=process.arch;if(e==="freebsd"){let s=await ht("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:r}}}if(e!=="linux")return{platform:e,arch:r};let t=await lu(),n=await yu(),i=cu({arch:r,archFromUname:n,familyDistro:t.familyDistro}),{libssl:o}=await pu(i);return{platform:"linux",libssl:o,arch:r,archFromUname:n,...t}}function au(e){let r=/^ID="?([^"\n]*)"?$/im,t=/^ID_LIKE="?([^"\n]*)"?$/im,n=r.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=t.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=Ge({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 $(`Found distro info:
@@ -107,7 +107,7 @@ ${M(p)}
107
107
  If you want the Prisma team to look into it, please open the link above \u{1F64F}
108
108
  To increase the chance of success, please post your schema and a snippet of
109
109
  how you used Prisma Client in the issue.
110
- `}var ga=require("@prisma/client-runtime-utils");var um=require("@prisma/client-runtime-utils");function fa(e,r){throw new Error(r)}function cm(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function pm(e,r){let t={};for(let n of Object.keys(e))t[n]=r(e[n],n);return t}function mr(e){return e===null?e:Array.isArray(e)?e.map(mr):typeof e=="object"?cm(e)?mm(e):e.constructor!==null&&e.constructor.name!=="Object"?e:pm(e,mr):e}function mm({$type:e,value:r}){switch(e){case"BigInt":return BigInt(r);case"Bytes":{let{buffer:t,byteOffset:n,byteLength:i}=Buffer.from(r,"base64");return new Uint8Array(t,n,i)}case"DateTime":return new Date(r);case"Decimal":return new ga.Decimal(r);case"Json":return JSON.parse(r);default:fa(r,"Unknown tagged value")}}function di(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}function nn(e){return{ok:!0,value:e,map(r){return nn(r(e))},flatMap(r){return r(e)}}}function Me(e){return{ok:!1,error:e,map(){return Me(e)},flatMap(){return Me(e)}}}var ya=v("driver-adapter-utils"),fi=class{registeredErrors=[];consumeError(r){return this.registeredErrors[r]}registerNewError(r){let t=0;for(;this.registeredErrors[t]!==void 0;)t++;return this.registeredErrors[t]={error:r},t}};var on=(e,r=new fi)=>{let t={adapterName:e.adapterName,errorRegistry:r,queryRaw:pe(r,e.queryRaw.bind(e)),executeRaw:pe(r,e.executeRaw.bind(e)),executeScript:pe(r,e.executeScript.bind(e)),dispose:pe(r,e.dispose.bind(e)),provider:e.provider,startTransaction:async(...n)=>(await pe(r,e.startTransaction.bind(e))(...n)).map(o=>dm(r,o))};return e.getConnectionInfo&&(t.getConnectionInfo=fm(r,e.getConnectionInfo.bind(e))),t},dm=(e,r)=>({adapterName:r.adapterName,provider:r.provider,options:r.options,queryRaw:pe(e,r.queryRaw.bind(r)),executeRaw:pe(e,r.executeRaw.bind(r)),commit:pe(e,r.commit.bind(r)),rollback:pe(e,r.rollback.bind(r))});function pe(e,r){return async(...t)=>{try{return nn(await r(...t))}catch(n){if(ya("[error@wrapAsync]",n),di(n))return Me(n.cause);let i=e.registerNewError(n);return Me({kind:"GenericJs",id:i})}}}function fm(e,r){return(...t)=>{try{return nn(r(...t))}catch(n){if(ya("[error@wrapSync]",n),di(n))return Me(n.cause);let i=e.registerNewError(n);return Me({kind:"GenericJs",id:i})}}}var ha="6.19.0-integration-next.1";var gi=require("@prisma/client-runtime-utils");var ym=()=>globalThis.process?.release?.name==="node",hm=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,bm=()=>!!globalThis.Deno,Em=()=>typeof globalThis.Netlify=="object",xm=()=>typeof globalThis.EdgeRuntime=="object",wm=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Pm(){return[[Em,"netlify"],[xm,"edge-light"],[wm,"workerd"],[bm,"deno"],[hm,"bun"],[ym,"node"]].flatMap(t=>t[0]()?[t[1]]:[]).at(0)??""}var vm={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 sn(){let e=Pm();return{id:e,prettyName:vm[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}function dr({inlineDatasources:e,overrideDatasources:r,env:t,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=r[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=t[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new gi.PrismaClientInitializationError(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new gi.PrismaClientInitializationError("error: Missing URL environment variable, value, or override.",n);return i}var an=class extends Error{clientVersion;cause;constructor(r,t){super(r),this.clientVersion=t.clientVersion,this.cause=t.cause}get[Symbol.toStringTag](){return this.name}};var B=class extends an{isRetryable;constructor(r,t){super(r,t),this.isRetryable=t.isRetryable??!0}};function b(e,r){return{...e,isRetryable:r}}var Ne=class extends B{name="InvalidDatasourceError";code="P6001";constructor(r,t){super(r,b(t,!1))}};y(Ne,"InvalidDatasourceError");function ba(e){let r={clientVersion:e.clientVersion},t=Object.keys(e.inlineDatasources)[0],n=dr({inlineDatasources:e.inlineDatasources,overrideDatasources:e.overrideDatasources,clientVersion:e.clientVersion,env:{...e.env,...typeof process<"u"?process.env:{}}}),i;try{i=new URL(n)}catch{throw new Ne(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r)}let{protocol:o,searchParams:s}=i;if(o!=="prisma:"&&o!==Tt)throw new Ne(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\` or \`prisma+postgres://\``,r);let a=s.get("api_key");if(a===null||a.length<1)throw new Ne(`Error validating datasource \`${t}\`: the URL must contain a valid API key`,r);let l=Vn(i)?"http:":"https:";process.env.TEST_CLIENT_ENGINE_REMOTE_EXECUTOR&&i.searchParams.has("use_http")&&(l="http:");let u=new URL(i.href.replace(o,l));return{apiKey:a,url:u}}var Ea=P(vt()),ln=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:r,tracingHelper:t,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=r,this.tracingHelper=t,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:r,transactionId:t}={}){let n={Accept:"application/json",Authorization:`Bearer ${this.apiKey}`,"Content-Type":"application/json","Prisma-Engine-Hash":this.engineHash,"Prisma-Engine-Version":Ea.enginesVersion};this.tracingHelper.isEnabled()&&(n.traceparent=r??this.tracingHelper.getTraceParent()),t&&(n["X-Transaction-Id"]=t);let i=this.#e();return i.length>0&&(n["X-Capture-Telemetry"]=i.join(", ")),n}#e(){let r=[];return this.tracingHelper.isEnabled()&&r.push("tracing"),this.logLevel&&r.push(this.logLevel),this.logQueries&&r.push("query"),r}};function Tm(e){return e[0]*1e3+e[1]/1e6}function yi(e){return new Date(Tm(e))}var Ca=require("@prisma/client-runtime-utils");var fr=class extends B{name="ForcedRetryError";code="P5001";constructor(r){super("This request must be retried",b(r,!0))}};y(fr,"ForcedRetryError");var $e=class extends B{name="NotImplementedYetError";code="P5004";constructor(r,t){super(r,b(t,!1))}};y($e,"NotImplementedYetError");var A=class extends B{response;constructor(r,t){super(r,t),this.response=t.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var qe=class extends A{name="SchemaMissingError";code="P5005";constructor(r){super("Schema needs to be uploaded",b(r,!0))}};y(qe,"SchemaMissingError");var un=require("@prisma/client-runtime-utils");var hi="This request could not be understood by the server",Wr=class extends A{name="BadRequestError";code="P5000";constructor(r,t,n){super(t||hi,b(r,!1)),n&&(this.code=n)}};y(Wr,"BadRequestError");var Kr=class extends A{name="HealthcheckTimeoutError";code="P5013";logs;constructor(r,t){super("Engine not started: healthcheck timeout",b(r,!0)),this.logs=t}};y(Kr,"HealthcheckTimeoutError");var Hr=class extends A{name="EngineStartupError";code="P5014";logs;constructor(r,t,n){super(t,b(r,!0)),this.logs=n}};y(Hr,"EngineStartupError");var Yr=class extends A{name="EngineVersionNotSupportedError";code="P5012";constructor(r){super("Engine version is not supported",b(r,!1))}};y(Yr,"EngineVersionNotSupportedError");var bi="Request timed out",zr=class extends A{name="GatewayTimeoutError";code="P5009";constructor(r,t=bi){super(t,b(r,!1))}};y(zr,"GatewayTimeoutError");var Sm="Interactive transaction error",Xr=class extends A{name="InteractiveTransactionError";code="P5015";constructor(r,t=Sm){super(t,b(r,!1))}};y(Xr,"InteractiveTransactionError");var Am="Request parameters are invalid",Zr=class extends A{name="InvalidRequestError";code="P5011";constructor(r,t=Am){super(t,b(r,!1))}};y(Zr,"InvalidRequestError");var Ei="Requested resource does not exist",et=class extends A{name="NotFoundError";code="P5003";constructor(r,t=Ei){super(t,b(r,!1))}};y(et,"NotFoundError");var xi="Unknown server error",gr=class extends A{name="ServerError";code="P5006";logs;constructor(r,t,n){super(t||xi,b(r,!0)),this.logs=n}};y(gr,"ServerError");var wi="Unauthorized, check your connection string",rt=class extends A{name="UnauthorizedError";code="P5007";constructor(r,t=wi){super(t,b(r,!1))}};y(rt,"UnauthorizedError");var Pi="Usage exceeded, retry again later",tt=class extends A{name="UsageExceededError";code="P5008";constructor(r,t=Pi){super(t,b(r,!0))}};y(tt,"UsageExceededError");async function Rm(e){let r;try{r=await e.text()}catch{return{type:"EmptyError"}}try{let t=JSON.parse(r);if(typeof t=="string")switch(t){case"InternalDataProxyError":return{type:"DataProxyError",body:t};default:return{type:"UnknownTextError",body:t}}if(typeof t=="object"&&t!==null){if("is_panic"in t&&"message"in t&&"error_code"in t)return{type:"QueryEngineError",body:t};if("EngineNotStarted"in t||"InteractiveTransactionMisrouted"in t||"InvalidRequestError"in t){let n=Object.values(t)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:t}:{type:"DataProxyError",body:t}}}return{type:"UnknownJsonError",body:t}}catch{return r===""?{type:"EmptyError"}:{type:"UnknownTextError",body:r}}}async function nt(e,r){if(e.ok)return;let t={clientVersion:r,response:e},n=await Rm(e);if(n.type==="QueryEngineError")throw new un.PrismaClientKnownRequestError(n.body.message,{code:n.body.error_code,clientVersion:r});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new gr(t,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new qe(t);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Yr(t);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Hr(t,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new un.PrismaClientInitializationError(i,r,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Kr(t,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Xr(t,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Zr(t,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new rt(t,yr(wi,n));if(e.status===404)return new et(t,yr(Ei,n));if(e.status===429)throw new tt(t,yr(Pi,n));if(e.status===504)throw new zr(t,yr(bi,n));if(e.status>=500)throw new gr(t,yr(xi,n));if(e.status>=400)throw new Wr(t,yr(hi,n))}function yr(e,r){return r.type==="EmptyError"?e:`${e}: ${JSON.stringify(r)}`}function xa(e){let r=Math.pow(2,e)*50,t=Math.ceil(Math.random()*r)-Math.ceil(r/2),n=r+t;return new Promise(i=>setTimeout(()=>i(n),n))}var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function wa(e){let r=new TextEncoder().encode(e),t="",n=r.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=r[p]<<16|r[p+1]<<8|r[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,t+=me[s]+me[a]+me[l]+me[u];return i==1?(c=r[o],s=(c&252)>>2,a=(c&3)<<4,t+=me[s]+me[a]+"=="):i==2&&(c=r[o]<<8|r[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,t+=me[s]+me[a]+me[l]+"="),t}var Pa=require("@prisma/client-runtime-utils");function va(e){if(!!e.generator?.previewFeatures.some(t=>t.toLowerCase().includes("metrics")))throw new Pa.PrismaClientInitializationError("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}var Ta={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var it=class extends B{name="RequestError";code="P5010";constructor(r,t){super(`Cannot fetch data from service:
110
+ `}var ga=require("@prisma/client-runtime-utils");var um=require("@prisma/client-runtime-utils");function fa(e,r){throw new Error(r)}function cm(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function pm(e,r){let t={};for(let n of Object.keys(e))t[n]=r(e[n],n);return t}function mr(e){return e===null?e:Array.isArray(e)?e.map(mr):typeof e=="object"?cm(e)?mm(e):e.constructor!==null&&e.constructor.name!=="Object"?e:pm(e,mr):e}function mm({$type:e,value:r}){switch(e){case"BigInt":return BigInt(r);case"Bytes":{let{buffer:t,byteOffset:n,byteLength:i}=Buffer.from(r,"base64");return new Uint8Array(t,n,i)}case"DateTime":return new Date(r);case"Decimal":return new ga.Decimal(r);case"Json":return JSON.parse(r);default:fa(r,"Unknown tagged value")}}function di(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}function nn(e){return{ok:!0,value:e,map(r){return nn(r(e))},flatMap(r){return r(e)}}}function Me(e){return{ok:!1,error:e,map(){return Me(e)},flatMap(){return Me(e)}}}var ya=v("driver-adapter-utils"),fi=class{registeredErrors=[];consumeError(r){return this.registeredErrors[r]}registerNewError(r){let t=0;for(;this.registeredErrors[t]!==void 0;)t++;return this.registeredErrors[t]={error:r},t}};var on=(e,r=new fi)=>{let t={adapterName:e.adapterName,errorRegistry:r,queryRaw:pe(r,e.queryRaw.bind(e)),executeRaw:pe(r,e.executeRaw.bind(e)),executeScript:pe(r,e.executeScript.bind(e)),dispose:pe(r,e.dispose.bind(e)),provider:e.provider,startTransaction:async(...n)=>(await pe(r,e.startTransaction.bind(e))(...n)).map(o=>dm(r,o))};return e.getConnectionInfo&&(t.getConnectionInfo=fm(r,e.getConnectionInfo.bind(e))),t},dm=(e,r)=>({adapterName:r.adapterName,provider:r.provider,options:r.options,queryRaw:pe(e,r.queryRaw.bind(r)),executeRaw:pe(e,r.executeRaw.bind(r)),commit:pe(e,r.commit.bind(r)),rollback:pe(e,r.rollback.bind(r))});function pe(e,r){return async(...t)=>{try{return nn(await r(...t))}catch(n){if(ya("[error@wrapAsync]",n),di(n))return Me(n.cause);let i=e.registerNewError(n);return Me({kind:"GenericJs",id:i})}}}function fm(e,r){return(...t)=>{try{return nn(r(...t))}catch(n){if(ya("[error@wrapSync]",n),di(n))return Me(n.cause);let i=e.registerNewError(n);return Me({kind:"GenericJs",id:i})}}}var ha="6.19.0-integration-next.2";var gi=require("@prisma/client-runtime-utils");var ym=()=>globalThis.process?.release?.name==="node",hm=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,bm=()=>!!globalThis.Deno,Em=()=>typeof globalThis.Netlify=="object",xm=()=>typeof globalThis.EdgeRuntime=="object",wm=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Pm(){return[[Em,"netlify"],[xm,"edge-light"],[wm,"workerd"],[bm,"deno"],[hm,"bun"],[ym,"node"]].flatMap(t=>t[0]()?[t[1]]:[]).at(0)??""}var vm={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 sn(){let e=Pm();return{id:e,prettyName:vm[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}function dr({inlineDatasources:e,overrideDatasources:r,env:t,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=r[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=t[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new gi.PrismaClientInitializationError(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new gi.PrismaClientInitializationError("error: Missing URL environment variable, value, or override.",n);return i}var an=class extends Error{clientVersion;cause;constructor(r,t){super(r),this.clientVersion=t.clientVersion,this.cause=t.cause}get[Symbol.toStringTag](){return this.name}};var B=class extends an{isRetryable;constructor(r,t){super(r,t),this.isRetryable=t.isRetryable??!0}};function b(e,r){return{...e,isRetryable:r}}var Ne=class extends B{name="InvalidDatasourceError";code="P6001";constructor(r,t){super(r,b(t,!1))}};y(Ne,"InvalidDatasourceError");function ba(e){let r={clientVersion:e.clientVersion},t=Object.keys(e.inlineDatasources)[0],n=dr({inlineDatasources:e.inlineDatasources,overrideDatasources:e.overrideDatasources,clientVersion:e.clientVersion,env:{...e.env,...typeof process<"u"?process.env:{}}}),i;try{i=new URL(n)}catch{throw new Ne(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r)}let{protocol:o,searchParams:s}=i;if(o!=="prisma:"&&o!==Tt)throw new Ne(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\` or \`prisma+postgres://\``,r);let a=s.get("api_key");if(a===null||a.length<1)throw new Ne(`Error validating datasource \`${t}\`: the URL must contain a valid API key`,r);let l=Vn(i)?"http:":"https:";process.env.TEST_CLIENT_ENGINE_REMOTE_EXECUTOR&&i.searchParams.has("use_http")&&(l="http:");let u=new URL(i.href.replace(o,l));return{apiKey:a,url:u}}var Ea=P(vt()),ln=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:r,tracingHelper:t,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=r,this.tracingHelper=t,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:r,transactionId:t}={}){let n={Accept:"application/json",Authorization:`Bearer ${this.apiKey}`,"Content-Type":"application/json","Prisma-Engine-Hash":this.engineHash,"Prisma-Engine-Version":Ea.enginesVersion};this.tracingHelper.isEnabled()&&(n.traceparent=r??this.tracingHelper.getTraceParent()),t&&(n["X-Transaction-Id"]=t);let i=this.#e();return i.length>0&&(n["X-Capture-Telemetry"]=i.join(", ")),n}#e(){let r=[];return this.tracingHelper.isEnabled()&&r.push("tracing"),this.logLevel&&r.push(this.logLevel),this.logQueries&&r.push("query"),r}};function Tm(e){return e[0]*1e3+e[1]/1e6}function yi(e){return new Date(Tm(e))}var Ca=require("@prisma/client-runtime-utils");var fr=class extends B{name="ForcedRetryError";code="P5001";constructor(r){super("This request must be retried",b(r,!0))}};y(fr,"ForcedRetryError");var $e=class extends B{name="NotImplementedYetError";code="P5004";constructor(r,t){super(r,b(t,!1))}};y($e,"NotImplementedYetError");var A=class extends B{response;constructor(r,t){super(r,t),this.response=t.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var qe=class extends A{name="SchemaMissingError";code="P5005";constructor(r){super("Schema needs to be uploaded",b(r,!0))}};y(qe,"SchemaMissingError");var un=require("@prisma/client-runtime-utils");var hi="This request could not be understood by the server",Wr=class extends A{name="BadRequestError";code="P5000";constructor(r,t,n){super(t||hi,b(r,!1)),n&&(this.code=n)}};y(Wr,"BadRequestError");var Kr=class extends A{name="HealthcheckTimeoutError";code="P5013";logs;constructor(r,t){super("Engine not started: healthcheck timeout",b(r,!0)),this.logs=t}};y(Kr,"HealthcheckTimeoutError");var Hr=class extends A{name="EngineStartupError";code="P5014";logs;constructor(r,t,n){super(t,b(r,!0)),this.logs=n}};y(Hr,"EngineStartupError");var Yr=class extends A{name="EngineVersionNotSupportedError";code="P5012";constructor(r){super("Engine version is not supported",b(r,!1))}};y(Yr,"EngineVersionNotSupportedError");var bi="Request timed out",zr=class extends A{name="GatewayTimeoutError";code="P5009";constructor(r,t=bi){super(t,b(r,!1))}};y(zr,"GatewayTimeoutError");var Sm="Interactive transaction error",Xr=class extends A{name="InteractiveTransactionError";code="P5015";constructor(r,t=Sm){super(t,b(r,!1))}};y(Xr,"InteractiveTransactionError");var Am="Request parameters are invalid",Zr=class extends A{name="InvalidRequestError";code="P5011";constructor(r,t=Am){super(t,b(r,!1))}};y(Zr,"InvalidRequestError");var Ei="Requested resource does not exist",et=class extends A{name="NotFoundError";code="P5003";constructor(r,t=Ei){super(t,b(r,!1))}};y(et,"NotFoundError");var xi="Unknown server error",gr=class extends A{name="ServerError";code="P5006";logs;constructor(r,t,n){super(t||xi,b(r,!0)),this.logs=n}};y(gr,"ServerError");var wi="Unauthorized, check your connection string",rt=class extends A{name="UnauthorizedError";code="P5007";constructor(r,t=wi){super(t,b(r,!1))}};y(rt,"UnauthorizedError");var Pi="Usage exceeded, retry again later",tt=class extends A{name="UsageExceededError";code="P5008";constructor(r,t=Pi){super(t,b(r,!0))}};y(tt,"UsageExceededError");async function Rm(e){let r;try{r=await e.text()}catch{return{type:"EmptyError"}}try{let t=JSON.parse(r);if(typeof t=="string")switch(t){case"InternalDataProxyError":return{type:"DataProxyError",body:t};default:return{type:"UnknownTextError",body:t}}if(typeof t=="object"&&t!==null){if("is_panic"in t&&"message"in t&&"error_code"in t)return{type:"QueryEngineError",body:t};if("EngineNotStarted"in t||"InteractiveTransactionMisrouted"in t||"InvalidRequestError"in t){let n=Object.values(t)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:t}:{type:"DataProxyError",body:t}}}return{type:"UnknownJsonError",body:t}}catch{return r===""?{type:"EmptyError"}:{type:"UnknownTextError",body:r}}}async function nt(e,r){if(e.ok)return;let t={clientVersion:r,response:e},n=await Rm(e);if(n.type==="QueryEngineError")throw new un.PrismaClientKnownRequestError(n.body.message,{code:n.body.error_code,clientVersion:r});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new gr(t,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new qe(t);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Yr(t);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Hr(t,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new un.PrismaClientInitializationError(i,r,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Kr(t,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Xr(t,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Zr(t,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new rt(t,yr(wi,n));if(e.status===404)return new et(t,yr(Ei,n));if(e.status===429)throw new tt(t,yr(Pi,n));if(e.status===504)throw new zr(t,yr(bi,n));if(e.status>=500)throw new gr(t,yr(xi,n));if(e.status>=400)throw new Wr(t,yr(hi,n))}function yr(e,r){return r.type==="EmptyError"?e:`${e}: ${JSON.stringify(r)}`}function xa(e){let r=Math.pow(2,e)*50,t=Math.ceil(Math.random()*r)-Math.ceil(r/2),n=r+t;return new Promise(i=>setTimeout(()=>i(n),n))}var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function wa(e){let r=new TextEncoder().encode(e),t="",n=r.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=r[p]<<16|r[p+1]<<8|r[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,t+=me[s]+me[a]+me[l]+me[u];return i==1?(c=r[o],s=(c&252)>>2,a=(c&3)<<4,t+=me[s]+me[a]+"=="):i==2&&(c=r[o]<<8|r[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,t+=me[s]+me[a]+me[l]+"="),t}var Pa=require("@prisma/client-runtime-utils");function va(e){if(!!e.generator?.previewFeatures.some(t=>t.toLowerCase().includes("metrics")))throw new Pa.PrismaClientInitializationError("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}var Ta={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var it=class extends B{name="RequestError";code="P5010";constructor(r,t){super(`Cannot fetch data from service:
111
111
  ${r}`,b(t,!0))}};y(it,"RequestError");async function je(e,r,t=n=>n){let{clientVersion:n,...i}=r,o=t(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new it(a,{clientVersion:n,cause:s})}}var Dm=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Sa=v("prisma:client:dataproxyEngine");async function Im(e,r){let t=Ta["@prisma/engines-version"],n=r.clientVersion??"unknown";if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&Dm.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){let[s]=t.split("-")??[],[a,l,u]=s.split("."),c=Om(`<=${a}.${l}.${u}`),p=await je(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||"<empty body>"}`);let m=await p.text();Sa("length of body fetched from unpkg.com",m.length);let f;try{f=JSON.parse(m)}catch(h){throw console.error("JSON.parse error: body fetched from unpkg.com: ",m),h}return f.version}throw new $e("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Aa(e,r){let t=await Im(e,r);return Sa("version",t),t}function Om(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Ra=3,ot=v("prisma:client:dataproxyEngine"),st=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;protocol;constructor(r){va(r),this.config=r,this.env=r.env,this.inlineSchema=wa(r.inlineSchema),this.inlineDatasources=r.inlineDatasources,this.inlineSchemaHash=r.inlineSchemaHash,this.clientVersion=r.clientVersion,this.engineHash=r.engineVersion,this.logEmitter=r.logEmitter,this.tracingHelper=r.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let{apiKey:r,url:t}=this.getURLAndAPIKey();this.host=t.host,this.protocol=t.protocol,this.headerBuilder=new ln({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel??"error",logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await Aa(this.host,this.config),ot("host",this.host),ot("protocol",this.protocol)})(),await this.startPromise}async stop(){}propagateResponseExtensions(r){r?.logs?.length&&r.logs.forEach(t=>{switch(t.level){case"debug":case"trace":ot(t);break;case"error":case"warn":case"info":{this.logEmitter.emit(t.level,{timestamp:yi(t.timestamp),message:t.attributes.message??"",target:t.target??"BinaryEngine"});break}case"query":{this.logEmitter.emit("query",{query:t.attributes.query??"",timestamp:yi(t.timestamp),duration:t.attributes.duration_ms??0,params:t.attributes.params??"",target:t.target??"BinaryEngine"});break}default:t.level}}),r?.traces?.length&&this.tracingHelper.dispatchEngineSpans(r.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(r){return await this.start(),`${this.protocol}//${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${r}`}async uploadSchema(){let r={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(r,async()=>{let t=await je(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});t.ok||ot("schema response status",t.status);let n=await nt(t,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(r,{traceparent:t,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:r,traceparent:t,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(r,{traceparent:t,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=ur(r,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:t})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:r,traceparent:t,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await je(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t,transactionId:i?.id}),body:JSON.stringify(r),clientVersion:this.clientVersion},n);a.ok||ot("graphql response status",a.status),await this.handleError(await nt(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(r,t,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[r]} transaction`,callback:async({logHttpCall:o})=>{if(r==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await je(a,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await nt(l,this.clientVersion));let u=await l.json(),{extensions:c}=u;c&&this.propagateResponseExtensions(c);let p=u.id,m=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:m}}}else{let s=`${n.payload.endpoint}/${r}`;o(s);let a=await je(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),clientVersion:this.clientVersion});await this.handleError(await nt(a,this.clientVersion));let l=await a.json(),{extensions:u}=l;u&&this.propagateResponseExtensions(u);return}}})}getURLAndAPIKey(){return ba({clientVersion:this.clientVersion,env:this.env,inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources})}metrics(){throw new $e("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(r){for(let t=0;;t++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${t})`,timestamp:new Date,target:""})};try{return await r.callback({logHttpCall:n})}catch(i){if(!(i instanceof B)||!i.isRetryable)throw i;if(t>=Ra)throw i instanceof fr?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${t+1}/${Ra} failed for ${r.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await xa(t);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(r){if(r instanceof qe)throw await this.uploadSchema(),new fr({clientVersion:this.clientVersion,cause:r});if(r)throw r}convertProtocolErrorsToClientError(r){return r.length===1?cr(r[0],this.config.clientVersion,this.config.activeProvider):new Ca.PrismaClientUnknownRequestError(JSON.stringify(r),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};var L=require("@prisma/client-runtime-utils");function Da(e){if(e?.kind==="itx")return e.options.id}var Ia=require("@prisma/client-runtime-utils");var Ti=P(require("node:os")),Oa=P(require("node:path"));var vi=Symbol("PrismaLibraryEngineCache");function km(){let e=globalThis;return e[vi]===void 0&&(e[vi]={}),e[vi]}function _m(e){let r=km();if(r[e]!==void 0)return r[e];let t=Oa.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=Ti.default.constants.dlopen.RTLD_LAZY|Ti.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,t,i),r[e]=n.exports,n.exports}var ka={async loadLibrary(e){let r=await Cn(),t=await aa("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>_m(t))}catch(n){let i=qn({e:n,platformInfo:r,id:t});throw new Ia.PrismaClientInitializationError(i,e.clientVersion)}}};var cn=require("@prisma/client-runtime-utils");var Si,_a={async loadLibrary(e){let{clientVersion:r,adapter:t,engineWasm:n}=e;if(t===void 0)throw new cn.PrismaClientInitializationError(`The \`adapter\` option for \`PrismaClient\` is required in this context (${sn().prettyName})`,r);if(n===void 0)throw new cn.PrismaClientInitializationError("WASM engine was unexpectedly `undefined`",r);Si===void 0&&(Si=(async()=>{let o=await n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new cn.PrismaClientInitializationError("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",r);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 Si;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var Lm="P2036",ie=v("prisma:client:libraryEngine");function Fm(e){return e.item_type==="query"&&"query"in e}function Mm(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var La=[...Pn,"native"],Nm=0xffffffffffffffffn,Ai=1n;function $m(){let e=Ai++;return Ai>Nm&&(Ai=1n),e}var hr=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(r,t){this.libraryLoader=t??ka,r.engineWasm!==void 0&&(this.libraryLoader=t??_a),this.config=r,this.libraryStarted=!1,this.logQueries=r.logQueries??!1,this.logLevel=r.logLevel??"error",this.logEmitter=r.logEmitter,this.datamodel=r.inlineSchema,this.tracingHelper=r.tracingHelper,r.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(r.overrideDatasources)[0],i=r.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}wrapEngine(r){return{applyPendingMigrations:r.applyPendingMigrations?.bind(r),commitTransaction:this.withRequestId(r.commitTransaction.bind(r)),connect:this.withRequestId(r.connect.bind(r)),disconnect:this.withRequestId(r.disconnect.bind(r)),metrics:r.metrics?.bind(r),query:this.withRequestId(r.query.bind(r)),rollbackTransaction:this.withRequestId(r.rollbackTransaction.bind(r)),sdlSchema:r.sdlSchema?.bind(r),startTransaction:this.withRequestId(r.startTransaction.bind(r)),trace:r.trace.bind(r),free:r.free?.bind(r)}}withRequestId(r){return async(...t)=>{let n=$m().toString();try{return await r(...t,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 applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(r,t,n){await this.start();let i=await this.adapterPromise,o=JSON.stringify(t),s;if(r==="start"){let l=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});s=await this.engine?.startTransaction(l,o)}else r==="commit"?s=await this.engine?.commitTransaction(n.id,o):r==="rollback"&&(s=await this.engine?.rollbackTransaction(n.id,o));let a=this.parseEngineResponse(s);if(qm(a)){let l=this.getExternalAdapterError(a,i?.errorRegistry);throw l?l.error:new L.PrismaClientKnownRequestError(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta})}else if(typeof a.message=="string")throw new L.PrismaClientUnknownRequestError(a.message,{clientVersion:this.config.clientVersion});return a}async instantiateLibrary(){if(ie("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;wn(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let r=await this.tracingHelper.runInChildSpan("detect_platform",()=>Oe());if(!La.includes(r))throw new L.PrismaClientInitializationError(`Unknown ${J("PRISMA_QUERY_ENGINE_LIBRARY")} ${J(F(r))}. Possible binaryTargets: ${ye(La.join(", "))} or a path to the query engine library.
112
112
  You may have to run ${ye("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return r}}parseEngineResponse(r){if(!r)throw new L.PrismaClientUnknownRequestError("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(r)}catch{throw new L.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 r=new WeakRef(this);this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(on));let t=await this.adapterPromise;t&&ie("Using driver adapter: %O",t),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=>{r.deref()?.logger(n)},t))}catch(r){let t=r,n=this.parseInitError(t.message);throw typeof n=="string"?t:new L.PrismaClientInitializationError(n.message,this.config.clientVersion,n.error_code)}}}logger(r){let t=this.parseEngineResponse(r);t&&(t.level=t?.level.toLowerCase()??"unknown",Fm(t)?this.logEmitter.emit("query",{timestamp:new Date,query:t.query,params:t.params,duration:Number(t.duration_ms),target:t.module_path}):Mm(t)?this.loggerRustPanic=new L.PrismaClientRustPanicError(Ri(this,`${t.message}: ${t.reason} in ${t.file}:${t.line}:${t.column}`),this.config.clientVersion):this.logEmitter.emit(t.level,{timestamp:new Date,message:t.message,target:t.module_path}))}parseInitError(r){try{return JSON.parse(r)}catch{}return r}parseRequestError(r){try{return JSON.parse(r)}catch{}return r}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 ie(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let r=async()=>{ie("library starting");try{let t={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(t)),this.libraryStarted=!0,this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(on)),await this.adapterPromise,ie("library started")}catch(t){let n=this.parseInitError(t.message);throw typeof n=="string"?t:new L.PrismaClientInitializationError(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",r),this.libraryStartingPromise}async stop(){if(await this.libraryInstantiationPromise,await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return ie("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted){await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0;return}let r=async()=>{await new Promise(n=>setImmediate(n)),ie("library stopping");let t={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(t)),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,ie("library stopped")};return this.libraryStoppingPromise=this.tracingHelper.runInChildSpan("disconnect",r),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(r){return this.library?.debugPanic(r)}async request(r,{traceparent:t,interactiveTransaction:n}){ie(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:t}),o=JSON.stringify(r);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 L.PrismaClientUnknownRequestError(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a}}catch(s){if(s instanceof L.PrismaClientInitializationError)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new L.PrismaClientRustPanicError(Ri(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new L.PrismaClientUnknownRequestError(`${a.message}
113
113
  ${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(r,{transaction:t,traceparent:n}){ie("requestBatch");let i=ur(r,t);await this.start();let o=await this.adapterPromise;this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine?.query(this.lastQuery,JSON.stringify({traceparent:n}),Da(t));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 L.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(r,t){if(r.user_facing_error.is_panic)return new L.PrismaClientRustPanicError(Ri(this,r.user_facing_error.message),this.config.clientVersion);let n=this.getExternalAdapterError(r.user_facing_error,t);return n?n.error:cr(r,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(r,t){if(r.error_code===Lm&&t){let n=r.meta?.id;At(typeof n=="number","Malformed external JS error received from the engine");let i=t.consumeError(n);return At(i,"External error with reported id was not registered"),i}}async metrics(r){await this.start();let t=await this.engine.metrics(JSON.stringify(r));return r.format==="prometheus"?t:this.parseEngineResponse(t)}};function qm(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function Ri(e,r){return da({binaryTarget:e.binaryTarget,title:r,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function Fa({url:e,adapter:r,copyEngine:t,targetBuildType:n}){let i=[],o=[],s=E=>{i.push({_tag:"warning",value:E})},a=E=>{let j=E.join(`