@descope/web-components-ui 3.10.1 → 3.11.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.
Files changed (31) hide show
  1. package/dist/cjs/index.cjs.js +1466 -757
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +1720 -1014
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/9582.js +1 -1
  6. package/dist/umd/9582.js.map +1 -1
  7. package/dist/umd/DescopeDev.js +1 -1
  8. package/dist/umd/DescopeDev.js.map +1 -1
  9. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  10. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.map +1 -1
  11. package/dist/umd/descope-alert-index-js.js +1 -1
  12. package/dist/umd/descope-alert-index-js.js.map +1 -1
  13. package/dist/umd/descope-enriched-text.js +1 -1
  14. package/dist/umd/descope-enriched-text.js.map +1 -1
  15. package/dist/umd/descope-link.js +1 -1
  16. package/dist/umd/descope-link.js.map +1 -1
  17. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
  18. package/dist/umd/descope-new-password-index-js.js.map +1 -1
  19. package/dist/umd/descope-policy-validation-index-js.js.map +1 -1
  20. package/dist/umd/descope-tooltip.js +1 -1
  21. package/dist/umd/descope-tooltip.js.map +1 -1
  22. package/dist/umd/descope-trusted-devices.js +1 -1
  23. package/dist/umd/descope-trusted-devices.js.map +1 -1
  24. package/dist/umd/descope-user-passkeys.js +339 -0
  25. package/dist/umd/descope-user-passkeys.js.LICENSE.txt +5 -0
  26. package/dist/umd/descope-user-passkeys.js.map +1 -0
  27. package/dist/umd/index.js +1 -1
  28. package/dist/umd/index.js.map +1 -1
  29. package/package.json +36 -35
  30. package/src/components/descope-policy-validation/PolicyValidationClass.js +1 -3
  31. package/src/theme/components/index.js +2 -0
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see descope-tooltip.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[628,2294,3267,4159,9261],{13094(t,e,o){o.r(e),o.d(e,{AnchoredClass:()=>a,componentName:()=>h});var n=o(88961),s=o(72270),i=o(25964),r=o(63200);const h=(0,i.xE)("anchored");class l extends((0,s.qu)({componentName:h,baseSelector:".anchored-root"})){#t=null;#e=null;#o=null;get#n(){return this.defaultSlot.assignedElements({flatten:!0})[0]}get#s(){return this.shadowRoot.querySelector('slot[name="anchored"]')?.assignedElements()[0]}get#i(){return this.getRootNode().host}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="anchored-root" part="root">\n <slot></slot>\n <div class="anchored-host" part="anchored">\n <slot name="anchored"></slot>\n </div>\n </div>\n ',this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])")}init(){super.init?.(),(0,i.fz)("\n :host {\n display: inline-flex;\n position: relative;\n box-sizing: border-box;\n }\n\n :host(:not([has-anchor])) {\n display: none;\n }\n\n .anchored-root {\n position: relative;\n display: flex;\n width: 100%;\n min-width: 0;\n }\n\n /* Make anchor fill the flex row and allow it to shrink. */\n ::slotted(*:not([slot])) {\n flex-grow: 1; /* fill the flex row */\n flex-shrink: 1; /* compress when constrained */\n flex-basis: auto; /* start from the anchor's natural size */\n min-width: 0; /* flex items won't shrink below content size without this */\n }\n\n /* Anchored container covers the anchor but is invisible to pointer events. */\n .anchored-host {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n /* Restore interactivity for actual anchored content. */\n ::slotted([slot=\"anchored\"]) {\n pointer-events: auto;\n }\n ",this),this.#r(),this.defaultSlot.addEventListener("slotchange",()=>this.#h()),this.#h()}#l(){const t=this.#n?.classList?.contains("hidden");this.classList.toggle("hidden",t)}#h(){this.#a(),this.#t=this.#d(this.#t,this.#i,"stretch"),this.#e=this.#d(this.#e,this.#s,"st-host-direction")}#r(){const t="\n descope-anchored {\n width: 100%; /* fill the outer host so the anchored element spans the full anchor width */\n }\n :host([stretch]) {\n display: inline-flex; /* switch from inline-block so internal children are flex items */\n width: 100%; /* fill non-flex parents */\n flex-grow: 1; /* absorb extra space in flex parents */\n flex-shrink: 0; /* hold full width — shrink:1 would let siblings squeeze it below 100% */\n flex-basis: auto; /* defer to width:100% on the main axis; avoids forcing 100% height in column-flex parents */\n min-width: 0; /* prevent overflow when the outer host is itself inside a constrained flex row */\n }\n ";this.#o?this.#o.replaceSync(t):this.#i&&(this.#o=(0,i.fz)(t,this.#i))}#d(t,e,o){return t?.disconnect(),e?.removeAttribute(o),this.#n&&e?(0,i.EA)(this.#n,e,{includeAttrs:[o]}):null}disconnectedCallback(){super.disconnectedCallback?.(),this.#t?.disconnect(),this.#e?.disconnect()}#a(){this.toggleAttribute("has-anchor",!!this.#n),this.#l()}}const a=(0,r.Zz)(n.tQ)(l);customElements.define(h,a)},76231(t,e,o){o.d(e,{T:()=>d,m:()=>p});var n=o(92540),s=o(88961),i=o(63200),r=o(36976),h=o(72270),l=o(54847),a=o(25964);const d=(0,a.xE)("enriched-text");class c extends((0,h.qu)({componentName:d,baseSelector:":host > div"})){#c;#p;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,a.fz)("\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n ",this),this.#u(),(0,a.Ge)(this,this.#m.bind(this)),this.contentNode?.addEventListener("click",t=>{t.target instanceof HTMLAnchorElement&&t.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),o!==e&&("readonly"===t&&this.onReadOnlyChange("true"===o),"link-target-blank"===t&&this.#u())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,o,n,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#p(t,e,o,n,s)),this.processor.renderer.rules.em_close=(t,e,o,n,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#p(t,e,o,n,s))}#y(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,o,n,s)=>(t[e].attrSet("target","_blank"),this.#c(t,e,o,n,s)):this.processor.renderer.rules.link_open=this.#c}#g(){this.processor&&this.processor.disable(r.M)}#b(){this.#g()}#v(){this.#c=this.processor.renderer.rules.link_open||((t,e,o,n,s)=>s.renderToken(t,e,o)),this.#p=this.processor.renderer.rules.em_open||((t,e,o,n,s)=>s.renderToken(t,e,o))}#u(){this.processor=new n.A("commonmark",{html:!0}),this.#v(),this.#b(),this.#y(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#m(){if(!this.processor)return;let t=(0,l.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch(t){console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t,this.contentNode.firstChild?.setAttribute("part","content")}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):this.contentNode.removeAttribute("inert")}}const p=(0,i.Zz)((0,s.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDisplay:{selector:()=>":host",property:"display",fallback:"inline-block"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},fontWeightBold:[{selector:()=>":host strong",property:"font-weight"},{selector:()=>":host b",property:"font-weight"}],textColor:{property:"color"},textLineHeight:{property:"line-height"},textAlign:{},linkColor:{selector:"a",property:"color"},linkTextDecoration:{selector:"a",property:"text-decoration"},linkHoverTextDecoration:{selector:"a:hover",property:"text-decoration"},minHeight:{},minWidth:{}}}),(0,s.RF)({componentNameOverride:(0,a.xE)("link")}),(0,s.RF)({componentNameOverride:(0,a.xE)("text")}),s.VO,s.tQ)(c)},36976(t,e,o){o.d(e,{M:()=>n});const n=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(t,e,o){o.d(e,{G:()=>n});const n=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838(t,e,o){o.r(e),o.d(e,{EnrichedTextClass:()=>n.m,componentName:()=>n.T}),o(74778);var n=o(76231);customElements.define(n.T,n.m)},74778(t,e,o){o.r(e),o.d(e,{LinkClass:()=>b,componentName:()=>l});var n=o(88961),s=o(63200),i=o(25964),r=o(72270),h=o(66434);const l=(0,i.xE)("link"),a=["href","readonly"];class d extends((0,r.qu)({componentName:l,baseSelector:":host a"})){static get observedAttributes(){return a.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t',(0,i.fz)('\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,i.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,i.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>h.s.componentName}},{anchor:p,text:u,host:m,wrapper:y,link:g}=c,b=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:y,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:h.s.cssVarList.textColor}],cursor:p}}),n.VO,n.tQ)(d);o(63595),customElements.define(l,b)},66434(t,e,o){o.d(e,{T:()=>h,s:()=>d});var n=o(88961),s=o(63200),i=o(25964),r=o(72270);const h=(0,i.xE)("text");class l extends((0,r.qu)({componentName:h,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,i.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,i.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:a}={host:{selector:()=>":host"}},d=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...a,property:"width"},hostDirection:{...a,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(l)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},38516(t,e,o){o.r(e),o.d(e,{TooltipClass:()=>u,componentName:()=>l}),o(13094),o(55838),o(17017),o(76720);var n=o(88961),s=o(63200),i=o(25964),r=o(72270),h=o(76231);const l=(0,i.xE)("tooltip"),a=["text","position","hide-delay","hover-delay","opened"];class d extends((0,r.qu)({componentName:l,baseSelector:"vaadin-tooltip"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <descope-anchored>\n <slot></slot>\n <vaadin-tooltip slot="anchored"></vaadin-tooltip>\n </descope-anchored>\n ',this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.tooltip=this.shadowRoot.querySelector("vaadin-tooltip"),this.anchored=this.shadowRoot.querySelector("descope-anchored")}#l(){const t=this.anchored?.classList?.contains("hidden");this.classList.toggle("hidden",t)}static get observedAttributes(){return a.concat(super.observedAttributes||[])}get isOpened(){return"true"===this.getAttribute("opened")}get overlay(){return this.tooltip?._overlayElement}get overlayContentNode(){return this.overlay?.shadowRoot.querySelector('[part="content"]')}get tooltipText(){return this.getAttribute("text")?.trim()||""}get isStaticDisplay(){return"true"===this.getAttribute("static-display")}get srLabel(){return this.tooltip?.querySelector('[slot="sr-label"]')}#f(){this.isStaticDisplay?(this.#x(),this.setAttribute("inert","true")):this.removeAttribute("inert")}#x(){this.overlay&&(this.overlay.style.display="block",this.overlay.style.position="static")}init(){super.init?.(),(0,i.fz)('\n :host {\n display: inline-block;\n }\n vaadin-tooltip {\n display: block;\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n /* Stack anchor above the anchored element so the tooltip flows below it inline. */\n :host([static-display="true"]) descope-anchored::part(root) {\n flex-direction: column;\n }\n :host([static-display="true"]) descope-anchored::part(anchored) {\n position: static;\n inset: unset;\n }\n :host([static-display="true"]) vaadin-tooltip {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n }\n :host([static-display="true"]) vaadin-tooltip [slot="sr-label"] {\n display: none;\n }\n',this),this.defaultSlot.addEventListener("slotchange",()=>this.#N()),this.#N(),this.#l(),setTimeout(()=>this.#w())}#N(){const t=this.defaultSlot?.assignedElements()?.[0];t&&(this.tooltip.target=t)}#w(){this.#k(),this.#S(),(0,i.EA)(this,this.tooltip,{includeAttrs:["position","opened"]}),this.#C()}#A(){this.overlayContentNode.innerHTML=""}#T(){const t=document.createElement("descope-enriched-text");return t.setAttribute("link-target-blank","true"),t.textContent=this.tooltipText,t}#k(){this.overlayContentNode&&setTimeout(()=>{this.#A(),this.textComponent=this.#T(),this.overlayContentNode.appendChild(this.textComponent),this.srLabel&&!this.tooltipText&&this.srLabel.setAttribute("aria-hidden","true"),(0,i.EA)(this,this.textComponent,{includeAttrs:["readonly"]})})}#S(){if(!this.overlay)return;const t=this.overlay._attachOverlay?.bind(this.overlay);this.overlay._detachOverlay=()=>{},this.overlay._attachOverlay=()=>{t?.(),setTimeout(()=>{this.tooltip.shadowRoot.appendChild(this.overlay),this.overlay._updatePosition?.()})},this.isOpened&&setTimeout(()=>{this.tooltip.shadowRoot.appendChild(this.overlay),this.#f(),this.overlay._updatePosition?.()})}#C(){this.tooltip?.toggleAttribute("manual",this.isOpened)}#E(t){if(!this.textComponent)return;const e=(t??"").trim();this.textComponent.textContent=e,this.srLabel&&(e?this.srLabel.removeAttribute("aria-hidden"):this.srLabel.setAttribute("aria-hidden","true"))}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),e!==o&&("text"===t&&this.#E(o),"opened"===t&&this.#C())}}const{overlay:c,content:p}={overlay:{selector:()=>"vaadin-tooltip-overlay::part(overlay)"},content:{selector:()=>"vaadin-tooltip-overlay::part(content)"}},u=(0,s.Zz)(n.tQ,(0,n.mA)({selector:"",mappings:{fontFamily:{...p,property:h.m.cssVarList.fontFamilyOverride},fontSize:{...p,property:h.m.cssVarList.fontSizeOverride},fontWeight:{...p,property:h.m.cssVarList.fontWeightOverride},textColor:{...p,property:h.m.cssVarList.textColorOverride},hostDirection:{...p,property:h.m.cssVarList.hostDirectionOverride},backgroundColor:[{...c},{...p}],borderColor:{...c},borderStyle:{...c},borderWidth:{...c},borderRadius:{...c},boxShadow:{...c},horizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],verticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}]},forward:{attributes:["style"],include:!1}}))(d);customElements.define(l,u)},1508(t,e,o){function n(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}function s(t){const e=[];let o;return"slot"===t.localName?o=t.assignedElements():(e.push(t),o=[...t.children]),o.forEach(t=>e.push(...s(t))),e}function i(t,e){return e?e.closest(t)||i(t,e.getRootNode().host):null}function r(t){return t?new Set(t.split(" ")):new Set}function h(t){return t?[...t].join(" "):""}function l(t,e,o){const n=r(t.getAttribute(e));n.add(o),t.setAttribute(e,h(n))}function a(t,e,o){const n=r(t.getAttribute(e));n.delete(o),0!==n.size?t.setAttribute(e,h(n)):t.removeAttribute(e)}function d(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}o.d(e,{Dy:()=>n,J$:()=>s,Wr:()=>a,Z4:()=>r,ZA:()=>d,el:()=>i,iA:()=>l,sz:()=>h})},44099(t,e,o){o.d(e,{r:()=>r});var n=o(1508),s=o(65641),i=o(11707);class r extends EventTarget{static generateId(t,e){return`${e||"default"}-${t.localName}-${(0,i.I)()}`}constructor(t,e,o,n={}){super();const{initializer:s,multiple:i,observe:r,useUniqueId:h}=n;this.host=t,this.slotName=e,this.tagName=o,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof i&&i,this.slotInitializer=s,i&&(this.nodes=[]),h&&(this.defaultId=this.constructor.generateId(t,e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach(t=>{this.initAddedNode(t)})}attachDefaultNode(){const{host:t,slotName:e,tagName:o}=this;let n=this.defaultNode;return!n&&o&&(n=document.createElement(o),n instanceof Element&&(""!==e&&n.setAttribute("slot",e),this.defaultNode=n)),n&&(this.node=n,t.appendChild(n)),n}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t)}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,o=this.host.shadowRoot.querySelector(e);this.__slotObserver=new s.P(o,({addedNodes:t,removedNodes:e})=>{const o=this.multiple?this.nodes:[this.node],s=t.filter(t=>!(0,n.ZA)(t)&&!o.includes(t));e.length&&(this.nodes=o.filter(t=>!e.includes(t)),e.forEach(t=>{this.teardownNode(t)})),s&&s.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...o,...s].filter(t=>t!==this.defaultNode),s.forEach(t=>{this.initAddedNode(t)})):(this.node&&this.node.remove(),this.node=s[0],this.initAddedNode(this.node)))})}}},65641(t,e,o){o.d(e,{P:()=>n});class n{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const o=[],n=[];t.length&&(e=t.filter(t=>!this._storedNodes.includes(t))),this._storedNodes.length&&this._storedNodes.forEach((e,s)=>{const i=t.indexOf(e);-1===i?o.push(e):i!==s&&n.push(e)}),(e.length||o.length||n.length)&&this.callback({addedNodes:e,movedNodes:n,removedNodes:o}),this._storedNodes=t}}},11707(t,e,o){o.d(e,{I:()=>s});let n=0;function s(){return n++}}}]);
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[628,2294,3267,4159,9261],{13094(t,e,o){o.r(e),o.d(e,{AnchoredClass:()=>a,componentName:()=>h});var n=o(88961),s=o(72270),i=o(25964),r=o(63200);const h=(0,i.xE)("anchored");class l extends((0,s.qu)({componentName:h,baseSelector:".anchored-root"})){#t=null;#e=null;#o=null;get#n(){return this.defaultSlot.assignedElements({flatten:!0})[0]}get#s(){return this.shadowRoot.querySelector('slot[name="anchored"]')?.assignedElements()[0]}get#i(){return this.getRootNode().host}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="anchored-root" part="root">\n <slot></slot>\n <div class="anchored-host" part="anchored">\n <slot name="anchored"></slot>\n </div>\n </div>\n ',this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])")}init(){super.init?.(),(0,i.fz)("\n :host {\n display: inline-flex;\n position: relative;\n box-sizing: border-box;\n }\n\n :host(:not([has-anchor])) {\n display: none;\n }\n\n .anchored-root {\n position: relative;\n display: flex;\n width: 100%;\n min-width: 0;\n }\n\n /* Make anchor fill the flex row and allow it to shrink. */\n ::slotted(*:not([slot])) {\n flex-grow: 1; /* fill the flex row */\n flex-shrink: 1; /* compress when constrained */\n flex-basis: auto; /* start from the anchor's natural size */\n min-width: 0; /* flex items won't shrink below content size without this */\n }\n\n /* Anchored container covers the anchor but is invisible to pointer events. */\n .anchored-host {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n /* Restore interactivity for actual anchored content. */\n ::slotted([slot=\"anchored\"]) {\n pointer-events: auto;\n }\n ",this),this.#r(),this.defaultSlot.addEventListener("slotchange",()=>this.#h()),this.#h()}#l(){const t=this.#n?.classList?.contains("hidden");this.classList.toggle("hidden",t)}#h(){this.#a(),this.#t=this.#d(this.#t,this.#i,"stretch"),this.#e=this.#d(this.#e,this.#s,"st-host-direction")}#r(){const t="\n descope-anchored {\n width: 100%; /* fill the outer host so the anchored element spans the full anchor width */\n }\n :host([stretch]) {\n display: inline-flex; /* switch from inline-block so internal children are flex items */\n width: 100%; /* fill non-flex parents */\n flex-grow: 1; /* absorb extra space in flex parents */\n flex-shrink: 0; /* hold full width — shrink:1 would let siblings squeeze it below 100% */\n flex-basis: auto; /* defer to width:100% on the main axis; avoids forcing 100% height in column-flex parents */\n min-width: 0; /* prevent overflow when the outer host is itself inside a constrained flex row */\n }\n ";this.#o?this.#o.replaceSync(t):this.#i&&(this.#o=(0,i.fz)(t,this.#i))}#d(t,e,o){return t?.disconnect(),e?.removeAttribute(o),this.#n&&e?(0,i.EA)(this.#n,e,{includeAttrs:[o]}):null}disconnectedCallback(){super.disconnectedCallback?.(),this.#t?.disconnect(),this.#e?.disconnect()}#a(){this.toggleAttribute("has-anchor",!!this.#n),this.#l()}}const a=(0,r.Zz)(n.tQ)(l);customElements.define(h,a)},76231(t,e,o){o.d(e,{T:()=>d,m:()=>p});var n=o(92540),s=o(88961),i=o(63200),r=o(36976),h=o(72270),l=o(54847),a=o(25964);const d=(0,a.xE)("enriched-text");class c extends((0,h.qu)({componentName:d,baseSelector:":host > div"})){#c;#p;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,a.fz)("\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n ",this),this.#u(),(0,a.Ge)(this,this.#m.bind(this)),this.contentNode?.addEventListener("click",t=>{t.target instanceof HTMLAnchorElement&&t.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),o!==e&&("readonly"===t&&this.onReadOnlyChange("true"===o),"link-target-blank"===t&&this.#u())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,o,n,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#p(t,e,o,n,s)),this.processor.renderer.rules.em_close=(t,e,o,n,s)=>("_"===t[e].markup&&(t[e].tag="u"),this.#p(t,e,o,n,s))}#y(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,o,n,s)=>(t[e].attrSet("target","_blank"),this.#c(t,e,o,n,s)):this.processor.renderer.rules.link_open=this.#c}#g(){this.processor&&this.processor.disable(r.M)}#b(){this.#g()}#v(){this.#c=this.processor.renderer.rules.link_open||((t,e,o,n,s)=>s.renderToken(t,e,o)),this.#p=this.processor.renderer.rules.em_open||((t,e,o,n,s)=>s.renderToken(t,e,o))}#u(){this.processor=new n.A("commonmark",{html:!0}),this.#v(),this.#b(),this.#y(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#m(){if(!this.processor)return;let t=(0,l.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch(t){console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t,this.contentNode.firstChild?.setAttribute("part","content")}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):this.contentNode.removeAttribute("inert")}}const p=(0,i.Zz)((0,s.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDisplay:{selector:()=>":host",property:"display",fallback:"inline-block"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},fontWeightBold:[{selector:()=>":host strong",property:"font-weight"},{selector:()=>":host b",property:"font-weight"}],textColor:{property:"color"},textLineHeight:{property:"line-height"},textAlign:{},linkColor:{selector:"a",property:"color"},linkTextDecoration:{selector:"a",property:"text-decoration"},linkHoverTextDecoration:{selector:"a:hover",property:"text-decoration"},minHeight:{},minWidth:{}}}),(0,s.RF)({componentNameOverride:(0,a.xE)("link")}),(0,s.RF)({componentNameOverride:(0,a.xE)("text")}),s.VO,s.tQ)(c)},36976(t,e,o){o.d(e,{M:()=>n});const n=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(t,e,o){o.d(e,{G:()=>n});const n=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838(t,e,o){o.r(e),o.d(e,{EnrichedTextClass:()=>n.m,componentName:()=>n.T}),o(90512);var n=o(76231);customElements.define(n.T,n.m)},75464(t,e,o){o.d(e,{J:()=>b,T:()=>l});var n=o(88961),s=o(63200),i=o(25964),r=o(72270),h=o(66434);const l=(0,i.xE)("link"),a=["href","readonly"];class d extends((0,r.qu)({componentName:l,baseSelector:":host a"})){static get observedAttributes(){return a.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t',(0,i.fz)('\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,i.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,i.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>h.s.componentName}},{anchor:p,text:u,host:m,wrapper:y,link:g}=c,b=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:y,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:h.s.cssVarList.textColor}],cursor:p}}),n.VO,n.tQ)(d)},90512(t,e,o){o.r(e),o.d(e,{LinkClass:()=>n.J,componentName:()=>n.T});var n=o(75464);o(63595),customElements.define(n.T,n.J)},66434(t,e,o){o.d(e,{T:()=>h,s:()=>d});var n=o(88961),s=o(63200),i=o(25964),r=o(72270);const h=(0,i.xE)("text");class l extends((0,r.qu)({componentName:h,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,i.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,i.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:a}={host:{selector:()=>":host"}},d=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...a,property:"width"},hostDirection:{...a,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(l)},63595(t,e,o){o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},38516(t,e,o){o.r(e),o.d(e,{TooltipClass:()=>u,componentName:()=>l}),o(13094),o(55838),o(17017),o(76720);var n=o(88961),s=o(63200),i=o(25964),r=o(72270),h=o(76231);const l=(0,i.xE)("tooltip"),a=["text","position","hide-delay","hover-delay","opened"];class d extends((0,r.qu)({componentName:l,baseSelector:"vaadin-tooltip"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <descope-anchored>\n <slot></slot>\n <vaadin-tooltip slot="anchored"></vaadin-tooltip>\n </descope-anchored>\n ',this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.tooltip=this.shadowRoot.querySelector("vaadin-tooltip"),this.anchored=this.shadowRoot.querySelector("descope-anchored")}#l(){const t=this.anchored?.classList?.contains("hidden");this.classList.toggle("hidden",t)}static get observedAttributes(){return a.concat(super.observedAttributes||[])}get isOpened(){return"true"===this.getAttribute("opened")}get overlay(){return this.tooltip?._overlayElement}get overlayContentNode(){return this.overlay?.shadowRoot.querySelector('[part="content"]')}get tooltipText(){return this.getAttribute("text")?.trim()||""}get isStaticDisplay(){return"true"===this.getAttribute("static-display")}get srLabel(){return this.tooltip?.querySelector('[slot="sr-label"]')}#f(){this.isStaticDisplay?(this.#x(),this.setAttribute("inert","true")):this.removeAttribute("inert")}#x(){this.overlay&&(this.overlay.style.display="block",this.overlay.style.position="static")}init(){super.init?.(),(0,i.fz)('\n :host {\n display: inline-block;\n }\n vaadin-tooltip {\n display: block;\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n /* Stack anchor above the anchored element so the tooltip flows below it inline. */\n :host([static-display="true"]) descope-anchored::part(root) {\n flex-direction: column;\n }\n :host([static-display="true"]) descope-anchored::part(anchored) {\n position: static;\n inset: unset;\n }\n :host([static-display="true"]) vaadin-tooltip {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n }\n :host([static-display="true"]) vaadin-tooltip [slot="sr-label"] {\n display: none;\n }\n',this),this.defaultSlot.addEventListener("slotchange",()=>this.#N()),this.#N(),this.#l(),setTimeout(()=>this.#w())}#N(){const t=this.defaultSlot?.assignedElements()?.[0];t&&(this.tooltip.target=t)}#w(){this.#k(),this.#S(),(0,i.EA)(this,this.tooltip,{includeAttrs:["position","opened"]}),this.#C()}#A(){this.overlayContentNode.innerHTML=""}#T(){const t=document.createElement("descope-enriched-text");return t.setAttribute("link-target-blank","true"),t.textContent=this.tooltipText,t}#k(){this.overlayContentNode&&setTimeout(()=>{this.#A(),this.textComponent=this.#T(),this.overlayContentNode.appendChild(this.textComponent),this.srLabel&&!this.tooltipText&&this.srLabel.setAttribute("aria-hidden","true"),(0,i.EA)(this,this.textComponent,{includeAttrs:["readonly"]})})}#S(){if(!this.overlay)return;const t=this.overlay._attachOverlay?.bind(this.overlay);this.overlay._detachOverlay=()=>{},this.overlay._attachOverlay=()=>{t?.(),setTimeout(()=>{this.tooltip.shadowRoot.appendChild(this.overlay),this.overlay._updatePosition?.()})},this.isOpened&&setTimeout(()=>{this.tooltip.shadowRoot.appendChild(this.overlay),this.#f(),this.overlay._updatePosition?.()})}#C(){this.tooltip?.toggleAttribute("manual",this.isOpened)}#E(t){if(!this.textComponent)return;const e=(t??"").trim();this.textComponent.textContent=e,this.srLabel&&(e?this.srLabel.removeAttribute("aria-hidden"):this.srLabel.setAttribute("aria-hidden","true"))}attributeChangedCallback(t,e,o){super.attributeChangedCallback?.(t,e,o),e!==o&&("text"===t&&this.#E(o),"opened"===t&&this.#C())}}const{overlay:c,content:p}={overlay:{selector:()=>"vaadin-tooltip-overlay::part(overlay)"},content:{selector:()=>"vaadin-tooltip-overlay::part(content)"}},u=(0,s.Zz)(n.tQ,(0,n.mA)({selector:"",mappings:{fontFamily:{...p,property:h.m.cssVarList.fontFamilyOverride},fontSize:{...p,property:h.m.cssVarList.fontSizeOverride},fontWeight:{...p,property:h.m.cssVarList.fontWeightOverride},textColor:{...p,property:h.m.cssVarList.textColorOverride},hostDirection:{...p,property:h.m.cssVarList.hostDirectionOverride},backgroundColor:[{...c},{...p}],borderColor:{...c},borderStyle:{...c},borderWidth:{...c},borderRadius:{...c},boxShadow:{...c},horizontalPadding:[{...p,property:"padding-left"},{...p,property:"padding-right"}],verticalPadding:[{...p,property:"padding-top"},{...p,property:"padding-bottom"}]},forward:{attributes:["style"],include:!1}}))(d);customElements.define(l,u)},1508(t,e,o){function n(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}function s(t){const e=[];let o;return"slot"===t.localName?o=t.assignedElements():(e.push(t),o=[...t.children]),o.forEach(t=>e.push(...s(t))),e}function i(t,e){return e?e.closest(t)||i(t,e.getRootNode().host):null}function r(t){return t?new Set(t.split(" ")):new Set}function h(t){return t?[...t].join(" "):""}function l(t,e,o){const n=r(t.getAttribute(e));n.add(o),t.setAttribute(e,h(n))}function a(t,e,o){const n=r(t.getAttribute(e));n.delete(o),0!==n.size?t.setAttribute(e,h(n)):t.removeAttribute(e)}function d(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}o.d(e,{Dy:()=>n,J$:()=>s,Wr:()=>a,Z4:()=>r,ZA:()=>d,el:()=>i,iA:()=>l,sz:()=>h})},44099(t,e,o){o.d(e,{r:()=>r});var n=o(1508),s=o(65641),i=o(11707);class r extends EventTarget{static generateId(t,e){return`${e||"default"}-${t.localName}-${(0,i.I)()}`}constructor(t,e,o,n={}){super();const{initializer:s,multiple:i,observe:r,useUniqueId:h}=n;this.host=t,this.slotName=e,this.tagName=o,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof i&&i,this.slotInitializer=s,i&&(this.nodes=[]),h&&(this.defaultId=this.constructor.generateId(t,e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach(t=>{this.initAddedNode(t)})}attachDefaultNode(){const{host:t,slotName:e,tagName:o}=this;let n=this.defaultNode;return!n&&o&&(n=document.createElement(o),n instanceof Element&&(""!==e&&n.setAttribute("slot",e),this.defaultNode=n)),n&&(this.node=n,t.appendChild(n)),n}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t)}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,o=this.host.shadowRoot.querySelector(e);this.__slotObserver=new s.P(o,({addedNodes:t,removedNodes:e})=>{const o=this.multiple?this.nodes:[this.node],s=t.filter(t=>!(0,n.ZA)(t)&&!o.includes(t));e.length&&(this.nodes=o.filter(t=>!e.includes(t)),e.forEach(t=>{this.teardownNode(t)})),s&&s.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...o,...s].filter(t=>t!==this.defaultNode),s.forEach(t=>{this.initAddedNode(t)})):(this.node&&this.node.remove(),this.node=s[0],this.initAddedNode(this.node)))})}}},65641(t,e,o){o.d(e,{P:()=>n});class n{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const o=[],n=[];t.length&&(e=t.filter(t=>!this._storedNodes.includes(t))),this._storedNodes.length&&this._storedNodes.forEach((e,s)=>{const i=t.indexOf(e);-1===i?o.push(e):i!==s&&n.push(e)}),(e.length||o.length||n.length)&&this.callback({addedNodes:e,movedNodes:n,removedNodes:o}),this._storedNodes=t}}},11707(t,e,o){o.d(e,{I:()=>s});let n=0;function s(){return n++}}}]);
3
3
  //# sourceMappingURL=descope-tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-tooltip.js","mappings":";iQASO,MAAMA,GAAgB,QAAiB,YAE9C,MAAMC,WAAoB,QAAgB,CACxCD,gBACAE,aAAc,oBAEd,GAAmB,KAEnB,GAAqB,KAErB,GAAoB,KAEpB,KAAI,GACF,OAAOC,KAAKC,YAAYC,iBAAiB,CAAEC,SAAS,IAAQ,EAC9D,CAEA,KAAI,GACF,OAAOH,KAAKI,WACTC,cAAc,0BACbH,mBAAmB,EACzB,CAEA,KAAI,GACF,OAAOF,KAAKM,cAAcC,IAC5B,CAEA,WAAAC,GACEC,QAEAT,KAAKU,aAAa,CAAEC,KAAM,SAAUC,UAAY,2MAShDZ,KAAKC,YAAcD,KAAKI,WAAWC,cAAc,mBACnD,CAEA,IAAAQ,GACEJ,MAAMI,UAEN,QACE,0iCAsCAb,MAGFA,MAAK,IAELA,KAAKC,YAAYa,iBAAiB,aAAc,IAAMd,MAAK,KAE3DA,MAAK,GACP,CAIA,KACE,MAAMe,EAAYf,MAAK,GAASgB,WAAWC,SAAS,UACpDjB,KAAKgB,UAAUE,OAAO,SAAUH,EAClC,CAEA,KACEf,MAAK,IAELA,MAAK,EAAmBA,MAAK,EAC3BA,MAAK,EACLA,MAAK,EACL,WAGFA,MAAK,EAAqBA,MAAK,EAC7BA,MAAK,EACLA,MAAK,EACL,oBAEJ,CAIA,KACE,MAAMmB,EAAM,yvBAcRnB,MAAK,EACPA,MAAK,EAAkBoB,YAAYD,GAC1BnB,MAAK,IACdA,MAAK,GAAoB,QAAYmB,EAAKnB,MAAK,GAEnD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PzP,KAAK0P,UACL1P,KAAKyP,WACP,CAOA,OAAAC,GACE1P,KAAKwO,KAAK1N,iBAAiB,aAAcd,KAAKwP,gBAC9CxP,KAAKsP,YAAa,CACpB,CAOA,UAAA9N,GACExB,KAAKwO,KAAKmB,oBAAoB,aAAc3P,KAAKwP,gBACjDxP,KAAKsP,YAAa,CACpB,CAGA,SAAAG,GACOzP,KAAKuP,aACRvP,KAAKuP,YAAa,EAElBK,eAAe,KACb5P,KAAK6P,UAGX,CAKA,KAAAA,GACO7P,KAAKsP,aAIVtP,KAAKuP,YAAa,EAElBvP,KAAK8P,gBACP,CAGA,aAAAA,GACE,MAAMC,EAAe/P,KAAKwO,KAAKwB,cAAc,CAAE7P,SAAS,IAExD,IAAI0O,EAAa,GACjB,MAAMC,EAAe,GACfmB,EAAa,GAEfF,EAAalI,SACfgH,EAAakB,EAAazB,OAAQ1D,IAAU5K,KAAKqP,aAAaJ,SAASrE,KAGrE5K,KAAKqP,aAAaxH,QACpB7H,KAAKqP,aAAa5D,QAAQ,CAACb,EAAMsF,KAC/B,MAAMhN,EAAM6M,EAAaI,QAAQvF,IACpB,IAAT1H,EACF4L,EAAa7D,KAAKL,GACT1H,IAAQgN,GACjBD,EAAWhF,KAAKL,MAKlBiE,EAAWhH,QAAUiH,EAAajH,QAAUoI,EAAWpI,SACzD7H,KAAKoP,SAAS,CAAEP,aAAYoB,aAAYnB,iBAG1C9O,KAAKqP,aAAeU,CACtB,E,gCCjGF,IAAIK,EAAW,EAgBR,SAASC,IAEd,OAAOD,GACT,C","sources":["webpack://@descope/web-components-ui/../components/descope-anchored/src/component/AnchoredClass.js","webpack://@descope/web-components-ui/../components/descope-anchored/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/consts.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/TooltipClass.js","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/dom-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-observer.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/unique-id-utils.js"],"sourcesContent":["import { componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('anchored');\n\nclass RawAnchored extends createBaseClass({\n componentName,\n baseSelector: '.anchored-root',\n}) {\n #stretchObserver = null;\n\n #directionObserver = null;\n\n #hostStretchSheet = null;\n\n get #anchor() {\n return this.defaultSlot.assignedElements({ flatten: true })[0];\n }\n\n get #anchored() {\n return this.shadowRoot\n .querySelector('slot[name=\"anchored\"]')\n ?.assignedElements()[0];\n }\n\n get #outerHost() {\n return this.getRootNode().host;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"anchored-root\" part=\"root\">\n <slot></slot>\n <div class=\"anchored-host\" part=\"anchored\">\n <slot name=\"anchored\"></slot>\n </div>\n </div>\n `;\n\n this.defaultSlot = this.shadowRoot.querySelector('slot:not([name])');\n }\n\n init() {\n super.init?.();\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n position: relative;\n box-sizing: border-box;\n }\n\n :host(:not([has-anchor])) {\n display: none;\n }\n\n .anchored-root {\n position: relative;\n display: flex;\n width: 100%;\n min-width: 0;\n }\n\n /* Make anchor fill the flex row and allow it to shrink. */\n ::slotted(*:not([slot])) {\n flex-grow: 1; /* fill the flex row */\n flex-shrink: 1; /* compress when constrained */\n flex-basis: auto; /* start from the anchor's natural size */\n min-width: 0; /* flex items won't shrink below content size without this */\n }\n\n /* Anchored container covers the anchor but is invisible to pointer events. */\n .anchored-host {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n /* Restore interactivity for actual anchored content. */\n ::slotted([slot=\"anchored\"]) {\n pointer-events: auto;\n }\n `,\n this,\n );\n\n this.#syncStretchCSS();\n\n this.defaultSlot.addEventListener('slotchange', () => this.#syncAnchor());\n\n this.#syncAnchor();\n }\n\n // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.\n // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.\n #syncComponentState() {\n const hasHidden = this.#anchor?.classList?.contains('hidden');\n this.classList.toggle('hidden', hasHidden);\n }\n\n #syncAnchor() {\n this.#onAnchorChanged();\n\n this.#stretchObserver = this.#forwardAttr(\n this.#stretchObserver,\n this.#outerHost,\n 'stretch',\n );\n\n this.#directionObserver = this.#forwardAttr(\n this.#directionObserver,\n this.#anchored,\n 'st-host-direction',\n );\n }\n\n // Injects [stretch] layout rules into the containing component's shadow root (e.g. descope-attachment)\n // so it stretches when the anchor has [stretch]. Replaces the existing rules on subsequent calls.\n #syncStretchCSS() {\n const css = `\n descope-anchored {\n width: 100%; /* fill the outer host so the anchored element spans the full anchor width */\n }\n :host([stretch]) {\n display: inline-flex; /* switch from inline-block so internal children are flex items */\n width: 100%; /* fill non-flex parents */\n flex-grow: 1; /* absorb extra space in flex parents */\n flex-shrink: 0; /* hold full width — shrink:1 would let siblings squeeze it below 100% */\n flex-basis: auto; /* defer to width:100% on the main axis; avoids forcing 100% height in column-flex parents */\n min-width: 0; /* prevent overflow when the outer host is itself inside a constrained flex row */\n }\n `;\n\n if (this.#hostStretchSheet) {\n this.#hostStretchSheet.replaceSync(css);\n } else if (this.#outerHost) {\n this.#hostStretchSheet = injectStyle(css, this.#outerHost);\n }\n }\n\n // Reconnects forwarding to the current anchor. Disconnects the old observer and\n // removes the stale attr from target first — forwardAttrs only sets attrs present\n // on the source, so absent attrs won't be removed automatically.\n #forwardAttr(observer, target, attr) {\n observer?.disconnect();\n target?.removeAttribute(attr);\n if (!this.#anchor || !target) return null;\n return forwardAttrs(this.#anchor, target, { includeAttrs: [attr] });\n }\n\n // Prevent stale callbacks from firing on a detached anchor after removal.\n disconnectedCallback() {\n super.disconnectedCallback?.();\n this.#stretchObserver?.disconnect();\n this.#directionObserver?.disconnect();\n }\n\n // Track whether anything is slotted, so the host display rule can hide an\n // empty host rather than reserving its layout box.\n #onAnchorChanged() {\n this.toggleAttribute('has-anchor', !!this.#anchor);\n this.#syncComponentState();\n }\n}\n\nexport const AnchoredClass = compose(componentNameValidationMixin)(RawAnchored);\n","import { componentName, AnchoredClass } from './AnchoredClass';\n\ncustomElements.define(componentName, AnchoredClass);\n\nexport { AnchoredClass, componentName };\n","/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n\n // Stop propagation on link clicks to prevent parent handlers from firing\n this.contentNode?.addEventListener('click', (e) => {\n if (e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\n }\n\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n this.contentNode.firstChild?.setAttribute('part', 'content');\n }\n\n onReadOnlyChange(isReadOnly) {\n if (isReadOnly) {\n this.contentNode.setAttribute('inert', isReadOnly);\n } else {\n this.contentNode.removeAttribute('inert');\n }\n }\n}\n\nexport const EnrichedTextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDisplay: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n","export const disableRules = [\n 'blockquote',\n 'list',\n 'image',\n 'table',\n 'code',\n 'hr',\n 'backticks',\n 'fence',\n 'reference',\n 'heading',\n 'lheading',\n 'html_block',\n];\n","export const decodeHTML = (html) => {\n const textArea = document.createElement('textarea');\n textArea.innerHTML = html;\n return textArea.value;\n};\n","import '@descope-ui/descope-link';\n\nimport { componentName, EnrichedTextClass } from './EnrichedTextClass';\n\ncustomElements.define(componentName, EnrichedTextClass);\n\nexport { EnrichedTextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nconst observedAttrs = ['href', 'readonly'];\n\nclass RawLink extends createBaseClass({\n componentName,\n baseSelector: ':host a',\n}) {\n static get observedAttributes() {\n return observedAttrs.concat(super.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text part=\"wrapper\">\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n\n :host([ellipsis=\"true\"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis=\"true\"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n `,\n this,\n );\n\n this.anchor = this.shadowRoot.querySelector('a');\n\n forwardAttrs(this, this.anchor, {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n\n this.anchor.addEventListener('click', (e) => {\n if (this.readOnly) {\n e.preventDefault();\n }\n });\n }\n\n get readOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: {\n ...link,\n property: 'text-decoration',\n fallback: 'none',\n },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n componentNameValidationMixin,\n portalMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\n\nexport const componentName = getComponentName('tooltip');\n\nconst tooltipAttrs = [\n 'text',\n 'position',\n 'hide-delay',\n 'hover-delay',\n 'opened',\n];\n\nclass RawTooltip extends createBaseClass({\n componentName,\n baseSelector: 'vaadin-tooltip',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <descope-anchored>\n <slot></slot>\n <vaadin-tooltip slot=\"anchored\"></vaadin-tooltip>\n </descope-anchored>\n `;\n\n this.defaultSlot = this.shadowRoot.querySelector('slot:not([name])');\n this.tooltip = this.shadowRoot.querySelector('vaadin-tooltip');\n\n this.anchored = this.shadowRoot.querySelector('descope-anchored');\n }\n\n // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.\n // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.\n #syncComponentState() {\n const hasHidden = this.anchored?.classList?.contains('hidden');\n this.classList.toggle('hidden', hasHidden);\n }\n\n static get observedAttributes() {\n return tooltipAttrs.concat(super.observedAttributes || []);\n }\n\n get isOpened() {\n return this.getAttribute('opened') === 'true';\n }\n\n get overlay() {\n return this.tooltip?._overlayElement;\n }\n\n get overlayContentNode() {\n return this.overlay?.shadowRoot.querySelector('[part=\"content\"]');\n }\n\n get tooltipText() {\n return this.getAttribute('text')?.trim() || '';\n }\n\n get isStaticDisplay() {\n return this.getAttribute('static-display') === 'true';\n }\n\n get srLabel() {\n return this.tooltip?.querySelector('[slot=\"sr-label\"]');\n }\n\n // We use `static-display` for presentation purposes, to show the tooltip content.\n // This should be used only when `opened` is `true`. Once `static-display` is set,\n // the overlay flows in-line and has layout in the presenting page. Mainly aimed\n // to solve the presentation problem on our Styles Page in the Console.\n #handleStaticDisplay() {\n if (this.isStaticDisplay) {\n this.#revealOverlay();\n this.setAttribute('inert', 'true');\n } else {\n this.removeAttribute('inert');\n }\n }\n\n #revealOverlay() {\n if (!this.overlay) return;\n // Keep the overlay in vaadin-tooltip.shadowRoot so adopted stylesheets from\n // portalMixin continue to apply (they are scoped to that shadow root).\n // Layout is handled via CSS: anchored-root becomes a column, vaadin-tooltip\n // becomes a visible block below the anchor, and the sr-label is hidden.\n this.overlay.style.display = 'block';\n this.overlay.style.position = 'static';\n }\n\n init() {\n super.init?.();\n\n injectStyle(\n `\n :host {\n display: inline-block;\n }\n vaadin-tooltip {\n display: block;\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n /* Stack anchor above the anchored element so the tooltip flows below it inline. */\n :host([static-display=\"true\"]) descope-anchored::part(root) {\n flex-direction: column;\n }\n :host([static-display=\"true\"]) descope-anchored::part(anchored) {\n position: static;\n inset: unset;\n }\n :host([static-display=\"true\"]) vaadin-tooltip {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n }\n :host([static-display=\"true\"]) vaadin-tooltip [slot=\"sr-label\"] {\n display: none;\n }\n`,\n this,\n );\n\n this.defaultSlot.addEventListener('slotchange', () =>\n this.#setTooltipTarget(),\n );\n this.#setTooltipTarget();\n\n this.#syncComponentState();\n\n setTimeout(() => this.#onOverlayReady());\n }\n\n #setTooltipTarget() {\n const target = this.defaultSlot?.assignedElements()?.[0];\n if (!target) return;\n this.tooltip.target = target;\n }\n\n #onOverlayReady() {\n this.#initTooltipTextComponent();\n this.#overrideAttachOverlay();\n\n forwardAttrs(this, this.tooltip, {\n includeAttrs: ['position', 'opened'],\n });\n\n this.#handleTooltipVisibility();\n }\n\n #clearOverlayContentNode() {\n this.overlayContentNode.innerHTML = '';\n }\n\n #createEnrichedTextComponent() {\n const enrichedText = document.createElement('descope-enriched-text');\n\n enrichedText.setAttribute('link-target-blank', 'true');\n enrichedText.textContent = this.tooltipText;\n\n return enrichedText;\n }\n\n #initTooltipTextComponent() {\n if (!this.overlayContentNode) return;\n\n setTimeout(() => {\n this.#clearOverlayContentNode();\n\n this.textComponent = this.#createEnrichedTextComponent();\n\n this.overlayContentNode.appendChild(this.textComponent);\n\n // An empty sr-label with role=\"tooltip\" fails accessibility checks.\n // Hide it when there's no tooltip text; vaadin handles populating it when text is present.\n if (this.srLabel && !this.tooltipText) {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['readonly'],\n });\n });\n }\n\n // The default vaadin behavior is to attach the overlay to the body when opened,\n // which makes it hard to style. We move the overlay into our shadow root instead.\n // Critical: vaadin computes position against the overlay's offsetParent — moving\n // it changes that context, so we must call `_updatePosition()` afterwards.\n // That's vaadin's own position-recompute method (the same one its resize/scroll\n // listeners use internally), so we get the right reposition without dispatching\n // global events.\n #overrideAttachOverlay() {\n if (!this.overlay) return;\n\n const originalAttach = this.overlay._attachOverlay?.bind(this.overlay);\n\n this.overlay._detachOverlay = () => {};\n this.overlay._attachOverlay = () => {\n originalAttach?.();\n setTimeout(() => {\n this.tooltip.shadowRoot.appendChild(this.overlay);\n this.overlay._updatePosition?.();\n });\n };\n\n if (this.isOpened) {\n // When `opened` attr is set at init, vaadin renders the overlay at the top\n // level without calling `_attachOverlay`. Move it back into our shadow root.\n setTimeout(() => {\n this.tooltip.shadowRoot.appendChild(this.overlay);\n this.#handleStaticDisplay();\n this.overlay._updatePosition?.();\n });\n }\n }\n\n #handleTooltipVisibility() {\n // This is Vaadin's API for manual control of tooltip visibility\n this.tooltip?.toggleAttribute('manual', this.isOpened);\n }\n\n #updateText(value) {\n if (!this.textComponent) return;\n const trimmedValue = (value ?? '').trim();\n this.textComponent.textContent = trimmedValue;\n if (this.srLabel) {\n if (trimmedValue) {\n this.srLabel.removeAttribute('aria-hidden');\n } else {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'text') {\n this.#updateText(newValue);\n }\n\n if (attrName === 'opened') {\n this.#handleTooltipVisibility();\n }\n }\n }\n}\n\nconst { overlay, content } = {\n overlay: { selector: () => 'vaadin-tooltip-overlay::part(overlay)' },\n content: { selector: () => 'vaadin-tooltip-overlay::part(content)' },\n};\n\nexport const TooltipClass = compose(\n componentNameValidationMixin,\n portalMixin({\n selector: '',\n mappings: {\n fontFamily: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontFamilyOverride,\n },\n fontSize: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontSizeOverride,\n },\n fontWeight: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontWeightOverride,\n },\n textColor: {\n ...content,\n property: EnrichedTextClass.cssVarList.textColorOverride,\n },\n hostDirection: {\n ...content,\n property: EnrichedTextClass.cssVarList.hostDirectionOverride,\n },\n backgroundColor: [{ ...overlay }, { ...content }],\n borderColor: { ...overlay },\n borderStyle: { ...overlay },\n borderWidth: { ...overlay },\n borderRadius: { ...overlay },\n boxShadow: { ...overlay },\n horizontalPadding: [\n { ...content, property: 'padding-left' },\n { ...content, property: 'padding-right' },\n ],\n verticalPadding: [\n { ...content, property: 'padding-top' },\n { ...content, property: 'padding-bottom' },\n ],\n },\n forward: {\n attributes: ['style'],\n include: false,\n },\n }),\n)(RawTooltip);\n","import '@descope-ui/descope-anchored';\nimport '@descope-ui/descope-enriched-text';\nimport '@vaadin/tooltip';\nimport { componentName, TooltipClass } from './TooltipClass';\n\ncustomElements.define(componentName, TooltipClass);\n\nexport { TooltipClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Returns an array of ancestor root nodes for the given node.\n *\n * A root node is either a document node or a document fragment node (Shadow Root).\n * The array is collected by a bottom-up DOM traversing that starts with the given node\n * and involves both the light DOM and ancestor shadow DOM trees.\n *\n * @param {Node} node\n * @return {Node[]}\n */\nexport function getAncestorRootNodes(node) {\n const result = [];\n\n while (node) {\n if (node.nodeType === Node.DOCUMENT_NODE) {\n result.push(node);\n break;\n }\n\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result.push(node);\n node = node.host;\n continue;\n }\n\n if (node.assignedSlot) {\n node = node.assignedSlot;\n continue;\n }\n\n node = node.parentNode;\n }\n\n return result;\n}\n\n/**\n * Returns the list of flattened elements for the given `node`.\n * This list consists of a node's children and, for any children that are\n * `<slot>` elements, the expanded flattened list of `assignedElements`.\n *\n * @param {Node} node\n * @return {Element[]}\n */\nexport function getFlattenedElements(node) {\n const result = [];\n let elements;\n if (node.localName === 'slot') {\n elements = node.assignedElements();\n } else {\n result.push(node);\n elements = [...node.children];\n }\n elements.forEach((elem) => result.push(...getFlattenedElements(elem)));\n return result;\n}\n\n/**\n * Traverses the given node and its parents, including those that are across\n * the shadow root boundaries, until it finds a node that matches the selector.\n *\n * @param {string} selector The CSS selector to match against\n * @param {Node} node The starting node for the traversal\n * @return {Node | null} The closest matching element, or null if no match is found\n */\nexport function getClosestElement(selector, node) {\n if (!node) {\n return null;\n }\n\n return node.closest(selector) || getClosestElement(selector, node.getRootNode().host);\n}\n\n/**\n * Takes a string with values separated by space and returns a set the values\n *\n * @param {string} value\n * @return {Set<string>}\n */\nexport function deserializeAttributeValue(value) {\n if (!value) {\n return new Set();\n }\n\n return new Set(value.split(' '));\n}\n\n/**\n * Takes a set of string values and returns a string with values separated by space\n *\n * @param {Set<string>} values\n * @return {string}\n */\nexport function serializeAttributeValue(values) {\n return values ? [...values].join(' ') : '';\n}\n\n/**\n * Adds a value to an attribute containing space-delimited values.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function addValueToAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.add(value);\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Removes a value from an attribute containing space-delimited values.\n * If the value is the last one, the whole attribute is removed.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function removeValueFromAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.delete(value);\n if (values.size === 0) {\n element.removeAttribute(attr);\n return;\n }\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Returns true if the given node is an empty text node, false otherwise.\n *\n * @param {Node} node\n * @return {boolean}\n */\nexport function isEmptyTextNode(node) {\n return node.nodeType === Node.TEXT_NODE && node.textContent.trim() === '';\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { isEmptyTextNode } from './dom-utils.js';\nimport { SlotObserver } from './slot-observer.js';\nimport { generateUniqueId } from './unique-id-utils.js';\n\n/**\n * A controller for providing content to slot element and observing changes.\n */\nexport class SlotController extends EventTarget {\n /**\n * Ensure that every instance has unique ID.\n *\n * @param {HTMLElement} host\n * @param {string} slotName\n * @return {string}\n * @protected\n */\n static generateId(host, slotName) {\n const prefix = slotName || 'default';\n return `${prefix}-${host.localName}-${generateUniqueId()}`;\n }\n\n constructor(host, slotName, tagName, config = {}) {\n super();\n\n const { initializer, multiple, observe, useUniqueId } = config;\n\n this.host = host;\n this.slotName = slotName;\n this.tagName = tagName;\n this.observe = typeof observe === 'boolean' ? observe : true;\n this.multiple = typeof multiple === 'boolean' ? multiple : false;\n this.slotInitializer = initializer;\n\n if (multiple) {\n this.nodes = [];\n }\n\n // Only generate the default ID if requested by the controller.\n if (useUniqueId) {\n this.defaultId = this.constructor.generateId(host, slotName);\n }\n }\n\n hostConnected() {\n if (!this.initialized) {\n if (this.multiple) {\n this.initMultiple();\n } else {\n this.initSingle();\n }\n\n if (this.observe) {\n this.observeSlot();\n }\n\n this.initialized = true;\n }\n }\n\n /** @protected */\n initSingle() {\n let node = this.getSlotChild();\n\n if (!node) {\n node = this.attachDefaultNode();\n this.initNode(node);\n } else {\n this.node = node;\n this.initAddedNode(node);\n }\n }\n\n /** @protected */\n initMultiple() {\n const children = this.getSlotChildren();\n\n if (children.length === 0) {\n const defaultNode = this.attachDefaultNode();\n if (defaultNode) {\n this.nodes = [defaultNode];\n this.initNode(defaultNode);\n }\n } else {\n this.nodes = children;\n children.forEach((node) => {\n this.initAddedNode(node);\n });\n }\n }\n\n /**\n * Create and attach default node using the provided tag name, if any.\n * @return {Node | undefined}\n * @protected\n */\n attachDefaultNode() {\n const { host, slotName, tagName } = this;\n\n // Check if the node was created previously and if so, reuse it.\n let node = this.defaultNode;\n\n // Tag name is optional, sometimes we don't init default content.\n if (!node && tagName) {\n node = document.createElement(tagName);\n if (node instanceof Element) {\n if (slotName !== '') {\n node.setAttribute('slot', slotName);\n }\n this.defaultNode = node;\n }\n }\n\n if (node) {\n this.node = node;\n host.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * Return the list of nodes matching the slot managed by the controller.\n * @return {Node}\n */\n getSlotChildren() {\n const { slotName } = this;\n return Array.from(this.host.childNodes).filter((node) => {\n // Either an element (any slot) or a text node (only un-named slot).\n return (\n (node.nodeType === Node.ELEMENT_NODE && node.slot === slotName) ||\n (node.nodeType === Node.TEXT_NODE && node.textContent.trim() && slotName === '')\n );\n });\n }\n\n /**\n * Return a reference to the node managed by the controller.\n * @return {Node}\n */\n getSlotChild() {\n return this.getSlotChildren()[0];\n }\n\n /**\n * Run `slotInitializer` for the node managed by the controller.\n *\n * @param {Node} node\n * @protected\n */\n initNode(node) {\n const { slotInitializer } = this;\n // Don't try to bind `this` to initializer (normally it's arrow function).\n // Instead, pass the host as a first argument to access component's state.\n if (slotInitializer) {\n slotInitializer(node, this.host);\n }\n }\n\n /**\n * Override to initialize the newly added custom node.\n *\n * @param {Node} _node\n * @protected\n */\n initCustomNode(_node) {}\n\n /**\n * Override to teardown slotted node when it's removed.\n *\n * @param {Node} _node\n * @protected\n */\n teardownNode(_node) {}\n\n /**\n * Run both `initCustomNode` and `initNode` for a custom slotted node.\n *\n * @param {Node} node\n * @protected\n */\n initAddedNode(node) {\n if (node !== this.defaultNode) {\n this.initCustomNode(node);\n this.initNode(node);\n }\n }\n\n /**\n * Setup the observer to manage slot content changes.\n * @protected\n */\n observeSlot() {\n const { slotName } = this;\n const selector = slotName === '' ? 'slot:not([name])' : `slot[name=${slotName}]`;\n const slot = this.host.shadowRoot.querySelector(selector);\n\n this.__slotObserver = new SlotObserver(slot, ({ addedNodes, removedNodes }) => {\n const current = this.multiple ? this.nodes : [this.node];\n\n // Calling `slot.assignedNodes()` includes whitespace text nodes in case of default slot:\n // unlike comment nodes, they are not filtered out. So we need to manually ignore them.\n const newNodes = addedNodes.filter((node) => !isEmptyTextNode(node) && !current.includes(node));\n\n if (removedNodes.length) {\n this.nodes = current.filter((node) => !removedNodes.includes(node));\n\n removedNodes.forEach((node) => {\n this.teardownNode(node);\n });\n }\n\n if (newNodes && newNodes.length > 0) {\n if (this.multiple) {\n // Remove default node if exists\n if (this.defaultNode) {\n this.defaultNode.remove();\n }\n this.nodes = [...current, ...newNodes].filter((node) => node !== this.defaultNode);\n newNodes.forEach((node) => {\n this.initAddedNode(node);\n });\n } else {\n // Remove previous node if exists\n if (this.node) {\n this.node.remove();\n }\n this.node = newNodes[0];\n this.initAddedNode(this.node);\n }\n }\n });\n }\n}\n","/**\n * @license\n * Copyright (c) 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * A helper for observing slot changes.\n */\nexport class SlotObserver {\n constructor(slot, callback) {\n /** @type HTMLSlotElement */\n this.slot = slot;\n\n /** @type Function */\n this.callback = callback;\n\n /** @type {Node[]} */\n this._storedNodes = [];\n\n this._connected = false;\n this._scheduled = false;\n\n this._boundSchedule = () => {\n this._schedule();\n };\n\n this.connect();\n this._schedule();\n }\n\n /**\n * Activates an observer. This method is automatically called when\n * a `SlotObserver` is created. It should only be called to re-activate\n * an observer that has been deactivated via the `disconnect` method.\n */\n connect() {\n this.slot.addEventListener('slotchange', this._boundSchedule);\n this._connected = true;\n }\n\n /**\n * Deactivates the observer. After calling this method the observer callback\n * will not be called when changes to slotted nodes occur. The `connect` method\n * may be subsequently called to reactivate the observer.\n */\n disconnect() {\n this.slot.removeEventListener('slotchange', this._boundSchedule);\n this._connected = false;\n }\n\n /** @private */\n _schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n\n queueMicrotask(() => {\n this.flush();\n });\n }\n }\n\n /**\n * Run the observer callback synchronously.\n */\n flush() {\n if (!this._connected) {\n return;\n }\n\n this._scheduled = false;\n\n this._processNodes();\n }\n\n /** @private */\n _processNodes() {\n const currentNodes = this.slot.assignedNodes({ flatten: true });\n\n let addedNodes = [];\n const removedNodes = [];\n const movedNodes = [];\n\n if (currentNodes.length) {\n addedNodes = currentNodes.filter((node) => !this._storedNodes.includes(node));\n }\n\n if (this._storedNodes.length) {\n this._storedNodes.forEach((node, index) => {\n const idx = currentNodes.indexOf(node);\n if (idx === -1) {\n removedNodes.push(node);\n } else if (idx !== index) {\n movedNodes.push(node);\n }\n });\n }\n\n if (addedNodes.length || removedNodes.length || movedNodes.length) {\n this.callback({ addedNodes, movedNodes, removedNodes });\n }\n\n this._storedNodes = currentNodes;\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nlet uniqueId = 0;\n\n/**\n * Resets the unique id counter.\n *\n * @return {void}\n */\nexport function resetUniqueId() {\n uniqueId = 0;\n}\n\n/**\n * Returns a unique integer id.\n *\n * @return {number}\n */\nexport function generateUniqueId() {\n // eslint-disable-next-line no-plusplus\n return uniqueId++;\n}\n"],"names":["componentName","RawAnchored","baseSelector","this","defaultSlot","assignedElements","flatten","shadowRoot","querySelector","getRootNode","host","constructor","super","attachShadow","mode","innerHTML","init","addEventListener","hasHidden","classList","contains","toggle","css","replaceSync","observer","target","attr","disconnect","removeAttribute","includeAttrs","disconnectedCallback","toggleAttribute","AnchoredClass","customElements","define","EnrichedText","bind","contentNode","e","HTMLAnchorElement","stopPropagation","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","html","getAttribute","trim","isConnected","setAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","disableRules","decodeHTML","textArea","document","createElement","value","observedAttrs","RawLink","concat","anchor","mapAttrs","tooltip","readOnly","preventDefault","selectors","link","wrapper","text","TextClass","LinkClass","textDecoration","cssVarList","cursor","RawText","hideWhenEmpty","hasChildren","childNodes","length","style","display","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","tooltipAttrs","RawTooltip","anchored","isOpened","overlay","_overlayElement","overlayContentNode","tooltipText","isStaticDisplay","srLabel","position","setTimeout","enrichedText","textContent","textComponent","appendChild","originalAttach","_attachOverlay","_detachOverlay","_updatePosition","trimmedValue","content","TooltipClass","fontFamilyOverride","fontSizeOverride","fontWeightOverride","textColorOverride","hostDirectionOverride","backgroundColor","borderRadius","boxShadow","horizontalPadding","verticalPadding","forward","attributes","include","getAncestorRootNodes","node","result","nodeType","Node","DOCUMENT_NODE","push","DOCUMENT_FRAGMENT_NODE","assignedSlot","parentNode","getFlattenedElements","elements","localName","children","forEach","elem","getClosestElement","closest","deserializeAttributeValue","Set","split","serializeAttributeValue","values","join","addValueToAttribute","element","add","removeValueFromAttribute","delete","size","isEmptyTextNode","TEXT_NODE","SlotController","EventTarget","generateId","slotName","tagName","config","initializer","multiple","observe","useUniqueId","slotInitializer","nodes","defaultId","hostConnected","initialized","initMultiple","initSingle","observeSlot","getSlotChild","initAddedNode","attachDefaultNode","initNode","getSlotChildren","defaultNode","Element","Array","from","filter","ELEMENT_NODE","slot","initCustomNode","_node","teardownNode","__slotObserver","addedNodes","removedNodes","current","newNodes","includes","remove","SlotObserver","callback","_storedNodes","_connected","_scheduled","_boundSchedule","_schedule","connect","removeEventListener","queueMicrotask","flush","_processNodes","currentNodes","assignedNodes","movedNodes","index","indexOf","uniqueId","generateUniqueId"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-tooltip.js","mappings":";iQASO,MAAMA,GAAgB,QAAiB,YAE9C,MAAMC,WAAoB,QAAgB,CACxCD,gBACAE,aAAc,oBAEd,GAAmB,KAEnB,GAAqB,KAErB,GAAoB,KAEpB,KAAI,GACF,OAAOC,KAAKC,YAAYC,iBAAiB,CAAEC,SAAS,IAAQ,EAC9D,CAEA,KAAI,GACF,OAAOH,KAAKI,WACTC,cAAc,0BACbH,mBAAmB,EACzB,CAE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B,OAAQ1D,IAAU5K,KAAKqP,aAAaJ,SAASrE,KAGrE5K,KAAKqP,aAAazH,QACpB5H,KAAKqP,aAAa5D,QAAQ,CAACb,EAAMsF,KAC/B,MAAMhN,EAAM6M,EAAaI,QAAQvF,IACpB,IAAT1H,EACF4L,EAAa7D,KAAKL,GACT1H,IAAQgN,GACjBD,EAAWhF,KAAKL,MAKlBiE,EAAWjH,QAAUkH,EAAalH,QAAUqI,EAAWrI,SACzD5H,KAAKoP,SAAS,CAAEP,aAAYoB,aAAYnB,iBAG1C9O,KAAKqP,aAAeU,CACtB,E,gCCjGF,IAAIK,EAAW,EAgBR,SAASC,IAEd,OAAOD,GACT,C","sources":["webpack://@descope/web-components-ui/../components/descope-anchored/src/component/AnchoredClass.js","webpack://@descope/web-components-ui/../components/descope-anchored/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/consts.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/TooltipClass.js","webpack://@descope/web-components-ui/../components/descope-tooltip/src/component/index.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/dom-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/slot-observer.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/component-base/src/unique-id-utils.js"],"sourcesContent":["import { componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('anchored');\n\nclass RawAnchored extends createBaseClass({\n componentName,\n baseSelector: '.anchored-root',\n}) {\n #stretchObserver = null;\n\n #directionObserver = null;\n\n #hostStretchSheet = null;\n\n get #anchor() {\n return this.defaultSlot.assignedElements({ flatten: true })[0];\n }\n\n get #anchored() {\n return this.shadowRoot\n .querySelector('slot[name=\"anchored\"]')\n ?.assignedElements()[0];\n }\n\n get #outerHost() {\n return this.getRootNode().host;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"anchored-root\" part=\"root\">\n <slot></slot>\n <div class=\"anchored-host\" part=\"anchored\">\n <slot name=\"anchored\"></slot>\n </div>\n </div>\n `;\n\n this.defaultSlot = this.shadowRoot.querySelector('slot:not([name])');\n }\n\n init() {\n super.init?.();\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n position: relative;\n box-sizing: border-box;\n }\n\n :host(:not([has-anchor])) {\n display: none;\n }\n\n .anchored-root {\n position: relative;\n display: flex;\n width: 100%;\n min-width: 0;\n }\n\n /* Make anchor fill the flex row and allow it to shrink. */\n ::slotted(*:not([slot])) {\n flex-grow: 1; /* fill the flex row */\n flex-shrink: 1; /* compress when constrained */\n flex-basis: auto; /* start from the anchor's natural size */\n min-width: 0; /* flex items won't shrink below content size without this */\n }\n\n /* Anchored container covers the anchor but is invisible to pointer events. */\n .anchored-host {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n /* Restore interactivity for actual anchored content. */\n ::slotted([slot=\"anchored\"]) {\n pointer-events: auto;\n }\n `,\n this,\n );\n\n this.#syncStretchCSS();\n\n this.defaultSlot.addEventListener('slotchange', () => this.#syncAnchor());\n\n this.#syncAnchor();\n }\n\n // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.\n // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.\n #syncComponentState() {\n const hasHidden = this.#anchor?.classList?.contains('hidden');\n this.classList.toggle('hidden', hasHidden);\n }\n\n #syncAnchor() {\n this.#onAnchorChanged();\n\n this.#stretchObserver = this.#forwardAttr(\n this.#stretchObserver,\n this.#outerHost,\n 'stretch',\n );\n\n this.#directionObserver = this.#forwardAttr(\n this.#directionObserver,\n this.#anchored,\n 'st-host-direction',\n );\n }\n\n // Injects [stretch] layout rules into the containing component's shadow root (e.g. descope-attachment)\n // so it stretches when the anchor has [stretch]. Replaces the existing rules on subsequent calls.\n #syncStretchCSS() {\n const css = `\n descope-anchored {\n width: 100%; /* fill the outer host so the anchored element spans the full anchor width */\n }\n :host([stretch]) {\n display: inline-flex; /* switch from inline-block so internal children are flex items */\n width: 100%; /* fill non-flex parents */\n flex-grow: 1; /* absorb extra space in flex parents */\n flex-shrink: 0; /* hold full width — shrink:1 would let siblings squeeze it below 100% */\n flex-basis: auto; /* defer to width:100% on the main axis; avoids forcing 100% height in column-flex parents */\n min-width: 0; /* prevent overflow when the outer host is itself inside a constrained flex row */\n }\n `;\n\n if (this.#hostStretchSheet) {\n this.#hostStretchSheet.replaceSync(css);\n } else if (this.#outerHost) {\n this.#hostStretchSheet = injectStyle(css, this.#outerHost);\n }\n }\n\n // Reconnects forwarding to the current anchor. Disconnects the old observer and\n // removes the stale attr from target first — forwardAttrs only sets attrs present\n // on the source, so absent attrs won't be removed automatically.\n #forwardAttr(observer, target, attr) {\n observer?.disconnect();\n target?.removeAttribute(attr);\n if (!this.#anchor || !target) return null;\n return forwardAttrs(this.#anchor, target, { includeAttrs: [attr] });\n }\n\n // Prevent stale callbacks from firing on a detached anchor after removal.\n disconnectedCallback() {\n super.disconnectedCallback?.();\n this.#stretchObserver?.disconnect();\n this.#directionObserver?.disconnect();\n }\n\n // Track whether anything is slotted, so the host display rule can hide an\n // empty host rather than reserving its layout box.\n #onAnchorChanged() {\n this.toggleAttribute('has-anchor', !!this.#anchor);\n this.#syncComponentState();\n }\n}\n\nexport const AnchoredClass = compose(componentNameValidationMixin)(RawAnchored);\n","import { componentName, AnchoredClass } from './AnchoredClass';\n\ncustomElements.define(componentName, AnchoredClass);\n\nexport { AnchoredClass, componentName };\n","/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n\n // Stop propagation on link clicks to prevent parent handlers from firing\n this.contentNode?.addEventListener('click', (e) => {\n if (e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\n }\n\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n this.contentNode.firstChild?.setAttribute('part', 'content');\n }\n\n onReadOnlyChange(isReadOnly) {\n if (isReadOnly) {\n this.contentNode.setAttribute('inert', isReadOnly);\n } else {\n this.contentNode.removeAttribute('inert');\n }\n }\n}\n\nexport const EnrichedTextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDisplay: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n","export const disableRules = [\n 'blockquote',\n 'list',\n 'image',\n 'table',\n 'code',\n 'hr',\n 'backticks',\n 'fence',\n 'reference',\n 'heading',\n 'lheading',\n 'html_block',\n];\n","export const decodeHTML = (html) => {\n const textArea = document.createElement('textarea');\n textArea.innerHTML = html;\n return textArea.value;\n};\n","import '@descope-ui/descope-link';\n\nimport { componentName, EnrichedTextClass } from './EnrichedTextClass';\n\ncustomElements.define(componentName, EnrichedTextClass);\n\nexport { EnrichedTextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nconst observedAttrs = ['href', 'readonly'];\n\nclass RawLink extends createBaseClass({\n componentName,\n baseSelector: ':host a',\n}) {\n static get observedAttributes() {\n return observedAttrs.concat(super.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text part=\"wrapper\">\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n\n :host([ellipsis=\"true\"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis=\"true\"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n `,\n this,\n );\n\n this.anchor = this.shadowRoot.querySelector('a');\n\n forwardAttrs(this, this.anchor, {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n\n this.anchor.addEventListener('click', (e) => {\n if (this.readOnly) {\n e.preventDefault();\n }\n });\n }\n\n get readOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: {\n ...link,\n property: 'text-decoration',\n fallback: 'none',\n },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n componentNameValidationMixin,\n portalMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\n\nexport const componentName = getComponentName('tooltip');\n\nconst tooltipAttrs = [\n 'text',\n 'position',\n 'hide-delay',\n 'hover-delay',\n 'opened',\n];\n\nclass RawTooltip extends createBaseClass({\n componentName,\n baseSelector: 'vaadin-tooltip',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <descope-anchored>\n <slot></slot>\n <vaadin-tooltip slot=\"anchored\"></vaadin-tooltip>\n </descope-anchored>\n `;\n\n this.defaultSlot = this.shadowRoot.querySelector('slot:not([name])');\n this.tooltip = this.shadowRoot.querySelector('vaadin-tooltip');\n\n this.anchored = this.shadowRoot.querySelector('descope-anchored');\n }\n\n // To support conditional components in flow, we need to sync the 'hidden' className to the root of the component.\n // Ideally, this would happen in the SDK, but we resolved to this patch to fix the issue without forcing users to update SDKs.\n #syncComponentState() {\n const hasHidden = this.anchored?.classList?.contains('hidden');\n this.classList.toggle('hidden', hasHidden);\n }\n\n static get observedAttributes() {\n return tooltipAttrs.concat(super.observedAttributes || []);\n }\n\n get isOpened() {\n return this.getAttribute('opened') === 'true';\n }\n\n get overlay() {\n return this.tooltip?._overlayElement;\n }\n\n get overlayContentNode() {\n return this.overlay?.shadowRoot.querySelector('[part=\"content\"]');\n }\n\n get tooltipText() {\n return this.getAttribute('text')?.trim() || '';\n }\n\n get isStaticDisplay() {\n return this.getAttribute('static-display') === 'true';\n }\n\n get srLabel() {\n return this.tooltip?.querySelector('[slot=\"sr-label\"]');\n }\n\n // We use `static-display` for presentation purposes, to show the tooltip content.\n // This should be used only when `opened` is `true`. Once `static-display` is set,\n // the overlay flows in-line and has layout in the presenting page. Mainly aimed\n // to solve the presentation problem on our Styles Page in the Console.\n #handleStaticDisplay() {\n if (this.isStaticDisplay) {\n this.#revealOverlay();\n this.setAttribute('inert', 'true');\n } else {\n this.removeAttribute('inert');\n }\n }\n\n #revealOverlay() {\n if (!this.overlay) return;\n // Keep the overlay in vaadin-tooltip.shadowRoot so adopted stylesheets from\n // portalMixin continue to apply (they are scoped to that shadow root).\n // Layout is handled via CSS: anchored-root becomes a column, vaadin-tooltip\n // becomes a visible block below the anchor, and the sr-label is hidden.\n this.overlay.style.display = 'block';\n this.overlay.style.position = 'static';\n }\n\n init() {\n super.init?.();\n\n injectStyle(\n `\n :host {\n display: inline-block;\n }\n vaadin-tooltip {\n display: block;\n position: absolute;\n width: 0;\n height: 0;\n overflow: hidden;\n }\n /* Stack anchor above the anchored element so the tooltip flows below it inline. */\n :host([static-display=\"true\"]) descope-anchored::part(root) {\n flex-direction: column;\n }\n :host([static-display=\"true\"]) descope-anchored::part(anchored) {\n position: static;\n inset: unset;\n }\n :host([static-display=\"true\"]) vaadin-tooltip {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n }\n :host([static-display=\"true\"]) vaadin-tooltip [slot=\"sr-label\"] {\n display: none;\n }\n`,\n this,\n );\n\n this.defaultSlot.addEventListener('slotchange', () =>\n this.#setTooltipTarget(),\n );\n this.#setTooltipTarget();\n\n this.#syncComponentState();\n\n setTimeout(() => this.#onOverlayReady());\n }\n\n #setTooltipTarget() {\n const target = this.defaultSlot?.assignedElements()?.[0];\n if (!target) return;\n this.tooltip.target = target;\n }\n\n #onOverlayReady() {\n this.#initTooltipTextComponent();\n this.#overrideAttachOverlay();\n\n forwardAttrs(this, this.tooltip, {\n includeAttrs: ['position', 'opened'],\n });\n\n this.#handleTooltipVisibility();\n }\n\n #clearOverlayContentNode() {\n this.overlayContentNode.innerHTML = '';\n }\n\n #createEnrichedTextComponent() {\n const enrichedText = document.createElement('descope-enriched-text');\n\n enrichedText.setAttribute('link-target-blank', 'true');\n enrichedText.textContent = this.tooltipText;\n\n return enrichedText;\n }\n\n #initTooltipTextComponent() {\n if (!this.overlayContentNode) return;\n\n setTimeout(() => {\n this.#clearOverlayContentNode();\n\n this.textComponent = this.#createEnrichedTextComponent();\n\n this.overlayContentNode.appendChild(this.textComponent);\n\n // An empty sr-label with role=\"tooltip\" fails accessibility checks.\n // Hide it when there's no tooltip text; vaadin handles populating it when text is present.\n if (this.srLabel && !this.tooltipText) {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['readonly'],\n });\n });\n }\n\n // The default vaadin behavior is to attach the overlay to the body when opened,\n // which makes it hard to style. We move the overlay into our shadow root instead.\n // Critical: vaadin computes position against the overlay's offsetParent — moving\n // it changes that context, so we must call `_updatePosition()` afterwards.\n // That's vaadin's own position-recompute method (the same one its resize/scroll\n // listeners use internally), so we get the right reposition without dispatching\n // global events.\n #overrideAttachOverlay() {\n if (!this.overlay) return;\n\n const originalAttach = this.overlay._attachOverlay?.bind(this.overlay);\n\n this.overlay._detachOverlay = () => {};\n this.overlay._attachOverlay = () => {\n originalAttach?.();\n setTimeout(() => {\n this.tooltip.shadowRoot.appendChild(this.overlay);\n this.overlay._updatePosition?.();\n });\n };\n\n if (this.isOpened) {\n // When `opened` attr is set at init, vaadin renders the overlay at the top\n // level without calling `_attachOverlay`. Move it back into our shadow root.\n setTimeout(() => {\n this.tooltip.shadowRoot.appendChild(this.overlay);\n this.#handleStaticDisplay();\n this.overlay._updatePosition?.();\n });\n }\n }\n\n #handleTooltipVisibility() {\n // This is Vaadin's API for manual control of tooltip visibility\n this.tooltip?.toggleAttribute('manual', this.isOpened);\n }\n\n #updateText(value) {\n if (!this.textComponent) return;\n const trimmedValue = (value ?? '').trim();\n this.textComponent.textContent = trimmedValue;\n if (this.srLabel) {\n if (trimmedValue) {\n this.srLabel.removeAttribute('aria-hidden');\n } else {\n this.srLabel.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'text') {\n this.#updateText(newValue);\n }\n\n if (attrName === 'opened') {\n this.#handleTooltipVisibility();\n }\n }\n }\n}\n\nconst { overlay, content } = {\n overlay: { selector: () => 'vaadin-tooltip-overlay::part(overlay)' },\n content: { selector: () => 'vaadin-tooltip-overlay::part(content)' },\n};\n\nexport const TooltipClass = compose(\n componentNameValidationMixin,\n portalMixin({\n selector: '',\n mappings: {\n fontFamily: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontFamilyOverride,\n },\n fontSize: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontSizeOverride,\n },\n fontWeight: {\n ...content,\n property: EnrichedTextClass.cssVarList.fontWeightOverride,\n },\n textColor: {\n ...content,\n property: EnrichedTextClass.cssVarList.textColorOverride,\n },\n hostDirection: {\n ...content,\n property: EnrichedTextClass.cssVarList.hostDirectionOverride,\n },\n backgroundColor: [{ ...overlay }, { ...content }],\n borderColor: { ...overlay },\n borderStyle: { ...overlay },\n borderWidth: { ...overlay },\n borderRadius: { ...overlay },\n boxShadow: { ...overlay },\n horizontalPadding: [\n { ...content, property: 'padding-left' },\n { ...content, property: 'padding-right' },\n ],\n verticalPadding: [\n { ...content, property: 'padding-top' },\n { ...content, property: 'padding-bottom' },\n ],\n },\n forward: {\n attributes: ['style'],\n include: false,\n },\n }),\n)(RawTooltip);\n","import '@descope-ui/descope-anchored';\nimport '@descope-ui/descope-enriched-text';\nimport '@vaadin/tooltip';\nimport { componentName, TooltipClass } from './TooltipClass';\n\ncustomElements.define(componentName, TooltipClass);\n\nexport { TooltipClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Returns an array of ancestor root nodes for the given node.\n *\n * A root node is either a document node or a document fragment node (Shadow Root).\n * The array is collected by a bottom-up DOM traversing that starts with the given node\n * and involves both the light DOM and ancestor shadow DOM trees.\n *\n * @param {Node} node\n * @return {Node[]}\n */\nexport function getAncestorRootNodes(node) {\n const result = [];\n\n while (node) {\n if (node.nodeType === Node.DOCUMENT_NODE) {\n result.push(node);\n break;\n }\n\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result.push(node);\n node = node.host;\n continue;\n }\n\n if (node.assignedSlot) {\n node = node.assignedSlot;\n continue;\n }\n\n node = node.parentNode;\n }\n\n return result;\n}\n\n/**\n * Returns the list of flattened elements for the given `node`.\n * This list consists of a node's children and, for any children that are\n * `<slot>` elements, the expanded flattened list of `assignedElements`.\n *\n * @param {Node} node\n * @return {Element[]}\n */\nexport function getFlattenedElements(node) {\n const result = [];\n let elements;\n if (node.localName === 'slot') {\n elements = node.assignedElements();\n } else {\n result.push(node);\n elements = [...node.children];\n }\n elements.forEach((elem) => result.push(...getFlattenedElements(elem)));\n return result;\n}\n\n/**\n * Traverses the given node and its parents, including those that are across\n * the shadow root boundaries, until it finds a node that matches the selector.\n *\n * @param {string} selector The CSS selector to match against\n * @param {Node} node The starting node for the traversal\n * @return {Node | null} The closest matching element, or null if no match is found\n */\nexport function getClosestElement(selector, node) {\n if (!node) {\n return null;\n }\n\n return node.closest(selector) || getClosestElement(selector, node.getRootNode().host);\n}\n\n/**\n * Takes a string with values separated by space and returns a set the values\n *\n * @param {string} value\n * @return {Set<string>}\n */\nexport function deserializeAttributeValue(value) {\n if (!value) {\n return new Set();\n }\n\n return new Set(value.split(' '));\n}\n\n/**\n * Takes a set of string values and returns a string with values separated by space\n *\n * @param {Set<string>} values\n * @return {string}\n */\nexport function serializeAttributeValue(values) {\n return values ? [...values].join(' ') : '';\n}\n\n/**\n * Adds a value to an attribute containing space-delimited values.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function addValueToAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.add(value);\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Removes a value from an attribute containing space-delimited values.\n * If the value is the last one, the whole attribute is removed.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function removeValueFromAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.delete(value);\n if (values.size === 0) {\n element.removeAttribute(attr);\n return;\n }\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Returns true if the given node is an empty text node, false otherwise.\n *\n * @param {Node} node\n * @return {boolean}\n */\nexport function isEmptyTextNode(node) {\n return node.nodeType === Node.TEXT_NODE && node.textContent.trim() === '';\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { isEmptyTextNode } from './dom-utils.js';\nimport { SlotObserver } from './slot-observer.js';\nimport { generateUniqueId } from './unique-id-utils.js';\n\n/**\n * A controller for providing content to slot element and observing changes.\n */\nexport class SlotController extends EventTarget {\n /**\n * Ensure that every instance has unique ID.\n *\n * @param {HTMLElement} host\n * @param {string} slotName\n * @return {string}\n * @protected\n */\n static generateId(host, slotName) {\n const prefix = slotName || 'default';\n return `${prefix}-${host.localName}-${generateUniqueId()}`;\n }\n\n constructor(host, slotName, tagName, config = {}) {\n super();\n\n const { initializer, multiple, observe, useUniqueId } = config;\n\n this.host = host;\n this.slotName = slotName;\n this.tagName = tagName;\n this.observe = typeof observe === 'boolean' ? observe : true;\n this.multiple = typeof multiple === 'boolean' ? multiple : false;\n this.slotInitializer = initializer;\n\n if (multiple) {\n this.nodes = [];\n }\n\n // Only generate the default ID if requested by the controller.\n if (useUniqueId) {\n this.defaultId = this.constructor.generateId(host, slotName);\n }\n }\n\n hostConnected() {\n if (!this.initialized) {\n if (this.multiple) {\n this.initMultiple();\n } else {\n this.initSingle();\n }\n\n if (this.observe) {\n this.observeSlot();\n }\n\n this.initialized = true;\n }\n }\n\n /** @protected */\n initSingle() {\n let node = this.getSlotChild();\n\n if (!node) {\n node = this.attachDefaultNode();\n this.initNode(node);\n } else {\n this.node = node;\n this.initAddedNode(node);\n }\n }\n\n /** @protected */\n initMultiple() {\n const children = this.getSlotChildren();\n\n if (children.length === 0) {\n const defaultNode = this.attachDefaultNode();\n if (defaultNode) {\n this.nodes = [defaultNode];\n this.initNode(defaultNode);\n }\n } else {\n this.nodes = children;\n children.forEach((node) => {\n this.initAddedNode(node);\n });\n }\n }\n\n /**\n * Create and attach default node using the provided tag name, if any.\n * @return {Node | undefined}\n * @protected\n */\n attachDefaultNode() {\n const { host, slotName, tagName } = this;\n\n // Check if the node was created previously and if so, reuse it.\n let node = this.defaultNode;\n\n // Tag name is optional, sometimes we don't init default content.\n if (!node && tagName) {\n node = document.createElement(tagName);\n if (node instanceof Element) {\n if (slotName !== '') {\n node.setAttribute('slot', slotName);\n }\n this.defaultNode = node;\n }\n }\n\n if (node) {\n this.node = node;\n host.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * Return the list of nodes matching the slot managed by the controller.\n * @return {Node}\n */\n getSlotChildren() {\n const { slotName } = this;\n return Array.from(this.host.childNodes).filter((node) => {\n // Either an element (any slot) or a text node (only un-named slot).\n return (\n (node.nodeType === Node.ELEMENT_NODE && node.slot === slotName) ||\n (node.nodeType === Node.TEXT_NODE && node.textContent.trim() && slotName === '')\n );\n });\n }\n\n /**\n * Return a reference to the node managed by the controller.\n * @return {Node}\n */\n getSlotChild() {\n return this.getSlotChildren()[0];\n }\n\n /**\n * Run `slotInitializer` for the node managed by the controller.\n *\n * @param {Node} node\n * @protected\n */\n initNode(node) {\n const { slotInitializer } = this;\n // Don't try to bind `this` to initializer (normally it's arrow function).\n // Instead, pass the host as a first argument to access component's state.\n if (slotInitializer) {\n slotInitializer(node, this.host);\n }\n }\n\n /**\n * Override to initialize the newly added custom node.\n *\n * @param {Node} _node\n * @protected\n */\n initCustomNode(_node) {}\n\n /**\n * Override to teardown slotted node when it's removed.\n *\n * @param {Node} _node\n * @protected\n */\n teardownNode(_node) {}\n\n /**\n * Run both `initCustomNode` and `initNode` for a custom slotted node.\n *\n * @param {Node} node\n * @protected\n */\n initAddedNode(node) {\n if (node !== this.defaultNode) {\n this.initCustomNode(node);\n this.initNode(node);\n }\n }\n\n /**\n * Setup the observer to manage slot content changes.\n * @protected\n */\n observeSlot() {\n const { slotName } = this;\n const selector = slotName === '' ? 'slot:not([name])' : `slot[name=${slotName}]`;\n const slot = this.host.shadowRoot.querySelector(selector);\n\n this.__slotObserver = new SlotObserver(slot, ({ addedNodes, removedNodes }) => {\n const current = this.multiple ? this.nodes : [this.node];\n\n // Calling `slot.assignedNodes()` includes whitespace text nodes in case of default slot:\n // unlike comment nodes, they are not filtered out. So we need to manually ignore them.\n const newNodes = addedNodes.filter((node) => !isEmptyTextNode(node) && !current.includes(node));\n\n if (removedNodes.length) {\n this.nodes = current.filter((node) => !removedNodes.includes(node));\n\n removedNodes.forEach((node) => {\n this.teardownNode(node);\n });\n }\n\n if (newNodes && newNodes.length > 0) {\n if (this.multiple) {\n // Remove default node if exists\n if (this.defaultNode) {\n this.defaultNode.remove();\n }\n this.nodes = [...current, ...newNodes].filter((node) => node !== this.defaultNode);\n newNodes.forEach((node) => {\n this.initAddedNode(node);\n });\n } else {\n // Remove previous node if exists\n if (this.node) {\n this.node.remove();\n }\n this.node = newNodes[0];\n this.initAddedNode(this.node);\n }\n }\n });\n }\n}\n","/**\n * @license\n * Copyright (c) 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * A helper for observing slot changes.\n */\nexport class SlotObserver {\n constructor(slot, callback) {\n /** @type HTMLSlotElement */\n this.slot = slot;\n\n /** @type Function */\n this.callback = callback;\n\n /** @type {Node[]} */\n this._storedNodes = [];\n\n this._connected = false;\n this._scheduled = false;\n\n this._boundSchedule = () => {\n this._schedule();\n };\n\n this.connect();\n this._schedule();\n }\n\n /**\n * Activates an observer. This method is automatically called when\n * a `SlotObserver` is created. It should only be called to re-activate\n * an observer that has been deactivated via the `disconnect` method.\n */\n connect() {\n this.slot.addEventListener('slotchange', this._boundSchedule);\n this._connected = true;\n }\n\n /**\n * Deactivates the observer. After calling this method the observer callback\n * will not be called when changes to slotted nodes occur. The `connect` method\n * may be subsequently called to reactivate the observer.\n */\n disconnect() {\n this.slot.removeEventListener('slotchange', this._boundSchedule);\n this._connected = false;\n }\n\n /** @private */\n _schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n\n queueMicrotask(() => {\n this.flush();\n });\n }\n }\n\n /**\n * Run the observer callback synchronously.\n */\n flush() {\n if (!this._connected) {\n return;\n }\n\n this._scheduled = false;\n\n this._processNodes();\n }\n\n /** @private */\n _processNodes() {\n const currentNodes = this.slot.assignedNodes({ flatten: true });\n\n let addedNodes = [];\n const removedNodes = [];\n const movedNodes = [];\n\n if (currentNodes.length) {\n addedNodes = currentNodes.filter((node) => !this._storedNodes.includes(node));\n }\n\n if (this._storedNodes.length) {\n this._storedNodes.forEach((node, index) => {\n const idx = currentNodes.indexOf(node);\n if (idx === -1) {\n removedNodes.push(node);\n } else if (idx !== index) {\n movedNodes.push(node);\n }\n });\n }\n\n if (addedNodes.length || removedNodes.length || movedNodes.length) {\n this.callback({ addedNodes, movedNodes, removedNodes });\n }\n\n this._storedNodes = currentNodes;\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nlet uniqueId = 0;\n\n/**\n * Resets the unique id counter.\n *\n * @return {void}\n */\nexport function resetUniqueId() {\n uniqueId = 0;\n}\n\n/**\n * Returns a unique integer id.\n *\n * @return {number}\n */\nexport function generateUniqueId() {\n // eslint-disable-next-line no-plusplus\n return uniqueId++;\n}\n"],"names":["componentName","RawAnchored","baseSelector","this","defaultSlot","assignedElements","flatten","shadowRoot","querySelector","getRootNode","host","constructor","super","attachShadow","mode","innerHTML","init","addEventListener","hasHidden","classList","contains","toggle","css","replaceSync","observer","target","attr","disconnect","removeAttribute","includeAttrs","disconnectedCallback","toggleAttribute","AnchoredClass","customElements","define","EnrichedText","bind","contentNode","e","HTMLAnchorElement","stopPropagation","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","html","getAttribute","trim","isConnected","setAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","disableRules","decodeHTML","textArea","document","createElement","value","observedAttrs","RawLink","concat","anchor","mapAttrs","tooltip","readOnly","preventDefault","selectors","link","wrapper","text","LinkClass","textDecoration","cssVarList","cursor","RawText","hideWhenEmpty","hasChildren","childNodes","length","style","display","TextClass","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","tooltipAttrs","RawTooltip","anchored","isOpened","overlay","_overlayElement","overlayContentNode","tooltipText","isStaticDisplay","srLabel","position","setTimeout","enrichedText","textContent","textComponent","appendChild","originalAttach","_attachOverlay","_detachOverlay","_updatePosition","trimmedValue","content","TooltipClass","fontFamilyOverride","fontSizeOverride","fontWeightOverride","textColorOverride","hostDirectionOverride","backgroundColor","borderRadius","boxShadow","horizontalPadding","verticalPadding","forward","attributes","include","getAncestorRootNodes","node","result","nodeType","Node","DOCUMENT_NODE","push","DOCUMENT_FRAGMENT_NODE","assignedSlot","parentNode","getFlattenedElements","elements","localName","children","forEach","elem","getClosestElement","closest","deserializeAttributeValue","Set","split","serializeAttributeValue","values","join","addValueToAttribute","element","add","removeValueFromAttribute","delete","size","isEmptyTextNode","TEXT_NODE","SlotController","EventTarget","generateId","slotName","tagName","config","initializer","multiple","observe","useUniqueId","slotInitializer","nodes","defaultId","hostConnected","initialized","initMultiple","initSingle","observeSlot","getSlotChild","initAddedNode","attachDefaultNode","initNode","getSlotChildren","defaultNode","Element","Array","from","filter","ELEMENT_NODE","slot","initCustomNode","_node","teardownNode","__slotObserver","addedNodes","removedNodes","current","newNodes","includes","remove","SlotObserver","callback","_storedNodes","_connected","_scheduled","_boundSchedule","_schedule","connect","removeEventListener","queueMicrotask","flush","_processNodes","currentNodes","assignedNodes","movedNodes","index","indexOf","uniqueId","generateUniqueId"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[461,1202,2294,4159,4188,4551,6724,7750],{67603(t){t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjUiIHZpZXdCb3g9IjAgMCAyNCAyNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gPHBhdGggZD0iTTIwIDE4LjVDMjEuMSAxOC41IDIxLjk5IDE3LjYgMjEuOTkgMTYuNUwyMiA2LjVDMjIgNS40IDIxLjEgNC41IDIwIDQuNUg0QzIuOSA0LjUgMiA1LjQgMiA2LjVWMTYuNUMyIDE3LjYgMi45IDE4LjUgNCAxOC41SDBWMjAuNUgyNFYxOC41SDIwWk00IDYuNUgyMFYxNi41SDRWNi41WiIgZmlsbD0iI0Y0RjVGNiIvPiA8L3N2Zz4g"},14329(t){t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gPHBhdGggZD0iTTIwIDE4QzIxLjEgMTggMjEuOTkgMTcuMSAyMS45OSAx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HA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gPHBhdGggZD0iTTQgNi41SDIyVjQuNUg0QzIuOSA0LjUgMiA1LjQgMiA2LjVWMTcuNUgwVjIwLjVIMTRWMTcuNUg0VjYuNVpNMjMgOC41SDE3QzE2LjQ1IDguNSAxNiA4Ljk1IDE2IDkuNVYxOS41QzE2IDIwLjA1IDE2LjQ1IDIwLjUgMTcgMjAuNUgyM0MyMy41NSAyMC41IDI0IDIwLjA1IDI0IDE5LjVWOS41QzI0IDguOTUgMjMuNTUgOC41IDIzIDguNVpNMjIgMTcuNUgxOFYxMC41SDIyVjE3LjVaIiBmaWxsPSIjNjM2Qzc0Ii8+IDwvc3ZnPiA="},77888(t,e,n){"use strict";n.d(e,{T:()=>a,e:()=>l});var i=n(88961),r=n(72270),o=n(25964),s=n(63200);const a=(0,o.xE)("badge");class d extends((0,r.qu)({componentName:a,baseSelector:":host > div"})){static get observedAttributes(){return["data-attachment-size","shrink-to-indicator-threshold"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div>\n <slot></slot>\n\t\t</div>\n\t\t",(0,o.fz)("\n :host {\n display: inline-flex;\n }\n :host > div {\n position: relative;\n width: 100%;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ",this)}get shrinkToIndicatorThreshold(){return this.getAttribute("shrink-to-indicator-threshold")||65}#t(t){this.toggleAttribute("shrink-to-indicator",parseFloat(t)<this.shrinkToIndicatorThreshold)}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"data-attachment-size"===t&&e!==n&&this.#t(n)}}const l=(0,s.Zz)((0,i.RF)({mappings:{hostWidth:[{selector:()=>":host",property:"width"}],hostHeight:[{selector:()=>":host",property:"height"}],hostDirection:{property:"direction"},fontFamily:{},fontSize:{},fontWeight:{},textTransform:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],borderWidth:{},borderStyle:{},borderColor:{},borderRadius:{},backgroundColor:{},textColor:{property:"color"},textAlign:{},boxShadow:{},textIndent:{}}}),i.VO,i.tQ)(d)},11065(t,e,n){"use strict";n.r(e),n.d(e,{BadgeClass:()=>i.e,componentName:()=>i.T});var i=n(77888);customElements.define(i.T,i.e)},98538(t,e,n){"use strict";n.d(e,{S:()=>d,T:()=>a});var i=n(88961),r=n(25964),o=n(8512),s=n(63200);const a=(0,r.xE)("icon"),d=(0,s.Zz)((0,i.RF)({mappings:{fill:[{},{property:o.q.cssVarList.fill}]}}),i.VO,i.tQ)((0,i.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n ",excludeAttrsSync:["tabindex","class","style"],componentName:a}))},56737(t,e,n){"use strict";n.r(e),n.d(e,{IconClass:()=>i.S,componentName:()=>i.T}),n(53455);var i=n(98538);customElements.define(i.T,i.S)},8512(t,e,n){"use strict";n.d(e,{T:()=>d,q:()=>p});var i=n(88961),r=n(72270),o=n(63200),s=n(25964),a=n(18782);const d=(0,s.xE)("image"),l=["src","src-dark"];class c extends((0,r.qu)({componentName:d,baseSelector:"slot"})){static get observedAttributes(){return l}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,s.fz)("\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n ",this)}init(){super.init?.(),this.toggleVisibility(this.getSrc)}onThemeChange(){this.renderImage()}toggleVisibility(t){t?this.classList.remove("hidden"):this.classList.add("hidden")}get altText(){return this.getAttribute("alt")||""}get legacySrc(){return this.getAttribute("src")}get themeSrc(){return this.getAttribute(`src-${this.currentThemeName}`)}get getSrc(){return this.themeSrc||this.legacySrc}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach(t=>{t.setAttribute("fill",`var(${p.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)})}renderImage(){this.toggleVisibility(this.getSrc),(0,a.m)(this.getSrc,this.altText).then(t=>{this.innerHTML="",t&&(this.updateFillColor(t),this.appendChild(t))})}shouldRender(t){const e=this.getAttribute(t);return this.getSrc===e}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&this.shouldRender(t)&&this.renderImage()}}const p=(0,o.Zz)((0,i.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),i.VO,i.tQ)(c)},18782(t,e,n){"use strict";n.d(e,{m:()=>o});var i=n(25414);const r=t=>{const e=i.A.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["image"],FORBID_TAGS:["defs"]});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},o=async(t,e)=>{try{let n;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));n=r(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),i=await e.text();n=r(i)}else n=((t,e)=>{const n=document.createElement("img");return n.setAttribute("src",t),n.setAttribute("alt",e),n})(t,e);return n.style.setProperty("max-width","100%"),n.style.setProperty("max-height","100%"),n}catch{return null}}},53455(t,e,n){"use strict";n.r(e),n.d(e,{ImageClass:()=>i.q,componentName:()=>i.T});var i=n(8512);customElements.define(i.T,i.q)},74778(t,e,n){"use strict";n.r(e),n.d(e,{LinkClass:()=>y,componentName:()=>d});var i=n(88961),r=n(63200),o=n(25964),s=n(72270),a=n(66434);const d=(0,o.xE)("link"),l=["href","readonly"];class c extends((0,s.qu)({componentName:d,baseSelector:":host a"})){static get observedAttributes(){return l.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t',(0,o.fz)('\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,o.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,o.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const p={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>a.s.componentName}},{anchor:g,text:h,host:m,wrapper:u,link:I}=p,y=(0,r.Zz)((0,i.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...h,property:"direction"},textAlign:u,textDecoration:{...I,property:"text-decoration",fallback:"none"},textColor:[{...g,property:"color"},{...h,property:a.s.cssVarList.textColor}],cursor:g}}),i.VO,i.tQ)(c);n(63595),customElements.define(d,y)},93895(t,e,n){"use strict";n.d(e,{O:()=>d,T:()=>a});var i=n(88961),r=n(63200),o=n(25964),s=n(72270);const a=(0,o.xE)("list-item"),d=(0,r.Zz)((0,i.RF)({mappings:{verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],backgroundColor:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},outline:{},cursor:{},gap:{},maxWidth:{selector:()=>":host"},alignItems:{},flexDirection:{},transition:{}}}),i.VO,i.tQ,t=>class extends t{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <slot></slot>\n ",(0,o.fz)("\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n ",this)}},i.y)((0,s.qu)({componentName:a,baseSelector:"slot"}))},24542(t,e,n){"use strict";n.r(e),n.d(e,{ListItemClass:()=>i.O,componentName:()=>i.T});var i=n(93895);customElements.define(i.T,i.O)},7720(t,e,n){"use strict";n.d(e,{T:()=>d,x:()=>c});var i=n(88961),r=n(63200),o=n(25964),s=n(93895),a=n(72270);const d=(0,o.xE)("list");class l extends((0,a.qu)({componentName:d,baseSelector:".wrapper"})){static get observedAttributes(){return["variant","readonly"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <slot></slot>\n <slot name="empty-state">\n No item...\n </slot>\n </div>\n\t',(0,o.fz)('\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name="empty-state"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name="empty-state"] {\n display: none;\n }\n :host([empty]) slot[name="empty-state"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n ',this)}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}#e(){0===this.items.length?this.setAttribute("empty","true"):this.removeAttribute("empty")}get variant(){return this.getAttribute("variant")||"list"}#n(){this.items.forEach(t=>{let e=t;e.localName!==s.O.componentName&&(e=t.querySelector(s.O.componentName));const n="tiles"===this.variant?"tile":"row";e?.setAttribute("variant",n)})}init(){super.init?.(),(0,o.Ge)(this,()=>{this.#e(),this.#n(),this.#i()})}get isReadOnly(){return"true"===this.getAttribute("readonly")}#i(){this.items.forEach(t=>{this.isReadOnly?t.setAttribute("inert",""):t.removeAttribute("inert")})}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("variant"===t?this.#n():"readonly"===t&&this.#i())}}const c=(0,r.Zz)((0,i.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},maxHeight:{selector:()=>":host"},minHeight:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],hostDirection:{selector:()=>":host",property:"direction"},fontFamily:{},gap:{},backgroundColor:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{},gridTemplateColumns:{},maxItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"max-width"},minItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"min-width"},maxRowItems:{property:"max-row-items"},itemsHorizontalAlign:{selector:()=>"::slotted(*)",property:"justify-self"},emptyStateTextColor:{selector:()=>'slot[name="empty-state"]',property:"color"},emptyStateTextFontFamily:{selector:()=>'slot[name="empty-state"]',property:"font-family"}}}),i.VO,i.tQ)(l)},45400(t,e,n){"use strict";n.r(e),n.d(e,{ListClass:()=>i.x,componentName:()=>i.T}),n(24542);var i=n(7720);customElements.define(i.T,i.x)},66434(t,e,n){"use strict";n.d(e,{T:()=>a,s:()=>c});var i=n(88961),r=n(63200),o=n(25964),s=n(72270);const a=(0,o.xE)("text");class d extends((0,s.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,o.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,o.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:l}={host:{selector:()=>":host"}},c=(0,r.Zz)((0,i.RF)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),i.VO,i.tQ)(d)},63595(t,e,n){"use strict";n.r(e),n.d(e,{TextClass:()=>i.s,componentName:()=>i.T});var i=n(66434);customElements.define(i.T,i.s)},66747(t,e,n){"use strict";n.r(e),n.d(e,{TrustedDevicesClass:()=>E,componentName:()=>w}),n(45400),n(24542),n(63595),n(74778),n(11065),n(56737);var i=n(63200),r=n(25964),o=n(88961),s=n(72270),a=n(77888),d=n(7720),l=n(93895),c=n(14329),p=n.n(c),g=n(86893),h=n.n(g),m=n(75407),u=n.n(m),I=n(50591),y=n.n(I),M=n(67603),x=n.n(M),b=n(39695),D=n.n(b),A=n(13369),N=n.n(A),j=n(81289),S=n.n(j);const v=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},L={desktop:{light:p(),dark:x()},mobile:{light:h(),dark:D()},tablet:{light:u(),dark:N()},unknown:{light:y(),dark:S()}},w=(0,r.xE)("trusted-devices"),C=({id:t,name:e,lastLoginDate:n,deviceType:i,isCurrent:r},o,s)=>{const a=r?'class="current-device"':"",{iconSrc:d,iconSrcDark:l}=(t=>{const e=L[t]||L.unknown;return{iconSrc:e.light,iconSrcDark:e.dark}})(i),c=s.lastLoginLabel?`${s.lastLoginLabel} `:"",p=((t,e)=>{if(Number.isNaN(parseInt(t,10)))return"";const n=new Date(t),i=n.getFullYear(),r=String(n.getMonth()+1).padStart(2,"0"),o=String(n.getDate()).padStart(2,"0"),s=n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),a={"DD-MM-YYYY":`${o}/${r}/${i}`,"YYYY-MM-DD":`${i}/${r}/${o}`,"MM-DD-YYYY":`${r}/${o}/${i}`};return`${a[e]||a["MM/DD/YYYY"]} ${s}`})(n,s.format),g=r?`<descope-badge\n bordered="true"\n size="xs"\n mode="primary"\n st-host-direction="${s.direction}"\n >\n ${s.currentDeviceLabel}\n </descope-badge>`:"",h=s.hideActions||r?"":`<descope-link\n class="remove-device"\n variant="body1"\n mode="primary"\n data-action="remove-device"\n data-device-id="${t}"\n st-host-direction="${s.direction}"\n ellipsis="true"\n >\n ${s.removeDeviceLabel}\n </descope-link>`,m=document.createElement("template");return m.innerHTML=`\n <descope-list-item ${a}>\n <div class="content">\n <div class="main">\n <span class="device">\n <descope-icon\n class="device-icon"\n src="${d}"\n src-dark="${l}">\n </descope-icon>\n <descope-text\n class="device-name"\n variant="body1"\n mode="primary">\n </descope-text>\n </span>\n <span class="panel">\n ${g}\n ${h}\n </span>\n </div>\n <div class="meta">\n <descope-text\n variant="body2"\n mode="primary"\n >\n ${c}\n </descope-text>\n <descope-text\n class="login-date"\n variant="body2"\n mode="primary"\n >\n ${p}\n </descope-text>\n </div>\n </div>\n </descope-list-item>\n `,m.content.querySelector(".device-name").textContent=e,m},z=(0,s.qu)({componentName:w,baseSelector:d.x.componentName}),{host:T}={host:{selector:()=>":host"}},E=(0,i.Zz)((0,o.RF)({mappings:{hostWidth:{...T,property:"width"},hostMinWidth:{...T,property:"min-width"},hostDirection:[{...T,property:"direction"},{selector:()=>"descope-list-item",property:"direction"},{selector:()=>"descope-text",property:"direction"}],listItemsGap:{property:d.x.cssVarList.gap},listBackgroundColor:{selector:()=>d.x.componentName,property:d.x.cssVarList.backgroundColor},listBorderRadius:{selector:()=>d.x.componentName,property:d.x.cssVarList.borderRadius},listBorderWidth:{selector:()=>d.x.componentName,property:d.x.cssVarList.borderWidth},listBoxShadow:{selector:()=>d.x.componentName,property:d.x.cssVarList.boxShadow},listPadding:[{selector:()=>d.x.componentName,property:d.x.cssVarList.verticalPadding},{selector:()=>d.x.componentName,property:d.x.cssVarList.horizontalPadding}],itemVerticalPadding:{selector:l.O.componentName,property:l.O.cssVarList.verticalPadding},itemHorizontalPadding:{selector:l.O.componentName,property:l.O.cssVarList.horizontalPadding},itemCursor:{selector:l.O.componentName,property:l.O.cssVarList.cursor},itemOutline:{selector:l.O.componentName,property:l.O.cssVarList.outline},itemBorderColor:{selector:l.O.componentName,property:l.O.cssVarList.borderColor},itemBorderRadius:{selector:l.O.componentName,property:l.O.cssVarList.borderRadius},itemBackgroundColor:{selector:l.O.componentName,property:l.O.cssVarList.backgroundColor},itemContentGap:{selector:()=>".content",property:"gap"},badgeBorderColor:{selector:a.e.componentName,property:a.e.cssVarList.borderColor},badgeTextColor:{selector:a.e.componentName,property:a.e.cssVarList.textColor},badgeBackgroundColor:{selector:a.e.componentName,property:a.e.cssVarList.backgroundColor},badgeBorderRadius:{selector:a.e.componentName,property:a.e.cssVarList.borderRadius},devicePanelGap:{selector:()=>".main",property:"gap"},deviceIconGap:{selector:()=>".device",property:"gap"},deviceIconSize:[{selector:()=>".device-icon",property:"width"},{selector:()=>".device-icon",property:"height"}],lastLoginLabelGap:{selector:" .meta",property:"gap"}}}),o.VO,(0,o.t$)({itemRenderer:C,sortFn:(t,e)=>v(e.lastLoginDate)-v(t.lastLoginDate),rerenderAttrsList:["remove-device-label","current-device-label","last-login-label","format","hide-actions"]}),o.tQ)(class extends z{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <descope-list>\n <slot name="empty-state" slot="empty-state"></slot>\n </descope-list>\n ',this.appsList=this.shadowRoot.querySelector("descope-list"),(0,r.fz)("\n :host {\n display: inline-block;\n }\n\n .descope-list-item {\n min-width: 0;\n }\n\n .current-device {\n order: -1;\n }\n\n .content {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .main {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .panel {\n display: flex;\n flex-shrink: 0;\n max-width: 75%;\n overflow: hidden;\n }\n\n .device {\n display: flex;\n min-width: 0;\n }\n\n .device-icon {\n flex-shrink: 0;\n }\n\n .meta {\n display: flex;\n }\n\n .login-date {\n min-width: fit-content;\n }\n\n descope-badge {\n min-width: 0;\n }\n\n descope-text {\n display: flex;\n align-items: center; \n min-width: 0;\n }\n descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n\n descope-link {\n overflow: hidden;\n }\n descope-link.remove-device::part(wrapper) {\n display: flex;\n width: 100%;\n }\n descope-link.remove-device {\n width: 100%;\n }\n ",this)}init(){super.init?.(),this.appsList.itemRenderer=C,this.appsList.addEventListener("click",this.onRemoveClick.bind(this))}onRemoveClick(t){if(this.readOnly)return;const e=t.target.closest("[data-device-id]"),n=e?.getAttribute("data-device-id");n&&this.dispatchEvent(new CustomEvent("remove-device-clicked",{bubbles:!0,detail:{id:n,action:"remove-device"}}))}get readOnly(){return"true"===this.getAttribute("readonly")}get hideActions(){return"true"===this.getAttribute("hide-actions")}get format(){return this.getAttribute("format")?.toUpperCase()||"MM-DD-YYYY"}get removeDeviceLabel(){return this.getAttribute("remove-device-label")||"Sign out"}get currentDeviceLabel(){return this.getAttribute("current-device-label")||"Current device"}get lastLoginLabel(){return this.getAttribute("last-login-label")||"Last login:"}get direction(){return this.getAttribute("st-host-direction")}});customElements.define(w,E)}}]);
1
+ (self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[461,1202,2294,4159,4188,4551,6724,7750],{67603(t){t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjUiIHZpZXdCb3g9IjAgMCAyNCAyNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gPHBhdGggZD0iTTIwIDE4LjVDMjEuMSAxOC41IDIxLjk5IDE3LjYgMjEuOTkgMTYuNUwyMiA2LjVDMjIgNS40IDIxLjEgNC41IDIwIDQuNUg0QzIuOSA0LjUgMiA1LjQgMiA2LjVWMTYuNUMyIDE3LjYgMi45IDE4LjUgNCAxOC41SDBWMjAuNUgyNFYxOC41SDIwWk00IDYuNUgyMFYxNi41SDRWNi41WiIgZmlsbD0iI0Y0RjVGNiIvPiA8L3N2Zz4g"},14329(t){t.exports="data:image/svg+xml;base64,PHN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aTTIyIDE3SDE4VjEwSDIyVjE3WiIgZmlsbD0id2hpdGUiLz4gPC9zdmc+IA=="},50591(t){t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjUiIHZpZXdCb3g9IjAgMCAyNCAyNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gPHBhdGggZD0iTTQgNi41SDIyVjQuNUg0QzIuOSA0LjUgMiA1LjQgMiA2LjVWMTcuNUgwVjIwLjVIMTRWMTcuNUg0VjYuNVpNMjMgOC41SDE3QzE2LjQ1IDguNSAxNiA4Ljk1IDE2IDkuNVYxOS41QzE2IDIwLjA1IDE2LjQ1IDIwLjUgMTcgMjAuNUgyM0MyMy41NSAyMC41IDI0IDIwLjA1IDI0IDE5LjVWOS41QzI0IDguOTUgMjMuNTUgOC41IDIzIDguNVpNMjIgMTcuNUgxOFYxMC41SDIyVjE3LjVaIiBmaWxsPSIjNjM2Qzc0Ii8+IDwvc3ZnPiA="},77888(t,e,n){"use strict";n.d(e,{T:()=>a,e:()=>l});var i=n(88961),r=n(72270),o=n(25964),s=n(63200);const a=(0,o.xE)("badge");class d extends((0,r.qu)({componentName:a,baseSelector:":host > div"})){static get observedAttributes(){return["data-attachment-size","shrink-to-indicator-threshold"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div>\n <slot></slot>\n\t\t</div>\n\t\t",(0,o.fz)("\n :host {\n display: inline-flex;\n }\n :host > div {\n position: relative;\n width: 100%;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ",this)}get shrinkToIndicatorThreshold(){return this.getAttribute("shrink-to-indicator-threshold")||65}#t(t){this.toggleAttribute("shrink-to-indicator",parseFloat(t)<this.shrinkToIndicatorThreshold)}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"data-attachment-size"===t&&e!==n&&this.#t(n)}}const l=(0,s.Zz)((0,i.RF)({mappings:{hostWidth:[{selector:()=>":host",property:"width"}],hostHeight:[{selector:()=>":host",property:"height"}],hostDirection:{property:"direction"},fontFamily:{},fontSize:{},fontWeight:{},textTransform:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],borderWidth:{},borderStyle:{},borderColor:{},borderRadius:{},backgroundColor:{},textColor:{property:"color"},textAlign:{},boxShadow:{},textIndent:{}}}),i.VO,i.tQ)(d)},11065(t,e,n){"use strict";n.r(e),n.d(e,{BadgeClass:()=>i.e,componentName:()=>i.T});var i=n(77888);customElements.define(i.T,i.e)},98538(t,e,n){"use strict";n.d(e,{S:()=>d,T:()=>a});var i=n(88961),r=n(25964),o=n(8512),s=n(63200);const a=(0,r.xE)("icon"),d=(0,s.Zz)((0,i.RF)({mappings:{fill:[{},{property:o.q.cssVarList.fill}]}}),i.VO,i.tQ)((0,i.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n ",excludeAttrsSync:["tabindex","class","style"],componentName:a}))},56737(t,e,n){"use strict";n.r(e),n.d(e,{IconClass:()=>i.S,componentName:()=>i.T}),n(53455);var i=n(98538);customElements.define(i.T,i.S)},8512(t,e,n){"use strict";n.d(e,{T:()=>d,q:()=>p});var i=n(88961),r=n(72270),o=n(63200),s=n(25964),a=n(18782);const d=(0,s.xE)("image"),l=["src","src-dark"];class c extends((0,r.qu)({componentName:d,baseSelector:"slot"})){static get observedAttributes(){return l}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,s.fz)("\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n ",this)}init(){super.init?.(),this.toggleVisibility(this.getSrc)}onThemeChange(){this.renderImage()}toggleVisibility(t){t?this.classList.remove("hidden"):this.classList.add("hidden")}get altText(){return this.getAttribute("alt")||""}get legacySrc(){return this.getAttribute("src")}get themeSrc(){return this.getAttribute(`src-${this.currentThemeName}`)}get getSrc(){return this.themeSrc||this.legacySrc}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach(t=>{t.setAttribute("fill",`var(${p.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)})}renderImage(){this.toggleVisibility(this.getSrc),(0,a.m)(this.getSrc,this.altText).then(t=>{this.innerHTML="",t&&(this.updateFillColor(t),this.appendChild(t))})}shouldRender(t){const e=this.getAttribute(t);return this.getSrc===e}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&this.shouldRender(t)&&this.renderImage()}}const p=(0,o.Zz)((0,i.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),i.VO,i.tQ)(c)},18782(t,e,n){"use strict";n.d(e,{m:()=>o});var i=n(25414);const r=t=>{const e=i.A.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["image"],FORBID_TAGS:["defs"]});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},o=async(t,e)=>{try{let n;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));n=r(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),i=await e.text();n=r(i)}else n=((t,e)=>{const n=document.createElement("img");return n.setAttribute("src",t),n.setAttribute("alt",e),n})(t,e);return n.style.setProperty("max-width","100%"),n.style.setProperty("max-height","100%"),n}catch{return null}}},53455(t,e,n){"use strict";n.r(e),n.d(e,{ImageClass:()=>i.q,componentName:()=>i.T});var i=n(8512);customElements.define(i.T,i.q)},75464(t,e,n){"use strict";n.d(e,{J:()=>y,T:()=>d});var i=n(88961),r=n(63200),o=n(25964),s=n(72270),a=n(66434);const d=(0,o.xE)("link"),l=["href","readonly"];class c extends((0,s.qu)({componentName:d,baseSelector:":host a"})){static get observedAttributes(){return l.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t',(0,o.fz)('\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,o.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,o.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const p={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>a.s.componentName}},{anchor:g,text:h,host:m,wrapper:u,link:I}=p,y=(0,r.Zz)((0,i.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...h,property:"direction"},textAlign:u,textDecoration:{...I,property:"text-decoration",fallback:"none"},textColor:[{...g,property:"color"},{...h,property:a.s.cssVarList.textColor}],cursor:g}}),i.VO,i.tQ)(c)},90512(t,e,n){"use strict";n.r(e),n.d(e,{LinkClass:()=>i.J,componentName:()=>i.T});var i=n(75464);n(63595),customElements.define(i.T,i.J)},93895(t,e,n){"use strict";n.d(e,{O:()=>d,T:()=>a});var i=n(88961),r=n(63200),o=n(25964),s=n(72270);const a=(0,o.xE)("list-item"),d=(0,r.Zz)((0,i.RF)({mappings:{verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],backgroundColor:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},outline:{},cursor:{},gap:{},maxWidth:{selector:()=>":host"},alignItems:{},flexDirection:{},transition:{}}}),i.VO,i.tQ,t=>class extends t{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <slot></slot>\n ",(0,o.fz)("\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n ",this)}},i.y)((0,s.qu)({componentName:a,baseSelector:"slot"}))},24542(t,e,n){"use strict";n.r(e),n.d(e,{ListItemClass:()=>i.O,componentName:()=>i.T});var i=n(93895);customElements.define(i.T,i.O)},7720(t,e,n){"use strict";n.d(e,{T:()=>d,x:()=>c});var i=n(88961),r=n(63200),o=n(25964),s=n(93895),a=n(72270);const d=(0,o.xE)("list");class l extends((0,a.qu)({componentName:d,baseSelector:".wrapper"})){static get observedAttributes(){return["variant","readonly"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <slot></slot>\n <slot name="empty-state">\n No item...\n </slot>\n </div>\n\t',(0,o.fz)('\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name="empty-state"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name="empty-state"] {\n display: none;\n }\n :host([empty]) slot[name="empty-state"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n ',this)}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}#e(){0===this.items.length?this.setAttribute("empty","true"):this.removeAttribute("empty")}get variant(){return this.getAttribute("variant")||"list"}#n(){this.items.forEach(t=>{let e=t;e.localName!==s.O.componentName&&(e=t.querySelector(s.O.componentName));const n="tiles"===this.variant?"tile":"row";e?.setAttribute("variant",n)})}init(){super.init?.(),(0,o.Ge)(this,()=>{this.#e(),this.#n(),this.#i()})}get isReadOnly(){return"true"===this.getAttribute("readonly")}#i(){this.items.forEach(t=>{this.isReadOnly?t.setAttribute("inert",""):t.removeAttribute("inert")})}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("variant"===t?this.#n():"readonly"===t&&this.#i())}}const c=(0,r.Zz)((0,i.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},maxHeight:{selector:()=>":host"},minHeight:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],hostDirection:{selector:()=>":host",property:"direction"},fontFamily:{},gap:{},backgroundColor:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{},gridTemplateColumns:{},maxItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"max-width"},minItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"min-width"},maxRowItems:{property:"max-row-items"},itemsHorizontalAlign:{selector:()=>"::slotted(*)",property:"justify-self"},emptyStateTextColor:{selector:()=>'slot[name="empty-state"]',property:"color"},emptyStateTextFontFamily:{selector:()=>'slot[name="empty-state"]',property:"font-family"}}}),i.VO,i.tQ)(l)},45400(t,e,n){"use strict";n.r(e),n.d(e,{ListClass:()=>i.x,componentName:()=>i.T}),n(24542);var i=n(7720);customElements.define(i.T,i.x)},66434(t,e,n){"use strict";n.d(e,{T:()=>a,s:()=>c});var i=n(88961),r=n(63200),o=n(25964),s=n(72270);const a=(0,o.xE)("text");class d extends((0,s.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,o.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,o.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:l}={host:{selector:()=>":host"}},c=(0,r.Zz)((0,i.RF)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),i.VO,i.tQ)(d)},63595(t,e,n){"use strict";n.r(e),n.d(e,{TextClass:()=>i.s,componentName:()=>i.T});var i=n(66434);customElements.define(i.T,i.s)},66747(t,e,n){"use strict";n.r(e),n.d(e,{TrustedDevicesClass:()=>E,componentName:()=>w}),n(45400),n(24542),n(63595),n(90512),n(11065),n(56737);var i=n(63200),r=n(25964),o=n(88961),s=n(72270),a=n(77888),d=n(7720),l=n(93895),c=n(14329),p=n.n(c),g=n(86893),h=n.n(g),m=n(75407),u=n.n(m),I=n(50591),y=n.n(I),M=n(67603),x=n.n(M),b=n(39695),D=n.n(b),A=n(13369),N=n.n(A),j=n(81289),S=n.n(j);const v=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},L={desktop:{light:p(),dark:x()},mobile:{light:h(),dark:D()},tablet:{light:u(),dark:N()},unknown:{light:y(),dark:S()}},w=(0,r.xE)("trusted-devices"),C=({id:t,name:e,lastLoginDate:n,deviceType:i,isCurrent:r},o,s)=>{const a=r?'class="current-device"':"",{iconSrc:d,iconSrcDark:l}=(t=>{const e=L[t]||L.unknown;return{iconSrc:e.light,iconSrcDark:e.dark}})(i),c=s.lastLoginLabel?`${s.lastLoginLabel} `:"",p=((t,e)=>{if(Number.isNaN(parseInt(t,10)))return"";const n=new Date(t),i=n.getFullYear(),r=String(n.getMonth()+1).padStart(2,"0"),o=String(n.getDate()).padStart(2,"0"),s=n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),a={"DD-MM-YYYY":`${o}/${r}/${i}`,"YYYY-MM-DD":`${i}/${r}/${o}`,"MM-DD-YYYY":`${r}/${o}/${i}`};return`${a[e]||a["MM-DD-YYYY"]} ${s}`})(n,s.format),g=r?`<descope-badge\n bordered="true"\n size="xs"\n mode="primary"\n st-host-direction="${s.direction}"\n >\n ${s.currentDeviceLabel}\n </descope-badge>`:"",h=s.hideActions||r?"":`<descope-link\n class="remove-device"\n variant="body1"\n mode="primary"\n data-action="remove-device"\n data-device-id="${t}"\n st-host-direction="${s.direction}"\n ellipsis="true"\n >\n ${s.removeDeviceLabel}\n </descope-link>`,m=document.createElement("template");return m.innerHTML=`\n <descope-list-item ${a}>\n <div class="content">\n <div class="main">\n <span class="device">\n <descope-icon\n class="device-icon"\n src="${d}"\n src-dark="${l}">\n </descope-icon>\n <descope-text\n class="device-name"\n variant="body1"\n mode="primary">\n </descope-text>\n </span>\n <span class="panel">\n ${g}\n ${h}\n </span>\n </div>\n <div class="meta">\n <descope-text\n variant="body2"\n mode="primary"\n >\n ${c}\n </descope-text>\n <descope-text\n class="login-date"\n variant="body2"\n mode="primary"\n >\n ${p}\n </descope-text>\n </div>\n </div>\n </descope-list-item>\n `,m.content.querySelector(".device-name").textContent=e,m},z=(0,s.qu)({componentName:w,baseSelector:d.x.componentName}),{host:T}={host:{selector:()=>":host"}},E=(0,i.Zz)((0,o.RF)({mappings:{hostWidth:{...T,property:"width"},hostMinWidth:{...T,property:"min-width"},hostDirection:[{...T,property:"direction"},{selector:()=>"descope-list-item",property:"direction"},{selector:()=>"descope-text",property:"direction"}],listItemsGap:{property:d.x.cssVarList.gap},listBackgroundColor:{selector:()=>d.x.componentName,property:d.x.cssVarList.backgroundColor},listBorderRadius:{selector:()=>d.x.componentName,property:d.x.cssVarList.borderRadius},listBorderWidth:{selector:()=>d.x.componentName,property:d.x.cssVarList.borderWidth},listBoxShadow:{selector:()=>d.x.componentName,property:d.x.cssVarList.boxShadow},listPadding:[{selector:()=>d.x.componentName,property:d.x.cssVarList.verticalPadding},{selector:()=>d.x.componentName,property:d.x.cssVarList.horizontalPadding}],itemVerticalPadding:{selector:l.O.componentName,property:l.O.cssVarList.verticalPadding},itemHorizontalPadding:{selector:l.O.componentName,property:l.O.cssVarList.horizontalPadding},itemCursor:{selector:l.O.componentName,property:l.O.cssVarList.cursor},itemOutline:{selector:l.O.componentName,property:l.O.cssVarList.outline},itemBorderColor:{selector:l.O.componentName,property:l.O.cssVarList.borderColor},itemBorderRadius:{selector:l.O.componentName,property:l.O.cssVarList.borderRadius},itemBackgroundColor:{selector:l.O.componentName,property:l.O.cssVarList.backgroundColor},itemContentGap:{selector:()=>".content",property:"gap"},badgeBorderColor:{selector:a.e.componentName,property:a.e.cssVarList.borderColor},badgeTextColor:{selector:a.e.componentName,property:a.e.cssVarList.textColor},badgeBackgroundColor:{selector:a.e.componentName,property:a.e.cssVarList.backgroundColor},badgeBorderRadius:{selector:a.e.componentName,property:a.e.cssVarList.borderRadius},devicePanelGap:{selector:()=>".main",property:"gap"},deviceIconGap:{selector:()=>".device",property:"gap"},deviceIconSize:[{selector:()=>".device-icon",property:"width"},{selector:()=>".device-icon",property:"height"}],lastLoginLabelGap:{selector:" .meta",property:"gap"}}}),o.VO,(0,o.t$)({itemRenderer:C,sortFn:(t,e)=>v(e.lastLoginDate)-v(t.lastLoginDate),rerenderAttrsList:["remove-device-label","current-device-label","last-login-label","format","hide-actions"]}),o.tQ)(class extends z{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <descope-list>\n <slot name="empty-state" slot="empty-state"></slot>\n </descope-list>\n ',this.appsList=this.shadowRoot.querySelector("descope-list"),(0,r.fz)("\n :host {\n display: inline-block;\n }\n\n .descope-list-item {\n min-width: 0;\n }\n\n .current-device {\n order: -1;\n }\n\n .content {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .main {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .panel {\n display: flex;\n flex-shrink: 0;\n max-width: 75%;\n overflow: hidden;\n }\n\n .device {\n display: flex;\n min-width: 0;\n }\n\n .device-icon {\n flex-shrink: 0;\n }\n\n .meta {\n display: flex;\n }\n\n .login-date {\n min-width: fit-content;\n }\n\n descope-badge {\n min-width: 0;\n }\n\n descope-text {\n display: flex;\n align-items: center; \n min-width: 0;\n }\n descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n\n descope-link {\n overflow: hidden;\n }\n descope-link.remove-device::part(wrapper) {\n display: flex;\n width: 100%;\n }\n descope-link.remove-device {\n width: 100%;\n }\n ",this)}init(){super.init?.(),this.appsList.itemRenderer=C,this.appsList.addEventListener("click",this.onRemoveClick.bind(this))}onRemoveClick(t){if(this.readOnly)return;const e=t.target.closest("[data-device-id]"),n=e?.getAttribute("data-device-id");n&&this.dispatchEvent(new CustomEvent("remove-device-clicked",{bubbles:!0,detail:{id:n,action:"remove-device"}}))}get readOnly(){return"true"===this.getAttribute("readonly")}get hideActions(){return"true"===this.getAttribute("hide-actions")}get format(){return this.getAttribute("format")?.toUpperCase()||"MM-DD-YYYY"}get removeDeviceLabel(){return this.getAttribute("remove-device-label")||"Sign out"}get currentDeviceLabel(){return this.getAttribute("current-device-label")||"Current device"}get lastLoginLabel(){return this.getAttribute("last-login-label")||"Last login:"}get direction(){return this.getAttribute("st-host-direction")}});customElements.define(w,E)}}]);
2
2
  //# sourceMappingURL=descope-trusted-devices.js.map