@decocms/mesh 1.0.0-alpha.12 → 1.0.0-alpha.13

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.
@@ -938,7 +938,7 @@ Please refer to the documentation here: https://better-auth.com/docs/plugins/org
938
938
  </script>
939
939
  <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference" ${G}></script>
940
940
  </body>
941
- </html>`},dr=(Q)=>{let J=Q?.path??"/reference";return{id:"open-api",endpoints:{generateOpenAPISchema:l0("/open-api/generate-schema",{method:"GET"},async(X)=>{let G=await KP0(X.context,X.context.options);return X.json(G)}),openAPIReference:l0(J,{method:"GET",metadata:{isAction:!1}},async(X)=>{if(Q?.disableDefaultReference)throw new n("NOT_FOUND");let G=await KP0(X.context,X.context.options);return new Response(hg1(G,Q?.theme,Q?.nonce),{headers:{"Content-Type":"text/html"}})})}}};var ZP0=_(()=>{ZX();t8();F4();S8();vg1=new Set(["string","number","boolean","array","object"])});var uH6,mH6,lH6,dH6,qP0,bg1,pH6,cH6,nH6,iH6,rH6,aH6,HP0,oH6;var FP0=_(()=>{cG();p5();m8();t8();w8();L9();aD();AR();Ar();V7();Q9();jQ();l9();F4();S8();uH6=s4(async()=>{return{}}),mH6=s4({use:[F8]},async(Q)=>{return{session:Q.context.session}}),lH6=j6({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_SLUG_ALREADY_TAKEN:"Organization slug already taken",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:"You cannot leave the organization without an owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:"Email verification required before accepting or rejecting invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"You are not allowed to invite a user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached",USER_IS_NOT_A_MEMBER_OF_THE_TEAM:"User is not a member of the team",YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:"You are not allowed to list the members of this team",YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:"You do not have an active team",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:"You are not allowed to create a new member",YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:"You are not allowed to remove a team member",YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:"You are not allowed to access this organization as an owner",YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:"You are not a member of this organization",MISSING_AC_INSTANCE:"Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information",YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:"You must be in an organization to create a role",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:"You are not allowed to create a role",YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:"You are not allowed to update a role",YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:"You are not allowed to delete a role",YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:"You are not allowed to read a role",YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:"You are not allowed to list a role",YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:"You are not allowed to get a role",TOO_MANY_ROLES:"This organization has too many roles",INVALID_RESOURCE:"The provided permission includes an invalid resource",ROLE_NAME_IS_ALREADY_TAKEN:"That role name is already taken",CANNOT_DELETE_A_PRE_DEFINED_ROLE:"Cannot delete a pre-defined role"}),dH6=Number.POSITIVE_INFINITY,qP0=C(),bg1=v1(["pending","accepted","rejected","canceled"]).default("pending"),pH6=J0({id:C().default(B9),name:C(),slug:C(),logo:C().nullish().optional(),metadata:D1(C(),UX()).or(C().transform((Q)=>JSON.parse(Q))).optional(),createdAt:r1()}),cH6=J0({id:C().default(B9),organizationId:C(),userId:x1.string(),role:qP0,createdAt:r1().default(()=>new Date)}),nH6=J0({id:C().default(B9),organizationId:C(),email:C(),role:qP0,status:bg1,teamId:C().nullish(),inviterId:C(),expiresAt:r1(),createdAt:r1().default(()=>new Date)}),iH6=J0({id:C().default(B9),name:C().min(1),organizationId:C(),createdAt:r1(),updatedAt:r1().optional()}),rH6=J0({id:C().default(B9),teamId:C(),userId:C(),createdAt:r1().default(()=>new Date)}),aH6=J0({id:C().default(B9),organizationId:C(),role:C(),permission:D1(C(),V1(C())),createdAt:r1().default(()=>new Date),updatedAt:r1().optional()}),HP0=["admin","member","owner"],oH6=O8([v1(HP0),V1(v1(HP0))])});var $q6;var VP0=_(()=>{N8();m8();w8();L9();Q9();jQ();l9();S8();$q6=j6({INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",PHONE_NUMBER_NOT_EXIST:"phone number isn't registered",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified",PHONE_NUMBER_CANNOT_BE_UPDATED:"Phone number cannot be updated",SEND_OTP_NOT_IMPLEMENTED:"sendOTP not implemented",TOO_MANY_ATTEMPTS:"Too many attempts"})});var zP0=_(()=>{m8();yX();t8();w8();S8()});var xg1;var UP0=_(()=>{N8();m8();c5();w8();L9();vD();Q9();jQ();l9();x9();S8();o6();u7();Lr();xg1=j6({OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"})});var gg1;var NP0=_(()=>{m8();t8();w8();Q9();jQ();l9();S8();gg1=j6({INVALID_USERNAME_OR_PASSWORD:"Invalid username or password",EMAIL_NOT_VERIFIED:"Email not verified",UNEXPECTED_ERROR:"Unexpected error",USERNAME_IS_ALREADY_TAKEN:"Username is already taken. Please try another.",USERNAME_TOO_SHORT:"Username is too short",USERNAME_TOO_LONG:"Username is too long",INVALID_USERNAME:"Username is invalid",INVALID_DISPLAY_USERNAME:"Display username is invalid"})});var pr=_(()=>{kG();ZX();cG();p5();N8();g$();m8();L7();c5();yX();t8();w8();L9();vD();aD();tV();Pr();Mr();AR();Ar();Cw0();tD();Sw0();vw0();cw0();nw0();iw0();rw0();ow0();sw0();tw0();ew0();Cr();QP0();_r();JP0();XP0();YP0();GP0();ZP0();FP0();VP0();zP0();UP0();NP0()});var BP0=_(()=>{tV();AR()});var GH;var OP0=_(()=>{GH={enabled:!0,batchSize:250,flushIntervalMs:300,maxQueueSize:1e4,redactor:"regex"}});import{existsSync as DP0,readFileSync as LP0}from"fs";function ug1(){if(DP0(wP0))try{let Q=LP0(wP0,"utf-8"),J=JSON.parse(Q);return{auth:fR,monitoring:GH,...J}}catch{return{auth:fR,monitoring:GH}}if(DP0(PP0))try{let Q=LP0(PP0,"utf-8");return{auth:JSON.parse(Q),monitoring:GH}}catch{return{auth:fR,monitoring:GH}}return{auth:fR,monitoring:GH}}function MP0(){return{...GH,...bR.monitoring}}var fR,wP0="./config.json",PP0="./auth-config.json",bR;var cr=_(()=>{OP0();fR={emailAndPassword:{enabled:!0}};bR=ug1()});var AP0=_(()=>{XH()});var ir=I((lg1)=>{lg1.parse=function(Q,J){return new nr(Q,J).parse()};class nr{constructor(Q,J){this.source=Q,this.transform=J||mg1,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var Q=this.source[this.position++];if(Q==="\\")return{value:this.source[this.position++],escaped:!0};return{value:Q,escaped:!1}}record(Q){this.recorded.push(Q)}newEntry(Q){var J;if(this.recorded.length>0||Q){if(J=this.recorded.join(""),J==="NULL"&&!Q)J=null;if(J!==null)J=this.transform(J);this.entries.push(J),this.recorded=[]}}consumeDimensions(){if(this.source[0]==="[")while(!this.isEof()){var Q=this.nextCharacter();if(Q.value==="=")break}}parse(Q){var J,X,G;this.consumeDimensions();while(!this.isEof())if(J=this.nextCharacter(),J.value==="{"&&!G){if(this.dimension++,this.dimension>1)X=new nr(this.source.substr(this.position-1),this.transform),this.entries.push(X.parse(!0)),this.position+=X.position-2}else if(J.value==="}"&&!G){if(this.dimension--,!this.dimension){if(this.newEntry(),Q)return this.entries}}else if(J.value==='"'&&!J.escaped){if(G)this.newEntry(!0);G=!G}else if(J.value===","&&!G)this.newEntry();else this.record(J.value);if(this.dimension!==0)throw Error("array dimension not balanced");return this.entries}}function mg1(Q){return Q}});var rr=I((UV6,TP0)=>{var pg1=ir();TP0.exports={create:function(Q,J){return{parse:function(){return pg1.parse(Q,J)}}}}});var IP0=I((NV6,jP0)=>{var cg1=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,ng1=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,ig1=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,rg1=/^-?infinity$/;jP0.exports=function(J){if(rg1.test(J))return Number(J.replace("i","I"));var X=cg1.exec(J);if(!X)return ag1(J)||null;var G=!!X[8],Y=parseInt(X[1],10);if(G)Y=EP0(Y);var W=parseInt(X[2],10)-1,$=X[3],K=parseInt(X[4],10),Z=parseInt(X[5],10),H=parseInt(X[6],10),q=X[7];q=q?1000*parseFloat(q):0;var F,V=og1(J);if(V!=null){if(F=new Date(Date.UTC(Y,W,$,K,Z,H,q)),ar(Y))F.setUTCFullYear(Y);if(V!==0)F.setTime(F.getTime()-V)}else if(F=new Date(Y,W,$,K,Z,H,q),ar(Y))F.setFullYear(Y);return F};function ag1(Q){var J=ng1.exec(Q);if(!J)return;var X=parseInt(J[1],10),G=!!J[4];if(G)X=EP0(X);var Y=parseInt(J[2],10)-1,W=J[3],$=new Date(X,Y,W);if(ar(X))$.setFullYear(X);return $}function og1(Q){if(Q.endsWith("+00"))return 0;var J=ig1.exec(Q.split(" ")[1]);if(!J)return;var X=J[1];if(X==="Z")return 0;var G=X==="-"?-1:1,Y=parseInt(J[2],10)*3600+parseInt(J[3]||0,10)*60+parseInt(J[4]||0,10);return Y*G*1000}function EP0(Q){return-(Q-1)}function ar(Q){return Q>=0&&Q<100}});var CP0=I((BV6,RP0)=>{RP0.exports=tg1;var sg1=Object.prototype.hasOwnProperty;function tg1(Q){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var G in X)if(sg1.call(X,G))Q[G]=X[G]}return Q}});var kP0=I((OV6,vP0)=>{var eg1=CP0();vP0.exports=eV;function eV(Q){if(!(this instanceof eV))return new eV(Q);eg1(this,Fu1(Q))}var Qu1=["seconds","minutes","hours","days","months","years"];eV.prototype.toPostgres=function(){var Q=Qu1.filter(this.hasOwnProperty,this);if(this.milliseconds&&Q.indexOf("seconds")<0)Q.push("seconds");if(Q.length===0)return"0";return Q.map(function(J){var X=this[J]||0;if(J==="seconds"&&this.milliseconds)X=(X+this.milliseconds/1000).toFixed(6).replace(/\.?0+$/,"");return X+" "+J},this).join(" ")};var Ju1={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},Xu1=["years","months","days"],Yu1=["hours","minutes","seconds"];eV.prototype.toISOString=eV.prototype.toISO=function(){var Q=Xu1.map(X,this).join(""),J=Yu1.map(X,this).join("");return"P"+Q+"T"+J;function X(G){var Y=this[G]||0;if(G==="seconds"&&this.milliseconds)Y=(Y+this.milliseconds/1000).toFixed(6).replace(/0+$/,"");return Y+Ju1[G]}};var or="([+-]?\\d+)",Gu1=or+"\\s+years?",Wu1=or+"\\s+mons?",$u1=or+"\\s+days?",Ku1="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Zu1=new RegExp([Gu1,Wu1,$u1,Ku1].map(function(Q){return"("+Q+")?"}).join("\\s*")),SP0={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},Hu1=["hours","minutes","seconds","milliseconds"];function qu1(Q){var J=Q+"000000".slice(Q.length);return parseInt(J,10)/1000}function Fu1(Q){if(!Q)return{};var J=Zu1.exec(Q),X=J[8]==="-";return Object.keys(SP0).reduce(function(G,Y){var W=SP0[Y],$=J[W];if(!$)return G;if($=Y==="milliseconds"?qu1($):parseInt($,10),!$)return G;if(X&&~Hu1.indexOf(Y))$*=-1;return G[Y]=$,G},{})}});var hP0=I((DV6,yP0)=>{var _P0=Buffer.from||Buffer;yP0.exports=function(J){if(/^\\x/.test(J))return _P0(J.substr(2),"hex");var X="",G=0;while(G<J.length)if(J[G]!=="\\")X+=J[G],++G;else if(/[0-7]{3}/.test(J.substr(G+1,3)))X+=String.fromCharCode(parseInt(J.substr(G+1,3),8)),G+=4;else{var Y=1;while(G+Y<J.length&&J[G+Y]==="\\")Y++;for(var W=0;W<Math.floor(Y/2);++W)X+="\\";G+=Math.floor(Y/2)*2}return _P0(X,"binary")}});var lP0=I((LV6,mP0)=>{var $L=ir(),KL=rr(),xR=IP0(),bP0=kP0(),xP0=hP0();function gR(Q){return function(X){if(X===null)return X;return Q(X)}}function gP0(Q){if(Q===null)return Q;return Q==="TRUE"||Q==="t"||Q==="true"||Q==="y"||Q==="yes"||Q==="on"||Q==="1"}function Vu1(Q){if(!Q)return null;return $L.parse(Q,gP0)}function zu1(Q){return parseInt(Q,10)}function sr(Q){if(!Q)return null;return $L.parse(Q,gR(zu1))}function Uu1(Q){if(!Q)return null;return $L.parse(Q,gR(function(J){return uP0(J).trim()}))}var Nu1=function(Q){if(!Q)return null;var J=KL.create(Q,function(X){if(X!==null)X=Ja(X);return X});return J.parse()},tr=function(Q){if(!Q)return null;var J=KL.create(Q,function(X){if(X!==null)X=parseFloat(X);return X});return J.parse()},xX=function(Q){if(!Q)return null;var J=KL.create(Q);return J.parse()},er=function(Q){if(!Q)return null;var J=KL.create(Q,function(X){if(X!==null)X=xR(X);return X});return J.parse()},Bu1=function(Q){if(!Q)return null;var J=KL.create(Q,function(X){if(X!==null)X=bP0(X);return X});return J.parse()},Ou1=function(Q){if(!Q)return null;return $L.parse(Q,gR(xP0))},Qa=function(Q){return parseInt(Q,10)},uP0=function(Q){var J=String(Q);if(/^\d+$/.test(J))return J;return Q},fP0=function(Q){if(!Q)return null;return $L.parse(Q,gR(JSON.parse))},Ja=function(Q){if(Q[0]!=="(")return null;return Q=Q.substring(1,Q.length-1).split(","),{x:parseFloat(Q[0]),y:parseFloat(Q[1])}},Du1=function(Q){if(Q[0]!=="<"&&Q[1]!=="(")return null;var J="(",X="",G=!1;for(var Y=2;Y<Q.length-1;Y++){if(!G)J+=Q[Y];if(Q[Y]===")"){G=!0;continue}else if(!G)continue;if(Q[Y]===",")continue;X+=Q[Y]}var W=Ja(J);return W.radius=parseFloat(X),W},Lu1=function(Q){Q(20,uP0),Q(21,Qa),Q(23,Qa),Q(26,Qa),Q(700,parseFloat),Q(701,parseFloat),Q(16,gP0),Q(1082,xR),Q(1114,xR),Q(1184,xR),Q(600,Ja),Q(651,xX),Q(718,Du1),Q(1000,Vu1),Q(1001,Ou1),Q(1005,sr),Q(1007,sr),Q(1028,sr),Q(1016,Uu1),Q(1017,Nu1),Q(1021,tr),Q(1022,tr),Q(1231,tr),Q(1014,xX),Q(1015,xX),Q(1008,xX),Q(1009,xX),Q(1040,xX),Q(1041,xX),Q(1115,er),Q(1182,er),Q(1185,er),Q(1186,bP0),Q(1187,Bu1),Q(17,xP0),Q(114,JSON.parse.bind(JSON)),Q(3802,JSON.parse.bind(JSON)),Q(199,fP0),Q(3807,fP0),Q(3907,xX),Q(2951,xX),Q(791,xX),Q(1183,xX),Q(1270,xX)};mP0.exports={init:Lu1}});var pP0=I((wV6,dP0)=>{var YJ=1e6;function wu1(Q){var J=Q.readInt32BE(0),X=Q.readUInt32BE(4),G="";if(J<0)J=~J+(X===0),X=~X+1>>>0,G="-";var Y="",W,$,K,Z,H,q;{if(W=J%YJ,J=J/YJ>>>0,$=4294967296*W+X,X=$/YJ>>>0,K=""+($-YJ*X),X===0&&J===0)return G+K+Y;Z="",H=6-K.length;for(q=0;q<H;q++)Z+="0";Y=Z+K+Y}{if(W=J%YJ,J=J/YJ>>>0,$=4294967296*W+X,X=$/YJ>>>0,K=""+($-YJ*X),X===0&&J===0)return G+K+Y;Z="",H=6-K.length;for(q=0;q<H;q++)Z+="0";Y=Z+K+Y}{if(W=J%YJ,J=J/YJ>>>0,$=4294967296*W+X,X=$/YJ>>>0,K=""+($-YJ*X),X===0&&J===0)return G+K+Y;Z="",H=6-K.length;for(q=0;q<H;q++)Z+="0";Y=Z+K+Y}return W=J%YJ,$=4294967296*W+X,K=""+$%YJ,G+K+Y}dP0.exports=wu1});var aP0=I((PV6,rP0)=>{var Pu1=pP0(),d8=function(Q,J,X,G,Y){X=X||0,G=G||!1,Y=Y||function(z,U,B){return z*Math.pow(2,B)+U};var W=X>>3,$=function(z){if(G)return~z&255;return z},K=255,Z=8-X%8;if(J<Z)K=255<<8-J&255,Z=J;if(X)K=K>>X%8;var H=0;if(X%8+J>=8)H=Y(0,$(Q[W])&K,Z);var q=J+X>>3;for(var F=W+1;F<q;F++)H=Y(H,$(Q[F]),8);var V=(J+X)%8;if(V>0)H=Y(H,$(Q[q])>>8-V,V);return H},iP0=function(Q,J,X){var G=Math.pow(2,X-1)-1,Y=d8(Q,1),W=d8(Q,X,1);if(W===0)return 0;var $=1,K=function(H,q,F){if(H===0)H=1;for(var V=1;V<=F;V++)if($/=2,(q&1<<F-V)>0)H+=$;return H},Z=d8(Q,J,X+1,!1,K);if(W==Math.pow(2,X+1)-1){if(Z===0)return Y===0?1/0:-1/0;return NaN}return(Y===0?1:-1)*Math.pow(2,W-G)*Z},Mu1=function(Q){if(d8(Q,1)==1)return-1*(d8(Q,15,1,!0)+1);return d8(Q,15,1)},cP0=function(Q){if(d8(Q,1)==1)return-1*(d8(Q,31,1,!0)+1);return d8(Q,31,1)},Au1=function(Q){return iP0(Q,23,8)},Tu1=function(Q){return iP0(Q,52,11)},Eu1=function(Q){var J=d8(Q,16,32);if(J==49152)return NaN;var X=Math.pow(1e4,d8(Q,16,16)),G=0,Y=[],W=d8(Q,16);for(var $=0;$<W;$++)G+=d8(Q,16,64+16*$)*X,X/=1e4;var K=Math.pow(10,d8(Q,16,48));return(J===0?1:-1)*Math.round(G*K)/K},nP0=function(Q,J){var X=d8(J,1),G=d8(J,63,1),Y=new Date((X===0?1:-1)*G/1000+946684800000);if(!Q)Y.setTime(Y.getTime()+Y.getTimezoneOffset()*60000);return Y.usec=G%1000,Y.getMicroSeconds=function(){return this.usec},Y.setMicroSeconds=function(W){this.usec=W},Y.getUTCMicroSeconds=function(){return this.usec},Y},ZL=function(Q){var J=d8(Q,32),X=d8(Q,32,32),G=d8(Q,32,64),Y=96,W=[];for(var $=0;$<J;$++)W[$]=d8(Q,32,Y),Y+=32,Y+=32;var K=function(H){var q=d8(Q,32,Y);if(Y+=32,q==4294967295)return null;var F;if(H==23||H==20)return F=d8(Q,q*8,Y),Y+=q*8,F;else if(H==25)return F=Q.toString(this.encoding,Y>>3,(Y+=q<<3)>>3),F;else console.log("ERROR: ElementType not implemented: "+H)},Z=function(H,q){var F=[],V;if(H.length>1){var z=H.shift();for(V=0;V<z;V++)F[V]=Z(H,q);H.unshift(z)}else for(V=0;V<H[0];V++)F[V]=K(q);return F};return Z(W,G)},ju1=function(Q){return Q.toString("utf8")},Iu1=function(Q){if(Q===null)return null;return d8(Q,8)>0},Ru1=function(Q){Q(20,Pu1),Q(21,Mu1),Q(23,cP0),Q(26,cP0),Q(1700,Eu1),Q(700,Au1),Q(701,Tu1),Q(16,Iu1),Q(1114,nP0.bind(null,!1)),Q(1184,nP0.bind(null,!0)),Q(1000,ZL),Q(1007,ZL),Q(1016,ZL),Q(1008,ZL),Q(1009,ZL),Q(25,ju1)};rP0.exports={init:Ru1}});var sP0=I((MV6,oP0)=>{oP0.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var qL=I((hu1)=>{var Cu1=lP0(),Su1=aP0(),vu1=rr(),ku1=sP0();hu1.getTypeParser=_u1;hu1.setTypeParser=yu1;hu1.arrayParser=vu1;hu1.builtins=ku1;var HL={text:{},binary:{}};function tP0(Q){return String(Q)}function _u1(Q,J){if(J=J||"text",!HL[J])return tP0;return HL[J][Q]||tP0}function yu1(Q,J,X){if(typeof J=="function")X=J,J="text";HL[J][Q]=X}Cu1.init(function(Q,J){HL.text[Q]=J});Su1.init(function(Q,J){HL.binary[Q]=J})});var FL=I((TV6,Xa)=>{Xa.exports={host:"localhost",user:process.platform==="win32"?process.env.USERNAME:process.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:30000,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var Qz=qL(),uu1=Qz.getTypeParser(20,"text"),mu1=Qz.getTypeParser(1016,"text");Xa.exports.__defineSetter__("parseInt8",function(Q){Qz.setTypeParser(20,"text",Q?Qz.getTypeParser(23,"text"):uu1),Qz.setTypeParser(1016,"text",Q?Qz.getTypeParser(1007,"text"):mu1)})});var Jz=I((EV6,JM0)=>{var lu1=FL(),eP0=E0("util"),{isDate:du1}=eP0.types||eP0;function pu1(Q){return'"'+Q.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")+'"'}function QM0(Q){let J="{";for(let X=0;X<Q.length;X++){if(X>0)J=J+",";if(Q[X]===null||typeof Q[X]>"u")J=J+"NULL";else if(Array.isArray(Q[X]))J=J+QM0(Q[X]);else if(ArrayBuffer.isView(Q[X])){let G=Q[X];if(!(G instanceof Buffer)){let Y=Buffer.from(G.buffer,G.byteOffset,G.byteLength);if(Y.length===G.byteLength)G=Y;else G=Y.slice(G.byteOffset,G.byteOffset+G.byteLength)}J+="\\\\x"+G.toString("hex")}else J+=pu1(uR(Q[X]))}return J=J+"}",J}var uR=function(Q,J){if(Q==null)return null;if(typeof Q==="object"){if(Q instanceof Buffer)return Q;if(ArrayBuffer.isView(Q)){let X=Buffer.from(Q.buffer,Q.byteOffset,Q.byteLength);if(X.length===Q.byteLength)return X;return X.slice(Q.byteOffset,Q.byteOffset+Q.byteLength)}if(du1(Q))if(lu1.parseInputDatesAsUTC)return iu1(Q);else return nu1(Q);if(Array.isArray(Q))return QM0(Q);return cu1(Q,J)}return Q.toString()};function cu1(Q,J){if(Q&&typeof Q.toPostgres==="function"){if(J=J||[],J.indexOf(Q)!==-1)throw Error('circular reference detected while preparing "'+Q+'" for query');return J.push(Q),uR(Q.toPostgres(uR),J)}return JSON.stringify(Q)}function nu1(Q){let J=-Q.getTimezoneOffset(),X=Q.getFullYear(),G=X<1;if(G)X=Math.abs(X)+1;let Y=String(X).padStart(4,"0")+"-"+String(Q.getMonth()+1).padStart(2,"0")+"-"+String(Q.getDate()).padStart(2,"0")+"T"+String(Q.getHours()).padStart(2,"0")+":"+String(Q.getMinutes()).padStart(2,"0")+":"+String(Q.getSeconds()).padStart(2,"0")+"."+String(Q.getMilliseconds()).padStart(3,"0");if(J<0)Y+="-",J*=-1;else Y+="+";if(Y+=String(Math.floor(J/60)).padStart(2,"0")+":"+String(J%60).padStart(2,"0"),G)Y+=" BC";return Y}function iu1(Q){let J=Q.getUTCFullYear(),X=J<1;if(X)J=Math.abs(J)+1;let G=String(J).padStart(4,"0")+"-"+String(Q.getUTCMonth()+1).padStart(2,"0")+"-"+String(Q.getUTCDate()).padStart(2,"0")+"T"+String(Q.getUTCHours()).padStart(2,"0")+":"+String(Q.getUTCMinutes()).padStart(2,"0")+":"+String(Q.getUTCSeconds()).padStart(2,"0")+"."+String(Q.getUTCMilliseconds()).padStart(3,"0");if(G+="+00:00",X)G+=" BC";return G}function ru1(Q,J,X){if(Q=typeof Q==="string"?{text:Q}:Q,J)if(typeof J==="function")Q.callback=J;else Q.values=J;if(X)Q.callback=X;return Q}var au1=function(Q){return'"'+Q.replace(/"/g,'""')+'"'},ou1=function(Q){let J=!1,X="'";if(Q==null)return"''";if(typeof Q!=="string")return"''";for(let G=0;G<Q.length;G++){let Y=Q[G];if(Y==="'")X+=Y+Y;else if(Y==="\\")X+=Y+Y,J=!0;else X+=Y}if(X+="'",J===!0)X=" E"+X;return X};JM0.exports={prepareValue:function(J){return uR(J)},normalizeQueryConfig:ru1,escapeIdentifier:au1,escapeLiteral:ou1}});var YM0=I((jV6,XM0)=>{var Xz=E0("crypto");function Ya(Q){return Xz.createHash("md5").update(Q,"utf-8").digest("hex")}function su1(Q,J,X){let G=Ya(J+Q);return"md5"+Ya(Buffer.concat([Buffer.from(G),X]))}function tu1(Q){return Xz.createHash("sha256").update(Q).digest()}function eu1(Q,J){return Q=Q.replace(/(\D)-/,"$1"),Xz.createHash(Q).update(J).digest()}function Qm1(Q,J){return Xz.createHmac("sha256",Q).update(J).digest()}async function Jm1(Q,J,X){return Xz.pbkdf2Sync(Q,J,X,32,"sha256")}XM0.exports={postgresMd5PasswordHash:su1,randomBytes:Xz.randomBytes,deriveKey:Jm1,sha256:tu1,hashByName:eu1,hmacSha256:Qm1,md5:Ya}});var KM0=I((IV6,$M0)=>{var GM0=E0("crypto");$M0.exports={postgresMd5PasswordHash:Ym1,randomBytes:Xm1,deriveKey:Km1,sha256:Gm1,hashByName:Wm1,hmacSha256:$m1,md5:Ga};var WM0=GM0.webcrypto||globalThis.crypto,WH=WM0.subtle,Wa=new TextEncoder;function Xm1(Q){return WM0.getRandomValues(Buffer.alloc(Q))}async function Ga(Q){try{return GM0.createHash("md5").update(Q,"utf-8").digest("hex")}catch(J){let X=typeof Q==="string"?Wa.encode(Q):Q,G=await WH.digest("MD5",X);return Array.from(new Uint8Array(G)).map((Y)=>Y.toString(16).padStart(2,"0")).join("")}}async function Ym1(Q,J,X){let G=await Ga(J+Q);return"md5"+await Ga(Buffer.concat([Buffer.from(G),X]))}async function Gm1(Q){return await WH.digest("SHA-256",Q)}async function Wm1(Q,J){return await WH.digest(Q,J)}async function $m1(Q,J){let X=await WH.importKey("raw",Q,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await WH.sign("HMAC",X,Wa.encode(J))}async function Km1(Q,J,X){let G=await WH.importKey("raw",Wa.encode(Q),"PBKDF2",!1,["deriveBits"]),Y={name:"PBKDF2",hash:"SHA-256",salt:J,iterations:X};return await WH.deriveBits(Y,G,256,["deriveBits"])}});var Ka=I((RV6,$a)=>{var Zm1=parseInt(process.versions&&process.versions.node&&process.versions.node.split(".")[0])<15;if(Zm1)$a.exports=YM0();else $a.exports=KM0()});var qM0=I((CV6,HM0)=>{function $H(Q,J){return Error("SASL channel binding: "+Q+" when parsing public certificate "+J.toString("base64"))}function Za(Q,J){let X=Q[J++];if(X<128)return{length:X,index:J};let G=X&127;if(G>4)throw $H("bad length",Q);X=0;for(let Y=0;Y<G;Y++)X=X<<8|Q[J++];return{length:X,index:J}}function ZM0(Q,J){if(Q[J++]!==6)throw $H("non-OID data",Q);let{length:X,index:G}=Za(Q,J);J=G;let Y=J+X,W=Q[J++],$=(W/40>>0)+"."+W%40;while(J<Y){let K=0;while(J<Y){let Z=Q[J++];if(K=K<<7|Z&127,Z<128)break}$+="."+K}return{oid:$,index:J}}function VL(Q,J){if(Q[J++]!==48)throw $H("non-sequence data",Q);return Za(Q,J)}function Hm1(Q,J){if(J===void 0)J=0;J=VL(Q,J).index;let{length:X,index:G}=VL(Q,J);J=G+X,J=VL(Q,J).index;let{oid:Y,index:W}=ZM0(Q,J);switch(Y){case"1.2.840.113549.1.1.4":return"MD5";case"1.2.840.113549.1.1.5":return"SHA-1";case"1.2.840.113549.1.1.11":return"SHA-256";case"1.2.840.113549.1.1.12":return"SHA-384";case"1.2.840.113549.1.1.13":return"SHA-512";case"1.2.840.113549.1.1.14":return"SHA-224";case"1.2.840.113549.1.1.15":return"SHA512-224";case"1.2.840.113549.1.1.16":return"SHA512-256";case"1.2.840.10045.4.1":return"SHA-1";case"1.2.840.10045.4.3.1":return"SHA-224";case"1.2.840.10045.4.3.2":return"SHA-256";case"1.2.840.10045.4.3.3":return"SHA-384";case"1.2.840.10045.4.3.4":return"SHA-512";case"1.2.840.113549.1.1.10":{if(J=W,J=VL(Q,J).index,Q[J++]!==160)throw $H("non-tag data",Q);J=Za(Q,J).index,J=VL(Q,J).index;let{oid:$}=ZM0(Q,J);switch($){case"1.2.840.113549.2.5":return"MD5";case"1.3.14.3.2.26":return"SHA-1";case"2.16.840.1.101.3.4.2.1":return"SHA-256";case"2.16.840.1.101.3.4.2.2":return"SHA-384";case"2.16.840.1.101.3.4.2.3":return"SHA-512"}throw $H("unknown hash OID "+$,Q)}case"1.3.101.110":case"1.3.101.112":return"SHA-512";case"1.3.101.111":case"1.3.101.113":throw $H("Ed448 certificate channel binding is not currently supported by Postgres")}throw $H("unknown OID "+Y,Q)}HM0.exports={signatureAlgorithmHashFromCertificate:Hm1}});var UM0=I((SV6,zM0)=>{var PK=Ka(),{signatureAlgorithmHashFromCertificate:qm1}=qM0();function Fm1(Q,J){let X=["SCRAM-SHA-256"];if(J)X.unshift("SCRAM-SHA-256-PLUS");let G=X.find(($)=>Q.includes($));if(!G)throw Error("SASL: Only mechanism(s) "+X.join(" and ")+" are supported");if(G==="SCRAM-SHA-256-PLUS"&&typeof J.getPeerCertificate!=="function")throw Error("SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate");let Y=PK.randomBytes(18).toString("base64");return{mechanism:G,clientNonce:Y,response:(G==="SCRAM-SHA-256-PLUS"?"p=tls-server-end-point":J?"y":"n")+",,n=*,r="+Y,message:"SASLInitialResponse"}}async function Vm1(Q,J,X,G){if(Q.message!=="SASLInitialResponse")throw Error("SASL: Last message was not SASLInitialResponse");if(typeof J!=="string")throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(J==="")throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string");if(typeof X!=="string")throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let Y=Nm1(X);if(!Y.nonce.startsWith(Q.clientNonce))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");else if(Y.nonce.length===Q.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short");let W="n=*,r="+Q.clientNonce,$="r="+Y.nonce+",s="+Y.salt+",i="+Y.iteration,K=G?"eSws":"biws";if(Q.mechanism==="SCRAM-SHA-256-PLUS"){let A=G.getPeerCertificate().raw,E=qm1(A);if(E==="MD5"||E==="SHA-1")E="SHA-256";let P=await PK.hashByName(E,A);K=Buffer.concat([Buffer.from("p=tls-server-end-point,,"),Buffer.from(P)]).toString("base64")}let Z="c="+K+",r="+Y.nonce,H=W+","+$+","+Z,q=Buffer.from(Y.salt,"base64"),F=await PK.deriveKey(J,q,Y.iteration),V=await PK.hmacSha256(F,"Client Key"),z=await PK.sha256(V),U=await PK.hmacSha256(z,H),B=Om1(Buffer.from(V),Buffer.from(U)).toString("base64"),D=await PK.hmacSha256(F,"Server Key"),w=await PK.hmacSha256(D,H);Q.message="SASLResponse",Q.serverSignature=Buffer.from(w).toString("base64"),Q.response=Z+",p="+B}function zm1(Q,J){if(Q.message!=="SASLResponse")throw Error("SASL: Last message was not SASLResponse");if(typeof J!=="string")throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:X}=Bm1(J);if(X!==Q.serverSignature)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function Um1(Q){if(typeof Q!=="string")throw TypeError("SASL: text must be a string");return Q.split("").map((J,X)=>Q.charCodeAt(X)).every((J)=>J>=33&&J<=43||J>=45&&J<=126)}function FM0(Q){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(Q)}function VM0(Q){if(typeof Q!=="string")throw TypeError("SASL: attribute pairs text must be a string");return new Map(Q.split(",").map((J)=>{if(!/^.=/.test(J))throw Error("SASL: Invalid attribute pair entry");let X=J[0],G=J.substring(2);return[X,G]}))}function Nm1(Q){let J=VM0(Q),X=J.get("r");if(!X)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");else if(!Um1(X))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters");let G=J.get("s");if(!G)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");else if(!FM0(G))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64");let Y=J.get("i");if(!Y)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");else if(!/^[1-9][0-9]*$/.test(Y))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count");let W=parseInt(Y,10);return{nonce:X,salt:G,iteration:W}}function Bm1(Q){let X=VM0(Q).get("v");if(!X)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");else if(!FM0(X))throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64");return{serverSignature:X}}function Om1(Q,J){if(!Buffer.isBuffer(Q))throw TypeError("first argument must be a Buffer");if(!Buffer.isBuffer(J))throw TypeError("second argument must be a Buffer");if(Q.length!==J.length)throw Error("Buffer lengths must match");if(Q.length===0)throw Error("Buffers cannot be empty");return Buffer.from(Q.map((X,G)=>Q[G]^J[G]))}zM0.exports={startSession:Fm1,continueSession:Vm1,finalizeSession:zm1}});var lR=I((vV6,NM0)=>{var Dm1=qL();function mR(Q){this._types=Q||Dm1,this.text={},this.binary={}}mR.prototype.getOverrides=function(Q){switch(Q){case"text":return this.text;case"binary":return this.binary;default:return{}}};mR.prototype.setTypeParser=function(Q,J,X){if(typeof J==="function")X=J,J="text";this.getOverrides(J)[Q]=X};mR.prototype.getTypeParser=function(Q,J){return J=J||"text",this.getOverrides(J)[Q]||this._types.getTypeParser(Q,J)};NM0.exports=mR});var DM0=I((kV6,OM0)=>{function Yz(Q,J={}){if(Q.charAt(0)==="/"){let Z=Q.split(" ");return{host:Z[0],database:Z[1]}}let X={},G,Y=!1;if(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(Q))Q=encodeURI(Q).replace(/%25(\d\d)/g,"%$1");try{try{G=new URL(Q,"postgres://base")}catch(Z){G=new URL(Q.replace("@/","@___DUMMY___/"),"postgres://base"),Y=!0}}catch(Z){Z.input&&(Z.input="*****REDACTED*****")}for(let Z of G.searchParams.entries())X[Z[0]]=Z[1];if(X.user=X.user||decodeURIComponent(G.username),X.password=X.password||decodeURIComponent(G.password),G.protocol=="socket:")return X.host=decodeURI(G.pathname),X.database=G.searchParams.get("db"),X.client_encoding=G.searchParams.get("encoding"),X;let W=Y?"":G.hostname;if(!X.host)X.host=decodeURIComponent(W);else if(W&&/^%2f/i.test(W))G.pathname=W+G.pathname;if(!X.port)X.port=G.port;let $=G.pathname.slice(1)||null;if(X.database=$?decodeURI($):null,X.ssl==="true"||X.ssl==="1")X.ssl=!0;if(X.ssl==="0")X.ssl=!1;if(X.sslcert||X.sslkey||X.sslrootcert||X.sslmode)X.ssl={};let K=X.sslcert||X.sslkey||X.sslrootcert?E0("fs"):null;if(X.sslcert)X.ssl.cert=K.readFileSync(X.sslcert).toString();if(X.sslkey)X.ssl.key=K.readFileSync(X.sslkey).toString();if(X.sslrootcert)X.ssl.ca=K.readFileSync(X.sslrootcert).toString();if(J.useLibpqCompat&&X.uselibpqcompat)throw Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");if(X.uselibpqcompat==="true"||J.useLibpqCompat)switch(X.sslmode){case"disable":{X.ssl=!1;break}case"prefer":{X.ssl.rejectUnauthorized=!1;break}case"require":{if(X.sslrootcert)X.ssl.checkServerIdentity=function(){};else X.ssl.rejectUnauthorized=!1;break}case"verify-ca":{if(!X.ssl.ca)throw Error("SECURITY WARNING: Using sslmode=verify-ca requires specifying a CA with sslrootcert. If a public CA is used, verify-ca allows connections to a server that somebody else may have registered with the CA, making you vulnerable to Man-in-the-Middle attacks. Either specify a custom CA certificate with sslrootcert parameter or use sslmode=verify-full for proper security.");X.ssl.checkServerIdentity=function(){};break}case"verify-full":break}else switch(X.sslmode){case"disable":{X.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":{X.ssl.rejectUnauthorized=!1;break}}return X}function Lm1(Q){return Object.entries(Q).reduce((X,[G,Y])=>{if(Y!==void 0&&Y!==null)X[G]=Y;return X},{})}function BM0(Q){return Object.entries(Q).reduce((X,[G,Y])=>{if(G==="ssl"){let W=Y;if(typeof W==="boolean")X[G]=W;if(typeof W==="object")X[G]=Lm1(W)}else if(Y!==void 0&&Y!==null)if(G==="port"){if(Y!==""){let W=parseInt(Y,10);if(isNaN(W))throw Error(`Invalid ${G}: ${Y}`);X[G]=W}}else X[G]=Y;return X},{})}function wm1(Q){return BM0(Yz(Q))}OM0.exports=Yz;Yz.parse=Yz;Yz.toClientConfig=BM0;Yz.parseIntoClientConfig=wm1});var Ha=I((_V6,MM0)=>{var Pm1=E0("dns"),wM0=FL(),LM0=DM0().parse,RQ=function(Q,J,X){if(X===void 0)X=process.env["PG"+Q.toUpperCase()];else if(X===!1);else X=process.env[X];return J[Q]||X||wM0[Q]},Mm1=function(){switch(process.env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify":return{rejectUnauthorized:!1}}return wM0.ssl},Gz=function(Q){return"'"+(""+Q).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},gX=function(Q,J,X){let G=J[X];if(G!==void 0&&G!==null)Q.push(X+"="+Gz(G))};class PM0{constructor(Q){if(Q=typeof Q==="string"?LM0(Q):Q||{},Q.connectionString)Q=Object.assign({},Q,LM0(Q.connectionString));if(this.user=RQ("user",Q),this.database=RQ("database",Q),this.database===void 0)this.database=this.user;if(this.port=parseInt(RQ("port",Q),10),this.host=RQ("host",Q),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:RQ("password",Q)}),this.binary=RQ("binary",Q),this.options=RQ("options",Q),this.ssl=typeof Q.ssl>"u"?Mm1():Q.ssl,typeof this.ssl==="string"){if(this.ssl==="true")this.ssl=!0}if(this.ssl==="no-verify")this.ssl={rejectUnauthorized:!1};if(this.ssl&&this.ssl.key)Object.defineProperty(this.ssl,"key",{enumerable:!1});if(this.client_encoding=RQ("client_encoding",Q),this.replication=RQ("replication",Q),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=RQ("application_name",Q,"PGAPPNAME"),this.fallback_application_name=RQ("fallback_application_name",Q,!1),this.statement_timeout=RQ("statement_timeout",Q,!1),this.lock_timeout=RQ("lock_timeout",Q,!1),this.idle_in_transaction_session_timeout=RQ("idle_in_transaction_session_timeout",Q,!1),this.query_timeout=RQ("query_timeout",Q,!1),Q.connectionTimeoutMillis===void 0)this.connect_timeout=process.env.PGCONNECT_TIMEOUT||0;else this.connect_timeout=Math.floor(Q.connectionTimeoutMillis/1000);if(Q.keepAlive===!1)this.keepalives=0;else if(Q.keepAlive===!0)this.keepalives=1;if(typeof Q.keepAliveInitialDelayMillis==="number")this.keepalives_idle=Math.floor(Q.keepAliveInitialDelayMillis/1000)}getLibpqConnectionString(Q){let J=[];gX(J,this,"user"),gX(J,this,"password"),gX(J,this,"port"),gX(J,this,"application_name"),gX(J,this,"fallback_application_name"),gX(J,this,"connect_timeout"),gX(J,this,"options");let X=typeof this.ssl==="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(gX(J,X,"sslmode"),gX(J,X,"sslca"),gX(J,X,"sslkey"),gX(J,X,"sslcert"),gX(J,X,"sslrootcert"),this.database)J.push("dbname="+Gz(this.database));if(this.replication)J.push("replication="+Gz(this.replication));if(this.host)J.push("host="+Gz(this.host));if(this.isDomainSocket)return Q(null,J.join(" "));if(this.client_encoding)J.push("client_encoding="+Gz(this.client_encoding));Pm1.lookup(this.host,function(G,Y){if(G)return Q(G,null);return J.push("hostaddr="+Gz(Y)),Q(null,J.join(" "))})}}MM0.exports=PM0});var qa=I((yV6,EM0)=>{var Am1=qL(),AM0=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/;class TM0{constructor(Q,J){if(this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=J,this.RowCtor=null,this.rowAsArray=Q==="array",this.rowAsArray)this.parseRow=this._parseRowAsArray;this._prebuiltEmptyResultObject=null}addCommandComplete(Q){let J;if(Q.text)J=AM0.exec(Q.text);else J=AM0.exec(Q.command);if(J){if(this.command=J[1],J[3])this.oid=parseInt(J[2],10),this.rowCount=parseInt(J[3],10);else if(J[2])this.rowCount=parseInt(J[2],10)}}_parseRowAsArray(Q){let J=Array(Q.length);for(let X=0,G=Q.length;X<G;X++){let Y=Q[X];if(Y!==null)J[X]=this._parsers[X](Y);else J[X]=null}return J}parseRow(Q){let J={...this._prebuiltEmptyResultObject};for(let X=0,G=Q.length;X<G;X++){let Y=Q[X],W=this.fields[X].name;if(Y!==null){let $=this.fields[X].format==="binary"?Buffer.from(Y):Y;J[W]=this._parsers[X]($)}else J[W]=null}return J}addRow(Q){this.rows.push(Q)}addFields(Q){if(this.fields=Q,this.fields.length)this._parsers=Array(Q.length);let J={};for(let X=0;X<Q.length;X++){let G=Q[X];if(J[G.name]=null,this._types)this._parsers[X]=this._types.getTypeParser(G.dataTypeID,G.format||"text");else this._parsers[X]=Am1.getTypeParser(G.dataTypeID,G.format||"text")}this._prebuiltEmptyResultObject={...J}}}EM0.exports=TM0});var SM0=I((hV6,CM0)=>{var{EventEmitter:Tm1}=E0("events"),jM0=qa(),IM0=Jz();class RM0 extends Tm1{constructor(Q,J,X){super();if(Q=IM0.normalizeQueryConfig(Q,J,X),this.text=Q.text,this.values=Q.values,this.rows=Q.rows,this.types=Q.types,this.name=Q.name,this.queryMode=Q.queryMode,this.binary=Q.binary,this.portal=Q.portal||"",this.callback=Q.callback,this._rowMode=Q.rowMode,process.domain&&Q.callback)this.callback=process.domain.bind(Q.callback);this._result=new jM0(this._rowMode,this.types),this._results=this._result,this._canceledDueToError=!1}requiresPreparation(){if(this.queryMode==="extended")return!0;if(this.name)return!0;if(this.rows)return!0;if(!this.text)return!1;if(!this.values)return!1;return this.values.length>0}_checkForMultirow(){if(this._result.command){if(!Array.isArray(this._results))this._results=[this._result];this._result=new jM0(this._rowMode,this._result._types),this._results.push(this._result)}}handleRowDescription(Q){this._checkForMultirow(),this._result.addFields(Q.fields),this._accumulateRows=this.callback||!this.listeners("row").length}handleDataRow(Q){let J;if(this._canceledDueToError)return;try{J=this._result.parseRow(Q.fields)}catch(X){this._canceledDueToError=X;return}if(this.emit("row",J,this._result),this._accumulateRows)this._result.addRow(J)}handleCommandComplete(Q,J){if(this._checkForMultirow(),this._result.addCommandComplete(Q),this.rows)J.sync()}handleEmptyQuery(Q){if(this.rows)Q.sync()}handleError(Q,J){if(this._canceledDueToError)Q=this._canceledDueToError,this._canceledDueToError=!1;if(this.callback)return this.callback(Q);this.emit("error",Q)}handleReadyForQuery(Q){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,Q);if(this.callback)try{this.callback(null,this._results)}catch(J){process.nextTick(()=>{throw J})}this.emit("end",this._results)}submit(Q){if(typeof this.text!=="string"&&typeof this.name!=="string")return Error("A query must have either text or a name. Supplying neither is unsupported.");let J=Q.parsedStatements[this.name];if(this.text&&J&&this.text!==J)return Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);if(this.values&&!Array.isArray(this.values))return Error("Query values must be an array");if(this.requiresPreparation()){Q.stream.cork&&Q.stream.cork();try{this.prepare(Q)}finally{Q.stream.uncork&&Q.stream.uncork()}}else Q.query(this.text);return null}hasBeenParsed(Q){return this.name&&Q.parsedStatements[this.name]}handlePortalSuspended(Q){this._getRows(Q,this.rows)}_getRows(Q,J){if(Q.execute({portal:this.portal,rows:J}),!J)Q.sync();else Q.flush()}prepare(Q){if(!this.hasBeenParsed(Q))Q.parse({text:this.text,name:this.name,types:this.types});try{Q.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:IM0.prepareValue})}catch(J){this.handleError(J,Q);return}Q.describe({type:"P",name:this.portal||""}),this._getRows(Q,this.rows)}handleCopyInResponse(Q){Q.sendCopyFail("No source stream defined")}handleCopyData(Q,J){}}CM0.exports=RM0});var Fa=I((cM0)=>{Object.defineProperty(cM0,"__esModule",{value:!0});cM0.NoticeMessage=cM0.DataRowMessage=cM0.CommandCompleteMessage=cM0.ReadyForQueryMessage=cM0.NotificationResponseMessage=cM0.BackendKeyDataMessage=cM0.AuthenticationMD5Password=cM0.ParameterStatusMessage=cM0.ParameterDescriptionMessage=cM0.RowDescriptionMessage=cM0.Field=cM0.CopyResponse=cM0.CopyDataMessage=cM0.DatabaseError=cM0.copyDone=cM0.emptyQuery=cM0.replicationStart=cM0.portalSuspended=cM0.noData=cM0.closeComplete=cM0.bindComplete=cM0.parseComplete=void 0;cM0.parseComplete={name:"parseComplete",length:5};cM0.bindComplete={name:"bindComplete",length:5};cM0.closeComplete={name:"closeComplete",length:5};cM0.noData={name:"noData",length:5};cM0.portalSuspended={name:"portalSuspended",length:5};cM0.replicationStart={name:"replicationStart",length:4};cM0.emptyQuery={name:"emptyQuery",length:4};cM0.copyDone={name:"copyDone",length:4};class vM0 extends Error{constructor(Q,J,X){super(Q);this.length=J,this.name=X}}cM0.DatabaseError=vM0;class kM0{constructor(Q,J){this.length=Q,this.chunk=J,this.name="copyData"}}cM0.CopyDataMessage=kM0;class _M0{constructor(Q,J,X,G){this.length=Q,this.name=J,this.binary=X,this.columnTypes=Array(G)}}cM0.CopyResponse=_M0;class yM0{constructor(Q,J,X,G,Y,W,$){this.name=Q,this.tableID=J,this.columnID=X,this.dataTypeID=G,this.dataTypeSize=Y,this.dataTypeModifier=W,this.format=$}}cM0.Field=yM0;class hM0{constructor(Q,J){this.length=Q,this.fieldCount=J,this.name="rowDescription",this.fields=Array(this.fieldCount)}}cM0.RowDescriptionMessage=hM0;class fM0{constructor(Q,J){this.length=Q,this.parameterCount=J,this.name="parameterDescription",this.dataTypeIDs=Array(this.parameterCount)}}cM0.ParameterDescriptionMessage=fM0;class bM0{constructor(Q,J,X){this.length=Q,this.parameterName=J,this.parameterValue=X,this.name="parameterStatus"}}cM0.ParameterStatusMessage=bM0;class xM0{constructor(Q,J){this.length=Q,this.salt=J,this.name="authenticationMD5Password"}}cM0.AuthenticationMD5Password=xM0;class gM0{constructor(Q,J,X){this.length=Q,this.processID=J,this.secretKey=X,this.name="backendKeyData"}}cM0.BackendKeyDataMessage=gM0;class uM0{constructor(Q,J,X,G){this.length=Q,this.processId=J,this.channel=X,this.payload=G,this.name="notification"}}cM0.NotificationResponseMessage=uM0;class mM0{constructor(Q,J){this.length=Q,this.status=J,this.name="readyForQuery"}}cM0.ReadyForQueryMessage=mM0;class lM0{constructor(Q,J){this.length=Q,this.text=J,this.name="commandComplete"}}cM0.CommandCompleteMessage=lM0;class dM0{constructor(Q,J){this.length=Q,this.fields=J,this.name="dataRow",this.fieldCount=J.length}}cM0.DataRowMessage=dM0;class pM0{constructor(Q,J){this.length=Q,this.message=J,this.name="notice"}}cM0.NoticeMessage=pM0});var oM0=I((rM0)=>{Object.defineProperty(rM0,"__esModule",{value:!0});rM0.Writer=void 0;class iM0{constructor(Q=256){this.size=Q,this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(Q)}ensure(Q){if(this.buffer.length-this.offset<Q){let X=this.buffer,G=X.length+(X.length>>1)+Q;this.buffer=Buffer.allocUnsafe(G),X.copy(this.buffer)}}addInt32(Q){return this.ensure(4),this.buffer[this.offset++]=Q>>>24&255,this.buffer[this.offset++]=Q>>>16&255,this.buffer[this.offset++]=Q>>>8&255,this.buffer[this.offset++]=Q>>>0&255,this}addInt16(Q){return this.ensure(2),this.buffer[this.offset++]=Q>>>8&255,this.buffer[this.offset++]=Q>>>0&255,this}addCString(Q){if(!Q)this.ensure(1);else{let J=Buffer.byteLength(Q);this.ensure(J+1),this.buffer.write(Q,this.offset,"utf-8"),this.offset+=J}return this.buffer[this.offset++]=0,this}addString(Q=""){let J=Buffer.byteLength(Q);return this.ensure(J),this.buffer.write(Q,this.offset),this.offset+=J,this}add(Q){return this.ensure(Q.length),Q.copy(this.buffer,this.offset),this.offset+=Q.length,this}join(Q){if(Q){this.buffer[this.headerPosition]=Q;let J=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(J,this.headerPosition+1)}return this.buffer.slice(Q?0:5,this.offset)}flush(Q){let J=this.join(Q);return this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(this.size),J}}rM0.Writer=iM0});var Q20=I((tM0)=>{Object.defineProperty(tM0,"__esModule",{value:!0});tM0.serialize=void 0;var Va=oM0(),h8=new Va.Writer,nm1=(Q)=>{h8.addInt16(3).addInt16(0);for(let G of Object.keys(Q))h8.addCString(G).addCString(Q[G]);h8.addCString("client_encoding").addCString("UTF8");let J=h8.addCString("").flush(),X=J.length+4;return new Va.Writer().addInt32(X).add(J).flush()},im1=()=>{let Q=Buffer.allocUnsafe(8);return Q.writeInt32BE(8,0),Q.writeInt32BE(80877103,4),Q},rm1=(Q)=>{return h8.addCString(Q).flush(112)},am1=function(Q,J){return h8.addCString(Q).addInt32(Buffer.byteLength(J)).addString(J),h8.flush(112)},om1=function(Q){return h8.addString(Q).flush(112)},sm1=(Q)=>{return h8.addCString(Q).flush(81)},sM0=[],tm1=(Q)=>{let J=Q.name||"";if(J.length>63)console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",J,J.length),console.error("This can cause conflicts and silent errors executing queries");let X=Q.types||sM0,G=X.length,Y=h8.addCString(J).addCString(Q.text).addInt16(G);for(let W=0;W<G;W++)Y.addInt32(X[W]);return h8.flush(80)},Wz=new Va.Writer,em1=function(Q,J){for(let X=0;X<Q.length;X++){let G=J?J(Q[X],X):Q[X];if(G==null)h8.addInt16(0),Wz.addInt32(-1);else if(G instanceof Buffer)h8.addInt16(1),Wz.addInt32(G.length),Wz.add(G);else h8.addInt16(0),Wz.addInt32(Buffer.byteLength(G)),Wz.addString(G)}},Ql1=(Q={})=>{let J=Q.portal||"",X=Q.statement||"",G=Q.binary||!1,Y=Q.values||sM0,W=Y.length;return h8.addCString(J).addCString(X),h8.addInt16(W),em1(Y,Q.valueMapper),h8.addInt16(W),h8.add(Wz.flush()),h8.addInt16(1),h8.addInt16(G?1:0),h8.flush(66)},Jl1=Buffer.from([69,0,0,0,9,0,0,0,0,0]),Xl1=(Q)=>{if(!Q||!Q.portal&&!Q.rows)return Jl1;let J=Q.portal||"",X=Q.rows||0,G=Buffer.byteLength(J),Y=4+G+1+4,W=Buffer.allocUnsafe(1+Y);return W[0]=69,W.writeInt32BE(Y,1),W.write(J,5,"utf-8"),W[G+5]=0,W.writeUInt32BE(X,W.length-4),W},Yl1=(Q,J)=>{let X=Buffer.allocUnsafe(16);return X.writeInt32BE(16,0),X.writeInt16BE(1234,4),X.writeInt16BE(5678,6),X.writeInt32BE(Q,8),X.writeInt32BE(J,12),X},za=(Q,J)=>{let G=4+Buffer.byteLength(J)+1,Y=Buffer.allocUnsafe(1+G);return Y[0]=Q,Y.writeInt32BE(G,1),Y.write(J,5,"utf-8"),Y[G]=0,Y},Gl1=h8.addCString("P").flush(68),Wl1=h8.addCString("S").flush(68),$l1=(Q)=>{return Q.name?za(68,`${Q.type}${Q.name||""}`):Q.type==="P"?Gl1:Wl1},Kl1=(Q)=>{let J=`${Q.type}${Q.name||""}`;return za(67,J)},Zl1=(Q)=>{return h8.add(Q).flush(100)},Hl1=(Q)=>{return za(102,Q)},dR=(Q)=>Buffer.from([Q,0,0,0,4]),ql1=dR(72),Fl1=dR(83),Vl1=dR(88),zl1=dR(99),Ul1={startup:nm1,password:rm1,requestSsl:im1,sendSASLInitialResponseMessage:am1,sendSCRAMClientFinalMessage:om1,query:sm1,parse:tm1,bind:Ql1,execute:Xl1,describe:$l1,close:Kl1,flush:()=>ql1,sync:()=>Fl1,end:()=>Vl1,copyData:Zl1,copyDone:()=>zl1,copyFail:Hl1,cancel:Yl1};tM0.serialize=Ul1});var G20=I((X20)=>{Object.defineProperty(X20,"__esModule",{value:!0});X20.BufferReader=void 0;var Nl1=Buffer.allocUnsafe(0);class J20{constructor(Q=0){this.offset=Q,this.buffer=Nl1,this.encoding="utf-8"}setBuffer(Q,J){this.offset=Q,this.buffer=J}int16(){let Q=this.buffer.readInt16BE(this.offset);return this.offset+=2,Q}byte(){let Q=this.buffer[this.offset];return this.offset++,Q}int32(){let Q=this.buffer.readInt32BE(this.offset);return this.offset+=4,Q}uint32(){let Q=this.buffer.readUInt32BE(this.offset);return this.offset+=4,Q}string(Q){let J=this.buffer.toString(this.encoding,this.offset,this.offset+Q);return this.offset+=Q,J}cstring(){let Q=this.offset,J=Q;while(this.buffer[J++]!==0);return this.offset=J,this.buffer.toString(this.encoding,Q,J-1)}bytes(Q){let J=this.buffer.slice(this.offset,this.offset+Q);return this.offset+=Q,J}}X20.BufferReader=J20});var q20=I((Z20)=>{Object.defineProperty(Z20,"__esModule",{value:!0});Z20.Parser=void 0;var p8=Fa(),Bl1=G20(),Ua=1,Ol1=4,W20=Ua+Ol1,$20=Buffer.allocUnsafe(0);class K20{constructor(Q){if(this.buffer=$20,this.bufferLength=0,this.bufferOffset=0,this.reader=new Bl1.BufferReader,(Q===null||Q===void 0?void 0:Q.mode)==="binary")throw Error("Binary mode not supported yet");this.mode=(Q===null||Q===void 0?void 0:Q.mode)||"text"}parse(Q,J){this.mergeBuffer(Q);let X=this.bufferOffset+this.bufferLength,G=this.bufferOffset;while(G+W20<=X){let Y=this.buffer[G],W=this.buffer.readUInt32BE(G+Ua),$=Ua+W;if($+G<=X){let K=this.handlePacket(G+W20,Y,W,this.buffer);J(K),G+=$}else break}if(G===X)this.buffer=$20,this.bufferLength=0,this.bufferOffset=0;else this.bufferLength=X-G,this.bufferOffset=G}mergeBuffer(Q){if(this.bufferLength>0){let J=this.bufferLength+Q.byteLength;if(J+this.bufferOffset>this.buffer.byteLength){let G;if(J<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)G=this.buffer;else{let Y=this.buffer.byteLength*2;while(J>=Y)Y*=2;G=Buffer.allocUnsafe(Y)}this.buffer.copy(G,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=G,this.bufferOffset=0}Q.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=J}else this.buffer=Q,this.bufferOffset=0,this.bufferLength=Q.byteLength}handlePacket(Q,J,X,G){switch(J){case 50:return p8.bindComplete;case 49:return p8.parseComplete;case 51:return p8.closeComplete;case 110:return p8.noData;case 115:return p8.portalSuspended;case 99:return p8.copyDone;case 87:return p8.replicationStart;case 73:return p8.emptyQuery;case 68:return this.parseDataRowMessage(Q,X,G);case 67:return this.parseCommandCompleteMessage(Q,X,G);case 90:return this.parseReadyForQueryMessage(Q,X,G);case 65:return this.parseNotificationMessage(Q,X,G);case 82:return this.parseAuthenticationResponse(Q,X,G);case 83:return this.parseParameterStatusMessage(Q,X,G);case 75:return this.parseBackendKeyData(Q,X,G);case 69:return this.parseErrorMessage(Q,X,G,"error");case 78:return this.parseErrorMessage(Q,X,G,"notice");case 84:return this.parseRowDescriptionMessage(Q,X,G);case 116:return this.parseParameterDescriptionMessage(Q,X,G);case 71:return this.parseCopyInMessage(Q,X,G);case 72:return this.parseCopyOutMessage(Q,X,G);case 100:return this.parseCopyData(Q,X,G);default:return new p8.DatabaseError("received invalid response: "+J.toString(16),X,"error")}}parseReadyForQueryMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.string(1);return new p8.ReadyForQueryMessage(J,G)}parseCommandCompleteMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.cstring();return new p8.CommandCompleteMessage(J,G)}parseCopyData(Q,J,X){let G=X.slice(Q,Q+(J-4));return new p8.CopyDataMessage(J,G)}parseCopyInMessage(Q,J,X){return this.parseCopyMessage(Q,J,X,"copyInResponse")}parseCopyOutMessage(Q,J,X){return this.parseCopyMessage(Q,J,X,"copyOutResponse")}parseCopyMessage(Q,J,X,G){this.reader.setBuffer(Q,X);let Y=this.reader.byte()!==0,W=this.reader.int16(),$=new p8.CopyResponse(J,G,Y,W);for(let K=0;K<W;K++)$.columnTypes[K]=this.reader.int16();return $}parseNotificationMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int32(),Y=this.reader.cstring(),W=this.reader.cstring();return new p8.NotificationResponseMessage(J,G,Y,W)}parseRowDescriptionMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int16(),Y=new p8.RowDescriptionMessage(J,G);for(let W=0;W<G;W++)Y.fields[W]=this.parseField();return Y}parseField(){let Q=this.reader.cstring(),J=this.reader.uint32(),X=this.reader.int16(),G=this.reader.uint32(),Y=this.reader.int16(),W=this.reader.int32(),$=this.reader.int16()===0?"text":"binary";return new p8.Field(Q,J,X,G,Y,W,$)}parseParameterDescriptionMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int16(),Y=new p8.ParameterDescriptionMessage(J,G);for(let W=0;W<G;W++)Y.dataTypeIDs[W]=this.reader.int32();return Y}parseDataRowMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int16(),Y=Array(G);for(let W=0;W<G;W++){let $=this.reader.int32();Y[W]=$===-1?null:this.reader.string($)}return new p8.DataRowMessage(J,Y)}parseParameterStatusMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.cstring(),Y=this.reader.cstring();return new p8.ParameterStatusMessage(J,G,Y)}parseBackendKeyData(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int32(),Y=this.reader.int32();return new p8.BackendKeyDataMessage(J,G,Y)}parseAuthenticationResponse(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int32(),Y={name:"authenticationOk",length:J};switch(G){case 0:break;case 3:if(Y.length===8)Y.name="authenticationCleartextPassword";break;case 5:if(Y.length===12){Y.name="authenticationMD5Password";let W=this.reader.bytes(4);return new p8.AuthenticationMD5Password(J,W)}break;case 10:{Y.name="authenticationSASL",Y.mechanisms=[];let W;do if(W=this.reader.cstring(),W)Y.mechanisms.push(W);while(W)}break;case 11:Y.name="authenticationSASLContinue",Y.data=this.reader.string(J-8);break;case 12:Y.name="authenticationSASLFinal",Y.data=this.reader.string(J-8);break;default:throw Error("Unknown authenticationOk message type "+G)}return Y}parseErrorMessage(Q,J,X,G){this.reader.setBuffer(Q,X);let Y={},W=this.reader.string(1);while(W!=="\x00")Y[W]=this.reader.cstring(),W=this.reader.string(1);let $=Y.M,K=G==="notice"?new p8.NoticeMessage(J,$):new p8.DatabaseError($,J,G);return K.severity=Y.S,K.code=Y.C,K.detail=Y.D,K.hint=Y.H,K.position=Y.P,K.internalPosition=Y.p,K.internalQuery=Y.q,K.where=Y.W,K.schema=Y.s,K.table=Y.t,K.column=Y.c,K.dataType=Y.d,K.constraint=Y.n,K.file=Y.F,K.line=Y.L,K.routine=Y.R,K}}Z20.Parser=K20});var Na=I((pR)=>{Object.defineProperty(pR,"__esModule",{value:!0});pR.DatabaseError=pR.serialize=pR.parse=void 0;var Dl1=Fa();Object.defineProperty(pR,"DatabaseError",{enumerable:!0,get:function(){return Dl1.DatabaseError}});var Ll1=Q20();Object.defineProperty(pR,"serialize",{enumerable:!0,get:function(){return Ll1.serialize}});var wl1=q20();function Pl1(Q,J){let X=new wl1.Parser;return Q.on("data",(G)=>X.parse(G,J)),new Promise((G)=>Q.on("end",()=>G()))}pR.parse=Pl1});var V20=I((F20)=>{Object.defineProperty(F20,"__esModule",{value:!0});F20.default={}});var U20=I((pV6,z20)=>{var{getStream:El1,getSecureStream:jl1}=Sl1();z20.exports={getStream:El1,getSecureStream:jl1};function Il1(){function Q(X){return new(E0("net")).Socket}function J(X){return E0("tls").connect(X)}return{getStream:Q,getSecureStream:J}}function Rl1(){function Q(X){let{CloudflareSocket:G}=V20();return new G(X)}function J(X){return X.socket.startTls(X),X.socket}return{getStream:Q,getSecureStream:J}}function Cl1(){if(typeof navigator==="object"&&navigator!==null&&typeof navigator.userAgent==="string")return navigator.userAgent==="Cloudflare-Workers";if(typeof Response==="function"){let Q=new Response(null,{cf:{thing:!0}});if(typeof Q.cf==="object"&&Q.cf!==null&&Q.cf.thing)return!0}return!1}function Sl1(){if(Cl1())return Rl1();return Il1()}});var Ba=I((cV6,B20)=>{var vl1=E0("events").EventEmitter,{parse:kl1,serialize:X5}=Na(),{getStream:_l1,getSecureStream:yl1}=U20(),hl1=X5.flush(),fl1=X5.sync(),bl1=X5.end();class N20 extends vl1{constructor(Q){super();if(Q=Q||{},this.stream=Q.stream||_l1(Q.ssl),typeof this.stream==="function")this.stream=this.stream(Q);this._keepAlive=Q.keepAlive,this._keepAliveInitialDelayMillis=Q.keepAliveInitialDelayMillis,this.lastBuffer=!1,this.parsedStatements={},this.ssl=Q.ssl||!1,this._ending=!1,this._emitMessage=!1;let J=this;this.on("newListener",function(X){if(X==="message")J._emitMessage=!0})}connect(Q,J){let X=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(Q,J),this.stream.once("connect",function(){if(X._keepAlive)X.stream.setKeepAlive(!0,X._keepAliveInitialDelayMillis);X.emit("connect")});let G=function(Y){if(X._ending&&(Y.code==="ECONNRESET"||Y.code==="EPIPE"))return;X.emit("error",Y)};if(this.stream.on("error",G),this.stream.on("close",function(){X.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(Y){switch(Y.toString("utf8")){case"S":break;case"N":return X.stream.end(),X.emit("error",Error("The server does not support SSL connections"));default:return X.stream.end(),X.emit("error",Error("There was an error establishing an SSL connection"))}let $={socket:X.stream};if(X.ssl!==!0){if(Object.assign($,X.ssl),"key"in X.ssl)$.key=X.ssl.key}let K=E0("net");if(K.isIP&&K.isIP(J)===0)$.servername=J;try{X.stream=yl1($)}catch(Z){return X.emit("error",Z)}X.attachListeners(X.stream),X.stream.on("error",G),X.emit("sslconnect")})}attachListeners(Q){kl1(Q,(J)=>{let X=J.name==="error"?"errorMessage":J.name;if(this._emitMessage)this.emit("message",J);this.emit(X,J)})}requestSsl(){this.stream.write(X5.requestSsl())}startup(Q){this.stream.write(X5.startup(Q))}cancel(Q,J){this._send(X5.cancel(Q,J))}password(Q){this._send(X5.password(Q))}sendSASLInitialResponseMessage(Q,J){this._send(X5.sendSASLInitialResponseMessage(Q,J))}sendSCRAMClientFinalMessage(Q){this._send(X5.sendSCRAMClientFinalMessage(Q))}_send(Q){if(!this.stream.writable)return!1;return this.stream.write(Q)}query(Q){this._send(X5.query(Q))}parse(Q){this._send(X5.parse(Q))}bind(Q){this._send(X5.bind(Q))}execute(Q){this._send(X5.execute(Q))}flush(){if(this.stream.writable)this.stream.write(hl1)}sync(){this._ending=!0,this._send(fl1)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this.stream.end();return}return this.stream.write(bl1,()=>{this.stream.end()})}close(Q){this._send(X5.close(Q))}describe(Q){this._send(X5.describe(Q))}sendCopyFromChunk(Q){this._send(X5.copyData(Q))}endCopyFrom(){this._send(X5.copyDone())}sendCopyFail(Q){this._send(X5.copyFail(Q))}}B20.exports=N20});var w20=I((nV6,L20)=>{var{Transform:xl1}=E0("stream"),{StringDecoder:gl1}=E0("string_decoder"),MK=Symbol("last"),cR=Symbol("decoder");function ul1(Q,J,X){let G;if(this.overflow){if(G=this[cR].write(Q).split(this.matcher),G.length===1)return X();G.shift(),this.overflow=!1}else this[MK]+=this[cR].write(Q),G=this[MK].split(this.matcher);this[MK]=G.pop();for(let Y=0;Y<G.length;Y++)try{D20(this,this.mapper(G[Y]))}catch(W){return X(W)}if(this.overflow=this[MK].length>this.maxLength,this.overflow&&!this.skipOverflow){X(Error("maximum buffer reached"));return}X()}function ml1(Q){if(this[MK]+=this[cR].end(),this[MK])try{D20(this,this.mapper(this[MK]))}catch(J){return Q(J)}Q()}function D20(Q,J){if(J!==void 0)Q.push(J)}function O20(Q){return Q}function ll1(Q,J,X){switch(Q=Q||/\r?\n/,J=J||O20,X=X||{},arguments.length){case 1:if(typeof Q==="function")J=Q,Q=/\r?\n/;else if(typeof Q==="object"&&!(Q instanceof RegExp)&&!Q[Symbol.split])X=Q,Q=/\r?\n/;break;case 2:if(typeof Q==="function")X=J,J=Q,Q=/\r?\n/;else if(typeof J==="object")X=J,J=O20}X=Object.assign({},X),X.autoDestroy=!0,X.transform=ul1,X.flush=ml1,X.readableObjectMode=!0;let G=new xl1(X);return G[MK]="",G[cR]=new gl1("utf8"),G.matcher=Q,G.mapper=J,G.maxLength=X.maxLength,G.skipOverflow=X.skipOverflow||!1,G.overflow=!1,G._destroy=function(Y,W){this._writableState.errorEmitted=!1,W(Y)},G}L20.exports=ll1});var A20=I((Jd1,DW)=>{var P20=E0("path"),dl1=E0("stream").Stream,pl1=w20(),M20=E0("util"),cl1=5432,nR=process.platform==="win32",zL=process.stderr,nl1=56,il1=7,rl1=61440,al1=32768;function ol1(Q){return(Q&rl1)==al1}var $z=["host","port","database","user","password"],Oa=$z.length,sl1=$z[Oa-1];function Da(){var Q=zL instanceof dl1&&zL.writable===!0;if(Q){var J=Array.prototype.slice.call(arguments).concat(`
941
+ </html>`},dr=(Q)=>{let J=Q?.path??"/reference";return{id:"open-api",endpoints:{generateOpenAPISchema:l0("/open-api/generate-schema",{method:"GET"},async(X)=>{let G=await KP0(X.context,X.context.options);return X.json(G)}),openAPIReference:l0(J,{method:"GET",metadata:{isAction:!1}},async(X)=>{if(Q?.disableDefaultReference)throw new n("NOT_FOUND");let G=await KP0(X.context,X.context.options);return new Response(hg1(G,Q?.theme,Q?.nonce),{headers:{"Content-Type":"text/html"}})})}}};var ZP0=_(()=>{ZX();t8();F4();S8();vg1=new Set(["string","number","boolean","array","object"])});var uH6,mH6,lH6,dH6,qP0,bg1,pH6,cH6,nH6,iH6,rH6,aH6,HP0,oH6;var FP0=_(()=>{cG();p5();m8();t8();w8();L9();aD();AR();Ar();V7();Q9();jQ();l9();F4();S8();uH6=s4(async()=>{return{}}),mH6=s4({use:[F8]},async(Q)=>{return{session:Q.context.session}}),lH6=j6({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_SLUG_ALREADY_TAKEN:"Organization slug already taken",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:"You cannot leave the organization without an owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:"Email verification required before accepting or rejecting invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"You are not allowed to invite a user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached",USER_IS_NOT_A_MEMBER_OF_THE_TEAM:"User is not a member of the team",YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:"You are not allowed to list the members of this team",YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:"You do not have an active team",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:"You are not allowed to create a new member",YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:"You are not allowed to remove a team member",YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:"You are not allowed to access this organization as an owner",YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:"You are not a member of this organization",MISSING_AC_INSTANCE:"Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information",YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:"You must be in an organization to create a role",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:"You are not allowed to create a role",YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:"You are not allowed to update a role",YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:"You are not allowed to delete a role",YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:"You are not allowed to read a role",YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:"You are not allowed to list a role",YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:"You are not allowed to get a role",TOO_MANY_ROLES:"This organization has too many roles",INVALID_RESOURCE:"The provided permission includes an invalid resource",ROLE_NAME_IS_ALREADY_TAKEN:"That role name is already taken",CANNOT_DELETE_A_PRE_DEFINED_ROLE:"Cannot delete a pre-defined role"}),dH6=Number.POSITIVE_INFINITY,qP0=C(),bg1=v1(["pending","accepted","rejected","canceled"]).default("pending"),pH6=J0({id:C().default(B9),name:C(),slug:C(),logo:C().nullish().optional(),metadata:D1(C(),UX()).or(C().transform((Q)=>JSON.parse(Q))).optional(),createdAt:r1()}),cH6=J0({id:C().default(B9),organizationId:C(),userId:x1.string(),role:qP0,createdAt:r1().default(()=>new Date)}),nH6=J0({id:C().default(B9),organizationId:C(),email:C(),role:qP0,status:bg1,teamId:C().nullish(),inviterId:C(),expiresAt:r1(),createdAt:r1().default(()=>new Date)}),iH6=J0({id:C().default(B9),name:C().min(1),organizationId:C(),createdAt:r1(),updatedAt:r1().optional()}),rH6=J0({id:C().default(B9),teamId:C(),userId:C(),createdAt:r1().default(()=>new Date)}),aH6=J0({id:C().default(B9),organizationId:C(),role:C(),permission:D1(C(),V1(C())),createdAt:r1().default(()=>new Date),updatedAt:r1().optional()}),HP0=["admin","member","owner"],oH6=O8([v1(HP0),V1(v1(HP0))])});var $q6;var VP0=_(()=>{N8();m8();w8();L9();Q9();jQ();l9();S8();$q6=j6({INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",PHONE_NUMBER_NOT_EXIST:"phone number isn't registered",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified",PHONE_NUMBER_CANNOT_BE_UPDATED:"Phone number cannot be updated",SEND_OTP_NOT_IMPLEMENTED:"sendOTP not implemented",TOO_MANY_ATTEMPTS:"Too many attempts"})});var zP0=_(()=>{m8();yX();t8();w8();S8()});var xg1;var UP0=_(()=>{N8();m8();c5();w8();L9();vD();Q9();jQ();l9();x9();S8();o6();u7();Lr();xg1=j6({OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"})});var gg1;var NP0=_(()=>{m8();t8();w8();Q9();jQ();l9();S8();gg1=j6({INVALID_USERNAME_OR_PASSWORD:"Invalid username or password",EMAIL_NOT_VERIFIED:"Email not verified",UNEXPECTED_ERROR:"Unexpected error",USERNAME_IS_ALREADY_TAKEN:"Username is already taken. Please try another.",USERNAME_TOO_SHORT:"Username is too short",USERNAME_TOO_LONG:"Username is too long",INVALID_USERNAME:"Username is invalid",INVALID_DISPLAY_USERNAME:"Display username is invalid"})});var pr=_(()=>{kG();ZX();cG();p5();N8();g$();m8();L7();c5();yX();t8();w8();L9();vD();aD();tV();Pr();Mr();AR();Ar();Cw0();tD();Sw0();vw0();cw0();nw0();iw0();rw0();ow0();sw0();tw0();ew0();Cr();QP0();_r();JP0();XP0();YP0();GP0();ZP0();FP0();VP0();zP0();UP0();NP0()});var BP0=_(()=>{tV();AR()});var GH;var OP0=_(()=>{GH={enabled:!0,batchSize:250,flushIntervalMs:300,maxQueueSize:1e4,redactor:"regex"}});import{existsSync as DP0,readFileSync as LP0}from"fs";function ug1(){if(DP0(wP0))try{let Q=LP0(wP0,"utf-8"),J=JSON.parse(Q);return{auth:fR,monitoring:GH,...J}}catch{return{auth:fR,monitoring:GH}}if(DP0(PP0))try{let Q=LP0(PP0,"utf-8");return{auth:JSON.parse(Q),monitoring:GH}}catch{return{auth:fR,monitoring:GH}}return{auth:fR,monitoring:GH}}function MP0(){return{...GH,...bR.monitoring}}var fR,wP0,PP0,bR;var cr=_(()=>{OP0();fR={emailAndPassword:{enabled:!0}},wP0=process.env.CONFIG_PATH||"./config.json",PP0=process.env.AUTH_CONFIG_PATH||"./auth-config.json";bR=ug1()});var AP0=_(()=>{XH()});var ir=I((lg1)=>{lg1.parse=function(Q,J){return new nr(Q,J).parse()};class nr{constructor(Q,J){this.source=Q,this.transform=J||mg1,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var Q=this.source[this.position++];if(Q==="\\")return{value:this.source[this.position++],escaped:!0};return{value:Q,escaped:!1}}record(Q){this.recorded.push(Q)}newEntry(Q){var J;if(this.recorded.length>0||Q){if(J=this.recorded.join(""),J==="NULL"&&!Q)J=null;if(J!==null)J=this.transform(J);this.entries.push(J),this.recorded=[]}}consumeDimensions(){if(this.source[0]==="[")while(!this.isEof()){var Q=this.nextCharacter();if(Q.value==="=")break}}parse(Q){var J,X,G;this.consumeDimensions();while(!this.isEof())if(J=this.nextCharacter(),J.value==="{"&&!G){if(this.dimension++,this.dimension>1)X=new nr(this.source.substr(this.position-1),this.transform),this.entries.push(X.parse(!0)),this.position+=X.position-2}else if(J.value==="}"&&!G){if(this.dimension--,!this.dimension){if(this.newEntry(),Q)return this.entries}}else if(J.value==='"'&&!J.escaped){if(G)this.newEntry(!0);G=!G}else if(J.value===","&&!G)this.newEntry();else this.record(J.value);if(this.dimension!==0)throw Error("array dimension not balanced");return this.entries}}function mg1(Q){return Q}});var rr=I((UV6,TP0)=>{var pg1=ir();TP0.exports={create:function(Q,J){return{parse:function(){return pg1.parse(Q,J)}}}}});var IP0=I((NV6,jP0)=>{var cg1=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,ng1=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,ig1=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,rg1=/^-?infinity$/;jP0.exports=function(J){if(rg1.test(J))return Number(J.replace("i","I"));var X=cg1.exec(J);if(!X)return ag1(J)||null;var G=!!X[8],Y=parseInt(X[1],10);if(G)Y=EP0(Y);var W=parseInt(X[2],10)-1,$=X[3],K=parseInt(X[4],10),Z=parseInt(X[5],10),H=parseInt(X[6],10),q=X[7];q=q?1000*parseFloat(q):0;var F,V=og1(J);if(V!=null){if(F=new Date(Date.UTC(Y,W,$,K,Z,H,q)),ar(Y))F.setUTCFullYear(Y);if(V!==0)F.setTime(F.getTime()-V)}else if(F=new Date(Y,W,$,K,Z,H,q),ar(Y))F.setFullYear(Y);return F};function ag1(Q){var J=ng1.exec(Q);if(!J)return;var X=parseInt(J[1],10),G=!!J[4];if(G)X=EP0(X);var Y=parseInt(J[2],10)-1,W=J[3],$=new Date(X,Y,W);if(ar(X))$.setFullYear(X);return $}function og1(Q){if(Q.endsWith("+00"))return 0;var J=ig1.exec(Q.split(" ")[1]);if(!J)return;var X=J[1];if(X==="Z")return 0;var G=X==="-"?-1:1,Y=parseInt(J[2],10)*3600+parseInt(J[3]||0,10)*60+parseInt(J[4]||0,10);return Y*G*1000}function EP0(Q){return-(Q-1)}function ar(Q){return Q>=0&&Q<100}});var CP0=I((BV6,RP0)=>{RP0.exports=tg1;var sg1=Object.prototype.hasOwnProperty;function tg1(Q){for(var J=1;J<arguments.length;J++){var X=arguments[J];for(var G in X)if(sg1.call(X,G))Q[G]=X[G]}return Q}});var kP0=I((OV6,vP0)=>{var eg1=CP0();vP0.exports=eV;function eV(Q){if(!(this instanceof eV))return new eV(Q);eg1(this,Fu1(Q))}var Qu1=["seconds","minutes","hours","days","months","years"];eV.prototype.toPostgres=function(){var Q=Qu1.filter(this.hasOwnProperty,this);if(this.milliseconds&&Q.indexOf("seconds")<0)Q.push("seconds");if(Q.length===0)return"0";return Q.map(function(J){var X=this[J]||0;if(J==="seconds"&&this.milliseconds)X=(X+this.milliseconds/1000).toFixed(6).replace(/\.?0+$/,"");return X+" "+J},this).join(" ")};var Ju1={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},Xu1=["years","months","days"],Yu1=["hours","minutes","seconds"];eV.prototype.toISOString=eV.prototype.toISO=function(){var Q=Xu1.map(X,this).join(""),J=Yu1.map(X,this).join("");return"P"+Q+"T"+J;function X(G){var Y=this[G]||0;if(G==="seconds"&&this.milliseconds)Y=(Y+this.milliseconds/1000).toFixed(6).replace(/0+$/,"");return Y+Ju1[G]}};var or="([+-]?\\d+)",Gu1=or+"\\s+years?",Wu1=or+"\\s+mons?",$u1=or+"\\s+days?",Ku1="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Zu1=new RegExp([Gu1,Wu1,$u1,Ku1].map(function(Q){return"("+Q+")?"}).join("\\s*")),SP0={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},Hu1=["hours","minutes","seconds","milliseconds"];function qu1(Q){var J=Q+"000000".slice(Q.length);return parseInt(J,10)/1000}function Fu1(Q){if(!Q)return{};var J=Zu1.exec(Q),X=J[8]==="-";return Object.keys(SP0).reduce(function(G,Y){var W=SP0[Y],$=J[W];if(!$)return G;if($=Y==="milliseconds"?qu1($):parseInt($,10),!$)return G;if(X&&~Hu1.indexOf(Y))$*=-1;return G[Y]=$,G},{})}});var hP0=I((DV6,yP0)=>{var _P0=Buffer.from||Buffer;yP0.exports=function(J){if(/^\\x/.test(J))return _P0(J.substr(2),"hex");var X="",G=0;while(G<J.length)if(J[G]!=="\\")X+=J[G],++G;else if(/[0-7]{3}/.test(J.substr(G+1,3)))X+=String.fromCharCode(parseInt(J.substr(G+1,3),8)),G+=4;else{var Y=1;while(G+Y<J.length&&J[G+Y]==="\\")Y++;for(var W=0;W<Math.floor(Y/2);++W)X+="\\";G+=Math.floor(Y/2)*2}return _P0(X,"binary")}});var lP0=I((LV6,mP0)=>{var $L=ir(),KL=rr(),xR=IP0(),bP0=kP0(),xP0=hP0();function gR(Q){return function(X){if(X===null)return X;return Q(X)}}function gP0(Q){if(Q===null)return Q;return Q==="TRUE"||Q==="t"||Q==="true"||Q==="y"||Q==="yes"||Q==="on"||Q==="1"}function Vu1(Q){if(!Q)return null;return $L.parse(Q,gP0)}function zu1(Q){return parseInt(Q,10)}function sr(Q){if(!Q)return null;return $L.parse(Q,gR(zu1))}function Uu1(Q){if(!Q)return null;return $L.parse(Q,gR(function(J){return uP0(J).trim()}))}var Nu1=function(Q){if(!Q)return null;var J=KL.create(Q,function(X){if(X!==null)X=Ja(X);return X});return J.parse()},tr=function(Q){if(!Q)return null;var J=KL.create(Q,function(X){if(X!==null)X=parseFloat(X);return X});return J.parse()},xX=function(Q){if(!Q)return null;var J=KL.create(Q);return J.parse()},er=function(Q){if(!Q)return null;var J=KL.create(Q,function(X){if(X!==null)X=xR(X);return X});return J.parse()},Bu1=function(Q){if(!Q)return null;var J=KL.create(Q,function(X){if(X!==null)X=bP0(X);return X});return J.parse()},Ou1=function(Q){if(!Q)return null;return $L.parse(Q,gR(xP0))},Qa=function(Q){return parseInt(Q,10)},uP0=function(Q){var J=String(Q);if(/^\d+$/.test(J))return J;return Q},fP0=function(Q){if(!Q)return null;return $L.parse(Q,gR(JSON.parse))},Ja=function(Q){if(Q[0]!=="(")return null;return Q=Q.substring(1,Q.length-1).split(","),{x:parseFloat(Q[0]),y:parseFloat(Q[1])}},Du1=function(Q){if(Q[0]!=="<"&&Q[1]!=="(")return null;var J="(",X="",G=!1;for(var Y=2;Y<Q.length-1;Y++){if(!G)J+=Q[Y];if(Q[Y]===")"){G=!0;continue}else if(!G)continue;if(Q[Y]===",")continue;X+=Q[Y]}var W=Ja(J);return W.radius=parseFloat(X),W},Lu1=function(Q){Q(20,uP0),Q(21,Qa),Q(23,Qa),Q(26,Qa),Q(700,parseFloat),Q(701,parseFloat),Q(16,gP0),Q(1082,xR),Q(1114,xR),Q(1184,xR),Q(600,Ja),Q(651,xX),Q(718,Du1),Q(1000,Vu1),Q(1001,Ou1),Q(1005,sr),Q(1007,sr),Q(1028,sr),Q(1016,Uu1),Q(1017,Nu1),Q(1021,tr),Q(1022,tr),Q(1231,tr),Q(1014,xX),Q(1015,xX),Q(1008,xX),Q(1009,xX),Q(1040,xX),Q(1041,xX),Q(1115,er),Q(1182,er),Q(1185,er),Q(1186,bP0),Q(1187,Bu1),Q(17,xP0),Q(114,JSON.parse.bind(JSON)),Q(3802,JSON.parse.bind(JSON)),Q(199,fP0),Q(3807,fP0),Q(3907,xX),Q(2951,xX),Q(791,xX),Q(1183,xX),Q(1270,xX)};mP0.exports={init:Lu1}});var pP0=I((wV6,dP0)=>{var YJ=1e6;function wu1(Q){var J=Q.readInt32BE(0),X=Q.readUInt32BE(4),G="";if(J<0)J=~J+(X===0),X=~X+1>>>0,G="-";var Y="",W,$,K,Z,H,q;{if(W=J%YJ,J=J/YJ>>>0,$=4294967296*W+X,X=$/YJ>>>0,K=""+($-YJ*X),X===0&&J===0)return G+K+Y;Z="",H=6-K.length;for(q=0;q<H;q++)Z+="0";Y=Z+K+Y}{if(W=J%YJ,J=J/YJ>>>0,$=4294967296*W+X,X=$/YJ>>>0,K=""+($-YJ*X),X===0&&J===0)return G+K+Y;Z="",H=6-K.length;for(q=0;q<H;q++)Z+="0";Y=Z+K+Y}{if(W=J%YJ,J=J/YJ>>>0,$=4294967296*W+X,X=$/YJ>>>0,K=""+($-YJ*X),X===0&&J===0)return G+K+Y;Z="",H=6-K.length;for(q=0;q<H;q++)Z+="0";Y=Z+K+Y}return W=J%YJ,$=4294967296*W+X,K=""+$%YJ,G+K+Y}dP0.exports=wu1});var aP0=I((PV6,rP0)=>{var Pu1=pP0(),d8=function(Q,J,X,G,Y){X=X||0,G=G||!1,Y=Y||function(z,U,B){return z*Math.pow(2,B)+U};var W=X>>3,$=function(z){if(G)return~z&255;return z},K=255,Z=8-X%8;if(J<Z)K=255<<8-J&255,Z=J;if(X)K=K>>X%8;var H=0;if(X%8+J>=8)H=Y(0,$(Q[W])&K,Z);var q=J+X>>3;for(var F=W+1;F<q;F++)H=Y(H,$(Q[F]),8);var V=(J+X)%8;if(V>0)H=Y(H,$(Q[q])>>8-V,V);return H},iP0=function(Q,J,X){var G=Math.pow(2,X-1)-1,Y=d8(Q,1),W=d8(Q,X,1);if(W===0)return 0;var $=1,K=function(H,q,F){if(H===0)H=1;for(var V=1;V<=F;V++)if($/=2,(q&1<<F-V)>0)H+=$;return H},Z=d8(Q,J,X+1,!1,K);if(W==Math.pow(2,X+1)-1){if(Z===0)return Y===0?1/0:-1/0;return NaN}return(Y===0?1:-1)*Math.pow(2,W-G)*Z},Mu1=function(Q){if(d8(Q,1)==1)return-1*(d8(Q,15,1,!0)+1);return d8(Q,15,1)},cP0=function(Q){if(d8(Q,1)==1)return-1*(d8(Q,31,1,!0)+1);return d8(Q,31,1)},Au1=function(Q){return iP0(Q,23,8)},Tu1=function(Q){return iP0(Q,52,11)},Eu1=function(Q){var J=d8(Q,16,32);if(J==49152)return NaN;var X=Math.pow(1e4,d8(Q,16,16)),G=0,Y=[],W=d8(Q,16);for(var $=0;$<W;$++)G+=d8(Q,16,64+16*$)*X,X/=1e4;var K=Math.pow(10,d8(Q,16,48));return(J===0?1:-1)*Math.round(G*K)/K},nP0=function(Q,J){var X=d8(J,1),G=d8(J,63,1),Y=new Date((X===0?1:-1)*G/1000+946684800000);if(!Q)Y.setTime(Y.getTime()+Y.getTimezoneOffset()*60000);return Y.usec=G%1000,Y.getMicroSeconds=function(){return this.usec},Y.setMicroSeconds=function(W){this.usec=W},Y.getUTCMicroSeconds=function(){return this.usec},Y},ZL=function(Q){var J=d8(Q,32),X=d8(Q,32,32),G=d8(Q,32,64),Y=96,W=[];for(var $=0;$<J;$++)W[$]=d8(Q,32,Y),Y+=32,Y+=32;var K=function(H){var q=d8(Q,32,Y);if(Y+=32,q==4294967295)return null;var F;if(H==23||H==20)return F=d8(Q,q*8,Y),Y+=q*8,F;else if(H==25)return F=Q.toString(this.encoding,Y>>3,(Y+=q<<3)>>3),F;else console.log("ERROR: ElementType not implemented: "+H)},Z=function(H,q){var F=[],V;if(H.length>1){var z=H.shift();for(V=0;V<z;V++)F[V]=Z(H,q);H.unshift(z)}else for(V=0;V<H[0];V++)F[V]=K(q);return F};return Z(W,G)},ju1=function(Q){return Q.toString("utf8")},Iu1=function(Q){if(Q===null)return null;return d8(Q,8)>0},Ru1=function(Q){Q(20,Pu1),Q(21,Mu1),Q(23,cP0),Q(26,cP0),Q(1700,Eu1),Q(700,Au1),Q(701,Tu1),Q(16,Iu1),Q(1114,nP0.bind(null,!1)),Q(1184,nP0.bind(null,!0)),Q(1000,ZL),Q(1007,ZL),Q(1016,ZL),Q(1008,ZL),Q(1009,ZL),Q(25,ju1)};rP0.exports={init:Ru1}});var sP0=I((MV6,oP0)=>{oP0.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var qL=I((hu1)=>{var Cu1=lP0(),Su1=aP0(),vu1=rr(),ku1=sP0();hu1.getTypeParser=_u1;hu1.setTypeParser=yu1;hu1.arrayParser=vu1;hu1.builtins=ku1;var HL={text:{},binary:{}};function tP0(Q){return String(Q)}function _u1(Q,J){if(J=J||"text",!HL[J])return tP0;return HL[J][Q]||tP0}function yu1(Q,J,X){if(typeof J=="function")X=J,J="text";HL[J][Q]=X}Cu1.init(function(Q,J){HL.text[Q]=J});Su1.init(function(Q,J){HL.binary[Q]=J})});var FL=I((TV6,Xa)=>{Xa.exports={host:"localhost",user:process.platform==="win32"?process.env.USERNAME:process.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:30000,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var Qz=qL(),uu1=Qz.getTypeParser(20,"text"),mu1=Qz.getTypeParser(1016,"text");Xa.exports.__defineSetter__("parseInt8",function(Q){Qz.setTypeParser(20,"text",Q?Qz.getTypeParser(23,"text"):uu1),Qz.setTypeParser(1016,"text",Q?Qz.getTypeParser(1007,"text"):mu1)})});var Jz=I((EV6,JM0)=>{var lu1=FL(),eP0=E0("util"),{isDate:du1}=eP0.types||eP0;function pu1(Q){return'"'+Q.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")+'"'}function QM0(Q){let J="{";for(let X=0;X<Q.length;X++){if(X>0)J=J+",";if(Q[X]===null||typeof Q[X]>"u")J=J+"NULL";else if(Array.isArray(Q[X]))J=J+QM0(Q[X]);else if(ArrayBuffer.isView(Q[X])){let G=Q[X];if(!(G instanceof Buffer)){let Y=Buffer.from(G.buffer,G.byteOffset,G.byteLength);if(Y.length===G.byteLength)G=Y;else G=Y.slice(G.byteOffset,G.byteOffset+G.byteLength)}J+="\\\\x"+G.toString("hex")}else J+=pu1(uR(Q[X]))}return J=J+"}",J}var uR=function(Q,J){if(Q==null)return null;if(typeof Q==="object"){if(Q instanceof Buffer)return Q;if(ArrayBuffer.isView(Q)){let X=Buffer.from(Q.buffer,Q.byteOffset,Q.byteLength);if(X.length===Q.byteLength)return X;return X.slice(Q.byteOffset,Q.byteOffset+Q.byteLength)}if(du1(Q))if(lu1.parseInputDatesAsUTC)return iu1(Q);else return nu1(Q);if(Array.isArray(Q))return QM0(Q);return cu1(Q,J)}return Q.toString()};function cu1(Q,J){if(Q&&typeof Q.toPostgres==="function"){if(J=J||[],J.indexOf(Q)!==-1)throw Error('circular reference detected while preparing "'+Q+'" for query');return J.push(Q),uR(Q.toPostgres(uR),J)}return JSON.stringify(Q)}function nu1(Q){let J=-Q.getTimezoneOffset(),X=Q.getFullYear(),G=X<1;if(G)X=Math.abs(X)+1;let Y=String(X).padStart(4,"0")+"-"+String(Q.getMonth()+1).padStart(2,"0")+"-"+String(Q.getDate()).padStart(2,"0")+"T"+String(Q.getHours()).padStart(2,"0")+":"+String(Q.getMinutes()).padStart(2,"0")+":"+String(Q.getSeconds()).padStart(2,"0")+"."+String(Q.getMilliseconds()).padStart(3,"0");if(J<0)Y+="-",J*=-1;else Y+="+";if(Y+=String(Math.floor(J/60)).padStart(2,"0")+":"+String(J%60).padStart(2,"0"),G)Y+=" BC";return Y}function iu1(Q){let J=Q.getUTCFullYear(),X=J<1;if(X)J=Math.abs(J)+1;let G=String(J).padStart(4,"0")+"-"+String(Q.getUTCMonth()+1).padStart(2,"0")+"-"+String(Q.getUTCDate()).padStart(2,"0")+"T"+String(Q.getUTCHours()).padStart(2,"0")+":"+String(Q.getUTCMinutes()).padStart(2,"0")+":"+String(Q.getUTCSeconds()).padStart(2,"0")+"."+String(Q.getUTCMilliseconds()).padStart(3,"0");if(G+="+00:00",X)G+=" BC";return G}function ru1(Q,J,X){if(Q=typeof Q==="string"?{text:Q}:Q,J)if(typeof J==="function")Q.callback=J;else Q.values=J;if(X)Q.callback=X;return Q}var au1=function(Q){return'"'+Q.replace(/"/g,'""')+'"'},ou1=function(Q){let J=!1,X="'";if(Q==null)return"''";if(typeof Q!=="string")return"''";for(let G=0;G<Q.length;G++){let Y=Q[G];if(Y==="'")X+=Y+Y;else if(Y==="\\")X+=Y+Y,J=!0;else X+=Y}if(X+="'",J===!0)X=" E"+X;return X};JM0.exports={prepareValue:function(J){return uR(J)},normalizeQueryConfig:ru1,escapeIdentifier:au1,escapeLiteral:ou1}});var YM0=I((jV6,XM0)=>{var Xz=E0("crypto");function Ya(Q){return Xz.createHash("md5").update(Q,"utf-8").digest("hex")}function su1(Q,J,X){let G=Ya(J+Q);return"md5"+Ya(Buffer.concat([Buffer.from(G),X]))}function tu1(Q){return Xz.createHash("sha256").update(Q).digest()}function eu1(Q,J){return Q=Q.replace(/(\D)-/,"$1"),Xz.createHash(Q).update(J).digest()}function Qm1(Q,J){return Xz.createHmac("sha256",Q).update(J).digest()}async function Jm1(Q,J,X){return Xz.pbkdf2Sync(Q,J,X,32,"sha256")}XM0.exports={postgresMd5PasswordHash:su1,randomBytes:Xz.randomBytes,deriveKey:Jm1,sha256:tu1,hashByName:eu1,hmacSha256:Qm1,md5:Ya}});var KM0=I((IV6,$M0)=>{var GM0=E0("crypto");$M0.exports={postgresMd5PasswordHash:Ym1,randomBytes:Xm1,deriveKey:Km1,sha256:Gm1,hashByName:Wm1,hmacSha256:$m1,md5:Ga};var WM0=GM0.webcrypto||globalThis.crypto,WH=WM0.subtle,Wa=new TextEncoder;function Xm1(Q){return WM0.getRandomValues(Buffer.alloc(Q))}async function Ga(Q){try{return GM0.createHash("md5").update(Q,"utf-8").digest("hex")}catch(J){let X=typeof Q==="string"?Wa.encode(Q):Q,G=await WH.digest("MD5",X);return Array.from(new Uint8Array(G)).map((Y)=>Y.toString(16).padStart(2,"0")).join("")}}async function Ym1(Q,J,X){let G=await Ga(J+Q);return"md5"+await Ga(Buffer.concat([Buffer.from(G),X]))}async function Gm1(Q){return await WH.digest("SHA-256",Q)}async function Wm1(Q,J){return await WH.digest(Q,J)}async function $m1(Q,J){let X=await WH.importKey("raw",Q,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await WH.sign("HMAC",X,Wa.encode(J))}async function Km1(Q,J,X){let G=await WH.importKey("raw",Wa.encode(Q),"PBKDF2",!1,["deriveBits"]),Y={name:"PBKDF2",hash:"SHA-256",salt:J,iterations:X};return await WH.deriveBits(Y,G,256,["deriveBits"])}});var Ka=I((RV6,$a)=>{var Zm1=parseInt(process.versions&&process.versions.node&&process.versions.node.split(".")[0])<15;if(Zm1)$a.exports=YM0();else $a.exports=KM0()});var qM0=I((CV6,HM0)=>{function $H(Q,J){return Error("SASL channel binding: "+Q+" when parsing public certificate "+J.toString("base64"))}function Za(Q,J){let X=Q[J++];if(X<128)return{length:X,index:J};let G=X&127;if(G>4)throw $H("bad length",Q);X=0;for(let Y=0;Y<G;Y++)X=X<<8|Q[J++];return{length:X,index:J}}function ZM0(Q,J){if(Q[J++]!==6)throw $H("non-OID data",Q);let{length:X,index:G}=Za(Q,J);J=G;let Y=J+X,W=Q[J++],$=(W/40>>0)+"."+W%40;while(J<Y){let K=0;while(J<Y){let Z=Q[J++];if(K=K<<7|Z&127,Z<128)break}$+="."+K}return{oid:$,index:J}}function VL(Q,J){if(Q[J++]!==48)throw $H("non-sequence data",Q);return Za(Q,J)}function Hm1(Q,J){if(J===void 0)J=0;J=VL(Q,J).index;let{length:X,index:G}=VL(Q,J);J=G+X,J=VL(Q,J).index;let{oid:Y,index:W}=ZM0(Q,J);switch(Y){case"1.2.840.113549.1.1.4":return"MD5";case"1.2.840.113549.1.1.5":return"SHA-1";case"1.2.840.113549.1.1.11":return"SHA-256";case"1.2.840.113549.1.1.12":return"SHA-384";case"1.2.840.113549.1.1.13":return"SHA-512";case"1.2.840.113549.1.1.14":return"SHA-224";case"1.2.840.113549.1.1.15":return"SHA512-224";case"1.2.840.113549.1.1.16":return"SHA512-256";case"1.2.840.10045.4.1":return"SHA-1";case"1.2.840.10045.4.3.1":return"SHA-224";case"1.2.840.10045.4.3.2":return"SHA-256";case"1.2.840.10045.4.3.3":return"SHA-384";case"1.2.840.10045.4.3.4":return"SHA-512";case"1.2.840.113549.1.1.10":{if(J=W,J=VL(Q,J).index,Q[J++]!==160)throw $H("non-tag data",Q);J=Za(Q,J).index,J=VL(Q,J).index;let{oid:$}=ZM0(Q,J);switch($){case"1.2.840.113549.2.5":return"MD5";case"1.3.14.3.2.26":return"SHA-1";case"2.16.840.1.101.3.4.2.1":return"SHA-256";case"2.16.840.1.101.3.4.2.2":return"SHA-384";case"2.16.840.1.101.3.4.2.3":return"SHA-512"}throw $H("unknown hash OID "+$,Q)}case"1.3.101.110":case"1.3.101.112":return"SHA-512";case"1.3.101.111":case"1.3.101.113":throw $H("Ed448 certificate channel binding is not currently supported by Postgres")}throw $H("unknown OID "+Y,Q)}HM0.exports={signatureAlgorithmHashFromCertificate:Hm1}});var UM0=I((SV6,zM0)=>{var PK=Ka(),{signatureAlgorithmHashFromCertificate:qm1}=qM0();function Fm1(Q,J){let X=["SCRAM-SHA-256"];if(J)X.unshift("SCRAM-SHA-256-PLUS");let G=X.find(($)=>Q.includes($));if(!G)throw Error("SASL: Only mechanism(s) "+X.join(" and ")+" are supported");if(G==="SCRAM-SHA-256-PLUS"&&typeof J.getPeerCertificate!=="function")throw Error("SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate");let Y=PK.randomBytes(18).toString("base64");return{mechanism:G,clientNonce:Y,response:(G==="SCRAM-SHA-256-PLUS"?"p=tls-server-end-point":J?"y":"n")+",,n=*,r="+Y,message:"SASLInitialResponse"}}async function Vm1(Q,J,X,G){if(Q.message!=="SASLInitialResponse")throw Error("SASL: Last message was not SASLInitialResponse");if(typeof J!=="string")throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(J==="")throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string");if(typeof X!=="string")throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let Y=Nm1(X);if(!Y.nonce.startsWith(Q.clientNonce))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");else if(Y.nonce.length===Q.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short");let W="n=*,r="+Q.clientNonce,$="r="+Y.nonce+",s="+Y.salt+",i="+Y.iteration,K=G?"eSws":"biws";if(Q.mechanism==="SCRAM-SHA-256-PLUS"){let A=G.getPeerCertificate().raw,E=qm1(A);if(E==="MD5"||E==="SHA-1")E="SHA-256";let P=await PK.hashByName(E,A);K=Buffer.concat([Buffer.from("p=tls-server-end-point,,"),Buffer.from(P)]).toString("base64")}let Z="c="+K+",r="+Y.nonce,H=W+","+$+","+Z,q=Buffer.from(Y.salt,"base64"),F=await PK.deriveKey(J,q,Y.iteration),V=await PK.hmacSha256(F,"Client Key"),z=await PK.sha256(V),U=await PK.hmacSha256(z,H),B=Om1(Buffer.from(V),Buffer.from(U)).toString("base64"),D=await PK.hmacSha256(F,"Server Key"),w=await PK.hmacSha256(D,H);Q.message="SASLResponse",Q.serverSignature=Buffer.from(w).toString("base64"),Q.response=Z+",p="+B}function zm1(Q,J){if(Q.message!=="SASLResponse")throw Error("SASL: Last message was not SASLResponse");if(typeof J!=="string")throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:X}=Bm1(J);if(X!==Q.serverSignature)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function Um1(Q){if(typeof Q!=="string")throw TypeError("SASL: text must be a string");return Q.split("").map((J,X)=>Q.charCodeAt(X)).every((J)=>J>=33&&J<=43||J>=45&&J<=126)}function FM0(Q){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(Q)}function VM0(Q){if(typeof Q!=="string")throw TypeError("SASL: attribute pairs text must be a string");return new Map(Q.split(",").map((J)=>{if(!/^.=/.test(J))throw Error("SASL: Invalid attribute pair entry");let X=J[0],G=J.substring(2);return[X,G]}))}function Nm1(Q){let J=VM0(Q),X=J.get("r");if(!X)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");else if(!Um1(X))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters");let G=J.get("s");if(!G)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");else if(!FM0(G))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64");let Y=J.get("i");if(!Y)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");else if(!/^[1-9][0-9]*$/.test(Y))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count");let W=parseInt(Y,10);return{nonce:X,salt:G,iteration:W}}function Bm1(Q){let X=VM0(Q).get("v");if(!X)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");else if(!FM0(X))throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64");return{serverSignature:X}}function Om1(Q,J){if(!Buffer.isBuffer(Q))throw TypeError("first argument must be a Buffer");if(!Buffer.isBuffer(J))throw TypeError("second argument must be a Buffer");if(Q.length!==J.length)throw Error("Buffer lengths must match");if(Q.length===0)throw Error("Buffers cannot be empty");return Buffer.from(Q.map((X,G)=>Q[G]^J[G]))}zM0.exports={startSession:Fm1,continueSession:Vm1,finalizeSession:zm1}});var lR=I((vV6,NM0)=>{var Dm1=qL();function mR(Q){this._types=Q||Dm1,this.text={},this.binary={}}mR.prototype.getOverrides=function(Q){switch(Q){case"text":return this.text;case"binary":return this.binary;default:return{}}};mR.prototype.setTypeParser=function(Q,J,X){if(typeof J==="function")X=J,J="text";this.getOverrides(J)[Q]=X};mR.prototype.getTypeParser=function(Q,J){return J=J||"text",this.getOverrides(J)[Q]||this._types.getTypeParser(Q,J)};NM0.exports=mR});var DM0=I((kV6,OM0)=>{function Yz(Q,J={}){if(Q.charAt(0)==="/"){let Z=Q.split(" ");return{host:Z[0],database:Z[1]}}let X={},G,Y=!1;if(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(Q))Q=encodeURI(Q).replace(/%25(\d\d)/g,"%$1");try{try{G=new URL(Q,"postgres://base")}catch(Z){G=new URL(Q.replace("@/","@___DUMMY___/"),"postgres://base"),Y=!0}}catch(Z){Z.input&&(Z.input="*****REDACTED*****")}for(let Z of G.searchParams.entries())X[Z[0]]=Z[1];if(X.user=X.user||decodeURIComponent(G.username),X.password=X.password||decodeURIComponent(G.password),G.protocol=="socket:")return X.host=decodeURI(G.pathname),X.database=G.searchParams.get("db"),X.client_encoding=G.searchParams.get("encoding"),X;let W=Y?"":G.hostname;if(!X.host)X.host=decodeURIComponent(W);else if(W&&/^%2f/i.test(W))G.pathname=W+G.pathname;if(!X.port)X.port=G.port;let $=G.pathname.slice(1)||null;if(X.database=$?decodeURI($):null,X.ssl==="true"||X.ssl==="1")X.ssl=!0;if(X.ssl==="0")X.ssl=!1;if(X.sslcert||X.sslkey||X.sslrootcert||X.sslmode)X.ssl={};let K=X.sslcert||X.sslkey||X.sslrootcert?E0("fs"):null;if(X.sslcert)X.ssl.cert=K.readFileSync(X.sslcert).toString();if(X.sslkey)X.ssl.key=K.readFileSync(X.sslkey).toString();if(X.sslrootcert)X.ssl.ca=K.readFileSync(X.sslrootcert).toString();if(J.useLibpqCompat&&X.uselibpqcompat)throw Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");if(X.uselibpqcompat==="true"||J.useLibpqCompat)switch(X.sslmode){case"disable":{X.ssl=!1;break}case"prefer":{X.ssl.rejectUnauthorized=!1;break}case"require":{if(X.sslrootcert)X.ssl.checkServerIdentity=function(){};else X.ssl.rejectUnauthorized=!1;break}case"verify-ca":{if(!X.ssl.ca)throw Error("SECURITY WARNING: Using sslmode=verify-ca requires specifying a CA with sslrootcert. If a public CA is used, verify-ca allows connections to a server that somebody else may have registered with the CA, making you vulnerable to Man-in-the-Middle attacks. Either specify a custom CA certificate with sslrootcert parameter or use sslmode=verify-full for proper security.");X.ssl.checkServerIdentity=function(){};break}case"verify-full":break}else switch(X.sslmode){case"disable":{X.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":{X.ssl.rejectUnauthorized=!1;break}}return X}function Lm1(Q){return Object.entries(Q).reduce((X,[G,Y])=>{if(Y!==void 0&&Y!==null)X[G]=Y;return X},{})}function BM0(Q){return Object.entries(Q).reduce((X,[G,Y])=>{if(G==="ssl"){let W=Y;if(typeof W==="boolean")X[G]=W;if(typeof W==="object")X[G]=Lm1(W)}else if(Y!==void 0&&Y!==null)if(G==="port"){if(Y!==""){let W=parseInt(Y,10);if(isNaN(W))throw Error(`Invalid ${G}: ${Y}`);X[G]=W}}else X[G]=Y;return X},{})}function wm1(Q){return BM0(Yz(Q))}OM0.exports=Yz;Yz.parse=Yz;Yz.toClientConfig=BM0;Yz.parseIntoClientConfig=wm1});var Ha=I((_V6,MM0)=>{var Pm1=E0("dns"),wM0=FL(),LM0=DM0().parse,RQ=function(Q,J,X){if(X===void 0)X=process.env["PG"+Q.toUpperCase()];else if(X===!1);else X=process.env[X];return J[Q]||X||wM0[Q]},Mm1=function(){switch(process.env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify":return{rejectUnauthorized:!1}}return wM0.ssl},Gz=function(Q){return"'"+(""+Q).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},gX=function(Q,J,X){let G=J[X];if(G!==void 0&&G!==null)Q.push(X+"="+Gz(G))};class PM0{constructor(Q){if(Q=typeof Q==="string"?LM0(Q):Q||{},Q.connectionString)Q=Object.assign({},Q,LM0(Q.connectionString));if(this.user=RQ("user",Q),this.database=RQ("database",Q),this.database===void 0)this.database=this.user;if(this.port=parseInt(RQ("port",Q),10),this.host=RQ("host",Q),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:RQ("password",Q)}),this.binary=RQ("binary",Q),this.options=RQ("options",Q),this.ssl=typeof Q.ssl>"u"?Mm1():Q.ssl,typeof this.ssl==="string"){if(this.ssl==="true")this.ssl=!0}if(this.ssl==="no-verify")this.ssl={rejectUnauthorized:!1};if(this.ssl&&this.ssl.key)Object.defineProperty(this.ssl,"key",{enumerable:!1});if(this.client_encoding=RQ("client_encoding",Q),this.replication=RQ("replication",Q),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=RQ("application_name",Q,"PGAPPNAME"),this.fallback_application_name=RQ("fallback_application_name",Q,!1),this.statement_timeout=RQ("statement_timeout",Q,!1),this.lock_timeout=RQ("lock_timeout",Q,!1),this.idle_in_transaction_session_timeout=RQ("idle_in_transaction_session_timeout",Q,!1),this.query_timeout=RQ("query_timeout",Q,!1),Q.connectionTimeoutMillis===void 0)this.connect_timeout=process.env.PGCONNECT_TIMEOUT||0;else this.connect_timeout=Math.floor(Q.connectionTimeoutMillis/1000);if(Q.keepAlive===!1)this.keepalives=0;else if(Q.keepAlive===!0)this.keepalives=1;if(typeof Q.keepAliveInitialDelayMillis==="number")this.keepalives_idle=Math.floor(Q.keepAliveInitialDelayMillis/1000)}getLibpqConnectionString(Q){let J=[];gX(J,this,"user"),gX(J,this,"password"),gX(J,this,"port"),gX(J,this,"application_name"),gX(J,this,"fallback_application_name"),gX(J,this,"connect_timeout"),gX(J,this,"options");let X=typeof this.ssl==="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(gX(J,X,"sslmode"),gX(J,X,"sslca"),gX(J,X,"sslkey"),gX(J,X,"sslcert"),gX(J,X,"sslrootcert"),this.database)J.push("dbname="+Gz(this.database));if(this.replication)J.push("replication="+Gz(this.replication));if(this.host)J.push("host="+Gz(this.host));if(this.isDomainSocket)return Q(null,J.join(" "));if(this.client_encoding)J.push("client_encoding="+Gz(this.client_encoding));Pm1.lookup(this.host,function(G,Y){if(G)return Q(G,null);return J.push("hostaddr="+Gz(Y)),Q(null,J.join(" "))})}}MM0.exports=PM0});var qa=I((yV6,EM0)=>{var Am1=qL(),AM0=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/;class TM0{constructor(Q,J){if(this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=J,this.RowCtor=null,this.rowAsArray=Q==="array",this.rowAsArray)this.parseRow=this._parseRowAsArray;this._prebuiltEmptyResultObject=null}addCommandComplete(Q){let J;if(Q.text)J=AM0.exec(Q.text);else J=AM0.exec(Q.command);if(J){if(this.command=J[1],J[3])this.oid=parseInt(J[2],10),this.rowCount=parseInt(J[3],10);else if(J[2])this.rowCount=parseInt(J[2],10)}}_parseRowAsArray(Q){let J=Array(Q.length);for(let X=0,G=Q.length;X<G;X++){let Y=Q[X];if(Y!==null)J[X]=this._parsers[X](Y);else J[X]=null}return J}parseRow(Q){let J={...this._prebuiltEmptyResultObject};for(let X=0,G=Q.length;X<G;X++){let Y=Q[X],W=this.fields[X].name;if(Y!==null){let $=this.fields[X].format==="binary"?Buffer.from(Y):Y;J[W]=this._parsers[X]($)}else J[W]=null}return J}addRow(Q){this.rows.push(Q)}addFields(Q){if(this.fields=Q,this.fields.length)this._parsers=Array(Q.length);let J={};for(let X=0;X<Q.length;X++){let G=Q[X];if(J[G.name]=null,this._types)this._parsers[X]=this._types.getTypeParser(G.dataTypeID,G.format||"text");else this._parsers[X]=Am1.getTypeParser(G.dataTypeID,G.format||"text")}this._prebuiltEmptyResultObject={...J}}}EM0.exports=TM0});var SM0=I((hV6,CM0)=>{var{EventEmitter:Tm1}=E0("events"),jM0=qa(),IM0=Jz();class RM0 extends Tm1{constructor(Q,J,X){super();if(Q=IM0.normalizeQueryConfig(Q,J,X),this.text=Q.text,this.values=Q.values,this.rows=Q.rows,this.types=Q.types,this.name=Q.name,this.queryMode=Q.queryMode,this.binary=Q.binary,this.portal=Q.portal||"",this.callback=Q.callback,this._rowMode=Q.rowMode,process.domain&&Q.callback)this.callback=process.domain.bind(Q.callback);this._result=new jM0(this._rowMode,this.types),this._results=this._result,this._canceledDueToError=!1}requiresPreparation(){if(this.queryMode==="extended")return!0;if(this.name)return!0;if(this.rows)return!0;if(!this.text)return!1;if(!this.values)return!1;return this.values.length>0}_checkForMultirow(){if(this._result.command){if(!Array.isArray(this._results))this._results=[this._result];this._result=new jM0(this._rowMode,this._result._types),this._results.push(this._result)}}handleRowDescription(Q){this._checkForMultirow(),this._result.addFields(Q.fields),this._accumulateRows=this.callback||!this.listeners("row").length}handleDataRow(Q){let J;if(this._canceledDueToError)return;try{J=this._result.parseRow(Q.fields)}catch(X){this._canceledDueToError=X;return}if(this.emit("row",J,this._result),this._accumulateRows)this._result.addRow(J)}handleCommandComplete(Q,J){if(this._checkForMultirow(),this._result.addCommandComplete(Q),this.rows)J.sync()}handleEmptyQuery(Q){if(this.rows)Q.sync()}handleError(Q,J){if(this._canceledDueToError)Q=this._canceledDueToError,this._canceledDueToError=!1;if(this.callback)return this.callback(Q);this.emit("error",Q)}handleReadyForQuery(Q){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,Q);if(this.callback)try{this.callback(null,this._results)}catch(J){process.nextTick(()=>{throw J})}this.emit("end",this._results)}submit(Q){if(typeof this.text!=="string"&&typeof this.name!=="string")return Error("A query must have either text or a name. Supplying neither is unsupported.");let J=Q.parsedStatements[this.name];if(this.text&&J&&this.text!==J)return Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);if(this.values&&!Array.isArray(this.values))return Error("Query values must be an array");if(this.requiresPreparation()){Q.stream.cork&&Q.stream.cork();try{this.prepare(Q)}finally{Q.stream.uncork&&Q.stream.uncork()}}else Q.query(this.text);return null}hasBeenParsed(Q){return this.name&&Q.parsedStatements[this.name]}handlePortalSuspended(Q){this._getRows(Q,this.rows)}_getRows(Q,J){if(Q.execute({portal:this.portal,rows:J}),!J)Q.sync();else Q.flush()}prepare(Q){if(!this.hasBeenParsed(Q))Q.parse({text:this.text,name:this.name,types:this.types});try{Q.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:IM0.prepareValue})}catch(J){this.handleError(J,Q);return}Q.describe({type:"P",name:this.portal||""}),this._getRows(Q,this.rows)}handleCopyInResponse(Q){Q.sendCopyFail("No source stream defined")}handleCopyData(Q,J){}}CM0.exports=RM0});var Fa=I((cM0)=>{Object.defineProperty(cM0,"__esModule",{value:!0});cM0.NoticeMessage=cM0.DataRowMessage=cM0.CommandCompleteMessage=cM0.ReadyForQueryMessage=cM0.NotificationResponseMessage=cM0.BackendKeyDataMessage=cM0.AuthenticationMD5Password=cM0.ParameterStatusMessage=cM0.ParameterDescriptionMessage=cM0.RowDescriptionMessage=cM0.Field=cM0.CopyResponse=cM0.CopyDataMessage=cM0.DatabaseError=cM0.copyDone=cM0.emptyQuery=cM0.replicationStart=cM0.portalSuspended=cM0.noData=cM0.closeComplete=cM0.bindComplete=cM0.parseComplete=void 0;cM0.parseComplete={name:"parseComplete",length:5};cM0.bindComplete={name:"bindComplete",length:5};cM0.closeComplete={name:"closeComplete",length:5};cM0.noData={name:"noData",length:5};cM0.portalSuspended={name:"portalSuspended",length:5};cM0.replicationStart={name:"replicationStart",length:4};cM0.emptyQuery={name:"emptyQuery",length:4};cM0.copyDone={name:"copyDone",length:4};class vM0 extends Error{constructor(Q,J,X){super(Q);this.length=J,this.name=X}}cM0.DatabaseError=vM0;class kM0{constructor(Q,J){this.length=Q,this.chunk=J,this.name="copyData"}}cM0.CopyDataMessage=kM0;class _M0{constructor(Q,J,X,G){this.length=Q,this.name=J,this.binary=X,this.columnTypes=Array(G)}}cM0.CopyResponse=_M0;class yM0{constructor(Q,J,X,G,Y,W,$){this.name=Q,this.tableID=J,this.columnID=X,this.dataTypeID=G,this.dataTypeSize=Y,this.dataTypeModifier=W,this.format=$}}cM0.Field=yM0;class hM0{constructor(Q,J){this.length=Q,this.fieldCount=J,this.name="rowDescription",this.fields=Array(this.fieldCount)}}cM0.RowDescriptionMessage=hM0;class fM0{constructor(Q,J){this.length=Q,this.parameterCount=J,this.name="parameterDescription",this.dataTypeIDs=Array(this.parameterCount)}}cM0.ParameterDescriptionMessage=fM0;class bM0{constructor(Q,J,X){this.length=Q,this.parameterName=J,this.parameterValue=X,this.name="parameterStatus"}}cM0.ParameterStatusMessage=bM0;class xM0{constructor(Q,J){this.length=Q,this.salt=J,this.name="authenticationMD5Password"}}cM0.AuthenticationMD5Password=xM0;class gM0{constructor(Q,J,X){this.length=Q,this.processID=J,this.secretKey=X,this.name="backendKeyData"}}cM0.BackendKeyDataMessage=gM0;class uM0{constructor(Q,J,X,G){this.length=Q,this.processId=J,this.channel=X,this.payload=G,this.name="notification"}}cM0.NotificationResponseMessage=uM0;class mM0{constructor(Q,J){this.length=Q,this.status=J,this.name="readyForQuery"}}cM0.ReadyForQueryMessage=mM0;class lM0{constructor(Q,J){this.length=Q,this.text=J,this.name="commandComplete"}}cM0.CommandCompleteMessage=lM0;class dM0{constructor(Q,J){this.length=Q,this.fields=J,this.name="dataRow",this.fieldCount=J.length}}cM0.DataRowMessage=dM0;class pM0{constructor(Q,J){this.length=Q,this.message=J,this.name="notice"}}cM0.NoticeMessage=pM0});var oM0=I((rM0)=>{Object.defineProperty(rM0,"__esModule",{value:!0});rM0.Writer=void 0;class iM0{constructor(Q=256){this.size=Q,this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(Q)}ensure(Q){if(this.buffer.length-this.offset<Q){let X=this.buffer,G=X.length+(X.length>>1)+Q;this.buffer=Buffer.allocUnsafe(G),X.copy(this.buffer)}}addInt32(Q){return this.ensure(4),this.buffer[this.offset++]=Q>>>24&255,this.buffer[this.offset++]=Q>>>16&255,this.buffer[this.offset++]=Q>>>8&255,this.buffer[this.offset++]=Q>>>0&255,this}addInt16(Q){return this.ensure(2),this.buffer[this.offset++]=Q>>>8&255,this.buffer[this.offset++]=Q>>>0&255,this}addCString(Q){if(!Q)this.ensure(1);else{let J=Buffer.byteLength(Q);this.ensure(J+1),this.buffer.write(Q,this.offset,"utf-8"),this.offset+=J}return this.buffer[this.offset++]=0,this}addString(Q=""){let J=Buffer.byteLength(Q);return this.ensure(J),this.buffer.write(Q,this.offset),this.offset+=J,this}add(Q){return this.ensure(Q.length),Q.copy(this.buffer,this.offset),this.offset+=Q.length,this}join(Q){if(Q){this.buffer[this.headerPosition]=Q;let J=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(J,this.headerPosition+1)}return this.buffer.slice(Q?0:5,this.offset)}flush(Q){let J=this.join(Q);return this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(this.size),J}}rM0.Writer=iM0});var Q20=I((tM0)=>{Object.defineProperty(tM0,"__esModule",{value:!0});tM0.serialize=void 0;var Va=oM0(),h8=new Va.Writer,nm1=(Q)=>{h8.addInt16(3).addInt16(0);for(let G of Object.keys(Q))h8.addCString(G).addCString(Q[G]);h8.addCString("client_encoding").addCString("UTF8");let J=h8.addCString("").flush(),X=J.length+4;return new Va.Writer().addInt32(X).add(J).flush()},im1=()=>{let Q=Buffer.allocUnsafe(8);return Q.writeInt32BE(8,0),Q.writeInt32BE(80877103,4),Q},rm1=(Q)=>{return h8.addCString(Q).flush(112)},am1=function(Q,J){return h8.addCString(Q).addInt32(Buffer.byteLength(J)).addString(J),h8.flush(112)},om1=function(Q){return h8.addString(Q).flush(112)},sm1=(Q)=>{return h8.addCString(Q).flush(81)},sM0=[],tm1=(Q)=>{let J=Q.name||"";if(J.length>63)console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",J,J.length),console.error("This can cause conflicts and silent errors executing queries");let X=Q.types||sM0,G=X.length,Y=h8.addCString(J).addCString(Q.text).addInt16(G);for(let W=0;W<G;W++)Y.addInt32(X[W]);return h8.flush(80)},Wz=new Va.Writer,em1=function(Q,J){for(let X=0;X<Q.length;X++){let G=J?J(Q[X],X):Q[X];if(G==null)h8.addInt16(0),Wz.addInt32(-1);else if(G instanceof Buffer)h8.addInt16(1),Wz.addInt32(G.length),Wz.add(G);else h8.addInt16(0),Wz.addInt32(Buffer.byteLength(G)),Wz.addString(G)}},Ql1=(Q={})=>{let J=Q.portal||"",X=Q.statement||"",G=Q.binary||!1,Y=Q.values||sM0,W=Y.length;return h8.addCString(J).addCString(X),h8.addInt16(W),em1(Y,Q.valueMapper),h8.addInt16(W),h8.add(Wz.flush()),h8.addInt16(1),h8.addInt16(G?1:0),h8.flush(66)},Jl1=Buffer.from([69,0,0,0,9,0,0,0,0,0]),Xl1=(Q)=>{if(!Q||!Q.portal&&!Q.rows)return Jl1;let J=Q.portal||"",X=Q.rows||0,G=Buffer.byteLength(J),Y=4+G+1+4,W=Buffer.allocUnsafe(1+Y);return W[0]=69,W.writeInt32BE(Y,1),W.write(J,5,"utf-8"),W[G+5]=0,W.writeUInt32BE(X,W.length-4),W},Yl1=(Q,J)=>{let X=Buffer.allocUnsafe(16);return X.writeInt32BE(16,0),X.writeInt16BE(1234,4),X.writeInt16BE(5678,6),X.writeInt32BE(Q,8),X.writeInt32BE(J,12),X},za=(Q,J)=>{let G=4+Buffer.byteLength(J)+1,Y=Buffer.allocUnsafe(1+G);return Y[0]=Q,Y.writeInt32BE(G,1),Y.write(J,5,"utf-8"),Y[G]=0,Y},Gl1=h8.addCString("P").flush(68),Wl1=h8.addCString("S").flush(68),$l1=(Q)=>{return Q.name?za(68,`${Q.type}${Q.name||""}`):Q.type==="P"?Gl1:Wl1},Kl1=(Q)=>{let J=`${Q.type}${Q.name||""}`;return za(67,J)},Zl1=(Q)=>{return h8.add(Q).flush(100)},Hl1=(Q)=>{return za(102,Q)},dR=(Q)=>Buffer.from([Q,0,0,0,4]),ql1=dR(72),Fl1=dR(83),Vl1=dR(88),zl1=dR(99),Ul1={startup:nm1,password:rm1,requestSsl:im1,sendSASLInitialResponseMessage:am1,sendSCRAMClientFinalMessage:om1,query:sm1,parse:tm1,bind:Ql1,execute:Xl1,describe:$l1,close:Kl1,flush:()=>ql1,sync:()=>Fl1,end:()=>Vl1,copyData:Zl1,copyDone:()=>zl1,copyFail:Hl1,cancel:Yl1};tM0.serialize=Ul1});var G20=I((X20)=>{Object.defineProperty(X20,"__esModule",{value:!0});X20.BufferReader=void 0;var Nl1=Buffer.allocUnsafe(0);class J20{constructor(Q=0){this.offset=Q,this.buffer=Nl1,this.encoding="utf-8"}setBuffer(Q,J){this.offset=Q,this.buffer=J}int16(){let Q=this.buffer.readInt16BE(this.offset);return this.offset+=2,Q}byte(){let Q=this.buffer[this.offset];return this.offset++,Q}int32(){let Q=this.buffer.readInt32BE(this.offset);return this.offset+=4,Q}uint32(){let Q=this.buffer.readUInt32BE(this.offset);return this.offset+=4,Q}string(Q){let J=this.buffer.toString(this.encoding,this.offset,this.offset+Q);return this.offset+=Q,J}cstring(){let Q=this.offset,J=Q;while(this.buffer[J++]!==0);return this.offset=J,this.buffer.toString(this.encoding,Q,J-1)}bytes(Q){let J=this.buffer.slice(this.offset,this.offset+Q);return this.offset+=Q,J}}X20.BufferReader=J20});var q20=I((Z20)=>{Object.defineProperty(Z20,"__esModule",{value:!0});Z20.Parser=void 0;var p8=Fa(),Bl1=G20(),Ua=1,Ol1=4,W20=Ua+Ol1,$20=Buffer.allocUnsafe(0);class K20{constructor(Q){if(this.buffer=$20,this.bufferLength=0,this.bufferOffset=0,this.reader=new Bl1.BufferReader,(Q===null||Q===void 0?void 0:Q.mode)==="binary")throw Error("Binary mode not supported yet");this.mode=(Q===null||Q===void 0?void 0:Q.mode)||"text"}parse(Q,J){this.mergeBuffer(Q);let X=this.bufferOffset+this.bufferLength,G=this.bufferOffset;while(G+W20<=X){let Y=this.buffer[G],W=this.buffer.readUInt32BE(G+Ua),$=Ua+W;if($+G<=X){let K=this.handlePacket(G+W20,Y,W,this.buffer);J(K),G+=$}else break}if(G===X)this.buffer=$20,this.bufferLength=0,this.bufferOffset=0;else this.bufferLength=X-G,this.bufferOffset=G}mergeBuffer(Q){if(this.bufferLength>0){let J=this.bufferLength+Q.byteLength;if(J+this.bufferOffset>this.buffer.byteLength){let G;if(J<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)G=this.buffer;else{let Y=this.buffer.byteLength*2;while(J>=Y)Y*=2;G=Buffer.allocUnsafe(Y)}this.buffer.copy(G,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=G,this.bufferOffset=0}Q.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=J}else this.buffer=Q,this.bufferOffset=0,this.bufferLength=Q.byteLength}handlePacket(Q,J,X,G){switch(J){case 50:return p8.bindComplete;case 49:return p8.parseComplete;case 51:return p8.closeComplete;case 110:return p8.noData;case 115:return p8.portalSuspended;case 99:return p8.copyDone;case 87:return p8.replicationStart;case 73:return p8.emptyQuery;case 68:return this.parseDataRowMessage(Q,X,G);case 67:return this.parseCommandCompleteMessage(Q,X,G);case 90:return this.parseReadyForQueryMessage(Q,X,G);case 65:return this.parseNotificationMessage(Q,X,G);case 82:return this.parseAuthenticationResponse(Q,X,G);case 83:return this.parseParameterStatusMessage(Q,X,G);case 75:return this.parseBackendKeyData(Q,X,G);case 69:return this.parseErrorMessage(Q,X,G,"error");case 78:return this.parseErrorMessage(Q,X,G,"notice");case 84:return this.parseRowDescriptionMessage(Q,X,G);case 116:return this.parseParameterDescriptionMessage(Q,X,G);case 71:return this.parseCopyInMessage(Q,X,G);case 72:return this.parseCopyOutMessage(Q,X,G);case 100:return this.parseCopyData(Q,X,G);default:return new p8.DatabaseError("received invalid response: "+J.toString(16),X,"error")}}parseReadyForQueryMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.string(1);return new p8.ReadyForQueryMessage(J,G)}parseCommandCompleteMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.cstring();return new p8.CommandCompleteMessage(J,G)}parseCopyData(Q,J,X){let G=X.slice(Q,Q+(J-4));return new p8.CopyDataMessage(J,G)}parseCopyInMessage(Q,J,X){return this.parseCopyMessage(Q,J,X,"copyInResponse")}parseCopyOutMessage(Q,J,X){return this.parseCopyMessage(Q,J,X,"copyOutResponse")}parseCopyMessage(Q,J,X,G){this.reader.setBuffer(Q,X);let Y=this.reader.byte()!==0,W=this.reader.int16(),$=new p8.CopyResponse(J,G,Y,W);for(let K=0;K<W;K++)$.columnTypes[K]=this.reader.int16();return $}parseNotificationMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int32(),Y=this.reader.cstring(),W=this.reader.cstring();return new p8.NotificationResponseMessage(J,G,Y,W)}parseRowDescriptionMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int16(),Y=new p8.RowDescriptionMessage(J,G);for(let W=0;W<G;W++)Y.fields[W]=this.parseField();return Y}parseField(){let Q=this.reader.cstring(),J=this.reader.uint32(),X=this.reader.int16(),G=this.reader.uint32(),Y=this.reader.int16(),W=this.reader.int32(),$=this.reader.int16()===0?"text":"binary";return new p8.Field(Q,J,X,G,Y,W,$)}parseParameterDescriptionMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int16(),Y=new p8.ParameterDescriptionMessage(J,G);for(let W=0;W<G;W++)Y.dataTypeIDs[W]=this.reader.int32();return Y}parseDataRowMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int16(),Y=Array(G);for(let W=0;W<G;W++){let $=this.reader.int32();Y[W]=$===-1?null:this.reader.string($)}return new p8.DataRowMessage(J,Y)}parseParameterStatusMessage(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.cstring(),Y=this.reader.cstring();return new p8.ParameterStatusMessage(J,G,Y)}parseBackendKeyData(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int32(),Y=this.reader.int32();return new p8.BackendKeyDataMessage(J,G,Y)}parseAuthenticationResponse(Q,J,X){this.reader.setBuffer(Q,X);let G=this.reader.int32(),Y={name:"authenticationOk",length:J};switch(G){case 0:break;case 3:if(Y.length===8)Y.name="authenticationCleartextPassword";break;case 5:if(Y.length===12){Y.name="authenticationMD5Password";let W=this.reader.bytes(4);return new p8.AuthenticationMD5Password(J,W)}break;case 10:{Y.name="authenticationSASL",Y.mechanisms=[];let W;do if(W=this.reader.cstring(),W)Y.mechanisms.push(W);while(W)}break;case 11:Y.name="authenticationSASLContinue",Y.data=this.reader.string(J-8);break;case 12:Y.name="authenticationSASLFinal",Y.data=this.reader.string(J-8);break;default:throw Error("Unknown authenticationOk message type "+G)}return Y}parseErrorMessage(Q,J,X,G){this.reader.setBuffer(Q,X);let Y={},W=this.reader.string(1);while(W!=="\x00")Y[W]=this.reader.cstring(),W=this.reader.string(1);let $=Y.M,K=G==="notice"?new p8.NoticeMessage(J,$):new p8.DatabaseError($,J,G);return K.severity=Y.S,K.code=Y.C,K.detail=Y.D,K.hint=Y.H,K.position=Y.P,K.internalPosition=Y.p,K.internalQuery=Y.q,K.where=Y.W,K.schema=Y.s,K.table=Y.t,K.column=Y.c,K.dataType=Y.d,K.constraint=Y.n,K.file=Y.F,K.line=Y.L,K.routine=Y.R,K}}Z20.Parser=K20});var Na=I((pR)=>{Object.defineProperty(pR,"__esModule",{value:!0});pR.DatabaseError=pR.serialize=pR.parse=void 0;var Dl1=Fa();Object.defineProperty(pR,"DatabaseError",{enumerable:!0,get:function(){return Dl1.DatabaseError}});var Ll1=Q20();Object.defineProperty(pR,"serialize",{enumerable:!0,get:function(){return Ll1.serialize}});var wl1=q20();function Pl1(Q,J){let X=new wl1.Parser;return Q.on("data",(G)=>X.parse(G,J)),new Promise((G)=>Q.on("end",()=>G()))}pR.parse=Pl1});var V20=I((F20)=>{Object.defineProperty(F20,"__esModule",{value:!0});F20.default={}});var U20=I((pV6,z20)=>{var{getStream:El1,getSecureStream:jl1}=Sl1();z20.exports={getStream:El1,getSecureStream:jl1};function Il1(){function Q(X){return new(E0("net")).Socket}function J(X){return E0("tls").connect(X)}return{getStream:Q,getSecureStream:J}}function Rl1(){function Q(X){let{CloudflareSocket:G}=V20();return new G(X)}function J(X){return X.socket.startTls(X),X.socket}return{getStream:Q,getSecureStream:J}}function Cl1(){if(typeof navigator==="object"&&navigator!==null&&typeof navigator.userAgent==="string")return navigator.userAgent==="Cloudflare-Workers";if(typeof Response==="function"){let Q=new Response(null,{cf:{thing:!0}});if(typeof Q.cf==="object"&&Q.cf!==null&&Q.cf.thing)return!0}return!1}function Sl1(){if(Cl1())return Rl1();return Il1()}});var Ba=I((cV6,B20)=>{var vl1=E0("events").EventEmitter,{parse:kl1,serialize:X5}=Na(),{getStream:_l1,getSecureStream:yl1}=U20(),hl1=X5.flush(),fl1=X5.sync(),bl1=X5.end();class N20 extends vl1{constructor(Q){super();if(Q=Q||{},this.stream=Q.stream||_l1(Q.ssl),typeof this.stream==="function")this.stream=this.stream(Q);this._keepAlive=Q.keepAlive,this._keepAliveInitialDelayMillis=Q.keepAliveInitialDelayMillis,this.lastBuffer=!1,this.parsedStatements={},this.ssl=Q.ssl||!1,this._ending=!1,this._emitMessage=!1;let J=this;this.on("newListener",function(X){if(X==="message")J._emitMessage=!0})}connect(Q,J){let X=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(Q,J),this.stream.once("connect",function(){if(X._keepAlive)X.stream.setKeepAlive(!0,X._keepAliveInitialDelayMillis);X.emit("connect")});let G=function(Y){if(X._ending&&(Y.code==="ECONNRESET"||Y.code==="EPIPE"))return;X.emit("error",Y)};if(this.stream.on("error",G),this.stream.on("close",function(){X.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(Y){switch(Y.toString("utf8")){case"S":break;case"N":return X.stream.end(),X.emit("error",Error("The server does not support SSL connections"));default:return X.stream.end(),X.emit("error",Error("There was an error establishing an SSL connection"))}let $={socket:X.stream};if(X.ssl!==!0){if(Object.assign($,X.ssl),"key"in X.ssl)$.key=X.ssl.key}let K=E0("net");if(K.isIP&&K.isIP(J)===0)$.servername=J;try{X.stream=yl1($)}catch(Z){return X.emit("error",Z)}X.attachListeners(X.stream),X.stream.on("error",G),X.emit("sslconnect")})}attachListeners(Q){kl1(Q,(J)=>{let X=J.name==="error"?"errorMessage":J.name;if(this._emitMessage)this.emit("message",J);this.emit(X,J)})}requestSsl(){this.stream.write(X5.requestSsl())}startup(Q){this.stream.write(X5.startup(Q))}cancel(Q,J){this._send(X5.cancel(Q,J))}password(Q){this._send(X5.password(Q))}sendSASLInitialResponseMessage(Q,J){this._send(X5.sendSASLInitialResponseMessage(Q,J))}sendSCRAMClientFinalMessage(Q){this._send(X5.sendSCRAMClientFinalMessage(Q))}_send(Q){if(!this.stream.writable)return!1;return this.stream.write(Q)}query(Q){this._send(X5.query(Q))}parse(Q){this._send(X5.parse(Q))}bind(Q){this._send(X5.bind(Q))}execute(Q){this._send(X5.execute(Q))}flush(){if(this.stream.writable)this.stream.write(hl1)}sync(){this._ending=!0,this._send(fl1)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this.stream.end();return}return this.stream.write(bl1,()=>{this.stream.end()})}close(Q){this._send(X5.close(Q))}describe(Q){this._send(X5.describe(Q))}sendCopyFromChunk(Q){this._send(X5.copyData(Q))}endCopyFrom(){this._send(X5.copyDone())}sendCopyFail(Q){this._send(X5.copyFail(Q))}}B20.exports=N20});var w20=I((nV6,L20)=>{var{Transform:xl1}=E0("stream"),{StringDecoder:gl1}=E0("string_decoder"),MK=Symbol("last"),cR=Symbol("decoder");function ul1(Q,J,X){let G;if(this.overflow){if(G=this[cR].write(Q).split(this.matcher),G.length===1)return X();G.shift(),this.overflow=!1}else this[MK]+=this[cR].write(Q),G=this[MK].split(this.matcher);this[MK]=G.pop();for(let Y=0;Y<G.length;Y++)try{D20(this,this.mapper(G[Y]))}catch(W){return X(W)}if(this.overflow=this[MK].length>this.maxLength,this.overflow&&!this.skipOverflow){X(Error("maximum buffer reached"));return}X()}function ml1(Q){if(this[MK]+=this[cR].end(),this[MK])try{D20(this,this.mapper(this[MK]))}catch(J){return Q(J)}Q()}function D20(Q,J){if(J!==void 0)Q.push(J)}function O20(Q){return Q}function ll1(Q,J,X){switch(Q=Q||/\r?\n/,J=J||O20,X=X||{},arguments.length){case 1:if(typeof Q==="function")J=Q,Q=/\r?\n/;else if(typeof Q==="object"&&!(Q instanceof RegExp)&&!Q[Symbol.split])X=Q,Q=/\r?\n/;break;case 2:if(typeof Q==="function")X=J,J=Q,Q=/\r?\n/;else if(typeof J==="object")X=J,J=O20}X=Object.assign({},X),X.autoDestroy=!0,X.transform=ul1,X.flush=ml1,X.readableObjectMode=!0;let G=new xl1(X);return G[MK]="",G[cR]=new gl1("utf8"),G.matcher=Q,G.mapper=J,G.maxLength=X.maxLength,G.skipOverflow=X.skipOverflow||!1,G.overflow=!1,G._destroy=function(Y,W){this._writableState.errorEmitted=!1,W(Y)},G}L20.exports=ll1});var A20=I((Jd1,DW)=>{var P20=E0("path"),dl1=E0("stream").Stream,pl1=w20(),M20=E0("util"),cl1=5432,nR=process.platform==="win32",zL=process.stderr,nl1=56,il1=7,rl1=61440,al1=32768;function ol1(Q){return(Q&rl1)==al1}var $z=["host","port","database","user","password"],Oa=$z.length,sl1=$z[Oa-1];function Da(){var Q=zL instanceof dl1&&zL.writable===!0;if(Q){var J=Array.prototype.slice.call(arguments).concat(`
942
942
  `);zL.write(M20.format.apply(M20,J))}}Object.defineProperty(Jd1,"isWin",{get:function(){return nR},set:function(Q){nR=Q}});Jd1.warnTo=function(Q){var J=zL;return zL=Q,J};Jd1.getFileName=function(Q){var J=Q||process.env,X=J.PGPASSFILE||(nR?P20.join(J.APPDATA||"./","postgresql","pgpass.conf"):P20.join(J.HOME||"./",".pgpass"));return X};Jd1.usePgPass=function(Q,J){if(Object.prototype.hasOwnProperty.call(process.env,"PGPASSWORD"))return!1;if(nR)return!0;if(J=J||"<unkn>",!ol1(Q.mode))return Da('WARNING: password file "%s" is not a plain file',J),!1;if(Q.mode&(nl1|il1))return Da('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',J),!1;return!0};var tl1=Jd1.match=function(Q,J){return $z.slice(0,-1).reduce(function(X,G,Y){if(Y==1){if(Number(Q[G]||cl1)===Number(J[G]))return X&&!0}return X&&(J[G]==="*"||J[G]===Q[G])},!0)};Jd1.getPassword=function(Q,J,X){var G,Y=J.pipe(pl1());function W(Z){var H=el1(Z);if(H&&Qd1(H)&&tl1(Q,H))G=H[sl1],Y.end()}var $=function(){J.destroy(),X(G)},K=function(Z){J.destroy(),Da("WARNING: error on reading file: %s",Z),X(void 0)};J.on("error",K),Y.on("data",W).on("end",$).on("error",K)};var el1=Jd1.parseLine=function(Q){if(Q.length<11||Q.match(/^\s+#/))return null;var J="",X="",G=0,Y=0,W=0,$={},K=!1,Z=function(q,F,V){var z=Q.substring(F,V);if(!Object.hasOwnProperty.call(process.env,"PGPASS_NO_DEESCAPE"))z=z.replace(/\\([:\\])/g,"$1");$[$z[q]]=z};for(var H=0;H<Q.length-1;H+=1){if(J=Q.charAt(H+1),X=Q.charAt(H),K=G==Oa-1,K){Z(G,Y);break}if(H>=0&&J==":"&&X!=="\\")Z(G,Y,H+1),Y=H+2,G+=1}return $=Object.keys($).length===Oa?$:null,$},Qd1=Jd1.isValidEntry=function(Q){var J={0:function($){return $.length>0},1:function($){if($==="*")return!0;return $=Number($),isFinite($)&&$>0&&$<9007199254740992&&Math.floor($)===$},2:function($){return $.length>0},3:function($){return $.length>0},4:function($){return $.length>0}};for(var X=0;X<$z.length;X+=1){var G=J[X],Y=Q[$z[X]]||"",W=G(Y);if(!W)return!1}return!0}});var E20=I((sV6,La)=>{var oV6=E0("path"),T20=E0("fs"),iR=A20();La.exports=function(Q,J){var X=iR.getFileName();T20.stat(X,function(G,Y){if(G||!iR.usePgPass(Y,X))return J(void 0);var W=T20.createReadStream(X);iR.getPassword(Q,W,J)})};La.exports.warnTo=iR.warnTo});var C20=I((tV6,R20)=>{var $d1=E0("events").EventEmitter,j20=Jz(),wa=UM0(),Kd1=lR(),Zd1=Ha(),I20=SM0(),Hd1=FL(),qd1=Ba(),Fd1=Ka();class Pa extends $d1{constructor(Q){super();this.connectionParameters=new Zd1(Q),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;let J=Q||{};if(this._Promise=J.Promise||global.Promise,this._types=new Kd1(J.types),this._ending=!1,this._ended=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.enableChannelBinding=Boolean(J.enableChannelBinding),this.connection=J.connection||new qd1({stream:J.stream,ssl:this.connectionParameters.ssl,keepAlive:J.keepAlive||!1,keepAliveInitialDelayMillis:J.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=J.binary||Hd1.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key)Object.defineProperty(this.ssl,"key",{enumerable:!1});this._connectionTimeoutMillis=J.connectionTimeoutMillis||0}_errorAllQueries(Q){let J=(X)=>{process.nextTick(()=>{X.handleError(Q,this.connection)})};if(this.activeQuery)J(this.activeQuery),this.activeQuery=null;this.queryQueue.forEach(J),this.queryQueue.length=0}_connect(Q){let J=this,X=this.connection;if(this._connectionCallback=Q,this._connecting||this._connected){let G=Error("Client has already been connected. You cannot reuse a client.");process.nextTick(()=>{Q(G)});return}if(this._connecting=!0,this._connectionTimeoutMillis>0){if(this.connectionTimeoutHandle=setTimeout(()=>{X._ending=!0,X.stream.destroy(Error("timeout expired"))},this._connectionTimeoutMillis),this.connectionTimeoutHandle.unref)this.connectionTimeoutHandle.unref()}if(this.host&&this.host.indexOf("/")===0)X.connect(this.host+"/.s.PGSQL."+this.port);else X.connect(this.port,this.host);X.on("connect",function(){if(J.ssl)X.requestSsl();else X.startup(J.getStartupConf())}),X.on("sslconnect",function(){X.startup(J.getStartupConf())}),this._attachListeners(X),X.once("end",()=>{let G=this._ending?Error("Connection terminated"):Error("Connection terminated unexpectedly");if(clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(G),this._ended=!0,!this._ending){if(this._connecting&&!this._connectionError)if(this._connectionCallback)this._connectionCallback(G);else this._handleErrorEvent(G);else if(!this._connectionError)this._handleErrorEvent(G)}process.nextTick(()=>{this.emit("end")})})}connect(Q){if(Q){this._connect(Q);return}return new this._Promise((J,X)=>{this._connect((G)=>{if(G)X(G);else J()})})}_attachListeners(Q){Q.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),Q.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),Q.on("authenticationSASL",this._handleAuthSASL.bind(this)),Q.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),Q.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),Q.on("backendKeyData",this._handleBackendKeyData.bind(this)),Q.on("error",this._handleErrorEvent.bind(this)),Q.on("errorMessage",this._handleErrorMessage.bind(this)),Q.on("readyForQuery",this._handleReadyForQuery.bind(this)),Q.on("notice",this._handleNotice.bind(this)),Q.on("rowDescription",this._handleRowDescription.bind(this)),Q.on("dataRow",this._handleDataRow.bind(this)),Q.on("portalSuspended",this._handlePortalSuspended.bind(this)),Q.on("emptyQuery",this._handleEmptyQuery.bind(this)),Q.on("commandComplete",this._handleCommandComplete.bind(this)),Q.on("parseComplete",this._handleParseComplete.bind(this)),Q.on("copyInResponse",this._handleCopyInResponse.bind(this)),Q.on("copyData",this._handleCopyData.bind(this)),Q.on("notification",this._handleNotification.bind(this))}_checkPgPass(Q){let J=this.connection;if(typeof this.password==="function")this._Promise.resolve().then(()=>this.password()).then((X)=>{if(X!==void 0){if(typeof X!=="string"){J.emit("error",TypeError("Password must be a string"));return}this.connectionParameters.password=this.password=X}else this.connectionParameters.password=this.password=null;Q()}).catch((X)=>{J.emit("error",X)});else if(this.password!==null)Q();else try{E20()(this.connectionParameters,(G)=>{if(G!==void 0)this.connectionParameters.password=this.password=G;Q()})}catch(X){this.emit("error",X)}}_handleAuthCleartextPassword(Q){this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(Q){this._checkPgPass(async()=>{try{let J=await Fd1.postgresMd5PasswordHash(this.user,this.password,Q.salt);this.connection.password(J)}catch(J){this.emit("error",J)}})}_handleAuthSASL(Q){this._checkPgPass(()=>{try{this.saslSession=wa.startSession(Q.mechanisms,this.enableChannelBinding&&this.connection.stream),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)}catch(J){this.connection.emit("error",J)}})}async _handleAuthSASLContinue(Q){try{await wa.continueSession(this.saslSession,this.password,Q.data,this.enableChannelBinding&&this.connection.stream),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}catch(J){this.connection.emit("error",J)}}_handleAuthSASLFinal(Q){try{wa.finalizeSession(this.saslSession,Q.data),this.saslSession=null}catch(J){this.connection.emit("error",J)}}_handleBackendKeyData(Q){this.processID=Q.processID,this.secretKey=Q.secretKey}_handleReadyForQuery(Q){if(this._connecting){if(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)this._connectionCallback(null,this),this._connectionCallback=null;this.emit("connect")}let{activeQuery:J}=this;if(this.activeQuery=null,this.readyForQuery=!0,J)J.handleReadyForQuery(this.connection);this._pulseQueryQueue()}_handleErrorWhileConnecting(Q){if(this._connectionError)return;if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(Q);this.emit("error",Q)}_handleErrorEvent(Q){if(this._connecting)return this._handleErrorWhileConnecting(Q);this._queryable=!1,this._errorAllQueries(Q),this.emit("error",Q)}_handleErrorMessage(Q){if(this._connecting)return this._handleErrorWhileConnecting(Q);let J=this.activeQuery;if(!J){this._handleErrorEvent(Q);return}this.activeQuery=null,J.handleError(Q,this.connection)}_handleRowDescription(Q){this.activeQuery.handleRowDescription(Q)}_handleDataRow(Q){this.activeQuery.handleDataRow(Q)}_handlePortalSuspended(Q){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(Q){this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(Q){if(this.activeQuery==null){let J=Error("Received unexpected commandComplete message from backend.");this._handleErrorEvent(J);return}this.activeQuery.handleCommandComplete(Q,this.connection)}_handleParseComplete(){if(this.activeQuery==null){let Q=Error("Received unexpected parseComplete message from backend.");this._handleErrorEvent(Q);return}if(this.activeQuery.name)this.connection.parsedStatements[this.activeQuery.name]=this.activeQuery.text}_handleCopyInResponse(Q){this.activeQuery.handleCopyInResponse(this.connection)}_handleCopyData(Q){this.activeQuery.handleCopyData(Q,this.connection)}_handleNotification(Q){this.emit("notification",Q)}_handleNotice(Q){this.emit("notice",Q)}getStartupConf(){let Q=this.connectionParameters,J={user:Q.user,database:Q.database},X=Q.application_name||Q.fallback_application_name;if(X)J.application_name=X;if(Q.replication)J.replication=""+Q.replication;if(Q.statement_timeout)J.statement_timeout=String(parseInt(Q.statement_timeout,10));if(Q.lock_timeout)J.lock_timeout=String(parseInt(Q.lock_timeout,10));if(Q.idle_in_transaction_session_timeout)J.idle_in_transaction_session_timeout=String(parseInt(Q.idle_in_transaction_session_timeout,10));if(Q.options)J.options=Q.options;return J}cancel(Q,J){if(Q.activeQuery===J){let X=this.connection;if(this.host&&this.host.indexOf("/")===0)X.connect(this.host+"/.s.PGSQL."+this.port);else X.connect(this.port,this.host);X.on("connect",function(){X.cancel(Q.processID,Q.secretKey)})}else if(Q.queryQueue.indexOf(J)!==-1)Q.queryQueue.splice(Q.queryQueue.indexOf(J),1)}setTypeParser(Q,J,X){return this._types.setTypeParser(Q,J,X)}getTypeParser(Q,J){return this._types.getTypeParser(Q,J)}escapeIdentifier(Q){return j20.escapeIdentifier(Q)}escapeLiteral(Q){return j20.escapeLiteral(Q)}_pulseQueryQueue(){if(this.readyForQuery===!0){if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery=!1,this.hasExecuted=!0;let Q=this.activeQuery.submit(this.connection);if(Q)process.nextTick(()=>{this.activeQuery.handleError(Q,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else if(this.hasExecuted)this.activeQuery=null,this.emit("drain")}}query(Q,J,X){let G,Y,W,$,K;if(Q===null||Q===void 0)throw TypeError("Client was passed a null or undefined query");else if(typeof Q.submit==="function"){if(W=Q.query_timeout||this.connectionParameters.query_timeout,Y=G=Q,typeof J==="function")G.callback=G.callback||J}else if(W=Q.query_timeout||this.connectionParameters.query_timeout,G=new I20(Q,J,X),!G.callback)Y=new this._Promise((Z,H)=>{G.callback=(q,F)=>q?H(q):Z(F)}).catch((Z)=>{throw Error.captureStackTrace(Z),Z});if(W)K=G.callback,$=setTimeout(()=>{let Z=Error("Query read timeout");process.nextTick(()=>{G.handleError(Z,this.connection)}),K(Z),G.callback=()=>{};let H=this.queryQueue.indexOf(G);if(H>-1)this.queryQueue.splice(H,1);this._pulseQueryQueue()},W),G.callback=(Z,H)=>{clearTimeout($),K(Z,H)};if(this.binary&&!G.binary)G.binary=!0;if(G._result&&!G._result._types)G._result._types=this._types;if(!this._queryable)return process.nextTick(()=>{G.handleError(Error("Client has encountered a connection error and is not queryable"),this.connection)}),Y;if(this._ending)return process.nextTick(()=>{G.handleError(Error("Client was closed and is not queryable"),this.connection)}),Y;return this.queryQueue.push(G),this._pulseQueryQueue(),Y}ref(){this.connection.ref()}unref(){this.connection.unref()}end(Q){if(this._ending=!0,!this.connection._connecting||this._ended)if(Q)Q();else return this._Promise.resolve();if(this.activeQuery||!this._queryable)this.connection.stream.destroy();else this.connection.end();if(Q)this.connection.once("end",Q);else return new this._Promise((J)=>{this.connection.once("end",J)})}}Pa.Query=I20;R20.exports=Pa});var h20=I((eV6,y20)=>{var Vd1=E0("events").EventEmitter,S20=function(){},v20=(Q,J)=>{let X=Q.findIndex(J);return X===-1?void 0:Q.splice(X,1)[0]};class k20{constructor(Q,J,X){this.client=Q,this.idleListener=J,this.timeoutId=X}}class UL{constructor(Q){this.callback=Q}}function zd1(){throw Error("Release called on client which has already been released to the pool.")}function rR(Q,J){if(J)return{callback:J,result:void 0};let X,G,Y=function($,K){$?X($):G(K)},W=new Q(function($,K){G=$,X=K}).catch(($)=>{throw Error.captureStackTrace($),$});return{callback:Y,result:W}}function Ud1(Q,J){return function X(G){G.client=J,J.removeListener("error",X),J.on("error",()=>{Q.log("additional client error after disconnection due to error",G)}),Q._remove(J),Q.emit("error",G,J)}}class _20 extends Vd1{constructor(Q,J){super();if(this.options=Object.assign({},Q),Q!=null&&"password"in Q)Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:Q.password});if(Q!=null&&Q.ssl&&Q.ssl.key)Object.defineProperty(this.options.ssl,"key",{enumerable:!1});if(this.options.max=this.options.max||this.options.poolSize||10,this.options.min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||J||Ma().Client,this.Promise=this.options.Promise||global.Promise,typeof this.options.idleTimeoutMillis>"u")this.options.idleTimeoutMillis=1e4;this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){return this._clients.length>this.options.min}_pulseQueue(){if(this.log("pulse queue"),this.ended){this.log("pulse queue ended");return}if(this.ending){if(this.log("pulse queue on ending"),this._idle.length)this._idle.slice().map((J)=>{this._remove(J.client)});if(!this._clients.length)this.ended=!0,this._endCallback();return}if(!this._pendingQueue.length){this.log("no queued requests");return}if(!this._idle.length&&this._isFull())return;let Q=this._pendingQueue.shift();if(this._idle.length){let J=this._idle.pop();clearTimeout(J.timeoutId);let X=J.client;X.ref&&X.ref();let G=J.idleListener;return this._acquireClient(X,Q,G,!1)}if(!this._isFull())return this.newClient(Q);throw Error("unexpected condition")}_remove(Q,J){let X=v20(this._idle,(Y)=>Y.client===Q);if(X!==void 0)clearTimeout(X.timeoutId);this._clients=this._clients.filter((Y)=>Y!==Q);let G=this;Q.end(()=>{if(G.emit("remove",Q),typeof J==="function")J()})}connect(Q){if(this.ending){let G=Error("Cannot use a pool after calling end on the pool");return Q?Q(G):this.Promise.reject(G)}let J=rR(this.Promise,Q),X=J.result;if(this._isFull()||this._idle.length){if(this._idle.length)process.nextTick(()=>this._pulseQueue());if(!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new UL(J.callback)),X;let G=($,K,Z)=>{clearTimeout(W),J.callback($,K,Z)},Y=new UL(G),W=setTimeout(()=>{v20(this._pendingQueue,($)=>$.callback===G),Y.timedOut=!0,J.callback(Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);if(W.unref)W.unref();return this._pendingQueue.push(Y),X}return this.newClient(new UL(J.callback)),X}newClient(Q){let J=new this.Client(this.options);this._clients.push(J);let X=Ud1(this,J);this.log("checking client timeout");let G,Y=!1;if(this.options.connectionTimeoutMillis)G=setTimeout(()=>{this.log("ending client due to timeout"),Y=!0,J.connection?J.connection.stream.destroy():J.end()},this.options.connectionTimeoutMillis);this.log("connecting new client"),J.connect((W)=>{if(G)clearTimeout(G);if(J.on("error",X),W){if(this.log("client failed to connect",W),this._clients=this._clients.filter(($)=>$!==J),Y)W=Error("Connection terminated due to connection timeout",{cause:W});if(this._pulseQueue(),!Q.timedOut)Q.callback(W,void 0,S20)}else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!==0){let $=setTimeout(()=>{if(this.log("ending client due to expired lifetime"),this._expired.add(J),this._idle.findIndex((Z)=>Z.client===J)!==-1)this._acquireClient(J,new UL((Z,H,q)=>q()),X,!1)},this.options.maxLifetimeSeconds*1000);$.unref(),J.once("end",()=>clearTimeout($))}return this._acquireClient(J,Q,X,!0)}})}_acquireClient(Q,J,X,G){if(G)this.emit("connect",Q);if(this.emit("acquire",Q),Q.release=this._releaseOnce(Q,X),Q.removeListener("error",X),!J.timedOut)if(G&&this.options.verify)this.options.verify(Q,(Y)=>{if(Y)return Q.release(Y),J.callback(Y,void 0,S20);J.callback(void 0,Q,Q.release)});else J.callback(void 0,Q,Q.release);else if(G&&this.options.verify)this.options.verify(Q,Q.release);else Q.release()}_releaseOnce(Q,J){let X=!1;return(G)=>{if(X)zd1();X=!0,this._release(Q,J,G)}}_release(Q,J,X){if(Q.on("error",J),Q._poolUseCount=(Q._poolUseCount||0)+1,this.emit("release",X,Q),X||this.ending||!Q._queryable||Q._ending||Q._poolUseCount>=this.options.maxUses){if(Q._poolUseCount>=this.options.maxUses)this.log("remove expended client");return this._remove(Q,this._pulseQueue.bind(this))}if(this._expired.has(Q))return this.log("remove expired client"),this._expired.delete(Q),this._remove(Q,this._pulseQueue.bind(this));let Y;if(this.options.idleTimeoutMillis&&this._isAboveMin()){if(Y=setTimeout(()=>{this.log("remove idle client"),this._remove(Q,this._pulseQueue.bind(this))},this.options.idleTimeoutMillis),this.options.allowExitOnIdle)Y.unref()}if(this.options.allowExitOnIdle)Q.unref();this._idle.push(new k20(Q,J,Y)),this._pulseQueue()}query(Q,J,X){if(typeof Q==="function"){let Y=rR(this.Promise,Q);return setImmediate(function(){return Y.callback(Error("Passing a function as the first parameter to pool.query is not supported"))}),Y.result}if(typeof J==="function")X=J,J=void 0;let G=rR(this.Promise,X);return X=G.callback,this.connect((Y,W)=>{if(Y)return X(Y);let $=!1,K=(Z)=>{if($)return;$=!0,W.release(Z),X(Z)};W.once("error",K),this.log("dispatching query");try{W.query(Q,J,(Z,H)=>{if(this.log("query dispatched"),W.removeListener("error",K),$)return;if($=!0,W.release(Z),Z)return X(Z);return X(void 0,H)})}catch(Z){return W.release(Z),X(Z)}}),G.result}end(Q){if(this.log("ending"),this.ending){let X=Error("Called end on pool more than once");return Q?Q(X):this.Promise.reject(X)}this.ending=!0;let J=rR(this.Promise,Q);return this._endCallback=J.callback,this._pulseQueue(),J.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((Q,J)=>Q+(this._expired.has(J)?1:0),0)}get totalCount(){return this._clients.length}}y20.exports=_20});var x20=I((Qz6,b20)=>{var f20=E0("events").EventEmitter,Nd1=E0("util"),Aa=Jz(),Kz=b20.exports=function(Q,J,X){f20.call(this),Q=Aa.normalizeQueryConfig(Q,J,X),this.text=Q.text,this.values=Q.values,this.name=Q.name,this.queryMode=Q.queryMode,this.callback=Q.callback,this.state="new",this._arrayMode=Q.rowMode==="array",this._emitRowEvents=!1,this.on("newListener",function(G){if(G==="row")this._emitRowEvents=!0}.bind(this))};Nd1.inherits(Kz,f20);var Bd1={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};Kz.prototype.handleError=function(Q){let J=this.native.pq.resultErrorFields();if(J)for(let X in J){let G=Bd1[X]||X;Q[G]=J[X]}if(this.callback)this.callback(Q);else this.emit("error",Q);this.state="error"};Kz.prototype.then=function(Q,J){return this._getPromise().then(Q,J)};Kz.prototype.catch=function(Q){return this._getPromise().catch(Q)};Kz.prototype._getPromise=function(){if(this._promise)return this._promise;return this._promise=new Promise(function(Q,J){this._once("end",Q),this._once("error",J)}.bind(this)),this._promise};Kz.prototype.submit=function(Q){this.state="running";let J=this;this.native=Q.native,Q.native.arrayMode=this._arrayMode;let X=function(G,Y,W){if(Q.native.arrayMode=!1,setImmediate(function(){J.emit("_done")}),G)return J.handleError(G);if(J._emitRowEvents)if(W.length>1)Y.forEach(($,K)=>{$.forEach((Z)=>{J.emit("row",Z,W[K])})});else Y.forEach(function($){J.emit("row",$,W)});if(J.state="end",J.emit("end",W),J.callback)J.callback(null,W)};if(process.domain)X=process.domain.bind(X);if(this.name){if(this.name.length>63)console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries");let G=(this.values||[]).map(Aa.prepareValue);if(Q.namedQueries[this.name]){if(this.text&&Q.namedQueries[this.name]!==this.text){let Y=Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);return X(Y)}return Q.native.execute(this.name,G,X)}return Q.native.prepare(this.name,this.text,G.length,function(Y){if(Y)return X(Y);return Q.namedQueries[J.name]=J.text,J.native.execute(J.name,G,X)})}else if(this.values){if(!Array.isArray(this.values)){let Y=Error("Query values must be an array");return X(Y)}let G=this.values.map(Aa.prepareValue);Q.native.query(this.text,G,X)}else if(this.queryMode==="extended")Q.native.query(this.text,[],X);else Q.native.query(this.text,X)}});var Ta=I((Jz6,l20)=>{var g20;try{g20=(()=>{throw new Error("Cannot require module "+"pg-native");})()}catch(Q){throw Q}var Od1=lR(),u20=E0("events").EventEmitter,Dd1=E0("util"),Ld1=Ha(),m20=x20(),GJ=l20.exports=function(Q){u20.call(this),Q=Q||{},this._Promise=Q.Promise||global.Promise,this._types=new Od1(Q.types),this.native=new g20({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;let J=this.connectionParameters=new Ld1(Q);if(Q.nativeConnectionString)J.nativeConnectionString=Q.nativeConnectionString;this.user=J.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:J.password}),this.database=J.database,this.host=J.host,this.port=J.port,this.namedQueries={}};GJ.Query=m20;Dd1.inherits(GJ,u20);GJ.prototype._errorAllQueries=function(Q){let J=(X)=>{process.nextTick(()=>{X.native=this.native,X.handleError(Q)})};if(this._hasActiveQuery())J(this._activeQuery),this._activeQuery=null;this._queryQueue.forEach(J),this._queryQueue.length=0};GJ.prototype._connect=function(Q){let J=this;if(this._connecting){process.nextTick(()=>Q(Error("Client has already been connected. You cannot reuse a client.")));return}this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(X,G){if(J.connectionParameters.nativeConnectionString)G=J.connectionParameters.nativeConnectionString;if(X)return Q(X);J.native.connect(G,function(Y){if(Y)return J.native.end(),Q(Y);J._connected=!0,J.native.on("error",function(W){J._queryable=!1,J._errorAllQueries(W),J.emit("error",W)}),J.native.on("notification",function(W){J.emit("notification",{channel:W.relname,payload:W.extra})}),J.emit("connect"),J._pulseQueryQueue(!0),Q()})})};GJ.prototype.connect=function(Q){if(Q){this._connect(Q);return}return new this._Promise((J,X)=>{this._connect((G)=>{if(G)X(G);else J()})})};GJ.prototype.query=function(Q,J,X){let G,Y,W,$,K;if(Q===null||Q===void 0)throw TypeError("Client was passed a null or undefined query");else if(typeof Q.submit==="function"){if(W=Q.query_timeout||this.connectionParameters.query_timeout,Y=G=Q,typeof J==="function")Q.callback=J}else if(W=Q.query_timeout||this.connectionParameters.query_timeout,G=new m20(Q,J,X),!G.callback){let Z,H;Y=new this._Promise((q,F)=>{Z=q,H=F}).catch((q)=>{throw Error.captureStackTrace(q),q}),G.callback=(q,F)=>q?H(q):Z(F)}if(W)K=G.callback,$=setTimeout(()=>{let Z=Error("Query read timeout");process.nextTick(()=>{G.handleError(Z,this.connection)}),K(Z),G.callback=()=>{};let H=this._queryQueue.indexOf(G);if(H>-1)this._queryQueue.splice(H,1);this._pulseQueryQueue()},W),G.callback=(Z,H)=>{clearTimeout($),K(Z,H)};if(!this._queryable)return G.native=this.native,process.nextTick(()=>{G.handleError(Error("Client has encountered a connection error and is not queryable"))}),Y;if(this._ending)return G.native=this.native,process.nextTick(()=>{G.handleError(Error("Client was closed and is not queryable"))}),Y;return this._queryQueue.push(G),this._pulseQueryQueue(),Y};GJ.prototype.end=function(Q){let J=this;if(this._ending=!0,!this._connected)this.once("connect",this.end.bind(this,Q));let X;if(!Q)X=new this._Promise(function(G,Y){Q=(W)=>W?Y(W):G()});return this.native.end(function(){J._errorAllQueries(Error("Connection terminated")),process.nextTick(()=>{if(J.emit("end"),Q)Q()})}),X};GJ.prototype._hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};GJ.prototype._pulseQueryQueue=function(Q){if(!this._connected)return;if(this._hasActiveQuery())return;let J=this._queryQueue.shift();if(!J){if(!Q)this.emit("drain");return}this._activeQuery=J,J.submit(this);let X=this;J.once("_done",function(){X._pulseQueryQueue()})};GJ.prototype.cancel=function(Q){if(this._activeQuery===Q)this.native.cancel(function(){});else if(this._queryQueue.indexOf(Q)!==-1)this._queryQueue.splice(this._queryQueue.indexOf(Q),1)};GJ.prototype.ref=function(){};GJ.prototype.unref=function(){};GJ.prototype.setTypeParser=function(Q,J,X){return this._types.setTypeParser(Q,J,X)};GJ.prototype.getTypeParser=function(Q,J){return this._types.getTypeParser(Q,J)}});var Ma=I((Xz6,NL)=>{var wd1=C20(),Pd1=FL(),Md1=Ba(),Ad1=qa(),Td1=Jz(),Ed1=h20(),jd1=lR(),{DatabaseError:Id1}=Na(),{escapeIdentifier:Rd1,escapeLiteral:Cd1}=Jz(),Sd1=(Q)=>{return class extends Ed1{constructor(X){super(X,Q)}}},Ea=function(Q){this.defaults=Pd1,this.Client=Q,this.Query=this.Client.Query,this.Pool=Sd1(this.Client),this._pools=[],this.Connection=Md1,this.types=qL(),this.DatabaseError=Id1,this.TypeOverrides=jd1,this.escapeIdentifier=Rd1,this.escapeLiteral=Cd1,this.Result=Ad1,this.utils=Td1};if(typeof process.env.NODE_PG_FORCE_NATIVE<"u")NL.exports=new Ea(Ta());else NL.exports=new Ea(wd1),Object.defineProperty(NL.exports,"native",{configurable:!0,enumerable:!1,get(){let Q=null;try{Q=new Ea(Ta())}catch(J){if(J.code!=="MODULE_NOT_FOUND")throw J}return Object.defineProperty(NL.exports,"native",{value:Q}),Q}})});var uX,Yz6,ja,Gz6,Wz6,$z6,Kz6,Zz6,Hz6,qz6,Fz6,Vz6;var d20=_(()=>{uX=f4(Ma(),1),Yz6=uX.default.Client,ja=uX.default.Pool,Gz6=uX.default.Connection,Wz6=uX.default.types,$z6=uX.default.Query,Kz6=uX.default.DatabaseError,Zz6=uX.default.escapeIdentifier,Hz6=uX.default.escapeLiteral,qz6=uX.default.Result,Fz6=uX.default.TypeOverrides,Vz6=uX.default.defaults});import{existsSync as vd1,mkdirSync as kd1}from"fs";import{Kysely as c20,PostgresDialect as n20,sql as p20}from"kysely";import{BunWorkerDialect as i20}from"kysely-bun-worker";import*as r20 from"path";function _d1(Q){let J=new ja({connectionString:Q.connectionString,max:Q.options?.maxConnections||10,ssl:process.env.DATABASE_PG_SSL==="true"?!0:!1}),X=new n20({pool:J});return{type:"postgres",db:new c20({dialect:X}),pool:J}}function a20(Q){if(Q===":memory:")return":memory:";if(Q.includes("://"))return new URL(Q).pathname;return Q}function o20(Q){if(Q!==":memory:"&&Q!=="/"&&Q){let J=Q.substring(0,Q.lastIndexOf("/"));if(J&&J!=="/"&&!vd1(J))try{kd1(J,{recursive:!0})}catch{return console.warn(`Failed to create directory ${J}, using in-memory database`),":memory:"}}return Q}function yd1(Q){let J=a20(Q.connectionString);J=o20(J);let X=new i20({url:J||":memory:"}),G=new c20({dialect:X});if(J!==":memory:"&&Q.options?.enableWAL!==!1)p20`PRAGMA journal_mode = WAL;`.execute(G).catch(()=>{});if(J!==":memory:"){let Y=Q.options?.busyTimeout||5000;p20`PRAGMA busy_timeout = ${Y};`.execute(G).catch(()=>{})}return{type:"sqlite",db:G}}function s20(Q){let J=Q||"file:./data/mesh.db";if(J===":memory:")return{type:"sqlite",connectionString:":memory:"};J=J.startsWith("/")?`file://${J}`:J;let X=URL.canParse(J)?new URL(J):null,G=X?.protocol.replace(":","")??J.split("://")[0];switch(G){case"postgres":case"postgresql":return{type:"postgres",connectionString:J};case"sqlite":case"file":if(!X?.pathname)throw Error("Invalid database URL: "+J);return{type:"sqlite",connectionString:X.pathname};default:throw Error(`Unsupported database protocol: ${G}. Supported protocols: postgres://, postgresql://, sqlite://, file://`)}}function Ra(){return process.env.DATABASE_URL||`file:${r20.join(process.cwd(),"data/mesh.db")}`}function t20(Q){let J=s20(Q);if(J.type==="postgres")return new n20({pool:new ja({connectionString:J.connectionString,max:J.options?.maxConnections||10,ssl:process.env.DATABASE_PG_SSL==="true"?!0:!1})});let X=a20(J.connectionString);return X=o20(X),new i20({url:X||":memory:"})}function hd1(Q){let J=s20(Q);if(J.type==="postgres")return _d1(J);return yd1(J)}async function Ca(Q){if(await Q.db.destroy(),Q.type==="postgres"&&!Q.pool.ended)await Q.pool.end()}function KH(){if(!Ia)Ia=hd1(Ra());return Ia}var Ia=null;var BL=_(()=>{d20()});class Sa{apiKey;constructor(Q){this.apiKey=Q}async sendEmail({to:Q,from:J,subject:X,html:G}){let Y=await fetch("https://api.resend.com/emails",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({to:Q,from:J,subject:X,html:G})});if(!Y.ok)throw Error(`Failed to send email: ${Y.statusText}`)}}class va{apiKey;constructor(Q){this.apiKey=Q}async sendEmail({to:Q,from:J,subject:X,html:G}){let Y=await fetch("https://api.sendgrid.com/v3/mail/send",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({personalizations:[{to:[{email:Q}]}],from:{email:J},subject:X,content:[{type:"text/html",value:G}]})});if(!Y.ok){let W=await Y.text();throw Error(`Failed to send email via SendGrid: ${Y.statusText} - ${W}`)}}}function aR(Q){let J=xd1[Q.provider];if(!J)throw Error(`Unknown email provider: ${Q.provider}`);return J(Q)}function oR(Q,J){return Q.find((X)=>X.id===J)}var fd1=(Q)=>{let J=new Sa(Q.config.apiKey);return async({to:X,subject:G,html:Y})=>{await J.sendEmail({to:X,from:Q.config.fromEmail,subject:G,html:Y})}},bd1=(Q)=>{let J=new va(Q.config.apiKey);return async({to:X,subject:G,html:Y})=>{await J.sendEmail({to:X,from:Q.config.fromEmail,subject:G,html:Y})}},xd1;var ka=_(()=>{xd1={resend:fd1,sendgrid:bd1}});var e20=(Q,J)=>{let X=oR(J,Q.emailProviderId);if(!X)throw Error(`Email provider with id '${Q.emailProviderId}' not found`);let G=aR(X);return{sendMagicLink:async({email:Y,url:W})=>{await G({to:Y,subject:"Magic Link",html:`<p>Click <a href="${W}">here</a> to login</p>`})}}};var QA0=_(()=>{ka()});function JA0(){return{id:IY.COMMUNITY_REGISTRY,title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function XA0(Q){return{id:IY.SELF,title:"Mesh MCP",description:"The MCP for the mesh API",connection_type:"HTTP",connection_url:`${Q}/mcp`,icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"@deco/management-mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:Zz.SELF}}}var IY,Zz;var ZH=_(()=>{IY={SELF:"self",REGISTRY:"registry",COMMUNITY_REGISTRY:"community-registry"},Zz={SELF:(Q)=>`${Q}_${IY.SELF}`,REGISTRY:(Q)=>`${Q}_${IY.REGISTRY}`,COMMUNITY_REGISTRY:(Q)=>`${Q}_${IY.COMMUNITY_REGISTRY}`}});import{createCipheriv as gd1,createDecipheriv as ud1,randomBytes as YA0}from"crypto";class DL{key;constructor(Q){if(Buffer.from(Q,"base64").length===$A0)this.key=Buffer.from(Q,"base64");else{let J=E0("crypto");this.key=J.createHash("sha256").update(Q).digest()}}async encrypt(Q){let J=YA0(OL),X=gd1(GA0,this.key,J),G=X.update(Q,"utf8");G=Buffer.concat([G,X.final()]);let Y=X.getAuthTag();return Buffer.concat([J,Y,G]).toString("base64")}async decrypt(Q){let J=Buffer.from(Q,"base64"),X=J.subarray(0,OL),G=J.subarray(OL,OL+WA0),Y=J.subarray(OL+WA0),W=ud1(GA0,this.key,X);W.setAuthTag(G);let $=W.update(Y);return $=Buffer.concat([$,W.final()]),$.toString("utf8")}static generateKey(){return YA0($A0).toString("base64")}}var GA0="aes-256-gcm",OL=16,WA0=16,$A0=32;var _a=()=>{};var KA0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";import{webcrypto as ZA0}from"crypto";function ld1(Q){if(!HH||HH.length<Q)HH=Buffer.allocUnsafe(Q*md1),ZA0.getRandomValues(HH),Hz=0;else if(Hz+Q>HH.length)ZA0.getRandomValues(HH),Hz=0;Hz+=Q}function HA0(Q=21){ld1(Q|=0);let J="";for(let X=Hz-Q;X<Hz;X++)J+=KA0[HH[X]&63];return J}var md1=128,HH,Hz;var qA0=()=>{};function r7(Q){return`${Q}_${HA0()}`}var sR=_(()=>{qA0()});class LL{db;vault;constructor(Q,J){this.db=Q;this.vault=J}async create(Q){let J=Q.id??r7("conn"),X=new Date().toISOString();if(await this.findById(J))return this.update(J,Q);let Y=await this.serializeConnection({...Q,id:Q.id??J,status:"active",created_at:X,updated_at:X});await this.db.insertInto("connections").values(Y).execute();let W=await this.findById(J);if(!W)throw Error(`Failed to create connection with id: ${J}`);return W}async findById(Q,J){let X=this.db.selectFrom("connections").selectAll().where("id","=",Q);if(J)X=X.where("organization_id","=",J);let G=await X.executeTakeFirst();return G?this.deserializeConnection(G):null}async list(Q){let J=await this.db.selectFrom("connections").selectAll().where("organization_id","=",Q).execute();return Promise.all(J.map((X)=>this.deserializeConnection(X)))}async update(Q,J){if(Object.keys(J).length===0){let Y=await this.findById(Q);if(!Y)throw Error("Connection not found");return Y}let X=await this.serializeConnection({...J,updated_at:new Date().toISOString()});await this.db.updateTable("connections").set(X).where("id","=",Q).execute();let G=await this.findById(Q);if(!G)throw Error("Connection not found after update");return G}async delete(Q){await this.db.deleteFrom("connections").where("id","=",Q).execute()}async testConnection(Q,J){let X=await this.findById(Q);if(!X)throw Error("Connection not found");let G=Date.now();try{let Y=await fetch(X.connection_url,{method:"POST",headers:{"Content-Type":"application/json",...X.connection_token&&{Authorization:`Bearer ${X.connection_token}`},...J},body:JSON.stringify({jsonrpc:"2.0",method:"ping",id:1})});return{healthy:Y.ok||Y.status===404,latencyMs:Date.now()-G}}catch{return{healthy:!1,latencyMs:Date.now()-G}}}async serializeConnection(Q){let J={};for(let[X,G]of Object.entries(Q)){if(G===void 0)continue;if(X==="connection_token"&&G)J[X]=await this.vault.encrypt(G);else if(X==="configuration_state"&&G){let Y=JSON.stringify(G);J[X]=await this.vault.encrypt(Y)}else if(dd1.includes(X))J[X]=G?JSON.stringify(G):null;else J[X]=G}return J}async deserializeConnection(Q){let J=null;if(Q.connection_token)try{J=await this.vault.decrypt(Q.connection_token)}catch(Y){console.error("Failed to decrypt connection token:",Y)}let X=null;if(Q.configuration_state)try{let Y=await this.vault.decrypt(Q.configuration_state);X=JSON.parse(Y)}catch(Y){console.error("Failed to decrypt configuration state:",Y)}let G=(Y)=>{if(Y===null)return null;if(typeof Y==="string")try{return JSON.parse(Y)}catch{return null}return Y};return{id:Q.id,organization_id:Q.organization_id,created_by:Q.created_by,title:Q.title,description:Q.description,icon:Q.icon,app_name:Q.app_name,app_id:Q.app_id,connection_type:Q.connection_type,connection_url:Q.connection_url,connection_token:J,connection_headers:G(Q.connection_headers),oauth_config:G(Q.oauth_config),configuration_state:X,configuration_scopes:G(Q.configuration_scopes),metadata:G(Q.metadata),tools:G(Q.tools),bindings:G(Q.bindings),status:Q.status,created_at:Q.created_at,updated_at:Q.updated_at}}}var dd1;var ya=_(()=>{sR();dd1=["connection_headers","oauth_config","configuration_scopes","metadata","tools","bindings"]});class wL{db;constructor(Q){this.db=Q}async create(Q,J,X){let G=r7("gw"),Y=new Date().toISOString();if(X.isDefault)return await this.db.transaction().execute(async($)=>{if(await $.updateTable("gateways").set({is_default:0,updated_at:Y,updated_by:J}).where("organization_id","=",Q).where("is_default","=",1).execute(),await $.insertInto("gateways").values({id:G,organization_id:Q,title:X.title,description:X.description??null,tool_selection_strategy:X.toolSelectionStrategy??"passthrough",tool_selection_mode:X.toolSelectionMode??"inclusion",icon:X.icon??null,status:X.status??"active",is_default:1,created_at:Y,updated_at:Y,created_by:J,updated_by:null}).execute(),X.connections.length>0)await $.insertInto("gateway_connections").values(X.connections.map((Z)=>({id:r7("gwc"),gateway_id:G,connection_id:Z.connectionId,selected_tools:Z.selectedTools?JSON.stringify(Z.selectedTools):null,created_at:Y}))).execute();let K=await this.findByIdInternal($,G);if(!K)throw Error(`Failed to create gateway with id: ${G}`);return K});if(await this.db.insertInto("gateways").values({id:G,organization_id:Q,title:X.title,description:X.description??null,tool_selection_strategy:X.toolSelectionStrategy??"passthrough",tool_selection_mode:X.toolSelectionMode??"inclusion",icon:X.icon??null,status:X.status??"active",is_default:0,created_at:Y,updated_at:Y,created_by:J,updated_by:null}).execute(),X.connections.length>0)await this.db.insertInto("gateway_connections").values(X.connections.map(($)=>({id:r7("gwc"),gateway_id:G,connection_id:$.connectionId,selected_tools:$.selectedTools?JSON.stringify($.selectedTools):null,created_at:Y}))).execute();let W=await this.findById(G);if(!W)throw Error(`Failed to create gateway with id: ${G}`);return W}async findById(Q){return this.findByIdInternal(this.db,Q)}async findByIdInternal(Q,J){let X=await Q.selectFrom("gateways").selectAll().where("id","=",J).executeTakeFirst();if(!X)return null;let G=await Q.selectFrom("gateway_connections").selectAll().where("gateway_id","=",J).execute();return this.deserializeGatewayWithConnections(X,G)}async list(Q){let J=await this.db.selectFrom("gateways").selectAll().where("organization_id","=",Q).execute(),X=J.map((W)=>W.id);if(X.length===0)return[];let G=await this.db.selectFrom("gateway_connections").selectAll().where("gateway_id","in",X).execute(),Y=new Map;for(let W of G){let $=Y.get(W.gateway_id)??[];$.push(W),Y.set(W.gateway_id,$)}return J.map((W)=>this.deserializeGatewayWithConnections(W,Y.get(W.id)??[]))}async listByConnectionId(Q,J){let G=(await this.db.selectFrom("gateway_connections").select("gateway_id").where("connection_id","=",J).execute()).map((Z)=>Z.gateway_id);if(G.length===0)return[];let Y=await this.db.selectFrom("gateways").selectAll().where("id","in",G).where("organization_id","=",Q).execute();if(Y.length===0)return[];let W=Y.map((Z)=>Z.id),$=await this.db.selectFrom("gateway_connections").selectAll().where("gateway_id","in",W).execute(),K=new Map;for(let Z of $){let H=K.get(Z.gateway_id)??[];H.push(Z),K.set(Z.gateway_id,H)}return Y.map((Z)=>this.deserializeGatewayWithConnections(Z,K.get(Z.id)??[]))}async update(Q,J,X){let G=new Date().toISOString(),Y={updated_at:G,updated_by:J};if(X.title!==void 0)Y.title=X.title;if(X.description!==void 0)Y.description=X.description;if(X.toolSelectionStrategy!==void 0)Y.tool_selection_strategy=X.toolSelectionStrategy;if(X.toolSelectionMode!==void 0)Y.tool_selection_mode=X.toolSelectionMode;if(X.icon!==void 0)Y.icon=X.icon;if(X.status!==void 0)Y.status=X.status;if(X.isDefault===!1)Y.is_default=0;if(X.isDefault===!0)Y.is_default=1;if(X.isDefault===!0){let $=await this.findById(Q);if(!$)throw Error(`Gateway not found: ${Q}`);await this.db.transaction().execute(async(K)=>{if(await K.updateTable("gateways").set({is_default:0,updated_at:G,updated_by:J}).where("organization_id","=",$.organizationId).where("is_default","=",1).execute(),await K.updateTable("gateways").set(Y).where("id","=",Q).execute(),X.connections!==void 0){if(await K.deleteFrom("gateway_connections").where("gateway_id","=",Q).execute(),X.connections.length>0)await K.insertInto("gateway_connections").values(X.connections.map((Z)=>({id:r7("gwc"),gateway_id:Q,connection_id:Z.connectionId,selected_tools:Z.selectedTools?JSON.stringify(Z.selectedTools):null,created_at:G}))).execute()}})}else if(await this.db.updateTable("gateways").set(Y).where("id","=",Q).execute(),X.connections!==void 0){if(await this.db.deleteFrom("gateway_connections").where("gateway_id","=",Q).execute(),X.connections.length>0)await this.db.insertInto("gateway_connections").values(X.connections.map(($)=>({id:r7("gwc"),gateway_id:Q,connection_id:$.connectionId,selected_tools:$.selectedTools?JSON.stringify($.selectedTools):null,created_at:G}))).execute()}let W=await this.findById(Q);if(!W)throw Error("Gateway not found after update");return W}async delete(Q){await this.db.deleteFrom("gateways").where("id","=",Q).execute()}async getDefaultByOrgId(Q){let J=await this.db.selectFrom("gateways").selectAll().where("organization_id","=",Q).where("is_default","=",1).executeTakeFirst();if(!J)return null;let X=await this.db.selectFrom("gateway_connections").selectAll().where("gateway_id","=",J.id).execute();return this.deserializeGatewayWithConnections(J,X)}async getDefaultByOrgSlug(Q){let J=await this.db.selectFrom("organization").select("id").where("slug","=",Q).executeTakeFirst();if(!J)return null;return this.getDefaultByOrgId(J.id)}async setDefault(Q,J){let X=await this.findById(Q);if(!X)throw Error(`Gateway not found: ${Q}`);let G=new Date().toISOString();await this.db.transaction().execute(async(W)=>{await W.updateTable("gateways").set({is_default:0,updated_at:G,updated_by:J}).where("organization_id","=",X.organizationId).where("is_default","=",1).execute(),await W.updateTable("gateways").set({is_default:1,updated_at:G,updated_by:J}).where("id","=",Q).execute()});let Y=await this.findById(Q);if(!Y)throw Error("Gateway not found after setting default");return Y}deserializeGatewayWithConnections(Q,J){return{...this.deserializeGateway(Q),connections:J.map((G)=>({connectionId:G.connection_id,selectedTools:this.parseJson(G.selected_tools)}))}}deserializeGateway(Q){return{id:Q.id,organizationId:Q.organization_id,title:Q.title,description:Q.description,toolSelectionStrategy:this.parseToolSelectionStrategy(Q.tool_selection_strategy),toolSelectionMode:this.parseToolSelectionMode(Q.tool_selection_mode),icon:Q.icon,status:Q.status,isDefault:Q.is_default===1,createdAt:Q.created_at,updatedAt:Q.updated_at,createdBy:Q.created_by,updatedBy:Q.updated_by}}parseToolSelectionStrategy(Q){if(Q==="smart_tool_selection")return"smart_tool_selection";if(Q==="code_execution")return"code_execution";return"passthrough"}parseToolSelectionMode(Q){if(Q==="exclusion")return"exclusion";return"inclusion"}parseJson(Q){if(Q===null)return null;if(typeof Q==="string")try{return JSON.parse(Q)}catch{return null}return Q}}var ha=_(()=>{sR()});var k4,fa,W1,a7=(Q)=>{switch(typeof Q){case"undefined":return W1.undefined;case"string":return W1.string;case"number":return Number.isNaN(Q)?W1.nan:W1.number;case"boolean":return W1.boolean;case"function":return W1.function;case"bigint":return W1.bigint;case"symbol":return W1.symbol;case"object":if(Array.isArray(Q))return W1.array;if(Q===null)return W1.null;if(Q.then&&typeof Q.then==="function"&&Q.catch&&typeof Q.catch==="function")return W1.promise;if(typeof Map<"u"&&Q instanceof Map)return W1.map;if(typeof Set<"u"&&Q instanceof Set)return W1.set;if(typeof Date<"u"&&Q instanceof Date)return W1.date;return W1.object;default:return W1.unknown}};var PL=_(()=>{(function(Q){Q.assertEqual=(Y)=>{};function J(Y){}Q.assertIs=J;function X(Y){throw Error()}Q.assertNever=X,Q.arrayToEnum=(Y)=>{let W={};for(let $ of Y)W[$]=$;return W},Q.getValidEnumValues=(Y)=>{let W=Q.objectKeys(Y).filter((K)=>typeof Y[Y[K]]!=="number"),$={};for(let K of W)$[K]=Y[K];return Q.objectValues($)},Q.objectValues=(Y)=>{return Q.objectKeys(Y).map(function(W){return Y[W]})},Q.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let W=[];for(let $ in Y)if(Object.prototype.hasOwnProperty.call(Y,$))W.push($);return W},Q.find=(Y,W)=>{for(let $ of Y)if(W($))return $;return},Q.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&Number.isFinite(Y)&&Math.floor(Y)===Y;function G(Y,W=" | "){return Y.map(($)=>typeof $==="string"?`'${$}'`:$).join(W)}Q.joinValues=G,Q.jsonStringifyReplacer=(Y,W)=>{if(typeof W==="bigint")return W.toString();return W}})(k4||(k4={}));(function(Q){Q.mergeShapes=(J,X)=>{return{...J,...X}}})(fa||(fa={}));W1=k4.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var s0,pd1=(Q)=>{return JSON.stringify(Q,null,2).replace(/"([^"]+)":/g,"$1:")},WJ;var tR=_(()=>{PL();s0=k4.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);WJ=class WJ extends Error{get errors(){return this.issues}constructor(Q){super();this.issues=[],this.addIssue=(X)=>{this.issues=[...this.issues,X]},this.addIssues=(X=[])=>{this.issues=[...this.issues,...X]};let J=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,J);else this.__proto__=J;this.name="ZodError",this.issues=Q}format(Q){let J=Q||function(Y){return Y.message},X={_errors:[]},G=(Y)=>{for(let W of Y.issues)if(W.code==="invalid_union")W.unionErrors.map(G);else if(W.code==="invalid_return_type")G(W.returnTypeError);else if(W.code==="invalid_arguments")G(W.argumentsError);else if(W.path.length===0)X._errors.push(J(W));else{let $=X,K=0;while(K<W.path.length){let Z=W.path[K];if(K!==W.path.length-1)$[Z]=$[Z]||{_errors:[]};else $[Z]=$[Z]||{_errors:[]},$[Z]._errors.push(J(W));$=$[Z],K++}}};return G(this),X}static assert(Q){if(!(Q instanceof WJ))throw Error(`Not a ZodError: ${Q}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,k4.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(Q=(J)=>J.message){let J={},X=[];for(let G of this.issues)if(G.path.length>0){let Y=G.path[0];J[Y]=J[Y]||[],J[Y].push(Q(G))}else X.push(Q(G));return{formErrors:X,fieldErrors:J}}get formErrors(){return this.flatten()}};WJ.create=(Q)=>{return new WJ(Q)}});var cd1=(Q,J)=>{let X;switch(Q.code){case s0.invalid_type:if(Q.received===W1.undefined)X="Required";else X=`Expected ${Q.expected}, received ${Q.received}`;break;case s0.invalid_literal:X=`Invalid literal value, expected ${JSON.stringify(Q.expected,k4.jsonStringifyReplacer)}`;break;case s0.unrecognized_keys:X=`Unrecognized key(s) in object: ${k4.joinValues(Q.keys,", ")}`;break;case s0.invalid_union:X="Invalid input";break;case s0.invalid_union_discriminator:X=`Invalid discriminator value. Expected ${k4.joinValues(Q.options)}`;break;case s0.invalid_enum_value:X=`Invalid enum value. Expected ${k4.joinValues(Q.options)}, received '${Q.received}'`;break;case s0.invalid_arguments:X="Invalid function arguments";break;case s0.invalid_return_type:X="Invalid function return type";break;case s0.invalid_date:X="Invalid date";break;case s0.invalid_string:if(typeof Q.validation==="object")if("includes"in Q.validation){if(X=`Invalid input: must include "${Q.validation.includes}"`,typeof Q.validation.position==="number")X=`${X} at one or more positions greater than or equal to ${Q.validation.position}`}else if("startsWith"in Q.validation)X=`Invalid input: must start with "${Q.validation.startsWith}"`;else if("endsWith"in Q.validation)X=`Invalid input: must end with "${Q.validation.endsWith}"`;else k4.assertNever(Q.validation);else if(Q.validation!=="regex")X=`Invalid ${Q.validation}`;else X="Invalid";break;case s0.too_small:if(Q.type==="array")X=`Array must contain ${Q.exact?"exactly":Q.inclusive?"at least":"more than"} ${Q.minimum} element(s)`;else if(Q.type==="string")X=`String must contain ${Q.exact?"exactly":Q.inclusive?"at least":"over"} ${Q.minimum} character(s)`;else if(Q.type==="number")X=`Number must be ${Q.exact?"exactly equal to ":Q.inclusive?"greater than or equal to ":"greater than "}${Q.minimum}`;else if(Q.type==="bigint")X=`Number must be ${Q.exact?"exactly equal to ":Q.inclusive?"greater than or equal to ":"greater than "}${Q.minimum}`;else if(Q.type==="date")X=`Date must be ${Q.exact?"exactly equal to ":Q.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(Q.minimum))}`;else X="Invalid input";break;case s0.too_big:if(Q.type==="array")X=`Array must contain ${Q.exact?"exactly":Q.inclusive?"at most":"less than"} ${Q.maximum} element(s)`;else if(Q.type==="string")X=`String must contain ${Q.exact?"exactly":Q.inclusive?"at most":"under"} ${Q.maximum} character(s)`;else if(Q.type==="number")X=`Number must be ${Q.exact?"exactly":Q.inclusive?"less than or equal to":"less than"} ${Q.maximum}`;else if(Q.type==="bigint")X=`BigInt must be ${Q.exact?"exactly":Q.inclusive?"less than or equal to":"less than"} ${Q.maximum}`;else if(Q.type==="date")X=`Date must be ${Q.exact?"exactly":Q.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(Q.maximum))}`;else X="Invalid input";break;case s0.custom:X="Invalid input";break;case s0.invalid_intersection_types:X="Intersection results could not be merged";break;case s0.not_multiple_of:X=`Number must be a multiple of ${Q.multipleOf}`;break;case s0.not_finite:X="Number must be finite";break;default:X=J.defaultError,k4.assertNever(Q)}return{message:X}},LW;var ba=_(()=>{tR();PL();LW=cd1});function nd1(Q){FA0=Q}function qz(){return FA0}var FA0;var eR=_(()=>{ba();FA0=LW});function B1(Q,J){let X=qz(),G=ML({issueData:J,data:Q.data,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,X,X===LW?void 0:LW].filter((Y)=>!!Y)});Q.common.issues.push(G)}class I5{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(Q,J){let X=[];for(let G of J){if(G.status==="aborted")return a1;if(G.status==="dirty")Q.dirty();X.push(G.value)}return{status:Q.value,value:X}}static async mergeObjectAsync(Q,J){let X=[];for(let G of J){let Y=await G.key,W=await G.value;X.push({key:Y,value:W})}return I5.mergeObjectSync(Q,X)}static mergeObjectSync(Q,J){let X={};for(let G of J){let{key:Y,value:W}=G;if(Y.status==="aborted")return a1;if(W.status==="aborted")return a1;if(Y.status==="dirty")Q.dirty();if(W.status==="dirty")Q.dirty();if(Y.value!=="__proto__"&&(typeof W.value<"u"||G.alwaysSet))X[Y.value]=W.value}return{status:Q.value,value:X}}}var ML=(Q)=>{let{data:J,path:X,errorMaps:G,issueData:Y}=Q,W=[...X,...Y.path||[]],$={...Y,path:W};if(Y.message!==void 0)return{...Y,path:W,message:Y.message};let K="",Z=G.filter((H)=>!!H).slice().reverse();for(let H of Z)K=H($,{data:J,defaultError:K}).message;return{...Y,path:W,message:K}},id1,a1,qH=(Q)=>({status:"dirty",value:Q}),QQ=(Q)=>({status:"valid",value:Q}),QC=(Q)=>Q.status==="aborted",JC=(Q)=>Q.status==="dirty",AK=(Q)=>Q.status==="valid",Fz=(Q)=>typeof Promise<"u"&&Q instanceof Promise;var xa=_(()=>{eR();ba();id1=[];a1=Object.freeze({status:"aborted"})});var VA0=()=>{};var y1;var zA0=_(()=>{(function(Q){Q.errToObj=(J)=>typeof J==="string"?{message:J}:J||{},Q.toString=(J)=>typeof J==="string"?J:J?.message})(y1||(y1={}))});class vY{constructor(Q,J,X,G){this._cachedPath=[],this.parent=Q,this.data=J,this._path=X,this._key=G}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function D4(Q){if(!Q)return{};let{errorMap:J,invalid_type_error:X,required_error:G,description:Y}=Q;if(J&&(X||G))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(J)return{errorMap:J,description:Y};return{errorMap:($,K)=>{let{message:Z}=Q;if($.code==="invalid_enum_value")return{message:Z??K.defaultError};if(typeof K.data>"u")return{message:Z??G??K.defaultError};if($.code!=="invalid_type")return{message:K.defaultError};return{message:Z??X??K.defaultError}},description:Y}}class P4{get description(){return this._def.description}_getType(Q){return a7(Q.data)}_getOrReturnCtx(Q,J){return J||{common:Q.parent.common,data:Q.data,parsedType:a7(Q.data),schemaErrorMap:this._def.errorMap,path:Q.path,parent:Q.parent}}_processInputParams(Q){return{status:new I5,ctx:{common:Q.parent.common,data:Q.data,parsedType:a7(Q.data),schemaErrorMap:this._def.errorMap,path:Q.path,parent:Q.parent}}}_parseSync(Q){let J=this._parse(Q);if(Fz(J))throw Error("Synchronous parse encountered promise.");return J}_parseAsync(Q){let J=this._parse(Q);return Promise.resolve(J)}parse(Q,J){let X=this.safeParse(Q,J);if(X.success)return X.data;throw X.error}safeParse(Q,J){let X={common:{issues:[],async:J?.async??!1,contextualErrorMap:J?.errorMap},path:J?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:Q,parsedType:a7(Q)},G=this._parseSync({data:Q,path:X.path,parent:X});return UA0(X,G)}"~validate"(Q){let J={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:Q,parsedType:a7(Q)};if(!this["~standard"].async)try{let X=this._parseSync({data:Q,path:[],parent:J});return AK(X)?{value:X.value}:{issues:J.common.issues}}catch(X){if(X?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;J.common={issues:[],async:!0}}return this._parseAsync({data:Q,path:[],parent:J}).then((X)=>AK(X)?{value:X.value}:{issues:J.common.issues})}async parseAsync(Q,J){let X=await this.safeParseAsync(Q,J);if(X.success)return X.data;throw X.error}async safeParseAsync(Q,J){let X={common:{issues:[],contextualErrorMap:J?.errorMap,async:!0},path:J?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:Q,parsedType:a7(Q)},G=this._parse({data:Q,path:X.path,parent:X}),Y=await(Fz(G)?G:Promise.resolve(G));return UA0(X,Y)}refine(Q,J){let X=(G)=>{if(typeof J==="string"||typeof J>"u")return{message:J};else if(typeof J==="function")return J(G);else return J};return this._refinement((G,Y)=>{let W=Q(G),$=()=>Y.addIssue({code:s0.custom,...X(G)});if(typeof Promise<"u"&&W instanceof Promise)return W.then((K)=>{if(!K)return $(),!1;else return!0});if(!W)return $(),!1;else return!0})}refinement(Q,J){return this._refinement((X,G)=>{if(!Q(X))return G.addIssue(typeof J==="function"?J(X,G):J),!1;else return!0})}_refinement(Q){return new kY({schema:this,typeName:k0.ZodEffects,effect:{type:"refinement",refinement:Q}})}superRefine(Q){return this._refinement(Q)}constructor(Q){this.spa=this.safeParseAsync,this._def=Q,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(J)=>this["~validate"](J)}}optional(){return SY.create(this,this._def)}nullable(){return PW.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return CY.create(this)}promise(){return UH.create(this,this._def)}or(Q){return Oz.create([this,Q],this._def)}and(Q){return Dz.create(this,Q,this._def)}transform(Q){return new kY({...D4(this._def),schema:this,typeName:k0.ZodEffects,effect:{type:"transform",transform:Q}})}default(Q){let J=typeof Q==="function"?Q:()=>Q;return new Mz({...D4(this._def),innerType:this,defaultValue:J,typeName:k0.ZodDefault})}brand(){return new YC({typeName:k0.ZodBranded,type:this,...D4(this._def)})}catch(Q){let J=typeof Q==="function"?Q:()=>Q;return new Az({...D4(this._def),innerType:this,catchValue:J,typeName:k0.ZodCatch})}describe(Q){return new this.constructor({...this._def,description:Q})}pipe(Q){return RL.create(this,Q)}readonly(){return Tz.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function OA0(Q){let J="[0-5]\\d";if(Q.precision)J=`${J}\\.\\d{${Q.precision}}`;else if(Q.precision==null)J=`${J}(\\.\\d+)?`;let X=Q.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${J})${X}`}function qp1(Q){return new RegExp(`^${OA0(Q)}$`)}function DA0(Q){let J=`${BA0}T${OA0(Q)}`,X=[];if(X.push(Q.local?"Z?":"Z"),Q.offset)X.push("([+-]\\d{2}:?\\d{2})");return J=`${J}(${X.join("|")})`,new RegExp(`^${J}$`)}function Fp1(Q,J){if((J==="v4"||!J)&&Yp1.test(Q))return!0;if((J==="v6"||!J)&&Wp1.test(Q))return!0;return!1}function Vp1(Q,J){if(!ed1.test(Q))return!1;try{let[X]=Q.split(".");if(!X)return!1;let G=X.replace(/-/g,"+").replace(/_/g,"/").padEnd(X.length+(4-X.length%4)%4,"="),Y=JSON.parse(atob(G));if(typeof Y!=="object"||Y===null)return!1;if("typ"in Y&&Y?.typ!=="JWT")return!1;if(!Y.alg)return!1;if(J&&Y.alg!==J)return!1;return!0}catch{return!1}}function zp1(Q,J){if((J==="v4"||!J)&&Gp1.test(Q))return!0;if((J==="v6"||!J)&&$p1.test(Q))return!0;return!1}function Up1(Q,J){let X=(Q.toString().split(".")[1]||"").length,G=(J.toString().split(".")[1]||"").length,Y=X>G?X:G,W=Number.parseInt(Q.toFixed(Y).replace(".","")),$=Number.parseInt(J.toFixed(Y).replace(".",""));return W%$/10**Y}function Vz(Q){if(Q instanceof c8){let J={};for(let X in Q.shape){let G=Q.shape[X];J[X]=SY.create(Vz(G))}return new c8({...Q._def,shape:()=>J})}else if(Q instanceof CY)return new CY({...Q._def,type:Vz(Q.element)});else if(Q instanceof SY)return SY.create(Vz(Q.unwrap()));else if(Q instanceof PW)return PW.create(Vz(Q.unwrap()));else if(Q instanceof s7)return s7.create(Q.items.map((J)=>Vz(J)));else return Q}function ua(Q,J){let X=a7(Q),G=a7(J);if(Q===J)return{valid:!0,data:Q};else if(X===W1.object&&G===W1.object){let Y=k4.objectKeys(J),W=k4.objectKeys(Q).filter((K)=>Y.indexOf(K)!==-1),$={...Q,...J};for(let K of W){let Z=ua(Q[K],J[K]);if(!Z.valid)return{valid:!1};$[K]=Z.data}return{valid:!0,data:$}}else if(X===W1.array&&G===W1.array){if(Q.length!==J.length)return{valid:!1};let Y=[];for(let W=0;W<Q.length;W++){let $=Q[W],K=J[W],Z=ua($,K);if(!Z.valid)return{valid:!1};Y.push(Z.data)}return{valid:!0,data:Y}}else if(X===W1.date&&G===W1.date&&+Q===+J)return{valid:!0,data:Q};else return{valid:!1}}function LA0(Q,J){return new IK({values:Q,typeName:k0.ZodEnum,...D4(J)})}function NA0(Q,J){let X=typeof Q==="function"?Q(J):typeof Q==="string"?{message:Q}:Q;return typeof X==="string"?{message:X}:X}function wA0(Q,J={},X){if(Q)return VH.create().superRefine((G,Y)=>{let W=Q(G);if(W instanceof Promise)return W.then(($)=>{if(!$){let K=NA0(J,G),Z=K.fatal??X??!0;Y.addIssue({code:"custom",...K,fatal:Z})}});if(!W){let $=NA0(J,G),K=$.fatal??X??!0;Y.addIssue({code:"custom",...$,fatal:K})}return});return VH.create()}var UA0=(Q,J)=>{if(AK(J))return{success:!0,data:J.value};else{if(!Q.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let X=new WJ(Q.common.issues);return this._error=X,this._error}}}},rd1,ad1,od1,sd1,td1,ed1,Qp1,Jp1,Xp1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ga,Yp1,Gp1,Wp1,$p1,Kp1,Zp1,BA0="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Hp1,RY,EK,jK,Uz,FH,AL,Nz,Bz,VH,TK,o7,TL,CY,c8,Oz,wW=(Q)=>{if(Q instanceof Lz)return wW(Q.schema);else if(Q instanceof kY)return wW(Q.innerType());else if(Q instanceof wz)return[Q.value];else if(Q instanceof IK)return Q.options;else if(Q instanceof Pz)return k4.objectValues(Q.enum);else if(Q instanceof Mz)return wW(Q._def.innerType);else if(Q instanceof Nz)return[void 0];else if(Q instanceof Bz)return[null];else if(Q instanceof SY)return[void 0,...wW(Q.unwrap())];else if(Q instanceof PW)return[null,...wW(Q.unwrap())];else if(Q instanceof YC)return wW(Q.unwrap());else if(Q instanceof Tz)return wW(Q.unwrap());else if(Q instanceof Az)return wW(Q._def.innerType);else return[]},XC,Dz,s7,EL,jL,zH,zz,Lz,wz,IK,Pz,UH,kY,SY,PW,Mz,Az,IL,Np1,YC,RL,Tz,Bp1,k0,Op1=(Q,J={message:`Input not instance of ${Q.name}`})=>wA0((X)=>X instanceof Q,J),PA0,MA0,Dp1,Lp1,AA0,wp1,Pp1,Mp1,Ap1,Tp1,Ep1,jp1,Ip1,Rp1,Cp1,Sp1,vp1,kp1,_p1,yp1,hp1,fp1,bp1,xp1,gp1,up1,mp1,lp1,dp1,pp1,cp1,np1,ip1,rp1,ap1=()=>PA0().optional(),op1=()=>MA0().optional(),sp1=()=>AA0().optional(),tp1,ep1;var TA0=_(()=>{tR();eR();zA0();xa();PL();rd1=/^c[^\s-]{8,}$/i,ad1=/^[0-9a-z]+$/,od1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,sd1=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,td1=/^[a-z0-9_-]{21}$/i,ed1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qp1=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Jp1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yp1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gp1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Wp1=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,$p1=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Kp1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Zp1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Hp1=new RegExp(`^${BA0}$`);RY=class RY extends P4{_parse(Q){if(this._def.coerce)Q.data=String(Q.data);if(this._getType(Q)!==W1.string){let Y=this._getOrReturnCtx(Q);return B1(Y,{code:s0.invalid_type,expected:W1.string,received:Y.parsedType}),a1}let X=new I5,G=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(Q.data.length<Y.value)G=this._getOrReturnCtx(Q,G),B1(G,{code:s0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="max"){if(Q.data.length>Y.value)G=this._getOrReturnCtx(Q,G),B1(G,{code:s0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),X.dirty()}else if(Y.kind==="length"){let W=Q.data.length>Y.value,$=Q.data.length<Y.value;if(W||$){if(G=this._getOrReturnCtx(Q,G),W)B1(G,{code:s0.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if($)B1(G,{code:s0.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});X.dirty()}}else if(Y.kind==="email"){if(!Jp1.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"email",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="emoji"){if(!ga)ga=new RegExp(Xp1,"u");if(!ga.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"emoji",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="uuid"){if(!sd1.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"uuid",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="nanoid"){if(!td1.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"nanoid",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="cuid"){if(!rd1.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"cuid",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="cuid2"){if(!ad1.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"cuid2",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="ulid"){if(!od1.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"ulid",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="url")try{new URL(Q.data)}catch{G=this._getOrReturnCtx(Q,G),B1(G,{validation:"url",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="regex"){if(Y.regex.lastIndex=0,!Y.regex.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"regex",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="trim")Q.data=Q.data.trim();else if(Y.kind==="includes"){if(!Q.data.includes(Y.value,Y.position))G=this._getOrReturnCtx(Q,G),B1(G,{code:s0.invalid_string,validation:{includes:Y.value,position:Y.position},message:Y.message}),X.dirty()}else if(Y.kind==="toLowerCase")Q.data=Q.data.toLowerCase();else if(Y.kind==="toUpperCase")Q.data=Q.data.toUpperCase();else if(Y.kind==="startsWith"){if(!Q.data.startsWith(Y.value))G=this._getOrReturnCtx(Q,G),B1(G,{code:s0.invalid_string,validation:{startsWith:Y.value},message:Y.message}),X.dirty()}else if(Y.kind==="endsWith"){if(!Q.data.endsWith(Y.value))G=this._getOrReturnCtx(Q,G),B1(G,{code:s0.invalid_string,validation:{endsWith:Y.value},message:Y.message}),X.dirty()}else if(Y.kind==="datetime"){if(!DA0(Y).test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{code:s0.invalid_string,validation:"datetime",message:Y.message}),X.dirty()}else if(Y.kind==="date"){if(!Hp1.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{code:s0.invalid_string,validation:"date",message:Y.message}),X.dirty()}else if(Y.kind==="time"){if(!qp1(Y).test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{code:s0.invalid_string,validation:"time",message:Y.message}),X.dirty()}else if(Y.kind==="duration"){if(!Qp1.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"duration",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="ip"){if(!Fp1(Q.data,Y.version))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"ip",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="jwt"){if(!Vp1(Q.data,Y.alg))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"jwt",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="cidr"){if(!zp1(Q.data,Y.version))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"cidr",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="base64"){if(!Kp1.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"base64",code:s0.invalid_string,message:Y.message}),X.dirty()}else if(Y.kind==="base64url"){if(!Zp1.test(Q.data))G=this._getOrReturnCtx(Q,G),B1(G,{validation:"base64url",code:s0.invalid_string,message:Y.message}),X.dirty()}else k4.assertNever(Y);return{status:X.value,value:Q.data}}_regex(Q,J,X){return this.refinement((G)=>Q.test(G),{validation:J,code:s0.invalid_string,...y1.errToObj(X)})}_addCheck(Q){return new RY({...this._def,checks:[...this._def.checks,Q]})}email(Q){return this._addCheck({kind:"email",...y1.errToObj(Q)})}url(Q){return this._addCheck({kind:"url",...y1.errToObj(Q)})}emoji(Q){return this._addCheck({kind:"emoji",...y1.errToObj(Q)})}uuid(Q){return this._addCheck({kind:"uuid",...y1.errToObj(Q)})}nanoid(Q){return this._addCheck({kind:"nanoid",...y1.errToObj(Q)})}cuid(Q){return this._addCheck({kind:"cuid",...y1.errToObj(Q)})}cuid2(Q){return this._addCheck({kind:"cuid2",...y1.errToObj(Q)})}ulid(Q){return this._addCheck({kind:"ulid",...y1.errToObj(Q)})}base64(Q){return this._addCheck({kind:"base64",...y1.errToObj(Q)})}base64url(Q){return this._addCheck({kind:"base64url",...y1.errToObj(Q)})}jwt(Q){return this._addCheck({kind:"jwt",...y1.errToObj(Q)})}ip(Q){return this._addCheck({kind:"ip",...y1.errToObj(Q)})}cidr(Q){return this._addCheck({kind:"cidr",...y1.errToObj(Q)})}datetime(Q){if(typeof Q==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:Q});return this._addCheck({kind:"datetime",precision:typeof Q?.precision>"u"?null:Q?.precision,offset:Q?.offset??!1,local:Q?.local??!1,...y1.errToObj(Q?.message)})}date(Q){return this._addCheck({kind:"date",message:Q})}time(Q){if(typeof Q==="string")return this._addCheck({kind:"time",precision:null,message:Q});return this._addCheck({kind:"time",precision:typeof Q?.precision>"u"?null:Q?.precision,...y1.errToObj(Q?.message)})}duration(Q){return this._addCheck({kind:"duration",...y1.errToObj(Q)})}regex(Q,J){return this._addCheck({kind:"regex",regex:Q,...y1.errToObj(J)})}includes(Q,J){return this._addCheck({kind:"includes",value:Q,position:J?.position,...y1.errToObj(J?.message)})}startsWith(Q,J){return this._addCheck({kind:"startsWith",value:Q,...y1.errToObj(J)})}endsWith(Q,J){return this._addCheck({kind:"endsWith",value:Q,...y1.errToObj(J)})}min(Q,J){return this._addCheck({kind:"min",value:Q,...y1.errToObj(J)})}max(Q,J){return this._addCheck({kind:"max",value:Q,...y1.errToObj(J)})}length(Q,J){return this._addCheck({kind:"length",value:Q,...y1.errToObj(J)})}nonempty(Q){return this.min(1,y1.errToObj(Q))}trim(){return new RY({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new RY({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new RY({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((Q)=>Q.kind==="datetime")}get isDate(){return!!this._def.checks.find((Q)=>Q.kind==="date")}get isTime(){return!!this._def.checks.find((Q)=>Q.kind==="time")}get isDuration(){return!!this._def.checks.find((Q)=>Q.kind==="duration")}get isEmail(){return!!this._def.checks.find((Q)=>Q.kind==="email")}get isURL(){return!!this._def.checks.find((Q)=>Q.kind==="url")}get isEmoji(){return!!this._def.checks.find((Q)=>Q.kind==="emoji")}get isUUID(){return!!this._def.checks.find((Q)=>Q.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((Q)=>Q.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((Q)=>Q.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((Q)=>Q.kind==="cuid2")}get isULID(){return!!this._def.checks.find((Q)=>Q.kind==="ulid")}get isIP(){return!!this._def.checks.find((Q)=>Q.kind==="ip")}get isCIDR(){return!!this._def.checks.find((Q)=>Q.kind==="cidr")}get isBase64(){return!!this._def.checks.find((Q)=>Q.kind==="base64")}get isBase64url(){return!!this._def.checks.find((Q)=>Q.kind==="base64url")}get minLength(){let Q=null;for(let J of this._def.checks)if(J.kind==="min"){if(Q===null||J.value>Q)Q=J.value}return Q}get maxLength(){let Q=null;for(let J of this._def.checks)if(J.kind==="max"){if(Q===null||J.value<Q)Q=J.value}return Q}};RY.create=(Q)=>{return new RY({checks:[],typeName:k0.ZodString,coerce:Q?.coerce??!1,...D4(Q)})};EK=class EK extends P4{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(Q){if(this._def.coerce)Q.data=Number(Q.data);if(this._getType(Q)!==W1.number){let Y=this._getOrReturnCtx(Q);return B1(Y,{code:s0.invalid_type,expected:W1.number,received:Y.parsedType}),a1}let X=void 0,G=new I5;for(let Y of this._def.checks)if(Y.kind==="int"){if(!k4.isInteger(Q.data))X=this._getOrReturnCtx(Q,X),B1(X,{code:s0.invalid_type,expected:"integer",received:"float",message:Y.message}),G.dirty()}else if(Y.kind==="min"){if(Y.inclusive?Q.data<Y.value:Q.data<=Y.value)X=this._getOrReturnCtx(Q,X),B1(X,{code:s0.too_small,minimum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),G.dirty()}else if(Y.kind==="max"){if(Y.inclusive?Q.data>Y.value:Q.data>=Y.value)X=this._getOrReturnCtx(Q,X),B1(X,{code:s0.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),G.dirty()}else if(Y.kind==="multipleOf"){if(Up1(Q.data,Y.value)!==0)X=this._getOrReturnCtx(Q,X),B1(X,{code:s0.not_multiple_of,multipleOf:Y.value,message:Y.message}),G.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite(Q.data))X=this._getOrReturnCtx(Q,X),B1(X,{code:s0.not_finite,message:Y.message}),G.dirty()}else k4.assertNever(Y);return{status:G.value,value:Q.data}}gte(Q,J){return this.setLimit("min",Q,!0,y1.toString(J))}gt(Q,J){return this.setLimit("min",Q,!1,y1.toString(J))}lte(Q,J){return this.setLimit("max",Q,!0,y1.toString(J))}lt(Q,J){return this.setLimit("max",Q,!1,y1.toString(J))}setLimit(Q,J,X,G){return new EK({...this._def,checks:[...this._def.checks,{kind:Q,value:J,inclusive:X,message:y1.toString(G)}]})}_addCheck(Q){return new EK({...this._def,checks:[...this._def.checks,Q]})}int(Q){return this._addCheck({kind:"int",message:y1.toString(Q)})}positive(Q){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y1.toString(Q)})}negative(Q){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y1.toString(Q)})}nonpositive(Q){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y1.toString(Q)})}nonnegative(Q){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y1.toString(Q)})}multipleOf(Q,J){return this._addCheck({kind:"multipleOf",value:Q,message:y1.toString(J)})}finite(Q){return this._addCheck({kind:"finite",message:y1.toString(Q)})}safe(Q){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y1.toString(Q)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y1.toString(Q)})}get minValue(){let Q=null;for(let J of this._def.checks)if(J.kind==="min"){if(Q===null||J.value>Q)Q=J.value}return Q}get maxValue(){let Q=null;for(let J of this._def.checks)if(J.kind==="max"){if(Q===null||J.value<Q)Q=J.value}return Q}get isInt(){return!!this._def.checks.find((Q)=>Q.kind==="int"||Q.kind==="multipleOf"&&k4.isInteger(Q.value))}get isFinite(){let Q=null,J=null;for(let X of this._def.checks)if(X.kind==="finite"||X.kind==="int"||X.kind==="multipleOf")return!0;else if(X.kind==="min"){if(J===null||X.value>J)J=X.value}else if(X.kind==="max"){if(Q===null||X.value<Q)Q=X.value}return Number.isFinite(J)&&Number.isFinite(Q)}};EK.create=(Q)=>{return new EK({checks:[],typeName:k0.ZodNumber,coerce:Q?.coerce||!1,...D4(Q)})};jK=class jK extends P4{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(Q){if(this._def.coerce)try{Q.data=BigInt(Q.data)}catch{return this._getInvalidInput(Q)}if(this._getType(Q)!==W1.bigint)return this._getInvalidInput(Q);let X=void 0,G=new I5;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?Q.data<Y.value:Q.data<=Y.value)X=this._getOrReturnCtx(Q,X),B1(X,{code:s0.too_small,type:"bigint",minimum:Y.value,inclusive:Y.inclusive,message:Y.message}),G.dirty()}else if(Y.kind==="max"){if(Y.inclusive?Q.data>Y.value:Q.data>=Y.value)X=this._getOrReturnCtx(Q,X),B1(X,{code:s0.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),G.dirty()}else if(Y.kind==="multipleOf"){if(Q.data%Y.value!==BigInt(0))X=this._getOrReturnCtx(Q,X),B1(X,{code:s0.not_multiple_of,multipleOf:Y.value,message:Y.message}),G.dirty()}else k4.assertNever(Y);return{status:G.value,value:Q.data}}_getInvalidInput(Q){let J=this._getOrReturnCtx(Q);return B1(J,{code:s0.invalid_type,expected:W1.bigint,received:J.parsedType}),a1}gte(Q,J){return this.setLimit("min",Q,!0,y1.toString(J))}gt(Q,J){return this.setLimit("min",Q,!1,y1.toString(J))}lte(Q,J){return this.setLimit("max",Q,!0,y1.toString(J))}lt(Q,J){return this.setLimit("max",Q,!1,y1.toString(J))}setLimit(Q,J,X,G){return new jK({...this._def,checks:[...this._def.checks,{kind:Q,value:J,inclusive:X,message:y1.toString(G)}]})}_addCheck(Q){return new jK({...this._def,checks:[...this._def.checks,Q]})}positive(Q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y1.toString(Q)})}negative(Q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y1.toString(Q)})}nonpositive(Q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y1.toString(Q)})}nonnegative(Q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y1.toString(Q)})}multipleOf(Q,J){return this._addCheck({kind:"multipleOf",value:Q,message:y1.toString(J)})}get minValue(){let Q=null;for(let J of this._def.checks)if(J.kind==="min"){if(Q===null||J.value>Q)Q=J.value}return Q}get maxValue(){let Q=null;for(let J of this._def.checks)if(J.kind==="max"){if(Q===null||J.value<Q)Q=J.value}return Q}};jK.create=(Q)=>{return new jK({checks:[],typeName:k0.ZodBigInt,coerce:Q?.coerce??!1,...D4(Q)})};Uz=class Uz extends P4{_parse(Q){if(this._def.coerce)Q.data=Boolean(Q.data);if(this._getType(Q)!==W1.boolean){let X=this._getOrReturnCtx(Q);return B1(X,{code:s0.invalid_type,expected:W1.boolean,received:X.parsedType}),a1}return QQ(Q.data)}};Uz.create=(Q)=>{return new Uz({typeName:k0.ZodBoolean,coerce:Q?.coerce||!1,...D4(Q)})};FH=class FH extends P4{_parse(Q){if(this._def.coerce)Q.data=new Date(Q.data);if(this._getType(Q)!==W1.date){let Y=this._getOrReturnCtx(Q);return B1(Y,{code:s0.invalid_type,expected:W1.date,received:Y.parsedType}),a1}if(Number.isNaN(Q.data.getTime())){let Y=this._getOrReturnCtx(Q);return B1(Y,{code:s0.invalid_date}),a1}let X=new I5,G=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(Q.data.getTime()<Y.value)G=this._getOrReturnCtx(Q,G),B1(G,{code:s0.too_small,message:Y.message,inclusive:!0,exact:!1,minimum:Y.value,type:"date"}),X.dirty()}else if(Y.kind==="max"){if(Q.data.getTime()>Y.value)G=this._getOrReturnCtx(Q,G),B1(G,{code:s0.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),X.dirty()}else k4.assertNever(Y);return{status:X.value,value:new Date(Q.data.getTime())}}_addCheck(Q){return new FH({...this._def,checks:[...this._def.checks,Q]})}min(Q,J){return this._addCheck({kind:"min",value:Q.getTime(),message:y1.toString(J)})}max(Q,J){return this._addCheck({kind:"max",value:Q.getTime(),message:y1.toString(J)})}get minDate(){let Q=null;for(let J of this._def.checks)if(J.kind==="min"){if(Q===null||J.value>Q)Q=J.value}return Q!=null?new Date(Q):null}get maxDate(){let Q=null;for(let J of this._def.checks)if(J.kind==="max"){if(Q===null||J.value<Q)Q=J.value}return Q!=null?new Date(Q):null}};FH.create=(Q)=>{return new FH({checks:[],coerce:Q?.coerce||!1,typeName:k0.ZodDate,...D4(Q)})};AL=class AL extends P4{_parse(Q){if(this._getType(Q)!==W1.symbol){let X=this._getOrReturnCtx(Q);return B1(X,{code:s0.invalid_type,expected:W1.symbol,received:X.parsedType}),a1}return QQ(Q.data)}};AL.create=(Q)=>{return new AL({typeName:k0.ZodSymbol,...D4(Q)})};Nz=class Nz extends P4{_parse(Q){if(this._getType(Q)!==W1.undefined){let X=this._getOrReturnCtx(Q);return B1(X,{code:s0.invalid_type,expected:W1.undefined,received:X.parsedType}),a1}return QQ(Q.data)}};Nz.create=(Q)=>{return new Nz({typeName:k0.ZodUndefined,...D4(Q)})};Bz=class Bz extends P4{_parse(Q){if(this._getType(Q)!==W1.null){let X=this._getOrReturnCtx(Q);return B1(X,{code:s0.invalid_type,expected:W1.null,received:X.parsedType}),a1}return QQ(Q.data)}};Bz.create=(Q)=>{return new Bz({typeName:k0.ZodNull,...D4(Q)})};VH=class VH extends P4{constructor(){super(...arguments);this._any=!0}_parse(Q){return QQ(Q.data)}};VH.create=(Q)=>{return new VH({typeName:k0.ZodAny,...D4(Q)})};TK=class TK extends P4{constructor(){super(...arguments);this._unknown=!0}_parse(Q){return QQ(Q.data)}};TK.create=(Q)=>{return new TK({typeName:k0.ZodUnknown,...D4(Q)})};o7=class o7 extends P4{_parse(Q){let J=this._getOrReturnCtx(Q);return B1(J,{code:s0.invalid_type,expected:W1.never,received:J.parsedType}),a1}};o7.create=(Q)=>{return new o7({typeName:k0.ZodNever,...D4(Q)})};TL=class TL extends P4{_parse(Q){if(this._getType(Q)!==W1.undefined){let X=this._getOrReturnCtx(Q);return B1(X,{code:s0.invalid_type,expected:W1.void,received:X.parsedType}),a1}return QQ(Q.data)}};TL.create=(Q)=>{return new TL({typeName:k0.ZodVoid,...D4(Q)})};CY=class CY extends P4{_parse(Q){let{ctx:J,status:X}=this._processInputParams(Q),G=this._def;if(J.parsedType!==W1.array)return B1(J,{code:s0.invalid_type,expected:W1.array,received:J.parsedType}),a1;if(G.exactLength!==null){let W=J.data.length>G.exactLength.value,$=J.data.length<G.exactLength.value;if(W||$)B1(J,{code:W?s0.too_big:s0.too_small,minimum:$?G.exactLength.value:void 0,maximum:W?G.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:G.exactLength.message}),X.dirty()}if(G.minLength!==null){if(J.data.length<G.minLength.value)B1(J,{code:s0.too_small,minimum:G.minLength.value,type:"array",inclusive:!0,exact:!1,message:G.minLength.message}),X.dirty()}if(G.maxLength!==null){if(J.data.length>G.maxLength.value)B1(J,{code:s0.too_big,maximum:G.maxLength.value,type:"array",inclusive:!0,exact:!1,message:G.maxLength.message}),X.dirty()}if(J.common.async)return Promise.all([...J.data].map((W,$)=>{return G.type._parseAsync(new vY(J,W,J.path,$))})).then((W)=>{return I5.mergeArray(X,W)});let Y=[...J.data].map((W,$)=>{return G.type._parseSync(new vY(J,W,J.path,$))});return I5.mergeArray(X,Y)}get element(){return this._def.type}min(Q,J){return new CY({...this._def,minLength:{value:Q,message:y1.toString(J)}})}max(Q,J){return new CY({...this._def,maxLength:{value:Q,message:y1.toString(J)}})}length(Q,J){return new CY({...this._def,exactLength:{value:Q,message:y1.toString(J)}})}nonempty(Q){return this.min(1,Q)}};CY.create=(Q,J)=>{return new CY({type:Q,minLength:null,maxLength:null,exactLength:null,typeName:k0.ZodArray,...D4(J)})};c8=class c8 extends P4{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let Q=this._def.shape(),J=k4.objectKeys(Q);return this._cached={shape:Q,keys:J},this._cached}_parse(Q){if(this._getType(Q)!==W1.object){let Z=this._getOrReturnCtx(Q);return B1(Z,{code:s0.invalid_type,expected:W1.object,received:Z.parsedType}),a1}let{status:X,ctx:G}=this._processInputParams(Q),{shape:Y,keys:W}=this._getCached(),$=[];if(!(this._def.catchall instanceof o7&&this._def.unknownKeys==="strip")){for(let Z in G.data)if(!W.includes(Z))$.push(Z)}let K=[];for(let Z of W){let H=Y[Z],q=G.data[Z];K.push({key:{status:"valid",value:Z},value:H._parse(new vY(G,q,G.path,Z)),alwaysSet:Z in G.data})}if(this._def.catchall instanceof o7){let Z=this._def.unknownKeys;if(Z==="passthrough")for(let H of $)K.push({key:{status:"valid",value:H},value:{status:"valid",value:G.data[H]}});else if(Z==="strict"){if($.length>0)B1(G,{code:s0.unrecognized_keys,keys:$}),X.dirty()}else if(Z==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let Z=this._def.catchall;for(let H of $){let q=G.data[H];K.push({key:{status:"valid",value:H},value:Z._parse(new vY(G,q,G.path,H)),alwaysSet:H in G.data})}}if(G.common.async)return Promise.resolve().then(async()=>{let Z=[];for(let H of K){let q=await H.key,F=await H.value;Z.push({key:q,value:F,alwaysSet:H.alwaysSet})}return Z}).then((Z)=>{return I5.mergeObjectSync(X,Z)});else return I5.mergeObjectSync(X,K)}get shape(){return this._def.shape()}strict(Q){return y1.errToObj,new c8({...this._def,unknownKeys:"strict",...Q!==void 0?{errorMap:(J,X)=>{let G=this._def.errorMap?.(J,X).message??X.defaultError;if(J.code==="unrecognized_keys")return{message:y1.errToObj(Q).message??G};return{message:G}}}:{}})}strip(){return new c8({...this._def,unknownKeys:"strip"})}passthrough(){return new c8({...this._def,unknownKeys:"passthrough"})}extend(Q){return new c8({...this._def,shape:()=>({...this._def.shape(),...Q})})}merge(Q){return new c8({unknownKeys:Q._def.unknownKeys,catchall:Q._def.catchall,shape:()=>({...this._def.shape(),...Q._def.shape()}),typeName:k0.ZodObject})}setKey(Q,J){return this.augment({[Q]:J})}catchall(Q){return new c8({...this._def,catchall:Q})}pick(Q){let J={};for(let X of k4.objectKeys(Q))if(Q[X]&&this.shape[X])J[X]=this.shape[X];return new c8({...this._def,shape:()=>J})}omit(Q){let J={};for(let X of k4.objectKeys(this.shape))if(!Q[X])J[X]=this.shape[X];return new c8({...this._def,shape:()=>J})}deepPartial(){return Vz(this)}partial(Q){let J={};for(let X of k4.objectKeys(this.shape)){let G=this.shape[X];if(Q&&!Q[X])J[X]=G;else J[X]=G.optional()}return new c8({...this._def,shape:()=>J})}required(Q){let J={};for(let X of k4.objectKeys(this.shape))if(Q&&!Q[X])J[X]=this.shape[X];else{let Y=this.shape[X];while(Y instanceof SY)Y=Y._def.innerType;J[X]=Y}return new c8({...this._def,shape:()=>J})}keyof(){return LA0(k4.objectKeys(this.shape))}};c8.create=(Q,J)=>{return new c8({shape:()=>Q,unknownKeys:"strip",catchall:o7.create(),typeName:k0.ZodObject,...D4(J)})};c8.strictCreate=(Q,J)=>{return new c8({shape:()=>Q,unknownKeys:"strict",catchall:o7.create(),typeName:k0.ZodObject,...D4(J)})};c8.lazycreate=(Q,J)=>{return new c8({shape:Q,unknownKeys:"strip",catchall:o7.create(),typeName:k0.ZodObject,...D4(J)})};Oz=class Oz extends P4{_parse(Q){let{ctx:J}=this._processInputParams(Q),X=this._def.options;function G(Y){for(let $ of Y)if($.result.status==="valid")return $.result;for(let $ of Y)if($.result.status==="dirty")return J.common.issues.push(...$.ctx.common.issues),$.result;let W=Y.map(($)=>new WJ($.ctx.common.issues));return B1(J,{code:s0.invalid_union,unionErrors:W}),a1}if(J.common.async)return Promise.all(X.map(async(Y)=>{let W={...J,common:{...J.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:J.data,path:J.path,parent:W}),ctx:W}})).then(G);else{let Y=void 0,W=[];for(let K of X){let Z={...J,common:{...J.common,issues:[]},parent:null},H=K._parseSync({data:J.data,path:J.path,parent:Z});if(H.status==="valid")return H;else if(H.status==="dirty"&&!Y)Y={result:H,ctx:Z};if(Z.common.issues.length)W.push(Z.common.issues)}if(Y)return J.common.issues.push(...Y.ctx.common.issues),Y.result;let $=W.map((K)=>new WJ(K));return B1(J,{code:s0.invalid_union,unionErrors:$}),a1}}get options(){return this._def.options}};Oz.create=(Q,J)=>{return new Oz({options:Q,typeName:k0.ZodUnion,...D4(J)})};XC=class XC extends P4{_parse(Q){let{ctx:J}=this._processInputParams(Q);if(J.parsedType!==W1.object)return B1(J,{code:s0.invalid_type,expected:W1.object,received:J.parsedType}),a1;let X=this.discriminator,G=J.data[X],Y=this.optionsMap.get(G);if(!Y)return B1(J,{code:s0.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[X]}),a1;if(J.common.async)return Y._parseAsync({data:J.data,path:J.path,parent:J});else return Y._parseSync({data:J.data,path:J.path,parent:J})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(Q,J,X){let G=new Map;for(let Y of J){let W=wW(Y.shape[Q]);if(!W.length)throw Error(`A discriminator value for key \`${Q}\` could not be extracted from all schema options`);for(let $ of W){if(G.has($))throw Error(`Discriminator property ${String(Q)} has duplicate value ${String($)}`);G.set($,Y)}}return new XC({typeName:k0.ZodDiscriminatedUnion,discriminator:Q,options:J,optionsMap:G,...D4(X)})}};Dz=class Dz extends P4{_parse(Q){let{status:J,ctx:X}=this._processInputParams(Q),G=(Y,W)=>{if(QC(Y)||QC(W))return a1;let $=ua(Y.value,W.value);if(!$.valid)return B1(X,{code:s0.invalid_intersection_types}),a1;if(JC(Y)||JC(W))J.dirty();return{status:J.value,value:$.data}};if(X.common.async)return Promise.all([this._def.left._parseAsync({data:X.data,path:X.path,parent:X}),this._def.right._parseAsync({data:X.data,path:X.path,parent:X})]).then(([Y,W])=>G(Y,W));else return G(this._def.left._parseSync({data:X.data,path:X.path,parent:X}),this._def.right._parseSync({data:X.data,path:X.path,parent:X}))}};Dz.create=(Q,J,X)=>{return new Dz({left:Q,right:J,typeName:k0.ZodIntersection,...D4(X)})};s7=class s7 extends P4{_parse(Q){let{status:J,ctx:X}=this._processInputParams(Q);if(X.parsedType!==W1.array)return B1(X,{code:s0.invalid_type,expected:W1.array,received:X.parsedType}),a1;if(X.data.length<this._def.items.length)return B1(X,{code:s0.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a1;if(!this._def.rest&&X.data.length>this._def.items.length)B1(X,{code:s0.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J.dirty();let Y=[...X.data].map((W,$)=>{let K=this._def.items[$]||this._def.rest;if(!K)return null;return K._parse(new vY(X,W,X.path,$))}).filter((W)=>!!W);if(X.common.async)return Promise.all(Y).then((W)=>{return I5.mergeArray(J,W)});else return I5.mergeArray(J,Y)}get items(){return this._def.items}rest(Q){return new s7({...this._def,rest:Q})}};s7.create=(Q,J)=>{if(!Array.isArray(Q))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new s7({items:Q,typeName:k0.ZodTuple,rest:null,...D4(J)})};EL=class EL extends P4{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Q){let{status:J,ctx:X}=this._processInputParams(Q);if(X.parsedType!==W1.object)return B1(X,{code:s0.invalid_type,expected:W1.object,received:X.parsedType}),a1;let G=[],Y=this._def.keyType,W=this._def.valueType;for(let $ in X.data)G.push({key:Y._parse(new vY(X,$,X.path,$)),value:W._parse(new vY(X,X.data[$],X.path,$)),alwaysSet:$ in X.data});if(X.common.async)return I5.mergeObjectAsync(J,G);else return I5.mergeObjectSync(J,G)}get element(){return this._def.valueType}static create(Q,J,X){if(J instanceof P4)return new EL({keyType:Q,valueType:J,typeName:k0.ZodRecord,...D4(X)});return new EL({keyType:RY.create(),valueType:Q,typeName:k0.ZodRecord,...D4(J)})}};jL=class jL extends P4{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Q){let{status:J,ctx:X}=this._processInputParams(Q);if(X.parsedType!==W1.map)return B1(X,{code:s0.invalid_type,expected:W1.map,received:X.parsedType}),a1;let G=this._def.keyType,Y=this._def.valueType,W=[...X.data.entries()].map(([$,K],Z)=>{return{key:G._parse(new vY(X,$,X.path,[Z,"key"])),value:Y._parse(new vY(X,K,X.path,[Z,"value"]))}});if(X.common.async){let $=new Map;return Promise.resolve().then(async()=>{for(let K of W){let Z=await K.key,H=await K.value;if(Z.status==="aborted"||H.status==="aborted")return a1;if(Z.status==="dirty"||H.status==="dirty")J.dirty();$.set(Z.value,H.value)}return{status:J.value,value:$}})}else{let $=new Map;for(let K of W){let{key:Z,value:H}=K;if(Z.status==="aborted"||H.status==="aborted")return a1;if(Z.status==="dirty"||H.status==="dirty")J.dirty();$.set(Z.value,H.value)}return{status:J.value,value:$}}}};jL.create=(Q,J,X)=>{return new jL({valueType:J,keyType:Q,typeName:k0.ZodMap,...D4(X)})};zH=class zH extends P4{_parse(Q){let{status:J,ctx:X}=this._processInputParams(Q);if(X.parsedType!==W1.set)return B1(X,{code:s0.invalid_type,expected:W1.set,received:X.parsedType}),a1;let G=this._def;if(G.minSize!==null){if(X.data.size<G.minSize.value)B1(X,{code:s0.too_small,minimum:G.minSize.value,type:"set",inclusive:!0,exact:!1,message:G.minSize.message}),J.dirty()}if(G.maxSize!==null){if(X.data.size>G.maxSize.value)B1(X,{code:s0.too_big,maximum:G.maxSize.value,type:"set",inclusive:!0,exact:!1,message:G.maxSize.message}),J.dirty()}let Y=this._def.valueType;function W(K){let Z=new Set;for(let H of K){if(H.status==="aborted")return a1;if(H.status==="dirty")J.dirty();Z.add(H.value)}return{status:J.value,value:Z}}let $=[...X.data.values()].map((K,Z)=>Y._parse(new vY(X,K,X.path,Z)));if(X.common.async)return Promise.all($).then((K)=>W(K));else return W($)}min(Q,J){return new zH({...this._def,minSize:{value:Q,message:y1.toString(J)}})}max(Q,J){return new zH({...this._def,maxSize:{value:Q,message:y1.toString(J)}})}size(Q,J){return this.min(Q,J).max(Q,J)}nonempty(Q){return this.min(1,Q)}};zH.create=(Q,J)=>{return new zH({valueType:Q,minSize:null,maxSize:null,typeName:k0.ZodSet,...D4(J)})};zz=class zz extends P4{constructor(){super(...arguments);this.validate=this.implement}_parse(Q){let{ctx:J}=this._processInputParams(Q);if(J.parsedType!==W1.function)return B1(J,{code:s0.invalid_type,expected:W1.function,received:J.parsedType}),a1;function X($,K){return ML({data:$,path:J.path,errorMaps:[J.common.contextualErrorMap,J.schemaErrorMap,qz(),LW].filter((Z)=>!!Z),issueData:{code:s0.invalid_arguments,argumentsError:K}})}function G($,K){return ML({data:$,path:J.path,errorMaps:[J.common.contextualErrorMap,J.schemaErrorMap,qz(),LW].filter((Z)=>!!Z),issueData:{code:s0.invalid_return_type,returnTypeError:K}})}let Y={errorMap:J.common.contextualErrorMap},W=J.data;if(this._def.returns instanceof UH){let $=this;return QQ(async function(...K){let Z=new WJ([]),H=await $._def.args.parseAsync(K,Y).catch((V)=>{throw Z.addIssue(X(K,V)),Z}),q=await Reflect.apply(W,this,H);return await $._def.returns._def.type.parseAsync(q,Y).catch((V)=>{throw Z.addIssue(G(q,V)),Z})})}else{let $=this;return QQ(function(...K){let Z=$._def.args.safeParse(K,Y);if(!Z.success)throw new WJ([X(K,Z.error)]);let H=Reflect.apply(W,this,Z.data),q=$._def.returns.safeParse(H,Y);if(!q.success)throw new WJ([G(H,q.error)]);return q.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...Q){return new zz({...this._def,args:s7.create(Q).rest(TK.create())})}returns(Q){return new zz({...this._def,returns:Q})}implement(Q){return this.parse(Q)}strictImplement(Q){return this.parse(Q)}static create(Q,J,X){return new zz({args:Q?Q:s7.create([]).rest(TK.create()),returns:J||TK.create(),typeName:k0.ZodFunction,...D4(X)})}};Lz=class Lz extends P4{get schema(){return this._def.getter()}_parse(Q){let{ctx:J}=this._processInputParams(Q);return this._def.getter()._parse({data:J.data,path:J.path,parent:J})}};Lz.create=(Q,J)=>{return new Lz({getter:Q,typeName:k0.ZodLazy,...D4(J)})};wz=class wz extends P4{_parse(Q){if(Q.data!==this._def.value){let J=this._getOrReturnCtx(Q);return B1(J,{received:J.data,code:s0.invalid_literal,expected:this._def.value}),a1}return{status:"valid",value:Q.data}}get value(){return this._def.value}};wz.create=(Q,J)=>{return new wz({value:Q,typeName:k0.ZodLiteral,...D4(J)})};IK=class IK extends P4{_parse(Q){if(typeof Q.data!=="string"){let J=this._getOrReturnCtx(Q),X=this._def.values;return B1(J,{expected:k4.joinValues(X),received:J.parsedType,code:s0.invalid_type}),a1}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(Q.data)){let J=this._getOrReturnCtx(Q),X=this._def.values;return B1(J,{received:J.data,code:s0.invalid_enum_value,options:X}),a1}return QQ(Q.data)}get options(){return this._def.values}get enum(){let Q={};for(let J of this._def.values)Q[J]=J;return Q}get Values(){let Q={};for(let J of this._def.values)Q[J]=J;return Q}get Enum(){let Q={};for(let J of this._def.values)Q[J]=J;return Q}extract(Q,J=this._def){return IK.create(Q,{...this._def,...J})}exclude(Q,J=this._def){return IK.create(this.options.filter((X)=>!Q.includes(X)),{...this._def,...J})}};IK.create=LA0;Pz=class Pz extends P4{_parse(Q){let J=k4.getValidEnumValues(this._def.values),X=this._getOrReturnCtx(Q);if(X.parsedType!==W1.string&&X.parsedType!==W1.number){let G=k4.objectValues(J);return B1(X,{expected:k4.joinValues(G),received:X.parsedType,code:s0.invalid_type}),a1}if(!this._cache)this._cache=new Set(k4.getValidEnumValues(this._def.values));if(!this._cache.has(Q.data)){let G=k4.objectValues(J);return B1(X,{received:X.data,code:s0.invalid_enum_value,options:G}),a1}return QQ(Q.data)}get enum(){return this._def.values}};Pz.create=(Q,J)=>{return new Pz({values:Q,typeName:k0.ZodNativeEnum,...D4(J)})};UH=class UH extends P4{unwrap(){return this._def.type}_parse(Q){let{ctx:J}=this._processInputParams(Q);if(J.parsedType!==W1.promise&&J.common.async===!1)return B1(J,{code:s0.invalid_type,expected:W1.promise,received:J.parsedType}),a1;let X=J.parsedType===W1.promise?J.data:Promise.resolve(J.data);return QQ(X.then((G)=>{return this._def.type.parseAsync(G,{path:J.path,errorMap:J.common.contextualErrorMap})}))}};UH.create=(Q,J)=>{return new UH({type:Q,typeName:k0.ZodPromise,...D4(J)})};kY=class kY extends P4{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===k0.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(Q){let{status:J,ctx:X}=this._processInputParams(Q),G=this._def.effect||null,Y={addIssue:(W)=>{if(B1(X,W),W.fatal)J.abort();else J.dirty()},get path(){return X.path}};if(Y.addIssue=Y.addIssue.bind(Y),G.type==="preprocess"){let W=G.transform(X.data,Y);if(X.common.async)return Promise.resolve(W).then(async($)=>{if(J.value==="aborted")return a1;let K=await this._def.schema._parseAsync({data:$,path:X.path,parent:X});if(K.status==="aborted")return a1;if(K.status==="dirty")return qH(K.value);if(J.value==="dirty")return qH(K.value);return K});else{if(J.value==="aborted")return a1;let $=this._def.schema._parseSync({data:W,path:X.path,parent:X});if($.status==="aborted")return a1;if($.status==="dirty")return qH($.value);if(J.value==="dirty")return qH($.value);return $}}if(G.type==="refinement"){let W=($)=>{let K=G.refinement($,Y);if(X.common.async)return Promise.resolve(K);if(K instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return $};if(X.common.async===!1){let $=this._def.schema._parseSync({data:X.data,path:X.path,parent:X});if($.status==="aborted")return a1;if($.status==="dirty")J.dirty();return W($.value),{status:J.value,value:$.value}}else return this._def.schema._parseAsync({data:X.data,path:X.path,parent:X}).then(($)=>{if($.status==="aborted")return a1;if($.status==="dirty")J.dirty();return W($.value).then(()=>{return{status:J.value,value:$.value}})})}if(G.type==="transform")if(X.common.async===!1){let W=this._def.schema._parseSync({data:X.data,path:X.path,parent:X});if(!AK(W))return a1;let $=G.transform(W.value,Y);if($ instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:J.value,value:$}}else return this._def.schema._parseAsync({data:X.data,path:X.path,parent:X}).then((W)=>{if(!AK(W))return a1;return Promise.resolve(G.transform(W.value,Y)).then(($)=>({status:J.value,value:$}))});k4.assertNever(G)}};kY.create=(Q,J,X)=>{return new kY({schema:Q,typeName:k0.ZodEffects,effect:J,...D4(X)})};kY.createWithPreprocess=(Q,J,X)=>{return new kY({schema:J,effect:{type:"preprocess",transform:Q},typeName:k0.ZodEffects,...D4(X)})};SY=class SY extends P4{_parse(Q){if(this._getType(Q)===W1.undefined)return QQ(void 0);return this._def.innerType._parse(Q)}unwrap(){return this._def.innerType}};SY.create=(Q,J)=>{return new SY({innerType:Q,typeName:k0.ZodOptional,...D4(J)})};PW=class PW extends P4{_parse(Q){if(this._getType(Q)===W1.null)return QQ(null);return this._def.innerType._parse(Q)}unwrap(){return this._def.innerType}};PW.create=(Q,J)=>{return new PW({innerType:Q,typeName:k0.ZodNullable,...D4(J)})};Mz=class Mz extends P4{_parse(Q){let{ctx:J}=this._processInputParams(Q),X=J.data;if(J.parsedType===W1.undefined)X=this._def.defaultValue();return this._def.innerType._parse({data:X,path:J.path,parent:J})}removeDefault(){return this._def.innerType}};Mz.create=(Q,J)=>{return new Mz({innerType:Q,typeName:k0.ZodDefault,defaultValue:typeof J.default==="function"?J.default:()=>J.default,...D4(J)})};Az=class Az extends P4{_parse(Q){let{ctx:J}=this._processInputParams(Q),X={...J,common:{...J.common,issues:[]}},G=this._def.innerType._parse({data:X.data,path:X.path,parent:{...X}});if(Fz(G))return G.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new WJ(X.common.issues)},input:X.data})}});else return{status:"valid",value:G.status==="valid"?G.value:this._def.catchValue({get error(){return new WJ(X.common.issues)},input:X.data})}}removeCatch(){return this._def.innerType}};Az.create=(Q,J)=>{return new Az({innerType:Q,typeName:k0.ZodCatch,catchValue:typeof J.catch==="function"?J.catch:()=>J.catch,...D4(J)})};IL=class IL extends P4{_parse(Q){if(this._getType(Q)!==W1.nan){let X=this._getOrReturnCtx(Q);return B1(X,{code:s0.invalid_type,expected:W1.nan,received:X.parsedType}),a1}return{status:"valid",value:Q.data}}};IL.create=(Q)=>{return new IL({typeName:k0.ZodNaN,...D4(Q)})};Np1=Symbol("zod_brand");YC=class YC extends P4{_parse(Q){let{ctx:J}=this._processInputParams(Q),X=J.data;return this._def.type._parse({data:X,path:J.path,parent:J})}unwrap(){return this._def.type}};RL=class RL extends P4{_parse(Q){let{status:J,ctx:X}=this._processInputParams(Q);if(X.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:X.data,path:X.path,parent:X});if(Y.status==="aborted")return a1;if(Y.status==="dirty")return J.dirty(),qH(Y.value);else return this._def.out._parseAsync({data:Y.value,path:X.path,parent:X})})();else{let G=this._def.in._parseSync({data:X.data,path:X.path,parent:X});if(G.status==="aborted")return a1;if(G.status==="dirty")return J.dirty(),{status:"dirty",value:G.value};else return this._def.out._parseSync({data:G.value,path:X.path,parent:X})}}static create(Q,J){return new RL({in:Q,out:J,typeName:k0.ZodPipeline})}};Tz=class Tz extends P4{_parse(Q){let J=this._def.innerType._parse(Q),X=(G)=>{if(AK(G))G.value=Object.freeze(G.value);return G};return Fz(J)?J.then((G)=>X(G)):X(J)}unwrap(){return this._def.innerType}};Tz.create=(Q,J)=>{return new Tz({innerType:Q,typeName:k0.ZodReadonly,...D4(J)})};Bp1={object:c8.lazycreate};(function(Q){Q.ZodString="ZodString",Q.ZodNumber="ZodNumber",Q.ZodNaN="ZodNaN",Q.ZodBigInt="ZodBigInt",Q.ZodBoolean="ZodBoolean",Q.ZodDate="ZodDate",Q.ZodSymbol="ZodSymbol",Q.ZodUndefined="ZodUndefined",Q.ZodNull="ZodNull",Q.ZodAny="ZodAny",Q.ZodUnknown="ZodUnknown",Q.ZodNever="ZodNever",Q.ZodVoid="ZodVoid",Q.ZodArray="ZodArray",Q.ZodObject="ZodObject",Q.ZodUnion="ZodUnion",Q.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Q.ZodIntersection="ZodIntersection",Q.ZodTuple="ZodTuple",Q.ZodRecord="ZodRecord",Q.ZodMap="ZodMap",Q.ZodSet="ZodSet",Q.ZodFunction="ZodFunction",Q.ZodLazy="ZodLazy",Q.ZodLiteral="ZodLiteral",Q.ZodEnum="ZodEnum",Q.ZodEffects="ZodEffects",Q.ZodNativeEnum="ZodNativeEnum",Q.ZodOptional="ZodOptional",Q.ZodNullable="ZodNullable",Q.ZodDefault="ZodDefault",Q.ZodCatch="ZodCatch",Q.ZodPromise="ZodPromise",Q.ZodBranded="ZodBranded",Q.ZodPipeline="ZodPipeline",Q.ZodReadonly="ZodReadonly"})(k0||(k0={}));PA0=RY.create,MA0=EK.create,Dp1=IL.create,Lp1=jK.create,AA0=Uz.create,wp1=FH.create,Pp1=AL.create,Mp1=Nz.create,Ap1=Bz.create,Tp1=VH.create,Ep1=TK.create,jp1=o7.create,Ip1=TL.create,Rp1=CY.create,Cp1=c8.create,Sp1=c8.strictCreate,vp1=Oz.create,kp1=XC.create,_p1=Dz.create,yp1=s7.create,hp1=EL.create,fp1=jL.create,bp1=zH.create,xp1=zz.create,gp1=Lz.create,up1=wz.create,mp1=IK.create,lp1=Pz.create,dp1=UH.create,pp1=kY.create,cp1=SY.create,np1=PW.create,ip1=kY.createWithPreprocess,rp1=RL.create,tp1={string:(Q)=>RY.create({...Q,coerce:!0}),number:(Q)=>EK.create({...Q,coerce:!0}),boolean:(Q)=>Uz.create({...Q,coerce:!0}),bigint:(Q)=>jK.create({...Q,coerce:!0}),date:(Q)=>FH.create({...Q,coerce:!0})},ep1=a1});var L={};H4(L,{void:()=>Ip1,util:()=>k4,unknown:()=>Ep1,union:()=>vp1,undefined:()=>Mp1,tuple:()=>yp1,transformer:()=>pp1,symbol:()=>Pp1,string:()=>PA0,strictObject:()=>Sp1,setErrorMap:()=>nd1,set:()=>bp1,record:()=>hp1,quotelessJson:()=>pd1,promise:()=>dp1,preprocess:()=>ip1,pipeline:()=>rp1,ostring:()=>ap1,optional:()=>cp1,onumber:()=>op1,oboolean:()=>sp1,objectUtil:()=>fa,object:()=>Cp1,number:()=>MA0,nullable:()=>np1,null:()=>Ap1,never:()=>jp1,nativeEnum:()=>lp1,nan:()=>Dp1,map:()=>fp1,makeIssue:()=>ML,literal:()=>up1,lazy:()=>gp1,late:()=>Bp1,isValid:()=>AK,isDirty:()=>JC,isAsync:()=>Fz,isAborted:()=>QC,intersection:()=>_p1,instanceof:()=>Op1,getParsedType:()=>a7,getErrorMap:()=>qz,function:()=>xp1,enum:()=>mp1,effect:()=>pp1,discriminatedUnion:()=>kp1,defaultErrorMap:()=>LW,datetimeRegex:()=>DA0,date:()=>wp1,custom:()=>wA0,coerce:()=>tp1,boolean:()=>AA0,bigint:()=>Lp1,array:()=>Rp1,any:()=>Tp1,addIssueToContext:()=>B1,ZodVoid:()=>TL,ZodUnknown:()=>TK,ZodUnion:()=>Oz,ZodUndefined:()=>Nz,ZodType:()=>P4,ZodTuple:()=>s7,ZodTransformer:()=>kY,ZodSymbol:()=>AL,ZodString:()=>RY,ZodSet:()=>zH,ZodSchema:()=>P4,ZodRecord:()=>EL,ZodReadonly:()=>Tz,ZodPromise:()=>UH,ZodPipeline:()=>RL,ZodParsedType:()=>W1,ZodOptional:()=>SY,ZodObject:()=>c8,ZodNumber:()=>EK,ZodNullable:()=>PW,ZodNull:()=>Bz,ZodNever:()=>o7,ZodNativeEnum:()=>Pz,ZodNaN:()=>IL,ZodMap:()=>jL,ZodLiteral:()=>wz,ZodLazy:()=>Lz,ZodIssueCode:()=>s0,ZodIntersection:()=>Dz,ZodFunction:()=>zz,ZodFirstPartyTypeKind:()=>k0,ZodError:()=>WJ,ZodEnum:()=>IK,ZodEffects:()=>kY,ZodDiscriminatedUnion:()=>XC,ZodDefault:()=>Mz,ZodDate:()=>FH,ZodCatch:()=>Az,ZodBranded:()=>YC,ZodBoolean:()=>Uz,ZodBigInt:()=>jK,ZodArray:()=>CY,ZodAny:()=>VH,Schema:()=>P4,ParseStatus:()=>I5,OK:()=>QQ,NEVER:()=>ep1,INVALID:()=>a1,EMPTY_PATH:()=>id1,DIRTY:()=>qH,BRAND:()=>Np1});var GC=_(()=>{eR();xa();VA0();PL();TA0();tR()});var ma;var M4=_(()=>{GC();GC();ma=L});var RK="2025-06-18",EA0="2025-03-26",NH,WC="2.0",jA0,IA0,Qc1,mX,$J,CL,t7,lX,$C,RA0,BH=(Q)=>RA0.safeParse(Q).success,CA0,SA0=(Q)=>CA0.safeParse(Q).success,vA0,MW=(Q)=>vA0.safeParse(Q).success,k6,kA0,Ez=(Q)=>kA0.safeParse(Q).success,_Y,AW,KC,Jc1,SL,vL,_A0,Xc1,ZC,yA0=(Q)=>ZC.safeParse(Q).success,Yc1,la,HC,hA0=(Q)=>HC.safeParse(Q).success,qC,Gc1,FC,VC,zC,fA0,bA0,da,xA0,gA0,Wc1,UC,pa,NC,ca,BC,na,$c1,Kc1,Zc1,Hc1,qc1,Fc1,OC,ia,DC,ra,aa,oa,Vc1,zc1,uA0,Uc1,sa,Nc1,Bc1,Oc1,CK,kL,LC,FU6,SK,Dc1,_L,ta,Lc1,wc1,Pc1,Mc1,Ac1,ea,Tc1,Ec1,jc1,Ic1,Rc1,Cc1,Qo,Sc1,vc1,wC,Jo,kc1,_c1,Xo,yc1,VU6,zU6,UU6,NU6,BU6,OU6,_6;var nJ=_(()=>{M4();NH=[RK,"2025-03-26","2024-11-05","2024-10-07"],jA0=L.union([L.string(),L.number().int()]),IA0=L.string(),Qc1=L.object({progressToken:L.optional(jA0)}).passthrough(),mX=L.object({_meta:L.optional(Qc1)}).passthrough(),$J=L.object({method:L.string(),params:L.optional(mX)}),CL=L.object({_meta:L.optional(L.object({}).passthrough())}).passthrough(),t7=L.object({method:L.string(),params:L.optional(CL)}),lX=L.object({_meta:L.optional(L.object({}).passthrough())}).passthrough(),$C=L.union([L.string(),L.number().int()]),RA0=L.object({jsonrpc:L.literal(WC),id:$C}).merge($J).strict(),CA0=L.object({jsonrpc:L.literal(WC)}).merge(t7).strict(),vA0=L.object({jsonrpc:L.literal(WC),id:$C,result:lX}).strict();(function(Q){Q[Q.ConnectionClosed=-32000]="ConnectionClosed",Q[Q.RequestTimeout=-32001]="RequestTimeout",Q[Q.ParseError=-32700]="ParseError",Q[Q.InvalidRequest=-32600]="InvalidRequest",Q[Q.MethodNotFound=-32601]="MethodNotFound",Q[Q.InvalidParams=-32602]="InvalidParams",Q[Q.InternalError=-32603]="InternalError"})(k6||(k6={}));kA0=L.object({jsonrpc:L.literal(WC),id:$C,error:L.object({code:L.number().int(),message:L.string(),data:L.optional(L.unknown())})}).strict(),_Y=L.union([RA0,CA0,vA0,kA0]),AW=lX.strict(),KC=t7.extend({method:L.literal("notifications/cancelled"),params:CL.extend({requestId:$C,reason:L.string().optional()})}),Jc1=L.object({src:L.string(),mimeType:L.optional(L.string()),sizes:L.optional(L.array(L.string()))}).passthrough(),SL=L.object({icons:L.array(Jc1).optional()}).passthrough(),vL=L.object({name:L.string(),title:L.optional(L.string())}).passthrough(),_A0=vL.extend({version:L.string(),websiteUrl:L.optional(L.string())}).merge(SL),Xc1=L.object({experimental:L.optional(L.object({}).passthrough()),sampling:L.optional(L.object({}).passthrough()),elicitation:L.optional(L.object({}).passthrough()),roots:L.optional(L.object({listChanged:L.optional(L.boolean())}).passthrough())}).passthrough(),ZC=$J.extend({method:L.literal("initialize"),params:mX.extend({protocolVersion:L.string(),capabilities:Xc1,clientInfo:_A0})}),Yc1=L.object({experimental:L.optional(L.object({}).passthrough()),logging:L.optional(L.object({}).passthrough()),completions:L.optional(L.object({}).passthrough()),prompts:L.optional(L.object({listChanged:L.optional(L.boolean())}).passthrough()),resources:L.optional(L.object({subscribe:L.optional(L.boolean()),listChanged:L.optional(L.boolean())}).passthrough()),tools:L.optional(L.object({listChanged:L.optional(L.boolean())}).passthrough())}).passthrough(),la=lX.extend({protocolVersion:L.string(),capabilities:Yc1,serverInfo:_A0,instructions:L.optional(L.string())}),HC=t7.extend({method:L.literal("notifications/initialized")}),qC=$J.extend({method:L.literal("ping")}),Gc1=L.object({progress:L.number(),total:L.optional(L.number()),message:L.optional(L.string())}).passthrough(),FC=t7.extend({method:L.literal("notifications/progress"),params:CL.merge(Gc1).extend({progressToken:jA0})}),VC=$J.extend({params:mX.extend({cursor:L.optional(IA0)}).optional()}),zC=lX.extend({nextCursor:L.optional(IA0)}),fA0=L.object({uri:L.string(),mimeType:L.optional(L.string()),_meta:L.optional(L.object({}).passthrough())}).passthrough(),bA0=fA0.extend({text:L.string()}),da=L.string().refine((Q)=>{try{return atob(Q),!0}catch(J){return!1}},{message:"Invalid Base64 string"}),xA0=fA0.extend({blob:da}),gA0=vL.extend({uri:L.string(),description:L.optional(L.string()),mimeType:L.optional(L.string()),_meta:L.optional(L.object({}).passthrough())}).merge(SL),Wc1=vL.extend({uriTemplate:L.string(),description:L.optional(L.string()),mimeType:L.optional(L.string()),_meta:L.optional(L.object({}).passthrough())}).merge(SL),UC=VC.extend({method:L.literal("resources/list")}),pa=zC.extend({resources:L.array(gA0)}),NC=VC.extend({method:L.literal("resources/templates/list")}),ca=zC.extend({resourceTemplates:L.array(Wc1)}),BC=$J.extend({method:L.literal("resources/read"),params:mX.extend({uri:L.string()})}),na=lX.extend({contents:L.array(L.union([bA0,xA0]))}),$c1=t7.extend({method:L.literal("notifications/resources/list_changed")}),Kc1=$J.extend({method:L.literal("resources/subscribe"),params:mX.extend({uri:L.string()})}),Zc1=$J.extend({method:L.literal("resources/unsubscribe"),params:mX.extend({uri:L.string()})}),Hc1=t7.extend({method:L.literal("notifications/resources/updated"),params:CL.extend({uri:L.string()})}),qc1=L.object({name:L.string(),description:L.optional(L.string()),required:L.optional(L.boolean())}).passthrough(),Fc1=vL.extend({description:L.optional(L.string()),arguments:L.optional(L.array(qc1)),_meta:L.optional(L.object({}).passthrough())}).merge(SL),OC=VC.extend({method:L.literal("prompts/list")}),ia=zC.extend({prompts:L.array(Fc1)}),DC=$J.extend({method:L.literal("prompts/get"),params:mX.extend({name:L.string(),arguments:L.optional(L.record(L.string()))})}),ra=L.object({type:L.literal("text"),text:L.string(),_meta:L.optional(L.object({}).passthrough())}).passthrough(),aa=L.object({type:L.literal("image"),data:da,mimeType:L.string(),_meta:L.optional(L.object({}).passthrough())}).passthrough(),oa=L.object({type:L.literal("audio"),data:da,mimeType:L.string(),_meta:L.optional(L.object({}).passthrough())}).passthrough(),Vc1=L.object({type:L.literal("resource"),resource:L.union([bA0,xA0]),_meta:L.optional(L.object({}).passthrough())}).passthrough(),zc1=gA0.extend({type:L.literal("resource_link")}),uA0=L.union([ra,aa,oa,zc1,Vc1]),Uc1=L.object({role:L.enum(["user","assistant"]),content:uA0}).passthrough(),sa=lX.extend({description:L.optional(L.string()),messages:L.array(Uc1)}),Nc1=t7.extend({method:L.literal("notifications/prompts/list_changed")}),Bc1=L.object({title:L.optional(L.string()),readOnlyHint:L.optional(L.boolean()),destructiveHint:L.optional(L.boolean()),idempotentHint:L.optional(L.boolean()),openWorldHint:L.optional(L.boolean())}).passthrough(),Oc1=vL.extend({description:L.optional(L.string()),inputSchema:L.object({type:L.literal("object"),properties:L.optional(L.object({}).passthrough()),required:L.optional(L.array(L.string()))}).passthrough(),outputSchema:L.optional(L.object({type:L.literal("object"),properties:L.optional(L.object({}).passthrough()),required:L.optional(L.array(L.string()))}).passthrough()),annotations:L.optional(Bc1),_meta:L.optional(L.object({}).passthrough())}).merge(SL),CK=VC.extend({method:L.literal("tools/list")}),kL=zC.extend({tools:L.array(Oc1)}),LC=lX.extend({content:L.array(uA0).default([]),structuredContent:L.object({}).passthrough().optional(),isError:L.optional(L.boolean())}),FU6=LC.or(lX.extend({toolResult:L.unknown()})),SK=$J.extend({method:L.literal("tools/call"),params:mX.extend({name:L.string(),arguments:L.optional(L.record(L.unknown()))})}),Dc1=t7.extend({method:L.literal("notifications/tools/list_changed")}),_L=L.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),ta=$J.extend({method:L.literal("logging/setLevel"),params:mX.extend({level:_L})}),Lc1=t7.extend({method:L.literal("notifications/message"),params:CL.extend({level:_L,logger:L.optional(L.string()),data:L.unknown()})}),wc1=L.object({name:L.string().optional()}).passthrough(),Pc1=L.object({hints:L.optional(L.array(wc1)),costPriority:L.optional(L.number().min(0).max(1)),speedPriority:L.optional(L.number().min(0).max(1)),intelligencePriority:L.optional(L.number().min(0).max(1))}).passthrough(),Mc1=L.object({role:L.enum(["user","assistant"]),content:L.union([ra,aa,oa])}).passthrough(),Ac1=$J.extend({method:L.literal("sampling/createMessage"),params:mX.extend({messages:L.array(Mc1),systemPrompt:L.optional(L.string()),includeContext:L.optional(L.enum(["none","thisServer","allServers"])),temperature:L.optional(L.number()),maxTokens:L.number().int(),stopSequences:L.optional(L.array(L.string())),metadata:L.optional(L.object({}).passthrough()),modelPreferences:L.optional(Pc1)})}),ea=lX.extend({model:L.string(),stopReason:L.optional(L.enum(["endTurn","stopSequence","maxTokens"]).or(L.string())),role:L.enum(["user","assistant"]),content:L.discriminatedUnion("type",[ra,aa,oa])}),Tc1=L.object({type:L.literal("boolean"),title:L.optional(L.string()),description:L.optional(L.string()),default:L.optional(L.boolean())}).passthrough(),Ec1=L.object({type:L.literal("string"),title:L.optional(L.string()),description:L.optional(L.string()),minLength:L.optional(L.number()),maxLength:L.optional(L.number()),format:L.optional(L.enum(["email","uri","date","date-time"]))}).passthrough(),jc1=L.object({type:L.enum(["number","integer"]),title:L.optional(L.string()),description:L.optional(L.string()),minimum:L.optional(L.number()),maximum:L.optional(L.number())}).passthrough(),Ic1=L.object({type:L.literal("string"),title:L.optional(L.string()),description:L.optional(L.string()),enum:L.array(L.string()),enumNames:L.optional(L.array(L.string()))}).passthrough(),Rc1=L.union([Tc1,Ec1,jc1,Ic1]),Cc1=$J.extend({method:L.literal("elicitation/create"),params:mX.extend({message:L.string(),requestedSchema:L.object({type:L.literal("object"),properties:L.record(L.string(),Rc1),required:L.optional(L.array(L.string()))}).passthrough()})}),Qo=lX.extend({action:L.enum(["accept","decline","cancel"]),content:L.optional(L.record(L.string(),L.unknown()))}),Sc1=L.object({type:L.literal("ref/resource"),uri:L.string()}).passthrough(),vc1=L.object({type:L.literal("ref/prompt"),name:L.string()}).passthrough(),wC=$J.extend({method:L.literal("completion/complete"),params:mX.extend({ref:L.union([vc1,Sc1]),argument:L.object({name:L.string(),value:L.string()}).passthrough(),context:L.optional(L.object({arguments:L.optional(L.record(L.string(),L.string()))}))})}),Jo=lX.extend({completion:L.object({values:L.array(L.string()).max(100),total:L.optional(L.number().int()),hasMore:L.optional(L.boolean())}).passthrough()}),kc1=L.object({uri:L.string().startsWith("file://"),name:L.optional(L.string()),_meta:L.optional(L.object({}).passthrough())}).passthrough(),_c1=$J.extend({method:L.literal("roots/list")}),Xo=lX.extend({roots:L.array(kc1)}),yc1=t7.extend({method:L.literal("notifications/roots/list_changed")}),VU6=L.union([qC,ZC,wC,ta,DC,OC,UC,NC,BC,Kc1,Zc1,SK,CK]),zU6=L.union([KC,FC,HC,yc1]),UU6=L.union([AW,ea,Qo,Xo]),NU6=L.union([qC,Ac1,Cc1,_c1]),BU6=L.union([KC,FC,Lc1,Hc1,$c1,Dc1,Nc1]),OU6=L.union([AW,la,Jo,sa,ia,pa,ca,na,LC,kL]);_6=class _6 extends Error{constructor(Q,J,X){super(`MCP error ${Q}: ${J}`);this.code=Q,this.data=X,this.name="McpError"}}});class yL{constructor(Q){this._options=Q,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(KC,(J)=>{let X=this._requestHandlerAbortControllers.get(J.params.requestId);X===null||X===void 0||X.abort(J.params.reason)}),this.setNotificationHandler(FC,(J)=>{this._onprogress(J)}),this.setRequestHandler(qC,(J)=>({}))}_setupTimeout(Q,J,X,G,Y=!1){this._timeoutInfo.set(Q,{timeoutId:setTimeout(G,J),startTime:Date.now(),timeout:J,maxTotalTimeout:X,resetTimeoutOnProgress:Y,onTimeout:G})}_resetTimeout(Q){let J=this._timeoutInfo.get(Q);if(!J)return!1;let X=Date.now()-J.startTime;if(J.maxTotalTimeout&&X>=J.maxTotalTimeout)throw this._timeoutInfo.delete(Q),new _6(k6.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:J.maxTotalTimeout,totalElapsed:X});return clearTimeout(J.timeoutId),J.timeoutId=setTimeout(J.onTimeout,J.timeout),!0}_cleanupTimeout(Q){let J=this._timeoutInfo.get(Q);if(J)clearTimeout(J.timeoutId),this._timeoutInfo.delete(Q)}async connect(Q){var J,X,G;this._transport=Q;let Y=(J=this.transport)===null||J===void 0?void 0:J.onclose;this._transport.onclose=()=>{Y===null||Y===void 0||Y(),this._onclose()};let W=(X=this.transport)===null||X===void 0?void 0:X.onerror;this._transport.onerror=(K)=>{W===null||W===void 0||W(K),this._onerror(K)};let $=(G=this._transport)===null||G===void 0?void 0:G.onmessage;this._transport.onmessage=(K,Z)=>{if($===null||$===void 0||$(K,Z),MW(K)||Ez(K))this._onresponse(K);else if(BH(K))this._onrequest(K,Z);else if(SA0(K))this._onnotification(K);else this._onerror(Error(`Unknown message type: ${JSON.stringify(K)}`))},await this._transport.start()}_onclose(){var Q;let J=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(Q=this.onclose)===null||Q===void 0||Q.call(this);let X=new _6(k6.ConnectionClosed,"Connection closed");for(let G of J.values())G(X)}_onerror(Q){var J;(J=this.onerror)===null||J===void 0||J.call(this,Q)}_onnotification(Q){var J;let X=(J=this._notificationHandlers.get(Q.method))!==null&&J!==void 0?J:this.fallbackNotificationHandler;if(X===void 0)return;Promise.resolve().then(()=>X(Q)).catch((G)=>this._onerror(Error(`Uncaught error in notification handler: ${G}`)))}_onrequest(Q,J){var X,G;let Y=(X=this._requestHandlers.get(Q.method))!==null&&X!==void 0?X:this.fallbackRequestHandler,W=this._transport;if(Y===void 0){W===null||W===void 0||W.send({jsonrpc:"2.0",id:Q.id,error:{code:k6.MethodNotFound,message:"Method not found"}}).catch((Z)=>this._onerror(Error(`Failed to send an error response: ${Z}`)));return}let $=new AbortController;this._requestHandlerAbortControllers.set(Q.id,$);let K={signal:$.signal,sessionId:W===null||W===void 0?void 0:W.sessionId,_meta:(G=Q.params)===null||G===void 0?void 0:G._meta,sendNotification:(Z)=>this.notification(Z,{relatedRequestId:Q.id}),sendRequest:(Z,H,q)=>this.request(Z,H,{...q,relatedRequestId:Q.id}),authInfo:J===null||J===void 0?void 0:J.authInfo,requestId:Q.id,requestInfo:J===null||J===void 0?void 0:J.requestInfo};Promise.resolve().then(()=>Y(Q,K)).then((Z)=>{if($.signal.aborted)return;return W===null||W===void 0?void 0:W.send({result:Z,jsonrpc:"2.0",id:Q.id})},(Z)=>{var H;if($.signal.aborted)return;return W===null||W===void 0?void 0:W.send({jsonrpc:"2.0",id:Q.id,error:{code:Number.isSafeInteger(Z.code)?Z.code:k6.InternalError,message:(H=Z.message)!==null&&H!==void 0?H:"Internal error"}})}).catch((Z)=>this._onerror(Error(`Failed to send response: ${Z}`))).finally(()=>{this._requestHandlerAbortControllers.delete(Q.id)})}_onprogress(Q){let{progressToken:J,...X}=Q.params,G=Number(J),Y=this._progressHandlers.get(G);if(!Y){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(Q)}`));return}let W=this._responseHandlers.get(G),$=this._timeoutInfo.get(G);if($&&W&&$.resetTimeoutOnProgress)try{this._resetTimeout(G)}catch(K){W(K);return}Y(X)}_onresponse(Q){let J=Number(Q.id),X=this._responseHandlers.get(J);if(X===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(Q)}`));return}if(this._responseHandlers.delete(J),this._progressHandlers.delete(J),this._cleanupTimeout(J),MW(Q))X(Q);else{let G=new _6(Q.error.code,Q.error.message,Q.error.data);X(G)}}get transport(){return this._transport}async close(){var Q;await((Q=this._transport)===null||Q===void 0?void 0:Q.close())}request(Q,J,X){let{relatedRequestId:G,resumptionToken:Y,onresumptiontoken:W}=X!==null&&X!==void 0?X:{};return new Promise(($,K)=>{var Z,H,q,F,V,z;if(!this._transport){K(Error("Not connected"));return}if(((Z=this._options)===null||Z===void 0?void 0:Z.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod(Q.method);(H=X===null||X===void 0?void 0:X.signal)===null||H===void 0||H.throwIfAborted();let U=this._requestMessageId++,B={...Q,jsonrpc:"2.0",id:U};if(X===null||X===void 0?void 0:X.onprogress)this._progressHandlers.set(U,X.onprogress),B.params={...Q.params,_meta:{...((q=Q.params)===null||q===void 0?void 0:q._meta)||{},progressToken:U}};let D=(E)=>{var P;this._responseHandlers.delete(U),this._progressHandlers.delete(U),this._cleanupTimeout(U),(P=this._transport)===null||P===void 0||P.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:U,reason:String(E)}},{relatedRequestId:G,resumptionToken:Y,onresumptiontoken:W}).catch((M)=>this._onerror(Error(`Failed to send cancellation: ${M}`))),K(E)};this._responseHandlers.set(U,(E)=>{var P;if((P=X===null||X===void 0?void 0:X.signal)===null||P===void 0?void 0:P.aborted)return;if(E instanceof Error)return K(E);try{let M=J.parse(E.result);$(M)}catch(M){K(M)}}),(F=X===null||X===void 0?void 0:X.signal)===null||F===void 0||F.addEventListener("abort",()=>{var E;D((E=X===null||X===void 0?void 0:X.signal)===null||E===void 0?void 0:E.reason)});let w=(V=X===null||X===void 0?void 0:X.timeout)!==null&&V!==void 0?V:hc1,A=()=>D(new _6(k6.RequestTimeout,"Request timed out",{timeout:w}));this._setupTimeout(U,w,X===null||X===void 0?void 0:X.maxTotalTimeout,A,(z=X===null||X===void 0?void 0:X.resetTimeoutOnProgress)!==null&&z!==void 0?z:!1),this._transport.send(B,{relatedRequestId:G,resumptionToken:Y,onresumptiontoken:W}).catch((E)=>{this._cleanupTimeout(U),K(E)})})}async notification(Q,J){var X,G;if(!this._transport)throw Error("Not connected");if(this.assertNotificationCapability(Q.method),((G=(X=this._options)===null||X===void 0?void 0:X.debouncedNotificationMethods)!==null&&G!==void 0?G:[]).includes(Q.method)&&!Q.params&&!(J===null||J===void 0?void 0:J.relatedRequestId)){if(this._pendingDebouncedNotifications.has(Q.method))return;this._pendingDebouncedNotifications.add(Q.method),Promise.resolve().then(()=>{var K;if(this._pendingDebouncedNotifications.delete(Q.method),!this._transport)return;let Z={...Q,jsonrpc:"2.0"};(K=this._transport)===null||K===void 0||K.send(Z,J).catch((H)=>this._onerror(H))});return}let $={...Q,jsonrpc:"2.0"};await this._transport.send($,J)}setRequestHandler(Q,J){let X=Q.shape.method.value;this.assertRequestHandlerCapability(X),this._requestHandlers.set(X,(G,Y)=>{return Promise.resolve(J(Q.parse(G),Y))})}removeRequestHandler(Q){this._requestHandlers.delete(Q)}assertCanSetRequestHandler(Q){if(this._requestHandlers.has(Q))throw Error(`A request handler for ${Q} already exists, which would be overridden`)}setNotificationHandler(Q,J){this._notificationHandlers.set(Q.shape.method.value,(X)=>Promise.resolve(J(Q.parse(X))))}removeNotificationHandler(Q){this._notificationHandlers.delete(Q)}}function PC(Q,J){return Object.entries(J).reduce((X,[G,Y])=>{if(Y&&typeof Y==="object")X[G]=X[G]?{...X[G],...Y}:Y;else X[G]=Y;return X},{...Q})}var hc1=60000;var Yo=_(()=>{nJ()});var lA0=I((MC,mA0)=>{(function(Q,J){typeof MC==="object"&&typeof mA0<"u"?J(MC):typeof define==="function"&&define.amd?define(["exports"],J):J(Q.URI=Q.URI||{})})(MC,function(Q){function J(){for(var t=arguments.length,o=Array(t),F0=0;F0<t;F0++)o[F0]=arguments[F0];if(o.length>1){o[0]=o[0].slice(0,-1);var A0=o.length-1;for(var W0=1;W0<A0;++W0)o[W0]=o[W0].slice(1,-1);return o[A0]=o[A0].slice(1),o.join("")}else return o[0]}function X(t){return"(?:"+t+")"}function G(t){return t===void 0?"undefined":t===null?"null":Object.prototype.toString.call(t).split(" ").pop().split("]").shift().toLowerCase()}function Y(t){return t.toUpperCase()}function W(t){return t!==void 0&&t!==null?t instanceof Array?t:typeof t.length!=="number"||t.split||t.setInterval||t.call?[t]:Array.prototype.slice.call(t):[]}function $(t,o){var F0=t;if(o)for(var A0 in o)F0[A0]=o[A0];return F0}function K(t){var o="[A-Za-z]",F0="[\\x0D]",A0="[0-9]",W0="[\\x22]",p0=J(A0,"[A-Fa-f]"),m1="[\\x0A]",O4="[\\x20]",F6=X(X("%[EFef]"+p0+"%"+p0+p0+"%"+p0+p0)+"|"+X("%[89A-Fa-f]"+p0+"%"+p0+p0)+"|"+X("%"+p0+p0)),U9="[\\:\\/\\?\\#\\[\\]\\@]",n4="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",x8=J(U9,n4),N9=t?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",M8=t?"[\\uE000-\\uF8FF]":"[]",V6=J(o,A0,"[\\-\\.\\_\\~]",N9),g8=X(o+J(o,A0,"[\\+\\-\\.]")+"*"),l6=X(X(F6+"|"+J(V6,n4,"[\\:]"))+"*"),IZ=X(X("25[0-5]")+"|"+X("2[0-4]"+A0)+"|"+X("1"+A0+A0)+"|"+X("[1-9]"+A0)+"|"+A0),wJ=X(X("25[0-5]")+"|"+X("2[0-4]"+A0)+"|"+X("1"+A0+A0)+"|"+X("0?[1-9]"+A0)+"|0?0?"+A0),$X=X(wJ+"\\."+wJ+"\\."+wJ+"\\."+wJ),a6=X(p0+"{1,4}"),PJ=X(X(a6+"\\:"+a6)+"|"+$X),KX=X(X(a6+"\\:")+"{6}"+PJ),Y7=X("\\:\\:"+X(a6+"\\:")+"{5}"+PJ),RZ=X(X(a6)+"?\\:\\:"+X(a6+"\\:")+"{4}"+PJ),CG=X(X(X(a6+"\\:")+"{0,1}"+a6)+"?\\:\\:"+X(a6+"\\:")+"{3}"+PJ),SN=X(X(X(a6+"\\:")+"{0,2}"+a6)+"?\\:\\:"+X(a6+"\\:")+"{2}"+PJ),w2=X(X(X(a6+"\\:")+"{0,3}"+a6)+"?\\:\\:"+a6+"\\:"+PJ),P2=X(X(X(a6+"\\:")+"{0,4}"+a6)+"?\\:\\:"+PJ),mq=X(X(X(a6+"\\:")+"{0,5}"+a6)+"?\\:\\:"+a6),lq=X(X(X(a6+"\\:")+"{0,6}"+a6)+"?\\:\\:"),SG=X([KX,Y7,RZ,CG,SN,w2,P2,mq,lq].join("|")),dq=X(X(V6+"|"+F6)+"+"),rh=X(SG+"\\%25"+dq),CZ=X(SG+X("\\%25|\\%(?!"+p0+"{2})")+dq),pF1=X("[vV]"+p0+"+\\."+J(V6,n4,"[\\:]")+"+"),cF1=X("\\["+X(CZ+"|"+SG+"|"+pF1)+"\\]"),kG0=X(X(F6+"|"+J(V6,n4))+"*"),vN=X(cF1+"|"+$X+"(?!"+kG0+")|"+kG0),kN=X(A0+"*"),_G0=X(X(l6+"@")+"?"+vN+X("\\:"+kN)+"?"),_N=X(F6+"|"+J(V6,n4,"[\\:\\@]")),nF1=X(_N+"*"),yG0=X(_N+"+"),iF1=X(X(F6+"|"+J(V6,n4,"[\\@]"))+"+"),vG=X(X("\\/"+nF1)+"*"),pq=X("\\/"+X(yG0+vG)+"?"),ah=X(iF1+vG),M2=X(yG0+vG),cq="(?!"+_N+")",Lm4=X(vG+"|"+pq+"|"+ah+"|"+M2+"|"+cq),nq=X(X(_N+"|"+J("[\\/\\?]",M8))+"*"),yN=X(X(_N+"|[\\/\\?]")+"*"),hG0=X(X("\\/\\/"+_G0+vG)+"|"+pq+"|"+M2+"|"+cq),rF1=X(g8+"\\:"+hG0+X("\\?"+nq)+"?"+X("\\#"+yN)+"?"),aF1=X(X("\\/\\/"+_G0+vG)+"|"+pq+"|"+ah+"|"+cq),oF1=X(aF1+X("\\?"+nq)+"?"+X("\\#"+yN)+"?"),wm4=X(rF1+"|"+oF1),Pm4=X(g8+"\\:"+hG0+X("\\?"+nq)+"?"),Mm4="^("+g8+")\\:"+X(X("\\/\\/("+X("("+l6+")@")+"?("+vN+")"+X("\\:("+kN+")")+"?)")+"?("+vG+"|"+pq+"|"+M2+"|"+cq+")")+X("\\?("+nq+")")+"?"+X("\\#("+yN+")")+"?$",Am4="^(){0}"+X(X("\\/\\/("+X("("+l6+")@")+"?("+vN+")"+X("\\:("+kN+")")+"?)")+"?("+vG+"|"+pq+"|"+ah+"|"+cq+")")+X("\\?("+nq+")")+"?"+X("\\#("+yN+")")+"?$",Tm4="^("+g8+")\\:"+X(X("\\/\\/("+X("("+l6+")@")+"?("+vN+")"+X("\\:("+kN+")")+"?)")+"?("+vG+"|"+pq+"|"+M2+"|"+cq+")")+X("\\?("+nq+")")+"?$",Em4="^"+X("\\#("+yN+")")+"?$",jm4="^"+X("("+l6+")@")+"?("+vN+")"+X("\\:("+kN+")")+"?$";return{NOT_SCHEME:new RegExp(J("[^]",o,A0,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(J("[^\\%\\:]",V6,n4),"g"),NOT_HOST:new RegExp(J("[^\\%\\[\\]\\:]",V6,n4),"g"),NOT_PATH:new RegExp(J("[^\\%\\/\\:\\@]",V6,n4),"g"),NOT_PATH_NOSCHEME:new RegExp(J("[^\\%\\/\\@]",V6,n4),"g"),NOT_QUERY:new RegExp(J("[^\\%]",V6,n4,"[\\:\\@\\/\\?]",M8),"g"),NOT_FRAGMENT:new RegExp(J("[^\\%]",V6,n4,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(J("[^]",V6,n4),"g"),UNRESERVED:new RegExp(V6,"g"),OTHER_CHARS:new RegExp(J("[^\\%]",V6,x8),"g"),PCT_ENCODED:new RegExp(F6,"g"),IPV4ADDRESS:new RegExp("^("+$X+")$"),IPV6ADDRESS:new RegExp("^\\[?("+SG+")"+X(X("\\%25|\\%(?!"+p0+"{2})")+"("+dq+")")+"?\\]?$")}}var Z=K(!1),H=K(!0),q=function(){function t(o,F0){var A0=[],W0=!0,p0=!1,m1=void 0;try{for(var O4=o[Symbol.iterator](),F6;!(W0=(F6=O4.next()).done);W0=!0)if(A0.push(F6.value),F0&&A0.length===F0)break}catch(U9){p0=!0,m1=U9}finally{try{if(!W0&&O4.return)O4.return()}finally{if(p0)throw m1}}return A0}return function(o,F0){if(Array.isArray(o))return o;else if(Symbol.iterator in Object(o))return t(o,F0);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),F=function(t){if(Array.isArray(t)){for(var o=0,F0=Array(t.length);o<t.length;o++)F0[o]=t[o];return F0}else return Array.from(t)},V=2147483647,z=36,U=1,B=26,D=38,w=700,A=72,E=128,P="-",M=/^xn--/,T=/[^\0-\x7E]/,R=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=z-U,y=Math.floor,f=String.fromCharCode;function l(t){throw RangeError(S[t])}function b(t,o){var F0=[],A0=t.length;while(A0--)F0[A0]=o(t[A0]);return F0}function v(t,o){var F0=t.split("@"),A0="";if(F0.length>1)A0=F0[0]+"@",t=F0[1];t=t.replace(R,".");var W0=t.split("."),p0=b(W0,o).join(".");return A0+p0}function g(t){var o=[],F0=0,A0=t.length;while(F0<A0){var W0=t.charCodeAt(F0++);if(W0>=55296&&W0<=56319&&F0<A0){var p0=t.charCodeAt(F0++);if((p0&64512)==56320)o.push(((W0&1023)<<10)+(p0&1023)+65536);else o.push(W0),F0--}else o.push(W0)}return o}var e=function(o){return String.fromCodePoint.apply(String,F(o))},a=function(o){if(o-48<10)return o-22;if(o-65<26)return o-65;if(o-97<26)return o-97;return z},$0=function(o,F0){return o+22+75*(o<26)-((F0!=0)<<5)},U0=function(o,F0,A0){var W0=0;o=A0?y(o/w):o>>1,o+=y(o/F0);for(;o>k*B>>1;W0+=z)o=y(o/k);return y(W0+(k+1)*o/(o+D))},X0=function(o){var F0=[],A0=o.length,W0=0,p0=E,m1=A,O4=o.lastIndexOf(P);if(O4<0)O4=0;for(var F6=0;F6<O4;++F6){if(o.charCodeAt(F6)>=128)l("not-basic");F0.push(o.charCodeAt(F6))}for(var U9=O4>0?O4+1:0;U9<A0;){var n4=W0;for(var x8=1,N9=z;;N9+=z){if(U9>=A0)l("invalid-input");var M8=a(o.charCodeAt(U9++));if(M8>=z||M8>y((V-W0)/x8))l("overflow");W0+=M8*x8;var V6=N9<=m1?U:N9>=m1+B?B:N9-m1;if(M8<V6)break;var g8=z-V6;if(x8>y(V/g8))l("overflow");x8*=g8}var l6=F0.length+1;if(m1=U0(W0-n4,l6,n4==0),y(W0/l6)>V-p0)l("overflow");p0+=y(W0/l6),W0%=l6,F0.splice(W0++,0,p0)}return String.fromCodePoint.apply(String,F0)},L0=function(o){var F0=[];o=g(o);var A0=o.length,W0=E,p0=0,m1=A,O4=!0,F6=!1,U9=void 0;try{for(var n4=o[Symbol.iterator](),x8;!(O4=(x8=n4.next()).done);O4=!0){var N9=x8.value;if(N9<128)F0.push(f(N9))}}catch(CZ){F6=!0,U9=CZ}finally{try{if(!O4&&n4.return)n4.return()}finally{if(F6)throw U9}}var M8=F0.length,V6=M8;if(M8)F0.push(P);while(V6<A0){var g8=V,l6=!0,IZ=!1,wJ=void 0;try{for(var $X=o[Symbol.iterator](),a6;!(l6=(a6=$X.next()).done);l6=!0){var PJ=a6.value;if(PJ>=W0&&PJ<g8)g8=PJ}}catch(CZ){IZ=!0,wJ=CZ}finally{try{if(!l6&&$X.return)$X.return()}finally{if(IZ)throw wJ}}var KX=V6+1;if(g8-W0>y((V-p0)/KX))l("overflow");p0+=(g8-W0)*KX,W0=g8;var Y7=!0,RZ=!1,CG=void 0;try{for(var SN=o[Symbol.iterator](),w2;!(Y7=(w2=SN.next()).done);Y7=!0){var P2=w2.value;if(P2<W0&&++p0>V)l("overflow");if(P2==W0){var mq=p0;for(var lq=z;;lq+=z){var SG=lq<=m1?U:lq>=m1+B?B:lq-m1;if(mq<SG)break;var dq=mq-SG,rh=z-SG;F0.push(f($0(SG+dq%rh,0))),mq=y(dq/rh)}F0.push(f($0(mq,0))),m1=U0(p0,KX,V6==M8),p0=0,++V6}}}catch(CZ){RZ=!0,CG=CZ}finally{try{if(!Y7&&SN.return)SN.return()}finally{if(RZ)throw CG}}++p0,++W0}return F0.join("")},R0=function(o){return v(o,function(F0){return M.test(F0)?X0(F0.slice(4).toLowerCase()):F0})},b0=function(o){return v(o,function(F0){return T.test(F0)?"xn--"+L0(F0):F0})},r0={version:"2.1.0",ucs2:{decode:g,encode:e},decode:X0,encode:L0,toASCII:b0,toUnicode:R0},D0={};function H0(t){var o=t.charCodeAt(0),F0=void 0;if(o<16)F0="%0"+o.toString(16).toUpperCase();else if(o<128)F0="%"+o.toString(16).toUpperCase();else if(o<2048)F0="%"+(o>>6|192).toString(16).toUpperCase()+"%"+(o&63|128).toString(16).toUpperCase();else F0="%"+(o>>12|224).toString(16).toUpperCase()+"%"+(o>>6&63|128).toString(16).toUpperCase()+"%"+(o&63|128).toString(16).toUpperCase();return F0}function S0(t){var o="",F0=0,A0=t.length;while(F0<A0){var W0=parseInt(t.substr(F0+1,2),16);if(W0<128)o+=String.fromCharCode(W0),F0+=3;else if(W0>=194&&W0<224){if(A0-F0>=6){var p0=parseInt(t.substr(F0+4,2),16);o+=String.fromCharCode((W0&31)<<6|p0&63)}else o+=t.substr(F0,6);F0+=6}else if(W0>=224){if(A0-F0>=9){var m1=parseInt(t.substr(F0+4,2),16),O4=parseInt(t.substr(F0+7,2),16);o+=String.fromCharCode((W0&15)<<12|(m1&63)<<6|O4&63)}else o+=t.substr(F0,9);F0+=9}else o+=t.substr(F0,3),F0+=3}return o}function b1(t,o){function F0(A0){var W0=S0(A0);return!W0.match(o.UNRESERVED)?A0:W0}if(t.scheme)t.scheme=String(t.scheme).replace(o.PCT_ENCODED,F0).toLowerCase().replace(o.NOT_SCHEME,"");if(t.userinfo!==void 0)t.userinfo=String(t.userinfo).replace(o.PCT_ENCODED,F0).replace(o.NOT_USERINFO,H0).replace(o.PCT_ENCODED,Y);if(t.host!==void 0)t.host=String(t.host).replace(o.PCT_ENCODED,F0).toLowerCase().replace(o.NOT_HOST,H0).replace(o.PCT_ENCODED,Y);if(t.path!==void 0)t.path=String(t.path).replace(o.PCT_ENCODED,F0).replace(t.scheme?o.NOT_PATH:o.NOT_PATH_NOSCHEME,H0).replace(o.PCT_ENCODED,Y);if(t.query!==void 0)t.query=String(t.query).replace(o.PCT_ENCODED,F0).replace(o.NOT_QUERY,H0).replace(o.PCT_ENCODED,Y);if(t.fragment!==void 0)t.fragment=String(t.fragment).replace(o.PCT_ENCODED,F0).replace(o.NOT_FRAGMENT,H0).replace(o.PCT_ENCODED,Y);return t}function C1(t){return t.replace(/^0*(.*)/,"$1")||"0"}function h0(t,o){var F0=t.match(o.IPV4ADDRESS)||[],A0=q(F0,2),W0=A0[1];if(W0)return W0.split(".").map(C1).join(".");else return t}function B0(t,o){var F0=t.match(o.IPV6ADDRESS)||[],A0=q(F0,3),W0=A0[1],p0=A0[2];if(W0){var m1=W0.toLowerCase().split("::").reverse(),O4=q(m1,2),F6=O4[0],U9=O4[1],n4=U9?U9.split(":").map(C1):[],x8=F6.split(":").map(C1),N9=o.IPV4ADDRESS.test(x8[x8.length-1]),M8=N9?7:8,V6=x8.length-M8,g8=Array(M8);for(var l6=0;l6<M8;++l6)g8[l6]=n4[l6]||x8[V6+l6]||"";if(N9)g8[M8-1]=h0(g8[M8-1],o);var IZ=g8.reduce(function(KX,Y7,RZ){if(!Y7||Y7==="0"){var CG=KX[KX.length-1];if(CG&&CG.index+CG.length===RZ)CG.length++;else KX.push({index:RZ,length:1})}return KX},[]),wJ=IZ.sort(function(KX,Y7){return Y7.length-KX.length})[0],$X=void 0;if(wJ&&wJ.length>1){var a6=g8.slice(0,wJ.index),PJ=g8.slice(wJ.index+wJ.length);$X=a6.join(":")+"::"+PJ.join(":")}else $X=g8.join(":");if(p0)$X+="%"+p0;return $X}else return t}var z0=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,j0="".match(/(){0}/)[1]===void 0;function G0(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F0={},A0=o.iri!==!1?H:Z;if(o.reference==="suffix")t=(o.scheme?o.scheme+":":"")+"//"+t;var W0=t.match(z0);if(W0){if(j0){if(F0.scheme=W0[1],F0.userinfo=W0[3],F0.host=W0[4],F0.port=parseInt(W0[5],10),F0.path=W0[6]||"",F0.query=W0[7],F0.fragment=W0[8],isNaN(F0.port))F0.port=W0[5]}else if(F0.scheme=W0[1]||void 0,F0.userinfo=t.indexOf("@")!==-1?W0[3]:void 0,F0.host=t.indexOf("//")!==-1?W0[4]:void 0,F0.port=parseInt(W0[5],10),F0.path=W0[6]||"",F0.query=t.indexOf("?")!==-1?W0[7]:void 0,F0.fragment=t.indexOf("#")!==-1?W0[8]:void 0,isNaN(F0.port))F0.port=t.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?W0[4]:void 0;if(F0.host)F0.host=B0(h0(F0.host,A0),A0);if(F0.scheme===void 0&&F0.userinfo===void 0&&F0.host===void 0&&F0.port===void 0&&!F0.path&&F0.query===void 0)F0.reference="same-document";else if(F0.scheme===void 0)F0.reference="relative";else if(F0.fragment===void 0)F0.reference="absolute";else F0.reference="uri";if(o.reference&&o.reference!=="suffix"&&o.reference!==F0.reference)F0.error=F0.error||"URI is not a "+o.reference+" reference.";var p0=D0[(o.scheme||F0.scheme||"").toLowerCase()];if(!o.unicodeSupport&&(!p0||!p0.unicodeSupport)){if(F0.host&&(o.domainHost||p0&&p0.domainHost))try{F0.host=r0.toASCII(F0.host.replace(A0.PCT_ENCODED,S0).toLowerCase())}catch(m1){F0.error=F0.error||"Host's domain name can not be converted to ASCII via punycode: "+m1}b1(F0,Z)}else b1(F0,A0);if(p0&&p0.parse)p0.parse(F0,o)}else F0.error=F0.error||"URI can not be parsed.";return F0}function O0(t,o){var F0=o.iri!==!1?H:Z,A0=[];if(t.userinfo!==void 0)A0.push(t.userinfo),A0.push("@");if(t.host!==void 0)A0.push(B0(h0(String(t.host),F0),F0).replace(F0.IPV6ADDRESS,function(W0,p0,m1){return"["+p0+(m1?"%25"+m1:"")+"]"}));if(typeof t.port==="number"||typeof t.port==="string")A0.push(":"),A0.push(String(t.port));return A0.length?A0.join(""):void 0}var m0=/^\.\.?\//,C0=/^\/\.(\/|$)/,f0=/^\/\.\.(\/|$)/,k1=/^\/?(?:.|\n)*?(?=\/|$)/;function u0(t){var o=[];while(t.length)if(t.match(m0))t=t.replace(m0,"");else if(t.match(C0))t=t.replace(C0,"/");else if(t.match(f0))t=t.replace(f0,"/"),o.pop();else if(t==="."||t==="..")t="";else{var F0=t.match(k1);if(F0){var A0=F0[0];t=t.slice(A0.length),o.push(A0)}else throw Error("Unexpected dot segment condition")}return o.join("")}function j1(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F0=o.iri?H:Z,A0=[],W0=D0[(o.scheme||t.scheme||"").toLowerCase()];if(W0&&W0.serialize)W0.serialize(t,o);if(t.host){if(F0.IPV6ADDRESS.test(t.host));else if(o.domainHost||W0&&W0.domainHost)try{t.host=!o.iri?r0.toASCII(t.host.replace(F0.PCT_ENCODED,S0).toLowerCase()):r0.toUnicode(t.host)}catch(O4){t.error=t.error||"Host's domain name can not be converted to "+(!o.iri?"ASCII":"Unicode")+" via punycode: "+O4}}if(b1(t,F0),o.reference!=="suffix"&&t.scheme)A0.push(t.scheme),A0.push(":");var p0=O0(t,o);if(p0!==void 0){if(o.reference!=="suffix")A0.push("//");if(A0.push(p0),t.path&&t.path.charAt(0)!=="/")A0.push("/")}if(t.path!==void 0){var m1=t.path;if(!o.absolutePath&&(!W0||!W0.absolutePath))m1=u0(m1);if(p0===void 0)m1=m1.replace(/^\/\//,"/%2F");A0.push(m1)}if(t.query!==void 0)A0.push("?"),A0.push(t.query);if(t.fragment!==void 0)A0.push("#"),A0.push(t.fragment);return A0.join("")}function Z4(t,o){var F0=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A0=arguments[3],W0={};if(!A0)t=G0(j1(t,F0),F0),o=G0(j1(o,F0),F0);if(F0=F0||{},!F0.tolerant&&o.scheme)W0.scheme=o.scheme,W0.userinfo=o.userinfo,W0.host=o.host,W0.port=o.port,W0.path=u0(o.path||""),W0.query=o.query;else{if(o.userinfo!==void 0||o.host!==void 0||o.port!==void 0)W0.userinfo=o.userinfo,W0.host=o.host,W0.port=o.port,W0.path=u0(o.path||""),W0.query=o.query;else{if(!o.path)if(W0.path=t.path,o.query!==void 0)W0.query=o.query;else W0.query=t.query;else{if(o.path.charAt(0)==="/")W0.path=u0(o.path);else{if((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path)W0.path="/"+o.path;else if(!t.path)W0.path=o.path;else W0.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+o.path;W0.path=u0(W0.path)}W0.query=o.query}W0.userinfo=t.userinfo,W0.host=t.host,W0.port=t.port}W0.scheme=t.scheme}return W0.fragment=o.fragment,W0}function $1(t,o,F0){var A0=$({scheme:"null"},F0);return j1(Z4(G0(t,A0),G0(o,A0),A0,!0),A0)}function v0(t,o){if(typeof t==="string")t=j1(G0(t,o),o);else if(G(t)==="object")t=G0(j1(t,o),o);return t}function Y1(t,o,F0){if(typeof t==="string")t=j1(G0(t,F0),F0);else if(G(t)==="object")t=j1(t,F0);if(typeof o==="string")o=j1(G0(o,F0),F0);else if(G(o)==="object")o=j1(o,F0);return t===o}function H6(t,o){return t&&t.toString().replace(!o||!o.iri?Z.ESCAPE:H.ESCAPE,H0)}function L4(t,o){return t&&t.toString().replace(!o||!o.iri?Z.PCT_ENCODED:H.PCT_ENCODED,S0)}var K8={scheme:"http",domainHost:!0,parse:function(o,F0){if(!o.host)o.error=o.error||"HTTP URIs must have a host.";return o},serialize:function(o,F0){var A0=String(o.scheme).toLowerCase()==="https";if(o.port===(A0?443:80)||o.port==="")o.port=void 0;if(!o.path)o.path="/";return o}},i1={scheme:"https",domainHost:K8.domainHost,parse:K8.parse,serialize:K8.serialize};function t1(t){return typeof t.secure==="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}var WQ={scheme:"ws",domainHost:!0,parse:function(o,F0){var A0=o;return A0.secure=t1(A0),A0.resourceName=(A0.path||"/")+(A0.query?"?"+A0.query:""),A0.path=void 0,A0.query=void 0,A0},serialize:function(o,F0){if(o.port===(t1(o)?443:80)||o.port==="")o.port=void 0;if(typeof o.secure==="boolean")o.scheme=o.secure?"wss":"ws",o.secure=void 0;if(o.resourceName){var A0=o.resourceName.split("?"),W0=q(A0,2),p0=W0[0],m1=W0[1];o.path=p0&&p0!=="/"?p0:void 0,o.query=m1,o.resourceName=void 0}return o.fragment=void 0,o}},O={scheme:"wss",domainHost:WQ.domainHost,parse:WQ.parse,serialize:WQ.serialize},h={},Q0=!0,q0="[A-Za-z0-9\\-\\.\\_\\~"+(Q0?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",N="[0-9A-Fa-f]",j=X(X("%[EFef]"+N+"%"+N+N+"%"+N+N)+"|"+X("%[89A-Fa-f]"+N+"%"+N+N)+"|"+X("%"+N+N)),c="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Y0="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Z0=J(Y0,"[\\\"\\\\]"),i="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",x0=new RegExp(q0,"g"),A1=new RegExp(j,"g"),h1=new RegExp(J("[^]",c,"[\\.]","[\\\"]",Z0),"g"),d0=new RegExp(J("[^]",q0,i),"g"),g1=d0;function q6(t){var o=S0(t);return!o.match(x0)?t:o}var E9={scheme:"mailto",parse:function(o,F0){var A0=o,W0=A0.to=A0.path?A0.path.split(","):[];if(A0.path=void 0,A0.query){var p0=!1,m1={},O4=A0.query.split("&");for(var F6=0,U9=O4.length;F6<U9;++F6){var n4=O4[F6].split("=");switch(n4[0]){case"to":var x8=n4[1].split(",");for(var N9=0,M8=x8.length;N9<M8;++N9)W0.push(x8[N9]);break;case"subject":A0.subject=L4(n4[1],F0);break;case"body":A0.body=L4(n4[1],F0);break;default:p0=!0,m1[L4(n4[0],F0)]=L4(n4[1],F0);break}}if(p0)A0.headers=m1}A0.query=void 0;for(var V6=0,g8=W0.length;V6<g8;++V6){var l6=W0[V6].split("@");if(l6[0]=L4(l6[0]),!F0.unicodeSupport)try{l6[1]=r0.toASCII(L4(l6[1],F0).toLowerCase())}catch(IZ){A0.error=A0.error||"Email address's domain name can not be converted to ASCII via punycode: "+IZ}else l6[1]=L4(l6[1],F0).toLowerCase();W0[V6]=l6.join("@")}return A0},serialize:function(o,F0){var A0=o,W0=W(o.to);if(W0){for(var p0=0,m1=W0.length;p0<m1;++p0){var O4=String(W0[p0]),F6=O4.lastIndexOf("@"),U9=O4.slice(0,F6).replace(A1,q6).replace(A1,Y).replace(h1,H0),n4=O4.slice(F6+1);try{n4=!F0.iri?r0.toASCII(L4(n4,F0).toLowerCase()):r0.toUnicode(n4)}catch(V6){A0.error=A0.error||"Email address's domain name can not be converted to "+(!F0.iri?"ASCII":"Unicode")+" via punycode: "+V6}W0[p0]=U9+"@"+n4}A0.path=W0.join(",")}var x8=o.headers=o.headers||{};if(o.subject)x8.subject=o.subject;if(o.body)x8.body=o.body;var N9=[];for(var M8 in x8)if(x8[M8]!==h[M8])N9.push(M8.replace(A1,q6).replace(A1,Y).replace(d0,H0)+"="+x8[M8].replace(A1,q6).replace(A1,Y).replace(g1,H0));if(N9.length)A0.query=N9.join("&");return A0}},K1=/^([^\:]+)\:(.*)/,O6={scheme:"urn",parse:function(o,F0){var A0=o.path&&o.path.match(K1),W0=o;if(A0){var p0=F0.scheme||W0.scheme||"urn",m1=A0[1].toLowerCase(),O4=A0[2],F6=p0+":"+(F0.nid||m1),U9=D0[F6];if(W0.nid=m1,W0.nss=O4,W0.path=void 0,U9)W0=U9.parse(W0,F0)}else W0.error=W0.error||"URN can not be parsed.";return W0},serialize:function(o,F0){var A0=F0.scheme||o.scheme||"urn",W0=o.nid,p0=A0+":"+(F0.nid||W0),m1=D0[p0];if(m1)o=m1.serialize(o,F0);var O4=o,F6=o.nss;return O4.path=(W0||F0.nid)+":"+F6,O4}},ZY=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,LJ={scheme:"urn:uuid",parse:function(o,F0){var A0=o;if(A0.uuid=A0.nss,A0.nss=void 0,!F0.tolerant&&(!A0.uuid||!A0.uuid.match(ZY)))A0.error=A0.error||"UUID is not valid.";return A0},serialize:function(o,F0){var A0=o;return A0.nss=(o.uuid||"").toLowerCase(),A0}};D0[K8.scheme]=K8,D0[i1.scheme]=i1,D0[WQ.scheme]=WQ,D0[O.scheme]=O,D0[E9.scheme]=E9,D0[O6.scheme]=O6,D0[LJ.scheme]=LJ,Q.SCHEMES=D0,Q.pctEncChar=H0,Q.pctDecChars=S0,Q.parse=G0,Q.removeDotSegments=u0,Q.serialize=j1,Q.resolveComponents=Z4,Q.resolve=$1,Q.normalize=v0,Q.equal=Y1,Q.escapeComponent=H6,Q.unescapeComponent=L4,Object.defineProperty(Q,"__esModule",{value:!0})})});var AC=I((PU6,dA0)=>{dA0.exports=function Q(J,X){if(J===X)return!0;if(J&&X&&typeof J=="object"&&typeof X=="object"){if(J.constructor!==X.constructor)return!1;var G,Y,W;if(Array.isArray(J)){if(G=J.length,G!=X.length)return!1;for(Y=G;Y--!==0;)if(!Q(J[Y],X[Y]))return!1;return!0}if(J.constructor===RegExp)return J.source===X.source&&J.flags===X.flags;if(J.valueOf!==Object.prototype.valueOf)return J.valueOf()===X.valueOf();if(J.toString!==Object.prototype.toString)return J.toString()===X.toString();if(W=Object.keys(J),G=W.length,G!==Object.keys(X).length)return!1;for(Y=G;Y--!==0;)if(!Object.prototype.hasOwnProperty.call(X,W[Y]))return!1;for(Y=G;Y--!==0;){var $=W[Y];if(!Q(J[$],X[$]))return!1}return!0}return J!==J&&X!==X}});var cA0=I((MU6,pA0)=>{pA0.exports=function(J){var X=0,G=J.length,Y=0,W;while(Y<G)if(X++,W=J.charCodeAt(Y++),W>=55296&&W<=56319&&Y<G){if(W=J.charCodeAt(Y),(W&64512)==56320)Y++}return X}});var OH=I((AU6,rA0)=>{rA0.exports={copy:fc1,checkDataType:Go,checkDataTypes:bc1,coerceToTypes:xc1,toHash:$o,getProperty:Ko,escapeQuotes:Zo,equal:AC(),ucs2length:cA0(),varOccurences:mc1,varReplace:lc1,schemaHasRules:dc1,schemaHasRulesExcept:pc1,schemaUnknownRules:cc1,toQuotedString:Wo,getPathExpr:nc1,getPath:ic1,getData:oc1,unescapeFragment:sc1,unescapeJsonPointer:qo,escapeFragment:tc1,escapeJsonPointer:Ho};function fc1(Q,J){J=J||{};for(var X in Q)J[X]=Q[X];return J}function Go(Q,J,X,G){var Y=G?" !== ":" === ",W=G?" || ":" && ",$=G?"!":"",K=G?"":"!";switch(Q){case"null":return J+Y+"null";case"array":return $+"Array.isArray("+J+")";case"object":return"("+$+J+W+"typeof "+J+Y+'"object"'+W+K+"Array.isArray("+J+"))";case"integer":return"(typeof "+J+Y+'"number"'+W+K+"("+J+" % 1)"+W+J+Y+J+(X?W+$+"isFinite("+J+")":"")+")";case"number":return"(typeof "+J+Y+'"'+Q+'"'+(X?W+$+"isFinite("+J+")":"")+")";default:return"typeof "+J+Y+'"'+Q+'"'}}function bc1(Q,J,X){switch(Q.length){case 1:return Go(Q[0],J,X,!0);default:var G="",Y=$o(Q);if(Y.array&&Y.object)G=Y.null?"(":"(!"+J+" || ",G+="typeof "+J+' !== "object")',delete Y.null,delete Y.array,delete Y.object;if(Y.number)delete Y.integer;for(var W in Y)G+=(G?" && ":"")+Go(W,J,X,!0);return G}}var nA0=$o(["string","number","integer","boolean","null"]);function xc1(Q,J){if(Array.isArray(J)){var X=[];for(var G=0;G<J.length;G++){var Y=J[G];if(nA0[Y])X[X.length]=Y;else if(Q==="array"&&Y==="array")X[X.length]=Y}if(X.length)return X}else if(nA0[J])return[J];else if(Q==="array"&&J==="array")return["array"]}function $o(Q){var J={};for(var X=0;X<Q.length;X++)J[Q[X]]=!0;return J}var gc1=/^[a-z$_][a-z$_0-9]*$/i,uc1=/'|\\/g;function Ko(Q){return typeof Q=="number"?"["+Q+"]":gc1.test(Q)?"."+Q:"['"+Zo(Q)+"']"}function Zo(Q){return Q.replace(uc1,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function mc1(Q,J){J+="[^0-9]";var X=Q.match(new RegExp(J,"g"));return X?X.length:0}function lc1(Q,J,X){return J+="([^0-9])",X=X.replace(/\$/g,"$$$$"),Q.replace(new RegExp(J,"g"),X+"$1")}function dc1(Q,J){if(typeof Q=="boolean")return!Q;for(var X in Q)if(J[X])return!0}function pc1(Q,J,X){if(typeof Q=="boolean")return!Q&&X!="not";for(var G in Q)if(G!=X&&J[G])return!0}function cc1(Q,J){if(typeof Q=="boolean")return;for(var X in Q)if(!J[X])return X}function Wo(Q){return"'"+Zo(Q)+"'"}function nc1(Q,J,X,G){var Y=X?"'/' + "+J+(G?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):G?"'[' + "+J+" + ']'":"'[\\'' + "+J+" + '\\']'";return iA0(Q,Y)}function ic1(Q,J,X){var G=X?Wo("/"+Ho(J)):Wo(Ko(J));return iA0(Q,G)}var rc1=/^\/(?:[^~]|~0|~1)*$/,ac1=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oc1(Q,J,X){var G,Y,W,$;if(Q==="")return"rootData";if(Q[0]=="/"){if(!rc1.test(Q))throw Error("Invalid JSON-pointer: "+Q);Y=Q,W="rootData"}else{if($=Q.match(ac1),!$)throw Error("Invalid JSON-pointer: "+Q);if(G=+$[1],Y=$[2],Y=="#"){if(G>=J)throw Error("Cannot access property/index "+G+" levels up, current level is "+J);return X[J-G]}if(G>J)throw Error("Cannot access data "+G+" levels up, current level is "+J);if(W="data"+(J-G||""),!Y)return W}var K=W,Z=Y.split("/");for(var H=0;H<Z.length;H++){var q=Z[H];if(q)W+=Ko(qo(q)),K+=" && "+W}return K}function iA0(Q,J){if(Q=='""')return J;return(Q+" + "+J).replace(/([^\\])' \+ '/g,"$1")}function sc1(Q){return qo(decodeURIComponent(Q))}function tc1(Q){return encodeURIComponent(Ho(Q))}function Ho(Q){return Q.replace(/~/g,"~0").replace(/\//g,"~1")}function qo(Q){return Q.replace(/~1/g,"/").replace(/~0/g,"~")}});var Fo=I((TU6,aA0)=>{var ec1=OH();aA0.exports=Qn1;function Qn1(Q){ec1.copy(Q,this)}});var sA0=I((EU6,oA0)=>{var vK=oA0.exports=function(Q,J,X){if(typeof J=="function")X=J,J={};X=J.cb||X;var G=typeof X=="function"?X:X.pre||function(){},Y=X.post||function(){};TC(J,G,Y,Q,"",Q)};vK.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};vK.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};vK.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};vK.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function TC(Q,J,X,G,Y,W,$,K,Z,H){if(G&&typeof G=="object"&&!Array.isArray(G)){J(G,Y,W,$,K,Z,H);for(var q in G){var F=G[q];if(Array.isArray(F)){if(q in vK.arrayKeywords)for(var V=0;V<F.length;V++)TC(Q,J,X,F[V],Y+"/"+q+"/"+V,W,Y,q,G,V)}else if(q in vK.propsKeywords){if(F&&typeof F=="object")for(var z in F)TC(Q,J,X,F[z],Y+"/"+q+"/"+Jn1(z),W,Y,q,G,z)}else if(q in vK.keywords||Q.allKeys&&!(q in vK.skipKeywords))TC(Q,J,X,F,Y+"/"+q,W,Y,q,G)}X(G,Y,W,$,K,Z,H)}}function Jn1(Q){return Q.replace(/~/g,"~0").replace(/\//g,"~1")}});var SC=I((jU6,JT0)=>{var hL=lA0(),tA0=AC(),RC=OH(),EC=Fo(),Xn1=sA0();JT0.exports=_K;_K.normalizeId=kK;_K.fullPath=jC;_K.url=IC;_K.ids=Kn1;_K.inlineRef=Vo;_K.schema=CC;function _K(Q,J,X){var G=this._refs[X];if(typeof G=="string")if(this._refs[G])G=this._refs[G];else return _K.call(this,Q,J,G);if(G=G||this._schemas[X],G instanceof EC)return Vo(G.schema,this._opts.inlineRefs)?G.schema:G.validate||this._compile(G);var Y=CC.call(this,J,X),W,$,K;if(Y)W=Y.schema,J=Y.root,K=Y.baseId;if(W instanceof EC)$=W.validate||Q.call(this,W.schema,J,void 0,K);else if(W!==void 0)$=Vo(W,this._opts.inlineRefs)?W:Q.call(this,W,J,void 0,K);return $}function CC(Q,J){var X=hL.parse(J),G=QT0(X),Y=jC(this._getId(Q.schema));if(Object.keys(Q.schema).length===0||G!==Y){var W=kK(G),$=this._refs[W];if(typeof $=="string")return Yn1.call(this,Q,$,X);else if($ instanceof EC){if(!$.validate)this._compile($);Q=$}else if($=this._schemas[W],$ instanceof EC){if(!$.validate)this._compile($);if(W==kK(J))return{schema:$,root:Q,baseId:Y};Q=$}else return;if(!Q.schema)return;Y=jC(this._getId(Q.schema))}return eA0.call(this,X,Y,Q.schema,Q)}function Yn1(Q,J,X){var G=CC.call(this,Q,J);if(G){var{schema:Y,baseId:W}=G;Q=G.root;var $=this._getId(Y);if($)W=IC(W,$);return eA0.call(this,X,W,Y,Q)}}var Gn1=RC.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function eA0(Q,J,X,G){if(Q.fragment=Q.fragment||"",Q.fragment.slice(0,1)!="/")return;var Y=Q.fragment.split("/");for(var W=1;W<Y.length;W++){var $=Y[W];if($){if($=RC.unescapeFragment($),X=X[$],X===void 0)break;var K;if(!Gn1[$]){if(K=this._getId(X),K)J=IC(J,K);if(X.$ref){var Z=IC(J,X.$ref),H=CC.call(this,G,Z);if(H)X=H.schema,G=H.root,J=H.baseId}}}}if(X!==void 0&&X!==G.schema)return{schema:X,root:G,baseId:J}}var Wn1=RC.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function Vo(Q,J){if(J===!1)return!1;if(J===void 0||J===!0)return zo(Q);else if(J)return Uo(Q)<=J}function zo(Q){var J;if(Array.isArray(Q)){for(var X=0;X<Q.length;X++)if(J=Q[X],typeof J=="object"&&!zo(J))return!1}else for(var G in Q){if(G=="$ref")return!1;if(J=Q[G],typeof J=="object"&&!zo(J))return!1}return!0}function Uo(Q){var J=0,X;if(Array.isArray(Q))for(var G=0;G<Q.length;G++){if(X=Q[G],typeof X=="object")J+=Uo(X);if(J==1/0)return 1/0}else for(var Y in Q){if(Y=="$ref")return 1/0;if(Wn1[Y])J++;else{if(X=Q[Y],typeof X=="object")J+=Uo(X)+1;if(J==1/0)return 1/0}}return J}function jC(Q,J){if(J!==!1)Q=kK(Q);var X=hL.parse(Q);return QT0(X)}function QT0(Q){return hL.serialize(Q).split("#")[0]+"#"}var $n1=/#\/?$/;function kK(Q){return Q?Q.replace($n1,""):""}function IC(Q,J){return J=kK(J),hL.resolve(Q,J)}function Kn1(Q){var J=kK(this._getId(Q)),X={"":J},G={"":jC(J,!1)},Y={},W=this;return Xn1(Q,{allKeys:!0},function($,K,Z,H,q,F,V){if(K==="")return;var z=W._getId($),U=X[H],B=G[H]+"/"+q;if(V!==void 0)B+="/"+(typeof V=="number"?V:RC.escapeFragment(V));if(typeof z=="string"){z=U=kK(U?hL.resolve(U,z):z);var D=W._refs[z];if(typeof D=="string")D=W._refs[D];if(D&&D.schema){if(!tA0($,D.schema))throw Error('id "'+z+'" resolves to more than one schema')}else if(z!=kK(B))if(z[0]=="#"){if(Y[z]&&!tA0($,Y[z]))throw Error('id "'+z+'" resolves to more than one schema');Y[z]=$}else W._refs[z]=B}X[K]=U,G[K]=B}),Y}});var vC=I((IU6,YT0)=>{var No=SC();YT0.exports={Validation:XT0(Zn1),MissingRef:XT0(Bo)};function Zn1(Q){this.message="validation failed",this.errors=Q,this.ajv=this.validation=!0}Bo.message=function(Q,J){return"can't resolve reference "+J+" from id "+Q};function Bo(Q,J,X){this.message=X||Bo.message(Q,J),this.missingRef=No.url(Q,J),this.missingSchema=No.normalizeId(No.fullPath(this.missingRef))}function XT0(Q){return Q.prototype=Object.create(Error.prototype),Q.prototype.constructor=Q,Q}});var Oo=I((RU6,GT0)=>{GT0.exports=function(Q,J){if(!J)J={};if(typeof J==="function")J={cmp:J};var X=typeof J.cycles==="boolean"?J.cycles:!1,G=J.cmp&&function(W){return function($){return function(K,Z){var H={key:K,value:$[K]},q={key:Z,value:$[Z]};return W(H,q)}}}(J.cmp),Y=[];return function W($){if($&&$.toJSON&&typeof $.toJSON==="function")$=$.toJSON();if($===void 0)return;if(typeof $=="number")return isFinite($)?""+$:"null";if(typeof $!=="object")return JSON.stringify($);var K,Z;if(Array.isArray($)){Z="[";for(K=0;K<$.length;K++){if(K)Z+=",";Z+=W($[K])||"null"}return Z+"]"}if($===null)return"null";if(Y.indexOf($)!==-1){if(X)return JSON.stringify("__cycle__");throw TypeError("Converting circular structure to JSON")}var H=Y.push($)-1,q=Object.keys($).sort(G&&G($));Z="";for(K=0;K<q.length;K++){var F=q[K],V=W($[F]);if(!V)continue;if(Z)Z+=",";Z+=JSON.stringify(F)+":"+V}return Y.splice(H,1),"{"+Z+"}"}(Q)}});var Do=I((CU6,WT0)=>{WT0.exports=function(J,X,G){var Y="",W=J.schema.$async===!0,$=J.util.schemaHasRulesExcept(J.schema,J.RULES.all,"$ref"),K=J.self._getId(J.schema);if(J.opts.strictKeywords){var Z=J.util.schemaUnknownRules(J.schema,J.RULES.keywords);if(Z){var H="unknown keyword: "+Z;if(J.opts.strictKeywords==="log")J.logger.warn(H);else throw Error(H)}}if(J.isTop){if(Y+=" var validate = ",W)J.async=!0,Y+="async ";if(Y+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",K&&(J.opts.sourceCode||J.opts.processCode))Y+=" "+("/*# sourceURL="+K+" */")+" "}if(typeof J.schema=="boolean"||!($||J.schema.$ref)){var X="false schema",q=J.level,F=J.dataLevel,V=J.schema[X],z=J.schemaPath+J.util.getProperty(X),U=J.errSchemaPath+"/"+X,M=!J.opts.allErrors,S,B="data"+(F||""),P="valid"+q;if(J.schema===!1){if(J.isTop)M=!0;else Y+=" var "+P+" = false; ";var D=D||[];if(D.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '"+(S||"false schema")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(U)+" , params: {} ",J.opts.messages!==!1)Y+=" , message: 'boolean schema is false' ";if(J.opts.verbose)Y+=" , schema: false , parentSchema: validate.schema"+J.schemaPath+" , data: "+B+" ";Y+=" } "}else Y+=" {} ";var w=Y;if(Y=D.pop(),!J.compositeRule&&M)if(J.async)Y+=" throw new ValidationError(["+w+"]); ";else Y+=" validate.errors = ["+w+"]; return false; ";else Y+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else if(J.isTop)if(W)Y+=" return data; ";else Y+=" validate.errors = null; return true; ";else Y+=" var "+P+" = true; ";if(J.isTop)Y+=" }; return validate; ";return Y}if(J.isTop){var A=J.isTop,q=J.level=0,F=J.dataLevel=0,B="data";if(J.rootId=J.resolve.fullPath(J.self._getId(J.root.schema)),J.baseId=J.baseId||J.rootId,delete J.isTop,J.dataPathArr=[""],J.schema.default!==void 0&&J.opts.useDefaults&&J.opts.strictDefaults){var E="default is ignored in the schema root";if(J.opts.strictDefaults==="log")J.logger.warn(E);else throw Error(E)}Y+=" var vErrors = null; ",Y+=" var errors = 0; ",Y+=" if (rootData === undefined) rootData = data; "}else{var{level:q,dataLevel:F}=J,B="data"+(F||"");if(K)J.baseId=J.resolve.url(J.baseId,K);if(W&&!J.async)throw Error("async schema in sync schema");Y+=" var errs_"+q+" = errors;"}var P="valid"+q,M=!J.opts.allErrors,T="",R="",S,k=J.schema.type,y=Array.isArray(k);if(k&&J.opts.nullable&&J.schema.nullable===!0){if(y){if(k.indexOf("null")==-1)k=k.concat("null")}else if(k!="null")k=[k,"null"],y=!0}if(y&&k.length==1)k=k[0],y=!1;if(J.schema.$ref&&$){if(J.opts.extendRefs=="fail")throw Error('$ref: validation keywords used in schema at path "'+J.errSchemaPath+'" (see option extendRefs)');else if(J.opts.extendRefs!==!0)$=!1,J.logger.warn('$ref: keywords ignored in schema at path "'+J.errSchemaPath+'"')}if(J.schema.$comment&&J.opts.$comment)Y+=" "+J.RULES.all.$comment.code(J,"$comment");if(k){if(J.opts.coerceTypes)var f=J.util.coerceToTypes(J.opts.coerceTypes,k);var l=J.RULES.types[k];if(f||y||l===!0||l&&!k1(l)){var z=J.schemaPath+".type",U=J.errSchemaPath+"/type",z=J.schemaPath+".type",U=J.errSchemaPath+"/type",b=y?"checkDataTypes":"checkDataType";if(Y+=" if ("+J.util[b](k,B,J.opts.strictNumbers,!0)+") { ",f){var v="dataType"+q,g="coerced"+q;if(Y+=" var "+v+" = typeof "+B+"; var "+g+" = undefined; ",J.opts.coerceTypes=="array")Y+=" if ("+v+" == 'object' && Array.isArray("+B+") && "+B+".length == 1) { "+B+" = "+B+"[0]; "+v+" = typeof "+B+"; if ("+J.util.checkDataType(J.schema.type,B,J.opts.strictNumbers)+") "+g+" = "+B+"; } ";Y+=" if ("+g+" !== undefined) ; ";var e=f;if(e){var a,$0=-1,U0=e.length-1;while($0<U0)if(a=e[$0+=1],a=="string")Y+=" else if ("+v+" == 'number' || "+v+" == 'boolean') "+g+" = '' + "+B+"; else if ("+B+" === null) "+g+" = ''; ";else if(a=="number"||a=="integer"){if(Y+=" else if ("+v+" == 'boolean' || "+B+" === null || ("+v+" == 'string' && "+B+" && "+B+" == +"+B+" ",a=="integer")Y+=" && !("+B+" % 1)";Y+=")) "+g+" = +"+B+"; "}else if(a=="boolean")Y+=" else if ("+B+" === 'false' || "+B+" === 0 || "+B+" === null) "+g+" = false; else if ("+B+" === 'true' || "+B+" === 1) "+g+" = true; ";else if(a=="null")Y+=" else if ("+B+" === '' || "+B+" === 0 || "+B+" === false) "+g+" = null; ";else if(J.opts.coerceTypes=="array"&&a=="array")Y+=" else if ("+v+" == 'string' || "+v+" == 'number' || "+v+" == 'boolean' || "+B+" == null) "+g+" = ["+B+"]; "}Y+=" else { ";var D=D||[];if(D.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '"+(S||"type")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(U)+" , params: { type: '",y)Y+=""+k.join(",");else Y+=""+k;if(Y+="' } ",J.opts.messages!==!1){if(Y+=" , message: 'should be ",y)Y+=""+k.join(",");else Y+=""+k;Y+="' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+B+" ";Y+=" } "}else Y+=" {} ";var w=Y;if(Y=D.pop(),!J.compositeRule&&M)if(J.async)Y+=" throw new ValidationError(["+w+"]); ";else Y+=" validate.errors = ["+w+"]; return false; ";else Y+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Y+=" } if ("+g+" !== undefined) { ";var X0=F?"data"+(F-1||""):"parentData",L0=F?J.dataPathArr[F]:"parentDataProperty";if(Y+=" "+B+" = "+g+"; ",!F)Y+="if ("+X0+" !== undefined)";Y+=" "+X0+"["+L0+"] = "+g+"; } "}else{var D=D||[];if(D.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '"+(S||"type")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(U)+" , params: { type: '",y)Y+=""+k.join(",");else Y+=""+k;if(Y+="' } ",J.opts.messages!==!1){if(Y+=" , message: 'should be ",y)Y+=""+k.join(",");else Y+=""+k;Y+="' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+B+" ";Y+=" } "}else Y+=" {} ";var w=Y;if(Y=D.pop(),!J.compositeRule&&M)if(J.async)Y+=" throw new ValidationError(["+w+"]); ";else Y+=" validate.errors = ["+w+"]; return false; ";else Y+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}Y+=" } "}}if(J.schema.$ref&&!$){if(Y+=" "+J.RULES.all.$ref.code(J,"$ref")+" ",M){if(Y+=" } if (errors === ",A)Y+="0";else Y+="errs_"+q;Y+=") { ",R+="}"}}else{var R0=J.RULES;if(R0){var l,b0=-1,r0=R0.length-1;while(b0<r0)if(l=R0[b0+=1],k1(l)){if(l.type)Y+=" if ("+J.util.checkDataType(l.type,B,J.opts.strictNumbers)+") { ";if(J.opts.useDefaults){if(l.type=="object"&&J.schema.properties){var V=J.schema.properties,D0=Object.keys(V),H0=D0;if(H0){var S0,b1=-1,C1=H0.length-1;while(b1<C1){S0=H0[b1+=1];var h0=V[S0];if(h0.default!==void 0){var B0=B+J.util.getProperty(S0);if(J.compositeRule){if(J.opts.strictDefaults){var E="default is ignored for: "+B0;if(J.opts.strictDefaults==="log")J.logger.warn(E);else throw Error(E)}}else{if(Y+=" if ("+B0+" === undefined ",J.opts.useDefaults=="empty")Y+=" || "+B0+" === null || "+B0+" === '' ";if(Y+=" ) "+B0+" = ",J.opts.useDefaults=="shared")Y+=" "+J.useDefault(h0.default)+" ";else Y+=" "+JSON.stringify(h0.default)+" ";Y+="; "}}}}}else if(l.type=="array"&&Array.isArray(J.schema.items)){var z0=J.schema.items;if(z0){var h0,$0=-1,j0=z0.length-1;while($0<j0)if(h0=z0[$0+=1],h0.default!==void 0){var B0=B+"["+$0+"]";if(J.compositeRule){if(J.opts.strictDefaults){var E="default is ignored for: "+B0;if(J.opts.strictDefaults==="log")J.logger.warn(E);else throw Error(E)}}else{if(Y+=" if ("+B0+" === undefined ",J.opts.useDefaults=="empty")Y+=" || "+B0+" === null || "+B0+" === '' ";if(Y+=" ) "+B0+" = ",J.opts.useDefaults=="shared")Y+=" "+J.useDefault(h0.default)+" ";else Y+=" "+JSON.stringify(h0.default)+" ";Y+="; "}}}}}var G0=l.rules;if(G0){var O0,m0=-1,C0=G0.length-1;while(m0<C0)if(O0=G0[m0+=1],u0(O0)){var f0=O0.code(J,O0.keyword,l.type);if(f0){if(Y+=" "+f0+" ",M)T+="}"}}}if(M)Y+=" "+T+" ",T="";if(l.type){if(Y+=" } ",k&&k===l.type&&!f){Y+=" else { ";var z=J.schemaPath+".type",U=J.errSchemaPath+"/type",D=D||[];if(D.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '"+(S||"type")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(U)+" , params: { type: '",y)Y+=""+k.join(",");else Y+=""+k;if(Y+="' } ",J.opts.messages!==!1){if(Y+=" , message: 'should be ",y)Y+=""+k.join(",");else Y+=""+k;Y+="' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+B+" ";Y+=" } "}else Y+=" {} ";var w=Y;if(Y=D.pop(),!J.compositeRule&&M)if(J.async)Y+=" throw new ValidationError(["+w+"]); ";else Y+=" validate.errors = ["+w+"]; return false; ";else Y+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Y+=" } "}}if(M){if(Y+=" if (errors === ",A)Y+="0";else Y+="errs_"+q;Y+=") { ",R+="}"}}}}if(M)Y+=" "+R+" ";if(A){if(W)Y+=" if (errors === 0) return data; ",Y+=" else throw new ValidationError(vErrors); ";else Y+=" validate.errors = vErrors; ",Y+=" return errors === 0; ";Y+=" }; return validate;"}else Y+=" var "+P+" = errors === errs_"+q+";";function k1(Z4){var $1=Z4.rules;for(var v0=0;v0<$1.length;v0++)if(u0($1[v0]))return!0}function u0(Z4){return J.schema[Z4.keyword]!==void 0||Z4.implements&&j1(Z4)}function j1(Z4){var $1=Z4.implements;for(var v0=0;v0<$1.length;v0++)if(J.schema[$1[v0]]!==void 0)return!0}return Y}});var qT0=I((SU6,HT0)=>{var kC=SC(),yC=OH(),KT0=vC(),Hn1=Oo(),$T0=Do(),qn1=yC.ucs2length,Fn1=AC(),Vn1=KT0.Validation;HT0.exports=Lo;function Lo(Q,J,X,G){var Y=this,W=this._opts,$=[void 0],K={},Z=[],H={},q=[],F={},V=[];J=J||{schema:Q,refVal:$,refs:K};var z=zn1.call(this,Q,J,G),U=this._compilations[z.index];if(z.compiling)return U.callValidate=E;var B=this._formats,D=this.RULES;try{var w=P(Q,J,X,G);U.validate=w;var A=U.callValidate;if(A){if(A.schema=w.schema,A.errors=null,A.refs=w.refs,A.refVal=w.refVal,A.root=w.root,A.$async=w.$async,W.sourceCode)A.source=w.source}return w}finally{Un1.call(this,Q,J,G)}function E(){var b=U.validate,v=b.apply(this,arguments);return E.errors=b.errors,v}function P(b,v,g,e){var a=!v||v&&v.schema==b;if(v.schema!=J.schema)return Lo.call(Y,b,v,g,e);var $0=b.$async===!0,U0=$T0({isTop:!0,schema:b,isRoot:a,baseId:e,root:v,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:KT0.MissingRef,RULES:D,validate:$T0,util:yC,resolve:kC,resolveRef:M,usePattern:y,useDefault:f,useCustomRule:l,opts:W,formats:B,logger:Y.logger,self:Y});if(U0=_C($,On1)+_C(Z,Nn1)+_C(q,Bn1)+_C(V,Dn1)+U0,W.processCode)U0=W.processCode(U0,b);var X0;try{var L0=Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",U0);X0=L0(Y,D,B,J,$,q,V,Fn1,qn1,Vn1),$[0]=X0}catch(R0){throw Y.logger.error("Error compiling schema, function code:",U0),R0}if(X0.schema=b,X0.errors=null,X0.refs=K,X0.refVal=$,X0.root=a?X0:v,$0)X0.$async=!0;if(W.sourceCode===!0)X0.source={code:U0,patterns:Z,defaults:q};return X0}function M(b,v,g){v=kC.url(b,v);var e=K[v],a,$0;if(e!==void 0)return a=$[e],$0="refVal["+e+"]",k(a,$0);if(!g&&J.refs){var U0=J.refs[v];if(U0!==void 0)return a=J.refVal[U0],$0=T(v,a),k(a,$0)}$0=T(v);var X0=kC.call(Y,P,J,v);if(X0===void 0){var L0=X&&X[v];if(L0)X0=kC.inlineRef(L0,W.inlineRefs)?L0:Lo.call(Y,L0,J,X,b)}if(X0===void 0)R(v);else return S(v,X0),k(X0,$0)}function T(b,v){var g=$.length;return $[g]=v,K[b]=g,"refVal"+g}function R(b){delete K[b]}function S(b,v){var g=K[b];$[g]=v}function k(b,v){return typeof b=="object"||typeof b=="boolean"?{code:v,schema:b,inline:!0}:{code:v,$async:b&&!!b.$async}}function y(b){var v=H[b];if(v===void 0)v=H[b]=Z.length,Z[v]=b;return"pattern"+v}function f(b){switch(typeof b){case"boolean":case"number":return""+b;case"string":return yC.toQuotedString(b);case"object":if(b===null)return"null";var v=Hn1(b),g=F[v];if(g===void 0)g=F[v]=q.length,q[g]=b;return"default"+g}}function l(b,v,g,e){if(Y._opts.validateSchema!==!1){var a=b.definition.dependencies;if(a&&!a.every(function(H0){return Object.prototype.hasOwnProperty.call(g,H0)}))throw Error("parent schema must have all required keywords: "+a.join(","));var $0=b.definition.validateSchema;if($0){var U0=$0(v);if(!U0){var X0="keyword schema is invalid: "+Y.errorsText($0.errors);if(Y._opts.validateSchema=="log")Y.logger.error(X0);else throw Error(X0)}}}var L0=b.definition.compile,R0=b.definition.inline,b0=b.definition.macro,r0;if(L0)r0=L0.call(Y,v,g,e);else if(b0){if(r0=b0.call(Y,v,g,e),W.validateSchema!==!1)Y.validateSchema(r0,!0)}else if(R0)r0=R0.call(Y,e,b.keyword,v,g);else if(r0=b.definition.validate,!r0)return;if(r0===void 0)throw Error('custom keyword "'+b.keyword+'"failed to compile');var D0=V.length;return V[D0]=r0,{code:"customRule"+D0,validate:r0}}}function zn1(Q,J,X){var G=ZT0.call(this,Q,J,X);if(G>=0)return{index:G,compiling:!0};return G=this._compilations.length,this._compilations[G]={schema:Q,root:J,baseId:X},{index:G,compiling:!1}}function Un1(Q,J,X){var G=ZT0.call(this,Q,J,X);if(G>=0)this._compilations.splice(G,1)}function ZT0(Q,J,X){for(var G=0;G<this._compilations.length;G++){var Y=this._compilations[G];if(Y.schema==Q&&Y.root==J&&Y.baseId==X)return G}return-1}function Nn1(Q,J){return"var pattern"+Q+" = new RegExp("+yC.toQuotedString(J[Q])+");"}function Bn1(Q){return"var default"+Q+" = defaults["+Q+"];"}function On1(Q,J){return J[Q]===void 0?"":"var refVal"+Q+" = refVal["+Q+"];"}function Dn1(Q){return"var customRule"+Q+" = customRules["+Q+"];"}function _C(Q,J){if(!Q.length)return"";var X="";for(var G=0;G<Q.length;G++)X+=J(G,Q);return X}});var VT0=I((vU6,FT0)=>{var hC=FT0.exports=function(){this._cache={}};hC.prototype.put=function(J,X){this._cache[J]=X};hC.prototype.get=function(J){return this._cache[J]};hC.prototype.del=function(J){delete this._cache[J]};hC.prototype.clear=function(){this._cache={}}});var TT0=I((kU6,AT0)=>{var Ln1=OH(),wn1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Pn1=[0,31,28,31,30,31,30,31,31,30,31,30,31],Mn1=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,zT0=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,An1=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Tn1=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,UT0=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,NT0=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,BT0=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,OT0=/^(?:\/(?:[^~/]|~0|~1)*)*$/,DT0=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,LT0=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;AT0.exports=fC;function fC(Q){return Q=Q=="full"?"full":"fast",Ln1.copy(fC[Q])}fC.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":UT0,url:NT0,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:zT0,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:MT0,uuid:BT0,"json-pointer":OT0,"json-pointer-uri-fragment":DT0,"relative-json-pointer":LT0};fC.full={date:wT0,time:PT0,"date-time":In1,uri:Cn1,"uri-reference":Tn1,"uri-template":UT0,url:NT0,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:zT0,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:MT0,uuid:BT0,"json-pointer":OT0,"json-pointer-uri-fragment":DT0,"relative-json-pointer":LT0};function En1(Q){return Q%4===0&&(Q%100!==0||Q%400===0)}function wT0(Q){var J=Q.match(wn1);if(!J)return!1;var X=+J[1],G=+J[2],Y=+J[3];return G>=1&&G<=12&&Y>=1&&Y<=(G==2&&En1(X)?29:Pn1[G])}function PT0(Q,J){var X=Q.match(Mn1);if(!X)return!1;var G=X[1],Y=X[2],W=X[3],$=X[5];return(G<=23&&Y<=59&&W<=59||G==23&&Y==59&&W==60)&&(!J||$)}var jn1=/t|\s/i;function In1(Q){var J=Q.split(jn1);return J.length==2&&wT0(J[0])&&PT0(J[1],!0)}var Rn1=/\/|:/;function Cn1(Q){return Rn1.test(Q)&&An1.test(Q)}var Sn1=/[^\\]\\Z/;function MT0(Q){if(Sn1.test(Q))return!1;try{return new RegExp(Q),!0}catch(J){return!1}}});var jT0=I((_U6,ET0)=>{ET0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.errSchemaPath+"/"+X,H=!J.opts.allErrors,q="data"+($||""),F="valid"+W,V,z;if(K=="#"||K=="#/")if(J.isRoot)V=J.async,z="validate";else V=J.root.schema.$async===!0,z="root.refVal[0]";else{var U=J.resolveRef(J.baseId,K,J.isRoot);if(U===void 0){var B=J.MissingRefError.message(J.baseId,K);if(J.opts.missingRefs=="fail"){J.logger.error(B);var D=D||[];if(D.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(Z)+" , params: { ref: '"+J.util.escapeQuotes(K)+"' } ",J.opts.messages!==!1)Y+=" , message: 'can\\'t resolve reference "+J.util.escapeQuotes(K)+"' ";if(J.opts.verbose)Y+=" , schema: "+J.util.toQuotedString(K)+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+q+" ";Y+=" } "}else Y+=" {} ";var w=Y;if(Y=D.pop(),!J.compositeRule&&H)if(J.async)Y+=" throw new ValidationError(["+w+"]); ";else Y+=" validate.errors = ["+w+"]; return false; ";else Y+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(H)Y+=" if (false) { "}else if(J.opts.missingRefs=="ignore"){if(J.logger.warn(B),H)Y+=" if (true) { "}else throw new J.MissingRefError(J.baseId,K,B)}else if(U.inline){var A=J.util.copy(J);A.level++;var E="valid"+A.level;A.schema=U.schema,A.schemaPath="",A.errSchemaPath=K;var P=J.validate(A).replace(/validate\.schema/g,U.code);if(Y+=" "+P+" ",H)Y+=" if ("+E+") { "}else V=U.$async===!0||J.async&&U.$async!==!1,z=U.code}if(z){var D=D||[];if(D.push(Y),Y="",J.opts.passContext)Y+=" "+z+".call(this, ";else Y+=" "+z+"( ";if(Y+=" "+q+", (dataPath || '')",J.errorPath!='""')Y+=" + "+J.errorPath;var M=$?"data"+($-1||""):"parentData",T=$?J.dataPathArr[$]:"parentDataProperty";Y+=" , "+M+" , "+T+", rootData) ";var R=Y;if(Y=D.pop(),V){if(!J.async)throw Error("async schema referenced by sync schema");if(H)Y+=" var "+F+"; ";if(Y+=" try { await "+R+"; ",H)Y+=" "+F+" = true; ";if(Y+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",H)Y+=" "+F+" = false; ";if(Y+=" } ",H)Y+=" if ("+F+") { "}else if(Y+=" if (!"+R+") { if (vErrors === null) vErrors = "+z+".errors; else vErrors = vErrors.concat("+z+".errors); errors = vErrors.length; } ",H)Y+=" else { "}return Y}});var RT0=I((yU6,IT0)=>{IT0.exports=function(J,X,G){var Y=" ",W=J.schema[X],$=J.schemaPath+J.util.getProperty(X),K=J.errSchemaPath+"/"+X,Z=!J.opts.allErrors,H=J.util.copy(J),q="";H.level++;var F="valid"+H.level,V=H.baseId,z=!0,U=W;if(U){var B,D=-1,w=U.length-1;while(D<w)if(B=U[D+=1],J.opts.strictKeywords?typeof B=="object"&&Object.keys(B).length>0||B===!1:J.util.schemaHasRules(B,J.RULES.all)){if(z=!1,H.schema=B,H.schemaPath=$+"["+D+"]",H.errSchemaPath=K+"/"+D,Y+=" "+J.validate(H)+" ",H.baseId=V,Z)Y+=" if ("+F+") { ",q+="}"}}if(Z)if(z)Y+=" if (true) { ";else Y+=" "+q.slice(0,-1)+" ";return Y}});var ST0=I((hU6,CT0)=>{CT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="valid"+W,z="errs__"+W,U=J.util.copy(J),B="";U.level++;var D="valid"+U.level,w=K.every(function(S){return J.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===!1:J.util.schemaHasRules(S,J.RULES.all)});if(w){var A=U.baseId;Y+=" var "+z+" = errors; var "+V+" = false; ";var E=J.compositeRule;J.compositeRule=U.compositeRule=!0;var P=K;if(P){var M,T=-1,R=P.length-1;while(T<R)M=P[T+=1],U.schema=M,U.schemaPath=Z+"["+T+"]",U.errSchemaPath=H+"/"+T,Y+=" "+J.validate(U)+" ",U.baseId=A,Y+=" "+V+" = "+V+" || "+D+"; if (!"+V+") { ",B+="}"}if(J.compositeRule=U.compositeRule=E,Y+=" "+B+" if (!"+V+") { var err = ",J.createErrors!==!1){if(Y+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: {} ",J.opts.messages!==!1)Y+=" , message: 'should match some schema in anyOf' ";if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";if(Y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(vErrors); ";else Y+=" validate.errors = vErrors; return false; ";if(Y+=" } else { errors = "+z+"; if (vErrors !== null) { if ("+z+") vErrors.length = "+z+"; else vErrors = null; } ",J.opts.allErrors)Y+=" } "}else if(q)Y+=" if (true) { ";return Y}});var kT0=I((fU6,vT0)=>{vT0.exports=function(J,X,G){var Y=" ",W=J.schema[X],$=J.errSchemaPath+"/"+X,K=!J.opts.allErrors,Z=J.util.toQuotedString(W);if(J.opts.$comment===!0)Y+=" console.log("+Z+");";else if(typeof J.opts.$comment=="function")Y+=" self._opts.$comment("+Z+", "+J.util.toQuotedString($)+", validate.root.schema);";return Y}});var yT0=I((bU6,_T0)=>{_T0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="valid"+W,z=J.opts.$data&&K&&K.$data,U;if(z)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",U="schema"+W;else U=K;if(!z)Y+=" var schema"+W+" = validate.schema"+Z+";";Y+="var "+V+" = equal("+F+", schema"+W+"); if (!"+V+") { ";var B=B||[];if(B.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'const' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { allowedValue: schema"+W+" } ",J.opts.messages!==!1)Y+=" , message: 'should be equal to constant' ";if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var D=Y;if(Y=B.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+D+"]); ";else Y+=" validate.errors = ["+D+"]; return false; ";else Y+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+=" }",q)Y+=" else { ";return Y}});var fT0=I((xU6,hT0)=>{hT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="valid"+W,z="errs__"+W,U=J.util.copy(J),B="";U.level++;var D="valid"+U.level,w="i"+W,A=U.dataLevel=J.dataLevel+1,E="data"+A,P=J.baseId,M=J.opts.strictKeywords?typeof K=="object"&&Object.keys(K).length>0||K===!1:J.util.schemaHasRules(K,J.RULES.all);if(Y+="var "+z+" = errors;var "+V+";",M){var T=J.compositeRule;J.compositeRule=U.compositeRule=!0,U.schema=K,U.schemaPath=Z,U.errSchemaPath=H,Y+=" var "+D+" = false; for (var "+w+" = 0; "+w+" < "+F+".length; "+w+"++) { ",U.errorPath=J.util.getPathExpr(J.errorPath,w,J.opts.jsonPointers,!0);var R=F+"["+w+"]";U.dataPathArr[A]=w;var S=J.validate(U);if(U.baseId=P,J.util.varOccurences(S,E)<2)Y+=" "+J.util.varReplace(S,E,R)+" ";else Y+=" var "+E+" = "+R+"; "+S+" ";Y+=" if ("+D+") break; } ",J.compositeRule=U.compositeRule=T,Y+=" "+B+" if (!"+D+") {"}else Y+=" if ("+F+".length == 0) {";var k=k||[];if(k.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: {} ",J.opts.messages!==!1)Y+=" , message: 'should contain a valid item' ";if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var y=Y;if(Y=k.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+y+"]); ";else Y+=" validate.errors = ["+y+"]; return false; ";else Y+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+=" } else { ",M)Y+=" errors = "+z+"; if (vErrors !== null) { if ("+z+") vErrors.length = "+z+"; else vErrors = null; } ";if(J.opts.allErrors)Y+=" } ";return Y}});var xT0=I((gU6,bT0)=>{bT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="errs__"+W,z=J.util.copy(J),U="";z.level++;var B="valid"+z.level,D={},w={},A=J.opts.ownProperties;for(T in K){if(T=="__proto__")continue;var E=K[T],P=Array.isArray(E)?w:D;P[T]=E}Y+="var "+V+" = errors;";var M=J.errorPath;Y+="var missing"+W+";";for(var T in w)if(P=w[T],P.length){if(Y+=" if ( "+F+J.util.getProperty(T)+" !== undefined ",A)Y+=" && Object.prototype.hasOwnProperty.call("+F+", '"+J.util.escapeQuotes(T)+"') ";if(q){Y+=" && ( ";var R=P;if(R){var S,k=-1,y=R.length-1;while(k<y){if(S=R[k+=1],k)Y+=" || ";var f=J.util.getProperty(S),l=F+f;if(Y+=" ( ( "+l+" === undefined ",A)Y+=" || ! Object.prototype.hasOwnProperty.call("+F+", '"+J.util.escapeQuotes(S)+"') ";Y+=") && (missing"+W+" = "+J.util.toQuotedString(J.opts.jsonPointers?S:f)+") ) "}}Y+=")) { ";var b="missing"+W,v="' + "+b+" + '";if(J.opts._errorDataPathProperty)J.errorPath=J.opts.jsonPointers?J.util.getPathExpr(M,b,!0):M+" + "+b;var g=g||[];if(g.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { property: '"+J.util.escapeQuotes(T)+"', missingProperty: '"+v+"', depsCount: "+P.length+", deps: '"+J.util.escapeQuotes(P.length==1?P[0]:P.join(", "))+"' } ",J.opts.messages!==!1){if(Y+=" , message: 'should have ",P.length==1)Y+="property "+J.util.escapeQuotes(P[0]);else Y+="properties "+J.util.escapeQuotes(P.join(", "));Y+=" when property "+J.util.escapeQuotes(T)+" is present' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var e=Y;if(Y=g.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+e+"]); ";else Y+=" validate.errors = ["+e+"]; return false; ";else Y+=" var err = "+e+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{Y+=" ) { ";var a=P;if(a){var S,$0=-1,U0=a.length-1;while($0<U0){S=a[$0+=1];var f=J.util.getProperty(S),v=J.util.escapeQuotes(S),l=F+f;if(J.opts._errorDataPathProperty)J.errorPath=J.util.getPath(M,S,J.opts.jsonPointers);if(Y+=" if ( "+l+" === undefined ",A)Y+=" || ! Object.prototype.hasOwnProperty.call("+F+", '"+J.util.escapeQuotes(S)+"') ";if(Y+=") { var err = ",J.createErrors!==!1){if(Y+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { property: '"+J.util.escapeQuotes(T)+"', missingProperty: '"+v+"', depsCount: "+P.length+", deps: '"+J.util.escapeQuotes(P.length==1?P[0]:P.join(", "))+"' } ",J.opts.messages!==!1){if(Y+=" , message: 'should have ",P.length==1)Y+="property "+J.util.escapeQuotes(P[0]);else Y+="properties "+J.util.escapeQuotes(P.join(", "));Y+=" when property "+J.util.escapeQuotes(T)+" is present' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";Y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}if(Y+=" } ",q)U+="}",Y+=" else { "}J.errorPath=M;var X0=z.baseId;for(var T in D){var E=D[T];if(J.opts.strictKeywords?typeof E=="object"&&Object.keys(E).length>0||E===!1:J.util.schemaHasRules(E,J.RULES.all)){if(Y+=" "+B+" = true; if ( "+F+J.util.getProperty(T)+" !== undefined ",A)Y+=" && Object.prototype.hasOwnProperty.call("+F+", '"+J.util.escapeQuotes(T)+"') ";if(Y+=") { ",z.schema=E,z.schemaPath=Z+J.util.getProperty(T),z.errSchemaPath=H+"/"+J.util.escapeFragment(T),Y+=" "+J.validate(z)+" ",z.baseId=X0,Y+=" } ",q)Y+=" if ("+B+") { ",U+="}"}}if(q)Y+=" "+U+" if ("+V+" == errors) {";return Y}});var uT0=I((uU6,gT0)=>{gT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="valid"+W,z=J.opts.$data&&K&&K.$data,U;if(z)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",U="schema"+W;else U=K;var B="i"+W,D="schema"+W;if(!z)Y+=" var "+D+" = validate.schema"+Z+";";if(Y+="var "+V+";",z)Y+=" if (schema"+W+" === undefined) "+V+" = true; else if (!Array.isArray(schema"+W+")) "+V+" = false; else {";if(Y+=""+V+" = false;for (var "+B+"=0; "+B+"<"+D+".length; "+B+"++) if (equal("+F+", "+D+"["+B+"])) { "+V+" = true; break; }",z)Y+=" } ";Y+=" if (!"+V+") { ";var w=w||[];if(w.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { allowedValues: schema"+W+" } ",J.opts.messages!==!1)Y+=" , message: 'should be equal to one of the allowed values' ";if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var A=Y;if(Y=w.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+A+"]); ";else Y+=" validate.errors = ["+A+"]; return false; ";else Y+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+=" }",q)Y+=" else { ";return Y}});var lT0=I((mU6,mT0)=>{mT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||"");if(J.opts.format===!1){if(q)Y+=" if (true) { ";return Y}var V=J.opts.$data&&K&&K.$data,z;if(V)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",z="schema"+W;else z=K;var U=J.opts.unknownFormats,B=Array.isArray(U);if(V){var D="format"+W,w="isObject"+W,A="formatType"+W;if(Y+=" var "+D+" = formats["+z+"]; var "+w+" = typeof "+D+" == 'object' && !("+D+" instanceof RegExp) && "+D+".validate; var "+A+" = "+w+" && "+D+".type || 'string'; if ("+w+") { ",J.async)Y+=" var async"+W+" = "+D+".async; ";if(Y+=" "+D+" = "+D+".validate; } if ( ",V)Y+=" ("+z+" !== undefined && typeof "+z+" != 'string') || ";if(Y+=" (",U!="ignore"){if(Y+=" ("+z+" && !"+D+" ",B)Y+=" && self._opts.unknownFormats.indexOf("+z+") == -1 ";Y+=") || "}if(Y+=" ("+D+" && "+A+" == '"+G+"' && !(typeof "+D+" == 'function' ? ",J.async)Y+=" (async"+W+" ? await "+D+"("+F+") : "+D+"("+F+")) ";else Y+=" "+D+"("+F+") ";Y+=" : "+D+".test("+F+"))))) {"}else{var D=J.formats[K];if(!D)if(U=="ignore"){if(J.logger.warn('unknown format "'+K+'" ignored in schema at path "'+J.errSchemaPath+'"'),q)Y+=" if (true) { ";return Y}else if(B&&U.indexOf(K)>=0){if(q)Y+=" if (true) { ";return Y}else throw Error('unknown format "'+K+'" is used in schema at path "'+J.errSchemaPath+'"');var w=typeof D=="object"&&!(D instanceof RegExp)&&D.validate,A=w&&D.type||"string";if(w){var E=D.async===!0;D=D.validate}if(A!=G){if(q)Y+=" if (true) { ";return Y}if(E){if(!J.async)throw Error("async format in sync schema");var P="formats"+J.util.getProperty(K)+".validate";Y+=" if (!(await "+P+"("+F+"))) { "}else{Y+=" if (! ";var P="formats"+J.util.getProperty(K);if(w)P+=".validate";if(typeof D=="function")Y+=" "+P+"("+F+") ";else Y+=" "+P+".test("+F+") ";Y+=") { "}}var M=M||[];if(M.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'format' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { format: ",V)Y+=""+z;else Y+=""+J.util.toQuotedString(K);if(Y+=" } ",J.opts.messages!==!1){if(Y+=` , message: 'should match format "`,V)Y+="' + "+z+" + '";else Y+=""+J.util.escapeQuotes(K);Y+=`"' `}if(J.opts.verbose){if(Y+=" , schema: ",V)Y+="validate.schema"+Z;else Y+=""+J.util.toQuotedString(K);Y+=" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" "}Y+=" } "}else Y+=" {} ";var T=Y;if(Y=M.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+T+"]); ";else Y+=" validate.errors = ["+T+"]; return false; ";else Y+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+=" } ",q)Y+=" else { ";return Y}});var pT0=I((lU6,dT0)=>{dT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="valid"+W,z="errs__"+W,U=J.util.copy(J);U.level++;var B="valid"+U.level,D=J.schema.then,w=J.schema.else,A=D!==void 0&&(J.opts.strictKeywords?typeof D=="object"&&Object.keys(D).length>0||D===!1:J.util.schemaHasRules(D,J.RULES.all)),E=w!==void 0&&(J.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:J.util.schemaHasRules(w,J.RULES.all)),P=U.baseId;if(A||E){var M;U.createErrors=!1,U.schema=K,U.schemaPath=Z,U.errSchemaPath=H,Y+=" var "+z+" = errors; var "+V+" = true; ";var T=J.compositeRule;if(J.compositeRule=U.compositeRule=!0,Y+=" "+J.validate(U)+" ",U.baseId=P,U.createErrors=!0,Y+=" errors = "+z+"; if (vErrors !== null) { if ("+z+") vErrors.length = "+z+"; else vErrors = null; } ",J.compositeRule=U.compositeRule=T,A){if(Y+=" if ("+B+") { ",U.schema=J.schema.then,U.schemaPath=J.schemaPath+".then",U.errSchemaPath=J.errSchemaPath+"/then",Y+=" "+J.validate(U)+" ",U.baseId=P,Y+=" "+V+" = "+B+"; ",A&&E)M="ifClause"+W,Y+=" var "+M+" = 'then'; ";else M="'then'";if(Y+=" } ",E)Y+=" else { "}else Y+=" if (!"+B+") { ";if(E){if(U.schema=J.schema.else,U.schemaPath=J.schemaPath+".else",U.errSchemaPath=J.errSchemaPath+"/else",Y+=" "+J.validate(U)+" ",U.baseId=P,Y+=" "+V+" = "+B+"; ",A&&E)M="ifClause"+W,Y+=" var "+M+" = 'else'; ";else M="'else'";Y+=" } "}if(Y+=" if (!"+V+") { var err = ",J.createErrors!==!1){if(Y+=" { keyword: 'if' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { failingKeyword: "+M+" } ",J.opts.messages!==!1)Y+=` , message: 'should match "' + `+M+` + '" schema' `;if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";if(Y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(vErrors); ";else Y+=" validate.errors = vErrors; return false; ";if(Y+=" } ",q)Y+=" else { "}else if(q)Y+=" if (true) { ";return Y}});var nT0=I((dU6,cT0)=>{cT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="valid"+W,z="errs__"+W,U=J.util.copy(J),B="";U.level++;var D="valid"+U.level,w="i"+W,A=U.dataLevel=J.dataLevel+1,E="data"+A,P=J.baseId;if(Y+="var "+z+" = errors;var "+V+";",Array.isArray(K)){var M=J.schema.additionalItems;if(M===!1){Y+=" "+V+" = "+F+".length <= "+K.length+"; ";var T=H;H=J.errSchemaPath+"/additionalItems",Y+=" if (!"+V+") { ";var R=R||[];if(R.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { limit: "+K.length+" } ",J.opts.messages!==!1)Y+=" , message: 'should NOT have more than "+K.length+" items' ";if(J.opts.verbose)Y+=" , schema: false , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var S=Y;if(Y=R.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+S+"]); ";else Y+=" validate.errors = ["+S+"]; return false; ";else Y+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+=" } ",H=T,q)B+="}",Y+=" else { "}var k=K;if(k){var y,f=-1,l=k.length-1;while(f<l)if(y=k[f+=1],J.opts.strictKeywords?typeof y=="object"&&Object.keys(y).length>0||y===!1:J.util.schemaHasRules(y,J.RULES.all)){Y+=" "+D+" = true; if ("+F+".length > "+f+") { ";var b=F+"["+f+"]";U.schema=y,U.schemaPath=Z+"["+f+"]",U.errSchemaPath=H+"/"+f,U.errorPath=J.util.getPathExpr(J.errorPath,f,J.opts.jsonPointers,!0),U.dataPathArr[A]=f;var v=J.validate(U);if(U.baseId=P,J.util.varOccurences(v,E)<2)Y+=" "+J.util.varReplace(v,E,b)+" ";else Y+=" var "+E+" = "+b+"; "+v+" ";if(Y+=" } ",q)Y+=" if ("+D+") { ",B+="}"}}if(typeof M=="object"&&(J.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:J.util.schemaHasRules(M,J.RULES.all))){U.schema=M,U.schemaPath=J.schemaPath+".additionalItems",U.errSchemaPath=J.errSchemaPath+"/additionalItems",Y+=" "+D+" = true; if ("+F+".length > "+K.length+") { for (var "+w+" = "+K.length+"; "+w+" < "+F+".length; "+w+"++) { ",U.errorPath=J.util.getPathExpr(J.errorPath,w,J.opts.jsonPointers,!0);var b=F+"["+w+"]";U.dataPathArr[A]=w;var v=J.validate(U);if(U.baseId=P,J.util.varOccurences(v,E)<2)Y+=" "+J.util.varReplace(v,E,b)+" ";else Y+=" var "+E+" = "+b+"; "+v+" ";if(q)Y+=" if (!"+D+") break; ";if(Y+=" } } ",q)Y+=" if ("+D+") { ",B+="}"}}else if(J.opts.strictKeywords?typeof K=="object"&&Object.keys(K).length>0||K===!1:J.util.schemaHasRules(K,J.RULES.all)){U.schema=K,U.schemaPath=Z,U.errSchemaPath=H,Y+=" for (var "+w+" = 0; "+w+" < "+F+".length; "+w+"++) { ",U.errorPath=J.util.getPathExpr(J.errorPath,w,J.opts.jsonPointers,!0);var b=F+"["+w+"]";U.dataPathArr[A]=w;var v=J.validate(U);if(U.baseId=P,J.util.varOccurences(v,E)<2)Y+=" "+J.util.varReplace(v,E,b)+" ";else Y+=" var "+E+" = "+b+"; "+v+" ";if(q)Y+=" if (!"+D+") break; ";Y+=" }"}if(q)Y+=" "+B+" if ("+z+" == errors) {";return Y}});var wo=I((pU6,iT0)=>{iT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,P,F="data"+($||""),V=J.opts.$data&&K&&K.$data,z;if(V)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",z="schema"+W;else z=K;var U=X=="maximum",B=U?"exclusiveMaximum":"exclusiveMinimum",D=J.schema[B],w=J.opts.$data&&D&&D.$data,A=U?"<":">",E=U?">":"<",P=void 0;if(!(V||typeof K=="number"||K===void 0))throw Error(X+" must be number");if(!(w||D===void 0||typeof D=="number"||typeof D=="boolean"))throw Error(B+" must be number or boolean");if(w){var M=J.util.getData(D.$data,$,J.dataPathArr),T="exclusive"+W,R="exclType"+W,S="exclIsNumber"+W,k="op"+W,y="' + "+k+" + '";Y+=" var schemaExcl"+W+" = "+M+"; ",M="schemaExcl"+W,Y+=" var "+T+"; var "+R+" = typeof "+M+"; if ("+R+" != 'boolean' && "+R+" != 'undefined' && "+R+" != 'number') { ";var P=B,f=f||[];if(f.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '"+(P||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: {} ",J.opts.messages!==!1)Y+=" , message: '"+B+" should be boolean' ";if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var l=Y;if(Y=f.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+l+"]); ";else Y+=" validate.errors = ["+l+"]; return false; ";else Y+=" var err = "+l+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+=" } else if ( ",V)Y+=" ("+z+" !== undefined && typeof "+z+" != 'number') || ";if(Y+=" "+R+" == 'number' ? ( ("+T+" = "+z+" === undefined || "+M+" "+A+"= "+z+") ? "+F+" "+E+"= "+M+" : "+F+" "+E+" "+z+" ) : ( ("+T+" = "+M+" === true) ? "+F+" "+E+"= "+z+" : "+F+" "+E+" "+z+" ) || "+F+" !== "+F+") { var op"+W+" = "+T+" ? '"+A+"' : '"+A+"='; ",K===void 0)P=B,H=J.errSchemaPath+"/"+B,z=M,V=w}else{var S=typeof D=="number",y=A;if(S&&V){var k="'"+y+"'";if(Y+=" if ( ",V)Y+=" ("+z+" !== undefined && typeof "+z+" != 'number') || ";Y+=" ( "+z+" === undefined || "+D+" "+A+"= "+z+" ? "+F+" "+E+"= "+D+" : "+F+" "+E+" "+z+" ) || "+F+" !== "+F+") { "}else{if(S&&K===void 0)T=!0,P=B,H=J.errSchemaPath+"/"+B,z=D,E+="=";else{if(S)z=Math[U?"min":"max"](D,K);if(D===(S?z:!0))T=!0,P=B,H=J.errSchemaPath+"/"+B,E+="=";else T=!1,y+="="}var k="'"+y+"'";if(Y+=" if ( ",V)Y+=" ("+z+" !== undefined && typeof "+z+" != 'number') || ";Y+=" "+F+" "+E+" "+z+" || "+F+" !== "+F+") { "}}P=P||X;var f=f||[];if(f.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '"+(P||"_limit")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { comparison: "+k+", limit: "+z+", exclusive: "+T+" } ",J.opts.messages!==!1)if(Y+=" , message: 'should be "+y+" ",V)Y+="' + "+z;else Y+=""+z+"'";if(J.opts.verbose){if(Y+=" , schema: ",V)Y+="validate.schema"+Z;else Y+=""+K;Y+=" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" "}Y+=" } "}else Y+=" {} ";var l=Y;if(Y=f.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+l+"]); ";else Y+=" validate.errors = ["+l+"]; return false; ";else Y+=" var err = "+l+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+=" } ",q)Y+=" else { ";return Y}});var Po=I((cU6,rT0)=>{rT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,B,F="data"+($||""),V=J.opts.$data&&K&&K.$data,z;if(V)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",z="schema"+W;else z=K;if(!(V||typeof K=="number"))throw Error(X+" must be number");var U=X=="maxItems"?">":"<";if(Y+="if ( ",V)Y+=" ("+z+" !== undefined && typeof "+z+" != 'number') || ";Y+=" "+F+".length "+U+" "+z+") { ";var B=X,D=D||[];if(D.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '"+(B||"_limitItems")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { limit: "+z+" } ",J.opts.messages!==!1){if(Y+=" , message: 'should NOT have ",X=="maxItems")Y+="more";else Y+="fewer";if(Y+=" than ",V)Y+="' + "+z+" + '";else Y+=""+K;Y+=" items' "}if(J.opts.verbose){if(Y+=" , schema: ",V)Y+="validate.schema"+Z;else Y+=""+K;Y+=" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" "}Y+=" } "}else Y+=" {} ";var w=Y;if(Y=D.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+w+"]); ";else Y+=" validate.errors = ["+w+"]; return false; ";else Y+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+="} ",q)Y+=" else { ";return Y}});var Mo=I((nU6,aT0)=>{aT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,B,F="data"+($||""),V=J.opts.$data&&K&&K.$data,z;if(V)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",z="schema"+W;else z=K;if(!(V||typeof K=="number"))throw Error(X+" must be number");var U=X=="maxLength"?">":"<";if(Y+="if ( ",V)Y+=" ("+z+" !== undefined && typeof "+z+" != 'number') || ";if(J.opts.unicode===!1)Y+=" "+F+".length ";else Y+=" ucs2length("+F+") ";Y+=" "+U+" "+z+") { ";var B=X,D=D||[];if(D.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '"+(B||"_limitLength")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { limit: "+z+" } ",J.opts.messages!==!1){if(Y+=" , message: 'should NOT be ",X=="maxLength")Y+="longer";else Y+="shorter";if(Y+=" than ",V)Y+="' + "+z+" + '";else Y+=""+K;Y+=" characters' "}if(J.opts.verbose){if(Y+=" , schema: ",V)Y+="validate.schema"+Z;else Y+=""+K;Y+=" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" "}Y+=" } "}else Y+=" {} ";var w=Y;if(Y=D.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+w+"]); ";else Y+=" validate.errors = ["+w+"]; return false; ";else Y+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+="} ",q)Y+=" else { ";return Y}});var Ao=I((iU6,oT0)=>{oT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,B,F="data"+($||""),V=J.opts.$data&&K&&K.$data,z;if(V)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",z="schema"+W;else z=K;if(!(V||typeof K=="number"))throw Error(X+" must be number");var U=X=="maxProperties"?">":"<";if(Y+="if ( ",V)Y+=" ("+z+" !== undefined && typeof "+z+" != 'number') || ";Y+=" Object.keys("+F+").length "+U+" "+z+") { ";var B=X,D=D||[];if(D.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '"+(B||"_limitProperties")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { limit: "+z+" } ",J.opts.messages!==!1){if(Y+=" , message: 'should NOT have ",X=="maxProperties")Y+="more";else Y+="fewer";if(Y+=" than ",V)Y+="' + "+z+" + '";else Y+=""+K;Y+=" properties' "}if(J.opts.verbose){if(Y+=" , schema: ",V)Y+="validate.schema"+Z;else Y+=""+K;Y+=" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" "}Y+=" } "}else Y+=" {} ";var w=Y;if(Y=D.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+w+"]); ";else Y+=" validate.errors = ["+w+"]; return false; ";else Y+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+="} ",q)Y+=" else { ";return Y}});var tT0=I((rU6,sT0)=>{sT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V=J.opts.$data&&K&&K.$data,z;if(V)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",z="schema"+W;else z=K;if(!(V||typeof K=="number"))throw Error(X+" must be number");if(Y+="var division"+W+";if (",V)Y+=" "+z+" !== undefined && ( typeof "+z+" != 'number' || ";if(Y+=" (division"+W+" = "+F+" / "+z+", ",J.opts.multipleOfPrecision)Y+=" Math.abs(Math.round(division"+W+") - division"+W+") > 1e-"+J.opts.multipleOfPrecision+" ";else Y+=" division"+W+" !== parseInt(division"+W+") ";if(Y+=" ) ",V)Y+=" ) ";Y+=" ) { ";var U=U||[];if(U.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { multipleOf: "+z+" } ",J.opts.messages!==!1)if(Y+=" , message: 'should be multiple of ",V)Y+="' + "+z;else Y+=""+z+"'";if(J.opts.verbose){if(Y+=" , schema: ",V)Y+="validate.schema"+Z;else Y+=""+K;Y+=" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" "}Y+=" } "}else Y+=" {} ";var B=Y;if(Y=U.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+B+"]); ";else Y+=" validate.errors = ["+B+"]; return false; ";else Y+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+="} ",q)Y+=" else { ";return Y}});var QE0=I((aU6,eT0)=>{eT0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="errs__"+W,z=J.util.copy(J);z.level++;var U="valid"+z.level;if(J.opts.strictKeywords?typeof K=="object"&&Object.keys(K).length>0||K===!1:J.util.schemaHasRules(K,J.RULES.all)){z.schema=K,z.schemaPath=Z,z.errSchemaPath=H,Y+=" var "+V+" = errors; ";var B=J.compositeRule;J.compositeRule=z.compositeRule=!0,z.createErrors=!1;var D;if(z.opts.allErrors)D=z.opts.allErrors,z.opts.allErrors=!1;if(Y+=" "+J.validate(z)+" ",z.createErrors=!0,D)z.opts.allErrors=D;J.compositeRule=z.compositeRule=B,Y+=" if ("+U+") { ";var w=w||[];if(w.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'not' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: {} ",J.opts.messages!==!1)Y+=" , message: 'should NOT be valid' ";if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var A=Y;if(Y=w.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+A+"]); ";else Y+=" validate.errors = ["+A+"]; return false; ";else Y+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+=" } else { errors = "+V+"; if (vErrors !== null) { if ("+V+") vErrors.length = "+V+"; else vErrors = null; } ",J.opts.allErrors)Y+=" } "}else{if(Y+=" var err = ",J.createErrors!==!1){if(Y+=" { keyword: 'not' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: {} ",J.opts.messages!==!1)Y+=" , message: 'should NOT be valid' ";if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";if(Y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",q)Y+=" if (false) { "}return Y}});var XE0=I((oU6,JE0)=>{JE0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="valid"+W,z="errs__"+W,U=J.util.copy(J),B="";U.level++;var D="valid"+U.level,w=U.baseId,A="prevValid"+W,E="passingSchemas"+W;Y+="var "+z+" = errors , "+A+" = false , "+V+" = false , "+E+" = null; ";var P=J.compositeRule;J.compositeRule=U.compositeRule=!0;var M=K;if(M){var T,R=-1,S=M.length-1;while(R<S){if(T=M[R+=1],J.opts.strictKeywords?typeof T=="object"&&Object.keys(T).length>0||T===!1:J.util.schemaHasRules(T,J.RULES.all))U.schema=T,U.schemaPath=Z+"["+R+"]",U.errSchemaPath=H+"/"+R,Y+=" "+J.validate(U)+" ",U.baseId=w;else Y+=" var "+D+" = true; ";if(R)Y+=" if ("+D+" && "+A+") { "+V+" = false; "+E+" = ["+E+", "+R+"]; } else { ",B+="}";Y+=" if ("+D+") { "+V+" = "+A+" = true; "+E+" = "+R+"; }"}}if(J.compositeRule=U.compositeRule=P,Y+=""+B+"if (!"+V+") { var err = ",J.createErrors!==!1){if(Y+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { passingSchemas: "+E+" } ",J.opts.messages!==!1)Y+=" , message: 'should match exactly one schema in oneOf' ";if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";if(Y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(vErrors); ";else Y+=" validate.errors = vErrors; return false; ";if(Y+="} else { errors = "+z+"; if (vErrors !== null) { if ("+z+") vErrors.length = "+z+"; else vErrors = null; }",J.opts.allErrors)Y+=" } ";return Y}});var GE0=I((sU6,YE0)=>{YE0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V=J.opts.$data&&K&&K.$data,z;if(V)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",z="schema"+W;else z=K;var U=V?"(new RegExp("+z+"))":J.usePattern(K);if(Y+="if ( ",V)Y+=" ("+z+" !== undefined && typeof "+z+" != 'string') || ";Y+=" !"+U+".test("+F+") ) { ";var B=B||[];if(B.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { pattern: ",V)Y+=""+z;else Y+=""+J.util.toQuotedString(K);if(Y+=" } ",J.opts.messages!==!1){if(Y+=` , message: 'should match pattern "`,V)Y+="' + "+z+" + '";else Y+=""+J.util.escapeQuotes(K);Y+=`"' `}if(J.opts.verbose){if(Y+=" , schema: ",V)Y+="validate.schema"+Z;else Y+=""+J.util.toQuotedString(K);Y+=" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" "}Y+=" } "}else Y+=" {} ";var D=Y;if(Y=B.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+D+"]); ";else Y+=" validate.errors = ["+D+"]; return false; ";else Y+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+="} ",q)Y+=" else { ";return Y}});var $E0=I((tU6,WE0)=>{WE0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="errs__"+W,z=J.util.copy(J),U="";z.level++;var B="valid"+z.level,D="key"+W,w="idx"+W,A=z.dataLevel=J.dataLevel+1,E="data"+A,P="dataProperties"+W,M=Object.keys(K||{}).filter($0),T=J.schema.patternProperties||{},R=Object.keys(T).filter($0),S=J.schema.additionalProperties,k=M.length||R.length,y=S===!1,f=typeof S=="object"&&Object.keys(S).length,l=J.opts.removeAdditional,b=y||f||l,v=J.opts.ownProperties,g=J.baseId,e=J.schema.required;if(e&&!(J.opts.$data&&e.$data)&&e.length<J.opts.loopRequired)var a=J.util.toHash(e);function $0(L4){return L4!=="__proto__"}if(Y+="var "+V+" = errors;var "+B+" = true;",v)Y+=" var "+P+" = undefined;";if(b){if(v)Y+=" "+P+" = "+P+" || Object.keys("+F+"); for (var "+w+"=0; "+w+"<"+P+".length; "+w+"++) { var "+D+" = "+P+"["+w+"]; ";else Y+=" for (var "+D+" in "+F+") { ";if(k){if(Y+=" var isAdditional"+W+" = !(false ",M.length)if(M.length>8)Y+=" || validate.schema"+Z+".hasOwnProperty("+D+") ";else{var U0=M;if(U0){var X0,L0=-1,R0=U0.length-1;while(L0<R0)X0=U0[L0+=1],Y+=" || "+D+" == "+J.util.toQuotedString(X0)+" "}}if(R.length){var b0=R;if(b0){var r0,D0=-1,H0=b0.length-1;while(D0<H0)r0=b0[D0+=1],Y+=" || "+J.usePattern(r0)+".test("+D+") "}}Y+=" ); if (isAdditional"+W+") { "}if(l=="all")Y+=" delete "+F+"["+D+"]; ";else{var S0=J.errorPath,b1="' + "+D+" + '";if(J.opts._errorDataPathProperty)J.errorPath=J.util.getPathExpr(J.errorPath,D,J.opts.jsonPointers);if(y)if(l)Y+=" delete "+F+"["+D+"]; ";else{Y+=" "+B+" = false; ";var C1=H;H=J.errSchemaPath+"/additionalProperties";var h0=h0||[];if(h0.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { additionalProperty: '"+b1+"' } ",J.opts.messages!==!1){if(Y+=" , message: '",J.opts._errorDataPathProperty)Y+="is an invalid additional property";else Y+="should NOT have additional properties";Y+="' "}if(J.opts.verbose)Y+=" , schema: false , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var B0=Y;if(Y=h0.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+B0+"]); ";else Y+=" validate.errors = ["+B0+"]; return false; ";else Y+=" var err = "+B0+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(H=C1,q)Y+=" break; "}else if(f)if(l=="failing"){Y+=" var "+V+" = errors; ";var z0=J.compositeRule;J.compositeRule=z.compositeRule=!0,z.schema=S,z.schemaPath=J.schemaPath+".additionalProperties",z.errSchemaPath=J.errSchemaPath+"/additionalProperties",z.errorPath=J.opts._errorDataPathProperty?J.errorPath:J.util.getPathExpr(J.errorPath,D,J.opts.jsonPointers);var j0=F+"["+D+"]";z.dataPathArr[A]=D;var G0=J.validate(z);if(z.baseId=g,J.util.varOccurences(G0,E)<2)Y+=" "+J.util.varReplace(G0,E,j0)+" ";else Y+=" var "+E+" = "+j0+"; "+G0+" ";Y+=" if (!"+B+") { errors = "+V+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+F+"["+D+"]; } ",J.compositeRule=z.compositeRule=z0}else{z.schema=S,z.schemaPath=J.schemaPath+".additionalProperties",z.errSchemaPath=J.errSchemaPath+"/additionalProperties",z.errorPath=J.opts._errorDataPathProperty?J.errorPath:J.util.getPathExpr(J.errorPath,D,J.opts.jsonPointers);var j0=F+"["+D+"]";z.dataPathArr[A]=D;var G0=J.validate(z);if(z.baseId=g,J.util.varOccurences(G0,E)<2)Y+=" "+J.util.varReplace(G0,E,j0)+" ";else Y+=" var "+E+" = "+j0+"; "+G0+" ";if(q)Y+=" if (!"+B+") break; "}J.errorPath=S0}if(k)Y+=" } ";if(Y+=" } ",q)Y+=" if ("+B+") { ",U+="}"}var O0=J.opts.useDefaults&&!J.compositeRule;if(M.length){var m0=M;if(m0){var X0,C0=-1,f0=m0.length-1;while(C0<f0){X0=m0[C0+=1];var k1=K[X0];if(J.opts.strictKeywords?typeof k1=="object"&&Object.keys(k1).length>0||k1===!1:J.util.schemaHasRules(k1,J.RULES.all)){var u0=J.util.getProperty(X0),j0=F+u0,j1=O0&&k1.default!==void 0;z.schema=k1,z.schemaPath=Z+u0,z.errSchemaPath=H+"/"+J.util.escapeFragment(X0),z.errorPath=J.util.getPath(J.errorPath,X0,J.opts.jsonPointers),z.dataPathArr[A]=J.util.toQuotedString(X0);var G0=J.validate(z);if(z.baseId=g,J.util.varOccurences(G0,E)<2){G0=J.util.varReplace(G0,E,j0);var Z4=j0}else{var Z4=E;Y+=" var "+E+" = "+j0+"; "}if(j1)Y+=" "+G0+" ";else{if(a&&a[X0]){if(Y+=" if ( "+Z4+" === undefined ",v)Y+=" || ! Object.prototype.hasOwnProperty.call("+F+", '"+J.util.escapeQuotes(X0)+"') ";Y+=") { "+B+" = false; ";var S0=J.errorPath,C1=H,$1=J.util.escapeQuotes(X0);if(J.opts._errorDataPathProperty)J.errorPath=J.util.getPath(S0,X0,J.opts.jsonPointers);H=J.errSchemaPath+"/required";var h0=h0||[];if(h0.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'required' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { missingProperty: '"+$1+"' } ",J.opts.messages!==!1){if(Y+=" , message: '",J.opts._errorDataPathProperty)Y+="is a required property";else Y+="should have required property \\'"+$1+"\\'";Y+="' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var B0=Y;if(Y=h0.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+B0+"]); ";else Y+=" validate.errors = ["+B0+"]; return false; ";else Y+=" var err = "+B0+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";H=C1,J.errorPath=S0,Y+=" } else { "}else if(q){if(Y+=" if ( "+Z4+" === undefined ",v)Y+=" || ! Object.prototype.hasOwnProperty.call("+F+", '"+J.util.escapeQuotes(X0)+"') ";Y+=") { "+B+" = true; } else { "}else{if(Y+=" if ("+Z4+" !== undefined ",v)Y+=" && Object.prototype.hasOwnProperty.call("+F+", '"+J.util.escapeQuotes(X0)+"') ";Y+=" ) { "}Y+=" "+G0+" } "}}if(q)Y+=" if ("+B+") { ",U+="}"}}}if(R.length){var v0=R;if(v0){var r0,Y1=-1,H6=v0.length-1;while(Y1<H6){r0=v0[Y1+=1];var k1=T[r0];if(J.opts.strictKeywords?typeof k1=="object"&&Object.keys(k1).length>0||k1===!1:J.util.schemaHasRules(k1,J.RULES.all)){if(z.schema=k1,z.schemaPath=J.schemaPath+".patternProperties"+J.util.getProperty(r0),z.errSchemaPath=J.errSchemaPath+"/patternProperties/"+J.util.escapeFragment(r0),v)Y+=" "+P+" = "+P+" || Object.keys("+F+"); for (var "+w+"=0; "+w+"<"+P+".length; "+w+"++) { var "+D+" = "+P+"["+w+"]; ";else Y+=" for (var "+D+" in "+F+") { ";Y+=" if ("+J.usePattern(r0)+".test("+D+")) { ",z.errorPath=J.util.getPathExpr(J.errorPath,D,J.opts.jsonPointers);var j0=F+"["+D+"]";z.dataPathArr[A]=D;var G0=J.validate(z);if(z.baseId=g,J.util.varOccurences(G0,E)<2)Y+=" "+J.util.varReplace(G0,E,j0)+" ";else Y+=" var "+E+" = "+j0+"; "+G0+" ";if(q)Y+=" if (!"+B+") break; ";if(Y+=" } ",q)Y+=" else "+B+" = true; ";if(Y+=" } ",q)Y+=" if ("+B+") { ",U+="}"}}}}if(q)Y+=" "+U+" if ("+V+" == errors) {";return Y}});var ZE0=I((eU6,KE0)=>{KE0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="errs__"+W,z=J.util.copy(J),U="";z.level++;var B="valid"+z.level;if(Y+="var "+V+" = errors;",J.opts.strictKeywords?typeof K=="object"&&Object.keys(K).length>0||K===!1:J.util.schemaHasRules(K,J.RULES.all)){z.schema=K,z.schemaPath=Z,z.errSchemaPath=H;var D="key"+W,w="idx"+W,A="i"+W,E="' + "+D+" + '",P=z.dataLevel=J.dataLevel+1,M="data"+P,T="dataProperties"+W,R=J.opts.ownProperties,S=J.baseId;if(R)Y+=" var "+T+" = undefined; ";if(R)Y+=" "+T+" = "+T+" || Object.keys("+F+"); for (var "+w+"=0; "+w+"<"+T+".length; "+w+"++) { var "+D+" = "+T+"["+w+"]; ";else Y+=" for (var "+D+" in "+F+") { ";Y+=" var startErrs"+W+" = errors; ";var k=D,y=J.compositeRule;J.compositeRule=z.compositeRule=!0;var f=J.validate(z);if(z.baseId=S,J.util.varOccurences(f,M)<2)Y+=" "+J.util.varReplace(f,M,k)+" ";else Y+=" var "+M+" = "+k+"; "+f+" ";if(J.compositeRule=z.compositeRule=y,Y+=" if (!"+B+") { for (var "+A+"=startErrs"+W+"; "+A+"<errors; "+A+"++) { vErrors["+A+"].propertyName = "+D+"; } var err = ",J.createErrors!==!1){if(Y+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { propertyName: '"+E+"' } ",J.opts.messages!==!1)Y+=" , message: 'property name \\'"+E+"\\' is invalid' ";if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";if(Y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(vErrors); ";else Y+=" validate.errors = vErrors; return false; ";if(q)Y+=" break; ";Y+=" } }"}if(q)Y+=" "+U+" if ("+V+" == errors) {";return Y}});var qE0=I((QN6,HE0)=>{HE0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="valid"+W,z=J.opts.$data&&K&&K.$data,U;if(z)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",U="schema"+W;else U=K;var B="schema"+W;if(!z)if(K.length<J.opts.loopRequired&&J.schema.properties&&Object.keys(J.schema.properties).length){var D=[],w=K;if(w){var A,E=-1,P=w.length-1;while(E<P){A=w[E+=1];var M=J.schema.properties[A];if(!(M&&(J.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:J.util.schemaHasRules(M,J.RULES.all))))D[D.length]=A}}}else var D=K;if(z||D.length){var T=J.errorPath,R=z||D.length>=J.opts.loopRequired,S=J.opts.ownProperties;if(q)if(Y+=" var missing"+W+"; ",R){if(!z)Y+=" var "+B+" = validate.schema"+Z+"; ";var k="i"+W,y="schema"+W+"["+k+"]",f="' + "+y+" + '";if(J.opts._errorDataPathProperty)J.errorPath=J.util.getPathExpr(T,y,J.opts.jsonPointers);if(Y+=" var "+V+" = true; ",z)Y+=" if (schema"+W+" === undefined) "+V+" = true; else if (!Array.isArray(schema"+W+")) "+V+" = false; else {";if(Y+=" for (var "+k+" = 0; "+k+" < "+B+".length; "+k+"++) { "+V+" = "+F+"["+B+"["+k+"]] !== undefined ",S)Y+=" && Object.prototype.hasOwnProperty.call("+F+", "+B+"["+k+"]) ";if(Y+="; if (!"+V+") break; } ",z)Y+=" } ";Y+=" if (!"+V+") { ";var l=l||[];if(l.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'required' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { missingProperty: '"+f+"' } ",J.opts.messages!==!1){if(Y+=" , message: '",J.opts._errorDataPathProperty)Y+="is a required property";else Y+="should have required property \\'"+f+"\\'";Y+="' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var b=Y;if(Y=l.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+b+"]); ";else Y+=" validate.errors = ["+b+"]; return false; ";else Y+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Y+=" } else { "}else{Y+=" if ( ";var v=D;if(v){var g,k=-1,e=v.length-1;while(k<e){if(g=v[k+=1],k)Y+=" || ";var a=J.util.getProperty(g),$0=F+a;if(Y+=" ( ( "+$0+" === undefined ",S)Y+=" || ! Object.prototype.hasOwnProperty.call("+F+", '"+J.util.escapeQuotes(g)+"') ";Y+=") && (missing"+W+" = "+J.util.toQuotedString(J.opts.jsonPointers?g:a)+") ) "}}Y+=") { ";var y="missing"+W,f="' + "+y+" + '";if(J.opts._errorDataPathProperty)J.errorPath=J.opts.jsonPointers?J.util.getPathExpr(T,y,!0):T+" + "+y;var l=l||[];if(l.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'required' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { missingProperty: '"+f+"' } ",J.opts.messages!==!1){if(Y+=" , message: '",J.opts._errorDataPathProperty)Y+="is a required property";else Y+="should have required property \\'"+f+"\\'";Y+="' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";var b=Y;if(Y=l.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+b+"]); ";else Y+=" validate.errors = ["+b+"]; return false; ";else Y+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Y+=" } else { "}else if(R){if(!z)Y+=" var "+B+" = validate.schema"+Z+"; ";var k="i"+W,y="schema"+W+"["+k+"]",f="' + "+y+" + '";if(J.opts._errorDataPathProperty)J.errorPath=J.util.getPathExpr(T,y,J.opts.jsonPointers);if(z){if(Y+=" if ("+B+" && !Array.isArray("+B+")) { var err = ",J.createErrors!==!1){if(Y+=" { keyword: 'required' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { missingProperty: '"+f+"' } ",J.opts.messages!==!1){if(Y+=" , message: '",J.opts._errorDataPathProperty)Y+="is a required property";else Y+="should have required property \\'"+f+"\\'";Y+="' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";Y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+B+" !== undefined) { "}if(Y+=" for (var "+k+" = 0; "+k+" < "+B+".length; "+k+"++) { if ("+F+"["+B+"["+k+"]] === undefined ",S)Y+=" || ! Object.prototype.hasOwnProperty.call("+F+", "+B+"["+k+"]) ";if(Y+=") { var err = ",J.createErrors!==!1){if(Y+=" { keyword: 'required' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { missingProperty: '"+f+"' } ",J.opts.messages!==!1){if(Y+=" , message: '",J.opts._errorDataPathProperty)Y+="is a required property";else Y+="should have required property \\'"+f+"\\'";Y+="' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";if(Y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",z)Y+=" } "}else{var U0=D;if(U0){var g,X0=-1,L0=U0.length-1;while(X0<L0){g=U0[X0+=1];var a=J.util.getProperty(g),f=J.util.escapeQuotes(g),$0=F+a;if(J.opts._errorDataPathProperty)J.errorPath=J.util.getPath(T,g,J.opts.jsonPointers);if(Y+=" if ( "+$0+" === undefined ",S)Y+=" || ! Object.prototype.hasOwnProperty.call("+F+", '"+J.util.escapeQuotes(g)+"') ";if(Y+=") { var err = ",J.createErrors!==!1){if(Y+=" { keyword: 'required' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { missingProperty: '"+f+"' } ",J.opts.messages!==!1){if(Y+=" , message: '",J.opts._errorDataPathProperty)Y+="is a required property";else Y+="should have required property \\'"+f+"\\'";Y+="' "}if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" ";Y+=" } "}else Y+=" {} ";Y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}J.errorPath=T}else if(q)Y+=" if (true) {";return Y}});var VE0=I((JN6,FE0)=>{FE0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F="data"+($||""),V="valid"+W,z=J.opts.$data&&K&&K.$data,U;if(z)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",U="schema"+W;else U=K;if((K||z)&&J.opts.uniqueItems!==!1){if(z)Y+=" var "+V+"; if ("+U+" === false || "+U+" === undefined) "+V+" = true; else if (typeof "+U+" != 'boolean') "+V+" = false; else { ";Y+=" var i = "+F+".length , "+V+" = true , j; if (i > 1) { ";var B=J.schema.items&&J.schema.items.type,D=Array.isArray(B);if(!B||B=="object"||B=="array"||D&&(B.indexOf("object")>=0||B.indexOf("array")>=0))Y+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+F+"[i], "+F+"[j])) { "+V+" = false; break outer; } } } ";else{Y+=" var itemIndices = {}, item; for (;i--;) { var item = "+F+"[i]; ";var w="checkDataType"+(D?"s":"");if(Y+=" if ("+J.util[w](B,"item",J.opts.strictNumbers,!0)+") continue; ",D)Y+=` if (typeof item == 'string') item = '"' + item; `;Y+=" if (typeof itemIndices[item] == 'number') { "+V+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}if(Y+=" } ",z)Y+=" } ";Y+=" if (!"+V+") { ";var A=A||[];if(A.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { i: i, j: j } ",J.opts.messages!==!1)Y+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";if(J.opts.verbose){if(Y+=" , schema: ",z)Y+="validate.schema"+Z;else Y+=""+K;Y+=" , parentSchema: validate.schema"+J.schemaPath+" , data: "+F+" "}Y+=" } "}else Y+=" {} ";var E=Y;if(Y=A.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+E+"]); ";else Y+=" validate.errors = ["+E+"]; return false; ";else Y+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Y+=" } ",q)Y+=" else { "}else if(q)Y+=" if (true) { ";return Y}});var UE0=I((XN6,zE0)=>{zE0.exports={$ref:jT0(),allOf:RT0(),anyOf:ST0(),$comment:kT0(),const:yT0(),contains:fT0(),dependencies:xT0(),enum:uT0(),format:lT0(),if:pT0(),items:nT0(),maximum:wo(),minimum:wo(),maxItems:Po(),minItems:Po(),maxLength:Mo(),minLength:Mo(),maxProperties:Ao(),minProperties:Ao(),multipleOf:tT0(),not:QE0(),oneOf:XE0(),pattern:GE0(),properties:$E0(),propertyNames:ZE0(),required:qE0(),uniqueItems:VE0(),validate:Do()}});var OE0=I((YN6,BE0)=>{var NE0=UE0(),To=OH().toHash;BE0.exports=function(){var J=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],X=["type","$comment"],G=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],Y=["number","integer","string","array","object","boolean","null"];return J.all=To(X),J.types=To(Y),J.forEach(function(W){if(W.rules=W.rules.map(function($){var K;if(typeof $=="object"){var Z=Object.keys($)[0];K=$[Z],$=Z,K.forEach(function(q){X.push(q),J.all[q]=!0})}X.push($);var H=J.all[$]={keyword:$,code:NE0[$],implements:K};return H}),J.all.$comment={keyword:"$comment",code:NE0.$comment},W.type)J.types[W.type]=W}),J.keywords=To(X.concat(G)),J.custom={},J}});var wE0=I((GN6,LE0)=>{var DE0=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];LE0.exports=function(Q,J){for(var X=0;X<J.length;X++){Q=JSON.parse(JSON.stringify(Q));var G=J[X].split("/"),Y=Q,W;for(W=1;W<G.length;W++)Y=Y[G[W]];for(W=0;W<DE0.length;W++){var $=DE0[W],K=Y[$];if(K)Y[$]={anyOf:[K,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}}}return Q}});var AE0=I((WN6,ME0)=>{var vn1=vC().MissingRef;ME0.exports=PE0;function PE0(Q,J,X){var G=this;if(typeof this._opts.loadSchema!="function")throw Error("options.loadSchema should be a function");if(typeof J=="function")X=J,J=void 0;var Y=W(Q).then(function(){var K=G._addSchema(Q,void 0,J);return K.validate||$(K)});if(X)Y.then(function(K){X(null,K)},X);return Y;function W(K){var Z=K.$schema;return Z&&!G.getSchema(Z)?PE0.call(G,{$ref:Z},!0):Promise.resolve()}function $(K){try{return G._compile(K)}catch(H){if(H instanceof vn1)return Z(H);throw H}function Z(H){var q=H.missingSchema;if(z(q))throw Error("Schema "+q+" is loaded but "+H.missingRef+" cannot be resolved");var F=G._loadingSchemas[q];if(!F)F=G._loadingSchemas[q]=G._opts.loadSchema(q),F.then(V,V);return F.then(function(U){if(!z(q))return W(U).then(function(){if(!z(q))G.addSchema(U,q,void 0,J)})}).then(function(){return $(K)});function V(){delete G._loadingSchemas[q]}function z(U){return G._refs[U]||G._schemas[U]}}}}});var EE0=I(($N6,TE0)=>{TE0.exports=function(J,X,G){var Y=" ",W=J.level,$=J.dataLevel,K=J.schema[X],Z=J.schemaPath+J.util.getProperty(X),H=J.errSchemaPath+"/"+X,q=!J.opts.allErrors,F,V="data"+($||""),z="valid"+W,U="errs__"+W,B=J.opts.$data&&K&&K.$data,D;if(B)Y+=" var schema"+W+" = "+J.util.getData(K.$data,$,J.dataPathArr)+"; ",D="schema"+W;else D=K;var w=this,A="definition"+W,E=w.definition,P="",M,T,R,S,k;if(B&&E.$data){k="keywordValidate"+W;var y=E.validateSchema;Y+=" var "+A+" = RULES.custom['"+X+"'].definition; var "+k+" = "+A+".validate;"}else{if(S=J.useCustomRule(w,K,J.schema,J),!S)return;D="validate.schema"+Z,k=S.code,M=E.compile,T=E.inline,R=E.macro}var f=k+".errors",l="i"+W,b="ruleErr"+W,v=E.async;if(v&&!J.async)throw Error("async keyword in sync schema");if(!(T||R))Y+=""+f+" = null;";if(Y+="var "+U+" = errors;var "+z+";",B&&E.$data){if(P+="}",Y+=" if ("+D+" === undefined) { "+z+" = true; } else { ",y)P+="}",Y+=" "+z+" = "+A+".validateSchema("+D+"); if ("+z+") { "}if(T)if(E.statements)Y+=" "+S.validate+" ";else Y+=" "+z+" = "+S.validate+"; ";else if(R){var g=J.util.copy(J),P="";g.level++;var e="valid"+g.level;g.schema=S.validate,g.schemaPath="";var a=J.compositeRule;J.compositeRule=g.compositeRule=!0;var $0=J.validate(g).replace(/validate\.schema/g,k);J.compositeRule=g.compositeRule=a,Y+=" "+$0}else{var U0=U0||[];if(U0.push(Y),Y="",Y+=" "+k+".call( ",J.opts.passContext)Y+="this";else Y+="self";if(M||E.schema===!1)Y+=" , "+V+" ";else Y+=" , "+D+" , "+V+" , validate.schema"+J.schemaPath+" ";if(Y+=" , (dataPath || '')",J.errorPath!='""')Y+=" + "+J.errorPath;var X0=$?"data"+($-1||""):"parentData",L0=$?J.dataPathArr[$]:"parentDataProperty";Y+=" , "+X0+" , "+L0+" , rootData ) ";var R0=Y;if(Y=U0.pop(),E.errors===!1){if(Y+=" "+z+" = ",v)Y+="await ";Y+=""+R0+"; "}else if(v)f="customErrors"+W,Y+=" var "+f+" = null; try { "+z+" = await "+R0+"; } catch (e) { "+z+" = false; if (e instanceof ValidationError) "+f+" = e.errors; else throw e; } ";else Y+=" "+f+" = null; "+z+" = "+R0+"; "}if(E.modifying)Y+=" if ("+X0+") "+V+" = "+X0+"["+L0+"];";if(Y+=""+P,E.valid){if(q)Y+=" if (true) { "}else{if(Y+=" if ( ",E.valid===void 0)if(Y+=" !",R)Y+=""+e;else Y+=""+z;else Y+=" "+!E.valid+" ";Y+=") { ",F=w.keyword;var U0=U0||[];U0.push(Y),Y="";var U0=U0||[];if(U0.push(Y),Y="",J.createErrors!==!1){if(Y+=" { keyword: '"+(F||"custom")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { keyword: '"+w.keyword+"' } ",J.opts.messages!==!1)Y+=` , message: 'should pass "`+w.keyword+`" keyword validation' `;if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+V+" ";Y+=" } "}else Y+=" {} ";var b0=Y;if(Y=U0.pop(),!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(["+b0+"]); ";else Y+=" validate.errors = ["+b0+"]; return false; ";else Y+=" var err = "+b0+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var r0=Y;if(Y=U0.pop(),T)if(E.errors){if(E.errors!="full"){if(Y+=" for (var "+l+"="+U+"; "+l+"<errors; "+l+"++) { var "+b+" = vErrors["+l+"]; if ("+b+".dataPath === undefined) "+b+".dataPath = (dataPath || '') + "+J.errorPath+"; if ("+b+".schemaPath === undefined) { "+b+'.schemaPath = "'+H+'"; } ',J.opts.verbose)Y+=" "+b+".schema = "+D+"; "+b+".data = "+V+"; ";Y+=" } "}}else if(E.errors===!1)Y+=" "+r0+" ";else{if(Y+=" if ("+U+" == errors) { "+r0+" } else { for (var "+l+"="+U+"; "+l+"<errors; "+l+"++) { var "+b+" = vErrors["+l+"]; if ("+b+".dataPath === undefined) "+b+".dataPath = (dataPath || '') + "+J.errorPath+"; if ("+b+".schemaPath === undefined) { "+b+'.schemaPath = "'+H+'"; } ',J.opts.verbose)Y+=" "+b+".schema = "+D+"; "+b+".data = "+V+"; ";Y+=" } } "}else if(R){if(Y+=" var err = ",J.createErrors!==!1){if(Y+=" { keyword: '"+(F||"custom")+"' , dataPath: (dataPath || '') + "+J.errorPath+" , schemaPath: "+J.util.toQuotedString(H)+" , params: { keyword: '"+w.keyword+"' } ",J.opts.messages!==!1)Y+=` , message: 'should pass "`+w.keyword+`" keyword validation' `;if(J.opts.verbose)Y+=" , schema: validate.schema"+Z+" , parentSchema: validate.schema"+J.schemaPath+" , data: "+V+" ";Y+=" } "}else Y+=" {} ";if(Y+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!J.compositeRule&&q)if(J.async)Y+=" throw new ValidationError(vErrors); ";else Y+=" validate.errors = vErrors; return false; "}else if(E.errors===!1)Y+=" "+r0+" ";else{if(Y+=" if (Array.isArray("+f+")) { if (vErrors === null) vErrors = "+f+"; else vErrors = vErrors.concat("+f+"); errors = vErrors.length; for (var "+l+"="+U+"; "+l+"<errors; "+l+"++) { var "+b+" = vErrors["+l+"]; if ("+b+".dataPath === undefined) "+b+".dataPath = (dataPath || '') + "+J.errorPath+"; "+b+'.schemaPath = "'+H+'"; ',J.opts.verbose)Y+=" "+b+".schema = "+D+"; "+b+".data = "+V+"; ";Y+=" } } else { "+r0+" } "}if(Y+=" } ",q)Y+=" else { "}return Y}});var Eo=I((KN6,kn1)=>{kn1.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var RE0=I((ZN6,IE0)=>{var jE0=Eo();IE0.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:jE0.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:jE0.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var SE0=I((HN6,CE0)=>{var _n1=/^[a-z_$][a-z0-9_$-]*$/i,yn1=EE0(),hn1=RE0();CE0.exports={add:fn1,get:bn1,remove:xn1,validate:jo};function fn1(Q,J){var X=this.RULES;if(X.keywords[Q])throw Error("Keyword "+Q+" is already defined");if(!_n1.test(Q))throw Error("Keyword "+Q+" is not a valid identifier");if(J){this.validateKeyword(J,!0);var G=J.type;if(Array.isArray(G))for(var Y=0;Y<G.length;Y++)$(Q,G[Y],J);else $(Q,G,J);var W=J.metaSchema;if(W){if(J.$data&&this._opts.$data)W={anyOf:[W,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]};J.validateSchema=this.compile(W,!0)}}X.keywords[Q]=X.all[Q]=!0;function $(K,Z,H){var q;for(var F=0;F<X.length;F++){var V=X[F];if(V.type==Z){q=V;break}}if(!q)q={type:Z,rules:[]},X.push(q);var z={keyword:K,definition:H,custom:!0,code:yn1,implements:H.implements};q.rules.push(z),X.custom[K]=z}return this}function bn1(Q){var J=this.RULES.custom[Q];return J?J.definition:this.RULES.keywords[Q]||!1}function xn1(Q){var J=this.RULES;delete J.keywords[Q],delete J.all[Q],delete J.custom[Q];for(var X=0;X<J.length;X++){var G=J[X].rules;for(var Y=0;Y<G.length;Y++)if(G[Y].keyword==Q){G.splice(Y,1);break}}return this}function jo(Q,J){jo.errors=null;var X=this._validateKeyword=this._validateKeyword||this.compile(hn1,!0);if(X(Q))return!0;if(jo.errors=X.errors,J)throw Error("custom keyword definition is invalid: "+this.errorsText(X.errors));else return!1}});var vE0=I((qN6,gn1)=>{gn1.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Ro=I((FN6,uE0)=>{var _E0=qT0(),DH=SC(),un1=VT0(),yE0=Fo(),mn1=Oo(),ln1=TT0(),dn1=OE0(),hE0=wE0(),fE0=OH();uE0.exports=e8;e8.prototype.validate=cn1;e8.prototype.compile=nn1;e8.prototype.addSchema=in1;e8.prototype.addMetaSchema=rn1;e8.prototype.validateSchema=an1;e8.prototype.getSchema=sn1;e8.prototype.removeSchema=en1;e8.prototype.addFormat=Ki1;e8.prototype.errorsText=$i1;e8.prototype._addSchema=Qi1;e8.prototype._compile=Ji1;e8.prototype.compileAsync=AE0();var gC=SE0();e8.prototype.addKeyword=gC.add;e8.prototype.getKeyword=gC.get;e8.prototype.removeKeyword=gC.remove;e8.prototype.validateKeyword=gC.validate;var bE0=vC();e8.ValidationError=bE0.Validation;e8.MissingRefError=bE0.MissingRef;e8.$dataMetaSchema=hE0;var xC="http://json-schema.org/draft-07/schema",kE0=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],pn1=["/properties"];function e8(Q){if(!(this instanceof e8))return new e8(Q);if(Q=this._opts=fE0.copy(Q)||{},zi1(this),this._schemas={},this._refs={},this._fragments={},this._formats=ln1(Q.format),this._cache=Q.cache||new un1,this._loadingSchemas={},this._compilations=[],this.RULES=dn1(),this._getId=Xi1(Q),Q.loopRequired=Q.loopRequired||1/0,Q.errorDataPath=="property")Q._errorDataPathProperty=!0;if(Q.serialize===void 0)Q.serialize=mn1;if(this._metaOpts=Vi1(this),Q.formats)qi1(this);if(Q.keywords)Fi1(this);if(Zi1(this),typeof Q.meta=="object")this.addMetaSchema(Q.meta);if(Q.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});Hi1(this)}function cn1(Q,J){var X;if(typeof Q=="string"){if(X=this.getSchema(Q),!X)throw Error('no schema with key or ref "'+Q+'"')}else{var G=this._addSchema(Q);X=G.validate||this._compile(G)}var Y=X(J);if(X.$async!==!0)this.errors=X.errors;return Y}function nn1(Q,J){var X=this._addSchema(Q,void 0,J);return X.validate||this._compile(X)}function in1(Q,J,X,G){if(Array.isArray(Q)){for(var Y=0;Y<Q.length;Y++)this.addSchema(Q[Y],void 0,X,G);return this}var W=this._getId(Q);if(W!==void 0&&typeof W!="string")throw Error("schema id must be string");return J=DH.normalizeId(J||W),gE0(this,J),this._schemas[J]=this._addSchema(Q,X,G,!0),this}function rn1(Q,J,X){return this.addSchema(Q,J,X,!0),this}function an1(Q,J){var X=Q.$schema;if(X!==void 0&&typeof X!="string")throw Error("$schema must be a string");if(X=X||this._opts.defaultMeta||on1(this),!X)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var G=this.validate(X,Q);if(!G&&J){var Y="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(Y);else throw Error(Y)}return G}function on1(Q){var J=Q._opts.meta;return Q._opts.defaultMeta=typeof J=="object"?Q._getId(J)||J:Q.getSchema(xC)?xC:void 0,Q._opts.defaultMeta}function sn1(Q){var J=xE0(this,Q);switch(typeof J){case"object":return J.validate||this._compile(J);case"string":return this.getSchema(J);case"undefined":return tn1(this,Q)}}function tn1(Q,J){var X=DH.schema.call(Q,{schema:{}},J);if(X){var{schema:G,root:Y,baseId:W}=X,$=_E0.call(Q,G,Y,void 0,W);return Q._fragments[J]=new yE0({ref:J,fragment:!0,schema:G,root:Y,baseId:W,validate:$}),$}}function xE0(Q,J){return J=DH.normalizeId(J),Q._schemas[J]||Q._refs[J]||Q._fragments[J]}function en1(Q){if(Q instanceof RegExp)return bC(this,this._schemas,Q),bC(this,this._refs,Q),this;switch(typeof Q){case"undefined":return bC(this,this._schemas),bC(this,this._refs),this._cache.clear(),this;case"string":var J=xE0(this,Q);if(J)this._cache.del(J.cacheKey);return delete this._schemas[Q],delete this._refs[Q],this;case"object":var X=this._opts.serialize,G=X?X(Q):Q;this._cache.del(G);var Y=this._getId(Q);if(Y)Y=DH.normalizeId(Y),delete this._schemas[Y],delete this._refs[Y]}return this}function bC(Q,J,X){for(var G in J){var Y=J[G];if(!Y.meta&&(!X||X.test(G)))Q._cache.del(Y.cacheKey),delete J[G]}}function Qi1(Q,J,X,G){if(typeof Q!="object"&&typeof Q!="boolean")throw Error("schema should be object or boolean");var Y=this._opts.serialize,W=Y?Y(Q):Q,$=this._cache.get(W);if($)return $;G=G||this._opts.addUsedSchema!==!1;var K=DH.normalizeId(this._getId(Q));if(K&&G)gE0(this,K);var Z=this._opts.validateSchema!==!1&&!J,H;if(Z&&!(H=K&&K==DH.normalizeId(Q.$schema)))this.validateSchema(Q,!0);var q=DH.ids.call(this,Q),F=new yE0({id:K,schema:Q,localRefs:q,cacheKey:W,meta:X});if(K[0]!="#"&&G)this._refs[K]=F;if(this._cache.put(W,F),Z&&H)this.validateSchema(Q,!0);return F}function Ji1(Q,J){if(Q.compiling){if(Q.validate=Y,Y.schema=Q.schema,Y.errors=null,Y.root=J?J:Y,Q.schema.$async===!0)Y.$async=!0;return Y}Q.compiling=!0;var X;if(Q.meta)X=this._opts,this._opts=this._metaOpts;var G;try{G=_E0.call(this,Q.schema,J,Q.localRefs)}catch(W){throw delete Q.validate,W}finally{if(Q.compiling=!1,Q.meta)this._opts=X}return Q.validate=G,Q.refs=G.refs,Q.refVal=G.refVal,Q.root=G.root,G;function Y(){var W=Q.validate,$=W.apply(this,arguments);return Y.errors=W.errors,$}}function Xi1(Q){switch(Q.schemaId){case"auto":return Wi1;case"id":return Yi1;default:return Gi1}}function Yi1(Q){if(Q.$id)this.logger.warn("schema $id ignored",Q.$id);return Q.id}function Gi1(Q){if(Q.id)this.logger.warn("schema id ignored",Q.id);return Q.$id}function Wi1(Q){if(Q.$id&&Q.id&&Q.$id!=Q.id)throw Error("schema $id is different from id");return Q.$id||Q.id}function $i1(Q,J){if(Q=Q||this.errors,!Q)return"No errors";J=J||{};var X=J.separator===void 0?", ":J.separator,G=J.dataVar===void 0?"data":J.dataVar,Y="";for(var W=0;W<Q.length;W++){var $=Q[W];if($)Y+=G+$.dataPath+" "+$.message+X}return Y.slice(0,-X.length)}function Ki1(Q,J){if(typeof J=="string")J=new RegExp(J);return this._formats[Q]=J,this}function Zi1(Q){var J;if(Q._opts.$data)J=vE0(),Q.addMetaSchema(J,J.$id,!0);if(Q._opts.meta===!1)return;var X=Eo();if(Q._opts.$data)X=hE0(X,pn1);Q.addMetaSchema(X,xC,!0),Q._refs["http://json-schema.org/schema"]=xC}function Hi1(Q){var J=Q._opts.schemas;if(!J)return;if(Array.isArray(J))Q.addSchema(J);else for(var X in J)Q.addSchema(J[X],X)}function qi1(Q){for(var J in Q._opts.formats){var X=Q._opts.formats[J];Q.addFormat(J,X)}}function Fi1(Q){for(var J in Q._opts.keywords){var X=Q._opts.keywords[J];Q.addKeyword(J,X)}}function gE0(Q,J){if(Q._schemas[J]||Q._refs[J])throw Error('schema with key or id "'+J+'" already exists')}function Vi1(Q){var J=fE0.copy(Q._opts);for(var X=0;X<kE0.length;X++)delete J[kE0[X]];return J}function zi1(Q){var J=Q._opts.logger;if(J===!1)Q.logger={log:Io,warn:Io,error:Io};else{if(J===void 0)J=console;if(!(typeof J=="object"&&J.log&&J.warn&&J.error))throw Error("logger must implement log, warn and error methods");Q.logger=J}}function Io(){}});var mE0,TW;var fL=_(()=>{Yo();nJ();mE0=f4(Ro(),1);TW=class TW extends yL{constructor(Q,J){var X;super(J);this._clientInfo=Q,this._cachedToolOutputValidators=new Map,this._capabilities=(X=J===null||J===void 0?void 0:J.capabilities)!==null&&X!==void 0?X:{},this._ajv=new mE0.default}registerCapabilities(Q){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=PC(this._capabilities,Q)}assertCapability(Q,J){var X;if(!((X=this._serverCapabilities)===null||X===void 0?void 0:X[Q]))throw Error(`Server does not support ${Q} (required for ${J})`)}async connect(Q,J){if(await super.connect(Q),Q.sessionId!==void 0)return;try{let X=await this.request({method:"initialize",params:{protocolVersion:RK,capabilities:this._capabilities,clientInfo:this._clientInfo}},la,J);if(X===void 0)throw Error(`Server sent invalid initialize result: ${X}`);if(!NH.includes(X.protocolVersion))throw Error(`Server's protocol version is not supported: ${X.protocolVersion}`);if(this._serverCapabilities=X.capabilities,this._serverVersion=X.serverInfo,Q.setProtocolVersion)Q.setProtocolVersion(X.protocolVersion);this._instructions=X.instructions,await this.notification({method:"notifications/initialized"})}catch(X){throw this.close(),X}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(Q){var J,X,G,Y,W;switch(Q){case"logging/setLevel":if(!((J=this._serverCapabilities)===null||J===void 0?void 0:J.logging))throw Error(`Server does not support logging (required for ${Q})`);break;case"prompts/get":case"prompts/list":if(!((X=this._serverCapabilities)===null||X===void 0?void 0:X.prompts))throw Error(`Server does not support prompts (required for ${Q})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!((G=this._serverCapabilities)===null||G===void 0?void 0:G.resources))throw Error(`Server does not support resources (required for ${Q})`);if(Q==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw Error(`Server does not support resource subscriptions (required for ${Q})`);break;case"tools/call":case"tools/list":if(!((Y=this._serverCapabilities)===null||Y===void 0?void 0:Y.tools))throw Error(`Server does not support tools (required for ${Q})`);break;case"completion/complete":if(!((W=this._serverCapabilities)===null||W===void 0?void 0:W.completions))throw Error(`Server does not support completions (required for ${Q})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(Q){var J;switch(Q){case"notifications/roots/list_changed":if(!((J=this._capabilities.roots)===null||J===void 0?void 0:J.listChanged))throw Error(`Client does not support roots list changed notifications (required for ${Q})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(Q){switch(Q){case"sampling/createMessage":if(!this._capabilities.sampling)throw Error(`Client does not support sampling capability (required for ${Q})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw Error(`Client does not support elicitation capability (required for ${Q})`);break;case"roots/list":if(!this._capabilities.roots)throw Error(`Client does not support roots capability (required for ${Q})`);break;case"ping":break}}async ping(Q){return this.request({method:"ping"},AW,Q)}async complete(Q,J){return this.request({method:"completion/complete",params:Q},Jo,J)}async setLoggingLevel(Q,J){return this.request({method:"logging/setLevel",params:{level:Q}},AW,J)}async getPrompt(Q,J){return this.request({method:"prompts/get",params:Q},sa,J)}async listPrompts(Q,J){return this.request({method:"prompts/list",params:Q},ia,J)}async listResources(Q,J){return this.request({method:"resources/list",params:Q},pa,J)}async listResourceTemplates(Q,J){return this.request({method:"resources/templates/list",params:Q},ca,J)}async readResource(Q,J){return this.request({method:"resources/read",params:Q},na,J)}async subscribeResource(Q,J){return this.request({method:"resources/subscribe",params:Q},AW,J)}async unsubscribeResource(Q,J){return this.request({method:"resources/unsubscribe",params:Q},AW,J)}async callTool(Q,J=LC,X){let G=await this.request({method:"tools/call",params:Q},J,X),Y=this.getToolOutputValidator(Q.name);if(Y){if(!G.structuredContent&&!G.isError)throw new _6(k6.InvalidRequest,`Tool ${Q.name} has an output schema but did not return structured content`);if(G.structuredContent)try{if(!Y(G.structuredContent))throw new _6(k6.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(Y.errors)}`)}catch(W){if(W instanceof _6)throw W;throw new _6(k6.InvalidParams,`Failed to validate structured content: ${W instanceof Error?W.message:String(W)}`)}}return G}cacheToolOutputSchemas(Q){this._cachedToolOutputValidators.clear();for(let J of Q)if(J.outputSchema)try{let X=this._ajv.compile(J.outputSchema);this._cachedToolOutputValidators.set(J.name,X)}catch(X){}}getToolOutputValidator(Q){return this._cachedToolOutputValidators.get(Q)}async listTools(Q,J){let X=await this.request({method:"tools/list",params:Q},kL,J);return this.cacheToolOutputSchemas(X.tools),X}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}});async function Ui1(Q){return(await Co).getRandomValues(new Uint8Array(Q))}async function Ni1(Q){let X=Math.pow(2,8)-Math.pow(2,8)%66,G="";while(G.length<Q){let Y=await Ui1(Q-G.length);for(let W of Y)if(W<X)G+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~"[W%66]}return G}async function Bi1(Q){return await Ni1(Q)}async function Oi1(Q){let J=await(await Co).subtle.digest("SHA-256",new TextEncoder().encode(Q));return btoa(String.fromCharCode(...new Uint8Array(J))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function So(Q){if(!Q)Q=43;if(Q<43||Q>128)throw`Expected a length between 43 and 128. Received ${Q}.`;let J=await Bi1(Q),X=await Oi1(J);return{code_verifier:J,code_challenge:X}}var Co;var lE0=_(()=>{Co=globalThis.crypto?.webcrypto??globalThis.crypto??import("crypto").then((Q)=>Q.webcrypto)});var R5,pE0,vo,Di1,cE0,ko,nE0,dE0,Li1,wi1,iE0,ON6,DN6;var _o=_(()=>{M4();R5=L.string().url().superRefine((Q,J)=>{if(!URL.canParse(Q))return J.addIssue({code:L.ZodIssueCode.custom,message:"URL must be parseable",fatal:!0}),L.NEVER}).refine((Q)=>{let J=new URL(Q);return J.protocol!=="javascript:"&&J.protocol!=="data:"&&J.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),pE0=L.object({resource:L.string().url(),authorization_servers:L.array(R5).optional(),jwks_uri:L.string().url().optional(),scopes_supported:L.array(L.string()).optional(),bearer_methods_supported:L.array(L.string()).optional(),resource_signing_alg_values_supported:L.array(L.string()).optional(),resource_name:L.string().optional(),resource_documentation:L.string().optional(),resource_policy_uri:L.string().url().optional(),resource_tos_uri:L.string().url().optional(),tls_client_certificate_bound_access_tokens:L.boolean().optional(),authorization_details_types_supported:L.array(L.string()).optional(),dpop_signing_alg_values_supported:L.array(L.string()).optional(),dpop_bound_access_tokens_required:L.boolean().optional()}).passthrough(),vo=L.object({issuer:L.string(),authorization_endpoint:R5,token_endpoint:R5,registration_endpoint:R5.optional(),scopes_supported:L.array(L.string()).optional(),response_types_supported:L.array(L.string()),response_modes_supported:L.array(L.string()).optional(),grant_types_supported:L.array(L.string()).optional(),token_endpoint_auth_methods_supported:L.array(L.string()).optional(),token_endpoint_auth_signing_alg_values_supported:L.array(L.string()).optional(),service_documentation:R5.optional(),revocation_endpoint:R5.optional(),revocation_endpoint_auth_methods_supported:L.array(L.string()).optional(),revocation_endpoint_auth_signing_alg_values_supported:L.array(L.string()).optional(),introspection_endpoint:L.string().optional(),introspection_endpoint_auth_methods_supported:L.array(L.string()).optional(),introspection_endpoint_auth_signing_alg_values_supported:L.array(L.string()).optional(),code_challenge_methods_supported:L.array(L.string()).optional()}).passthrough(),Di1=L.object({issuer:L.string(),authorization_endpoint:R5,token_endpoint:R5,userinfo_endpoint:R5.optional(),jwks_uri:R5,registration_endpoint:R5.optional(),scopes_supported:L.array(L.string()).optional(),response_types_supported:L.array(L.string()),response_modes_supported:L.array(L.string()).optional(),grant_types_supported:L.array(L.string()).optional(),acr_values_supported:L.array(L.string()).optional(),subject_types_supported:L.array(L.string()),id_token_signing_alg_values_supported:L.array(L.string()),id_token_encryption_alg_values_supported:L.array(L.string()).optional(),id_token_encryption_enc_values_supported:L.array(L.string()).optional(),userinfo_signing_alg_values_supported:L.array(L.string()).optional(),userinfo_encryption_alg_values_supported:L.array(L.string()).optional(),userinfo_encryption_enc_values_supported:L.array(L.string()).optional(),request_object_signing_alg_values_supported:L.array(L.string()).optional(),request_object_encryption_alg_values_supported:L.array(L.string()).optional(),request_object_encryption_enc_values_supported:L.array(L.string()).optional(),token_endpoint_auth_methods_supported:L.array(L.string()).optional(),token_endpoint_auth_signing_alg_values_supported:L.array(L.string()).optional(),display_values_supported:L.array(L.string()).optional(),claim_types_supported:L.array(L.string()).optional(),claims_supported:L.array(L.string()).optional(),service_documentation:L.string().optional(),claims_locales_supported:L.array(L.string()).optional(),ui_locales_supported:L.array(L.string()).optional(),claims_parameter_supported:L.boolean().optional(),request_parameter_supported:L.boolean().optional(),request_uri_parameter_supported:L.boolean().optional(),require_request_uri_registration:L.boolean().optional(),op_policy_uri:R5.optional(),op_tos_uri:R5.optional()}).passthrough(),cE0=Di1.merge(vo.pick({code_challenge_methods_supported:!0})),ko=L.object({access_token:L.string(),id_token:L.string().optional(),token_type:L.string(),expires_in:L.number().optional(),scope:L.string().optional(),refresh_token:L.string().optional()}).strip(),nE0=L.object({error:L.string(),error_description:L.string().optional(),error_uri:L.string().optional()}),dE0=R5.optional().or(L.literal("").transform(()=>{return})),Li1=L.object({redirect_uris:L.array(R5),token_endpoint_auth_method:L.string().optional(),grant_types:L.array(L.string()).optional(),response_types:L.array(L.string()).optional(),client_name:L.string().optional(),client_uri:R5.optional(),logo_uri:dE0,scope:L.string().optional(),contacts:L.array(L.string()).optional(),tos_uri:dE0,policy_uri:L.string().optional(),jwks_uri:R5.optional(),jwks:L.any().optional(),software_id:L.string().optional(),software_version:L.string().optional(),software_statement:L.string().optional()}).strip(),wi1=L.object({client_id:L.string(),client_secret:L.string().optional(),client_id_issued_at:L.number().optional(),client_secret_expires_at:L.number().optional()}).strip(),iE0=Li1.merge(wi1),ON6=L.object({error:L.string(),error_description:L.string().optional()}).strip(),DN6=L.object({token:L.string(),token_type_hint:L.string().optional()}).strip()});function rE0(Q){let J=typeof Q==="string"?new URL(Q):new URL(Q.href);return J.hash="",J}function aE0({requestedResource:Q,configuredResource:J}){let X=typeof Q==="string"?new URL(Q):new URL(Q.href),G=typeof J==="string"?new URL(J):new URL(J.href);if(X.origin!==G.origin)return!1;if(X.pathname.length<G.pathname.length)return!1;let Y=X.pathname.endsWith("/")?X.pathname:X.pathname+"/",W=G.pathname.endsWith("/")?G.pathname:G.pathname+"/";return Y.startsWith(W)}var y9,uC,jz,Iz,Rz,mC,lC,dC,yK,pC,cC,nC,iC,rC,aC,oC,sC,oE0;var sE0=_(()=>{y9=class y9 extends Error{constructor(Q,J){super(Q);this.errorUri=J,this.name=this.constructor.name}toResponseObject(){let Q={error:this.errorCode,error_description:this.message};if(this.errorUri)Q.error_uri=this.errorUri;return Q}get errorCode(){return this.constructor.errorCode}};uC=class uC extends y9{};uC.errorCode="invalid_request";jz=class jz extends y9{};jz.errorCode="invalid_client";Iz=class Iz extends y9{};Iz.errorCode="invalid_grant";Rz=class Rz extends y9{};Rz.errorCode="unauthorized_client";mC=class mC extends y9{};mC.errorCode="unsupported_grant_type";lC=class lC extends y9{};lC.errorCode="invalid_scope";dC=class dC extends y9{};dC.errorCode="access_denied";yK=class yK extends y9{};yK.errorCode="server_error";pC=class pC extends y9{};pC.errorCode="temporarily_unavailable";cC=class cC extends y9{};cC.errorCode="unsupported_response_type";nC=class nC extends y9{};nC.errorCode="unsupported_token_type";iC=class iC extends y9{};iC.errorCode="invalid_token";rC=class rC extends y9{};rC.errorCode="method_not_allowed";aC=class aC extends y9{};aC.errorCode="too_many_requests";oC=class oC extends y9{};oC.errorCode="invalid_client_metadata";sC=class sC extends y9{};sC.errorCode="insufficient_scope";oE0={[uC.errorCode]:uC,[jz.errorCode]:jz,[Iz.errorCode]:Iz,[Rz.errorCode]:Rz,[mC.errorCode]:mC,[lC.errorCode]:lC,[dC.errorCode]:dC,[yK.errorCode]:yK,[pC.errorCode]:pC,[cC.errorCode]:cC,[nC.errorCode]:nC,[iC.errorCode]:iC,[rC.errorCode]:rC,[aC.errorCode]:aC,[oC.errorCode]:oC,[sC.errorCode]:sC}});function eE0(Q,J){let X=Q.client_secret!==void 0;if(J.length===0)return X?"client_secret_post":"none";if(X&&J.includes("client_secret_basic"))return"client_secret_basic";if(X&&J.includes("client_secret_post"))return"client_secret_post";if(J.includes("none"))return"none";return X?"client_secret_post":"none"}function Qj0(Q,J,X,G){let{client_id:Y,client_secret:W}=J;switch(Q){case"client_secret_basic":Pi1(Y,W,X);return;case"client_secret_post":Mi1(Y,W,G);return;case"none":Ai1(Y,G);return;default:throw Error(`Unsupported client authentication method: ${Q}`)}}function Pi1(Q,J,X){if(!J)throw Error("client_secret_basic authentication requires a client_secret");let G=btoa(`${Q}:${J}`);X.set("Authorization",`Basic ${G}`)}function Mi1(Q,J,X){if(X.set("client_id",Q),J)X.set("client_secret",J)}function Ai1(Q,J){J.set("client_id",Q)}async function bo(Q){let J=Q instanceof Response?Q.status:void 0,X=Q instanceof Response?await Q.text():Q;try{let G=nE0.parse(JSON.parse(X)),{error:Y,error_description:W,error_uri:$}=G;return new(oE0[Y]||yK)(W||"",$)}catch(G){let Y=`${J?`HTTP ${J}: `:""}Invalid OAuth error response: ${G}. Raw body: ${X}`;return new yK(Y)}}async function hK(Q,J){var X,G;try{return await fo(Q,J)}catch(Y){if(Y instanceof jz||Y instanceof Rz)return await((X=Q.invalidateCredentials)===null||X===void 0?void 0:X.call(Q,"all")),await fo(Q,J);else if(Y instanceof Iz)return await((G=Q.invalidateCredentials)===null||G===void 0?void 0:G.call(Q,"tokens")),await fo(Q,J);throw Y}}async function fo(Q,{serverUrl:J,authorizationCode:X,scope:G,resourceMetadataUrl:Y,fetchFn:W}){let $,K;try{if($=await Ei1(J,{resourceMetadataUrl:Y},W),$.authorization_servers&&$.authorization_servers.length>0)K=$.authorization_servers[0]}catch(B){}if(!K)K=J;let Z=await Ti1(J,Q,$),H=await Si1(K,{fetchFn:W}),q=await Promise.resolve(Q.clientInformation());if(!q){if(X!==void 0)throw Error("Existing OAuth client information is required when exchanging an authorization code");if(!Q.saveClientInformation)throw Error("OAuth client information must be saveable for dynamic registration");let B=await yi1(K,{metadata:H,clientMetadata:Q.clientMetadata,fetchFn:W});await Q.saveClientInformation(B),q=B}if(X!==void 0){let B=await Q.codeVerifier(),D=await ki1(K,{metadata:H,clientInformation:q,authorizationCode:X,codeVerifier:B,redirectUri:Q.redirectUrl,resource:Z,addClientAuthentication:Q.addClientAuthentication,fetchFn:W});return await Q.saveTokens(D),"AUTHORIZED"}let F=await Q.tokens();if(F===null||F===void 0?void 0:F.refresh_token)try{let B=await _i1(K,{metadata:H,clientInformation:q,refreshToken:F.refresh_token,resource:Z,addClientAuthentication:Q.addClientAuthentication,fetchFn:W});return await Q.saveTokens(B),"AUTHORIZED"}catch(B){if(!(B instanceof y9)||B instanceof yK);else throw B}let V=Q.state?await Q.state():void 0,{authorizationUrl:z,codeVerifier:U}=await vi1(K,{metadata:H,clientInformation:q,state:V,redirectUrl:Q.redirectUrl,scope:G||Q.clientMetadata.scope,resource:Z});return await Q.saveCodeVerifier(U),await Q.redirectToAuthorization(z),"REDIRECT"}async function Ti1(Q,J,X){let G=rE0(Q);if(J.validateResourceURL)return await J.validateResourceURL(G,X===null||X===void 0?void 0:X.resource);if(!X)return;if(!aE0({requestedResource:G,configuredResource:X.resource}))throw Error(`Protected resource ${X.resource} does not match expected ${G} (or origin)`);return new URL(X.resource)}function bL(Q){let J=Q.headers.get("WWW-Authenticate");if(!J)return;let[X,G]=J.split(" ");if(X.toLowerCase()!=="bearer"||!G)return;let W=/resource_metadata="([^"]*)"/.exec(J);if(!W)return;try{return new URL(W[1])}catch($){return}}async function Ei1(Q,J,X=fetch){let G=await Ri1(Q,"oauth-protected-resource",X,{protocolVersion:J===null||J===void 0?void 0:J.protocolVersion,metadataUrl:J===null||J===void 0?void 0:J.resourceMetadataUrl});if(!G||G.status===404)throw Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!G.ok)throw Error(`HTTP ${G.status} trying to load well-known OAuth protected resource metadata.`);return pE0.parse(await G.json())}async function xo(Q,J,X=fetch){try{return await X(Q,{headers:J})}catch(G){if(G instanceof TypeError)if(J)return xo(Q,void 0,X);else return;throw G}}function ji1(Q,J="",X={}){if(J.endsWith("/"))J=J.slice(0,-1);return X.prependPathname?`${J}/.well-known/${Q}`:`/.well-known/${Q}${J}`}async function tE0(Q,J,X=fetch){return await xo(Q,{"MCP-Protocol-Version":J},X)}function Ii1(Q,J){return!Q||Q.status>=400&&Q.status<500&&J!=="/"}async function Ri1(Q,J,X,G){var Y,W;let $=new URL(Q),K=(Y=G===null||G===void 0?void 0:G.protocolVersion)!==null&&Y!==void 0?Y:RK,Z;if(G===null||G===void 0?void 0:G.metadataUrl)Z=new URL(G.metadataUrl);else{let q=ji1(J,$.pathname);Z=new URL(q,(W=G===null||G===void 0?void 0:G.metadataServerUrl)!==null&&W!==void 0?W:$),Z.search=$.search}let H=await tE0(Z,K,X);if(!(G===null||G===void 0?void 0:G.metadataUrl)&&Ii1(H,$.pathname)){let q=new URL(`/.well-known/${J}`,$);H=await tE0(q,K,X)}return H}function Ci1(Q){let J=typeof Q==="string"?new URL(Q):Q,X=J.pathname!=="/",G=[];if(!X)return G.push({url:new URL("/.well-known/oauth-authorization-server",J.origin),type:"oauth"}),G.push({url:new URL("/.well-known/openid-configuration",J.origin),type:"oidc"}),G;let Y=J.pathname;if(Y.endsWith("/"))Y=Y.slice(0,-1);return G.push({url:new URL(`/.well-known/oauth-authorization-server${Y}`,J.origin),type:"oauth"}),G.push({url:new URL("/.well-known/oauth-authorization-server",J.origin),type:"oauth"}),G.push({url:new URL(`/.well-known/openid-configuration${Y}`,J.origin),type:"oidc"}),G.push({url:new URL(`${Y}/.well-known/openid-configuration`,J.origin),type:"oidc"}),G}async function Si1(Q,{fetchFn:J=fetch,protocolVersion:X=RK}={}){let G={"MCP-Protocol-Version":X,Accept:"application/json"},Y=Ci1(Q);for(let{url:W,type:$}of Y){let K=await xo(W,G,J);if(!K)continue;if(!K.ok){if(K.status>=400&&K.status<500)continue;throw Error(`HTTP ${K.status} trying to load ${$==="oauth"?"OAuth":"OpenID provider"} metadata from ${W}`)}if($==="oauth")return vo.parse(await K.json());else return cE0.parse(await K.json())}return}async function vi1(Q,{metadata:J,clientInformation:X,redirectUrl:G,scope:Y,state:W,resource:$}){let K;if(J){if(K=new URL(J.authorization_endpoint),!J.response_types_supported.includes(yo))throw Error(`Incompatible auth server: does not support response type ${yo}`);if(J.code_challenge_methods_supported&&!J.code_challenge_methods_supported.includes(ho))throw Error(`Incompatible auth server: does not support code challenge method ${ho}`)}else K=new URL("/authorize",Q);let Z=await So(),H=Z.code_verifier,q=Z.code_challenge;if(K.searchParams.set("response_type",yo),K.searchParams.set("client_id",X.client_id),K.searchParams.set("code_challenge",q),K.searchParams.set("code_challenge_method",ho),K.searchParams.set("redirect_uri",String(G)),W)K.searchParams.set("state",W);if(Y)K.searchParams.set("scope",Y);if(Y===null||Y===void 0?void 0:Y.includes("offline_access"))K.searchParams.append("prompt","consent");if($)K.searchParams.set("resource",$.href);return{authorizationUrl:K,codeVerifier:H}}async function ki1(Q,{metadata:J,clientInformation:X,authorizationCode:G,codeVerifier:Y,redirectUri:W,resource:$,addClientAuthentication:K,fetchFn:Z}){var H;let q="authorization_code",F=(J===null||J===void 0?void 0:J.token_endpoint)?new URL(J.token_endpoint):new URL("/token",Q);if((J===null||J===void 0?void 0:J.grant_types_supported)&&!J.grant_types_supported.includes("authorization_code"))throw Error("Incompatible auth server: does not support grant type authorization_code");let V=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),z=new URLSearchParams({grant_type:"authorization_code",code:G,code_verifier:Y,redirect_uri:String(W)});if(K)K(V,z,Q,J);else{let B=(H=J===null||J===void 0?void 0:J.token_endpoint_auth_methods_supported)!==null&&H!==void 0?H:[],D=eE0(X,B);Qj0(D,X,V,z)}if($)z.set("resource",$.href);let U=await(Z!==null&&Z!==void 0?Z:fetch)(F,{method:"POST",headers:V,body:z});if(!U.ok)throw await bo(U);return ko.parse(await U.json())}async function _i1(Q,{metadata:J,clientInformation:X,refreshToken:G,resource:Y,addClientAuthentication:W,fetchFn:$}){var K;let Z="refresh_token",H;if(J){if(H=new URL(J.token_endpoint),J.grant_types_supported&&!J.grant_types_supported.includes("refresh_token"))throw Error("Incompatible auth server: does not support grant type refresh_token")}else H=new URL("/token",Q);let q=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),F=new URLSearchParams({grant_type:"refresh_token",refresh_token:G});if(W)W(q,F,Q,J);else{let z=(K=J===null||J===void 0?void 0:J.token_endpoint_auth_methods_supported)!==null&&K!==void 0?K:[],U=eE0(X,z);Qj0(U,X,q,F)}if(Y)F.set("resource",Y.href);let V=await($!==null&&$!==void 0?$:fetch)(H,{method:"POST",headers:q,body:F});if(!V.ok)throw await bo(V);return ko.parse({refresh_token:G,...await V.json()})}async function yi1(Q,{metadata:J,clientMetadata:X,fetchFn:G}){let Y;if(J){if(!J.registration_endpoint)throw Error("Incompatible auth server: does not support dynamic client registration");Y=new URL(J.registration_endpoint)}else Y=new URL("/register",Q);let W=await(G!==null&&G!==void 0?G:fetch)(Y,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)});if(!W.ok)throw await bo(W);return iE0.parse(await W.json())}var iJ,yo="code",ho="S256";var go=_(()=>{lE0();nJ();_o();_o();sE0();iJ=class iJ extends Error{constructor(Q){super(Q!==null&&Q!==void 0?Q:"Unauthorized")}}});function uo(Q){}function tC(Q){if(typeof Q=="function")throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:J=uo,onError:X=uo,onRetry:G=uo,onComment:Y}=Q,W="",$=!0,K,Z="",H="";function q(B){let D=$?B.replace(/^\xEF\xBB\xBF/,""):B,[w,A]=hi1(`${W}${D}`);for(let E of w)F(E);W=A,$=!1}function F(B){if(B===""){z();return}if(B.startsWith(":")){Y&&Y(B.slice(B.startsWith(": ")?2:1));return}let D=B.indexOf(":");if(D!==-1){let w=B.slice(0,D),A=B[D+1]===" "?2:1,E=B.slice(D+A);V(w,E,B);return}V(B,"",B)}function V(B,D,w){switch(B){case"event":H=D;break;case"data":Z=`${Z}${D}
943
943
  `;break;case"id":K=D.includes("\x00")?void 0:D;break;case"retry":/^\d+$/.test(D)?G(parseInt(D,10)):X(new mo(`Invalid \`retry\` value: "${D}"`,{type:"invalid-retry",value:D,line:w}));break;default:X(new mo(`Unknown field "${B.length>20?`${B.slice(0,20)}\u2026`:B}"`,{type:"unknown-field",field:B,value:D,line:w}));break}}function z(){Z.length>0&&J({id:K,event:H||void 0,data:Z.endsWith(`
944
944
  `)?Z.slice(0,-1):Z}),K=void 0,Z="",H=""}function U(B={}){W&&B.consume&&F(W),$=!0,K=void 0,Z="",H="",W=""}return{feed:q,reset:U}}function hi1(Q){let J=[],X="",G=0;for(;G<Q.length;){let Y=Q.indexOf("\r",G),W=Q.indexOf(`
@@ -1180,6 +1180,8 @@ Environment Variables:
1180
1180
  NODE_ENV Set to 'production' for production mode
1181
1181
  BETTER_AUTH_SECRET Secret for authentication (auto-generated if not set)
1182
1182
  ENCRYPTION_KEY Key for encrypting secrets (auto-generated if not set)
1183
+ AUTH_CONFIG_PATH Path to auth config file (default: ./auth-config.json)
1184
+ CONFIG_PATH Path to full config file (default: ./config.json)
1183
1185
 
1184
1186
  Examples:
1185
1187
  bunx @decocms/mesh # Start on port 3000