@descope/web-components-ui 1.0.300 → 1.0.301

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/dist/cjs/index.cjs.js +287 -204
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.esm.js +221 -138
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/1612.js +1 -1
  7. package/dist/umd/1621.js +2 -2
  8. package/dist/umd/3951.js +1 -1
  9. package/dist/umd/4024.js +1 -1
  10. package/dist/umd/4052.js +1 -1
  11. package/dist/umd/4746.js +1 -1
  12. package/dist/umd/5806.js +1 -1
  13. package/dist/umd/6770.js +1 -1
  14. package/dist/umd/7056.js +1 -1
  15. package/dist/umd/7531.js +1 -1
  16. package/dist/umd/7911.js +1 -1
  17. package/dist/umd/9092.js +2 -2
  18. package/dist/umd/9314.js +1 -1
  19. package/dist/umd/9423.js +2 -2
  20. package/dist/umd/9562.js +1 -1
  21. package/dist/umd/9927.js +1 -0
  22. package/dist/umd/DescopeDev.js +1 -1
  23. package/dist/umd/descope-button-index-js.js +1 -1
  24. package/dist/umd/descope-divider-index-js.js +1 -1
  25. package/dist/umd/descope-email-field-index-js.js +1 -1
  26. package/dist/umd/descope-enriched-text-index-js.js +1 -0
  27. package/dist/umd/descope-link-index-js.js +1 -1
  28. package/dist/umd/descope-text-index-js.js +1 -0
  29. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  30. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  31. package/dist/umd/index.js +1 -1
  32. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  33. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  34. package/package.json +3 -3
  35. package/src/components/descope-divider/DividerClass.js +1 -1
  36. package/src/components/descope-divider/index.js +1 -1
  37. package/src/components/descope-enriched-text/EnrichedTextClass.js +163 -0
  38. package/src/components/descope-enriched-text/consts.js +74 -0
  39. package/src/components/descope-link/LinkClass.js +1 -1
  40. package/src/components/descope-link/index.js +1 -1
  41. package/src/components/descope-text/TextClass.js +64 -0
  42. package/src/components/descope-user-attribute/UserAttributeClass.js +1 -1
  43. package/src/components/descope-user-attribute/index.js +1 -1
  44. package/src/components/descope-user-auth-method/UserAuthMethodClass.js +1 -1
  45. package/src/components/descope-user-auth-method/index.js +1 -1
  46. package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +1 -1
  47. package/src/components/mapping-fields/descope-mappings-field/index.js +1 -1
  48. package/src/index.cjs.js +2 -2
  49. package/src/index.d.ts +2 -2
  50. package/src/index.js +2 -2
  51. package/src/theme/components/enrichedText.js +4 -1
  52. package/src/theme/components/text.js +1 -1
  53. package/dist/umd/4569.js +0 -1
  54. package/dist/umd/text-components-descope-enriched-text-index-js.js +0 -1
  55. package/dist/umd/text-components-descope-text-index-js.js +0 -1
  56. package/src/components/text-components/createBaseTextClass.js +0 -26
  57. package/src/components/text-components/descope-enriched-text/EnrichedTextClass.js +0 -106
  58. package/src/components/text-components/descope-enriched-text/helpers.js +0 -41
  59. package/src/components/text-components/descope-text/TextClass.js +0 -34
  60. package/src/components/text-components/hideWhenEmptyMixin.js +0 -17
  61. /package/src/components/{text-components/descope-enriched-text → descope-enriched-text}/index.js +0 -0
  62. /package/src/components/{text-components/descope-text → descope-text}/index.js +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9476,3172,5130,9299,9656,7433],{3878:(t,e,i)=>{i.d(e,{P:()=>o});var n=i(2061),r=i(4978),a=i(3346);const o=(...t)=>(0,n.qC)(r.wX,r.li,r.QT,r.mE)((0,a.s)(...t))},5964:(t,e,i)=>{i.d(e,{f:()=>s,n:()=>u});var n=i(2061),r=i(4567),a=i(4978),o=i(3804);const s=(0,r.iY)("button"),{host:l,label:p}={host:{selector:()=>":host"},label:{selector:"::part(label)"}};let d;const u=(0,n.qC)((0,a.yk)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...l,property:"direction"},fontSize:{},fontFamily:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],labelTextColor:{property:"color"},labelTextDecoration:{...p,property:"text-decoration"},labelSpacing:{...p,property:"gap"},textAlign:{...p,property:"justify-content",fallback:"center"}}}),o.v,a.e4,a.Ae)((0,a.DM)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${d}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${u.cssVarList.outlineWidth}) + var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${u.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${u.cssVarList.hostHeight}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${u.cssVarList.hostWidth}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s})),{color:c,fontSize:h}=u.cssVarList;d=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${c});\n\t\ttop: calc(50% - (var(${h}) / 2));\n\t\tleft: calc(50% - (var(${h}) / 2));\n\t\tborder-width: calc(var(${h}) / 10);\n\t\twidth: var(${h});\n\t\theight: var(${h});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"])::part(prefix),\n\t:host([loading="true"])::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},3804:(t,e,i)=>{i.d(e,{v:()=>n});const n=t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}},2018:(t,e,i)=>{i.r(e),i.d(e,{ButtonClass:()=>n.n}),i(1721);var n=i(5964);customElements.define(n.f,n.n)},4049:(t,e,i)=>{i.d(e,{H:()=>y,f:()=>s});var n=i(2061),r=i(4567),a=i(4201),o=i(4978);const s=(0,r.iY)("combo-box"),{host:l,inputField:p,inputElement:d,placeholder:u,toggle:c,clearButton:h,label:b,requiredIndicator:m,helperText:g,errorMessage:v}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},y=(0,n.qC)((0,o.yk)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[b,u,p,g,v],labelTextColor:[{...b,property:"color"},{...m,property:"color"}],errorMessageTextColor:{...v,property:"color"},inputHeight:{...p,property:"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:{...m,property:"content"},inputValueTextColor:{...p,property:"color"},inputPlaceholderTextColor:{...u,property:"color"},inputDropdownButtonCursor:[{...c,property:"cursor"},{...h,property:"cursor"}],inputDropdownButtonColor:[{...c,property:"color"},{...h,property:"color"}],inputDropdownButtonSize:[{...c,property:"font-size"},{...h,property:"font-size"}],inputDropdownButtonOffset:[{...c,property:"margin-right"},{...c,property:"margin-left"}],inputOutlineColor:{...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"}],overlayBackground:{property:()=>y.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>y.cssVarList.overlay.textColor},overlayBorder:{property:()=>y.cssVarList.overlay.border},overlayFontSize:{property:()=>y.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>y.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>y.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>y.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>y.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>y.cssVarList.overlay.itemPaddingInlineEnd}}}),o.e4,(0,o.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,o.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),o.Ae,(t=>class extends t{#t=({displayName:t,value:e,label:i})=>`<span data-name="${i}" data-id="${e}">${t||i}</span>`;#e;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#t}set renderItem(t){this.#t=t,this.renderItems()}get data(){if(this.#e)return this.#e;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#e=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}handleSelectedItem(){const t=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,t&&(this.value=t),this.value||this.setDefaultValue()}customValueTransformFn(t){return t}setComboBoxDescriptor(){const t=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),e=this;Object.defineProperties(this.inputElement,{value:{...t,set(i){if(!e.baseElement.items?.length)return;const n=e.customValueTransformFn(i)||"";n!==this.value&&t.set.call(this,n)}}})}#i(){const t=this.shadowRoot.querySelector(this.baseSelector),e=Array.from(this.children);e.length&&(e.forEach((t=>{Object.defineProperty(t,"data-name",{value:t.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id"),configurable:!0,writable:!0})})),t.items=e,setTimeout((()=>{this.handleSelectedItem()}),0)),t.renderer=(t,e,i)=>{t.innerHTML=i.item.outerHTML}}#n(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=()=>{t.bringToFront()},t._detachOverlay=()=>{},t._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#n(),this.renderItems(),(0,r.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,r.P$)(this,this.#i.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}setDefaultValue(){this.value=this.defaultValue}set value(t){if(t){const e=this.baseElement.items?.find((e=>e["data-id"]===t));e&&(this.baseElement.selectedItem=e)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((0,o.DM)({slots:["","prefix"],wrappedEleName:"vaadin-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,a.bi)(y.cssVarList)}\n\t\t${(0,a.PH)("vaadin-combo-box")}\n\t\t${(0,a.jI)("vaadin-combo-box")}\n\t\t${(0,a.Pd)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,a.Wf)("vaadin-combo-box")}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))},1294:(t,e,i)=>{i.r(e),i.d(e,{ComboBoxClass:()=>n.H}),i(7583);var n=i(4049);customElements.define(n.f,n.H)},6417:(t,e,i)=>{i.d(e,{f:()=>l,z:()=>d});var n=i(4978),r=i(4447),a=i(2061),o=i(4567),s=i(4201);const l=(0,o.iY)("text-field"),p=["type"],d=(0,a.qC)((0,n.yk)({mappings:r.Z}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"]}),n.Ae,(t=>class extends t{static get observedAttributes(){return p.concat(t.observedAttributes||[])}attributeChangedCallback(t,e,i){super.attributeChangeCallback?.(t,e,i),"type"===t&&this.baseElement._setType(i)}}))((0,n.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${d.cssVarList.inputOutlineWidth}) + var(${d.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,s.Wf)("vaadin-text-field")}\n\t\t\t${(0,s.bi)(d.cssVarList)}\n\t\t\t${(0,s.wm)("vaadin-text-field",d.cssVarList)}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},9357:(t,e,i)=>{i.r(e),i.d(e,{TextFieldClass:()=>n.z}),i(9789);var n=i(6417);customElements.define(n.f,n.z)},4447:(t,e,i)=>{i.d(e,{Z:()=>h});const{host:n,label:r,placeholder:a,requiredIndicator:o,inputField:s,input:l,helperText:p,errorMessage:d,disabledPlaceholder:u,inputDisabled:c}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:{selector:"> input:placeholder-shown"},disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},h={fontSize:[{},n],fontFamily:[r,s,p,d],hostWidth:{...n,property:"width"},hostMinWidth:{...n,property:"min-width"},hostDirection:{...n,property:"direction"},inputBackgroundColor:{...s,property:"background-color"},labelTextColor:[{...r,property:"color"},{...o,property:"color"},{...r,property:"-webkit-text-fill-color"},{...o,property:"-webkit-text-fill-color"}],errorMessageTextColor:{...d,property:"color"},helperTextColor:{...p,property:"-webkit-text-fill-color"},inputValueTextColor:[{...s,property:"color"},{...c,property:"-webkit-text-fill-color"}],inputCaretTextColor:{...l,property:"color"},labelRequiredIndicator:{...o,property:"content"},inputBorderColor:{...s,property:"border-color"},inputBorderWidth:{...s,property:"border-width"},inputBorderStyle:{...s,property:"border-style"},inputBorderRadius:{...s,property:"border-radius"},inputHeight:{...s,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"}],inputOutlineColor:{...s,property:"outline-color"},inputOutlineStyle:{...s,property:"outline-style"},inputOutlineWidth:{...s,property:"outline-width"},inputOutlineOffset:{...s,property:"outline-offset"},inputTextAlign:{...l,property:"text-align"},inputPlaceholderColor:[{...a,property:"color"},{...u,property:"-webkit-text-fill-color"}]}},6751:(t,e,i)=>{i.r(e);var n=i(3878),r=i(4567);const a=(0,r.iY)("mapping-item"),o=["size","bordered","readonly","full-width","disabled"],s=(0,n.P)({componentName:a,baseSelector:"div"});customElements.define(a,class extends s{static get observedAttributes(){return[].concat(s.observedAttributes||[],o,["separator","options","invalid","disabled"])}get separator(){return this.getAttribute("separator")||"map to"}get value(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{[t]:e}:null}set value(t){if(1!==Object.entries(t).length)return void console.error("descope-mapping item expected expects only one key-value pair in the value but received: ",t);const[e,i]=Object.entries(t)[0];this.valueInput.value=i,this.attributeInput.value=e,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n .wrapper {\n display: flex;\n }\n .separator {\n text-align: center;\n flex-shrink: 0;\n }\n </style>\n <div class="wrapper" part="wrapper">\n <descope-text-field required="true"></descope-text-field>\n <div class="separator" part="separator">${this.separator}</div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n required="true"\n >\n </descope-combo-box>\n <descope-button variant="link" mode="primary">\n <vaadin-icon icon="vaadin:minus"></vaadin-icon>\n </descope-button>\n </div>\n\t`,this.valueInput=this.shadowRoot.querySelector("descope-text-field"),this.attributeInput=this.shadowRoot.querySelector("descope-combo-box"),this.inputs=[this.valueInput,this.attributeInput],this.removeButton=this.shadowRoot.querySelector("descope-button"),(0,r.oP)(this,this.valueInput,{includeAttrs:o}),(0,r.oP)(this,this.attributeInput,{includeAttrs:[...o,"options"],mapAttrs:{options:"data"}}),(0,r.oP)(this,this.removeButton,{includeAttrs:["disabled"]})}initRemoveButton(){this.removeButton.addEventListener("click",(()=>this.dispatchEvent(new CustomEvent("mapping-item-removed",{bubbles:!0,composed:!0}))))}init(){super.init?.(),this.initRemoveButton()}getValidity(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{}:{badInput:!0}}reportValidity(){this.inputs.forEach((t=>t.reportValidity()))}focus(){(this.checkValidity()||!this.valueInput.checkValidity()?this.valueInput:this.attributeInput).focus()}handleSeparatorChange(){this.shadowRoot.querySelector(".separator").textContent=this.separator}#r(t){"true"===t&&(this.valueInput.value||(this.valueInput.setAttribute("invalid","true"),this.valueInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)),this.attributeInput.value||(this.attributeInput.setAttribute("invalid","true"),this.attributeInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"separator"===t&&this.handleSeparatorChange(),"invalid"===t&&this.#r(i)}})},7819:(t,e,i)=>{i.d(e,{Z:()=>s,f:()=>a});var n=i(3878),r=i(4567);const a=(0,r.iY)("mappings-field-internal"),o=(0,n.P)({componentName:a,baseSelector:"div"}),s=class extends o{#a;static get observedAttributes(){return[].concat(o.observedAttributes||[],["label-value","label-attr","button-label","invalid","readonly","disabled"])}isValidDataType(t){try{return t.every((t=>"object"==typeof t&&!Array.isArray(t)&&1===Object.getOwnPropertyNames(t).length&&"string"==typeof t[Object.keys(t)[0]]&&""!==t[Object.keys(t)[0]].trim()))}catch(t){return!1}}get labelValue(){return this.getAttribute("label-value")||"Value"}get labelAttr(){return this.getAttribute("label-attr")||"Attribute"}get buttonLabel(){return this.getAttribute("button-label")||"Add mapping"}get options(){return this.getAttribute("options")||[]}addNewMappingItem(t){const e=document.createElement("descope-mapping-item");return e.setAttribute("bordered","true"),this.mappingsContainerEle.appendChild(e),(0,r.oP)(this,e,{includeAttrs:["size","full-width","separator","options","disabled"]}),setTimeout((()=>{this.setCustomValidity(""),e.addEventListener("mapping-item-removed",(()=>{e===this.#a&&(this.resetInvalidIndication(),this.#a=void 0),e.remove(),this.setCustomValidity("")})),this.dispatchEvent(new CustomEvent("mapping-item-added",{bubbles:!0,composed:!0})),t&&e.focus()}),0),e}get items(){return Array.from(this.mappingsContainerEle.querySelectorAll("descope-mapping-item"))}get value(){return this.items.reduce(((t,e)=>e.value?[...t,e.value]:t),[])}set value(t){if(!this.isValidDataType(t))return void console.error("received invalid value to set - should be an array of objects with one key-value pair");const e=this.items;if(e.length>t.length)for(let i=t.length;i<e.length;i++)this.mappingsContainerEle.removeChild(e[i]);t.forEach(((t,i)=>{const n=e[i];if(n)n.value=t;else{const e=this.addNewMappingItem(!1);setTimeout((()=>{e.value=t}),0)}}))}constructor(){super(),this.innerHTML='\n <div class="labels-container" part="labels"></div>\n <div class="mappings-container"></div>\n <div class="button-container"></div>\n ',this.labelsEle=this.querySelector(".labels-container"),this.mappingsContainerEle=this.querySelector(".mappings-container"),this.buttonContainer=this.querySelector(".button-container")}initLabels(){this.labelsEle.innerHTML=`\n <descope-text variant="body2" part="value-label">${this.labelValue}</descope-text>\n <descope-text variant="body2" part="attr-label">${this.labelAttr}</descope-text>\n `}initAddButton(){this.buttonContainer.innerHTML=`\n <descope-button variant="link" mode="primary" disabled="${this.isDisabled}">\n <vaadin-icon icon="vaadin:plus"></vaadin-icon>\n ${this.buttonLabel}\n </descope-button>\n `;const t=this.querySelector("descope-button");t.onclick=()=>{this.addNewMappingItem(!0)},(0,r.oP)(this,t,{includeAttrs:["disabled"]})}#o(){this.labelsEle.style.display=this.items.length?"grid":"none"}init(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.#a||this.items[0]||this.querySelector("descope-button")).focus()})),super.init?.(),this.initLabels(),this.initAddButton(),this.addEventListener("input",(()=>{this.mappingsContainerEle.contains(this.#a)&&this.#a?.checkValidity()&&(this.resetInvalidIndication(),this.#a.removeAttribute("invalid"),this.#a=void 0)})),(0,r.P$)(this.mappingsContainerEle,this.#o.bind(this))}resetInvalidIndication(){this.removeAttribute("invalid")}getValidity(){const t=this.items.find((t=>!t.checkValidity()));return t?t.validity:{}}#s(t){t&&(this.#a=this.items.find((t=>!t.checkValidity())),this.#a?.reportValidity(),this.#a?.setAttribute("invalid","true"))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"label-value"!==t&&"label-attr"!==t||this.initLabels(),"button-label"===t&&this.initAddButton(),"invalid"===t&&this.#s("true"===i),"readonly"===t&&this.toggleAttribute("inert","true"===i)}}},3820:(t,e,i)=>{i.r(e);var n=i(7819);customElements.define(n.f,n.Z)},9227:(t,e,i)=>{i.r(e),i.d(e,{MappingsFieldClass:()=>f}),i(9381),i(7911),i(6594);var n=i(4978),r=i(1611),a=i(2061),o=i(4567),s=i(7819);const l=(0,o.iY)("mappings-field"),{host:p,helperText:d,errorMessage:u,mappingItem:c,labels:h,labelsText:b,valueLabel:m,attrLabel:g,separator:v,labelsContainer:y}={host:{selector:()=>":host"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},mappingItem:{selector:"descope-mapping-item::part(wrapper)"},labels:{selector:'descope-mappings-field-internal [part="labels"] descope-text'},labelsText:{selector:'descope-mappings-field-internal [part="labels"] descope-text::part(text-wrapper)'},valueLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="value-label"]'},attrLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="attr-label"]'},separator:{selector:"descope-mapping-item::part(separator)"},labelsContainer:{selector:'descope-mappings-field-internal [part="labels"]'}},f=(0,a.qC)((0,n.yk)({mappings:{hostWidth:{...p,property:"width"},hostDirection:{...p,property:"direction"},fontSize:[{},p,{...v,property:"margin-top"}],fontFamily:[d,u,h],separatorFontSize:{...v,property:"font-size"},labelsFontSize:{...b,property:"font-size"},labelsLineHeight:[{...b,property:"line-height"},{...h,property:"line-height"}],labelTextColor:{...h,property:r.k.cssVarList.textColor},itemMarginBottom:{...c,property:"margin-bottom"},valueLabelMinWidth:{...m,property:"min-width"},attrLabelMinWidth:{...g,property:"min-width"},labelsMarginBottom:{...y,property:"margin-bottom"},separatorWidth:{},removeButtonWidth:{}}}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"],inputEvent:"input",proxyParentValidation:!0}),n.Ae,(t=>class extends t{get defaultValues(){const t=this.getAttribute("default-values");if(t)try{return JSON.parse(t)}catch(t){console.error('could not parse data string from attribute "default-values" -',t.message)}return[]}setDefaultValues(){const t=this.defaultValues;Object.keys(t).length>0&&(this.inputElement.value=t)}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${s.f}\n tabindex="-1"\n ></${s.f}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(s.f),(0,o.oP)(this,this.inputElement,{includeAttrs:["size","full-width","label-value","label-attr","button-label","separator","options","default-values","invalid","readonly","disabled"]}),(0,o.tg)(this,this.inputElement,{includeAttrs:["invalid"]}),this.setDefaultValues()}}))((0,n.DM)({slots:[],wrappedEleName:"vaadin-custom-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n direction: ltr;\n }\n vaadin-custom-field {\n line-height: unset;\n width: 100%;\n }\n\n descope-mappings-field-internal [part="labels"] {\n display: none;\n grid-template-columns: 1fr var(${f.cssVarList.separatorWidth}) 1fr var(${f.cssVarList.removeButtonWidth});\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"],\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n ${r.k.cssVarList.fontWeight}: 500;\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"] {\n grid-column: 1 / span 1;\n }\n\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n grid-column: 3 / span 1;\n }\n\n descope-mapping-item::part(wrapper) {\n display: grid;\n grid-template-columns: 1fr var(${f.cssVarList.separatorWidth}) 1fr var(${f.cssVarList.removeButtonWidth});\n }\n `,excludeAttrsSync:["tabindex","label-value","label-attr","button-label","options","error-message"],componentName:l}));i(4803),i(2018),i(9357),i(1294),i(3820),i(6751),customElements.define(l,f)},6867:(t,e,i)=>{i.d(e,{Z:()=>s,f:()=>a});var n=i(3878),r=i(4567);const a=(0,r.iY)("saml-group-mappings-internal"),o=(0,n.P)({componentName:a,baseSelector:""}),s=class extends o{static get observedAttributes(){return["invalid"].concat(o.observedAttributes||[])}constructor(){super(),this.innerHTML='\n <descope-text-field variant="body2" bordered="true"></descope-text-field>\n <descope-mappings-field></descope-mappings-field>\n ',this.groupInputElement=this.querySelector("descope-text-field"),this.mappingsElement=this.querySelector("descope-mappings-field")}resetInvalidIndication(){this.removeAttribute("invalid")}handleMappingsInvalidChange(t){t.includes("invalid")&&(this.mappingsElement.hasAttribute("invalid")||this.resetInvalidIndication())}initFocusHandler(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.mappingsElement.checkValidity()?this.groupInputElement:this.mappingsElement).focus()}))}init(){this.initFocusHandler(),super.init?.(),(0,r.oP)(this,this.groupInputElement,{mapAttrs:{"label-group":"label"},includeAttrs:["size","label-group","readonly","disabled"]}),(0,r.oP)(this,this.mappingsElement,{includeAttrs:["size","full-width","label-value","label-attr","button-label","separator","options","readonly","disabled","data-errormessage-pattern-mismatch"]}),(0,r.FX)(this.mappingsElement,this.handleMappingsInvalidChange.bind(this),{includeAttrs:["invalid"]})}get value(){return{group:this.groupInputElement.value,mappings:this.mappingsElement.value}}set value(t){t?.group&&"string"==typeof t.group&&(this.groupInputElement.value=t.group),Array.isArray(t?.mappings)&&(this.mappingsElement.value=t.mappings)}getValidity(){return this.groupInputElement.checkValidity()?this.mappingsElement.checkValidity()?{}:this.mappingsElement.validity:this.groupInputElement.validity}#l(t){if(t){if(!this.groupInputElement.checkValidity())return void this.groupInputElement.setAttribute("invalid","true");this.mappingsElement.checkValidity()||this.mappingsElement.setAttribute("invalid","true")}}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"invalid"===t&&this.#l("true"===i)}}},4115:(t,e,i)=>{i.r(e);var n=i(6867);customElements.define(n.f,n.Z)},3277:(t,e,i)=>{i.r(e),i.d(e,{SamlGroupMappingsClass:()=>d}),i(9381);var n=i(4978),r=i(2061),a=i(4567),o=i(6867);const s=(0,a.iY)("saml-group-mappings"),{host:l,groupInput:p}={host:{selector:()=>":host"},groupInput:{selector:"descope-text-field"}},d=(0,r.qC)((0,n.yk)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},groupNameInputMarginBottom:{...p,property:"margin-bottom"}}}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"],inputEvent:"input",triggerValidationEvents:["mapping-item-added","mapping-item-removed"],proxyParentValidation:!0}),n.Ae,(t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${o.f}\n tabindex="-1"\n ></${o.f}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),(0,a.oP)(this,this.inputElement,{includeAttrs:["size","full-width","label-group","label-value","label-attr","button-label","separator","options","readonly","disabled"]}),(0,a.tg)(this,this.inputElement,{includeAttrs:["invalid"]})}}))((0,n.DM)({slots:[],wrappedEleName:"vaadin-custom-field",style:()=>"\n :host {\n display: inline-flex;\n max-width: 100%;\n direction: ltr;\n }\n\n vaadin-custom-field {\n line-height: unset;\n width: 100%;\n }\n\n descope-text-field {\n width: auto;\n }\n\n descope-mappings-field {\n display: block;\n }\n ",excludeAttrsSync:["tabindex","label-group","label-value","label-attr","button-label","separator","options","error-message"],componentName:s}));i(9357),i(9227),i(4115),customElements.define(s,d)},2663:(t,e,i)=>{i.d(e,{T:()=>r});var n=i(3346);const r=t=>{class e extends((0,n.s)({componentName:t,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <style>\n :host {\n display: inline-block;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n </style>\n <slot part="text-wrapper"></slot>\n ',this.textSlot=this.shadowRoot.querySelector("slot")}}return e}},1611:(t,e,i)=>{i.d(e,{f:()=>l,k:()=>d});var n=i(4978),r=i(2061),a=i(4567),o=i(5753),s=i(2663);const l=(0,a.iY)("text"),p=(0,s.T)(l),d=(0,r.qC)((0,n.yk)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:{property:"color"},textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.e4,n.Ae,o.y)(p)},4803:(t,e,i)=>{i.r(e),i.d(e,{TextClass:()=>n.k});var n=i(1611);customElements.define(n.f,n.k)},5753:(t,e,i)=>{i.d(e,{y:()=>r});var n=i(4567);const r=t=>class extends t{get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,n.P$)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}},4201:(t,e,i)=>{i.d(e,{B:()=>d,DY:()=>l,PH:()=>p,Pd:()=>o,TX:()=>r,Wf:()=>c,bi:()=>n,jI:()=>s,jl:()=>a,wm:()=>u});const n=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,r=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,a=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,o=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,s=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",p=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,d=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,u=(t,e)=>`\n ${r(t)}\n ${o(t)}\n ${s(t)}\n ${a(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${d(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,c=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9476,2528,3172,5130,9299,9656],{3878:(t,e,i)=>{i.d(e,{P:()=>o});var n=i(2061),r=i(4978),a=i(3346);const o=(...t)=>(0,n.qC)(r.wX,r.li,r.QT,r.mE)((0,a.s)(...t))},5964:(t,e,i)=>{i.d(e,{f:()=>s,n:()=>u});var n=i(2061),r=i(4567),a=i(4978),o=i(3804);const s=(0,r.iY)("button"),{host:l,label:p}={host:{selector:()=>":host"},label:{selector:"::part(label)"}};let d;const u=(0,n.qC)((0,a.yk)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...l,property:"direction"},fontSize:{},fontFamily:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],labelTextColor:{property:"color"},labelTextDecoration:{...p,property:"text-decoration"},labelSpacing:{...p,property:"gap"},textAlign:{...p,property:"justify-content",fallback:"center"}}}),o.v,a.e4,a.Ae)((0,a.DM)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${d}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${u.cssVarList.outlineWidth}) + var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${u.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${u.cssVarList.hostHeight}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${u.cssVarList.hostWidth}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:s})),{color:c,fontSize:h}=u.cssVarList;d=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${c});\n\t\ttop: calc(50% - (var(${h}) / 2));\n\t\tleft: calc(50% - (var(${h}) / 2));\n\t\tborder-width: calc(var(${h}) / 10);\n\t\twidth: var(${h});\n\t\theight: var(${h});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"])::part(prefix),\n\t:host([loading="true"])::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},3804:(t,e,i)=>{i.d(e,{v:()=>n});const n=t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}},2018:(t,e,i)=>{i.r(e),i.d(e,{ButtonClass:()=>n.n}),i(1721);var n=i(5964);customElements.define(n.f,n.n)},4049:(t,e,i)=>{i.d(e,{H:()=>y,f:()=>s});var n=i(2061),r=i(4567),a=i(4201),o=i(4978);const s=(0,r.iY)("combo-box"),{host:l,inputField:p,inputElement:d,placeholder:u,toggle:c,clearButton:h,label:b,requiredIndicator:m,helperText:g,errorMessage:v}={host:{selector:()=>":host"},inputField:{selector:"::part(input-field)"},inputElement:{selector:"input"},placeholder:{selector:"> input:placeholder-shown"},toggle:{selector:"::part(toggle-button)"},clearButton:{selector:"::part(clear-button)"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},y=(0,n.qC)((0,o.yk)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:[{},l],fontFamily:[b,u,p,g,v],labelTextColor:[{...b,property:"color"},{...m,property:"color"}],errorMessageTextColor:{...v,property:"color"},inputHeight:{...p,property:"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:{...m,property:"content"},inputValueTextColor:{...p,property:"color"},inputPlaceholderTextColor:{...u,property:"color"},inputDropdownButtonCursor:[{...c,property:"cursor"},{...h,property:"cursor"}],inputDropdownButtonColor:[{...c,property:"color"},{...h,property:"color"}],inputDropdownButtonSize:[{...c,property:"font-size"},{...h,property:"font-size"}],inputDropdownButtonOffset:[{...c,property:"margin-right"},{...c,property:"margin-left"}],inputOutlineColor:{...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"}],overlayBackground:{property:()=>y.cssVarList.overlay.backgroundColor},overlayTextColor:{property:()=>y.cssVarList.overlay.textColor},overlayBorder:{property:()=>y.cssVarList.overlay.border},overlayFontSize:{property:()=>y.cssVarList.overlay.fontSize},overlayFontFamily:{property:()=>y.cssVarList.overlay.fontFamily},overlayCursor:{property:()=>y.cssVarList.overlay.cursor},overlayItemBoxShadow:{property:()=>y.cssVarList.overlay.itemBoxShadow},overlayItemPaddingInlineStart:{property:()=>y.cssVarList.overlay.itemPaddingInlineStart},overlayItemPaddingInlineEnd:{property:()=>y.cssVarList.overlay.itemPaddingInlineEnd}}}),o.e4,(0,o.Iw)({name:"overlay",selector:"",mappings:{backgroundColor:{selector:"vaadin-combo-box-scroller"},minHeight:{selector:"vaadin-combo-box-overlay"},margin:{selector:"vaadin-combo-box-overlay"},cursor:{selector:"vaadin-combo-box-item"},fontFamily:{selector:"vaadin-combo-box-item"},textColor:{selector:"vaadin-combo-box-item",property:"color"},fontSize:{selector:"vaadin-combo-box-item"},itemBoxShadow:{selector:"vaadin-combo-box-item",property:"box-shadow"},itemPaddingInlineStart:{selector:"vaadin-combo-box-item",property:"padding-inline-start"},itemPaddingInlineEnd:{selector:"vaadin-combo-box-item",property:"padding-inline-end"}},forward:{include:!1,attributes:["size"]}}),(0,o.dj)({proxyProps:["selectionStart"],inputEvent:"selected-item-changed"}),o.Ae,(t=>class extends t{#t=({displayName:t,value:e,label:i})=>`<span data-name="${i}" data-id="${e}">${t||i}</span>`;#e;get defaultValue(){return this.getAttribute("default-value")}get renderItem(){return this.#t}set renderItem(t){this.#t=t,this.renderItems()}get data(){if(this.#e)return this.#e;const t=this.getAttribute("data");if(t)try{const e=JSON.parse(t);if(this.isValidDataType(e))return e}catch(t){console.error('could not parse data string from attribute "data" -',t.message)}return[]}set data(t){this.isValidDataType(t)&&(this.#e=t,this.renderItems())}isValidDataType(t){const e=Array.isArray(t);return e||console.error("data must be an array, received:",t),e}getItemsTemplate(){return this.data?.reduce?.(((t,e)=>t+(this.renderItem?.(e||{})||"")),"")}renderItems(){const t=this.getItemsTemplate();t&&(this.innerHTML=t)}handleSelectedItem(){const t=this.baseElement.selectedItem?.["data-id"];this.baseElement.selectedItem=void 0,t&&(this.value=t),this.value||this.setDefaultValue()}customValueTransformFn(t){return t}setComboBoxDescriptor(){const t=Object.getOwnPropertyDescriptor(this.inputElement.constructor.prototype,"value"),e=this;Object.defineProperties(this.inputElement,{value:{...t,set(i){if(!e.baseElement.items?.length)return;const n=e.customValueTransformFn(i)||"";n!==this.value&&t.set.call(this,n)}}})}#i(){const t=this.shadowRoot.querySelector(this.baseSelector),e=Array.from(this.children);e.length&&(e.forEach((t=>{Object.defineProperty(t,"data-name",{value:t.getAttribute("data-name"),configurable:!0,writable:!0}),Object.defineProperty(t,"data-id",{value:t.getAttribute("data-id"),configurable:!0,writable:!0})})),t.items=e,setTimeout((()=>{this.handleSelectedItem()}),0)),t.renderer=(t,e,i)=>{t.innerHTML=i.item.outerHTML}}#n(){const t=this.baseElement.shadowRoot.querySelector("vaadin-combo-box-overlay");t._attachOverlay=()=>{t.bringToFront()},t._detachOverlay=()=>{},t._enterModalState=()=>{}}init(){super.init?.(),this.getValidity=function(){return!this.value&&this.isRequired?{valueMissing:!0}:{}},this.setComboBoxDescriptor(),this.#n(),this.renderItems(),(0,r.FX)(this,this.renderItems.bind(this),{includeAttrs:["data"]}),(0,r.P$)(this,this.#i.bind(this)),this.setDefaultValue(),this.baseElement.addEventListener("selected-item-changed",(()=>{this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}))}setDefaultValue(){this.value=this.defaultValue}set value(t){if(t){const e=this.baseElement.items?.find((e=>e["data-id"]===t));e&&(this.baseElement.selectedItem=e)}else this.baseElement.selectedItem=void 0}get value(){return this.baseElement.selectedItem?.["data-id"]||""}}))((0,o.DM)({slots:["","prefix"],wrappedEleName:"vaadin-combo-box",style:()=>`\n\t\t:host {\n\t\t\tdisplay: inline-flex;\n\t\t\tbox-sizing: border-box;\n\t\t\t-webkit-mask-image: none;\n\t\t}\n\t\t${(0,a.bi)(y.cssVarList)}\n\t\t${(0,a.PH)("vaadin-combo-box")}\n\t\t${(0,a.jI)("vaadin-combo-box")}\n\t\t${(0,a.Pd)("vaadin-combo-box")}\n\n\t\tvaadin-combo-box {\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t\tvaadin-combo-box::before {\n\t\t\theight: initial;\n\t\t}\n\t\tvaadin-combo-box [slot="input"] {\n\t\t\t-webkit-mask-image: none;\n\t\t\tmin-height: 0;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tvaadin-combo-box::part(input-field) {\n\t\t\tpadding: 0;\n\t\t\tbox-shadow: none;\n\t\t}\n ${(0,a.Wf)("vaadin-combo-box")}\n\t\t`,excludeAttrsSync:["tabindex","size","data"],componentName:s,includeForwardProps:["items","renderer","selectedItem"]}))},1294:(t,e,i)=>{i.r(e),i.d(e,{ComboBoxClass:()=>n.H}),i(7583);var n=i(4049);customElements.define(n.f,n.H)},6417:(t,e,i)=>{i.d(e,{f:()=>l,z:()=>d});var n=i(4978),r=i(4447),a=i(2061),o=i(4567),s=i(4201);const l=(0,o.iY)("text-field"),p=["type"],d=(0,a.qC)((0,n.yk)({mappings:r.Z}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"]}),n.Ae,(t=>class extends t{static get observedAttributes(){return p.concat(t.observedAttributes||[])}attributeChangedCallback(t,e,i){super.attributeChangeCallback?.(t,e,i),"type"===t&&this.baseElement._setType(i)}}))((0,n.DM)({slots:["prefix","suffix"],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding: calc(var(${d.cssVarList.inputOutlineWidth}) + var(${d.cssVarList.inputOutlineOffset}));\n box-sizing: border-box;\n\t\t\t}\n ${(0,s.Wf)("vaadin-text-field")}\n\t\t\t${(0,s.bi)(d.cssVarList)}\n\t\t\t${(0,s.wm)("vaadin-text-field",d.cssVarList)}\n\t\t`,excludeAttrsSync:["tabindex"],componentName:l}))},9357:(t,e,i)=>{i.r(e),i.d(e,{TextFieldClass:()=>n.z}),i(9789);var n=i(6417);customElements.define(n.f,n.z)},4447:(t,e,i)=>{i.d(e,{Z:()=>h});const{host:n,label:r,placeholder:a,requiredIndicator:o,inputField:s,input:l,helperText:p,errorMessage:d,disabledPlaceholder:u,inputDisabled:c}={host:{selector:()=>":host"},label:{selector:"::part(label)"},requiredIndicator:{selector:"[required]::part(required-indicator)::after"},placeholder:{selector:"> input:placeholder-shown"},disabledPlaceholder:{selector:"> input:disabled::placeholder"},inputField:{selector:"::part(input-field)"},input:{selector:"input"},inputDisabled:{selector:"input:disabled"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},h={fontSize:[{},n],fontFamily:[r,s,p,d],hostWidth:{...n,property:"width"},hostMinWidth:{...n,property:"min-width"},hostDirection:{...n,property:"direction"},inputBackgroundColor:{...s,property:"background-color"},labelTextColor:[{...r,property:"color"},{...o,property:"color"},{...r,property:"-webkit-text-fill-color"},{...o,property:"-webkit-text-fill-color"}],errorMessageTextColor:{...d,property:"color"},helperTextColor:{...p,property:"-webkit-text-fill-color"},inputValueTextColor:[{...s,property:"color"},{...c,property:"-webkit-text-fill-color"}],inputCaretTextColor:{...l,property:"color"},labelRequiredIndicator:{...o,property:"content"},inputBorderColor:{...s,property:"border-color"},inputBorderWidth:{...s,property:"border-width"},inputBorderStyle:{...s,property:"border-style"},inputBorderRadius:{...s,property:"border-radius"},inputHeight:{...s,property:"height"},inputHorizontalPadding:[{...l,property:"padding-left"},{...l,property:"padding-right"}],inputOutlineColor:{...s,property:"outline-color"},inputOutlineStyle:{...s,property:"outline-style"},inputOutlineWidth:{...s,property:"outline-width"},inputOutlineOffset:{...s,property:"outline-offset"},inputTextAlign:{...l,property:"text-align"},inputPlaceholderColor:[{...a,property:"color"},{...u,property:"-webkit-text-fill-color"}]}},2138:(t,e,i)=>{i.d(e,{f:()=>s,k:()=>p});var n=i(4978),r=i(2061),a=i(4567),o=i(3346);const s=(0,a.iY)("text");class l extends((0,o.s)({componentName:s,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <style>\n :host {\n display: inline-block;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n </style>\n <slot part="text-wrapper"></slot>\n ',this.textSlot=this.shadowRoot.querySelector("slot")}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,a.P$)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const p=(0,r.qC)((0,n.yk)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:{property:"color"},textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.e4,n.Ae)(l)},1876:(t,e,i)=>{i.r(e),i.d(e,{TextClass:()=>n.k});var n=i(2138);customElements.define(n.f,n.k)},6751:(t,e,i)=>{i.r(e);var n=i(3878),r=i(4567);const a=(0,r.iY)("mapping-item"),o=["size","bordered","readonly","full-width","disabled"],s=(0,n.P)({componentName:a,baseSelector:"div"});customElements.define(a,class extends s{static get observedAttributes(){return[].concat(s.observedAttributes||[],o,["separator","options","invalid","disabled"])}get separator(){return this.getAttribute("separator")||"map to"}get value(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{[t]:e}:null}set value(t){if(1!==Object.entries(t).length)return void console.error("descope-mapping item expected expects only one key-value pair in the value but received: ",t);const[e,i]=Object.entries(t)[0];this.valueInput.value=i,this.attributeInput.value=e,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n .wrapper {\n display: flex;\n }\n .separator {\n text-align: center;\n flex-shrink: 0;\n }\n </style>\n <div class="wrapper" part="wrapper">\n <descope-text-field required="true"></descope-text-field>\n <div class="separator" part="separator">${this.separator}</div>\n <descope-combo-box\n item-label-path="data-name"\n item-value-path="data-id"\n required="true"\n >\n </descope-combo-box>\n <descope-button variant="link" mode="primary">\n <vaadin-icon icon="vaadin:minus"></vaadin-icon>\n </descope-button>\n </div>\n\t`,this.valueInput=this.shadowRoot.querySelector("descope-text-field"),this.attributeInput=this.shadowRoot.querySelector("descope-combo-box"),this.inputs=[this.valueInput,this.attributeInput],this.removeButton=this.shadowRoot.querySelector("descope-button"),(0,r.oP)(this,this.valueInput,{includeAttrs:o}),(0,r.oP)(this,this.attributeInput,{includeAttrs:[...o,"options"],mapAttrs:{options:"data"}}),(0,r.oP)(this,this.removeButton,{includeAttrs:["disabled"]})}initRemoveButton(){this.removeButton.addEventListener("click",(()=>this.dispatchEvent(new CustomEvent("mapping-item-removed",{bubbles:!0,composed:!0}))))}init(){super.init?.(),this.initRemoveButton()}getValidity(){const t=this.attributeInput.value,e=this.valueInput.value;return t&&e?{}:{badInput:!0}}reportValidity(){this.inputs.forEach((t=>t.reportValidity()))}focus(){(this.checkValidity()||!this.valueInput.checkValidity()?this.valueInput:this.attributeInput).focus()}handleSeparatorChange(){this.shadowRoot.querySelector(".separator").textContent=this.separator}#r(t){"true"===t&&(this.valueInput.value||(this.valueInput.setAttribute("invalid","true"),this.valueInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)),this.attributeInput.value||(this.attributeInput.setAttribute("invalid","true"),this.attributeInput.setAttribute("error-message",this.defaultErrorMsgValueMissing)))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"separator"===t&&this.handleSeparatorChange(),"invalid"===t&&this.#r(i)}})},7819:(t,e,i)=>{i.d(e,{Z:()=>s,f:()=>a});var n=i(3878),r=i(4567);const a=(0,r.iY)("mappings-field-internal"),o=(0,n.P)({componentName:a,baseSelector:"div"}),s=class extends o{#a;static get observedAttributes(){return[].concat(o.observedAttributes||[],["label-value","label-attr","button-label","invalid","readonly","disabled"])}isValidDataType(t){try{return t.every((t=>"object"==typeof t&&!Array.isArray(t)&&1===Object.getOwnPropertyNames(t).length&&"string"==typeof t[Object.keys(t)[0]]&&""!==t[Object.keys(t)[0]].trim()))}catch(t){return!1}}get labelValue(){return this.getAttribute("label-value")||"Value"}get labelAttr(){return this.getAttribute("label-attr")||"Attribute"}get buttonLabel(){return this.getAttribute("button-label")||"Add mapping"}get options(){return this.getAttribute("options")||[]}addNewMappingItem(t){const e=document.createElement("descope-mapping-item");return e.setAttribute("bordered","true"),this.mappingsContainerEle.appendChild(e),(0,r.oP)(this,e,{includeAttrs:["size","full-width","separator","options","disabled"]}),setTimeout((()=>{this.setCustomValidity(""),e.addEventListener("mapping-item-removed",(()=>{e===this.#a&&(this.resetInvalidIndication(),this.#a=void 0),e.remove(),this.setCustomValidity("")})),this.dispatchEvent(new CustomEvent("mapping-item-added",{bubbles:!0,composed:!0})),t&&e.focus()}),0),e}get items(){return Array.from(this.mappingsContainerEle.querySelectorAll("descope-mapping-item"))}get value(){return this.items.reduce(((t,e)=>e.value?[...t,e.value]:t),[])}set value(t){if(!this.isValidDataType(t))return void console.error("received invalid value to set - should be an array of objects with one key-value pair");const e=this.items;if(e.length>t.length)for(let i=t.length;i<e.length;i++)this.mappingsContainerEle.removeChild(e[i]);t.forEach(((t,i)=>{const n=e[i];if(n)n.value=t;else{const e=this.addNewMappingItem(!1);setTimeout((()=>{e.value=t}),0)}}))}constructor(){super(),this.innerHTML='\n <div class="labels-container" part="labels"></div>\n <div class="mappings-container"></div>\n <div class="button-container"></div>\n ',this.labelsEle=this.querySelector(".labels-container"),this.mappingsContainerEle=this.querySelector(".mappings-container"),this.buttonContainer=this.querySelector(".button-container")}initLabels(){this.labelsEle.innerHTML=`\n <descope-text variant="body2" part="value-label">${this.labelValue}</descope-text>\n <descope-text variant="body2" part="attr-label">${this.labelAttr}</descope-text>\n `}initAddButton(){this.buttonContainer.innerHTML=`\n <descope-button variant="link" mode="primary" disabled="${this.isDisabled}">\n <vaadin-icon icon="vaadin:plus"></vaadin-icon>\n ${this.buttonLabel}\n </descope-button>\n `;const t=this.querySelector("descope-button");t.onclick=()=>{this.addNewMappingItem(!0)},(0,r.oP)(this,t,{includeAttrs:["disabled"]})}#o(){this.labelsEle.style.display=this.items.length?"grid":"none"}init(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.#a||this.items[0]||this.querySelector("descope-button")).focus()})),super.init?.(),this.initLabels(),this.initAddButton(),this.addEventListener("input",(()=>{this.mappingsContainerEle.contains(this.#a)&&this.#a?.checkValidity()&&(this.resetInvalidIndication(),this.#a.removeAttribute("invalid"),this.#a=void 0)})),(0,r.P$)(this.mappingsContainerEle,this.#o.bind(this))}resetInvalidIndication(){this.removeAttribute("invalid")}getValidity(){const t=this.items.find((t=>!t.checkValidity()));return t?t.validity:{}}#s(t){t&&(this.#a=this.items.find((t=>!t.checkValidity())),this.#a?.reportValidity(),this.#a?.setAttribute("invalid","true"))}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"label-value"!==t&&"label-attr"!==t||this.initLabels(),"button-label"===t&&this.initAddButton(),"invalid"===t&&this.#s("true"===i),"readonly"===t&&this.toggleAttribute("inert","true"===i)}}},3820:(t,e,i)=>{i.r(e);var n=i(7819);customElements.define(n.f,n.Z)},5894:(t,e,i)=>{i.r(e),i.d(e,{MappingsFieldClass:()=>f}),i(9381),i(7911),i(6594);var n=i(4978),r=i(2138),a=i(2061),o=i(4567),s=i(7819);const l=(0,o.iY)("mappings-field"),{host:p,helperText:d,errorMessage:u,mappingItem:c,labels:h,labelsText:b,valueLabel:m,attrLabel:g,separator:v,labelsContainer:y}={host:{selector:()=>":host"},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"},mappingItem:{selector:"descope-mapping-item::part(wrapper)"},labels:{selector:'descope-mappings-field-internal [part="labels"] descope-text'},labelsText:{selector:'descope-mappings-field-internal [part="labels"] descope-text::part(text-wrapper)'},valueLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="value-label"]'},attrLabel:{selector:'descope-mappings-field-internal [part="labels"] [part="attr-label"]'},separator:{selector:"descope-mapping-item::part(separator)"},labelsContainer:{selector:'descope-mappings-field-internal [part="labels"]'}},f=(0,a.qC)((0,n.yk)({mappings:{hostWidth:{...p,property:"width"},hostDirection:{...p,property:"direction"},fontSize:[{},p,{...v,property:"margin-top"}],fontFamily:[d,u,h],separatorFontSize:{...v,property:"font-size"},labelsFontSize:{...b,property:"font-size"},labelsLineHeight:[{...b,property:"line-height"},{...h,property:"line-height"}],labelTextColor:{...h,property:r.k.cssVarList.textColor},itemMarginBottom:{...c,property:"margin-bottom"},valueLabelMinWidth:{...m,property:"min-width"},attrLabelMinWidth:{...g,property:"min-width"},labelsMarginBottom:{...y,property:"margin-bottom"},separatorWidth:{},removeButtonWidth:{}}}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"],inputEvent:"input",proxyParentValidation:!0}),n.Ae,(t=>class extends t{get defaultValues(){const t=this.getAttribute("default-values");if(t)try{return JSON.parse(t)}catch(t){console.error('could not parse data string from attribute "default-values" -',t.message)}return[]}setDefaultValues(){const t=this.defaultValues;Object.keys(t).length>0&&(this.inputElement.value=t)}init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${s.f}\n tabindex="-1"\n ></${s.f}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(s.f),(0,o.oP)(this,this.inputElement,{includeAttrs:["size","full-width","label-value","label-attr","button-label","separator","options","default-values","invalid","readonly","disabled"]}),(0,o.tg)(this,this.inputElement,{includeAttrs:["invalid"]}),this.setDefaultValues()}}))((0,n.DM)({slots:[],wrappedEleName:"vaadin-custom-field",style:()=>`\n :host {\n display: inline-flex;\n max-width: 100%;\n direction: ltr;\n }\n vaadin-custom-field {\n line-height: unset;\n width: 100%;\n }\n\n descope-mappings-field-internal [part="labels"] {\n display: none;\n grid-template-columns: 1fr var(${f.cssVarList.separatorWidth}) 1fr var(${f.cssVarList.removeButtonWidth});\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"],\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n ${r.k.cssVarList.fontWeight}: 500;\n }\n\n descope-mappings-field-internal [part="labels"] [part="value-label"] {\n grid-column: 1 / span 1;\n }\n\n descope-mappings-field-internal [part="labels"] [part="attr-label"] {\n grid-column: 3 / span 1;\n }\n\n descope-mapping-item::part(wrapper) {\n display: grid;\n grid-template-columns: 1fr var(${f.cssVarList.separatorWidth}) 1fr var(${f.cssVarList.removeButtonWidth});\n }\n `,excludeAttrsSync:["tabindex","label-value","label-attr","button-label","options","error-message"],componentName:l}));i(1876),i(2018),i(9357),i(1294),i(3820),i(6751),customElements.define(l,f)},6867:(t,e,i)=>{i.d(e,{Z:()=>s,f:()=>a});var n=i(3878),r=i(4567);const a=(0,r.iY)("saml-group-mappings-internal"),o=(0,n.P)({componentName:a,baseSelector:""}),s=class extends o{static get observedAttributes(){return["invalid"].concat(o.observedAttributes||[])}constructor(){super(),this.innerHTML='\n <descope-text-field variant="body2" bordered="true"></descope-text-field>\n <descope-mappings-field></descope-mappings-field>\n ',this.groupInputElement=this.querySelector("descope-text-field"),this.mappingsElement=this.querySelector("descope-mappings-field")}resetInvalidIndication(){this.removeAttribute("invalid")}handleMappingsInvalidChange(t){t.includes("invalid")&&(this.mappingsElement.hasAttribute("invalid")||this.resetInvalidIndication())}initFocusHandler(){this.addEventListener("focus",(t=>{t.isTrusted&&(this.mappingsElement.checkValidity()?this.groupInputElement:this.mappingsElement).focus()}))}init(){this.initFocusHandler(),super.init?.(),(0,r.oP)(this,this.groupInputElement,{mapAttrs:{"label-group":"label"},includeAttrs:["size","label-group","readonly","disabled"]}),(0,r.oP)(this,this.mappingsElement,{includeAttrs:["size","full-width","label-value","label-attr","button-label","separator","options","readonly","disabled","data-errormessage-pattern-mismatch"]}),(0,r.FX)(this.mappingsElement,this.handleMappingsInvalidChange.bind(this),{includeAttrs:["invalid"]})}get value(){return{group:this.groupInputElement.value,mappings:this.mappingsElement.value}}set value(t){t?.group&&"string"==typeof t.group&&(this.groupInputElement.value=t.group),Array.isArray(t?.mappings)&&(this.mappingsElement.value=t.mappings)}getValidity(){return this.groupInputElement.checkValidity()?this.mappingsElement.checkValidity()?{}:this.mappingsElement.validity:this.groupInputElement.validity}#l(t){if(t){if(!this.groupInputElement.checkValidity())return void this.groupInputElement.setAttribute("invalid","true");this.mappingsElement.checkValidity()||this.mappingsElement.setAttribute("invalid","true")}}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),"invalid"===t&&this.#l("true"===i)}}},4115:(t,e,i)=>{i.r(e);var n=i(6867);customElements.define(n.f,n.Z)},3277:(t,e,i)=>{i.r(e),i.d(e,{SamlGroupMappingsClass:()=>d}),i(9381);var n=i(4978),r=i(2061),a=i(4567),o=i(6867);const s=(0,a.iY)("saml-group-mappings"),{host:l,groupInput:p}={host:{selector:()=>":host"},groupInput:{selector:"descope-text-field"}},d=(0,r.qC)((0,n.yk)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},groupNameInputMarginBottom:{...p,property:"margin-bottom"}}}),n.e4,(0,n.dj)({proxyProps:["value","selectionStart"],inputEvent:"input",triggerValidationEvents:["mapping-item-added","mapping-item-removed"],proxyParentValidation:!0}),n.Ae,(t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n <${o.f}\n tabindex="-1"\n ></${o.f}>\n `,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.f),(0,a.oP)(this,this.inputElement,{includeAttrs:["size","full-width","label-group","label-value","label-attr","button-label","separator","options","readonly","disabled"]}),(0,a.tg)(this,this.inputElement,{includeAttrs:["invalid"]})}}))((0,n.DM)({slots:[],wrappedEleName:"vaadin-custom-field",style:()=>"\n :host {\n display: inline-flex;\n max-width: 100%;\n direction: ltr;\n }\n\n vaadin-custom-field {\n line-height: unset;\n width: 100%;\n }\n\n descope-text-field {\n width: auto;\n }\n\n descope-mappings-field {\n display: block;\n }\n ",excludeAttrsSync:["tabindex","label-group","label-value","label-attr","button-label","separator","options","error-message"],componentName:s}));i(9357),i(5894),i(4115),customElements.define(s,d)},4201:(t,e,i)=>{i.d(e,{B:()=>d,DY:()=>l,PH:()=>p,Pd:()=>o,TX:()=>r,Wf:()=>c,bi:()=>n,jI:()=>s,jl:()=>a,wm:()=>u});const n=t=>`\n :host {\n padding: calc(var(${t.inputOutlineWidth}) + var(${t.inputOutlineOffset}))\n }\n`,r=t=>`\n ${t} {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n }\n`,a=t=>`\n ${t}::part(input-field) {\n overflow: hidden;\n padding: 0;\n box-shadow: none;\n }\n`,o=t=>`\n ${t} > label,\n ${t}::part(label),\n ${t}::part(required-indicator) {\n cursor: pointer;\n }\n`,s=(t,e="input")=>`\n ${t}[disabled] > ${e}:placeholder-shown,\n\t${t}[readonly] > ${e}:placeholder-shown {\n\t\topacity: 1;\n\t}\n`,l=()=>"\n :host {\n --vaadin-field-default-width: auto;\n box-sizing: border-box;\n }\n",p=t=>`\n ${t}::part(input-field)::after {\n opacity: 0;\n }\n`,d=t=>`\n ${t}::part(input-field)::after {\n background: none;\n }\n`,u=(t,e)=>`\n ${r(t)}\n ${o(t)}\n ${s(t)}\n ${a(t)}\n ${((t,e)=>`\n ${t} input:-webkit-autofill,\n ${t} input:-webkit-autofill::first-line,\n ${t} input:-webkit-autofill:hover,\n ${t} input:-webkit-autofill:active,\n ${t} input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(${e.inputValueTextColor});\n box-shadow: 0 0 0 var(${e.inputHeight}) var(${e.inputBackgroundColor}) inset;\n }\n`)(t,e)}\n ${d(t)}\n ${(t=>`\n ${t}::before {\n\t\theight: unset;\n\t}\n`)(t)}\n ${(t=>`\n ${t} > input {\n -webkit-mask-image: none;\n min-height: 0;\n box-sizing: border-box;\n }\n`)(t)}\n ${(t=>`\n ${t}::part(input-field)::after {\n border: none;\n }\n`)(t)}\n`,c=t=>`\n :host ::part(error-message) {\n direction: ltr;\n }\n :host([required]) ::part(required-indicator) {\n width: 1em;\n display: inline-flex;\n }\n :host([required]) ::part(required-indicator)::after {\n position: static;\n }\n :host([has-label]) ::part(label) {\n padding-right: 0;\n padding-bottom: 0;\n display: flex;\n width: 100%;\n }\n ${t} [slot="label"] {\n max-width: calc(100% - 1em);\n overflow: hidden;\n text-overflow: ellipsis;\n padding-bottom: 0.5em;\n }\n`}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.0.300",
