var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; import { ref, onMounted, defineComponent, computed, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, Comment, warn, watch, withKeys, renderSlot, resolveComponent, createElementVNode, createBlock, resolveDynamicComponent, withCtx, withModifiers, createVNode, Fragment, renderList, createTextVNode, Transition, normalizeStyle, inject, toRef, mergeProps, getCurrentInstance, withDirectives, vModelCheckbox, createSlots, nextTick, vModelDynamic, onUnmounted, vShow, unref, shallowRef, getCurrentScope, onScopeDispose, shallowReadonly, Teleport, toRefs, provide, vModelRadio, vModelText } from "vue"; const M = '', S = '', s1 = '', n1 = '', A1 = '', k1 = '', c0 = '', p = '', v0 = '', g2 = '', S2 = '', K2 = '', p5 = '', m3 = M, f3 = S, J3 = s1, j3 = n1, z4 = A1, p4 = k1, E4 = c0, J4 = { langCodeMap: { ar: p }, default: v0 }, Y6 = { ltr: g2, shouldFlip: true }, n7 = { ltr: S2, shouldFlip: true }, L7 = K2, E7 = p5; function U8(c, s, h) { if (typeof c == "string" || "path" in c) return c; if ("shouldFlip" in c) return c.ltr; if ("rtl" in c) return h === "rtl" ? c.rtl : c.ltr; const n = s in c.langCodeMap ? c.langCodeMap[s] : c.default; return typeof n == "string" || "path" in n ? n : n.ltr; } function D8(c, s) { if (typeof c == "string") return false; if ("langCodeMap" in c) { const h = s in c.langCodeMap ? c.langCodeMap[s] : c.default; if (typeof h == "string") return false; c = h; } if ("shouldFlipExceptions" in c && Array.isArray(c.shouldFlipExceptions)) { const h = c.shouldFlipExceptions.indexOf(s); return h === void 0 || h === -1; } return "shouldFlip" in c ? c.shouldFlip : false; } function useComputedDirection(root) { const computedDir = ref(null); onMounted(() => { const dir = window.getComputedStyle(root.value).direction; computedDir.value = dir === "ltr" || dir === "rtl" ? dir : null; }); return computedDir; } function useComputedLanguage(root) { const computedLang = ref(""); onMounted(() => { let ancestor = root.value; while (ancestor && ancestor.lang === "") { ancestor = ancestor.parentElement; } computedLang.value = ancestor ? ancestor.lang : null; }); return computedLang; } function makeStringTypeValidator(allowedValues) { return (s) => typeof s === "string" && allowedValues.indexOf(s) !== -1; } const LibraryPrefix = "cdx"; const ButtonActions = [ "default", "progressive", "destructive" ]; const ButtonWeights = [ "normal", "primary", "quiet" ]; const ButtonSizes = [ "medium", "large" ]; const IconSizes = [ "x-small", "small", "medium" ]; const StatusTypes = [ "notice", "warning", "error", "success" ]; const statusTypeValidator = makeStringTypeValidator(StatusTypes); const TextInputTypes = [ "text", "search", "number", "email", "month", "password", "tel", "url", "week", "date", "datetime-local", "time" ]; const ValidationStatusTypes = [ "default", "warning", "error", "success" ]; const DebounceInterval = 120; const PendingDelay = 500; const MenuFooterValue = "cdx-menu-footer-item"; const TabsKey = Symbol("CdxTabs"); const ActiveTabKey = Symbol("CdxActiveTab"); const FieldInputIdKey = Symbol("CdxFieldInputId"); const FieldDescriptionIdKey = Symbol("CdxFieldDescriptionId"); const FieldStatusKey = Symbol("CdxFieldStatus"); const DisabledKey = Symbol("CdxDisabled"); const NoInvertClass = "".concat(LibraryPrefix, "-no-invert"); const iconSizeValidator = makeStringTypeValidator(IconSizes); const _sfc_main$u = defineComponent({ name: "CdxIcon", props: { /** The SVG path or an object containing that path plus other data. */ icon: { type: [String, Object], required: true }, /** * Accessible label for the icon. If not included, the icon will be hidden from screen * readers via `aria-hidden="true"`. Browsers also display this label as a tooltip when the * user hovers over the icon. Note that this label is not rendered as visible text next * to the icon. */ iconLabel: { type: String, default: "" }, /** * Explicitly set the language code to use for the icon. See * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/lang. * Defaults to the lang attribute of the nearest ancestor at mount time. */ lang: { type: String, default: null }, /** * Explicitly set the direction to use for the icon. See * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dir. * Defaults to the computed direction at mount time. */ dir: { type: String, default: null }, /** * Specify icon size by choosing one of several pre-defined size * options. See the type documentation for supported size options. * The `medium` size is used by default if no size prop is provided. */ size: { type: String, default: "medium", validator: iconSizeValidator } }, setup(props) { const rootElement = ref(); const computedDir = useComputedDirection(rootElement); const computedLang = useComputedLanguage(rootElement); const overriddenDir = computed(() => { var _a; return (_a = props.dir) != null ? _a : computedDir.value; }); const overriddenLang = computed(() => { var _a; return (_a = props.lang) != null ? _a : computedLang.value; }); const rootClasses = computed(() => { return { "cdx-icon--flipped": overriddenDir.value === "rtl" && overriddenLang.value !== null && D8(props.icon, overriddenLang.value), ["cdx-icon--".concat(props.size)]: true }; }); const resolvedIcon = computed( () => { var _a, _b; return U8(props.icon, (_a = overriddenLang.value) != null ? _a : "", (_b = overriddenDir.value) != null ? _b : "ltr"); } ); const iconSvg = computed(() => typeof resolvedIcon.value === "string" ? resolvedIcon.value : ""); const iconPath = computed(() => typeof resolvedIcon.value !== "string" ? resolvedIcon.value.path : ""); return { rootElement, rootClasses, iconSvg, iconPath }; } }); const Icon_vue_vue_type_style_index_0_lang = ""; const _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; const _hoisted_1$s = ["aria-hidden"]; const _hoisted_2$k = { key: 0 }; const _hoisted_3$a = ["innerHTML"]; const _hoisted_4$7 = ["d"]; function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("span", { ref: "rootElement", class: normalizeClass(["cdx-icon", _ctx.rootClasses]) }, [ (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", width: "20", height: "20", viewBox: "0 0 20 20", "aria-hidden": _ctx.iconLabel ? void 0 : true }, [ _ctx.iconLabel ? (openBlock(), createElementBlock("title", _hoisted_2$k, toDisplayString(_ctx.iconLabel), 1)) : createCommentVNode("", true), _ctx.iconSvg ? (openBlock(), createElementBlock("g", { key: 1, innerHTML: _ctx.iconSvg }, null, 8, _hoisted_3$a)) : (openBlock(), createElementBlock("path", { key: 2, d: _ctx.iconPath }, null, 8, _hoisted_4$7)) ], 8, _hoisted_1$s)) ], 2); } const CdxIcon = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$u]]); function flattenSlotContents(slotContents) { const flattened = []; for (const node of slotContents) { if ( // HTML tag typeof node.type === "string" || // Component typeof node.type === "object" ) { flattened.push(node); } else if (node.type !== Comment) { if (typeof node.children === "string" && node.children.trim() !== "") { flattened.push(node.children); } else if (Array.isArray(node.children)) { flattened.push(...flattenSlotContents(node.children)); } } } return flattened; } function isComponentVNode(node, componentName) { if (typeof node.type === "object" && "name" in node.type) { if (componentName !== void 0) { return node.type.name === componentName; } return true; } return false; } function isTagVNode(node, tagName) { if (typeof node.type === "string") { if (tagName !== void 0) { return node.type === tagName.toLowerCase(); } return true; } return false; } function useSlotContents(slot) { const slotContents = typeof slot === "function" ? slot() : slot; return slotContents ? flattenSlotContents(slotContents) : []; } function useWarnOnce(shouldWarn, message) { if (shouldWarn()) { warn(message); return; } const stop = watch(shouldWarn, (newValue) => { if (newValue) { warn(message); stop(); } }); } function useIconOnlyButton(slot, attrs, componentName) { const isIconOnly = computed(() => { const slotContents = useSlotContents(slot); if (slotContents.length !== 1) { return false; } const soleNode = slotContents[0]; if (typeof soleNode === "object" && (isComponentVNode(soleNode, "CdxIcon") || isTagVNode(soleNode, "svg"))) { return true; } return false; }); useWarnOnce( () => isIconOnly.value && !attrs["aria-label"] && !attrs["aria-hidden"], "".concat(componentName, ": Icon-only buttons require one of the following attributes: aria-label or aria-hidden. See documentation at https://doc.wikimedia.org/codex/latest/components/demos/button.html#icon-only-button") ); return isIconOnly; } const buttonActionValidator = makeStringTypeValidator(ButtonActions); const buttonWeightValidator = makeStringTypeValidator(ButtonWeights); const buttonSizeValidator = makeStringTypeValidator(ButtonSizes); const _sfc_main$t = defineComponent({ name: "CdxButton", props: { /** * The kind of action that will be taken on click. * * @values 'default', 'progressive', 'destructive' */ action: { type: String, default: "default", validator: buttonActionValidator }, /** * Visual prominence of the button. * * @values 'normal', 'primary', 'quiet' */ weight: { type: String, default: "normal", validator: buttonWeightValidator }, /** * Button size. * * Most buttons should use the default medium size. In rare cases the large size should * be used, for example to make icon-only buttons larger on touchscreens. * * @values 'medium', 'large' */ size: { type: String, default: "medium", validator: buttonSizeValidator } }, emits: ["click"], setup(props, { emit, slots, attrs }) { const isIconOnly = useIconOnlyButton(slots.default, attrs, "CdxButton"); const isActive = ref(false); const rootClasses = computed(() => ({ ["cdx-button--action-".concat(props.action)]: true, ["cdx-button--weight-".concat(props.weight)]: true, ["cdx-button--size-".concat(props.size)]: true, "cdx-button--framed": props.weight !== "quiet", "cdx-button--icon-only": isIconOnly.value, "cdx-button--is-active": isActive.value })); const onClick = (event) => { emit("click", event); }; const setActive = (active) => { isActive.value = active; }; return { rootClasses, onClick, setActive }; } }); const Button_vue_vue_type_style_index_0_lang = ""; function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("button", { class: normalizeClass(["cdx-button", _ctx.rootClasses]), onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)), onKeydown: _cache[1] || (_cache[1] = withKeys(($event) => _ctx.setActive(true), ["space", "enter"])), onKeyup: _cache[2] || (_cache[2] = withKeys(($event) => _ctx.setActive(false), ["space", "enter"])) }, [ renderSlot(_ctx.$slots, "default") ], 34); } const CdxButton = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$t]]); const _sfc_main$s = defineComponent({ name: "CdxAccordion", components: { CdxButton, CdxIcon }, props: { /** * Forces the accordion to show the action icon. * * @values 'true', 'false' */ actionAlwaysVisible: { type: Boolean, default: false }, /** * The icon that will be displayed on the right side of the accordion header when expanded. * */ actionIcon: { type: [String, Object], default: null }, /** * Label for the action button. If an action icon is being used, then a label for that icon * should be provided for ARIA support. */ actionButtonLabel: { type: String, default: "" }, /** * The heading level of the accordion title. * * @values 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' */ headingLevel: { type: String, default: "h3" } }, emits: [ /** * When the action button is clicked. * */ "action-button-click" ], setup(props, { attrs, emit }) { const isExpanded = ref("open" in attrs); const emitActionButtonClick = () => { emit("action-button-click"); }; const onToggle = (e) => { isExpanded.value = e.newState === "open"; }; const shouldShowActionButton = computed(() => { return props.actionIcon && (isExpanded.value || props.actionAlwaysVisible); }); const rootClasses = computed(() => ({ "cdx-accordion--has-icon": shouldShowActionButton.value })); return { emitActionButtonClick, rootClasses, shouldShowActionButton, onToggle }; } }); const Accordion_vue_vue_type_style_index_0_lang = ""; const _hoisted_1$r = { class: "cdx-accordion__header__title" }; const _hoisted_2$j = { class: "cdx-accordion__header__description" }; function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) { const _component_cdx_icon = resolveComponent("cdx-icon"); const _component_cdx_button = resolveComponent("cdx-button"); return openBlock(), createElementBlock("details", { class: normalizeClass(["cdx-accordion", _ctx.rootClasses]), onToggle: _cache[1] || (_cache[1] = (...args) => _ctx.onToggle && _ctx.onToggle(...args)) }, [ createElementVNode("summary", null, [ (openBlock(), createBlock(resolveDynamicComponent(_ctx.headingLevel), { class: "cdx-accordion__header" }, { default: withCtx(() => [ createElementVNode("span", _hoisted_1$r, [ renderSlot(_ctx.$slots, "title") ]), createElementVNode("span", _hoisted_2$j, [ renderSlot(_ctx.$slots, "description") ]) ]), _: 3 })), _ctx.shouldShowActionButton ? (openBlock(), createBlock(_component_cdx_button, { key: 0, class: "cdx-accordion__action", "aria-label": _ctx.actionButtonLabel, type: "button", weight: "quiet", onClick: withModifiers(_ctx.emitActionButtonClick, ["stop"]) }, { default: withCtx(() => [ createVNode(_component_cdx_icon, { icon: _ctx.actionIcon, "icon-label": _ctx.actionButtonLabel, size: "medium" }, null, 8, ["icon", "icon-label"]) ]), _: 1 }, 8, ["aria-label", "onClick"])) : createCommentVNode("", true) ]), createElementVNode("div", { class: "cdx-accordion__content", onClick: _cache[0] || (_cache[0] = withModifiers(() => { }, ["stop"])) }, [ renderSlot(_ctx.$slots, "default") ]) ], 34); } const Accordion = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$s]]); function getButtonLabel(button) { if (button.label === void 0) { return button.value; } if (button.label === null) { return ""; } return button.label; } const _sfc_main$r = defineComponent({ name: "CdxButtonGroup", components: { CdxButton, CdxIcon }, props: { /** * Objects describing the buttons in the group. See the ButtonGroupItem type. */ buttons: { type: Array, required: true, validator: (value) => Array.isArray(value) && value.length >= 1 }, /** * Whether the entire group is disabled. * * If this is set to true, all buttons in the group are disabled. Buttons can also be * disabled individually by setting their `disabled` property to true. */ disabled: { type: Boolean, default: false } }, emits: [ /** * Emitted when a button is clicked * * @property {string | number} value The `value` property of the button that was clicked */ "click" ], setup() { return { getButtonLabel }; } }); const ButtonGroup_vue_vue_type_style_index_0_lang = ""; const _hoisted_1$q = { class: "cdx-button-group" }; function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) { const _component_cdx_icon = resolveComponent("cdx-icon"); const _component_cdx_button = resolveComponent("cdx-button"); return openBlock(), createElementBlock("div", _hoisted_1$q, [ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.buttons, (button) => { return openBlock(), createBlock(_component_cdx_button, { key: button.value, disabled: button.disabled || _ctx.disabled, "aria-label": button.ariaLabel, onClick: ($event) => _ctx.$emit("click", button.value) }, { default: withCtx(() => [ renderSlot(_ctx.$slots, "default", { button }, () => [ button.icon ? (openBlock(), createBlock(_component_cdx_icon, { key: 0, icon: button.icon }, null, 8, ["icon"])) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(_ctx.getButtonLabel(button)), 1) ]) ]), _: 2 }, 1032, ["disabled", "aria-label", "onClick"]); }), 128)) ]); } const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$r]]); const _sfc_main$q = defineComponent({ name: "CdxThumbnail", components: { CdxIcon }, props: { /** * Thumbnail data. */ thumbnail: { type: [Object, null], default: null }, /** * Thumbnail placeholder icon. */ placeholderIcon: { type: [String, Object], default: E4 } }, setup: (props) => { const thumbnailLoaded = ref(false); const thumbnailStyle = ref({}); const preloadThumbnail = (url) => { const escapedUrl = url.replace(/([\\"\n])/g, "\\$1"); const image = new Image(); image.onload = () => { thumbnailStyle.value = { backgroundImage: 'url("'.concat(escapedUrl, '")') }; thumbnailLoaded.value = true; }; image.onerror = () => { thumbnailLoaded.value = false; }; image.src = escapedUrl; }; onMounted(() => { var _a; if ((_a = props.thumbnail) == null ? void 0 : _a.url) { preloadThumbnail(props.thumbnail.url); } }); return { thumbnailStyle, thumbnailLoaded, NoInvertClass }; } }); const Thumbnail_vue_vue_type_style_index_0_lang = ""; const _hoisted_1$p = { class: "cdx-thumbnail" }; const _hoisted_2$i = { key: 0, class: "cdx-thumbnail__placeholder" }; function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) { const _component_cdx_icon = resolveComponent("cdx-icon"); return openBlock(), createElementBlock("span", _hoisted_1$p, [ !_ctx.thumbnailLoaded ? (openBlock(), createElementBlock("span", _hoisted_2$i, [ createVNode(_component_cdx_icon, { icon: _ctx.placeholderIcon, class: "cdx-thumbnail__placeholder__icon--vue" }, null, 8, ["icon"]) ])) : createCommentVNode("", true), createVNode(Transition, { name: "cdx-thumbnail__image" }, { default: withCtx(() => [ _ctx.thumbnailLoaded ? (openBlock(), createElementBlock("span", { key: 0, style: normalizeStyle(_ctx.thumbnailStyle), class: normalizeClass([_ctx.NoInvertClass, "cdx-thumbnail__image"]) }, null, 6)) : createCommentVNode("", true) ]), _: 1 }) ]); } const CdxThumbnail = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q]]); const _sfc_main$p = defineComponent({ name: "CdxCard", components: { CdxIcon, CdxThumbnail }, props: { /** * If provided, the Card will be a link to this URL. */ url: { type: String, default: "" }, /** * Icon displayed at the start of the Card. */ icon: { type: [String, Object], default: "" }, /** * Thumbnail image data for the Card. */ thumbnail: { type: [Object, null], default: null }, /** * Option to force a thumbnail layout. * * When set to `true`, the Card will display a Thumbnail. If a `thumbnail` prop was also * provided, the thumbnail image will display. Otherwise, a placeholder icon will display. * * This is useful when displaying groups of Cards when some of the cards have thumbnail * images but some do not. `forceThumbnail` will provide a consistent layout for that group. * * Note that this prop is not needed to display a thumbnail image: if the `thumbnail` prop * is provided, it will display. This prop is only needed to enable the display of the * thumbnail placeholder icon when the `thumbnail` prop is not provided. */ forceThumbnail: { type: Boolean, default: false }, /** * Optional custom icon for the placeholder shown when `forceThumbnail` is true but no * thumbnail is provided. * * Defaults to the default placeholder icon set in the Thumbnail component. */ customPlaceholderIcon: { type: [String, Object], default: void 0 } }, setup(props) { const isLink = computed(() => !!props.url); const contentTag = computed(() => isLink.value ? "a" : "span"); const cardLink = computed(() => isLink.value ? props.url : void 0); return { isLink, contentTag, cardLink }; } }); const Card_vue_vue_type_style_index_0_lang = ""; const _hoisted_1$o = { class: "cdx-card__text" }; const _hoisted_2$h = { class: "cdx-card__text__title" }; const _hoisted_3$9 = { key: 0, class: "cdx-card__text__description" }; const _hoisted_4$6 = { key: 1, class: "cdx-card__text__supporting-text" }; function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) { const _component_cdx_thumbnail = resolveComponent("cdx-thumbnail"); const _component_cdx_icon = resolveComponent("cdx-icon"); return openBlock(), createBlock(resolveDynamicComponent(_ctx.contentTag), { href: _ctx.cardLink, class: normalizeClass(["cdx-card", { "cdx-card--is-link": _ctx.isLink, // Include dynamic classes in the template so that $slots is reactive. "cdx-card--title-only": !_ctx.$slots.description && !_ctx.$slots["supporting-text"] }]) }, { default: withCtx(() => [ _ctx.thumbnail || _ctx.forceThumbnail ? (openBlock(), createBlock(_component_cdx_thumbnail, { key: 0, thumbnail: _ctx.thumbnail, "placeholder-icon": _ctx.customPlaceholderIcon, class: "cdx-card__thumbnail" }, null, 8, ["thumbnail", "placeholder-icon"])) : _ctx.icon ? (openBlock(), createBlock(_component_cdx_icon, { key: 1, icon: _ctx.icon, class: "cdx-card__icon" }, null, 8, ["icon"])) : createCommentVNode("", true), createElementVNode("span", _hoisted_1$o, [ createElementVNode("span", _hoisted_2$h, [ renderSlot(_ctx.$slots, "title") ]), _ctx.$slots.description ? (openBlock(), createElementBlock("span", _hoisted_3$9, [ renderSlot(_ctx.$slots, "description") ])) : createCommentVNode("", true), _ctx.$slots["supporting-text"] ? (openBlock(), createElementBlock("span", _hoisted_4$6, [ renderSlot(_ctx.$slots, "supporting-text") ])) : createCommentVNode("", true) ]) ]), _: 3 }, 8, ["href", "class"]); } const Card = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p]]); function useComputedDisabled(disabledProp) { const providedDisabled = inject(DisabledKey, ref(false)); return computed(() => providedDisabled.value || disabledProp.value); } function useFieldData(disabledProp, statusProp, idAttr) { const computedDisabled = useComputedDisabled(disabledProp); const providedStatus = inject(FieldStatusKey, ref("default")); const computedStatus = computed(() => { if ((statusProp == null ? void 0 : statusProp.value) && statusProp.value !== "default") { return statusProp.value; } return providedStatus.value; }); const providedId = inject(FieldInputIdKey, void 0); const computedInputId = computed(() => { var _a; return (_a = providedId == null ? void 0 : providedId.value) != null ? _a : idAttr; }); return { computedDisabled, computedStatus, computedInputId }; } function useSplitAttributes(attrs, internalClasses = computed(() => ({}))) { const rootClasses = computed(() => { const classRecord = __objRest(internalClasses.value, []); if (attrs.class) { const providedClasses = attrs.class.split(" "); providedClasses.forEach((className) => { classRecord[className] = true; }); } return classRecord; }); const rootStyle = computed(() => { if ("style" in attrs) { return attrs.style; } return void 0; }); const otherAttrs = computed(() => { const _a = attrs, { class: _ignoredClass, style: _ignoredStyle } = _a, attrsCopy = __objRest(_a, ["class", "style"]); return attrsCopy; }); return { rootClasses, rootStyle, otherAttrs }; } const _sfc_main$o = defineComponent({ name: "CdxLabel", components: { CdxIcon }, /** * We want the label or legend to inherit attributes, not the root element. */ inheritAttrs: false, props: { /** * Icon before the label text. * * Do not use this if including a start icon within the input component. */ icon: { type: [String, Object], default: null }, /** * Text to indicate that the field is optional. * * For example, this might be '(optional)' in English. This text will be placed next to * the label text. */ optionalFlag: { type: String, default: "" }, /** * Whether the label should be visually hidden. */ visuallyHidden: { type: Boolean, default: false }, /** * Whether this component should output a `` element. * * Always set this to true when this component is used inside a `