prisma
Version:
Prisma is an open-source database toolkit. It includes a JavaScript/TypeScript ORM for Node.js, migrations and a modern GUI to view and edit the data in your database. You can use Prisma in new projects or add it to an existing one.
28 lines (26 loc) • 202 kB
JavaScript
import * as __banner_node_module from "node:module";
import * as __banner_node_path from "node:path";
import * as process from "node:process";
import * as __banner_node_url from "node:url";
const __filename = __banner_node_url.fileURLToPath(import.meta.url);
const __dirname = __banner_node_path.dirname(__filename);
const require = __banner_node_module.createRequire(import.meta.url);
var nu=Object.create;var Kn=Object.defineProperty;var iu=Object.getOwnPropertyDescriptor;var ou=Object.getOwnPropertyNames;var su=Object.getPrototypeOf,au=Object.prototype.hasOwnProperty;var fr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ro=(e,r)=>()=>(e&&(r=e(e=0)),r);var te=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),gr=(e,r)=>{for(var t in r)Kn(e,t,{get:r[t],enumerable:!0})},lu=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ou(r))!au.call(e,i)&&i!==t&&Kn(e,i,{get:()=>r[i],enumerable:!(n=iu(r,i))||n.enumerable});return e};var ne=(e,r,t)=>(t=e!=null?nu(su(e)):{},lu(r||!e||!e.__esModule?Kn(t,"default",{value:e,enumerable:!0}):t,e));var li=te((Vg,Xo)=>{"use strict";Xo.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 ts=te((Bg,rs)=>{"use strict";var Sc=fr("node:os"),es=fr("node:tty"),pe=li(),{env:U}=process,Qe;pe("no-color")||pe("no-colors")||pe("color=false")||pe("color=never")?Qe=0:(pe("color")||pe("colors")||pe("color=true")||pe("color=always"))&&(Qe=1);"FORCE_COLOR"in U&&(U.FORCE_COLOR==="true"?Qe=1:U.FORCE_COLOR==="false"?Qe=0:Qe=U.FORCE_COLOR.length===0?1:Math.min(parseInt(U.FORCE_COLOR,10),3));function ui(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ci(e,r){if(Qe===0)return 0;if(pe("color=16m")||pe("color=full")||pe("color=truecolor"))return 3;if(pe("color=256"))return 2;if(e&&!r&&Qe===void 0)return 0;let t=Qe||0;if(U.TERM==="dumb")return t;if(process.platform==="win32"){let n=Sc.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in U)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in U)||U.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in U)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(U.TEAMCITY_VERSION)?1:0;if(U.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in U){let n=parseInt((U.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(U.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(U.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(U.TERM)||"COLORTERM"in U?1:t}function Rc(e){let r=ci(e,e&&e.isTTY);return ui(r)}rs.exports={supportsColor:Rc,stdout:ui(ci(!0,es.isatty(1))),stderr:ui(ci(!0,es.isatty(2)))}});var os=te((Ug,is)=>{"use strict";var Ac=ts(),Er=li();function ns(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 pi(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(Er("no-hyperlink")||Er("no-hyperlinks")||Er("hyperlink=false")||Er("hyperlink=never"))return!1;if(Er("hyperlink=true")||Er("hyperlink=always")||n)return!0;if(!Ac.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=ns(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=ns(a);return u.major>0||u.minor>=50}switch(l){case"alacritty":return!0}return!1}is.exports={supportsHyperlink:pi,stdout:pi(process.stdout),stderr:pi(process.stderr)}});var ss=te((th,Cc)=>{Cc.exports={name:"@prisma/internals",version:"6.13.0",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.5.0",esbuild:"0.25.5","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.13.0-35.361e86d0ea4987e9f53a565309b3eed797a6bcbd","@prisma/schema-engine-wasm":"6.13.0-35.361e86d0ea4987e9f53a565309b3eed797a6bcbd","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var hi=te((Ph,Nc)=>{Nc.exports={name:"@prisma/engines-version",version:"6.13.0-35.361e86d0ea4987e9f53a565309b3eed797a6bcbd",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"361e86d0ea4987e9f53a565309b3eed797a6bcbd"},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 Zt=te(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.enginesVersion=void 0;zt.enginesVersion=hi().prisma.enginesVersion});var ds=te((qh,ps)=>{"use strict";ps.exports=e=>{let r=e.match(/^[ \t]*(?=\S)/gm);return r?r.reduce((t,n)=>Math.min(t,n.length),1/0):0}});var xi=te((Bh,gs)=>{"use strict";gs.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 Es=te((Qh,bs)=>{"use strict";bs.exports=({onlyFirst:e=!1}={})=>{let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}});var Si=te((Wh,ws)=>{"use strict";var Gc=Es();ws.exports=e=>typeof e=="string"?e.replace(Gc(),""):e});var xs=te((zh,Qc)=>{Qc.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 Rs=te((Zh,Ne)=>{"use strict";var Ai=fr("node:fs"),Ci=fr("node:path"),Wc=fr("node:os"),Jc=fr("node:crypto"),Hc=xs(),Ps=Hc.version,Kc=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Yc(e){let r={},t=e.toString();t=t.replace(/\r\n?/mg,`
`);let n;for(;(n=Kc.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,`
`),o=o.replace(/\\r/g,"\r")),r[i]=o}return r}function zc(e){let r=Ss(e),t=V.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=Ts(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=Xc(t,a);o=V.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return V.parse(o)}function Zc(e){console.log(`[dotenv@${Ps}][WARN] ${e}`)}function tt(e){console.log(`[dotenv@${Ps}][DEBUG] ${e}`)}function Ts(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 Xc(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 Ss(e){let r=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let t of e.path)Ai.existsSync(t)&&(r=t.endsWith(".vault")?t:`${t}.vault`);else r=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else r=Ci.resolve(process.cwd(),".env.vault");return Ai.existsSync(r)?r:null}function vs(e){return e[0]==="~"?Ci.join(Wc.homedir(),e.slice(1)):e}function ep(e){!!(e&&e.debug)&&tt("Loading env from encrypted .env.vault");let t=V._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),V.populate(n,t,e),{parsed:t}}function rp(e){let r=Ci.resolve(process.cwd(),".env"),t="utf8",n=!!(e&&e.debug);e&&e.encoding?t=e.encoding:n&&tt("No encoding is specified. UTF-8 is used by default");let i=[r];if(e&&e.path)if(!Array.isArray(e.path))i=[vs(e.path)];else{i=[];for(let l of e.path)i.push(vs(l))}let o,s={};for(let l of i)try{let u=V.parse(Ai.readFileSync(l,{encoding:t}));V.populate(s,u,e)}catch(u){n&&tt(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),V.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function tp(e){if(Ts(e).length===0)return V.configDotenv(e);let r=Ss(e);return r?V._configVault(e):(Zc(`You set DOTENV_KEY but you are missing a .env.vault file at ${r}. Did you forget to build it?`),V.configDotenv(e))}function np(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=Jc.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 ip(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&&tt(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=r[o]}var V={configDotenv:rp,_configVault:ep,_parseVault:zc,config:tp,decrypt:np,parse:Yc,populate:ip};Ne.exports.configDotenv=V.configDotenv;Ne.exports._configVault=V._configVault;Ne.exports._parseVault=V._parseVault;Ne.exports.config=V.config;Ne.exports.decrypt=V.decrypt;Ne.exports.parse=V.parse;Ne.exports.populate=V.populate;Ne.exports=V});var ks=te((sy,nn)=>{"use strict";nn.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()};nn.exports.default=nn.exports});var ji=te(($b,zs)=>{"use strict";zs.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,d,f,h,g,S,P,R,b,k=[];for(l=0;l<i;l++)k.push(l+1),k.push(r.charCodeAt(s+l));for(var me=k.length-1;a<o-3;)for(S=t.charCodeAt(s+(u=a)),P=t.charCodeAt(s+(c=a+1)),R=t.charCodeAt(s+(p=a+2)),b=t.charCodeAt(s+(d=a+3)),f=a+=4,l=0;l<me;l+=2)h=k[l],g=k[l+1],u=e(h,u,c,S,g),c=e(u,c,p,P,g),p=e(c,p,d,R,g),f=e(p,d,f,b,g),k[l]=f,d=p,p=c,c=u,u=h;for(;a<o;)for(S=t.charCodeAt(s+(u=a)),f=++a,l=0;l<me;l+=2)h=k[l],k[l]=f=e(h,u,f,S,k[l+1]),u=h;return f}}()});var ta=Ro(()=>{"use strict"});var na=Ro(()=>{"use strict"});var Io={};gr(Io,{defineExtension:()=>Ao,getExtensionContext:()=>Co});function Ao(e){return typeof e=="function"?e:r=>r.$extends(e)}function Co(e){return e}var Do={};gr(Do,{validator:()=>ko});function ko(...e){return r=>r}var $t={};gr($t,{$:()=>Fo,bgBlack:()=>bu,bgBlue:()=>vu,bgCyan:()=>Tu,bgGreen:()=>wu,bgMagenta:()=>Pu,bgRed:()=>Eu,bgWhite:()=>Su,bgYellow:()=>xu,black:()=>fu,blue:()=>tr,bold:()=>Q,cyan:()=>ke,dim:()=>Ce,gray:()=>Jr,green:()=>qe,grey:()=>yu,hidden:()=>du,inverse:()=>pu,italic:()=>cu,magenta:()=>gu,red:()=>ue,reset:()=>uu,strikethrough:()=>mu,underline:()=>K,white:()=>hu,yellow:()=>Ie});var Yn,Oo,_o,No,Lo=!0;typeof process<"u"&&({FORCE_COLOR:Yn,NODE_DISABLE_COLORS:Oo,NO_COLOR:_o,TERM:No}=process.env||{},Lo=process.stdout&&process.stdout.isTTY);var Fo={enabled:!Oo&&_o==null&&No!=="dumb"&&(Yn!=null&&Yn!=="0"||Lo)};function N(e,r){let t=new RegExp(`\\x1b\\[${r}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${r}m`;return function(o){return!Fo.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(t,i+n):o)+i}}var uu=N(0,0),Q=N(1,22),Ce=N(2,22),cu=N(3,23),K=N(4,24),pu=N(7,27),du=N(8,28),mu=N(9,29),fu=N(30,39),ue=N(31,39),qe=N(32,39),Ie=N(33,39),tr=N(34,39),gu=N(35,39),ke=N(36,39),hu=N(37,39),Jr=N(90,39),yu=N(90,39),bu=N(40,49),Eu=N(41,49),wu=N(42,49),xu=N(43,49),vu=N(44,49),Pu=N(45,49),Tu=N(46,49),Su=N(47,49);var Ru=100,Mo=["green","yellow","blue","magenta","cyan","red"],Hr=[],$o=Date.now(),Au=0,zn=typeof process<"u"?process.env:{};globalThis.DEBUG??=zn.DEBUG??"";globalThis.DEBUG_COLORS??=zn.DEBUG_COLORS?zn.DEBUG_COLORS==="true":!0;var Kr={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 Cu(e){let r={color:Mo[Au++%Mo.length],enabled:Kr.enabled(e),namespace:e,log:Kr.log,extend:()=>{}},t=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=r;if(n.length!==0&&Hr.push([o,...n]),Hr.length>Ru&&Hr.shift(),Kr.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Iu(c)),u=`+${Date.now()-$o}ms`;$o=Date.now(),globalThis.DEBUG_COLORS?a($t[s](Q(o)),...l,$t[s](u)):a(o,...l,u)}};return new Proxy(t,{get:(n,i)=>r[i],set:(n,i,o)=>r[i]=o})}var L=new Proxy(Cu,{get:(e,r)=>Kr[r],set:(e,r,t)=>Kr[r]=t});function Iu(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 qo(e=7500){let r=Hr.map(([t,...n])=>`${t} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
`);return r.length<e?r:r.slice(-e)}function jo(){Hr.length=0}var hr=L;import ku from"node:fs";function Zn(){let e=process.env.PRISMA_QUERY_ENGINE_LIBRARY;if(!(e&&ku.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 Xn=["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 qt="libquery_engine";function jt(e,r){let t=r==="url";return e.includes("windows")?t?"query_engine.dll.node":`query_engine-${e}.dll.node`:e.includes("darwin")?t?`${qt}.dylib.node`:`${qt}-${e}.dylib.node`:t?`${qt}.so.node`:`${qt}-${e}.so.node`}import Fu from"node:child_process";import Go from"node:fs/promises";import ii from"node:os";var De=Symbol.for("@ts-pattern/matcher"),Du=Symbol.for("@ts-pattern/isVariadic"),Bt="@ts-pattern/anonymous-select-key",ei=e=>!!(e&&typeof e=="object"),Vt=e=>e&&!!e[De],Ee=(e,r,t)=>{if(Vt(e)){let n=e[De](),{matched:i,selections:o}=n.match(r);return i&&o&&Object.keys(o).forEach(s=>t(s,o[s])),i}if(ei(e)){if(!ei(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];Vt(a)&&a[Du]?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||Vt(o=i)&&o[De]().matcherType==="optional")&&Ee(i,r[n],t);var o})}return Object.is(r,e)},Ge=e=>{var r,t,n;return ei(e)?Vt(e)?(r=(t=(n=e[De]()).getSelectionKeys)==null?void 0:t.call(n))!=null?r:[]:Array.isArray(e)?Yr(e,Ge):Yr(Object.values(e),Ge):[]},Yr=(e,r)=>e.reduce((t,n)=>t.concat(r(n)),[]);function ce(e){return Object.assign(e,{optional:()=>Ou(e),and:r=>$(e,r),or:r=>_u(e,r),select:r=>r===void 0?Vo(e):Vo(r,e)})}function Ou(e){return ce({[De]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return r===void 0?(Ge(e).forEach(i=>n(i,void 0)),{matched:!0,selections:t}):{matched:Ee(e,r,n),selections:t}},getSelectionKeys:()=>Ge(e),matcherType:"optional"})})}function $(...e){return ce({[De]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return{matched:e.every(i=>Ee(i,r,n)),selections:t}},getSelectionKeys:()=>Yr(e,Ge),matcherType:"and"})})}function _u(...e){return ce({[De]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return Yr(e,Ge).forEach(i=>n(i,void 0)),{matched:e.some(i=>Ee(i,r,n)),selections:t}},getSelectionKeys:()=>Yr(e,Ge),matcherType:"or"})})}function C(e){return{[De]:()=>({match:r=>({matched:!!e(r)})})}}function Vo(...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 ce({[De]:()=>({match:n=>{let i={[r??Bt]:n};return{matched:t===void 0||Ee(t,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[r??Bt].concat(t===void 0?[]:Ge(t))})})}function ye(e){return typeof e=="number"}function je(e){return typeof e=="string"}function Ve(e){return typeof e=="bigint"}var ng=ce(C(function(e){return!0}));var Be=e=>Object.assign(ce(e),{startsWith:r=>{return Be($(e,(t=r,C(n=>je(n)&&n.startsWith(t)))));var t},endsWith:r=>{return Be($(e,(t=r,C(n=>je(n)&&n.endsWith(t)))));var t},minLength:r=>Be($(e,(t=>C(n=>je(n)&&n.length>=t))(r))),length:r=>Be($(e,(t=>C(n=>je(n)&&n.length===t))(r))),maxLength:r=>Be($(e,(t=>C(n=>je(n)&&n.length<=t))(r))),includes:r=>{return Be($(e,(t=r,C(n=>je(n)&&n.includes(t)))));var t},regex:r=>{return Be($(e,(t=r,C(n=>je(n)&&!!n.match(t)))));var t}}),ig=Be(C(je)),be=e=>Object.assign(ce(e),{between:(r,t)=>be($(e,((n,i)=>C(o=>ye(o)&&n<=o&&i>=o))(r,t))),lt:r=>be($(e,(t=>C(n=>ye(n)&&n<t))(r))),gt:r=>be($(e,(t=>C(n=>ye(n)&&n>t))(r))),lte:r=>be($(e,(t=>C(n=>ye(n)&&n<=t))(r))),gte:r=>be($(e,(t=>C(n=>ye(n)&&n>=t))(r))),int:()=>be($(e,C(r=>ye(r)&&Number.isInteger(r)))),finite:()=>be($(e,C(r=>ye(r)&&Number.isFinite(r)))),positive:()=>be($(e,C(r=>ye(r)&&r>0))),negative:()=>be($(e,C(r=>ye(r)&&r<0)))}),og=be(C(ye)),Ue=e=>Object.assign(ce(e),{between:(r,t)=>Ue($(e,((n,i)=>C(o=>Ve(o)&&n<=o&&i>=o))(r,t))),lt:r=>Ue($(e,(t=>C(n=>Ve(n)&&n<t))(r))),gt:r=>Ue($(e,(t=>C(n=>Ve(n)&&n>t))(r))),lte:r=>Ue($(e,(t=>C(n=>Ve(n)&&n<=t))(r))),gte:r=>Ue($(e,(t=>C(n=>Ve(n)&&n>=t))(r))),positive:()=>Ue($(e,C(r=>Ve(r)&&r>0))),negative:()=>Ue($(e,C(r=>Ve(r)&&r<0)))}),sg=Ue(C(Ve)),ag=ce(C(function(e){return typeof e=="boolean"})),lg=ce(C(function(e){return typeof e=="symbol"})),ug=ce(C(function(e){return e==null})),cg=ce(C(function(e){return e!=null}));var ri=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}},ti={matched:!1,value:void 0};function yr(e){return new ni(e,ti)}var ni=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)?ti:{matched:!0,value:t(o?Bt in s?s[Bt]: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)}:ti)}otherwise(r){return this.state.matched?this.state.value:r(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new ri(this.input)}run(){return this.exhaustive()}returnType(){return this}};import{promisify as Mu}from"node:util";var Nu={warn:Ie("prisma:warn")},Lu={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Ut(e,...r){Lu.warn()&&console.warn(`${Nu.warn} ${e}`,...r)}var $u=Mu(Fu.exec),z=hr("prisma:get-platform"),qu=["1.0.x","1.1.x","3.0.x"];async function Qo(){let e=ii.platform(),r=process.arch;if(e==="freebsd"){let s=await Qt("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 Vu(),n=await Ku(),i=Uu({arch:r,archFromUname:n,familyDistro:t.familyDistro}),{libssl:o}=await Gu(i);return{platform:"linux",libssl:o,arch:r,archFromUname:n,...t}}function ju(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=yr({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 z(`Found distro info:
${JSON.stringify(a,null,2)}`),a}async function Vu(){let e="/etc/os-release";try{let r=await Go.readFile(e,{encoding:"utf-8"});return ju(r)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function Bu(e){let r=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(r){let t=`${r[1]}.x`;return Wo(t)}}function Bo(e){let r=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(r){let t=`${r[1]}${r[2]??".0"}.x`;return Wo(t)}}function Wo(e){let r=(()=>{if(Ho(e))return e;let t=e.split(".");return t[1]="0",t.join(".")})();if(qu.includes(r))return r}function Uu(e){return yr(e).with({familyDistro:"musl"},()=>(z('Trying platform-specific paths for "alpine"'),["/lib","/usr/lib"])).with({familyDistro:"debian"},({archFromUname:r})=>(z('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${r}-linux-gnu`,`/lib/${r}-linux-gnu`])).with({familyDistro:"rhel"},()=>(z('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:r,arch:t,archFromUname:n})=>(z(`Don't know any platform-specific paths for "${r}" on ${t} (${n})`),[]))}async function Gu(e){let r='grep -v "libssl.so.0"',t=await Uo(e);if(t){z(`Found libssl.so file using platform-specific paths: ${t}`);let o=Bo(t);if(z(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}z('Falling back to "ldconfig" and other generic paths');let n=await Qt(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${r}`);if(n||(n=await Uo(["/lib64","/usr/lib64","/lib","/usr/lib"])),n){z(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=Bo(n);if(z(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Qt("openssl version -v");if(i){z(`Found openssl binary with version: ${i}`);let o=Bu(i);if(z(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return z("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Uo(e){for(let r of e){let t=await Qu(r);if(t)return t}}async function Qu(e){try{return(await Go.readdir(e)).find(t=>t.startsWith("libssl.so.")&&!t.startsWith("libssl.so.0"))}catch(r){if(r.code==="ENOENT")return;throw r}}async function nr(){let{binaryTarget:e}=await Jo();return e}function Wu(e){return e.binaryTarget!==void 0}async function oi(){let{memoized:e,...r}=await Jo();return r}var Gt={};async function Jo(){if(Wu(Gt))return Promise.resolve({...Gt,memoized:!0});let e=await Qo(),r=Ju(e);return Gt={...e,binaryTarget:r},{...Gt,memoized:!1}}function Ju(e){let{platform:r,arch:t,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;r==="linux"&&!["x64","arm64"].includes(t)&&Ut(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${t}" 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(r==="linux"&&i===void 0){let c=yr({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.");Ut(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}".
${c}`)}let u="debian";if(r==="linux"&&o===void 0&&z(`Distro is "${a}". Falling back to Prisma engines built for "${u}".`),r==="darwin"&&t==="arm64")return"darwin-arm64";if(r==="darwin")return"darwin";if(r==="win32")return"windows";if(r==="freebsd")return o;if(r==="openbsd")return"openbsd";if(r==="netbsd")return"netbsd";if(r==="linux"&&o==="nixos")return"linux-nixos";if(r==="linux"&&t==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(r==="linux"&&t==="arm")return`linux-arm-openssl-${i||l}`;if(r==="linux"&&o==="musl"){let c="linux-musl";return!i||Ho(i)?c:`${c}-openssl-${i}`}return r==="linux"&&o&&i?`${o}-openssl-${i}`:(r!=="linux"&&Ut(`Prisma detected unknown OS "${r}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function Hu(e){try{return await e()}catch{return}}function Qt(e){return Hu(async()=>{let r=await $u(e);return z(`Command "${e}" successfully returned "${r.stdout}"`),r.stdout})}async function Ku(){return typeof ii.machine=="function"?ii.machine():(await Qt("uname -m"))?.trim()}function Ho(e){return e.startsWith("1.")}var Jt={};gr(Jt,{beep:()=>xc,clearScreen:()=>yc,clearTerminal:()=>bc,cursorBackward:()=>tc,cursorDown:()=>ec,cursorForward:()=>rc,cursorGetPosition:()=>oc,cursorHide:()=>lc,cursorLeft:()=>zo,cursorMove:()=>Xu,cursorNextLine:()=>sc,cursorPrevLine:()=>ac,cursorRestorePosition:()=>ic,cursorSavePosition:()=>nc,cursorShow:()=>uc,cursorTo:()=>Zu,cursorUp:()=>Yo,enterAlternativeScreen:()=>Ec,eraseDown:()=>mc,eraseEndLine:()=>pc,eraseLine:()=>Zo,eraseLines:()=>cc,eraseScreen:()=>si,eraseStartLine:()=>dc,eraseUp:()=>fc,exitAlternativeScreen:()=>wc,iTerm:()=>Tc,image:()=>Pc,link:()=>vc,scrollDown:()=>hc,scrollUp:()=>gc});import ai from"node:process";var Wt=globalThis.window?.document!==void 0,vg=globalThis.process?.versions?.node!==void 0,Pg=globalThis.process?.versions?.bun!==void 0,Tg=globalThis.Deno?.version?.deno!==void 0,Sg=globalThis.process?.versions?.electron!==void 0,Rg=globalThis.navigator?.userAgent?.includes("jsdom")===!0,Ag=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,Cg=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,Ig=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,kg=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,zr=globalThis.navigator?.userAgentData?.platform,Dg=zr==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",Og=zr==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",_g=zr==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",Ng=zr==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),Lg=zr==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var I="\x1B[",Xr="\x1B]",br="\x07",Zr=";",Ko=!Wt&&ai.env.TERM_PROGRAM==="Apple_Terminal",Yu=!Wt&&ai.platform==="win32",zu=Wt?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:ai.cwd,Zu=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof r!="number"?I+(e+1)+"G":I+(r+1)+Zr+(e+1)+"H"},Xu=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let t="";return e<0?t+=I+-e+"D":e>0&&(t+=I+e+"C"),r<0?t+=I+-r+"A":r>0&&(t+=I+r+"B"),t},Yo=(e=1)=>I+e+"A",ec=(e=1)=>I+e+"B",rc=(e=1)=>I+e+"C",tc=(e=1)=>I+e+"D",zo=I+"G",nc=Ko?"\x1B7":I+"s",ic=Ko?"\x1B8":I+"u",oc=I+"6n",sc=I+"E",ac=I+"F",lc=I+"?25l",uc=I+"?25h",cc=e=>{let r="";for(let t=0;t<e;t++)r+=Zo+(t<e-1?Yo():"");return e&&(r+=zo),r},pc=I+"K",dc=I+"1K",Zo=I+"2K",mc=I+"J",fc=I+"1J",si=I+"2J",gc=I+"S",hc=I+"T",yc="\x1Bc",bc=Yu?`${si}${I}0f`:`${si}${I}3J${I}H`,Ec=I+"?1049h",wc=I+"?1049l",xc=br,vc=(e,r)=>[Xr,"8",Zr,Zr,r,br,e,Xr,"8",Zr,Zr,br].join(""),Pc=(e,r={})=>{let t=`${Xr}1337;File=inline=1`;return r.width&&(t+=`;width=${r.width}`),r.height&&(t+=`;height=${r.height}`),r.preserveAspectRatio===!1&&(t+=";preserveAspectRatio=0"),t+":"+Buffer.from(e).toString("base64")+br},Tc={setCwd:(e=zu())=>`${Xr}50;CurrentDir=${e}${br}`,annotation(e,r={}){let t=`${Xr}1337;`,n=r.x!==void 0,i=r.y!==void 0;if((n||i)&&!(n&&i&&r.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replaceAll("|",""),t+=r.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",r.length>0?t+=(n?[e,r.length,r.x,r.y]:[r.length,e]).join("|"):t+=e,t+br}};var Ht=ne(os(),1);function ir(e,r,{target:t="stdout",...n}={}){return Ht.default[t]?Jt.link(e,r):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,r):`${e} (\u200B${r}\u200B)`}ir.isSupported=Ht.default.stdout;ir.stderr=(e,r,t={})=>ir(e,r,{target:"stderr",...t});ir.stderr.isSupported=Ht.default.stderr;function di(e){return ir(e,e,{fallback:K})}var Ic=ss(),mi=Ic.version;function wr(e){let r=kc();return r||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":Dc(e))}function kc(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function Dc(e){return e?.previewFeatures.includes("queryCompiler")?"client":"library"}function fi(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}function Kt(e){return{ok:!0,value:e,map(r){return Kt(r(e))},flatMap(r){return r(e)}}}function or(e){return{ok:!1,error:e,map(){return or(e)},flatMap(){return or(e)}}}var as=L("driver-adapter-utils"),gi=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 Yt=(e,r=new gi)=>{let t={adapterName:e.adapterName,errorRegistry:r,queryRaw:Oe(r,e.queryRaw.bind(e)),executeRaw:Oe(r,e.executeRaw.bind(e)),executeScript:Oe(r,e.executeScript.bind(e)),dispose:Oe(r,e.dispose.bind(e)),provider:e.provider,startTransaction:async(...n)=>(await Oe(r,e.startTransaction.bind(e))(...n)).map(o=>Oc(r,o))};return e.getConnectionInfo&&(t.getConnectionInfo=_c(r,e.getConnectionInfo.bind(e))),t},Oc=(e,r)=>({adapterName:r.adapterName,provider:r.provider,options:r.options,queryRaw:Oe(e,r.queryRaw.bind(r)),executeRaw:Oe(e,r.executeRaw.bind(r)),commit:Oe(e,r.commit.bind(r)),rollback:Oe(e,r.rollback.bind(r))});function Oe(e,r){return async(...t)=>{try{return Kt(await r(...t))}catch(n){if(as("[error@wrapAsync]",n),fi(n))return or(n.cause);let i=e.registerNewError(n);return or({kind:"GenericJs",id:i})}}}function _c(e,r){return(...t)=>{try{return Kt(r(...t))}catch(n){if(as("[error@wrapSync]",n),fi(n))return or(n.cause);let i=e.registerNewError(n);return or({kind:"GenericJs",id:i})}}}var Lc=ne(Zt());var Fc=ne(Zt());import M from"node:path";var Ih=L("prisma:engines");function ls(){return M.join(__dirname,"../")}var kh="libquery-engine";M.join(__dirname,"../query-engine-darwin");M.join(__dirname,"../query-engine-darwin-arm64");M.join(__dirname,"../query-engine-debian-openssl-1.0.x");M.join(__dirname,"../query-engine-debian-openssl-1.1.x");M.join(__dirname,"../query-engine-debian-openssl-3.0.x");M.join(__dirname,"../query-engine-linux-static-x64");M.join(__dirname,"../query-engine-linux-static-arm64");M.join(__dirname,"../query-engine-rhel-openssl-1.0.x");M.join(__dirname,"../query-engine-rhel-openssl-1.1.x");M.join(__dirname,"../query-engine-rhel-openssl-3.0.x");M.join(__dirname,"../libquery_engine-darwin.dylib.node");M.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");M.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");M.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");M.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");M.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");M.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");M.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");M.join(__dirname,"../libquery_engine-linux-musl.so.node");M.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");M.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");M.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");M.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");M.join(__dirname,"../query_engine-windows.dll.node");import us from"node:fs";var cs=hr("chmodPlusX");function yi(e){if(process.platform==="win32")return;let r=us.statSync(e),t=r.mode|64|8|1;if(r.mode===t){cs(`Execution permissions of ${e} are fine`);return}let n=t.toString(8).slice(-3);cs(`Have to call chmodPlusX on ${e}`),us.chmodSync(e,n)}function bi(e){let r=e.e,t=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=r.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${di("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${Ce(e.id)}\`).`,s=yr({message:r.message,code:r.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${t("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${t("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`${t("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}
${s}
Details: ${r.message}`}var ms=ne(ds(),1);function Ei(e){let r=(0,ms.default)(e);if(r===0)return e;let t=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(t,"")}var fs="prisma+postgres",Xt=`${fs}:`;function en(e){return e?.toString().startsWith(`${Xt}//`)??!1}function wi(e){if(!en(e))return!1;let{host:r}=new URL(e);return r.includes("localhost")||r.includes("127.0.0.1")||r.includes("[::1]")}var hs=ne(xi());function Pi(e){return String(new vi(e))}var vi=class{constructor(r){this.config=r}toString(){let{config:r}=this,t=r.provider.fromEnvVar?`env("${r.provider.fromEnvVar}")`:r.provider.value,n=JSON.parse(JSON.stringify({provider:t,binaryTargets:Mc(r.binaryTargets)}));return`generator ${r.name} {
${(0,hs.default)($c(n),2)}
}`}};function Mc(e){let r;if(e.length>0){let t=e.find(n=>n.fromEnvVar!==null);t?r=`env("${t.fromEnvVar}")`:r=e.map(n=>n.native?"native":n.value)}else r=void 0;return r}function $c(e){let r=Object.keys(e).reduce((t,n)=>Math.max(t,n.length),0);return Object.entries(e).map(([t,n])=>`${t.padEnd(r)} = ${qc(n)}`).join(`
`)}function qc(e){return JSON.parse(JSON.stringify(e,(r,t)=>Array.isArray(t)?`[${t.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(t)))}var rt={};gr(rt,{error:()=>Bc,info:()=>Vc,log:()=>jc,query:()=>Uc,should:()=>ys,tags:()=>et,warn:()=>Ti});var et={error:ue("prisma:error"),warn:Ie("prisma:warn"),info:ke("prisma:info"),query:tr("prisma:query")},ys={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function jc(...e){console.log(...e)}function Ti(e,...r){ys.warn()&&console.warn(`${et.warn} ${e}`,...r)}function Vc(e,...r){console.info(`${et.info} ${e}`,...r)}function Bc(e,...r){console.error(`${et.error} ${e}`,...r)}function Uc(e,...r){console.log(`${et.query} ${e}`,...r)}function rn(e,r){if(!e)throw new Error(`${r}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function _e(e,r){throw new Error(r)}import tn from"node:path";function Ri(e){return tn.sep===tn.posix.sep?e:e.split(tn.sep).join(tn.posix.sep)}var Di=ne(Rs());import Ii from"node:fs";import nt from"node:path";function As(e){let r=e.ignoreProcessEnv?{}:process.env,t=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(r,p)?r[p]:e.parsed[p]||"",u=t(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(r,n)?r[n]:e.parsed[n];e.parsed[n]=t(i)}for(let n in e.parsed)r[n]=e.parsed[n];return e}var ki=hr("prisma:tryLoadEnv");function it({rootEnvPath:e,schemaEnvPath:r},t={conflictCheck:"none"}){let n=Cs(e);t.conflictCheck!=="none"&&op(n,r,t.conflictCheck);let i=null;return Is(n?.path,r)||(i=Cs(r)),!n&&!i&&ki("No Environment variables loaded"),i?.dotenvResult.error?console.error(ue(Q("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function op(e,r,t){let n=e?.dotenvResult.parsed,i=!Is(e?.path,r);if(n&&r&&i&&Ii.existsSync(r)){let o=Di.default.parse(Ii.readFileSync(r)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=nt.relative(process.cwd(),e.path),l=nt.relative(process.cwd(),r);if(t==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${K(a)} and ${K(l)}
Conflicting env vars:
${s.map(c=>` ${Q(c)}`).join(`
`)}
We suggest to move the contents of ${K(l)} to ${K(a)} to consolidate your env vars.
`;throw new Error(u)}else if(t==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>Q(c)).join(", ")} in ${K(a)} and ${K(l)}
Env vars from ${K(l)} overwrite the ones from ${K(a)}
`;console.warn(`${Ie("warn(prisma)")} ${u}`)}}}}function Cs(e){if(sp(e)){ki(`Environment variables loaded from ${e}`);let r=Di.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:As(r),message:Ce(`Environment variables loaded from ${nt.relative(process.cwd(),e)}`),path:e}}else ki(`Environment variables not found at ${e}`);return null}function Is(e,r){return e&&r&&nt.resolve(e)===nt.resolve(r)}function sp(e){return!!(e&&Ii.existsSync(e))}function Oi(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function xr(e,r){let t={};for(let n of Object.keys(e))t[n]=r(e[n],n);return t}function _i(e,r){if(e.length===0)return;let t=e[0];for(let n=1;n<e.length;n++)r(t,e[n])<0&&(t=e[n]);return t}function x(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}var Ds=new Set,on=(e,r,...t)=>{Ds.has(e)||(Ds.add(e),Ti(r,...t))};var T=class e extends Error{clientVersion;errorCode;retryable;constructor(r,t,n){super(r),this.name="PrismaClientInitializationError",this.clientVersion=t,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};x(T,"PrismaClientInitializationError");var Z=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(r,{code:t,clientVersion:n,meta:i,batchRequestIdx:o}){super(r),this.name="PrismaClientKnownRequestError",this.code=t,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};x(Z,"PrismaClientKnownRequestError");var de=class extends Error{clientVersion;constructor(r,t){super(r),this.name="PrismaClientRustPanicError",this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};x(de,"PrismaClientRustPanicError");var q=class extends Error{clientVersion;batchRequestIdx;constructor(r,{clientVersion:t,batchRequestIdx:n}){super(r),this.name="PrismaClientUnknownRequestError",this.clientVersion=t,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};x(q,"PrismaClientUnknownRequestError");var X=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(r,{clientVersion:t}){super(r),this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};x(X,"PrismaClientValidationError");var vr=9e15,Ke=1e9,Ni="0123456789abcdef",un="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",cn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Li={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-vr,maxE:vr,crypto:!1},Ls,Le,w=!0,dn="[DecimalError] ",He=dn+"Invalid argument: ",Fs=dn+"Precision limit exceeded",Ms=dn+"crypto unavailable",$s="[object Decimal]",Y=Math.floor,B=Math.pow,ap=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,lp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,up=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,qs=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe=1e7,E=7,cp=9007199254740991,pp=un.length-1,Fi=cn.length-1,m={toStringTag:$s};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};m.ceil=function(){return y(new t