(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[172],{17:e=>{"use strict";e.exports=Object},552:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(r(79922)),o=i(r(9219));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){(0,n.default)(e);var r=t?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,o.default)(e,r)}e.exports=t.default,e.exports.default=t.default},1156:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={defaultEasing:function(e){return e<.5?Math.pow(2*e,2)/2:1-Math.pow((1-e)*2,2)/2},linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}}},1367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var n=i(r(79922)),o=i(r(29203));function i(e){return e&&e.__esModule?e:{default:e}}var a=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,s=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,l=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,u=/^\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,c={checkDMS:!1};function d(e,t){if((0,n.default)(e),t=(0,o.default)(t,c),!e.includes(","))return!1;var r=e.split(",");return!(r[0].startsWith("(")&&!r[1].endsWith(")")||r[1].endsWith(")")&&!r[0].startsWith("("))&&(t.checkDMS?l.test(r[0])&&u.test(r[1]):a.test(r[0])&&s.test(r[1]))}e.exports=t.default,e.exports.default=t.default},1956:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t{"use strict";function n(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}r.d(t,{A:()=>n})},2068:(e,t,r)=>{"use strict";var n=r(16638);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},2166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if((0,n.default)(e),t){var r=RegExp("[".concat(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+$"),"g");return e.replace(r,"")}for(var o=e.length-1;/\s/.test(e.charAt(o));)o-=1;return e.slice(0,o+1)}e.exports=t.default,e.exports.default=t.default},2316:(e,t,r)=>{"use strict";let n=r(77721);e.exports=(e,t,r)=>{let o=new n(e,r),i=new n(t,r);return o.compare(i)||o.compareBuild(i)}},3140:(e,t,r)=>{"use strict";var n,o=r(17),i=r(74002),a=r(61924),s=r(44451),l=r(43339),u=r(69497),c=r(72206),d=r(7016),f=r(33923),p=r(91925),h=r(37025),m=r(75739),g=r(41605),y=r(41167),v=r(2068),b=Function,_=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},$=r(27654),w=r(3194),S=function(){throw new c},E=$?function(){try{return arguments.callee,S}catch(e){try{return $(arguments,"callee").get}catch(e){return S}}}():S,x=r(72562)(),A=r(50865),O=r(61429),k=r(92709),I=r(57379),C=r(95185),T={},P="undefined"!=typeof Uint8Array&&A?A(Uint8Array):n,R={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":x&&A?A([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":T,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":x&&A?A(A([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&x&&A?A(new Map()[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":$,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&x&&A?A(new Set()[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":x&&A?A(""[Symbol.iterator]()):n,"%Symbol%":x?Symbol:n,"%SyntaxError%":u,"%ThrowTypeError%":E,"%TypedArray%":P,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":I,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":O,"%Math.abs%":f,"%Math.floor%":p,"%Math.max%":h,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":y,"%Math.sign%":v,"%Reflect.getPrototypeOf%":k};if(A)try{null.error}catch(e){var j=A(A(e));R["%Error.prototype%"]=j}var N=function e(t){var r;if("%AsyncFunction%"===t)r=_("async function () {}");else if("%GeneratorFunction%"===t)r=_("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=_("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&A&&(r=A(o.prototype))}return R[t]=r,r},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},L=r(14274),D=r(98516),B=L.call(C,Array.prototype.concat),F=L.call(I,Array.prototype.splice),U=L.call(C,String.prototype.replace),Z=L.call(C,String.prototype.slice),Y=L.call(C,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,G=function(e){var t=Z(e,0,1),r=Z(e,-1);if("%"===t&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return U(e,H,function(e,t,r,o){n[n.length]=r?U(o,q,"$1"):t||e}),n},W=function(e,t){var r,n=e;if(D(M,n)&&(n="%"+(r=M[n])[0]+"%"),D(R,n)){var o=R[n];if(o===T&&(o=N(n)),void 0===o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new u("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===Y(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=G(e),n=r.length>0?r[0]:"",o=W("%"+n+"%",t),i=o.name,a=o.value,s=!1,l=o.alias;l&&(n=l[0],F(r,B([0,1],l)));for(var d=1,f=!0;d=r.length){var g=$(a,p);a=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[p]}else f=D(a,p),a=a[p];f&&!s&&(R[i]=a)}}return a}},3194:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},3347:(e,t,r)=>{var n,o=r(61769).Buffer,i=r(62701),a=r(59139),s=r(84864),l='"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',u="secret must be a string or buffer",c="key must be a string or a buffer",d="key must be a string, a buffer or an object",f="function"==typeof i.createPublicKey;function p(e){if(!o.isBuffer(e)&&"string"!=typeof e&&(!f||"object"!=typeof e||"string"!=typeof e.type||"string"!=typeof e.asymmetricKeyType||"function"!=typeof e.export))throw v(c)}function h(e){if(!o.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw v(d)}function m(e){if(!o.isBuffer(e)){if("string"==typeof e)return e;if(!f||"object"!=typeof e||"secret"!==e.type||"function"!=typeof e.export)throw v(u)}}function g(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function y(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},3476:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){(0,n.default)(e),"object"===i(t)?(r=t.min||0,o=t.max):(r=arguments[1]||0,o=arguments[2]);var r,o,a=e.match(/(\uFE0F|\uFE0E)/g)||[],s=e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],l=e.length-a.length-s.length;return l>=r&&(void 0===o||l<=o)}e.exports=t.default,e.exports.default=t.default},4140:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4264:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentRect=function(e){if("getBBox"in e){var t=e.getBBox();return Object.freeze({height:t.height,left:0,top:0,width:t.width})}var r=window.getComputedStyle(e);return Object.freeze({height:parseFloat(r.height||"0"),left:parseFloat(r.paddingLeft||"0"),top:parseFloat(r.paddingTop||"0"),width:parseFloat(r.width||"0")})}},4427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^(0x|0h)?[0-9A-F]+$/i;function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},4479:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/[^\x00-\x7F]/;function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},4658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=i(r(79922)),o=i(r(29203));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var s={allow_primitives:!1};function l(e,t){(0,n.default)(e);try{t=(0,o.default)(t,s);var r=[];t.allow_primitives&&(r=[null,!1,!0]);var i=JSON.parse(e);return r.includes(i)||!!i&&"object"===a(i)}catch(e){}return!1}e.exports=t.default,e.exports.default=t.default},5074:(e,t,r)=>{"use strict";let n=/\s+/g;class o{constructor(e,t){if(t=a(t),e instanceof o)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new o(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!y(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&m)|(this.options.loose&&g))+":"+e,r=i.get(t);if(r)return r;let n=this.options.loose,o=n?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];l("hyphen replace",e=e.replace(o,C(this.options.includePrerelease))),l("comparator trim",e=e.replace(c[d.COMPARATORTRIM],f)),l("tilde trim",e=e.replace(c[d.TILDETRIM],p)),l("caret trim",e=e.replace(c[d.CARETTRIM],h));let a=e.split(" ").map(e=>_(e,this.options)).join(" ").split(/\s+/).map(e=>I(e,this.options));n&&(a=a.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(c[d.COMPARATORLOOSE])))),l("range list",a);let u=new Map;for(let e of a.map(e=>new s(e,this.options))){if(y(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");let v=[...u.values()];return i.set(t,v),v}intersects(e,t){if(!(e instanceof o))throw TypeError("a Range is required");return this.set.some(r=>b(r,t)&&e.set.some(e=>b(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,v=e=>""===e.value,b=(e,t)=>{let r=!0,n=e.slice(),o=n.pop();for(;r&&n.length;)r=n.every(e=>o.intersects(e,t)),o=n.pop();return r},_=(e,t)=>(l("comp",e,t),l("caret",e=E(e,t)),l("tildes",e=w(e,t)),l("xrange",e=A(e,t)),l("stars",e=k(e,t)),e),$=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(" "),S=(e,t)=>{let r=t.loose?c[d.TILDELOOSE]:c[d.TILDE];return e.replace(r,(t,r,n,o,i)=>{let a;return l("tilde",e,t,r,n,o,i),$(r)?a="":$(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:$(o)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:i?(l("replaceTilde pr",i),a=`>=${r}.${n}.${o}-${i} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${o} <${r}.${+n+1}.0-0`,l("tilde return",a),a})},E=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(" "),x=(e,t)=>{l("caret",e,t);let r=t.loose?c[d.CARETLOOSE]:c[d.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,o,i,a)=>{let s;return l("caret",e,t,r,o,i,a),$(r)?s="":$(o)?s=`>=${r}.0.0${n} <${+r+1}.0.0-0`:$(i)?s="0"===r?`>=${r}.${o}.0${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.0${n} <${+r+1}.0.0-0`:a?(l("replaceCaret pr",a),s="0"===r?"0"===o?`>=${r}.${o}.${i}-${a} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i}-${a} <${+r+1}.0.0-0`):(l("no pr"),s="0"===r?"0"===o?`>=${r}.${o}.${i}${n} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i} <${+r+1}.0.0-0`),l("caret return",s),s})},A=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>O(e,t)).join(" ")),O=(e,t)=>{e=e.trim();let r=t.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return e.replace(r,(r,n,o,i,a,s)=>{l("xRange",e,r,n,o,i,a,s);let u=$(o),c=u||$(i),d=c||$(a),f=d;return"="===n&&f&&(n=""),s=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(c&&(i=0),a=0,">"===n?(n=">=",c?(o=+o+1,i=0):i=+i+1,a=0):"<="===n&&(n="<",c?o=+o+1:i=+i+1),"<"===n&&(s="-0"),r=`${n+o}.${i}.${a}${s}`):c?r=`>=${o}.0.0${s} <${+o+1}.0.0-0`:d&&(r=`>=${o}.${i}.0${s} <${o}.${+i+1}.0-0`),l("xRange return",r),r})},k=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[d.STAR],"")),I=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),C=e=>(t,r,n,o,i,a,s,l,u,c,d,f)=>(r=$(n)?"":$(o)?`>=${n}.0.0${e?"-0":""}`:$(i)?`>=${n}.${o}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`,l=$(u)?"":$(c)?`<${+u+1}.0.0-0`:$(d)?`<${u}.${+c+1}.0-0`:f?`<=${u}.${c}.${d}-${f}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`,`${r} ${l}`.trim()),T=(e,t,r)=>{for(let r=0;r0){let n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},5440:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=r(55729).createContext(null)},5464:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i={loose:!1},a=["true","false","1","0"],s=[].concat(a,["yes","no"]);function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return((0,n.default)(e),t.loose)?s.includes(e.toLowerCase()):a.includes(e)}e.exports=t.default,e.exports.default=t.default},6385:module=>{var __dirname="/";!function(){var __webpack_modules__={950:function(__unused_webpack_module,exports){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r{"use strict";let n;r.d(t,{qt:()=>ew,tm:()=>to,Sj:()=>h,Ml:()=>W,n:()=>J,Lr:()=>U,WF:()=>Z,eN:()=>eS,hw:()=>e_,aP:()=>Y,Xi:()=>eb,jv:()=>er,k1:()=>eg,Vb:()=>ep,kY:()=>i,CZ:()=>eu,Jv:()=>eo,Ih:()=>ec,DN:()=>ed,Ut:()=>es,Tq:()=>e$,WM:()=>eh,iS:()=>V,PQ:()=>G,l1:()=>ev,rS:()=>F,bv:()=>Q,Ii:()=>ey,_c:()=>eE,$i:()=>em,EV:()=>ex,b8:()=>ea,lK:()=>h,Kz:()=>el,ND:()=>D,K5:()=>H,BG:()=>eg,y0:()=>ei,aR:()=>h,_Z:()=>q,fZ:()=>ee,_:()=>K,a0:()=>z,bz:()=>eB,YO:()=>eY,o:()=>eR,zM:()=>ej,au:()=>tn,Ie:()=>eO,p6:()=>eN,fm:()=>j,gM:()=>eW,QZ:()=>e4,k5:()=>e2,fH:()=>eQ,Nl:()=>eI,E$:()=>eK,fn:()=>ek,RZ:()=>e0,eu:()=>e1,Tj:()=>eJ,oi:()=>eP,fc:()=>e3,Zm:()=>eU,ch:()=>eD,me:()=>e6,ai:()=>eT,Ik:()=>eH,yN:()=>tr,p7:()=>tt,lq:()=>e8,Di:()=>te,Tk:()=>e7,vk:()=>e5,iv:()=>e9,g1:()=>ez,hZ:()=>eX,re:()=>eq,Yj:()=>eC,HR:()=>eM,Gu:()=>e4,PV:()=>eV,Vx:()=>eL,KC:()=>eG,L5:()=>eF,rI:()=>eZ});var o,i,a=r(64892),s=r(78974),l=r(19086);!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(o||(o={}));var u=r(8722),c=r(45859);class d{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let f=(e,t)=>{if((0,u.fn)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new a.G(e.common.issues);return this._error=t,this._error}}};function p(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:o}:{errorMap:(t,o)=>{let{message:i}=e;return"invalid_enum_value"===t.code?{message:i??o.defaultError}:void 0===o.data?{message:i??n??o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:i??r??o.defaultError}},description:o}}class h{get description(){return this._def.description}_getType(e){return(0,c.CR)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,c.CR)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new u.MY,ctx:{common:e.parent.common,data:e.data,parsedType:(0,c.CR)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if((0,u.xP)(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.CR)(e)},n=this._parseSync({data:e,path:r.path,parent:r});return f(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.CR)(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return(0,u.fn)(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>(0,u.fn)(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.CR)(e)},n=this._parse({data:e,path:r.path,parent:r});return f(r,await ((0,u.xP)(n)?n:Promise.resolve(n)))}refine(e,t){let r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{let o=e(t),i=()=>n.addIssue({code:a.eq.custom,...r(t)});return"undefined"!=typeof Promise&&o instanceof Promise?o.then(e=>!!e||(i(),!1)):!!o||(i(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new eg({schema:this,typeName:i.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ey.create(this,this._def)}nullable(){return ev.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return J.create(this)}promise(){return em.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return eo.create(this,e,this._def)}transform(e){return new eg({...p(this._def),schema:this,typeName:i.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t="function"==typeof e?e:()=>e;return new eb({...p(this._def),innerType:this,defaultValue:t,typeName:i.ZodDefault})}brand(){return new eS({typeName:i.ZodBranded,type:this,...p(this._def)})}catch(e){let t="function"==typeof e?e:()=>e;return new e_({...p(this._def),innerType:this,catchValue:t,typeName:i.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eE.create(this,e)}readonly(){return ex.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let m=/^c[^\s-]{8,}$/i,g=/^[0-9a-z]+$/,y=/^[0-9A-HJKMNP-TV-Z]{26}$/i,v=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,b=/^[a-z0-9_-]{21}$/i,_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,w=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,S="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",E=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,x=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,A=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,O=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,k=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,I=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,C="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",T=RegExp(`^${C}$`);function P(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function R(e){return RegExp(`^${P(e)}$`)}function j(e){let t=`${C}T${P(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)}function N(e,t){return!!(("v4"===t||!t)&&E.test(e)||("v6"===t||!t)&&A.test(e))}function M(e,t){if(!_.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));if("object"!=typeof o||null===o||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)return!1;return!0}catch{return!1}}function L(e,t){return!!(("v4"===t||!t)&&x.test(e)||("v6"===t||!t)&&O.test(e))}class D extends h{_parse(e){let t;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.Zp.string){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.string,received:t.parsedType}),u.uY}let r=new u.MY;for(let o of this._def.checks)if("min"===o.kind)e.data.lengtho.value&&(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:a.eq.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if("length"===o.kind){let n=e.data.length>o.value,i=e.data.lengthe.test(t),{validation:t,code:a.eq.invalid_string,...o.errToObj(r)})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...o.errToObj(e)})}url(e){return this._addCheck({kind:"url",...o.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...o.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...o.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...o.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...o.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...o.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...o.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...o.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...o.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...o.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...o.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...o.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...o.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...o.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...o.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...o.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...o.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...o.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...o.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...o.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...o.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...o.errToObj(t)})}nonempty(e){return this.min(1,o.errToObj(e))}trim(){return new D({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?r:n;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}D.create=e=>new D({checks:[],typeName:i.ZodString,coerce:e?.coerce??!1,...p(e)});class F extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==c.Zp.number){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.number,received:t.parsedType}),u.uY}let r=new u.MY;for(let n of this._def.checks)"int"===n.kind?c.ZS.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:a.eq.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:a.eq.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==B(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:a.eq.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:a.eq.not_finite,message:n.message}),r.dirty()):c.ZS.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,o.toString(t))}gt(e,t){return this.setLimit("min",e,!1,o.toString(t))}lte(e,t){return this.setLimit("max",e,!0,o.toString(t))}lt(e,t){return this.setLimit("max",e,!1,o.toString(t))}setLimit(e,t,r,n){return new F({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:o.toString(n)}]})}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:o.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:o.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:o.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:o.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:o.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:o.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:o.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:o.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:o.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&c.ZS.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew F({checks:[],typeName:i.ZodNumber,coerce:e?.coerce||!1,...p(e)});class U extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==c.Zp.bigint)return this._getInvalidInput(e);let r=new u.MY;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:a.eq.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:a.eq.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):c.ZS.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.bigint,received:t.parsedType}),u.uY}gte(e,t){return this.setLimit("min",e,!0,o.toString(t))}gt(e,t){return this.setLimit("min",e,!1,o.toString(t))}lte(e,t){return this.setLimit("max",e,!0,o.toString(t))}lt(e,t){return this.setLimit("max",e,!1,o.toString(t))}setLimit(e,t,r,n){return new U({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:o.toString(n)}]})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:o.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:o.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:o.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:o.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:o.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew U({checks:[],typeName:i.ZodBigInt,coerce:e?.coerce??!1,...p(e)});class Z extends h{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==c.Zp.boolean){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.boolean,received:t.parsedType}),u.uY}return(0,u.OK)(e.data)}}Z.create=e=>new Z({typeName:i.ZodBoolean,coerce:e?.coerce||!1,...p(e)});class Y extends h{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.Zp.date){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.date,received:t.parsedType}),u.uY}if(Number.isNaN(e.data.getTime())){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_date}),u.uY}let r=new u.MY;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:a.eq.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):c.ZS.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:o.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:o.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew Y({checks:[],coerce:e?.coerce||!1,typeName:i.ZodDate,...p(e)});class H extends h{_parse(e){if(this._getType(e)!==c.Zp.symbol){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.symbol,received:t.parsedType}),u.uY}return(0,u.OK)(e.data)}}H.create=e=>new H({typeName:i.ZodSymbol,...p(e)});class q extends h{_parse(e){if(this._getType(e)!==c.Zp.undefined){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.undefined,received:t.parsedType}),u.uY}return(0,u.OK)(e.data)}}q.create=e=>new q({typeName:i.ZodUndefined,...p(e)});class G extends h{_parse(e){if(this._getType(e)!==c.Zp.null){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.null,received:t.parsedType}),u.uY}return(0,u.OK)(e.data)}}G.create=e=>new G({typeName:i.ZodNull,...p(e)});class W extends h{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,u.OK)(e.data)}}W.create=e=>new W({typeName:i.ZodAny,...p(e)});class K extends h{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,u.OK)(e.data)}}K.create=e=>new K({typeName:i.ZodUnknown,...p(e)});class V extends h{_parse(e){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.never,received:t.parsedType}),u.uY}}V.create=e=>new V({typeName:i.ZodNever,...p(e)});class z extends h{_parse(e){if(this._getType(e)!==c.Zp.undefined){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.void,received:t.parsedType}),u.uY}return(0,u.OK)(e.data)}}z.create=e=>new z({typeName:i.ZodVoid,...p(e)});class J extends h{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==c.Zp.array)return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.array,received:t.parsedType}),u.uY;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&((0,u.zn)(t,{code:a.eq.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new d(t,e,t.path,r)))).then(e=>u.MY.mergeArray(r,e));let o=[...t.data].map((e,r)=>n.type._parseSync(new d(t,e,t.path,r)));return u.MY.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new J({...this._def,minLength:{value:e,message:o.toString(t)}})}max(e,t){return new J({...this._def,maxLength:{value:e,message:o.toString(t)}})}length(e,t){return new J({...this._def,exactLength:{value:e,message:o.toString(t)}})}nonempty(e){return this.min(1,e)}}function X(e){if(e instanceof Q){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ey.create(X(n))}return new Q({...e._def,shape:()=>t})}if(e instanceof J)return new J({...e._def,type:X(e.element)});if(e instanceof ey)return ey.create(X(e.unwrap()));if(e instanceof ev)return ev.create(X(e.unwrap()));if(e instanceof ei)return ei.create(e.items.map(e=>X(e)));else return e}J.create=(e,t)=>new J({type:e,minLength:null,maxLength:null,exactLength:null,typeName:i.ZodArray,...p(t)});class Q extends h{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=c.ZS.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==c.Zp.object){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.object,received:t.parsedType}),u.uY}let{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof V&&"strip"===this._def.unknownKeys))for(let e in r.data)o.includes(e)||i.push(e);let s=[];for(let e of o){let t=n[e],o=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new d(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof V){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of i)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&((0,u.zn)(r,{code:a.eq.unrecognized_keys,keys:i}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of i){let n=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new d(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>u.MY.mergeObjectSync(t,e)):u.MY.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return o.errToObj,new Q({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:o.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new Q({...this._def,unknownKeys:"strip"})}passthrough(){return new Q({...this._def,unknownKeys:"passthrough"})}extend(e){return new Q({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Q({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:i.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Q({...this._def,catchall:e})}pick(e){let t={};for(let r of c.ZS.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new Q({...this._def,shape:()=>t})}omit(e){let t={};for(let r of c.ZS.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new Q({...this._def,shape:()=>t})}deepPartial(){return X(this)}partial(e){let t={};for(let r of c.ZS.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new Q({...this._def,shape:()=>t})}required(e){let t={};for(let r of c.ZS.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ey;)e=e._def.innerType;t[r]=e}return new Q({...this._def,shape:()=>t})}keyof(){return ef(c.ZS.objectKeys(this.shape))}}Q.create=(e,t)=>new Q({shape:()=>e,unknownKeys:"strip",catchall:V.create(),typeName:i.ZodObject,...p(t)}),Q.strictCreate=(e,t)=>new Q({shape:()=>e,unknownKeys:"strict",catchall:V.create(),typeName:i.ZodObject,...p(t)}),Q.lazycreate=(e,t)=>new Q({shape:e,unknownKeys:"strip",catchall:V.create(),typeName:i.ZodObject,...p(t)});class ee extends h{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new a.G(e.ctx.common.issues));return(0,u.zn)(t,{code:a.eq.invalid_union,unionErrors:r}),u.uY}if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(n);{let e,n=[];for(let o of r){let r={...t,common:{...t.common,issues:[]},parent:null},i=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let o=n.map(e=>new a.G(e));return(0,u.zn)(t,{code:a.eq.invalid_union,unionErrors:o}),u.uY}}get options(){return this._def.options}}ee.create=(e,t)=>new ee({options:e,typeName:i.ZodUnion,...p(t)});let et=e=>{if(e instanceof ec)return et(e.schema);if(e instanceof eg)return et(e.innerType());if(e instanceof ed)return[e.value];if(e instanceof ep)return e.options;if(e instanceof eh)return c.ZS.objectValues(e.enum);else if(e instanceof eb)return et(e._def.innerType);else if(e instanceof q)return[void 0];else if(e instanceof G)return[null];else if(e instanceof ey)return[void 0,...et(e.unwrap())];else if(e instanceof ev)return[null,...et(e.unwrap())];else if(e instanceof eS)return et(e.unwrap());else if(e instanceof ex)return et(e.unwrap());else if(e instanceof e_)return et(e._def.innerType);else return[]};class er extends h{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.Zp.object)return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.object,received:t.parsedType}),u.uY;let r=this.discriminator,n=t.data[r],o=this.optionsMap.get(n);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):((0,u.zn)(t,{code:a.eq.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),u.uY)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let r of t){let t=et(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of t){if(n.has(o))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,r)}}return new er({typeName:i.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...p(r)})}}function en(e,t){let r=(0,c.CR)(e),n=(0,c.CR)(t);if(e===t)return{valid:!0,data:e};if(r===c.Zp.object&&n===c.Zp.object){let r=c.ZS.objectKeys(t),n=c.ZS.objectKeys(e).filter(e=>-1!==r.indexOf(e)),o={...e,...t};for(let r of n){let n=en(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===c.Zp.array&&n===c.Zp.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let n=0;n{if((0,u.G4)(e)||(0,u.G4)(n))return u.uY;let o=en(e.value,n.value);return o.valid?(((0,u.DM)(e)||(0,u.DM)(n))&&t.dirty(),{status:t.value,value:o.data}):((0,u.zn)(r,{code:a.eq.invalid_intersection_types}),u.uY)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}eo.create=(e,t,r)=>new eo({left:e,right:t,typeName:i.ZodIntersection,...p(r)});class ei extends h{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.Zp.array)return(0,u.zn)(r,{code:a.eq.invalid_type,expected:c.Zp.array,received:r.parsedType}),u.uY;if(r.data.lengththis._def.items.length&&((0,u.zn)(r,{code:a.eq.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new d(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>u.MY.mergeArray(t,e)):u.MY.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ei({...this._def,rest:e})}}ei.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ei({items:e,typeName:i.ZodTuple,rest:null,...p(t)})};class ea extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.Zp.object)return(0,u.zn)(r,{code:a.eq.invalid_type,expected:c.Zp.object,received:r.parsedType}),u.uY;let n=[],o=this._def.keyType,i=this._def.valueType;for(let e in r.data)n.push({key:o._parse(new d(r,e,r.path,e)),value:i._parse(new d(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?u.MY.mergeObjectAsync(t,n):u.MY.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new ea(t instanceof h?{keyType:e,valueType:t,typeName:i.ZodRecord,...p(r)}:{keyType:D.create(),valueType:e,typeName:i.ZodRecord,...p(t)})}}class es extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.Zp.map)return(0,u.zn)(r,{code:a.eq.invalid_type,expected:c.Zp.map,received:r.parsedType}),u.uY;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([e,t],i)=>({key:n._parse(new d(r,e,r.path,[i,"key"])),value:o._parse(new d(r,t,r.path,[i,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of i){let n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return u.uY;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of i){let n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return u.uY;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}es.create=(e,t,r)=>new es({valueType:t,keyType:e,typeName:i.ZodMap,...p(r)});class el extends h{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.Zp.set)return(0,u.zn)(r,{code:a.eq.invalid_type,expected:c.Zp.set,received:r.parsedType}),u.uY;let n=this._def;null!==n.minSize&&r.data.sizen.maxSize.value&&((0,u.zn)(r,{code:a.eq.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let o=this._def.valueType;function i(e){let r=new Set;for(let n of e){if("aborted"===n.status)return u.uY;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let s=[...r.data.values()].map((e,t)=>o._parse(new d(r,e,r.path,t)));return r.common.async?Promise.all(s).then(e=>i(e)):i(s)}min(e,t){return new el({...this._def,minSize:{value:e,message:o.toString(t)}})}max(e,t){return new el({...this._def,maxSize:{value:e,message:o.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}el.create=(e,t)=>new el({valueType:e,minSize:null,maxSize:null,typeName:i.ZodSet,...p(t)});class eu extends h{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.Zp.function)return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.function,received:t.parsedType}),u.uY;function r(e,r){return(0,u.y7)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.$W)(),l.A].filter(e=>!!e),issueData:{code:a.eq.invalid_arguments,argumentsError:r}})}function n(e,r){return(0,u.y7)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.$W)(),l.A].filter(e=>!!e),issueData:{code:a.eq.invalid_return_type,returnTypeError:r}})}let o={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof em){let e=this;return(0,u.OK)(async function(...t){let s=new a.G([]),l=await e._def.args.parseAsync(t,o).catch(e=>{throw s.addIssue(r(t,e)),s}),u=await Reflect.apply(i,this,l);return await e._def.returns._def.type.parseAsync(u,o).catch(e=>{throw s.addIssue(n(u,e)),s})})}{let e=this;return(0,u.OK)(function(...t){let s=e._def.args.safeParse(t,o);if(!s.success)throw new a.G([r(t,s.error)]);let l=Reflect.apply(i,this,s.data),u=e._def.returns.safeParse(l,o);if(!u.success)throw new a.G([n(l,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new eu({...this._def,args:ei.create(e).rest(K.create())})}returns(e){return new eu({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new eu({args:e||ei.create([]).rest(K.create()),returns:t||K.create(),typeName:i.ZodFunction,...p(r)})}}class ec extends h{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ec.create=(e,t)=>new ec({getter:e,typeName:i.ZodLazy,...p(t)});class ed extends h{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{received:t.data,code:a.eq.invalid_literal,expected:this._def.value}),u.uY}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ef(e,t){return new ep({values:e,typeName:i.ZodEnum,...p(t)})}ed.create=(e,t)=>new ed({value:e,typeName:i.ZodLiteral,...p(t)});class ep extends h{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return(0,u.zn)(t,{expected:c.ZS.joinValues(r),received:t.parsedType,code:a.eq.invalid_type}),u.uY}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return(0,u.zn)(t,{received:t.data,code:a.eq.invalid_enum_value,options:r}),u.uY}return(0,u.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ep.create(e,{...this._def,...t})}exclude(e,t=this._def){return ep.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}ep.create=ef;class eh extends h{_parse(e){let t=c.ZS.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==c.Zp.string&&r.parsedType!==c.Zp.number){let e=c.ZS.objectValues(t);return(0,u.zn)(r,{expected:c.ZS.joinValues(e),received:r.parsedType,code:a.eq.invalid_type}),u.uY}if(this._cache||(this._cache=new Set(c.ZS.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=c.ZS.objectValues(t);return(0,u.zn)(r,{received:r.data,code:a.eq.invalid_enum_value,options:e}),u.uY}return(0,u.OK)(e.data)}get enum(){return this._def.values}}eh.create=(e,t)=>new eh({values:e,typeName:i.ZodNativeEnum,...p(t)});class em extends h{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.Zp.promise&&!1===t.common.async)return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.promise,received:t.parsedType}),u.uY;let r=t.parsedType===c.Zp.promise?t.data:Promise.resolve(t.data);return(0,u.OK)(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}em.create=(e,t)=>new em({type:e,typeName:i.ZodPromise,...p(t)});class eg extends h{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===i.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{(0,u.zn)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){let e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return u.uY;let n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?u.uY:"dirty"===n.status||"dirty"===t.value?(0,u.jm)(n.value):n});{if("aborted"===t.value)return u.uY;let n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?u.uY:"dirty"===n.status||"dirty"===t.value?(0,u.jm)(n.value):n}}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?u.uY:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?u.uY:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>(0,u.fn)(e)?Promise.resolve(n.transform(e.value,o)).then(e=>({status:t.value,value:e})):u.uY);else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,u.fn)(e))return u.uY;let i=n.transform(e.value,o);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}c.ZS.assertNever(n)}}eg.create=(e,t,r)=>new eg({schema:e,typeName:i.ZodEffects,effect:t,...p(r)}),eg.createWithPreprocess=(e,t,r)=>new eg({schema:t,effect:{type:"preprocess",transform:e},typeName:i.ZodEffects,...p(r)});class ey extends h{_parse(e){return this._getType(e)===c.Zp.undefined?(0,u.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ey.create=(e,t)=>new ey({innerType:e,typeName:i.ZodOptional,...p(t)});class ev extends h{_parse(e){return this._getType(e)===c.Zp.null?(0,u.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ev.create=(e,t)=>new ev({innerType:e,typeName:i.ZodNullable,...p(t)});class eb extends h{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===c.Zp.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}eb.create=(e,t)=>new eb({innerType:e,typeName:i.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...p(t)});class e_ extends h{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,u.xP)(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new a.G(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new a.G(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}e_.create=(e,t)=>new e_({innerType:e,typeName:i.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...p(t)});class e$ extends h{_parse(e){if(this._getType(e)!==c.Zp.nan){let t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:a.eq.invalid_type,expected:c.Zp.nan,received:t.parsedType}),u.uY}return{status:"valid",value:e.data}}}e$.create=e=>new e$({typeName:i.ZodNaN,...p(e)});let ew=Symbol("zod_brand");class eS extends h{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class eE extends h{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?u.uY:"dirty"===e.status?(t.dirty(),(0,u.jm)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?u.uY:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new eE({in:e,out:t,typeName:i.ZodPipeline})}}class ex extends h{_parse(e){let t=this._def.innerType._parse(e),r=e=>((0,u.fn)(e)&&(e.value=Object.freeze(e.value)),e);return(0,u.xP)(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function eA(e,t){let r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function eO(e,t={},r){return e?W.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(e=>{if(!e){let e=eA(t,n),i=e.fatal??r??!0;o.addIssue({code:"custom",...e,fatal:i})}});if(!i){let e=eA(t,n),i=e.fatal??r??!0;o.addIssue({code:"custom",...e,fatal:i})}}):W.create()}ex.create=(e,t)=>new ex({innerType:e,typeName:i.ZodReadonly,...p(t)});let ek={object:Q.lazycreate};!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(i||(i={}));let eI=(e,t={message:`Input not instance of ${e.name}`})=>eO(t=>t instanceof e,t),eC=D.create,eT=F.create,eP=e$.create,eR=U.create,ej=Z.create,eN=Y.create,eM=H.create,eL=q.create,eD=G.create,eB=W.create,eF=K.create,eU=V.create,eZ=z.create,eY=J.create,eH=Q.create,eq=Q.strictCreate,eG=ee.create,eW=er.create,eK=eo.create,eV=ei.create,ez=ea.create,eJ=es.create,eX=el.create,eQ=eu.create,e0=ec.create,e1=ed.create,e2=ep.create,e3=eh.create,e9=em.create,e4=eg.create,e8=ey.create,e6=ev.create,e5=eg.createWithPreprocess,e7=eE.create,te=()=>eC().optional(),tt=()=>eT().optional(),tr=()=>ej().optional(),tn={string:e=>D.create({...e,coerce:!0}),number:e=>F.create({...e,coerce:!0}),boolean:e=>Z.create({...e,coerce:!0}),bigint:e=>U.create({...e,coerce:!0}),date:e=>Y.create({...e,coerce:!0})},to=u.uY},6746:(e,t,r)=>{var n=r(33601);e.exports=r(77012).satisfies(n.version,">=16.9.0")},6772:(e,t,r)=>{e.exports=r(85432)},6833:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return(0,n.default)(e),e===t}e.exports=t.default,e.exports.default=t.default},7016:e=>{"use strict";e.exports=URIError},7978:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},8304:(e,t,r)=>{"use strict";var n=r(57693),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===n.RFC1738&&(40===c||41===c)){l+=s.charAt(u);continue}if(c<128){l+=a[c];continue}if(c<2048){l+=a[192|c>>6]+a[128|63&c];continue}if(c<55296||c>=57344){l+=a[224|c>>12]+a[128|c>>6&63]+a[128|63&c];continue}u+=1,l+=a[240|(c=65536+((1023&c)<<10|1023&s.charCodeAt(u)))>>18]+a[128|c>>12&63]+a[128|c>>6&63]+a[128|63&c]}return l},isBuffer:function(e){return!!e&&"object"==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n{"use strict";r.d(t,{DM:()=>p,G4:()=>f,I3:()=>a,MY:()=>l,OK:()=>d,fn:()=>h,jm:()=>c,uY:()=>u,xP:()=>m,y7:()=>i,zn:()=>s});var n=r(78974),o=r(19086);let i=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],a={...o,path:i};if(void 0!==o.message)return{...o,path:i,message:o.message};let s="";for(let e of n.filter(e=>!!e).slice().reverse())s=e(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}},a=[];function s(e,t){let r=(0,n.$W)(),a=i({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===o.A?void 0:o.A].filter(e=>!!e)});e.common.issues.push(a)}class l{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return u;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return l.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:t,value:o}=n;if("aborted"===t.status||"aborted"===o.status)return u;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==o.value||n.alwaysSet)&&(r[t.value]=o.value)}return{status:e.value,value:r}}}let u=Object.freeze({status:"aborted"}),c=e=>({status:"dirty",value:e}),d=e=>({status:"valid",value:e}),f=e=>"aborted"===e.status,p=e=>"dirty"===e.status,h=e=>"valid"===e.status,m=e=>"undefined"!=typeof Promise&&e instanceof Promise},8759:(e,t,r)=>{"use strict";let n=r(5074);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},8887:(e,t,r)=>{"use strict";let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=r(66931),a=r(77909),s=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],d=t.t={},f=0,p="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[p,o]],m=e=>{for(let[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},g=(e,t,r)=>{let n=m(t),o=f++;a(e,o,t),d[e]=o,u[o]=t,c[o]=n,s[o]=new RegExp(t,r?"g":void 0),l[o]=new RegExp(n,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),g("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${p}+`),g("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),g("FULL",`^${u[d.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),g("LOOSE",`^${u[d.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),g("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?`+"(?:$|[^\\d])"),g("COERCERTL",u[d.COERCE],!0),g("COERCERTLFULL",u[d.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},9219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return(0,n.default)(e),e.replace(RegExp("[".concat(t,"]+"),"g"),"")}e.exports=t.default,e.exports.default=t.default},9354:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPassiveEventListener=function(e,t,r){var n=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e}();e.addEventListener(t,r,!!n&&{passive:!0})},t.removePassiveEventListener=function(e,t,r){e.removeEventListener(t,r)}},10594:(e,t,r)=>{var n=r(67264);e.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var o=n(e);if(void 0===o)return;return Math.floor(r+o/1e3)}if("number"==typeof e)return r+e}},10898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9354),o=["mousedown","mousewheel","touchmove","keydown"];t.default={subscribe:function(e){return"undefined"!=typeof document&&o.forEach(function(t){return(0,n.addPassiveEventListener)(document,t,e)})}}},11335:(e,t,r)=>{"use strict";r.d(t,{H:()=>n});class n extends Error{constructor(e,t,r){let n=e.status||0===e.status?e.status:"",o=e.statusText||"",i=`${n} ${o}`.trim();super(`Request failed with ${i?`status code ${i}`:"an unknown error"}`),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=e,this.request=t,this.options=r}}},11538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(9354);var n=o(r(67763));function o(e){return e&&e.__esModule?e:{default:e}}t.default={mountFlag:!1,initialized:!1,scroller:null,containers:{},mount:function(e){this.scroller=e,this.handleHashChange=this.handleHashChange.bind(this),window.addEventListener("hashchange",this.handleHashChange),this.initStateFromHash(),this.mountFlag=!0},mapContainer:function(e,t){this.containers[e]=t},isMounted:function(){return this.mountFlag},isInitialized:function(){return this.initialized},initStateFromHash:function(){var e=this,t=this.getHash();t?window.setTimeout(function(){e.scrollTo(t,!0),e.initialized=!0},10):this.initialized=!0},scrollTo:function(e,t){var r=this.scroller;if(r.get(e)&&(t||e!==r.getActiveLink())){var n=this.containers[e]||document;r.scrollTo(e,{container:n})}},getHash:function(){return n.default.getHash()},changeHash:function(e,t){this.isInitialized()&&n.default.getHash()!==e&&n.default.updateHash(e,t)},handleHashChange:function(){this.scrollTo(this.getHash())},unmount:function(){this.scroller=null,this.containers=null,window.removeEventListener("hashchange",this.handleHashChange)}}},11732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^(?:[0-9]{9}X|[0-9]{10})$/,a=/^(?:[0-9]{13})$/,s=[1,3];function l(e,t){(0,n.default)(e);var r=String((null==t?void 0:t.version)||t);if(!(null!=t&&t.version||t))return l(e,{version:10})||l(e,{version:13});var o=e.replace(/[\s-]+/g,""),u=0;if("10"===r){if(!i.test(o))return!1;for(var c=0;c{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;function a(e){return(0,n.default)(e),0===e.indexOf("magnet:?")&&i.test(e)}e.exports=t.default,e.exports.default=t.default},12396:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=ee;var o=u(r(79922)),i=l(r(93563)),a=u(r(57300));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&({}).hasOwnProperty.call(e,a)){var l=i?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(o,a,l):o[a]=e[a]}return o.default=e,r&&r.set(e,o),o}function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return h(e)||p(e)||f(e)||d()}function d(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}}function p(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e){if(Array.isArray(e))return m(e)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r40?(r-=40,t="20".concat(t)):r>20?(r-=20,t="18".concat(t)):t="19".concat(t),r<10&&(r="0".concat(r));var n="".concat(t,"/").concat(r,"/").concat(e.slice(4,6));if(!(0,a.default)(n,"YYYY/MM/DD"))return!1;for(var o=e.split("").map(function(e){return parseInt(e,10)}),i=[2,4,8,5,10,9,7,3,6],s=0,l=0;l50&&(r-=50),r>20){if(2004>parseInt(t,10))return!1;r-=20}r<10&&(r="0".concat(r));var n="".concat(t,"/").concat(r,"/").concat(e.slice(4,6));if(!(0,a.default)(n,"YYYY/MM/DD"))return!1;if(10===e.length&&parseInt(e,10)%11!=0){var o=parseInt(e.slice(0,9),10)%11;if(!(1986>parseInt(t,10))||10!==o||0!==parseInt(e.slice(9),10))return!1}return!0}function b(e){return i.luhnCheck(e)}function _(e){for(var t=e.split("").map(function(e){return parseInt(e,10)}),r=[],n=0;n1})).length&&3!==r.length)return!1;if(3===r[0].length){for(var a=r[0].split("").map(function(e){return parseInt(e,10)}),s=0,l=0;l58))return!1;t="18".concat(t)}}3===t.length&&(t=[t.slice(0,2),"0",t.slice(2)].join(""));var r="".concat(t,"/").concat(e.slice(2,4),"/").concat(e.slice(0,2));if(!(0,a.default)(r,"YYYY/MM/DD"))return!1;for(var n=e.split("").map(function(e){return parseInt(e,10)}),o=0,i=4,s=0;s<9;s++)o+=n[s]*i,1==(i-=1)&&(i=7);return 1!=(o%=11)&&(0===o?0===n[9]:n[9]===11-o)}function w(e){for(var t=e.slice(0,8).split("").map(function(e){return parseInt(e,10)}),r=0,n=1;n4&&(r+=2));return String.fromCharCode(r%26+65)===e.charAt(8)}function S(e){for(var t=e.split("").map(function(e){return parseInt(e,10)}),r=0,n=0;n<8;n++)r+=t[n]*Math.pow(2,8-n);return r%11%10===t[8]}function E(e){var t=i.reverseMultiplyAndSum(e.split("").slice(0,7).map(function(e){return parseInt(e,10)}),8);return(9===e.length&&"W"!==e[8]&&(t+=(e[8].charCodeAt(0)-64)*9),0==(t%=23))?"W"===e[7].toUpperCase():e[7].toUpperCase()===String.fromCharCode(64+t)}var x={andover:["10","12"],atlanta:["60","67"],austin:["50","53"],brookhaven:["01","02","03","04","05","06","11","13","14","16","21","22","23","25","34","51","52","54","55","56","57","58","59","65"],cincinnati:["30","32","35","36","37","38","61"],fresno:["15","24"],internet:["20","26","27","45","46","47"],kansas:["40","44"],memphis:["94","95"],ogden:["80","90"],philadelphia:["33","39","41","42","43","46","48","62","63","64","66","68","71","72","73","74","75","76","77","81","82","83","84","85","86","87","88","91","92","93","98","99"],sba:["31"]};function A(){var e=[];for(var t in x)x.hasOwnProperty(t)&&e.push.apply(e,c(x[t]));return e}function O(e){return -1!==A().indexOf(e.slice(0,2))}function k(e){for(var t=0,r=e.split(""),n=parseInt(r.pop(),10),o=0;o1){var r=0;switch(t[0]){case"Y":r=1;break;case"Z":r=2}t.splice(0,1,r)}else for(;t.length<9;)t.unshift(0);var n=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"],o=parseInt((t=t.join("")).slice(0,8),10)%23;return t[8]===n[o]}function C(e){var t=e.slice(1,3);switch(e.slice(0,1)){case"1":case"2":t="18".concat(t);break;case"3":case"4":t="19".concat(t);break;default:t="20".concat(t)}var r="".concat(t,"/").concat(e.slice(3,5),"/").concat(e.slice(5,7));if(!(0,a.default)(r,"YYYY/MM/DD"))return!1;for(var n=e.split("").map(function(e){return parseInt(e,10)}),o=0,i=1,s=0;s<10;s++)o+=n[s]*i,10===(i+=1)&&(i=1);if(o%11==10){o=0,i=3;for(var l=0;l<10;l++)o+=n[l]*i,10===(i+=1)&&(i=1);if(o%11==10)return 0===n[10]}return o%11===n[10]}function T(e){var t=e.slice(4,6);switch(e.slice(6,7)){case"+":t="18".concat(t);break;case"-":t="19".concat(t);break;default:t="20".concat(t)}var r="".concat(t,"/").concat(e.slice(2,4),"/").concat(e.slice(0,2));if(!(0,a.default)(r,"YYYY/MM/DD"))return!1;var n=parseInt(e.slice(0,6)+e.slice(7,10),10)%31;return n<10?n===parseInt(e.slice(10),10):["A","B","C","D","E","F","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y"][n-=10]===e.slice(10)}function P(e){if("00"!==e.slice(2,4)||"00"!==e.slice(4,6)){var t="".concat(e.slice(0,2),"/").concat(e.slice(2,4),"/").concat(e.slice(4,6));if(!(0,a.default)(t,"YY/MM/DD"))return!1}var r=97-parseInt(e.slice(0,9),10)%97,n=parseInt(e.slice(9,11),10);return(r===n||(r=97-parseInt("2".concat(e.slice(0,9)),10)%97)===n)&&!0}function R(e){return parseInt((e=e.replace(/\s/g,"")).slice(0,10),10)%511===parseInt(e.slice(10,13),10)}function j(e){var t="".concat(e.slice(0,4),"/").concat(e.slice(4,6),"/").concat(e.slice(6,8));return!!(0,a.default)(t,"YYYY/MM/DD")&&!!i.luhnCheck(e.slice(0,12))&&i.verhoeffCheck("".concat(e.slice(0,11)).concat(e[12]))}function N(e){return i.iso7064Check(e)}function M(e){for(var t=e.split("").map(function(e){return parseInt(e,10)}),r=8,n=1;n<9;n++)r+=t[n]*(n+1);return r%11===t[9]}function L(e){for(var t=!1,r=!1,n=0;n<3;n++)if(!t&&/[AEIOU]/.test(e[n]))t=!0;else if(!r&&t&&"X"===e[n])r=!0;else if(n>0&&(t&&!r&&!/[AEIOU]/.test(e[n])||r&&!/X/.test(e[n])))return!1;return!0}function D(e){var t=e.toUpperCase().split("");if(!L(t.slice(0,3))||!L(t.slice(3,6)))return!1;for(var r=[6,7,9,10,12,13,14],n={L:"0",M:"1",N:"2",P:"3",Q:"4",R:"5",S:"6",T:"7",U:"8",V:"9"},o=0,i=r;o40&&(u-=40),u<10&&(u="0".concat(u));var c="".concat(t[6]).concat(t[7],"/").concat(l,"/").concat(u);if(!(0,a.default)(c,"YY/MM/DD"))return!1;for(var d=0,f=1;f4&&(g+=2)}d+=g}return String.fromCharCode(65+d%26)===t[15]}function B(e){var t=(e=e.replace(/\W/,"")).slice(0,2);if("32"!==t){if("00"!==e.slice(2,4)){var r=e.slice(4,6);switch(e[6]){case"0":r="18".concat(r);break;case"1":r="19".concat(r);break;default:r="20".concat(r)}var n="".concat(r,"/").concat(e.slice(2,4),"/").concat(t);if(!(0,a.default)(n,"YYYY/MM/DD"))return!1}for(var o=1101,i=[1,6,3,7,9,10,5,8,4,2],s=0;s32e3||r===parseInt(t.join("").slice(5,7),10))return!1}}return!0}function U(e){return i.reverseMultiplyAndSum(e.split("").slice(0,8).map(function(e){return parseInt(e,10)}),9)%11===parseInt(e[8],10)}function Z(e){if(10===e.length){for(var t=[6,5,7,2,3,4,5,6,7],r=0,n=0;n80?(o="18".concat(o),i-=80):i>60?(o="22".concat(o),i-=60):i>40?(o="21".concat(o),i-=40):i>20?(o="20".concat(o),i-=20):o="19".concat(o),i<10&&(i="0".concat(i));var s="".concat(o,"/").concat(i,"/").concat(e.slice(4,6));if(!(0,a.default)(s,"YYYY/MM/DD"))return!1;for(var l=0,u=1,c=0;c10?u=1:5===u&&(u+=2);return(l=10-l%10)===parseInt(e[10],10)}function Y(e){if(11===e.length){if(t=0,"11111111111"===e||"22222222222"===e||"33333333333"===e||"44444444444"===e||"55555555555"===e||"66666666666"===e||"77777777777"===e||"88888888888"===e||"99999999999"===e||"00000000000"===e)return!1;for(var t,r,n=1;n<=9;n++)t+=parseInt(e.substring(n-1,n),10)*(11-n);if(10==(r=10*t%11)&&(r=0),r!==parseInt(e.substring(9,10),10))return!1;t=0;for(var o=1;o<=10;o++)t+=parseInt(e.substring(o-1,o),10)*(12-o);return 10==(r=10*t%11)&&(r=0),r===parseInt(e.substring(10,11),10)}if("00000000000000"===e||"11111111111111"===e||"22222222222222"===e||"33333333333333"===e||"44444444444444"===e||"55555555555555"===e||"66666666666666"===e||"77777777777777"===e||"88888888888888"===e||"99999999999999"===e)return!1;for(var i=e.length-2,a=e.substring(0,i),s=e.substring(i),l=0,u=i-7,c=i;c>=1;c--)l+=a.charAt(i-c)*u,(u-=1)<2&&(u=9);var d=l%11<2?0:11-l%11;if(d!==parseInt(s.charAt(0),10))return!1;i+=1,a=e.substring(0,i),l=0,u=i-7;for(var f=i;f>=1;f--)l+=a.charAt(i-f)*u,(u-=1)<2&&(u=9);return(d=l%11<2?0:11-l%11)===parseInt(s.charAt(1),10)}function H(e){var t=11-i.reverseMultiplyAndSum(e.split("").slice(0,8).map(function(e){return parseInt(e,10)}),9)%11;return t>9?0===parseInt(e[8],10):t===parseInt(e[8],10)}function q(e){if("9000"!==e.slice(0,4)){var t=e.slice(1,3);switch(e[0]){case"1":case"2":t="19".concat(t);break;case"3":case"4":t="18".concat(t);break;case"5":case"6":t="20".concat(t)}var r="".concat(t,"/").concat(e.slice(3,5),"/").concat(e.slice(5,7));if(8===r.length){if(!(0,a.default)(r,"YY/MM/DD"))return!1}else if(!(0,a.default)(r,"YYYY/MM/DD"))return!1;for(var n=e.split("").map(function(e){return parseInt(e,10)}),o=[2,7,9,1,4,6,3,5,8,2,7,9],i=0,s=0;s53)return!1;t=t<10?"190".concat(t):"19".concat(t);var r=parseInt(e.slice(2,4),10);r>50&&(r-=50),r<10&&(r="0".concat(r));var n="".concat(t,"/").concat(r,"/").concat(e.slice(4,6));if(!(0,a.default)(n,"YYYY/MM/DD"))return!1}return!0}function W(e){var t=11-i.reverseMultiplyAndSum(e.split("").slice(0,7).map(function(e){return parseInt(e,10)}),8)%11;return 10===t?0===parseInt(e[7],10):t===parseInt(e[7],10)}function K(e){var t=e.slice(0);e.length>11&&(t=t.slice(2));var r="",n=t.slice(2,4),o=parseInt(t.slice(4,6),10);if(e.length>11)r=e.slice(0,4);else if(r=e.slice(0,2),11===e.length&&o<60){var s=new Date().getFullYear().toString(),l=parseInt(s.slice(0,2),10);if(s=parseInt(s,10),"-"===e[6])r=parseInt("".concat(l).concat(r),10)>s?"".concat(l-1).concat(r):"".concat(l).concat(r);else if(s-parseInt(r="".concat(l-1).concat(r),10)<100)return!1}o>60&&(o-=60),o<10&&(o="0".concat(o));var u="".concat(r,"/").concat(n,"/").concat(o);if(8===u.length){if(!(0,a.default)(u,"YY/MM/DD"))return!1}else if(!(0,a.default)(u,"YYYY/MM/DD"))return!1;return i.luhnCheck(e.replace(/\W/,""))}function V(e){for(var t=e.split("").map(function(e){return parseInt(e,10)}),r=[-1,5,7,9,4,6,10,5,7],n=0,o=0;o1&&void 0!==arguments[1]?arguments[1]:"en-US";(0,o.default)(e);var r=e.slice(0);if(t in z)return t in Q&&(r=r.replace(Q[t],"")),!!z[t].test(r)&&(!(t in J)||J[t](r));throw Error("Invalid locale '".concat(t,"'"))}Q["nl-BE"]=Q["fr-BE"],e.exports=t.default,e.exports.default=t.default},13108:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){(0,n.default)(e);var r=t?RegExp("^[".concat(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+"),"g"):/^\s+/g;return e.replace(r,"")}e.exports=t.default,e.exports.default=t.default},13536:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},13941:(e,t,r)=>{"use strict";let n=r(5074),o=r(50141),{ANY:i}=o,a=r(8759),s=r(26189),l=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let o=!1;e:for(let n of e.set){for(let e of t.set){let t=d(n,e,r);if(o=o||null!==t,t)continue e}if(o)return!1}return!0},u=[new o(">=0.0.0-0")],c=[new o(">=0.0.0")],d=(e,t,r)=>{let n,o,l,d,h,m,g;if(e===t)return!0;if(1===e.length&&e[0].semver===i)if(1===t.length&&t[0].semver===i)return!0;else e=r.includePrerelease?u:c;if(1===t.length&&t[0].semver===i)if(r.includePrerelease)return!0;else t=c;let y=new Set;for(let t of e)">"===t.operator||">="===t.operator?n=f(n,t,r):"<"===t.operator||"<="===t.operator?o=p(o,t,r):y.add(t.semver);if(y.size>1)return null;if(n&&o&&((l=s(n.semver,o.semver,r))>0||0===l&&(">="!==n.operator||"<="!==o.operator)))return null;for(let e of y){if(n&&!a(e,String(n),r)||o&&!a(e,String(o),r))return null;for(let n of t)if(!a(e,String(n),r))return!1;return!0}let v=!!o&&!r.includePrerelease&&!!o.semver.prerelease.length&&o.semver,b=!!n&&!r.includePrerelease&&!!n.semver.prerelease.length&&n.semver;for(let e of(v&&1===v.prerelease.length&&"<"===o.operator&&0===v.prerelease[0]&&(v=!1),t)){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,n){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if((d=f(n,e,r))===e&&d!==n)return!1}else if(">="===n.operator&&!a(n.semver,String(e),r))return!1}if(o){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if((h=p(o,e,r))===e&&h!==o)return!1}else if("<="===o.operator&&!a(o.semver,String(e),r))return!1}if(!e.operator&&(o||n)&&0!==l)return!1}return(!n||!m||!!o||0===l)&&(!o||!g||!!n||0===l)&&!b&&!v&&!0},f=(e,t,r)=>{if(!e)return t;let n=s(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;let n=s(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=l},14274:(e,t,r)=>{"use strict";var n=r(80656);e.exports=Function.prototype.bind||n},14287:(e,t,r)=>{"use strict";r.d(t,{Ch:()=>ei,Di:()=>R,Kq:()=>V,M3:()=>L,Tt:()=>k,b8:()=>eh,bD:()=>_,cj:()=>eg,eM:()=>et,hL:()=>E,iM:()=>ec,k9:()=>ey,u1:()=>I,u6:()=>q,xn:()=>U});var n,o,i,a,s,l,u,c,d,f,p,h,m,g,y="vercel.ai.error",v=Symbol.for(y),b=class e extends Error{constructor({name:e,message:t,cause:r}){super(t),this[n]=!0,this.name=e,this.cause=r}static isInstance(t){return e.hasMarker(t,y)}static hasMarker(e,t){let r=Symbol.for(t);return null!=e&&"object"==typeof e&&r in e&&"boolean"==typeof e[r]&&!0===e[r]}};n=v;var _=b,$="AI_APICallError",w=`vercel.ai.error.${$}`,S=Symbol.for(w),E=class extends _{constructor({message:e,url:t,requestBodyValues:r,statusCode:n,responseHeaders:i,responseBody:a,cause:s,isRetryable:l=null!=n&&(408===n||409===n||429===n||n>=500),data:u}){super({name:$,message:e,cause:s}),this[o]=!0,this.url=t,this.requestBodyValues=r,this.statusCode=n,this.responseHeaders=i,this.responseBody=a,this.isRetryable=l,this.data=u}static isInstance(e){return _.hasMarker(e,w)}};o=S;var x="AI_EmptyResponseBodyError",A=`vercel.ai.error.${x}`,O=Symbol.for(A),k=class extends _{constructor({message:e="Empty response body"}={}){super({name:x,message:e}),this[i]=!0}static isInstance(e){return _.hasMarker(e,A)}};function I(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}i=O;var C="AI_InvalidArgumentError",T=`vercel.ai.error.${C}`,P=Symbol.for(T),R=class extends _{constructor({message:e,cause:t,argument:r}){super({name:C,message:e,cause:t}),this[a]=!0,this.argument=r}static isInstance(e){return _.hasMarker(e,T)}};a=P;var j="AI_InvalidPromptError",N=`vercel.ai.error.${j}`,M=Symbol.for(N),L=class extends _{constructor({prompt:e,message:t,cause:r}){super({name:j,message:`Invalid prompt: ${t}`,cause:r}),this[s]=!0,this.prompt=e}static isInstance(e){return _.hasMarker(e,N)}};s=M;var D="AI_InvalidResponseDataError",B=`vercel.ai.error.${D}`,F=Symbol.for(B),U=class extends _{constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:D,message:t}),this[l]=!0,this.data=e}static isInstance(e){return _.hasMarker(e,B)}};l=F;var Z="AI_JSONParseError",Y=`vercel.ai.error.${Z}`,H=Symbol.for(Y),q=class extends _{constructor({text:e,cause:t}){super({name:Z,message:`JSON parsing failed: Text: ${e}. Error message: ${I(t)}`,cause:t}),this[u]=!0,this.text=e}static isInstance(e){return _.hasMarker(e,Y)}};u=H;var G="AI_LoadAPIKeyError",W=`vercel.ai.error.${G}`,K=Symbol.for(W),V=class extends _{constructor({message:e}){super({name:G,message:e}),this[c]=!0}static isInstance(e){return _.hasMarker(e,W)}};c=K;var z="AI_LoadSettingError";d=Symbol.for(`vercel.ai.error.${z}`);var J="AI_NoContentGeneratedError";f=Symbol.for(`vercel.ai.error.${J}`);var X="AI_NoSuchModelError",Q=`vercel.ai.error.${X}`,ee=Symbol.for(Q),et=class extends _{constructor({errorName:e=X,modelId:t,modelType:r,message:n=`No such ${r}: ${t}`}){super({name:e,message:n}),this[p]=!0,this.modelId=t,this.modelType=r}static isInstance(e){return _.hasMarker(e,Q)}};p=ee;var er="AI_TooManyEmbeddingValuesForCallError",en=`vercel.ai.error.${er}`,eo=Symbol.for(en),ei=class extends _{constructor(e){super({name:er,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[h]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return _.hasMarker(e,en)}};h=eo;var ea="AI_TypeValidationError",es=`vercel.ai.error.${ea}`,el=Symbol.for(es),eu=class e extends _{constructor({value:e,cause:t}){super({name:ea,message:`Type validation failed: Value: ${JSON.stringify(e)}. Error message: ${I(t)}`,cause:t}),this[m]=!0,this.value=e}static isInstance(e){return _.hasMarker(e,es)}static wrap({value:t,cause:r}){return e.isInstance(r)&&r.value===t?r:new e({value:t,cause:r})}};m=el;var ec=eu,ed="AI_UnsupportedFunctionalityError",ef=`vercel.ai.error.${ed}`,ep=Symbol.for(ef),eh=class extends _{constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:ed,message:t}),this[g]=!0,this.functionality=e}static isInstance(e){return _.hasMarker(e,ef)}};function em(e){return null===e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||(Array.isArray(e)?e.every(em):"object"==typeof e&&Object.entries(e).every(([e,t])=>"string"==typeof e&&em(t)))}function eg(e){return Array.isArray(e)&&e.every(em)}function ey(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>"string"==typeof e&&em(t))}g=ep},15618:(e,t,r)=>{var n=r(33601),o=r(92572).Buffer,i=r(46994);function a(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=o.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=o.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,n.nextTick((function(){this.emit("end",e),this.readable=!1,this.emit("close")}).bind(this)),this;throw TypeError("Unexpected data type ("+typeof e+")")}r(84864).inherits(a,i),a.prototype.write=function(e){this.buffer=o.concat([this.buffer,o.from(e)]),this.emit("data",e)},a.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},e.exports=a},16076:e=>{var t=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},16526:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=s&&l&&"function"==typeof l.get?l.get:null,c=s&&Set.prototype.forEach,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,v=String.prototype.slice,b=String.prototype.replace,_=String.prototype.toUpperCase,$=String.prototype.toLowerCase,w=RegExp.prototype.test,S=Array.prototype.concat,E=Array.prototype.join,x=Array.prototype.slice,A=Math.floor,O="function"==typeof BigInt?BigInt.prototype.valueOf:null,k=Object.getOwnPropertySymbols,I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,T="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===C?"object":"symbol")?Symbol.toStringTag:null,P=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function j(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||w.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-A(-e):A(e);if(n!==e){var o=String(n),i=v.call(t,o.length+1);return b.call(o,r,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,r,"$&_")}var N=r(86973),M=N.custom,L=z(M)?M:null,D={__proto__:null,double:'"',single:"'"},B={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function F(e,t,r){var n=D[r.quoteStyle||t];return n+e+n}function U(e){return b.call(String(e),/"/g,""")}function Z(e){return!T||!("object"==typeof e&&(T in e||void 0!==e[T]))}function Y(e){return"[object Array]"===ee(e)&&Z(e)}function H(e){return"[object Date]"===ee(e)&&Z(e)}function q(e){return"[object RegExp]"===ee(e)&&Z(e)}function G(e){return"[object Error]"===ee(e)&&Z(e)}function W(e){return"[object String]"===ee(e)&&Z(e)}function K(e){return"[object Number]"===ee(e)&&Z(e)}function V(e){return"[object Boolean]"===ee(e)&&Z(e)}function z(e){if(C)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!I)return!1;try{return I.call(e),!0}catch(e){}return!1}function J(e){if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,s){var l=n||{};if(Q(l,"quoteStyle")&&!Q(D,l.quoteStyle))throw TypeError('option "quoteStyle" must be "single" or "double"');if(Q(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var d=!Q(l,"customInspect")||l.customInspect;if("boolean"!=typeof d&&"symbol"!==d)throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Q(l,"indent")&&null!==l.indent&&" "!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Q(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return eu(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var p=String(t);return f?j(t,p):p}if("bigint"==typeof t){var m=String(t)+"n";return f?j(t,m):m}var g=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=g&&g>0&&"object"==typeof t)return Y(t)?"[Array]":"[Object]";var y=em(l,o);if(void 0===s)s=[];else if(er(s,t)>=0)return"[Circular]";function _(t,r,n){if(r&&(s=x.call(s)).push(r),n){var i={depth:l.depth};return Q(l,"quoteStyle")&&(i.quoteStyle=l.quoteStyle),e(t,i,o+1,s)}return e(t,l,o+1,s)}if("function"==typeof t&&!q(t)){var w=et(t),A=ey(t,_);return"[Function"+(w?": "+w:" (anonymous)")+"]"+(A.length>0?" { "+E.call(A,", ")+" }":"")}if(z(t)){var k=C?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):I.call(t);return"object"!=typeof t||C?k:ed(k)}if(el(t)){for(var M="<"+$.call(String(t.nodeName)),B=t.attributes||[],Z=0;Z"}if(Y(t)){if(0===t.length)return"[]";var X=ey(t,_);return y&&!eh(X)?"["+eg(X,y)+"]":"[ "+E.call(X,", ")+" ]"}if(G(t)){var ec=ey(t,_);return"cause"in Error.prototype||!("cause"in t)||P.call(t,"cause")?0===ec.length?"["+String(t)+"]":"{ ["+String(t)+"] "+E.call(ec,", ")+" }":"{ ["+String(t)+"] "+E.call(S.call("[cause]: "+_(t.cause),ec),", ")+" }"}if("object"==typeof t&&d){if(L&&"function"==typeof t[L]&&N)return N(t,{depth:g-o});else if("symbol"!==d&&"function"==typeof t.inspect)return t.inspect()}if(en(t)){var ev=[];return a&&a.call(t,function(e,r){ev.push(_(r,t,!0)+" => "+_(e,t))}),ep("Map",i.call(t),ev,y)}if(ea(t)){var eb=[];return c&&c.call(t,function(e){eb.push(_(e,t))}),ep("Set",u.call(t),eb,y)}if(eo(t))return ef("WeakMap");if(es(t))return ef("WeakSet");if(ei(t))return ef("WeakRef");if(K(t))return ed(_(Number(t)));if(J(t))return ed(_(O.call(t)));if(V(t))return ed(h.call(t));if(W(t))return ed(_(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!H(t)&&!q(t)){var e_=ey(t,_),e$=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,ew=t instanceof Object?"":"null prototype",eS=!e$&&T&&Object(t)===t&&T in t?v.call(ee(t),8,-1):ew?"Object":"",eE=(e$||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(eS||ew?"["+E.call(S.call([],eS||[],ew||[]),": ")+"] ":"");return 0===e_.length?eE+"{}":y?eE+"{"+eg(e_,y)+"}":eE+"{ "+E.call(e_,", ")+" }"}return String(t)};var X=Object.prototype.hasOwnProperty||function(e){return e in this};function Q(e,t){return X.call(e,t)}function ee(e){return m.call(e)}function et(e){if(e.name)return e.name;var t=y.call(g.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function er(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;rt.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return eu(v.call(e,0,t.maxStringLength),t)+n}var o=B[t.quoteStyle||"single"];return o.lastIndex=0,F(b.call(b.call(e,o,"\\$1"),/[\x00-\x1f]/g,ec),"single",t)}function ec(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+_.call(t.toString(16))}function ed(e){return"Object("+e+")"}function ef(e){return e+" { ? }"}function ep(e,t,r,n){return e+" ("+t+") {"+(n?eg(r,n):E.call(r,", "))+"}"}function eh(e){for(var t=0;t=0)return!1;return!0}function em(e,t){var r;if(" "===e.indent)r=" ";else{if("number"!=typeof e.indent||!(e.indent>0))return null;r=E.call(Array(e.indent+1)," ")}return{base:r,prev:E.call(Array(t+1),r)}}function eg(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+E.call(e,","+r)+"\n"+t.prev}function ey(e,t){var r,n=Y(e),o=[];if(n){o.length=e.length;for(var i=0;i{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},18081:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return(0,n.default)(e),e.replace(RegExp("[^".concat(t,"]+"),"g"),"")}e.exports=t.default,e.exports.default=t.default},18598:(e,t,r)=>{"use strict";var n=r(8304),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},l=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},u="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",d=function(e,t){var r={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=d.split(t.delimiter,f),h=-1,m=t.charset;if(t.charsetSentinel)for(g=0;g-1&&(v=i(v)?[v]:v),o.call(r,y)?r[y]=n.combine(r[y],v):r[y]=v}return r},f=function(e,t,r,n){for(var o=n?t:l(t,r),i=e.length-1;i>=0;--i){var a,s=e[i];if("[]"===s&&r.parseArrays)a=[].concat(o);else{a=r.plainObjects?Object.create(null):{};var u="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,c=parseInt(u,10);r.parseArrays||""!==u?!isNaN(c)&&s!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(a=[])[c]=o:"__proto__"!==u&&(a[u]=o):a={0:o}}o=a}return o},p=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,l=r.depth>0&&a.exec(i),u=l?i.slice(0,l.index):i,c=[];if(u){if(!r.plainObjects&&o.call(Object.prototype,u)&&!r.allowPrototypes)return;c.push(u)}for(var d=0;r.depth>0&&null!==(l=s.exec(i))&&d{"use strict";r.d(t,{A:()=>i});var n=r(64892),o=r(45859);let i=(e,t)=>{let r;switch(e.code){case n.eq.invalid_type:r=e.received===o.Zp.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case n.eq.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,o.ZS.jsonStringifyReplacer)}`;break;case n.eq.unrecognized_keys:r=`Unrecognized key(s) in object: ${o.ZS.joinValues(e.keys,", ")}`;break;case n.eq.invalid_union:r="Invalid input";break;case n.eq.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${o.ZS.joinValues(e.options)}`;break;case n.eq.invalid_enum_value:r=`Invalid enum value. Expected ${o.ZS.joinValues(e.options)}, received '${e.received}'`;break;case n.eq.invalid_arguments:r="Invalid function arguments";break;case n.eq.invalid_return_type:r="Invalid function return type";break;case n.eq.invalid_date:r="Invalid date";break;case n.eq.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:o.ZS.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case n.eq.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case n.eq.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case n.eq.custom:r="Invalid input";break;case n.eq.invalid_intersection_types:r="Intersection results could not be merged";break;case n.eq.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case n.eq.not_finite:r="Number must be finite";break;default:r=t.defaultError,o.ZS.assertNever(e)}return{message:r}}},19692:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=v;var n=l(r(79922)),o=l(r(54506)),i=l(r(74499)),a=l(r(26433)),s=l(r(29203));function l(e){return e&&e.__esModule?e:{default:e}}var u={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:[]},c=/^([^\x00-\x1F\x7F-\x9F\cX]+)]/.test(t)&&(t===e||t.split('"').length!==t.split('\\"').length))&&!0}function v(e,t){if((0,n.default)(e),(t=(0,s.default)(t,u)).require_display_name||t.allow_display_name){var r=e.match(c);if(r){var l=r[1];if(e=e.replace(l,"").replace(/(^<|>$)/g,""),l.endsWith(" ")&&(l=l.slice(0,-1)),!y(l))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>g)return!1;var v=e.split("@"),b=v.pop(),_=b.toLowerCase();if(t.host_blacklist.includes(_)||t.host_whitelist.length>0&&!t.host_whitelist.includes(_))return!1;var $=v.join("@");if(t.domain_specific_validation&&("gmail.com"===_||"googlemail.com"===_)){var w=($=$.toLowerCase()).split("+")[0];if(!(0,o.default)(w.replace(/\./g,""),{min:6,max:30}))return!1;for(var S=w.split("."),E=0;E{"use strict";var n=r(16526),o=r(72206),i=function(e,t,r){for(var n,o=e;null!=(n=o.next);o=n)if(n.key===t)return o.next=n.next,r||(n.next=e.next,e.next=n),n},a=function(e,t){if(e){var r=i(e,t);return r&&r.value}},s=function(e,t,r){var n=i(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},l=function(e,t){return!!e&&!!i(e,t)},u=function(e,t){if(e)return i(e,t,!0)};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+n(e))},delete:function(t){var r=e&&e.next,n=u(e,t);return n&&r&&r===n&&(e=void 0),!!n},get:function(t){return a(e,t)},has:function(t){return l(e,t)},set:function(t,r){e||(e={next:void 0}),s(e,t,r)}};return t}},20248:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=eJ(r(73909)),i=eJ(r(83637)),a=eJ(r(92946)),s=eJ(r(58031)),l=eJ(r(6833)),u=eJ(r(50553)),c=eJ(r(82189)),d=eJ(r(19692)),f=eJ(r(51513)),p=eJ(r(67953)),h=eJ(r(26433)),m=eJ(r(39070)),g=eJ(r(74499)),y=eJ(r(57300)),v=eJ(r(73313)),b=eJ(r(5464)),_=eJ(r(99834)),$=eJ(r(91428)),w=ez(r(34200)),S=ez(r(29427)),E=eJ(r(52187)),x=eJ(r(66939)),A=eJ(r(21003)),O=eJ(r(42145)),k=eJ(r(68960)),I=eJ(r(70892)),C=eJ(r(78567)),T=eJ(r(32539)),P=eJ(r(25247)),R=eJ(r(49600)),j=eJ(r(4479)),N=eJ(r(95736)),M=eJ(r(42774)),L=eJ(r(84409)),D=ez(r(87398)),B=eJ(r(56887)),F=eJ(r(4427)),U=eJ(r(56451)),Z=eJ(r(92178)),Y=eJ(r(71384)),H=eJ(r(30366)),q=eJ(r(48479)),G=eJ(r(38123)),W=ez(r(58528)),K=eJ(r(79998)),V=eJ(r(37304)),z=eJ(r(21508)),J=eJ(r(91385)),X=eJ(r(4658)),Q=eJ(r(29349)),ee=eJ(r(3476)),et=eJ(r(54506)),er=eJ(r(99931)),en=eJ(r(23641)),eo=eJ(r(32942)),ei=eJ(r(87931)),ea=eJ(r(41467)),es=eJ(r(83120)),el=eJ(r(78647)),eu=eJ(r(20356)),ec=eJ(r(36884)),ed=eJ(r(37399)),ef=eJ(r(11732)),ep=eJ(r(73169)),eh=eJ(r(12396)),em=ez(r(98886)),eg=eJ(r(72107)),ey=eJ(r(42463)),ev=eJ(r(75705)),eb=r(67400),e_=eJ(r(87896)),e$=eJ(r(50560)),ew=eJ(r(89843)),eS=eJ(r(73242)),eE=eJ(r(59237)),ex=eJ(r(77543)),eA=eJ(r(44448)),eO=eJ(r(63392)),ek=eJ(r(60091)),eI=eJ(r(53034)),eC=eJ(r(12260)),eT=eJ(r(43528)),eP=eJ(r(71648)),eR=eJ(r(1367)),ej=ez(r(54534)),eN=eJ(r(13108)),eM=eJ(r(2166)),eL=eJ(r(47500)),eD=eJ(r(83455)),eB=eJ(r(29628)),eF=eJ(r(552)),eU=eJ(r(18081)),eZ=eJ(r(9219)),eY=eJ(r(41556)),eH=eJ(r(90629)),eq=eJ(r(68907)),eG=eJ(r(94265)),eW=eJ(r(38238)),eK=eJ(r(85463));function eV(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(eV=function(e){return e?r:t})(e)}function ez(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=eV(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&({}).hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,r&&r.set(e,o),o}function eJ(e){return e&&e.__esModule?e:{default:e}}t.default={version:"13.12.0",toDate:o.default,toFloat:i.default,toInt:a.default,toBoolean:s.default,equals:l.default,contains:u.default,matches:c.default,isEmail:d.default,isURL:f.default,isMACAddress:p.default,isIP:h.default,isIPRange:m.default,isFQDN:g.default,isBoolean:b.default,isIBAN:W.default,isBIC:K.default,isAbaRouting:$.default,isAlpha:w.default,isAlphaLocales:w.locales,isAlphanumeric:S.default,isAlphanumericLocales:S.locales,isNumeric:E.default,isPassportNumber:x.default,isPort:A.default,isLowercase:O.default,isUppercase:k.default,isAscii:C.default,isFullWidth:T.default,isHalfWidth:P.default,isVariableWidth:R.default,isMultibyte:j.default,isSemVer:N.default,isSurrogatePair:M.default,isInt:L.default,isIMEI:I.default,isFloat:D.default,isFloatLocales:D.locales,isDecimal:B.default,isHexadecimal:F.default,isOctal:U.default,isDivisibleBy:Z.default,isHexColor:Y.default,isRgbColor:H.default,isHSL:q.default,isISRC:G.default,isMD5:V.default,isHash:z.default,isJWT:J.default,isJSON:X.default,isEmpty:Q.default,isLength:ee.default,isLocale:_.default,isByteLength:et.default,isUUID:er.default,isMongoId:en.default,isAfter:eo.default,isBefore:ei.default,isIn:ea.default,isLuhnNumber:es.default,isCreditCard:el.default,isIdentityCard:eu.default,isEAN:ec.default,isISIN:ed.default,isISBN:ef.default,isISSN:ep.default,isMobilePhone:em.default,isMobilePhoneLocales:em.locales,isPostalCode:ej.default,isPostalCodeLocales:ej.locales,isEthereumAddress:eg.default,isCurrency:ey.default,isBtcAddress:ev.default,isISO6346:eb.isISO6346,isFreightContainerID:eb.isFreightContainerID,isISO6391:e_.default,isISO8601:e$.default,isRFC3339:ew.default,isISO31661Alpha2:eS.default,isISO31661Alpha3:eE.default,isISO4217:ex.default,isBase32:eA.default,isBase58:eO.default,isBase64:ek.default,isDataURI:eI.default,isMagnetURI:eC.default,isMailtoURI:eT.default,isMimeType:eP.default,isLatLong:eR.default,ltrim:eN.default,rtrim:eM.default,trim:eL.default,escape:eD.default,unescape:eB.default,stripLow:eF.default,whitelist:eU.default,blacklist:eZ.default,isWhitelisted:eY.default,normalizeEmail:eH.default,toString:toString,isSlug:eq.default,isStrongPassword:eW.default,isTaxID:eh.default,isDate:y.default,isTime:v.default,isLicensePlate:eG.default,isVAT:eK.default,ibanLocales:W.locales},e.exports=t.default,e.exports.default=t.default},20356:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=i(r(79922)),o=i(r(84409));function i(e){return e&&e.__esModule?e:{default:e}}var a={PL:function(e){(0,n.default)(e);var t={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(null!=e&&11===e.length&&(0,o.default)(e,{allow_leading_zeroes:!0})){var r=e.split("").slice(0,-1).reduce(function(e,r,n){return e+Number(r)*t[n+1]},0)%10,i=Number(e.charAt(e.length-1));if(0===r&&0===i||i===10-r)return!0}return!1},ES:function(e){(0,n.default)(e);var t=/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/,r={X:0,Y:1,Z:2},o=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"],i=e.trim().toUpperCase();if(!t.test(i))return!1;var a=i.slice(0,-1).replace(/[X,Y,Z]/g,function(e){return r[e]});return i.endsWith(o[a%23])},FI:function(e){return(0,n.default)(e),11===e.length&&!!e.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/)&&"0123456789ABCDEFHJKLMNPRSTUVWXY"[(1e3*parseInt(e.slice(0,6),10)+parseInt(e.slice(7,10),10))%31]===e.slice(10,11)},IN:function(e){var t=/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/,r=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],n=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],o=e.trim();if(!t.test(o))return!1;var i=0;return o.replace(/\s/g,"").split("").map(Number).reverse().forEach(function(e,t){i=r[i][n[t%8][e]]}),0===i},IR:function(e){if(!e.match(/^\d{10}$/)||0===parseInt((e="0000".concat(e).slice(e.length-6)).slice(3,9),10))return!1;for(var t=parseInt(e.slice(9,10),10),r=0,n=0;n<9;n++)r+=parseInt(e.slice(n,n+1),10)*(10-n);return(r%=11)<2&&t===r||r>=2&&t===11-r},IT:function(e){return 9===e.length&&"CA00000AA"!==e&&e.search(/C[A-Z]\d{5}[A-Z]{2}/i)>-1},NO:function(e){var t=e.trim();if(isNaN(Number(t))||11!==t.length||"00000000000"===t)return!1;var r=t.split("").map(Number),n=(11-(3*r[0]+7*r[1]+6*r[2]+ +r[3]+8*r[4]+9*r[5]+4*r[6]+5*r[7]+2*r[8])%11)%11,o=(11-(5*r[0]+4*r[1]+3*r[2]+2*r[3]+7*r[4]+6*r[5]+5*r[6]+4*r[7]+3*r[8]+2*n)%11)%11;return n===r[9]&&o===r[10]},TH:function(e){if(!e.match(/^[1-8]\d{12}$/))return!1;for(var t=0,r=0;r<12;r++)t+=parseInt(e[r],10)*(13-r);return e[12]===((11-t%11)%10).toString()},LK:function(e){var t=/^[1-9]\d{8}[vx]$/i,r=/^[1-9]\d{11}$/i;return!!(10===e.length&&t.test(e))||!!(12===e.length&&r.test(e))},"he-IL":function(e){var t=/^\d{9}$/,r=e.trim();if(!t.test(r))return!1;for(var n,o=r,i=0,a=0;a9?n-9:n;return i%10==0},"ar-LY":function(e){return!!/^(1|2)\d{11}$/.test(e.trim())},"ar-TN":function(e){return!!/^\d{8}$/.test(e.trim())},"zh-CN":function(e){var t=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],r=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],n=["1","0","X","9","8","7","6","5","4","3","2"],o=function(e){return t.includes(e)},i=function(e){var t=parseInt(e.substring(0,4),10),r=parseInt(e.substring(4,6),10),n=parseInt(e.substring(6),10),o=new Date(t,r-1,n);if(o>new Date);else if(o.getFullYear()===t&&o.getMonth()===r-1&&o.getDate()===n)return!0;return!1},a=function(e){for(var t=e.substring(0,17),o=0,i=0;i<17;i++)o+=parseInt(t.charAt(i),10)*parseInt(r[i],10);return n[o%11]},s=function(e){return a(e)===e.charAt(17).toUpperCase()},l=function(e){var t=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(e);return!!t&&!!(t=o(e.substring(0,2)))&&!!(t=i("19".concat(e.substring(6,12))))},u=function(e){var t=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(e);return!!t&&!!(t=o(e.substring(0,2)))&&!!(t=i(e.substring(6,14)))&&s(e)};return function(e){return!!/^\d{15}|(\d{17}(\d|x|X))$/.test(e)&&(15===e.length?l(e):u(e))}(e)},"zh-HK":function(e){e=e.trim();var t,r=/^[0-9]$/;if(!/^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/.test(e=e.toUpperCase()))return!1;8===(e=e.replace(/\[|\]|\(|\)/g,"")).length&&(e="3".concat(e));for(var n=0,o=0;o<=7;o++){var i=void 0;n+=(i=r.test(e[o])?e[o]:(e[o].charCodeAt(0)-55)%11)*(9-o)}return n%=11,(t=0===n?"0":1===n?"A":String(11-n))===e[e.length-1]},"zh-TW":function(e){var t={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},r=e.trim().toUpperCase();return!!/^[A-Z][0-9]{9}$/.test(r)&&Array.from(r).reduce(function(e,r,n){if(0===n){var o=t[r];return o%10*9+Math.floor(o/10)}return 9===n?(10-e%10-Number(r))%10==0:e+Number(r)*(9-n)},0)}};function s(e,t){if((0,n.default)(e),t in a)return a[t](e);if("any"===t){for(var r in a)if(a.hasOwnProperty(r)&&(0,a[r])(e))return!0;return!1}throw Error("Invalid locale '".concat(t,"'"))}e.exports=t.default,e.exports.default=t.default},20970:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(84409));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return(0,n.default)(e,{allow_leading_zeroes:!1,min:0,max:65535})}e.exports=t.default,e.exports.default=t.default},21093:(e,t,r)=>{"use strict";var n,o=r(83639),i=r(27654);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!n&&i&&i(Object.prototype,"__proto__"),s=Object,l=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof l&&function(e){return l(null==e?e:s(e))}},21175:(e,t,r)=>{var n=r(51642).Buffer;e.exports=function(e){return"string"==typeof e?e:"number"==typeof e||n.isBuffer(e)?e.toString():JSON.stringify(e)}},21508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};function a(e,t){return(0,n.default)(e),new RegExp("^[a-fA-F0-9]{".concat(i[t],"}$")).test(e)}e.exports=t.default,e.exports.default=t.default},21667:(e,t,r)=>{"use strict";var n=r(24813),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=function(e,t,r){for(var n=0,o=e.length;n=3&&(o=r),u(e)?a(e,t,o):"string"==typeof e?s(e,t,o):l(e,t,o)}},21988:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.farsiLocales=t.englishLocales=t.dotDecimal=t.decimal=t.commaDecimal=t.bengaliLocales=t.arabicLocales=t.alphanumeric=t.alpha=void 0;for(var r,n=t.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"kk-KZ":/^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ko-KR":/^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/},o=t.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"kk-KZ":/^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ko-KR":/^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/},i=t.decimal={"en-US":".",ar:"٫"},a=t.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"],s=0;s{"use strict";let n=r(26829);e.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}},23582:e=>{var t="/";!function(){var r={229:function(e){var t,r,n,o=e.exports={};function i(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}function l(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u=[],c=!1,d=-1;function f(){c&&n&&(c=!1,n.length?u=n.concat(u):d=-1,u.length&&p())}function p(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(n=u,u=[];++d1)for(var r=1;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(r(79922)),o=i(r(4427));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return(0,n.default)(e),(0,o.default)(e)&&24===e.length}e.exports=t.default,e.exports.default=t.default},24813:e=>{"use strict";var t,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o(function(){throw 42},null,t)}catch(e){e!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(e){try{var t=n.call(e);return i.test(t)}catch(e){return!1}},s=function(e){try{if(a(e))return!1;return n.call(e),!0}catch(e){return!1}},l=Object.prototype.toString,u="[object Object]",c="[object Function]",d="[object GeneratorFunction]",f="[object HTMLAllCollection]",p="[object HTML document.all class]",h="[object HTMLCollection]",m="function"==typeof Symbol&&!!Symbol.toStringTag,g=!(0 in[,]),y=function(){return!1};if("object"==typeof document){var v=document.all;l.call(v)===l.call(document.all)&&(y=function(e){if((g||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return(t===f||t===p||t===h||t===u)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(y(e))return!0;if(!e||"function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(y(e))return!0;if(!e||"function"!=typeof e&&"object"!=typeof e)return!1;if(m)return s(e);if(a(e))return!1;var t=l.call(e);return(t===c||t===d||!!/^\[object HTML/.test(t))&&s(e)}},25247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a,t.halfWidth=void 0;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=t.halfWidth=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function a(e){return(0,n.default)(e),i.test(e)}},26189:(e,t,r)=>{"use strict";let n=r(77721);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},26433:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",a="(".concat(i,"[.]){3}").concat(i),s=new RegExp("^".concat(a,"$")),l="(?:[0-9a-fA-F]{1,4})",u=RegExp("^("+"(?:".concat(l,":){7}(?:").concat(l,"|:)|")+"(?:".concat(l,":){6}(?:").concat(a,"|:").concat(l,"|:)|")+"(?:".concat(l,":){5}(?::").concat(a,"|(:").concat(l,"){1,2}|:)|")+"(?:".concat(l,":){4}(?:(:").concat(l,"){0,1}:").concat(a,"|(:").concat(l,"){1,3}|:)|")+"(?:".concat(l,":){3}(?:(:").concat(l,"){0,2}:").concat(a,"|(:").concat(l,"){1,4}|:)|")+"(?:".concat(l,":){2}(?:(:").concat(l,"){0,3}:").concat(a,"|(:").concat(l,"){1,5}|:)|")+"(?:".concat(l,":){1}(?:(:").concat(l,"){0,4}:").concat(a,"|(:").concat(l,"){1,6}|:)|")+"(?::((?::".concat(l,"){0,5}:").concat(a,"|(?::").concat(l,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return((0,n.default)(e),t=String(t))?"4"===t?s.test(e):"6"===t&&u.test(e):c(e,4)||c(e,6)}e.exports=t.default,e.exports.default=t.default},26572:(e,t,r)=>{"use strict";var n=r(14274),o=r(57379),i=r(95605);e.exports=function(){return i(n,o,arguments)}},26739:(e,t,r)=>{var n;let{createId:o,init:i,getConstants:a,isCuid:s}=r(65382);e.exports.sX=o,n=i,n=a,n=s},26829:(e,t,r)=>{"use strict";let n=r(77721);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},26882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t=Math.floor(d)&&m=Math.floor(f)}else{var g=0,y=0,v=0;if(o.getBoundingClientRect&&(v=o.getBoundingClientRect().top),!s||e.props.isDynamic){if(!(s=r.get(a)))return;var b=s.getBoundingClientRect();y=(g=b.top-v+n)+b.height}var _=n-e.props.offset;l=_>=Math.floor(g)&&_=Math.floor(y)}var $=r.getActiveLink();if(c){if(a===$&&r.setActiveLink(void 0),e.props.hashSpy&&u.default.getHash()===a){var w=e.props.saveHashHistory,S=void 0!==w&&w;u.default.changeHash("",S)}e.props.spy&&e.state.active&&(e.setState({active:!1}),e.props.onSetInactive&&e.props.onSetInactive(a,s))}if(l&&($!==a||!1===e.state.active)){r.setActiveLink(a);var E=e.props.saveHashHistory,x=void 0!==E&&E;e.props.hashSpy&&u.default.changeHash(a,x),e.props.spy&&(e.setState({active:!0}),e.props.onSetActive&&e.props.onSetActive(a,s))}}}};return l.propTypes=h,l.defaultProps={offset:0},l}},27654:(e,t,r)=>{"use strict";var n=r(31652);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},27721:(e,t,r)=>{"use strict";var n=r(47684);e.exports=function(){return n()&&!!Symbol.toStringTag}},27896:(e,t,r)=>{"use strict";r.d(t,{P:()=>f});var n=r(57407),o=r(14287),i=r(38483),a=r(6663),s=e=>{var t,r;return null==e?void 0:{deepseek:{promptCacheHitTokens:null!=(t=e.prompt_cache_hit_tokens)?t:NaN,promptCacheMissTokens:null!=(r=e.prompt_cache_miss_tokens)?r:NaN}}},l={extractMetadata:({parsedBody:e})=>{let t=(0,i.ZZ)({value:e,schema:c});return t.success&&null!=t.value.usage?s(t.value.usage):void 0},createStreamExtractor:()=>{let e;return{processChunk:t=>{var r,n;let o=(0,i.ZZ)({value:t,schema:d});o.success&&(null==(n=null==(r=o.value.choices)?void 0:r[0])?void 0:n.finish_reason)==="stop"&&o.value.usage&&(e=o.value.usage)},buildMetadata:()=>s(e)}}},u=a.Ik({prompt_cache_hit_tokens:a.ai().nullish(),prompt_cache_miss_tokens:a.ai().nullish()}),c=a.Ik({usage:u.nullish()}),d=a.Ik({choices:a.YO(a.Ik({finish_reason:a.Yj().nullish()})).nullish(),usage:u.nullish()});function f(e={}){var t;let r=(0,i.ae)(null!=(t=e.baseURL)?t:"https://api.deepseek.com/v1"),a=()=>({Authorization:`Bearer ${(0,i.WL)({apiKey:e.apiKey,environmentVariableName:"DEEPSEEK_API_KEY",description:"DeepSeek API key"})}`,...e.headers}),s=(t,o={})=>new n.Ey(t,o,{provider:"deepseek.chat",url:({path:e})=>`${r}${e}`,headers:a,fetch:e.fetch,defaultObjectGenerationMode:"json",metadataExtractor:l}),u=(e,t)=>s(e,t);return u.languageModel=s,u.chat=s,u.textEmbeddingModel=e=>{throw new o.eM({modelId:e,modelType:"textEmbeddingModel"})},u}f()},28160:(e,t,r)=>{"use strict";var n=r(3194),o=r(69497),i=r(72206),a=r(27654);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],d=!!a&&a(e,t);if(n)n(e,t,{configurable:null===u&&d?d.configurable:!u,enumerable:null===s&&d?d.enumerable:!s,value:r,writable:null===l&&d?d.writable:!l});else if(!c&&(s||l||u))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else e[t]=r}},29203:(e,t)=>{"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default,e.exports.default=t.default},29349:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=i(r(79922)),o=i(r(29203));function i(e){return e&&e.__esModule?e:{default:e}}var a={ignore_whitespace:!1};function s(e,t){return(0,n.default)(e),((t=(0,o.default)(t,a)).ignore_whitespace?e.trim().length:e.length)===0}e.exports=t.default,e.exports.default=t.default},29427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a,t.locales=void 0;var n=i(r(79922)),o=r(21988);function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,n.default)(e);var i=e,a=r.ignore;if(a)if(a instanceof RegExp)i=i.replace(a,"");else if("string"==typeof a)i=i.replace(RegExp("[".concat(a.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw Error("ignore should be instance of a String or RegExp");if(t in o.alphanumeric)return o.alphanumeric[t].test(i);throw Error("Invalid locale '".concat(t,"'"))}t.locales=Object.keys(o.alphanumeric)},29486:(e,t,r)=>{"use strict";var n=r(51642).Buffer;let o=void 0!==n,i=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,a=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function s(e,t,r){null==r&&null!==t&&"object"==typeof t&&(r=t,t=void 0),o&&n.isBuffer(e)&&(e=e.toString()),e&&65279===e.charCodeAt(0)&&(e=e.slice(1));let s=JSON.parse(e,t);if(null===s||"object"!=typeof s)return s;let u=r&&r.protoAction||"error",c=r&&r.constructorAction||"error";if("ignore"===u&&"ignore"===c)return s;if("ignore"!==u&&"ignore"!==c){if(!1===i.test(e)&&!1===a.test(e))return s}else if("ignore"!==u&&"ignore"===c){if(!1===i.test(e))return s}else if(!1===a.test(e))return s;return l(s,{protoAction:u,constructorAction:c,safe:r&&r.safe})}function l(e,{protoAction:t="error",constructorAction:r="error",safe:n}={}){let o=[e];for(;o.length;){let e=o;for(let i of(o=[],e)){if("ignore"!==t&&Object.prototype.hasOwnProperty.call(i,"__proto__")){if(!0===n)return null;if("error"===t)throw SyntaxError("Object contains forbidden prototype property");delete i.__proto__}if("ignore"!==r&&Object.prototype.hasOwnProperty.call(i,"constructor")&&Object.prototype.hasOwnProperty.call(i.constructor,"prototype")){if(!0===n)return null;if("error"===r)throw SyntaxError("Object contains forbidden prototype property");delete i.constructor}for(let e in i){let t=i[e];t&&"object"==typeof t&&o.push(t)}}}return e}function u(e,t,r){let n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return s(e,t,r)}finally{Error.stackTraceLimit=n}}function c(e,t){let r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return s(e,t,{safe:!0})}catch(e){return null}finally{Error.stackTraceLimit=r}}e.exports=u,e.exports.default=u,e.exports.parse=u,e.exports.safeParse=c,e.exports.scan=l},29628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return(0,n.default)(e),e.replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(///g,"/").replace(/\/g,"\\").replace(/`/g,"`").replace(/&/g,"&")}e.exports=t.default,e.exports.default=t.default},29911:(e,t,r)=>{"use strict";let n=r(26829);e.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},30366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,a=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,s=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/,l=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;function u(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return((0,n.default)(e),t)?i.test(e)||a.test(e)||s.test(e)||l.test(e):i.test(e)||a.test(e)}e.exports=t.default,e.exports.default=t.default},30629:(e,t,r)=>{"use strict";var n=r(48033),o=r(86357),i=r(44050),a=r(84173);function s(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,c=s(Object.prototype.toString),d=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(l)var h=s(BigInt.prototype.valueOf);if(u)var m=s(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===c(e)}function v(e){return"[object Set]"===c(e)}function b(e){return"[object WeakMap]"===c(e)}function _(e){return"[object WeakSet]"===c(e)}function $(e){return"[object ArrayBuffer]"===c(e)}function w(e){return"undefined"!=typeof ArrayBuffer&&($.working?$(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===c(e)}function E(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||E(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},_.working="undefined"!=typeof WeakSet&&_(new WeakSet),t.isWeakSet=function(e){return _(e)},$.working="undefined"!=typeof ArrayBuffer&&$(new ArrayBuffer),t.isArrayBuffer=w,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=E;var x="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(e){return"[object SharedArrayBuffer]"===c(e)}function O(e){return void 0!==x&&(void 0===A.working&&(A.working=A(new x)),A.working?A(e):e instanceof x)}function k(e){return g(e,d)}function I(e){return g(e,f)}function C(e){return g(e,p)}function T(e){return l&&g(e,h)}function P(e){return u&&g(e,m)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===c(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===c(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===c(e)},t.isGeneratorObject=function(e){return"[object Generator]"===c(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===c(e)},t.isNumberObject=k,t.isStringObject=I,t.isBooleanObject=C,t.isBigIntObject=T,t.isSymbolObject=P,t.isBoxedPrimitive=function(e){return k(e)||I(e)||C(e)||T(e)||P(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(w(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw Error(e+" is not supported in userland")}})})},31652:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},31838:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,l=(1<>1,c=-7,d=r?o-1:0,f=r?-1:1,p=e[t+d];for(d+=f,i=p&(1<<-c)-1,p>>=-c,c+=s;c>0;i=256*i+e[t+d],d+=f,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+d],d+=f,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=u}return(p?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,l,u=8*i-o-1,c=(1<>1,f=5960464477539062e-23*(23===o),p=n?0:i-1,h=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(a++,l/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[r+p]=255&s,p+=h,s/=256,o-=8);for(a=a<0;e[r+p]=255&a,p+=h,a/=256,u-=8);e[r+p-h]|=128*m}},32138:(e,t,r)=>{"use strict";let n=r(77721);e.exports=(e,t,r,o,i)=>{"string"==typeof r&&(i=o,o=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,o,i).version}catch(e){return null}}},32539:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a,t.fullWidth=void 0;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=t.fullWidth=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function a(e){return(0,n.default)(e),i.test(e)}},32942:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(73909));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=(null==t?void 0:t.comparisonDate)||t||Date().toString(),o=(0,n.default)(r),i=(0,n.default)(e);return!!(i&&o&&i>o)}e.exports=t.default,e.exports.default=t.default},32988:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{"use strict";var n,o;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(o=r.g.process)?void 0:o.env)?r.g.process:r(23582)},33923:e=>{"use strict";e.exports=Math.abs},34200:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a,t.locales=void 0;var n=i(r(79922)),o=r(21988);function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,n.default)(e);var i=e,a=r.ignore;if(a)if(a instanceof RegExp)i=i.replace(a,"");else if("string"==typeof a)i=i.replace(RegExp("[".concat(a.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw Error("ignore should be instance of a String or RegExp");if(t in o.alpha)return o.alpha[t].test(i);throw Error("Invalid locale '".concat(t,"'"))}t.locales=Object.keys(o.alpha)},34289:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4264);t.ResizeObserverEntry=function(){return function(e){this.target=e,this.contentRect=n.ContentRect(e)}}()},35146:(e,t,r)=>{"use strict";var n=r(3140),o=r(54913),i=r(16526),a=r(80510),s=r(72206),l=n("%WeakMap%",!0),u=o("WeakMap.prototype.get",!0),c=o("WeakMap.prototype.set",!0),d=o("WeakMap.prototype.has",!0),f=o("WeakMap.prototype.delete",!0);e.exports=l?function(){var e,t,r={assert:function(e){if(!r.has(e))throw new s("Side channel does not contain "+i(e))},delete:function(r){if(l&&r&&("object"==typeof r||"function"==typeof r)){if(e)return f(e,r)}else if(a&&t)return t.delete(r);return!1},get:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?u(e,r):t&&t.get(r)},has:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?d(e,r):!!t&&t.has(r)},set:function(r,n){l&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new l),c(e,r,n)):a&&(t||(t=a()),t.set(r,n))}};return r}:a},35876:(e,t,r)=>{"use strict";var n=r(51642).Buffer,o=r(51642).SlowBuffer;function i(e,t){if(!n.isBuffer(e)||!n.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,o=0;o{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};function o(e){console&&console.warn&&console.warn(e)}t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=v,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){if(l(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var i,a,s,c=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,o(c)}return e}function d(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=d.bind(n);return o.listener=r,n.wrapFn=o,o}function p(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?y(o):m(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=Array(t),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else for(var u=l.length,c=m(l,u),r=0;r=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():g(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var o,i=Object.keys(r);for(n=0;n=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},36884:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=8,a=14,s=/^(\d{8}|\d{13}|\d{14})$/;function l(e,t){return e===i||e===a?t%2==0?3:1:t%2==0?1:3}function u(e){var t=10-e.slice(0,-1).split("").map(function(t,r){return Number(t)*l(e.length,r)}).reduce(function(e,t){return e+t},0)%10;return t<10?t:0}function c(e){(0,n.default)(e);var t=Number(e.slice(-1));return s.test(e)&&t===u(e)}e.exports=t.default,e.exports.default=t.default},37025:e=>{"use strict";e.exports=Math.max},37304:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^[a-f0-9]{32}$/;function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},37399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;function a(e){if((0,n.default)(e),!i.test(e))return!1;for(var t=!0,r=0,o=e.length-2;o>=0;o--)if(e[o]>="A"&&e[o]<="Z")for(var a=e[o].charCodeAt(0)-55,s=a%10,l=Math.trunc(a/10),u=0,c=[s,l];u=5?r+=1+(d-5)*2:r+=2*d:r+=d,t=!t}else{var f=e[o].charCodeAt(0)-48;t?f>=5?r+=1+(f-5)*2:r+=2*f:r+=f,t=!t}var p=10*Math.trunc((r+9)/10)-r;return+e[e.length-1]===p}e.exports=t.default,e.exports.default=t.default},37599:(e,t,r)=>{"use strict";let n=r(38278);e.exports=(e,t,r)=>n(e,t,"<",r)},38123:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},38164:(e,t,r)=>{"use strict";let n=r(2316);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},38238:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var n=i(r(29203)),o=i(r(79922));function i(e){return e&&e.__esModule?e:{default:e}}var a=/^[A-Z]$/,s=/^[a-z]$/,l=/^[0-9]$/,u=/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/,c={minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1,returnScore:!1,pointsPerUnique:1,pointsPerRepeat:.5,pointsForContainingLower:10,pointsForContainingUpper:10,pointsForContainingNumber:10,pointsForContainingSymbol:10};function d(e){var t={};return Array.from(e).forEach(function(e){t[e]?t[e]+=1:t[e]=1}),t}function f(e){var t=d(e),r={length:e.length,uniqueChars:Object.keys(t).length,uppercaseCount:0,lowercaseCount:0,numberCount:0,symbolCount:0};return Object.keys(t).forEach(function(e){a.test(e)?r.uppercaseCount+=t[e]:s.test(e)?r.lowercaseCount+=t[e]:l.test(e)?r.numberCount+=t[e]:u.test(e)&&(r.symbolCount+=t[e])}),r}function p(e,t){var r;return r=0+e.uniqueChars*t.pointsPerUnique+(e.length-e.uniqueChars)*t.pointsPerRepeat,e.lowercaseCount>0&&(r+=t.pointsForContainingLower),e.uppercaseCount>0&&(r+=t.pointsForContainingUpper),e.numberCount>0&&(r+=t.pointsForContainingNumber),e.symbolCount>0&&(r+=t.pointsForContainingSymbol),r}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;(0,o.default)(e);var r=f(e);return(t=(0,n.default)(t||{},c)).returnScore?p(r,t):r.length>=t.minLength&&r.lowercaseCount>=t.minLowercase&&r.uppercaseCount>=t.minUppercase&&r.numberCount>=t.minNumbers&&r.symbolCount>=t.minSymbols}e.exports=t.default,e.exports.default=t.default},38278:(e,t,r)=>{"use strict";let n=r(77721),o=r(50141),{ANY:i}=o,a=r(5074),s=r(8759),l=r(44689),u=r(91526),c=r(72925),d=r(50736);e.exports=(e,t,r,f)=>{let p,h,m,g,y;switch(e=new n(e,f),t=new a(t,f),r){case">":p=l,h=c,m=u,g=">",y=">=";break;case"<":p=u,h=d,m=l,g="<",y="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,f))return!1;for(let r=0;r{e.semver===i&&(e=new o(">=0.0.0")),a=a||e,s=s||e,p(e.semver,a.semver,f)?a=e:m(e.semver,s.semver,f)&&(s=e)}),a.operator===g||a.operator===y||(!s.operator||s.operator===g)&&h(e,s.semver)||s.operator===y&&m(e,s.semver))return!1}return!0}},38483:(e,t,r)=>{"use strict";r.d(t,{$C:()=>h,Ds:()=>M,GU:()=>T,HD:()=>D,N8:()=>O,NR:()=>l,S:()=>P,WL:()=>v,Z9:()=>U,ZZ:()=>x,ae:()=>Y,cV:()=>L,cb:()=>u,eu:()=>b,hK:()=>p,hd:()=>j,m2:()=>s,n_:()=>Z,sl:()=>N,u1:()=>m,v0:()=>k,xI:()=>I,zf:()=>y});var n=r(14287),o=r(55247),i=r(29486),a=r(33601);function s(...e){return e.reduce((e,t)=>({...e,...null!=t?t:{}}),{})}function l(e){return new ReadableStream({async pull(t){try{let{value:r,done:n}=await e.next();n?t.close():t.enqueue(r)}catch(e){t.error(e)}},cancel(){}})}async function u(e){return null==e?Promise.resolve():new Promise(t=>setTimeout(t,e))}function c(){let e,t,r,n="",o=[];function i(e,t){if(""===e)return void a(t);if(e.startsWith(":"))return;let r=e.indexOf(":");if(-1===r)return void s(e,"");let n=e.slice(0,r),o=r+1;s(n,o0&&(n.enqueue({event:e,data:o.join("\n"),id:t,retry:r}),o=[],e=void 0,r=void 0)}function s(n,i){switch(n){case"event":e=i;break;case"data":o.push(i);break;case"id":t=i;break;case"retry":let a=parseInt(i,10);isNaN(a)||(r=a)}}return new TransformStream({transform(e,t){let{lines:r,incompleteLine:o}=d(n,e);n=o;for(let e=0;e{t[r]=e}),t}var p=({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:i="-"}={})=>{let a=(0,o.d)(r,t);if(null==e)return a;if(r.includes(i))throw new n.Di({argument:"separator",message:`The separator "${i}" must not be part of the alphabet "${r}".`});return t=>`${e}${i}${a(t)}`},h=p();function m(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}function g(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>null!=t))}function y(e){return e instanceof Error&&("AbortError"===e.name||"TimeoutError"===e.name)}function v({apiKey:e,environmentVariableName:t,apiKeyParameterName:r="apiKey",description:o}){if("string"==typeof e)return e;if(null!=e)throw new n.Kq({message:`${o} API key must be a string.`});if(void 0===a)throw new n.Kq({message:`${o} API key is missing. Pass it using the '${r}' parameter. Environment variables is not supported in this environment.`});if(null==(e=a.env[t]))throw new n.Kq({message:`${o} API key is missing. Pass it using the '${r}' parameter or the ${t} environment variable.`});if("string"!=typeof e)throw new n.Kq({message:`${o} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}var b=Symbol.for("vercel.ai.validator");function _(e){return{[b]:!0,validate:e}}function $(e){return"object"==typeof e&&null!==e&&b in e&&!0===e[b]&&"validate"in e}function w(e){return $(e)?e:S(e)}function S(e){return _(t=>{let r=e.safeParse(t);return r.success?{success:!0,value:r.data}:{success:!1,error:r.error}})}function E({value:e,schema:t}){let r=x({value:e,schema:t});if(!r.success)throw n.iM.wrap({value:e,cause:r.error});return r.value}function x({value:e,schema:t}){let r=w(t);try{if(null==r.validate)return{success:!0,value:e};let t=r.validate(e);if(t.success)return t;return{success:!1,error:n.iM.wrap({value:e,cause:t.error})}}catch(t){return{success:!1,error:n.iM.wrap({value:e,cause:t})}}}function A({text:e,schema:t}){try{let r=i.parse(e);if(null==t)return r;return E({value:r,schema:t})}catch(t){if(n.u6.isInstance(t)||n.iM.isInstance(t))throw t;throw new n.u6({text:e,cause:t})}}function O({text:e,schema:t}){try{let r=i.parse(e);if(null==t)return{success:!0,value:r,rawValue:r};let n=x({value:r,schema:t});return n.success?{...n,rawValue:r}:n}catch(t){return{success:!1,error:n.u6.isInstance(t)?t:new n.u6({text:e,cause:t})}}}function k(e){try{return i.parse(e),!0}catch(e){return!1}}function I({provider:e,providerOptions:t,schema:r}){if((null==t?void 0:t[e])==null)return;let o=x({value:t[e],schema:r});if(!o.success)throw new n.Di({argument:"providerOptions",message:`invalid ${e} provider options`,cause:o.error});return o.value}var C=()=>globalThis.fetch,T=async({url:e,headers:t,body:r,failedResponseHandler:n,successfulResponseHandler:o,abortSignal:i,fetch:a})=>R({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(r),values:r},failedResponseHandler:n,successfulResponseHandler:o,abortSignal:i,fetch:a}),P=async({url:e,headers:t,formData:r,failedResponseHandler:n,successfulResponseHandler:o,abortSignal:i,fetch:a})=>R({url:e,headers:t,body:{content:r,values:Object.fromEntries(r.entries())},failedResponseHandler:n,successfulResponseHandler:o,abortSignal:i,fetch:a}),R=async({url:e,headers:t={},body:r,successfulResponseHandler:o,failedResponseHandler:i,abortSignal:a,fetch:s=C()})=>{try{let l=await s(e,{method:"POST",headers:g(t),body:r.content,signal:a}),u=f(l);if(!l.ok){let t;try{t=await i({response:l,url:e,requestBodyValues:r.values})}catch(t){if(y(t)||n.hL.isInstance(t))throw t;throw new n.hL({message:"Failed to process error response",cause:t,statusCode:l.status,url:e,responseHeaders:u,requestBodyValues:r.values})}throw t.value}try{return await o({response:l,url:e,requestBodyValues:r.values})}catch(t){if(t instanceof Error&&(y(t)||n.hL.isInstance(t)))throw t;throw new n.hL({message:"Failed to process successful response",cause:t,statusCode:l.status,url:e,responseHeaders:u,requestBodyValues:r.values})}}catch(t){if(y(t))throw t;if(t instanceof TypeError&&"fetch failed"===t.message){let o=t.cause;if(null!=o)throw new n.hL({message:`Cannot connect to API: ${o.message}`,cause:o,url:e,requestBodyValues:r.values,isRetryable:!0})}throw t}};async function j(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var N=({errorSchema:e,errorToMessage:t,isRetryable:r})=>async({response:o,url:i,requestBodyValues:a})=>{let s=await o.text(),l=f(o);if(""===s.trim())return{responseHeaders:l,value:new n.hL({message:o.statusText,url:i,requestBodyValues:a,statusCode:o.status,responseHeaders:l,responseBody:s,isRetryable:null==r?void 0:r(o)})};try{let u=A({text:s,schema:e});return{responseHeaders:l,value:new n.hL({message:t(u),url:i,requestBodyValues:a,statusCode:o.status,responseHeaders:l,responseBody:s,data:u,isRetryable:null==r?void 0:r(o,u)})}}catch(e){return{responseHeaders:l,value:new n.hL({message:o.statusText,url:i,requestBodyValues:a,statusCode:o.status,responseHeaders:l,responseBody:s,isRetryable:null==r?void 0:r(o)})}}},M=e=>async({response:t})=>{let r=f(t);if(null==t.body)throw new n.Tt({});return{responseHeaders:r,value:t.body.pipeThrough(new TextDecoderStream).pipeThrough(c()).pipeThrough(new TransformStream({transform({data:t},r){"[DONE]"!==t&&r.enqueue(O({text:t,schema:e}))}}))}},L=e=>async({response:t,url:r,requestBodyValues:o})=>{let i=await t.text(),a=O({text:i,schema:e}),s=f(t);if(!a.success)throw new n.hL({message:"Invalid JSON response",cause:a.error,statusCode:t.status,responseHeaders:s,responseBody:i,url:r,requestBodyValues:o});return{responseHeaders:s,value:a.value,rawValue:a.rawValue}},D=()=>async({response:e,url:t,requestBodyValues:r})=>{let o=f(e);if(!e.body)throw new n.hL({message:"Response body is empty",url:t,requestBodyValues:r,statusCode:e.status,responseHeaders:o,responseBody:void 0});try{let t=await e.arrayBuffer();return{responseHeaders:o,value:new Uint8Array(t)}}catch(i){throw new n.hL({message:"Failed to read response as array buffer",url:t,requestBodyValues:r,statusCode:e.status,responseHeaders:o,responseBody:void 0,cause:i})}},{btoa:B,atob:F}=globalThis;function U(e){let t=F(e.replace(/-/g,"+").replace(/_/g,"/"));return Uint8Array.from(t,e=>e.codePointAt(0))}function Z(e){let t="";for(let r=0;r{"use strict";r.d(t,{A:()=>A});var n=r(99410),o=r(1983),i=r(38985);function a(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function s(e,t){e.classList?e.classList.add(t):a(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function l(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function u(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=l(e.className,t):e.setAttribute("class",l(e.className&&e.className.baseVal||"",t))}var c=r(55729),d=r(56760);let f={disabled:!1};var p=r(5440),h=function(e){return e.scrollTop},m="unmounted",g="exited",y="entering",v="entered",b="exiting",_=function(e){function t(t,r){var n,o=e.call(this,t,r)||this,i=r,a=i&&!i.isMounting?t.enter:t.appear;return o.appearStatus=null,t.in?a?(n=g,o.appearStatus=y):n=v:n=t.unmountOnExit||t.mountOnEnter?m:g,o.state={status:n},o.nextCallback=null,o}(0,i.A)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===m?{status:g}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==y&&r!==v&&(t=y):(r===y||r===v)&&(t=b)}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},r.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===y){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:d.findDOMNode(this);r&&h(r)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===g&&this.setState({status:m})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,o=this.props.nodeRef?[n]:[d.findDOMNode(this),n],i=o[0],a=o[1],s=this.getTimeouts(),l=n?s.appear:s.enter;if(!e&&!r||f.disabled)return void this.safeSetState({status:v},function(){t.props.onEntered(i)});this.props.onEnter(i,a),this.safeSetState({status:y},function(){t.props.onEntering(i,a),t.onTransitionEnd(l,function(){t.safeSetState({status:v},function(){t.props.onEntered(i,a)})})})},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:d.findDOMNode(this);if(!t||f.disabled)return void this.safeSetState({status:g},function(){e.props.onExited(n)});this.props.onExit(n),this.safeSetState({status:b},function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,function(){e.safeSetState({status:g},function(){e.props.onExited(n)})})})},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:d.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(!r||n)return void setTimeout(this.nextCallback,0);if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)},r.render=function(){var e=this.state.status;if(e===m)return null;var t=this.props,r=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,(0,o.A)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return c.createElement(p.A.Provider,{value:null},"function"==typeof r?r(e,n):c.cloneElement(c.Children.only(r),n))},t}(c.Component);function $(){}_.contextType=p.A,_.propTypes={},_.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:$,onEntering:$,onEntered:$,onExit:$,onExiting:$,onExited:$},_.UNMOUNTED=m,_.EXITED=g,_.ENTERING=y,_.ENTERED=v,_.EXITING=b;let w=_;var S=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return s(e,t)})},E=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return u(e,t)})},x=function(e){function t(){for(var t,r=arguments.length,n=Array(r),o=0;o{"use strict";var n=r(88700),o=r(18598);e.exports={formats:r(57693),parse:o,stringify:n}},38985:(e,t,r)=>{"use strict";function n(e,t){return(n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}r.d(t,{A:()=>o})},39070:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(r(79922)),o=i(r(26433));function i(e){return e&&e.__esModule?e:{default:e}}var a=/^\d{1,3}$/,s=32,l=128;function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,n.default)(e);var r=e.split("/");if(2!==r.length||!a.test(r[1])||r[1].length>1&&r[1].startsWith("0")||!(0,o.default)(r[0],t))return!1;var i=null;switch(String(t)){case"4":i=s;break;case"6":i=l;break;default:i=(0,o.default)(r[0],"6")?l:s}return r[1]<=i&&r[1]>=0}e.exports=t.default,e.exports.default=t.default},41167:e=>{"use strict";e.exports=Math.round},41467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=i(r(79922)),o=i(r(89089));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if((0,n.default)(e),"[object Array]"===Object.prototype.toString.call(t)){var r,i=[];for(r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=(0,o.default)(t[r]));return i.indexOf(e)>=0}return"object"===a(t)?t.hasOwnProperty(e):!!t&&"function"==typeof t.indexOf&&t.indexOf(e)>=0}e.exports=t.default,e.exports.default=t.default},41556:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){(0,n.default)(e);for(var r=e.length-1;r>=0;r--)if(-1===t.indexOf(e[r]))return!1;return!0}e.exports=t.default,e.exports.default=t.default},41605:e=>{"use strict";e.exports=Math.pow},41670:(e,t,r)=>{"use strict";let n=r(26189);e.exports=(e,t)=>n(e,t,!0)},41880:(e,t,r)=>{"use strict";r.d(t,{r:()=>ef});var n=r(38483),o=r(14287),i=r(6663);function a({prompt:e,useLegacyFunctionCalling:t=!1,systemMessageMode:r="system"}){let i=[],a=[];for(let{role:s,content:l}of e)switch(s){case"system":switch(r){case"system":i.push({role:"system",content:l});break;case"developer":i.push({role:"developer",content:l});break;case"remove":a.push({type:"other",message:"system messages are removed for this model"});break;default:{let e=r;throw Error(`Unsupported system message mode: ${e}`)}}break;case"user":if(1===l.length&&"text"===l[0].type){i.push({role:"user",content:l[0].text});break}i.push({role:"user",content:l.map((e,t)=>{var r,i,a,s;switch(e.type){case"text":return{type:"text",text:e.text};case"image":return{type:"image_url",image_url:{url:e.image instanceof URL?e.image.toString():`data:${null!=(r=e.mimeType)?r:"image/jpeg"};base64,${(0,n.n_)(e.image)}`,detail:null==(a=null==(i=e.providerMetadata)?void 0:i.openai)?void 0:a.imageDetail}};case"file":if(e.data instanceof URL)throw new o.b8({functionality:"'File content parts with URL data' functionality not supported."});switch(e.mimeType){case"audio/wav":return{type:"input_audio",input_audio:{data:e.data,format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:e.data,format:"mp3"}};case"application/pdf":return{type:"file",file:{filename:null!=(s=e.filename)?s:`part-${t}.pdf`,file_data:`data:application/pdf;base64,${e.data}`}};default:throw new o.b8({functionality:`File content part type ${e.mimeType} in user messages`})}}})});break;case"assistant":{let e="",r=[];for(let t of l)switch(t.type){case"text":e+=t.text;break;case"tool-call":r.push({id:t.toolCallId,type:"function",function:{name:t.toolName,arguments:JSON.stringify(t.args)}})}if(t){if(r.length>1)throw new o.b8({functionality:"useLegacyFunctionCalling with multiple tool calls in one message"});i.push({role:"assistant",content:e,function_call:r.length>0?r[0].function:void 0})}else i.push({role:"assistant",content:e,tool_calls:r.length>0?r:void 0});break}case"tool":for(let e of l)t?i.push({role:"function",name:e.toolName,content:JSON.stringify(e.result)}):i.push({role:"tool",tool_call_id:e.toolCallId,content:JSON.stringify(e.result)});break;default:{let e=s;throw Error(`Unsupported role: ${e}`)}}return{messages:i,warnings:a}}function s(e){var t,r;return null!=(r=null==(t=null==e?void 0:e.content)?void 0:t.map(({token:e,logprob:t,top_logprobs:r})=>({token:e,logprob:t,topLogprobs:r?r.map(({token:e,logprob:t})=>({token:e,logprob:t})):[]})))?r:void 0}function l(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var u=i.Ik({error:i.Ik({message:i.Yj(),type:i.Yj().nullish(),param:i.bz().nullish(),code:i.KC([i.Yj(),i.ai()]).nullish()})}),c=(0,n.sl)({errorSchema:u,errorToMessage:e=>e.error.message});function d({id:e,model:t,created:r}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:null!=r?new Date(1e3*r):void 0}}function f({mode:e,useLegacyFunctionCalling:t=!1,structuredOutputs:r}){var n;let i=(null==(n=e.tools)?void 0:n.length)?e.tools:void 0,a=[];if(null==i)return{tools:void 0,tool_choice:void 0,toolWarnings:a};let s=e.toolChoice;if(t){let e=[];for(let t of i)"provider-defined"===t.type?a.push({type:"unsupported-tool",tool:t}):e.push({name:t.name,description:t.description,parameters:t.parameters});if(null==s)return{functions:e,function_call:void 0,toolWarnings:a};switch(s.type){case"auto":case"none":case void 0:return{functions:e,function_call:void 0,toolWarnings:a};case"required":throw new o.b8({functionality:"useLegacyFunctionCalling and toolChoice: required"});default:return{functions:e,function_call:{name:s.toolName},toolWarnings:a}}}let l=[];for(let e of i)"provider-defined"===e.type?a.push({type:"unsupported-tool",tool:e}):l.push({type:"function",function:{name:e.name,description:e.description,parameters:e.parameters,strict:!!r||void 0}});if(null==s)return{tools:l,tool_choice:void 0,toolWarnings:a};let u=s.type;switch(u){case"auto":case"none":case"required":return{tools:l,tool_choice:u,toolWarnings:a};case"tool":return{tools:l,tool_choice:{type:"function",function:{name:s.toolName}},toolWarnings:a};default:{let e=u;throw new o.b8({functionality:`Unsupported tool choice type: ${e}`})}}}var p=class{constructor(e,t,r){this.specificationVersion="v1",this.modelId=e,this.settings=t,this.config=r}get supportsStructuredOutputs(){var e;return null!=(e=this.settings.structuredOutputs)?e:y(this.modelId)}get defaultObjectGenerationMode(){return v(this.modelId)?"tool":this.supportsStructuredOutputs?"json":"tool"}get provider(){return this.config.provider}get supportsImageUrls(){return!this.settings.downloadImages}getArgs({mode:e,prompt:t,maxTokens:r,temperature:n,topP:i,topK:s,frequencyPenalty:l,presencePenalty:u,stopSequences:c,responseFormat:d,seed:p,providerMetadata:h}){var m,g,v,_,$,w,S,E;let x=e.type,A=[];null!=s&&A.push({type:"unsupported-setting",setting:"topK"}),(null==d?void 0:d.type)!=="json"||null==d.schema||this.supportsStructuredOutputs||A.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let O=this.settings.useLegacyFunctionCalling;if(O&&!0===this.settings.parallelToolCalls)throw new o.b8({functionality:"useLegacyFunctionCalling with parallelToolCalls"});if(O&&this.supportsStructuredOutputs)throw new o.b8({functionality:"structuredOutputs with useLegacyFunctionCalling"});let{messages:k,warnings:I}=a({prompt:t,useLegacyFunctionCalling:O,systemMessageMode:b(this.modelId)});A.push(...I);let C={model:this.modelId,logit_bias:this.settings.logitBias,logprobs:!0===this.settings.logprobs||"number"==typeof this.settings.logprobs||void 0,top_logprobs:"number"==typeof this.settings.logprobs?this.settings.logprobs:"boolean"==typeof this.settings.logprobs&&this.settings.logprobs?0:void 0,user:this.settings.user,parallel_tool_calls:this.settings.parallelToolCalls,max_tokens:r,temperature:n,top_p:i,frequency_penalty:l,presence_penalty:u,response_format:(null==d?void 0:d.type)==="json"?this.supportsStructuredOutputs&&null!=d.schema?{type:"json_schema",json_schema:{schema:d.schema,strict:!0,name:null!=(m=d.name)?m:"response",description:d.description}}:{type:"json_object"}:void 0,stop:c,seed:p,max_completion_tokens:null==(g=null==h?void 0:h.openai)?void 0:g.maxCompletionTokens,store:null==(v=null==h?void 0:h.openai)?void 0:v.store,metadata:null==(_=null==h?void 0:h.openai)?void 0:_.metadata,prediction:null==($=null==h?void 0:h.openai)?void 0:$.prediction,reasoning_effort:null!=(S=null==(w=null==h?void 0:h.openai)?void 0:w.reasoningEffort)?S:this.settings.reasoningEffort,messages:k};switch(y(this.modelId)?(null!=C.temperature&&(C.temperature=void 0,A.push({type:"unsupported-setting",setting:"temperature",details:"temperature is not supported for reasoning models"})),null!=C.top_p&&(C.top_p=void 0,A.push({type:"unsupported-setting",setting:"topP",details:"topP is not supported for reasoning models"})),null!=C.frequency_penalty&&(C.frequency_penalty=void 0,A.push({type:"unsupported-setting",setting:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"})),null!=C.presence_penalty&&(C.presence_penalty=void 0,A.push({type:"unsupported-setting",setting:"presencePenalty",details:"presencePenalty is not supported for reasoning models"})),null!=C.logit_bias&&(C.logit_bias=void 0,A.push({type:"other",message:"logitBias is not supported for reasoning models"})),null!=C.logprobs&&(C.logprobs=void 0,A.push({type:"other",message:"logprobs is not supported for reasoning models"})),null!=C.top_logprobs&&(C.top_logprobs=void 0,A.push({type:"other",message:"topLogprobs is not supported for reasoning models"})),null!=C.max_tokens&&(null==C.max_completion_tokens&&(C.max_completion_tokens=C.max_tokens),C.max_tokens=void 0)):(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview"))&&null!=C.temperature&&(C.temperature=void 0,A.push({type:"unsupported-setting",setting:"temperature",details:"temperature is not supported for the search preview models and has been removed."})),x){case"regular":{let{tools:t,tool_choice:r,functions:n,function_call:o,toolWarnings:i}=f({mode:e,useLegacyFunctionCalling:O,structuredOutputs:this.supportsStructuredOutputs});return{args:{...C,tools:t,tool_choice:r,functions:n,function_call:o},warnings:[...A,...i]}}case"object-json":return{args:{...C,response_format:this.supportsStructuredOutputs&&null!=e.schema?{type:"json_schema",json_schema:{schema:e.schema,strict:!0,name:null!=(E=e.name)?E:"response",description:e.description}}:{type:"json_object"}},warnings:A};case"object-tool":return{args:O?{...C,function_call:{name:e.tool.name},functions:[{name:e.tool.name,description:e.tool.description,parameters:e.tool.parameters}]}:{...C,tool_choice:{type:"function",function:{name:e.tool.name}},tools:[{type:"function",function:{name:e.tool.name,description:e.tool.description,parameters:e.tool.parameters,strict:!!this.supportsStructuredOutputs||void 0}}]},warnings:A};default:{let e=x;throw Error(`Unsupported type: ${e}`)}}}async doGenerate(e){var t,r,o,i,a,u,f,p;let{args:h,warnings:g}=this.getArgs(e),{responseHeaders:y,value:v,rawValue:b}=await (0,n.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,n.m2)(this.config.headers(),e.headers),body:h,failedResponseHandler:c,successfulResponseHandler:(0,n.cV)(m),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:_,...$}=h,w=v.choices[0],S=null==(t=v.usage)?void 0:t.completion_tokens_details,E=null==(r=v.usage)?void 0:r.prompt_tokens_details,x={openai:{}};return(null==S?void 0:S.reasoning_tokens)!=null&&(x.openai.reasoningTokens=null==S?void 0:S.reasoning_tokens),(null==S?void 0:S.accepted_prediction_tokens)!=null&&(x.openai.acceptedPredictionTokens=null==S?void 0:S.accepted_prediction_tokens),(null==S?void 0:S.rejected_prediction_tokens)!=null&&(x.openai.rejectedPredictionTokens=null==S?void 0:S.rejected_prediction_tokens),(null==E?void 0:E.cached_tokens)!=null&&(x.openai.cachedPromptTokens=null==E?void 0:E.cached_tokens),{text:null!=(o=w.message.content)?o:void 0,toolCalls:this.settings.useLegacyFunctionCalling&&w.message.function_call?[{toolCallType:"function",toolCallId:(0,n.$C)(),toolName:w.message.function_call.name,args:w.message.function_call.arguments}]:null==(i=w.message.tool_calls)?void 0:i.map(e=>{var t;return{toolCallType:"function",toolCallId:null!=(t=e.id)?t:(0,n.$C)(),toolName:e.function.name,args:e.function.arguments}}),finishReason:l(w.finish_reason),usage:{promptTokens:null!=(u=null==(a=v.usage)?void 0:a.prompt_tokens)?u:NaN,completionTokens:null!=(p=null==(f=v.usage)?void 0:f.completion_tokens)?p:NaN},rawCall:{rawPrompt:_,rawSettings:$},rawResponse:{headers:y,body:b},request:{body:JSON.stringify(h)},response:d(v),warnings:g,logprobs:s(w.logprobs),providerMetadata:x}}async doStream(e){let t;if(this.settings.simulateStreaming){let t=await this.doGenerate(e);return{stream:new ReadableStream({start(e){if(e.enqueue({type:"response-metadata",...t.response}),t.text&&e.enqueue({type:"text-delta",textDelta:t.text}),t.toolCalls)for(let r of t.toolCalls)e.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:r.toolCallId,toolName:r.toolName,argsTextDelta:r.args}),e.enqueue({type:"tool-call",...r});e.enqueue({type:"finish",finishReason:t.finishReason,usage:t.usage,logprobs:t.logprobs,providerMetadata:t.providerMetadata}),e.close()}}),rawCall:t.rawCall,rawResponse:t.rawResponse,warnings:t.warnings}}let{args:r,warnings:i}=this.getArgs(e),a={...r,stream:!0,stream_options:"strict"===this.config.compatibility?{include_usage:!0}:void 0},{responseHeaders:u,value:f}=await (0,n.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,n.m2)(this.config.headers(),e.headers),body:a,failedResponseHandler:c,successfulResponseHandler:(0,n.Ds)(g),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:p,...h}=r,m=[],y="unknown",v={promptTokens:void 0,completionTokens:void 0},b=!0,{useLegacyFunctionCalling:_}=this.settings,$={openai:{}};return{stream:f.pipeThrough(new TransformStream({transform(e,r){var i,a,u,c,f,p,h,g,w,S,E,x;if(!e.success){y="error",r.enqueue({type:"error",error:e.error});return}let A=e.value;if("error"in A){y="error",r.enqueue({type:"error",error:A.error});return}if(b&&(b=!1,r.enqueue({type:"response-metadata",...d(A)})),null!=A.usage){let{prompt_tokens:e,completion_tokens:t,prompt_tokens_details:r,completion_tokens_details:n}=A.usage;v={promptTokens:null!=e?e:void 0,completionTokens:null!=t?t:void 0},(null==n?void 0:n.reasoning_tokens)!=null&&($.openai.reasoningTokens=null==n?void 0:n.reasoning_tokens),(null==n?void 0:n.accepted_prediction_tokens)!=null&&($.openai.acceptedPredictionTokens=null==n?void 0:n.accepted_prediction_tokens),(null==n?void 0:n.rejected_prediction_tokens)!=null&&($.openai.rejectedPredictionTokens=null==n?void 0:n.rejected_prediction_tokens),(null==r?void 0:r.cached_tokens)!=null&&($.openai.cachedPromptTokens=null==r?void 0:r.cached_tokens)}let O=A.choices[0];if((null==O?void 0:O.finish_reason)!=null&&(y=l(O.finish_reason)),(null==O?void 0:O.delta)==null)return;let k=O.delta;null!=k.content&&r.enqueue({type:"text-delta",textDelta:k.content});let I=s(null==O?void 0:O.logprobs);(null==I?void 0:I.length)&&(void 0===t&&(t=[]),t.push(...I));let C=_&&null!=k.function_call?[{type:"function",id:(0,n.$C)(),function:k.function_call,index:0}]:k.tool_calls;if(null!=C)for(let e of C){let t=e.index;if(null==m[t]){if("function"!==e.type)throw new o.xn({data:e,message:"Expected 'function' type."});if(null==e.id)throw new o.xn({data:e,message:"Expected 'id' to be a string."});if((null==(i=e.function)?void 0:i.name)==null)throw new o.xn({data:e,message:"Expected 'function.name' to be a string."});m[t]={id:e.id,type:"function",function:{name:e.function.name,arguments:null!=(a=e.function.arguments)?a:""},hasFinished:!1};let s=m[t];(null==(u=s.function)?void 0:u.name)!=null&&(null==(c=s.function)?void 0:c.arguments)!=null&&(s.function.arguments.length>0&&r.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:s.id,toolName:s.function.name,argsTextDelta:s.function.arguments}),(0,n.v0)(s.function.arguments)&&(r.enqueue({type:"tool-call",toolCallType:"function",toolCallId:null!=(f=s.id)?f:(0,n.$C)(),toolName:s.function.name,args:s.function.arguments}),s.hasFinished=!0));continue}let s=m[t];!s.hasFinished&&((null==(p=e.function)?void 0:p.arguments)!=null&&(s.function.arguments+=null!=(g=null==(h=e.function)?void 0:h.arguments)?g:""),r.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:s.id,toolName:s.function.name,argsTextDelta:null!=(w=e.function.arguments)?w:""}),(null==(S=s.function)?void 0:S.name)!=null&&(null==(E=s.function)?void 0:E.arguments)!=null&&(0,n.v0)(s.function.arguments)&&(r.enqueue({type:"tool-call",toolCallType:"function",toolCallId:null!=(x=s.id)?x:(0,n.$C)(),toolName:s.function.name,args:s.function.arguments}),s.hasFinished=!0))}},flush(e){var r,n;e.enqueue({type:"finish",finishReason:y,logprobs:t,usage:{promptTokens:null!=(r=v.promptTokens)?r:NaN,completionTokens:null!=(n=v.completionTokens)?n:NaN},...null!=$?{providerMetadata:$}:{}})}})),rawCall:{rawPrompt:p,rawSettings:h},rawResponse:{headers:u},request:{body:JSON.stringify(a)},warnings:i}}},h=i.Ik({prompt_tokens:i.ai().nullish(),completion_tokens:i.ai().nullish(),prompt_tokens_details:i.Ik({cached_tokens:i.ai().nullish()}).nullish(),completion_tokens_details:i.Ik({reasoning_tokens:i.ai().nullish(),accepted_prediction_tokens:i.ai().nullish(),rejected_prediction_tokens:i.ai().nullish()}).nullish()}).nullish(),m=i.Ik({id:i.Yj().nullish(),created:i.ai().nullish(),model:i.Yj().nullish(),choices:i.YO(i.Ik({message:i.Ik({role:i.eu("assistant").nullish(),content:i.Yj().nullish(),function_call:i.Ik({arguments:i.Yj(),name:i.Yj()}).nullish(),tool_calls:i.YO(i.Ik({id:i.Yj().nullish(),type:i.eu("function"),function:i.Ik({name:i.Yj(),arguments:i.Yj()})})).nullish()}),index:i.ai(),logprobs:i.Ik({content:i.YO(i.Ik({token:i.Yj(),logprob:i.ai(),top_logprobs:i.YO(i.Ik({token:i.Yj(),logprob:i.ai()}))})).nullable()}).nullish(),finish_reason:i.Yj().nullish()})),usage:h}),g=i.KC([i.Ik({id:i.Yj().nullish(),created:i.ai().nullish(),model:i.Yj().nullish(),choices:i.YO(i.Ik({delta:i.Ik({role:i.k5(["assistant"]).nullish(),content:i.Yj().nullish(),function_call:i.Ik({name:i.Yj().optional(),arguments:i.Yj().optional()}).nullish(),tool_calls:i.YO(i.Ik({index:i.ai(),id:i.Yj().nullish(),type:i.eu("function").nullish(),function:i.Ik({name:i.Yj().nullish(),arguments:i.Yj().nullish()})})).nullish()}).nullish(),logprobs:i.Ik({content:i.YO(i.Ik({token:i.Yj(),logprob:i.ai(),top_logprobs:i.YO(i.Ik({token:i.Yj(),logprob:i.ai()}))})).nullable()}).nullish(),finish_reason:i.Yj().nullish(),index:i.ai()})),usage:h}),u]);function y(e){return e.startsWith("o")||e.startsWith("gpt-5")}function v(e){return e.startsWith("gpt-4o-audio-preview")}function b(e){var t,r;return y(e)?null!=(r=null==(t=_[e])?void 0:t.systemMessageMode)?r:"developer":"system"}var _={"o1-mini":{systemMessageMode:"remove"},"o1-mini-2024-09-12":{systemMessageMode:"remove"},"o1-preview":{systemMessageMode:"remove"},"o1-preview-2024-09-12":{systemMessageMode:"remove"},o3:{systemMessageMode:"developer"},"o3-2025-04-16":{systemMessageMode:"developer"},"o3-mini":{systemMessageMode:"developer"},"o3-mini-2025-01-31":{systemMessageMode:"developer"},"o4-mini":{systemMessageMode:"developer"},"o4-mini-2025-04-16":{systemMessageMode:"developer"}};function $({prompt:e,inputFormat:t,user:r="user",assistant:n="assistant"}){if("prompt"===t&&1===e.length&&"user"===e[0].role&&1===e[0].content.length&&"text"===e[0].content[0].type)return{prompt:e[0].content[0].text};let i="";for(let{role:t,content:a}of("system"===e[0].role&&(i+=`${e[0].content} `,e=e.slice(1)),e))switch(t){case"system":throw new o.M3({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":{let e=a.map(e=>{switch(e.type){case"text":return e.text;case"image":throw new o.b8({functionality:"images"})}}).join("");i+=`${r}: ${e} `;break}case"assistant":{let e=a.map(e=>{switch(e.type){case"text":return e.text;case"tool-call":throw new o.b8({functionality:"tool-call messages"})}}).join("");i+=`${n}: ${e} `;break}case"tool":throw new o.b8({functionality:"tool messages"});default:{let e=t;throw Error(`Unsupported role: ${e}`)}}return{prompt:i+=`${n}: `,stopSequences:[` ${r}:`]}}function w(e){return null==e?void 0:e.tokens.map((t,r)=>({token:t,logprob:e.token_logprobs[r],topLogprobs:e.top_logprobs?Object.entries(e.top_logprobs[r]).map(([e,t])=>({token:e,logprob:t})):[]}))}var S=class{constructor(e,t,r){this.specificationVersion="v1",this.defaultObjectGenerationMode=void 0,this.modelId=e,this.settings=t,this.config=r}get provider(){return this.config.provider}getArgs({mode:e,inputFormat:t,prompt:r,maxTokens:n,temperature:i,topP:a,topK:s,frequencyPenalty:l,presencePenalty:u,stopSequences:c,responseFormat:d,seed:f}){var p;let h=e.type,m=[];null!=s&&m.push({type:"unsupported-setting",setting:"topK"}),null!=d&&"text"!==d.type&&m.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format is not supported."});let{prompt:g,stopSequences:y}=$({prompt:r,inputFormat:t}),v=[...null!=y?y:[],...null!=c?c:[]],b={model:this.modelId,echo:this.settings.echo,logit_bias:this.settings.logitBias,logprobs:"number"==typeof this.settings.logprobs?this.settings.logprobs:"boolean"==typeof this.settings.logprobs&&this.settings.logprobs?0:void 0,suffix:this.settings.suffix,user:this.settings.user,max_tokens:n,temperature:i,top_p:a,frequency_penalty:l,presence_penalty:u,seed:f,prompt:g,stop:v.length>0?v:void 0};switch(h){case"regular":if(null==(p=e.tools)?void 0:p.length)throw new o.b8({functionality:"tools"});if(e.toolChoice)throw new o.b8({functionality:"toolChoice"});return{args:b,warnings:m};case"object-json":throw new o.b8({functionality:"object-json mode"});case"object-tool":throw new o.b8({functionality:"object-tool mode"});default:{let e=h;throw Error(`Unsupported type: ${e}`)}}}async doGenerate(e){let{args:t,warnings:r}=this.getArgs(e),{responseHeaders:o,value:i,rawValue:a}=await (0,n.GU)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:(0,n.m2)(this.config.headers(),e.headers),body:t,failedResponseHandler:c,successfulResponseHandler:(0,n.cV)(E),abortSignal:e.abortSignal,fetch:this.config.fetch}),{prompt:s,...u}=t,f=i.choices[0];return{text:f.text,usage:{promptTokens:i.usage.prompt_tokens,completionTokens:i.usage.completion_tokens},finishReason:l(f.finish_reason),logprobs:w(f.logprobs),rawCall:{rawPrompt:s,rawSettings:u},rawResponse:{headers:o,body:a},response:d(i),warnings:r,request:{body:JSON.stringify(t)}}}async doStream(e){let t,{args:r,warnings:o}=this.getArgs(e),i={...r,stream:!0,stream_options:"strict"===this.config.compatibility?{include_usage:!0}:void 0},{responseHeaders:a,value:s}=await (0,n.GU)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:(0,n.m2)(this.config.headers(),e.headers),body:i,failedResponseHandler:c,successfulResponseHandler:(0,n.Ds)(x),abortSignal:e.abortSignal,fetch:this.config.fetch}),{prompt:u,...f}=r,p="unknown",h={promptTokens:NaN,completionTokens:NaN},m=!0;return{stream:s.pipeThrough(new TransformStream({transform(e,r){if(!e.success){p="error",r.enqueue({type:"error",error:e.error});return}let n=e.value;if("error"in n){p="error",r.enqueue({type:"error",error:n.error});return}m&&(m=!1,r.enqueue({type:"response-metadata",...d(n)})),null!=n.usage&&(h={promptTokens:n.usage.prompt_tokens,completionTokens:n.usage.completion_tokens});let o=n.choices[0];(null==o?void 0:o.finish_reason)!=null&&(p=l(o.finish_reason)),(null==o?void 0:o.text)!=null&&r.enqueue({type:"text-delta",textDelta:o.text});let i=w(null==o?void 0:o.logprobs);(null==i?void 0:i.length)&&(void 0===t&&(t=[]),t.push(...i))},flush(e){e.enqueue({type:"finish",finishReason:p,logprobs:t,usage:h})}})),rawCall:{rawPrompt:u,rawSettings:f},rawResponse:{headers:a},warnings:o,request:{body:JSON.stringify(i)}}}},E=i.Ik({id:i.Yj().nullish(),created:i.ai().nullish(),model:i.Yj().nullish(),choices:i.YO(i.Ik({text:i.Yj(),finish_reason:i.Yj(),logprobs:i.Ik({tokens:i.YO(i.Yj()),token_logprobs:i.YO(i.ai()),top_logprobs:i.YO(i.g1(i.Yj(),i.ai())).nullable()}).nullish()})),usage:i.Ik({prompt_tokens:i.ai(),completion_tokens:i.ai()})}),x=i.KC([i.Ik({id:i.Yj().nullish(),created:i.ai().nullish(),model:i.Yj().nullish(),choices:i.YO(i.Ik({text:i.Yj(),finish_reason:i.Yj().nullish(),index:i.ai(),logprobs:i.Ik({tokens:i.YO(i.Yj()),token_logprobs:i.YO(i.ai()),top_logprobs:i.YO(i.g1(i.Yj(),i.ai())).nullable()}).nullish()})),usage:i.Ik({prompt_tokens:i.ai(),completion_tokens:i.ai()}).nullish()}),u]),A=class{constructor(e,t,r){this.specificationVersion="v1",this.modelId=e,this.settings=t,this.config=r}get provider(){return this.config.provider}get maxEmbeddingsPerCall(){var e;return null!=(e=this.settings.maxEmbeddingsPerCall)?e:2048}get supportsParallelCalls(){var e;return null==(e=this.settings.supportsParallelCalls)||e}async doEmbed({values:e,headers:t,abortSignal:r}){if(e.length>this.maxEmbeddingsPerCall)throw new o.Ch({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});let{responseHeaders:i,value:a}=await (0,n.GU)({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:(0,n.m2)(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:this.settings.dimensions,user:this.settings.user},failedResponseHandler:c,successfulResponseHandler:(0,n.cV)(O),abortSignal:r,fetch:this.config.fetch});return{embeddings:a.data.map(e=>e.embedding),usage:a.usage?{tokens:a.usage.prompt_tokens}:void 0,rawResponse:{headers:i}}}},O=i.Ik({data:i.YO(i.Ik({embedding:i.YO(i.ai())})),usage:i.Ik({prompt_tokens:i.ai()}).nullish()}),k={"dall-e-3":1,"dall-e-2":10,"gpt-image-1":10},I=new Set(["gpt-image-1"]),C=class{constructor(e,t,r){this.modelId=e,this.settings=t,this.config=r,this.specificationVersion="v1"}get maxImagesPerCall(){var e,t;return null!=(t=null!=(e=this.settings.maxImagesPerCall)?e:k[this.modelId])?t:1}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:r,aspectRatio:o,seed:i,providerOptions:a,headers:s,abortSignal:l}){var u,d,f,p;let h=[];null!=o&&h.push({type:"unsupported-setting",setting:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),null!=i&&h.push({type:"unsupported-setting",setting:"seed"});let m=null!=(f=null==(d=null==(u=this.config._internal)?void 0:u.currentDate)?void 0:d.call(u))?f:new Date,{value:g,responseHeaders:y}=await (0,n.GU)({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:(0,n.m2)(this.config.headers(),s),body:{model:this.modelId,prompt:e,n:t,size:r,...null!=(p=a.openai)?p:{},...!I.has(this.modelId)?{response_format:"b64_json"}:{}},failedResponseHandler:c,successfulResponseHandler:(0,n.cV)(T),abortSignal:l,fetch:this.config.fetch});return{images:g.data.map(e=>e.b64_json),warnings:h,response:{timestamp:m,modelId:this.modelId,headers:y}}}},T=i.Ik({data:i.YO(i.Ik({b64_json:i.Yj()}))}),P=i.Ik({include:i.YO(i.Yj()).nullish(),language:i.Yj().nullish(),prompt:i.Yj().nullish(),temperature:i.ai().min(0).max(1).nullish().default(0),timestampGranularities:i.YO(i.k5(["word","segment"])).nullish().default(["segment"])}),R={afrikaans:"af",arabic:"ar",armenian:"hy",azerbaijani:"az",belarusian:"be",bosnian:"bs",bulgarian:"bg",catalan:"ca",chinese:"zh",croatian:"hr",czech:"cs",danish:"da",dutch:"nl",english:"en",estonian:"et",finnish:"fi",french:"fr",galician:"gl",german:"de",greek:"el",hebrew:"he",hindi:"hi",hungarian:"hu",icelandic:"is",indonesian:"id",italian:"it",japanese:"ja",kannada:"kn",kazakh:"kk",korean:"ko",latvian:"lv",lithuanian:"lt",macedonian:"mk",malay:"ms",marathi:"mr",maori:"mi",nepali:"ne",norwegian:"no",persian:"fa",polish:"pl",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"sr",slovak:"sk",slovenian:"sl",spanish:"es",swahili:"sw",swedish:"sv",tagalog:"tl",tamil:"ta",thai:"th",turkish:"tr",ukrainian:"uk",urdu:"ur",vietnamese:"vi",welsh:"cy"},j=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v1"}get provider(){return this.config.provider}getArgs({audio:e,mediaType:t,providerOptions:r}){var o,i,a,s,l;let u=[],c=(0,n.xI)({provider:"openai",providerOptions:r,schema:P}),d=new FormData,f=e instanceof Uint8Array?new Blob([e]):new Blob([(0,n.Z9)(e)]);if(d.append("model",this.modelId),d.append("file",new File([f],"audio",{type:t})),c){let e={include:null!=(o=c.include)?o:void 0,language:null!=(i=c.language)?i:void 0,prompt:null!=(a=c.prompt)?a:void 0,temperature:null!=(s=c.temperature)?s:void 0,timestamp_granularities:null!=(l=c.timestampGranularities)?l:void 0};for(let t in e){let r=e[t];void 0!==r&&d.append(t,String(r))}}return{formData:d,warnings:u}}async doGenerate(e){var t,r,o,i,a,s;let l=null!=(o=null==(r=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:r.call(t))?o:new Date,{formData:u,warnings:d}=this.getArgs(e),{value:f,responseHeaders:p,rawValue:h}=await (0,n.S)({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:(0,n.m2)(this.config.headers(),e.headers),formData:u,failedResponseHandler:c,successfulResponseHandler:(0,n.cV)(N),abortSignal:e.abortSignal,fetch:this.config.fetch}),m=null!=f.language&&f.language in R?R[f.language]:void 0;return{text:f.text,segments:null!=(a=null==(i=f.words)?void 0:i.map(e=>({text:e.word,startSecond:e.start,endSecond:e.end})))?a:[],language:m,durationInSeconds:null!=(s=f.duration)?s:void 0,warnings:d,response:{timestamp:l,modelId:this.modelId,headers:p,body:h}}}},N=i.Ik({text:i.Yj(),language:i.Yj().nullish(),duration:i.ai().nullish(),words:i.YO(i.Ik({word:i.Yj(),start:i.ai(),end:i.ai()})).nullish()});function M({prompt:e,systemMessageMode:t}){let r=[],i=[];for(let{role:a,content:s}of e)switch(a){case"system":switch(t){case"system":r.push({role:"system",content:s});break;case"developer":r.push({role:"developer",content:s});break;case"remove":i.push({type:"other",message:"system messages are removed for this model"});break;default:{let e=t;throw Error(`Unsupported system message mode: ${e}`)}}break;case"user":r.push({role:"user",content:s.map((e,t)=>{var r,i,a,s;switch(e.type){case"text":return{type:"input_text",text:e.text};case"image":return{type:"input_image",image_url:e.image instanceof URL?e.image.toString():`data:${null!=(r=e.mimeType)?r:"image/jpeg"};base64,${(0,n.n_)(e.image)}`,detail:null==(a=null==(i=e.providerMetadata)?void 0:i.openai)?void 0:a.imageDetail};case"file":if(e.data instanceof URL)throw new o.b8({functionality:"File URLs in user messages"});if("application/pdf"===e.mimeType)return{type:"input_file",filename:null!=(s=e.filename)?s:`part-${t}.pdf`,file_data:`data:application/pdf;base64,${e.data}`};throw new o.b8({functionality:"Only PDF files are supported in user messages"})}})});break;case"assistant":for(let e of s)switch(e.type){case"text":r.push({role:"assistant",content:[{type:"output_text",text:e.text}]});break;case"tool-call":r.push({type:"function_call",call_id:e.toolCallId,name:e.toolName,arguments:JSON.stringify(e.args)})}break;case"tool":for(let e of s)r.push({type:"function_call_output",call_id:e.toolCallId,output:JSON.stringify(e.result)});break;default:{let e=a;throw Error(`Unsupported role: ${e}`)}}return{messages:r,warnings:i}}function L({finishReason:e,hasToolCalls:t}){switch(e){case void 0:case null:return t?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return t?"tool-calls":"unknown"}}function D({mode:e,strict:t}){var r;let n=(null==(r=e.tools)?void 0:r.length)?e.tools:void 0,i=[];if(null==n)return{tools:void 0,tool_choice:void 0,toolWarnings:i};let a=e.toolChoice,s=[];for(let e of n)switch(e.type){case"function":s.push({type:"function",name:e.name,description:e.description,parameters:e.parameters,strict:!!t||void 0});break;case"provider-defined":"openai.web_search_preview"===e.id?s.push({type:"web_search_preview",search_context_size:e.args.searchContextSize,user_location:e.args.userLocation}):i.push({type:"unsupported-tool",tool:e});break;default:i.push({type:"unsupported-tool",tool:e})}if(null==a)return{tools:s,tool_choice:void 0,toolWarnings:i};let l=a.type;switch(l){case"auto":case"none":case"required":return{tools:s,tool_choice:l,toolWarnings:i};case"tool":if("web_search_preview"===a.toolName)return{tools:s,tool_choice:{type:"web_search_preview"},toolWarnings:i};return{tools:s,tool_choice:{type:"function",name:a.toolName},toolWarnings:i};default:{let e=l;throw new o.b8({functionality:`Unsupported tool choice type: ${e}`})}}}var B=class{constructor(e,t){this.specificationVersion="v1",this.defaultObjectGenerationMode="json",this.supportsStructuredOutputs=!0,this.modelId=e,this.config=t}get provider(){return this.config.provider}getArgs({mode:e,maxTokens:t,temperature:r,stopSequences:o,topP:i,topK:a,presencePenalty:s,frequencyPenalty:l,seed:u,prompt:c,providerMetadata:d,responseFormat:f}){var p,h,m;let g=[],y=ea(this.modelId),v=e.type;null!=a&&g.push({type:"unsupported-setting",setting:"topK"}),null!=u&&g.push({type:"unsupported-setting",setting:"seed"}),null!=s&&g.push({type:"unsupported-setting",setting:"presencePenalty"}),null!=l&&g.push({type:"unsupported-setting",setting:"frequencyPenalty"}),null!=o&&g.push({type:"unsupported-setting",setting:"stopSequences"});let{messages:b,warnings:_}=M({prompt:c,systemMessageMode:y.systemMessageMode});g.push(..._);let $=(0,n.xI)({provider:"openai",providerOptions:d,schema:es}),w=null==(p=null==$?void 0:$.strictSchemas)||p,S={model:this.modelId,input:b,temperature:r,top_p:i,max_output_tokens:t,...(null==f?void 0:f.type)==="json"&&{text:{format:null!=f.schema?{type:"json_schema",strict:w,name:null!=(h=f.name)?h:"response",description:f.description,schema:f.schema}:{type:"json_object"}}},metadata:null==$?void 0:$.metadata,parallel_tool_calls:null==$?void 0:$.parallelToolCalls,previous_response_id:null==$?void 0:$.previousResponseId,store:null==$?void 0:$.store,user:null==$?void 0:$.user,instructions:null==$?void 0:$.instructions,...y.isReasoningModel&&((null==$?void 0:$.reasoningEffort)!=null||(null==$?void 0:$.reasoningSummary)!=null)&&{reasoning:{...(null==$?void 0:$.reasoningEffort)!=null&&{effort:$.reasoningEffort},...(null==$?void 0:$.reasoningSummary)!=null&&{summary:$.reasoningSummary}}},...y.requiredAutoTruncation&&{truncation:"auto"}};switch(y.isReasoningModel&&(null!=S.temperature&&(S.temperature=void 0,g.push({type:"unsupported-setting",setting:"temperature",details:"temperature is not supported for reasoning models"})),null!=S.top_p&&(S.top_p=void 0,g.push({type:"unsupported-setting",setting:"topP",details:"topP is not supported for reasoning models"}))),v){case"regular":{let{tools:t,tool_choice:r,toolWarnings:n}=D({mode:e,strict:w});return{args:{...S,tools:t,tool_choice:r},warnings:[...g,...n]}}case"object-json":return{args:{...S,text:{format:null!=e.schema?{type:"json_schema",strict:w,name:null!=(m=e.name)?m:"response",description:e.description,schema:e.schema}:{type:"json_object"}}},warnings:g};case"object-tool":return{args:{...S,tool_choice:{type:"function",name:e.tool.name},tools:[{type:"function",name:e.tool.name,description:e.tool.description,parameters:e.tool.parameters,strict:w}]},warnings:g};default:{let e=v;throw Error(`Unsupported type: ${e}`)}}}async doGenerate(e){var t,r,a,s,l,u,d;let{args:f,warnings:p}=this.getArgs(e),h=this.config.url({path:"/responses",modelId:this.modelId}),{responseHeaders:m,value:g,rawValue:y}=await (0,n.GU)({url:h,headers:(0,n.m2)(this.config.headers(),e.headers),body:f,failedResponseHandler:c,successfulResponseHandler:(0,n.cV)(i.Ik({id:i.Yj(),created_at:i.ai(),error:i.Ik({message:i.Yj(),code:i.Yj()}).nullish(),model:i.Yj(),output:i.YO(i.gM("type",[i.Ik({type:i.eu("message"),role:i.eu("assistant"),content:i.YO(i.Ik({type:i.eu("output_text"),text:i.Yj(),annotations:i.YO(i.Ik({type:i.eu("url_citation"),start_index:i.ai(),end_index:i.ai(),url:i.Yj(),title:i.Yj()}))}))}),i.Ik({type:i.eu("function_call"),call_id:i.Yj(),name:i.Yj(),arguments:i.Yj()}),i.Ik({type:i.eu("web_search_call")}),i.Ik({type:i.eu("computer_call")}),i.Ik({type:i.eu("reasoning"),summary:i.YO(i.Ik({type:i.eu("summary_text"),text:i.Yj()}))})])),incomplete_details:i.Ik({reason:i.Yj()}).nullable(),usage:F})),abortSignal:e.abortSignal,fetch:this.config.fetch});if(g.error)throw new o.hL({message:g.error.message,url:h,requestBodyValues:f,statusCode:400,responseHeaders:m,responseBody:y,isRetryable:!1});let v=g.output.filter(e=>"message"===e.type).flatMap(e=>e.content).filter(e=>"output_text"===e.type),b=g.output.filter(e=>"function_call"===e.type).map(e=>({toolCallType:"function",toolCallId:e.call_id,toolName:e.name,args:e.arguments})),_=null!=(r=null==(t=g.output.find(e=>"reasoning"===e.type))?void 0:t.summary)?r:null;return{text:v.map(e=>e.text).join("\n"),sources:v.flatMap(e=>e.annotations.map(e=>{var t,r,o;return{sourceType:"url",id:null!=(o=null==(r=(t=this.config).generateId)?void 0:r.call(t))?o:(0,n.$C)(),url:e.url,title:e.title}})),finishReason:L({finishReason:null==(a=g.incomplete_details)?void 0:a.reason,hasToolCalls:b.length>0}),toolCalls:b.length>0?b:void 0,reasoning:_?_.map(e=>({type:"text",text:e.text})):void 0,usage:{promptTokens:g.usage.input_tokens,completionTokens:g.usage.output_tokens},rawCall:{rawPrompt:void 0,rawSettings:{}},rawResponse:{headers:m,body:y},request:{body:JSON.stringify(f)},response:{id:g.id,timestamp:new Date(1e3*g.created_at),modelId:g.model},providerMetadata:{openai:{responseId:g.id,cachedPromptTokens:null!=(l=null==(s=g.usage.input_tokens_details)?void 0:s.cached_tokens)?l:null,reasoningTokens:null!=(d=null==(u=g.usage.output_tokens_details)?void 0:u.reasoning_tokens)?d:null}},warnings:p}}async doStream(e){let{args:t,warnings:r}=this.getArgs(e),{responseHeaders:o,value:i}=await (0,n.GU)({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:(0,n.m2)(this.config.headers(),e.headers),body:{...t,stream:!0},failedResponseHandler:c,successfulResponseHandler:(0,n.Ds)(z),abortSignal:e.abortSignal,fetch:this.config.fetch}),a=this,s="unknown",l=NaN,u=NaN,d=null,f=null,p=null,h={},m=!1;return{stream:i.pipeThrough(new TransformStream({transform(e,t){var r,o,i,c,g,y,v,b;if(!e.success){s="error",t.enqueue({type:"error",error:e.error});return}let _=e.value;if(er(_))"function_call"===_.item.type&&(h[_.output_index]={toolName:_.item.name,toolCallId:_.item.call_id},t.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:_.item.call_id,toolName:_.item.name,argsTextDelta:_.item.arguments}));else if(et(_)){let e=h[_.output_index];null!=e&&t.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:e.toolCallId,toolName:e.toolName,argsTextDelta:_.delta})}else ee(_)?(p=_.response.id,t.enqueue({type:"response-metadata",id:_.response.id,timestamp:new Date(1e3*_.response.created_at),modelId:_.response.model})):J(_)?t.enqueue({type:"text-delta",textDelta:_.delta}):eo(_)?t.enqueue({type:"reasoning",textDelta:_.delta}):X(_)&&"function_call"===_.item.type?(h[_.output_index]=void 0,m=!0,t.enqueue({type:"tool-call",toolCallType:"function",toolCallId:_.item.call_id,toolName:_.item.name,args:_.item.arguments})):Q(_)?(s=L({finishReason:null==(r=_.response.incomplete_details)?void 0:r.reason,hasToolCalls:m}),l=_.response.usage.input_tokens,u=_.response.usage.output_tokens,d=null!=(i=null==(o=_.response.usage.input_tokens_details)?void 0:o.cached_tokens)?i:d,f=null!=(g=null==(c=_.response.usage.output_tokens_details)?void 0:c.reasoning_tokens)?g:f):en(_)?t.enqueue({type:"source",source:{sourceType:"url",id:null!=(b=null==(v=(y=a.config).generateId)?void 0:v.call(y))?b:(0,n.$C)(),url:_.annotation.url,title:_.annotation.title}}):ei(_)&&t.enqueue({type:"error",error:_})},flush(e){e.enqueue({type:"finish",finishReason:s,usage:{promptTokens:l,completionTokens:u},...(null!=d||null!=f)&&{providerMetadata:{openai:{responseId:p,cachedPromptTokens:d,reasoningTokens:f}}}})}})),rawCall:{rawPrompt:void 0,rawSettings:{}},rawResponse:{headers:o},request:{body:JSON.stringify(t)},warnings:r}}},F=i.Ik({input_tokens:i.ai(),input_tokens_details:i.Ik({cached_tokens:i.ai().nullish()}).nullish(),output_tokens:i.ai(),output_tokens_details:i.Ik({reasoning_tokens:i.ai().nullish()}).nullish()}),U=i.Ik({type:i.eu("response.output_text.delta"),delta:i.Yj()}),Z=i.Ik({type:i.k5(["response.completed","response.incomplete"]),response:i.Ik({incomplete_details:i.Ik({reason:i.Yj()}).nullish(),usage:F})}),Y=i.Ik({type:i.eu("response.created"),response:i.Ik({id:i.Yj(),created_at:i.ai(),model:i.Yj()})}),H=i.Ik({type:i.eu("response.output_item.done"),output_index:i.ai(),item:i.gM("type",[i.Ik({type:i.eu("message")}),i.Ik({type:i.eu("function_call"),id:i.Yj(),call_id:i.Yj(),name:i.Yj(),arguments:i.Yj(),status:i.eu("completed")})])}),q=i.Ik({type:i.eu("response.function_call_arguments.delta"),item_id:i.Yj(),output_index:i.ai(),delta:i.Yj()}),G=i.Ik({type:i.eu("response.output_item.added"),output_index:i.ai(),item:i.gM("type",[i.Ik({type:i.eu("message")}),i.Ik({type:i.eu("function_call"),id:i.Yj(),call_id:i.Yj(),name:i.Yj(),arguments:i.Yj()})])}),W=i.Ik({type:i.eu("response.output_text.annotation.added"),annotation:i.Ik({type:i.eu("url_citation"),url:i.Yj(),title:i.Yj()})}),K=i.Ik({type:i.eu("response.reasoning_summary_text.delta"),item_id:i.Yj(),output_index:i.ai(),summary_index:i.ai(),delta:i.Yj()}),V=i.Ik({type:i.eu("error"),code:i.Yj(),message:i.Yj(),param:i.Yj().nullish(),sequence_number:i.ai()}),z=i.KC([U,Z,Y,H,q,G,W,K,V,i.Ik({type:i.Yj()}).passthrough()]);function J(e){return"response.output_text.delta"===e.type}function X(e){return"response.output_item.done"===e.type}function Q(e){return"response.completed"===e.type||"response.incomplete"===e.type}function ee(e){return"response.created"===e.type}function et(e){return"response.function_call_arguments.delta"===e.type}function er(e){return"response.output_item.added"===e.type}function en(e){return"response.output_text.annotation.added"===e.type}function eo(e){return"response.reasoning_summary_text.delta"===e.type}function ei(e){return"error"===e.type}function ea(e){return e.startsWith("o")||e.startsWith("gpt-5")?e.startsWith("o1-mini")||e.startsWith("o1-preview")?{isReasoningModel:!0,systemMessageMode:"remove",requiredAutoTruncation:!1}:{isReasoningModel:!0,systemMessageMode:"developer",requiredAutoTruncation:!1}:{isReasoningModel:!1,systemMessageMode:"system",requiredAutoTruncation:!1}}var es=i.Ik({metadata:i.bz().nullish(),parallelToolCalls:i.zM().nullish(),previousResponseId:i.Yj().nullish(),store:i.zM().nullish(),user:i.Yj().nullish(),reasoningEffort:i.Yj().nullish(),strictSchemas:i.zM().nullish(),instructions:i.Yj().nullish(),reasoningSummary:i.Yj().nullish()}),el=i.Ik({}),eu={webSearchPreview:function({searchContextSize:e,userLocation:t}={}){return{type:"provider-defined",id:"openai.web_search_preview",args:{searchContextSize:e,userLocation:t},parameters:el}}},ec=i.Ik({instructions:i.Yj().nullish(),speed:i.ai().min(.25).max(4).default(1).nullish()}),ed=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v1"}get provider(){return this.config.provider}getArgs({text:e,voice:t="alloy",outputFormat:r="mp3",speed:o,instructions:i,providerOptions:a}){let s=[],l=(0,n.xI)({provider:"openai",providerOptions:a,schema:ec}),u={model:this.modelId,input:e,voice:t,response_format:"mp3",speed:o,instructions:i};if(r&&(["mp3","opus","aac","flac","wav","pcm"].includes(r)?u.response_format=r:s.push({type:"unsupported-setting",setting:"outputFormat",details:`Unsupported output format: ${r}. Using mp3 instead.`})),l){let e={};for(let t in e){let r=e[t];void 0!==r&&(u[t]=r)}}return{requestBody:u,warnings:s}}async doGenerate(e){var t,r,o;let i=null!=(o=null==(r=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:r.call(t))?o:new Date,{requestBody:a,warnings:s}=this.getArgs(e),{value:l,responseHeaders:u,rawValue:d}=await (0,n.GU)({url:this.config.url({path:"/audio/speech",modelId:this.modelId}),headers:(0,n.m2)(this.config.headers(),e.headers),body:a,failedResponseHandler:c,successfulResponseHandler:(0,n.HD)(),abortSignal:e.abortSignal,fetch:this.config.fetch});return{audio:l,warnings:s,request:{body:JSON.stringify(a)},response:{timestamp:i,modelId:this.modelId,headers:u,body:d}}}};function ef(e={}){var t,r,o;let i=null!=(t=(0,n.ae)(e.baseURL))?t:"https://api.openai.com/v1",a=null!=(r=e.compatibility)?r:"compatible",s=null!=(o=e.name)?o:"openai",l=()=>({Authorization:`Bearer ${(0,n.WL)({apiKey:e.apiKey,environmentVariableName:"OPENAI_API_KEY",description:"OpenAI"})}`,"OpenAI-Organization":e.organization,"OpenAI-Project":e.project,...e.headers}),u=(t,r={})=>new p(t,r,{provider:`${s}.chat`,url:({path:e})=>`${i}${e}`,headers:l,compatibility:a,fetch:e.fetch}),c=(t,r={})=>new S(t,r,{provider:`${s}.completion`,url:({path:e})=>`${i}${e}`,headers:l,compatibility:a,fetch:e.fetch}),d=(t,r={})=>new A(t,r,{provider:`${s}.embedding`,url:({path:e})=>`${i}${e}`,headers:l,fetch:e.fetch}),f=(t,r={})=>new C(t,r,{provider:`${s}.image`,url:({path:e})=>`${i}${e}`,headers:l,fetch:e.fetch}),h=t=>new j(t,{provider:`${s}.transcription`,url:({path:e})=>`${i}${e}`,headers:l,fetch:e.fetch}),m=t=>new ed(t,{provider:`${s}.speech`,url:({path:e})=>`${i}${e}`,headers:l,fetch:e.fetch}),g=(e,t)=>{if(new.target)throw Error("The OpenAI model function cannot be called with the new keyword.");return"gpt-3.5-turbo-instruct"===e?c(e,t):u(e,t)},y=t=>new B(t,{provider:`${s}.responses`,url:({path:e})=>`${i}${e}`,headers:l,fetch:e.fetch}),v=function(e,t){return g(e,t)};return v.languageModel=g,v.chat=u,v.completion=c,v.responses=y,v.embedding=d,v.textEmbedding=d,v.textEmbeddingModel=d,v.image=f,v.imageModel=f,v.transcription=h,v.transcriptionModel=h,v.speech=m,v.speechModel=m,v.tools=eu,v}ef({compatibility:"strict"})},42145:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return(0,n.default)(e),e===e.toLowerCase()}e.exports=t.default,e.exports.default=t.default},42270:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=void 0,t.keccakP=b;let n=r(67247),o=r(72274),i=BigInt(0),a=BigInt(1),s=BigInt(2),l=BigInt(7),u=BigInt(256),c=BigInt(113),d=[],f=[],p=[];for(let e=0,t=a,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],d.push(2*(5*n+r)),f.push((e+1)*(e+2)/2%64);let o=i;for(let e=0;e<7;e++)(t=(t<>l)*c)%u)&s&&(o^=a<<(a<r>32?(0,n.rotlBH)(e,t,r):(0,n.rotlSH)(e,t,r),v=(e,t,r)=>r>32?(0,n.rotlBL)(e,t,r):(0,n.rotlSL)(e,t,r);function b(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,o=(t+2)%10,i=r[o],a=r[o+1],s=y(i,a,1)^r[n],l=v(i,a,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=s,e[t+r+1]^=l}let t=e[2],o=e[3];for(let r=0;r<24;r++){let n=f[r],i=y(t,o,n),a=v(t,o,n),s=d[r];t=e[s],o=e[s+1],e[s]=i,e[s+1]=a}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=m[n],e[1]^=g[n]}(0,o.clean)(r)}class _ extends o.Hash{constructor(e,t,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,(0,o.anumber)(r),!(0=r&&this.keccak();let i=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,o.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,o.aoutput)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,o.clean)(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:o,enableXOF:i}=this;return e||(e=new _(t,r,n,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}t.Keccak=_;let $=(e,t,r)=>(0,o.createHasher)(()=>new _(t,e,r));t.sha3_224=$(6,144,28),t.sha3_256=$(6,136,32),t.sha3_384=$(6,104,48),t.sha3_512=$(6,72,64),t.keccak_224=$(1,144,28),t.keccak_256=$(1,136,32),t.keccak_384=$(1,104,48),t.keccak_512=$(1,72,64);let w=(e,t,r)=>(0,o.createXOFer)((n={})=>new _(t,e,void 0===n.dkLen?r:n.dkLen,!0));t.shake128=w(31,168,16),t.shake256=w(31,136,32)},42463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=i(r(29203)),o=i(r(79922));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t="\\d{".concat(e.digits_after_decimal[0],"}");e.digits_after_decimal.forEach(function(e,r){0!==r&&(t="".concat(t,"|\\d{").concat(e,"}"))});var r="(".concat(e.symbol.replace(/\W/,function(e){return"\\".concat(e)}),")").concat(e.require_symbol?"":"?"),n="-?",o=["0","[1-9]\\d*","[1-9]\\d{0,2}(\\".concat(e.thousands_separator,"\\d{3})*")],i="(".concat(o.join("|"),")?"),a="(\\".concat(e.decimal_separator,"(").concat(t,"))").concat(e.require_decimal?"":"?"),s=i+(e.allow_decimal||e.require_decimal?a:"");return e.allow_negatives&&!e.parens_for_negatives&&(e.negative_sign_after_digits?s+=n:e.negative_sign_before_digits&&(s=n+s)),e.allow_negative_sign_placeholder?s="( (?!\\-))?".concat(s):e.allow_space_after_symbol?s=" ?".concat(s):e.allow_space_after_digits&&(s+="( (?!$))?"),e.symbol_after_digits?s+=r:s=r+s,e.allow_negatives&&(e.parens_for_negatives?s="(\\(".concat(s,"\\)|").concat(s,")"):e.negative_sign_before_digits||e.negative_sign_after_digits||(s=n+s)),new RegExp("^(?!-? )(?=.*\\d)".concat(s,"$"))}var s={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};function l(e,t){return(0,o.default)(e),a(t=(0,n.default)(t,s)).test(e)}e.exports=t.default,e.exports.default=t.default},42774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},43232:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t{"use strict";e.exports=ReferenceError},43528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var n=a(r(47500)),o=a(r(19692)),i=a(r(79922));function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){return c(e)||u(e,t)||f(e,t)||l()}function l(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}function c(e){if(Array.isArray(e))return e}function d(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=f(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function f(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r4)return!1;var i,a=d(o);try{for(a.s();!(i=a.n()).done;){var l=i.value.split("="),u=s(l,2),c=u[0],f=u[1];if(c&&!t.has(c)){n=!0;break}f&&("cc"===c||"bcc"===c)&&(r[c]=f),c&&t.delete(c)}}catch(e){a.e(e)}finally{a.f()}return!n&&r}function m(e,t){if((0,i.default)(e),0!==e.indexOf("mailto:"))return!1;var r=s(e.replace("mailto:","").split("?"),2),a=r[0],l=r[1],u=void 0===l?"":l;if(!a&&!u)return!0;var c=h(u);return!!c&&"".concat(a,",").concat(c.cc,",").concat(c.bcc).split(",").every(function(e){return!(e=(0,n.default)(e," "))||(0,o.default)(e,t)})}e.exports=t.default,e.exports.default=t.default},43946:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},44050:(e,t,r)=>{"use strict";var n=r(21667),o=r(96779),i=r(74818),a=r(54913),s=r(27654),l=r(50865),u=a("Object.prototype.toString"),c=r(27721)(),d="undefined"==typeof globalThis?r.g:globalThis,f=o(),p=a("String.prototype.slice"),h=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1?t:"Object"===t&&y(e)}return s?g(e):null}},44288:(e,t,r)=>{"use strict";r.d(t,{T:()=>b});var n=r(38483),o=r(6663),i=r(14287);function a(e){let t=[];for(let r=0;r{var t;switch(e.type){case"text":return{type:"text",text:e.text};case"image":return{type:"image_url",image_url:e.image instanceof URL?e.image.toString():`data:${null!=(t=e.mimeType)?t:"image/jpeg"};base64,${(0,n.n_)(e.image)}`};case"file":if(!(e.data instanceof URL))throw new i.b8({functionality:"File content parts in user messages"});if("application/pdf"===e.mimeType)return{type:"document_url",document_url:e.data.toString()};throw new i.b8({functionality:"Only PDF files are supported in user messages"})}})});break;case"assistant":{let e="",r=[];for(let t of a)switch(t.type){case"text":e+=t.text;break;case"tool-call":r.push({id:t.toolCallId,type:"function",function:{name:t.toolName,arguments:JSON.stringify(t.args)}})}t.push({role:"assistant",content:e,prefix:!!s||void 0,tool_calls:r.length>0?r:void 0});break}case"tool":for(let e of a)t.push({role:"tool",name:e.toolName,content:JSON.stringify(e.result),tool_call_id:e.toolCallId});break;default:{let e=o;throw Error(`Unsupported role: ${e}`)}}}return t}function s(e){switch(e){case"stop":return"stop";case"length":case"model_length":return"length";case"tool_calls":return"tool-calls";default:return"unknown"}}var l=o.Ik({object:o.eu("error"),message:o.Yj(),type:o.Yj(),param:o.Yj().nullable(),code:o.Yj().nullable()}),u=(0,n.sl)({errorSchema:l,errorToMessage:e=>e.message});function c({id:e,model:t,created:r}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:null!=r?new Date(1e3*r):void 0}}function d(e){var t;let r=(null==(t=e.tools)?void 0:t.length)?e.tools:void 0,n=[];if(null==r)return{tools:void 0,tool_choice:void 0,toolWarnings:n};let o=[];for(let e of r)"provider-defined"===e.type?n.push({type:"unsupported-tool",tool:e}):o.push({type:"function",function:{name:e.name,description:e.description,parameters:e.parameters}});let a=e.toolChoice;if(null==a)return{tools:o,tool_choice:void 0,toolWarnings:n};let s=a.type;switch(s){case"auto":case"none":return{tools:o,tool_choice:s,toolWarnings:n};case"required":return{tools:o,tool_choice:"any",toolWarnings:n};case"tool":return{tools:o.filter(e=>e.function.name===a.toolName),tool_choice:"any",toolWarnings:n};default:{let e=s;throw new i.b8({functionality:`Unsupported tool choice type: ${e}`})}}}var f=class{constructor(e,t,r){this.specificationVersion="v1",this.defaultObjectGenerationMode="json",this.supportsImageUrls=!1,this.modelId=e,this.settings=t,this.config=r}get provider(){return this.config.provider}supportsUrl(e){return"https:"===e.protocol}getArgs({mode:e,prompt:t,maxTokens:r,temperature:n,topP:o,topK:i,frequencyPenalty:s,presencePenalty:l,stopSequences:u,responseFormat:c,seed:f,providerMetadata:p}){var h,m;let g=e.type,y=[];null!=i&&y.push({type:"unsupported-setting",setting:"topK"}),null!=s&&y.push({type:"unsupported-setting",setting:"frequencyPenalty"}),null!=l&&y.push({type:"unsupported-setting",setting:"presencePenalty"}),null!=u&&y.push({type:"unsupported-setting",setting:"stopSequences"}),null!=c&&"json"===c.type&&null!=c.schema&&y.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format schema is not supported"});let v={model:this.modelId,safe_prompt:this.settings.safePrompt,max_tokens:r,temperature:n,top_p:o,random_seed:f,response_format:(null==c?void 0:c.type)==="json"?{type:"json_object"}:void 0,document_image_limit:null==(h=null==p?void 0:p.mistral)?void 0:h.documentImageLimit,document_page_limit:null==(m=null==p?void 0:p.mistral)?void 0:m.documentPageLimit,messages:a(t)};switch(g){case"regular":{let{tools:t,tool_choice:r,toolWarnings:n}=d(e);return{args:{...v,tools:t,tool_choice:r},warnings:[...y,...n]}}case"object-json":return{args:{...v,response_format:{type:"json_object"}},warnings:y};case"object-tool":return{args:{...v,tool_choice:"any",tools:[{type:"function",function:e.tool}]},warnings:y};default:{let e=g;throw Error(`Unsupported type: ${e}`)}}}async doGenerate(e){var t;let{args:r,warnings:o}=this.getArgs(e),{responseHeaders:i,value:a,rawValue:l}=await (0,n.GU)({url:`${this.config.baseURL}/chat/completions`,headers:(0,n.m2)(this.config.headers(),e.headers),body:r,failedResponseHandler:u,successfulResponseHandler:(0,n.cV)(m),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:d,...f}=r,h=a.choices[0],g=p(h.message.content),y=d[d.length-1];return"assistant"===y.role&&(null==g?void 0:g.startsWith(y.content))&&(g=g.slice(y.content.length)),{text:g,toolCalls:null==(t=h.message.tool_calls)?void 0:t.map(e=>({toolCallType:"function",toolCallId:e.id,toolName:e.function.name,args:e.function.arguments})),finishReason:s(h.finish_reason),usage:{promptTokens:a.usage.prompt_tokens,completionTokens:a.usage.completion_tokens},rawCall:{rawPrompt:d,rawSettings:f},rawResponse:{headers:i,body:l},request:{body:JSON.stringify(r)},response:c(a),warnings:o}}async doStream(e){let{args:t,warnings:r}=this.getArgs(e),o={...t,stream:!0},{responseHeaders:i,value:a}=await (0,n.GU)({url:`${this.config.baseURL}/chat/completions`,headers:(0,n.m2)(this.config.headers(),e.headers),body:o,failedResponseHandler:u,successfulResponseHandler:(0,n.Ds)(g),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:l,...d}=t,f="unknown",h={promptTokens:NaN,completionTokens:NaN},m=0,y=!1;return{stream:a.pipeThrough(new TransformStream({transform(e,t){if(!e.success)return void t.enqueue({type:"error",error:e.error});m++;let r=e.value;1===m&&t.enqueue({type:"response-metadata",...c(r)}),null!=r.usage&&(h={promptTokens:r.usage.prompt_tokens,completionTokens:r.usage.completion_tokens});let n=r.choices[0];if((null==n?void 0:n.finish_reason)!=null&&(f=s(n.finish_reason)),(null==n?void 0:n.delta)==null)return;let o=n.delta,i=p(o.content);if(m<=2){let e=l[l.length-1];if("assistant"===e.role&&i===e.content.trimEnd()){i.lengththis.maxEmbeddingsPerCall)throw new i.Ch({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});let{responseHeaders:o,value:a}=await (0,n.GU)({url:`${this.config.baseURL}/embeddings`,headers:(0,n.m2)(this.config.headers(),r),body:{model:this.modelId,input:e,encoding_format:"float"},failedResponseHandler:u,successfulResponseHandler:(0,n.cV)(v),abortSignal:t,fetch:this.config.fetch});return{embeddings:a.data.map(e=>e.embedding),usage:a.usage?{tokens:a.usage.prompt_tokens}:void 0,rawResponse:{headers:o}}}},v=o.Ik({data:o.YO(o.Ik({embedding:o.YO(o.ai())})),usage:o.Ik({prompt_tokens:o.ai()}).nullish()});function b(e={}){var t;let r=null!=(t=(0,n.ae)(e.baseURL))?t:"https://api.mistral.ai/v1",o=()=>({Authorization:`Bearer ${(0,n.WL)({apiKey:e.apiKey,environmentVariableName:"MISTRAL_API_KEY",description:"Mistral"})}`,...e.headers}),i=(t,n={})=>new f(t,n,{provider:"mistral.chat",baseURL:r,headers:o,fetch:e.fetch}),a=(t,n={})=>new y(t,n,{provider:"mistral.embedding",baseURL:r,headers:o,fetch:e.fetch}),s=function(e,t){if(new.target)throw Error("The Mistral model function cannot be called with the new keyword.");return i(e,t)};return s.languageModel=i,s.chat=i,s.embedding=a,s.textEmbedding=a,s.textEmbeddingModel=a,s}b()},44396:(e,t,r)=>{"use strict";let n=r(77721),o=r(5074),i=r(44689);e.exports=(e,t)=>{e=new o(e,t);let r=new n("0.0.0");if(e.test(r)||(r=new n("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t{let t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!a||i(t,a))&&(a=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),a&&(!r||i(r,a))&&(r=a)}return r&&e.test(r)?r:null}},44448:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(r(79922)),o=i(r(29203));function i(e){return e&&e.__esModule?e:{default:e}}var a=/^[A-Z2-7]+=*$/,s=/^[A-HJKMNP-TV-Z0-9]+$/,l={crockford:!1};function u(e,t){return((0,n.default)(e),(t=(0,o.default)(t,l)).crockford)?s.test(e):!!(e.length%8==0&&a.test(e))}e.exports=t.default,e.exports.default=t.default},44451:e=>{"use strict";e.exports=RangeError},44689:(e,t,r)=>{"use strict";let n=r(26189);e.exports=(e,t,r)=>n(e,t,r)>0},45819:(e,t,r)=>{"use strict";let n,o;function i(e){for(var t=e.constructor.prototype,r=0,n=Object.getOwnPropertyNames(t);rtJ});var u=function(e,t){return(u=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;rt.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function p(e,t,r,n){function o(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function a(e){try{l(n.next(e))}catch(e){i(e)}}function s(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){e.done?r(e.value):o(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})}function h(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{if(!e.writeKey)throw new g("writeKey","writeKey is missing.")},v="2.3.0";function b(e){var t=Math.random()+1,r=e.minTimeout,n=void 0===r?500:r,o=e.factor,i=void 0===o?2:o,a=e.attempt,s=e.maxTimeout;return Math.min(t*n*Math.pow(i,a),void 0===s?1/0:s)}let _=e=>e.replace(/\/$/,""),$=(e,t)=>_(new URL(t||"",e).href);for(var w,S=function(){var e,t,r=!1,n=new Promise(function(n,o){e=function(){for(var e=[],t=0;t256){for(w=Array(t=256);t--;)w[t]=256*Math.random()|0;t=E=0}for(;t<16;t++)e=w[E+t],6==t?r+=x[15&e|64]:8==t?r+=x[63&e|128]:r+=x[e],1&t&&t>1&&t<11&&(r+="-");return E++,r}let O=32,k=480;class I{id=A();items=[];sizeInBytes=0;maxEventCount;constructor(e){this.maxEventCount=Math.max(1,e)}tryAdd(e){if(this.length===this.maxEventCount)return{success:!1,message:`Event limit of ${this.maxEventCount} has been exceeded.`};let t=this.calculateSize(e.context);return t>1024*O?{success:!1,message:`Event exceeds maximum event size of ${O} KB`}:this.sizeInBytes+t>1024*k?{success:!1,message:`Event has caused batch size to exceed ${k} KB`}:(this.items.push(e),this.sizeInBytes+=t,{success:!0})}get length(){return this.items.length}calculateSize(e){return encodeURI(JSON.stringify(e.event)).split(/%..|i/).length}getEvents(){return this.items.map(({context:e})=>e.event)}getContexts(){return this.items.map(e=>e.context)}resolveEvents(){this.items.forEach(({resolver:e,context:t})=>e(t))}}let C=crypto,T=e=>e instanceof CryptoKey;class P extends Error{constructor(e,t){super(e,t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}P.code="ERR_JOSE_GENERIC";class R extends P{constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=r,this.reason=n,this.payload=t}}R.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class j extends P{constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.code="ERR_JWT_EXPIRED",this.claim=r,this.reason=n,this.payload=t}}j.code="ERR_JWT_EXPIRED";class N extends P{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}N.code="ERR_JOSE_ALG_NOT_ALLOWED";class M extends P{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}}M.code="ERR_JOSE_NOT_SUPPORTED";class L extends P{constructor(e="decryption operation failed",t){super(e,t),this.code="ERR_JWE_DECRYPTION_FAILED"}}L.code="ERR_JWE_DECRYPTION_FAILED";class D extends P{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}}D.code="ERR_JWE_INVALID";class B extends P{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}}B.code="ERR_JWS_INVALID";class F extends P{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}}F.code="ERR_JWT_INVALID";class U extends P{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}}U.code="ERR_JWK_INVALID";class Z extends P{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}}Z.code="ERR_JWKS_INVALID";class Y extends P{constructor(e="no applicable key found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_NO_MATCHING_KEY"}}Y.code="ERR_JWKS_NO_MATCHING_KEY";class H extends P{constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Symbol.asyncIterator,H.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class q extends P{constructor(e="request timed out",t){super(e,t),this.code="ERR_JWKS_TIMEOUT"}}q.code="ERR_JWKS_TIMEOUT";class G extends P{constructor(e="signature verification failed",t){super(e,t),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}G.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";let W=(e,t,r=0)=>{0===r&&(t.unshift(t.length),t.unshift(6));let n=e.indexOf(t[0],r);if(-1===n)return!1;let o=e.subarray(n,n+t.length);return o.length===t.length&&(o.every((e,r)=>e===t[r])||W(e,t,n+1))},K=e=>{switch(!0){case W(e,[42,134,72,206,61,3,1,7]):return"P-256";case W(e,[43,129,4,0,34]):return"P-384";case W(e,[43,129,4,0,35]):return"P-521";case W(e,[43,101,110]):return"X25519";case W(e,[43,101,111]):return"X448";case W(e,[43,101,112]):return"Ed25519";case W(e,[43,101,113]):return"Ed448";default:throw new M("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},V=async(e,t,r,n,o)=>{let i,a,s=new Uint8Array(atob(r.replace(e,"")).split("").map(e=>e.charCodeAt(0))),l="spki"===t;switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},a=l?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},a=l?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},a=l?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":i={name:"ECDSA",namedCurve:"P-256"},a=l?["verify"]:["sign"];break;case"ES384":i={name:"ECDSA",namedCurve:"P-384"},a=l?["verify"]:["sign"];break;case"ES512":i={name:"ECDSA",namedCurve:"P-521"},a=l?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let e=K(s);i=e.startsWith("P-")?{name:"ECDH",namedCurve:e}:{name:e},a=l?[]:["deriveBits"];break}case"Ed25519":i={name:"Ed25519"},a=l?["verify"]:["sign"];break;case"EdDSA":i={name:K(s)},a=l?["verify"]:["sign"];break;default:throw new M('Invalid or unsupported "alg" (Algorithm) value')}return C.subtle.importKey(t,s,i,o?.extractable??!1,a)},z=(e,t,r)=>V(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t,r);async function J(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return z(e,t,r)}let X=new TextEncoder,Q=new TextDecoder;function ee(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}let et=e=>{let t=e;"string"==typeof t&&(t=X.encode(t));let r=32768,n=[];for(let e=0;eet(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),en=e=>{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=Q.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return en(t)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}};function ei(e,t){let r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:t.name};default:throw new M(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}let ea=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};function es(e,t="algorithm.name"){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function el(e,t){return e.name===t}function eu(e){return parseInt(e.name.slice(4),10)}function ec(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}function ed(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){let r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}function ef(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!el(e.algorithm,"HMAC"))throw es("HMAC");let r=parseInt(t.slice(2),10);if(eu(e.algorithm.hash)!==r)throw es(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!el(e.algorithm,"RSASSA-PKCS1-v1_5"))throw es("RSASSA-PKCS1-v1_5");let r=parseInt(t.slice(2),10);if(eu(e.algorithm.hash)!==r)throw es(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!el(e.algorithm,"RSA-PSS"))throw es("RSA-PSS");let r=parseInt(t.slice(2),10);if(eu(e.algorithm.hash)!==r)throw es(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw es("Ed25519 or Ed448");break;case"Ed25519":if(!el(e.algorithm,"Ed25519"))throw es("Ed25519");break;case"ES256":case"ES384":case"ES512":{if(!el(e.algorithm,"ECDSA"))throw es("ECDSA");let r=ec(t);if(e.algorithm.namedCurve!==r)throw es(r,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}ed(e,r)}function ep(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let eh=(e,...t)=>ep("Key must be ",e,...t);function em(e,t,...r){return ep(`Key for the ${e} algorithm must be `,t,...r)}let eg=e=>!!T(e)||e?.[Symbol.toStringTag]==="KeyObject",ey=["CryptoKey"];function ev(e){return"object"==typeof e&&null!==e}function eb(e){if(!ev(e)||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function e_(e){return eb(e)&&"string"==typeof e.kty}function e$(e){return"oct"!==e.kty&&"string"==typeof e.d}function ew(e){return"oct"!==e.kty&&void 0===e.d}function eS(e){return e_(e)&&"oct"===e.kty&&"string"==typeof e.k}function eE(e){let t,r;switch(e.kty){case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new M('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new M('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"Ed25519":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new M('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new M('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}let ex=async e=>{if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=eE(e),n=[t,e.ext??!1,e.key_ops??r],o={...e};return delete o.alg,delete o.use,C.subtle.importKey("jwk",o,...n)},eA=e=>eo(e),eO=e=>e?.[Symbol.toStringTag]==="KeyObject",ek=async(e,t,r,n,o=!1)=>{let i=e.get(t);if(i?.[n])return i[n];let a=await ex({...r,alg:n});return o&&Object.freeze(t),i?i[n]=a:e.set(t,{[n]:a}),a},eI={normalizePublicKey:(e,t)=>{if(eO(e)){let r=e.export({format:"jwk"});return(delete r.d,delete r.dp,delete r.dq,delete r.p,delete r.q,delete r.qi,r.k)?eA(r.k):(o||(o=new WeakMap),ek(o,e,r,t))}return e_(e)?e.k?eo(e.k):(o||(o=new WeakMap),ek(o,e,e,t,!0)):e},normalizePrivateKey:(e,t)=>{if(eO(e)){let r=e.export({format:"jwk"});return r.k?eA(r.k):(n||(n=new WeakMap),ek(n,e,r,t))}return e_(e)?e.k?eo(e.k):(n||(n=new WeakMap),ek(n,e,e,t,!0)):e}};async function eC(e,t,r){if("sign"===r&&(t=await eI.normalizePrivateKey(t,e)),"verify"===r&&(t=await eI.normalizePublicKey(t,e)),T(t))return ef(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError(eh(t,...ey));return C.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw TypeError(eh(t,...ey,"Uint8Array","JSON Web Key"))}let eT=async(e,t,r)=>{let n=await eC(e,t,"sign");return ea(e,n),new Uint8Array(await C.subtle.sign(ei(e,n.algorithm),n,r))},eP=(...e)=>{let t,r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0},eR=e=>e?.[Symbol.toStringTag],ej=(e,t,r)=>{if(void 0!==t.use&&"sig"!==t.use)throw TypeError("Invalid key for this operation, when present its use must be sig");if(void 0!==t.key_ops&&t.key_ops.includes?.(r)!==!0)throw TypeError(`Invalid key for this operation, when present its key_ops must include ${r}`);if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},eN=(e,t,r,n)=>{if(!(t instanceof Uint8Array)){if(n&&e_(t)){if(eS(t)&&ej(e,t,r))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!eg(t))throw TypeError(em(e,t,...ey,"Uint8Array",n?"JSON Web Key":null));if("secret"!==t.type)throw TypeError(`${eR(t)} instances for symmetric algorithms must be of type "secret"`)}},eM=(e,t,r,n)=>{if(n&&e_(t))switch(r){case"sign":if(e$(t)&&ej(e,t,r))return;throw TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(ew(t)&&ej(e,t,r))return;throw TypeError("JSON Web Key for this operation be a public JWK")}if(!eg(t))throw TypeError(em(e,t,...ey,n?"JSON Web Key":null));if("secret"===t.type)throw TypeError(`${eR(t)} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw TypeError(`${eR(t)} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw TypeError(`${eR(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw TypeError(`${eR(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw TypeError(`${eR(t)} instances for asymmetric algorithm encryption must be of type "public"`)};function eL(e,t,r,n){t.startsWith("HS")||"dir"===t||t.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(t)?eN(t,r,n,e):eM(t,r,n,e)}eL.bind(void 0,!1);let eD=eL.bind(void 0,!0),eB=function(e,t,r,n,o){let i;if(void 0!==o.crit&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let a of(i=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,n.crit)){if(!i.has(a))throw new M(`Extension Header Parameter "${a}" is not recognized`);if(void 0===o[a])throw new e(`Extension Header Parameter "${a}" is missing`);if(i.get(a)&&void 0===n[a])throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(n.crit)};class eF{constructor(e){if(!(e instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){let r;if(!this._protectedHeader&&!this._unprotectedHeader)throw new B("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!eP(this._protectedHeader,this._unprotectedHeader))throw new B("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...this._protectedHeader,...this._unprotectedHeader},o=eB(B,new Map([["b64",!0]]),t?.crit,this._protectedHeader,n),i=!0;if(o.has("b64")&&"boolean"!=typeof(i=this._protectedHeader.b64))throw new B('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:a}=n;if("string"!=typeof a||!a)throw new B('JWS "alg" (Algorithm) Header Parameter missing or invalid');eD(a,e,"sign");let s=this._payload;i&&(s=X.encode(er(s)));let l=ee(r=this._protectedHeader?X.encode(er(JSON.stringify(this._protectedHeader))):X.encode(""),X.encode("."),s),u={signature:er(await eT(a,e,l)),payload:""};return i&&(u.payload=Q.decode(s)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=Q.decode(r)),u}}class eU{constructor(e){this._flattened=new eF(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){let r=await this._flattened.sign(e,t);if(void 0===r.payload)throw TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}let eZ=e=>Math.floor(e.getTime()/1e3),eY=60,eH=3600,eq=86400,eG=604800,eW=0x1e187e0,eK=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,eV=e=>{let t,r=eK.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let n=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(n*eY);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(n*eH);break;case"day":case"days":case"d":t=Math.round(n*eq);break;case"week":case"weeks":case"w":t=Math.round(n*eG);break;default:t=Math.round(n*eW)}return"-"===r[1]||"ago"===r[4]?-t:t};function ez(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}class eJ{constructor(e={}){if(!eb(e))throw TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return"number"==typeof e?this._payload={...this._payload,nbf:ez("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:ez("setNotBefore",eZ(e))}:this._payload={...this._payload,nbf:eZ(new Date)+eV(e)},this}setExpirationTime(e){return"number"==typeof e?this._payload={...this._payload,exp:ez("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:ez("setExpirationTime",eZ(e))}:this._payload={...this._payload,exp:eZ(new Date)+eV(e)},this}setIssuedAt(e){return void 0===e?this._payload={...this._payload,iat:eZ(new Date)}:e instanceof Date?this._payload={...this._payload,iat:ez("setIssuedAt",eZ(e))}:"string"==typeof e?this._payload={...this._payload,iat:ez("setIssuedAt",eZ(new Date)+eV(e))}:this._payload={...this._payload,iat:ez("setIssuedAt",e)},this}}class eX extends eJ{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){let r=new eU(X.encode(JSON.stringify(this._payload)));if(r.setProtectedHeader(this._protectedHeader),Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new F("JWTs MUST NOT use unencoded payload");return r.sign(e,t)}}var eQ=function(){function e(e){var t;this.callbacks={},this.warned=!1,this.maxListeners=null!=(t=null==e?void 0:e.maxListeners)?t:10}return e.prototype.warnIfPossibleMemoryLeak=function(e){!this.warned&&this.maxListeners&&this.callbacks[e].length>this.maxListeners&&(console.warn("Event Emitter: Possible memory leak detected; ".concat(String(e)," has exceeded ").concat(this.maxListeners," listeners.")),this.warned=!0)},e.prototype.on=function(e,t){return this.callbacks[e]?(this.callbacks[e].push(t),this.warnIfPossibleMemoryLeak(e)):this.callbacks[e]=[t],this},e.prototype.once=function(e,t){var r=this,n=function(){for(var o=[],i=0;i!!(e&&"object"==typeof e&&"access_token"in e&&"expires_in"in e&&"string"==typeof e.access_token&&"number"==typeof e.expires_in),e1=e=>"function"==typeof e.text;function e2(e){let t={};if(!e)return{};if(e3(e)){for(let[r,n]of e.entries())t[r.toLowerCase()]=n;return t}for(let[r,n]of Object.entries(e))t[r.toLowerCase()]=n;return t}function e3(e){return!!("object"==typeof e&&null!==e&&"entries"in Object(e))&&"function"==typeof Object(e).entries}class e9{alg="RS256";grantType="client_credentials";clientAssertionType="urn:ietf:params:oauth:client-assertion-type:jwt-bearer";clientId;clientKey;keyId;scope;authServer;httpClient;maxRetries;clockSkewInSeconds=0;accessToken;tokenEmitter=new eQ;retryCount;pollerTimer;constructor(e){this.keyId=e.keyId,this.clientId=e.clientId,this.clientKey=e.clientKey,this.authServer=e.authServer??"https://oauth2.segment.io",this.scope=e.scope??"tracking_api:write",this.httpClient=e.httpClient,this.maxRetries=e.maxRetries,this.tokenEmitter.on("access_token",e=>{"token"in e&&(this.accessToken=e.token)}),this.retryCount=0}stopPoller(){clearTimeout(this.pollerTimer)}async pollerLoop(){let e,t=25;try{e=await this.requestAccessToken()}catch(e){return this.handleTransientError({error:e})}if(!e1(e))return this.handleInvalidCustomResponse();let r=e2(e.headers);if(r.date&&this.updateClockSkew(Date.parse(r.date)),200===e.status)try{let r=await e.text(),n=JSON.parse(r);if(!e0(n))throw Error("Response did not contain a valid access_token and expires_in");return n.expires_at=Math.round(Date.now()/1e3)+n.expires_in,this.tokenEmitter.emit("access_token",{token:n}),this.retryCount=0,t=n.expires_in/2*1e3,this.queueNextPoll(t)}catch(e){return this.handleTransientError({error:e,forceEmitError:!0})}return 429===e.status?await this.handleRateLimited(e,r,t):[400,401,415].includes(e.status)?this.handleUnrecoverableErrors(e):this.handleTransientError({error:Error(`[${e.status}] ${e.statusText}`)})}handleTransientError({error:e,forceEmitError:t}){this.incrementRetries({error:e,forceEmitError:t});let r=b({attempt:this.retryCount,minTimeout:25,maxTimeout:1e3});this.queueNextPoll(r)}handleInvalidCustomResponse(){this.tokenEmitter.emit("access_token",{error:Error("HTTPClient does not implement response.text method")})}async handleRateLimited(e,t,r){if(this.incrementRetries({error:Error(`[${e.status}] ${e.statusText}`)}),t["x-ratelimit-reset"]){let e=parseInt(t["x-ratelimit-reset"],10);r=isFinite(e)?e-Date.now()+1e3*this.clockSkewInSeconds:5e3,await s(r),r=0}this.queueNextPoll(r)}handleUnrecoverableErrors(e){this.retryCount=0,this.tokenEmitter.emit("access_token",{error:Error(`[${e.status}] ${e.statusText}`)}),this.stopPoller()}updateClockSkew(e){this.clockSkewInSeconds=(Date.now()-e)/1e3}incrementRetries({error:e,forceEmitError:t}){this.retryCount++,(t||this.retryCount%this.maxRetries==0)&&(this.retryCount=0,this.tokenEmitter.emit("access_token",{error:e}))}queueNextPoll(e){this.pollerTimer=setTimeout(()=>this.pollerLoop(),e),this.pollerTimer.unref&&this.pollerTimer.unref()}async requestAccessToken(){let e=5,t=55,r=A(),n=Math.round(Date.now()/1e3)-this.clockSkewInSeconds,o={iss:this.clientId,sub:this.clientId,aud:this.authServer,iat:n-e,exp:n+t,jti:r},i=await J(this.clientKey,"RS256"),a=await new eX(o).setProtectedHeader({alg:this.alg,kid:this.keyId,typ:"JWT"}).sign(i),s=`grant_type=${this.grantType}&client_assertion_type=${this.clientAssertionType}&client_assertion=${a}&scope=${this.scope}`,l={method:"POST",url:`${this.authServer}/token`,body:s,headers:{"Content-Type":"application/x-www-form-urlencoded"},httpRequestTimeout:1e4};return this.httpClient.makeRequest(l)}async getAccessToken(){return this.isValidToken(this.accessToken)?this.accessToken:(this.stopPoller(),this.pollerLoop().catch(()=>{}),new Promise((e,t)=>{this.tokenEmitter.once("access_token",r=>{"token"in r?e(r.token):t(r.error)})}))}clearToken(){this.accessToken=void 0}isValidToken(e){return null!=e&&e.expires_insetTimeout(t,e))}function e8(){}class e6{pendingFlushTimeout;_batch;_flushInterval;_flushAt;_maxRetries;_url;_flushPendingItemsCount;_httpRequestTimeout;_emitter;_disable;_httpClient;_writeKey;_tokenManager;constructor({host:e,path:t,maxRetries:r,flushAt:n,flushInterval:o,writeKey:i,httpRequestTimeout:a,httpClient:s,disable:l,oauthSettings:u},c){this._emitter=c,this._maxRetries=r,this._flushAt=Math.max(n,1),this._flushInterval=o,this._url=$(e??"https://api.segment.io",t??"/v1/batch"),this._httpRequestTimeout=a??1e4,this._disable=!!l,this._httpClient=s,this._writeKey=i,u&&(this._tokenManager=new e9({...u,httpClient:u.httpClient??s,maxRetries:u.maxRetries??r}))}createBatch(){this.pendingFlushTimeout&&clearTimeout(this.pendingFlushTimeout);let e=new I(this._flushAt);return this._batch=e,this.pendingFlushTimeout=setTimeout(()=>{e===this._batch&&(this._batch=void 0),this.pendingFlushTimeout=void 0,e.length&&this.send(e).catch(e8)},this._flushInterval),e}clearBatch(){this.pendingFlushTimeout&&clearTimeout(this.pendingFlushTimeout),this._batch=void 0}flush(e){if(!e){this._tokenManager&&this._tokenManager.stopPoller();return}this._flushPendingItemsCount=e,this._batch&&this._batch.length===e&&(this.send(this._batch).catch(e8).finally(()=>{this._tokenManager&&this._tokenManager.stopPoller()}),this.clearBatch())}enqueue(e){let t=this._batch??this.createBatch(),{promise:r,resolve:n}=S(),o={context:e,resolver:n};if(t.tryAdd(o).success){let e=t.length===this._flushPendingItemsCount;return(t.length===this._flushAt||e)&&(this.send(t).catch(e8),this.clearBatch()),r}t.length&&(this.send(t).catch(e8),this.clearBatch());let i=this.createBatch(),a=i.tryAdd(o);return a.success?(i.length===this._flushPendingItemsCount&&(this.send(i).catch(e8),this.clearBatch()),r):(e.setFailedDelivery({reason:Error(a.message)}),Promise.resolve(e))}async send(e){this._flushPendingItemsCount&&(this._flushPendingItemsCount-=e.length);let t=e.getEvents(),r=this._maxRetries+1,n=0;for(;n=200&&s.status<300)return void e.resolveEvents();if(this._tokenManager&&(400===s.status||401===s.status||403===s.status))this._tokenManager.clearToken(),i=Error(`[${s.status}] ${s.statusText}`);else if(400===s.status)return void e5(e,Error(`[${s.status}] ${s.statusText}`));else if(429===s.status){if(s.headers&&"x-ratelimit-reset"in s.headers){let e=parseInt(s.headers["x-ratelimit-reset"],10);isFinite(e)&&(o=e-Date.now())}i=Error(`[${s.status}] ${s.statusText}`)}else i=Error(`[${s.status}] ${s.statusText}`)}catch(e){i=e}if(n===r)return void e5(e,i);await e4(o||b({attempt:n,minTimeout:25,maxTimeout:1e3}))}}}function e5(e,t){e.getContexts().forEach(e=>e.setFailedDelivery({reason:t})),e.resolveEvents()}var e7=r(33601);let te=()=>"object"==typeof e7&&e7&&"object"==typeof e7.env&&e7.env&&"string"==typeof e7.version?"node":"object"==typeof window?"browser":"undefined"!=typeof WebSocketPair?"cloudflare-worker":"string"==typeof EdgeRuntime?"vercel-edge":"undefined"!=typeof WorkerGlobalScope&&"function"==typeof importScripts?"web-worker":"unknown";var tt=r(33601);function tr(e){e.updateEvent("context.library.name","@segment/analytics-node"),e.updateEvent("context.library.version",v);let t=te();"node"===t&&e.updateEvent("_metadata.nodeVersion",tt.version),e.updateEvent("_metadata.jsRuntime",t)}function tn(e){function t(t){return tr(t),e.enqueue(t)}return{name:"Segment.io",type:"destination",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),alias:t,group:t,identify:t,page:t,screen:t,track:t}}let to=(e,t)=>{let r=new e6(e,t);return{publisher:r,plugin:tn(r)}};function ti(e,t,r){t.split&&(t=t.split("."));for(var n,o,i=0,a=t.length,s=e;i`node-next-${Date.now()}-${A()}`;class tE extends tw{constructor(){super({createMessageId:tS,onFinishedEvent:e=>{tp(e)}})}}var tx=function(e,t){return Math.max((null!=t?t:300)-(Date.now()-e),0)};function tA(e,t,r,n){return p(this,void 0,void 0,function(){var o,i;return h(this,function(a){switch(a.label){case 0:if(r.emit("dispatch_start",e),o=Date.now(),!t.isEmpty())return[3,2];return[4,t.dispatchSingle(e)];case 1:return i=a.sent(),[3,4];case 2:return[4,t.dispatch(e)];case 3:i=a.sent(),a.label=4;case 4:if(!(null==n?void 0:n.callback))return[3,6];return[4,l(i,n.callback,tx(o,n.timeout))];case 5:i=a.sent(),a.label=6;case 6:return(null==n?void 0:n.debug)&&i.flush(),[2,i]}})})}var tO=function(){function e(){this._logs=[]}return e.prototype.log=function(e,t,r){var n=new Date;this._logs.push({level:e,message:t,time:n,extras:r})},Object.defineProperty(e.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),e.prototype.flush=function(){if(this.logs.length>1){var e=this._logs.reduce(function(e,t){var r,n,o,i=d(d({},t),{json:JSON.stringify(t.extras,null," "),extras:t.extras});delete i.time;var a=null!=(o=null==(n=t.time)?void 0:n.toISOString())?o:"";return e[a]&&(a="".concat(a,"-").concat(Math.random())),d(d({},e),((r={})[a]=i,r))},{});console.table?console.table(e):console.log(e)}else this.logs.forEach(function(e){var t=e.level,r=e.message,n=e.extras;"info"===t||"debug"===t?console.log(r,null!=n?n:""):console[t](r,null!=n?n:"")});this._logs=[]},e}(),tk=function(e){return({gauge:"g",counter:"c"})[e]},tI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.gauge=function(){for(var e=[],t=0;tt=>{let r=t.failedDelivery();return r?e(r.reason,t):e(void 0,t)},tj=async(e,t,r,n)=>{try{let o=new tP(e),i=await tA(o,t,r,{...n?{callback:tR(n)}:{}}),a=i.failedDelivery();a?r.emit("error",{code:"delivery_failure",reason:a.reason,ctx:i}):r.emit(e.type,i)}catch(e){r.emit("error",{code:"unknown",reason:e})}};class tN extends eQ{}var tM="onRemoveFromFuture",tL=function(e){function t(t,r,n){var o=e.call(this)||this;return o.future=[],o.maxAttempts=t,o.queue=r,o.seen=null!=n?n:{},o}return c(t,e),t.prototype.push=function(){for(var e=this,t=[],r=0;re.maxAttempts||e.includes(t))&&(e.queue.push(t),!0)});return this.queue=this.queue.sort(function(t,r){return e.getAttempts(t)-e.getAttempts(r)}),n},t.prototype.pushWithBackoff=function(e,t){var r=this;if(void 0===t&&(t=0),0==t&&0===this.getAttempts(e))return this.push(e)[0];var n=this.updateAttempts(e);if(n>this.maxAttempts||this.includes(e))return!1;var o=b({attempt:n-1});return t>0&&o1&&this.emit("delivery_retry",e),o=(n=this.availableExtensions(null!=(t=e.event.integrations)?t:{})).before,i=n.enrichment,a=0,s=o,h.label=1;case 1:if(!(a{if("cloudflare-worker"===te())return[];let t=new(globalThis.AbortController||tW),r=setTimeout(()=>{t.abort()},e);return r?.unref?.(),[t.signal,r]},tV=async(...e)=>{if(globalThis.fetch)return globalThis.fetch(...e);if("string"!=typeof EdgeRuntime)return(await r.e(81).then(r.t.bind(r,33081,23))).default(...e);throw Error("Invariant: an edge runtime that does not support fetch should not exist")};class tz{_fetch;constructor(e){this._fetch=e??tV}async makeRequest(e){let[t,r]=tK(e.httpRequestTimeout),n={url:e.url,method:e.method,headers:e.headers,body:e.body,signal:t};return this._fetch(e.url,n).finally(()=>clearTimeout(r))}}class tJ extends tN{_eventFactory;_isClosed=!1;_pendingEvents=0;_closeAndFlushDefaultTimeout;_publisher;_isFlushing=!1;_queue;ready;constructor(e){super(),y(e),this._eventFactory=new tE,this._queue=new tG;let t=e.flushInterval??1e4;this._closeAndFlushDefaultTimeout=1.25*t;let{plugin:r,publisher:n}=to({writeKey:e.writeKey,host:e.host,path:e.path,maxRetries:e.maxRetries??3,flushAt:e.flushAt??e.maxEventsInBatch??15,httpRequestTimeout:e.httpRequestTimeout,disable:e.disable,flushInterval:t,httpClient:"function"==typeof e.httpClient?new tz(e.httpClient):e.httpClient??new tz,oauthSettings:e.oauthSettings},this);this._publisher=n,this.ready=this.register(r).then(()=>void 0),this.emit("initialize",e),i(this)}get VERSION(){return v}closeAndFlush({timeout:e=this._closeAndFlushDefaultTimeout}={}){return this.flush({timeout:e,close:!0})}async flush({timeout:e,close:t=!1}={}){if(this._isFlushing)return void console.warn("Overlapping flush calls detected. Please wait for the previous flush to finish before calling .flush again");this._isFlushing=!0,t&&(this._isClosed=!0),this._publisher.flush(this._pendingEvents);let r=new Promise(e=>{this._pendingEvents?this.once("drained",()=>{e()}):e()}).finally(()=>{this._isFlushing=!1});return e?a(r,e).catch(()=>void 0):r}_dispatch(e,t){if(this._isClosed)return void this.emit("call_after_close",e);this._pendingEvents++,tj(e,this._queue,this,t).catch(e=>e).finally(()=>{this._pendingEvents--,this._pendingEvents||this.emit("drained")})}alias({userId:e,previousId:t,context:r,timestamp:n,integrations:o,messageId:i},a){let s=this._eventFactory.alias(e,t,{context:r,integrations:o,timestamp:n,messageId:i});this._dispatch(s,a)}group({timestamp:e,groupId:t,userId:r,anonymousId:n,traits:o={},context:i,integrations:a,messageId:s},l){let u=this._eventFactory.group(t,o,{context:i,anonymousId:n,userId:r,timestamp:e,integrations:a,messageId:s});this._dispatch(u,l)}identify({userId:e,anonymousId:t,traits:r={},context:n,timestamp:o,integrations:i,messageId:a},s){let l=this._eventFactory.identify(e,r,{context:n,anonymousId:t,userId:e,timestamp:o,integrations:i,messageId:a});this._dispatch(l,s)}page({userId:e,anonymousId:t,category:r,name:n,properties:o,context:i,timestamp:a,integrations:s,messageId:l},u){let c=this._eventFactory.page(r??null,n??null,o,{context:i,anonymousId:t,userId:e,timestamp:a,integrations:s,messageId:l});this._dispatch(c,u)}screen({userId:e,anonymousId:t,category:r,name:n,properties:o,context:i,timestamp:a,integrations:s,messageId:l},u){let c=this._eventFactory.screen(r??null,n??null,o,{context:i,anonymousId:t,userId:e,timestamp:a,integrations:s,messageId:l});this._dispatch(c,u)}track({userId:e,anonymousId:t,event:r,properties:n,context:o,timestamp:i,integrations:a,messageId:s},l){let u=this._eventFactory.track(r,n,{context:o,userId:e,anonymousId:t,timestamp:i,integrations:a,messageId:s});this._dispatch(u,l)}register(...e){return this._queue.criticalTasks.run(async()=>{let t=tP.system(),r=e.map(e=>this._queue.register(t,e,this));await Promise.all(r),this.emit("register",e.map(e=>e.name))})}async deregister(...e){let t=tP.system(),r=e.map(e=>{let r=this._queue.plugins.find(t=>t.name===e);if(r)return this._queue.deregister(t,r,this);t.log("warn",`plugin ${e} not found`)});await Promise.all(r),this.emit("deregister",e)}}},45859:(e,t,r)=>{"use strict";var n,o;r.d(t,{CR:()=>a,ZS:()=>n,Zp:()=>i,o6:()=>o}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},e.getValidEnumValues=t=>{let r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(let e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(let r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(n||(n={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(o||(o={}));let i=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),a=e=>{switch(typeof e){case"undefined":return i.undefined;case"string":return i.string;case"number":return Number.isNaN(e)?i.nan:i.number;case"boolean":return i.boolean;case"function":return i.function;case"bigint":return i.bigint;case"symbol":return i.symbol;case"object":if(Array.isArray(e))return i.array;if(null===e)return i.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return i.promise;if("undefined"!=typeof Map&&e instanceof Map)return i.map;if("undefined"!=typeof Set&&e instanceof Set)return i.set;if("undefined"!=typeof Date&&e instanceof Date)return i.date;return i.object;default:return i.unknown}}},46440:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(r(78619)),o=r(9354);function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:66;return(0,n.default)(e,t)},s={spyCallbacks:[],spySetState:[],scrollSpyContainers:[],mount:function(e,t){if(e){var r=a(function(t){s.scrollHandler(e)},t);s.scrollSpyContainers.push(e),(0,o.addPassiveEventListener)(e,"scroll",r)}},isMounted:function(e){return -1!==s.scrollSpyContainers.indexOf(e)},currentPositionX:function(e){if(e!==document)return e.scrollLeft;var t=void 0!==window.pageYOffset,r="CSS1Compat"===(document.compatMode||"");return t?window.pageXOffset:r?document.documentElement.scrollLeft:document.body.scrollLeft},currentPositionY:function(e){if(e!==document)return e.scrollTop;var t=void 0!==window.pageXOffset,r="CSS1Compat"===(document.compatMode||"");return t?window.pageYOffset:r?document.documentElement.scrollTop:document.body.scrollTop},scrollHandler:function(e){(s.scrollSpyContainers[s.scrollSpyContainers.indexOf(e)].spyCallbacks||[]).forEach(function(t){return t(s.currentPositionX(e),s.currentPositionY(e))})},addStateHandler:function(e){s.spySetState.push(e)},addSpyHandler:function(e,t){var r=s.scrollSpyContainers[s.scrollSpyContainers.indexOf(t)];r.spyCallbacks||(r.spyCallbacks=[]),r.spyCallbacks.push(e),e(s.currentPositionX(t),s.currentPositionY(t))},updateStates:function(){s.spySetState.forEach(function(e){return e()})},unmount:function(e,t){s.scrollSpyContainers.forEach(function(e){return e.spyCallbacks&&e.spyCallbacks.length&&e.spyCallbacks.indexOf(t)>-1&&e.spyCallbacks.splice(e.spyCallbacks.indexOf(t),1)}),s.spySetState&&s.spySetState.length&&s.spySetState.indexOf(e)>-1&&s.spySetState.splice(s.spySetState.indexOf(e),1),document.removeEventListener("scroll",s.scrollHandler)},update:function(){return s.scrollSpyContainers.forEach(function(e){return s.scrollHandler(e)})}};t.default=s},46994:(e,t,r)=>{var n="/",o=r(33601);!function(){var t={782:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},646:function(e){"use strict";let t={};function r(e,r,n){function o(e,t,n){return"string"==typeof r?r:r(e,t,n)}n||(n=Error);class i extends n{constructor(e,t,r){super(o(e,t,r))}}i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(!Array.isArray(e))return`of ${t} ${String(e)}`;{let r=e.length;return(e=e.map(e=>String(e)),r>2)?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}}function o(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function i(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function a(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){let s,l;if("string"==typeof t&&o(t,"not ")?(s="must not be",t=t.replace(/^not /,"")):s="must be",i(e," argument"))l=`The ${e} ${s} ${n(t,"type")}`;else{let r=a(e,".")?"property":"argument";l=`The "${e}" ${r} ${s} ${n(t,"type")}`}return l+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},403:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(709),a=r(337);r(782)(c,i);for(var s=n(a.prototype),l=0;l0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=h(t)),n)s.endEmitted?x(e,new E):T(e,s,t,!0);else if(s.ended)x(e,new w);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?T(e,s,t,!1):B(e,s)):T(e,s,t,!1)}else n||(s.reading=!1,B(e,s));return!s.ended&&(s.length=R?e=R:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function N(e,t){if(e<=0||0===t.length&&t.ended)return 0;if(t.objectMode)return 1;if(e!=e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;return(e>t.highWaterMark&&(t.highWaterMark=j(e)),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function M(e,t){if(a("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?L(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,D(e)))}}function L(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick(D,e))}function D(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,G(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(F,e,t))}function F(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function Y(e){a("readable nexttick read 0"),e.read(0)}function H(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(q,e,t))}function q(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),G(e),t.flowing&&!t.reading&&e.read(0)}function G(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function W(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function K(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(V,t,e))}function V(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function z(e,t){for(var r=0,n=e.length;r=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?K(this):L(this),null;if(0===(e=N(e,r))&&r.ended)return 0===r.length&&K(this),null;var o=r.needReadable;return a("need readable",o),(0===r.length||r.length-e0?W(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&K(this)),null!==t&&this.emit("data",t),t},I.prototype._read=function(e){x(this,new S("_read()"))},I.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var i=t&&!1===t.end||e===o.stdout||e===o.stderr?y:l;function s(e,t){a("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,f())}function l(){a("onend"),e.end()}n.endEmitted?o.nextTick(i):r.once("end",i),e.on("unpipe",s);var u=U(r);e.on("drain",u);var d=!1;function f(){a("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",y),r.removeListener("data",p),d=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}function p(t){a("ondata");var o=e.write(t);a("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==z(n.pipes,e))&&!d&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){a("onerror",t),y(),e.removeListener("error",h),0===c(e,"error")&&x(e,t)}function m(){e.removeListener("finish",g),y()}function g(){a("onfinish"),e.removeListener("close",m),y()}function y(){a("unpipe"),r.unpipe(e)}return r.on("data",p),O(e,"error",h),e.once("close",m),e.once("finish",g),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},I.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?L(this):n.reading||o.nextTick(Y,this)),r},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,t){var r=d.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(Z,this),r},I.prototype.removeAllListeners=function(e){var t=d.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&o.nextTick(Z,this),t},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,H(this,e)),e.paused=!1,this},I.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){if(a("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!r.objectMode||null!=o)(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new v("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||H(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=h.destroy,k.prototype._undestroy=h.undestroy,k.prototype._destroy=function(e,t){t(e)}},871:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i,a=r(698),s=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),d=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function h(e,t){return{value:e,done:t}}function m(e){var t=e[s];if(null!==t){var r=e[p].read();null!==r&&(e[d]=null,e[s]=null,e[l]=null,t(h(r,!1)))}}function g(e){o.nextTick(m,e)}function y(e,t){return function(r,n){e.then(function(){if(t[c])return void r(h(void 0,!0));t[f](r,n)},n)}}var v=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((n(i={get stream(){return this[p]},next:function(){var e,t=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[c])return Promise.resolve(h(void 0,!0));if(this[p].destroyed)return new Promise(function(e,r){o.nextTick(function(){t[u]?r(t[u]):e(h(void 0,!0))})});var n=this[d];if(n)e=new Promise(y(n,this));else{var i=this[p].read();if(null!==i)return Promise.resolve(h(i,!1));e=new Promise(this[f])}return this[d]=e,e}},Symbol.asyncIterator,function(){return this}),n(i,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){if(e)return void r(e);t(h(void 0,!0))})})}),i),v);e.exports=function(e){var t,r=Object.create(b,(n(t={},p,{value:e,writable:!0}),n(t,s,{value:null,writable:!0}),n(t,l,{value:null,writable:!0}),n(t,u,{value:null,writable:!0}),n(t,c,{value:e._readableState.endEmitted,writable:!0}),n(t,f,{value:function(e,t){var n=r[p].read();n?(r[d]=null,r[s]=null,r[l]=null,e(h(n,!1))):(r[s]=e,r[l]=t)},writable:!0}),t));return r[d]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];null!==t&&(r[d]=null,r[s]=null,r[l]=null,t(e)),r[u]=e;return}var n=r[s];null!==n&&(r[d]=null,r[s]=null,r[l]=null,n(h(void 0,!0))),r[c]=!0}),e.on("readable",g.bind(null,r)),r}},379:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t=u.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return eo.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0==(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,t}},{key:d,value:function(e,t){return c(this,o({},t,{depth:0,customInspect:!1}))}}]),e}()},25:function(e){"use strict";function t(e,t){n(e,t),r(e)}function r(e){(!e._writableState||e._writableState.emitClose)&&(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var a=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,o.nextTick(n,this,e)):o.nextTick(n,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!i&&e?a._writableState?a._writableState.errorEmitted?o.nextTick(r,a):(a._writableState.errorEmitted=!0,o.nextTick(t,a,e)):o.nextTick(t,a,e):i?(o.nextTick(r,a),i(e)):o.nextTick(r,a)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},698:function(e,t,r){"use strict";var n=r(646).q.ERR_STREAM_PREMATURE_CLOSE;function o(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=Array(r),o=0;o0,function(t){e||(e=t),t&&i.forEach(d),a||(i.forEach(d),o(e))})});return r.reduce(f)}},776:function(e,t,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;function o(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}e.exports={getHighWaterMark:function(e,t,r,i){var a=o(t,i,r);if(null!=a){if(!(isFinite(a)&&Math.floor(a)===a)||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},678:function(e,t,r){e.exports=r(781)},55:function(e,t,r){var n=r(300),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},173:function(e,t,r){e.exports=o;var n=r(361).EventEmitter;function o(){n.call(this)}r(782)(o,n),o.Readable=r(709),o.Writable=r(337),o.Duplex=r(403),o.Transform=r(170),o.PassThrough=r(889),o.finished=r(698),o.pipeline=r(442),o.Stream=o,o.prototype.pipe=function(e,t){var r=this;function o(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var a=!1;function s(){a||(a=!0,e.end())}function l(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",o),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},704:function(e,t,r){"use strict";var n=r(55).Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function a(e){var t=i(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=a(e),this.encoding){case"utf16le":this.text=h,this.end=m,t=4;break;case"utf8":this.fillLast=d,t=4;break;case"base64":this.text=g,this.end=y,t=3;break;default:this.write=v,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function l(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e,t,r){var n=t.length-1;if(n=0?(o>0&&(e.lastNeed=o-1),o):--n=0?(o>0&&(e.lastNeed=o-2),o):--n=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}function c(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function d(e){var t=this.lastTotal-this.lastNeed,r=c(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function f(e,t){var r=u(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function h(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function m(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function g(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function y(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function b(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(r(2166)),o=i(r(13108));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return(0,n.default)((0,o.default)(e,t),t)}e.exports=t.default,e.exports.default=t.default},47684:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;var n=42;for(var o in e[t]=n,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==n||!0!==a.enumerable)return!1}return!0}},47701:(e,t,r)=>{var n=r(92572).Buffer,o=r(15618),i=r(3347),a=r(46994),s=r(21175),l=r(84864);function u(e,t){return n.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(e,t,r){r=r||"utf8";var n=u(s(e),"binary"),o=u(s(t),r);return l.format("%s.%s",n,o)}function d(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,o=e.encoding,a=i(t.alg),s=c(t,r,o),u=a.sign(s,n);return l.format("%s.%s",s,u)}function f(e){var t=new o(e.secret||e.privateKey||e.key);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=t,this.payload=new o(e.payload),this.secret.once("close",(function(){!this.payload.writable&&this.readable&&this.sign()}).bind(this)),this.payload.once("close",(function(){!this.secret.writable&&this.readable&&this.sign()}).bind(this))}l.inherits(f,a),f.prototype.sign=function(){try{var e=d({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},f.sign=d,e.exports=f},47824:(e,t,r)=>{"use strict";var n=r(54913),o=r(80454),i=n("RegExp.prototype.exec"),a=r(72206);e.exports=function(e){if(!o(e))throw new a("`regex` must be a RegExp");return function(t){return null!==i(e,t)}}},47967:(e,t,r)=>{"use strict";var n=Object.assign||function(e){for(var t=1;t=Math.floor(a)&&d=Math.floor(s),m=r.getActiveLink();if(h)return o===m&&r.setActiveLink(void 0),e.props.hashSpy&&f.getHash()===o&&f.changeHash(),e.props.spy&&e.state.active&&(e.setState({active:!1}),e.props.onSetInactive&&e.props.onSetInactive()),u.updateStates();if(p&&m!==o)return r.setActiveLink(o),e.props.hashSpy&&f.changeHash(o),e.props.spy&&(e.setState({active:!0}),e.props.onSetActive&&e.props.onSetActive(o)),u.updateStates()}}};return d.propTypes=p,d.defaultProps={offset:0},d},Element:function(e){console.warn("Helpers.Element is deprecated since v1.7.0");var t=function(t){function r(e){i(this,r);var t=a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.childBindings={domNode:null},t}return s(r,t),o(r,[{key:"componentDidMount",value:function(){if("undefined"==typeof window)return!1;this.registerElems(this.props.name)}},{key:"componentDidUpdate",value:function(e){this.props.name!==e.name&&this.registerElems(this.props.name)}},{key:"componentWillUnmount",value:function(){if("undefined"==typeof window)return!1;c.unregister(this.props.name)}},{key:"registerElems",value:function(e){c.register(e,this.childBindings.domNode)}},{key:"render",value:function(){return l.createElement(e,n({},this.props,{parentBindings:this.childBindings}))}}]),r}(l.Component);return t.propTypes={name:d.string,id:d.string},t}}},48033:(e,t,r)=>{"use strict";var n=r(27721)(),o=r(54913)("Object.prototype.toString"),i=function(e){return(!n||!e||"object"!=typeof e||!(Symbol.toStringTag in e))&&"[object Arguments]"===o(e)},a=function(e){return!!i(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"callee"in e&&"[object Function]"===o(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=s?i:a},48353:(e,t,r)=>{"use strict";r.d(t,{g:()=>w});var n=r(38483),o=r(14287),i=r(6663),a=i.Ik({id:i.Yj(),answer:i.Yj(),task_id:i.Yj(),conversation_id:i.Yj(),message_id:i.Yj(),metadata:i.Ik({usage:i.Ik({completion_tokens:i.ai(),prompt_tokens:i.ai(),total_tokens:i.ai()})})}),s=i.Ik({code:i.Yj(),message:i.Yj(),status:i.ai()}),l=i.Ik({event:i.Yj(),conversation_id:i.Yj().optional(),message_id:i.Yj().optional(),task_id:i.Yj().optional(),created_at:i.ai().optional()}).passthrough(),u=l.extend({event:i.eu("workflow_started"),workflow_run_id:i.Yj(),data:i.Ik({id:i.Yj(),workflow_id:i.Yj(),created_at:i.ai()}).passthrough()}),c=l.extend({event:i.eu("workflow_finished"),workflow_run_id:i.Yj(),data:i.Ik({id:i.Yj(),workflow_id:i.Yj(),total_tokens:i.ai().optional(),created_at:i.ai()}).passthrough()}),d=l.extend({event:i.eu("node_started"),workflow_run_id:i.Yj(),data:i.Ik({id:i.Yj(),node_id:i.Yj(),node_type:i.Yj()}).passthrough()}),f=l.extend({event:i.eu("node_finished"),workflow_run_id:i.Yj(),data:i.Ik({id:i.Yj(),node_id:i.Yj(),node_type:i.Yj()}).passthrough()}),p=l.extend({event:i.eu("message"),id:i.Yj().optional(),answer:i.Yj(),from_variable_selector:i.YO(i.Yj()).optional()}),h=l.extend({event:i.eu("message_end"),id:i.Yj(),metadata:i.Ik({usage:i.Ik({prompt_tokens:i.ai(),completion_tokens:i.ai(),total_tokens:i.ai()}).passthrough()}).passthrough(),files:i.YO(i.L5()).optional()}),m=l.extend({event:i.eu("tts_message"),audio:i.Yj()}),g=l.extend({event:i.eu("tts_message_end"),audio:i.Yj()}),y=l.extend({event:i.eu("agent_message"),answer:i.Yj()}),v=l.extend({event:i.eu("agent_thought"),thought:i.Yj(),observation:i.Yj(),tool:i.Yj(),tool_labels:i.g1(i.Yj(),i.Yj()),tool_input:i.Yj(),message_files:i.YO(i.L5())}),b=i.gM("event",[u,c,d,f,p,h,m,g,v,y]).or(l),_=(0,n.sl)({errorSchema:s,errorToMessage:e=>(console.log("Dify API error:",e),`Dify API error: ${e.message}`)}),$=class{constructor(e,t,r){this.settings=t,this.specificationVersion="v1",this.defaultObjectGenerationMode=void 0,this.modelId=e,this.config=r,this.generateId=n.$C,this.chatMessagesEndpoint=`${this.config.baseURL}/chat-messages`,this.settings.responseMode||(this.settings.responseMode="streaming")}get provider(){return this.config.provider}async doGenerate(e){var t,r,o,i;let{abortSignal:s}=e,l=this.getRequestBody(e),{responseHeaders:u,value:c}=await (0,n.GU)({url:this.chatMessagesEndpoint,headers:(0,n.m2)(this.config.headers(),e.headers),body:l,abortSignal:s,failedResponseHandler:_,successfulResponseHandler:(0,n.cV)(a),fetch:this.config.fetch});return{text:c.answer,toolCalls:[],finishReason:"stop",usage:{promptTokens:(null==(r=null==(t=c.metadata)?void 0:t.usage)?void 0:r.prompt_tokens)||0,completionTokens:(null==(i=null==(o=c.metadata)?void 0:o.usage)?void 0:i.completion_tokens)||0},rawCall:this.createRawCall(e),providerMetadata:{difyWorkflowData:{conversationId:c.conversation_id,messageId:c.message_id}},rawResponse:{headers:u,body:c},request:{body:JSON.stringify(l)},response:{id:c.id,timestamp:new Date}}}async doStream(e){let t,r,o,{abortSignal:i}=e,a={...this.getRequestBody(e),response_mode:"streaming"},{responseHeaders:s,value:l}=await (0,n.GU)({url:this.chatMessagesEndpoint,headers:(0,n.m2)(this.config.headers(),e.headers),body:a,failedResponseHandler:_,successfulResponseHandler:(0,n.Ds)(b),abortSignal:i,fetch:this.config.fetch});return{stream:l.pipeThrough(new TransformStream({transform(e,n){if(!e.success)return void n.enqueue({type:"error",error:e.error});let i=e.value;switch(i.conversation_id&&(t=i.conversation_id),i.message_id&&(r=i.message_id),i.task_id&&(o=i.task_id),i.event){case"workflow_finished":case"message_end":{let e=0;"data"in i&&i.data&&"object"==typeof i.data&&"total_tokens"in i.data&&"number"==typeof i.data.total_tokens&&(e=i.data.total_tokens),n.enqueue({type:"finish",finishReason:"stop",providerMetadata:{difyWorkflowData:{conversationId:t,messageId:r,taskId:o}},usage:{promptTokens:0,completionTokens:e}});break}case"message":case"agent_message":"answer"in i&&"string"==typeof i.answer&&(n.enqueue({type:"text-delta",textDelta:i.answer}),"id"in i&&"string"==typeof i.id&&n.enqueue({type:"response-metadata",id:i.id}))}}})),rawCall:this.createRawCall(e),rawResponse:{headers:s},request:{body:JSON.stringify(a)}}}getRequestBody(e){var t,r,n;let i=e.messages||e.prompt;if(!i||!i.length)throw new o.hL({message:"No messages provided",url:this.chatMessagesEndpoint,requestBodyValues:e});let a=i[i.length-1];if("user"!==a.role)throw new o.hL({message:"The last message must be a user message",url:this.chatMessagesEndpoint,requestBodyValues:{latestMessageRole:a.role}});if(Array.isArray(a.content)&&a.content.some(e=>"string"!=typeof e&&"image"===e.type))throw new o.hL({message:"Dify provider does not currently support image attachments",url:this.chatMessagesEndpoint,requestBodyValues:{hasAttachments:!0}});let s="";"string"==typeof a.content?s=a.content:Array.isArray(a.content)&&(s=a.content.map(e=>"string"==typeof e?e:"text"===e.type?e.text:"").filter(Boolean).join(" "));let l=null==(t=e.headers)?void 0:t["chat-id"],u=null!=(n=null==(r=e.headers)?void 0:r["user-id"])?n:"you_should_pass_user-id",{"chat-id":c,"user-id":d,...f}=e.headers||{};return e.headers=f,{inputs:this.settings.inputs||{},query:s,response_mode:this.settings.responseMode,conversation_id:l,user:u}}createRawCall(e){return{rawPrompt:e.messages||e.prompt,rawSettings:{...this.settings}}}supportsUrl(e){return!1}};function w(e={}){let t=(t,r={})=>new $(t,r,{provider:"dify.chat",baseURL:e.baseURL||"https://api.dify.ai/v1",headers:()=>({Authorization:`Bearer ${(0,n.WL)({apiKey:r.apiKey,environmentVariableName:"DIFY_API_KEY",description:"Dify API Key"})}`,"Content-Type":"application/json",...e.headers})}),r=function(e,r){if(new.target)throw Error("The model factory function cannot be called with the new keyword.");return t(e,r)};return r.chat=t,r}w()},48479:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,a=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;function s(e){(0,n.default)(e);var t=e.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/ig,"$1");return -1!==t.indexOf(",")?i.test(t):a.test(t)}e.exports=t.default,e.exports.default=t.default},48983:(e,t)=>{"use strict";t.byteLength=u,t.toByteArray=d,t.fromByteArray=h;for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function u(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n}function c(e,t,r){return(t+r)*3/4-r}function d(e){var t,r,i=l(e),a=i[0],s=i[1],u=new o(c(e,a,s)),d=0,f=s>0?a-4:a;for(r=0;r>16&255,u[d++]=t>>8&255,u[d++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[d++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[d++]=t>>8&255,u[d++]=255&t),u}function f(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function p(e,t,r){for(var n=[],o=t;ol?l:s+a));return 1===o?i.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===o&&i.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),i.join("")}n[45]=62,n[95]=63},49059:(e,t,r)=>{"use strict";let n=r(77721),o=r(26829),{safeRe:i,t:a}=r(8887);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let n,o=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL];for(;(n=o.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),o.lastIndex=n.index+n[1].length+n[2].length;o.lastIndex=-1}else r=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);if(null===r)return null;let s=r[2],l=r[3]||"0",u=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return o(`${s}.${l}.${u}${c}${d}`,t)}},49512:(e,t,r)=>{"use strict";let n=r(26829);e.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},49600:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=a(r(79922)),o=r(32539),i=r(25247);function a(e){return e&&e.__esModule?e:{default:e}}function s(e){return(0,n.default)(e),o.fullWidth.test(e)&&i.halfWidth.test(e)}e.exports=t.default,e.exports.default=t.default},49694:e=>{"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},50141:(e,t,r)=>{"use strict";let n=Symbol("SemVer ANY");class o{static get ANY(){return n}constructor(e,t){if(t=i(t),e instanceof o)if(!!t.loose===e.loose)return e;else e=e.value;u("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){let t=this.options.loose?a[s.COMPARATORLOOSE]:a[s.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof o))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=o;let i=r(49694),{safeRe:a,t:s}=r(8887),l=r(94762),u=r(77909),c=r(77721),d=r(5074)},50183:(e,t,r)=>{"use strict";r.d(t,{c:()=>v});var n=r(14287),o=r(38483),i=r(6663);function a(e){let t=[];for(let{role:r,content:i}of e)switch(r){case"system":t.push({role:"system",content:i});break;case"user":if(1===i.length&&"text"===i[0].type){t.push({role:"user",content:i[0].text});break}t.push({role:"user",content:i.map(e=>{var t;switch(e.type){case"text":return{type:"text",text:e.text};case"image":return{type:"image_url",image_url:{url:e.image instanceof URL?e.image.toString():`data:${null!=(t=e.mimeType)?t:"image/jpeg"};base64,${(0,o.n_)(e.image)}`}};case"file":throw new n.b8({functionality:"File content parts in user messages"})}})});break;case"assistant":{let e="",r=[];for(let t of i)switch(t.type){case"text":e+=t.text;break;case"tool-call":r.push({id:t.toolCallId,type:"function",function:{name:t.toolName,arguments:JSON.stringify(t.args)}})}t.push({role:"assistant",content:e,tool_calls:r.length>0?r:void 0});break}case"tool":for(let e of i)t.push({role:"tool",tool_call_id:e.toolCallId,content:JSON.stringify(e.result)});break;default:{let e=r;throw Error(`Unsupported role: ${e}`)}}return t}function s({id:e,model:t,created:r}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:null!=r?new Date(1e3*r):void 0}}var l=i.Ik({error:i.Ik({message:i.Yj(),type:i.Yj()})}),u=(0,o.sl)({errorSchema:l,errorToMessage:e=>e.error.message});function c({mode:e}){var t;let r=(null==(t=e.tools)?void 0:t.length)?e.tools:void 0,o=[];if(null==r)return{tools:void 0,tool_choice:void 0,toolWarnings:o};let i=e.toolChoice,a=[];for(let e of r)"provider-defined"===e.type?o.push({type:"unsupported-tool",tool:e}):a.push({type:"function",function:{name:e.name,description:e.description,parameters:e.parameters}});if(null==i)return{tools:a,tool_choice:void 0,toolWarnings:o};let s=i.type;switch(s){case"auto":case"none":case"required":return{tools:a,tool_choice:s,toolWarnings:o};case"tool":return{tools:a,tool_choice:{type:"function",function:{name:i.toolName}},toolWarnings:o};default:{let e=s;throw new n.b8({functionality:`Unsupported tool choice type: ${e}`})}}}function d(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var f=class{constructor(e,t,r){this.specificationVersion="v1",this.supportsStructuredOutputs=!1,this.defaultObjectGenerationMode="json",this.modelId=e,this.settings=t,this.config=r}get provider(){return this.config.provider}get supportsImageUrls(){return!this.settings.downloadImages}getArgs({mode:e,prompt:t,maxTokens:r,temperature:n,topP:s,topK:l,frequencyPenalty:u,presencePenalty:d,stopSequences:f,responseFormat:p,seed:h,stream:m,providerMetadata:g}){let y=e.type,v=[];null!=l&&v.push({type:"unsupported-setting",setting:"topK"}),null!=p&&"json"===p.type&&null!=p.schema&&v.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format schema is not supported"});let b=(0,o.xI)({provider:"groq",providerOptions:g,schema:i.Ik({reasoningFormat:i.k5(["parsed","raw","hidden"]).nullish()})}),_={model:this.modelId,user:this.settings.user,parallel_tool_calls:this.settings.parallelToolCalls,max_tokens:r,temperature:n,top_p:s,frequency_penalty:u,presence_penalty:d,stop:f,seed:h,response_format:!1===m&&(null==p?void 0:p.type)==="json"?{type:"json_object"}:void 0,reasoning_format:null==b?void 0:b.reasoningFormat,messages:a(t)};switch(y){case"regular":{let{tools:t,tool_choice:r,toolWarnings:n}=c({mode:e});return{args:{..._,tools:t,tool_choice:r},warnings:[...v,...n]}}case"object-json":return{args:{..._,response_format:!1===m?{type:"json_object"}:void 0},warnings:v};case"object-tool":return{args:{..._,tool_choice:{type:"function",function:{name:e.tool.name}},tools:[{type:"function",function:{name:e.tool.name,description:e.tool.description,parameters:e.tool.parameters}}]},warnings:v};default:{let e=y;throw Error(`Unsupported type: ${e}`)}}}async doGenerate(e){var t,r,n,i,a,l,c;let{args:f,warnings:h}=this.getArgs({...e,stream:!1}),m=JSON.stringify(f),{responseHeaders:g,value:y,rawValue:v}=await (0,o.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,o.m2)(this.config.headers(),e.headers),body:f,failedResponseHandler:u,successfulResponseHandler:(0,o.cV)(p),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:b,..._}=f,$=y.choices[0];return{text:null!=(t=$.message.content)?t:void 0,reasoning:null!=(r=$.message.reasoning)?r:void 0,toolCalls:null==(n=$.message.tool_calls)?void 0:n.map(e=>{var t;return{toolCallType:"function",toolCallId:null!=(t=e.id)?t:(0,o.$C)(),toolName:e.function.name,args:e.function.arguments}}),finishReason:d($.finish_reason),usage:{promptTokens:null!=(a=null==(i=y.usage)?void 0:i.prompt_tokens)?a:NaN,completionTokens:null!=(c=null==(l=y.usage)?void 0:l.completion_tokens)?c:NaN},rawCall:{rawPrompt:b,rawSettings:_},rawResponse:{headers:g,body:v},response:s(y),warnings:h,request:{body:m}}}async doStream(e){let t,{args:r,warnings:i}=this.getArgs({...e,stream:!0}),a=JSON.stringify({...r,stream:!0}),{responseHeaders:l,value:c}=await (0,o.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,o.m2)(this.config.headers(),e.headers),body:{...r,stream:!0},failedResponseHandler:u,successfulResponseHandler:(0,o.Ds)(h),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:f,...p}=r,m=[],g="unknown",y={promptTokens:void 0,completionTokens:void 0},v=!0;return{stream:c.pipeThrough(new TransformStream({transform(e,t){var r,i,a,l,u,c,f,p,h,b,_,$,w,S,E;if(!e.success){g="error",t.enqueue({type:"error",error:e.error});return}let x=e.value;if("error"in x){g="error",t.enqueue({type:"error",error:x.error});return}v&&(v=!1,t.enqueue({type:"response-metadata",...s(x)})),(null==(r=x.x_groq)?void 0:r.usage)!=null&&(y={promptTokens:null!=(i=x.x_groq.usage.prompt_tokens)?i:void 0,completionTokens:null!=(a=x.x_groq.usage.completion_tokens)?a:void 0});let A=x.choices[0];if((null==A?void 0:A.finish_reason)!=null&&(g=d(A.finish_reason)),(null==A?void 0:A.delta)==null)return;let O=A.delta;if(null!=O.reasoning&&O.reasoning.length>0&&t.enqueue({type:"reasoning",textDelta:O.reasoning}),null!=O.content&&O.content.length>0&&t.enqueue({type:"text-delta",textDelta:O.content}),null!=O.tool_calls)for(let e of O.tool_calls){let r=e.index;if(null==m[r]){if("function"!==e.type)throw new n.xn({data:e,message:"Expected 'function' type."});if(null==e.id)throw new n.xn({data:e,message:"Expected 'id' to be a string."});if((null==(l=e.function)?void 0:l.name)==null)throw new n.xn({data:e,message:"Expected 'function.name' to be a string."});m[r]={id:e.id,type:"function",function:{name:e.function.name,arguments:null!=(u=e.function.arguments)?u:""},hasFinished:!1};let i=m[r];(null==(c=i.function)?void 0:c.name)!=null&&(null==(f=i.function)?void 0:f.arguments)!=null&&(i.function.arguments.length>0&&t.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:i.id,toolName:i.function.name,argsTextDelta:i.function.arguments}),(0,o.v0)(i.function.arguments)&&(t.enqueue({type:"tool-call",toolCallType:"function",toolCallId:null!=(p=i.id)?p:(0,o.$C)(),toolName:i.function.name,args:i.function.arguments}),i.hasFinished=!0));continue}let i=m[r];!i.hasFinished&&((null==(h=e.function)?void 0:h.arguments)!=null&&(i.function.arguments+=null!=(_=null==(b=e.function)?void 0:b.arguments)?_:""),t.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:i.id,toolName:i.function.name,argsTextDelta:null!=($=e.function.arguments)?$:""}),(null==(w=i.function)?void 0:w.name)!=null&&(null==(S=i.function)?void 0:S.arguments)!=null&&(0,o.v0)(i.function.arguments)&&(t.enqueue({type:"tool-call",toolCallType:"function",toolCallId:null!=(E=i.id)?E:(0,o.$C)(),toolName:i.function.name,args:i.function.arguments}),i.hasFinished=!0))}},flush(e){var r,n;e.enqueue({type:"finish",finishReason:g,usage:{promptTokens:null!=(r=y.promptTokens)?r:NaN,completionTokens:null!=(n=y.completionTokens)?n:NaN},...null!=t?{providerMetadata:t}:{}})}})),rawCall:{rawPrompt:f,rawSettings:p},rawResponse:{headers:l},warnings:i,request:{body:a}}}},p=i.Ik({id:i.Yj().nullish(),created:i.ai().nullish(),model:i.Yj().nullish(),choices:i.YO(i.Ik({message:i.Ik({content:i.Yj().nullish(),reasoning:i.Yj().nullish(),tool_calls:i.YO(i.Ik({id:i.Yj().nullish(),type:i.eu("function"),function:i.Ik({name:i.Yj(),arguments:i.Yj()})})).nullish()}),index:i.ai(),finish_reason:i.Yj().nullish()})),usage:i.Ik({prompt_tokens:i.ai().nullish(),completion_tokens:i.ai().nullish()}).nullish()}),h=i.KC([i.Ik({id:i.Yj().nullish(),created:i.ai().nullish(),model:i.Yj().nullish(),choices:i.YO(i.Ik({delta:i.Ik({content:i.Yj().nullish(),reasoning:i.Yj().nullish(),tool_calls:i.YO(i.Ik({index:i.ai(),id:i.Yj().nullish(),type:i.eu("function").optional(),function:i.Ik({name:i.Yj().nullish(),arguments:i.Yj().nullish()})})).nullish()}).nullish(),finish_reason:i.Yj().nullable().optional(),index:i.ai()})),x_groq:i.Ik({usage:i.Ik({prompt_tokens:i.ai().nullish(),completion_tokens:i.ai().nullish()}).nullish()}).nullish()}),l]),m=i.Ik({language:i.Yj().nullish(),prompt:i.Yj().nullish(),responseFormat:i.Yj().nullish(),temperature:i.ai().min(0).max(1).nullish(),timestampGranularities:i.YO(i.Yj()).nullish()}),g=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v1"}get provider(){return this.config.provider}getArgs({audio:e,mediaType:t,providerOptions:r}){var n,i,a,s,l;let u=[],c=(0,o.xI)({provider:"groq",providerOptions:r,schema:m}),d=new FormData,f=e instanceof Uint8Array?new Blob([e]):new Blob([(0,o.Z9)(e)]);if(d.append("model",this.modelId),d.append("file",new File([f],"audio",{type:t})),c){let e={language:null!=(n=c.language)?n:void 0,prompt:null!=(i=c.prompt)?i:void 0,response_format:null!=(a=c.responseFormat)?a:void 0,temperature:null!=(s=c.temperature)?s:void 0,timestamp_granularities:null!=(l=c.timestampGranularities)?l:void 0};for(let t in e){let r=e[t];void 0!==r&&d.append(t,String(r))}}return{formData:d,warnings:u}}async doGenerate(e){var t,r,n,i,a;let s=null!=(n=null==(r=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:r.call(t))?n:new Date,{formData:l,warnings:c}=this.getArgs(e),{value:d,responseHeaders:f,rawValue:p}=await (0,o.S)({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:(0,o.m2)(this.config.headers(),e.headers),formData:l,failedResponseHandler:u,successfulResponseHandler:(0,o.cV)(y),abortSignal:e.abortSignal,fetch:this.config.fetch});return{text:d.text,segments:null!=(a=null==(i=d.segments)?void 0:i.map(e=>({text:e.text,startSecond:e.start,endSecond:e.end})))?a:[],language:d.language,durationInSeconds:d.duration,warnings:c,response:{timestamp:s,modelId:this.modelId,headers:f,body:p}}}},y=i.Ik({task:i.Yj(),language:i.Yj(),duration:i.ai(),text:i.Yj(),segments:i.YO(i.Ik({id:i.ai(),seek:i.ai(),start:i.ai(),end:i.ai(),text:i.Yj(),tokens:i.YO(i.ai()),temperature:i.ai(),avg_logprob:i.ai(),compression_ratio:i.ai(),no_speech_prob:i.ai()})),x_groq:i.Ik({id:i.Yj()})});function v(e={}){var t;let r=null!=(t=(0,o.ae)(e.baseURL))?t:"https://api.groq.com/openai/v1",i=()=>({Authorization:`Bearer ${(0,o.WL)({apiKey:e.apiKey,environmentVariableName:"GROQ_API_KEY",description:"Groq"})}`,...e.headers}),a=(t,n={})=>new f(t,n,{provider:"groq.chat",url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),s=(e,t)=>{if(new.target)throw Error("The Groq model function cannot be called with the new keyword.");return a(e,t)},l=t=>new g(t,{provider:"groq.transcription",url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),u=function(e,t){return s(e,t)};return u.languageModel=s,u.chat=a,u.textEmbeddingModel=e=>{throw new n.eM({modelId:e,modelType:"textEmbeddingModel"})},u.transcription=l,u}v()},50553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=a(r(79922)),o=a(r(89089)),i=a(r(29203));function a(e){return e&&e.__esModule?e:{default:e}}var s={ignoreCase:!1,minOccurrences:1};function l(e,t,r){return((0,n.default)(e),(r=(0,i.default)(r,s)).ignoreCase)?e.toLowerCase().split((0,o.default)(t).toLowerCase()).length>r.minOccurrences:e.split((0,o.default)(t)).length>r.minOccurrences}e.exports=t.default,e.exports.default=t.default},50560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,a=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,s=function(e){var t=e.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(t){var r=Number(t[1]),n=Number(t[2]);return r%4==0&&r%100!=0||r%400==0?n<=366:n<=365}var o=e.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),i=o[1],a=o[2],s=o[3],l=a?"0".concat(a).slice(-2):a,u=s?"0".concat(s).slice(-2):s,c=new Date("".concat(i,"-").concat(l||"01","-").concat(u||"01"));return!a||!s||c.getUTCFullYear()===i&&c.getUTCMonth()+1===a&&c.getUTCDate()===s};function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.default)(e);var r=t.strictSeparator?a.test(e):i.test(e);return r&&t.strict?s(e):r}e.exports=t.default,e.exports.default=t.default},50736:(e,t,r)=>{"use strict";let n=r(26189);e.exports=(e,t,r)=>n(e,t,r)>=0},50865:(e,t,r)=>{"use strict";var n=r(92709),o=r(61429),i=r(21093);e.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},50892:(e,t,r)=>{"use strict";let n=r(77721);e.exports=(e,t)=>new n(e,t).patch},51429:(e,t,r)=>{e.exports={decode:r(63809),verify:r(68750),sign:r(86246),JsonWebTokenError:r(16076),NotBeforeError:r(57759),TokenExpiredError:r(75657)}},51513:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=v;var n=s(r(79922)),o=s(r(74499)),i=s(r(26433)),a=s(r(29203));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){return p(e)||f(e,t)||c(e,t)||u()}function u(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r]/.test(e)||0===e.indexOf("mailto:")||(t=(0,a.default)(t,h)).validate_length&&e.length>=2083||!t.allow_fragments&&e.includes("#")||!t.allow_query_components&&(e.includes("?")||e.includes("&")))return!1;if((p=(e=(p=(e=(p=e.split("#")).shift()).split("?")).shift()).split("://")).length>1){if(r=p.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(r))return!1}else if(t.require_protocol)return!1;else if("//"===e.slice(0,2)){if(!t.allow_protocol_relative_urls)return!1;p[0]=e.slice(2)}if(""===(e=p.join("://")))return!1;if(""===(e=(p=e.split("/")).shift())&&!t.require_host)return!0;if((p=e.split("@")).length>1){if(t.disallow_auth||""===p[0]||(s=p.shift()).indexOf(":")>=0&&s.split(":").length>2)return!1;var r,s,u,c,d,f,p,g,v=l(s.split(":"),2),b=v[0],_=v[1];if(""===b&&""===_)return!1}c=p.join("@"),f=null,g=null;var $=c.match(m);if($?(u="",g=$[1],f=$[2]||null):(u=(p=c.split(":")).shift(),p.length&&(f=p.join(":"))),null!==f&&f.length>0){if(d=parseInt(f,10),!/^[0-9]+$/.test(f)||d<=0||d>65535)return!1}else if(t.require_port)return!1;return t.host_whitelist?y(u,t.host_whitelist):""===u&&!t.require_host||(!!(0,i.default)(u)||!!(0,o.default)(u,t)||!!g&&!!(0,i.default)(g,6))&&(u=u||g,!(t.host_blacklist&&y(u,t.host_blacklist)))}e.exports=t.default,e.exports.default=t.default},51642:(e,t,r)=>{"use strict";let n=r(48983),o=r(31838),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=_,t.INSPECT_MAX_BYTES=50;let a=0x7fffffff;function s(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}function l(e){if(e>a)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return p(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return h(e,t);if(ArrayBuffer.isView(e))return g(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ea(e,ArrayBuffer)||e&&ea(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(ea(e,SharedArrayBuffer)||e&&ea(e.buffer,SharedArrayBuffer)))return y(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);let o=v(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function f(e,t,r){return(d(e),e<=0)?l(e):void 0!==t?"string"==typeof r?l(e).fill(t,r):l(e).fill(t):l(e)}function p(e){return d(e),l(e<0?0:0|b(e))}function h(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!u.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|$(e,t),n=l(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}function m(e){let t=e.length<0?0:0|b(e.length),r=l(t);for(let n=0;n=a)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function _(e){return+e!=e&&(e=0),u.alloc(+e)}function $(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ea(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return et(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return eo(e).length;default:if(o)return n?-1:et(e).length;t=(""+t).toLowerCase(),o=!0}}function w(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return N(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function E(e,t,r,n,o){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),es(r*=1)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(o)return -1;else r=e.length-1;else if(r<0)if(!o)return -1;else r=0;if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:x(e,t,r,n,o);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(o)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return x(e,[t],r,n,o)}throw TypeError("val must be string, number or Buffer")}function x(e,t,r,n,o){let i,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){let r=!0;for(let n=0;ni&&(n=i):n=i;let a=t.length;for(n>a/2&&(n=a/2),o=0;o239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,l;switch(a){case 1:t<128&&(i=t);break;case 2:(192&(r=e[o+1]))==128&&(l=(31&t)<<6|63&r)>127&&(i=l);break;case 3:r=e[o+1],n=e[o+2],(192&r)==128&&(192&n)==128&&(l=(15&t)<<12|(63&r)<<6|63&n)>2047&&(l<55296||l>57343)&&(i=l);break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],(192&r)==128&&(192&n)==128&&(192&s)==128&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s)>65535&&l<1114112&&(i=l)}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return j(n)}t.kMaxLength=0x7fffffff,u.TYPED_ARRAY_SUPPORT=s(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return f(e,t,r)},u.allocUnsafe=function(e){return p(e)},u.allocUnsafeSlow=function(e){return p(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(ea(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),ea(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);on.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else if(u.isBuffer(t))t.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=t.length}return n},u.byteLength=$,u.prototype._isBuffer=!0,u.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(ea(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let i=o-n,a=r-t,s=Math.min(i,a),l=this.slice(n,o),c=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return A(this,e,t,r);case"utf8":case"utf-8":return O(this,e,t,r);case"ascii":case"latin1":case"binary":return k(this,e,t,r);case"base64":return I(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,r);default:if(i)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};let R=4096;function j(e){let t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let o="";for(let n=t;nr)throw RangeError("Trying to access beyond buffer length")}function F(e,t,r,n,o,i){if(!u.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw RangeError("Index out of range")}function U(e,t,r,n,o){z(t,n,o,e,r,7);let i=Number(t&BigInt(0xffffffff));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function Z(e,t,r,n,o){z(t,n,o,e,r,7);let i=Number(t&BigInt(0xffffffff));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function Y(e,t,r,n,o,i){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function H(e,t,r,n,i){return t*=1,r>>>=0,i||Y(e,t,r,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,r,n,23,4),r+4}function q(e,t,r,n,i){return t*=1,r>>>=0,i||Y(e,t,r,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=eu(function(e){J(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&X(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],o=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(o)<>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&X(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],o=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=(o*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return(e>>>=0,t||B(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=eu(function(e){J(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&X(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&X(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<>>=0,t||B(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;F(this,e,t,r,n,0)}let o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;F(this,e,t,r,n,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=eu(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=eu(function(e,t=0){return Z(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!n){let n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=eu(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=eu(function(e,t=0){return Z(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return q(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return q(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r){J(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&X(t,e.length-(r+1))}function z(e,t,r,n,o,i){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${o} and < 2${o} ** ${(i+1)*8}${o}`:`>= -(2${o} ** ${(i+1)*8-1}${o}) and < 2 ** ${(i+1)*8-1}${o}`:`>= ${t}${o} and <= ${r}${o}`,new G.ERR_OUT_OF_RANGE("value",n,e)}V(n,o,i)}function J(e,t){if("number"!=typeof e)throw new G.ERR_INVALID_ARG_TYPE(t,"number",e)}function X(e,t,r){if(Math.floor(e)!==e)throw J(e,r),new G.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}W("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),W("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?o=K(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=K(o)),o+="n"),n+=` It must be ${t}. Received ${o}`},RangeError);let Q=/[^+/0-9A-Za-z-_]/g;function ee(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function et(e,t){let r;t=t||1/0;let n=e.length,o=null,i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319||a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function er(e){let t=[];for(let r=0;r>8,o.push(r%256),o.push(n);return o}function eo(e){return n.toByteArray(ee(e))}function ei(e,t,r,n){let o;for(o=0;o=t.length)&&!(o>=e.length);++o)t[o+r]=e[o];return o}function ea(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function es(e){return e!=e}let el=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function eu(e){return"undefined"==typeof BigInt?ec:e}function ec(){throw Error("BigInt not supported")}},52175:(e,t,r)=>{"use strict";let n,o,i,a,s,l,u,c,d,f;r.d(t,{z4:()=>nd,Ay:()=>nf});let p="RFC3986",h={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:e=>String(e)},m="RFC1738";Object.prototype.hasOwnProperty;let g=Array.isArray,y=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),v=1024,b=(e,t,r,n,o)=>{if(0===e.length)return e;let i=e;if("symbol"==typeof e?i=Symbol.prototype.toString.call(e):"string"!=typeof e&&(i=String(e)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});let a="";for(let e=0;e=v?i.slice(e,e+v):i,r=[];for(let e=0;e=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||o===m&&(40===n||41===n)){r[r.length]=t.charAt(e);continue}if(n<128){r[r.length]=y[n];continue}if(n<2048){r[r.length]=y[192|n>>6]+y[128|63&n];continue}if(n<55296||n>=57344){r[r.length]=y[224|n>>12]+y[128|n>>6&63]+y[128|63&n];continue}e+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(e)),r[r.length]=y[240|n>>18]+y[128|n>>12&63]+y[128|n>>6&63]+y[128|63&n]}a+=r.join("")}return a};function _(e){return!!e&&"object"==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function $(e,t){if(g(e)){let r=[];for(let n=0;nString(e)+"[]",comma:"comma",indices:(e,t)=>String(e)+"["+t+"]",repeat:e=>String(e)},E=Array.isArray,x=Array.prototype.push,A=function(e,t){x.apply(e,E(t)?t:[t])},O=Date.prototype.toISOString,k={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:b,encodeValuesOnly:!1,format:p,formatter:h[p],indices:!1,serializeDate:e=>O.call(e),skipNulls:!1,strictNullHandling:!1};function I(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e}let C={};function T(e,t,r,n,o,i,a,s,l,u,c,d,f,p,h,m,g,y){let v,b=e,w=y,S=0,x=!1;for(;void 0!==(w=w.get(C))&&!x;){let t=w.get(e);if(S+=1,void 0!==t)if(t===S)throw RangeError("Cyclic object value");else x=!0;void 0===w.get(C)&&(S=0)}if("function"==typeof u?b=u(t,b):b instanceof Date?b=f?.(b):"comma"===r&&E(b)&&(b=$(b,function(e){return e instanceof Date?f?.(e):e})),null===b){if(i)return l&&!m?l(t,k.encoder,g,"key",p):t;b=""}if(I(b)||_(b)){if(l){let e=m?t:l(t,k.encoder,g,"key",p);return[h?.(e)+"="+h?.(l(b,k.encoder,g,"value",p))]}return[h?.(t)+"="+h?.(String(b))]}let O=[];if(void 0===b)return O;if("comma"===r&&E(b))m&&l&&(b=$(b,l)),v=[{value:b.length>0?b.join(",")||null:void 0}];else if(E(u))v=u;else{let e=Object.keys(b);v=c?e.sort(c):e}let P=s?String(t).replace(/\./g,"%2E"):String(t),R=n&&E(b)&&1===b.length?P+"[]":P;if(o&&E(b)&&0===b.length)return R+"[]";for(let t=0;t0?d+c:""}let j="4.81.0",N=!1,M=null,L=null,D=null,B=null;function F(e,t={auto:!1}){if(N)throw Error(`you must \`import 'openai/shims/${e.kind}'\` before importing anything else from openai`);if(o)throw Error(`can't \`import 'openai/shims/${e.kind}'\` after \`import 'openai/shims/${o}'\``);N=t.auto,o=e.kind,i=e.fetch,M=e.Request,L=e.Response,D=e.Headers,a=e.FormData,B=e.Blob,s=e.File,l=e.ReadableStream,u=e.getMultipartRequestOptions,c=e.getDefaultAgent,d=e.fileFromPath,f=e.isFsReadStream}class U{constructor(e){this.body=e}get[Symbol.toStringTag](){return"MultipartBody"}}function Z({manuallyImported:e}={}){let t,r,n,o,i=e?"You may need to use polyfills":`Add one of these imports before your first \`import … from 'openai'\`: - \`import 'openai/shims/node'\` (if you're running on Node) - \`import 'openai/shims/web'\` (otherwise) `;try{t=fetch,r=Request,n=Response,o=Headers}catch(e){throw Error(`this environment is missing the following Web Fetch API type: ${e.message}. ${i}`)}return{kind:"web",fetch:t,Request:r,Response:n,Headers:o,FormData:"undefined"!=typeof FormData?FormData:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${i}`)}},Blob:"undefined"!=typeof Blob?Blob:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${i}`)}},File:"undefined"!=typeof File?File:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${i}`)}},ReadableStream:"undefined"!=typeof ReadableStream?ReadableStream:class{constructor(){throw Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${i}`)}},getMultipartRequestOptions:async(e,t)=>({...t,body:new U(e)}),getDefaultAgent:e=>void 0,fileFromPath:()=>{throw Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:e=>!1}}o||F(Z(),{auto:!0});class Y extends Error{}class H extends Y{constructor(e,t,r,n){super(`${H.makeMessage(e,t,r)}`),this.status=e,this.headers=n,this.request_id=n?.["x-request-id"],this.error=t;let o=t;this.code=o?.code,this.param=o?.param,this.type=o?.type}static makeMessage(e,t,r){let n=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):r;return e&&n?`${e} ${n}`:e?`${e} status code (no body)`:n||"(no status code or body)"}static generate(e,t,r,n){if(!e||!n)return new G({message:r,cause:tq(t)});let o=t?.error;return 400===e?new K(e,o,r,n):401===e?new V(e,o,r,n):403===e?new z(e,o,r,n):404===e?new J(e,o,r,n):409===e?new X(e,o,r,n):422===e?new Q(e,o,r,n):429===e?new ee(e,o,r,n):e>=500?new et(e,o,r,n):new H(e,o,r,n)}}class q extends H{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class G extends H{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class W extends G{constructor({message:e}={}){super({message:e??"Request timed out."})}}class K extends H{}class V extends H{}class z extends H{}class J extends H{}class X extends H{}class Q extends H{}class ee extends H{}class et extends H{}class er extends Y{constructor(){super("Could not parse response content as the length limit was reached")}}class en extends Y{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}var eo,ei,ea,es,el,eu,ec,ed,ef,ep,eh,em,eg,ey,ev,eb,e_,e$,ew,eS,eE,ex,eA,eO,ek,eI,eC,eT,eP,eR,ej,eN,eM,eL,eD,eB,eF,eU,eZ,eY,eH,eq,eG,eW,eK,eV,ez,eJ,eX,eQ,e0,e1,e2,e3,e9,e4,e8,e6=r(51642).Buffer;class e5{constructor(){this.buffer=[],this.trailingCR=!1}decode(e){let t=this.decodeText(e);if(this.trailingCR&&(t="\r"+t,this.trailingCR=!1),t.endsWith("\r")&&(this.trailingCR=!0,t=t.slice(0,-1)),!t)return[];let r=e5.NEWLINE_CHARS.has(t[t.length-1]||""),n=t.split(e5.NEWLINE_REGEXP);return(r&&n.pop(),1!==n.length||r)?(this.buffer.length>0&&(n=[this.buffer.join("")+n[0],...n.slice(1)],this.buffer=[]),r||(this.buffer=[n.pop()||""]),n):(this.buffer.push(n[0]),[])}decodeText(e){if(null==e)return"";if("string"==typeof e)return e;if(void 0!==e6){if(e instanceof e6)return e.toString();if(e instanceof Uint8Array)return e6.from(e).toString();throw new Y(`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if("undefined"!=typeof TextDecoder){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new Y(`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`)}throw new Y("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){if(!this.buffer.length&&!this.trailingCR)return[];let e=[this.buffer.join("")];return this.buffer=[],this.trailingCR=!1,e}}function e7(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}e5.NEWLINE_CHARS=new Set(["\n","\r"]),e5.NEWLINE_REGEXP=/\r\n|[\n\r]/g;class te{constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let r=!1;return new te(async function*(){if(r)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let n=!1;try{for await(let r of tt(e,t))if(!n){if(r.data.startsWith("[DONE]")){n=!0;continue}if(null===r.event){let e;try{e=JSON.parse(r.data)}catch(e){throw console.error("Could not parse message into JSON:",r.data),console.error("From chunk:",r.raw),e}if(e&&e.error)throw new H(void 0,e.error,void 0,void 0);yield e}else{let e;try{e=JSON.parse(r.data)}catch(e){throw console.error("Could not parse message into JSON:",r.data),console.error("From chunk:",r.raw),e}if("error"==r.event)throw new H(void 0,e.error,e.message,void 0);yield{event:r.event,data:e}}}n=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{n||t.abort()}},t)}static fromReadableStream(e,t){let r=!1;async function*n(){let t=new e5;for await(let r of e7(e))for(let e of t.decode(r))yield e;for(let e of t.flush())yield e}return new te(async function*(){if(r)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let e=!1;try{for await(let t of n())!e&&t&&(yield JSON.parse(t));e=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{e||t.abort()}},t)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],t=[],r=this.iterator(),n=n=>({next:()=>{if(0===n.length){let n=r.next();e.push(n),t.push(n)}return n.shift()}});return[new te(()=>n(e),this.controller),new te(()=>n(t),this.controller)]}toReadableStream(){let e,t=this,r=new TextEncoder;return new l({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:o}=await e.next();if(o)return t.close();let i=r.encode(JSON.stringify(n)+"\n");t.enqueue(i)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*tt(e,t){if(!e.body)throw t.abort(),new Y("Attempted to iterate over a response with no body");let r=new to,n=new e5;for await(let t of tr(e7(e.body)))for(let e of n.decode(t)){let t=r.decode(e);t&&(yield t)}for(let e of n.flush()){let t=r.decode(e);t&&(yield t)}}async function*tr(e){let t=new Uint8Array;for await(let r of e){let e;if(null==r)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):"string"==typeof r?new TextEncoder().encode(r):r,o=new Uint8Array(t.length+n.length);for(o.set(t),o.set(n,t.length),t=o;-1!==(e=tn(t));)yield t.slice(0,e),t=t.slice(e)}t.length>0&&(yield t)}function tn(e){let t=10,r=13;for(let n=0;nnull!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob,tl=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&tu(e),tu=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,tc=e=>tl(e)||ts(e)||f(e);async function td(e,t,r){if(tl(e=await e))return e;if(ts(e)){let n=await e.blob();t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()??"unknown_file");let o=tu(n)?[await n.arrayBuffer()]:[n];return new s(o,t,r)}let n=await tf(e);if(t||(t=th(e)??"unknown_file"),!r?.type){let e=n[0]?.type;"string"==typeof e&&(r={...r,type:e})}return new s(n,t,r)}async function tf(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(tu(e))t.push(await e.arrayBuffer());else if(tg(e))for await(let r of e)t.push(r);else throw Error(`Unexpected data type: ${typeof e}; constructor: ${e?.constructor?.name}; props: ${tp(e)}`);return t}function tp(e){let t=Object.getOwnPropertyNames(e);return`[${t.map(e=>`"${e}"`).join(", ")}]`}function th(e){return tm(e.name)||tm(e.filename)||tm(e.path)?.split(/[\\/]/).pop()}let tm=e=>"string"==typeof e?e:void 0!==ta&&e instanceof ta?String(e):void 0,tg=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],ty=e=>e&&"object"==typeof e&&e.body&&"MultipartBody"===e[Symbol.toStringTag],tv=async e=>{let t=await tb(e.body);return u(t,e)},tb=async e=>{let t=new a;return await Promise.all(Object.entries(e||{}).map(([e,r])=>t$(t,e,r))),t},t_=e=>{if(tc(e))return!0;if(Array.isArray(e))return e.some(t_);if(e&&"object"==typeof e){for(let t in e)if(t_(e[t]))return!0}return!1},t$=async(e,t,r)=>{if(void 0!==r){if(null==r)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof r||"number"==typeof r||"boolean"==typeof r)e.append(t,String(r));else if(tc(r)){let n=await td(r);e.append(t,n)}else if(Array.isArray(r))await Promise.all(r.map(r=>t$(e,t+"[]",r)));else if("object"==typeof r)await Promise.all(Object.entries(r).map(([r,n])=>t$(e,`${t}[${r}]`,n)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}};var tw=r(51642).Buffer,tS=r(33601),tE=function(e,t,r,n,o){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},tx=function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};async function tA(e){let{response:t}=e;if(e.options.stream)return(tJ("response",t.status,t.url,t.headers,t.body),e.options.__streamClass)?e.options.__streamClass.fromSSEResponse(t,e.controller):te.fromSSEResponse(t,e.controller);if(204===t.status)return null;if(e.options.__binaryResponse)return t;let r=t.headers.get("content-type");if(r?.includes("application/json")||r?.includes("application/vnd.api+json")){let e=await t.json();return tJ("response",t.status,t.url,t.headers,e),tO(e,t)}let n=await t.text();return tJ("response",t.status,t.url,t.headers,n),n}function tO(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("x-request-id"),enumerable:!1})}class tk extends Promise{constructor(e,t=tA){super(e=>{e(null)}),this.responsePromise=e,this.parseResponse=t}_thenUnwrap(e){return new tk(this.responsePromise,async t=>tO(e(await this.parseResponse(t),t),t.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}class tI{constructor({baseURL:e,maxRetries:t=2,timeout:r=6e5,httpAgent:n,fetch:o}){this.baseURL=e,this.maxRetries=tH("maxRetries",t),this.timeout=tH("timeout",r),this.httpAgent=n,this.fetch=o??i}authHeaders(e){return{}}defaultHeaders(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...tB(),...this.authHeaders(e)}}validateHeaders(e,t){}defaultIdempotencyKey(){return`stainless-node-retry-${tX()}`}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,r){return this.request(Promise.resolve(r).then(async r=>{let n=r&&tu(r?.body)?new DataView(await r.body.arrayBuffer()):r?.body instanceof DataView?r.body:r?.body instanceof ArrayBuffer?new DataView(r.body):r&&ArrayBuffer.isView(r?.body)?new DataView(r.body.buffer):r?.body;return{method:e,path:t,...r,body:n}}))}getAPIList(e,t,r){return this.requestAPIList(t,{method:"get",path:e,...r})}calculateContentLength(e){if("string"==typeof e){if(void 0!==tw)return tw.byteLength(e,"utf8").toString();if("undefined"!=typeof TextEncoder)return new TextEncoder().encode(e).length.toString()}else if(ArrayBuffer.isView(e))return e.byteLength.toString();return null}buildRequest(e,{retryCount:t=0}={}){let{method:r,path:n,query:o,headers:i={}}=e,a=ArrayBuffer.isView(e.body)||e.__binaryRequest&&"string"==typeof e.body?e.body:ty(e.body)?e.body.body:e.body?JSON.stringify(e.body,null,2):null,s=this.calculateContentLength(a),l=this.buildURL(n,o);"timeout"in e&&tH("timeout",e.timeout);let u=e.timeout??this.timeout,d=e.httpAgent??this.httpAgent??c(l),f=u+1e3;"number"==typeof d?.options?.timeout&&f>(d.options.timeout??0)&&(d.options.timeout=f),this.idempotencyHeader&&"get"!==r&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);let p=this.buildHeaders({options:e,headers:i,contentLength:s,retryCount:t});return{req:{method:r,...a&&{body:a},headers:p,...d&&{agent:d},signal:e.signal??null},url:l,timeout:u}}buildHeaders({options:e,headers:t,contentLength:r,retryCount:n}){let i={};r&&(i["content-length"]=r);let a=this.defaultHeaders(e);return tV(i,a),tV(i,t),ty(e.body)&&"node"!==o&&delete i["content-type"],void 0===t1(a,"x-stainless-retry-count")&&void 0===t1(t,"x-stainless-retry-count")&&(i["x-stainless-retry-count"]=String(n)),this.validateHeaders(i,t),i}async prepareOptions(e){}async prepareRequest(e,{url:t,options:r}){}parseHeaders(e){return e?Symbol.iterator in e?Object.fromEntries(Array.from(e).map(e=>[...e])):{...e}:{}}makeStatusError(e,t,r,n){return H.generate(e,t,r,n)}request(e,t=null){return new tk(this.makeRequest(e,t))}async makeRequest(e,t){let r=await e,n=r.maxRetries??this.maxRetries;null==t&&(t=n),await this.prepareOptions(r);let{req:o,url:i,timeout:a}=this.buildRequest(r,{retryCount:n-t});if(await this.prepareRequest(o,{url:i,options:r}),tJ("request",i,r,o.headers),r.signal?.aborted)throw new q;let s=new AbortController,l=await this.fetchWithTimeout(i,o,a,s).catch(tq);if(l instanceof Error){if(r.signal?.aborted)throw new q;if(t)return this.retryRequest(r,t);if("AbortError"===l.name)throw new W;throw new G({cause:l})}let u=tP(l.headers);if(!l.ok){if(t&&this.shouldRetry(l)){let e=`retrying, ${t} attempts remaining`;return tJ(`response (error; ${e})`,l.status,i,u),this.retryRequest(r,t,u)}let e=await l.text().catch(e=>tq(e).message),n=tF(e),o=n?void 0:e,a=t?"(error; no more retries left)":"(error; not retryable)";throw tJ(`response (error; ${a})`,l.status,i,u,o),this.makeStatusError(l.status,n,o,u)}return{response:l,options:r,controller:s}}requestAPIList(e,t){return new tT(this,this.makeRequest(t,null),e)}buildURL(e,t){let r=new URL(tZ(e)?e:this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),n=this.defaultQuery();return tW(n)||(t={...n,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(r.search=this.stringifyQuery(t)),r.toString()}stringifyQuery(e){return Object.entries(e).filter(([e,t])=>void 0!==t).map(([e,t])=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(null===t)return`${encodeURIComponent(e)}=`;throw new Y(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout(e,t,r,n){let{signal:o,...i}=t||{};o&&o.addEventListener("abort",()=>n.abort());let a=setTimeout(()=>n.abort(),r),s={signal:n.signal,...i};return s.method&&(s.method=s.method.toUpperCase()),this.fetch.call(void 0,e,s).finally(()=>{clearTimeout(a)})}shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||!!(e.status>=500))}async retryRequest(e,t,r){let n,o=r?.["retry-after-ms"];if(o){let e=parseFloat(o);Number.isNaN(e)||(n=e)}let i=r?.["retry-after"];if(i&&!n){let e=parseFloat(i);n=Number.isNaN(e)?Date.parse(i)-Date.now():1e3*e}if(!(n&&0<=n&&n<6e4)){let r=e.maxRetries??this.maxRetries;n=this.calculateDefaultRetryTimeoutMillis(t,r)}return await tY(n),this.makeRequest(e,t-1)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}getUserAgent(){return`${this.constructor.name}/JS ${j}`}}class tC{constructor(e,t,r,n){eo.set(this,void 0),tE(this,eo,e,"f"),this.options=n,this.response=t,this.body=r}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageInfo()}async getNextPage(){let e=this.nextPageInfo();if(!e)throw new Y("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");let t={...this.options};if("params"in e&&"object"==typeof t.query)t.query={...t.query,...e.params};else if("url"in e){for(let[r,n]of[...Object.entries(t.query||{}),...e.url.searchParams.entries()])e.url.searchParams.set(r,n);t.query=void 0,t.path=e.url.toString()}return await tx(this,eo,"f").requestAPIList(this.constructor,t)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(eo=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class tT extends tk{constructor(e,t,r){super(t,async t=>new r(e,t.response,await tA(t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}let tP=e=>new Proxy(Object.fromEntries(e.entries()),{get(e,t){let r=t.toString();return e[r.toLowerCase()]||e[r]}}),tR={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__binaryRequest:!0,__binaryResponse:!0,__streamClass:!0},tj=e=>"object"==typeof e&&null!==e&&!tW(e)&&Object.keys(e).every(e=>tK(tR,e)),tN=()=>{if("undefined"!=typeof Deno&&null!=Deno.build)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":j,"X-Stainless-OS":tD(Deno.build.os),"X-Stainless-Arch":tL(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":j,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":tS.version};if("[object process]"===Object.prototype.toString.call(void 0!==tS?tS:0))return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":j,"X-Stainless-OS":tD(tS.platform),"X-Stainless-Arch":tL(tS.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":tS.version};let e=tM();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":j,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":j,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function tM(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let r=t.exec(navigator.userAgent);if(r){let t=r[1]||0,n=r[2]||0,o=r[3]||0;return{browser:e,version:`${t}.${n}.${o}`}}}return null}let tL=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",tD=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",tB=()=>n??(n=tN()),tF=e=>{try{return JSON.parse(e)}catch(e){return}},tU=/^[a-z][a-z0-9+.-]*:/i,tZ=e=>tU.test(e),tY=e=>new Promise(t=>setTimeout(t,e)),tH=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new Y(`${e} must be an integer`);if(t<0)throw new Y(`${e} must be a positive integer`);return t},tq=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e)try{return Error(JSON.stringify(e))}catch{}return Error(e)},tG=e=>void 0!==tS?tS.env?.[e]?.trim()??void 0:"undefined"!=typeof Deno?Deno.env?.get?.(e)?.trim():void 0;function tW(e){if(!e)return!0;for(let t in e)return!1;return!0}function tK(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tV(e,t){for(let r in t){if(!tK(t,r))continue;let n=r.toLowerCase();if(!n)continue;let o=t[r];null===o?delete e[n]:void 0!==o&&(e[n]=o)}}let tz=new Set(["authorization","api-key"]);function tJ(e,...t){void 0!==tS&&tS?.env?.DEBUG==="true"&&console.log(`OpenAI:DEBUG:${e}`,...t.map(e=>{if(!e)return e;if(e.headers){let t={...e,headers:{...e.headers}};for(let r in e.headers)tz.has(r.toLowerCase())&&(t.headers[r]="REDACTED");return t}let t=null;for(let r in e)tz.has(r.toLowerCase())&&(t??(t={...e}),t[r]="REDACTED");return t??e}))}let tX=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),tQ=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,t0=e=>"function"==typeof e?.get,t1=(e,t)=>{let r=t.toLowerCase();if(t0(e)){let n=t[0]?.toUpperCase()+t.substring(1).replace(/([^\w])(\w)/g,(e,t,r)=>t+r.toUpperCase());for(let o of[t,r,t.toUpperCase(),n]){let t=e.get(o);if(t)return t}}for(let[n,o]of Object.entries(e))if(n.toLowerCase()===r){if(Array.isArray(o)){if(o.length<=1)return o[0];return console.warn(`Received ${o.length} entries for the ${t} header, using the first entry.`),o[0]}return o}};function t2(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}class t3{constructor(e){this._client=e}}class t9 extends t3{create(e,t){return this._client.post("/completions",{body:e,...t,stream:e.stream??!1})}}class t4 extends t3{create(e,t){return this._client.post("/chat/completions",{body:e,...t,stream:e.stream??!1})}}class t8 extends t3{constructor(){super(...arguments),this.completions=new t4(this._client)}}t8.Completions=t4;class t6 extends t3{create(e,t){return this._client.post("/embeddings",{body:e,...t})}}class t5 extends tC{constructor(e,t,r,n){super(e,t,r,n),this.data=r.data||[],this.object=r.object}getPaginatedItems(){return this.data??[]}nextPageParams(){return null}nextPageInfo(){return null}}class t7 extends tC{constructor(e,t,r,n){super(e,t,r,n),this.data=r.data||[]}getPaginatedItems(){return this.data??[]}nextPageParams(){let e=this.nextPageInfo();if(!e)return null;if("params"in e)return e.params;let t=Object.fromEntries(e.url.searchParams);return Object.keys(t).length?t:null}nextPageInfo(){let e=this.getPaginatedItems();if(!e.length)return null;let t=e[e.length-1]?.id;return t?{params:{after:t}}:null}}class re extends t3{create(e,t){return this._client.post("/files",tv({body:e,...t}))}retrieve(e,t){return this._client.get(`/files/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/files",rt,{query:e,...t})}del(e,t){return this._client.delete(`/files/${e}`,t)}content(e,t){return this._client.get(`/files/${e}/content`,{...t,headers:{Accept:"application/binary",...t?.headers},__binaryResponse:!0})}retrieveContent(e,t){return this._client.get(`/files/${e}/content`,t)}async waitForProcessing(e,{pollInterval:t=5e3,maxWait:r=18e5}={}){let n=new Set(["processed","error","deleted"]),o=Date.now(),i=await this.retrieve(e);for(;!i.status||!n.has(i.status);)if(await tY(t),i=await this.retrieve(e),Date.now()-o>r)throw new W({message:`Giving up on waiting for file ${e} to finish processing after ${r} milliseconds.`});return i}}class rt extends t7{}re.FileObjectsPage=rt;class rr extends t3{createVariation(e,t){return this._client.post("/images/variations",tv({body:e,...t}))}edit(e,t){return this._client.post("/images/edits",tv({body:e,...t}))}generate(e,t){return this._client.post("/images/generations",{body:e,...t})}}class rn extends t3{create(e,t){return this._client.post("/audio/speech",{body:e,...t,headers:{Accept:"application/octet-stream",...t?.headers},__binaryResponse:!0})}}class ro extends t3{create(e,t){return this._client.post("/audio/transcriptions",tv({body:e,...t}))}}class ri extends t3{create(e,t){return this._client.post("/audio/translations",tv({body:e,...t}))}}class ra extends t3{constructor(){super(...arguments),this.transcriptions=new ro(this._client),this.translations=new ri(this._client),this.speech=new rn(this._client)}}ra.Transcriptions=ro,ra.Translations=ri,ra.Speech=rn;class rs extends t3{create(e,t){return this._client.post("/moderations",{body:e,...t})}}class rl extends t3{retrieve(e,t){return this._client.get(`/models/${e}`,t)}list(e){return this._client.getAPIList("/models",ru,e)}del(e,t){return this._client.delete(`/models/${e}`,t)}}class ru extends t5{}rl.ModelsPage=ru;class rc extends t3{list(e,t={},r){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/checkpoints`,rd,{query:t,...r})}}class rd extends t7{}rc.FineTuningJobCheckpointsPage=rd;class rf extends t3{constructor(){super(...arguments),this.checkpoints=new rc(this._client)}create(e,t){return this._client.post("/fine_tuning/jobs",{body:e,...t})}retrieve(e,t){return this._client.get(`/fine_tuning/jobs/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/fine_tuning/jobs",rp,{query:e,...t})}cancel(e,t){return this._client.post(`/fine_tuning/jobs/${e}/cancel`,t)}listEvents(e,t={},r){return tj(t)?this.listEvents(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/events`,rh,{query:t,...r})}}class rp extends t7{}class rh extends t7{}rf.FineTuningJobsPage=rp,rf.FineTuningJobEventsPage=rh,rf.Checkpoints=rc,rf.FineTuningJobCheckpointsPage=rd;class rm extends t3{constructor(){super(...arguments),this.jobs=new rf(this._client)}}rm.Jobs=rf,rm.FineTuningJobsPage=rp,rm.FineTuningJobEventsPage=rh;class rg extends t3{create(e,t){return this._client.post("/assistants",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,r){return this._client.post(`/assistants/${e}`,{body:t,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/assistants",ry,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}}class ry extends t7{}function rv(e){return"function"==typeof e.parse}rg.AssistantsPage=ry;let rb=e=>e?.role==="assistant",r_=e=>e?.role==="function",r$=e=>e?.role==="tool";var rw=function(e,t,r,n,o){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},rS=function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class rE{constructor(){ei.add(this),this.controller=new AbortController,ea.set(this,void 0),es.set(this,()=>{}),el.set(this,()=>{}),eu.set(this,void 0),ec.set(this,()=>{}),ed.set(this,()=>{}),ef.set(this,{}),ep.set(this,!1),eh.set(this,!1),em.set(this,!1),eg.set(this,!1),rw(this,ea,new Promise((e,t)=>{rw(this,es,e,"f"),rw(this,el,t,"f")}),"f"),rw(this,eu,new Promise((e,t)=>{rw(this,ec,e,"f"),rw(this,ed,t,"f")}),"f"),rS(this,ea,"f").catch(()=>{}),rS(this,eu,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},rS(this,ei,"m",ey).bind(this))},0)}_connected(){this.ended||(rS(this,es,"f").call(this),this._emit("connect"))}get ended(){return rS(this,ep,"f")}get errored(){return rS(this,eh,"f")}get aborted(){return rS(this,em,"f")}abort(){this.controller.abort()}on(e,t){return(rS(this,ef,"f")[e]||(rS(this,ef,"f")[e]=[])).push({listener:t}),this}off(e,t){let r=rS(this,ef,"f")[e];if(!r)return this;let n=r.findIndex(e=>e.listener===t);return n>=0&&r.splice(n,1),this}once(e,t){return(rS(this,ef,"f")[e]||(rS(this,ef,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,r)=>{rw(this,eg,!0,"f"),"error"!==e&&this.once("error",r),this.once(e,t)})}async done(){rw(this,eg,!0,"f"),await rS(this,eu,"f")}_emit(e,...t){if(rS(this,ep,"f"))return;"end"===e&&(rw(this,ep,!0,"f"),rS(this,ec,"f").call(this));let r=rS(this,ef,"f")[e];if(r&&(rS(this,ef,"f")[e]=r.filter(e=>!e.once),r.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];rS(this,eg,"f")||r?.length||Promise.reject(e),rS(this,el,"f").call(this,e),rS(this,ed,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];rS(this,eg,"f")||r?.length||Promise.reject(e),rS(this,el,"f").call(this,e),rS(this,ed,"f").call(this,e),this._emit("end")}}_emitFinal(){}}function rx(e){return e?.$brand==="auto-parseable-response-format"}function rA(e){return e?.$brand==="auto-parseable-tool"}function rO(e,t){return t&&rP(t)?rk(e,t):{...e,choices:e.choices.map(e=>({...e,message:{...e.message,parsed:null,tool_calls:e.message.tool_calls??[]}}))}}function rk(e,t){let r=e.choices.map(e=>{if("length"===e.finish_reason)throw new er;if("content_filter"===e.finish_reason)throw new en;return{...e,message:{...e.message,tool_calls:e.message.tool_calls?.map(e=>rC(t,e))??[],parsed:e.message.content&&!e.message.refusal?rI(t,e.message.content):null}}});return{...e,choices:r}}function rI(e,t){return e.response_format?.type!=="json_schema"?null:e.response_format?.type==="json_schema"?"$parseRaw"in e.response_format?e.response_format.$parseRaw(t):JSON.parse(t):null}function rC(e,t){let r=e.tools?.find(e=>e.function?.name===t.function.name);return{...t,function:{...t.function,parsed_arguments:rA(r)?r.$parseRaw(t.function.arguments):r?.function.strict?JSON.parse(t.function.arguments):null}}}function rT(e,t){if(!e)return!1;let r=e.tools?.find(e=>e.function?.name===t.function.name);return rA(r)||r?.function.strict||!1}function rP(e){return!!rx(e.response_format)||(e.tools?.some(e=>rA(e)||"function"===e.type&&!0===e.function.strict)??!1)}function rR(e){for(let t of e??[]){if("function"!==t.type)throw new Y(`Currently only \`function\` tool types support auto-parsing; Received \`${t.type}\``);if(!0!==t.function.strict)throw new Y(`The \`${t.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}ea=new WeakMap,es=new WeakMap,el=new WeakMap,eu=new WeakMap,ec=new WeakMap,ed=new WeakMap,ef=new WeakMap,ep=new WeakMap,eh=new WeakMap,em=new WeakMap,eg=new WeakMap,ei=new WeakSet,ey=function(e){if(rw(this,eh,!0,"f"),e instanceof Error&&"AbortError"===e.name&&(e=new q),e instanceof q)return rw(this,em,!0,"f"),this._emit("abort",e);if(e instanceof Y)return this._emit("error",e);if(e instanceof Error){let t=new Y(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new Y(String(e)))};var rj=function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};let rN=10;class rM extends rE{constructor(){super(...arguments),ev.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);let t=e.choices[0]?.message;return t&&this._addMessage(t),e}_addMessage(e,t=!0){if("content"in e||(e.content=null),this.messages.push(e),t){if(this._emit("message",e),(r_(e)||r$(e))&&e.content)this._emit("functionCallResult",e.content);else if(rb(e)&&e.function_call)this._emit("functionCall",e.function_call);else if(rb(e)&&e.tool_calls)for(let t of e.tool_calls)"function"===t.type&&this._emit("functionCall",t.function)}}async finalChatCompletion(){await this.done();let e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new Y("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),rj(this,ev,"m",eb).call(this)}async finalMessage(){return await this.done(),rj(this,ev,"m",e_).call(this)}async finalFunctionCall(){return await this.done(),rj(this,ev,"m",e$).call(this)}async finalFunctionCallResult(){return await this.done(),rj(this,ev,"m",ew).call(this)}async totalUsage(){return await this.done(),rj(this,ev,"m",eS).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);let t=rj(this,ev,"m",e_).call(this);t&&this._emit("finalMessage",t);let r=rj(this,ev,"m",eb).call(this);r&&this._emit("finalContent",r);let n=rj(this,ev,"m",e$).call(this);n&&this._emit("finalFunctionCall",n);let o=rj(this,ev,"m",ew).call(this);null!=o&&this._emit("finalFunctionCallResult",o),this._chatCompletions.some(e=>e.usage)&&this._emit("totalUsage",rj(this,ev,"m",eS).call(this))}async _createChatCompletion(e,t,r){let n=r?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),rj(this,ev,"m",eE).call(this,t);let o=await e.chat.completions.create({...t,stream:!1},{...r,signal:this.controller.signal});return this._connected(),this._addChatCompletion(rk(o,t))}async _runChatCompletion(e,t,r){for(let e of t.messages)this._addMessage(e,!1);return await this._createChatCompletion(e,t,r)}async _runFunctions(e,t,r){let n="function",{function_call:o="auto",stream:i,...a}=t,s="string"!=typeof o&&o?.name,{maxChatCompletions:l=rN}=r||{},u={};for(let e of t.functions)u[e.name||e.function.name]=e;let c=t.functions.map(e=>({name:e.name||e.function.name,parameters:e.parameters,description:e.description}));for(let e of t.messages)this._addMessage(e,!1);for(let t=0;tJSON.stringify(e.name)).join(", ")}. Please try again`;this._addMessage({role:n,name:d,content:e});continue}try{t=rv(p)?await p.parse(f):f}catch(e){this._addMessage({role:n,name:d,content:e instanceof Error?e.message:String(e)});continue}let h=await p.function(t,this),m=rj(this,ev,"m",ex).call(this,h);if(this._addMessage({role:n,name:d,content:m}),s)return}}async _runTools(e,t,r){let n="tool",{tool_choice:o="auto",stream:i,...a}=t,s="string"!=typeof o&&o?.function?.name,{maxChatCompletions:l=rN}=r||{},u=t.tools.map(e=>{if(rA(e)){if(!e.$callback)throw new Y("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:e.$callback,name:e.function.name,description:e.function.description||"",parameters:e.function.parameters,parse:e.$parseRaw,strict:!0}}}return e}),c={};for(let e of u)"function"===e.type&&(c[e.function.name||e.function.function.name]=e.function);let d="tools"in t?u.map(e=>"function"===e.type?{type:"function",function:{name:e.function.name||e.function.function.name,parameters:e.function.parameters,description:e.function.description,strict:e.function.strict}}:e):void 0;for(let e of t.messages)this._addMessage(e,!1);for(let t=0;tJSON.stringify(e)).join(", ")}. Please try again`;this._addMessage({role:n,tool_call_id:r,content:e});continue}try{t=rv(a)?await a.parse(i):i}catch(t){let e=t instanceof Error?t.message:String(t);this._addMessage({role:n,tool_call_id:r,content:e});continue}let l=await a.function(t,this),u=rj(this,ev,"m",ex).call(this,l);if(this._addMessage({role:n,tool_call_id:r,content:u}),s)return}}}}ev=new WeakSet,eb=function(){return rj(this,ev,"m",e_).call(this).content??null},e_=function(){let e=this.messages.length;for(;e-- >0;){let t=this.messages[e];if(rb(t)){let{function_call:e,...r}=t,n={...r,content:t.content??null,refusal:t.refusal??null};return e&&(n.function_call=e),n}}throw new Y("stream ended without producing a ChatCompletionMessage with role=assistant")},e$=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(rb(t)&&t?.function_call)return t.function_call;if(rb(t)&&t?.tool_calls?.length)return t.tool_calls.at(-1)?.function}},ew=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(r_(t)&&null!=t.content||r$(t)&&null!=t.content&&"string"==typeof t.content&&this.messages.some(e=>"assistant"===e.role&&e.tool_calls?.some(e=>"function"===e.type&&e.id===t.tool_call_id)))return t.content}},eS=function(){let e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:t}of this._chatCompletions)t&&(e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens);return e},eE=function(e){if(null!=e.n&&e.n>1)throw new Y("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},ex=function(e){return"string"==typeof e?e:void 0===e?"undefined":JSON.stringify(e)};class rL extends rM{static runFunctions(e,t,r){let n=new rL,o={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runFunctions"}};return n._run(()=>n._runFunctions(e,t,o)),n}static runTools(e,t,r){let n=new rL,o={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runTools"}};return n._run(()=>n._runTools(e,t,o)),n}_addMessage(e,t=!0){super._addMessage(e,t),rb(e)&&e.content&&this._emit("content",e.content)}}let rD={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,INF:384,ALL:511};class rB extends Error{}class rF extends Error{}function rU(e,t=rD.ALL){if("string"!=typeof e)throw TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw Error(`${e} is empty`);return rZ(e.trim(),t)}let rZ=(e,t)=>{let r=e.length,n=0,o=e=>{throw new rB(`${e} at position ${n}`)},i=e=>{throw new rF(`${e} at position ${n}`)},a=()=>(d(),n>=r&&o("Unexpected end of input"),'"'===e[n])?s():"{"===e[n]?l():"["===e[n]?u():"null"===e.substring(n,n+4)||rD.NULL&t&&r-n<4&&"null".startsWith(e.substring(n))?(n+=4,null):"true"===e.substring(n,n+4)||rD.BOOL&t&&r-n<4&&"true".startsWith(e.substring(n))?(n+=4,!0):"false"===e.substring(n,n+5)||rD.BOOL&t&&r-n<5&&"false".startsWith(e.substring(n))?(n+=5,!1):"Infinity"===e.substring(n,n+8)||rD.INFINITY&t&&r-n<8&&"Infinity".startsWith(e.substring(n))?(n+=8,1/0):"-Infinity"===e.substring(n,n+9)||rD.MINUS_INFINITY&t&&1{let a=n,s=!1;for(n++;n{n++,d();let i={};try{for(;"}"!==e[n];){if(d(),n>=r&&rD.OBJ&t)return i;let o=s();d(),n++;try{let e=a();Object.defineProperty(i,o,{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){if(rD.OBJ&t)return i;throw e}d(),","===e[n]&&n++}}catch(e){if(rD.OBJ&t)return i;o("Expected '}' at end of object")}return n++,i},u=()=>{n++;let r=[];try{for(;"]"!==e[n];)r.push(a()),d(),","===e[n]&&n++}catch(e){if(rD.ARR&t)return r;o("Expected ']' at end of array")}return n++,r},c=()=>{if(0===n){"-"===e&&rD.NUM&t&&o("Not sure what '-' is");try{return JSON.parse(e)}catch(r){if(rD.NUM&t)try{if("."===e[e.length-1])return JSON.parse(e.substring(0,e.lastIndexOf(".")));return JSON.parse(e.substring(0,e.lastIndexOf("e")))}catch(e){}i(String(r))}}let a=n;for("-"===e[n]&&n++;e[n]&&!",]}".includes(e[n]);)n++;n!=r||rD.NUM&t||o("Unterminated number literal");try{return JSON.parse(e.substring(a,n))}catch(r){"-"===e.substring(a,n)&&rD.NUM&t&&o("Not sure what '-' is");try{return JSON.parse(e.substring(a,e.lastIndexOf("e")))}catch(e){i(String(e))}}},d=()=>{for(;nrU(e,rD.ALL^rD.NUM);var rH=function(e,t,r,n,o){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},rq=function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class rG extends rM{constructor(e){super(),eA.add(this),eO.set(this,void 0),ek.set(this,void 0),eI.set(this,void 0),rH(this,eO,e,"f"),rH(this,ek,[],"f")}get currentChatCompletionSnapshot(){return rq(this,eI,"f")}static fromReadableStream(e){let t=new rG(null);return t._run(()=>t._fromReadableStream(e)),t}static createChatCompletion(e,t,r){let n=new rG(t);return n._run(()=>n._runChatCompletion(e,{...t,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),n}async _createChatCompletion(e,t,r){super._createChatCompletion;let n=r?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),rq(this,eA,"m",eC).call(this);let o=await e.chat.completions.create({...t,stream:!0},{...r,signal:this.controller.signal});for await(let e of(this._connected(),o))rq(this,eA,"m",eP).call(this,e);if(o.controller.signal?.aborted)throw new q;return this._addChatCompletion(rq(this,eA,"m",eN).call(this))}async _fromReadableStream(e,t){let r,n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),rq(this,eA,"m",eC).call(this),this._connected();let o=te.fromReadableStream(e,this.controller);for await(let e of o)r&&r!==e.id&&this._addChatCompletion(rq(this,eA,"m",eN).call(this)),rq(this,eA,"m",eP).call(this,e),r=e.id;if(o.controller.signal?.aborted)throw new q;return this._addChatCompletion(rq(this,eA,"m",eN).call(this))}[(eO=new WeakMap,ek=new WeakMap,eI=new WeakMap,eA=new WeakSet,eC=function(){this.ended||rH(this,eI,void 0,"f")},eT=function(e){let t=rq(this,ek,"f")[e.index];return t||(t={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},rq(this,ek,"f")[e.index]=t),t},eP=function(e){if(this.ended)return;let t=rq(this,eA,"m",eL).call(this,e);for(let r of(this._emit("chunk",e,t),e.choices)){let e=t.choices[r.index];null!=r.delta.content&&e.message?.role==="assistant"&&e.message?.content&&(this._emit("content",r.delta.content,e.message.content),this._emit("content.delta",{delta:r.delta.content,snapshot:e.message.content,parsed:e.message.parsed})),null!=r.delta.refusal&&e.message?.role==="assistant"&&e.message?.refusal&&this._emit("refusal.delta",{delta:r.delta.refusal,snapshot:e.message.refusal}),r.logprobs?.content!=null&&e.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:r.logprobs?.content,snapshot:e.logprobs?.content??[]}),r.logprobs?.refusal!=null&&e.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:r.logprobs?.refusal,snapshot:e.logprobs?.refusal??[]});let n=rq(this,eA,"m",eT).call(this,e);for(let t of(e.finish_reason&&(rq(this,eA,"m",ej).call(this,e),null!=n.current_tool_call_index&&rq(this,eA,"m",eR).call(this,e,n.current_tool_call_index)),r.delta.tool_calls??[]))n.current_tool_call_index!==t.index&&(rq(this,eA,"m",ej).call(this,e),null!=n.current_tool_call_index&&rq(this,eA,"m",eR).call(this,e,n.current_tool_call_index)),n.current_tool_call_index=t.index;for(let t of r.delta.tool_calls??[]){let r=e.message.tool_calls?.[t.index];r?.type&&(r?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:r.function?.name,index:t.index,arguments:r.function.arguments,parsed_arguments:r.function.parsed_arguments,arguments_delta:t.function?.arguments??""}):r?.type)}}},eR=function(e,t){if(rq(this,eA,"m",eT).call(this,e).done_tool_calls.has(t))return;let r=e.message.tool_calls?.[t];if(!r)throw Error("no tool call snapshot");if(!r.type)throw Error("tool call snapshot missing `type`");if("function"===r.type){let e=rq(this,eO,"f")?.tools?.find(e=>"function"===e.type&&e.function.name===r.function.name);this._emit("tool_calls.function.arguments.done",{name:r.function.name,index:t,arguments:r.function.arguments,parsed_arguments:rA(e)?e.$parseRaw(r.function.arguments):e?.function.strict?JSON.parse(r.function.arguments):null})}else r.type},ej=function(e){let t=rq(this,eA,"m",eT).call(this,e);if(e.message.content&&!t.content_done){t.content_done=!0;let r=rq(this,eA,"m",eM).call(this);this._emit("content.done",{content:e.message.content,parsed:r?r.$parseRaw(e.message.content):null})}e.message.refusal&&!t.refusal_done&&(t.refusal_done=!0,this._emit("refusal.done",{refusal:e.message.refusal})),e.logprobs?.content&&!t.logprobs_content_done&&(t.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:e.logprobs.content})),e.logprobs?.refusal&&!t.logprobs_refusal_done&&(t.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:e.logprobs.refusal}))},eN=function(){if(this.ended)throw new Y("stream has ended, this shouldn't happen");let e=rq(this,eI,"f");if(!e)throw new Y("request ended without sending any chunks");return rH(this,eI,void 0,"f"),rH(this,ek,[],"f"),rW(e,rq(this,eO,"f"))},eM=function(){let e=rq(this,eO,"f")?.response_format;return rx(e)?e:null},eL=function(e){var t,r,n,o;let i=rq(this,eI,"f"),{choices:a,...s}=e;for(let{delta:a,finish_reason:l,index:u,logprobs:c=null,...d}of(i?Object.assign(i,s):i=rH(this,eI,{...s,choices:[]},"f"),e.choices)){let e=i.choices[u];if(e||(e=i.choices[u]={finish_reason:l,index:u,message:{},logprobs:c,...d}),c)if(e.logprobs){let{content:n,refusal:o,...i}=c;Object.assign(e.logprobs,i),n&&((t=e.logprobs).content??(t.content=[]),e.logprobs.content.push(...n)),o&&((r=e.logprobs).refusal??(r.refusal=[]),e.logprobs.refusal.push(...o))}else e.logprobs=Object.assign({},c);if(l&&(e.finish_reason=l,rq(this,eO,"f")&&rP(rq(this,eO,"f")))){if("length"===l)throw new er;if("content_filter"===l)throw new en}if(Object.assign(e,d),!a)continue;let{content:s,refusal:f,function_call:p,role:h,tool_calls:m,...g}=a;if(Object.assign(e.message,g),f&&(e.message.refusal=(e.message.refusal||"")+f),h&&(e.message.role=h),p&&(e.message.function_call?(p.name&&(e.message.function_call.name=p.name),p.arguments&&((n=e.message.function_call).arguments??(n.arguments=""),e.message.function_call.arguments+=p.arguments)):e.message.function_call=p),s&&(e.message.content=(e.message.content||"")+s,!e.message.refusal&&rq(this,eA,"m",eM).call(this)&&(e.message.parsed=rY(e.message.content))),m)for(let{index:t,id:r,type:n,function:i,...a}of(e.message.tool_calls||(e.message.tool_calls=[]),m)){let s=(o=e.message.tool_calls)[t]??(o[t]={});Object.assign(s,a),r&&(s.id=r),n&&(s.type=n),i&&(s.function??(s.function={name:i.name??"",arguments:""})),i?.name&&(s.function.name=i.name),i?.arguments&&(s.function.arguments+=i.arguments,rT(rq(this,eO,"f"),s)&&(s.function.parsed_arguments=rY(s.function.arguments)))}}return i},Symbol.asyncIterator)](){let e=[],t=[],r=!1;return this.on("chunk",r=>{let n=t.shift();n?n.resolve(r):e.push(r)}),this.on("end",()=>{for(let e of(r=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let n of(r=!0,t))n.reject(e);t.length=0}),this.on("error",e=>{for(let n of(r=!0,t))n.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((e,r)=>t.push({resolve:e,reject:r})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new te(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function rW(e,t){let{id:r,choices:n,created:o,model:i,system_fingerprint:a,...s}=e;return rO({...s,id:r,choices:n.map(({message:t,finish_reason:r,index:n,logprobs:o,...i})=>{if(!r)throw new Y(`missing finish_reason for choice ${n}`);let{content:a=null,function_call:s,tool_calls:l,...u}=t,c=t.role;if(!c)throw new Y(`missing role for choice ${n}`);if(s){let{arguments:e,name:l}=s;if(null==e)throw new Y(`missing function_call.arguments for choice ${n}`);if(!l)throw new Y(`missing function_call.name for choice ${n}`);return{...i,message:{content:a,function_call:{arguments:e,name:l},role:c,refusal:t.refusal??null},finish_reason:r,index:n,logprobs:o}}return l?{...i,index:n,finish_reason:r,logprobs:o,message:{...u,role:c,content:a,refusal:t.refusal??null,tool_calls:l.map((t,r)=>{let{function:o,type:i,id:a,...s}=t,{arguments:l,name:u,...c}=o||{};if(null==a)throw new Y(`missing choices[${n}].tool_calls[${r}].id ${rK(e)}`);if(null==i)throw new Y(`missing choices[${n}].tool_calls[${r}].type ${rK(e)}`);if(null==u)throw new Y(`missing choices[${n}].tool_calls[${r}].function.name ${rK(e)}`);if(null==l)throw new Y(`missing choices[${n}].tool_calls[${r}].function.arguments ${rK(e)}`);return{...s,id:a,type:i,function:{...c,name:u,arguments:l}}})}}:{...i,message:{...u,content:a,role:c,refusal:t.refusal??null},finish_reason:r,index:n,logprobs:o}}),created:o,model:i,object:"chat.completion",...a?{system_fingerprint:a}:{}},t)}function rK(e){return JSON.stringify(e)}class rV extends rG{static fromReadableStream(e){let t=new rV(null);return t._run(()=>t._fromReadableStream(e)),t}static runFunctions(e,t,r){let n=new rV(null),o={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runFunctions"}};return n._run(()=>n._runFunctions(e,t,o)),n}static runTools(e,t,r){let n=new rV(t),o={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runTools"}};return n._run(()=>n._runTools(e,t,o)),n}}class rz extends t3{parse(e,t){return rR(e.tools),this._client.chat.completions.create(e,{...t,headers:{...t?.headers,"X-Stainless-Helper-Method":"beta.chat.completions.parse"}})._thenUnwrap(t=>rk(t,e))}runFunctions(e,t){return e.stream?rV.runFunctions(this._client,e,t):rL.runFunctions(this._client,e,t)}runTools(e,t){return e.stream?rV.runTools(this._client,e,t):rL.runTools(this._client,e,t)}stream(e,t){return rG.createChatCompletion(this._client,e,t)}}class rJ extends t3{constructor(){super(...arguments),this.completions=new rz(this._client)}}!function(e){e.Completions=rz}(rJ||(rJ={}));class rX extends t3{create(e,t){return this._client.post("/realtime/sessions",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}}class rQ extends t3{constructor(){super(...arguments),this.sessions=new rX(this._client)}}rQ.Sessions=rX;var r0=function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},r1=function(e,t,r,n,o){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r};class r2 extends rE{constructor(){super(...arguments),eD.add(this),eB.set(this,[]),eF.set(this,{}),eU.set(this,{}),eZ.set(this,void 0),eY.set(this,void 0),eH.set(this,void 0),eq.set(this,void 0),eG.set(this,void 0),eW.set(this,void 0),eK.set(this,void 0),eV.set(this,void 0),ez.set(this,void 0)}[(eB=new WeakMap,eF=new WeakMap,eU=new WeakMap,eZ=new WeakMap,eY=new WeakMap,eH=new WeakMap,eq=new WeakMap,eG=new WeakMap,eW=new WeakMap,eK=new WeakMap,eV=new WeakMap,ez=new WeakMap,eD=new WeakSet,Symbol.asyncIterator)](){let e=[],t=[],r=!1;return this.on("event",r=>{let n=t.shift();n?n.resolve(r):e.push(r)}),this.on("end",()=>{for(let e of(r=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let n of(r=!0,t))n.reject(e);t.length=0}),this.on("error",e=>{for(let n of(r=!0,t))n.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((e,r)=>t.push({resolve:e,reject:r})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(e){let t=new r2;return t._run(()=>t._fromReadableStream(e)),t}async _fromReadableStream(e,t){let r=t?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),this._connected();let n=te.fromReadableStream(e,this.controller);for await(let e of n)r0(this,eD,"m",eJ).call(this,e);if(n.controller.signal?.aborted)throw new q;return this._addRun(r0(this,eD,"m",eX).call(this))}toReadableStream(){return new te(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(e,t,r,n,o){let i=new r2;return i._run(()=>i._runToolAssistantStream(e,t,r,n,{...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"stream"}})),i}async _createToolAssistantStream(e,t,r,n,o){let i=o?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort()));let a={...n,stream:!0},s=await e.submitToolOutputs(t,r,a,{...o,signal:this.controller.signal});for await(let e of(this._connected(),s))r0(this,eD,"m",eJ).call(this,e);if(s.controller.signal?.aborted)throw new q;return this._addRun(r0(this,eD,"m",eX).call(this))}static createThreadAssistantStream(e,t,r){let n=new r2;return n._run(()=>n._threadAssistantStream(e,t,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),n}static createAssistantStream(e,t,r,n){let o=new r2;return o._run(()=>o._runAssistantStream(e,t,r,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),o}currentEvent(){return r0(this,eK,"f")}currentRun(){return r0(this,eV,"f")}currentMessageSnapshot(){return r0(this,eZ,"f")}currentRunStepSnapshot(){return r0(this,ez,"f")}async finalRunSteps(){return await this.done(),Object.values(r0(this,eF,"f"))}async finalMessages(){return await this.done(),Object.values(r0(this,eU,"f"))}async finalRun(){if(await this.done(),!r0(this,eY,"f"))throw Error("Final run was not received.");return r0(this,eY,"f")}async _createThreadAssistantStream(e,t,r){let n=r?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort()));let o={...t,stream:!0},i=await e.createAndRun(o,{...r,signal:this.controller.signal});for await(let e of(this._connected(),i))r0(this,eD,"m",eJ).call(this,e);if(i.controller.signal?.aborted)throw new q;return this._addRun(r0(this,eD,"m",eX).call(this))}async _createAssistantStream(e,t,r,n){let o=n?.signal;o&&(o.aborted&&this.controller.abort(),o.addEventListener("abort",()=>this.controller.abort()));let i={...r,stream:!0},a=await e.create(t,i,{...n,signal:this.controller.signal});for await(let e of(this._connected(),a))r0(this,eD,"m",eJ).call(this,e);if(a.controller.signal?.aborted)throw new q;return this._addRun(r0(this,eD,"m",eX).call(this))}static accumulateDelta(e,t){for(let[r,n]of Object.entries(t)){if(!e.hasOwnProperty(r)){e[r]=n;continue}let t=e[r];if(null==t||"index"===r||"type"===r){e[r]=n;continue}if("string"==typeof t&&"string"==typeof n)t+=n;else if("number"==typeof t&&"number"==typeof n)t+=n;else if(t2(t)&&t2(n))t=this.accumulateDelta(t,n);else if(Array.isArray(t)&&Array.isArray(n)){if(t.every(e=>"string"==typeof e||"number"==typeof e)){t.push(...n);continue}for(let e of n){if(!t2(e))throw Error(`Expected array delta entry to be an object but got: ${e}`);let r=e.index;if(null==r)throw console.error(e),Error("Expected array delta entry to have an `index` property");if("number"!=typeof r)throw Error(`Expected array delta entry \`index\` property to be a number but got ${r}`);let n=t[r];null==n?t.push(e):t[r]=this.accumulateDelta(n,e)}continue}else throw Error(`Unhandled record type: ${r}, deltaValue: ${n}, accValue: ${t}`);e[r]=t}return e}_addRun(e){return e}async _threadAssistantStream(e,t,r){return await this._createThreadAssistantStream(t,e,r)}async _runAssistantStream(e,t,r,n){return await this._createAssistantStream(t,e,r,n)}async _runToolAssistantStream(e,t,r,n,o){return await this._createToolAssistantStream(r,e,t,n,o)}}eJ=function(e){if(!this.ended)switch(r1(this,eK,e,"f"),r0(this,eD,"m",e1).call(this,e),e.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":r0(this,eD,"m",e4).call(this,e);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":r0(this,eD,"m",e0).call(this,e);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":r0(this,eD,"m",eQ).call(this,e);break;case"error":throw Error("Encountered an error event in event processing - errors should be processed earlier")}},eX=function(){if(this.ended)throw new Y("stream has ended, this shouldn't happen");if(!r0(this,eY,"f"))throw Error("Final run has not been received");return r0(this,eY,"f")},eQ=function(e){let[t,r]=r0(this,eD,"m",e3).call(this,e,r0(this,eZ,"f"));for(let e of(r1(this,eZ,t,"f"),r0(this,eU,"f")[t.id]=t,r)){let r=t.content[e.index];r?.type=="text"&&this._emit("textCreated",r.text)}switch(e.event){case"thread.message.created":this._emit("messageCreated",e.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",e.data.delta,t),e.data.delta.content)for(let r of e.data.delta.content){if("text"==r.type&&r.text){let e=r.text,n=t.content[r.index];if(n&&"text"==n.type)this._emit("textDelta",e,n.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(r.index!=r0(this,eH,"f")){if(r0(this,eq,"f"))switch(r0(this,eq,"f").type){case"text":this._emit("textDone",r0(this,eq,"f").text,r0(this,eZ,"f"));break;case"image_file":this._emit("imageFileDone",r0(this,eq,"f").image_file,r0(this,eZ,"f"))}r1(this,eH,r.index,"f")}r1(this,eq,t.content[r.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(void 0!==r0(this,eH,"f")){let t=e.data.content[r0(this,eH,"f")];if(t)switch(t.type){case"image_file":this._emit("imageFileDone",t.image_file,r0(this,eZ,"f"));break;case"text":this._emit("textDone",t.text,r0(this,eZ,"f"))}}r0(this,eZ,"f")&&this._emit("messageDone",e.data),r1(this,eZ,void 0,"f")}},e0=function(e){let t=r0(this,eD,"m",e2).call(this,e);switch(r1(this,ez,t,"f"),e.event){case"thread.run.step.created":this._emit("runStepCreated",e.data);break;case"thread.run.step.delta":let r=e.data.delta;if(r.step_details&&"tool_calls"==r.step_details.type&&r.step_details.tool_calls&&"tool_calls"==t.step_details.type)for(let e of r.step_details.tool_calls)e.index==r0(this,eG,"f")?this._emit("toolCallDelta",e,t.step_details.tool_calls[e.index]):(r0(this,eW,"f")&&this._emit("toolCallDone",r0(this,eW,"f")),r1(this,eG,e.index,"f"),r1(this,eW,t.step_details.tool_calls[e.index],"f"),r0(this,eW,"f")&&this._emit("toolCallCreated",r0(this,eW,"f")));this._emit("runStepDelta",e.data.delta,t);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":r1(this,ez,void 0,"f"),"tool_calls"==e.data.step_details.type&&r0(this,eW,"f")&&(this._emit("toolCallDone",r0(this,eW,"f")),r1(this,eW,void 0,"f")),this._emit("runStepDone",e.data,t)}},e1=function(e){r0(this,eB,"f").push(e),this._emit("event",e)},e2=function(e){switch(e.event){case"thread.run.step.created":return r0(this,eF,"f")[e.data.id]=e.data,e.data;case"thread.run.step.delta":let t=r0(this,eF,"f")[e.data.id];if(!t)throw Error("Received a RunStepDelta before creation of a snapshot");let r=e.data;if(r.delta){let n=r2.accumulateDelta(t,r.delta);r0(this,eF,"f")[e.data.id]=n}return r0(this,eF,"f")[e.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":r0(this,eF,"f")[e.data.id]=e.data}if(r0(this,eF,"f")[e.data.id])return r0(this,eF,"f")[e.data.id];throw Error("No snapshot available")},e3=function(e,t){let r=[];switch(e.event){case"thread.message.created":return[e.data,r];case"thread.message.delta":if(!t)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let n=e.data;if(n.delta.content)for(let e of n.delta.content)if(e.index in t.content){let r=t.content[e.index];t.content[e.index]=r0(this,eD,"m",e9).call(this,e,r)}else t.content[e.index]=e,r.push(e);return[t,r];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(t)return[t,r];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},e9=function(e,t){return r2.accumulateDelta(t,e)},e4=function(e){switch(r1(this,eV,e.data,"f"),e.event){case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":r1(this,eY,e.data,"f"),r0(this,eW,"f")&&(this._emit("toolCallDone",r0(this,eW,"f")),r1(this,eW,void 0,"f"))}};class r3 extends t3{create(e,t,r){return this._client.post(`/threads/${e}/messages`,{body:t,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}retrieve(e,t,r){return this._client.get(`/threads/${e}/messages/${t}`,{...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}update(e,t,r,n){return this._client.post(`/threads/${e}/messages/${t}`,{body:r,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e,t={},r){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/threads/${e}/messages`,r9,{query:t,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}del(e,t,r){return this._client.delete(`/threads/${e}/messages/${t}`,{...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}}class r9 extends t7{}r3.MessagesPage=r9;class r4 extends t3{retrieve(e,t,r,n={},o){return tj(n)?this.retrieve(e,t,r,{},n):this._client.get(`/threads/${e}/runs/${t}/steps/${r}`,{query:n,...o,headers:{"OpenAI-Beta":"assistants=v2",...o?.headers}})}list(e,t,r={},n){return tj(r)?this.list(e,t,{},r):this._client.getAPIList(`/threads/${e}/runs/${t}/steps`,r8,{query:r,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class r8 extends t7{}r4.RunStepsPage=r8;class r6 extends t3{constructor(){super(...arguments),this.steps=new r4(this._client)}create(e,t,r){let{include:n,...o}=t;return this._client.post(`/threads/${e}/runs`,{query:{include:n},body:o,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers},stream:t.stream??!1})}retrieve(e,t,r){return this._client.get(`/threads/${e}/runs/${t}`,{...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}update(e,t,r,n){return this._client.post(`/threads/${e}/runs/${t}`,{body:r,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e,t={},r){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/threads/${e}/runs`,r5,{query:t,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}cancel(e,t,r){return this._client.post(`/threads/${e}/runs/${t}/cancel`,{...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}async createAndPoll(e,t,r){let n=await this.create(e,t,r);return await this.poll(e,n.id,r)}createAndStream(e,t,r){return r2.createAssistantStream(e,this._client.beta.threads.runs,t,r)}async poll(e,t,r){let n={...r?.headers,"X-Stainless-Poll-Helper":"true"};for(r?.pollIntervalMs&&(n["X-Stainless-Custom-Poll-Interval"]=r.pollIntervalMs.toString());;){let{data:o,response:i}=await this.retrieve(e,t,{...r,headers:{...r?.headers,...n}}).withResponse();switch(o.status){case"queued":case"in_progress":case"cancelling":let a=5e3;if(r?.pollIntervalMs)a=r.pollIntervalMs;else{let e=i.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(a=t)}}await tY(a);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return o}}}stream(e,t,r){return r2.createAssistantStream(e,this._client.beta.threads.runs,t,r)}submitToolOutputs(e,t,r,n){return this._client.post(`/threads/${e}/runs/${t}/submit_tool_outputs`,{body:r,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers},stream:r.stream??!1})}async submitToolOutputsAndPoll(e,t,r,n){let o=await this.submitToolOutputs(e,t,r,n);return await this.poll(e,o.id,n)}submitToolOutputsStream(e,t,r,n){return r2.createToolAssistantStream(e,t,this._client.beta.threads.runs,r,n)}}class r5 extends t7{}r6.RunsPage=r5,r6.Steps=r4,r6.RunStepsPage=r8;class r7 extends t3{constructor(){super(...arguments),this.runs=new r6(this._client),this.messages=new r3(this._client)}create(e={},t){return tj(e)?this.create({},e):this._client.post("/threads",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/threads/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,r){return this._client.post(`/threads/${e}`,{body:t,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}del(e,t){return this._client.delete(`/threads/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}createAndRun(e,t){return this._client.post("/threads/runs",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers},stream:e.stream??!1})}async createAndRunPoll(e,t){let r=await this.createAndRun(e,t);return await this.runs.poll(r.thread_id,r.id,t)}createAndRunStream(e,t){return r2.createThreadAssistantStream(e,this._client.beta.threads,t)}}r7.Runs=r6,r7.RunsPage=r5,r7.Messages=r3,r7.MessagesPage=r9;let ne=async e=>{let t=await Promise.allSettled(e),r=t.filter(e=>"rejected"===e.status);if(r.length){for(let e of r)console.error(e.reason);throw Error(`${r.length} promise(s) failed - see the above errors`)}let n=[];for(let e of t)"fulfilled"===e.status&&n.push(e.value);return n};class nt extends t3{create(e,t,r){return this._client.post(`/vector_stores/${e}/files`,{body:t,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}retrieve(e,t,r){return this._client.get(`/vector_stores/${e}/files/${t}`,{...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}list(e,t={},r){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/vector_stores/${e}/files`,nr,{query:t,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}del(e,t,r){return this._client.delete(`/vector_stores/${e}/files/${t}`,{...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}async createAndPoll(e,t,r){let n=await this.create(e,t,r);return await this.poll(e,n.id,r)}async poll(e,t,r){let n={...r?.headers,"X-Stainless-Poll-Helper":"true"};for(r?.pollIntervalMs&&(n["X-Stainless-Custom-Poll-Interval"]=r.pollIntervalMs.toString());;){let o=await this.retrieve(e,t,{...r,headers:n}).withResponse(),i=o.data;switch(i.status){case"in_progress":let a=5e3;if(r?.pollIntervalMs)a=r.pollIntervalMs;else{let e=o.response.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(a=t)}}await tY(a);break;case"failed":case"completed":return i}}}async upload(e,t,r){let n=await this._client.files.create({file:t,purpose:"assistants"},r);return this.create(e,{file_id:n.id},r)}async uploadAndPoll(e,t,r){let n=await this.upload(e,t,r);return await this.poll(e,n.id,r)}}class nr extends t7{}nt.VectorStoreFilesPage=nr;class nn extends t3{create(e,t,r){return this._client.post(`/vector_stores/${e}/file_batches`,{body:t,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}retrieve(e,t,r){return this._client.get(`/vector_stores/${e}/file_batches/${t}`,{...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}cancel(e,t,r){return this._client.post(`/vector_stores/${e}/file_batches/${t}/cancel`,{...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}async createAndPoll(e,t,r){let n=await this.create(e,t);return await this.poll(e,n.id,r)}listFiles(e,t,r={},n){return tj(r)?this.listFiles(e,t,{},r):this._client.getAPIList(`/vector_stores/${e}/file_batches/${t}/files`,nr,{query:r,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async poll(e,t,r){let n={...r?.headers,"X-Stainless-Poll-Helper":"true"};for(r?.pollIntervalMs&&(n["X-Stainless-Custom-Poll-Interval"]=r.pollIntervalMs.toString());;){let{data:o,response:i}=await this.retrieve(e,t,{...r,headers:n}).withResponse();switch(o.status){case"in_progress":let a=5e3;if(r?.pollIntervalMs)a=r.pollIntervalMs;else{let e=i.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(a=t)}}await tY(a);break;case"failed":case"cancelled":case"completed":return o}}}async uploadAndPoll(e,{files:t,fileIds:r=[]},n){if(null==t||0==t.length)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let o=Math.min(n?.maxConcurrency??5,t.length),i=this._client,a=t.values(),s=[...r];async function l(e){for(let t of e){let e=await i.files.create({file:t,purpose:"assistants"},n);s.push(e.id)}}let u=Array(o).fill(a).map(l);return await ne(u),await this.createAndPoll(e,{file_ids:s})}}class no extends t3{constructor(){super(...arguments),this.files=new nt(this._client),this.fileBatches=new nn(this._client)}create(e,t){return this._client.post("/vector_stores",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,r){return this._client.post(`/vector_stores/${e}`,{body:t,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/vector_stores",ni,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}}class ni extends t7{}no.VectorStoresPage=ni,no.Files=nt,no.VectorStoreFilesPage=nr,no.FileBatches=nn;class na extends t3{constructor(){super(...arguments),this.realtime=new rQ(this._client),this.vectorStores=new no(this._client),this.chat=new rJ(this._client),this.assistants=new rg(this._client),this.threads=new r7(this._client)}}na.Realtime=rQ,na.VectorStores=no,na.VectorStoresPage=ni,na.Assistants=rg,na.AssistantsPage=ry,na.Threads=r7;class ns extends t3{create(e,t){return this._client.post("/batches",{body:e,...t})}retrieve(e,t){return this._client.get(`/batches/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/batches",nl,{query:e,...t})}cancel(e,t){return this._client.post(`/batches/${e}/cancel`,t)}}class nl extends t7{}ns.BatchesPage=nl;class nu extends t3{create(e,t,r){return this._client.post(`/uploads/${e}/parts`,tv({body:t,...r}))}}class nc extends t3{constructor(){super(...arguments),this.parts=new nu(this._client)}create(e,t){return this._client.post("/uploads",{body:e,...t})}cancel(e,t){return this._client.post(`/uploads/${e}/cancel`,t)}complete(e,t,r){return this._client.post(`/uploads/${e}/complete`,{body:t,...r})}}nc.Parts=nu,r(33601);class nd extends tI{constructor({baseURL:e=tG("OPENAI_BASE_URL"),apiKey:t=tG("OPENAI_API_KEY"),organization:r=tG("OPENAI_ORG_ID")??null,project:n=tG("OPENAI_PROJECT_ID")??null,...o}={}){if(void 0===t)throw new Y("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).");let i={apiKey:t,organization:r,project:n,...o,baseURL:e||"https://api.openai.com/v1"};if(!i.dangerouslyAllowBrowser&&tQ())throw new Y("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n");super({baseURL:i.baseURL,timeout:i.timeout??6e5,httpAgent:i.httpAgent,maxRetries:i.maxRetries,fetch:i.fetch}),this.completions=new t9(this),this.chat=new t8(this),this.embeddings=new t6(this),this.files=new re(this),this.images=new rr(this),this.audio=new ra(this),this.moderations=new rs(this),this.models=new rl(this),this.fineTuning=new rm(this),this.beta=new na(this),this.batches=new ns(this),this.uploads=new nc(this),this._options=i,this.apiKey=t,this.organization=r,this.project=n}defaultQuery(){return this._options.defaultQuery}defaultHeaders(e){return{...super.defaultHeaders(e),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project,...this._options.defaultHeaders}}authHeaders(e){return{Authorization:`Bearer ${this.apiKey}`}}stringifyQuery(e){return R(e,{arrayFormat:"brackets"})}}e8=nd,nd.OpenAI=e8,nd.DEFAULT_TIMEOUT=6e5,nd.OpenAIError=Y,nd.APIError=H,nd.APIConnectionError=G,nd.APIConnectionTimeoutError=W,nd.APIUserAbortError=q,nd.NotFoundError=J,nd.ConflictError=X,nd.RateLimitError=ee,nd.BadRequestError=K,nd.AuthenticationError=V,nd.InternalServerError=et,nd.PermissionDeniedError=z,nd.UnprocessableEntityError=Q,nd.toFile=td,nd.fileFromPath=d,nd.Completions=t9,nd.Chat=t8,nd.Embeddings=t6,nd.Files=re,nd.FileObjectsPage=rt,nd.Images=rr,nd.Audio=ra,nd.Moderations=rs,nd.Models=rl,nd.ModelsPage=ru,nd.FineTuning=rm,nd.Beta=na,nd.Batches=ns,nd.BatchesPage=nl,nd.Uploads=nc;let nf=nd},52187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=i(r(79922)),o=r(21988);function i(e){return e&&e.__esModule?e:{default:e}}var a=/^[0-9]+$/;function s(e,t){return((0,n.default)(e),t&&t.no_symbols)?a.test(e):new RegExp("^[+-]?([0-9]*[".concat((t||{}).locale?o.decimal[t.locale]:".","])?[0-9]+$")).test(e)}e.exports=t.default,e.exports.default=t.default},53034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^[a-z]+\/[a-z0-9\-\+\._]+$/i,a=/^[a-z\-]+=[a-z0-9\-]+$/i,s=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;function l(e){(0,n.default)(e);var t=e.split(",");if(t.length<2)return!1;var r=t.shift().trim().split(";"),o=r.shift();if("data:"!==o.slice(0,5))return!1;var l=o.slice(5);if(""!==l&&!i.test(l))return!1;for(var u=0;u{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){(0,n.default)(e),"object"===i(t)?(r=t.min||0,o=t.max):(r=arguments[1],o=arguments[2]);var r,o,a=encodeURI(e).split(/%..|./).length-1;return a>=r&&(void 0===o||a<=o)}e.exports=t.default,e.exports.default=t.default},54534:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=c,t.locales=void 0;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^\d{3}$/,a=/^\d{4}$/,s=/^\d{5}$/,l=/^\d{6}$/,u={AD:/^AD\d{3}$/,AT:a,AU:a,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:a,BG:a,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:a,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:s,DK:a,DO:s,DZ:s,EE:s,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:s,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:a,ID:s,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:i,IT:s,JP:/^\d{3}\-\d{4}$/,KE:s,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:a,LV:/^LV\-\d{4}$/,LK:s,MG:i,MX:s,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:s,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:a,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:a,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:l,RU:l,SA:s,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:l,SI:a,SK:/^\d{3}\s?\d{2}$/,TH:s,TN:a,TW:/^\d{3}(\d{2})?$/,UA:s,US:/^\d{5}(-\d{4})?$/,ZA:a,ZM:s};function c(e,t){if((0,n.default)(e),t in u)return u[t].test(e);if("any"===t){for(var r in u)if(u.hasOwnProperty(r)&&u[r].test(e))return!0;return!1}throw Error("Invalid locale '".concat(t,"'"))}t.locales=Object.keys(u)},54634:(e,t,r)=>{"use strict";r.d(t,{F:()=>u});var n=r(57407),o=r(38483),i=r(6663),a=class{constructor(e,t,r){this.modelId=e,this.settings=t,this.config=r,this.specificationVersion="v1"}get provider(){return this.config.provider}get maxImagesPerCall(){var e;return null!=(e=this.settings.maxImagesPerCall)?e:1}async doGenerate({prompt:e,n:t,size:r,seed:n,providerOptions:i,headers:a,abortSignal:u}){var c,d,f,p;let h=[];null!=r&&h.push({type:"unsupported-setting",setting:"aspectRatio",details:"This model does not support the `aspectRatio` option. Use `size` instead."});let m=null!=(f=null==(d=null==(c=this.config._internal)?void 0:c.currentDate)?void 0:d.call(c))?f:new Date,g=null==r?void 0:r.split("x"),{value:y,responseHeaders:v}=await (0,o.GU)({url:`${this.config.baseURL}/images/generations`,headers:(0,o.m2)(this.config.headers(),a),body:{model:this.modelId,prompt:e,seed:n,n:t,...g&&{width:parseInt(g[0]),height:parseInt(g[1])},response_format:"base64",...null!=(p=i.togetherai)?p:{}},failedResponseHandler:(0,o.sl)({errorSchema:l,errorToMessage:e=>e.error.message}),successfulResponseHandler:(0,o.cV)(s),abortSignal:u,fetch:this.config.fetch});return{images:y.data.map(e=>e.b64_json),warnings:h,response:{timestamp:m,modelId:this.modelId,headers:v}}}},s=i.Ik({data:i.YO(i.Ik({b64_json:i.Yj()}))}),l=i.Ik({error:i.Ik({message:i.Yj()})});function u(e={}){var t;let r=(0,o.ae)(null!=(t=e.baseURL)?t:"https://api.together.xyz/v1/"),i=()=>({Authorization:`Bearer ${(0,o.WL)({apiKey:e.apiKey,environmentVariableName:"TOGETHER_AI_API_KEY",description:"TogetherAI"})}`,...e.headers}),s=t=>({provider:`togetherai.${t}`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),l=(e,t={})=>new n.Ey(e,t,{...s("chat"),defaultObjectGenerationMode:"tool"}),c=(e,t={})=>new n.fG(e,t,s("embedding")),d=(e,t={})=>new a(e,t,{...s("image"),baseURL:null!=r?r:"https://api.together.xyz/v1/"}),f=(e,t)=>l(e,t);return f.completionModel=(e,t={})=>new n.K9(e,t,s("completion")),f.languageModel=l,f.chatModel=l,f.textEmbeddingModel=c,f.image=d,f.imageModel=d,f}u()},54913:(e,t,r)=>{"use strict";var n=r(3140),o=r(83639),i=o([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o([r]):r}},55032:(e,t,r)=>{var n=r(33601);e.exports=r(77012).satisfies(n.version,"^6.12.0 || >=8.0.0")},55247:(e,t,r)=>{"use strict";r.d(t,{d:()=>n});let n=(e,t=21)=>(r=t)=>{let n="",o=0|r;for(;o--;)n+=e[Math.random()*e.length|0];return n}},55790:(e,t,r)=>{let n=r(95424),o=r(6746),i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},a={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let s=i[r];if(!s)throw Error(`Unknown key type "${r}".`);if(!s.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${s.join(", ")}.`);if(n)switch(r){case"ec":let l=t.asymmetricKeyDetails.namedCurve,u=a[e];if(l!==u)throw Error(`"alg" parameter "${e}" requires curve "${u}".`);break;case"rsa-pss":if(o){let r=parseInt(e.slice(-3),10),{hashAlgorithm:n,mgf1HashAlgorithm:o,saltLength:i}=t.asymmetricKeyDetails;if(n!==`sha${r}`||o!==n)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==i&&i>r>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}}},56121:(e,t,r)=>{e.exports=r(61847)()},56451:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^(0o)?[0-7]+$/i;function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},56887:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var n=s(r(29203)),o=s(r(79922)),i=s(r(57656)),a=r(21988);function s(e){return e&&e.__esModule?e:{default:e}}function l(e){return new RegExp("^[-+]?([0-9]+)?(\\".concat(a.decimal[e.locale],"[0-9]{").concat(e.decimal_digits,"})").concat(e.force_decimal?"":"?","$"))}var u={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},c=["","-","+"];function d(e,t){if((0,o.default)(e),(t=(0,n.default)(t,u)).locale in a.decimal)return!(0,i.default)(c,e.replace(/ /g,""))&&l(t).test(e);throw Error("Invalid locale '".concat(t.locale,"'"))}e.exports=t.default,e.exports.default=t.default},57300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var n=o(r(29203));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return l(e)||s(e,t)||c(e,t)||a()}function a(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}function l(e){if(Array.isArray(e))return e}function u(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function c(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{"use strict";e.exports=Function.prototype.apply},57407:(e,t,r)=>{"use strict";r.d(t,{Ey:()=>f,K9:()=>y,fG:()=>_});var n=r(14287),o=r(38483),i=r(6663);function a(e){var t,r;return null!=(r=null==(t=null==e?void 0:e.providerMetadata)?void 0:t.openaiCompatible)?r:{}}function s(e){let t=[];for(let{role:r,content:i,...s}of e){let e=a({...s});switch(r){case"system":t.push({role:"system",content:i,...e});break;case"user":if(1===i.length&&"text"===i[0].type){t.push({role:"user",content:i[0].text,...a(i[0])});break}t.push({role:"user",content:i.map(e=>{var t;let r=a(e);switch(e.type){case"text":return{type:"text",text:e.text,...r};case"image":return{type:"image_url",image_url:{url:e.image instanceof URL?e.image.toString():`data:${null!=(t=e.mimeType)?t:"image/jpeg"};base64,${(0,o.n_)(e.image)}`},...r};case"file":throw new n.b8({functionality:"File content parts in user messages"})}}),...e});break;case"assistant":{let r="",n=[];for(let e of i){let t=a(e);switch(e.type){case"text":r+=e.text;break;case"tool-call":n.push({id:e.toolCallId,type:"function",function:{name:e.toolName,arguments:JSON.stringify(e.args)},...t})}}t.push({role:"assistant",content:r,tool_calls:n.length>0?n:void 0,...e});break}case"tool":for(let e of i){let r=a(e);t.push({role:"tool",tool_call_id:e.toolCallId,content:JSON.stringify(e.result),...r})}break;default:{let e=r;throw Error(`Unsupported role: ${e}`)}}}return t}function l({id:e,model:t,created:r}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:null!=r?new Date(1e3*r):void 0}}function u(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var c={errorSchema:i.Ik({error:i.Ik({message:i.Yj(),type:i.Yj().nullish(),param:i.bz().nullish(),code:i.KC([i.Yj(),i.ai()]).nullish()})}),errorToMessage:e=>e.error.message};function d({mode:e,structuredOutputs:t}){var r;let o=(null==(r=e.tools)?void 0:r.length)?e.tools:void 0,i=[];if(null==o)return{tools:void 0,tool_choice:void 0,toolWarnings:i};let a=e.toolChoice,s=[];for(let e of o)"provider-defined"===e.type?i.push({type:"unsupported-tool",tool:e}):s.push({type:"function",function:{name:e.name,description:e.description,parameters:e.parameters}});if(null==a)return{tools:s,tool_choice:void 0,toolWarnings:i};let l=a.type;switch(l){case"auto":case"none":case"required":return{tools:s,tool_choice:l,toolWarnings:i};case"tool":return{tools:s,tool_choice:{type:"function",function:{name:a.toolName}},toolWarnings:i};default:{let e=l;throw new n.b8({functionality:`Unsupported tool choice type: ${e}`})}}}var f=class{constructor(e,t,r){var n,i;this.specificationVersion="v1",this.modelId=e,this.settings=t,this.config=r;let a=null!=(n=r.errorStructure)?n:c;this.chunkSchema=m(a.errorSchema),this.failedResponseHandler=(0,o.sl)(a),this.supportsStructuredOutputs=null!=(i=r.supportsStructuredOutputs)&&i}get defaultObjectGenerationMode(){return this.config.defaultObjectGenerationMode}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}getArgs({mode:e,prompt:t,maxTokens:r,temperature:n,topP:o,topK:i,frequencyPenalty:a,presencePenalty:l,providerMetadata:u,stopSequences:c,responseFormat:f,seed:p}){var h,m,g,y,v;let b=e.type,_=[];null!=i&&_.push({type:"unsupported-setting",setting:"topK"}),(null==f?void 0:f.type)!=="json"||null==f.schema||this.supportsStructuredOutputs||_.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let $={model:this.modelId,user:this.settings.user,max_tokens:r,temperature:n,top_p:o,frequency_penalty:a,presence_penalty:l,response_format:(null==f?void 0:f.type)==="json"?!0===this.supportsStructuredOutputs&&null!=f.schema?{type:"json_schema",json_schema:{schema:f.schema,name:null!=(h=f.name)?h:"response",description:f.description}}:{type:"json_object"}:void 0,stop:c,seed:p,...null==u?void 0:u[this.providerOptionsName],reasoning_effort:null!=(y=null==(m=null==u?void 0:u[this.providerOptionsName])?void 0:m.reasoningEffort)?y:null==(g=null==u?void 0:u["openai-compatible"])?void 0:g.reasoningEffort,messages:s(t)};switch(b){case"regular":{let{tools:t,tool_choice:r,toolWarnings:n}=d({mode:e,structuredOutputs:this.supportsStructuredOutputs});return{args:{...$,tools:t,tool_choice:r},warnings:[..._,...n]}}case"object-json":return{args:{...$,response_format:!0===this.supportsStructuredOutputs&&null!=e.schema?{type:"json_schema",json_schema:{schema:e.schema,name:null!=(v=e.name)?v:"response",description:e.description}}:{type:"json_object"}},warnings:_};case"object-tool":return{args:{...$,tool_choice:{type:"function",function:{name:e.tool.name}},tools:[{type:"function",function:{name:e.tool.name,description:e.tool.description,parameters:e.tool.parameters}}]},warnings:_};default:{let e=b;throw Error(`Unsupported type: ${e}`)}}}async doGenerate(e){var t,r,n,i,a,s,c,d,f,p,m;let{args:g,warnings:y}=this.getArgs({...e}),v=JSON.stringify(g),{responseHeaders:b,value:_,rawValue:$}=await (0,o.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,o.m2)(this.config.headers(),e.headers),body:g,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:(0,o.cV)(h),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:w,...S}=g,E=_.choices[0],x={[this.providerOptionsName]:{},...null==(r=null==(t=this.config.metadataExtractor)?void 0:t.extractMetadata)?void 0:r.call(t,{parsedBody:$})},A=null==(n=_.usage)?void 0:n.completion_tokens_details,O=null==(i=_.usage)?void 0:i.prompt_tokens_details;return(null==A?void 0:A.reasoning_tokens)!=null&&(x[this.providerOptionsName].reasoningTokens=null==A?void 0:A.reasoning_tokens),(null==A?void 0:A.accepted_prediction_tokens)!=null&&(x[this.providerOptionsName].acceptedPredictionTokens=null==A?void 0:A.accepted_prediction_tokens),(null==A?void 0:A.rejected_prediction_tokens)!=null&&(x[this.providerOptionsName].rejectedPredictionTokens=null==A?void 0:A.rejected_prediction_tokens),(null==O?void 0:O.cached_tokens)!=null&&(x[this.providerOptionsName].cachedPromptTokens=null==O?void 0:O.cached_tokens),{text:null!=(a=E.message.content)?a:void 0,reasoning:null!=(s=E.message.reasoning_content)?s:void 0,toolCalls:null==(c=E.message.tool_calls)?void 0:c.map(e=>{var t;return{toolCallType:"function",toolCallId:null!=(t=e.id)?t:(0,o.$C)(),toolName:e.function.name,args:e.function.arguments}}),finishReason:u(E.finish_reason),usage:{promptTokens:null!=(f=null==(d=_.usage)?void 0:d.prompt_tokens)?f:NaN,completionTokens:null!=(m=null==(p=_.usage)?void 0:p.completion_tokens)?m:NaN},providerMetadata:x,rawCall:{rawPrompt:w,rawSettings:S},rawResponse:{headers:b,body:$},response:l(_),warnings:y,request:{body:v}}}async doStream(e){var t;if(this.settings.simulateStreaming){let t=await this.doGenerate(e);return{stream:new ReadableStream({start(e){if(e.enqueue({type:"response-metadata",...t.response}),t.reasoning)if(Array.isArray(t.reasoning))for(let r of t.reasoning)"text"===r.type&&e.enqueue({type:"reasoning",textDelta:r.text});else e.enqueue({type:"reasoning",textDelta:t.reasoning});if(t.text&&e.enqueue({type:"text-delta",textDelta:t.text}),t.toolCalls)for(let r of t.toolCalls)e.enqueue({type:"tool-call",...r});e.enqueue({type:"finish",finishReason:t.finishReason,usage:t.usage,logprobs:t.logprobs,providerMetadata:t.providerMetadata}),e.close()}}),rawCall:t.rawCall,rawResponse:t.rawResponse,warnings:t.warnings}}let{args:r,warnings:i}=this.getArgs({...e}),a={...r,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},s=null==(t=this.config.metadataExtractor)?void 0:t.createStreamExtractor(),{responseHeaders:c,value:d}=await (0,o.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,o.m2)(this.config.headers(),e.headers),body:a,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:(0,o.Ds)(this.chunkSchema),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:f,...p}=r,h=[],m="unknown",g={completionTokens:void 0,completionTokensDetails:{reasoningTokens:void 0,acceptedPredictionTokens:void 0,rejectedPredictionTokens:void 0},promptTokens:void 0,promptTokensDetails:{cachedTokens:void 0}},y=!0,v=this.providerOptionsName;return{stream:d.pipeThrough(new TransformStream({transform(e,t){var r,i,a,c,d,f,p,v,b,_,$,w;if(!e.success){m="error",t.enqueue({type:"error",error:e.error});return}let S=e.value;if(null==s||s.processChunk(e.rawValue),"error"in S){m="error",t.enqueue({type:"error",error:S.error.message});return}if(y&&(y=!1,t.enqueue({type:"response-metadata",...l(S)})),null!=S.usage){let{prompt_tokens:e,completion_tokens:t,prompt_tokens_details:r,completion_tokens_details:n}=S.usage;g.promptTokens=null!=e?e:void 0,g.completionTokens=null!=t?t:void 0,(null==n?void 0:n.reasoning_tokens)!=null&&(g.completionTokensDetails.reasoningTokens=null==n?void 0:n.reasoning_tokens),(null==n?void 0:n.accepted_prediction_tokens)!=null&&(g.completionTokensDetails.acceptedPredictionTokens=null==n?void 0:n.accepted_prediction_tokens),(null==n?void 0:n.rejected_prediction_tokens)!=null&&(g.completionTokensDetails.rejectedPredictionTokens=null==n?void 0:n.rejected_prediction_tokens),(null==r?void 0:r.cached_tokens)!=null&&(g.promptTokensDetails.cachedTokens=null==r?void 0:r.cached_tokens)}let E=S.choices[0];if((null==E?void 0:E.finish_reason)!=null&&(m=u(E.finish_reason)),(null==E?void 0:E.delta)==null)return;let x=E.delta;if(null!=x.reasoning_content&&t.enqueue({type:"reasoning",textDelta:x.reasoning_content}),null!=x.content&&t.enqueue({type:"text-delta",textDelta:x.content}),null!=x.tool_calls)for(let e of x.tool_calls){let s=e.index;if(null==h[s]){if("function"!==e.type)throw new n.xn({data:e,message:"Expected 'function' type."});if(null==e.id)throw new n.xn({data:e,message:"Expected 'id' to be a string."});if((null==(r=e.function)?void 0:r.name)==null)throw new n.xn({data:e,message:"Expected 'function.name' to be a string."});h[s]={id:e.id,type:"function",function:{name:e.function.name,arguments:null!=(i=e.function.arguments)?i:""},hasFinished:!1};let l=h[s];(null==(a=l.function)?void 0:a.name)!=null&&(null==(c=l.function)?void 0:c.arguments)!=null&&(l.function.arguments.length>0&&t.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:l.id,toolName:l.function.name,argsTextDelta:l.function.arguments}),(0,o.v0)(l.function.arguments)&&(t.enqueue({type:"tool-call",toolCallType:"function",toolCallId:null!=(d=l.id)?d:(0,o.$C)(),toolName:l.function.name,args:l.function.arguments}),l.hasFinished=!0));continue}let l=h[s];!l.hasFinished&&((null==(f=e.function)?void 0:f.arguments)!=null&&(l.function.arguments+=null!=(v=null==(p=e.function)?void 0:p.arguments)?v:""),t.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:l.id,toolName:l.function.name,argsTextDelta:null!=(b=e.function.arguments)?b:""}),(null==(_=l.function)?void 0:_.name)!=null&&(null==($=l.function)?void 0:$.arguments)!=null&&(0,o.v0)(l.function.arguments)&&(t.enqueue({type:"tool-call",toolCallType:"function",toolCallId:null!=(w=l.id)?w:(0,o.$C)(),toolName:l.function.name,args:l.function.arguments}),l.hasFinished=!0))}},flush(e){var t,r;let n={[v]:{},...null==s?void 0:s.buildMetadata()};null!=g.completionTokensDetails.reasoningTokens&&(n[v].reasoningTokens=g.completionTokensDetails.reasoningTokens),null!=g.completionTokensDetails.acceptedPredictionTokens&&(n[v].acceptedPredictionTokens=g.completionTokensDetails.acceptedPredictionTokens),null!=g.completionTokensDetails.rejectedPredictionTokens&&(n[v].rejectedPredictionTokens=g.completionTokensDetails.rejectedPredictionTokens),null!=g.promptTokensDetails.cachedTokens&&(n[v].cachedPromptTokens=g.promptTokensDetails.cachedTokens),e.enqueue({type:"finish",finishReason:m,usage:{promptTokens:null!=(t=g.promptTokens)?t:NaN,completionTokens:null!=(r=g.completionTokens)?r:NaN},providerMetadata:n})}})),rawCall:{rawPrompt:f,rawSettings:p},rawResponse:{headers:c},warnings:i,request:{body:JSON.stringify(a)}}}},p=i.Ik({prompt_tokens:i.ai().nullish(),completion_tokens:i.ai().nullish(),prompt_tokens_details:i.Ik({cached_tokens:i.ai().nullish()}).nullish(),completion_tokens_details:i.Ik({reasoning_tokens:i.ai().nullish(),accepted_prediction_tokens:i.ai().nullish(),rejected_prediction_tokens:i.ai().nullish()}).nullish()}).nullish(),h=i.Ik({id:i.Yj().nullish(),created:i.ai().nullish(),model:i.Yj().nullish(),choices:i.YO(i.Ik({message:i.Ik({role:i.eu("assistant").nullish(),content:i.Yj().nullish(),reasoning_content:i.Yj().nullish(),tool_calls:i.YO(i.Ik({id:i.Yj().nullish(),type:i.eu("function"),function:i.Ik({name:i.Yj(),arguments:i.Yj()})})).nullish()}),finish_reason:i.Yj().nullish()})),usage:p}),m=e=>i.KC([i.Ik({id:i.Yj().nullish(),created:i.ai().nullish(),model:i.Yj().nullish(),choices:i.YO(i.Ik({delta:i.Ik({role:i.k5(["assistant"]).nullish(),content:i.Yj().nullish(),reasoning_content:i.Yj().nullish(),tool_calls:i.YO(i.Ik({index:i.ai().optional(),id:i.Yj().nullish(),type:i.eu("function").nullish(),function:i.Ik({name:i.Yj().nullish(),arguments:i.Yj().nullish()})})).nullish()}).nullish(),finish_reason:i.Yj().nullish()})),usage:p}),e]);function g({prompt:e,inputFormat:t,user:r="user",assistant:o="assistant"}){if("prompt"===t&&1===e.length&&"user"===e[0].role&&1===e[0].content.length&&"text"===e[0].content[0].type)return{prompt:e[0].content[0].text};let i="";for(let{role:t,content:a}of("system"===e[0].role&&(i+=`${e[0].content} `,e=e.slice(1)),e))switch(t){case"system":throw new n.M3({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":{let e=a.map(e=>{switch(e.type){case"text":return e.text;case"image":throw new n.b8({functionality:"images"})}}).join("");i+=`${r}: ${e} `;break}case"assistant":{let e=a.map(e=>{switch(e.type){case"text":return e.text;case"tool-call":throw new n.b8({functionality:"tool-call messages"})}}).join("");i+=`${o}: ${e} `;break}case"tool":throw new n.b8({functionality:"tool messages"});default:{let e=t;throw Error(`Unsupported role: ${e}`)}}return{prompt:i+=`${o}: `,stopSequences:[` ${r}:`]}}var y=class{constructor(e,t,r){var n;this.specificationVersion="v1",this.defaultObjectGenerationMode=void 0,this.modelId=e,this.settings=t,this.config=r;let i=null!=(n=r.errorStructure)?n:c;this.chunkSchema=b(i.errorSchema),this.failedResponseHandler=(0,o.sl)(i)}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}getArgs({mode:e,inputFormat:t,prompt:r,maxTokens:o,temperature:i,topP:a,topK:s,frequencyPenalty:l,presencePenalty:u,stopSequences:c,responseFormat:d,seed:f,providerMetadata:p}){var h;let m=e.type,y=[];null!=s&&y.push({type:"unsupported-setting",setting:"topK"}),null!=d&&"text"!==d.type&&y.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format is not supported."});let{prompt:v,stopSequences:b}=g({prompt:r,inputFormat:t}),_=[...null!=b?b:[],...null!=c?c:[]],$={model:this.modelId,echo:this.settings.echo,logit_bias:this.settings.logitBias,suffix:this.settings.suffix,user:this.settings.user,max_tokens:o,temperature:i,top_p:a,frequency_penalty:l,presence_penalty:u,seed:f,...null==p?void 0:p[this.providerOptionsName],prompt:v,stop:_.length>0?_:void 0};switch(m){case"regular":if(null==(h=e.tools)?void 0:h.length)throw new n.b8({functionality:"tools"});if(e.toolChoice)throw new n.b8({functionality:"toolChoice"});return{args:$,warnings:y};case"object-json":throw new n.b8({functionality:"object-json mode"});case"object-tool":throw new n.b8({functionality:"object-tool mode"});default:{let e=m;throw Error(`Unsupported type: ${e}`)}}}async doGenerate(e){var t,r,n,i;let{args:a,warnings:s}=this.getArgs(e),{responseHeaders:c,value:d,rawValue:f}=await (0,o.GU)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:(0,o.m2)(this.config.headers(),e.headers),body:a,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:(0,o.cV)(v),abortSignal:e.abortSignal,fetch:this.config.fetch}),{prompt:p,...h}=a,m=d.choices[0];return{text:m.text,usage:{promptTokens:null!=(r=null==(t=d.usage)?void 0:t.prompt_tokens)?r:NaN,completionTokens:null!=(i=null==(n=d.usage)?void 0:n.completion_tokens)?i:NaN},finishReason:u(m.finish_reason),rawCall:{rawPrompt:p,rawSettings:h},rawResponse:{headers:c,body:f},response:l(d),warnings:s,request:{body:JSON.stringify(a)}}}async doStream(e){let{args:t,warnings:r}=this.getArgs(e),n={...t,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:i,value:a}=await (0,o.GU)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:(0,o.m2)(this.config.headers(),e.headers),body:n,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:(0,o.Ds)(this.chunkSchema),abortSignal:e.abortSignal,fetch:this.config.fetch}),{prompt:s,...c}=t,d="unknown",f={promptTokens:NaN,completionTokens:NaN},p=!0;return{stream:a.pipeThrough(new TransformStream({transform(e,t){if(!e.success){d="error",t.enqueue({type:"error",error:e.error});return}let r=e.value;if("error"in r){d="error",t.enqueue({type:"error",error:r.error});return}p&&(p=!1,t.enqueue({type:"response-metadata",...l(r)})),null!=r.usage&&(f={promptTokens:r.usage.prompt_tokens,completionTokens:r.usage.completion_tokens});let n=r.choices[0];(null==n?void 0:n.finish_reason)!=null&&(d=u(n.finish_reason)),(null==n?void 0:n.text)!=null&&t.enqueue({type:"text-delta",textDelta:n.text})},flush(e){e.enqueue({type:"finish",finishReason:d,usage:f})}})),rawCall:{rawPrompt:s,rawSettings:c},rawResponse:{headers:i},warnings:r,request:{body:JSON.stringify(n)}}}},v=i.Ik({id:i.Yj().nullish(),created:i.ai().nullish(),model:i.Yj().nullish(),choices:i.YO(i.Ik({text:i.Yj(),finish_reason:i.Yj()})),usage:i.Ik({prompt_tokens:i.ai(),completion_tokens:i.ai()}).nullish()}),b=e=>i.KC([i.Ik({id:i.Yj().nullish(),created:i.ai().nullish(),model:i.Yj().nullish(),choices:i.YO(i.Ik({text:i.Yj(),finish_reason:i.Yj().nullish(),index:i.ai()})),usage:i.Ik({prompt_tokens:i.ai(),completion_tokens:i.ai()}).nullish()}),e]),_=class{constructor(e,t,r){this.specificationVersion="v1",this.modelId=e,this.settings=t,this.config=r}get provider(){return this.config.provider}get maxEmbeddingsPerCall(){var e;return null!=(e=this.config.maxEmbeddingsPerCall)?e:2048}get supportsParallelCalls(){var e;return null==(e=this.config.supportsParallelCalls)||e}async doEmbed({values:e,headers:t,abortSignal:r}){var i;if(e.length>this.maxEmbeddingsPerCall)throw new n.Ch({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});let{responseHeaders:a,value:s}=await (0,o.GU)({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:(0,o.m2)(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:this.settings.dimensions,user:this.settings.user},failedResponseHandler:(0,o.sl)(null!=(i=this.config.errorStructure)?i:c),successfulResponseHandler:(0,o.cV)($),abortSignal:r,fetch:this.config.fetch});return{embeddings:s.data.map(e=>e.embedding),usage:s.usage?{tokens:s.usage.prompt_tokens}:void 0,rawResponse:{headers:a}}}},$=i.Ik({data:i.YO(i.Ik({embedding:i.YO(i.ai())})),usage:i.Ik({prompt_tokens:i.ai()}).nullish()});i.Ik({data:i.YO(i.Ik({b64_json:i.Yj()}))})},57619:(e,t,r)=>{"use strict";let n=r(77721);e.exports=(e,t)=>new n(e,t).major},57652:(e,t,r)=>{"use strict";r.d(t,{u:()=>eo});var n,o,i="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof r.g?r.g:{},a="1.9.0",s=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,l=function(e){var t=new Set([e]),r=new Set,n=e.match(s);if(!n)return function(){return!1};var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=o.prerelease)return function(t){return t===e};function i(e){return r.add(e),!1}function a(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var n=e.match(s);if(!n)return i(e);var l={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};return null!=l.prerelease||o.major!==l.major?i(e):0===o.major?o.minor===l.minor&&o.patch<=l.patch?a(e):i(e):o.minor<=l.minor?a(e):i(e)}}(a),u=Symbol.for("opentelemetry.js.api."+a.split(".")[0]),c=i;function d(e,t,r,n){void 0===n&&(n=!1);var o,i=c[u]=null!=(o=c[u])?o:{version:a};if(!n&&i[e]){var s=Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(s.stack||s.message),!1}if(i.version!==a){var s=Error("@opentelemetry/api: Registration of version v"+i.version+" for "+e+" does not match previously registered API v"+a);return r.error(s.stack||s.message),!1}return i[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+a+"."),!0}function f(e){var t,r,n=null==(t=c[u])?void 0:t.version;if(n&&l(n))return null==(r=c[u])?void 0:r[e]}function p(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+a+".");var r=c[u];r&&delete r[e]}function h(e){return Symbol.for(e)}var m=new(function(){function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(e){return r._currentContext.get(e)},r.setValue=function(t,n){var o=new e(r._currentContext);return o._currentContext.set(t,n),o},r.deleteValue=function(t){var n=new e(r._currentContext);return n._currentContext.delete(t),n}}return e}()),g=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},y=function(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},_=function(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o=n?o.bind(t):function(){}}return en.ALL&&(e=n.ALL),t=t||{},{error:r("error",n.ERROR),warn:r("warn",n.WARN),info:r("info",n.INFO),debug:r("debug",n.DEBUG),verbose:r("verbose",n.VERBOSE)}}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(n||(n={}));var E=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},x=function(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o";l.warn("Current logger will be overwritten from "+c),u.warn("Current logger will overwrite one already registered from "+c)}return d("diag",u,t,!0)};t.setLogger=r,t.disable=function(){p(A,t)},t.createComponentLogger=function(e){return new $(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),k=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},I=function(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(e,t){return e.some(function(e){return t===e})},e.exports=t.default,e.exports.default=t.default},57693:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports={default:n.RFC3986,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986}},57759:(e,t,r)=>{var n=r(16076),o=function(e,t){n.call(this,e),this.name="NotBeforeError",this.date=t};o.prototype=Object.create(n.prototype),o.prototype.constructor=o,e.exports=o},58031:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return((0,n.default)(e),t)?"1"===e||/^true$/i.test(e):"0"!==e&&!/^false$/i.test(e)&&""!==e}e.exports=t.default,e.exports.default=t.default},58528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=u,t.locales=void 0;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i={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 a(e){return!(e.filter(function(e){return!(e in i)}).length>0)}function s(e,t){var r=e.replace(/[\s\-]+/gi,"").toUpperCase(),n=r.slice(0,2).toUpperCase(),o=n in i;return!(t.whitelist&&(!a(t.whitelist)||!t.whitelist.includes(n))||t.blacklist&&t.blacklist.includes(n))&&o&&i[n].test(r)}function l(e){var t=e.replace(/[^A-Z0-9]+/gi,"").toUpperCase();return 1===(t.slice(4)+t.slice(0,4)).replace(/[A-Z]/g,function(e){return e.charCodeAt(0)-55}).match(/\d{1,7}/g).reduce(function(e,t){return Number(e+t)%97},"")}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,n.default)(e),s(e,t)&&l(e)}t.locales=Object.keys(i)},58987:(e,t)=>{"use strict";function r(e,t){return new RegExp(e.join(""),t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default,e.exports.default=t.default},59102:(e,t,r)=>{var n=r(51642),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},59139:(e,t,r)=>{"use strict";var n=r(92572).Buffer,o=r(86610),i=128,a=48,s=2;function l(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(e){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function c(e,t,r){for(var n=0;t+n=i&&--n,n}e.exports={derToJose:function(e,t){e=u(e);var r=o(t),c=r+1,d=e.length,f=0;if(e[f++]!==a)throw Error('Could not find expected "seq"');var p=e[f++];if(p===(1|i)&&(p=e[f++]),d-f{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);function a(e){return(0,n.default)(e),i.has(e.toUpperCase())}e.exports=t.default,e.exports.default=t.default},59748:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(r(55729)),o=i(r(26882));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function l(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(e){function t(){a(this,t);for(var e,r,o,i=arguments.length,l=Array(i),u=0;u{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(r(79922)),o=i(r(29203));function i(e){return e&&e.__esModule?e:{default:e}}var a=/[^A-Z0-9+\/=]/i,s=/^[A-Z0-9_\-]*$/i,l={urlSafe:!1};function u(e,t){(0,n.default)(e),t=(0,o.default)(t,l);var r=e.length;if(t.urlSafe)return s.test(e);if(r%4!=0||a.test(e))return!1;var i=e.indexOf("=");return -1===i||i===r-1||i===r-2&&"="===e[r-1]}e.exports=t.default,e.exports.default=t.default},61429:(e,t,r)=>{"use strict";e.exports=r(17).getPrototypeOf||null},61686:(e,t,r)=>{"use strict";function n(e){if(void 0!==e.ZodType.prototype.openapi)return;e.ZodType.prototype.openapi=function(e){return new this.constructor({...this._def,openapi:e})};let t=e.ZodObject.prototype.extend;e.ZodObject.prototype.extend=function(...e){let r=t.apply(this,e);return r._def.extendMetadata={extends:this},delete r._def.openapi,r};let r=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...e){let t=r.apply(this,e);return delete t._def.extendMetadata,delete t._def.openapi,t};let n=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...e){let t=n.apply(this,e);return delete t._def.extendMetadata,delete t._def.openapi,t}}r.d(t,{I:()=>n})},61769:(e,t,r)=>{var n=r(51642),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},61847:(e,t,r)=>{"use strict";var n=r(4140);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},61924:e=>{"use strict";e.exports=EvalError},61956:(e,t,r)=>{"use strict";r.d(t,{d:()=>g});var n=r(14287),o=r(38483),i=r(6663);function a(e){let t=[];for(let{role:r,content:o}of e)switch(r){case"system":t.push({role:"system",content:o});break;case"user":case"assistant":t.push({role:r,content:o.filter(e=>"reasoning"!==e.type&&"redacted-reasoning"!==e.type).map(e=>{switch(e.type){case"text":return e.text;case"image":throw new n.b8({functionality:"Image content parts in user messages"});case"file":throw new n.b8({functionality:"File content parts in user messages"});case"tool-call":throw new n.b8({functionality:"Tool calls in assistant messages"});default:{let t=e;throw Error(`Unsupported part: ${t}`)}}}).join("")});break;case"tool":throw new n.b8({functionality:"Tool messages"});default:{let e=r;throw Error(`Unsupported role: ${e}`)}}return t}function s(e){switch(e){case"stop":case"length":return e;default:return"unknown"}}var l=class{constructor(e,t){this.specificationVersion="v1",this.defaultObjectGenerationMode="json",this.supportsStructuredOutputs=!0,this.supportsImageUrls=!1,this.provider="perplexity",this.modelId=e,this.config=t}getArgs({mode:e,prompt:t,maxTokens:r,temperature:o,topP:i,topK:s,frequencyPenalty:l,presencePenalty:u,stopSequences:c,responseFormat:d,seed:f,providerMetadata:p}){var h;let m=e.type,g=[];null!=s&&g.push({type:"unsupported-setting",setting:"topK"}),null!=c&&g.push({type:"unsupported-setting",setting:"stopSequences"}),null!=f&&g.push({type:"unsupported-setting",setting:"seed"});let y={model:this.modelId,frequency_penalty:l,max_tokens:r,presence_penalty:u,temperature:o,top_k:s,top_p:i,response_format:(null==d?void 0:d.type)==="json"?{type:"json_schema",json_schema:{schema:d.schema}}:void 0,...null!=(h=null==p?void 0:p.perplexity)?h:{},messages:a(t)};switch(m){case"regular":return{args:y,warnings:g};case"object-json":return{args:{...y,response_format:{type:"json_schema",json_schema:{schema:e.schema}}},warnings:g};case"object-tool":throw new n.b8({functionality:"tool-mode object generation"});default:{let e=m;throw Error(`Unsupported type: ${e}`)}}}async doGenerate(e){var t,r,n,i,a,l,c,d,p,g,y;let{args:v,warnings:b}=this.getArgs(e),{responseHeaders:_,value:$,rawValue:w}=await (0,o.GU)({url:`${this.config.baseURL}/chat/completions`,headers:(0,o.m2)(this.config.headers(),e.headers),body:v,failedResponseHandler:(0,o.sl)({errorSchema:h,errorToMessage:m}),successfulResponseHandler:(0,o.cV)(f),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:S,...E}=v,x=$.choices[0];return{text:x.message.content,toolCalls:[],finishReason:s(x.finish_reason),usage:{promptTokens:null!=(r=null==(t=$.usage)?void 0:t.prompt_tokens)?r:NaN,completionTokens:null!=(i=null==(n=$.usage)?void 0:n.completion_tokens)?i:NaN},rawCall:{rawPrompt:S,rawSettings:E},rawResponse:{headers:_,body:w},request:{body:JSON.stringify(v)},response:u($),warnings:b,sources:null==(a=$.citations)?void 0:a.map(e=>({sourceType:"url",id:this.config.generateId(),url:e})),providerMetadata:{perplexity:{images:null!=(c=null==(l=$.images)?void 0:l.map(e=>({imageUrl:e.image_url,originUrl:e.origin_url,height:e.height,width:e.width})))?c:null,usage:{citationTokens:null!=(p=null==(d=$.usage)?void 0:d.citation_tokens)?p:null,numSearchQueries:null!=(y=null==(g=$.usage)?void 0:g.num_search_queries)?y:null}}}}}async doStream(e){let{args:t,warnings:r}=this.getArgs(e),n={...t,stream:!0},{responseHeaders:i,value:a}=await (0,o.GU)({url:`${this.config.baseURL}/chat/completions`,headers:(0,o.m2)(this.config.headers(),e.headers),body:n,failedResponseHandler:(0,o.sl)({errorSchema:h,errorToMessage:m}),successfulResponseHandler:(0,o.Ds)(p),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:l,...c}=t,d="unknown",f={promptTokens:NaN,completionTokens:NaN},g={perplexity:{usage:{citationTokens:null,numSearchQueries:null},images:null}},y=!0,v=this;return{stream:a.pipeThrough(new TransformStream({transform(e,t){var r,n,o;if(!e.success)return void t.enqueue({type:"error",error:e.error});let i=e.value;y&&(t.enqueue({type:"response-metadata",...u(i)}),null==(r=i.citations)||r.forEach(e=>{t.enqueue({type:"source",source:{sourceType:"url",id:v.config.generateId(),url:e}})}),y=!1),null!=i.usage&&(f={promptTokens:i.usage.prompt_tokens,completionTokens:i.usage.completion_tokens},g.perplexity.usage={citationTokens:null!=(n=i.usage.citation_tokens)?n:null,numSearchQueries:null!=(o=i.usage.num_search_queries)?o:null}),null!=i.images&&(g.perplexity.images=i.images.map(e=>({imageUrl:e.image_url,originUrl:e.origin_url,height:e.height,width:e.width})));let a=i.choices[0];if((null==a?void 0:a.finish_reason)!=null&&(d=s(a.finish_reason)),(null==a?void 0:a.delta)==null)return;let l=a.delta.content;null!=l&&t.enqueue({type:"text-delta",textDelta:l})},flush(e){e.enqueue({type:"finish",finishReason:d,usage:f,providerMetadata:g})}})),rawCall:{rawPrompt:l,rawSettings:c},rawResponse:{headers:i},request:{body:JSON.stringify(n)},warnings:r}}};function u({id:e,model:t,created:r}){return{id:e,modelId:t,timestamp:new Date(1e3*r)}}var c=i.Ik({prompt_tokens:i.ai(),completion_tokens:i.ai(),citation_tokens:i.ai().nullish(),num_search_queries:i.ai().nullish()}),d=i.Ik({image_url:i.Yj(),origin_url:i.Yj(),height:i.ai(),width:i.ai()}),f=i.Ik({id:i.Yj(),created:i.ai(),model:i.Yj(),choices:i.YO(i.Ik({message:i.Ik({role:i.eu("assistant"),content:i.Yj()}),finish_reason:i.Yj().nullish()})),citations:i.YO(i.Yj()).nullish(),images:i.YO(d).nullish(),usage:c.nullish()}),p=i.Ik({id:i.Yj(),created:i.ai(),model:i.Yj(),choices:i.YO(i.Ik({delta:i.Ik({role:i.eu("assistant"),content:i.Yj()}),finish_reason:i.Yj().nullish()})),citations:i.YO(i.Yj()).nullish(),images:i.YO(d).nullish(),usage:c.nullish()}),h=i.Ik({error:i.Ik({code:i.ai(),message:i.Yj().nullish(),type:i.Yj().nullish()})}),m=e=>{var t,r;return null!=(r=null!=(t=e.error.message)?t:e.error.type)?r:"unknown error"};function g(e={}){let t=()=>({Authorization:`Bearer ${(0,o.WL)({apiKey:e.apiKey,environmentVariableName:"PERPLEXITY_API_KEY",description:"Perplexity"})}`,...e.headers}),r=r=>{var n;return new l(r,{baseURL:(0,o.ae)(null!=(n=e.baseURL)?n:"https://api.perplexity.ai"),headers:t,generateId:o.$C,fetch:e.fetch})},i=e=>r(e);return i.languageModel=r,i.textEmbeddingModel=e=>{throw new n.eM({modelId:e,modelType:"textEmbeddingModel"})},i}g()},63392:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^[A-HJ-NP-Za-km-z1-9]*$/;function a(e){return(0,n.default)(e),!!i.test(e)}e.exports=t.default,e.exports.default=t.default},63809:(e,t,r)=>{var n=r(89809);e.exports=function(e,t){t=t||{};var r=n.decode(e,t);if(!r)return null;var o=r.payload;if("string"==typeof o)try{var i=JSON.parse(o);null!==i&&"object"==typeof i&&(o=i)}catch(e){}return!0===t.complete?{header:r.header,payload:o,signature:r.signature}:o}},64331:(e,t,r)=>{"use strict";let n=r(26189);e.exports=(e,t,r)=>n(t,e,r)},64892:(e,t,r)=>{"use strict";r.d(t,{G:()=>a,WI:()=>i,eq:()=>o});var n=r(45859);let o=n.ZS.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),i=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;ne.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}a.create=e=>new a(e)},65382:(e,t,r)=>{let{sha3_512:n}=r(42270),o=24,i=32,a=(e=4,t=Math.random)=>{let r="";for(;r.lengths(n(e)).toString(36).slice(1),u=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),c=e=>u[Math.floor(e()*u.length)],d=({globalObj:e=void 0!==r.g?r.g:"undefined"!=typeof window?window:{},random:t=Math.random}={})=>{let n=Object.keys(e).toString();return l(n.length?n+a(i,t):a(i,t)).substring(0,i)},f=e=>()=>e++,p=0x1c6b1f1f,h=({random:e=Math.random,counter:t=f(Math.floor(e()*p)),length:r=o,fingerprint:n=d({random:e})}={})=>function(){let o=c(e),i=Date.now().toString(36),s=t().toString(36),u=a(r,e),d=`${i+u+s+n}`;return`${o+l(d).substring(1,r)}`},m=h(),g=(e,{minLength:t=2,maxLength:r=i}={})=>{let n=e.length,o=/^[0-9a-z]+$/;return!!("string"==typeof e&&n>=t&&n<=r&&o.test(e))};e.exports.getConstants=()=>({defaultLength:o,bigLength:i}),e.exports.init=h,e.exports.createId=m,e.exports.bufToBigInt=s,e.exports.createCounter=f,e.exports.createFingerprint=d,e.exports.isCuid=g},66931:e=>{"use strict";e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},66939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i={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 a(e,t){(0,n.default)(e);var r=e.replace(/\s/g,"").toUpperCase();return t.toUpperCase()in i&&i[t].test(r)}e.exports=t.default,e.exports.default=t.default},66957:(e,t,r)=>{"use strict";var n=r(3194),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},67247:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toBig=t.shrSL=t.shrSH=t.rotrSL=t.rotrSH=t.rotrBL=t.rotrBH=t.rotr32L=t.rotr32H=t.rotlSL=t.rotlSH=t.rotlBL=t.rotlBH=t.add5L=t.add5H=t.add4L=t.add4H=t.add3L=t.add3H=void 0,t.add=b,t.fromBig=o,t.split=i;let r=BigInt(0x100000000-1),n=BigInt(32);function o(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function i(e,t=!1){let r=e.length,n=new Uint32Array(r),a=new Uint32Array(r);for(let i=0;iBigInt(e>>>0)<>>0);t.toBig=a;let s=(e,t,r)=>e>>>r;t.shrSH=s;let l=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=l;let u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;let c=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=c;let d=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=d;let f=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=f;let p=(e,t)=>t;t.rotr32H=p;let h=(e,t)=>e;t.rotr32L=h;let m=(e,t,r)=>e<>>32-r;t.rotlSH=m;let g=(e,t,r)=>t<>>32-r;t.rotlSL=g;let y=(e,t,r)=>t<>>64-r;t.rotlBH=y;let v=(e,t,r)=>e<>>64-r;function b(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/0x100000000|0)|0,l:0|o}}t.rotlBL=v;let _=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=_;let $=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0;t.add3H=$;let w=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=w;let S=(e,t,r,n,o)=>t+r+n+o+(e/0x100000000|0)|0;t.add4H=S;let E=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0);t.add5L=E;let x=(e,t,r,n,o,i)=>t+r+n+o+i+(e/0x100000000|0)|0;t.add5H=x,t.default={fromBig:o,split:i,toBig:a,shrSH:s,shrSL:l,rotrSH:u,rotrSL:c,rotrBH:d,rotrBL:f,rotr32H:p,rotr32L:h,rotlSH:m,rotlSL:g,rotlBH:y,rotlBL:v,add:b,add3L:_,add3H:$,add4L:w,add4H:S,add5H:x,add5L:E}},67264:e=>{var t=1e3,r=6e4,n=36e5,o=864e5,i=6048e5,a=315576e5;function s(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var l=parseFloat(s[1]),u=(s[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return l*a;case"weeks":case"week":case"w":return l*i;case"days":case"day":case"d":return l*o;case"hours":case"hour":case"hrs":case"hr":case"h":return l*n;case"minutes":case"minute":case"mins":case"min":case"m":return l*r;case"seconds":case"second":case"secs":case"sec":case"s":return l*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}function l(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=n?Math.round(e/n)+"h":i>=r?Math.round(e/r)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}function u(e){var i=Math.abs(e);return i>=o?c(e,i,o,"day"):i>=n?c(e,i,n,"hour"):i>=r?c(e,i,r,"minute"):i>=t?c(e,i,t,"second"):e+" ms"}function c(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return s(e);if("number"===r&&isFinite(e))return t.long?u(e):l(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},67400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFreightContainerID=void 0,t.isISO6346=s;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/,a=/^[0-9]$/;function s(e){if((0,n.default)(e),e=e.toUpperCase(),!i.test(e))return!1;if(11===e.length){for(var t=0,r=0;r=11&&s<=20?12+s%11:s>=21&&s<=30?23+s%21:34+s%31)*Math.pow(2,r)}var l=t%11;return Number(e[e.length-1])===l}return!0}t.isFreightContainerID=s},67763:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return"static"!==getComputedStyle(e).position},n=function(e,t){for(var r=e.offsetTop,n=e.offsetParent;n&&!t(n);)r+=n.offsetTop,n=n.offsetParent;return{offsetTop:r,offsetParent:n}};t.default={updateHash:function(e,t){var r=0===e.indexOf("#")?e.substring(1):e,n=r?"#"+r:"",o=window&&window.location,i=n?o.pathname+o.search+n:o.pathname+o.search;t?history.pushState(history.state,"",i):history.replaceState(history.state,"",i)},getHash:function(){return window.location.hash.replace(/^#/,"")},filterElementInContainer:function(e){return function(t){return e.contains?e!=t&&e.contains(t):!!(16&e.compareDocumentPosition(t))}},scrollOffset:function(e,t,o){if(o)return e===document?t.getBoundingClientRect().left+(window.scrollX||window.pageXOffset):"static"!==getComputedStyle(e).position?t.offsetLeft:t.offsetLeft-e.offsetLeft;if(e===document)return t.getBoundingClientRect().top+(window.scrollY||window.pageYOffset);if(r(e)){if(t.offsetParent!==e){var i=n(t,function(t){return t===e||t===document}),a=i.offsetTop;if(i.offsetParent!==e)throw Error("Seems containerElement is not an ancestor of the Element");return a}return t.offsetTop}if(t.offsetParent===e.offsetParent)return t.offsetTop-e.offsetTop;var s=function(e){return e===document};return n(t,s).offsetTop-n(e,s).offsetTop}}},67953:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,a=/^([0-9a-fA-F]){12}$/,s=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/,l=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/,u=/^([0-9a-fA-F]){16}$/,c=/^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;function d(e,t){return((0,n.default)(e),null!=t&&t.eui&&(t.eui=String(t.eui)),null!=t&&t.no_colons||null!=t&&t.no_separators)?"48"===t.eui?a.test(e):"64"===t.eui?u.test(e):a.test(e)||u.test(e):(null==t?void 0:t.eui)==="48"?i.test(e)||s.test(e):(null==t?void 0:t.eui)==="64"?l.test(e)||c.test(e):d(e,{eui:"48"})||d(e,{eui:"64"})}e.exports=t.default,e.exports.default=t.default},68140:(e,t,r)=>{"use strict";r.d(t,{n:()=>k});var n=r(14287),o=r(38483),i=r(6663),a=i.Ik({type:i.eu("error"),error:i.Ik({type:i.Yj(),message:i.Yj()})}),s=(0,o.sl)({errorSchema:a,errorToMessage:e=>e.error.message});function l(e){var t;let r=(null==(t=e.tools)?void 0:t.length)?e.tools:void 0,o=[],i=new Set;if(null==r)return{tools:void 0,tool_choice:void 0,toolWarnings:o,betas:i};let a=[];for(let e of r)switch(e.type){case"function":a.push({name:e.name,description:e.description,input_schema:e.parameters});break;case"provider-defined":switch(e.id){case"anthropic.computer_20250124":i.add("computer-use-2025-01-24"),a.push({name:e.name,type:"computer_20250124",display_width_px:e.args.displayWidthPx,display_height_px:e.args.displayHeightPx,display_number:e.args.displayNumber});break;case"anthropic.computer_20241022":i.add("computer-use-2024-10-22"),a.push({name:e.name,type:"computer_20241022",display_width_px:e.args.displayWidthPx,display_height_px:e.args.displayHeightPx,display_number:e.args.displayNumber});break;case"anthropic.text_editor_20250124":i.add("computer-use-2025-01-24"),a.push({name:e.name,type:"text_editor_20250124"});break;case"anthropic.text_editor_20241022":i.add("computer-use-2024-10-22"),a.push({name:e.name,type:"text_editor_20241022"});break;case"anthropic.bash_20250124":i.add("computer-use-2025-01-24"),a.push({name:e.name,type:"bash_20250124"});break;case"anthropic.bash_20241022":i.add("computer-use-2024-10-22"),a.push({name:e.name,type:"bash_20241022"});break;default:o.push({type:"unsupported-tool",tool:e})}break;default:o.push({type:"unsupported-tool",tool:e})}let s=e.toolChoice;if(null==s)return{tools:a,tool_choice:void 0,toolWarnings:o,betas:i};let l=s.type;switch(l){case"auto":return{tools:a,tool_choice:{type:"auto"},toolWarnings:o,betas:i};case"required":return{tools:a,tool_choice:{type:"any"},toolWarnings:o,betas:i};case"none":return{tools:void 0,tool_choice:void 0,toolWarnings:o,betas:i};case"tool":return{tools:a,tool_choice:{type:"tool",name:s.toolName},toolWarnings:o,betas:i};default:{let e=l;throw new n.b8({functionality:`Unsupported tool choice type: ${e}`})}}}function u({prompt:e,sendReasoning:t,warnings:r}){var i,a,s,l;let u,d=new Set,f=c(e),p=[];function h(e){var t;let r=null==e?void 0:e.anthropic;return null!=(t=null==r?void 0:r.cacheControl)?t:null==r?void 0:r.cache_control}for(let e=0;e({type:"text",text:e,cache_control:h(t)}));break;case"user":{let e=[];for(let t of c.messages){let{role:r,content:l}=t;switch(r){case"user":for(let r=0;r{var t;switch(e.type){case"text":return{type:"text",text:e.text,cache_control:void 0};case"image":return{type:"image",source:{type:"base64",media_type:null!=(t=e.mimeType)?t:"image/jpeg",data:e.data},cache_control:void 0}}}):JSON.stringify(n.result);e.push({type:"tool_result",tool_use_id:n.toolCallId,content:a,is_error:n.isError,cache_control:i})}break;default:{let e=r;throw Error(`Unsupported role: ${e}`)}}}p.push({role:"user",content:e});break}case"assistant":{let e=[];for(let n=0;n0?{"anthropic-beta":Array.from(e).join(",")}:{},t)}buildRequestUrl(e){var t,r,n;return null!=(n=null==(r=(t=this.config).buildRequestUrl)?void 0:r.call(t,this.config.baseURL,e))?n:`${this.config.baseURL}/messages`}transformRequestBody(e){var t,r,n;return null!=(n=null==(r=(t=this.config).transformRequestBody)?void 0:r.call(t,e))?n:e}async doGenerate(e){var t,r,n,i;let a,{args:l,warnings:u,betas:c}=await this.getArgs(e),{responseHeaders:f,value:h,rawValue:m}=await (0,o.GU)({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:c,headers:e.headers}),body:this.transformRequestBody(l),failedResponseHandler:s,successfulResponseHandler:(0,o.cV)(p),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:g,...y}=l,v="";for(let e of h.content)"text"===e.type&&(v+=e.text);if(h.content.some(e=>"tool_use"===e.type))for(let e of(a=[],h.content))"tool_use"===e.type&&a.push({toolCallType:"function",toolCallId:e.id,toolName:e.name,args:JSON.stringify(e.input)});let b=h.content.filter(e=>"redacted_thinking"===e.type||"thinking"===e.type).map(e=>"thinking"===e.type?{type:"text",text:e.thinking,signature:e.signature}:{type:"redacted",data:e.data});return{text:v,reasoning:b.length>0?b:void 0,toolCalls:a,finishReason:d(h.stop_reason),usage:{promptTokens:h.usage.input_tokens,completionTokens:h.usage.output_tokens},rawCall:{rawPrompt:g,rawSettings:y},rawResponse:{headers:f,body:m},response:{id:null!=(t=h.id)?t:void 0,modelId:null!=(r=h.model)?r:void 0},warnings:u,providerMetadata:{anthropic:{cacheCreationInputTokens:null!=(n=h.usage.cache_creation_input_tokens)?n:null,cacheReadInputTokens:null!=(i=h.usage.cache_read_input_tokens)?i:null}},request:{body:JSON.stringify(l)}}}async doStream(e){let t,r,{args:n,warnings:i,betas:a}=await this.getArgs(e),l={...n,stream:!0},{responseHeaders:u,value:c}=await (0,o.GU)({url:this.buildRequestUrl(!0),headers:await this.getHeaders({betas:a,headers:e.headers}),body:this.transformRequestBody(l),failedResponseHandler:s,successfulResponseHandler:(0,o.Ds)(h),abortSignal:e.abortSignal,fetch:this.config.fetch}),{messages:f,...p}=n,m="unknown",g={promptTokens:NaN,completionTokens:NaN},y={};return{stream:c.pipeThrough(new TransformStream({transform(e,n){var o,i,a,s;if(!e.success)return void n.enqueue({type:"error",error:e.error});let l=e.value;switch(l.type){case"ping":return;case"content_block_start":{let e=l.content_block.type;switch(r=e,e){case"text":case"thinking":return;case"redacted_thinking":return void n.enqueue({type:"redacted-reasoning",data:l.content_block.data});case"tool_use":y[l.index]={toolCallId:l.content_block.id,toolName:l.content_block.name,jsonText:""};return;default:{let t=e;throw Error(`Unsupported content block type: ${t}`)}}}case"content_block_stop":if(null!=y[l.index]){let e=y[l.index];n.enqueue({type:"tool-call",toolCallType:"function",toolCallId:e.toolCallId,toolName:e.toolName,args:e.jsonText}),delete y[l.index]}r=void 0;return;case"content_block_delta":{let e=l.delta.type;switch(e){case"text_delta":return void n.enqueue({type:"text-delta",textDelta:l.delta.text});case"thinking_delta":return void n.enqueue({type:"reasoning",textDelta:l.delta.thinking});case"signature_delta":"thinking"===r&&n.enqueue({type:"reasoning-signature",signature:l.delta.signature});return;case"input_json_delta":{let e=y[l.index];n.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:e.toolCallId,toolName:e.toolName,argsTextDelta:l.delta.partial_json}),e.jsonText+=l.delta.partial_json;return}default:{let t=e;throw Error(`Unsupported delta type: ${t}`)}}}case"message_start":g.promptTokens=l.message.usage.input_tokens,g.completionTokens=l.message.usage.output_tokens,t={anthropic:{cacheCreationInputTokens:null!=(o=l.message.usage.cache_creation_input_tokens)?o:null,cacheReadInputTokens:null!=(i=l.message.usage.cache_read_input_tokens)?i:null}},n.enqueue({type:"response-metadata",id:null!=(a=l.message.id)?a:void 0,modelId:null!=(s=l.message.model)?s:void 0});return;case"message_delta":g.completionTokens=l.usage.output_tokens,m=d(l.delta.stop_reason);return;case"message_stop":return void n.enqueue({type:"finish",finishReason:m,usage:g,providerMetadata:t});case"error":return void n.enqueue({type:"error",error:l.error});default:{let e=l;throw Error(`Unsupported chunk type: ${e}`)}}}})),rawCall:{rawPrompt:f,rawSettings:p},rawResponse:{headers:u},warnings:i,request:{body:JSON.stringify(l)}}}},p=i.Ik({type:i.eu("message"),id:i.Yj().nullish(),model:i.Yj().nullish(),content:i.YO(i.gM("type",[i.Ik({type:i.eu("text"),text:i.Yj()}),i.Ik({type:i.eu("thinking"),thinking:i.Yj(),signature:i.Yj()}),i.Ik({type:i.eu("redacted_thinking"),data:i.Yj()}),i.Ik({type:i.eu("tool_use"),id:i.Yj(),name:i.Yj(),input:i.L5()})])),stop_reason:i.Yj().nullish(),usage:i.Ik({input_tokens:i.ai(),output_tokens:i.ai(),cache_creation_input_tokens:i.ai().nullish(),cache_read_input_tokens:i.ai().nullish()})}),h=i.gM("type",[i.Ik({type:i.eu("message_start"),message:i.Ik({id:i.Yj().nullish(),model:i.Yj().nullish(),usage:i.Ik({input_tokens:i.ai(),output_tokens:i.ai(),cache_creation_input_tokens:i.ai().nullish(),cache_read_input_tokens:i.ai().nullish()})})}),i.Ik({type:i.eu("content_block_start"),index:i.ai(),content_block:i.gM("type",[i.Ik({type:i.eu("text"),text:i.Yj()}),i.Ik({type:i.eu("thinking"),thinking:i.Yj()}),i.Ik({type:i.eu("tool_use"),id:i.Yj(),name:i.Yj()}),i.Ik({type:i.eu("redacted_thinking"),data:i.Yj()})])}),i.Ik({type:i.eu("content_block_delta"),index:i.ai(),delta:i.gM("type",[i.Ik({type:i.eu("input_json_delta"),partial_json:i.Yj()}),i.Ik({type:i.eu("text_delta"),text:i.Yj()}),i.Ik({type:i.eu("thinking_delta"),thinking:i.Yj()}),i.Ik({type:i.eu("signature_delta"),signature:i.Yj()})])}),i.Ik({type:i.eu("content_block_stop"),index:i.ai()}),i.Ik({type:i.eu("error"),error:i.Ik({type:i.Yj(),message:i.Yj()})}),i.Ik({type:i.eu("message_delta"),delta:i.Ik({stop_reason:i.Yj().nullish()}),usage:i.Ik({output_tokens:i.ai()})}),i.Ik({type:i.eu("message_stop")}),i.Ik({type:i.eu("ping")})]),m=i.Ik({thinking:i.Ik({type:i.KC([i.eu("enabled"),i.eu("disabled")]),budgetTokens:i.ai().optional()}).optional()}),g=i.Ik({command:i.Yj(),restart:i.zM().optional()});function y(e={}){return{type:"provider-defined",id:"anthropic.bash_20241022",args:{},parameters:g,execute:e.execute,experimental_toToolResultContent:e.experimental_toToolResultContent}}var v=i.Ik({command:i.Yj(),restart:i.zM().optional()});function b(e={}){return{type:"provider-defined",id:"anthropic.bash_20250124",args:{},parameters:v,execute:e.execute,experimental_toToolResultContent:e.experimental_toToolResultContent}}var _=i.Ik({command:i.k5(["view","create","str_replace","insert","undo_edit"]),path:i.Yj(),file_text:i.Yj().optional(),insert_line:i.ai().int().optional(),new_str:i.Yj().optional(),old_str:i.Yj().optional(),view_range:i.YO(i.ai().int()).optional()});function $(e={}){return{type:"provider-defined",id:"anthropic.text_editor_20241022",args:{},parameters:_,execute:e.execute,experimental_toToolResultContent:e.experimental_toToolResultContent}}var w=i.Ik({command:i.k5(["view","create","str_replace","insert","undo_edit"]),path:i.Yj(),file_text:i.Yj().optional(),insert_line:i.ai().int().optional(),new_str:i.Yj().optional(),old_str:i.Yj().optional(),view_range:i.YO(i.ai().int()).optional()});function S(e={}){return{type:"provider-defined",id:"anthropic.text_editor_20250124",args:{},parameters:w,execute:e.execute,experimental_toToolResultContent:e.experimental_toToolResultContent}}var E=i.Ik({action:i.k5(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","screenshot","cursor_position"]),coordinate:i.YO(i.ai().int()).optional(),text:i.Yj().optional()});function x(e){return{type:"provider-defined",id:"anthropic.computer_20241022",args:{displayWidthPx:e.displayWidthPx,displayHeightPx:e.displayHeightPx,displayNumber:e.displayNumber},parameters:E,execute:e.execute,experimental_toToolResultContent:e.experimental_toToolResultContent}}var A=i.Ik({action:i.k5(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot"]),coordinate:i.PV([i.ai().int(),i.ai().int()]).optional(),duration:i.ai().optional(),scroll_amount:i.ai().optional(),scroll_direction:i.k5(["up","down","left","right"]).optional(),start_coordinate:i.PV([i.ai().int(),i.ai().int()]).optional(),text:i.Yj().optional()}),O={bash_20241022:y,bash_20250124:b,textEditor_20241022:$,textEditor_20250124:S,computer_20241022:x,computer_20250124:function(e){return{type:"provider-defined",id:"anthropic.computer_20250124",args:{displayWidthPx:e.displayWidthPx,displayHeightPx:e.displayHeightPx,displayNumber:e.displayNumber},parameters:A,execute:e.execute,experimental_toToolResultContent:e.experimental_toToolResultContent}}};function k(e={}){var t;let r=null!=(t=(0,o.ae)(e.baseURL))?t:"https://api.anthropic.com/v1",i=()=>({"anthropic-version":"2023-06-01","x-api-key":(0,o.WL)({apiKey:e.apiKey,environmentVariableName:"ANTHROPIC_API_KEY",description:"Anthropic"}),...e.headers}),a=(t,n={})=>new f(t,n,{provider:"anthropic.messages",baseURL:r,headers:i,fetch:e.fetch,supportsImageUrls:!0}),s=function(e,t){if(new.target)throw Error("The Anthropic model function cannot be called with the new keyword.");return a(e,t)};return s.languageModel=a,s.chat=a,s.messages=a,s.textEmbeddingModel=e=>{throw new n.eM({modelId:e,modelType:"textEmbeddingModel"})},s.tools=O,s}k()},68750:(e,t,r)=>{var n=r(51642).Buffer;let o=r(16076),i=r(57759),a=r(75657),s=r(63809),l=r(10594),u=r(55790),c=r(55032),d=r(89809),{KeyObject:f,createSecretKey:p,createPublicKey:h}=r(62701),m=["RS256","RS384","RS512"],g=["ES256","ES384","ES512"],y=["RS256","RS384","RS512"],v=["HS256","HS384","HS512"];c&&(m.splice(m.length,0,"PS256","PS384","PS512"),y.splice(y.length,0,"PS256","PS384","PS512")),e.exports=function(e,t,r,c){let b,_,$;if("function"!=typeof r||c||(c=r,r={}),r||(r={}),r=Object.assign({},r),b=c||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return b(new o("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return b(new o("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return b(new o("allowInvalidAsymmetricKeyTypes must be a boolean"));let w=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return b(new o("jwt must be provided"));if("string"!=typeof e)return b(new o("jwt must be a string"));let S=e.split(".");if(3!==S.length)return b(new o("jwt malformed"));try{_=s(e,{complete:!0})}catch(e){return b(e)}if(!_)return b(new o("invalid token"));let E=_.header;if("function"==typeof t){if(!c)return b(new o("verify must be called asynchronous if secret or public key is provided as a callback"));$=t}else $=function(e,r){return r(null,t)};return $(E,function(t,s){let c;if(t)return b(new o("error in secret or public key callback: "+t.message));let $=""!==S[2].trim();if(!$&&s)return b(new o("jwt signature is required"));if($&&!s)return b(new o("secret or public key must be provided"));if(!$&&!r.algorithms)return b(new o('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=s&&!(s instanceof f))try{s=h(s)}catch(e){try{s=p("string"==typeof s?n.from(s):s)}catch(e){return b(new o("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===s.type?r.algorithms=v:["rsa","rsa-pss"].includes(s.asymmetricKeyType)?r.algorithms=y:"ec"===s.asymmetricKeyType?r.algorithms=g:r.algorithms=m),-1===r.algorithms.indexOf(_.header.alg))return b(new o("invalid algorithm"));if(E.alg.startsWith("HS")&&"secret"!==s.type)return b(new o(`secretOrPublicKey must be a symmetric key when using ${E.alg}`));if(/^(?:RS|PS|ES)/.test(E.alg)&&"public"!==s.type)return b(new o(`secretOrPublicKey must be an asymmetric key when using ${E.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{u(E.alg,s)}catch(e){return b(e)}try{c=d.verify(e,_.header.alg,s)}catch(e){return b(e)}if(!c)return b(new o("invalid signature"));let x=_.payload;if(void 0!==x.nbf&&!r.ignoreNotBefore){if("number"!=typeof x.nbf)return b(new o("invalid nbf value"));if(x.nbf>w+(r.clockTolerance||0))return b(new i("jwt not active",new Date(1e3*x.nbf)))}if(void 0!==x.exp&&!r.ignoreExpiration){if("number"!=typeof x.exp)return b(new o("invalid exp value"));if(w>=x.exp+(r.clockTolerance||0))return b(new a("jwt expired",new Date(1e3*x.exp)))}if(r.audience){let e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(x.aud)?x.aud:[x.aud]).some(function(t){return e.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return b(new o("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&x.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(x.iss)))return b(new o("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&x.sub!==r.subject)return b(new o("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&x.jti!==r.jwtid)return b(new o("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&x.nonce!==r.nonce)return b(new o("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof x.iat)return b(new o("iat required when maxAge is specified"));let e=l(r.maxAge,x.iat);if(void 0===e)return b(new o('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(w>=e+(r.clockTolerance||0))return b(new a("maxAge exceeded",new Date(1e3*e)))}return!0===r.complete?b(null,{header:E,payload:x,signature:_.signature}):b(null,x)})}},68907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},68960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return(0,n.default)(e),e===e.toUpperCase()}e.exports=t.default,e.exports.default=t.default},69497:e=>{"use strict";e.exports=SyntaxError},70491:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>k});var n=r(11335);class o extends Error{constructor(e){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=e}}let i=e=>null!==e&&"object"==typeof e,a=(...e)=>{for(let t of e)if((!i(t)||Array.isArray(t))&&void 0!==t)throw TypeError("The `options` argument must be an object");return l({},...e)},s=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers;for(let[e,o]of new globalThis.Headers(t).entries())n&&"undefined"===o||void 0===o?r.delete(e):r.set(e,o);return r},l=(...e)=>{let t={},r={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(i(n)){for(let[e,r]of Object.entries(n))i(r)&&e in t&&(r=l(t[e],r)),t={...t,[e]:r};i(n.headers)&&(r=s(r,n.headers),t.headers=r)}return t},u=(()=>{let e=!1,t=!1,r="function"==typeof globalThis.Request;return"function"==typeof globalThis.ReadableStream&&r&&(t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")),e&&!t})(),c="function"==typeof globalThis.AbortController,d="function"==typeof globalThis.ReadableStream,f="function"==typeof globalThis.FormData,p=["get","post","put","patch","head","delete"],h={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},m=0x7fffffff,g=Symbol("stop"),y={json:!0,parseJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},v={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},b=e=>p.includes(e)?e.toUpperCase():e,_=[413,429,503],$={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:_,maxRetryAfter:1/0,backoffLimit:1/0,delay:e=>.3*2**(e-1)*1e3},w=(e={})=>{if("number"==typeof e)return{...$,limit:e};if(e.methods&&!Array.isArray(e.methods))throw Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw Error("retry.statusCodes must be an array");return{...$,...e,afterStatusCodes:_}};async function S(e,t,r,n){return new Promise((i,a)=>{let s=setTimeout(()=>{r&&r.abort(),a(new o(e))},n.timeout);n.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(s)})})}async function E(e,{signal:t}){return new Promise((r,n)=>{function o(){clearTimeout(i),n(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));let i=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e)})}let x=(e,t)=>{let r={};for(let n in t)n in v||n in y||n in e||(r[n]=t[n]);return r};class A{static create(e,t){let r=new A(e,t),o=async()=>{if("number"==typeof r._options.timeout&&r._options.timeout>m)throw RangeError(`The \`timeout\` option cannot be greater than ${m}`);await Promise.resolve();let e=await r._fetch();for(let t of r._options.hooks.afterResponse){let n=await t(r.request,r._options,r._decorateResponse(e.clone()));n instanceof globalThis.Response&&(e=n)}if(r._decorateResponse(e),!e.ok&&r._options.throwHttpErrors){let t=new n.H(e,r.request,r._options);for(let e of r._options.hooks.beforeError)t=await e(t);throw t}if(r._options.onDownloadProgress){if("function"!=typeof r._options.onDownloadProgress)throw TypeError("The `onDownloadProgress` option must be a function");if(!d)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");return r._stream(e.clone(),r._options.onDownloadProgress)}return e},i=r._options.retry.methods.includes(r.request.method.toLowerCase())?r._retry(o):o();for(let[e,n]of Object.entries(h))i[e]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||n);let o=(await i).clone();if("json"===e){if(204===o.status||0===(await o.clone().arrayBuffer()).byteLength)return"";if(t.parseJson)return t.parseJson(await o.text())}return o[e]()};return i}constructor(e,t={}){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=e;let r=this._input instanceof Request&&"credentials"in Request.prototype?this._input.credentials:void 0;if(this._options={...r&&{credentials:r},...t,headers:s(this._input.headers,t.headers),hooks:l({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},t.hooks),method:b(t.method??this._input.method),prefixUrl:String(t.prefixUrl||""),retry:w(t.retry),throwHttpErrors:!1!==t.throwHttpErrors,timeout:t.timeout??1e4,fetch:t.fetch??globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(c){if(this.abortController=new globalThis.AbortController,this._options.signal){let e=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(e.reason)})}this._options.signal=this.abortController.signal}if(u&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let e="?"+("string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),t=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,e);(f&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(t,{...this.request}),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(e instanceof o)){if(e instanceof n.H){if(!this._options.retry.statusCodes.includes(e.response.status))return 0;let t=e.response.headers.get("Retry-After");if(t&&this._options.retry.afterStatusCodes.includes(e.response.status)){let e=Number(t);return(Number.isNaN(e)?e=Date.parse(t)-Date.now():e*=1e3,void 0!==this._options.retry.maxRetryAfter&&e>this._options.retry.maxRetryAfter)?0:e}if(413===e.response.status)return 0}let t=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,t)}return 0}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let t=Math.min(this._calculateRetryDelay(r),m);if(0!==t&&this._retryCount>0){for(let e of(await E(t,{signal:this._options.signal}),this._options.hooks.beforeRetry))if(await e({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===g)return;return this._retry(e)}throw r}}async _fetch(){for(let e of this._options.hooks.beforeRequest){let t=await e(this.request,this._options);if(t instanceof Request){this.request=t;break}if(t instanceof Response)return t}let e=x(this.request,this._options);return!1===this._options.timeout?this._options.fetch(this.request.clone(),e):S(this.request.clone(),e,this.abortController,this._options)}_stream(e,t){let r=Number(e.headers.get("content-length"))||0,n=0;return 204===e.status?(t&&t({percent:1,totalBytes:r,transferredBytes:n},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let i=e.body.getReader();async function a(){let{done:e,value:s}=await i.read();if(e)return void o.close();t&&(n+=s.byteLength,t({percent:0===r?0:n/r,transferredBytes:n,totalBytes:r},s)),o.enqueue(s),await a()}t&&t({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array),await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}}let O=e=>{let t=(t,r)=>A.create(t,a(e,r));for(let r of p)t[r]=(t,n)=>A.create(t,a(e,n,{method:r}));return t.create=e=>O(a(e)),t.extend=t=>O(a(e,t)),t.stop=g,t},k=O()},70892:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^[0-9]{15}$/,a=/^\d{2}-\d{6}-\d{6}-\d{1}$/;function s(e,t){(0,n.default)(e);var r=i;if((t=t||{}).allow_hyphens&&(r=a),!r.test(e))return!1;e=e.replace(/-/g,"");for(var o=0,s=2,l=14,u=0;u=10?o+=c%10+1:o+=c,1===s?s+=1:s-=1}return(10-o%10)%10===parseInt(e.substring(14,15),10)}e.exports=t.default,e.exports.default=t.default},71137:(e,t,r)=>{"use strict";let n=r(5074);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},71384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},71648:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i,a=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,s=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;function l(e){return(0,n.default)(e),i.test(e)||a.test(e)||s.test(e)}e.exports=t.default,e.exports.default=t.default},72107:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^(0x)[0-9a-f]{40}$/i;function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},72206:e=>{"use strict";e.exports=TypeError},72274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=o,t.anumber=i,t.abytes=a,t.ahash=s,t.aexists=l,t.aoutput=u,t.u8=c,t.u32=d,t.clean=f,t.createView=p,t.rotr=h,t.rotl=m,t.byteSwap=g,t.byteSwap32=y,t.bytesToHex=_,t.hexToBytes=S,t.asyncLoop=E,t.utf8ToBytes=x,t.bytesToUtf8=A,t.toBytes=O,t.kdfInputToBytes=k,t.concatBytes=I,t.checkOpts=C,t.createHasher=P,t.createOptHasher=R,t.createXOFer=j,t.randomBytes=N;let n=r(13536);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function a(e,...t){if(!o(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");i(e.outputLen),i(e.blockLen)}function l(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function u(e,t){a(e);let r=t.outputLen;if(e.length>>t}function m(e,t){return e<>>32-t>>>0}function g(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}function y(e){for(let t=0;te:e=>g(e),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?e=>e:y;let v="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,b=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function _(e){if(a(e),v)return e.toHex();let t="";for(let r=0;r=$._0&&e<=$._9?e-$._0:e>=$.A&&e<=$.F?e-($.A-10):e>=$.a&&e<=$.f?e-($.a-10):void 0}function S(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(v)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,o=0;t=0&&e{};class T{}function P(e){let t=t=>e().update(O(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function R(e){let t=(t,r)=>e(r).update(O(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function j(e){let t=(t,r)=>e(r).update(O(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function N(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return Uint8Array.from(n.crypto.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}t.Hash=T,t.wrapConstructor=P,t.wrapConstructorWithOpts=R,t.wrapXOFConstructorWithOpts=j},72562:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(47684);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},72643:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={registered:{},scrollEvent:{register:function(e,t){r.registered[e]=t},remove:function(e){r.registered[e]=null}}};t.default=r},72925:(e,t,r)=>{"use strict";let n=r(26189);e.exports=(e,t,r)=>0>=n(e,t,r)},73169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i="^\\d{4}-?\\d{3}[\\dX]$";function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.default)(e);var r=i;if(r=t.require_hyphen?r.replace("?",""):r,!(r=t.case_sensitive?new RegExp(r):RegExp(r,"i")).test(e))return!1;for(var o=e.replace("-","").toUpperCase(),a=0,s=0;s{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CountryCodes=void 0,t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]);function a(e){return(0,n.default)(e),i.has(e.toUpperCase())}t.CountryCodes=i},73313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=o(r(29203));function o(e){return e&&e.__esModule?e:{default:e}}var i={hourFormat:"hour24",mode:"default"},a={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/}};function s(e,t){return t=(0,n.default)(t,i),"string"==typeof e&&a[t.hourFormat][t.mode].test(e)}e.exports=t.default,e.exports.default=t.default},73909:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return(0,n.default)(e),isNaN(e=Date.parse(e))?null:new Date(e)}e.exports=t.default,e.exports.default=t.default},74002:e=>{"use strict";e.exports=Error},74499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=i(r(79922)),o=i(r(29203));function i(e){return e&&e.__esModule?e:{default:e}}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function s(e,t){(0,n.default)(e),(t=(0,o.default)(t,a)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1)),!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var r=e.split("."),i=r[r.length-1];return!(t.require_tld&&(r.length<2||!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(i)||/\s/.test(i)))&&!(!t.allow_numeric_tld&&/^\d+$/.test(i))&&r.every(function(e){return!(e.length>63&&!t.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)||/[\uff01-\uff5e]/.test(e)||/^-|-$/.test(e)||!t.allow_underscores&&/_/.test(e))})}e.exports=t.default,e.exports.default=t.default},74818:(e,t,r)=>{"use strict";var n=r(76536),o=r(3194),i=r(83639),a=r(26572);e.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},o?o(e.exports,"apply",{value:a}):e.exports.apply=a},75657:(e,t,r)=>{var n=r(16076),o=function(e,t){n.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};o.prototype=Object.create(n.prototype),o.prototype.constructor=o,e.exports=o},75705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^(bc1)[a-z0-9]{25,39}$/,a=/^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;function s(e){return(0,n.default)(e),i.test(e)||a.test(e)}e.exports=t.default,e.exports.default=t.default},75739:e=>{"use strict";e.exports=Math.min},75878:(e,t,r)=>{"use strict";let n=r(38278);e.exports=(e,t,r)=>n(e,t,">",r)},76536:(e,t,r)=>{"use strict";var n=r(3140),o=r(28160),i=r(66957)(),a=r(27654),s=r(72206),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>0xffffffff||l(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in e&&a){var c=a(e,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(u=!1)}return(n||u||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},77012:(e,t,r)=>{"use strict";let n=r(8887),o=r(66931),i=r(77721),a=r(96790),s=r(26829),l=r(23136),u=r(29911),c=r(32138),d=r(82965),f=r(57619),p=r(96751),h=r(50892),m=r(49512),g=r(26189),y=r(64331),v=r(41670),b=r(2316),_=r(95586),$=r(38164),w=r(44689),S=r(91526),E=r(92648),x=r(84426),A=r(50736),O=r(72925),k=r(94762),I=r(49059),C=r(50141),T=r(5074),P=r(8759),R=r(86298),j=r(81601),N=r(86159),M=r(44396),L=r(79243),D=r(38278),B=r(75878),F=r(37599),U=r(71137);e.exports={parse:s,valid:l,clean:u,inc:c,diff:d,major:f,minor:p,patch:h,prerelease:m,compare:g,rcompare:y,compareLoose:v,compareBuild:b,sort:_,rsort:$,gt:w,lt:S,eq:E,neq:x,gte:A,lte:O,cmp:k,coerce:I,Comparator:C,Range:T,satisfies:P,toComparators:R,maxSatisfying:j,minSatisfying:N,minVersion:M,validRange:L,outside:D,gtr:B,ltr:F,intersects:U,simplifyRange:r(78540),subset:r(13941),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:o.SEMVER_SPEC_VERSION,RELEASE_TYPES:o.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},77201:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4264);t.ResizeObservation=function(){function e(e){this.target=e,this.$$broadcastWidth=this.$$broadcastHeight=0}return Object.defineProperty(e.prototype,"broadcastWidth",{get:function(){return this.$$broadcastWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"broadcastHeight",{get:function(){return this.$$broadcastHeight},enumerable:!0,configurable:!0}),e.prototype.isActive=function(){var e=n.ContentRect(this.target);return!!e&&(e.width!==this.broadcastWidth||e.height!==this.broadcastHeight)},e}()},77543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CurrencyCodes=void 0,t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"]);function a(e){return(0,n.default)(e),i.has(e.toUpperCase())}t.CurrencyCodes=i},77721:(e,t,r)=>{"use strict";let n=r(77909),{MAX_LENGTH:o,MAX_SAFE_INTEGER:i}=r(66931),{safeRe:a,t:s}=r(8887),l=r(49694),{compareIdentifiers:u}=r(96790);class c{constructor(e,t){if(t=l(t),e instanceof c)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else e=e.version;else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>o)throw TypeError(`version is longer than ${o} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?a[s.LOOSE]:a[s.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},77827:e=>{"use strict";class t{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}e.exports=t},77909:(e,t,r)=>{"use strict";var n=r(33601);e.exports="object"==typeof n&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},78540:(e,t,r)=>{"use strict";let n=r(8759),o=r(26189);e.exports=(e,t,r)=>{let i=[],a=null,s=null,l=e.sort((e,t)=>o(e,t,r));for(let e of l)n(e,t,r)?(s=e,a||(a=e)):(s&&i.push([a,s]),s=null,a=null);a&&i.push([a,null]);let u=[];for(let[e,t]of i)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");let c=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return c.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^[\x00-\x7F]+$/;function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},78619:(e,t,r)=>{var n="Expected a function",o=0/0,i="[object Symbol]",a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt,d="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,f="object"==typeof self&&self&&self.Object===Object&&self,p=d||f||Function("return this")(),h=Object.prototype.toString,m=Math.max,g=Math.min,y=function(){return p.Date.now()};function v(e,t,r){var o,i,a,s,l,u,c=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw TypeError(n);function h(t){var r=o,n=i;return o=i=void 0,c=t,s=e.apply(n,r)}function v(e){return c=e,l=setTimeout(S,t),d?h(e):s}function _(e){var r=e-u,n=e-c,o=t-r;return f?g(o,a-n):o}function $(e){var r=e-u,n=e-c;return void 0===u||r>=t||r<0||f&&n>=a}function S(){var e=y();if($(e))return E(e);l=setTimeout(S,_(e))}function E(e){return(l=void 0,p&&o)?h(e):(o=i=void 0,s)}function x(){return void 0===l?s:E(y())}function A(){var e=y(),r=$(e);if(o=arguments,i=this,u=e,r){if(void 0===l)return v(u);if(f)return l=setTimeout(S,t),h(u)}return void 0===l&&(l=setTimeout(S,t)),s}return t=w(t)||0,b(r)&&(d=!!r.leading,a=(f="maxWait"in r)?m(w(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),A.cancel=function(){void 0!==l&&clearTimeout(l),c=0,o=u=i=l=void 0},A.flush=x,A}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _(e){return!!e&&"object"==typeof e}function $(e){return"symbol"==typeof e||_(e)&&h.call(e)==i}function w(e){if("number"==typeof e)return e;if($(e))return o;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var r=l.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):s.test(e)?o:+e}e.exports=function(e,t,r){var o=!0,i=!0;if("function"!=typeof e)throw TypeError(n);return b(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),v(e,t,{leading:o,maxWait:t,trailing:i})}},78647:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=i(r(79922)),o=i(r(83120));function i(e){return e&&e.__esModule?e:{default:e}}var a={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})?$/},s=function(){var e=[];for(var t in a)a.hasOwnProperty(t)&&e.push(a[t]);return e}();function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.default)(e);var r=t.provider,i=e.replace(/[- ]+/g,"");if(r&&r.toLowerCase()in a){if(!a[r.toLowerCase()].test(i))return!1}else if(!r||r.toLowerCase()in a){if(!s.some(function(e){return e.test(i)}))return!1}else throw Error("".concat(r," is not a valid credit card provider."));return(0,o.default)(e)}e.exports=t.default,e.exports.default=t.default},78805:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t=o.duration?1:t(o.progress/o.duration),o.currentPosition=o.startPosition+Math.ceil(o.delta*o.percent),o.containerElement&&o.containerElement!==document&&o.containerElement!==document.body?r.horizontal?o.containerElement.scrollLeft=o.currentPosition:o.containerElement.scrollTop=o.currentPosition:r.horizontal?window.scrollTo(o.currentPosition,0):window.scrollTo(0,o.currentPosition),o.percent<1){var i=e.bind(null,t,r);d.call(window,i);return}a.default.registered.end&&a.default.registered.end(o.to,o.target,o.currentPosition)},v=function(e){e.data.containerElement=e?e.containerId?document.getElementById(e.containerId):e.container&&e.container.nodeType?e.container:document:null},b=function(e,t,r,n){if(t.data=t.data||f(),window.clearTimeout(t.data.delayTimeout),i.default.subscribe(function(){t.data.cancel=!0}),v(t),t.data.start=null,t.data.cancel=!1,t.data.startPosition=t.horizontal?p(t):h(t),t.data.targetPosition=t.absolute?e:e+t.data.startPosition,t.data.startPosition===t.data.targetPosition){a.default.registered.end&&a.default.registered.end(t.data.to,t.data.target,t.data.currentPosition);return}t.data.delta=Math.round(t.data.targetPosition-t.data.startPosition),t.data.duration=u(t.duration)(t.data.delta),t.data.duration=isNaN(parseFloat(t.data.duration))?1e3:parseFloat(t.data.duration),t.data.to=r,t.data.target=n;var o=l(t),s=y.bind(null,o,t);if(t&&t.delay>0){t.data.delayTimeout=window.setTimeout(function(){a.default.registered.begin&&a.default.registered.begin(t.data.to,t.data.target),d.call(window,s)},t.delay);return}a.default.registered.begin&&a.default.registered.begin(t.data.to,t.data.target),d.call(window,s)},_=function(e){return(e=n({},e)).data=e.data||f(),e.absolute=!0,e},$=function(e){b(0,_(e))},w=function(e,t){b(e,_(t))},S=function(e){v(e=_(e)),b(e.horizontal?m(e):g(e),e)},E=function(e,t){v(t=_(t)),b(e+(t.horizontal?p(t):h(t)),t)};t.default={animateTopScroll:b,getAnimationType:l,scrollToTop:$,scrollToBottom:S,scrollTo:w,scrollMore:E}},78895:function(e,t,r){!function(e,n){n(t,r(55729))}(0,function(e,t){"use strict";function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function n(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r provider."));return e},C=t.createContext(null);C.displayName="CartElementContext";var T=function(e,t){if(!e)throw Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an provider."));return e},P=function(e){var r=e.stripe,n=e.options,o=e.children,i=t.useMemo(function(){return O(r)},[r]),s=a(t.useState(null),2),l=s[0],u=s[1],c=a(t.useState(null),2),d=c[0],f=c[1],p=a(t.useState(function(){return{stripe:"sync"===i.tag?i.stripe:null,elements:"sync"===i.tag?i.stripe.elements(n):null}}),2),h=p[0],m=p[1];t.useEffect(function(){var e=!0,t=function(e){m(function(t){return t.stripe?t:{stripe:e,elements:e.elements(n)}})};return"async"!==i.tag||h.stripe?"sync"!==i.tag||h.stripe||t(i.stripe):i.stripePromise.then(function(r){r&&e&&t(r)}),function(){e=!1}},[i,h,n]);var g=v(r);t.useEffect(function(){null!==g&&g!==r&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[g,r]);var y=v(n);return t.useEffect(function(){if(h.elements){var e=E(n,y,["clientSecret","fonts"]);e&&h.elements.update(e)}},[n,y,h.elements]),t.useEffect(function(){var e=h.stripe;e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"1.16.4"}),e.registerAppInfo({name:"react-stripe-js",version:"1.16.4",url:"https://stripe.com/docs/stripe-js/react"}))},[h.stripe]),t.createElement(k.Provider,{value:h},t.createElement(C.Provider,{value:{cart:l,setCart:u,cartState:d,setCartState:f}},o))};P.propTypes={stripe:y.any,options:y.object};var R=function(e){return I(t.useContext(k),e)},j=function(e){return T(t.useContext(C),e)},N=function(){return R("calls useElements()").elements},M=function(){return R("calls useStripe()").stripe},L=function(){return j("calls useCartElement()").cart},D=function(){return j("calls useCartElementState()").cartState},B=function(e){return(0,e.children)(R("mounts "))};B.propTypes={children:y.func.isRequired};var F=function(e,r,n){var o=!!n,i=t.useRef(n);t.useEffect(function(){i.current=n},[n]),t.useEffect(function(){if(!o||!e)return function(){};var t=function(){i.current&&i.current.apply(i,arguments)};return e.on(r,t),function(){e.off(r,t)}},[o,r,e,i])},U=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Z=function(e,r){var n="".concat(U(e),"Element"),o=function(r){var o,i=r.id,s=r.className,l=r.options,u=void 0===l?{}:l,c=r.onBlur,d=r.onFocus,f=r.onReady,p=r.onChange,h=r.onEscape,m=r.onClick,g=r.onLoadError,y=r.onLoaderStart,b=r.onNetworksChange,_=r.onCheckout,$=r.onLineItemClick,w=r.onConfirm,S=r.onCancel,x=r.onShippingAddressChange,A=r.onShippingRateChange,O=R("mounts <".concat(n,">")).elements,k=a(t.useState(null),2),I=k[0],C=k[1],T=t.useRef(null),P=t.useRef(null),N=j("mounts <".concat(n,">")),M=N.setCart,L=N.setCartState;F(I,"blur",c),F(I,"focus",d),F(I,"escape",h),F(I,"click",m),F(I,"loaderror",g),F(I,"loaderstart",y),F(I,"networkschange",b),F(I,"lineitemclick",$),F(I,"confirm",w),F(I,"cancel",S),F(I,"shippingaddresschange",x),F(I,"shippingratechange",A),"cart"===e?o=function(e){L(e),f&&f(e)}:f&&(o="payButton"===e?f:function(){f(I)}),F(I,"ready",o),F(I,"change","cart"===e?function(e){L(e),p&&p(e)}:p),F(I,"checkout","cart"===e?function(e){L(e),_&&_(e)}:_),t.useLayoutEffect(function(){if(null===T.current&&O&&null!==P.current){var t=O.create(e,u);"cart"===e&&M&&M(t),T.current=t,C(t),t.mount(P.current)}},[O,u,M]);var D=v(u);return t.useEffect(function(){if(T.current){var e=E(u,D,["paymentRequest"]);e&&T.current.update(e)}},[u,D]),t.useLayoutEffect(function(){return function(){T.current&&(T.current.destroy(),T.current=null)}},[]),t.createElement("div",{id:i,className:s,ref:P})},i=function(e){R("mounts <".concat(n,">")),j("mounts <".concat(n,">"));var r=e.id,o=e.className;return t.createElement("div",{id:r,className:o})},s=r?i:o;return s.propTypes={id:y.string,className:y.string,onChange:y.func,onBlur:y.func,onFocus:y.func,onReady:y.func,onEscape:y.func,onClick:y.func,onLoadError:y.func,onLoaderStart:y.func,onNetworksChange:y.func,onCheckout:y.func,onLineItemClick:y.func,onConfirm:y.func,onCancel:y.func,onShippingAddressChange:y.func,onShippingRateChange:y.func,options:y.object},s.displayName=n,s.__elementType=e,s},Y="undefined"==typeof window,H=Z("auBankAccount",Y),q=Z("card",Y),G=Z("cardNumber",Y),W=Z("cardExpiry",Y),K=Z("cardCvc",Y),V=Z("fpxBank",Y),z=Z("iban",Y),J=Z("idealBank",Y),X=Z("p24Bank",Y),Q=Z("epsBank",Y),ee=Z("payment",Y),et=Z("payButton",Y),er=Z("paymentRequestButton",Y),en=Z("linkAuthentication",Y),eo=Z("address",Y),ei=Z("shippingAddress",Y),ea=Z("cart",Y),es=Z("paymentMethodMessaging",Y),el=Z("affirmMessage",Y),eu=Z("afterpayClearpayMessage",Y);e.AddressElement=eo,e.AffirmMessageElement=el,e.AfterpayClearpayMessageElement=eu,e.AuBankAccountElement=H,e.CardCvcElement=K,e.CardElement=q,e.CardExpiryElement=W,e.CardNumberElement=G,e.CartElement=ea,e.Elements=P,e.ElementsConsumer=B,e.EpsBankElement=Q,e.FpxBankElement=V,e.IbanElement=z,e.IdealBankElement=J,e.LinkAuthenticationElement=en,e.P24BankElement=X,e.PayButtonElement=et,e.PaymentElement=ee,e.PaymentMethodMessagingElement=es,e.PaymentRequestButtonElement=er,e.ShippingAddressElement=ei,e.useCartElement=L,e.useCartElementState=D,e.useElements=N,e.useStripe=M,Object.defineProperty(e,"__esModule",{value:!0})})},78974:(e,t,r)=>{"use strict";r.d(t,{$W:()=>a,pJ:()=>i,su:()=>n.A});var n=r(19086);let o=n.A;function i(e){o=e}function a(){return o}},79243:(e,t,r)=>{"use strict";let n=r(5074);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},79616:(e,t,r)=>{"use strict";r.d(t,{w:()=>l});var n=r(6663),o=r(33601);function i(e){let t=e.runtimeEnvStrict??e.runtimeEnv??o.env;if(e.emptyStringAsUndefined)for(let[e,r]of Object.entries(t))""===r&&delete t[e];if(e.skipValidation)return t;let r="object"==typeof e.client?e.client:{},i="object"==typeof e.server?e.server:{},a="object"==typeof e.shared?e.shared:{},s=(0,n.Ik)(r),l=(0,n.Ik)(i),u=(0,n.Ik)(a),c=e.isServer??("undefined"==typeof window||"Deno"in window),d=s.merge(u),f=l.merge(u).merge(s),p=c?f.safeParse(t):d.safeParse(t),h=e.onValidationError??(e=>{throw console.error("❌ Invalid environment variables:",e.flatten().fieldErrors),Error("Invalid environment variables")}),m=e.onInvalidAccess??(e=>{throw Error("❌ Attempted to access a server-side environment variable on the client")});if(!1===p.success)return h(p.error);let g=t=>!e.clientPrefix||!t.startsWith(e.clientPrefix)&&!(t in u.shape),y=e=>c||!g(e),v=e=>"__esModule"===e||"$$typeof"===e,b=(e.extends??[]).reduce((e,t)=>Object.assign(e,t),{});return new Proxy(Object.assign(p.data,b),{get(e,t){if("string"==typeof t&&!v(t))return y(t)?Reflect.get(e,t):m(t)}})}var a=r(33601);let s="NEXT_PUBLIC_";function l(e){let t="object"==typeof e.client?e.client:{},r="object"==typeof e.server?e.server:{},n=e.shared,o=e.runtimeEnv?e.runtimeEnv:{...a.env,...e.experimental__runtimeEnv};return i({...e,shared:n,client:t,server:r,clientPrefix:s,runtimeEnv:o})}},79814:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BRAND:()=>a.qt,DIRTY:()=>o.jm,EMPTY_PATH:()=>o.I3,INVALID:()=>o.uY,NEVER:()=>a.tm,OK:()=>o.OK,ParseStatus:()=>o.MY,Schema:()=>a.Sj,ZodAny:()=>a.Ml,ZodArray:()=>a.n,ZodBigInt:()=>a.Lr,ZodBoolean:()=>a.WF,ZodBranded:()=>a.eN,ZodCatch:()=>a.hw,ZodDate:()=>a.aP,ZodDefault:()=>a.Xi,ZodDiscriminatedUnion:()=>a.jv,ZodEffects:()=>a.k1,ZodEnum:()=>a.Vb,ZodError:()=>s.G,ZodFirstPartyTypeKind:()=>a.kY,ZodFunction:()=>a.CZ,ZodIntersection:()=>a.Jv,ZodIssueCode:()=>s.eq,ZodLazy:()=>a.Ih,ZodLiteral:()=>a.DN,ZodMap:()=>a.Ut,ZodNaN:()=>a.Tq,ZodNativeEnum:()=>a.WM,ZodNever:()=>a.iS,ZodNull:()=>a.PQ,ZodNullable:()=>a.l1,ZodNumber:()=>a.rS,ZodObject:()=>a.bv,ZodOptional:()=>a.Ii,ZodParsedType:()=>i.Zp,ZodPipeline:()=>a._c,ZodPromise:()=>a.$i,ZodReadonly:()=>a.EV,ZodRecord:()=>a.b8,ZodSchema:()=>a.lK,ZodSet:()=>a.Kz,ZodString:()=>a.ND,ZodSymbol:()=>a.K5,ZodTransformer:()=>a.BG,ZodTuple:()=>a.y0,ZodType:()=>a.aR,ZodUndefined:()=>a._Z,ZodUnion:()=>a.fZ,ZodUnknown:()=>a._,ZodVoid:()=>a.a0,addIssueToContext:()=>o.zn,any:()=>a.bz,array:()=>a.YO,bigint:()=>a.o,boolean:()=>a.zM,coerce:()=>a.au,custom:()=>a.Ie,date:()=>a.p6,datetimeRegex:()=>a.fm,defaultErrorMap:()=>n.su,discriminatedUnion:()=>a.gM,effect:()=>a.QZ,enum:()=>a.k5,function:()=>a.fH,getErrorMap:()=>n.$W,getParsedType:()=>i.CR,instanceof:()=>a.Nl,intersection:()=>a.E$,isAborted:()=>o.G4,isAsync:()=>o.xP,isDirty:()=>o.DM,isValid:()=>o.fn,late:()=>a.fn,lazy:()=>a.RZ,literal:()=>a.eu,makeIssue:()=>o.y7,map:()=>a.Tj,nan:()=>a.oi,nativeEnum:()=>a.fc,never:()=>a.Zm,null:()=>a.ch,nullable:()=>a.me,number:()=>a.ai,object:()=>a.Ik,objectUtil:()=>i.o6,oboolean:()=>a.yN,onumber:()=>a.p7,optional:()=>a.lq,ostring:()=>a.Di,pipeline:()=>a.Tk,preprocess:()=>a.vk,promise:()=>a.iv,quotelessJson:()=>s.WI,record:()=>a.g1,set:()=>a.hZ,setErrorMap:()=>n.pJ,strictObject:()=>a.re,string:()=>a.Yj,symbol:()=>a.HR,transformer:()=>a.Gu,tuple:()=>a.PV,undefined:()=>a.Vx,union:()=>a.KC,unknown:()=>a.L5,util:()=>i.ZS,void:()=>a.rI});var n=r(78974),o=r(8722),i=r(45859),a=r(6663),s=r(64892)},79922:(e,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){if(!("string"==typeof e||e instanceof String)){var t=r(e);throw null===e?t="null":"object"===t&&(t=e.constructor.name),TypeError("Expected a string but received a ".concat(t))}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default,e.exports.default=t.default},79998:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=i(r(79922)),o=r(73242);function i(e){return e&&e.__esModule?e:{default:e}}var a=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;function s(e){(0,n.default)(e);var t=e.slice(4,6).toUpperCase();return(!!o.CountryCodes.has(t)||"XK"===t)&&a.test(e)}e.exports=t.default,e.exports.default=t.default},80124:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r{"use strict";var n,o=r(54913),i=r(27721)(),a=r(98516),s=r(27654);if(i){var l=o("RegExp.prototype.exec"),u={},c=function(){throw u},d={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(d[Symbol.toPrimitive]=c),n=function(e){if(!e||"object"!=typeof e)return!1;var t=s(e,"lastIndex");if(!(t&&a(t,"value")))return!1;try{l(e,d)}catch(e){return e===u}}}else{var f=o("Object.prototype.toString"),p="[object RegExp]";n=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&f(e)===p}}e.exports=n},80510:(e,t,r)=>{"use strict";var n=r(3140),o=r(54913),i=r(16526),a=r(72206),s=n("%Map%",!0),l=o("Map.prototype.get",!0),u=o("Map.prototype.set",!0),c=o("Map.prototype.has",!0),d=o("Map.prototype.delete",!0),f=o("Map.prototype.size",!0);e.exports=!!s&&function(){var e,t={assert:function(e){if(!t.has(e))throw new a("Side channel does not contain "+i(e))},delete:function(t){if(e){var r=d(e,t);return 0===f(e)&&(e=void 0),r}return!1},get:function(t){if(e)return l(e,t)},has:function(t){return!!e&&c(e,t)},set:function(t,r){e||(e=new s),u(e,t,r)}};return t}},80656:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,n=Math.max,o="[object Function]",i=function(e,t){for(var r=[],n=0;n{e.exports=r(79098)},81601:(e,t,r)=>{"use strict";let n=r(77721),o=r(5074);e.exports=(e,t,r)=>{let i=null,a=null,s=null;try{s=new o(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(!i||-1===a.compare(e))&&(a=new n(i=e,r))}),i}},82189:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return(0,n.default)(e),"[object RegExp]"!==Object.prototype.toString.call(t)&&(t=new RegExp(t,r)),!!e.match(t)}e.exports=t.default,e.exports.default=t.default},82965:(e,t,r)=>{"use strict";let n=r(26829);e.exports=(e,t)=>{let r=n(e,null,!0),o=n(t,null,!0),i=r.compare(o);if(0===i)return null;let a=i>0,s=a?r:o,l=a?o:r,u=!!s.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(s))return l.minor&&!l.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==o.major?c+"major":r.minor!==o.minor?c+"minor":r.patch!==o.patch?c+"patch":"prerelease"}},83120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){(0,n.default)(e);for(var t,r,o=e.replace(/[- ]+/g,""),i=0,a=o.length-1;a>=0;a--)t=parseInt(o.substring(a,a+1),10),r&&(t*=2)>=10?i+=t%10+1:i+=t,r=!r;return!!(i%10==0&&o)}e.exports=t.default,e.exports.default=t.default},83455:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return(0,n.default)(e),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")}e.exports=t.default,e.exports.default=t.default},83637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(87398));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return(0,n.default)(e)?parseFloat(e):NaN}e.exports=t.default,e.exports.default=t.default},83639:(e,t,r)=>{"use strict";var n=r(14274),o=r(72206),i=r(95185),a=r(95605);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return a(n,i,e)}},84035:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},84173:(e,t,r)=>{"use strict";var n=r(44050);e.exports=function(e){return!!n(e)}},84409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,a=/^[-+]?[0-9]+$/;function s(e,t){(0,n.default)(e);var r=!1===(t=t||{}).allow_leading_zeroes?i:a,o=!t.hasOwnProperty("min")||e>=t.min,s=!t.hasOwnProperty("max")||e<=t.max,l=!t.hasOwnProperty("lt")||et.gt;return r.test(e)&&o&&s&&l&&u}e.exports=t.default,e.exports.default=t.default},84426:(e,t,r)=>{"use strict";let n=r(26189);e.exports=(e,t,r)=>0!==n(e,t,r)},84864:(e,t,r)=>{var n=r(33601),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),_(r)?n.showHidden=r:r&&t._extend(n,r),E(n.showHidden)&&(n.showHidden=!1),E(n.depth)&&(n.depth=2),E(n.colors)&&(n.colors=!1),E(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),p(n,e,n.depth)}function c(e,t){var r=u.styles[t];return r?"\x1b["+u.colors[r][0]+"m"+e+"\x1b["+u.colors[r][1]+"m":e}function d(e,t){return e}function f(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function p(e,r,n){if(e.customInspect&&r&&I(r.inspect)&&r.inspect!==t.inspect&&!(r.constructor&&r.constructor.prototype===r)){var o,i=r.inspect(n,e);return S(i)||(i=p(e,i,n)),i}var a=h(e,r);if(a)return a;var s=Object.keys(r),l=f(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),k(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return m(r);if(0===s.length){if(I(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(x(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(O(r))return e.stylize(Date.prototype.toString.call(r),"date");if(k(r))return m(r)}var c="",d=!1,_=["{","}"];if(b(r)&&(d=!0,_=["[","]"]),I(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),x(r)&&(c=" "+RegExp.prototype.toString.call(r)),O(r)&&(c=" "+Date.prototype.toUTCString.call(r)),k(r)&&(c=" "+m(r)),0===s.length&&(!d||0==r.length))return _[0]+c+_[1];if(n<0)if(x(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");else return e.stylize("[Object]","special");return e.seen.push(r),o=d?g(e,r,n,l,s):s.map(function(t){return y(e,r,n,l,t,d)}),e.seen.pop(),v(o,c,_)}function h(e,t){if(E(t))return e.stylize("undefined","undefined");if(S(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return w(t)?e.stylize(""+t,"number"):_(t)?e.stylize(""+t,"boolean"):$(t)?e.stylize("null","null"):void 0}function m(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,r,n,o){for(var i=[],a=0,s=t.length;ae.seen.indexOf(l.value)?(s=$(r)?p(e,l.value,null):p(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),E(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function v(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function b(e){return Array.isArray(e)}function _(e){return"boolean"==typeof e}function $(e){return null===e}function w(e){return"number"==typeof e}function S(e){return"string"==typeof e}function E(e){return void 0===e}function x(e){return A(e)&&"[object RegExp]"===C(e)}function A(e){return"object"==typeof e&&null!==e}function O(e){return A(e)&&"[object Date]"===C(e)}function k(e){return A(e)&&("[object Error]"===C(e)||e instanceof Error)}function I(e){return"function"==typeof e}function C(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(!a[e=e.toUpperCase()])if(s.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(30629),t.isArray=b,t.isBoolean=_,t.isNull=$,t.isNullOrUndefined=function(e){return null==e},t.isNumber=w,t.isString=S,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=E,t.isRegExp=x,t.types.isRegExp=x,t.isObject=A,t.isDate=O,t.types.isDate=O,t.isError=k,t.types.isNativeError=k,t.isFunction=I,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(43946);var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),P[e.getMonth()],t].join(" ")}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",R(),t.format.apply(t,arguments))},t.inherits=r(84035),t._extend=function(e,t){if(!t||!A(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var N="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function M(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(N&&e[N]){var t=e[N];if("function"!=typeof t)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,N,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),o=[],i=0;i{"use strict";var n=r(72206),o=r(16526),i=r(19782),a=r(80510),s=r(35146)||a||i;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n("Side channel does not contain "+o(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,r){e||(e=s()),e.set(t,r)}};return t}},85463:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=c,t.vatMatchers=void 0;var o=l(r(79922)),i=s(r(93563));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&({}).hasOwnProperty.call(e,s)){var l=i?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(o,s,l):o[s]=e[s]}return o.default=e,r&&r.set(e,o),o}function l(e){return e&&e.__esModule?e:{default:e}}var u=t.vatMatchers={AT:function(e){return/^(AT)?U\d{8}$/.test(e)},BE:function(e){return/^(BE)?\d{10}$/.test(e)},BG:function(e){return/^(BG)?\d{9,10}$/.test(e)},HR:function(e){return/^(HR)?\d{11}$/.test(e)},CY:function(e){return/^(CY)?\w{9}$/.test(e)},CZ:function(e){return/^(CZ)?\d{8,10}$/.test(e)},DK:function(e){return/^(DK)?\d{8}$/.test(e)},EE:function(e){return/^(EE)?\d{9}$/.test(e)},FI:function(e){return/^(FI)?\d{8}$/.test(e)},FR:function(e){return/^(FR)?\w{2}\d{9}$/.test(e)},DE:function(e){return/^(DE)?\d{9}$/.test(e)},EL:function(e){return/^(EL)?\d{9}$/.test(e)},HU:function(e){return/^(HU)?\d{8}$/.test(e)},IE:function(e){return/^(IE)?\d{7}\w{1}(W)?$/.test(e)},IT:function(e){return/^(IT)?\d{11}$/.test(e)},LV:function(e){return/^(LV)?\d{11}$/.test(e)},LT:function(e){return/^(LT)?\d{9,12}$/.test(e)},LU:function(e){return/^(LU)?\d{8}$/.test(e)},MT:function(e){return/^(MT)?\d{8}$/.test(e)},NL:function(e){return/^(NL)?\d{9}B\d{2}$/.test(e)},PL:function(e){return/^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(e)},PT:function(e){var t=e.match(/^(PT)?(\d{9})$/);if(!t)return!1;var r=t[2],n=11-i.reverseMultiplyAndSum(r.split("").slice(0,8).map(function(e){return parseInt(e,10)}),9)%11;return n>9?0===parseInt(r[8],10):n===parseInt(r[8],10)},RO:function(e){return/^(RO)?\d{2,10}$/.test(e)},SK:function(e){return/^(SK)?\d{10}$/.test(e)},SI:function(e){return/^(SI)?\d{8}$/.test(e)},ES:function(e){return/^(ES)?\w\d{7}[A-Z]$/.test(e)},SE:function(e){return/^(SE)?\d{12}$/.test(e)},AL:function(e){return/^(AL)?\w{9}[A-Z]$/.test(e)},MK:function(e){return/^(MK)?\d{13}$/.test(e)},AU:function(e){if(!e.match(/^(AU)?(\d{11})$/))return!1;for(var t=[10,1,3,5,7,9,11,13,15,17,19],r=(parseInt((e=e.replace(/^AU/,"")).slice(0,1),10)-1).toString()+e.slice(1),n=0,o=0;o<11;o++)n+=t[o]*r.charAt(o);return 0!==n&&n%89==0},BY:function(e){return/^(УНП )?\d{9}$/.test(e)},CA:function(e){return/^(CA)?\d{9}$/.test(e)},IS:function(e){return/^(IS)?\d{5,6}$/.test(e)},IN:function(e){return/^(IN)?\d{15}$/.test(e)},ID:function(e){return/^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(e)},IL:function(e){return/^(IL)?\d{9}$/.test(e)},KZ:function(e){return/^(KZ)?\d{12}$/.test(e)},NZ:function(e){return/^(NZ)?\d{9}$/.test(e)},NG:function(e){return/^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(e)},NO:function(e){return/^(NO)?\d{9}MVA$/.test(e)},PH:function(e){return/^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(e)},RU:function(e){return/^(RU)?(\d{10}|\d{12})$/.test(e)},SM:function(e){return/^(SM)?\d{5}$/.test(e)},SA:function(e){return/^(SA)?\d{15}$/.test(e)},RS:function(e){return/^(RS)?\d{9}$/.test(e)},CH:function(e){var t=function(e){var t=e.pop(),r=[5,4,3,2,7,6,5,4];return t===(11-e.reduce(function(e,t,n){return e+t*r[n]},0)%11)%11};return/^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(e)&&t(e.match(/\d/g).map(function(e){return+e}))},TR:function(e){return/^(TR)?\d{10}$/.test(e)},UA:function(e){return/^(UA)?\d{12}$/.test(e)},GB:function(e){return/^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(e)},UZ:function(e){return/^(UZ)?\d{9}$/.test(e)},AR:function(e){return/^(AR)?\d{11}$/.test(e)},BO:function(e){return/^(BO)?\d{7}$/.test(e)},BR:function(e){return/^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(e)},CL:function(e){return/^(CL)?\d{8}-\d{1}$/.test(e)},CO:function(e){return/^(CO)?\d{10}$/.test(e)},CR:function(e){return/^(CR)?\d{9,12}$/.test(e)},EC:function(e){return/^(EC)?\d{13}$/.test(e)},SV:function(e){return/^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(e)},GT:function(e){return/^(GT)?\d{7}-\d{1}$/.test(e)},HN:function(e){return/^(HN)?$/.test(e)},MX:function(e){return/^(MX)?\w{3,4}\d{6}\w{3}$/.test(e)},NI:function(e){return/^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(e)},PA:function(e){return/^(PA)?$/.test(e)},PY:function(e){return/^(PY)?\d{6,8}-\d{1}$/.test(e)},PE:function(e){return/^(PE)?\d{11}$/.test(e)},DO:function(e){return/^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(e)},UY:function(e){return/^(UY)?\d{12}$/.test(e)},VE:function(e){return/^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(e)}};function c(e,t){if((0,o.default)(e),(0,o.default)(t),t in u)return u[t](e);throw Error("Invalid country code: '".concat(t,"'"))}},85652:(e,t,r)=>{"use strict";var n=r(59102).Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function a(e){var t=i(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=a(e),this.encoding){case"utf16le":this.text=h,this.end=m,t=4;break;case"utf8":this.fillLast=d,t=4;break;case"base64":this.text=g,this.end=y,t=3;break;default:this.write=v,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function l(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e,t,r){var n=t.length-1;if(n=0?(o>0&&(e.lastNeed=o-1),o):--n=0?(o>0&&(e.lastNeed=o-2),o):--n=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}function c(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function d(e){var t=this.lastTotal-this.lastNeed,r=c(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function f(e,t){var r=u(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function h(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function m(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function g(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function y(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function b(e){return e&&e.length?this.write(e):""}t.StringDecoder=s,s.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r{"use strict";var n;r.d(t,{s:()=>n}),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(n||(n={}))},86159:(e,t,r)=>{"use strict";let n=r(77721),o=r(5074);e.exports=(e,t,r)=>{let i=null,a=null,s=null;try{s=new o(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(!i||1===a.compare(e))&&(a=new n(i=e,r))}),i}},86246:(e,t,r)=>{var n=r(51642).Buffer;let o=r(10594),i=r(55032),a=r(55790),s=r(89809),{includes:l,isBoolean:u,isInteger:c,isNumber:d,isPlainObject:f,isString:p,once:h}=r(71434),{KeyObject:m,createSecretKey:g,createPrivateKey:y}=r(62701),v=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];i&&v.splice(3,0,"PS256","PS384","PS512");let b={expiresIn:{isValid:function(e){return c(e)||p(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return c(e)||p(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return p(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:l.bind(null,v),message:'"algorithm" must be a valid string enum value'},header:{isValid:f,message:'"header" must be an object'},encoding:{isValid:p,message:'"encoding" must be a string'},issuer:{isValid:p,message:'"issuer" must be a string'},subject:{isValid:p,message:'"subject" must be a string'},jwtid:{isValid:p,message:'"jwtid" must be a string'},noTimestamp:{isValid:u,message:'"noTimestamp" must be a boolean'},keyid:{isValid:p,message:'"keyid" must be a string'},mutatePayload:{isValid:u,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:u,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:u,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},_={iat:{isValid:d,message:'"iat" should be a number of seconds'},exp:{isValid:d,message:'"exp" should be a number of seconds'},nbf:{isValid:d,message:'"nbf" should be a number of seconds'}};function $(e,t,r,n){if(!f(r))throw Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(o){let i=e[o];if(!i){if(!t)throw Error('"'+o+'" is not allowed in "'+n+'"');return}if(!i.isValid(r[o]))throw Error(i.message)})}function w(e){return $(b,!1,e,"options")}function S(e){return $(_,!0,e,"payload")}let E={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},x=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,t,r,i){"function"==typeof r?(i=r,r={}):r=r||{};let l="object"==typeof e&&!n.isBuffer(e),u=Object.assign({alg:r.algorithm||"HS256",typ:l?"JWT":void 0,kid:r.keyid},r.header);function c(e){if(i)return i(e);throw e}if(!t&&"none"!==r.algorithm)return c(Error("secretOrPrivateKey must have a value"));if(null!=t&&!(t instanceof m))try{t=y(t)}catch(e){try{t=g("string"==typeof t?n.from(t):t)}catch(e){return c(Error("secretOrPrivateKey is not valid key material"))}}if(u.alg.startsWith("HS")&&"secret"!==t.type)return c(Error(`secretOrPrivateKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)){if("private"!==t.type)return c(Error(`secretOrPrivateKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInsecureKeySizes&&!u.alg.startsWith("ES")&&void 0!==t.asymmetricKeyDetails&&t.asymmetricKeyDetails.modulusLength<2048)return c(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}if(void 0===e)return c(Error("payload is required"));if(l){try{S(e)}catch(e){return c(e)}r.mutatePayload||(e=Object.assign({},e))}else{let t=x.filter(function(e){return void 0!==r[e]});if(t.length>0)return c(Error("invalid "+t.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==r.expiresIn)return c(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==r.notBefore)return c(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{w(r)}catch(e){return c(e)}if(!r.allowInvalidAsymmetricKeyTypes)try{a(u.alg,t)}catch(e){return c(e)}let d=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:l&&(e.iat=d),void 0!==r.notBefore){try{e.nbf=o(r.notBefore,d)}catch(e){return c(e)}if(void 0===e.nbf)return c(Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==r.expiresIn&&"object"==typeof e){try{e.exp=o(r.expiresIn,d)}catch(e){return c(e)}if(void 0===e.exp)return c(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(E).forEach(function(t){let n=E[t];if(void 0!==r[t]){if(void 0!==e[n])return c(Error('Bad "options.'+t+'" option. The payload already has an "'+n+'" property.'));e[n]=r[t]}});let f=r.encoding||"utf8";if("function"==typeof i)i=i&&h(i),s.createSign({header:u,privateKey:t,payload:e,encoding:f}).once("error",i).once("done",function(e){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&e.length<256)return i(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`));i(null,e)});else{let n=s.sign({header:u,payload:e,secret:t,encoding:f});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&n.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`);return n}}},86298:(e,t,r)=>{"use strict";let n=r(5074);e.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},86357:(e,t,r)=>{"use strict";var n,o=r(54913),i=r(47824)(/^\s*(?:function)?\*/),a=r(27721)(),s=r(50865),l=o("Object.prototype.toString"),u=o("Function.prototype.toString"),c=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}};e.exports=function(e){if("function"!=typeof e)return!1;if(i(u(e)))return!0;if(!a)return"[object GeneratorFunction]"===l(e);if(!s)return!1;if(void 0===n){var t=c();n=!!t&&s(t)}return s(e)===n}},86387:(e,t,r)=>{"use strict";var n,o={value:!0},i=r(77201),a=r(34289),s=[],l=function(){function e(e){this.$$observationTargets=[],this.$$activeTargets=[],this.$$skippedTargets=[];var t=d(e);if(t)throw TypeError(t);this.$$callback=e}return e.prototype.observe=function(e){var t=f("observe",e);if(t)throw TypeError(t);p(this.$$observationTargets,e)>=0||(this.$$observationTargets.push(new i.ResizeObservation(e)),u(this))},e.prototype.unobserve=function(e){var t=f("unobserve",e);if(t)throw TypeError(t);var r=p(this.$$observationTargets,e);r<0||(this.$$observationTargets.splice(r,1),0===this.$$observationTargets.length&&c(this))},e.prototype.disconnect=function(){this.$$observationTargets=[],this.$$activeTargets=[],c(this)},e}();function u(e){0>s.indexOf(e)&&(s.push(e),$())}function c(e){var t=s.indexOf(e);t>=0&&(s.splice(t,1),S())}function d(e){return void 0===e?"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.":"function"!=typeof e?"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.":void 0}function f(e,t){return void 0===t?"Failed to execute '"+e+"' on 'ResizeObserver': 1 argument required, but only 0 present.":t&&t.nodeType===window.Node.ELEMENT_NODE?void 0:"Failed to execute '"+e+"' on 'ResizeObserver': parameter 1 is not of type 'Element'."}function p(e,t){for(var r=0;re?t.$$activeTargets.push(r):t.$$skippedTargets.push(r))})})},m=function(){return s.some(function(e){return!!e.$$activeTargets.length})},g=function(){return s.some(function(e){return!!e.$$skippedTargets.length})},y=function(){var e=1/0;return s.forEach(function(t){if(t.$$activeTargets.length){var r=[];t.$$activeTargets.forEach(function(t){var n=new a.ResizeObserverEntry(t.target);r.push(n),t.$$broadcastWidth=n.contentRect.width,t.$$broadcastHeight=n.contentRect.height;var o=b(t.target);o{"use strict";function t(e){return(e/8|0)+ +(e%8!=0)}var r={ES256:t(256),ES384:t(384),ES512:t(521)};e.exports=function(e){var t=r[e];if(t)return t;throw Error('Unknown algorithm "'+e+'"')}},87398:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a,t.locales=void 0;var n=i(r(79922)),o=r(21988);function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){(0,n.default)(e),t=t||{};var r=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(t.locale?o.decimal[t.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(""===e||"."===e||","===e||"-"===e||"+"===e)return!1;var i=parseFloat(e.replace(",","."));return r.test(e)&&(!t.hasOwnProperty("min")||i>=t.min)&&(!t.hasOwnProperty("max")||i<=t.max)&&(!t.hasOwnProperty("lt")||it.gt)}t.locales=Object.keys(o.decimal)},87765:(e,t,r)=>{"use strict";let n;r.d(t,{mD:()=>eO,H4:()=>eb,d1:()=>eh,EC:()=>ew});var o=r(38483);let i=Symbol("Let zodToJsonSchema decide on which parser to use"),a={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},s=e=>"string"==typeof e?{...a,name:e}:{...a,...e},l=e=>{let t=s(e),r=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};var u=r(6663);let c=(e,t)=>{let r=0;for(;ren(e.innerType._def,t);function b(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,n)=>b(e,t,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return _(e,t)}}let _=(e,t)=>{let r={type:"integer",format:"unix-time"};if("openApi3"===t.target)return r;for(let n of e.checks)switch(n.kind){case"min":p(r,"minimum",n.value,n.message,t);break;case"max":p(r,"maximum",n.value,n.message,t)}return r};function $(e,t){return{...en(e.innerType._def,t),default:e.defaultValue()}}function w(e,t){return"input"===t.effectStrategy?en(e.schema._def,t):d(t)}function S(e){return{type:"string",enum:Array.from(e.values)}}let E=e=>(!("type"in e)||"string"!==e.type)&&"allOf"in e;function x(e,t){let r=[en(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),en(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e),n="jsonSchema2019-09"===t.target?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(e=>{if(E(e))o.push(...e.allOf),void 0===e.unevaluatedProperties&&(n=void 0);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:r,...n}=e;t=n}else n=void 0;o.push(t)}}),o.length?{allOf:o,...n}:void 0}function A(e,t){let r=typeof e.value;return"bigint"!==r&&"number"!==r&&"boolean"!==r&&"string"!==r?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===t.target?{type:"bigint"===r?"integer":r,enum:[e.value]}:{type:"bigint"===r?"integer":r,const:e.value}}let O={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===n&&(n=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),n),ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function k(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":p(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":p(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":P(r,"email",n.message,t);break;case"format:idn-email":P(r,"idn-email",n.message,t);break;case"pattern:zod":R(r,O.email,n.message,t)}break;case"url":P(r,"uri",n.message,t);break;case"uuid":P(r,"uuid",n.message,t);break;case"regex":R(r,n.regex,n.message,t);break;case"cuid":R(r,O.cuid,n.message,t);break;case"cuid2":R(r,O.cuid2,n.message,t);break;case"startsWith":R(r,RegExp(`^${I(n.value,t)}`),n.message,t);break;case"endsWith":R(r,RegExp(`${I(n.value,t)}$`),n.message,t);break;case"datetime":P(r,"date-time",n.message,t);break;case"date":P(r,"date",n.message,t);break;case"time":P(r,"time",n.message,t);break;case"duration":P(r,"duration",n.message,t);break;case"length":p(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,n.value):n.value,n.message,t),p(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":R(r,RegExp(I(n.value,t)),n.message,t);break;case"ip":"v6"!==n.version&&P(r,"ipv4",n.message,t),"v4"!==n.version&&P(r,"ipv6",n.message,t);break;case"base64url":R(r,O.base64url,n.message,t);break;case"jwt":R(r,O.jwt,n.message,t);break;case"cidr":"v6"!==n.version&&R(r,O.ipv4Cidr,n.message,t),"v4"!==n.version&&R(r,O.ipv6Cidr,n.message,t);break;case"emoji":R(r,O.emoji(),n.message,t);break;case"ulid":R(r,O.ulid,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":P(r,"binary",n.message,t);break;case"contentEncoding:base64":p(r,"contentEncoding","base64",n.message,t);break;case"pattern:zod":R(r,O.base64,n.message,t)}break;case"nanoid":R(r,O.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:(e=>{})(0)}return r}function I(e,t){return"escape"===t.patternStrategy?T(e):e}let C=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function T(e){let t="";for(let r=0;re.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):p(e,"format",t,r,n)}function R(e,t,r,n){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:j(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):p(e,"pattern",j(t,n),r,n)}function j(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,o="",i=!1,a=!1,s=!1;for(let e=0;e({...r,[n]:en(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??d(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:en(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if("openApi3"===t.target)return r;if(e.keyType?._def.typeName===u.kY.ZodString&&e.keyType._def.checks?.length){let{type:n,...o}=k(e.keyType._def,t);return{...r,propertyNames:o}}if(e.keyType?._def.typeName===u.kY.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===u.kY.ZodBranded&&e.keyType._def.type._def.typeName===u.kY.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...o}=y(e.keyType._def,t);return{...r,propertyNames:o}}return r}function M(e,t){return"record"===t.mapStrategy?N(e,t):{type:"array",maxItems:125,items:{type:"array",items:[en(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||d(t),en(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||d(t)],minItems:2,maxItems:2}}}function L(e){let t=e.values,r=Object.keys(e.values).filter(e=>"number"!=typeof t[t[e]]).map(e=>t[e]),n=Array.from(new Set(r.map(e=>typeof e)));return{type:1===n.length?"string"===n[0]?"string":"number":["string","number"],enum:r}}function D(e){return"openAi"===e.target?void 0:{not:d({...e,currentPath:[...e.currentPath,"not"]})}}function B(e){return"openApi3"===e.target?{enum:["null"],nullable:!0}:{type:"null"}}let F={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function U(e,t){if("openApi3"===t.target)return Z(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(e=>e._def.typeName in F&&(!e._def.checks||!e._def.checks.length))){let e=r.reduce((e,t)=>{let r=F[t._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}if(r.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=r.reduce((e,t)=>{let r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===r.length){let t=e.filter((e,t,r)=>r.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:r.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(r.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:r.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return Z(e,t)}let Z=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,r)=>en(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return r.length?{anyOf:r}:void 0};function Y(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===t.target?{type:F[e.innerType._def.typeName],nullable:!0}:{type:[F[e.innerType._def.typeName],"null"]};if("openApi3"===t.target){let r=en(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}let r=en(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function H(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",f(r,"type",n.message,t);break;case"min":"jsonSchema7"===t.target?n.inclusive?p(r,"minimum",n.value,n.message,t):p(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),p(r,"minimum",n.value,n.message,t));break;case"max":"jsonSchema7"===t.target?n.inclusive?p(r,"maximum",n.value,n.message,t):p(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),p(r,"maximum",n.value,n.message,t));break;case"multipleOf":p(r,"multipleOf",n.value,n.message,t)}return r}function q(e,t){let r="openAi"===t.target,n={type:"object",properties:{}},o=[],i=e.shape();for(let e in i){let a=i[e];if(void 0===a||void 0===a._def)continue;let s=W(a);s&&r&&("ZodOptional"===a._def.typeName&&(a=a._def.innerType),a.isNullable()||(a=a.nullable()),s=!1);let l=en(a._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==l&&(n.properties[e]=l,s||o.push(e))}o.length&&(n.required=o);let a=G(e,t);return void 0!==a&&(n.additionalProperties=a),n}function G(e,t){if("ZodNever"!==e.catchall._def.typeName)return en(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function W(e){try{return e.isOptional()}catch{return!0}}let K=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return en(e.innerType._def,t);let r=en(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:d(t)},r]}:d(t)},V=(e,t)=>{if("input"===t.pipeStrategy)return en(e.in._def,t);if("output"===t.pipeStrategy)return en(e.out._def,t);let r=en(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=en(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(e=>void 0!==e)}};function z(e,t){return en(e.type._def,t)}function J(e,t){let r={type:"array",uniqueItems:!0,items:en(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&p(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&p(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function X(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,r)=>en(e._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:en(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,r)=>en(e._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}function Q(e){return{not:d(e)}}function ee(e){return d(e)}let et=(e,t)=>en(e.innerType._def,t),er=(e,t,r)=>{switch(t){case u.kY.ZodString:return k(e,r);case u.kY.ZodNumber:return H(e,r);case u.kY.ZodObject:return q(e,r);case u.kY.ZodBigInt:return m(e,r);case u.kY.ZodBoolean:return g();case u.kY.ZodDate:return b(e,r);case u.kY.ZodUndefined:return Q(r);case u.kY.ZodNull:return B(r);case u.kY.ZodArray:return h(e,r);case u.kY.ZodUnion:case u.kY.ZodDiscriminatedUnion:return U(e,r);case u.kY.ZodIntersection:return x(e,r);case u.kY.ZodTuple:return X(e,r);case u.kY.ZodRecord:return N(e,r);case u.kY.ZodLiteral:return A(e,r);case u.kY.ZodEnum:return S(e);case u.kY.ZodNativeEnum:return L(e);case u.kY.ZodNullable:return Y(e,r);case u.kY.ZodOptional:return K(e,r);case u.kY.ZodMap:return M(e,r);case u.kY.ZodSet:return J(e,r);case u.kY.ZodLazy:return()=>e.getter()._def;case u.kY.ZodPromise:return z(e,r);case u.kY.ZodNaN:case u.kY.ZodNever:return D(r);case u.kY.ZodEffects:return w(e,r);case u.kY.ZodAny:return d(r);case u.kY.ZodUnknown:return ee(r);case u.kY.ZodDefault:return $(e,r);case u.kY.ZodBranded:return y(e,r);case u.kY.ZodReadonly:return et(e,r);case u.kY.ZodCatch:return v(e,r);case u.kY.ZodPipeline:return V(e,r);case u.kY.ZodFunction:case u.kY.ZodVoid:case u.kY.ZodSymbol:return;default:let n;return void(n=0)}};function en(e,t,r=!1){let n=t.seen.get(e);if(t.override){let o=t.override?.(e,t,n,r);if(o!==i)return o}if(n&&!r){let e=eo(n,t);if(void 0!==e)return e}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let a=er(e,e.typeName,t),s="function"==typeof a?en(a(),t):a;if(s&&ei(e,t,s),t.postProcess){let r=t.postProcess(s,e,t);return o.jsonSchema=s,r}return o.jsonSchema=s,s}let eo=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:c(t.currentPath,e.path)};case"none":case"seen":if(e.path.lengtht.currentPath[r]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),d(t);return"seen"===t.$refStrategy?d(t):void 0}},ei=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r),ea=(e,t)=>{let r=l(t),n="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>({...e,[t]:en(n._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0)??d(r)}),{}):void 0,o="string"==typeof t?t:t?.nameStrategy==="title"?void 0:t?.name,i=en(e._def,void 0===o?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??d(r),a="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==a&&(i.title=a),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===r.$refStrategy?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let s=void 0===o?n?{...i,[r.definitionPath]:n}:i:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:i}};return"jsonSchema7"===r.target?s.$schema="http://json-schema.org/draft-07/schema#":("jsonSchema2019-09"===r.target||"openAi"===r.target)&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===r.target&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s};var es={code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw Error('"text" parts expect a string value.');return{type:"text",value:e}}},el={code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw Error('"error" parts expect a string value.');return{type:"error",value:e}}},eu={code:"4",name:"assistant_message",parse:e=>{if(null==e||"object"!=typeof e||!("id"in e)||!("role"in e)||!("content"in e)||"string"!=typeof e.id||"string"!=typeof e.role||"assistant"!==e.role||!Array.isArray(e.content)||!e.content.every(e=>null!=e&&"object"==typeof e&&"type"in e&&"text"===e.type&&"text"in e&&null!=e.text&&"object"==typeof e.text&&"value"in e.text&&"string"==typeof e.text.value))throw Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},ec={code:"5",name:"assistant_control_data",parse:e=>{if(null==e||"object"!=typeof e||!("threadId"in e)||!("messageId"in e)||"string"!=typeof e.threadId||"string"!=typeof e.messageId)throw Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},ed={code:"6",name:"data_message",parse:e=>{if(null==e||"object"!=typeof e||!("role"in e)||!("data"in e)||"string"!=typeof e.role||"data"!==e.role)throw Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},ef=[es,el,eu,ec,ed];function ep(e){let t=["ROOT"],r=-1,n=null;function o(e,o,i){switch(e){case'"':r=o,t.pop(),t.push(i),t.push("INSIDE_STRING");break;case"f":case"t":case"n":r=o,n=o,t.pop(),t.push(i),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(i),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=o,t.pop(),t.push(i),t.push("INSIDE_NUMBER");break;case"{":r=o,t.pop(),t.push(i),t.push("INSIDE_OBJECT_START");break;case"[":r=o,t.pop(),t.push(i),t.push("INSIDE_ARRAY_START")}}function i(e,n){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":r=n,t.pop()}}function a(e,n){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":r=n,t.pop()}}for(let s=0;s=0;r--)switch(t[r]){case"INSIDE_STRING":s+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":s+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":s+="]";break;case"INSIDE_LITERAL":{let t=e.substring(n,e.length);"true".startsWith(t)?s+="true".slice(t.length):"false".startsWith(t)?s+="false".slice(t.length):"null".startsWith(t)&&(s+="null".slice(t.length))}}return s}function eh(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=(0,o.N8)({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=(0,o.N8)({text:ep(e)})).success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"}}es.code,el.code,eu.code,ec.code,ed.code,es.name,es.code,el.name,el.code,eu.name,eu.code,ec.name,ec.code,ed.name,ed.code,ef.map(e=>e.code);var em=[{code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw Error('"text" parts expect a string value.');return{type:"text",value:e}}},{code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw Error('"data" parts expect an array value.');return{type:"data",value:e}}},{code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw Error('"error" parts expect a string value.');return{type:"error",value:e}}},{code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},{code:"9",name:"tool_call",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName||!("args"in e)||"object"!=typeof e.args)throw Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},{code:"a",name:"tool_result",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("result"in e))throw Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},{code:"b",name:"tool_call_streaming_start",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName)throw Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},{code:"c",name:"tool_call_delta",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("argsTextDelta"in e)||"string"!=typeof e.argsTextDelta)throw Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},{code:"d",name:"finish_message",parse:e=>{if(null==e||"object"!=typeof e||!("finishReason"in e)||"string"!=typeof e.finishReason)throw Error('"finish_message" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason};return"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:"number"==typeof e.usage.promptTokens?e.usage.promptTokens:NaN,completionTokens:"number"==typeof e.usage.completionTokens?e.usage.completionTokens:NaN}),{type:"finish_message",value:t}}},{code:"e",name:"finish_step",parse:e=>{if(null==e||"object"!=typeof e||!("finishReason"in e)||"string"!=typeof e.finishReason)throw Error('"finish_step" parts expect an object with a "finishReason" property.');let t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:"number"==typeof e.usage.promptTokens?e.usage.promptTokens:NaN,completionTokens:"number"==typeof e.usage.completionTokens?e.usage.completionTokens:NaN}),"isContinued"in e&&"boolean"==typeof e.isContinued&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},{code:"f",name:"start_step",parse:e=>{if(null==e||"object"!=typeof e||!("messageId"in e)||"string"!=typeof e.messageId)throw Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},{code:"g",name:"reasoning",parse:e=>{if("string"!=typeof e)throw Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},{code:"h",name:"source",parse:e=>{if(null==e||"object"!=typeof e)throw Error('"source" parts expect a Source object.');return{type:"source",value:e}}},{code:"i",name:"redacted_reasoning",parse:e=>{if(null==e||"object"!=typeof e||!("data"in e)||"string"!=typeof e.data)throw Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},{code:"j",name:"reasoning_signature",parse:e=>{if(null==e||"object"!=typeof e||!("signature"in e)||"string"!=typeof e.signature)throw Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},{code:"k",name:"file",parse:e=>{if(null==e||"object"!=typeof e||!("data"in e)||"string"!=typeof e.data||!("mimeType"in e)||"string"!=typeof e.mimeType)throw Error('"file" parts expect an object with a "data" and "mimeType" property.');return{type:"file",value:e}}}],eg=Object.fromEntries(em.map(e=>[e.code,e]));Object.fromEntries(em.map(e=>[e.name,e.code]));var ey=em.map(e=>e.code),ev=e=>{let t=e.indexOf(":");if(-1===t)throw Error("Failed to parse stream string. No separator found.");let r=e.slice(0,t);if(!ey.includes(r))throw Error(`Failed to parse stream string. Invalid code ${r}.`);let n=r,o=JSON.parse(e.slice(t+1));return eg[n].parse(o)};function eb(e,t){let r=em.find(t=>t.name===e);if(!r)throw Error(`Invalid stream part type: ${e}`);return`${r.code}:${JSON.stringify(t)} `}var e_=10;function e$(e,t){let r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return e.length=0,r}async function ew({stream:e,onTextPart:t,onReasoningPart:r,onReasoningSignaturePart:n,onRedactedReasoningPart:o,onSourcePart:i,onFilePart:a,onDataPart:s,onErrorPart:l,onToolCallStreamingStartPart:u,onToolCallDeltaPart:c,onToolCallPart:d,onToolResultPart:f,onMessageAnnotationsPart:p,onFinishMessagePart:h,onFinishStepPart:m,onStartStepPart:g}){let y=e.getReader(),v=new TextDecoder,b=[],_=0;for(;;){let{value:e}=await y.read();if(e&&(b.push(e),_+=e.length,e[e.length-1]!==e_))continue;if(0===b.length)break;let $=e$(b,_);for(let{type:e,value:y}of(_=0,v.decode($,{stream:!0}).split("\n").filter(e=>""!==e).map(ev)))switch(e){case"text":await (null==t?void 0:t(y));break;case"reasoning":await (null==r?void 0:r(y));break;case"reasoning_signature":await (null==n?void 0:n(y));break;case"redacted_reasoning":await (null==o?void 0:o(y));break;case"file":await (null==a?void 0:a(y));break;case"source":await (null==i?void 0:i(y));break;case"data":await (null==s?void 0:s(y));break;case"error":await (null==l?void 0:l(y));break;case"message_annotations":await (null==p?void 0:p(y));break;case"tool_call_streaming_start":await (null==u?void 0:u(y));break;case"tool_call_delta":await (null==c?void 0:c(y));break;case"tool_call":await (null==d?void 0:d(y));break;case"tool_result":await (null==f?void 0:f(y));break;case"finish_message":await (null==h?void 0:h(y));break;case"finish_step":await (null==m?void 0:m(y));break;case"start_step":await (null==g?void 0:g(y));break;default:{let t=e;throw Error(`Unknown stream part type: ${t}`)}}}}function eS(e,t){var r;return ex(ea(e,{$refStrategy:null!=(r=null==t?void 0:t.useReferences)&&r?"root":"none",target:"jsonSchema7"}),{validate:t=>{let r=e.safeParse(t);return r.success?{success:!0,value:r.data}:{success:!1,error:r.error}}})}var eE=Symbol.for("vercel.ai.schema");function ex(e,{validate:t}={}){return{[eE]:!0,_type:void 0,[o.eu]:!0,jsonSchema:e,validate:t}}function eA(e){return"object"==typeof e&&null!==e&&eE in e&&!0===e[eE]&&"jsonSchema"in e&&"validate"in e}function eO(e){return eA(e)?e:eS(e)}},87896:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=new Set(["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"]);function a(e){return(0,n.default)(e),i.has(e)}e.exports=t.default,e.exports.default=t.default},87931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(r(79922)),o=i(r(73909));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:String(new Date);(0,n.default)(e);var r=(0,o.default)(t),i=(0,o.default)(e);return!!(i&&r&&i{"use strict";var n=r(85397),o=r(8304),i=r(57693),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,u=Array.prototype.push,c=function(e,t){u.apply(e,l(t)?t:[t])},d=Date.prototype.toISOString,f=i.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:f,formatter:i.formatters[f],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},h=function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e},m={},g=function e(t,r,i,a,s,u,d,f,g,y,v,b,_,$,w,S){for(var E,x=t,A=S,O=0,k=!1;void 0!==(A=A.get(m))&&!k;){var I=A.get(t);if(O+=1,void 0!==I)if(I===O)throw RangeError("Cyclic object value");else k=!0;void 0===A.get(m)&&(O=0)}if("function"==typeof f?x=f(r,x):x instanceof Date?x=v(x):"comma"===i&&l(x)&&(x=o.maybeMap(x,function(e){return e instanceof Date?v(e):e})),null===x){if(s)return d&&!$?d(r,p.encoder,w,"key",b):r;x=""}if(h(x)||o.isBuffer(x))return d?[_($?r:d(r,p.encoder,w,"key",b))+"="+_(d(x,p.encoder,w,"value",b))]:[_(r)+"="+_(String(x))];var C=[];if(void 0===x)return C;if("comma"===i&&l(x))$&&d&&(x=o.maybeMap(x,d)),E=[{value:x.length>0?x.join(",")||null:void 0}];else if(l(f))E=f;else{var T=Object.keys(x);E=g?T.sort(g):T}for(var P=a&&l(x)&&1===x.length?r+"[]":r,R=0;R0?_+b:""}},89089:(e,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return"object"===r(e)&&null!==e?e="function"==typeof e.toString?e.toString():"[object Object]":(null==e||isNaN(e)&&!e.length)&&(e=""),String(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default,e.exports.default=t.default},89809:(e,t,r)=>{var n=r(47701),o=r(92781);t.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],t.sign=n.sign,t.verify=o.verify,t.decode=o.decode,t.isValid=o.isValid,t.createSign=function(e){return new n(e)},t.createVerify=function(e){return new o(e)}},89843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=v;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/[0-9]{4}/,a=/(0[1-9]|1[0-2])/,s=/([12]\d|0[1-9]|3[01])/,l=/([01][0-9]|2[0-3])/,u=/[0-5][0-9]/,c=/([0-5][0-9]|60)/,d=/(\.[0-9]+)?/,f=new RegExp("[-+]".concat(l.source,":").concat(u.source)),p=new RegExp("([zZ]|".concat(f.source,")")),h=new RegExp("".concat(l.source,":").concat(u.source,":").concat(c.source).concat(d.source)),m=new RegExp("".concat(i.source,"-").concat(a.source,"-").concat(s.source)),g=new RegExp("".concat(h.source).concat(p.source)),y=new RegExp("^".concat(m.source,"[ tT]").concat(g.source,"$"));function v(e){return(0,n.default)(e),y.test(e)}e.exports=t.default,e.exports.default=t.default},90629:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var n=o(r(29203));function o(e){return e&&e.__esModule?e:{default:e}}var i={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},a=["icloud.com","me.com"],s=["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"],l=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],u=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function c(e){return e.length>1?e:""}function d(e,t){t=(0,n.default)(t,i);var r=e.split("@"),o=r.pop(),d=[r.join("@"),o];if(d[1]=d[1].toLowerCase(),"gmail.com"===d[1]||"googlemail.com"===d[1]){if(t.gmail_remove_subaddress&&(d[0]=d[0].split("+")[0]),t.gmail_remove_dots&&(d[0]=d[0].replace(/\.+/g,c)),!d[0].length)return!1;(t.all_lowercase||t.gmail_lowercase)&&(d[0]=d[0].toLowerCase()),d[1]=t.gmail_convert_googlemaildotcom?"gmail.com":d[1]}else if(a.indexOf(d[1])>=0){if(t.icloud_remove_subaddress&&(d[0]=d[0].split("+")[0]),!d[0].length)return!1;(t.all_lowercase||t.icloud_lowercase)&&(d[0]=d[0].toLowerCase())}else if(s.indexOf(d[1])>=0){if(t.outlookdotcom_remove_subaddress&&(d[0]=d[0].split("+")[0]),!d[0].length)return!1;(t.all_lowercase||t.outlookdotcom_lowercase)&&(d[0]=d[0].toLowerCase())}else if(l.indexOf(d[1])>=0){if(t.yahoo_remove_subaddress){var f=d[0].split("-");d[0]=f.length>1?f.slice(0,-1).join("-"):f[0]}if(!d[0].length)return!1;(t.all_lowercase||t.yahoo_lowercase)&&(d[0]=d[0].toLowerCase())}else u.indexOf(d[1])>=0?((t.all_lowercase||t.yandex_lowercase)&&(d[0]=d[0].toLowerCase()),d[1]="yandex.ru"):t.all_lowercase&&(d[0]=d[0].toLowerCase());return d.join("@")}e.exports=t.default,e.exports.default=t.default},91385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(r(79922)),o=i(r(60091));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){(0,n.default)(e);var t=e.split(".");return 3===t.length&&t.reduce(function(e,t){return e&&(0,o.default)(t,{urlSafe:!0})},!0)}e.exports=t.default,e.exports.default=t.default},91428:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=/^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/;function a(e){if((0,n.default)(e),!i.test(e))return!1;for(var t=0,r=0;r{"use strict";let n=r(26189);e.exports=(e,t,r)=>0>n(e,t,r)},91925:e=>{"use strict";e.exports=Math.floor},92178:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(r(79922)),o=i(r(83637));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return(0,n.default)(e),(0,o.default)(e)%parseInt(t,10)==0}e.exports=t.default,e.exports.default=t.default},92349:(e,t,r)=>{"use strict";n={value:!0};var n=n=n=t.Nk=n=n=n=n=n=n=void 0,o=h(r(59748)),i=h(r(80124)),a=h(r(1956)),s=h(r(43232)),l=h(r(72643)),u=h(r(46440)),c=h(r(78805)),d=h(r(26882)),f=h(r(20970)),p=h(r(47967));function h(e){return e&&e.__esModule?e:{default:e}}n=o.default,n=i.default,n=a.default,n=s.default,n=l.default,n=u.default,t.Nk=c.default,n=d.default,n=f.default,n=p.default,n={Link:o.default,Button:i.default,Element:a.default,scroller:s.default,Events:l.default,scrollSpy:u.default,animateScroll:c.default,ScrollLink:d.default,ScrollElement:f.default,Helpers:p.default}},92572:(e,t,r)=>{var n=r(51642),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},92648:(e,t,r)=>{"use strict";let n=r(26189);e.exports=(e,t,r)=>0===n(e,t,r)},92709:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},92781:(e,t,r)=>{var n=r(92572).Buffer,o=r(15618),i=r(3347),a=r(46994),s=r(21175),l=r(84864),u=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function c(e){return"[object Object]"===Object.prototype.toString.call(e)}function d(e){if(c(e))return e;try{return JSON.parse(e)}catch(e){return}}function f(e){var t=e.split(".",1)[0];return d(n.from(t,"base64").toString("binary"))}function p(e){return e.split(".",2).join(".")}function h(e){return e.split(".")[2]}function m(e,t){t=t||"utf8";var r=e.split(".")[1];return n.from(r,"base64").toString(t)}function g(e){return u.test(e)&&!!f(e)}function y(e,t,r){if(!t){var n=Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}var o=h(e=s(e)),a=p(e);return i(t).verify(a,o,r)}function v(e,t){if(t=t||{},!g(e=s(e)))return null;var r=f(e);if(!r)return null;var n=m(e);return("JWT"===r.typ||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:h(e)}}function b(e){var t=new o((e=e||{}).secret||e.publicKey||e.key);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=t,this.signature=new o(e.signature),this.secret.once("close",(function(){!this.signature.writable&&this.readable&&this.verify()}).bind(this)),this.signature.once("close",(function(){!this.secret.writable&&this.readable&&this.verify()}).bind(this))}l.inherits(b,a),b.prototype.verify=function(){try{var e=y(this.signature.buffer,this.algorithm,this.key.buffer),t=v(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},b.decode=v,b.isValid=g,b.verify=y,e.exports=b},92946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return(0,n.default)(e),parseInt(e,t||10)}e.exports=t.default,e.exports.default=t.default},93563:(e,t)=>{"use strict";function r(e){for(var t=10,r=0;r=0;n--){if(r){var o=2*parseInt(e[n],10);o>9?t+=o.toString().split("").map(function(e){return parseInt(e,10)}).reduce(function(e,t){return e+t},0):t+=o}else t+=parseInt(e[n],10);r=!r}return t%10==0}function o(e,t){for(var r=0,n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i={"cs-CZ":function(e){return/^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(e)},"de-DE":function(e){return/^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÜ|ÜB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÜ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÜD|BUL|BÜR|BÜS|BÜZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÜW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÖ|FOR|FRG|FRI|FRW|FTL|FÜS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÜ|HOG|HOH|HOL|HOM|HOR|HÖS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÜL|KEH|KEL|KEM|KIB|KLE|KLZ|KÖN|KÖT|KÖZ|KRU|KÜN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÖB|LOS|LRO|LSZ|LÜN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(e)},"de-LI":function(e){return/^FL[- ]?\d{1,5}[UZ]?$/.test(e)},"en-IN":function(e){return/^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(e)},"es-AR":function(e){return/^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(e)},"fi-FI":function(e){return/^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(e)},"hu-HU":function(e){return/^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(e)},"pt-BR":function(e){return/^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(e)},"pt-PT":function(e){return/^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(e)},"sq-AL":function(e){return/^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(e)},"sv-SE":function(e){return/^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(e.trim())},"en-PK":function(e){return/(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(e.trim())}};function a(e,t){if((0,n.default)(e),t in i)return i[t](e);if("any"===t){for(var r in i)if((0,i[r])(e))return!0;return!1}throw Error("Invalid locale '".concat(t,"'"))}e.exports=t.default,e.exports.default=t.default},94762:(e,t,r)=>{"use strict";let n=r(92648),o=r(84426),i=r(44689),a=r(50736),s=r(91526),l=r(72925);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return o(e,r,u);case">":return i(e,r,u);case">=":return a(e,r,u);case"<":return s(e,r,u);case"<=":return l(e,r,u);default:throw TypeError(`Invalid operator: ${t}`)}}},95185:e=>{"use strict";e.exports=Function.prototype.call},95232:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>ij,h1:()=>iN});let n={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[047]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[24-689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]]],BL:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-2])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-79]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","10(?:10|9[56])|2[0-57-9](?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0(4(?:[14]4|56)|[579])?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["5"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[189]"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0-579])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-2]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","[56]94\\d{6}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[56]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1289]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-2])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([3-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","9008\\d{3}|(?:[2-467]\\d\\d|862)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-46-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|(?:[235-8]\\d|99)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[25]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29[1289]|389)","529(?:1[1-46-9]|2[013-8]|90)|5(?:298|389)[0-46-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5293[01]\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|9[0-289])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[0189]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[017]\\d|2[0-2]|6[0-8]|8[0-3]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-2])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","596\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:[27]2|44|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[047]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[29]\\d{7,9}|50\\d{5}(?:\\d{2,3})?|6[0-35-9]\\d{6}|7\\d{7,8}|8\\d{4,9}|(?:11\\d|[34])\\d{7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-579]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|[89]0","50(?:[0367]|88)|[89]0"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[59]|80"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7|86"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|80\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-3]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:0[0-46]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|6[0-6]|7[0-27]|8[0-8]|9[0-479]))|9(?:399[0-3]|479[0-2]|76(?:2[27]|3[0-37]|9\\d)))\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,0,["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[2378]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-6]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|[57]9)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3478]|64|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["5056(?:[0-35-9]\\d|4[46])\\d{4}|(?:4722|505[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[0-2]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","(?:0004|4)\\d{9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10,13],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","(?:33|[5-79]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[35-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[69]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3578]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:(?:(?:26|63)9|80\\d)\\d|9398)\\d{5}",[9],0,"0",0,0,0,0,"269|63|9398"],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[013-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);ra)return 1;if(a>i)return -1;if(!isNaN(i)&&isNaN(a))return 1;if(isNaN(i)&&!isNaN(a))return -1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]=g&&eg.test(e)}function ev(e){return em.test(e)}var eb=RegExp("(?:"+ef()+")$","i");function e_(e){var t=e.search(eb);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(eb),o=1;o=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ew(e,t){if(e){if("string"==typeof e)return eS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eS(e,t)}}function eS(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ek(e,t){if(e){if("string"==typeof e)return eI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eI(e,t)}}function eI(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function eR(e,t){if(e){if("string"==typeof e)return ej(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ej(e,t)}}function ej(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.indexOf(i)&&n.push(i)}return n.sort(function(e,t){return e-t})}function eM(e,t){return eL(e,void 0,t)}function eL(e,t,r){var n=r.type(t),o=n&&n.possibleLengths()||r.possibleLengths();if(!o)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===t){if(!r.type("FIXED_LINE"))return eL(e,"MOBILE",r);var i=r.type("MOBILE");i&&(o=eN(o,i.possibleLengths()))}else if(t&&!n)return"INVALID_LENGTH";var a=e.length,s=o[0];return s===a?"IS_POSSIBLE":s>a?"TOO_SHORT":o[o.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function eD(e,t,r){if(void 0===t&&(t={}),r=new X(r),t.v2){if(!e.countryCallingCode)throw Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)throw Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return eB(e.phone||e.nationalNumber,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function eB(e,t){return"IS_POSSIBLE"===eM(e,t)}function eF(e,t){return e=e||"",RegExp("^(?:"+t+")$").test(e)}function eU(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=eZ(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function eZ(e,t){if(e){if("string"==typeof e)return eY(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eY(e,t)}}function eY(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rt.possibleLengths().indexOf(e.length))&&eF(e,t.pattern())}function eW(e,t,r){return(t=t||{},(r=new X(r)).selectNumberingPlan(e.country,e.countryCallingCode),r.hasTypes())?void 0!==eq(e,t,r.metadata):eF(t.v2?e.nationalNumber:e.phone,r.nationalNumberPattern())}function eK(e,t,r){var n=new X(r).getCountryCodesForCallingCode(e);return n?n.filter(function(e){return eV(t,e,r)}):[]}function eV(e,t,r){var n=new X(r);return n.selectNumberingPlan(t),n.numberingPlan.possibleLengths().indexOf(e.length)>=0}function ez(e){return e.replace(RegExp("[".concat(A,"]+"),"g")," ").trim()}var eJ=/(\$\d)/;function eX(e,t,r){var n=r.useInternationalFormat,o=r.withNationalPrefix;r.carrierCode,r.metadata;var i=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():o&&t.nationalPrefixFormattingRule()?t.format().replace(eJ,t.nationalPrefixFormattingRule()):t.format());return n?ez(i):i}var eQ=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function e0(e,t,r){var n=new X(r);return(n.selectNumberingPlan(e,t),n.defaultIDDPrefix())?n.defaultIDDPrefix():eQ.test(n.IDDPrefix())?n.IDDPrefix():void 0}function e1(e){var t=e.number,r=e.ext;if(!t)return"";if("+"!==t[0])throw Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(r?";ext="+r:"")}function e2(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=e3(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e3(e,t){if(e){if("string"==typeof e)return e9(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e9(e,t)}}function e9(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0){var i=o.leadingDigitsPatterns()[o.leadingDigitsPatterns().length-1];if(0!==t.search(i))continue}if(eF(t,o.pattern()))return o}}function tr(e,t,r,n){return t?n(e,t,r):e}function tn(e,t,r,n,o){if(es(n,o.metadata)===r){var i=te(e,t,"NATIONAL",o);return"1"===r?r+" "+i:i}var a=e0(n,void 0,o.metadata);if(a)return"".concat(a," ").concat(r," ").concat(te(e,null,"INTERNATIONAL",o))}function to(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ti(e){for(var t=1;t0)||"0"!==a[1])return e}}}function tg(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var o,i,a,s=n.length-1,l=s>0&&n[s];if(t.nationalPrefixTransformRule()&&l)o=e.replace(r,t.nationalPrefixTransformRule()),s>1&&(i=n[1]);else{var u=n[0];o=e.slice(u.length),l&&(i=n[1])}if(l){var c=e.indexOf(n[1]);e.slice(0,c)===t.numberingPlan.nationalPrefix()&&(a=t.numberingPlan.nationalPrefix())}else a=n[0];return{nationalNumber:o,nationalPrefix:a,carrierCode:i}}}return{nationalNumber:e}}function ty(e,t){var r=tg(e,t),n=r.carrierCode,o=r.nationalNumber;return o!==e&&(!tv(e,o,t)||t.possibleLengths()&&!tb(o,t))?{nationalNumber:e}:{nationalNumber:o,carrierCode:n}}function tv(e,t,r){return!eF(e,r.nationalNumberPattern())||!!eF(t,r.nationalNumberPattern())}function tb(e,t){switch(eM(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function t_(e,t,r,n){var o=t?es(t,n):r;if(0===e.indexOf(o)){(n=new X(n)).selectNumberingPlan(t,r);var i=e.slice(o.length),a=ty(i,n).nationalNumber,s=ty(e,n).nationalNumber;if(!eF(s,n.nationalNumberPattern())&&eF(a,n.nationalNumberPattern())||"TOO_LONG"===eM(s,n))return{countryCallingCode:o,number:i}}return{number:e}}function t$(e,t,r,n){if(!e)return{};if("+"!==e[0]){var o,i=tm(e,t,r,n);if(i&&i!==e)o=!0,e="+"+i;else{if(t||r){var a=t_(e,t,r,n),s=a.countryCallingCode,l=a.number;if(s)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:s,number:l}}return{number:e}}}if("0"===e[1])return{};n=new X(n);for(var u=2;u-1<=v&&u<=e.length;){var c=e.slice(1,u);if(n.hasCallingCode(c))return n.selectNumberingPlan(c),{countryCallingCodeSource:o?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:c,number:e.slice(u)};u++}return{}}function tw(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=tS(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function tS(e,t){if(e){if("string"==typeof e)return tE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tE(e,t)}}function tE(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0)return a[0]}var tA=!1;function tO(e,t){var r=t.nationalNumber,n=t.defaultCountry,o=t.metadata;if(tA&&o.isNonGeographicCallingCode(e))return"001";var i=o.getCountryCodesForCallingCode(e);if(i)return 1===i.length?i[0]:tx(r,{countries:i,defaultCountry:n,metadata:o.metadata})}var tk="+",tI="(["+b+"]|[\\-\\.\\(\\)]?)",tC=RegExp("^\\"+tk+tI+"*["+b+"]"+tI+"*$","g"),tT=b,tP=RegExp("^("+("["+tT+"]+((\\-)*["+tT)+"])*\\.)*"+("[a-zA-Z]+((\\-)*["+tT)+"])*\\.?$","g"),tR="tel:",tj=";phone-context=",tN=";isub=";function tM(e){var t=e.indexOf(tj);if(t<0)return null;var r=t+tj.length;if(r>=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}function tL(e){return null===e||0!==e.length&&(tC.test(e)||tP.test(e))}function tD(e,t){var r=t.extractFormattedPhoneNumber,n=tM(e);if(!tL(n))throw new Z("NOT_A_NUMBER");if(null===n)o=r(e)||"";else{o="",n.charAt(0)===tk&&(o+=n);var o,i,a=e.indexOf(tR);i=a>=0?a+tR.length:0;var s=e.indexOf(tj);o+=e.substring(i,s)}var l=o.indexOf(tN);if(l>0&&(o=o.substring(0,l)),""!==o)return o}var tB=250,tF=RegExp("["+O+b+"]"),tU=RegExp("[^"+b+"#]+$"),tZ=!1;function tY(e,t,r){if(t=t||{},r=new X(r),t.defaultCountry&&!r.hasCountry(t.defaultCountry)){if(t.v2)throw new Z("INVALID_COUNTRY");throw Error("Unknown country: ".concat(t.defaultCountry))}var n=tq(e,t.v2,t.extract),o=n.number,i=n.ext,a=n.error;if(!o){if(t.v2){if("TOO_SHORT"===a)throw new Z("TOO_SHORT");throw new Z("NOT_A_NUMBER")}return{}}var s=tW(o,t.defaultCountry,t.defaultCallingCode,r),l=s.country,u=s.nationalNumber,c=s.countryCallingCode,d=s.countryCallingCodeSource,f=s.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new Z("INVALID_COUNTRY");return{}}if(!u||u.lengthy){if(t.v2)throw new Z("TOO_LONG");return{}}if(t.v2){var p=new td(c,u,r.metadata);return l&&(p.country=l),f&&(p.carrierCode=f),i&&(p.ext=i),p.__countryCallingCodeSource=d,p}var h=(t.extended?!!r.hasSelectedNumberingPlan():!!l)&&eF(u,r.nationalNumberPattern());return t.extended?{country:l,countryCallingCode:c,carrierCode:f,valid:h,possible:!!h||!!(!0===t.extended&&r.possibleLengths()&&eB(u,r)),phone:u,ext:i}:h?tG(l,u,i):{}}function tH(e,t,r){if(e){if(e.length>tB){if(r)throw new Z("TOO_LONG");return}if(!1===t)return e;var n=e.search(tF);if(!(n<0))return e.slice(n).replace(tU,"")}}function tq(e,t,r){var n=tD(e,{extractFormattedPhoneNumber:function(e){return tH(e,r,t)}});if(!n)return{};if(!ey(n))return ev(n)?{error:"TOO_SHORT"}:{};var o=e_(n);return o.ext?o:{number:n}}function tG(e,t,r){var n={country:e,phone:t};return r&&(n.ext=r),n}function tW(e,t,r,n){var o,i=t$(eC(e),t,r,n.metadata),a=i.countryCallingCodeSource,s=i.countryCallingCode,l=i.number;if(s)n.selectNumberingPlan(s);else{if(!l||!t&&!r)return{};n.selectNumberingPlan(t,r),t?o=t:tZ&&n.isNonGeographicCallingCode(r)&&(o="001"),s=r||es(t,n.metadata)}if(!l)return{countryCallingCodeSource:a,countryCallingCode:s};var u=ty(eC(l),n),c=u.nationalNumber,d=u.carrierCode,f=tO(s,{nationalNumber:c,defaultCountry:t,metadata:n});return f&&(o=f,"001"===f||n.country(o)),{country:o,countryCallingCode:s,countryCallingCodeSource:a,nationalNumber:c,carrierCode:d}}function tK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function tV(e){for(var t=1;t0&&(e=e.slice(0,t-1)+e.slice(t),t--);break;case"Delete":e=e.slice(0,t)+e.slice(t+1)}return{value:e,caret:t}}function rn(e,t,r){for(var n={},o="",i=0,a=0;aa&&(i=o.length))),a++}return void 0===t&&(i=o.length),{value:o,caret:i}}function ro(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=ri(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ri(e,t){if(e){if("string"==typeof e)return ra(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ra(e,t)}}function ra(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2&&void 0!==arguments[2]?arguments[2]:"x",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:" ",o=e.length,i=rs("(",e)-rs(")",e);i>0&&o=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function rc(e,t){if(e){if("string"==typeof e)return rd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rd(e,t)}}function rd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:"x",r=arguments.length>2?arguments[2]:void 0;if(!e)return function(e){return{text:e}};var n=rs(t,e);return function(o){if(!o)return{text:"",template:e};for(var i,a=0,s="",l=ru(e.split(""));!(i=l()).done;){var u=i.value;if(u!==t){s+=u;continue}if(s+=o[a],++a===o.length&&o.length=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function rT(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}function rP(e){var t=e.ref,r=e.parse,n=e.format,o=e.value,i=e.defaultValue,a=e.controlled,s=void 0===a||a,l=e.onChange,u=e.onKeyDown,c=rC(e,rA),d=(0,t8.useRef)(),f=(0,t8.useCallback)(function(e){d.current=e,t&&("function"==typeof t?t(e):t.current=e)},[t]),p=(0,t8.useCallback)(function(e){return rw(e,d.current,r,n,l)},[d,r,n,l]),h=(0,t8.useCallback)(function(e){if(u&&u(e),!e.defaultPrevented)return rS(e,d.current,r,n,l)},[d,r,n,l,u]),m=rk(rk({},c),{},{ref:f,onChange:p,onKeyDown:h});return s?rk(rk({},m),{},{value:n(rR(o)?"":o).text}):rk(rk({},m),{},{defaultValue:n(rR(i)?"":i).text})}function rR(e){return null==e}var rj=["inputComponent","parse","format","value","defaultValue","onChange","controlled","onKeyDown","type"];function rN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function rM(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function rB(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}function rF(e,t){var r=e.inputComponent,n=void 0===r?"input":r,o=e.parse,i=e.format,a=e.value,s=e.defaultValue,l=e.onChange,u=e.controlled,c=e.onKeyDown,d=e.type,f=rP(rM({ref:t,parse:o,format:i,value:a,defaultValue:s,onChange:l,controlled:u,onKeyDown:c,type:void 0===d?"text":d},rD(e,rj)));return t8.createElement(n,f)}(rF=t8.forwardRef(rF)).propTypes={parse:t5.func.isRequired,format:t5.func.isRequired,inputComponent:t5.elementType,type:t5.string,value:t5.string,defaultValue:t5.string,onChange:t5.func,controlled:t5.bool,onKeyDown:t5.func,onCut:t5.func,onPaste:t5.func};let rU=rF;function rZ(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function rY(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function rW(e,t){if(e){if("string"==typeof e)return rK(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rK(e,t)}}function rK(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1;)1&t&&(r+=e),t>>=1,e+=e;return r+e}function rX(e,t){return")"===e[t]&&t++,rQ(e.slice(0,t))}function rQ(e){for(var t=[],r=0;re.slice(t+1).search(rz))return;t=e.search(rz),e=e.replace(rz,i)}return[e,t]}function r1(e,t,r){var n=r.metadata,o=r.shouldTryNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return r3(e,t,{metadata:n,shouldTryNationalPrefixFormattingRule:o,getSeparatorAfterNationalPrefix:i})}function r2(e,t){return"IS_POSSIBLE"===eM(e,t)}function r3(e,t,r){var n=r.metadata,o=r.shouldTryNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix;if(e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode,o(t)){var a=r9(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:i,metadata:n});if(a)return a}return r9(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:i,metadata:n})}function r9(e,t,r){var n=r.metadata,o=r.useNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix,a=eX(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:o,metadata:n});if(!o&&(e.nationalPrefix?a=e.nationalPrefix+i(t)+a:e.complexPrefixBeforeNationalSignificantNumber&&(a=e.complexPrefixBeforeNationalSignificantNumber+" "+a)),r4(a,e))return a}function r4(e,t){return eA(e)===t.getNationalDigits()}function r8(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function r6(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ni(e,t){if(e){if("string"==typeof e)return na(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return na(e,t)}}function na(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=t.allowOverflow;if(!e)throw Error("String is required");var n=nd(e.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||r)return n}}]),e}();function nd(e,t,r){if("string"==typeof t){var n=e.join("");return 0===t.indexOf(n)?e.length===t.length?{match:!0,matchedChars:e}:{partialMatch:!0}:0===n.indexOf(t)?r&&e.length>t.length?{overflow:!0}:{match:!0,matchedChars:e.slice(0,t.length)}:void 0}if(Array.isArray(t)){for(var o=e.slice(),i=0;i=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function np(e,t){if(e){if("string"==typeof e)return nh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nh(e,t)}}function nh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0)){var r=this.getTemplateForFormat(e,t);if(r)return this.setNationalNumberTemplate(r,t),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(e){return this.isNANP||e&&e.nationalPrefixFormattingRule()&&n_.test(e.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(e,t){var r=e.IDDPrefix,n=e.missingPlus;return r?t&&!1===t.spacing?r:r+" ":n?"":"+"}},{key:"getTemplate",value:function(e){if(this.template){for(var t=-1,r=0,n=e.international?this.getInternationalPrefixBeforeCountryCallingCode(e,{spacing:!1}):"";rl.length)){var u=RegExp("^"+s+"$"),c=n.replace(/\d/g,nv);u.test(c)&&(l=c);var d=this.getFormatFormat(e,o);if(this.shouldTryNationalPrefixFormattingRule(e,{international:o,nationalPrefix:i})){var f=d.replace(eJ,e.nationalPrefixFormattingRule());if(eA(e.nationalPrefixFormattingRule())===(i||"")+eA("$1")&&(d=f,r=!0,i))for(var p=i.length;p>0;)d=d.replace(/\d/,rV),p--}var h=l.replace(new RegExp(s),d).replace(RegExp(nv,"g"),rV);return!r&&(a?h=rJ(rV,a.length)+" "+h:i&&(h=rJ(rV,i.length)+this.getSeparatorAfterNationalPrefix(e)+h)),o&&(h=ez(h)),h}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=r0(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);return t?(this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],rX(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)):void this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(e,t){var r=t.international,n=t.nationalPrefix;if(e.nationalPrefixFormattingRule()){var o=e.usesNationalPrefix();if(o&&n||!o&&!r)return!0}}}]),e}();function nO(e,t){return nP(e)||nT(e,t)||nI(e,t)||nk()}function nk(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nI(e,t){if(e){if("string"==typeof e)return nC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nC(e,t)}}function nC(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=3;if(t.appendDigits(e),n&&this.extractIddPrefix(t),this.isWaitingForCountryCallingCode(t)){if(!this.extractCountryCallingCode(t))return}else t.appendNationalSignificantNumberDigits(e);t.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(t.getNationalDigits(),function(e){return t.update(e)})}},{key:"isWaitingForCountryCallingCode",value:function(e){var t=e.international,r=e.callingCode;return t&&!r}},{key:"extractCountryCallingCode",value:function(e){var t=t$("+"+e.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode,n=t.number;if(r)return e.setCallingCode(r),e.update({nationalSignificantNumber:n}),!0}},{key:"reset",value:function(e){if(e){this.hasSelectedNumberingPlan=!0;var t=e._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=t&&nB.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var r=tg(e,this.metadata),n=r.nationalPrefix,o=r.nationalNumber,i=r.carrierCode;if(o!==e)return this.onExtractedNationalNumber(n,i,o,e,t),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(e,t,r){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,r);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var n=tg(e,this.metadata),o=n.nationalPrefix,i=n.nationalNumber,a=n.carrierCode;if(i!==t)return this.onExtractedNationalNumber(o,a,i,e,r),!0}}},{key:"onExtractedNationalNumber",value:function(e,t,r,n,o){var i,a,s=n.lastIndexOf(r);if(s>=0&&s===n.length-r.length){a=!0;var l=n.slice(0,s);l!==e&&(i=l)}o({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:r,nationalSignificantNumberMatchesInput:a,complexPrefixBeforeNationalSignificantNumber:i}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(e){return!!this.extractAnotherNationalSignificantNumber(e.getNationalDigits(),e.nationalSignificantNumber,function(t){return e.update(t)})||(this.extractIddPrefix(e)||this.fixMissingPlus(e)?(this.extractCallingCodeAndNationalSignificantNumber(e),!0):void 0)}},{key:"extractIddPrefix",value:function(e){var t=e.international,r=e.IDDPrefix,n=e.digits;if(e.nationalSignificantNumber,!t&&!r){var o=tm(n,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(void 0!==o&&o!==n)return e.update({IDDPrefix:n.slice(0,n.length-o.length)}),this.startInternationalNumber(e,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(e){if(!e.international){var t=t_(e.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode;if(t.number,r)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:r}),!0}}},{key:"startInternationalNumber",value:function(e,t){var r=t.country,n=t.callingCode;e.startInternationalNumber(r,n),e.nationalSignificantNumber&&(e.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(e){this.extractCountryCallingCode(e)&&this.extractNationalSignificantNumber(e.getNationalDigits(),function(t){return e.update(t)})}}]),e}();function nU(e){var t,r=e.search(nL);if(!(r<0))return"+"===(e=e.slice(r))[0]&&(t=!0,e=e.slice(1)),e=e.replace(nD,""),t&&(e="+"+e),e}function nZ(e){var t=nU(e)||"";return"+"===t[0]?[t.slice(1),!0]:[t]}function nY(e){var t=nO(nZ(e),2),r=t[0],n=t[1];return nM.test(r)||(r=""),[r,n]}function nH(e){return(nH="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nq(e,t){return nz(e)||nV(e,t)||nW(e,t)||nG()}function nG(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function nW(e,t){if(e){if("string"==typeof e)return nK(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nK(e,t)}}function nK(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1}},{key:"determineTheCountry",value:function(){this.state.setCountry(tO(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var e=this.state,t=e.digits,r=e.callingCode,n=e.country,o=e.nationalSignificantNumber;if(t){if(this.isInternational())if(r)return"+"+r+o;else return"+"+t;else if(n||r)return"+"+(n?this.metadata.countryCallingCode():r)+o}}},{key:"getNumber",value:function(){var e=this.state,t=e.nationalSignificantNumber,r=e.carrierCode,n=e.callingCode,o=this._getCountry();if(t&&(o||n)){if(o&&o===this.defaultCountry){var i=new X(this.metadata.metadata);i.selectNumberingPlan(o);var a=i.numberingPlan.callingCode(),s=this.metadata.getCountryCodesForCallingCode(a);if(s.length>1){var l=tx(t,{countries:s,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});l&&(o=l)}}var u=new td(o||n,t,this.metadata.metadata);return r&&(u.carrierCode=r),u}}},{key:"isPossible",value:function(){var e=this.getNumber();return!!e&&e.isPossible()}},{key:"isValid",value:function(){var e=this.getNumber();return!!e&&e.isValid()}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}]),e}();function n2(e){var t=e.country,r=e.international,n=e.withCountryCallingCode,o=e.metadata;return t&&r&&!n?"+".concat(es(t,o)):""}function n3(e,t){return t&&" "===(e=e.slice(t.length))[0]&&(e=e.slice(1)),e}var n9=["country","international","withCountryCallingCode","metadata"];function n4(){return(n4=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function n6(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}let n5=function(e){function t(e,t){var r=e.country,n=e.international,o=e.withCountryCallingCode,i=e.metadata,a=n8(e,n9),s=(0,t8.useCallback)(function(e){var t=new n1(r,i),a=n2({country:r,international:n,withCountryCallingCode:o,metadata:i}),s=t.input(a+e),l=t.getTemplate();return a&&(s=n3(s,a),l&&(l=n3(l,a))),{text:s,template:l}},[r,i]);return t8.createElement(rU,n4({},a,{ref:t,parse:eT,format:s}))}return(t=t8.forwardRef(t)).propTypes={value:t5.string.isRequired,onChange:t5.func.isRequired,country:t5.string,international:t5.bool,withCountryCallingCode:t5.bool,metadata:t5.object.isRequired},t.defaultProps={metadata:void 0},t}();function n7(e,t,r){return r||(r=t,t=void 0),new n1(t,r).input(e)}var oe=["value","onChange","country","international","withCountryCallingCode","metadata","inputComponent"];function ot(){return(ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function on(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}let oo=function(e){function t(e,t){var r=e.value,n=e.onChange,o=e.country,i=e.international,a=e.withCountryCallingCode,s=e.metadata,l=e.inputComponent,u=or(e,oe),c=n2({country:o,international:i,withCountryCallingCode:a,metadata:s}),d=(0,t8.useCallback)(function(e){var t=eC(e.target.value);t===r&&0===oi(c,t,o,s).indexOf(e.target.value)&&(t=t.slice(0,-1)),n(t)},[c,r,n,o,s]);return t8.createElement(l,ot({},u,{ref:t,value:oi(c,r,o,s),onChange:d}))}return(t=t8.forwardRef(t)).propTypes={value:t5.string.isRequired,onChange:t5.func.isRequired,country:t5.string,international:t5.bool,withCountryCallingCode:t5.bool,metadata:t5.object.isRequired,inputComponent:t5.elementType.isRequired},t.defaultProps={metadata:void 0,inputComponent:"input"},t}();function oi(e,t,r,n){return n3(n7(e+t,r,n),e)}function oa(e){return os(e[0])+os(e[1])}function os(e){return String.fromCodePoint(127397+e.toUpperCase().charCodeAt(0))}var ol=["value","onChange","options"],ou=["value","options","className","iconComponent","getIconAspectRatio","arrowComponent","unicodeFlags"];function oc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=od(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function od(e,t){if(e){if("string"==typeof e)return of(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return of(e,t)}}function of(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function om(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}function og(e){var t=e.value,r=e.onChange,n=e.options,o=oh(e,ol),i=(0,t8.useCallback)(function(e){var t=e.target.value;r("ZZ"===t?void 0:t)},[r]);return(0,t8.useMemo)(function(){return ob(n,t)},[n,t]),t8.createElement("select",op({},o,{value:t||"ZZ",onChange:i}),n.map(function(e){var t=e.value,r=e.label,n=e.divider;return t8.createElement("option",{key:n?"|":t||"ZZ",value:n?"|":t||"ZZ",disabled:!!n,style:n?oy:void 0},r)}))}og.propTypes={value:t5.string,onChange:t5.func.isRequired,options:t5.arrayOf(t5.shape({value:t5.string,label:t5.string,divider:t5.bool})).isRequired};var oy={fontSize:"1px",backgroundColor:"currentColor",color:"inherit"};function ov(e){var t=e.value,r=e.options,n=e.className,o=e.iconComponent,i=(e.getIconAspectRatio,e.arrowComponent),a=e.unicodeFlags,s=oh(e,ou),l=(0,t8.useMemo)(function(){return ob(r,t)},[r,t]);return t8.createElement("div",{className:"PhoneInputCountry"},t8.createElement(og,op({},s,{value:t,options:r,className:rt("PhoneInputCountrySelect",n)})),a&&t&&t8.createElement("div",{className:"PhoneInputCountryIconUnicode"},oa(t)),!(a&&t)&&t8.createElement(o,{"aria-hidden":!0,country:t,label:l&&l.label,aspectRatio:a?1:void 0}),t8.createElement(i,null))}function ob(e,t){for(var r,n=oc(e);!(r=n()).done;){var o=r.value;if(!o.divider&&o.value===t)return o}}ov.propTypes={iconComponent:t5.elementType,arrowComponent:t5.elementType.isRequired,unicodeFlags:t5.bool},ov.defaultProps={arrowComponent:function(){return t8.createElement("div",{className:"PhoneInputCountrySelectArrow"})}};var o_=["country","countryName","flags","flagUrl"];function o$(){return(o$=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function oS(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}function oE(e){var t=e.country,r=e.countryName,n=e.flags,o=e.flagUrl,i=ow(e,o_);return n&&n[t]?n[t]({title:r}):t8.createElement("img",o$({},i,{alt:r,role:r?void 0:"presentation",src:o.replace("{XX}",t).replace("{xx}",t.toLowerCase())}))}oE.propTypes={country:t5.string.isRequired,countryName:t5.string.isRequired,flags:t5.objectOf(t5.elementType),flagUrl:t5.string.isRequired};var ox=["aspectRatio"],oA=["title"],oO=["title"];function ok(){return(ok=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function oC(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}function oT(e){var t=e.aspectRatio,r=oI(e,ox);return 1===t?t8.createElement(oR,r):t8.createElement(oP,r)}function oP(e){var t=e.title,r=oI(e,oA);return t8.createElement("svg",ok({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 50"}),t8.createElement("title",null,t),t8.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeMiterlimit:"10"},t8.createElement("path",{strokeLinecap:"round",d:"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3"}),t8.createElement("path",{d:"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3"}),t8.createElement("line",{x1:"26",y1:"25",x2:"74",y2:"25"}),t8.createElement("line",{x1:"50",y1:"1",x2:"50",y2:"49"}),t8.createElement("path",{strokeLinecap:"round",d:"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8"}),t8.createElement("path",{strokeLinecap:"round",d:"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2"})),t8.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"none",fill:"currentColor",d:"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z"}))}function oR(e){var t=e.title,r=oI(e,oO);return t8.createElement("svg",ok({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"}),t8.createElement("title",null,t),t8.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round"},t8.createElement("path",{d:"M8.45,13A21.44,21.44,0,1,1,37.08,41.56"}),t8.createElement("path",{d:"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21"}),t8.createElement("path",{d:"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86"}),t8.createElement("path",{d:"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54"}),t8.createElement("line",{x1:"27.8",y1:"0.85",x2:"27.8",y2:"34.61"}),t8.createElement("line",{x1:"15.2",y1:"22.23",x2:"49.15",y2:"22.23"})),t8.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"transparent",fill:"currentColor",d:"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z"}))}function oj(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=oN(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function oN(e,t){if(e){if("string"==typeof e)return oM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oM(e,t)}}function oM(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0)return e}function oB(e,t){return!!el(e,t)||(console.error("Country not found: ".concat(e)),!1)}function oF(e,t){return e&&0===(e=e.filter(function(e){return oB(e,t)})).length&&(e=void 0),e}function oU(e){return new X(e).getCountries()}oT.propTypes={title:t5.string.isRequired,aspectRatio:t5.number},oP.propTypes={title:t5.string.isRequired},oR.propTypes={title:t5.string.isRequired};var oZ=["country","label","aspectRatio"];function oY(){return(oY=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function oq(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}function oG(e){var t=e.flags,r=e.flagUrl,n=e.flagComponent,o=e.internationalIcon;function i(e){var i=e.country,a=e.label,s=e.aspectRatio,l=oH(e,oZ),u=o===oT?s:void 0;return t8.createElement("div",oY({},l,{className:rt("PhoneInputCountryIcon",{"PhoneInputCountryIcon--square":1===u,"PhoneInputCountryIcon--border":i})}),i?t8.createElement(n,{country:i,countryName:a,flags:t,flagUrl:r,className:"PhoneInputCountryIconImg"}):t8.createElement(o,{title:a,aspectRatio:u,className:"PhoneInputCountryIconImg"}))}return i.propTypes={country:t5.string,label:t5.string.isRequired,aspectRatio:t5.number},i}function oW(){var e=h(arguments);return t1(e.text,e.options,e.metadata)}function oK(e,t){return"+"+es(e,t)}function oV(e){var t,r=e.value,n=e.phoneNumber,o=e.defaultCountry,i=e.getAnyCountry,a=e.countries,s=e.required,l=e.metadata;return n&&n.country?t=n.country:o&&(!r||ie(r,o,l))&&(t=o),a&&0>a.indexOf(t)&&(t=void 0),!t&&s&&a&&a.length>0&&(t=i()),t}function oz(e){var t=e.countries,r=e.countryNames,n=e.addInternationalOption,o=e.compareStringsLocales,i=e.compareStrings;i||(i=o6);var a=t.map(function(e){return{value:e,label:r[e]||e}});return a.sort(function(e,t){return i(e.label,t.label,o)}),n&&a.unshift({label:r.ZZ}),a}function oJ(e,t){return oW(e||"",t)}function oX(e){return e.formatNational().replace(/\D/g,"")}function oQ(e,t){var r=t.prevCountry,n=t.newCountry,o=t.metadata,i=t.useNationalFormat;if(r===n)return e;if(!e)if(i)return"";else return oK(n,o);if(n){if("+"===e[0]){if(i)return 0===e.indexOf("+"+es(n,o))?o5(e,n,o):"";if(r){var a=oK(n,o);if(0!==e.indexOf(a))return a}else{var s=oK(n,o);return 0===e.indexOf(s)?e:s}}}else if("+"!==e[0])return o0(e,r,o)||"";return e}function o0(e,t,r){if(e){if("+"===e[0]){if("+"===e)return;var n=new n1(t,r);return n.input(e),n.getNumberValue()}if(t){var o=o7(e,t,r);return"+".concat(es(t,r)).concat(o||"")}}}function o1(e,t,r){var n=o7(e,t,r);if(n){var o=n.length-o2(t,r);if(o>0)return e.slice(0,e.length-o)}return e}function o2(e,t){return(t=new X(t)).selectNumberingPlan(e),t.numberingPlan.possibleLengths()[t.numberingPlan.possibleLengths().length-1]}function o3(e,t){var r=t.country,n=t.countries,o=t.required,i=t.metadata;if("+"===e)return r;var a=o8(e,i);return a&&(!n||n.indexOf(a)>=0)?a:!r||o||ie(e,r,i)?r:void 0}function o9(e,t){var r,n=t.prevPhoneDigits,o=t.country,i=t.defaultCountry,a=t.countryRequired,s=t.getAnyCountry,l=t.countries,u=t.international,c=t.limitMaxLength,d=t.countryCallingCodeEditable,f=t.metadata;if(u&&!1===d){var p,h=oK(o,f);if(0!==e.indexOf(h))return e&&"+"!==e[0]?p=o0(e=h+e,o,f):e=h,{phoneDigits:e,value:p,country:o}}return!1===u&&o&&e&&"+"===e[0]&&(e=o4(e,o,f)),e&&o&&c&&(e=o1(e,o,f)),e&&"+"!==e[0]&&(!o||u)&&(e="+"+e),!e&&n&&"+"===n[0]&&(o=u?void 0:i),"+"===e&&n&&"+"===n[0]&&n.length>1&&(o=void 0),e&&(r="+"===e[0]&&("+"===e||o&&0===oK(o,f).indexOf(e))?void 0:o0(e,o,f)),r&&(o=o3(r,{country:o,countries:l,metadata:f}),!1===u&&o&&e&&"+"===e[0]&&(r=o0(e=o4(e,o,f),o,f))),!o&&a&&(o=i||s()),{phoneDigits:e,country:o,value:r}}function o4(e,t,r){if(0!==e.indexOf(oK(t,r)))return e.replace(/\D/g,"");var n=new n1(t,r);n.input(e);var o=n.getNumber();return o?o.formatNational().replace(/\D/g,""):""}function o8(e,t){var r=new n1(null,t);return r.input(e),r.getCountry()}function o6(e,t,r){return String.prototype.localeCompare?e.localeCompare(t,r):et)}function o5(e,t,r){if(t){var n="+"+es(t,r);if(e.length=0)&&(_=w.country):_=o3(a,{country:void 0,countries:S,metadata:n})}return a||($={hasUserSelectedACountry:void 0}),io(io({},$),{},{phoneDigits:g({phoneNumber:w,value:a,defaultCountry:i}),value:a,country:a?_:i})}}function is(e,t){return null===e&&(e=void 0),null===t&&(t=void 0),e===t}function il(e){return(il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}oG({flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",flagComponent:oE,internationalIcon:oT});var iu=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function ic(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function id(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function im(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}function ig(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function iy(e,t){for(var r=0;r{var n=r(33601);e.exports=r(77012).satisfies(n.version,">=15.7.0")},95586:(e,t,r)=>{"use strict";let n=r(2316);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},95605:(e,t,r)=>{"use strict";var n=r(14274),o=r(57379),i=r(95185);e.exports=r(7978)||n.call(i,o)},95669:(e,t,r)=>{e.exports=r(2483)},95736:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i=(0,o(r(58987)).default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");function a(e){return(0,n.default)(e),i.test(e)}e.exports=t.default,e.exports.default=t.default},95901:(e,t,r)=>{"use strict";r.d(t,{ER:()=>ti});var n,o,i,a,s,l,u,c,d,f,p,h,m,g,y="vercel.ai.error",v=Symbol.for(y),b=class e extends Error{constructor({name:e,message:t,cause:r}){super(t),this[n]=!0,this.name=e,this.cause=r}static isInstance(t){return e.hasMarker(t,y)}static hasMarker(e,t){let r=Symbol.for(t);return null!=e&&"object"==typeof e&&r in e&&"boolean"==typeof e[r]&&!0===e[r]}};n=v;var _=b,$="AI_APICallError",w=`vercel.ai.error.${$}`,S=Symbol.for(w),E=class extends _{constructor({message:e,url:t,requestBodyValues:r,statusCode:n,responseHeaders:i,responseBody:a,cause:s,isRetryable:l=null!=n&&(408===n||409===n||429===n||n>=500),data:u}){super({name:$,message:e,cause:s}),this[o]=!0,this.url=t,this.requestBodyValues=r,this.statusCode=n,this.responseHeaders=i,this.responseBody=a,this.isRetryable=l,this.data=u}static isInstance(e){return _.hasMarker(e,w)}};o=S;var x="AI_EmptyResponseBodyError",A=`vercel.ai.error.${x}`,O=Symbol.for(A),k=class extends _{constructor({message:e="Empty response body"}={}){super({name:x,message:e}),this[i]=!0}static isInstance(e){return _.hasMarker(e,A)}};function I(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}i=O;var C="AI_InvalidArgumentError",T=`vercel.ai.error.${C}`,P=Symbol.for(T),R=class extends _{constructor({message:e,cause:t,argument:r}){super({name:C,message:e,cause:t}),this[a]=!0,this.argument=r}static isInstance(e){return _.hasMarker(e,T)}};a=P;var j="AI_InvalidPromptError",N=`vercel.ai.error.${j}`,M=Symbol.for(N),L=class extends _{constructor({prompt:e,message:t,cause:r}){super({name:j,message:`Invalid prompt: ${t}`,cause:r}),this[s]=!0,this.prompt=e}static isInstance(e){return _.hasMarker(e,N)}};s=M;var D="AI_InvalidResponseDataError",B=`vercel.ai.error.${D}`,F=Symbol.for(B),U=class extends _{constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:D,message:t}),this[l]=!0,this.data=e}static isInstance(e){return _.hasMarker(e,B)}};l=F;var Z="AI_JSONParseError",Y=`vercel.ai.error.${Z}`,H=Symbol.for(Y),q=class extends _{constructor({text:e,cause:t}){super({name:Z,message:`JSON parsing failed: Text: ${e}. Error message: ${I(t)}`,cause:t}),this[u]=!0,this.text=e}static isInstance(e){return _.hasMarker(e,Y)}};u=H;var G="AI_LoadAPIKeyError",W=`vercel.ai.error.${G}`,K=Symbol.for(W),V=class extends _{constructor({message:e}){super({name:G,message:e}),this[c]=!0}static isInstance(e){return _.hasMarker(e,W)}};c=K;var z="AI_LoadSettingError";d=Symbol.for(`vercel.ai.error.${z}`);var J="AI_NoContentGeneratedError";f=Symbol.for(`vercel.ai.error.${J}`);var X="AI_NoSuchModelError";p=Symbol.for(`vercel.ai.error.${X}`);var Q="AI_TooManyEmbeddingValuesForCallError";h=Symbol.for(`vercel.ai.error.${Q}`);var ee="AI_TypeValidationError",et=`vercel.ai.error.${ee}`,er=Symbol.for(et),en=class e extends _{constructor({value:e,cause:t}){super({name:ee,message:`Type validation failed: Value: ${JSON.stringify(e)}. Error message: ${I(t)}`,cause:t}),this[m]=!0,this.value=e}static isInstance(e){return _.hasMarker(e,et)}static wrap({value:t,cause:r}){return e.isInstance(r)&&r.value===t?r:new e({value:t,cause:r})}};m=er;var eo=en,ei="AI_UnsupportedFunctionalityError",ea=`vercel.ai.error.${ei}`,es=Symbol.for(ea),el=class extends _{constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:ei,message:t}),this[g]=!0,this.functionality=e}static isInstance(e){return _.hasMarker(e,ea)}};g=es;var eu=r(55247),ec=r(29486);class ed extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function ef(e){}function ep(e){if("function"==typeof e)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=ef,onError:r=ef,onRetry:n=ef,onComment:o}=e,i="",a=!0,s,l="",u="";function c(e){if(""===e)return void f();if(e.startsWith(":")){o&&o(e.slice(e.startsWith(": ")?2:1));return}let t=e.indexOf(":");if(-1!==t){let r=e.slice(0,t),n=" "===e[t+1]?2:1;d(r,e.slice(t+n),e);return}d(e,"",e)}function d(e,t,o){switch(e){case"event":u=t;break;case"data":l=`${l}${t} `;break;case"id":s=t.includes("\0")?void 0:t;break;case"retry":/^\d+$/.test(t)?n(parseInt(t,10)):r(new ed(`Invalid \`retry\` value: "${t}"`,{type:"invalid-retry",value:t,line:o}));break;default:r(new ed(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:"unknown-field",field:e,value:t,line:o}))}}function f(){l.length>0&&t({id:s,event:u||void 0,data:l.endsWith(` `)?l.slice(0,-1):l}),s=void 0,l="",u=""}return{feed:function(e){let t=a?e.replace(/^\xEF\xBB\xBF/,""):e,[r,n]=eh(`${i}${t}`);for(let e of r)c(e);i=n,a=!1},reset:function(e={}){i&&e.consume&&c(i),a=!0,s=void 0,l="",u="",i=""}}}function eh(e){let t=[],r="",n=0;for(;n{o.enqueue(e)},onError(t){"terminate"===e?o.error(t):"function"==typeof e&&e(t)},onRetry:t,onComment:r})},transform(e){n.feed(e)}})}}var eg=r(33601);function ey(...e){return e.reduce((e,t)=>({...e,...null!=t?t:{}}),{})}function ev(e){let t={};return e.headers.forEach((e,r)=>{t[r]=e}),t}var eb=(({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let o=(0,eu.d)(r,t);if(null==e)return o;if(r.includes(n))throw new R({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${r}".`});return t=>`${e}${n}${o(t)}`})();function e_(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>null!=t))}function e$(e){return e instanceof Error&&("AbortError"===e.name||"TimeoutError"===e.name)}function ew({apiKey:e,environmentVariableName:t,apiKeyParameterName:r="apiKey",description:n}){if("string"==typeof e)return e;if(null!=e)throw new V({message:`${n} API key must be a string.`});if(void 0===eg)throw new V({message:`${n} API key is missing. Pass it using the '${r}' parameter. Environment variables is not supported in this environment.`});if(null==(e=eg.env[t]))throw new V({message:`${n} API key is missing. Pass it using the '${r}' parameter or the ${t} environment variable.`});if("string"!=typeof e)throw new V({message:`${n} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}var eS=Symbol.for("vercel.ai.validator");function eE(e){return{[eS]:!0,validate:e}}function ex(e){return"object"==typeof e&&null!==e&&eS in e&&!0===e[eS]&&"validate"in e}function eA(e){return ex(e)?e:eO(e)}function eO(e){return eE(t=>{let r=e.safeParse(t);return r.success?{success:!0,value:r.data}:{success:!1,error:r.error}})}function ek({value:e,schema:t}){let r=eI({value:e,schema:t});if(!r.success)throw eo.wrap({value:e,cause:r.error});return r.value}function eI({value:e,schema:t}){let r=eA(t);try{if(null==r.validate)return{success:!0,value:e};let t=r.validate(e);if(t.success)return t;return{success:!1,error:eo.wrap({value:e,cause:t.error})}}catch(t){return{success:!1,error:eo.wrap({value:e,cause:t})}}}function eC({text:e,schema:t}){try{let r=ec.parse(e);if(null==t)return r;return ek({value:r,schema:t})}catch(t){if(q.isInstance(t)||eo.isInstance(t))throw t;throw new q({text:e,cause:t})}}function eT({text:e,schema:t}){try{let r=ec.parse(e);if(null==t)return{success:!0,value:r,rawValue:r};let n=eI({value:r,schema:t});return n.success?{...n,rawValue:r}:n}catch(t){return{success:!1,error:q.isInstance(t)?t:new q({text:e,cause:t})}}}function eP(e){try{return ec.parse(e),!0}catch(e){return!1}}var eR=()=>globalThis.fetch,ej=async({url:e,headers:t,body:r,failedResponseHandler:n,successfulResponseHandler:o,abortSignal:i,fetch:a})=>eN({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(r),values:r},failedResponseHandler:n,successfulResponseHandler:o,abortSignal:i,fetch:a}),eN=async({url:e,headers:t={},body:r,successfulResponseHandler:n,failedResponseHandler:o,abortSignal:i,fetch:a=eR()})=>{try{let s=await a(e,{method:"POST",headers:e_(t),body:r.content,signal:i}),l=ev(s);if(!s.ok){let t;try{t=await o({response:s,url:e,requestBodyValues:r.values})}catch(t){if(e$(t)||E.isInstance(t))throw t;throw new E({message:"Failed to process error response",cause:t,statusCode:s.status,url:e,responseHeaders:l,requestBodyValues:r.values})}throw t.value}try{return await n({response:s,url:e,requestBodyValues:r.values})}catch(t){if(t instanceof Error&&(e$(t)||E.isInstance(t)))throw t;throw new E({message:"Failed to process successful response",cause:t,statusCode:s.status,url:e,responseHeaders:l,requestBodyValues:r.values})}}catch(t){if(e$(t))throw t;if(t instanceof TypeError&&"fetch failed"===t.message){let n=t.cause;if(null!=n)throw new E({message:`Cannot connect to API: ${n.message}`,cause:n,url:e,requestBodyValues:r.values,isRetryable:!0})}throw t}},eM=({errorSchema:e,errorToMessage:t,isRetryable:r})=>async({response:n,url:o,requestBodyValues:i})=>{let a=await n.text(),s=ev(n);if(""===a.trim())return{responseHeaders:s,value:new E({message:n.statusText,url:o,requestBodyValues:i,statusCode:n.status,responseHeaders:s,responseBody:a,isRetryable:null==r?void 0:r(n)})};try{let l=eC({text:a,schema:e});return{responseHeaders:s,value:new E({message:t(l),url:o,requestBodyValues:i,statusCode:n.status,responseHeaders:s,responseBody:a,data:l,isRetryable:null==r?void 0:r(n,l)})}}catch(e){return{responseHeaders:s,value:new E({message:n.statusText,url:o,requestBodyValues:i,statusCode:n.status,responseHeaders:s,responseBody:a,isRetryable:null==r?void 0:r(n)})}}},eL=e=>async({response:t})=>{let r=ev(t);if(null==t.body)throw new k({});return{responseHeaders:r,value:t.body.pipeThrough(new TextDecoderStream).pipeThrough(new em).pipeThrough(new TransformStream({transform({data:t},r){"[DONE]"!==t&&r.enqueue(eT({text:t,schema:e}))}}))}},eD=e=>async({response:t,url:r,requestBodyValues:n})=>{let o=await t.text(),i=eT({text:o,schema:e}),a=ev(t);if(!i.success)throw new E({message:"Invalid JSON response",cause:i.error,statusCode:t.status,responseHeaders:a,responseBody:o,url:r,requestBodyValues:n});return{responseHeaders:a,value:i.value,rawValue:i.rawValue}},{btoa:eB,atob:eF}=globalThis;function eU(e){let t="";for(let r=0;rt in e?eH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eJ=(e,t)=>{for(var r in t||(t={}))eK.call(t,r)&&ez(e,r,t[r]);if(eW)for(var r of eW(t))eV.call(t,r)&&ez(e,r,t[r]);return e},eX=(e,t)=>eq(e,eG(t)),eQ=(e,t)=>{var r={};for(var n in e)eK.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&eW)for(var n of eW(e))0>t.indexOf(n)&&eV.call(e,n)&&(r[n]=e[n]);return r};function e0(e){var t;let r=[];for(let{role:n,content:o}of e)switch(n){case"system":r.push({role:"system",content:o});break;case"user":{if(1===o.length&&(null==(t=o[0])?void 0:t.type)==="text"){r.push({role:"user",content:o[0].text});break}let e=o.map(e=>{var t;switch(e.type){case"text":return{type:"text",text:e.text};case"image":return{type:"image_url",image_url:{url:e.image instanceof URL?e.image.toString():`data:${null!=(t=e.mimeType)?t:"image/jpeg"};base64,${eU(e.image)}`}};case"file":return{type:"text",text:e.data instanceof URL?e.data.toString():e.data};default:{let t=e;throw Error(`Unsupported content part type: ${t}`)}}});r.push({role:"user",content:e});break}case"assistant":{let e="",t=[];for(let r of o)switch(r.type){case"text":e+=r.text;break;case"tool-call":t.push({id:r.toolCallId,type:"function",function:{name:r.toolName,arguments:JSON.stringify(r.args)}});break;default:{let e=r;throw Error(`Unsupported part: ${e}`)}}r.push({role:"assistant",content:e,tool_calls:t.length>0?t:void 0});break}case"tool":for(let e of o)r.push({role:"tool",tool_call_id:e.toolCallId,content:JSON.stringify(e.result)});break;default:{let e=n;throw Error(`Unsupported role: ${e}`)}}return r}function e1(e){var t,r;return null!=(r=null==(t=null==e?void 0:e.content)?void 0:t.map(({token:e,logprob:t,top_logprobs:r})=>({token:e,logprob:t,topLogprobs:r?r.map(({token:e,logprob:t})=>({token:e,logprob:t})):[]})))?r:void 0}function e2(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var e3=eY.Ik({error:eY.Ik({message:eY.Yj(),type:eY.Yj(),param:eY.bz().nullable(),code:eY.Yj().nullable()})}),e9=eM({errorSchema:e3,errorToMessage:e=>e.error.message});function e4(e){return"parameters"in e}var e8=class{constructor(e,t,r){this.specificationVersion="v1",this.defaultObjectGenerationMode="tool",this.modelId=e,this.settings=t,this.config=r}get provider(){return this.config.provider}getArgs({mode:e,prompt:t,maxTokens:r,temperature:n,topP:o,frequencyPenalty:i,presencePenalty:a,seed:s}){let l=e.type,u=eJ({model:this.modelId,models:this.settings.models,logit_bias:this.settings.logitBias,logprobs:!0===this.settings.logprobs||"number"==typeof this.settings.logprobs||void 0,top_logprobs:"number"==typeof this.settings.logprobs?this.settings.logprobs:"boolean"==typeof this.settings.logprobs&&this.settings.logprobs?0:void 0,user:this.settings.user,parallel_tool_calls:this.settings.parallelToolCalls,max_tokens:r,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:a,seed:s,messages:e0(t)},this.config.extraBody);switch(l){case"regular":return eJ(eJ({},u),e7(e));case"object-json":return eX(eJ({},u),{response_format:{type:"json_object"}});case"object-tool":return eX(eJ({},u),{tool_choice:{type:"function",function:{name:e.tool.name}},tools:[{type:"function",function:{name:e.tool.name,description:e.tool.description,parameters:e.tool.parameters}}]});default:{let e=l;throw new el({functionality:`${e} mode`})}}}async doGenerate(e){var t,r;let n=this.getArgs(e),{responseHeaders:o,value:i}=await ej({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:ey(this.config.headers(),e.headers),body:n,failedResponseHandler:e9,successfulResponseHandler:eD(e6),abortSignal:e.abortSignal,fetch:this.config.fetch}),a=n,{messages:s}=a,l=eQ(a,["messages"]),u=i.choices[0];if(null==u)throw Error("No choice in response");return{text:null!=(t=u.message.content)?t:void 0,toolCalls:null==(r=u.message.tool_calls)?void 0:r.map(e=>{var t;return{toolCallType:"function",toolCallId:null!=(t=e.id)?t:eb(),toolName:e.function.name,args:e.function.arguments}}),finishReason:e2(u.finish_reason),usage:{promptTokens:i.usage.prompt_tokens,completionTokens:i.usage.completion_tokens},rawCall:{rawPrompt:s,rawSettings:l},rawResponse:{headers:o},warnings:[],logprobs:e1(u.logprobs)}}async doStream(e){let t,r=this.getArgs(e),{responseHeaders:n,value:o}=await ej({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:ey(this.config.headers(),e.headers),body:eX(eJ({},r),{stream:!0,stream_options:"strict"===this.config.compatibility?{include_usage:!0}:void 0}),failedResponseHandler:e9,successfulResponseHandler:eL(e5),abortSignal:e.abortSignal,fetch:this.config.fetch}),i=r,{messages:a}=i,s=eQ(i,["messages"]),l=[],u="other",c={promptTokens:NaN,completionTokens:NaN};return{stream:o.pipeThrough(new TransformStream({transform(e,r){var n,o,i,a,s,d,f,p,h,m,g,y;if(!e.success){u="error",r.enqueue({type:"error",error:e.error});return}let v=e.value;if("error"in v){u="error",r.enqueue({type:"error",error:v.error});return}null!=v.usage&&(c={promptTokens:v.usage.prompt_tokens,completionTokens:v.usage.completion_tokens});let b=v.choices[0];if((null==b?void 0:b.finish_reason)!=null&&(u=e2(b.finish_reason)),(null==b?void 0:b.delta)==null)return;let _=b.delta;null!=_.content&&r.enqueue({type:"text-delta",textDelta:_.content});let $=e1(null==b?void 0:b.logprobs);if((null==$?void 0:$.length)&&(void 0===t&&(t=[]),t.push(...$)),null!=_.tool_calls)for(let e of _.tool_calls){let t=e.index;if(null==l[t]){if("function"!==e.type)throw new U({data:e,message:"Expected 'function' type."});if(null==e.id)throw new U({data:e,message:"Expected 'id' to be a string."});if((null==(n=e.function)?void 0:n.name)==null)throw new U({data:e,message:"Expected 'function.name' to be a string."});l[t]={id:e.id,type:"function",function:{name:e.function.name,arguments:null!=(o=e.function.arguments)?o:""}};let u=l[t];if(null==u)throw Error("Tool call is missing");(null==(i=u.function)?void 0:i.name)!=null&&(null==(a=u.function)?void 0:a.arguments)!=null&&eP(u.function.arguments)&&(r.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:u.id,toolName:u.function.name,argsTextDelta:u.function.arguments}),r.enqueue({type:"tool-call",toolCallType:"function",toolCallId:null!=(s=u.id)?s:eb(),toolName:u.function.name,args:u.function.arguments}));continue}let u=l[t];if(null==u)throw Error("Tool call is missing");(null==(d=e.function)?void 0:d.arguments)!=null&&(u.function.arguments+=null!=(p=null==(f=e.function)?void 0:f.arguments)?p:""),r.enqueue({type:"tool-call-delta",toolCallType:"function",toolCallId:u.id,toolName:u.function.name,argsTextDelta:null!=(h=e.function.arguments)?h:""}),(null==(m=u.function)?void 0:m.name)!=null&&(null==(g=u.function)?void 0:g.arguments)!=null&&eP(u.function.arguments)&&r.enqueue({type:"tool-call",toolCallType:"function",toolCallId:null!=(y=u.id)?y:eb(),toolName:u.function.name,args:u.function.arguments})}},flush(e){e.enqueue({type:"finish",finishReason:u,logprobs:t,usage:c})}})),rawCall:{rawPrompt:a,rawSettings:s},rawResponse:{headers:n},warnings:[]}}},e6=eY.Ik({choices:eY.YO(eY.Ik({message:eY.Ik({role:eY.eu("assistant"),content:eY.Yj().nullable().optional(),tool_calls:eY.YO(eY.Ik({id:eY.Yj().optional().nullable(),type:eY.eu("function"),function:eY.Ik({name:eY.Yj(),arguments:eY.Yj()})})).optional()}),index:eY.ai(),logprobs:eY.Ik({content:eY.YO(eY.Ik({token:eY.Yj(),logprob:eY.ai(),top_logprobs:eY.YO(eY.Ik({token:eY.Yj(),logprob:eY.ai()}))})).nullable()}).nullable().optional(),finish_reason:eY.Yj().optional().nullable()})),usage:eY.Ik({prompt_tokens:eY.ai(),completion_tokens:eY.ai()})}),e5=eY.KC([eY.Ik({choices:eY.YO(eY.Ik({delta:eY.Ik({role:eY.k5(["assistant"]).optional(),content:eY.Yj().nullish(),tool_calls:eY.YO(eY.Ik({index:eY.ai(),id:eY.Yj().nullish(),type:eY.eu("function").optional(),function:eY.Ik({name:eY.Yj().nullish(),arguments:eY.Yj().nullish()})})).nullish()}).nullish(),logprobs:eY.Ik({content:eY.YO(eY.Ik({token:eY.Yj(),logprob:eY.ai(),top_logprobs:eY.YO(eY.Ik({token:eY.Yj(),logprob:eY.ai()}))})).nullable()}).nullish(),finish_reason:eY.Yj().nullable().optional(),index:eY.ai()})),usage:eY.Ik({prompt_tokens:eY.ai(),completion_tokens:eY.ai()}).nullish()}),e3]);function e7(e){var t;let r=(null==(t=e.tools)?void 0:t.length)?e.tools:void 0;if(null==r)return{tools:void 0,tool_choice:void 0};let n=r.map(e=>e4(e)?{type:"function",function:{name:e.name,description:e.description,parameters:e.parameters}}:{type:"function",function:{name:e.name}}),o=e.toolChoice;if(null==o)return{tools:n,tool_choice:void 0};let i=o.type;switch(i){case"auto":case"none":case"required":return{tools:n,tool_choice:i};case"tool":return{tools:n,tool_choice:{type:"function",function:{name:o.toolName}}};default:{let e=i;throw Error(`Unsupported tool choice type: ${e}`)}}}function te({prompt:e,inputFormat:t,user:r="user",assistant:n="assistant"}){if("prompt"===t&&1===e.length&&e[0]&&"user"===e[0].role&&1===e[0].content.length&&e[0].content[0]&&"text"===e[0].content[0].type)return{prompt:e[0].content[0].text};let o="";for(let{role:t,content:i}of(e[0]&&"system"===e[0].role&&(o+=`${e[0].content} `,e=e.slice(1)),e))switch(t){case"system":throw new L({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":{let e=i.map(e=>{switch(e.type){case"text":return e.text;case"image":throw new el({functionality:"images"});case"file":throw new el({functionality:"file attachments"});default:{let t=e;throw Error(`Unsupported content type: ${t}`)}}}).join("");o+=`${r}: ${e} `;break}case"assistant":{let e=i.map(e=>{switch(e.type){case"text":return e.text;case"tool-call":throw new el({functionality:"tool-call messages"});default:{let t=e;throw Error(`Unsupported content type: ${t}`)}}}).join("");o+=`${n}: ${e} `;break}case"tool":throw new el({functionality:"tool messages"});default:{let e=t;throw Error(`Unsupported role: ${e}`)}}return{prompt:o+=`${n}: `,stopSequences:[` ${r}:`]}}function tt(e){return null==e?void 0:e.tokens.map((t,r)=>{var n,o;return{token:t,logprob:null!=(n=e.token_logprobs[r])?n:0,topLogprobs:e.top_logprobs?Object.entries(null!=(o=e.top_logprobs[r])?o:{}).map(([e,t])=>({token:e,logprob:t})):[]}})}var tr=class{constructor(e,t,r){this.specificationVersion="v1",this.defaultObjectGenerationMode=void 0,this.modelId=e,this.settings=t,this.config=r}get provider(){return this.config.provider}getArgs({mode:e,inputFormat:t,prompt:r,maxTokens:n,temperature:o,topP:i,frequencyPenalty:a,presencePenalty:s,seed:l}){var u;let c=e.type,{prompt:d,stopSequences:f}=te({prompt:r,inputFormat:t}),p=eJ({model:this.modelId,models:this.settings.models,echo:this.settings.echo,logit_bias:this.settings.logitBias,logprobs:"number"==typeof this.settings.logprobs?this.settings.logprobs:"boolean"==typeof this.settings.logprobs&&this.settings.logprobs?0:void 0,suffix:this.settings.suffix,user:this.settings.user,max_tokens:n,temperature:o,top_p:i,frequency_penalty:a,presence_penalty:s,seed:l,prompt:d,stop:f},this.config.extraBody);switch(c){case"regular":if(null==(u=e.tools)?void 0:u.length)throw new el({functionality:"tools"});if(e.toolChoice)throw new el({functionality:"toolChoice"});return p;case"object-json":throw new el({functionality:"object-json mode"});case"object-tool":throw new el({functionality:"object-tool mode"});default:{let e=c;throw new el({functionality:`${e} mode`})}}}async doGenerate(e){let t=this.getArgs(e),{responseHeaders:r,value:n}=await ej({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:ey(this.config.headers(),e.headers),body:t,failedResponseHandler:e9,successfulResponseHandler:eD(tn),abortSignal:e.abortSignal,fetch:this.config.fetch}),o=t,{prompt:i}=o,a=eQ(o,["prompt"]),s=n.choices[0];if(!s)throw Error("No choice in OpenRouter completion response");return{text:s.text,usage:{promptTokens:n.usage.prompt_tokens,completionTokens:n.usage.completion_tokens},finishReason:e2(s.finish_reason),logprobs:tt(s.logprobs),rawCall:{rawPrompt:i,rawSettings:a},rawResponse:{headers:r},warnings:[]}}async doStream(e){let t,r=this.getArgs(e),{responseHeaders:n,value:o}=await ej({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:ey(this.config.headers(),e.headers),body:eX(eJ({},this.getArgs(e)),{stream:!0,stream_options:"strict"===this.config.compatibility?{include_usage:!0}:void 0}),failedResponseHandler:e9,successfulResponseHandler:eL(to),abortSignal:e.abortSignal,fetch:this.config.fetch}),i=r,{prompt:a}=i,s=eQ(i,["prompt"]),l="other",u={promptTokens:NaN,completionTokens:NaN};return{stream:o.pipeThrough(new TransformStream({transform(e,r){if(!e.success){l="error",r.enqueue({type:"error",error:e.error});return}let n=e.value;if("error"in n){l="error",r.enqueue({type:"error",error:n.error});return}null!=n.usage&&(u={promptTokens:n.usage.prompt_tokens,completionTokens:n.usage.completion_tokens});let o=n.choices[0];(null==o?void 0:o.finish_reason)!=null&&(l=e2(o.finish_reason)),(null==o?void 0:o.text)!=null&&r.enqueue({type:"text-delta",textDelta:o.text});let i=tt(null==o?void 0:o.logprobs);(null==i?void 0:i.length)&&(void 0===t&&(t=[]),t.push(...i))},flush(e){e.enqueue({type:"finish",finishReason:l,logprobs:t,usage:u})}})),rawCall:{rawPrompt:a,rawSettings:s},rawResponse:{headers:n},warnings:[]}}},tn=eY.Ik({choices:eY.YO(eY.Ik({text:eY.Yj(),finish_reason:eY.Yj(),logprobs:eY.Ik({tokens:eY.YO(eY.Yj()),token_logprobs:eY.YO(eY.ai()),top_logprobs:eY.YO(eY.g1(eY.Yj(),eY.ai())).nullable()}).nullable().optional()})),usage:eY.Ik({prompt_tokens:eY.ai(),completion_tokens:eY.ai()})}),to=eY.KC([eY.Ik({choices:eY.YO(eY.Ik({text:eY.Yj(),finish_reason:eY.Yj().nullish(),index:eY.ai(),logprobs:eY.Ik({tokens:eY.YO(eY.Yj()),token_logprobs:eY.YO(eY.ai()),top_logprobs:eY.YO(eY.g1(eY.Yj(),eY.ai())).nullable()}).nullable().optional()})),usage:eY.Ik({prompt_tokens:eY.ai(),completion_tokens:eY.ai()}).optional().nullable()}),e3]);function ti(e={}){var t,r,n;let o=null!=(r=eZ(null!=(t=e.baseURL)?t:e.baseUrl))?r:"https://openrouter.ai/api/v1",i=null!=(n=e.compatibility)?n:"compatible",a=()=>eJ({Authorization:`Bearer ${ew({apiKey:e.apiKey,environmentVariableName:"OPENROUTER_API_KEY",description:"OpenRouter"})}`},e.headers),s=(t,r={})=>new e8(t,r,{provider:"openrouter.chat",url:({path:e})=>`${o}${e}`,headers:a,compatibility:i,fetch:e.fetch,extraBody:e.extraBody}),l=(t,r={})=>new tr(t,r,{provider:"openrouter.completion",url:({path:e})=>`${o}${e}`,headers:a,compatibility:i,fetch:e.fetch,extraBody:e.extraBody}),u=(e,t)=>{if(new.target)throw Error("The OpenRouter model function cannot be called with the new keyword.");return"openai/gpt-3.5-turbo-instruct"===e?l(e,t):s(e,t)},c=function(e,t){return u(e,t)};return c.languageModel=u,c.chat=s,c.completion=l,c}ti({compatibility:"strict"})},96751:(e,t,r)=>{"use strict";let n=r(77721);e.exports=(e,t)=>new n(e,t).minor},96779:(e,t,r)=>{"use strict";var n=r(3387),o="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t{"use strict";let t=/^[0-9]+$/,r=(e,r)=>{let n=t.test(e),o=t.test(r);return n&&o&&(e*=1,r*=1),e===r?0:n&&!o?-1:o&&!n?1:er(t,e);e.exports={compareIdentifiers:r,rcompareIdentifiers:n}},98088:(e,t,r)=>{"use strict";r.d(t,{A:()=>y});var n=r(1983),o=r(99410);function i(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var a=r(38985),s=r(55729),l=r(5440);function u(e,t){var r=function(e){return t&&(0,s.isValidElement)(e)?t(e):e},n=Object.create(null);return e&&s.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=r(e)}),n}function c(e,t){function r(r){return r in t?t[r]:e[r]}e=e||{},t=t||{};var n,o=Object.create(null),i=[];for(var a in e)a in t?i.length&&(o[a]=i,i=[]):i.push(a);var s={};for(var l in t){if(o[l])for(n=0;n{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty;e.exports=r(14274).call(n,o)},98886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a,t.locales=void 0;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i={"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})$/};function a(e,t,r){if((0,n.default)(e),r&&r.strictMode&&!e.startsWith("+"))return!1;if(Array.isArray(t))return t.some(function(t){return!!(i.hasOwnProperty(t)&&i[t].test(e))||!1});if(t in i)return i[t].test(e);if(!t||"any"===t){for(var o in i)if(i.hasOwnProperty(o)&&i[o].test(e))return!0;return!1}throw Error("Invalid locale '".concat(t,"'"))}i["en-CA"]=i["en-US"],i["fr-CA"]=i["en-CA"],i["fr-BE"]=i["nl-BE"],i["zh-HK"]=i["en-HK"],i["zh-MO"]=i["en-MO"],i["ga-IE"]=i["en-IE"],i["fr-CH"]=i["de-CH"],i["it-CH"]=i["fr-CH"],t.locales=Object.keys(i)},99410:(e,t,r)=>{"use strict";function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;tn})},99834:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=b;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i="([A-Za-z]{3}(-[A-Za-z]{3}){0,2})",a="(([a-zA-Z]{2,3}(-".concat(i,")?)|([a-zA-Z]{5,8}))"),s="([A-Za-z]{4})",l="([A-Za-z]{2}|\\d{3})",u="([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))",c="(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])",d="(".concat(c,"(-[A-Za-z0-9]{2,8})+)"),f="(x(-[A-Za-z0-9]{1,8})+)",p="((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))",h="((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))",m="(".concat(p,"|").concat(h,")"),g="(-|_)",y="".concat(a,"(").concat(g).concat(s,")?(").concat(g).concat(l,")?(").concat(g).concat(u,")*(").concat(g).concat(d,")*(").concat(g).concat(f,")?"),v=new RegExp("(^".concat(f,"$)|(^").concat(m,"$)|(^").concat(y,"$)"));function b(e){return(0,n.default)(e),v.test(e)}e.exports=t.default,e.exports.default=t.default},99931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(r(79922));function o(e){return e&&e.__esModule?e:{default:e}}var i={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 a(e,t){(0,n.default)(e);var r=i[![void 0,null].includes(t)?t:"all"];return!!r&&r.test(e)}e.exports=t.default,e.exports.default=t.default}}]);