"use strict";var Bn=Object.defineProperty,Sn=Object.defineProperties;var In=Object.getOwnPropertyDescriptors;var Fe=Object.getOwnPropertySymbols;var yt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable;var lt=(e,n,o)=>n in e?Bn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,P=(e,n)=>{for(var o in n||(n={}))yt.call(n,o)&<(e,o,n[o]);if(Fe)for(var o of Fe(n))Ct.call(n,o)&<(e,o,n[o]);return e},Z=(e,n)=>Sn(e,In(n));var re=(e,n)=>{var o={};for(var l in e)yt.call(e,l)&&n.indexOf(l)<0&&(o[l]=e[l]);if(e!=null&&Fe)for(var l of Fe(e))n.indexOf(l)<0&&Ct.call(e,l)&&(o[l]=e[l]);return o};var ce=(e,n,o)=>(lt(e,typeof n!="symbol"?n+"":n,o),o);var ee=(e,n,o)=>new Promise((l,r)=>{var d=a=>{try{i(o.next(a))}catch(u){r(u)}},s=a=>{try{i(o.throw(a))}catch(u){r(u)}},i=a=>a.done?l(a.value):Promise.resolve(a.value).then(d,s);i((o=o.apply(e,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),xn='',Vn='',En='',Nn='',An='',Mn='',Dn='',Ln='',Tn='',Rn='',Fn='',_n='',On='',zn='',Kn='',Pn='',Hn='',Un='',jn='',At=xn,qn=Vn,Wn=En,Qn=Nn,dt=An,Gn=Mn,Mt=Dn,Dt=Ln,Yn=Tn,Lt={langCodeMap:{ar:Rn},default:Fn},Xn={ltr:_n,shouldFlip:!0},Jn={ltr:On,shouldFlip:!0},Tt={ltr:zn,shouldFlip:!0},Rt={ltr:Kn,shouldFlip:!0},Zn=Pn,eo=Hn,Ft=Un,to=jn;function no(e,n,o){if(typeof e=="string"||"path"in e)return e;if("shouldFlip"in e)return e.ltr;if("rtl"in e)return o==="rtl"?e.rtl:e.ltr;const l=n in e.langCodeMap?e.langCodeMap[n]:e.default;return typeof l=="string"||"path"in l?l:l.ltr}function oo(e,n){if(typeof e=="string")return!1;if("langCodeMap"in e){const o=n in e.langCodeMap?e.langCodeMap[n]:e.default;if(typeof o=="string")return!1;e=o}if("shouldFlipExceptions"in e&&Array.isArray(e.shouldFlipExceptions)){const o=e.shouldFlipExceptions.indexOf(n);return o===void 0||o===-1}return"shouldFlip"in e?e.shouldFlip:!1}function Ae(e){const n=t.ref(null);return t.onMounted(()=>{const o=window.getComputedStyle(e.value).direction;n.value=o==="ltr"||o==="rtl"?o:null}),n}function _t(e){const n=t.ref("");return t.onMounted(()=>{let o=e.value;for(;o&&o.lang==="";)o=o.parentElement;n.value=o?o.lang:null}),n}function J(e){return n=>typeof n=="string"&&e.indexOf(n)!==-1}const ze="cdx",lo=["default","progressive","destructive"],ao=["normal","primary","quiet"],so=["medium","large"],io=["x-small","small","medium"],ro=["notice","warning","error","success"],Ot=J(ro),uo=["text","search","number","email","month","password","tel","url","week","date","datetime-local","time"],ue=["default","warning","error","success"],co=["start","center","end","number"],po=120,fo=500,$e="cdx-menu-footer-item",zt=Symbol("CdxTabs"),Kt=Symbol("CdxActiveTab"),Pt=Symbol("CdxAllowArbitrary"),Ht=Symbol("CdxFieldInputId"),qe=Symbol("CdxFieldDescriptionId"),Ut=Symbol("CdxFieldStatus"),jt=Symbol("CdxDisabled"),mo="".concat(ze,"-no-invert"),Ke=Symbol("CdxTableRowIdentifier"),ho=["top","bottom","both"],vo=J(io),go=t.defineComponent({name:"CdxIcon",props:{icon:{type:[String,Object],required:!0},iconLabel:{type:String,default:""},lang:{type:String,default:null},dir:{type:String,default:null},size:{type:String,default:"medium",validator:vo}},setup(e){const n=t.ref(),o=Ae(n),l=_t(n),r=t.computed(()=>{var c;return(c=e.dir)!=null?c:o.value}),d=t.computed(()=>{var c;return(c=e.lang)!=null?c:l.value}),s=t.computed(()=>({"cdx-icon--flipped":r.value==="rtl"&&d.value!==null&&oo(e.icon,d.value),["cdx-icon--".concat(e.size)]:!0})),i=t.computed(()=>{var c,p;return no(e.icon,(c=d.value)!=null?c:"",(p=r.value)!=null?p:"ltr")}),a=t.computed(()=>typeof i.value=="string"?i.value:""),u=t.computed(()=>typeof i.value!="string"?i.value.path:"");return{rootElement:n,rootClasses:s,iconSvg:a,iconPath:u}}}),O=(e,n)=>{const o=e.__vccOpts||e;for(const[l,r]of n)o[l]=r;return o},bo=["aria-hidden"],yo={key:0},Co=["innerHTML"],wo=["d"];function ko(e,n,o,l,r,d){return t.openBlock(),t.createElementBlock("span",{ref:"rootElement",class:t.normalizeClass(["cdx-icon",e.rootClasses])},[(t.openBlock(),t.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":e.iconLabel?void 0:!0},[e.iconLabel?(t.openBlock(),t.createElementBlock("title",yo,t.toDisplayString(e.iconLabel),1)):t.createCommentVNode("v-if",!0),e.iconSvg?(t.openBlock(),t.createElementBlock("g",{key:1,innerHTML:e.iconSvg},null,8,Co)):(t.openBlock(),t.createElementBlock("path",{key:2,d:e.iconPath},null,8,wo))],8,bo))],2)}const G=O(go,[["render",ko]]);function qt(e){const n=[];for(const o of e)typeof o.type=="string"||typeof o.type=="object"?n.push(o):o.type!==t.Comment&&(typeof o.children=="string"&&o.children.trim()!==""?n.push(o.children):Array.isArray(o.children)&&n.push(...qt(o.children)));return n}function Wt(e,n){return typeof e.type=="object"&&"name"in e.type?n!==void 0?e.type.name===n:!0:!1}function $o(e,n){return typeof e.type=="string"?e.type===n.toLowerCase():!1}function We(e){const n=typeof e=="function"?e():e;return n?qt(n):[]}function Qe(e,n){if(e()){t.warn(n);return}const o=t.watch(e,l=>{l&&(t.warn(n),o())})}function Qt(e,n,o){const l=t.computed(()=>{const r=We(e);if(r.length!==1)return!1;const d=r[0];return!!(typeof d=="object"&&(Wt(d,"CdxIcon")||$o(d,"svg")))});return Qe(()=>l.value&&!n["aria-label"]&&!n["aria-hidden"],"".concat(o,": 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")),l}const Bo=J(lo),So=J(ao),Io=J(so),xo=t.defineComponent({name:"CdxButton",props:{action:{type:String,default:"default",validator:Bo},weight:{type:String,default:"normal",validator:So},size:{type:String,default:"medium",validator:Io}},emits:["click"],setup(e,{emit:n,slots:o,attrs:l}){const r=t.ref(),d=Qt(o.default,l,"CdxButton"),s=t.ref(!1),i=t.computed(()=>({["cdx-button--action-".concat(e.action)]:!0,["cdx-button--weight-".concat(e.weight)]:!0,["cdx-button--size-".concat(e.size)]:!0,"cdx-button--framed":e.weight!=="quiet","cdx-button--icon-only":d.value,"cdx-button--is-active":s.value})),a=f=>{n("click",f)},u=f=>{s.value=f};function c(){u(!0)}function p(){var f;u(!1),(f=r.value)==null||f.click()}return{button:r,rootClasses:i,onClick:a,onKeyDown:c,onKeyUp:p}}});function Vo(e,n,o,l,r,d){return t.openBlock(),t.createElementBlock("button",{ref:"button",class:t.normalizeClass(["cdx-button",e.rootClasses]),onKeydown:n[0]||(n[0]=t.withKeys(t.withModifiers((...s)=>e.onKeyDown&&e.onKeyDown(...s),["prevent"]),["space","enter"])),onKeyup:n[1]||(n[1]=t.withKeys((...s)=>e.onKeyUp&&e.onKeyUp(...s),["space","enter"])),onClick:n[2]||(n[2]=(...s)=>e.onClick&&e.onClick(...s))},[t.renderSlot(e.$slots,"default")],34)}const fe=O(xo,[["render",Vo]]),Eo=t.defineComponent({name:"CdxAccordion",components:{CdxButton:fe,CdxIcon:G},props:{actionAlwaysVisible:{type:Boolean,default:!1},actionIcon:{type:[String,Object],default:null},actionButtonLabel:{type:String,default:""},headingLevel:{type:String,default:"h3"}},emits:["action-button-click"],setup(e,{attrs:n,emit:o}){const l=t.ref("open"in n),r=()=>{o("action-button-click")},d=a=>{l.value=a.newState==="open"},s=t.computed(()=>e.actionIcon&&(l.value||e.actionAlwaysVisible)),i=t.computed(()=>({"cdx-accordion--has-icon":s.value}));return{emitActionButtonClick:r,rootClasses:i,shouldShowActionButton:s,onToggle:d}}}),No={class:"cdx-accordion__header__title"},Ao={class:"cdx-accordion__header__description"};function Mo(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("details",{class:t.normalizeClass(["cdx-accordion",e.rootClasses]),onToggle:n[1]||(n[1]=(...a)=>e.onToggle&&e.onToggle(...a))},[t.createElementVNode("summary",null,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.headingLevel),{class:"cdx-accordion__header"},{default:t.withCtx(()=>[t.createElementVNode("span",No,[t.renderSlot(e.$slots,"title")]),t.createElementVNode("span",Ao,[t.renderSlot(e.$slots,"description")])]),_:3})),e.shouldShowActionButton?(t.openBlock(),t.createBlock(i,{key:0,class:"cdx-accordion__action","aria-label":e.actionButtonLabel,type:"button",weight:"quiet",onClick:t.withModifiers(e.emitActionButtonClick,["stop"])},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.actionIcon,"icon-label":e.actionButtonLabel,size:"medium"},null,8,["icon","icon-label"])]),_:1},8,["aria-label","onClick"])):t.createCommentVNode("v-if",!0)]),t.createElementVNode("div",{class:"cdx-accordion__content",onClick:n[0]||(n[0]=t.withModifiers(()=>{},["stop"]))},[t.renderSlot(e.$slots,"default")])],34)}const Do=O(Eo,[["render",Mo]]);function Gt(e){return e.label===void 0?e.value:e.label===null?"":e.label}function Yt(e){const n=t.ref(),o=t.ref(),l=t.ref(new Map),r=Ae(n);function d(h,v){const C=h;C&&l.value.set(v,C)}function s(h){o.value=h}function i(){o.value=void 0}function a(h,v){var B;const C=h+v,k=e.value[C];if(k)if(k.disabled)a(C,v);else{const w=(B=l.value.get(C))==null?void 0:B.$el;w==null||w.focus()}}function u(){var h;a((h=o.value)!=null?h:-1,1)}function c(){var h;a((h=o.value)!=null?h:e.value.length,-1)}function p(){r.value==="rtl"?c():u()}function f(){r.value==="rtl"?u():c()}function m(h){switch(h.key){case"ArrowRight":h.preventDefault(),p();break;case"ArrowLeft":h.preventDefault(),f();break;case"ArrowDown":h.preventDefault(),u();break;case"ArrowUp":h.preventDefault(),c();break}}return{rootElement:n,assignTemplateRef:d,onFocus:s,onBlur:i,onKeydown:m}}const Lo=t.defineComponent({name:"CdxButtonGroup",components:{CdxButton:fe,CdxIcon:G},props:{buttons:{type:Array,required:!0,validator:e=>Array.isArray(e)&&e.length>=1},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e){const{rootElement:n,assignTemplateRef:o,onFocus:l,onBlur:r,onKeydown:d}=Yt(t.toRef(e,"buttons"));return{rootElement:n,assignTemplateRef:o,onFocus:l,onBlur:r,onKeydown:d,getButtonLabel:Gt}}}),To={ref:"rootElement",class:"cdx-button-group"};function Ro(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",To,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.buttons,(a,u)=>(t.openBlock(),t.createBlock(i,{key:a.value,ref_for:!0,ref:c=>e.assignTemplateRef(c,u),disabled:a.disabled||e.disabled,"aria-label":a.ariaLabel,onClick:c=>e.$emit("click",a.value),onFocus:c=>e.onFocus(u),onBlur:e.onBlur,onKeydown:e.onKeydown},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{button:a},()=>[a.icon?(t.openBlock(),t.createBlock(s,{key:0,icon:a.icon},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createTextVNode(" "+t.toDisplayString(e.getButtonLabel(a)),1)])]),_:2},1032,["disabled","aria-label","onClick","onFocus","onBlur","onKeydown"]))),128))],512)}const Fo=O(Lo,[["render",Ro]]),_o=t.defineComponent({name:"CdxThumbnail",components:{CdxIcon:G},props:{thumbnail:{type:[Object,null],default:null},placeholderIcon:{type:[String,Object],default:Yn}},setup:e=>{const n=t.ref(!1),o=t.ref({}),l=r=>{const d=r.replace(/([\\"\n])/g,"\\$1"),s=new Image;s.onload=()=>{o.value={backgroundImage:'url("'.concat(d,'")')},n.value=!0},s.onerror=()=>{n.value=!1},s.src=d};return t.onMounted(()=>{var r;(r=e.thumbnail)!=null&&r.url&&l(e.thumbnail.url)}),{thumbnailStyle:o,thumbnailLoaded:n,NoInvertClass:mo}}}),Oo={class:"cdx-thumbnail"},zo={key:0,class:"cdx-thumbnail__placeholder"};function Ko(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("span",Oo,[e.thumbnailLoaded?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("span",zo,[t.createVNode(s,{icon:e.placeholderIcon,class:"cdx-thumbnail__placeholder__icon--vue"},null,8,["icon"])])),t.createVNode(t.Transition,{name:"cdx-thumbnail__image"},{default:t.withCtx(()=>[e.thumbnailLoaded?(t.openBlock(),t.createElementBlock("span",{key:0,style:t.normalizeStyle(e.thumbnailStyle),class:t.normalizeClass([e.NoInvertClass,"cdx-thumbnail__image"])},null,6)):t.createCommentVNode("v-if",!0)]),_:1})])}const ut=O(_o,[["render",Ko]]),Po=t.defineComponent({name:"CdxCard",components:{CdxIcon:G,CdxThumbnail:ut},props:{url:{type:String,default:""},icon:{type:[String,Object],default:""},thumbnail:{type:[Object,null],default:null},forceThumbnail:{type:Boolean,default:!1},customPlaceholderIcon:{type:[String,Object],default:void 0}},setup(e){const n=t.computed(()=>!!e.url),o=t.computed(()=>n.value?"a":"span"),l=t.computed(()=>n.value?e.url:void 0);return{isLink:n,contentTag:o,cardLink:l}}}),Ho={class:"cdx-card__text"},Uo={class:"cdx-card__text__title"},jo={key:0,class:"cdx-card__text__description"},qo={key:1,class:"cdx-card__text__supporting-text"};function Wo(e,n,o,l,r,d){const s=t.resolveComponent("cdx-thumbnail"),i=t.resolveComponent("cdx-icon");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.contentTag),{href:e.cardLink,class:t.normalizeClass(["cdx-card",{"cdx-card--is-link":e.isLink,"cdx-card--title-only":!e.$slots.description&&!e.$slots["supporting-text"]}])},{default:t.withCtx(()=>[e.thumbnail||e.forceThumbnail?(t.openBlock(),t.createBlock(s,{key:0,thumbnail:e.thumbnail,"placeholder-icon":e.customPlaceholderIcon,class:"cdx-card__thumbnail"},null,8,["thumbnail","placeholder-icon"])):e.icon?(t.openBlock(),t.createBlock(i,{key:1,icon:e.icon,class:"cdx-card__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",Ho,[t.createElementVNode("span",Uo,[t.renderSlot(e.$slots,"title")]),e.$slots.description?(t.openBlock(),t.createElementBlock("span",jo,[t.renderSlot(e.$slots,"description")])):t.createCommentVNode("v-if",!0),e.$slots["supporting-text"]?(t.openBlock(),t.createElementBlock("span",qo,[t.renderSlot(e.$slots,"supporting-text")])):t.createCommentVNode("v-if",!0)])]),_:3},8,["href","class"])}const Qo=O(Po,[["render",Wo]]);function ct(e){const n=t.inject(jt,t.ref(!1));return t.computed(()=>n.value||e.value)}function oe(e,n,o){const l=ct(e),r=t.inject(Ut,t.ref("default")),d=t.computed(()=>n!=null&&n.value&&n.value!=="default"?n.value:r.value),s=t.inject(Ht,void 0),i=t.computed(()=>{var a;return(a=s==null?void 0:s.value)!=null?a:o});return{computedDisabled:l,computedStatus:d,computedInputId:i}}function le(e,n=t.computed(()=>({}))){const o=t.computed(()=>{const d=re(n.value,[]);return e.class&&e.class.split(" ").forEach(i=>{d[i]=!0}),d}),l=t.computed(()=>{if("style"in e)return e.style}),r=t.computed(()=>{const a=e,{class:d,style:s}=a;return re(a,["class","style"])});return{rootClasses:o,rootStyle:l,otherAttrs:r}}function Q(e,n,o=[]){const l=t.inject("CdxI18nFunction",void 0);return t.computed(()=>{const r=o.map(s=>typeof s=="function"?s():s.value),d=l==null?void 0:l(e,...r);return d!=null?d:typeof n=="function"?n(...r):n})}function Ge(e,n,o,l=[]){const r=Q(n,o,l);return t.computed(()=>e.value||r.value)}const Go=t.defineComponent({name:"CdxLabel",components:{CdxIcon:G},inheritAttrs:!1,props:{icon:{type:[String,Object],default:null},optional:{type:Boolean,default:!1},optionalFlag:{type:String,default:""},visuallyHidden:{type:Boolean,default:!1},isLegend:{type:Boolean,default:!1},inputId:{type:String,default:""},descriptionId:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(e,{attrs:n}){const{computedDisabled:o}=oe(t.toRef(e,"disabled")),l=t.computed(()=>({"cdx-label--visually-hidden":e.visuallyHidden,"cdx-label--disabled":o.value})),{rootClasses:r,rootStyle:d,otherAttrs:s}=le(n,l),i=Ge(t.toRef(e,"optionalFlag"),"cdx-label-optional-flag","(optional)");return{rootClasses:r,rootStyle:d,otherAttrs:s,translatedOptionalFlag:i}}}),Yo=["for"],Xo={class:"cdx-label__label__text"},Jo={key:1,class:"cdx-label__label__optional-flag"},Zo=["id"],el={class:"cdx-label__label"},tl={class:"cdx-label__label__text"},nl={key:1,class:"cdx-label__label__optional-flag"},ol={key:0,class:"cdx-label__description"};function ll(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon");return e.isLegend?(t.openBlock(),t.createElementBlock("legend",t.mergeProps({key:1,class:["cdx-label",e.rootClasses],style:e.rootStyle},e.otherAttrs),[t.createElementVNode("span",el,[e.icon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.icon,class:"cdx-label__label__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",tl,[t.renderSlot(e.$slots,"default")]),e.optionalFlag||e.optional?(t.openBlock(),t.createElementBlock("span",nl,t.toDisplayString(" ")+" "+t.toDisplayString(e.translatedOptionalFlag),1)):t.createCommentVNode("v-if",!0)]),e.$slots.description&&e.$slots.description().length>0?(t.openBlock(),t.createElementBlock("span",ol,[t.renderSlot(e.$slots,"description")])):t.createCommentVNode("v-if",!0)],16)):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["cdx-label",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("label",t.mergeProps({class:"cdx-label__label",for:e.inputId?e.inputId:void 0},e.otherAttrs),[e.icon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.icon,class:"cdx-label__label__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",Xo,[t.renderSlot(e.$slots,"default")]),e.optionalFlag||e.optional?(t.openBlock(),t.createElementBlock("span",Jo,t.toDisplayString(" ")+" "+t.toDisplayString(e.translatedOptionalFlag),1)):t.createCommentVNode("v-if",!0)],16,Yo),e.$slots.description&&e.$slots.description().length>0?(t.openBlock(),t.createElementBlock("span",{key:0,id:e.descriptionId||void 0,class:"cdx-label__description"},[t.renderSlot(e.$slots,"description")],8,Zo)):t.createCommentVNode("v-if",!0)],6))}const Me=O(Go,[["render",ll]]);function pt(e,n,o){Qe(()=>We(e).length===0&&!(n!=null&&n["aria-label"])&&!(n!=null&&n["aria-labelledby"]),"".concat(o,": Inputs must have an associated label. Provide one of the following:\n - A label via the appropriate slot\n - An `aria-label` attribute set to the label text\n - An `aria-labelledby` attribute set to the ID of the label element"))}function te(e,n,o){return t.computed({get:()=>e.value,set:l=>n(o||"update:modelValue",l)})}let at=0;function q(e){var l;const n=t.getCurrentInstance(),o=(l=n==null?void 0:n.props.id)!=null?l:n==null?void 0:n.attrs.id;return e?"".concat(ze,"-").concat(e,"-").concat(at++):o?"".concat(ze,"-").concat(o,"-").concat(at++):"".concat(ze,"-").concat(at++)}const al=J(ue),sl=t.defineComponent({name:"CdxCheckbox",components:{CdxLabel:Me},props:{modelValue:{type:[Boolean,Array],default:!1},inputValue:{type:[String,Number,Boolean],default:!1},name:{type:String,default:null},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},status:{type:String,default:"default",validator:al}},emits:["update:modelValue"],setup(e,{emit:n,slots:o,attrs:l}){var f;pt((f=o.default)==null?void 0:f.call(o),l,"CdxCheckbox");const{computedDisabled:r,computedStatus:d}=oe(t.toRef(e,"disabled"),t.toRef(e,"status")),s=t.computed(()=>({"cdx-checkbox--inline":e.inline,["cdx-checkbox--status-".concat(d.value)]:!0})),i=t.computed(()=>({"cdx-checkbox__custom-input--inline":e.inline})),a=t.ref(),u=q("checkbox"),c=q("description"),p=te(t.toRef(e,"modelValue"),n);return{rootClasses:s,computedDisabled:r,input:a,checkboxId:u,descriptionId:c,wrappedModel:p,customInputClasses:i}}}),il={class:"cdx-checkbox__wrapper"},rl=["id","aria-describedby","value","name","disabled",".indeterminate"],dl=t.createElementVNode("span",{class:"cdx-checkbox__icon"},null,-1);function ul(e,n,o,l,r,d){const s=t.resolveComponent("cdx-label");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-checkbox",e.rootClasses])},[t.createElementVNode("div",il,[t.withDirectives(t.createElementVNode("input",{id:e.checkboxId,ref:"input","onUpdate:modelValue":n[0]||(n[0]=i=>e.wrappedModel=i),class:"cdx-checkbox__input",type:"checkbox","aria-describedby":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,value:e.inputValue,name:e.name,disabled:e.computedDisabled,".indeterminate":e.indeterminate},null,40,rl),[[t.vModelCheckbox,e.wrappedModel]]),dl,e.$slots.default&&e.$slots.default().length?(t.openBlock(),t.createBlock(s,{key:0,class:"cdx-checkbox__label","input-id":e.checkboxId,"description-id":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,disabled:e.computedDisabled,"visually-hidden":e.hideLabel},t.createSlots({default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:2},[e.$slots.description&&e.$slots.description().length>0?{name:"description",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"description")]),key:"0"}:void 0]),1032,["input-id","description-id","disabled","visually-hidden"])):t.createCommentVNode("v-if",!0)]),e.$slots["custom-input"]?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["cdx-checkbox__custom-input",e.customInputClasses])},[t.renderSlot(e.$slots,"custom-input")],2)):t.createCommentVNode("v-if",!0)],2)}const Xt=O(sl,[["render",ul]]),cl=t.defineComponent({name:"CdxInputChip",components:{CdxButton:fe,CdxIcon:G},props:{icon:{type:[String,Object],default:null},disabled:{type:Boolean,default:!1}},expose:["focus"],emits:["remove-chip","click-chip","arrow-left","arrow-right"],setup(e,{emit:n}){const o=t.ref(),l=t.computed(()=>({"cdx-input-chip--disabled":e.disabled})),r=Q("cdx-input-chip-aria-description","Press Enter to edit or Delete to remove");function d(s){var i;switch(s.key){case"Enter":n("click-chip"),s.preventDefault(),s.stopPropagation();break;case"Escape":(i=o.value)==null||i.blur(),s.preventDefault(),s.stopPropagation();break;case"Backspace":case"Delete":n("remove-chip",s.key),s.preventDefault(),s.stopPropagation();break;case"ArrowLeft":n("arrow-left"),s.preventDefault(),s.stopPropagation();break;case"ArrowRight":n("arrow-right"),s.preventDefault(),s.stopPropagation();break}}return{rootElement:o,rootClasses:l,ariaDescription:r,onKeydown:d,cdxIconClose:dt}},methods:{focus(){this.$refs.rootElement.focus()}}}),pl=["aria-description"],fl={class:"cdx-input-chip__text"};function ml(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-input-chip",e.rootClasses]),tabindex:"0",role:"option","aria-description":e.ariaDescription,onKeydown:n[1]||(n[1]=(...a)=>e.onKeydown&&e.onKeydown(...a)),onClick:n[2]||(n[2]=a=>e.$emit("click-chip"))},[e.icon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.icon,size:"small"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",fl,[t.renderSlot(e.$slots,"default")]),t.createVNode(i,{class:"cdx-input-chip__button",weight:"quiet",tabindex:"-1","aria-hidden":"true",disabled:e.disabled,onClick:n[0]||(n[0]=t.withModifiers(a=>e.$emit("remove-chip","button"),["stop"]))},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.cdxIconClose,size:"x-small"},null,8,["icon"])]),_:1},8,["disabled"])],42,pl)}const hl=O(cl,[["render",ml]]);function Ye(e,n,o,l){return t.computed({get:()=>{var r;return(r=n.value)!=null?r:e.value},set:r=>{n.value!==null?o(l||"update:modelValue",r):e.value=r}})}const vl=J(ue),gl=t.defineComponent({name:"CdxChipInput",components:{CdxInputChip:hl},inheritAttrs:!1,props:{inputChips:{type:Array,required:!0},inputValue:{type:[String,Number],default:null},separateInput:{type:Boolean,default:!1},status:{type:String,default:"default",validator:vl},chipValidator:{type:Function,default:e=>!0},disabled:{type:Boolean,default:!1}},emits:["update:input-chips","update:input-value"],setup(e,{emit:n,attrs:o}){const l=t.ref(),r=t.ref(),d=t.ref(),s=t.ref(""),i=Ae(l),a=t.ref(),u=t.inject(Pt,t.ref(!0)),c=t.ref(""),p=Ye(c,t.toRef(e,"inputValue"),n,"update:input-value"),f=t.ref("default"),m=t.computed(()=>f.value==="error"||e.status==="error"?"error":"default"),{computedDisabled:h,computedStatus:v}=oe(t.toRef(e,"disabled"),m),C=t.ref(!1),k=t.computed(()=>({"cdx-chip-input--has-separate-input":e.separateInput,["cdx-chip-input--status-".concat(v.value)]:!0,"cdx-chip-input--focused":C.value,"cdx-chip-input--disabled":h.value})),{rootClasses:B,rootStyle:w,otherAttrs:I}=le(o,k),x=[],D=t.ref(null),A=t.computed(()=>D.value?D.value.value:""),M=Q("cdx-chip-input-chip-added",$=>"Chip ".concat($," was added."),[p]),b=Q("cdx-chip-input-chip-removed",$=>"Chip ".concat($," was removed."),[A]);function y($,L){$!==null&&(x[L]=$)}const S=()=>{a.value.focus()};function E(){e.inputChips.find($=>$.value===p.value)||!e.chipValidator(p.value)?f.value="error":p.value.toString().length>0&&(s.value=M.value,n("update:input-chips",e.inputChips.concat({value:p.value})),p.value="")}function R($){n("update:input-chips",e.inputChips.filter(L=>L.value!==$.value))}function K($,L){const H=i.value==="ltr"&&$==="left"||i.value==="rtl"&&$==="right"?-1:1,Y=L+H;if(!(Y<0)){if(Y>=e.inputChips.length){S();return}x[Y].focus()}}function T($){return ee(this,null,function*(){var L;E(),yield t.nextTick(),R($),p.value=(L=$.label)!=null?L:$.value,S()})}function _($,L,H){if(D.value=$,s.value=b.value,H==="button")S();else if(H==="Backspace"){const Y=L===0?1:L-1;Y0&&u.value){E(),$.preventDefault(),$.stopPropagation();return}break;case"Escape":(H=a.value)==null||H.blur(),$.preventDefault(),$.stopPropagation();return;case"Backspace":case L:if(((Y=a.value)==null?void 0:Y.selectionStart)===0&&a.value.selectionEnd===0&&e.inputChips.length>0){x[e.inputChips.length-1].focus(),$.preventDefault(),$.stopPropagation();return}break}}function W(){C.value=!0}function ne(){C.value=!1}function me($){var L;!((L=l.value)!=null&&L.contains($.relatedTarget))&&u.value&&E()}return t.watch(t.toRef(e,"inputChips"),$=>{const L=$.find(H=>H.value===p.value);f.value=L?"error":"default"}),t.watch(p,()=>{f.value==="error"&&(f.value="default")}),{rootElement:l,chipsContainer:r,separateInputWrapper:d,input:a,computedInputValue:p,rootClasses:B,rootStyle:w,otherAttrs:I,assignChipTemplateRef:y,handleChipClick:T,handleChipRemove:_,moveChipFocus:K,onInputKeydown:j,focusInput:S,onInputFocus:W,onInputBlur:ne,onFocusOut:me,computedDisabled:h,statusMessageContent:s}}}),bl={ref:"chipsContainer",class:"cdx-chip-input__chips",role:"listbox","aria-orientation":"horizontal"},yl=["disabled"],Cl={key:0,ref:"separateInputWrapper",class:"cdx-chip-input__separate-input"},wl=["disabled"],kl={class:"cdx-chip-input__aria-status",role:"status","aria-live":"polite"};function $l(e,n,o,l,r,d){const s=t.resolveComponent("cdx-input-chip");return t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-chip-input",e.rootClasses]),style:t.normalizeStyle(e.rootStyle),onClick:n[8]||(n[8]=(...i)=>e.focusInput&&e.focusInput(...i)),onFocusout:n[9]||(n[9]=(...i)=>e.onFocusOut&&e.onFocusOut(...i))},[t.createElementVNode("div",bl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.inputChips,(i,a)=>(t.openBlock(),t.createBlock(s,{key:i.value,ref_for:!0,ref:u=>e.assignChipTemplateRef(u,a),class:"cdx-chip-input__item",icon:i.icon,disabled:e.computedDisabled,onClickChip:u=>e.handleChipClick(i),onRemoveChip:u=>e.handleChipRemove(i,a,u),onArrowLeft:u=>e.moveChipFocus("left",a),onArrowRight:u=>e.moveChipFocus("right",a)},{default:t.withCtx(()=>{var u;return[t.createTextVNode(t.toDisplayString((u=i.label)!=null?u:i.value),1)]}),_:2},1032,["icon","disabled","onClickChip","onRemoveChip","onArrowLeft","onArrowRight"]))),128)),e.separateInput?t.createCommentVNode("v-if",!0):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:0,ref:"input","onUpdate:modelValue":n[0]||(n[0]=i=>e.computedInputValue=i),class:"cdx-chip-input__input",disabled:e.computedDisabled},e.otherAttrs,{onBlur:n[1]||(n[1]=(...i)=>e.onInputBlur&&e.onInputBlur(...i)),onFocus:n[2]||(n[2]=(...i)=>e.onInputFocus&&e.onInputFocus(...i)),onKeydown:n[3]||(n[3]=(...i)=>e.onInputKeydown&&e.onInputKeydown(...i))}),null,16,yl)),[[t.vModelDynamic,e.computedInputValue]])],512),e.separateInput?(t.openBlock(),t.createElementBlock("div",Cl,[t.withDirectives(t.createElementVNode("input",t.mergeProps({ref:"input","onUpdate:modelValue":n[4]||(n[4]=i=>e.computedInputValue=i),class:"cdx-chip-input__input",disabled:e.computedDisabled},e.otherAttrs,{onBlur:n[5]||(n[5]=(...i)=>e.onInputBlur&&e.onInputBlur(...i)),onFocus:n[6]||(n[6]=(...i)=>e.onInputFocus&&e.onInputFocus(...i)),onKeydown:n[7]||(n[7]=(...i)=>e.onInputKeydown&&e.onInputKeydown(...i))}),null,16,wl),[[t.vModelDynamic,e.computedInputValue]])],512)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",kl,t.toDisplayString(e.statusMessageContent),1)],38)}const Jt=O(gl,[["render",$l]]);function Zt(e){return e.replace(/([\\{}()|.?*+\-^$[\]])/g,"\\$1")}const Bl="[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣ৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఀ-ఄా-ౄె-ైొ-్ౕౖౢౣಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝᠋-᠍ᢅᢆᢩᤠ-ᤫᤰ-᤻ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼᪰-᪾ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-ᮭ᯦-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ-᳴᳷-᳹᷀-᷹᷻-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣠-꣱ꣿꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꧥꨩ-ꨶꩃꩌꩍꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭ﬞ︀-️︠-︯]";function en(e,n){if(!e)return[n,"",""];const o=Zt(e),l=new RegExp(o+Bl+"*","i").exec(n);if(!l||l.index===void 0)return[n,"",""];const r=l.index,d=r+l[0].length,s=n.slice(r,d),i=n.slice(0,r),a=n.slice(d,n.length);return[i,s,a]}const Sl=Object.freeze(Object.defineProperty({__proto__:null,regExpEscape:Zt,splitStringAtMatch:en},Symbol.toStringTag,{value:"Module"})),Il=t.defineComponent({name:"CdxSearchResultTitle",props:{title:{type:String,required:!0},searchQuery:{type:String,default:""}},setup:e=>({titleChunks:t.computed(()=>en(e.searchQuery,String(e.title)))})}),xl={class:"cdx-search-result-title"},Vl={class:"cdx-search-result-title__match"};function El(e,n,o,l,r,d){return t.openBlock(),t.createElementBlock("span",xl,[t.createElementVNode("bdi",null,[t.createTextVNode(t.toDisplayString(e.titleChunks[0]),1),t.createElementVNode("span",Vl,t.toDisplayString(e.titleChunks[1]),1),t.createTextVNode(t.toDisplayString(e.titleChunks[2]),1)])])}const tn=O(Il,[["render",El]]),Nl=t.defineComponent({name:"CdxMenuItem",components:{CdxIcon:G,CdxThumbnail:ut,CdxSearchResultTitle:tn},props:{id:{type:String,required:!0},value:{type:[String,Number],required:!0},disabled:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},active:{type:Boolean,default:!1},highlighted:{type:Boolean,default:!1},label:{type:String,default:""},match:{type:String,default:""},supportingText:{type:String,default:""},url:{type:String,default:""},icon:{type:[String,Object],default:""},showThumbnail:{type:Boolean,default:!1},thumbnail:{type:[Object,null],default:null},description:{type:[String,null],default:""},searchQuery:{type:String,default:""},boldLabel:{type:Boolean,default:!1},hideDescriptionOverflow:{type:Boolean,default:!1},language:{type:Object,default:()=>({})},action:{type:String,default:"default"},multiselect:{type:Boolean,default:!1}},emits:["change"],setup:(e,{emit:n})=>{const o=()=>{e.highlighted||n("change","highlighted",!0)},l=()=>{n("change","highlighted",!1)},r=c=>{c.button===0&&n("change","active",!0)},d=()=>{n("change","selected",!0)},s=t.computed(()=>e.searchQuery.length>0),i=t.computed(()=>({"cdx-menu-item--selected":e.selected,"cdx-menu-item--active":e.active&&e.highlighted,"cdx-menu-item--highlighted":e.highlighted,"cdx-menu-item--destructive":e.action&&e.action==="destructive","cdx-menu-item--enabled":!e.disabled,"cdx-menu-item--disabled":e.disabled,"cdx-menu-item--highlight-query":s.value,"cdx-menu-item--bold-label":e.boldLabel,"cdx-menu-item--has-description":!!e.description,"cdx-menu-item--hide-description-overflow":e.hideDescriptionOverflow})),a=t.computed(()=>e.url?"a":"span"),u=t.computed(()=>e.label||String(e.value));return{onMouseMove:o,onMouseLeave:l,onMouseDown:r,onClick:d,highlightQuery:s,rootClasses:i,contentTag:a,title:u,cdxIconCheck:Wn}}}),Al=["id","aria-disabled","aria-selected","aria-checked"],Ml={class:"cdx-menu-item__text"},Dl=["lang"],Ll=["lang"],Tl=["lang"],Rl=["lang"];function Fl(e,n,o,l,r,d){const s=t.resolveComponent("cdx-thumbnail"),i=t.resolveComponent("cdx-icon"),a=t.resolveComponent("cdx-search-result-title");return t.openBlock(),t.createElementBlock("li",{id:e.id,role:"option",class:t.normalizeClass(["cdx-menu-item",e.rootClasses]),"aria-disabled":e.disabled,"aria-selected":e.selected&&!e.multiselect?!0:void 0,"aria-checked":e.selected&&e.multiselect?!0:void 0,onMousemove:n[0]||(n[0]=(...u)=>e.onMouseMove&&e.onMouseMove(...u)),onMouseleave:n[1]||(n[1]=(...u)=>e.onMouseLeave&&e.onMouseLeave(...u)),onMousedown:n[2]||(n[2]=t.withModifiers((...u)=>e.onMouseDown&&e.onMouseDown(...u),["prevent"])),onClick:n[3]||(n[3]=(...u)=>e.onClick&&e.onClick(...u))},[t.renderSlot(e.$slots,"default",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.contentTag),{href:e.url?e.url:void 0,class:"cdx-menu-item__content"},{default:t.withCtx(()=>{var u,c,p,f,m,h;return[e.showThumbnail?(t.openBlock(),t.createBlock(s,{key:0,thumbnail:e.thumbnail,class:"cdx-menu-item__thumbnail"},null,8,["thumbnail"])):e.icon?(t.openBlock(),t.createBlock(i,{key:1,icon:e.icon,class:"cdx-menu-item__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",Ml,[e.highlightQuery?(t.openBlock(),t.createBlock(a,{key:0,title:e.title,"search-query":e.searchQuery,lang:(u=e.language)==null?void 0:u.label},null,8,["title","search-query","lang"])):(t.openBlock(),t.createElementBlock("span",{key:1,class:"cdx-menu-item__text__label",lang:(c=e.language)==null?void 0:c.label},[t.createElementVNode("bdi",null,t.toDisplayString(e.title),1)],8,Dl)),e.match?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createTextVNode(t.toDisplayString(" ")+" "),e.highlightQuery?(t.openBlock(),t.createBlock(a,{key:0,title:e.match,"search-query":e.searchQuery,lang:(p=e.language)==null?void 0:p.match},null,8,["title","search-query","lang"])):(t.openBlock(),t.createElementBlock("span",{key:1,class:"cdx-menu-item__text__match",lang:(f=e.language)==null?void 0:f.match},[t.createElementVNode("bdi",null,t.toDisplayString(e.match),1)],8,Ll))],64)):t.createCommentVNode("v-if",!0),e.supportingText?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createTextVNode(t.toDisplayString(" ")+" "),t.createElementVNode("span",{class:"cdx-menu-item__text__supporting-text",lang:(m=e.language)==null?void 0:m.supportingText},[t.createElementVNode("bdi",null,t.toDisplayString(e.supportingText),1)],8,Tl)],64)):t.createCommentVNode("v-if",!0),e.description?(t.openBlock(),t.createElementBlock("span",{key:4,class:"cdx-menu-item__text__description",lang:(h=e.language)==null?void 0:h.description},[t.createElementVNode("bdi",null,t.toDisplayString(e.description),1)],8,Rl)):t.createCommentVNode("v-if",!0)]),e.multiselect&&e.selected?(t.openBlock(),t.createBlock(i,{key:2,icon:e.cdxIconCheck,size:"small",class:"cdx-menu-item__selected-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0)]}),_:1},8,["href"]))])],42,Al)}const nn=O(Nl,[["render",Fl]]),_l=t.defineComponent({name:"CdxProgressBar",props:{inline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e,{attrs:n}){Qe(()=>!e.inline&&!n["aria-label"]&&!n["aria-hidden"],"CdxProgressBar: Progress bars require one of the following attribute, aria-label or aria-hidden. See documentation on https://doc.wikimedia.org/codex/latest/components/demos/progressbar.html");const o=t.computed(()=>({"cdx-progress-bar--block":!e.inline,"cdx-progress-bar--inline":e.inline,"cdx-progress-bar--enabled":!e.disabled,"cdx-progress-bar--disabled":e.disabled})),l=t.computed(()=>e.inline?"true":void 0);return{rootClasses:o,computedAriaHidden:l}}}),Ol=["aria-hidden","aria-disabled"],zl=t.createElementVNode("div",{class:"cdx-progress-bar__bar"},null,-1),Kl=[zl];function Pl(e,n,o,l,r,d){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-progress-bar",e.rootClasses]),role:"progressbar","aria-hidden":e.computedAriaHidden,"aria-disabled":e.disabled},Kl,10,Ol)}const ft=O(_l,[["render",Pl]]);function Pe(e,n){const o=t.ref(!1);let l=!1;if(typeof window!="object"||!("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype))return o;const r=new window.IntersectionObserver(d=>{const s=d[0];s&&(o.value=s.isIntersecting)},n);return t.onMounted(()=>{l=!0,e.value&&r.observe(e.value)}),t.onUnmounted(()=>{l=!1,r.disconnect()}),t.watch(e,d=>{l&&(r.disconnect(),o.value=!1,d&&r.observe(d))}),o}function _e(e){return e!==null&&Array.isArray(e)}function st(e){return"items"in e}const Hl=t.defineComponent({name:"CdxMenu",components:{CdxMenuItem:nn,CdxIcon:G,CdxProgressBar:ft},inheritAttrs:!1,props:{menuItems:{type:Array,required:!0},footer:{type:Object,default:null},selected:{type:[String,Number,Array,null],required:!0},expanded:{type:Boolean,required:!0},showPending:{type:Boolean,default:!1},visibleItemLimit:{type:Number,default:null},showThumbnail:{type:Boolean,default:!1},boldLabel:{type:Boolean,default:!1},hideDescriptionOverflow:{type:Boolean,default:!1},searchQuery:{type:String,default:""},showNoResultsSlot:{type:Boolean,default:null}},emits:["update:selected","update:expanded","menu-item-click","menu-item-keyboard-navigation","load-more"],expose:["isExpanded","clearActive","getHighlightedMenuItem","getHighlightedViaKeyboard","getComputedMenuItems","delegateKeyNavigation"],setup(e,{emit:n,slots:o,attrs:l}){const r=t.computed(()=>{const g=e.footer&&e.menuItems?[...e.menuItems,e.footer]:e.menuItems,N=z=>Z(P({},z),{id:q("menu-item")});return g.map(z=>st(z)?Z(P({},z),{id:q("menu-group"),items:z.items.map(X=>N(X))}):N(z))}),d=t.computed(()=>{const g=[];return r.value.forEach(N=>{st(N)?g.push(...N.items):g.push(N)}),g}),s=t.computed(()=>o["no-results"]?e.showNoResultsSlot!==null?e.showNoResultsSlot:d.value.length===0:!1),i=t.ref(null),a=t.ref(!1),u=t.ref(null),c="additions removals";let p="",f=null;function m(){p="",f!==null&&(clearTimeout(f),f=null)}function h(){f!==null&&clearTimeout(f),f=setTimeout(m,1500)}function v(){var g;return(g=d.value.find(N=>_e(e.selected)?e.selected.indexOf(N.value)!==-1:N.value===e.selected))!=null?g:null}const C=t.computed(()=>_e(e.selected));function k(g){return _e(e.selected)?e.selected.indexOf(g)!==-1:g===e.selected}function B(g){if(_e(e.selected)){const N=e.selected.indexOf(g)===-1?e.selected.concat(g):e.selected.filter(z=>z!==g);n("update:selected",N)}else n("update:selected",g)}function w(g,N){if(!(N&&N.disabled))switch(g){case"selected":N&&B(N.value),C.value||n("update:expanded",!1),u.value=null;break;case"highlighted":i.value=N!=null?N:null,a.value=!1;break;case"highlightedViaKeyboard":i.value=N!=null?N:null,a.value=!0;break;case"active":u.value=N!=null?N:null;break}}const I=t.computed(()=>{if(i.value!==null)return d.value.findIndex(g=>g.value===i.value.value)});function x(g){g&&(w("highlightedViaKeyboard",g),n("menu-item-keyboard-navigation",g))}function D(g){var X;const N=ke=>{for(let ie=ke-1;ie>=0;ie--)if(!d.value[ie].disabled)return d.value[ie]};g=g!=null?g:d.value.length;const z=(X=N(g))!=null?X:N(d.value.length);x(z)}function A(g){var X;const N=ke=>d.value.find((ie,Re)=>!ie.disabled&&Re>ke);g=g!=null?g:-1;const z=(X=N(g))!=null?X:N(-1);x(z)}function M(g){if(g.key==="Clear")return m(),!0;if(g.key==="Backspace")return p=p.slice(0,-1),h(),!0;if(g.key.length===1&&!g.metaKey&&!g.ctrlKey&&!g.altKey){if(e.expanded||n("update:expanded",!0),g.key===" "&&p.length<1)return!1;p+=g.key.toLowerCase();const N=p.length>1&&p.split("").every(ie=>ie===p[0]);let z=d.value,X=p;N&&I.value!==void 0&&(z=z.slice(I.value+1).concat(z.slice(0,I.value)),X=p[0]);const ke=z.find(ie=>{var Re;return!ie.disabled&&String((Re=ie.label)!=null?Re:ie.value).toLowerCase().startsWith(X)});return ke&&(w("highlightedViaKeyboard",ke),_()),h(),!0}return!1}function b(g,{prevent:N=!0,characterNavigation:z=!1}={}){if(z){if(M(g))return g.preventDefault(),!0;m()}function X(){N&&(g.preventDefault(),g.stopPropagation())}switch(g.key){case"Enter":case" ":return X(),e.expanded?(i.value&&a.value&&B(i.value.value),C.value||n("update:expanded",!1)):n("update:expanded",!0),!0;case"Tab":return e.expanded&&i.value&&a.value&&!C.value&&(B(i.value.value),n("update:expanded",!1)),!0;case"ArrowUp":return X(),e.expanded?(i.value===null&&w("highlightedViaKeyboard",v()),D(I.value)):n("update:expanded",!0),_(),!0;case"ArrowDown":return X(),e.expanded?(i.value===null&&w("highlightedViaKeyboard",v()),A(I.value)):n("update:expanded",!0),_(),!0;case"Home":return X(),e.expanded?(i.value===null&&w("highlightedViaKeyboard",v()),A()):n("update:expanded",!0),_(),!0;case"End":return X(),e.expanded?(i.value===null&&w("highlightedViaKeyboard",v()),D()):n("update:expanded",!0),_(),!0;case"Escape":return X(),n("update:expanded",!1),!0;default:return!1}}function y(){w("active",null)}const S=[],E=t.ref(void 0),R=Pe(E,{threshold:.8});t.watch(R,g=>{g&&n("load-more")});function K(g,N){if(g){S[N]=g.$el;const z=e.visibleItemLimit;if(!z||e.menuItems.lengthT.value.clientHeight;if(I.value===void 0||!g)return;const N=I.value>=0?I.value:0;S[N].scrollIntoView({behavior:"smooth",block:"nearest"})}const j=t.ref(null),W=t.ref(null);function ne(){return ee(this,null,function*(){yield t.nextTick(),me(),$(),yield t.nextTick(),_()})}function me(){if(e.footer){const g=S[S.length-1];W.value=g.scrollHeight}else W.value=null}function $(){if(!e.visibleItemLimit||S.length<=e.visibleItemLimit){j.value=null;return}const g=S[0].getBoundingClientRect().top,N=S[e.visibleItemLimit].getBoundingClientRect().top;j.value=N-g+2}function L(g){return{"cdx-menu__group-wrapper--hide-label":!!g.hideLabel}}function H(g){return d.value.indexOf(g)}function Y(g){var N,z;return P({selected:k(g.value),active:g.value===((N=u.value)==null?void 0:N.value),highlighted:g.value===((z=i.value)==null?void 0:z.value),showThumbnail:e.showThumbnail,boldLabel:e.boldLabel,hideDescriptionOverflow:e.hideDescriptionOverflow,searchQuery:e.searchQuery,multiselect:C.value},g)}function et(g){return{change:(N,z)=>w(N,z?g:null),click:()=>n("menu-item-click",g)}}function tt(g){var N,z;return{menuItem:g,active:g.value===((N=u.value)==null?void 0:N.value)&&g.value===((z=i.value)==null?void 0:z.value)}}t.onMounted(()=>{document.addEventListener("mouseup",y)}),t.onUnmounted(()=>{document.removeEventListener("mouseup",y)}),t.watch(t.toRef(e,"expanded"),g=>ee(this,null,function*(){if(g){const N=v();N&&!i.value&&w("highlighted",N),yield ne()}else w("highlighted",null)})),t.watch(t.toRef(e,"menuItems"),g=>ee(this,null,function*(){g.length({"max-height":j.value?"".concat(j.value,"px"):void 0,"margin-bottom":W.value?"".concat(W.value,"px"):void 0})),ot=t.computed(()=>({"cdx-menu--has-footer":!!e.footer})),{rootClasses:V,rootStyle:F,otherAttrs:U}=le(l,ot);return{listBoxStyle:nt,rootClasses:V,rootStyle:F,otherAttrs:U,assignTemplateRef:K,computedMenuEntries:r,computedMenuItems:d,computedShowNoResultsSlot:s,highlightedMenuItem:i,highlightedViaKeyboard:a,handleMenuItemChange:w,handleKeyNavigation:b,ariaRelevant:c,isMultiselect:C,menuListbox:T,getGroupWrapperClasses:L,getMenuItemIndex:H,getMenuItemBindings:Y,getMenuItemHandlers:et,getSlotBindings:tt,isMenuGroupData:st}},methods:{isExpanded(){return this.expanded},getHighlightedMenuItem(){return this.expanded?this.highlightedMenuItem:null},getHighlightedViaKeyboard(){return this.highlightedViaKeyboard},getComputedMenuItems(){return this.computedMenuItems},clearActive(){this.handleMenuItemChange("active",null)},delegateKeyNavigation(e,{prevent:n=!0,characterNavigation:o=!1}={}){return this.handleKeyNavigation(e,{prevent:n,characterNavigation:o})}}}),Ul=["aria-live","aria-relevant","aria-multiselectable"],jl={key:0,class:"cdx-menu__pending cdx-menu-item"},ql={key:1,class:"cdx-menu__no-results cdx-menu-item",role:"option"},Wl=["aria-labelledby","aria-describedby"],Ql={class:"cdx-menu__group__meta"},Gl={class:"cdx-menu__group__meta__text"},Yl=["id"],Xl=["id"];function Jl(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-menu-item"),a=t.resolveComponent("cdx-progress-bar");return t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-menu",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("ul",t.mergeProps({ref:"menuListbox",class:"cdx-menu__listbox",role:"listbox",style:e.listBoxStyle,"aria-live":e.showPending?"polite":void 0,"aria-relevant":e.showPending?e.ariaRelevant:void 0,"aria-multiselectable":e.isMultiselect?!0:void 0},e.otherAttrs),[e.showPending&&e.computedMenuItems.length===0&&e.$slots.pending?(t.openBlock(),t.createElementBlock("li",jl,[t.renderSlot(e.$slots,"pending")])):t.createCommentVNode("v-if",!0),e.computedShowNoResultsSlot?(t.openBlock(),t.createElementBlock("li",ql,[t.renderSlot(e.$slots,"no-results")])):t.createCommentVNode("v-if",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedMenuEntries,(u,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:c},[e.isMenuGroupData(u)?(t.openBlock(),t.createElementBlock("li",{key:0,class:t.normalizeClass(["cdx-menu__group-wrapper",e.getGroupWrapperClasses(u)])},[t.createElementVNode("ul",{class:"cdx-menu__group",role:"group","aria-labelledby":u.id+"-label","aria-describedby":u.id+"-description"},[t.createElementVNode("span",Ql,[u.icon?(t.openBlock(),t.createBlock(s,{key:0,class:"cdx-menu__group__icon",icon:u.icon},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",Gl,[t.createElementVNode("span",{id:u.id+"-label",class:"cdx-menu__group__label"},t.toDisplayString(u.label),9,Yl),u.description?(t.openBlock(),t.createElementBlock("span",{key:0,id:u.id+"-description",class:"cdx-menu__group__description"},t.toDisplayString(u.description),9,Xl)):t.createCommentVNode("v-if",!0)])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.items,p=>(t.openBlock(),t.createBlock(i,t.mergeProps({key:p.value,ref_for:!0,ref:f=>e.assignTemplateRef(f,e.getMenuItemIndex(p)),class:"cdx-menu__group__item"},e.getMenuItemBindings(p),t.toHandlers(e.getMenuItemHandlers(p))),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",t.mergeProps({ref_for:!0},e.getSlotBindings(p)))]),_:2},1040))),128))],8,Wl)],2)):(t.openBlock(),t.createBlock(i,t.mergeProps({key:1,ref_for:!0,ref:p=>e.assignTemplateRef(p,e.getMenuItemIndex(u))},e.getMenuItemBindings(u),t.toHandlers(e.getMenuItemHandlers(u))),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",t.mergeProps({ref_for:!0},e.getSlotBindings(u)))]),_:2},1040))],64))),128)),e.showPending?(t.openBlock(),t.createBlock(a,{key:2,class:"cdx-menu__progress-bar",inline:!0})):t.createCommentVNode("v-if",!0)],16,Ul)],6)),[[t.vShow,e.expanded]])}const we=O(Hl,[["render",Jl]]),Zl=J(uo),ea=J(ue),ta=t.defineComponent({name:"CdxTextInput",components:{CdxIcon:G},inheritAttrs:!1,expose:["focus","blur"],props:{modelValue:{type:[String,Number],default:""},inputType:{type:String,default:"text",validator:Zl},status:{type:String,default:"default",validator:ea},disabled:{type:Boolean,default:!1},startIcon:{type:[String,Object],default:void 0},endIcon:{type:[String,Object],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue","keydown","input","change","focus","blur","clear"],setup(e,{emit:n,attrs:o}){const l=o.id,{computedDisabled:r,computedStatus:d,computedInputId:s}=oe(t.toRef(e,"disabled"),t.toRef(e,"status"),l),i=t.inject(qe,void 0),a=te(t.toRef(e,"modelValue"),n),u=t.computed(()=>e.clearable&&!!a.value&&!r.value),c=t.computed(()=>({"cdx-text-input--has-start-icon":!!e.startIcon,"cdx-text-input--has-end-icon":!!e.endIcon,"cdx-text-input--clearable":u.value,["cdx-text-input--status-".concat(d.value)]:!0})),{rootClasses:p,rootStyle:f,otherAttrs:m}=le(o,c),h=t.computed(()=>{const M=m.value,{id:D}=M;return re(M,["id"])}),v=t.computed(()=>({"cdx-text-input__input--has-value":!!a.value}));return{computedInputId:s,descriptionId:i,wrappedModel:a,isClearable:u,rootClasses:p,rootStyle:f,otherAttrsMinusId:h,inputClasses:v,computedDisabled:r,onClear:D=>{a.value="",n("clear",D)},onInput:D=>{n("input",D)},onChange:D=>{n("change",D)},onKeydown:D=>{(D.key==="Home"||D.key==="End")&&!D.ctrlKey&&!D.metaKey||n("keydown",D)},onFocus:D=>{n("focus",D)},onBlur:D=>{n("blur",D)},cdxIconClear:Qn}},methods:{focus(){this.$refs.input.focus()},blur(){this.$refs.input.blur()}}}),na=["id","type","aria-describedby","disabled"];function oa(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-text-input",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.withDirectives(t.createElementVNode("input",t.mergeProps({id:e.computedInputId,ref:"input","onUpdate:modelValue":n[0]||(n[0]=i=>e.wrappedModel=i),class:["cdx-text-input__input",e.inputClasses]},e.otherAttrsMinusId,{type:e.inputType,"aria-describedby":e.descriptionId,disabled:e.computedDisabled,size:"1",onInput:n[1]||(n[1]=(...i)=>e.onInput&&e.onInput(...i)),onChange:n[2]||(n[2]=(...i)=>e.onChange&&e.onChange(...i)),onFocus:n[3]||(n[3]=(...i)=>e.onFocus&&e.onFocus(...i)),onBlur:n[4]||(n[4]=(...i)=>e.onBlur&&e.onBlur(...i)),onKeydown:n[5]||(n[5]=(...i)=>e.onKeydown&&e.onKeydown(...i))}),null,16,na),[[t.vModelDynamic,e.wrappedModel]]),e.startIcon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.startIcon,class:"cdx-text-input__icon-vue cdx-text-input__start-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),e.endIcon?(t.openBlock(),t.createBlock(s,{key:1,icon:e.endIcon,class:"cdx-text-input__icon-vue cdx-text-input__end-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),e.isClearable?(t.openBlock(),t.createBlock(s,{key:2,icon:e.cdxIconClear,class:"cdx-text-input__icon-vue cdx-text-input__clear-icon",onMousedown:n[6]||(n[6]=t.withModifiers(()=>{},["prevent"])),onClick:e.onClear},null,8,["icon","onClick"])):t.createCommentVNode("v-if",!0)],6)}const Xe=O(ta,[["render",oa]]),la=["top","right","bottom","left"],Se=Math.min,ae=Math.max,He=Math.round,Oe=Math.floor,be=e=>({x:e,y:e}),aa={left:"right",right:"left",bottom:"top",top:"bottom"},sa={start:"end",end:"start"};function wt(e,n,o){return ae(e,Se(n,o))}function xe(e,n){return typeof e=="function"?e(n):e}function ye(e){return e.split("-")[0]}function De(e){return e.split("-")[1]}function on(e){return e==="x"?"y":"x"}function ln(e){return e==="y"?"height":"width"}function Le(e){return["top","bottom"].includes(ye(e))?"y":"x"}function an(e){return on(Le(e))}function ia(e,n,o){o===void 0&&(o=!1);const l=De(e),r=an(e),d=ln(r);let s=r==="x"?l===(o?"end":"start")?"right":"left":l==="start"?"bottom":"top";return n.reference[d]>n.floating[d]&&(s=Ue(s)),[s,Ue(s)]}function ra(e){const n=Ue(e);return[it(e),n,it(n)]}function it(e){return e.replace(/start|end/g,n=>sa[n])}function da(e,n,o){const l=["left","right"],r=["right","left"],d=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return o?n?r:l:n?l:r;case"left":case"right":return n?d:s;default:return[]}}function ua(e,n,o,l){const r=De(e);let d=da(ye(e),o==="start",l);return r&&(d=d.map(s=>s+"-"+r),n&&(d=d.concat(d.map(it)))),d}function Ue(e){return e.replace(/left|right|bottom|top/g,n=>aa[n])}function ca(e){return P({top:0,right:0,bottom:0,left:0},e)}function pa(e){return typeof e!="number"?ca(e):{top:e,right:e,bottom:e,left:e}}function je(e){return Z(P({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function kt(e,n,o){let{reference:l,floating:r}=e;const d=Le(n),s=an(n),i=ln(s),a=ye(n),u=d==="y",c=l.x+l.width/2-r.width/2,p=l.y+l.height/2-r.height/2,f=l[i]/2-r[i]/2;let m;switch(a){case"top":m={x:c,y:l.y-r.height};break;case"bottom":m={x:c,y:l.y+l.height};break;case"right":m={x:l.x+l.width,y:p};break;case"left":m={x:l.x-r.width,y:p};break;default:m={x:l.x,y:l.y}}switch(De(n)){case"start":m[s]-=f*(o&&u?-1:1);break;case"end":m[s]+=f*(o&&u?-1:1);break}return m}const fa=(e,n,o)=>ee(exports,null,function*(){const{placement:l="bottom",strategy:r="absolute",middleware:d=[],platform:s}=o,i=d.filter(Boolean),a=yield s.isRTL==null?void 0:s.isRTL(n);let u=yield s.getElementRects({reference:e,floating:n,strategy:r}),{x:c,y:p}=kt(u,l,a),f=l,m={},h=0;for(let v=0;vK<=0)){var y,S;const K=(((y=s.flip)==null?void 0:y.index)||0)+1,T=D[K];if(T)return{data:{index:K,overflows:b},reset:{placement:T}};let _=(S=b.filter(j=>j.overflows[0]<=0).sort((j,W)=>j.overflows[1]-W.overflows[1])[0])==null?void 0:S.placement;if(!_)switch(h){case"bestFit":{var E;const j=(E=b.map(W=>[W.placement,W.overflows.filter(ne=>ne>0).reduce((ne,me)=>ne+me,0)]).sort((W,ne)=>W[1]-ne[1])[0])==null?void 0:E[0];j&&(_=j);break}case"initialPlacement":_=a;break}if(d!==_)return{reset:{placement:_}}}return{}})}}};function $t(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Bt(e){return la.some(n=>e[n]>=0)}const ha=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(o){return ee(this,null,function*(){const{rects:l}=o,s=xe(e,o),{strategy:r="referenceHidden"}=s,d=re(s,["strategy"]);switch(r){case"referenceHidden":{const i=yield Ee(o,Z(P({},d),{elementContext:"reference"})),a=$t(i,l.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Bt(a)}}}case"escaped":{const i=yield Ee(o,Z(P({},d),{altBoundary:!0})),a=$t(i,l.floating);return{data:{escapedOffsets:a,escaped:Bt(a)}}}default:return{}}})}}};function va(e,n){return ee(this,null,function*(){const{placement:o,platform:l,elements:r}=e,d=yield l.isRTL==null?void 0:l.isRTL(r.floating),s=ye(o),i=De(o),a=Le(o)==="y",u=["left","top"].includes(s)?-1:1,c=d&&a?-1:1,p=xe(n,e);let{mainAxis:f,crossAxis:m,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:P({mainAxis:0,crossAxis:0,alignmentAxis:null},p);return i&&typeof h=="number"&&(m=i==="end"?h*-1:h),a?{x:m*c,y:f*u}:{x:f*u,y:m*c}})}const sn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(o){return ee(this,null,function*(){var l,r;const{x:d,y:s,placement:i,middlewareData:a}=o,u=yield va(o,e);return i===((l=a.offset)==null?void 0:l.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:d+u.x,y:s+u.y,data:Z(P({},u),{placement:i})}})}}},ga=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(o){return ee(this,null,function*(){const{x:l,y:r,placement:d}=o,k=xe(e,o),{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:B=>{let{x:w,y:I}=B;return{x:w,y:I}}}}=k,u=re(k,["mainAxis","crossAxis","limiter"]),c={x:l,y:r},p=yield Ee(o,u),f=Le(ye(d)),m=on(f);let h=c[m],v=c[f];if(s){const B=m==="y"?"top":"left",w=m==="y"?"bottom":"right",I=h+p[B],x=h-p[w];h=wt(I,h,x)}if(i){const B=f==="y"?"top":"left",w=f==="y"?"bottom":"right",I=v+p[B],x=v-p[w];v=wt(I,v,x)}const C=a.fn(Z(P({},o),{[m]:h,[f]:v}));return Z(P({},C),{data:{x:C.x-l,y:C.y-r}})})}}},ba=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(o){return ee(this,null,function*(){const{placement:l,rects:r,platform:d,elements:s}=o,A=xe(e,o),{apply:i=()=>{}}=A,a=re(A,["apply"]),u=yield Ee(o,a),c=ye(l),p=De(l),f=Le(l)==="y",{width:m,height:h}=r.floating;let v,C;c==="top"||c==="bottom"?(v=c,C=p===((yield d.isRTL==null?void 0:d.isRTL(s.floating))?"start":"end")?"left":"right"):(C=c,v=p==="end"?"top":"bottom");const k=h-u[v],B=m-u[C],w=!o.middlewareData.shift;let I=k,x=B;if(f){const M=m-u.left-u.right;x=p||w?Se(B,M):M}else{const M=h-u.top-u.bottom;I=p||w?Se(k,M):M}if(w&&!p){const M=ae(u.left,0),b=ae(u.right,0),y=ae(u.top,0),S=ae(u.bottom,0);f?x=m-2*(M!==0||b!==0?M+b:ae(u.left,u.right)):I=h-2*(y!==0||S!==0?y+S:ae(u.top,u.bottom))}yield i(Z(P({},o),{availableWidth:x,availableHeight:I}));const D=yield d.getDimensions(s.floating);return m!==D.width||h!==D.height?{reset:{rects:!0}}:{}})}}};function he(e){return mt(e)?(e.nodeName||"").toLowerCase():"#document"}function se(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function ge(e){var n;return(n=(mt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function mt(e){return e instanceof Node||e instanceof se(e).Node}function ve(e){return e instanceof Element||e instanceof se(e).Element}function pe(e){return e instanceof HTMLElement||e instanceof se(e).HTMLElement}function St(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof se(e).ShadowRoot}function Te(e){const{overflow:n,overflowX:o,overflowY:l,display:r}=de(e);return/auto|scroll|overlay|hidden|clip/.test(n+l+o)&&!["inline","contents"].includes(r)}function ya(e){return["table","td","th"].includes(he(e))}function ht(e){const n=vt(),o=de(e);return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!n&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!n&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(l=>(o.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(o.contain||"").includes(l))}function Ca(e){let n=Ie(e);for(;pe(n)&&!Je(n);){if(ht(n))return n;n=Ie(n)}return null}function vt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Je(e){return["html","body","#document"].includes(he(e))}function de(e){return se(e).getComputedStyle(e)}function Ze(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ie(e){if(he(e)==="html")return e;const n=e.assignedSlot||e.parentNode||St(e)&&e.host||ge(e);return St(n)?n.host:n}function rn(e){const n=Ie(e);return Je(n)?e.ownerDocument?e.ownerDocument.body:e.body:pe(n)&&Te(n)?n:rn(n)}function Ne(e,n,o){var l;n===void 0&&(n=[]),o===void 0&&(o=!0);const r=rn(e),d=r===((l=e.ownerDocument)==null?void 0:l.body),s=se(r);return d?n.concat(s,s.visualViewport||[],Te(r)?r:[],s.frameElement&&o?Ne(s.frameElement):[]):n.concat(r,Ne(r,[],o))}function dn(e){const n=de(e);let o=parseFloat(n.width)||0,l=parseFloat(n.height)||0;const r=pe(e),d=r?e.offsetWidth:o,s=r?e.offsetHeight:l,i=He(o)!==d||He(l)!==s;return i&&(o=d,l=s),{width:o,height:l,$:i}}function gt(e){return ve(e)?e:e.contextElement}function Be(e){const n=gt(e);if(!pe(n))return be(1);const o=n.getBoundingClientRect(),{width:l,height:r,$:d}=dn(n);let s=(d?He(o.width):o.width)/l,i=(d?He(o.height):o.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const wa=be(0);function un(e){const n=se(e);return!vt()||!n.visualViewport?wa:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function ka(e,n,o){return n===void 0&&(n=!1),!o||n&&o!==se(e)?!1:n}function Ce(e,n,o,l){n===void 0&&(n=!1),o===void 0&&(o=!1);const r=e.getBoundingClientRect(),d=gt(e);let s=be(1);n&&(l?ve(l)&&(s=Be(l)):s=Be(e));const i=ka(d,o,l)?un(d):be(0);let a=(r.left+i.x)/s.x,u=(r.top+i.y)/s.y,c=r.width/s.x,p=r.height/s.y;if(d){const f=se(d),m=l&&ve(l)?se(l):l;let h=f,v=h.frameElement;for(;v&&l&&m!==h;){const C=Be(v),k=v.getBoundingClientRect(),B=de(v),w=k.left+(v.clientLeft+parseFloat(B.paddingLeft))*C.x,I=k.top+(v.clientTop+parseFloat(B.paddingTop))*C.y;a*=C.x,u*=C.y,c*=C.x,p*=C.y,a+=w,u+=I,h=se(v),v=h.frameElement}}return je({width:c,height:p,x:a,y:u})}const $a=[":popover-open",":modal"];function cn(e){return $a.some(n=>{try{return e.matches(n)}catch(o){return!1}})}function Ba(e){let{elements:n,rect:o,offsetParent:l,strategy:r}=e;const d=r==="fixed",s=ge(l),i=n?cn(n.floating):!1;if(l===s||i&&d)return o;let a={scrollLeft:0,scrollTop:0},u=be(1);const c=be(0),p=pe(l);if((p||!p&&!d)&&((he(l)!=="body"||Te(s))&&(a=Ze(l)),pe(l))){const f=Ce(l);u=Be(l),c.x=f.x+l.clientLeft,c.y=f.y+l.clientTop}return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-a.scrollLeft*u.x+c.x,y:o.y*u.y-a.scrollTop*u.y+c.y}}function Sa(e){return Array.from(e.getClientRects())}function pn(e){return Ce(ge(e)).left+Ze(e).scrollLeft}function Ia(e){const n=ge(e),o=Ze(e),l=e.ownerDocument.body,r=ae(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),d=ae(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let s=-o.scrollLeft+pn(e);const i=-o.scrollTop;return de(l).direction==="rtl"&&(s+=ae(n.clientWidth,l.clientWidth)-r),{width:r,height:d,x:s,y:i}}function xa(e,n){const o=se(e),l=ge(e),r=o.visualViewport;let d=l.clientWidth,s=l.clientHeight,i=0,a=0;if(r){d=r.width,s=r.height;const u=vt();(!u||u&&n==="fixed")&&(i=r.offsetLeft,a=r.offsetTop)}return{width:d,height:s,x:i,y:a}}function Va(e,n){const o=Ce(e,!0,n==="fixed"),l=o.top+e.clientTop,r=o.left+e.clientLeft,d=pe(e)?Be(e):be(1),s=e.clientWidth*d.x,i=e.clientHeight*d.y,a=r*d.x,u=l*d.y;return{width:s,height:i,x:a,y:u}}function It(e,n,o){let l;if(n==="viewport")l=xa(e,o);else if(n==="document")l=Ia(ge(e));else if(ve(n))l=Va(n,o);else{const r=un(e);l=Z(P({},n),{x:n.x-r.x,y:n.y-r.y})}return je(l)}function fn(e,n){const o=Ie(e);return o===n||!ve(o)||Je(o)?!1:de(o).position==="fixed"||fn(o,n)}function Ea(e,n){const o=n.get(e);if(o)return o;let l=Ne(e,[],!1).filter(i=>ve(i)&&he(i)!=="body"),r=null;const d=de(e).position==="fixed";let s=d?Ie(e):e;for(;ve(s)&&!Je(s);){const i=de(s),a=ht(s);!a&&i.position==="fixed"&&(r=null),(d?!a&&!r:!a&&i.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Te(s)&&!a&&fn(e,s))?l=l.filter(c=>c!==s):r=i,s=Ie(s)}return n.set(e,l),l}function Na(e){let{element:n,boundary:o,rootBoundary:l,strategy:r}=e;const s=[...o==="clippingAncestors"?Ea(n,this._c):[].concat(o),l],i=s[0],a=s.reduce((u,c)=>{const p=It(n,c,r);return u.top=ae(p.top,u.top),u.right=Se(p.right,u.right),u.bottom=Se(p.bottom,u.bottom),u.left=ae(p.left,u.left),u},It(n,i,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Aa(e){const{width:n,height:o}=dn(e);return{width:n,height:o}}function Ma(e,n,o){const l=pe(n),r=ge(n),d=o==="fixed",s=Ce(e,!0,d,n);let i={scrollLeft:0,scrollTop:0};const a=be(0);if(l||!l&&!d)if((he(n)!=="body"||Te(r))&&(i=Ze(n)),l){const p=Ce(n,!0,d,n);a.x=p.x+n.clientLeft,a.y=p.y+n.clientTop}else r&&(a.x=pn(r));const u=s.left+i.scrollLeft-a.x,c=s.top+i.scrollTop-a.y;return{x:u,y:c,width:s.width,height:s.height}}function xt(e,n){return!pe(e)||de(e).position==="fixed"?null:n?n(e):e.offsetParent}function mn(e,n){const o=se(e);if(!pe(e)||cn(e))return o;let l=xt(e,n);for(;l&&ya(l)&&de(l).position==="static";)l=xt(l,n);return l&&(he(l)==="html"||he(l)==="body"&&de(l).position==="static"&&!ht(l))?o:l||Ca(e)||o}const Da=function(e){return ee(this,null,function*(){const n=this.getOffsetParent||mn,o=this.getDimensions;return{reference:Ma(e.reference,yield n(e.floating),e.strategy),floating:P({x:0,y:0},yield o(e.floating))}})};function La(e){return de(e).direction==="rtl"}const Ta={convertOffsetParentRelativeRectToViewportRelativeRect:Ba,getDocumentElement:ge,getClippingRect:Na,getOffsetParent:mn,getElementRects:Da,getClientRects:Sa,getDimensions:Aa,getScale:Be,isElement:ve,isRTL:La};function Ra(e,n){let o=null,l;const r=ge(e);function d(){var i;clearTimeout(l),(i=o)==null||i.disconnect(),o=null}function s(i,a){i===void 0&&(i=!1),a===void 0&&(a=1),d();const{left:u,top:c,width:p,height:f}=e.getBoundingClientRect();if(i||n(),!p||!f)return;const m=Oe(c),h=Oe(r.clientWidth-(u+p)),v=Oe(r.clientHeight-(c+f)),C=Oe(u),B={rootMargin:-m+"px "+-h+"px "+-v+"px "+-C+"px",threshold:ae(0,Se(1,a))||1};let w=!0;function I(x){const D=x[0].intersectionRatio;if(D!==a){if(!w)return s();D?s(!1,D):l=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{o=new IntersectionObserver(I,Z(P({},B),{root:r.ownerDocument}))}catch(x){o=new IntersectionObserver(I,B)}o.observe(e)}return s(!0),d}function hn(e,n,o,l){l===void 0&&(l={});const{ancestorScroll:r=!0,ancestorResize:d=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:a=!1}=l,u=gt(e),c=r||d?[...u?Ne(u):[],...Ne(n)]:[];c.forEach(k=>{r&&k.addEventListener("scroll",o,{passive:!0}),d&&k.addEventListener("resize",o)});const p=u&&i?Ra(u,o):null;let f=-1,m=null;s&&(m=new ResizeObserver(k=>{let[B]=k;B&&B.target===u&&m&&(m.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(n)})),o()}),u&&!a&&m.observe(u),m.observe(n));let h,v=a?Ce(e):null;a&&C();function C(){const k=Ce(e);v&&(k.x!==v.x||k.y!==v.y||k.width!==v.width||k.height!==v.height)&&o(),v=k,h=requestAnimationFrame(C)}return o(),()=>{var k;c.forEach(B=>{r&&B.removeEventListener("scroll",o),d&&B.removeEventListener("resize",o)}),p==null||p(),(k=m)==null||k.disconnect(),m=null,a&&cancelAnimationFrame(h)}}const Fa=ga,vn=ma,_a=ba,rt=ha,gn=(e,n,o)=>{const l=new Map,r=P({platform:Ta},o),d=Z(P({},r.platform),{_c:l});return fa(e,n,Z(P({},r),{platform:d}))};function Oa(e){return e!=null&&typeof e=="object"&&"$el"in e}function Vt(e){if(Oa(e)){const n=e.$el;return mt(n)&&he(n)==="#comment"?null:n}return e}function bn(e){return typeof window=="undefined"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Et(e,n){const o=bn(e);return Math.round(n*o)/o}function za(e,n,o){o===void 0&&(o={});const l=o.whileElementsMounted,r=t.computed(()=>{var A;return(A=t.unref(o.open))!=null?A:!0}),d=t.computed(()=>t.unref(o.middleware)),s=t.computed(()=>{var A;return(A=t.unref(o.placement))!=null?A:"bottom"}),i=t.computed(()=>{var A;return(A=t.unref(o.strategy))!=null?A:"absolute"}),a=t.computed(()=>{var A;return(A=t.unref(o.transform))!=null?A:!0}),u=t.computed(()=>Vt(e.value)),c=t.computed(()=>Vt(n.value)),p=t.ref(0),f=t.ref(0),m=t.ref(i.value),h=t.ref(s.value),v=t.shallowRef({}),C=t.ref(!1),k=t.computed(()=>{const A={position:m.value,left:"0",top:"0"};if(!c.value)return A;const M=Et(c.value,p.value),b=Et(c.value,f.value);return a.value?P(Z(P({},A),{transform:"translate("+M+"px, "+b+"px)"}),bn(c.value)>=1.5&&{willChange:"transform"}):{position:m.value,left:M+"px",top:b+"px"}});let B;function w(){u.value==null||c.value==null||gn(u.value,c.value,{middleware:d.value,placement:s.value,strategy:i.value}).then(A=>{p.value=A.x,f.value=A.y,m.value=A.strategy,h.value=A.placement,v.value=A.middlewareData,C.value=!0})}function I(){typeof B=="function"&&(B(),B=void 0)}function x(){if(I(),l===void 0){w();return}if(u.value!=null&&c.value!=null){B=l(u.value,c.value,w);return}}function D(){r.value||(C.value=!1)}return t.watch([d,s,i],w,{flush:"sync"}),t.watch([u,c],x,{flush:"sync"}),t.watch(r,D,{flush:"sync"}),t.getCurrentScope()&&t.onScopeDispose(I),{x:t.shallowReadonly(p),y:t.shallowReadonly(f),strategy:t.shallowReadonly(m),placement:t.shallowReadonly(h),middlewareData:t.shallowReadonly(v),isPositioned:t.shallowReadonly(C),floatingStyles:k,update:w}}function Ka(e){return e&&"$el"in e?e.$el:e}const Nt=16,Pa=128;function Ve(e,n,o){var p;const l=()=>{var f;return(f=n.value)==null?void 0:f.isExpanded()},r=[sn(o==null?void 0:o.offset),_a({padding:Nt,apply({rects:f,elements:m,availableHeight:h,availableWidth:v}){Object.assign(m.floating.style,{width:"".concat(o!=null&&o.useAvailableWidth?v:f.reference.width,"px"),maxHeight:"".concat(Math.max(Pa,h),"px")})}}),vn({padding:Nt}),rt({strategy:"escaped"}),rt()],{floatingStyles:d,placement:s,middlewareData:i,update:a}=za(e,n,{middleware:r,placement:(p=o==null?void 0:o.placement)!=null?p:"bottom"}),u=t.computed(()=>{var m,h;return!l()||!!((m=i.value.hide)!=null&&m.escaped)||((h=i.value.hide)==null?void 0:h.referenceHidden)?"hidden":"visible"});t.watch([d,u,s],([f,m,h])=>{var v,C,k,B,w;Object.assign((C=(v=n.value)==null?void 0:v.$el.style)!=null?C:{},{visibility:m,position:f.position,top:"".concat(f.top,"px"),right:"unset",left:"".concat(f.left,"px"),transform:(k=f.transform)!=null?k:"none",borderTopLeftRadius:h==="bottom"&&m==="visible"?"0":"",borderTopRightRadius:h==="bottom"&&m==="visible"?"0":"",borderBottomLeftRadius:h==="top"&&m==="visible"?"0":"",borderBottomRightRadius:h==="top"&&m==="visible"?"0":""}),Object.assign((w=(B=Ka(e.value))==null?void 0:B.style)!=null?w:{},{borderTopLeftRadius:h==="top"&&m==="visible"?"0":"",borderTopRightRadius:h==="top"&&m==="visible"?"0":"",borderBottomLeftRadius:h==="bottom"&&m==="visible"?"0":"",borderBottomRightRadius:h==="bottom"&&m==="visible"?"0":""})});let c=null;t.watch(l,f=>{var m;f?c=hn(e.value&&"$el"in e.value?e.value.$el:e,(m=n.value)==null?void 0:m.$el,a):c&&(c(),c=null)})}const Ha=J(ue),Ua=t.defineComponent({name:"CdxCombobox",components:{CdxButton:fe,CdxIcon:G,CdxMenu:we,CdxTextInput:Xe},inheritAttrs:!1,props:{menuItems:{type:Array,required:!0},selected:{type:[String,Number],required:!0},disabled:{type:Boolean,default:!1},menuConfig:{type:Object,default:()=>({})},status:{type:String,default:"default",validator:Ha}},emits:["update:selected","load-more","input","change","focus","blur"],setup(e,{emit:n,attrs:o,slots:l}){const r=t.ref(),d=t.ref(),s=t.ref(),i=q("combobox"),a=t.toRef(e,"selected"),u=te(a,n,"update:selected"),c=t.ref(!1),p=t.ref(!1),f=t.computed(()=>{var M,b;return(b=(M=s.value)==null?void 0:M.getHighlightedMenuItem())==null?void 0:b.id}),{computedDisabled:m,computedStatus:h}=oe(t.toRef(e,"disabled"),t.toRef(e,"status")),v=t.computed(()=>({"cdx-combobox--expanded":c.value,"cdx-combobox--disabled":m.value})),{rootClasses:C,rootStyle:k,otherAttrs:B}=le(o,v);function w(M){p.value&&c.value?c.value=!1:(e.menuItems.length>0||l["no-results"])&&(c.value=!0),n("focus",M)}function I(M){c.value=p.value&&c.value,n("blur",M)}function x(){m.value||(p.value=!0)}function D(){var M;m.value||(M=r.value)==null||M.focus()}function A(M){!s.value||m.value||e.menuItems.length===0||M.key===" "||s.value.delegateKeyNavigation(M)}return Ve(r,s),t.watch(c,()=>{p.value=!1}),{input:r,inputWrapper:d,menu:s,menuId:i,modelWrapper:u,expanded:c,highlightedId:f,computedDisabled:m,computedStatus:h,onInputFocus:w,onInputBlur:I,onKeydown:A,onButtonClick:D,onButtonMousedown:x,cdxIconExpand:Dt,rootClasses:C,rootStyle:k,otherAttrs:B}}}),ja={ref:"inputWrapper",class:"cdx-combobox__input-wrapper"};function qa(e,n,o,l,r,d){const s=t.resolveComponent("cdx-text-input"),i=t.resolveComponent("cdx-icon"),a=t.resolveComponent("cdx-button"),u=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-combobox",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("div",ja,[t.createVNode(s,t.mergeProps({ref:"input",modelValue:e.modelWrapper,"onUpdate:modelValue":n[0]||(n[0]=c=>e.modelWrapper=c)},e.otherAttrs,{class:"cdx-combobox__input","aria-activedescendant":e.highlightedId,"aria-expanded":e.expanded,"aria-controls":e.menuId,disabled:e.computedDisabled,status:e.computedStatus,autocomplete:"off",role:"combobox",onKeydown:e.onKeydown,onInput:n[1]||(n[1]=c=>e.$emit("input",c)),onChange:n[2]||(n[2]=c=>e.$emit("change",c)),onFocus:e.onInputFocus,onBlur:e.onInputBlur}),null,16,["modelValue","aria-activedescendant","aria-expanded","aria-controls","disabled","status","onKeydown","onFocus","onBlur"]),t.createVNode(a,{class:"cdx-combobox__expand-button","aria-hidden":"true",disabled:e.computedDisabled,tabindex:"-1",type:"button",onMousedown:e.onButtonMousedown,onClick:e.onButtonClick},{default:t.withCtx(()=>[t.createVNode(i,{class:"cdx-combobox__expand-icon",icon:e.cdxIconExpand},null,8,["icon"])]),_:1},8,["disabled","onMousedown","onClick"])],512),t.createVNode(u,t.mergeProps({id:e.menuId,ref:"menu",selected:e.modelWrapper,"onUpdate:selected":n[3]||(n[3]=c=>e.modelWrapper=c),expanded:e.expanded,"onUpdate:expanded":n[4]||(n[4]=c=>e.expanded=c),"menu-items":e.menuItems},e.menuConfig,{onLoadMore:n[5]||(n[5]=c=>e.$emit("load-more"))}),{default:t.withCtx(({menuItem:c})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:c})]),"no-results":t.withCtx(()=>[t.renderSlot(e.$slots,"no-results")]),_:3},16,["id","selected","expanded","menu-items"])],6)}const Wa=O(Ua,[["render",qa]]);function yn(e){const n=t.ref({width:void 0,height:void 0});if(typeof window!="object"||!("ResizeObserver"in window)||!("ResizeObserverEntry"in window))return n;const o=new window.ResizeObserver(r=>{const d=r[0];d&&(n.value={width:d.borderBoxSize[0].inlineSize,height:d.borderBoxSize[0].blockSize})});let l=!1;return t.onMounted(()=>{l=!0,e.value&&o.observe(e.value)}),t.onUnmounted(()=>{l=!1,o.disconnect()}),t.watch(e,r=>{l&&(o.disconnect(),n.value={width:void 0,height:void 0},r&&o.observe(r))}),n}const Qa=t.defineComponent({name:"CdxDialog",components:{CdxButton:fe,CdxIcon:G},inheritAttrs:!1,props:{open:{type:Boolean,default:!1},title:{type:String,required:!0},subtitle:{type:String,required:!1,default:null},hideTitle:{type:Boolean,default:!1},useCloseButton:{type:Boolean,default:!1},closeButtonLabel:{type:String,default:""},primaryAction:{type:Object,default:null},defaultAction:{type:Object,default:null},stackedActions:{type:Boolean,default:!1},target:{type:String,default:null},renderInPlace:{type:Boolean,default:!1}},emits:["update:open","primary","default"],setup(e,{emit:n}){const o=q("dialog-label"),l=t.ref(),r=t.ref(),d=t.ref(),s=t.ref(),i=t.ref(),a=t.ref();let u=null;const c=t.computed(()=>e.useCloseButton||e.closeButtonLabel.length>0),p=Ge(t.toRef(e,"closeButtonLabel"),"cdx-dialog-close-button-label","Close"),f=t.computed(()=>!e.hideTitle||c.value),m=t.computed(()=>!!e.primaryAction||!!e.defaultAction),h=yn(d),v=t.computed(()=>{var T;return(T=h.value.height)!=null?T:0}),C=t.ref(!1),k=t.computed(()=>({"cdx-dialog--vertical-actions":e.stackedActions,"cdx-dialog--horizontal-actions":!e.stackedActions,"cdx-dialog--dividers":C.value})),B=t.inject("CdxTeleportTarget",void 0),w=t.computed(()=>{var T,_;return(_=(T=e.target)!=null?T:B)!=null?_:"body"}),I=t.ref(0);function x(){n("update:open",!1)}function D(){M(r.value)}function A(){M(r.value,!0)}function M(T,_=!1){let j=Array.from(T.querySelectorAll('\n input, select, textarea, button, object, a, area,\n [contenteditable], [tabindex]:not([tabindex^="-"])\n '));_&&(j=j.reverse());for(const W of j)if(W.focus(),document.activeElement===W)return!0;return!1}let b=[],y=[];function S(){let T=l.value;for(;T.parentElement&&T.nodeName!=="BODY";){for(const _ of Array.from(T.parentElement.children))_===T||_.nodeName==="SCRIPT"||(_.hasAttribute("aria-hidden")||(_.setAttribute("aria-hidden","true"),b.push(_)),_.hasAttribute("inert")||(_.setAttribute("inert",""),y.push(_)));T=T.parentElement}}function E(){for(const T of b)T.removeAttribute("aria-hidden");for(const T of y)T.removeAttribute("inert");b=[],y=[]}function R(){return ee(this,null,function*(){var T;yield t.nextTick(),I.value=window.innerWidth-document.documentElement.clientWidth,document.documentElement.style.setProperty("margin-right","".concat(I.value,"px")),document.body.classList.add("cdx-dialog-open"),S(),u=document.activeElement,M(d.value)||(T=s.value)==null||T.focus()})}function K(){document.body.classList.remove("cdx-dialog-open"),document.documentElement.style.removeProperty("margin-right"),E(),u instanceof HTMLElement&&document.contains(u)&&(u.focus(),u=null)}return t.onMounted(()=>{e.open&&R()}),t.onUnmounted(()=>{e.open&&K()}),t.watch(t.toRef(e,"open"),T=>{T?R():K()}),t.watch(v,()=>{d.value&&(C.value=d.value.clientHeight[e.open?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"backdrop",class:"cdx-dialog-backdrop",onClick:n[5]||(n[5]=(...a)=>e.close&&e.close(...a)),onKeyup:n[6]||(n[6]=t.withKeys((...a)=>e.close&&e.close(...a),["escape"]))},[t.createElementVNode("div",{ref:"focusTrapStart",tabindex:"0",onFocus:n[0]||(n[0]=(...a)=>e.focusLast&&e.focusLast(...a))},null,544),t.createElementVNode("div",t.mergeProps({ref:"dialogElement",class:["cdx-dialog",e.rootClasses],role:"dialog"},e.$attrs,{"aria-label":e.$slots.header||e.hideTitle?e.title:void 0,"aria-labelledby":!e.$slots.header&&!e.hideTitle?e.labelId:void 0,"aria-modal":"true",onClick:n[3]||(n[3]=t.withModifiers(()=>{},["stop"]))}),[e.showHeader||e.$slots.header?(t.openBlock(),t.createElementBlock("header",{key:0,class:t.normalizeClass(["cdx-dialog__header",{"cdx-dialog__header--default":!e.$slots.header}])},[t.renderSlot(e.$slots,"header",{},()=>[e.hideTitle?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("div",Ya,[t.createElementVNode("h2",{id:e.labelId,class:"cdx-dialog__header__title"},t.toDisplayString(e.title),9,Xa),e.subtitle?(t.openBlock(),t.createElementBlock("p",Ja,t.toDisplayString(e.subtitle),1)):t.createCommentVNode("v-if",!0)])),e.useCloseButtonOrLabel?(t.openBlock(),t.createBlock(i,{key:1,class:"cdx-dialog__header__close-button",weight:"quiet",type:"button","aria-label":e.translatedCloseButtonLabel,onClick:e.close},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.cdxIconClose},null,8,["icon"])]),_:1},8,["aria-label","onClick"])):t.createCommentVNode("v-if",!0)])],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",Za,null,512),t.createElementVNode("div",{ref:"dialogBody",class:t.normalizeClass(["cdx-dialog__body",{"cdx-dialog__body--no-header":!(e.showHeader||e.$slots.header),"cdx-dialog__body--no-footer":!(e.showFooterActions||e.$slots.footer||e.$slots["footer-text"])}])},[t.renderSlot(e.$slots,"default")],2),e.showFooterActions||e.$slots.footer||e.$slots["footer-text"]?(t.openBlock(),t.createElementBlock("footer",{key:1,class:t.normalizeClass(["cdx-dialog__footer",{"cdx-dialog__footer--default":!e.$slots.footer}])},[t.renderSlot(e.$slots,"footer",{},()=>[e.$slots["footer-text"]?(t.openBlock(),t.createElementBlock("p",es,[t.renderSlot(e.$slots,"footer-text")])):t.createCommentVNode("v-if",!0),e.showFooterActions?(t.openBlock(),t.createElementBlock("div",ts,[e.primaryAction?(t.openBlock(),t.createBlock(i,{key:0,class:"cdx-dialog__footer__primary-action",weight:"primary",action:e.primaryAction.actionType,disabled:e.primaryAction.disabled,onClick:n[1]||(n[1]=a=>e.$emit("primary"))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.primaryAction.label),1)]),_:1},8,["action","disabled"])):t.createCommentVNode("v-if",!0),e.defaultAction?(t.openBlock(),t.createBlock(i,{key:1,class:"cdx-dialog__footer__default-action",disabled:e.defaultAction.disabled,onClick:n[2]||(n[2]=a=>e.$emit("default"))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.defaultAction.label),1)]),_:1},8,["disabled"])):t.createCommentVNode("v-if",!0)])):t.createCommentVNode("v-if",!0)])],2)):t.createCommentVNode("v-if",!0)],16,Ga),t.createElementVNode("div",{ref:"focusTrapEnd",tabindex:"0",onFocus:n[4]||(n[4]=(...a)=>e.focusFirst&&e.focusFirst(...a))},null,544)],544)):t.createCommentVNode("v-if",!0)]),_:3})],8,["to","disabled"])}const os=O(Qa,[["render",ns]]),ls={notice:Lt,error:Mt,warning:At,success:Ft},as=t.defineComponent({name:"CdxMessage",components:{CdxButton:fe,CdxIcon:G},props:{type:{type:String,default:"notice",validator:Ot},inline:{type:Boolean,default:!1},icon:{type:[String,Object],default:null},fadeIn:{type:Boolean,default:!1},allowUserDismiss:{type:Boolean,default:!1},dismissButtonLabel:{type:String,default:""},autoDismiss:{type:[Boolean,Number],default:!1,validator:e=>typeof e=="boolean"||typeof e=="number"&&e>0}},emits:["user-dismissed","auto-dismissed"],setup(e,{emit:n}){const o=t.ref(!1),l=t.computed(()=>e.inline===!1&&(e.dismissButtonLabel.length>0||e.allowUserDismiss)),r=Ge(t.toRef(e,"dismissButtonLabel"),"cdx-message-dismiss-button-label","Close"),d=t.computed(()=>e.autoDismiss===!1||e.type==="error"?!1:e.autoDismiss===!0?4e3:e.autoDismiss),s=t.computed(()=>({"cdx-message--inline":e.inline,"cdx-message--block":!e.inline,"cdx-message--user-dismissable":l.value,["cdx-message--".concat(e.type)]:!0})),i=t.computed(()=>e.icon&&e.type==="notice"?e.icon:ls[e.type]),a=t.ref("");function u(c){o.value||(a.value=c==="user-dismissed"?"cdx-message-leave-active-user":"cdx-message-leave-active-system",o.value=!0,n(c))}return t.onMounted(()=>{e.type==="error"&&e.autoDismiss!==!1?t.warn('CdxMessage: Message with type="error" cannot use auto-dismiss'):d.value&&setTimeout(()=>u("auto-dismissed"),d.value)}),{dismissed:o,userDismissable:l,translatedDismissButtonLabel:r,rootClasses:s,leaveActiveClass:a,computedIcon:i,onDismiss:u,cdxIconClose:dt}}}),ss=["aria-live","role"],is={class:"cdx-message__content"};function rs(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createBlock(t.Transition,{name:"cdx-message",appear:e.fadeIn,"leave-active-class":e.leaveActiveClass},{default:t.withCtx(()=>[e.dismissed?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["cdx-message",e.rootClasses]),"aria-live":e.type!=="error"?"polite":void 0,role:e.type==="error"?"alert":void 0},[t.createVNode(s,{class:"cdx-message__icon--vue",icon:e.computedIcon},null,8,["icon"]),t.createElementVNode("div",is,[t.renderSlot(e.$slots,"default")]),e.userDismissable?(t.openBlock(),t.createBlock(i,{key:0,class:"cdx-message__dismiss-button",weight:"quiet",type:"button","aria-label":e.translatedDismissButtonLabel,onClick:n[0]||(n[0]=a=>e.onDismiss("user-dismissed"))},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.cdxIconClose},null,8,["icon"])]),_:1},8,["aria-label"])):t.createCommentVNode("v-if",!0)],10,ss))]),_:3},8,["appear","leave-active-class"])}const Cn=O(as,[["render",rs]]),ds=J(ue),us=t.defineComponent({name:"CdxField",components:{CdxLabel:Me,CdxMessage:Cn},props:{labelIcon:{type:[String,Object],default:""},optional:{type:Boolean,default:!1},optionalFlag:{type:String,default:""},hideLabel:{type:Boolean,default:!1},isFieldset:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},status:{type:String,default:"default",validator:ds},messages:{type:Object,default:()=>({})}},setup(e,{slots:n}){const{disabled:o,status:l,isFieldset:r}=t.toRefs(e),d=ct(o),s=t.computed(()=>({"cdx-field--disabled":d.value,"cdx-field--is-fieldset":r.value})),i=q("label"),a=q("description"),u=q("input"),c=t.computed(()=>r.value?void 0:u);t.provide(Ht,c);const p=t.computed(()=>!r.value&&n.description?a:void 0);t.provide(qe,p),t.provide(jt,d),t.provide(Ut,l);const f=t.computed(()=>e.status!=="default"&&e.status in e.messages?e.messages[e.status]:""),m=t.computed(()=>e.status==="default"?"notice":e.status);return{rootClasses:s,computedDisabled:d,labelId:i,descriptionId:a,inputId:u,validationMessage:f,validationMessageType:m}}}),cs={class:"cdx-field__control"},ps={class:"cdx-field__help-text"},fs={key:0,class:"cdx-field__validation-message"};function ms(e,n,o,l,r,d){const s=t.resolveComponent("cdx-label"),i=t.resolveComponent("cdx-message");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isFieldset?"fieldset":"div"),{class:t.normalizeClass(["cdx-field",e.rootClasses]),"aria-disabled":!e.isFieldset&&e.computedDisabled?!0:void 0,disabled:e.isFieldset&&e.computedDisabled?!0:void 0},{default:t.withCtx(()=>[t.createVNode(s,{id:e.labelId,icon:e.labelIcon,"visually-hidden":e.hideLabel,optional:e.optional,"optional-flag":e.optionalFlag,"input-id":e.inputId,"description-id":e.descriptionId,disabled:e.computedDisabled,"is-legend":e.isFieldset},t.createSlots({default:t.withCtx(()=>[t.renderSlot(e.$slots,"label")]),_:2},[e.$slots.description&&e.$slots.description().length>0?{name:"description",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"description")]),key:"0"}:void 0]),1032,["id","icon","visually-hidden","optional","optional-flag","input-id","description-id","disabled","is-legend"]),t.createElementVNode("div",cs,[t.renderSlot(e.$slots,"default")]),t.createElementVNode("div",ps,[t.renderSlot(e.$slots,"help-text")]),!e.computedDisabled&&e.validationMessage||e.$slots[e.validationMessageType]?(t.openBlock(),t.createElementBlock("div",fs,[t.createVNode(i,{type:e.validationMessageType,inline:!0},{default:t.withCtx(()=>[e.status==="warning"&&e.$slots.warning?t.renderSlot(e.$slots,"warning",{key:0}):e.status==="error"&&e.$slots.error?t.renderSlot(e.$slots,"error",{key:1}):e.status==="success"&&e.$slots.success?t.renderSlot(e.$slots,"success",{key:2}):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createTextVNode(t.toDisplayString(e.validationMessage),1)],64))]),_:3},8,["type"])])):t.createCommentVNode("v-if",!0)]),_:3},8,["class","aria-disabled","disabled"])}const hs=O(us,[["render",ms]]),vs={notice:Lt,error:Mt,warning:At,success:Ft},gs=t.defineComponent({name:"CdxInfoChip",components:{CdxIcon:G},props:{status:{type:String,default:"notice",validator:Ot},icon:{type:[String,Object],default:null}},setup(e){const n=t.computed(()=>({["cdx-info-chip--".concat(e.status)]:!0})),o=t.computed(()=>e.status==="notice"?e.icon:vs[e.status]);return{rootClasses:n,computedIcon:o}}}),bs={class:"cdx-info-chip__text"};function ys(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-info-chip",e.rootClasses])},[e.computedIcon?(t.openBlock(),t.createBlock(s,{key:0,class:"cdx-info-chip__icon--vue",icon:e.computedIcon},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",bs,[t.renderSlot(e.$slots,"default")])],2)}const Cs=O(gs,[["render",ys]]),ws=J(ue),ks=t.defineComponent({name:"CdxLookup",components:{CdxMenu:we,CdxTextInput:Xe},inheritAttrs:!1,props:{selected:{type:[String,Number,null],required:!0},menuItems:{type:Array,required:!0},inputValue:{type:[String,Number],default:null},initialInputValue:{type:[String,Number],default:"",validator:e=>(e&&console.warn("CdxLookup: prop initialInputValue is deprecated. Use inputValue instead."),!0)},disabled:{type:Boolean,default:!1},menuConfig:{type:Object,default:()=>({})},status:{type:String,default:"default",validator:ws}},emits:["update:selected","update:input-value","load-more","input","change","focus","blur"],setup:(e,{emit:n,attrs:o,slots:l})=>{const r=t.ref(),d=t.ref(),s=t.ref(),i=q("lookup-menu"),a=t.ref(!1),u=t.ref(!1),c=t.ref(!1),p=t.ref(e.menuItems),{computedDisabled:f,computedStatus:m}=oe(t.toRef(e,"disabled"),t.toRef(e,"status")),h=t.toRef(e,"selected"),v=te(h,n,"update:selected"),C=t.computed(()=>{var E;return(E=s.value)==null?void 0:E.getComputedMenuItems().find(R=>R.value===v.value)}),k=t.computed(()=>{var E,R;return(R=(E=s.value)==null?void 0:E.getHighlightedMenuItem())==null?void 0:R.id}),B=t.ref(e.initialInputValue),w=Ye(B,t.toRef(e,"inputValue"),n,"update:input-value"),I=t.computed(()=>({"cdx-lookup--disabled":f.value,"cdx-lookup--pending":a.value})),{rootClasses:x,rootStyle:D,otherAttrs:A}=le(o,I);function M(E){C.value?C.value.label!==E&&C.value.value!==E&&(v.value=null):e.selected!==null&&e.selected!==E&&(v.value=null),E===""&&p.value.length===0?(u.value=!1,a.value=!1):a.value=!0,n("input",E)}function b(E){c.value=!0;const R=w.value!==null&&w.value!=="";!!(e.menuItems.length>0||l["no-results"])&&(R||p.value.length>0)&&(u.value=!0),n("focus",E)}function y(E){c.value=!1,u.value=!1,n("blur",E)}function S(E){!s.value||f.value||e.menuItems.length===0&&!l["no-results"]||E.key===" "||s.value.delegateKeyNavigation(E)}return Ve(d,s),t.watch(v,E=>{var R;if(E!==null){const K=C.value?(R=C.value.label)!=null?R:C.value.value:"";w.value!==K&&(w.value=K,n("input",K))}}),t.watch(t.toRef(e,"menuItems"),E=>{c.value&&a.value&&(E.length>0||l["no-results"])&&(u.value=!0),E.length===0&&!l["no-results"]&&(u.value=!1),a.value=!1}),{rootElement:r,textInput:d,menu:s,menuId:i,highlightedId:k,computedInputValue:w,selection:v,expanded:u,computedDisabled:f,computedStatus:m,onInputBlur:y,rootClasses:x,rootStyle:D,otherAttrs:A,onUpdateInput:M,onInputFocus:b,onKeydown:S}}});function $s(e,n,o,l,r,d){const s=t.resolveComponent("cdx-text-input"),i=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-lookup",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createVNode(s,t.mergeProps({ref:"textInput",modelValue:e.computedInputValue,"onUpdate:modelValue":n[0]||(n[0]=a=>e.computedInputValue=a)},e.otherAttrs,{class:"cdx-lookup__input",role:"combobox",autocomplete:"off","aria-autocomplete":"list","aria-controls":e.menuId,"aria-expanded":e.expanded,"aria-activedescendant":e.highlightedId,disabled:e.computedDisabled,status:e.computedStatus,"onUpdate:modelValue":e.onUpdateInput,onChange:n[1]||(n[1]=a=>e.$emit("change",a)),onFocus:e.onInputFocus,onBlur:e.onInputBlur,onKeydown:e.onKeydown}),null,16,["modelValue","aria-controls","aria-expanded","aria-activedescendant","disabled","status","onUpdate:modelValue","onFocus","onBlur","onKeydown"]),t.createVNode(i,t.mergeProps({id:e.menuId,ref:"menu",selected:e.selection,"onUpdate:selected":n[2]||(n[2]=a=>e.selection=a),expanded:e.expanded,"onUpdate:expanded":n[3]||(n[3]=a=>e.expanded=a),"menu-items":e.menuItems},e.menuConfig,{onLoadMore:n[4]||(n[4]=a=>e.$emit("load-more"))}),{default:t.withCtx(({menuItem:a})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:a})]),"no-results":t.withCtx(()=>[t.renderSlot(e.$slots,"no-results")]),_:3},16,["id","selected","expanded","menu-items"])],6)}const Bs=O(ks,[["render",$s]]),Ss=t.defineComponent({name:"CdxToggleButton",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},quiet:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:n,slots:o,attrs:l}){const r=Qt(o.default,l,"CdxToggleButton"),d=t.ref(!1),s=t.computed(()=>({"cdx-toggle-button--quiet":e.quiet,"cdx-toggle-button--framed":!e.quiet,"cdx-toggle-button--toggled-on":e.modelValue,"cdx-toggle-button--toggled-off":!e.modelValue,"cdx-toggle-button--icon-only":r.value,"cdx-toggle-button--is-active":d.value})),i=()=>{n("update:modelValue",!e.modelValue)},a=p=>{d.value=p};function u(){a(!0)}function c(){a(!1),i()}return{rootClasses:s,onClick:i,onKeyDown:u,onKeyUp:c}}}),Is=["aria-pressed","disabled"];function xs(e,n,o,l,r,d){return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["cdx-toggle-button",e.rootClasses]),"aria-pressed":e.modelValue,disabled:e.disabled,type:"button",onClick:n[0]||(n[0]=(...s)=>e.onClick&&e.onClick(...s)),onKeydown:n[1]||(n[1]=t.withKeys(t.withModifiers((...s)=>e.onKeyDown&&e.onKeyDown(...s),["prevent"]),["space","enter"])),onKeyup:n[2]||(n[2]=t.withKeys((...s)=>e.onKeyUp&&e.onKeyUp(...s),["space","enter"]))},[t.renderSlot(e.$slots,"default")],42,Is)}const bt=O(Ss,[["render",xs]]),Vs=t.defineComponent({name:"CdxMenuButton",components:{CdxToggleButton:bt,CdxMenu:we},inheritAttrs:!1,props:{selected:{type:[String,Number,null],required:!0},menuItems:{type:Array,required:!0},menuConfig:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},footer:{type:Object,default:null}},emits:["update:selected"],setup(e,{emit:n,attrs:o}){const l=t.ref(),r=t.ref(),d=t.toRef(e,"selected"),s=te(d,n,"update:selected"),i=t.ref(!1),a=q("menuToggle"),u=q("menu"),{computedDisabled:c}=oe(t.toRef(e,"disabled")),{rootClasses:p,rootStyle:f,otherAttrs:m}=le(o);function h(v){!l.value||c.value||e.menuItems.length===0||v.key===" "||l.value.delegateKeyNavigation(v)}return Ve(r,l,{useAvailableWidth:!0,placement:"bottom-start",offset:4}),{computedDisabled:c,expanded:i,menu:l,menuId:u,modelWrapper:s,onKeydown:h,toggle:r,toggleId:a,rootClasses:p,rootStyle:f,otherAttrs:m}}}),Es={class:"cdx-menu-button__menu-wrapper"};function Ns(e,n,o,l,r,d){const s=t.resolveComponent("cdx-toggle-button"),i=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-menu-button",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createVNode(s,t.mergeProps({id:e.toggleId,ref:"toggle"},e.otherAttrs,{modelValue:e.expanded,"onUpdate:modelValue":n[0]||(n[0]=a=>e.expanded=a),disabled:e.computedDisabled,quiet:"","aria-haspopup":"menu","aria-controls":e.menuId,"aria-expanded":e.expanded,onBlur:n[1]||(n[1]=a=>e.expanded=!1),onKeydown:e.onKeydown}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["id","modelValue","disabled","aria-controls","aria-expanded","onKeydown"]),t.createElementVNode("div",Es,[t.createVNode(i,t.mergeProps({id:e.menuId,ref:"menu",selected:e.modelWrapper,"onUpdate:selected":n[2]||(n[2]=a=>e.modelWrapper=a),expanded:e.expanded,"onUpdate:expanded":n[3]||(n[3]=a=>e.expanded=a),"menu-items":e.menuItems},e.menuConfig,{role:"menu","aria-labelledby":e.toggleId,footer:e.footer}),{default:t.withCtx(({menuItem:a})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:a})]),_:3},16,["id","selected","expanded","menu-items","aria-labelledby","footer"])])],6)}const As=O(Vs,[["render",Ns]]),Ms=J(ue),Ds=t.defineComponent({name:"CdxMultiselectLookup",components:{CdxChipInput:Jt,CdxMenu:we},props:{inputChips:{type:Array,required:!0},selected:{type:[Array],required:!0},menuItems:{type:Array,required:!0},inputValue:{type:[String,Number],default:null},separateInput:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},status:{type:String,default:"default",validator:Ms},menuConfig:{type:Object,default:()=>({})}},emits:["update:input-chips","update:selected","update:input-value","load-more","input","change","focus","blur"],setup:(e,{emit:n,attrs:o,slots:l})=>{const r=t.ref(),d=t.ref(),s=q("multiselect-lookup-menu"),i=t.computed(()=>{var y,S;return(S=(y=d.value)==null?void 0:y.getHighlightedMenuItem())==null?void 0:S.id}),a=t.ref(!1),u=t.ref(!1),c=t.ref(!1);t.provide(Pt,t.ref(!1));const{computedDisabled:p,computedStatus:f}=oe(t.toRef(e,"disabled"),t.toRef(e,"status")),m=t.computed(()=>({"cdx-multiselect-lookup--disabled":p.value,"cdx-multiselect-lookup--pending":a.value})),{rootClasses:h,rootStyle:v,otherAttrs:C}=le(o,m);Ve(r,d);const k=te(t.toRef(e,"selected"),n,"update:selected"),B=te(t.toRef(e,"inputChips"),n,"update:input-chips"),w=t.ref(""),I=Ye(w,t.toRef(e,"inputValue"),n,"update:input-value"),x=t.computed(()=>I.value.toString().length>0&&l["no-results"]);function D(y){return ee(this,null,function*(){yield t.nextTick(),a.value=y!==null&&y!=="",n("input",y)})}function A(y){c.value=!0,(e.menuItems.length>0||x.value)&&(u.value=!0),n("focus",y)}function M(y){c.value=!1,u.value=!1,n("blur",y)}function b(y){!d.value||p.value||e.menuItems.length===0&&!x.value||y.key===" "||d.value.delegateKeyNavigation(y)}return t.watch(t.toRef(e,"selected"),y=>{const S=y.filter(E=>B.value.find(R=>E===R.value)===void 0);S.length>0&&(S.forEach(E=>{var K;const R=(K=d.value)==null?void 0:K.getComputedMenuItems().find(_=>_.value===E);if(R){const T=R,{id:_}=T,j=re(T,["id"]);B.value.push(j)}}),I.value="",n("input","")),B.value=B.value.filter(E=>y.find(R=>E.value===R)!==void 0)}),t.watch(t.toRef(e,"inputChips"),y=>{y.lengthS.value))}),t.watch(t.toRef(e,"menuItems"),y=>{y.length===0&&!x.value?u.value=!1:c.value&&a.value&&(u.value=!0),a.value=!1}),{chipInput:r,menu:d,menuId:s,highlightedId:i,expanded:u,computedDisabled:p,computedStatus:f,rootClasses:h,rootStyle:v,otherAttrs:C,selectedWrapper:k,inputChipsWrapper:B,computedInputValue:I,onUpdateInputValue:D,onInputBlur:M,onInputFocus:A,onKeydown:b}}});function Ls(e,n,o,l,r,d){const s=t.resolveComponent("cdx-chip-input"),i=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-multiselect-lookup",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createVNode(s,t.mergeProps({ref:"chipInput","input-chips":e.inputChipsWrapper,"onUpdate:inputChips":n[0]||(n[0]=a=>e.inputChipsWrapper=a),"input-value":e.computedInputValue,"onUpdate:inputValue":n[1]||(n[1]=a=>e.computedInputValue=a)},e.otherAttrs,{class:"cdx-multiselect-lookup__chip-input",role:"combobox",autocomplete:"off","aria-autocomplete":"list","aria-controls":e.menuId,"aria-expanded":e.expanded,"aria-activedescendant":e.highlightedId,"separate-input":e.separateInput,disabled:e.computedDisabled,status:e.computedStatus,"disallow-arbitrary":!0,"onUpdate:inputValue":e.onUpdateInputValue,onFocus:e.onInputFocus,onBlur:e.onInputBlur,onKeydown:e.onKeydown}),null,16,["input-chips","input-value","aria-controls","aria-expanded","aria-activedescendant","separate-input","disabled","status","onUpdate:inputValue","onFocus","onBlur","onKeydown"]),t.createVNode(i,t.mergeProps({id:e.menuId,ref:"menu",selected:e.selectedWrapper,"onUpdate:selected":n[2]||(n[2]=a=>e.selectedWrapper=a),expanded:e.expanded,"onUpdate:expanded":n[3]||(n[3]=a=>e.expanded=a),"menu-items":e.menuItems},e.menuConfig,{onLoadMore:n[4]||(n[4]=a=>e.$emit("load-more"))}),{default:t.withCtx(({menuItem:a})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:a})]),"no-results":t.withCtx(()=>[t.renderSlot(e.$slots,"no-results")]),_:3},16,["id","selected","expanded","menu-items"])],6)}const Ts=O(Ds,[["render",Ls]]),Rs=J(ue),Fs=t.defineComponent({name:"CdxRadio",components:{CdxLabel:Me},props:{modelValue:{type:[String,Number,Boolean],default:""},inputValue:{type:[String,Number,Boolean],default:!1},name:{type:String,required:!0},disabled:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},status:{type:String,default:"default",validator:Rs}},emits:["update:modelValue"],setup(e,{emit:n,slots:o,attrs:l}){var m;pt((m=o.default)==null?void 0:m.call(o),l,"CdxRadio");const{computedDisabled:r,computedStatus:d}=oe(t.toRef(e,"disabled"),t.toRef(e,"status")),s=t.computed(()=>({"cdx-radio--inline":e.inline,["cdx-radio--status-".concat(d.value)]:!0})),i=t.computed(()=>({"cdx-radio__custom-input--inline":e.inline})),a=t.ref(),u=q("radio"),c=q("description"),p=()=>{a.value.focus()},f=te(t.toRef(e,"modelValue"),n);return{rootClasses:s,computedDisabled:r,input:a,radioId:u,descriptionId:c,focusInput:p,wrappedModel:f,customInputClasses:i}}}),_s={class:"cdx-radio__wrapper"},Os=["id","aria-describedby","name","value","disabled"],zs=t.createElementVNode("span",{class:"cdx-radio__icon"},null,-1);function Ks(e,n,o,l,r,d){const s=t.resolveComponent("cdx-label");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-radio",e.rootClasses])},[t.createElementVNode("div",_s,[t.withDirectives(t.createElementVNode("input",{id:e.radioId,ref:"input","onUpdate:modelValue":n[0]||(n[0]=i=>e.wrappedModel=i),class:"cdx-radio__input",type:"radio","aria-describedby":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,name:e.name,value:e.inputValue,disabled:e.computedDisabled},null,8,Os),[[t.vModelRadio,e.wrappedModel]]),zs,e.$slots.default&&e.$slots.default().length?(t.openBlock(),t.createBlock(s,{key:0,class:"cdx-radio__label","input-id":e.radioId,"description-id":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,disabled:e.computedDisabled,onClick:e.focusInput},t.createSlots({default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:2},[e.$slots.description&&e.$slots.description().length>0?{name:"description",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"description")]),key:"0"}:void 0]),1032,["input-id","description-id","disabled","onClick"])):t.createCommentVNode("v-if",!0)]),e.$slots["custom-input"]?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["cdx-radio__custom-input",e.customInputClasses])},[t.renderSlot(e.$slots,"custom-input")],2)):t.createCommentVNode("v-if",!0)],2)}const Ps=O(Fs,[["render",Ks]]),Hs=J(ue),Us=t.defineComponent({name:"CdxSearchInput",components:{CdxButton:fe,CdxTextInput:Xe},inheritAttrs:!1,props:{modelValue:{type:[String,Number],default:""},useButton:{type:Boolean,default:!1},buttonLabel:{type:String,default:""},disabled:{type:Boolean,default:!1},status:{type:String,default:"default",validator:Hs}},emits:["update:modelValue","submit-click","input","change","focus","blur"],setup(e,{emit:n,attrs:o}){const l=te(t.toRef(e,"modelValue"),n),{computedDisabled:r}=oe(t.toRef(e,"disabled")),d=t.computed(()=>({"cdx-search-input--has-end-button":!!e.buttonLabel||e.useButton})),{rootClasses:s,rootStyle:i,otherAttrs:a}=le(o,d),u=Ge(t.toRef(e,"buttonLabel"),"cdx-search-input-search-button-label","Search"),c=t.computed(()=>e.useButton||e.buttonLabel.length>0);return{wrappedModel:l,computedDisabled:r,rootClasses:s,rootStyle:i,otherAttrs:a,handleSubmit:()=>{n("submit-click",l.value)},searchIcon:Zn,translatedSearchButtonLabel:u,useButtonOrLabel:c}},methods:{focus(){this.$refs.textInput.focus()}}}),js={class:"cdx-search-input__input-wrapper"};function qs(e,n,o,l,r,d){const s=t.resolveComponent("cdx-text-input"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-search-input",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("div",js,[t.createVNode(s,t.mergeProps({ref:"textInput",modelValue:e.wrappedModel,"onUpdate:modelValue":n[0]||(n[0]=a=>e.wrappedModel=a),class:"cdx-search-input__text-input","input-type":"search","start-icon":e.searchIcon,disabled:e.computedDisabled,status:e.status},e.otherAttrs,{onKeydown:t.withKeys(e.handleSubmit,["enter"]),onInput:n[1]||(n[1]=a=>e.$emit("input",a)),onChange:n[2]||(n[2]=a=>e.$emit("change",a)),onFocus:n[3]||(n[3]=a=>e.$emit("focus",a)),onBlur:n[4]||(n[4]=a=>e.$emit("blur",a))}),null,16,["modelValue","start-icon","disabled","status","onKeydown"]),t.renderSlot(e.$slots,"default")]),e.useButtonOrLabel?(t.openBlock(),t.createBlock(i,{key:0,class:"cdx-search-input__end-button",disabled:e.computedDisabled,onClick:e.handleSubmit},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.translatedSearchButtonLabel),1)]),_:1},8,["disabled","onClick"])):t.createCommentVNode("v-if",!0)],6)}const wn=O(Us,[["render",qs]]),Ws=J(ue),Qs=t.defineComponent({name:"CdxSelect",components:{CdxIcon:G,CdxMenu:we},inheritAttrs:!1,props:{menuItems:{type:Array,required:!0},selected:{type:[String,Number,null],required:!0},defaultLabel:{type:String,default:""},disabled:{type:Boolean,default:!1},menuConfig:{type:Object,default:()=>({})},defaultIcon:{type:[String,Object],default:void 0},status:{type:String,default:"default",validator:Ws}},emits:["update:selected","load-more"],setup(e,{emit:n,attrs:o}){const l=t.ref(),r=t.ref(),d=t.inject(qe,void 0),s=q("select-menu"),i=t.ref(!1),a=o.id||q("select-handle"),{computedDisabled:u,computedStatus:c,computedInputId:p}=oe(t.toRef(e,"disabled"),t.toRef(e,"status"),a),f=te(t.toRef(e,"selected"),n,"update:selected"),m=t.computed(()=>{var b;return(b=r.value)==null?void 0:b.getComputedMenuItems().find(y=>y.value===e.selected)}),h=t.computed(()=>{var b;return m.value?(b=m.value.label)!=null?b:m.value.value:e.defaultLabel}),v=t.computed(()=>{var b;if(e.defaultIcon&&!m.value)return e.defaultIcon;if((b=m.value)!=null&&b.icon)return m.value.icon}),C=t.computed(()=>({"cdx-select-vue--enabled":!u.value,"cdx-select-vue--disabled":u.value,"cdx-select-vue--expanded":i.value,"cdx-select-vue--value-selected":!!m.value,"cdx-select-vue--no-selections":!m.value,"cdx-select-vue--has-start-icon":!!v.value,["cdx-select-vue--status-".concat(c.value)]:!0})),{rootClasses:k,rootStyle:B,otherAttrs:w}=le(o,C),I=t.computed(()=>{const S=w.value,{id:b}=S;return re(S,["id"])}),x=t.computed(()=>{var b,y;return(y=(b=r.value)==null?void 0:b.getHighlightedMenuItem())==null?void 0:y.id});function D(){i.value=!1}function A(){var b;u.value||(i.value=!i.value,(b=l.value)==null||b.focus())}function M(b){var y;u.value||(y=r.value)==null||y.delegateKeyNavigation(b,{characterNavigation:!0})}return Ve(l,r),{handle:l,menu:r,computedHandleId:p,descriptionId:d,menuId:s,modelWrapper:f,selectedMenuItem:m,highlightedId:x,expanded:i,computedDisabled:u,onBlur:D,currentLabel:h,rootClasses:k,rootStyle:B,otherAttrsMinusId:I,onClick:A,onKeydown:M,startIcon:v,cdxIconExpand:Dt}}}),Gs=["aria-disabled"],Ys=["id","aria-controls","aria-activedescendant","aria-expanded","aria-describedby"];function Xs(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-select-vue",e.rootClasses]),style:t.normalizeStyle(e.rootStyle),"aria-disabled":e.computedDisabled},[t.createElementVNode("div",t.mergeProps({id:e.computedHandleId,ref:"handle",class:"cdx-select-vue__handle"},e.otherAttrsMinusId,{tabindex:"0",role:"combobox","aria-controls":e.menuId,"aria-activedescendant":e.highlightedId,"aria-expanded":e.expanded,"aria-describedby":e.descriptionId,onClick:n[0]||(n[0]=(...a)=>e.onClick&&e.onClick(...a)),onBlur:n[1]||(n[1]=(...a)=>e.onBlur&&e.onBlur(...a)),onKeydown:n[2]||(n[2]=(...a)=>e.onKeydown&&e.onKeydown(...a))}),[t.renderSlot(e.$slots,"label",{selectedMenuItem:e.selectedMenuItem,defaultLabel:e.defaultLabel},()=>[t.createTextVNode(t.toDisplayString(e.currentLabel),1)]),e.startIcon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.startIcon,class:"cdx-select-vue__start-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createVNode(s,{icon:e.cdxIconExpand,class:"cdx-select-vue__indicator"},null,8,["icon"])],16,Ys),t.createVNode(i,t.mergeProps({id:e.menuId,ref:"menu",selected:e.modelWrapper,"onUpdate:selected":n[3]||(n[3]=a=>e.modelWrapper=a),expanded:e.expanded,"onUpdate:expanded":n[4]||(n[4]=a=>e.expanded=a),"menu-items":e.menuItems},e.menuConfig,{onLoadMore:n[5]||(n[5]=a=>e.$emit("load-more"))}),{default:t.withCtx(({menuItem:a})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:a})]),_:3},16,["id","selected","expanded","menu-items"])],14,Gs)}const kn=O(Qs,[["render",Xs]]),Js=t.defineComponent({name:"CdxTablePager",components:{CdxButton:fe,CdxIcon:G,CdxSelect:kn},props:{paginationSizeOptions:{type:Array,required:!0},itemsPerPage:{type:Number,required:!0},nextDisabled:{type:Boolean,default:!1},prevDisabled:{type:Boolean,default:!1},lastDisabled:{type:Boolean,default:!1}},emits:["update:itemsPerPage","first","last","next","prev"],setup(e,{emit:n}){const o=te(t.toRef(e,"itemsPerPage"),n,"update:itemsPerPage"),l=Q("cdx-table-pager-items-per-page-default","Results per page"),r=Q("cdx-table-pager-items-per-page-current",u=>"".concat(u," rows"),[o]),d=Q("cdx-table-pager-button-first-page","First page"),s=Q("cdx-table-pager-button-next-page","Next page"),i=Q("cdx-table-pager-button-prev-page","Previous page"),a=Q("cdx-table-pager-button-last-page","Last page");return{defaultItemsPerPageLabel:l,currentItemsPerPageLabel:r,btnLabelFirst:d,btnLabelNext:s,btnLabelPrev:i,btnLabelLast:a,wrappedItemsPerPage:o,cdxIconPrevious:Rt,cdxIconNext:Tt,cdxIconMoveFirst:Xn,cdxIconMoveLast:Jn}}}),Zs={class:"cdx-table-pager"},ei={class:"cdx-table-pager__start"},ti={key:0},ni={key:1},oi={class:"cdx-table-pager__center"},li={class:"cdx-table-pager__end"};function ai(e,n,o,l,r,d){const s=t.resolveComponent("cdx-select"),i=t.resolveComponent("cdx-icon"),a=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",Zs,[t.createElementVNode("div",ei,[t.createVNode(s,{selected:e.wrappedItemsPerPage,"onUpdate:selected":n[0]||(n[0]=u=>e.wrappedItemsPerPage=u),"default-label":e.defaultItemsPerPageLabel,"menu-items":e.paginationSizeOptions},{label:t.withCtx(({selectedMenuItem:u,defaultLabel:c})=>[u?(t.openBlock(),t.createElementBlock("span",ti,[t.createElementVNode("span",null,t.toDisplayString(e.currentItemsPerPageLabel),1)])):(t.openBlock(),t.createElementBlock("span",ni,t.toDisplayString(c),1))]),_:1},8,["selected","default-label","menu-items"])]),t.createElementVNode("div",oi,[t.renderSlot(e.$slots,"default")]),t.createElementVNode("div",li,[t.createVNode(a,{disabled:e.prevDisabled,class:"cdx-table-pager__button-first",weight:"quiet","aria-label":e.btnLabelFirst,onClick:n[1]||(n[1]=u=>e.$emit("first"))},{default:t.withCtx(()=>[t.createVNode(i,{icon:e.cdxIconMoveFirst},null,8,["icon"])]),_:1},8,["disabled","aria-label"]),t.createVNode(a,{disabled:e.prevDisabled,class:"cdx-table-pager__button-prev",weight:"quiet","aria-label":e.btnLabelPrev,onClick:n[2]||(n[2]=u=>e.$emit("prev"))},{default:t.withCtx(()=>[t.createVNode(i,{icon:e.cdxIconPrevious},null,8,["icon"])]),_:1},8,["disabled","aria-label"]),t.createVNode(a,{disabled:e.nextDisabled,class:"cdx-table-pager__button-next",weight:"quiet","aria-label":e.btnLabelNext,onClick:n[3]||(n[3]=u=>e.$emit("next"))},{default:t.withCtx(()=>[t.createVNode(i,{icon:e.cdxIconNext},null,8,["icon"])]),_:1},8,["disabled","aria-label"]),t.createVNode(a,{disabled:e.nextDisabled||e.lastDisabled,class:"cdx-table-pager__button-last",weight:"quiet","aria-label":e.btnLabelLast,onClick:n[4]||(n[4]=u=>e.$emit("last"))},{default:t.withCtx(()=>[t.createVNode(i,{icon:e.cdxIconMoveLast},null,8,["icon"])]),_:1},8,["disabled","aria-label"])])])}const si=O(Js,[["render",ai]]),ii=J(co),ri=J(ho),di={none:eo,asc:to,desc:Gn},ui={none:"none",asc:"ascending",desc:"descending"},ci=t.defineComponent({name:"CdxTable",components:{CdxCheckbox:Xt,CdxIcon:G,CdxTablePager:si,CdxProgressBar:ft},props:{caption:{type:String,required:!0},hideCaption:{type:Boolean,default:!1},columns:{type:Array,default:()=>[],validator:e=>{const n=e.map(l=>l.id);return new Set(n).size===n.length?!0:(console.warn('Each column in the "columns" prop of CdxTable must have a unique "id".'),!1)}},data:{type:Array,default:()=>[],validator:(e,n)=>{if(!Array.isArray(n.columns)||n.columns.length===0||e.length===0)return!0;const o=n.columns.some(r=>"allowSort"in r),l=e.every(r=>Ke in r);return o&&n.useRowSelection&&!l?(console.warn('For CdxTables with sorting and row selection, each row in the "data" prop must have a "TableRowIdentifier".'),!1):!0}},useRowHeaders:{type:Boolean,default:!1},showVerticalBorders:{type:Boolean,default:!1},useRowSelection:{type:Boolean,default:!1},selectedRows:{type:Array,default:()=>[]},sort:{type:Object,default:()=>({})},pending:{type:Boolean,default:!1},paginate:{type:Boolean,default:!1},serverPagination:{type:Boolean,default:!1},totalRows:{type:Number,default:NaN},paginationPosition:{type:String,default:"bottom",validator:ri},paginationSizeOptions:{type:Array,default:()=>[{value:10},{value:20},{value:50}],validator:e=>{const n=o=>typeof o.value=="number";return e.every(n)?!0:(console.warn('"value" property of all menu items in PaginationOptions must be a number.'),!1)}},paginationSizeDefault:{type:Number,default:e=>e.paginate&&e.serverPagination?e.data.length:e.paginationSizeOptions[0].value}},emits:["update:selectedRows","update:sort","load-more","last"],setup(e,{emit:n}){const o=t.ref(0),l=t.ref(e.paginationSizeDefault),r=t.computed(()=>e.serverPagination&&e.paginate?e.data:e.paginate?e.data.slice(o.value,l.value+o.value):e.data),d=t.computed(()=>{var V;return e.serverPagination?(V=e.totalRows)!=null?V:NaN:e.data.length}),s=t.computed(()=>isNaN(d.value)),i=t.computed(()=>r.value.length),a=t.computed(()=>o.value+1),u=t.computed(()=>o.value+i.value),c=t.computed(()=>s.value),p=t.computed(()=>o.value<=0),f=t.computed(()=>s.value?i.value=d.value),m=Q("cdx-table-pagination-status-message-determinate-short",(V,F,U)=>"".concat(V,"–").concat(F," of ").concat(U),[a,u,d]),h=Q("cdx-table-pagination-status-message-determinate-long",(V,F,U)=>"Showing results ".concat(V,"–").concat(F," of ").concat(U),[a,u,d]),v=Q("cdx-table-pagination-status-message-indeterminate-short",(V,F)=>"".concat(V,"–").concat(F," of many"),[a,u]),C=Q("cdx-table-pagination-status-message-indeterminate-long",(V,F)=>"Showing results ".concat(V,"–").concat(F," of many"),[a,u]),k=Q("cdx-table-pagination-status-message-indeterminate-final",V=>"Showing the last ".concat(V," results"),[i]),B=Q("cdx-table-pagination-status-message-pending","Loading results..."),w=t.computed(()=>e.pending?B.value:s.value&&f.value?k.value:s.value?v.value:m.value),I=t.computed(()=>e.pending?B.value:s.value&&f.value?k.value:s.value?C.value:h.value);function x(){o.value+=l.value,e.serverPagination&&n("load-more",o.value,l.value)}function D(){o.value-l.value<1?A():(o.value-=l.value,e.serverPagination&&n("load-more",o.value,l.value))}function A(){o.value=0,e.serverPagination&&n("load-more",o.value,l.value)}function M(){d.value%l.value===0?(o.value=d.value-l.value,n("load-more",o.value,l.value)):(o.value=Math.floor(d.value/l.value)*l.value,n("load-more",o.value,l.value))}t.watch(l,V=>{e.serverPagination&&n("load-more",o.value,V)});const b=te(t.toRef(e,"selectedRows"),n,"update:selectedRows"),y=t.ref(d.value===b.value.length),S=t.ref(!1),E=t.computed(()=>Object.keys(e.sort)[0]),R=t.computed(()=>e.columns.some(V=>V.allowSort)),K=t.computed(()=>{var F;return{"cdx-table__table--layout-fixed":(F=e.columns)==null?void 0:F.some(U=>"width"in U||"minWidth"in U),"cdx-table__table--borders-vertical":e.showVerticalBorders}}),T=Q("cdx-table-sort-caption",V=>"".concat(V," (column headers with buttons are sortable)."),[t.toRef(e,"caption")]),_=(V,F)=>Q("cdx-table-select-row-label",(U,g)=>"Select row ".concat(U," of ").concat(g),[()=>V,()=>F]).value,j=Q("cdx-table-select-all-label","Select all rows");function W(V,F){return Ke in V?V[Ke]:F}function ne(V,F){const U=W(V,F);return{"cdx-table__row--selected":b.value.indexOf(U)!==-1}}function me(V){const F=e.columns[0].id;if(e.useRowHeaders===!0&&V===F)return"row"}function $(V){const F=e.columns[0].id;return e.useRowHeaders&&V===F?"th":"td"}function L(V,F=!1){if("textAlign"in V&&!ii(V.textAlign)){console.warn("Invalid value for TableColumn textAlign property.");return}return{["cdx-table__table__cell--align-".concat(V.textAlign)]:"textAlign"in V&&V.textAlign!=="start","cdx-table__table__cell--has-sort":F}}function H(V){const F={};return"width"in V&&(F.width=V.width),"minWidth"in V&&(F.minWidth=V.minWidth),F}function Y(V){if(d.value===V.length){y.value=!0,S.value=!1;return}y.value=!1,d.value>V.length&&(S.value=!0),V.length===0&&(S.value=!1)}function et(V){S.value=!1,V?b.value=e.data.map((F,U)=>W(F,U)):b.value=[]}function tt(V){var g;const F=(g=e.sort[V])!=null?g:"none";let U="asc";F==="asc"&&(U="desc"),F==="desc"&&(U="none"),n("update:sort",{[V]:U})}function nt(V){var U;const F=(U=e.sort[V])!=null?U:"none";return di[F]}function ot(V,F=!1){var U;if(F){const g=(U=e.sort[V])!=null?U:"none";return g==="none"?void 0:ui[g]}}return{dataForDisplay:r,pageSize:l,onNext:x,onPrev:D,onFirst:A,onLast:M,nextDisabled:f,prevDisabled:p,lastDisabled:c,paginationStatusMessageShort:w,paginationStatusMessageLong:I,wrappedSelectedRows:b,selectAll:y,selectAllIndeterminate:S,activeSortColumn:E,hasSortableColumns:R,tableClasses:K,getRowKey:W,getRowClass:ne,getRowHeaderScope:me,getCellElement:$,getCellClass:L,getCellStyle:H,handleRowSelection:Y,handleSelectAll:et,handleSort:tt,getSortIcon:nt,getSortOrder:ot,translatedSortCaption:T,translatedSelectRowLabel:_,translatedSelectAllLabel:j}}}),pi={class:"cdx-table",tabindex:"0"},fi={key:0,class:"cdx-table__header"},mi=["aria-hidden"],hi={class:"cdx-table__header__content"},vi={class:"cdx-table__pagination-status--long"},gi={class:"cdx-table__pagination-status--short"},bi={class:"cdx-table__table-wrapper"},yi={key:0},Ci={key:0,class:"cdx-table__table__select-rows"},wi=["aria-sort"],ki=["aria-selected","onClick"],$i={class:"cdx-table__table__sort-label"},Bi={key:0},Si={key:0},Ii={key:1},xi={class:"cdx-table__table__empty-state"},Vi=["colspan"],Ei={class:"cdx-table__pagination-status--long"},Ni={class:"cdx-table__pagination-status--short"},Ai={key:3,class:"cdx-table__footer"};function Mi(e,n,o,l,r,d){const s=t.resolveComponent("cdx-table-pager"),i=t.resolveComponent("cdx-checkbox"),a=t.resolveComponent("cdx-icon"),u=t.resolveComponent("cdx-progress-bar");return t.openBlock(),t.createElementBlock("div",pi,[!e.hideCaption||e.$slots.header&&e.$slots.header().length>0?(t.openBlock(),t.createElementBlock("div",fi,[t.createElementVNode("div",{class:"cdx-table__header__caption","aria-hidden":e.$slots.header&&e.$slots.header().length>0?void 0:!0},[e.hideCaption?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(e.caption),1)],64))],8,mi),t.createElementVNode("div",hi,[t.renderSlot(e.$slots,"header")])])):t.createCommentVNode("v-if",!0),e.paginate&&(e.paginationPosition==="top"||e.paginationPosition==="both")?(t.openBlock(),t.createBlock(s,{key:1,"items-per-page":e.pageSize,"onUpdate:itemsPerPage":n[0]||(n[0]=c=>e.pageSize=c),class:"cdx-table__pagination--top","pagination-size-options":e.paginationSizeOptions,"prev-disabled":e.prevDisabled,"next-disabled":e.nextDisabled,"last-disabled":e.lastDisabled,onNext:e.onNext,onPrev:e.onPrev,onFirst:e.onFirst,onLast:e.onLast},{default:t.withCtx(()=>[t.createElementVNode("span",vi,t.toDisplayString(e.paginationStatusMessageLong),1),t.createElementVNode("span",gi,t.toDisplayString(e.paginationStatusMessageShort),1)]),_:1},8,["items-per-page","pagination-size-options","prev-disabled","next-disabled","last-disabled","onNext","onPrev","onFirst","onLast"])):t.createCommentVNode("v-if",!0),t.createElementVNode("div",bi,[t.createElementVNode("table",{class:t.normalizeClass(["cdx-table__table",e.tableClasses])},[t.createElementVNode("caption",null,[e.hasSortableColumns?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(e.translatedSortCaption),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(e.caption),1)],64))]),t.renderSlot(e.$slots,"thead",{},()=>[e.columns.length>0?(t.openBlock(),t.createElementBlock("thead",yi,[t.createElementVNode("tr",null,[e.useRowSelection?(t.openBlock(),t.createElementBlock("th",Ci,[t.createVNode(i,{modelValue:e.selectAll,"onUpdate:modelValue":[n[1]||(n[1]=c=>e.selectAll=c),e.handleSelectAll],"hide-label":!0,indeterminate:e.selectAllIndeterminate},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.translatedSelectAllLabel),1)]),_:1},8,["modelValue","indeterminate","onUpdate:modelValue"])])):t.createCommentVNode("v-if",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.columns,c=>(t.openBlock(),t.createElementBlock("th",{key:c.id,scope:"col",class:t.normalizeClass(e.getCellClass(c,c.allowSort)),"aria-sort":e.getSortOrder(c.id,c.allowSort),style:t.normalizeStyle(e.getCellStyle(c))},[c.allowSort?(t.openBlock(),t.createElementBlock("button",{key:0,"aria-selected":c.id===e.activeSortColumn,class:"cdx-table__table__sort-button",onClick:p=>e.handleSort(c.id)},[t.createElementVNode("span",$i,t.toDisplayString(c.label),1),t.createVNode(a,{icon:e.getSortIcon(c.id),size:"small",class:"cdx-table__table__sort-icon--vue","aria-hidden":"true"},null,8,["icon"])],8,ki)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(c.label),1)],64))],14,wi))),128))])])):t.createCommentVNode("v-if",!0)]),e.pending?(t.openBlock(),t.createBlock(u,{key:0,inline:!0,class:"cdx-table__pending-indicator"})):t.createCommentVNode("v-if",!0),t.renderSlot(e.$slots,"tbody",{},()=>[e.dataForDisplay.length>0?(t.openBlock(),t.createElementBlock("tbody",Bi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.dataForDisplay,(c,p)=>(t.openBlock(),t.createElementBlock("tr",{key:e.getRowKey(c,p),class:t.normalizeClass(e.getRowClass(c,p))},[e.useRowSelection?(t.openBlock(),t.createElementBlock("td",Si,[t.createVNode(i,{modelValue:e.wrappedSelectedRows,"onUpdate:modelValue":[n[2]||(n[2]=f=>e.wrappedSelectedRows=f),e.handleRowSelection],"input-value":e.getRowKey(c,p),"hide-label":!0},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.translatedSelectRowLabel(p+1,e.dataForDisplay.length)),1)]),_:2},1032,["modelValue","input-value","onUpdate:modelValue"])])):t.createCommentVNode("v-if",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.columns,f=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.getCellElement(f.id)),{key:f.id,scope:e.getRowHeaderScope(f.id),class:t.normalizeClass(e.getCellClass(f))},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"item-"+f.id,{item:c[f.id],row:c},()=>[t.createTextVNode(t.toDisplayString(c[f.id]),1)])]),_:2},1032,["scope","class"]))),128))],2))),128))])):e.$slots["empty-state"]&&e.$slots["empty-state"]().length>0?(t.openBlock(),t.createElementBlock("tbody",Ii,[t.createElementVNode("tr",xi,[t.createElementVNode("td",{colspan:e.columns.length,class:"cdx-table__table__empty-state-content"},[t.renderSlot(e.$slots,"empty-state")],8,Vi)])])):t.createCommentVNode("v-if",!0)]),t.renderSlot(e.$slots,"tfoot")],2)]),e.paginate&&(e.paginationPosition==="bottom"||e.paginationPosition==="both")?(t.openBlock(),t.createBlock(s,{key:2,"items-per-page":e.pageSize,"onUpdate:itemsPerPage":n[3]||(n[3]=c=>e.pageSize=c),class:"cdx-table__pagination--bottom","pagination-size-options":e.paginationSizeOptions,"prev-disabled":e.prevDisabled,"next-disabled":e.nextDisabled,"last-disabled":e.lastDisabled,onNext:e.onNext,onPrev:e.onPrev,onFirst:e.onFirst,onLast:e.onLast},{default:t.withCtx(()=>[t.createElementVNode("span",Ei,t.toDisplayString(e.paginationStatusMessageLong),1),t.createElementVNode("span",Ni,t.toDisplayString(e.paginationStatusMessageShort),1)]),_:1},8,["items-per-page","pagination-size-options","prev-disabled","next-disabled","last-disabled","onNext","onPrev","onFirst","onLast"])):t.createCommentVNode("v-if",!0),e.$slots.footer&&e.$slots.footer().length>0?(t.openBlock(),t.createElementBlock("div",Ai,[t.renderSlot(e.$slots,"footer")])):t.createCommentVNode("v-if",!0)])}const Di=O(ci,[["render",Mi]]),Li=t.defineComponent({name:"CdxTab",props:{name:{type:String,required:!0},label:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(e){var d;const n=t.inject(zt),o=t.inject(Kt);if(!n||!o)throw new Error("Tab component must be used inside a Tabs component");const l=(d=n.value.get(e.name))!=null?d:{},r=t.computed(()=>e.name===o.value);return{tab:l,isActive:r}}}),Ti=["id","aria-hidden","aria-labelledby"];function Ri(e,n,o,l,r,d){return t.withDirectives((t.openBlock(),t.createElementBlock("section",{id:e.tab.id,"aria-hidden":e.isActive?void 0:!0,"aria-labelledby":"".concat(e.tab.id,"-label"),class:"cdx-tab",role:"tabpanel",tabindex:"-1"},[t.renderSlot(e.$slots,"default")],8,Ti)),[[t.vShow,e.isActive]])}const $n=O(Li,[["render",Ri]]),Fi=t.defineComponent({name:"CdxTabs",components:{CdxButton:fe,CdxIcon:G},props:{active:{type:String,default:null},framed:{type:Boolean,default:!1}},emits:["update:active"],expose:["select","next","prev"],setup(e,{slots:n,emit:o}){const l=t.ref(),r=t.ref(),d=t.ref(),s=t.ref(),i=Ae(l),a=t.computed(()=>{const b=We(n.default);if(!b.every(y=>typeof y=="object"&&Wt(y,$n.name)))throw new Error("Slot content may only contain CdxTab components");if(b.length===0)throw new Error("Slot content cannot be empty");return b}),u=t.computed(()=>a.value.reduce((b,y)=>{var S;if((S=y.props)!=null&&S.name&&typeof y.props.name=="string"){if(b.get(y.props.name))throw new Error("Tab names must be unique");b.set(y.props.name,{name:y.props.name,id:q(y.props.name),label:y.props.label||y.props.name,disabled:y.props.disabled})}return b},new Map)),c=t.ref(Array.from(u.value.keys())[0]),p=Ye(c,t.toRef(e,"active"),o,"update:active"),f=t.computed(()=>Array.from(u.value.keys())),m=t.computed(()=>f.value.indexOf(p.value)),h=t.computed(()=>{var b;return(b=u.value.get(p.value))==null?void 0:b.id});t.provide(Kt,p),t.provide(zt,u);const v=t.ref(new Map),C=t.ref(),k=t.ref(),B=Pe(C,{threshold:.95}),w=Pe(k,{threshold:.95});function I(b,y){const S=b;S&&(v.value.set(y,S),y===0?C.value=S:y===f.value.length-1&&(k.value=S))}const x=t.computed(()=>({"cdx-tabs--framed":e.framed,"cdx-tabs--quiet":!e.framed}));function D(){var b;(b=v.value.get(m.value))==null||b.focus()}function A(b){if(!r.value||!d.value||!s.value)return 0;const y=i.value==="rtl"?s.value:d.value,S=i.value==="rtl"?d.value:s.value,E=b.offsetLeft,R=E+b.clientWidth,K=r.value.scrollLeft+y.clientWidth,T=r.value.scrollLeft+r.value.clientWidth-S.clientWidth;return ET?R-T:0}function M(b){if(!r.value||!d.value||!s.value)return;const y=b==="next"&&i.value==="ltr"||b==="prev"&&i.value==="rtl"?1:-1;let S=0,E=b==="next"?r.value.firstElementChild:r.value.lastElementChild;for(;E;){const R=b==="next"?E.nextElementSibling:E.previousElementSibling;if(S=A(E),Math.sign(S)===y){R&&Math.abs(S)<.25*r.value.clientWidth&&(S=A(R));break}E=R}r.value.scrollBy({left:S,behavior:"smooth"}),D()}return t.watch(p,()=>{if(h.value===void 0||!r.value||!d.value||!s.value)return;const b=document.getElementById("".concat(h.value,"-label"));b&&r.value.scrollBy({left:A(b),behavior:"smooth"})}),{activeTab:p,activeTabIndex:m,activeTabId:h,currentDirection:i,rootElement:l,tabListElement:r,prevScroller:d,nextScroller:s,rootClasses:x,tabNames:f,tabsData:u,firstLabelVisible:B,lastLabelVisible:w,assignTemplateRefForTabButton:I,scrollTabs:M,focusActiveTab:D,cdxIconPrevious:Rt,cdxIconNext:Tt}},methods:{select(e,n){const o=this.tabsData.get(e);o&&!(o!=null&&o.disabled)&&(this.activeTab=e,n&&t.nextTick(()=>{this.focusActiveTab()}))},selectNonDisabled(e,n,o){const l=this.tabsData.get(this.tabNames[e+n]);l&&(l.disabled?this.selectNonDisabled(e+n,n,o):this.select(l.name,o))},next(e){this.selectNonDisabled(this.activeTabIndex,1,e)},prev(e){this.selectNonDisabled(this.activeTabIndex,-1,e)},onLeftArrowKeypress(){this.currentDirection==="rtl"?this.next(!0):this.prev(!0)},onRightArrowKeypress(){this.currentDirection==="rtl"?this.prev(!0):this.next(!0)},onDownArrowKeypress(){var e;this.activeTabId&&((e=document.getElementById(this.activeTabId))==null||e.focus())}}}),_i={class:"cdx-tabs__header"},Oi={ref:"prevScroller",class:"cdx-tabs__prev-scroller"},zi={ref:"tabListElement",class:"cdx-tabs__list",role:"tablist"},Ki=["id","disabled","aria-controls","aria-selected","tabindex","onClick","onKeyup"],Pi={ref:"nextScroller",class:"cdx-tabs__next-scroller"},Hi={class:"cdx-tabs__content"};function Ui(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-tabs",e.rootClasses])},[t.createElementVNode("div",_i,[t.withDirectives(t.createElementVNode("div",Oi,[t.createVNode(i,{class:"cdx-tabs__scroll-button",weight:"quiet",type:"button",tabindex:"-1","aria-hidden":!0,onMousedown:n[0]||(n[0]=t.withModifiers(()=>{},["prevent"])),onClick:n[1]||(n[1]=a=>e.scrollTabs("prev"))},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.cdxIconPrevious},null,8,["icon"])]),_:1})],512),[[t.vShow,!e.firstLabelVisible]]),t.createElementVNode("div",zi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.tabsData.values(),(a,u)=>(t.openBlock(),t.createElementBlock("button",{id:"".concat(a.id,"-label"),key:u,ref_for:!0,ref:c=>e.assignTemplateRefForTabButton(c,u),disabled:a.disabled?!0:void 0,"aria-controls":a.id,"aria-selected":a.name===e.activeTab,tabindex:a.name===e.activeTab?void 0:-1,class:"cdx-tabs__list__item",role:"tab",onClick:t.withModifiers(c=>e.select(a.name),["prevent"]),onKeyup:t.withKeys(c=>e.select(a.name),["enter"]),onKeydown:[n[2]||(n[2]=t.withKeys(t.withModifiers((...c)=>e.onRightArrowKeypress&&e.onRightArrowKeypress(...c),["prevent"]),["right"])),n[3]||(n[3]=t.withKeys(t.withModifiers((...c)=>e.onDownArrowKeypress&&e.onDownArrowKeypress(...c),["prevent"]),["down"])),n[4]||(n[4]=t.withKeys(t.withModifiers((...c)=>e.onLeftArrowKeypress&&e.onLeftArrowKeypress(...c),["prevent"]),["left"]))]},[t.createElementVNode("span",null,t.toDisplayString(a.label),1)],40,Ki))),128))],512),t.withDirectives(t.createElementVNode("div",Pi,[t.createVNode(i,{class:"cdx-tabs__scroll-button",weight:"quiet",type:"button",tabindex:"-1","aria-hidden":!0,onMousedown:n[5]||(n[5]=t.withModifiers(()=>{},["prevent"])),onClick:n[6]||(n[6]=a=>e.scrollTabs("next"))},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.cdxIconNext},null,8,["icon"])]),_:1})],512),[[t.vShow,!e.lastLabelVisible]])]),t.createElementVNode("div",Hi,[t.renderSlot(e.$slots,"default")])],2)}const ji=O(Fi,[["render",Ui]]),qi=J(ue),Wi=t.defineComponent({name:"CdxTextArea",components:{CdxIcon:G},inheritAttrs:!1,props:{modelValue:{type:String,default:""},status:{type:String,default:"default",validator:qi},disabled:{type:Boolean,default:!1},autosize:{type:Boolean,default:!1},startIcon:{type:[String,Object],default:void 0},endIcon:{type:[String,Object],default:void 0}},emits:["update:modelValue"],setup(e,{attrs:n,emit:o}){const l=te(t.toRef(e,"modelValue"),o),r=n.id,{computedDisabled:d,computedStatus:s,computedInputId:i}=oe(t.toRef(e,"disabled"),t.toRef(e,"status"),r),a=t.inject(qe,void 0),u=t.computed(()=>({"cdx-text-area__textarea--has-value":!!l.value,"cdx-text-area__textarea--is-autosize":e.autosize})),c=t.computed(()=>({"cdx-text-area--status-default":s.value==="default","cdx-text-area--status-error":s.value==="error","cdx-text-area--has-start-icon":!!e.startIcon,"cdx-text-area--has-end-icon":!!e.endIcon})),{rootClasses:p,rootStyle:f,otherAttrs:m}=le(n,c),h=t.computed(()=>{const w=m.value,{id:k}=w;return re(w,["id"])}),v=t.ref();function C(){v.value&&e.autosize&&(v.value.style.height="auto",v.value.style.height="".concat(v.value.scrollHeight,"px"))}return{rootClasses:p,rootStyle:f,wrappedModel:l,computedDisabled:d,computedInputId:i,descriptionId:a,textareaClasses:u,otherAttrsMinusId:h,textarea:v,onInput:C}}}),Qi=["id","aria-describedby","disabled"];function Gi(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-text-area",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.withDirectives(t.createElementVNode("textarea",t.mergeProps({id:e.computedInputId,ref:"textarea"},e.otherAttrsMinusId,{"onUpdate:modelValue":n[0]||(n[0]=i=>e.wrappedModel=i),class:[e.textareaClasses,"cdx-text-area__textarea"],"aria-describedby":e.descriptionId,disabled:e.computedDisabled,onInput:n[1]||(n[1]=(...i)=>e.onInput&&e.onInput(...i))}),null,16,Qi),[[t.vModelText,e.wrappedModel]]),e.startIcon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.startIcon,class:"cdx-text-area__icon-vue cdx-text-area__start-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),e.endIcon?(t.openBlock(),t.createBlock(s,{key:1,icon:e.endIcon,class:"cdx-text-area__icon-vue cdx-text-area__end-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0)],6)}const Yi=O(Wi,[["render",Gi]]),Xi=t.defineComponent({name:"CdxToggleButtonGroup",components:{CdxIcon:G,CdxToggleButton:bt},props:{buttons:{type:Array,required:!0,validator:e=>Array.isArray(e)&&e.length>=1},modelValue:{type:[String,Number,null,Array],required:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:n}){const{rootElement:o,assignTemplateRef:l,onFocus:r,onBlur:d,onKeydown:s}=Yt(t.toRef(e,"buttons"));function i(u){return Array.isArray(e.modelValue)?e.modelValue.indexOf(u.value)!==-1:e.modelValue!==null?e.modelValue===u.value:!1}function a(u,c){if(Array.isArray(e.modelValue)){const p=e.modelValue.indexOf(u.value)!==-1;c&&!p?n("update:modelValue",e.modelValue.concat(u.value)):!c&&p&&n("update:modelValue",e.modelValue.filter(f=>f!==u.value))}else c&&e.modelValue!==u.value&&n("update:modelValue",u.value)}return{rootElement:o,assignTemplateRef:l,onFocus:r,onBlur:d,onKeydown:s,getButtonLabel:Gt,isSelected:i,onUpdate:a}}}),Ji={ref:"rootElement",class:"cdx-toggle-button-group"};function Zi(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-toggle-button");return t.openBlock(),t.createElementBlock("div",Ji,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.buttons,(a,u)=>(t.openBlock(),t.createBlock(i,{key:a.value,ref_for:!0,ref:c=>e.assignTemplateRef(c,u),"model-value":e.isSelected(a),disabled:a.disabled||e.disabled,"aria-label":a.ariaLabel,"onUpdate:modelValue":c=>e.onUpdate(a,c),onFocus:c=>e.onFocus(u),onBlur:e.onBlur,onKeydown:e.onKeydown},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{button:a,selected:e.isSelected(a)},()=>[a.icon?(t.openBlock(),t.createBlock(s,{key:0,icon:a.icon},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createTextVNode(" "+t.toDisplayString(e.getButtonLabel(a)),1)])]),_:2},1032,["model-value","disabled","aria-label","onUpdate:modelValue","onFocus","onBlur","onKeydown"]))),128))],512)}const er=O(Xi,[["render",Zi]]),tr=t.defineComponent({name:"CdxToggleSwitch",components:{CdxLabel:Me},inheritAttrs:!1,props:{modelValue:{type:[Boolean,Array],default:!1},inputValue:{type:[String,Number,Boolean],default:!1},alignSwitch:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:n,slots:o,attrs:l}){var h;pt((h=o.default)==null?void 0:h.call(o),l,"CdxToggleSwitch");const r=t.ref(),d=q("toggle-switch"),s=q("description"),i=t.computed(()=>({"cdx-toggle-switch--align-switch":e.alignSwitch})),{rootClasses:a,rootStyle:u,otherAttrs:c}=le(l,i),{computedDisabled:p}=oe(t.toRef(e,"disabled")),f=te(t.toRef(e,"modelValue"),n);return{input:r,inputId:d,descriptionId:s,rootClasses:a,rootStyle:u,otherAttrs:c,computedDisabled:p,wrappedModel:f,clickInput:()=>{r.value.click()}}}}),nr=["id","aria-describedby","value","disabled"],or=t.createElementVNode("span",{class:"cdx-toggle-switch__switch"},[t.createElementVNode("span",{class:"cdx-toggle-switch__switch__grip"})],-1);function lr(e,n,o,l,r,d){const s=t.resolveComponent("cdx-label");return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["cdx-toggle-switch",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.withDirectives(t.createElementVNode("input",t.mergeProps({id:e.inputId,ref:"input","onUpdate:modelValue":n[0]||(n[0]=i=>e.wrappedModel=i),class:"cdx-toggle-switch__input",type:"checkbox",role:"switch","aria-describedby":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,value:e.inputValue,disabled:e.computedDisabled},e.otherAttrs,{onKeydown:n[1]||(n[1]=t.withKeys(t.withModifiers((...i)=>e.clickInput&&e.clickInput(...i),["prevent"]),["enter"]))}),null,16,nr),[[t.vModelCheckbox,e.wrappedModel]]),or,e.$slots.default&&e.$slots.default().length?(t.openBlock(),t.createBlock(s,{key:0,class:"cdx-toggle-switch__label","input-id":e.inputId,"description-id":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,"visually-hidden":e.hideLabel,disabled:e.computedDisabled},t.createSlots({default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:2},[e.$slots.description&&e.$slots.description().length>0?{name:"description",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"description")]),key:"0"}:void 0]),1032,["input-id","description-id","visually-hidden","disabled"])):t.createCommentVNode("v-if",!0)],6)}const ar=O(tr,[["render",lr]]);class sr{constructor(n,o){ce(this,"referenceElement");ce(this,"tooltipElement");ce(this,"textContent");ce(this,"placement");ce(this,"autoUpdateCleanup");ce(this,"referenceElementHandlers");ce(this,"tooltipElementHandlers");ce(this,"escapeHandler");ce(this,"timeoutId");var d,s;const l=n.ownerDocument,r=q("tooltip");this.referenceElement=n,this.textContent=o.textContent,this.placement=(d=o.placement)!=null?d:"bottom",this.timeoutId=null,this.tooltipElement=l.createElement("div"),this.tooltipElement.classList.add("cdx-tooltip"),this.tooltipElement.role="tooltip",this.tooltipElement.id=r,this.referenceElement.setAttribute("aria-describedby",r),this.tooltipElement.textContent=this.textContent,(s=this.referenceElement.parentElement)==null||s.appendChild(this.tooltipElement),this.referenceElementHandlers={},this.referenceElementHandlers.mouseenter=this.show.bind(this),this.referenceElementHandlers.mouseleave=this.hideAfterDelay.bind(this),this.referenceElementHandlers.focus=this.show.bind(this),this.referenceElementHandlers.blur=this.hide.bind(this),this.tooltipElementHandlers={},this.tooltipElementHandlers.mouseenter=this.show.bind(this),this.tooltipElementHandlers.mouseleave=this.hideAfterDelay.bind(this),this.escapeHandler=this.onKeyup.bind(this),this.addEventListeners(),this.autoUpdateCleanup=hn(this.referenceElement,this.tooltipElement,()=>this.update())}isVisible(){return this.tooltipElement.style.display==="block"}show(){this.timeoutId&&clearTimeout(this.timeoutId),this.tooltipElement.style.display="block",this.tooltipElement.ownerDocument.addEventListener("keyup",this.escapeHandler)}hide(){this.tooltipElement.style.display="none",this.tooltipElement.ownerDocument.removeEventListener("keyup",this.escapeHandler)}hideAfterDelay(){this.timeoutId=setTimeout(this.hide.bind(this),250)}onKeyup(n){n.key==="Escape"&&this.isVisible()&&this.hide()}addEventListeners(){Object.keys(this.referenceElementHandlers).forEach(n=>{this.referenceElement.addEventListener(n,this.referenceElementHandlers[n])}),Object.keys(this.tooltipElementHandlers).forEach(n=>{this.tooltipElement.addEventListener(n,this.tooltipElementHandlers[n])})}removeEventListeners(){Object.keys(this.referenceElementHandlers).forEach(n=>{this.referenceElement.removeEventListener(n,this.referenceElementHandlers[n])}),Object.keys(this.tooltipElementHandlers).forEach(n=>{this.tooltipElement.removeEventListener(n,this.tooltipElementHandlers[n])})}update(){gn(this.referenceElement,this.tooltipElement,{placement:this.placement,middleware:[sn(4),vn(),Fa(),rt()]}).then(({x:n,y:o,middlewareData:l})=>{var s,i,a;const r=(i=(s=l.offset)==null?void 0:s.placement)!=null?i:this.placement,d={left:"right","left-start":"right","left-end":"right",top:"bottom","top-start":"bottom","top-end":"bottom",bottom:"top","bottom-start":"top","bottom-end":"top",right:"left","right-start":"left","right-end":"left"};Object.assign(this.tooltipElement.style,{left:"".concat(n,"px"),top:"".concat(o,"px"),visibility:(a=l.hide)!=null&&a.referenceHidden?"hidden":"visible",transformOrigin:d[r]})})}remove(){this.tooltipElement.remove(),this.autoUpdateCleanup(),this.removeEventListeners()}}const ir={mounted(e,{value:n,arg:o}){e.tooltip=new sr(e,{textContent:String(n),placement:o})},beforeUnmount(e){e.tooltip&&e.tooltip.remove()}},rr=t.defineComponent({name:"CdxTypeaheadSearch",components:{CdxIcon:G,CdxMenu:we,CdxSearchInput:wn},inheritAttrs:!1,props:{id:{type:String,required:!0},formAction:{type:String,required:!0},searchResults:{type:Array,required:!0},useButton:{type:Boolean,default:!1},buttonLabel:{type:String,default:""},initialInputValue:{type:String,default:""},searchFooterUrl:{type:String,default:""},debounceInterval:{type:Number,default:po},highlightQuery:{type:Boolean,default:!1},showThumbnail:{type:Boolean,default:!1},autoExpandWidth:{type:Boolean,default:!1},visibleItemLimit:{type:Number,default:null}},emits:["input","search-result-click","submit","load-more"],setup(e,{attrs:n,emit:o,slots:l}){const r=t.ref(),d=t.ref(),s=q("typeahead-search-menu"),i=Q("cdx-typeahead-search-search-results-label","Search results"),a=t.ref(!1),u=t.ref(!1),c=t.ref(!1),p=t.ref(!1),f=t.ref(e.initialInputValue),m=t.ref(""),h=t.computed(()=>{var $,L;return(L=($=d.value)==null?void 0:$.getHighlightedMenuItem())==null?void 0:L.id}),v=t.ref(null),C=t.computed(()=>({"cdx-typeahead-search__menu-message--has-thumbnail":e.showThumbnail})),k=t.computed(()=>e.searchResults.find($=>$.value===v.value)),B=t.computed(()=>e.searchFooterUrl?{value:$e,url:e.searchFooterUrl}:void 0),w=t.computed(()=>({"cdx-typeahead-search--show-thumbnail":e.showThumbnail,"cdx-typeahead-search--expanded":a.value,"cdx-typeahead-search--auto-expand-width":e.showThumbnail&&e.autoExpandWidth})),{rootClasses:I,rootStyle:x,otherAttrs:D}=le(n,w);function A($){return $}const M=t.computed(()=>({visibleItemLimit:e.visibleItemLimit,showThumbnail:e.showThumbnail,boldLabel:!0,hideDescriptionOverflow:!0}));let b,y;function S($,L=!1){k.value&&k.value.label!==$&&k.value.value!==$&&(v.value=null),y!==void 0&&(clearTimeout(y),y=void 0),$===""?a.value=!1:(u.value=!0,l["search-results-pending"]&&(y=setTimeout(()=>{p.value&&(a.value=!0),c.value=!0},fo))),b!==void 0&&(clearTimeout(b),b=void 0);const H=()=>{o("input",$)};L?H():b=setTimeout(()=>{H()},e.debounceInterval)}function E($){var L;if($===$e){v.value=null,f.value=m.value;return}v.value=$,$!==null&&(f.value=k.value?(L=k.value.label)!=null?L:String(k.value.value):"")}function R(){p.value=!0,(m.value||c.value)&&(a.value=!0)}function K(){p.value=!1,a.value=!1}function T($){const Y=$,{id:L}=Y,H=re(Y,["id"]);if(H.value===$e){o("search-result-click",{searchResult:null,index:e.searchResults.length,numberOfResults:e.searchResults.length});return}_(H)}function _($){const L={searchResult:$,index:e.searchResults.findIndex(H=>H.value===$.value),numberOfResults:e.searchResults.length};o("search-result-click",L)}function j($){var L;if($.value===$e){f.value=m.value;return}f.value=$.value?(L=$.label)!=null?L:String($.value):""}function W($){var L;a.value=!1,(L=d.value)==null||L.clearActive(),T($)}function ne($){if(k.value)_(k.value),$.stopPropagation(),window.location.assign(k.value.url),$.preventDefault();else{const L={searchResult:null,index:-1,numberOfResults:e.searchResults.length};o("submit",L)}}function me($){if(!d.value||!m.value||$.key===" ")return;const L=d.value.getHighlightedMenuItem(),H=d.value.getHighlightedViaKeyboard();switch($.key){case"Enter":L&&(L.value===$e&&H?window.location.assign(e.searchFooterUrl):d.value.delegateKeyNavigation($,{prevent:!1})),a.value=!1;break;case"Tab":a.value=!1;break;default:d.value.delegateKeyNavigation($);break}}return t.onMounted(()=>{e.initialInputValue&&S(e.initialInputValue,!0)}),t.watch(t.toRef(e,"searchResults"),()=>{m.value=f.value.trim(),p.value&&u.value&&m.value.length>0&&(a.value=!0),y!==void 0&&(clearTimeout(y),y=void 0),u.value=!1,c.value=!1}),{form:r,menu:d,menuId:s,highlightedId:h,selection:v,menuMessageClass:C,footer:B,asSearchResult:A,inputValue:f,searchQuery:m,expanded:a,showPending:c,rootClasses:I,rootStyle:x,otherAttrs:D,menuConfig:M,onUpdateInputValue:S,onUpdateMenuSelection:E,onFocus:R,onBlur:K,onSearchResultClick:T,onSearchResultKeyboardNavigation:j,onSearchFooterClick:W,onSubmit:ne,onKeydown:me,MenuFooterValue:$e,articleIcon:qn,translatedSearchResultsLabel:i}},methods:{focus(){this.$refs.searchInput.focus()}}}),dr=["id","action"],ur={class:"cdx-typeahead-search__menu-message__text"},cr={class:"cdx-typeahead-search__menu-message__text"},pr=["href","onClickCapture"],fr={class:"cdx-menu-item__text cdx-typeahead-search__search-footer__text"},mr={class:"cdx-typeahead-search__search-footer__query"};function hr(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-menu"),a=t.resolveComponent("cdx-search-input");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-typeahead-search",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("form",{id:e.id,ref:"form",class:"cdx-typeahead-search__form",action:e.formAction,onSubmit:n[4]||(n[4]=(...u)=>e.onSubmit&&e.onSubmit(...u))},[t.createVNode(a,t.mergeProps({ref:"searchInput",modelValue:e.inputValue,"onUpdate:modelValue":n[3]||(n[3]=u=>e.inputValue=u),"button-label":e.buttonLabel,"use-button":e.useButton},e.otherAttrs,{class:"cdx-typeahead-search__input",name:"search",role:"combobox",autocomplete:"off","aria-autocomplete":"list","aria-controls":e.menuId,"aria-expanded":e.expanded,"aria-activedescendant":e.highlightedId,"onUpdate:modelValue":e.onUpdateInputValue,onFocus:e.onFocus,onBlur:e.onBlur,onKeydown:e.onKeydown}),{default:t.withCtx(()=>[t.createVNode(i,t.mergeProps({id:e.menuId,ref:"menu",expanded:e.expanded,"onUpdate:expanded":n[0]||(n[0]=u=>e.expanded=u),class:"cdx-typeahead-search__menu","show-pending":e.showPending,selected:e.selection,"menu-items":e.searchResults,footer:e.footer,"search-query":e.highlightQuery?e.searchQuery:"","show-no-results-slot":e.searchQuery.length>0&&e.searchResults.length===0&&e.$slots["search-no-results-text"]&&e.$slots["search-no-results-text"]().length>0},e.menuConfig,{"aria-label":e.translatedSearchResultsLabel,"onUpdate:selected":e.onUpdateMenuSelection,onMenuItemClick:n[1]||(n[1]=u=>e.onSearchResultClick(e.asSearchResult(u))),onMenuItemKeyboardNavigation:e.onSearchResultKeyboardNavigation,onLoadMore:n[2]||(n[2]=u=>e.$emit("load-more"))}),{pending:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["cdx-menu-item__content cdx-typeahead-search__menu-message",e.menuMessageClass])},[t.createElementVNode("span",ur,[t.renderSlot(e.$slots,"search-results-pending")])],2)]),"no-results":t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["cdx-menu-item__content cdx-typeahead-search__menu-message",e.menuMessageClass])},[t.createElementVNode("span",cr,[t.renderSlot(e.$slots,"search-no-results-text")])],2)]),default:t.withCtx(({menuItem:u,active:c})=>[u.value===e.MenuFooterValue?(t.openBlock(),t.createElementBlock("a",{key:0,class:t.normalizeClass(["cdx-menu-item__content cdx-typeahead-search__search-footer",{"cdx-typeahead-search__search-footer__active":c}]),href:e.asSearchResult(u).url,onClickCapture:t.withModifiers(p=>e.onSearchFooterClick(e.asSearchResult(u)),["stop"])},[t.createVNode(s,{class:"cdx-menu-item__thumbnail cdx-typeahead-search__search-footer__icon",icon:e.articleIcon},null,8,["icon"]),t.createElementVNode("span",fr,[t.renderSlot(e.$slots,"search-footer-text",{searchQuery:e.searchQuery},()=>[t.createElementVNode("strong",mr,t.toDisplayString(e.searchQuery),1)])])],42,pr)):t.createCommentVNode("v-if",!0)]),_:3},16,["id","expanded","show-pending","selected","menu-items","footer","search-query","show-no-results-slot","aria-label","onUpdate:selected","onMenuItemKeyboardNavigation"])]),_:3},16,["modelValue","button-label","use-button","aria-controls","aria-expanded","aria-activedescendant","onUpdate:modelValue","onFocus","onBlur","onKeydown"]),t.renderSlot(e.$slots,"default")],40,dr)],6)}const vr=O(rr,[["render",hr]]);exports.CdxAccordion=Do;exports.CdxButton=fe;exports.CdxButtonGroup=Fo;exports.CdxCard=Qo;exports.CdxCheckbox=Xt;exports.CdxChipInput=Jt;exports.CdxCombobox=Wa;exports.CdxDialog=os;exports.CdxField=hs;exports.CdxIcon=G;exports.CdxInfoChip=Cs;exports.CdxLabel=Me;exports.CdxLookup=Bs;exports.CdxMenu=we;exports.CdxMenuButton=As;exports.CdxMenuItem=nn;exports.CdxMessage=Cn;exports.CdxMultiselectLookup=Ts;exports.CdxProgressBar=ft;exports.CdxRadio=Ps;exports.CdxSearchInput=wn;exports.CdxSearchResultTitle=tn;exports.CdxSelect=kn;exports.CdxTab=$n;exports.CdxTable=Di;exports.CdxTabs=ji;exports.CdxTextArea=Yi;exports.CdxTextInput=Xe;exports.CdxThumbnail=ut;exports.CdxToggleButton=bt;exports.CdxToggleButtonGroup=er;exports.CdxToggleSwitch=ar;exports.CdxTooltip=ir;exports.CdxTypeaheadSearch=vr;exports.TableRowIdentifier=Ke;exports.stringHelpers=Sl;exports.useComputedDirection=Ae;exports.useComputedDisabled=ct;exports.useComputedLanguage=_t;exports.useFieldData=oe;exports.useFloatingMenu=Ve;exports.useGeneratedId=q;exports.useI18n=Q;exports.useIntersectionObserver=Pe;exports.useModelWrapper=te;exports.useResizeObserver=yn;exports.useSlotContents=We;exports.useSplitAttributes=le;exports.useWarnOnce=Qe;