@descope/web-components-ui 1.0.281 → 1.0.283

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/README.md +1 -0
  2. package/dist/cjs/index.cjs.js +1081 -935
  3. package/dist/cjs/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +1074 -931
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/1621.js +1 -1
  7. package/dist/umd/{3280.js → 2106.js} +5 -129
  8. package/dist/umd/{3280.js.LICENSE.txt → 2106.js.LICENSE.txt} +0 -6
  9. package/dist/umd/2775.js +240 -0
  10. package/dist/umd/2775.js.LICENSE.txt +17 -0
  11. package/dist/umd/3003.js +1 -1
  12. package/dist/umd/3249.js +2 -0
  13. package/dist/umd/3249.js.LICENSE.txt +5 -0
  14. package/dist/umd/3373.js +2 -0
  15. package/dist/umd/3373.js.LICENSE.txt +5 -0
  16. package/dist/umd/4946.js +2 -0
  17. package/dist/umd/4946.js.LICENSE.txt +5 -0
  18. package/dist/umd/6091.js +2 -1
  19. package/dist/umd/6606.js +17 -0
  20. package/dist/umd/7531.js +1 -1
  21. package/dist/umd/9383.js +94 -0
  22. package/dist/umd/descope-avatar-index-js.js +1 -0
  23. package/dist/umd/descope-grid-index-js.js +1 -1
  24. package/dist/umd/index.js +1 -1
  25. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +126 -1
  26. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.LICENSE.txt +5 -0
  27. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  28. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  29. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
  30. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  31. package/package.json +2 -1
  32. package/src/components/descope-avatar/AvatarClass.js +102 -0
  33. package/src/components/descope-avatar/index.js +8 -0
  34. package/src/index.cjs.js +1 -0
  35. package/src/index.js +1 -0
  36. package/src/theme/components/avatar.js +40 -0
  37. package/src/theme/components/index.js +2 -0
  38. package/dist/umd/3660.js +0 -17
  39. package/dist/umd/5345.js +0 -94
  40. package/dist/umd/7262.js +0 -1
  41. /package/dist/umd/{3660.js.LICENSE.txt → 6606.js.LICENSE.txt} +0 -0
  42. /package/dist/umd/{5345.js.LICENSE.txt → 9383.js.LICENSE.txt} +0 -0
