@descope/web-components-ui 3.22.3 → 3.23.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.
package/dist/umd/67.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[67],{94681(e,t,o){o.d(t,{T:()=>l,t:()=>I});var r=o(63200),i=o(25964),n=o(79673),a=o(88961);const l=(0,i.xE)("multi-select-combo-box"),{host:s,inputField:p,inputElement:d,placeholder:c,toggle:u,clearButton:m,label:h,requiredIndicator:b,helperText:y,errorMessage:g,chip:v,chipLabel:f,overflowChipFirstBorder:x,overflowChipSecondBorder:w}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},chip:{selector:"vaadin-multi-select-combo-box-chip"},chipLabel:{selector:"vaadin-multi-select-combo-box-chip::part(label)"},overflowChipFirstBorder:{selector:"vaadin-multi-select-combo-box-chip[slot='overflow']::before"},overflowChipSecondBorder:{selector:"vaadin-multi-select-combo-box-chip[slot='overflow']::after"}},I=(0,r.Zz)((0,a.RF)({mappings:{hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontSize:[{},s],chipFontSize:{...f,property:"font-size"},fontFamily:[h,c,p,y,g,f],labelFontSize:{...h,property:"font-size"},labelFontWeight:{...h,property:"font-weight"},inputValueFontWeight:{...p,property:"font-weight"},inputPlaceholderFontWeight:{...c,property:"font-weight"},helperTextFontWeight:{...y,property:"font-weight"},errorMessageFontWeight:{...g,property:"font-weight"},labelTextColor:[{...h,property:"color"},{...b,property:"color"}],errorMessageTextColor:{...g,property:"color"},errorMessageIcon:{...g,property:"background-image"},errorMessageIconSize:{...g,property:"background-size"},errorMessageIconPadding:{...g,property:"padding-inline-start"},errorMessageIconRepeat:{...g,property:"background-repeat"},errorMessageIconPosition:{...g,property:"background-position"},errorMessageFontSize:{...g,property:"font-size"},inputHeight:{...p,property:"min-height"},inputBackgroundColor:{...p,property:"background-color"},inputBorderColor:{...p,property:"border-color"},inputBorderWidth:{...p,property:"border-width"},inputBorderStyle:{...p,property:"border-style"},inputBorderRadius:{...p,property:"border-radius"},labelRequiredIndicator:{...b,property:"content"},inputValueTextColor:{...p,property:"color"},inputPlaceholderTextColor:{...c,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...m,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...m,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...m,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,property:"margin-left"}],inputOutlineColor:{...p,property:"outline-color"},inputOutlineWidth:{...p,property:"outline-width"},inputOutlineStyle:{...p,property:"outline-style"},inputOutlineOffset:{...p,property:"outline-offset"},inputHorizontalPadding:[{...d,property:"padding-left"},{...d,property:"padding-right"},{...p,property:"padding-inline-start"}],inputVerticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}],chipTextColor:{...f,property:"color"},chipBackgroundColor:[{...v,property:"background-color"},{...x,property:"border-color"},{...w,property:"border-color"}],labelPosition:{...h,property:"position"},labelTopPosition:{...h,property:"top"},labelLeftPosition:{...h,property:"left"},labelHorizontalPosition:[{...h,property:"left"},{...h,property:"right"}],inputTransformY:{...h,property:"transform"},inputTransition:{...h,property:"transition"},marginInlineStart:{...h,property:"margin-inline-start"},placeholderOpacity:{...c,property:"opacity"},inputVerticalAlignment:{...p,property:"align-items"},overlayBackground:{property:()=>I.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>I.cssVarList.overlay.textColor},overlayBorder:{property:()=>I.cssVarList.overlay.border},overlayFontSize:{property:()=>I.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>I.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>I.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>I.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>I.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>I.cssVarList.overlay.itemPaddingInlineEnd}}}),a.VO,(0,a.mA)({name:"overlay",selector:"vaadin-multi-select-combo-box-internal",mappings:{backgroundColor:{selector:"vaadin-multi-select-combo-box-scroller"},minHeight:{selector:"vaadin-multi-select-combo-box-overlay"},margin:{selector:"vaadin-multi-select-combo-box-overlay"},cursor:{selector:"vaadin-multi-select-combo-box-item"},fontFamily:{selector:"vaadin-multi-select-combo-box-item"},textColor:{selector:"vaadin-multi-select-combo-box-item",property:"color"},fontSize:{selector:"vaadin-multi-select-combo-box-item"},itemBoxShadow:{selector:"vaadin-multi-select-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-multi-select-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-multi-select-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,a.OZ)({proxyProps:["selectionStart"],inputEvent:"selected-items-changed"}),a._$,a.tQ,e=>class extends e{static get observedAttributes(){return["readonly"]}#e=({displayName:e,value:t,label:o})=>{const r=document.createElement("span");return r.setAttribute("data-name",o),r.setAttribute("data-id",t),r.textContent=e||o,r.outerHTML};#t;#o=[];get defaultValues(){const e=this.getAttribute("default-values");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "default-values" -',e.message)}return[]}get renderItem(){return this.#e}set renderItem(e){this.#e=e,this.renderItems()}get data(){if(this.#t)return this.#t;const e=this.getAttribute("data");if(e)try{const t=JSON.parse(e);if(this.isValidDataType(t))return t}catch(e){console.error('could not parse data string from attribute "data" -',e.message)}return[]}set data(e){this.isValidDataType(e)&&(this.#t=e,this.renderItems())}get allowCustomValues(){return"true"===this.getAttribute("allow-custom-value")}get minItemsSelection(){return parseInt(this.getAttribute("min-items-selection"),10)||0}get maxItemsSelection(){return parseInt(this.getAttribute("max-items-selection"),10)||0}isValidDataType(e){const t=Array.isArray(e);return t||console.error("data and default-values must be an array, received:",e),t}getItemsTemplate(){return this.data?.reduce?.((e,t)=>e+(this.renderItem?.(t||{})||""),"")}renderItems(){const e=this.getItemsTemplate();e&&(this.innerHTML=e)}updateSelectedItems(){const e=this.baseElement.selectedItems?.map(e=>e.getAttribute("data-id"))||[];e.length>0&&(this.value=e),0===this.value.length&&this.setDefaultValues()}customValueTransformFn(e){return e}setComboBoxDescriptor(){const e=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),t=this;Object.defineProperties(this.inputElement,{value:{...e,set(o){const r=t.customValueTransformFn(o)||"";r!==this.value&&e.set.call(this,r)}}})}#r(e){return Array.from(new Map(e.map(e=>[e.getAttribute("data-id"),e])).values())}#i(){const e=Array.from(this.children),t=this.#r(e);e.length?(this.removeAttribute("has-no-options"),t.forEach(e=>{Object.defineProperty(e,"data-name",{value:e.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(e,"data-id",{value:e.getAttribute("data-id"),configurable:!0,writable:!0})}),this.baseElement.items=t,setTimeout(()=>{this.updateSelectedItems()},0)):(this.baseElement.items=[],this.setAttribute("has-no-options","")),this.baseElement.renderer=(e,t,o)=>{e.innerHTML=o.item.outerHTML}}#n(){const e=this.baseElement.shadowRoot.querySelector("vaadin-multi-select-combo-box-internal").shadowRoot.querySelector("vaadin-multi-select-combo-box-overlay");e._attachOverlay=()=>{e.bringToFront()},e._detachOverlay=()=>{},e._enterModalState=()=>{}}#a(){this.allowCustomValues&&this.baseElement.addEventListener("custom-value-set",e=>{const t=this.#e({label:e.detail,displayName:e.detail,value:e.detail});this.innerHTML+=t,this.baseElement._lastFilter="",setTimeout(()=>{this.value=[...this.value,e.detail]},0)})}setGetValidity(){this.getValidity=function(){if(this.pattern){const e=new RegExp(this.pattern);if(this.value.some(t=>!e.test(t)))return{patternMismatch:!0}}return this.isRequired&&!this.value.length?{valueMissing:!0}:this.isRequired&&this.minItemsSelection&&this.value.length<this.minItemsSelection?{rangeUnderflow:!0}:this.maxItemsSelection&&this.value.length>this.maxItemsSelection?{rangeOverflow:!0}:{}};const e=this;this.baseElement.checkValidity=()=>e.validity.valid}init(){super.init?.(),this.setGetValidity(),this.#a(),this.renderItems(),(0,i.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,i.Ge)(this,this.#i.bind(this)),(0,i.EA)(this,this.baseElement,{includeAttrs:["placeholder"]}),setTimeout(()=>{this.setComboBoxDescriptor(),this.#n()}),this.setDefaultValues(),this.baseElement.addEventListener("selected-items-changed",()=>{this.#l(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0}))})}setDefaultValues(){this.defaultValues.length>0&&(this.value=this.defaultValues)}#l(){this.#o=this.baseElement.selectedItems?.map(e=>e.getAttribute("data-id"))||[]}set value(e){if(e&&e.length>0){const t=this.baseElement.items?.filter(t=>e.includes(t["data-id"]));if(this.allowCustomValues){const o=t?.map(e=>e.getAttribute("data-id"))||[],r=e.filter(e=>!o.includes(e));if(r.length){const t=r.reduce((e,t)=>e+this.#e({label:t,displayName:t,value:t}),"");return this.innerHTML+=t,void setTimeout(()=>{this.value=e},0)}}const o=t?.map(e=>e.getAttribute("data-id"))||[];(0,r.AG)(this.#o,o)||(this.baseElement.selectedItems=t)}else this.baseElement.selectedItems=[]}get value(){return this.#o}attributeChangedCallback(e,t,o){super.attributeChangedCallback?.(e,t,o),"readonly"===e&&this.onReadOnlyChange(null!==o&&"true"===o)}onReadOnlyChange(e){e?this.baseElement?.shadowRoot?.querySelector("vaadin-multi-select-combo-box-internal")?.setAttribute("inert",e):this.baseElement?.shadowRoot?.querySelector("vaadin-multi-select-combo-box-internal")?.removeAttribute("inert")}})((0,a.tz)({slots:["","prefix"],wrappedEleName:"vaadin-multi-select-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,n.cy)(I.cssVarList)}\n\t\t${(0,n.fu)("vaadin-multi-select-combo-box")}\n\t\t${(0,n.lS)("vaadin-multi-select-combo-box")}\n\t\t${(0,n.I4)("vaadin-multi-select-combo-box")}\n\n\t\tvaadin-multi-select-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-multi-select-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-multi-select-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n align-self: center;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\tvaadin-multi-select-combo-box[readonly] [slot="input"] {\n flex-grow: 1;\n flex-basis: 4em;\n\t\t}\n\n\t\t::part(input-field) {\n padding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,n.$J)("vaadin-multi-select-combo-box")}\n :host([has-label]) vaadin-multi-select-combo-box-chip::part(label) {\n display: block;\n }\n\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::before,\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -4px;\n right: -4px;\n border-left-width: 0;\n border-inline-start-style: solid;\n border-inline-start-width: 2px;\n }\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -8px;\n right: -8px;\n }\n\n :host([has-no-options][allow-custom-value='true']) ::part(toggle-button) {\n display: none;\n }\n\n ${(0,n.Kl)()}\n\n vaadin-multi-select-combo-box::part(toggle-button),\n vaadin-multi-select-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-multi-select-combo-box[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-multi-select-combo-box[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t`,excludeAttrsSync:["tabindex","size","data","placeholder","style"],componentName:l,includeForwardProps:["items","renderer","selectedItems"]}))},70067(e,t,o){o.r(t),o.d(t,{MultiSelectComboBoxClass:()=>r.t,componentName:()=>r.T}),o(51408);var r=o(94681);customElements.define(r.T,r.t)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[67],{94681(t,e,r){r.d(e,{T:()=>l,t:()=>I});var o=r(63200),i=r(25964),n=r(79673),a=r(88961);const l=(0,i.xE)("multi-select-combo-box"),{host:s,inputField:p,inputElement:d,placeholder:c,toggle:u,clearButton:m,label:h,requiredIndicator:b,helperText:y,errorMessage:g,chip:v,chipLabel:f,overflowChipFirstBorder:x,overflowChipSecondBorder:w}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},chip:{selector:"vaadin-multi-select-combo-box-chip"},chipLabel:{selector:"vaadin-multi-select-combo-box-chip::part(label)"},overflowChipFirstBorder:{selector:"vaadin-multi-select-combo-box-chip[slot='overflow']::before"},overflowChipSecondBorder:{selector:"vaadin-multi-select-combo-box-chip[slot='overflow']::after"}},I=(0,o.Zz)((0,a.RF)({mappings:{hostWidth:{...s,property:"width"},hostDirection:{...s,property:"direction"},fontSize:[{},s],chipFontSize:{...f,property:"font-size"},fontFamily:[h,c,p,y,g,f],labelFontSize:{...h,property:"font-size"},labelFontWeight:{...h,property:"font-weight"},inputValueFontWeight:{...p,property:"font-weight"},inputPlaceholderFontWeight:{...c,property:"font-weight"},helperTextFontWeight:{...y,property:"font-weight"},errorMessageFontWeight:{...g,property:"font-weight"},labelTextColor:[{...h,property:"color"},{...b,property:"color"}],errorMessageTextColor:{...g,property:"color"},errorMessageIcon:{...g,property:"background-image"},errorMessageIconSize:{...g,property:"background-size"},errorMessageIconPadding:{...g,property:"padding-inline-start"},errorMessageIconRepeat:{...g,property:"background-repeat"},errorMessageIconPosition:{...g,property:"background-position"},errorMessageFontSize:{...g,property:"font-size"},inputHeight:{...p,property:"min-height"},inputBackgroundColor:{...p,property:"background-color"},inputBorderColor:{...p,property:"border-color"},inputBorderWidth:{...p,property:"border-width"},inputBorderStyle:{...p,property:"border-style"},inputBorderRadius:{...p,property:"border-radius"},labelRequiredIndicator:{...b,property:"content"},inputValueTextColor:{...p,property:"color"},inputPlaceholderTextColor:{...c,property:"color"},inputDropdownButtonCursor:[{...u,property:"cursor"},{...m,property:"cursor"}],inputDropdownButtonColor:[{...u,property:"color"},{...m,property:"color"}],inputDropdownButtonSize:[{...u,property:"font-size"},{...m,property:"font-size"}],inputDropdownButtonOffset:[{...u,property:"margin-right"},{...u,property:"margin-left"}],inputOutlineColor:{...p,property:"outline-color"},inputOutlineWidth:{...p,property:"outline-width"},inputOutlineStyle:{...p,property:"outline-style"},inputOutlineOffset:{...p,property:"outline-offset"},inputHorizontalPadding:[{...d,property:"padding-left"},{...d,property:"padding-right"},{...p,property:"padding-inline-start"}],inputVerticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}],chipTextColor:{...f,property:"color"},chipBackgroundColor:[{...v,property:"background-color"},{...x,property:"border-color"},{...w,property:"border-color"}],labelPosition:{...h,property:"position"},labelTopPosition:{...h,property:"top"},labelLeftPosition:{...h,property:"left"},labelHorizontalPosition:[{...h,property:"left"},{...h,property:"right"}],inputTransformY:{...h,property:"transform"},inputTransition:{...h,property:"transition"},marginInlineStart:{...h,property:"margin-inline-start"},placeholderOpacity:{...c,property:"opacity"},inputVerticalAlignment:{...p,property:"align-items"},overlayBackground:{property:()=>I.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>I.cssVarList.overlay.textColor},overlayBorder:{property:()=>I.cssVarList.overlay.border},overlayFontSize:{property:()=>I.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>I.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>I.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>I.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>I.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>I.cssVarList.overlay.itemPaddingInlineEnd}}}),a.VO,(0,a.mA)({name:"overlay",selector:"vaadin-multi-select-combo-box-internal",mappings:{backgroundColor:{selector:"vaadin-multi-select-combo-box-scroller"},minHeight:{selector:"vaadin-multi-select-combo-box-overlay"},margin:{selector:"vaadin-multi-select-combo-box-overlay"},cursor:{selector:"vaadin-multi-select-combo-box-item"},fontFamily:{selector:"vaadin-multi-select-combo-box-item"},textColor:{selector:"vaadin-multi-select-combo-box-item",property:"color"},fontSize:{selector:"vaadin-multi-select-combo-box-item"},itemBoxShadow:{selector:"vaadin-multi-select-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-multi-select-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-multi-select-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,a.OZ)({proxyProps:["selectionStart"],inputEvent:"selected-items-changed"}),a._$,a.tQ,t=>class extends t{static get observedAttributes(){return["readonly"]}#t=({displayName:t,value:e,label:r})=>{const o=document.createElement("span");return o.setAttribute("data-name",r),o.setAttribute("data-id",e),o.textContent=t||r,o.outerHTML};#e;#r=[];get defaultValues(){const t=this.getAttribute("default-values");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "default-values" -',t.message)}return[]}get renderItem(){return this.#t}set renderItem(t){this.#t=t,this.renderItems()}get data(){if(this.#e)return this.#e;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#e=t,this.renderItems())}get allowCustomValues(){return"true"===this.getAttribute("allow-custom-value")}get minItemsSelection(){return parseInt(this.getAttribute("min-items-selection"),10)||0}get maxItemsSelection(){return parseInt(this.getAttribute("max-items-selection"),10)||0}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data and default-values must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.((t,e)=>t+(this.renderItem?.(e||{})||""),"")}#o(){if(this.#e)return!0;const t=this.getAttribute("data");if(!t)return!1;try{return Array.isArray(JSON.parse(t))}catch{return!1}}renderItems(){const t=this.getItemsTemplate();t?this.innerHTML=t:this.#o()&&(this.innerHTML="")}updateSelectedItems(){const t=this.baseElement.selectedItems?.map(t=>t.getAttribute("data-id"))||[];t.length>0&&(this.value=t),0===this.value.length&&this.setDefaultValues()}customValueTransformFn(t){return t}setComboBoxDescriptor(){const t=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),e=this;Object.defineProperties(this.inputElement,{value:{...t,set(r){const o=e.customValueTransformFn(r)||"";o!==this.value&&t.set.call(this,o)}}})}#i(t){return Array.from(new Map(t.map(t=>[t.getAttribute("data-id"),t])).values())}#n(){const t=Array.from(this.children),e=this.#i(t);t.length?(this.removeAttribute("has-no-options"),e.forEach(t=>{Object.defineProperty(t,"data-name",{value:t.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id"),configurable:!0,writable:!0})}),this.baseElement.items=e,setTimeout(()=>{this.updateSelectedItems()},0)):(this.baseElement.items=[],this.setAttribute("has-no-options","")),this.baseElement.renderer=(t,e,r)=>{t.innerHTML=r.item.outerHTML}}#a(){const t=this.baseElement.shadowRoot.querySelector("vaadin-multi-select-combo-box-internal").shadowRoot.querySelector("vaadin-multi-select-combo-box-overlay");t._attachOverlay=()=>{t.bringToFront()},t._detachOverlay=()=>{},t._enterModalState=()=>{}}#l(){this.allowCustomValues&&this.baseElement.addEventListener("custom-value-set",t=>{const e=this.#t({label:t.detail,displayName:t.detail,value:t.detail});this.innerHTML+=e,this.baseElement._lastFilter="",setTimeout(()=>{this.value=[...this.value,t.detail]},0)})}setGetValidity(){this.getValidity=function(){if(this.pattern){const t=new RegExp(this.pattern);if(this.value.some(e=>!t.test(e)))return{patternMismatch:!0}}return this.isRequired&&!this.value.length?{valueMissing:!0}:this.isRequired&&this.minItemsSelection&&this.value.length<this.minItemsSelection?{rangeUnderflow:!0}:this.maxItemsSelection&&this.value.length>this.maxItemsSelection?{rangeOverflow:!0}:{}};const t=this;this.baseElement.checkValidity=()=>t.validity.valid}init(){super.init?.(),this.setGetValidity(),this.#l(),this.renderItems(),(0,i.mx)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,i.Ge)(this,this.#n.bind(this)),(0,i.EA)(this,this.baseElement,{includeAttrs:["placeholder"]}),setTimeout(()=>{this.setComboBoxDescriptor(),this.#a()}),this.setDefaultValues(),this.baseElement.addEventListener("selected-items-changed",()=>{this.#s(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0}))})}setDefaultValues(){this.defaultValues.length>0&&(this.value=this.defaultValues)}#s(){this.#r=this.baseElement.selectedItems?.map(t=>t.getAttribute("data-id"))||[]}set value(t){if(t&&t.length>0){const e=this.baseElement.items?.filter(e=>t.includes(e["data-id"]));if(this.allowCustomValues){const r=e?.map(t=>t.getAttribute("data-id"))||[],o=t.filter(t=>!r.includes(t));if(o.length){const e=o.reduce((t,e)=>t+this.#t({label:e,displayName:e,value:e}),"");return this.innerHTML+=e,void setTimeout(()=>{this.value=t},0)}}const r=e?.map(t=>t.getAttribute("data-id"))||[];(0,o.AG)(this.#r,r)||(this.baseElement.selectedItems=e)}else this.baseElement.selectedItems=[]}get value(){return this.#r}attributeChangedCallback(t,e,r){super.attributeChangedCallback?.(t,e,r),"readonly"===t&&this.onReadOnlyChange(null!==r&&"true"===r)}onReadOnlyChange(t){t?this.baseElement?.shadowRoot?.querySelector("vaadin-multi-select-combo-box-internal")?.setAttribute("inert",t):this.baseElement?.shadowRoot?.querySelector("vaadin-multi-select-combo-box-internal")?.removeAttribute("inert")}})((0,a.tz)({slots:["","prefix"],wrappedEleName:"vaadin-multi-select-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,n.cy)(I.cssVarList)}\n\t\t${(0,n.fu)("vaadin-multi-select-combo-box")}\n\t\t${(0,n.lS)("vaadin-multi-select-combo-box")}\n\t\t${(0,n.I4)("vaadin-multi-select-combo-box")}\n\n\t\tvaadin-multi-select-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-multi-select-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-multi-select-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n align-self: center;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\tvaadin-multi-select-combo-box[readonly] [slot="input"] {\n flex-grow: 1;\n flex-basis: 4em;\n\t\t}\n\n\t\t::part(input-field) {\n padding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,n.$J)("vaadin-multi-select-combo-box")}\n :host([has-label]) vaadin-multi-select-combo-box-chip::part(label) {\n display: block;\n }\n\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::before,\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -4px;\n right: -4px;\n border-left-width: 0;\n border-inline-start-style: solid;\n border-inline-start-width: 2px;\n }\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -8px;\n right: -8px;\n }\n\n :host([has-no-options][allow-custom-value='true']) ::part(toggle-button) {\n display: none;\n }\n\n ${(0,n.Kl)()}\n\n vaadin-multi-select-combo-box::part(toggle-button),\n vaadin-multi-select-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-multi-select-combo-box[label-type="floating"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-multi-select-combo-box[label-type="floating"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t`,excludeAttrsSync:["tabindex","size","data","placeholder","style"],componentName:l,includeForwardProps:["items","renderer","selectedItems"]}))},70067(t,e,r){r.r(e),r.d(e,{MultiSelectComboBoxClass:()=>o.t,componentName:()=>o.T}),r(51408);var o=r(94681);customElements.define(o.T,o.t)}}]);
2
2
  //# sourceMappingURL=67.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"67.js","mappings":"6MAyBO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,2BA0X7CC,KACAA,EAAAC,WACAA,EAAAC,aACAA,EAAAC,YACAA,EAAAC,OACAA,EAAAC,YACAA,EAAAC,MACAA,EAAAC,kBACAA,EAAAC,WACAA,EAAAC,aACAA,EAAAC,KACAA,EAAAC,UACAA,EAAAC,wBACAA,EAAAC,yBACAA,GACE,CACFb,KAAA,CAAUc,SAAA,aACVb,WAAA,CAAgBa,SAAA,uBAChBZ,aAAA,CAAkBY,SAAA,SAClBX,YAAA,CAAiBW,SAAA,6BACjBV,OAAA,CAAYU,SAAA,yBACZT,YAAA,CAAiBS,SAAA,wBACjBR,MAAA,CAAWQ,SAAA,iBACXP,kBAAA,CACAO,SAAA,+CAEAN,WAAA,CAAgBM,SAAA,uBAChBL,aAAA,CAAkBK,SAAA,yBAClBJ,KAAA,CAAUI,SAAA,sCACVH,UAAA,CAAeG,SAAA,mDACfF,wBAAA,CACAE,SAAA,+DAEAD,yBAAA,CACAC,SAAA,+DAIOC,GAAiC,EAAAC,EAAAC,KACtC,EAAAC,EAAAC,IAAgB,CAClBC,SAAA,CACAC,UAAA,IAAmBrB,EAAAsB,SAAA,SACnBC,cAAA,IAAuBvB,EAAAsB,SAAA,aACvBE,SAAA,IAAmBxB,GACnByB,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IAAgB,yjBAwBd,EAAAJ,EAAAK,IAAuB,8uBAsBvB,EAAAL,EAAAM,0bAeNC,iBAAA,iDACAxP,gBACAyP,oBAAA,qJC3qBAC,eAAAC,OAAsBC,EAAAC,EAAeD,EAAAE","sources":["webpack://@descope/web-components-ui/../components/descope-multi-select-combo-box/src/component/MultiSelectComboBoxClass.js","webpack://@descope/web-components-ui/../components/descope-multi-select-combo-box/src/component/index.js"],"sourcesContent":["import { compose, compareArraysUnordered } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n resetInputPlaceholder,\n resetInputReadonlyStyle,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '@descope-ui/common/theme-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n portalMixin,\n proxyInputMixin,\n changeMixin,\n} from '@descope-ui/common/components-mixins';\n\nexport const componentName = getComponentName('multi-select-combo-box');\n\nconst multiSelectComboBoxMixin = (superclass) =>\n class MultiSelectComboBoxMixinClass extends superclass {\n static get observedAttributes() {\n return ['readonly'];\n }\n\n #renderItem = ({ displayName, value, label }) => {\n const ele = document.createElement('span');\n ele.setAttribute('data-name', label);\n ele.setAttribute('data-id', value);\n ele.textContent = displayName || label;\n\n return ele.outerHTML;\n };\n\n #data;\n\n #value = [];\n\n get defaultValues() {\n const defaultValuesAttr = this.getAttribute('default-values');\n if (defaultValuesAttr) {\n try {\n const defaultValues = JSON.parse(defaultValuesAttr);\n if (this.isValidDataType(defaultValues)) {\n return defaultValues;\n }\n } catch (e) {\n console.error(\n 'could not parse data string from attribute \"default-values\" -',\n e.message,\n );\n }\n }\n return [];\n }\n\n get renderItem() {\n return this.#renderItem;\n }\n\n set renderItem(renderFn) {\n this.#renderItem = renderFn;\n this.renderItems();\n }\n\n get data() {\n if (this.#data) return this.#data;\n\n const dataAttr = this.getAttribute('data');\n\n if (dataAttr) {\n try {\n const data = JSON.parse(dataAttr);\n if (this.isValidDataType(data)) {\n return data;\n }\n } catch (e) {\n console.error(\n 'could not parse data string from attribute \"data\" -',\n e.message,\n );\n }\n }\n\n return [];\n }\n\n set data(data) {\n if (this.isValidDataType(data)) {\n this.#data = data;\n this.renderItems();\n }\n }\n\n get allowCustomValues() {\n return this.getAttribute('allow-custom-value') === 'true';\n }\n\n get minItemsSelection() {\n return parseInt(this.getAttribute('min-items-selection'), 10) || 0;\n }\n\n get maxItemsSelection() {\n return parseInt(this.getAttribute('max-items-selection'), 10) || 0;\n }\n\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n console.error(\n 'data and default-values must be an array, received:',\n data,\n );\n }\n\n return isValid;\n }\n\n getItemsTemplate() {\n return this.data?.reduce?.(\n (acc, item) => acc + (this.renderItem?.(item || {}) || ''),\n '',\n );\n }\n\n renderItems() {\n const template = this.getItemsTemplate();\n if (template) this.innerHTML = template;\n }\n\n updateSelectedItems() {\n const currentSelected =\n this.baseElement.selectedItems?.map((item) =>\n item.getAttribute('data-id'),\n ) || [];\n\n if (currentSelected.length > 0) {\n this.value = currentSelected;\n }\n\n if (this.value.length === 0) {\n this.setDefaultValues();\n }\n }\n\n customValueTransformFn(val) {\n return val;\n }\n\n setComboBoxDescriptor() {\n const valueDescriptor = Object.getOwnPropertyDescriptor(\n this.inputElement.constructor.prototype,\n 'value',\n );\n\n const comboBox = this;\n\n Object.defineProperties(this.inputElement, {\n value: {\n ...valueDescriptor,\n set(val) {\n const transformedValue = comboBox.customValueTransformFn(val) || '';\n\n if (transformedValue === this.value) {\n return;\n }\n\n valueDescriptor.set.call(this, transformedValue);\n },\n },\n });\n }\n\n #dedupItems(items) {\n return Array.from(\n new Map(\n items.map((item) => [item.getAttribute('data-id'), item]),\n ).values(),\n );\n }\n\n #onChildrenChange() {\n const items = Array.from(this.children);\n const dedupItems = this.#dedupItems(items);\n\n if (items.length) {\n this.removeAttribute('has-no-options');\n\n dedupItems.forEach((node) => {\n Object.defineProperty(node, 'data-name', {\n value: node.getAttribute('data-name'),\n configurable: true,\n writable: true,\n });\n Object.defineProperty(node, 'data-id', {\n value: node.getAttribute('data-id'),\n configurable: true,\n writable: true,\n });\n });\n\n this.baseElement.items = dedupItems;\n\n setTimeout(() => {\n this.updateSelectedItems();\n }, 0);\n } else {\n this.baseElement.items = [];\n this.setAttribute('has-no-options', '');\n }\n\n this.baseElement.renderer = (root, combo, model) => {\n root.innerHTML = model.item.outerHTML;\n };\n }\n\n #overrideOverlaySettings() {\n const overlay = this.baseElement.shadowRoot\n .querySelector('vaadin-multi-select-combo-box-internal')\n .shadowRoot.querySelector('vaadin-multi-select-combo-box-overlay');\n overlay._attachOverlay = () => {\n overlay.bringToFront();\n };\n overlay._detachOverlay = () => {};\n overlay._enterModalState = () => {};\n }\n\n #handleCustomValues() {\n if (this.allowCustomValues) {\n this.baseElement.addEventListener('custom-value-set', (e) => {\n const newItemHtml = this.#renderItem({\n label: e.detail,\n displayName: e.detail,\n value: e.detail,\n });\n this.innerHTML += newItemHtml;\n this.baseElement._lastFilter = '';\n setTimeout(() => {\n this.value = [...this.value, e.detail];\n }, 0);\n });\n }\n }\n\n setGetValidity() {\n this.getValidity = function () {\n if (this.pattern) {\n const patternRegex = new RegExp(this.pattern);\n if (this.value.some((val) => !patternRegex.test(val)))\n return {\n patternMismatch: true,\n };\n }\n\n if (this.isRequired && !this.value.length) {\n return {\n valueMissing: true,\n };\n }\n if (\n this.isRequired &&\n this.minItemsSelection &&\n this.value.length < this.minItemsSelection\n ) {\n return {\n rangeUnderflow: true,\n };\n }\n if (\n this.maxItemsSelection &&\n this.value.length > this.maxItemsSelection\n ) {\n return {\n rangeOverflow: true,\n };\n }\n return {};\n };\n\n const that = this;\n\n this.baseElement.checkValidity = () => that.validity.valid;\n }\n\n init() {\n super.init?.();\n\n this.setGetValidity();\n\n this.#handleCustomValues();\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), {\n includeAttrs: ['data'],\n });\n\n observeChildren(this, this.#onChildrenChange.bind(this));\n\n forwardAttrs(this, this.baseElement, { includeAttrs: ['placeholder'] });\n\n setTimeout(() => {\n this.setComboBoxDescriptor();\n this.#overrideOverlaySettings();\n });\n\n this.setDefaultValues();\n\n this.baseElement.addEventListener('selected-items-changed', () => {\n this.#updateInternalValue();\n this.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n });\n }\n\n setDefaultValues() {\n const initialDefaultValues = this.defaultValues;\n if (initialDefaultValues.length > 0) {\n this.value = this.defaultValues;\n }\n }\n\n #updateInternalValue() {\n this.#value =\n this.baseElement.selectedItems?.map((elem) =>\n elem.getAttribute('data-id'),\n ) || [];\n }\n\n set value(vals) {\n if (vals && vals.length > 0) {\n const selectedChildren = this.baseElement.items?.filter((item) =>\n vals.includes(item['data-id']),\n );\n\n if (this.allowCustomValues) {\n const existingValues =\n selectedChildren?.map((child) => child.getAttribute('data-id')) ||\n [];\n const missingValues = vals.filter(\n (val) => !existingValues.includes(val),\n );\n\n if (missingValues.length) {\n const newItemsHtml = missingValues.reduce((acc, val) => {\n const newItemHtml = this.#renderItem({\n label: val,\n displayName: val,\n value: val,\n });\n return acc + newItemHtml;\n }, '');\n this.innerHTML += newItemsHtml;\n\n setTimeout(() => {\n this.value = vals;\n }, 0);\n return;\n }\n }\n\n const newSelectedValues =\n selectedChildren?.map((child) => child.getAttribute('data-id')) || [];\n if (!compareArraysUnordered(this.#value, newSelectedValues)) {\n this.baseElement.selectedItems = selectedChildren;\n }\n } else {\n this.baseElement.selectedItems = [];\n }\n }\n\n get value() {\n return this.#value;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null && newValue === 'true');\n }\n }\n\n onReadOnlyChange(val) {\n if (val) {\n this.baseElement?.shadowRoot\n ?.querySelector('vaadin-multi-select-combo-box-internal')\n ?.setAttribute('inert', val);\n } else {\n this.baseElement?.shadowRoot\n ?.querySelector('vaadin-multi-select-combo-box-internal')\n ?.removeAttribute('inert');\n }\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n placeholder,\n toggle,\n clearButton,\n label,\n requiredIndicator,\n helperText,\n errorMessage,\n chip,\n chipLabel,\n overflowChipFirstBorder,\n overflowChipSecondBorder,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: 'input' },\n placeholder: { selector: '> input:placeholder-shown' },\n toggle: { selector: '::part(toggle-button)' },\n clearButton: { selector: '::part(clear-button)' },\n label: { selector: '::part(label)' },\n requiredIndicator: {\n selector: '[required]::part(required-indicator)::after',\n },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n chip: { selector: 'vaadin-multi-select-combo-box-chip' },\n chipLabel: { selector: 'vaadin-multi-select-combo-box-chip::part(label)' },\n overflowChipFirstBorder: {\n selector: \"vaadin-multi-select-combo-box-chip[slot='overflow']::before\",\n },\n overflowChipSecondBorder: {\n selector: \"vaadin-multi-select-combo-box-chip[slot='overflow']::after\",\n },\n};\n\nexport const MultiSelectComboBoxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: [{}, host],\n chipFontSize: { ...chipLabel, property: 'font-size' },\n fontFamily: [\n label,\n placeholder,\n inputField,\n helperText,\n errorMessage,\n chipLabel,\n ],\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n inputValueFontWeight: { ...inputField, property: 'font-weight' },\n inputPlaceholderFontWeight: { ...placeholder, property: 'font-weight' },\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n ],\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: {\n ...errorMessage,\n property: 'padding-inline-start',\n },\n errorMessageIconRepeat: {\n ...errorMessage,\n property: 'background-repeat',\n },\n errorMessageIconPosition: {\n ...errorMessage,\n property: 'background-position',\n },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n inputHeight: { ...inputField, property: 'min-height' },\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n inputValueTextColor: { ...inputField, property: 'color' },\n inputPlaceholderTextColor: { ...placeholder, property: 'color' },\n inputDropdownButtonCursor: [\n { ...toggle, property: 'cursor' },\n { ...clearButton, property: 'cursor' },\n ],\n inputDropdownButtonColor: [\n { ...toggle, property: 'color' },\n { ...clearButton, property: 'color' },\n ],\n inputDropdownButtonSize: [\n { ...toggle, property: 'font-size' },\n { ...clearButton, property: 'font-size' },\n ],\n inputDropdownButtonOffset: [\n { ...toggle, property: 'margin-right' },\n { ...toggle, property: 'margin-left' },\n ],\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n { ...inputField, property: 'padding-inline-start' },\n ],\n inputVerticalPadding: [\n { ...inputField, property: 'padding-top' },\n { ...inputField, property: 'padding-bottom' },\n ],\n chipTextColor: { ...chipLabel, property: 'color' },\n chipBackgroundColor: [\n { ...chip, property: 'background-color' },\n { ...overflowChipFirstBorder, property: 'border-color' },\n { ...overflowChipSecondBorder, property: 'border-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelLeftPosition: { ...label, property: 'left' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: { ...placeholder, property: 'opacity' },\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n\n overlayBackground: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.backgroundColor,\n },\n overlayTextColor: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.textColor,\n },\n overlayBorder: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.border,\n },\n overlayFontSize: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontSize,\n },\n overlayFontFamily: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontFamily,\n },\n overlayCursor: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.cursor,\n },\n overlayItemBoxShadow: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.itemBoxShadow,\n },\n overlayItemPaddingInlineStart: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,\n },\n overlayItemPaddingInlineEnd: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,\n },\n },\n }),\n draggableMixin,\n portalMixin({\n name: 'overlay',\n selector: 'vaadin-multi-select-combo-box-internal',\n mappings: {\n backgroundColor: { selector: 'vaadin-multi-select-combo-box-scroller' },\n minHeight: { selector: 'vaadin-multi-select-combo-box-overlay' },\n margin: { selector: 'vaadin-multi-select-combo-box-overlay' },\n cursor: { selector: 'vaadin-multi-select-combo-box-item' },\n fontFamily: { selector: 'vaadin-multi-select-combo-box-item' },\n textColor: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'color',\n },\n fontSize: { selector: 'vaadin-multi-select-combo-box-item' },\n itemBoxShadow: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'box-shadow',\n },\n itemPaddingInlineStart: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'padding-inline-start',\n },\n itemPaddingInlineEnd: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'padding-inline-end',\n },\n },\n forward: {\n include: false,\n attributes: ['size'],\n },\n }),\n proxyInputMixin({\n proxyProps: ['selectionStart'],\n inputEvent: 'selected-items-changed',\n }),\n changeMixin,\n componentNameValidationMixin,\n multiSelectComboBoxMixin,\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-multi-select-combo-box',\n style: () => `\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${useHostExternalPadding(MultiSelectComboBoxClass.cssVarList)}\n\t\t${resetInputReadonlyStyle('vaadin-multi-select-combo-box')}\n\t\t${resetInputPlaceholder('vaadin-multi-select-combo-box')}\n\t\t${resetInputCursor('vaadin-multi-select-combo-box')}\n\n\t\tvaadin-multi-select-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-multi-select-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-multi-select-combo-box [slot=\"input\"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n align-self: center;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\tvaadin-multi-select-combo-box[readonly] [slot=\"input\"] {\n flex-grow: 1;\n flex-basis: 4em;\n\t\t}\n\n\t\t::part(input-field) {\n padding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${resetInputLabelPosition('vaadin-multi-select-combo-box')}\n :host([has-label]) vaadin-multi-select-combo-box-chip::part(label) {\n display: block;\n }\n\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::before,\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -4px;\n right: -4px;\n border-left-width: 0;\n border-inline-start-style: solid;\n border-inline-start-width: 2px;\n }\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -8px;\n right: -8px;\n }\n\n :host([has-no-options][allow-custom-value='true']) ::part(toggle-button) {\n display: none;\n }\n\n ${inputFloatingLabelStyle()}\n\n vaadin-multi-select-combo-box::part(toggle-button),\n vaadin-multi-select-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-multi-select-combo-box[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-multi-select-combo-box[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t`,\n excludeAttrsSync: ['tabindex', 'size', 'data', 'placeholder', 'style'],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItems'],\n }),\n);\n","import '@vaadin/multi-select-combo-box';\nimport {\n componentName,\n MultiSelectComboBoxClass,\n} from './MultiSelectComboBoxClass';\n\ncustomElements.define(componentName, MultiSelectComboBoxClass);\n\nexport { MultiSelectComboBoxClass, componentName };\n"],"names":["componentName","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_1__","xE","host","inputField","inputElement","placeholder","toggle","clearButton","label","requiredIndicator","helperText","errorMessage","chip","chipLabel","overflowChipFirstBorder","overflowChipSecondBorder","selector","MultiSelectComboBoxClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_0__","Zz","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_3__","RF","mappings","hostWidth","property","hostDirection","fontSize","chipFontSize","fontFamily","labelFontSize","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputHeight","inputBackgroundColor","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","labelRequiredIndicator","inputValueTextColor","inputPlaceholderTextColor","inputDropdownButtonCursor","inputDropdownButtonColor","inputDropdownButtonSize","inputDropdownButtonOffset","inputOutlineColor","inputOutlineWidth","inputOutlineStyle","inputOutlineOffset","inputHorizontalPadding","inputVerticalPadding","chipTextColor","chipBackgroundColor","labelPosition","labelTopPosition","labelLeftPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","overlayBackground","cssVarList","overlay","backgroundColor","overlayTextColor","textColor","overlayBorder","border","overlayFontSize","overlayFontFamily","overlayCursor","cursor","overlayItemBoxShadow","itemBoxShadow","overlayItemPaddingInlineStart","itemPaddingInlineStart","overlayItemPaddingInlineEnd","itemPaddingInlineEnd","VO","mA","name","minHeight","margin","forward","include","attributes","OZ","proxyProps","inputEvent","_$","tQ","superclass","observedAttributes","renderItem","displayName","value","ele","document","createElement","setAttribute","textContent","outerHTML","data","defaultValues","defaultValuesAttr","this","getAttribute","JSON","parse","isValidDataType","e","console","error","message","renderFn","renderItems","dataAttr","allowCustomValues","minItemsSelection","parseInt","maxItemsSelection","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","template","innerHTML","updateSelectedItems","currentSelected","baseElement","selectedItems","map","length","setDefaultValues","customValueTransformFn","val","setComboBoxDescriptor","valueDescriptor","Object","getOwnPropertyDescriptor","constructor","prototype","comboBox","defineProperties","set","transformedValue","call","dedupItems","items","from","Map","values","onChildrenChange","children","removeAttribute","forEach","node","defineProperty","configurable","writable","setTimeout","renderer","root","combo","model","overrideOverlaySettings","shadowRoot","querySelector","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","handleCustomValues","addEventListener","newItemHtml","detail","_lastFilter","setGetValidity","getValidity","pattern","patternRegex","RegExp","some","test","patternMismatch","isRequired","valueMissing","rangeUnderflow","rangeOverflow","that","checkValidity","validity","valid","init","super","mx","bind","includeAttrs","Ge","EA","updateInternalValue","dispatchEvent","CustomEvent","bubbles","elem","vals","selectedChildren","filter","includes","existingValues","child","missingValues","newItemsHtml","newSelectedValues","AG","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","tz","slots","wrappedEleName","style","_descope_ui_common_theme_helpers__WEBPACK_IMPORTED_MODULE_2__","cy","fu","lS","I4","$J","Kl","excludeAttrsSync","includeForwardProps","customElements","define","_MultiSelectComboBoxClass__WEBPACK_IMPORTED_MODULE_1__","T","t"],"sourceRoot":""}