3
+ "version": "1.0.301",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -60,8 +60,8 @@
60
60
  "@storybook/addon-links": "^6.4.9",
61
61
  "@storybook/html": "^6.4.9",
62
62
  "@storybook/manager-api": "^7.4.6",
63
- "@types/markdown-it": "^14.0.1",
64
63
  "@types/node": "^20.8.0",
64
+ "@types/remarkable": "^2.0.8",
65
65
  "eslint": "^8.48.0",
66
66
  "eslint-config-airbnb-base": "^15.0.0",
67
67
  "eslint-config-prettier": "^9.0.0",
@@ -102,7 +102,7 @@
102
102
  "element-internals-polyfill": "^1.3.9",
103
103
  "lint-staged": "^15.0.0",
104
104
  "lodash.merge": "4.6.2",
105
- "markdown-it": "^14.1.0"
105
+ "remarkable": "^2.0.1"
106
106
  },
107
107
  "overrides": {
108
108
  "@vaadin/avatar": "24.3.4",
@@ -2,7 +2,7 @@ import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '
2
2
  import { createBaseClass } from '../../baseClasses/createBaseClass';
3
3
  import { compose } from '../../helpers';
4
4
  import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
5
- import { TextClass } from '../text-components/descope-text/TextClass';
5
+ import { TextClass } from '../descope-text/TextClass';
6
6
 
7
7
  export const componentName = getComponentName('divider');
8
8
  class RawDivider extends createBaseClass({ componentName, baseSelector: ':host > div' }) {
@@ -1,5 +1,5 @@
1
1
  import { componentName, DividerClass } from './DividerClass';
2
- import '../text-components/descope-text';
2
+ import '../descope-text';
3
3
 
4
4
  customElements.define(componentName, DividerClass);
5
5
 
@@ -0,0 +1,163 @@
1
+ import { Remarkable } from 'remarkable';
2
+ import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
3
+ import { compose } from '../../helpers';
4
+ import { getComponentName } from '../../helpers/componentHelpers';
5
+ import { ruleSet, textRuleSet } from './consts';
6
+ import { createBaseClass } from '../../baseClasses/createBaseClass';
7
+
8
+ export const componentName = getComponentName('enriched-text');
9
+
10
+ class EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {
11
+ #origImageRenderer;
12
+
13
+ constructor() {
14
+ super();
15
+
16
+ this.attachShadow({ mode: 'open' }).innerHTML = `
17
+ <style>
18
+ :host {
19
+ display: inline-block;
20
+ }
21
+ :host > slot {
22
+ width: 100%;
23
+ display: inline-block;
24
+ }
25
+ *, *:last-child {
26
+ margin: 0;
27
+ }
28
+ h1,
29
+ h2,
30
+ h3,
31
+ h4,
32
+ h5,
33
+ h6,
34
+ p {
35
+ margin-bottom: 1em;
36
+ }
37
+ a {
38
+ text-decoration: none;
39
+ cursor: pointer;
40
+ }
41
+ a:hover {
42
+ text-decoration: underline;
43
+ }
44
+ blockquote {
45
+ padding: 0 2em;
46
+ }
47
+ </style>
48
+ <slot part="text-wrapper" style="display:none"></slot>
49
+ <div class="content"></div>
50
+ `;
51
+
52
+ this.textSlot = this.shadowRoot.querySelector('slot');
53
+
54
+ this.#initProcessor();
55
+
56
+ this.textSlot.addEventListener('slotchange', this.#parseChildren.bind(this));
57
+ }
58
+
59
+ static get observedAttributes() {
60
+ return ['readonly'];
61
+ }
62
+
63
+ attributeChangedCallback(attrName, oldValue, newValue) {
64
+ super.attributeChangedCallback?.(attrName, oldValue, newValue);
65
+
66
+ if (newValue !== oldValue) {
67
+ if (attrName === 'readonly') {
68
+ this.onReadOnlyChange(newValue === 'true');
69
+ }
70
+ }
71
+ }
72
+
73
+ #disableAllRules() {
74
+ if (!this.processor) {
75
+ return;
76
+ }
77
+
78
+ ruleSet?.core && this.processor.core.ruler.disable(ruleSet.core);
79
+ ruleSet?.inline && this.processor.inline.ruler.disable(ruleSet.inline);
80
+ ruleSet?.block && this.processor.block.ruler.disable(ruleSet.block);
81
+
82
+ this.processor.renderer.rules.image = () => {
83
+ return '';
84
+ };
85
+ }
86
+
87
+ #enableCustomRules() {
88
+ if (!this.processor) {
89
+ return;
90
+ }
91
+
92
+ const customRuleSet = textRuleSet;
93
+
94
+ customRuleSet?.core && this.processor?.core.ruler.enable(customRuleSet?.core);
95
+ customRuleSet?.inline && this.processor?.inline.ruler.enable(customRuleSet?.inline);
96
+ customRuleSet?.block && this.processor?.block.ruler.enable(customRuleSet?.block);
97
+
98
+ if (customRuleSet?.custom?.includes('image')) {
99
+ this.processor.renderer.rules.image = this.#origImageRenderer;
100
+ }
101
+ }
102
+
103
+ #updateProcessorRules() {
104
+ this.#disableAllRules();
105
+ this.#enableCustomRules();
106
+ }
107
+
108
+ #initProcessor() {
109
+ this.processor = new Remarkable();
110
+ this.#origImageRenderer = this.processor.renderer.rules.image;
111
+ this.#updateProcessorRules();
112
+ }
113
+
114
+ get contentNode() {
115
+ return this.shadowRoot.querySelector('.content');
116
+ }
117
+
118
+ #parseChildren() {
119
+ if (!this.processor) {
120
+ return;
121
+ }
122
+
123
+ let html = this.textContent;
124
+
125
+ try {
126
+ const tokens = this.processor.parse(this.textContent);
127
+ html = this.processor.renderer.render(tokens, { breaks: true });
128
+ this.contentNode.innerHTML = html;
129
+ } catch (e) {
130
+ // eslint-disable-next-line no-console
131
+ console.warn('Not parsing invalid markdown token');
132
+ }
133
+
134
+ this.contentNode.innerHTML = html;
135
+ }
136
+
137
+ onReadOnlyChange(isReadOnly) {
138
+ if (isReadOnly) {
139
+ this.setAttribute('inert', isReadOnly);
140
+ } else {
141
+ this.removeAttribute('inert');
142
+ }
143
+ }
144
+ }
145
+
146
+ export const EnrichedTextClass = compose(
147
+ createStyleMixin({
148
+ mappings: {
149
+ hostWidth: { selector: () => ':host', property: 'width' },
150
+ hostDirection: { selector: () => ':host', property: 'direction' },
151
+ fontSize: {},
152
+ fontFamily: {},
153
+ fontWeight: {},
154
+ textColor: { property: 'color' },
155
+ textLineHeight: { property: 'line-height' },
156
+ textAlign: {},
157
+ linkColor: { selector: 'a', property: 'color' },
158
+ },
159
+ }),
160
+ createStyleMixin({ componentNameOverride: getComponentName('link') }),
161
+ draggableMixin,
162
+ componentNameValidationMixin
163
+ )(EnrichedText);
@@ -0,0 +1,74 @@
1
+ export const ruleSet = {
2
+ custom: ['image'],
3
+ core: [
4
+ 'block',
5
+ 'inline',
6
+ 'abbr', // Parse abbreviation definitions, i.e. `*[abbr]: description`
7
+ 'abbr2', // Enclose abbreviations in <abbr> tags
8
+ 'references',
9
+ 'footnote_tail',
10
+ 'replacements', // Simple typographical replacements
11
+ 'smartquotes', // Convert straight quotation marks to typographic ones
12
+ ],
13
+ inline: [
14
+ 'text',
15
+ 'newline', // Proceess '\n'
16
+ 'backticks', // Parse backticks
17
+ 'del', // Process ~~deleted text~~
18
+ 'emphasis', // Process *this* and _that_
19
+ 'sub', // Process ~subscript~
20
+ 'sup', // Process ^superscript^
21
+ 'links', // Process [links](<to> "stuff")
22
+ 'escape', // Proceess escaped chars and hardbreaks
23
+ 'ins', // Process ++inserted text++
24
+ 'mark', // Process ==highlighted text==
25
+ 'footnote_inline', // Process inline footnotes (^[...])
26
+ 'footnote_ref', // Process footnote references ([^...])
27
+ 'autolink', // Process autolinks '<protocol:...>'
28
+ 'htmltag', // Process html tags
29
+ 'entity', // Process html entity - &#123;, &#xAF;, &quot;, ...
30
+ ],
31
+ block: [
32
+ 'code', // Code block (4 spaces padded)
33
+ 'fences', // fences (``` lang, ~~~ lang)
34
+ 'blockquote', // Block quotes
35
+ 'list',
36
+ 'heading', // heading (#, ##, ...)
37
+ 'paragraph',
38
+ 'hr', // Horizontal rule
39
+ 'footnote', // Process footnote reference list
40
+ 'lheading', // lheading (---, ===)
41
+ 'htmlblock', // HTML block
42
+ 'table', // GFM table, non-standard
43
+ 'deflist', // Definition lists
44
+ ],
45
+ };
46
+
47
+ export const textRuleSet = {
48
+ core: ['block', 'inline'],
49
+ inline: [
50
+ 'text',
51
+ 'newline', // Proceess '\n'
52
+ 'backticks', // Parse backticks
53
+ 'del', // Process ~~deleted text~~
54
+ 'emphasis', // Process *this* and _that_
55
+ 'sub', // Process ~subscript~
56
+ 'sup', // Process ^superscript^
57
+ 'links', // Process [links](<to> "stuff")
58
+ 'escape', // Proceess escaped chars and hardbreaks
59
+ 'ins', // Process ++inserted text++
60
+ 'footnote_inline', // Process inline footnotes (^[...])
61
+ 'footnote_ref', // Process footnote references ([^...])
62
+ 'autolink', // Process autolinks '<protocol:...>'
63
+ ],
64
+ block: [
65
+ 'code', // Code block (4 spaces padded)
66
+ 'fences', // fences (``` lang, ~~~ lang)
67
+ 'blockquote', // Block quotes
68
+ 'list',
69
+ 'heading', // heading (#, ##, ...)
70
+ 'paragraph',
71
+ 'footnote', // Process footnote reference list
72
+ 'htmlblock', // HTML block
73
+ ],
74
+ };
@@ -1,6 +1,6 @@
1
1
  import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
