@descope/web-components-ui 3.11.4 → 3.11.6

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 (49) hide show
  1. package/dist/cjs/index.cjs.js +37 -16
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +37 -16
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/DescopeDev.js +1 -1
  6. package/dist/umd/DescopeDev.js.map +1 -1
  7. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  8. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
  9. package/dist/umd/descope-button.js +1 -1
  10. package/dist/umd/descope-button.js.map +1 -1
  11. package/dist/umd/descope-code-snippet-index-js.js +1 -1
  12. package/dist/umd/descope-code-snippet-index-js.js.map +1 -1
  13. package/dist/umd/descope-collapsible-container.js +1 -1
  14. package/dist/umd/descope-collapsible-container.js.map +1 -1
  15. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  16. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  17. package/dist/umd/descope-grid-index-js.js +1 -1
  18. package/dist/umd/descope-grid-index-js.js.map +1 -1
  19. package/dist/umd/descope-icon.js +1 -1
  20. package/dist/umd/descope-icon.js.map +1 -1
  21. package/dist/umd/descope-image.js.map +1 -1
  22. package/dist/umd/descope-multi-line-mappings.js +1 -1
  23. package/dist/umd/descope-multi-line-mappings.js.map +1 -1
  24. package/dist/umd/descope-outbound-app-button.js +1 -1
  25. package/dist/umd/descope-outbound-app-button.js.map +1 -1
  26. package/dist/umd/descope-outbound-apps.js +1 -1
  27. package/dist/umd/descope-outbound-apps.js.map +1 -1
  28. package/dist/umd/descope-third-party-app-logo-index-js.js +1 -1
  29. package/dist/umd/descope-third-party-app-logo-index-js.js.map +1 -1
  30. package/dist/umd/descope-timer-button.js +1 -1
  31. package/dist/umd/descope-timer-button.js.map +1 -1
  32. package/dist/umd/descope-timer.js +1 -1
  33. package/dist/umd/descope-timer.js.map +1 -1
  34. package/dist/umd/descope-trusted-devices.js +1 -1
  35. package/dist/umd/descope-trusted-devices.js.map +1 -1
  36. package/dist/umd/descope-upload-file-index-js.js +2 -2
  37. package/dist/umd/descope-upload-file-index-js.js.map +1 -1
  38. package/dist/umd/descope-user-attribute-index-js.js +4 -4
  39. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  40. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  41. package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
  42. package/dist/umd/descope-user-passkeys.js +1 -1
  43. package/dist/umd/descope-user-passkeys.js.map +1 -1
  44. package/dist/umd/index.js +1 -1
  45. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  46. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  47. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  48. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  49. package/package.json +36 -36
