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QS,OAAO,EAAAC;;;;GAWlCC,OAnDa,yOAqDeC,IACxBC,GAAqB,IAAAC,GAAgBlB,E,0HC5b3C,MAEMmB,EAAa,EAAGC,cAAapG,UAASc,WAAUmB,eAAe,IAAAsD,GACnE,OACA,CAAC,eAAea,IAAeC,QAAQD,IACvC,CAAC,UAAWC,QAAQrG,IACpB,CAAC,WAAYqG,QAAQvF,IACrB,CAAC,WAAYuF,QAAQpE,KA8BjBqE,EAAkB,CALA,EAAAR,EAAMb,QAAQ,CACpCC,SAAU,QACVC,SAzBoB,IACb,EAAAE,CAAI;UACFC,GAAMA,EAAEiB,UAAY,eAAiB;;;YAGpCJ;;iBAEMb,GAAMA,EAAEiB;mBACNjB,GAAMA,EAAEtF;oBACPsF,GAAMA,EAAEkB;oBACRlB,GAAMA,EAAErD;gBACb,CAACqD,EAAGC,IAAMD,EAAEmB,gBAAgBlB,EAAEC;aACjC,CAACF,EAAGC,IAAMD,EAAE5D,aAAa6D,EAAEC;;;MAGnC,IAAAC,IACAH,GAAMA,EAAEI,OACT,EAAAL,CAAI,wBAAyBC,GAAMA,EAAEI;;cASvCK,OAnCa,wgIAqCUW,IACnBC,GAAgB,IAAAT,GAAgBI,E","sources":["webpack://frontend/./node_modules/@vonage/vivid/shared/definition40.js","webpack://frontend/./node_modules/@vonage/vivid/shared/definition41.js"],"sourcesContent":["import { F as FoundationElement, _ as __decorate, a as attr, o as observable, h as html, r as registerFactory } from './index.js';\nimport { D as Direction, g as getDirection } from './direction.js';\nimport { h as keyArrowRight, i as keyArrowLeft, A as ArrowKeys, e as keyArrowUp, f as keyArrowDown, k as keyEnter } from './key-codes.js';\nimport { O as Orientation } from './aria2.js';\nimport { R as Radio } from './radio.js';\nimport { s as slotted, e as elements } from './slotted.js';\nimport { w as when } from './when.js';\nimport { O as Orientation$1 } from './aria.js';\n\n/**\n * An Radio Group Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radiogroup | ARIA radiogroup }.\n *\n * @slot label - The slot for the label\n * @slot - The default slot for radio buttons\n * @csspart positioning-region - The positioning region for laying out the radios\n * @fires change - Fires a custom 'change' event when the value changes\n *\n * @public\n */\nlet RadioGroup$1 = class RadioGroup extends FoundationElement {\n constructor() {\n super(...arguments);\n /**\n * The orientation of the group\n *\n * @public\n * @remarks\n * HTML Attribute: orientation\n */\n this.orientation = Orientation.horizontal;\n this.radioChangeHandler = (e) => {\n const changedRadio = e.target;\n if (changedRadio.checked) {\n this.slottedRadioButtons.forEach((radio) => {\n if (radio !== changedRadio) {\n radio.checked = false;\n if (!this.isInsideFoundationToolbar) {\n radio.setAttribute(\"tabindex\", \"-1\");\n }\n }\n });\n this.selectedRadio = changedRadio;\n this.value = changedRadio.value;\n changedRadio.setAttribute(\"tabindex\", \"0\");\n this.focusedRadio = changedRadio;\n }\n e.stopPropagation();\n };\n this.moveToRadioByIndex = (group, index) => {\n const radio = group[index];\n if (!this.isInsideToolbar) {\n radio.setAttribute(\"tabindex\", \"0\");\n if (radio.readOnly) {\n this.slottedRadioButtons.forEach((nextRadio) => {\n if (nextRadio !== radio) {\n nextRadio.setAttribute(\"tabindex\", \"-1\");\n }\n });\n }\n else {\n radio.checked = true;\n this.selectedRadio = radio;\n }\n }\n this.focusedRadio = radio;\n radio.focus();\n };\n this.moveRightOffGroup = () => {\n var _a;\n (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus();\n };\n this.moveLeftOffGroup = () => {\n var _a;\n (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus();\n };\n /**\n * @internal\n */\n this.focusOutHandler = (e) => {\n const group = this.slottedRadioButtons;\n const radio = e.target;\n const index = radio !== null ? group.indexOf(radio) : 0;\n const focusedIndex = this.focusedRadio\n ? group.indexOf(this.focusedRadio)\n : -1;\n if ((focusedIndex === 0 && index === focusedIndex) ||\n (focusedIndex === group.length - 1 && focusedIndex === index)) {\n if (!this.selectedRadio) {\n this.focusedRadio = group[0];\n this.focusedRadio.setAttribute(\"tabindex\", \"0\");\n group.forEach((nextRadio) => {\n if (nextRadio !== this.focusedRadio) {\n nextRadio.setAttribute(\"tabindex\", \"-1\");\n }\n });\n }\n else {\n this.focusedRadio = this.selectedRadio;\n if (!this.isInsideFoundationToolbar) {\n this.selectedRadio.setAttribute(\"tabindex\", \"0\");\n group.forEach((nextRadio) => {\n if (nextRadio !== this.selectedRadio) {\n nextRadio.setAttribute(\"tabindex\", \"-1\");\n }\n });\n }\n }\n }\n return true;\n };\n /**\n * @internal\n */\n this.clickHandler = (e) => {\n const radio = e.target;\n if (radio) {\n const group = this.slottedRadioButtons;\n if (radio.checked || group.indexOf(radio) === 0) {\n radio.setAttribute(\"tabindex\", \"0\");\n this.selectedRadio = radio;\n }\n else {\n radio.setAttribute(\"tabindex\", \"-1\");\n this.selectedRadio = null;\n }\n this.focusedRadio = radio;\n }\n e.preventDefault();\n };\n this.shouldMoveOffGroupToTheRight = (index, group, key) => {\n return index === group.length && this.isInsideToolbar && key === keyArrowRight;\n };\n this.shouldMoveOffGroupToTheLeft = (group, key) => {\n const index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0;\n return index < 0 && this.isInsideToolbar && key === keyArrowLeft;\n };\n this.checkFocusedRadio = () => {\n if (this.focusedRadio !== null &&\n !this.focusedRadio.readOnly &&\n !this.focusedRadio.checked) {\n this.focusedRadio.checked = true;\n this.focusedRadio.setAttribute(\"tabindex\", \"0\");\n this.focusedRadio.focus();\n this.selectedRadio = this.focusedRadio;\n }\n };\n this.moveRight = (e) => {\n const group = this.slottedRadioButtons;\n let index = 0;\n index = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1;\n if (this.shouldMoveOffGroupToTheRight(index, group, e.key)) {\n this.moveRightOffGroup();\n return;\n }\n else if (index === group.length) {\n index = 0;\n }\n /* looping to get to next radio that is not disabled */\n /* matching native radio/radiogroup which does not select an item if there is only 1 in the group */\n while (index < group.length && group.length > 1) {\n if (!group[index].disabled) {\n this.moveToRadioByIndex(group, index);\n break;\n }\n else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) {\n break;\n }\n else if (index + 1 >= group.length) {\n if (this.isInsideToolbar) {\n break;\n }\n else {\n index = 0;\n }\n }\n else {\n index += 1;\n }\n }\n };\n this.moveLeft = (e) => {\n const group = this.slottedRadioButtons;\n let index = 0;\n index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0;\n index = index < 0 ? group.length - 1 : index;\n if (this.shouldMoveOffGroupToTheLeft(group, e.key)) {\n this.moveLeftOffGroup();\n return;\n }\n /* looping to get to next radio that is not disabled */\n while (index >= 0 && group.length > 1) {\n if (!group[index].disabled) {\n this.moveToRadioByIndex(group, index);\n break;\n }\n else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) {\n break;\n }\n else if (index - 1 < 0) {\n index = group.length - 1;\n }\n else {\n index -= 1;\n }\n }\n };\n /**\n * keyboard handling per https://w3c.github.io/aria-practices/#for-radio-groups-not-contained-in-a-toolbar\n * navigation is different when there is an ancestor with role='toolbar'\n *\n * @internal\n */\n this.keydownHandler = (e) => {\n const key = e.key;\n if (key in ArrowKeys && this.isInsideFoundationToolbar) {\n return true;\n }\n switch (key) {\n case keyEnter: {\n this.checkFocusedRadio();\n break;\n }\n case keyArrowRight:\n case keyArrowDown: {\n if (this.direction === Direction.ltr) {\n this.moveRight(e);\n }\n else {\n this.moveLeft(e);\n }\n break;\n }\n case keyArrowLeft:\n case keyArrowUp: {\n if (this.direction === Direction.ltr) {\n this.moveLeft(e);\n }\n else {\n this.moveRight(e);\n }\n break;\n }\n default: {\n return true;\n }\n }\n };\n }\n readOnlyChanged() {\n if (this.slottedRadioButtons !== undefined) {\n this.slottedRadioButtons.forEach((radio) => {\n if (this.readOnly) {\n radio.readOnly = true;\n }\n else {\n radio.readOnly = false;\n }\n });\n }\n }\n disabledChanged() {\n if (this.slottedRadioButtons !== undefined) {\n this.slottedRadioButtons.forEach((radio) => {\n if (this.disabled) {\n radio.disabled = true;\n }\n else {\n radio.disabled = false;\n }\n });\n }\n }\n nameChanged() {\n if (this.slottedRadioButtons) {\n this.slottedRadioButtons.forEach((radio) => {\n radio.setAttribute(\"name\", this.name);\n });\n }\n }\n valueChanged() {\n if (this.slottedRadioButtons) {\n this.slottedRadioButtons.forEach((radio) => {\n if (radio.value === this.value) {\n radio.checked = true;\n this.selectedRadio = radio;\n }\n });\n }\n this.$emit(\"change\");\n }\n slottedRadioButtonsChanged(oldValue, newValue) {\n if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) {\n this.setupRadioButtons();\n }\n }\n get parentToolbar() {\n return this.closest('[role=\"toolbar\"]');\n }\n get isInsideToolbar() {\n var _a;\n return ((_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false);\n }\n get isInsideFoundationToolbar() {\n var _a;\n return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a[\"$fastController\"]);\n }\n /**\n * @internal\n */\n connectedCallback() {\n super.connectedCallback();\n this.direction = getDirection(this);\n this.setupRadioButtons();\n }\n disconnectedCallback() {\n this.slottedRadioButtons.forEach((radio) => {\n radio.removeEventListener(\"change\", this.radioChangeHandler);\n });\n }\n setupRadioButtons() {\n const checkedRadios = this.slottedRadioButtons.filter((radio) => {\n return radio.hasAttribute(\"checked\");\n });\n const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0;\n if (numberOfCheckedRadios > 1) {\n const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1];\n lastCheckedRadio.checked = true;\n }\n let foundMatchingVal = false;\n this.slottedRadioButtons.forEach((radio) => {\n if (this.name !== undefined) {\n radio.setAttribute(\"name\", this.name);\n }\n if (this.disabled) {\n radio.disabled = true;\n }\n if (this.readOnly) {\n radio.readOnly = true;\n }\n if (this.value && this.value === radio.value) {\n this.selectedRadio = radio;\n this.focusedRadio = radio;\n radio.checked = true;\n radio.setAttribute(\"tabindex\", \"0\");\n foundMatchingVal = true;\n }\n else {\n if (!this.isInsideFoundationToolbar) {\n radio.setAttribute(\"tabindex\", \"-1\");\n }\n radio.checked = false;\n }\n radio.addEventListener(\"change\", this.radioChangeHandler);\n });\n if (this.value === undefined && this.slottedRadioButtons.length > 0) {\n const checkedRadios = this.slottedRadioButtons.filter((radio) => {\n return radio.hasAttribute(\"checked\");\n });\n const numberOfCheckedRadios = checkedRadios !== null ? checkedRadios.length : 0;\n if (numberOfCheckedRadios > 0 && !foundMatchingVal) {\n const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1];\n lastCheckedRadio.checked = true;\n this.focusedRadio = lastCheckedRadio;\n lastCheckedRadio.setAttribute(\"tabindex\", \"0\");\n }\n else {\n this.slottedRadioButtons[0].setAttribute(\"tabindex\", \"0\");\n this.focusedRadio = this.slottedRadioButtons[0];\n }\n }\n }\n};\n__decorate([\n attr({ attribute: \"readonly\", mode: \"boolean\" })\n], RadioGroup$1.prototype, \"readOnly\", void 0);\n__decorate([\n attr({ attribute: \"disabled\", mode: \"boolean\" })\n], RadioGroup$1.prototype, \"disabled\", void 0);\n__decorate([\n attr\n], RadioGroup$1.prototype, \"name\", void 0);\n__decorate([\n attr\n], RadioGroup$1.prototype, \"value\", void 0);\n__decorate([\n attr\n], RadioGroup$1.prototype, \"orientation\", void 0);\n__decorate([\n observable\n], RadioGroup$1.prototype, \"childItems\", void 0);\n__decorate([\n observable\n], RadioGroup$1.prototype, \"slottedRadioButtons\", void 0);\n\nconst styles = \".positioning-region{display:flex;flex-wrap:wrap;gap:8px}.positioning-region.vertical{flex-direction:column}label+.positioning-region{margin-block-start:8px}label{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}\";\n\nvar __defProp = Object.defineProperty;\nvar __decorateClass = (decorators, target, key, kind) => {\n var result = void 0 ;\n for (var i = decorators.length - 1, decorator; i >= 0; i--)\n if (decorator = decorators[i])\n result = (decorator(target, key, result) ) || result;\n if (result)\n __defProp(target, key, result);\n return result;\n};\nclass RadioGroup extends RadioGroup$1 {\n}\n__decorateClass([\n attr\n], RadioGroup.prototype, \"label\");\n\nconst RadioGroupTemplate = (context) => {\n return html`\n\t\t x.disabled}\"\n\t\t\taria-readonly=\"${(x) => x.readOnly}\"\n\t\t\taria-orientation=\"${(x) => x.orientation}\"\n\t\t\t@click=\"${(x, c) => x.clickHandler(c.event)}\"\n\t\t\t@keydown=\"${(x, c) => x.keydownHandler(c.event)}\"\n\t\t\t@focusout=\"${(x, c) => x.focusOutHandler(c.event)}\"\n\t\t>\n\t\t\t${when(\n (x) => x.label,\n html``\n )}\n\n\t\t\t x.orientation === Orientation$1.horizontal ? \"horizontal\" : \"vertical\"}\"\n\t\t\t>\n\t\t\t\t\n\t\t\t\n\t\t\n\t`;\n};\n\nconst radioGroupDefinition = RadioGroup.compose({\n baseName: \"radio-group\",\n template: RadioGroupTemplate,\n styles\n});\nconst radioGroupRegistries = [radioGroupDefinition()];\nconst registerRadioGroup = registerFactory(radioGroupRegistries);\n\nexport { radioGroupRegistries as a, registerRadioGroup as b, radioGroupDefinition as r };\n","import { h as html, r as registerFactory } from './index.js';\nimport { R as Radio } from './radio.js';\nimport { w as when } from './when.js';\nimport { c as classNames } from './class-names.js';\n\nconst styles = \":host(:focus-visible){outline:none}:host([disabled]){cursor:not-allowed}.base{display:inline-flex;align-items:center;cursor:pointer;gap:8px}.base.connotation-cta{--_connotation-color-primary: var(--vvd-radio-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-radio-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-radio-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-intermediate: var(--vvd-radio-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-firm: var(--vvd-radio-cta-firm, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-radio-cta-fierce, var(--vvd-color-cta-700))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-radio-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-radio-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-radio-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-radio-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-radio-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-radio-accent-fierce, var(--vvd-color-neutral-700))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.base:where(.checked,:checked):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}.base:where(.checked,:checked):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: var(--_connotation-color-primary-increment)}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}@supports (user-select: none){.base{user-select:none}}.base.disabled{pointer-events:none}.control{position:relative;flex-shrink:0;border-radius:50%;block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base:not(.checked) .control{background-color:var(--_appearance-color-fill)}.control:after{position:absolute;border-radius:inherit;background-color:var(--_appearance-color-outline);content:\\\"\\\";inset:5px;opacity:1;transition:opacity .2s}.base:not(.checked) .control:after{opacity:0}:host(:focus-visible) .control{--focus-inset: -3px;--focus-stroke-gap-color: transparent}:host(:focus-visible) .control:before{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));position:absolute;display:block;border-radius:inherit;block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));content:\\\"\\\";inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}label{color:var(--vvd-color-canvas-text);cursor:pointer;font:var(--vvd-typography-base)}.focus-indicator{--focus-inset: -3px;--focus-stroke-gap-color: transparent;border-radius:50%}:host(:not(:focus-visible)) .focus-indicator{display:none}\";\n\nconst getClasses = ({ connotation, checked, readOnly, disabled }) => classNames(\n \"base\",\n [`connotation-${connotation}`, Boolean(connotation)],\n [\"checked\", Boolean(checked)],\n [\"readonly\", Boolean(readOnly)],\n [\"disabled\", Boolean(disabled)]\n);\nconst RadioTemplate = () => {\n return html` x.ariaLabel ? \"presentation\" : null}\"\n\t>\n\t\t x.ariaLabel}\"\n\t\t\taria-checked=\"${(x) => x.checked}\"\n\t\t\taria-required=\"${(x) => x.required}\"\n\t\t\taria-disabled=\"${(x) => x.disabled}\"\n\t\t\t@keypress=\"${(x, c) => x.keypressHandler(c.event)}\"\n\t\t\t@click=\"${(x, c) => x.clickHandler(c.event)}\"\n\t\t>\n\t\t\t
\n\t\t\t${when(\n (x) => x.label,\n html``\n )}\n\t\t\n\t`;\n};\n\nconst radioDefinition = Radio.compose({\n baseName: \"radio\",\n template: RadioTemplate,\n styles\n});\nconst radioRegistries = [radioDefinition()];\nconst registerRadio = registerFactory(radioRegistries);\n\nexport { radioRegistries as a, registerRadio as b, radioDefinition as r };\n"],"names":["RadioGroup$1","F","constructor","super","arguments","this","orientation","O","horizontal","radioChangeHandler","e","changedRadio","target","checked","slottedRadioButtons","forEach","radio","isInsideFoundationToolbar","setAttribute","selectedRadio","value","focusedRadio","stopPropagation","moveToRadioByIndex","group","index","isInsideToolbar","readOnly","nextRadio","focus","moveRightOffGroup","_a","nextElementSibling","moveLeftOffGroup","previousElementSibling","focusOutHandler","indexOf","focusedIndex","length","clickHandler","preventDefault","shouldMoveOffGroupToTheRight","key","shouldMoveOffGroupToTheLeft","checkFocusedRadio","moveRight","disabled","moveLeft","keydownHandler","A","k","direction","D","ltr","readOnlyChanged","undefined","disabledChanged","nameChanged","name","valueChanged","$emit","slottedRadioButtonsChanged","oldValue","newValue","setupRadioButtons","parentToolbar","closest","connectedCallback","g","disconnectedCallback","removeEventListener","checkedRadios","filter","hasAttribute","numberOfCheckedRadios","foundMatchingVal","addEventListener","lastCheckedRadio","_","a","attribute","mode","prototype","o","__defProp","Object","defineProperty","RadioGroup","decorators","decorator","result","i","__decorateClass","radioGroupRegistries","compose","baseName","template","context","h","x","c","event","w","label","s","property","tagFor","R","styles","radioGroupDefinition","registerRadioGroup","r","getClasses","connotation","Boolean","radioRegistries","ariaLabel","required","keypressHandler","radioDefinition","registerRadio"],"sourceRoot":""}