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.
20 lines (19 loc) • 229 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);
globalThis['__dirname'] = __banner_node_path.dirname(__filename);
const require = __banner_node_module.createRequire(import.meta.url);
var du=Object.create;var li=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var fu=Object.getOwnPropertyNames;var gu=Object.getPrototypeOf,yu=Object.prototype.hasOwnProperty;var Gt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Go=(e,t)=>()=>(e&&(t=e(e=0)),t);var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jt=(e,t)=>{for(var r in t)li(e,r,{get:t[r],enumerable:!0})},hu=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fu(t))!yu.call(e,i)&&i!==r&&li(e,i,{get:()=>t[i],enumerable:!(n=mu(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?du(gu(e)):{},hu(t||!e||!e.__esModule?li(r,"default",{value:e,enumerable:!0}):r,e));var ls=z((Sy,Vu)=>{Vu.exports={name:"@prisma/internals",version:"6.16.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":"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",empathic:"2.0.0","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-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.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43","@prisma/schema-engine-wasm":"6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43","@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 di=z(($y,Bu)=>{Bu.exports={name:"@prisma/engines-version",version:"6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"1c57fdcd7e44b29b9313256c76699e91c3ac3c43"},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 cs=z(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.enginesVersion=void 0;Yr.enginesVersion=di().prisma.enginesVersion});var ps=z((qy,us)=>{"use strict";us.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var gs=z((By,fs)=>{"use strict";fs.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var hs=z((Yy,Ku)=>{Ku.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 Ps=z((Zy,ke)=>{"use strict";var wi=Gt("node:fs"),Ei=Gt("node:path"),zu=Gt("node:os"),Yu=Gt("node:crypto"),Zu=hs(),Es=Zu.version,Xu=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ep(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
`);let n;for(;(n=Xu.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function tp(e){let t=bs(e),r=j.configDotenv({path:t});if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=xs(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=np(r,a);o=j.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return j.parse(o)}function rp(e){console.log(`[dotenv@${Es}][WARN] ${e}`)}function er(e){console.log(`[dotenv@${Es}][DEBUG] ${e}`)}function xs(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function np(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function bs(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)wi.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Ei.resolve(process.cwd(),".env.vault");return wi.existsSync(t)?t:null}function ws(e){return e[0]==="~"?Ei.join(zu.homedir(),e.slice(1)):e}function ip(e){!!(e&&e.debug)&&er("Loading env from encrypted .env.vault");let r=j._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),j.populate(n,r,e),{parsed:r}}function op(e){let t=Ei.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&er("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[ws(e.path)];else{i=[];for(let l of e.path)i.push(ws(l))}let o,s={};for(let l of i)try{let c=j.parse(wi.readFileSync(l,{encoding:r}));j.populate(s,c,e)}catch(c){n&&er(`Failed to load ${l} ${c.message}`),o=c}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),j.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function sp(e){if(xs(e).length===0)return j.configDotenv(e);let t=bs(e);return t?j._configVault(e):(rp(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),j.configDotenv(e))}function ap(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=Yu.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",c=s.message==="Unsupported state or unable to authenticate data";if(a||l){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(c){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw s}}function lp(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override);if(typeof t!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o]),n&&er(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var j={configDotenv:op,_configVault:ip,_parseVault:tp,config:sp,decrypt:ap,parse:ep,populate:lp};ke.exports.configDotenv=j.configDotenv;ke.exports._configVault=j._configVault;ke.exports._parseVault=j._parseVault;ke.exports.config=j.config;ke.exports.decrypt=j.decrypt;ke.exports.parse=j.parse;ke.exports.populate=j.populate;ke.exports=j});var Cs=z((sh,tn)=>{"use strict";tn.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};tn.exports.default=tn.exports});var Oi=z((Nw,Ws)=>{"use strict";Ws.exports=function(){function e(t,r,n,i,o){return t<r||n<r?t>n?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&t.charCodeAt(s)===r.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,c,u,p,d,m,y,g,I,A,C,w,k=[];for(l=0;l<i;l++)k.push(l+1),k.push(t.charCodeAt(s+l));for(var me=k.length-1;a<o-3;)for(I=r.charCodeAt(s+(c=a)),A=r.charCodeAt(s+(u=a+1)),C=r.charCodeAt(s+(p=a+2)),w=r.charCodeAt(s+(d=a+3)),m=a+=4,l=0;l<me;l+=2)y=k[l],g=k[l+1],c=e(y,c,u,I,g),u=e(c,u,p,A,g),p=e(u,p,d,C,g),m=e(p,d,m,w,g),k[l]=m,d=p,p=u,u=c,c=y;for(;a<o;)for(I=r.charCodeAt(s+(c=a)),m=++a,l=0;l<me;l+=2)y=k[l],k[l]=m=e(y,c,m,I,k[l+1]),c=y;return m}}()});var Xs=Go(()=>{"use strict"});var ea=Go(()=>{"use strict"});var no=z(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.anumber=ro;et.abytes=yl;et.ahash=of;et.aexists=sf;et.aoutput=af;function ro(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function nf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function yl(e,...t){if(!nf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function of(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ro(e.outputLen),ro(e.blockLen)}function sf(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function af(e,t){yl(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var $l=z(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.add5L=v.add5H=v.add4H=v.add4L=v.add3H=v.add3L=v.rotlBL=v.rotlBH=v.rotlSL=v.rotlSH=v.rotr32L=v.rotr32H=v.rotrBL=v.rotrBH=v.rotrSL=v.rotrSH=v.shrSL=v.shrSH=v.toBig=void 0;v.fromBig=oo;v.split=hl;v.add=Ol;var $n=BigInt(2**32-1),io=BigInt(32);function oo(e,t=!1){return t?{h:Number(e&$n),l:Number(e>>io&$n)}:{h:Number(e>>io&$n)|0,l:Number(e&$n)|0}}function hl(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=oo(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var wl=(e,t)=>BigInt(e>>>0)<<io|BigInt(t>>>0);v.toBig=wl;var El=(e,t,r)=>e>>>r;v.shrSH=El;var xl=(e,t,r)=>e<<32-r|t>>>r;v.shrSL=xl;var bl=(e,t,r)=>e>>>r|t<<32-r;v.rotrSH=bl;var Pl=(e,t,r)=>e<<32-r|t>>>r;v.rotrSL=Pl;var vl=(e,t,r)=>e<<64-r|t>>>r-32;v.rotrBH=vl;var Tl=(e,t,r)=>e>>>r-32|t<<64-r;v.rotrBL=Tl;var Al=(e,t)=>t;v.rotr32H=Al;var Cl=(e,t)=>e;v.rotr32L=Cl;var Rl=(e,t,r)=>e<<r|t>>>32-r;v.rotlSH=Rl;var Sl=(e,t,r)=>t<<r|e>>>32-r;v.rotlSL=Sl;var Il=(e,t,r)=>t<<r-32|e>>>64-r;v.rotlBH=Il;var kl=(e,t,r)=>e<<r-32|t>>>64-r;v.rotlBL=kl;function Ol(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Dl=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);v.add3L=Dl;var Nl=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;v.add3H=Nl;var _l=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);v.add4L=_l;var Ml=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;v.add4H=Ml;var Fl=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);v.add5L=Fl;var Ll=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;v.add5H=Ll;var lf={fromBig:oo,split:hl,toBig:wl,shrSH:El,shrSL:xl,rotrSH:bl,rotrSL:Pl,rotrBH:vl,rotrBL:Tl,rotr32H:Al,rotr32L:Cl,rotlSH:Rl,rotlSL:Sl,rotlBH:Il,rotlBL:kl,add:Ol,add3L:Dl,add3H:Nl,add4L:_l,add4H:Ml,add5H:Ll,add5L:Fl};v.default=lf});var Vl=z(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.crypto=void 0;var Qe=Gt("node:crypto");Vn.crypto=Qe&&typeof Qe=="object"&&"webcrypto"in Qe?Qe.webcrypto:Qe&&typeof Qe=="object"&&"randomBytes"in Qe?Qe:void 0});var jl=z(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.Hash=S.nextTick=S.byteSwapIfBE=S.isLE=void 0;S.isBytes=cf;S.u8=uf;S.u32=pf;S.createView=df;S.rotr=mf;S.rotl=ff;S.byteSwap=lo;S.byteSwap32=gf;S.bytesToHex=hf;S.hexToBytes=wf;S.asyncLoop=xf;S.utf8ToBytes=Ul;S.toBytes=qn;S.concatBytes=bf;S.checkOpts=Pf;S.wrapConstructor=vf;S.wrapConstructorWithOpts=Tf;S.wrapXOFConstructorWithOpts=Af;S.randomBytes=Cf;var kt=Vl(),ao=no();function cf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function uf(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function pf(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function df(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function mf(e,t){return e<<32-t|e>>>t}function ff(e,t){return e<<t|e>>>32-t>>>0}S.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function lo(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}S.byteSwapIfBE=S.isLE?e=>e:e=>lo(e);function gf(e){for(let t=0;t<e.length;t++)e[t]=lo(e[t])}var yf=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function hf(e){(0,ao.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=yf[e[r]];return t}var _e={_0:48,_9:57,A:65,F:70,a:97,f:102};function ql(e){if(e>=_e._0&&e<=_e._9)return e-_e._0;if(e>=_e.A&&e<=_e.F)return e-(_e.A-10);if(e>=_e.a&&e<=_e.f)return e-(_e.a-10)}function wf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let s=ql(e.charCodeAt(o)),a=ql(e.charCodeAt(o+1));if(s===void 0||a===void 0){let l=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}n[i]=s*16+a}return n}var Ef=async()=>{};S.nextTick=Ef;async function xf(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);let o=Date.now()-n;o>=0&&o<t||(await(0,S.nextTick)(),n+=o)}}function Ul(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function qn(e){return typeof e=="string"&&(e=Ul(e)),(0,ao.abytes)(e),e}function bf(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,ao.abytes)(i),t+=i.length}let r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return r}var so=class{clone(){return this._cloneInto()}};S.Hash=so;function Pf(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function vf(e){let t=n=>e().update(qn(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Tf(e){let t=(n,i)=>e(i).update(qn(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Af(e){let t=(n,i)=>e(i).update(qn(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Cf(e=32){if(kt.crypto&&typeof kt.crypto.getRandomValues=="function")return kt.crypto.getRandomValues(new Uint8Array(e));if(kt.crypto&&typeof kt.crypto.randomBytes=="function")return kt.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var zl=z(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.shake256=V.shake128=V.keccak_512=V.keccak_384=V.keccak_256=V.keccak_224=V.sha3_512=V.sha3_384=V.sha3_256=V.sha3_224=V.Keccak=void 0;V.keccakP=Wl;var Ot=no(),vr=$l(),Me=jl(),Hl=[],Gl=[],Jl=[],Rf=BigInt(0),Pr=BigInt(1),Sf=BigInt(2),If=BigInt(7),kf=BigInt(256),Of=BigInt(113);for(let e=0,t=Pr,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Hl.push(2*(5*n+r)),Gl.push((e+1)*(e+2)/2%64);let i=Rf;for(let o=0;o<7;o++)t=(t<<Pr^(t>>If)*Of)%kf,t&Sf&&(i^=Pr<<(Pr<<BigInt(o))-Pr);Jl.push(i)}var[Df,Nf]=(0,vr.split)(Jl,!0),Bl=(e,t,r)=>r>32?(0,vr.rotlBH)(e,t,r):(0,vr.rotlSH)(e,t,r),Ql=(e,t,r)=>r>32?(0,vr.rotlBL)(e,t,r):(0,vr.rotlSL)(e,t,r);function Wl(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,l=(s+2)%10,c=r[l],u=r[l+1],p=Bl(c,u,1)^r[a],d=Ql(c,u,1)^r[a+1];for(let m=0;m<50;m+=10)e[s+m]^=p,e[s+m+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=Gl[s],l=Bl(i,o,a),c=Ql(i,o,a),u=Hl[s];i=e[u],o=e[u+1],e[u]=l,e[u+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=Df[n],e[1]^=Nf[n]}r.fill(0)}var Tr=class e extends Me.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Ot.anumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Me.u32)(this.state)}keccak(){Me.isLE||(0,Me.byteSwap32)(this.state32),Wl(this.state32,this.rounds),Me.isLE||(0,Me.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Ot.aexists)(this);let{blockLen:r,state:n}=this;t=(0,Me.toBytes)(t);let i=t.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);for(let a=0;a<s;a++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){(0,Ot.aexists)(this,!1),(0,Ot.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,Ot.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Ot.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new e(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}};V.Keccak=Tr;var He=(e,t,r)=>(0,Me.wrapConstructor)(()=>new Tr(t,e,r));V.sha3_224=He(6,144,224/8);V.sha3_256=He(6,136,256/8);V.sha3_384=He(6,104,384/8);V.sha3_512=He(6,72,512/8);V.keccak_224=He(1,144,224/8);V.keccak_256=He(1,136,256/8);V.keccak_384=He(1,104,384/8);V.keccak_512=He(1,72,512/8);var Kl=(e,t,r)=>(0,Me.wrapXOFConstructorWithOpts)((n={})=>new Tr(t,e,n.dkLen===void 0?r:n.dkLen,!0));V.shake128=Kl(31,168,128/8);V.shake256=Kl(31,136,256/8)});var ic=z((UP,Ge)=>{"use strict";var{sha3_512:_f}=zl(),Zl=24,Ar=32,co=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Xl(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var ec=(e="")=>Xl(_f(e)).toString(36).slice(1),Yl=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),Mf=e=>Yl[Math.floor(e()*Yl.length)],tc=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+co(Ar,t):co(Ar,t);return ec(n).substring(0,Ar)},rc=e=>()=>e++,Ff=476782367,nc=({random:e=Math.random,counter:t=rc(Math.floor(e()*Ff)),length:r=Zl,fingerprint:n=tc({random:e})}={})=>function(){let o=Mf(e),s=Date.now().toString(36),a=t().toString(36),l=co(r,e),c=`${s+l+a+n}`;return`${o+ec(c).substring(1,r)}`},Lf=nc(),$f=(e,{minLength:t=2,maxLength:r=Ar}={})=>{let n=e.length,i=/^[0-9a-z]+$/;try{if(typeof e=="string"&&n>=t&&n<=r&&i.test(e))return!0}finally{}return!1};Ge.exports.getConstants=()=>({defaultLength:Zl,bigLength:Ar});Ge.exports.init=nc;Ge.exports.createId=Lf;Ge.exports.bufToBigInt=Xl;Ge.exports.createCounter=rc;Ge.exports.createFingerprint=tc;Ge.exports.isCuid=$f});var oc=z((jP,Cr)=>{"use strict";var{createId:Vf,init:qf,getConstants:Uf,isCuid:jf}=ic();Cr.exports.createId=Vf;Cr.exports.init=qf;Cr.exports.getConstants=Uf;Cr.exports.isCuid=jf});var Ko={};Jt(Ko,{defineExtension:()=>Jo,getExtensionContext:()=>Wo});function Jo(e){return typeof e=="function"?e:t=>t.$extends(e)}function Wo(e){return e}var Yo={};Jt(Yo,{validator:()=>zo});function zo(...e){return t=>t}var Kr={};Jt(Kr,{$:()=>rs,bgBlack:()=>Ru,bgBlue:()=>Ou,bgCyan:()=>Nu,bgGreen:()=>Iu,bgMagenta:()=>Du,bgRed:()=>Su,bgWhite:()=>_u,bgYellow:()=>ku,black:()=>vu,blue:()=>ze,bold:()=>X,cyan:()=>Se,dim:()=>We,gray:()=>Kt,green:()=>Wt,grey:()=>Cu,hidden:()=>bu,inverse:()=>xu,italic:()=>Eu,magenta:()=>Tu,red:()=>Re,reset:()=>wu,strikethrough:()=>Pu,underline:()=>ie,white:()=>Au,yellow:()=>Ke});var ci,Zo,Xo,es,ts=!0;typeof process<"u"&&({FORCE_COLOR:ci,NODE_DISABLE_COLORS:Zo,NO_COLOR:Xo,TERM:es}=process.env||{},ts=process.stdout&&process.stdout.isTTY);var rs={enabled:!Zo&&Xo==null&&es!=="dumb"&&(ci!=null&&ci!=="0"||ts)};function F(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!rs.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var wu=F(0,0),X=F(1,22),We=F(2,22),Eu=F(3,23),ie=F(4,24),xu=F(7,27),bu=F(8,28),Pu=F(9,29),vu=F(30,39),Re=F(31,39),Wt=F(32,39),Ke=F(33,39),ze=F(34,39),Tu=F(35,39),Se=F(36,39),Au=F(37,39),Kt=F(90,39),Cu=F(90,39),Ru=F(40,49),Su=F(41,49),Iu=F(42,49),ku=F(43,49),Ou=F(44,49),Du=F(45,49),Nu=F(46,49),_u=F(47,49);var Mu=100,ns=["green","yellow","blue","magenta","cyan","red"],zt=[],is=Date.now(),Fu=0,ui=typeof process<"u"?process.env:{};globalThis.DEBUG??=ui.DEBUG??"";globalThis.DEBUG_COLORS??=ui.DEBUG_COLORS?ui.DEBUG_COLORS==="true":!0;var Yt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function Lu(e){let t={color:ns[Fu++%ns.length],enabled:Yt.enabled(e),namespace:e,log:Yt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&zt.push([o,...n]),zt.length>Mu&&zt.shift(),Yt.enabled(o)||i){let l=n.map(u=>typeof u=="string"?u:$u(u)),c=`+${Date.now()-is}ms`;is=Date.now(),globalThis.DEBUG_COLORS?a(Kr[s](X(o)),...l,Kr[s](c)):a(o,...l,c)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var q=new Proxy(Lu,{get:(e,t)=>Yt[t],set:(e,t,r)=>Yt[t]=r});function $u(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function os(e=7500){let t=zt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
`);return t.length<e?t:t.slice(-e)}function ss(){zt.length=0}var as=q;var qu=ls(),pi=qu.version;function ut(e){let t=Uu();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":ju())}function Uu(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function ju(){return"library"}function zr(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var x={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Character:6,Text:7,Date:8,Time:9,DateTime:10,Json:11,Enum:12,Bytes:13,Set:14,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,EnumArray:76,BytesArray:77,UuidArray:78,UnknownNumber:128};var ds=Ce(ps(),1);function mi(e){let t=(0,ds.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var ms="prisma+postgres",Zr=`${ms}:`;function Xr(e){return e?.toString().startsWith(`${Zr}//`)??!1}function fi(e){if(!Xr(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")||t.includes("[::1]")}var Xt={};Jt(Xt,{error:()=>Gu,info:()=>Hu,log:()=>Qu,query:()=>Ju,should:()=>ys,tags:()=>Zt,warn:()=>gi});var Zt={error:Re("prisma:error"),warn:Ke("prisma:warn"),info:Se("prisma:info"),query:ze("prisma:query")},ys={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Qu(...e){console.log(...e)}function gi(e,...t){ys.warn()&&console.warn(`${Zt.warn} ${e}`,...t)}function Hu(e,...t){console.info(`${Zt.info} ${e}`,...t)}function Gu(e,...t){console.error(`${Zt.error} ${e}`,...t)}function Ju(e,...t){console.log(`${Zt.query} ${e}`,...t)}function Ie(e,t){throw new Error(t)}function yi({onlyFirst:e=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}var Wu=yi();function pt(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Wu,"")}import en from"node:path";function hi(e){return en.sep===en.posix.sep?e:e.split(en.sep).join(en.posix.sep)}var Pi=Ce(Ps());import xi from"node:fs";import tr from"node:path";function vs(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],c,u;if(l==="\\")u=a[0],c=u.replace("\\$","$");else{let p=a[2];u=a[0].substring(l.length),c=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",c=r(c)}return o.replace(u,c)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var bi=as("prisma:tryLoadEnv");function rr({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=Ts(e);r.conflictCheck!=="none"&&cp(n,t,r.conflictCheck);let i=null;return As(n?.path,t)||(i=Ts(t)),!n&&!i&&bi("No Environment variables loaded"),i?.dotenvResult.error?console.error(Re(X("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function cp(e,t,r){let n=e?.dotenvResult.parsed,i=!As(e?.path,t);if(n&&t&&i&&xi.existsSync(t)){let o=Pi.default.parse(xi.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=tr.relative(process.cwd(),e.path),l=tr.relative(process.cwd(),t);if(r==="error"){let c=`There is a conflict between env var${s.length>1?"s":""} in ${ie(a)} and ${ie(l)}
Conflicting env vars:
${s.map(u=>` ${X(u)}`).join(`
`)}
We suggest to move the contents of ${ie(l)} to ${ie(a)} to consolidate your env vars.
`;throw new Error(c)}else if(r==="warn"){let c=`Conflict for env var${s.length>1?"s":""} ${s.map(u=>X(u)).join(", ")} in ${ie(a)} and ${ie(l)}
Env vars from ${ie(l)} overwrite the ones from ${ie(a)}
`;console.warn(`${Ke("warn(prisma)")} ${c}`)}}}}function Ts(e){if(up(e)){bi(`Environment variables loaded from ${e}`);let t=Pi.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:vs(t),message:We(`Environment variables loaded from ${tr.relative(process.cwd(),e)}`),path:e}}else bi(`Environment variables not found at ${e}`);return null}function As(e,t){return e&&t&&tr.resolve(e)===tr.resolve(t)}function up(e){return!!(e&&xi.existsSync(e))}function vi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function rn(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function Ti(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n<e.length;n++)t(r,e[n])<0&&(r=e[n]);return r}function P(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var Rs=new Set,nn=(e,t,...r)=>{Rs.has(e)||(Rs.add(e),gi(t,...r))};var _=class e extends Error{clientVersion;errorCode;retryable;constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};P(_,"PrismaClientInitializationError");var B=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};P(B,"PrismaClientKnownRequestError");var oe=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};P(oe,"PrismaClientRustPanicError");var Y=class extends Error{clientVersion;batchRequestIdx;constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};P(Y,"PrismaClientUnknownRequestError");var ee=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};P(ee,"PrismaClientValidationError");var we=class{_map=new Map;get(t){return this._map.get(t)?.value}set(t,r){this._map.set(t,{value:r})}getOrCreate(t,r){let n=this._map.get(t);if(n)return n.value;let i=r();return this.set(t,i),i}};function Le(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Is(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function nr(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function pp(e){return{models:Ai(e.models),enums:Ai(e.enums),types:Ai(e.types)}}function Ai(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function dt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function on(e){return e.toString()!=="Invalid Date"}var mt=9e15,Ue=1e9,Ci="0123456789abcdef",ln="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",cn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ri={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-mt,maxE:mt,crypto:!1},Ns,Oe,b=!0,pn="[DecimalError] ",qe=pn+"Invalid argument: ",_s=pn+"Precision limit exceeded",Ms=pn+"crypto unavailable",Fs="[object Decimal]",Z=Math.floor,Q=Math.pow,dp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,mp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,fp=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ls=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe=1e7,E=7,gp=9007199254740991,yp=ln.length-1,Si=cn.length-1,f={toStringTag:Fs};f.absoluteValue=f.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),h(e)};f.ceil=function(){return h(new this.constructor(this),this.e+1,2)};f.clampedTo=f.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(qe+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};f.comparedTo=f.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,c=e.s;if(!s||!a)return!l||!c?NaN:l!==c?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-c:0;if(l!==c)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};f.cosine=f.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+E,n.rounding=1,r=hp(n,js(n,r)),n.precision=e,n.rounding=t,h(Oe==2||Oe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};f.cubeRoot=f.cbrt=function(){var e,t,r,n,i,o,s,a,l,c,u=this,p=u.constructor;if(!u.isFinite()||u.isZero())return new p(u);for(b=!1,o=u.s*Q(u.s*u,1/3),!o||Math.abs(o)==1/0?(r=G(u.d),e=u.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=Q(r,1/3),e=Z((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=u.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),c=l.plus(u),n=M(c.plus(u).times(a),c.plus(l),s+2,1),G(a.d).slice(0,s)===(r=G(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(h(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(h(n,e+1,1),t=!n.times(n).times(n).eq(u));break}return b=!0,h(n,e,p.rounding,t)};f.decimalPlaces=f.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Z(this.e/E))*E,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};f.dividedBy=f.div=function(e){return M(this,new this.constructor(e))};f.dividedToIntegerBy=f.divToInt=function(e){var t=this,r=t.constructor;return h(M(t,new r(e),0,1,1),r.precision,r.rounding)};f.equals=f.eq=function(e){return this.cmp(e)===0};f.floor=function(){return h(new this.constructor(this),this.e+1,3)};f.greaterThan=f.gt=function(e){return this.cmp(e)>0};f.greaterThanOrEqualTo=f.gte=function(e){var t=this.cmp(e);return t==1||t===0};f.hyperbolicCosine=f.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/mn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=ft(s,1,o.times(t),new s(1),!0);for(var l,c=e,u=new s(8);c--;)l=o.times(o),o=a.minus(l.times(u.minus(l.times(u))));return h(o,s.precision=r,s.rounding=n,!0)};f.hyperbolicSine=f.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=ft(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/mn(5,e)),i=ft(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),c=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(c))))}return o.precision=t,o.rounding=r,h(i,t,r,!0)};f.hyperbolicTangent=f.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,M(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};f.inverseCosine=f.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?Ee(t,n,i):new t(0):new t(NaN):e.isZero()?Ee(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};f.inverseHyperbolicCosine=f.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,b=!1,r=r.times(r).minus(1).sqrt().plus(r),b=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};f.inverseHyperbolicSine=f.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,b=!1,r=r.times(r).plus(1).sqrt().plus(r),b=!0,n.precision=e,n.rounding=t,r.ln())};f.inverseHyperbolicTangent=f.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?h(new o(i),e,t,!0):(o.precision=r=n-i.e,i=M(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};f.inverseSine=f.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=Ee(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};f.inverseTangent=f.atan=function(){var e,t,r,n,i,o,s,a,l,c=this,u=c.constructor,p=u.precision,d=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&p+4<=Si)return s=Ee(u,p+4,d).times(.25),s.s=c.s,s}else{if(!c.s)return new u(NaN);if(p+4<=Si)return s=Ee(u,p+4,d).times(.5),s.s=c.s,s}for(u.precision=a=p+10,u.rounding=1,r=Math.min(28,a/E+2|0),e=r;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(b=!1,t=Math.ceil(a/E),n=1,l=c.times(c),s=new u(c),i=c;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),b=!0,h(s,u.precision=p,u.rounding=d,!0)};f.isFinite=function(){return!!this.d};f.isInteger=f.isInt=function(){return!!this.d&&Z(this.e/E)>this.d.length-2};f.isNaN=function(){return!this.s};f.isNegative=f.isNeg=function(){return this.s<0};f.isPositive=f.isPos=function(){return this.s>0};f.isZero=function(){return!!this.d&&this.d[0]===0};f.lessThan=f.lt=function(e){return this.cmp(e)<0};f.lessThanOrEqualTo=f.lte=function(e){return this.cmp(e)<1};f.logarithm=f.log=function(e){var t,r,n,i,o,s,a,l,c=this,u=c.constructor,p=u.precision,d=u.rounding,m=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new u(r&&!r[0]?-1/0:c.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(b=!1,a=p+m,s=Ve(c,a),n=t?un(u,a+10):Ve(e,a),l=M(s,n,a,1),ir(l.d,i=p,d))do if(a+=10,s=Ve(c,a),n=t?un(u,a+10):Ve(e,a),l=M(s,n,a,1),!o){+G(l.d).slice(i+1,i+15)+1==1e14&&(l=h(l,p+1,0));break}while(ir(l.d,i+=10,d));return b=!0,h(l,p,d)};f.minus=f.sub=function(e){var t,r,n,i,o,s,a,l,c,u,p,d,m=this,y=m.constructor;if(e=new y(e),!m.d||!e.d)return!m.s||!e.s?e=new y(NaN):m.d?e.s=-e.s:e=new y(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,d=e.d,a=y.precision,l=y.rounding,!c[0]||!d[0]){if(d[0])e.s=-e.s;else if(c[0])e=new y(m);else return new y(l===3?-0:0);return b?h(e,a,l):e}if(r=Z(e.e/E),u=Z(m.e/E),c=c.slice(),o=u-r,o){for(p=o<0,p?(t=c,o=-o,s=d.length):(t=d,r=u,s=c.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=c.length,s=d.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(c[n]!=d[n]){p=c[n]<d[n];break}o=0}for(p&&(t=c,c=d,d=t,e.s=-e.s),s=c.length,n=d.length-s;n>0;--n)c[s++]=0;for(n=d.length;n>o;){if(c[--n]<d[n]){for(i=n;i&&c[--i]===0;)c[i]=fe-1;--c[i],c[n]+=fe}c[n]-=d[n]}for(;c[--s]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(e.d=c,e.e=dn(c,r),b?h(e,a,l):e):new y(l===3?-0:0)};f.modulo=f.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?h(new n(r),n.precision,n.rounding):(b=!1,n.modulo==9?(t=M(r,e.abs(),0,3,1),t.s*=e.s):t=M(r,e,0,n.modulo,1),t=t.times(e),b=!0,r.minus(t))};f.naturalExponential=f.exp=function(){return Ii(this)};f.naturalLogarithm=f.ln=function(){return Ve(this)};f.negated=f.neg=function(){var e=new this.constructor(this);return e.s=-e.s,h(e)};f.plus=f.add=function(e){var t,r,n,i,o,s,a,l,c,u,p=this,d=p.constructor;if(e=new d(e),!p.d||!e.d)return!p.s||!e.s?e=new d(NaN):p.d||(e=new d(e.d||p.s===e.s?p:NaN)),e;if(p.s!=e.s)return e.s=-e.s,p.minus(e);if(c=p.d,u=e.d,a=d.precision,l=d.rounding,!c[0]||!u[0])return u[0]||(e=new d(p)),b?h(e,a,l):e;if(o=Z(p.e/E),n=Z(e.e/E),c=c.slice(),i=o-n,i){for(i<0?(r=c,i=-i,s=u.length):(r=u,n=o,s=c.length),o=Math.ceil(a/E),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=c.length,i=u.length,s-i<0&&(i=s,r=u,u=c,c=r),t=0;i;)t=(c[--i]=c[i]+u[i]+t)/fe|0,c[i]%=fe;for(t&&(c.unshift(t),++n),s=c.length;c[--s]==0;)c.pop();return e.d=c,e.e=dn(c,n),b?h(e,a,l):e};f.precision=f.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(qe+e);return r.d?(t=$s(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};f.round=function(){var e=this,t=e.constructor;return h(new t(e),e.e+1,t.rounding)};f.sine=f.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+E,n.rounding=1,r=Ep(n,js(n,r)),n.precision=e,n.rounding=t,h(Oe>2?r.neg():r,e,t,!0)):new n(NaN)};f.squareRoot=f.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,c=s.s,u=s.constructor;if(c!==1||!a||!a[0])return new u(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);for(b=!1,c=Math.sqrt(+s),c==0||c==1/0?(t=G(a),(t.length+l)%2==0&&(t+="0"),c=Math.sqrt(t),l=Z((l+1)/2)-(l<0||l%2),c==1/0?t="5e"+l:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new u(t)):n=new u(c.toString()),r=(l=u.precision)+3;;)if(o=n,n=o.plus(M(s,o,r+2,1)).times(.5),G(o.d).slice(0,r)===(t=G(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(h(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(h(n,l+1,1),e=!n.times(n).eq(s));break}return b=!0,h(n,l,u.rounding,e)};f.tangent=f.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=M(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,h(Oe==2||Oe==4?r.neg():r,e,t,!0)):new n(NaN)};f.times=f.mul=function(e){var t,r,n,i,o,s,a,l,c,u=this,p=u.constructor,d=u.d,m=(e=new p(e)).d;if(e.s*=u.s,!d||!d[0]||!m||!m[0])return new p(!e.s||d&&!d[0]&&!m||m&&!m[0]&&!d?NaN:!d||!m?e.s/0:e.s*0);for(r=Z(u.e/E)+Z(e.e/E),l=d.length,c=m.length,l<c&&(o=d,d=m,m=o,s=l,l=c,c=s),o=[],s=l+c,n=s;n--;)o.push(0);for(n=c;--n>=0;){for(t=0,i=l+n;i>n;)a=o[i]+m[n]*d[i-n-1]+t,o[i--]=a%fe|0,t=a/fe|0;o[i]=(o[i]+t)%fe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=dn(o,r),b?h(e,p.precision,p.rounding):e};f.toBinary=function(e,t){return ki(this,2,e,t)};f.toDecimalPlaces=f.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(se(e,0,Ue),t===void 0?t=n.rounding:se(t,0,8),h(r,e+r.e+1,t))};f.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,!0):(se(e,0,Ue),t===void 0?t=i.rounding:se(t,0,8),n=h(new i(n),e+1,t),r=xe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};f.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=xe(i):(se(e,0,Ue),t===void 0?t=o.rounding:se(t,0,8),n=h(new o(i),e+i.e+1,t),r=xe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};f.toFraction=function(e){var t,r,n,i,o,s,a,l,c,u,p,d,m=this,y=m.d,g=m.constructor;if(!y)return new g(m);if(c=r=new g(1),n=l=new g(0),t=new g(n),o=t.e=$s(y)-m.e-1,s=o%E,t.d[0]=Q(10,s<0?E+s:s),e==null)e=o>0?t:c;else{if(a=new g(e),!a.isInt()||a.lt(c))throw Error(qe+a);e=a.gt(t)?o>0?t:c:a}for(b=!1,a=new g(G(y)),u=g.precision,g.precision=o=y.length*E*2;p=M(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=c,c=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=M(e.minus(r),n,0,1,1),l=l.plus(i.times(c)),r=r.plus(i.times(n)),l.s=c.s=m.s,d=M(c,n,o,1).minus(m).abs().cmp(M(l,r,o,1).minus(m).abs())<1?[c,n]:[l,r],g.precision=u,b=!0,d};f.toHexadecimal=f.toHex=function(e,t){return ki(this,16,e,t)};f.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:se(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(b=!1,r=M(r,e,0,t,1).times(e),b=!0,h(r)):(e.s=r.s,r=e),r};f.toNumber=function(){return+this};f.toOctal=function(e,t){return ki(this,8,e,t)};f.toPower=f.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,c=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Q(+a,c));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return h(a,n,o);if(t=Z(e.e/E),t>=e.d.length-1&&(r=c<0?-c:c)<=gp)return i=Vs(l,a,r,n),e.s<0?new l(1).div(i):h(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new l(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=Q(+a,c),t=r==0||!isFinite(r)?Z(c*(Math.log("0."+G(a.d))/Math.LN10+a.e+1)):new l(r+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(b=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Ii(e.times(Ve(a,n+r)),n),i.d&&(i=h(i,n+5,1),ir(i.d,n,o)&&(t=n+10,i=h(Ii(e.times(Ve(a,t+r)),t),t+5,1),+G(i.d).slice(n+1,n+15)+1==1e14&&(i=h(i,n+1,0)))),i.s=s,b=!0,l.rounding=o,h(i,n,o))};f.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?