@bagelink/vue 1.4.128 → 1.4.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TelInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/TelInput.vue"],"names":[],"mappings":"AAsVA,KAAK,WAAW,GAAG;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"TelInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/TelInput.vue"],"names":[],"mappings":"AAsVA,KAAK,WAAW,GAAG;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyZF,wBASG"}
|
package/dist/index.cjs
CHANGED
|
@@ -39,7 +39,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
39
39
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Im(e,t){if(e){if(typeof e==`string`)return Lm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lm(e,t)}}function Lm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Rm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Rm(Object(n),!0).forEach(function(t){Bm(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Bm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vm={formatExtension:function(e,t,n){return`${e}${n.ext()}${t}`}};function Hm(e,t,n,r){if(n=n?zm(zm({},Vm),n):Vm,r=new wp(r),e.country&&e.country!==`001`){if(!r.hasCountry(e.country))throw Error(`Unknown country: ${e.country}`);r.country(e.country)}else if(e.countryCallingCode)r.selectNumberingPlan(e.countryCallingCode);else return e.phone||``;var i=r.countryCallingCode(),a=n.v2?e.nationalNumber:e.phone,o;switch(t){case`NATIONAL`:return a?(o=Um(a,e.carrierCode,`NATIONAL`,r,n),Gm(o,e.ext,r,n.formatExtension)):``;case`INTERNATIONAL`:return a?(o=Um(a,null,`INTERNATIONAL`,r,n),o=`+${i} ${o}`,Gm(o,e.ext,r,n.formatExtension)):`+${i}`;case`E.164`:return`+${i}${a}`;case`RFC3966`:return Pm({number:`+${i}${a}`,ext:e.ext});case`IDD`:if(!n.fromCountry)return;var s=Km(a,e.carrierCode,i,n.fromCountry,r);return Gm(s,e.ext,r,n.formatExtension);default:throw Error(`Unknown "format" argument passed to "formatNumber()": "${t}"`)}}function Um(e,t,n,r,i){var a=Wm(r.formats(),e);return a?xm(e,a,{useInternationalFormat:n===`INTERNATIONAL`,withNationalPrefix:!(a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1),carrierCode:t,metadata:r}):e}function Wm(e,t){for(var n=Fm(e),r;!(r=n()).done;){var i=r.value;if(i.leadingDigitsPatterns().length>0){var a=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(t.search(a)!==0)continue}if(Up(t,i.pattern()))return i}}function Gm(e,t,n,r){return t?r(e,t,n):e}function Km(e,t,n,r,i){var a=Mp(r,i.metadata);if(a===n){var o=Um(e,t,`NATIONAL`,i);return n===`1`?n+` `+o:o}var s=Cm(r,void 0,i.metadata);if(s)return`${s} ${n} ${Um(e,null,`INTERNATIONAL`,i)}`}function qm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qm(Object(n),!0).forEach(function(t){Ym(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ym(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xm(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Zm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qm(e,t,n){return t&&Zm(e.prototype,t),n&&Zm(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}var $m=!1,eh=function(){function e(t,n,r){if(Xm(this,e),!t)throw TypeError(`First argument is required`);if(typeof t!=`string`)throw TypeError(`First argument must be a string`);if(typeof t==`string`){if(t[0]===`+`&&!n)throw TypeError("`metadata` argument not passed");if(hp(n)&&hp(n.countries)){r=n;var i=t;if(!rh.test(i))throw Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var a=vm(i,void 0,void 0,r),o=a.countryCallingCode,s=a.number;if(n=s,t=o,!n)throw Error("Invalid `number` argument passed: too short")}}if(!n)throw TypeError("`nationalNumber` argument is required");if(typeof n!=`string`)throw TypeError("`nationalNumber` argument must be a string");Ap(r);var c=nh(t,r),l=c.country,u=c.countryCallingCode;this.country=l,this.countryCallingCode=u,this.nationalNumber=n,this.number=`+`+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return Qm(e,[{key:`setExt`,value:function(e){this.ext=e}},{key:`getPossibleCountries`,value:function(){return this.country?[this.country]:Zp(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:`isPossible`,value:function(){return Vp(this,{v2:!0},this.getMetadata())}},{key:`isValid`,value:function(){return Xp(this,{v2:!0},this.getMetadata())}},{key:`isNonGeographic`,value:function(){var e=new wp(this.getMetadata());return e.isNonGeographicCallingCode(this.countryCallingCode)}},{key:`isEqual`,value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:`getType`,value:function(){return Jp(this,{v2:!0},this.getMetadata())}},{key:`format`,value:function(e,t){return Hm(this,e,t?Jm(Jm({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:`formatNational`,value:function(e){return this.format(`NATIONAL`,e)}},{key:`formatInternational`,value:function(e){return this.format(`INTERNATIONAL`,e)}},{key:`getURI`,value:function(e){return this.format(`RFC3966`,e)}}]),e}(),th=function(e){return/^[A-Z]{2}$/.test(e)};function nh(e,t){var n,r,i=new wp(t);return th(e)?(n=e,i.selectNumberingPlan(n),r=i.countryCallingCode()):(r=e,$m&&i.isNonGeographicCallingCode(r)&&(n=`001`)),{country:n,countryCallingCode:r}}var rh=/^\+\d+$/;function ih(e){"@babel/helpers - typeof";return ih=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ih(e)}function ah(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oh(e,t,n){return t&&ah(e.prototype,t),n&&ah(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function sh(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function ch(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&gh(e,t)}function lh(e){var t=mh();return function(){var n=_h(e),r;if(t){var i=_h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return uh(this,r)}}function uh(e,t){if(t&&(ih(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return dh(e)}function dh(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function fh(e){var t=typeof Map==`function`?new Map:void 0;return fh=function(e){if(e===null||!hh(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ph(e,arguments,_h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),gh(n,e)},fh(e)}function ph(e,t,n){return ph=mh()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=Function.bind.apply(e,r),a=new i;return n&&gh(a,n.prototype),a},ph.apply(null,arguments)}function mh(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hh(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function gh(e,t){return gh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},gh(e,t)}function _h(e){return _h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_h(e)}var vh=function(e){ch(n,e);var t=lh(n);function n(e){var r;return sh(this,n),r=t.call(this,e),Object.setPrototypeOf(dh(r),n.prototype),r.name=r.constructor.name,r}return oh(n)}(fh(Error)),yh=RegExp(`(?:`+Em()+`)$`,`i`);function bh(e){var t=e.search(yh);if(t<0)return{};for(var n=e.slice(0,t),r=e.match(yh),i=1;i<r.length;){if(r[i])return{number:n,ext:r[i]};i++}}var xh={0:`0`,1:`1`,2:`2`,3:`3`,4:`4`,5:`5`,6:`6`,7:`7`,8:`8`,9:`9`,"0":`0`,"1":`1`,"2":`2`,"3":`3`,"4":`4`,"5":`5`,"6":`6`,"7":`7`,"8":`8`,"9":`9`,"٠":`0`,"١":`1`,"٢":`2`,"٣":`3`,"٤":`4`,"٥":`5`,"٦":`6`,"٧":`7`,"٨":`8`,"٩":`9`,"۰":`0`,"۱":`1`,"۲":`2`,"۳":`3`,"۴":`4`,"۵":`5`,"۶":`6`,"۷":`7`,"۸":`8`,"۹":`9`};function Sh(e){return xh[e]}function Ch(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=wh(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
40
40
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wh(e,t){if(e){if(typeof e==`string`)return Th(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Th(e,t)}}function Th(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Eh(e){for(var t=``,n=Ch(e.split(``)),r;!(r=n()).done;){var i=r.value;t+=Dh(i,t)||``}return t}function Dh(e,t,n){if(e===`+`){if(t){typeof n==`function`&&n(`end`);return}return`+`}return Sh(e)}function Oh(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=kh(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
41
41
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kh(e,t){if(e){if(typeof e==`string`)return Ah(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ah(e,t)}}function Ah(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jh(e,t){var n=t.countries,r=t.defaultCountry,i=t.metadata;i=new wp(i);for(var a=Oh(n),o;!(o=a()).done;){var s=o.value;if(i.country(s),i.leadingDigits()){if(e&&e.search(i.leadingDigits())===0)return s}else if(Jp({phone:e,country:s},void 0,i.metadata))return s}}var Mh=!1;function Nh(e,t){var n=t.nationalNumber,r=t.defaultCountry,i=t.metadata;if(Mh&&i.isNonGeographicCallingCode(e))return`001`;var a=i.getCountryCodesForCallingCode(e);if(a)return a.length===1?a[0]:jh(n,{countries:a,defaultCountry:r,metadata:i.metadata})}var Ph=`+`,Fh=`[\\-\\.\\(\\)]?`,Ih=`([`+nm+`]|`+Fh+`)`,Lh=`^\\`+Ph+Ih+`*[`+nm+`]`+Ih+`*$`,Rh=new RegExp(Lh,`g`),zh=nm,Bh=`[`+zh+`]+((\\-)*[`+zh+`])*`,Vh=`a-zA-Z`,Hh=`[`+Vh+`]+((\\-)*[`+zh+`])*`,Uh=`^(`+Bh+`\\.)*`+Hh+`\\.?$`,Wh=new RegExp(Uh,`g`),Gh=`tel:`,Kh=`;phone-context=`,qh=`;isub=`;function Jh(e){var t=e.indexOf(Kh);if(t<0)return null;var n=t+Kh.length;if(n>=e.length)return``;var r=e.indexOf(`;`,n);return r>=0?e.substring(n,r):e.substring(n)}function Yh(e){return e===null?!0:e.length===0?!1:Rh.test(e)||Wh.test(e)}function Xh(e,t){var n=t.extractFormattedPhoneNumber,r=Jh(e);if(!Yh(r))throw new vh(`NOT_A_NUMBER`);var i;if(r===null)i=n(e)||``;else{i=``,r.charAt(0)===Ph&&(i+=r);var a=e.indexOf(Gh),o;o=a>=0?a+Gh.length:0;var s=e.indexOf(Kh);i+=e.substring(o,s)}var c=i.indexOf(qh);if(c>0&&(i=i.substring(0,c)),i!==``)return i}var Zh=250,Qh=RegExp(`[`+um+nm+`]`),$h=RegExp(`[^`+nm+`#]+$`),eg=!1;function tg(e,t,n){if(t||={},n=new wp(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry))throw t.v2?new vh(`INVALID_COUNTRY`):Error(`Unknown country: ${t.defaultCountry}`);var r=rg(e,t.v2,t.extract),i=r.number,a=r.ext,o=r.error;if(!i){if(t.v2)throw o===`TOO_SHORT`?new vh(`TOO_SHORT`):new vh(`NOT_A_NUMBER`);return{}}var s=ag(i,t.defaultCountry,t.defaultCallingCode,n),c=s.country,l=s.nationalNumber,u=s.countryCallingCode,d=s.countryCallingCodeSource,f=s.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new vh(`INVALID_COUNTRY`);return{}}if(!l||l.length<$p){if(t.v2)throw new vh(`TOO_SHORT`);return{}}if(l.length>em){if(t.v2)throw new vh(`TOO_LONG`);return{}}if(t.v2){var p=new eh(u,l,n.metadata);return c&&(p.country=c),f&&(p.carrierCode=f),a&&(p.ext=a),p.__countryCallingCodeSource=d,p}var m=(t.extended?n.hasSelectedNumberingPlan():c)?Up(l,n.nationalNumberPattern()):!1;return t.extended?{country:c,countryCallingCode:u,carrierCode:f,valid:m,possible:m?!0:!!(t.extended===!0&&n.possibleLengths()&&Hp(l,n)),phone:l,ext:a}:m?ig(c,l,a):{}}function ng(e,t,n){if(e){if(e.length>Zh){if(n)throw new vh(`TOO_LONG`);return}if(t===!1)return e;var r=e.search(Qh);if(!(r<0))return e.slice(r).replace($h,``)}}function rg(e,t,n){var r=Xh(e,{extractFormattedPhoneNumber:function(e){return ng(e,n,t)}});if(!r)return{};if(!Mm(r))return Nm(r)?{error:`TOO_SHORT`}:{};var i=bh(r);return i.ext?i:{number:r}}function ig(e,t,n){var r={country:e,phone:t};return n&&(r.ext=n),r}function ag(e,t,n,r){var i=vm(Eh(e),t,n,r.metadata),a=i.countryCallingCodeSource,o=i.countryCallingCode,s=i.number,c;if(o)r.selectNumberingPlan(o);else if(s&&(t||n))r.selectNumberingPlan(t,n),t?c=t:eg&&r.isNonGeographicCallingCode(n)&&(c=`001`),o=n||Mp(t,r.metadata);else return{};if(!s)return{countryCallingCodeSource:a,countryCallingCode:o};var l=mm(Eh(s),r),u=l.nationalNumber,d=l.carrierCode,f=Nh(o,{nationalNumber:u,defaultCountry:t,metadata:r});return f&&(c=f,f===`001`||r.country(c)),{country:c,countryCallingCode:o,countryCallingCodeSource:a,nationalNumber:u,carrierCode:d}}function og(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?og(Object(n),!0).forEach(function(t){cg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):og(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lg(e,t,n){return tg(e,sg(sg({},t),{},{v2:!0}),n)}function ug(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ug(Object(n),!0).forEach(function(t){fg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ug(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pg(e,t){return vg(e)||_g(e,t)||hg(e,t)||mg()}function mg(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
42
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hg(e,t){if(e){if(typeof e==`string`)return gg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gg(e,t)}}function gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _g(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function vg(e){if(Array.isArray(e))return e}function yg(e){var t=Array.prototype.slice.call(e),n=pg(t,4),r=n[0],i=n[1],a=n[2],o=n[3],s,c,l;if(typeof r==`string`)s=r;else throw TypeError(`A text for parsing must be a string.`);if(!i||typeof i==`string`)o?(c=a,l=o):(c=void 0,l=a),i&&(c=dg({defaultCountry:i},c));else if(hp(i))a?(c=i,l=a):l=i;else throw Error(`Invalid second argument: ${i}`);return{text:s,options:c,metadata:l}}function bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bg(Object(n),!0).forEach(function(t){Sg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Sg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cg(e,t,n){t&&t.defaultCountry&&!Np(t.defaultCountry,n)&&(t=xg(xg({},t),{},{defaultCountry:void 0}));try{return lg(e,t,n)}catch(e){if(!(e instanceof vh))throw e}}function wg(){var e=yg(arguments),t=e.text,n=e.options,r=e.metadata;return Cg(t,n,r)}function Tg(){return fp(wg,arguments)}const Eg={key:0},Dg=[`aria-expanded`],Og={class:`flex gap-05 country-code-display`},kg={class:`p-075 tel-countryp-dropdown`},Ag={class:`overflow-y p-0 max-h-300px`,role:`listbox`},jg=[`aria-selected`,`onClick`],Mg={class:`tel-country`},Ng=[`id`,`required`,`placeholder`,`disabled`,`name`];var Pg=(0,u.defineComponent)({__name:`TelInput`,props:{id:{},label:{},modelValue:{},placeholder:{},excludeCountries:{},onlyCountries:{},required:{type:Boolean},disabled:{type:Boolean}},emits:[`update:modelValue`,`blur`,`focus`,`keydown`,`input`,`paste`],setup(e,{emit:t}){let n=e,r=t,i=(0,u.ref)(n.modelValue),a=(0,u.ref)(``),o=(0,u.ref)(),s=(0,u.ref)(),c=(0,u.ref)(!1),l=(0,u.ref)(null),d=(0,u.ref)(!0);(0,u.watch)(()=>i.value,e=>{r(`update:modelValue`,e)}),(0,u.watch)(()=>n.modelValue,e=>{e!==i.value&&(i.value=e)});let f=(0,u.computed)(()=>{let e=WT;if(n.excludeCountries&&n.excludeCountries.length){let t=n.excludeCountries.map(e=>e.toLowerCase());e=e.filter(e=>!t.includes(e.iso2.toLowerCase()))}if(n.onlyCountries&&n.onlyCountries.length){let t=n.onlyCountries.map(e=>e.toLowerCase());e=e.filter(e=>t.includes(e.iso2.toLowerCase()))}if(a.value.length){let t=a.value.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.iso2.toLowerCase().includes(t)||e.dialCode.includes(a.value.replace(`+`,``)))}return e}),p=(0,u.computed)(()=>{var e;return(e=o.value)?.iso2});function m(e){if(o.value=e,c.value=!1,a.value=``,!i.value)i.value=`+${o.value.dialCode}`;else if(i.value.startsWith(`+`)){let t=f.value.find(e=>i.value.startsWith(`+${e.dialCode}`));if(t&&t!==e){let e=i.value.substring(`+${t.dialCode}`.length).trim();i.value=`+${o.value.dialCode}${e?` ${e}`:``}`}}else i.value=`+${o.value.dialCode} ${i.value.replace(/^0+/,``)}`}async function h(){let{country_code:e}=await hE();m(f.value.find(t=>t.iso2===e)??f.value[0])}function g(){var e;return(e=o.value)?.iso2?o.value.iso2.toUpperCase():void 0}function _(e){if(!e)return e;try{let t=Tg(e,g());if(t&&t.isValid())return t.formatInternational()}catch(e){console.error(`Error parsing phone number:`,e)}return e}function v(){if(l.value)try{let e=Tg(i.value,g());e&&e.isValid()?(l.value.setCustomValidity(``),d.value=!0):(l.value.setCustomValidity(`Please enter a valid phone number`),d.value=!1)}catch{l.value.setCustomValidity(`Please enter a valid phone number`),d.value=!1}}function y(e){if(!e.startsWith(`+`))return!1;let t=e.replace(/\D/g,``);if(t.length<=1)return!1;for(let e of f.value)if(t.startsWith(e.dialCode)&&e!==o.value)return m(e),!0;return!1}async function b(){i.value?y(i.value):await h();let e=_(i.value);e!==i.value&&(i.value=e,r(`input`,i.value),v()),v()}function x(e){let t=e.target,{value:n}=t;if(y(n),n.startsWith(`+`)){let t=_(n);if(t!==n){i.value=t,r(`input`,e),v();return}}i.value=n,r(`input`,e),v()}function S(e){if(i.value&&!i.value.startsWith(`+`)&&o.value){let e=i.value.replace(/^0+/,``);i.value=`+${o.value.dialCode} ${e}`}else i.value&&=_(i.value);v(),r(`blur`,e)}let C=(0,u.computed)(()=>f.value.length===1&&!a.value),w=(0,u.computed)(()=>f.value.length>7||a.value);function T(){setTimeout(()=>{var e;return(e=s.value)?.focus()},100)}return(0,u.onMounted)(b),(e,t)=>{let n=(0,u.resolveDirective)(`pattern`);return(0,u.openBlock)(),(0,u.createElementBlock)(`div`,{class:(0,u.normalizeClass)([`bagel-input text-input`,{invalid:!(0,u.unref)(d)}])},[(0,u.createElementVNode)(`label`,null,[(0,u.createTextVNode)((0,u.toDisplayString)(e.label)+` `,1),e.required&&e.label?((0,u.openBlock)(),(0,u.createElementBlock)(`span`,Eg,`*`)):(0,u.createCommentVNode)(``,!0),(0,u.createElementVNode)(`div`,{dir:`ltr`,class:`flex gap-05 tel-input`,tabindex:`-1`,"aria-label":`Country Code Selector`,"aria-haspopup":`listbox`,"aria-expanded":(0,u.unref)(c)},[(0,u.createVNode)((0,u.unref)(Ya),{shown:(0,u.unref)(c),"onUpdate:shown":t[1]||=e=>(0,u.isRef)(c)?c.value=e:c=e,placement:`bottom-start`,disabled:C.value,onShow:T},{trigger:(0,u.withCtx)(()=>[(0,u.createElementVNode)(`span`,Og,[C.value?(0,u.createCommentVNode)(``,!0):((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)($),{key:0,icon:(0,u.unref)(c)?`collapse_all`:`expand_all`},null,8,[`icon`])),p.value?((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)(to),{key:1,country:p.value},null,8,[`country`])):(0,u.createCommentVNode)(``,!0)])]),default:(0,u.withCtx)(()=>[(0,u.createElementVNode)(`div`,kg,[w.value?((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)(Ug),{key:0,ref_key:`searchInput`,ref:s,modelValue:(0,u.unref)(a),"onUpdate:modelValue":t[0]||=e=>(0,u.isRef)(a)?a.value=e:a=e,"aria-label":`Search by country name or country code`,placeholder:`Search`,icon:`search`},null,8,[`modelValue`])):(0,u.createCommentVNode)(``,!0),(0,u.createElementVNode)(`ul`,Ag,[((0,u.openBlock)(!0),(0,u.createElementBlock)(u.Fragment,null,(0,u.renderList)(f.value,e=>((0,u.openBlock)(),(0,u.createElementBlock)(`li`,{key:e.iso2,role:`option`,class:`flex gap-075 pointer hover`,tabindex:`-1`,"aria-selected":p.value===e.iso2,onClick:t=>m(e)},[(0,u.createVNode)((0,u.unref)(to),{country:e.iso2},null,8,[`country`]),(0,u.createElementVNode)(`p`,Mg,(0,u.toDisplayString)(e.name),1),(0,u.createElementVNode)(`span`,null,` +`+(0,u.toDisplayString)(e.dialCode),1)],8,jg))),128))])])]),_:1},8,[`shown`,`disabled`]),(0,u.withDirectives)((0,u.createElementVNode)(`input`,{id:e.id,ref_key:`inputRef`,ref:l,"onUpdate:modelValue":t[2]||=e=>(0,u.isRef)(i)?i.value=e:i=e,required:e.required,placeholder:e.placeholder||e.label||`Phone Number`,disabled:e.disabled,type:`tel`,autocomplete:`tel`,name:e.id,tabindex:`0`,class:`national-number-input`,onBlur:t[3]||=e=>S(e),onFocus:t[4]||=e=>r(`focus`,e),onKeydown:t[5]||=e=>r(`keydown`,e),onInput:t[6]||=e=>x(e),onPaste:t[7]||=e=>r(`paste`,e)},null,40,Ng),[[u.vModelText,(0,u.unref)(i)],[n,void 0,void 0,{tel:!0}]])],8,Dg)])],2)}}}),Fg=v(Pg,[[`__scopeId`,`data-v-
|
|
42
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hg(e,t){if(e){if(typeof e==`string`)return gg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gg(e,t)}}function gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _g(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function vg(e){if(Array.isArray(e))return e}function yg(e){var t=Array.prototype.slice.call(e),n=pg(t,4),r=n[0],i=n[1],a=n[2],o=n[3],s,c,l;if(typeof r==`string`)s=r;else throw TypeError(`A text for parsing must be a string.`);if(!i||typeof i==`string`)o?(c=a,l=o):(c=void 0,l=a),i&&(c=dg({defaultCountry:i},c));else if(hp(i))a?(c=i,l=a):l=i;else throw Error(`Invalid second argument: ${i}`);return{text:s,options:c,metadata:l}}function bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bg(Object(n),!0).forEach(function(t){Sg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Sg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cg(e,t,n){t&&t.defaultCountry&&!Np(t.defaultCountry,n)&&(t=xg(xg({},t),{},{defaultCountry:void 0}));try{return lg(e,t,n)}catch(e){if(!(e instanceof vh))throw e}}function wg(){var e=yg(arguments),t=e.text,n=e.options,r=e.metadata;return Cg(t,n,r)}function Tg(){return fp(wg,arguments)}const Eg={key:0},Dg=[`aria-expanded`],Og={class:`flex gap-05 country-code-display`},kg={class:`p-075 tel-countryp-dropdown`},Ag={class:`overflow-y p-0 max-h-300px`,role:`listbox`},jg=[`aria-selected`,`onClick`],Mg={class:`tel-country`},Ng=[`id`,`required`,`placeholder`,`disabled`,`name`];var Pg=(0,u.defineComponent)({__name:`TelInput`,props:{id:{},label:{},modelValue:{},placeholder:{},excludeCountries:{},onlyCountries:{},required:{type:Boolean},disabled:{type:Boolean}},emits:[`update:modelValue`,`blur`,`focus`,`keydown`,`input`,`paste`],setup(e,{emit:t}){let n=e,r=t,i=(0,u.ref)(n.modelValue??``),a=(0,u.ref)(``),o=(0,u.ref)(),s=(0,u.ref)(),c=(0,u.ref)(!1),l=(0,u.ref)(null),d=(0,u.ref)(!0);(0,u.watch)(()=>i.value,e=>{r(`update:modelValue`,e)}),(0,u.watch)(()=>n.modelValue,e=>{e!==i.value&&(i.value=e??``)});let f=(0,u.computed)(()=>{let e=WT;if(n.excludeCountries&&n.excludeCountries.length){let t=n.excludeCountries.map(e=>e.toLowerCase());e=e.filter(e=>!t.includes(e.iso2.toLowerCase()))}if(n.onlyCountries&&n.onlyCountries.length){let t=n.onlyCountries.map(e=>e.toLowerCase());e=e.filter(e=>t.includes(e.iso2.toLowerCase()))}if(a.value.length){let t=a.value.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.iso2.toLowerCase().includes(t)||e.dialCode.includes(a.value.replace(`+`,``)))}return e}),p=(0,u.computed)(()=>{var e;return(e=o.value)?.iso2});function m(e){if(o.value=e,c.value=!1,a.value=``,!i.value)i.value=`+${o.value.dialCode}`;else if(i.value.startsWith(`+`)){let t=f.value.find(e=>i.value.startsWith(`+${e.dialCode}`));if(t&&t!==e){let e=i.value.substring(`+${t.dialCode}`.length).trim();i.value=`+${o.value.dialCode}${e?` ${e}`:``}`}}else i.value=`+${o.value.dialCode} ${i.value.replace(/^0+/,``)}`}async function h(){let{country_code:e}=await hE();m(f.value.find(t=>t.iso2===e)??f.value[0])}function g(){var e;return(e=o.value)?.iso2?o.value.iso2.toUpperCase():void 0}function _(e){if(!e)return e;try{let t=Tg(e,g());if(t&&t.isValid())return t.formatInternational()}catch(e){console.error(`Error parsing phone number:`,e)}return e}function v(){if(l.value)try{let e=Tg(i.value,g());e&&e.isValid()?(l.value.setCustomValidity(``),d.value=!0):(l.value.setCustomValidity(`Please enter a valid phone number`),d.value=!1)}catch{l.value.setCustomValidity(`Please enter a valid phone number`),d.value=!1}}function y(e){if(!e.startsWith(`+`))return!1;let t=e.replace(/\D/g,``);if(t.length<=1)return!1;for(let e of f.value)if(t.startsWith(e.dialCode)&&e!==o.value)return m(e),!0;return!1}async function b(){i.value?y(i.value):await h();let e=_(i.value);e!==i.value&&(i.value=e,r(`input`,i.value),v()),v()}function x(e){let t=e.target,{value:n}=t;if(y(n),n.startsWith(`+`)){let t=_(n);if(t!==n){i.value=t,r(`input`,e),v();return}}i.value=n,r(`input`,e),v()}function S(e){if(i.value&&!i.value.startsWith(`+`)&&o.value){let e=i.value.replace(/^0+/,``);i.value=`+${o.value.dialCode} ${e}`}else i.value&&=_(i.value);v(),r(`blur`,e)}let C=(0,u.computed)(()=>f.value.length===1&&!a.value),w=(0,u.computed)(()=>f.value.length>7||a.value);function T(){setTimeout(()=>{var e;return(e=s.value)?.focus()},100)}return(0,u.onMounted)(b),(e,t)=>{let n=(0,u.resolveDirective)(`pattern`);return(0,u.openBlock)(),(0,u.createElementBlock)(`div`,{class:(0,u.normalizeClass)([`bagel-input text-input`,{invalid:!(0,u.unref)(d)}])},[(0,u.createElementVNode)(`label`,null,[(0,u.createTextVNode)((0,u.toDisplayString)(e.label)+` `,1),e.required&&e.label?((0,u.openBlock)(),(0,u.createElementBlock)(`span`,Eg,`*`)):(0,u.createCommentVNode)(``,!0),(0,u.createElementVNode)(`div`,{dir:`ltr`,class:`flex gap-05 tel-input`,tabindex:`-1`,"aria-label":`Country Code Selector`,"aria-haspopup":`listbox`,"aria-expanded":(0,u.unref)(c)},[(0,u.createVNode)((0,u.unref)(Ya),{shown:(0,u.unref)(c),"onUpdate:shown":t[1]||=e=>(0,u.isRef)(c)?c.value=e:c=e,placement:`bottom-start`,disabled:C.value,onShow:T},{trigger:(0,u.withCtx)(()=>[(0,u.createElementVNode)(`span`,Og,[C.value?(0,u.createCommentVNode)(``,!0):((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)($),{key:0,icon:(0,u.unref)(c)?`collapse_all`:`expand_all`},null,8,[`icon`])),p.value?((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)(to),{key:1,country:p.value},null,8,[`country`])):(0,u.createCommentVNode)(``,!0)])]),default:(0,u.withCtx)(()=>[(0,u.createElementVNode)(`div`,kg,[w.value?((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)(Ug),{key:0,ref_key:`searchInput`,ref:s,modelValue:(0,u.unref)(a),"onUpdate:modelValue":t[0]||=e=>(0,u.isRef)(a)?a.value=e:a=e,"aria-label":`Search by country name or country code`,placeholder:`Search`,icon:`search`},null,8,[`modelValue`])):(0,u.createCommentVNode)(``,!0),(0,u.createElementVNode)(`ul`,Ag,[((0,u.openBlock)(!0),(0,u.createElementBlock)(u.Fragment,null,(0,u.renderList)(f.value,e=>((0,u.openBlock)(),(0,u.createElementBlock)(`li`,{key:e.iso2,role:`option`,class:`flex gap-075 pointer hover`,tabindex:`-1`,"aria-selected":p.value===e.iso2,onClick:t=>m(e)},[(0,u.createVNode)((0,u.unref)(to),{country:e.iso2},null,8,[`country`]),(0,u.createElementVNode)(`p`,Mg,(0,u.toDisplayString)(e.name),1),(0,u.createElementVNode)(`span`,null,` +`+(0,u.toDisplayString)(e.dialCode),1)],8,jg))),128))])])]),_:1},8,[`shown`,`disabled`]),(0,u.withDirectives)((0,u.createElementVNode)(`input`,{id:e.id,ref_key:`inputRef`,ref:l,"onUpdate:modelValue":t[2]||=e=>(0,u.isRef)(i)?i.value=e:i=e,required:e.required,placeholder:e.placeholder||e.label||`Phone Number`,disabled:e.disabled,type:`tel`,autocomplete:`tel`,name:e.id,tabindex:`0`,class:`national-number-input`,onBlur:t[3]||=e=>S(e),onFocus:t[4]||=e=>r(`focus`,e),onKeydown:t[5]||=e=>r(`keydown`,e),onInput:t[6]||=e=>x(e),onPaste:t[7]||=e=>r(`paste`,e)},null,40,Ng),[[u.vModelText,(0,u.unref)(i)],[n,void 0,void 0,{tel:!0}]])],8,Dg)])],2)}}}),Fg=v(Pg,[[`__scopeId`,`data-v-f19b4eea`]]);const Ig=[`title`],Lg=[`for`],Rg={key:0},zg=[`id`,`name`,`title`,`autocomplete`,`type`,`placeholder`,`disabled`,`required`,`pattern`],Bg=[`id`,`name`,`title`,`type`,`rows`,`placeholder`,`disabled`,`required`,`pattern`],Vg={key:3,class:`opacity-7 light`};var Hg=(0,u.defineComponent)({__name:`TextInput`,props:{id:{},title:{},helptext:{},name:{},placeholder:{},modelValue:{default:``},label:{},small:{type:Boolean},dense:{type:Boolean},required:{type:Boolean},pattern:{},defaultValue:{},shrink:{type:Boolean},disabled:{type:Boolean},type:{default:`text`},nativeInputAttrs:{},icon:{},iconStart:{},multiline:{type:Boolean},autoheight:{type:Boolean},code:{type:Boolean},rows:{},autocomplete:{},autofocus:{type:Boolean},onFocusout:{},onFocus:{},validate:{},getFormData:{}},emits:[`update:modelValue`,`debounce`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=(0,u.ref)(),o=(0,u.ref)();Mw(()=>a.value,()=>o.value,r.validate,r.getFormData);let s=(0,u.computed)(()=>{let e=Number(r.rows)||1;return r.autoheight&&(e=Math.max(e,String(a.value).split(`
|
|
43
43
|
`).length)),(r.multiline||r.code)&&(e=Math.max(e,4)),e}),c=he(()=>{i(`debounce`,a.value)},700);function l(){r.disabled||(i(`update:modelValue`,a.value),c())}(0,u.watch)(()=>r.modelValue,e=>{e!==a.value&&(a.value=e)},{immediate:!0});let d=()=>document.activeElement===o.value,f=()=>{var e;return(e=o.value)?.focus()};return t({focus:f,hasFocus:d}),(0,u.onMounted)(async()=>{if(r.autofocus){var e;await ye(()=>o.value).toBeTruthy(),await zo(400),(e=o.value)?.focus()}r.defaultValue&&!r.modelValue&&(a.value=r.defaultValue)}),(e,t)=>((0,u.openBlock)(),(0,u.createElementBlock)(`div`,{class:(0,u.normalizeClass)([`bagel-input text-input`,{dense:e.dense,small:e.small,shrink:e.shrink,code:e.code,textInputIconWrap:e.icon,txtInputIconStart:e.iconStart}]),title:e.title},[(0,u.createElementVNode)(`label`,{for:e.id},[(0,u.createTextVNode)((0,u.toDisplayString)(e.label)+` `,1),e.required&&e.label?((0,u.openBlock)(),(0,u.createElementBlock)(`span`,Rg,`*`)):(0,u.createCommentVNode)(``,!0),!e.multiline&&!e.autoheight&&!e.code&&s.value<2?(0,u.withDirectives)(((0,u.openBlock)(),(0,u.createElementBlock)(`input`,(0,u.mergeProps)({key:1,id:e.id,ref_key:`input`,ref:o,"onUpdate:modelValue":t[0]||=e=>(0,u.isRef)(a)?a.value=e:a=e,name:e.name,title:e.title,autocomplete:e.autocomplete,type:e.type,rows:1,placeholder:e.placeholder||e.label,disabled:e.disabled,required:e.required,pattern:e.pattern},e.nativeInputAttrs,{onFocusout:t[1]||=(...t)=>e.onFocusout&&e.onFocusout(...t),onFocus:t[2]||=(...t)=>e.onFocus&&e.onFocus(...t),onInput:l}),null,16,zg)),[[u.vModelDynamic,(0,u.unref)(a),void 0,{trim:!0}]]):(0,u.withDirectives)(((0,u.openBlock)(),(0,u.createElementBlock)(`textarea`,(0,u.mergeProps)({key:2,id:e.id,ref_key:`input`,ref:o,"onUpdate:modelValue":t[3]||=e=>(0,u.isRef)(a)?a.value=e:a=e,name:e.name,title:e.title,type:e.type,rows:s.value,placeholder:e.placeholder||e.label,disabled:e.disabled,required:e.required,pattern:e.pattern},e.nativeInputAttrs,{onInput:l,onFocusout:t[4]||=(...t)=>e.onFocusout&&e.onFocusout(...t)}),null,16,Bg)),[[u.vModelText,(0,u.unref)(a)]]),e.helptext?((0,u.openBlock)(),(0,u.createElementBlock)(`p`,Vg,(0,u.toDisplayString)(e.helptext),1)):(0,u.createCommentVNode)(``,!0),e.iconStart?((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)($),{key:4,class:`iconStart`,icon:e.iconStart},null,8,[`icon`])):(0,u.createCommentVNode)(``,!0),e.icon?((0,u.openBlock)(),(0,u.createBlock)((0,u.unref)($),{key:5,icon:e.icon},null,8,[`icon`])):(0,u.createCommentVNode)(``,!0)],8,Lg)],10,Ig))}}),Ug=v(Hg,[[`__scopeId`,`data-v-4a4590e1`]]);const Wg=[`title`],Gg=[`id`,`required`],Kg=[`for`];var qg=(0,u.defineComponent)({__name:`ToggleInput`,props:(0,u.mergeModels)({label:{},id:{},title:{},small:{type:Boolean},required:{type:Boolean},defaultValue:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=(0,u.ref)(t.id||Math.random().toString(36).slice(7)),r=(0,u.useModel)(e,`modelValue`);return(0,u.onMounted)(()=>{r.value===void 0&&(r.value=t.defaultValue)}),(e,t)=>((0,u.openBlock)(),(0,u.createElementBlock)(`div`,{class:(0,u.normalizeClass)([`bagel-input bgl-toggle`,{small:e.small}]),title:e.title},[(0,u.createElementVNode)(`div`,{class:(0,u.normalizeClass)([`switch`,{checked:r.value}])},t[1]||=[(0,u.createElementVNode)(`span`,{class:`slider rounded`},null,-1)],2),(0,u.withDirectives)((0,u.createElementVNode)(`input`,{id:n.value,"onUpdate:modelValue":t[0]||=e=>r.value=e,type:`checkbox`,required:e.required},null,8,Gg),[[u.vModelCheckbox,r.value]]),(0,u.createElementVNode)(`label`,{for:n.value},[(0,u.renderSlot)(e.$slots,`label`,{},()=>[(0,u.createTextVNode)((0,u.toDisplayString)(e.label),1)],!0)],8,Kg)],10,Wg))}}),Jg=v(qg,[[`__scopeId`,`data-v-c5e45931`]]);function Yg(e,t){return function(){return e.apply(t,arguments)}}const{toString:Xg}=Object.prototype,{getPrototypeOf:Zg}=Object,{iterator:Qg,toStringTag:$g}=Symbol,e_=(e=>t=>{let n=Xg.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),t_=e=>(e=e.toLowerCase(),t=>e_(t)===e),n_=e=>t=>typeof t===e,{isArray:r_}=Array,i_=n_(`undefined`);function a_(e){return e!==null&&!i_(e)&&e.constructor!==null&&!i_(e.constructor)&&l_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const o_=t_(`ArrayBuffer`);function s_(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&o_(e.buffer),t}const c_=n_(`string`),l_=n_(`function`),u_=n_(`number`),d_=e=>typeof e==`object`&&!!e,f_=e=>e===!0||e===!1,p_=e=>{if(e_(e)!==`object`)return!1;let t=Zg(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!($g in e)&&!(Qg in e)},m_=t_(`Date`),h_=t_(`File`),g_=t_(`Blob`),__=t_(`FileList`),v_=e=>d_(e)&&l_(e.pipe),y_=e=>{let t;return e&&(typeof FormData==`function`&&e instanceof FormData||l_(e.append)&&((t=e_(e))===`formdata`||t===`object`&&l_(e.toString)&&e.toString()===`[object FormData]`))},b_=t_(`URLSearchParams`),[x_,S_,C_,w_]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(t_),T_=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function E_(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),r_(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function D_(e,t){t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const O_=(()=>typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global)(),k_=e=>!i_(e)&&e!==O_;function A_(){let{caseless:e}=k_(this)&&this||{},t={},n=(n,r)=>{let i=e&&D_(t,r)||r;p_(t[i])&&p_(n)?t[i]=A_(t[i],n):p_(n)?t[i]=A_({},n):r_(n)?t[i]=n.slice():t[i]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&E_(arguments[e],n);return t}const j_=(e,t,n,{allOwnKeys:r}={})=>(E_(t,(t,r)=>{n&&l_(t)?e[r]=Yg(t,n):e[r]=t},{allOwnKeys:r}),e),M_=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),N_=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,`super`,{value:t.prototype}),n&&Object.assign(e.prototype,n)},P_=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Zg(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},F_=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},I_=e=>{if(!e)return null;if(r_(e))return e;let t=e.length;if(!u_(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},L_=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&Zg(Uint8Array)),R_=(e,t)=>{let n=e&&e[Qg],r=n.call(e),i;for(;(i=r.next())&&!i.done;){let n=i.value;t.call(e,n[0],n[1])}},z_=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},B_=t_(`HTMLFormElement`),V_=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),H_=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),U_=t_(`RegExp`),W_=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};E_(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},G_=e=>{W_(e,(t,n)=>{if(l_(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(l_(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},K_=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return r_(e)?r(e):r(String(e).split(t)),n},q_=()=>{},J_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Y_(e){return!!(e&&l_(e.append)&&e[$g]===`FormData`&&e[Qg])}const X_=e=>{let t=Array(10),n=(e,r)=>{if(d_(e)){if(t.indexOf(e)>=0)return;if(!(`toJSON`in e)){t[r]=e;let i=r_(e)?[]:{};return E_(e,(e,t)=>{let a=n(e,r+1);!i_(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},Z_=t_(`AsyncFunction`),Q_=e=>e&&(d_(e)||l_(e))&&l_(e.then)&&l_(e.catch),$_=((e,t)=>e?setImmediate:t?((e,t)=>(O_.addEventListener(`message`,({source:n,data:r})=>{n===O_&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),O_.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,l_(O_.postMessage)),ev=typeof queueMicrotask<`u`?queueMicrotask.bind(O_):typeof process<`u`&&process.nextTick||$_,tv=e=>e!=null&&l_(e[Qg]);var Z={isArray:r_,isArrayBuffer:o_,isBuffer:a_,isFormData:y_,isArrayBufferView:s_,isString:c_,isNumber:u_,isBoolean:f_,isObject:d_,isPlainObject:p_,isReadableStream:x_,isRequest:S_,isResponse:C_,isHeaders:w_,isUndefined:i_,isDate:m_,isFile:h_,isBlob:g_,isRegExp:U_,isFunction:l_,isStream:v_,isURLSearchParams:b_,isTypedArray:L_,isFileList:__,forEach:E_,merge:A_,extend:j_,trim:T_,stripBOM:M_,inherits:N_,toFlatObject:P_,kindOf:e_,kindOfTest:t_,endsWith:F_,toArray:I_,forEachEntry:R_,matchAll:z_,isHTMLForm:B_,hasOwnProperty:H_,hasOwnProp:H_,reduceDescriptors:W_,freezeMethods:G_,toObjectSet:K_,toCamelCase:V_,noop:q_,toFiniteNumber:J_,findKey:D_,global:O_,isContextDefined:k_,isSpecCompliantForm:Y_,toJSONObject:X_,isAsyncFn:Z_,isThenable:Q_,setImmediate:$_,asap:ev,isIterable:tv};function nv(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name=`AxiosError`,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Z.inherits(nv,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Z.toJSONObject(this.config),code:this.code,status:this.status}}});const rv=nv.prototype,iv={};[`ERR_BAD_OPTION_VALUE`,`ERR_BAD_OPTION`,`ECONNABORTED`,`ETIMEDOUT`,`ERR_NETWORK`,`ERR_FR_TOO_MANY_REDIRECTS`,`ERR_DEPRECATED`,`ERR_BAD_RESPONSE`,`ERR_BAD_REQUEST`,`ERR_CANCELED`,`ERR_NOT_SUPPORT`,`ERR_INVALID_URL`].forEach(e=>{iv[e]={value:e}}),Object.defineProperties(nv,iv),Object.defineProperty(rv,`isAxiosError`,{value:!0}),nv.from=(e,t,n,r,i,a)=>{let o=Object.create(rv);return Z.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>e!==`isAxiosError`),nv.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};var Q=nv,av=null;function ov(e){return Z.isPlainObject(e)||Z.isArray(e)}function sv(e){return Z.endsWith(e,`[]`)?e.slice(0,-2):e}function cv(e,t,n){return e?e.concat(t).map(function(e,t){return e=sv(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function lv(e){return Z.isArray(e)&&!e.some(ov)}const uv=Z.toFlatObject(Z,{},null,function(e){return/^is[A-Z]/.test(e)});function dv(e,t,n){if(!Z.isObject(e))throw TypeError(`target must be an object`);t||=new(av||FormData),n=Z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Z.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||u,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=s&&Z.isSpecCompliantForm(t);if(!Z.isFunction(i))throw TypeError(`visitor must be a function`);function l(e){if(e===null)return``;if(Z.isDate(e))return e.toISOString();if(!c&&Z.isBlob(e))throw new Q(`Blob is not supported. Use a Buffer instead.`);return Z.isArrayBuffer(e)||Z.isTypedArray(e)?c&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let s=e;if(e&&!i&&typeof e==`object`){if(Z.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Z.isArray(e)&&lv(e)||(Z.isFileList(e)||Z.endsWith(n,`[]`))&&(s=Z.toArray(e)))return n=sv(n),s.forEach(function(e,r){!(Z.isUndefined(e)||e===null)&&t.append(o===!0?cv([n],r,a):o===null?n:n+`[]`,l(e))}),!1}return ov(e)?!0:(t.append(cv(i,n,a),l(e)),!1)}let d=[],f=Object.assign(uv,{defaultVisitor:u,convertValue:l,isVisitable:ov});function p(e,n){if(!Z.isUndefined(e)){if(d.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));d.push(e),Z.forEach(e,function(e,r){let a=!(Z.isUndefined(e)||e===null)&&i.call(t,e,Z.isString(r)?r.trim():r,n,f);a===!0&&p(e,n?n.concat(r):[r])}),d.pop()}}if(!Z.isObject(e))throw TypeError(`data must be an object`);return p(e),t}var fv=dv;function pv(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function mv(e,t){this._pairs=[],e&&fv(e,this,t)}const hv=mv.prototype;hv.append=function(e,t){this._pairs.push([e,t])},hv.toString=function(e){let t=e?function(t){return e.call(this,t,pv)}:pv;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};var gv=mv;function _v(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`).replace(/%5B/gi,`[`).replace(/%5D/gi,`]`)}function vv(e,t,n){if(!t)return e;let r=n&&n.encode||_v;Z.isFunction(n)&&(n={serialize:n});let i=n&&n.serialize,a;if(a=i?i(t,n):Z.isURLSearchParams(t)?t.toString():new gv(t,n).toString(r),a){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+a}return e}var yv=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){Z.forEach(this.handlers,function(t){t!==null&&e(t)})}},bv=yv,xv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Sv=typeof URLSearchParams<`u`?URLSearchParams:gv,Cv=typeof FormData<`u`?FormData:null,wv=typeof Blob<`u`?Blob:null,Tv={isBrowser:!0,classes:{URLSearchParams:Sv,FormData:Cv,Blob:wv},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Ev={};s(Ev,{hasBrowserEnv:()=>Dv,hasStandardBrowserEnv:()=>kv,hasStandardBrowserWebWorkerEnv:()=>Av,navigator:()=>Ov,origin:()=>jv});const Dv=typeof window<`u`&&typeof document<`u`,Ov=typeof navigator==`object`&&navigator||void 0,kv=Dv&&(!Ov||[`ReactNative`,`NativeScript`,`NS`].indexOf(Ov.product)<0),Av=(()=>typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`)(),jv=Dv&&window.location.href||`http://localhost`;var Mv={...Ev,...Tv};function Nv(e,t){return fv(e,new Mv.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Mv.isNode&&Z.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Pv(e){return Z.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function Fv(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Iv(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&Z.isArray(r)?r.length:a,s)return Z.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;(!r[a]||!Z.isObject(r[a]))&&(r[a]=[]);let c=t(e,n,r[a],i);return c&&Z.isArray(r[a])&&(r[a]=Fv(r[a])),!o}if(Z.isFormData(e)&&Z.isFunction(e.entries)){let n={};return Z.forEachEntry(e,(e,r)=>{t(Pv(e),r,n,0)}),n}return null}var Lv=Iv;function Rv(e,t,n){if(Z.isString(e))try{return(t||JSON.parse)(e),Z.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}const zv={transitional:xv,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=Z.isObject(e);i&&Z.isHTMLForm(e)&&(e=new FormData(e));let a=Z.isFormData(e);if(a)return r?JSON.stringify(Lv(e)):e;if(Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)||Z.isReadableStream(e))return e;if(Z.isArrayBufferView(e))return e.buffer;if(Z.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let o;if(i){if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Nv(e,this.formSerializer).toString();if((o=Z.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let t=this.env&&this.env.FormData;return fv(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType(`application/json`,!1),Rv(e)):e}],transformResponse:[function(e){let t=this.transitional||zv.transitional,n=t&&t.forcedJSONParsing,r=this.responseType===`json`;if(Z.isResponse(e)||Z.isReadableStream(e))return e;if(e&&Z.isString(e)&&(n&&!this.responseType||r)){let n=t&&t.silentJSONParsing,i=!n&&r;try{return JSON.parse(e)}catch(e){if(i)throw e.name===`SyntaxError`?Q.from(e,Q.ERR_BAD_RESPONSE,this,null,this.response):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mv.classes.FormData,Blob:Mv.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};Z.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{zv.headers[e]={}});var Bv=zv;const Vv=Z.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]);var Hv=e=>{let t={},n,r,i;return e&&e.split(`
|
|
44
44
|
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Vv[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t};const Uv=Symbol(`internals`);function Wv(e){return e&&String(e).trim().toLowerCase()}function Gv(e){return e===!1||e==null?e:Z.isArray(e)?e.map(Gv):String(e)}function Kv(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const qv=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Jv(e,t,n,r,i){if(Z.isFunction(r))return r.call(this,t,n);if(i&&(t=n),Z.isString(t)){if(Z.isString(r))return t.indexOf(r)!==-1;if(Z.isRegExp(r))return r.test(t)}}function Yv(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function Xv(e,t){let n=Z.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var Zv=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=Wv(t);if(!i)throw Error(`header name must be a non-empty string`);let a=Z.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=Gv(e))}let a=(e,t)=>Z.forEach(e,(e,n)=>i(e,n,t));if(Z.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Z.isString(e)&&(e=e.trim())&&!qv(e))a(Hv(e),t);else if(Z.isObject(e)&&Z.isIterable(e)){let n={},r,i;for(let t of e){if(!Z.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?Z.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=Wv(e),e){let n=Z.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Kv(e);if(Z.isFunction(t))return t.call(this,e,n);if(Z.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=Wv(e),e){let n=Z.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Jv(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=Wv(e),e){let i=Z.findKey(n,e);i&&(!t||Jv(n,n[i],i,t))&&(delete n[i],r=!0)}}return Z.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||Jv(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return Z.forEach(this,(r,i)=>{let a=Z.findKey(n,i);if(a){t[a]=Gv(r),delete t[i];return}let o=e?Yv(i):String(i).trim();o!==i&&delete t[i],t[o]=Gv(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return Z.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&Z.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
|
|
45
45
|
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=this[Uv]=this[Uv]={accessors:{}},n=t.accessors,r=this.prototype;function i(e){let t=Wv(e);n[t]||(Xv(r,e),n[t]=!0)}return Z.isArray(e)?e.forEach(i):i(e),this}};Zv.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),Z.reduceDescriptors(Zv.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Z.freezeMethods(Zv);var Qv=Zv;function $v(e,t){let n=this||Bv,r=t||n,i=Qv.from(r.headers),a=r.data;return Z.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function ey(e){return!!(e&&e.__CANCEL__)}function ty(e,t,n){Q.call(this,e??`canceled`,Q.ERR_CANCELED,t,n),this.name=`CanceledError`}Z.inherits(ty,Q,{__CANCEL__:!0});var ny=ty;function ry(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Q(`Request failed with status code `+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function iy(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function ay(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}var oy=ay;function sy(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&(clearTimeout(a),a=null),e.apply(null,t)},s=(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},c=()=>i&&o(i);return[s,c]}var cy=sy;const ly=(e,t,n=3)=>{let r=0,i=oy(50,250);return cy(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,c=i(s),l=a<=o;r=a;let u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0};e(u)},n)},uy=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},dy=e=>(...t)=>Z.asap(()=>e(...t));var fy=Mv.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Mv.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Mv.origin),Mv.navigator&&/(msie|trident)/i.test(Mv.navigator.userAgent)):()=>!0,py=Mv.hasStandardBrowserEnv?{write(e,t,n,r,i,a){let o=[e+`=`+encodeURIComponent(t)];Z.isNumber(n)&&o.push(`expires=`+new Date(n).toGMTString()),Z.isString(r)&&o.push(`path=`+r),Z.isString(i)&&o.push(`domain=`+i),a===!0&&o.push(`secure`),document.cookie=o.join(`; `)},read(e){let t=document.cookie.match(RegExp(`(^|;\\s*)(`+e+`)=([^;]*)`));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,``,Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function my(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function hy(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function gy(e,t,n){let r=!my(t);return e&&(r||n==0)?hy(e,t):t}const _y=e=>e instanceof Qv?{...e}:e;function vy(e,t){t||={};let n={};function r(e,t,n,r){return Z.isPlainObject(e)&&Z.isPlainObject(t)?Z.merge.call({caseless:r},e,t):Z.isPlainObject(t)?Z.merge({},t):Z.isArray(t)?t.slice():t}function i(e,t,n,i){if(Z.isUndefined(t)){if(!Z.isUndefined(e))return r(void 0,e,n,i)}else return r(e,t,n,i)}function a(e,t){if(!Z.isUndefined(t))return r(void 0,t)}function o(e,t){if(Z.isUndefined(t)){if(!Z.isUndefined(e))return r(void 0,e)}else return r(void 0,t)}function s(n,i,a){if(a in t)return r(n,i);if(a in e)return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(_y(e),_y(t),n,!0)};return Z.forEach(Object.keys(Object.assign({},e,t)),function(r){let a=c[r]||i,o=a(e[r],t[r],r);Z.isUndefined(o)&&a!==s||(n[r]=o)}),n}var yy=e=>{let t=vy({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;t.headers=o=Qv.from(o),t.url=vv(gy(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set(`Authorization`,`Basic `+btoa((s.username||``)+`:`+(s.password?unescape(encodeURIComponent(s.password)):``)));let c;if(Z.isFormData(n)){if(Mv.hasStandardBrowserEnv||Mv.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){let[e,...t]=c?c.split(`;`).map(e=>e.trim()).filter(Boolean):[];o.setContentType([e||`multipart/form-data`,...t].join(`; `))}}if(Mv.hasStandardBrowserEnv&&(r&&Z.isFunction(r)&&(r=r(t)),r||r!==!1&&fy(t.url))){let e=i&&a&&py.read(a);e&&o.set(i,e)}return t};const by=typeof XMLHttpRequest<`u`;var xy=by&&function(e){return new Promise(function(t,n){let r=yy(e),i=r.data,a=Qv.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=Qv.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders()),i=!o||o===`text`||o===`json`?h.responseText:h.response,a={data:i,status:h.status,statusText:h.statusText,headers:r,config:e,request:h};ry(function(e){t(e),m()},function(e){n(e),m()},a),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf(`file:`)===0)||setTimeout(g)},h.onabort=function(){h&&(n(new Q(`Request aborted`,Q.ECONNABORTED,e,h)),h=null)},h.onerror=function(){n(new Q(`Network Error`,Q.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||xv;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Q(t,i.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&Z.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),Z.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=ly(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=ly(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&(n(!t||t.type?new ny(null,e,h):t),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=iy(r.url);if(_&&Mv.protocols.indexOf(_)===-1){n(new Q(`Unsupported protocol `+_+`:`,Q.ERR_BAD_REQUEST,e));return}h.send(i||null)})};const Sy=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof Q?t:new ny(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))},t),o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),e=null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>Z.asap(o),s}};var Cy=Sy;const wy=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},Ty=async function*(e,t){for await(let n of Ey(e))yield*wy(n,t)},Ey=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Dy=(e,t,n,r)=>{let i=Ty(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;if(n){let e=a+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},Oy=typeof fetch==`function`&&typeof Request==`function`&&typeof Response==`function`,ky=Oy&&typeof ReadableStream==`function`,Ay=Oy&&(typeof TextEncoder==`function`?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),jy=(e,...t)=>{try{return!!e(...t)}catch{return!1}},My=ky&&jy(()=>{let e=!1,t=new Request(Mv.origin,{body:new ReadableStream,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`);return e&&!t}),Ny=64*1024,Py=ky&&jy(()=>Z.isReadableStream(new Response(``).body)),Fy={stream:Py&&(e=>e.body)};Oy&&(e=>{[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(t=>{!Fy[t]&&(Fy[t]=Z.isFunction(e[t])?e=>e[t]():(e,n)=>{throw new Q(`Response type '${t}' is not supported`,Q.ERR_NOT_SUPPORT,n)})})})(new Response);const Iy=async e=>{if(e==null)return 0;if(Z.isBlob(e))return e.size;if(Z.isSpecCompliantForm(e)){let t=new Request(Mv.origin,{method:`POST`,body:e});return(await t.arrayBuffer()).byteLength}if(Z.isArrayBufferView(e)||Z.isArrayBuffer(e))return e.byteLength;if(Z.isURLSearchParams(e)&&(e+=``),Z.isString(e))return(await Ay(e)).byteLength},Ly=async(e,t)=>{let n=Z.toFiniteNumber(e.getContentLength());return n??Iy(t)};var Ry=Oy&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:c,responseType:l,headers:u,withCredentials:d=`same-origin`,fetchOptions:f}=yy(e);l=l?(l+``).toLowerCase():`text`;let p=Cy([i,a&&a.toAbortSignal()],o),m,h=p&&p.unsubscribe&&(()=>{p.unsubscribe()}),g;try{if(c&&My&&n!==`get`&&n!==`head`&&(g=await Ly(u,r))!==0){let e=new Request(t,{method:`POST`,body:r,duplex:`half`}),n;if(Z.isFormData(r)&&(n=e.headers.get(`content-type`))&&u.setContentType(n),e.body){let[t,n]=uy(g,ly(dy(c)));r=Dy(e.body,Ny,t,n)}}Z.isString(d)||(d=d?`include`:`omit`);let i=`credentials`in Request.prototype;m=new Request(t,{...f,signal:p,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:`half`,credentials:i?d:void 0});let a=await fetch(m),o=Py&&(l===`stream`||l===`response`);if(Py&&(s||o&&h)){let e={};[`status`,`statusText`,`headers`].forEach(t=>{e[t]=a[t]});let t=Z.toFiniteNumber(a.headers.get(`content-length`)),[n,r]=s&&uy(t,ly(dy(s),!0))||[];a=new Response(Dy(a.body,Ny,n,()=>{r&&r(),h&&h()}),e)}l||=`text`;let _=await Fy[Z.findKey(Fy,l)||`text`](a,e);return!o&&h&&h(),await new Promise((t,n)=>{ry(t,n,{data:_,headers:Qv.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:m})})}catch(t){throw h&&h(),t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new Q(`Network Error`,Q.ERR_NETWORK,e,m),{cause:t.cause||t}):Q.from(t,t&&t.code,e,m)}});const zy={http:av,xhr:xy,fetch:Ry};Z.forEach(zy,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{value:t})}catch{}Object.defineProperty(e,`adapterName`,{value:t})}});const By=e=>`- ${e}`,Vy=e=>Z.isFunction(e)||e===null||e===!1;var Hy={getAdapter:e=>{e=Z.isArray(e)?e:[e];let{length:t}=e,n,r,i={};for(let a=0;a<t;a++){n=e[a];let t;if(r=n,!Vy(n)&&(r=zy[(t=String(n)).toLowerCase()],r===void 0))throw new Q(`Unknown adapter '${t}'`);if(r)break;i[t||`#`+a]=r}if(!r){let e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`)),n=t?e.length>1?`since :
|
package/dist/index.mjs
CHANGED
|
@@ -39,7 +39,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
39
39
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rh(e,t){if(e){if(typeof e==`string`)return zh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zh(e,t)}}function zh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Bh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Bh(Object(n),!0).forEach(function(t){Hh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Hh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Uh={formatExtension:function(e,t,n){return`${e}${n.ext()}${t}`}};function Wh(e,t,n,r){if(n=n?Vh(Vh({},Uh),n):Uh,r=new Em(r),e.country&&e.country!==`001`){if(!r.hasCountry(e.country))throw Error(`Unknown country: ${e.country}`);r.country(e.country)}else if(e.countryCallingCode)r.selectNumberingPlan(e.countryCallingCode);else return e.phone||``;var i=r.countryCallingCode(),a=n.v2?e.nationalNumber:e.phone,o;switch(t){case`NATIONAL`:return a?(o=Gh(a,e.carrierCode,`NATIONAL`,r,n),qh(o,e.ext,r,n.formatExtension)):``;case`INTERNATIONAL`:return a?(o=Gh(a,null,`INTERNATIONAL`,r,n),o=`+${i} ${o}`,qh(o,e.ext,r,n.formatExtension)):`+${i}`;case`E.164`:return`+${i}${a}`;case`RFC3966`:return Ih({number:`+${i}${a}`,ext:e.ext});case`IDD`:if(!n.fromCountry)return;var s=Jh(a,e.carrierCode,i,n.fromCountry,r);return qh(s,e.ext,r,n.formatExtension);default:throw Error(`Unknown "format" argument passed to "formatNumber()": "${t}"`)}}function Gh(e,t,n,r,i){var a=Kh(r.formats(),e);return a?Ch(e,a,{useInternationalFormat:n===`INTERNATIONAL`,withNationalPrefix:!(a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1),carrierCode:t,metadata:r}):e}function Kh(e,t){for(var n=Lh(e),r;!(r=n()).done;){var i=r.value;if(i.leadingDigitsPatterns().length>0){var a=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(t.search(a)!==0)continue}if(Gm(t,i.pattern()))return i}}function qh(e,t,n,r){return t?r(e,t,n):e}function Jh(e,t,n,r,i){var a=Pm(r,i.metadata);if(a===n){var o=Gh(e,t,`NATIONAL`,i);return n===`1`?n+` `+o:o}var s=Th(r,void 0,i.metadata);if(s)return`${s} ${n} ${Gh(e,null,`INTERNATIONAL`,i)}`}function Yh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yh(Object(n),!0).forEach(function(t){Zh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qh(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function $h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function eg(e,t,n){return t&&$h(e.prototype,t),n&&$h(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}var tg=!1,ng=function(){function e(t,n,r){if(Qh(this,e),!t)throw TypeError(`First argument is required`);if(typeof t!=`string`)throw TypeError(`First argument must be a string`);if(typeof t==`string`){if(t[0]===`+`&&!n)throw TypeError("`metadata` argument not passed");if(_m(n)&&_m(n.countries)){r=n;var i=t;if(!ag.test(i))throw Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var a=bh(i,void 0,void 0,r),o=a.countryCallingCode,s=a.number;if(n=s,t=o,!n)throw Error("Invalid `number` argument passed: too short")}}if(!n)throw TypeError("`nationalNumber` argument is required");if(typeof n!=`string`)throw TypeError("`nationalNumber` argument must be a string");Mm(r);var c=ig(t,r),l=c.country,u=c.countryCallingCode;this.country=l,this.countryCallingCode=u,this.nationalNumber=n,this.number=`+`+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return eg(e,[{key:`setExt`,value:function(e){this.ext=e}},{key:`getPossibleCountries`,value:function(){return this.country?[this.country]:$m(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:`isPossible`,value:function(){return Um(this,{v2:!0},this.getMetadata())}},{key:`isValid`,value:function(){return Qm(this,{v2:!0},this.getMetadata())}},{key:`isNonGeographic`,value:function(){var e=new Em(this.getMetadata());return e.isNonGeographicCallingCode(this.countryCallingCode)}},{key:`isEqual`,value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:`getType`,value:function(){return Xm(this,{v2:!0},this.getMetadata())}},{key:`format`,value:function(e,t){return Wh(this,e,t?Xh(Xh({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:`formatNational`,value:function(e){return this.format(`NATIONAL`,e)}},{key:`formatInternational`,value:function(e){return this.format(`INTERNATIONAL`,e)}},{key:`getURI`,value:function(e){return this.format(`RFC3966`,e)}}]),e}(),rg=function(e){return/^[A-Z]{2}$/.test(e)};function ig(e,t){var n,r,i=new Em(t);return rg(e)?(n=e,i.selectNumberingPlan(n),r=i.countryCallingCode()):(r=e,tg&&i.isNonGeographicCallingCode(r)&&(n=`001`)),{country:n,countryCallingCode:r}}var ag=/^\+\d+$/;function og(e){"@babel/helpers - typeof";return og=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},og(e)}function sg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function cg(e,t,n){return t&&sg(e.prototype,t),n&&sg(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function lg(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function ug(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&vg(e,t)}function dg(e){var t=gg();return function(){var n=yg(e),r;if(t){var i=yg(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return fg(this,r)}}function fg(e,t){if(t&&(og(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return pg(e)}function pg(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function mg(e){var t=typeof Map==`function`?new Map:void 0;return mg=function(e){if(e===null||!_g(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return hg(e,arguments,yg(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),vg(n,e)},mg(e)}function hg(e,t,n){return hg=gg()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=Function.bind.apply(e,r),a=new i;return n&&vg(a,n.prototype),a},hg.apply(null,arguments)}function gg(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _g(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function vg(e,t){return vg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},vg(e,t)}function yg(e){return yg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},yg(e)}var bg=function(e){ug(n,e);var t=dg(n);function n(e){var r;return lg(this,n),r=t.call(this,e),Object.setPrototypeOf(pg(r),n.prototype),r.name=r.constructor.name,r}return cg(n)}(mg(Error)),xg=RegExp(`(?:`+Oh()+`)$`,`i`);function Sg(e){var t=e.search(xg);if(t<0)return{};for(var n=e.slice(0,t),r=e.match(xg),i=1;i<r.length;){if(r[i])return{number:n,ext:r[i]};i++}}var Cg={0:`0`,1:`1`,2:`2`,3:`3`,4:`4`,5:`5`,6:`6`,7:`7`,8:`8`,9:`9`,"0":`0`,"1":`1`,"2":`2`,"3":`3`,"4":`4`,"5":`5`,"6":`6`,"7":`7`,"8":`8`,"9":`9`,"٠":`0`,"١":`1`,"٢":`2`,"٣":`3`,"٤":`4`,"٥":`5`,"٦":`6`,"٧":`7`,"٨":`8`,"٩":`9`,"۰":`0`,"۱":`1`,"۲":`2`,"۳":`3`,"۴":`4`,"۵":`5`,"۶":`6`,"۷":`7`,"۸":`8`,"۹":`9`};function wg(e){return Cg[e]}function Tg(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=Eg(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
40
40
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eg(e,t){if(e){if(typeof e==`string`)return Dg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dg(e,t)}}function Dg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Og(e){for(var t=``,n=Tg(e.split(``)),r;!(r=n()).done;){var i=r.value;t+=kg(i,t)||``}return t}function kg(e,t,n){if(e===`+`){if(t){typeof n==`function`&&n(`end`);return}return`+`}return wg(e)}function Ag(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=jg(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
41
41
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jg(e,t){if(e){if(typeof e==`string`)return Mg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mg(e,t)}}function Mg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ng(e,t){var n=t.countries,r=t.defaultCountry,i=t.metadata;i=new Em(i);for(var a=Ag(n),o;!(o=a()).done;){var s=o.value;if(i.country(s),i.leadingDigits()){if(e&&e.search(i.leadingDigits())===0)return s}else if(Xm({phone:e,country:s},void 0,i.metadata))return s}}var Pg=!1;function Fg(e,t){var n=t.nationalNumber,r=t.defaultCountry,i=t.metadata;if(Pg&&i.isNonGeographicCallingCode(e))return`001`;var a=i.getCountryCodesForCallingCode(e);if(a)return a.length===1?a[0]:Ng(n,{countries:a,defaultCountry:r,metadata:i.metadata})}var Ig=`+`,Lg=`[\\-\\.\\(\\)]?`,Rg=`([`+ih+`]|`+Lg+`)`,zg=`^\\`+Ig+Rg+`*[`+ih+`]`+Rg+`*$`,Bg=new RegExp(zg,`g`),Vg=ih,Hg=`[`+Vg+`]+((\\-)*[`+Vg+`])*`,Ug=`a-zA-Z`,Wg=`[`+Ug+`]+((\\-)*[`+Vg+`])*`,Gg=`^(`+Hg+`\\.)*`+Wg+`\\.?$`,Kg=new RegExp(Gg,`g`),qg=`tel:`,Jg=`;phone-context=`,Yg=`;isub=`;function Xg(e){var t=e.indexOf(Jg);if(t<0)return null;var n=t+Jg.length;if(n>=e.length)return``;var r=e.indexOf(`;`,n);return r>=0?e.substring(n,r):e.substring(n)}function Zg(e){return e===null?!0:e.length===0?!1:Bg.test(e)||Kg.test(e)}function Qg(e,t){var n=t.extractFormattedPhoneNumber,r=Xg(e);if(!Zg(r))throw new bg(`NOT_A_NUMBER`);var i;if(r===null)i=n(e)||``;else{i=``,r.charAt(0)===Ig&&(i+=r);var a=e.indexOf(qg),o;o=a>=0?a+qg.length:0;var s=e.indexOf(Jg);i+=e.substring(o,s)}var c=i.indexOf(Yg);if(c>0&&(i=i.substring(0,c)),i!==``)return i}var $g=250,e_=RegExp(`[`+fh+ih+`]`),t_=RegExp(`[^`+ih+`#]+$`),n_=!1;function r_(e,t,n){if(t||={},n=new Em(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry))throw t.v2?new bg(`INVALID_COUNTRY`):Error(`Unknown country: ${t.defaultCountry}`);var r=a_(e,t.v2,t.extract),i=r.number,a=r.ext,o=r.error;if(!i){if(t.v2)throw o===`TOO_SHORT`?new bg(`TOO_SHORT`):new bg(`NOT_A_NUMBER`);return{}}var s=s_(i,t.defaultCountry,t.defaultCallingCode,n),c=s.country,l=s.nationalNumber,u=s.countryCallingCode,d=s.countryCallingCodeSource,f=s.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new bg(`INVALID_COUNTRY`);return{}}if(!l||l.length<th){if(t.v2)throw new bg(`TOO_SHORT`);return{}}if(l.length>nh){if(t.v2)throw new bg(`TOO_LONG`);return{}}if(t.v2){var p=new ng(u,l,n.metadata);return c&&(p.country=c),f&&(p.carrierCode=f),a&&(p.ext=a),p.__countryCallingCodeSource=d,p}var m=(t.extended?n.hasSelectedNumberingPlan():c)?Gm(l,n.nationalNumberPattern()):!1;return t.extended?{country:c,countryCallingCode:u,carrierCode:f,valid:m,possible:m?!0:!!(t.extended===!0&&n.possibleLengths()&&Wm(l,n)),phone:l,ext:a}:m?o_(c,l,a):{}}function i_(e,t,n){if(e){if(e.length>$g){if(n)throw new bg(`TOO_LONG`);return}if(t===!1)return e;var r=e.search(e_);if(!(r<0))return e.slice(r).replace(t_,``)}}function a_(e,t,n){var r=Qg(e,{extractFormattedPhoneNumber:function(e){return i_(e,n,t)}});if(!r)return{};if(!Ph(r))return Fh(r)?{error:`TOO_SHORT`}:{};var i=Sg(r);return i.ext?i:{number:r}}function o_(e,t,n){var r={country:e,phone:t};return n&&(r.ext=n),r}function s_(e,t,n,r){var i=bh(Og(e),t,n,r.metadata),a=i.countryCallingCodeSource,o=i.countryCallingCode,s=i.number,c;if(o)r.selectNumberingPlan(o);else if(s&&(t||n))r.selectNumberingPlan(t,n),t?c=t:n_&&r.isNonGeographicCallingCode(n)&&(c=`001`),o=n||Pm(t,r.metadata);else return{};if(!s)return{countryCallingCodeSource:a,countryCallingCode:o};var l=gh(Og(s),r),u=l.nationalNumber,d=l.carrierCode,f=Fg(o,{nationalNumber:u,defaultCountry:t,metadata:r});return f&&(c=f,f===`001`||r.country(c)),{country:c,countryCallingCode:o,countryCallingCodeSource:a,nationalNumber:u,carrierCode:d}}function c_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c_(Object(n),!0).forEach(function(t){u_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d_(e,t,n){return r_(e,l_(l_({},t),{},{v2:!0}),n)}function f_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?f_(Object(n),!0).forEach(function(t){m_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h_(e,t){return b_(e)||y_(e,t)||__(e,t)||g_()}function g_(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
42
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function __(e,t){if(e){if(typeof e==`string`)return v_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v_(e,t)}}function v_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y_(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function b_(e){if(Array.isArray(e))return e}function x_(e){var t=Array.prototype.slice.call(e),n=h_(t,4),r=n[0],i=n[1],a=n[2],o=n[3],s,c,l;if(typeof r==`string`)s=r;else throw TypeError(`A text for parsing must be a string.`);if(!i||typeof i==`string`)o?(c=a,l=o):(c=void 0,l=a),i&&(c=p_({defaultCountry:i},c));else if(_m(i))a?(c=i,l=a):l=i;else throw Error(`Invalid second argument: ${i}`);return{text:s,options:c,metadata:l}}function S_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?S_(Object(n),!0).forEach(function(t){w_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T_(e,t,n){t&&t.defaultCountry&&!Fm(t.defaultCountry,n)&&(t=C_(C_({},t),{},{defaultCountry:void 0}));try{return d_(e,t,n)}catch(e){if(!(e instanceof bg))throw e}}function E_(){var e=x_(arguments),t=e.text,n=e.options,r=e.metadata;return T_(t,n,r)}function D_(){return mm(E_,arguments)}const O_={key:0},k_=[`aria-expanded`],A_={class:`flex gap-05 country-code-display`},j_={class:`p-075 tel-countryp-dropdown`},M_={class:`overflow-y p-0 max-h-300px`,role:`listbox`},N_=[`aria-selected`,`onClick`],P_={class:`tel-country`},F_=[`id`,`required`,`placeholder`,`disabled`,`name`];var I_=h({__name:`TelInput`,props:{id:{},label:{},modelValue:{},placeholder:{},excludeCountries:{},onlyCountries:{},required:{type:Boolean},disabled:{type:Boolean}},emits:[`update:modelValue`,`blur`,`focus`,`keydown`,`input`,`paste`],setup(e,{emit:t}){let r=e,i=t,a=L(r.modelValue),s=L(``),f=L(),h=L(),g=L(!1),_=L(null),v=L(!0);W(()=>a.value,e=>{i(`update:modelValue`,e)}),W(()=>r.modelValue,e=>{e!==a.value&&(a.value=e)});let y=o(()=>{let e=qE;if(r.excludeCountries&&r.excludeCountries.length){let t=r.excludeCountries.map(e=>e.toLowerCase());e=e.filter(e=>!t.includes(e.iso2.toLowerCase()))}if(r.onlyCountries&&r.onlyCountries.length){let t=r.onlyCountries.map(e=>e.toLowerCase());e=e.filter(e=>t.includes(e.iso2.toLowerCase()))}if(s.value.length){let t=s.value.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.iso2.toLowerCase().includes(t)||e.dialCode.includes(s.value.replace(`+`,``)))}return e}),b=o(()=>{var e;return(e=f.value)?.iso2});function S(e){if(f.value=e,g.value=!1,s.value=``,!a.value)a.value=`+${f.value.dialCode}`;else if(a.value.startsWith(`+`)){let t=y.value.find(e=>a.value.startsWith(`+${e.dialCode}`));if(t&&t!==e){let e=a.value.substring(`+${t.dialCode}`.length).trim();a.value=`+${f.value.dialCode}${e?` ${e}`:``}`}}else a.value=`+${f.value.dialCode} ${a.value.replace(/^0+/,``)}`}async function C(){let{country_code:e}=await vD();S(y.value.find(t=>t.iso2===e)??y.value[0])}function w(){var e;return(e=f.value)?.iso2?f.value.iso2.toUpperCase():void 0}function T(e){if(!e)return e;try{let t=D_(e,w());if(t&&t.isValid())return t.formatInternational()}catch(e){console.error(`Error parsing phone number:`,e)}return e}function E(){if(_.value)try{let e=D_(a.value,w());e&&e.isValid()?(_.value.setCustomValidity(``),v.value=!0):(_.value.setCustomValidity(`Please enter a valid phone number`),v.value=!1)}catch{_.value.setCustomValidity(`Please enter a valid phone number`),v.value=!1}}function O(e){if(!e.startsWith(`+`))return!1;let t=e.replace(/\D/g,``);if(t.length<=1)return!1;for(let e of y.value)if(t.startsWith(e.dialCode)&&e!==f.value)return S(e),!0;return!1}async function k(){a.value?O(a.value):await C();let e=T(a.value);e!==a.value&&(a.value=e,i(`input`,a.value),E()),E()}function A(e){let t=e.target,{value:n}=t;if(O(n),n.startsWith(`+`)){let t=T(n);if(t!==n){a.value=t,i(`input`,e),E();return}}a.value=n,i(`input`,e),E()}function M(e){if(a.value&&!a.value.startsWith(`+`)&&f.value){let e=a.value.replace(/^0+/,``);a.value=`+${f.value.dialCode} ${e}`}else a.value&&=T(a.value);E(),i(`blur`,e)}let N=o(()=>y.value.length===1&&!s.value),ee=o(()=>y.value.length>7||s.value);function F(){setTimeout(()=>{var e;return(e=h.value)?.focus()},100)}return j(k),(e,t)=>{let r=ie(`pattern`);return P(),u(`div`,{class:D([`bagel-input text-input`,{invalid:!U(v)}])},[d(`label`,null,[p(V(e.label)+` `,1),e.required&&e.label?(P(),u(`span`,O_,`*`)):l(``,!0),d(`div`,{dir:`ltr`,class:`flex gap-05 tel-input`,tabindex:`-1`,"aria-label":`Country Code Selector`,"aria-haspopup":`listbox`,"aria-expanded":U(g)},[m(U(qo),{shown:U(g),"onUpdate:shown":t[1]||=e=>x(g)?g.value=e:g=e,placement:`bottom-start`,disabled:N.value,onShow:F},{trigger:G(()=>[d(`span`,A_,[N.value?l(``,!0):(P(),c(U($),{key:0,icon:U(g)?`collapse_all`:`expand_all`},null,8,[`icon`])),b.value?(P(),c(U($o),{key:1,country:b.value},null,8,[`country`])):l(``,!0)])]),default:G(()=>[d(`div`,j_,[ee.value?(P(),c(U(G_),{key:0,ref_key:`searchInput`,ref:h,modelValue:U(s),"onUpdate:modelValue":t[0]||=e=>x(s)?s.value=e:s=e,"aria-label":`Search by country name or country code`,placeholder:`Search`,icon:`search`},null,8,[`modelValue`])):l(``,!0),d(`ul`,M_,[(P(!0),u(n,null,R(y.value,e=>(P(),u(`li`,{key:e.iso2,role:`option`,class:`flex gap-075 pointer hover`,tabindex:`-1`,"aria-selected":b.value===e.iso2,onClick:t=>S(e)},[m(U($o),{country:e.iso2},null,8,[`country`]),d(`p`,P_,V(e.name),1),d(`span`,null,` +`+V(e.dialCode),1)],8,N_))),128))])])]),_:1},8,[`shown`,`disabled`]),K(d(`input`,{id:e.id,ref_key:`inputRef`,ref:_,"onUpdate:modelValue":t[2]||=e=>x(a)?a.value=e:a=e,required:e.required,placeholder:e.placeholder||e.label||`Phone Number`,disabled:e.disabled,type:`tel`,autocomplete:`tel`,name:e.id,tabindex:`0`,class:`national-number-input`,onBlur:t[3]||=e=>M(e),onFocus:t[4]||=e=>i(`focus`,e),onKeydown:t[5]||=e=>i(`keydown`,e),onInput:t[6]||=e=>A(e),onPaste:t[7]||=e=>i(`paste`,e)},null,40,F_),[[pe,U(a)],[r,void 0,void 0,{tel:!0}]])],8,k_)])],2)}}}),L_=q(I_,[[`__scopeId`,`data-v-
|
|
42
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function __(e,t){if(e){if(typeof e==`string`)return v_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v_(e,t)}}function v_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y_(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function b_(e){if(Array.isArray(e))return e}function x_(e){var t=Array.prototype.slice.call(e),n=h_(t,4),r=n[0],i=n[1],a=n[2],o=n[3],s,c,l;if(typeof r==`string`)s=r;else throw TypeError(`A text for parsing must be a string.`);if(!i||typeof i==`string`)o?(c=a,l=o):(c=void 0,l=a),i&&(c=p_({defaultCountry:i},c));else if(_m(i))a?(c=i,l=a):l=i;else throw Error(`Invalid second argument: ${i}`);return{text:s,options:c,metadata:l}}function S_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?S_(Object(n),!0).forEach(function(t){w_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T_(e,t,n){t&&t.defaultCountry&&!Fm(t.defaultCountry,n)&&(t=C_(C_({},t),{},{defaultCountry:void 0}));try{return d_(e,t,n)}catch(e){if(!(e instanceof bg))throw e}}function E_(){var e=x_(arguments),t=e.text,n=e.options,r=e.metadata;return T_(t,n,r)}function D_(){return mm(E_,arguments)}const O_={key:0},k_=[`aria-expanded`],A_={class:`flex gap-05 country-code-display`},j_={class:`p-075 tel-countryp-dropdown`},M_={class:`overflow-y p-0 max-h-300px`,role:`listbox`},N_=[`aria-selected`,`onClick`],P_={class:`tel-country`},F_=[`id`,`required`,`placeholder`,`disabled`,`name`];var I_=h({__name:`TelInput`,props:{id:{},label:{},modelValue:{},placeholder:{},excludeCountries:{},onlyCountries:{},required:{type:Boolean},disabled:{type:Boolean}},emits:[`update:modelValue`,`blur`,`focus`,`keydown`,`input`,`paste`],setup(e,{emit:t}){let r=e,i=t,a=L(r.modelValue??``),s=L(``),f=L(),h=L(),g=L(!1),_=L(null),v=L(!0);W(()=>a.value,e=>{i(`update:modelValue`,e)}),W(()=>r.modelValue,e=>{e!==a.value&&(a.value=e??``)});let y=o(()=>{let e=qE;if(r.excludeCountries&&r.excludeCountries.length){let t=r.excludeCountries.map(e=>e.toLowerCase());e=e.filter(e=>!t.includes(e.iso2.toLowerCase()))}if(r.onlyCountries&&r.onlyCountries.length){let t=r.onlyCountries.map(e=>e.toLowerCase());e=e.filter(e=>t.includes(e.iso2.toLowerCase()))}if(s.value.length){let t=s.value.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.iso2.toLowerCase().includes(t)||e.dialCode.includes(s.value.replace(`+`,``)))}return e}),b=o(()=>{var e;return(e=f.value)?.iso2});function S(e){if(f.value=e,g.value=!1,s.value=``,!a.value)a.value=`+${f.value.dialCode}`;else if(a.value.startsWith(`+`)){let t=y.value.find(e=>a.value.startsWith(`+${e.dialCode}`));if(t&&t!==e){let e=a.value.substring(`+${t.dialCode}`.length).trim();a.value=`+${f.value.dialCode}${e?` ${e}`:``}`}}else a.value=`+${f.value.dialCode} ${a.value.replace(/^0+/,``)}`}async function C(){let{country_code:e}=await vD();S(y.value.find(t=>t.iso2===e)??y.value[0])}function w(){var e;return(e=f.value)?.iso2?f.value.iso2.toUpperCase():void 0}function T(e){if(!e)return e;try{let t=D_(e,w());if(t&&t.isValid())return t.formatInternational()}catch(e){console.error(`Error parsing phone number:`,e)}return e}function E(){if(_.value)try{let e=D_(a.value,w());e&&e.isValid()?(_.value.setCustomValidity(``),v.value=!0):(_.value.setCustomValidity(`Please enter a valid phone number`),v.value=!1)}catch{_.value.setCustomValidity(`Please enter a valid phone number`),v.value=!1}}function O(e){if(!e.startsWith(`+`))return!1;let t=e.replace(/\D/g,``);if(t.length<=1)return!1;for(let e of y.value)if(t.startsWith(e.dialCode)&&e!==f.value)return S(e),!0;return!1}async function k(){a.value?O(a.value):await C();let e=T(a.value);e!==a.value&&(a.value=e,i(`input`,a.value),E()),E()}function A(e){let t=e.target,{value:n}=t;if(O(n),n.startsWith(`+`)){let t=T(n);if(t!==n){a.value=t,i(`input`,e),E();return}}a.value=n,i(`input`,e),E()}function M(e){if(a.value&&!a.value.startsWith(`+`)&&f.value){let e=a.value.replace(/^0+/,``);a.value=`+${f.value.dialCode} ${e}`}else a.value&&=T(a.value);E(),i(`blur`,e)}let N=o(()=>y.value.length===1&&!s.value),ee=o(()=>y.value.length>7||s.value);function F(){setTimeout(()=>{var e;return(e=h.value)?.focus()},100)}return j(k),(e,t)=>{let r=ie(`pattern`);return P(),u(`div`,{class:D([`bagel-input text-input`,{invalid:!U(v)}])},[d(`label`,null,[p(V(e.label)+` `,1),e.required&&e.label?(P(),u(`span`,O_,`*`)):l(``,!0),d(`div`,{dir:`ltr`,class:`flex gap-05 tel-input`,tabindex:`-1`,"aria-label":`Country Code Selector`,"aria-haspopup":`listbox`,"aria-expanded":U(g)},[m(U(qo),{shown:U(g),"onUpdate:shown":t[1]||=e=>x(g)?g.value=e:g=e,placement:`bottom-start`,disabled:N.value,onShow:F},{trigger:G(()=>[d(`span`,A_,[N.value?l(``,!0):(P(),c(U($),{key:0,icon:U(g)?`collapse_all`:`expand_all`},null,8,[`icon`])),b.value?(P(),c(U($o),{key:1,country:b.value},null,8,[`country`])):l(``,!0)])]),default:G(()=>[d(`div`,j_,[ee.value?(P(),c(U(G_),{key:0,ref_key:`searchInput`,ref:h,modelValue:U(s),"onUpdate:modelValue":t[0]||=e=>x(s)?s.value=e:s=e,"aria-label":`Search by country name or country code`,placeholder:`Search`,icon:`search`},null,8,[`modelValue`])):l(``,!0),d(`ul`,M_,[(P(!0),u(n,null,R(y.value,e=>(P(),u(`li`,{key:e.iso2,role:`option`,class:`flex gap-075 pointer hover`,tabindex:`-1`,"aria-selected":b.value===e.iso2,onClick:t=>S(e)},[m(U($o),{country:e.iso2},null,8,[`country`]),d(`p`,P_,V(e.name),1),d(`span`,null,` +`+V(e.dialCode),1)],8,N_))),128))])])]),_:1},8,[`shown`,`disabled`]),K(d(`input`,{id:e.id,ref_key:`inputRef`,ref:_,"onUpdate:modelValue":t[2]||=e=>x(a)?a.value=e:a=e,required:e.required,placeholder:e.placeholder||e.label||`Phone Number`,disabled:e.disabled,type:`tel`,autocomplete:`tel`,name:e.id,tabindex:`0`,class:`national-number-input`,onBlur:t[3]||=e=>M(e),onFocus:t[4]||=e=>i(`focus`,e),onKeydown:t[5]||=e=>i(`keydown`,e),onInput:t[6]||=e=>A(e),onPaste:t[7]||=e=>i(`paste`,e)},null,40,F_),[[pe,U(a)],[r,void 0,void 0,{tel:!0}]])],8,k_)])],2)}}}),L_=q(I_,[[`__scopeId`,`data-v-f19b4eea`]]);const R_=[`title`],z_=[`for`],B_={key:0},V_=[`id`,`name`,`title`,`autocomplete`,`type`,`placeholder`,`disabled`,`required`,`pattern`],H_=[`id`,`name`,`title`,`type`,`rows`,`placeholder`,`disabled`,`required`,`pattern`],U_={key:3,class:`opacity-7 light`};var W_=h({__name:`TextInput`,props:{id:{},title:{},helptext:{},name:{},placeholder:{},modelValue:{default:``},label:{},small:{type:Boolean},dense:{type:Boolean},required:{type:Boolean},pattern:{},defaultValue:{},shrink:{type:Boolean},disabled:{type:Boolean},type:{default:`text`},nativeInputAttrs:{},icon:{},iconStart:{},multiline:{type:Boolean},autoheight:{type:Boolean},code:{type:Boolean},rows:{},autocomplete:{},autofocus:{type:Boolean},onFocusout:{},onFocus:{},validate:{},getFormData:{}},emits:[`update:modelValue`,`debounce`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=L(),s=L();FT(()=>a.value,()=>s.value,r.validate,r.getFormData);let f=o(()=>{let e=Number(r.rows)||1;return r.autoheight&&(e=Math.max(e,String(a.value).split(`
|
|
43
43
|
`).length)),(r.multiline||r.code)&&(e=Math.max(e,4)),e}),m=dt(()=>{i(`debounce`,a.value)},700);function h(){r.disabled||(i(`update:modelValue`,a.value),m())}W(()=>r.modelValue,e=>{e!==a.value&&(a.value=e)},{immediate:!0});let g=()=>document.activeElement===s.value,_=()=>{var e;return(e=s.value)?.focus()};return t({focus:_,hasFocus:g}),j(async()=>{if(r.autofocus){var e;await ht(()=>s.value).toBeTruthy(),await Rs(400),(e=s.value)?.focus()}r.defaultValue&&!r.modelValue&&(a.value=r.defaultValue)}),(e,t)=>(P(),u(`div`,{class:D([`bagel-input text-input`,{dense:e.dense,small:e.small,shrink:e.shrink,code:e.code,textInputIconWrap:e.icon,txtInputIconStart:e.iconStart}]),title:e.title},[d(`label`,{for:e.id},[p(V(e.label)+` `,1),e.required&&e.label?(P(),u(`span`,B_,`*`)):l(``,!0),!e.multiline&&!e.autoheight&&!e.code&&f.value<2?K((P(),u(`input`,T({key:1,id:e.id,ref_key:`input`,ref:s,"onUpdate:modelValue":t[0]||=e=>x(a)?a.value=e:a=e,name:e.name,title:e.title,autocomplete:e.autocomplete,type:e.type,rows:1,placeholder:e.placeholder||e.label,disabled:e.disabled,required:e.required,pattern:e.pattern},e.nativeInputAttrs,{onFocusout:t[1]||=(...t)=>e.onFocusout&&e.onFocusout(...t),onFocus:t[2]||=(...t)=>e.onFocus&&e.onFocus(...t),onInput:h}),null,16,V_)),[[de,U(a),void 0,{trim:!0}]]):K((P(),u(`textarea`,T({key:2,id:e.id,ref_key:`input`,ref:s,"onUpdate:modelValue":t[3]||=e=>x(a)?a.value=e:a=e,name:e.name,title:e.title,type:e.type,rows:f.value,placeholder:e.placeholder||e.label,disabled:e.disabled,required:e.required,pattern:e.pattern},e.nativeInputAttrs,{onInput:h,onFocusout:t[4]||=(...t)=>e.onFocusout&&e.onFocusout(...t)}),null,16,H_)),[[pe,U(a)]]),e.helptext?(P(),u(`p`,U_,V(e.helptext),1)):l(``,!0),e.iconStart?(P(),c(U($),{key:4,class:`iconStart`,icon:e.iconStart},null,8,[`icon`])):l(``,!0),e.icon?(P(),c(U($),{key:5,icon:e.icon},null,8,[`icon`])):l(``,!0)],8,z_)],10,R_))}}),G_=q(W_,[[`__scopeId`,`data-v-4a4590e1`]]);const K_=[`title`],q_=[`id`,`required`],J_=[`for`];var Y_=h({__name:`ToggleInput`,props:w({label:{},id:{},title:{},small:{type:Boolean},required:{type:Boolean},defaultValue:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=L(t.id||Math.random().toString(36).slice(7)),r=ce(e,`modelValue`);return j(()=>{r.value===void 0&&(r.value=t.defaultValue)}),(e,t)=>(P(),u(`div`,{class:D([`bagel-input bgl-toggle`,{small:e.small}]),title:e.title},[d(`div`,{class:D([`switch`,{checked:r.value}])},t[1]||=[d(`span`,{class:`slider rounded`},null,-1)],2),K(d(`input`,{id:n.value,"onUpdate:modelValue":t[0]||=e=>r.value=e,type:`checkbox`,required:e.required},null,8,q_),[[ue,r.value]]),d(`label`,{for:n.value},[z(e.$slots,`label`,{},()=>[p(V(e.label),1)],!0)],8,J_)],10,K_))}}),X_=q(Y_,[[`__scopeId`,`data-v-c5e45931`]]);function Z_(e,t){return function(){return e.apply(t,arguments)}}const{toString:Q_}=Object.prototype,{getPrototypeOf:$_}=Object,{iterator:ev,toStringTag:tv}=Symbol,nv=(e=>t=>{let n=Q_.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),rv=e=>(e=e.toLowerCase(),t=>nv(t)===e),iv=e=>t=>typeof t===e,{isArray:av}=Array,ov=iv(`undefined`);function sv(e){return e!==null&&!ov(e)&&e.constructor!==null&&!ov(e.constructor)&&dv(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const cv=rv(`ArrayBuffer`);function lv(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&cv(e.buffer),t}const uv=iv(`string`),dv=iv(`function`),fv=iv(`number`),pv=e=>typeof e==`object`&&!!e,mv=e=>e===!0||e===!1,hv=e=>{if(nv(e)!==`object`)return!1;let t=$_(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(tv in e)&&!(ev in e)},gv=rv(`Date`),_v=rv(`File`),vv=rv(`Blob`),yv=rv(`FileList`),bv=e=>pv(e)&&dv(e.pipe),xv=e=>{let t;return e&&(typeof FormData==`function`&&e instanceof FormData||dv(e.append)&&((t=nv(e))===`formdata`||t===`object`&&dv(e.toString)&&e.toString()===`[object FormData]`))},Sv=rv(`URLSearchParams`),[Cv,wv,Tv,Ev]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(rv),Dv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function Ov(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),av(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function kv(e,t){t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Av=(()=>typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global)(),jv=e=>!ov(e)&&e!==Av;function Mv(){let{caseless:e}=jv(this)&&this||{},t={},n=(n,r)=>{let i=e&&kv(t,r)||r;hv(t[i])&&hv(n)?t[i]=Mv(t[i],n):hv(n)?t[i]=Mv({},n):av(n)?t[i]=n.slice():t[i]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Ov(arguments[e],n);return t}const Nv=(e,t,n,{allOwnKeys:r}={})=>(Ov(t,(t,r)=>{n&&dv(t)?e[r]=Z_(t,n):e[r]=t},{allOwnKeys:r}),e),Pv=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Fv=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,`super`,{value:t.prototype}),n&&Object.assign(e.prototype,n)},Iv=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&$_(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Lv=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Rv=e=>{if(!e)return null;if(av(e))return e;let t=e.length;if(!fv(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},zv=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&$_(Uint8Array)),Bv=(e,t)=>{let n=e&&e[ev],r=n.call(e),i;for(;(i=r.next())&&!i.done;){let n=i.value;t.call(e,n[0],n[1])}},Vv=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Hv=rv(`HTMLFormElement`),Uv=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Wv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Gv=rv(`RegExp`),Kv=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};Ov(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},qv=e=>{Kv(e,(t,n)=>{if(dv(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(dv(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Jv=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return av(e)?r(e):r(String(e).split(t)),n},Yv=()=>{},Xv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Zv(e){return!!(e&&dv(e.append)&&e[tv]===`FormData`&&e[ev])}const Qv=e=>{let t=Array(10),n=(e,r)=>{if(pv(e)){if(t.indexOf(e)>=0)return;if(!(`toJSON`in e)){t[r]=e;let i=av(e)?[]:{};return Ov(e,(e,t)=>{let a=n(e,r+1);!ov(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},$v=rv(`AsyncFunction`),ey=e=>e&&(pv(e)||dv(e))&&dv(e.then)&&dv(e.catch),ty=((e,t)=>e?setImmediate:t?((e,t)=>(Av.addEventListener(`message`,({source:n,data:r})=>{n===Av&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Av.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,dv(Av.postMessage)),ny=typeof queueMicrotask<`u`?queueMicrotask.bind(Av):typeof process<`u`&&process.nextTick||ty,ry=e=>e!=null&&dv(e[ev]);var Q={isArray:av,isArrayBuffer:cv,isBuffer:sv,isFormData:xv,isArrayBufferView:lv,isString:uv,isNumber:fv,isBoolean:mv,isObject:pv,isPlainObject:hv,isReadableStream:Cv,isRequest:wv,isResponse:Tv,isHeaders:Ev,isUndefined:ov,isDate:gv,isFile:_v,isBlob:vv,isRegExp:Gv,isFunction:dv,isStream:bv,isURLSearchParams:Sv,isTypedArray:zv,isFileList:yv,forEach:Ov,merge:Mv,extend:Nv,trim:Dv,stripBOM:Pv,inherits:Fv,toFlatObject:Iv,kindOf:nv,kindOfTest:rv,endsWith:Lv,toArray:Rv,forEachEntry:Bv,matchAll:Vv,isHTMLForm:Hv,hasOwnProperty:Wv,hasOwnProp:Wv,reduceDescriptors:Kv,freezeMethods:qv,toObjectSet:Jv,toCamelCase:Uv,noop:Yv,toFiniteNumber:Xv,findKey:kv,global:Av,isContextDefined:jv,isSpecCompliantForm:Zv,toJSONObject:Qv,isAsyncFn:$v,isThenable:ey,setImmediate:ty,asap:ny,isIterable:ry};function iy(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name=`AxiosError`,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Q.inherits(iy,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Q.toJSONObject(this.config),code:this.code,status:this.status}}});const ay=iy.prototype,oy={};[`ERR_BAD_OPTION_VALUE`,`ERR_BAD_OPTION`,`ECONNABORTED`,`ETIMEDOUT`,`ERR_NETWORK`,`ERR_FR_TOO_MANY_REDIRECTS`,`ERR_DEPRECATED`,`ERR_BAD_RESPONSE`,`ERR_BAD_REQUEST`,`ERR_CANCELED`,`ERR_NOT_SUPPORT`,`ERR_INVALID_URL`].forEach(e=>{oy[e]={value:e}}),Object.defineProperties(iy,oy),Object.defineProperty(ay,`isAxiosError`,{value:!0}),iy.from=(e,t,n,r,i,a)=>{let o=Object.create(ay);return Q.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>e!==`isAxiosError`),iy.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};var sy=iy,cy=null;function ly(e){return Q.isPlainObject(e)||Q.isArray(e)}function uy(e){return Q.endsWith(e,`[]`)?e.slice(0,-2):e}function dy(e,t,n){return e?e.concat(t).map(function(e,t){return e=uy(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function fy(e){return Q.isArray(e)&&!e.some(ly)}const py=Q.toFlatObject(Q,{},null,function(e){return/^is[A-Z]/.test(e)});function my(e,t,n){if(!Q.isObject(e))throw TypeError(`target must be an object`);t||=new(cy||FormData),n=Q.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Q.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||u,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=s&&Q.isSpecCompliantForm(t);if(!Q.isFunction(i))throw TypeError(`visitor must be a function`);function l(e){if(e===null)return``;if(Q.isDate(e))return e.toISOString();if(!c&&Q.isBlob(e))throw new sy(`Blob is not supported. Use a Buffer instead.`);return Q.isArrayBuffer(e)||Q.isTypedArray(e)?c&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let s=e;if(e&&!i&&typeof e==`object`){if(Q.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Q.isArray(e)&&fy(e)||(Q.isFileList(e)||Q.endsWith(n,`[]`))&&(s=Q.toArray(e)))return n=uy(n),s.forEach(function(e,r){!(Q.isUndefined(e)||e===null)&&t.append(o===!0?dy([n],r,a):o===null?n:n+`[]`,l(e))}),!1}return ly(e)?!0:(t.append(dy(i,n,a),l(e)),!1)}let d=[],f=Object.assign(py,{defaultVisitor:u,convertValue:l,isVisitable:ly});function p(e,n){if(!Q.isUndefined(e)){if(d.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));d.push(e),Q.forEach(e,function(e,r){let a=!(Q.isUndefined(e)||e===null)&&i.call(t,e,Q.isString(r)?r.trim():r,n,f);a===!0&&p(e,n?n.concat(r):[r])}),d.pop()}}if(!Q.isObject(e))throw TypeError(`data must be an object`);return p(e),t}var hy=my;function gy(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function _y(e,t){this._pairs=[],e&&hy(e,this,t)}const vy=_y.prototype;vy.append=function(e,t){this._pairs.push([e,t])},vy.toString=function(e){let t=e?function(t){return e.call(this,t,gy)}:gy;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};var yy=_y;function by(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`).replace(/%5B/gi,`[`).replace(/%5D/gi,`]`)}function xy(e,t,n){if(!t)return e;let r=n&&n.encode||by;Q.isFunction(n)&&(n={serialize:n});let i=n&&n.serialize,a;if(a=i?i(t,n):Q.isURLSearchParams(t)?t.toString():new yy(t,n).toString(r),a){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+a}return e}var Sy=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){Q.forEach(this.handlers,function(t){t!==null&&e(t)})}},Cy=Sy,wy={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ty=typeof URLSearchParams<`u`?URLSearchParams:yy,Ey=typeof FormData<`u`?FormData:null,Dy=typeof Blob<`u`?Blob:null,Oy={isBrowser:!0,classes:{URLSearchParams:Ty,FormData:Ey,Blob:Dy},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},ky={};xe(ky,{hasBrowserEnv:()=>Ay,hasStandardBrowserEnv:()=>My,hasStandardBrowserWebWorkerEnv:()=>Ny,navigator:()=>jy,origin:()=>Py});const Ay=typeof window<`u`&&typeof document<`u`,jy=typeof navigator==`object`&&navigator||void 0,My=Ay&&(!jy||[`ReactNative`,`NativeScript`,`NS`].indexOf(jy.product)<0),Ny=(()=>typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`)(),Py=Ay&&window.location.href||`http://localhost`;var Fy={...ky,...Oy};function Iy(e,t){return hy(e,new Fy.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Fy.isNode&&Q.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Ly(e){return Q.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function Ry(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function zy(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&Q.isArray(r)?r.length:a,s)return Q.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;(!r[a]||!Q.isObject(r[a]))&&(r[a]=[]);let c=t(e,n,r[a],i);return c&&Q.isArray(r[a])&&(r[a]=Ry(r[a])),!o}if(Q.isFormData(e)&&Q.isFunction(e.entries)){let n={};return Q.forEachEntry(e,(e,r)=>{t(Ly(e),r,n,0)}),n}return null}var By=zy;function Vy(e,t,n){if(Q.isString(e))try{return(t||JSON.parse)(e),Q.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}const Hy={transitional:wy,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=Q.isObject(e);i&&Q.isHTMLForm(e)&&(e=new FormData(e));let a=Q.isFormData(e);if(a)return r?JSON.stringify(By(e)):e;if(Q.isArrayBuffer(e)||Q.isBuffer(e)||Q.isStream(e)||Q.isFile(e)||Q.isBlob(e)||Q.isReadableStream(e))return e;if(Q.isArrayBufferView(e))return e.buffer;if(Q.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let o;if(i){if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Iy(e,this.formSerializer).toString();if((o=Q.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let t=this.env&&this.env.FormData;return hy(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType(`application/json`,!1),Vy(e)):e}],transformResponse:[function(e){let t=this.transitional||Hy.transitional,n=t&&t.forcedJSONParsing,r=this.responseType===`json`;if(Q.isResponse(e)||Q.isReadableStream(e))return e;if(e&&Q.isString(e)&&(n&&!this.responseType||r)){let n=t&&t.silentJSONParsing,i=!n&&r;try{return JSON.parse(e)}catch(e){if(i)throw e.name===`SyntaxError`?sy.from(e,sy.ERR_BAD_RESPONSE,this,null,this.response):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:Fy.classes.FormData,Blob:Fy.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};Q.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{Hy.headers[e]={}});var Uy=Hy;const Wy=Q.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]);var Gy=e=>{let t={},n,r,i;return e&&e.split(`
|
|
44
44
|
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Wy[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t};const Ky=Symbol(`internals`);function qy(e){return e&&String(e).trim().toLowerCase()}function Jy(e){return e===!1||e==null?e:Q.isArray(e)?e.map(Jy):String(e)}function Yy(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Xy=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Zy(e,t,n,r,i){if(Q.isFunction(r))return r.call(this,t,n);if(i&&(t=n),Q.isString(t)){if(Q.isString(r))return t.indexOf(r)!==-1;if(Q.isRegExp(r))return r.test(t)}}function Qy(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function $y(e,t){let n=Q.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var eb=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=qy(t);if(!i)throw Error(`header name must be a non-empty string`);let a=Q.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=Jy(e))}let a=(e,t)=>Q.forEach(e,(e,n)=>i(e,n,t));if(Q.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Q.isString(e)&&(e=e.trim())&&!Xy(e))a(Gy(e),t);else if(Q.isObject(e)&&Q.isIterable(e)){let n={},r,i;for(let t of e){if(!Q.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?Q.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=qy(e),e){let n=Q.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Yy(e);if(Q.isFunction(t))return t.call(this,e,n);if(Q.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=qy(e),e){let n=Q.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Zy(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=qy(e),e){let i=Q.findKey(n,e);i&&(!t||Zy(n,n[i],i,t))&&(delete n[i],r=!0)}}return Q.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||Zy(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return Q.forEach(this,(r,i)=>{let a=Q.findKey(n,i);if(a){t[a]=Jy(r),delete t[i];return}let o=e?Qy(i):String(i).trim();o!==i&&delete t[i],t[o]=Jy(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return Q.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&Q.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
|
|
45
45
|
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=this[Ky]=this[Ky]={accessors:{}},n=t.accessors,r=this.prototype;function i(e){let t=qy(e);n[t]||($y(r,e),n[t]=!0)}return Q.isArray(e)?e.forEach(i):i(e),this}};eb.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),Q.reduceDescriptors(eb.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Q.freezeMethods(eb);var tb=eb;function nb(e,t){let n=this||Uy,r=t||n,i=tb.from(r.headers),a=r.data;return Q.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function rb(e){return!!(e&&e.__CANCEL__)}function ib(e,t,n){sy.call(this,e??`canceled`,sy.ERR_CANCELED,t,n),this.name=`CanceledError`}Q.inherits(ib,sy,{__CANCEL__:!0});var ab=ib;function ob(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new sy(`Request failed with status code `+n.status,[sy.ERR_BAD_REQUEST,sy.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function sb(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function cb(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}var lb=cb;function ub(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&(clearTimeout(a),a=null),e.apply(null,t)},s=(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},c=()=>i&&o(i);return[s,c]}var db=ub;const fb=(e,t,n=3)=>{let r=0,i=lb(50,250);return db(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,c=i(s),l=a<=o;r=a;let u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0};e(u)},n)},pb=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},mb=e=>(...t)=>Q.asap(()=>e(...t));var hb=Fy.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Fy.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Fy.origin),Fy.navigator&&/(msie|trident)/i.test(Fy.navigator.userAgent)):()=>!0,gb=Fy.hasStandardBrowserEnv?{write(e,t,n,r,i,a){let o=[e+`=`+encodeURIComponent(t)];Q.isNumber(n)&&o.push(`expires=`+new Date(n).toGMTString()),Q.isString(r)&&o.push(`path=`+r),Q.isString(i)&&o.push(`domain=`+i),a===!0&&o.push(`secure`),document.cookie=o.join(`; `)},read(e){let t=document.cookie.match(RegExp(`(^|;\\s*)(`+e+`)=([^;]*)`));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,``,Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function _b(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function vb(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function yb(e,t,n){let r=!_b(t);return e&&(r||n==0)?vb(e,t):t}const bb=e=>e instanceof tb?{...e}:e;function xb(e,t){t||={};let n={};function r(e,t,n,r){return Q.isPlainObject(e)&&Q.isPlainObject(t)?Q.merge.call({caseless:r},e,t):Q.isPlainObject(t)?Q.merge({},t):Q.isArray(t)?t.slice():t}function i(e,t,n,i){if(Q.isUndefined(t)){if(!Q.isUndefined(e))return r(void 0,e,n,i)}else return r(e,t,n,i)}function a(e,t){if(!Q.isUndefined(t))return r(void 0,t)}function o(e,t){if(Q.isUndefined(t)){if(!Q.isUndefined(e))return r(void 0,e)}else return r(void 0,t)}function s(n,i,a){if(a in t)return r(n,i);if(a in e)return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(bb(e),bb(t),n,!0)};return Q.forEach(Object.keys(Object.assign({},e,t)),function(r){let a=c[r]||i,o=a(e[r],t[r],r);Q.isUndefined(o)&&a!==s||(n[r]=o)}),n}var Sb=e=>{let t=xb({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;t.headers=o=tb.from(o),t.url=xy(yb(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set(`Authorization`,`Basic `+btoa((s.username||``)+`:`+(s.password?unescape(encodeURIComponent(s.password)):``)));let c;if(Q.isFormData(n)){if(Fy.hasStandardBrowserEnv||Fy.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){let[e,...t]=c?c.split(`;`).map(e=>e.trim()).filter(Boolean):[];o.setContentType([e||`multipart/form-data`,...t].join(`; `))}}if(Fy.hasStandardBrowserEnv&&(r&&Q.isFunction(r)&&(r=r(t)),r||r!==!1&&hb(t.url))){let e=i&&a&&gb.read(a);e&&o.set(i,e)}return t};const Cb=typeof XMLHttpRequest<`u`;var wb=Cb&&function(e){return new Promise(function(t,n){let r=Sb(e),i=r.data,a=tb.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=tb.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders()),i=!o||o===`text`||o===`json`?h.responseText:h.response,a={data:i,status:h.status,statusText:h.statusText,headers:r,config:e,request:h};ob(function(e){t(e),m()},function(e){n(e),m()},a),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf(`file:`)===0)||setTimeout(g)},h.onabort=function(){h&&(n(new sy(`Request aborted`,sy.ECONNABORTED,e,h)),h=null)},h.onerror=function(){n(new sy(`Network Error`,sy.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||wy;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new sy(t,i.clarifyTimeoutError?sy.ETIMEDOUT:sy.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&Q.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),Q.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=fb(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=fb(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&(n(!t||t.type?new ab(null,e,h):t),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=sb(r.url);if(_&&Fy.protocols.indexOf(_)===-1){n(new sy(`Unsupported protocol `+_+`:`,sy.ERR_BAD_REQUEST,e));return}h.send(i||null)})};const Tb=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof sy?t:new ab(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new sy(`timeout ${t} of ms exceeded`,sy.ETIMEDOUT))},t),o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),e=null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>Q.asap(o),s}};var Eb=Tb;const Db=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},Ob=async function*(e,t){for await(let n of kb(e))yield*Db(n,t)},kb=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Ab=(e,t,n,r)=>{let i=Ob(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;if(n){let e=a+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},jb=typeof fetch==`function`&&typeof Request==`function`&&typeof Response==`function`,Mb=jb&&typeof ReadableStream==`function`,Nb=jb&&(typeof TextEncoder==`function`?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Pb=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Fb=Mb&&Pb(()=>{let e=!1,t=new Request(Fy.origin,{body:new ReadableStream,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`);return e&&!t}),Ib=64*1024,Lb=Mb&&Pb(()=>Q.isReadableStream(new Response(``).body)),Rb={stream:Lb&&(e=>e.body)};jb&&(e=>{[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(t=>{!Rb[t]&&(Rb[t]=Q.isFunction(e[t])?e=>e[t]():(e,n)=>{throw new sy(`Response type '${t}' is not supported`,sy.ERR_NOT_SUPPORT,n)})})})(new Response);const zb=async e=>{if(e==null)return 0;if(Q.isBlob(e))return e.size;if(Q.isSpecCompliantForm(e)){let t=new Request(Fy.origin,{method:`POST`,body:e});return(await t.arrayBuffer()).byteLength}if(Q.isArrayBufferView(e)||Q.isArrayBuffer(e))return e.byteLength;if(Q.isURLSearchParams(e)&&(e+=``),Q.isString(e))return(await Nb(e)).byteLength},Bb=async(e,t)=>{let n=Q.toFiniteNumber(e.getContentLength());return n??zb(t)};var Vb=jb&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:c,responseType:l,headers:u,withCredentials:d=`same-origin`,fetchOptions:f}=Sb(e);l=l?(l+``).toLowerCase():`text`;let p=Eb([i,a&&a.toAbortSignal()],o),m,h=p&&p.unsubscribe&&(()=>{p.unsubscribe()}),g;try{if(c&&Fb&&n!==`get`&&n!==`head`&&(g=await Bb(u,r))!==0){let e=new Request(t,{method:`POST`,body:r,duplex:`half`}),n;if(Q.isFormData(r)&&(n=e.headers.get(`content-type`))&&u.setContentType(n),e.body){let[t,n]=pb(g,fb(mb(c)));r=Ab(e.body,Ib,t,n)}}Q.isString(d)||(d=d?`include`:`omit`);let i=`credentials`in Request.prototype;m=new Request(t,{...f,signal:p,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:`half`,credentials:i?d:void 0});let a=await fetch(m),o=Lb&&(l===`stream`||l===`response`);if(Lb&&(s||o&&h)){let e={};[`status`,`statusText`,`headers`].forEach(t=>{e[t]=a[t]});let t=Q.toFiniteNumber(a.headers.get(`content-length`)),[n,r]=s&&pb(t,fb(mb(s),!0))||[];a=new Response(Ab(a.body,Ib,n,()=>{r&&r(),h&&h()}),e)}l||=`text`;let _=await Rb[Q.findKey(Rb,l)||`text`](a,e);return!o&&h&&h(),await new Promise((t,n)=>{ob(t,n,{data:_,headers:tb.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:m})})}catch(t){throw h&&h(),t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new sy(`Network Error`,sy.ERR_NETWORK,e,m),{cause:t.cause||t}):sy.from(t,t&&t.code,e,m)}});const Hb={http:cy,xhr:wb,fetch:Vb};Q.forEach(Hb,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{value:t})}catch{}Object.defineProperty(e,`adapterName`,{value:t})}});const Ub=e=>`- ${e}`,Wb=e=>Q.isFunction(e)||e===null||e===!1;var Gb={getAdapter:e=>{e=Q.isArray(e)?e:[e];let{length:t}=e,n,r,i={};for(let a=0;a<t;a++){n=e[a];let t;if(r=n,!Wb(n)&&(r=Hb[(t=String(n)).toLowerCase()],r===void 0))throw new sy(`Unknown adapter '${t}'`);if(r)break;i[t||`#`+a]=r}if(!r){let e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`)),n=t?e.length>1?`since :
|