export const __webpack_esm_id__=6709;export const __webpack_esm_ids__=[6709];export const __webpack_esm_modules__={6709(t,e,o){o.d(e,{Y:()=>r}),o(2273);var r,a=o(9609),i=o(4084),n=o(526),s=o(457),l=o(2927),d=o(8899),p=o(4955),c=o(2577),u=o(8373),h=function(t,e,o,r){var a,i=arguments.length,n=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(n=(i<3?a(n):i>3?a(e,o,n):a(e,o))||n);return i>3&&n&&Object.defineProperty(e,o,n),n};!function(t){let e=class extends l.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,n.customArray)({name:"{countryNameEn}",value:"{countryCallingCode}",code:"{countryCode}"}),""===this.id&&(this.id=`md-country-code-picker-${Math.random().toString(36).substring(2,6)}`)}getCountryFlag(t){return l.html`
        <span class="flag-svg-wrapper">
          <img src="${(0,s.findFlagUrlByIso2Code)(t)}" />
        </span>
      `}countryCodeOptionTemplate(t,e){return l.html`
        <div
          part="option"
          class="md-country-code-picker__option"
          display-value="+${t.value}"
          slot=${e}
          aria-label="+${t.value}, ${t.name}, ${t.code}"
        >
          ${this.showFlags?this.getCountryFlag(t.code):l.nothing}
          <span>${t.name}</span>
          <span>+${t.value}</span>
        </div>
      `}handleCountryChange(t){var e,o;t.detail.value&&(null===(e=t.detail.value)||void 0===e?void 0:e.id)?(this.countryCallingCode=t.detail.value.id,this.countryCode=null===(o=t.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:t}}))}get flagClassMap(){return{"new-momentum":this.newMomentum}}get containerClassMap(){return{"md-country-code-picker__container":!0,"show-flags":this.showFlags}}getFormatedCountryCallingCode(){var t;return{id:this.countryCallingCode,value:null===(t=this.countryCallingCode.split(",")[0])||void 0===t?void 0:t.trim()}}static get styles(){return[i.A,u.A]}get sortedCodeList(){return[...this.codeList].sort((t,e)=>t.name.localeCompare(e.name))}render(){return l.html`
        <div class="${(0,p.classMap)(this.containerClassMap)}">
          ${this.showFlags?l.html`
                <span class="flag-box ${(0,p.classMap)(this.flagClassMap)}">${this.getCountryFlag(this.countryCode)}</span>
              `:l.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=${t=>this.handleCountryChange(t)}
            with-custom-content
            ?newMomentum=${this.newMomentum}
            ?is-dropdown-arrow=${this.isDropdownArrow}
            .clearAriaLabel="${this.clearAriaLabel}"
          >
            ${(0,c.repeat)(this.sortedCodeList,t=>t.name,(t,e)=>this.countryCodeOptionTemplate(t,e))}
          </md-combobox>
        </div>
      `}};h([(0,d.property)({type:String,reflect:!0})],e.prototype,"codePlaceholder",void 0),h([(0,d.property)({type:String,attribute:"country-calling-code"})],e.prototype,"countryCallingCode",void 0),h([(0,d.property)({type:Boolean,attribute:"show-flags"})],e.prototype,"showFlags",void 0),h([(0,d.property)({type:Boolean})],e.prototype,"pill",void 0),h([(0,d.property)({type:Boolean})],e.prototype,"disabled",void 0),h([(0,d.property)({type:String})],e.prototype,"ariaLabel",void 0),h([(0,d.property)({type:String})],e.prototype,"clearAriaLabel",void 0),h([(0,d.property)({type:String})],e.prototype,"id",void 0),h([(0,d.property)({type:Boolean})],e.prototype,"newMomentum",void 0),h([(0,d.property)({type:Boolean})],e.prototype,"isDropdownArrow",void 0),h([(0,d.state)()],e.prototype,"countryCode",void 0),h([(0,d.state)()],e.prototype,"codeList",void 0),h([(0,d.query)("md-combobox")],e.prototype,"combobox",void 0),e=h([(0,a.w)("md-country-code-picker")],e),t.ELEMENT=e}(r||(r={}))}};