@avakhula/ui 0.0.505-alpha.101 → 0.0.505-alpha.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11547,6 +11547,10 @@ const Z1 = {
11547
11547
  errorMessage: {
11548
11548
  type: String,
11549
11549
  default: ""
11550
+ },
11551
+ disabled: {
11552
+ type: Boolean,
11553
+ default: !1
11550
11554
  }
11551
11555
  },
11552
11556
  emits: ["update:modelValue", "onReady"],
@@ -11609,7 +11613,8 @@ function J1(t, n, e, r, o, i) {
11609
11613
  "dropdown-options": { showSearchBox: !0, showFlags: !0, tabindex: 0 },
11610
11614
  defaultCountry: o.defaultCountry,
11611
11615
  ignoredCountries: e.ignoredCountries,
11612
- class: { error: e.error || e.errorMessage.length },
11616
+ class: { error: e.error || e.errorMessage.length, disabled: e.disabled },
11617
+ disabled: e.disabled,
11613
11618
  "style-classes": "ib-phone-input",
11614
11619
  ref: "vueTel"
11615
11620
  }), {
@@ -11617,7 +11622,7 @@ function J1(t, n, e, r, o, i) {
11617
11622
  pe(l, { name: "chevron-down-outline" })
11618
11623
  ]),
11619
11624
  _: 1
11620
- }, 16, ["modelValue", "onCountryChanged", "input-options", "auto-default-country", "defaultCountry", "ignoredCountries", "class"])), [
11625
+ }, 16, ["modelValue", "onCountryChanged", "input-options", "auto-default-country", "defaultCountry", "ignoredCountries", "class", "disabled"])), [
11621
11626
  [u, i.clickOutside]
11622
11627
  ])
11623
11628
  ], 64);