2
2
  import { createBaseClass } from '../../baseClasses/createBaseClass';
3
- import { TextClass } from '../text-components/descope-text/TextClass';
3
+ import { TextClass } from '../descope-text/TextClass';
4
4
  import { compose } from '../../helpers';
5
5
  import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { componentName, LinkClass } from './LinkClass';
2
- import '../text-components/descope-text';
2
+ import '../descope-text';
3
3
 
4
4
  customElements.define(componentName, LinkClass);
5
5
 
@@ -0,0 +1,64 @@
1
+ import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';
2
+ import { compose } from '../../helpers';
3
+ import { getComponentName, observeChildren } from '../../helpers/componentHelpers';
4
+ import { createBaseClass } from '../../baseClasses/createBaseClass';
5
+
6
+ export const componentName = getComponentName('text');
7
+
8
+ class RawText extends createBaseClass({ componentName, baseSelector: ':host > slot' }) {
9
+ constructor() {
10
+ super();
11
+
12
+ this.attachShadow({ mode: 'open' }).innerHTML = `
13
+ <style>
14
+ :host {
15
+ display: inline-block;
16
+ }
17
+ :host > slot {
18
+ width: 100%;
19
+ display: inline-block;
20
+ }
21
+ </style>
22
+ <slot part="text-wrapper"></slot>
23
+ `;
24
+
25
+ this.textSlot = this.shadowRoot.querySelector('slot');
26
+ }
27
+
28
+ get hideWhenEmpty() {
29
+ return this.getAttribute('hide-when-empty') === 'true';
30
+ }
31
+
32
+ init() {
33
+ super.init();
34
+
35
+ observeChildren(this, () => {
36
+ const hasChildren = !!this.childNodes.length;
37
+ this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';
38
+ });
39
+ }
40
+ }
41
+
42
+ export const TextClass = compose(
43
+ createStyleMixin({
44
+ mappings: {
45
+ hostWidth: { selector: () => ':host', property: 'width' },
46
+ hostDirection: { selector: () => ':host', property: 'direction' },
47
+ fontSize: {},
48
+ textColor: { property: 'color' },
49
+ textLineHeight: { property: 'line-height' },
50
+ textLetterSpacing: { property: 'letter-spacing' },
51
+ textShadow: {},
52
+ textAlign: {},
53
+ textTransform: {},
54
+ fontFamily: {},
55
+ fontStyle: {},
56
+ fontWeight: {},
57
+ borderWidth: {},
58
+ borderStyle: {},
59
+ borderColor: {},
60
+ },
61
+ }),
62
+ draggableMixin,
63
+ componentNameValidationMixin
64
+ )(RawText);
@@ -4,7 +4,7 @@ import { compose } from '../../helpers';
4
4
  import { getComponentName } from '../../helpers/componentHelpers';
