!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"),require("country-codes-list"),require("country-flags-svg"),require("libphonenumber-js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js","country-codes-list","country-flags-svg","libphonenumber-js"],t);else{var o="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"),require("country-codes-list"),require("country-flags-svg"),require("libphonenumber-js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/repeat.js"],e["country-codes-list"],e["country-flags-svg"],e["libphonenumber-js"]);for(var i in o)("object"==typeof exports?exports:e)[i]=o[i]}}(self,(e,t,o,i,r,s,a,l,n,d,p,u)=>(()=>{"use strict";var c,h={6709(e,t,o){o(2273);var i,r=o(9609),s=o(4084),a=o(3060),l=o(5875),n=o(7161),d=o(429),p=o(5125),u=o(8175),c=o(8373),h=function(e,t,o,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,o,a):r(t,o))||a);return s>3&&a&&Object.defineProperty(t,o,a),a};!function(e){let t=class extends n.LitElement{constructor(){super(...arguments),this.codePlaceholder="+1",this.countryCallingCode="",this.showFlags=!1,this.pill=!1,this.disabled=!1,this.ariaLabel="",this.clearAriaLabel="Clear Country Code",this.id="",this.newMomentum=!1,this.isDropdownArrow=!0,this.countryCode="US",this.codeList=[]}connectedCallback(){super.connectedCallback(),this.codeList=(0,a.customArray)({name:"{countryNameEn}",value:"{countryCallingCode}",code:"{countryCode}"}),""===this.id&&(this.id=`md-country-code-picker-${Math.random().toString(36).substring(2,6)}`)}getCountryFlag(e){return n.html`
        <span class="flag-svg-wrapper">
          <img src="${(0,l.findFlagUrlByIso2Code)(e)}" />
        </span>
      `}countryCodeOptionTemplate(e,t){return n.html`
        <div
          part="option"
          class="md-country-code-picker__option"
          display-value="+${e.value}"
          slot=${t}
          aria-label="+${e.value}, ${e.name}, ${e.code}"
        >
          ${this.showFlags?this.getCountryFlag(e.code):n.nothing}
          <span>${e.name}</span>
          <span>+${e.value}</span>
        </div>
      `}handleCountryChange(e){var t,o;e.detail.value&&(null===(t=e.detail.value)||void 0===t?void 0:t.id)?(this.countryCallingCode=e.detail.value.id,this.countryCode=null===(o=e.detail.value.id.split(",")[2])||void 0===o?void 0:o.trim()):(this.countryCode="US",this.countryCallingCode=""),this.dispatchEvent(new CustomEvent("country-code-changed",{bubbles:!0,composed:!0,detail:{srcEvent:e}}))}get flagClassMap(){return{"new-momentum":this.newMomentum}}get containerClassMap(){return{"md-country-code-picker__container":!0,"show-flags":this.showFlags}}getFormatedCountryCallingCode(){var e;return{id:this.countryCallingCode,value:null===(e=this.countryCallingCode.split(",")[0])||void 0===e?void 0:e.trim()}}static get styles(){return[s.A,c.A]}get sortedCodeList(){return[...this.codeList].sort((e,t)=>e.name.localeCompare(t.name))}render(){return n.html`
        <div class="${(0,p.classMap)(this.containerClassMap)}">
          ${this.showFlags?n.html`
                <span class="flag-box ${(0,p.classMap)(this.flagClassMap)}">${this.getCountryFlag(this.countryCode)}</span>
              `:n.nothing}
          <md-combobox
            part="combobox"
            exportparts="group: combobox-group, combobox-options: options-container"
            ?disabled=${this.disabled}
            shape="${this.pill?"pill":"none"}"
            ariaLabel=${this.ariaLabel}
            placeholder="${this.codePlaceholder}"
            .value="${this.countryCallingCode?[this.getFormatedCountryCallingCode()]:[]}"
            @change-selected=${e=>this.handleCountryChange(e)}
            with-custom-content
            ?newMomentum=${this.newMomentum}
            ?is-dropdown-arrow=${this.isDropdownArrow}
            .clearAriaLabel="${this.clearAriaLabel}"
          >
            ${(0,u.repeat)(this.sortedCodeList,e=>e.name,(e,t)=>this.countryCodeOptionTemplate(e,t))}
          </md-combobox>
        </div>
      `}};h([(0,d.property)({type:String,reflect:!0})],t.prototype,"codePlaceholder",void 0),h([(0,d.property)({type:String,attribute:"country-calling-code"})],t.prototype,"countryCallingCode",void 0),h([(0,d.property)({type:Boolean,attribute:"show-flags"})],t.prototype,"showFlags",void 0),h([(0,d.property)({type:Boolean})],t.prototype,"pill",void 0),h([(0,d.property)({type:Boolean})],t.prototype,"disabled",void 0),h([(0,d.property)({type:String})],t.prototype,"ariaLabel",void 0),h([(0,d.property)({type:String})],t.prototype,"clearAriaLabel",void 0),h([(0,d.property)({type:String})],t.prototype,"id",void 0),h([(0,d.property)({type:Boolean})],t.prototype,"newMomentum",void 0),h([(0,d.property)({type:Boolean})],t.prototype,"isDropdownArrow",void 0),h([(0,d.state)()],t.prototype,"countryCode",void 0),h([(0,d.state)()],t.prototype,"codeList",void 0),h([(0,d.query)("md-combobox")],t.prototype,"combobox",void 0),t=h([(0,r.w)("md-country-code-picker")],t),e.ELEMENT=t}(i||(i={}))},5566(e,t,o){o.r(t),o.d(t,{PhoneInput:()=>i}),o(2273),o(6709),o(9189);var i,r=o(9609),s=o(860),a=o(7161),l=o(429),n=o(5125),d=o(6429),p=function(e,t,o,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(s<3?r(a):s>3?r(t,o,a):r(t,o))||a);return s>3&&a&&Object.defineProperty(t,o,a),a};!function(e){let t=class extends a.LitElement{constructor(){super(...arguments),this.codePlaceholder="+1",this.numberPlaceholder="Enter Phone Number",this.countryCallingCode="",this.showFlags=!1,this.pill=!1,this.disabled=!1,this.value="",this.errorMessage="",this.showErrorMessage=!1,this.countryCodeAriaLabel="",this.dialNumberAriaLabel="",this.clearAriaLabel="Clear Input",this.clearCountryCodeAriaLabel="Clear Country Code",this.id="",this.newMomentum=!1,this.countryCode="US",this.formattedValue="",this.isValid=!0}get isRtl(){try{if(!this.isConnected)return!1;const e=getComputedStyle(this);return"rtl"===(null==e?void 0:e.direction)}catch(e){return!1}}connectedCallback(){super.connectedCallback(),""===this.id&&(this.id=`md-phone-input-${Math.random().toString(36).substring(2,6)}`),this.validateInput(this.value)}validateNumber(){this.isValid=!this.value||(0,s.isValidNumberForRegion)(this.value,this.countryCode)}handleCountryChange(e){var t,o;const i=e.detail.srcEvent;i.detail.value&&(null===(t=i.detail.value)||void 0===t?void 0:t.id)?(this.countryCallingCode=i.detail.value.id,this.countryCode=null===(o=i.detail.value.id.split(",")[2])||void 0===o?void 0:o.trim()):(this.countryCode="US",this.countryCallingCode=""),this.validateNumber(),this.dispatchEvent(new CustomEvent("countrycode-change",{bubbles:!0,composed:!0,detail:{srcEvent:i,isValid:this.isValid}}))}handlePhoneChange(e){this.value=e.detail.value,e.stopPropagation(),this.dispatchEvent(new CustomEvent("phoneinput-change",{bubbles:!0,composed:!0,detail:{srcEvent:e,value:`${this.countryCallingCode}${this.value}`,isValid:this.isValid,phoneNumber:this.value}}))}handleKeydown(e){this.isValid=!0,e.stopPropagation(),this.dispatchEvent(new CustomEvent("phoneinput-keydown",{bubbles:!0,composed:!0,detail:{srcEvent:e,value:`${this.countryCallingCode}${this.value}`,isValid:this.isValid,phoneNumber:this.value}}))}handleBlur(e){this.validateInput(this.value),this.validateNumber(),e.stopPropagation(),this.removeCountryCode(),this.dispatchEvent(new CustomEvent("phoneinput-blur",{bubbles:!0,composed:!0,detail:{srcEvent:e,value:`${this.countryCallingCode}${this.value}`,isValid:this.isValid,phoneNumber:this.value}}))}removeCountryCode(){var e;const t=null===(e=this.countryCallingCode.split(",")[0])||void 0===e?void 0:e.trim();if(this.value.startsWith(t)){const e=this.value.slice(t.length).replace(/^-/,"");this.value=e}}validateInput(e){this.formattedValue=new s.AsYouType(this.countryCode).input(e)}get flagClassMap(){return{"new-momentum":this.newMomentum}}get containerClassMap(){return{"md-phone-input__container":!0,rtl:this.isRtl}}static get styles(){return[d.A]}render(){return a.html`
        <div class=${(0,n.classMap)(this.containerClassMap)}>
          <md-country-code-picker
            part="md-country-code-picker"
            exportparts="option: option"
            ?disabled=${this.disabled}
            ?pill=${this.pill}
            ?show-flags=${this.showFlags}
            ariaLabel=${this.countryCodeAriaLabel}
            codePlaceholder="${this.codePlaceholder}"
            .countryCallingCode="${this.countryCallingCode}"
            @country-code-changed=${e=>this.handleCountryChange(e)}
            ?newMomentum=${this.newMomentum}
            ?isDropdownArrow=${!0}
            .clearAriaLabel="${this.clearCountryCodeAriaLabel}"
          ></md-country-code-picker>

          <md-input
            part="md-input"
            ?disabled=${this.disabled}
            placeholder=${this.numberPlaceholder}
            .ariaInvalid=${this.isValid?"false":"true"}
            .ariaLabel=${`${this.dialNumberAriaLabel}`}
            @input-change=${e=>this.handlePhoneChange(e)}
            @input-blur=${e=>this.handleBlur(e)}
            @input-keydown=${e=>this.handleKeydown(e)}
            shape="${this.pill?"pill":"none"}"
            .ariaControls=${this.id}
            clear
            ?newMomentum=${this.newMomentum}
            clearAriaLabel="${this.clearAriaLabel}"
            type="tel"
            value="${this.formattedValue}"
            .messageArr="${!this.isValid||this.showErrorMessage?[{type:"error",id:this.id,ariaLive:"polite",message:this.errorMessage}]:[]}"
          ></md-input>
        </div>
      `}};p([(0,l.property)({type:String,reflect:!0})],t.prototype,"codePlaceholder",void 0),p([(0,l.property)({type:String})],t.prototype,"numberPlaceholder",void 0),p([(0,l.property)({type:String,attribute:"country-calling-code"})],t.prototype,"countryCallingCode",void 0),p([(0,l.property)({type:Boolean,attribute:"show-flags"})],t.prototype,"showFlags",void 0),p([(0,l.property)({type:Boolean})],t.prototype,"pill",void 0),p([(0,l.property)({type:Boolean})],t.prototype,"disabled",void 0),p([(0,l.property)({type:String})],t.prototype,"value",void 0),p([(0,l.property)({type:String})],t.prototype,"errorMessage",void 0),p([(0,l.property)({type:Boolean})],t.prototype,"showErrorMessage",void 0),p([(0,l.property)({type:String})],t.prototype,"countryCodeAriaLabel",void 0),p([(0,l.property)({type:String})],t.prototype,"dialNumberAriaLabel",void 0),p([(0,l.property)({type:String})],t.prototype,"clearAriaLabel",void 0),p([(0,l.property)({type:String})],t.prototype,"clearCountryCodeAriaLabel",void 0),p([(0,l.property)({type:String})],t.prototype,"id",void 0),p([(0,l.property)({type:Boolean})],t.prototype,"newMomentum",void 0),p([(0,l.state)()],t.prototype,"countryCode",void 0),p([(0,l.state)()],t.prototype,"formattedValue",void 0),p([(0,l.state)()],t.prototype,"isValid",void 0),t=p([(0,r.w)("md-phone-input")],t),e.ELEMENT=t}(i||(i={}))},2022(e){e.exports=s},554(e){e.exports=a},3060(e){e.exports=d},5875(e){e.exports=p},860(e){e.exports=u},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=o},291(e){e.exports=r},8175(e){e.exports=n},318(e){e.exports=i},5314(e){e.exports=l}},y={};function m(e){var t=y[e];if(void 0!==t)return t.exports;var o=y[e]={exports:{}};return h[e].call(o.exports,o,o.exports,m),o.exports}m.m=h,c=[],m.O=(e,t,o,i)=>{if(!t){var r=1/0;for(n=0;n<c.length;n++){for(var[t,o,i]=c[n],s=!0,a=0;a<t.length;a++)(!1&i||r>=i)&&Object.keys(m.O).every(e=>m.O[e](t[a]))?t.splice(a--,1):(s=!1,i<r&&(r=i));if(s){c.splice(n--,1);var l=o();void 0!==l&&(e=l)}}return e}i=i||0;for(var n=c.length;n>0&&c[n-1][2]>i;n--)c[n]=c[n-1];c[n]=[t,o,i]},m.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return m.d(t,{a:t}),t},m.d=(e,t)=>{for(var o in t)m.o(t,o)&&!m.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},m.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={445:0,6753:0};m.O.j=t=>0===e[t];var t=(t,o)=>{var i,r,[s,a,l]=o,n=0;if(s.some(t=>0!==e[t])){for(i in a)m.o(a,i)&&(m.m[i]=a[i]);if(l)var d=l(m)}for(t&&t(o);n<s.length;n++)r=s[n],m.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return m.O(d)},o=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var v=m.O(void 0,[7103,9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5201,5584,8227,7704,2797,3970,7906,9336,2369,9189,4047,4431,8138,2273,8373,6429],()=>m(5566));return m.O(v)})());