@@ -86,7 +86,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
86
86
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nh(t,n){if(t){if(typeof t=="string")return ra(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ra(t,n)}}function ra(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}var rh=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function oi(t,n,e){if(n=n||{},!(!t.country&&!t.countryCallingCode)){e=new nt(e),e.selectNumberingPlan(t.country,t.countryCallingCode);var o=n.v2?t.nationalNumber:t.phone;if(Dt(o,e.nationalNumberPattern())){if(ai(o,"FIXED_LINE",e))return e.type("MOBILE")&&e.type("MOBILE").pattern()===""||!e.type("MOBILE")||ai(o,"MOBILE",e)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var a=th(rh),r;!(r=a()).done;){var l=r.value;if(ai(o,l,e))return l}}}}function ai(t,n,e){return n=e.type(n),!n||!n.pattern()||n.possibleLengths()&&n.possibleLengths().indexOf(t.length)<0?!1:Dt(t,n.pattern())}function ih(t,n,e){if(n=n||{},e=new nt(e),e.selectNumberingPlan(t.country,t.countryCallingCode),e.hasTypes())return oi(t,n,e.metadata)!==void 0;var o=n.v2?t.nationalNumber:t.phone;return Dt(o,e.nationalNumberPattern())}function oh(t,n,e){var o=new nt(e),a=o.getCountryCodesForCallingCode(t);return a?a.filter(function(r){return ah(n,r,e)}):[]}function ah(t,n,e){var o=new nt(e);return o.selectNumberingPlan(n),o.numberingPlan.possibleLengths().indexOf(t.length)>=0}function lh(t){return t.replace(new RegExp("[".concat(cr,"]+"),"g")," ").trim()}var sh=/(\$\d)/;function dh(t,n,e){var o=e.useInternationalFormat,a=e.withNationalPrefix;e.carrierCode,e.metadata;var r=t.replace(new RegExp(n.pattern()),o?n.internationalFormat():a&&n.nationalPrefixFormattingRule()?n.format().replace(sh,n.nationalPrefixFormattingRule()):n.format());return o?lh(r):r}var ch=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function uh(t,n,e){var o=new nt(e);if(o.selectNumberingPlan(t,n),o.defaultIDDPrefix())return o.defaultIDDPrefix();if(ch.test(o.IDDPrefix()))return o.IDDPrefix()}function fh(t){var n=t.number,e=t.ext;if(!n)return"";if(n[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(n).concat(e?";ext="+e:"")}function hh(t,n){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=ph(t))||n&&t&&typeof t.length=="number"){e&&(t=e);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
87
87
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ph(t,n){if(t){if(typeof t=="string")return ia(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ia(t,n)}}function ia(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}function oa(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,o)}return e}function aa(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?oa(Object(e),!0).forEach(function(o){mh(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):oa(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function mh(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var la={formatExtension:function(t,n,e){return"".concat(t).concat(e.ext()).concat(n)}};function gh(t,n,e,o){if(e?e=aa(aa({},la),e):e=la,o=new nt(o),t.country&&t.country!=="001"){if(!o.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));o.country(t.country)}else if(t.countryCallingCode)o.selectNumberingPlan(t.countryCallingCode);else return t.phone||"";var a=o.countryCallingCode(),r=e.v2?t.nationalNumber:t.phone,l;switch(n){case"NATIONAL":return r?(l=pr(r,t.carrierCode,"NATIONAL",o,e),li(l,t.ext,o,e.formatExtension)):"";case"INTERNATIONAL":return r?(l=pr(r,null,"INTERNATIONAL",o,e),l="+".concat(a," ").concat(l),li(l,t.ext,o,e.formatExtension)):"+".concat(a);case"E.164":return"+".concat(a).concat(r);case"RFC3966":return fh({number:"+".concat(a).concat(r),ext:t.ext});case"IDD":if(!e.fromCountry)return;var s=bh(r,t.carrierCode,a,e.fromCountry,o);return li(s,t.ext,o,e.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(n,'"'))}}function pr(t,n,e,o,a){var r=yh(o.formats(),t);return r?dh(t,r,{useInternationalFormat:e==="INTERNATIONAL",withNationalPrefix:!(r.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&a&&a.nationalPrefix===!1),carrierCode:n,metadata:o}):t}function yh(t,n){for(var e=hh(t),o;!(o=e()).done;){var a=o.value;if(a.leadingDigitsPatterns().length>0){var r=a.leadingDigitsPatterns()[a.leadingDigitsPatterns().length-1];if(n.search(r)!==0)continue}if(Dt(n,a.pattern()))return a}}function li(t,n,e,o){return n?o(t,n,e):t}function bh(t,n,e,o,a){var r=ri(o,a.metadata);if(r===e){var l=pr(t,n,"NATIONAL",a);return e==="1"?e+" "+l:l}var s=uh(o,void 0,a.metadata);if(s)return"".concat(s," ").concat(e," ").concat(pr(t,null,"INTERNATIONAL",a))}function sa(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,o)}return e}function da(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?sa(Object(e),!0).forEach(function(o){vh(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):sa(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function vh(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function _h(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function ca(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function $h(t,n,e){return n&&ca(t.prototype,n),e&&ca(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var wh=function(){function t(n,e,o){if(_h(this,t),!n)throw new TypeError("`country` or `countryCallingCode` not passed");if(!e)throw new TypeError("`nationalNumber` not passed");if(!o)throw new TypeError("`metadata` not passed");var a=Ch(n,o),r=a.country,l=a.countryCallingCode;this.country=r,this.countryCallingCode=l,this.nationalNumber=e,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return o}}return $h(t,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:oh(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return eh(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return ih(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new nt(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return oi(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,e){return gh(this,n,e?da(da({},e),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}]),t}(),kh=function(t){return/^[A-Z]{2}$/.test(t)};function Ch(t,n){var e,o,a=new nt(n);return kh(t)?(e=t,a.selectNumberingPlan(e),o=a.countryCallingCode()):o=t,{country:e,countryCallingCode:o}}var Oh=new RegExp("(["+yt+"])");function Eh(t,n,e,o){if(n){var a=new nt(o);a.selectNumberingPlan(n,e);var r=new RegExp(a.IDDPrefix());if(t.search(r)===0){t=t.slice(t.match(r)[0].length);var l=t.match(Oh);if(!(l&&l[1]!=null&&l[1].length>0&&l[1]==="0"))return t}}}function Sh(t,n){if(t&&n.numberingPlan.nationalPrefixForParsing()){var e=new RegExp("^(?:"+n.numberingPlan.nationalPrefixForParsing()+")"),o=e.exec(t);if(o){var a,r,l=o.length-1,s=l>0&&o[l];if(n.nationalPrefixTransformRule()&&s)a=t.replace(e,n.nationalPrefixTransformRule()),l>1&&(r=o[1]);else{var u=o[0];a=t.slice(u.length),s&&(r=o[1])}var c;if(s){var p=t.indexOf(o[1]),f=t.slice(0,p);f===n.numberingPlan.nationalPrefix()&&(c=n.numberingPlan.nationalPrefix())}else c=o[0];return{nationalNumber:a,nationalPrefix:c,carrierCode:r}}}return{nationalNumber:t}}function si(t,n){var e=Sh(t,n),o=e.carrierCode,a=e.nationalNumber;if(a!==t){if(!xh(t,a,n))return{nationalNumber:t};if(n.possibleLengths()&&!Th(a,n))return{nationalNumber:t}}return{nationalNumber:a,carrierCode:o}}function xh(t,n,e){return!(Dt(t,e.nationalNumberPattern())&&!Dt(n,e.nationalNumberPattern()))}function Th(t,n){switch(ii(t,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function Nh(t,n,e,o){var a=n?ri(n,o):e;if(t.indexOf(a)===0){o=new nt(o),o.selectNumberingPlan(n,e);var r=t.slice(a.length),l=si(r,o),s=l.nationalNumber,u=si(t,o),c=u.nationalNumber;if(!Dt(c,o.nationalNumberPattern())&&Dt(s,o.nationalNumberPattern())||ii(c,o)==="TOO_LONG")return{countryCallingCode:a,number:r}}return{number:t}}function Ah(t,n,e,o){if(!t)return{};var a;if(t[0]!=="+"){var r=Eh(t,n,e,o);if(r&&r!==t)a=!0,t="+"+r;else{if(n||e){var l=Nh(t,n,e,o),s=l.countryCallingCode,u=l.number;if(s)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:s,number:u}}return{number:t}}}if(t[1]==="0")return{};o=new nt(o);for(var c=2;c-1<=_f&&c<=t.length;){var p=t.slice(1,c);if(o.hasCallingCode(p))return o.selectNumberingPlan(p),{countryCallingCodeSource:a?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:p,number:t.slice(c)};c++}return{}}function Dh(t,n){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=Ph(t))||n&&t&&typeof t.length=="number"){e&&(t=e);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
88
88
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ph(t,n){if(t){if(typeof t=="string")return ua(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ua(t,n)}}function ua(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}function Ih(t,n){var e=n.countries,o=n.defaultCountry,a=n.metadata;a=new nt(a);for(var r=[],l=Dh(e),s;!(s=l()).done;){var u=s.value;if(a.country(u),a.leadingDigits()){if(t&&t.search(a.leadingDigits())===0)return u}else if(oi({phone:t,country:u},void 0,a.metadata))if(o){if(u===o)return u;r.push(u)}else return u}if(r.length>0)return r[0]}function Mh(t,n){var e=n.nationalNumber,o=n.defaultCountry,a=n.metadata,r=a.getCountryCodesForCallingCode(t);if(r)return r.length===1?r[0]:Ih(e,{countries:r,defaultCountry:o,metadata:a.metadata})}var fa="+",Bh="[\\-\\.\\(\\)]?",ha="(["+yt+"]|"+Bh+")",Lh="^\\"+fa+ha+"*["+yt+"]"+ha+"*$",Rh=new RegExp(Lh,"g"),di=yt,jh="["+di+"]+((\\-)*["+di+"])*",Vh="a-zA-Z",qh="["+Vh+"]+((\\-)*["+di+"])*",Fh="^("+jh+"\\.)*"+qh+"\\.?$",Hh=new RegExp(Fh,"g"),pa="tel:",ci=";phone-context=",zh=";isub=";function Uh(t){var n=t.indexOf(ci);if(n<0)return null;var e=n+ci.length;if(e>=t.length)return"";var o=t.indexOf(";",e);return o>=0?t.substring(e,o):t.substring(e)}function Kh(t){return t===null?!0:t.length===0?!1:Rh.test(t)||Hh.test(t)}function Gh(t,n){var e=n.extractFormattedPhoneNumber,o=Uh(t);if(!Kh(o))throw new At("NOT_A_NUMBER");var a;if(o===null)a=e(t)||"";else{a="",o.charAt(0)===fa&&(a+=o);var r=t.indexOf(pa),l;r>=0?l=r+pa.length:l=0;var s=t.indexOf(ci);a+=t.substring(l,s)}var u=a.indexOf(zh);if(u>0&&(a=a.substring(0,u)),a!=="")return a}var Wh=250,Yh=new RegExp("["+ti+yt+"]"),Zh=new RegExp("[^"+yt+"#]+$");function Jh(t,n,e){if(n=n||{},e=new nt(e),n.defaultCountry&&!e.hasCountry(n.defaultCountry))throw n.v2?new At("INVALID_COUNTRY"):new Error("Unknown country: ".concat(n.defaultCountry));var o=Qh(t,n.v2,n.extract),a=o.number,r=o.ext,l=o.error;if(!a){if(n.v2)throw l==="TOO_SHORT"?new At("TOO_SHORT"):new At("NOT_A_NUMBER");return{}}var s=t1(a,n.defaultCountry,n.defaultCallingCode,e),u=s.country,c=s.nationalNumber,p=s.countryCallingCode,f=s.countryCallingCodeSource,d=s.carrierCode;if(!e.hasSelectedNumberingPlan()){if(n.v2)throw new At("INVALID_COUNTRY");return{}}if(!c||c.length<ei){if(n.v2)throw new At("TOO_SHORT");return{}}if(c.length>vf){if(n.v2)throw new At("TOO_LONG");return{}}if(n.v2){var h=new wh(p,c,e.metadata);return u&&(h.country=u),d&&(h.carrierCode=d),r&&(h.ext=r),h.__countryCallingCodeSource=f,h}var v=(n.extended?e.hasSelectedNumberingPlan():u)?Dt(c,e.nationalNumberPattern()):!1;return n.extended?{country:u,countryCallingCode:p,carrierCode:d,valid:v,possible:v?!0:!!(n.extended===!0&&e.possibleLengths()&&na(c,e)),phone:c,ext:r}:v?e1(u,c,r):{}}function Xh(t,n,e){if(t){if(t.length>Wh){if(e)throw new At("TOO_LONG");return}if(n===!1)return t;var o=t.search(Yh);if(!(o<0))return t.slice(o).replace(Zh,"")}}function Qh(t,n,e){var o=Gh(t,{extractFormattedPhoneNumber:function(r){return Xh(r,e,n)}});if(!o)return{};if(!Hf(o))return zf(o)?{error:"TOO_SHORT"}:{};var a=Uf(o);return a.ext?a:{number:o}}function e1(t,n,e){var o={country:t,phone:n};return e&&(o.ext=e),o}function t1(t,n,e,o){var a=Ah(Qo(t),n,e,o.metadata),r=a.countryCallingCodeSource,l=a.countryCallingCode,s=a.number,u;if(l)o.selectNumberingPlan(l);else if(s&&(n||e))o.selectNumberingPlan(n,e),n&&(u=n),l=e||ri(n,o.metadata);else return{};if(!s)return{countryCallingCodeSource:r,countryCallingCode:l};var c=si(Qo(s),o),p=c.nationalNumber,f=c.carrierCode,d=Mh(l,{nationalNumber:p,defaultCountry:n,metadata:o});return d&&(u=d,d==="001"||o.country(u)),{country:u,countryCallingCode:l,countryCallingCodeSource:r,nationalNumber:p,carrierCode:f}}function ma(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,o)}return e}function ga(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?ma(Object(e),!0).forEach(function(o){n1(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ma(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function n1(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function r1(t,n,e){return Jh(t,ga(ga({},n),{},{v2:!0}),e)}function ya(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,o)}return e}function i1(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?ya(Object(e),!0).forEach(function(o){o1(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ya(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function o1(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function a1(t,n){return c1(t)||d1(t,n)||s1(t,n)||l1()}function l1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
89
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s1(t,n){if(t){if(typeof t=="string")return ba(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ba(t,n)}}function ba(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}function d1(t,n){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var o=[],a=!0,r=!1,l,s;try{for(e=e.call(t);!(a=(l=e.next()).done)&&(o.push(l.value),!(n&&o.length===n));a=!0);}catch(u){r=!0,s=u}finally{try{!a&&e.return!=null&&e.return()}finally{if(r)throw s}}return o}}function c1(t){if(Array.isArray(t))return t}function u1(t){var n=Array.prototype.slice.call(t),e=a1(n,4),o=e[0],a=e[1],r=e[2],l=e[3],s,u,c;if(typeof o=="string")s=o;else throw new TypeError("A text for parsing must be a string.");if(!a||typeof a=="string")l?(u=r,c=l):(u=void 0,c=r),a&&(u=i1({defaultCountry:a},u));else if(ur(a))r?(u=a,c=r):c=a;else throw new Error("Invalid second argument: ".concat(a));return{text:s,options:u,metadata:c}}function va(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,o)}return e}function _a(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?va(Object(e),!0).forEach(function(o){f1(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):va(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function f1(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function h1(t,n,e){n&&n.defaultCountry&&!Bf(n.defaultCountry,e)&&(n=_a(_a({},n),{},{defaultCountry:void 0}));try{return r1(t,n,e)}catch(o){if(!(o instanceof At))throw o}}function p1(){var t=u1(arguments),n=t.text,e=t.options,o=t.metadata;return h1(n,e,o)}function ui(){return ff(p1,arguments)}const m1={beforeMount(t,n,e){if(typeof n.value!="function"){const o=e.context.name;let a=`[Vue-click-outside:] provided expression ${n.expression} is not a function, but has to be`;o&&(a+=`Found in component ${o}`),console.warn(a)}t.clickOutsideEvent=function(o){const a=o.composedPath?o.composedPath():o.path;t===o.target||t.contains(o.target)||a.includes(t)||n.value(o,t)},document.body.addEventListener("click",t.clickOutsideEvent)},unmounted(t){document.body.removeEventListener("click",t.clickOutsideEvent)}},g1=["aria-expanded","tabindex"],y1={class:"vti__selection"},b1={key:1,class:"vti__country-code"},v1={class:"vti__dropdown-arrow"},_1={key:0,class:"vti__search_box_container"},$1=["placeholder"],w1=["onClick","onMousemove","aria-selected"],k1={key:1},C1=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex","value","aria-describedby"],O1=i.defineComponent({name:"VueTelInput",directives:{clickOutside:m1},__name:"vue-tel-input",props:i.mergeModels({allCountries:{type:Array,default:()=>tt("allCountries")},autoFormat:{type:Boolean,default:()=>tt("autoFormat")},customValidate:{type:[Boolean,RegExp],default:()=>tt("customValidate")},defaultCountry:{type:[String,Number],default:()=>tt("defaultCountry")},disabled:{type:Boolean,default:()=>tt("disabled")},autoDefaultCountry:{type:Boolean,default:()=>tt("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>tt("dropdownOptions")},ignoredCountries:{type:Array,default:()=>tt("ignoredCountries")},inputOptions:{type:Object,default:()=>tt("inputOptions")},invalidMsg:{type:String,default:()=>tt("invalidMsg")},mode:{type:String,default:()=>tt("mode")},onlyCountries:{type:Array,default:()=>tt("onlyCountries")},preferredCountries:{type:Array,default:()=>tt("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>tt("validCharactersOnly")},styleClasses:{type:[String,Array,Object],default:()=>tt("styleClasses")}},{modelValue:{type:String},modelModifiers:{}}),emits:i.mergeModels(["blur","close","country-changed","enter","focus","on-input","open","space","validate"],["update:modelValue"]),setup(t,{expose:n,emit:e}){const o=i.shallowRef(),a=i.shallowRef(),r=i.shallowRef(),l=e,s=t,u=i.useModel(t,"modelValue");i.watch(u,(A,I)=>{S()?c.phone=A??"":i.nextTick(()=>{c.phone=I??"",B()})});const c=i.reactive({phone:"",activeCountryCode:void 0,open:!1,finishMounted:!1,selectedIndex:null,typeToFindInput:"",typeToFindTimer:void 0,dropdownOpenDirection:"below",parsedPlaceholder:s.inputOptions.placeholder,searchQuery:""});i.watch(()=>c.open,A=>{A?(D(),l("open")):l("close")});const p=i.computed(()=>s.onlyCountries.length?s.allCountries.filter(({iso2:A})=>s.onlyCountries.some(I=>Tn(I)===A)):s.ignoredCountries.length?s.allCountries.filter(({iso2:A})=>!s.ignoredCountries.includes(Tn(A))&&!s.ignoredCountries.includes(xn(A))):s.allCountries),f=i.computed(()=>g(c.activeCountryCode));i.watch(f,(A,I)=>{if(!A&&I!=null&&I.iso2){c.activeCountryCode=I.iso2;return}A!=null&&A.iso2&&l("country-changed",A)});const d=i.computed(()=>{var A;const I=xn(s.mode);return I==="auto"?(A=c.phone)!=null&&A.startsWith("+")?"international":"national":["national","international","e.164","rfc3966","idd"].includes(I)?I:(console.error('Invalid value of prop "mode"'),"international")}),h=i.computed(()=>{const A=[...y(s.preferredCountries).map(U=>({...U,preferred:!0})),...p.value];if(!s.dropdownOptions.showSearchBox)return A;const I=c.searchQuery.toLowerCase().replace(/[~`!@#$%^&*()+={}\[\];:\'\"<>.,\/\\\?-_]/g,"");return A.filter(U=>new RegExp(I,"i").test(U.name)||new RegExp(I,"i").test(U.iso2)||new RegExp(I,"i").test(U.dialCode))}),v=i.computed(()=>{var A;const I=c.phone.startsWith("+")?ui(c.phone):ui(c.phone,c.activeCountryCode),U={country:I==null?void 0:I.country,countryCode:I==null?void 0:I.country,formatted:c.phone,valid:I==null?void 0:I.isValid(),possible:(A=I==null?void 0:I.isPossible)==null?void 0:A.call(I),nationalNumber:I==null?void 0:I.nationalNumber};return U.valid&&(U.formatted=I==null?void 0:I.format(Tn(d.value))),I!=null&&I.country&&(s.ignoredCountries.length||s.onlyCountries.length)&&!g(I.country)&&(U.valid=!1,U.possible=!1,I.country=null),I?{...U,...I}:U});i.watch(()=>v.value.countryCode,A=>{A&&(c.activeCountryCode=A)}),i.watch(()=>v.value.valid,()=>{l("validate",v.value)}),i.watch(()=>v.value.formatted,A=>{!s.autoFormat||s.customValidate||(E(A),i.nextTick(()=>{A&&!u.value&&(c.phone=A)}))}),i.watch(()=>s.inputOptions.placeholder,m),i.onMounted(()=>{u.value&&(c.phone=u.value.trim()),T(),_().then(()=>{var A;!c.phone&&(A=s.inputOptions)!=null&&A.showDialCode&&c.activeCountryCode&&(c.phone=`+${c.activeCountryCode}`),l("validate",v.value)}).catch(console.error).then(()=>{c.finishMounted=!0})});function m(){c.parsedPlaceholder=s.inputOptions.placeholder}function _(){return new Promise(A=>{var I;if(((I=c.phone)==null?void 0:I[0])==="+"){A();return}if(s.defaultCountry){if(typeof s.defaultCountry=="string"){k(s.defaultCountry),A();return}if(typeof s.defaultCountry=="number"){const F=w(s.defaultCountry);if(F){k(F.iso2),A();return}}}const U=s.preferredCountries[0]||p.value[0];s.autoDefaultCountry?lf().then(F=>{k(F||c.activeCountryCode)}).catch(F=>{console.warn(F),k(U)}).then(()=>{A()}):(k(U),A())})}function y(A=[]){return A.map(g).filter(Boolean)}function g(A=""){return p.value.find(I=>I.iso2===Tn(A))}function w(A){return p.value.find(I=>Number(I.dialCode)===A)}function b(A,I){const U=c.selectedIndex===A,F=A===s.preferredCountries.length-1,L=s.preferredCountries.some(z=>Tn(z)===I);return{highlighted:U,"last-preferred":F,preferred:L}}function k(A){var I,U,F;let L=A;if(typeof L=="string"&&(L=g(L)),!!L){if(((I=c.phone)==null?void 0:I[0])==="+"&&L.iso2&&v.value.nationalNumber){c.activeCountryCode=L.iso2,c.phone=((U=ui(v.value.nationalNumber,L.iso2))==null?void 0:U.formatInternational())??"";return}if((F=s.inputOptions)!=null&&F.showDialCode&&L){c.phone=`+${L.dialCode}`,c.activeCountryCode=L.iso2;return}c.activeCountryCode=L.iso2,E(c.phone)}}function T(){const A=c.phone;if(s.validCharactersOnly){const I=c.phone.match(/[()\-+0-9\s]*/g);c.phone=I.join("")}if(s.customValidate&&s.customValidate instanceof RegExp){const I=c.phone.match(s.customValidate);c.phone=I.join("")}A!==c.phone&&E(c.phone)}function S(){return s.validCharactersOnly&&!/^[()\-+0-9\s]*$/.test(c.phone)?!1:s.customValidate?x():!0}function x(){return s.customValidate instanceof RegExp?s.customValidate.test(c.phone):!1}function B(){var A;(A=r.value)==null||A.setCustomValidity(v.value.valid?"":s.invalidMsg),E(c.phone)}function E(A){u.value=A,l("on-input",A,v.value,r.value)}function C(A){l("blur",A)}function O(A){sf(r.value,c.phone.length),l("focus",A)}function N(A){l("enter",A)}function R(A){l("space",A)}function q(){var A;(A=r.value)==null||A.focus()}function W(){var A;(A=r.value)==null||A.blur()}function Y(){s.disabled||s.dropdownOptions.disabled||(c.searchQuery="",c.open=!c.open)}function re(){c.open=!1}function K(A){if(A.keyCode===40){A.preventDefault(),c.open=!0,c.selectedIndex===null?c.selectedIndex=0:c.selectedIndex=Math.min(h.value.length-1,c.selectedIndex+1);const I=a.value.children[c.selectedIndex];I.focus(),I.offsetTop+I.clientHeight>a.value.scrollTop+a.value.clientHeight&&(a.value.scrollTop=I.offsetTop-a.value.clientHeight+I.clientHeight)}else if(A.keyCode===38){A.preventDefault(),c.open=!0,c.selectedIndex===null?c.selectedIndex=h.value.length-1:c.selectedIndex=Math.max(0,c.selectedIndex-1);const I=a.value.children[c.selectedIndex];I.focus(),I.offsetTop<a.value.scrollTop&&(a.value.scrollTop=I.offsetTop)}else if(A.keyCode===13)c.selectedIndex!==null&&k(h.value[c.selectedIndex]),c.open=!c.open;else if(c.open){c.typeToFindInput+=A.key,clearTimeout(c.typeToFindTimer),c.typeToFindTimer=setTimeout(()=>{c.typeToFindInput=""},700);const I=h.value.slice(s.preferredCountries.length).findIndex(U=>xn(U.name).startsWith(c.typeToFindInput));if(I>=0){c.selectedIndex=s.preferredCountries.length+I;const U=a.value.children[c.selectedIndex],F=U.offsetTop<a.value.scrollTop,L=U.offsetTop+U.clientHeight>a.value.scrollTop+a.value.clientHeight;(F||L)&&(a.value.scrollTop=U.offsetTop-a.value.clientHeight/2)}}}function V(){c.selectedIndex=h.value.map(A=>A.iso2).indexOf(c.activeCountryCode),c.open=!1}function D(){window.innerHeight-o.value.getBoundingClientRect().bottom>200?c.dropdownOpenDirection="below":c.dropdownOpenDirection="above"}return n({focus:q,blur:W}),(A,I)=>{const U=i.resolveDirective("click-outside");return i.openBlock(),i.createElementBlock("div",{ref_key:"refRoot",ref:o,class:i.normalizeClass(["vue-tel-input",t.styleClasses,{disabled:t.disabled}])},[i.withDirectives((i.openBlock(),i.createElementBlock("div",{"aria-label":"Country Code Selector","aria-haspopup":"listbox","aria-expanded":c.open,role:"button",class:i.normalizeClass(["vti__dropdown",{open:c.open,disabled:t.dropdownOptions.disabled}]),tabindex:t.dropdownOptions.tabindex,onKeydown:[K,i.withKeys(Y,["space"]),i.withKeys(V,["esc"]),i.withKeys(V,["tab"])],onClick:Y},[i.createElementVNode("span",y1,[t.dropdownOptions.showFlags?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["vti__flag",i.unref(xn)(c.activeCountryCode)])},null,2)):i.createCommentVNode("",!0),t.dropdownOptions.showDialCodeInSelection?(i.openBlock(),i.createElementBlock("span",b1," +"+i.toDisplayString(f.value&&f.value.dialCode),1)):i.createCommentVNode("",!0),i.renderSlot(A.$slots,"arrow-icon",{open:c.open},()=>[i.createElementVNode("span",v1,i.toDisplayString(c.open?"▲":"▼"),1)])]),c.open?(i.openBlock(),i.createElementBlock("ul",{key:0,ref_key:"refList",ref:a,class:i.normalizeClass(["vti__dropdown-list",c.dropdownOpenDirection]),role:"listbox"},[t.dropdownOptions.showSearchBox?(i.openBlock(),i.createElementBlock("div",_1,[i.renderSlot(A.$slots,"search-icon"),i.withDirectives(i.createElementVNode("input",{class:i.normalizeClass(["vti__input","vti__search_box"]),"aria-label":"Search by country name or country code",placeholder:t.dropdownOptions.searchBoxPlaceholder||(h.value.length?h.value[0].name:""),type:"text","onUpdate:modelValue":I[0]||(I[0]=F=>c.searchQuery=F),onClick:I[1]||(I[1]=i.withModifiers(()=>{},["stop"]))},null,8,$1),[[i.vModelText,c.searchQuery]])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(F,L)=>(i.openBlock(),i.createElementBlock("li",{role:"option",class:i.normalizeClass(["vti__dropdown-item",b(L,F.iso2)]),key:F.iso2+(F.preferred?"-preferred":""),tabindex:"-1",onClick:z=>k(F),onMousemove:z=>c.selectedIndex=L,"aria-selected":c.activeCountryCode===F.iso2&&!F.preferred},[t.dropdownOptions.showFlags?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["vti__flag",i.unref(xn)(F.iso2)])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("strong",null,i.toDisplayString(F.name),1),t.dropdownOptions.showDialCodeInList?(i.openBlock(),i.createElementBlock("span",k1," +"+i.toDisplayString(F.dialCode),1)):i.createCommentVNode("",!0)],42,w1))),128))],2)):i.createCommentVNode("",!0)],42,g1)),[[U,re]]),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":I[2]||(I[2]=F=>c.phone=F),ref_key:"refInput",ref:r,type:t.inputOptions.type,autocomplete:t.inputOptions.autocomplete,autofocus:t.inputOptions.autofocus,class:i.normalizeClass(["vti__input","vti__phone",t.inputOptions.styleClasses]),disabled:t.disabled,id:t.inputOptions.id,maxlength:t.inputOptions.maxlength,name:t.inputOptions.name,placeholder:c.parsedPlaceholder,readonly:t.inputOptions.readonly,required:t.inputOptions.required,tabindex:t.inputOptions.tabindex,value:u.value,"aria-describedby":t.inputOptions["aria-describedby"],onBlur:C,onFocus:O,onInput:B,onKeyup:[i.withKeys(N,["enter"]),i.withKeys(R,["space"])]},null,42,C1),[[i.vModelDynamic,c.phone]]),i.renderSlot(A.$slots,"icon-right")],2)}}}),Lp="",Rp="",E1={directives:{Outside:nr},props:{modelValue:{type:String},value:String,inputName:{type:String,default:"phone"},autoDefaultCountry:{type:Boolean,default:!0},ignoredCountries:{type:Array,default:()=>[]},error:{type:Boolean,default:!1},errorMessage:{type:String,default:""}},emits:["update:modelValue","onReady"],components:{VueTelInput:O1,IbAlert:Ft,IbIcon:Le},data(){return{vueTel:null,dialCode:"",defaultCountry:"US",allowChange:!1}},mounted(){this.vueTel=this.$refs.vueTel,this.$emit("onReady")},computed:{phone:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{countryChanged(t){this.$globalEvents.$on("countrySelectValue",n=>{this.vueTel.choose(n)}),!this.phone||this.phone.length-1<this.dialCode.length?this.phone="+"+t.dialCode:this.dialCode&&(this.phone=this.phone.replace(this.dialCode,t.dialCode)),this.dialCode=t.dialCode},clickOutside(){this.vueTel.open&&this.vueTel.clickedOutside()}}};function S1(t,n,e,o,a,r){const l=i.resolveComponent("ib-alert"),s=i.resolveComponent("ib-icon"),u=i.resolveComponent("vue-tel-input"),c=i.resolveDirective("outside");return i.openBlock(),i.createElementBlock(i.Fragment,null,[e.errorMessage.length?(i.openBlock(),i.createBlock(l,{key:0,class:"ib-phone-error-message"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.errorMessage),1)]),_:1})):i.createCommentVNode("",!0),i.withDirectives((i.openBlock(),i.createBlock(u,i.mergeProps({modelValue:r.phone,"onUpdate:modelValue":n[0]||(n[0]=p=>r.phone=p)},t.$attrs,{onCountryChanged:r.countryChanged,"input-options":{name:e.inputName,id:e.inputName,autocomplete:"off"},"auto-default-country":e.autoDefaultCountry,"dropdown-options":{showSearchBox:!0,showFlags:!0,tabindex:0},defaultCountry:a.defaultCountry,ignoredCountries:e.ignoredCountries,class:{error:e.error||e.errorMessage.length},"style-classes":"ib-phone-input",ref:"vueTel"}),{"arrow-icon":i.withCtx(()=>[i.createVNode(s,{name:"chevron-down-outline"})]),_:1},16,["modelValue","onCountryChanged","input-options","auto-default-country","defaultCountry","ignoredCountries","class"])),[[c,r.clickOutside]])],64)}const x1=_e(E1,[["render",S1]]);var $a={exports:{}};/*!
89
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s1(t,n){if(t){if(typeof t=="string")return ba(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ba(t,n)}}function ba(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}function d1(t,n){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var o=[],a=!0,r=!1,l,s;try{for(e=e.call(t);!(a=(l=e.next()).done)&&(o.push(l.value),!(n&&o.length===n));a=!0);}catch(u){r=!0,s=u}finally{try{!a&&e.return!=null&&e.return()}finally{if(r)throw s}}return o}}function c1(t){if(Array.isArray(t))return t}function u1(t){var n=Array.prototype.slice.call(t),e=a1(n,4),o=e[0],a=e[1],r=e[2],l=e[3],s,u,c;if(typeof o=="string")s=o;else throw new TypeError("A text for parsing must be a string.");if(!a||typeof a=="string")l?(u=r,c=l):(u=void 0,c=r),a&&(u=i1({defaultCountry:a},u));else if(ur(a))r?(u=a,c=r):c=a;else throw new Error("Invalid second argument: ".concat(a));return{text:s,options:u,metadata:c}}function va(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,o)}return e}function _a(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?va(Object(e),!0).forEach(function(o){f1(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):va(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function f1(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function h1(t,n,e){n&&n.defaultCountry&&!Bf(n.defaultCountry,e)&&(n=_a(_a({},n),{},{defaultCountry:void 0}));try{return r1(t,n,e)}catch(o){if(!(o instanceof At))throw o}}function p1(){var t=u1(arguments),n=t.text,e=t.options,o=t.metadata;return h1(n,e,o)}function ui(){return ff(p1,arguments)}const m1={beforeMount(t,n,e){if(typeof n.value!="function"){const o=e.context.name;let a=`[Vue-click-outside:] provided expression ${n.expression} is not a function, but has to be`;o&&(a+=`Found in component ${o}`),console.warn(a)}t.clickOutsideEvent=function(o){const a=o.composedPath?o.composedPath():o.path;t===o.target||t.contains(o.target)||a.includes(t)||n.value(o,t)},document.body.addEventListener("click",t.clickOutsideEvent)},unmounted(t){document.body.removeEventListener("click",t.clickOutsideEvent)}},g1=["aria-expanded","tabindex"],y1={class:"vti__selection"},b1={key:1,class:"vti__country-code"},v1={class:"vti__dropdown-arrow"},_1={key:0,class:"vti__search_box_container"},$1=["placeholder"],w1=["onClick","onMousemove","aria-selected"],k1={key:1},C1=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex","value","aria-describedby"],O1=i.defineComponent({name:"VueTelInput",directives:{clickOutside:m1},__name:"vue-tel-input",props:i.mergeModels({allCountries:{type:Array,default:()=>tt("allCountries")},autoFormat:{type:Boolean,default:()=>tt("autoFormat")},customValidate:{type:[Boolean,RegExp],default:()=>tt("customValidate")},defaultCountry:{type:[String,Number],default:()=>tt("defaultCountry")},disabled:{type:Boolean,default:()=>tt("disabled")},autoDefaultCountry:{type:Boolean,default:()=>tt("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>tt("dropdownOptions")},ignoredCountries:{type:Array,default:()=>tt("ignoredCountries")},inputOptions:{type:Object,default:()=>tt("inputOptions")},invalidMsg:{type:String,default:()=>tt("invalidMsg")},mode:{type:String,default:()=>tt("mode")},onlyCountries:{type:Array,default:()=>tt("onlyCountries")},preferredCountries:{type:Array,default:()=>tt("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>tt("validCharactersOnly")},styleClasses:{type:[String,Array,Object],default:()=>tt("styleClasses")}},{modelValue:{type:String},modelModifiers:{}}),emits:i.mergeModels(["blur","close","country-changed","enter","focus","on-input","open","space","validate"],["update:modelValue"]),setup(t,{expose:n,emit:e}){const o=i.shallowRef(),a=i.shallowRef(),r=i.shallowRef(),l=e,s=t,u=i.useModel(t,"modelValue");i.watch(u,(A,I)=>{S()?c.phone=A??"":i.nextTick(()=>{c.phone=I??"",B()})});const c=i.reactive({phone:"",activeCountryCode:void 0,open:!1,finishMounted:!1,selectedIndex:null,typeToFindInput:"",typeToFindTimer:void 0,dropdownOpenDirection:"below",parsedPlaceholder:s.inputOptions.placeholder,searchQuery:""});i.watch(()=>c.open,A=>{A?(D(),l("open")):l("close")});const p=i.computed(()=>s.onlyCountries.length?s.allCountries.filter(({iso2:A})=>s.onlyCountries.some(I=>Tn(I)===A)):s.ignoredCountries.length?s.allCountries.filter(({iso2:A})=>!s.ignoredCountries.includes(Tn(A))&&!s.ignoredCountries.includes(xn(A))):s.allCountries),f=i.computed(()=>g(c.activeCountryCode));i.watch(f,(A,I)=>{if(!A&&I!=null&&I.iso2){c.activeCountryCode=I.iso2;return}A!=null&&A.iso2&&l("country-changed",A)});const d=i.computed(()=>{var A;const I=xn(s.mode);return I==="auto"?(A=c.phone)!=null&&A.startsWith("+")?"international":"national":["national","international","e.164","rfc3966","idd"].includes(I)?I:(console.error('Invalid value of prop "mode"'),"international")}),h=i.computed(()=>{const A=[...y(s.preferredCountries).map(U=>({...U,preferred:!0})),...p.value];if(!s.dropdownOptions.showSearchBox)return A;const I=c.searchQuery.toLowerCase().replace(/[~`!@#$%^&*()+={}\[\];:\'\"<>.,\/\\\?-_]/g,"");return A.filter(U=>new RegExp(I,"i").test(U.name)||new RegExp(I,"i").test(U.iso2)||new RegExp(I,"i").test(U.dialCode))}),v=i.computed(()=>{var A;const I=c.phone.startsWith("+")?ui(c.phone):ui(c.phone,c.activeCountryCode),U={country:I==null?void 0:I.country,countryCode:I==null?void 0:I.country,formatted:c.phone,valid:I==null?void 0:I.isValid(),possible:(A=I==null?void 0:I.isPossible)==null?void 0:A.call(I),nationalNumber:I==null?void 0:I.nationalNumber};return U.valid&&(U.formatted=I==null?void 0:I.format(Tn(d.value))),I!=null&&I.country&&(s.ignoredCountries.length||s.onlyCountries.length)&&!g(I.country)&&(U.valid=!1,U.possible=!1,I.country=null),I?{...U,...I}:U});i.watch(()=>v.value.countryCode,A=>{A&&(c.activeCountryCode=A)}),i.watch(()=>v.value.valid,()=>{l("validate",v.value)}),i.watch(()=>v.value.formatted,A=>{!s.autoFormat||s.customValidate||(E(A),i.nextTick(()=>{A&&!u.value&&(c.phone=A)}))}),i.watch(()=>s.inputOptions.placeholder,m),i.onMounted(()=>{u.value&&(c.phone=u.value.trim()),T(),_().then(()=>{var A;!c.phone&&(A=s.inputOptions)!=null&&A.showDialCode&&c.activeCountryCode&&(c.phone=`+${c.activeCountryCode}`),l("validate",v.value)}).catch(console.error).then(()=>{c.finishMounted=!0})});function m(){c.parsedPlaceholder=s.inputOptions.placeholder}function _(){return new Promise(A=>{var I;if(((I=c.phone)==null?void 0:I[0])==="+"){A();return}if(s.defaultCountry){if(typeof s.defaultCountry=="string"){k(s.defaultCountry),A();return}if(typeof s.defaultCountry=="number"){const F=w(s.defaultCountry);if(F){k(F.iso2),A();return}}}const U=s.preferredCountries[0]||p.value[0];s.autoDefaultCountry?lf().then(F=>{k(F||c.activeCountryCode)}).catch(F=>{console.warn(F),k(U)}).then(()=>{A()}):(k(U),A())})}function y(A=[]){return A.map(g).filter(Boolean)}function g(A=""){return p.value.find(I=>I.iso2===Tn(A))}function w(A){return p.value.find(I=>Number(I.dialCode)===A)}function b(A,I){const U=c.selectedIndex===A,F=A===s.preferredCountries.length-1,L=s.preferredCountries.some(z=>Tn(z)===I);return{highlighted:U,"last-preferred":F,preferred:L}}function k(A){var I,U,F;let L=A;if(typeof L=="string"&&(L=g(L)),!!L){if(((I=c.phone)==null?void 0:I[0])==="+"&&L.iso2&&v.value.nationalNumber){c.activeCountryCode=L.iso2,c.phone=((U=ui(v.value.nationalNumber,L.iso2))==null?void 0:U.formatInternational())??"";return}if((F=s.inputOptions)!=null&&F.showDialCode&&L){c.phone=`+${L.dialCode}`,c.activeCountryCode=L.iso2;return}c.activeCountryCode=L.iso2,E(c.phone)}}function T(){const A=c.phone;if(s.validCharactersOnly){const I=c.phone.match(/[()\-+0-9\s]*/g);c.phone=I.join("")}if(s.customValidate&&s.customValidate instanceof RegExp){const I=c.phone.match(s.customValidate);c.phone=I.join("")}A!==c.phone&&E(c.phone)}function S(){return s.validCharactersOnly&&!/^[()\-+0-9\s]*$/.test(c.phone)?!1:s.customValidate?x():!0}function x(){return s.customValidate instanceof RegExp?s.customValidate.test(c.phone):!1}function B(){var A;(A=r.value)==null||A.setCustomValidity(v.value.valid?"":s.invalidMsg),E(c.phone)}function E(A){u.value=A,l("on-input",A,v.value,r.value)}function C(A){l("blur",A)}function O(A){sf(r.value,c.phone.length),l("focus",A)}function N(A){l("enter",A)}function R(A){l("space",A)}function q(){var A;(A=r.value)==null||A.focus()}function W(){var A;(A=r.value)==null||A.blur()}function Y(){s.disabled||s.dropdownOptions.disabled||(c.searchQuery="",c.open=!c.open)}function re(){c.open=!1}function K(A){if(A.keyCode===40){A.preventDefault(),c.open=!0,c.selectedIndex===null?c.selectedIndex=0:c.selectedIndex=Math.min(h.value.length-1,c.selectedIndex+1);const I=a.value.children[c.selectedIndex];I.focus(),I.offsetTop+I.clientHeight>a.value.scrollTop+a.value.clientHeight&&(a.value.scrollTop=I.offsetTop-a.value.clientHeight+I.clientHeight)}else if(A.keyCode===38){A.preventDefault(),c.open=!0,c.selectedIndex===null?c.selectedIndex=h.value.length-1:c.selectedIndex=Math.max(0,c.selectedIndex-1);const I=a.value.children[c.selectedIndex];I.focus(),I.offsetTop<a.value.scrollTop&&(a.value.scrollTop=I.offsetTop)}else if(A.keyCode===13)c.selectedIndex!==null&&k(h.value[c.selectedIndex]),c.open=!c.open;else if(c.open){c.typeToFindInput+=A.key,clearTimeout(c.typeToFindTimer),c.typeToFindTimer=setTimeout(()=>{c.typeToFindInput=""},700);const I=h.value.slice(s.preferredCountries.length).findIndex(U=>xn(U.name).startsWith(c.typeToFindInput));if(I>=0){c.selectedIndex=s.preferredCountries.length+I;const U=a.value.children[c.selectedIndex],F=U.offsetTop<a.value.scrollTop,L=U.offsetTop+U.clientHeight>a.value.scrollTop+a.value.clientHeight;(F||L)&&(a.value.scrollTop=U.offsetTop-a.value.clientHeight/2)}}}function V(){c.selectedIndex=h.value.map(A=>A.iso2).indexOf(c.activeCountryCode),c.open=!1}function D(){window.innerHeight-o.value.getBoundingClientRect().bottom>200?c.dropdownOpenDirection="below":c.dropdownOpenDirection="above"}return n({focus:q,blur:W}),(A,I)=>{const U=i.resolveDirective("click-outside");return i.openBlock(),i.createElementBlock("div",{ref_key:"refRoot",ref:o,class:i.normalizeClass(["vue-tel-input",t.styleClasses,{disabled:t.disabled}])},[i.withDirectives((i.openBlock(),i.createElementBlock("div",{"aria-label":"Country Code Selector","aria-haspopup":"listbox","aria-expanded":c.open,role:"button",class:i.normalizeClass(["vti__dropdown",{open:c.open,disabled:t.dropdownOptions.disabled}]),tabindex:t.dropdownOptions.tabindex,onKeydown:[K,i.withKeys(Y,["space"]),i.withKeys(V,["esc"]),i.withKeys(V,["tab"])],onClick:Y},[i.createElementVNode("span",y1,[t.dropdownOptions.showFlags?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["vti__flag",i.unref(xn)(c.activeCountryCode)])},null,2)):i.createCommentVNode("",!0),t.dropdownOptions.showDialCodeInSelection?(i.openBlock(),i.createElementBlock("span",b1," +"+i.toDisplayString(f.value&&f.value.dialCode),1)):i.createCommentVNode("",!0),i.renderSlot(A.$slots,"arrow-icon",{open:c.open},()=>[i.createElementVNode("span",v1,i.toDisplayString(c.open?"▲":"▼"),1)])]),c.open?(i.openBlock(),i.createElementBlock("ul",{key:0,ref_key:"refList",ref:a,class:i.normalizeClass(["vti__dropdown-list",c.dropdownOpenDirection]),role:"listbox"},[t.dropdownOptions.showSearchBox?(i.openBlock(),i.createElementBlock("div",_1,[i.renderSlot(A.$slots,"search-icon"),i.withDirectives(i.createElementVNode("input",{class:i.normalizeClass(["vti__input","vti__search_box"]),"aria-label":"Search by country name or country code",placeholder:t.dropdownOptions.searchBoxPlaceholder||(h.value.length?h.value[0].name:""),type:"text","onUpdate:modelValue":I[0]||(I[0]=F=>c.searchQuery=F),onClick:I[1]||(I[1]=i.withModifiers(()=>{},["stop"]))},null,8,$1),[[i.vModelText,c.searchQuery]])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(F,L)=>(i.openBlock(),i.createElementBlock("li",{role:"option",class:i.normalizeClass(["vti__dropdown-item",b(L,F.iso2)]),key:F.iso2+(F.preferred?"-preferred":""),tabindex:"-1",onClick:z=>k(F),onMousemove:z=>c.selectedIndex=L,"aria-selected":c.activeCountryCode===F.iso2&&!F.preferred},[t.dropdownOptions.showFlags?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["vti__flag",i.unref(xn)(F.iso2)])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("strong",null,i.toDisplayString(F.name),1),t.dropdownOptions.showDialCodeInList?(i.openBlock(),i.createElementBlock("span",k1," +"+i.toDisplayString(F.dialCode),1)):i.createCommentVNode("",!0)],42,w1))),128))],2)):i.createCommentVNode("",!0)],42,g1)),[[U,re]]),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":I[2]||(I[2]=F=>c.phone=F),ref_key:"refInput",ref:r,type:t.inputOptions.type,autocomplete:t.inputOptions.autocomplete,autofocus:t.inputOptions.autofocus,class:i.normalizeClass(["vti__input","vti__phone",t.inputOptions.styleClasses]),disabled:t.disabled,id:t.inputOptions.id,maxlength:t.inputOptions.maxlength,name:t.inputOptions.name,placeholder:c.parsedPlaceholder,readonly:t.inputOptions.readonly,required:t.inputOptions.required,tabindex:t.inputOptions.tabindex,value:u.value,"aria-describedby":t.inputOptions["aria-describedby"],onBlur:C,onFocus:O,onInput:B,onKeyup:[i.withKeys(N,["enter"]),i.withKeys(R,["space"])]},null,42,C1),[[i.vModelDynamic,c.phone]]),i.renderSlot(A.$slots,"icon-right")],2)}}}),Lp="",Rp="",E1={directives:{Outside:nr},props:{modelValue:{type:String},value:String,inputName:{type:String,default:"phone"},autoDefaultCountry:{type:Boolean,default:!0},ignoredCountries:{type:Array,default:()=>[]},error:{type:Boolean,default:!1},errorMessage:{type:String,default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","onReady"],components:{VueTelInput:O1,IbAlert:Ft,IbIcon:Le},data(){return{vueTel:null,dialCode:"",defaultCountry:"US",allowChange:!1}},mounted(){this.vueTel=this.$refs.vueTel,this.$emit("onReady")},computed:{phone:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{countryChanged(t){this.$globalEvents.$on("countrySelectValue",n=>{this.vueTel.choose(n)}),!this.phone||this.phone.length-1<this.dialCode.length?this.phone="+"+t.dialCode:this.dialCode&&(this.phone=this.phone.replace(this.dialCode,t.dialCode)),this.dialCode=t.dialCode},clickOutside(){this.vueTel.open&&this.vueTel.clickedOutside()}}};function S1(t,n,e,o,a,r){const l=i.resolveComponent("ib-alert"),s=i.resolveComponent("ib-icon"),u=i.resolveComponent("vue-tel-input"),c=i.resolveDirective("outside");return i.openBlock(),i.createElementBlock(i.Fragment,null,[e.errorMessage.length?(i.openBlock(),i.createBlock(l,{key:0,class:"ib-phone-error-message"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.errorMessage),1)]),_:1})):i.createCommentVNode("",!0),i.withDirectives((i.openBlock(),i.createBlock(u,i.mergeProps({modelValue:r.phone,"onUpdate:modelValue":n[0]||(n[0]=p=>r.phone=p)},t.$attrs,{onCountryChanged:r.countryChanged,"input-options":{name:e.inputName,id:e.inputName,autocomplete:"off"},"auto-default-country":e.autoDefaultCountry,"dropdown-options":{showSearchBox:!0,showFlags:!0,tabindex:0},defaultCountry:a.defaultCountry,ignoredCountries:e.ignoredCountries,class:{error:e.error||e.errorMessage.length,disabled:e.disabled},disabled:e.disabled,"style-classes":"ib-phone-input",ref:"vueTel"}),{"arrow-icon":i.withCtx(()=>[i.createVNode(s,{name:"chevron-down-outline"})]),_:1},16,["modelValue","onCountryChanged","input-options","auto-default-country","defaultCountry","ignoredCountries","class","disabled"])),[[c,r.clickOutside]])],64)}const x1=_e(E1,[["render",S1]]);var $a={exports:{}};/*!
90
90
  * Quill Editor v1.3.7
91
91
  * https://quilljs.com/
92
92
  * Copyright (c) 2014, Jason Chen