5
5
  import deleteIcon from './delete.svg';
6
6
  import editIcon from './edit.svg';
7
- import { TextClass } from '../text-components/descope-text/TextClass';
7
+ import { TextClass } from '../descope-text/TextClass';
8
8
  import { ButtonClass } from '../descope-button/ButtonClass';
9
9
  import { BadgeClass } from '../descope-badge/BadgeClass';
10
10
 
@@ -1,5 +1,5 @@
1
1
  import { componentName, UserAttributeClass } from './UserAttributeClass';
2
- import '../text-components/descope-text';
2
+ import '../descope-text';
3
3
  import '../descope-button';
4
4
  import '../descope-badge';
5
5
  import '@vaadin/icon';
@@ -3,7 +3,7 @@ import { createBaseClass } from '../../baseClasses/createBaseClass';
3
3
  import { compose } from '../../helpers';
4
4
  import { getComponentName } from '../../helpers/componentHelpers';
5
5
  import greenVIcon from './green-v.svg';
6
- import { TextClass } from '../text-components/descope-text/TextClass';
6
+ import { TextClass } from '../descope-text/TextClass';
7
7
  import { ButtonClass } from '../descope-button/ButtonClass';
8
8
  import { BadgeClass } from '../descope-badge/BadgeClass';
9
9
 
