UNPKG

@gravityforms/components

Version:

UI components for use in Gravity Forms development. Both React and vanilla js flavors.

1 lines 146 kB
"use strict";(self.webpackChunkgravityforms=self.webpackChunkgravityforms||[]).push([[680],{419:function(t,d,e){e.d(d,{A:function(){return A}});var n=e(8171),r=e(3798);function a(t,d,e){if(void 0===d&&(d={}),e=new n.Ay(e),d.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");e.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!e.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));e.country(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");e.selectNumberingPlan(t.countryCallingCode)}}if(e.possibleLengths())return function(t,d){if("IS_POSSIBLE"===(0,r.A)(t,d))return!0;return!1}(t.phone||t.nationalNumber,e);if(t.countryCallingCode&&e.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}var i=e(2700),$=e(9386);function o(t,d,e){var r=new n.Ay(e).getCountryCodesForCallingCode(t);return r?r.filter((function(t){return function(t,d,e){var r=new n.Ay(e);if(r.selectNumberingPlan(d),r.numberingPlan.possibleLengths().indexOf(t.length)>=0)return!0;return!1}(d,t,e)})):[]}var u=e(8988),l=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function s(t,d){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,d){if(!t)return;if("string"==typeof t)return c(t,d);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return c(t,d)}(t))||d&&t&&"number"==typeof t.length){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,d){(null==d||d>t.length)&&(d=t.length);for(var e=0,n=new Array(d);e<d;e++)n[e]=t[e];return n}function f(t,d){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);d&&(n=n.filter((function(d){return Object.getOwnPropertyDescriptor(t,d).enumerable}))),e.push.apply(e,n)}return e}function h(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{};d%2?f(Object(e),!0).forEach((function(d){g(t,d,e[d])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):f(Object(e)).forEach((function(d){Object.defineProperty(t,d,Object.getOwnPropertyDescriptor(e,d))}))}return t}function g(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}var m={formatExtension:function(t,d,e){return"".concat(t).concat(e.ext()).concat(d)}};function y(t,d,e,r){if(e=e?h(h({},m),e):m,r=new n.Ay(r),t.country&&"001"!==t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.country(t.country)}else{if(!t.countryCallingCode)return t.phone||"";r.selectNumberingPlan(t.countryCallingCode)}var a,i=r.countryCallingCode(),$=e.v2?t.nationalNumber:t.phone;switch(d){case"NATIONAL":return $?p(a=v($,t.carrierCode,"NATIONAL",r,e),t.ext,r,e.formatExtension):"";case"INTERNATIONAL":return $?(a=v($,null,"INTERNATIONAL",r,e),p(a="+".concat(i," ").concat(a),t.ext,r,e.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat($);case"RFC3966":return function(t){var d=t.number,e=t.ext;if(!d)return"";if("+"!==d[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(d).concat(e?";ext="+e:"")}({number:"+".concat(i).concat($),ext:t.ext});case"IDD":if(!e.fromCountry)return;var o=function(t,d,e,r,a){var i=(0,n.Ko)(r,a.metadata);if(i===e){var $=v(t,d,"NATIONAL",a);return"1"===e?e+" "+$:$}var o=function(t,d,e){var r=new n.Ay(e);return r.selectNumberingPlan(t,d),r.defaultIDDPrefix()?r.defaultIDDPrefix():l.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,a.metadata);if(o)return"".concat(o," ").concat(e," ").concat(v(t,null,"INTERNATIONAL",a))}($,t.carrierCode,i,e.fromCountry,r);return p(o,t.ext,r,e.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(d,'"'))}}function v(t,d,e,n,r){var a=function(t,d){for(var e,n=s(t);!(e=n()).done;){var r=e.value;if(r.leadingDigitsPatterns().length>0){var a=r.leadingDigitsPatterns()[r.leadingDigitsPatterns().length-1];if(0!==d.search(a))continue}if((0,i.A)(d,r.pattern()))return r}}(n.formats(),t);return a?(0,u.A)(t,a,{useInternationalFormat:"INTERNATIONAL"===e,withNationalPrefix:!a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!r||!1!==r.nationalPrefix,carrierCode:d,metadata:n}):t}function p(t,d,e,n){return d?n(t,d,e):t}function b(t,d){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);d&&(n=n.filter((function(d){return Object.getOwnPropertyDescriptor(t,d).enumerable}))),e.push.apply(e,n)}return e}function C(t){for(var d=1;d<arguments.length;d++){var e=null!=arguments[d]?arguments[d]:{};d%2?b(Object(e),!0).forEach((function(d){N(t,d,e[d])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):b(Object(e)).forEach((function(d){Object.defineProperty(t,d,Object.getOwnPropertyDescriptor(e,d))}))}return t}function N(t,d,e){return d in t?Object.defineProperty(t,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[d]=e,t}function P(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var A=function(){function t(d,e,r){if(function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),!d)throw new TypeError("`country` or `countryCallingCode` not passed");if(!e)throw new TypeError("`nationalNumber` not passed");if(!r)throw new TypeError("`metadata` not passed");var a=function(t,d){var e,r,a=new n.Ay(d);S(t)?(e=t,a.selectNumberingPlan(e),r=a.countryCallingCode()):r=t;return{country:e,countryCallingCode:r}}(d,r),i=a.country,$=a.countryCallingCode;this.country=i,this.countryCallingCode=$,this.nationalNumber=e,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}var d,e,r;return d=t,(e=[{key:"setExt",value:function(t){this.ext=t}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:o(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return a(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return function(t,d,e){if(d=d||{},(e=new n.Ay(e)).selectNumberingPlan(t.country,t.countryCallingCode),e.hasTypes())return void 0!==(0,$.A)(t,d,e.metadata);var r=d.v2?t.nationalNumber:t.phone;return(0,i.A)(r,e.nationalNumberPattern())}(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new n.Ay(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(t){return this.number===t.number&&this.ext===t.ext}},{key:"getType",value:function(){return(0,$.A)(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(t,d){return y(this,t,d?C(C({},d),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(t){return this.format("NATIONAL",t)}},{key:"formatInternational",value:function(t){return this.format("INTERNATIONAL",t)}},{key:"getURI",value:function(t){return this.format("RFC3966",t)}}])&&P(d.prototype,e),r&&P(d,r),Object.defineProperty(d,"prototype",{writable:!1}),t}(),S=function(t){return/^[A-Z]{2}$/.test(t)}},1677:function(t,d,e){function n(t,d,e){for(var n={},r="",a=0,i=0;i<t.length;){var $=e(t[i],r,n);void 0!==$&&(r+=$,void 0!==d&&(d===i?a=r.length-1:d>i&&(a=r.length))),i++}return void 0===d&&(a=r.length),{value:r,caret:a}}e.d(d,{A:function(){return n}})},1844:function(t,d,e){e.d(d,{A:function(){return r}});var n={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 r(t){return n[t]}},1969:function(t,d){d.A={AC:"40123",AD:"312345",AE:"501234567",AF:"701234567",AG:"2684641234",AI:"2642351234",AL:"672123456",AM:"77123456",AO:"923123456",AR:"91123456789",AS:"6847331234",AT:"664123456",AU:"412345678",AW:"5601234",AX:"412345678",AZ:"401234567",BA:"61123456",BB:"2462501234",BD:"1812345678",BE:"470123456",BF:"70123456",BG:"43012345",BH:"36001234",BI:"79561234",BJ:"0195123456",BL:"690001234",BM:"4413701234",BN:"7123456",BO:"71234567",BQ:"3181234",BR:"11961234567",BS:"2423591234",BT:"17123456",BW:"71123456",BY:"294911911",BZ:"6221234",CA:"5062345678",CC:"412345678",CD:"991234567",CF:"70012345",CG:"061234567",CH:"781234567",CI:"0123456789",CK:"71234",CL:"221234567",CM:"671234567",CN:"13123456789",CO:"3211234567",CR:"83123456",CU:"51234567",CV:"9911234",CW:"95181234",CX:"412345678",CY:"96123456",CZ:"601123456",DE:"15123456789",DJ:"77831001",DK:"34412345",DM:"7672251234",DO:"8092345678",DZ:"551234567",EC:"991234567",EE:"51234567",EG:"1001234567",EH:"650123456",ER:"7123456",ES:"612345678",ET:"911234567",FI:"412345678",FJ:"7012345",FK:"51234",FM:"3501234",FO:"211234",FR:"612345678",GA:"06031234",GB:"7400123456",GD:"4734031234",GE:"555123456",GF:"694201234",GG:"7781123456",GH:"231234567",GI:"57123456",GL:"221234",GM:"3012345",GN:"601123456",GP:"690001234",GQ:"222123456",GR:"6912345678",GT:"51234567",GU:"6713001234",GW:"955012345",GY:"6091234",HK:"51234567",HN:"91234567",HR:"921234567",HT:"34101234",HU:"201234567",ID:"812345678",IE:"850123456",IL:"502345678",IM:"7924123456",IN:"8123456789",IO:"3801234",IQ:"7912345678",IR:"9123456789",IS:"6111234",IT:"3123456789",JE:"7797712345",JM:"8762101234",JO:"790123456",JP:"9012345678",KE:"712123456",KG:"700123456",KH:"91234567",KI:"72001234",KM:"3212345",KN:"8697652917",KP:"1921234567",KR:"1020000000",KW:"50012345",KY:"3453231234",KZ:"7710009998",LA:"2023123456",LB:"71123456",LC:"7582845678",LI:"660234567",LK:"712345678",LR:"770123456",LS:"50123456",LT:"61234567",LU:"628123456",LV:"21234567",LY:"912345678",MA:"650123456",MC:"612345678",MD:"62112345",ME:"67622901",MF:"690001234",MG:"321234567",MH:"2351234",MK:"72345678",ML:"65012345",MM:"92123456",MN:"88123456",MO:"66123456",MP:"6702345678",MQ:"696201234",MR:"22123456",MS:"6644923456",MT:"96961234",MU:"52512345",MV:"7712345",MW:"991234567",MX:"2221234567",MY:"123456789",MZ:"821234567",NA:"811234567",NC:"751234",NE:"93123456",NF:"381234",NG:"8021234567",NI:"81234567",NL:"612345678",NO:"40612345",NP:"9841234567",NR:"5551234",NU:"8884012",NZ:"211234567",OM:"92123456",PA:"61234567",PE:"912345678",PF:"87123456",PG:"70123456",PH:"9051234567",PK:"3012345678",PL:"512345678",PM:"551234",PR:"7872345678",PS:"599123456",PT:"912345678",PW:"6201234",PY:"961456789",QA:"33123456",RE:"692123456",RO:"712034567",RS:"601234567",RU:"9123456789",RW:"720123456",SA:"512345678",SB:"7421234",SC:"2510123",SD:"911231234",SE:"701234567",SG:"81234567",SH:"51234",SI:"31234567",SJ:"41234567",SK:"912123456",SL:"25123456",SM:"66661212",SN:"701234567",SO:"71123456",SR:"7412345",SS:"977123456",ST:"9812345",SV:"70123456",SX:"7215205678",SY:"944567890",SZ:"76123456",TA:"8999",TC:"6492311234",TD:"63012345",TG:"90112345",TH:"812345678",TJ:"917123456",TK:"7290",TL:"77212345",TM:"66123456",TN:"20123456",TO:"7715123",TR:"5012345678",TT:"8682911234",TV:"901234",TW:"912345678",TZ:"621234567",UA:"501234567",UG:"712345678",US:"2015550123",UY:"94231234",UZ:"912345678",VA:"3123456789",VC:"7844301234",VE:"4121234567",VG:"2843001234",VI:"3406421234",VN:"912345678",VU:"5912345",WF:"821234",WS:"7212345",XK:"43201234",YE:"712345678",YT:"639012345",ZA:"711234567",ZM:"955123456",ZW:"712345678"}},2700:function(t,d,e){function n(t,d){return t=t||"",new RegExp("^(?:"+d+")$").test(t)}e.d(d,{A:function(){return n}})},3068:function(t,d,e){e.d(d,{Jq:function(){return n},OA:function(){return r},tz:function(){return i},uD:function(){return a}});var n=3,r="0-90-9٠-٩۰-۹",a="".concat("-‐-―−ー-").concat("//").concat("..").concat("  ­​⁠ ").concat("()()[]\\[\\]").concat("~⁓∼~"),i="++"},3315:function(t,d,e){e.d(d,{A:function(){return r}});var n=e(3068);function r(t){return t.replace(new RegExp("[".concat(n.uD,"]+"),"g")," ").trim()}},3798:function(t,d,e){function n(t,d){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,d){if(!t)return;if("string"==typeof t)return r(t,d);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return r(t,d)}(t))||d&&t&&"number"==typeof t.length){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,d){(null==d||d>t.length)&&(d=t.length);for(var e=0,n=new Array(d);e<d;e++)n[e]=t[e];return n}function a(t,d){return i(t,void 0,d)}function i(t,d,e){var r=e.type(d),a=r&&r.possibleLengths()||e.possibleLengths();if(!a)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===d){if(!e.type("FIXED_LINE"))return i(t,"MOBILE",e);var $=e.type("MOBILE");$&&(a=function(t,d){for(var e,r=t.slice(),a=n(d);!(e=a()).done;){var i=e.value;t.indexOf(i)<0&&r.push(i)}return r.sort((function(t,d){return t-d}))}(a,$.possibleLengths()))}else if(d&&!r)return"INVALID_LENGTH";var o=t.length,u=a[0];return u===o?"IS_POSSIBLE":u>o?"TOO_SHORT":a[a.length-1]<o?"TOO_LONG":a.indexOf(o,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}e.d(d,{A:function(){return a}})},4965:function(t,d,e){e.d(d,{A:function(){return r}});var n=e(5295);function r(t,d,e){"function"==typeof d&&(e=d,d="x");var r=(0,n.v)(d,t);return function(t,d){if(d.length<r)return e(t,d)}}},5295:function(t,d,e){function n(t,d){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,d){if(!t)return;if("string"==typeof t)return r(t,d);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return r(t,d)}(t))||d&&t&&"number"==typeof t.length){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,d){(null==d||d>t.length)&&(d=t.length);for(var e=0,n=new Array(d);e<d;e++)n[e]=t[e];return n}function a(t,d){for(var e,r=0,a=n(d.split(""));!(e=a()).done;){e.value===t&&r++}return r}e.d(d,{v:function(){return a}})},6511:function(t,d,e){e.d(d,{A:function(){return r}});var n=e(7611);function r(t,d,e){"string"==typeof e&&(e=(0,n.A)(e));var r=e(t)||{},a=r.text,i=r.template;if(void 0===a&&(a=t),i)if(void 0===d)d=a.length;else{for(var $=0,o=!1,u=-1;$<a.length&&$<i.length;){if(a[$]!==i[$]){if(0===d){o=!0,d=$;break}u=$,d--}$++}o||(d=u+1)}return{text:a,caret:d}}},7611:function(t,d,e){e.d(d,{A:function(){return i}});var n=e(5295);function r(t,d){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,d){if(!t)return;if("string"==typeof t)return a(t,d);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return a(t,d)}(t))||d&&t&&"number"==typeof t.length){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,d){(null==d||d>t.length)&&(d=t.length);for(var e=0,n=new Array(d);e<d;e++)n[e]=t[e];return n}function i(t){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",e=arguments.length>2?arguments[2]:void 0;if(!t)return function(t){return{text:t}};var a=(0,n.v)(d,t);return function(i){if(!i)return{text:"",template:t};for(var $,o=0,u="",l=r(t.split(""));!($=l()).done;){var s=$.value;if(s===d){if(u+=i[o],++o===i.length&&i.length<a)break}else u+=s}return e&&(u=function(t,d){for(var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:" ",a=t.length,i=(0,n.v)("(",t)-(0,n.v)(")",t);i>0&&a<d.length;)t+=d[a].replace(e,r),")"===d[a]&&i--,a++;return t}(u,t)),{text:u,template:t}}}},8048:function(t,d,e){e.d(d,{A:function(){return r}});var n={}.constructor;function r(t){return null!=t&&t.constructor===n}},8171:function(t,d,e){function n(t,d){t=t.split("-"),d=d.split("-");for(var e=t[0].split("."),n=d[0].split("."),r=0;r<3;r++){var a=Number(e[r]),i=Number(n[r]);if(a>i)return 1;if(i>a)return-1;if(!isNaN(a)&&isNaN(i))return 1;if(isNaN(a)&&!isNaN(i))return-1}return t[1]&&d[1]?t[1]>d[1]?1:t[1]<d[1]?-1:0:!t[1]&&d[1]?1:t[1]&&!d[1]?-1:0}e.d(d,{Ay:function(){return s},Ko:function(){return v}});var r=e(8048);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function i(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}function $(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,d,e){return d&&$(t.prototype,d),e&&$(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var u=" ext. ",l=/^\d+$/,s=function(){function t(d){i(this,t),function(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!(0,r.A)(t)||!(0,r.A)(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat((0,r.A)(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+y(t)+": "+t,"."))}(d),this.metadata=d,p.call(this,d)}return o(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter((function(t){return"001"!==t}))}},{key:"getCountryMetadata",value:function(t){return this.metadata.countries[t]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(t){return void 0!==this.getCountryMetadata(t)}},{key:"hasCallingCode",value:function(t){if(this.getCountryCodesForCallingCode(t))return!0;if(this.nonGeographic()){if(this.nonGeographic()[t])return!0}else{var d=this.countryCallingCodes()[t];if(d&&1===d.length&&"001"===d[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(t){return this.nonGeographic()?!!this.nonGeographic()[t]:!this.getCountryCodesForCallingCode(t)}},{key:"country",value:function(t){return this.selectNumberingPlan(t)}},{key:"selectNumberingPlan",value:function(t,d){if(t&&l.test(t)&&(d=t,t=null),t&&"001"!==t){if(!this.hasCountry(t))throw new Error("Unknown country: ".concat(t));this.numberingPlan=new c(this.getCountryMetadata(t),this)}else if(d){if(!this.hasCallingCode(d))throw new Error("Unknown calling code: ".concat(d));this.numberingPlan=new c(this.getNumberingPlanMetadata(d),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(t){var d=this.countryCallingCodes()[t];if(d){if(1===d.length&&3===d[0].length)return;return d}}},{key:"getCountryCodeForCallingCode",value:function(t){var d=this.getCountryCodesForCallingCode(t);if(d)return d[0]}},{key:"getNumberingPlanMetadata",value:function(t){var d=this.getCountryCodeForCallingCode(t);if(d)return this.getCountryMetadata(d);if(this.nonGeographic()){var e=this.nonGeographic()[t];if(e)return e}else{var n=this.countryCallingCodes()[t];if(n&&1===n.length&&"001"===n[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(t){return this.numberingPlan.type(t)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(t){return this.selectNumberingPlan(t)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),t}(),c=function(){function t(d,e){i(this,t),this.globalMetadataObject=e,this.metadata=d,p.call(this,e.metadata)}return o(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(t){return t[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var t=this,d=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return d.map((function(d){return new f(d,t)}))}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(t){return t[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(t){if(this.hasTypes()&&m(this.types(),t))return new g(m(this.types(),t),this)}},{key:"ext",value:function(){return this.v1||this.v2?u:this.metadata[13]||u}}]),t}(),f=function(){function t(d,e){i(this,t),this._format=d,this.metadata=e}return o(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||h.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),t}(),h=/^\(?\$1\)?$/,g=function(){function t(d,e){i(this,t),this.type=d,this.metadata=e}return o(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),t}();function m(t,d){switch(d){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}var y=function(t){return a(t)};function v(t,d){if((d=new s(d)).hasCountry(t))return d.country(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function p(t){var d=t.version;"number"==typeof d?(this.v1=1===d,this.v2=2===d,this.v3=3===d,this.v4=4===d):d?-1===n(d,"1.2.0")?this.v2=!0:-1===n(d,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}},8456:function(t,d,e){e.d(d,{Q:function(){return gt}});var n=e(8533),r=e(8171),a=e(419);function i(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var $=function(){function t(d){var e=d.onCountryChange,n=d.onCallingCodeChange;!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),this.onCountryChange=e,this.onCallingCodeChange=n}var d,e,n;return d=t,(e=[{key:"reset",value:function(t){var d=t.country,e=t.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(d,e)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=void 0}},{key:"update",value:function(t){for(var d=0,e=Object.keys(t);d<e.length;d++){var n=e[d];this[n]=t[n]}}},{key:"initCountryAndCallingCode",value:function(t,d){this.setCountry(t),this.setCallingCode(d)}},{key:"setCountry",value:function(t){this.country=t,this.onCountryChange(t)}},{key:"setCallingCode",value:function(t){this.callingCode=t,this.onCallingCodeChange(t,this.country)}},{key:"startInternationalNumber",value:function(t,d){this.international=!0,this.initCountryAndCallingCode(t,d)}},{key:"appendDigits",value:function(t){this.digits+=t}},{key:"appendNationalSignificantNumberDigits",value:function(t){this.nationalSignificantNumber+=t}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])&&i(d.prototype,e),n&&i(d,n),Object.defineProperty(d,"prototype",{writable:!1}),t}();function o(t,d){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,d){if(!t)return;if("string"==typeof t)return u(t,d);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return u(t,d)}(t))||d&&t&&"number"==typeof t.length){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,d){(null==d||d>t.length)&&(d=t.length);for(var e=0,n=new Array(d);e<d;e++)n[e]=t[e];return n}var l="x",s=new RegExp(l);function c(t,d){if(d<1)return"";for(var e="";d>1;)1&d&&(e+=t),d>>=1,t+=t;return e+t}function f(t,d){return")"===t[d]&&d++,function(t){var d=[],e=0;for(;e<t.length;)"("===t[e]?d.push(e):")"===t[e]&&d.pop(),e++;var n=0,r="";d.push(t.length);for(var a=0,i=d;a<i.length;a++){var $=i[a];r+=t.slice(n,$),n=$+1}return r}(t.slice(0,d))}var h=e(3798);function g(t,d){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,d){if(!t)return;if("string"==typeof t)return m(t,d);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return m(t,d)}(t))||d&&t&&"number"==typeof t.length){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(t,d){(null==d||d>t.length)&&(d=t.length);for(var e=0,n=new Array(d);e<d;e++)n[e]=t[e];return n}var y={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 v(t){return y[t]}function p(t){for(var d,e="",n=g(t.split(""));!(d=n()).done;){var r=v(d.value);r&&(e+=r)}return e}var b=e(8988);function C(t,d,e){var n=e.metadata,r=e.shouldTryNationalPrefixFormattingRule,a=e.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(d.pattern(),")$")).test(t.nationalSignificantNumber))return function(t,d,e){var n=e.metadata,r=e.shouldTryNationalPrefixFormattingRule,a=e.getSeparatorAfterNationalPrefix;t.nationalSignificantNumber,t.international,t.nationalPrefix,t.carrierCode;if(r(d)){var i=N(t,d,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:a,metadata:n});if(i)return i}return N(t,d,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:a,metadata:n})}(t,d,{metadata:n,shouldTryNationalPrefixFormattingRule:r,getSeparatorAfterNationalPrefix:a})}function N(t,d,e){var n=e.metadata,r=e.useNationalPrefixFormattingRule,a=e.getSeparatorAfterNationalPrefix,i=(0,b.A)(t.nationalSignificantNumber,d,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:r,metadata:n});if(r||(t.nationalPrefix?i=t.nationalPrefix+a(d)+i:t.complexPrefixBeforeNationalSignificantNumber&&(i=t.complexPrefixBeforeNationalSignificantNumber+" "+i)),function(t,d){return p(t)===d.getNationalDigits()}(i,t))return i}function P(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var A=function(){function t(){!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t)}var d,e,n;return d=t,(e=[{key:"parse",value:function(t){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(t),1!==this.context.length)throw new Error("Non-finalized contexts left when pattern parse ended");var d=this.context[0],e=d.branches,n=d.instructions;if(e)return{op:"|",args:e.concat([w(n)])};if(0===n.length)throw new Error("Pattern is required");return 1===n.length?n[0]:n}},{key:"startContext",value:function(t){this.context.push(t)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(t){if(!t)throw new Error("Pattern is required");var d=t.match(I);if(d){var e=d[1],n=t.slice(0,d.index),r=t.slice(d.index+e.length);switch(e){case"(?:":n&&this.parsePattern(n),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(n&&this.parsePattern(n),0===this.getContext().instructions.length)throw new Error('No instructions found after "|" operator in an "or" group');var a=this.getContext().branches;a.push(w(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:a});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(n&&this.parsePattern(n),!this.getContext().branches){if(1!==this.context.length)throw new Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(w(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":n&&this.parsePattern(n),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:S(n)});break;default:throw new Error("Unknown operator: ".concat(e))}r&&this.parsePattern(r)}else{if(x.test(t))throw new Error("Illegal characters found in a pattern: ".concat(t));this.getContext().instructions=this.getContext().instructions.concat(t.split(""))}}}])&&P(d.prototype,e),n&&P(d,n),Object.defineProperty(d,"prototype",{writable:!1}),t}();function S(t){for(var d=[],e=0;e<t.length;){if("-"===t[e]){if(0===e||e===t.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(t));for(var n=t[e-1].charCodeAt(0)+1,r=t[e+1].charCodeAt(0)-1,a=n;a<=r;)d.push(String.fromCharCode(a)),a++}else d.push(t[e]);e++}return d}var x=/[\(\)\[\]\?\:\|]/,I=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function w(t){return 1===t.length?t[0]:t}function E(t,d){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,d){if(!t)return;if("string"==typeof t)return O(t,d);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return O(t,d)}(t))||d&&t&&"number"==typeof t.length){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(t,d){(null==d||d>t.length)&&(d=t.length);for(var e=0,n=new Array(d);e<d;e++)n[e]=t[e];return n}function M(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var T=function(){function t(d){!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),this.matchTree=(new A).parse(d)}var d,e,n;return d=t,e=[{key:"match",value:function(t){var d=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!t)throw new Error("String is required");var e=F(t.split(""),this.matchTree,!0);if(e&&e.match&&delete e.matchedChars,!e||!e.overflow||d)return e}}],e&&M(d.prototype,e),n&&M(d,n),Object.defineProperty(d,"prototype",{writable:!1}),t}();function F(t,d,e){if("string"==typeof d){var n=t.join("");return 0===d.indexOf(n)?t.length===d.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===n.indexOf(d)?e&&t.length>d.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,d.length)}:void 0}if(Array.isArray(d)){for(var r=t.slice(),a=0;a<d.length;){var i=F(r,d[a],e&&a===d.length-1);if(!i)return;if(i.overflow)return i;if(!i.match){if(i.partialMatch)return{partialMatch:!0};throw new Error("Unsupported match result:\n".concat(JSON.stringify(i,null,2)))}if(0===(r=r.slice(i.matchedChars.length)).length)return a===d.length-1?{match:!0,matchedChars:t}:{partialMatch:!0};a++}return e?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-r.length)}}switch(d.op){case"|":for(var $,o,u=E(d.args);!(o=u()).done;){var l=F(t,o.value,e);if(l){if(l.overflow)return l;if(l.match)return{match:!0,matchedChars:l.matchedChars};if(!l.partialMatch)throw new Error("Unsupported match result:\n".concat(JSON.stringify(l,null,2)));$=!0}}return $?{partialMatch:!0}:void 0;case"[]":for(var s,c=E(d.args);!(s=c()).done;){var f=s.value;if(t[0]===f)return 1===t.length?{match:!0,matchedChars:t}:e?{overflow:!0}:{match:!0,matchedChars:[f]}}return;default:throw new Error("Unsupported instruction tree: ".concat(d))}}var k=e(3068),D=e(3315);function R(t,d){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,d){if(!t)return;if("string"==typeof t)return L(t,d);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return L(t,d)}(t))||d&&t&&"number"==typeof t.length){e&&(t=e);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function L(t,d){(null==d||d>t.length)&&(d=t.length);for(var e=0,n=new Array(d);e<d;e++)n[e]=t[e];return n}function G(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var B=c("9",15),j=/[- ]/,_=function(){return/\[([^\[\]])*\]/g},U=function(){return/\d(?=[^,}][^,}])/g},K=new RegExp("["+k.uD+"]*\\$1["+k.uD+"]*(\\$\\d["+k.uD+"]*)*$"),W=function(){function t(d){d.state;var e=d.metadata;!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),this.metadata=e,this.resetFormat()}var d,e,n;return d=t,(e=[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(t,d){this.resetFormat(),t?(this.isNANP="1"===t.callingCode(),this.matchingFormats=t.formats(),d.nationalSignificantNumber&&this.narrowDownMatchingFormats(d)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(t,d){var e,n,r=this;if(e=d.nationalSignificantNumber,n=this.metadata,"IS_POSSIBLE"===(0,h.A)(e,n))for(var a,i=R(this.matchingFormats);!(a=i()).done;){var $=a.value,o=C(d,$,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(t){return r.shouldTryNationalPrefixFormattingRule(t,{international:d.international,nationalPrefix:d.nationalPrefix})},getSeparatorAfterNationalPrefix:function(t){return r.getSeparatorAfterNationalPrefix(t)}});if(o)return this.resetFormat(),this.chosenFormat=$,this.setNationalNumberTemplate(o.replace(/\d/g,l),d),this.populatedNationalNumberTemplate=o,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(l),o}return this.formatNationalNumberWithNextDigits(t,d)}},{key:"formatNationalNumberWithNextDigits",value:function(t,d){var e=this.chosenFormat,n=this.chooseFormat(d);if(n)return n===e?this.formatNextNationalNumberDigits(t):this.formatNextNationalNumberDigits(d.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(t){var d=this,e=t.nationalSignificantNumber,n=t.nationalPrefix,r=t.international,a=e,i=a.length-3;i<0&&(i=0),this.matchingFormats=this.matchingFormats.filter((function(t){return d.formatSuits(t,r,n)&&d.formatMatches(t,a,i)})),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(t,d,e){return!(e&&!t.usesNationalPrefix()&&!t.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!d&&!e&&t.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(t,d,e){var n=t.leadingDigitsPatterns().length;if(0===n)return!0;e=Math.min(e,n-1);var r=t.leadingDigitsPatterns()[e];if(d.length<3)try{return void 0!==new T(r).match(d,{allowOverflow:!0})}catch(t){return!0}return new RegExp("^(".concat(r,")")).test(d)}},{key:"getFormatFormat",value:function(t,d){return d?t.internationalFormat():t.format()}},{key:"chooseFormat",value:function(t){for(var d,e=this,n=function(){var n=d.value;return e.chosenFormat===n?"break":K.test(e.getFormatFormat(n,t.international))?e.createTemplateForFormat(n,t)?(e.chosenFormat=n,"break"):(e.matchingFormats=e.matchingFormats.filter((function(t){return t!==n})),"continue"):"continue"},r=R(this.matchingFormats.slice());!(d=r()).done;){var a=n();if("break"===a)break}return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(t,d){if(!(t.pattern().indexOf("|")>=0)){var e=this.getTemplateForFormat(t,d);return e?(this.setNationalNumberTemplate(e,d),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(t){return this.isNANP||t&&t.nationalPrefixFormattingRule()&&j.test(t.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(t,d){var e=t.IDDPrefix,n=t.missingPlus;return e?d&&!1===d.spacing?e:e+" ":n?"":"+"}},{key:"getTemplate",value:function(t){if(this.template){for(var d=-1,e=0,n=t.international?this.getInternationalPrefixBeforeCountryCallingCode(t,{spacing:!1}):"";e<n.length+t.getDigitsWithoutInternationalPrefix().length;)d=this.template.indexOf(l,d+1),e++;return f(this.template,d+1)}}},{key:"setNationalNumberTemplate",value:function(t,d){this.nationalNumberTemplate=t,this.populatedNationalNumberTemplate=t,this.populatedNationalNumberTemplatePosition=-1,d.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(d).replace(/[\d\+]/g,l)+c(l,d.callingCode.length)+" "+t:this.template=t}},{key:"getTemplateForFormat",value:function(t,d){var e=d.nationalSignificantNumber,n=d.international,r=d.nationalPrefix,a=d.complexPrefixBeforeNationalSignificantNumber,i=t.pattern();i=i.replace(_(),"\\d").replace(U(),"\\d");var $=B.match(i)[0];if(!(e.length>$.length)){var o=new RegExp("^"+i+"$"),u=e.replace(/\d/g,"9");o.test(u)&&($=u);var s,f=this.getFormatFormat(t,n);if(this.shouldTryNationalPrefixFormattingRule(t,{international:n,nationalPrefix:r})){var h=f.replace(b._,t.nationalPrefixFormattingRule());if(p(t.nationalPrefixFormattingRule())===(r||"")+p("$1")&&(f=h,s=!0,r))for(var g=r.length;g>0;)f=f.replace(/\d/,l),g--}var m=$.replace(new RegExp(i),f).replace(new RegExp("9","g"),l);return s||(a?m=c(l,a.length)+" "+m:r&&(m=c(l,r.length)+this.getSeparatorAfterNationalPrefix(t)+m)),n&&(m=(0,D.A)(m)),m}}},{key:"formatNextNationalNumberDigits",value:function(t){var d=function(t,d,e){for(var n,r=o(e.split(""));!(n=r()).done;){var a=n.value;if(t.slice(d+1).search(s)<0)return;d=t.search(s),t=t.replace(s,a)}return[t,d]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,t);if(d)return this.populatedNationalNumberTemplate=d[0],this.populatedNationalNumberTemplatePosition=d[1],f(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(t,d){var e=d.international,n=d.nationalPrefix;if(t.nationalPrefixFormattingRule()){var r=t.usesNationalPrefix();if(r&&n||!r&&!e)return!0}}}])&&G(d.prototype,e),n&&G(d,n),Object.defineProperty(d,"prototype",{writable:!1}),t}(),H=new RegExp("(["+k.OA+"])");function V(t,d,e,n){if(d){var a=new r.Ay(n);a.selectNumberingPlan(d,e);var i=new RegExp(a.IDDPrefix());if(0===t.search(i)){var $=(t=t.slice(t.match(i)[0].length)).match(H);if(!($&&null!=$[1]&&$[1].length>0&&"0"===$[1]))return t}}}var Z=e(2700);function Y(t,d){if(t&&d.numberingPlan.nationalPrefixForParsing()){var e=new RegExp("^(?:"+d.numberingPlan.nationalPrefixForParsing()+")"),n=e.exec(t);if(n){var r,a,i,$=n.length-1,o=$>0&&n[$];if(d.nationalPrefixTransformRule()&&o)r=t.replace(e,d.nationalPrefixTransformRule()),$>1&&(a=n[1]);else{var u=n[0];r=t.slice(u.length),o&&(a=n[1])}if(o){var l=t.indexOf(n[1]);t.slice(0,l)===d.numberingPlan.nationalPrefix()&&(i=d.numberingPlan.nationalPrefix())}else i=n[0];return{nationalNumber:r,nationalPrefix:i,carrierCode:a}}}return{nationalNumber:t}}function J(t,d){var e=Y(t,d),n=e.carrierCode,r=e.nationalNumber;if(r!==t){if(!function(t,d,e){if((0,Z.A)(t,e.nationalNumberPattern())&&!(0,Z.A)(d,e.nationalNumberPattern()))return!1;return!0}(t,r,d))return{nationalNumber:t};if(d.possibleLengths()&&!function(t,d){switch((0,h.A)(t,d)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(r,d))return{nationalNumber:t}}return{nationalNumber:r,carrierCode:n}}function X(t,d,e,n){var a=d?(0,r.Ko)(d,n):e;if(0===t.indexOf(a)){(n=new r.Ay(n)).selectNumberingPlan(d,e);var i=t.slice(a.length),$=J(i,n).nationalNumber,o=J(t,n).nationalNumber;if(!(0,Z.A)(o,n.nationalNumberPattern())&&(0,Z.A)($,n.nationalNumberPattern())||"TOO_LONG"===(0,h.A)(o,n))return{countryCallingCode:a,number:i}}return{number:t}}function Q(t,d){return function(t){if(Array.isArray(t))return t}(t)||function(t,d){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==e)return;var n,r,a=[],i=!0,$=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(a.push(n.value),!d||a.length!==d);i=!0);}catch(t){$=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if($)throw r}}return a}(t,d)||function(t,d){if(!t)return;if("string"==typeof t)return q(t,d);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return q(t,d)}(t,d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(t,d){(null==d||d>t.length)&&(d=t.length);for(var e=0,n=new Array(d);e<d;e++)n[e]=t[e];return n}function z(t,d){for(var e=0;e<d.length;e++){var n=d[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var tt="["+k.uD+k.OA+"]+",dt=new RegExp("^"+tt+"$","i"),et="(?:["+k.tz+"]["+k.uD+k.OA+"]*|["+k.uD+k.OA+"]+)",nt=new RegExp("[^"+k.uD+k.OA+"]+.*$"),rt=/[^\d\[\]]/,at=function(){function t(d){var e=d.defaultCountry,n=d.defaultCallingCode,r=d.metadata,a=d.onNationalSignificantNumberChange;!function(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}(this,t),this.defaultCountry=e,this.defaultCallingCode=n,this.metadata=r,this.onNationalSignificantNumberChange=a}var d,e,n;return d=t,(e=[{key:"input",value:function(t,d){var e,n=function(t){var d=function(t){var d=function(t){var d,e=t.search(et);if(!(e<0))return"+"===(t=t.slice(e))[0]&&(d=!0,t=t.slice(1)),t=t.replace(nt,""),d&&(t="+"+t),t}(t)||"";return"+"===d[0]?[d.slice(1),!0]:[d]}(t),e=Q(d,2),n=e[0],r=e[1];return dt.test(n)||(n=""),[n,r]}(t),r=Q(n,2),a=r[0],i=r[1],$=p(a);return i&&(d.digits||(d.startInternationalNumber(),$||(e=!0))),$&&this.inputDigits($,d),{digits:$,justLeadingPlus:e}}},{key:"inputDigits",value:function(t,d){var e=d.digits,n=e.length<3&&e.length+t.length>=3;if(d.appendDigits(t),n&&this.extractIddPrefix(d),this.isWaitingForCountryCallingCode(d)){if(!this.extractCountryCallingCode(d))return}else d.appendNationalSignificantNumberDigits(t);d.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(d.getNationalDigits(),(function(t){return d.update(t)}))}},{key:"isWaitingForCountryCallingCode",value:function(t){var d=t.international,e=t.callingCode;return d&&!e}},{key:"extractCountryCallingCode",value:function(t){var d=function(t,d,e,n){if(!t)return{};var a;if("+"!==t[0]){var i=V(t,d,e,n);if(!i||i===t){if(d||e){var $=X(t,d,e,n),o=$.countryCallingCode,u=$.number;if(o)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:o,number:u}}return{number:t}}a=!0,t="+"+i}if("0"===t[1])return{};n=new r.Ay(n);for(var l=2;l-1<=k.Jq&&l<=t.length;){var s=t.slice(1,l);if(n.hasCallingCode(s))return n.selectNumberingPlan(s),{countryCallingCodeSource:a?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:s,number:t.slice(l)};l++}return{}}("+"+t.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),e=d.countryCallingCode,n=d.number;if(e)return t.setCallingCode(e),t.update({nationalSignificantNumber:n}),!0}},{key:"reset",value:function(t){if(t){this.hasSelectedNumberingPlan=!0;var d=t._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=d&&rt.test(d)}els