@@ -1 +1,126 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9299,9662,9483,2934,2528,3172,5130,4201,3878,4447],{3878:(t,e,r)=>{r.d(e,{P:()=>a});var n=r(2061),i=r(1e3),o=r(2561);const a=(...t)=>(0,n.qC)(i.wX,i.li,i.QT,i.mE)((0,o.s)(...t))},9690:(t,e,r)=>{r.d(e,{n:()=>p,f:()=>a});var n=r(2061),i=r(4567),o=r(1e3);const a=(0,i.iY)("button"),{host:s,label:l}={host:{selector:()=>":host"},label:{selector:"::part(label)"}};let d;const p=(0,n.qC)((0,o.yk)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...s,property:"direction"},fontSize:{},fontFamily:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],labelTextColor:{property:"color"},labelTextDecoration:{...l,property:"text-decoration"},labelSpacing:{...l,property:"gap"},textAlign:{...l,property:"justify-content",fallback:"center"}}}),(t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}),o.e4,o.Ae)((0,o.DM)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${d}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${p.cssVarList.outlineWidth}) + var(${p.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${p.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${p.cssVarList.hostHeight}) - var(${p.cssVarList.outlineWidth}) - var(${p.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${p.cssVarList.hostWidth}) - var(${p.cssVarList.outlineWidth}) - var(${p.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:a})),{color:u,fontSize:c}=p.cssVarList;d=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${u});\n\t\ttop: calc(50% - (var(${c}) / 2));\n\t\tleft: calc(50% - (var(${c}) / 2));\n\t\tborder-width: calc(var(${c}) / 10);\n\t\twidth: var(${c});\n\t\theight: var(${c});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"])::part(prefix),\n\t:host([loading="true"])::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},2018:(t,e,r)=>{r.r(e),r.d(e,{ButtonClass:()=>n.n}),r(1721);var n=r(9690);customElements.define(n.f,n.n)},4049:(t,e,r)=>{r.d(e,{H:()=>y,f:()=>s});var n=r(2061),i=r(4567),o=r(4201),a=r(1e3);const s=(0,i.iY)("combo-box"),{host:l,inputField:d,inputElement:p,placeholder:u,toggle:c,clearButton:h,label:b,requiredIndicator:m,helperText:g,errorMessage:v}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},y=(0,n.qC)((0,a.yk)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[b,u,d,g,v],labelTextColor:[{...b,property:"color"},{...m,property:"color"}],errorMessageTextColor:{...v,property:"color"},inputHeight:{...d,property:"height"},inputBackgroundColor:{...d,property:"background-color"},inputBorderColor:{...d,property:"border-color"},inputBorderWidth:{...d,property:"border-width"},inputBorderStyle:{...d,property:"border-style"},inputBorderRadius:{...d,property:"border-radius"},labelRequiredIndicator:{...m,property:"content"},inputValueTextColor:{...d,property:"color"},inputPlaceholderTextColor:{...u,property:"color"},inputDropdownButtonCursor:[{...c,property:"cursor"},{...h,property:"cursor"}],inputDropdownButtonColor:[{...c,property:"color"},{...h,property:"color"}],inputDropdownButtonSize:[{...c,property:"font-size"},{...h,property:"font-size"}],inputDropdownButtonOffset:[{...c,property:"margin-right"},{...c,property:"margin-left"}],inputOutlineColor:{...d,property:"outline-color"},inputOutlineWidth:{...d,property:"outline-width"},inputOutlineStyle:{...d,property:"outline-style"},inputOutlineOffset:{...d,property:"outline-offset"},inputHorizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],overlayBackground:{property:()=>y.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>y.cssVarList.overlay.textColor},overlayBorder:{property:()=>y.cssVarList.overlay.border},overlayFontSize:{property:()=>y.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>y.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>y.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>y.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>y.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>y.cssVarList.overlay.itemPaddingInlineEnd}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,a.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.Ae,(t=>class extends t{#t=({displayName:t,value:e,label:r})=>`<span data-name="${r}" data-id="${e}">${t||r}</span>`;#e;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#t}set renderItem(t){this.#t=t,this.renderItems()}get data(){if(this.#e)return this.#e;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#e=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}handleSelectedItem(){const t=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,t&&(this.value=t),this.value||this.setDefaultValue()}customValueTransformFn(t){return t}setComboBoxDescriptor(){const t=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),e=this;Object.defineProperties(this.inputElement,{value:{...t,set(r){if(!e.baseElement.items?.length)return;const n=e.customValueTransformFn(r)||"";n!==this.value&&t.set.call(this,n)}}})}#r(){const t=this.shadowRoot.querySelector(this.baseSelector),e=Array.from(this.children);e.length&&(e.forEach((t=>{Object.defineProperty(t,"data-name",{value:t.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id"),configurable:!0,writable:!0})})),t.items=e,setTimeout((()=>{this.handleSelectedItem()}),0)),t.renderer=(t,e,r)=>{t.innerHTML=r.item.outerHTML}}#n(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=()=>{t.bringToFront()},t._detachOverlay=()=>{},t._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#n(),this.renderItems(),(0,i.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,i.P$)(this,this.#r.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}setDefaultValue(){this.value=this.defaultValue}set value(t){if(t){const e=this.baseElement.items?.find((e=>e["data-id"]===t));e&&(this.baseElement.selectedItem=e)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((0,a.DM)({slots:["","prefix"],wrappedEleName:"vaadin-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,o.bi)(y.cssVarList)}\n\t\t${(0,o.PH)("vaadin-combo-box")}\n\t\t${(0,o.jI)("vaadin-combo-box")}\n\t\t${(0,o.Pd)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,o.Wf)("vaadin-combo-box")}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))},1294:(t,e,r)=>{r.r(e),r.d(e,{ComboBoxClass:()=>n.H}),r(7583);var n=r(4049);customElements.define(n.f,n.H)},6417:(t,e,r)=>{r.d(e,{f:()=>l,z:()=>p});var n=r(1e3),i=r(4447),o=r(2061),a=r(4567),s=r(4201);const l=(0,a.iY)("text-field"),d=["type"],p=(0,o.qC)((0,n.yk)({mappings:i.Z}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"]}),n.Ae,(t=>class extends t{static get observedAttributes(){return d.concat(t.observedAttributes||[])}attributeChangedCallback(t,e,r){super.attributeChangeCallback?.(t,e,r),"type"===t&&this.baseElement._setType(r)}}))((0,n.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${p.cssVarList.inputOutlineWidth}) + var(${p.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,s.Wf)("vaadin-text-field")}\n\t\t\t${(0,s.bi)(p.cssVarList)}\n\t\t\t${(0,s.wm)("vaadin-text-field",p.cssVarList)}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},9357:(t,e,r)=>{r.r(e),r.d(e,{TextFieldClass:()=>n.z}),r(9789);var n=r(6417);customElements.define(n.f,n.z)},4447:(t,e,r)=>{r.d(e,{Z:()=>h});const{host:n,label:i,placeholder:o,requiredIndicator:a,inputField:s,input:l,helperText:d,errorMessage:p,disabledPlaceholder:u,inputDisabled:c}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:{selector:"> input:placeholder-shown"},disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},h={fontSize:[{},n],fontFamily:[i,s,d,p],hostWidth:{...n,property:"width"},hostMinWidth:{...n,property:"min-width"},hostDirection:{...n,property:"direction"},inputBackgroundColor:{...s,property:"background-color"},labelTextColor:[{...i,property:"color"},{...a,property:"color"},{...i,property:"-webkit-text-fill-color"},{...a,property:"-webkit-text-fill-color"}],errorMessageTextColor:{...p,property:"color"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...s,property:"color"},{...c,property:"-webkit-text-fill-color"}],inputCaretTextColor:{...l,property:"color"},labelRequiredIndicator:{...a,property:"content"},inputBorderColor:{...s,property:"border-color"},inputBorderWidth:{...s,property:"border-width"},inputBorderStyle:{...s,property:"border-style"},inputBorderRadius:{...s,property:"border-radius"},inputHeight:{...s,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"}],inputOutlineColor:{...s,property:"outline-color"},inputOutlineStyle:{...s,property:"outline-style"},inputOutlineWidth:{...s,property:"outline-width"},inputOutlineOffset:{...s,property:"outline-offset"},inputTextAlign:{...l,property:"text-align"},inputPlaceholderColor:[{...o,property:"color"},{...u,property:"-webkit-text-fill-color"}]}},2138:(t,e,r)=>{r.d(e,{f:()=>s,k:()=>d});var n=r(1e3),i=r(2561),o=r(2061),a=r(4567);const s=(0,a.iY)("text");class l extends((0,i.s)({componentName:s,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\t:host > slot {\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t\t"}}const d=(0,o.qC)((0,n.yk)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:{property:"color"},textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.e4,n.Ae,(t=>class extends t{get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,a.P$)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}))(l)},1876:(t,e,r)=>{r.r(e),r.d(e,{TextClass:()=>n.k});var n=r(2138);customElements.define(n.f,n.k)},6751:(t,e,r)=>{r.r(e);var n=r(3878),i=r(4567);const o=(0,i.iY)("mapping-item"),a=["size","bordered","readonly","full-width","disabled"],s=(0,n.P)({componentName:o,baseSelector:"div"});customElements.define(o,class extends s{static get observedAttributes(){return[].concat(s.observedAttributes||[],a,["separator","options","invalid","disabled"])}get separator(){return this.getAttribute("separator")||"map to"}get value(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{[t]:e}:null}set value(t){if(1!==Object.entries(t).length)return void console.error("descope-mapping item expected expects only one key-value pair in the value but received: ",t);const[e,r]=Object.entries(t)[0];this.valueInput.value=r,this.attributeInput.value=e,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n .wrapper {\n display: flex;\n }\n .separator {\n text-align: center;\n flex-shrink: 0;\n }\n </style>\n <div class="wrapper" part="wrapper">\n <descope-text-field required="true"></descope-text-field>\n <div class="separator" part="separator">${this.separator}</div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n required="true"\n >\n </descope-combo-box>\n <descope-button variant="link" mode="primary">\n <vaadin-icon icon="vaadin:minus"></vaadin-icon>\n </descope-button>\n </div>\n\t`,this.valueInput=this.shadowRoot.querySelector("descope-text-field"),this.attributeInput=this.shadowRoot.querySelector("descope-combo-box"),this.inputs=[this.valueInput,this.attributeInput],this.removeButton=this.shadowRoot.querySelector("descope-button"),(0,i.oP)(this,this.valueInput,{includeAttrs:a}),(0,i.oP)(this,this.attributeInput,{includeAttrs:[...a,"options"],mapAttrs:{options:"data"}}),(0,i.oP)(this,this.removeButton,{includeAttrs:["disabled"]})}initRemoveButton(){this.removeButton.addEventListener("click",(()=>this.dispatchEvent(new CustomEvent("mapping-item-removed"))))}init(){super.init?.(),this.initRemoveButton()}getValidity(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{}:{badInput:!0}}reportValidity(){this.inputs.forEach((t=>t.reportValidity()))}focus(){(this.checkValidity()||!this.valueInput.checkValidity()?this.valueInput:this.attributeInput).focus()}handleSeparatorChange(){this.shadowRoot.querySelector(".separator").textContent=this.separator}#i(t){"true"===t&&(this.valueInput.value||(this.valueInput.setAttribute("invalid","true"),this.valueInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)),this.attributeInput.value||(this.attributeInput.setAttribute("invalid","true"),this.attributeInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)))}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),"separator"===t&&this.handleSeparatorChange(),"invalid"===t&&this.#i(r)}})},7819:(t,e,r)=>{r.d(e,{Z:()=>s,f:()=>o});var n=r(3878),i=r(4567);const o=(0,i.iY)("mappings-field-internal"),a=(0,n.P)({componentName:o,baseSelector:"div"}),s=class extends a{#o;static get observedAttributes(){return[].concat(a.observedAttributes||[],["label-value","label-attr","button-label","invalid","readonly","disabled"])}isValidDataType(t){try{return t.every((t=>"object"==typeof t&&!Array.isArray(t)&&1===Object.getOwnPropertyNames(t).length&&"string"==typeof t[Object.keys(t)[0]]&&""!==t[Object.keys(t)[0]].trim()))}catch(t){return!1}}get labelValue(){return this.getAttribute("label-value")||"Value"}get labelAttr(){return this.getAttribute("label-attr")||"Attribute"}get buttonLabel(){return this.getAttribute("button-label")||"Add mapping"}get options(){return this.getAttribute("options")||[]}addNewMappingItem(){const t=document.createElement("descope-mapping-item");return t.setAttribute("bordered","true"),this.mappingsContainerEle.appendChild(t),(0,i.oP)(this,t,{includeAttrs:["size","full-width","separator","options","disabled"]}),setTimeout((()=>{this.setCustomValidity(""),t.addEventListener("mapping-item-removed",(e=>{t===this.#o&&(this.resetInvalidIndication(),this.#o=void 0),t.remove(),this.setCustomValidity(""),e.stopPropagation()}))}),0),t}get items(){return Array.from(this.mappingsContainerEle.querySelectorAll("descope-mapping-item"))}get value(){return this.items.reduce(((t,e)=>e.value?[...t,e.value]:t),[])}set value(t){if(!this.isValidDataType(t))return void console.error("received invalid value to set - should be an array of objects with one key-value pair");const e=this.items;if(e.length>t.length)for(let r=t.length;r<e.length;r++)this.mappingsContainerEle.removeChild(e[r]);t.forEach(((t,r)=>{const n=e[r];if(n)n.value=t;else{const e=this.addNewMappingItem();setTimeout((()=>{e.value=t}),0)}}))}constructor(){super(),this.innerHTML='\n <div class="labels-container" part="labels"></div>\n <div class="mappings-container"></div>\n <div class="button-container"></div>\n ',this.labelsEle=this.querySelector(".labels-container"),this.mappingsContainerEle=this.querySelector(".mappings-container"),this.buttonContainer=this.querySelector(".button-container")}initLabels(){this.labelsEle.innerHTML=`\n <descope-text variant="body2" part="value-label">${this.labelValue}</descope-text>\n <descope-text variant="body2" part="attr-label">${this.labelAttr}</descope-text>\n `}initAddButton(){this.buttonContainer.innerHTML=`\n <descope-button variant="link" mode="primary" disabled="${this.isDisabled}">\n <vaadin-icon icon="vaadin:plus"></vaadin-icon>\n ${this.buttonLabel}\n </descope-button>\n `;const t=this.querySelector("descope-button");t.onclick=()=>{this.addNewMappingItem()},(0,i.oP)(this,t,{includeAttrs:["disabled"]})}init(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.#o||this.items[0]||this.querySelector("descope-button")).focus()})),super.init?.(),this.initLabels(),this.initAddButton(),this.addEventListener("input",(()=>{this.mappingsContainerEle.contains(this.#o)&&this.#o?.checkValidity()&&(this.resetInvalidIndication(),this.#o.removeAttribute("invalid"),this.#o=void 0)}))}resetInvalidIndication(){this.removeAttribute("invalid")}getValidity(){const t=this.items.find((t=>!t.checkValidity()));return t?t.validity:{}}#a(t){t&&(this.#o=this.items.find((t=>!t.checkValidity())),this.#o?.reportValidity(),this.#o?.setAttribute("invalid","true"))}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),"label-value"!==t&&"label-attr"!==t||this.initLabels(),"button-label"===t&&this.initAddButton(),"invalid"===t&&this.#a("true"===r),"readonly"===t&&this.toggleAttribute("inert","true"===r)}}},3820:(t,e,r)=>{r.r(e);var n=r(7819);customElements.define(n.f,n.Z)},5894:(t,e,r)=>{r.r(e),r.d(e,{MappingsFieldClass:()=>f}),r(9381),r(7911),r(6594);var n=r(1e3),i=r(1876),o=r(2061),a=r(4567),s=r(7819);const l=(0,a.iY)("mappings-field"),d="80px",p="60px",{host:u,helperText:c,errorMessage:h,mappingItem:b,labels:m,valueLabel:g,attrLabel:v,separator:y}={host:{selector:()=>":host"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},mappingItem:{selector:"descope-mapping-item::part(wrapper)"},labels:{selector:'descope-mappings-field-internal [part="labels"] descope-text'},valueLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="value-label"]'},attrLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="attr-label"]'},separator:{selector:"descope-mapping-item::part(separator)"}},f=(0,o.qC)((0,n.yk)({mappings:{hostWidth:{...u,property:"width"},hostDirection:{...u,property:"direction"},fontSize:[{},u,{...y,property:"margin-top"}],fontFamily:[c,h,m],separatorFontSize:{...y,property:"font-size"},labelTextColor:{...m,property:i.TextClass.cssVarList.textColor},itemMarginBottom:{...b,property:"margin-bottom"},valueLabelMinWidth:{...g,property:"min-width"},attrLabelMinWidth:{...v,property:"min-width"}}}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"],inputEvent:"input",proxyParentValidation:!0}),n.Ae,(t=>class extends t{get defaultValues(){const t=this.getAttribute("default-values");if(t)try{return JSON.parse(t)}catch(t){console.error('could not parse data string from attribute "default-values" -',t.message)}return[]}setDefaultValues(){const t=this.defaultValues;Object.keys(t).length>0&&(this.inputElement.value=t)}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${s.f}\n tabindex="-1"\n ></${s.f}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(s.f),(0,a.oP)(this,this.inputElement,{includeAttrs:["size","full-width","label-value","label-attr","button-label","separator","options","default-values","invalid","readonly","disabled"]}),this.setDefaultValues()}}))((0,n.DM)({slots:[],wrappedEleName:"vaadin-custom-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n direction: ltr;\n }\n vaadin-custom-field {\n line-height: unset;\n width: 100%;\n }\n\n descope-mappings-field-internal [part="labels"] {\n margin-bottom: 0.5em;\n display: grid;\n grid-template-columns: 1fr ${d} 1fr ${p};\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"],\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n ${i.TextClass.cssVarList.fontWeight}: 500;\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"] {\n grid-column: 1 / span 1;\n }\n\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n grid-column: 3 / span 1;\n }\n\n descope-mapping-item::part(wrapper) {\n display: grid;\n grid-template-columns: 1fr ${d} 1fr ${p};\n }\n `,excludeAttrsSync:["tabindex","label-value","label-attr","button-label","options","error-message"],componentName:l}));r(2018),r(9357),r(1294),r(3820),r(6751),customElements.define(l,f)},4201:(t,e,r)=>{r.d(e,{B:()=>p,DY:()=>l,PH:()=>d,Pd:()=>a,TX:()=>i,Wf:()=>c,bi:()=>n,jI:()=>s,jl:()=>o,wm:()=>u});const n=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,i=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,o=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,s=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",d=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,p=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,u=(t,e)=>`\n ${i(t)}\n ${a(t)}\n ${s(t)}\n ${o(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${p(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,c=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`}}]);
1
+ /*! For license information please see mapping-fields-descope-mappings-field-index-js.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9299,9662,9483,2934,2528,3172,5130,4567,1e3,4201,3878,4447],{2561:(t,e,i)=>{i.d(e,{s:()=>d});var r=i(2061),n=i(357),s=i(7878);const a=t=>class extends t{#t=s.C.bind(this,"components-context");updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}};var o=i(2666),l=i(8084);const d=({componentName:t,baseSelector:e=""})=>{class i extends HTMLElement{static get componentName(){return t}#e;#i=!0;get baseSelector(){return e}get baseElement(){return this.#e??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#e||console.warn("missing base element for component",this.localName),this.#e}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#i&&(this.#i=!1,this.init?.())}}return(0,r.qC)(n.A,o._,l.Q,a)(i)}},3878:(t,e,i)=>{i.d(e,{P:()=>a});var r=i(2061),n=i(1e3),s=i(2561);const a=(...t)=>(0,r.qC)(n.wX,n.li,n.QT,n.mE)((0,s.s)(...t))},9690:(t,e,i)=>{i.d(e,{n:()=>u,f:()=>a});var r=i(2061),n=i(4567),s=i(1e3);const a=(0,n.iY)("button"),{host:o,label:l}={host:{selector:()=>":host"},label:{selector:"::part(label)"}};let d;const u=(0,r.qC)((0,s.yk)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...o,property:"direction"},fontSize:{},fontFamily:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],labelTextColor:{property:"color"},labelTextDecoration:{...l,property:"text-decoration"},labelSpacing:{...l,property:"gap"},textAlign:{...l,property:"justify-content",fallback:"center"}}}),(t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}),s.e4,s.Ae)((0,s.DM)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${d}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${u.cssVarList.outlineWidth}) + var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${u.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${u.cssVarList.hostHeight}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${u.cssVarList.hostWidth}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:a})),{color:p,fontSize:h}=u.cssVarList;d=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${p});\n\t\ttop: calc(50% - (var(${h}) / 2));\n\t\tleft: calc(50% - (var(${h}) / 2));\n\t\tborder-width: calc(var(${h}) / 10);\n\t\twidth: var(${h});\n\t\theight: var(${h});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"])::part(prefix),\n\t:host([loading="true"])::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},2018:(t,e,i)=>{i.r(e),i.d(e,{ButtonClass:()=>r.n}),i(1721);var r=i(9690);customElements.define(r.f,r.n)},4049:(t,e,i)=>{i.d(e,{H:()=>y,f:()=>o});var r=i(2061),n=i(4567),s=i(4201),a=i(1e3);const o=(0,n.iY)("combo-box"),{host:l,inputField:d,inputElement:u,placeholder:p,toggle:h,clearButton:c,label:m,requiredIndicator:b,helperText:g,errorMessage:v}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},y=(0,r.qC)((0,a.yk)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[m,p,d,g,v],labelTextColor:[{...m,property:"color"},{...b,property:"color"}],errorMessageTextColor:{...v,property:"color"},inputHeight:{...d,property:"height"},inputBackgroundColor:{...d,property:"background-color"},inputBorderColor:{...d,property:"border-color"},inputBorderWidth:{...d,property:"border-width"},inputBorderStyle:{...d,property:"border-style"},inputBorderRadius:{...d,property:"border-radius"},labelRequiredIndicator:{...b,property:"content"},inputValueTextColor:{...d,property:"color"},inputPlaceholderTextColor:{...p,property:"color"},inputDropdownButtonCursor:[{...h,property:"cursor"},{...c,property:"cursor"}],inputDropdownButtonColor:[{...h,property:"color"},{...c,property:"color"}],inputDropdownButtonSize:[{...h,property:"font-size"},{...c,property:"font-size"}],inputDropdownButtonOffset:[{...h,property:"margin-right"},{...h,property:"margin-left"}],inputOutlineColor:{...d,property:"outline-color"},inputOutlineWidth:{...d,property:"outline-width"},inputOutlineStyle:{...d,property:"outline-style"},inputOutlineOffset:{...d,property:"outline-offset"},inputHorizontalPadding:[{...u,property:"padding-left"},{...u,property:"padding-right"}],overlayBackground:{property:()=>y.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>y.cssVarList.overlay.textColor},overlayBorder:{property:()=>y.cssVarList.overlay.border},overlayFontSize:{property:()=>y.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>y.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>y.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>y.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>y.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>y.cssVarList.overlay.itemPaddingInlineEnd}}}),a.e4,(0,a.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,a.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),a.Ae,(t=>class extends t{#r=({displayName:t,value:e,label:i})=>`<span data-name="${i}" data-id="${e}">${t||i}</span>`;#n;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#r}set renderItem(t){this.#r=t,this.renderItems()}get data(){if(this.#n)return this.#n;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#n=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}handleSelectedItem(){const t=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,t&&(this.value=t),this.value||this.setDefaultValue()}customValueTransformFn(t){return t}setComboBoxDescriptor(){const t=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),e=this;Object.defineProperties(this.inputElement,{value:{...t,set(i){if(!e.baseElement.items?.length)return;const r=e.customValueTransformFn(i)||"";r!==this.value&&t.set.call(this,r)}}})}#s(){const t=this.shadowRoot.querySelector(this.baseSelector),e=Array.from(this.children);e.length&&(e.forEach((t=>{Object.defineProperty(t,"data-name",{value:t.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id"),configurable:!0,writable:!0})})),t.items=e,setTimeout((()=>{this.handleSelectedItem()}),0)),t.renderer=(t,e,i)=>{t.innerHTML=i.item.outerHTML}}#a(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=()=>{t.bringToFront()},t._detachOverlay=()=>{},t._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#a(),this.renderItems(),(0,n.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,n.P$)(this,this.#s.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}setDefaultValue(){this.value=this.defaultValue}set value(t){if(t){const e=this.baseElement.items?.find((e=>e["data-id"]===t));e&&(this.baseElement.selectedItem=e)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((0,a.DM)({slots:["","prefix"],wrappedEleName:"vaadin-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,s.bi)(y.cssVarList)}\n\t\t${(0,s.PH)("vaadin-combo-box")}\n\t\t${(0,s.jI)("vaadin-combo-box")}\n\t\t${(0,s.Pd)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,s.Wf)("vaadin-combo-box")}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:o,includeForwardProps:["items","renderer","selectedItem"]}))},1294:(t,e,i)=>{i.r(e),i.d(e,{ComboBoxClass:()=>r.H}),i(7583);var r=i(4049);customElements.define(r.f,r.H)},6417:(t,e,i)=>{i.d(e,{f:()=>l,z:()=>u});var r=i(1e3),n=i(4447),s=i(2061),a=i(4567),o=i(4201);const l=(0,a.iY)("text-field"),d=["type"],u=(0,s.qC)((0,r.yk)({mappings:n.Z}),r.e4,(0,r.dj)({proxyProps:["value","selectionStart"]}),r.Ae,(t=>class extends t{static get observedAttributes(){return d.concat(t.observedAttributes||[])}attributeChangedCallback(t,e,i){super.attributeChangeCallback?.(t,e,i),"type"===t&&this.baseElement._setType(i)}}))((0,r.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${u.cssVarList.inputOutlineWidth}) + var(${u.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,o.Wf)("vaadin-text-field")}\n\t\t\t${(0,o.bi)(u.cssVarList)}\n\t\t\t${(0,o.wm)("vaadin-text-field",u.cssVarList)}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},9357:(t,e,i)=>{i.r(e),i.d(e,{TextFieldClass:()=>r.z}),i(9789);var r=i(6417);customElements.define(r.f,r.z)},4447:(t,e,i)=>{i.d(e,{Z:()=>c});const{host:r,label:n,placeholder:s,requiredIndicator:a,inputField:o,input:l,helperText:d,errorMessage:u,disabledPlaceholder:p,inputDisabled:h}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:{selector:"> input:placeholder-shown"},disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},c={fontSize:[{},r],fontFamily:[n,o,d,u],hostWidth:{...r,property:"width"},hostMinWidth:{...r,property:"min-width"},hostDirection:{...r,property:"direction"},inputBackgroundColor:{...o,property:"background-color"},labelTextColor:[{...n,property:"color"},{...a,property:"color"},{...n,property:"-webkit-text-fill-color"},{...a,property:"-webkit-text-fill-color"}],errorMessageTextColor:{...u,property:"color"},helperTextColor:{...d,property:"-webkit-text-fill-color"},inputValueTextColor:[{...o,property:"color"},{...h,property:"-webkit-text-fill-color"}],inputCaretTextColor:{...l,property:"color"},labelRequiredIndicator:{...a,property:"content"},inputBorderColor:{...o,property:"border-color"},inputBorderWidth:{...o,property:"border-width"},inputBorderStyle:{...o,property:"border-style"},inputBorderRadius:{...o,property:"border-radius"},inputHeight:{...o,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"}],inputOutlineColor:{...o,property:"outline-color"},inputOutlineStyle:{...o,property:"outline-style"},inputOutlineWidth:{...o,property:"outline-width"},inputOutlineOffset:{...o,property:"outline-offset"},inputTextAlign:{...l,property:"text-align"},inputPlaceholderColor:[{...s,property:"color"},{...p,property:"-webkit-text-fill-color"}]}},2138:(t,e,i)=>{i.d(e,{f:()=>o,k:()=>d});var r=i(1e3),n=i(2561),s=i(2061),a=i(4567);const o=(0,a.iY)("text");class l extends((0,n.s)({componentName:o,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<style>\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\t:host > slot {\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<slot></slot>\n\t\t"}}const d=(0,s.qC)((0,r.yk)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:{property:"color"},textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),r.e4,r.Ae,(t=>class extends t{get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,a.P$)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}))(l)},1876:(t,e,i)=>{i.r(e),i.d(e,{TextClass:()=>r.k});var r=i(2138);customElements.define(r.f,r.k)},6751:(t,e,i)=>{i.r(e);var r=i(3878),n=i(4567);const s=(0,n.iY)("mapping-item"),a=["size","bordered","readonly","full-width","disabled"],o=(0,r.P)({componentName:s,baseSelector:"div"});customElements.define(s,class extends o{static get observedAttributes(){return[].concat(o.observedAttributes||[],a,["separator","options","invalid","disabled"])}get separator(){return this.getAttribute("separator")||"map to"}get value(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{[t]:e}:null}set value(t){if(1!==Object.entries(t).length)return void console.error("descope-mapping item expected expects only one key-value pair in the value but received: ",t);const[e,i]=Object.entries(t)[0];this.valueInput.value=i,this.attributeInput.value=e,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n .wrapper {\n display: flex;\n }\n .separator {\n text-align: center;\n flex-shrink: 0;\n }\n </style>\n <div class="wrapper" part="wrapper">\n <descope-text-field required="true"></descope-text-field>\n <div class="separator" part="separator">${this.separator}</div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n required="true"\n >\n </descope-combo-box>\n <descope-button variant="link" mode="primary">\n <vaadin-icon icon="vaadin:minus"></vaadin-icon>\n </descope-button>\n </div>\n\t`,this.valueInput=this.shadowRoot.querySelector("descope-text-field"),this.attributeInput=this.shadowRoot.querySelector("descope-combo-box"),this.inputs=[this.valueInput,this.attributeInput],this.removeButton=this.shadowRoot.querySelector("descope-button"),(0,n.oP)(this,this.valueInput,{includeAttrs:a}),(0,n.oP)(this,this.attributeInput,{includeAttrs:[...a,"options"],mapAttrs:{options:"data"}}),(0,n.oP)(this,this.removeButton,{includeAttrs:["disabled"]})}initRemoveButton(){this.removeButton.addEventListener("click",(()=>this.dispatchEvent(new CustomEvent("mapping-item-removed"))))}init(){super.init?.(),this.initRemoveButton()}getValidity(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{}:{badInput:!0}}reportValidity(){this.inputs.forEach((t=>t.reportValidity()))}focus(){(this.checkValidity()||!this.valueInput.checkValidity()?this.valueInput:this.attributeInput).focus()}handleSeparatorChange(){this.shadowRoot.querySelector(".separator").textContent=this.separator}#o(t){"true"===t&&(this.valueInput.value||(this.valueInput.setAttribute("invalid","true"),this.valueInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)),this.attributeInput.value||(this.attributeInput.setAttribute("invalid","true"),this.attributeInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"separator"===t&&this.handleSeparatorChange(),"invalid"===t&&this.#o(i)}})},7819:(t,e,i)=>{i.d(e,{Z:()=>o,f:()=>s});var r=i(3878),n=i(4567);const s=(0,n.iY)("mappings-field-internal"),a=(0,r.P)({componentName:s,baseSelector:"div"}),o=class extends a{#l;static get observedAttributes(){return[].concat(a.observedAttributes||[],["label-value","label-attr","button-label","invalid","readonly","disabled"])}isValidDataType(t){try{return t.every((t=>"object"==typeof t&&!Array.isArray(t)&&1===Object.getOwnPropertyNames(t).length&&"string"==typeof t[Object.keys(t)[0]]&&""!==t[Object.keys(t)[0]].trim()))}catch(t){return!1}}get labelValue(){return this.getAttribute("label-value")||"Value"}get labelAttr(){return this.getAttribute("label-attr")||"Attribute"}get buttonLabel(){return this.getAttribute("button-label")||"Add mapping"}get options(){return this.getAttribute("options")||[]}addNewMappingItem(){const t=document.createElement("descope-mapping-item");return t.setAttribute("bordered","true"),this.mappingsContainerEle.appendChild(t),(0,n.oP)(this,t,{includeAttrs:["size","full-width","separator","options","disabled"]}),setTimeout((()=>{this.setCustomValidity(""),t.addEventListener("mapping-item-removed",(e=>{t===this.#l&&(this.resetInvalidIndication(),this.#l=void 0),t.remove(),this.setCustomValidity(""),e.stopPropagation()}))}),0),t}get items(){return Array.from(this.mappingsContainerEle.querySelectorAll("descope-mapping-item"))}get value(){return this.items.reduce(((t,e)=>e.value?[...t,e.value]:t),[])}set value(t){if(!this.isValidDataType(t))return void console.error("received invalid value to set - should be an array of objects with one key-value pair");const e=this.items;if(e.length>t.length)for(let i=t.length;i<e.length;i++)this.mappingsContainerEle.removeChild(e[i]);t.forEach(((t,i)=>{const r=e[i];if(r)r.value=t;else{const e=this.addNewMappingItem();setTimeout((()=>{e.value=t}),0)}}))}constructor(){super(),this.innerHTML='\n <div class="labels-container" part="labels"></div>\n <div class="mappings-container"></div>\n <div class="button-container"></div>\n ',this.labelsEle=this.querySelector(".labels-container"),this.mappingsContainerEle=this.querySelector(".mappings-container"),this.buttonContainer=this.querySelector(".button-container")}initLabels(){this.labelsEle.innerHTML=`\n <descope-text variant="body2" part="value-label">${this.labelValue}</descope-text>\n <descope-text variant="body2" part="attr-label">${this.labelAttr}</descope-text>\n `}initAddButton(){this.buttonContainer.innerHTML=`\n <descope-button variant="link" mode="primary" disabled="${this.isDisabled}">\n <vaadin-icon icon="vaadin:plus"></vaadin-icon>\n ${this.buttonLabel}\n </descope-button>\n `;const t=this.querySelector("descope-button");t.onclick=()=>{this.addNewMappingItem()},(0,n.oP)(this,t,{includeAttrs:["disabled"]})}init(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.#l||this.items[0]||this.querySelector("descope-button")).focus()})),super.init?.(),this.initLabels(),this.initAddButton(),this.addEventListener("input",(()=>{this.mappingsContainerEle.contains(this.#l)&&this.#l?.checkValidity()&&(this.resetInvalidIndication(),this.#l.removeAttribute("invalid"),this.#l=void 0)}))}resetInvalidIndication(){this.removeAttribute("invalid")}getValidity(){const t=this.items.find((t=>!t.checkValidity()));return t?t.validity:{}}#d(t){t&&(this.#l=this.items.find((t=>!t.checkValidity())),this.#l?.reportValidity(),this.#l?.setAttribute("invalid","true"))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"label-value"!==t&&"label-attr"!==t||this.initLabels(),"button-label"===t&&this.initAddButton(),"invalid"===t&&this.#d("true"===i),"readonly"===t&&this.toggleAttribute("inert","true"===i)}}},3820:(t,e,i)=>{i.r(e);var r=i(7819);customElements.define(r.f,r.Z)},3325:(t,e,i)=>{i.r(e),i.d(e,{MappingsFieldClass:()=>q}),i(1195),i(9098),i(9416),i(4173);var r=i(2982),n=i(1251),s=i(6570);const a=s.iv`
3
+ :host {
4
+ --lumo-text-field-size: var(--lumo-size-m);
5
+ color: var(--lumo-body-text-color);
6
+ font-size: var(--lumo-font-size-m);
7
+ /* align with text-field height + vertical paddings */
8
+ line-height: calc(var(--lumo-text-field-size) + 2 * var(--lumo-space-xs));
9
+ font-family: var(--lumo-font-family);
10
+ -webkit-font-smoothing: antialiased;
11
+ -moz-osx-font-smoothing: grayscale;
12
+ -webkit-tap-highlight-color: transparent;
13
+ padding: 0;
14
+ }
15
+
16
+ :host::before {
17
+ margin-top: var(--lumo-space-xs);
18
+ height: var(--lumo-text-field-size);
19
+ box-sizing: border-box;
20
+ display: inline-flex;
21
+ align-items: center;
22
+ }
23
+
24
+ /* align with text-field label */
25
+ :host([has-label]) [part='label'] {
26
+ padding-bottom: calc(0.5em - var(--lumo-space-xs));
27
+ }
28
+
29
+ :host(:not([has-label])) [part='label'],
30
+ :host(:not([has-label]))::before {
31
+ display: none;
32
+ }
33
+
34
+ /* align with text-field error message */
35
+ :host([has-error-message]) [part='error-message']::before {
36
+ height: calc(0.4em - var(--lumo-space-xs));
37
+ }
38
+
39
+ :host([focused]:not([readonly]):not([disabled])) [part='label'] {
40
+ color: var(--lumo-primary-text-color);
41
+ }
42
+
43
+ :host(:hover:not([readonly]):not([disabled]):not([focused])) [part='label'],
44
+ :host(:hover:not([readonly]):not([disabled]):not([focused])) [part='helper-text'] {
45
+ color: var(--lumo-body-text-color);
46
+ }
47
+
48
+ /* Touch device adjustment */
49
+ @media (pointer: coarse) {
50
+ :host(:hover:not([readonly]):not([disabled]):not([focused])) [part='label'] {
51
+ color: var(--lumo-secondary-text-color);
52
+ }
53
+ }
54
+
55
+ /* Disabled */
56
+ :host([disabled]) [part='label'] {
57
+ color: var(--lumo-disabled-text-color);
58
+ -webkit-text-fill-color: var(--lumo-disabled-text-color);
59
+ }
60
+
61
+ /* Small theme */
62
+ :host([theme~='small']) {
63
+ font-size: var(--lumo-font-size-s);
64
+ --lumo-text-field-size: var(--lumo-size-s);
65
+ }
66
+
67
+ :host([theme~='small'][has-label]) [part='label'] {
68
+ font-size: var(--lumo-font-size-xs);
69
+ }
70
+
71
+ :host([theme~='small'][has-label]) [part='error-message'] {
72
+ font-size: var(--lumo-font-size-xxs);
73
+ }
74
+
75
+ /* When custom-field is used with components without outer margin */
76
+ :host([theme~='whitespace'][has-label]) [part='label'] {
77
+ padding-bottom: 0.5em;
78
+ }
79
+ `;(0,s.hC)("vaadin-custom-field",[n.l,r._,a],{moduleId:"lumo-custom-field"});var o=i(4241),l=i(2807),d=i(2521),u=i(1360),p=i(2628),h=i(3726),c=i(4463),m=i(7412);const b=t=>t.split("\t"),g=t=>t.join("\t"),v=t=>class extends((0,m.f)((0,u.W)((0,p.L)(t)))){static get properties(){return{name:String,value:{type:String,observer:"__valueChanged",notify:!0},inputs:{type:Array,readOnly:!0},formatValue:{type:Function},parseValue:{type:Function}}}ready(){super.ready(),this.setAttribute("role","group"),this.ariaTarget=this,this.__childrenObserver=new MutationObserver((()=>{this.__setInputsFromSlot()})),this.__setInputsFromSlot(),this.$.slot.addEventListener("slotchange",(()=>{this.__setInputsFromSlot(),(0,h.xX)(this.$.slot).filter((t=>!this.__isInput(t))).forEach((t=>{this.__childrenObserver.observe(t,{childList:!0})}))})),this._tooltipController=new c.f(this),this.addController(this._tooltipController),this._tooltipController.setShouldShow((t=>!(t.inputs||[]).some((t=>t.opened))))}focus(){this.inputs&&this.inputs[0]&&this.inputs[0].focus()}_setFocused(t){super._setFocused(t),t||this.validate()}_shouldRemoveFocus(t){const{relatedTarget:e}=t;return!this.inputs.some((t=>e===(t.focusElement||t)))}checkValidity(){return!(this.inputs.filter((t=>!(t.validate||t.checkValidity).call(t))).length||this.required&&!this.value.trim())}_onKeyDown(t){"Tab"===t.key&&(this.inputs.indexOf(t.target)<this.inputs.length-1&&!t.shiftKey||this.inputs.indexOf(t.target)>0&&t.shiftKey?this.dispatchEvent(new CustomEvent("internal-tab")):this.__setValue())}_onInputChange(t){t.stopPropagation(),this.__setValue(),this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))}__setValue(){this.__settingValue=!0;const t=this.formatValue||g;this.value=t.apply(this,[this.inputs.map((t=>t.value))]),this.__settingValue=!1}__isInput(t){return!("input"===t.getAttribute("slot")||"textarea"===t.getAttribute("slot"))&&(t.validate||t.checkValidity)}__getInputsFromSlot(){return(0,h.xX)(this.$.slot).filter((t=>this.__isInput(t)))}__setInputsFromSlot(){this._setInputs(this.__getInputsFromSlot()),this.__setValue()}__toggleHasValue(t){this.toggleAttribute("has-value",null!==t&&""!==t.trim())}__valueChanged(t,e){if(this.__settingValue||!this.inputs)return;this.__toggleHasValue(t);const i=(this.parseValue||b).apply(this,[t]);i&&0!==i.length?(this.inputs.forEach(((t,e)=>{t.value=i[e]})),void 0!==e&&this.validate()):console.warn("Value parser has not provided values array")}},y=i(9392).iv`
80
+ :host {
81
+ display: inline-flex;
82
+ }
83
+
84
+ :host::before {
85
+ content: '\\2003';
86
+ width: 0;
87
+ display: inline-block;
88
+ /* Size and position this element on the same vertical position as the input-field element
89
+ to make vertical align for the host element work as expected */
90
+ }
91
+
92
+ :host([hidden]) {
93
+ display: none !important;
94
+ }
95
+
96
+ .vaadin-custom-field-container {
97
+ width: 100%;
98
+ display: flex;
99
+ flex-direction: column;
100
+ }
101
+
102
+ .inputs-wrapper {
103
+ flex: none;
104
+ }
105
+ `;(0,s.hC)("vaadin-custom-field",y,{moduleId:"vaadin-custom-field-styles"});class f extends(v((0,s.Tb)((0,d.S)(o.H3)))){static get is(){return"vaadin-custom-field"}static get template(){return o.dy`
106
+ <div class="vaadin-custom-field-container">
107
+ <div part="label" on-click="focus">
108
+ <slot name="label"></slot>
109
+ <span part="required-indicator" aria-hidden="true"></span>
110
+ </div>
111
+
112
+ <div class="inputs-wrapper" part="input-fields" on-change="_onInputChange">
113
+ <slot id="slot"></slot>
114
+ </div>
115
+
116
+ <div part="helper-text">
117
+ <slot name="helper"></slot>
118
+ </div>
119
+
120
+ <div part="error-message">
121
+ <slot name="error-message"></slot>
122
+ </div>
123
+ </div>
124
+
125
+ <slot name="tooltip"></slot>
126
+ `}}(0,l.M)(f),i(7911),i(6594);var x=i(1e3),E=i(1876),w=i(2061),C=i(4567),A=i(7819);const S=(0,C.iY)("mappings-field"),I="80px",V="60px",{host:$,helperText:k,errorMessage:T,mappingItem:L,labels:M,valueLabel:_,attrLabel:O,separator:P}={host:{selector:()=>":host"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},mappingItem:{selector:"descope-mapping-item::part(wrapper)"},labels:{selector:'descope-mappings-field-internal [part="labels"] descope-text'},valueLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="value-label"]'},attrLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="attr-label"]'},separator:{selector:"descope-mapping-item::part(separator)"}},q=(0,w.qC)((0,x.yk)({mappings:{hostWidth:{...$,property:"width"},hostDirection:{...$,property:"direction"},fontSize:[{},$,{...P,property:"margin-top"}],fontFamily:[k,T,M],separatorFontSize:{...P,property:"font-size"},labelTextColor:{...M,property:E.TextClass.cssVarList.textColor},itemMarginBottom:{...L,property:"margin-bottom"},valueLabelMinWidth:{..._,property:"min-width"},attrLabelMinWidth:{...O,property:"min-width"}}}),x.e4,(0,x.dj)({proxyProps:["value","selectionStart"],inputEvent:"input",proxyParentValidation:!0}),x.Ae,(t=>class extends t{get defaultValues(){const t=this.getAttribute("default-values");if(t)try{return JSON.parse(t)}catch(t){console.error('could not parse data string from attribute "default-values" -',t.message)}return[]}setDefaultValues(){const t=this.defaultValues;Object.keys(t).length>0&&(this.inputElement.value=t)}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${A.f}\n tabindex="-1"\n ></${A.f}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(A.f),(0,C.oP)(this,this.inputElement,{includeAttrs:["size","full-width","label-value","label-attr","button-label","separator","options","default-values","invalid","readonly","disabled"]}),this.setDefaultValues()}}))((0,x.DM)({slots:[],wrappedEleName:"vaadin-custom-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n direction: ltr;\n }\n vaadin-custom-field {\n line-height: unset;\n width: 100%;\n }\n\n descope-mappings-field-internal [part="labels"] {\n margin-bottom: 0.5em;\n display: grid;\n grid-template-columns: 1fr ${I} 1fr ${V};\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"],\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n ${E.TextClass.cssVarList.fontWeight}: 500;\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"] {\n grid-column: 1 / span 1;\n }\n\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n grid-column: 3 / span 1;\n }\n\n descope-mapping-item::part(wrapper) {\n display: grid;\n grid-template-columns: 1fr ${I} 1fr ${V};\n }\n `,excludeAttrsSync:["tabindex","label-value","label-attr","button-label","options","error-message"],componentName:S}));i(2018),i(9357),i(1294),i(3820),i(6751),customElements.define(S,q)},5279:(t,e,i)=>{i.d(e,{gh:()=>r,k4:()=>n,qM:()=>a,qg:()=>s});const r="descope",n=3,s="host",a="@"},4567:(t,e,i)=>{i.d(e,{Db:()=>h,FX:()=>s,P$:()=>a,Tk:()=>u,iY:()=>d,oP:()=>p,tg:()=>l});var r=i(2061),n=i(5279);const s=(t,e,{excludeAttrs:i=[],includeAttrs:r=[]})=>{const n=Array.from(t.attributes).filter((t=>!i.includes(t.name)&&(!r.length||r.includes(t.name)))).map((t=>t.name));e(n),new MutationObserver((t=>{t.forEach((t=>{"attributes"!==t.type||i.includes(t.attributeName)||r.length&&!r.includes(t.attributeName)||e([t.attributeName])}))})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&e(t)}))})).observe(t,{childList:!0})},o=(t,e,i={})=>r=>{r.forEach((r=>{const n=i[r]||r,s=t.getAttribute(r);null!==s?e.getAttribute(n)!==s&&e.setAttribute(n,s):e.removeAttribute(n)}))},l=(t,e,i)=>{s(t,o(t,e),i),s(e,o(e,t),i)},d=t=>(0,r.E3)(n.gh,t),u=(...t)=>`--${(0,r.E3)(...t)}`,p=(t,e,i={})=>{s(t,o(t,e,i.mapAttrs),i)},h=(t,e,i=[])=>{if(!i.length)return;const r=i.reduce(((e,i)=>Object.assign(e,{[i]:{get:()=>t[i],set(e){t[i]=e}}})),{});Object.defineProperties(e,r)}},2061:(t,e,i)=>{i.d(e,{E3:()=>n,GL:()=>r,lo:()=>o,mf:()=>a,qC:()=>s});const r=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),n=(...t)=>r(t.filter((t=>!!t)).join("-")),s=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t,o=(t,e)=>{if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;const i=t.slice().sort(),r=e.slice().sort();for(let t=0;t<i.length;t++)if(i[t]!==r[t])return!1;return!0}},7878:(t,e,i)=>{function r(t,e={}){const i=new Event(t,e);this[`on${t}`]?.(i),this.dispatchEvent(i)}i.d(e,{C:()=>r})},4201:(t,e,i)=>{i.d(e,{B:()=>u,DY:()=>l,PH:()=>d,Pd:()=>a,TX:()=>n,Wf:()=>h,bi:()=>r,jI:()=>o,jl:()=>s,wm:()=>p});const r=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,n=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,s=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,a=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,o=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",d=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,u=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,p=(t,e)=>`\n ${n(t)}\n ${a(t)}\n ${o(t)}\n ${s(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${u(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,h=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`},357:(t,e,i)=>{i.d(e,{A:()=>r});const r=t=>class extends t{#u(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#u()}}},2666:(t,e,i)=>{i.d(e,{_:()=>r});const r=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}}},1e3:(t,e,i)=>{i.d(e,{li:()=>A,Ae:()=>x.A,DM:()=>c,yk:()=>d,e4:()=>u,_A:()=>E._,mE:()=>I,wX:()=>b,QT:()=>S.Q,Iw:()=>C,dj:()=>f});var r=i(5279),n=i(2061),s=i(4567),a=i(5561);class o{constructor(){this.styleMap=new Map}add(t,e,i){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:i}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,i])=>`${t}${e} { \n${i.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const l=(t,e)=>Object.keys(e).reduce(((e,i)=>Object.assign(e,{[i]:(0,s.Tk)(t,i)})),{}),d=({mappings:t={},componentNameOverride:e=""})=>i=>{const d=e||i.componentName;return class extends i{static get cssVarList(){return{...i.cssVarList,...l(d,{...t})}}#p;#h;#c;#m;#b;#g;#v;#y;#f;constructor({getRootElement:e,componentNameSuffix:i="",themeSection:s=r.qg,baseSelector:a}={}){super(),this.#m=i,this.#b=s,this.#v=a??this.baseSelector,this.#f=e,this.#y=Object.keys(t).map((t=>(0,n.E3)("st",i,t)))}get#x(){return a.componentsThemeManager.currentTheme?.[d]||""}#E(){this.#h.innerHTML=this.#x[this.#b]}#w(){this.#h=document.createElement("style"),this.#h.id=`style-mixin-theme__${d}`,this.#g.prepend(this.#h),this.#c=a.componentsThemeManager.onCurrentThemeChange(this.#E.bind(this)),this.#E()}#C(){if(this.#y.length){this.#p=document.createElement("style"),this.#p.id=`style-mixin-overrides__${d}`;const i=(t=d,e=r.k4,Array(e).fill(`.${t}`).join(""));this.#p.innerText=`:host(${i}) {}`,this.#g.append(this.#p)}var t,e}#A(t,e){const i=this.#p?.sheet?.cssRules[0].style;if(!i)return;const r=(0,s.Tk)(d,t.replace(new RegExp("^st-"),""));e?i?.setProperty(r,e):(i?.removeProperty(r),this.removeAttribute(t))}#S(t=[]){let e=!1;t.forEach((t=>{this.#y.includes(t)&&(this.#A(t,this.getAttribute(t)),e=!0)})),e&&(this.#p.innerHTML=this.#p?.sheet?.cssRules[0].cssText)}#I(){if(Object.keys(t).length){const e=document.createElement("style");e.id=`style-mixin-mappings__${d}`,e.innerHTML=((t,e,i)=>{const r=new o;return Object.keys(i).forEach((a=>{const o=((t,e)=>{const i={selector:"",property:(0,n.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>({...i,...t}))):[{...i,...e}]:[i]})(a,i[a]),l=(0,s.Tk)(t,a);o.forEach((({selector:t,property:i,important:s,fallback:a})=>{r.add(((t="",e="")=>(0,n.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,n.mf)(i)?i():i,((t,e)=>`var(${t}${e?`, ${e}`:""})`)(l,a)+(s?"!important":""))}))})),r.toString()})((0,n.E3)(d,this.#m),this.#v,t),this.#g.prepend(e)}}#V(t){(this.#g.classList||this.#g.host.classList).add(t)}async init(){super.init?.(),this.shadowRoot.isConnected&&(this.#g=await(this.#f?.(this))||this.shadowRoot,this.#V(d),this.#I(),this.#w(),this.#C(),(0,s.FX)(this,this.#S.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#c?.()}}},u=t=>class extends t{#$=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#$=document.createElement("style"),this.#$.innerText="* { cursor: inherit!important }"}#k(t){t?this.shadowRoot.appendChild(this.#$):this.#$.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const i=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",i),t.target.removeEventListener("dragend",i)};t.target.addEventListener("mouseup",i,{once:!0}),t.target.addEventListener("dragend",i,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"draggable"===t&&this.#k("true"===i)}};var p=i(2561),h=i(7878);const c=({componentName:t,wrappedEleName:e,slots:i=[],style:r,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[],delegatesFocus:d=!0})=>{class u extends((0,p.s)({componentName:t,baseSelector:e})){#T=h.C.bind(this,"blur");#L=h.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:d}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,n.mf)(r)?r():r}</style>\n\t\t\t<${e}>\n\t\t\t${i.map((t=>`<slot ${t?`name="${t}" slot="${t}"`:""} ></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#T()})),this.baseElement.addEventListener("focus",(t=>{this.#L()})),(0,s.Db)(this.baseElement,this,l),(0,s.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return u};i(5910);const m=["required","pattern"],b=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...m]}static get formAssociated(){return!0}#M;get internals(){return this.#M}set internals(t){this.#M=t}constructor(){super(),this.#M=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}getErrorMessage(t){const{valueMissing:e,patternMismatch:i,typeMismatch:r,stepMismatch:n,tooShort:s,tooLong:a,rangeOverflow:o,rangeUnderflow:l,badInput:d,customError:u}=t;switch(!0){case e:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case i||r||n||d:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case s:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case a:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case l:return this.defaultErrorMsgRangeUnderflow;case o:return this.defaultErrorMsgRangeOverflow;case u:return this.validationMessage;default:return""}}#_(){const t=this.isReadOnly?{}:this.getValidity();this.#M.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#M.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#M.validity.valid}reportValidity(){return this.#M.reportValidity()}get validity(){return this.#M.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#M.setValidity({customError:!0},t,this.validationTarget):(this.#M.setValidity({}),this.#_())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#M.form}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),m.includes(t)&&this.#_()}init(){super.init?.(),this.addEventListener("change",this.#_),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#_),setTimeout((()=>this.#_()))}},g=["invalid","required"],v=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e.localName)return e},y=({proxyProps:t=[],inputEvent:e="input",proxyParentValidation:i=!1})=>r=>class extends(b(r)){static get observedAttributes(){return[...r.observedAttributes||[],...g]}#O;#P=h.C.bind(this,"change");constructor(){super(),this.#O=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#O&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){if(this.#O)return this.#O;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#O=v(t)||v(e),this.#O}set inputElement(t){this.#O=t}getValidity(){return this.inputElement?.validity||{}}#q(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#q(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},setTimeout((()=>{(Array.isArray(e)?e:[e]).forEach((t=>{this.baseElement?.addEventListener(t,(()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#q()}))})),this.baseElement.addEventListener("change",(()=>{this.#P()})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#q()})),t.forEach((t=>{var e,i;e=this.inputElement,i=t,Object.defineProperty(this,i,{set(t){e[i]=t},get:()=>e[i],configurable:!0})})),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,s.oP)(this,this.inputElement,{includeAttrs:["inputmode"]})})),i){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,i)=>"function"==typeof t[i]&&"setValidity"===i?(...r)=>{if(3===r.length){const t=r.slice(0,r.length-1);t.push(e.inputElement),e.internals[i](...t)}else e.internals[i](...r);return t[i](...r)}:"function"==typeof t[i]?(...r)=>(e.internals[i](...r),t[i](...r)):t[i]})}}},f=t=>(0,n.qC)(y(t),d({componentNameOverride:(0,s.iY)("input-wrapper")}));var x=i(357),E=i(2666);const w=t=>async e=>{const i=await t(e);return new Promise((t=>{let e=0;const r=()=>{if(e>20)return console.error("could not get shadow root for element",i),void t(i);e++,i?.shadowRoot?t(i.shadowRoot):setTimeout(r)};r()}))},C=({name:t,selector:e,mappings:i={},forward:{attributes:a=[],include:o=!0}={}})=>u=>{const p=t||(t=>t.replace(/[^\w\s]/gi,""))(e),h=d({mappings:i})(u);return class extends h{static get cssVarList(){return{...h.cssVarList,[p]:l((0,n.E3)(u.componentName,"_"+p),i)}}#N;constructor(){const t=w((async t=>{const i=t.shadowRoot.querySelector(t.baseSelector);return e?(await w((()=>i))(t)).querySelector(e):i}));super({getRootElement:t,componentNameSuffix:"_"+p,themeSection:r.qM+p,baseSelector:":host"}),this.#N=t(this).then((t=>t.host))}async#z(){const t=await this.#N;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.();const t=await this.#N;(0,s.oP)(this,t,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#z()}}},A=t=>class extends t{#P=h.C.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#P(),this.prevValue=this.value)}))}};var S=i(8084);const I=t=>class extends t{init(){this.#D(),super.init?.()}#D(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,h.C.call(this,"blur"),h.C.call(this,"focusout",{bubbles:!0})}))}));const i=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(h.C.call(this,"focus"),h.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",i),t?.addEventListener("focus",i)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,i)=>{i.d(e,{Q:()=>s});var r=i(4567);const n=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options"],s=t=>class extends t{init(){super.init?.(),(0,r.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);(t=>n.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.warn(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}))),{})}}}}]);
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2019 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9288],{2246:(t,e,n)=>{n.d(e,{f:()=>r,Z:()=>m});var i=n(3878),s=n(4567),u=n(7262);const o=({code:t,dialCode:e,name:n})=>`\n\t<div\n\t\tstyle="display:flex; flex-direction: column;"\n\t\tdata-id="${e}"\n\t\tdata-name="${t} ${e} ${n}"\n\t\tdata-country-code="${t}"\n\t>\n\t\t<div>\n\t\t\t<span>\n\t\t\t\t<img src="${(t=>`https://static.descope.com/npm/svg-country-flags@1.2.10/svg/${t.toLowerCase()}.svg`)(t)}" width="20"/>\n\t\t\t</span>\n\t\t\t<span>${n}</span>\n\t\t</div>\n\t\t<div>\n\t\t\t<span>${t}</span>\n\t\t\t<span>${e}</span>\n\t\t</div>\n\t</div>\n`,r=(0,s.iY)("phone-field-internal"),d=["disabled","size","bordered","invalid","readonly"],a=["country-input-placeholder","default-code","restrict-countries"],c=["phone-input-placeholder","maxlength"],p={"country-input-placeholder":"placeholder","phone-input-placeholder":"placeholder"},l=[].concat(d,a,c),h=(0,i.P)({componentName:r,baseSelector:"div"}),m=class extends h{static get observedAttributes(){return[].concat(h.observedAttributes||[],l)}constructor(){super(),this.innerHTML=`\n <div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n >\n ${u.Z.map((t=>o(t))).join("")}\n </descope-combo-box>\n <div class="separator"></div>\n <descope-text-field type="tel"></descope-text-field>\n </div>\n `,this.countryCodeInput=this.querySelector("descope-combo-box"),this.phoneNumberInput=this.querySelector("descope-text-field"),this.inputs=[this.countryCodeInput,this.phoneNumberInput],this.countryCodeInput.customValueTransformFn=t=>{const[,e]=t?.split?.(" ")||[];return e}}get value(){return this.phoneNumberValue?`${this.countryCodeInput.value}-${this.phoneNumberInput.value}`:""}set value(t){const[e="",n=""]=t.split("-");if(e){const t=this.getCountryByDialCode(e);t&&(this.countryCodeInput.selectedItem=t)}else this.countryCodeInput.selectedItem=void 0;this.phoneNumberInput.value=n}get phoneNumberValue(){return this.phoneNumberInput.value}get countryCodeValue(){return this.countryCodeInput.shadowRoot.querySelector("input").value}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}getValidity(){const t=this.countryCodeInput.value,e=this.phoneNumberInput.value,n=!t||!e,i=this.phoneNumberInput.value?.length&&this.phoneNumberInput.value.length<this.minLength;return this.isRequired&&n?{valueMissing:!0}:i?{tooShort:!0}:e&&!t?{valueMissing:!0}:{}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.inputs[1].focus()})),super.init?.(),this.initInputs()}getRestrictedCountries(){return this.getAttribute("restrict-countries")?.split(",")||[]}getCountryByDialCode(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-id")===t))}getCountryByCodeId(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-country-code")===t))}updateCountryCodeItems(t){const e=t.length?u.Z.filter((e=>t.includes(e.code))):u.Z;this.querySelector("descope-combo-box").innerHTML=e.map((t=>o(t))).join("")}handleDefaultCountryCode(t){if(!this.countryCodeInput.value){const e=this.getCountryByCodeId(t);e&&setTimeout((()=>{this.countryCodeInput.selectedItem=e}))}}initInputs(){this.phoneNumberInput.addEventListener("input",(t=>{const e=/^\d$/,n=t.target.value.split("").filter((t=>e.test(t))).join("");t.target.value=n})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,n){if(super.attributeChangedCallback(t,e,n),e!==n){if("default-code"===t&&n)this.handleDefaultCountryCode(n);else if(l.includes(t)){const e=p[t]||t;d.includes(t)?this.inputs.forEach((t=>t.setAttribute(e,n))):a.includes(t)?this.countryCodeInput.setAttribute(e,n):c.includes(t)&&this.phoneNumberInput.setAttribute(e,n)}"restrict-countries"===t&&this.updateCountryCodeItems(this.getRestrictedCountries())}}}},9240:(t,e,n)=>{n.r(e),n(1294),n(9357);var i=n(2246);customElements.define(i.f,i.Z)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9288,9483,2934],{4049:(e,a,o)=>{o.d(a,{H:()=>g,f:()=>r});var d=o(2061),t=o(4567),n=o(4201),i=o(1e3);const r=(0,t.iY)("combo-box"),{host:l,inputField:c,inputElement:s,placeholder:m,toggle:u,clearButton:C,label:p,requiredIndicator:h,helperText:b,errorMessage:y}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},g=(0,d.qC)((0,i.yk)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[p,m,c,b,y],labelTextColor:[{...p,property:"color"},{...h,property:"color"}],errorMessageTextColor:{...y,property:"color"},inputHeight:{...c,property:"height"},inputBackgroundColor:{...c,property:"background-color"},inputBorderColor:{...c,property:"border-color"},inputBorderWidth:{...c,property:"border-width"},inputBorderStyle:{...c,property:"border-style"},inputBorderRadius:{...c,property:"border-radius"},labelRequiredIndicator:{...h,property:"content"},inputValueTextColor:{...c,property:"color"},inputPlaceholderTextColor:{...m,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...C,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...C,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...C,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,property:"margin-left"}],inputOutlineColor:{...c,property:"outline-color"},inputOutlineWidth:{...c,property:"outline-width"},inputOutlineStyle:{...c,property:"outline-style"},inputOutlineOffset:{...c,property:"outline-offset"},inputHorizontalPadding:[{...s,property:"padding-left"},{...s,property:"padding-right"}],overlayBackground:{property:()=>g.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>g.cssVarList.overlay.textColor},overlayBorder:{property:()=>g.cssVarList.overlay.border},overlayFontSize:{property:()=>g.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>g.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>g.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>g.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>g.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>g.cssVarList.overlay.itemPaddingInlineEnd}}}),i.e4,(0,i.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,i.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),i.Ae,(e=>class extends e{#e=({displayName:e,value:a,label:o})=>`<span data-name="${o}" data-id="${a}">${e||o}</span>`;#a;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}get data(){if(this.#a)return this.#a;const e=this.getAttribute("data");if(e)try{const a=JSON.parse(e);if(this.isValidDataType(a))return a}catch(e){console.error('could not parse data string from attribute "data" -',e.message)}return[]}set data(e){this.isValidDataType(e)&&(this.#a=e,this.renderItems())}isValidDataType(e){const a=Array.isArray(e);return a||console.error("data must be an array, received:",e),a}getItemsTemplate(){return this.data?.reduce?.(((e,a)=>e+(this.renderItem?.(a||{})||"")),"")}renderItems(){const e=this.getItemsTemplate();e&&(this.innerHTML=e)}handleSelectedItem(){const e=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,e&&(this.value=e),this.value||this.setDefaultValue()}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),a=this;Object.defineProperties(this.inputElement,{value:{...e,set(o){if(!a.baseElement.items?.length)return;const d=a.customValueTransformFn(o)||"";d!==this.value&&e.set.call(this,d)}}})}#o(){const e=this.shadowRoot.querySelector(this.baseSelector),a=Array.from(this.children);a.length&&(a.forEach((e=>{Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(e,"data-id",{value:e.getAttribute("data-id"),configurable:!0,writable:!0})})),e.items=a,setTimeout((()=>{this.handleSelectedItem()}),0)),e.renderer=(e,a,o)=>{e.innerHTML=o.item.outerHTML}}#d(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#d(),this.renderItems(),(0,t.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,t.P$)(this,this.#o.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}setDefaultValue(){this.value=this.defaultValue}set value(e){if(e){const a=this.baseElement.items?.find((a=>a["data-id"]===e));a&&(this.baseElement.selectedItem=a)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((0,i.DM)({slots:["","prefix"],wrappedEleName:"vaadin-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,n.bi)(g.cssVarList)}\n\t\t${(0,n.PH)("vaadin-combo-box")}\n\t\t${(0,n.jI)("vaadin-combo-box")}\n\t\t${(0,n.Pd)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,n.Wf)("vaadin-combo-box")}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:r,includeForwardProps:["items","renderer","selectedItem"]}))},1294:(e,a,o)=>{o.r(a),o.d(a,{ComboBoxClass:()=>d.H}),o(7583);var d=o(4049);customElements.define(d.f,d.H)},6417:(e,a,o)=>{o.d(a,{f:()=>l,z:()=>s});var d=o(1e3),t=o(4447),n=o(2061),i=o(4567),r=o(4201);const l=(0,i.iY)("text-field"),c=["type"],s=(0,n.qC)((0,d.yk)({mappings:t.Z}),d.e4,(0,d.dj)({proxyProps:["value","selectionStart"]}),d.Ae,(e=>class extends e{static get observedAttributes(){return c.concat(e.observedAttributes||[])}attributeChangedCallback(e,a,o){super.attributeChangeCallback?.(e,a,o),"type"===e&&this.baseElement._setType(o)}}))((0,d.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${s.cssVarList.inputOutlineWidth}) + var(${s.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,r.Wf)("vaadin-text-field")}\n\t\t\t${(0,r.bi)(s.cssVarList)}\n\t\t\t${(0,r.wm)("vaadin-text-field",s.cssVarList)}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},9357:(e,a,o)=>{o.r(a),o.d(a,{TextFieldClass:()=>d.z}),o(9789);var d=o(6417);customElements.define(d.f,d.z)},7262:(e,a,o)=>{o.d(a,{Z:()=>d});const d=[{name:"United States",dialCode:"+1",code:"US"},...[{name:"Afghanistan",dialCode:"+93",code:"AF"},{name:"Aland Islands",dialCode:"+358",code:"AX"},{name:"Albania",dialCode:"+355",code:"AL"},{name:"Algeria",dialCode:"+213",code:"DZ"},{name:"AmericanSamoa",dialCode:"+1684",code:"AS"},{name:"Andorra",dialCode:"+376",code:"AD"},{name:"Angola",dialCode:"+244",code:"AO"},{name:"Anguilla",dialCode:"+1264",code:"AI"},{name:"Antarctica",dialCode:"+672",code:"AQ"},{name:"Antigua and Barbuda",dialCode:"+1268",code:"AG"},{name:"Argentina",dialCode:"+54",code:"AR"},{name:"Armenia",dialCode:"+374",code:"AM"},{name:"Aruba",dialCode:"+297",code:"AW"},{name:"Australia",dialCode:"+61",code:"AU"},{name:"Austria",dialCode:"+43",code:"AT"},{name:"Azerbaijan",dialCode:"+994",code:"AZ"},{name:"Bahamas",dialCode:"+1242",code:"BS"},{name:"Bahrain",dialCode:"+973",code:"BH"},{name:"Bangladesh",dialCode:"+880",code:"BD"},{name:"Barbados",dialCode:"+1246",code:"BB"},{name:"Belarus",dialCode:"+375",code:"BY"},{name:"Belgium",dialCode:"+32",code:"BE"},{name:"Belize",dialCode:"+501",code:"BZ"},{name:"Benin",dialCode:"+229",code:"BJ"},{name:"Bermuda",dialCode:"+1441",code:"BM"},{name:"Bhutan",dialCode:"+975",code:"BT"},{name:"Bolivia, Plurinational State of",dialCode:"+591",code:"BO"},{name:"Bosnia and Herzegovina",dialCode:"+387",code:"BA"},{name:"Botswana",dialCode:"+267",code:"BW"},{name:"Brazil",dialCode:"+55",code:"BR"},{name:"British Indian Ocean Territory",dialCode:"+246",code:"IO"},{name:"Brunei Darussalam",dialCode:"+673",code:"BN"},{name:"Bulgaria",dialCode:"+359",code:"BG"},{name:"Burkina Faso",dialCode:"+226",code:"BF"},{name:"Burundi",dialCode:"+257",code:"BI"},{name:"Cambodia",dialCode:"+855",code:"KH"},{name:"Cameroon",dialCode:"+237",code:"CM"},{name:"Canada",dialCode:"+1",code:"CA"},{name:"Cape Verde",dialCode:"+238",code:"CV"},{name:"Cayman Islands",dialCode:"+345",code:"KY"},{name:"Central African Republic",dialCode:"+236",code:"CF"},{name:"Chad",dialCode:"+235",code:"TD"},{name:"Chile",dialCode:"+56",code:"CL"},{name:"China",dialCode:"+86",code:"CN"},{name:"Christmas Island",dialCode:"+61",code:"CX"},{name:"Cocos (Keeling) Islands",dialCode:"+61",code:"CC"},{name:"Colombia",dialCode:"+57",code:"CO"},{name:"Comoros",dialCode:"+269",code:"KM"},{name:"Congo",dialCode:"+242",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dialCode:"+243",code:"CD"},{name:"Cook Islands",dialCode:"+682",code:"CK"},{name:"Costa Rica",dialCode:"+506",code:"CR"},{name:"Cote d'Ivoire",dialCode:"+225",code:"CI"},{name:"Croatia",dialCode:"+385",code:"HR"},{name:"Cuba",dialCode:"+53",code:"CU"},{name:"Cyprus",dialCode:"+357",code:"CY"},{name:"Czech Republic",dialCode:"+420",code:"CZ"},{name:"Denmark",dialCode:"+45",code:"DK"},{name:"Djibouti",dialCode:"+253",code:"DJ"},{name:"Dominica",dialCode:"+1767",code:"DM"},{name:"Dominican Republic",dialCode:"+1849",code:"DO"},{name:"Ecuador",dialCode:"+593",code:"EC"},{name:"Egypt",dialCode:"+20",code:"EG"},{name:"El Salvador",dialCode:"+503",code:"SV"},{name:"Equatorial Guinea",dialCode:"+240",code:"GQ"},{name:"Eritrea",dialCode:"+291",code:"ER"},{name:"Estonia",dialCode:"+372",code:"EE"},{name:"Ethiopia",dialCode:"+251",code:"ET"},{name:"Falkland Islands (Malvinas)",dialCode:"+500",code:"FK"},{name:"Faroe Islands",dialCode:"+298",code:"FO"},{name:"Fiji",dialCode:"+679",code:"FJ"},{name:"Finland",dialCode:"+358",code:"FI"},{name:"France",dialCode:"+33",code:"FR"},{name:"French Guiana",dialCode:"+594",code:"GF"},{name:"French Polynesia",dialCode:"+689",code:"PF"},{name:"Gabon",dialCode:"+241",code:"GA"},{name:"Gambia",dialCode:"+220",code:"GM"},{name:"Georgia",dialCode:"+995",code:"GE"},{name:"Germany",dialCode:"+49",code:"DE"},{name:"Ghana",dialCode:"+233",code:"GH"},{name:"Gibraltar",dialCode:"+350",code:"GI"},{name:"Greece",dialCode:"+30",code:"GR"},{name:"Greenland",dialCode:"+299",code:"GL"},{name:"Grenada",dialCode:"+1473",code:"GD"},{name:"Guadeloupe",dialCode:"+590",code:"GP"},{name:"Guam",dialCode:"+1671",code:"GU"},{name:"Guatemala",dialCode:"+502",code:"GT"},{name:"Guernsey",dialCode:"+44",code:"GG"},{name:"Guinea",dialCode:"+224",code:"GN"},{name:"Guinea-Bissau",dialCode:"+245",code:"GW"},{name:"Guyana",dialCode:"+595",code:"GY"},{name:"Haiti",dialCode:"+509",code:"HT"},{name:"Holy See (Vatican City State)",dialCode:"+379",code:"VA"},{name:"Honduras",dialCode:"+504",code:"HN"},{name:"Hong Kong",dialCode:"+852",code:"HK"},{name:"Hungary",dialCode:"+36",code:"HU"},{name:"Iceland",dialCode:"+354",code:"IS"},{name:"India",dialCode:"+91",code:"IN"},{name:"Indonesia",dialCode:"+62",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dialCode:"+98",code:"IR"},{name:"Iraq",dialCode:"+964",code:"IQ"},{name:"Ireland",dialCode:"+353",code:"IE"},{name:"Isle of Man",dialCode:"+44",code:"IM"},{name:"Israel",dialCode:"+972",code:"IL"},{name:"Italy",dialCode:"+39",code:"IT"},{name:"Jamaica",dialCode:"+1876",code:"JM"},{name:"Japan",dialCode:"+81",code:"JP"},{name:"Jersey",dialCode:"+44",code:"JE"},{name:"Jordan",dialCode:"+962",code:"JO"},{name:"Kazakhstan",dialCode:"+77",code:"KZ"},{name:"Kenya",dialCode:"+254",code:"KE"},{name:"Kiribati",dialCode:"+686",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dialCode:"+850",code:"KP"},{name:"Korea, Republic of South Korea",dialCode:"+82",code:"KR"},{name:"Kuwait",dialCode:"+965",code:"KW"},{name:"Kyrgyzstan",dialCode:"+996",code:"KG"},{name:"Laos",dialCode:"+856",code:"LA"},{name:"Latvia",dialCode:"+371",code:"LV"},{name:"Lebanon",dialCode:"+961",code:"LB"},{name:"Lesotho",dialCode:"+266",code:"LS"},{name:"Liberia",dialCode:"+231",code:"LR"},{name:"Libyan Arab Jamahiriya",dialCode:"+218",code:"LY"},{name:"Liechtenstein",dialCode:"+423",code:"LI"},{name:"Lithuania",dialCode:"+370",code:"LT"},{name:"Luxembourg",dialCode:"+352",code:"LU"},{name:"Macao",dialCode:"+853",code:"MO"},{name:"Macedonia",dialCode:"+389",code:"MK"},{name:"Madagascar",dialCode:"+261",code:"MG"},{name:"Malawi",dialCode:"+265",code:"MW"},{name:"Malaysia",dialCode:"+60",code:"MY"},{name:"Maldives",dialCode:"+960",code:"MV"},{name:"Mali",dialCode:"+223",code:"ML"},{name:"Malta",dialCode:"+356",code:"MT"},{name:"Marshall Islands",dialCode:"+692",code:"MH"},{name:"Martinique",dialCode:"+596",code:"MQ"},{name:"Mauritania",dialCode:"+222",code:"MR"},{name:"Mauritius",dialCode:"+230",code:"MU"},{name:"Mayotte",dialCode:"+262",code:"YT"},{name:"Mexico",dialCode:"+52",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dialCode:"+691",code:"FM"},{name:"Moldova",dialCode:"+373",code:"MD"},{name:"Monaco",dialCode:"+377",code:"MC"},{name:"Mongolia",dialCode:"+976",code:"MN"},{name:"Montenegro",dialCode:"+382",code:"ME"},{name:"Montserrat",dialCode:"+1664",code:"MS"},{name:"Morocco",dialCode:"+212",code:"MA"},{name:"Mozambique",dialCode:"+258",code:"MZ"},{name:"Myanmar",dialCode:"+95",code:"MM"},{name:"Namibia",dialCode:"+264",code:"NA"},{name:"Nauru",dialCode:"+674",code:"NR"},{name:"Nepal",dialCode:"+977",code:"NP"},{name:"Netherlands",dialCode:"+31",code:"NL"},{name:"Netherlands Antilles",dialCode:"+599",code:"AN"},{name:"New Caledonia",dialCode:"+687",code:"NC"},{name:"New Zealand",dialCode:"+64",code:"NZ"},{name:"Nicaragua",dialCode:"+505",code:"NI"},{name:"Niger",dialCode:"+227",code:"NE"},{name:"Nigeria",dialCode:"+234",code:"NG"},{name:"Niue",dialCode:"+683",code:"NU"},{name:"Norfolk Island",dialCode:"+672",code:"NF"},{name:"Northern Mariana Islands",dialCode:"+1670",code:"MP"},{name:"Norway",dialCode:"+47",code:"NO"},{name:"Oman",dialCode:"+968",code:"OM"},{name:"Pakistan",dialCode:"+92",code:"PK"},{name:"Palau",dialCode:"+680",code:"PW"},{name:"Palestinian Territory, Occupied",dialCode:"+970",code:"PS"},{name:"Panama",dialCode:"+507",code:"PA"},{name:"Papua New Guinea",dialCode:"+675",code:"PG"},{name:"Paraguay",dialCode:"+595",code:"PY"},{name:"Peru",dialCode:"+51",code:"PE"},{name:"Philippines",dialCode:"+63",code:"PH"},{name:"Pitcairn",dialCode:"+872",code:"PN"},{name:"Poland",dialCode:"+48",code:"PL"},{name:"Portugal",dialCode:"+351",code:"PT"},{name:"Puerto Rico",dialCode:"+1939",code:"PR"},{name:"Qatar",dialCode:"+974",code:"QA"},{name:"Romania",dialCode:"+40",code:"RO"},{name:"Russia",dialCode:"+7",code:"RU"},{name:"Rwanda",dialCode:"+250",code:"RW"},{name:"Reunion",dialCode:"+262",code:"RE"},{name:"Saint Barthelemy",dialCode:"+590",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dialCode:"+290",code:"SH"},{name:"Saint Kitts and Nevis",dialCode:"+1869",code:"KN"},{name:"Saint Lucia",dialCode:"+1758",code:"LC"},{name:"Saint Martin",dialCode:"+590",code:"MF"},{name:"Saint Pierre and Miquelon",dialCode:"+508",code:"PM"},{name:"Saint Vincent and the Grenadines",dialCode:"+1784",code:"VC"},{name:"Samoa",dialCode:"+685",code:"WS"},{name:"San Marino",dialCode:"+378",code:"SM"},{name:"Sao Tome and Principe",dialCode:"+239",code:"ST"},{name:"Saudi Arabia",dialCode:"+966",code:"SA"},{name:"Senegal",dialCode:"+221",code:"SN"},{name:"Serbia",dialCode:"+381",code:"RS"},{name:"Seychelles",dialCode:"+248",code:"SC"},{name:"Sierra Leone",dialCode:"+232",code:"SL"},{name:"Singapore",dialCode:"+65",code:"SG"},{name:"Slovakia",dialCode:"+421",code:"SK"},{name:"Slovenia",dialCode:"+386",code:"SI"},{name:"Solomon Islands",dialCode:"+677",code:"SB"},{name:"Somalia",dialCode:"+252",code:"SO"},{name:"South Africa",dialCode:"+27",code:"ZA"},{name:"South Sudan",dialCode:"+211",code:"SS"},{name:"South Georgia and the South Sandwich Islands",dialCode:"+500",code:"GS"},{name:"Spain",dialCode:"+34",code:"ES"},{name:"Sri Lanka",dialCode:"+94",code:"LK"},{name:"Sudan",dialCode:"+249",code:"SD"},{name:"Suriname",dialCode:"+597",code:"SR"},{name:"Svalbard and Jan Mayen",dialCode:"+47",code:"SJ"},{name:"Swaziland",dialCode:"+268",code:"SZ"},{name:"Sweden",dialCode:"+46",code:"SE"},{name:"Switzerland",dialCode:"+41",code:"CH"},{name:"Syrian Arab Republic",dialCode:"+963",code:"SY"},{name:"Taiwan",dialCode:"+886",code:"TW"},{name:"Tajikistan",dialCode:"+992",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dialCode:"+255",code:"TZ"},{name:"Thailand",dialCode:"+66",code:"TH"},{name:"Timor-Leste",dialCode:"+670",code:"TL"},{name:"Togo",dialCode:"+228",code:"TG"},{name:"Tokelau",dialCode:"+690",code:"TK"},{name:"Tonga",dialCode:"+676",code:"TO"},{name:"Trinidad and Tobago",dialCode:"+1868",code:"TT"},{name:"Tunisia",dialCode:"+216",code:"TN"},{name:"Turkey",dialCode:"+90",code:"TR"},{name:"Turkmenistan",dialCode:"+993",code:"TM"},{name:"Turks and Caicos Islands",dialCode:"+1649",code:"TC"},{name:"Tuvalu",dialCode:"+688",code:"TV"},{name:"Uganda",dialCode:"+256",code:"UG"},{name:"Ukraine",dialCode:"+380",code:"UA"},{name:"United Arab Emirates",dialCode:"+971",code:"AE"},{name:"United Kingdom",dialCode:"+44",code:"GB"},{name:"Uruguay",dialCode:"+598",code:"UY"},{name:"Uzbekistan",dialCode:"+998",code:"UZ"},{name:"Vanuatu",dialCode:"+678",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dialCode:"+58",code:"VE"},{name:"Vietnam",dialCode:"+84",code:"VN"},{name:"Virgin Islands, British",dialCode:"+1284",code:"VG"},{name:"Virgin Islands, U.S.",dialCode:"+1340",code:"VI"},{name:"Wallis and Futuna",dialCode:"+681",code:"WF"},{name:"Yemen",dialCode:"+967",code:"YE"},{name:"Zambia",dialCode:"+260",code:"ZM"},{name:"Zimbabwe",dialCode:"+263",code:"ZW"}].sort(((e,a)=>e.name<a.name?-1:1))]},2246:(e,a,o)=>{o.d(a,{f:()=>r,Z:()=>p});var d=o(3878),t=o(4567),n=o(7262);const i=({code:e,dialCode:a,name:o})=>`\n\t<div\n\t\tstyle="display:flex; flex-direction: column;"\n\t\tdata-id="${a}"\n\t\tdata-name="${e} ${a} ${o}"\n\t\tdata-country-code="${e}"\n\t>\n\t\t<div>\n\t\t\t<span>\n\t\t\t\t<img src="${(e=>`https://static.descope.com/npm/svg-country-flags@1.2.10/svg/${e.toLowerCase()}.svg`)(e)}" width="20"/>\n\t\t\t</span>\n\t\t\t<span>${o}</span>\n\t\t</div>\n\t\t<div>\n\t\t\t<span>${e}</span>\n\t\t\t<span>${a}</span>\n\t\t</div>\n\t</div>\n`,r=(0,t.iY)("phone-field-internal"),l=["disabled","size","bordered","invalid","readonly"],c=["country-input-placeholder","default-code","restrict-countries"],s=["phone-input-placeholder","maxlength"],m={"country-input-placeholder":"placeholder","phone-input-placeholder":"placeholder"},u=[].concat(l,c,s),C=(0,d.P)({componentName:r,baseSelector:"div"}),p=class extends C{static get observedAttributes(){return[].concat(C.observedAttributes||[],u)}constructor(){super(),this.innerHTML=`\n <div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n >\n ${n.Z.map((e=>i(e))).join("")}\n </descope-combo-box>\n <div class="separator"></div>\n <descope-text-field type="tel"></descope-text-field>\n </div>\n `,this.countryCodeInput=this.querySelector("descope-combo-box"),this.phoneNumberInput=this.querySelector("descope-text-field"),this.inputs=[this.countryCodeInput,this.phoneNumberInput],this.countryCodeInput.customValueTransformFn=e=>{const[,a]=e?.split?.(" ")||[];return a}}get value(){return this.phoneNumberValue?`${this.countryCodeInput.value}-${this.phoneNumberInput.value}`:""}set value(e){const[a="",o=""]=e.split("-");if(a){const e=this.getCountryByDialCode(a);e&&(this.countryCodeInput.selectedItem=e)}else this.countryCodeInput.selectedItem=void 0;this.phoneNumberInput.value=o}get phoneNumberValue(){return this.phoneNumberInput.value}get countryCodeValue(){return this.countryCodeInput.shadowRoot.querySelector("input").value}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}getValidity(){const e=this.countryCodeInput.value,a=this.phoneNumberInput.value,o=!e||!a,d=this.phoneNumberInput.value?.length&&this.phoneNumberInput.value.length<this.minLength;return this.isRequired&&o?{valueMissing:!0}:d?{tooShort:!0}:a&&!e?{valueMissing:!0}:{}}init(){this.addEventListener("focus",(e=>{e.isTrusted&&this.inputs[1].focus()})),super.init?.(),this.initInputs()}getRestrictedCountries(){return this.getAttribute("restrict-countries")?.split(",")||[]}getCountryByDialCode(e){return this.countryCodeInput.items?.find((a=>a.getAttribute("data-id")===e))}getCountryByCodeId(e){return this.countryCodeInput.items?.find((a=>a.getAttribute("data-country-code")===e))}updateCountryCodeItems(e){const a=e.length?n.Z.filter((a=>e.includes(a.code))):n.Z;this.querySelector("descope-combo-box").innerHTML=a.map((e=>i(e))).join("")}handleDefaultCountryCode(e){if(!this.countryCodeInput.value){const a=this.getCountryByCodeId(e);a&&setTimeout((()=>{this.countryCodeInput.selectedItem=a}))}}initInputs(){this.phoneNumberInput.addEventListener("input",(e=>{const a=/^\d$/,o=e.target.value.split("").filter((e=>a.test(e))).join("");e.target.value=o})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(e,a,o){if(super.attributeChangedCallback(e,a,o),a!==o){if("default-code"===e&&o)this.handleDefaultCountryCode(o);else if(u.includes(e)){const a=m[e]||e;l.includes(e)?this.inputs.forEach((e=>e.setAttribute(a,o))):c.includes(e)?this.countryCodeInput.setAttribute(a,o):s.includes(e)&&this.phoneNumberInput.setAttribute(a,o)}"restrict-countries"===e&&this.updateCountryCodeItems(this.getRestrictedCountries())}}}},9240:(e,a,o)=>{o.r(a),o(1294),o(9357);var d=o(2246);customElements.define(d.f,d.Z)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9806,9288],{2246:(t,e,n)=>{n.d(e,{f:()=>d,Z:()=>y});var o=n(3878),r=n(4567),i=n(7262);const s=({code:t,dialCode:e,name:n})=>`\n\t<div\n\t\tstyle="display:flex; flex-direction: column;"\n\t\tdata-id="${e}"\n\t\tdata-name="${t} ${e} ${n}"\n\t\tdata-country-code="${t}"\n\t>\n\t\t<div>\n\t\t\t<span>\n\t\t\t\t<img src="${(t=>`https://static.descope.com/npm/svg-country-flags@1.2.10/svg/${t.toLowerCase()}.svg`)(t)}" width="20"/>\n\t\t\t</span>\n\t\t\t<span>${n}</span>\n\t\t</div>\n\t\t<div>\n\t\t\t<span>${t}</span>\n\t\t\t<span>${e}</span>\n\t\t</div>\n\t</div>\n`,d=(0,r.iY)("phone-field-internal"),p=["disabled","size","bordered","invalid","readonly"],l=["country-input-placeholder","default-code","restrict-countries"],u=["phone-input-placeholder","maxlength"],a={"country-input-placeholder":"placeholder","phone-input-placeholder":"placeholder"},c=[].concat(p,l,u),h=(0,o.P)({componentName:d,baseSelector:"div"}),y=class extends h{static get observedAttributes(){return[].concat(h.observedAttributes||[],c)}constructor(){super(),this.innerHTML=`\n <div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n >\n ${i.Z.map((t=>s(t))).join("")}\n </descope-combo-box>\n <div class="separator"></div>\n <descope-text-field type="tel"></descope-text-field>\n </div>\n `,this.countryCodeInput=this.querySelector("descope-combo-box"),this.phoneNumberInput=this.querySelector("descope-text-field"),this.inputs=[this.countryCodeInput,this.phoneNumberInput],this.countryCodeInput.customValueTransformFn=t=>{const[,e]=t?.split?.(" ")||[];return e}}get value(){return this.phoneNumberValue?`${this.countryCodeInput.value}-${this.phoneNumberInput.value}`:""}set value(t){const[e="",n=""]=t.split("-");if(e){const t=this.getCountryByDialCode(e);t&&(this.countryCodeInput.selectedItem=t)}else this.countryCodeInput.selectedItem=void 0;this.phoneNumberInput.value=n}get phoneNumberValue(){return this.phoneNumberInput.value}get countryCodeValue(){return this.countryCodeInput.shadowRoot.querySelector("input").value}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}getValidity(){const t=this.countryCodeInput.value,e=this.phoneNumberInput.value,n=!t||!e,o=this.phoneNumberInput.value?.length&&this.phoneNumberInput.value.length<this.minLength;return this.isRequired&&n?{valueMissing:!0}:o?{tooShort:!0}:e&&!t?{valueMissing:!0}:{}}init(){this.addEventListener("focus",(t=>{t.isTrusted&&this.inputs[1].focus()})),super.init?.(),this.initInputs()}getRestrictedCountries(){return this.getAttribute("restrict-countries")?.split(",")||[]}getCountryByDialCode(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-id")===t))}getCountryByCodeId(t){return this.countryCodeInput.items?.find((e=>e.getAttribute("data-country-code")===t))}updateCountryCodeItems(t){const e=t.length?i.Z.filter((e=>t.includes(e.code))):i.Z;this.querySelector("descope-combo-box").innerHTML=e.map((t=>s(t))).join("")}handleDefaultCountryCode(t){if(!this.countryCodeInput.value){const e=this.getCountryByCodeId(t);e&&setTimeout((()=>{this.countryCodeInput.selectedItem=e}))}}initInputs(){this.phoneNumberInput.addEventListener("input",(t=>{const e=/^\d$/,n=t.target.value.split("").filter((t=>e.test(t))).join("");t.target.value=n})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(t,e,n){if(super.attributeChangedCallback(t,e,n),e!==n){if("default-code"===t&&n)this.handleDefaultCountryCode(n);else if(c.includes(t)){const e=a[t]||t;p.includes(t)?this.inputs.forEach((t=>t.setAttribute(e,n))):l.includes(t)?this.countryCodeInput.setAttribute(e,n):u.includes(t)&&this.phoneNumberInput.setAttribute(e,n)}"restrict-countries"===t&&this.updateCountryCodeItems(this.getRestrictedCountries())}}}},9240:(t,e,n)=>{n.r(e),n(1294),n(9357);var o=n(2246);customElements.define(o.f,o.Z)},6581:(t,e,n)=>{n.r(e),n.d(e,{PhoneFieldClass:()=>$}),n(9240),n(1294),n(9357);var o=n(2246),r=n(4567),i=n(2061),s=n(1e3),d=n(6417),p=n(4049),l=n(7262),u=n(4201);const a=d.z.cssVarList,c=p.H.cssVarList,h=(0,r.iY)("phone-field"),{host:y,label:f,requiredIndicator:b,inputField:m,countryCodeInput:v,phoneInput:C,separator:g,errorMessage:x,helperText:I}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:"::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},countryCodeInput:{selector:()=>"descope-combo-box"},separator:{selector:"descope-phone-field-internal .separator"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},$=(0,i.qC)((0,s.yk)({mappings:{fontSize:[y,m,{selector:d.z.componentName,property:d.z.cssVarList.fontSize},{selector:p.H.componentName,property:p.H.cssVarList.fontSize}],fontFamily:[f,x,I,{...v,property:p.H.cssVarList.overlay.fontFamily}],hostWidth:[{...y,property:"width"},{...C,property:"width"},{...v,property:"--vaadin-combo-box-overlay-width"}],hostDirection:{...y,property:"direction"},inputBorderStyle:[{...m,property:"border-style"},{...g,property:"border-left-style"}],inputBorderWidth:[{...m,property:"border-width"},{...g,property:"border-left-width"}],inputBorderColor:[{...m,property:"border-color"},{...g,property:"border-left-color"}],inputBorderRadius:{...m,property:"border-radius"},countryCodeInputWidth:{...v,property:c.hostWidth},countryCodeDropdownWidth:{...v,property:"--vaadin-combo-box-overlay-width"},phoneInputWidth:{...C,property:"width"},labelTextColor:[{...f,property:"color"},{...b,property:"color"}],labelRequiredIndicator:{...b,property:"content"},errorMessageTextColor:{...x,property:"color"},inputValueTextColor:[{...C,property:a.inputValueTextColor},{...v,property:c.inputValueTextColor}],inputPlaceholderTextColor:{...C,property:a.inputPlaceholderColor},overlayItemBackgroundColor:{selector:"descope-combo-box",property:c.overlayItemBackgroundColor},inputOutlineStyle:{...m,property:"outline-style"},inputOutlineColor:{...m,property:"outline-color"},inputOutlineWidth:{...m,property:"outline-width"},inputOutlineOffset:{...m,property:"outline-offset"}}}),s.e4,(0,s.dj)({proxyProps:["value","selectionStart"]}),(t=>class extends t{static get CountryCodes(){return l.Z}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.f}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.f}>\n \t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),(0,r.oP)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","country-input-placeholder","phone-input-placeholder","disabled","restrict-countries"]})}}))((0,s.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 15em;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\t${(0,u.bi)($.cssVarList)}\n\t\t\t${(0,u.Pd)("vaadin-text-field")}\n\t\t\t${(0,u.B)("vaadin-text-field")}\n\t\t\t${(0,u.DY)()}\n\n\t\t\tdiv {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\tvaadin-text-field {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-text-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t\tvaadin-text-field::before {\n\t\t\t\theight: 0;\n\t\t\t}\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\tdescope-phone-field-internal {\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n direction: ltr;\n\t\t\t}\n\t\t\tdescope-phone-field-internal > div {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t\t\tdescope-phone-field-internal .separator {\n\t\t\t\tflex: 0;\n\t\t\t\tborder: none;\n\t\t\t}\n\t\t\tdescope-combo-box {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tmin-width: 5.75em;\n\t\t\t\t${c.inputOutlineWidth}: 0;\n\t\t\t\t${c.inputOutlineOffset}: 0;\n\t\t\t\t${c.inputBorderWidth}: 0;\n\t\t\t\t${c.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tdescope-text-field {\n\t\t\t\tflex-grow: 1;\n\t\t\t\t${a.inputOutlineWidth}: 0;\n\t\t\t\t${a.inputOutlineOffset}: 0;\n\t\t\t\t${a.inputBorderWidth}: 0;\n\t\t\t\t${a.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tvaadin-text-field::part(input-field)::after {\n\t\t\t\tborder: none;\n\t\t\t}\n ${(0,u.Wf)("vaadin-text-field")}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:h}));customElements.define(h,$)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9806,9483,2934,9288],{4049:(e,t,a)=>{a.d(t,{H:()=>g,f:()=>r});var o=a(2061),d=a(4567),n=a(4201),i=a(1e3);const r=(0,d.iY)("combo-box"),{host:l,inputField:s,inputElement:c,placeholder:m,toggle:u,clearButton:p,label:C,requiredIndicator:h,helperText:b,errorMessage:y}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},g=(0,o.qC)((0,i.yk)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[C,m,s,b,y],labelTextColor:[{...C,property:"color"},{...h,property:"color"}],errorMessageTextColor:{...y,property:"color"},inputHeight:{...s,property:"height"},inputBackgroundColor:{...s,property:"background-color"},inputBorderColor:{...s,property:"border-color"},inputBorderWidth:{...s,property:"border-width"},inputBorderStyle:{...s,property:"border-style"},inputBorderRadius:{...s,property:"border-radius"},labelRequiredIndicator:{...h,property:"content"},inputValueTextColor:{...s,property:"color"},inputPlaceholderTextColor:{...m,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...p,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...p,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...p,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,property:"margin-left"}],inputOutlineColor:{...s,property:"outline-color"},inputOutlineWidth:{...s,property:"outline-width"},inputOutlineStyle:{...s,property:"outline-style"},inputOutlineOffset:{...s,property:"outline-offset"},inputHorizontalPadding:[{...c,property:"padding-left"},{...c,property:"padding-right"}],overlayBackground:{property:()=>g.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>g.cssVarList.overlay.textColor},overlayBorder:{property:()=>g.cssVarList.overlay.border},overlayFontSize:{property:()=>g.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>g.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>g.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>g.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>g.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>g.cssVarList.overlay.itemPaddingInlineEnd}}}),i.e4,(0,i.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,i.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),i.Ae,(e=>class extends e{#e=({displayName:e,value:t,label:a})=>`<span data-name="${a}" data-id="${t}">${e||a}</span>`;#t;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}get data(){if(this.#t)return this.#t;const e=this.getAttribute("data");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "data" -',e.message)}return[]}set data(e){this.isValidDataType(e)&&(this.#t=e,this.renderItems())}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.(((e,t)=>e+(this.renderItem?.(t||{})||"")),"")}renderItems(){const e=this.getItemsTemplate();e&&(this.innerHTML=e)}handleSelectedItem(){const e=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,e&&(this.value=e),this.value||this.setDefaultValue()}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),t=this;Object.defineProperties(this.inputElement,{value:{...e,set(a){if(!t.baseElement.items?.length)return;const o=t.customValueTransformFn(a)||"";o!==this.value&&e.set.call(this,o)}}})}#a(){const e=this.shadowRoot.querySelector(this.baseSelector),t=Array.from(this.children);t.length&&(t.forEach((e=>{Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(e,"data-id",{value:e.getAttribute("data-id"),configurable:!0,writable:!0})})),e.items=t,setTimeout((()=>{this.handleSelectedItem()}),0)),e.renderer=(e,t,a)=>{e.innerHTML=a.item.outerHTML}}#o(){const e=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#o(),this.renderItems(),(0,d.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,d.P$)(this,this.#a.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}setDefaultValue(){this.value=this.defaultValue}set value(e){if(e){const t=this.baseElement.items?.find((t=>t["data-id"]===e));t&&(this.baseElement.selectedItem=t)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((0,i.DM)({slots:["","prefix"],wrappedEleName:"vaadin-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,n.bi)(g.cssVarList)}\n\t\t${(0,n.PH)("vaadin-combo-box")}\n\t\t${(0,n.jI)("vaadin-combo-box")}\n\t\t${(0,n.Pd)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,n.Wf)("vaadin-combo-box")}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:r,includeForwardProps:["items","renderer","selectedItem"]}))},1294:(e,t,a)=>{a.r(t),a.d(t,{ComboBoxClass:()=>o.H}),a(7583);var o=a(4049);customElements.define(o.f,o.H)},6417:(e,t,a)=>{a.d(t,{f:()=>l,z:()=>c});var o=a(1e3),d=a(4447),n=a(2061),i=a(4567),r=a(4201);const l=(0,i.iY)("text-field"),s=["type"],c=(0,n.qC)((0,o.yk)({mappings:d.Z}),o.e4,(0,o.dj)({proxyProps:["value","selectionStart"]}),o.Ae,(e=>class extends e{static get observedAttributes(){return s.concat(e.observedAttributes||[])}attributeChangedCallback(e,t,a){super.attributeChangeCallback?.(e,t,a),"type"===e&&this.baseElement._setType(a)}}))((0,o.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${c.cssVarList.inputOutlineWidth}) + var(${c.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,r.Wf)("vaadin-text-field")}\n\t\t\t${(0,r.bi)(c.cssVarList)}\n\t\t\t${(0,r.wm)("vaadin-text-field",c.cssVarList)}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},9357:(e,t,a)=>{a.r(t),a.d(t,{TextFieldClass:()=>o.z}),a(9789);var o=a(6417);customElements.define(o.f,o.z)},7262:(e,t,a)=>{a.d(t,{Z:()=>o});const o=[{name:"United States",dialCode:"+1",code:"US"},...[{name:"Afghanistan",dialCode:"+93",code:"AF"},{name:"Aland Islands",dialCode:"+358",code:"AX"},{name:"Albania",dialCode:"+355",code:"AL"},{name:"Algeria",dialCode:"+213",code:"DZ"},{name:"AmericanSamoa",dialCode:"+1684",code:"AS"},{name:"Andorra",dialCode:"+376",code:"AD"},{name:"Angola",dialCode:"+244",code:"AO"},{name:"Anguilla",dialCode:"+1264",code:"AI"},{name:"Antarctica",dialCode:"+672",code:"AQ"},{name:"Antigua and Barbuda",dialCode:"+1268",code:"AG"},{name:"Argentina",dialCode:"+54",code:"AR"},{name:"Armenia",dialCode:"+374",code:"AM"},{name:"Aruba",dialCode:"+297",code:"AW"},{name:"Australia",dialCode:"+61",code:"AU"},{name:"Austria",dialCode:"+43",code:"AT"},{name:"Azerbaijan",dialCode:"+994",code:"AZ"},{name:"Bahamas",dialCode:"+1242",code:"BS"},{name:"Bahrain",dialCode:"+973",code:"BH"},{name:"Bangladesh",dialCode:"+880",code:"BD"},{name:"Barbados",dialCode:"+1246",code:"BB"},{name:"Belarus",dialCode:"+375",code:"BY"},{name:"Belgium",dialCode:"+32",code:"BE"},{name:"Belize",dialCode:"+501",code:"BZ"},{name:"Benin",dialCode:"+229",code:"BJ"},{name:"Bermuda",dialCode:"+1441",code:"BM"},{name:"Bhutan",dialCode:"+975",code:"BT"},{name:"Bolivia, Plurinational State of",dialCode:"+591",code:"BO"},{name:"Bosnia and Herzegovina",dialCode:"+387",code:"BA"},{name:"Botswana",dialCode:"+267",code:"BW"},{name:"Brazil",dialCode:"+55",code:"BR"},{name:"British Indian Ocean Territory",dialCode:"+246",code:"IO"},{name:"Brunei Darussalam",dialCode:"+673",code:"BN"},{name:"Bulgaria",dialCode:"+359",code:"BG"},{name:"Burkina Faso",dialCode:"+226",code:"BF"},{name:"Burundi",dialCode:"+257",code:"BI"},{name:"Cambodia",dialCode:"+855",code:"KH"},{name:"Cameroon",dialCode:"+237",code:"CM"},{name:"Canada",dialCode:"+1",code:"CA"},{name:"Cape Verde",dialCode:"+238",code:"CV"},{name:"Cayman Islands",dialCode:"+345",code:"KY"},{name:"Central African Republic",dialCode:"+236",code:"CF"},{name:"Chad",dialCode:"+235",code:"TD"},{name:"Chile",dialCode:"+56",code:"CL"},{name:"China",dialCode:"+86",code:"CN"},{name:"Christmas Island",dialCode:"+61",code:"CX"},{name:"Cocos (Keeling) Islands",dialCode:"+61",code:"CC"},{name:"Colombia",dialCode:"+57",code:"CO"},{name:"Comoros",dialCode:"+269",code:"KM"},{name:"Congo",dialCode:"+242",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dialCode:"+243",code:"CD"},{name:"Cook Islands",dialCode:"+682",code:"CK"},{name:"Costa Rica",dialCode:"+506",code:"CR"},{name:"Cote d'Ivoire",dialCode:"+225",code:"CI"},{name:"Croatia",dialCode:"+385",code:"HR"},{name:"Cuba",dialCode:"+53",code:"CU"},{name:"Cyprus",dialCode:"+357",code:"CY"},{name:"Czech Republic",dialCode:"+420",code:"CZ"},{name:"Denmark",dialCode:"+45",code:"DK"},{name:"Djibouti",dialCode:"+253",code:"DJ"},{name:"Dominica",dialCode:"+1767",code:"DM"},{name:"Dominican Republic",dialCode:"+1849",code:"DO"},{name:"Ecuador",dialCode:"+593",code:"EC"},{name:"Egypt",dialCode:"+20",code:"EG"},{name:"El Salvador",dialCode:"+503",code:"SV"},{name:"Equatorial Guinea",dialCode:"+240",code:"GQ"},{name:"Eritrea",dialCode:"+291",code:"ER"},{name:"Estonia",dialCode:"+372",code:"EE"},{name:"Ethiopia",dialCode:"+251",code:"ET"},{name:"Falkland Islands (Malvinas)",dialCode:"+500",code:"FK"},{name:"Faroe Islands",dialCode:"+298",code:"FO"},{name:"Fiji",dialCode:"+679",code:"FJ"},{name:"Finland",dialCode:"+358",code:"FI"},{name:"France",dialCode:"+33",code:"FR"},{name:"French Guiana",dialCode:"+594",code:"GF"},{name:"French Polynesia",dialCode:"+689",code:"PF"},{name:"Gabon",dialCode:"+241",code:"GA"},{name:"Gambia",dialCode:"+220",code:"GM"},{name:"Georgia",dialCode:"+995",code:"GE"},{name:"Germany",dialCode:"+49",code:"DE"},{name:"Ghana",dialCode:"+233",code:"GH"},{name:"Gibraltar",dialCode:"+350",code:"GI"},{name:"Greece",dialCode:"+30",code:"GR"},{name:"Greenland",dialCode:"+299",code:"GL"},{name:"Grenada",dialCode:"+1473",code:"GD"},{name:"Guadeloupe",dialCode:"+590",code:"GP"},{name:"Guam",dialCode:"+1671",code:"GU"},{name:"Guatemala",dialCode:"+502",code:"GT"},{name:"Guernsey",dialCode:"+44",code:"GG"},{name:"Guinea",dialCode:"+224",code:"GN"},{name:"Guinea-Bissau",dialCode:"+245",code:"GW"},{name:"Guyana",dialCode:"+595",code:"GY"},{name:"Haiti",dialCode:"+509",code:"HT"},{name:"Holy See (Vatican City State)",dialCode:"+379",code:"VA"},{name:"Honduras",dialCode:"+504",code:"HN"},{name:"Hong Kong",dialCode:"+852",code:"HK"},{name:"Hungary",dialCode:"+36",code:"HU"},{name:"Iceland",dialCode:"+354",code:"IS"},{name:"India",dialCode:"+91",code:"IN"},{name:"Indonesia",dialCode:"+62",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dialCode:"+98",code:"IR"},{name:"Iraq",dialCode:"+964",code:"IQ"},{name:"Ireland",dialCode:"+353",code:"IE"},{name:"Isle of Man",dialCode:"+44",code:"IM"},{name:"Israel",dialCode:"+972",code:"IL"},{name:"Italy",dialCode:"+39",code:"IT"},{name:"Jamaica",dialCode:"+1876",code:"JM"},{name:"Japan",dialCode:"+81",code:"JP"},{name:"Jersey",dialCode:"+44",code:"JE"},{name:"Jordan",dialCode:"+962",code:"JO"},{name:"Kazakhstan",dialCode:"+77",code:"KZ"},{name:"Kenya",dialCode:"+254",code:"KE"},{name:"Kiribati",dialCode:"+686",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dialCode:"+850",code:"KP"},{name:"Korea, Republic of South Korea",dialCode:"+82",code:"KR"},{name:"Kuwait",dialCode:"+965",code:"KW"},{name:"Kyrgyzstan",dialCode:"+996",code:"KG"},{name:"Laos",dialCode:"+856",code:"LA"},{name:"Latvia",dialCode:"+371",code:"LV"},{name:"Lebanon",dialCode:"+961",code:"LB"},{name:"Lesotho",dialCode:"+266",code:"LS"},{name:"Liberia",dialCode:"+231",code:"LR"},{name:"Libyan Arab Jamahiriya",dialCode:"+218",code:"LY"},{name:"Liechtenstein",dialCode:"+423",code:"LI"},{name:"Lithuania",dialCode:"+370",code:"LT"},{name:"Luxembourg",dialCode:"+352",code:"LU"},{name:"Macao",dialCode:"+853",code:"MO"},{name:"Macedonia",dialCode:"+389",code:"MK"},{name:"Madagascar",dialCode:"+261",code:"MG"},{name:"Malawi",dialCode:"+265",code:"MW"},{name:"Malaysia",dialCode:"+60",code:"MY"},{name:"Maldives",dialCode:"+960",code:"MV"},{name:"Mali",dialCode:"+223",code:"ML"},{name:"Malta",dialCode:"+356",code:"MT"},{name:"Marshall Islands",dialCode:"+692",code:"MH"},{name:"Martinique",dialCode:"+596",code:"MQ"},{name:"Mauritania",dialCode:"+222",code:"MR"},{name:"Mauritius",dialCode:"+230",code:"MU"},{name:"Mayotte",dialCode:"+262",code:"YT"},{name:"Mexico",dialCode:"+52",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dialCode:"+691",code:"FM"},{name:"Moldova",dialCode:"+373",code:"MD"},{name:"Monaco",dialCode:"+377",code:"MC"},{name:"Mongolia",dialCode:"+976",code:"MN"},{name:"Montenegro",dialCode:"+382",code:"ME"},{name:"Montserrat",dialCode:"+1664",code:"MS"},{name:"Morocco",dialCode:"+212",code:"MA"},{name:"Mozambique",dialCode:"+258",code:"MZ"},{name:"Myanmar",dialCode:"+95",code:"MM"},{name:"Namibia",dialCode:"+264",code:"NA"},{name:"Nauru",dialCode:"+674",code:"NR"},{name:"Nepal",dialCode:"+977",code:"NP"},{name:"Netherlands",dialCode:"+31",code:"NL"},{name:"Netherlands Antilles",dialCode:"+599",code:"AN"},{name:"New Caledonia",dialCode:"+687",code:"NC"},{name:"New Zealand",dialCode:"+64",code:"NZ"},{name:"Nicaragua",dialCode:"+505",code:"NI"},{name:"Niger",dialCode:"+227",code:"NE"},{name:"Nigeria",dialCode:"+234",code:"NG"},{name:"Niue",dialCode:"+683",code:"NU"},{name:"Norfolk Island",dialCode:"+672",code:"NF"},{name:"Northern Mariana Islands",dialCode:"+1670",code:"MP"},{name:"Norway",dialCode:"+47",code:"NO"},{name:"Oman",dialCode:"+968",code:"OM"},{name:"Pakistan",dialCode:"+92",code:"PK"},{name:"Palau",dialCode:"+680",code:"PW"},{name:"Palestinian Territory, Occupied",dialCode:"+970",code:"PS"},{name:"Panama",dialCode:"+507",code:"PA"},{name:"Papua New Guinea",dialCode:"+675",code:"PG"},{name:"Paraguay",dialCode:"+595",code:"PY"},{name:"Peru",dialCode:"+51",code:"PE"},{name:"Philippines",dialCode:"+63",code:"PH"},{name:"Pitcairn",dialCode:"+872",code:"PN"},{name:"Poland",dialCode:"+48",code:"PL"},{name:"Portugal",dialCode:"+351",code:"PT"},{name:"Puerto Rico",dialCode:"+1939",code:"PR"},{name:"Qatar",dialCode:"+974",code:"QA"},{name:"Romania",dialCode:"+40",code:"RO"},{name:"Russia",dialCode:"+7",code:"RU"},{name:"Rwanda",dialCode:"+250",code:"RW"},{name:"Reunion",dialCode:"+262",code:"RE"},{name:"Saint Barthelemy",dialCode:"+590",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dialCode:"+290",code:"SH"},{name:"Saint Kitts and Nevis",dialCode:"+1869",code:"KN"},{name:"Saint Lucia",dialCode:"+1758",code:"LC"},{name:"Saint Martin",dialCode:"+590",code:"MF"},{name:"Saint Pierre and Miquelon",dialCode:"+508",code:"PM"},{name:"Saint Vincent and the Grenadines",dialCode:"+1784",code:"VC"},{name:"Samoa",dialCode:"+685",code:"WS"},{name:"San Marino",dialCode:"+378",code:"SM"},{name:"Sao Tome and Principe",dialCode:"+239",code:"ST"},{name:"Saudi Arabia",dialCode:"+966",code:"SA"},{name:"Senegal",dialCode:"+221",code:"SN"},{name:"Serbia",dialCode:"+381",code:"RS"},{name:"Seychelles",dialCode:"+248",code:"SC"},{name:"Sierra Leone",dialCode:"+232",code:"SL"},{name:"Singapore",dialCode:"+65",code:"SG"},{name:"Slovakia",dialCode:"+421",code:"SK"},{name:"Slovenia",dialCode:"+386",code:"SI"},{name:"Solomon Islands",dialCode:"+677",code:"SB"},{name:"Somalia",dialCode:"+252",code:"SO"},{name:"South Africa",dialCode:"+27",code:"ZA"},{name:"South Sudan",dialCode:"+211",code:"SS"},{name:"South Georgia and the South Sandwich Islands",dialCode:"+500",code:"GS"},{name:"Spain",dialCode:"+34",code:"ES"},{name:"Sri Lanka",dialCode:"+94",code:"LK"},{name:"Sudan",dialCode:"+249",code:"SD"},{name:"Suriname",dialCode:"+597",code:"SR"},{name:"Svalbard and Jan Mayen",dialCode:"+47",code:"SJ"},{name:"Swaziland",dialCode:"+268",code:"SZ"},{name:"Sweden",dialCode:"+46",code:"SE"},{name:"Switzerland",dialCode:"+41",code:"CH"},{name:"Syrian Arab Republic",dialCode:"+963",code:"SY"},{name:"Taiwan",dialCode:"+886",code:"TW"},{name:"Tajikistan",dialCode:"+992",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dialCode:"+255",code:"TZ"},{name:"Thailand",dialCode:"+66",code:"TH"},{name:"Timor-Leste",dialCode:"+670",code:"TL"},{name:"Togo",dialCode:"+228",code:"TG"},{name:"Tokelau",dialCode:"+690",code:"TK"},{name:"Tonga",dialCode:"+676",code:"TO"},{name:"Trinidad and Tobago",dialCode:"+1868",code:"TT"},{name:"Tunisia",dialCode:"+216",code:"TN"},{name:"Turkey",dialCode:"+90",code:"TR"},{name:"Turkmenistan",dialCode:"+993",code:"TM"},{name:"Turks and Caicos Islands",dialCode:"+1649",code:"TC"},{name:"Tuvalu",dialCode:"+688",code:"TV"},{name:"Uganda",dialCode:"+256",code:"UG"},{name:"Ukraine",dialCode:"+380",code:"UA"},{name:"United Arab Emirates",dialCode:"+971",code:"AE"},{name:"United Kingdom",dialCode:"+44",code:"GB"},{name:"Uruguay",dialCode:"+598",code:"UY"},{name:"Uzbekistan",dialCode:"+998",code:"UZ"},{name:"Vanuatu",dialCode:"+678",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dialCode:"+58",code:"VE"},{name:"Vietnam",dialCode:"+84",code:"VN"},{name:"Virgin Islands, British",dialCode:"+1284",code:"VG"},{name:"Virgin Islands, U.S.",dialCode:"+1340",code:"VI"},{name:"Wallis and Futuna",dialCode:"+681",code:"WF"},{name:"Yemen",dialCode:"+967",code:"YE"},{name:"Zambia",dialCode:"+260",code:"ZM"},{name:"Zimbabwe",dialCode:"+263",code:"ZW"}].sort(((e,t)=>e.name<t.name?-1:1))]},2246:(e,t,a)=>{a.d(t,{f:()=>r,Z:()=>C});var o=a(3878),d=a(4567),n=a(7262);const i=({code:e,dialCode:t,name:a})=>`\n\t<div\n\t\tstyle="display:flex; flex-direction: column;"\n\t\tdata-id="${t}"\n\t\tdata-name="${e} ${t} ${a}"\n\t\tdata-country-code="${e}"\n\t>\n\t\t<div>\n\t\t\t<span>\n\t\t\t\t<img src="${(e=>`https://static.descope.com/npm/svg-country-flags@1.2.10/svg/${e.toLowerCase()}.svg`)(e)}" width="20"/>\n\t\t\t</span>\n\t\t\t<span>${a}</span>\n\t\t</div>\n\t\t<div>\n\t\t\t<span>${e}</span>\n\t\t\t<span>${t}</span>\n\t\t</div>\n\t</div>\n`,r=(0,d.iY)("phone-field-internal"),l=["disabled","size","bordered","invalid","readonly"],s=["country-input-placeholder","default-code","restrict-countries"],c=["phone-input-placeholder","maxlength"],m={"country-input-placeholder":"placeholder","phone-input-placeholder":"placeholder"},u=[].concat(l,s,c),p=(0,o.P)({componentName:r,baseSelector:"div"}),C=class extends p{static get observedAttributes(){return[].concat(p.observedAttributes||[],u)}constructor(){super(),this.innerHTML=`\n <div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n >\n ${n.Z.map((e=>i(e))).join("")}\n </descope-combo-box>\n <div class="separator"></div>\n <descope-text-field type="tel"></descope-text-field>\n </div>\n `,this.countryCodeInput=this.querySelector("descope-combo-box"),this.phoneNumberInput=this.querySelector("descope-text-field"),this.inputs=[this.countryCodeInput,this.phoneNumberInput],this.countryCodeInput.customValueTransformFn=e=>{const[,t]=e?.split?.(" ")||[];return t}}get value(){return this.phoneNumberValue?`${this.countryCodeInput.value}-${this.phoneNumberInput.value}`:""}set value(e){const[t="",a=""]=e.split("-");if(t){const e=this.getCountryByDialCode(t);e&&(this.countryCodeInput.selectedItem=e)}else this.countryCodeInput.selectedItem=void 0;this.phoneNumberInput.value=a}get phoneNumberValue(){return this.phoneNumberInput.value}get countryCodeValue(){return this.countryCodeInput.shadowRoot.querySelector("input").value}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}getValidity(){const e=this.countryCodeInput.value,t=this.phoneNumberInput.value,a=!e||!t,o=this.phoneNumberInput.value?.length&&this.phoneNumberInput.value.length<this.minLength;return this.isRequired&&a?{valueMissing:!0}:o?{tooShort:!0}:t&&!e?{valueMissing:!0}:{}}init(){this.addEventListener("focus",(e=>{e.isTrusted&&this.inputs[1].focus()})),super.init?.(),this.initInputs()}getRestrictedCountries(){return this.getAttribute("restrict-countries")?.split(",")||[]}getCountryByDialCode(e){return this.countryCodeInput.items?.find((t=>t.getAttribute("data-id")===e))}getCountryByCodeId(e){return this.countryCodeInput.items?.find((t=>t.getAttribute("data-country-code")===e))}updateCountryCodeItems(e){const t=e.length?n.Z.filter((t=>e.includes(t.code))):n.Z;this.querySelector("descope-combo-box").innerHTML=t.map((e=>i(e))).join("")}handleDefaultCountryCode(e){if(!this.countryCodeInput.value){const t=this.getCountryByCodeId(e);t&&setTimeout((()=>{this.countryCodeInput.selectedItem=t}))}}initInputs(){this.phoneNumberInput.addEventListener("input",(e=>{const t=/^\d$/,a=e.target.value.split("").filter((e=>t.test(e))).join("");e.target.value=a})),this.handleFocusEventsDispatching(this.inputs),this.handleInputEventDispatching()}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),t!==a){if("default-code"===e&&a)this.handleDefaultCountryCode(a);else if(u.includes(e)){const t=m[e]||e;l.includes(e)?this.inputs.forEach((e=>e.setAttribute(t,a))):s.includes(e)?this.countryCodeInput.setAttribute(t,a):c.includes(e)&&this.phoneNumberInput.setAttribute(t,a)}"restrict-countries"===e&&this.updateCountryCodeItems(this.getRestrictedCountries())}}}},9240:(e,t,a)=>{a.r(t),a(1294),a(9357);var o=a(2246);customElements.define(o.f,o.Z)},6581:(e,t,a)=>{a.r(t),a.d(t,{PhoneFieldClass:()=>S}),a(9240),a(1294),a(9357);var o=a(2246),d=a(4567),n=a(2061),i=a(1e3),r=a(6417),l=a(4049),s=a(7262),c=a(4201);const m=r.z.cssVarList,u=l.H.cssVarList,p=(0,d.iY)("phone-field"),{host:C,label:h,requiredIndicator:b,inputField:y,countryCodeInput:g,phoneInput:f,separator:v,errorMessage:I,helperText:x}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},inputField:{selector:"::part(input-field)"},phoneInput:{selector:()=>"descope-text-field"},countryCodeInput:{selector:()=>"descope-combo-box"},separator:{selector:"descope-phone-field-internal .separator"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},S=(0,n.qC)((0,i.yk)({mappings:{fontSize:[C,y,{selector:r.z.componentName,property:r.z.cssVarList.fontSize},{selector:l.H.componentName,property:l.H.cssVarList.fontSize}],fontFamily:[h,I,x,{...g,property:l.H.cssVarList.overlay.fontFamily}],hostWidth:[{...C,property:"width"},{...f,property:"width"},{...g,property:"--vaadin-combo-box-overlay-width"}],hostDirection:{...C,property:"direction"},inputBorderStyle:[{...y,property:"border-style"},{...v,property:"border-left-style"}],inputBorderWidth:[{...y,property:"border-width"},{...v,property:"border-left-width"}],inputBorderColor:[{...y,property:"border-color"},{...v,property:"border-left-color"}],inputBorderRadius:{...y,property:"border-radius"},countryCodeInputWidth:{...g,property:u.hostWidth},countryCodeDropdownWidth:{...g,property:"--vaadin-combo-box-overlay-width"},phoneInputWidth:{...f,property:"width"},labelTextColor:[{...h,property:"color"},{...b,property:"color"}],labelRequiredIndicator:{...b,property:"content"},errorMessageTextColor:{...I,property:"color"},inputValueTextColor:[{...f,property:m.inputValueTextColor},{...g,property:u.inputValueTextColor}],inputPlaceholderTextColor:{...f,property:m.inputPlaceholderColor},overlayItemBackgroundColor:{selector:"descope-combo-box",property:u.overlayItemBackgroundColor},inputOutlineStyle:{...y,property:"outline-style"},inputOutlineColor:{...y,property:"outline-color"},inputOutlineWidth:{...y,property:"outline-width"},inputOutlineOffset:{...y,property:"outline-offset"}}}),i.e4,(0,i.dj)({proxyProps:["value","selectionStart"]}),(e=>class extends e{static get CountryCodes(){return s.Z}init(){super.init?.();const e=document.createElement("template");e.innerHTML=`\n\t\t\t\t<${o.f}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.f}>\n \t\t`,this.baseElement.appendChild(e.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),(0,d.oP)(this.shadowRoot.host,this.inputElement,{includeAttrs:["size","bordered","invalid","minlength","maxlength","default-code","country-input-placeholder","phone-input-placeholder","disabled","restrict-countries"]})}}))((0,i.DM)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tmin-width: 15em;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\t${(0,c.bi)(S.cssVarList)}\n\t\t\t${(0,c.Pd)("vaadin-text-field")}\n\t\t\t${(0,c.B)("vaadin-text-field")}\n\t\t\t${(0,c.DY)()}\n\n\t\t\tdiv {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n\t\t\tvaadin-text-field {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-text-field[focus-ring]::part(input-field) {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t\tvaadin-text-field::before {\n\t\t\t\theight: 0;\n\t\t\t}\n\t\t\tvaadin-text-field::part(input-field) {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\tdescope-phone-field-internal {\n\t\t\t\t-webkit-mask-image: none;\n\t\t\t\tpadding: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n direction: ltr;\n\t\t\t}\n\t\t\tdescope-phone-field-internal > div {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\t\t\tdescope-phone-field-internal .separator {\n\t\t\t\tflex: 0;\n\t\t\t\tborder: none;\n\t\t\t}\n\t\t\tdescope-combo-box {\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tmin-width: 5.75em;\n\t\t\t\t${u.inputOutlineWidth}: 0;\n\t\t\t\t${u.inputOutlineOffset}: 0;\n\t\t\t\t${u.inputBorderWidth}: 0;\n\t\t\t\t${u.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tdescope-text-field {\n\t\t\t\tflex-grow: 1;\n\t\t\t\t${m.inputOutlineWidth}: 0;\n\t\t\t\t${m.inputOutlineOffset}: 0;\n\t\t\t\t${m.inputBorderWidth}: 0;\n\t\t\t\t${m.inputBorderRadius}: 0;\n\t\t\t}\n\t\t\tvaadin-text-field[readonly] > input:placeholder-shown {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tvaadin-text-field::part(input-field)::after {\n\t\t\t\tborder: none;\n\t\t\t}\n ${(0,c.Wf)("vaadin-text-field")}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:p}));customElements.define(p,S)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[4981],{2565:(e,t,n)=>{n.d(t,{f:()=>s,Z:()=>o});var i=n(3878),u=n(4567),r=n(7262);const s=(0,u.iY)("phone-field-internal-input-box"),a=["disabled","size","bordered","invalid","readonly","phone-input-placeholder"],h={"phone-input-placeholder":"placeholder"},l=(0,i.P)({componentName:s,baseSelector:"div"}),o=class extends l{static get observedAttributes(){return[].concat(l.observedAttributes||[],a)}constructor(){super(),this.innerHTML='\n <div>\n <descope-text-field tabindex="1"></descope-text-field>\n </div>\n ',this.phoneNumberInput=this.querySelector("descope-text-field")}get defaultCountryCode(){return e=this.getAttribute("default-code"),r.Z.find((t=>t.code===e))?.dialCode;var e}get hasDefaultCode(){return!!this.getAttribute("default-code")}get value(){if(!this.phoneNumberValue)return"";if(this.hasDefaultCode){const e=new RegExp(`\\+?${parseInt(this.defaultCountryCode,10)}--?`);return`${this.defaultCountryCode}-${this.phoneNumberInput.value.replace(e,"")}`}return this.phoneNumberInput.value}set value(e){this.phoneNumberInput.value=e}get phoneNumberValue(){return this.phoneNumberInput.value}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}get maxLength(){return parseInt(this.getAttribute("maxlength"),10)||50}getValidity(){const e=this.value.replace(/\D/g,"");return this.isRequired&&!this.value?{valueMissing:!0}:e.length<this.minLength?{tooShort:!0}:e.length>this.maxLength?{tooLong:!0}:/^\+?\d{1,4}-?(?:\d-?){1,15}$/.test(this.value)?{}:{patternMismatch:!0}}init(){this.addEventListener("focus",(e=>{e.isTrusted&&this.phoneNumberInput.focus()})),super.init?.(),this.initInputs()}getCountryByDialCode(e){return this.countryCodeInput.items?.find((t=>t.getAttribute("data-country-code")===e))}initInputs(){this.phoneNumberInput.addEventListener("input",(e=>{1===e.target.value.length&&"-"===e.target.value&&(e.target.value=""),e.target.value=e.target.value.replace(/(?!^)\+/g,"").replace("--","-").replace("+-","+");const t=/^[+\d-]+$/,n=e.target.value.split("").filter((e=>t.test(e))).join("");e.target.value=n})),this.handleFocusEventsDispatching([this.phoneNumberInput]),this.handleInputEventDispatching()}attributeChangedCallback(e,t,n){if(super.attributeChangedCallback(e,t,n),t!==n&&a.includes(e)){const t=h[e]||e;this.phoneNumberInput.setAttribute(t,n)}}}},3067:(e,t,n)=>{n.r(t),n(9357);var i=n(2565);customElements.define(i.f,i.Z)}}]);
1
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[4981],{7262:(e,a,d)=>{d.d(a,{Z:()=>o});const o=[{name:"United States",dialCode:"+1",code:"US"},...[{name:"Afghanistan",dialCode:"+93",code:"AF"},{name:"Aland Islands",dialCode:"+358",code:"AX"},{name:"Albania",dialCode:"+355",code:"AL"},{name:"Algeria",dialCode:"+213",code:"DZ"},{name:"AmericanSamoa",dialCode:"+1684",code:"AS"},{name:"Andorra",dialCode:"+376",code:"AD"},{name:"Angola",dialCode:"+244",code:"AO"},{name:"Anguilla",dialCode:"+1264",code:"AI"},{name:"Antarctica",dialCode:"+672",code:"AQ"},{name:"Antigua and Barbuda",dialCode:"+1268",code:"AG"},{name:"Argentina",dialCode:"+54",code:"AR"},{name:"Armenia",dialCode:"+374",code:"AM"},{name:"Aruba",dialCode:"+297",code:"AW"},{name:"Australia",dialCode:"+61",code:"AU"},{name:"Austria",dialCode:"+43",code:"AT"},{name:"Azerbaijan",dialCode:"+994",code:"AZ"},{name:"Bahamas",dialCode:"+1242",code:"BS"},{name:"Bahrain",dialCode:"+973",code:"BH"},{name:"Bangladesh",dialCode:"+880",code:"BD"},{name:"Barbados",dialCode:"+1246",code:"BB"},{name:"Belarus",dialCode:"+375",code:"BY"},{name:"Belgium",dialCode:"+32",code:"BE"},{name:"Belize",dialCode:"+501",code:"BZ"},{name:"Benin",dialCode:"+229",code:"BJ"},{name:"Bermuda",dialCode:"+1441",code:"BM"},{name:"Bhutan",dialCode:"+975",code:"BT"},{name:"Bolivia, Plurinational State of",dialCode:"+591",code:"BO"},{name:"Bosnia and Herzegovina",dialCode:"+387",code:"BA"},{name:"Botswana",dialCode:"+267",code:"BW"},{name:"Brazil",dialCode:"+55",code:"BR"},{name:"British Indian Ocean Territory",dialCode:"+246",code:"IO"},{name:"Brunei Darussalam",dialCode:"+673",code:"BN"},{name:"Bulgaria",dialCode:"+359",code:"BG"},{name:"Burkina Faso",dialCode:"+226",code:"BF"},{name:"Burundi",dialCode:"+257",code:"BI"},{name:"Cambodia",dialCode:"+855",code:"KH"},{name:"Cameroon",dialCode:"+237",code:"CM"},{name:"Canada",dialCode:"+1",code:"CA"},{name:"Cape Verde",dialCode:"+238",code:"CV"},{name:"Cayman Islands",dialCode:"+345",code:"KY"},{name:"Central African Republic",dialCode:"+236",code:"CF"},{name:"Chad",dialCode:"+235",code:"TD"},{name:"Chile",dialCode:"+56",code:"CL"},{name:"China",dialCode:"+86",code:"CN"},{name:"Christmas Island",dialCode:"+61",code:"CX"},{name:"Cocos (Keeling) Islands",dialCode:"+61",code:"CC"},{name:"Colombia",dialCode:"+57",code:"CO"},{name:"Comoros",dialCode:"+269",code:"KM"},{name:"Congo",dialCode:"+242",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dialCode:"+243",code:"CD"},{name:"Cook Islands",dialCode:"+682",code:"CK"},{name:"Costa Rica",dialCode:"+506",code:"CR"},{name:"Cote d'Ivoire",dialCode:"+225",code:"CI"},{name:"Croatia",dialCode:"+385",code:"HR"},{name:"Cuba",dialCode:"+53",code:"CU"},{name:"Cyprus",dialCode:"+357",code:"CY"},{name:"Czech Republic",dialCode:"+420",code:"CZ"},{name:"Denmark",dialCode:"+45",code:"DK"},{name:"Djibouti",dialCode:"+253",code:"DJ"},{name:"Dominica",dialCode:"+1767",code:"DM"},{name:"Dominican Republic",dialCode:"+1849",code:"DO"},{name:"Ecuador",dialCode:"+593",code:"EC"},{name:"Egypt",dialCode:"+20",code:"EG"},{name:"El Salvador",dialCode:"+503",code:"SV"},{name:"Equatorial Guinea",dialCode:"+240",code:"GQ"},{name:"Eritrea",dialCode:"+291",code:"ER"},{name:"Estonia",dialCode:"+372",code:"EE"},{name:"Ethiopia",dialCode:"+251",code:"ET"},{name:"Falkland Islands (Malvinas)",dialCode:"+500",code:"FK"},{name:"Faroe Islands",dialCode:"+298",code:"FO"},{name:"Fiji",dialCode:"+679",code:"FJ"},{name:"Finland",dialCode:"+358",code:"FI"},{name:"France",dialCode:"+33",code:"FR"},{name:"French Guiana",dialCode:"+594",code:"GF"},{name:"French Polynesia",dialCode:"+689",code:"PF"},{name:"Gabon",dialCode:"+241",code:"GA"},{name:"Gambia",dialCode:"+220",code:"GM"},{name:"Georgia",dialCode:"+995",code:"GE"},{name:"Germany",dialCode:"+49",code:"DE"},{name:"Ghana",dialCode:"+233",code:"GH"},{name:"Gibraltar",dialCode:"+350",code:"GI"},{name:"Greece",dialCode:"+30",code:"GR"},{name:"Greenland",dialCode:"+299",code:"GL"},{name:"Grenada",dialCode:"+1473",code:"GD"},{name:"Guadeloupe",dialCode:"+590",code:"GP"},{name:"Guam",dialCode:"+1671",code:"GU"},{name:"Guatemala",dialCode:"+502",code:"GT"},{name:"Guernsey",dialCode:"+44",code:"GG"},{name:"Guinea",dialCode:"+224",code:"GN"},{name:"Guinea-Bissau",dialCode:"+245",code:"GW"},{name:"Guyana",dialCode:"+595",code:"GY"},{name:"Haiti",dialCode:"+509",code:"HT"},{name:"Holy See (Vatican City State)",dialCode:"+379",code:"VA"},{name:"Honduras",dialCode:"+504",code:"HN"},{name:"Hong Kong",dialCode:"+852",code:"HK"},{name:"Hungary",dialCode:"+36",code:"HU"},{name:"Iceland",dialCode:"+354",code:"IS"},{name:"India",dialCode:"+91",code:"IN"},{name:"Indonesia",dialCode:"+62",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dialCode:"+98",code:"IR"},{name:"Iraq",dialCode:"+964",code:"IQ"},{name:"Ireland",dialCode:"+353",code:"IE"},{name:"Isle of Man",dialCode:"+44",code:"IM"},{name:"Israel",dialCode:"+972",code:"IL"},{name:"Italy",dialCode:"+39",code:"IT"},{name:"Jamaica",dialCode:"+1876",code:"JM"},{name:"Japan",dialCode:"+81",code:"JP"},{name:"Jersey",dialCode:"+44",code:"JE"},{name:"Jordan",dialCode:"+962",code:"JO"},{name:"Kazakhstan",dialCode:"+77",code:"KZ"},{name:"Kenya",dialCode:"+254",code:"KE"},{name:"Kiribati",dialCode:"+686",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dialCode:"+850",code:"KP"},{name:"Korea, Republic of South Korea",dialCode:"+82",code:"KR"},{name:"Kuwait",dialCode:"+965",code:"KW"},{name:"Kyrgyzstan",dialCode:"+996",code:"KG"},{name:"Laos",dialCode:"+856",code:"LA"},{name:"Latvia",dialCode:"+371",code:"LV"},{name:"Lebanon",dialCode:"+961",code:"LB"},{name:"Lesotho",dialCode:"+266",code:"LS"},{name:"Liberia",dialCode:"+231",code:"LR"},{name:"Libyan Arab Jamahiriya",dialCode:"+218",code:"LY"},{name:"Liechtenstein",dialCode:"+423",code:"LI"},{name:"Lithuania",dialCode:"+370",code:"LT"},{name:"Luxembourg",dialCode:"+352",code:"LU"},{name:"Macao",dialCode:"+853",code:"MO"},{name:"Macedonia",dialCode:"+389",code:"MK"},{name:"Madagascar",dialCode:"+261",code:"MG"},{name:"Malawi",dialCode:"+265",code:"MW"},{name:"Malaysia",dialCode:"+60",code:"MY"},{name:"Maldives",dialCode:"+960",code:"MV"},{name:"Mali",dialCode:"+223",code:"ML"},{name:"Malta",dialCode:"+356",code:"MT"},{name:"Marshall Islands",dialCode:"+692",code:"MH"},{name:"Martinique",dialCode:"+596",code:"MQ"},{name:"Mauritania",dialCode:"+222",code:"MR"},{name:"Mauritius",dialCode:"+230",code:"MU"},{name:"Mayotte",dialCode:"+262",code:"YT"},{name:"Mexico",dialCode:"+52",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dialCode:"+691",code:"FM"},{name:"Moldova",dialCode:"+373",code:"MD"},{name:"Monaco",dialCode:"+377",code:"MC"},{name:"Mongolia",dialCode:"+976",code:"MN"},{name:"Montenegro",dialCode:"+382",code:"ME"},{name:"Montserrat",dialCode:"+1664",code:"MS"},{name:"Morocco",dialCode:"+212",code:"MA"},{name:"Mozambique",dialCode:"+258",code:"MZ"},{name:"Myanmar",dialCode:"+95",code:"MM"},{name:"Namibia",dialCode:"+264",code:"NA"},{name:"Nauru",dialCode:"+674",code:"NR"},{name:"Nepal",dialCode:"+977",code:"NP"},{name:"Netherlands",dialCode:"+31",code:"NL"},{name:"Netherlands Antilles",dialCode:"+599",code:"AN"},{name:"New Caledonia",dialCode:"+687",code:"NC"},{name:"New Zealand",dialCode:"+64",code:"NZ"},{name:"Nicaragua",dialCode:"+505",code:"NI"},{name:"Niger",dialCode:"+227",code:"NE"},{name:"Nigeria",dialCode:"+234",code:"NG"},{name:"Niue",dialCode:"+683",code:"NU"},{name:"Norfolk Island",dialCode:"+672",code:"NF"},{name:"Northern Mariana Islands",dialCode:"+1670",code:"MP"},{name:"Norway",dialCode:"+47",code:"NO"},{name:"Oman",dialCode:"+968",code:"OM"},{name:"Pakistan",dialCode:"+92",code:"PK"},{name:"Palau",dialCode:"+680",code:"PW"},{name:"Palestinian Territory, Occupied",dialCode:"+970",code:"PS"},{name:"Panama",dialCode:"+507",code:"PA"},{name:"Papua New Guinea",dialCode:"+675",code:"PG"},{name:"Paraguay",dialCode:"+595",code:"PY"},{name:"Peru",dialCode:"+51",code:"PE"},{name:"Philippines",dialCode:"+63",code:"PH"},{name:"Pitcairn",dialCode:"+872",code:"PN"},{name:"Poland",dialCode:"+48",code:"PL"},{name:"Portugal",dialCode:"+351",code:"PT"},{name:"Puerto Rico",dialCode:"+1939",code:"PR"},{name:"Qatar",dialCode:"+974",code:"QA"},{name:"Romania",dialCode:"+40",code:"RO"},{name:"Russia",dialCode:"+7",code:"RU"},{name:"Rwanda",dialCode:"+250",code:"RW"},{name:"Reunion",dialCode:"+262",code:"RE"},{name:"Saint Barthelemy",dialCode:"+590",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dialCode:"+290",code:"SH"},{name:"Saint Kitts and Nevis",dialCode:"+1869",code:"KN"},{name:"Saint Lucia",dialCode:"+1758",code:"LC"},{name:"Saint Martin",dialCode:"+590",code:"MF"},{name:"Saint Pierre and Miquelon",dialCode:"+508",code:"PM"},{name:"Saint Vincent and the Grenadines",dialCode:"+1784",code:"VC"},{name:"Samoa",dialCode:"+685",code:"WS"},{name:"San Marino",dialCode:"+378",code:"SM"},{name:"Sao Tome and Principe",dialCode:"+239",code:"ST"},{name:"Saudi Arabia",dialCode:"+966",code:"SA"},{name:"Senegal",dialCode:"+221",code:"SN"},{name:"Serbia",dialCode:"+381",code:"RS"},{name:"Seychelles",dialCode:"+248",code:"SC"},{name:"Sierra Leone",dialCode:"+232",code:"SL"},{name:"Singapore",dialCode:"+65",code:"SG"},{name:"Slovakia",dialCode:"+421",code:"SK"},{name:"Slovenia",dialCode:"+386",code:"SI"},{name:"Solomon Islands",dialCode:"+677",code:"SB"},{name:"Somalia",dialCode:"+252",code:"SO"},{name:"South Africa",dialCode:"+27",code:"ZA"},{name:"South Sudan",dialCode:"+211",code:"SS"},{name:"South Georgia and the South Sandwich Islands",dialCode:"+500",code:"GS"},{name:"Spain",dialCode:"+34",code:"ES"},{name:"Sri Lanka",dialCode:"+94",code:"LK"},{name:"Sudan",dialCode:"+249",code:"SD"},{name:"Suriname",dialCode:"+597",code:"SR"},{name:"Svalbard and Jan Mayen",dialCode:"+47",code:"SJ"},{name:"Swaziland",dialCode:"+268",code:"SZ"},{name:"Sweden",dialCode:"+46",code:"SE"},{name:"Switzerland",dialCode:"+41",code:"CH"},{name:"Syrian Arab Republic",dialCode:"+963",code:"SY"},{name:"Taiwan",dialCode:"+886",code:"TW"},{name:"Tajikistan",dialCode:"+992",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dialCode:"+255",code:"TZ"},{name:"Thailand",dialCode:"+66",code:"TH"},{name:"Timor-Leste",dialCode:"+670",code:"TL"},{name:"Togo",dialCode:"+228",code:"TG"},{name:"Tokelau",dialCode:"+690",code:"TK"},{name:"Tonga",dialCode:"+676",code:"TO"},{name:"Trinidad and Tobago",dialCode:"+1868",code:"TT"},{name:"Tunisia",dialCode:"+216",code:"TN"},{name:"Turkey",dialCode:"+90",code:"TR"},{name:"Turkmenistan",dialCode:"+993",code:"TM"},{name:"Turks and Caicos Islands",dialCode:"+1649",code:"TC"},{name:"Tuvalu",dialCode:"+688",code:"TV"},{name:"Uganda",dialCode:"+256",code:"UG"},{name:"Ukraine",dialCode:"+380",code:"UA"},{name:"United Arab Emirates",dialCode:"+971",code:"AE"},{name:"United Kingdom",dialCode:"+44",code:"GB"},{name:"Uruguay",dialCode:"+598",code:"UY"},{name:"Uzbekistan",dialCode:"+998",code:"UZ"},{name:"Vanuatu",dialCode:"+678",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dialCode:"+58",code:"VE"},{name:"Vietnam",dialCode:"+84",code:"VN"},{name:"Virgin Islands, British",dialCode:"+1284",code:"VG"},{name:"Virgin Islands, U.S.",dialCode:"+1340",code:"VI"},{name:"Wallis and Futuna",dialCode:"+681",code:"WF"},{name:"Yemen",dialCode:"+967",code:"YE"},{name:"Zambia",dialCode:"+260",code:"ZM"},{name:"Zimbabwe",dialCode:"+263",code:"ZW"}].sort(((e,a)=>e.name<a.name?-1:1))]},2565:(e,a,d)=>{d.d(a,{f:()=>l,Z:()=>t});var o=d(3878),n=d(4567),i=d(7262);const l=(0,n.iY)("phone-field-internal-input-box"),c=["disabled","size","bordered","invalid","readonly","phone-input-placeholder"],m={"phone-input-placeholder":"placeholder"},C=(0,o.P)({componentName:l,baseSelector:"div"}),t=class extends C{static get observedAttributes(){return[].concat(C.observedAttributes||[],c)}constructor(){super(),this.innerHTML='\n <div>\n <descope-text-field tabindex="1"></descope-text-field>\n </div>\n ',this.phoneNumberInput=this.querySelector("descope-text-field")}get defaultCountryCode(){return e=this.getAttribute("default-code"),i.Z.find((a=>a.code===e))?.dialCode;var e}get hasDefaultCode(){return!!this.getAttribute("default-code")}get value(){if(!this.phoneNumberValue)return"";if(this.hasDefaultCode){const e=new RegExp(`\\+?${parseInt(this.defaultCountryCode,10)}--?`);return`${this.defaultCountryCode}-${this.phoneNumberInput.value.replace(e,"")}`}return this.phoneNumberInput.value}set value(e){this.phoneNumberInput.value=e}get phoneNumberValue(){return this.phoneNumberInput.value}get minLength(){return parseInt(this.getAttribute("minlength"),10)||0}get maxLength(){return parseInt(this.getAttribute("maxlength"),10)||50}getValidity(){const e=this.value.replace(/\D/g,"");return this.isRequired&&!this.value?{valueMissing:!0}:e.length<this.minLength?{tooShort:!0}:e.length>this.maxLength?{tooLong:!0}:/^\+?\d{1,4}-?(?:\d-?){1,15}$/.test(this.value)?{}:{patternMismatch:!0}}init(){this.addEventListener("focus",(e=>{e.isTrusted&&this.phoneNumberInput.focus()})),super.init?.(),this.initInputs()}getCountryByDialCode(e){return this.countryCodeInput.items?.find((a=>a.getAttribute("data-country-code")===e))}initInputs(){this.phoneNumberInput.addEventListener("input",(e=>{1===e.target.value.length&&"-"===e.target.value&&(e.target.value=""),e.target.value=e.target.value.replace(/(?!^)\+/g,"").replace("--","-").replace("+-","+");const a=/^[+\d-]+$/,d=e.target.value.split("").filter((e=>a.test(e))).join("");e.target.value=d})),this.handleFocusEventsDispatching([this.phoneNumberInput]),this.handleInputEventDispatching()}attributeChangedCallback(e,a,d){if(super.attributeChangedCallback(e,a,d),a!==d&&c.includes(e)){const a=m[e]||e;this.phoneNumberInput.setAttribute(a,d)}}}},3067:(e,a,d)=>{d.r(a),d(9357);var o=d(2565);customElements.define(o.f,o.Z)}}]);