1
+ {"version":3,"file":"67.js","mappings":"6MAyBO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,2BAoZ7CC,KACAA,EAAAC,WACAA,EAAAC,aACAA,EAAAC,YACAA,EAAAC,OACAA,EAAAC,YACAA,EAAAC,MACAA,EAAAC,kBACAA,EAAAC,WACAA,EAAAC,aACAA,EAAAC,KACAA,EAAAC,UACAA,EAAAC,wBACAA,EAAAC,yBACAA,GACE,CACFb,KAAA,CAAUc,SAAA,aACVb,WAAA,CAAgBa,SAAA,uBAChBZ,aAAA,CAAkBY,SAAA,SAClBX,YAAA,CAAiBW,SAAA,6BACjBV,OAAA,CAAYU,SAAA,yBACZT,YAAA,CAAiBS,SAAA,wBACjBR,MAAA,CAAWQ,SAAA,iBACXP,kBAAA,CACAO,SAAA,+CAEAN,WAAA,CAAgBM,SAAA,uBAChBL,aAAA,CAAkBK,SAAA,yBAClBJ,KAAA,CAAUI,SAAA,sCACVH,UAAA,CAAeG,SAAA,mDACfF,wBAAA,CACAE,SAAA,+DAEAD,yBAAA,CACAC,SAAA,+DAIOC,GAAiC,EAAAC,EAAAC,KACtC,EAAAC,EAAAC,IAAgB,CAClBC,SAAA,CACAC,UAAA,IAAmBrB,EAAAsB,SAAA,SACnBC,cAAA,IAAuBvB,EAAAsB,SAAA,aACvBE,SAAA,IAAmBxB,GACnByB,aAAA,IAAsBd,EAAAW,SAAA,aACtBI,WAAA,CACApB,EACAH,EACAF,EACAO,EACAC,EACAE,GAEAgB,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,+HAMI,EAAAC,EAAAC,IAAsBjO,EAAAyD,qBACtB,EAAAuK,EAAAE,IAAuB,0CACvB,EAAAF,EAAAG,IAAqB,0CACrB,EAAAH,EAAAI,IAAgB,yjBAwBd,EAAAJ,EAAAK,IAAuB,8uBAsBvB,EAAAL,EAAAM,0bAeNC,iBAAA,iDACAzP,gBACA0P,oBAAA,qJCrsBAC,eAAAC,OAAsBC,EAAAC,EAAeD,EAAAE","sources":["webpack://@descope/web-components-ui/../components/descope-multi-select-combo-box/src/component/MultiSelectComboBoxClass.js","webpack://@descope/web-components-ui/../components/descope-multi-select-combo-box/src/component/index.js"],"sourcesContent":["import { compose, compareArraysUnordered } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n observeAttributes,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport {\n resetInputLabelPosition,\n resetInputCursor,\n resetInputPlaceholder,\n resetInputReadonlyStyle,\n useHostExternalPadding,\n inputFloatingLabelStyle,\n} from '@descope-ui/common/theme-helpers';\nimport {\n createStyleMixin,\n draggableMixin,\n createProxy,\n componentNameValidationMixin,\n portalMixin,\n proxyInputMixin,\n changeMixin,\n} from '@descope-ui/common/components-mixins';\n\nexport const componentName = getComponentName('multi-select-combo-box');\n\nconst multiSelectComboBoxMixin = (superclass) =>\n class MultiSelectComboBoxMixinClass extends superclass {\n static get observedAttributes() {\n return ['readonly'];\n }\n\n #renderItem = ({ displayName, value, label }) => {\n const ele = document.createElement('span');\n ele.setAttribute('data-name', label);\n ele.setAttribute('data-id', value);\n ele.textContent = displayName || label;\n\n return ele.outerHTML;\n };\n\n #data;\n\n #value = [];\n\n get defaultValues() {\n const defaultValuesAttr = this.getAttribute('default-values');\n if (defaultValuesAttr) {\n try {\n const defaultValues = JSON.parse(defaultValuesAttr);\n if (this.isValidDataType(defaultValues)) {\n return defaultValues;\n }\n } catch (e) {\n console.error(\n 'could not parse data string from attribute \"default-values\" -',\n e.message,\n );\n }\n }\n return [];\n }\n\n get renderItem() {\n return this.#renderItem;\n }\n\n set renderItem(renderFn) {\n this.#renderItem = renderFn;\n this.renderItems();\n }\n\n get data() {\n if (this.#data) return this.#data;\n\n const dataAttr = this.getAttribute('data');\n\n if (dataAttr) {\n try {\n const data = JSON.parse(dataAttr);\n if (this.isValidDataType(data)) {\n return data;\n }\n } catch (e) {\n console.error(\n 'could not parse data string from attribute \"data\" -',\n e.message,\n );\n }\n }\n\n return [];\n }\n\n set data(data) {\n if (this.isValidDataType(data)) {\n this.#data = data;\n this.renderItems();\n }\n }\n\n get allowCustomValues() {\n return this.getAttribute('allow-custom-value') === 'true';\n }\n\n get minItemsSelection() {\n return parseInt(this.getAttribute('min-items-selection'), 10) || 0;\n }\n\n get maxItemsSelection() {\n return parseInt(this.getAttribute('max-items-selection'), 10) || 0;\n }\n\n isValidDataType(data) {\n const isValid = Array.isArray(data);\n if (!isValid) {\n console.error(\n 'data and default-values must be an array, received:',\n data,\n );\n }\n\n return isValid;\n }\n\n getItemsTemplate() {\n return this.data?.reduce?.(\n (acc, item) => acc + (this.renderItem?.(item || {}) || ''),\n '',\n );\n }\n\n // Whether `data` is what this combo box builds its items from. Items can instead be given as\n // light DOM children (see the observeChildren call in init), and those are the consumer's to\n // manage - so an absent, empty or unparseable `data` attribute means \"not my items\".\n #hasDataSource() {\n if (this.#data) return true;\n\n const dataAttr = this.getAttribute('data');\n if (!dataAttr) return false;\n\n try {\n return Array.isArray(JSON.parse(dataAttr));\n } catch {\n // Already reported by the `data` getter, and a broken attribute is no reason to throw\n // away items that are on screen.\n return false;\n }\n }\n\n renderItems() {\n const template = this.getItemsTemplate();\n if (template) {\n this.innerHTML = template;\n return;\n }\n\n // An empty list has to empty the dropdown. Without this the previous items stayed on screen\n // after the data said there were none, so a picker refreshed with nothing left would still\n // offer the old rows.\n if (this.#hasDataSource()) this.innerHTML = '';\n }\n\n updateSelectedItems() {\n const currentSelected =\n this.baseElement.selectedItems?.map((item) =>\n item.getAttribute('data-id'),\n ) || [];\n\n if (currentSelected.length > 0) {\n this.value = currentSelected;\n }\n\n if (this.value.length === 0) {\n this.setDefaultValues();\n }\n }\n\n customValueTransformFn(val) {\n return val;\n }\n\n setComboBoxDescriptor() {\n const valueDescriptor = Object.getOwnPropertyDescriptor(\n this.inputElement.constructor.prototype,\n 'value',\n );\n\n const comboBox = this;\n\n Object.defineProperties(this.inputElement, {\n value: {\n ...valueDescriptor,\n set(val) {\n const transformedValue = comboBox.customValueTransformFn(val) || '';\n\n if (transformedValue === this.value) {\n return;\n }\n\n valueDescriptor.set.call(this, transformedValue);\n },\n },\n });\n }\n\n #dedupItems(items) {\n return Array.from(\n new Map(\n items.map((item) => [item.getAttribute('data-id'), item]),\n ).values(),\n );\n }\n\n #onChildrenChange() {\n const items = Array.from(this.children);\n const dedupItems = this.#dedupItems(items);\n\n if (items.length) {\n this.removeAttribute('has-no-options');\n\n dedupItems.forEach((node) => {\n Object.defineProperty(node, 'data-name', {\n value: node.getAttribute('data-name'),\n configurable: true,\n writable: true,\n });\n Object.defineProperty(node, 'data-id', {\n value: node.getAttribute('data-id'),\n configurable: true,\n writable: true,\n });\n });\n\n this.baseElement.items = dedupItems;\n\n setTimeout(() => {\n this.updateSelectedItems();\n }, 0);\n } else {\n this.baseElement.items = [];\n this.setAttribute('has-no-options', '');\n }\n\n this.baseElement.renderer = (root, combo, model) => {\n root.innerHTML = model.item.outerHTML;\n };\n }\n\n #overrideOverlaySettings() {\n const overlay = this.baseElement.shadowRoot\n .querySelector('vaadin-multi-select-combo-box-internal')\n .shadowRoot.querySelector('vaadin-multi-select-combo-box-overlay');\n overlay._attachOverlay = () => {\n overlay.bringToFront();\n };\n overlay._detachOverlay = () => {};\n overlay._enterModalState = () => {};\n }\n\n #handleCustomValues() {\n if (this.allowCustomValues) {\n this.baseElement.addEventListener('custom-value-set', (e) => {\n const newItemHtml = this.#renderItem({\n label: e.detail,\n displayName: e.detail,\n value: e.detail,\n });\n this.innerHTML += newItemHtml;\n this.baseElement._lastFilter = '';\n setTimeout(() => {\n this.value = [...this.value, e.detail];\n }, 0);\n });\n }\n }\n\n setGetValidity() {\n this.getValidity = function () {\n if (this.pattern) {\n const patternRegex = new RegExp(this.pattern);\n if (this.value.some((val) => !patternRegex.test(val)))\n return {\n patternMismatch: true,\n };\n }\n\n if (this.isRequired && !this.value.length) {\n return {\n valueMissing: true,\n };\n }\n if (\n this.isRequired &&\n this.minItemsSelection &&\n this.value.length < this.minItemsSelection\n ) {\n return {\n rangeUnderflow: true,\n };\n }\n if (\n this.maxItemsSelection &&\n this.value.length > this.maxItemsSelection\n ) {\n return {\n rangeOverflow: true,\n };\n }\n return {};\n };\n\n const that = this;\n\n this.baseElement.checkValidity = () => that.validity.valid;\n }\n\n init() {\n super.init?.();\n\n this.setGetValidity();\n\n this.#handleCustomValues();\n\n this.renderItems();\n\n observeAttributes(this, this.renderItems.bind(this), {\n includeAttrs: ['data'],\n });\n\n observeChildren(this, this.#onChildrenChange.bind(this));\n\n forwardAttrs(this, this.baseElement, { includeAttrs: ['placeholder'] });\n\n setTimeout(() => {\n this.setComboBoxDescriptor();\n this.#overrideOverlaySettings();\n });\n\n this.setDefaultValues();\n\n this.baseElement.addEventListener('selected-items-changed', () => {\n this.#updateInternalValue();\n this.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n });\n }\n\n setDefaultValues() {\n const initialDefaultValues = this.defaultValues;\n if (initialDefaultValues.length > 0) {\n this.value = this.defaultValues;\n }\n }\n\n #updateInternalValue() {\n this.#value =\n this.baseElement.selectedItems?.map((elem) =>\n elem.getAttribute('data-id'),\n ) || [];\n }\n\n set value(vals) {\n if (vals && vals.length > 0) {\n const selectedChildren = this.baseElement.items?.filter((item) =>\n vals.includes(item['data-id']),\n );\n\n if (this.allowCustomValues) {\n const existingValues =\n selectedChildren?.map((child) => child.getAttribute('data-id')) ||\n [];\n const missingValues = vals.filter(\n (val) => !existingValues.includes(val),\n );\n\n if (missingValues.length) {\n const newItemsHtml = missingValues.reduce((acc, val) => {\n const newItemHtml = this.#renderItem({\n label: val,\n displayName: val,\n value: val,\n });\n return acc + newItemHtml;\n }, '');\n this.innerHTML += newItemsHtml;\n\n setTimeout(() => {\n this.value = vals;\n }, 0);\n return;\n }\n }\n\n const newSelectedValues =\n selectedChildren?.map((child) => child.getAttribute('data-id')) || [];\n if (!compareArraysUnordered(this.#value, newSelectedValues)) {\n this.baseElement.selectedItems = selectedChildren;\n }\n } else {\n this.baseElement.selectedItems = [];\n }\n }\n\n get value() {\n return this.#value;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null && newValue === 'true');\n }\n }\n\n onReadOnlyChange(val) {\n if (val) {\n this.baseElement?.shadowRoot\n ?.querySelector('vaadin-multi-select-combo-box-internal')\n ?.setAttribute('inert', val);\n } else {\n this.baseElement?.shadowRoot\n ?.querySelector('vaadin-multi-select-combo-box-internal')\n ?.removeAttribute('inert');\n }\n }\n };\n\nconst {\n host,\n inputField,\n inputElement,\n placeholder,\n toggle,\n clearButton,\n label,\n requiredIndicator,\n helperText,\n errorMessage,\n chip,\n chipLabel,\n overflowChipFirstBorder,\n overflowChipSecondBorder,\n} = {\n host: { selector: () => ':host' },\n inputField: { selector: '::part(input-field)' },\n inputElement: { selector: 'input' },\n placeholder: { selector: '> input:placeholder-shown' },\n toggle: { selector: '::part(toggle-button)' },\n clearButton: { selector: '::part(clear-button)' },\n label: { selector: '::part(label)' },\n requiredIndicator: {\n selector: '[required]::part(required-indicator)::after',\n },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n chip: { selector: 'vaadin-multi-select-combo-box-chip' },\n chipLabel: { selector: 'vaadin-multi-select-combo-box-chip::part(label)' },\n overflowChipFirstBorder: {\n selector: \"vaadin-multi-select-combo-box-chip[slot='overflow']::before\",\n },\n overflowChipSecondBorder: {\n selector: \"vaadin-multi-select-combo-box-chip[slot='overflow']::after\",\n },\n};\n\nexport const MultiSelectComboBoxClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: [{}, host],\n chipFontSize: { ...chipLabel, property: 'font-size' },\n fontFamily: [\n label,\n placeholder,\n inputField,\n helperText,\n errorMessage,\n chipLabel,\n ],\n labelFontSize: { ...label, property: 'font-size' },\n labelFontWeight: { ...label, property: 'font-weight' },\n inputValueFontWeight: { ...inputField, property: 'font-weight' },\n inputPlaceholderFontWeight: { ...placeholder, property: 'font-weight' },\n helperTextFontWeight: { ...helperText, property: 'font-weight' },\n errorMessageFontWeight: { ...errorMessage, property: 'font-weight' },\n labelTextColor: [\n { ...label, property: 'color' },\n { ...requiredIndicator, property: 'color' },\n ],\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: {\n ...errorMessage,\n property: 'padding-inline-start',\n },\n errorMessageIconRepeat: {\n ...errorMessage,\n property: 'background-repeat',\n },\n errorMessageIconPosition: {\n ...errorMessage,\n property: 'background-position',\n },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n inputHeight: { ...inputField, property: 'min-height' },\n inputBackgroundColor: { ...inputField, property: 'background-color' },\n inputBorderColor: { ...inputField, property: 'border-color' },\n inputBorderWidth: { ...inputField, property: 'border-width' },\n inputBorderStyle: { ...inputField, property: 'border-style' },\n inputBorderRadius: { ...inputField, property: 'border-radius' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n inputValueTextColor: { ...inputField, property: 'color' },\n inputPlaceholderTextColor: { ...placeholder, property: 'color' },\n inputDropdownButtonCursor: [\n { ...toggle, property: 'cursor' },\n { ...clearButton, property: 'cursor' },\n ],\n inputDropdownButtonColor: [\n { ...toggle, property: 'color' },\n { ...clearButton, property: 'color' },\n ],\n inputDropdownButtonSize: [\n { ...toggle, property: 'font-size' },\n { ...clearButton, property: 'font-size' },\n ],\n inputDropdownButtonOffset: [\n { ...toggle, property: 'margin-right' },\n { ...toggle, property: 'margin-left' },\n ],\n inputOutlineColor: { ...inputField, property: 'outline-color' },\n inputOutlineWidth: { ...inputField, property: 'outline-width' },\n inputOutlineStyle: { ...inputField, property: 'outline-style' },\n inputOutlineOffset: { ...inputField, property: 'outline-offset' },\n inputHorizontalPadding: [\n { ...inputElement, property: 'padding-left' },\n { ...inputElement, property: 'padding-right' },\n { ...inputField, property: 'padding-inline-start' },\n ],\n inputVerticalPadding: [\n { ...inputField, property: 'padding-top' },\n { ...inputField, property: 'padding-bottom' },\n ],\n chipTextColor: { ...chipLabel, property: 'color' },\n chipBackgroundColor: [\n { ...chip, property: 'background-color' },\n { ...overflowChipFirstBorder, property: 'border-color' },\n { ...overflowChipSecondBorder, property: 'border-color' },\n ],\n\n labelPosition: { ...label, property: 'position' },\n labelTopPosition: { ...label, property: 'top' },\n labelLeftPosition: { ...label, property: 'left' },\n labelHorizontalPosition: [\n { ...label, property: 'left' },\n { ...label, property: 'right' },\n ],\n inputTransformY: { ...label, property: 'transform' },\n inputTransition: { ...label, property: 'transition' },\n marginInlineStart: { ...label, property: 'margin-inline-start' },\n placeholderOpacity: { ...placeholder, property: 'opacity' },\n inputVerticalAlignment: { ...inputField, property: 'align-items' },\n\n overlayBackground: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.backgroundColor,\n },\n overlayTextColor: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.textColor,\n },\n overlayBorder: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.border,\n },\n overlayFontSize: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontSize,\n },\n overlayFontFamily: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.fontFamily,\n },\n overlayCursor: {\n property: () => MultiSelectComboBoxClass.cssVarList.overlay.cursor,\n },\n overlayItemBoxShadow: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.itemBoxShadow,\n },\n overlayItemPaddingInlineStart: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineStart,\n },\n overlayItemPaddingInlineEnd: {\n property: () =>\n MultiSelectComboBoxClass.cssVarList.overlay.itemPaddingInlineEnd,\n },\n },\n }),\n draggableMixin,\n portalMixin({\n name: 'overlay',\n selector: 'vaadin-multi-select-combo-box-internal',\n mappings: {\n backgroundColor: { selector: 'vaadin-multi-select-combo-box-scroller' },\n minHeight: { selector: 'vaadin-multi-select-combo-box-overlay' },\n margin: { selector: 'vaadin-multi-select-combo-box-overlay' },\n cursor: { selector: 'vaadin-multi-select-combo-box-item' },\n fontFamily: { selector: 'vaadin-multi-select-combo-box-item' },\n textColor: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'color',\n },\n fontSize: { selector: 'vaadin-multi-select-combo-box-item' },\n itemBoxShadow: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'box-shadow',\n },\n itemPaddingInlineStart: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'padding-inline-start',\n },\n itemPaddingInlineEnd: {\n selector: 'vaadin-multi-select-combo-box-item',\n property: 'padding-inline-end',\n },\n },\n forward: {\n include: false,\n attributes: ['size'],\n },\n }),\n proxyInputMixin({\n proxyProps: ['selectionStart'],\n inputEvent: 'selected-items-changed',\n }),\n changeMixin,\n componentNameValidationMixin,\n multiSelectComboBoxMixin,\n)(\n createProxy({\n slots: ['', 'prefix'],\n wrappedEleName: 'vaadin-multi-select-combo-box',\n style: () => `\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${useHostExternalPadding(MultiSelectComboBoxClass.cssVarList)}\n\t\t${resetInputReadonlyStyle('vaadin-multi-select-combo-box')}\n\t\t${resetInputPlaceholder('vaadin-multi-select-combo-box')}\n\t\t${resetInputCursor('vaadin-multi-select-combo-box')}\n\n\t\tvaadin-multi-select-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-multi-select-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-multi-select-combo-box [slot=\"input\"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n align-self: center;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\tvaadin-multi-select-combo-box[readonly] [slot=\"input\"] {\n flex-grow: 1;\n flex-basis: 4em;\n\t\t}\n\n\t\t::part(input-field) {\n padding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${resetInputLabelPosition('vaadin-multi-select-combo-box')}\n :host([has-label]) vaadin-multi-select-combo-box-chip::part(label) {\n display: block;\n }\n\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::before,\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -4px;\n right: -4px;\n border-left-width: 0;\n border-inline-start-style: solid;\n border-inline-start-width: 2px;\n }\n vaadin-multi-select-combo-box vaadin-multi-select-combo-box-chip[slot='overflow']::after {\n left: -8px;\n right: -8px;\n }\n\n :host([has-no-options][allow-custom-value='true']) ::part(toggle-button) {\n display: none;\n }\n\n ${inputFloatingLabelStyle()}\n\n vaadin-multi-select-combo-box::part(toggle-button),\n vaadin-multi-select-combo-box::part(clear-button) {\n align-self: center;\n }\n\n vaadin-multi-select-combo-box[label-type=\"floating\"]:not([focused])[readonly] > input:placeholder-shown {\n opacity: 0;\n }\n vaadin-multi-select-combo-box[label-type=\"floating\"]:not([focused])[disabled] > input:placeholder-shown {\n opacity: 0;\n }\n\n\t\t`,\n excludeAttrsSync: ['tabindex', 'size', 'data', 'placeholder', 'style'],\n componentName,\n includeForwardProps: ['items', 'renderer', 'selectedItems'],\n }),\n);\n","import '@vaadin/multi-select-combo-box';\nimport {\n componentName,\n MultiSelectComboBoxClass,\n} from './MultiSelectComboBoxClass';\n\ncustomElements.define(componentName, MultiSelectComboBoxClass);\n\nexport { MultiSelectComboBoxClass, componentName };\n"],"names":["componentName","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_1__","xE","host","inputField","inputElement","placeholder","toggle","clearButton","label","requiredIndicator","helperText","errorMessage","chip","chipLabel","overflowChipFirstBorder","overflowChipSecondBorder","selector","MultiSelectComboBoxClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_0__","Zz","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_3__","RF","mappings","hostWidth","property","hostDirection","fontSize","chipFontSize","fontFamily","labelFontSize","labelFontWeight","inputValueFontWeight","inputPlaceholderFontWeight","helperTextFontWeight","errorMessageFontWeight","labelTextColor","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","inputHeight","inputBackgroundColor","inputBorderColor","inputBorderWidth","inputBorderStyle","inputBorderRadius","labelRequiredIndicator","inputValueTextColor","inputPlaceholderTextColor","inputDropdownButtonCursor","inputDropdownButtonColor","inputDropdownButtonSize","inputDropdownButtonOffset","inputOutlineColor","inputOutlineWidth","inputOutlineStyle","inputOutlineOffset","inputHorizontalPadding","inputVerticalPadding","chipTextColor","chipBackgroundColor","labelPosition","labelTopPosition","labelLeftPosition","labelHorizontalPosition","inputTransformY","inputTransition","marginInlineStart","placeholderOpacity","inputVerticalAlignment","overlayBackground","cssVarList","overlay","backgroundColor","overlayTextColor","textColor","overlayBorder","border","overlayFontSize","overlayFontFamily","overlayCursor","cursor","overlayItemBoxShadow","itemBoxShadow","overlayItemPaddingInlineStart","itemPaddingInlineStart","overlayItemPaddingInlineEnd","itemPaddingInlineEnd","VO","mA","name","minHeight","margin","forward","include","attributes","OZ","proxyProps","inputEvent","_$","tQ","superclass","observedAttributes","renderItem","displayName","value","ele","document","createElement","setAttribute","textContent","outerHTML","data","defaultValues","defaultValuesAttr","this","getAttribute","JSON","parse","isValidDataType","e","console","error","message","renderFn","renderItems","dataAttr","allowCustomValues","minItemsSelection","parseInt","maxItemsSelection","isValid","Array","isArray","getItemsTemplate","reduce","acc","item","hasDataSource","template","innerHTML","updateSelectedItems","currentSelected","baseElement","selectedItems","map","length","setDefaultValues","customValueTransformFn","val","setComboBoxDescriptor","valueDescriptor","Object","getOwnPropertyDescriptor","constructor","prototype","comboBox","defineProperties","set","transformedValue","call","dedupItems","items","from","Map","values","onChildrenChange","children","removeAttribute","forEach","node","defineProperty","configurable","writable","setTimeout","renderer","root","combo","model","overrideOverlaySettings","shadowRoot","querySelector","_attachOverlay","bringToFront","_detachOverlay","_enterModalState","handleCustomValues","addEventListener","newItemHtml","detail","_lastFilter","setGetValidity","getValidity","pattern","patternRegex","RegExp","some","test","patternMismatch","isRequired","valueMissing","rangeUnderflow","rangeOverflow","that","checkValidity","validity","valid","init","super","mx","bind","includeAttrs","Ge","EA","updateInternalValue","dispatchEvent","CustomEvent","bubbles","elem","vals","selectedChildren","filter","includes","existingValues","child","missingValues","newItemsHtml","newSelectedValues","AG","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","tz","slots","wrappedEleName","style","_descope_ui_common_theme_helpers__WEBPACK_IMPORTED_MODULE_2__","cy","fu","lS","I4","$J","Kl","excludeAttrsSync","includeForwardProps","customElements","define","_MultiSelectComboBoxClass__WEBPACK_IMPORTED_MODULE_1__","T","t"],"sourceRoot":""}
package/dist/umd/8961.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[8961],{34797(t,e,s){s.d(e,{q:()=>l});var r=s(63200),i=s(61246),n=s(27754),a=s(11501),o=s(36745);const l=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,r.Zz)(i.t,a.m,o.y,n.b)(s)}},84548(t,e,s){s.d(e,{O:()=>r,h:()=>i});const r={CONNECTOR_INVALID:"CONNECTOR_INVALID",FETCH_RESULTS_ERROR:"FETCH_RESULTS_ERROR"},i=()=>class{constructor(t){this.getAttribute=t,this.isValid=this.#s()}checkConnectorValidity(){this.isValid=this.#s()}#s(){return!this.getRequiredParams().filter(t=>{const e=this.getAttribute(t);return!e||!this.validateParam(t,e)}).length}validateParam(t,e){return e.trim().length>0}getRequiredParams(){return console.error("Connector must implement getRequiredParams"),[]}async fetch(t){return this.isValid?this._fetchResults(t):(console.error(`[${this.constructor.name}] Cannot fetch results: connector is not properly configured`),{results:[],error:r.CONNECTOR_INVALID})}_fetchResults(t){return console.error("Connector must implement fetchResults"),{results:[],error:void 0}}}},49449(t,e,s){s.d(e,{y:()=>h});var r=s(63200),i=s(1317),n=s(70962),a=s(4430),o=s(36745),l=s(34797);const h=(...t)=>(0,r.Zz)(a.X,i._,o.y,n.j)((0,l.q)(...t))},3563(t,e,s){s(63200),s(22515),s(11430),s(34797),s(25964)},72270(t,e,s){s.d(e,{OR:()=>n.O,h:()=>n.h,qu:()=>r.q,yc:()=>i.y});var r=s(34797),i=(s(3563),s(49449)),n=s(84548)},50336(t,e,s){function r(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{r:()=>r})},88961(t,e,s){s.d(e,{DM:()=>r.DM,Jm:()=>r.Jm,OZ:()=>r.OZ,RF:()=>r.RF,VO:()=>r.VO,Yg:()=>r.Yg,_$:()=>r._$,mA:()=>r.mA,t$:()=>r.t$,tQ:()=>r.tQ,tz:()=>r.tz,y:()=>r.y});var r=s(78968)},71887(t,e,s){s.d(e,{y:()=>r});const r=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mousedown",t=>{t.preventDefault(),this.setAttribute("active","true"),window.addEventListener("mouseup",()=>this.removeAttribute("active"),{once:!0})})}}},1317(t,e,s){s.d(e,{_:()=>i});var r=s(50336);const i=t=>class extends t{#r=r.r.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",t=>{t.stopPropagation()}),this.addEventListener("blur",()=>{this.value!==this.prevValue&&(this.#r(),this.prevValue=this.value)})}}},61246(t,e,s){s.d(e,{t:()=>r});const r=t=>class extends t{#i(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#i()}}},27754(t,e,s){s.d(e,{b:()=>r});const r=t=>class extends t{updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}}},83370(t,e,s){s.d(e,{J:()=>r});const r=({connectorClasses:t})=>e=>class extends e{#n=t;static get observedAttributes(){return[...e.observedAttributes||[],"connector-template"]}get connectorClasses(){return this.#n}set connectorClasses(t){this.#n=t}get connectorTemplate(){return this.getAttribute("connector-template")}initializeConnector(){const t=this.connectorTemplate;if(!this.connectorClasses[t])return;const e=this.connectorClasses[t];this.connector=new e(this.getAttribute.bind(this))}async fetchConnectorResults(t){if(!this.connector)return console.error(`No connector initialized for the field with template: ${this.connectorTemplate}`),{results:[]};const{results:e,error:s}=await this.connector.fetch(t);return s?{results:[],error:s}:{results:e.map(({label:t,value:e})=>({label:t,value:e}))}}init(){super.init?.(),this.initializeConnector()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),e!==s&&"connector-template"===t&&this.initializeConnector()}}},84292(t,e,s){s.d(e,{t:()=>a});var r=s(25964);const i=()=>!0,n=t=>`<pre>${JSON.stringify(t,null,4)}</pre>`,a=({itemRenderer:t=n,validateSchema:e=i,slotName:s,rerenderAttrsList:a=[],targetSelector:o,sortFn:l=t=>t})=>i=>class extends i{#a=[];#o;#l(t){if(!e)return!0;const s=e(t);return!0===s||(console.error("Data schema validation failed",s||""),!1)}#h(){const t=s?`*[slot="${s}"]`:":not([slot])";this.#o&&this.#o.querySelectorAll(t).forEach(t=>t.remove())}#c(){this.#h(),(l?this.data.sort(l):this.data).forEach((e,s)=>{const r="string"==typeof(i=t(e,s,this))?(t=>{const e=document.createElement("template");return e.innerHTML=t,e})(i).content:i instanceof HTMLTemplateElement?i.content:(console.error("Invalid template",i),null);var i;this.#o&&this.#o.appendChild(r?.cloneNode(!0))})}set data(t){this.#l(t)&&(this.#a=t,this.#c())}get data(){return this.#a}init(){super.init?.(),this.#o=o?this.shadowRoot.querySelector(o):this.baseElement,(0,r.mx)(this,t=>{t.includes("data")?this.#u():this.#c()},{includeAttrs:[...a,"data"]})}#u(){const t=this.getAttribute("data");if(t)try{this.data=JSON.parse(t)}catch(e){console.warn("Invalid JSON data",t)}}}},1160(t,e,s){s.d(e,{t:()=>o});var r=s(72270),i=s(63200),n=s(25964),a=s(50336);const o=({componentName:t,wrappedEleName:e,slots:s=[],style:o,excludeAttrsSync:l=[],includeAttrsSync:h=[],includeForwardProps:c=[],delegatesFocus:u=!0})=>{class d extends((0,r.qu)({componentName:t,baseSelector:e})){#d=a.r.bind(this,"blur");#m=a.r.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:u}).innerHTML=`\n\t\t\t<${e}>\n\t\t\t${s.map(t=>`<slot ${t?`name="${t}" slot="${t}"`:""}></slot>`).join("")}\n\t\t\t</${e}>\n\t\t`,(0,n.fz)(((0,i.Tn)(o)?o():o)||"",this)}init(){super.init?.(),this.baseElement.addEventListener("blur",t=>{this.#d()}),this.baseElement.addEventListener("focus",t=>{this.#m()}),(0,n.q)(this.baseElement,this,c),(0,n.Gh)(this.baseElement,this,{excludeAttrs:l,includeAttrs:h})}}return d}},83538(t,e,s){s.d(e,{AM:()=>d,SR:()=>u,_r:()=>h});var r=s(63200),i=s(25964);const n=t=>`${t}__override`,a=(t,e,s=!1)=>{const r=`var(${t}${e?`, ${e}`:""})`;return s?`var(${n(t)}, ${r})`:r};class o{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce((t,[e,s])=>`${t}${e} { \n${s.map(({property:t,value:e})=>`${t}: ${e}`).join(";\n")} \n}\n\n`,"")}}const l=(t,e="fallback")=>(0,r.GL)(t,e),h=(t,e,s)=>{const n=new o,h=(t,e)=>{if(!t)return"";if("string"==typeof t)return t;const s=l(e,t?.suffix);return a(s,h(t.fallback,s))};return Object.keys(s).forEach(o=>{const l=((t,e)=>{const s={selector:"",property:(0,r.kW)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map(t=>({...s,...t})):[{...s,...e}]:[s]})(o,s[o]),c=(0,i.Ix)(t,o);l.forEach(({selector:t,property:s,important:i,fallback:o})=>{const l=h(o,c);n.add(((t="",e="")=>(0,r.Tn)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,r.Tn)(s)?s():s,a(c,l,!0)+(i?"!important":""))})}),n.toString()},c=(t,e,{fallback:s})=>{if(!s)return{};const i=l(e,s.suffix),n=(0,r.dk)(t,s.suffix||"fallback");return{[n]:i,...c(n,i,s)}},u=(t,e)=>Object.keys(e).reduce((s,r)=>{const a=(0,i.Ix)(t,r);return Object.assign(s,{[r]:a},{[r+"Override"]:n(a)},c(r,a,e[r]))},{}),d=(t,e)=>`.${t}`.repeat(e)},22515(t,e,s){s.d(e,{R:()=>l});var r=s(69591),i=s(63200),n=s(25964),a=s(79673),o=s(83538);const l=({mappings:t={},componentNameOverride:e=""})=>s=>{const l=e||s.componentName;return class e extends s{static get cssVarList(){return{...s.cssVarList,...(0,o.SR)(l,{...t})}}#g;#p;#b;#E;#v;#f;#y;#A;#C;constructor({getRootElement:t,componentNameSuffix:s="",themeSection:n=r.IM,baseSelector:a}={}){super(),this.#E=s,this.#v=n,this.#y=a??this.baseSelector,this.#C=t,this.#A=Object.keys(e.cssVarList).map(t=>(0,i.GL)("st",s,t))}get#S(){return a.br.currentTheme?.[l]||""}#M(){this.#p.replaceSync(this.#S[this.#v]),this.currentThemeName=a.br.currentThemeName,this.onThemeChange?.(a.br.currentThemeName)}#w(){this.#p=(0,n.fz)("",this.#f,{prepend:!0}),this.#b=a.br.onCurrentThemeChange(this.#M.bind(this)),this.#M()}#T(){if(this.#A.length){let t=(0,o.AM)(l,r.aE);const e=this.getAttribute("id");e&&(t+=`#${CSS.escape(e)}`),this.#g=(0,n.fz)(`:host(${t}) {}`,this.#f)}}#R(t,e){const s=this.#g.cssRules[0].style;if(!s)return;const r=(0,n.Ix)(l,t.replace(new RegExp("^st-"),""));e?s?.setProperty(r,e):(s?.removeProperty(r),this.removeAttribute(t))}#x(t=[]){t.forEach(t=>{this.#A.includes(t)&&this.#R(t,this.getAttribute(t))})}#V(){if(Object.keys(t).length){const e=(0,o._r)((0,i.GL)(l,this.#E),this.#y,t);(0,n.fz)(e,this.#f,{prepend:!0})}}#L(t){(this.#f?.classList||this.#f?.host?.classList||this.classList).add(t)}async init(){super.init?.(),!this.shadowRoot?.isConnected&&this.shadowRoot||(this.#f=await(this.#C?.(this))||this.shadowRoot,this.#L(l),this.#V(),this.#w(),this.#T(),(0,n.mx)(this,this.#x.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#b?.()}}}},11430(t,e,s){s.d(e,{V:()=>i});var r=s(25964);const i=t=>class extends t{constructor(){super(),(0,r.fz)(':host([draggable="true"]) * { cursor: inherit!important }',this)}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}}),super.init?.()}}},19852(t,e,s){s(25964)},11501(t,e,s){s.d(e,{m:()=>r});const r=t=>class extends t{init(){super.init?.(),(this.baseElement||this).addEventListener("mouseover",t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",()=>this.removeAttribute("hover"),{once:!0})})}}},78968(t,e,s){s.d(e,{DM:()=>g.D,Jm:()=>c.J,OZ:()=>a.O,RF:()=>r.R,VO:()=>i.V,Yg:()=>m.Y,_$:()=>h._,mA:()=>l.m,t$:()=>u.t,tQ:()=>o.t,tz:()=>n.t,y:()=>d.y});var r=s(22515),i=s(11430),n=s(1160),a=s(71209),o=s(61246),l=(s(4430),s(87503)),h=s(1317),c=(s(36745),s(19852),s(83370)),u=s(84292),d=s(71887),m=s(76477),g=s(93280)},70962(t,e,s){s.d(e,{j:()=>i});var r=s(50336);const i=t=>class extends t{init(){this.#N(),super.init?.()}#N(){["blur","focus","focusin","focusout"].forEach(t=>{this.addEventListener(t,t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()})})}handleFocusEventsDispatching(t){let e;t?.forEach(t=>{t?.addEventListener("focusout",t=>{t.stopImmediatePropagation(),e=setTimeout(()=>{e=null,r.r.call(this,"blur"),r.r.call(this,"focusout",{bubbles:!0})})});const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(r.r.call(this,"focus"),r.r.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)})}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",e=>{this!==e.target&&(e.stopImmediatePropagation(),t!==this.value&&(t=this.value,r.r.call(this,"input",{bubbles:!0,composed:!0})))})}}},76477(t,e,s){s.d(e,{Y:()=>r});const r=t=>class extends t{init(){super.init?.(),this.baseElement._hasValidConstraints&&(this.baseElement._hasValidConstraints=()=>!0)}}},4430(t,e,s){s.d(e,{X:()=>n}),s(42672);const r=["required","pattern"],i=Symbol("validationTarget"),n=t=>class extends t{#O=i;static get observedAttributes(){return[...t.observedAttributes||[],...r]}static get formAssociated(){return!0}#$;get internals(){return this.#$}set internals(t){this.#$=t}constructor(){super(),this.#$=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}get defaultErrorMsgTypeMismatch(){return"Please match the requested type."}getCustomErrorMessage(t,e){return this.hasAttribute(t)?this.getAttribute(t)||" ":e}getErrorMessage(t){const{valueMissing:e,patternMismatch:s,typeMismatch:r,stepMismatch:i,tooShort:n,tooLong:a,rangeOverflow:o,rangeUnderflow:l,badInput:h,customError:c}=t;switch(!0){case e:return this.getCustomErrorMessage("data-errormessage-value-missing",this.defaultErrorMsgValueMissing);case s||i||h:return this.getCustomErrorMessage("data-errormessage-pattern-mismatch",this.defaultErrorMsgPatternMismatch);case r:return this.getCustomErrorMessage("data-errormessage-type-mismatch",this.defaultErrorMsgTypeMismatch);case n:return this.getCustomErrorMessage("data-errormessage-pattern-mismatch-too-short",this.defaultErrorMsgTooShort);case a:return this.getCustomErrorMessage("data-errormessage-pattern-mismatch-too-long",this.defaultErrorMsgTooLong);case l:return this.getCustomErrorMessage("data-errormessage-pattern-range-underflow",this.defaultErrorMsgRangeUnderflow);case o:return this.getCustomErrorMessage("data-errormessage-pattern-range-overflow",this.defaultErrorMsgRangeOverflow);case c:return this.validationMessage;default:return""}}#k(){const t=this.isReadOnly?{}:this.getValidity();this.#$.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#$.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#$.validity.valid}reportValidity(){return this.#$.reportValidity()}get validity(){return this.#$.validity}get validationTarget(){return this.#O===i?this.inputElement:this.#O}set validationTarget(t){this.#O=t}setCustomValidity(t){t?this.#$.setValidity({customError:!0},t,this.validationTarget):(this.#$.setValidity({}),this.#k())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#$.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),r.includes(t)&&this.#k()}init(){super.init?.(),this.addEventListener("change",this.#k),this.addEventListener("invalid",t=>t.stopPropagation()),this.addEventListener("input",this.#k),setTimeout(()=>this.#k())}}},36745(t,e,s){s.d(e,{y:()=>n});var r=s(25964);const i=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options","loading","allow-custom-value","collapsed","hide-country","hide-subdivision","hide-city"],n=t=>class extends t{init(){super.init?.(),(0,r.mx)(this,t=>t.forEach(t=>{const e=this.getAttribute(t);(t=>i.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.debug(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}),{})}}},87503(t,e,s){s.d(e,{m:()=>l});var r=s(63200),i=s(25964),n=s(22515),a=s(83538);const o=t=>async e=>{const s=await t(e);return new Promise(t=>{let e=0;const r=()=>{if(e>20)return console.error("could not get shadow root for element",s),void t(s);e++,s?.shadowRoot?t(s.shadowRoot):setTimeout(r)};r()})},l=({name:t,selector:e,mappings:s={},forward:{attributes:l=[],include:h=!0}={}})=>c=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=(0,n.R)({mappings:s})(c);return class extends d{static get cssVarList(){return{...d.cssVarList,[u]:(0,a.SR)(u?(0,r.GL)(c.componentName,"_"+u):c.componentName,s)}}#I;constructor(){const t=o(async t=>{const s=(t.shadowRoot||t).querySelector(t.baseSelector);return e&&t.shadowRoot?(await o(()=>s)(t)).querySelector(e):s});super({getRootElement:t,componentNameSuffix:u&&"_"+u,themeSection:u?"_"+u:void 0,baseSelector:""}),this.#_=()=>t(this).then(t=>t?.host||t)}#_;async#P(){const t=await this.#I;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.(),this.#I=this.#_();const t=await this.#I;(0,i.EA)(this,t,{[h?"includeAttrs":"excludeAttrs"]:l}),this.#P()}}}},71209(t,e,s){s.d(e,{O:()=>u});var r=s(63200),i=s(25964),n=s(50336),a=s(4430),o=s(22515);const l=["invalid","required"],h=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e?.localName)return e},c=({proxyProps:t=[],useProxyTargets:e=!1,inputEvent:s="input",triggerValidationEvents:r=[],proxyParentValidation:o=!1})=>c=>class extends((0,a.X)(c)){static get observedAttributes(){return[...c.observedAttributes||[],...l]}#q;#r=n.r.bind(this,"change");constructor(){super(),this.#q=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout(()=>{!this.#q&&console.warn(this.localName,"no input was found")},0)}get inputElement(){if(this.#q)return this.#q;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#q=h(t)||h(e),this.#q}set inputElement(t){this.#q=t}getValidity(){return this.inputElement?.validity||{}}#D(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#D(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},this.baseElement.addEventListener("input",t=>{t.composed||this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}),r.forEach(t=>{this.baseElement?.addEventListener(t,()=>{this.inputElement?.setCustomValidity("")})}),setTimeout(()=>{(Array.isArray(s)?s:[s]).forEach(t=>{this.baseElement?.addEventListener(t,()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#D()})}),this.baseElement.addEventListener("change",()=>{this.#r()}),this.addEventListener("invalid",()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#D()}),t.forEach(t=>{const s=this.querySelector('input[slot="external-input"]')||null,r=e?[this.baseElement,s].filter(Boolean):[];((t,e,s)=>{const r=Array.isArray(e)?e:[e];Object.defineProperty(t,s,{set(t){r.forEach(e=>{e[s]=t})},get:()=>e[0][s],configurable:!0})})(this,[this.inputElement,...r],t)}),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,i.EA)(this,this.inputElement,{includeAttrs:["inputmode"]})}),o){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,s)=>"function"==typeof t[s]&&"setValidity"===s?(...r)=>{if(3===r.length){const t=r.slice(0,r.length-1);t.push(e.inputElement),e.internals[s](...t)}else e.internals[s](...r);return t[s](...r)}:"function"==typeof t[s]?(...r)=>(e.internals[s](...r),t[s](...r)):t[s]})}}},u=t=>(0,r.Zz)(c(t),(0,o.R)({componentNameOverride:(0,i.xE)("input-wrapper")}))},93280(t,e,s){s.d(e,{D:()=>r});const r=({triggers:t=[]}={})=>e=>class extends e{static get observedAttributes(){return[...e.observedAttributes||[],...t.map(({attr:t})=>t)]}get#z(){return t.some(({attr:t,value:e})=>this.getAttribute(t)===e)}#F=()=>{this.toggleAttribute("stretch",this.#z)};attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),e!==s&&this.#F()}init(){super.init?.(),this.#F()}}}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[8961],{34797(t,e,s){s.d(e,{q:()=>l});var r=s(63200),i=s(61246),n=s(27754),a=s(11501),o=s(36745);const l=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}get name(){return this.getAttribute("name")}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,r.Zz)(i.t,a.m,o.y,n.b)(s)}},84548(t,e,s){s.d(e,{O:()=>r,h:()=>i});const r={CONNECTOR_INVALID:"CONNECTOR_INVALID",FETCH_RESULTS_ERROR:"FETCH_RESULTS_ERROR"},i=()=>class{constructor(t){this.getAttribute=t,this.isValid=this.#s()}checkConnectorValidity(){this.isValid=this.#s()}#s(){return!this.getRequiredParams().filter(t=>{const e=this.getAttribute(t);return!e||!this.validateParam(t,e)}).length}validateParam(t,e){return e.trim().length>0}getRequiredParams(){return console.error("Connector must implement getRequiredParams"),[]}async fetch(t){return this.isValid?this._fetchResults(t):(console.error(`[${this.constructor.name}] Cannot fetch results: connector is not properly configured`),{results:[],error:r.CONNECTOR_INVALID})}_fetchResults(t){return console.error("Connector must implement fetchResults"),{results:[],error:void 0}}}},49449(t,e,s){s.d(e,{y:()=>h});var r=s(63200),i=s(1317),n=s(70962),a=s(4430),o=s(36745),l=s(34797);const h=(...t)=>(0,r.Zz)(a.X,i._,o.y,n.j)((0,l.q)(...t))},3563(t,e,s){s(63200),s(22515),s(11430),s(34797),s(25964)},72270(t,e,s){s.d(e,{OR:()=>n.O,h:()=>n.h,qu:()=>r.q,yc:()=>i.y});var r=s(34797),i=(s(3563),s(49449)),n=s(84548)},50336(t,e,s){function r(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{r:()=>r})},88961(t,e,s){s.d(e,{DM:()=>r.DM,Jm:()=>r.Jm,OZ:()=>r.OZ,RF:()=>r.RF,VO:()=>r.VO,Yg:()=>r.Yg,_$:()=>r._$,mA:()=>r.mA,t$:()=>r.t$,tQ:()=>r.tQ,tz:()=>r.tz,y:()=>r.y});var r=s(78968)},71887(t,e,s){s.d(e,{y:()=>r});const r=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mousedown",t=>{t.preventDefault(),this.setAttribute("active","true"),window.addEventListener("mouseup",()=>this.removeAttribute("active"),{once:!0})})}}},1317(t,e,s){s.d(e,{_:()=>i});var r=s(50336);const i=t=>class extends t{#r=r.r.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",t=>{t.stopPropagation()}),this.addEventListener("blur",()=>{this.value!==this.prevValue&&(this.#r(),this.prevValue=this.value)})}}},61246(t,e,s){s.d(e,{t:()=>r});const r=t=>class extends t{#i(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#i()}}},27754(t,e,s){s.d(e,{b:()=>r});const r=t=>class extends t{updateComponentsContext(t){this.dispatchEvent(new CustomEvent("components-context",{bubbles:!0,composed:!0,detail:t}))}}},83370(t,e,s){s.d(e,{J:()=>r});const r=({connectorClasses:t})=>e=>class extends e{#n=t;static get observedAttributes(){return[...e.observedAttributes||[],"connector-template"]}get connectorClasses(){return this.#n}set connectorClasses(t){this.#n=t}get connectorTemplate(){return this.getAttribute("connector-template")}initializeConnector(){const t=this.connectorTemplate;if(!this.connectorClasses[t])return;const e=this.connectorClasses[t];this.connector=new e(this.getAttribute.bind(this))}async fetchConnectorResults(t){if(!this.connector)return console.error(`No connector initialized for the field with template: ${this.connectorTemplate}`),{results:[]};const{results:e,error:s}=await this.connector.fetch(t);return s?{results:[],error:s}:{results:e.map(({label:t,value:e})=>({label:t,value:e}))}}init(){super.init?.(),this.initializeConnector()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),e!==s&&"connector-template"===t&&this.initializeConnector()}}},84292(t,e,s){s.d(e,{t:()=>a});var r=s(25964);const i=()=>!0,n=t=>`<pre>${JSON.stringify(t,null,4)}</pre>`,a=({itemRenderer:t=n,validateSchema:e=i,slotName:s,rerenderAttrsList:a=[],targetSelector:o,sortFn:l=t=>t})=>i=>class extends i{#a=[];#o;#l(t){if(!e)return!0;const s=e(t);return!0===s||(console.error("Data schema validation failed",s||""),!1)}#h(){const t=s?`*[slot="${s}"]`:":not([slot])";this.#o&&this.#o.querySelectorAll(t).forEach(t=>t.remove())}#c(){this.#h(),(l?this.data.sort(l):this.data).forEach((e,s)=>{const r="string"==typeof(i=t(e,s,this))?(t=>{const e=document.createElement("template");return e.innerHTML=t,e})(i).content:i instanceof HTMLTemplateElement?i.content:(console.error("Invalid template",i),null);var i;this.#o&&this.#o.appendChild(r?.cloneNode(!0))})}set data(t){this.#l(t)&&(this.#a=t,this.#c())}get data(){return this.#a}init(){super.init?.(),this.#o=o?this.shadowRoot.querySelector(o):this.baseElement,(0,r.mx)(this,t=>{t.includes("data")?this.#u():this.#c()},{includeAttrs:[...a,"data"]})}#u(){const t=this.getAttribute("data");if(t)try{this.data=JSON.parse(t)}catch(e){console.warn("Invalid JSON data",t)}}}},1160(t,e,s){s.d(e,{t:()=>o});var r=s(72270),i=s(63200),n=s(25964),a=s(50336);const o=({componentName:t,wrappedEleName:e,slots:s=[],style:o,excludeAttrsSync:l=[],includeAttrsSync:h=[],includeForwardProps:c=[],delegatesFocus:u=!0})=>{class d extends((0,r.qu)({componentName:t,baseSelector:e})){#d=a.r.bind(this,"blur");#m=a.r.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:u}).innerHTML=`\n\t\t\t<${e}>\n\t\t\t${s.map(t=>`<slot ${t?`name="${t}" slot="${t}"`:""}></slot>`).join("")}\n\t\t\t</${e}>\n\t\t`,(0,n.fz)(((0,i.Tn)(o)?o():o)||"",this)}init(){super.init?.(),this.baseElement.addEventListener("blur",t=>{this.#d()}),this.baseElement.addEventListener("focus",t=>{this.#m()}),(0,n.q)(this.baseElement,this,c),(0,n.Gh)(this.baseElement,this,{excludeAttrs:l,includeAttrs:h})}}return d}},83538(t,e,s){s.d(e,{AM:()=>d,SR:()=>u,_r:()=>h});var r=s(63200),i=s(25964);const n=t=>`${t}__override`,a=(t,e,s=!1)=>{const r=`var(${t}${e?`, ${e}`:""})`;return s?`var(${n(t)}, ${r})`:r};class o{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce((t,[e,s])=>`${t}${e} { \n${s.map(({property:t,value:e})=>`${t}: ${e}`).join(";\n")} \n}\n\n`,"")}}const l=(t,e="fallback")=>(0,r.GL)(t,e),h=(t,e,s)=>{const n=new o,h=(t,e)=>{if(!t)return"";if("string"==typeof t)return t;const s=l(e,t?.suffix);return a(s,h(t.fallback,s))};return Object.keys(s).forEach(o=>{const l=((t,e)=>{const s={selector:"",property:(0,r.kW)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map(t=>({...s,...t})):[{...s,...e}]:[s]})(o,s[o]),c=(0,i.Ix)(t,o);l.forEach(({selector:t,property:s,important:i,fallback:o})=>{const l=h(o,c);n.add(((t="",e="")=>(0,r.Tn)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,r.Tn)(s)?s():s,a(c,l,!0)+(i?"!important":""))})}),n.toString()},c=(t,e,{fallback:s})=>{if(!s)return{};const i=l(e,s.suffix),n=(0,r.dk)(t,s.suffix||"fallback");return{[n]:i,...c(n,i,s)}},u=(t,e)=>Object.keys(e).reduce((s,r)=>{const a=(0,i.Ix)(t,r);return Object.assign(s,{[r]:a},{[r+"Override"]:n(a)},c(r,a,e[r]))},{}),d=(t,e)=>`.${t}`.repeat(e)},22515(t,e,s){s.d(e,{R:()=>l});var r=s(69591),i=s(63200),n=s(25964),a=s(79673),o=s(83538);const l=({mappings:t={},componentNameOverride:e="",style:s=""})=>l=>{const h=e||l.componentName;return class e extends l{static get cssVarList(){return{...l.cssVarList,...(0,o.SR)(h,{...t})}}#p;#g;#b;#E;#v;#f;#y;#A;#C;constructor({getRootElement:t,componentNameSuffix:s="",themeSection:n=r.IM,baseSelector:a}={}){super(),this.#E=s,this.#v=n,this.#y=a??this.baseSelector,this.#C=t,this.#A=Object.keys(e.cssVarList).map(t=>(0,i.GL)("st",s,t))}get#S(){return a.br.currentTheme?.[h]||""}#M(){this.#g.replaceSync(this.#S[this.#v]),this.currentThemeName=a.br.currentThemeName,this.onThemeChange?.(a.br.currentThemeName)}#T(){this.#g=(0,n.fz)("",this.#f,{prepend:!0}),this.#b=a.br.onCurrentThemeChange(this.#M.bind(this)),this.#M()}#w(){if(this.#A.length){let t=(0,o.AM)(h,r.aE);const e=this.getAttribute("id");e&&(t+=`#${CSS.escape(e)}`),this.#p=(0,n.fz)(`:host(${t}) {}`,this.#f)}}#R(t,e){const s=this.#p.cssRules[0].style;if(!s)return;const r=(0,n.Ix)(h,t.replace(new RegExp("^st-"),""));e?s?.setProperty(r,e):(s?.removeProperty(r),this.removeAttribute(t))}#V(t=[]){t.forEach(t=>{this.#A.includes(t)&&this.#R(t,this.getAttribute(t))})}#x(){if(Object.keys(t).length){const e=(0,o._r)((0,i.GL)(h,this.#E),this.#y,t);(0,n.fz)(e,this.#f,{prepend:!0})}}#L(){const t=(0,i.Tn)(s)?s():s;t&&(0,n.fz)(t,this.#f,{prepend:!0})}#N(t){(this.#f?.classList||this.#f?.host?.classList||this.classList).add(t)}async init(){super.init?.(),!this.shadowRoot?.isConnected&&this.shadowRoot||(this.#f=await(this.#C?.(this))||this.shadowRoot,this.#N(h),this.#x(),this.#L(),this.#T(),this.#w(),(0,n.mx)(this,this.#V.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#b?.()}}}},11430(t,e,s){s.d(e,{V:()=>i});var r=s(25964);const i=t=>class extends t{constructor(){super(),(0,r.fz)(':host([draggable="true"]) * { cursor: inherit!important }',this)}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}}),super.init?.()}}},19852(t,e,s){s(25964)},11501(t,e,s){s.d(e,{m:()=>r});const r=t=>class extends t{init(){super.init?.(),(this.baseElement||this).addEventListener("mouseover",t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",()=>this.removeAttribute("hover"),{once:!0})})}}},78968(t,e,s){s.d(e,{DM:()=>p.D,Jm:()=>c.J,OZ:()=>a.O,RF:()=>r.R,VO:()=>i.V,Yg:()=>m.Y,_$:()=>h._,mA:()=>l.m,t$:()=>u.t,tQ:()=>o.t,tz:()=>n.t,y:()=>d.y});var r=s(22515),i=s(11430),n=s(1160),a=s(71209),o=s(61246),l=(s(4430),s(87503)),h=s(1317),c=(s(36745),s(19852),s(83370)),u=s(84292),d=s(71887),m=s(76477),p=s(93280)},70962(t,e,s){s.d(e,{j:()=>i});var r=s(50336);const i=t=>class extends t{init(){this.#O(),super.init?.()}#O(){["blur","focus","focusin","focusout"].forEach(t=>{this.addEventListener(t,t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()})})}handleFocusEventsDispatching(t){let e;t?.forEach(t=>{t?.addEventListener("focusout",t=>{t.stopImmediatePropagation(),e=setTimeout(()=>{e=null,r.r.call(this,"blur"),r.r.call(this,"focusout",{bubbles:!0})})});const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(r.r.call(this,"focus"),r.r.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)})}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",e=>{this!==e.target&&(e.stopImmediatePropagation(),t!==this.value&&(t=this.value,r.r.call(this,"input",{bubbles:!0,composed:!0})))})}}},76477(t,e,s){s.d(e,{Y:()=>r});const r=t=>class extends t{init(){super.init?.(),this.baseElement._hasValidConstraints&&(this.baseElement._hasValidConstraints=()=>!0)}}},4430(t,e,s){s.d(e,{X:()=>n}),s(42672);const r=["required","pattern"],i=Symbol("validationTarget"),n=t=>class extends t{#$=i;static get observedAttributes(){return[...t.observedAttributes||[],...r]}static get formAssociated(){return!0}#k;get internals(){return this.#k}set internals(t){this.#k=t}constructor(){super(),this.#k=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}get defaultErrorMsgRangeUnderflow(){return`At least ${this.getAttribute("min-items-selection")} items are required.`}get defaultErrorMsgRangeOverflow(){return`At most ${this.getAttribute("max-items-selection")} items are allowed.`}get defaultErrorMsgTypeMismatch(){return"Please match the requested type."}getCustomErrorMessage(t,e){return this.hasAttribute(t)?this.getAttribute(t)||" ":e}getErrorMessage(t){const{valueMissing:e,patternMismatch:s,typeMismatch:r,stepMismatch:i,tooShort:n,tooLong:a,rangeOverflow:o,rangeUnderflow:l,badInput:h,customError:c}=t;switch(!0){case e:return this.getCustomErrorMessage("data-errormessage-value-missing",this.defaultErrorMsgValueMissing);case s||i||h:return this.getCustomErrorMessage("data-errormessage-pattern-mismatch",this.defaultErrorMsgPatternMismatch);case r:return this.getCustomErrorMessage("data-errormessage-type-mismatch",this.defaultErrorMsgTypeMismatch);case n:return this.getCustomErrorMessage("data-errormessage-pattern-mismatch-too-short",this.defaultErrorMsgTooShort);case a:return this.getCustomErrorMessage("data-errormessage-pattern-mismatch-too-long",this.defaultErrorMsgTooLong);case l:return this.getCustomErrorMessage("data-errormessage-pattern-range-underflow",this.defaultErrorMsgRangeUnderflow);case o:return this.getCustomErrorMessage("data-errormessage-pattern-range-overflow",this.defaultErrorMsgRangeOverflow);case c:return this.validationMessage;default:return""}}#I(){const t=this.isReadOnly?{}:this.getValidity();this.#k.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#k.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#k.validity.valid}reportValidity(){return this.#k.reportValidity()}get validity(){return this.#k.validity}get validationTarget(){return this.#$===i?this.inputElement:this.#$}set validationTarget(t){this.#$=t}setCustomValidity(t){t?this.#k.setValidity({customError:!0},t,this.validationTarget):(this.#k.setValidity({}),this.#I())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get isDisabled(){return this.hasAttribute("disabled")&&"false"!==this.getAttribute("disabled")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#k.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),r.includes(t)&&this.#I()}init(){super.init?.(),this.addEventListener("change",this.#I),this.addEventListener("invalid",t=>t.stopPropagation()),this.addEventListener("input",this.#I),setTimeout(()=>this.#I())}}},36745(t,e,s){s.d(e,{y:()=>n});var r=s(25964);const i=["readonly","focused","invalid","has-label","required","disabled","checked","has-helper","has-value","step-buttons-visible","hover","has-error-message","focus-ring","opened","active","password-visible","opening","closing","has-no-options","loading","allow-custom-value","collapsed","hide-country","hide-subdivision","hide-city"],n=t=>class extends t{init(){super.init?.(),(0,r.mx)(this,t=>t.forEach(t=>{const e=this.getAttribute(t);(t=>i.includes(t))(t)?""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t):e||console.debug(`attribute "${t}" has no value, should it be added to the boolean attributes list?`)}),{})}}},87503(t,e,s){s.d(e,{m:()=>o});var r=s(63200),i=s(25964),n=s(22515),a=s(83538);const o=({name:t,selector:e,mappings:s={},style:o="",forward:l={}})=>h=>{if((0,r.Tn)(e)&&!t)throw new Error("portalMixin: a function selector requires a name");const c=t||(t=>t.replace(/[^\w\s]/gi,""))(e),u=(0,n.R)({mappings:s,style:o})(h);return class extends u{static get cssVarList(){return{...u.cssVarList,[c]:(0,a.SR)(c?(0,r.GL)(h.componentName,"_"+c):h.componentName,s)}}#_;constructor(){const t=(0,i.VZ)(async t=>{const s=(t.shadowRoot||t).querySelector(t.baseSelector);if(!e||!t.shadowRoot)return s;const n=await(0,i.VZ)(()=>s)(t);return(0,r.Tn)(e)?e(n):n.querySelector(e)});super({getRootElement:t,componentNameSuffix:c&&"_"+c,themeSection:c?"_"+c:void 0,baseSelector:""}),this.#q=()=>t(this).then(t=>t?.host||t)}#q;async#P(){const t=await this.#_;t.onmouseenter=t=>{t.target.setAttribute("hover","true")},t.onmouseleave=t=>{t.target.removeAttribute("hover")}}async init(){super.init?.(),this.#_=this.#q();const t=await this.#_;if(!1!==l){const{attributes:e=[],include:s=!0}=l;(0,i.EA)(this,t,{[s?"includeAttrs":"excludeAttrs"]:e})}this.#P()}}}},71209(t,e,s){s.d(e,{O:()=>u});var r=s(63200),i=s(25964),n=s(50336),a=s(4430),o=s(22515);const l=["invalid","required"],h=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if([e]=e.assignedElements(),"slot"!==e?.localName)return e},c=({proxyProps:t=[],useProxyTargets:e=!1,inputEvent:s="input",triggerValidationEvents:r=[],proxyParentValidation:o=!1})=>c=>class extends((0,a.X)(c)){static get observedAttributes(){return[...c.observedAttributes||[],...l]}#z;#r=n.r.bind(this,"change");constructor(){super(),this.#z=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout(()=>{!this.#z&&console.warn(this.localName,"no input was found")},0)}get inputElement(){if(this.#z)return this.#z;this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#z=h(t)||h(e),this.#z}set inputElement(t){this.#z=t}getValidity(){return this.inputElement?.validity||{}}#D(){this.setAttribute("error-message",this.validationMessage)}reportValidity=()=>{this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.checkValidity()||(this.setAttribute("invalid","true"),this.#D(),this.focus())};defaultReportValidity(){return super.reportValidity()}init(){if(super.init?.(),this.baseElement._setInvalid=function(t){!t&&this._shouldSetInvalid(t)&&(this.invalid=t)},this.baseElement.addEventListener("input",t=>{t.composed||this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}),r.forEach(t=>{this.baseElement?.addEventListener(t,()=>{this.inputElement?.setCustomValidity("")})}),setTimeout(()=>{(Array.isArray(s)?s:[s]).forEach(t=>{this.baseElement?.addEventListener(t,()=>{this.baseElement.checkValidity()?this.removeAttribute("invalid"):this.#D()})}),this.baseElement.addEventListener("change",()=>{this.#r()}),this.addEventListener("invalid",()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#D()}),t.forEach(t=>{const s=this.querySelector('input[slot="external-input"]')||null,r=e?[this.baseElement,s].filter(Boolean):[];((t,e,s)=>{const r=Array.isArray(e)?e:[e];Object.defineProperty(t,s,{set(t){r.forEach(e=>{e[s]=t})},get:()=>e[0][s],configurable:!0})})(this,[this.inputElement,...r],t)}),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement),(0,i.EA)(this,this.inputElement,{includeAttrs:["inputmode"]})}),o){const t=this.inputElement.internals,e=this;this.inputElement.internals=new Proxy(t,{get:(t,s)=>"function"==typeof t[s]&&"setValidity"===s?(...r)=>{if(3===r.length){const t=r.slice(0,r.length-1);t.push(e.inputElement),e.internals[s](...t)}else e.internals[s](...r);return t[s](...r)}:"function"==typeof t[s]?(...r)=>(e.internals[s](...r),t[s](...r)):t[s]})}}},u=t=>(0,r.Zz)(c(t),(0,o.R)({componentNameOverride:(0,i.xE)("input-wrapper")}))},93280(t,e,s){s.d(e,{D:()=>r});const r=({triggers:t=[]}={})=>e=>class extends e{static get observedAttributes(){return[...e.observedAttributes||[],...t.map(({attr:t})=>t)]}get#F(){return t.some(({attr:t,value:e})=>this.getAttribute(t)===e)}#j=()=>{this.toggleAttribute("stretch",this.#F)};attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),e!==s&&this.#j()}init(){super.init?.(),this.#j()}}}}]);
2
2
  //# sourceMappingURL=8961.js.map