@prisma/studio-core 0.0.0-dev.202503251921 → 0.0.0-dev.202503251940

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ var c={postgres:{encoded:"ZGF0YXNvdXJjZSBkYiB7CiAgICBwcm92aWRlciA9ICJwb3N0Z3JlcyIKICAgIHVybCAgICAgID0gZW52KCJEQVRBQkFTRV9VUkwiKQp9CiAgICAKZ2VuZXJhdG9yIGNsaWVudCB7CiAgICBwcm92aWRlciA9ICJwcmlzbWEtY2xpZW50LWpzIgp9",hash:"54195896aeafa3318ca33f5a8bb44c6b4d89c368cb15288f3bd5ace35a3f9227"}};export{c as a};
@@ -1,30 +1 @@
1
- "use strict";var uo=Object.create;var Nt=Object.defineProperty;var co=Object.getOwnPropertyDescriptor;var ho=Object.getOwnPropertyNames;var fo=Object.getPrototypeOf,po=Object.prototype.hasOwnProperty;var go=(e,t)=>()=>(e&&(t=e(e=0)),t);var mo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yo=(e,t)=>{for(var r in t)Nt(e,r,{get:t[r],enumerable:!0})},ln=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ho(t))!po.call(e,i)&&i!==r&&Nt(e,i,{get:()=>t[i],enumerable:!(n=co(t,i))||n.enumerable});return e};var un=(e,t,r)=>(r=e!=null?uo(fo(e)):{},ln(t||!e||!e.__esModule?Nt(r,"default",{value:e,enumerable:!0}):r,e)),wo=e=>ln(Nt({},"__esModule",{value:!0}),e);var $t,Be=go(()=>{$t={postgres:{encoded:"ZGF0YXNvdXJjZSBkYiB7CiAgICBwcm92aWRlciA9ICJwb3N0Z3JlcyIKICAgIHVybCAgICAgID0gZW52KCJEQVRBQkFTRV9VUkwiKQp9CiAgICAKZ2VuZXJhdG9yIGNsaWVudCB7CiAgICBwcm92aWRlciA9ICJwcmlzbWEtY2xpZW50LWpzIgp9",hash:"54195896aeafa3318ca33f5a8bb44c6b4d89c368cb15288f3bd5ace35a3f9227"}}});var Qs=mo((ad,Js)=>{"use strict";Be();var bo=Object.create,Et=Object.defineProperty,Eo=Object.getOwnPropertyDescriptor,Po=Object.getOwnPropertyNames,xo=Object.getPrototypeOf,Ao=Object.prototype.hasOwnProperty,_o=(e,t,r)=>t in e?Et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ve=(e,t)=>()=>(e&&(t=e(e=0)),t),We=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qt=(e,t)=>{for(var r in t)Et(e,r,{get:t[r],enumerable:!0})},Gn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Po(t))!Ao.call(e,i)&&i!==r&&Et(e,i,{get:()=>t[i],enumerable:!(n=Eo(t,i))||n.enumerable});return e},st=(e,t,r)=>(r=e!=null?bo(xo(e)):{},Gn(t||!e||!e.__esModule?Et(r,"default",{value:e,enumerable:!0}):r,e)),So=e=>Gn(Et({},"__esModule",{value:!0}),e),A=(e,t,r)=>_o(e,typeof t!="symbol"?t+"":t,r),te,y=Ve(()=>{"use strict";te={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}}),Ro,w=Ve(()=>{"use strict";Ro=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()}),nr,v=Ve(()=>{"use strict";nr=()=>{},nr.prototype=nr}),b=Ve(()=>{"use strict"}),No=We(e=>{"use strict";E(),y(),w(),v(),b();var t=(o,l)=>()=>(l||o((l={exports:{}}).exports,l),l.exports),r=t(o=>{"use strict";o.byteLength=B,o.toByteArray=F,o.fromByteArray=Te;var l=[],u=[],p=typeof Uint8Array<"u"?Uint8Array:Array,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(P=0,S=g.length;P<S;++P)l[P]=g[P],u[g.charCodeAt(P)]=P;var P,S;u[45]=62,u[95]=63;function k(M){var j=M.length;if(j%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var K=M.indexOf("=");K===-1&&(K=j);var ae=K===j?0:4-K%4;return[K,ae]}function B(M){var j=k(M),K=j[0],ae=j[1];return(K+ae)*3/4-ae}function q(M,j,K){return(j+K)*3/4-K}function F(M){var j,K=k(M),ae=K[0],pe=K[1],re=new p(q(M,ae,pe)),ge=0,ct=pe>0?ae-4:ae,me;for(me=0;me<ct;me+=4)j=u[M.charCodeAt(me)]<<18|u[M.charCodeAt(me+1)]<<12|u[M.charCodeAt(me+2)]<<6|u[M.charCodeAt(me+3)],re[ge++]=j>>16&255,re[ge++]=j>>8&255,re[ge++]=j&255;return pe===2&&(j=u[M.charCodeAt(me)]<<2|u[M.charCodeAt(me+1)]>>4,re[ge++]=j&255),pe===1&&(j=u[M.charCodeAt(me)]<<10|u[M.charCodeAt(me+1)]<<4|u[M.charCodeAt(me+2)]>>2,re[ge++]=j>>8&255,re[ge++]=j&255),re}function I(M){return l[M>>18&63]+l[M>>12&63]+l[M>>6&63]+l[M&63]}function oe(M,j,K){for(var ae,pe=[],re=j;re<K;re+=3)ae=(M[re]<<16&16711680)+(M[re+1]<<8&65280)+(M[re+2]&255),pe.push(I(ae));return pe.join("")}function Te(M){for(var j,K=M.length,ae=K%3,pe=[],re=16383,ge=0,ct=K-ae;ge<ct;ge+=re)pe.push(oe(M,ge,ge+re>ct?ct:ge+re));return ae===1?(j=M[K-1],pe.push(l[j>>2]+l[j<<4&63]+"==")):ae===2&&(j=(M[K-2]<<8)+M[K-1],pe.push(l[j>>10]+l[j>>4&63]+l[j<<2&63]+"=")),pe.join("")}}),n=t(o=>{o.read=function(l,u,p,g,P){var S,k,B=P*8-g-1,q=(1<<B)-1,F=q>>1,I=-7,oe=p?P-1:0,Te=p?-1:1,M=l[u+oe];for(oe+=Te,S=M&(1<<-I)-1,M>>=-I,I+=B;I>0;S=S*256+l[u+oe],oe+=Te,I-=8);for(k=S&(1<<-I)-1,S>>=-I,I+=g;I>0;k=k*256+l[u+oe],oe+=Te,I-=8);if(S===0)S=1-F;else{if(S===q)return k?NaN:(M?-1:1)*(1/0);k=k+Math.pow(2,g),S=S-F}return(M?-1:1)*k*Math.pow(2,S-g)},o.write=function(l,u,p,g,P,S){var k,B,q,F=S*8-P-1,I=(1<<F)-1,oe=I>>1,Te=P===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=g?0:S-1,j=g?1:-1,K=u<0||u===0&&1/u<0?1:0;for(u=Math.abs(u),isNaN(u)||u===1/0?(B=isNaN(u)?1:0,k=I):(k=Math.floor(Math.log(u)/Math.LN2),u*(q=Math.pow(2,-k))<1&&(k--,q*=2),k+oe>=1?u+=Te/q:u+=Te*Math.pow(2,1-oe),u*q>=2&&(k++,q/=2),k+oe>=I?(B=0,k=I):k+oe>=1?(B=(u*q-1)*Math.pow(2,P),k=k+oe):(B=u*Math.pow(2,oe-1)*Math.pow(2,P),k=0));P>=8;l[p+M]=B&255,M+=j,B/=256,P-=8);for(k=k<<P|B,F+=P;F>0;l[p+M]=k&255,M+=j,k/=256,F-=8);l[p+M-j]|=K*128}}),i=r(),s=n(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=h,e.SlowBuffer=_e,e.INSPECT_MAX_BYTES=50;var c=2147483647;e.kMaxLength=c,h.TYPED_ARRAY_SUPPORT=d(),!h.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let o=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(o,l),o.foo()===42}catch{return!1}}Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}});function f(o){if(o>c)throw new RangeError('The value "'+o+'" is invalid for option "size"');let l=new Uint8Array(o);return Object.setPrototypeOf(l,h.prototype),l}function h(o,l,u){if(typeof o=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return $(o)}return m(o,l,u)}h.poolSize=8192;function m(o,l,u){if(typeof o=="string")return N(o,l);if(ArrayBuffer.isView(o))return D(o);if(o==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof o);if(be(o,ArrayBuffer)||o&&be(o.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(be(o,SharedArrayBuffer)||o&&be(o.buffer,SharedArrayBuffer)))return Z(o,l,u);if(typeof o=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let p=o.valueOf&&o.valueOf();if(p!=null&&p!==o)return h.from(p,l,u);let g=V(o);if(g)return g;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof o[Symbol.toPrimitive]=="function")return h.from(o[Symbol.toPrimitive]("string"),l,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof o)}h.from=function(o,l,u){return m(o,l,u)},Object.setPrototypeOf(h.prototype,Uint8Array.prototype),Object.setPrototypeOf(h,Uint8Array);function x(o){if(typeof o!="number")throw new TypeError('"size" argument must be of type number');if(o<0)throw new RangeError('The value "'+o+'" is invalid for option "size"')}function R(o,l,u){return x(o),o<=0?f(o):l!==void 0?typeof u=="string"?f(o).fill(l,u):f(o).fill(l):f(o)}h.alloc=function(o,l,u){return R(o,l,u)};function $(o){return x(o),f(o<0?0:W(o)|0)}h.allocUnsafe=function(o){return $(o)},h.allocUnsafeSlow=function(o){return $(o)};function N(o,l){if((typeof l!="string"||l==="")&&(l="utf8"),!h.isEncoding(l))throw new TypeError("Unknown encoding: "+l);let u=G(o,l)|0,p=f(u),g=p.write(o,l);return g!==u&&(p=p.slice(0,g)),p}function U(o){let l=o.length<0?0:W(o.length)|0,u=f(l);for(let p=0;p<l;p+=1)u[p]=o[p]&255;return u}function D(o){if(be(o,Uint8Array)){let l=new Uint8Array(o);return Z(l.buffer,l.byteOffset,l.byteLength)}return U(o)}function Z(o,l,u){if(l<0||o.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(o.byteLength<l+(u||0))throw new RangeError('"length" is outside of buffer bounds');let p;return l===void 0&&u===void 0?p=new Uint8Array(o):u===void 0?p=new Uint8Array(o,l):p=new Uint8Array(o,l,u),Object.setPrototypeOf(p,h.prototype),p}function V(o){if(h.isBuffer(o)){let l=W(o.length)|0,u=f(l);return u.length===0||o.copy(u,0,0,l),u}if(o.length!==void 0)return typeof o.length!="number"||rr(o.length)?f(0):U(o);if(o.type==="Buffer"&&Array.isArray(o.data))return U(o.data)}function W(o){if(o>=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return o|0}function _e(o){return+o!=o&&(o=0),h.alloc(+o)}h.isBuffer=function(o){return o!=null&&o._isBuffer===!0&&o!==h.prototype},h.compare=function(o,l){if(be(o,Uint8Array)&&(o=h.from(o,o.offset,o.byteLength)),be(l,Uint8Array)&&(l=h.from(l,l.offset,l.byteLength)),!h.isBuffer(o)||!h.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(o===l)return 0;let u=o.length,p=l.length;for(let g=0,P=Math.min(u,p);g<P;++g)if(o[g]!==l[g]){u=o[g],p=l[g];break}return u<p?-1:p<u?1:0},h.isEncoding=function(o){switch(String(o).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(o,l){if(!Array.isArray(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return h.alloc(0);let u;if(l===void 0)for(l=0,u=0;u<o.length;++u)l+=o[u].length;let p=h.allocUnsafe(l),g=0;for(u=0;u<o.length;++u){let P=o[u];if(be(P,Uint8Array))g+P.length>p.length?(h.isBuffer(P)||(P=h.from(P)),P.copy(p,g)):Uint8Array.prototype.set.call(p,P,g);else if(h.isBuffer(P))P.copy(p,g);else throw new TypeError('"list" argument must be an Array of Buffers');g+=P.length}return p};function G(o,l){if(h.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||be(o,ArrayBuffer))return o.byteLength;if(typeof o!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof o);let u=o.length,p=arguments.length>2&&arguments[2]===!0;if(!p&&u===0)return 0;let g=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":return tr(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return an(o).length;default:if(g)return p?-1:tr(o).length;l=(""+l).toLowerCase(),g=!0}}h.byteLength=G;function Oe(o,l,u){let p=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((u===void 0||u>this.length)&&(u=this.length),u<=0)||(u>>>=0,l>>>=0,u<=l))return"";for(o||(o="utf8");;)switch(o){case"hex":return eo(this,l,u);case"utf8":case"utf-8":return Zr(this,l,u);case"ascii":return Ys(this,l,u);case"latin1":case"binary":return Xs(this,l,u);case"base64":return L(this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return to(this,l,u);default:if(p)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),p=!0}}h.prototype._isBuffer=!0;function fe(o,l,u){let p=o[l];o[l]=o[u],o[u]=p}h.prototype.swap16=function(){let o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let l=0;l<o;l+=2)fe(this,l,l+1);return this},h.prototype.swap32=function(){let o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let l=0;l<o;l+=4)fe(this,l,l+3),fe(this,l+1,l+2);return this},h.prototype.swap64=function(){let o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let l=0;l<o;l+=8)fe(this,l,l+7),fe(this,l+1,l+6),fe(this,l+2,l+5),fe(this,l+3,l+4);return this},h.prototype.toString=function(){let o=this.length;return o===0?"":arguments.length===0?Zr(this,0,o):Oe.apply(this,arguments)},h.prototype.toLocaleString=h.prototype.toString,h.prototype.equals=function(o){if(!h.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:h.compare(this,o)===0},h.prototype.inspect=function(){let o="",l=e.INSPECT_MAX_BYTES;return o=this.toString("hex",0,l).replace(/(.{2})/g,"$1 ").trim(),this.length>l&&(o+=" ... "),"<Buffer "+o+">"},a&&(h.prototype[a]=h.prototype.inspect),h.prototype.compare=function(o,l,u,p,g){if(be(o,Uint8Array)&&(o=h.from(o,o.offset,o.byteLength)),!h.isBuffer(o))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof o);if(l===void 0&&(l=0),u===void 0&&(u=o?o.length:0),p===void 0&&(p=0),g===void 0&&(g=this.length),l<0||u>o.length||p<0||g>this.length)throw new RangeError("out of range index");if(p>=g&&l>=u)return 0;if(p>=g)return-1;if(l>=u)return 1;if(l>>>=0,u>>>=0,p>>>=0,g>>>=0,this===o)return 0;let P=g-p,S=u-l,k=Math.min(P,S),B=this.slice(p,g),q=o.slice(l,u);for(let F=0;F<k;++F)if(B[F]!==q[F]){P=B[F],S=q[F];break}return P<S?-1:S<P?1:0};function ke(o,l,u,p,g){if(o.length===0)return-1;if(typeof u=="string"?(p=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,rr(u)&&(u=g?0:o.length-1),u<0&&(u=o.length+u),u>=o.length){if(g)return-1;u=o.length-1}else if(u<0)if(g)u=0;else return-1;if(typeof l=="string"&&(l=h.from(l,p)),h.isBuffer(l))return l.length===0?-1:Ke(o,l,u,p,g);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?g?Uint8Array.prototype.indexOf.call(o,l,u):Uint8Array.prototype.lastIndexOf.call(o,l,u):Ke(o,[l],u,p,g);throw new TypeError("val must be string, number or Buffer")}function Ke(o,l,u,p,g){let P=1,S=o.length,k=l.length;if(p!==void 0&&(p=String(p).toLowerCase(),p==="ucs2"||p==="ucs-2"||p==="utf16le"||p==="utf-16le")){if(o.length<2||l.length<2)return-1;P=2,S/=2,k/=2,u/=2}function B(F,I){return P===1?F[I]:F.readUInt16BE(I*P)}let q;if(g){let F=-1;for(q=u;q<S;q++)if(B(o,q)===B(l,F===-1?0:q-F)){if(F===-1&&(F=q),q-F+1===k)return F*P}else F!==-1&&(q-=q-F),F=-1}else for(u+k>S&&(u=S-k),q=u;q>=0;q--){let F=!0;for(let I=0;I<k;I++)if(B(o,q+I)!==B(l,I)){F=!1;break}if(F)return q}return-1}h.prototype.includes=function(o,l,u){return this.indexOf(o,l,u)!==-1},h.prototype.indexOf=function(o,l,u){return ke(this,o,l,u,!0)},h.prototype.lastIndexOf=function(o,l,u){return ke(this,o,l,u,!1)};function he(o,l,u,p){u=Number(u)||0;let g=o.length-u;p?(p=Number(p),p>g&&(p=g)):p=g;let P=l.length;p>P/2&&(p=P/2);let S;for(S=0;S<p;++S){let k=parseInt(l.substr(S*2,2),16);if(rr(k))return S;o[u+S]=k}return S}function Ge(o,l,u,p){return Rt(tr(l,o.length-u),o,u,p)}function ze(o,l,u,p){return Rt(so(l),o,u,p)}function lt(o,l,u,p){return Rt(an(l),o,u,p)}function X(o,l,u,p){return Rt(oo(l,o.length-u),o,u,p)}h.prototype.write=function(o,l,u,p){if(l===void 0)p="utf8",u=this.length,l=0;else if(u===void 0&&typeof l=="string")p=l,u=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(u)?(u=u>>>0,p===void 0&&(p="utf8")):(p=u,u=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let g=this.length-l;if((u===void 0||u>g)&&(u=g),o.length>0&&(u<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");p||(p="utf8");let P=!1;for(;;)switch(p){case"hex":return he(this,o,l,u);case"utf8":case"utf-8":return Ge(this,o,l,u);case"ascii":case"latin1":case"binary":return ze(this,o,l,u);case"base64":return lt(this,o,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,o,l,u);default:if(P)throw new TypeError("Unknown encoding: "+p);p=(""+p).toLowerCase(),P=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(o,l,u){return l===0&&u===o.length?i.fromByteArray(o):i.fromByteArray(o.slice(l,u))}function Zr(o,l,u){u=Math.min(o.length,u);let p=[],g=l;for(;g<u;){let P=o[g],S=null,k=P>239?4:P>223?3:P>191?2:1;if(g+k<=u){let B,q,F,I;switch(k){case 1:P<128&&(S=P);break;case 2:B=o[g+1],(B&192)===128&&(I=(P&31)<<6|B&63,I>127&&(S=I));break;case 3:B=o[g+1],q=o[g+2],(B&192)===128&&(q&192)===128&&(I=(P&15)<<12|(B&63)<<6|q&63,I>2047&&(I<55296||I>57343)&&(S=I));break;case 4:B=o[g+1],q=o[g+2],F=o[g+3],(B&192)===128&&(q&192)===128&&(F&192)===128&&(I=(P&15)<<18|(B&63)<<12|(q&63)<<6|F&63,I>65535&&I<1114112&&(S=I))}}S===null?(S=65533,k=1):S>65535&&(S-=65536,p.push(S>>>10&1023|55296),S=56320|S&1023),p.push(S),g+=k}return Zs(p)}var Yr=4096;function Zs(o){let l=o.length;if(l<=Yr)return String.fromCharCode.apply(String,o);let u="",p=0;for(;p<l;)u+=String.fromCharCode.apply(String,o.slice(p,p+=Yr));return u}function Ys(o,l,u){let p="";u=Math.min(o.length,u);for(let g=l;g<u;++g)p+=String.fromCharCode(o[g]&127);return p}function Xs(o,l,u){let p="";u=Math.min(o.length,u);for(let g=l;g<u;++g)p+=String.fromCharCode(o[g]);return p}function eo(o,l,u){let p=o.length;(!l||l<0)&&(l=0),(!u||u<0||u>p)&&(u=p);let g="";for(let P=l;P<u;++P)g+=ao[o[P]];return g}function to(o,l,u){let p=o.slice(l,u),g="";for(let P=0;P<p.length-1;P+=2)g+=String.fromCharCode(p[P]+p[P+1]*256);return g}h.prototype.slice=function(o,l){let u=this.length;o=~~o,l=l===void 0?u:~~l,o<0?(o+=u,o<0&&(o=0)):o>u&&(o=u),l<0?(l+=u,l<0&&(l=0)):l>u&&(l=u),l<o&&(l=o);let p=this.subarray(o,l);return Object.setPrototypeOf(p,h.prototype),p};function ee(o,l,u){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+l>u)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(o,l,u){o=o>>>0,l=l>>>0,u||ee(o,l,this.length);let p=this[o],g=1,P=0;for(;++P<l&&(g*=256);)p+=this[o+P]*g;return p},h.prototype.readUintBE=h.prototype.readUIntBE=function(o,l,u){o=o>>>0,l=l>>>0,u||ee(o,l,this.length);let p=this[o+--l],g=1;for(;l>0&&(g*=256);)p+=this[o+--l]*g;return p},h.prototype.readUint8=h.prototype.readUInt8=function(o,l){return o=o>>>0,l||ee(o,1,this.length),this[o]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(o,l){return o=o>>>0,l||ee(o,2,this.length),this[o]|this[o+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(o,l){return o=o>>>0,l||ee(o,2,this.length),this[o]<<8|this[o+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(o,l){return o=o>>>0,l||ee(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(o,l){return o=o>>>0,l||ee(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])},h.prototype.readBigUInt64LE=Ce(function(o){o=o>>>0,Ye(o,"offset");let l=this[o],u=this[o+7];(l===void 0||u===void 0)&&ut(o,this.length-8);let p=l+this[++o]*2**8+this[++o]*2**16+this[++o]*2**24,g=this[++o]+this[++o]*2**8+this[++o]*2**16+u*2**24;return BigInt(p)+(BigInt(g)<<BigInt(32))}),h.prototype.readBigUInt64BE=Ce(function(o){o=o>>>0,Ye(o,"offset");let l=this[o],u=this[o+7];(l===void 0||u===void 0)&&ut(o,this.length-8);let p=l*2**24+this[++o]*2**16+this[++o]*2**8+this[++o],g=this[++o]*2**24+this[++o]*2**16+this[++o]*2**8+u;return(BigInt(p)<<BigInt(32))+BigInt(g)}),h.prototype.readIntLE=function(o,l,u){o=o>>>0,l=l>>>0,u||ee(o,l,this.length);let p=this[o],g=1,P=0;for(;++P<l&&(g*=256);)p+=this[o+P]*g;return g*=128,p>=g&&(p-=Math.pow(2,8*l)),p},h.prototype.readIntBE=function(o,l,u){o=o>>>0,l=l>>>0,u||ee(o,l,this.length);let p=l,g=1,P=this[o+--p];for(;p>0&&(g*=256);)P+=this[o+--p]*g;return g*=128,P>=g&&(P-=Math.pow(2,8*l)),P},h.prototype.readInt8=function(o,l){return o=o>>>0,l||ee(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]},h.prototype.readInt16LE=function(o,l){o=o>>>0,l||ee(o,2,this.length);let u=this[o]|this[o+1]<<8;return u&32768?u|4294901760:u},h.prototype.readInt16BE=function(o,l){o=o>>>0,l||ee(o,2,this.length);let u=this[o+1]|this[o]<<8;return u&32768?u|4294901760:u},h.prototype.readInt32LE=function(o,l){return o=o>>>0,l||ee(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},h.prototype.readInt32BE=function(o,l){return o=o>>>0,l||ee(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},h.prototype.readBigInt64LE=Ce(function(o){o=o>>>0,Ye(o,"offset");let l=this[o],u=this[o+7];(l===void 0||u===void 0)&&ut(o,this.length-8);let p=this[o+4]+this[o+5]*2**8+this[o+6]*2**16+(u<<24);return(BigInt(p)<<BigInt(32))+BigInt(l+this[++o]*2**8+this[++o]*2**16+this[++o]*2**24)}),h.prototype.readBigInt64BE=Ce(function(o){o=o>>>0,Ye(o,"offset");let l=this[o],u=this[o+7];(l===void 0||u===void 0)&&ut(o,this.length-8);let p=(l<<24)+this[++o]*2**16+this[++o]*2**8+this[++o];return(BigInt(p)<<BigInt(32))+BigInt(this[++o]*2**24+this[++o]*2**16+this[++o]*2**8+u)}),h.prototype.readFloatLE=function(o,l){return o=o>>>0,l||ee(o,4,this.length),s.read(this,o,!0,23,4)},h.prototype.readFloatBE=function(o,l){return o=o>>>0,l||ee(o,4,this.length),s.read(this,o,!1,23,4)},h.prototype.readDoubleLE=function(o,l){return o=o>>>0,l||ee(o,8,this.length),s.read(this,o,!0,52,8)},h.prototype.readDoubleBE=function(o,l){return o=o>>>0,l||ee(o,8,this.length),s.read(this,o,!1,52,8)};function le(o,l,u,p,g,P){if(!h.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>g||l<P)throw new RangeError('"value" argument is out of bounds');if(u+p>o.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(o,l,u,p){if(o=+o,l=l>>>0,u=u>>>0,!p){let S=Math.pow(2,8*u)-1;le(this,o,l,u,S,0)}let g=1,P=0;for(this[l]=o&255;++P<u&&(g*=256);)this[l+P]=o/g&255;return l+u},h.prototype.writeUintBE=h.prototype.writeUIntBE=function(o,l,u,p){if(o=+o,l=l>>>0,u=u>>>0,!p){let S=Math.pow(2,8*u)-1;le(this,o,l,u,S,0)}let g=u-1,P=1;for(this[l+g]=o&255;--g>=0&&(P*=256);)this[l+g]=o/P&255;return l+u},h.prototype.writeUint8=h.prototype.writeUInt8=function(o,l,u){return o=+o,l=l>>>0,u||le(this,o,l,1,255,0),this[l]=o&255,l+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(o,l,u){return o=+o,l=l>>>0,u||le(this,o,l,2,65535,0),this[l]=o&255,this[l+1]=o>>>8,l+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(o,l,u){return o=+o,l=l>>>0,u||le(this,o,l,2,65535,0),this[l]=o>>>8,this[l+1]=o&255,l+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(o,l,u){return o=+o,l=l>>>0,u||le(this,o,l,4,4294967295,0),this[l+3]=o>>>24,this[l+2]=o>>>16,this[l+1]=o>>>8,this[l]=o&255,l+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(o,l,u){return o=+o,l=l>>>0,u||le(this,o,l,4,4294967295,0),this[l]=o>>>24,this[l+1]=o>>>16,this[l+2]=o>>>8,this[l+3]=o&255,l+4};function Xr(o,l,u,p,g){on(l,p,g,o,u,7);let P=Number(l&BigInt(4294967295));o[u++]=P,P=P>>8,o[u++]=P,P=P>>8,o[u++]=P,P=P>>8,o[u++]=P;let S=Number(l>>BigInt(32)&BigInt(4294967295));return o[u++]=S,S=S>>8,o[u++]=S,S=S>>8,o[u++]=S,S=S>>8,o[u++]=S,u}function en(o,l,u,p,g){on(l,p,g,o,u,7);let P=Number(l&BigInt(4294967295));o[u+7]=P,P=P>>8,o[u+6]=P,P=P>>8,o[u+5]=P,P=P>>8,o[u+4]=P;let S=Number(l>>BigInt(32)&BigInt(4294967295));return o[u+3]=S,S=S>>8,o[u+2]=S,S=S>>8,o[u+1]=S,S=S>>8,o[u]=S,u+8}h.prototype.writeBigUInt64LE=Ce(function(o,l=0){return Xr(this,o,l,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeBigUInt64BE=Ce(function(o,l=0){return en(this,o,l,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeIntLE=function(o,l,u,p){if(o=+o,l=l>>>0,!p){let k=Math.pow(2,8*u-1);le(this,o,l,u,k-1,-k)}let g=0,P=1,S=0;for(this[l]=o&255;++g<u&&(P*=256);)o<0&&S===0&&this[l+g-1]!==0&&(S=1),this[l+g]=(o/P>>0)-S&255;return l+u},h.prototype.writeIntBE=function(o,l,u,p){if(o=+o,l=l>>>0,!p){let k=Math.pow(2,8*u-1);le(this,o,l,u,k-1,-k)}let g=u-1,P=1,S=0;for(this[l+g]=o&255;--g>=0&&(P*=256);)o<0&&S===0&&this[l+g+1]!==0&&(S=1),this[l+g]=(o/P>>0)-S&255;return l+u},h.prototype.writeInt8=function(o,l,u){return o=+o,l=l>>>0,u||le(this,o,l,1,127,-128),o<0&&(o=255+o+1),this[l]=o&255,l+1},h.prototype.writeInt16LE=function(o,l,u){return o=+o,l=l>>>0,u||le(this,o,l,2,32767,-32768),this[l]=o&255,this[l+1]=o>>>8,l+2},h.prototype.writeInt16BE=function(o,l,u){return o=+o,l=l>>>0,u||le(this,o,l,2,32767,-32768),this[l]=o>>>8,this[l+1]=o&255,l+2},h.prototype.writeInt32LE=function(o,l,u){return o=+o,l=l>>>0,u||le(this,o,l,4,2147483647,-2147483648),this[l]=o&255,this[l+1]=o>>>8,this[l+2]=o>>>16,this[l+3]=o>>>24,l+4},h.prototype.writeInt32BE=function(o,l,u){return o=+o,l=l>>>0,u||le(this,o,l,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),this[l]=o>>>24,this[l+1]=o>>>16,this[l+2]=o>>>8,this[l+3]=o&255,l+4},h.prototype.writeBigInt64LE=Ce(function(o,l=0){return Xr(this,o,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),h.prototype.writeBigInt64BE=Ce(function(o,l=0){return en(this,o,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function tn(o,l,u,p,g,P){if(u+p>o.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function rn(o,l,u,p,g){return l=+l,u=u>>>0,g||tn(o,l,u,4,34028234663852886e22,-34028234663852886e22),s.write(o,l,u,p,23,4),u+4}h.prototype.writeFloatLE=function(o,l,u){return rn(this,o,l,!0,u)},h.prototype.writeFloatBE=function(o,l,u){return rn(this,o,l,!1,u)};function nn(o,l,u,p,g){return l=+l,u=u>>>0,g||tn(o,l,u,8,17976931348623157e292,-17976931348623157e292),s.write(o,l,u,p,52,8),u+8}h.prototype.writeDoubleLE=function(o,l,u){return nn(this,o,l,!0,u)},h.prototype.writeDoubleBE=function(o,l,u){return nn(this,o,l,!1,u)},h.prototype.copy=function(o,l,u,p){if(!h.isBuffer(o))throw new TypeError("argument should be a Buffer");if(u||(u=0),!p&&p!==0&&(p=this.length),l>=o.length&&(l=o.length),l||(l=0),p>0&&p<u&&(p=u),p===u||o.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(u<0||u>=this.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("sourceEnd out of bounds");p>this.length&&(p=this.length),o.length-l<p-u&&(p=o.length-l+u);let g=p-u;return this===o&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,u,p):Uint8Array.prototype.set.call(o,this.subarray(u,p),l),g},h.prototype.fill=function(o,l,u,p){if(typeof o=="string"){if(typeof l=="string"?(p=l,l=0,u=this.length):typeof u=="string"&&(p=u,u=this.length),p!==void 0&&typeof p!="string")throw new TypeError("encoding must be a string");if(typeof p=="string"&&!h.isEncoding(p))throw new TypeError("Unknown encoding: "+p);if(o.length===1){let P=o.charCodeAt(0);(p==="utf8"&&P<128||p==="latin1")&&(o=P)}}else typeof o=="number"?o=o&255:typeof o=="boolean"&&(o=Number(o));if(l<0||this.length<l||this.length<u)throw new RangeError("Out of range index");if(u<=l)return this;l=l>>>0,u=u===void 0?this.length:u>>>0,o||(o=0);let g;if(typeof o=="number")for(g=l;g<u;++g)this[g]=o;else{let P=h.isBuffer(o)?o:h.from(o,p),S=P.length;if(S===0)throw new TypeError('The value "'+o+'" is invalid for argument "value"');for(g=0;g<u-l;++g)this[g+l]=P[g%S]}return this};var Ze={};function er(o,l,u){Ze[o]=class extends u{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${o}]`,this.stack,delete this.name}get code(){return o}set code(p){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:p,writable:!0})}toString(){return`${this.name} [${o}]: ${this.message}`}}}er("ERR_BUFFER_OUT_OF_BOUNDS",function(o){return o?`${o} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),er("ERR_INVALID_ARG_TYPE",function(o,l){return`The "${o}" argument must be of type number. Received type ${typeof l}`},TypeError),er("ERR_OUT_OF_RANGE",function(o,l,u){let p=`The value of "${o}" is out of range.`,g=u;return Number.isInteger(u)&&Math.abs(u)>2**32?g=sn(String(u)):typeof u=="bigint"&&(g=String(u),(u>BigInt(2)**BigInt(32)||u<-(BigInt(2)**BigInt(32)))&&(g=sn(g)),g+="n"),p+=` It must be ${l}. Received ${g}`,p},RangeError);function sn(o){let l="",u=o.length,p=o[0]==="-"?1:0;for(;u>=p+4;u-=3)l=`_${o.slice(u-3,u)}${l}`;return`${o.slice(0,u)}${l}`}function ro(o,l,u){Ye(l,"offset"),(o[l]===void 0||o[l+u]===void 0)&&ut(l,o.length-(u+1))}function on(o,l,u,p,g,P){if(o>u||o<l){let S=typeof l=="bigint"?"n":"",k;throw P>3?l===0||l===BigInt(0)?k=`>= 0${S} and < 2${S} ** ${(P+1)*8}${S}`:k=`>= -(2${S} ** ${(P+1)*8-1}${S}) and < 2 ** ${(P+1)*8-1}${S}`:k=`>= ${l}${S} and <= ${u}${S}`,new Ze.ERR_OUT_OF_RANGE("value",k,o)}ro(p,g,P)}function Ye(o,l){if(typeof o!="number")throw new Ze.ERR_INVALID_ARG_TYPE(l,"number",o)}function ut(o,l,u){throw Math.floor(o)!==o?(Ye(o,u),new Ze.ERR_OUT_OF_RANGE(u||"offset","an integer",o)):l<0?new Ze.ERR_BUFFER_OUT_OF_BOUNDS:new Ze.ERR_OUT_OF_RANGE(u||"offset",`>= ${u?1:0} and <= ${l}`,o)}var no=/[^+/0-9A-Za-z-_]/g;function io(o){if(o=o.split("=")[0],o=o.trim().replace(no,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function tr(o,l){l=l||1/0;let u,p=o.length,g=null,P=[];for(let S=0;S<p;++S){if(u=o.charCodeAt(S),u>55295&&u<57344){if(!g){if(u>56319){(l-=3)>-1&&P.push(239,191,189);continue}else if(S+1===p){(l-=3)>-1&&P.push(239,191,189);continue}g=u;continue}if(u<56320){(l-=3)>-1&&P.push(239,191,189),g=u;continue}u=(g-55296<<10|u-56320)+65536}else g&&(l-=3)>-1&&P.push(239,191,189);if(g=null,u<128){if((l-=1)<0)break;P.push(u)}else if(u<2048){if((l-=2)<0)break;P.push(u>>6|192,u&63|128)}else if(u<65536){if((l-=3)<0)break;P.push(u>>12|224,u>>6&63|128,u&63|128)}else if(u<1114112){if((l-=4)<0)break;P.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else throw new Error("Invalid code point")}return P}function so(o){let l=[];for(let u=0;u<o.length;++u)l.push(o.charCodeAt(u)&255);return l}function oo(o,l){let u,p,g,P=[];for(let S=0;S<o.length&&!((l-=2)<0);++S)u=o.charCodeAt(S),p=u>>8,g=u%256,P.push(g),P.push(p);return P}function an(o){return i.toByteArray(io(o))}function Rt(o,l,u,p){let g;for(g=0;g<p&&!(g+u>=l.length||g>=o.length);++g)l[g+u]=o[g];return g}function be(o,l){return o instanceof l||o!=null&&o.constructor!=null&&o.constructor.name!=null&&o.constructor.name===l.name}function rr(o){return o!==o}var ao=function(){let o="0123456789abcdef",l=new Array(256);for(let u=0;u<16;++u){let p=u*16;for(let g=0;g<16;++g)l[p+g]=o[u]+o[g]}return l}();function Ce(o){return typeof BigInt>"u"?lo:o}function lo(){throw new Error("BigInt not supported")}}),Fe,E=Ve(()=>{"use strict";Fe=st(No())});function $o(){return!1}function zn(){return{dev:0,ino:0,mode:0,nlink:0,uid:0,gid:0,rdev:0,size:0,blksize:0,blocks:0,atimeMs:0,mtimeMs:0,ctimeMs:0,birthtimeMs:0,atime:new Date,mtime:new Date,ctime:new Date,birthtime:new Date}}function Oo(){return zn()}function ko(){return[]}function Co(e){e(null,[])}function To(){return""}function Mo(){return""}function Io(){}function qo(){}function Fo(){}function Do(){}function Vo(){}function jo(){}var cn,hn,Zn,Uo=Ve(()=>{"use strict";E(),y(),w(),v(),b(),cn={},hn={existsSync:$o,lstatSync:zn,statSync:Oo,readdirSync:ko,readdir:Co,readlinkSync:To,realpathSync:Mo,chmodSync:Io,renameSync:qo,mkdirSync:Fo,rmdirSync:Do,rmSync:Vo,unlinkSync:jo,promises:cn},Zn=hn});function Bo(...e){return e.join("/")}function Lo(...e){return e.join("/")}function Ho(e){let t=Yn(e),r=Xn(e),[n,i]=t.split(".");return{root:"/",dir:r,base:t,ext:i,name:n}}function Yn(e){let t=e.split("/");return t[t.length-1]}function Xn(e){return e.split("/").slice(0,-1).join("/")}var ir,dn,fn,dt,Jo=Ve(()=>{"use strict";E(),y(),w(),v(),b(),ir="/",dn={sep:ir},fn={basename:Yn,dirname:Xn,join:Lo,parse:Ho,posix:dn,resolve:Bo,sep:ir},dt=fn}),Qo=We((e,t)=>{t.exports={name:"@prisma/internals",version:"6.5.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:{"@antfu/ni":"0.21.12","@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.4.7",esbuild:"0.24.2","escape-string-regexp":"4.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":"4.2.3","strip-ansi":"6.0.1","strip-indent":"3.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"2.1.1",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/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}}),ei,Wo=Ve(()=>{"use strict";E(),y(),w(),v(),b(),ei=class{constructor(){A(this,"events",{})}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),this}emit(e,...t){return this.events[e]?(this.events[e].forEach(r=>{r(...t)}),!0):!1}}}),Ko=We((e,t)=>{"use strict";E(),y(),w(),v(),b(),t.exports=(r,n=1,i)=>{if(i={indent:" ",includeEmptyLines:!1,...i},typeof r!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof r}\``);if(typeof n!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof n}\``);if(typeof i.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof i.indent}\``);if(n===0)return r;let s=i.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return r.replace(s,i.indent.repeat(n))}}),Go=We((e,t)=>{"use strict";E(),y(),w(),v(),b(),t.exports=({onlyFirst:r=!1}={})=>{let n=["[\\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(n,r?void 0:"g")}}),zo=We((e,t)=>{"use strict";E(),y(),w(),v(),b();var r=Go();t.exports=n=>typeof n=="string"?n.replace(r(),""):n}),ti=We((e,t)=>{"use strict";E(),y(),w(),v(),b(),t.exports=function(){function r(n,i,s,a,c){return n<i||s<i?n>s?s+1:n+1:a===c?i:i+1}return function(n,i){if(n===i)return 0;if(n.length>i.length){var s=n;n=i,i=s}for(var a=n.length,c=i.length;a>0&&n.charCodeAt(a-1)===i.charCodeAt(c-1);)a--,c--;for(var d=0;d<a&&n.charCodeAt(d)===i.charCodeAt(d);)d++;if(a-=d,c-=d,a===0||c<3)return c;var f=0,h,m,x,R,$,N,U,D,Z,V,W,_e,G=[];for(h=0;h<a;h++)G.push(h+1),G.push(n.charCodeAt(d+h));for(var Oe=G.length-1;f<c-3;)for(Z=i.charCodeAt(d+(m=f)),V=i.charCodeAt(d+(x=f+1)),W=i.charCodeAt(d+(R=f+2)),_e=i.charCodeAt(d+($=f+3)),N=f+=4,h=0;h<Oe;h+=2)U=G[h],D=G[h+1],m=r(U,m,x,Z,D),x=r(m,x,R,V,D),R=r(x,R,$,W,D),N=r(R,$,N,_e,D),G[h]=N,$=R,R=x,x=m,m=U;for(;f<c;)for(Z=i.charCodeAt(d+(m=f)),N=++f,h=0;h<Oe;h+=2)U=G[h],G[h]=N=r(U,m,N,Z,G[h+1]),m=U;return N}}()}),Zo=We((e,t)=>{t.exports={name:"@prisma/engines-version",version:"6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"173f8d54f8d52e692c7e27e72a88314ec7aeff60"},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"}}}),ri={};Qt(ri,{Debug:()=>di,Decimal:()=>xt,Extensions:()=>ni,MetricsClient:()=>ss,PrismaClientInitializationError:()=>de,PrismaClientKnownRequestError:()=>He,PrismaClientRustPanicError:()=>gt,PrismaClientUnknownRequestError:()=>Je,PrismaClientValidationError:()=>Re,Public:()=>ii,Sql:()=>Ue,createParam:()=>gu,defineDmmfProperty:()=>Ru,deserializeJsonResponse:()=>Lt,deserializeRawResult:()=>Bs,dmmfToRuntimeDataModel:()=>Su,empty:()=>Cu,getPrismaClient:()=>Rh,getRuntime:()=>vs,join:()=>ku,makeStrictEnum:()=>Oh,makeTypedQueryFactory:()=>$u,objectEnumValues:()=>Ji,raw:()=>ls,serializeJsonQuery:()=>rs,skip:()=>es,sqltag:()=>Tu,warnEnvConflicts:()=>{},warnOnce:()=>yi});Js.exports=So(ri);E();y();w();v();b();var ni={};Qt(ni,{defineExtension:()=>Yo,getExtensionContext:()=>Xo});E();y();w();v();b();E();y();w();v();b();function Yo(e){return typeof e=="function"?e:t=>t.$extends(e)}E();y();w();v();b();function Xo(e){return e}var ii={};Qt(ii,{validator:()=>ea});E();y();w();v();b();E();y();w();v();b();function ea(...e){return t=>t}E();y();w();v();b();E();y();w();v();b();E();y();w();v();b();E();y();w();v();b();E();y();w();v();b();function si(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}E();y();w();v();b();function kr(e){return{ok:!0,value:e,map(t){return kr(t(e))},flatMap(t){return t(e)}}}function rt(e){return{ok:!1,error:e,map(){return rt(e)},flatMap(){return rt(e)}}}var ta=class{constructor(){A(this,"registeredErrors",[])}consumeError(e){return this.registeredErrors[e]}registerNewError(e){let t=0;for(;this.registeredErrors[t]!==void 0;)t++;return this.registeredErrors[t]={error:e},t}},ra=e=>{let t=new ta,r=ye(t,e.transactionContext.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:ye(t,e.queryRaw.bind(e)),executeRaw:ye(t,e.executeRaw.bind(e)),executeScript:ye(t,e.executeScript.bind(e)),dispose:ye(t,e.dispose.bind(e)),provider:e.provider,transactionContext:async(...i)=>(await r(...i)).map(s=>na(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=sa(t,e.getConnectionInfo.bind(e))),n},na=(e,t)=>{let r=ye(e,t.startTransaction.bind(t));return{adapterName:t.adapterName,provider:t.provider,queryRaw:ye(e,t.queryRaw.bind(t)),executeRaw:ye(e,t.executeRaw.bind(t)),startTransaction:async(...n)=>(await r(...n)).map(i=>ia(e,i))}},ia=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:ye(e,t.queryRaw.bind(t)),executeRaw:ye(e,t.executeRaw.bind(t)),commit:ye(e,t.commit.bind(t)),rollback:ye(e,t.rollback.bind(t))});function ye(e,t){return async(...r)=>{try{return kr(await t(...r))}catch(n){if(si(n))return rt(n.cause);let i=e.registerNewError(n);return rt({kind:"GenericJs",id:i})}}}function sa(e,t){return(...r)=>{try{return kr(t(...r))}catch(n){if(si(n))return rt(n.cause);let i=e.registerNewError(n);return rt({kind:"GenericJs",id:i})}}}E();y();w();v();b();E();y();w();v();b();var ur,oi,ai,li,ui=!0;typeof te<"u"&&({FORCE_COLOR:ur,NODE_DISABLE_COLORS:oi,NO_COLOR:ai,TERM:li}=te.env||{},ui=te.stdout&&te.stdout.isTTY);var oa={enabled:!oi&&ai==null&&li!=="dumb"&&(ur!=null&&ur!=="0"||ui)};function Q(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(s){return!oa.enabled||s==null?s:n+(~(""+s).indexOf(i)?s.replace(r,i+n):s)+i}}var Lh=Q(0,0),ci=Q(1,22),hi=Q(2,22),Hh=Q(3,23),aa=Q(4,24),Jh=Q(7,27),Qh=Q(8,28),Wh=Q(9,29),Kh=Q(30,39),Cr=Q(31,39),la=Q(32,39),ua=Q(33,39),ca=Q(34,39),Gh=Q(35,39),ha=Q(36,39),zh=Q(37,39),da=Q(90,39),Zh=Q(90,39),Yh=Q(40,49),Xh=Q(41,49),ed=Q(42,49),td=Q(43,49),rd=Q(44,49),nd=Q(45,49),id=Q(46,49),sd=Q(47,49),fa=100,pn=["green","yellow","blue","magenta","cyan","red"],Tt=[],gn=Date.now(),pa=0,cr=typeof te<"u"?te.env:{};globalThis.DEBUG??=cr.DEBUG??"";globalThis.DEBUG_COLORS??=cr.DEBUG_COLORS?cr.DEBUG_COLORS==="true":!0;var pt={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 ga(e){let t={color:pn[pa++%pn.length],enabled:pt.enabled(e),namespace:e,log:pt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:s,color:a,log:c}=t;if(n.length!==0&&Tt.push([s,...n]),Tt.length>fa&&Tt.shift(),pt.enabled(s)||i){let d=n.map(h=>typeof h=="string"?h:ma(h)),f=`+${Date.now()-gn}ms`;gn=Date.now(),c(s,...d,f)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,s)=>t[i]=s})}var di=new Proxy(ga,{get:(e,t)=>pt[t],set:(e,t,r)=>pt[t]=r});function ma(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 ya(){Tt.length=0}var $e=di;E();y();w();v();b();E();y();w();v();b();var wa=Qo(),va=wa.version;E();y();w();v();b();var ba="library";function hr(e){return Ea()||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":ba)}function Ea(){let e=te.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}E();y();w();v();b();var Pa="prisma+postgres",fi=`${Pa}:`;function xa(e){return e?.startsWith(`${fi}//`)??!1}E();y();w();v();b();E();y();w();v();b();var pi;(e=>{let t;(r=>(r.findUnique="findUnique",r.findUniqueOrThrow="findUniqueOrThrow",r.findFirst="findFirst",r.findFirstOrThrow="findFirstOrThrow",r.findMany="findMany",r.create="create",r.createMany="createMany",r.createManyAndReturn="createManyAndReturn",r.update="update",r.updateMany="updateMany",r.updateManyAndReturn="updateManyAndReturn",r.upsert="upsert",r.delete="delete",r.deleteMany="deleteMany",r.groupBy="groupBy",r.count="count",r.aggregate="aggregate",r.findRaw="findRaw",r.aggregateRaw="aggregateRaw"))(t=e.ModelAction||={})})(pi||={});var dr={};Qt(dr,{error:()=>Sa,info:()=>_a,log:()=>Aa,query:()=>Ra,should:()=>gi,tags:()=>Pt,warn:()=>mi});E();y();w();v();b();var Pt={error:Cr("prisma:error"),warn:ua("prisma:warn"),info:ha("prisma:info"),query:ca("prisma:query")},gi={warn:()=>!te.env.PRISMA_DISABLE_WARNINGS};function Aa(...e){console.log(...e)}function mi(e,...t){gi.warn()&&console.warn(`${Pt.warn} ${e}`,...t)}function _a(e,...t){console.info(`${Pt.info} ${e}`,...t)}function Sa(e,...t){console.error(`${Pt.error} ${e}`,...t)}function Ra(e,...t){console.log(`${Pt.query} ${e}`,...t)}E();y();w();v();b();function Wt(e,t){throw new Error(t)}E();y();w();v();b();function Na(e,t){return Object.prototype.hasOwnProperty.call(e,t)}E();y();w();v();b();var $a=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});E();y();w();v();b();function Tr(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}E();y();w();v();b();function Oa(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}E();y();w();v();b();function z(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}E();y();w();v();b();var mn=new Set,yi=(e,t,...r)=>{mn.has(e)||(mn.add(e),mi(t,...r))},de=class wi extends Error{constructor(t,r,n){super(t),A(this,"clientVersion"),A(this,"errorCode"),A(this,"retryable"),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(wi)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};z(de,"PrismaClientInitializationError");E();y();w();v();b();var He=class extends Error{constructor(e,{code:t,clientVersion:r,meta:n,batchRequestIdx:i}){super(e),A(this,"code"),A(this,"meta"),A(this,"clientVersion"),A(this,"batchRequestIdx"),this.name="PrismaClientKnownRequestError",this.code=t,this.clientVersion=r,this.meta=n,Object.defineProperty(this,"batchRequestIdx",{value:i,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};z(He,"PrismaClientKnownRequestError");E();y();w();v();b();var gt=class extends Error{constructor(e,t){super(e),A(this,"clientVersion"),this.name="PrismaClientRustPanicError",this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};z(gt,"PrismaClientRustPanicError");E();y();w();v();b();var Je=class extends Error{constructor(e,{clientVersion:t,batchRequestIdx:r}){super(e),A(this,"clientVersion"),A(this,"batchRequestIdx"),this.name="PrismaClientUnknownRequestError",this.clientVersion=t,Object.defineProperty(this,"batchRequestIdx",{value:r,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};z(Je,"PrismaClientUnknownRequestError");E();y();w();v();b();var Re=class extends Error{constructor(e,{clientVersion:t}){super(e),A(this,"name","PrismaClientValidationError"),A(this,"clientVersion"),this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};z(Re,"PrismaClientValidationError");E();y();w();v();b();E();y();w();v();b();var tt=9e15,je=1e9,fr="0123456789abcdef",jt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ut="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",pr={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-tt,maxE:tt,crypto:!1},vi,Ne,T=!0,Kt="[DecimalError] ",De=Kt+"Invalid argument: ",bi=Kt+"Precision limit exceeded",Ei=Kt+"crypto unavailable",Pi="[object Decimal]",ie=Math.floor,Y=Math.pow,ka=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ca=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ta=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,xi=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ve=1e7,C=7,Ma=9007199254740991,Ia=jt.length-1,gr=Ut.length-1,_={toStringTag:Pi};_.absoluteValue=_.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),O(e)};_.ceil=function(){return O(new this.constructor(this),this.e+1,2)};_.clampedTo=_.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(De+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};_.comparedTo=_.cmp=function(e){var t,r,n,i,s=this,a=s.d,c=(e=new s.constructor(e)).d,d=s.s,f=e.s;if(!a||!c)return!d||!f?NaN:d!==f?d:a===c?0:!a^d<0?1:-1;if(!a[0]||!c[0])return a[0]?d:c[0]?-f:0;if(d!==f)return d;if(s.e!==e.e)return s.e>e.e^d<0?1:-1;for(n=a.length,i=c.length,t=0,r=n<i?n:i;t<r;++t)if(a[t]!==c[t])return a[t]>c[t]^d<0?1:-1;return n===i?0:n>i^d<0?1:-1};_.cosine=_.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())+C,n.rounding=1,r=qa(n,Ni(n,r)),n.precision=e,n.rounding=t,O(Ne==2||Ne==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};_.cubeRoot=_.cbrt=function(){var e,t,r,n,i,s,a,c,d,f,h=this,m=h.constructor;if(!h.isFinite()||h.isZero())return new m(h);for(T=!1,s=h.s*Y(h.s*h,1/3),!s||Math.abs(s)==1/0?(r=ne(h.d),e=h.e,(s=(e-r.length+1)%3)&&(r+=s==1||s==-2?"0":"00"),s=Y(r,1/3),e=ie((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?r="5e"+e:(r=s.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new m(r),n.s=h.s):n=new m(s.toString()),a=(e=m.precision)+3;;)if(c=n,d=c.times(c).times(c),f=d.plus(h),n=H(f.plus(h).times(c),f.plus(d),a+2,1),ne(c.d).slice(0,a)===(r=ne(n.d)).slice(0,a))if(r=r.slice(a-3,a+1),r=="9999"||!i&&r=="4999"){if(!i&&(O(c,e+1,0),c.times(c).times(c).eq(h))){n=c;break}a+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(O(n,e+1,1),t=!n.times(n).times(n).eq(h));break}return T=!0,O(n,e,m.rounding,t)};_.decimalPlaces=_.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ie(this.e/C))*C,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};_.dividedBy=_.div=function(e){return H(this,new this.constructor(e))};_.dividedToIntegerBy=_.divToInt=function(e){var t=this,r=t.constructor;return O(H(t,new r(e),0,1,1),r.precision,r.rounding)};_.equals=_.eq=function(e){return this.cmp(e)===0};_.floor=function(){return O(new this.constructor(this),this.e+1,3)};_.greaterThan=_.gt=function(e){return this.cmp(e)>0};_.greaterThanOrEqualTo=_.gte=function(e){var t=this.cmp(e);return t==1||t===0};_.hyperbolicCosine=_.cosh=function(){var e,t,r,n,i,s=this,a=s.constructor,c=new a(1);if(!s.isFinite())return new a(s.s?1/0:NaN);if(s.isZero())return c;r=a.precision,n=a.rounding,a.precision=r+Math.max(s.e,s.sd())+4,a.rounding=1,i=s.d.length,i<32?(e=Math.ceil(i/3),t=(1/zt(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),s=nt(a,1,s.times(t),new a(1),!0);for(var d,f=e,h=new a(8);f--;)d=s.times(s),s=c.minus(d.times(h.minus(d.times(h))));return O(s,a.precision=r,a.rounding=n,!0)};_.hyperbolicSine=_.sinh=function(){var e,t,r,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(t=s.precision,r=s.rounding,s.precision=t+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=nt(s,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/zt(5,e)),i=nt(s,2,i,i,!0);for(var a,c=new s(5),d=new s(16),f=new s(20);e--;)a=i.times(i),i=i.times(c.plus(a.times(d.times(a).plus(f))))}return s.precision=t,s.rounding=r,O(i,t,r,!0)};_.hyperbolicTangent=_.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,H(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};_.inverseCosine=_.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))};_.inverseHyperbolicCosine=_.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,T=!1,r=r.times(r).minus(1).sqrt().plus(r),T=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};_.inverseHyperbolicSine=_.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,T=!1,r=r.times(r).plus(1).sqrt().plus(r),T=!0,n.precision=e,n.rounding=t,r.ln())};_.inverseHyperbolicTangent=_.atanh=function(){var e,t,r,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=s.precision,t=s.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?O(new s(i),e,t,!0):(s.precision=r=n-i.e,i=H(i.plus(1),new s(1).minus(i),r+e,1),s.precision=e+4,s.rounding=1,i=i.ln(),s.precision=e,s.rounding=t,i.times(.5))):new s(NaN)};_.inverseSine=_.asin=function(){var e,t,r,n,i=this,s=i.constructor;return i.isZero()?new s(i):(t=i.abs().cmp(1),r=s.precision,n=s.rounding,t!==-1?t===0?(e=Ee(s,r+4,n).times(.5),e.s=i.s,e):new s(NaN):(s.precision=r+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,i.times(2)))};_.inverseTangent=_.atan=function(){var e,t,r,n,i,s,a,c,d,f=this,h=f.constructor,m=h.precision,x=h.rounding;if(f.isFinite()){if(f.isZero())return new h(f);if(f.abs().eq(1)&&m+4<=gr)return a=Ee(h,m+4,x).times(.25),a.s=f.s,a}else{if(!f.s)return new h(NaN);if(m+4<=gr)return a=Ee(h,m+4,x).times(.5),a.s=f.s,a}for(h.precision=c=m+10,h.rounding=1,r=Math.min(28,c/C+2|0),e=r;e;--e)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(T=!1,t=Math.ceil(c/C),n=1,d=f.times(f),a=new h(f),i=f;e!==-1;)if(i=i.times(d),s=a.minus(i.div(n+=2)),i=i.times(d),a=s.plus(i.div(n+=2)),a.d[t]!==void 0)for(e=t;a.d[e]===s.d[e]&&e--;);return r&&(a=a.times(2<<r-1)),T=!0,O(a,h.precision=m,h.rounding=x,!0)};_.isFinite=function(){return!!this.d};_.isInteger=_.isInt=function(){return!!this.d&&ie(this.e/C)>this.d.length-2};_.isNaN=function(){return!this.s};_.isNegative=_.isNeg=function(){return this.s<0};_.isPositive=_.isPos=function(){return this.s>0};_.isZero=function(){return!!this.d&&this.d[0]===0};_.lessThan=_.lt=function(e){return this.cmp(e)<0};_.lessThanOrEqualTo=_.lte=function(e){return this.cmp(e)<1};_.logarithm=_.log=function(e){var t,r,n,i,s,a,c,d,f=this,h=f.constructor,m=h.precision,x=h.rounding,R=5;if(e==null)e=new h(10),t=!0;else{if(e=new h(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new h(NaN);t=e.eq(10)}if(r=f.d,f.s<0||!r||!r[0]||f.eq(1))return new h(r&&!r[0]?-1/0:f.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)s=!0;else{for(i=r[0];i%10===0;)i/=10;s=i!==1}if(T=!1,c=m+R,a=qe(f,c),n=t?Bt(h,c+10):qe(e,c),d=H(a,n,c,1),vt(d.d,i=m,x))do if(c+=10,a=qe(f,c),n=t?Bt(h,c+10):qe(e,c),d=H(a,n,c,1),!s){+ne(d.d).slice(i+1,i+15)+1==1e14&&(d=O(d,m+1,0));break}while(vt(d.d,i+=10,x));return T=!0,O(d,m,x)};_.minus=_.sub=function(e){var t,r,n,i,s,a,c,d,f,h,m,x,R=this,$=R.constructor;if(e=new $(e),!R.d||!e.d)return!R.s||!e.s?e=new $(NaN):R.d?e.s=-e.s:e=new $(e.d||R.s!==e.s?R:NaN),e;if(R.s!=e.s)return e.s=-e.s,R.plus(e);if(f=R.d,x=e.d,c=$.precision,d=$.rounding,!f[0]||!x[0]){if(x[0])e.s=-e.s;else if(f[0])e=new $(R);else return new $(d===3?-0:0);return T?O(e,c,d):e}if(r=ie(e.e/C),h=ie(R.e/C),f=f.slice(),s=h-r,s){for(m=s<0,m?(t=f,s=-s,a=x.length):(t=x,r=h,a=f.length),n=Math.max(Math.ceil(c/C),a)+2,s>n&&(s=n,t.length=1),t.reverse(),n=s;n--;)t.push(0);t.reverse()}else{for(n=f.length,a=x.length,m=n<a,m&&(a=n),n=0;n<a;n++)if(f[n]!=x[n]){m=f[n]<x[n];break}s=0}for(m&&(t=f,f=x,x=t,e.s=-e.s),a=f.length,n=x.length-a;n>0;--n)f[a++]=0;for(n=x.length;n>s;){if(f[--n]<x[n]){for(i=n;i&&f[--i]===0;)f[i]=ve-1;--f[i],f[n]+=ve}f[n]-=x[n]}for(;f[--a]===0;)f.pop();for(;f[0]===0;f.shift())--r;return f[0]?(e.d=f,e.e=Gt(f,r),T?O(e,c,d):e):new $(d===3?-0:0)};_.modulo=_.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]?O(new n(r),n.precision,n.rounding):(T=!1,n.modulo==9?(t=H(r,e.abs(),0,3,1),t.s*=e.s):t=H(r,e,0,n.modulo,1),t=t.times(e),T=!0,r.minus(t))};_.naturalExponential=_.exp=function(){return mr(this)};_.naturalLogarithm=_.ln=function(){return qe(this)};_.negated=_.neg=function(){var e=new this.constructor(this);return e.s=-e.s,O(e)};_.plus=_.add=function(e){var t,r,n,i,s,a,c,d,f,h,m=this,x=m.constructor;if(e=new x(e),!m.d||!e.d)return!m.s||!e.s?e=new x(NaN):m.d||(e=new x(e.d||m.s===e.s?m:NaN)),e;if(m.s!=e.s)return e.s=-e.s,m.minus(e);if(f=m.d,h=e.d,c=x.precision,d=x.rounding,!f[0]||!h[0])return h[0]||(e=new x(m)),T?O(e,c,d):e;if(s=ie(m.e/C),n=ie(e.e/C),f=f.slice(),i=s-n,i){for(i<0?(r=f,i=-i,a=h.length):(r=h,n=s,a=f.length),s=Math.ceil(c/C),a=s>a?s+1:a+1,i>a&&(i=a,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(a=f.length,i=h.length,a-i<0&&(i=a,r=h,h=f,f=r),t=0;i;)t=(f[--i]=f[i]+h[i]+t)/ve|0,f[i]%=ve;for(t&&(f.unshift(t),++n),a=f.length;f[--a]==0;)f.pop();return e.d=f,e.e=Gt(f,n),T?O(e,c,d):e};_.precision=_.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(De+e);return r.d?(t=Ai(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};_.round=function(){var e=this,t=e.constructor;return O(new t(e),e.e+1,t.rounding)};_.sine=_.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())+C,n.rounding=1,r=Da(n,Ni(n,r)),n.precision=e,n.rounding=t,O(Ne>2?r.neg():r,e,t,!0)):new n(NaN)};_.squareRoot=_.sqrt=function(){var e,t,r,n,i,s,a=this,c=a.d,d=a.e,f=a.s,h=a.constructor;if(f!==1||!c||!c[0])return new h(!f||f<0&&(!c||c[0])?NaN:c?a:1/0);for(T=!1,f=Math.sqrt(+a),f==0||f==1/0?(t=ne(c),(t.length+d)%2==0&&(t+="0"),f=Math.sqrt(t),d=ie((d+1)/2)-(d<0||d%2),f==1/0?t="5e"+d:(t=f.toExponential(),t=t.slice(0,t.indexOf("e")+1)+d),n=new h(t)):n=new h(f.toString()),r=(d=h.precision)+3;;)if(s=n,n=s.plus(H(a,s,r+2,1)).times(.5),ne(s.d).slice(0,r)===(t=ne(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(O(s,d+1,0),s.times(s).eq(a))){n=s;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(O(n,d+1,1),e=!n.times(n).eq(a));break}return T=!0,O(n,d,h.rounding,e)};_.tangent=_.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=H(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,O(Ne==2||Ne==4?r.neg():r,e,t,!0)):new n(NaN)};_.times=_.mul=function(e){var t,r,n,i,s,a,c,d,f,h=this,m=h.constructor,x=h.d,R=(e=new m(e)).d;if(e.s*=h.s,!x||!x[0]||!R||!R[0])return new m(!e.s||x&&!x[0]&&!R||R&&!R[0]&&!x?NaN:!x||!R?e.s/0:e.s*0);for(r=ie(h.e/C)+ie(e.e/C),d=x.length,f=R.length,d<f&&(s=x,x=R,R=s,a=d,d=f,f=a),s=[],a=d+f,n=a;n--;)s.push(0);for(n=f;--n>=0;){for(t=0,i=d+n;i>n;)c=s[i]+R[n]*x[i-n-1]+t,s[i--]=c%ve|0,t=c/ve|0;s[i]=(s[i]+t)%ve|0}for(;!s[--a];)s.pop();return t?++r:s.shift(),e.d=s,e.e=Gt(s,r),T?O(e,m.precision,m.rounding):e};_.toBinary=function(e,t){return Mr(this,2,e,t)};_.toDecimalPlaces=_.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ce(e,0,je),t===void 0?t=n.rounding:ce(t,0,8),O(r,e+r.e+1,t))};_.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,!0):(ce(e,0,je),t===void 0?t=i.rounding:ce(t,0,8),n=O(new i(n),e+1,t),r=xe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};_.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?r=xe(i):(ce(e,0,je),t===void 0?t=s.rounding:ce(t,0,8),n=O(new s(i),e+i.e+1,t),r=xe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};_.toFraction=function(e){var t,r,n,i,s,a,c,d,f,h,m,x,R=this,$=R.d,N=R.constructor;if(!$)return new N(R);if(f=r=new N(1),n=d=new N(0),t=new N(n),s=t.e=Ai($)-R.e-1,a=s%C,t.d[0]=Y(10,a<0?C+a:a),e==null)e=s>0?t:f;else{if(c=new N(e),!c.isInt()||c.lt(f))throw Error(De+c);e=c.gt(t)?s>0?t:f:c}for(T=!1,c=new N(ne($)),h=N.precision,N.precision=s=$.length*C*2;m=H(c,t,0,1,1),i=r.plus(m.times(n)),i.cmp(e)!=1;)r=n,n=i,i=f,f=d.plus(m.times(i)),d=i,i=t,t=c.minus(m.times(i)),c=i;return i=H(e.minus(r),n,0,1,1),d=d.plus(i.times(f)),r=r.plus(i.times(n)),d.s=f.s=R.s,x=H(f,n,s,1).minus(R).abs().cmp(H(d,r,s,1).minus(R).abs())<1?[f,n]:[d,r],N.precision=h,T=!0,x};_.toHexadecimal=_.toHex=function(e,t){return Mr(this,16,e,t)};_.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:ce(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]?(T=!1,r=H(r,e,0,t,1).times(e),T=!0,O(r)):(e.s=r.s,r=e),r};_.toNumber=function(){return+this};_.toOctal=function(e,t){return Mr(this,8,e,t)};_.toPower=_.pow=function(e){var t,r,n,i,s,a,c=this,d=c.constructor,f=+(e=new d(e));if(!c.d||!e.d||!c.d[0]||!e.d[0])return new d(Y(+c,f));if(c=new d(c),c.eq(1))return c;if(n=d.precision,s=d.rounding,e.eq(1))return O(c,n,s);if(t=ie(e.e/C),t>=e.d.length-1&&(r=f<0?-f:f)<=Ma)return i=_i(d,c,r,n),e.s<0?new d(1).div(i):O(i,n,s);if(a=c.s,a<0){if(t<e.d.length-1)return new d(NaN);if(e.d[t]&1||(a=1),c.e==0&&c.d[0]==1&&c.d.length==1)return c.s=a,c}return r=Y(+c,f),t=r==0||!isFinite(r)?ie(f*(Math.log("0."+ne(c.d))/Math.LN10+c.e+1)):new d(r+"").e,t>d.maxE+1||t<d.minE-1?new d(t>0?a/0:0):(T=!1,d.rounding=c.s=1,r=Math.min(12,(t+"").length),i=mr(e.times(qe(c,n+r)),n),i.d&&(i=O(i,n+5,1),vt(i.d,n,s)&&(t=n+10,i=O(mr(e.times(qe(c,t+r)),t),t+5,1),+ne(i.d).slice(n+1,n+15)+1==1e14&&(i=O(i,n+1,0)))),i.s=a,T=!0,d.rounding=s,O(i,n,s))};_.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ce(e,1,je),t===void 0?t=i.rounding:ce(t,0,8),n=O(new i(n),e,t),r=xe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};_.toSignificantDigits=_.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ce(e,1,je),t===void 0?t=n.rounding:ce(t,0,8)),O(new n(r),e,t)};_.toString=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};_.truncated=_.trunc=function(){return O(new this.constructor(this),this.e+1,1)};_.valueOf=_.toJSON=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function ne(e){var t,r,n,i=e.length-1,s="",a=e[0];if(i>0){for(s+=a,t=1;t<i;t++)n=e[t]+"",r=C-n.length,r&&(s+=Ie(r)),s+=n;a=e[t],n=a+"",r=C-n.length,r&&(s+=Ie(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}function ce(e,t,r){if(e!==~~e||e<t||e>r)throw Error(De+e)}function vt(e,t,r,n){var i,s,a,c;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=C,i=0):(i=Math.ceil((t+1)/C),t%=C),s=Y(10,C-t),c=e[i]%s|0,n==null?t<3?(t==0?c=c/100|0:t==1&&(c=c/10|0),a=r<4&&c==99999||r>3&&c==49999||c==5e4||c==0):a=(r<4&&c+1==s||r>3&&c+1==s/2)&&(e[i+1]/s/100|0)==Y(10,t-2)-1||(c==s/2||c==0)&&(e[i+1]/s/100|0)==0:t<4?(t==0?c=c/1e3|0:t==1?c=c/100|0:t==2&&(c=c/10|0),a=(n||r<4)&&c==9999||!n&&r>3&&c==4999):a=((n||r<4)&&c+1==s||!n&&r>3&&c+1==s/2)&&(e[i+1]/s/1e3|0)==Y(10,t-3)-1,a}function Mt(e,t,r){for(var n,i=[0],s,a=0,c=e.length;a<c;){for(s=i.length;s--;)i[s]*=t;for(i[0]+=fr.indexOf(e.charAt(a++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function qa(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/zt(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=nt(e,1,t.times(i),new e(1));for(var s=r;s--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=r,t}var H=function(){function e(n,i,s){var a,c=0,d=n.length;for(n=n.slice();d--;)a=n[d]*i+c,n[d]=a%s|0,c=a/s|0;return c&&n.unshift(c),n}function t(n,i,s,a){var c,d;if(s!=a)d=s>a?1:-1;else for(c=d=0;c<s;c++)if(n[c]!=i[c]){d=n[c]>i[c]?1:-1;break}return d}function r(n,i,s,a){for(var c=0;s--;)n[s]-=c,c=n[s]<i[s]?1:0,n[s]=c*a+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,a,c,d){var f,h,m,x,R,$,N,U,D,Z,V,W,_e,G,Oe,fe,ke,Ke,he,Ge,ze=n.constructor,lt=n.s==i.s?1:-1,X=n.d,L=i.d;if(!X||!X[0]||!L||!L[0])return new ze(!n.s||!i.s||(X?L&&X[0]==L[0]:!L)?NaN:X&&X[0]==0||!L?lt*0:lt/0);for(d?(R=1,h=n.e-i.e):(d=ve,R=C,h=ie(n.e/R)-ie(i.e/R)),he=L.length,ke=X.length,D=new ze(lt),Z=D.d=[],m=0;L[m]==(X[m]||0);m++);if(L[m]>(X[m]||0)&&h--,s==null?(G=s=ze.precision,a=ze.rounding):c?G=s+(n.e-i.e)+1:G=s,G<0)Z.push(1),$=!0;else{if(G=G/R+2|0,m=0,he==1){for(x=0,L=L[0],G++;(m<ke||x)&&G--;m++)Oe=x*d+(X[m]||0),Z[m]=Oe/L|0,x=Oe%L|0;$=x||m<ke}else{for(x=d/(L[0]+1)|0,x>1&&(L=e(L,x,d),X=e(X,x,d),he=L.length,ke=X.length),fe=he,V=X.slice(0,he),W=V.length;W<he;)V[W++]=0;Ge=L.slice(),Ge.unshift(0),Ke=L[0],L[1]>=d/2&&++Ke;do x=0,f=t(L,V,he,W),f<0?(_e=V[0],he!=W&&(_e=_e*d+(V[1]||0)),x=_e/Ke|0,x>1?(x>=d&&(x=d-1),N=e(L,x,d),U=N.length,W=V.length,f=t(N,V,U,W),f==1&&(x--,r(N,he<U?Ge:L,U,d))):(x==0&&(f=x=1),N=L.slice()),U=N.length,U<W&&N.unshift(0),r(V,N,W,d),f==-1&&(W=V.length,f=t(L,V,he,W),f<1&&(x++,r(V,he<W?Ge:L,W,d))),W=V.length):f===0&&(x++,V=[0]),Z[m++]=x,f&&V[0]?V[W++]=X[fe]||0:(V=[X[fe]],W=1);while((fe++<ke||V[0]!==void 0)&&G--);$=V[0]!==void 0}Z[0]||Z.shift()}if(R==1)D.e=h,vi=$;else{for(m=1,x=Z[0];x>=10;x/=10)m++;D.e=m+h*R-1,O(D,c?s+D.e+1:s,a,$)}return D}}();function O(e,t,r,n){var i,s,a,c,d,f,h,m,x,R=e.constructor;e:if(t!=null){if(m=e.d,!m)return e;for(i=1,c=m[0];c>=10;c/=10)i++;if(s=t-i,s<0)s+=C,a=t,h=m[x=0],d=h/Y(10,i-a-1)%10|0;else if(x=Math.ceil((s+1)/C),c=m.length,x>=c)if(n){for(;c++<=x;)m.push(0);h=d=0,i=1,s%=C,a=s-C+1}else break e;else{for(h=c=m[x],i=1;c>=10;c/=10)i++;s%=C,a=s-C+i,d=a<0?0:h/Y(10,i-a-1)%10|0}if(n=n||t<0||m[x+1]!==void 0||(a<0?h:h%Y(10,i-a-1)),f=r<4?(d||n)&&(r==0||r==(e.s<0?3:2)):d>5||d==5&&(r==4||n||r==6&&(s>0?a>0?h/Y(10,i-a):0:m[x-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,f?(t-=e.e+1,m[0]=Y(10,(C-t%C)%C),e.e=-t||0):m[0]=e.e=0,e;if(s==0?(m.length=x,c=1,x--):(m.length=x+1,c=Y(10,C-s),m[x]=a>0?(h/Y(10,i-a)%Y(10,a)|0)*c:0),f)for(;;)if(x==0){for(s=1,a=m[0];a>=10;a/=10)s++;for(a=m[0]+=c,c=1;a>=10;a/=10)c++;s!=c&&(e.e++,m[0]==ve&&(m[0]=1));break}else{if(m[x]+=c,m[x]!=ve)break;m[x--]=0,c=1}for(s=m.length;m[--s]===0;)m.pop()}return T&&(e.e>R.maxE?(e.d=null,e.e=NaN):e.e<R.minE&&(e.e=0,e.d=[0])),e}function xe(e,t,r){if(!e.isFinite())return Ri(e);var n,i=e.e,s=ne(e.d),a=s.length;return t?(r&&(n=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+Ie(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):i<0?(s="0."+Ie(-i-1)+s,r&&(n=r-a)>0&&(s+=Ie(n))):i>=a?(s+=Ie(i+1-a),r&&(n=r-i-1)>0&&(s=s+"."+Ie(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(s+="."),s+=Ie(n))),s}function Gt(e,t){var r=e[0];for(t*=C;r>=10;r/=10)t++;return t}function Bt(e,t,r){if(t>Ia)throw T=!0,r&&(e.precision=r),Error(bi);return O(new e(jt),t,1,!0)}function Ee(e,t,r){if(t>gr)throw Error(bi);return O(new e(Ut),t,r,!0)}function Ai(e){var t=e.length-1,r=t*C+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Ie(e){for(var t="";e--;)t+="0";return t}function _i(e,t,r,n){var i,s=new e(1),a=Math.ceil(n/C+4);for(T=!1;;){if(r%2&&(s=s.times(t),wn(s.d,a)&&(i=!0)),r=ie(r/2),r===0){r=s.d.length-1,i&&s.d[r]===0&&++s.d[r];break}t=t.times(t),wn(t.d,a)}return T=!0,s}function yn(e){return e.d[e.d.length-1]&1}function Si(e,t,r){for(var n,i,s=new e(t[0]),a=0;++a<t.length;){if(i=new e(t[a]),!i.s){s=i;break}n=s.cmp(i),(n===r||n===0&&s.s===r)&&(s=i)}return s}function mr(e,t){var r,n,i,s,a,c,d,f=0,h=0,m=0,x=e.constructor,R=x.rounding,$=x.precision;if(!e.d||!e.d[0]||e.e>17)return new x(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(T=!1,d=$):d=t,c=new x(.03125);e.e>-2;)e=e.times(c),m+=5;for(n=Math.log(Y(2,m))/Math.LN10*2+5|0,d+=n,r=s=a=new x(1),x.precision=d;;){if(s=O(s.times(e),d,1),r=r.times(++h),c=a.plus(H(s,r,d,1)),ne(c.d).slice(0,d)===ne(a.d).slice(0,d)){for(i=m;i--;)a=O(a.times(a),d,1);if(t==null)if(f<3&&vt(a.d,d-n,R,f))x.precision=d+=10,r=s=c=new x(1),h=0,f++;else return O(a,x.precision=$,R,T=!0);else return x.precision=$,a}a=c}}function qe(e,t){var r,n,i,s,a,c,d,f,h,m,x,R=1,$=10,N=e,U=N.d,D=N.constructor,Z=D.rounding,V=D.precision;if(N.s<0||!U||!U[0]||!N.e&&U[0]==1&&U.length==1)return new D(U&&!U[0]?-1/0:N.s!=1?NaN:U?0:N);if(t==null?(T=!1,h=V):h=t,D.precision=h+=$,r=ne(U),n=r.charAt(0),Math.abs(s=N.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)N=N.times(e),r=ne(N.d),n=r.charAt(0),R++;s=N.e,n>1?(N=new D("0."+r),s++):N=new D(n+"."+r.slice(1))}else return f=Bt(D,h+2,V).times(s+""),N=qe(new D(n+"."+r.slice(1)),h-$).plus(f),D.precision=V,t==null?O(N,V,Z,T=!0):N;for(m=N,d=a=N=H(N.minus(1),N.plus(1),h,1),x=O(N.times(N),h,1),i=3;;){if(a=O(a.times(x),h,1),f=d.plus(H(a,new D(i),h,1)),ne(f.d).slice(0,h)===ne(d.d).slice(0,h))if(d=d.times(2),s!==0&&(d=d.plus(Bt(D,h+2,V).times(s+""))),d=H(d,new D(R),h,1),t==null)if(vt(d.d,h-$,Z,c))D.precision=h+=$,f=a=N=H(m.minus(1),m.plus(1),h,1),x=O(N.times(N),h,1),i=c=1;else return O(d,D.precision=V,Z,T=!0);else return D.precision=V,d;d=f,i+=2}}function Ri(e){return String(e.s*e.s/0)}function It(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%C,r<0&&(n+=C),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=C;n<i;)e.d.push(+t.slice(n,n+=C));t=t.slice(n),n=C-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),T&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Fa(e,t){var r,n,i,s,a,c,d,f,h;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),xi.test(t))return It(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Ca.test(t))r=16,t=t.toLowerCase();else if(ka.test(t))r=2;else if(Ta.test(t))r=8;else throw Error(De+t);for(s=t.search(/p/i),s>0?(d=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),s=t.indexOf("."),a=s>=0,n=e.constructor,a&&(t=t.replace(".",""),c=t.length,s=c-s,i=_i(n,new n(r),s,s*2)),f=Mt(t,r,ve),h=f.length-1,s=h;f[s]===0;--s)f.pop();return s<0?new n(e.s*0):(e.e=Gt(f,h),e.d=f,T=!1,a&&(e=H(e,i,c*4)),d&&(e=e.times(Math.abs(d)<54?Y(2,d):ot.pow(2,d))),T=!0,e)}function Da(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:nt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/zt(5,r)),t=nt(e,2,t,t);for(var i,s=new e(5),a=new e(16),c=new e(20);r--;)i=t.times(t),t=t.times(s.plus(i.times(a.times(i).minus(c))));return t}function nt(e,t,r,n,i){var s,a,c,d,f=1,h=e.precision,m=Math.ceil(h/C);for(T=!1,d=r.times(r),c=new e(n);;){if(a=H(c.times(d),new e(t++*t++),h,1),c=i?n.plus(a):n.minus(a),n=H(a.times(d),new e(t++*t++),h,1),a=c.plus(n),a.d[m]!==void 0){for(s=m;a.d[s]===c.d[s]&&s--;);if(s==-1)break}s=c,c=n,n=a,a=s,f++}return T=!0,a.d.length=m+1,a}function zt(e,t){for(var r=e;--t;)r*=e;return r}function Ni(e,t){var r,n=t.s<0,i=Ee(e,e.precision,1),s=i.times(.5);if(t=t.abs(),t.lte(s))return Ne=n?4:1,t;if(r=t.divToInt(i),r.isZero())Ne=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(s))return Ne=yn(r)?n?2:3:n?4:1,t;Ne=yn(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Mr(e,t,r,n){var i,s,a,c,d,f,h,m,x,R=e.constructor,$=r!==void 0;if($?(ce(r,1,je),n===void 0?n=R.rounding:ce(n,0,8)):(r=R.precision,n=R.rounding),!e.isFinite())h=Ri(e);else{for(h=xe(e),a=h.indexOf("."),$?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,a>=0&&(h=h.replace(".",""),x=new R(1),x.e=h.length-a,x.d=Mt(xe(x),10,i),x.e=x.d.length),m=Mt(h,10,i),s=d=m.length;m[--d]==0;)m.pop();if(!m[0])h=$?"0p+0":"0";else{if(a<0?s--:(e=new R(e),e.d=m,e.e=s,e=H(e,x,r,n,0,i),m=e.d,s=e.e,f=vi),a=m[r],c=i/2,f=f||m[r+1]!==void 0,f=n<4?(a!==void 0||f)&&(n===0||n===(e.s<0?3:2)):a>c||a===c&&(n===4||f||n===6&&m[r-1]&1||n===(e.s<0?8:7)),m.length=r,f)for(;++m[--r]>i-1;)m[r]=0,r||(++s,m.unshift(1));for(d=m.length;!m[d-1];--d);for(a=0,h="";a<d;a++)h+=fr.charAt(m[a]);if($){if(d>1)if(t==16||t==8){for(a=t==16?4:3,--d;d%a;d++)h+="0";for(m=Mt(h,i,t),d=m.length;!m[d-1];--d);for(a=1,h="1.";a<d;a++)h+=fr.charAt(m[a])}else h=h.charAt(0)+"."+h.slice(1);h=h+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)h="0"+h;h="0."+h}else if(++s>d)for(s-=d;s--;)h+="0";else s<d&&(h=h.slice(0,s)+"."+h.slice(s))}h=(t==16?"0x":t==2?"0b":t==8?"0o":"")+h}return e.s<0?"-"+h:h}function wn(e,t){if(e.length>t)return e.length=t,!0}function Va(e){return new this(e).abs()}function ja(e){return new this(e).acos()}function Ua(e){return new this(e).acosh()}function Ba(e,t){return new this(e).plus(t)}function La(e){return new this(e).asin()}function Ha(e){return new this(e).asinh()}function Ja(e){return new this(e).atan()}function Qa(e){return new this(e).atanh()}function Wa(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,s=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Ee(this,s,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Ee(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Ee(this,s,1).times(.5),r.s=e.s):t.s<0?(this.precision=s,this.rounding=1,r=this.atan(H(e,t,s,1)),t=Ee(this,s,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(H(e,t,s,1)),r}function Ka(e){return new this(e).cbrt()}function Ga(e){return O(e=new this(e),e.e+1,2)}function za(e,t,r){return new this(e).clamp(t,r)}function Za(e){if(!e||typeof e!="object")throw Error(Kt+"Object expected");var t,r,n,i=e.defaults===!0,s=["precision",1,je,"rounding",0,8,"toExpNeg",-tt,0,"toExpPos",0,tt,"maxE",0,tt,"minE",-tt,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(r=s[t],i&&(this[r]=pr[r]),(n=e[r])!==void 0)if(ie(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(De+r+": "+n);if(r="crypto",i&&(this[r]=pr[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Ei);else this[r]=!1;else throw Error(De+r+": "+n);return this}function Ya(e){return new this(e).cos()}function Xa(e){return new this(e).cosh()}function $i(e){var t,r,n;function i(s){var a,c,d,f=this;if(!(f instanceof i))return new i(s);if(f.constructor=i,vn(s)){f.s=s.s,T?!s.d||s.e>i.maxE?(f.e=NaN,f.d=null):s.e<i.minE?(f.e=0,f.d=[0]):(f.e=s.e,f.d=s.d.slice()):(f.e=s.e,f.d=s.d?s.d.slice():s.d);return}if(d=typeof s,d==="number"){if(s===0){f.s=1/s<0?-1:1,f.e=0,f.d=[0];return}if(s<0?(s=-s,f.s=-1):f.s=1,s===~~s&&s<1e7){for(a=0,c=s;c>=10;c/=10)a++;T?a>i.maxE?(f.e=NaN,f.d=null):a<i.minE?(f.e=0,f.d=[0]):(f.e=a,f.d=[s]):(f.e=a,f.d=[s]);return}if(s*0!==0){s||(f.s=NaN),f.e=NaN,f.d=null;return}return It(f,s.toString())}if(d==="string")return(c=s.charCodeAt(0))===45?(s=s.slice(1),f.s=-1):(c===43&&(s=s.slice(1)),f.s=1),xi.test(s)?It(f,s):Fa(f,s);if(d==="bigint")return s<0?(s=-s,f.s=-1):f.s=1,It(f,s.toString());throw Error(De+s)}if(i.prototype=_,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Za,i.clone=$i,i.isDecimal=vn,i.abs=Va,i.acos=ja,i.acosh=Ua,i.add=Ba,i.asin=La,i.asinh=Ha,i.atan=Ja,i.atanh=Qa,i.atan2=Wa,i.cbrt=Ka,i.ceil=Ga,i.clamp=za,i.cos=Ya,i.cosh=Xa,i.div=el,i.exp=tl,i.floor=rl,i.hypot=nl,i.ln=il,i.log=sl,i.log10=al,i.log2=ol,i.max=ll,i.min=ul,i.mod=cl,i.mul=hl,i.pow=dl,i.random=fl,i.round=pl,i.sign=gl,i.sin=ml,i.sinh=yl,i.sqrt=wl,i.sub=vl,i.sum=bl,i.tan=El,i.tanh=Pl,i.trunc=xl,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function el(e,t){return new this(e).div(t)}function tl(e){return new this(e).exp()}function rl(e){return O(e=new this(e),e.e+1,3)}function nl(){var e,t,r=new this(0);for(T=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return T=!0,new this(1/0);r=t}return T=!0,r.sqrt()}function vn(e){return e instanceof ot||e&&e.toStringTag===Pi||!1}function il(e){return new this(e).ln()}function sl(e,t){return new this(e).log(t)}function ol(e){return new this(e).log(2)}function al(e){return new this(e).log(10)}function ll(){return Si(this,arguments,-1)}function ul(){return Si(this,arguments,1)}function cl(e,t){return new this(e).mod(t)}function hl(e,t){return new this(e).mul(t)}function dl(e,t){return new this(e).pow(t)}function fl(e){var t,r,n,i,s=0,a=new this(1),c=[];if(e===void 0?e=this.precision:ce(e,1,je),n=Math.ceil(e/C),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));s<n;)i=t[s],i>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:c[s++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);s<n;)i=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((t[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,s):(c.push(i%1e7),s+=4);s=n/4}else throw Error(Ei);else for(;s<n;)c[s++]=Math.random()*1e7|0;for(n=c[--s],e%=C,n&&e&&(i=Y(10,C-e),c[s]=(n/i|0)*i);c[s]===0;s--)c.pop();if(s<0)r=0,c=[0];else{for(r=-1;c[0]===0;r-=C)c.shift();for(n=1,i=c[0];i>=10;i/=10)n++;n<C&&(r-=C-n)}return a.e=r,a.d=c,a}function pl(e){return O(e=new this(e),e.e+1,this.rounding)}function gl(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function ml(e){return new this(e).sin()}function yl(e){return new this(e).sinh()}function wl(e){return new this(e).sqrt()}function vl(e,t){return new this(e).sub(t)}function bl(){var e=0,t=arguments,r=new this(t[e]);for(T=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return T=!0,O(r,this.precision,this.rounding)}function El(e){return new this(e).tan()}function Pl(e){return new this(e).tanh()}function xl(e){return O(e=new this(e),e.e+1,1)}_[Symbol.for("nodejs.util.inspect.custom")]=_.toString;_[Symbol.toStringTag]="Decimal";var ot=_.constructor=$i(pr);jt=new ot(jt);Ut=new ot(Ut);var xt=ot;function Lt(e){return e===null?e:Array.isArray(e)?e.map(Lt):typeof e=="object"?Al(e)?_l(e):Tr(e,Lt):e}function Al(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function _l({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Fe.Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"DateTime":return new Date(t);case"Decimal":return new xt(t);case"Json":return JSON.parse(t);default:Wt(t,"Unknown tagged value")}}E();y();w();v();b();E();y();w();v();b();function Ir(e){return e.substring(0,1).toLowerCase()+e.substring(1)}E();y();w();v();b();function qr(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Oi(e){return e.toString()!=="Invalid Date"}E();y();w();v();b();function Fr(e){return ot.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}E();y();w();v();b();E();y();w();v();b();var od=st(Ko()),Sl={red:Cr,gray:da,dim:hi,bold:ci,underline:aa,highlightSource:e=>e.highlight()},Rl={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Nl({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function $l({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:s},a){let c=[""],d=t?" in":":";if(n?(c.push(a.red(`Oops, an unknown error occurred! This is ${a.bold("on us")}, you did nothing wrong.`)),c.push(a.red(`It occurred in the ${a.bold(`\`${e}\``)} invocation${d}`))):c.push(a.red(`Invalid ${a.bold(`\`${e}\``)} invocation${d}`)),t&&c.push(a.underline(Ol(t))),i){c.push("");let f=[i.toString()];s&&(f.push(s),f.push(a.dim(")"))),c.push(f.join("")),s&&c.push("")}else c.push(""),s&&c.push(s),c.push("");return c.push(r),c.join(`
2
- `)}function Ol(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function ki(e){let t=e.showColors?Sl:Rl,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(e,t):r=Nl(e),$l(r,t)}E();y();w();v();b();var kl=st(ti());E();y();w();v();b();function Cl(e,t,r){let n=Ci(e),i=Tl(n),s=Il(i);s?Di(s,t,r):t.addErrorMessage(()=>"Unknown error")}function Ci(e){return e.errors.flatMap(t=>t.kind==="Union"?Ci(t):[t])}function Tl(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,s=t.get(i);s?t.set(i,{...n,argument:{...n.argument,typeNames:Ml(s.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Ml(e,t){return[...new Set(e.concat(t))]}function Il(e){return Oa(e,(t,r)=>{let n=bn(t),i=bn(r);return n!==i?n-i:En(t)-En(r)})}function bn(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function En(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}E();y();w();v();b();var Ae=class{constructor(e,t){this.name=e,this.value=t,A(this,"isRequired",!1)}makeRequired(){return this.isRequired=!0,this}write(e){let{colors:{green:t}}=e.context;e.addMarginSymbol(t(this.isRequired?"+":"?")),e.write(t(this.name)),this.isRequired||e.write(t("?")),e.write(t(": ")),typeof this.value=="string"?e.write(t(this.value)):e.write(this.value)}};E();y();w();v();b();E();y();w();v();b();var Ti=class{constructor(e=0,t){this.context=t,A(this,"lines",[]),A(this,"currentLine",""),A(this,"currentIndent",0),A(this,"marginSymbol"),A(this,"afterNextNewLineCallback"),this.currentIndent=e}write(e){return typeof e=="string"?this.currentLine+=e:e.write(this),this}writeJoined(e,t,r=(n,i)=>i.write(n)){let n=t.length-1;for(let i=0;i<t.length;i++)r(t[i],this),i!==n&&this.write(e);return this}writeLine(e){return this.write(e).newLine()}newLine(){this.lines.push(this.indentedCurrentLine()),this.currentLine="",this.marginSymbol=void 0;let e=this.afterNextNewLineCallback;return this.afterNextNewLineCallback=void 0,e?.(),this}withIndent(e){return this.indent(),e(this),this.unindent(),this}afterNextNewline(e){return this.afterNextNewLineCallback=e,this}indent(){return this.currentIndent++,this}unindent(){return this.currentIndent>0&&this.currentIndent--,this}addMarginSymbol(e){return this.marginSymbol=e,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(`
3
- `)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let e=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+e.slice(1):e}};E();y();w();v();b();E();y();w();v();b();var ql=class{constructor(e){this.value=e}write(e){e.write(this.value)}markAsError(){this.value.markAsError()}};E();y();w();v();b();var Ot=e=>e,Mi={bold:Ot,red:Ot,green:Ot,dim:Ot,enabled:!1},Fl={bold:ci,red:Cr,green:la,dim:hi,enabled:!0},Dr={write(e){e.writeLine(",")}};E();y();w();v();b();var Zt=class{constructor(e){this.contents=e,A(this,"isUnderlined",!1),A(this,"color",t=>t)}underline(){return this.isUnderlined=!0,this}setColor(e){return this.color=e,this}write(e){let t=e.getCurrentLineLength();e.write(this.color(this.contents)),this.isUnderlined&&e.afterNextNewline(()=>{e.write(" ".repeat(t)).writeLine(this.color("~".repeat(this.contents.length)))})}};E();y();w();v();b();var Vr=class{constructor(){A(this,"hasError",!1)}markAsError(){return this.hasError=!0,this}},Ii=class extends Vr{constructor(){super(...arguments),A(this,"items",[])}addItem(e){return this.items.push(new ql(e)),this}getField(e){return this.items[e]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(e=>e.value.getPrintWidth()))+2}write(e){if(this.items.length===0){this.writeEmpty(e);return}this.writeWithItems(e)}writeEmpty(e){let t=new Zt("[]");this.hasError&&t.setColor(e.context.colors.red).underline(),e.write(t)}writeWithItems(e){let{colors:t}=e.context;e.writeLine("[").withIndent(()=>e.writeJoined(Dr,this.items).newLine()).write("]"),this.hasError&&e.afterNextNewline(()=>{e.writeLine(t.red("~".repeat(this.getPrintWidth())))})}asObject(){}},qi=class qt extends Vr{constructor(){super(...arguments),A(this,"fields",{}),A(this,"suggestions",[])}addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[r,...n]=t,i=this.getField(r);if(!i)return;let s=i;for(let a of n){let c;if(s.value instanceof qt?c=s.value.getField(a):s.value instanceof Ii&&(c=s.value.getField(Number(a))),!c)return;s=c}return s}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let r=this;for(let n of t){if(!(r instanceof qt))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(t){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of t){let s=n.value.getFieldValue(i);if(!s||!(s instanceof qt))return;let a=s.getSelectionParent();if(!a)return;n=a}return n}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(r=>r.getPrintWidth()))+2}write(t){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,r)}asObject(){return this}writeEmpty(t){let r=new Zt("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(Dr,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};E();y();w();v();b();var ue=class extends Vr{constructor(e){super(),this.text=e}getPrintWidth(){return this.text.length}write(e){let t=new Zt(this.text);this.hasError&&t.underline().setColor(e.context.colors.red),e.write(t)}asObject(){}};E();y();w();v();b();var Fi=class{constructor(){A(this,"fields",[])}addField(e,t){return this.fields.push({write(r){let{green:n,dim:i}=r.context.colors;r.write(n(i(`${e}: ${t}`))).addMarginSymbol(n(i("+")))}}),this}write(e){let{colors:{green:t}}=e.context;e.writeLine(t("{")).withIndent(()=>{e.writeJoined(Dr,this.fields).newLine()}).write(t("}")).addMarginSymbol(t("+"))}};function Di(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Dl(e,t);break;case"IncludeOnScalar":Vl(e,t);break;case"EmptySelection":jl(e,t,r);break;case"UnknownSelectionField":Hl(e,t);break;case"InvalidSelectionValue":Jl(e,t);break;case"UnknownArgument":Ql(e,t);break;case"UnknownInputField":Wl(e,t);break;case"RequiredArgumentMissing":Kl(e,t);break;case"InvalidArgumentType":Gl(e,t);break;case"InvalidArgumentValue":zl(e,t);break;case"ValueTooLarge":Zl(e,t);break;case"SomeFieldsMissing":Yl(e,t);break;case"TooManyFieldsGiven":Xl(e,t);break;case"Union":Cl(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Dl(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Vl(e,t){let[r,n]=At(e.selectionPath),i=e.outputType,s=t.arguments.getDeepSelectionParent(r)?.value;if(s&&(s.getField(n)?.markAsError(),i))for(let a of i.fields)a.isRelation&&s.addSuggestion(new Ae(a.name,"true"));t.addErrorMessage(a=>{let c=`Invalid scalar field ${a.red(`\`${n}\``)} for ${a.bold("include")} statement`;return i?c+=` on model ${a.bold(i.name)}. ${_t(a)}`:c+=".",c+=`
4
- Note that ${a.bold("include")} statements only accept relation fields.`,c})}function jl(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Ul(e,t,i);return}if(n.hasField("select")){Bl(e,t);return}}if(r?.[Ir(e.outputType.name)]){Ll(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Ul(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new Ae(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Bl(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Ui(n,r)),t.addErrorMessage(s=>i?`The ${s.red("`select`")} statement for type ${s.bold(r.name)} must not be empty. ${_t(s)}`:`The ${s.red("`select`")} statement for type ${s.bold(r.name)} needs ${s.bold("at least one truthy value")}.`)}function Ll(e,t){let r=new Fi;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new Ae("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,s]=At(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(s);if(a){let c=a?.value.asObject()??new qi;c.addSuggestion(n),a.value=c}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function Hl(e,t){let r=Bi(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":Ui(n,e.outputType);break;case"include":eu(n,e.outputType);break;case"omit":tu(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(_t(n)),i.join(" ")})}function Jl(e,t){let r=Bi(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function Ql(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),ru(n,e.arguments)),t.addErrorMessage(i=>Vi(i,r,e.arguments.map(s=>s.name)))}function Wl(e,t){let[r,n]=At(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let s=i.getDeepFieldValue(r)?.asObject();s&&Li(s,e.inputType)}t.addErrorMessage(s=>Vi(s,n,e.inputType.fields.map(a=>a.name)))}function Vi(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=iu(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(_t(e)),n.join(" ")}function Kl(e,t){let r;t.addErrorMessage(d=>r?.value instanceof ue&&r.value.text==="null"?`Argument \`${d.green(s)}\` must not be ${d.red("null")}.`:`Argument \`${d.green(s)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,s]=At(e.argumentPath),a=new Fi,c=n.getDeepFieldValue(i)?.asObject();if(c)if(r=c.getField(s),r&&c.removeField(s),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let d of e.inputTypes[0].fields)a.addField(d.name,d.typeNames.join(" | "));c.addSuggestion(new Ae(s,a).makeRequired())}else{let d=e.inputTypes.map(ji).join(" | ");c.addSuggestion(new Ae(s,d).makeRequired())}}function ji(e){return e.kind==="list"?`${ji(e.elementType)}[]`:e.name}function Gl(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let s=Yt("or",e.argument.typeNames.map(a=>i.green(a)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${s}, provided ${i.red(e.inferredType)}.`})}function zl(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let s=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&s.push(`: ${e.underlyingError}`),s.push("."),e.argument.typeNames.length>0){let a=Yt("or",e.argument.typeNames.map(c=>i.green(c)));s.push(` Expected ${a}.`)}return s.join("")})}function Zl(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof ue&&(i=s.text)}t.addErrorMessage(s=>{let a=["Unable to fit value"];return i&&a.push(s.red(i)),a.push(`into a 64-bit signed integer for field \`${s.bold(r)}\``),a.join(" ")})}function Yl(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&Li(i,e.inputType)}t.addErrorMessage(i=>{let s=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?s.push(`${i.green("at least one of")} ${Yt("or",e.constraints.requiredFields.map(a=>`\`${i.bold(a)}\``))} arguments.`):s.push(`${i.green("at least one")} argument.`):s.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),s.push(_t(i)),s.join(" ")})}function Xl(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let s=n.getDeepFieldValue(e.argumentPath)?.asObject();s&&(s.markAsError(),i=Object.keys(s.getFields()))}t.addErrorMessage(s=>{let a=[`Argument \`${s.bold(r)}\` of type ${s.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?a.push(`${s.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?a.push(`${s.green("at most one")} argument,`):a.push(`${s.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),a.push(`but you provided ${Yt("and",i.map(c=>s.red(c)))}. Please choose`),e.constraints.maxFieldCount===1?a.push("one."):a.push(`${e.constraints.maxFieldCount}.`),a.join(" ")})}function Ui(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new Ae(r.name,"true"))}function eu(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new Ae(r.name,"true"))}function tu(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new Ae(r.name,"true"))}function ru(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new Ae(r.name,r.typeNames.join(" | ")))}function Bi(e,t){let[r,n]=At(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),c=i.getFieldValue("omit")?.asObject(),d=s?.getField(n);return s&&d?{parentKind:"select",parent:s,field:d,fieldName:n}:(d=a?.getField(n),a&&d?{parentKind:"include",field:d,parent:a,fieldName:n}:(d=c?.getField(n),c&&d?{parentKind:"omit",field:d,parent:c,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function Li(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new Ae(r.name,r.typeNames.join(" | ")))}function At(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function _t({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Yt(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var nu=3;function iu(e,t){let r=1/0,n;for(let i of t){let s=(0,kl.default)(e,i);s>nu||s<r&&(r=s,n=i)}return n}E();y();w();v();b();E();y();w();v();b();function su(e){return e.substring(0,1).toLowerCase()+e.substring(1)}E();y();w();v();b();var Hi=class{constructor(e,t,r,n,i){A(this,"modelName"),A(this,"name"),A(this,"typeName"),A(this,"isList"),A(this,"isEnum"),this.modelName=e,this.name=t,this.typeName=r,this.isList=n,this.isEnum=i}_toGraphQLInputType(){let e=this.isList?"List":"",t=this.isEnum?"Enum":"";return`${e}${t}${this.typeName}FieldRefInput<${this.modelName}>`}};function jr(e){return e instanceof Hi}E();y();w();v();b();var Ft=Symbol(),sr=new WeakMap,Xt=class{constructor(e){e===Ft?sr.set(this,`Prisma.${this._getName()}`):sr.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return sr.get(this)}},Ur=class extends Xt{_getNamespace(){return"NullTypes"}},yr=class extends Ur{};Br(yr,"DbNull");var wr=class extends Ur{};Br(wr,"JsonNull");var vr=class extends Ur{};Br(vr,"AnyNull");var Ji={classes:{DbNull:yr,JsonNull:wr,AnyNull:vr},instances:{DbNull:new yr(Ft),JsonNull:new wr(Ft),AnyNull:new vr(Ft)}};function Br(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}E();y();w();v();b();var Pn=": ",ou=class{constructor(e,t){this.name=e,this.value=t,A(this,"hasError",!1)}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Pn.length}write(e){let t=new Zt(this.name);this.hasError&&t.underline().setColor(e.context.colors.red),e.write(t).write(Pn).write(this.value)}},au=class{constructor(e){A(this,"arguments"),A(this,"errorMessages",[]),this.arguments=e}write(e){e.write(this.arguments)}addErrorMessage(e){this.errorMessages.push(e)}renderAllMessages(e){return this.errorMessages.map(t=>t(e)).join(`
5
- `)}};function Lr(e){return new au(Qi(e))}function Qi(e){let t=new qi;for(let[r,n]of Object.entries(e)){let i=new ou(r,Wi(n));t.addField(i)}return t}function Wi(e){if(typeof e=="string")return new ue(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new ue(String(e));if(typeof e=="bigint")return new ue(`${e}n`);if(e===null)return new ue("null");if(e===void 0)return new ue("undefined");if(Fr(e))return new ue(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Fe.Buffer.isBuffer(e)?new ue(`Buffer.alloc(${e.byteLength})`):new ue(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Oi(e)?e.toISOString():"Invalid Date";return new ue(`new Date("${t}")`)}return e instanceof Xt?new ue(`Prisma.${e._getName()}`):jr(e)?new ue(`prisma.${su(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?lu(e):typeof e=="object"?Qi(e):new ue(Object.prototype.toString.call(e))}function lu(e){let t=new Ii;for(let r of e)t.addItem(Wi(r));return t}function Ki(e,t){let r=t==="pretty"?Fl:Mi,n=e.renderAllMessages(r),i=new Ti(0,{colors:r}).write(e).toString();return{message:n,args:i}}function Gi({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:s,globalOmit:a}){let c=Lr(e);for(let m of t)Di(m,c,a);let{message:d,args:f}=Ki(c,r),h=ki({message:d,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:f});throw new Re(h,{clientVersion:s})}E();y();w();v();b();E();y();w();v();b();var mt=class{constructor(){A(this,"_map",new Map)}get(e){return this._map.get(e)?.value}set(e,t){this._map.set(e,{value:t})}getOrCreate(e,t){let r=this._map.get(e);if(r)return r.value;let n=t();return this.set(e,n),n}};E();y();w();v();b();function br(e){let t;return{get(){return t||(t={value:e()}),t.value}}}E();y();w();v();b();function St(e){return e.replace(/^./,t=>t.toLowerCase())}E();y();w();v();b();function uu(e,t,r){let n=St(r);return!t.result||!(t.result.$allModels||t.result[n])?e:cu({...e,...xn(t.name,e,t.result.$allModels),...xn(t.name,e,t.result[n])})}function cu(e){let t=new mt,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(s=>r(s,i)):[n]));return Tr(e,n=>({...n,needs:r(n.name,new Set)}))}function xn(e,t,r){return r?Tr(r,({needs:n,compute:i},s)=>({name:s,needs:n?Object.keys(n).filter(a=>n[a]):[],compute:hu(t,s,i)})):{}}function hu(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function du(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function fu(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var An=class{constructor(e,t){this.extension=e,this.previous=t,A(this,"computedFieldsCache",new mt),A(this,"modelExtensionsCache",new mt),A(this,"queryCallbacksCache",new mt),A(this,"clientExtensions",br(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions())),A(this,"batchCallbacks",br(()=>{let r=this.previous?.getAllBatchQueryCallbacks()??[],n=this.extension.query?.$__internalBatch;return n?r.concat(n):r}))}getAllComputedFields(e){return this.computedFieldsCache.getOrCreate(e,()=>uu(this.previous?.getAllComputedFields(e),this.extension,e))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(e){return this.modelExtensionsCache.getOrCreate(e,()=>{let t=St(e);return!this.extension.model||!(this.extension.model[t]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(e):{...this.previous?.getAllModelExtensions(e),...this.extension.model.$allModels,...this.extension.model[t]}})}getAllQueryCallbacks(e,t){return this.queryCallbacksCache.getOrCreate(`${e}:${t}`,()=>{let r=this.previous?.getAllQueryCallbacks(e,t)??[],n=[],i=this.extension.query;return!i||!(i[e]||i.$allModels||i[t]||i.$allOperations)?r:(i[e]!==void 0&&(i[e][t]!==void 0&&n.push(i[e][t]),i[e].$allOperations!==void 0&&n.push(i[e].$allOperations)),e!=="$none"&&i.$allModels!==void 0&&(i.$allModels[t]!==void 0&&n.push(i.$allModels[t]),i.$allModels.$allOperations!==void 0&&n.push(i.$allModels.$allOperations)),i[t]!==void 0&&n.push(i[t]),i.$allOperations!==void 0&&n.push(i.$allOperations),r.concat(n))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},zi=class Dt{constructor(t){this.head=t}static empty(){return new Dt}static single(t){return new Dt(new An(t))}isEmpty(){return this.head===void 0}append(t){return new Dt(new An(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};E();y();w();v();b();var Zi=class{constructor(e){this.name=e}};function pu(e){return e instanceof Zi}function gu(e){return new Zi(e)}E();y();w();v();b();E();y();w();v();b();var Yi=Symbol(),Xi=class{constructor(e){if(e!==Yi)throw new Error("Skip instance can not be constructed directly")}ifUndefined(e){return e===void 0?es:e}},es=new Xi(Yi);function Qe(e){return e instanceof Xi}var mu={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},ts="explicitly `undefined` values are not allowed";function rs({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=zi.empty(),callsite:s,clientMethod:a,errorFormat:c,clientVersion:d,previewFeatures:f,globalOmit:h}){let m=new _u({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:s,extensions:i,selectionPath:[],argumentPath:[],originalMethod:a,errorFormat:c,clientVersion:d,previewFeatures:f,globalOmit:h});return{modelName:e,action:mu[t],query:bt(r,m)}}function bt({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:is(r,n),selection:yu(e,t,i,n)}}function yu(e,t,r,n){return e?(t?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):r&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),Eu(e,n)):wu(n,t,r)}function wu(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&vu(n,t,e),bu(n,r,e),n}function vu(e,t,r){for(let[n,i]of Object.entries(t)){if(Qe(i))continue;let s=r.nestSelection(n);if(Hr(i,s),i===!1||i===void 0){e[n]=!1;continue}let a=r.findField(n);if(a&&a.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),a){e[n]=bt(i===!0?{}:i,s);continue}if(i===!0){e[n]=!0;continue}e[n]=bt(i,s)}}function bu(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},s=fu(i,n);for(let[a,c]of Object.entries(s)){if(Qe(c))continue;Hr(c,r.nestSelection(a));let d=r.findField(a);n?.[a]&&!d||(e[a]=!c)}}function Eu(e,t){let r={},n=t.getComputedFields(),i=du(e,n);for(let[s,a]of Object.entries(i)){if(Qe(a))continue;let c=t.nestSelection(s);Hr(a,c);let d=t.findField(s);if(!(n?.[s]&&!d)){if(a===!1||a===void 0||Qe(a)){r[s]=!1;continue}if(a===!0){d?.kind==="object"?r[s]=bt({},c):r[s]=!0;continue}r[s]=bt(a,c)}}return r}function ns(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(qr(e)){if(Oi(e))return{$type:"DateTime",value:e.toISOString()};t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(pu(e))return{$type:"Param",value:e.name};if(jr(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return Pu(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:Fe.Buffer.from(r,n,i).toString("base64")}}if(xu(e))return e.values;if(Fr(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof Xt){if(e!==Ji.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(Au(e))return e.toJSON();if(typeof e=="object")return is(e,t);t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function is(e,t){if(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],s=t.nestArgument(n);Qe(i)||(i!==void 0?r[n]=ns(i,s):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:s.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:ts}))}return r}function Pu(e,t){let r=[];for(let n=0;n<e.length;n++){let i=t.nestArgument(String(n)),s=e[n];if(s===void 0||Qe(s)){let a=s===void 0?"undefined":"Prisma.skip";t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:i.getSelectionPath(),argumentPath:i.getArgumentPath(),argument:{name:`${t.getArgumentName()}[${n}]`,typeNames:[]},underlyingError:`Can not use \`${a}\` value within array. Use \`null\` or filter out \`${a}\` values`})}r.push(ns(s,i))}return r}function xu(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function Au(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function Hr(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:ts})}var _u=class Er{constructor(t){this.params=t,A(this,"modelOrType"),this.params.modelName&&(this.modelOrType=this.params.runtimeDataModel.models[this.params.modelName]??this.params.runtimeDataModel.types[this.params.modelName])}throwValidationError(t){Gi({errors:[t],originalMethod:this.params.originalMethod,args:this.params.rootArgs??{},callsite:this.params.callsite,errorFormat:this.params.errorFormat,clientVersion:this.params.clientVersion,globalOmit:this.params.globalOmit})}getSelectionPath(){return this.params.selectionPath}getArgumentPath(){return this.params.argumentPath}getArgumentName(){return this.params.argumentPath[this.params.argumentPath.length-1]}getOutputTypeDescription(){if(!(!this.params.modelName||!this.modelOrType))return{name:this.params.modelName,fields:this.modelOrType.fields.map(t=>({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new Er({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[Ir(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:Wt(this.params.action,"Unknown action")}}nestArgument(t){return new Er({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};E();y();w();v();b();function _n(e){if(!e._hasPreviewFlag("metrics"))throw new Re("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var ss=class{constructor(e){A(this,"_client"),this._client=e}prometheus(e){return _n(this._client),this._client._engine.metrics({format:"prometheus",...e})}json(e){return _n(this._client),this._client._engine.metrics({format:"json",...e})}};E();y();w();v();b();function Su(e){return{models:or(e.models),enums:or(e.enums),types:or(e.types)}}function or(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function Ru(e,t){let r=br(()=>Nu(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function Nu(e){return{datamodel:{models:ar(e.models),enums:ar(e.enums),types:ar(e.types)}}}function ar(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}E();y();w();v();b();var lr=new WeakMap,Ht="$$PrismaTypedSql",os=class{constructor(e,t){lr.set(this,{sql:e,values:t}),Object.defineProperty(this,Ht,{value:Ht})}get sql(){return lr.get(this).sql}get values(){return lr.get(this).values}};function $u(e){return(...t)=>new os(e,t)}function as(e){return e!=null&&e[Ht]===Ht}E();y();w();v();b();var Ou=st(Zo());E();y();w();v();b();Wo();Uo();Jo();E();y();w();v();b();var Ue=class Pr{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((a,c)=>a+(c instanceof Pr?c.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,s=0;for(;i<r.length;){let a=r[i++],c=t[i];if(a instanceof Pr){this.strings[s]+=a.strings[0];let d=0;for(;d<a.values.length;)this.values[s++]=a.values[d++],this.strings[s]=a.strings[d];this.strings[s]+=c}else this.values[s++]=a,this.strings[s]=c}}get sql(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`?${this.strings[r++]}`;return n}get statement(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`:${r}${this.strings[r++]}`;return n}get text(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`$${r}${this.strings[r++]}`;return n}inspect(){return{sql:this.sql,statement:this.statement,text:this.text,values:this.values}}};function ku(e,t=",",r="",n=""){if(e.length===0)throw new TypeError("Expected `join([])` to be called with an array of multiple elements, but got an empty array");return new Ue([r,...Array(e.length-1).fill(t),n],e)}function ls(e){return new Ue([e],[])}var Cu=ls("");function Tu(e,...t){return new Ue(e,t)}E();y();w();v();b();E();y();w();v();b();function us(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}E();y();w();v();b();function Pe(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}E();y();w();v();b();function Jr(e){let t=new mt;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}E();y();w();v();b();E();y();w();v();b();var xr={enumerable:!0,configurable:!0,writable:!0};function cs(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>xr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Sn=Symbol.for("nodejs.util.inspect.custom");function it(e,t){let r=Mu(t),n=new Set,i=new Proxy(e,{get(s,a){if(n.has(a))return s[a];let c=r.get(a);return c?c.getPropertyValue(a):s[a]},has(s,a){if(n.has(a))return!0;let c=r.get(a);return c?c.has?.(a)??!0:Reflect.has(s,a)},ownKeys(s){let a=Rn(Reflect.ownKeys(s),r),c=Rn(Array.from(r.keys()),r);return[...new Set([...a,...c,...n])]},set(s,a,c){return r.get(a)?.getPropertyDescriptor?.(a)?.writable===!1?!1:(n.add(a),Reflect.set(s,a,c))},getOwnPropertyDescriptor(s,a){let c=Reflect.getOwnPropertyDescriptor(s,a);if(c&&!c.configurable)return c;let d=r.get(a);return d?d.getPropertyDescriptor?{...xr,...d?.getPropertyDescriptor(a)}:xr:c},defineProperty(s,a,c){return n.add(a),Reflect.defineProperty(s,a,c)},getPrototypeOf:()=>Object.prototype});return i[Sn]=function(){let s={...this};return delete s[Sn],s},i}function Mu(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Rn(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}E();y();w();v();b();function Ar(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}E();y();w();v();b();function hs(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}E();y();w();v();b();function Iu(e){if(e===void 0)return"";let t=Lr(e);return new Ti(0,{colors:Mi}).write(t).toString()}E();y();w();v();b();var qu="P2037";function ds({error:e,user_facing_error:t},r,n){return t.error_code?new He(Fu(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new Je(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function Fu(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===qu&&(r+=`
6
- Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}E();y();w();v();b();E();y();w();v();b();E();y();w();v();b();E();y();w();v();b();E();y();w();v();b();var Du=class{getLocation(){return null}};function yt(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Du}E();y();w();v();b();E();y();w();v();b();E();y();w();v();b();var Vu={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Jt(e={}){let t=ju(e);return Object.entries(t).reduce((r,[n,i])=>(Vu[n]!==void 0?r.select[n]={select:i}:r[n]=i,r),{select:{}})}function ju(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function _r(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Uu(e,t){let r=_r(e);return t({action:"aggregate",unpacker:r,argsMapper:Jt})(e)}E();y();w();v();b();function Bu(e={}){let{select:t,...r}=e;return Jt(typeof t=="object"?{...r,_count:t}:{...r,_count:{_all:!0}})}function Lu(e={}){return typeof e.select=="object"?t=>_r(e)(t)._count:t=>_r(e)(t)._count._all}function Hu(e,t){return t({action:"count",unpacker:Lu(e),argsMapper:Bu})(e)}E();y();w();v();b();function Ju(e={}){let t=Jt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function Qu(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Wu(e,t){return t({action:"groupBy",unpacker:Qu(e),argsMapper:Ju})(e)}function Ku(e,t,r){if(t==="aggregate")return n=>Uu(n,r);if(t==="count")return n=>Hu(n,r);if(t==="groupBy")return n=>Wu(n,r)}E();y();w();v();b();function Gu(e,t){let r=t.fields.filter(i=>!i.relationName),n=$a(r,i=>i.name);return new Proxy({},{get(i,s){if(s in i||typeof s=="symbol")return i[s];let a=n[s];if(a)return new Hi(e,s,a.type,a.isList,a.kind==="enum")},...cs(Object.keys(n))})}E();y();w();v();b();E();y();w();v();b();var fs=e=>Array.isArray(e)?e:e.split("."),ps=(e,t)=>fs(t).reduce((r,n)=>r&&r[n],e),zu=(e,t,r)=>fs(t).reduceRight((n,i,s,a)=>Object.assign({},ps(e,a.slice(0,s)),{[i]:n}),r);function Zu(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Yu(e,t,r){return t===void 0?e??{}:zu(t,r,e||!0)}function gs(e,t,r,n,i,s){let a=e._runtimeDataModel.models[t].fields.reduce((c,d)=>({...c,[d.name]:d}),{});return c=>{let d=yt(e._errorFormat),f=Zu(n,i),h=Yu(c,s,f),m=r({dataPath:f,callsite:d})(h),x=Xu(e,t);return new Proxy(m,{get(R,$){if(!x.includes($))return R[$];let N=[a[$].type,r,$],U=[f,h];return gs(e,...N,...U)},...cs([...x,...Object.getOwnPropertyNames(m)])})}}function Xu(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var ec=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],tc=["aggregate","count","groupBy"];function Nn(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[rc(e,t),ic(e,t),us(r),Pe("name",()=>t),Pe("$name",()=>t),Pe("$parent",()=>e._appliedParent)];return it({},n)}function rc(e,t){let r=St(t),n=Object.keys(pi.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let s=i,a=c=>d=>{let f=yt(e._errorFormat);return e._createPrismaPromise(h=>{let m={args:d,dataPath:[],action:s,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:f};return e._request({...m,...c})},{action:s,args:d,model:t})};return ec.includes(s)?gs(e,t,a):nc(i)?Ku(e,i,a):a({})}}}function nc(e){return tc.includes(e)}function ic(e,t){return Jr(Pe("fields",()=>{let r=e._runtimeDataModel.models[t];return Gu(t,r)}))}E();y();w();v();b();function sc(e){return e.replace(/^./,t=>t.toUpperCase())}var Sr=Symbol();function Rr(e){let t=[oc(e),ac(e),Pe(Sr,()=>e),Pe("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(us(r)),it(e,t)}function oc(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function ac(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(St),n=[...new Set(t.concat(r))];return Jr({getKeys(){return n},getPropertyValue(i){let s=sc(i);if(e._runtimeDataModel.models[s]!==void 0)return Nn(e,s);if(e._runtimeDataModel.models[i]!==void 0)return Nn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function lc(e){return e[Sr]?e[Sr]:e}function uc(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Rr(t)}E();y();w();v();b();E();y();w();v();b();function cc({result:e,modelName:t,select:r,omit:n,extensions:i}){let s=i.getAllComputedFields(t);if(!s)return e;let a=[],c=[];for(let d of Object.values(s)){if(n){if(n[d.name])continue;let f=d.needs.filter(h=>n[h]);f.length>0&&c.push(Ar(f))}else if(r){if(!r[d.name])continue;let f=d.needs.filter(h=>!r[h]);f.length>0&&c.push(Ar(f))}hc(e,d.needs)&&a.push(dc(d,it(e,a)))}return a.length>0||c.length>0?it(e,[...a,...c]):e}function hc(e,t){return t.every(r=>Na(e,r))}function dc(e,t){return Jr(Pe(e.name,()=>e.compute(t)))}E();y();w();v();b();function Qr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let a=0;a<t.length;a++)t[a]=Qr({result:t[a],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let s=e(t,i,r)??t;return r.include&&$n({includeOrSelect:r.include,result:s,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&$n({includeOrSelect:r.select,result:s,parentModelName:i,runtimeDataModel:n,visitor:e}),s}function $n({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[s,a]of Object.entries(e)){if(!a||t[s]==null||Qe(a))continue;let c=n.models[r].fields.find(f=>f.name===s);if(!c||c.kind!=="object"||!c.relationName)continue;let d=typeof a=="object"?a:{};t[s]=Qr({visitor:i,result:t[s],args:d,modelName:c.type,runtimeDataModel:n})}}function fc({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:s}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Qr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,c,d)=>{let f=St(c);return cc({result:a,modelName:f,select:d.select,omit:d.select?void 0:{...s?.[f],...d.omit},extensions:n})}})}E();y();w();v();b();E();y();w();v();b();E();y();w();v();b();var pc=["$connect","$disconnect","$on","$transaction","$use","$extends"],gc=pc;function mc(e){if(e instanceof Ue)return yc(e);if(as(e))return wc(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=wt(e[n]);return r}let t={};for(let r in e)t[r]=wt(e[r]);return t}function yc(e){return new Ue(e.strings,e.values)}function wc(e){return new os(e.sql,e.values)}function wt(e){if(typeof e!="object"||e==null||e instanceof Xt||jr(e))return e;if(Fr(e))return new xt(e.toFixed());if(qr(e))return new Date(+e);if(ArrayBuffer.isView(e))return e.slice(0);if(Array.isArray(e)){let t=e.length,r;for(r=Array(t);t--;)r[t]=wt(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:wt(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=wt(e[r]);return t}Wt(e,"Unknown value")}function ms(e,t,r,n=0){return e._createPrismaPromise(i=>{let s=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:mc(t.args??{}),__internalParams:t,query:(a,c=t)=>{let d=c.customDataProxyFetch;return c.customDataProxyFetch=ws(s,d),c.args=a,ms(e,c,r,n+1)}})})}function vc(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,s=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let a=e._extensions.getAllQueryCallbacks(r??"$none",s);return ms(e,t,a)}function bc(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?ys(r,n,0,e):e(r)}}function ys(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,s=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(a=>({model:a.modelName,operation:a.action,args:a.args})),transaction:s?{isolationLevel:s.kind==="batch"?s.isolationLevel:void 0}:void 0},__internalParams:e,query(a,c=e){let d=c.customDataProxyFetch;return c.customDataProxyFetch=ws(i,d),ys(c,t,r+1,n)}})}var On=e=>e;function ws(e=On,t=On){return r=>e(t(r))}E();y();w();v();b();var kn=$e("prisma:client"),Cn={Vercel:"vercel","Netlify CI":"netlify"};function Ec({postinstall:e,ciName:t,clientVersion:r}){if(kn("checkPlatformCaching:postinstall",e),kn("checkPlatformCaching:ciName",t),e===!0&&t&&t in Cn){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process.
7
-
8
- Learn how: https://pris.ly/d/${Cn[t]}-build`;throw console.error(n),new de(n,r)}}E();y();w();v();b();function Pc(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}E();y();w();v();b();E();y();w();v();b();var xc=()=>globalThis.process?.release?.name==="node",Ac=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,_c=()=>!!globalThis.Deno,Sc=()=>typeof globalThis.Netlify=="object",Rc=()=>typeof globalThis.EdgeRuntime=="object",Nc=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function $c(){return[[Sc,"netlify"],[Rc,"edge-light"],[Nc,"workerd"],[_c,"deno"],[Ac,"bun"],[xc,"node"]].flatMap(e=>e[0]()?[e[1]]:[]).at(0)??""}var Oc={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function vs(){let e=$c();return{id:e,prettyName:Oc[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}E();y();w();v();b();E();y();w();v();b();E();y();w();v();b();function Wr({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,s=Object.keys(e)[0],a=e[s]?.url,c=t[s]?.url;if(s===void 0?i=void 0:c?i=c:a?.value?i=a.value:a?.fromEnvVar&&(i=r[a.fromEnvVar]),a?.fromEnvVar!==void 0&&i===void 0)throw vs().id==="workerd"?new de(`error: Environment variable not found: ${a.fromEnvVar}.
9
-
10
- In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`.
11
- To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new de(`error: Environment variable not found: ${a.fromEnvVar}.`,n);if(i===void 0)throw new de("error: Missing URL environment variable, value, or override.",n);return i}E();y();w();v();b();E();y();w();v();b();var kc=class extends Error{constructor(e,t){super(e),A(this,"clientVersion"),A(this,"cause"),this.clientVersion=t.clientVersion,this.cause=t.cause}get[Symbol.toStringTag](){return this.name}},at=class extends kc{constructor(e,t){super(e,t),A(this,"isRetryable"),this.isRetryable=t.isRetryable??!0}};E();y();w();v();b();E();y();w();v();b();function se(e,t){return{...e,isRetryable:t}}var Nr=class extends at{constructor(e){super("This request must be retried",se(e,!0)),A(this,"name","ForcedRetryError"),A(this,"code","P5001")}};z(Nr,"ForcedRetryError");E();y();w();v();b();var Vt=class extends at{constructor(e,t){super(e,se(t,!1)),A(this,"name","InvalidDatasourceError"),A(this,"code","P6001")}};z(Vt,"InvalidDatasourceError");E();y();w();v();b();var Kr=class extends at{constructor(e,t){super(e,se(t,!1)),A(this,"name","NotImplementedYetError"),A(this,"code","P5004")}};z(Kr,"NotImplementedYetError");E();y();w();v();b();E();y();w();v();b();var we=class extends at{constructor(e,t){super(e,t),A(this,"response"),this.response=t.response;let r=this.response.headers.get("prisma-request-id");if(r){let n=`(The request id was: ${r})`;this.message=this.message+" "+n}}},Gr=class extends we{constructor(e){super("Schema needs to be uploaded",se(e,!0)),A(this,"name","SchemaMissingError"),A(this,"code","P5005")}};z(Gr,"SchemaMissingError");E();y();w();v();b();E();y();w();v();b();var bs="This request could not be understood by the server",Es=class extends we{constructor(e,t,r){super(t||bs,se(e,!1)),A(this,"name","BadRequestError"),A(this,"code","P5000"),r&&(this.code=r)}};z(Es,"BadRequestError");E();y();w();v();b();var Ps=class extends we{constructor(e,t){super("Engine not started: healthcheck timeout",se(e,!0)),A(this,"name","HealthcheckTimeoutError"),A(this,"code","P5013"),A(this,"logs"),this.logs=t}};z(Ps,"HealthcheckTimeoutError");E();y();w();v();b();var xs=class extends we{constructor(e,t,r){super(t,se(e,!0)),A(this,"name","EngineStartupError"),A(this,"code","P5014"),A(this,"logs"),this.logs=r}};z(xs,"EngineStartupError");E();y();w();v();b();var As=class extends we{constructor(e){super("Engine version is not supported",se(e,!1)),A(this,"name","EngineVersionNotSupportedError"),A(this,"code","P5012")}};z(As,"EngineVersionNotSupportedError");E();y();w();v();b();var _s="Request timed out",Ss=class extends we{constructor(e,t=_s){super(t,se(e,!1)),A(this,"name","GatewayTimeoutError"),A(this,"code","P5009")}};z(Ss,"GatewayTimeoutError");E();y();w();v();b();var Cc="Interactive transaction error",Rs=class extends we{constructor(e,t=Cc){super(t,se(e,!1)),A(this,"name","InteractiveTransactionError"),A(this,"code","P5015")}};z(Rs,"InteractiveTransactionError");E();y();w();v();b();var Tc="Request parameters are invalid",Ns=class extends we{constructor(e,t=Tc){super(t,se(e,!1)),A(this,"name","InvalidRequestError"),A(this,"code","P5011")}};z(Ns,"InvalidRequestError");E();y();w();v();b();var $s="Requested resource does not exist",Os=class extends we{constructor(e,t=$s){super(t,se(e,!1)),A(this,"name","NotFoundError"),A(this,"code","P5003")}};z(Os,"NotFoundError");E();y();w();v();b();var ks="Unknown server error",$r=class extends we{constructor(e,t,r){super(t||ks,se(e,!0)),A(this,"name","ServerError"),A(this,"code","P5006"),A(this,"logs"),this.logs=r}};z($r,"ServerError");E();y();w();v();b();var Cs="Unauthorized, check your connection string",Ts=class extends we{constructor(e,t=Cs){super(t,se(e,!1)),A(this,"name","UnauthorizedError"),A(this,"code","P5007")}};z(Ts,"UnauthorizedError");E();y();w();v();b();var Ms="Usage exceeded, retry again later",Is=class extends we{constructor(e,t=Ms){super(t,se(e,!0)),A(this,"name","UsageExceededError"),A(this,"code","P5008")}};z(Is,"UsageExceededError");async function Mc(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function kt(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Mc(e);if(n.type==="QueryEngineError")throw new He(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new $r(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Gr(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new As(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:s}=n.body.EngineNotStarted.reason.EngineStartupError;throw new xs(r,i,s)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:s}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new de(i,t,s)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Ps(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Rs(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Ns(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Ts(r,Xe(Cs,n));if(e.status===404)return new Os(r,Xe($s,n));if(e.status===429)throw new Is(r,Xe(Ms,n));if(e.status===504)throw new Ss(r,Xe(_s,n));if(e.status>=500)throw new $r(r,Xe(ks,n));if(e.status>=400)throw new Es(r,Xe(bs,n))}function Xe(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}E();y();w();v();b();function Ic(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}E();y();w();v();b();var Se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function qc(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,s=n-i,a,c,d,f,h;for(let m=0;m<s;m=m+3)h=t[m]<<16|t[m+1]<<8|t[m+2],a=(h&16515072)>>18,c=(h&258048)>>12,d=(h&4032)>>6,f=h&63,r+=Se[a]+Se[c]+Se[d]+Se[f];return i==1?(h=t[s],a=(h&252)>>2,c=(h&3)<<4,r+=Se[a]+Se[c]+"=="):i==2&&(h=t[s]<<8|t[s+1],a=(h&64512)>>10,c=(h&1008)>>4,d=(h&15)<<2,r+=Se[a]+Se[c]+Se[d]+"="),r}E();y();w();v();b();function Fc(e){if(e.generator?.previewFeatures.some(t=>t.toLowerCase().includes("metrics")))throw new de("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}E();y();w();v();b();function Dc(e){return e[0]*1e3+e[1]/1e6}function Tn(e){return new Date(Dc(e))}E();y();w();v();b();var Vc={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};E();y();w();v();b();E();y();w();v();b();var qs=class extends at{constructor(e,t){super(`Cannot fetch data from service:
12
- ${e}`,se(t,!0)),A(this,"name","RequestError"),A(this,"code","P5010")}};z(qs,"RequestError");async function ft(e,t,r=n=>n){let{clientVersion:n,...i}=t,s=r(fetch);try{return await s(e,i)}catch(a){let c=a.message??"Unknown error";throw new qs(c,{clientVersion:n,cause:a})}}var jc=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Fs=$e("prisma:client:dataproxyEngine");async function Uc(e,t){let r=Vc["@prisma/engines-version"],n=t.clientVersion??"unknown";if(te.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return te.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,s]=n?.split("-")??[];if(s===void 0&&jc.test(i))return i;if(s!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[a]=r.split("-")??[],[c,d,f]=a.split("."),h=Lc(`<=${c}.${d}.${f}`),m=await ft(h,{clientVersion:n});if(!m.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${m.status} ${m.statusText}, response body: ${await m.text()||"<empty body>"}`);let x=await m.text();Fs("length of body fetched from unpkg.com",x.length);let R;try{R=JSON.parse(x)}catch($){throw console.error("JSON.parse error: body fetched from unpkg.com: ",x),$}return R.version}throw new Kr("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Bc(e,t){let r=await Uc(e,t);return Fs("version",r),r}function Lc(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Mn=3,Ct=$e("prisma:client:dataproxyEngine"),Hc=class{constructor({apiKey:e,tracingHelper:t,logLevel:r,logQueries:n,engineHash:i}){A(this,"apiKey"),A(this,"tracingHelper"),A(this,"logLevel"),A(this,"logQueries"),A(this,"engineHash"),this.apiKey=e,this.tracingHelper=t,this.logLevel=r,this.logQueries=n,this.engineHash=i}build({traceparent:e,interactiveTransaction:t}={}){let r={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(r.traceparent=e??this.tracingHelper.getTraceParent()),t&&(r["X-transaction-id"]=t.id);let n=this.buildCaptureSettings();return n.length>0&&(r["X-capture-telemetry"]=n.join(", ")),r}buildCaptureSettings(){let e=[];return this.tracingHelper.isEnabled()&&e.push("tracing"),this.logLevel&&e.push(this.logLevel),this.logQueries&&e.push("query"),e}},In=class{constructor(e){A(this,"name","DataProxyEngine"),A(this,"inlineSchema"),A(this,"inlineSchemaHash"),A(this,"inlineDatasources"),A(this,"config"),A(this,"logEmitter"),A(this,"env"),A(this,"clientVersion"),A(this,"engineHash"),A(this,"tracingHelper"),A(this,"remoteClientVersion"),A(this,"host"),A(this,"headerBuilder"),A(this,"startPromise"),Fc(e),this.config=e,this.env={...e.env,...typeof te<"u"?te.env:{}},this.inlineSchema=qc(e.inlineSchema),this.inlineDatasources=e.inlineDatasources,this.inlineSchemaHash=e.inlineSchemaHash,this.clientVersion=e.clientVersion,this.engineHash=e.engineVersion,this.logEmitter=e.logEmitter,this.tracingHelper=e.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[e,t]=this.extractHostAndApiKey();this.host=e,this.headerBuilder=new Hc({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await Bc(e,this.config),Ct("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(e){e?.logs?.length&&e.logs.forEach(t=>{switch(t.level){case"debug":case"trace":Ct(t);break;case"error":case"warn":case"info":{this.logEmitter.emit(t.level,{timestamp:Tn(t.timestamp),message:t.attributes.message??"",target:t.target});break}case"query":{this.logEmitter.emit("query",{query:t.attributes.query??"",timestamp:Tn(t.timestamp),duration:t.attributes.duration_ms??0,params:t.attributes.params??"",target:t.target});break}default:t.level}}),e?.traces?.length&&this.tracingHelper.dispatchEngineSpans(e.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(e){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${e}`}async uploadSchema(){let e={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(e,async()=>{let t=await ft(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});t.ok||Ct("schema response status",t.status);let r=await kt(t,this.clientVersion);if(r)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${r.message}`,timestamp:new Date,target:""}),r;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(e,{traceparent:t,interactiveTransaction:r,customDataProxyFetch:n}){return this.requestInternal({body:e,traceparent:t,interactiveTransaction:r,customDataProxyFetch:n})}async requestBatch(e,{traceparent:t,transaction:r,customDataProxyFetch:n}){let i=r?.kind==="itx"?r.options:void 0,s=hs(e,r);return(await this.requestInternal({body:s,customDataProxyFetch:n,interactiveTransaction:i,traceparent:t})).map(a=>(a.extensions&&this.propagateResponseExtensions(a.extensions),"errors"in a?this.convertProtocolErrorsToClientError(a.errors):a))}requestInternal({body:e,traceparent:t,customDataProxyFetch:r,interactiveTransaction:n}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:i})=>{let s=n?`${n.payload.endpoint}/graphql`:await this.url("graphql");i(s);let a=await ft(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t,interactiveTransaction:n}),body:JSON.stringify(e),clientVersion:this.clientVersion},r);a.ok||Ct("graphql response status",a.status),await this.handleError(await kt(a,this.clientVersion));let c=await a.json();if(c.extensions&&this.propagateResponseExtensions(c.extensions),"errors"in c)throw this.convertProtocolErrorsToClientError(c.errors);return"batchResult"in c?c.batchResult:c}})}async transaction(e,t,r){let n={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${n[e]} transaction`,callback:async({logHttpCall:i})=>{if(e==="start"){let s=JSON.stringify({max_wait:r.maxWait,timeout:r.timeout,isolation_level:r.isolationLevel}),a=await this.url("transaction/start");i(a);let c=await ft(a,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await kt(c,this.clientVersion));let d=await c.json(),{extensions:f}=d;f&&this.propagateResponseExtensions(f);let h=d.id,m=d["data-proxy"].endpoint;return{id:h,payload:{endpoint:m}}}else{let s=`${r.payload.endpoint}/${e}`;i(s);let a=await ft(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),clientVersion:this.clientVersion});await this.handleError(await kt(a,this.clientVersion));let c=await a.json(),{extensions:d}=c;d&&this.propagateResponseExtensions(d);return}}})}extractHostAndApiKey(){let e={clientVersion:this.clientVersion},t=Object.keys(this.inlineDatasources)[0],r=Wr({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),n;try{n=new URL(r)}catch{throw new Vt(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,e)}let{protocol:i,host:s,searchParams:a}=n;if(i!=="prisma:"&&i!==fi)throw new Vt(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,e);let c=a.get("api_key");if(c===null||c.length<1)throw new Vt(`Error validating datasource \`${t}\`: the URL must contain a valid API key`,e);return[s,c]}metrics(){throw new Kr("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(e){for(let t=0;;t++){let r=n=>{this.logEmitter.emit("info",{message:`Calling ${n} (n=${t})`,timestamp:new Date,target:""})};try{return await e.callback({logHttpCall:r})}catch(n){if(!(n instanceof at)||!n.isRetryable)throw n;if(t>=Mn)throw n instanceof Nr?n.cause:n;this.logEmitter.emit("warn",{message:`Attempt ${t+1}/${Mn} failed for ${e.actionGerund}: ${n.message??"(unknown)"}`,timestamp:new Date,target:""});let i=await Ic(t);this.logEmitter.emit("warn",{message:`Retrying after ${i}ms`,timestamp:new Date,target:""})}}}async handleError(e){if(e instanceof Gr)throw await this.uploadSchema(),new Nr({clientVersion:this.clientVersion,cause:e});if(e)throw e}convertProtocolErrorsToClientError(e){return e.length===1?ds(e[0],this.config.clientVersion,this.config.activeProvider):new Je(JSON.stringify(e),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Jc({copyEngine:e=!0},t){let r;try{r=Wr({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...te.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||xa(r));e&&n&&yi("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=hr(t.generator),s=n||!e,a=!!t.adapter,c=i==="library",d=i==="binary",f=i==="client";if(s&&a||a){let h;throw h=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new Re(h.join(`
13
- `),{clientVersion:t.clientVersion})}return s?new In(t):new In(t)}E();y();w();v();b();function Ds({generator:e}){return e?.previewFeatures??[]}E();y();w();v();b();var Qc=e=>({command:e});E();y();w();v();b();E();y();w();v();b();var Wc=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);E();y();w();v();b();function ht(e){try{return qn(e,"fast")}catch{return qn(e,"slow")}}function qn(e,t){return JSON.stringify(e.map(r=>Vs(r,t)))}function Vs(e,t){if(Array.isArray(e))return e.map(r=>Vs(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(qr(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(xt.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Fe.Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(Kc(e))return{prisma__type:"bytes",prisma__value:Fe.Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:Fe.Buffer.from(r,n,i).toString("base64")}}return typeof e=="object"&&t==="slow"?js(e):e}function Kc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function js(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Fn);let t={};for(let r of Object.keys(e))t[r]=Fn(e[r]);return t}function Fn(e){return typeof e=="bigint"?e.toString():js(e)}var Gc=/^(\s*alter\s)/i,Dn=$e("prisma:client");function Vn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Gc.exec(t))throw new Error(`Running ALTER using ${n} is not supported
14
- Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization.
15
-
16
- Example:
17
- await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
18
-
19
- More Information: https://pris.ly/d/execute-raw
20
- `)}var jn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(as(r))n=r.sql,i={values:ht(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[s,...a]=r;n=s,i={values:ht(a||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:ht(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:ht(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Wc(r),i={values:ht(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Dn(`prisma.${e}(${n}, ${i.values})`):Dn(`prisma.${e}(${n})`),{query:n,parameters:i}},zc={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new Ue(t,r)}},Zc={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};E();y();w();v();b();function Un(e){return function(t,r){let n,i=(s=e)=>{try{return s===void 0||s?.kind==="itx"?n??=Bn(t(s)):Bn(t(s))}catch(a){return Promise.reject(a)}};return{get spec(){return r},then(s,a){return i().then(s,a)},catch(s){return i().catch(s)},finally(s){return i().finally(s)},requestTransaction(s){let a=i(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function Bn(e){return typeof e.then=="function"?e:Promise.resolve(e)}E();y();w();v();b();var Yc=va.split(".")[0],Xc={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},eh=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(e){return this.getGlobalTracingHelper().getTraceParent(e)}dispatchEngineSpans(e){return this.getGlobalTracingHelper().dispatchEngineSpans(e)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(e,t){return this.getGlobalTracingHelper().runInChildSpan(e,t)}getGlobalTracingHelper(){let e=globalThis[`V${Yc}_PRISMA_INSTRUMENTATION`],t=globalThis.PRISMA_INSTRUMENTATION;return e?.helper??t?.helper??Xc}};function th(){return new eh}E();y();w();v();b();function rh(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}E();y();w();v();b();function nh(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}E();y();w();v();b();var ih=class{constructor(){A(this,"_middlewares",[])}use(e){this._middlewares.push(e)}get(e){return this._middlewares[e]}has(e){return!!this._middlewares[e]}length(){return this._middlewares.length}};E();y();w();v();b();var sh=st(zo());E();y();w();v();b();function Us(e){return typeof e.batchRequestIdx=="number"}E();y();w();v();b();function oh(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Or(e.query.arguments)),t.push(Or(e.query.selection)),t.join("")}function Or(e){return`(${Object.keys(e).sort().map(t=>{let r=e[t];return typeof r=="object"&&r!==null?`(${t} ${Or(r)})`:t}).join(" ")})`}E();y();w();v();b();var ah={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function Ln(e){return ah[e]}E();y();w();v();b();var lh=class{constructor(e){this.options=e,A(this,"batches"),A(this,"tickActive",!1),this.batches={}}request(e){let t=this.options.batchBy(e);return t?(this.batches[t]||(this.batches[t]=[],this.tickActive||(this.tickActive=!0,te.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((r,n)=>{this.batches[t].push({request:e,resolve:r,reject:n})})):this.options.singleLoader(e)}dispatchBatches(){for(let e in this.batches){let t=this.batches[e];delete this.batches[e],t.length===1?this.options.singleLoader(t[0].request).then(r=>{r instanceof Error?t[0].reject(r):t[0].resolve(r)}).catch(r=>{t[0].reject(r)}):(t.sort((r,n)=>this.options.batchOrder(r.request,n.request)),this.options.batchLoader(t.map(r=>r.request)).then(r=>{if(r instanceof Error)for(let n=0;n<t.length;n++)t[n].reject(r);else for(let n=0;n<t.length;n++){let i=r[n];i instanceof Error?t[n].reject(i):t[n].resolve(i)}}).catch(r=>{for(let n=0;n<t.length;n++)t[n].reject(r)}))}}get[Symbol.toStringTag](){return"DataLoader"}};E();y();w();v();b();function Le(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Fe.Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"decimal":return new xt(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"bigint-array":return t.map(r=>Le("bigint",r));case"bytes-array":return t.map(r=>Le("bytes",r));case"decimal-array":return t.map(r=>Le("decimal",r));case"datetime-array":return t.map(r=>Le("datetime",r));case"date-array":return t.map(r=>Le("date",r));case"time-array":return t.map(r=>Le("time",r));default:return t}}function Bs(e){let t=[],r=uh(e);for(let n=0;n<e.rows.length;n++){let i=e.rows[n],s={...r};for(let a=0;a<i.length;a++)s[e.columns[a]]=Le(e.types[a],i[a]);t.push(s)}return t}function uh(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var ch=$e("prisma:client:request_handler"),hh=class{constructor(e,t){A(this,"client"),A(this,"dataloader"),A(this,"logEmitter"),this.logEmitter=t,this.client=e,this.dataloader=new lh({batchLoader:bc(async({requests:r,customDataProxyFetch:n})=>{let{transaction:i,otelParentCtx:s}=r[0],a=r.map(f=>f.protocolQuery),c=this.client._tracingHelper.getTraceParent(s),d=r.some(f=>Ln(f.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:c,transaction:dh(i),containsWrite:d,customDataProxyFetch:n})).map((f,h)=>{if(f instanceof Error)return f;try{return this.mapQueryEngineResult(r[h],f)}catch(m){return m}})}),singleLoader:async r=>{let n=r.transaction?.kind==="itx"?Ls(r.transaction):void 0,i=await this.client._engine.request(r.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:n,isWrite:Ln(r.protocolQuery.action),customDataProxyFetch:r.customDataProxyFetch});return this.mapQueryEngineResult(r,i)},batchBy:r=>r.transaction?.id?`transaction-${r.transaction.id}`:oh(r.protocolQuery),batchOrder(r,n){return r.transaction?.kind==="batch"&&n.transaction?.kind==="batch"?r.transaction.index-n.transaction.index:0}})}async request(e){try{return await this.dataloader.request(e)}catch(t){let{clientMethod:r,callsite:n,transaction:i,args:s,modelName:a}=e;this.handleAndLogRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:s,modelName:a,globalOmit:e.globalOmit})}}mapQueryEngineResult({dataPath:e,unpacker:t},r){let n=r?.data,i=this.unpack(n,e,t);return te.env.PRISMA_CLIENT_GET_TIME?{data:i}:i}handleAndLogRequestError(e){try{this.handleRequestError(e)}catch(t){throw this.logEmitter&&this.logEmitter.emit("error",{message:t.message,target:e.clientMethod,timestamp:new Date}),t}}handleRequestError({error:e,clientMethod:t,callsite:r,transaction:n,args:i,modelName:s,globalOmit:a}){if(ch(e),fh(e,n))throw e;if(e instanceof He&&ph(e)){let d=Hs(e.meta);Gi({args:i,errors:[d],callsite:r,errorFormat:this.client._errorFormat,originalMethod:t,clientVersion:this.client._clientVersion,globalOmit:a})}let c=e.message;if(r&&(c=ki({callsite:r,originalMethod:t,isPanic:e.isPanic,showColors:this.client._errorFormat==="pretty",message:c})),c=this.sanitizeMessage(c),e.code){let d=s?{modelName:s,...e.meta}:e.meta;throw new He(c,{code:e.code,clientVersion:this.client._clientVersion,meta:d,batchRequestIdx:e.batchRequestIdx})}else{if(e.isPanic)throw new gt(c,this.client._clientVersion);if(e instanceof Je)throw new Je(c,{clientVersion:this.client._clientVersion,batchRequestIdx:e.batchRequestIdx});if(e instanceof de)throw new de(c,this.client._clientVersion);if(e instanceof gt)throw new gt(c,this.client._clientVersion)}throw e.clientVersion=this.client._clientVersion,e}sanitizeMessage(e){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,sh.default)(e):e}unpack(e,t,r){if(!e||(e.data&&(e=e.data),!e))return e;let n=Object.keys(e)[0],i=Object.values(e)[0],s=t.filter(d=>d!=="select"&&d!=="include"),a=ps(i,s),c=n==="queryRaw"?Bs(a):Lt(a);return r?r(c):c}get[Symbol.toStringTag](){return"RequestHandler"}};function dh(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ls(e)};Wt(e,"Unknown transaction kind")}}function Ls(e){return{id:e.id,payload:e.payload}}function fh(e,t){return Us(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function ph(e){return e.code==="P2009"||e.code==="P2012"}function Hs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Hs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}E();y();w();v();b();var gh="6.5.0",mh=gh;E();y();w();v();b();var yh=st(ti());E();y();w();v();b();var J=class extends Error{constructor(e){super(e+`
21
- Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};z(J,"PrismaClientConstructorValidationError");var Hn=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Jn=["pretty","colorless","minimal"],Qn=["info","query","warn","error"],wh={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=et(r,t)||` Available datasources: ${t.join(", ")}`;throw new J(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
22
- It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,s]of Object.entries(n)){if(i!=="url")throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
23
- It should have this form: { url: "CONNECTION_STRING" }`);if(typeof s!="string")throw new J(`Invalid value ${JSON.stringify(s)} for datasource "${r}" provided to PrismaClient constructor.
24
- It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&hr(t.generator)==="client")throw new J('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e!==null){if(e===void 0)throw new J('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Ds(t).includes("driverAdapters"))throw new J('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(hr(t.generator)==="binary")throw new J('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')}},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor.
25
- Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Jn.includes(e)){let t=et(e,Jn);throw new J(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Qn.includes(r)){let n=et(r,Qn);throw new J(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let s=["stdout","event"];if(!s.includes(i)){let a=et(i,s);throw new J(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${a}`)}}};if(r&&typeof r=="object")for(let[i,s]of Object.entries(r))if(n[i])n[i](s);else throw new J(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new J(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new J(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new J('"omit" option is expected to be an object.');if(e===null)throw new J('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let s=Eh(n,t.runtimeDataModel);if(!s){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[a,c]of Object.entries(i)){let d=s.fields.find(f=>f.name===a);if(!d){r.push({kind:"UnknownField",modelKey:n,fieldName:a});continue}if(d.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:a});continue}typeof c!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:a})}}if(r.length>0)throw new J(Ph(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new J(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=et(r,t);throw new J(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function vh(e,t){for(let[r,n]of Object.entries(e)){if(!Hn.includes(r)){let i=et(r,Hn);throw new J(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}wh[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new J('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function et(e,t){if(t.length===0||typeof e!="string")return"";let r=bh(e,t);return r?` Did you mean "${r}"?`:""}function bh(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,yh.default)(e,i)}));r.sort((i,s)=>i.distance<s.distance?-1:1);let n=r[0];return n.distance<3?n.value:null}function Eh(e,t){return Wn(t.models,e)??Wn(t.types,e)}function Wn(e,t){let r=Object.keys(e).find(n=>Ir(n)===t);if(r)return e[r]}function Ph(e,t){let r=Lr(e);for(let s of t)switch(s.kind){case"UnknownModel":r.arguments.getField(s.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${s.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([s.modelKey,s.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${s.modelKey}" does not have a field named "${s.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([s.modelKey,s.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([s.modelKey,s.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=Ki(r,"colorless");return`Error validating "omit" option:
26
-
27
- ${i}
28
-
29
- ${n}`}E();y();w();v();b();function xh(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,s=!1,a=0,c=()=>{s||(a++,a===e.length&&(s=!0,i?r(i):t(n)))},d=f=>{s||(s=!0,r(f))};for(let f=0;f<e.length;f++)e[f].then(h=>{n[f]=h,c()},h=>{if(!Us(h)){d(h);return}h.batchRequestIdx===f?d(h):(i||(i=h),c())})})}var Me=$e("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Ah={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},_h=Symbol.for("prisma.client.transaction.id"),Sh={id:0,nextId(){return++this.id}};function Rh(e){class t{constructor(n){A(this,"_originalClient",this),A(this,"_runtimeDataModel"),A(this,"_requestHandler"),A(this,"_connectionPromise"),A(this,"_disconnectionPromise"),A(this,"_engineConfig"),A(this,"_accelerateEngineConfig"),A(this,"_clientVersion"),A(this,"_errorFormat"),A(this,"_tracingHelper"),A(this,"_middlewares",new ih),A(this,"_previewFeatures"),A(this,"_activeProvider"),A(this,"_globalOmit"),A(this,"_extensions"),A(this,"_engine"),A(this,"_appliedParent"),A(this,"_createPrismaPromise",Un()),A(this,"$metrics",new ss(this)),A(this,"$extends",uc),e=n?.__internal?.configOverride?.(e)??e,Ec(e),n&&vh(n,e);let i=new ei().on("error",()=>{});this._extensions=zi.empty(),this._previewFeatures=Ds(e),this._clientVersion=e.clientVersion??mh,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=th();let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&dt.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&dt.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a;if(n?.adapter){a=ra(n.adapter);let d=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(a.provider!==d)throw new de(`The Driver Adapter \`${a.adapterName}\`, based on \`${a.provider}\`, is not compatible with the provider \`${d}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new de("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let c=e.injectableEdgeEnv?.();try{let d=n??{},f=d.__internal??{},h=f.debug===!0;h&&$e.enable("prisma:client");let m=dt.resolve(e.dirname,e.relativePath);Zn.existsSync(m)||(m=e.dirname),Me("dirname",e.dirname),Me("relativePath",e.relativePath),Me("cwd",m);let x=f.engine||{};if(d.errorFormat?this._errorFormat=d.errorFormat:te.env.NODE_ENV==="production"?this._errorFormat="minimal":te.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:m,dirname:e.dirname,enableDebugLogs:h,allowTriggerPanic:x.allowTriggerPanic,datamodelPath:dt.join(e.dirname,e.filename??"schema.prisma"),prismaPath:x.binaryPath??void 0,engineEndpoint:x.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:d.log&&nh(d.log),logQueries:d.log&&!!(typeof d.log=="string"?d.log==="query":d.log.find(R=>typeof R=="string"?R==="query":R.level==="query")),env:c?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Pc(d,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:d.transactionOptions?.maxWait??2e3,timeout:d.transactionOptions?.timeout??5e3,isolationLevel:d.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:a},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Wr,getBatchRequestPayload:hs,prismaGraphQLToJSError:ds,PrismaClientUnknownRequestError:Je,PrismaClientInitializationError:de,PrismaClientKnownRequestError:He,debug:$e("prisma:client:accelerateEngine"),engineVersion:Ou.version,clientVersion:e.clientVersion}},Me("clientVersion",e.clientVersion),this._engine=Jc(e,this._engineConfig),this._requestHandler=new hh(this,i),d.log)for(let R of d.log){let $=typeof R=="string"?R:R.emit==="stdout"?R.level:null;$&&this.$on($,N=>{dr.log(`${dr.tags[$]??""}`,N.message||N.query)})}}catch(d){throw d.clientVersion=this._clientVersion,d}return this._appliedParent=Rr(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{ya()}}$executeRawInternal(n,i,s,a){let c=this._activeProvider;return this._request({action:"executeRaw",args:s,transaction:n,clientMethod:i,argsMapper:jn({clientMethod:i,activeProvider:c}),callsite:yt(this._errorFormat),dataPath:[],middlewareArgsMapper:a})}$executeRaw(n,...i){return this._createPrismaPromise(s=>{if(n.raw!==void 0||n.sql!==void 0){let[a,c]=Kn(n,i);return Vn(this._activeProvider,a.text,a.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(s,"$executeRaw",a,c)}throw new Re("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(s=>(Vn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(s,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Re(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Qc,callsite:yt(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,s,a){let c=this._activeProvider;return this._request({action:"queryRaw",args:s,transaction:n,clientMethod:i,argsMapper:jn({clientMethod:i,activeProvider:c}),callsite:yt(this._errorFormat),dataPath:[],middlewareArgsMapper:a})}$queryRaw(n,...i){return this._createPrismaPromise(s=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(s,"$queryRaw",...Kn(n,i));throw new Re("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new Re("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(s=>this.$queryRawInternal(s,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let s=Sh.nextId(),a=rh(n.length),c=n.map((d,f)=>{if(d?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let h=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,m={kind:"batch",id:s,index:f,isolationLevel:h,lock:a};return d.requestTransaction?.(m)??d});return xh(c)}async _transactionWithCallback({callback:n,options:i}){let s={traceparent:this._tracingHelper.getTraceParent()},a={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},c=await this._engine.transaction("start",s,a),d;try{let f={kind:"itx",...c};d=await n(this._createItxClient(f)),await this._engine.transaction("commit",s,c)}catch(f){throw await this._engine.transaction("rollback",s,c).catch(()=>{}),f}return d}_createItxClient(n){return it(Rr(it(lc(this),[Pe("_appliedParent",()=>this._appliedParent._createItxClient(n)),Pe("_createPrismaPromise",()=>Un(n)),Pe(_h,()=>n.id)])),[Ar(gc)])}$transaction(n,i){let s;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?s=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:s=()=>this._transactionWithCallback({callback:n,options:i}):s=()=>this._transactionWithArray({promises:n,options:i});let a={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(a,s)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Ah,s={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},a={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:s.action,model:s.model,name:s.model?`${s.model}.${s.action}`:s.action}}},c=-1,d=async f=>{let h=this._middlewares.get(++c);if(h)return this._tracingHelper.runInChildSpan(a.middleware,U=>h(f,D=>(U?.end(),d(D))));let{runInTransaction:m,args:x,...R}=f,$={...n,...R};x&&($.args=i.middlewareArgsToRequestArgs(x)),n.transaction!==void 0&&m===!1&&delete $.transaction;let N=await vc(this,$);return $.model?fc({result:N,modelName:$.model,args:$.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):N};return this._tracingHelper.runInChildSpan(a.operation,()=>d(s))}async _executeRequest({args:n,clientMethod:i,dataPath:s,callsite:a,action:c,model:d,argsMapper:f,transaction:h,unpacker:m,otelParentCtx:x,customDataProxyFetch:R}){try{n=f?f(n):n;let $={name:"serialize"},N=this._tracingHelper.runInChildSpan($,()=>rs({modelName:d,runtimeDataModel:this._runtimeDataModel,action:c,args:n,clientMethod:i,callsite:a,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return $e.enabled("prisma:client")&&(Me("Prisma Client call:"),Me(`prisma.${i}(${Iu(n)})`),Me("Generated request:"),Me(JSON.stringify(N,null,2)+`
30
- `)),h?.kind==="batch"&&await h.lock,this._requestHandler.request({protocolQuery:N,modelName:d,action:c,clientMethod:i,dataPath:s,callsite:a,args:n,extensions:this._extensions,transaction:h,unpacker:m,otelParentCtx:x,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:R})}catch($){throw $.clientVersion=this._clientVersion,$}}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Kn(e,t){return Nh(e)?[new Ue(e,t),zc]:[e,Zc]}function Nh(e){return Array.isArray(e)&&Array.isArray(e.raw)}E();y();w();v();b();var $h=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Oh(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!$h.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}E();y();w();v();b()});var jh={};yo(jh,{createAccelerateHttpClient:()=>Gs});module.exports=wo(jh);Be();Be();var zr=un(require("@prisma/client/package.json"),1),Ks=un(Qs(),1),kh=["postgres"],Ch="accelerate.prisma-data.net",Th=zr.default.devDependencies["@prisma/engines-version"],Mh=zr.default.version,Ih=Th.split("-")[1].split(".")[1],Ws=$t;function Gs(e){let{provider:t}=e;if(t!=="postgresql"&&!kh.includes(t))throw new Error(`Invalid provider: ${t}`);let r=qh(e);return{sendQueryRequest:Vh(e,r)}}function qh(e){let t=`https://${e.host||Ch}/${Mh}/${zs(e.provider).hash}`,r=e.fetch||fetch,n={Authorization:`Bearer ${e.apiKey}`,"Prisma-Engine-Hash":Ih};return i=>r(`${t}/${i.path}`,{body:i.body,headers:n,method:i.method})}async function Fh(e,t){let r=await t({body:zs(e.provider).encoded,method:"PUT",path:"schema"});if(!r.ok){try{console.error(await r.text())}catch{}throw new Error(`Failed to upload schema to query engine: ${r.statusText}`)}}function zs(e){return e==="postgresql"?Ws.postgres:Ws[e]}async function Dh(e,t){let r=await t({body:JSON.stringify(e),method:"POST",path:"graphql"});if(!r.ok){try{console.error(await r.text())}catch{}throw new Error(`Failed to execute query: ${r.statusText}`)}return await r.json()}function Vh(e,t){let r=null;return async n=>{await(r||=Fh(e,t));let{data:i,errors:s}=await Dh({action:"queryRaw",query:{arguments:{parameters:n.parameters,query:n.sql},selection:{}}},t);if(s)throw new AggregateError(s,"Errors occurred while executing the query");return(0,Ks.deserializeRawResult)(i.queryRaw)}}0&&(module.exports={createAccelerateHttpClient});
1
+ "use strict";var m=Object.create;var c=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},l=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of h(t))!E.call(e,n)&&n!==r&&c(e,n,{get:()=>t[n],enumerable:!(s=w(t,n))||s.enumerable});return e};var A=(e,t,r)=>(r=e!=null?m(g(e)):{},l(t||!e||!e.__esModule?c(r,"default",{value:e,enumerable:!0}):r,e)),P=e=>l(c({},"__esModule",{value:!0}),e);var Q={};f(Q,{createAccelerateHttpClient:()=>y});module.exports=P(Q);var u={postgres:{encoded:"ZGF0YXNvdXJjZSBkYiB7CiAgICBwcm92aWRlciA9ICJwb3N0Z3JlcyIKICAgIHVybCAgICAgID0gZW52KCJEQVRBQkFTRV9VUkwiKQp9CiAgICAKZ2VuZXJhdG9yIGNsaWVudCB7CiAgICBwcm92aWRlciA9ICJwcmlzbWEtY2xpZW50LWpzIgp9",hash:"54195896aeafa3318ca33f5a8bb44c6b4d89c368cb15288f3bd5ace35a3f9227"}};var p=A(require("@prisma/client/package.json"),1),q=["postgres"],C="accelerate.prisma-data.net",_=p.default.devDependencies["@prisma/engines-version"],k=p.default.version,H=_.split("-")[1].split(".")[1],R=u;function y(e){let{provider:t}=e;if(t!=="postgresql"&&!q.includes(t))throw new Error(`Invalid provider: ${t}`);let r=I(e);return{sendQueryRequest:O(e,r)}}function I(e){let t=`https://${e.host||C}/${k}/${d(e.provider).hash}`,r=e.fetch||fetch,s={Authorization:`Bearer ${e.apiKey}`,"Prisma-Engine-Hash":H};return n=>r(`${t}/${n.path}`,{body:n.body,headers:s,method:n.method})}async function T(e,t){let r=await t({body:d(e.provider).encoded,method:"PUT",path:"schema"});if(!r.ok){try{console.error(await r.text())}catch{}throw new Error(`Failed to upload schema to query engine: ${r.statusText}`)}}function d(e){return e==="postgresql"?R.postgres:R[e]}async function b(e,t){let r=await t({body:JSON.stringify(e),method:"POST",path:"graphql"});if(!r.ok){try{console.error(await r.text())}catch{}throw new Error(`Failed to execute query: ${r.statusText}`)}return await r.json()}function O(e,t){let r=null;return async s=>{await(r||=T(e,t));let{data:n,errors:a}=await b({action:"queryRaw",query:{arguments:{parameters:s.parameters,query:s.sql},selection:{}}},t);if(a)throw new AggregateError(a,"Errors occurred while executing the query");return x(n.queryRaw)}}function x(e){let t=[],r=D(e);for(let s=0;s<e.rows.length;s++){let n=e.rows[s],a={...r};for(let i=0;i<n.length;i++)a[e.columns[i]]=o(e.types[i],n[i]);t.push(a)}return t}function o(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bigint-array":return t.map(r=>o("bigint",r));case"bytes-array":return t.map(r=>o("bytes",r));case"decimal-array":return t.map(r=>o("decimal",r));case"datetime-array":return t.map(r=>o("datetime",r));case"date-array":return t.map(r=>o("date",r));case"time-array":return t.map(r=>o("time",r));default:return t}}function D(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}0&&(module.exports={createAccelerateHttpClient});