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