@@ -1,5 +1,5 @@
1
1
  import { componentName, UserAuthMethodClass } from './UserAuthMethodClass';
2
- import '../text-components/descope-text';
2
+ import '../descope-text';
3
3
  import '../descope-button';
4
4
  import '../descope-badge';
5
5
  import '@vaadin/icon';
@@ -5,7 +5,7 @@ import {
5
5
  proxyInputMixin,
6
6
  componentNameValidationMixin,
7
7
  } from '../../../mixins';
8
- import { TextClass } from '../../text-components/descope-text/TextClass';
8
+ import { TextClass } from '../../descope-text/TextClass';
9
9
  import { compose } from '../../../helpers';
10
10
  import { forwardAttrs, getComponentName, syncAttrs } from '../../../helpers/componentHelpers';
11
11
  import { componentName as descopeInternalComponentName } from './descope-mappings-field-internal/MappingsFieldInternal';
@@ -2,7 +2,7 @@ import '@vaadin/custom-field';
2
2
  import '@vaadin/icon';
3
3
  import '@vaadin/icons';
4
4
  import { componentName, MappingsFieldClass } from './MappingsFieldClass';
5
- import '../../text-components/descope-text';
5
+ import '../../descope-text';
6
6
  import '../../descope-button';
7
7
  import '../../descope-text-field';
