@webority/ui-elements 0.6.13 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,7 +43,7 @@ var WeborityUiElements=(function(e){Object.defineProperty(e,Symbol.toStringTag,{
43
43
  <path d="M108.216 75.5971C107.507 74.8585 106.532 74.4448 105.527 74.4448H68.1816C67.177 74.4448 66.1725 74.8585 65.4929 75.5971C64.8134 76.3357 64.4293 77.3403 64.4884 78.3744L66.3202 108.688C66.6452 113.179 67.0588 118.793 77.3702 118.793H96.3384C106.65 118.793 107.063 113.208 107.388 108.688L109.22 78.4039C109.279 77.3403 108.895 76.3357 108.216 75.5971ZM91.7588 103.99H81.9202C80.7088 103.99 79.7043 102.986 79.7043 101.774C79.7043 100.563 80.7088 99.5585 81.9202 99.5585H91.7588C92.9702 99.5585 93.9747 100.563 93.9747 101.774C93.9747 102.986 92.9702 103.99 91.7588 103.99ZM94.2406 92.1721H79.4679C78.2566 92.1721 77.252 91.1676 77.252 89.9562C77.252 88.7448 78.2566 87.7403 79.4679 87.7403H94.2406C95.452 87.7403 96.4566 88.7448 96.4566 89.9562C96.4566 91.1676 95.452 92.1721 94.2406 92.1721Z" fill="white"/>
44
44
  </g>
45
45
  </g>
46
- <defs><clipPath id="wui_delete_clip0"><rect x="32" y="32" width="110" height="110" rx="55" fill="white"/></clipPath><clipPath id="wui_delete_clip1"><rect width="65" height="65" fill="white" transform="translate(54.3535 54.502)"/></clipPath></defs>`},a=Object.keys(i),o=class extends HTMLElement{static get observedAttributes(){return[`tone`,`size`]}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}render(){let e=this.getAttribute(`tone`),t=this.getAttribute(`size`)||`72`,n=i[e]||i.info;this.innerHTML=`<svg width="${t}" height="${t}" viewBox="0 0 174 174" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">${n}</svg>`}},s=4;function c(e,t,n={}){if(!e||!t)return;let r=e.getBoundingClientRect(),i=t.offsetHeight,a=window.innerHeight-r.bottom,o=a<i+s&&r.top>a;t.classList.toggle(`drop-up`,o),t.style.position=`fixed`,t.style.top=o?`${Math.max(s,r.top-i-s)}px`:`${r.bottom+s}px`,n.matchWidth&&(t.style.width=`${r.width}px`);let c=t.offsetWidth,l=Math.min(r.left,window.innerWidth-c-s);t.style.left=`${Math.max(s,l)}px`}function l(e,t){u(e),e._reanchor=t,window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchor,!0)}function u(e){e?._reanchor&&(window.removeEventListener(`resize`,e._reanchor),window.removeEventListener(`scroll`,e._reanchor,!0),e._reanchor=null)}var d=`data-wui-mirror`;function f(e,t){let n=e.getAttribute(`name`),r=e.querySelector(`:scope > input[${d}]`);if(!n){r?.remove();return}r||(r=document.createElement(`input`),r.type=`hidden`,r.setAttribute(d,``),e.appendChild(r)),r.name=n,r.value=t==null?``:String(t);for(let t of e.attributes)t.name.startsWith(`data-val`)&&r.setAttribute(t.name,t.value);r.disabled=e.hasAttribute(`disabled`)}var p=Symbol(`wui.trustedHtml`),m=e=>String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),h=e=>{if(!e)return``;let t=String(e).toLowerCase().replace(/[^a-z0-9-]/g,``);return t?`<i class="bi bi-${t}" aria-hidden="true"></i>`:``},g=e=>{if(e==null)return``;let t=e[p]?String(e.label??``):m(e.label),n=h(e.icon);return n?`<span class="wui-opt-label">${n}${t}</span>`:t},_=class extends HTMLElement{_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}static get observedAttributes(){return[`value`,`placeholder`,`disabled`,`min-chars`,`debounce`,`remote`,`size`,`aria-label`]}constructor(){super(),this._value=``,this._label=``,this._optionsProp=null,this._loading=!1,this._active=-1,this._timer=null}connectedCallback(){this._rendered||this.render()}attributeChangedCallback(e,t,n){this._rendered&&(e===`value`?this.value=n:this.render())}get value(){return this._value}set value(e){this._value=e==null?``:String(e),f(this,this._value);let t=this._readOptions().find(e=>String(e.value)===this._value);t&&(this._label=ee(t.label)),this._syncInput()}set options(e){this._optionsProp=Array.isArray(e)?e:[],this._renderOptions()}get options(){return this._readOptions()}set loading(e){this._loading=!!e,this._renderLoading()}get loading(){return this._loading}get _remote(){return this.hasAttribute(`remote`)}get _minChars(){return Math.max(0,Number(this.getAttribute(`min-chars`))||+!!this._remote)}get _debounceMs(){let e=Number(this.getAttribute(`debounce`));return Number.isFinite(e)&&e>=0?e:250}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>({value:e.getAttribute(`value`)??e.textContent.trim(),label:e.innerHTML,icon:e.getAttribute(`icon`)||void 0,[p]:!0,selected:e.hasAttribute(`selected`)})))}_readOptions(){return this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}render(){this._snapshotDeclared();let e=this.getAttribute(`placeholder`)||`Search…`,t=this.getAttribute(`size`),n=t===`sm`?` search-select-sm`:t===`lg`?` search-select-lg`:``;this.innerHTML=`
46
+ <defs><clipPath id="wui_delete_clip0"><rect x="32" y="32" width="110" height="110" rx="55" fill="white"/></clipPath><clipPath id="wui_delete_clip1"><rect width="65" height="65" fill="white" transform="translate(54.3535 54.502)"/></clipPath></defs>`},a=Object.keys(i),o=class extends HTMLElement{static get observedAttributes(){return[`tone`,`size`]}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}render(){let e=this.getAttribute(`tone`),t=this.getAttribute(`size`)||`72`,n=i[e]||i.info;this.innerHTML=`<svg width="${t}" height="${t}" viewBox="0 0 174 174" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">${n}</svg>`}},s=4;function c(e,t,n={}){if(!e||!t)return;let r=e.getBoundingClientRect(),i=t.offsetHeight,a=window.innerHeight-r.bottom,o=a<i+s&&r.top>a;t.classList.toggle(`drop-up`,o),t.style.position=`fixed`,t.style.top=o?`${Math.max(s,r.top-i-s)}px`:`${r.bottom+s}px`,n.matchWidth&&(t.style.width=`${r.width}px`);let c=t.offsetWidth,l=Math.min(r.left,window.innerWidth-c-s);t.style.left=`${Math.max(s,l)}px`}function l(e,t){u(e),e._reanchor=t,window.addEventListener(`resize`,e._reanchor),window.addEventListener(`scroll`,e._reanchor,!0)}function u(e){e?._reanchor&&(window.removeEventListener(`resize`,e._reanchor),window.removeEventListener(`scroll`,e._reanchor,!0),e._reanchor=null)}var d=`data-wui-mirror`;function f(e,t){let n=e.getAttribute(`name`),r=e.querySelector(`:scope > input[${d}]`);if(!n){r?.remove();return}r||(r=document.createElement(`input`),r.type=`hidden`,r.setAttribute(d,``),e.appendChild(r)),r.name=n,r.value=t==null?``:String(t);for(let t of e.attributes)t.name.startsWith(`data-val`)&&r.setAttribute(t.name,t.value);r.disabled=e.hasAttribute(`disabled`)}var p=Symbol(`wui.trustedHtml`),m=e=>String(e??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),h=e=>{if(!e)return``;let t=String(e).toLowerCase().replace(/[^a-z0-9-]/g,``);return t?`<i class="bi bi-${t}" aria-hidden="true"></i>`:``},g=e=>{if(e==null)return``;let t=e[p]?String(e.label??``):m(e.label),n=h(e.icon);return n?`<span class="wui-opt-label">${n}${t}</span>`:t},_=class extends HTMLElement{_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}static get observedAttributes(){return[`value`,`placeholder`,`disabled`,`min-chars`,`debounce`,`remote`,`size`,`aria-label`]}constructor(){super(),this._value=``,this._label=``,this._optionsProp=null,this._loading=!1,this._active=-1,this._timer=null}connectedCallback(){this._rendered||this.render()}attributeChangedCallback(e,t,n){this._rendered&&(e===`value`?this.value=n:this.render())}get value(){return this._value}set value(e){this._value=e==null?``:String(e),f(this,this._value);let t=this._readOptions().find(e=>String(e.value)===this._value);this._label=t?ee(t.label):``,this._syncInput(),this._renderOptions(``)}set options(e){this._optionsProp=Array.isArray(e)?e:[];let t=this._readOptions().find(e=>String(e.value)===this._value);t&&(this._label=ee(t.label)),this._renderOptions(),this._syncInput()}get options(){return this._readOptions()}set loading(e){this._loading=!!e,this._renderLoading(),this._renderOptions()}get loading(){return this._loading}get _remote(){return this.hasAttribute(`remote`)}get _minChars(){return Math.max(0,Number(this.getAttribute(`min-chars`))||+!!this._remote)}get _debounceMs(){let e=this.getAttribute(`debounce`);if(e==null||e===``)return 250;let t=Number(e);return Number.isFinite(t)&&t>=0?t:250}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>({value:e.getAttribute(`value`)??e.textContent.trim(),label:e.innerHTML,icon:e.getAttribute(`icon`)||void 0,[p]:!0,selected:e.hasAttribute(`selected`)})))}_readOptions(){return this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}render(){this._snapshotDeclared();let e=this.getAttribute(`placeholder`)||`Search…`,t=this.getAttribute(`size`),n=t===`sm`?` search-select-sm`:t===`lg`?` search-select-lg`:``;this.innerHTML=`
47
47
  <div class="search-select${n}">
48
48
  <div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="${v(this._accessibleName())}">
49
49
  <input class="search-select-input search-select-ac-input" placeholder="${v(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute(`disabled`)?` disabled`:``} />
@@ -150,7 +150,7 @@ ${JSON.stringify(s,null,2)}`);a++}return n?{overflow:!0}:{match:!0,matchedChars:
150
150
  ${JSON.stringify(f,null,2)}`)}}return c?{partialMatch:!0}:void 0;case`[]`:for(var p=Ns(t.args),m;!(m=p()).done;){var h=m.value;if(e[0]===h)return e.length===1?{match:!0,matchedChars:e}:n?{overflow:!0}:{match:!0,matchedChars:[h]}}return;default:throw Error(`Unsupported instruction tree: ${t}`)}}var Us,Ws=n((()=>{Ms(),Us=function(){function e(t){Ls(this,e),this.matchTree=new ks().parse(t)}return zs(e,[{key:`match`,value:function(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).allowOverflow;if(!e)throw Error(`String is required`);var n=Hs(e.split(``),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!(n&&n.overflow&&!t))return n}}])}()}));function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Gs(e)}function Ks(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=qs(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
151
151
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qs(e,t){if(e){if(typeof e==`string`)return Js(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Js(e,t):void 0}}function Js(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ys(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Xs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Qs(r.key),r)}}function Zs(e,t,n){return t&&Xs(e.prototype,t),n&&Xs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qs(e){var t=$s(e,`string`);return Gs(t)==`symbol`?t:t+``}function $s(e,t){if(Gs(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Gs(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ec,tc,nc,rc,ic,ac,oc,sc,cc,lc=n((()=>{ms(),bs(),Ws(),U(),tn(),L(),Qt(),ec=`9`,tc=ls(ec,15),nc=/[- ]/,rc=!0,ic=rc&&function(){return/\[([^\[\]])*\]/g},ac=rc&&function(){return/\d(?=[^,}][^,}])/g},oc=RegExp(`[`+F+`]*\\$1[`+F+`]*(\\$\\d[`+F+`]*)*$`),sc=3,cc=function(){function e(t){t.state;var n=t.metadata;Ys(this,e),this.metadata=n,this.resetFormat()}return Zs(e,[{key:`resetFormat`,value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:`reset`,value:function(e,t){this.resetFormat(),e?(this.isNANP=e.callingCode()===`1`,this.matchingFormats=e.formats(),t.nationalSignificantNumber&&this.narrowDownMatchingFormats(t)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:`format`,value:function(e,t){var n=this;if(gs(t.nationalSignificantNumber,this.metadata))for(var r=Ks(this.matchingFormats),i;!(i=r()).done;){var a=i.value,o=hs(t,a,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(e){return n.shouldTryNationalPrefixFormattingRule(e,{international:t.international,nationalPrefix:t.nationalPrefix})},getSeparatorAfterNationalPrefix:function(e){return n.getSeparatorAfterNationalPrefix(e)}});if(o)return this.resetFormat(),this.chosenFormat=a,this.setNationalNumberTemplate(o.replace(/\d/g,`x`),t),this.populatedNationalNumberTemplate=o,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(`x`),o}return this.formatNationalNumberWithNextDigits(e,t)}},{key:`formatNationalNumberWithNextDigits`,value:function(e,t){var n=this.chosenFormat,r=this.chooseFormat(t);if(r)return r===n?this.formatNextNationalNumberDigits(e):this.formatNextNationalNumberDigits(t.getNationalDigits())}},{key:`narrowDownMatchingFormats`,value:function(e){var t=this,n=e.nationalSignificantNumber,r=e.nationalPrefix,i=e.international,a=n,o=a.length-sc;o<0&&(o=0),this.matchingFormats=this.matchingFormats.filter(function(e){return t.formatSuits(e,i,r)&&t.formatMatches(e,a,o)}),this.chosenFormat&&this.matchingFormats.indexOf(this.chosenFormat)===-1&&this.resetFormat()}},{key:`formatSuits`,value:function(e,t,n){return!(n&&!e.usesNationalPrefix()&&!e.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!t&&!n&&e.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:`formatMatches`,value:function(e,t,n){var r=e.leadingDigitsPatterns().length;if(r===0)return!0;n=Math.min(n,r-1);var i=e.leadingDigitsPatterns()[n];if(t.length<sc)try{return new Us(i).match(t,{allowOverflow:!0})!==void 0}catch(e){return console.error(e),!0}return RegExp(`^(${i})`).test(t)}},{key:`getFormatFormat`,value:function(e,t){return t?e.internationalFormat():e.format()}},{key:`chooseFormat`,value:function(e){for(var t=this,n=function(){var n=a.value;return t.chosenFormat===n?0:oc.test(t.getFormatFormat(n,e.international))?t.createTemplateForFormat(n,e)?(t.chosenFormat=n,0):(t.matchingFormats=t.matchingFormats.filter(function(e){return e!==n}),1):1},r,i=Ks(this.matchingFormats.slice()),a;!(a=i()).done&&(r=n(),r!==0););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:`createTemplateForFormat`,value:function(e,t){if(!(rc&&e.pattern().indexOf(`|`)>=0)){var n=this.getTemplateForFormat(e,t);if(n)return this.setNationalNumberTemplate(n,t),!0}}},{key:`getSeparatorAfterNationalPrefix`,value:function(e){return this.isNANP||e&&e.nationalPrefixFormattingRule()&&nc.test(e.nationalPrefixFormattingRule())?` `:``}},{key:`getInternationalPrefixBeforeCountryCallingCode`,value:function(e,t){var n=e.IDDPrefix,r=e.missingPlus;return n?t&&t.spacing===!1?n:n+` `:r?``:`+`}},{key:`getTemplate`,value:function(e){if(this.template){for(var t=-1,n=0,r=e.international?this.getInternationalPrefixBeforeCountryCallingCode(e,{spacing:!1}):``;n<r.length+e.getDigitsWithoutInternationalPrefix().length;)t=this.template.indexOf(`x`,t+1),n++;return us(this.template,t+1)}}},{key:`setNationalNumberTemplate`,value:function(e,t){this.nationalNumberTemplate=e,this.populatedNationalNumberTemplate=e,this.populatedNationalNumberTemplatePosition=-1,t.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(t).replace(/[\d\+]/g,`x`)+ls(`x`,t.callingCode.length)+` `+e:this.template=e}},{key:`getTemplateForFormat`,value:function(e,t){var n=t.nationalSignificantNumber,r=t.international,i=t.nationalPrefix,a=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,o=e.pattern();rc&&(o=o.replace(ic(),`\\d`).replace(ac(),`\\d`));var s=tc.match(o)[0];if(!(n.length>s.length)){var c=RegExp(`^`+o+`$`),l=n.replace(/\d/g,ec);c.test(l)&&(s=l);var u=this.getFormatFormat(e,r),d;if(this.shouldTryNationalPrefixFormattingRule(e,{international:r,nationalPrefix:i})){var f=u.replace(en,e.nationalPrefixFormattingRule());if(H(e.nationalPrefixFormattingRule())===(i||``)+H(`$1`)&&(u=f,d=!0,i))for(var p=i.length;p>0;)u=u.replace(/\d/,`x`),p--}var m=s.replace(new RegExp(o),u).replace(new RegExp(ec,`g`),`x`);return d||(a?m=ls(`x`,a.length)+` `+m:i&&(m=ls(`x`,i.length)+this.getSeparatorAfterNationalPrefix(e)+m)),r&&(m=Zt(m)),m}}},{key:`formatNextNationalNumberDigits`,value:function(e){var t=fs(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);if(!t){this.resetFormat();return}return this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],us(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:`shouldTryNationalPrefixFormattingRule`,value:function(e,t){var n=t.international,r=t.nationalPrefix;if(e.nationalPrefixFormattingRule()){var i=e.usesNationalPrefix();if(i&&r||!i&&!n)return!0}}}])}()}));function uc(e){"@babel/helpers - typeof";return uc=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},uc(e)}function dc(e,t){return gc(e)||hc(e,t)||pc(e,t)||fc()}function fc(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
152
152
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pc(e,t){if(e){if(typeof e==`string`)return mc(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mc(e,t):void 0}}function mc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hc(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function gc(e){if(Array.isArray(e))return e}function _c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function vc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,bc(r.key),r)}}function yc(e,t,n){return t&&vc(e.prototype,t),n&&vc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bc(e){var t=xc(e,`string`);return uc(t)==`symbol`?t:t+``}function xc(e,t){if(uc(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(uc(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Sc(e){var t=e.search(Dc);if(!(t<0)){e=e.slice(t);var n;return e[0]===`+`&&(n=!0,e=e.slice(1)),e=e.replace(Oc,``),n&&(e=`+`+e),e}}function Cc(e){var t=Sc(e)||``;return t[0]===`+`?[t.slice(1),!0]:[t]}function wc(e){var t=dc(Cc(e),2),n=t[0],r=t[1];return Ec.test(n)||(n=``),[n,r]}var Tc,Ec,Dc,Oc,kc,Ac,jc=n((()=>{Xt(),Jt(),Nt(),jt(),U(),L(),Tc=`[`+F+P+`]+`,Ec=RegExp(`^`+Tc+`$`,`i`),Dc=`(?:[`+I+`][`+F+P+`]*|[`+F+P+`]+)`,Oc=RegExp(`[^`+F+P+`]+.*$`),kc=/[^\d\[\]]/,Ac=function(){function e(t){var n=t.defaultCountry,r=t.defaultCallingCode,i=t.metadata,a=t.onNationalSignificantNumberChange;_c(this,e),this.defaultCountry=n,this.defaultCallingCode=r,this.metadata=i,this.onNationalSignificantNumberChange=a}return yc(e,[{key:`input`,value:function(e,t){var n=dc(wc(e),2),r=n[0],i=n[1],a=H(r),o;return i&&(t.digits||(t.startInternationalNumber(void 0,void 0),a||(o=!0))),a&&this.inputDigits(a,t),{digits:a,justLeadingPlus:o}}},{key:`inputDigits`,value:function(e,t){var n=t.digits,r=n.length<3&&n.length+e.length>=3;if(t.appendDigits(e),r&&this.extractIddPrefix(t),this.isWaitingForCountryCallingCode(t)){if(!this.extractCountryCallingCode(t))return}else t.appendNationalSignificantNumberDigits(e);t.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(t.getNationalDigits(),function(e){return t.update(e)})}},{key:`isWaitingForCountryCallingCode`,value:function(e){var t=e.international,n=e.callingCode;return t&&!n}},{key:`extractCountryCallingCode`,value:function(e){var t=Yt(`+`+e.getDigitsWithoutInternationalPrefix(),e.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=t.countryCallingCode,r=t.number;if(n)return e.setCallingCode(n),e.update({nationalSignificantNumber:r}),!0}},{key:`reset`,value:function(e){if(e){this.hasSelectedNumberingPlan=!0;var t=e._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=t&&kc.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:`extractNationalSignificantNumber`,value:function(e,t){if(this.hasSelectedNumberingPlan){var n=Mt(e,this.metadata),r=n.nationalPrefix,i=n.nationalNumber,a=n.carrierCode;if(i!==e)return this.onExtractedNationalNumber(r,a,i,e,t),!0}}},{key:`extractAnotherNationalSignificantNumber`,value:function(e,t,n){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,n);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var r=Mt(e,this.metadata),i=r.nationalPrefix,a=r.nationalNumber,o=r.carrierCode;if(a!==t)return this.onExtractedNationalNumber(i,o,a,e,n),!0}}},{key:`onExtractedNationalNumber`,value:function(e,t,n,r,i){var a=!1,o,s=r.lastIndexOf(n);if(s<0||s!==r.length-n.length)a=!0;else{var c=r.slice(0,s);c&&c!==e&&(o=c)}i({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:n,nationalSignificantNumberIsModified:a,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:o}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:`reExtractNationalSignificantNumber`,value:function(e){if(this.extractAnotherNationalSignificantNumber(e.getNationalDigits(),e.nationalSignificantNumber,function(t){return e.update(t)}))return!0;if(this.extractIddPrefix(e)||this.fixMissingPlus(e))return this.extractCallingCodeAndNationalSignificantNumber(e),!0}},{key:`extractIddPrefix`,value:function(e){var t=e.international,n=e.IDDPrefix,r=e.digits;if(e.nationalSignificantNumber,!(t||n)){var i=kt(r,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(i!==void 0&&i!==r)return e.update({IDDPrefix:r.slice(0,r.length-i.length)}),this.startInternationalNumber(e,{country:void 0,callingCode:void 0}),!0}}},{key:`fixMissingPlus`,value:function(e){if(!e.international){var t=qt(e.digits,e.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata).countryCallingCode;if(t)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:t}),!0}}},{key:`startInternationalNumber`,value:function(e,t){var n=t.country,r=t.callingCode;e.startInternationalNumber(n,r),e.nationalSignificantNumber&&(e.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:`extractCallingCodeAndNationalSignificantNumber`,value:function(e){this.extractCountryCallingCode(e)&&this.extractNationalSignificantNumber(e.getNationalDigits(),function(t){return e.update(t)})}}])}()}));function Mc(e){"@babel/helpers - typeof";return Mc=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Mc(e)}function Nc(e,t){return Rc(e)||Lc(e,t)||Fc(e,t)||Pc()}function Pc(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
153
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fc(e,t){if(e){if(typeof e==`string`)return Ic(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ic(e,t):void 0}}function Ic(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Lc(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Rc(e){if(Array.isArray(e))return e}function zc(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Bc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Hc(r.key),r)}}function Vc(e,t,n){return t&&Bc(e.prototype,t),n&&Bc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hc(e){var t=Uc(e,`string`);return Mc(t)==`symbol`?t:t+``}function Uc(e,t){if(Mc(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Mc(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wc(e,t,n){var r=n.getCountryCodesForCallingCode(e);if(r.length>1)return Lt(t,r,n.metadata)}var Gc,Kc,qc=n((()=>{k(),Kn(),j(),as(),lc(),jc(),Vt(),Rt(),E(),Gc=!1,Kc=function(){function e(t,n){zc(this,e),this.metadata=new O(n);var r=Nc(this.getCountryAndCallingCode(t),2),i=r[0],a=r[1];this.defaultCountry=i,this.defaultCallingCode=a,this.reset()}return Vc(e,[{key:`getCountryAndCallingCode`,value:function(e){var t,n;return e&&(T(e)?(t=e.defaultCountry,n=e.defaultCallingCode):t=e),t&&!this.metadata.hasCountry(t)&&(t=void 0),n&&Gc&&this.metadata.isNonGeographicCallingCode(n)&&(t=`001`),[t,n]}},{key:`input`,value:function(e){var t=this.parser.input(e,this.state),n=t.digits;if(t.justLeadingPlus)this.formattedOutput=`+`;else if(n){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var r;if(this.metadata.hasSelectedNumberingPlan()&&(r=this.formatter.format(n,this.state)),r===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var i=this.state.getNationalDigits();i&&(r=this.formatter.format(i,this.state))}this.formattedOutput=r?this.getFullNumber(r):this.getNonFormattedNumber()}return this.formattedOutput}},{key:`reset`,value:function(){var e=this;return this.state=new is({onCountryChange:function(t){e.country=t},onCallingCodeChange:function(t,n){e.metadata.selectNumberingPlan(n||t),e.formatter.reset(e.metadata.numberingPlan,e.state),e.parser.reset(e.metadata.numberingPlan)}}),this.formatter=new cc({state:this.state,metadata:this.metadata}),this.parser=new Ac({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){e.determineTheCountryIfNeeded(),e.formatter.reset(e.metadata.numberingPlan,e.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput=``,this}},{key:`isInternational`,value:function(){return this.state.international}},{key:`getCallingCode`,value:function(){if(this.isInternational())return this.state.callingCode}},{key:`getCountryCallingCode`,value:function(){return this.getCallingCode()}},{key:`getCountry`,value:function(){if(this.state.digits)return this._getCountry()}},{key:`_getCountry`,value:function(){var e=this.state.country;if(!(Gc&&e===`001`))return e}},{key:`determineTheCountryIfNeeded`,value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:`getFullNumber`,value:function(e){var t=this;if(this.isInternational()){var n=function(e){return t.formatter.getInternationalPrefixBeforeCountryCallingCode(t.state,{spacing:!!e})+e},r=this.state.callingCode;return n(r?e?`${r} ${e}`:r:`${this.state.getDigitsWithoutInternationalPrefix()}`)}return e}},{key:`getNonFormattedNationalNumberWithPrefix`,value:function(){var e=this.state,t=e.nationalSignificantNumber,n=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,r=e.nationalPrefix,i=t,a=n||r;return a&&(i=a+i),i}},{key:`getNonFormattedNumber`,value:function(){var e=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(e?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:`getNonFormattedTemplate`,value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,`x`)}},{key:`isCountryCallingCodeAmbiguous`,value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:`determineTheCountry`,value:function(){var e=zt(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata});e!==this.state.country&&(this.state.setCountry(e),e&&this.metadata.selectNumberingPlan(e))}},{key:`getNumberValue`,value:function(){var e=this.state,t=e.digits,n=e.callingCode,r=e.country,i=e.nationalSignificantNumber;if(t){if(this.isInternational())return n?`+`+n+i:`+`+t;if(r||n)return`+`+(r?this.metadata.countryCallingCode():n)+i}}},{key:`getNumber`,value:function(){var e=this.state,t=e.nationalSignificantNumber,n=e.carrierCode,r=e.callingCode;if(t){var i=this._getCountry();if(!(!i&&!r)){if(i&&i===this.defaultCountry){var a=Wc(this.metadata.numberingPlan.callingCode(),t,this.metadata);a&&(i=a)}var o=new z(i||r,t,this.metadata.metadata);return n&&(o.carrierCode=n),o}}}},{key:`isPossible`,value:function(){var e=this.getNumber();return e?e.isPossible():!1}},{key:`isValid`,value:function(){var e=this.getNumber();return e?e.isValid():!1}},{key:`validateLength`,value:function(){var e=this.state,t=e.digits,n=e.nationalSignificantNumber;if(!t)return`NOT_A_NUMBER`;if(!this.metadata.numberingPlan)return`INVALID_COUNTRY`;if(!n)return`TOO_SHORT`;var r=A(n,void 0,this.metadata);if(r!==`IS_POSSIBLE`)return r}},{key:`getNationalNumber`,value:function(){return this.state.nationalSignificantNumber}},{key:`getChars`,value:function(){return(this.state.international?`+`:``)+this.state.digits}},{key:`getTemplate`,value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||``}}])}()}));function Jc(e){return new O(e).getCountries()}var Yc=n((()=>{k()}));function Xc(e,t,n){if(t[e])return new z(e,t[e],n)}var Zc=n((()=>{Kn()}));function Qc(e,t,n){return n||(n=t,t=void 0),new Kc(t,n).input(e)}var $c=n((()=>{qc()})),X=n((()=>{Kn(),cr(),mi(),wi(),Mi(),Bi(),Ji(),ko(),Fo(),Uo(),Zo(),Do(),qc(),lc(),Yc(),k(),Zc(),$c(),Sr(),U(),En()}));function el(){return C(pi,arguments)}var tl=n((()=>{w(),X()}));function nl(){return C(Ci,arguments)}var rl=n((()=>{w(),X()}));function il(){return C(ji,arguments)}var al=n((()=>{w(),X()}));function ol(){return C(zi,arguments)}var sl=n((()=>{w(),X()}));function cl(){return C(qi,arguments)}var ll=n((()=>{w(),X()}));function ul(){return C(Oo,arguments)}var dl=n((()=>{w(),X()}));function fl(){return C(Po,arguments)}var pl=n((()=>{w(),X()}));function ml(){return C(Ho,arguments)}var hl=n((()=>{w(),X()}));function gl(){return C(Xo,arguments)}var _l=n((()=>{w(),X()}));function vl(e,t){return Y.call(this,e,t,x)}var yl=n((()=>{S(),X(),vl.prototype=Object.create(Y.prototype,{}),vl.prototype.constructor=vl}));function bl(e){return Kc.call(this,e,x)}var xl=n((()=>{S(),X(),bl.prototype=Object.create(Kc.prototype,{}),bl.prototype.constructor=bl}));function Sl(){return C(Be,arguments)}var Cl=n((()=>{w(),X()}));function wl(){return C(Jc,arguments)}var Tl=n((()=>{w(),X()}));function El(){return C(ze,arguments)}var Dl=n((()=>{w(),X()}));function Ol(){return C(Re,arguments)}var kl=n((()=>{w(),X()}));function Al(){return O.call(this,x)}var jl=n((()=>{S(),X(),Al.prototype=Object.create(O.prototype,{}),Al.prototype.constructor=Al}));function Ml(){return C(Xc,arguments)}var Nl=n((()=>{w(),X()}));function Pl(){return C(Qc,arguments)}var Fl=n((()=>{w(),X()}));function Il(e){return z.call(this,e,x)}var Ll=n((()=>{S(),X(),Il.prototype=z.prototype,Il.prototype.constructor=Il}));function Rl(){var e=K(arguments),t=e.text,n=e.options,r=e.metadata;return W(t,n,r)}var zl=n((()=>{G(),q()}));function Bl(){return C(Rl,arguments)}var Vl=n((()=>{w(),zl()}));function Hl(){var e=Ul(arguments),t=e.input,n=e.format,r=e.options,i=e.metadata;return Dn(t,n,r,i)}function Ul(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o,s,c,l;if(typeof t==`string`)if(typeof r==`string`)s=r,a?(c=i,l=a):l=i,o=W(t,{defaultCountry:n,extended:!0},l);else{if(typeof n!=`string`)throw Error("`format` argument not passed to `formatNumber(number, format)`");s=n,i?(c=r,l=i):l=r,o=W(t,{extended:!0},l)}else if(T(t))o=t,s=n,i?(c=r,l=i):l=r;else throw TypeError(`A phone number must either be a string or an object of shape { phone, [country] }.`);return s===`International`?s=`INTERNATIONAL`:s===`National`&&(s=`NATIONAL`),{input:o,format:s,options:c,metadata:l}}var Wl=n((()=>{Fn(),G(),E()}));function Gl(){return C(Hl,arguments)}var Kl=n((()=>{w(),Wl()}));function ql(){var e=Jl(arguments),t=e.input,n=e.options,r=e.metadata;if(t.phone)return ct(t,n,r)}function Jl(e){var t=e[0],n=e[1],r=e[2],i=e[3],a,o={},s;if(typeof t==`string`)T(n)?(r?(o=n,s=r):s=n,a=ln(t)?W(t,void 0,s):{}):(i?(o=r,s=i):s=r,a=ln(t)?W(t,{defaultCountry:n},s):{});else if(T(t))a=t,r?(o=n,s=r):s=n;else throw TypeError(`A phone number must either be a string or an object of shape { phone, [country] }.`);return{input:a,options:o,metadata:s}}var Yl=n((()=>{gn(),dt(),E(),G()}));function Xl(){return C(ql,arguments)}var Zl=n((()=>{w(),Yl()}));function Ql(){var e=Jl(arguments),t=e.input,n=e.options,r=e.metadata;return!t.phone&&!(n&&n.v2)?!1:nt(t,n,r)}var $l=n((()=>{Yl(),it()}));function eu(){return C(Ql,arguments)}var tu=n((()=>{w(),$l()}));function nu(){var e=Jl(arguments),t=e.input,n=e.options,r=e.metadata;return t.phone?ft(t,n,r):!1}var ru=n((()=>{pt(),Yl()}));function iu(){return C(nu,arguments)}var au=n((()=>{w(),ru()}));function ou(e,t,n,r){return n||={},e.country===t&&ft(e,n,r)}var su=n((()=>{pt()}));function cu(e,t,n){if(typeof e!=`string`)throw TypeError(`number must be a string`);if(typeof t!=`string`)throw TypeError(`country must be a string`);return ou(ln(e)?W(e,{defaultCountry:t},n):{},t,void 0,n)}var lu=n((()=>{gn(),G(),su()}));function uu(){return C(cu,arguments)}var du=n((()=>{w(),lu()}));function fu(e){"@babel/helpers - typeof";return fu=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},fu(e)}function pu(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function mu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,gu(r.key),r)}}function hu(e,t,n){return t&&mu(e.prototype,t),n&&mu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gu(e){var t=_u(e,`string`);return fu(t)==`symbol`?t:t+``}function _u(e,t){if(fu(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(fu(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var vu,yu,Z,bu=n((()=>{G(),gn(),Ua(),Ja(),io(),L(),vu=RegExp(`^[`+Et+`]+`),yu=RegExp(`[`+F+`]+$`),Z=function(){function e(t,n,r){pu(this,e),this.text=t,this.options=n||{},this.metadata=r,this.state=`NOT_READY`,this.regexp=new RegExp(mn,`ig`)}return hu(e,[{key:`find`,value:function(){var e=this.regexp.exec(this.text);if(e){var t=e[0],n=e.index;return t=t.replace(vu,``),n+=e[0].length-t.length,t=t.replace(yu,``),t=Va(t),this.parseCandidate(t,n)||this.find()}}},{key:`parseCandidate`,value:function(e,t){if(Wa(e,t,this.text)&&Ya(e,t,this.text,this.options.extended?`POSSIBLE`:`VALID`)){var n=W(e,this.options,this.metadata);if(n.phone)return n.startsAt=t,n.endsAt=t+e.length,n}}},{key:`hasNext`,value:function(){return this.state===`NOT_READY`&&(this.last_match=this.find(),this.last_match?this.state=`READY`:this.state=`DONE`),this.state===`READY`}},{key:`next`,value:function(){if(!this.hasNext())throw Error(`No next element`);var e=this.last_match;return this.last_match=null,this.state=`NOT_READY`,e}}])}()}));function xu(e,t,n){t===void 0&&(t={});for(var r=new Z(e,t,n),i=[];r.hasNext();)i.push(r.next());return i}function Su(e,t,n){t===void 0&&(t={});var r=new Z(e,t,n),i=function(){return{next:function(){return r.hasNext()?{done:!1,value:r.next()}:{done:!0}}}},a={};return a[Symbol.iterator]=i,a}var Cu=n((()=>{cn(),bu(),on(`parsing`)}));function wu(){var e=K(arguments),t=e.text,n=e.options,r=e.metadata;return xu(t,n,r)}function Tu(){var e=K(arguments),t=e.text,n=e.options,r=e.metadata;return Su(t,n,r)}var Eu=n((()=>{Cu(),q()}));function Du(){return C(wu,arguments)}var Ou=n((()=>{w(),Eu()}));function ku(){return C(Tu,arguments)}var Au=n((()=>{w(),Eu()}));function ju(e,t){Z.call(this,e,t,x)}var Mu=n((()=>{S(),bu(),ju.prototype=Object.create(Z.prototype,{}),ju.prototype.constructor=ju})),Nu=r({AsYouType:()=>bl,AsYouTypeCustom:()=>Kc,DIGITS:()=>gr,DIGIT_PLACEHOLDER:()=>`x`,Metadata:()=>Al,ParseError:()=>V,PhoneNumber:()=>Il,PhoneNumberMatcher:()=>vl,PhoneNumberSearch:()=>ju,PhoneNumberSearchCustom:()=>Z,default:()=>nl,findNumbers:()=>ul,findPhoneNumbers:()=>Du,findPhoneNumbersCustom:()=>wu,findPhoneNumbersInText:()=>ml,format:()=>Gl,formatCustom:()=>Hl,formatIncompletePhoneNumber:()=>Pl,formatNumber:()=>Gl,formatRFC3966:()=>Tn,getCountries:()=>wl,getCountryCallingCode:()=>El,getCountryCallingCodeCustom:()=>ze,getExampleNumber:()=>Ml,getExtPrefix:()=>Ol,getNumberType:()=>Xl,getNumberTypeCustom:()=>ql,getPhoneCode:()=>El,getPhoneCodeCustom:()=>ze,isPossibleNumber:()=>eu,isPossiblePhoneNumber:()=>ol,isSupportedCountry:()=>Sl,isValidNumber:()=>iu,isValidNumberCustom:()=>nu,isValidNumberForRegion:()=>uu,isValidPhoneNumber:()=>il,parse:()=>Bl,parseCustom:()=>Rl,parseDigits:()=>H,parseIncompletePhoneNumber:()=>br,parseNumber:()=>Bl,parsePhoneNumber:()=>el,parsePhoneNumberCharacter:()=>xr,parsePhoneNumberFromString:()=>nl,parsePhoneNumberWithError:()=>el,parseRFC3966:()=>wn,searchNumbers:()=>fl,searchPhoneNumbers:()=>ku,searchPhoneNumbersCustom:()=>Tu,searchPhoneNumbersInText:()=>gl,validatePhoneNumberLength:()=>cl}),Pu=n((()=>{tl(),rl(),al(),sl(),ll(),dl(),pl(),hl(),_l(),yl(),xl(),lc(),Cl(),Tl(),Dl(),kl(),jl(),Nl(),Fl(),Ll(),X(),Vl(),Kl(),Zl(),tu(),au(),du(),Ou(),Au(),Mu(),U(),zl(),Wl(),ru(),Eu(),bu(),Yl(),Kt(),qc()})),Fu=r({default:()=>Iu}),Iu,Lu=n((()=>{Iu={AC:`40123`,AD:`312345`,AE:`501234567`,AF:`701234567`,AG:`2684641234`,AI:`2642351234`,AL:`672123456`,AM:`77123456`,AO:`923123456`,AR:`91123456789`,AS:`6847331234`,AT:`664123456`,AU:`412345678`,AW:`5601234`,AX:`412345678`,AZ:`401234567`,BA:`61123456`,BB:`2462501234`,BD:`1812345678`,BE:`450001234`,BF:`70123456`,BG:`43012345`,BH:`36001234`,BI:`79561234`,BJ:`0195123456`,BL:`690001234`,BM:`4413701234`,BN:`7123456`,BO:`71234567`,BQ:`3181234`,BR:`11961234567`,BS:`2423591234`,BT:`17123456`,BW:`71123456`,BY:`294911911`,BZ:`6221234`,CA:`5062345678`,CC:`412345678`,CD:`991234567`,CF:`70012345`,CG:`061234567`,CH:`781234567`,CI:`0123456789`,CK:`71234`,CL:`221234567`,CM:`671234567`,CN:`13123456789`,CO:`3211234567`,CR:`83123456`,CU:`51234567`,CV:`9911234`,CW:`95181234`,CX:`412345678`,CY:`96123456`,CZ:`601123456`,DE:`15123456789`,DJ:`77831001`,DK:`34412345`,DM:`7672251234`,DO:`8092345678`,DZ:`551234567`,EC:`991234567`,EE:`51234567`,EG:`1001234567`,EH:`650123456`,ER:`7123456`,ES:`612345678`,ET:`911234567`,FI:`412345678`,FJ:`7012345`,FK:`51234`,FM:`3501234`,FO:`211234`,FR:`612345678`,GA:`06031234`,GB:`7400123456`,GD:`4734031234`,GE:`555123456`,GF:`694201234`,GG:`7781123456`,GH:`231234567`,GI:`57123456`,GL:`221234`,GM:`3012345`,GN:`601123456`,GP:`690001234`,GQ:`222123456`,GR:`6912345678`,GT:`51234567`,GU:`6713001234`,GW:`955012345`,GY:`6091234`,HK:`51234567`,HN:`91234567`,HR:`921234567`,HT:`34101234`,HU:`201234567`,ID:`812345678`,IE:`850123456`,IL:`502345678`,IM:`7924123456`,IN:`8123456789`,IO:`3801234`,IQ:`7912345678`,IR:`9123456789`,IS:`6111234`,IT:`3123456789`,JE:`7797712345`,JM:`8762101234`,JO:`790123456`,JP:`9012345678`,KE:`712123456`,KG:`700123456`,KH:`91234567`,KI:`72001234`,KM:`3212345`,KN:`8697652917`,KP:`1921234567`,KR:`1020000000`,KW:`50012345`,KY:`3453231234`,KZ:`7710009998`,LA:`2023123456`,LB:`71123456`,LC:`7582845678`,LI:`660234567`,LK:`712345678`,LR:`770123456`,LS:`50123456`,LT:`61234567`,LU:`628123456`,LV:`21234567`,LY:`912345678`,MA:`650123456`,MC:`612345678`,MD:`62112345`,ME:`60123456`,MF:`690001234`,MG:`321234567`,MH:`2351234`,MK:`72345678`,ML:`65012345`,MM:`92123456`,MN:`88123456`,MO:`66123456`,MP:`6702345678`,MQ:`696201234`,MR:`22123456`,MS:`6644923456`,MT:`96961234`,MU:`52512345`,MV:`7712345`,MW:`991234567`,MX:`2221234567`,MY:`123456789`,MZ:`821234567`,NA:`811234567`,NC:`751234`,NE:`93123456`,NF:`381234`,NG:`8021234567`,NI:`81234567`,NL:`612345678`,NO:`40612345`,NP:`9841234567`,NR:`5551234`,NU:`8884012`,NZ:`211234567`,OM:`92123456`,PA:`61234567`,PE:`912345678`,PF:`87123456`,PG:`70123456`,PH:`9051234567`,PK:`3012345678`,PL:`512345678`,PM:`551234`,PR:`7872345678`,PS:`599123456`,PT:`912345678`,PW:`6201234`,PY:`961456789`,QA:`33123456`,RE:`692123456`,RO:`712034567`,RS:`601234567`,RU:`9123456789`,RW:`720123456`,SA:`512345678`,SB:`7421234`,SC:`2510123`,SD:`911231234`,SE:`701234567`,SG:`81234567`,SH:`51234`,SI:`31234567`,SJ:`41234567`,SK:`912123456`,SL:`25123456`,SM:`66661212`,SN:`701234567`,SO:`71123456`,SR:`7412345`,SS:`977123456`,ST:`9812345`,SV:`70123456`,SX:`7215205678`,SY:`944567890`,SZ:`76123456`,TA:`8999`,TC:`6492311234`,TD:`63012345`,TG:`90112345`,TH:`812345678`,TJ:`917123456`,TK:`7290`,TL:`77212345`,TM:`66123456`,TN:`20123456`,TO:`7715123`,TR:`5012345678`,TT:`8682911234`,TV:`901234`,TW:`912345678`,TZ:`621234567`,UA:`501234567`,UG:`712345678`,US:`2015550123`,UY:`94231234`,UZ:`912345678`,VA:`3123456789`,VC:`7844301234`,VE:`4121234567`,VG:`2843001234`,VI:`3406421234`,VN:`912345678`,VU:`5912345`,WF:`821234`,WS:`7212345`,XK:`43201234`,YE:`712345678`,YT:`639012345`,ZA:`711234567`,ZM:`955123456`,ZW:`712345678`}})),Ru=e=>`wui-flag wui-flag-${String(e).toLowerCase()}`,Q=null,zu=null;function Bu(){return Q?Promise.resolve(Q):(zu||=Promise.all([Promise.resolve().then(()=>(Pu(),Nu)),Promise.resolve().then(()=>(Lu(),Fu))]).then(([e,t])=>(Q={AsYouType:e.AsYouType,getExampleNumber:e.getExampleNumber,isValidPhoneNumber:e.isValidPhoneNumber,examples:t.default||t},Q)).catch(()=>null),zu)}function Vu(e,t){if(!Q||!t)return t;try{return new Q.AsYouType(e).input(t)}catch{return t}}function Hu(e){if(!Q)return null;try{return Q.getExampleNumber(e,Q.examples)?.formatNational()||null}catch{return null}}function Uu(e){if(!Q||!e)return null;try{return Q.isValidPhoneNumber(e)}catch{return null}}function Wu(e){if(!Q)return null;try{let t=Q.getExampleNumber(e,Q.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function Gu(e){if(!Q||!e?.trim().startsWith(`+`))return null;try{let t=new Q.AsYouType;t.input(e.trim());let n=t.getCountry();return n?{country:n,national:t.getNationalNumber()||``}:null}catch{return null}}var Ku=class extends HTMLElement{static get observedAttributes(){return[`value`,`country`,`placeholder`,`disabled`]}constructor(){super(),this._country=`IN`,this._national=``}connectedCallback(){this._rendered||this.render()}attributeChangedCallback(e,t,n){this._rendered&&(e===`country`&&(this._country=n||`IN`),this.render())}get value(){return`+${we(this._country)}${this._national}`}set value(e){this._national=String(e??``).replace(/[^0-9]/g,``),this._commit()}_commit(){f(this,this.value),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){let e=this.getAttribute(`placeholder`)||Hu(this._country)||`Enter phone number`;this._country=this.getAttribute(`country`)||this._country;let t=Ce.map(([e,t,n])=>`<button type="button" role="option" class="country-dropdown-item${e===this._country?` selected`:``}" data-iso="${e}"><span class="${Ru(e)}" aria-hidden="true"></span><span class="country-name-text">${t}<span class="country-code-text">+${n}</span></span></button>`).join(``);this.innerHTML=`
153
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fc(e,t){if(e){if(typeof e==`string`)return Ic(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ic(e,t):void 0}}function Ic(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Lc(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Rc(e){if(Array.isArray(e))return e}function zc(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Bc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Hc(r.key),r)}}function Vc(e,t,n){return t&&Bc(e.prototype,t),n&&Bc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hc(e){var t=Uc(e,`string`);return Mc(t)==`symbol`?t:t+``}function Uc(e,t){if(Mc(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Mc(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wc(e,t,n){var r=n.getCountryCodesForCallingCode(e);if(r.length>1)return Lt(t,r,n.metadata)}var Gc,Kc,qc=n((()=>{k(),Kn(),j(),as(),lc(),jc(),Vt(),Rt(),E(),Gc=!1,Kc=function(){function e(t,n){zc(this,e),this.metadata=new O(n);var r=Nc(this.getCountryAndCallingCode(t),2),i=r[0],a=r[1];this.defaultCountry=i,this.defaultCallingCode=a,this.reset()}return Vc(e,[{key:`getCountryAndCallingCode`,value:function(e){var t,n;return e&&(T(e)?(t=e.defaultCountry,n=e.defaultCallingCode):t=e),t&&!this.metadata.hasCountry(t)&&(t=void 0),n&&Gc&&this.metadata.isNonGeographicCallingCode(n)&&(t=`001`),[t,n]}},{key:`input`,value:function(e){var t=this.parser.input(e,this.state),n=t.digits;if(t.justLeadingPlus)this.formattedOutput=`+`;else if(n){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var r;if(this.metadata.hasSelectedNumberingPlan()&&(r=this.formatter.format(n,this.state)),r===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var i=this.state.getNationalDigits();i&&(r=this.formatter.format(i,this.state))}this.formattedOutput=r?this.getFullNumber(r):this.getNonFormattedNumber()}return this.formattedOutput}},{key:`reset`,value:function(){var e=this;return this.state=new is({onCountryChange:function(t){e.country=t},onCallingCodeChange:function(t,n){e.metadata.selectNumberingPlan(n||t),e.formatter.reset(e.metadata.numberingPlan,e.state),e.parser.reset(e.metadata.numberingPlan)}}),this.formatter=new cc({state:this.state,metadata:this.metadata}),this.parser=new Ac({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){e.determineTheCountryIfNeeded(),e.formatter.reset(e.metadata.numberingPlan,e.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput=``,this}},{key:`isInternational`,value:function(){return this.state.international}},{key:`getCallingCode`,value:function(){if(this.isInternational())return this.state.callingCode}},{key:`getCountryCallingCode`,value:function(){return this.getCallingCode()}},{key:`getCountry`,value:function(){if(this.state.digits)return this._getCountry()}},{key:`_getCountry`,value:function(){var e=this.state.country;if(!(Gc&&e===`001`))return e}},{key:`determineTheCountryIfNeeded`,value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:`getFullNumber`,value:function(e){var t=this;if(this.isInternational()){var n=function(e){return t.formatter.getInternationalPrefixBeforeCountryCallingCode(t.state,{spacing:!!e})+e},r=this.state.callingCode;return n(r?e?`${r} ${e}`:r:`${this.state.getDigitsWithoutInternationalPrefix()}`)}return e}},{key:`getNonFormattedNationalNumberWithPrefix`,value:function(){var e=this.state,t=e.nationalSignificantNumber,n=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,r=e.nationalPrefix,i=t,a=n||r;return a&&(i=a+i),i}},{key:`getNonFormattedNumber`,value:function(){var e=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(e?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:`getNonFormattedTemplate`,value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,`x`)}},{key:`isCountryCallingCodeAmbiguous`,value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:`determineTheCountry`,value:function(){var e=zt(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata});e!==this.state.country&&(this.state.setCountry(e),e&&this.metadata.selectNumberingPlan(e))}},{key:`getNumberValue`,value:function(){var e=this.state,t=e.digits,n=e.callingCode,r=e.country,i=e.nationalSignificantNumber;if(t){if(this.isInternational())return n?`+`+n+i:`+`+t;if(r||n)return`+`+(r?this.metadata.countryCallingCode():n)+i}}},{key:`getNumber`,value:function(){var e=this.state,t=e.nationalSignificantNumber,n=e.carrierCode,r=e.callingCode;if(t){var i=this._getCountry();if(!(!i&&!r)){if(i&&i===this.defaultCountry){var a=Wc(this.metadata.numberingPlan.callingCode(),t,this.metadata);a&&(i=a)}var o=new z(i||r,t,this.metadata.metadata);return n&&(o.carrierCode=n),o}}}},{key:`isPossible`,value:function(){var e=this.getNumber();return e?e.isPossible():!1}},{key:`isValid`,value:function(){var e=this.getNumber();return e?e.isValid():!1}},{key:`validateLength`,value:function(){var e=this.state,t=e.digits,n=e.nationalSignificantNumber;if(!t)return`NOT_A_NUMBER`;if(!this.metadata.numberingPlan)return`INVALID_COUNTRY`;if(!n)return`TOO_SHORT`;var r=A(n,void 0,this.metadata);if(r!==`IS_POSSIBLE`)return r}},{key:`getNationalNumber`,value:function(){return this.state.nationalSignificantNumber}},{key:`getChars`,value:function(){return(this.state.international?`+`:``)+this.state.digits}},{key:`getTemplate`,value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||``}}])}()}));function Jc(e){return new O(e).getCountries()}var Yc=n((()=>{k()}));function Xc(e,t,n){if(t[e])return new z(e,t[e],n)}var Zc=n((()=>{Kn()}));function Qc(e,t,n){return n||(n=t,t=void 0),new Kc(t,n).input(e)}var $c=n((()=>{qc()})),X=n((()=>{Kn(),cr(),mi(),wi(),Mi(),Bi(),Ji(),ko(),Fo(),Uo(),Zo(),Do(),qc(),lc(),Yc(),k(),Zc(),$c(),Sr(),U(),En()}));function el(){return C(pi,arguments)}var tl=n((()=>{w(),X()}));function nl(){return C(Ci,arguments)}var rl=n((()=>{w(),X()}));function il(){return C(ji,arguments)}var al=n((()=>{w(),X()}));function ol(){return C(zi,arguments)}var sl=n((()=>{w(),X()}));function cl(){return C(qi,arguments)}var ll=n((()=>{w(),X()}));function ul(){return C(Oo,arguments)}var dl=n((()=>{w(),X()}));function fl(){return C(Po,arguments)}var pl=n((()=>{w(),X()}));function ml(){return C(Ho,arguments)}var hl=n((()=>{w(),X()}));function gl(){return C(Xo,arguments)}var _l=n((()=>{w(),X()}));function vl(e,t){return Y.call(this,e,t,x)}var yl=n((()=>{S(),X(),vl.prototype=Object.create(Y.prototype,{}),vl.prototype.constructor=vl}));function bl(e){return Kc.call(this,e,x)}var xl=n((()=>{S(),X(),bl.prototype=Object.create(Kc.prototype,{}),bl.prototype.constructor=bl}));function Sl(){return C(Be,arguments)}var Cl=n((()=>{w(),X()}));function wl(){return C(Jc,arguments)}var Tl=n((()=>{w(),X()}));function El(){return C(ze,arguments)}var Dl=n((()=>{w(),X()}));function Ol(){return C(Re,arguments)}var kl=n((()=>{w(),X()}));function Al(){return O.call(this,x)}var jl=n((()=>{S(),X(),Al.prototype=Object.create(O.prototype,{}),Al.prototype.constructor=Al}));function Ml(){return C(Xc,arguments)}var Nl=n((()=>{w(),X()}));function Pl(){return C(Qc,arguments)}var Fl=n((()=>{w(),X()}));function Il(e){return z.call(this,e,x)}var Ll=n((()=>{S(),X(),Il.prototype=z.prototype,Il.prototype.constructor=Il}));function Rl(){var e=K(arguments),t=e.text,n=e.options,r=e.metadata;return W(t,n,r)}var zl=n((()=>{G(),q()}));function Bl(){return C(Rl,arguments)}var Vl=n((()=>{w(),zl()}));function Hl(){var e=Ul(arguments),t=e.input,n=e.format,r=e.options,i=e.metadata;return Dn(t,n,r,i)}function Ul(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o,s,c,l;if(typeof t==`string`)if(typeof r==`string`)s=r,a?(c=i,l=a):l=i,o=W(t,{defaultCountry:n,extended:!0},l);else{if(typeof n!=`string`)throw Error("`format` argument not passed to `formatNumber(number, format)`");s=n,i?(c=r,l=i):l=r,o=W(t,{extended:!0},l)}else if(T(t))o=t,s=n,i?(c=r,l=i):l=r;else throw TypeError(`A phone number must either be a string or an object of shape { phone, [country] }.`);return s===`International`?s=`INTERNATIONAL`:s===`National`&&(s=`NATIONAL`),{input:o,format:s,options:c,metadata:l}}var Wl=n((()=>{Fn(),G(),E()}));function Gl(){return C(Hl,arguments)}var Kl=n((()=>{w(),Wl()}));function ql(){var e=Jl(arguments),t=e.input,n=e.options,r=e.metadata;if(t.phone)return ct(t,n,r)}function Jl(e){var t=e[0],n=e[1],r=e[2],i=e[3],a,o={},s;if(typeof t==`string`)T(n)?(r?(o=n,s=r):s=n,a=ln(t)?W(t,void 0,s):{}):(i?(o=r,s=i):s=r,a=ln(t)?W(t,{defaultCountry:n},s):{});else if(T(t))a=t,r?(o=n,s=r):s=n;else throw TypeError(`A phone number must either be a string or an object of shape { phone, [country] }.`);return{input:a,options:o,metadata:s}}var Yl=n((()=>{gn(),dt(),E(),G()}));function Xl(){return C(ql,arguments)}var Zl=n((()=>{w(),Yl()}));function Ql(){var e=Jl(arguments),t=e.input,n=e.options,r=e.metadata;return!t.phone&&!(n&&n.v2)?!1:nt(t,n,r)}var $l=n((()=>{Yl(),it()}));function eu(){return C(Ql,arguments)}var tu=n((()=>{w(),$l()}));function nu(){var e=Jl(arguments),t=e.input,n=e.options,r=e.metadata;return t.phone?ft(t,n,r):!1}var ru=n((()=>{pt(),Yl()}));function iu(){return C(nu,arguments)}var au=n((()=>{w(),ru()}));function ou(e,t,n,r){return n||={},e.country===t&&ft(e,n,r)}var su=n((()=>{pt()}));function cu(e,t,n){if(typeof e!=`string`)throw TypeError(`number must be a string`);if(typeof t!=`string`)throw TypeError(`country must be a string`);return ou(ln(e)?W(e,{defaultCountry:t},n):{},t,void 0,n)}var lu=n((()=>{gn(),G(),su()}));function uu(){return C(cu,arguments)}var du=n((()=>{w(),lu()}));function fu(e){"@babel/helpers - typeof";return fu=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},fu(e)}function pu(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function mu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,gu(r.key),r)}}function hu(e,t,n){return t&&mu(e.prototype,t),n&&mu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gu(e){var t=_u(e,`string`);return fu(t)==`symbol`?t:t+``}function _u(e,t){if(fu(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(fu(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var vu,yu,Z,bu=n((()=>{G(),gn(),Ua(),Ja(),io(),L(),vu=RegExp(`^[`+Et+`]+`),yu=RegExp(`[`+F+`]+$`),Z=function(){function e(t,n,r){pu(this,e),this.text=t,this.options=n||{},this.metadata=r,this.state=`NOT_READY`,this.regexp=new RegExp(mn,`ig`)}return hu(e,[{key:`find`,value:function(){var e=this.regexp.exec(this.text);if(e){var t=e[0],n=e.index;return t=t.replace(vu,``),n+=e[0].length-t.length,t=t.replace(yu,``),t=Va(t),this.parseCandidate(t,n)||this.find()}}},{key:`parseCandidate`,value:function(e,t){if(Wa(e,t,this.text)&&Ya(e,t,this.text,this.options.extended?`POSSIBLE`:`VALID`)){var n=W(e,this.options,this.metadata);if(n.phone)return n.startsAt=t,n.endsAt=t+e.length,n}}},{key:`hasNext`,value:function(){return this.state===`NOT_READY`&&(this.last_match=this.find(),this.last_match?this.state=`READY`:this.state=`DONE`),this.state===`READY`}},{key:`next`,value:function(){if(!this.hasNext())throw Error(`No next element`);var e=this.last_match;return this.last_match=null,this.state=`NOT_READY`,e}}])}()}));function xu(e,t,n){t===void 0&&(t={});for(var r=new Z(e,t,n),i=[];r.hasNext();)i.push(r.next());return i}function Su(e,t,n){t===void 0&&(t={});var r=new Z(e,t,n),i=function(){return{next:function(){return r.hasNext()?{done:!1,value:r.next()}:{done:!0}}}},a={};return a[Symbol.iterator]=i,a}var Cu=n((()=>{cn(),bu(),on(`parsing`)}));function wu(){var e=K(arguments),t=e.text,n=e.options,r=e.metadata;return xu(t,n,r)}function Tu(){var e=K(arguments),t=e.text,n=e.options,r=e.metadata;return Su(t,n,r)}var Eu=n((()=>{Cu(),q()}));function Du(){return C(wu,arguments)}var Ou=n((()=>{w(),Eu()}));function ku(){return C(Tu,arguments)}var Au=n((()=>{w(),Eu()}));function ju(e,t){Z.call(this,e,t,x)}var Mu=n((()=>{S(),bu(),ju.prototype=Object.create(Z.prototype,{}),ju.prototype.constructor=ju})),Nu=r({AsYouType:()=>bl,AsYouTypeCustom:()=>Kc,DIGITS:()=>gr,DIGIT_PLACEHOLDER:()=>`x`,Metadata:()=>Al,ParseError:()=>V,PhoneNumber:()=>Il,PhoneNumberMatcher:()=>vl,PhoneNumberSearch:()=>ju,PhoneNumberSearchCustom:()=>Z,default:()=>nl,findNumbers:()=>ul,findPhoneNumbers:()=>Du,findPhoneNumbersCustom:()=>wu,findPhoneNumbersInText:()=>ml,format:()=>Gl,formatCustom:()=>Hl,formatIncompletePhoneNumber:()=>Pl,formatNumber:()=>Gl,formatRFC3966:()=>Tn,getCountries:()=>wl,getCountryCallingCode:()=>El,getCountryCallingCodeCustom:()=>ze,getExampleNumber:()=>Ml,getExtPrefix:()=>Ol,getNumberType:()=>Xl,getNumberTypeCustom:()=>ql,getPhoneCode:()=>El,getPhoneCodeCustom:()=>ze,isPossibleNumber:()=>eu,isPossiblePhoneNumber:()=>ol,isSupportedCountry:()=>Sl,isValidNumber:()=>iu,isValidNumberCustom:()=>nu,isValidNumberForRegion:()=>uu,isValidPhoneNumber:()=>il,parse:()=>Bl,parseCustom:()=>Rl,parseDigits:()=>H,parseIncompletePhoneNumber:()=>br,parseNumber:()=>Bl,parsePhoneNumber:()=>el,parsePhoneNumberCharacter:()=>xr,parsePhoneNumberFromString:()=>nl,parsePhoneNumberWithError:()=>el,parseRFC3966:()=>wn,searchNumbers:()=>fl,searchPhoneNumbers:()=>ku,searchPhoneNumbersCustom:()=>Tu,searchPhoneNumbersInText:()=>gl,validatePhoneNumberLength:()=>cl}),Pu=n((()=>{tl(),rl(),al(),sl(),ll(),dl(),pl(),hl(),_l(),yl(),xl(),lc(),Cl(),Tl(),Dl(),kl(),jl(),Nl(),Fl(),Ll(),X(),Vl(),Kl(),Zl(),tu(),au(),du(),Ou(),Au(),Mu(),U(),zl(),Wl(),ru(),Eu(),bu(),Yl(),Kt(),qc()})),Fu=r({default:()=>Iu}),Iu,Lu=n((()=>{Iu={AC:`40123`,AD:`312345`,AE:`501234567`,AF:`701234567`,AG:`2684641234`,AI:`2642351234`,AL:`672123456`,AM:`77123456`,AO:`923123456`,AR:`91123456789`,AS:`6847331234`,AT:`664123456`,AU:`412345678`,AW:`5601234`,AX:`412345678`,AZ:`401234567`,BA:`61123456`,BB:`2462501234`,BD:`1812345678`,BE:`450001234`,BF:`70123456`,BG:`43012345`,BH:`36001234`,BI:`79561234`,BJ:`0195123456`,BL:`690001234`,BM:`4413701234`,BN:`7123456`,BO:`71234567`,BQ:`3181234`,BR:`11961234567`,BS:`2423591234`,BT:`17123456`,BW:`71123456`,BY:`294911911`,BZ:`6221234`,CA:`5062345678`,CC:`412345678`,CD:`991234567`,CF:`70012345`,CG:`061234567`,CH:`781234567`,CI:`0123456789`,CK:`71234`,CL:`221234567`,CM:`671234567`,CN:`13123456789`,CO:`3211234567`,CR:`83123456`,CU:`51234567`,CV:`9911234`,CW:`95181234`,CX:`412345678`,CY:`96123456`,CZ:`601123456`,DE:`15123456789`,DJ:`77831001`,DK:`34412345`,DM:`7672251234`,DO:`8092345678`,DZ:`551234567`,EC:`991234567`,EE:`51234567`,EG:`1001234567`,EH:`650123456`,ER:`7123456`,ES:`612345678`,ET:`911234567`,FI:`412345678`,FJ:`7012345`,FK:`51234`,FM:`3501234`,FO:`211234`,FR:`612345678`,GA:`06031234`,GB:`7400123456`,GD:`4734031234`,GE:`555123456`,GF:`694201234`,GG:`7781123456`,GH:`231234567`,GI:`57123456`,GL:`221234`,GM:`3012345`,GN:`601123456`,GP:`690001234`,GQ:`222123456`,GR:`6912345678`,GT:`51234567`,GU:`6713001234`,GW:`955012345`,GY:`6091234`,HK:`51234567`,HN:`91234567`,HR:`921234567`,HT:`34101234`,HU:`201234567`,ID:`812345678`,IE:`850123456`,IL:`502345678`,IM:`7924123456`,IN:`8123456789`,IO:`3801234`,IQ:`7912345678`,IR:`9123456789`,IS:`6111234`,IT:`3123456789`,JE:`7797712345`,JM:`8762101234`,JO:`790123456`,JP:`9012345678`,KE:`712123456`,KG:`700123456`,KH:`91234567`,KI:`72001234`,KM:`3212345`,KN:`8697652917`,KP:`1921234567`,KR:`1020000000`,KW:`50012345`,KY:`3453231234`,KZ:`7710009998`,LA:`2023123456`,LB:`71123456`,LC:`7582845678`,LI:`660234567`,LK:`712345678`,LR:`770123456`,LS:`50123456`,LT:`61234567`,LU:`628123456`,LV:`21234567`,LY:`912345678`,MA:`650123456`,MC:`612345678`,MD:`62112345`,ME:`60123456`,MF:`690001234`,MG:`321234567`,MH:`2351234`,MK:`72345678`,ML:`65012345`,MM:`92123456`,MN:`88123456`,MO:`66123456`,MP:`6702345678`,MQ:`696201234`,MR:`22123456`,MS:`6644923456`,MT:`96961234`,MU:`52512345`,MV:`7712345`,MW:`991234567`,MX:`2221234567`,MY:`123456789`,MZ:`821234567`,NA:`811234567`,NC:`751234`,NE:`93123456`,NF:`381234`,NG:`8021234567`,NI:`81234567`,NL:`612345678`,NO:`40612345`,NP:`9841234567`,NR:`5551234`,NU:`8884012`,NZ:`211234567`,OM:`92123456`,PA:`61234567`,PE:`912345678`,PF:`87123456`,PG:`70123456`,PH:`9051234567`,PK:`3012345678`,PL:`512345678`,PM:`551234`,PR:`7872345678`,PS:`599123456`,PT:`912345678`,PW:`6201234`,PY:`961456789`,QA:`33123456`,RE:`692123456`,RO:`712034567`,RS:`601234567`,RU:`9123456789`,RW:`720123456`,SA:`512345678`,SB:`7421234`,SC:`2510123`,SD:`911231234`,SE:`701234567`,SG:`81234567`,SH:`51234`,SI:`31234567`,SJ:`41234567`,SK:`912123456`,SL:`25123456`,SM:`66661212`,SN:`701234567`,SO:`71123456`,SR:`7412345`,SS:`977123456`,ST:`9812345`,SV:`70123456`,SX:`7215205678`,SY:`944567890`,SZ:`76123456`,TA:`8999`,TC:`6492311234`,TD:`63012345`,TG:`90112345`,TH:`812345678`,TJ:`917123456`,TK:`7290`,TL:`77212345`,TM:`66123456`,TN:`20123456`,TO:`7715123`,TR:`5012345678`,TT:`8682911234`,TV:`901234`,TW:`912345678`,TZ:`621234567`,UA:`501234567`,UG:`712345678`,US:`2015550123`,UY:`94231234`,UZ:`912345678`,VA:`3123456789`,VC:`7844301234`,VE:`4121234567`,VG:`2843001234`,VI:`3406421234`,VN:`912345678`,VU:`5912345`,WF:`821234`,WS:`7212345`,XK:`43201234`,YE:`712345678`,YT:`639012345`,ZA:`711234567`,ZM:`955123456`,ZW:`712345678`}})),Ru=e=>`wui-flag wui-flag-${String(e).toLowerCase()}`,Q=null,zu=null;function Bu(){return Q?Promise.resolve(Q):(zu||=Promise.all([Promise.resolve().then(()=>(Pu(),Nu)),Promise.resolve().then(()=>(Lu(),Fu))]).then(([e,t])=>(Q={AsYouType:e.AsYouType,getExampleNumber:e.getExampleNumber,isValidPhoneNumber:e.isValidPhoneNumber,examples:t.default||t},Q)).catch(()=>null),zu)}function Vu(e,t){if(!Q||!t)return t;try{return new Q.AsYouType(e).input(t)}catch{return t}}function Hu(e){if(!Q)return null;try{return Q.getExampleNumber(e,Q.examples)?.formatNational()||null}catch{return null}}function Uu(e){if(!Q||!e)return null;try{return Q.isValidPhoneNumber(e)}catch{return null}}function Wu(e){if(!Q)return null;try{let t=Q.getExampleNumber(e,Q.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function Gu(e){if(!Q||!e?.trim().startsWith(`+`))return null;try{let t=new Q.AsYouType;t.input(e.trim());let n=t.getCountry();return n?{country:n,national:t.getNationalNumber()||``}:null}catch{return null}}var Ku=class extends HTMLElement{static get observedAttributes(){return[`value`,`country`,`placeholder`,`disabled`]}constructor(){super(),this._country=`IN`,this._national=``}connectedCallback(){this._rendered||this.render()}attributeChangedCallback(e,t,n){this._rendered&&(e===`country`&&(this._country=n||`IN`),this.render())}get value(){return`+${we(this._country)}${this._national}`}set value(e){let t=String(e??``).trim(),n=Gu(t);if(n)this._country=n.country,this._national=n.national.replace(/[^0-9]/g,``);else if(t.startsWith(`+`)){let e=t.replace(/[^0-9]/g,``),n=String(we(this._country));n&&e.startsWith(n)&&(e=e.slice(n.length)),this._national=e}else this._national=t.replace(/[^0-9]/g,``);n&&this.getAttribute(`country`)!==this._country?this.setAttribute(`country`,this._country):this._rendered&&this.render(),this._commit()}_commit(){f(this,this.value),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){let e=this.getAttribute(`placeholder`)||Hu(this._country)||`Enter phone number`;this._country=this.getAttribute(`country`)||this._country;let t=Ce.map(([e,t,n])=>`<button type="button" role="option" class="country-dropdown-item${e===this._country?` selected`:``}" data-iso="${e}"><span class="${Ru(e)}" aria-hidden="true"></span><span class="country-name-text">${t}<span class="country-code-text">+${n}</span></span></button>`).join(``);this.innerHTML=`
154
154
  <div class="phone-input-wrap">
155
155
  <div class="phone-country-adornment">
156
156
  <button type="button" class="country-toggle" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute(`disabled`)?` disabled`:``}>
@@ -165,7 +165,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
165
165
  </div>
166
166
  <input type="tel" class="input" placeholder="${qu(e)}" value="${qu(Vu(this._country,this._national))}"${this.hasAttribute(`disabled`)?` disabled`:``} />
167
167
  </div>
168
- <div class="field-error" data-phone-error hidden></div>`,this._rendered=!0,f(this,this.value),this._wire()}_wire(){let e=this.querySelector(`.country-toggle`),t=this.querySelector(`.phone-input-wrap`),n=this.querySelector(`.country-dropdown-menu`),r=this.querySelector(`.dropdown-search-input`),i=this.querySelector(`.country-list-scroll`),a=this.querySelector(`.country-empty`),o=this.querySelector(`input[type=tel]`),s=this.querySelector(`[data-flag]`),c=this.querySelector(`[data-dial]`);if(!e||!n)return;let l=()=>!n.hidden,u=()=>{let r=(t||e).getBoundingClientRect(),i=n.offsetWidth||320,a=n.offsetHeight||320,o=window.innerHeight-r.bottom,s=o<a+6&&r.top>o?r.top-a-6:r.bottom+6,c=Math.min(Math.max(8,r.left),Math.max(8,window.innerWidth-i-8));n.style.top=`${Math.max(8,s)}px`,n.style.left=`${c}px`},d=()=>{n.hidden=!1,e.setAttribute(`aria-expanded`,`true`),r.value=``,m(``),u(),r.focus()},p=()=>{n.hidden=!0,e.setAttribute(`aria-expanded`,`false`)};this._reposition=()=>{l()&&u()},window.addEventListener(`scroll`,this._reposition,!0),window.addEventListener(`resize`,this._reposition);let m=e=>{let t=e.trim().toLowerCase(),n=0;for(let e of i.querySelectorAll(`.country-dropdown-item`)){let r=!t||e.textContent.toLowerCase().includes(t);e.hidden=!r,r&&(n+=1)}a&&(a.hidden=n>0)},h=e=>{this._country=e,this.setAttribute(`country`,e),s&&(s.className=Ru(e)),c&&(c.textContent=`+${we(e)}`);for(let t of i.querySelectorAll(`.country-dropdown-item`))t.classList.toggle(`selected`,t.dataset.iso===e);p(),this._commit()};e.addEventListener(`click`,()=>l()?p():d()),r.addEventListener(`input`,()=>m(r.value)),i.addEventListener(`click`,e=>{let t=e.target.closest(`.country-dropdown-item`);t&&h(t.dataset.iso)});let g=this.querySelector(`[data-phone-error]`),_=e=>{if(o.classList.toggle(`is-invalid`,e),e?o.setAttribute(`aria-invalid`,`true`):o.removeAttribute(`aria-invalid`),g){if(e){let e=Hu(this._country);g.textContent=e?`Enter a valid phone number, e.g. ${e}`:`Enter a valid phone number`}g.hidden=!e}};o.addEventListener(`input`,()=>{let e=o.value.replace(/[^0-9]/g,``),t=Wu(this._country);t&&e.length>t&&(e=e.slice(0,t)),this._national=e;let n=Vu(this._country,this._national);o.value!==n&&(o.value=n),this._commit(),o.classList.contains(`is-invalid`)&&(!this._national||Uu(this.value)===!0)&&_(!1)}),o.addEventListener(`blur`,()=>{_(this._national.length>0&&Uu(this.value)===!1)}),o.addEventListener(`paste`,e=>{let t=Gu(e.clipboardData?.getData(`text`));t&&(e.preventDefault(),this._national=t.national.replace(/[^0-9]/g,``),t.country===this._country?o.value=Vu(this._country,this._national):this.setAttribute(`country`,t.country),this._commit(),this.querySelector(`input[type=tel]`)?.focus())}),this._onDocClick=e=>{l()&&!this.contains(e.target)&&p()},document.addEventListener(`click`,this._onDocClick),Bu().then(e=>{if(!(!e||!o)&&(this._national&&(o.value=Vu(this._country,this._national)),!this.getAttribute(`placeholder`))){let e=Hu(this._country);e&&(o.placeholder=e)}}),f(this,this.value)}disconnectedCallback(){this._reposition&&(window.removeEventListener(`scroll`,this._reposition,!0),window.removeEventListener(`resize`,this._reposition)),this._onDocClick&&document.removeEventListener(`click`,this._onDocClick)}},qu=e=>String(e??``).replace(/"/g,`&quot;`).replace(/</g,`&lt;`),Ju=class extends HTMLElement{static get observedAttributes(){return[`value`,`placeholder`,`search-placeholder`,`searchable`,`disabled`,`compact`,`size`,`clearable`,`icon`,`prefix`,`aria-label`]}_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}constructor(){super(),this._value=``,this._optionsProp=null,this._active=-1}connectedCallback(){this._rendered||this.render()}attributeChangedCallback(e,t,n){this._rendered&&(e===`value`?this.value=n:this.render())}get value(){return this._value}set value(e){this._value=e==null?``:String(e),f(this,this._value),this._syncSelected(),this._syncReset()}set options(e){this._optionsProp=Array.isArray(e)?e:null,this.isConnected&&this.render()}get options(){return this._readOptions()}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>({value:e.getAttribute(`value`)??e.textContent.trim(),label:e.innerHTML,icon:e.getAttribute(`icon`)||void 0,[p]:!0,selected:e.hasAttribute(`selected`)})))}_readOptions(){return this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}render(){this._snapshotDeclared();let e=this._readOptions(),t=this.hasAttribute(`searchable`),n=this.hasAttribute(`clearable`),r=this.getAttribute(`size`),i=r===`sm`?` search-select-sm`:r===`lg`?` search-select-lg`:``,a=this.getAttribute(`icon`),o=this.getAttribute(`prefix`),s=this.getAttribute(`placeholder`)||`Select...`,c=this.getAttribute(`search-placeholder`)||`Search...`,l=e.find(e=>String(e.value)===String(this._value))||e.find(e=>e.selected);l&&(this._value=String(l.value)),f(this,this._value);let u=e.map(e=>{let t=String(e.value)===String(this._value);return`<button type="button" role="option" class="search-select-option${t?` selected`:``}" data-value="${Yu(e.value)}" aria-selected="${t}">${g(e)}</button>`}).join(``);this.innerHTML=`
168
+ <div class="field-error" data-phone-error hidden></div>`,this._rendered=!0,f(this,this.value),this._wire()}_wire(){let e=this.querySelector(`.country-toggle`),t=this.querySelector(`.phone-input-wrap`),n=this.querySelector(`.country-dropdown-menu`),r=this.querySelector(`.dropdown-search-input`),i=this.querySelector(`.country-list-scroll`),a=this.querySelector(`.country-empty`),o=this.querySelector(`input[type=tel]`),s=this.querySelector(`[data-flag]`),c=this.querySelector(`[data-dial]`);if(!e||!n)return;let l=()=>!n.hidden,u=()=>{let r=(t||e).getBoundingClientRect(),i=n.offsetWidth||320,a=n.offsetHeight||320,o=window.innerHeight-r.bottom,s=o<a+6&&r.top>o?r.top-a-6:r.bottom+6,c=Math.min(Math.max(8,r.left),Math.max(8,window.innerWidth-i-8));n.style.top=`${Math.max(8,s)}px`,n.style.left=`${c}px`},d=()=>{n.hidden=!1,e.setAttribute(`aria-expanded`,`true`),r.value=``,m(``),u(),r.focus()},p=()=>{n.hidden=!0,e.setAttribute(`aria-expanded`,`false`)};this._reposition=()=>{l()&&u()},window.addEventListener(`scroll`,this._reposition,!0),window.addEventListener(`resize`,this._reposition);let m=e=>{let t=e.trim().toLowerCase(),n=0;for(let e of i.querySelectorAll(`.country-dropdown-item`)){let r=!t||e.textContent.toLowerCase().includes(t);e.hidden=!r,r&&(n+=1)}a&&(a.hidden=n>0)},h=e=>{this._country=e,this.setAttribute(`country`,e),s&&(s.className=Ru(e)),c&&(c.textContent=`+${we(e)}`);for(let t of i.querySelectorAll(`.country-dropdown-item`))t.classList.toggle(`selected`,t.dataset.iso===e);p(),this._commit()};e.addEventListener(`click`,()=>l()?p():d()),r.addEventListener(`input`,()=>m(r.value)),i.addEventListener(`click`,e=>{let t=e.target.closest(`.country-dropdown-item`);t&&h(t.dataset.iso)});let g=this.querySelector(`[data-phone-error]`),_=e=>{if(o.classList.toggle(`is-invalid`,e),e?o.setAttribute(`aria-invalid`,`true`):o.removeAttribute(`aria-invalid`),g){if(e){let e=Hu(this._country);g.textContent=e?`Enter a valid phone number, e.g. ${e}`:`Enter a valid phone number`}g.hidden=!e}};o.addEventListener(`input`,()=>{let e=o.value.replace(/[^0-9]/g,``),t=Wu(this._country);t&&e.length>t&&(e=e.slice(0,t)),this._national=e;let n=Vu(this._country,this._national);o.value!==n&&(o.value=n),this._commit(),o.classList.contains(`is-invalid`)&&(!this._national||Uu(this.value)===!0)&&_(!1)}),o.addEventListener(`blur`,()=>{_(this._national.length>0&&Uu(this.value)===!1)}),o.addEventListener(`paste`,e=>{let t=Gu(e.clipboardData?.getData(`text`));t&&(e.preventDefault(),this._national=t.national.replace(/[^0-9]/g,``),t.country===this._country?o.value=Vu(this._country,this._national):this.setAttribute(`country`,t.country),this._commit(),this.querySelector(`input[type=tel]`)?.focus())}),this._onDocClick=e=>{l()&&!this.contains(e.target)&&p()},document.addEventListener(`click`,this._onDocClick),Bu().then(e=>{if(!(!e||!o)&&(this._national&&(o.value=Vu(this._country,this._national)),!this.getAttribute(`placeholder`))){let e=Hu(this._country);e&&(o.placeholder=e)}}),f(this,this.value)}disconnectedCallback(){this._reposition&&(window.removeEventListener(`scroll`,this._reposition,!0),window.removeEventListener(`resize`,this._reposition)),this._onDocClick&&document.removeEventListener(`click`,this._onDocClick)}},qu=e=>String(e??``).replace(/"/g,`&quot;`).replace(/</g,`&lt;`),Ju=class extends HTMLElement{static get observedAttributes(){return[`value`,`placeholder`,`search-placeholder`,`searchable`,`disabled`,`compact`,`size`,`clearable`,`icon`,`prefix`,`aria-label`]}_accessibleName(){return this.getAttribute(`aria-label`)||this.getAttribute(`placeholder`)||`Select`}constructor(){super(),this._value=``,this._optionsProp=null,this._active=-1}connectedCallback(){this._rendered||this.render()}attributeChangedCallback(e,t,n){if(e===`value`){this.value=n;return}this._rendered&&this.render()}get value(){return this._value}set value(e){this._value=e==null?``:String(e),f(this,this._value),this._syncSelected(),this._syncReset()}set options(e){this._optionsProp=Array.isArray(e)?e:null,this.isConnected&&this.render()}get options(){return this._readOptions()}_snapshotDeclared(){if(this._declared)return;let e=[...this.querySelectorAll(`:scope > wui-option`)];e.length&&(this._declared=e.map(e=>({value:e.getAttribute(`value`)??e.textContent.trim(),label:e.innerHTML,icon:e.getAttribute(`icon`)||void 0,[p]:!0,selected:e.hasAttribute(`selected`)})))}_readOptions(){return this._optionsProp?this._optionsProp:(this._snapshotDeclared(),this._declared||[])}render(){this._snapshotDeclared();let e=this._readOptions(),t=this.hasAttribute(`searchable`),n=this.hasAttribute(`clearable`),r=this.getAttribute(`size`),i=r===`sm`?` search-select-sm`:r===`lg`?` search-select-lg`:``,a=this.getAttribute(`icon`),o=this.getAttribute(`prefix`),s=this.getAttribute(`placeholder`)||`Select...`,c=this.getAttribute(`search-placeholder`)||`Search...`,l=e.find(e=>String(e.value)===String(this._value))||e.find(e=>e.selected);l&&(this._value=String(l.value)),f(this,this._value);let u=e.map(e=>{let t=String(e.value)===String(this._value);return`<button type="button" role="option" class="search-select-option${t?` selected`:``}" data-value="${Yu(e.value)}" aria-selected="${t}">${g(e)}</button>`}).join(``);this.innerHTML=`
169
169
  <div class="search-select${this.hasAttribute(`compact`)?` search-select-compact`:``}${i}">
170
170
  <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${Yu(this._accessibleName())}"${this.hasAttribute(`disabled`)?` disabled`:``}>
171
171
  ${a?`<i class="bi bi-${Yu(a)} search-select-icon" aria-hidden="true"></i>`:``}
@@ -178,4 +178,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
178
178
  ${t?`<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${Yu(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>`:``}
179
179
  <div class="search-select-options">${u}<div class="search-select-empty" hidden>No matches</div></div>
180
180
  </div>
181
- </div>`,this._rendered=!0,f(this,this._value),this._wire(),this._syncReset()}_refs(){return{control:this.querySelector(`.search-select-control`),menu:this.querySelector(`.search-select-menu`),label:this.querySelector(`[data-label]`),reset:this.querySelector(`.search-select-reset`),search:this.querySelector(`.search-select-input`),clear:this.querySelector(`.search-select-clear`),empty:this.querySelector(`.search-select-empty`),optionsWrap:this.querySelector(`.search-select-options`)}}_optionEls(){return[...this.querySelectorAll(`.search-select-option`)]}_visible(){return this._optionEls().filter(e=>!e.hidden)}_syncSelected(){let{label:e}=this._refs(),t=this._readOptions().find(e=>String(e.value)===String(this._value));for(let e of this._optionEls()){let t=e.dataset.value===String(this._value);e.classList.toggle(`selected`,t),e.setAttribute(`aria-selected`,String(t))}e&&(e.innerHTML=t?g(t):e.innerHTML,e.classList.toggle(`search-select-placeholder`,!t))}_syncReset(){let{reset:e}=this._refs();e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._value!==``&&!this.hasAttribute(`disabled`)))}_wire(){let e=this._refs();if(!e.control||!e.menu)return;let t=()=>{if(this.hasAttribute(`compact`)){let t=e.control.getBoundingClientRect();e.menu.style.width=`max-content`,e.menu.style.minWidth=`${t.width}px`,e.menu.style.maxWidth=`280px`,c(e.control,e.menu)}else c(e.control,e.menu,{matchWidth:!0})},n=e=>{let t=this._visible();this._active=e;for(let e of this._optionEls())e.classList.remove(`is-active`);e>=0&&t[e]&&(t[e].classList.add(`is-active`),t[e].scrollIntoView({block:`nearest`}))},r=t=>{let n=t.trim().toLowerCase(),r=0;for(let e of this._optionEls()){let t=!n||e.textContent.toLowerCase().includes(n);e.hidden=!t,t&&(r+=1)}e.empty&&(e.empty.hidden=r>0),e.clear&&(e.clear.hidden=!n)},i=()=>!e.menu.hidden,a=()=>{e.menu.hidden=!1,e.control.setAttribute(`aria-expanded`,`true`),e.control.classList.add(`open`),t(),e.search&&(e.search.value=``,r(``),e.search.focus()),n(this._optionEls().findIndex(e=>e.classList.contains(`selected`)))},o=()=>{e.menu.hidden=!0,e.control.setAttribute(`aria-expanded`,`false`),e.control.classList.remove(`open`),n(-1)},s=t=>{this.value=t.dataset.value,this.dispatchEvent(new Event(`change`,{bubbles:!0})),o(),e.control.focus()},u=t=>{let r=this._visible();t.key===`ArrowDown`?(t.preventDefault(),n(Math.min(this._active+1,r.length-1))):t.key===`ArrowUp`?(t.preventDefault(),n(Math.max(this._active-1,0))):t.key===`Enter`?(t.preventDefault(),r[this._active]&&s(r[this._active])):t.key===`Escape`&&(o(),e.control.focus())};e.reset?.addEventListener(`click`,t=>{t.stopPropagation(),this.value=``,this.dispatchEvent(new Event(`change`,{bubbles:!0})),e.control.focus()}),e.control.addEventListener(`click`,()=>i()?o():a()),e.control.addEventListener(`keydown`,e=>{if(i()){u(e);return}(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())}),e.optionsWrap.addEventListener(`click`,e=>{let t=e.target.closest(`.search-select-option`);t&&s(t)}),e.optionsWrap.addEventListener(`mousemove`,e=>{let t=e.target.closest(`.search-select-option`);t&&n(this._visible().indexOf(t))}),e.optionsWrap.addEventListener(`mouseleave`,()=>n(-1)),e.search?.addEventListener(`input`,()=>{r(e.search.value),n(-1)}),e.search?.addEventListener(`keydown`,u),e.clear?.addEventListener(`click`,()=>{e.search.value=``,r(``),e.search.focus()}),e.menu.addEventListener(`keydown`,u),this._onDocClick=e=>{i()&&!this.contains(e.target)&&o()},document.addEventListener(`click`,this._onDocClick),l(this,()=>{i()&&t()})}disconnectedCallback(){this._onDocClick&&document.removeEventListener(`click`,this._onDocClick),u(this)}},Yu=e=>String(e??``).replace(/"/g,`&quot;`).replace(/</g,`&lt;`),Xu=`image/png,image/jpeg,image/webp`,Zu=5,Qu={"image/png":[`.png`],"image/jpeg":[`.jpg`,`.jpeg`],"image/webp":[`.webp`],"image/gif":[`.gif`],"image/svg+xml":[`.svg`],"application/pdf":[`.pdf`]},$u={"image/png":`PNG`,"image/jpeg":`JPG`,"image/webp":`WEBP`,"image/gif":`GIF`,"image/svg+xml":`SVG`,"application/pdf":`PDF`,".png":`PNG`,".jpg":`JPG`,".jpeg":`JPG`,".webp":`WEBP`,".gif":`GIF`,".svg":`SVG`,".pdf":`PDF`},ed=e=>String(e||``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);function td(e){let t=[];for(let n of ed(e)){let e=$u[n]||(n.startsWith(`.`)?n.slice(1).toUpperCase():n.toUpperCase());t.includes(e)||t.push(e)}return t.length<=1?t[0]||`supported`:`${t.slice(0,-1).join(`, `)} or ${t[t.length-1]}`}function nd(e,t){let n=ed(t);if(!n.length)return!0;let r=(e.type||``).toLowerCase(),i=(e.name||``).toLowerCase();return n.some(e=>e.startsWith(`.`)?i.endsWith(e):e.endsWith(`/*`)?r.startsWith(e.slice(0,-1)):r&&r===e?!0:!r&&(Qu[e]||[]).some(e=>i.endsWith(e)))}function rd(e,t={}){if(!e)return null;let n=t.accept===void 0?Xu:t.accept,r=t.maxSizeMb||5;return nd(e,n)?e.size>r*1024*1024?`Keep the file under ${r} MB.`:null:`Choose a ${td(n)} file.`}var $=(e,t)=>{typeof customElements<`u`&&!customElements.get(e)&&customElements.define(e,t)};function id(){$(`wui-select`,Ju),$(`wui-phone`,Ku),$(`wui-datepicker`,se),$(`wui-date-range`,ge),$(`wui-autocomplete`,_),$(`wui-multiselect`,_e),$(`wui-otp`,Se),$(`wui-status-icon`,o)}return id(),e.DEFAULT_IMAGE_ACCEPT=Xu,e.DEFAULT_MAX_SIZE_MB=Zu,e.STATUS_TONES=a,e.WuiAutocomplete=_,e.WuiDatePicker=se,e.WuiDateRange=ge,e.WuiMultiSelect=_e,e.WuiOtp=Se,e.WuiPhone=Ku,e.WuiSelect=Ju,e.WuiStatusIcon=o,e.acceptLabel=td,e.defineWeborityElements=id,e.matchesAccept=nd,e.validateFile=rd,e})({});
181
+ </div>`,this._rendered=!0,f(this,this._value),this._wire(),this._syncReset()}_refs(){return{control:this.querySelector(`.search-select-control`),menu:this.querySelector(`.search-select-menu`),label:this.querySelector(`[data-label]`),reset:this.querySelector(`.search-select-reset`),search:this.querySelector(`.search-select-input`),clear:this.querySelector(`.search-select-clear`),empty:this.querySelector(`.search-select-empty`),optionsWrap:this.querySelector(`.search-select-options`)}}_optionEls(){return[...this.querySelectorAll(`.search-select-option`)]}_visible(){return this._optionEls().filter(e=>!e.hidden)}_syncSelected(){let{label:e}=this._refs(),t=this._readOptions().find(e=>String(e.value)===String(this._value));for(let e of this._optionEls()){let t=e.dataset.value===String(this._value);e.classList.toggle(`selected`,t),e.setAttribute(`aria-selected`,String(t))}e&&(e.innerHTML=t?g(t):e.innerHTML,e.classList.toggle(`search-select-placeholder`,!t))}_syncReset(){let{reset:e}=this._refs();e&&(e.hidden=!(this.hasAttribute(`clearable`)&&this._value!==``&&!this.hasAttribute(`disabled`)))}_wire(){let e=this._refs();if(!e.control||!e.menu)return;let t=()=>{if(this.hasAttribute(`compact`)){let t=e.control.getBoundingClientRect();e.menu.style.width=`max-content`,e.menu.style.minWidth=`${t.width}px`,e.menu.style.maxWidth=`280px`,c(e.control,e.menu)}else c(e.control,e.menu,{matchWidth:!0})},n=e=>{let t=this._visible();this._active=e;for(let e of this._optionEls())e.classList.remove(`is-active`);e>=0&&t[e]&&(t[e].classList.add(`is-active`),t[e].scrollIntoView({block:`nearest`}))},r=t=>{let n=t.trim().toLowerCase(),r=0;for(let e of this._optionEls()){let t=!n||e.textContent.toLowerCase().includes(n);e.hidden=!t,t&&(r+=1)}e.empty&&(e.empty.hidden=r>0),e.clear&&(e.clear.hidden=!n)},i=()=>!e.menu.hidden,a=()=>{e.menu.hidden=!1,e.control.setAttribute(`aria-expanded`,`true`),e.control.classList.add(`open`),t(),e.search&&(e.search.value=``,r(``),e.search.focus()),n(this._optionEls().findIndex(e=>e.classList.contains(`selected`)))},o=()=>{e.menu.hidden=!0,e.control.setAttribute(`aria-expanded`,`false`),e.control.classList.remove(`open`),n(-1)},s=t=>{this.value=t.dataset.value,this.dispatchEvent(new Event(`change`,{bubbles:!0})),o(),e.control.focus()},u=t=>{let r=this._visible();t.key===`ArrowDown`?(t.preventDefault(),n(Math.min(this._active+1,r.length-1))):t.key===`ArrowUp`?(t.preventDefault(),n(Math.max(this._active-1,0))):t.key===`Enter`?(t.preventDefault(),r[this._active]&&s(r[this._active])):t.key===`Escape`&&(o(),e.control.focus())};e.reset?.addEventListener(`click`,t=>{t.stopPropagation(),this.value=``,this.dispatchEvent(new Event(`change`,{bubbles:!0})),e.control.focus()}),e.control.addEventListener(`click`,()=>i()?o():a()),e.control.addEventListener(`keydown`,e=>{if(i()){u(e);return}(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())}),e.optionsWrap.addEventListener(`click`,e=>{let t=e.target.closest(`.search-select-option`);t&&s(t)}),e.optionsWrap.addEventListener(`mousemove`,e=>{let t=e.target.closest(`.search-select-option`);t&&n(this._visible().indexOf(t))}),e.optionsWrap.addEventListener(`mouseleave`,()=>n(-1)),e.search?.addEventListener(`input`,()=>{r(e.search.value),n(-1)}),e.clear?.addEventListener(`click`,()=>{e.search.value=``,r(``),e.search.focus()}),e.menu.addEventListener(`keydown`,u),this._onDocClick=e=>{i()&&!this.contains(e.target)&&o()},document.addEventListener(`click`,this._onDocClick),l(this,()=>{i()&&t()})}disconnectedCallback(){this._onDocClick&&document.removeEventListener(`click`,this._onDocClick),u(this)}},Yu=e=>String(e??``).replace(/"/g,`&quot;`).replace(/</g,`&lt;`),Xu=`image/png,image/jpeg,image/webp`,Zu=5,Qu={"image/png":[`.png`],"image/jpeg":[`.jpg`,`.jpeg`],"image/webp":[`.webp`],"image/gif":[`.gif`],"image/svg+xml":[`.svg`],"application/pdf":[`.pdf`]},$u={"image/png":`PNG`,"image/jpeg":`JPG`,"image/webp":`WEBP`,"image/gif":`GIF`,"image/svg+xml":`SVG`,"application/pdf":`PDF`,".png":`PNG`,".jpg":`JPG`,".jpeg":`JPG`,".webp":`WEBP`,".gif":`GIF`,".svg":`SVG`,".pdf":`PDF`},ed=e=>String(e||``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);function td(e){let t=[];for(let n of ed(e)){let e=$u[n]||(n.startsWith(`.`)?n.slice(1).toUpperCase():n.toUpperCase());t.includes(e)||t.push(e)}return t.length<=1?t[0]||`supported`:`${t.slice(0,-1).join(`, `)} or ${t[t.length-1]}`}function nd(e,t){let n=ed(t);if(!n.length)return!0;let r=(e.type||``).toLowerCase(),i=(e.name||``).toLowerCase();return n.some(e=>e.startsWith(`.`)?i.endsWith(e):e.endsWith(`/*`)?r.startsWith(e.slice(0,-1)):r&&r===e?!0:!r&&(Qu[e]||[]).some(e=>i.endsWith(e)))}function rd(e,t={}){if(!e)return null;let n=t.accept===void 0?Xu:t.accept,r=t.maxSizeMb||5;return nd(e,n)?e.size>r*1024*1024?`Keep the file under ${r} MB.`:null:`Choose a ${td(n)} file.`}var $=(e,t)=>{typeof customElements<`u`&&!customElements.get(e)&&customElements.define(e,t)};function id(){$(`wui-select`,Ju),$(`wui-phone`,Ku),$(`wui-datepicker`,se),$(`wui-date-range`,ge),$(`wui-autocomplete`,_),$(`wui-multiselect`,_e),$(`wui-otp`,Se),$(`wui-status-icon`,o)}return id(),e.DEFAULT_IMAGE_ACCEPT=Xu,e.DEFAULT_MAX_SIZE_MB=Zu,e.STATUS_TONES=a,e.WuiAutocomplete=_,e.WuiDatePicker=se,e.WuiDateRange=ge,e.WuiMultiSelect=_e,e.WuiOtp=Se,e.WuiPhone=Ku,e.WuiSelect=Ju,e.WuiStatusIcon=o,e.acceptLabel=td,e.defineWeborityElements=id,e.matchesAccept=nd,e.validateFile=rd,e})({});
@@ -87,16 +87,18 @@ var l = Symbol("wui.trustedHtml"), u = (e) => String(e ?? "").replace(/&/g, "&am
87
87
  set value(e) {
88
88
  this._value = e == null ? "" : String(e), c(this, this._value);
89
89
  let t = this._readOptions().find((e) => String(e.value) === this._value);
90
- t && (this._label = h(t.label)), this._syncInput();
90
+ this._label = t ? h(t.label) : "", this._syncInput(), this._renderOptions("");
91
91
  }
92
92
  set options(e) {
93
- this._optionsProp = Array.isArray(e) ? e : [], this._renderOptions();
93
+ this._optionsProp = Array.isArray(e) ? e : [];
94
+ let t = this._readOptions().find((e) => String(e.value) === this._value);
95
+ t && (this._label = h(t.label)), this._renderOptions(), this._syncInput();
94
96
  }
95
97
  get options() {
96
98
  return this._readOptions();
97
99
  }
98
100
  set loading(e) {
99
- this._loading = !!e, this._renderLoading();
101
+ this._loading = !!e, this._renderLoading(), this._renderOptions();
100
102
  }
101
103
  get loading() {
102
104
  return this._loading;
@@ -108,8 +110,10 @@ var l = Symbol("wui.trustedHtml"), u = (e) => String(e ?? "").replace(/&/g, "&am
108
110
  return Math.max(0, Number(this.getAttribute("min-chars")) || +!!this._remote);
109
111
  }
110
112
  get _debounceMs() {
111
- let e = Number(this.getAttribute("debounce"));
112
- return Number.isFinite(e) && e >= 0 ? e : 250;
113
+ let e = this.getAttribute("debounce");
114
+ if (e == null || e === "") return 250;
115
+ let t = Number(e);
116
+ return Number.isFinite(t) && t >= 0 ? t : 250;
113
117
  }
114
118
  _snapshotDeclared() {
115
119
  if (this._declared) return;
@@ -2314,7 +2318,7 @@ function ae(e) {
2314
2318
  return null;
2315
2319
  }
2316
2320
  }
2317
- function oe(e) {
2321
+ function W(e) {
2318
2322
  if (!z || !e?.trim().startsWith("+")) return null;
2319
2323
  try {
2320
2324
  let t = new z.AsYouType();
@@ -2328,7 +2332,7 @@ function oe(e) {
2328
2332
  return null;
2329
2333
  }
2330
2334
  }
2331
- var W = class extends HTMLElement {
2335
+ var G = class extends HTMLElement {
2332
2336
  static get observedAttributes() {
2333
2337
  return [
2334
2338
  "value",
@@ -2350,7 +2354,13 @@ var W = class extends HTMLElement {
2350
2354
  return `+${L(this._country)}${this._national}`;
2351
2355
  }
2352
2356
  set value(e) {
2353
- this._national = String(e ?? "").replace(/[^0-9]/g, ""), this._commit();
2357
+ let t = String(e ?? "").trim(), n = W(t);
2358
+ if (n) this._country = n.country, this._national = n.national.replace(/[^0-9]/g, "");
2359
+ else if (t.startsWith("+")) {
2360
+ let e = t.replace(/[^0-9]/g, ""), n = String(L(this._country));
2361
+ n && e.startsWith(n) && (e = e.slice(n.length)), this._national = e;
2362
+ } else this._national = t.replace(/[^0-9]/g, "");
2363
+ n && this.getAttribute("country") !== this._country ? this.setAttribute("country", this._country) : this._rendered && this.render(), this._commit();
2354
2364
  }
2355
2365
  _commit() {
2356
2366
  c(this, this.value), this.dispatchEvent(new Event("change", { bubbles: !0 }));
@@ -2372,7 +2382,7 @@ var W = class extends HTMLElement {
2372
2382
  <div class="country-list-scroll">${t}<div class="country-empty" hidden>No countries found</div></div>
2373
2383
  </div>
2374
2384
  </div>
2375
- <input type="tel" class="input" placeholder="${G(e)}" value="${G(V(this._country, this._national))}"${this.hasAttribute("disabled") ? " disabled" : ""} />
2385
+ <input type="tel" class="input" placeholder="${K(e)}" value="${K(V(this._country, this._national))}"${this.hasAttribute("disabled") ? " disabled" : ""} />
2376
2386
  </div>
2377
2387
  <div class="field-error" data-phone-error hidden></div>`, this._rendered = !0, c(this, this.value), this._wire();
2378
2388
  }
@@ -2423,7 +2433,7 @@ var W = class extends HTMLElement {
2423
2433
  }), o.addEventListener("blur", () => {
2424
2434
  _(this._national.length > 0 && U(this.value) === !1);
2425
2435
  }), o.addEventListener("paste", (e) => {
2426
- let t = oe(e.clipboardData?.getData("text"));
2436
+ let t = W(e.clipboardData?.getData("text"));
2427
2437
  t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value = V(this._country, this._national) : this.setAttribute("country", t.country), this._commit(), this.querySelector("input[type=tel]")?.focus());
2428
2438
  }), this._onDocClick = (e) => {
2429
2439
  u() && !this.contains(e.target) && p();
@@ -2437,7 +2447,7 @@ var W = class extends HTMLElement {
2437
2447
  disconnectedCallback() {
2438
2448
  this._reposition && (window.removeEventListener("scroll", this._reposition, !0), window.removeEventListener("resize", this._reposition)), this._onDocClick && document.removeEventListener("click", this._onDocClick);
2439
2449
  }
2440
- }, G = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), K = class extends HTMLElement {
2450
+ }, K = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), q = class extends HTMLElement {
2441
2451
  static get observedAttributes() {
2442
2452
  return [
2443
2453
  "value",
@@ -2463,7 +2473,11 @@ var W = class extends HTMLElement {
2463
2473
  this._rendered || this.render();
2464
2474
  }
2465
2475
  attributeChangedCallback(e, t, n) {
2466
- this._rendered && (e === "value" ? this.value = n : this.render());
2476
+ if (e === "value") {
2477
+ this.value = n;
2478
+ return;
2479
+ }
2480
+ this._rendered && this.render();
2467
2481
  }
2468
2482
  get value() {
2469
2483
  return this._value;
@@ -2497,19 +2511,19 @@ var W = class extends HTMLElement {
2497
2511
  d && (this._value = String(d.value)), c(this, this._value);
2498
2512
  let p = e.map((e) => {
2499
2513
  let t = String(e.value) === String(this._value);
2500
- return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${q(e.value)}" aria-selected="${t}">${f(e)}</button>`;
2514
+ return `<button type="button" role="option" class="search-select-option${t ? " selected" : ""}" data-value="${J(e.value)}" aria-selected="${t}">${f(e)}</button>`;
2501
2515
  }).join("");
2502
2516
  this.innerHTML = `
2503
2517
  <div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
2504
- <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${q(this._accessibleName())}"${this.hasAttribute("disabled") ? " disabled" : ""}>
2505
- ${a ? `<i class="bi bi-${q(a)} search-select-icon" aria-hidden="true"></i>` : ""}
2518
+ <button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-label="${J(this._accessibleName())}"${this.hasAttribute("disabled") ? " disabled" : ""}>
2519
+ ${a ? `<i class="bi bi-${J(a)} search-select-icon" aria-hidden="true"></i>` : ""}
2506
2520
  ${o ? `<span class="search-select-prefix">${u(o)}</span>` : ""}
2507
2521
  <span class="${d ? "" : "search-select-placeholder"}" data-label>${d ? f(d) : u(s)}</span>
2508
2522
  ${n ? "<span class=\"search-select-reset\" role=\"button\" aria-label=\"Clear selection\" hidden><i class=\"bi bi-x-lg\" aria-hidden=\"true\"></i></span>" : ""}
2509
2523
  <i class="bi bi-chevron-down search-select-caret" aria-hidden="true"></i>
2510
2524
  </button>
2511
2525
  <div class="search-select-menu search-select-menu-fixed" role="listbox" tabindex="-1" hidden>
2512
- ${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${q(l)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
2526
+ ${t ? `<div class="search-select-search"><i class="bi bi-search" aria-hidden="true"></i><input class="search-select-input" placeholder="${J(l)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden><i class="bi bi-x" aria-hidden="true"></i></button></div>` : ""}
2513
2527
  <div class="search-select-options">${p}<div class="search-select-empty" hidden>No matches</div></div>
2514
2528
  </div>
2515
2529
  </div>`, this._rendered = !0, c(this, this._value), this._wire(), this._syncReset();
@@ -2590,7 +2604,7 @@ var W = class extends HTMLElement {
2590
2604
  t && n(this._visible().indexOf(t));
2591
2605
  }), e.optionsWrap.addEventListener("mouseleave", () => n(-1)), e.search?.addEventListener("input", () => {
2592
2606
  r(e.search.value), n(-1);
2593
- }), e.search?.addEventListener("keydown", u), e.clear?.addEventListener("click", () => {
2607
+ }), e.clear?.addEventListener("click", () => {
2594
2608
  e.search.value = "", r(""), e.search.focus();
2595
2609
  }), e.menu.addEventListener("keydown", u), this._onDocClick = (e) => {
2596
2610
  o() && !this.contains(e.target) && c();
@@ -2601,14 +2615,14 @@ var W = class extends HTMLElement {
2601
2615
  disconnectedCallback() {
2602
2616
  this._onDocClick && document.removeEventListener("click", this._onDocClick), o(this);
2603
2617
  }
2604
- }, q = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), J = "image/png,image/jpeg,image/webp", se = 5, ce = {
2618
+ }, J = (e) => String(e ?? "").replace(/"/g, "&quot;").replace(/</g, "&lt;"), Y = "image/png,image/jpeg,image/webp", oe = 5, se = {
2605
2619
  "image/png": [".png"],
2606
2620
  "image/jpeg": [".jpg", ".jpeg"],
2607
2621
  "image/webp": [".webp"],
2608
2622
  "image/gif": [".gif"],
2609
2623
  "image/svg+xml": [".svg"],
2610
2624
  "application/pdf": [".pdf"]
2611
- }, le = {
2625
+ }, ce = {
2612
2626
  "image/png": "PNG",
2613
2627
  "image/jpeg": "JPG",
2614
2628
  "image/webp": "WEBP",
@@ -2622,34 +2636,34 @@ var W = class extends HTMLElement {
2622
2636
  ".gif": "GIF",
2623
2637
  ".svg": "SVG",
2624
2638
  ".pdf": "PDF"
2625
- }, Y = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
2626
- function X(e) {
2639
+ }, X = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
2640
+ function Z(e) {
2627
2641
  let t = [];
2628
- for (let n of Y(e)) {
2629
- let e = le[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
2642
+ for (let n of X(e)) {
2643
+ let e = ce[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
2630
2644
  t.includes(e) || t.push(e);
2631
2645
  }
2632
2646
  return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
2633
2647
  }
2634
- function Z(e, t) {
2635
- let n = Y(t);
2648
+ function Q(e, t) {
2649
+ let n = X(t);
2636
2650
  if (!n.length) return !0;
2637
2651
  let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
2638
- return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (ce[e] || []).some((e) => i.endsWith(e)));
2652
+ return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (se[e] || []).some((e) => i.endsWith(e)));
2639
2653
  }
2640
- function ue(e, t = {}) {
2654
+ function le(e, t = {}) {
2641
2655
  if (!e) return null;
2642
- let n = t.accept === void 0 ? J : t.accept, r = t.maxSizeMb || 5;
2643
- return Z(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${X(n)} file.`;
2656
+ let n = t.accept === void 0 ? Y : t.accept, r = t.maxSizeMb || 5;
2657
+ return Q(e, n) ? e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${Z(n)} file.`;
2644
2658
  }
2645
2659
  //#endregion
2646
2660
  //#region src/index.js
2647
- var Q = (e, t) => {
2661
+ var $ = (e, t) => {
2648
2662
  typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
2649
2663
  };
2650
- function $() {
2651
- Q("wui-select", K), Q("wui-phone", W), Q("wui-datepicker", w), Q("wui-date-range", M), Q("wui-autocomplete", p), Q("wui-multiselect", N), Q("wui-otp", F), Q("wui-status-icon", n);
2664
+ function ue() {
2665
+ $("wui-select", q), $("wui-phone", G), $("wui-datepicker", w), $("wui-date-range", M), $("wui-autocomplete", p), $("wui-multiselect", N), $("wui-otp", F), $("wui-status-icon", n);
2652
2666
  }
2653
- $();
2667
+ ue();
2654
2668
  //#endregion
2655
- export { J as DEFAULT_IMAGE_ACCEPT, se as DEFAULT_MAX_SIZE_MB, t as STATUS_TONES, p as WuiAutocomplete, w as WuiDatePicker, M as WuiDateRange, N as WuiMultiSelect, F as WuiOtp, W as WuiPhone, K as WuiSelect, n as WuiStatusIcon, X as acceptLabel, $ as defineWeborityElements, Z as matchesAccept, ue as validateFile };
2669
+ export { Y as DEFAULT_IMAGE_ACCEPT, oe as DEFAULT_MAX_SIZE_MB, t as STATUS_TONES, p as WuiAutocomplete, w as WuiDatePicker, M as WuiDateRange, N as WuiMultiSelect, F as WuiOtp, G as WuiPhone, q as WuiSelect, n as WuiStatusIcon, Z as acceptLabel, ue as defineWeborityElements, Q as matchesAccept, le as validateFile };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-elements",
3
- "version": "0.6.13",
3
+ "version": "0.7.0",
4
4
  "description": "Webority framework-agnostic UI custom elements (<wui-*>) — the single implementation of the interactive components, styled by @webority/theme. Used natively in Razor and wrapped by @webority/ui-react.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -30,9 +30,15 @@
30
30
  "libphonenumber-js": "^1.13.9"
31
31
  },
32
32
  "devDependencies": {
33
- "vite": "^8.0.12"
33
+ "@vitest/coverage-v8": "^3.2.4",
34
+ "jsdom": "^26.0.0",
35
+ "vite": "^8.0.12",
36
+ "vitest": "^3.2.4"
34
37
  },
35
38
  "scripts": {
36
- "build": "vite build && node ../../scripts/sync-rcl-assets.mjs elements"
39
+ "build": "vite build && node ../../scripts/sync-rcl-assets.mjs elements",
40
+ "test": "vitest run",
41
+ "test:watch": "vitest",
42
+ "test:coverage": "vitest run --coverage"
37
43
  }
38
44
  }