@@ -1 +1 @@
1
- {"version":3,"file":"descope-code-snippet-index-js.js","mappings":"+HAAAA,EAAOC,QAAU,gX,WCAjBD,EAAOC,QAAU,gd,oGCUV,MAAMC,GAAgB,QAAiB,QAEjCC,GAAY,SACvB,QAAiB,CACfC,SAAU,CACRC,KAAM,CAAC,CAAC,EAAG,CAAEC,SAAU,IAAWC,WAAWF,UAGjD,KACA,KAPuB,EASvB,QAAY,CACVG,MAAO,GACPC,eAAgB,gBAChBC,MAAO,IAAM,6FAMbC,iBAAkB,CAAC,WAAY,QAAS,SACxCT,kB,4GC3BJU,eAAeC,OAAO,IAAe,I,+GCQ9B,MAAMX,GAAgB,QAAiB,SAExCY,EAAW,CAAC,MAAO,YAEzB,MAAMC,WAAiB,QAAgB,CACrCb,gBACAc,aAAc,UAEd,6BAAWC,GACT,OAAOH,CACT,CAEA,WAAAI,GACEC,QAEAC,KAAKC,aAAa,CAAEC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ACvEmN,gBAAiB,IAAKvG,EAAS5G,SAAU,YAG7C,KACA,KAlE8B,CAmE9BqF,GCvVF/E,eAAeC,OAAOX,EAAe8J,G","sources":["webpack://@descope/web-components-ui/./src/components/descope-code-snippet/check-icon.svg","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/copy-icon.svg","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/index.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/CodeSnippetClass.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/index.js"],"sourcesContent":["module.exports = \"data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iY2hlY2staWNvbiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4gPHBvbHlsaW5lIHBvaW50cz0iMjAgNiA5IDE3IDQgMTIiPjwvcG9seWxpbmU+IDwvc3ZnPiA=\"","module.exports = \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPiA8cmVjdCB4PSI5IiB5PSI5IiB3aWR0aD0iMTMiIGhlaWdodD0iMTMiIHJ4PSIyIiByeT0iMiI+PC9yZWN0PiA8cGF0aCBkPSJNNSAxNUg0YTIgMiAwIDAgMS0yLTJWNGEyIDIgMCAwIDEgMi0yaDlhMiAyIDAgMCAxIDIgMnYxIj48L3BhdGg+IDwvc3ZnPiA=\"","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style'],\n componentName,\n }),\n);\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n","/* eslint-disable no-use-before-define */\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\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 `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n // eslint-disable-next-line class-methods-use-this\n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n","export const decode = (input) => {\n const txt = document.createElement('textarea');\n txt.innerHTML = input;\n return txt.value;\n};\n\nexport const tpl = (input, inline) => (inline ? input : `<pre>${input}</pre>`);\n","import hljs from 'highlight.js';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { compose } from '../../helpers';\nimport { getComponentName, observeChildren } from '../../helpers/componentHelpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { decode, tpl } from './helpers';\nimport copyIconSrc from './copy-icon.svg';\nimport checkIconSrc from './check-icon.svg';\n\nexport const componentName = getComponentName('code-snippet');\n\nclass CodeSnippet extends createBaseClass({ componentName, baseSelector: ':host > .wrapper' }) {\n static get observedAttributes() {\n return ['lang', 'inline', 'copy-button'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <code class=\"hljs\"></code>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n width: 100%;\n }\n .wrapper {\n display: grid;\n width: 100%;\n }\n code {\n grid-area: 1 / 1;\n display: block;\n width: 100%;\n min-height: 1em;\n overflow-x: auto;\n }\n pre {\n margin: 0;\n }\n .copy-btn {\n grid-area: 1 / 1;\n place-self: start end;\n margin: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border-style: solid;\n cursor: pointer;\n opacity: 0;\n transition: opacity 150ms ease, background 150ms ease;\n }\n .wrapper:hover .copy-btn,\n .copy-btn:focus-visible {\n opacity: 1;\n }\n .copy-btn descope-icon {\n width: 16px;\n height: 16px;\n pointer-events: none;\n flex-shrink: 0;\n }\n .copy-btn .check-icon {\n display: none;\n }\n .copy-btn.copied .check-icon {\n display: block;\n }\n .copy-btn.copied descope-icon:not(.check-icon) {\n display: none;\n }\n `,\n this\n );\n }\n\n init() {\n super.init?.();\n\n this.lang = this.getAttribute('lang');\n this.isInline = this.getAttribute('inline') === 'true';\n\n if (this.getAttribute('copy-button') === 'true') {\n this.#initCopyButton();\n }\n\n observeChildren(this, this.#renderSnippet.bind(this));\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('code');\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'inline') {\n this.isInline = newValue;\n }\n\n if (attrName === 'lang') {\n this.lang = newValue;\n }\n\n if (attrName === 'copy-button') {\n if (newValue === 'true') {\n this.#initCopyButton();\n } else {\n this.#destroyCopyButton();\n }\n }\n\n this.#renderSnippet();\n }\n }\n\n // ── Copy button ────────────────────────────────────────────────────────────\n\n #initCopyButton() {\n if (this.shadowRoot.querySelector('.copy-btn')) return;\n\n const btn = document.createElement('button');\n btn.className = 'copy-btn';\n btn.type = 'button';\n btn.setAttribute('aria-label', 'Copy code');\n const copyIcon = document.createElement('descope-icon');\n copyIcon.setAttribute('src', copyIconSrc);\n\n const checkIcon = document.createElement('descope-icon');\n checkIcon.setAttribute('src', checkIconSrc);\n checkIcon.classList.add('check-icon');\n\n btn.appendChild(copyIcon);\n btn.appendChild(checkIcon);\n btn.addEventListener('click', () => this.#handleCopyClick());\n\n this.shadowRoot.querySelector('.wrapper').appendChild(btn);\n }\n\n #destroyCopyButton() {\n this.shadowRoot.querySelector('.copy-btn')?.remove();\n }\n\n #handleCopyClick() {\n const btn = this.shadowRoot.querySelector('.copy-btn');\n navigator.clipboard\n .writeText(decode(this.textContent))\n .then(() => {\n btn.classList.add('copied');\n setTimeout(() => btn.classList.remove('copied'), 2000);\n })\n .catch(() => {});\n }\n\n // ── Snippet rendering ──────────────────────────────────────────────────────\n\n #renderSnippet() {\n const sanitized = decode(this.textContent);\n const language = this.lang;\n\n if (!language) {\n this.contentNode.textContent = sanitized;\n return;\n }\n\n const { value: highlighted } = hljs.highlight(sanitized, { language });\n\n this.contentNode.innerHTML = tpl(highlighted, this.isInline);\n }\n}\n\nconst copyBtn = { selector: () => '.copy-btn' };\n\nconst {\n root,\n docTag,\n keyword,\n metaKeyword,\n templateTag,\n templateVariable,\n type,\n variableLanguage,\n title,\n titleClass,\n titleClassInherited,\n titleFunction,\n attr,\n attribute,\n literal,\n meta,\n number,\n operator,\n variable,\n selectorAttr,\n selectorClass,\n selectorId,\n regexp,\n string,\n metaString,\n builtIn,\n symbol,\n comment,\n code,\n formula,\n name,\n quote,\n selectorTag,\n selectorPseudo,\n subst,\n section,\n bullet,\n emphasis,\n strong,\n addition,\n deletion,\n charEscape,\n link,\n params,\n property,\n punctuation,\n tag,\n} = {\n root: { selector: () => '.hljs' },\n docTag: { selector: () => '.hljs-doctag' },\n keyword: { selector: () => '.hljs-keyword' },\n metaKeyword: { selector: () => '.hljs-meta .hljs-keyword' },\n templateTag: { selector: () => '.hljs-template-tag' },\n templateVariable: { selector: () => '.hljs-template-variable' },\n type: { selector: () => '.hljs-type' },\n variableLanguage: { selector: () => '.hljs-variable.language' },\n title: { selector: () => '.hljs-title' },\n titleClass: { selector: () => '.hljs-title.class_' },\n titleClassInherited: { selector: () => '.hljs-title.class_.inherited__' },\n titleFunction: { selector: () => '.hljs-title.function_' },\n attr: { selector: () => '.hljs-attr' },\n attribute: { selector: () => '.hljs-attribute' },\n literal: { selector: () => '.hljs-literal' },\n meta: { selector: () => '.hljs-meta' },\n number: { selector: () => '.hljs-number' },\n operator: { selector: () => '.hljs-operator' },\n variable: { selector: () => '.hljs-variable' },\n selectorAttr: { selector: () => '.hljs-selector-attr' },\n selectorClass: { selector: () => '.hljs-selector-class' },\n selectorId: { selector: () => '.hljs-selector-id' },\n regexp: { selector: () => '.hljs-regexp' },\n string: { selector: () => '.hljs-string' },\n metaString: { selector: () => '.hljs-meta .hljs-string' },\n builtIn: { selector: () => '.hljs-built_in' },\n symbol: { selector: () => '.hljs-symbol' },\n comment: { selector: () => '.hljs-comment' },\n code: { selector: () => '.hljs-code' },\n formula: { selector: () => '.hljs-formula' },\n name: { selector: () => '.hljs-name' },\n quote: { selector: () => '.hljs-quote' },\n selectorTag: { selector: () => '.hljs-selector-tag' },\n selectorPseudo: { selector: () => '.hljs-selector-pseudo' },\n subst: { selector: () => '.hljs-subst' },\n section: { selector: () => '.hljs-section' },\n bullet: { selector: () => '.hljs-bullet' },\n emphasis: { selector: () => '.hljs-emphasis' },\n strong: { selector: () => '.hljs-strong' },\n addition: { selector: () => '.hljs-addition' },\n deletion: { selector: () => '.hljs-deletion' },\n charEscape: { selector: () => '.hljs-char.escape' },\n link: { selector: () => '.hljs-link' },\n params: { selector: () => '.hljs-params' },\n property: { selector: () => '.hljs-property' },\n punctuation: { selector: () => '.hljs-punctuation' },\n tag: { selector: () => '.hljs-tag' },\n};\n\nexport const CodeSnippetClass = compose(\n createStyleMixin({\n mappings: {\n rootBgColor: { ...root, property: 'background-color' },\n rootTextColor: { ...root, property: 'color' },\n docTagTextColor: { ...docTag, property: 'color' },\n keywordTextColor: { ...keyword, property: 'color' },\n metaKeywordTextColor: { ...metaKeyword, property: 'color' },\n templateTagTextColor: { ...templateTag, property: 'color' },\n templateVariableTextColor: { ...templateVariable, property: 'color' },\n typeTextColor: { ...type, property: 'color' },\n variableLanguageTextColor: { ...variableLanguage, property: 'color' },\n titleTextColor: { ...title, property: 'color' },\n titleClassTextColor: { ...titleClass, property: 'color' },\n titleClassInheritedTextColor: { ...titleClassInherited, property: 'color' },\n titleFunctionTextColor: { ...titleFunction, property: 'color' },\n attrTextColor: { ...attr, property: 'color' },\n attributeTextColor: { ...attribute, property: 'color' },\n literalTextColor: { ...literal, property: 'color' },\n metaTextColor: { ...meta, property: 'color' },\n numberTextColor: { ...number, property: 'color' },\n operatorTextColor: { ...operator, property: 'color' },\n variableTextColor: { ...variable, property: 'color' },\n selectorAttrTextColor: { ...selectorAttr, property: 'color' },\n selectorClassTextColor: { ...selectorClass, property: 'color' },\n selectorIdTextColor: { ...selectorId, property: 'color' },\n regexpTextColor: { ...regexp, property: 'color' },\n stringTextColor: { ...string, property: 'color' },\n metaStringTextColor: { ...metaString, property: 'color' },\n builtInTextColor: { ...builtIn, property: 'color' },\n symbolTextColor: { ...symbol, property: 'color' },\n commentTextColor: { ...comment, property: 'color' },\n codeTextColor: { ...code, property: 'color' },\n formulaTextColor: { ...formula, property: 'color' },\n nameTextColor: { ...name, property: 'color' },\n quoteTextColor: { ...quote, property: 'color' },\n selectorTagTextColor: { ...selectorTag, property: 'color' },\n selectorPseudoTextColor: { ...selectorPseudo, property: 'color' },\n substTextColor: { ...subst, property: 'color' },\n sectionTextColor: { ...section, property: 'color' },\n bulletTextColor: { ...bullet, property: 'color' },\n emphasisTextColor: { ...emphasis, property: 'color' },\n strongTextColor: { ...strong, property: 'color' },\n additionTextColor: { ...addition, property: 'color' },\n additionBgColor: { ...addition, property: 'background-color' },\n deletionTextColor: { ...deletion, property: 'color' },\n deletionBgColor: { ...deletion, property: 'background-color' },\n charEscapeTextColor: { ...charEscape, property: 'color' },\n linkTextColor: { ...link, property: 'color' },\n paramsTextColor: { ...params, property: 'color' },\n propertyTextColor: { ...property, property: 'color' },\n punctuationTextColor: { ...punctuation, property: 'color' },\n tagTextColor: { ...tag, property: 'color' },\n copyButtonSize: [\n { ...copyBtn, property: 'width' },\n { ...copyBtn, property: 'height' },\n ],\n copyButtonBorderRadius: { ...copyBtn, property: 'border-radius' },\n copyButtonBorderWidth: { ...copyBtn, property: 'border-width' },\n copyButtonBorderColor: { ...copyBtn, property: 'border-color' },\n copyButtonBgColor: { ...copyBtn, property: 'background-color' },\n copyButtonHoverBgColor: { selector: () => '.copy-btn:hover', property: 'background-color' },\n copyButtonColor: { ...copyBtn, property: 'color' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(CodeSnippet);\n","import '@descope-ui/descope-icon';\nimport { componentName, CodeSnippetClass } from './CodeSnippetClass';\n\ncustomElements.define(componentName, CodeSnippetClass);\n\nexport { CodeSnippetClass, componentName };\n"],"names":["module","exports","componentName","IconClass","mappings","fill","property","cssVarList","slots","wrappedEleName","style","excludeAttrsSync","customElements","define","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","getAttribute","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","height","selector","width","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","decode","input","txt","value","CodeSnippet","createBaseClass","lang","isInline","bind","contentNode","shadowRoot","btn","className","type","copyIcon","checkIcon","addEventListener","navigator","clipboard","writeText","textContent","setTimeout","catch","sanitized","language","highlighted","highlight","copyBtn","root","docTag","keyword","metaKeyword","templateTag","templateVariable","variableLanguage","title","titleClass","titleClassInherited","titleFunction","attr","attribute","literal","meta","number","operator","variable","selectorAttr","selectorClass","selectorId","regexp","string","metaString","builtIn","symbol","comment","code","formula","name","quote","selectorTag","selectorPseudo","subst","section","bullet","emphasis","strong","addition","deletion","charEscape","link","params","punctuation","tag","CodeSnippetClass","rootBgColor","rootTextColor","docTagTextColor","keywordTextColor","metaKeywordTextColor","templateTagTextColor","templateVariableTextColor","typeTextColor","variableLanguageTextColor","titleTextColor","titleClassTextColor","titleClassInheritedTextColor","titleFunctionTextColor","attrTextColor","attributeTextColor","literalTextColor","metaTextColor","numberTextColor","operatorTextColor","variableTextColor","selectorAttrTextColor","selectorClassTextColor","selectorIdTextColor","regexpTextColor","stringTextColor","metaStringTextColor","builtInTextColor","symbolTextColor","commentTextColor","codeTextColor","formulaTextColor","nameTextColor","quoteTextColor","selectorTagTextColor","selectorPseudoTextColor","substTextColor","sectionTextColor","bulletTextColor","emphasisTextColor","strongTextColor","additionTextColor","additionBgColor","deletionTextColor","deletionBgColor","charEscapeTextColor","linkTextColor","paramsTextColor","propertyTextColor","punctuationTextColor","tagTextColor","copyButtonSize","copyButtonBorderRadius","copyButtonBorderWidth","copyButtonBorderColor","copyButtonBgColor","copyButtonHoverBgColor","copyButtonColor"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-code-sn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U,oBAC1CqM,kBAAmB,IAAKjD,GAAUpJ,SAAU,SAC5CsM,gBAAiB,IAAKlD,GAAUpJ,SAAU,oBAC1CuM,oBAAqB,IAAKlD,GAAYrJ,SAAU,SAChDwM,cAAe,IAAK,GAAMxM,SAAU,SACpCyM,gBAAiB,IAAKlD,GAAQvJ,SAAU,SACxC0M,kBAAmB,IAAK1M,GAAUA,SAAU,SAC5C2M,qBAAsB,IAAKnD,GAAaxJ,SAAU,SAClD4M,aAAc,IAAKnD,GAAKzJ,SAAU,SAClC6M,eAAgB,CACd,IAAKjG,EAAS5G,SAAU,SACxB,IAAK4G,EAAS5G,SAAU,WAE1B8M,uBAAwB,IAAKlG,EAAS5G,SAAU,iBAChD+M,sBAAuB,IAAKnG,EAAS5G,SAAU,gBAC/CgN,sBAAuB,IAAKpG,EAAS5G,SAAU,gBAC/CiN,kBAAmB,IAAKrG,EAAS5G,SAAU,oBAC3CkN,uBAAwB,CAAE/M,SAAU,IAAM,kBAAmBH,SAAU,oBACvEmN,gBAAiB,IAAKvG,EAAS5G,SAAU,YAG7C,KACA,KAlE8B,CAmE9BqF,GCvVF5E,eAAeC,OAAOd,EAAe8J,G","sources":["webpack://@descope/web-components-ui/./src/components/descope-code-snippet/check-icon.svg","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/copy-icon.svg","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/index.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/helpers.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/CodeSnippetClass.js","webpack://@descope/web-components-ui/./src/components/descope-code-snippet/index.js"],"sourcesContent":["module.exports = \"data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iY2hlY2staWNvbiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4gPHBvbHlsaW5lIHBvaW50cz0iMjAgNiA5IDE3IDQgMTIiPjwvcG9seWxpbmU+IDwvc3ZnPiA=\"","module.exports = \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPiA8cmVjdCB4PSI5IiB5PSI5IiB3aWR0aD0iMTMiIGhlaWdodD0iMTMiIHJ4PSIyIiByeT0iMiI+PC9yZWN0PiA8cGF0aCBkPSJNNSAxNUg0YTIgMiAwIDAgMS0yLTJWNGEyIDIgMCAwIDEgMi0yaDlhMiAyIDAgMCAxIDIgMnYxIj48L3BhdGg+IDwvc3ZnPiA=\"","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style', 'st-height', 'st-width'],\n componentName,\n }),\n);\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n"," \nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\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 `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n \n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n","export const decode = (input) => {\n const txt = document.createElement('textarea');\n txt.innerHTML = input;\n return txt.value;\n};\n\nexport const tpl = (input, inline) => (inline ? input : `<pre>${input}</pre>`);\n","import hljs from 'highlight.js';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { compose } from '../../helpers';\nimport { getComponentName, observeChildren } from '../../helpers/componentHelpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { decode, tpl } from './helpers';\nimport copyIconSrc from './copy-icon.svg';\nimport checkIconSrc from './check-icon.svg';\n\nexport const componentName = getComponentName('code-snippet');\n\nclass CodeSnippet extends createBaseClass({ componentName, baseSelector: ':host > .wrapper' }) {\n static get observedAttributes() {\n return ['lang', 'inline', 'copy-button'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <code class=\"hljs\"></code>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-block;\n width: 100%;\n }\n .wrapper {\n display: grid;\n width: 100%;\n }\n code {\n grid-area: 1 / 1;\n display: block;\n width: 100%;\n min-height: 1em;\n overflow-x: auto;\n }\n pre {\n margin: 0;\n }\n .copy-btn {\n grid-area: 1 / 1;\n place-self: start end;\n margin: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border-style: solid;\n cursor: pointer;\n opacity: 0;\n transition: opacity 150ms ease, background 150ms ease;\n }\n .wrapper:hover .copy-btn,\n .copy-btn:focus-visible {\n opacity: 1;\n }\n .copy-btn descope-icon {\n width: 16px;\n height: 16px;\n pointer-events: none;\n flex-shrink: 0;\n }\n .copy-btn .check-icon {\n display: none;\n }\n .copy-btn.copied .check-icon {\n display: block;\n }\n .copy-btn.copied descope-icon:not(.check-icon) {\n display: none;\n }\n `,\n this\n );\n }\n\n init() {\n super.init?.();\n\n this.lang = this.getAttribute('lang');\n this.isInline = this.getAttribute('inline') === 'true';\n\n if (this.getAttribute('copy-button') === 'true') {\n this.#initCopyButton();\n }\n\n observeChildren(this, this.#renderSnippet.bind(this));\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('code');\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue !== newValue) {\n if (attrName === 'inline') {\n this.isInline = newValue;\n }\n\n if (attrName === 'lang') {\n this.lang = newValue;\n }\n\n if (attrName === 'copy-button') {\n if (newValue === 'true') {\n this.#initCopyButton();\n } else {\n this.#destroyCopyButton();\n }\n }\n\n this.#renderSnippet();\n }\n }\n\n // ── Copy button ────────────────────────────────────────────────────────────\n\n #initCopyButton() {\n if (this.shadowRoot.querySelector('.copy-btn')) return;\n\n const btn = document.createElement('button');\n btn.className = 'copy-btn';\n btn.type = 'button';\n btn.setAttribute('aria-label', 'Copy code');\n const copyIcon = document.createElement('descope-icon');\n copyIcon.setAttribute('src', copyIconSrc);\n\n const checkIcon = document.createElement('descope-icon');\n checkIcon.setAttribute('src', checkIconSrc);\n checkIcon.classList.add('check-icon');\n\n btn.appendChild(copyIcon);\n btn.appendChild(checkIcon);\n btn.addEventListener('click', () => this.#handleCopyClick());\n\n this.shadowRoot.querySelector('.wrapper').appendChild(btn);\n }\n\n #destroyCopyButton() {\n this.shadowRoot.querySelector('.copy-btn')?.remove();\n }\n\n #handleCopyClick() {\n const btn = this.shadowRoot.querySelector('.copy-btn');\n navigator.clipboard\n .writeText(decode(this.textContent))\n .then(() => {\n btn.classList.add('copied');\n setTimeout(() => btn.classList.remove('copied'), 2000);\n })\n .catch(() => {});\n }\n\n // ── Snippet rendering ──────────────────────────────────────────────────────\n\n #renderSnippet() {\n const sanitized = decode(this.textContent);\n const language = this.lang;\n\n if (!language) {\n this.contentNode.textContent = sanitized;\n return;\n }\n\n const { value: highlighted } = hljs.highlight(sanitized, { language });\n\n this.contentNode.innerHTML = tpl(highlighted, this.isInline);\n }\n}\n\nconst copyBtn = { selector: () => '.copy-btn' };\n\nconst {\n root,\n docTag,\n keyword,\n metaKeyword,\n templateTag,\n templateVariable,\n type,\n variableLanguage,\n title,\n titleClass,\n titleClassInherited,\n titleFunction,\n attr,\n attribute,\n literal,\n meta,\n number,\n operator,\n variable,\n selectorAttr,\n selectorClass,\n selectorId,\n regexp,\n string,\n metaString,\n builtIn,\n symbol,\n comment,\n code,\n formula,\n name,\n quote,\n selectorTag,\n selectorPseudo,\n subst,\n section,\n bullet,\n emphasis,\n strong,\n addition,\n deletion,\n charEscape,\n link,\n params,\n property,\n punctuation,\n tag,\n} = {\n root: { selector: () => '.hljs' },\n docTag: { selector: () => '.hljs-doctag' },\n keyword: { selector: () => '.hljs-keyword' },\n metaKeyword: { selector: () => '.hljs-meta .hljs-keyword' },\n templateTag: { selector: () => '.hljs-template-tag' },\n templateVariable: { selector: () => '.hljs-template-variable' },\n type: { selector: () => '.hljs-type' },\n variableLanguage: { selector: () => '.hljs-variable.language' },\n title: { selector: () => '.hljs-title' },\n titleClass: { selector: () => '.hljs-title.class_' },\n titleClassInherited: { selector: () => '.hljs-title.class_.inherited__' },\n titleFunction: { selector: () => '.hljs-title.function_' },\n attr: { selector: () => '.hljs-attr' },\n attribute: { selector: () => '.hljs-attribute' },\n literal: { selector: () => '.hljs-literal' },\n meta: { selector: () => '.hljs-meta' },\n number: { selector: () => '.hljs-number' },\n operator: { selector: () => '.hljs-operator' },\n variable: { selector: () => '.hljs-variable' },\n selectorAttr: { selector: () => '.hljs-selector-attr' },\n selectorClass: { selector: () => '.hljs-selector-class' },\n selectorId: { selector: () => '.hljs-selector-id' },\n regexp: { selector: () => '.hljs-regexp' },\n string: { selector: () => '.hljs-string' },\n metaString: { selector: () => '.hljs-meta .hljs-string' },\n builtIn: { selector: () => '.hljs-built_in' },\n symbol: { selector: () => '.hljs-symbol' },\n comment: { selector: () => '.hljs-comment' },\n code: { selector: () => '.hljs-code' },\n formula: { selector: () => '.hljs-formula' },\n name: { selector: () => '.hljs-name' },\n quote: { selector: () => '.hljs-quote' },\n selectorTag: { selector: () => '.hljs-selector-tag' },\n selectorPseudo: { selector: () => '.hljs-selector-pseudo' },\n subst: { selector: () => '.hljs-subst' },\n section: { selector: () => '.hljs-section' },\n bullet: { selector: () => '.hljs-bullet' },\n emphasis: { selector: () => '.hljs-emphasis' },\n strong: { selector: () => '.hljs-strong' },\n addition: { selector: () => '.hljs-addition' },\n deletion: { selector: () => '.hljs-deletion' },\n charEscape: { selector: () => '.hljs-char.escape' },\n link: { selector: () => '.hljs-link' },\n params: { selector: () => '.hljs-params' },\n property: { selector: () => '.hljs-property' },\n punctuation: { selector: () => '.hljs-punctuation' },\n tag: { selector: () => '.hljs-tag' },\n};\n\nexport const CodeSnippetClass = compose(\n createStyleMixin({\n mappings: {\n rootBgColor: { ...root, property: 'background-color' },\n rootTextColor: { ...root, property: 'color' },\n docTagTextColor: { ...docTag, property: 'color' },\n keywordTextColor: { ...keyword, property: 'color' },\n metaKeywordTextColor: { ...metaKeyword, property: 'color' },\n templateTagTextColor: { ...templateTag, property: 'color' },\n templateVariableTextColor: { ...templateVariable, property: 'color' },\n typeTextColor: { ...type, property: 'color' },\n variableLanguageTextColor: { ...variableLanguage, property: 'color' },\n titleTextColor: { ...title, property: 'color' },\n titleClassTextColor: { ...titleClass, property: 'color' },\n titleClassInheritedTextColor: { ...titleClassInherited, property: 'color' },\n titleFunctionTextColor: { ...titleFunction, property: 'color' },\n attrTextColor: { ...attr, property: 'color' },\n attributeTextColor: { ...attribute, property: 'color' },\n literalTextColor: { ...literal, property: 'color' },\n metaTextColor: { ...meta, property: 'color' },\n numberTextColor: { ...number, property: 'color' },\n operatorTextColor: { ...operator, property: 'color' },\n variableTextColor: { ...variable, property: 'color' },\n selectorAttrTextColor: { ...selectorAttr, property: 'color' },\n selectorClassTextColor: { ...selectorClass, property: 'color' },\n selectorIdTextColor: { ...selectorId, property: 'color' },\n regexpTextColor: { ...regexp, property: 'color' },\n stringTextColor: { ...string, property: 'color' },\n metaStringTextColor: { ...metaString, property: 'color' },\n builtInTextColor: { ...builtIn, property: 'color' },\n symbolTextColor: { ...symbol, property: 'color' },\n commentTextColor: { ...comment, property: 'color' },\n codeTextColor: { ...code, property: 'color' },\n formulaTextColor: { ...formula, property: 'color' },\n nameTextColor: { ...name, property: 'color' },\n quoteTextColor: { ...quote, property: 'color' },\n selectorTagTextColor: { ...selectorTag, property: 'color' },\n selectorPseudoTextColor: { ...selectorPseudo, property: 'color' },\n substTextColor: { ...subst, property: 'color' },\n sectionTextColor: { ...section, property: 'color' },\n bulletTextColor: { ...bullet, property: 'color' },\n emphasisTextColor: { ...emphasis, property: 'color' },\n strongTextColor: { ...strong, property: 'color' },\n additionTextColor: { ...addition, property: 'color' },\n additionBgColor: { ...addition, property: 'background-color' },\n deletionTextColor: { ...deletion, property: 'color' },\n deletionBgColor: { ...deletion, property: 'background-color' },\n charEscapeTextColor: { ...charEscape, property: 'color' },\n linkTextColor: { ...link, property: 'color' },\n paramsTextColor: { ...params, property: 'color' },\n propertyTextColor: { ...property, property: 'color' },\n punctuationTextColor: { ...punctuation, property: 'color' },\n tagTextColor: { ...tag, property: 'color' },\n copyButtonSize: [\n { ...copyBtn, property: 'width' },\n { ...copyBtn, property: 'height' },\n ],\n copyButtonBorderRadius: { ...copyBtn, property: 'border-radius' },\n copyButtonBorderWidth: { ...copyBtn, property: 'border-width' },\n copyButtonBorderColor: { ...copyBtn, property: 'border-color' },\n copyButtonBgColor: { ...copyBtn, property: 'background-color' },\n copyButtonHoverBgColor: { selector: () => '.copy-btn:hover', property: 'background-color' },\n copyButtonColor: { ...copyBtn, property: 'color' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(CodeSnippet);\n","import '@descope-ui/descope-icon';\nimport { componentName, CodeSnippetClass } from './CodeSnippetClass';\n\ncustomElements.define(componentName, CodeSnippetClass);\n\nexport { CodeSnippetClass, componentName };\n"],"names":["module","exports","componentName","IconClass","mappings","fill","property","cssVarList","height","selector","width","slots","wrappedEleName","style","excludeAttrsSync","customElements","define","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","init","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","classList","remove","add","altText","getAttribute","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attributeChangedCallback","attrName","oldValue","newValue","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","decode","input","txt","value","CodeSnippet","createBaseClass","lang","isInline","bind","contentNode","shadowRoot","btn","className","type","copyIcon","checkIcon","addEventListener","navigator","clipboard","writeText","textContent","setTimeout","catch","sanitized","language","highlighted","highlight","copyBtn","root","docTag","keyword","metaKeyword","templateTag","templateVariable","variableLanguage","title","titleClass","titleClassInherited","titleFunction","attr","attribute","literal","meta","number","operator","variable","selectorAttr","selectorClass","selectorId","regexp","string","metaString","builtIn","symbol","comment","code","formula","name","quote","selectorTag","selectorPseudo","subst","section","bullet","emphasis","strong","addition","deletion","charEscape","link","params","punctuation","tag","CodeSnippetClass","rootBgColor","rootTextColor","docTagTextColor","keywordTextColor","metaKeywordTextColor","templateTagTextColor","templateVariableTextColor","typeTextColor","variableLanguageTextColor","titleTextColor","titleClassTextColor","titleClassInheritedTextColor","titleFunctionTextColor","attrTextColor","attributeTextColor","literalTextColor","metaTextColor","numberTextColor","operatorTextColor","variableTextColor","selectorAttrTextColor","selectorClassTextColor","selectorIdTextColor","regexpTextColor","stringTextColor","metaStringTextColor","builtInTextColor","symbolTextColor","commentTextColor","codeTextColor","formulaTextColor","nameTextColor","quoteTextColor","selectorTagTextColor","selectorPseudoTextColor","substTextColor","sectionTextColor","bulletTextColor","emphasisTextColor","strongTextColor","additionTextColor","additionBgColor","deletionTextColor","deletionBgColor","charEscapeTextColor","linkTextColor","paramsTextColor","propertyTextColor","punctuationTextColor","tagTextColor","copyButtonSize","copyButtonBorderRadius","copyButtonBorderWidth","copyButtonBorderColor","copyButtonBgColor","copyButtonHoverBgColor","copyButtonColor"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1202,2294,6367,6724],{97376(t){t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+IDxwYXRoIGQ9Ik0xNy4yMTkzIDkuMjcyODNDMTcuNjU4NCA4Ljg3OTEyIDE4LjMzMzQgOC45MTU4NyAxOC43MjcyIDkuMzU0OTJDMTkuMTIwOSA5Ljc5Mzk3IDE5LjA4NDEgMTAuNDY5MSAxOC42NDUxIDEwLjg2MjhDMTguNjQ1MSAxMC44NjI4IDEzLjA0NTcgMTYuMDAyMiAxMi42NCAxNi4zNjZDMTIuMjM0MyAxNi43Mjk4IDExLjc2MDggMTYuNzI5OCAxMS4zNTUyIDE2LjM2Nkw1LjM1NDkyIDEwLjg2MjhDNC45MTU4NyAxMC40NjkxIDQuODc5MTIgOS43OTM5NyA1LjI3MjgzIDkuMzU0OTJDNS42NjY1NSA4LjkxNTg3IDYuMzQxNjQgOC44NzkxMiA2Ljc4MDY5IDkuMjcyODNMMTIgMTQuMTM2OEwxNy4yMTkzIDkuMjcyODNaIi8+IDwvc3ZnPiA="},96945(t,e,n){"use strict";n.r(e),n.d(e,{CollapsibleContainerClass:()=>g,componentName:()=>d}),n(63595),n(56737);var s=n(88961),r=n(72270),i=n(63200),o=n(25964),a=n(97376),l=n.n(a),c=n(66434);const d=(0,o.xE)("collapsible-container");class h extends((0,r.qu)({componentName:d,baseSelector:"slot"})){static get observedAttributes(){return["collapsed","collapsible","text"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <div class="wrapper">\n <descope-text st-host-direction="ltr">\n <div class="header">\n <div class="icon">\n <descope-icon st-fill="currentcolor" src=${l()}></descope-icon>\n </div>\n <span></span>\n </div>\n </descope-text>\n <div class="content">\n <slot></slot>\n </div>\n </div>\n\t`,(0,o.fz)(`\n div.content {\n transition-property: max-height;\n overflow: auto;\n height: auto;\n\t\t\t}\n\t\t\tslot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n slot:focus-visible {\n outline: none;\n }\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n .header {\n user-select: none;\n display: flex;\n align-items: baseline;\n }\n .icon {\n flex-shrink: 0;\n height: var(${c.s.cssVarList.textLineHeight});\n min-height: 24px;\n display: flex;\n align-items: center;\n }\n descope-icon {\n transition-property: transform;\n }\n .rotate {\n transform: rotate(-180deg);\n }\n descope-text {\n width: 100%;\n display: flex;\n }\n span {\n align-self: center;\n word-break: break-word;\n }\n span:empty {\n display: none;\n }\n .wrapper {\n overflow: hidden;\n display: inline-flex;\n width: 100%;\n flex-direction: column;\n }\n `,this),this.header=this.shadowRoot.querySelector(".header"),this.content=this.shadowRoot.querySelector("div.content"),this.icon=this.header.querySelector("descope-icon"),this.headerText=this.header.querySelector("span"),this.textComponent=this.shadowRoot.querySelector("descope-text")}get isCollapsible(){return"true"===this.getAttribute("collapsible")}calcContentHeight(){return this.content.offsetHeight||this.content.scrollHeight}get isCollapsed(){return"true"===this.getAttribute("collapsed")}toggle(){this.setAttribute("collapsed",this.isCollapsed?"false":"true")}collapse(t=!1){const e=()=>{this.content.style.maxHeight="0px"};if(this.icon.classList.add("rotate"),!t)return e();this.content.style.maxHeight=this.calcContentHeight()+"px",setTimeout(e)}expand(t=!1){const e=()=>{this.content.style.maxHeight=""};if(this.icon.classList.remove("rotate"),!t)return e();this.content.addEventListener("transitionend",e,{once:!0}),this.content.style.maxHeight=this.calcContentHeight()+"px"}#t=!1;init(){super.init?.(),this.#t=!0,this.header.addEventListener("click",()=>{this.isCollapsible&&this.toggle()}),(0,o.EA)(this,this.textComponent,{includeAttrs:["text-align","text-variant","text-mode"],mapAttrs:{"text-mode":"mode","text-variant":"variant"}})}updateHeaderText(){const t=this.getAttribute("text")||"";this.headerText.innerText=t}attributeChangedCallback(t,e,n){"text"!==t?this.isCollapsed&&this.isCollapsible?this.collapse(this.#t):this.expand(this.#t):this.updateHeaderText()}}const p={host:()=>":host",icon:()=>"descope-icon",iconWrapper:()=>".icon",header:()=>".header",text:()=>"span",wrapper:()=>".wrapper",content:()=>"div.content"},g=(0,i.Zz)((0,s.RF)({mappings:{hostWidth:{selector:p.host,property:"width"},hostDirection:{selector:p.host,property:"direction"},verticalPadding:[{selector:p.wrapper,property:"padding-top"},{selector:p.wrapper,property:"padding-bottom"}],horizontalPadding:[{selector:p.wrapper,property:"padding-left"},{selector:p.wrapper,property:"padding-right"}],flexDirection:{},justifyContent:{},alignItems:{},gap:[{},{property:"margin-top"}],backgroundColor:{selector:p.wrapper},backgroundImage:{selector:p.wrapper},backgroundPositionX:{selector:p.wrapper},backgroundPositionY:{selector:p.wrapper},backgroundSize:{selector:p.wrapper},backgroundRepeat:{selector:p.wrapper},borderRadius:{selector:p.wrapper},borderColor:{selector:p.wrapper},borderStyle:{selector:p.wrapper},borderWidth:{selector:p.wrapper},boxShadow:{selector:p.wrapper},headerIconOrder:{selector:p.iconWrapper,property:"order"},headerCursor:{selector:p.header,property:"cursor"},headerGap:{selector:p.header,property:"gap"},textGrow:{selector:p.text,property:"flex-grow"},textDirection:{selector:p.text,property:"direction"},iconAnimationDuration:{selector:p.icon,property:"transition-duration"},contentAnimationDuration:{selector:p.content,property:"transition-duration"}}}),s.VO,s.tQ)(h);customElements.define(d,g)},98538(t,e,n){"use strict";n.d(e,{S:()=>l,T:()=>a});var s=n(88961),r=n(25964),i=n(8512),o=n(63200);const a=(0,r.xE)("icon"),l=(0,o.Zz)((0,s.RF)({mappings:{fill:[{},{property:i.q.cssVarList.fill}]}}),s.VO,s.tQ)((0,s.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:()=>s.S,componentName:()=>s.T}),n(53455);var s=n(98538);customElements.define(s.T,s.S)},8512(t,e,n){"use strict";n.d(e,{T:()=>l,q:()=>h});var s=n(88961),r=n(72270),i=n(63200),o=n(25964),a=n(18782);const l=(0,o.xE)("image"),c=["src","src-dark"];class d extends((0,r.qu)({componentName:l,baseSelector:"slot"})){static get observedAttributes(){return c}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,o.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(${h.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 h=(0,i.Zz)((0,s.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),s.VO,s.tQ)(d)},18782(t,e,n){"use strict";n.d(e,{m:()=>i});var s=n(25414);const r=t=>{const e=s.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")},i=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),s=await e.text();n=r(s)}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:()=>s.q,componentName:()=>s.T});var s=n(8512);customElements.define(s.T,s.q)},66434(t,e,n){"use strict";n.d(e,{T:()=>a,s:()=>d});var s=n(88961),r=n(63200),i=n(25964),o=n(72270);const a=(0,i.xE)("text");class l extends((0,o.qu)({componentName:a,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:c}={host:{selector:()=>":host"}},d=(0,r.Zz)((0,s.RF)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),(0,s.DM)({triggers:[{attr:"full-width",value:"true"}]}),s.VO,s.tQ)(l)},63595(t,e,n){"use strict";n.r(e),n.d(e,{TextClass:()=>s.s,componentName:()=>s.T});var s=n(66434);customElements.define(s.T,s.s)}}]);
1
+ (self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1202,2294,6367,6724],{97376(t){t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+IDxwYXRoIGQ9Ik0xNy4yMTkzIDkuMjcyODNDMTcuNjU4NCA4Ljg3OTEyIDE4LjMzMzQgOC45MTU4NyAxOC43MjcyIDkuMzU0OTJDMTkuMTIwOSA5Ljc5Mzk3IDE5LjA4NDEgMTAuNDY5MSAxOC42NDUxIDEwLjg2MjhDMTguNjQ1MSAxMC44NjI4IDEzLjA0NTcgMTYuMDAyMiAxMi42NCAxNi4zNjZDMTIuMjM0MyAxNi43Mjk4IDExLjc2MDggMTYuNzI5OCAxMS4zNTUyIDE2LjM2Nkw1LjM1NDkyIDEwLjg2MjhDNC45MTU4NyAxMC40NjkxIDQuODc5MTIgOS43OTM5NyA1LjI3MjgzIDkuMzU0OTJDNS42NjY1NSA4LjkxNTg3IDYuMzQxNjQgOC44NzkxMiA2Ljc4MDY5IDkuMjcyODNMMTIgMTQuMTM2OEwxNy4yMTkzIDkuMjcyODNaIi8+IDwvc3ZnPiA="},96945(t,e,n){"use strict";n.r(e),n.d(e,{CollapsibleContainerClass:()=>g,componentName:()=>h}),n(63595),n(56737);var s=n(88961),i=n(72270),r=n(63200),o=n(25964),a=n(97376),l=n.n(a),c=n(66434);const h=(0,o.xE)("collapsible-container");class d extends((0,i.qu)({componentName:h,baseSelector:"slot"})){static get observedAttributes(){return["collapsed","collapsible","text"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <div class="wrapper">\n <descope-text st-host-direction="ltr">\n <div class="header">\n <div class="icon">\n <descope-icon st-fill="currentcolor" src=${l()}></descope-icon>\n </div>\n <span></span>\n </div>\n </descope-text>\n <div class="content">\n <slot></slot>\n </div>\n </div>\n\t`,(0,o.fz)(`\n div.content {\n transition-property: max-height;\n overflow: auto;\n height: auto;\n\t\t\t}\n\t\t\tslot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n slot:focus-visible {\n outline: none;\n }\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n .header {\n user-select: none;\n display: flex;\n align-items: baseline;\n }\n .icon {\n flex-shrink: 0;\n height: var(${c.s.cssVarList.textLineHeight});\n min-height: 24px;\n display: flex;\n align-items: center;\n }\n descope-icon {\n transition-property: transform;\n }\n .rotate {\n transform: rotate(-180deg);\n }\n descope-text {\n width: 100%;\n display: flex;\n }\n span {\n align-self: center;\n word-break: break-word;\n }\n span:empty {\n display: none;\n }\n .wrapper {\n overflow: hidden;\n display: inline-flex;\n width: 100%;\n flex-direction: column;\n }\n `,this),this.header=this.shadowRoot.querySelector(".header"),this.content=this.shadowRoot.querySelector("div.content"),this.icon=this.header.querySelector("descope-icon"),this.headerText=this.header.querySelector("span"),this.textComponent=this.shadowRoot.querySelector("descope-text")}get isCollapsible(){return"true"===this.getAttribute("collapsible")}calcContentHeight(){return this.content.offsetHeight||this.content.scrollHeight}get isCollapsed(){return"true"===this.getAttribute("collapsed")}toggle(){this.setAttribute("collapsed",this.isCollapsed?"false":"true")}collapse(t=!1){const e=()=>{this.content.style.maxHeight="0px"};if(this.icon.classList.add("rotate"),!t)return e();this.content.style.maxHeight=this.calcContentHeight()+"px",setTimeout(e)}expand(t=!1){const e=()=>{this.content.style.maxHeight=""};if(this.icon.classList.remove("rotate"),!t)return e();this.content.addEventListener("transitionend",e,{once:!0}),this.content.style.maxHeight=this.calcContentHeight()+"px"}#t=!1;init(){super.init?.(),this.#t=!0,this.header.addEventListener("click",()=>{this.isCollapsible&&this.toggle()}),(0,o.EA)(this,this.textComponent,{includeAttrs:["text-align","text-variant","text-mode"],mapAttrs:{"text-mode":"mode","text-variant":"variant"}})}updateHeaderText(){const t=this.getAttribute("text")||"";this.headerText.innerText=t}attributeChangedCallback(t,e,n){"text"!==t?this.isCollapsed&&this.isCollapsible?this.collapse(this.#t):this.expand(this.#t):this.updateHeaderText()}}const p={host:()=>":host",icon:()=>"descope-icon",iconWrapper:()=>".icon",header:()=>".header",text:()=>"span",wrapper:()=>".wrapper",content:()=>"div.content"},g=(0,r.Zz)((0,s.RF)({mappings:{hostWidth:{selector:p.host,property:"width"},hostDirection:{selector:p.host,property:"direction"},verticalPadding:[{selector:p.wrapper,property:"padding-top"},{selector:p.wrapper,property:"padding-bottom"}],horizontalPadding:[{selector:p.wrapper,property:"padding-left"},{selector:p.wrapper,property:"padding-right"}],flexDirection:{},justifyContent:{},alignItems:{},gap:[{},{property:"margin-top"}],backgroundColor:{selector:p.wrapper},backgroundImage:{selector:p.wrapper},backgroundPositionX:{selector:p.wrapper},backgroundPositionY:{selector:p.wrapper},backgroundSize:{selector:p.wrapper},backgroundRepeat:{selector:p.wrapper},borderRadius:{selector:p.wrapper},borderColor:{selector:p.wrapper},borderStyle:{selector:p.wrapper},borderWidth:{selector:p.wrapper},boxShadow:{selector:p.wrapper},headerIconOrder:{selector:p.iconWrapper,property:"order"},headerCursor:{selector:p.header,property:"cursor"},headerGap:{selector:p.header,property:"gap"},textGrow:{selector:p.text,property:"flex-grow"},textDirection:{selector:p.text,property:"direction"},iconAnimationDuration:{selector:p.icon,property:"transition-duration"},contentAnimationDuration:{selector:p.content,property:"transition-duration"}}}),s.VO,s.tQ)(d);customElements.define(h,g)},98538(t,e,n){"use strict";n.d(e,{S:()=>l,T:()=>a});var s=n(88961),i=n(25964),r=n(8512),o=n(63200);const a=(0,i.xE)("icon"),l=(0,o.Zz)((0,s.RF)({mappings:{fill:[{},{property:r.q.cssVarList.fill}],height:{selector:()=>":host"},width:{selector:()=>":host"}}}),s.VO,s.tQ)((0,s.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n ",excludeAttrsSync:["tabindex","class","style","st-height","st-width"],componentName:a}))},56737(t,e,n){"use strict";n.r(e),n.d(e,{IconClass:()=>s.S,componentName:()=>s.T}),n(53455);var s=n(98538);customElements.define(s.T,s.S)},8512(t,e,n){"use strict";n.d(e,{T:()=>l,q:()=>d});var s=n(88961),i=n(72270),r=n(63200),o=n(25964),a=n(18782);const l=(0,o.xE)("image"),c=["src","src-dark"];class h extends((0,i.qu)({componentName:l,baseSelector:"slot"})){static get observedAttributes(){return c}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,o.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(${d.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 d=(0,r.Zz)((0,s.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),s.VO,s.tQ)(h)},18782(t,e,n){"use strict";n.d(e,{m:()=>r});var s=n(25414);const i=t=>{const e=s.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")},r=async(t,e)=>{try{let n;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));n=i(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),s=await e.text();n=i(s)}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:()=>s.q,componentName:()=>s.T});var s=n(8512);customElements.define(s.T,s.q)},66434(t,e,n){"use strict";n.d(e,{T:()=>a,s:()=>h});var s=n(88961),i=n(63200),r=n(25964),o=n(72270);const a=(0,r.xE)("text");class l extends((0,o.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,r.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,r.Ge)(this,()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:c}={host:{selector:()=>":host"}},h=(0,i.Zz)((0,s.RF)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),(0,s.DM)({triggers:[{attr:"full-width",value:"true"}]}),s.VO,s.tQ)(l)},63595(t,e,n){"use strict";n.r(e),n.d(e,{TextClass:()=>s.s,componentName:()=>s.T});var s=n(66434);customElements.define(s.T,s.s)}}]);
2
2
  //# sourceMappingURL=descope-collapsible-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-collapsible-container.js","mappings":"oIAAAA,EAAOC,QAAU,ooB,iMCeV,MAAMC,GAAgB,QAAiB,yBAE9C,MAAMC,WAAgC,QAAgB,CACpDD,gBACAE,aAAc,UAEd,6BAAWC,GACT,MAAO,CAAC,YAAa,cAAe,OACtC,CAEA,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM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,EAAMO,SAAU,SAChCC,cAAe,IAAKR,EAAMO,SAAU,aACpC4F,SAAU,CAAC,EACXC,UAAW,CAAC,CAAE7F,SAAU,UACxB9C,eAAgB,CAAE8C,SAAU,eAC5B8F,kBAAmB,CAAE9F,SAAU,kBAC/B+F,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,cAAe,CAAC,EAChBC,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,WAAY,CAAC,EACbnF,YAAa,CAAC,EACdD,YAAa,CAAC,EACdD,YAAa,CAAC,MAGlB,QAAa,CAAEsF,SAAU,CAAC,CAAEC,KAAM,aAAcC,MAAO,WACvD,KACA,KAtBuB,CAuBvBjB,E,mGCjFF5D,eAAeC,OAAO,IAAe,I","sources":["webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/chevron.svg","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/CollapsibleContainerClass.js","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/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"],"sourcesContent":["module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+IDxwYXRoIGQ9Ik0xNy4yMTkzIDkuMjcyODNDMTcuNjU4NCA4Ljg3OTEyIDE4LjMzMzQgOC45MTU4NyAxOC43MjcyIDkuMzU0OTJDMTkuMTIwOSA5Ljc5Mzk3IDE5LjA4NDEgMTAuNDY5MSAxOC42NDUxIDEwLjg2MjhDMTguNjQ1MSAxMC44NjI4IDEzLjA0NTcgMTYuMDAyMiAxMi42NCAxNi4zNjZDMTIuMjM0MyAxNi43Mjk4IDExLjc2MDggMTYuNzI5OCAxMS4zNTUyIDE2LjM2Nkw1LjM1NDkyIDEwLjg2MjhDNC45MTU4NyAxMC40NjkxIDQuODc5MTIgOS43OTM5NyA1LjI3MjgzIDkuMzU0OTJDNS42NjY1NSA4LjkxNTg3IDYuMzQxNjQgOC44NzkxMiA2Ljc4MDY5IDkuMjcyODNMMTIgMTQuMTM2OEwxNy4yMTkzIDkuMjcyODNaIi8+IDwvc3ZnPiA=\"","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport chevronIcon from './chevron.svg';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('collapsible-container');\n\nclass RawCollapsibleContainer extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return ['collapsed', 'collapsible', 'text'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <descope-text st-host-direction=\"ltr\">\n <div class=\"header\">\n <div class=\"icon\">\n <descope-icon st-fill=\"currentcolor\" src=${chevronIcon}></descope-icon>\n </div>\n <span></span>\n </div>\n </descope-text>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n\t`;\n\n injectStyle(\n `\n div.content {\n transition-property: max-height;\n overflow: auto;\n height: auto;\n\t\t\t}\n\t\t\tslot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n slot:focus-visible {\n outline: none;\n }\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n .header {\n user-select: none;\n display: flex;\n align-items: baseline;\n }\n .icon {\n flex-shrink: 0;\n height: var(${TextClass.cssVarList.textLineHeight});\n min-height: 24px;\n display: flex;\n align-items: center;\n }\n descope-icon {\n transition-property: transform;\n }\n .rotate {\n transform: rotate(-180deg);\n }\n descope-text {\n width: 100%;\n display: flex;\n }\n span {\n align-self: center;\n word-break: break-word;\n }\n span:empty {\n display: none;\n }\n .wrapper {\n overflow: hidden;\n display: inline-flex;\n width: 100%;\n flex-direction: column;\n }\n `,\n this,\n );\n\n this.header = this.shadowRoot.querySelector('.header');\n this.content = this.shadowRoot.querySelector('div.content');\n this.icon = this.header.querySelector('descope-icon');\n this.headerText = this.header.querySelector('span');\n this.textComponent = this.shadowRoot.querySelector('descope-text');\n }\n\n get isCollapsible() {\n return this.getAttribute('collapsible') === 'true';\n }\n\n calcContentHeight() {\n return this.content.offsetHeight || this.content.scrollHeight;\n }\n\n get isCollapsed() {\n return this.getAttribute('collapsed') === 'true';\n }\n\n toggle() {\n this.setAttribute('collapsed', this.isCollapsed ? 'false' : 'true');\n }\n\n collapse(animated = false) {\n const final = () => {\n this.content.style.maxHeight = '0px';\n };\n this.icon.classList.add('rotate');\n if (!animated) return final();\n\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n setTimeout(final);\n }\n\n expand(animated = false) {\n const final = () => {\n this.content.style.maxHeight = '';\n };\n this.icon.classList.remove('rotate');\n if (!animated) return final();\n\n this.content.addEventListener('transitionend', final, { once: true });\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n }\n\n #isComponentMounted = false;\n\n init() {\n super.init?.();\n // we want to animate the collapse/expand only after the first time the component is connected\n // so when setting a default value for the collapsed attribute, it will not animate\n this.#isComponentMounted = true;\n\n this.header.addEventListener('click', () => {\n if (!this.isCollapsible) return;\n this.toggle();\n });\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['text-align', 'text-variant', 'text-mode'],\n mapAttrs: { 'text-mode': 'mode', 'text-variant': 'variant' },\n });\n }\n\n updateHeaderText() {\n const text = this.getAttribute('text') || '';\n this.headerText.innerText = text;\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'text') {\n this.updateHeaderText();\n return;\n }\n const collapsed = this.isCollapsed && this.isCollapsible;\n if (collapsed) {\n this.collapse(this.#isComponentMounted);\n } else {\n this.expand(this.#isComponentMounted);\n }\n }\n}\n\nconst selectors = {\n host: () => ':host',\n icon: () => 'descope-icon',\n iconWrapper: () => '.icon',\n header: () => '.header',\n text: () => 'span',\n wrapper: () => '.wrapper',\n content: () => 'div.content',\n};\n\nexport const CollapsibleContainerClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: selectors.host, property: 'width' },\n hostDirection: { selector: selectors.host, property: 'direction' },\n verticalPadding: [\n { selector: selectors.wrapper, property: 'padding-top' },\n { selector: selectors.wrapper, property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { selector: selectors.wrapper, property: 'padding-left' },\n { selector: selectors.wrapper, property: 'padding-right' },\n ],\n\n flexDirection: {},\n justifyContent: {},\n alignItems: {},\n gap: [{}, { property: 'margin-top' }],\n\n backgroundColor: { selector: selectors.wrapper },\n backgroundImage: { selector: selectors.wrapper },\n backgroundPositionX: { selector: selectors.wrapper },\n backgroundPositionY: { selector: selectors.wrapper },\n backgroundSize: { selector: selectors.wrapper },\n backgroundRepeat: { selector: selectors.wrapper },\n\n borderRadius: { selector: selectors.wrapper },\n borderColor: { selector: selectors.wrapper },\n borderStyle: { selector: selectors.wrapper },\n borderWidth: { selector: selectors.wrapper },\n\n boxShadow: { selector: selectors.wrapper },\n\n headerIconOrder: { selector: selectors.iconWrapper, property: 'order' },\n headerCursor: { selector: selectors.header, property: 'cursor' },\n headerGap: { selector: selectors.header, property: 'gap' },\n textGrow: { selector: selectors.text, property: 'flex-grow' },\n textDirection: { selector: selectors.text, property: 'direction' },\n iconAnimationDuration: {\n selector: selectors.icon,\n property: 'transition-duration',\n },\n contentAnimationDuration: {\n selector: selectors.content,\n property: 'transition-duration',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawCollapsibleContainer);\n","import '@descope-ui/descope-text'\nimport '@descope-ui/descope-icon'\nimport { componentName, CollapsibleContainerClass } from './CollapsibleContainerClass';\n\ncustomElements.define(componentName, CollapsibleContainerClass);\n\nexport { CollapsibleContainerClass, componentName };\n","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style'],\n componentName,\n }),\n);\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n","/* eslint-disable no-use-before-define */\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\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 `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n // eslint-disable-next-line class-methods-use-this\n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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 `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\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: [{ property: 'color' }],\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 stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n"],"names":["module","exports","componentName","RawCollapsibleContainer","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","TextClass","cssVarList","textLineHeight","header","shadowRoot","querySelector","content","icon","headerText","textComponent","isCollapsible","getAttribute","calcContentHeight","offsetHeight","scrollHeight","isCollapsed","toggle","setAttribute","collapse","animated","final","style","maxHeight","classList","add","setTimeout","expand","remove","addEventListener","once","init","includeAttrs","mapAttrs","updateHeaderText","text","innerText","attributeChangedCallback","name","oldValue","newValue","selectors","host","iconWrapper","wrapper","CollapsibleContainerClass","mappings","hostWidth","selector","property","hostDirection","verticalPadding","horizontalPadding","flexDirection","justifyContent","alignItems","gap","backgroundColor","backgroundImage","backgroundPositionX","backgroundPositionY","backgroundSize","backgroundRepeat","borderRadius","borderColor","borderStyle","borderWidth","boxShadow","headerIconOrder","headerCursor","headerGap","textGrow","textDirection","iconAnimationDuration","contentAnimationDuration","customElements","define","IconClass","fill","slots","wrappedEleName","excludeAttrsSync","srcAttrs","RawImage","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","altText","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attrName","height","width","createSvgEle","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","RawText","hideWhenEmpty","hasChildren","childNodes","length","display","fontSize","textColor","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","triggers","attr","value"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-collapsible-container.js","mappings":"oIAAAA,EAAOC,QAAU,ooB,iMCeV,MAAMC,GAAgB,QAAiB,yBAE9C,MAAMC,WAAgC,QAAgB,CACpDD,gBACAE,aAAc,UAEd,6BAAWC,GACT,MAAO,CAAC,YAAa,cAAe,OACtC,CAEA,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,+LAKG,2LAWnD,QACE,2gBAwBkBC,EAAA,EAAUC,WAAWC,qmBA6BvCN,MAGFA,KAAKO,OAASP,KAAKQ,WAAWC,cAAc,WAC5CT,KAAKU,QAAUV,KAAKQ,WAAWC,cAAc,eAC7CT,KAAKW,KAAOX,KAAKO,OAAOE,cAAc,gBACtCT,KAAKY,WAAaZ,KAAKO,OAAOE,cAAc,QAC5CT,KAAKa,cAAgBb,KAAKQ,WAAWC,cAAc,eACrD,CAE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,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,WAAY,CAAC,EACbnF,YAAa,CAAC,EACdD,YAAa,CAAC,EACdD,YAAa,CAAC,MAGlB,QAAa,CAAEsF,SAAU,CAAC,CAAEC,KAAM,aAAcC,MAAO,WACvD,KACA,KAtBuB,CAuBvBjB,E,mGCjFF5D,eAAeC,OAAO,IAAe,I","sources":["webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/chevron.svg","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/CollapsibleContainerClass.js","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/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"],"sourcesContent":["module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+IDxwYXRoIGQ9Ik0xNy4yMTkzIDkuMjcyODNDMTcuNjU4NCA4Ljg3OTEyIDE4LjMzMzQgOC45MTU4NyAxOC43MjcyIDkuMzU0OTJDMTkuMTIwOSA5Ljc5Mzk3IDE5LjA4NDEgMTAuNDY5MSAxOC42NDUxIDEwLjg2MjhDMTguNjQ1MSAxMC44NjI4IDEzLjA0NTcgMTYuMDAyMiAxMi42NCAxNi4zNjZDMTIuMjM0MyAxNi43Mjk4IDExLjc2MDggMTYuNzI5OCAxMS4zNTUyIDE2LjM2Nkw1LjM1NDkyIDEwLjg2MjhDNC45MTU4NyAxMC40NjkxIDQuODc5MTIgOS43OTM5NyA1LjI3MjgzIDkuMzU0OTJDNS42NjY1NSA4LjkxNTg3IDYuMzQxNjQgOC44NzkxMiA2Ljc4MDY5IDkuMjcyODNMMTIgMTQuMTM2OEwxNy4yMTkzIDkuMjcyODNaIi8+IDwvc3ZnPiA=\"","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport chevronIcon from './chevron.svg';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('collapsible-container');\n\nclass RawCollapsibleContainer extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return ['collapsed', 'collapsible', 'text'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <descope-text st-host-direction=\"ltr\">\n <div class=\"header\">\n <div class=\"icon\">\n <descope-icon st-fill=\"currentcolor\" src=${chevronIcon}></descope-icon>\n </div>\n <span></span>\n </div>\n </descope-text>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n\t`;\n\n injectStyle(\n `\n div.content {\n transition-property: max-height;\n overflow: auto;\n height: auto;\n\t\t\t}\n\t\t\tslot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n slot:focus-visible {\n outline: none;\n }\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n .header {\n user-select: none;\n display: flex;\n align-items: baseline;\n }\n .icon {\n flex-shrink: 0;\n height: var(${TextClass.cssVarList.textLineHeight});\n min-height: 24px;\n display: flex;\n align-items: center;\n }\n descope-icon {\n transition-property: transform;\n }\n .rotate {\n transform: rotate(-180deg);\n }\n descope-text {\n width: 100%;\n display: flex;\n }\n span {\n align-self: center;\n word-break: break-word;\n }\n span:empty {\n display: none;\n }\n .wrapper {\n overflow: hidden;\n display: inline-flex;\n width: 100%;\n flex-direction: column;\n }\n `,\n this,\n );\n\n this.header = this.shadowRoot.querySelector('.header');\n this.content = this.shadowRoot.querySelector('div.content');\n this.icon = this.header.querySelector('descope-icon');\n this.headerText = this.header.querySelector('span');\n this.textComponent = this.shadowRoot.querySelector('descope-text');\n }\n\n get isCollapsible() {\n return this.getAttribute('collapsible') === 'true';\n }\n\n calcContentHeight() {\n return this.content.offsetHeight || this.content.scrollHeight;\n }\n\n get isCollapsed() {\n return this.getAttribute('collapsed') === 'true';\n }\n\n toggle() {\n this.setAttribute('collapsed', this.isCollapsed ? 'false' : 'true');\n }\n\n collapse(animated = false) {\n const final = () => {\n this.content.style.maxHeight = '0px';\n };\n this.icon.classList.add('rotate');\n if (!animated) return final();\n\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n setTimeout(final);\n }\n\n expand(animated = false) {\n const final = () => {\n this.content.style.maxHeight = '';\n };\n this.icon.classList.remove('rotate');\n if (!animated) return final();\n\n this.content.addEventListener('transitionend', final, { once: true });\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n }\n\n #isComponentMounted = false;\n\n init() {\n super.init?.();\n // we want to animate the collapse/expand only after the first time the component is connected\n // so when setting a default value for the collapsed attribute, it will not animate\n this.#isComponentMounted = true;\n\n this.header.addEventListener('click', () => {\n if (!this.isCollapsible) return;\n this.toggle();\n });\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['text-align', 'text-variant', 'text-mode'],\n mapAttrs: { 'text-mode': 'mode', 'text-variant': 'variant' },\n });\n }\n\n updateHeaderText() {\n const text = this.getAttribute('text') || '';\n this.headerText.innerText = text;\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'text') {\n this.updateHeaderText();\n return;\n }\n const collapsed = this.isCollapsed && this.isCollapsible;\n if (collapsed) {\n this.collapse(this.#isComponentMounted);\n } else {\n this.expand(this.#isComponentMounted);\n }\n }\n}\n\nconst selectors = {\n host: () => ':host',\n icon: () => 'descope-icon',\n iconWrapper: () => '.icon',\n header: () => '.header',\n text: () => 'span',\n wrapper: () => '.wrapper',\n content: () => 'div.content',\n};\n\nexport const CollapsibleContainerClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: selectors.host, property: 'width' },\n hostDirection: { selector: selectors.host, property: 'direction' },\n verticalPadding: [\n { selector: selectors.wrapper, property: 'padding-top' },\n { selector: selectors.wrapper, property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { selector: selectors.wrapper, property: 'padding-left' },\n { selector: selectors.wrapper, property: 'padding-right' },\n ],\n\n flexDirection: {},\n justifyContent: {},\n alignItems: {},\n gap: [{}, { property: 'margin-top' }],\n\n backgroundColor: { selector: selectors.wrapper },\n backgroundImage: { selector: selectors.wrapper },\n backgroundPositionX: { selector: selectors.wrapper },\n backgroundPositionY: { selector: selectors.wrapper },\n backgroundSize: { selector: selectors.wrapper },\n backgroundRepeat: { selector: selectors.wrapper },\n\n borderRadius: { selector: selectors.wrapper },\n borderColor: { selector: selectors.wrapper },\n borderStyle: { selector: selectors.wrapper },\n borderWidth: { selector: selectors.wrapper },\n\n boxShadow: { selector: selectors.wrapper },\n\n headerIconOrder: { selector: selectors.iconWrapper, property: 'order' },\n headerCursor: { selector: selectors.header, property: 'cursor' },\n headerGap: { selector: selectors.header, property: 'gap' },\n textGrow: { selector: selectors.text, property: 'flex-grow' },\n textDirection: { selector: selectors.text, property: 'direction' },\n iconAnimationDuration: {\n selector: selectors.icon,\n property: 'transition-duration',\n },\n contentAnimationDuration: {\n selector: selectors.content,\n property: 'transition-duration',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawCollapsibleContainer);\n","import '@descope-ui/descope-text'\nimport '@descope-ui/descope-icon'\nimport { componentName, CollapsibleContainerClass } from './CollapsibleContainerClass';\n\ncustomElements.define(componentName, CollapsibleContainerClass);\n\nexport { CollapsibleContainerClass, componentName };\n","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class', 'style', 'st-height', 'st-width'],\n componentName,\n }),\n);\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n"," \nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\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 `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.getSrc);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get getSrc() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n \n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.getSrc);\n\n createImage(this.getSrc, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.getSrc === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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 `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\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: [{ property: 'color' }],\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 stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n"],"names":["module","exports","componentName","RawCollapsibleContainer","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","TextClass","cssVarList","textLineHeight","header","shadowRoot","querySelector","content","icon","headerText","textComponent","isCollapsible","getAttribute","calcContentHeight","offsetHeight","scrollHeight","isCollapsed","toggle","setAttribute","collapse","animated","final","style","maxHeight","classList","add","setTimeout","expand","remove","addEventListener","once","init","includeAttrs","mapAttrs","updateHeaderText","text","innerText","attributeChangedCallback","name","oldValue","newValue","selectors","host","iconWrapper","wrapper","CollapsibleContainerClass","mappings","hostWidth","selector","property","hostDirection","verticalPadding","horizontalPadding","flexDirection","justifyContent","alignItems","gap","backgroundColor","backgroundImage","backgroundPositionX","backgroundPositionY","backgroundSize","backgroundRepeat","borderRadius","borderColor","borderStyle","borderWidth","boxShadow","headerIconOrder","headerCursor","headerGap","textGrow","textDirection","iconAnimationDuration","contentAnimationDuration","customElements","define","IconClass","fill","height","width","slots","wrappedEleName","excludeAttrsSync","srcAttrs","RawImage","toggleVisibility","getSrc","onThemeChange","renderImage","isVisible","altText","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","ImageClass","then","res","appendChild","shouldRender","src","srcVal","attrName","createSvgEle","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","setProperty","RawText","hideWhenEmpty","hasChildren","childNodes","length","display","fontSize","textColor","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","triggers","attr","value"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[6028],{19624(t,e,n){n.d(e,{J:()=>u,T:()=>l});var r=n(63200),a=n(25964),i=n(88961),o=n(98538),s=n(10767);const l=(0,a.xE)("button"),{host:d,label:h,slottedIcon:c}={host:{selector:()=>":host"},label:{selector:"::part(label)"},slottedIcon:{selector:()=>"::slotted(descope-icon)"}};let p;const u=(0,r.Zz)((0,i.DM)({triggers:[{attr:"full-width",value:"true"}]}),(0,i.RF)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...d,property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-right",fallback:"0.875em"},{property:"padding-left",fallback:"0.875em"}],labelTextColor:{property:"color"},iconColor:{selector:()=>"::slotted(*)",property:o.S.cssVarList.fill},labelTextDecoration:{...h,property:"text-decoration"},labelSpacing:{...h,property:"gap"},textAlign:{...h,property:"justify-content",fallback:"center"},iconSize:[{...c,property:"width"},{...c,property:"height"}]}}),s.G,i.VO,i.tQ)((0,i.tz)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${p}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${u.cssVarList.outlineWidth}) + var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${u.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${u.cssVarList.hostHeight}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${u.cssVarList.hostWidth}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex","class","style"],componentName:l})),{color:y,fontSize:g}=u.cssVarList;p=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${y});\n\t\ttop: calc(50% - (var(${g}) / 2));\n\t\tleft: calc(50% - (var(${g}) / 2));\n\t\tborder-width: calc(var(${g}) / 10);\n\t\twidth: var(${g});\n\t\theight: var(${g});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"]) ::part(prefix),\n\t:host([loading="true"]) ::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},10767(t,e,n){n.d(e,{G:()=>r});const r=t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}},30576(t,e,n){n.r(e),n.d(e,{ButtonClass:()=>r.J,componentName:()=>r.T});var r=n(19624);n(83799),customElements.define(r.T,r.J)},98538(t,e,n){n.d(e,{S:()=>l,T:()=>s});var r=n(88961),a=n(25964),i=n(8512),o=n(63200);const s=(0,a.xE)("icon"),l=(0,o.Zz)((0,r.RF)({mappings:{fill:[{},{property:i.q.cssVarList.fill}]}}),r.VO,r.tQ)((0,r.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n max-height: 100%;\n }\n ",excludeAttrsSync:["tabindex","class","style"],componentName:s}))},8512(t,e,n){n.d(e,{T:()=>l,q:()=>c});var r=n(88961),a=n(72270),i=n(63200),o=n(25964),s=n(18782);const l=(0,o.xE)("image"),d=["src","src-dark"];class h extends((0,a.qu)({componentName:l,baseSelector:"slot"})){static get observedAttributes(){return d}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,o.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(${c.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)})}renderImage(){this.toggleVisibility(this.getSrc),(0,s.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 c=(0,i.Zz)((0,r.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),r.VO,r.tQ)(h)},18782(t,e,n){n.d(e,{m:()=>i});var r=n(25414);const a=t=>{const e=r.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")},i=async(t,e)=>{try{let n;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));n=a(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),r=await e.text();n=a(r)}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}}},3393(t,e,n){n.d(e,{y:()=>o});var r=n(9696),a=n(79365),i=n(81365);const o=(...t)=>(0,r.Zz)(a.XX,a._$,a.yF,a.jd)((0,i.q)(...t))},64101(t,e,n){n.d(e,{QF:()=>y,SP:()=>r,SZ:()=>g,Tv:()=>p,US:()=>l,V$:()=>o,eT:()=>s,lv:()=>u,mx:()=>d,nr:()=>c,rR:()=>h,ui:()=>a,wJ:()=>i});const r=["MM/DD/YYYY","DD/MM/YYYY","YYYY/MM/DD"],a=r[0],i="YYYY-MM-DD",o=100,s="/",l=["January","February","March","April","May","June","July","August","September","October","November","December"],d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h={MONTH:{id:"month",min:1,max:12,placeholder:"MM"},DAY:{id:"day",min:1,max:31,placeholder:"DD"},YEAR:{id:"year",min:0,max:9999,placeholder:"YYYY"}},c={year:{min:1900,max:2099}},p="Done",u="Cancel",y="Today",g=150},15177(t,e,n){n.d(e,{N:()=>r});const r=(t,e)=>{if("number"==typeof t)return new Date(t);if("string"==typeof t){const n=new Date(t.replace(/-/g,"/"));return e?new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())):new Date(n)}return new Date}},88350(t,e,n){n.r(e),n.d(e,{CalendarClass:()=>z,componentName:()=>C}),n(27092),n(30576);var r=n(19624),a=n(25964),i=n(3393),o=n(9696),s=n(97810),l=n(73551),d=n(79365),h=n(49224),c=n(80071),p=n(64101),u=n(15177);const y=(t,e)=>Array.isArray(t)&&t.length===e&&t.filter(Boolean).length===e,g=({label:t,dataId:e,dataName:n})=>`\n\t<div class="combo-box-item"\n\t\tdata-id="${e}"\n\t\tdata-name="${n}"\n\t>\n\t\t\t${t}\n\t</div>\n`,b=(t=p.US)=>t.map((t,e)=>g({label:t,dataId:e+1,dataName:t})).join(""),v=(t,e)=>{const[n,r]=(0,h._G)(e),[a,i]=(0,h._G)(t);return a===n&&i===r},m=(t,e,n)=>(t.addEventListener("input",e),t.addEventListener("focusout",n),t),C=(0,s.xE)("calendar"),w=["initial-value","initial-year","initial-month","years-range","calendar-months","calendar-weekdays","calendar-label-today","st-host-direction","disabled","full-width"],f=["calendar-label-submit","calendar-label-cancel"],S=(0,i.y)({componentName:C,baseSelector:"div"}),{calendar:x,day:M,dayEntry:V,currentDay:D,selectedDay:N,disabledDay:H,weekday:E,topNav:T,topNavSelectors:Y,bottomNav:L,navPrev:A,navNext:k,navPrevRTL:B,navNextRTL:I,yearInput:$,monthInput:R}={calendar:{selector:()=>".calendar"},topNav:{selector:()=>".nav.top-nav"},topNavSelectors:{selector:()=>".nav.top-nav .selectors > span"},bottomNav:{selector:()=>".nav.bottom-nav"},day:{selector:()=>".day"},dayEntry:{selector:()=>".day-entry"},currentDay:{selector:()=>".day-entry[data-current-day] .day"},selectedDay:{selector:()=>".day-entry[data-selected] .day"},disabledDay:{selector:()=>'.day-entry[data-disabled="true"] .day'},weekday:{selector:()=>".weekday"},navPrev:{selector:()=>".nav-prev"},navNext:{selector:()=>".nav-next"},navPrevRTL:{selector:()=>':host([st-host-direction="rtl"]) .nav-prev'},navNextRTL:{selector:()=>':host([st-host-direction="rtl"]) .nav-next'},yearInput:{selector:()=>".year-input"},monthInput:{selector:()=>".month-input"}},z=(0,o.Zz)((0,d.RF)({componentNameOverride:(0,s.xE)("input-wrapper")}),(0,d.RF)({mappings:{fontSize:{},fontFamily:{},hostWidth:[{selector:()=>":host",property:"width"},{selector:"table",property:"width"}],hostDirection:{property:"direction"},topNavVerticalPadding:[{...T,property:"padding-top"},{...T,property:"padding-bottom"}],topNavHorizointalPadding:[{...T,property:"padding-right"},{...T,property:"padding-left"}],topNavAlignment:{...T,property:"justify-content"},topNavGap:{...T,property:"gap"},topNavSelectorsGap:{...Y,property:"gap"},bottomNavVerticalPadding:[{...L,property:"padding-top"},{...L,property:"padding-bottom"}],bottomNavHorizontalPadding:[{...L,property:"padding-right"},{...L,property:"padding-left"}],bottomNavAlignment:{...L,property:"justify-content"},bottomNavGap:{...L,property:"gap"},navMarginBottom:{...T,property:"margin-bottom"},calendarPadding:[{...x,property:"padding-bottom"},{...x,property:"padding-right"},{...x,property:"padding-left"}],navBorderBottomWidth:{...T,property:"border-bottom-width"},navBorderBottomColor:{...T,property:"border-bottom-color"},navBorderBottomStyle:{...T,property:"border-bottom-style"},weekdayFontSize:{...E,property:"font-size"},weekdayFontWeight:{...E,property:"font-weight"},currentDayBorderColor:{...D,property:"border-color"},currentDayBorderWidth:{...D,property:"border-width"},currentDayBorderStyle:{...D,property:"border-style"},dayHeight:{...V,property:"height"},daySize:[{...M,property:"height"},{...M,property:"width"}],dayPadding:{...M,property:"padding"},dayRadius:{...M,property:"border-radius"},dayTextAlign:{...M,property:"text-align"},dayBlockAlign:{...M,property:"margin"},dayTextColor:{...M,property:"color"},dayFontWeight:{...M,property:"font-weight"},dayBackgroundColor:{...M,property:"background-color"},dayCursor:{...M,property:"cursor"},dayFontSize:{...M,property:"font-size"},dayBackgroundColorHover:{selector:()=>".day:hover",property:"background-color"},daySelectedTextdColor:{...N,property:"color"},daySelectedBackgroundColor:{...N,property:"background-color"},dayDisabledTextdColor:{...H,property:"color"},yearInputWidth:{...$,property:"width"},monthInputWidth:{...R,property:"width"},navButtonSize:[{...A,property:"width"},{...A,property:"height"},{...k,property:"width"},{...k,property:"height"}],navButtonCursor:[{...A,property:"cursor"},{...k,property:"cursor"}],navButtonRotation:[{...B,property:"transform"},{...I,property:"transform"}],navButtonOpacity:[{...A,property:"opacity"},{...k,property:"opacity"}]}}),d.VO,d.tQ)(class extends S{static get observedAttributes(){return[].concat(S.observedAttributes||[],w,f)}preview;epoch;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <nav class="nav top-nav">\n <div class="nav-prev">\n </div>\n <div class="selectors"></div>\n <div class="nav-next">\n </div>\n </nav>\n <div class="calendar"></div>\n <nav class="nav bottom-nav">\n <descope-button class="cancel-button" variant="link" mode="primary">Cancel</descope-button>\n <descope-button class="submit-button" variant="link" mode="primary" disabled="true">Done</descope-button>\n </nav>\n </div>\n ',(0,a.fz)(`\n :host {\n display: inline-block;\n box-sizing: border-box;\n max-width: 100%;\n user-select: none;\n -webkit-user-select: none;\n }\n\n :host ::slotted {\n padding: 0;\n }\n\n [data-toggle-calendar] {\n cursor: pointer;\n display: flex;\n align-self: center;\n z-index: 1;\n }\n\n [data-disabled="true"] {\n pointer-events: none;\n }\n\n .calendar .day {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .nav {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n }\n\n .selectors,\n .selectors span {\n display: flex;\n justify-content: center;\n }\n\n descope-button {\n padding: 0;\n ${r.J.cssVarList.horizontalPadding}: 0;\n ${r.J.cssVarList.verticalPadding}: 0;\n ${r.J.cssVarList.outlineWidth}: 0;\n }\n\n .combo-box-item {\n display:flex;\n flex-direction: column;\n }\n\n ${(0,l.Kl)()}\n `,this)}set value(t){if(!t)return;const e=(0,u.N)(t).getTime();(0,h.mZ)(e)&&e!==this.epoch&&(this.epoch=e,this.renderCalendar())}get value(){return this.epoch?(0,h.jO)(this.epoch,p.wJ):""}get isSelectedView(){return v(this.preview,this.epoch)}get isTodayView(){return v((0,h.Ln)(),this.preview)}get monthNames(){return(t=>{const e=t?.split(",");return y(e,12)?e:p.US})(this.getAttribute("calendar-months"))}get weekdayNames(){return(t=>{const e=t?.split?.(",");return y(e,7)?e:p.mx})(this.getAttribute("calendar-weekdays"))}get hasYearValue(){return!!this.yearInput.value}get hasMonthValue(){return!!this.monthInput.value}get yearsRange(){const t=this.getAttribute("years-range")?.split("-");if(2===t?.length){const[e,n]=t.map(Number);if(e<=n)return[e,n]}const e=(0,u.N)().getFullYear();return[e,e+p.V$]}init(){super.init?.(),this.initCalendar(),this.renderCalendar()}initCalendar(){this.calendar=this.shadowRoot.querySelector(".calendar"),this.navPrevEle=this.shadowRoot.querySelector(".nav-prev"),this.navNextEle=this.shadowRoot.querySelector(".nav-next"),this.submitButton=this.shadowRoot.querySelector(".submit-button"),this.cancelButton=this.shadowRoot.querySelector(".cancel-button"),this.initInputs(),this.initNav(),this.addEventListener("day-changed",()=>this.submitButton.removeAttribute("disabled")),this.submitButton.shadowRoot.querySelector("vaadin-button").setAttribute("disabled","true")}initInputs(){const t=(()=>{const t=document.createElement("span");return t.innerHTML=`\n <descope-combo-box\n label-type="static"\n bordered="true"\n item-label-path="data-name"\n item-value-path="data-id"\n class="month-input"\n >\n ${b()}\n </descope-combo-box>\n <descope-combo-box\n allow-custom-value="true"\n label-type="static"\n bordered="true"\n item-label-path="data-name"\n item-value-path="data-id"\n class="year-input"\n no-empty-value="true"\n >\n </descope-combo-box>\n `,t})(this.monthNames,this.yearsRange);this.shadowRoot.querySelector(".selectors").appendChild(t),this.monthInput=m(this.shadowRoot.querySelector(".month-input"),this.onMonthChange.bind(this),this.onMonthInputBlur.bind(this)),this.yearInput=m(this.shadowRoot.querySelector(".year-input"),this.onYearChange.bind(this),this.onYearInputBlur.bind(this)),[this.monthInput,this.yearInput].forEach(t=>(0,s.EA)(this,t,{includeAttrs:["disabled","size","st-host-direction"]}))}initNav(){this.navPrevEle.addEventListener("click",this.navPrevMonth.bind(this)),this.navNextEle.addEventListener("click",this.navNextMonth.bind(this)),this.cancelButton.addEventListener("click",this.onCancel.bind(this)),this.submitButton.addEventListener("click",this.onSubmit.bind(this)),[this.navPrevEle,this.navNextEle].forEach(t=>(0,s.EA)(this,t,{includeAttrs:["size"]})),this.shadowRoot.querySelector(".nav-next").innerHTML=c.ZM,this.shadowRoot.querySelector(".nav-prev").innerHTML=c.i1}onSubmit(){this.isDisabled||this.value&&this.dispatchEvent(new CustomEvent("date-submit",{detail:(0,u.N)(this.preview)}))}onCancel(){this.isDisabled||(this.dispatchEvent(new CustomEvent("cancel")),this.dispatchEvent(new CustomEvent("date-cancel")),this.clearSelectedDay())}clearSelectedDay(){this.getSelectedDayEle()?.removeAttribute("data-selected"),this.submitButton.setAttribute("disabled","true"),this.epoch=""}updateInputs(){if(this.yearInput&&this.monthInput){const t=this.preview||(0,h.Ln)(),e=(0,h.Bl)(t),n=(0,h.tj)(t);this.monthInput.value=n,setTimeout(()=>{this.yearInput.baseElement.value=e})}}renderCalendar(){const t=(0,u.N)(this.preview||(0,h.Ln)()).getTime(),[e,n]=(0,h._G)(t);this.calendar&&(this.calendar.innerHTML=((t,e,n)=>{const r=((t,e)=>new Date(t,e,0).getDate())(t,e),a=new Date(t,e-1,1).getDay();let i="<table>";i+=`<thead><tr>${n.reduce((t,e)=>`${t}<th><span class="weekday">${e}</span></th>`,"")}</tr></thead>`,i+="<tbody>",i+="<tr>";for(let t=0;t<a;t++)i+="<td></td>";let o=a;for(let t=1;t<=r;t++)7===o&&(o=0,i+="</tr><tr>"),i+=`\n <td\n data-date-day="${t}"\n class="day-entry">\n <span class="day" data-date-day=${t}>\n ${t}\n </span>\n </td>\n `,o++;for(;o<7;)i+="<td></td>",o++;return i+="</tr></tbody></table>",i})(e,n,this.weekdayNames.map(t=>t.substring(0,3)))),Array.from(this.calendar?.querySelectorAll(".day-entry .day")||[]).forEach(t=>t.addEventListener("click",this.onDayChange.bind(this))),this.updateInputs(),this.setSelectedDay(),this.setCurrentDay()}onDayChange(t){if(this.isDisabled)return;const e=(0,u.N)(this.preview);e.setDate(Number(t.target.getAttribute("data-date-day"))),this.value=(0,h.jO)(e.getTime(),p.wJ),this.dispatchEvent(new CustomEvent("day-changed",{detail:e}))}onYearChange(t){if(!t.target.value)return;const e=(0,u.N)(this.preview);e.setFullYear(Number(t.target.value.trim())),this.preview=e.getTime(),this.renderCalendar(),this.dispatchEvent(new CustomEvent("year-changed",{detail:e}))}onMonthChange(t){if(!t.target.value)return;const e=(0,u.N)(this.preview);e.setMonth(Number(t.target.value)-1),this.preview=e.getTime(),this.renderCalendar(),this.dispatchEvent(new CustomEvent("month-changed",{detail:e}))}onYearInputBlur(t){this.yearInput.baseElement.value=t.target.value||(0,h.Bl)(this.preview)}onMonthInputBlur(t){this.monthInput.baseElement.value=t.target.value||(0,h.tj)(this.preview)}getSelectedDayEle(){const t=(0,u.N)(this.epoch).getDate();return this.calendar?.querySelector(`[data-date-day="${t}"]`)}getCurrentDayEle(){return this.calendar?.querySelector(`[data-date-day="${(0,h._B)()}"]`)}clearSelectedDays(){const t=this.calendar?.querySelectorAll("[data-selected]");t&&t.forEach(t=>t.removeAttribute("data-selected"))}setSelectedDay(){this.clearSelectedDays(),this.value&&this.isSelectedView&&this.getSelectedDayEle().setAttribute("data-selected","true")}setCurrentDay(){if(this.isTodayView){const t=this.getCurrentDayEle(),e=this.getAttribute("calendar-label-today")||p.QF;t?.setAttribute("data-current-day","true"),t?.setAttribute("title",e)}}navPrevMonth(){if(this.isDisabled)return;const t=(t=>{const e=(0,u.N)(t),n=e.getMonth();if(0===n){const t=e.getFullYear();e.setFullYear(t-1),e.setMonth(11)}else e.setMonth(n-1);return e})(this.preview);this.preview=t.getTime(),this.renderCalendar()}navNextMonth(){if(this.isDisabled)return;const t=(t=>{const e=(0,u.N)(t),n=e.getMonth();if(11===n){const t=e.getFullYear();e.setFullYear(t+1),e.setMonth(0)}else e.setMonth(n+1);return e})(this.preview);this.preview=t.getTime(),this.renderCalendar()}clearValue(){this.epoch="",this.value="",this.removeAttribute("preview"),this.submitButton.setAttribute("disabled","true")}onInitialValueChange(t){if(this.value)return;const e=(0,u.N)(t).getTime();(0,h.mZ)(e)?(this.epoch=e,this.preview=e):this.clearValue()}onYearsRangeChange(){setTimeout(()=>{this.yearInput&&(this.yearInput.innerHTML=(t=>{const[e,n]=t,r=[];for(let t=e;t<=n;t++)r.push(t);return r})(this.yearsRange).map(t=>g({label:t,dataId:t,dataName:t})).join(""))})}onMonthNamesChange(){setTimeout(()=>{this.monthInput&&(this.monthInput.innerHTML=b(this.monthNames))})}onSubmitLabelChange(t){this.submitButton&&(this.submitButton.textContent=t||p.Tv)}onCancelLabelChange(t){this.cancelButton&&(this.cancelButton.textContent=t||p.lv)}onInitialMonthChange(t){const e=(0,h.Bl)(this.preview);this.preview=(0,u.N)(`${e}/${t}/1`).getTime()}onInitialYearChange(t){const e=(0,h.tj)(this.preview);this.preview=(0,u.N)(`${t}/${e}/1`).getTime()}attributeChangedCallback(t,e,n){super.attributeChangedCallback(t,e,n),e!==n&&(f.includes(t)?("calendar-label-submit"===t&&this.onSubmitLabelChange(n),"calendar-label-cancel"===t&&this.onCancelLabelChange(n)):(n&&"initial-value"===t&&this.onInitialValueChange(n),n&&"initial-month"===t&&this.onInitialMonthChange(n),n&&"initial-year"===t&&this.onInitialYearChange(n),"years-range"===t&&this.onYearsRangeChange(Number(n)),"calendar-months"===t&&this.onMonthNamesChange(),"calendar-label-today"===t&&this.setCurrentDay(n),"disabled"===t&&setTimeout(()=>{this.cancelButton?.setAttribute("disabled","true"===n)}),this.renderCalendar()))}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}});customElements.define(C,z)},77421(t,e,n){n.d(e,{F:()=>s});var r=n(64101),a=n(15177);const i={MM:"(0?[1-9]|1[0-2])",DD:"(0?[1-9]|[12][0-9]|3[01])",YYYY:"([0-9]{4})"},o=t=>{const e=(t=>`^${t.split(r.eT).map(t=>i[t]).join("\\D")}$`)(t),n=(t=>{const e=t.split(r.eT);return t=>{const n={};return e.forEach((e,r)=>{n[e]=t[r+1]}),[n.YYYY,n.MM,n.DD]}})(t),o=new RegExp(e);return{pattern:e,validate:t=>o.test(t),getDate:t=>((t,e,n)=>{const i=e.exec(t);if(!i)return null;const[o,s,l]=n(i);return(0,a.N)([o,s,l].join(r.eT))})(t,o,n)}},s=Object.fromEntries(r.SP.map(t=>[t,o(t)]))},49224(t,e,n){n.d(e,{Bl:()=>h,Et:()=>o,Ln:()=>d,Rm:()=>y,Xs:()=>u,_B:()=>p,_G:()=>s,jO:()=>l,mZ:()=>i,tj:()=>c,xq:()=>g});var r=n(77421),a=n(15177);const i=t=>!Number.isNaN(Number(t)),o=t=>!!String(t||"").trim()&&!Number.isNaN(Number(t)),s=t=>{const e=(0,a.N)(t);return[e.getFullYear(),e.getMonth()+1,e.getDate()]},l=(t,e)=>{const[n,r,a]=s(t),i={DD:String(a).padStart(2,"0"),MM:String(r).padStart(2,"0"),YYYY:String(n)};return e.replace(/DD|MM|YYYY/g,t=>i[t])},d=()=>(0,a.N)().getTime(),h=t=>(0,a.N)(t).getFullYear().toString(),c=t=>((0,a.N)(t).getMonth()+1).toString(),p=()=>(0,a.N)().getDate(),u=t=>{const e=new CSSStyleSheet;e.insertRule(":host{display:block!important;}"),t?.shadowRoot?.adoptedStyleSheets?.push(e)},y=(t,e)=>{const n=t.trim?.();return n?r.F[e].getDate(n):null},g=(t,e)=>"number"==typeof t?t:e?Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()):t.getTime()},80071(t,e,n){n.d(e,{ZM:()=>a,i1:()=>i,ki:()=>r});const r='\n<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9 5H15V4.50468C15 4.21404 15.226 4 15.5047 4H16.4953C16.786 4 17 4.22595 17 4.50468V5H18.7568C19.3028 5 19.75 5.44725 19.75 5.99896V7.00104C19.75 7.55734 19.3053 8 18.7568 8H5.24317C4.69717 8 4.25 7.55275 4.25 7.00104V5.99896C4.25 5.44266 4.69466 5 5.24317 5H7V4.50468C7 4.21404 7.22596 4 7.50468 4H8.49532C8.78596 4 9 4.22595 9 4.50468V5ZM5.50468 9H6.49532C6.78596 9 7 9.22596 7 9.50468V10.4953C7 10.786 6.77404 11 6.49532 11H5.50468C5.21404 11 5 10.774 5 10.4953V9.50468C5 9.21404 5.22595 9 5.50468 9ZM8.50468 9H9.49532C9.78596 9 10 9.22596 10 9.50468V10.4953C10 10.786 9.77404 11 9.49532 11H8.50468C8.21404 11 8 10.774 8 10.4953V9.50468C8 9.21404 8.22596 9 8.50468 9ZM11.5047 9H12.4953C12.786 9 13 9.22596 13 9.50468V10.4953C13 10.786 12.774 11 12.4953 11H11.5047C11.214 11 11 10.774 11 10.4953V9.50468C11 9.21404 11.226 9 11.5047 9ZM5.50468 12H6.49532C6.78596 12 7 12.226 7 12.5047V13.4953C7 13.786 6.77404 14 6.49532 14H5.50468C5.21404 14 5 13.774 5 13.4953V12.5047C5 12.214 5.22595 12 5.50468 12ZM8.50468 12H9.49532C9.78596 12 10 12.226 10 12.5047V13.4953C10 13.786 9.77404 14 9.49532 14H8.50468C8.21404 14 8 13.774 8 13.4953V12.5047C8 12.214 8.22596 12 8.50468 12ZM11.5047 12H12.4953C12.786 12 13 12.226 13 12.5047V13.4953C13 13.786 12.774 14 12.4953 14H11.5047C11.214 14 11 13.774 11 13.4953V12.5047C11 12.214 11.226 12 11.5047 12ZM5.50468 15H6.49532C6.78596 15 7 15.226 7 15.5047V16.4953C7 16.786 6.77404 17 6.49532 17H5.50468C5.21404 17 5 16.774 5 16.4953V15.5047C5 15.214 5.22595 15 5.50468 15ZM8.50468 15H9.49532C9.78596 15 10 15.226 10 15.5047V16.4953C10 16.786 9.77404 17 9.49532 17H8.50468C8.21404 17 8 16.774 8 16.4953V15.5047C8 15.214 8.22596 15 8.50468 15ZM11.5047 15H12.4953C12.786 15 13 15.226 13 15.5047V16.4953C13 16.786 12.774 17 12.4953 17H11.5047C11.214 17 11 16.774 11 16.4953V15.5047C11 15.214 11.226 15 11.5047 15ZM14.5047 9H15.4953C15.786 9 16 9.22596 16 9.50468V10.4953C16 10.786 15.774 11 15.4953 11H14.5047C14.214 11 14 10.774 14 10.4953V9.50468C14 9.21404 14.226 9 14.5047 9ZM14.5047 12H15.4953C15.786 12 16 12.226 16 12.5047V13.4953C16 13.786 15.774 14 15.4953 14H14.5047C14.214 14 14 13.774 14 13.4953V12.5047C14 12.214 14.226 12 14.5047 12ZM14.5047 15H15.4953C15.786 15 16 15.226 16 15.5047V16.4953C16 16.786 15.774 17 15.4953 17H14.5047C14.214 17 14 16.774 14 16.4953V15.5047C14 15.214 14.226 15 14.5047 15ZM17.5047 15H18.4953C18.786 15 19 15.226 19 15.5047V16.4953C19 16.786 18.774 17 18.4953 17H17.5047C17.214 17 17 16.774 17 16.4953V15.5047C17 15.214 17.226 15 17.5047 15ZM5.50468 18H6.49532C6.78596 18 7 18.226 7 18.5047V19.4953C7 19.786 6.77404 20 6.49532 20H5.50468C5.21404 20 5 19.774 5 19.4953V18.5047C5 18.214 5.22595 18 5.50468 18ZM8.50468 18H9.49532C9.78596 18 10 18.226 10 18.5047V19.4953C10 19.786 9.77404 20 9.49532 20H8.50468C8.21404 20 8 19.774 8 19.4953V18.5047C8 18.214 8.22596 18 8.50468 18ZM11.5047 18H12.4953C12.786 18 13 18.226 13 18.5047V19.4953C13 19.786 12.774 20 12.4953 20H11.5047C11.214 20 11 19.774 11 19.4953V18.5047C11 18.214 11.226 18 11.5047 18ZM14.5047 18H15.4953C15.786 18 16 18.226 16 18.5047V19.4953C16 19.786 15.774 20 15.4953 20H14.5047C14.214 20 14 19.774 14 19.4953V18.5047C14 18.214 14.226 18 14.5047 18ZM17.5047 18H18.4953C18.786 18 19 18.226 19 18.5047V19.4953C19 19.786 18.774 20 18.4953 20H17.5047C17.214 20 17 19.774 17 19.4953V18.5047C17 18.214 17.226 18 17.5047 18ZM17.5047 12H18.4953C18.786 12 19 12.226 19 12.5047V13.4953C19 13.786 18.774 14 18.4953 14H17.5047C17.214 14 17 13.774 17 13.4953V12.5047C17 12.214 17.226 12 17.5047 12ZM17.5047 9H18.4953C18.786 9 19 9.22596 19 9.50468V10.4953C19 10.786 18.774 11 18.4953 11H17.5047C17.214 11 17 10.774 17 10.4953V9.50468C17 9.21404 17.226 9 17.5047 9Z" fill="#808080"/>\n</svg>\n',a='\n<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.27283 6.78069C8.87912 6.34164 8.91587 5.66655 9.35492 5.27283C9.79397 4.87912 10.4691 4.91587 10.8628 5.35492C10.8628 5.35492 16.0022 10.9543 16.366 11.36C16.7298 11.7657 16.7298 12.2392 16.366 12.6448L10.8628 18.6451C10.4691 19.0841 9.79397 19.1209 9.35492 18.7272C8.91587 18.3334 8.87912 17.6584 9.27283 17.2193L14.1368 12L9.27283 6.78069Z" fill="#808080"/>\n</svg>',i='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.7272 17.2193C15.1209 17.6584 15.0841 18.3334 14.6451 18.7272C14.206 19.1209 13.5309 19.0841 13.1372 18.6451C13.1372 18.6451 7.99776 13.0457 7.63399 12.64C7.27023 12.2343 7.27023 11.7608 7.63399 11.3552L13.1372 5.35492C13.5309 4.91587 14.206 4.87912 14.6451 5.27283C15.0841 5.66655 15.1209 6.34164 14.7272 6.78069L9.86322 12L14.7272 17.2193Z" fill="#808080"/>\n</svg>'}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[6028],{19624(t,e,n){n.d(e,{J:()=>u,T:()=>l});var r=n(63200),a=n(25964),i=n(88961),o=n(98538),s=n(10767);const l=(0,a.xE)("button"),{host:d,label:h,slottedIcon:c}={host:{selector:()=>":host"},label:{selector:"::part(label)"},slottedIcon:{selector:()=>"::slotted(descope-icon)"}};let p;const u=(0,r.Zz)((0,i.DM)({triggers:[{attr:"full-width",value:"true"}]}),(0,i.RF)({mappings:{hostWidth:{property:"width"},hostHeight:{property:"height"},hostDirection:{...d,property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},cursor:{},backgroundColor:{},outlineOffset:{},outlineColor:{},outlineStyle:{},outlineWidth:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-right",fallback:"0.875em"},{property:"padding-left",fallback:"0.875em"}],labelTextColor:{property:"color"},iconColor:{selector:()=>"::slotted(*)",property:o.S.cssVarList.fill},labelTextDecoration:{...h,property:"text-decoration"},labelSpacing:{...h,property:"gap"},textAlign:{...h,property:"justify-content",fallback:"center"},iconSize:[{...c,property:"width"},{...c,property:"height"}]}}),s.G,i.VO,i.tQ)((0,i.tz)({slots:["","prefix","label","suffix"],wrappedEleName:"vaadin-button",style:()=>`\n\t\t\t\n\t:host {\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t}\n\tvaadin-button::before,\n\tvaadin-button::after {\n\t\topacity: 0;\n\t}\n\tvaadin-button {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\twidth: 100%;\n\t\theight: auto;\n\t\tbox-shadow: none;\n\t}\n\tvaadin-button::part(label) {\n\t\tpadding: 0;\n width: 100%;\n\t}\n\tvaadin-button::part(prefix) {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t}\n\n\t\t\t\n\tvaadin-button::part(prefix),\n\tvaadin-button::part(label) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t\t\t${p}\n\t\t\tvaadin-button::part(label) { pointer-events: none; }\n\t\t\t:host {\n\t\t\t\tpadding: calc(var(${u.cssVarList.outlineWidth}) + var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n :host([full-width="true"]) {\n width: var(${u.cssVarList.hostWidth});\n }\n\t\t\tvaadin-button {\n\t\t\t\theight: calc(var(${u.cssVarList.hostHeight}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n\t\t\t}\n\t\t\t[square="true"]:not([full-width="true"]) {\n\t\t\t\twidth: calc(var(${u.cssVarList.hostWidth}) - var(${u.cssVarList.outlineWidth}) - var(${u.cssVarList.outlineOffset}));\n padding: 0;\n\t\t\t}\n\t\t`,excludeAttrsSync:["tabindex","class","style"],componentName:l})),{color:y,fontSize:g}=u.cssVarList;p=`\n\t@keyframes spin {\n\t\t0% { -webkit-transform: rotate(0deg); }\n\t\t100% { -webkit-transform: rotate(360deg); }\n\t}\n\t:host([loading="true"]) ::before {\n\t\tanimation: spin 2s linear infinite;\n\t\tposition: absolute;\n\t\tcontent: '';\n\t\tz-index: 1;\n\t\tbox-sizing: border-box;\n\t\tborder-radius: 50%;\n\t\tborder-bottom-color: transparent;\n\t\tborder-left-color: transparent;\n\t\tborder-style: solid;\n\t\tcolor: var(${y});\n\t\ttop: calc(50% - (var(${g}) / 2));\n\t\tleft: calc(50% - (var(${g}) / 2));\n\t\tborder-width: calc(var(${g}) / 10);\n\t\twidth: var(${g});\n\t\theight: var(${g});\n\t}\n\t:host([disabled="true"]),\n\t:host([loading="true"]) {\n\t\tpointer-events: none;\n\t}\n\t:host([loading="true"]) ::part(prefix),\n\t:host([loading="true"]) ::part(label) {\n\t\tvisibility: hidden;\n\t}\n`},10767(t,e,n){n.d(e,{G:()=>r});const r=t=>class extends t{get isLoading(){return"true"===this.getAttribute("loading")}click(){this.isLoading||super.click()}}},30576(t,e,n){n.r(e),n.d(e,{ButtonClass:()=>r.J,componentName:()=>r.T});var r=n(19624);n(83799),customElements.define(r.T,r.J)},98538(t,e,n){n.d(e,{S:()=>l,T:()=>s});var r=n(88961),a=n(25964),i=n(8512),o=n(63200);const s=(0,a.xE)("icon"),l=(0,o.Zz)((0,r.RF)({mappings:{fill:[{},{property:i.q.cssVarList.fill}],height:{selector:()=>":host"},width:{selector:()=>":host"}}}),r.VO,r.tQ)((0,r.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n max-height: 100%;\n }\n ",excludeAttrsSync:["tabindex","class","style","st-height","st-width"],componentName:s}))},8512(t,e,n){n.d(e,{T:()=>l,q:()=>c});var r=n(88961),a=n(72270),i=n(63200),o=n(25964),s=n(18782);const l=(0,o.xE)("image"),d=["src","src-dark"];class h extends((0,a.qu)({componentName:l,baseSelector:"slot"})){static get observedAttributes(){return d}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,o.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(${c.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)})}renderImage(){this.toggleVisibility(this.getSrc),(0,s.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 c=(0,i.Zz)((0,r.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),r.VO,r.tQ)(h)},18782(t,e,n){n.d(e,{m:()=>i});var r=n(25414);const a=t=>{const e=r.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")},i=async(t,e)=>{try{let n;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));n=a(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),r=await e.text();n=a(r)}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}}},3393(t,e,n){n.d(e,{y:()=>o});var r=n(9696),a=n(79365),i=n(81365);const o=(...t)=>(0,r.Zz)(a.XX,a._$,a.yF,a.jd)((0,i.q)(...t))},64101(t,e,n){n.d(e,{QF:()=>y,SP:()=>r,SZ:()=>g,Tv:()=>p,US:()=>l,V$:()=>o,eT:()=>s,lv:()=>u,mx:()=>d,nr:()=>c,rR:()=>h,ui:()=>a,wJ:()=>i});const r=["MM/DD/YYYY","DD/MM/YYYY","YYYY/MM/DD"],a=r[0],i="YYYY-MM-DD",o=100,s="/",l=["January","February","March","April","May","June","July","August","September","October","November","December"],d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h={MONTH:{id:"month",min:1,max:12,placeholder:"MM"},DAY:{id:"day",min:1,max:31,placeholder:"DD"},YEAR:{id:"year",min:0,max:9999,placeholder:"YYYY"}},c={year:{min:1900,max:2099}},p="Done",u="Cancel",y="Today",g=150},15177(t,e,n){n.d(e,{N:()=>r});const r=(t,e)=>{if("number"==typeof t)return new Date(t);if("string"==typeof t){const n=new Date(t.replace(/-/g,"/"));return e?new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())):new Date(n)}return new Date}},88350(t,e,n){n.r(e),n.d(e,{CalendarClass:()=>z,componentName:()=>C}),n(27092),n(30576);var r=n(19624),a=n(25964),i=n(3393),o=n(9696),s=n(97810),l=n(73551),d=n(79365),h=n(49224),c=n(80071),p=n(64101),u=n(15177);const y=(t,e)=>Array.isArray(t)&&t.length===e&&t.filter(Boolean).length===e,g=({label:t,dataId:e,dataName:n})=>`\n\t<div class="combo-box-item"\n\t\tdata-id="${e}"\n\t\tdata-name="${n}"\n\t>\n\t\t\t${t}\n\t</div>\n`,b=(t=p.US)=>t.map((t,e)=>g({label:t,dataId:e+1,dataName:t})).join(""),v=(t,e)=>{const[n,r]=(0,h._G)(e),[a,i]=(0,h._G)(t);return a===n&&i===r},m=(t,e,n)=>(t.addEventListener("input",e),t.addEventListener("focusout",n),t),C=(0,s.xE)("calendar"),w=["initial-value","initial-year","initial-month","years-range","calendar-months","calendar-weekdays","calendar-label-today","st-host-direction","disabled","full-width"],f=["calendar-label-submit","calendar-label-cancel"],S=(0,i.y)({componentName:C,baseSelector:"div"}),{calendar:x,day:M,dayEntry:V,currentDay:D,selectedDay:N,disabledDay:H,weekday:E,topNav:T,topNavSelectors:Y,bottomNav:L,navPrev:A,navNext:k,navPrevRTL:B,navNextRTL:I,yearInput:$,monthInput:R}={calendar:{selector:()=>".calendar"},topNav:{selector:()=>".nav.top-nav"},topNavSelectors:{selector:()=>".nav.top-nav .selectors > span"},bottomNav:{selector:()=>".nav.bottom-nav"},day:{selector:()=>".day"},dayEntry:{selector:()=>".day-entry"},currentDay:{selector:()=>".day-entry[data-current-day] .day"},selectedDay:{selector:()=>".day-entry[data-selected] .day"},disabledDay:{selector:()=>'.day-entry[data-disabled="true"] .day'},weekday:{selector:()=>".weekday"},navPrev:{selector:()=>".nav-prev"},navNext:{selector:()=>".nav-next"},navPrevRTL:{selector:()=>':host([st-host-direction="rtl"]) .nav-prev'},navNextRTL:{selector:()=>':host([st-host-direction="rtl"]) .nav-next'},yearInput:{selector:()=>".year-input"},monthInput:{selector:()=>".month-input"}},z=(0,o.Zz)((0,d.RF)({componentNameOverride:(0,s.xE)("input-wrapper")}),(0,d.RF)({mappings:{fontSize:{},fontFamily:{},hostWidth:[{selector:()=>":host",property:"width"},{selector:"table",property:"width"}],hostDirection:{property:"direction"},topNavVerticalPadding:[{...T,property:"padding-top"},{...T,property:"padding-bottom"}],topNavHorizointalPadding:[{...T,property:"padding-right"},{...T,property:"padding-left"}],topNavAlignment:{...T,property:"justify-content"},topNavGap:{...T,property:"gap"},topNavSelectorsGap:{...Y,property:"gap"},bottomNavVerticalPadding:[{...L,property:"padding-top"},{...L,property:"padding-bottom"}],bottomNavHorizontalPadding:[{...L,property:"padding-right"},{...L,property:"padding-left"}],bottomNavAlignment:{...L,property:"justify-content"},bottomNavGap:{...L,property:"gap"},navMarginBottom:{...T,property:"margin-bottom"},calendarPadding:[{...x,property:"padding-bottom"},{...x,property:"padding-right"},{...x,property:"padding-left"}],navBorderBottomWidth:{...T,property:"border-bottom-width"},navBorderBottomColor:{...T,property:"border-bottom-color"},navBorderBottomStyle:{...T,property:"border-bottom-style"},weekdayFontSize:{...E,property:"font-size"},weekdayFontWeight:{...E,property:"font-weight"},currentDayBorderColor:{...D,property:"border-color"},currentDayBorderWidth:{...D,property:"border-width"},currentDayBorderStyle:{...D,property:"border-style"},dayHeight:{...V,property:"height"},daySize:[{...M,property:"height"},{...M,property:"width"}],dayPadding:{...M,property:"padding"},dayRadius:{...M,property:"border-radius"},dayTextAlign:{...M,property:"text-align"},dayBlockAlign:{...M,property:"margin"},dayTextColor:{...M,property:"color"},dayFontWeight:{...M,property:"font-weight"},dayBackgroundColor:{...M,property:"background-color"},dayCursor:{...M,property:"cursor"},dayFontSize:{...M,property:"font-size"},dayBackgroundColorHover:{selector:()=>".day:hover",property:"background-color"},daySelectedTextdColor:{...N,property:"color"},daySelectedBackgroundColor:{...N,property:"background-color"},dayDisabledTextdColor:{...H,property:"color"},yearInputWidth:{...$,property:"width"},monthInputWidth:{...R,property:"width"},navButtonSize:[{...A,property:"width"},{...A,property:"height"},{...k,property:"width"},{...k,property:"height"}],navButtonCursor:[{...A,property:"cursor"},{...k,property:"cursor"}],navButtonRotation:[{...B,property:"transform"},{...I,property:"transform"}],navButtonOpacity:[{...A,property:"opacity"},{...k,property:"opacity"}]}}),d.VO,d.tQ)(class extends S{static get observedAttributes(){return[].concat(S.observedAttributes||[],w,f)}preview;epoch;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <nav class="nav top-nav">\n <div class="nav-prev">\n </div>\n <div class="selectors"></div>\n <div class="nav-next">\n </div>\n </nav>\n <div class="calendar"></div>\n <nav class="nav bottom-nav">\n <descope-button class="cancel-button" variant="link" mode="primary">Cancel</descope-button>\n <descope-button class="submit-button" variant="link" mode="primary" disabled="true">Done</descope-button>\n </nav>\n </div>\n ',(0,a.fz)(`\n :host {\n display: inline-block;\n box-sizing: border-box;\n max-width: 100%;\n user-select: none;\n -webkit-user-select: none;\n }\n\n :host ::slotted {\n padding: 0;\n }\n\n [data-toggle-calendar] {\n cursor: pointer;\n display: flex;\n align-self: center;\n z-index: 1;\n }\n\n [data-disabled="true"] {\n pointer-events: none;\n }\n\n .calendar .day {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .nav {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n }\n\n .selectors,\n .selectors span {\n display: flex;\n justify-content: center;\n }\n\n descope-button {\n padding: 0;\n ${r.J.cssVarList.horizontalPadding}: 0;\n ${r.J.cssVarList.verticalPadding}: 0;\n ${r.J.cssVarList.outlineWidth}: 0;\n }\n\n .combo-box-item {\n display:flex;\n flex-direction: column;\n }\n\n ${(0,l.Kl)()}\n `,this)}set value(t){if(!t)return;const e=(0,u.N)(t).getTime();(0,h.mZ)(e)&&e!==this.epoch&&(this.epoch=e,this.renderCalendar())}get value(){return this.epoch?(0,h.jO)(this.epoch,p.wJ):""}get isSelectedView(){return v(this.preview,this.epoch)}get isTodayView(){return v((0,h.Ln)(),this.preview)}get monthNames(){return(t=>{const e=t?.split(",");return y(e,12)?e:p.US})(this.getAttribute("calendar-months"))}get weekdayNames(){return(t=>{const e=t?.split?.(",");return y(e,7)?e:p.mx})(this.getAttribute("calendar-weekdays"))}get hasYearValue(){return!!this.yearInput.value}get hasMonthValue(){return!!this.monthInput.value}get yearsRange(){const t=this.getAttribute("years-range")?.split("-");if(2===t?.length){const[e,n]=t.map(Number);if(e<=n)return[e,n]}const e=(0,u.N)().getFullYear();return[e,e+p.V$]}init(){super.init?.(),this.initCalendar(),this.renderCalendar()}initCalendar(){this.calendar=this.shadowRoot.querySelector(".calendar"),this.navPrevEle=this.shadowRoot.querySelector(".nav-prev"),this.navNextEle=this.shadowRoot.querySelector(".nav-next"),this.submitButton=this.shadowRoot.querySelector(".submit-button"),this.cancelButton=this.shadowRoot.querySelector(".cancel-button"),this.initInputs(),this.initNav(),this.addEventListener("day-changed",()=>this.submitButton.removeAttribute("disabled")),this.submitButton.shadowRoot.querySelector("vaadin-button").setAttribute("disabled","true")}initInputs(){const t=(()=>{const t=document.createElement("span");return t.innerHTML=`\n <descope-combo-box\n label-type="static"\n bordered="true"\n item-label-path="data-name"\n item-value-path="data-id"\n class="month-input"\n >\n ${b()}\n </descope-combo-box>\n <descope-combo-box\n allow-custom-value="true"\n label-type="static"\n bordered="true"\n item-label-path="data-name"\n item-value-path="data-id"\n class="year-input"\n no-empty-value="true"\n >\n </descope-combo-box>\n `,t})(this.monthNames,this.yearsRange);this.shadowRoot.querySelector(".selectors").appendChild(t),this.monthInput=m(this.shadowRoot.querySelector(".month-input"),this.onMonthChange.bind(this),this.onMonthInputBlur.bind(this)),this.yearInput=m(this.shadowRoot.querySelector(".year-input"),this.onYearChange.bind(this),this.onYearInputBlur.bind(this)),[this.monthInput,this.yearInput].forEach(t=>(0,s.EA)(this,t,{includeAttrs:["disabled","size","st-host-direction"]}))}initNav(){this.navPrevEle.addEventListener("click",this.navPrevMonth.bind(this)),this.navNextEle.addEventListener("click",this.navNextMonth.bind(this)),this.cancelButton.addEventListener("click",this.onCancel.bind(this)),this.submitButton.addEventListener("click",this.onSubmit.bind(this)),[this.navPrevEle,this.navNextEle].forEach(t=>(0,s.EA)(this,t,{includeAttrs:["size"]})),this.shadowRoot.querySelector(".nav-next").innerHTML=c.ZM,this.shadowRoot.querySelector(".nav-prev").innerHTML=c.i1}onSubmit(){this.isDisabled||this.value&&this.dispatchEvent(new CustomEvent("date-submit",{detail:(0,u.N)(this.preview)}))}onCancel(){this.isDisabled||(this.dispatchEvent(new CustomEvent("cancel")),this.dispatchEvent(new CustomEvent("date-cancel")),this.clearSelectedDay())}clearSelectedDay(){this.getSelectedDayEle()?.removeAttribute("data-selected"),this.submitButton.setAttribute("disabled","true"),this.epoch=""}updateInputs(){if(this.yearInput&&this.monthInput){const t=this.preview||(0,h.Ln)(),e=(0,h.Bl)(t),n=(0,h.tj)(t);this.monthInput.value=n,setTimeout(()=>{this.yearInput.baseElement.value=e})}}renderCalendar(){const t=(0,u.N)(this.preview||(0,h.Ln)()).getTime(),[e,n]=(0,h._G)(t);this.calendar&&(this.calendar.innerHTML=((t,e,n)=>{const r=((t,e)=>new Date(t,e,0).getDate())(t,e),a=new Date(t,e-1,1).getDay();let i="<table>";i+=`<thead><tr>${n.reduce((t,e)=>`${t}<th><span class="weekday">${e}</span></th>`,"")}</tr></thead>`,i+="<tbody>",i+="<tr>";for(let t=0;t<a;t++)i+="<td></td>";let o=a;for(let t=1;t<=r;t++)7===o&&(o=0,i+="</tr><tr>"),i+=`\n <td\n data-date-day="${t}"\n class="day-entry">\n <span class="day" data-date-day=${t}>\n ${t}\n </span>\n </td>\n `,o++;for(;o<7;)i+="<td></td>",o++;return i+="</tr></tbody></table>",i})(e,n,this.weekdayNames.map(t=>t.substring(0,3)))),Array.from(this.calendar?.querySelectorAll(".day-entry .day")||[]).forEach(t=>t.addEventListener("click",this.onDayChange.bind(this))),this.updateInputs(),this.setSelectedDay(),this.setCurrentDay()}onDayChange(t){if(this.isDisabled)return;const e=(0,u.N)(this.preview);e.setDate(Number(t.target.getAttribute("data-date-day"))),this.value=(0,h.jO)(e.getTime(),p.wJ),this.dispatchEvent(new CustomEvent("day-changed",{detail:e}))}onYearChange(t){if(!t.target.value)return;const e=(0,u.N)(this.preview);e.setFullYear(Number(t.target.value.trim())),this.preview=e.getTime(),this.renderCalendar(),this.dispatchEvent(new CustomEvent("year-changed",{detail:e}))}onMonthChange(t){if(!t.target.value)return;const e=(0,u.N)(this.preview);e.setMonth(Number(t.target.value)-1),this.preview=e.getTime(),this.renderCalendar(),this.dispatchEvent(new CustomEvent("month-changed",{detail:e}))}onYearInputBlur(t){this.yearInput.baseElement.value=t.target.value||(0,h.Bl)(this.preview)}onMonthInputBlur(t){this.monthInput.baseElement.value=t.target.value||(0,h.tj)(this.preview)}getSelectedDayEle(){const t=(0,u.N)(this.epoch).getDate();return this.calendar?.querySelector(`[data-date-day="${t}"]`)}getCurrentDayEle(){return this.calendar?.querySelector(`[data-date-day="${(0,h._B)()}"]`)}clearSelectedDays(){const t=this.calendar?.querySelectorAll("[data-selected]");t&&t.forEach(t=>t.removeAttribute("data-selected"))}setSelectedDay(){this.clearSelectedDays(),this.value&&this.isSelectedView&&this.getSelectedDayEle().setAttribute("data-selected","true")}setCurrentDay(){if(this.isTodayView){const t=this.getCurrentDayEle(),e=this.getAttribute("calendar-label-today")||p.QF;t?.setAttribute("data-current-day","true"),t?.setAttribute("title",e)}}navPrevMonth(){if(this.isDisabled)return;const t=(t=>{const e=(0,u.N)(t),n=e.getMonth();if(0===n){const t=e.getFullYear();e.setFullYear(t-1),e.setMonth(11)}else e.setMonth(n-1);return e})(this.preview);this.preview=t.getTime(),this.renderCalendar()}navNextMonth(){if(this.isDisabled)return;const t=(t=>{const e=(0,u.N)(t),n=e.getMonth();if(11===n){const t=e.getFullYear();e.setFullYear(t+1),e.setMonth(0)}else e.setMonth(n+1);return e})(this.preview);this.preview=t.getTime(),this.renderCalendar()}clearValue(){this.epoch="",this.value="",this.removeAttribute("preview"),this.submitButton.setAttribute("disabled","true")}onInitialValueChange(t){if(this.value)return;const e=(0,u.N)(t).getTime();(0,h.mZ)(e)?(this.epoch=e,this.preview=e):this.clearValue()}onYearsRangeChange(){setTimeout(()=>{this.yearInput&&(this.yearInput.innerHTML=(t=>{const[e,n]=t,r=[];for(let t=e;t<=n;t++)r.push(t);return r})(this.yearsRange).map(t=>g({label:t,dataId:t,dataName:t})).join(""))})}onMonthNamesChange(){setTimeout(()=>{this.monthInput&&(this.monthInput.innerHTML=b(this.monthNames))})}onSubmitLabelChange(t){this.submitButton&&(this.submitButton.textContent=t||p.Tv)}onCancelLabelChange(t){this.cancelButton&&(this.cancelButton.textContent=t||p.lv)}onInitialMonthChange(t){const e=(0,h.Bl)(this.preview);this.preview=(0,u.N)(`${e}/${t}/1`).getTime()}onInitialYearChange(t){const e=(0,h.tj)(this.preview);this.preview=(0,u.N)(`${t}/${e}/1`).getTime()}attributeChangedCallback(t,e,n){super.attributeChangedCallback(t,e,n),e!==n&&(f.includes(t)?("calendar-label-submit"===t&&this.onSubmitLabelChange(n),"calendar-label-cancel"===t&&this.onCancelLabelChange(n)):(n&&"initial-value"===t&&this.onInitialValueChange(n),n&&"initial-month"===t&&this.onInitialMonthChange(n),n&&"initial-year"===t&&this.onInitialYearChange(n),"years-range"===t&&this.onYearsRangeChange(Number(n)),"calendar-months"===t&&this.onMonthNamesChange(),"calendar-label-today"===t&&this.setCurrentDay(n),"disabled"===t&&setTimeout(()=>{this.cancelButton?.setAttribute("disabled","true"===n)}),this.renderCalendar()))}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}});customElements.define(C,z)},77421(t,e,n){n.d(e,{F:()=>s});var r=n(64101),a=n(15177);const i={MM:"(0?[1-9]|1[0-2])",DD:"(0?[1-9]|[12][0-9]|3[01])",YYYY:"([0-9]{4})"},o=t=>{const e=(t=>`^${t.split(r.eT).map(t=>i[t]).join("\\D")}$`)(t),n=(t=>{const e=t.split(r.eT);return t=>{const n={};return e.forEach((e,r)=>{n[e]=t[r+1]}),[n.YYYY,n.MM,n.DD]}})(t),o=new RegExp(e);return{pattern:e,validate:t=>o.test(t),getDate:t=>((t,e,n)=>{const i=e.exec(t);if(!i)return null;const[o,s,l]=n(i);return(0,a.N)([o,s,l].join(r.eT))})(t,o,n)}},s=Object.fromEntries(r.SP.map(t=>[t,o(t)]))},49224(t,e,n){n.d(e,{Bl:()=>h,Et:()=>o,Ln:()=>d,Rm:()=>y,Xs:()=>u,_B:()=>p,_G:()=>s,jO:()=>l,mZ:()=>i,tj:()=>c,xq:()=>g});var r=n(77421),a=n(15177);const i=t=>!Number.isNaN(Number(t)),o=t=>!!String(t||"").trim()&&!Number.isNaN(Number(t)),s=t=>{const e=(0,a.N)(t);return[e.getFullYear(),e.getMonth()+1,e.getDate()]},l=(t,e)=>{const[n,r,a]=s(t),i={DD:String(a).padStart(2,"0"),MM:String(r).padStart(2,"0"),YYYY:String(n)};return e.replace(/DD|MM|YYYY/g,t=>i[t])},d=()=>(0,a.N)().getTime(),h=t=>(0,a.N)(t).getFullYear().toString(),c=t=>((0,a.N)(t).getMonth()+1).toString(),p=()=>(0,a.N)().getDate(),u=t=>{const e=new CSSStyleSheet;e.insertRule(":host{display:block!important;}"),t?.shadowRoot?.adoptedStyleSheets?.push(e)},y=(t,e)=>{const n=t.trim?.();return n?r.F[e].getDate(n):null},g=(t,e)=>"number"==typeof t?t:e?Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()):t.getTime()},80071(t,e,n){n.d(e,{ZM:()=>a,i1:()=>i,ki:()=>r});const r='\n<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9 5H15V4.50468C15 4.21404 15.226 4 15.5047 4H16.4953C16.786 4 17 4.22595 17 4.50468V5H18.7568C19.3028 5 19.75 5.44725 19.75 5.99896V7.00104C19.75 7.55734 19.3053 8 18.7568 8H5.24317C4.69717 8 4.25 7.55275 4.25 7.00104V5.99896C4.25 5.44266 4.69466 5 5.24317 5H7V4.50468C7 4.21404 7.22596 4 7.50468 4H8.49532C8.78596 4 9 4.22595 9 4.50468V5ZM5.50468 9H6.49532C6.78596 9 7 9.22596 7 9.50468V10.4953C7 10.786 6.77404 11 6.49532 11H5.50468C5.21404 11 5 10.774 5 10.4953V9.50468C5 9.21404 5.22595 9 5.50468 9ZM8.50468 9H9.49532C9.78596 9 10 9.22596 10 9.50468V10.4953C10 10.786 9.77404 11 9.49532 11H8.50468C8.21404 11 8 10.774 8 10.4953V9.50468C8 9.21404 8.22596 9 8.50468 9ZM11.5047 9H12.4953C12.786 9 13 9.22596 13 9.50468V10.4953C13 10.786 12.774 11 12.4953 11H11.5047C11.214 11 11 10.774 11 10.4953V9.50468C11 9.21404 11.226 9 11.5047 9ZM5.50468 12H6.49532C6.78596 12 7 12.226 7 12.5047V13.4953C7 13.786 6.77404 14 6.49532 14H5.50468C5.21404 14 5 13.774 5 13.4953V12.5047C5 12.214 5.22595 12 5.50468 12ZM8.50468 12H9.49532C9.78596 12 10 12.226 10 12.5047V13.4953C10 13.786 9.77404 14 9.49532 14H8.50468C8.21404 14 8 13.774 8 13.4953V12.5047C8 12.214 8.22596 12 8.50468 12ZM11.5047 12H12.4953C12.786 12 13 12.226 13 12.5047V13.4953C13 13.786 12.774 14 12.4953 14H11.5047C11.214 14 11 13.774 11 13.4953V12.5047C11 12.214 11.226 12 11.5047 12ZM5.50468 15H6.49532C6.78596 15 7 15.226 7 15.5047V16.4953C7 16.786 6.77404 17 6.49532 17H5.50468C5.21404 17 5 16.774 5 16.4953V15.5047C5 15.214 5.22595 15 5.50468 15ZM8.50468 15H9.49532C9.78596 15 10 15.226 10 15.5047V16.4953C10 16.786 9.77404 17 9.49532 17H8.50468C8.21404 17 8 16.774 8 16.4953V15.5047C8 15.214 8.22596 15 8.50468 15ZM11.5047 15H12.4953C12.786 15 13 15.226 13 15.5047V16.4953C13 16.786 12.774 17 12.4953 17H11.5047C11.214 17 11 16.774 11 16.4953V15.5047C11 15.214 11.226 15 11.5047 15ZM14.5047 9H15.4953C15.786 9 16 9.22596 16 9.50468V10.4953C16 10.786 15.774 11 15.4953 11H14.5047C14.214 11 14 10.774 14 10.4953V9.50468C14 9.21404 14.226 9 14.5047 9ZM14.5047 12H15.4953C15.786 12 16 12.226 16 12.5047V13.4953C16 13.786 15.774 14 15.4953 14H14.5047C14.214 14 14 13.774 14 13.4953V12.5047C14 12.214 14.226 12 14.5047 12ZM14.5047 15H15.4953C15.786 15 16 15.226 16 15.5047V16.4953C16 16.786 15.774 17 15.4953 17H14.5047C14.214 17 14 16.774 14 16.4953V15.5047C14 15.214 14.226 15 14.5047 15ZM17.5047 15H18.4953C18.786 15 19 15.226 19 15.5047V16.4953C19 16.786 18.774 17 18.4953 17H17.5047C17.214 17 17 16.774 17 16.4953V15.5047C17 15.214 17.226 15 17.5047 15ZM5.50468 18H6.49532C6.78596 18 7 18.226 7 18.5047V19.4953C7 19.786 6.77404 20 6.49532 20H5.50468C5.21404 20 5 19.774 5 19.4953V18.5047C5 18.214 5.22595 18 5.50468 18ZM8.50468 18H9.49532C9.78596 18 10 18.226 10 18.5047V19.4953C10 19.786 9.77404 20 9.49532 20H8.50468C8.21404 20 8 19.774 8 19.4953V18.5047C8 18.214 8.22596 18 8.50468 18ZM11.5047 18H12.4953C12.786 18 13 18.226 13 18.5047V19.4953C13 19.786 12.774 20 12.4953 20H11.5047C11.214 20 11 19.774 11 19.4953V18.5047C11 18.214 11.226 18 11.5047 18ZM14.5047 18H15.4953C15.786 18 16 18.226 16 18.5047V19.4953C16 19.786 15.774 20 15.4953 20H14.5047C14.214 20 14 19.774 14 19.4953V18.5047C14 18.214 14.226 18 14.5047 18ZM17.5047 18H18.4953C18.786 18 19 18.226 19 18.5047V19.4953C19 19.786 18.774 20 18.4953 20H17.5047C17.214 20 17 19.774 17 19.4953V18.5047C17 18.214 17.226 18 17.5047 18ZM17.5047 12H18.4953C18.786 12 19 12.226 19 12.5047V13.4953C19 13.786 18.774 14 18.4953 14H17.5047C17.214 14 17 13.774 17 13.4953V12.5047C17 12.214 17.226 12 17.5047 12ZM17.5047 9H18.4953C18.786 9 19 9.22596 19 9.50468V10.4953C19 10.786 18.774 11 18.4953 11H17.5047C17.214 11 17 10.774 17 10.4953V9.50468C17 9.21404 17.226 9 17.5047 9Z" fill="#808080"/>\n</svg>\n',a='\n<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.27283 6.78069C8.87912 6.34164 8.91587 5.66655 9.35492 5.27283C9.79397 4.87912 10.4691 4.91587 10.8628 5.35492C10.8628 5.35492 16.0022 10.9543 16.366 11.36C16.7298 11.7657 16.7298 12.2392 16.366 12.6448L10.8628 18.6451C10.4691 19.0841 9.79397 19.1209 9.35492 18.7272C8.91587 18.3334 8.87912 17.6584 9.27283 17.2193L14.1368 12L9.27283 6.78069Z" fill="#808080"/>\n</svg>',i='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.7272 17.2193C15.1209 17.6584 15.0841 18.3334 14.6451 18.7272C14.206 19.1209 13.5309 19.0841 13.1372 18.6451C13.1372 18.6451 7.99776 13.0457 7.63399 12.64C7.27023 12.2343 7.27023 11.7608 7.63399 11.3552L13.1372 5.35492C13.5309 4.91587 14.206 4.87912 14.6451 5.27283C15.0841 5.66655 15.1209 6.34164 14.7272 6.78069L9.86322 12L14.7272 17.2193Z" fill="#808080"/>\n</svg>'}}]);
2
2
  //# sourceMappingURL=descope-date-field-descope-calendar-index-js.js.map