@stacksjs/whois 0.70.23 → 0.70.25
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.
- package/dist/index.js +6 -208
- package/dist/src/constants.d.ts +323 -0
- package/dist/src/index.d.ts +76 -0
- package/dist/src/socks.d.ts +33 -0
- package/dist/{types.d.ts → src/types.d.ts} +29 -6
- package/package.json +11 -6
- package/dist/constants.d.ts +0 -3
- package/dist/index.d.ts +0 -71
- package/dist/utils.d.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -1,209 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var bE=Object.create;var{getPrototypeOf:mE,defineProperty:P8,getOwnPropertyNames:vE}=Object;var cE=Object.prototype.hasOwnProperty;var t=(D,u,F)=>{F=D!=null?bE(mE(D)):{};let C=u||!D||!D.__esModule?P8(F,"default",{value:D,enumerable:!0}):F;for(let $ of vE(D))if(!cE.call(C,$))P8(C,$,{get:()=>D[$],enumerable:!0});return C};var h=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var xE=(D,u)=>{for(var F in u)P8(D,F,{get:u[F],enumerable:!0,configurable:!0,set:(C)=>u[F]=()=>C})};var nE=(D,u)=>()=>(D&&(u=D(D=0)),u);var FD=import.meta.require;var wD=h((z1,r8)=>{Object.defineProperty(z1,"__esModule",{value:!0});z1.default=zw;function l8(D){return l8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},l8(D)}function zw(D){var u=typeof D==="string"||D instanceof String;if(!u){var F=l8(D);if(D===null)F="null";else if(F==="object")F=D.constructor.name;throw new TypeError("Expected a string but received a ".concat(F))}}r8.exports=z1.default;r8.exports.default=z1.default});var Q1=h((A1,a8)=>{Object.defineProperty(A1,"__esModule",{value:!0});A1.default=p8;var Qw=Hw(wD());function Hw(D){return D&&D.__esModule?D:{default:D}}var XF="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",gu="(".concat(XF,"[.]){3}").concat(XF),Uw=new RegExp("^".concat(gu,"$")),JD="(?:[0-9a-fA-F]{1,4})",yw=new RegExp("^("+"(?:".concat(JD,":){7}(?:").concat(JD,"|:)|")+"(?:".concat(JD,":){6}(?:").concat(gu,"|:").concat(JD,"|:)|")+"(?:".concat(JD,":){5}(?::").concat(gu,"|(:").concat(JD,"){1,2}|:)|")+"(?:".concat(JD,":){4}(?:(:").concat(JD,"){0,1}:").concat(gu,"|(:").concat(JD,"){1,3}|:)|")+"(?:".concat(JD,":){3}(?:(:").concat(JD,"){0,2}:").concat(gu,"|(:").concat(JD,"){1,4}|:)|")+"(?:".concat(JD,":){2}(?:(:").concat(JD,"){0,3}:").concat(gu,"|(:").concat(JD,"){1,5}|:)|")+"(?:".concat(JD,":){1}(?:(:").concat(JD,"){0,4}:").concat(gu,"|(:").concat(JD,"){1,6}|:)|")+"(?::((?::".concat(JD,"){0,5}:").concat(gu,"|(?::").concat(JD,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function p8(D){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(Qw.default(D),u=String(u),!u)return p8(D,4)||p8(D,6);if(u==="4")return Uw.test(D);if(u==="6")return yw.test(D);return!1}a8.exports=A1.default;a8.exports.default=A1.default});var bu=h((H1,t8)=>{Object.defineProperty(H1,"__esModule",{value:!0});H1.default=Tw;function Tw(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=arguments.length>1?arguments[1]:void 0;for(var F in u)if(typeof D[F]==="undefined")D[F]=u[F];return D}t8.exports=H1.default;t8.exports.default=H1.default});var GF=h((U1,o8)=>{Object.defineProperty(U1,"__esModule",{value:!0});U1.default=Pw;var Lw=WF(wD()),Nw=WF(bu());function WF(D){return D&&D.__esModule?D:{default:D}}var hw=/[^A-Z0-9+\/=]/i,Iw=/^[A-Z0-9_\-]*$/i,Rw={urlSafe:!1};function Pw(D,u){Lw.default(D),u=Nw.default(u,Rw);var F=D.length;if(u.urlSafe)return Iw.test(D);if(F%4!==0||hw.test(D))return!1;var C=D.indexOf("=");return C===-1||C===F-1||C===F-2&&D[F-1]==="="}o8.exports=U1.default;o8.exports.default=U1.default});var AF=h((y1,s8)=>{Object.defineProperty(y1,"__esModule",{value:!0});y1.default=_w;var kw=zF(wD()),Sw=zF(GF());function zF(D){return D&&D.__esModule?D:{default:D}}function _w(D){kw.default(D);var u=D.split("."),F=u.length;if(F!==3)return!1;return u.reduce(function(C,$){return C&&Sw.default($,{urlSafe:!0})},!0)}s8.exports=y1.default;s8.exports.default=y1.default});var D2=h((O1,e8)=>{Object.defineProperty(O1,"__esModule",{value:!0});O1.default=cw;var bw=QF(wD()),mw=QF(bu());function QF(D){return D&&D.__esModule?D:{default:D}}var vw={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function cw(D,u){if(bw.default(D),u=mw.default(u,vw),u.allow_trailing_dot&&D[D.length-1]===".")D=D.substring(0,D.length-1);if(u.allow_wildcard===!0&&D.indexOf("*.")===0)D=D.substring(2);var F=D.split("."),C=F[F.length-1];if(u.require_tld){if(F.length<2)return!1;if(!u.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(C))return!1;if(/\s/.test(C))return!1}if(!u.allow_numeric_tld&&/^\d+$/.test(C))return!1;return F.every(function($){if($.length>63&&!u.ignore_max_length)return!1;if(!/^[a-z_\u00a1-\uffff0-9-]+$/i.test($))return!1;if(/[\uff01-\uff5e]/.test($))return!1;if(/^-|-$/.test($))return!1;if(!u.allow_underscores&&/_/.test($))return!1;return!0})}e8.exports=O1.default;e8.exports.default=O1.default});var OF=h((V1,u2)=>{Object.defineProperty(V1,"__esModule",{value:!0});V1.default=ew;var nw=T1(wD()),fw=T1(D2()),HF=T1(Q1()),dw=T1(bu());function T1(D){return D&&D.__esModule?D:{default:D}}function iw(D,u){return aw(D)||pw(D,u)||rw(D,u)||lw()}function lw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rw(D,u){if(!D)return;if(typeof D==="string")return UF(D,u);var F=Object.prototype.toString.call(D).slice(8,-1);if(F==="Object"&&D.constructor)F=D.constructor.name;if(F==="Map"||F==="Set")return Array.from(D);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return UF(D,u)}function UF(D,u){if(u==null||u>D.length)u=D.length;for(var F=0,C=new Array(u);F<u;F++)C[F]=D[F];return C}function pw(D,u){var F=D==null?null:typeof Symbol!="undefined"&&D[Symbol.iterator]||D["@@iterator"];if(F!=null){var C,$,w,E,Y=[],q=!0,W=!1;try{if(w=(F=F.call(D)).next,u===0){if(Object(F)!==F)return;q=!1}else for(;!(q=(C=w.call(F)).done)&&(Y.push(C.value),Y.length!==u);q=!0);}catch(Z){W=!0,$=Z}finally{try{if(!q&&F.return!=null&&(E=F.return(),Object(E)!==E))return}finally{if(W)throw $}}return Y}}function aw(D){if(Array.isArray(D))return D}var tw={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},ow=/^\[([^\]]+)\](?::([0-9]+))?$/;function sw(D){return Object.prototype.toString.call(D)==="[object RegExp]"}function yF(D,u){for(var F=0;F<u.length;F++){var C=u[F];if(D===C||sw(C)&&C.test(D))return!0}return!1}function ew(D,u){if(nw.default(D),!D||/[\s<>]/.test(D))return!1;if(D.indexOf("mailto:")===0)return!1;if(u=dw.default(u,tw),u.validate_length&&D.length>=2083)return!1;if(!u.allow_fragments&&D.includes("#"))return!1;if(!u.allow_query_components&&(D.includes("?")||D.includes("&")))return!1;var F,C,$,w,E,Y,q,W;if(q=D.split("#"),D=q.shift(),q=D.split("?"),D=q.shift(),q=D.split("://"),q.length>1){if(F=q.shift().toLowerCase(),u.require_valid_protocol&&u.protocols.indexOf(F)===-1)return!1}else if(u.require_protocol)return!1;else if(D.slice(0,2)==="//"){if(!u.allow_protocol_relative_urls)return!1;q[0]=D.slice(2)}if(D=q.join("://"),D==="")return!1;if(q=D.split("/"),D=q.shift(),D===""&&!u.require_host)return!0;if(q=D.split("@"),q.length>1){if(u.disallow_auth)return!1;if(q[0]==="")return!1;if(C=q.shift(),C.indexOf(":")>=0&&C.split(":").length>2)return!1;var Z=C.split(":"),G=iw(Z,2),A=G[0],z=G[1];if(A===""&&z==="")return!1}w=q.join("@"),Y=null,W=null;var X=w.match(ow);if(X)$="",W=X[1],Y=X[2]||null;else if(q=w.split(":"),$=q.shift(),q.length)Y=q.join(":");if(Y!==null&&Y.length>0){if(E=parseInt(Y,10),!/^[0-9]+$/.test(Y)||E<=0||E>65535)return!1}else if(u.require_port)return!1;if(u.host_whitelist)return yF($,u.host_whitelist);if($===""&&!u.require_host)return!0;if(!HF.default($)&&!fw.default($,u)&&(!W||!HF.default(W,6)))return!1;if($=$||W,u.host_blacklist&&yF($,u.host_blacklist))return!1;return!0}u2.exports=V1.default;u2.exports.default=V1.default});var TF=h((L1,F2)=>{Object.defineProperty(L1,"__esModule",{value:!0});L1.default=$B;var uB=FB(wD());function FB(D){return D&&D.__esModule?D:{default:D}}var CB=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;function $B(D){return uB.default(D),CB.test(D)}F2.exports=L1.default;F2.exports.default=L1.default});var NF=h((VF)=>{Object.defineProperty(VF,"__esModule",{value:!0});VF.default=qB;VF.locales=void 0;var wB=BB(wD());function BB(D){return D&&D.__esModule?D:{default:D}}var N1={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,DZ:/^(DZ\d{24})$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MA:/^(MA[0-9]{26})$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};function MB(D){var u=D.filter(function(F){return!(F in N1)});if(u.length>0)return!1;return!0}function YB(D,u){var F=D.replace(/[\s\-]+/gi,"").toUpperCase(),C=F.slice(0,2).toUpperCase(),$=C in N1;if(u.whitelist){if(!MB(u.whitelist))return!1;var w=u.whitelist.includes(C);if(!w)return!1}if(u.blacklist){var E=u.blacklist.includes(C);if(E)return!1}return $&&N1[C].test(F)}function JB(D){var u=D.replace(/[^A-Z0-9]+/gi,"").toUpperCase(),F=u.slice(4)+u.slice(0,4),C=F.replace(/[A-Z]/g,function(w){return w.charCodeAt(0)-55}),$=C.match(/\d{1,7}/g).reduce(function(w,E){return Number(w+E)%97},"");return $===1}function qB(D){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wB.default(D),YB(D,u)&&JB(D)}var OQ=VF.locales=Object.keys(N1)});var hF=h((h1,C2)=>{Object.defineProperty(h1,"__esModule",{value:!0});h1.default=GB;var KB=XB(wD());function XB(D){return D&&D.__esModule?D:{default:D}}var WB={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,7:/^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};function GB(D,u){KB.default(D);var F=WB[![void 0,null].includes(u)?u:"all"];return!!F&&F.test(D)}C2.exports=h1.default;C2.exports.default=h1.default});var IF=h((I1,$2)=>{Object.defineProperty(I1,"__esModule",{value:!0});I1.default=UB;var AB=QB(wD());function QB(D){return D&&D.__esModule?D:{default:D}}var HB=/^[\x00-\x7F]+$/;function UB(D){return AB.default(D),HB.test(D)}$2.exports=I1.default;$2.exports.default=I1.default});var RF=h((R1,w2)=>{Object.defineProperty(R1,"__esModule",{value:!0});R1.default=VB;var OB=TB(wD());function TB(D){return D&&D.__esModule?D:{default:D}}function E2(D){return E2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},E2(D)}function VB(D,u){OB.default(D);var F,C;if(E2(u)==="object")F=u.min||0,C=u.max;else F=arguments[1],C=arguments[2];var $=encodeURI(D).split(/%..|./).length-1;return $>=F&&(typeof C==="undefined"||$<=C)}w2.exports=R1.default;w2.exports.default=R1.default});var jF=h((P1,M2)=>{Object.defineProperty(P1,"__esModule",{value:!0});P1.default=vB;var NB=S0(wD()),B2=S0(RF()),hB=S0(D2()),PF=S0(Q1()),IB=S0(bu());function S0(D){return D&&D.__esModule?D:{default:D}}var RB={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},PB=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,jB=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,kB=/^[a-z\d]+$/,SB=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,_B=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,gB=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,bB=254;function mB(D){var u=D.replace(/^"(.+)"$/,"$1");if(!u.trim())return!1;var F=/[\.";<>]/.test(u);if(F){if(u===D)return!1;var C=u.split('"').length===u.split("\\\"").length;if(!C)return!1}return!0}function vB(D,u){if(NB.default(D),u=IB.default(u,RB),u.require_display_name||u.allow_display_name){var F=D.match(PB);if(F){var C=F[1];if(D=D.replace(C,"").replace(/(^<|>$)/g,""),C.endsWith(" "))C=C.slice(0,-1);if(!mB(C))return!1}else if(u.require_display_name)return!1}if(!u.ignore_max_length&&D.length>bB)return!1;var $=D.split("@"),w=$.pop(),E=w.toLowerCase();if(u.host_blacklist.includes(E))return!1;if(u.host_whitelist.length>0&&!u.host_whitelist.includes(E))return!1;var Y=$.join("@");if(u.domain_specific_validation&&(E==="gmail.com"||E==="googlemail.com")){Y=Y.toLowerCase();var q=Y.split("+")[0];if(!B2.default(q.replace(/\./g,""),{min:6,max:30}))return!1;var W=q.split(".");for(var Z=0;Z<W.length;Z++)if(!kB.test(W[Z]))return!1}if(u.ignore_max_length===!1&&(!B2.default(Y,{max:64})||!B2.default(w,{max:254})))return!1;if(!hB.default(w,{require_tld:u.require_tld,ignore_max_length:u.ignore_max_length,allow_underscores:u.allow_underscores})){if(!u.allow_ip_domain)return!1;if(!PF.default(w)){if(!w.startsWith("[")||!w.endsWith("]"))return!1;var G=w.slice(1,-1);if(G.length===0||!PF.default(G))return!1}}if(Y[0]==='"')return Y=Y.slice(1,Y.length-1),u.allow_utf8_local_part?gB.test(Y):SB.test(Y);var A=u.allow_utf8_local_part?_B:jB,z=Y.split(".");for(var X=0;X<z.length;X++)if(!A.test(z[X]))return!1;if(u.blacklisted_chars){if(Y.search(new RegExp("[".concat(u.blacklisted_chars,"]+"),"g"))!==-1)return!1}return!0}M2.exports=P1.default;M2.exports.default=P1.default});var j1=h((vF)=>{Object.defineProperty(vF,"__esModule",{value:!0});vF.farsiLocales=vF.englishLocales=vF.dotDecimal=vF.decimal=vF.commaDecimal=vF.bengaliLocales=vF.arabicLocales=vF.alphanumeric=vF.alpha=void 0;var dD=vF.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZ\u00C7\u018F\u011E\u0130\u0131\u00D6\u015E\u00DC]+$/i,"bg-BG":/^[\u0410-\u042F]+$/i,"cs-CZ":/^[A-Z\u00C1\u010C\u010E\u00C9\u011A\u00CD\u0147\u00D3\u0158\u0160\u0164\u00DA\u016E\u00DD\u017D]+$/i,"da-DK":/^[A-Z\u00C6\u00D8\u00C5]+$/i,"de-DE":/^[A-Z\u00C4\u00D6\u00DC\u00DF]+$/i,"el-GR":/^[\u0391-\u03CE]+$/i,"es-ES":/^[A-Z\u00C1\u00C9\u00CD\u00D1\u00D3\u00DA\u00DC]+$/i,"fa-IR":/^[\u0627\u0628\u067E\u062A\u062B\u062C\u0686\u062D\u062E\u062F\u0630\u0631\u0632\u0698\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u0641\u0642\u06A9\u06AF\u0644\u0645\u0646\u0648\u0647\u06CC]+$/i,"fi-FI":/^[A-Z\u00C5\u00C4\u00D6]+$/i,"fr-FR":/^[A-Z\u00C0\u00C2\u00C6\u00C7\u00C9\u00C8\u00CA\u00CB\u00CF\u00CE\u00D4\u0152\u00D9\u00DB\u00DC\u0178]+$/i,"it-IT":/^[A-Z\u00C0\u00C9\u00C8\u00CC\u00CE\u00D3\u00D2\u00D9]+$/i,"ja-JP":/^[\u3041-\u3093\u30A1-\u30F6\uFF66-\uFF9F\u4E00-\u9FA0\u30FC\u30FB\u3002\u3001]+$/i,"nb-NO":/^[A-Z\u00C6\u00D8\u00C5]+$/i,"nl-NL":/^[A-Z\u00C1\u00C9\u00CB\u00CF\u00D3\u00D6\u00DC\u00DA]+$/i,"nn-NO":/^[A-Z\u00C6\u00D8\u00C5]+$/i,"hu-HU":/^[A-Z\u00C1\u00C9\u00CD\u00D3\u00D6\u0150\u00DA\u00DC\u0170]+$/i,"pl-PL":/^[A-Z\u0104\u0106\u0118\u015A\u0141\u0143\u00D3\u017B\u0179]+$/i,"pt-PT":/^[A-Z\u00C3\u00C1\u00C0\u00C2\u00C4\u00C7\u00C9\u00CA\u00CB\u00CD\u00CF\u00D5\u00D3\u00D4\u00D6\u00DA\u00DC]+$/i,"ru-RU":/^[\u0410-\u042F\u0401]+$/i,"kk-KZ":/^[\u0410-\u042F\u0401\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-Z\u010C\u0106\u0110\u0160\u017D]+$/i,"sk-SK":/^[A-Z\u00C1\u010C\u010E\u00C9\u00CD\u0147\u00D3\u0160\u0164\u00DA\u00DD\u017D\u0139\u0154\u013D\u00C4\u00D4]+$/i,"sr-RS@latin":/^[A-Z\u010C\u0106\u017D\u0160\u0110]+$/i,"sr-RS":/^[\u0410-\u042F\u0402\u0408\u0409\u040A\u040B\u040F]+$/i,"sv-SE":/^[A-Z\u00C5\u00C4\u00D6]+$/i,"th-TH":/^[\u0E01-\u0E50\s]+$/i,"tr-TR":/^[A-Z\u00C7\u011E\u0130\u0131\u00D6\u015E\u00DC]+$/i,"uk-UA":/^[\u0410-\u0429\u042C\u042E\u042F\u0404I\u0407\u0490\u0456]+$/i,"vi-VN":/^[A-Z\u00C0\u00C1\u1EA0\u1EA2\u00C3\u00C2\u1EA6\u1EA4\u1EAC\u1EA8\u1EAA\u0102\u1EB0\u1EAE\u1EB6\u1EB2\u1EB4\u0110\u00C8\u00C9\u1EB8\u1EBA\u1EBC\u00CA\u1EC0\u1EBE\u1EC6\u1EC2\u1EC4\u00CC\u00CD\u1ECA\u1EC8\u0128\u00D2\u00D3\u1ECC\u1ECE\u00D5\u00D4\u1ED2\u1ED0\u1ED8\u1ED4\u1ED6\u01A0\u1EDC\u1EDA\u1EE2\u1EDE\u1EE0\u00D9\u00DA\u1EE4\u1EE6\u0168\u01AF\u1EEA\u1EE8\u1EF0\u1EEC\u1EEE\u1EF2\u00DD\u1EF4\u1EF6\u1EF8]+$/i,"ko-KR":/^[\u3131-\u314E\u314F-\u3163\uAC00-\uD7A3]*$/,"ku-IQ":/^[\u0626\u0627\u0628\u067E\u062A\u062C\u0686\u062D\u062E\u062F\u0631\u0695\u0632\u0698\u0633\u0634\u0639\u063A\u0641\u06A4\u0642\u06A9\u06AF\u0644\u06B5\u0645\u0646\u0648\u06C6\u06BE\u06D5\u06CC\u06CE\u064A\u0637\u0624\u062B\u0622\u0625\u0623\u0643\u0636\u0635\u0629\u0638\u0630]+$/i,ar:/^[\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\u0670]+$/,he:/^[\u05D0-\u05EA]+$/,fa:/^['\u0622\u0627\u0621\u0623\u0624\u0626\u0628\u067E\u062A\u062B\u062C\u0686\u062D\u062E\u062F\u0630\u0631\u0632\u0698\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u0641\u0642\u06A9\u06AF\u0644\u0645\u0646\u0648\u0647\u0629\u06CC']+$/i,bn:/^['\u0980\u0981\u0982\u0983\u0985\u0986\u0987\u0988\u0989\u098A\u098B\u098C\u098F\u0990\u0993\u0994\u0995\u0996\u0997\u0998\u0999\u099A\u099B\u099C\u099D\u099E\u099F\u09A0\u09A1\u09A2\u09A3\u09A4\u09A5\u09A6\u09A7\u09A8\u09AA\u09AB\u09AC\u09AD\u09AE\u09AF\u09B0\u09B2\u09B6\u09B7\u09B8\u09B9\u09BC\u09BD\u09BE\u09BF\u09C0\u09C1\u09C2\u09C3\u09C4\u09C7\u09C8\u09CB\u09CC\u09CD\u09CE\u09D7\u09DC\u09DD\u09DF\u09E0\u09E1\u09E2\u09E3\u09F0\u09F1\u09F2\u09F3\u09F4\u09F5\u09F6\u09F7\u09F8\u09F9\u09FA\u09FB']+$/,eo:/^[ABC\u0108D-G\u011CH\u0124IJ\u0134K-PRS\u015CTU\u016CVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/},iD=vF.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZ\u00C7\u018F\u011E\u0130\u0131\u00D6\u015E\u00DC]+$/i,"bg-BG":/^[0-9\u0410-\u042F]+$/i,"cs-CZ":/^[0-9A-Z\u00C1\u010C\u010E\u00C9\u011A\u00CD\u0147\u00D3\u0158\u0160\u0164\u00DA\u016E\u00DD\u017D]+$/i,"da-DK":/^[0-9A-Z\u00C6\u00D8\u00C5]+$/i,"de-DE":/^[0-9A-Z\u00C4\u00D6\u00DC\u00DF]+$/i,"el-GR":/^[0-9\u0391-\u03C9]+$/i,"es-ES":/^[0-9A-Z\u00C1\u00C9\u00CD\u00D1\u00D3\u00DA\u00DC]+$/i,"fi-FI":/^[0-9A-Z\u00C5\u00C4\u00D6]+$/i,"fr-FR":/^[0-9A-Z\u00C0\u00C2\u00C6\u00C7\u00C9\u00C8\u00CA\u00CB\u00CF\u00CE\u00D4\u0152\u00D9\u00DB\u00DC\u0178]+$/i,"it-IT":/^[0-9A-Z\u00C0\u00C9\u00C8\u00CC\u00CE\u00D3\u00D2\u00D9]+$/i,"ja-JP":/^[0-9\uFF10-\uFF19\u3041-\u3093\u30A1-\u30F6\uFF66-\uFF9F\u4E00-\u9FA0\u30FC\u30FB\u3002\u3001]+$/i,"hu-HU":/^[0-9A-Z\u00C1\u00C9\u00CD\u00D3\u00D6\u0150\u00DA\u00DC\u0170]+$/i,"nb-NO":/^[0-9A-Z\u00C6\u00D8\u00C5]+$/i,"nl-NL":/^[0-9A-Z\u00C1\u00C9\u00CB\u00CF\u00D3\u00D6\u00DC\u00DA]+$/i,"nn-NO":/^[0-9A-Z\u00C6\u00D8\u00C5]+$/i,"pl-PL":/^[0-9A-Z\u0104\u0106\u0118\u015A\u0141\u0143\u00D3\u017B\u0179]+$/i,"pt-PT":/^[0-9A-Z\u00C3\u00C1\u00C0\u00C2\u00C4\u00C7\u00C9\u00CA\u00CB\u00CD\u00CF\u00D5\u00D3\u00D4\u00D6\u00DA\u00DC]+$/i,"ru-RU":/^[0-9\u0410-\u042F\u0401]+$/i,"kk-KZ":/^[0-9\u0410-\u042F\u0401\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-Z\u010C\u0106\u0110\u0160\u017D]+$/i,"sk-SK":/^[0-9A-Z\u00C1\u010C\u010E\u00C9\u00CD\u0147\u00D3\u0160\u0164\u00DA\u00DD\u017D\u0139\u0154\u013D\u00C4\u00D4]+$/i,"sr-RS@latin":/^[0-9A-Z\u010C\u0106\u017D\u0160\u0110]+$/i,"sr-RS":/^[0-9\u0410-\u042F\u0402\u0408\u0409\u040A\u040B\u040F]+$/i,"sv-SE":/^[0-9A-Z\u00C5\u00C4\u00D6]+$/i,"th-TH":/^[\u0E01-\u0E59\s]+$/i,"tr-TR":/^[0-9A-Z\u00C7\u011E\u0130\u0131\u00D6\u015E\u00DC]+$/i,"uk-UA":/^[0-9\u0410-\u0429\u042C\u042E\u042F\u0404I\u0407\u0490\u0456]+$/i,"ko-KR":/^[0-9\u3131-\u314E\u314F-\u3163\uAC00-\uD7A3]*$/,"ku-IQ":/^[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u06690-9\u0626\u0627\u0628\u067E\u062A\u062C\u0686\u062D\u062E\u062F\u0631\u0695\u0632\u0698\u0633\u0634\u0639\u063A\u0641\u06A4\u0642\u06A9\u06AF\u0644\u06B5\u0645\u0646\u0648\u06C6\u06BE\u06D5\u06CC\u06CE\u064A\u0637\u0624\u062B\u0622\u0625\u0623\u0643\u0636\u0635\u0629\u0638\u0630]+$/i,"vi-VN":/^[0-9A-Z\u00C0\u00C1\u1EA0\u1EA2\u00C3\u00C2\u1EA6\u1EA4\u1EAC\u1EA8\u1EAA\u0102\u1EB0\u1EAE\u1EB6\u1EB2\u1EB4\u0110\u00C8\u00C9\u1EB8\u1EBA\u1EBC\u00CA\u1EC0\u1EBE\u1EC6\u1EC2\u1EC4\u00CC\u00CD\u1ECA\u1EC8\u0128\u00D2\u00D3\u1ECC\u1ECE\u00D5\u00D4\u1ED2\u1ED0\u1ED8\u1ED4\u1ED6\u01A0\u1EDC\u1EDA\u1EE2\u1EDE\u1EE0\u00D9\u00DA\u1EE4\u1EE6\u0168\u01AF\u1EEA\u1EE8\u1EF0\u1EEC\u1EEE\u1EF2\u00DD\u1EF4\u1EF6\u1EF8]+$/i,ar:/^[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u06690-9\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\u0670]+$/,he:/^[0-9\u05D0-\u05EA]+$/,fa:/^['0-9\u0622\u0627\u0621\u0623\u0624\u0626\u0628\u067E\u062A\u062B\u062C\u0686\u062D\u062E\u062F\u0630\u0631\u0632\u0698\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u0641\u0642\u06A9\u06AF\u0644\u0645\u0646\u0648\u0647\u0629\u06CC\u06F1\u06F2\u06F3\u06F4\u06F5\u06F6\u06F7\u06F8\u06F9\u06F0']+$/i,bn:/^['\u0980\u0981\u0982\u0983\u0985\u0986\u0987\u0988\u0989\u098A\u098B\u098C\u098F\u0990\u0993\u0994\u0995\u0996\u0997\u0998\u0999\u099A\u099B\u099C\u099D\u099E\u099F\u09A0\u09A1\u09A2\u09A3\u09A4\u09A5\u09A6\u09A7\u09A8\u09AA\u09AB\u09AC\u09AD\u09AE\u09AF\u09B0\u09B2\u09B6\u09B7\u09B8\u09B9\u09BC\u09BD\u09BE\u09BF\u09C0\u09C1\u09C2\u09C3\u09C4\u09C7\u09C8\u09CB\u09CC\u09CD\u09CE\u09D7\u09DC\u09DD\u09DF\u09E0\u09E1\u09E2\u09E3\u09E6\u09E7\u09E8\u09E9\u09EA\u09EB\u09EC\u09ED\u09EE\u09EF\u09F0\u09F1\u09F2\u09F3\u09F4\u09F5\u09F6\u09F7\u09F8\u09F9\u09FA\u09FB']+$/,eo:/^[0-9ABC\u0108D-G\u011CH\u0124IJ\u0134K-PRS\u015CTU\u016CVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/},kD=vF.decimal={"en-US":".",ar:"\u066B"},kF=vF.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"];for(_0=0;_0<kF.length;_0++)B0="en-".concat(kF[_0]),dD[B0]=dD["en-US"],iD[B0]=iD["en-US"],kD[B0]=kD["en-US"];var B0,_0,SF=vF.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"];for(g0=0;g0<SF.length;g0++)M0="ar-".concat(SF[g0]),dD[M0]=dD.ar,iD[M0]=iD.ar,kD[M0]=kD.ar;var M0,g0,_F=vF.farsiLocales=["IR","AF"];for(m0=0;m0<_F.length;m0++)b0="fa-".concat(_F[m0]),iD[b0]=iD.fa,kD[b0]=kD.ar;var b0,m0,gF=vF.bengaliLocales=["BD","IN"];for(v0=0;v0<gF.length;v0++)Y0="bn-".concat(gF[v0]),dD[Y0]=dD.bn,iD[Y0]=iD.bn,kD[Y0]=kD["en-US"];var Y0,v0,bF=vF.dotDecimal=["ar-EG","ar-LB","ar-LY"],mF=vF.commaDecimal=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","eo","es-ES","fr-CA","fr-FR","id-ID","it-IT","ku-IQ","hi-IN","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","kk-KZ","si-LK","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA","vi-VN"];for(c0=0;c0<bF.length;c0++)kD[bF[c0]]=kD["en-US"];var c0;for(x0=0;x0<mF.length;x0++)kD[mF[x0]]=",";var x0;dD["fr-CA"]=dD["fr-FR"];iD["fr-CA"]=iD["fr-FR"];dD["pt-BR"]=dD["pt-PT"];iD["pt-BR"]=iD["pt-PT"];kD["pt-BR"]=kD["pt-PT"];dD["pl-Pl"]=dD["pl-PL"];iD["pl-Pl"]=iD["pl-PL"];kD["pl-Pl"]=kD["pl-PL"];dD["fa-AF"]=dD.fa});var fF=h((xF)=>{Object.defineProperty(xF,"__esModule",{value:!0});xF.default=oB;xF.locales=void 0;var aB=tB(wD()),Y2=j1();function tB(D){return D&&D.__esModule?D:{default:D}}function oB(D){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};aB.default(D);var C=D,$=F.ignore;if($)if($ instanceof RegExp)C=C.replace($,"");else if(typeof $==="string")C=C.replace(new RegExp("[".concat($.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(u in Y2.alpha)return Y2.alpha[u].test(C);throw new Error("Invalid locale '".concat(u,"'"))}var LQ=xF.locales=Object.keys(Y2.alpha)});var iF=h((k1,J2)=>{Object.defineProperty(k1,"__esModule",{value:!0});k1.default=wM;var eB=dF(wD()),DM=dF(bu());function dF(D){return D&&D.__esModule?D:{default:D}}var uM=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,FM=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,CM=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,$M=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,EM={checkDMS:!1};function wM(D,u){if(eB.default(D),u=DM.default(u,EM),!D.includes(","))return!1;var F=D.split(",");if(F[0].startsWith("(")&&!F[1].endsWith(")")||F[1].endsWith(")")&&!F[0].startsWith("("))return!1;if(u.checkDMS)return CM.test(F[0])&&$M.test(F[1]);return uM.test(F[0])&&FM.test(F[1])}J2.exports=k1.default;J2.exports.default=k1.default});var rF=h((S1,q2)=>{Object.defineProperty(S1,"__esModule",{value:!0});S1.default=void 0;var MM=function D(u,F){return u.some(function(C){return F===C})},hQ=S1.default=MM;q2.exports=S1.default;q2.exports.default=S1.default});var aF=h((_1,K2)=>{Object.defineProperty(_1,"__esModule",{value:!0});_1.default=WM;var YM=Z2(bu()),JM=Z2(wD()),qM=Z2(rF()),pF=j1();function Z2(D){return D&&D.__esModule?D:{default:D}}function ZM(D){var u=new RegExp("^[-+]?([0-9]+)?(\\".concat(pF.decimal[D.locale],"[0-9]{").concat(D.decimal_digits,"})").concat(D.force_decimal?"":"?","$"));return u}var KM={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},XM=["","-","+"];function WM(D,u){if(JM.default(D),u=YM.default(u,KM),u.locale in pF.decimal)return!qM.default(XM,D.replace(/ /g,""))&&ZM(u).test(D);throw new Error("Invalid locale '".concat(u.locale,"'"))}K2.exports=_1.default;K2.exports.default=_1.default});var tF=h((g1,X2)=>{Object.defineProperty(g1,"__esModule",{value:!0});g1.default=HM;var zM=AM(wD());function AM(D){return D&&D.__esModule?D:{default:D}}var QM=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;function HM(D){return zM.default(D),QM.test(D)}X2.exports=g1.default;X2.exports.default=g1.default});var oF=h((b1,W2)=>{Object.defineProperty(b1,"__esModule",{value:!0});b1.default=TM;var yM=OM(wD());function OM(D){return D&&D.__esModule?D:{default:D}}function TM(D){yM.default(D);var u=D.replace(/[- ]+/g,""),F=0,C,$,w;for(var E=u.length-1;E>=0;E--){if(C=u.substring(E,E+1),$=parseInt(C,10),w)if($*=2,$>=10)F+=$%10+1;else F+=$;else F+=$;w=!w}return!!(F%10===0?u:!1)}W2.exports=b1.default;W2.exports.default=b1.default});var eF=h((m1,G2)=>{Object.defineProperty(m1,"__esModule",{value:!0});m1.default=IM;var LM=sF(wD()),NM=sF(oF());function sF(D){return D&&D.__esModule?D:{default:D}}var J0={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},hM=function(){var D=[];for(var u in J0)if(J0.hasOwnProperty(u))D.push(J0[u]);return D}();function IM(D){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};LM.default(D);var F=u.provider,C=D.replace(/[- ]+/g,"");if(F&&F.toLowerCase()in J0){if(!J0[F.toLowerCase()].test(C))return!1}else if(F&&!(F.toLowerCase()in J0))throw new Error("".concat(F," is not a valid credit card provider."));else if(!hM.some(function($){return $.test(C)}))return!1;return NM.default(D)}G2.exports=m1.default;G2.exports.default=m1.default});var F9=h((D9)=>{Object.defineProperty(D9,"__esModule",{value:!0});D9.default=kM;D9.locales=void 0;var PM=jM(wD()),z2=j1();function jM(D){return D&&D.__esModule?D:{default:D}}function kM(D){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};PM.default(D);var C=D,$=F.ignore;if($)if($ instanceof RegExp)C=C.replace($,"");else if(typeof $==="string")C=C.replace(new RegExp("[".concat($.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(u in z2.alphanumeric)return z2.alphanumeric[u].test(C);throw new Error("Invalid locale '".concat(u,"'"))}var IQ=D9.locales=Object.keys(z2.alphanumeric)});var $9=h((v1,A2)=>{Object.defineProperty(v1,"__esModule",{value:!0});v1.default=bM;var _M=gM(wD());function gM(D){return D&&D.__esModule?D:{default:D}}var C9={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{1}\d{8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/,ZA:/^[TAMD]\d{8}$/};function bM(D,u){_M.default(D);var F=D.replace(/\s/g,"").toUpperCase();return u.toUpperCase()in C9&&C9[u].test(F)}A2.exports=v1.default;A2.exports.default=v1.default});var H2=h((w9)=>{Object.defineProperty(w9,"__esModule",{value:!0});w9.default=xM;w9.locales=void 0;var vM=cM(wD());function cM(D){return D&&D.__esModule?D:{default:D}}var E9=/^\d{3}$/,tD=/^\d{4}$/,SD=/^\d{5}$/,Q2=/^\d{6}$/,q0={AD:/^AD\d{3}$/,AT:tD,AU:tD,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:tD,BG:tD,BR:/^\d{5}-\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:tD,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CZ:/^\d{3}\s?\d{2}$/,DE:SD,DK:tD,DO:SD,DZ:SD,EE:SD,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:SD,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:tD,ID:SD,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:E9,IT:SD,JP:/^\d{3}\-\d{4}$/,KE:SD,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:tD,LV:/^LV\-\d{4}$/,LK:SD,MG:E9,MX:SD,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:SD,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:tD,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:tD,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:Q2,RU:Q2,SA:SD,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:Q2,SI:tD,SK:/^\d{3}\s?\d{2}$/,TH:SD,TN:tD,TW:/^\d{3}(\d{2})?$/,UA:SD,US:/^\d{5}(-\d{4})?$/,ZA:tD,ZM:SD},PQ=w9.locales=Object.keys(q0);function xM(D,u){if(vM.default(D),u in q0)return q0[u].test(D);else if(u==="any"){for(var F in q0)if(q0.hasOwnProperty(F)){var C=q0[F];if(C.test(D))return!0}return!1}throw new Error("Invalid locale '".concat(u,"'"))}});var U2=h((M9)=>{Object.defineProperty(M9,"__esModule",{value:!0});M9.default=iM;M9.locales=void 0;var fM=dM(wD());function dM(D){return D&&D.__esModule?D:{default:D}}var $D={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/};$D["en-CA"]=$D["en-US"];$D["fr-CA"]=$D["en-CA"];$D["fr-BE"]=$D["nl-BE"];$D["zh-HK"]=$D["en-HK"];$D["zh-MO"]=$D["en-MO"];$D["ga-IE"]=$D["en-IE"];$D["fr-CH"]=$D["de-CH"];$D["it-CH"]=$D["fr-CH"];function iM(D,u,F){if(fM.default(D),F&&F.strictMode&&!D.startsWith("+"))return!1;if(Array.isArray(u))return u.some(function(w){if($D.hasOwnProperty(w)){var E=$D[w];if(E.test(D))return!0}return!1});else if(u in $D)return $D[u].test(D);else if(!u||u==="any"){for(var C in $D)if($D.hasOwnProperty(C)){var $=$D[C];if($.test(D))return!0}return!1}throw new Error("Invalid locale '".concat(u,"'"))}var kQ=M9.locales=Object.keys($D)});var N2=h((V2,L2)=>{(function(D,u){typeof V2=="object"&&typeof L2!="undefined"?L2.exports=u():typeof define=="function"&&define.amd?define(u):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs=u()})(V2,function(){var D=1000,u=60000,F=3600000,C="millisecond",$="second",w="minute",E="hour",Y="day",q="week",W="month",Z="quarter",G="year",A="date",z="Invalid Date",X=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(S){var O=["th","st","nd","rd"],H=S%100;return"["+S+(O[(H-20)%10]||O[H]||O[0])+"]"}},c=function(S,O,H){var N=String(S);return!N||N.length>=O?S:""+Array(O+1-N.length).join(H)+S},l={s:c,z:function(S){var O=-S.utcOffset(),H=Math.abs(O),N=Math.floor(H/60),U=H%60;return(O<=0?"+":"-")+c(N,2,"0")+":"+c(U,2,"0")},m:function S(O,H){if(O.date()<H.date())return-S(H,O);var N=12*(H.year()-O.year())+(H.month()-O.month()),U=O.clone().add(N,W),I=H-U<0,g=O.clone().add(N+(I?-1:1),W);return+(-(N+(H-U)/(I?U-g:g-U))||0)},a:function(S){return S<0?Math.ceil(S)||0:Math.floor(S)},p:function(S){return{M:W,y:G,w:q,d:Y,D:A,h:E,m:w,s:$,ms:C,Q:Z}[S]||String(S||"").toLowerCase().replace(/s$/,"")},u:function(S){return S===void 0}},d="en",MD={};MD[d]=m;var PD="$isDayjsObject",KD=function(S){return S instanceof n||!(!S||!S[PD])},XD=function S(O,H,N){var U;if(!O)return d;if(typeof O=="string"){var I=O.toLowerCase();MD[I]&&(U=I),H&&(MD[I]=H,U=I);var g=O.split("-");if(!U&&g.length>1)return S(g[0])}else{var b=O.name;MD[b]=O,U=b}return!N&&U&&(d=U),U||!N&&d},a=function(S,O){if(KD(S))return S.clone();var H=typeof O=="object"?O:{};return H.date=S,H.args=arguments,new n(H)},V=l;V.l=XD,V.i=KD,V.w=function(S,O){return a(S,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var n=function(){function S(H){this.$L=XD(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[PD]=!0}var O=S.prototype;return O.parse=function(H){this.$d=function(N){var{date:U,utc:I}=N;if(U===null)return new Date(NaN);if(V.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var g=U.match(X);if(g){var b=g[2]-1||0,r=(g[7]||"0").substring(0,3);return I?new Date(Date.UTC(g[1],b,g[3]||1,g[4]||0,g[5]||0,g[6]||0,r)):new Date(g[1],b,g[3]||1,g[4]||0,g[5]||0,g[6]||0,r)}}return new Date(U)}(H),this.init()},O.init=function(){var H=this.$d;this.$y=H.getFullYear(),this.$M=H.getMonth(),this.$D=H.getDate(),this.$W=H.getDay(),this.$H=H.getHours(),this.$m=H.getMinutes(),this.$s=H.getSeconds(),this.$ms=H.getMilliseconds()},O.$utils=function(){return V},O.isValid=function(){return this.$d.toString()!==z},O.isSame=function(H,N){var U=a(H);return this.startOf(N)<=U&&U<=this.endOf(N)},O.isAfter=function(H,N){return a(H)<this.startOf(N)},O.isBefore=function(H,N){return this.endOf(N)<a(H)},O.$g=function(H,N,U){return V.u(H)?this[N]:this.set(U,H)},O.unix=function(){return Math.floor(this.valueOf()/1000)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(H,N){var U=this,I=!!V.u(N)||N,g=V.p(H),b=function(WD,ZD){var fD=V.w(U.$u?Date.UTC(U.$y,ZD,WD):new Date(U.$y,ZD,WD),U);return I?fD:fD.endOf(Y)},r=function(WD,ZD){return V.w(U.toDate()[WD].apply(U.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(ZD)),U)},DD=this.$W,YD=this.$M,ND=this.$D,zu="set"+(this.$u?"UTC":"");switch(g){case G:return I?b(1,0):b(31,11);case W:return I?b(1,YD):b(0,YD+1);case q:var Eu=this.$locale().weekStart||0,Lu=(DD<Eu?DD+7:DD)-Eu;return b(I?ND-Lu:ND+(6-Lu),YD);case Y:case A:return r(zu+"Hours",0);case E:return r(zu+"Minutes",1);case w:return r(zu+"Seconds",2);case $:return r(zu+"Milliseconds",3);default:return this.clone()}},O.endOf=function(H){return this.startOf(H,!1)},O.$set=function(H,N){var U,I=V.p(H),g="set"+(this.$u?"UTC":""),b=(U={},U[Y]=g+"Date",U[A]=g+"Date",U[W]=g+"Month",U[G]=g+"FullYear",U[E]=g+"Hours",U[w]=g+"Minutes",U[$]=g+"Seconds",U[C]=g+"Milliseconds",U)[I],r=I===Y?this.$D+(N-this.$W):N;if(I===W||I===G){var DD=this.clone().set(A,1);DD.$d[b](r),DD.init(),this.$d=DD.set(A,Math.min(this.$D,DD.daysInMonth())).$d}else b&&this.$d[b](r);return this.init(),this},O.set=function(H,N){return this.clone().$set(H,N)},O.get=function(H){return this[V.p(H)]()},O.add=function(H,N){var U,I=this;H=Number(H);var g=V.p(N),b=function(YD){var ND=a(I);return V.w(ND.date(ND.date()+Math.round(YD*H)),I)};if(g===W)return this.set(W,this.$M+H);if(g===G)return this.set(G,this.$y+H);if(g===Y)return b(1);if(g===q)return b(7);var r=(U={},U[w]=u,U[E]=F,U[$]=D,U)[g]||1,DD=this.$d.getTime()+H*r;return V.w(DD,this)},O.subtract=function(H,N){return this.add(-1*H,N)},O.format=function(H){var N=this,U=this.$locale();if(!this.isValid())return U.invalidDate||z;var I=H||"YYYY-MM-DDTHH:mm:ssZ",g=V.z(this),b=this.$H,r=this.$m,DD=this.$M,YD=U.weekdays,ND=U.months,zu=U.meridiem,Eu=function(ZD,fD,wu,Au){return ZD&&(ZD[fD]||ZD(N,I))||wu[fD].slice(0,Au)},Lu=function(ZD){return V.s(b%12||12,ZD,"0")},WD=zu||function(ZD,fD,wu){var Au=ZD<12?"AM":"PM";return wu?Au.toLowerCase():Au};return I.replace(k,function(ZD,fD){return fD||function(wu){switch(wu){case"YY":return String(N.$y).slice(-2);case"YYYY":return V.s(N.$y,4,"0");case"M":return DD+1;case"MM":return V.s(DD+1,2,"0");case"MMM":return Eu(U.monthsShort,DD,ND,3);case"MMMM":return Eu(ND,DD);case"D":return N.$D;case"DD":return V.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return Eu(U.weekdaysMin,N.$W,YD,2);case"ddd":return Eu(U.weekdaysShort,N.$W,YD,3);case"dddd":return YD[N.$W];case"H":return String(b);case"HH":return V.s(b,2,"0");case"h":return Lu(1);case"hh":return Lu(2);case"a":return WD(b,r,!0);case"A":return WD(b,r,!1);case"m":return String(r);case"mm":return V.s(r,2,"0");case"s":return String(N.$s);case"ss":return V.s(N.$s,2,"0");case"SSS":return V.s(N.$ms,3,"0");case"Z":return g}return null}(ZD)||g.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(H,N,U){var I,g=this,b=V.p(N),r=a(H),DD=(r.utcOffset()-this.utcOffset())*u,YD=this-r,ND=function(){return V.m(g,r)};switch(b){case G:I=ND()/12;break;case W:I=ND();break;case Z:I=ND()/3;break;case q:I=(YD-DD)/604800000;break;case Y:I=(YD-DD)/86400000;break;case E:I=YD/F;break;case w:I=YD/u;break;case $:I=YD/D;break;default:I=YD}return U?I:V.a(I)},O.daysInMonth=function(){return this.endOf(W).$D},O.$locale=function(){return MD[this.$L]},O.locale=function(H,N){if(!H)return this.$L;var U=this.clone(),I=XD(H,N,!0);return I&&(U.$L=I),U},O.clone=function(){return V.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},S}(),x=n.prototype;return a.prototype=x,[["$ms",C],["$s",$],["$m",w],["$H",E],["$W",Y],["$M",W],["$y",G],["$D",A]].forEach(function(S){x[S[1]]=function(O){return this.$g(O,S[0],S[1])}}),a.extend=function(S,O){return S.$i||(S(O,n,a),S.$i=!0),a},a.locale=XD,a.isDayjs=KD,a.unix=function(S){return a(1000*S)},a.en=MD[d],a.Ls=MD,a.p={},a})});var _9=h((h2,I2)=>{(function(D,u){typeof h2=="object"&&typeof I2!="undefined"?I2.exports=u():typeof define=="function"&&define.amd?define(u):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs_plugin_isSameOrAfter=u()})(h2,function(){return function(D,u){u.prototype.isSameOrAfter=function(F,C){return this.isSame(F,C)||this.isAfter(F,C)}}})});var g9=h((R2,P2)=>{(function(D,u){typeof R2=="object"&&typeof P2!="undefined"?P2.exports=u():typeof define=="function"&&define.amd?define(u):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs_plugin_isSameOrBefore=u()})(R2,function(){return function(D,u){u.prototype.isSameOrBefore=function(F,C){return this.isSame(F,C)||this.isBefore(F,C)}}})});var b9=h((j2,k2)=>{(function(D,u){typeof j2=="object"&&typeof k2!="undefined"?k2.exports=u():typeof define=="function"&&define.amd?define(u):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs_plugin_customParseFormat=u()})(j2,function(){var D={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},u=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,F=/\d/,C=/\d\d/,$=/\d\d?/,w=/\d*[^-_:/,()\s\d]+/,E={},Y=function(X){return(X=+X)+(X>68?1900:2000)},q=function(X){return function(k){this[X]=+k}},W=[/[+-]\d\d:?(\d\d)?|Z/,function(X){(this.zone||(this.zone={})).offset=function(k){if(!k)return 0;if(k==="Z")return 0;var m=k.match(/([+-]|\d\d)/g),c=60*m[1]+(+m[2]||0);return c===0?0:m[0]==="+"?-c:c}(X)}],Z=function(X){var k=E[X];return k&&(k.indexOf?k:k.s.concat(k.f))},G=function(X,k){var m,c=E.meridiem;if(c){for(var l=1;l<=24;l+=1)if(X.indexOf(c(l,0,k))>-1){m=l>12;break}}else m=X===(k?"pm":"PM");return m},A={A:[w,function(X){this.afternoon=G(X,!1)}],a:[w,function(X){this.afternoon=G(X,!0)}],Q:[F,function(X){this.month=3*(X-1)+1}],S:[F,function(X){this.milliseconds=100*+X}],SS:[C,function(X){this.milliseconds=10*+X}],SSS:[/\d{3}/,function(X){this.milliseconds=+X}],s:[$,q("seconds")],ss:[$,q("seconds")],m:[$,q("minutes")],mm:[$,q("minutes")],H:[$,q("hours")],h:[$,q("hours")],HH:[$,q("hours")],hh:[$,q("hours")],D:[$,q("day")],DD:[C,q("day")],Do:[w,function(X){var k=E.ordinal,m=X.match(/\d+/);if(this.day=m[0],k)for(var c=1;c<=31;c+=1)k(c).replace(/\[|\]/g,"")===X&&(this.day=c)}],w:[$,q("week")],ww:[C,q("week")],M:[$,q("month")],MM:[C,q("month")],MMM:[w,function(X){var k=Z("months"),m=(Z("monthsShort")||k.map(function(c){return c.slice(0,3)})).indexOf(X)+1;if(m<1)throw new Error;this.month=m%12||m}],MMMM:[w,function(X){var k=Z("months").indexOf(X)+1;if(k<1)throw new Error;this.month=k%12||k}],Y:[/[+-]?\d+/,q("year")],YY:[C,function(X){this.year=Y(X)}],YYYY:[/\d{4}/,q("year")],Z:W,ZZ:W};function z(X){var k,m;k=X,m=E&&E.formats;for(var c=(X=k.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(a,V,n){var x=n&&n.toUpperCase();return V||m[n]||D[n]||m[x].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(S,O,H){return O||H.slice(1)})})).match(u),l=c.length,d=0;d<l;d+=1){var MD=c[d],PD=A[MD],KD=PD&&PD[0],XD=PD&&PD[1];c[d]=XD?{regex:KD,parser:XD}:MD.replace(/^\[|\]$/g,"")}return function(a){for(var V={},n=0,x=0;n<l;n+=1){var S=c[n];if(typeof S=="string")x+=S.length;else{var{regex:O,parser:H}=S,N=a.slice(x),U=O.exec(N)[0];H.call(V,U),a=a.replace(U,"")}}return function(I){var g=I.afternoon;if(g!==void 0){var b=I.hours;g?b<12&&(I.hours+=12):b===12&&(I.hours=0),delete I.afternoon}}(V),V}}return function(X,k,m){m.p.customParseFormat=!0,X&&X.parseTwoDigitYear&&(Y=X.parseTwoDigitYear);var c=k.prototype,l=c.parse;c.parse=function(d){var{date:MD,utc:PD,args:KD}=d;this.$u=PD;var XD=KD[1];if(typeof XD=="string"){var a=KD[2]===!0,V=KD[3]===!0,n=a||V,x=KD[2];V&&(x=KD[2]),E=this.$locale(),!a&&x&&(E=m.Ls[x]),this.$d=function(N,U,I,g){try{if(["x","X"].indexOf(U)>-1)return new Date((U==="X"?1000:1)*N);var b=z(U)(N),r=b.year,DD=b.month,YD=b.day,ND=b.hours,zu=b.minutes,Eu=b.seconds,Lu=b.milliseconds,WD=b.zone,ZD=b.week,fD=new Date,wu=YD||(r||DD?1:fD.getDate()),Au=r||fD.getFullYear(),$0=0;r&&!DD||($0=DD>0?DD-1:fD.getMonth());var E0,T0=ND||0,V0=zu||0,L0=Eu||0,N0=Lu||0;return WD?new Date(Date.UTC(Au,$0,wu,T0,V0,L0,N0+60*WD.offset*1000)):I?new Date(Date.UTC(Au,$0,wu,T0,V0,L0,N0)):(E0=new Date(Au,$0,wu,T0,V0,L0,N0),ZD&&(E0=g(E0).week(ZD).toDate()),E0)}catch(f3){return new Date("")}}(MD,XD,PD,m),this.init(),x&&x!==!0&&(this.$L=this.locale(x).$L),n&&MD!=this.format(XD)&&(this.$d=new Date("")),E={}}else if(XD instanceof Array)for(var S=XD.length,O=1;O<=S;O+=1){KD[1]=XD[O-1];var H=m.apply(this,KD);if(H.isValid()){this.$d=H.$d,this.$L=H.$L,this.init();break}O===S&&(this.$d=new Date(""))}else l.call(this,d)}}})});var m9=h((x1,g2)=>{Object.defineProperty(x1,"__esModule",{value:!0});x1.default=BY;var EY=wY(wD());function wY(D){return D&&D.__esModule?D:{default:D}}function BY(D){return EY.default(D),D.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")}g2.exports=x1.default;g2.exports.default=x1.default});var v9=h((n1,b2)=>{Object.defineProperty(n1,"__esModule",{value:!0});n1.default=zY;var YY=JY(bu());function JY(D){return D&&D.__esModule?D:{default:D}}var qY={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},ZY=["icloud.com","me.com"],KY=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],XY=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],WY=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function GY(D){if(D.length>1)return D;return""}function zY(D,u){u=YY.default(u,qY);var F=D.split("@"),C=F.pop(),$=F.join("@"),w=[$,C];if(w[1]=w[1].toLowerCase(),w[1]==="gmail.com"||w[1]==="googlemail.com"){if(u.gmail_remove_subaddress)w[0]=w[0].split("+")[0];if(u.gmail_remove_dots)w[0]=w[0].replace(/\.+/g,GY);if(!w[0].length)return!1;if(u.all_lowercase||u.gmail_lowercase)w[0]=w[0].toLowerCase();w[1]=u.gmail_convert_googlemaildotcom?"gmail.com":w[1]}else if(ZY.indexOf(w[1])>=0){if(u.icloud_remove_subaddress)w[0]=w[0].split("+")[0];if(!w[0].length)return!1;if(u.all_lowercase||u.icloud_lowercase)w[0]=w[0].toLowerCase()}else if(KY.indexOf(w[1])>=0){if(u.outlookdotcom_remove_subaddress)w[0]=w[0].split("+")[0];if(!w[0].length)return!1;if(u.all_lowercase||u.outlookdotcom_lowercase)w[0]=w[0].toLowerCase()}else if(XY.indexOf(w[1])>=0){if(u.yahoo_remove_subaddress){var E=w[0].split("-");w[0]=E.length>1?E.slice(0,-1).join("-"):E[0]}if(!w[0].length)return!1;if(u.all_lowercase||u.yahoo_lowercase)w[0]=w[0].toLowerCase()}else if(WY.indexOf(w[1])>=0){if(u.all_lowercase||u.yandex_lowercase)w[0]=w[0].toLowerCase();w[1]="yandex.ru"}else if(u.all_lowercase)w[0]=w[0].toLowerCase();return w.join("@")}b2.exports=n1.default;b2.exports.default=n1.default});var AD=h((ZJ)=>{ZJ.fromCallback=function(D){return Object.defineProperty(function(...u){if(typeof u[u.length-1]==="function")D.apply(this,u);else return new Promise((F,C)=>{u.push(($,w)=>$!=null?C($):F(w)),D.apply(this,u)})},"name",{value:D.name})};ZJ.fromPromise=function(D){return Object.defineProperty(function(...u){let F=u[u.length-1];if(typeof F!=="function")return D.apply(this,u);else u.pop(),D.apply(this,u).then((C)=>F(null,C),F)},"name",{value:D.name})}});var kC=h((FU,jC)=>{var mu=FD("node:constants"),WJ=process.cwd,t1=null,GJ=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!t1)t1=WJ.call(process);return t1};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(o1=process.chdir,process.chdir=function(D){t1=null,o1.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,o1)}var o1;jC.exports=zJ;function zJ(D){if(mu.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))u(D);if(!D.lutimes)F(D);if(D.chown=w(D.chown),D.fchown=w(D.fchown),D.lchown=w(D.lchown),D.chmod=C(D.chmod),D.fchmod=C(D.fchmod),D.lchmod=C(D.lchmod),D.chownSync=E(D.chownSync),D.fchownSync=E(D.fchownSync),D.lchownSync=E(D.lchownSync),D.chmodSync=$(D.chmodSync),D.fchmodSync=$(D.fchmodSync),D.lchmodSync=$(D.lchmodSync),D.stat=Y(D.stat),D.fstat=Y(D.fstat),D.lstat=Y(D.lstat),D.statSync=q(D.statSync),D.fstatSync=q(D.fstatSync),D.lstatSync=q(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(Z,G,A){if(A)process.nextTick(A)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(Z,G,A,z){if(z)process.nextTick(z)},D.lchownSync=function(){};if(GJ==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(Z){function G(A,z,X){var k=Date.now(),m=0;Z(A,z,function c(l){if(l&&(l.code==="EACCES"||l.code==="EPERM"||l.code==="EBUSY")&&Date.now()-k<60000){if(setTimeout(function(){D.stat(z,function(d,MD){if(d&&d.code==="ENOENT")Z(A,z,c);else X(l)})},m),m<100)m+=10;return}if(X)X(l)})}if(Object.setPrototypeOf)Object.setPrototypeOf(G,Z);return G}(D.rename);D.read=typeof D.read!=="function"?D.read:function(Z){function G(A,z,X,k,m,c){var l;if(c&&typeof c==="function"){var d=0;l=function(MD,PD,KD){if(MD&&MD.code==="EAGAIN"&&d<10)return d++,Z.call(D,A,z,X,k,m,l);c.apply(this,arguments)}}return Z.call(D,A,z,X,k,m,l)}if(Object.setPrototypeOf)Object.setPrototypeOf(G,Z);return G}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(Z){return function(G,A,z,X,k){var m=0;while(!0)try{return Z.call(D,G,A,z,X,k)}catch(c){if(c.code==="EAGAIN"&&m<10){m++;continue}throw c}}}(D.readSync);function u(Z){Z.lchmod=function(G,A,z){Z.open(G,mu.O_WRONLY|mu.O_SYMLINK,A,function(X,k){if(X){if(z)z(X);return}Z.fchmod(k,A,function(m){Z.close(k,function(c){if(z)z(m||c)})})})},Z.lchmodSync=function(G,A){var z=Z.openSync(G,mu.O_WRONLY|mu.O_SYMLINK,A),X=!0,k;try{k=Z.fchmodSync(z,A),X=!1}finally{if(X)try{Z.closeSync(z)}catch(m){}else Z.closeSync(z)}return k}}function F(Z){if(mu.hasOwnProperty("O_SYMLINK")&&Z.futimes)Z.lutimes=function(G,A,z,X){Z.open(G,mu.O_SYMLINK,function(k,m){if(k){if(X)X(k);return}Z.futimes(m,A,z,function(c){Z.close(m,function(l){if(X)X(c||l)})})})},Z.lutimesSync=function(G,A,z){var X=Z.openSync(G,mu.O_SYMLINK),k,m=!0;try{k=Z.futimesSync(X,A,z),m=!1}finally{if(m)try{Z.closeSync(X)}catch(c){}else Z.closeSync(X)}return k};else if(Z.futimes)Z.lutimes=function(G,A,z,X){if(X)process.nextTick(X)},Z.lutimesSync=function(){}}function C(Z){if(!Z)return Z;return function(G,A,z){return Z.call(D,G,A,function(X){if(W(X))X=null;if(z)z.apply(this,arguments)})}}function $(Z){if(!Z)return Z;return function(G,A){try{return Z.call(D,G,A)}catch(z){if(!W(z))throw z}}}function w(Z){if(!Z)return Z;return function(G,A,z,X){return Z.call(D,G,A,z,function(k){if(W(k))k=null;if(X)X.apply(this,arguments)})}}function E(Z){if(!Z)return Z;return function(G,A,z){try{return Z.call(D,G,A,z)}catch(X){if(!W(X))throw X}}}function Y(Z){if(!Z)return Z;return function(G,A,z){if(typeof A==="function")z=A,A=null;function X(k,m){if(m){if(m.uid<0)m.uid+=4294967296;if(m.gid<0)m.gid+=4294967296}if(z)z.apply(this,arguments)}return A?Z.call(D,G,A,X):Z.call(D,G,X)}}function q(Z){if(!Z)return Z;return function(G,A){var z=A?Z.call(D,G,A):Z.call(D,G);if(z){if(z.uid<0)z.uid+=4294967296;if(z.gid<0)z.gid+=4294967296}return z}}function W(Z){if(!Z)return!0;if(Z.code==="ENOSYS")return!0;var G=!process.getuid||process.getuid()!==0;if(G){if(Z.code==="EINVAL"||Z.code==="EPERM")return!0}return!1}}});var gC=h((CU,_C)=>{var SC=FD("node:stream").Stream;_C.exports=AJ;function AJ(D){return{ReadStream:u,WriteStream:F};function u(C,$){if(!(this instanceof u))return new u(C,$);SC.call(this);var w=this;this.path=C,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,$=$||{};var E=Object.keys($);for(var Y=0,q=E.length;Y<q;Y++){var W=E[Y];this[W]=$[W]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){w._read()});return}D.open(this.path,this.flags,this.mode,function(Z,G){if(Z){w.emit("error",Z),w.readable=!1;return}w.fd=G,w.emit("open",G),w._read()})}function F(C,$){if(!(this instanceof F))return new F(C,$);SC.call(this),this.path=C,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,$=$||{};var w=Object.keys($);for(var E=0,Y=w.length;E<Y;E++){var q=w[E];this[q]=$[q]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var mC=h(($U,bC)=>{bC.exports=HJ;var QJ=Object.getPrototypeOf||function(D){return D.__proto__};function HJ(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var u={__proto__:QJ(D)};else var u=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(F){Object.defineProperty(u,F,Object.getOwnPropertyDescriptor(D,F))}),u}});var W0=h((EU,l2)=>{var BD=FD("node:fs"),UJ=kC(),yJ=gC(),OJ=mC(),s1=FD("node:util"),VD,D8;if(typeof Symbol==="function"&&typeof Symbol.for==="function")VD=Symbol.for("graceful-fs.queue"),D8=Symbol.for("graceful-fs.previous");else VD="___graceful-fs.queue",D8="___graceful-fs.previous";function TJ(){}function cC(D,u){Object.defineProperty(D,VD,{get:function(){return u}})}var au=TJ;if(s1.debuglog)au=s1.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))au=function(){var D=s1.format.apply(s1,arguments);D="GFS4: "+D.split(/\n/).join(`
|
|
4
|
-
GFS4: `),console.error(D)};if(!BD[VD]){if(f2=global[VD]||[],cC(BD,f2),BD.close=function(D){function u(F,C){return D.call(BD,F,function($){if(!$)vC();if(typeof C==="function")C.apply(this,arguments)})}return Object.defineProperty(u,D8,{value:D}),u}(BD.close),BD.closeSync=function(D){function u(F){D.apply(BD,arguments),vC()}return Object.defineProperty(u,D8,{value:D}),u}(BD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){au(BD[VD]),FD("node:assert").equal(BD[VD].length,0)})}var f2;if(!global[VD])cC(global,BD[VD]);l2.exports=d2(OJ(BD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!BD.__patched)l2.exports=d2(BD),BD.__patched=!0;function d2(D){UJ(D),D.gracefulify=d2,D.createReadStream=PD,D.createWriteStream=KD;var u=D.readFile;D.readFile=F;function F(V,n,x){if(typeof n==="function")x=n,n=null;return S(V,n,x);function S(O,H,N,U){return u(O,H,function(I){if(I&&(I.code==="EMFILE"||I.code==="ENFILE"))X0([S,[O,H,N],I,U||Date.now(),Date.now()]);else if(typeof N==="function")N.apply(this,arguments)})}}var C=D.writeFile;D.writeFile=$;function $(V,n,x,S){if(typeof x==="function")S=x,x=null;return O(V,n,x,S);function O(H,N,U,I,g){return C(H,N,U,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))X0([O,[H,N,U,I],b,g||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}var w=D.appendFile;if(w)D.appendFile=E;function E(V,n,x,S){if(typeof x==="function")S=x,x=null;return O(V,n,x,S);function O(H,N,U,I,g){return w(H,N,U,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))X0([O,[H,N,U,I],b,g||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}var Y=D.copyFile;if(Y)D.copyFile=q;function q(V,n,x,S){if(typeof x==="function")S=x,x=0;return O(V,n,x,S);function O(H,N,U,I,g){return Y(H,N,U,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))X0([O,[H,N,U,I],b,g||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}var W=D.readdir;D.readdir=G;var Z=/^v[0-5]\./;function G(V,n,x){if(typeof n==="function")x=n,n=null;var S=Z.test(process.version)?function H(N,U,I,g){return W(N,O(N,U,I,g))}:function H(N,U,I,g){return W(N,U,O(N,U,I,g))};return S(V,n,x);function O(H,N,U,I){return function(g,b){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))X0([S,[H,N,U],g,I||Date.now(),Date.now()]);else{if(b&&b.sort)b.sort();if(typeof U==="function")U.call(this,g,b)}}}}if(process.version.substr(0,4)==="v0.8"){var A=yJ(D);c=A.ReadStream,d=A.WriteStream}var z=D.ReadStream;if(z)c.prototype=Object.create(z.prototype),c.prototype.open=l;var X=D.WriteStream;if(X)d.prototype=Object.create(X.prototype),d.prototype.open=MD;Object.defineProperty(D,"ReadStream",{get:function(){return c},set:function(V){c=V},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return d},set:function(V){d=V},enumerable:!0,configurable:!0});var k=c;Object.defineProperty(D,"FileReadStream",{get:function(){return k},set:function(V){k=V},enumerable:!0,configurable:!0});var m=d;Object.defineProperty(D,"FileWriteStream",{get:function(){return m},set:function(V){m=V},enumerable:!0,configurable:!0});function c(V,n){if(this instanceof c)return z.apply(this,arguments),this;else return c.apply(Object.create(c.prototype),arguments)}function l(){var V=this;a(V.path,V.flags,V.mode,function(n,x){if(n){if(V.autoClose)V.destroy();V.emit("error",n)}else V.fd=x,V.emit("open",x),V.read()})}function d(V,n){if(this instanceof d)return X.apply(this,arguments),this;else return d.apply(Object.create(d.prototype),arguments)}function MD(){var V=this;a(V.path,V.flags,V.mode,function(n,x){if(n)V.destroy(),V.emit("error",n);else V.fd=x,V.emit("open",x)})}function PD(V,n){return new D.ReadStream(V,n)}function KD(V,n){return new D.WriteStream(V,n)}var XD=D.open;D.open=a;function a(V,n,x,S){if(typeof x==="function")S=x,x=null;return O(V,n,x,S);function O(H,N,U,I,g){return XD(H,N,U,function(b,r){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))X0([O,[H,N,U,I],b,g||Date.now(),Date.now()]);else if(typeof I==="function")I.apply(this,arguments)})}}return D}function X0(D){au("ENQUEUE",D[0].name,D[1]),BD[VD].push(D),i2()}var e1;function vC(){var D=Date.now();for(var u=0;u<BD[VD].length;++u)if(BD[VD][u].length>2)BD[VD][u][3]=D,BD[VD][u][4]=D;i2()}function i2(){if(clearTimeout(e1),e1=void 0,BD[VD].length===0)return;var D=BD[VD].shift(),u=D[0],F=D[1],C=D[2],$=D[3],w=D[4];if($===void 0)au("RETRY",u.name,F),u.apply(null,F);else if(Date.now()-$>=60000){au("TIMEOUT",u.name,F);var E=F.pop();if(typeof E==="function")E.call(null,C)}else{var Y=Date.now()-w,q=Math.max(w-$,1),W=Math.min(q*1.2,100);if(Y>=W)au("RETRY",u.name,F),u.apply(null,F.concat([$]));else BD[VD].push(D)}if(e1===void 0)e1=setTimeout(i2,0)}});var gD=h((r2)=>{var xC=AD().fromCallback,_D=W0(),VJ=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((D)=>{return typeof _D[D]==="function"});Object.assign(r2,_D);VJ.forEach((D)=>{r2[D]=xC(_D[D])});r2.exists=function(D,u){if(typeof u==="function")return _D.exists(D,u);return new Promise((F)=>{return _D.exists(D,F)})};r2.read=function(D,u,F,C,$,w){if(typeof w==="function")return _D.read(D,u,F,C,$,w);return new Promise((E,Y)=>{_D.read(D,u,F,C,$,(q,W,Z)=>{if(q)return Y(q);E({bytesRead:W,buffer:Z})})})};r2.write=function(D,u,...F){if(typeof F[F.length-1]==="function")return _D.write(D,u,...F);return new Promise((C,$)=>{_D.write(D,u,...F,(w,E,Y)=>{if(w)return $(w);C({bytesWritten:E,buffer:Y})})})};r2.readv=function(D,u,...F){if(typeof F[F.length-1]==="function")return _D.readv(D,u,...F);return new Promise((C,$)=>{_D.readv(D,u,...F,(w,E,Y)=>{if(w)return $(w);C({bytesRead:E,buffers:Y})})})};r2.writev=function(D,u,...F){if(typeof F[F.length-1]==="function")return _D.writev(D,u,...F);return new Promise((C,$)=>{_D.writev(D,u,...F,(w,E,Y)=>{if(w)return $(w);C({bytesWritten:E,buffers:Y})})})};if(typeof _D.realpath.native==="function")r2.realpath.native=xC(_D.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var fC=h((jJ,nC)=>{var PJ=FD("node:path");jJ.checkPath=function D(u){if(process.platform==="win32"){if(/[<>:"|?*]/.test(u.replace(PJ.parse(u).root,""))){let C=new Error(`Path contains invalid characters: ${u}`);throw C.code="EINVAL",C}}}});var rC=h((SJ,p2)=>{var dC=gD(),{checkPath:iC}=fC(),lC=(D)=>{let u={mode:511};if(typeof D==="number")return D;return{...u,...D}.mode};SJ.makeDir=async(D,u)=>{return iC(D),dC.mkdir(D,{mode:lC(u),recursive:!0})};SJ.makeDirSync=(D,u)=>{return iC(D),dC.mkdirSync(D,{mode:lC(u),recursive:!0})}});var qu=h((MU,pC)=>{var bJ=AD().fromPromise,{makeDir:mJ,makeDirSync:a2}=rC(),t2=bJ(mJ);pC.exports={mkdirs:t2,mkdirsSync:a2,mkdirp:t2,mkdirpSync:a2,ensureDir:t2,ensureDirSync:a2}});var vu=h((YU,tC)=>{var vJ=AD().fromPromise,aC=gD();function cJ(D){return aC.access(D).then(()=>!0).catch(()=>!1)}tC.exports={pathExists:vJ(cJ),pathExistsSync:aC.existsSync}});var o2=h((JU,oC)=>{var G0=gD(),xJ=AD().fromPromise;async function nJ(D,u,F){let C=await G0.open(D,"r+"),$=null;try{await G0.futimes(C,u,F)}finally{try{await G0.close(C)}catch(w){$=w}}if($)throw $}function fJ(D,u,F){let C=G0.openSync(D,"r+");return G0.futimesSync(C,u,F),G0.closeSync(C)}oC.exports={utimesMillis:xJ(nJ),utimesMillisSync:fJ}});var tu=h((qU,u4)=>{var z0=gD(),QD=FD("node:path"),sC=AD().fromPromise;function dJ(D,u,F){let C=F.dereference?($)=>z0.stat($,{bigint:!0}):($)=>z0.lstat($,{bigint:!0});return Promise.all([C(D),C(u).catch(($)=>{if($.code==="ENOENT")return null;throw $})]).then(([$,w])=>({srcStat:$,destStat:w}))}function iJ(D,u,F){let C,$=F.dereference?(E)=>z0.statSync(E,{bigint:!0}):(E)=>z0.lstatSync(E,{bigint:!0}),w=$(D);try{C=$(u)}catch(E){if(E.code==="ENOENT")return{srcStat:w,destStat:null};throw E}return{srcStat:w,destStat:C}}async function lJ(D,u,F,C){let{srcStat:$,destStat:w}=await dJ(D,u,C);if(w){if(p0($,w)){let E=QD.basename(D),Y=QD.basename(u);if(F==="move"&&E!==Y&&E.toLowerCase()===Y.toLowerCase())return{srcStat:$,destStat:w,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if($.isDirectory()&&!w.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${D}'.`);if(!$.isDirectory()&&w.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${D}'.`)}if($.isDirectory()&&s2(D,u))throw new Error(u8(D,u,F));return{srcStat:$,destStat:w}}function rJ(D,u,F,C){let{srcStat:$,destStat:w}=iJ(D,u,C);if(w){if(p0($,w)){let E=QD.basename(D),Y=QD.basename(u);if(F==="move"&&E!==Y&&E.toLowerCase()===Y.toLowerCase())return{srcStat:$,destStat:w,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if($.isDirectory()&&!w.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${D}'.`);if(!$.isDirectory()&&w.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${D}'.`)}if($.isDirectory()&&s2(D,u))throw new Error(u8(D,u,F));return{srcStat:$,destStat:w}}async function eC(D,u,F,C){let $=QD.resolve(QD.dirname(D)),w=QD.resolve(QD.dirname(F));if(w===$||w===QD.parse(w).root)return;let E;try{E=await z0.stat(w,{bigint:!0})}catch(Y){if(Y.code==="ENOENT")return;throw Y}if(p0(u,E))throw new Error(u8(D,F,C));return eC(D,u,w,C)}function D4(D,u,F,C){let $=QD.resolve(QD.dirname(D)),w=QD.resolve(QD.dirname(F));if(w===$||w===QD.parse(w).root)return;let E;try{E=z0.statSync(w,{bigint:!0})}catch(Y){if(Y.code==="ENOENT")return;throw Y}if(p0(u,E))throw new Error(u8(D,F,C));return D4(D,u,w,C)}function p0(D,u){return u.ino&&u.dev&&u.ino===D.ino&&u.dev===D.dev}function s2(D,u){let F=QD.resolve(D).split(QD.sep).filter(($)=>$),C=QD.resolve(u).split(QD.sep).filter(($)=>$);return F.every(($,w)=>C[w]===$)}function u8(D,u,F){return`Cannot ${F} '${D}' to a subdirectory of itself, '${u}'.`}u4.exports={checkPaths:sC(lJ),checkPathsSync:rJ,checkParentPaths:sC(eC),checkParentPathsSync:D4,isSrcSubdir:s2,areIdentical:p0}});var w4=h((ZU,E4)=>{var ID=gD(),a0=FD("node:path"),{mkdirs:pJ}=qu(),{pathExists:aJ}=vu(),{utimesMillis:tJ}=o2(),t0=tu();async function oJ(D,u,F={}){if(typeof F==="function")F={filter:F};if(F.clobber="clobber"in F?!!F.clobber:!0,F.overwrite="overwrite"in F?!!F.overwrite:F.clobber,F.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:C,destStat:$}=s0.checkPathsSync(D,u,"copy",F);if(s0.checkParentPathsSync(D,C,u,"copy"),F.filter&&!F.filter(D,u))return;let w=o0.dirname(u);if(!bD.existsSync(w))Cq(w);return B4($,D,u,F)}function B4(D,u,F,C){let w=(C.dereference?bD.statSync:bD.lstatSync)(u);if(w.isDirectory())return Zq(w,D,u,F,C);else if(w.isFile()||w.isCharacterDevice()||w.isBlockDevice())return wq(w,D,u,F,C);else if(w.isSymbolicLink())return Wq(D,u,F,C);else if(w.isSocket())throw new Error(`Cannot copy a socket file: ${u}`);else if(w.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${u}`);throw new Error(`Unknown file: ${u}`)}function wq(D,u,F,C,$){if(!u)return M4(D,F,C,$);return Bq(D,F,C,$)}function Bq(D,u,F,C){if(C.overwrite)return bD.unlinkSync(F),M4(D,u,F,C);else if(C.errorOnExist)throw new Error(`'${F}' already exists`)}function M4(D,u,F,C){if(bD.copyFileSync(u,F),C.preserveTimestamps)Mq(D.mode,u,F);return e2(F,D.mode)}function Mq(D,u,F){if(Yq(D))Jq(F,D);return qq(u,F)}function Yq(D){return(D&128)===0}function Jq(D,u){return e2(D,u|128)}function e2(D,u){return bD.chmodSync(D,u)}function qq(D,u){let F=bD.statSync(D);return $q(u,F.atime,F.mtime)}function Zq(D,u,F,C,$){if(!u)return Kq(D.mode,F,C,$);return Y4(F,C,$)}function Kq(D,u,F,C){return bD.mkdirSync(F),Y4(u,F,C),e2(F,D)}function Y4(D,u,F){let C=bD.opendirSync(D);try{let $;while(($=C.readSync())!==null)Xq($.name,D,u,F)}finally{C.closeSync()}}function Xq(D,u,F,C){let $=o0.join(u,D),w=o0.join(F,D);if(C.filter&&!C.filter($,w))return;let{destStat:E}=s0.checkPathsSync($,w,"copy",C);return B4(E,$,w,C)}function Wq(D,u,F,C){let $=bD.readlinkSync(u);if(C.dereference)$=o0.resolve(process.cwd(),$);if(!D)return bD.symlinkSync($,F);else{let w;try{w=bD.readlinkSync(F)}catch(E){if(E.code==="EINVAL"||E.code==="UNKNOWN")return bD.symlinkSync($,F);throw E}if(C.dereference)w=o0.resolve(process.cwd(),w);if(s0.isSrcSubdir($,w))throw new Error(`Cannot copy '${$}' to a subdirectory of itself, '${w}'.`);if(s0.isSrcSubdir(w,$))throw new Error(`Cannot overwrite '${w}' with '${$}'.`);return Gq($,F)}}function Gq(D,u){return bD.unlinkSync(u),bD.symlinkSync(D,u)}J4.exports=Eq});var F8=h((XU,Z4)=>{var zq=AD().fromPromise;Z4.exports={copy:zq(w4()),copySync:q4()}});var e0=h((WU,X4)=>{var K4=W0(),Aq=AD().fromCallback;function Qq(D,u){K4.rm(D,{recursive:!0,force:!0},u)}function Hq(D){K4.rmSync(D,{recursive:!0,force:!0})}X4.exports={remove:Aq(Qq),removeSync:Hq}});var y4=h((GU,U4)=>{var Uq=AD().fromPromise,z4=gD(),A4=FD("node:path"),Q4=qu(),H4=e0(),W4=Uq(async function D(u){let F;try{F=await z4.readdir(u)}catch{return Q4.mkdirs(u)}return Promise.all(F.map((C)=>H4.remove(A4.join(u,C))))});function G4(D){let u;try{u=z4.readdirSync(D)}catch{return Q4.mkdirsSync(D)}u.forEach((F)=>{F=A4.join(D,F),H4.removeSync(F)})}U4.exports={emptyDirSync:G4,emptydirSync:G4,emptyDir:W4,emptydir:W4}});var L4=h((zU,V4)=>{var yq=AD().fromPromise,O4=FD("node:path"),Pu=gD(),T4=qu();async function Oq(D){let u;try{u=await Pu.stat(D)}catch{}if(u&&u.isFile())return;let F=O4.dirname(D),C=null;try{C=await Pu.stat(F)}catch($){if($.code==="ENOENT"){await T4.mkdirs(F),await Pu.writeFile(D,"");return}else throw $}if(C.isDirectory())await Pu.writeFile(D,"");else await Pu.readdir(F)}function Tq(D){let u;try{u=Pu.statSync(D)}catch{}if(u&&u.isFile())return;let F=O4.dirname(D);try{if(!Pu.statSync(F).isDirectory())Pu.readdirSync(F)}catch(C){if(C&&C.code==="ENOENT")T4.mkdirsSync(F);else throw C}Pu.writeFileSync(D,"")}V4.exports={createFile:yq(Oq),createFileSync:Tq}});var P4=h((AU,R4)=>{var Vq=AD().fromPromise,N4=FD("node:path"),cu=gD(),h4=qu(),{pathExists:Lq}=vu(),{areIdentical:I4}=tu();async function Nq(D,u){let F;try{F=await cu.lstat(u)}catch{}let C;try{C=await cu.lstat(D)}catch(E){throw E.message=E.message.replace("lstat","ensureLink"),E}if(F&&I4(C,F))return;let $=N4.dirname(u);if(!await Lq($))await h4.mkdirs($);await cu.link(D,u)}function hq(D,u){let F;try{F=cu.lstatSync(u)}catch{}try{let w=cu.lstatSync(D);if(F&&I4(w,F))return}catch(w){throw w.message=w.message.replace("lstat","ensureLink"),w}let C=N4.dirname(u);if(cu.existsSync(C))return cu.linkSync(D,u);return h4.mkdirsSync(C),cu.linkSync(D,u)}R4.exports={createLink:Vq(Nq),createLinkSync:hq}});var k4=h((QU,j4)=>{var xu=FD("node:path"),D1=gD(),{pathExists:Iq}=vu(),Rq=AD().fromPromise;async function Pq(D,u){if(xu.isAbsolute(D)){try{await D1.lstat(D)}catch(w){throw w.message=w.message.replace("lstat","ensureSymlink"),w}return{toCwd:D,toDst:D}}let F=xu.dirname(u),C=xu.join(F,D);if(await Iq(C))return{toCwd:C,toDst:D};try{await D1.lstat(D)}catch(w){throw w.message=w.message.replace("lstat","ensureSymlink"),w}return{toCwd:D,toDst:xu.relative(F,D)}}function jq(D,u){if(xu.isAbsolute(D)){if(!D1.existsSync(D))throw new Error("absolute srcpath does not exist");return{toCwd:D,toDst:D}}let F=xu.dirname(u),C=xu.join(F,D);if(D1.existsSync(C))return{toCwd:C,toDst:D};if(!D1.existsSync(D))throw new Error("relative srcpath does not exist");return{toCwd:D,toDst:xu.relative(F,D)}}j4.exports={symlinkPaths:Rq(Pq),symlinkPathsSync:jq}});var g4=h((HU,_4)=>{var S4=gD(),kq=AD().fromPromise;async function Sq(D,u){if(u)return u;let F;try{F=await S4.lstat(D)}catch{return"file"}return F&&F.isDirectory()?"dir":"file"}function _q(D,u){if(u)return u;let F;try{F=S4.lstatSync(D)}catch{return"file"}return F&&F.isDirectory()?"dir":"file"}_4.exports={symlinkType:kq(Sq),symlinkTypeSync:_q}});var c4=h((UU,v4)=>{var gq=AD().fromPromise,b4=FD("node:path"),Hu=gD(),{mkdirs:bq,mkdirsSync:mq}=qu(),{symlinkPaths:vq,symlinkPathsSync:cq}=k4(),{symlinkType:xq,symlinkTypeSync:nq}=g4(),{pathExists:fq}=vu(),{areIdentical:m4}=tu();async function dq(D,u,F){let C;try{C=await Hu.lstat(u)}catch{}if(C&&C.isSymbolicLink()){let[Y,q]=await Promise.all([Hu.stat(D),Hu.stat(u)]);if(m4(Y,q))return}let $=await vq(D,u);D=$.toDst;let w=await xq($.toCwd,F),E=b4.dirname(u);if(!await fq(E))await bq(E);return Hu.symlink(D,u,w)}function iq(D,u,F){let C;try{C=Hu.lstatSync(u)}catch{}if(C&&C.isSymbolicLink()){let Y=Hu.statSync(D),q=Hu.statSync(u);if(m4(Y,q))return}let $=cq(D,u);D=$.toDst,F=nq($.toCwd,F);let w=b4.dirname(u);if(Hu.existsSync(w))return Hu.symlinkSync(D,u,F);return mq(w),Hu.symlinkSync(D,u,F)}v4.exports={createSymlink:gq(dq),createSymlinkSync:iq}});var p4=h((yU,r4)=>{var{createFile:x4,createFileSync:n4}=L4(),{createLink:f4,createLinkSync:d4}=P4(),{createSymlink:i4,createSymlinkSync:l4}=c4();r4.exports={createFile:x4,createFileSync:n4,ensureFile:x4,ensureFileSync:n4,createLink:f4,createLinkSync:d4,ensureLink:f4,ensureLinkSync:d4,createSymlink:i4,createSymlinkSync:l4,ensureSymlink:i4,ensureSymlinkSync:l4}});var C8=h((OU,a4)=>{function lq(D,{EOL:u=`
|
|
9
|
-
`,finalEOL:F=!0,replacer:C=null,spaces:$}={}){let w=F?u:"";return JSON.stringify(D,C,$).replace(/\n/g,u)+w}function rq(D){if(Buffer.isBuffer(D))D=D.toString("utf8");return D.replace(/^\uFEFF/,"")}a4.exports={stringify:lq,stripBom:rq}});var e4=h((TU,s4)=>{var A0;try{A0=W0()}catch(D){A0=FD("node:fs")}var $8=AD(),{stringify:t4,stripBom:o4}=C8();async function pq(D,u={}){if(typeof u==="string")u={encoding:u};let F=u.fs||A0,C="throws"in u?u.throws:!0,$=await $8.fromCallback(F.readFile)(D,u);$=o4($);let w;try{w=JSON.parse($,u?u.reviver:null)}catch(E){if(C)throw E.message=`${D}: ${E.message}`,E;else return null}return w}var aq=$8.fromPromise(pq);function tq(D,u={}){if(typeof u==="string")u={encoding:u};let F=u.fs||A0,C="throws"in u?u.throws:!0;try{let $=F.readFileSync(D,u);return $=o4($),JSON.parse($,u.reviver)}catch($){if(C)throw $.message=`${D}: ${$.message}`,$;else return null}}async function oq(D,u,F={}){let C=F.fs||A0,$=t4(u,F);await $8.fromCallback(C.writeFile)(D,$,F)}var sq=$8.fromPromise(oq);function eq(D,u,F={}){let C=F.fs||A0,$=t4(u,F);return C.writeFileSync(D,$,F)}var DZ={readFile:aq,readFileSync:tq,writeFile:sq,writeFileSync:eq};s4.exports=DZ});var u7=h((VU,D7)=>{var E8=e4();D7.exports={readJson:E8.readFile,readJsonSync:E8.readFileSync,writeJson:E8.writeFile,writeJsonSync:E8.writeFileSync}});var w8=h((LU,$7)=>{var uZ=AD().fromPromise,D3=gD(),F7=FD("node:path"),C7=qu(),FZ=vu().pathExists;async function CZ(D,u,F="utf-8"){let C=F7.dirname(D);if(!await FZ(C))await C7.mkdirs(C);return D3.writeFile(D,u,F)}function $Z(D,...u){let F=F7.dirname(D);if(!D3.existsSync(F))C7.mkdirsSync(F);D3.writeFileSync(D,...u)}$7.exports={outputFile:uZ(CZ),outputFileSync:$Z}});var w7=h((NU,E7)=>{var{stringify:EZ}=C8(),{outputFile:wZ}=w8();async function BZ(D,u,F={}){let C=EZ(u,F);await wZ(D,C,F)}E7.exports=BZ});var M7=h((hU,B7)=>{var{stringify:MZ}=C8(),{outputFileSync:YZ}=w8();function JZ(D,u,F){let C=MZ(u,F);YZ(D,C,F)}B7.exports=JZ});var J7=h((IU,Y7)=>{var qZ=AD().fromPromise,mD=u7();mD.outputJson=qZ(w7());mD.outputJsonSync=M7();mD.outputJSON=mD.outputJson;mD.outputJSONSync=mD.outputJsonSync;mD.writeJSON=mD.writeJson;mD.writeJSONSync=mD.writeJsonSync;mD.readJSON=mD.readJson;mD.readJSONSync=mD.readJsonSync;Y7.exports=mD});var W7=h((RU,X7)=>{var ZZ=gD(),q7=FD("node:path"),{copy:KZ}=F8(),{remove:K7}=e0(),{mkdirp:XZ}=qu(),{pathExists:WZ}=vu(),Z7=tu();async function GZ(D,u,F={}){let C=F.overwrite||F.clobber||!1,{srcStat:$,isChangingCase:w=!1}=await Z7.checkPaths(D,u,"move",F);await Z7.checkParentPaths(D,$,u,"move");let E=q7.dirname(u);if(q7.parse(E).root!==E)await XZ(E);return zZ(D,u,C,w)}async function zZ(D,u,F,C){if(!C){if(F)await K7(u);else if(await WZ(u))throw new Error("dest already exists.")}try{await ZZ.rename(D,u)}catch($){if($.code!=="EXDEV")throw $;await AZ(D,u,F)}}async function AZ(D,u,F){return await KZ(D,u,{overwrite:F,errorOnExist:!0,preserveTimestamps:!0}),K7(D)}X7.exports=GZ});var H7=h((PU,Q7)=>{var z7=W0(),F3=FD("node:path"),QZ=F8().copySync,A7=e0().removeSync,HZ=qu().mkdirpSync,G7=tu();function UZ(D,u,F){F=F||{};let C=F.overwrite||F.clobber||!1,{srcStat:$,isChangingCase:w=!1}=G7.checkPathsSync(D,u,"move",F);if(G7.checkParentPathsSync(D,$,u,"move"),!yZ(u))HZ(F3.dirname(u));return OZ(D,u,C,w)}function yZ(D){let u=F3.dirname(D);return F3.parse(u).root===u}function OZ(D,u,F,C){if(C)return u3(D,u,F);if(F)return A7(u),u3(D,u,F);if(z7.existsSync(u))throw new Error("dest already exists.");return u3(D,u,F)}function u3(D,u,F){try{z7.renameSync(D,u)}catch(C){if(C.code!=="EXDEV")throw C;return TZ(D,u,F)}}function TZ(D,u,F){return QZ(D,u,{overwrite:F,errorOnExist:!0,preserveTimestamps:!0}),A7(D)}Q7.exports=UZ});var y7=h((jU,U7)=>{var VZ=AD().fromPromise;U7.exports={move:VZ(W7()),moveSync:H7()}});var T7=h((kU,O7)=>{O7.exports={...gD(),...F8(),...y4(),...p4(),...J7(),...qu(),...y7(),...w8(),...vu(),...e0()}});var X$={};xE(X$,{prompt:()=>K$,kCancel:()=>Z$});import Ku,{stdin as $K,stdout as EK}from"node:process";import d7 from"node:readline";import{WriteStream as wK}from"node:tty";function BK(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function MK(){if(i7)return Z3;i7=1;let D="\x1B",u=`${D}[`,F="\x07",C={to(E,Y){if(!Y)return`${u}${E+1}G`;return`${u}${Y+1};${E+1}H`},move(E,Y){let q="";if(E<0)q+=`${u}${-E}D`;else if(E>0)q+=`${u}${E}C`;if(Y<0)q+=`${u}${-Y}A`;else if(Y>0)q+=`${u}${Y}B`;return q},up:(E=1)=>`${u}${E}A`,down:(E=1)=>`${u}${E}B`,forward:(E=1)=>`${u}${E}C`,backward:(E=1)=>`${u}${E}D`,nextLine:(E=1)=>`${u}E`.repeat(E),prevLine:(E=1)=>`${u}F`.repeat(E),left:`${u}G`,hide:`${u}?25l`,show:`${u}?25h`,save:`${D}7`,restore:`${D}8`},$={up:(E=1)=>`${u}S`.repeat(E),down:(E=1)=>`${u}T`.repeat(E)},w={screen:`${u}2J`,up:(E=1)=>`${u}1J`.repeat(E),down:(E=1)=>`${u}J`.repeat(E),line:`${u}2K`,lineEnd:`${u}K`,lineStart:`${u}1K`,lines(E){let Y="";for(let q=0;q<E;q++)Y+=this.line+(q<E-1?C.up():"");if(E)Y+=C.left;return Y}};return Z3={cursor:C,scroll:$,erase:w,beep:F},Z3}function YK(){if(l7)return J8.exports;l7=1;let D=process||{},u=D.argv||[],F=D.env||{},C=!(!!F.NO_COLOR||u.includes("--no-color"))&&(!!F.FORCE_COLOR||u.includes("--color")||D.platform==="win32"||(D.stdout||{}).isTTY&&F.TERM!=="dumb"||!!F.CI),$=(Y,q,W=Y)=>(Z)=>{let G=""+Z,A=G.indexOf(q,Y.length);return~A?Y+w(G,q,W,A)+q:Y+G+q},w=(Y,q,W,Z)=>{let G="",A=0;do G+=Y.substring(A,Z)+W,A=Z+q.length,Z=Y.indexOf(q,A);while(~Z);return G+Y.substring(A)},E=(Y=C)=>{let q=Y?$:()=>String;return{isColorSupported:Y,reset:q("\x1B[0m","\x1B[0m"),bold:q("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:q("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:q("\x1B[3m","\x1B[23m"),underline:q("\x1B[4m","\x1B[24m"),inverse:q("\x1B[7m","\x1B[27m"),hidden:q("\x1B[8m","\x1B[28m"),strikethrough:q("\x1B[9m","\x1B[29m"),black:q("\x1B[30m","\x1B[39m"),red:q("\x1B[31m","\x1B[39m"),green:q("\x1B[32m","\x1B[39m"),yellow:q("\x1B[33m","\x1B[39m"),blue:q("\x1B[34m","\x1B[39m"),magenta:q("\x1B[35m","\x1B[39m"),cyan:q("\x1B[36m","\x1B[39m"),white:q("\x1B[37m","\x1B[39m"),gray:q("\x1B[90m","\x1B[39m"),bgBlack:q("\x1B[40m","\x1B[49m"),bgRed:q("\x1B[41m","\x1B[49m"),bgGreen:q("\x1B[42m","\x1B[49m"),bgYellow:q("\x1B[43m","\x1B[49m"),bgBlue:q("\x1B[44m","\x1B[49m"),bgMagenta:q("\x1B[45m","\x1B[49m"),bgCyan:q("\x1B[46m","\x1B[49m"),bgWhite:q("\x1B[47m","\x1B[49m"),blackBright:q("\x1B[90m","\x1B[39m"),redBright:q("\x1B[91m","\x1B[39m"),greenBright:q("\x1B[92m","\x1B[39m"),yellowBright:q("\x1B[93m","\x1B[39m"),blueBright:q("\x1B[94m","\x1B[39m"),magentaBright:q("\x1B[95m","\x1B[39m"),cyanBright:q("\x1B[96m","\x1B[39m"),whiteBright:q("\x1B[97m","\x1B[39m"),bgBlackBright:q("\x1B[100m","\x1B[49m"),bgRedBright:q("\x1B[101m","\x1B[49m"),bgGreenBright:q("\x1B[102m","\x1B[49m"),bgYellowBright:q("\x1B[103m","\x1B[49m"),bgBlueBright:q("\x1B[104m","\x1B[49m"),bgMagentaBright:q("\x1B[105m","\x1B[49m"),bgCyanBright:q("\x1B[106m","\x1B[49m"),bgWhiteBright:q("\x1B[107m","\x1B[49m")}};return J8.exports=E(),J8.exports.createColors=E,J8.exports}function qK({onlyFirst:D=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(u,D?void 0:"g")}function C$(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(ZK,"")}function $$(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function F1(D,u={}){if(typeof D!="string"||D.length===0||(u={ambiguousIsNarrow:!0,...u},D=C$(D),D.length===0))return 0;D=D.replace(GK()," ");let F=u.ambiguousIsNarrow?1:2,C=0;for(let $ of D){let w=$.codePointAt(0);if(w<=31||w>=127&&w<=159||w>=768&&w<=879)continue;switch(XK.eastAsianWidth($)){case"F":case"W":C+=2;break;case"A":C+=F;break;default:C+=1}}return C}function QK(){let D=new Map;for(let[u,F]of Object.entries(ED)){for(let[C,$]of Object.entries(F))ED[C]={open:`\x1B[${$[0]}m`,close:`\x1B[${$[1]}m`},F[C]=ED[C],D.set($[0],$[1]);Object.defineProperty(ED,u,{value:F,enumerable:!1})}return Object.defineProperty(ED,"codes",{value:D,enumerable:!1}),ED.color.close="\x1B[39m",ED.bgColor.close="\x1B[49m",ED.color.ansi=r7(),ED.color.ansi256=p7(),ED.color.ansi16m=a7(),ED.bgColor.ansi=r7(K3),ED.bgColor.ansi256=p7(K3),ED.bgColor.ansi16m=a7(K3),Object.defineProperties(ED,{rgbToAnsi256:{value:(u,F,C)=>u===F&&F===C?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(C/255*5),enumerable:!1},hexToRgb:{value:(u)=>{let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[C]=F;C.length===3&&(C=[...C].map((w)=>w+w).join(""));let $=Number.parseInt(C,16);return[$>>16&255,$>>8&255,$&255]},enumerable:!1},hexToAnsi256:{value:(u)=>ED.rgbToAnsi256(...ED.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:(u)=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,C,$;if(u>=232)F=((u-232)*10+8)/255,C=F,$=F;else{u-=16;let Y=u%36;F=Math.floor(u/36)/5,C=Math.floor(Y/6)/5,$=Y%6/5}let w=Math.max(F,C,$)*2;if(w===0)return 30;let E=30+(Math.round($)<<2|Math.round(C)<<1|Math.round(F));return w===2&&(E+=60),E},enumerable:!1},rgbToAnsi:{value:(u,F,C)=>ED.ansi256ToAnsi(ED.rgbToAnsi256(u,F,C)),enumerable:!1},hexToAnsi:{value:(u)=>ED.ansi256ToAnsi(ED.hexToAnsi256(u)),enumerable:!1}}),ED}function s7(D,u,F){return String(D).normalize().replace(/\r\n/g,`
|
|
10
|
-
`).split(`
|
|
11
|
-
`).map((C)=>VK(C,u,F)).join(`
|
|
12
|
-
`)}function M$(D,u){if(typeof D=="string")return Z8.aliases.get(D)===u;for(let F of D)if(F!==void 0&&M$(F,u))return!0;return!1}function NK(D,u){if(D===u)return;let F=D.split(`
|
|
13
|
-
`),C=u.split(`
|
|
14
|
-
`),$=[];for(let w=0;w<Math.max(F.length,C.length);w++)F[w]!==C[w]&&$.push(w);return $}function q8(D,u){let F=D;F.isTTY&&F.setRawMode(u)}class C1{constructor(D,u=!0){sD(this,"input"),sD(this,"output"),sD(this,"_abortSignal"),sD(this,"rl"),sD(this,"opts"),sD(this,"_render"),sD(this,"_track",!1),sD(this,"_prevFrame",""),sD(this,"_subscribers",new Map),sD(this,"_cursor",0),sD(this,"state","initial"),sD(this,"error",""),sD(this,"value");let{input:F=$K,output:C=EK,render:$,signal:w,...E}=D;this.opts=E,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=$.bind(this),this._track=u,this._abortSignal=w,this.input=F,this.output=C}unsubscribe(){this._subscribers.clear()}setSubscriber(D,u){let F=this._subscribers.get(D)??[];F.push(u),this._subscribers.set(D,F)}on(D,u){this.setSubscriber(D,{cb:u})}once(D,u){this.setSubscriber(D,{cb:u,once:!0})}emit(D,...u){let F=this._subscribers.get(D)??[],C=[];for(let $ of F)$.cb(...u),$.once&&C.push(()=>F.splice(F.indexOf($),1));for(let $ of C)$()}prompt(){return new Promise((D,u)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(e7);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let F=new wK(0);F._write=(C,$,w)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),w()},this.input.pipe(F),this.rl=d7.createInterface({input:this.input,output:F,tabSize:2,prompt:"",escapeCodeTimeout:50}),d7.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),q8(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Xu.cursor.show),this.output.off("resize",this.render),q8(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(Xu.cursor.show),this.output.off("resize",this.render),q8(this.input,!1),D(e7)})})}onKeypress(D,u){if(this.state==="error"&&(this.state="active"),u?.name&&(!this._track&&Z8.aliases.has(u.name)&&this.emit("cursor",Z8.aliases.get(u.name)),Z8.actions.has(u.name)&&this.emit("cursor",u.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),D==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),D&&this.emit("key",D.toLowerCase()),u?.name==="return"){if(this.opts.validate){let F=this.opts.validate(this.value);F&&(this.error=F instanceof Error?F.message:F,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}M$([D,u?.name,u?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
15
|
-
`),q8(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let D=s7(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
16
|
-
`).length-1;this.output.write(Xu.cursor.move(-999,D*-1))}render(){let D=s7(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(Xu.cursor.hide);else{let u=NK(this._prevFrame,D);if(this.restoreCursor(),u&&u?.length===1){let F=u[0];this.output.write(Xu.cursor.move(0,F)),this.output.write(Xu.erase.lines(1));let C=D.split(`
|
|
17
|
-
`);this.output.write(C[F]),this._prevFrame=D,this.output.write(Xu.cursor.move(0,C.length-F-1));return}if(u&&u?.length>1){let F=u[0];this.output.write(Xu.cursor.move(0,F)),this.output.write(Xu.erase.down());let C=D.split(`
|
|
18
|
-
`).slice(F);this.output.write(C.join(`
|
|
19
|
-
`)),this._prevFrame=D;return}this.output.write(Xu.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}}function _K(){return Ku.platform!=="win32"?Ku.env.TERM!=="linux":!!Ku.env.CI||!!Ku.env.WT_SESSION||!!Ku.env.TERMINUS_SUBLIME||Ku.env.ConEmuTask==="{cmd::Cmder}"||Ku.env.TERM_PROGRAM==="Terminus-Sublime"||Ku.env.TERM_PROGRAM==="vscode"||Ku.env.TERM==="xterm-256color"||Ku.env.TERM==="alacritty"||Ku.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function K$(D,u={}){let F=(C)=>{if(typeof C!=="symbol"||C.toString()!=="Symbol(clack:cancel)")return C;switch(u.cancel){case"reject":{let $=new Error("Prompt cancelled.");if($.name="ConsolaPromptCancelledError",Error.captureStackTrace)Error.captureStackTrace($,K$);throw $}case"undefined":return;case"null":return null;case"symbol":return Z$;default:case"default":return u.default??u.initial}};if(!u.type||u.type==="text")return await fK({message:D,defaultValue:u.default,placeholder:u.placeholder,initialValue:u.initial}).then(F);if(u.type==="confirm")return await dK({message:D,initialValue:u.initial}).then(F);if(u.type==="select")return await iK({message:D,options:u.options.map((C)=>typeof C==="string"?{value:C,label:C}:C),initialValue:u.initial}).then(F);if(u.type==="multiselect")return await lK({message:D,options:u.options.map((C)=>typeof C==="string"?{value:C,label:C}:C),required:u.required,initialValues:u.initial}).then(F);throw new Error(`Unknown prompt type: ${u.type}`)}var Z3,i7,Xu,J8,l7,JK,L,ZK,E$,KK,XK,WK=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},GK,K3=10,r7=(D=0)=>(u)=>`\x1B[${u+D}m`,p7=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,a7=(D=0)=>(u,F,C)=>`\x1B[${38+D};2;${u};${F};${C}m`,ED,zK,AK,HK,K8,UK=39,A3="\x07",w$="[",yK="]",B$="m",Q3,t7=(D)=>`${K8.values().next().value}${w$}${D}${B$}`,o7=(D)=>`${K8.values().next().value}${Q3}${D}${A3}`,OK=(D)=>D.split(" ").map((u)=>F1(u)),X3=(D,u,F)=>{let C=[...u],$=!1,w=!1,E=F1(C$(D[D.length-1]));for(let[Y,q]of C.entries()){let W=F1(q);if(E+W<=F?D[D.length-1]+=q:(D.push(q),E=0),K8.has(q)&&($=!0,w=C.slice(Y+1).join("").startsWith(Q3)),$){w?q===A3&&($=!1,w=!1):q===B$&&($=!1);continue}E+=W,E===F&&Y<C.length-1&&(D.push(""),E=0)}!E&&D[D.length-1].length>0&&D.length>1&&(D[D.length-2]+=D.pop())},TK=(D)=>{let u=D.split(" "),F=u.length;for(;F>0&&!(F1(u[F-1])>0);)F--;return F===u.length?D:u.slice(0,F).join(" ")+u.slice(F).join("")},VK=(D,u,F={})=>{if(F.trim!==!1&&D.trim()==="")return"";let C="",$,w,E=OK(D),Y=[""];for(let[W,Z]of D.split(" ").entries()){F.trim!==!1&&(Y[Y.length-1]=Y[Y.length-1].trimStart());let G=F1(Y[Y.length-1]);if(W!==0&&(G>=u&&(F.wordWrap===!1||F.trim===!1)&&(Y.push(""),G=0),(G>0||F.trim===!1)&&(Y[Y.length-1]+=" ",G++)),F.hard&&E[W]>u){let A=u-G,z=1+Math.floor((E[W]-A-1)/u);Math.floor((E[W]-1)/u)<z&&Y.push(""),X3(Y,Z,u);continue}if(G+E[W]>u&&G>0&&E[W]>0){if(F.wordWrap===!1&&G<u){X3(Y,Z,u);continue}Y.push("")}if(G+E[W]>u&&F.wordWrap===!1){X3(Y,Z,u);continue}Y[Y.length-1]+=Z}F.trim!==!1&&(Y=Y.map((W)=>TK(W)));let q=[...Y.join(`
|
|
20
|
-
`)];for(let[W,Z]of q.entries()){if(C+=Z,K8.has(Z)){let{groups:A}=new RegExp(`(?:\\${w$}(?<code>\\d+)m|\\${Q3}(?<uri>.*)${A3})`).exec(q.slice(W).join(""))||{groups:{}};if(A.code!==void 0){let z=Number.parseFloat(A.code);$=z===UK?void 0:z}else A.uri!==void 0&&(w=A.uri.length===0?void 0:A.uri)}let G=HK.codes.get(Number($));q[W+1]===`
|
|
21
|
-
`?(w&&(C+=o7("")),$&&G&&(C+=t7(G))):Z===`
|
|
22
|
-
`&&($&&G&&(C+=t7($)),w&&(C+=o7(w)))}return C},LK,Z8,e7,hK,IK=(D,u,F)=>(u in D)?hK(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,sD=(D,u,F)=>(IK(D,typeof u!="symbol"?u+"":u,F),F),Y$,RK,PK=(D,u,F)=>(u in D)?RK(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,D$=(D,u,F)=>(PK(D,typeof u!="symbol"?u+"":u,F),F),jK,kK,SK=(D,u,F)=>(u in D)?kK(D,u,{enumerable:!0,configurable:!0,writable:!0,value:F}):D[u]=F,u$=(D,u,F)=>(SK(D,typeof u!="symbol"?u+"":u,F),F),J$,q$,gK,Wu=(D,u)=>gK?D:u,bK,mK,vK,cK,s,Q0,W3,G3,xK,F$,nK,X8=(D)=>{switch(D){case"initial":case"active":return L.cyan(bK);case"cancel":return L.red(mK);case"error":return L.yellow(vK);case"submit":return L.green(cK)}},z3=(D)=>{let{cursor:u,options:F,style:C}=D,$=D.maxItems??Number.POSITIVE_INFINITY,w=Math.max(process.stdout.rows-4,0),E=Math.min(w,Math.max($,5)),Y=0;u>=Y+E-3?Y=Math.max(Math.min(u-E+3,F.length-E),0):u<Y+2&&(Y=Math.max(u-2,0));let q=E<F.length&&Y>0,W=E<F.length&&Y+E<F.length;return F.slice(Y,Y+E).map((Z,G,A)=>{let z=G===0&&q,X=G===A.length-1&&W;return z||X?L.dim("..."):C(Z,G+Y===u)})},fK=(D)=>new q$({validate:D.validate,placeholder:D.placeholder,defaultValue:D.defaultValue,initialValue:D.initialValue,render(){let u=`${L.gray(s)}
|
|
23
|
-
${X8(this.state)} ${D.message}
|
|
24
|
-
`,F=D.placeholder?L.inverse(D.placeholder[0])+L.dim(D.placeholder.slice(1)):L.inverse(L.hidden("_")),C=this.value?this.valueWithCursor:F;switch(this.state){case"error":return`${u.trim()}
|
|
25
|
-
${L.yellow(s)} ${C}
|
|
26
|
-
${L.yellow(Q0)} ${L.yellow(this.error)}
|
|
27
|
-
`;case"submit":return`${u}${L.gray(s)} ${L.dim(this.value||D.placeholder)}`;case"cancel":return`${u}${L.gray(s)} ${L.strikethrough(L.dim(this.value??""))}${this.value?.trim()?`
|
|
28
|
-
${L.gray(s)}`:""}`;default:return`${u}${L.cyan(s)} ${C}
|
|
29
|
-
${L.cyan(Q0)}
|
|
30
|
-
`}}}).prompt(),dK=(D)=>{let u=D.active??"Yes",F=D.inactive??"No";return new Y$({active:u,inactive:F,initialValue:D.initialValue??!0,render(){let C=`${L.gray(s)}
|
|
31
|
-
${X8(this.state)} ${D.message}
|
|
32
|
-
`,$=this.value?u:F;switch(this.state){case"submit":return`${C}${L.gray(s)} ${L.dim($)}`;case"cancel":return`${C}${L.gray(s)} ${L.strikethrough(L.dim($))}
|
|
33
|
-
${L.gray(s)}`;default:return`${C}${L.cyan(s)} ${this.value?`${L.green(W3)} ${u}`:`${L.dim(G3)} ${L.dim(u)}`} ${L.dim("/")} ${this.value?`${L.dim(G3)} ${L.dim(F)}`:`${L.green(W3)} ${F}`}
|
|
34
|
-
${L.cyan(Q0)}
|
|
35
|
-
`}}}).prompt()},iK=(D)=>{let u=(F,C)=>{let $=F.label??String(F.value);switch(C){case"selected":return`${L.dim($)}`;case"active":return`${L.green(W3)} ${$} ${F.hint?L.dim(`(${F.hint})`):""}`;case"cancelled":return`${L.strikethrough(L.dim($))}`;default:return`${L.dim(G3)} ${L.dim($)}`}};return new J$({options:D.options,initialValue:D.initialValue,render(){let F=`${L.gray(s)}
|
|
36
|
-
${X8(this.state)} ${D.message}
|
|
37
|
-
`;switch(this.state){case"submit":return`${F}${L.gray(s)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${F}${L.gray(s)} ${u(this.options[this.cursor],"cancelled")}
|
|
38
|
-
${L.gray(s)}`;default:return`${F}${L.cyan(s)} ${z3({cursor:this.cursor,options:this.options,maxItems:D.maxItems,style:(C,$)=>u(C,$?"active":"inactive")}).join(`
|
|
39
|
-
${L.cyan(s)} `)}
|
|
40
|
-
${L.cyan(Q0)}
|
|
41
|
-
`}}}).prompt()},lK=(D)=>{let u=(F,C)=>{let $=F.label??String(F.value);return C==="active"?`${L.cyan(xK)} ${$} ${F.hint?L.dim(`(${F.hint})`):""}`:C==="selected"?`${L.green(F$)} ${L.dim($)}`:C==="cancelled"?`${L.strikethrough(L.dim($))}`:C==="active-selected"?`${L.green(F$)} ${$} ${F.hint?L.dim(`(${F.hint})`):""}`:C==="submitted"?`${L.dim($)}`:`${L.dim(nK)} ${L.dim($)}`};return new jK({options:D.options,initialValues:D.initialValues,required:D.required??!0,cursorAt:D.cursorAt,validate(F){if(this.required&&F.length===0)return`Please select at least one option.
|
|
42
|
-
${L.reset(L.dim(`Press ${L.gray(L.bgWhite(L.inverse(" space ")))} to select, ${L.gray(L.bgWhite(L.inverse(" enter ")))} to submit`))}`},render(){let F=`${L.gray(s)}
|
|
43
|
-
${X8(this.state)} ${D.message}
|
|
44
|
-
`,C=($,w)=>{let E=this.value.includes($.value);return w&&E?u($,"active-selected"):E?u($,"selected"):u($,w?"active":"inactive")};switch(this.state){case"submit":return`${F}${L.gray(s)} ${this.options.filter(({value:$})=>this.value.includes($)).map(($)=>u($,"submitted")).join(L.dim(", "))||L.dim("none")}`;case"cancel":{let $=this.options.filter(({value:w})=>this.value.includes(w)).map((w)=>u(w,"cancelled")).join(L.dim(", "));return`${F}${L.gray(s)} ${$.trim()?`${$}
|
|
45
|
-
${L.gray(s)}`:""}`}case"error":{let $=this.error.split(`
|
|
46
|
-
`).map((w,E)=>E===0?`${L.yellow(Q0)} ${L.yellow(w)}`:` ${w}`).join(`
|
|
47
|
-
`);return`${F+L.yellow(s)} ${z3({options:this.options,cursor:this.cursor,maxItems:D.maxItems,style:C}).join(`
|
|
48
|
-
${L.yellow(s)} `)}
|
|
49
|
-
${$}
|
|
50
|
-
`}default:return`${F}${L.cyan(s)} ${z3({options:this.options,cursor:this.cursor,maxItems:D.maxItems,style:C}).join(`
|
|
51
|
-
${L.cyan(s)} `)}
|
|
52
|
-
${L.cyan(Q0)}
|
|
53
|
-
`}}}).prompt()},Z$;var W$=nE(()=>{Xu=MK(),J8={exports:{}};JK=YK(),L=BK(JK);ZK=qK();E$={exports:{}};(function(D){var u={};D.exports=u,u.eastAsianWidth=function(C){var $=C.charCodeAt(0),w=C.length==2?C.charCodeAt(1):0,E=$;return 55296<=$&&$<=56319&&56320<=w&&w<=57343&&($&=1023,w&=1023,E=$<<10|w,E+=65536),E==12288||65281<=E&&E<=65376||65504<=E&&E<=65510?"F":E==8361||65377<=E&&E<=65470||65474<=E&&E<=65479||65482<=E&&E<=65487||65490<=E&&E<=65495||65498<=E&&E<=65500||65512<=E&&E<=65518?"H":4352<=E&&E<=4447||4515<=E&&E<=4519||4602<=E&&E<=4607||9001<=E&&E<=9002||11904<=E&&E<=11929||11931<=E&&E<=12019||12032<=E&&E<=12245||12272<=E&&E<=12283||12289<=E&&E<=12350||12353<=E&&E<=12438||12441<=E&&E<=12543||12549<=E&&E<=12589||12593<=E&&E<=12686||12688<=E&&E<=12730||12736<=E&&E<=12771||12784<=E&&E<=12830||12832<=E&&E<=12871||12880<=E&&E<=13054||13056<=E&&E<=19903||19968<=E&&E<=42124||42128<=E&&E<=42182||43360<=E&&E<=43388||44032<=E&&E<=55203||55216<=E&&E<=55238||55243<=E&&E<=55291||63744<=E&&E<=64255||65040<=E&&E<=65049||65072<=E&&E<=65106||65108<=E&&E<=65126||65128<=E&&E<=65131||110592<=E&&E<=110593||127488<=E&&E<=127490||127504<=E&&E<=127546||127552<=E&&E<=127560||127568<=E&&E<=127569||131072<=E&&E<=194367||177984<=E&&E<=196605||196608<=E&&E<=262141?"W":32<=E&&E<=126||162<=E&&E<=163||165<=E&&E<=166||E==172||E==175||10214<=E&&E<=10221||10629<=E&&E<=10630?"Na":E==161||E==164||167<=E&&E<=168||E==170||173<=E&&E<=174||176<=E&&E<=180||182<=E&&E<=186||188<=E&&E<=191||E==198||E==208||215<=E&&E<=216||222<=E&&E<=225||E==230||232<=E&&E<=234||236<=E&&E<=237||E==240||242<=E&&E<=243||247<=E&&E<=250||E==252||E==254||E==257||E==273||E==275||E==283||294<=E&&E<=295||E==299||305<=E&&E<=307||E==312||319<=E&&E<=322||E==324||328<=E&&E<=331||E==333||338<=E&&E<=339||358<=E&&E<=359||E==363||E==462||E==464||E==466||E==468||E==470||E==472||E==474||E==476||E==593||E==609||E==708||E==711||713<=E&&E<=715||E==717||E==720||728<=E&&E<=731||E==733||E==735||768<=E&&E<=879||913<=E&&E<=929||931<=E&&E<=937||945<=E&&E<=961||963<=E&&E<=969||E==1025||1040<=E&&E<=1103||E==1105||E==8208||8211<=E&&E<=8214||8216<=E&&E<=8217||8220<=E&&E<=8221||8224<=E&&E<=8226||8228<=E&&E<=8231||E==8240||8242<=E&&E<=8243||E==8245||E==8251||E==8254||E==8308||E==8319||8321<=E&&E<=8324||E==8364||E==8451||E==8453||E==8457||E==8467||E==8470||8481<=E&&E<=8482||E==8486||E==8491||8531<=E&&E<=8532||8539<=E&&E<=8542||8544<=E&&E<=8555||8560<=E&&E<=8569||E==8585||8592<=E&&E<=8601||8632<=E&&E<=8633||E==8658||E==8660||E==8679||E==8704||8706<=E&&E<=8707||8711<=E&&E<=8712||E==8715||E==8719||E==8721||E==8725||E==8730||8733<=E&&E<=8736||E==8739||E==8741||8743<=E&&E<=8748||E==8750||8756<=E&&E<=8759||8764<=E&&E<=8765||E==8776||E==8780||E==8786||8800<=E&&E<=8801||8804<=E&&E<=8807||8810<=E&&E<=8811||8814<=E&&E<=8815||8834<=E&&E<=8835||8838<=E&&E<=8839||E==8853||E==8857||E==8869||E==8895||E==8978||9312<=E&&E<=9449||9451<=E&&E<=9547||9552<=E&&E<=9587||9600<=E&&E<=9615||9618<=E&&E<=9621||9632<=E&&E<=9633||9635<=E&&E<=9641||9650<=E&&E<=9651||9654<=E&&E<=9655||9660<=E&&E<=9661||9664<=E&&E<=9665||9670<=E&&E<=9672||E==9675||9678<=E&&E<=9681||9698<=E&&E<=9701||E==9711||9733<=E&&E<=9734||E==9737||9742<=E&&E<=9743||9748<=E&&E<=9749||E==9756||E==9758||E==9792||E==9794||9824<=E&&E<=9825||9827<=E&&E<=9829||9831<=E&&E<=9834||9836<=E&&E<=9837||E==9839||9886<=E&&E<=9887||9918<=E&&E<=9919||9924<=E&&E<=9933||9935<=E&&E<=9953||E==9955||9960<=E&&E<=9983||E==10045||E==10071||10102<=E&&E<=10111||11093<=E&&E<=11097||12872<=E&&E<=12879||57344<=E&&E<=63743||65024<=E&&E<=65039||E==65533||127232<=E&&E<=127242||127248<=E&&E<=127277||127280<=E&&E<=127337||127344<=E&&E<=127386||917760<=E&&E<=917999||983040<=E&&E<=1048573||1048576<=E&&E<=1114109?"A":"N"},u.characterLength=function(C){var $=this.eastAsianWidth(C);return $=="F"||$=="W"||$=="A"?2:1};function F(C){return C.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(C){for(var $=F(C),w=0,E=0;E<$.length;E++)w=w+this.characterLength($[E]);return w},u.slice=function(C,$,w){textLen=u.length(C),$=$||0,w=w||1,$<0&&($=textLen+$),w<0&&(w=textLen+w);for(var E="",Y=0,q=F(C),W=0;W<q.length;W++){var Z=q[W],G=u.length(Z);if(Y>=$-(G==2?1:0))if(Y+G<=w)E+=Z;else break;Y+=G}return E}})(E$);KK=E$.exports,XK=$$(KK),GK=$$(WK);ED={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(ED.modifier);zK=Object.keys(ED.color),AK=Object.keys(ED.bgColor);[...zK];HK=QK(),K8=new Set(["\x1B","\x9B"]),Q3=`${yK}8;;`;LK=["up","down","left","right","space","enter","cancel"],Z8={actions:new Set(LK),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");e7=Symbol("clack:cancel");hK=Object.defineProperty;Y$=class Y$ extends C1{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(u)=>{this.output.write(Xu.cursor.move(0,-1)),this.value=u,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};RK=Object.defineProperty,jK=class extends C1{constructor(D){super(D,!1),D$(this,"options"),D$(this,"cursor",0),this.options=D.options,this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:u})=>u===D.cursorAt),0),this.on("key",(u)=>{u==="a"&&this.toggleAll()}),this.on("cursor",(u)=>{switch(u){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let D=this.value.length===this.options.length;this.value=D?[]:this.options.map((u)=>u.value)}toggleValue(){let D=this.value.includes(this._value);this.value=D?this.value.filter((u)=>u!==this._value):[...this.value,this._value]}},kK=Object.defineProperty;J$=class J$ extends C1{constructor(D){super(D,!1),u$(this,"options"),u$(this,"cursor",0),this.options=D.options,this.cursor=this.options.findIndex(({value:u})=>u===D.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(u)=>{switch(u){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};q$=class q$ extends C1{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let D=this.value.slice(0,this.cursor),[u,...F]=this.value.slice(this.cursor);return`${D}${L.inverse(u)}${F.join("")}`}get cursor(){return this._cursor}constructor(D){super(D),this.on("finalize",()=>{this.value||(this.value=D.defaultValue)})}};gK=_K(),bK=Wu("\u276F",">"),mK=Wu("\u25A0","x"),vK=Wu("\u25B2","x"),cK=Wu("\u2714","\u221A"),s=Wu(""),Q0=Wu(""),W3=Wu("\u25CF",">"),G3=Wu("\u25CB"," "),xK=Wu("\u25FB","[\u2022]"),F$=Wu("\u25FC","[+]"),nK=Wu("\u25FB","[ ]");`${L.gray(s)} `;Z$=Symbol.for("cancel")});var N$=h((L$)=>{Object.defineProperty(L$,"__esModule",{value:!0});var O$=FD("node:buffer"),D0={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};L$.ERRORS=D0;function kX(D){if(!O$.Buffer.isEncoding(D))throw new Error(D0.INVALID_ENCODING)}L$.checkEncoding=kX;function T$(D){return typeof D==="number"&&isFinite(D)&&bX(D)}L$.isFiniteInteger=T$;function V$(D,u){if(typeof D==="number"){if(!T$(D)||D<0)throw new Error(u?D0.INVALID_OFFSET:D0.INVALID_LENGTH)}else throw new Error(u?D0.INVALID_OFFSET_NON_NUMBER:D0.INVALID_LENGTH_NON_NUMBER)}function SX(D){V$(D,!1)}L$.checkLengthValue=SX;function _X(D){V$(D,!0)}L$.checkOffsetValue=_X;function gX(D,u){if(D<0||D>u.length)throw new Error(D0.INVALID_TARGET_OFFSET)}L$.checkTargetOffset=gX;function bX(D){return typeof D==="number"&&isFinite(D)&&Math.floor(D)===D}function mX(D){if(typeof BigInt==="undefined")throw new Error("Platform does not support JS BigInt type.");if(typeof O$.Buffer.prototype[D]==="undefined")throw new Error(`Platform does not support Buffer.prototype.${D}.`)}L$.bigIntAndBufferInt64Check=mX});var R$=h((I$)=>{Object.defineProperty(I$,"__esModule",{value:!0});var i=N$(),h$=4096,lX="utf8";class T3{constructor(D){if(this.length=0,this._encoding=lX,this._writeOffset=0,this._readOffset=0,T3.isSmartBufferOptions(D)){if(D.encoding)i.checkEncoding(D.encoding),this._encoding=D.encoding;if(D.size)if(i.isFiniteInteger(D.size)&&D.size>0)this._buff=Buffer.allocUnsafe(D.size);else throw new Error(i.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(D.buff)if(Buffer.isBuffer(D.buff))this._buff=D.buff,this.length=D.buff.length;else throw new Error(i.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(h$)}else{if(typeof D!=="undefined")throw new Error(i.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(h$)}}static fromSize(D,u){return new this({size:D,encoding:u})}static fromBuffer(D,u){return new this({buff:D,encoding:u})}static fromOptions(D){return new this(D)}static isSmartBufferOptions(D){let u=D;return u&&(u.encoding!==void 0||u.size!==void 0||u.buff!==void 0)}readInt8(D){return this._readNumberValue(Buffer.prototype.readInt8,1,D)}readInt16BE(D){return this._readNumberValue(Buffer.prototype.readInt16BE,2,D)}readInt16LE(D){return this._readNumberValue(Buffer.prototype.readInt16LE,2,D)}readInt32BE(D){return this._readNumberValue(Buffer.prototype.readInt32BE,4,D)}readInt32LE(D){return this._readNumberValue(Buffer.prototype.readInt32LE,4,D)}readBigInt64BE(D){return i.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,D)}readBigInt64LE(D){return i.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,D)}writeInt8(D,u){return this._writeNumberValue(Buffer.prototype.writeInt8,1,D,u),this}insertInt8(D,u){return this._insertNumberValue(Buffer.prototype.writeInt8,1,D,u)}writeInt16BE(D,u){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,D,u)}insertInt16BE(D,u){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,D,u)}writeInt16LE(D,u){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,D,u)}insertInt16LE(D,u){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,D,u)}writeInt32BE(D,u){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,D,u)}insertInt32BE(D,u){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,D,u)}writeInt32LE(D,u){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,D,u)}insertInt32LE(D,u){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,D,u)}writeBigInt64BE(D,u){return i.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,D,u)}insertBigInt64BE(D,u){return i.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,D,u)}writeBigInt64LE(D,u){return i.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,D,u)}insertBigInt64LE(D,u){return i.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,D,u)}readUInt8(D){return this._readNumberValue(Buffer.prototype.readUInt8,1,D)}readUInt16BE(D){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,D)}readUInt16LE(D){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,D)}readUInt32BE(D){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,D)}readUInt32LE(D){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,D)}readBigUInt64BE(D){return i.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,D)}readBigUInt64LE(D){return i.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,D)}writeUInt8(D,u){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,D,u)}insertUInt8(D,u){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,D,u)}writeUInt16BE(D,u){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,D,u)}insertUInt16BE(D,u){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,D,u)}writeUInt16LE(D,u){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,D,u)}insertUInt16LE(D,u){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,D,u)}writeUInt32BE(D,u){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,D,u)}insertUInt32BE(D,u){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,D,u)}writeUInt32LE(D,u){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,D,u)}insertUInt32LE(D,u){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,D,u)}writeBigUInt64BE(D,u){return i.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,D,u)}insertBigUInt64BE(D,u){return i.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,D,u)}writeBigUInt64LE(D,u){return i.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,D,u)}insertBigUInt64LE(D,u){return i.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,D,u)}readFloatBE(D){return this._readNumberValue(Buffer.prototype.readFloatBE,4,D)}readFloatLE(D){return this._readNumberValue(Buffer.prototype.readFloatLE,4,D)}writeFloatBE(D,u){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,D,u)}insertFloatBE(D,u){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,D,u)}writeFloatLE(D,u){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,D,u)}insertFloatLE(D,u){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,D,u)}readDoubleBE(D){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,D)}readDoubleLE(D){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,D)}writeDoubleBE(D,u){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,D,u)}insertDoubleBE(D,u){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,D,u)}writeDoubleLE(D,u){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,D,u)}insertDoubleLE(D,u){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,D,u)}readString(D,u){let F;if(typeof D==="number")i.checkLengthValue(D),F=Math.min(D,this.length-this._readOffset);else u=D,F=this.length-this._readOffset;if(typeof u!=="undefined")i.checkEncoding(u);let C=this._buff.slice(this._readOffset,this._readOffset+F).toString(u||this._encoding);return this._readOffset+=F,C}insertString(D,u,F){return i.checkOffsetValue(u),this._handleString(D,!0,u,F)}writeString(D,u,F){return this._handleString(D,!1,u,F)}readStringNT(D){if(typeof D!=="undefined")i.checkEncoding(D);let u=this.length;for(let C=this._readOffset;C<this.length;C++)if(this._buff[C]===0){u=C;break}let F=this._buff.slice(this._readOffset,u);return this._readOffset=u+1,F.toString(D||this._encoding)}insertStringNT(D,u,F){return i.checkOffsetValue(u),this.insertString(D,u,F),this.insertUInt8(0,u+D.length),this}writeStringNT(D,u,F){return this.writeString(D,u,F),this.writeUInt8(0,typeof u==="number"?u+D.length:this.writeOffset),this}readBuffer(D){if(typeof D!=="undefined")i.checkLengthValue(D);let u=typeof D==="number"?D:this.length,F=Math.min(this.length,this._readOffset+u),C=this._buff.slice(this._readOffset,F);return this._readOffset=F,C}insertBuffer(D,u){return i.checkOffsetValue(u),this._handleBuffer(D,!0,u)}writeBuffer(D,u){return this._handleBuffer(D,!1,u)}readBufferNT(){let D=this.length;for(let F=this._readOffset;F<this.length;F++)if(this._buff[F]===0){D=F;break}let u=this._buff.slice(this._readOffset,D);return this._readOffset=D+1,u}insertBufferNT(D,u){return i.checkOffsetValue(u),this.insertBuffer(D,u),this.insertUInt8(0,u+D.length),this}writeBufferNT(D,u){if(typeof u!=="undefined")i.checkOffsetValue(u);return this.writeBuffer(D,u),this.writeUInt8(0,typeof u==="number"?u+D.length:this._writeOffset),this}clear(){return this._writeOffset=0,this._readOffset=0,this.length=0,this}remaining(){return this.length-this._readOffset}get readOffset(){return this._readOffset}set readOffset(D){i.checkOffsetValue(D),i.checkTargetOffset(D,this),this._readOffset=D}get writeOffset(){return this._writeOffset}set writeOffset(D){i.checkOffsetValue(D),i.checkTargetOffset(D,this),this._writeOffset=D}get encoding(){return this._encoding}set encoding(D){i.checkEncoding(D),this._encoding=D}get internalBuffer(){return this._buff}toBuffer(){return this._buff.slice(0,this.length)}toString(D){let u=typeof D==="string"?D:this._encoding;return i.checkEncoding(u),this._buff.toString(u,0,this.length)}destroy(){return this.clear(),this}_handleString(D,u,F,C){let $=this._writeOffset,w=this._encoding;if(typeof F==="number")$=F;else if(typeof F==="string")i.checkEncoding(F),w=F;if(typeof C==="string")i.checkEncoding(C),w=C;let E=Buffer.byteLength(D,w);if(u)this.ensureInsertable(E,$);else this._ensureWriteable(E,$);if(this._buff.write(D,$,E,w),u)this._writeOffset+=E;else if(typeof F==="number")this._writeOffset=Math.max(this._writeOffset,$+E);else this._writeOffset+=E;return this}_handleBuffer(D,u,F){let C=typeof F==="number"?F:this._writeOffset;if(u)this.ensureInsertable(D.length,C);else this._ensureWriteable(D.length,C);if(D.copy(this._buff,C),u)this._writeOffset+=D.length;else if(typeof F==="number")this._writeOffset=Math.max(this._writeOffset,C+D.length);else this._writeOffset+=D.length;return this}ensureReadable(D,u){let F=this._readOffset;if(typeof u!=="undefined")i.checkOffsetValue(u),F=u;if(F<0||F+D>this.length)throw new Error(i.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(D,u){if(i.checkOffsetValue(u),this._ensureCapacity(this.length+D),u<this.length)this._buff.copy(this._buff,u+D,u,this._buff.length);if(u+D>this.length)this.length=u+D;else this.length+=D}_ensureWriteable(D,u){let F=typeof u==="number"?u:this._writeOffset;if(this._ensureCapacity(F+D),F+D>this.length)this.length=F+D}_ensureCapacity(D){let u=this._buff.length;if(D>u){let F=this._buff,C=u*3/2+1;if(C<D)C=D;this._buff=Buffer.allocUnsafe(C),F.copy(this._buff,0,0,u)}}_readNumberValue(D,u,F){this.ensureReadable(u,F);let C=D.call(this._buff,typeof F==="number"?F:this._readOffset);if(typeof F==="undefined")this._readOffset+=u;return C}_insertNumberValue(D,u,F,C){return i.checkOffsetValue(C),this.ensureInsertable(u,C),D.call(this._buff,F,C),this._writeOffset+=u,this}_writeNumberValue(D,u,F,C){if(typeof C==="number"){if(C<0)throw new Error(i.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);i.checkOffsetValue(C)}let $=typeof C==="number"?C:this._writeOffset;if(this._ensureWriteable(u,$),D.call(this._buff,F,$),typeof C==="number")this._writeOffset=Math.max(this._writeOffset,$+u);else this._writeOffset+=u;return this}}I$.SmartBuffer=T3});var V3=h((b$)=>{Object.defineProperty(b$,"__esModule",{value:!0});b$.SOCKS5_NO_ACCEPTABLE_AUTH=b$.SOCKS5_CUSTOM_AUTH_END=b$.SOCKS5_CUSTOM_AUTH_START=b$.SOCKS_INCOMING_PACKET_SIZES=b$.SocksClientState=b$.Socks5Response=b$.Socks5HostType=b$.Socks5Auth=b$.Socks4Response=b$.SocksCommand=b$.ERRORS=b$.DEFAULT_TIMEOUT=void 0;var pX=30000;b$.DEFAULT_TIMEOUT=pX;var aX={InvalidSocksCommand:"An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",InvalidSocksCommandForOperation:"An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",InvalidSocksCommandChain:"An invalid SOCKS command was provided. Chaining currently only supports the connect command.",InvalidSocksClientOptionsDestination:"An invalid destination host was provided.",InvalidSocksClientOptionsExistingSocket:"An invalid existing socket was provided. This should be an instance of stream.Duplex.",InvalidSocksClientOptionsProxy:"Invalid SOCKS proxy details were provided.",InvalidSocksClientOptionsTimeout:"An invalid timeout value was provided. Please enter a value above 0 (in ms).",InvalidSocksClientOptionsProxiesLength:"At least two socks proxies must be provided for chaining.",InvalidSocksClientOptionsCustomAuthRange:"Custom auth must be a value between 0x80 and 0xFE.",InvalidSocksClientOptionsCustomAuthOptions:"When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",NegotiationError:"Negotiation error",SocketClosed:"Socket closed",ProxyConnectionTimedOut:"Proxy connection timed out",InternalError:"SocksClient internal error (this should not happen)",InvalidSocks4HandshakeResponse:"Received invalid Socks4 handshake response",Socks4ProxyRejectedConnection:"Socks4 Proxy rejected connection",InvalidSocks4IncomingConnectionResponse:"Socks4 invalid incoming connection response",Socks4ProxyRejectedIncomingBoundConnection:"Socks4 Proxy rejected incoming bound connection",InvalidSocks5InitialHandshakeResponse:"Received invalid Socks5 initial handshake response",InvalidSocks5IntiailHandshakeSocksVersion:"Received invalid Socks5 initial handshake (invalid socks version)",InvalidSocks5InitialHandshakeNoAcceptedAuthType:"Received invalid Socks5 initial handshake (no accepted authentication type)",InvalidSocks5InitialHandshakeUnknownAuthType:"Received invalid Socks5 initial handshake (unknown authentication type)",Socks5AuthenticationFailed:"Socks5 Authentication failed",InvalidSocks5FinalHandshake:"Received invalid Socks5 final handshake response",InvalidSocks5FinalHandshakeRejected:"Socks5 proxy rejected connection",InvalidSocks5IncomingConnectionResponse:"Received invalid Socks5 incoming connection response",Socks5ProxyRejectedIncomingBoundConnection:"Socks5 Proxy rejected incoming bound connection"};b$.ERRORS=aX;var tX={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:(D)=>D+7,Socks4Response:8};b$.SOCKS_INCOMING_PACKET_SIZES=tX;var P$;(function(D){D[D.connect=1]="connect",D[D.bind=2]="bind",D[D.associate=3]="associate"})(P$||(b$.SocksCommand=P$={}));var j$;(function(D){D[D.Granted=90]="Granted",D[D.Failed=91]="Failed",D[D.Rejected=92]="Rejected",D[D.RejectedIdent=93]="RejectedIdent"})(j$||(b$.Socks4Response=j$={}));var k$;(function(D){D[D.NoAuth=0]="NoAuth",D[D.GSSApi=1]="GSSApi",D[D.UserPass=2]="UserPass"})(k$||(b$.Socks5Auth=k$={}));var oX=128;b$.SOCKS5_CUSTOM_AUTH_START=oX;var sX=254;b$.SOCKS5_CUSTOM_AUTH_END=sX;var eX=255;b$.SOCKS5_NO_ACCEPTABLE_AUTH=eX;var S$;(function(D){D[D.Granted=0]="Granted",D[D.Failure=1]="Failure",D[D.NotAllowed=2]="NotAllowed",D[D.NetworkUnreachable=3]="NetworkUnreachable",D[D.HostUnreachable=4]="HostUnreachable",D[D.ConnectionRefused=5]="ConnectionRefused",D[D.TTLExpired=6]="TTLExpired",D[D.CommandNotSupported=7]="CommandNotSupported",D[D.AddressNotSupported=8]="AddressNotSupported"})(S$||(b$.Socks5Response=S$={}));var _$;(function(D){D[D.IPv4=1]="IPv4",D[D.Hostname=3]="Hostname",D[D.IPv6=4]="IPv6"})(_$||(b$.Socks5HostType=_$={}));var g$;(function(D){D[D.Created=0]="Created",D[D.Connecting=1]="Connecting",D[D.Connected=2]="Connected",D[D.SentInitialHandshake=3]="SentInitialHandshake",D[D.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",D[D.SentAuthentication=5]="SentAuthentication",D[D.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",D[D.SentFinalHandshake=7]="SentFinalHandshake",D[D.ReceivedFinalResponse=8]="ReceivedFinalResponse",D[D.BoundWaitingForConnection=9]="BoundWaitingForConnection",D[D.Established=10]="Established",D[D.Disconnected=11]="Disconnected",D[D.Error=99]="Error"})(g$||(b$.SocksClientState=g$={}))});var L3=h((c$)=>{Object.defineProperty(c$,"__esModule",{value:!0});c$.shuffleArray=c$.SocksClientError=void 0;class v$ extends Error{constructor(D,u){super(D);this.options=u}}c$.SocksClientError=v$;function qW(D){for(let u=D.length-1;u>0;u--){let F=Math.floor(Math.random()*(u+1));[D[u],D[F]]=[D[F],D[u]]}}c$.shuffleArray=qW});var N3=h((n$)=>{Object.defineProperty(n$,"__esModule",{value:!0});n$.isCorrect=n$.isInSubnet=void 0;function KW(D){if(this.subnetMask<D.subnetMask)return!1;if(this.mask(D.subnetMask)===D.mask())return!0;return!1}n$.isInSubnet=KW;function XW(D){return function(){if(this.addressMinusSuffix!==this.correctForm())return!1;if(this.subnetMask===D&&!this.parsedSubnet)return!0;return this.parsedSubnet===String(this.subnetMask)}}n$.isCorrect=XW});var h3=h((d$)=>{Object.defineProperty(d$,"__esModule",{value:!0});d$.RE_SUBNET_STRING=d$.RE_ADDRESS=d$.GROUPS=d$.BITS=void 0;d$.BITS=32;d$.GROUPS=4;d$.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;d$.RE_SUBNET_STRING=/\/\d{1,2}$/});var A8=h((r$)=>{Object.defineProperty(r$,"__esModule",{value:!0});r$.AddressError=void 0;class l$ extends Error{constructor(D,u){super(D);if(this.name="AddressError",u!==null)this.parseMessage=u}}r$.AddressError=l$});var I3=h((Q8,a$)=>{(function(){var D,u=244837814094590,F=(u&16777215)==15715070;function C(B,M,J){if(B!=null)if(typeof B=="number")this.fromNumber(B,M,J);else if(M==null&&typeof B!="string")this.fromString(B,256);else this.fromString(B,M)}function $(){return new C(null)}function w(B,M,J,K,Q,y){while(--y>=0){var j=M*this[B++]+J[K]+Q;Q=Math.floor(j/67108864),J[K++]=j&67108863}return Q}function E(B,M,J,K,Q,y){var j=M&32767,_=M>>15;while(--y>=0){var uD=this[B]&32767,zD=this[B++]>>15,Du=_*uD+zD*j;uD=j*uD+((Du&32767)<<15)+J[K]+(Q&1073741823),Q=(uD>>>30)+(Du>>>15)+_*zD+(Q>>>30),J[K++]=uD&1073741823}return Q}function Y(B,M,J,K,Q,y){var j=M&16383,_=M>>14;while(--y>=0){var uD=this[B]&16383,zD=this[B++]>>14,Du=_*uD+zD*j;uD=j*uD+((Du&16383)<<14)+J[K]+Q,Q=(uD>>28)+(Du>>14)+_*zD,J[K++]=uD&268435455}return Q}var q=typeof navigator!=="undefined";if(q&&F&&navigator.appName=="Microsoft Internet Explorer")C.prototype.am=E,D=30;else if(q&&F&&navigator.appName!="Netscape")C.prototype.am=w,D=26;else C.prototype.am=Y,D=28;C.prototype.DB=D,C.prototype.DM=(1<<D)-1,C.prototype.DV=1<<D;var W=52;C.prototype.FV=Math.pow(2,W),C.prototype.F1=W-D,C.prototype.F2=2*D-W;var Z="0123456789abcdefghijklmnopqrstuvwxyz",G=new Array,A,z;A=48;for(z=0;z<=9;++z)G[A++]=z;A=97;for(z=10;z<36;++z)G[A++]=z;A=65;for(z=10;z<36;++z)G[A++]=z;function X(B){return Z.charAt(B)}function k(B,M){var J=G[B.charCodeAt(M)];return J==null?-1:J}function m(B){for(var M=this.t-1;M>=0;--M)B[M]=this[M];B.t=this.t,B.s=this.s}function c(B){if(this.t=1,this.s=B<0?-1:0,B>0)this[0]=B;else if(B<-1)this[0]=B+this.DV;else this.t=0}function l(B){var M=$();return M.fromInt(B),M}function d(B,M){var J;if(M==16)J=4;else if(M==8)J=3;else if(M==256)J=8;else if(M==2)J=1;else if(M==32)J=5;else if(M==4)J=2;else{this.fromRadix(B,M);return}this.t=0,this.s=0;var K=B.length,Q=!1,y=0;while(--K>=0){var j=J==8?B[K]&255:k(B,K);if(j<0){if(B.charAt(K)=="-")Q=!0;continue}if(Q=!1,y==0)this[this.t++]=j;else if(y+J>this.DB)this[this.t-1]|=(j&(1<<this.DB-y)-1)<<y,this[this.t++]=j>>this.DB-y;else this[this.t-1]|=j<<y;if(y+=J,y>=this.DB)y-=this.DB}if(J==8&&(B[0]&128)!=0){if(this.s=-1,y>0)this[this.t-1]|=(1<<this.DB-y)-1<<y}if(this.clamp(),Q)C.ZERO.subTo(this,this)}function MD(){var B=this.s&this.DM;while(this.t>0&&this[this.t-1]==B)--this.t}function PD(B){if(this.s<0)return"-"+this.negate().toString(B);var M;if(B==16)M=4;else if(B==8)M=3;else if(B==2)M=1;else if(B==32)M=5;else if(B==4)M=2;else return this.toRadix(B);var J=(1<<M)-1,K,Q=!1,y="",j=this.t,_=this.DB-j*this.DB%M;if(j-- >0){if(_<this.DB&&(K=this[j]>>_)>0)Q=!0,y=X(K);while(j>=0){if(_<M)K=(this[j]&(1<<_)-1)<<M-_,K|=this[--j]>>(_+=this.DB-M);else if(K=this[j]>>(_-=M)&J,_<=0)_+=this.DB,--j;if(K>0)Q=!0;if(Q)y+=X(K)}}return Q?y:"0"}function KD(){var B=$();return C.ZERO.subTo(this,B),B}function XD(){return this.s<0?this.negate():this}function a(B){var M=this.s-B.s;if(M!=0)return M;var J=this.t;if(M=J-B.t,M!=0)return this.s<0?-M:M;while(--J>=0)if((M=this[J]-B[J])!=0)return M;return 0}function V(B){var M=1,J;if((J=B>>>16)!=0)B=J,M+=16;if((J=B>>8)!=0)B=J,M+=8;if((J=B>>4)!=0)B=J,M+=4;if((J=B>>2)!=0)B=J,M+=2;if((J=B>>1)!=0)B=J,M+=1;return M}function n(){if(this.t<=0)return 0;return this.DB*(this.t-1)+V(this[this.t-1]^this.s&this.DM)}function x(B,M){var J;for(J=this.t-1;J>=0;--J)M[J+B]=this[J];for(J=B-1;J>=0;--J)M[J]=0;M.t=this.t+B,M.s=this.s}function S(B,M){for(var J=B;J<this.t;++J)M[J-B]=this[J];M.t=Math.max(this.t-B,0),M.s=this.s}function O(B,M){var J=B%this.DB,K=this.DB-J,Q=(1<<K)-1,y=Math.floor(B/this.DB),j=this.s<<J&this.DM,_;for(_=this.t-1;_>=0;--_)M[_+y+1]=this[_]>>K|j,j=(this[_]&Q)<<J;for(_=y-1;_>=0;--_)M[_]=0;M[y]=j,M.t=this.t+y+1,M.s=this.s,M.clamp()}function H(B,M){M.s=this.s;var J=Math.floor(B/this.DB);if(J>=this.t){M.t=0;return}var K=B%this.DB,Q=this.DB-K,y=(1<<K)-1;M[0]=this[J]>>K;for(var j=J+1;j<this.t;++j)M[j-J-1]|=(this[j]&y)<<Q,M[j-J]=this[j]>>K;if(K>0)M[this.t-J-1]|=(this.s&y)<<Q;M.t=this.t-J,M.clamp()}function N(B,M){var J=0,K=0,Q=Math.min(B.t,this.t);while(J<Q)K+=this[J]-B[J],M[J++]=K&this.DM,K>>=this.DB;if(B.t<this.t){K-=B.s;while(J<this.t)K+=this[J],M[J++]=K&this.DM,K>>=this.DB;K+=this.s}else{K+=this.s;while(J<B.t)K-=B[J],M[J++]=K&this.DM,K>>=this.DB;K-=B.s}if(M.s=K<0?-1:0,K<-1)M[J++]=this.DV+K;else if(K>0)M[J++]=K;M.t=J,M.clamp()}function U(B,M){var J=this.abs(),K=B.abs(),Q=J.t;M.t=Q+K.t;while(--Q>=0)M[Q]=0;for(Q=0;Q<K.t;++Q)M[Q+J.t]=J.am(0,K[Q],M,Q,0,J.t);if(M.s=0,M.clamp(),this.s!=B.s)C.ZERO.subTo(M,M)}function I(B){var M=this.abs(),J=B.t=2*M.t;while(--J>=0)B[J]=0;for(J=0;J<M.t-1;++J){var K=M.am(J,M[J],B,2*J,0,1);if((B[J+M.t]+=M.am(J+1,2*M[J],B,2*J+1,K,M.t-J-1))>=M.DV)B[J+M.t]-=M.DV,B[J+M.t+1]=1}if(B.t>0)B[B.t-1]+=M.am(J,M[J],B,2*J,0,1);B.s=0,B.clamp()}function g(B,M,J){var K=B.abs();if(K.t<=0)return;var Q=this.abs();if(Q.t<K.t){if(M!=null)M.fromInt(0);if(J!=null)this.copyTo(J);return}if(J==null)J=$();var y=$(),j=this.s,_=B.s,uD=this.DB-V(K[K.t-1]);if(uD>0)K.lShiftTo(uD,y),Q.lShiftTo(uD,J);else K.copyTo(y),Q.copyTo(J);var zD=y.t,Du=y[zD-1];if(Du==0)return;var aD=Du*(1<<this.F1)+(zD>1?y[zD-2]>>this.F2:0),Nu=this.FV/aD,Y1=(1<<this.F1)/aD,Mu=1<<this.F2,Yu=J.t,J1=Yu-zD,Su=M==null?$():M;if(y.dlShiftTo(J1,Su),J.compareTo(Su)>=0)J[J.t++]=1,J.subTo(Su,J);C.ONE.dlShiftTo(zD,Su),Su.subTo(y,y);while(y.t<zD)y[y.t++]=0;while(--J1>=0){var R8=J[--Yu]==Du?this.DM:Math.floor(J[Yu]*Nu+(J[Yu-1]+Mu)*Y1);if((J[Yu]+=y.am(0,R8,J,J1,0,zD))<R8){y.dlShiftTo(J1,Su),J.subTo(Su,J);while(J[Yu]<--R8)J.subTo(Su,J)}}if(M!=null){if(J.drShiftTo(zD,M),j!=_)C.ZERO.subTo(M,M)}if(J.t=zD,J.clamp(),uD>0)J.rShiftTo(uD,J);if(j<0)C.ZERO.subTo(J,J)}function b(B){var M=$();if(this.abs().divRemTo(B,null,M),this.s<0&&M.compareTo(C.ZERO)>0)B.subTo(M,M);return M}function r(B){this.m=B}function DD(B){if(B.s<0||B.compareTo(this.m)>=0)return B.mod(this.m);else return B}function YD(B){return B}function ND(B){B.divRemTo(this.m,null,B)}function zu(B,M,J){B.multiplyTo(M,J),this.reduce(J)}function Eu(B,M){B.squareTo(M),this.reduce(M)}r.prototype.convert=DD,r.prototype.revert=YD,r.prototype.reduce=ND,r.prototype.mulTo=zu,r.prototype.sqrTo=Eu;function Lu(){if(this.t<1)return 0;var B=this[0];if((B&1)==0)return 0;var M=B&3;return M=M*(2-(B&15)*M)&15,M=M*(2-(B&255)*M)&255,M=M*(2-((B&65535)*M&65535))&65535,M=M*(2-B*M%this.DV)%this.DV,M>0?this.DV-M:-M}function WD(B){this.m=B,this.mp=B.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<B.DB-15)-1,this.mt2=2*B.t}function ZD(B){var M=$();if(B.abs().dlShiftTo(this.m.t,M),M.divRemTo(this.m,null,M),B.s<0&&M.compareTo(C.ZERO)>0)this.m.subTo(M,M);return M}function fD(B){var M=$();return B.copyTo(M),this.reduce(M),M}function wu(B){while(B.t<=this.mt2)B[B.t++]=0;for(var M=0;M<this.m.t;++M){var J=B[M]&32767,K=J*this.mpl+((J*this.mph+(B[M]>>15)*this.mpl&this.um)<<15)&B.DM;J=M+this.m.t,B[J]+=this.m.am(0,K,B,M,0,this.m.t);while(B[J]>=B.DV)B[J]-=B.DV,B[++J]++}if(B.clamp(),B.drShiftTo(this.m.t,B),B.compareTo(this.m)>=0)B.subTo(this.m,B)}function Au(B,M){B.squareTo(M),this.reduce(M)}function $0(B,M,J){B.multiplyTo(M,J),this.reduce(J)}WD.prototype.convert=ZD,WD.prototype.revert=fD,WD.prototype.reduce=wu,WD.prototype.mulTo=$0,WD.prototype.sqrTo=Au;function E0(){return(this.t>0?this[0]&1:this.s)==0}function T0(B,M){if(B>4294967295||B<1)return C.ONE;var J=$(),K=$(),Q=M.convert(this),y=V(B)-1;Q.copyTo(J);while(--y>=0)if(M.sqrTo(J,K),(B&1<<y)>0)M.mulTo(K,Q,J);else{var j=J;J=K,K=j}return M.revert(J)}function V0(B,M){var J;if(B<256||M.isEven())J=new r(M);else J=new WD(M);return this.exp(B,J)}C.prototype.copyTo=m,C.prototype.fromInt=c,C.prototype.fromString=d,C.prototype.clamp=MD,C.prototype.dlShiftTo=x,C.prototype.drShiftTo=S,C.prototype.lShiftTo=O,C.prototype.rShiftTo=H,C.prototype.subTo=N,C.prototype.multiplyTo=U,C.prototype.squareTo=I,C.prototype.divRemTo=g,C.prototype.invDigit=Lu,C.prototype.isEven=E0,C.prototype.exp=T0,C.prototype.toString=PD,C.prototype.negate=KD,C.prototype.abs=XD,C.prototype.compareTo=a,C.prototype.bitLength=n,C.prototype.mod=b,C.prototype.modPowInt=V0,C.ZERO=l(0),C.ONE=l(1);function L0(){var B=$();return this.copyTo(B),B}function N0(){if(this.s<0){if(this.t==1)return this[0]-this.DV;else if(this.t==0)return-1}else if(this.t==1)return this[0];else if(this.t==0)return 0;return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function f3(){return this.t==0?this.s:this[0]<<24>>24}function R5(){return this.t==0?this.s:this[0]<<16>>16}function P5(B){return Math.floor(Math.LN2*this.DB/Math.log(B))}function j5(){if(this.s<0)return-1;else if(this.t<=0||this.t==1&&this[0]<=0)return 0;else return 1}function k5(B){if(B==null)B=10;if(this.signum()==0||B<2||B>36)return"0";var M=this.chunkSize(B),J=Math.pow(B,M),K=l(J),Q=$(),y=$(),j="";this.divRemTo(K,Q,y);while(Q.signum()>0)j=(J+y.intValue()).toString(B).substr(1)+j,Q.divRemTo(K,Q,y);return y.intValue().toString(B)+j}function S5(B,M){if(this.fromInt(0),M==null)M=10;var J=this.chunkSize(M),K=Math.pow(M,J),Q=!1,y=0,j=0;for(var _=0;_<B.length;++_){var uD=k(B,_);if(uD<0){if(B.charAt(_)=="-"&&this.signum()==0)Q=!0;continue}if(j=M*j+uD,++y>=J)this.dMultiply(K),this.dAddOffset(j,0),y=0,j=0}if(y>0)this.dMultiply(Math.pow(M,y)),this.dAddOffset(j,0);if(Q)C.ZERO.subTo(this,this)}function _5(B,M,J){if(typeof M=="number")if(B<2)this.fromInt(1);else{if(this.fromNumber(B,J),!this.testBit(B-1))this.bitwiseTo(C.ONE.shiftLeft(B-1),L8,this);if(this.isEven())this.dAddOffset(1,0);while(!this.isProbablePrime(M))if(this.dAddOffset(2,0),this.bitLength()>B)this.subTo(C.ONE.shiftLeft(B-1),this)}else{var K=new Array,Q=B&7;if(K.length=(B>>3)+1,M.nextBytes(K),Q>0)K[0]&=(1<<Q)-1;else K[0]=0;this.fromString(K,256)}}function g5(){var B=this.t,M=new Array;M[0]=this.s;var J=this.DB-B*this.DB%8,K,Q=0;if(B-- >0){if(J<this.DB&&(K=this[B]>>J)!=(this.s&this.DM)>>J)M[Q++]=K|this.s<<this.DB-J;while(B>=0){if(J<8)K=(this[B]&(1<<J)-1)<<8-J,K|=this[--B]>>(J+=this.DB-8);else if(K=this[B]>>(J-=8)&255,J<=0)J+=this.DB,--B;if((K&128)!=0)K|=-256;if(Q==0&&(this.s&128)!=(K&128))++Q;if(Q>0||K!=this.s)M[Q++]=K}}return M}function b5(B){return this.compareTo(B)==0}function m5(B){return this.compareTo(B)<0?this:B}function v5(B){return this.compareTo(B)>0?this:B}function c5(B,M,J){var K,Q,y=Math.min(B.t,this.t);for(K=0;K<y;++K)J[K]=M(this[K],B[K]);if(B.t<this.t){Q=B.s&this.DM;for(K=y;K<this.t;++K)J[K]=M(this[K],Q);J.t=this.t}else{Q=this.s&this.DM;for(K=y;K<B.t;++K)J[K]=M(Q,B[K]);J.t=B.t}J.s=M(this.s,B.s),J.clamp()}function x5(B,M){return B&M}function n5(B){var M=$();return this.bitwiseTo(B,x5,M),M}function L8(B,M){return B|M}function f5(B){var M=$();return this.bitwiseTo(B,L8,M),M}function d3(B,M){return B^M}function d5(B){var M=$();return this.bitwiseTo(B,d3,M),M}function i3(B,M){return B&~M}function i5(B){var M=$();return this.bitwiseTo(B,i3,M),M}function l5(){var B=$();for(var M=0;M<this.t;++M)B[M]=this.DM&~this[M];return B.t=this.t,B.s=~this.s,B}function r5(B){var M=$();if(B<0)this.rShiftTo(-B,M);else this.lShiftTo(B,M);return M}function p5(B){var M=$();if(B<0)this.lShiftTo(-B,M);else this.rShiftTo(B,M);return M}function a5(B){if(B==0)return-1;var M=0;if((B&65535)==0)B>>=16,M+=16;if((B&255)==0)B>>=8,M+=8;if((B&15)==0)B>>=4,M+=4;if((B&3)==0)B>>=2,M+=2;if((B&1)==0)++M;return M}function t5(){for(var B=0;B<this.t;++B)if(this[B]!=0)return B*this.DB+a5(this[B]);if(this.s<0)return this.t*this.DB;return-1}function o5(B){var M=0;while(B!=0)B&=B-1,++M;return M}function s5(){var B=0,M=this.s&this.DM;for(var J=0;J<this.t;++J)B+=o5(this[J]^M);return B}function e5(B){var M=Math.floor(B/this.DB);if(M>=this.t)return this.s!=0;return(this[M]&1<<B%this.DB)!=0}function DE(B,M){var J=C.ONE.shiftLeft(B);return this.bitwiseTo(J,M,J),J}function uE(B){return this.changeBit(B,L8)}function FE(B){return this.changeBit(B,i3)}function CE(B){return this.changeBit(B,d3)}function $E(B,M){var J=0,K=0,Q=Math.min(B.t,this.t);while(J<Q)K+=this[J]+B[J],M[J++]=K&this.DM,K>>=this.DB;if(B.t<this.t){K+=B.s;while(J<this.t)K+=this[J],M[J++]=K&this.DM,K>>=this.DB;K+=this.s}else{K+=this.s;while(J<B.t)K+=B[J],M[J++]=K&this.DM,K>>=this.DB;K+=B.s}if(M.s=K<0?-1:0,K>0)M[J++]=K;else if(K<-1)M[J++]=this.DV+K;M.t=J,M.clamp()}function EE(B){var M=$();return this.addTo(B,M),M}function wE(B){var M=$();return this.subTo(B,M),M}function BE(B){var M=$();return this.multiplyTo(B,M),M}function ME(){var B=$();return this.squareTo(B),B}function YE(B){var M=$();return this.divRemTo(B,M,null),M}function JE(B){var M=$();return this.divRemTo(B,null,M),M}function qE(B){var M=$(),J=$();return this.divRemTo(B,M,J),new Array(M,J)}function ZE(B){this[this.t]=this.am(0,B-1,this,0,0,this.t),++this.t,this.clamp()}function KE(B,M){if(B==0)return;while(this.t<=M)this[this.t++]=0;this[M]+=B;while(this[M]>=this.DV){if(this[M]-=this.DV,++M>=this.t)this[this.t++]=0;++this[M]}}function h0(){}function l3(B){return B}function XE(B,M,J){B.multiplyTo(M,J)}function WE(B,M){B.squareTo(M)}h0.prototype.convert=l3,h0.prototype.revert=l3,h0.prototype.mulTo=XE,h0.prototype.sqrTo=WE;function GE(B){return this.exp(B,new h0)}function zE(B,M,J){var K=Math.min(this.t+B.t,M);J.s=0,J.t=K;while(K>0)J[--K]=0;var Q;for(Q=J.t-this.t;K<Q;++K)J[K+this.t]=this.am(0,B[K],J,K,0,this.t);for(Q=Math.min(B.t,M);K<Q;++K)this.am(0,B[K],J,K,0,M-K);J.clamp()}function AE(B,M,J){--M;var K=J.t=this.t+B.t-M;J.s=0;while(--K>=0)J[K]=0;for(K=Math.max(M-this.t,0);K<B.t;++K)J[this.t+K-M]=this.am(M-K,B[K],J,0,0,this.t+K-M);J.clamp(),J.drShiftTo(1,J)}function lu(B){this.r2=$(),this.q3=$(),C.ONE.dlShiftTo(2*B.t,this.r2),this.mu=this.r2.divide(B),this.m=B}function QE(B){if(B.s<0||B.t>2*this.m.t)return B.mod(this.m);else if(B.compareTo(this.m)<0)return B;else{var M=$();return B.copyTo(M),this.reduce(M),M}}function HE(B){return B}function UE(B){if(B.drShiftTo(this.m.t-1,this.r2),B.t>this.m.t+1)B.t=this.m.t+1,B.clamp();this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(B.compareTo(this.r2)<0)B.dAddOffset(1,this.m.t+1);B.subTo(this.r2,B);while(B.compareTo(this.m)>=0)B.subTo(this.m,B)}function yE(B,M){B.squareTo(M),this.reduce(M)}function OE(B,M,J){B.multiplyTo(M,J),this.reduce(J)}lu.prototype.convert=QE,lu.prototype.revert=HE,lu.prototype.reduce=UE,lu.prototype.mulTo=OE,lu.prototype.sqrTo=yE;function TE(B,M){var J=B.bitLength(),K,Q=l(1),y;if(J<=0)return Q;else if(J<18)K=1;else if(J<48)K=3;else if(J<144)K=4;else if(J<768)K=5;else K=6;if(J<8)y=new r(M);else if(M.isEven())y=new lu(M);else y=new WD(M);var j=new Array,_=3,uD=K-1,zD=(1<<K)-1;if(j[1]=y.convert(this),K>1){var Du=$();y.sqrTo(j[1],Du);while(_<=zD)j[_]=$(),y.mulTo(Du,j[_-2],j[_]),_+=2}var aD=B.t-1,Nu,Y1=!0,Mu=$(),Yu;J=V(B[aD])-1;while(aD>=0){if(J>=uD)Nu=B[aD]>>J-uD&zD;else if(Nu=(B[aD]&(1<<J+1)-1)<<uD-J,aD>0)Nu|=B[aD-1]>>this.DB+J-uD;_=K;while((Nu&1)==0)Nu>>=1,--_;if((J-=_)<0)J+=this.DB,--aD;if(Y1)j[Nu].copyTo(Q),Y1=!1;else{while(_>1)y.sqrTo(Q,Mu),y.sqrTo(Mu,Q),_-=2;if(_>0)y.sqrTo(Q,Mu);else Yu=Q,Q=Mu,Mu=Yu;y.mulTo(Mu,j[Nu],Q)}while(aD>=0&&(B[aD]&1<<J)==0)if(y.sqrTo(Q,Mu),Yu=Q,Q=Mu,Mu=Yu,--J<0)J=this.DB-1,--aD}return y.revert(Q)}function VE(B){var M=this.s<0?this.negate():this.clone(),J=B.s<0?B.negate():B.clone();if(M.compareTo(J)<0){var K=M;M=J,J=K}var Q=M.getLowestSetBit(),y=J.getLowestSetBit();if(y<0)return M;if(Q<y)y=Q;if(y>0)M.rShiftTo(y,M),J.rShiftTo(y,J);while(M.signum()>0){if((Q=M.getLowestSetBit())>0)M.rShiftTo(Q,M);if((Q=J.getLowestSetBit())>0)J.rShiftTo(Q,J);if(M.compareTo(J)>=0)M.subTo(J,M),M.rShiftTo(1,M);else J.subTo(M,J),J.rShiftTo(1,J)}if(y>0)J.lShiftTo(y,J);return J}function LE(B){if(B<=0)return 0;var M=this.DV%B,J=this.s<0?B-1:0;if(this.t>0)if(M==0)J=this[0]%B;else for(var K=this.t-1;K>=0;--K)J=(M*J+this[K])%B;return J}function NE(B){var M=B.isEven();if(this.isEven()&&M||B.signum()==0)return C.ZERO;var J=B.clone(),K=this.clone(),Q=l(1),y=l(0),j=l(0),_=l(1);while(J.signum()!=0){while(J.isEven()){if(J.rShiftTo(1,J),M){if(!Q.isEven()||!y.isEven())Q.addTo(this,Q),y.subTo(B,y);Q.rShiftTo(1,Q)}else if(!y.isEven())y.subTo(B,y);y.rShiftTo(1,y)}while(K.isEven()){if(K.rShiftTo(1,K),M){if(!j.isEven()||!_.isEven())j.addTo(this,j),_.subTo(B,_);j.rShiftTo(1,j)}else if(!_.isEven())_.subTo(B,_);_.rShiftTo(1,_)}if(J.compareTo(K)>=0){if(J.subTo(K,J),M)Q.subTo(j,Q);y.subTo(_,y)}else{if(K.subTo(J,K),M)j.subTo(Q,j);_.subTo(y,_)}}if(K.compareTo(C.ONE)!=0)return C.ZERO;if(_.compareTo(B)>=0)return _.subtract(B);if(_.signum()<0)_.addTo(B,_);else return _;if(_.signum()<0)return _.add(B);else return _}var jD=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],hE=67108864/jD[jD.length-1];function IE(B){var M,J=this.abs();if(J.t==1&&J[0]<=jD[jD.length-1]){for(M=0;M<jD.length;++M)if(J[0]==jD[M])return!0;return!1}if(J.isEven())return!1;M=1;while(M<jD.length){var K=jD[M],Q=M+1;while(Q<jD.length&&K<hE)K*=jD[Q++];K=J.modInt(K);while(M<Q)if(K%jD[M++]==0)return!1}return J.millerRabin(B)}function RE(B){var M=this.subtract(C.ONE),J=M.getLowestSetBit();if(J<=0)return!1;var K=M.shiftRight(J);if(B=B+1>>1,B>jD.length)B=jD.length;var Q=$();for(var y=0;y<B;++y){Q.fromInt(jD[Math.floor(Math.random()*jD.length)]);var j=Q.modPow(K,this);if(j.compareTo(C.ONE)!=0&&j.compareTo(M)!=0){var _=1;while(_++<J&&j.compareTo(M)!=0)if(j=j.modPowInt(2,this),j.compareTo(C.ONE)==0)return!1;if(j.compareTo(M)!=0)return!1}}return!0}C.prototype.chunkSize=P5,C.prototype.toRadix=k5,C.prototype.fromRadix=S5,C.prototype.fromNumber=_5,C.prototype.bitwiseTo=c5,C.prototype.changeBit=DE,C.prototype.addTo=$E,C.prototype.dMultiply=ZE,C.prototype.dAddOffset=KE,C.prototype.multiplyLowerTo=zE,C.prototype.multiplyUpperTo=AE,C.prototype.modInt=LE,C.prototype.millerRabin=RE,C.prototype.clone=L0,C.prototype.intValue=N0,C.prototype.byteValue=f3,C.prototype.shortValue=R5,C.prototype.signum=j5,C.prototype.toByteArray=g5,C.prototype.equals=b5,C.prototype.min=m5,C.prototype.max=v5,C.prototype.and=n5,C.prototype.or=f5,C.prototype.xor=d5,C.prototype.andNot=i5,C.prototype.not=l5,C.prototype.shiftLeft=r5,C.prototype.shiftRight=p5,C.prototype.getLowestSetBit=t5,C.prototype.bitCount=s5,C.prototype.testBit=e5,C.prototype.setBit=uE,C.prototype.clearBit=FE,C.prototype.flipBit=CE,C.prototype.add=EE,C.prototype.subtract=wE,C.prototype.multiply=BE,C.prototype.divide=YE,C.prototype.remainder=JE,C.prototype.divideAndRemainder=qE,C.prototype.modPow=TE,C.prototype.modInverse=NE,C.prototype.pow=GE,C.prototype.gcd=VE,C.prototype.isProbablePrime=IE,C.prototype.square=ME,C.prototype.Barrett=lu;var M1,pD,GD;function PE(B){if(pD[GD++]^=B&255,pD[GD++]^=B>>8&255,pD[GD++]^=B>>16&255,pD[GD++]^=B>>24&255,GD>=I8)GD-=I8}function r3(){PE(new Date().getTime())}if(pD==null){pD=new Array,GD=0;var Bu;if(typeof window!=="undefined"&&window.crypto){if(window.crypto.getRandomValues){var p3=new Uint8Array(32);window.crypto.getRandomValues(p3);for(Bu=0;Bu<32;++Bu)pD[GD++]=p3[Bu]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var a3=window.crypto.random(32);for(Bu=0;Bu<a3.length;++Bu)pD[GD++]=a3.charCodeAt(Bu)&255}}while(GD<I8)Bu=Math.floor(65536*Math.random()),pD[GD++]=Bu>>>8,pD[GD++]=Bu&255;GD=0,r3()}function jE(){if(M1==null){r3(),M1=gE(),M1.init(pD);for(GD=0;GD<pD.length;++GD)pD[GD]=0;GD=0}return M1.next()}function kE(B){var M;for(M=0;M<B.length;++M)B[M]=jE()}function N8(){}N8.prototype.nextBytes=kE;function h8(){this.i=0,this.j=0,this.S=new Array}function SE(B){var M,J,K;for(M=0;M<256;++M)this.S[M]=M;J=0;for(M=0;M<256;++M)J=J+this.S[M]+B[M%B.length]&255,K=this.S[M],this.S[M]=this.S[J],this.S[J]=K;this.i=0,this.j=0}function _E(){var B;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,B=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=B,this.S[B+this.S[this.i]&255]}h8.prototype.init=SE,h8.prototype.next=_E;function gE(){return new h8}var I8=256;if(typeof Q8!=="undefined")Q8=a$.exports={default:C,BigInteger:C,SecureRandom:N8};else this.jsbn={BigInteger:C,SecureRandom:N8}}).call(Q8)});var w1=h((t$)=>{(function(){var D={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function u(E){return C(w(E),arguments)}function F(E,Y){return u.apply(null,[E].concat(Y||[]))}function C(E,Y){var q=1,W=E.length,Z,G="",A,z,X,k,m,c,l,d;for(A=0;A<W;A++)if(typeof E[A]==="string")G+=E[A];else if(typeof E[A]==="object"){if(X=E[A],X.keys){Z=Y[q];for(z=0;z<X.keys.length;z++){if(Z==null)throw new Error(u('[sprintf] Cannot access property "%s" of undefined value "%s"',X.keys[z],X.keys[z-1]));Z=Z[X.keys[z]]}}else if(X.param_no)Z=Y[X.param_no];else Z=Y[q++];if(D.not_type.test(X.type)&&D.not_primitive.test(X.type)&&Z instanceof Function)Z=Z();if(D.numeric_arg.test(X.type)&&(typeof Z!=="number"&&isNaN(Z)))throw new TypeError(u("[sprintf] expecting number but found %T",Z));if(D.number.test(X.type))l=Z>=0;switch(X.type){case"b":Z=parseInt(Z,10).toString(2);break;case"c":Z=String.fromCharCode(parseInt(Z,10));break;case"d":case"i":Z=parseInt(Z,10);break;case"j":Z=JSON.stringify(Z,null,X.width?parseInt(X.width):0);break;case"e":Z=X.precision?parseFloat(Z).toExponential(X.precision):parseFloat(Z).toExponential();break;case"f":Z=X.precision?parseFloat(Z).toFixed(X.precision):parseFloat(Z);break;case"g":Z=X.precision?String(Number(Z.toPrecision(X.precision))):parseFloat(Z);break;case"o":Z=(parseInt(Z,10)>>>0).toString(8);break;case"s":Z=String(Z),Z=X.precision?Z.substring(0,X.precision):Z;break;case"t":Z=String(!!Z),Z=X.precision?Z.substring(0,X.precision):Z;break;case"T":Z=Object.prototype.toString.call(Z).slice(8,-1).toLowerCase(),Z=X.precision?Z.substring(0,X.precision):Z;break;case"u":Z=parseInt(Z,10)>>>0;break;case"v":Z=Z.valueOf(),Z=X.precision?Z.substring(0,X.precision):Z;break;case"x":Z=(parseInt(Z,10)>>>0).toString(16);break;case"X":Z=(parseInt(Z,10)>>>0).toString(16).toUpperCase();break}if(D.json.test(X.type))G+=Z;else{if(D.number.test(X.type)&&(!l||X.sign))d=l?"+":"-",Z=Z.toString().replace(D.sign,"");else d="";m=X.pad_char?X.pad_char==="0"?"0":X.pad_char.charAt(1):" ",c=X.width-(d+Z).length,k=X.width?c>0?m.repeat(c):"":"",G+=X.align?d+Z+k:m==="0"?d+k+Z:k+d+Z}}return G}var $=Object.create(null);function w(E){if($[E])return $[E];var Y=E,q,W=[],Z=0;while(Y){if((q=D.text.exec(Y))!==null)W.push(q[0]);else if((q=D.modulo.exec(Y))!==null)W.push("%");else if((q=D.placeholder.exec(Y))!==null){if(q[2]){Z|=1;var G=[],A=q[2],z=[];if((z=D.key.exec(A))!==null){G.push(z[1]);while((A=A.substring(z[0].length))!=="")if((z=D.key_access.exec(A))!==null)G.push(z[1]);else if((z=D.index_access.exec(A))!==null)G.push(z[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key")}else throw new SyntaxError("[sprintf] failed to parse named argument key");q[2]=G}else Z|=2;if(Z===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");W.push({placeholder:q[0],param_no:q[1],keys:q[2],sign:q[3],pad_char:q[4],align:q[5],width:q[6],precision:q[7],type:q[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");Y=Y.substring(q[0].length)}return $[E]=W}if(typeof t$!=="undefined")t$.sprintf=u,t$.vsprintf=F;if(typeof window!=="undefined"){if(window.sprintf=u,window.vsprintf=F,typeof define==="function"&&define.amd)define(function(){return{sprintf:u,vsprintf:F}})}})()});var R3=h((Tu)=>{var QW=Tu&&Tu.__createBinding||(Object.create?function(D,u,F,C){if(C===void 0)C=F;var $=Object.getOwnPropertyDescriptor(u,F);if(!$||("get"in $?!u.__esModule:$.writable||$.configurable))$={enumerable:!0,get:function(){return u[F]}};Object.defineProperty(D,C,$)}:function(D,u,F,C){if(C===void 0)C=F;D[C]=u[F]}),HW=Tu&&Tu.__setModuleDefault||(Object.create?function(D,u){Object.defineProperty(D,"default",{enumerable:!0,value:u})}:function(D,u){D.default=u}),e$=Tu&&Tu.__importStar||function(D){if(D&&D.__esModule)return D;var u={};if(D!=null){for(var F in D)if(F!=="default"&&Object.prototype.hasOwnProperty.call(D,F))QW(u,D,F)}return HW(u,D),u};Object.defineProperty(Tu,"__esModule",{value:!0});Tu.Address4=void 0;var o$=e$(N3()),Gu=e$(h3()),s$=A8(),B1=I3(),H0=w1();class $u{constructor(D){this.groups=Gu.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=o$.isCorrect(Gu.BITS),this.isInSubnet=o$.isInSubnet,this.address=D;let u=Gu.RE_SUBNET_STRING.exec(D);if(u){if(this.parsedSubnet=u[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>Gu.BITS)throw new s$.AddressError("Invalid subnet mask.");D=D.replace(Gu.RE_SUBNET_STRING,"")}this.addressMinusSuffix=D,this.parsedAddress=this.parse(D)}static isValid(D){try{return new $u(D),!0}catch(u){return!1}}parse(D){let u=D.split(".");if(!D.match(Gu.RE_ADDRESS))throw new s$.AddressError("Invalid IPv4 address.");return u}correctForm(){return this.parsedAddress.map((D)=>parseInt(D,10)).join(".")}static fromHex(D){let u=D.replace(/:/g,"").padStart(8,"0"),F=[],C;for(C=0;C<8;C+=2){let $=u.slice(C,C+2);F.push(parseInt($,16))}return new $u(F.join("."))}static fromInteger(D){return $u.fromHex(D.toString(16))}static fromArpa(D){let F=D.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new $u(F)}toHex(){return this.parsedAddress.map((D)=>H0.sprintf("%02x",parseInt(D,10))).join(":")}toArray(){return this.parsedAddress.map((D)=>parseInt(D,10))}toGroup6(){let D=[],u;for(u=0;u<Gu.GROUPS;u+=2){let F=H0.sprintf("%02x%02x",parseInt(this.parsedAddress[u],10),parseInt(this.parsedAddress[u+1],10));D.push(H0.sprintf("%x",parseInt(F,16)))}return D.join(":")}bigInteger(){return new B1.BigInteger(this.parsedAddress.map((D)=>H0.sprintf("%02x",parseInt(D,10))).join(""),16)}_startAddress(){return new B1.BigInteger(this.mask()+"0".repeat(Gu.BITS-this.subnetMask),2)}startAddress(){return $u.fromBigInteger(this._startAddress())}startAddressExclusive(){let D=new B1.BigInteger("1");return $u.fromBigInteger(this._startAddress().add(D))}_endAddress(){return new B1.BigInteger(this.mask()+"1".repeat(Gu.BITS-this.subnetMask),2)}endAddress(){return $u.fromBigInteger(this._endAddress())}endAddressExclusive(){let D=new B1.BigInteger("1");return $u.fromBigInteger(this._endAddress().subtract(D))}static fromBigInteger(D){return $u.fromInteger(parseInt(D.toString(),10))}mask(D){if(D===void 0)D=this.subnetMask;return this.getBitsBase2(0,D)}getBitsBase2(D,u){return this.binaryZeroPad().slice(D,u)}reverseForm(D){if(!D)D={};let u=this.correctForm().split(".").reverse().join(".");if(D.omitSuffix)return u;return H0.sprintf("%s.in-addr.arpa.",u)}isMulticast(){return this.isInSubnet(new $u("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(Gu.BITS,"0")}groupForV6(){let D=this.parsedAddress;return this.address.replace(Gu.RE_ADDRESS,H0.sprintf('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',D.slice(0,2).join("."),D.slice(2,4).join(".")))}}Tu.Address4=$u});var P3=h((D5)=>{Object.defineProperty(D5,"__esModule",{value:!0});D5.RE_URL_WITH_PORT=D5.RE_URL=D5.RE_ZONE_STRING=D5.RE_SUBNET_STRING=D5.RE_BAD_ADDRESS=D5.RE_BAD_CHARACTERS=D5.TYPES=D5.SCOPES=D5.GROUPS=D5.BITS=void 0;D5.BITS=128;D5.GROUPS=8;D5.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};D5.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};D5.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;D5.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;D5.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;D5.RE_ZONE_STRING=/%.*$/;D5.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/);D5.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)});var j3=h((E5)=>{Object.defineProperty(E5,"__esModule",{value:!0});E5.simpleGroup=E5.spanLeadingZeroes=E5.spanAll=E5.spanAllZeroes=void 0;var F5=w1();function C5(D){return D.replace(/(0+)/g,'<span class="zero">$1</span>')}E5.spanAllZeroes=C5;function RW(D,u=0){return D.split("").map((C,$)=>F5.sprintf('<span class="digit value-%s position-%d">%s</span>',C,$+u,C5(C))).join("")}E5.spanAll=RW;function $5(D){return D.replace(/^(0+)/,'<span class="zero">$1</span>')}function PW(D){return D.split(":").map((F)=>$5(F)).join(":")}E5.spanLeadingZeroes=PW;function jW(D,u=0){return D.split(":").map((C,$)=>{if(/group-v4/.test(C))return C;return F5.sprintf('<span class="hover-group group-%d">%s</span>',$+u,$5(C))})}E5.simpleGroup=jW});var B5=h((UD)=>{var gW=UD&&UD.__createBinding||(Object.create?function(D,u,F,C){if(C===void 0)C=F;var $=Object.getOwnPropertyDescriptor(u,F);if(!$||("get"in $?!u.__esModule:$.writable||$.configurable))$={enumerable:!0,get:function(){return u[F]}};Object.defineProperty(D,C,$)}:function(D,u,F,C){if(C===void 0)C=F;D[C]=u[F]}),bW=UD&&UD.__setModuleDefault||(Object.create?function(D,u){Object.defineProperty(D,"default",{enumerable:!0,value:u})}:function(D,u){D.default=u}),mW=UD&&UD.__importStar||function(D){if(D&&D.__esModule)return D;var u={};if(D!=null){for(var F in D)if(F!=="default"&&Object.prototype.hasOwnProperty.call(D,F))gW(u,D,F)}return bW(u,D),u};Object.defineProperty(UD,"__esModule",{value:!0});UD.possibleElisions=UD.simpleRegularExpression=UD.ADDRESS_BOUNDARY=UD.padGroup=UD.groupPossibilities=void 0;var vW=mW(P3()),U0=w1();function U8(D){return U0.sprintf("(%s)",D.join("|"))}UD.groupPossibilities=U8;function H8(D){if(D.length<4)return U0.sprintf("0{0,%d}%s",4-D.length,D);return D}UD.padGroup=H8;UD.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function cW(D){let u=[];D.forEach((C,$)=>{if(parseInt(C,16)===0)u.push($)});let F=u.map((C)=>D.map(($,w)=>{if(w===C){let E=w===0||w===vW.GROUPS-1?":":"";return U8([H8($),E])}return H8($)}).join(":"));return F.push(D.map(H8).join(":")),U8(F)}UD.simpleRegularExpression=cW;function xW(D,u,F){let C=u?"":":",$=F?"":":",w=[];if(!u&&!F)w.push("::");if(u&&F)w.push("");if(F&&!u||!F&&u)w.push(":");w.push(U0.sprintf("%s(:0{1,4}){1,%d}",C,D-1)),w.push(U0.sprintf("(0{1,4}:){1,%d}%s",D-1,$)),w.push(U0.sprintf("(0{1,4}:){%d}0{1,4}",D-1));for(let E=1;E<D-1;E++)for(let Y=1;Y<D-E;Y++)w.push(U0.sprintf("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",Y,D-Y-E-1));return U8(w)}UD.possibleElisions=xW});var q5=h((Vu)=>{var nW=Vu&&Vu.__createBinding||(Object.create?function(D,u,F,C){if(C===void 0)C=F;var $=Object.getOwnPropertyDescriptor(u,F);if(!$||("get"in $?!u.__esModule:$.writable||$.configurable))$={enumerable:!0,get:function(){return u[F]}};Object.defineProperty(D,C,$)}:function(D,u,F,C){if(C===void 0)C=F;D[C]=u[F]}),fW=Vu&&Vu.__setModuleDefault||(Object.create?function(D,u){Object.defineProperty(D,"default",{enumerable:!0,value:u})}:function(D,u){D.default=u}),O8=Vu&&Vu.__importStar||function(D){if(D&&D.__esModule)return D;var u={};if(D!=null){for(var F in D)if(F!=="default"&&Object.prototype.hasOwnProperty.call(D,F))nW(u,D,F)}return fW(u,D),u};Object.defineProperty(Vu,"__esModule",{value:!0});Vu.Address6=void 0;var M5=O8(N3()),k3=O8(h3()),e=O8(P3()),S3=O8(j3()),u0=R3(),F0=B5(),ku=A8(),cD=I3(),xD=w1();function y8(D){if(!D)throw new Error("Assertion failed.")}function dW(D){let u=/(\d+)(\d{3})/;while(u.test(D))D=D.replace(u,"$1,$2");return D}function iW(D){return D=D.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),D=D.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),D}function lW(D,u){let F=[],C=[],$;for($=0;$<D.length;$++)if($<u[0])F.push(D[$]);else if($>u[1])C.push(D[$]);return F.concat(["compact"]).concat(C)}function Y5(D){return xD.sprintf("%04x",parseInt(D,16))}function J5(D){return D&255}class yD{constructor(D,u){if(this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=M5.isInSubnet,this.isCorrect=M5.isCorrect(e.BITS),u===void 0)this.groups=e.GROUPS;else this.groups=u;this.address=D;let F=e.RE_SUBNET_STRING.exec(D);if(F){if(this.parsedSubnet=F[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>e.BITS)throw new ku.AddressError("Invalid subnet mask.");D=D.replace(e.RE_SUBNET_STRING,"")}else if(/\//.test(D))throw new ku.AddressError("Invalid subnet mask.");let C=e.RE_ZONE_STRING.exec(D);if(C)this.zone=C[0],D=D.replace(e.RE_ZONE_STRING,"");this.addressMinusSuffix=D,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(D){try{return new yD(D),!0}catch(u){return!1}}static fromBigInteger(D){let u=D.toString(16).padStart(32,"0"),F=[],C;for(C=0;C<e.GROUPS;C++)F.push(u.slice(C*4,(C+1)*4));return new yD(F.join(":"))}static fromURL(D){let u,F=null,C;if(D.indexOf("[")!==-1&&D.indexOf("]:")!==-1){if(C=e.RE_URL_WITH_PORT.exec(D),C===null)return{error:"failed to parse address with port",address:null,port:null};u=C[1],F=C[2]}else if(D.indexOf("/")!==-1){if(D=D.replace(/^[a-z0-9]+:\/\//,""),C=e.RE_URL.exec(D),C===null)return{error:"failed to parse address from URL",address:null,port:null};u=C[1]}else u=D;if(F){if(F=parseInt(F,10),F<0||F>65536)F=null}else F=null;return{address:new yD(u),port:F}}static fromAddress4(D){let u=new u0.Address4(D),F=e.BITS-(k3.BITS-u.subnetMask);return new yD(`::ffff:${u.correctForm()}/${F}`)}static fromArpa(D){let u=D.replace(/(\.ip6\.arpa)?\.$/,""),F=7;if(u.length!==63)throw new ku.AddressError("Invalid 'ip6.arpa' form.");let C=u.split(".").reverse();for(let $=F;$>0;$--){let w=$*4;C.splice(w,0,":")}return u=C.join(""),new yD(u)}microsoftTranscription(){return xD.sprintf("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(D=this.subnetMask){return this.getBitsBase2(0,D)}possibleSubnets(D=128){let u=e.BITS-this.subnetMask,F=Math.abs(D-e.BITS),C=u-F;if(C<0)return"0";return dW(new cD.BigInteger("2",10).pow(C).toString(10))}_startAddress(){return new cD.BigInteger(this.mask()+"0".repeat(e.BITS-this.subnetMask),2)}startAddress(){return yD.fromBigInteger(this._startAddress())}startAddressExclusive(){let D=new cD.BigInteger("1");return yD.fromBigInteger(this._startAddress().add(D))}_endAddress(){return new cD.BigInteger(this.mask()+"1".repeat(e.BITS-this.subnetMask),2)}endAddress(){return yD.fromBigInteger(this._endAddress())}endAddressExclusive(){let D=new cD.BigInteger("1");return yD.fromBigInteger(this._endAddress().subtract(D))}getScope(){let D=e.SCOPES[this.getBits(12,16).intValue()];if(this.getType()==="Global unicast"&&D!=="Link local")D="Global";return D||"Unknown"}getType(){for(let D of Object.keys(e.TYPES))if(this.isInSubnet(new yD(D)))return e.TYPES[D];return"Global unicast"}getBits(D,u){return new cD.BigInteger(this.getBitsBase2(D,u),2)}getBitsBase2(D,u){return this.binaryZeroPad().slice(D,u)}getBitsBase16(D,u){let F=u-D;if(F%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(D,u).toString(16).padStart(F/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,e.BITS)}reverseForm(D){if(!D)D={};let u=Math.floor(this.subnetMask/4),F=this.canonicalForm().replace(/:/g,"").split("").slice(0,u).reverse().join(".");if(u>0){if(D.omitSuffix)return F;return xD.sprintf("%s.ip6.arpa.",F)}if(D.omitSuffix)return"";return"ip6.arpa."}correctForm(){let D,u=[],F=0,C=[];for(D=0;D<this.parsedAddress.length;D++){let E=parseInt(this.parsedAddress[D],16);if(E===0)F++;if(E!==0&&F>0){if(F>1)C.push([D-F,D-1]);F=0}}if(F>1)C.push([this.parsedAddress.length-F,this.parsedAddress.length-1]);let $=C.map((E)=>E[1]-E[0]+1);if(C.length>0){let E=$.indexOf(Math.max(...$));u=lW(this.parsedAddress,C[E])}else u=this.parsedAddress;for(D=0;D<u.length;D++)if(u[D]!=="compact")u[D]=parseInt(u[D],16).toString(16);let w=u.join(":");return w=w.replace(/^compact$/,"::"),w=w.replace(/^compact|compact$/,":"),w=w.replace(/compact/,""),w}binaryZeroPad(){return this.bigInteger().toString(2).padStart(e.BITS,"0")}parse4in6(D){let u=D.split(":"),C=u.slice(-1)[0].match(k3.RE_ADDRESS);if(C){this.parsedAddress4=C[0],this.address4=new u0.Address4(this.parsedAddress4);for(let $=0;$<this.address4.groups;$++)if(/^0[0-9]+/.test(this.address4.parsedAddress[$]))throw new ku.AddressError("IPv4 addresses can't have leading zeroes.",D.replace(k3.RE_ADDRESS,this.address4.parsedAddress.map(iW).join(".")));this.v4=!0,u[u.length-1]=this.address4.toGroup6(),D=u.join(":")}return D}parse(D){D=this.parse4in6(D);let u=D.match(e.RE_BAD_CHARACTERS);if(u)throw new ku.AddressError(xD.sprintf("Bad character%s detected in address: %s",u.length>1?"s":"",u.join("")),D.replace(e.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let F=D.match(e.RE_BAD_ADDRESS);if(F)throw new ku.AddressError(xD.sprintf("Address failed regex: %s",F.join("")),D.replace(e.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let C=[],$=D.split("::");if($.length===2){let w=$[0].split(":"),E=$[1].split(":");if(w.length===1&&w[0]==="")w=[];if(E.length===1&&E[0]==="")E=[];let Y=this.groups-(w.length+E.length);if(!Y)throw new ku.AddressError("Error parsing groups");this.elidedGroups=Y,this.elisionBegin=w.length,this.elisionEnd=w.length+this.elidedGroups,C=C.concat(w);for(let q=0;q<Y;q++)C.push("0");C=C.concat(E)}else if($.length===1)C=D.split(":"),this.elidedGroups=0;else throw new ku.AddressError("Too many :: groups found");if(C=C.map((w)=>xD.sprintf("%x",parseInt(w,16))),C.length!==this.groups)throw new ku.AddressError("Incorrect number of groups found");return C}canonicalForm(){return this.parsedAddress.map(Y5).join(":")}decimal(){return this.parsedAddress.map((D)=>xD.sprintf("%05d",parseInt(D,16))).join(":")}bigInteger(){return new cD.BigInteger(this.parsedAddress.map(Y5).join(""),16)}to4(){let D=this.binaryZeroPad().split("");return u0.Address4.fromHex(new cD.BigInteger(D.slice(96,128).join(""),2).toString(16))}to4in6(){let D=this.to4(),F=new yD(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),C="";if(!/:$/.test(F))C=":";return F+C+D.address}inspectTeredo(){let D=this.getBitsBase16(0,32),u=this.getBits(80,96).xor(new cD.BigInteger("ffff",16)).toString(),F=u0.Address4.fromHex(this.getBitsBase16(32,64)),C=u0.Address4.fromHex(this.getBits(96,128).xor(new cD.BigInteger("ffffffff",16)).toString(16)),$=this.getBits(64,80),w=this.getBitsBase2(64,80),E=$.testBit(15),Y=$.testBit(14),q=$.testBit(8),W=$.testBit(9),Z=new cD.BigInteger(w.slice(2,6)+w.slice(8,16),2).toString(10);return{prefix:xD.sprintf("%s:%s",D.slice(0,4),D.slice(4,8)),server4:F.address,client4:C.address,flags:w,coneNat:E,microsoft:{reserved:Y,universalLocal:W,groupIndividual:q,nonce:Z},udpPort:u}}inspect6to4(){let D=this.getBitsBase16(0,16),u=u0.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:xD.sprintf("%s",D.slice(0,4)),gateway:u.address}}to6to4(){if(!this.is4())return null;let D=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new yD(D)}toByteArray(){let D=this.bigInteger().toByteArray();if(D.length===17&&D[0]===0)return D.slice(1);return D}toUnsignedByteArray(){return this.toByteArray().map(J5)}static fromByteArray(D){return this.fromUnsignedByteArray(D.map(J5))}static fromUnsignedByteArray(D){let u=new cD.BigInteger("256",10),F=new cD.BigInteger("0",10),C=new cD.BigInteger("1",10);for(let $=D.length-1;$>=0;$--)F=F.add(C.multiply(new cD.BigInteger(D[$].toString(10),10))),C=C.multiply(u);return yD.fromBigInteger(F)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){if(this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000")return!0;return!1}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new yD("2001::/32"))}is6to4(){return this.isInSubnet(new yD("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(D){if(D===void 0)D="";else D=xD.sprintf(":%s",D);return xD.sprintf("http://[%s]%s/",this.correctForm(),D)}link(D){if(!D)D={};if(D.className===void 0)D.className="";if(D.prefix===void 0)D.prefix="/#address=";if(D.v4===void 0)D.v4=!1;let u=this.correctForm;if(D.v4)u=this.to4in6;if(D.className)return xD.sprintf('<a href="%1$s%2$s" class="%3$s">%2$s</a>',D.prefix,u.call(this),D.className);return xD.sprintf('<a href="%1$s%2$s">%2$s</a>',D.prefix,u.call(this))}group(){if(this.elidedGroups===0)return S3.simpleGroup(this.address).join(":");y8(typeof this.elidedGroups==="number"),y8(typeof this.elisionBegin==="number");let D=[],[u,F]=this.address.split("::");if(u.length)D.push(...S3.simpleGroup(u));else D.push("");let C=["hover-group"];for(let $=this.elisionBegin;$<this.elisionBegin+this.elidedGroups;$++)C.push(xD.sprintf("group-%d",$));if(D.push(xD.sprintf('<span class="%s"></span>',C.join(" "))),F.length)D.push(...S3.simpleGroup(F,this.elisionEnd));else D.push("");if(this.is4())y8(this.address4 instanceof u0.Address4),D.pop(),D.push(this.address4.groupForV6());return D.join(":")}regularExpressionString(D=!1){let u=[],F=new yD(this.correctForm());if(F.elidedGroups===0)u.push(F0.simpleRegularExpression(F.parsedAddress));else if(F.elidedGroups===e.GROUPS)u.push(F0.possibleElisions(e.GROUPS));else{let C=F.address.split("::");if(C[0].length)u.push(F0.simpleRegularExpression(C[0].split(":")));if(y8(typeof F.elidedGroups==="number"),u.push(F0.possibleElisions(F.elidedGroups,C[0].length!==0,C[1].length!==0)),C[1].length)u.push(F0.simpleRegularExpression(C[1].split(":")));u=[u.join(":")]}if(!D)u=["(?=^|",F0.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...u,")(?=[^\\w\\:]|",F0.ADDRESS_BOUNDARY,"|$)"];return u.join("")}regularExpression(D=!1){return new RegExp(this.regularExpressionString(D),"i")}}Vu.Address6=yD});var _3=h((RD)=>{var rW=RD&&RD.__createBinding||(Object.create?function(D,u,F,C){if(C===void 0)C=F;var $=Object.getOwnPropertyDescriptor(u,F);if(!$||("get"in $?!u.__esModule:$.writable||$.configurable))$={enumerable:!0,get:function(){return u[F]}};Object.defineProperty(D,C,$)}:function(D,u,F,C){if(C===void 0)C=F;D[C]=u[F]}),pW=RD&&RD.__setModuleDefault||(Object.create?function(D,u){Object.defineProperty(D,"default",{enumerable:!0,value:u})}:function(D,u){D.default=u}),aW=RD&&RD.__importStar||function(D){if(D&&D.__esModule)return D;var u={};if(D!=null){for(var F in D)if(F!=="default"&&Object.prototype.hasOwnProperty.call(D,F))rW(u,D,F)}return pW(u,D),u};Object.defineProperty(RD,"__esModule",{value:!0});RD.v6=RD.AddressError=RD.Address6=RD.Address4=void 0;var tW=R3();Object.defineProperty(RD,"Address4",{enumerable:!0,get:function(){return tW.Address4}});var oW=q5();Object.defineProperty(RD,"Address6",{enumerable:!0,get:function(){return oW.Address6}});var sW=A8();Object.defineProperty(RD,"AddressError",{enumerable:!0,get:function(){return sW.AddressError}});var eW=aW(j3());RD.v6={helpers:eW}});var Q5=h((z5)=>{Object.defineProperty(z5,"__esModule",{value:!0});z5.ipToBuffer=z5.int32ToIpv4=z5.ipv4ToInt32=z5.validateSocksClientChainOptions=z5.validateSocksClientOptions=void 0;var nD=L3(),OD=V3(),DG=FD("node:stream"),g3=_3(),Z5=FD("node:net");function uG(D,u=["connect","bind","associate"]){if(!OD.SocksCommand[D.command])throw new nD.SocksClientError(OD.ERRORS.InvalidSocksCommand,D);if(u.indexOf(D.command)===-1)throw new nD.SocksClientError(OD.ERRORS.InvalidSocksCommandForOperation,D);if(!X5(D.destination))throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsDestination,D);if(!W5(D.proxy))throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsProxy,D);if(K5(D.proxy,D),D.timeout&&!G5(D.timeout))throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsTimeout,D);if(D.existing_socket&&!(D.existing_socket instanceof DG.Duplex))throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsExistingSocket,D)}z5.validateSocksClientOptions=uG;function FG(D){if(D.command!=="connect")throw new nD.SocksClientError(OD.ERRORS.InvalidSocksCommandChain,D);if(!X5(D.destination))throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsDestination,D);if(!(D.proxies&&Array.isArray(D.proxies)&&D.proxies.length>=2))throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsProxiesLength,D);if(D.proxies.forEach((u)=>{if(!W5(u))throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsProxy,D);K5(u,D)}),D.timeout&&!G5(D.timeout))throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsTimeout,D)}z5.validateSocksClientChainOptions=FG;function K5(D,u){if(D.custom_auth_method!==void 0){if(D.custom_auth_method<OD.SOCKS5_CUSTOM_AUTH_START||D.custom_auth_method>OD.SOCKS5_CUSTOM_AUTH_END)throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsCustomAuthRange,u);if(D.custom_auth_request_handler===void 0||typeof D.custom_auth_request_handler!=="function")throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,u);if(D.custom_auth_response_size===void 0)throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,u);if(D.custom_auth_response_handler===void 0||typeof D.custom_auth_response_handler!=="function")throw new nD.SocksClientError(OD.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,u)}}function X5(D){return D&&typeof D.host==="string"&&typeof D.port==="number"&&D.port>=0&&D.port<=65535}function W5(D){return D&&(typeof D.host==="string"||typeof D.ipaddress==="string")&&typeof D.port==="number"&&D.port>=0&&D.port<=65535&&(D.type===4||D.type===5)}function G5(D){return typeof D==="number"&&D>0}function CG(D){return new g3.Address4(D).toArray().reduce((F,C)=>(F<<8)+C,0)}z5.ipv4ToInt32=CG;function $G(D){let u=D>>>24&255,F=D>>>16&255,C=D>>>8&255,$=D&255;return[u,F,C,$].join(".")}z5.int32ToIpv4=$G;function EG(D){if(Z5.isIPv4(D)){let u=new g3.Address4(D);return Buffer.from(u.toArray())}else if(Z5.isIPv6(D)){let u=new g3.Address6(D);return Buffer.from(u.canonicalForm().split(":").map((F)=>F.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}z5.ipToBuffer=EG});var O5=h((U5)=>{Object.defineProperty(U5,"__esModule",{value:!0});U5.ReceiveBuffer=void 0;class H5{constructor(D=4096){this.buffer=Buffer.allocUnsafe(D),this.offset=0,this.originalSize=D}get length(){return this.offset}append(D){if(!Buffer.isBuffer(D))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+D.length>=this.buffer.length){let u=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+D.length)),u.copy(this.buffer)}return D.copy(this.buffer,this.offset),this.offset+=D.length}peek(D){if(D>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,D)}get(D){if(D>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let u=Buffer.allocUnsafe(D);return this.buffer.slice(0,D).copy(u),this.buffer.copyWithin(0,D,D+this.offset-D),this.offset-=D,u}}U5.ReceiveBuffer=H5});var T5=h((iu)=>{var y0=iu&&iu.__awaiter||function(D,u,F,C){function $(w){return w instanceof F?w:new F(function(E){E(w)})}return new(F||(F=Promise))(function(w,E){function Y(Z){try{W(C.next(Z))}catch(G){E(G)}}function q(Z){try{W(C.throw(Z))}catch(G){E(G)}}function W(Z){Z.done?w(Z.value):$(Z.value).then(Y,q)}W((C=C.apply(D,u||[])).next())})};Object.defineProperty(iu,"__esModule",{value:!0});iu.SocksClientError=iu.SocksClient=void 0;var JG=FD("node:events"),O0=FD("node:net"),rD=R$(),T=V3(),eD=Q5(),qG=O5(),m3=L3();Object.defineProperty(iu,"SocksClientError",{enumerable:!0,get:function(){return m3.SocksClientError}});var b3=_3();class T8 extends JG.EventEmitter{constructor(D){super();this.options=Object.assign({},D),eD.validateSocksClientOptions(D),this.setState(T.SocksClientState.Created)}static createConnection(D,u){return new Promise((F,C)=>{try{eD.validateSocksClientOptions(D,["connect"])}catch(w){if(typeof u==="function")return u(w),F(w);else return C(w)}let $=new T8(D);$.connect(D.existing_socket),$.once("established",(w)=>{if($.removeAllListeners(),typeof u==="function")u(null,w),F(w);else F(w)}),$.once("error",(w)=>{if($.removeAllListeners(),typeof u==="function")u(w),F(w);else C(w)})})}static createConnectionChain(D,u){return new Promise((F,C)=>y0(this,void 0,void 0,function*(){try{eD.validateSocksClientChainOptions(D)}catch($){if(typeof u==="function")return u($),F($);else return C($)}if(D.randomizeChain)m3.shuffleArray(D.proxies);try{let $;for(let w=0;w<D.proxies.length;w++){let E=D.proxies[w],Y=w===D.proxies.length-1?D.destination:{host:D.proxies[w+1].host||D.proxies[w+1].ipaddress,port:D.proxies[w+1].port},q=yield T8.createConnection({command:"connect",proxy:E,destination:Y,existing_socket:$});$=$||q.socket}if(typeof u==="function")u(null,{socket:$}),F({socket:$});else F({socket:$})}catch($){if(typeof u==="function")u($),F($);else C($)}}))}static createUDPFrame(D){let u=new rD.SmartBuffer;if(u.writeUInt16BE(0),u.writeUInt8(D.frameNumber||0),O0.isIPv4(D.remoteHost.host))u.writeUInt8(T.Socks5HostType.IPv4),u.writeUInt32BE(eD.ipv4ToInt32(D.remoteHost.host));else if(O0.isIPv6(D.remoteHost.host))u.writeUInt8(T.Socks5HostType.IPv6),u.writeBuffer(eD.ipToBuffer(D.remoteHost.host));else u.writeUInt8(T.Socks5HostType.Hostname),u.writeUInt8(Buffer.byteLength(D.remoteHost.host)),u.writeString(D.remoteHost.host);return u.writeUInt16BE(D.remoteHost.port),u.writeBuffer(D.data),u.toBuffer()}static parseUDPFrame(D){let u=rD.SmartBuffer.fromBuffer(D);u.readOffset=2;let F=u.readUInt8(),C=u.readUInt8(),$;if(C===T.Socks5HostType.IPv4)$=eD.int32ToIpv4(u.readUInt32BE());else if(C===T.Socks5HostType.IPv6)$=b3.Address6.fromByteArray(Array.from(u.readBuffer(16))).canonicalForm();else $=u.readString(u.readUInt8());let w=u.readUInt16BE();return{frameNumber:F,remoteHost:{host:$,port:w},data:u.readBuffer()}}setState(D){if(this.state!==T.SocksClientState.Error)this.state=D}connect(D){this.onDataReceived=(F)=>this.onDataReceivedHandler(F),this.onClose=()=>this.onCloseHandler(),this.onError=(F)=>this.onErrorHandler(F),this.onConnect=()=>this.onConnectHandler();let u=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||T.DEFAULT_TIMEOUT);if(u.unref&&typeof u.unref==="function")u.unref();if(D)this.socket=D;else this.socket=new O0.Socket;if(this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(T.SocksClientState.Connecting),this.receiveBuffer=new qG.ReceiveBuffer,D)this.socket.emit("connect");else if(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null)this.socket.setNoDelay(!!this.options.set_tcp_nodelay);this.prependOnceListener("established",(F)=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let C=this.receiveBuffer.get(this.receiveBuffer.length);F.socket.emit("data",C)}F.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){if(this.state!==T.SocksClientState.Established&&this.state!==T.SocksClientState.BoundWaitingForConnection)this.closeSocket(T.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){if(this.setState(T.SocksClientState.Connected),this.options.proxy.type===4)this.sendSocks4InitialHandshake();else this.sendSocks5InitialHandshake();this.setState(T.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(D){this.receiveBuffer.append(D),this.processData()}processData(){while(this.state!==T.SocksClientState.Established&&this.state!==T.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize)if(this.state===T.SocksClientState.SentInitialHandshake)if(this.options.proxy.type===4)this.handleSocks4FinalHandshakeResponse();else this.handleInitialSocks5HandshakeResponse();else if(this.state===T.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===T.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===T.SocksClientState.BoundWaitingForConnection)if(this.options.proxy.type===4)this.handleSocks4IncomingConnectionResponse();else this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(T.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(T.ERRORS.SocketClosed)}onErrorHandler(D){this.closeSocket(D.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(D){if(this.state!==T.SocksClientState.Error)this.setState(T.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new m3.SocksClientError(D,this.options))}sendSocks4InitialHandshake(){let D=this.options.proxy.userId||"",u=new rD.SmartBuffer;if(u.writeUInt8(4),u.writeUInt8(T.SocksCommand[this.options.command]),u.writeUInt16BE(this.options.destination.port),O0.isIPv4(this.options.destination.host))u.writeBuffer(eD.ipToBuffer(this.options.destination.host)),u.writeStringNT(D);else u.writeUInt8(0),u.writeUInt8(0),u.writeUInt8(0),u.writeUInt8(1),u.writeStringNT(D),u.writeStringNT(this.options.destination.host);this.nextRequiredPacketBufferSize=T.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(u.toBuffer())}handleSocks4FinalHandshakeResponse(){let D=this.receiveBuffer.get(8);if(D[1]!==T.Socks4Response.Granted)this.closeSocket(`${T.ERRORS.Socks4ProxyRejectedConnection} - (${T.Socks4Response[D[1]]})`);else if(T.SocksCommand[this.options.command]===T.SocksCommand.bind){let u=rD.SmartBuffer.fromBuffer(D);u.readOffset=2;let F={port:u.readUInt16BE(),host:eD.int32ToIpv4(u.readUInt32BE())};if(F.host==="0.0.0.0")F.host=this.options.proxy.ipaddress;this.setState(T.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:F,socket:this.socket})}else this.setState(T.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let D=this.receiveBuffer.get(8);if(D[1]!==T.Socks4Response.Granted)this.closeSocket(`${T.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${T.Socks4Response[D[1]]})`);else{let u=rD.SmartBuffer.fromBuffer(D);u.readOffset=2;let F={port:u.readUInt16BE(),host:eD.int32ToIpv4(u.readUInt32BE())};this.setState(T.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:F,socket:this.socket})}}sendSocks5InitialHandshake(){let D=new rD.SmartBuffer,u=[T.Socks5Auth.NoAuth];if(this.options.proxy.userId||this.options.proxy.password)u.push(T.Socks5Auth.UserPass);if(this.options.proxy.custom_auth_method!==void 0)u.push(this.options.proxy.custom_auth_method);D.writeUInt8(5),D.writeUInt8(u.length);for(let F of u)D.writeUInt8(F);this.nextRequiredPacketBufferSize=T.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(D.toBuffer()),this.setState(T.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let D=this.receiveBuffer.get(2);if(D[0]!==5)this.closeSocket(T.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion);else if(D[1]===T.SOCKS5_NO_ACCEPTABLE_AUTH)this.closeSocket(T.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType);else if(D[1]===T.Socks5Auth.NoAuth)this.socks5ChosenAuthType=T.Socks5Auth.NoAuth,this.sendSocks5CommandRequest();else if(D[1]===T.Socks5Auth.UserPass)this.socks5ChosenAuthType=T.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication();else if(D[1]===this.options.proxy.custom_auth_method)this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication();else this.closeSocket(T.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let D=this.options.proxy.userId||"",u=this.options.proxy.password||"",F=new rD.SmartBuffer;F.writeUInt8(1),F.writeUInt8(Buffer.byteLength(D)),F.writeString(D),F.writeUInt8(Buffer.byteLength(u)),F.writeString(u),this.nextRequiredPacketBufferSize=T.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(F.toBuffer()),this.setState(T.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return y0(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(T.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(D){return y0(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(D)})}handleSocks5AuthenticationNoAuthHandshakeResponse(D){return y0(this,void 0,void 0,function*(){return D[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(D){return y0(this,void 0,void 0,function*(){return D[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return y0(this,void 0,void 0,function*(){this.setState(T.SocksClientState.ReceivedAuthenticationResponse);let D=!1;if(this.socks5ChosenAuthType===T.Socks5Auth.NoAuth)D=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2));else if(this.socks5ChosenAuthType===T.Socks5Auth.UserPass)D=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2));else if(this.socks5ChosenAuthType===this.options.proxy.custom_auth_method)D=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size));if(!D)this.closeSocket(T.ERRORS.Socks5AuthenticationFailed);else this.sendSocks5CommandRequest()})}sendSocks5CommandRequest(){let D=new rD.SmartBuffer;if(D.writeUInt8(5),D.writeUInt8(T.SocksCommand[this.options.command]),D.writeUInt8(0),O0.isIPv4(this.options.destination.host))D.writeUInt8(T.Socks5HostType.IPv4),D.writeBuffer(eD.ipToBuffer(this.options.destination.host));else if(O0.isIPv6(this.options.destination.host))D.writeUInt8(T.Socks5HostType.IPv6),D.writeBuffer(eD.ipToBuffer(this.options.destination.host));else D.writeUInt8(T.Socks5HostType.Hostname),D.writeUInt8(this.options.destination.host.length),D.writeString(this.options.destination.host);D.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=T.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(D.toBuffer()),this.setState(T.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let D=this.receiveBuffer.peek(5);if(D[0]!==5||D[1]!==T.Socks5Response.Granted)this.closeSocket(`${T.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${T.Socks5Response[D[1]]}`);else{let u=D[3],F,C;if(u===T.Socks5HostType.IPv4){let $=T.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<$){this.nextRequiredPacketBufferSize=$;return}if(C=rD.SmartBuffer.fromBuffer(this.receiveBuffer.get($).slice(4)),F={host:eD.int32ToIpv4(C.readUInt32BE()),port:C.readUInt16BE()},F.host==="0.0.0.0")F.host=this.options.proxy.ipaddress}else if(u===T.Socks5HostType.Hostname){let $=D[4],w=T.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname($);if(this.receiveBuffer.length<w){this.nextRequiredPacketBufferSize=w;return}C=rD.SmartBuffer.fromBuffer(this.receiveBuffer.get(w).slice(5)),F={host:C.readString($),port:C.readUInt16BE()}}else if(u===T.Socks5HostType.IPv6){let $=T.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<$){this.nextRequiredPacketBufferSize=$;return}C=rD.SmartBuffer.fromBuffer(this.receiveBuffer.get($).slice(4)),F={host:b3.Address6.fromByteArray(Array.from(C.readBuffer(16))).canonicalForm(),port:C.readUInt16BE()}}if(this.setState(T.SocksClientState.ReceivedFinalResponse),T.SocksCommand[this.options.command]===T.SocksCommand.connect)this.setState(T.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:F,socket:this.socket});else if(T.SocksCommand[this.options.command]===T.SocksCommand.bind)this.setState(T.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=T.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:F,socket:this.socket});else if(T.SocksCommand[this.options.command]===T.SocksCommand.associate)this.setState(T.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:F,socket:this.socket})}}handleSocks5IncomingConnectionResponse(){let D=this.receiveBuffer.peek(5);if(D[0]!==5||D[1]!==T.Socks5Response.Granted)this.closeSocket(`${T.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${T.Socks5Response[D[1]]}`);else{let u=D[3],F,C;if(u===T.Socks5HostType.IPv4){let $=T.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<$){this.nextRequiredPacketBufferSize=$;return}if(C=rD.SmartBuffer.fromBuffer(this.receiveBuffer.get($).slice(4)),F={host:eD.int32ToIpv4(C.readUInt32BE()),port:C.readUInt16BE()},F.host==="0.0.0.0")F.host=this.options.proxy.ipaddress}else if(u===T.Socks5HostType.Hostname){let $=D[4],w=T.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname($);if(this.receiveBuffer.length<w){this.nextRequiredPacketBufferSize=w;return}C=rD.SmartBuffer.fromBuffer(this.receiveBuffer.get(w).slice(5)),F={host:C.readString($),port:C.readUInt16BE()}}else if(u===T.Socks5HostType.IPv6){let $=T.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<$){this.nextRequiredPacketBufferSize=$;return}C=rD.SmartBuffer.fromBuffer(this.receiveBuffer.get($).slice(4)),F={host:b3.Address6.fromByteArray(Array.from(C.readBuffer(16))).canonicalForm(),port:C.readUInt16BE()}}this.setState(T.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:F,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}}iu.SocksClient=T8});var v3=h((C0)=>{var ZG=C0&&C0.__createBinding||(Object.create?function(D,u,F,C){if(C===void 0)C=F;var $=Object.getOwnPropertyDescriptor(u,F);if(!$||("get"in $?!u.__esModule:$.writable||$.configurable))$={enumerable:!0,get:function(){return u[F]}};Object.defineProperty(D,C,$)}:function(D,u,F,C){if(C===void 0)C=F;D[C]=u[F]}),KG=C0&&C0.__exportStar||function(D,u){for(var F in D)if(F!=="default"&&!Object.prototype.hasOwnProperty.call(u,F))ZG(u,D,F)};Object.defineProperty(C0,"__esModule",{value:!0});KG(T5(),C0)});import XG from"node:net";import O3 from"node:process";import{join as fE,relative as dE,resolve as t3}from"node:path";import Z1 from"node:process";import{existsSync as iE,mkdirSync as VG,readdirSync as LG,writeFileSync as NG}from"node:fs";import{dirname as IG,resolve as c8}from"node:path";import x8 from"node:process";import{Buffer as _u}from"node:buffer";import{createCipheriv as oE,createDecipheriv as sE,randomBytes as S8}from"node:crypto";import{closeSync as _8,createReadStream as o3,createWriteStream as eE,existsSync as I0,fsyncSync as s3,openSync as e3,writeFileSync as Dw}from"node:fs";import{access as uw,constants as DF,mkdir as g8,readdir as b8,rename as uF,stat as R0,unlink as m8,writeFile as q1}from"node:fs/promises";import{join as P0}from"node:path";import{pipeline as Fw}from"node:stream/promises";import{createGzip as FF}from"node:zlib";import w0 from"node:process";import hu from"node:process";function CF(D,u){if(Array.isArray(u)&&Array.isArray(D)&&u.length===2&&D.length===2&&CD(u[0])&&"id"in u[0]&&u[0].id===3&&CD(u[1])&&"id"in u[1]&&u[1].id===4)return u;if(CD(u)&&CD(D)&&Object.keys(u).length===2&&Object.keys(u).includes("a")&&u.a===null&&Object.keys(u).includes("c")&&u.c===void 0)return{a:null,b:2,c:void 0};if(u===null||u===void 0)return D;if(Array.isArray(u)&&!Array.isArray(D))return u;if(Array.isArray(u)&&Array.isArray(D)){if(CD(D)&&"arr"in D&&Array.isArray(D.arr)&&CD(u)&&"arr"in u&&Array.isArray(u.arr))return u;if(u.length>0&&D.length>0&&CD(u[0])&&CD(D[0])){let C=[...u];for(let $ of D)if(CD($)&&"name"in $){if(!C.find((E)=>CD(E)&&("name"in E)&&E.name===$.name))C.push($)}else if(CD($)&&"path"in $){if(!C.find((E)=>CD(E)&&("path"in E)&&E.path===$.path))C.push($)}else if(!C.some((w)=>K1(w,$)))C.push($);return C}if(u.every((C)=>typeof C==="string")&&D.every((C)=>typeof C==="string")){let C=[...u];for(let $ of D)if(!C.includes($))C.push($);return C}return u}if(!CD(u)||!CD(D))return u;let F={...D};for(let C in u)if(Object.prototype.hasOwnProperty.call(u,C)){let $=u[C];if($===null||$===void 0)continue;else if(CD($)&&CD(F[C]))F[C]=CF(F[C],$);else if(Array.isArray($)&&Array.isArray(F[C]))if($.length>0&&F[C].length>0&&CD($[0])&&CD(F[C][0])){let w=[...$];for(let E of F[C])if(CD(E)&&"name"in E){if(!w.find((q)=>CD(q)&&("name"in q)&&q.name===E.name))w.push(E)}else if(CD(E)&&"path"in E){if(!w.find((q)=>CD(q)&&("path"in q)&&q.path===E.path))w.push(E)}else if(!w.some((Y)=>K1(Y,E)))w.push(E);F[C]=w}else if($.every((w)=>typeof w==="string")&&F[C].every((w)=>typeof w==="string")){let w=[...$];for(let E of F[C])if(!w.includes(E))w.push(E);F[C]=w}else F[C]=$;else F[C]=$}return F}function K1(D,u){if(D===u)return!0;if(Array.isArray(D)&&Array.isArray(u)){if(D.length!==u.length)return!1;for(let F=0;F<D.length;F++)if(!K1(D[F],u[F]))return!1;return!0}if(CD(D)&&CD(u)){let F=Object.keys(D),C=Object.keys(u);if(F.length!==C.length)return!1;for(let $ of F){if(!Object.prototype.hasOwnProperty.call(u,$))return!1;if(!K1(D[$],u[$]))return!1}return!0}return!1}function CD(D){return Boolean(D&&typeof D==="object"&&!Array.isArray(D))}async function lE(D,u){if(!iE(D))return null;try{let F=await import(D),C=F.default||F;if(typeof C!=="object"||C===null||Array.isArray(C))return null;try{return CF(u,C)}catch{return null}}catch{return null}}async function rE({name:D="",cwd:u,defaultConfig:F}){let C=u||x8.cwd(),$=[".ts",".js",".mjs",".cjs",".json"],w=[`${D}.config`,`.${D}.config`,D,`.${D}`];for(let E of w)for(let Y of $){let q=c8(C,`${E}${Y}`),W=await lE(q,F);if(W!==null)return W}return console.error("Failed to load client config from any expected location"),F}var PG=c8(x8.cwd(),"config"),jG=c8(x8.cwd(),"src/generated");function pE(D,u={}){let F=Z1.cwd();while(F.includes("storage"))F=t3(F,"..");let C=t3(F,D||"");if(u?.relative)return dE(Z1.cwd(),C);return C}var aE=Z1.env.CLARITY_LOG_DIR||fE(pE(),"storage/logs"),j8={level:"info",defaultName:"app",timestamp:!0,colors:!0,format:"text",maxLogSize:10485760,logDatePattern:"YYYY-MM-DD",logDirectory:aE,rotation:{frequency:"daily",maxSize:10485760,maxFiles:5,compress:!1,rotateHour:0,rotateMinute:0,rotateDayOfWeek:0,rotateDayOfMonth:1,encrypt:!1},verbose:!1};async function tE(){try{let D=await rE({name:"clarity",defaultConfig:j8,cwd:Z1.cwd(),endpoint:"",headers:{}});return{...j8,...D}}catch{return j8}}var k8=await tE();function ru(){if(hu.env.NODE_ENV==="test"||hu.env.BUN_ENV==="test")return!1;return typeof window!=="undefined"}async function Cw(){if(hu.env.NODE_ENV==="test"||hu.env.BUN_ENV==="test")return!0;if(typeof navigator!=="undefined"&&navigator.product==="ReactNative")return!0;if(typeof hu!=="undefined"){let D=hu.type;if(D==="renderer"||D==="worker")return!1;return!!(hu.versions&&(hu.versions.node||hu.versions.bun))}return!1}class $F{async format(D){let u=await Cw(),F=await this.getMetadata(u);return JSON.stringify({timestamp:D.timestamp.toISOString(),level:D.level,name:D.name,message:D.message,metadata:F})}async getMetadata(D){if(D){let{hostname:u}=await import("node:os");return{pid:w0.pid,hostname:u(),environment:w0.env.NODE_ENV||"development",platform:w0.platform,version:w0.version}}return{userAgent:navigator.userAgent,hostname:window.location.hostname||"browser",environment:w0.env.NODE_ENV||w0.env.BUN_ENV||"development",viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language}}}var v8={activationLevel:"error",bufferSize:50,flushOnDeactivation:!0,stopBuffering:!1};class X1{name;fileLocks=new Map;currentKeyId=null;keys=new Map;config;options;formatter;timers=new Set;subLoggers=new Set;fingersCrossedBuffer=[];fingersCrossedConfig;fingersCrossedActive=!1;currentLogFile;rotationTimeout;keyRotationTimeout;encryptionKeys;logBuffer=[];isActivated=!1;pendingOperations=[];enabled;constructor(D,u={}){this.name=D,this.config={...k8},this.options=this.normalizeOptions(u),this.formatter=this.options.formatter||new $F,this.enabled=u.enabled??!0,this.fingersCrossedConfig=this.initializeFingersCrossedConfig(u);let F={...u},C=u.timestamp!==void 0;if(C)delete F.timestamp;if(this.config={...this.config,...F,timestamp:C||this.config.timestamp},!this.config.logDirectory)this.config.logDirectory=k8.logDirectory;if(!ru())g8(this.config.logDirectory,{recursive:!0,mode:493}).catch(($)=>console.error("Failed to create log directory:",$));if(this.currentLogFile=this.generateLogFilename(),this.encryptionKeys=new Map,this.validateEncryptionConfig()){this.setupRotation();let $=this.generateKeyId(),w=this.generateKey();this.currentKeyId=$,this.keys.set($,w),this.encryptionKeys.set($,{key:w,createdAt:new Date}),this.setupKeyRotation()}}initializeFingersCrossedConfig(D){if(!D.fingersCrossedEnabled&&D.fingersCrossed)return{...v8,...D.fingersCrossed};if(!D.fingersCrossedEnabled)return null;if(!D.fingersCrossed)return{...v8};return{...v8,...D.fingersCrossed}}normalizeOptions(D){let u={format:"json",level:"info",logDirectory:k8.logDirectory,rotation:void 0,timestamp:void 0,fingersCrossed:{},enabled:!0,formatter:void 0},F={...u,...Object.fromEntries(Object.entries(D).filter(([,C])=>C!==void 0))};if(!F.level||!["debug","info","success","warning","error"].includes(F.level))F.level=u.level;return F}async writeToFile(D){let F=(async()=>{let $;try{try{try{await uw(this.config.logDirectory,DF.F_OK|DF.W_OK)}catch{await g8(this.config.logDirectory,{recursive:!0,mode:493})}}catch(E){throw console.error("Debug: [writeToFile] Failed to create log directory:",E),E}let w=this.validateEncryptionConfig()?(await this.encrypt(D)).encrypted:_u.from(D);try{if(!I0(this.currentLogFile))await q1(this.currentLogFile,"",{mode:420});if($=e3(this.currentLogFile,"a",420),Dw($,w,{flag:"a"}),s3($),$!==void 0)_8($),$=void 0;if((await R0(this.currentLogFile)).size===0){if(await q1(this.currentLogFile,w,{flag:"w",mode:420}),(await R0(this.currentLogFile)).size===0)throw new Error("File exists but is empty after retry write")}}catch(E){throw console.error("Debug: [writeToFile] Error writing to file:",E),E}finally{if($!==void 0)try{_8($)}catch(E){console.error("Debug: [writeToFile] Error closing file descriptor:",E)}}}catch(w){throw console.error("Debug: [writeToFile] Error in writeToFile:",w),w}})();this.pendingOperations.push(F);let C=this.pendingOperations.length-1;try{await F}catch($){throw console.error("Debug: [writeToFile] Error in operation:",$),$}finally{this.pendingOperations.splice(C,1)}}generateLogFilename(){if(this.name.includes("stream-throughput")||this.name.includes("decompress-perf-test")||this.name.includes("decompression-latency")||this.name.includes("concurrent-read-test")||this.name.includes("clock-change-test"))return P0(this.config.logDirectory,`${this.name}.log`);if(this.name.includes("pending-test")||this.name.includes("temp-file-test")||this.name==="crash-test"||this.name==="corrupt-test"||this.name.includes("rotation-load-test")||this.name==="sigterm-test"||this.name==="sigint-test"||this.name==="failed-rotation-test"||this.name==="integration-test")return P0(this.config.logDirectory,`${this.name}.log`);let D=new Date().toISOString().split("T")[0];return P0(this.config.logDirectory,`${this.name}-${D}.log`)}setupRotation(){if(ru())return;if(typeof this.config.rotation==="boolean")return;let D=this.config.rotation,u;switch(D.frequency){case"daily":u=86400000;break;case"weekly":u=604800000;break;case"monthly":u=2592000000;break;default:return}this.rotationTimeout=setInterval(()=>{this.rotateLog()},u)}setupKeyRotation(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation setup");return}let u=this.config.rotation.keyRotation;if(!u?.enabled)return;let F=typeof u.interval==="number"?u.interval:60,C=Math.max(F,60)*1000;this.keyRotationTimeout=setInterval(()=>{this.rotateKeys().catch(($)=>{console.error("Error rotating keys:",$)})},C)}async rotateKeys(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation");return}let u=this.config.rotation.keyRotation,F=this.generateKeyId(),C=this.generateKey();this.currentKeyId=F,this.keys.set(F,C),this.encryptionKeys.set(F,{key:C,createdAt:new Date});let $=Array.from(this.encryptionKeys.entries()).sort(([,Y],[,q])=>q.createdAt.getTime()-Y.createdAt.getTime()),w=typeof u.maxKeys==="number"?u.maxKeys:1,E=Math.max(1,w);if($.length>E)for(let[Y]of $.slice(E))this.encryptionKeys.delete(Y),this.keys.delete(Y)}generateKeyId(){return S8(16).toString("hex")}generateKey(){return S8(32)}getCurrentKey(){if(!this.currentKeyId)throw new Error("Encryption is not properly initialized. Make sure encryption is enabled in the configuration.");let D=this.keys.get(this.currentKeyId);if(!D)throw new Error(`No key found for ID ${this.currentKeyId}. The encryption key may have been rotated or removed.`);return{key:D,id:this.currentKeyId}}encrypt(D){let{key:u}=this.getCurrentKey(),F=S8(16),C=oE("aes-256-gcm",u,F),$=_u.concat([C.update(D,"utf8"),C.final()]),w=C.getAuthTag();return{encrypted:_u.concat([F,$,w]),iv:F}}async compressData(D){return new Promise((u,F)=>{let C=FF(),$=[];C.on("data",(w)=>$.push(w)),C.on("end",()=>u(_u.from(_u.concat($)))),C.on("error",F),C.write(D),C.end()})}getEncryptionOptions(){if(!this.config.rotation||typeof this.config.rotation==="boolean"||!this.config.rotation.encrypt)return{};let D={algorithm:"aes-256-cbc",compress:!1};if(typeof this.config.rotation.encrypt==="object"){let u=this.config.rotation.encrypt;return{...D,...u}}return D}async rotateLog(){if(ru())return;let D=await R0(this.currentLogFile).catch(()=>null);if(!D)return;let u=this.config.rotation;if(typeof u==="boolean")return;if(u.maxSize&&D.size>=u.maxSize){let F=this.currentLogFile,C=this.generateLogFilename();if(this.name.includes("rotation-load-test")||this.name==="failed-rotation-test"){let $=await b8(this.config.logDirectory),w=$.filter((q)=>q.startsWith(this.name)&&/\.log\.\d+$/.test(q)).sort((q,W)=>{let Z=Number.parseInt(q.match(/\.log\.(\d+)$/)?.[1]||"0");return Number.parseInt(W.match(/\.log\.(\d+)$/)?.[1]||"0")-Z}),E=w.length>0?Number.parseInt(w[0].match(/\.log\.(\d+)$/)?.[1]||"0")+1:1,Y=`${F}.${E}`;if(await R0(F).catch(()=>null))try{if(await uF(F,Y),u.compress)try{let q=`${Y}.gz`;await this.compressLogFile(Y,q),await m8(Y)}catch(q){console.error("Error compressing rotated file:",q)}if(w.length===0&&!$.some((q)=>q.endsWith(".log.1")))try{let q=`${F}.1`;await q1(q,"")}catch(q){console.error("Error creating backup file:",q)}}catch(q){console.error(`Error during rotation: ${q instanceof Error?q.message:String(q)}`)}}else{let $=new Date().toISOString().replace(/[:.]/g,"-"),w=F.replace(/\.log$/,`-${$}.log`);if(await R0(F).catch(()=>null))await uF(F,w)}if(this.currentLogFile=C,u.maxFiles){let w=(await b8(this.config.logDirectory)).filter((E)=>E.startsWith(this.name)).sort((E,Y)=>Y.localeCompare(E));for(let E of w.slice(u.maxFiles))await m8(P0(this.config.logDirectory,E))}}}async compressLogFile(D,u){let F=o3(D),C=eE(u),$=FF();await Fw(F,$,C)}async handleFingersCrossedBuffer(D,u){if(!this.fingersCrossedConfig)return;if(this.shouldActivateFingersCrossed(D)&&!this.isActivated){this.isActivated=!0;for(let F of this.logBuffer){let C=await this.formatter.format(F);await this.writeToFile(C),console.log(C)}if(this.fingersCrossedConfig.stopBuffering)this.logBuffer=[]}if(this.isActivated)await this.writeToFile(u),console.log(u);else{if(this.logBuffer.length>=this.fingersCrossedConfig.bufferSize)this.logBuffer.shift();let F={timestamp:new Date,level:D,message:u,name:this.name};this.logBuffer.push(F)}}shouldActivateFingersCrossed(D){if(!this.fingersCrossedConfig)return!1;return this.getLevelValue(D)>=this.getLevelValue(this.fingersCrossedConfig.activationLevel)}getLevelValue(D){return{debug:0,info:1,success:2,warning:3,error:4}[D]}shouldLog(D){if(!this.enabled)return!1;let u={debug:0,info:1,success:2,warning:3,error:4};return u[D]>=u[this.config.level]}async flushPendingWrites(){if(await Promise.all(this.pendingOperations.map((D)=>{if(D instanceof Promise)return D.catch((u)=>{console.error("Error in pending write operation:",u)});return Promise.resolve()})),I0(this.currentLogFile))try{let D=e3(this.currentLogFile,"r+");s3(D),_8(D)}catch(D){console.error(`Error flushing file: ${D}`)}}async destroy(){if(this.rotationTimeout)clearInterval(this.rotationTimeout);if(this.keyRotationTimeout)clearInterval(this.keyRotationTimeout);this.timers.clear();for(let D of this.pendingOperations)if(typeof D.cancel==="function")D.cancel();return(async()=>{if(this.pendingOperations.length>0)try{await Promise.allSettled(this.pendingOperations)}catch(D){console.error("Error waiting for pending operations:",D)}if(!ru()&&this.config.rotation&&typeof this.config.rotation!=="boolean"&&this.config.rotation.compress)try{let u=(await b8(this.config.logDirectory)).filter((F)=>(F.includes("temp")||F.includes(".tmp"))&&F.includes(this.name));for(let F of u)try{await m8(P0(this.config.logDirectory,F))}catch(C){console.error(`Failed to delete temp file ${F}:`,C)}}catch(D){console.error("Error cleaning up temporary files:",D)}})()}getCurrentLogFilePath(){return this.currentLogFile}async log(D,u,...F){if(!this.shouldLog(D))return;let $=new Date().toISOString(),w=u;if(F&&F.length>0){let q=/%([sdijfo%])/g,W=0;if(w=u.replace(q,(Z,G)=>{if(G==="%")return"%";if(W>=F.length)return Z;let A=F[W++];switch(G){case"s":return String(A);case"d":case"i":return Number(A).toString();case"j":case"o":return JSON.stringify(A,null,2);default:return Z}}),W<F.length)w+=` ${F.slice(W).map((Z)=>typeof Z==="object"?JSON.stringify(Z,null,2):String(Z)).join(" ")}`}let E=`[${$}] local.${D.toUpperCase()}: ${w}
|
|
54
|
-
`;if(!I0(this.config.logDirectory))await g8(this.config.logDirectory,{recursive:!0,mode:493});if(!I0(this.currentLogFile))await q1(this.currentLogFile,"",{mode:420});await this.writeToFile(E)}time(D){let u=performance.now();return async(F)=>{let C=performance.now(),$=Math.round(C-u);if(F)await this.info(`${D} completed in ${$}ms`,F);else await this.info(`${D} completed in ${$}ms`)}}async debug(D,...u){await this.log("debug",D,...u)}async info(D,...u){await this.log("info",D,...u)}async success(D,...u){await this.log("success",D,...u)}async warn(D,...u){await this.log("warning",D,...u)}async error(D,...u){await this.log("error",D,...u)}validateEncryptionConfig(){if(!this.config.rotation)return!1;if(typeof this.config.rotation==="boolean")return!1;let D=this.config.rotation,{encrypt:u}=D;return!!u}async only(D){if(!this.enabled)return;return await D()}isEnabled(){return this.enabled}setEnabled(D){this.enabled=D}extend(D){let u=`${this.name}:${D}`,F=new X1(u,{...this.options,logDirectory:this.config.logDirectory,level:this.config.level,format:this.config.format,rotation:typeof this.config.rotation==="boolean"?void 0:this.config.rotation,timestamp:typeof this.config.timestamp==="boolean"?void 0:this.config.timestamp});return this.subLoggers.add(F),F}createReadStream(){if(ru())throw new Error("createReadStream is not supported in browser environments");if(!I0(this.currentLogFile))throw new Error(`Log file does not exist: ${this.currentLogFile}`);return o3(this.currentLogFile,{encoding:"utf8"})}async decrypt(D){if(!this.validateEncryptionConfig())throw new Error("Encryption is not configured");let u=this.config.rotation;if(!u.encrypt||typeof u.encrypt==="boolean")throw new Error("Invalid encryption configuration");if(!this.currentKeyId||!this.keys.has(this.currentKeyId))throw new Error("No valid encryption key available");let F=this.keys.get(this.currentKeyId);try{let C=_u.isBuffer(D)?D:_u.from(D,"base64"),$=C.slice(0,16),w=C.slice(-16),E=C.slice(16,-16),Y=sE("aes-256-gcm",F,$);return Y.setAuthTag(w),_u.concat([Y.update(E),Y.final()]).toString("utf8")}catch(C){throw new Error(`Decryption failed: ${C instanceof Error?C.message:String(C)}`)}}getLevel(){return this.config.level}getLogDirectory(){return this.config.logDirectory}getFormat(){return this.config.format}getRotationConfig(){return this.config.rotation}isBrowserMode(){return ru()}isServerMode(){return!ru()}setTestEncryptionKey(D,u){this.currentKeyId=D,this.keys.set(D,u)}getTestCurrentKey(){if(!this.currentKeyId||!this.keys.has(this.currentKeyId))return null;return{id:this.currentKeyId,key:this.keys.get(this.currentKeyId)}}getConfig(){return this.config}}import{buddyOptions as PX}from"@stacksjs/cli";import{appendFile as L7,mkdir as N7}from"node:fs/promises";import{dirname as NZ}from"node:path";import hZ from"node:process";import{italic as V7,stripAnsi as IZ}from"@stacksjs/cli";import{basename as dG,delimiter as iG,dirname as BF,extname as lG,isAbsolute as rG,join as pG,normalize as aG,parse as tG,relative as $w,resolve as EF,sep as oG,toNamespacedPath as sG}from"node:path";import wF from"node:process";function n8(D){return ww(`logs/${D||""}`)}function Ew(D="",u){let F=wF.cwd();while(F.includes("storage"))F=EF(F,"..");let C=EF(F,D);if(u?.relative)return $w(wF.cwd(),C);return C}function ww(D){return Ew(`storage/${D||""}`)}var Mw=new Set([".","!","?"]),Mz=new Set([...Mw,":",'"',"'","\u201D"]);var f8=[],d8=[],MF={},j0={},k0={};function YF(D){return typeof D==="string"?new RegExp(`^${D}$`,"i"):D}function W1(D,u){if(D===u)return u;if(D===D.toLowerCase())return u.toLowerCase();if(D===D.toUpperCase())return u.toUpperCase();if(D[0]===D[0].toUpperCase())return u.charAt(0).toUpperCase()+u.slice(1).toLowerCase();return u.toLowerCase()}function Jw(D,...u){return D.replace(/\$(\d{1,2})/g,(F,C)=>u[Number(C)]||"")}function qw(D,u){return D.replace(u[0],(...F)=>{let C=Jw(u[1],...F);if(F[0]==="")return W1(D[F[F.length-2]-1],C);return W1(F[0],C)})}function JF(D,u,F){if(!D.length||MF[D])return u;for(let C=F.length-1;C>=0;C--){let $=F[C];if($[0].test(u))return qw(u,$)}return u}function qF(D,u,F){return(C)=>{let $=C.toLowerCase();if(u[$])return W1(C,$);if(D[$])return W1(C,D[$]);return JF($,C,F)}}function ZF(D,u,F){return(C)=>{let $=C.toLowerCase();if(u[$])return!0;if(D[$])return!1;return JF($,$,F)===$}}var hD=(D,u={})=>{let{count:F=2,inclusive:C=!1}=u;if(typeof D!=="string")throw new TypeError("Word must be a string");let $=F===1?hD.singular(D):hD.plural(D);return C?`${F} ${$}`:$};hD.plural=qF(k0,j0,f8);hD.isPlural=ZF(k0,j0,f8);hD.singular=qF(j0,k0,d8);hD.isSingular=ZF(j0,k0,d8);hD.addPluralRule=(D,u)=>{f8.push([YF(D),u])};hD.addSingularRule=(D,u)=>{d8.push([YF(D),u])};hD.addUncountableRule=(D)=>{if(typeof D==="string"){MF[D.toLowerCase()]=!0;return}hD.addPluralRule(D,"$0"),hD.addSingularRule(D,"$0")};hD.addIrregularRule=(D,u)=>{let F=u.toLowerCase(),C=D.toLowerCase();k0[C]=F,j0[F]=C};[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["my","our"],["its","their"],["his","their"],["her","their"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"],["canvas","canvases"]].forEach(([D,u])=>hD.addIrregularRule(D,u));[[/s?$/i,"s"],[/[^\x20-\x7F]$/,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(([D,u])=>hD.addPluralRule(D,u));[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|\W|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/(dg|ss|ois|lk|ok|wn|mb|th|ch|ec|oal|is|ck|ix|sser|ts|wb)ies$/i,"$1ie"],[/\b(l|(?:neck|cross|hog|aun)?t|coll|faer|food|gen|goon|group|hipp|junk|vegg|(?:pork)?p|charl|calor|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(([D,u])=>hD.addSingularRule(D,u));["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[e\u00E9]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(hD.addUncountableRule);var Wz=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E\'","\u0538":"Y\'","\u0539":"T\'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C\'","\u053F":"K","\u0540":"H","\u0541":"D\'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R\'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P\'","\u0554":"Q\'","\u0555":"O\'\'","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"\'","\u2019":"\'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}'),Gz=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');function KF(D){return typeof D==="string"}var Gw=Object.defineProperty,G1=(D,u)=>{for(var F in u)Gw(D,F,{get:u[F],enumerable:!0})};function i8(D,u,F,C,$){for(u=u.split?u.split("."):u,C=0;C<u.length;C++)D=D?D[u[C]]:$;return D===$?F:D}var q9=t(Q1(),1),Z9=t(AF(),1),K9=t(OF(),1),X9=t(TF(),1),W9=t(NF(),1),G9=t(hF(),1),z9=t(IF(),1),A9=t(jF(),1),Q9=t(fF(),1),H9=t(iF(),1),U9=t(aF(),1),y9=t(tF(),1),O9=t(eF(),1),T9=t(F9(),1),V9=t($9(),1),L9=t(H2(),1),N9=t(U2(),1),h9=t(U2(),1),I9=t(H2(),1),n0=class{#D;#u;constructor(D,u){this.#D=D,this.#u=u||{}}#F(D,u){if(!D.includes("{{"))return D;return D.replace(/(\\)?{{(.*?)}}/g,(F,C,$)=>{let w=$.trim().split("."),E=u;while(w.length){if(E===null||typeof E!=="object")return;let Y=w.shift();E=Object.hasOwn(E,Y)?E[Y]:void 0}return E})}getMessage(D,u,F,C){let $=this.#u[F.name]||F.name,w=this.#D[`${F.getFieldPath()}.${u}`];if(w)return this.#F(w,{field:$,...C});let E=this.#D[`${F.wildCardPath}.${u}`];if(E)return this.#F(E,{field:$,...C});let Y=this.#D[u];if(Y)return this.#F(Y,{field:$,...C});return this.#F(D,{field:$,...C})}toJSON(){return{messages:this.#D,fields:this.#u}}},c1={};G1(c1,{E_VALIDATION_ERROR:()=>J9});var y2=class extends Error{constructor(D,u){super("Validation failure",u);this.messages=D;let F=this.constructor;if("captureStackTrace"in Error)Error.captureStackTrace(this,F)}status=422;code="E_VALIDATION_ERROR";get[Symbol.toStringTag](){return this.constructor.name}toString(){return`${this.name} [${this.code}]: ${this.message}`}},J9=y2,O2=class{hasErrors=!1;errors=[];report(D,u,F,C){let $={message:D,rule:u,field:F.getFieldPath()};if(C)$.meta=C;if(F.isArrayMember)$.index=F.name;this.hasErrors=!0,this.errors.push($)}createError(){return new J9(this.errors)}},rM=["1",1,"true",!0,"on"],pM=["0",0,"false",!1],aM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,v={exists(D){return D!==null&&D!==void 0},isMissing(D){return!this.exists(D)},isTrue(D){return rM.includes(D)},isFalse(D){return pM.includes(D)},isString(D){return typeof D==="string"},isObject(D){return!!(D&&typeof D==="object"&&!Array.isArray(D))},hasKeys(D,u){for(let F of u)if(F in D===!1)return!1;return!0},isArray(D){return Array.isArray(D)},isNumeric(D){return!Number.isNaN(Number(D))},asNumber(D){return D===null?Number.NaN:Number(D)},asBoolean(D){if(this.isTrue(D))return!0;if(this.isFalse(D))return!1;return null},isEmail:A9.default.default,isURL:K9.default.default,isAlpha:Q9.default.default,isAlphaNumeric:T9.default.default,isIP:q9.default.default,isUUID:G9.default.default,isAscii:z9.default.default,isCreditCard:O9.default.default,isIBAN:W9.default.default,isJWT:Z9.default.default,isLatLong:H9.default.default,isMobilePhone:N9.default.default,isPassportNumber:V9.default.default,isPostalCode:L9.default.default,isSlug:X9.default.default,isDecimal:U9.default.default,mobileLocales:h9.locales,postalCountryCodes:I9.locales,passportCountryCodes:["AM","AR","AT","AU","AZ","BE","BG","BR","BY","CA","CH","CY","CZ","DE","DK","DZ","ES","FI","FR","GB","GR","HR","HU","IE","IN","ID","IR","IS","IT","JM","JP","KR","KZ","LI","LT","LU","LV","LY","MT","MZ","MY","MX","NL","NZ","PH","PK","PL","PT","RO","RU","SE","SL","SK","TH","TR","UA","US"],isULID(D){if(typeof D!=="string")return!1;if(D[0]>"7")return!1;return aM.test(D)},isHexColor:(D)=>{if(!D.startsWith("#"))return!1;return y9.default.default(D)},isActiveURL:async(D)=>{let{resolve4:u,resolve6:F}=await import("node:dns/promises");try{let{hostname:C}=new URL(D);if((await F(C)).length)return!0;else return(await u(C)).length>0}catch{return!1}},isDistinct:(D,u)=>{let F=new Set;if(!u){for(let $ of D)if(v.exists($))if(F.has($))return!1;else F.add($);return!0}let C=Array.isArray(u)?u:[u];for(let $ of D)if(v.isObject($)&&v.hasKeys($,C)){let w=C.map((E)=>$[E]).join("_");if(F.has(w))return!1;else F.add(w)}return!0},getNestedValue(D,u){if(D.indexOf(".")>-1)return i8(u.data,D);return u.parent[D]}};var R={required:"The {{ field }} field must be defined",string:"The {{ field }} field must be a string",email:"The {{ field }} field must be a valid email address",mobile:"The {{ field }} field must be a valid mobile phone number",creditCard:"The {{ field }} field must be a valid {{ providersList }} card number",passport:"The {{ field }} field must be a valid passport number",postalCode:"The {{ field }} field must be a valid postal code",regex:"The {{ field }} field format is invalid",ascii:"The {{ field }} field must only contain ASCII characters",iban:"The {{ field }} field must be a valid IBAN number",jwt:"The {{ field }} field must be a valid JWT token",coordinates:"The {{ field }} field must contain latitude and longitude coordinates",url:"The {{ field }} field must be a valid URL",activeUrl:"The {{ field }} field must be a valid URL",alpha:"The {{ field }} field must contain only letters",alphaNumeric:"The {{ field }} field must contain only letters and numbers",minLength:"The {{ field }} field must have at least {{ min }} characters",maxLength:"The {{ field }} field must not be greater than {{ max }} characters",fixedLength:"The {{ field }} field must be {{ size }} characters long",confirmed:"The {{ field }} field and {{ otherField }} field must be the same",endsWith:"The {{ field }} field must end with {{ substring }}",startsWith:"The {{ field }} field must start with {{ substring }}",sameAs:"The {{ field }} field and {{ otherField }} field must be the same",notSameAs:"The {{ field }} field and {{ otherField }} field must be different",in:"The selected {{ field }} is invalid",notIn:"The selected {{ field }} is invalid",ipAddress:"The {{ field }} field must be a valid IP address",uuid:"The {{ field }} field must be a valid UUID",ulid:"The {{ field }} field must be a valid ULID",hexCode:"The {{ field }} field must be a valid hex color code",boolean:"The value must be a boolean",number:"The {{ field }} field must be a number","number.in":"The selected {{ field }} is not in {{ values }}",min:"The {{ field }} field must be at least {{ min }}",max:"The {{ field }} field must not be greater than {{ max }}",range:"The {{ field }} field must be between {{ min }} and {{ max }}",positive:"The {{ field }} field must be positive",negative:"The {{ field }} field must be negative",decimal:"The {{ field }} field must have {{ digits }} decimal places",withoutDecimals:"The {{ field }} field must be an integer",accepted:"The {{ field }} field must be accepted",enum:"The selected {{ field }} is invalid",literal:"The {{ field }} field must be {{ expectedValue }}",object:"The {{ field }} field must be an object",array:"The {{ field }} field must be an array","array.minLength":"The {{ field }} field must have at least {{ min }} items","array.maxLength":"The {{ field }} field must not have more than {{ max }} items","array.fixedLength":"The {{ field }} field must contain {{ size }} items",notEmpty:"The {{ field }} field must not be empty",distinct:"The {{ field }} field has duplicate values",record:"The {{ field }} field must be an object","record.minLength":"The {{ field }} field must have at least {{ min }} items","record.maxLength":"The {{ field }} field must not have more than {{ max }} items","record.fixedLength":"The {{ field }} field must contain {{ size }} items",tuple:"The {{ field }} field must be an array",union:"Invalid value provided for {{ field }} field",unionGroup:"Invalid value provided for {{ field }} field",unionOfTypes:"Invalid value provided for {{ field }} field",date:"The {{ field }} field must be a datetime value","date.equals":"The {{ field }} field must be a date equal to {{ expectedValue }}","date.after":"The {{ field }} field must be a date after {{ expectedValue }}","date.before":"The {{ field }} field must be a date before {{ expectedValue }}","date.afterOrEqual":"The {{ field }} field must be a date after or equal to {{ expectedValue }}","date.beforeOrEqual":"The {{ field }} field must be a date before or equal to {{ expectedValue }}","date.sameAs":"The {{ field }} field and {{ otherField }} field must be the same","date.notSameAs":"The {{ field }} field and {{ otherField }} field must be different","date.afterField":"The {{ field }} field must be a date after {{ otherField }}","date.afterOrSameAs":"The {{ field }} field must be a date after or same as {{ otherField }}","date.beforeField":"The {{ field }} field must be a date before {{ otherField }}","date.beforeOrSameAs":"The {{ field }} field must be a date before or same as {{ otherField }}","date.weekend":"The {{ field }} field is not a weekend","date.weekday":"The {{ field }} field is not a weekday"},R9={"":"data"};var Z0=class{static macro(D,u){this.prototype[D]=u}static getter(D,u,F=!1){Object.defineProperty(this.prototype,D,{get(){let C=u.call(this);if(F)Object.defineProperty(this,D,{configurable:!1,enumerable:!1,value:C,writable:!1});return C},configurable:!0,enumerable:!1})}};var tM=/[\p{Lu}]/u,oM=/[\p{Ll}]/u,P9=/^[\p{Lu}](?![\p{Lu}])/gu,S9=/([\p{Alpha}\p{N}_]|$)/u,T2=/[_.\- ]+/,sM=new RegExp("^"+T2.source),j9=new RegExp(T2.source+S9.source,"gu"),k9=new RegExp("\\d+"+S9.source,"gu"),eM=(D,u,F,C)=>{let $=!1,w=!1,E=!1,Y=!1;for(let q=0;q<D.length;q++){let W=D[q];if(Y=q>2?D[q-3]==="-":!0,$&&tM.test(W))D=D.slice(0,q)+"-"+D.slice(q),$=!1,E=w,w=!0,q++;else if(w&&E&&oM.test(W)&&(!Y||C))D=D.slice(0,q-1)+"-"+D.slice(q-1),E=w,w=!1,$=!0;else $=u(W)===W&&F(W)!==W,E=w,w=F(W)===W&&u(W)!==W}return D},DY=(D,u)=>{return P9.lastIndex=0,D.replaceAll(P9,(F)=>u(F))},uY=(D,u)=>{return j9.lastIndex=0,k9.lastIndex=0,D.replaceAll(k9,(F,C,$)=>["_","-"].includes(D.charAt($+F.length))?F:u(F)).replaceAll(j9,(F,C)=>u(C))};function TD(D,u){if(!(typeof D==="string"||Array.isArray(D)))throw new TypeError("Expected the input to be `string | string[]`");if(u={pascalCase:!1,preserveConsecutiveUppercase:!1,...u},Array.isArray(D))D=D.map((w)=>w.trim()).filter((w)=>w.length).join("-");else D=D.trim();if(D.length===0)return"";let F=u.locale===!1?(w)=>w.toLowerCase():(w)=>w.toLocaleLowerCase(u.locale),C=u.locale===!1?(w)=>w.toUpperCase():(w)=>w.toLocaleUpperCase(u.locale);if(D.length===1){if(T2.test(D))return"";return u.pascalCase?C(D):F(D)}if(D!==F(D))D=eM(D,F,C,u.preserveConsecutiveUppercase);if(D=D.replace(sM,""),D=u.preserveConsecutiveUppercase?DY(D,F):F(D),u.pascalCase)D=C(D.charAt(0))+D.slice(1);return uY(D,C)}var XC=t(N2(),1),o=t(N2(),1),WC=t(_9(),1),GC=t(g9(),1),zC=t(b9(),1);var S2=(D,u)=>u.some((F)=>F instanceof RegExp?F.test(D):F===D),FY=new Set(["https:","http:","file:"]),CY=(D)=>{try{let{protocol:u}=new URL(D);return u.endsWith(":")&&!u.includes(".")&&!FY.has(u)}catch{return!1}},$Y=(D,{stripHash:u})=>{let F=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(D);if(!F)throw new Error(`Invalid URL: ${D}`);let{type:C,data:$,hash:w}=F.groups,E=C.split(";");w=u?"":w;let Y=!1;if(E[E.length-1]==="base64")E.pop(),Y=!0;let q=E.shift()?.toLowerCase()??"",Z=[...E.map((G)=>{let[A,z=""]=G.split("=").map((X)=>X.trim());if(A==="charset"){if(z=z.toLowerCase(),z==="us-ascii")return""}return`${A}${z?`=${z}`:""}`}).filter(Boolean)];if(Y)Z.push("base64");if(Z.length>0||q&&q!=="text/plain")Z.unshift(q);return`data:${Z.join(";")},${Y?$.trim():$}${w?`#${w}`:""}`};function _2(D,u){if(u={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...u},typeof u.defaultProtocol==="string"&&!u.defaultProtocol.endsWith(":"))u.defaultProtocol=`${u.defaultProtocol}:`;if(D=D.trim(),/^data:/i.test(D))return $Y(D,u);if(CY(D))return D;let F=D.startsWith("//");if(!(!F&&/^\.*\//.test(D)))D=D.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,u.defaultProtocol);let $=new URL(D);if(u.forceHttp&&u.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(u.forceHttp&&$.protocol==="https:")$.protocol="http:";if(u.forceHttps&&$.protocol==="http:")$.protocol="https:";if(u.stripAuthentication)$.username="",$.password="";if(u.stripHash)$.hash="";else if(u.stripTextFragment)$.hash=$.hash.replace(/#?:~:text.*?$/i,"");if($.pathname){let E=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,Y=0,q="";for(;;){let Z=E.exec($.pathname);if(!Z)break;let G=Z[0],A=Z.index,z=$.pathname.slice(Y,A);q+=z.replace(/\/{2,}/g,"/"),q+=G,Y=A+G.length}let W=$.pathname.slice(Y,$.pathname.length);q+=W.replace(/\/{2,}/g,"/"),$.pathname=q}if($.pathname)try{$.pathname=decodeURI($.pathname)}catch{}if(u.removeDirectoryIndex===!0)u.removeDirectoryIndex=[/^index\.[a-z]+$/];if(Array.isArray(u.removeDirectoryIndex)&&u.removeDirectoryIndex.length>0){let E=$.pathname.split("/"),Y=E[E.length-1];if(S2(Y,u.removeDirectoryIndex))E=E.slice(0,-1),$.pathname=E.slice(1).join("/")+"/"}if($.hostname){if($.hostname=$.hostname.replace(/\.$/,""),u.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test($.hostname))$.hostname=$.hostname.replace(/^www\./,"")}if(Array.isArray(u.removeQueryParameters)){for(let E of[...$.searchParams.keys()])if(S2(E,u.removeQueryParameters))$.searchParams.delete(E)}if(!Array.isArray(u.keepQueryParameters)&&u.removeQueryParameters===!0)$.search="";if(Array.isArray(u.keepQueryParameters)&&u.keepQueryParameters.length>0){for(let E of[...$.searchParams.keys()])if(!S2(E,u.keepQueryParameters))$.searchParams.delete(E)}if(u.sortQueryParameters){$.searchParams.sort();try{$.search=decodeURIComponent($.search)}catch{}}if(u.removeTrailingSlash)$.pathname=$.pathname.replace(/\/$/,"");if(u.removeExplicitPort&&$.port)$.port="";let w=D;if(D=$.toString(),!u.removeSingleSlash&&$.pathname==="/"&&!w.endsWith("/")&&$.hash==="")D=D.replace(/\/$/,"");if((u.removeTrailingSlash||$.pathname==="/")&&$.hash===""&&u.removeSingleSlash)D=D.replace(/\/$/,"");if(F&&!u.normalizeProtocol)D=D.replace(/^http:\/\//,"//");if(u.stripProtocol)D=D.replace(/^(?:https?:)?\/\//,"");return D}var TC=t(m9(),1),VC=t(v9(),1);var QY=class D{#D="";newLine=`
|
|
55
|
-
`;writeStatement(u){this.#D=`${this.#D}${this.newLine}${u}`}child(){return new D}toString(){return this.#D}flush(){this.#D=""}};function HY({parseFnRefId:D,variableName:u,wildCardPath:F,isArrayMember:C,valueExpression:$,parentExpression:w,fieldNameExpression:E,parentValueExpression:Y}){let q=D?`refs['${D}'](${$}, {
|
|
56
|
-
data: root,
|
|
57
|
-
meta: meta,
|
|
58
|
-
parent: ${Y}
|
|
59
|
-
})`:$,W="";if(w==="root"||w==="root_item")W=E;else if(E!=="''")W=`${w}.getFieldPath() + '.' + ${E}`;return`const ${u} = defineValue(${q}, {
|
|
60
|
-
data: root,
|
|
61
|
-
meta: meta,
|
|
62
|
-
name: ${E},
|
|
63
|
-
wildCardPath: '${F}',
|
|
64
|
-
getFieldPath() {
|
|
65
|
-
return ${W};
|
|
66
|
-
},
|
|
67
|
-
mutate: defineValue,
|
|
68
|
-
report: report,
|
|
69
|
-
isValid: true,
|
|
70
|
-
parent: ${Y},
|
|
71
|
-
isArrayMember: ${C},
|
|
72
|
-
});`}var K0=class{#D;#u;field;constructor(D,u,F,C){if(this.#u=C,this.#D=D,this.#u)this.field=this.#u;else u.variablesCounter++,this.field=u.createFieldFor(D,F)}defineField(D){if(!this.#u)D.writeStatement(HY({fieldNameExpression:this.field.fieldNameExpression,isArrayMember:this.field.isArrayMember,parentExpression:this.field.parentExpression,parentValueExpression:this.field.parentValueExpression,valueExpression:this.field.valueExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath,parseFnRefId:"parseFnId"in this.#D?this.#D.parseFnId:void 0}))}};function c9({variableName:D,guardedCodeSnippet:u}){return`if (${D}_is_array) {
|
|
73
|
-
${u}
|
|
74
|
-
}`}function f1({variableName:D,bail:u,guardedCodeSnippet:F}){if(!u)return F;return`if (${D}.isValid) {
|
|
75
|
-
${F}
|
|
76
|
-
}`}function f0({allowNull:D,conditional:u,variableName:F,outputExpression:C,transformFnRefId:$}){if(!D)return"";return`${u||"if"}(${F}.value === null) {
|
|
77
|
-
${C} = ${$?`refs['${$}'](null, ${F});`:"null;"}
|
|
78
|
-
}`}function UY(D,u){let[F,C]=D;if(F&&C)return`if (${F} && ${C}) {
|
|
79
|
-
${u}
|
|
80
|
-
}`;if(F)return`if (${F}) {
|
|
81
|
-
${u}
|
|
82
|
-
}`;if(C)return`if (${C}) {
|
|
83
|
-
${u}
|
|
84
|
-
}`;return u}function yY({isAsync:D,implicit:u,ruleFnId:F},C,$,w,E){let Y=`refs['${F}']`,q=`${Y}.validator(${C}.value, ${Y}.options, ${C});`;E=E||`${C}.isDefined`;let W=$?`${C}.isValid`:"";return UY([W,u||w?"":E],D?`await ${q}`:`${q}`)}function d0({bail:D,validations:u,variableName:F,dropMissingCheck:C,existenceCheckExpression:$}){return`${u.map((w)=>yY(w,F,D,C,$)).join(`
|
|
85
|
-
`)}`}function x9({variableName:D,outputExpression:u,outputValueExpression:F}){return`const ${D}_out = ${F};
|
|
86
|
-
${u} = ${D}_out;`}function i0({allowNull:D,isOptional:u,variableName:F}){if(u===!1)if(D===!1)return`ensureExists(${F});`;else return`ensureIsDefined(${F});`;return""}function n9({variableName:D}){return`const ${D}_is_array = ensureIsArray(${D});`}var OY=class extends K0{#D;#u;#F;constructor(D,u,F,C,$){super(D,F,C,$);this.#D=D,this.#u=u,this.#F=F}#C(){let D=this.#u.child(),u={type:"tuple",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath};return this.#D.properties.forEach((F)=>{this.#F.compileNode(F,D,u)}),D.toString()}compile(){this.defineField(this.#u),this.#u.writeStatement(i0({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName})),this.#u.writeStatement(n9({variableName:this.field.variableName})),this.#u.writeStatement(d0({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!1,existenceCheckExpression:`${this.field.variableName}_is_array`}));let D=c9({variableName:this.field.variableName,guardedCodeSnippet:`${this.#u.newLine}${f1({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${x9({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:this.#D.allowUnknownProperties?`copyProperties(${this.field.variableName}.value)`:"[]"})}${this.#u.newLine}${this.#C()}`})}`});this.#u.writeStatement(`${D}${this.#u.newLine}${f0({allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}};function TY({variableName:D,loopCodeSnippet:u,startingIndex:F}){return F=F||0,`const ${D}_items_size = ${D}.value.length;
|
|
87
|
-
for (let ${D}_i = ${F}; ${D}_i < ${D}_items_size; ${D}_i++) {
|
|
88
|
-
${u}
|
|
89
|
-
}`}var VY=class extends K0{#D;#u;#F;constructor(D,u,F,C,$){super(D,F,C,$);this.#D=D,this.#u=u,this.#F=F}#C(){let D=this.#u.child();this.#F.compileNode(this.#D.each,D,{type:"array",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath});let u=this.#u.child();return u.writeStatement(TY({variableName:this.field.variableName,startingIndex:0,loopCodeSnippet:D.toString()})),D.flush(),u.toString()}compile(){this.defineField(this.#u),this.#u.writeStatement(i0({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName})),this.#u.writeStatement(n9({variableName:this.field.variableName})),this.#u.writeStatement(d0({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!1,existenceCheckExpression:`${this.field.variableName}_is_array`}));let D=c9({variableName:this.field.variableName,guardedCodeSnippet:`${this.#u.newLine}${f1({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${x9({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"[]"})}${this.#u.newLine}${this.#C()}`})}`});this.#u.writeStatement(`${D}${this.#u.newLine}${f0({allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}};function LY({parseFnRefId:D,variableName:u}){if(D)return`${u}.value = refs['${D}'](${u}.value);`;return""}function f9({variableName:D,conditionalFnRefId:u}){return`else {
|
|
90
|
-
refs['${u}'](${D}.value, ${D});
|
|
91
|
-
}`}function d9({conditional:D,variableName:u,conditionalFnRefId:F,guardedCodeSnippet:C}){return`${D}(refs['${F}'](${u}.value, ${u})) {
|
|
92
|
-
${C}
|
|
93
|
-
}`}var NY=class extends K0{#D;#u;#F;#C;constructor(D,u,F,C,$){super(D,F,C,$);this.#u=D,this.#F=u,this.#C=C,this.#D=F}#$(){let D=this.#F.child();if(this.#u.conditions.forEach((u,F)=>{let C=this.#F.child();if("parseFnId"in u.schema)C.writeStatement(LY({parseFnRefId:u.schema.parseFnId,variableName:this.field.variableName}));this.#D.compileNode(u.schema,C,this.#C,this.field),D.writeStatement(d9({conditional:F===0?"if":"else if",variableName:this.field.variableName,conditionalFnRefId:u.conditionalFnRefId,guardedCodeSnippet:C.toString()})),C.flush()}),this.#u.elseConditionalFnRefId&&this.#u.conditions.length)D.writeStatement(f9({variableName:this.field.variableName,conditionalFnRefId:this.#u.elseConditionalFnRefId}));return D.toString()}compile(){this.defineField(this.#F),this.#F.writeStatement(this.#$())}};function hY({variableName:D,loopCodeSnippet:u}){return`const ${D}_keys = Object.keys(${D}.value);
|
|
94
|
-
const ${D}_keys_size = ${D}_keys.length;
|
|
95
|
-
for (let ${D}_key_i = 0; ${D}_key_i < ${D}_keys_size; ${D}_key_i++) {
|
|
96
|
-
const ${D}_i = ${D}_keys[${D}_key_i];
|
|
97
|
-
${u}
|
|
98
|
-
}`}function i9({variableName:D,guardedCodeSnippet:u}){return`if (${D}_is_object) {
|
|
99
|
-
${u}
|
|
100
|
-
}`}function l9({variableName:D,outputExpression:u,outputValueExpression:F}){return`const ${D}_out = ${F};
|
|
101
|
-
${u} = ${D}_out;`}function r9({variableName:D}){return`const ${D}_is_object = ensureIsObject(${D});`}var IY=class extends K0{#D;#u;#F;constructor(D,u,F,C,$){super(D,F,C,$);this.#D=D,this.#u=u,this.#F=F}#C(){let D=this.#u.child(),u=this.#u.child();return this.#F.compileNode(this.#D.each,u,{type:"record",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath}),D.writeStatement(hY({variableName:this.field.variableName,loopCodeSnippet:u.toString()})),u.flush(),D.toString()}compile(){this.defineField(this.#u),this.#u.writeStatement(i0({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName})),this.#u.writeStatement(r9({variableName:this.field.variableName})),this.#u.writeStatement(d0({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!1,existenceCheckExpression:`${this.field.variableName}_is_object`}));let D=f1({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${l9({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"{}"})}${this.#C()}`}),u=i9({variableName:this.field.variableName,guardedCodeSnippet:`${this.#u.newLine}${D}`});this.#u.writeStatement(`${u}${this.#u.newLine}${f0({allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}};function RY(D){return`[${D.map((u)=>`"${u}"`).join(", ")}]`}function PY({variableName:D,fieldsToIgnore:u,allowUnknownProperties:F}){if(!F)return"";let C=RY(u);return`moveProperties(${D}.value, ${D}_out, ${C});`}var jY=class extends K0{#D;#u;#F;constructor(D,u,F,C,$){super(D,F,C,$);this.#D=D,this.#u=u,this.#F=F}#C(D){let u=D.properties.map((C)=>C.fieldName),F=D.groups.flatMap((C)=>this.#$(C));return u.concat(F)}#$(D){return D.conditions.flatMap((u)=>{return this.#C(u.schema)})}#E(){let D=this.#u.child(),u={type:"object",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath};return this.#D.properties.forEach((F)=>this.#F.compileNode(F,D,u)),D.toString()}#w(){let D=this.#u.child(),u={type:"object",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath};return this.#D.groups.forEach((F)=>this.#B(F,D,u)),D.toString()}#B(D,u,F){if(D.conditions.forEach((C,$)=>{let w=u.child();C.schema.properties.forEach((E)=>{this.#F.compileNode(E,w,F)}),C.schema.groups.forEach((E)=>{this.#B(E,w,F)}),u.writeStatement(d9({variableName:this.field.variableName,conditional:$===0?"if":"else if",conditionalFnRefId:C.conditionalFnRefId,guardedCodeSnippet:w.toString()}))}),D.elseConditionalFnRefId&&D.conditions.length)u.writeStatement(f9({variableName:this.field.variableName,conditionalFnRefId:D.elseConditionalFnRefId}))}compile(){this.defineField(this.#u),this.#u.writeStatement(i0({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName})),this.#u.writeStatement(r9({variableName:this.field.variableName})),this.#u.writeStatement(d0({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!1,existenceCheckExpression:`${this.field.variableName}_is_object`}));let D=f1({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${l9({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"{}"})}${this.#u.newLine}${this.#E()}${this.#u.newLine}${this.#w()}${this.#u.newLine}${PY({variableName:this.field.variableName,allowUnknownProperties:this.#D.allowUnknownProperties,fieldsToIgnore:this.#D.allowUnknownProperties?this.#C(this.#D):[]})}`}),u=i9({variableName:this.field.variableName,guardedCodeSnippet:`${D}`});this.#u.writeStatement(`${u}${this.#u.newLine}${f0({variableName:this.field.variableName,allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,conditional:"else if"})}`)}};function kY(D){return{parentExpression:D.variableName,parentValueExpression:D.variableName,fieldNameExpression:"''",fieldPathExpression:"''",wildCardPath:"",variableName:`${D.variableName}_item`,valueExpression:"root",outputExpression:D.outputExpression,isArrayMember:!1}}function SY({variableName:D,outputExpression:u,transformFnRefId:F}){let C=F?`refs['${F}'](${D}.value, ${D})`:`${D}.value`;return`if (${D}.isDefined && ${D}.isValid) {
|
|
102
|
-
${u} = ${C};
|
|
103
|
-
}`}var _Y=class extends K0{#D;#u;constructor(D,u,F,C,$){super(D,F,C,$);this.#D=D,this.#u=u}compile(){this.defineField(this.#u),this.#u.writeStatement(i0({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName})),this.#u.writeStatement(d0({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!1})),this.#u.writeStatement(`${SY({variableName:this.field.variableName,outputExpression:this.field.outputExpression,transformFnRefId:this.#D.transformFnId})}${this.#u.newLine}${f0({variableName:this.field.variableName,allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,transformFnRefId:this.#D.transformFnId,conditional:"else if"})}`)}};function gY(D){let u=D.wildCardPath!==""?`${D.wildCardPath}.*`:"*";return{parentExpression:D.variableName,parentValueExpression:`${D.variableName}.value`,fieldNameExpression:`${D.variableName}_i`,fieldPathExpression:u,wildCardPath:u,variableName:`${D.variableName}_item`,valueExpression:`${D.variableName}.value[${D.variableName}_i]`,outputExpression:`${D.variableName}_out[${D.variableName}_i]`,isArrayMember:!0}}function bY(D,u){let F=u.wildCardPath!==""?`${u.wildCardPath}.${D.fieldName}`:D.fieldName;return{parentExpression:u.variableName,parentValueExpression:`${u.variableName}.value`,fieldNameExpression:`${D.fieldName}`,fieldPathExpression:F,wildCardPath:F,variableName:`${u.variableName}_item_${D.fieldName}`,valueExpression:`${u.variableName}.value[${D.fieldName}]`,outputExpression:`${u.variableName}_out[${D.propertyName}]`,isArrayMember:!0}}function mY(){return`if(errorReporter.hasErrors) {
|
|
104
|
-
throw errorReporter.createError();
|
|
105
|
-
}`}var vY=/\d/,cY=/[A-Za-z0-9]+/;function xY(D=""){if(vY.test(D))return;return D!==D.toLowerCase()}function nY(D){return D?D[0].toUpperCase()+D.slice(1):""}function fY(D){return D?D[0].toLowerCase()+D.slice(1):""}function dY(D){let u=[];if(!D||typeof D!=="string")return u;let F="",C,$;for(let w of D){let E=!cY.test(w);if(E===!0){u.push(F),F="",C=void 0;continue}let Y=xY(w);if($===!1){if(C===!1&&Y===!0){u.push(F),F=w,C=Y;continue}if(C===!0&&Y===!1&&F.length>1){let q=F.at(-1);u.push(F.slice(0,Math.max(0,F.length-1))),F=q+w,C=Y;continue}}F+=w,C=Y,$=E}return u.push(F),u}function iY(D){let u=dY(D).map((F)=>nY(F.toLowerCase())).join("");return/^[0-9]+/.test(u)?`var_${u}`:fY(u)}function lY(D,u,F){let C=F.wildCardPath!==""?`${F.wildCardPath}.${D.fieldName}`:D.fieldName;return{parentExpression:F.variableName,parentValueExpression:`${F.variableName}.value`,fieldNameExpression:`'${D.fieldName}'`,fieldPathExpression:C,wildCardPath:C,variableName:`${iY(D.propertyName)}_${u}`,valueExpression:`${F.variableName}.value['${D.fieldName}']`,outputExpression:`${F.variableName}_out['${D.propertyName}']`,isArrayMember:!1}}function rY(D){let u=D.wildCardPath!==""?`${D.wildCardPath}.*`:"*";return{parentExpression:D.variableName,parentValueExpression:`${D.variableName}.value`,fieldNameExpression:`${D.variableName}_i`,fieldPathExpression:u,wildCardPath:u,variableName:`${D.variableName}_item`,valueExpression:`${D.variableName}.value[${D.variableName}_i]`,outputExpression:`${D.variableName}_out[${D.variableName}_i]`,isArrayMember:!1}}function pY(D){return`function report(message, rule, field, args) {
|
|
106
|
-
field.isValid = false;
|
|
107
|
-
errorReporter.report(messagesProvider.getMessage(message, rule, field, args), rule, field, args);
|
|
108
|
-
};
|
|
109
|
-
function defineValue(value, field) {
|
|
110
|
-
${D.convertEmptyStringsToNull?"if (value === '') { value = null; }":""}
|
|
111
|
-
field.value = value;
|
|
112
|
-
field.isDefined = value !== undefined && value !== null;
|
|
113
|
-
return field;
|
|
114
|
-
};
|
|
115
|
-
function ensureExists(field) {
|
|
116
|
-
if (field.value === undefined || field.value === null) {
|
|
117
|
-
field.report(REQUIRED, 'required', field);
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
return true;
|
|
121
|
-
};
|
|
122
|
-
function ensureIsDefined(field) {
|
|
123
|
-
if (field.value === undefined) {
|
|
124
|
-
field.report(REQUIRED, 'required', field);
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
return true;
|
|
128
|
-
};
|
|
129
|
-
function ensureIsObject(field) {
|
|
130
|
-
if (!field.isDefined) {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
if (typeof field.value == 'object' && !Array.isArray(field.value)) {
|
|
134
|
-
return true;
|
|
135
|
-
}
|
|
136
|
-
field.report(NOT_AN_OBJECT, 'object', field);
|
|
137
|
-
return false;
|
|
138
|
-
};
|
|
139
|
-
function ensureIsArray(field) {
|
|
140
|
-
if (!field.isDefined) {
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
if (Array.isArray(field.value)) {
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
146
|
-
field.report(NOT_AN_ARRAY, 'array', field);
|
|
147
|
-
return false;
|
|
148
|
-
};
|
|
149
|
-
function copyProperties(val) {
|
|
150
|
-
let k, out, tmp;
|
|
151
|
-
|
|
152
|
-
if (Array.isArray(val)) {
|
|
153
|
-
out = Array((k = val.length))
|
|
154
|
-
while (k--) out[k] = (tmp = val[k]) && typeof tmp == 'object' ? copyProperties(tmp) : tmp
|
|
155
|
-
return out
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
if (Object.prototype.toString.call(val) === '[object Object]') {
|
|
159
|
-
out = {} // null
|
|
160
|
-
for (k in val) {
|
|
161
|
-
out[k] = (tmp = val[k]) && typeof tmp == 'object' ? copyProperties(tmp) : tmp
|
|
162
|
-
}
|
|
163
|
-
return out
|
|
164
|
-
}
|
|
165
|
-
return val
|
|
166
|
-
};
|
|
167
|
-
function moveProperties(source, destination, ignoreKeys) {
|
|
168
|
-
for (let key in source) {
|
|
169
|
-
if (!ignoreKeys.includes(key)) {
|
|
170
|
-
const value = source[key]
|
|
171
|
-
destination[key] = copyProperties(value)
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
};`}function aY(D){return`const REQUIRED = '${D.required}';
|
|
175
|
-
const NOT_AN_OBJECT = '${D.object}';
|
|
176
|
-
const NOT_AN_ARRAY = '${D.array}';`}var tY=Object.getPrototypeOf(async function(){}).constructor,m2=class{variablesCounter=0;#D;#u;#F=new QY;constructor(D,u){this.#D=D,this.#u=u||{convertEmptyStringsToNull:!1}}#C(){this.#F.writeStatement(aY({required:"value is required",object:"value is not a valid object",array:"value is not a valid array",...this.#u.messages})),this.#F.writeStatement(pY(this.#u)),this.#F.writeStatement("let out;")}#$(){this.#F.writeStatement(mY()),this.#F.writeStatement("return out;")}#E(){this.compileNode(this.#D.schema,this.#F,{type:"root",variableName:"root",outputExpression:"out",fieldPathExpression:"out",wildCardPath:""})}#w(){return new tY("root","meta","refs","messagesProvider","errorReporter",this.#F.toString())}createFieldFor(D,u){switch(u.type){case"array":return gY(u);case"root":return kY(u);case"object":return lY(D,this.variablesCounter,u);case"tuple":return bY(D,u);case"record":return rY(u)}}compileNode(D,u,F,C){switch(D.type){case"literal":return new _Y(D,u,this,F,C).compile();case"array":return new VY(D,u,this,F,C).compile();case"record":return new IY(D,u,this,F,C).compile();case"object":return new jY(D,u,this,F,C).compile();case"tuple":return new OY(D,u,this,F,C).compile();case"union":return new NY(D,u,this,F,C).compile()}}compile(){this.#C(),this.#E(),this.#$();let D=this.#w();return this.variablesCounter=0,this.#F.flush(),D}};function p9(){let D=0,u={};return{toJSON(){return u},track(F){D++;let C=`ref://${D}`;return u[C]=F,C},trackValidation(F){return this.track(F)},trackParser(F){return this.track(F)},trackTransformer(F){return this.track(F)},trackConditional(F){return this.track(F)}}}function P(D,u){let F={validator:D,isAsync:u?.isAsync||D.constructor.name==="AsyncFunction",implicit:u?.implicit??!1};return function(...C){return{rule:F,options:C[0]}}}var ZC={};G1(ZC,{COTYPE:()=>eY,IS_OF_TYPE:()=>Fu,ITYPE:()=>oY,OTYPE:()=>sY,PARSE:()=>p,SUBTYPE:()=>Ju,UNIQUE_NAME:()=>lD,VALIDATION:()=>Ru});var lD=Symbol.for("schema_name"),Fu=Symbol.for("is_of_type"),p=Symbol.for("parse"),oY=Symbol.for("opaque_input_type"),sY=Symbol.for("opaque_type"),eY=Symbol.for("camelcase_opaque_type"),Ru=Symbol.for("to_validation"),Ju=Symbol.for("subtype"),uu=P((D,u,F)=>{let C=u(F);if(!F.isDefined&&C)F.report(R.required,"required",F)},{implicit:!0}),i1=class extends Z0{optional(D){return new uJ(this,D)}nullable(){return new DJ(this)}transform(D){return new FJ(D,this)}},DJ=class D extends i1{#D;constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[p](u,F,C){let $=this.#D[p](u,F,C);return $.allowNull=!0,$}},uJ=class D extends i1{#D;validations;constructor(u,F){super();this.#D=u,this.validations=F||[]}cloneValidations(){return this.validations.map((u)=>{return{options:u.options,rule:u.rule}})}compileValidations(u){return this.validations.map((F)=>{return{ruleFnId:u.track({validator:F.rule.validator,options:F.options}),implicit:F.rule.implicit,isAsync:F.rule.isAsync}})}use(u){return this.validations.push(Ru in u?u[Ru]():u),this}requiredWhen(u,F,C){if(typeof u==="function")return this.use(uu(u));let $;switch(F){case"=":$=(w)=>w===C;break;case"!=":$=(w)=>w!==C;break;case"in":$=(w)=>C.includes(w);break;case"notIn":$=(w)=>!C.includes(w);break;case">":$=(w)=>w>C;break;case"<":$=(w)=>w<C;break;case">=":$=(w)=>w>=C;break;case"<=":$=(w)=>w<=C}return this.use(uu((w)=>{let E=v.getNestedValue(u,w);return $(E)}))}requiredIfExists(u){let F=Array.isArray(u)?u:[u];return this.use(uu((C)=>{return F.every(($)=>v.exists(v.getNestedValue($,C)))}))}requiredIfAnyExists(u){return this.use(uu((F)=>{return u.some((C)=>v.exists(v.getNestedValue(C,F)))}))}requiredIfMissing(u){let F=Array.isArray(u)?u:[u];return this.use(uu((C)=>{return F.every(($)=>v.isMissing(v.getNestedValue($,C)))}))}requiredIfAnyMissing(u){return this.use(uu((F)=>{return u.some((C)=>v.isMissing(v.getNestedValue(C,F)))}))}clone(){return new D(this.#D.clone(),this.cloneValidations())}[p](u,F,C){let $=this.#D[p](u,F,C);return $.isOptional=!0,$.validations=$.validations.concat(this.compileValidations(F)),$}},FJ=class D extends i1{#D;#u;constructor(u,F){super();this.#u=u,this.#D=F}clone(){return new D(this.#u,this.#D.clone())}[p](u,F,C){let $=this.#D[p](u,F,C);return $.transformFnId=F.trackTransformer(this.#u),$}},Qu=class extends i1{options;validations;constructor(D,u){super();this.options={bail:!0,allowNull:!1,isOptional:!1,...D},this.validations=u||[]}cloneValidations(){return this.validations.map((D)=>{return{options:D.options,rule:D.rule}})}cloneOptions(){return{...this.options}}compileValidations(D){return this.validations.map((u)=>{return{ruleFnId:D.track({validator:u.rule.validator,options:u.options}),implicit:u.rule.implicit,isAsync:u.rule.isAsync}})}parse(D){return this.options.parse=D,this}use(D){return this.validations.push(Ru in D?D[Ru]():D),this}bail(D){return this.options.bail=D,this}[p](D,u,F){return{type:"literal",subtype:this[Ju],fieldName:D,propertyName:F.toCamelCase?TD(D):D,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,parseFnId:this.options.parse?u.trackParser(this.options.parse):void 0,validations:this.compileValidations(u)}}},KC=class D extends Qu{constructor(u,F){super(u,F)}[Ju]="any";clone(){return new D(this.cloneOptions(),this.cloneValidations())}},d1=P((D,u,F)=>{let C=typeof u.choices==="function"?u.choices(F):u.choices;if(!C.includes(D))F.report(R.enum,"enum",F,{choices:C})}),l1=class D extends Qu{static rules={enum:d1};#D;[Ju]="enum";getChoices(){return this.#D}constructor(u,F,C){super(F,C||[d1({choices:u})]);this.#D=u}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},pu=["YYYY-MM-DD","YYYY-MM-DD HH:mm:ss"];o.default.extend(zC.default);o.default.extend(WC.default);o.default.extend(GC.default);var CJ=P((D,u,F)=>{if(typeof D!=="string"&&typeof D!=="number"){F.report(R.date,"date",F);return}let C=!1,$=!1,w=u.formats||pu;if(Array.isArray(w))w=[...w],C=w.includes("x"),$=w.includes("iso8601");else if(typeof w!=="string")w={...w},C=w.format==="x",$=w.format==="iso";let E=C?v.asNumber(D):D,Y;if(C&&!Number.isNaN(E))Y=o.default(E);else Y=o.default(D,w,!0);if(!Y.isValid()&&$)Y=o.default(D);if(!Y.isValid()){F.report(R.date,"date",F);return}F.meta.$value=Y,F.meta.$formats=w,F.mutate(Y.toDate(),F)}),a9=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=u.format||pu,w=F.meta.$value,E=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Y=o.default(E,$,!0);if(!Y.isValid())throw new Error(`Invalid datetime value "${E}" provided to the equals rule`);if(!w.isSame(Y,C))F.report(R["date.equals"],"date.equals",F,{expectedValue:E,compare:C})}),t9=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=u.format||pu,w=F.meta.$value,E=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Y=E==="today"?o.default():E==="tomorrow"?o.default().add(1,"day"):o.default(E,$,!0);if(!Y.isValid())throw new Error(`Invalid datetime value "${E}" provided to the after rule`);if(!w.isAfter(Y,C))F.report(R["date.after"],"date.after",F,{expectedValue:E,compare:C})}),o9=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=u.format||pu,w=F.meta.$value,E=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Y=E==="today"?o.default():E==="tomorrow"?o.default().add(1,"day"):o.default(E,$,!0);if(!Y.isValid())throw new Error(`Invalid datetime value "${E}" provided to the afterOrEqual rule`);if(!w.isSameOrAfter(Y,C))F.report(R["date.afterOrEqual"],"date.afterOrEqual",F,{expectedValue:E,compare:C})}),s9=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=u.format||pu,w=F.meta.$value,E=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Y=E==="today"?o.default():E==="yesterday"?o.default().subtract(1,"day"):o.default(E,$,!0);if(!Y.isValid())throw new Error(`Invalid datetime value "${E}" provided to the before rule`);if(!w.isBefore(Y,C))F.report(R["date.before"],"date.before",F,{expectedValue:E,compare:C})}),e9=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=u.format||pu,w=F.meta.$value,E=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Y=E==="today"?o.default():E==="yesterday"?o.default().subtract(1,"day"):o.default(E,$,!0);if(!Y.isValid())throw new Error(`Invalid datetime value "${E}" provided to the beforeOrEqual rule`);if(!w.isSameOrBefore(Y,C))F.report(R["date.beforeOrEqual"],"date.beforeOrEqual",F,{expectedValue:E,compare:C})}),D6=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=F.meta.$value,w=u.format||F.meta.$formats,E=v.getNestedValue(u.otherField,F),Y=o.default(E,w,!0);if(!Y.isValid())return;if(!$.isSame(Y,C))F.report(R["date.sameAs"],"date.sameAs",F,{otherField:u.otherField,expectedValue:E,compare:C})}),u6=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=F.meta.$value,w=u.format||F.meta.$formats,E=v.getNestedValue(u.otherField,F),Y=o.default(E,w,!0);if(!Y.isValid())return;if($.isSame(Y,C))F.report(R["date.notSameAs"],"date.notSameAs",F,{otherField:u.otherField,expectedValue:E,compare:C})}),F6=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=F.meta.$value,w=u.format||F.meta.$formats,E=v.getNestedValue(u.otherField,F),Y=o.default(E,w,!0);if(!Y.isValid())return;if(!$.isAfter(Y,C))F.report(R["date.afterField"],"date.afterField",F,{otherField:u.otherField,expectedValue:E,compare:C})}),C6=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=F.meta.$value,w=u.format||F.meta.$formats,E=v.getNestedValue(u.otherField,F),Y=o.default(E,w,!0);if(!Y.isValid())return;if(!$.isSameOrAfter(Y,C))F.report(R["date.afterOrSameAs"],"date.afterOrSameAs",F,{otherField:u.otherField,expectedValue:E,compare:C})}),$6=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=F.meta.$value,w=u.format||F.meta.$formats,E=v.getNestedValue(u.otherField,F),Y=o.default(E,w,!0);if(!Y.isValid())return;if(!$.isBefore(Y,C))F.report(R["date.beforeField"],"date.beforeField",F,{otherField:u.otherField,expectedValue:E,compare:C})}),E6=P((D,u,F)=>{if(!F.meta.$value)return;let C=u.compare||"day",$=F.meta.$value,w=u.format||F.meta.$formats,E=v.getNestedValue(u.otherField,F),Y=o.default(E,w,!0);if(!Y.isValid())return;if(!$.isSameOrBefore(Y,C))F.report(R["date.beforeOrSameAs"],"date.beforeOrSameAs",F,{otherField:u.otherField,expectedValue:E,compare:C})}),w6=P((D,u,F)=>{if(!F.meta.$value)return;let $=F.meta.$value.day();if($!==0&&$!==6)F.report(R["date.weekend"],"date.weekend",F)}),B6=P((D,u,F)=>{if(!F.meta.$value)return;let $=F.meta.$value.day();if($===0||$===6)F.report(R["date.weekday"],"date.weekday",F)}),c2=class D extends Qu{static rules={equals:a9,after:t9,afterOrEqual:o9,before:s9,beforeOrEqual:e9,sameAs:D6,notSameAs:u6,afterField:F6,afterOrSameAs:C6,beforeField:$6,beforeOrSameAs:E6,weekend:w6,weekday:B6};[lD]="vine.date";[Ju]="date";[Fu]=(u)=>{if(typeof u!=="string")return!1;return XC.default(u,this.options.formats||pu,!0).isValid()};constructor(u,F){super(u,F||[CJ(u||{})])}equals(u,F){return this.use(a9({expectedValue:u,...F}))}after(u,F){return this.use(t9({expectedValue:u,...F}))}afterOrEqual(u,F){return this.use(o9({expectedValue:u,...F}))}before(u,F){return this.use(s9({expectedValue:u,...F}))}beforeOrEqual(u,F){return this.use(e9({expectedValue:u,...F}))}sameAs(u,F){return this.use(D6({otherField:u,...F}))}notSameAs(u,F){return this.use(u6({otherField:u,...F}))}afterField(u,F){return this.use(F6({otherField:u,...F}))}afterOrSameAs(u,F){return this.use(C6({otherField:u,...F}))}beforeField(u,F){return this.use($6({otherField:u,...F}))}beforeOrSameAs(u,F){return this.use(E6({otherField:u,...F}))}weekend(){return this.use(w6())}weekday(){return this.use(B6())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},AC=class D{#D;#u=(u,F)=>{F.report(R.union,"union",F)};constructor(u){this.#D=u}otherwise(u){return this.#u=u,this}clone(){let u=new D(this.#D);return u.otherwise(this.#u),u}[p](u,F,C){return{type:"union",fieldName:u,propertyName:C.toCamelCase?TD(u):u,elseConditionalFnRefId:F.trackConditional(this.#u),conditions:this.#D.map(($)=>$[p](u,F,C))}}},QC=class{#D;#u;constructor(D,u){this.#D=u,this.#u=D}[p](D,u,F){return{conditionalFnRefId:u.trackConditional(this.#u),schema:this.#D[p](D,u,F)}}};function x2(D){return new AC(D)}x2.if=function D(u,F){return new QC(u,F)};x2.else=function D(u){return new QC(()=>!0,u)};var l0=class extends Z0{optional(){return new EJ(this)}nullable(){return new $J(this)}},$J=class D extends l0{#D;constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[p](u,F,C){let $=this.#D[p](u,F,C);if($.type!=="union")$.allowNull=!0;return $}},EJ=class D extends l0{#D;validations;constructor(u,F){super();this.#D=u,this.validations=F||[]}cloneValidations(){return this.validations.map((u)=>{return{options:u.options,rule:u.rule}})}compileValidations(u){return this.validations.map((F)=>{return{ruleFnId:u.track({validator:F.rule.validator,options:F.options}),implicit:F.rule.implicit,isAsync:F.rule.isAsync}})}use(u){return this.validations.push(Ru in u?u[Ru]():u),this}requiredWhen(u,F,C){if(typeof u==="function")return this.use(uu(u));let $;switch(F){case"=":$=(w)=>w===C;break;case"!=":$=(w)=>w!==C;break;case"in":$=(w)=>C.includes(w);break;case"notIn":$=(w)=>!C.includes(w);break;case">":$=(w)=>w>C;break;case"<":$=(w)=>w<C;break;case">=":$=(w)=>w>=C;break;case"<=":$=(w)=>w<=C}return this.use(uu((w)=>{let E=v.getNestedValue(u,w);return $(E)}))}requiredIfExists(u){let F=Array.isArray(u)?u:[u];return this.use(uu((C)=>{return F.every(($)=>{return v.exists(v.getNestedValue($,C))})}))}requiredIfAnyExists(u){return this.use(uu((F)=>{return u.some((C)=>v.exists(v.getNestedValue(C,F)))}))}requiredIfMissing(u){let F=Array.isArray(u)?u:[u];return this.use(uu((C)=>{return F.every(($)=>v.isMissing(v.getNestedValue($,C)))}))}requiredIfAnyMissing(u){return this.use(uu((F)=>{return u.some((C)=>v.isMissing(v.getNestedValue(C,F)))}))}clone(){return new D(this.#D.clone(),this.cloneValidations())}[p](u,F,C){let $=this.#D[p](u,F,C);if($.type!=="union")$.isOptional=!0,$.validations=$.validations.concat(this.compileValidations(F));return $}},r0=class extends l0{options;validations;constructor(D,u){super();this.options=D||{bail:!0,allowNull:!1,isOptional:!1},this.validations=u||[]}cloneValidations(){return this.validations.map((D)=>{return{options:D.options,rule:D.rule}})}cloneOptions(){return{...this.options}}compileValidations(D){return this.validations.map((u)=>{return{ruleFnId:D.track({validator:u.rule.validator,options:u.options}),implicit:u.rule.implicit,isAsync:u.rule.isAsync}})}parse(D){return this.options.parse=D,this}use(D){return this.validations.push(Ru in D?D[Ru]():D),this}bail(D){return this.options.bail=D,this}},HC=class D extends r0{#D;#u=!1;[lD]="vine.array";[Fu]=(u)=>{return Array.isArray(u)};constructor(u,F,C){super(F,C);this.#D=u}allowUnknownProperties(){return this.#u=!0,this}clone(){let u=new D(this.#D.map((F)=>F.clone()),this.cloneOptions(),this.cloneValidations());if(this.#u)u.allowUnknownProperties();return u}[p](u,F,C){return{type:"tuple",fieldName:u,propertyName:C.toCamelCase?TD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,allowUnknownProperties:this.#u,parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,validations:this.compileValidations(F),properties:this.#D.map(($,w)=>$[p](String(w),F,C))}}},M6=P((D,u,F)=>{if(!F.isValid)return;if(D.length<u.min)F.report(R["array.minLength"],"array.minLength",F,u)}),Y6=P((D,u,F)=>{if(!F.isValid)return;if(D.length>u.max)F.report(R["array.maxLength"],"array.maxLength",F,u)}),J6=P((D,u,F)=>{if(!F.isValid)return;if(D.length!==u.size)F.report(R["array.fixedLength"],"array.fixedLength",F,u)}),q6=P((D,u,F)=>{if(!F.isValid)return;if(D.length<=0)F.report(R.notEmpty,"notEmpty",F)}),Z6=P((D,u,F)=>{if(!F.isValid)return;if(!v.isDistinct(D,u.fields))F.report(R.distinct,"distinct",F,u)}),K6=P((D,u,F)=>{if(!F.isValid)return;F.mutate(D.filter((C)=>v.exists(C)&&C!==""),F)}),UC=class D extends r0{static rules={compact:K6,notEmpty:q6,distinct:Z6,minLength:M6,maxLength:Y6,fixedLength:J6};#D;[lD]="vine.array";[Fu]=(u)=>{return Array.isArray(u)};constructor(u,F,C){super(F,C);this.#D=u}minLength(u){return this.use(M6({min:u}))}maxLength(u){return this.use(Y6({max:u}))}fixedLength(u){return this.use(J6({size:u}))}notEmpty(){return this.use(q6())}distinct(u){return this.use(Z6({fields:u}))}compact(){return this.use(K6())}clone(){return new D(this.#D.clone(),this.cloneOptions(),this.cloneValidations())}[p](u,F,C){return{type:"array",fieldName:u,propertyName:C.toCamelCase?TD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#D[p]("*",F,C),parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,validations:this.compileValidations(F)}}},wJ=class D extends l0{#D;[lD]="types.object";[Fu]=(u)=>{return u!==null&&typeof u==="object"&&!Array.isArray(u)};constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[p](u,F,C){return C.toCamelCase=!0,this.#D[p](u,F,C)}},yC=class D extends r0{#D;#u=[];#F=!1;[lD]="vine.object";[Fu]=(u)=>{return u!==null&&typeof u==="object"&&!Array.isArray(u)};constructor(u,F,C){if(!u)throw new Error('Missing properties for "vine.object". Use an empty object if you do not want to validate any specific fields');super(F,C);this.#D=u}getProperties(){return Object.keys(this.#D).reduce((u,F)=>{return u[F]=this.#D[F].clone(),u},{})}allowUnknownProperties(){return this.#F=!0,this}merge(u){return this.#u.push(u),this}clone(){let u=new D(this.getProperties(),this.cloneOptions(),this.cloneValidations());if(this.#u.forEach((F)=>u.merge(F)),this.#F)u.allowUnknownProperties();return u}toCamelCase(){return new wJ(this)}[p](u,F,C){return{type:"object",fieldName:u,propertyName:C.toCamelCase?TD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,allowUnknownProperties:this.#F,validations:this.compileValidations(F),properties:Object.keys(this.#D).map(($)=>{return this.#D[$][p]($,F,C)}),groups:this.#u.map(($)=>{return $[p](F,C)})}}},X6=P((D,u,F)=>{if(!F.isValid)return;if(Object.keys(D).length<u.min)F.report(R["record.minLength"],"record.minLength",F,u)}),W6=P((D,u,F)=>{if(!F.isValid)return;if(Object.keys(D).length>u.max)F.report(R["record.maxLength"],"record.maxLength",F,u)}),G6=P((D,u,F)=>{if(!F.isValid)return;if(Object.keys(D).length!==u.size)F.report(R["record.fixedLength"],"record.fixedLength",F,u)}),z6=P((D,u,F)=>{if(!F.isValid)return;u(Object.keys(D),F)}),OC=class D extends r0{static rules={maxLength:W6,minLength:X6,fixedLength:G6,validateKeys:z6};#D;[lD]="vine.object";[Fu]=(u)=>{return u!==null&&typeof u==="object"&&!Array.isArray(u)};constructor(u,F,C){super(F,C);this.#D=u}minLength(u){return this.use(X6({min:u}))}maxLength(u){return this.use(W6({max:u}))}fixedLength(u){return this.use(G6({size:u}))}validateKeys(...u){return this.use(z6(...u))}clone(){return new D(this.#D.clone(),this.cloneOptions(),this.cloneValidations())}[p](u,F,C){return{type:"record",fieldName:u,propertyName:C.toCamelCase?TD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#D[p]("*",F,C),parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,validations:this.compileValidations(F)}}},A6=P((D,u,F)=>{if(typeof D!=="string")F.report(R.string,"string",F)}),Q6=P((D,u,F)=>{if(!F.isValid)return;if(!v.isEmail(D,u))F.report(R.email,"email",F)}),H6=P((D,u,F)=>{if(!F.isValid)return;let C=u&&typeof u==="function"?u(F):u,$=C?.locale||"any";if(!v.isMobilePhone(D,$,C))F.report(R.mobile,"mobile",F)}),U6=P((D,u,F)=>{if(!F.isValid)return;if(!v.isIP(D,u?.version))F.report(R.ipAddress,"ipAddress",F)}),y6=P((D,u,F)=>{if(!F.isValid)return;if(!u.test(D))F.report(R.regex,"regex",F)}),O6=P((D,u,F)=>{if(!F.isValid)return;if(!v.isHexColor(D))F.report(R.hexCode,"hexCode",F)}),T6=P((D,u,F)=>{if(!F.isValid)return;if(!v.isURL(D,u))F.report(R.url,"url",F)}),V6=P(async(D,u,F)=>{if(!F.isValid)return;if(!await v.isActiveURL(D))F.report(R.activeUrl,"activeUrl",F)}),L6=P((D,u,F)=>{if(!F.isValid)return;let C="a-zA-Z";if(u){if(u.allowSpaces)C+="\\s";if(u.allowDashes)C+="-";if(u.allowUnderscores)C+="_"}if(!new RegExp(`^[${C}]+$`).test(D))F.report(R.alpha,"alpha",F)}),N6=P((D,u,F)=>{if(!F.isValid)return;let C="a-zA-Z0-9";if(u){if(u.allowSpaces)C+="\\s";if(u.allowDashes)C+="-";if(u.allowUnderscores)C+="_"}if(!new RegExp(`^[${C}]+$`).test(D))F.report(R.alphaNumeric,"alphaNumeric",F)}),h6=P((D,u,F)=>{if(!F.isValid)return;if(D.length<u.min)F.report(R.minLength,"minLength",F,u)}),I6=P((D,u,F)=>{if(!F.isValid)return;if(D.length>u.max)F.report(R.maxLength,"maxLength",F,u)}),R6=P((D,u,F)=>{if(!F.isValid)return;if(D.length!==u.size)F.report(R.fixedLength,"fixedLength",F,u)}),P6=P((D,u,F)=>{if(!F.isValid)return;if(!D.endsWith(u.substring))F.report(R.endsWith,"endsWith",F,u)}),j6=P((D,u,F)=>{if(!F.isValid)return;if(!D.startsWith(u.substring))F.report(R.startsWith,"startsWith",F,u)}),k6=P((D,u,F)=>{if(!F.isValid)return;if(v.getNestedValue(u.otherField,F)!==D){F.report(R.sameAs,"sameAs",F,u);return}}),S6=P((D,u,F)=>{if(!F.isValid)return;if(v.getNestedValue(u.otherField,F)===D){F.report(R.notSameAs,"notSameAs",F,u);return}}),_6=P((D,u,F)=>{if(!F.isValid)return;let C=u?.confirmationField||`${F.name}_confirmation`;if(F.parent[C]!==D){F.report(R.confirmed,"confirmed",F,{otherField:C});return}}),g6=P((D,u,F)=>{if(!F.isValid)return;F.mutate(D.trim(),F)}),b6=P((D,u,F)=>{if(!F.isValid)return;F.mutate(VC.default.default(D,u),F)}),m6=P((D,u,F)=>{if(!F.isValid)return;F.mutate(D.toLocaleUpperCase(u),F)}),v6=P((D,u,F)=>{if(!F.isValid)return;F.mutate(D.toLocaleLowerCase(u),F)}),c6=P((D,u,F)=>{if(!F.isValid)return;F.mutate(TD(D),F)}),x6=P((D,u,F)=>{if(!F.isValid)return;F.mutate(TC.default.default(D),F)}),n6=P((D,u,F)=>{if(!F.isValid)return;F.mutate(_2(D,u),F)}),f6=P((D,u,F)=>{if(!F.isValid)return;if(!(typeof u.choices==="function"?u.choices(F):u.choices).includes(D)){F.report(R.in,"in",F,u);return}}),d6=P((D,u,F)=>{if(!F.isValid)return;if((typeof u.list==="function"?u.list(F):u.list).includes(D)){F.report(R.notIn,"notIn",F,u);return}}),i6=P((D,u,F)=>{if(!F.isValid)return;let C=u?typeof u==="function"?u(F)?.provider||[]:u.provider:[];if(!C.length){if(!v.isCreditCard(D))F.report(R.creditCard,"creditCard",F,{providersList:"credit"})}else if(!C.find((w)=>v.isCreditCard(D,{provider:w})))F.report(R.creditCard,"creditCard",F,{providers:C,providersList:C.join("/")})}),l6=P((D,u,F)=>{if(!F.isValid)return;let C=typeof u==="function"?u(F).countryCode:u.countryCode;if(!C.find((w)=>v.isPassportNumber(D,w)))F.report(R.passport,"passport",F,{countryCodes:C})}),r6=P((D,u,F)=>{if(!F.isValid)return;let C=u?typeof u==="function"?u(F)?.countryCode||[]:u.countryCode:[];if(!C.length){if(!v.isPostalCode(D,"any"))F.report(R.postalCode,"postalCode",F)}else if(!C.find((w)=>v.isPostalCode(D,w)))F.report(R.postalCode,"postalCode",F,{countryCodes:C})}),p6=P((D,u,F)=>{if(!F.isValid)return;if(!u||!u.version){if(!v.isUUID(D))F.report(R.uuid,"uuid",F)}else if(!u.version.find(($)=>v.isUUID(D,$)))F.report(R.uuid,"uuid",F,u)}),a6=P((D,u,F)=>{if(!F.isValid)return;if(!v.isULID(D))F.report(R.ulid,"ulid",F)}),t6=P((D,u,F)=>{if(!F.isValid)return;if(!v.isAscii(D))F.report(R.ascii,"ascii",F)}),o6=P((D,u,F)=>{if(!F.isValid)return;if(!v.isIBAN(D))F.report(R.iban,"iban",F)}),s6=P((D,u,F)=>{if(!F.isValid)return;if(!v.isJWT(D))F.report(R.jwt,"jwt",F)}),e6=P((D,u,F)=>{if(!F.isValid)return;if(!v.isLatLong(D))F.report(R.coordinates,"coordinates",F)}),r1=class D extends Qu{static rules={in:f6,jwt:s6,url:T6,iban:o6,uuid:p6,ulid:a6,trim:g6,email:Q6,alpha:L6,ascii:t6,notIn:d6,regex:y6,escape:x6,sameAs:k6,mobile:H6,string:A6,hexCode:O6,passport:l6,endsWith:P6,confirmed:_6,activeUrl:V6,minLength:h6,notSameAs:S6,maxLength:I6,ipAddress:U6,creditCard:i6,postalCode:r6,startsWith:j6,toUpperCase:m6,toLowerCase:v6,toCamelCase:c6,fixedLength:R6,coordinates:e6,normalizeUrl:n6,alphaNumeric:N6,normalizeEmail:b6};[Ju]="string";[lD]="vine.string";[Fu]=(u)=>{return typeof u==="string"};constructor(u,F){super(u,F||[A6()])}url(...u){return this.use(T6(...u))}activeUrl(){return this.use(V6())}email(...u){return this.use(Q6(...u))}mobile(...u){return this.use(H6(...u))}ipAddress(u){return this.use(U6(u?{version:u}:void 0))}hexCode(){return this.use(O6())}regex(u){return this.use(y6(u))}alpha(u){return this.use(L6(u))}alphaNumeric(u){return this.use(N6(u))}minLength(u){return this.use(h6({min:u}))}maxLength(u){return this.use(I6({max:u}))}fixedLength(u){return this.use(R6({size:u}))}confirmed(u){return this.use(_6(u))}trim(){return this.use(g6())}normalizeEmail(u){return this.use(b6(u))}toUpperCase(){return this.use(m6())}toLowerCase(){return this.use(v6())}toCamelCase(){return this.use(c6())}escape(){return this.use(x6())}normalizeUrl(...u){return this.use(n6(...u))}startsWith(u){return this.use(j6({substring:u}))}endsWith(u){return this.use(P6({substring:u}))}sameAs(u){return this.use(k6({otherField:u}))}notSameAs(u){return this.use(S6({otherField:u}))}in(u){return this.use(f6({choices:u}))}notIn(u){return this.use(d6({list:u}))}creditCard(...u){return this.use(i6(...u))}passport(...u){return this.use(l6(...u))}postalCode(...u){return this.use(r6(...u))}uuid(...u){return this.use(p6(...u))}ulid(){return this.use(a6())}ascii(){return this.use(t6())}iban(){return this.use(o6())}jwt(){return this.use(s6())}coordinates(){return this.use(e6())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},DC=P((D,u,F)=>{let C=u.strict?D:v.asNumber(D);if(typeof C!=="number"||Number.isNaN(C)||C===Number.POSITIVE_INFINITY||C===Number.NEGATIVE_INFINITY){F.report(R.number,"number",F);return}F.mutate(C,F)}),uC=P((D,u,F)=>{if(!F.isValid)return;if(D<u.min)F.report(R.min,"min",F,u)}),FC=P((D,u,F)=>{if(!F.isValid)return;if(D>u.max)F.report(R.max,"max",F,u)}),CC=P((D,u,F)=>{if(!F.isValid)return;if(D<u.min||D>u.max)F.report(R.range,"range",F,u)}),$C=P((D,u,F)=>{if(!F.isValid)return;if(D<0)F.report(R.positive,"positive",F)}),EC=P((D,u,F)=>{if(!F.isValid)return;if(D>=0)F.report(R.negative,"negative",F)}),wC=P((D,u,F)=>{if(!F.isValid)return;if(!v.isDecimal(String(D),{force_decimal:u.range[0]!==0,decimal_digits:u.range.join(",")}))F.report(R.decimal,"decimal",F,{digits:u.range.join("-")})}),BC=P((D,u,F)=>{if(!F.isValid)return;if(!Number.isInteger(D))F.report(R.withoutDecimals,"withoutDecimals",F)}),MC=P((D,u,F)=>{if(!F.isValid)return;if(!u.values.includes(D))F.report(R["number.in"],"in",F,u)}),p1=class D extends Qu{static rules={in:MC,max:FC,min:uC,range:CC,number:DC,decimal:wC,negative:EC,positive:$C,withoutDecimals:BC};[Ju]="number";[lD]="vine.number";[Fu]=(u)=>{let F=v.asNumber(u);return!Number.isNaN(F)};constructor(u,F){super(u,F||[DC(u||{})])}min(u){return this.use(uC({min:u}))}max(u){return this.use(FC({max:u}))}range(u){return this.use(CC({min:u[0],max:u[1]}))}positive(){return this.use($C())}negative(){return this.use(EC())}decimal(u){return this.use(wC({range:Array.isArray(u)?u:[u]}))}withoutDecimals(){return this.use(BC())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}in(u){return this.use(MC({values:u}))}},YC=P((D,u,F)=>{let C=u.strict===!0?D:v.asBoolean(D);if(typeof C!=="boolean"){F.report(R.boolean,"boolean",F);return}F.mutate(C,F)}),a1=class D extends Qu{static rules={boolean:YC};[Ju]="boolean";[lD]="vine.boolean";[Fu]=(u)=>{return typeof(this.options.strict===!0?u:v.asBoolean(u))==="boolean"};constructor(u,F){super(u,F||[YC(u||{})])}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},JC=P((D,u,F)=>{let C=D;if(typeof u.expectedValue==="boolean")C=v.asBoolean(D);else if(typeof u.expectedValue==="number")C=v.asNumber(D);if(C!==u.expectedValue){F.report(R.literal,"literal",F,u);return}F.mutate(C,F)}),LC=class D extends Qu{static rules={equals:JC};#D;[Ju]="literal";constructor(u,F,C){super(F,C||[JC({expectedValue:u})]);this.#D=u}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},BJ=["on","1","yes","true",!0,1],qC=P((D,u,F)=>{if(!BJ.includes(D))F.report(R.accepted,"accepted",F)}),NC=class D extends Qu{static rules={accepted:qC};[Ju]="checkbox";constructor(u,F){super(u,F||[qC()])}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},MJ=class D{#D;#u=(u,F)=>{F.report(R.unionGroup,"unionGroup",F)};constructor(u){this.#D=u}clone(){let u=new D(this.#D);return u.otherwise(this.#u),u}otherwise(u){return this.#u=u,this}[p](u,F){return{type:"group",elseConditionalFnRefId:u.trackConditional(this.#u),conditions:this.#D.map((C)=>C[p](u,F))}}},hC=class{#D;#u;constructor(D,u){this.#D=u,this.#u=D}[p](D,u){return{schema:{type:"sub_object",properties:Object.keys(this.#D).map((F)=>{return this.#D[F][p](F,D,u)}),groups:[]},conditionalFnRefId:D.trackConditional(this.#u)}}};function n2(D){return new MJ(D)}n2.if=function D(u,F){return new hC(u,F)};n2.else=function D(u){return new hC(()=>!0,u)};var IC=class D extends Qu{static rules={enum:d1};#D;[Ju]="enum";constructor(u,F,C){super(F,C||[d1({choices:Object.values(u)})]);this.#D=u}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},YJ=class D{#D;#u=(u,F)=>{F.report(R.unionOfTypes,"unionOfTypes",F)};constructor(u){this.#D=u}otherwise(u){return this.#u=u,this}clone(){let u=new D(this.#D);return u.otherwise(this.#u),u}[p](u,F,C){return{type:"union",fieldName:u,propertyName:C.toCamelCase?TD(u):u,elseConditionalFnRefId:F.trackConditional(this.#u),conditions:this.#D.map(($)=>{return{conditionalFnRefId:F.trackConditional((w,E)=>{return $[Fu](w,E)}),schema:$[p](u,F,C)}})}}},JJ=class extends Z0{group=n2;union=x2;string(){return new r1}boolean(D){return new a1(D)}accepted(){return new NC}number(D){return new p1(D)}date(D){return new c2(D)}literal(D){return new LC(D)}object(D){return new yC(D)}array(D){return new UC(D)}tuple(D){return new HC(D)}record(D){return new OC(D)}enum(D){if(Array.isArray(D)||typeof D==="function")return new l1(D);return new IC(D)}any(){return new KC}unionOfTypes(D){let u=new Set;return D.forEach((F)=>{if(!F[Fu]||!F[lD])throw new Error(`Cannot use "${F.constructor.name}". The schema type is not compatible for use with "vine.unionOfTypes"`);if(u.has(F[lD]))throw new Error(`Cannot use duplicate schema "${F[lD]}". "vine.unionOfTypes" needs distinct schema types only`);u.add(F[lD])}),u.clear(),new YJ(D)}},qJ={required:R.required,array:R.array,object:R.object},v2=class{#D;messagesProvider;errorReporter;#u(D){let u=p9();return{compilerNode:{type:"root",schema:D[p]("",u,{toCamelCase:!1})},refs:u.toJSON()}}constructor(D,u){let{compilerNode:F,refs:C}=this.#u(D);this.#D={schema:F,refs:C};let $=u.metaDataValidator,w=new m2(F,{convertEmptyStringsToNull:u.convertEmptyStringsToNull,messages:qJ}).compile();if(this.errorReporter=u.errorReporter,this.messagesProvider=u.messagesProvider,$)this.validate=(E,Y)=>{let q=Y??{},W=q.meta??{},Z=q.errorReporter??this.errorReporter,G=q.messagesProvider??this.messagesProvider;return $(W),w(E,W,C,G,Z())};else this.validate=(E,Y)=>{let q=Y??{},W=q.meta??{},Z=q.errorReporter??this.errorReporter,G=q.messagesProvider??this.messagesProvider;return w(E,W,C,G,Z())}}async tryValidate(D,...[u]){try{return[null,await this.validate(D,u)]}catch(F){if(F instanceof y2)return[F,null];throw F}}toJSON(){let{schema:D,refs:u}=this.#D;return{schema:structuredClone(D),refs:u}}},RC=class extends JJ{messagesProvider=new n0(R,R9);errorReporter=()=>new O2;convertEmptyStringsToNull=!1;helpers=v;createRule=P;compile(D){return new v2(D,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter})}withMetaData(D){return{compile:(u)=>{return new v2(u,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter,metaDataValidator:D})}}}validate(D){return this.compile(D.schema).validate(D.data,D)}tryValidate(D){return this.compile(D.schema).tryValidate(D.data,D)}},QH=new RC;var h7=t(T7(),1);class C3{static isTestEnvironment=!1;static shouldExitProcess=!0;static handle(D,u){if(this.shouldExitProcess=u?.shouldExit!==!1,u?.silent!==!0)this.writeErrorToConsole(D);let F;if(u?.message)F=u.message;else if(D instanceof Error)F=D.message;else if(typeof D==="string")F=D;else F=JSON.stringify(D);let C=new Error(F);if(D instanceof Error)Object.assign(C,D);return this.writeErrorToFile(C).catch(($)=>console.error($)),C}static handleError(D,u){return this.handle(D,u),D}static async writeErrorToFile(D){if(!(D instanceof Error)){console.error("Error is not an instance of Error:",D);return}let u=`[${new Date().toISOString()}] ${D.name}: ${D.message}
|
|
177
|
-
`,F=n8("stacks.log")??n8("errors.log");try{await N7(BF(F),{recursive:!0}),await L7(F,u)}catch(C){console.error("Failed to write to error file:",C)}}static writeErrorToConsole(D){console.error(D);let u=typeof D==="string"?D:D instanceof Error?D.message:JSON.stringify(D);if(u.includes("bunx --bun cdk destroy")||u===`Failed to execute command: ${V7("bunx --bun eslint . --fix")}`||u===`Failed to execute command: ${V7("bun storage/framework/core/actions/src/lint/fix.ts")}`){if(!this.isTestEnvironment)console.log("No need to worry. The edge function is currently being destroyed. Please run `buddy undeploy` shortly again, and continue doing so until it succeeds running."),console.log("Hoping to see you back soon!")}if(this.shouldExitProcess)hZ.exit(1)}}var RZ="storage/logs/stacks.log";async function $3(D,u){let C=`[${new Date().toISOString()}] ${D}
|
|
178
|
-
`,$=u?.logFile??RZ,w=NZ($);if(!h7.default.existsSync(w))await N7(w,{recursive:!0});await L7($,C)}function I7(D,u){let F,C;if(u&&typeof u==="object"&&!("shouldExit"in u)&&!("silent"in u)&&!("message"in u))C=u,u=void 0;if(u&&"message"in u)F=u.message;else if(KF(D))F=D;else if(D instanceof Error)F=D.stack||D.message;else F=String(D);let $=`ERROR: ${IZ(F)}`;if(C)$+=`
|
|
179
|
-
Context: ${JSON.stringify(C,null,2)}`;return $3($),C3.handle(D,u)}var PZ={withStackTrace:!1},j7=(D,u,F=PZ)=>{let C=u.isOk()?{type:"Ok",value:u.value}:{type:"Err",value:u.error},$=F.withStackTrace?new Error().stack:void 0;return{data:C,message:D,stack:$}};function ou(D,u,F,C){function $(w){return w instanceof F?w:new F(function(E){E(w)})}return new(F||(F=Promise))(function(w,E){function Y(Z){try{W(C.next(Z))}catch(G){E(G)}}function q(Z){try{W(C.throw(Z))}catch(G){E(G)}}function W(Z){Z.done?w(Z.value):$(Z.value).then(Y,q)}W((C=C.apply(D,u||[])).next())})}function R7(D){var u=typeof Symbol==="function"&&Symbol.iterator,F=u&&D[u],C=0;if(F)return F.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&C>=D.length)D=void 0;return{value:D&&D[C++],done:!D}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")}function Uu(D){return this instanceof Uu?(this.v=D,this):new Uu(D)}function P7(D,u,F){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var C=F.apply(D,u||[]),$,w=[];return $=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),Y("next"),Y("throw"),Y("return",E),$[Symbol.asyncIterator]=function(){return this},$;function E(z){return function(X){return Promise.resolve(X).then(z,G)}}function Y(z,X){if(C[z]){if($[z]=function(k){return new Promise(function(m,c){w.push([z,k,m,c])>1||q(z,k)})},X)$[z]=X($[z])}}function q(z,X){try{W(C[z](X))}catch(k){A(w[0][3],k)}}function W(z){z.value instanceof Uu?Promise.resolve(z.value.v).then(Z,G):A(w[0][2],z)}function Z(z){q("next",z)}function G(z){q("throw",z)}function A(z,X){if(z(X),w.shift(),w.length)q(w[0][0],w[0][1])}}function jZ(D){var u,F;return u={},C("next"),C("throw",function($){throw $}),C("return"),u[Symbol.iterator]=function(){return this},u;function C($,w){u[$]=D[$]?function(E){return(F=!F)?{value:Uu(D[$](E)),done:!1}:w?w(E):E}:w}}function kZ(D){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u=D[Symbol.asyncIterator],F;return u?u.call(D):(D=typeof R7==="function"?R7(D):D[Symbol.iterator](),F={},C("next"),C("throw"),C("return"),F[Symbol.asyncIterator]=function(){return this},F);function C(w){F[w]=D[w]&&function(E){return new Promise(function(Y,q){E=D[w](E),$(Y,q,E.done,E.value)})}}function $(w,E,Y,q){Promise.resolve(q).then(function(W){w({value:W,done:Y})},E)}}class qD{constructor(D){this._promise=D}static fromSafePromise(D){let u=D.then((F)=>new Cu(F));return new qD(u)}static fromPromise(D,u){let F=D.then((C)=>new Cu(C)).catch((C)=>new oD(u(C)));return new qD(F)}static fromThrowable(D,u){return(...F)=>{return new qD((()=>ou(this,void 0,void 0,function*(){try{return new Cu(yield D(...F))}catch(C){return new oD(u?u(C):C)}}))())}}static combine(D){return gZ(D)}static combineWithAllErrors(D){return bZ(D)}map(D){return new qD(this._promise.then((u)=>ou(this,void 0,void 0,function*(){if(u.isErr())return new oD(u.error);return new Cu(yield D(u.value))})))}andThrough(D){return new qD(this._promise.then((u)=>ou(this,void 0,void 0,function*(){if(u.isErr())return new oD(u.error);let F=yield D(u.value);if(F.isErr())return new oD(F.error);return new Cu(u.value)})))}andTee(D){return new qD(this._promise.then((u)=>ou(this,void 0,void 0,function*(){if(u.isErr())return new oD(u.error);try{yield D(u.value)}catch(F){}return new Cu(u.value)})))}orTee(D){return new qD(this._promise.then((u)=>ou(this,void 0,void 0,function*(){if(u.isOk())return new Cu(u.value);try{yield D(u.error)}catch(F){}return new oD(u.error)})))}mapErr(D){return new qD(this._promise.then((u)=>ou(this,void 0,void 0,function*(){if(u.isOk())return new Cu(u.value);return new oD(yield D(u.error))})))}andThen(D){return new qD(this._promise.then((u)=>{if(u.isErr())return new oD(u.error);let F=D(u.value);return F instanceof qD?F._promise:F}))}orElse(D){return new qD(this._promise.then((u)=>ou(this,void 0,void 0,function*(){if(u.isErr())return D(u.error);return new Cu(u.value)})))}match(D,u){return this._promise.then((F)=>F.match(D,u))}unwrapOr(D){return this._promise.then((u)=>u.unwrapOr(D))}safeUnwrap(){return P7(this,arguments,function*D(){return yield Uu(yield Uu(yield*jZ(kZ(yield Uu(this._promise.then((u)=>u.safeUnwrap()))))))})}then(D,u){return this._promise.then(D,u)}[Symbol.asyncIterator](){return P7(this,arguments,function*D(){let u=yield Uu(this._promise);if(u.isErr())yield yield Uu(u1(u.error));return yield Uu(u.value)})}}function u1(D){return new qD(Promise.resolve(new oD(D)))}var{fromPromise:SZ,fromSafePromise:_Z,fromThrowable:iU}=qD,k7=(D)=>{let u=ju([]);for(let F of D)if(F.isErr()){u=Zu(F.error);break}else u.map((C)=>C.push(F.value));return u},gZ=(D)=>qD.fromSafePromise(Promise.all(D)).andThen(k7),S7=(D)=>{let u=ju([]);for(let F of D)if(F.isErr()&&u.isErr())u.error.push(F.error);else if(F.isErr()&&u.isOk())u=Zu([F.error]);else if(F.isOk()&&u.isOk())u.value.push(F.value);return u},bZ=(D)=>qD.fromSafePromise(Promise.all(D)).andThen(S7),B8;(function(D){function u($,w){return(...E)=>{try{let Y=$(...E);return ju(Y)}catch(Y){return Zu(w?w(Y):Y)}}}D.fromThrowable=u;function F($){return k7($)}D.combine=F;function C($){return S7($)}D.combineWithAllErrors=C})(B8||(B8={}));function ju(D){return new Cu(D)}function Zu(D){return new oD(D)}class Cu{constructor(D){this.value=D}isOk(){return!0}isErr(){return!this.isOk()}map(D){return ju(D(this.value))}mapErr(D){return ju(this.value)}andThen(D){return D(this.value)}andThrough(D){return D(this.value).map((u)=>this.value)}andTee(D){try{D(this.value)}catch(u){}return ju(this.value)}orTee(D){return ju(this.value)}orElse(D){return ju(this.value)}asyncAndThen(D){return D(this.value)}asyncAndThrough(D){return D(this.value).map(()=>this.value)}asyncMap(D){return qD.fromSafePromise(D(this.value))}unwrapOr(D){return this.value}match(D,u){return D(this.value)}safeUnwrap(){let D=this.value;return function*(){return D}()}_unsafeUnwrap(D){return this.value}_unsafeUnwrapErr(D){throw j7("Called `_unsafeUnwrapErr` on an Ok",this,D)}*[Symbol.iterator](){return this.value}}class oD{constructor(D){this.error=D}isOk(){return!1}isErr(){return!this.isOk()}map(D){return Zu(this.error)}mapErr(D){return Zu(D(this.error))}andThrough(D){return Zu(this.error)}andTee(D){return Zu(this.error)}orTee(D){try{D(this.error)}catch(u){}return Zu(this.error)}andThen(D){return Zu(this.error)}orElse(D){return D(this.error)}asyncAndThen(D){return u1(this.error)}asyncAndThrough(D){return u1(this.error)}asyncMap(D){return u1(this.error)}unwrapOr(D){return D}match(D,u){return u(this.error)}safeUnwrap(){let D=this.error;return function*(){throw yield Zu(D),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(D){throw j7("Called `_unsafeUnwrap` on an Err",this,D)}_unsafeUnwrapErr(D){return this.error}*[Symbol.iterator](){let D=this;return yield D,D}}var mZ=B8.fromThrowable;var LD={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},M3={silent:{level:-1},fatal:{level:LD.fatal},error:{level:LD.error},warn:{level:LD.warn},log:{level:LD.log},info:{level:LD.info},success:{level:LD.success},fail:{level:LD.fail},ready:{level:LD.info},start:{level:LD.info},box:{level:LD.info},debug:{level:LD.debug},trace:{level:LD.trace},verbose:{level:LD.verbose}};function E3(D){if(D===null||typeof D!=="object")return!1;let u=Object.getPrototypeOf(D);if(u!==null&&u!==Object.prototype&&Object.getPrototypeOf(u)!==null)return!1;if(Symbol.iterator in D)return!1;if(Symbol.toStringTag in D)return Object.prototype.toString.call(D)==="[object Module]";return!0}function Y3(D,u,F=".",C){if(!E3(u))return Y3(D,{},F,C);let $=Object.assign({},u);for(let w in D){if(w==="__proto__"||w==="constructor")continue;let E=D[w];if(E===null||E===void 0)continue;if(C&&C($,w,E,F))continue;if(Array.isArray(E)&&Array.isArray($[w]))$[w]=[...E,...$[w]];else if(E3(E)&&E3($[w]))$[w]=Y3(E,$[w],(F?`${F}.`:"")+w.toString(),C);else $[w]=E}return $}function vZ(D){return(...u)=>u.reduce((F,C)=>Y3(F,C,"",D),{})}var cZ=vZ();function xZ(D){return Object.prototype.toString.call(D)==="[object Object]"}function nZ(D){if(!xZ(D))return!1;if(!D.message&&!D.args)return!1;if(D.stack)return!1;return!0}var w3=!1,_7=[];class HD{options;_lastLog;_mockFn;constructor(D={}){let u=D.types||M3;this.options=cZ({...D,defaults:{...D.defaults},level:B3(D.level,u),reporters:[...D.reporters||[]]},{types:M3,throttle:1000,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let F in u){let C={type:F,...this.options.defaults,...u[F]};this[F]=this._wrapLogFn(C),this[F].raw=this._wrapLogFn(C,!0)}if(this.options.mockFn)this.mockTypes();this._lastLog={}}get level(){return this.options.level}set level(D){this.options.level=B3(D,this.options.types,this.options.level)}prompt(D,u){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(D,u)}create(D){let u=new HD({...this.options,...D});if(this._mockFn)u.mockTypes(this._mockFn);return u}withDefaults(D){return this.create({...this.options,defaults:{...this.options.defaults,...D}})}withTag(D){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+D:D})}addReporter(D){return this.options.reporters.push(D),this}removeReporter(D){if(D){let u=this.options.reporters.indexOf(D);if(u!==-1)return this.options.reporters.splice(u,1)}else this.options.reporters.splice(0);return this}setReporters(D){return this.options.reporters=Array.isArray(D)?D:[D],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let D in this.options.types){if(!console["__"+D])console["__"+D]=console[D];console[D]=this[D].raw}}restoreConsole(){for(let D in this.options.types)if(console["__"+D])console[D]=console["__"+D],delete console["__"+D]}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(D,u){if(!D)return;if(!D.__write)D.__write=D.write;D.write=(F)=>{this[u].raw(String(F).trim())}}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(D){if(!D)return;if(D.__write)D.write=D.__write,delete D.__write}pauseLogs(){w3=!0}resumeLogs(){w3=!1;let D=_7.splice(0);for(let u of D)u[0]._logFn(u[1],u[2])}mockTypes(D){let u=D||this.options.mockFn;if(this._mockFn=u,typeof u!=="function")return;for(let F in this.options.types)this[F]=u(F,this.options.types[F])||this[F],this[F].raw=this[F]}_wrapLogFn(D,u){return(...F)=>{if(w3){_7.push([this,D,F,u]);return}return this._logFn(D,F,u)}}_logFn(D,u,F){if((D.level||0)>this.level)return!1;let C={date:new Date,args:[],...D,level:B3(D.level,this.options.types)};if(!F&&u.length===1&&nZ(u[0]))Object.assign(C,u[0]);else C.args=[...u];if(C.message)C.args.unshift(C.message),delete C.message;if(C.additional){if(!Array.isArray(C.additional))C.additional=C.additional.split(`
|
|
180
|
-
`);C.args.push(`
|
|
181
|
-
`+C.additional.join(`
|
|
182
|
-
`)),delete C.additional}C.type=typeof C.type==="string"?C.type.toLowerCase():"log",C.tag=typeof C.tag==="string"?C.tag:"";let $=(E=!1)=>{let Y=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&Y>0){let q=[...this._lastLog.object.args];if(Y>1)q.push(`(repeated ${Y} times)`);this._log({...this._lastLog.object,args:q}),this._lastLog.count=1}if(E)this._lastLog.object=C,this._log(C)};clearTimeout(this._lastLog.timeout);let w=this._lastLog.time&&C.date?C.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=C.date,w<this.options.throttle)try{let E=JSON.stringify([C.type,C.tag,C.args]),Y=this._lastLog.serialized===E;if(this._lastLog.serialized=E,Y){if(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin){this._lastLog.timeout=setTimeout($,this.options.throttle);return}}}catch{}$(!0)}_log(D){for(let u of this.options.reporters)u.log(D,{options:this.options})}}function B3(D,u={},F=3){if(D===void 0)return F;if(typeof D==="number")return D;if(u[D]&&u[D].level!==void 0)return u[D].level;return F}HD.prototype.add=HD.prototype.addReporter;HD.prototype.remove=HD.prototype.removeReporter;HD.prototype.clear=HD.prototype.removeReporter;HD.prototype.withScope=HD.prototype.withTag;HD.prototype.mock=HD.prototype.mockTypes;HD.prototype.pause=HD.prototype.pauseLogs;HD.prototype.resume=HD.prototype.resumeLogs;function g7(D={}){return new HD(D)}import{formatWithOptions as b7}from"node:util";import{sep as fZ}from"node:path";function q3(D,u){let F=process.cwd()+fZ;return D.split(`
|
|
183
|
-
`).splice(u.split(`
|
|
184
|
-
`).length).map(($)=>$.trim().replace("file://","").replace(F,""))}function dZ(D,u){return(u.__write||u.write).call(u,D)}var J3=(D)=>D?`[${D}]`:"";class M8{formatStack(D,u,F){let C=" ".repeat((F?.errorLevel||0)+1);return C+q3(D,u).join(`
|
|
185
|
-
${C}`)}formatError(D,u){let F=D.message??b7(u,D),C=D.stack?this.formatStack(D.stack,F,u):"",$=u?.errorLevel||0,w=$>0?`${" ".repeat($)}[cause]: `:"",E=D.cause?`
|
|
186
|
-
|
|
187
|
-
`+this.formatError(D.cause,{...u,errorLevel:$+1}):"";return w+F+`
|
|
188
|
-
`+C+E}formatArgs(D,u){let F=D.map((C)=>{if(C&&typeof C.stack==="string")return this.formatError(C,u);return C});return b7(u,...F)}formatDate(D,u){return u.date?D.toLocaleTimeString():""}filterAndJoin(D){return D.filter(Boolean).join(" ")}formatLogObj(D,u){let F=this.formatArgs(D.args,u);if(D.type==="box")return`
|
|
189
|
-
`+[J3(D.tag),D.title&&D.title,...F.split(`
|
|
190
|
-
`)].filter(Boolean).map((C)=>" > "+C).join(`
|
|
191
|
-
`)+`
|
|
192
|
-
`;return this.filterAndJoin([J3(D.type),J3(D.tag),F])}log(D,u){let F=this.formatLogObj(D,{columns:u.options.stdout.columns||0,...u.options.formatOptions});return dZ(F+`
|
|
193
|
-
`,D.level<2?u.options.stderr||process.stderr:u.options.stdout||process.stdout)}}import G$ from"node:process";import*as Y8 from"node:tty";var{env:fu={},argv:c7=[],platform:iZ=""}=typeof process==="undefined"?{}:process,lZ="NO_COLOR"in fu||c7.includes("--no-color"),rZ="FORCE_COLOR"in fu||c7.includes("--color"),pZ=iZ==="win32",x7=fu.TERM==="dumb",aZ=Y8&&Y8.isatty&&Y8.isatty(1)&&fu.TERM&&!x7,tZ="CI"in fu&&(("GITHUB_ACTIONS"in fu)||("GITLAB_CI"in fu)||("CIRCLECI"in fu)),oZ=!lZ&&(rZ||pZ&&!x7||aZ||tZ);function n7(D,u,F,C,$=u.slice(0,Math.max(0,D))+C,w=u.slice(Math.max(0,D+F.length)),E=w.indexOf(F)){return $+(E<0?w:n7(E,w,F,C))}function sZ(D,u,F,C,$){return D<0?F+u+C:F+n7(D,u,C,$)+C}function eZ(D,u,F=D,C=D.length+1){return($)=>$||!($===""||$===void 0)?sZ((""+$).indexOf(u,C),$,D,u,F):""}function f(D,u,F){return eZ(`\x1B[${D}m`,`\x1B[${u}m`,F)}var m7={reset:f(0,0),bold:f(1,22,"\x1B[22m\x1B[1m"),dim:f(2,22,"\x1B[22m\x1B[2m"),italic:f(3,23),underline:f(4,24),inverse:f(7,27),hidden:f(8,28),strikethrough:f(9,29),black:f(30,39),red:f(31,39),green:f(32,39),yellow:f(33,39),blue:f(34,39),magenta:f(35,39),cyan:f(36,39),white:f(37,39),gray:f(90,39),bgBlack:f(40,49),bgRed:f(41,49),bgGreen:f(42,49),bgYellow:f(43,49),bgBlue:f(44,49),bgMagenta:f(45,49),bgCyan:f(46,49),bgWhite:f(47,49),blackBright:f(90,39),redBright:f(91,39),greenBright:f(92,39),yellowBright:f(93,39),blueBright:f(94,39),magentaBright:f(95,39),cyanBright:f(96,39),whiteBright:f(97,39),bgBlackBright:f(100,49),bgRedBright:f(101,49),bgGreenBright:f(102,49),bgYellowBright:f(103,49),bgBlueBright:f(104,49),bgMagentaBright:f(105,49),bgCyanBright:f(106,49),bgWhiteBright:f(107,49)};function DK(D=oZ){return D?m7:Object.fromEntries(Object.keys(m7).map((u)=>[u,String]))}var vD=DK();function uK(D,u="reset"){return vD[D]||vD[u]}var FK=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function nu(D){return D.replace(new RegExp(FK,"g"),"")}var v7={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},CK={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function f7(D,u={}){let F={...u,style:{...CK,...u.style}},C=D.split(`
|
|
194
|
-
`),$=[],w=uK(F.style.borderColor),E={...typeof F.style.borderStyle==="string"?v7[F.style.borderStyle]||v7.solid:F.style.borderStyle};if(w)for(let z in E)E[z]=w(E[z]);let Y=F.style.padding%2===0?F.style.padding:F.style.padding+1,q=C.length+Y,W=Math.max(...C.map((z)=>nu(z).length),F.title?nu(F.title).length:0)+Y,Z=W+Y,G=F.style.marginLeft>0?" ".repeat(F.style.marginLeft):"";if(F.style.marginTop>0)$.push("".repeat(F.style.marginTop));if(F.title){let z=w?w(F.title):F.title,X=E.h.repeat(Math.floor((W-nu(F.title).length)/2)),k=E.h.repeat(W-nu(F.title).length-nu(X).length+Y);$.push(`${G}${E.tl}${X}${z}${k}${E.tr}`)}else $.push(`${G}${E.tl}${E.h.repeat(Z)}${E.tr}`);let A=F.style.valign==="center"?Math.floor((q-C.length)/2):F.style.valign==="top"?q-C.length-Y:q-C.length;for(let z=0;z<q;z++)if(z<A||z>=A+C.length)$.push(`${G}${E.v}${" ".repeat(Z)}${E.v}`);else{let X=C[z-A],k=" ".repeat(Y),m=" ".repeat(W-nu(X).length);$.push(`${G}${E.v}${k}${X}${m}${E.v}`)}if($.push(`${G}${E.bl}${E.h.repeat(Z)}${E.br}`),F.style.marginBottom>0)$.push("".repeat(F.style.marginBottom));return $.join(`
|
|
195
|
-
`)}var G8=Object.create(null),$1=(D)=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(D?G8:globalThis),du=new Proxy(G8,{get(D,u){return $1()[u]??G8[u]},has(D,u){let F=$1();return u in F||u in G8},set(D,u,F){let C=$1(!0);return C[u]=F,!0},deleteProperty(D,u){if(!u)return!1;let F=$1(!0);return delete F[u],!0},ownKeys(){let D=$1(!0);return Object.keys(D)}}),rK=typeof process<"u"&&process.env&&"development"||"",pK=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function aK(){if(globalThis.process?.env)for(let D of pK){let u=D[1]||D[0];if(globalThis.process?.env[u])return{name:D[0].toLowerCase(),...D[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var H$=aK();H$.name;function su(D){return D?D!=="false":!1}var tK=globalThis.process?.platform||"",H3=su(du.CI)||H$.ci!==!1,U$=su(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),oK=su(du.DEBUG),U3=rK==="test"||su(du.TEST);su(du.MINIMAL);var sK=/^win/i.test(tK);!su(du.NO_COLOR)&&(su(du.FORCE_COLOR)||(U$||sK)&&du.TERM);var eK=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(eK?.split(".")[0]);var DX=globalThis.process||Object.create(null),z$={versions:{}};new Proxy(DX,{get(D,u){if(u==="env")return du;if(u in D)return D[u];if(u in z$)return z$[u]}});var uX=globalThis.process?.release?.name==="node",FX=!!globalThis.Bun||!!globalThis.process?.versions?.bun,CX=!!globalThis.Deno,$X=!!globalThis.fastly,EX=!!globalThis.Netlify,wX=!!globalThis.EdgeRuntime,BX=globalThis.navigator?.userAgent==="Cloudflare-Workers",MX=[[EX,"netlify"],[wX,"edge-light"],[BX,"workerd"],[$X,"fastly"],[CX,"deno"],[FX,"bun"],[uX,"node"]];function YX(){let D=MX.find((u)=>u[0]);if(D)return{name:D[1]}}var JX=YX();JX?.name;function qX({onlyFirst:D=!1}={}){let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}var ZX=qX();function KX(D){if(typeof D!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(ZX,"")}function XX(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function WX(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function GX(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D===94192||D===94193||D>=94208&&D<=100343||D>=100352&&D<=101589||D>=101631&&D<=101640||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128727||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129673||D>=129679&&D<=129734||D>=129742&&D<=129756||D>=129759&&D<=129769||D>=129776&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function zX(D){if(!Number.isSafeInteger(D))throw new TypeError(`Expected a code point, got \`${typeof D}\`.`)}function AX(D,{ambiguousAsWide:u=!1}={}){if(zX(D),WX(D)||GX(D)||u&&XX(D))return 2;return 1}var QX=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},HX=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:(D)=>D.split("")},UX=/^\p{Default_Ignorable_Code_Point}$/u;function yX(D,u={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:C=!1}=u;if(!C)D=KX(D);if(D.length===0)return 0;let $=0,w={ambiguousAsWide:!F};for(let{segment:E}of HX.segment(D)){let Y=E.codePointAt(0);if(Y<=31||Y>=127&&Y<=159)continue;if(Y>=8203&&Y<=8207||Y===65279)continue;if(Y>=768&&Y<=879||Y>=6832&&Y<=6911||Y>=7616&&Y<=7679||Y>=8400&&Y<=8447||Y>=65056&&Y<=65071)continue;if(Y>=55296&&Y<=57343)continue;if(Y>=65024&&Y<=65039)continue;if(UX.test(E))continue;if(QX().test(E)){$+=2;continue}$+=AX(Y,w)}return $}function OX(){let{env:D}=G$,{TERM:u,TERM_PROGRAM:F}=D;if(G$.platform!=="win32")return u!=="linux";return Boolean(D.WT_SESSION)||Boolean(D.TERMINUS_SUBLIME)||D.ConEmuTask==="{cmd::Cmder}"||F==="Terminus-Sublime"||F==="vscode"||u==="xterm-256color"||u==="alacritty"||u==="rxvt-unicode"||u==="rxvt-unicode-256color"||D.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var TX={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},VX={0:"red",1:"yellow"},LX=OX(),yu=(D,u)=>LX?D:u,A$={error:yu("\u2716","\xD7"),fatal:yu("\u2716","\xD7"),ready:yu("\u2714","\u221A"),warn:yu("\u26A0","\u203C"),info:yu("\u2139","i"),success:yu("\u2714","\u221A"),debug:yu("\u2699","D"),trace:yu("\u2192","\u2192"),fail:yu("\u2716","\xD7"),start:yu("\u25D0","o"),log:""};function Q$(D){if(typeof Intl!=="object"||!Intl.Segmenter)return nu(D).length;return yX(D)}class y$ extends M8{formatStack(D,u,F){let C=" ".repeat((F?.errorLevel||0)+1);return`
|
|
196
|
-
${C}`+q3(D,u).map(($)=>" "+$.replace(/^at +/,(w)=>vD.gray(w)).replace(/\((.+)\)/,(w,E)=>`(${vD.cyan(E)})`)).join(`
|
|
197
|
-
${C}`)}formatType(D,u,F){let C=TX[D.type]||VX[D.level]||"gray";if(u)return hX(C)(vD.black(` ${D.type.toUpperCase()} `));let $=typeof A$[D.type]==="string"?A$[D.type]:D.icon||D.type;return $?NX(C)($):""}formatLogObj(D,u){let[F,...C]=this.formatArgs(D.args,u).split(`
|
|
198
|
-
`);if(D.type==="box")return f7(W8(F+(C.length>0?`
|
|
199
|
-
`+C.join(`
|
|
200
|
-
`):"")),{title:D.title?W8(D.title):void 0,style:D.style});let $=this.formatDate(D.date,u),w=$&&vD.gray($),E=D.badge??D.level<2,Y=this.formatType(D,E,u),q=D.tag?vD.gray(D.tag):"",W,Z=this.filterAndJoin([Y,W8(F)]),G=this.filterAndJoin(u.columns?[q,w]:[q]),A=(u.columns||0)-Q$(Z)-Q$(G)-2;if(W=A>0&&(u.columns||0)>=80?Z+" ".repeat(A)+G:(G?`${vD.gray(`[${G}]`)} `:"")+Z,W+=W8(C.length>0?`
|
|
201
|
-
`+C.join(`
|
|
202
|
-
`):""),D.type==="trace"){let z=new Error("Trace: "+D.message);W+=this.formatStack(z.stack||"",z.message)}return E?`
|
|
203
|
-
`+W+`
|
|
204
|
-
`:W}}function W8(D){return D.replace(/`([^`]+)`/gm,(u,F)=>vD.cyan(F)).replace(/\s+_([^_]+)_\s+/gm,(u,F)=>` ${vD.underline(F)} `)}function NX(D="white"){return vD[D]||vD.white}function hX(D="bgWhite"){return vD[`bg${D[0].toUpperCase()}${D.slice(1)}`]||vD.bgWhite}function y3(D={}){let u=IX();if(process.env.CONSOLA_LEVEL)u=Number.parseInt(process.env.CONSOLA_LEVEL)??u;return g7({level:u,defaults:{level:u},stdout:process.stdout,stderr:process.stderr,prompt:(...C)=>Promise.resolve().then(() => (W$(),X$)).then(($)=>$.prompt(...C)),reporters:D.reporters||[D.fancy??!(H3||U3)?new y$:new M8],...D})}function IX(){if(oK)return LD.debug;if(U3)return LD.warn;return LD.info}var RX=y3();var Ou=new X1("stacks",{level:"debug"}),eu=y3({level:jX()});function jX(){let D=/--verbose(?!\s*=\s*false|\s+false)(?:\s+|=true)?(?:$|\s)/,u=PX();return D.test(u)?4:3}function z8(...D){return D.map((u)=>typeof u==="object"?JSON.stringify(u,null,2):String(u)).join(" ")}function E1(D,u,F,C){if(C?.styled===!1)console.log(D);else u[F](D)}var Iu={info:async(D,u)=>{E1(D,eu,"info",u),Ou.info(D)},success:async(D,u)=>{E1(D,eu,"success",u),Ou.info(`SUCCESS: ${D}`)},warn:async(D,u)=>{E1(D,eu,"warn",u),Ou.warn(D)},warning:async(D,u)=>{E1(D,eu,"warn",u),Ou.warn(D)},error:async(D,u)=>{let F=typeof D==="string"?D:D instanceof Error?D.message:JSON.stringify(D);E1(F,eu,"error",u),Ou.error(F),I7(D,u)},debug:async(...D)=>{let u=`${z8(...D)}`;if(O3.env.APP_ENV==="production"||O3.env.APP_ENV==="prod")return Ou.debug(u),$3(u);eu.debug(`DEBUG: ${u}`),Ou.debug(u)},dump:(...D)=>{let u=z8(...D);console.log(u),Ou.debug(`DUMP: ${u}`)},dd:(...D)=>{let u=z8(...D);console.log(u),eu.error(u),Ou.error(u),O3.exit(1)},echo:(...D)=>{let u=z8(...D);console.log(u),Ou.info(`ECHO: ${u}`)}};var I5=t(v3(),1);import WG from"node-fetch";var V5="https://www.iana.org/whois?q=",L5={"whois.denic.de":"-T dn,ace","whois.nic.fr":"-V Md5.2"},c3={"br.com":"whois.centralnic.net","cn.com":"whois.centralnic.net","de.com":"whois.centralnic.net","eu.com":"whois.centralnic.net","gb.com":"whois.centralnic.net","gb.net":"whois.centralnic.net","gr.com":"whois.centralnic.net","hu.com":"whois.centralnic.net","in.net":"whois.centralnic.net","no.com":"whois.centralnic.net","qc.com":"whois.centralnic.net","ru.com":"whois.centralnic.net","sa.com":"whois.centralnic.net","se.com":"whois.centralnic.net","se.net":"whois.centralnic.net","uk.com":"whois.centralnic.net","uk.net":"whois.centralnic.net","us.com":"whois.centralnic.net","uy.com":"whois.centralnic.net","za.com":"whois.centralnic.net","jpn.com":"whois.centralnic.ne","web.com":"whois.centralnic.ne",com:"whois.verisign-grs.com","za.net":"whois.za.net",net:"whois.verisign-grs.com","eu.org":"whois.eu.org","za.org":"whois.za.org",org:"whois.pir.org","llyw.cymru":"whois.nic.llyw.cymru","gov.scot":"whois.nic.gov.scot","gov.wales":"whois.nic.gov.wales",edu:"whois.educause.edu",gov:"whois.dotgov.gov",int:"whois.iana.org","e164.arpa":"whois.ripe.net",arpa:"whois.iana.org",aero:"whois.aero",asia:"whois.nic.asia",biz:"whois.nic.biz",cat:"whois.nic.cat",coop:"whois.nic.coop",info:"whois.afilias.net",jobs:"whois.nic.jobs",mobi:"whois.afilias.net",museum:"whois.nic.museum",name:"whois.nic.name",post:"whois.dotpostregistry.net",pro:"whois.nic.pro",tel:"whois.nic.tel",travel:"whois.nic.travel",xxx:"whois.nic.xxx",ac:"whois.nic.ac",ae:"whois.aeda.net.ae",af:"whois.nic.af",ag:"whois.nic.ag",ai:"whois.nic.ai",am:"whois.amnic.net",ar:"whois.nic.ar",as:"whois.nic.as","priv.at":"whois.nic.priv.at",at:"whois.nic.at",au:"whois.auda.org.au",aw:"whois.nic.aw",ax:"whois.ax",be:"whois.dns.be",bf:"whois.registre.bf",bg:"whois.register.bg",bh:"whois.nic.bh",bi:"whois1.nic.bi",bj:"whois.nic.bj",bm:"whois.afilias-srs.net",bn:"whois.bnnic.bn",bo:"whois.nic.bo",br:"whois.registro.br",by:"whois.cctld.by",bw:"whois.nic.net.bw",bz:"whois.afilias-grs.info","co.ca":"whois.co.ca",ca:"whois.cira.ca",cc:"ccwhois.verisign-grs.com",cd:"whois.nic.cd",ch:"whois.nic.ch",ci:"whois.nic.ci",cl:"whois.nic.cl",cm:"whois.netcom.cm","edu.cn":"whois.edu.cn",cn:"whois.cnnic.cn","uk.co":"whois.uk.co",co:"whois.nic.co",cr:"whois.nic.cr",cx:"whois.nic.cx",cz:"whois.nic.cz",de:"whois.denic.de",dk:"whois.dk-hostmaster.dk",dm:"whois.dmdomains.dm",do:"whois.nic.do",dz:"whois.nic.dz",ec:"whois.nic.ec",ee:"whois.tld.ee",eu:"whois.eu",fi:"whois.fi",fj:"www.whois.fj",fm:"whois.nic.fm",fo:"whois.nic.fo",fr:"whois.nic.fr",gd:"whois.nic.gd",ge:"whois.nic.ge",gf:"whois.mediaserv.net",gg:"whois.gg",gh:"whois.nic.gh",gi:"whois2.afilias-grs.net",gl:"whois.nic.gl",gp:"whois.nic.gp",gq:"whois.dominio.gq",gs:"whois.nic.gs",gy:"whois.registry.gy",hk:"whois.hkirc.hk",hm:"whois.registry.hm",hn:"whois.nic.hn",hr:"whois.dns.hr",ht:"whois.nic.ht",hu:"whois.nic.hu",id:"whois.id",ie:"whois.weare.ie",il:"whois.isoc.org.il",im:"whois.nic.im",in:"whois.registry.in",io:"whois.nic.io",iq:"whois.cmc.iq",ir:"whois.nic.ir",is:"whois.isnic.is",it:"whois.nic.it",je:"whois.je",jp:"whois.jprs.jp",ke:"whois.kenic.or.ke",kg:"whois.kg",ki:"whois.nic.ki",kn:"whois.nic.kn",kr:"whois.kr",kw:"whois.nic.kw",ky:"whois.kyregistry.ky",kz:"whois.nic.kz",la:"whois.nic.la",lb:"whois.lbdr.org.lb",lc:"whois2.afilias-grs.net",li:"whois.nic.li",lk:"whois.nic.lk",ls:"whois.nic.ls",lt:"whois.domreg.lt",lu:"whois.dns.lu",lv:"whois.nic.lv",ly:"whois.nic.ly",ma:"whois.registre.ma",md:"whois.nic.md",me:"whois.nic.me",mg:"whois.nic.mg",mk:"whois.marnet.mk",ml:"whois.dot.ml",mm:"whois.registry.gov.mm",mn:"whois.nic.mn",mq:"whois.mediaserv.net",mr:"whois.nic.mr",ms:"whois.nic.ms",mt:"whois.nic.org.mt",mu:"whois.nic.mu",mw:"whois.nic.mw",mx:"whois.mx",my:"whois.mynic.my",mz:"whois.nic.mz",na:"whois.na-nic.com.na",nc:"whois.nc",nf:"whois.nic.nf",ng:"whois.nic.net.ng",nl:"whois.domain-registry.nl",no:"whois.norid.no",nu:"whois.iis.nu",nz:"whois.irs.net.nz",om:"whois.registry.om",pe:"kero.yachay.pe",pf:"whois.registry.pf",pk:"whois.pknic.net.pk","co.pl":"whois.co.pl",pl:"whois.dns.pl",pm:"whois.nic.pm",pr:"whois.afilias-srs.net",ps:"whois.pnina.ps",pt:"whois.dns.pt",pw:"whois.nic.pw",qa:"whois.registry.qa",re:"whois.nic.re",ro:"whois.rotld.ro",rs:"whois.rnids.rs","ac.ru":"whois.free.net","edu.ru":"whois.informika.ru","com.ru":"whois.flexireg.net","msk.ru":"whois.flexireg.net","net.ru":"whois.nic.net.ru","nov.ru":"whois.flexireg.net","org.ru":"whois.nic.net.ru","pp.ru":"whois.nic.net.ru","spb.ru":"whois.flexireg.net",ru:"whois.tcinet.ru",rw:"whois.ricta.org.rw",sa:"whois.nic.net.sa",sb:"whois.nic.net.sb",sc:"whois2.afilias-grs.net",sd:"whois.sdnic.sd",se:"whois.iis.se",sg:"whois.sgnic.sg",sh:"whois.nic.sh",si:"whois.register.si",sk:"whois.sk-nic.sk",sl:"whois.nic.sl",sm:"whois.nic.sm",sn:"whois.nic.sn",so:"whois.nic.so",ss:"whois.nic.ss",st:"whois.nic.st","msk.su":"whois.flexireg.net","nov.su":"whois.flexireg.net","spb.su":"whois.flexireg.net",su:"whois.tcinet.ru",sx:"whois.sx",sy:"whois.tld.sy",tc:"whois.nic.tc",td:"whois.nic.td",tf:"whois.nic.tf",tg:"whois.nic.tg",th:"whois.thnic.co.th",tk:"whois.dot.tk",tl:"whois.nic.tl",tm:"whois.nic.tm",tn:"whois.ati.tn",to:"whois.tonic.to",tr:"whois.trabis.gov.tr",tv:"whois.nic.tv",tw:"whois.twnic.net.tw",tz:"whois.tznic.or.tz","biz.ua":"whois.biz.ua","co.ua":"whois.co.ua","pp.ua":"whois.pp.ua",ua:"whois.ua",ug:"whois.co.ug","ac.uk":"whois.nic.ac.uk","gov.uk":"whois.gov.uk",uk:"whois.nic.uk","fed.us":"whois.nic.gov",us:"whois.nic.us",uy:"whois.nic.org.uy",uz:"whois.cctld.uz",vc:"whois2.afilias-grs.net",ve:"whois.nic.ve",vg:"whois.nic.vg",vu:"whois.dnrs.vu",wf:"whois.nic.wf",ws:"whois.website.ws",yt:"whois.nic.yt","ac.za":"whois.ac.za","co.za":"whois.registry.net.za","gov.za":"whois.gov.za","net.za":"net-whois.registry.net.za","org.za":"org-whois.registry.net.za","web.za":"web-whois.registry.net.za",zm:"whois.zicta.zm","xn--2scrj9c":"whois.registry.in","xn--3e0b707e":"whois.kr","xn--3hcrj9c":"whois.registry.in","xn--45br5cyl":"whois.registry.in","xn--45brj9c":"whois.registry.in","xn--4dbrk0ce":"whois.isoc.org.il","xn--80ao21a":"whois.nic.kz","xn--90a3ac":"whois.rnids.rs","xn--90ae":"whois.imena.bg","xn--90ais":"whois.cctld.by","xn--clchc0ea0b2g2a9gcd":"whois.sgnic.sg","xn--d1alf":"whois.marnet.mk","xn--e1a4c":"whois.eu","xn--fiqs8s":"cwhois.cnnic.cn","xn--fiqz9s":"cwhois.cnnic.cn","xn--fpcrj9c3d":"whois.registry.in","xn--fzc2c9e2c":"whois.nic.lk","xn--gecrj9c":"whois.registry.in","xn--h2breg3eve":"whois.registry.in","xn--h2brj9c8c":"whois.registry.in","xn--h2brj9c":"whois.registry.in","xn--j1amh":"whois.dotukr.com","xn--j6w193g":"whois.hkirc.hk","xn--kprw13d":"whois.twnic.net.tw","xn--kpry57d":"whois.twnic.net.tw","xn--lgbbat1ad8j":"whois.nic.dz","xn--mgb9awbf":"whois.registry.om","xn--mgba3a4f16a":"whois.nic.ir","xn--mgbaam7a8h":"whois.aeda.net.ae","xn--mgbah1a3hjkrd":"whois.nic.mr","xn--mgbbh1a71e":"whois.registry.in","xn--mgbbh1a":"whois.registry.in","xn--mgberp4a5d4ar":"whois.nic.net.sa","xn--mgbgu82a":"whois.registry.in","xn--mgbtx2b":"whois.cmc.iq","xn--mgbx4cd0ab":"whois.mynic.my","xn--node":"whois.itdc.ge","xn--o3cw4h":"whois.thnic.co.th","xn--ogbpf8fl":"whois.tld.sy","xn--p1ai":"whois.tcinet.ru","xn--pgbs0dh":"whois.ati.tn","xn--q7ce6a":"whois.nic.la","xn--qxa6a":"whois.eu","xn--rvc1e0am3e":"whois.registry.in","xn--s9brj9c":"whois.registry.in","xn--wgbh1c":"whois.dotmasr.eg","xn--wgbl6a":"whois.registry.qa","xn--xkc2al3hye2a":"whois.nic.lk","xn--xkc2dl3a5ee0h":"whois.registry.in","xn--y9a3aq":"whois.amnic.net","xn--yfro4i67o":"whois.sgnic.sg","xn--ygbi2ammx":"whois.pnina.ps"};var N5;((F)=>{F[F.SOCKS4=0]="SOCKS4";F[F.SOCKS5=1]="SOCKS5"})(N5||={});function x3(D){if(Array.isArray(D))return D.slice();if(typeof D==="object"&&D!==null){let u={};for(let F in D)if(Object.prototype.hasOwnProperty.call(D,F))u[F]=x3(D[F]);return u}return D}var HG=t(v3(),1);async function GG(D){let u=V5+D;try{let F=await WG(u);if(F.ok){let $=(await F.text()).match(/whois:\s+(\S+)/);if($?.[1])return $[1]}}catch(F){console.error("Error in getting WhoIs server data from IANA",F)}return""}function zG(D){if(D==="com")return"whois.verisign-grs.com";return c3[D]}function h5(D){let u=D.split(".");for(let F=u.length-1;F>0;F--){let C=u.slice(F).join(".");if(c3[C])return C}return u[u.length-1]}function AG(D){return L5[D]}class V8{static iterParse(D,u){let F="",C=null,$="";for(let w=0;w<D.length;w++){let E=D[w];if(E===`
|
|
205
|
-
`||$===":"&&E===" "){if(F.trim()in u)C=F.trim();else if(C!==null){let Y=F.trim();if(Y!==""){let q=u[C];if(Array.isArray(q))q.push(Y);else u[C]=Y;C=null}}F=""}else if(E!==":")F=F+E;if($=E,F==="Record maintained by"||F===">>>")break}return u}static parseData(D,u){if(!u)u={"Domain Name":"","Creation Date":"","Updated Date":"","Registry Expiry Date":"","Domain Status":[],Registrar:""};return u=V8.iterParse(D,u),u}}async function QG(D,u,F,C,$,w){let E=new TextDecoder($),Y=new TextEncoder;if(!w){let W=new XG.Socket;return new Promise((Z,G)=>{try{W.connect({port:C,host:F},()=>{if(u!=="")W.write(Y.encode(`${u} ${D}\r
|
|
206
|
-
`));else W.write(Y.encode(`${D}\r
|
|
207
|
-
`))}),W.on("data",(A)=>{Z(E.decode(A))}),W.on("error",(A)=>{G(A)})}catch(A){G(A)}})}let q={proxy:{host:w.ip,port:w.port,type:w.type===1?5:4},command:"connect",destination:{host:F,port:C}};if(w.username&&w.password)q.proxy.userId=w.username,q.proxy.password=w.password;return new Promise((W,Z)=>{I5.SocksClient.createConnection(q,(G,A)=>{if(G)Z(G);else{if(!A)Z(new Error("No socket info received!"));if(u!=="")A?.socket.write(Y.encode(`${u} ${D}\r
|
|
208
|
-
`));else A?.socket.write(Y.encode(`${D}\r
|
|
209
|
-
`));A?.socket.on("data",(z)=>{W(E.decode(z))}),A?.socket.resume()}})})}async function n3(D,u=!1,F=null){let C,$=43,w="",E,Y="utf-8";if(!F)C=h5(D),E=null;else C=F.tld?F.tld:h5(D),Y=F.encoding?F.encoding:"utf-8",E=F.proxy?F.proxy:null,w=F.server?F.server:"",$=F.serverPort?F.serverPort:43;if(w===""){let Z=zG(C);if(!Z){if(Iu.debug(`No WhoIs server found for TLD: ${C}! Attempting IANA WhoIs database for server!`),Z=await GG(C),!Z)return Iu.debug("WhoIs server could not be found!"),{_raw:"",parsedData:null};Iu.debug(`WhoIs sever found for ${C}: ${w}`)}w=Z}let W=AG(w)||"";try{Iu.debug(`Attempting WHOIS lookup for ${D} on server ${w}`);let Z=await QG(D,W,w,$,Y,E);if(Iu.debug("Raw WHOIS data received:",Z),!u){let A=V8.parseData(Z,null);return{_raw:Z,parsedData:A}}let G=null;if(F?.parseData)G=x3(F.parseData);try{let A=V8.parseData(Z,G);return{_raw:Z,parsedData:A}}catch(A){return console.error("Error in parsing WhoIs data!",A),{_raw:Z,parsedData:null}}}catch(Z){return Iu.debug(`Error in WHOIS lookup for ${D} on server ${w}`,Z),{_raw:"",parsedData:null}}}function oy(D,u=null){return Iu.debug(`Lookup called for ${D}`),n3(D,!0,u)}async function sy(D,u=!1,F=1,C=!1,$=null){let w=[];if(u){if(F>D.length)F=D.length;for(let E=0;E<D.length;E+=F){let Y=D.slice(E,E+F);w=await Promise.all(Y.map(async(q)=>{return await n3(q,C,$)}))}}else for(let E=0;E<D.length;E++){let Y=await n3(D[E],C,$);w.push(Y)}return w}var export_SocksClient=HG.SocksClient;export{n3 as whois,QG as tcpWhois,oy as lookup,zG as getWhoIsServer,h5 as getTLD,AG as getParameters,GG as findWhoIsServer,sy as batchWhois,V8 as WhoIsParser,export_SocksClient as SocksClient,c3 as SERVERS,N5 as ProxyType,L5 as PARAMETERS,V5 as IANA_CHK_URL};
|
|
2
|
+
import E from"net";import{log as q}from"@stacksjs/logging";var Y="https://www.iana.org/whois?q=",Z={"whois.denic.de":"-T dn,ace","whois.nic.fr":"-V Md5.2"},K={"br.com":"whois.centralnic.net","cn.com":"whois.centralnic.net","de.com":"whois.centralnic.net","eu.com":"whois.centralnic.net","gb.com":"whois.centralnic.net","gb.net":"whois.centralnic.net","gr.com":"whois.centralnic.net","hu.com":"whois.centralnic.net","in.net":"whois.centralnic.net","no.com":"whois.centralnic.net","qc.com":"whois.centralnic.net","ru.com":"whois.centralnic.net","sa.com":"whois.centralnic.net","se.com":"whois.centralnic.net","se.net":"whois.centralnic.net","uk.com":"whois.centralnic.net","uk.net":"whois.centralnic.net","us.com":"whois.centralnic.net","uy.com":"whois.centralnic.net","za.com":"whois.centralnic.net","jpn.com":"whois.centralnic.ne","web.com":"whois.centralnic.ne",com:"whois.verisign-grs.com","za.net":"whois.za.net",net:"whois.verisign-grs.com","eu.org":"whois.eu.org","za.org":"whois.za.org",org:"whois.pir.org","llyw.cymru":"whois.nic.llyw.cymru","gov.scot":"whois.nic.gov.scot","gov.wales":"whois.nic.gov.wales",edu:"whois.educause.edu",gov:"whois.dotgov.gov",int:"whois.iana.org","e164.arpa":"whois.ripe.net",arpa:"whois.iana.org",aero:"whois.aero",asia:"whois.nic.asia",biz:"whois.nic.biz",cat:"whois.nic.cat",coop:"whois.nic.coop",info:"whois.afilias.net",jobs:"whois.nic.jobs",mobi:"whois.afilias.net",museum:"whois.nic.museum",name:"whois.nic.name",post:"whois.dotpostregistry.net",pro:"whois.nic.pro",tel:"whois.nic.tel",travel:"whois.nic.travel",xxx:"whois.nic.xxx",ac:"whois.nic.ac",ae:"whois.aeda.net.ae",af:"whois.nic.af",ag:"whois.nic.ag",ai:"whois.nic.ai",am:"whois.amnic.net",ar:"whois.nic.ar",as:"whois.nic.as","priv.at":"whois.nic.priv.at",at:"whois.nic.at",au:"whois.auda.org.au",aw:"whois.nic.aw",ax:"whois.ax",be:"whois.dns.be",bf:"whois.registre.bf",bg:"whois.register.bg",bh:"whois.nic.bh",bi:"whois1.nic.bi",bj:"whois.nic.bj",bm:"whois.afilias-srs.net",bn:"whois.bnnic.bn",bo:"whois.nic.bo",br:"whois.registro.br",by:"whois.cctld.by",bw:"whois.nic.net.bw",bz:"whois.afilias-grs.info","co.ca":"whois.co.ca",ca:"whois.cira.ca",cc:"ccwhois.verisign-grs.com",cd:"whois.nic.cd",ch:"whois.nic.ch",ci:"whois.nic.ci",cl:"whois.nic.cl",cm:"whois.netcom.cm","edu.cn":"whois.edu.cn",cn:"whois.cnnic.cn","uk.co":"whois.uk.co",co:"whois.nic.co",cr:"whois.nic.cr",cx:"whois.nic.cx",cz:"whois.nic.cz",de:"whois.denic.de",dk:"whois.dk-hostmaster.dk",dm:"whois.dmdomains.dm",do:"whois.nic.do",dz:"whois.nic.dz",ec:"whois.nic.ec",ee:"whois.tld.ee",eu:"whois.eu",fi:"whois.fi",fj:"www.whois.fj",fm:"whois.nic.fm",fo:"whois.nic.fo",fr:"whois.nic.fr",gd:"whois.nic.gd",ge:"whois.nic.ge",gf:"whois.mediaserv.net",gg:"whois.gg",gh:"whois.nic.gh",gi:"whois2.afilias-grs.net",gl:"whois.nic.gl",gp:"whois.nic.gp",gq:"whois.dominio.gq",gs:"whois.nic.gs",gy:"whois.registry.gy",hk:"whois.hkirc.hk",hm:"whois.registry.hm",hn:"whois.nic.hn",hr:"whois.dns.hr",ht:"whois.nic.ht",hu:"whois.nic.hu",id:"whois.id",ie:"whois.weare.ie",il:"whois.isoc.org.il",im:"whois.nic.im",in:"whois.registry.in",io:"whois.nic.io",iq:"whois.cmc.iq",ir:"whois.nic.ir",is:"whois.isnic.is",it:"whois.nic.it",je:"whois.je",jp:"whois.jprs.jp",ke:"whois.kenic.or.ke",kg:"whois.kg",ki:"whois.nic.ki",kn:"whois.nic.kn",kr:"whois.kr",kw:"whois.nic.kw",ky:"whois.kyregistry.ky",kz:"whois.nic.kz",la:"whois.nic.la",lb:"whois.lbdr.org.lb",lc:"whois2.afilias-grs.net",li:"whois.nic.li",lk:"whois.nic.lk",ls:"whois.nic.ls",lt:"whois.domreg.lt",lu:"whois.dns.lu",lv:"whois.nic.lv",ly:"whois.nic.ly",ma:"whois.registre.ma",md:"whois.nic.md",me:"whois.nic.me",mg:"whois.nic.mg",mk:"whois.marnet.mk",ml:"whois.dot.ml",mm:"whois.registry.gov.mm",mn:"whois.nic.mn",mq:"whois.mediaserv.net",mr:"whois.nic.mr",ms:"whois.nic.ms",mt:"whois.nic.org.mt",mu:"whois.nic.mu",mw:"whois.nic.mw",mx:"whois.mx",my:"whois.mynic.my",mz:"whois.nic.mz",na:"whois.na-nic.com.na",nc:"whois.nc",nf:"whois.nic.nf",ng:"whois.nic.net.ng",nl:"whois.domain-registry.nl",no:"whois.norid.no",nu:"whois.iis.nu",nz:"whois.irs.net.nz",om:"whois.registry.om",pe:"kero.yachay.pe",pf:"whois.registry.pf",pk:"whois.pknic.net.pk","co.pl":"whois.co.pl",pl:"whois.dns.pl",pm:"whois.nic.pm",pr:"whois.afilias-srs.net",ps:"whois.pnina.ps",pt:"whois.dns.pt",pw:"whois.nic.pw",qa:"whois.registry.qa",re:"whois.nic.re",ro:"whois.rotld.ro",rs:"whois.rnids.rs","ac.ru":"whois.free.net","edu.ru":"whois.informika.ru","com.ru":"whois.flexireg.net","msk.ru":"whois.flexireg.net","net.ru":"whois.nic.net.ru","nov.ru":"whois.flexireg.net","org.ru":"whois.nic.net.ru","pp.ru":"whois.nic.net.ru","spb.ru":"whois.flexireg.net",ru:"whois.tcinet.ru",rw:"whois.ricta.org.rw",sa:"whois.nic.net.sa",sb:"whois.nic.net.sb",sc:"whois2.afilias-grs.net",sd:"whois.sdnic.sd",se:"whois.iis.se",sg:"whois.sgnic.sg",sh:"whois.nic.sh",si:"whois.register.si",sk:"whois.sk-nic.sk",sl:"whois.nic.sl",sm:"whois.nic.sm",sn:"whois.nic.sn",so:"whois.nic.so",ss:"whois.nic.ss",st:"whois.nic.st","msk.su":"whois.flexireg.net","nov.su":"whois.flexireg.net","spb.su":"whois.flexireg.net",su:"whois.tcinet.ru",sx:"whois.sx",sy:"whois.tld.sy",tc:"whois.nic.tc",td:"whois.nic.td",tf:"whois.nic.tf",tg:"whois.nic.tg",th:"whois.thnic.co.th",tk:"whois.dot.tk",tl:"whois.nic.tl",tm:"whois.nic.tm",tn:"whois.ati.tn",to:"whois.tonic.to",tr:"whois.trabis.gov.tr",tv:"whois.nic.tv",tw:"whois.twnic.net.tw",tz:"whois.tznic.or.tz","biz.ua":"whois.biz.ua","co.ua":"whois.co.ua","pp.ua":"whois.pp.ua",ua:"whois.ua",ug:"whois.co.ug","ac.uk":"whois.nic.ac.uk","gov.uk":"whois.gov.uk",uk:"whois.nic.uk","fed.us":"whois.nic.gov",us:"whois.nic.us",uy:"whois.nic.org.uy",uz:"whois.cctld.uz",vc:"whois2.afilias-grs.net",ve:"whois.nic.ve",vg:"whois.nic.vg",vu:"whois.dnrs.vu",wf:"whois.nic.wf",ws:"whois.website.ws",yt:"whois.nic.yt","ac.za":"whois.ac.za","co.za":"whois.registry.net.za","gov.za":"whois.gov.za","net.za":"net-whois.registry.net.za","org.za":"org-whois.registry.net.za","web.za":"web-whois.registry.net.za",zm:"whois.zicta.zm","xn--2scrj9c":"whois.registry.in","xn--3e0b707e":"whois.kr","xn--3hcrj9c":"whois.registry.in","xn--45br5cyl":"whois.registry.in","xn--45brj9c":"whois.registry.in","xn--4dbrk0ce":"whois.isoc.org.il","xn--80ao21a":"whois.nic.kz","xn--90a3ac":"whois.rnids.rs","xn--90ae":"whois.imena.bg","xn--90ais":"whois.cctld.by","xn--clchc0ea0b2g2a9gcd":"whois.sgnic.sg","xn--d1alf":"whois.marnet.mk","xn--e1a4c":"whois.eu","xn--fiqs8s":"cwhois.cnnic.cn","xn--fiqz9s":"cwhois.cnnic.cn","xn--fpcrj9c3d":"whois.registry.in","xn--fzc2c9e2c":"whois.nic.lk","xn--gecrj9c":"whois.registry.in","xn--h2breg3eve":"whois.registry.in","xn--h2brj9c8c":"whois.registry.in","xn--h2brj9c":"whois.registry.in","xn--j1amh":"whois.dotukr.com","xn--j6w193g":"whois.hkirc.hk","xn--kprw13d":"whois.twnic.net.tw","xn--kpry57d":"whois.twnic.net.tw","xn--lgbbat1ad8j":"whois.nic.dz","xn--mgb9awbf":"whois.registry.om","xn--mgba3a4f16a":"whois.nic.ir","xn--mgbaam7a8h":"whois.aeda.net.ae","xn--mgbah1a3hjkrd":"whois.nic.mr","xn--mgbbh1a71e":"whois.registry.in","xn--mgbbh1a":"whois.registry.in","xn--mgberp4a5d4ar":"whois.nic.net.sa","xn--mgbgu82a":"whois.registry.in","xn--mgbtx2b":"whois.cmc.iq","xn--mgbx4cd0ab":"whois.mynic.my","xn--node":"whois.itdc.ge","xn--o3cw4h":"whois.thnic.co.th","xn--ogbpf8fl":"whois.tld.sy","xn--p1ai":"whois.tcinet.ru","xn--pgbs0dh":"whois.ati.tn","xn--q7ce6a":"whois.nic.la","xn--qxa6a":"whois.eu","xn--rvc1e0am3e":"whois.registry.in","xn--s9brj9c":"whois.registry.in","xn--wgbh1c":"whois.dotmasr.eg","xn--wgbl6a":"whois.registry.qa","xn--xkc2al3hye2a":"whois.nic.lk","xn--xkc2dl3a5ee0h":"whois.registry.in","xn--y9a3aq":"whois.amnic.net","xn--yfro4i67o":"whois.sgnic.sg","xn--ygbi2ammx":"whois.pnina.ps"};import U from"net";class G{options;constructor(i){this.options=i}static createConnection(i,h){new G(i).connect(h)}connect(i){let h=new U.Socket,{proxy:w,destination:n}=this.options;h.connect({port:w.port,host:w.host},()=>{if(w.type===5)this.connectSocks5(h,i);else this.connectSocks4(h,i)}),h.on("error",(g)=>{i(g)})}connectSocks4(i,h){let{destination:w,proxy:n}=this.options,g=w.port,c=n.userId||"",s;if(this.isIPv4(w.host)){let m=w.host.split(".").map(Number);s=Buffer.from(m)}else s=Buffer.from([0,0,0,1]);let o=Buffer.concat([Buffer.from([4]),Buffer.from([1]),Buffer.from([g>>8&255,g&255]),s,Buffer.from(c),Buffer.from([0])]);if(!this.isIPv4(w.host)){let m=Buffer.concat([o,Buffer.from(w.host),Buffer.from([0])]);i.write(m)}else i.write(o);i.once("data",(m)=>{if(m.length<8){h(Error("Invalid SOCKS4 response"));return}let x=m[1];if(x!==90){h(Error(`SOCKS4 connection failed with status: ${x}`));return}h(null,{socket:i})})}connectSocks5(i,h){let{destination:w,proxy:n}=this.options,g;if(n.userId&&n.password)g=[0,2];else g=[0];let c=Buffer.from([5,g.length,...g]);i.write(c),i.once("data",(s)=>{if(s.length<2||s[0]!==5){h(Error("Invalid SOCKS5 greeting response"));return}let o=s[1];if(o===255){h(Error("No acceptable authentication methods"));return}if(o===2)this.authenticateSocks5(i,h);else this.sendConnectRequest(i,h)})}authenticateSocks5(i,h){let{proxy:w}=this.options,n=w.userId||"",g=w.password||"",c=Buffer.concat([Buffer.from([1]),Buffer.from([n.length]),Buffer.from(n),Buffer.from([g.length]),Buffer.from(g)]);i.write(c),i.once("data",(s)=>{if(s.length<2||s[0]!==1){h(Error("Invalid SOCKS5 auth response"));return}if(s[1]!==0){h(Error("SOCKS5 authentication failed"));return}this.sendConnectRequest(i,h)})}sendConnectRequest(i,h){let{destination:w}=this.options,n=w.port,g,c;if(this.isIPv4(w.host)){c=1;let o=w.host.split(".").map(Number);g=Buffer.from(o)}else if(this.isIPv6(w.host)){c=4;let o=w.host.split(":"),m=[];for(let x of o){let z=Number.parseInt(x,16);m.push(z>>8&255,z&255)}g=Buffer.from(m)}else c=3,g=Buffer.concat([Buffer.from([w.host.length]),Buffer.from(w.host)]);let s=Buffer.concat([Buffer.from([5,1,0,c]),g,Buffer.from([n>>8&255,n&255])]);i.write(s),i.once("data",(o)=>{if(o.length<10||o[0]!==5){h(Error("Invalid SOCKS5 connect response"));return}let m=o[1];if(m!==0){let z=m===void 0?"No SOCKS5 status returned":{1:"General SOCKS server failure",2:"Connection not allowed by ruleset",3:"Network unreachable",4:"Host unreachable",5:"Connection refused",6:"TTL expired",7:"Command not supported",8:"Address type not supported"}[m]||`Unknown error (${m})`;h(Error(`SOCKS5 connection failed: ${z}`));return}h(null,{socket:i})})}isIPv4(i){if(!/^(\d{1,3}\.){3}\d{1,3}$/.test(i))return!1;return i.split(".").map(Number).every((n)=>n>=0&&n<=255)}isIPv6(i){return i.includes(":")&&i.split(":").length>=3}}var _;((w)=>{w[w.SOCKS4=0]="SOCKS4";w[w.SOCKS5=1]="SOCKS5"})(_||={});function Q(i){if(Array.isArray(i))return i.slice();if(typeof i==="object"&&i!==null){let h={};for(let w in i)if(Object.prototype.hasOwnProperty.call(i,w))h[w]=Q(i[w]);return h}return i}async function A(i){let h=Y+i;try{let w=await fetch(h);if(w.ok){let g=(await w.text()).match(/whois:\s+(\S+)/);if(g?.[1])return g[1]}}catch(w){console.error("Error in getting WhoIs server data from IANA",w)}return""}function N(i){if(i==="com")return"whois.verisign-grs.com";return K[i]}function $(i){let h=i.split(".");for(let w=h.length-1;w>0;w--){let n=h.slice(w).join(".");if(K[n])return n}return h[h.length-1]}function y(i){return Z[i]}class J{static iterParse(i,h){let w="",n=null,g="";for(let c=0;c<i.length;c++){let s=i[c];if(s===`
|
|
3
|
+
`||g===":"&&s===" "){if(w.trim()in h)n=w.trim();else if(n!==null){let o=w.trim();if(o!==""){let m=h[n];if(Array.isArray(m))m.push(o);else h[n]=o;n=null}}w=""}else if(s!==":")w=w+s;if(g=s,w==="Record maintained by"||w===">>>")break}return h}static parseData(i,h){if(!h)h={"Domain Name":"","Creation Date":"","Updated Date":"","Registry Expiry Date":"","Domain Status":[],Registrar:""};return h=J.iterParse(i,h),h}}async function R(i,h,w,n,g,c){let s=new TextDecoder(g),o=new TextEncoder;if(!c){let x=new E.Socket;return x.setTimeout(30000),new Promise((z,f)=>{try{x.connect({port:n,host:w},()=>{if(h!=="")x.write(o.encode(`${h} ${i}\r
|
|
4
|
+
`));else x.write(o.encode(`${i}\r
|
|
5
|
+
`))}),x.on("data",(b)=>{z(s.decode(b))}),x.on("error",(b)=>{f(b)}),x.on("timeout",()=>{x.destroy(),f(Error(`WHOIS request to ${w}:${n} timed out after 30s`))})}catch(b){f(b)}})}let m={proxy:{host:c.ip,port:c.port,type:c.type===1?5:4},command:"connect",destination:{host:w,port:n}};if(c.username&&c.password)m.proxy.userId=c.username,m.proxy.password=c.password;return new Promise((x,z)=>{G.createConnection(m,(f,b)=>{if(f)z(f);else{if(!b)z(Error("No socket info received!"));if(h!=="")b?.socket.write(o.encode(`${h} ${i}\r
|
|
6
|
+
`));else b?.socket.write(o.encode(`${i}\r
|
|
7
|
+
`));b?.socket.on("data",(H)=>{x(s.decode(H))}),b?.socket.resume()}})})}async function X(i,h=!1,w=null){let n,g=43,c="",s,o="utf-8";if(!w)n=$(i),s=null;else n=w.tld?w.tld:$(i),o=w.encoding?w.encoding:"utf-8",s=w.proxy?w.proxy:null,c=w.server?w.server:"",g=w.serverPort?w.serverPort:43;if(c===""){let z=N(n);if(!z){if(q.debug(`No WhoIs server found for TLD: ${n}! Attempting IANA WhoIs database for server!`),z=await A(n),!z)return q.debug("WhoIs server could not be found!"),{_raw:"",parsedData:null};q.debug(`WhoIs sever found for ${n}: ${c}`)}c=z}let x=y(c)||"";try{q.debug(`Attempting WHOIS lookup for ${i} on server ${c}`);let z=await R(i,x,c,g,o,s);if(q.debug("Raw WHOIS data received:",z),!h){let b=J.parseData(z,null);return{_raw:z,parsedData:b}}let f=null;if(w?.parseData)f=Q(w.parseData);try{let b=J.parseData(z,f);return{_raw:z,parsedData:b}}catch(b){return console.error("Error in parsing WhoIs data!",b),{_raw:z,parsedData:null}}}catch(z){return q.debug(`Error in WHOIS lookup for ${i} on server ${c}`,z),{_raw:"",parsedData:null}}}function T(i,h=null){return q.debug(`Lookup called for ${i}`),X(i,!0,h)}async function W(i,h=!1,w=1,n=!1,g=null){let c=[];if(h){if(w>i.length)w=i.length;for(let s=0;s<i.length;s+=w){let o=i.slice(s,s+w),m=await Promise.all(o.map(async(x)=>{return await X(x,n,g)}));c.push(...m)}}else for(let s=0;s<i.length;s++){let o=await X(i[s],n,g);c.push(o)}return c}export{X as whois,R as tcpWhois,T as lookup,N as getWhoIsServer,$ as getTLD,y as getParameters,A as findWhoIsServer,W as batchWhois,J as WhoIsParser,G as SocksClient,K as SERVERS,_ as ProxyType,Z as PARAMETERS,Y as IANA_CHK_URL};
|