8
8
  import '../../descope-combo-box';
package/src/index.cjs.js CHANGED
@@ -20,8 +20,8 @@ export { NotpImageClass } from './components/descope-notp-image/NotpImageClass';
20
20
  export { NumberFieldClass } from './components/descope-number-field/NumberFieldClass';
21
21
  export { PasscodeClass } from './components/descope-passcode/PasscodeClass';
22
22
  export { PasswordClass } from './components/descope-password/PasswordClass';
23
- export { TextClass } from './components/text-components/descope-text/TextClass';
24
- export { EnrichedTextClass } from './components/text-components/descope-enriched-text/EnrichedTextClass';
23
+ export { TextClass } from './components/descope-text/TextClass';
24
+ export { EnrichedTextClass } from './components/descope-enriched-text/EnrichedTextClass';
25
25
  export { TextAreaClass } from './components/descope-text-area/TextAreaClass';
26
26
  export { TextFieldClass } from './components/descope-text-field/TextFieldClass';
27
27
  export { ImageClass } from './components/descope-image/ImageClass';
package/src/index.d.ts CHANGED
@@ -24,8 +24,8 @@ export { NotpImageClass } from './components/descope-notp-image';
24
24
  export { NumberFieldClass } from './components/descope-number-field';
25
25
  export { PasscodeClass } from './components/descope-passcode';
26
26
  export { PasswordClass } from './components/descope-password';
27
- export { TextClass } from './components/text-components/descope-text';
28
- export { EnrichedTextClass } from './components/text-components/descope-enriched-text';
27
+ export { TextClass } from './components/descope-text';
28
+ export { EnrichedTextClass } from './components/descope-enriched-text';
29
29
  export { TextAreaClass } from './components/descope-text-area';
30
30
  export { TextFieldClass } from './components/descope-text-field';
31
31
  export { ImageClass } from './components/descope-image';
package/src/index.js CHANGED
@@ -14,8 +14,8 @@ export * from './components/descope-notp-image';
14
14
  export * from './components/descope-number-field';
15
15
  export * from './components/descope-passcode';
16
16
  export * from './components/descope-password';
17
- export * from './components/text-components/descope-text';
18
- export * from './components/text-components/descope-enriched-text';
17
+ export * from './components/descope-text';
18
+ export * from './components/descope-enriched-text';
19
19
  export * from './components/descope-text-area';
20
20
  export * from './components/descope-text-field';
21
21
  export * from './components/descope-image';