wiki.techinc.nl/resources/lib/codex/codex.umd.js
Eric Gardner c47f31fe12 Update Codex from v0.1.1 to v0.2.1
Bug: T259203
Bug: T305236
Bug: T311514
Bug: T312594
Bug: T313768
Bug: T313940
Bug: T314332
Bug: T316893
Bug: T317198
Change-Id: I3ec2d7c7d56076637e3667fe3023aade943a5254
2022-09-13 11:31:02 -07:00

2 lines
60 KiB
JavaScript

(function(p,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(p=typeof globalThis!="undefined"?globalThis:p||self,t(p.codex={},p.Vue))})(this,function(p,t){"use strict";var ko=Object.defineProperty,$o=Object.defineProperties;var Ao=Object.getOwnPropertyDescriptors;var Q=Object.getOwnPropertySymbols;var be=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var he=(p,t,V)=>t in p?ko(p,t,{enumerable:!0,configurable:!0,writable:!0,value:V}):p[t]=V,ye=(p,t)=>{for(var V in t||(t={}))be.call(t,V)&&he(p,V,t[V]);if(Q)for(var V of Q(t))ge.call(t,V)&&he(p,V,t[V]);return p},Ce=(p,t)=>$o(p,Ao(t));var G=(p,t)=>{var V={};for(var F in p)be.call(p,F)&&t.indexOf(F)<0&&(V[F]=p[F]);if(p!=null&&Q)for(var F of Q(p))t.indexOf(F)<0&&ge.call(p,F)&&(V[F]=p[F]);return V};const V="cdx",F=["default","progressive","destructive"],Be=["normal","primary","quiet"],_e=["notice","warning","error","success"],ke=["text","search"],q="cdx-menu-footer-item",te=Symbol("CdxTabs"),ne=Symbol("CdxActiveTab"),$e='<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"/>',Ae='<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"/>',we='<path d="M7 14.17 2.83 10l-1.41 1.41L7 17 19 5l-1.41-1.42z"/>',Se='<path d="M10 0a10 10 0 1010 10A10 10 0 0010 0zm5.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"/>',xe='<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"/>',Ee='<path d="M13.728 1H6.272L1 6.272v7.456L6.272 19h7.456L19 13.728V6.272zM11 15H9v-2h2zm0-4H9V5h2z"/>',Ie='<path d="m17.5 4.75-7.5 7.5-7.5-7.5L1 6.25l9 9 9-9z"/>',Ve='<path d="M19 3H1v14h18zM3 14l3.5-4.5 2.5 3L12.5 8l4.5 6z"/><path d="M19 5H1V3h18zm0 12H1v-2h18z"/>',De='<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 7z"/>',Me='<path d="M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zM9 5h2v2H9zm0 4h2v6H9z"/>',Ne='<path d="M7 1 5.6 2.5 13 10l-7.4 7.5L7 19l9-9z"/>',Te='<path d="m4 10 9 9 1.4-1.5L7 10l7.4-7.5L13 1z"/>',Fe='<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 8z"/>',Le=$e,Re=Ae,ze=we,Ke=Se,ve=xe,qe=Ee,oe=Ie,Oe=Ve,Ue={langCodeMap:{ar:De},default:Me},Pe={ltr:Ne,shouldFlip:!0},je={ltr:Te,shouldFlip:!0},He=Fe;function We(e,n,l){if(typeof e=="string"||"path"in e)return e;if("shouldFlip"in e)return e.ltr;if("rtl"in e)return l==="rtl"?e.rtl:e.ltr;const s=n in e.langCodeMap?e.langCodeMap[n]:e.default;return typeof s=="string"||"path"in s?s:s.ltr}function Qe(e,n){if(typeof e=="string")return!1;if("langCodeMap"in e){const l=n in e.langCodeMap?e.langCodeMap[n]:e.default;if(typeof l=="string")return!1;e=l}if("shouldFlipExceptions"in e&&Array.isArray(e.shouldFlipExceptions)){const l=e.shouldFlipExceptions.indexOf(n);return l===void 0||l===-1}return"shouldFlip"in e?e.shouldFlip:!1}function J(e){const n=t.ref(null);return t.onMounted(()=>{const l=window.getComputedStyle(e.value).direction;n.value=l==="ltr"||l==="rtl"?l:null}),n}function le(e){const n=t.ref("");return t.onMounted(()=>{let l=e.value;for(;l&&l.lang==="";)l=l.parentElement;n.value=l?l.lang:null}),n}const Ge=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}},emits:["click"],setup(e,{emit:n}){const l=t.ref(),s=J(l),r=le(l),i=t.computed(()=>e.dir||s.value),a=t.computed(()=>e.lang||r.value),d=t.computed(()=>({"cdx-icon--flipped":i.value==="rtl"&&a.value!==null&&Qe(e.icon,a.value)})),o=t.computed(()=>We(e.icon,a.value||"",i.value||"ltr")),u=t.computed(()=>typeof o.value=="string"?o.value:""),c=t.computed(()=>typeof o.value!="string"?o.value.path:"");return{rootElement:l,rootClasses:d,iconSvg:u,iconPath:c,onClick:y=>{n("click",y)}}}}),xo="",k=(e,n)=>{const l=e.__vccOpts||e;for(const[s,r]of n)l[s]=r;return l},Je=["aria-hidden"],Xe={key:0},Ye=["innerHTML"],Ze=["d"];function et(e,n,l,s,r,i){return t.openBlock(),t.createElementBlock("span",{ref:"rootElement",class:t.normalizeClass(["cdx-icon",e.rootClasses]),onClick:n[0]||(n[0]=(...a)=>e.onClick&&e.onClick(...a))},[(t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20","aria-hidden":!e.iconLabel},[e.iconLabel?(t.openBlock(),t.createElementBlock("title",Xe,t.toDisplayString(e.iconLabel),1)):t.createCommentVNode("",!0),e.iconSvg?(t.openBlock(),t.createElementBlock("g",{key:1,fill:"currentColor",innerHTML:e.iconSvg},null,8,Ye)):(t.openBlock(),t.createElementBlock("path",{key:2,d:e.iconPath,fill:"currentColor"},null,8,Ze))],8,Je))],2)}const T=k(Ge,[["render",et]]);function j(e){return n=>typeof n=="string"&&e.indexOf(n)!==-1}const tt=j(Be),nt=j(F),ot=e=>{!e["aria-label"]&&!e["aria-hidden"]&&t.warn(`icon-only buttons require one of the following attribute: aria-label or aria-hidden.
See documentation on https://doc.wikimedia.org/codex/main/components/button.html#default-icon-only`)};function X(e){const n=[];for(const l of e)typeof l=="string"&&l.trim()!==""?n.push(l):Array.isArray(l)?n.push(...X(l)):typeof l=="object"&&l&&(typeof l.type=="string"||typeof l.type=="object"?n.push(l):l.type!==t.Comment&&(typeof l.children=="string"&&l.children.trim()!==""?n.push(l.children):Array.isArray(l.children)&&n.push(...X(l.children))));return n}const lt=(e,n)=>{if(!e)return!1;const l=X(e);if(l.length!==1)return!1;const s=l[0],r=typeof s=="object"&&typeof s.type=="object"&&"name"in s.type&&s.type.name===T.name,i=typeof s=="object"&&s.type==="svg";return r||i?(ot(n),!0):!1},at=t.defineComponent({name:"CdxButton",props:{action:{type:String,default:"default",validator:nt},type:{type:String,default:"normal",validator:tt}},emits:["click"],setup(e,{emit:n,slots:l,attrs:s}){return{rootClasses:t.computed(()=>{var a;return{[`cdx-button--action-${e.action}`]:!0,[`cdx-button--type-${e.type}`]:!0,"cdx-button--framed":e.type!=="quiet","cdx-button--icon-only":lt((a=l.default)==null?void 0:a.call(l),s)}}),onClick:a=>{n("click",a)}}}}),Eo="";function st(e,n,l,s,r,i){return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["cdx-button",e.rootClasses]),onClick:n[0]||(n[0]=(...a)=>e.onClick&&e.onClick(...a))},[t.renderSlot(e.$slots,"default")],2)}const O=k(at,[["render",st]]);function ae(e){return e.label===void 0?e.value:e.label===null?"":e.label}const rt=t.defineComponent({name:"CdxButtonGroup",components:{CdxButton:O,CdxIcon:T},props:{buttons:{type:Array,required:!0,validator:e=>Array.isArray(e)&&e.length>=1},disabled:{type:Boolean,default:!1}},emits:["click"],setup(){return{getButtonLabel:ae}}}),Io="",it={class:"cdx-button-group"};function dt(e,n,l,s,r,i){const a=t.resolveComponent("cdx-icon"),d=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",it,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.buttons,o=>(t.openBlock(),t.createBlock(d,{key:o.value,disabled:o.disabled||e.disabled,"aria-label":o.ariaLabel,onClick:u=>e.$emit("click",o.value)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{button:o},()=>[o.icon?(t.openBlock(),t.createBlock(a,{key:0,icon:o.icon},null,8,["icon"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(e.getButtonLabel(o)),1)])]),_:2},1032,["disabled","aria-label","onClick"]))),128))])}const ut=k(rt,[["render",dt]]),ct=t.defineComponent({name:"CdxThumbnail",components:{CdxIcon:T},props:{thumbnail:{type:[Object,null],default:null},placeholderIcon:{type:[String,Object],default:Oe}},setup:e=>{const n=t.ref(!1),l=t.ref({}),s=r=>{const i=r.replace(/([\\"\n])/g,"\\$1"),a=new Image;a.onload=()=>{l.value={backgroundImage:`url("${i}")`},n.value=!0},a.onerror=()=>{n.value=!1},a.src=i};return t.onMounted(()=>{var r;(r=e.thumbnail)!=null&&r.url&&s(e.thumbnail.url)}),{thumbnailStyle:l,thumbnailLoaded:n}}}),Vo="",pt={class:"cdx-thumbnail"},mt={key:0,class:"cdx-thumbnail__placeholder"};function ft(e,n,l,s,r,i){const a=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("span",pt,[e.thumbnailLoaded?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",mt,[t.createVNode(a,{icon:e.placeholderIcon,class:"cdx-thumbnail__placeholder__icon"},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:"cdx-thumbnail__image"},null,4)):t.createCommentVNode("",!0)]),_:1})])}const Y=k(ct,[["render",ft]]),ht=t.defineComponent({name:"CdxCard",components:{CdxIcon:T,CdxThumbnail:Y},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),l=t.computed(()=>n.value?"a":"span"),s=t.computed(()=>n.value?e.url:void 0);return{isLink:n,contentTag:l,cardLink:s}}}),Do="",bt={class:"cdx-card__text"},gt={class:"cdx-card__text__title"},yt={key:0,class:"cdx-card__text__description"},Ct={key:1,class:"cdx-card__text__supporting-text"};function Bt(e,n,l,s,r,i){const a=t.resolveComponent("cdx-thumbnail"),d=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(a,{key:0,thumbnail:e.thumbnail,"placeholder-icon":e.customPlaceholderIcon,class:"cdx-card__thumbnail"},null,8,["thumbnail","placeholder-icon"])):e.icon?(t.openBlock(),t.createBlock(d,{key:1,icon:e.icon,class:"cdx-card__icon"},null,8,["icon"])):t.createCommentVNode("",!0),t.createElementVNode("span",bt,[t.createElementVNode("span",gt,[t.renderSlot(e.$slots,"title")]),e.$slots.description?(t.openBlock(),t.createElementBlock("span",yt,[t.renderSlot(e.$slots,"description")])):t.createCommentVNode("",!0),e.$slots["supporting-text"]?(t.openBlock(),t.createElementBlock("span",Ct,[t.renderSlot(e.$slots,"supporting-text")])):t.createCommentVNode("",!0)])]),_:3},8,["href","class"])}const _t=k(ht,[["render",Bt]]);function L(e,n,l){return t.computed({get:()=>e.value,set:s=>n(l||"update:modelValue",s)})}const kt=t.defineComponent({name:"CdxCheckbox",props:{modelValue:{type:[Boolean,Array],default:!1},inputValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},inline:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:n}){const l=t.computed(()=>({"cdx-checkbox--inline":e.inline})),s=t.ref(),r=t.ref(),i=()=>{s.value.focus()},a=()=>{r.value.click()},d=L(t.toRef(e,"modelValue"),n);return{rootClasses:l,input:s,label:r,focusInput:i,clickLabel:a,wrappedModel:d}}}),Mo="",$t=["value","disabled",".indeterminate"],At=t.createElementVNode("span",{class:"cdx-checkbox__icon"},null,-1),wt={class:"cdx-checkbox__label-content"};function St(e,n,l,s,r,i){return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["cdx-checkbox",e.rootClasses])},[t.createElementVNode("label",{ref:"label",class:"cdx-checkbox__label",onClick:n[1]||(n[1]=(...a)=>e.focusInput&&e.focusInput(...a)),onKeydown:n[2]||(n[2]=t.withKeys(t.withModifiers((...a)=>e.clickLabel&&e.clickLabel(...a),["prevent"]),["enter"]))},[t.withDirectives(t.createElementVNode("input",{ref:"input","onUpdate:modelValue":n[0]||(n[0]=a=>e.wrappedModel=a),class:"cdx-checkbox__input",type:"checkbox",value:e.inputValue,disabled:e.disabled,".indeterminate":e.indeterminate},null,8,$t),[[t.vModelCheckbox,e.wrappedModel]]),At,t.createElementVNode("span",wt,[t.renderSlot(e.$slots,"default")])],544)],2)}const xt=k(kt,[["render",St]]);function se(e){return e.replace(/([\\{}()|.?*+\-^$[\]])/g,"\\$1")}const Et="[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]";function re(e,n){if(!e)return[n,"",""];const l=se(e),s=new RegExp(l+Et+"*","i").exec(n);if(!s||s.index===void 0)return[n,"",""];const r=s.index,i=r+s[0].length,a=n.slice(r,i),d=n.slice(0,r),o=n.slice(i,n.length);return[d,a,o]}const It=Object.freeze(Object.defineProperty({__proto__:null,regExpEscape:se,splitStringAtMatch:re},Symbol.toStringTag,{value:"Module"})),Vt=t.defineComponent({name:"CdxSearchResultTitle",props:{title:{type:String,required:!0},searchQuery:{type:String,default:""}},setup:e=>({titleChunks:t.computed(()=>re(e.searchQuery,String(e.title)))})}),No="",Dt={class:"cdx-search-result-title"},Mt={class:"cdx-search-result-title__match"};function Nt(e,n,l,s,r,i){return t.openBlock(),t.createElementBlock("span",Dt,[t.createElementVNode("bdi",null,[t.createTextVNode(t.toDisplayString(e.titleChunks[0]),1),t.createElementVNode("span",Mt,t.toDisplayString(e.titleChunks[1]),1),t.createTextVNode(t.toDisplayString(e.titleChunks[2]),1)])])}const ie=k(Vt,[["render",Nt]]),Tt=t.defineComponent({name:"CdxMenuItem",components:{CdxIcon:T,CdxThumbnail:Y,CdxSearchResultTitle:ie},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:""},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:()=>({})}},emits:["change"],setup:(e,{emit:n})=>{const l=()=>{n("change","highlighted",!0)},s=()=>{n("change","highlighted",!1)},r=c=>{c.button===0&&n("change","active",!0)},i=()=>{n("change","selected",!0)},a=t.computed(()=>e.searchQuery.length>0),d=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--enabled":!e.disabled,"cdx-menu-item--disabled":e.disabled,"cdx-menu-item--highlight-query":a.value,"cdx-menu-item--bold-label":e.boldLabel,"cdx-menu-item--has-description":!!e.description,"cdx-menu-item--hide-description-overflow":e.hideDescriptionOverflow})),o=t.computed(()=>e.url?"a":"span"),u=t.computed(()=>e.label||String(e.value));return{onMouseEnter:l,onMouseLeave:s,onMouseDown:r,onClick:i,highlightQuery:a,rootClasses:d,contentTag:o,title:u}}}),To="",Ft=["id","aria-disabled","aria-selected"],Lt={class:"cdx-menu-item__text"},Rt=["lang"],zt=t.createTextVNode(t.toDisplayString(" ")+" "),Kt=["lang"],vt=["lang"];function qt(e,n,l,s,r,i){const a=t.resolveComponent("cdx-thumbnail"),d=t.resolveComponent("cdx-icon"),o=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,onMouseenter:n[0]||(n[0]=(...u)=>e.onMouseEnter&&e.onMouseEnter(...u)),onMouseleave:n[1]||(n[1]=(...u)=>e.onMouseLeave&&e.onMouseLeave(...u)),onMousedown:n[2]||(n[2]=t.withModifiers((...u)=>e.onMouseDown&&e.onMouseDown(...u),["prevent"])),onClick:n[3]||(n[3]=(...u)=>e.onClick&&e.onClick(...u))},[t.renderSlot(e.$slots,"default",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.contentTag),{href:e.url?e.url:void 0,class:"cdx-menu-item__content"},{default:t.withCtx(()=>{var u,c,h,y,A;return[e.showThumbnail?(t.openBlock(),t.createBlock(a,{key:0,thumbnail:e.thumbnail,class:"cdx-menu-item__thumbnail"},null,8,["thumbnail"])):e.icon?(t.openBlock(),t.createBlock(d,{key:1,icon:e.icon,class:"cdx-menu-item__icon"},null,8,["icon"])):t.createCommentVNode("",!0),t.createElementVNode("span",Lt,[e.highlightQuery?(t.openBlock(),t.createBlock(o,{key:0,title:e.title,"search-query":e.searchQuery,lang:(u=e.language)==null?void 0:u.label},null,8,["title","search-query","lang"])):(t.openBlock(),t.createElementBlock("span",{key:1,class:"cdx-menu-item__text__label",lang:(c=e.language)==null?void 0:c.label},[t.createElementVNode("bdi",null,t.toDisplayString(e.title),1)],8,Rt)),e.match?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[zt,e.highlightQuery?(t.openBlock(),t.createBlock(o,{key:0,title:e.match,"search-query":e.searchQuery,lang:(h=e.language)==null?void 0:h.match},null,8,["title","search-query","lang"])):(t.openBlock(),t.createElementBlock("span",{key:1,class:"cdx-menu-item__text__match",lang:(y=e.language)==null?void 0:y.match},[t.createElementVNode("bdi",null,t.toDisplayString(e.match),1)],8,Kt))],64)):t.createCommentVNode("",!0),e.description?(t.openBlock(),t.createElementBlock("span",{key:3,class:"cdx-menu-item__text__description",lang:(A=e.language)==null?void 0:A.description},[t.createElementVNode("bdi",null,t.toDisplayString(e.description),1)],8,vt)):t.createCommentVNode("",!0)])]}),_:1},8,["href"]))])],42,Ft)}const de=k(Tt,[["render",qt]]),Ot=t.defineComponent({name:"CdxProgressBar",props:{inline:{type:Boolean,default:!1}},setup(e){return{rootClasses:t.computed(()=>({"cdx-progress-bar--block":!e.inline,"cdx-progress-bar--inline":e.inline}))}}}),Fo="",Ut=[t.createElementVNode("div",{class:"cdx-progress-bar__bar"},null,-1)];function Pt(e,n,l,s,r,i){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-progress-bar",e.rootClasses]),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100"},Ut,2)}const ue=k(Ot,[["render",Pt]]);let Z=0;function R(e){const n=t.getCurrentInstance(),l=(n==null?void 0:n.props.id)||(n==null?void 0:n.attrs.id);return e?`${V}-${e}-${Z++}`:l?`${V}-${l}-${Z++}`:`${V}-${Z++}`}const jt=t.defineComponent({name:"CdxMenu",components:{CdxMenuItem:de,CdxProgressBar:ue},props:{menuItems:{type:Array,required:!0},selected:{type:[String,Number,null],required:!0},expanded:{type:Boolean,required:!0},showPending:{type:Boolean,default:!1},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"],expose:["clearActive","getHighlightedMenuItem","delegateKeyNavigation"],setup(e,{emit:n,slots:l}){const s=t.computed(()=>e.menuItems.map(m=>Ce(ye({},m),{id:R("menu-item")}))),r=t.computed(()=>l["no-results"]?e.showNoResultsSlot!==null?e.showNoResultsSlot:s.value.length===0:!1),i=t.ref(null),a=t.ref(null);function d(){return s.value.find(m=>m.value===e.selected)}function o(m,f){var g;if(!(f&&f.disabled))switch(m){case"selected":n("update:selected",(g=f==null?void 0:f.value)!=null?g:null),n("update:expanded",!1),a.value=null;break;case"highlighted":i.value=f||null;break;case"active":a.value=f||null;break}}const u=t.computed(()=>{if(i.value!==null)return s.value.findIndex(m=>m.value===i.value.value)});function c(m){!m||(o("highlighted",m),n("menu-item-keyboard-navigation",m))}function h(m){var E;const f=I=>{for(let D=I-1;D>=0;D--)if(!s.value[D].disabled)return s.value[D]};m=m||s.value.length;const g=(E=f(m))!=null?E:f(s.value.length);c(g)}function y(m){const f=E=>s.value.find((I,D)=>!I.disabled&&D>E);m=m!=null?m:-1;const g=f(m)||f(-1);c(g)}function A(m,f=!0){function g(){n("update:expanded",!0),o("highlighted",d())}function E(){f&&(m.preventDefault(),m.stopPropagation())}switch(m.key){case"Enter":case" ":return E(),e.expanded?(i.value&&n("update:selected",i.value.value),n("update:expanded",!1)):g(),!0;case"Tab":return e.expanded&&(i.value&&n("update:selected",i.value.value),n("update:expanded",!1)),!0;case"ArrowUp":return E(),e.expanded?(i.value===null&&o("highlighted",d()),h(u.value)):g(),!0;case"ArrowDown":return E(),e.expanded?(i.value===null&&o("highlighted",d()),y(u.value)):g(),!0;case"Home":return E(),e.expanded?(i.value===null&&o("highlighted",d()),y()):g(),!0;case"End":return E(),e.expanded?(i.value===null&&o("highlighted",d()),h()):g(),!0;case"Escape":return E(),n("update:expanded",!1),!0;default:return!1}}function S(){o("active")}return t.onMounted(()=>{document.addEventListener("mouseup",S)}),t.onUnmounted(()=>{document.removeEventListener("mouseup",S)}),t.watch(t.toRef(e,"expanded"),m=>{const f=d();!m&&i.value&&f===void 0&&o("highlighted"),m&&f!==void 0&&o("highlighted",f)}),{computedMenuItems:s,computedShowNoResultsSlot:r,highlightedMenuItem:i,activeMenuItem:a,handleMenuItemChange:o,handleKeyNavigation:A}},methods:{getHighlightedMenuItem(){return this.highlightedMenuItem},clearActive(){this.handleMenuItemChange("active")},delegateKeyNavigation(e,n=!0){return this.handleKeyNavigation(e,n)}}}),Ro="",Ht={class:"cdx-menu",role:"listbox","aria-multiselectable":"false"},Wt={key:0,class:"cdx-menu__pending cdx-menu-item"},Qt={key:1,class:"cdx-menu__no-results cdx-menu-item"};function Gt(e,n,l,s,r,i){const a=t.resolveComponent("cdx-menu-item"),d=t.resolveComponent("cdx-progress-bar");return t.withDirectives((t.openBlock(),t.createElementBlock("ul",Ht,[e.showPending&&e.computedMenuItems.length===0&&e.$slots.pending?(t.openBlock(),t.createElementBlock("li",Wt,[t.renderSlot(e.$slots,"pending")])):t.createCommentVNode("",!0),e.computedShowNoResultsSlot?(t.openBlock(),t.createElementBlock("li",Qt,[t.renderSlot(e.$slots,"no-results")])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedMenuItems,o=>{var u,c;return t.openBlock(),t.createBlock(a,t.mergeProps({key:o.value},o,{selected:o.value===e.selected,active:o.value===((u=e.activeMenuItem)==null?void 0:u.value),highlighted:o.value===((c=e.highlightedMenuItem)==null?void 0:c.value),"show-thumbnail":e.showThumbnail,"bold-label":e.boldLabel,"hide-description-overflow":e.hideDescriptionOverflow,"search-query":e.searchQuery,onChange:(h,y)=>e.handleMenuItemChange(h,y&&o),onClick:h=>e.$emit("menu-item-click",o)}),{default:t.withCtx(()=>{var h,y;return[t.renderSlot(e.$slots,"default",{menuItem:o,active:o.value===((h=e.activeMenuItem)==null?void 0:h.value)&&o.value===((y=e.highlightedMenuItem)==null?void 0:y.value)})]}),_:2},1040,["selected","active","highlighted","show-thumbnail","bold-label","hide-description-overflow","search-query","onChange","onClick"])}),128)),e.showPending?(t.openBlock(),t.createBlock(d,{key:2,class:"cdx-menu__progress-bar",inline:!0})):t.createCommentVNode("",!0)],512)),[[t.vShow,e.expanded]])}const P=k(jt,[["render",Gt]]);function K(e,n=t.computed(()=>({}))){const l=t.computed(()=>{const i=G(n.value,[]);return e.class&&e.class.split(" ").forEach(d=>{i[d]=!0}),i}),s=t.computed(()=>{if("style"in e)return e.style}),r=t.computed(()=>{const o=e,{class:i,style:a}=o;return G(o,["class","style"])});return{rootClasses:l,rootStyle:s,otherAttrs:r}}const Jt=j(ke),Xt=t.defineComponent({name:"CdxTextInput",components:{CdxIcon:T},inheritAttrs:!1,expose:["focus"],props:{modelValue:{type:[String,Number],default:""},inputType:{type:String,default:"text",validator:Jt},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","input","change","focus","blur"],setup(e,{emit:n,attrs:l}){const s=L(t.toRef(e,"modelValue"),n),r=t.computed(()=>e.clearable&&!!s.value&&!e.disabled),i=t.computed(()=>({"cdx-text-input--has-start-icon":!!e.startIcon,"cdx-text-input--has-end-icon":!!e.endIcon,"cdx-text-input--clearable":r.value})),{rootClasses:a,rootStyle:d,otherAttrs:o}=K(l,i),u=t.computed(()=>({"cdx-text-input__input--has-value":!!s.value}));return{wrappedModel:s,isClearable:r,rootClasses:a,rootStyle:d,otherAttrs:o,inputClasses:u,onClear:()=>{s.value=""},onInput:m=>{n("input",m)},onChange:m=>{n("change",m)},onFocus:m=>{n("focus",m)},onBlur:m=>{n("blur",m)},cdxIconClear:Ke}},methods:{focus(){this.$refs.input.focus()}}}),zo="",Yt=["type","disabled"];function Zt(e,n,l,s,r,i){const a=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({ref:"input","onUpdate:modelValue":n[0]||(n[0]=d=>e.wrappedModel=d),class:["cdx-text-input__input",e.inputClasses]},e.otherAttrs,{type:e.inputType,disabled:e.disabled,onInput:n[1]||(n[1]=(...d)=>e.onInput&&e.onInput(...d)),onChange:n[2]||(n[2]=(...d)=>e.onChange&&e.onChange(...d)),onFocus:n[3]||(n[3]=(...d)=>e.onFocus&&e.onFocus(...d)),onBlur:n[4]||(n[4]=(...d)=>e.onBlur&&e.onBlur(...d))}),null,16,Yt),[[t.vModelDynamic,e.wrappedModel]]),e.startIcon?(t.openBlock(),t.createBlock(a,{key:0,icon:e.startIcon,class:"cdx-text-input__icon cdx-text-input__start-icon"},null,8,["icon"])):t.createCommentVNode("",!0),e.endIcon?(t.openBlock(),t.createBlock(a,{key:1,icon:e.endIcon,class:"cdx-text-input__icon cdx-text-input__end-icon"},null,8,["icon"])):t.createCommentVNode("",!0),e.isClearable?(t.openBlock(),t.createBlock(a,{key:2,icon:e.cdxIconClear,class:"cdx-text-input__icon cdx-text-input__clear-icon",onMousedown:n[5]||(n[5]=t.withModifiers(()=>{},["prevent"])),onClick:e.onClear},null,8,["icon","onClick"])):t.createCommentVNode("",!0)],6)}const H=k(Xt,[["render",Zt]]),en=t.defineComponent({name:"CdxCombobox",components:{CdxButton:O,CdxIcon:T,CdxMenu:P,CdxTextInput:H},inheritAttrs:!1,props:{menuItems:{type:Array,required:!0},selected:{type:[String,Number],required:!0},disabled:{type:Boolean,default:!1},menuConfig:{type:Object,default:()=>({})}},emits:["update:selected"],setup(e,{emit:n,attrs:l,slots:s}){const r=t.ref(),i=t.ref(),a=R("combobox"),d=t.toRef(e,"selected"),o=L(d,n,"update:selected"),u=t.ref(!1),c=t.ref(!1),h=t.computed(()=>{var M,B;return(B=(M=i.value)==null?void 0:M.getHighlightedMenuItem())==null?void 0:B.id}),y=t.computed(()=>({"cdx-combobox--disabled":e.disabled})),{rootClasses:A,rootStyle:S,otherAttrs:m}=K(l,y);function f(){c.value&&u.value?u.value=!1:(e.menuItems.length>0||s["no-results"])&&(u.value=!0)}function g(){u.value=c.value&&u.value}function E(){e.disabled||(c.value=!0)}function I(){var M;e.disabled||(M=r.value)==null||M.focus()}function D(M){!i.value||e.disabled||e.menuItems.length===0||M.key===" "&&u.value||i.value.delegateKeyNavigation(M)}return t.watch(u,()=>{c.value=!1}),{input:r,menu:i,menuId:a,modelWrapper:o,expanded:u,highlightedId:h,onInputFocus:f,onInputBlur:g,onKeydown:D,onButtonClick:I,onButtonMousedown:E,cdxIconExpand:oe,rootClasses:A,rootStyle:S,otherAttrs:m}}}),Ko="",tn={class:"cdx-combobox__input-wrapper"};function nn(e,n,l,s,r,i){const a=t.resolveComponent("cdx-text-input"),d=t.resolveComponent("cdx-icon"),o=t.resolveComponent("cdx-button"),u=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-combobox",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("div",tn,[t.createVNode(a,t.mergeProps({ref:"input",modelValue:e.modelWrapper,"onUpdate:modelValue":n[0]||(n[0]=c=>e.modelWrapper=c)},e.otherAttrs,{class:"cdx-combobox__input","aria-activedescendant":e.highlightedId,"aria-expanded":e.expanded,"aria-owns":e.menuId,disabled:e.disabled,"aria-autocomplete":"list",autocomplete:"off",role:"combobox",onKeydown:e.onKeydown,onFocus:e.onInputFocus,onBlur:e.onInputBlur}),null,16,["modelValue","aria-activedescendant","aria-expanded","aria-owns","disabled","onKeydown","onFocus","onBlur"]),t.createVNode(o,{class:"cdx-combobox__expand-button","aria-hidden":"true",disabled:e.disabled,tabindex:"-1",onMousedown:e.onButtonMousedown,onClick:e.onButtonClick},{default:t.withCtx(()=>[t.createVNode(d,{class:"cdx-combobox__expand-icon",icon:e.cdxIconExpand},null,8,["icon"])]),_:1},8,["disabled","onMousedown","onClick"])]),t.createVNode(u,t.mergeProps({id:e.menuId,ref:"menu",selected:e.modelWrapper,"onUpdate:selected":n[1]||(n[1]=c=>e.modelWrapper=c),expanded:e.expanded,"onUpdate:expanded":n[2]||(n[2]=c=>e.expanded=c),"menu-items":e.menuItems},e.menuConfig),{default:t.withCtx(({menuItem:c})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:c})]),"no-results":t.withCtx(()=>[t.renderSlot(e.$slots,"no-results")]),_:3},16,["id","selected","expanded","menu-items"])],6)}const on=k(en,[["render",nn]]),ln=t.defineComponent({name:"CdxLookup",components:{CdxMenu:P,CdxTextInput:H},inheritAttrs:!1,props:{selected:{type:[String,Number,null],required:!0},menuItems:{type:Array,required:!0},initialInputValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},menuConfig:{type:Object,default:()=>({})}},emits:["update:selected","input"],setup:(e,{emit:n,attrs:l,slots:s})=>{const r=t.ref(),i=R("lookup-menu"),a=t.ref(!1),d=t.ref(!1),o=t.ref(!1),u=t.toRef(e,"selected"),c=L(u,n,"update:selected"),h=t.computed(()=>e.menuItems.find(B=>B.value===e.selected)),y=t.computed(()=>{var B,U;return(U=(B=r.value)==null?void 0:B.getHighlightedMenuItem())==null?void 0:U.id}),A=t.ref(e.initialInputValue),S=t.computed(()=>({"cdx-lookup--disabled":e.disabled,"cdx-lookup--pending":a.value})),{rootClasses:m,rootStyle:f,otherAttrs:g}=K(l,S);function E(B){h.value&&h.value.label!==B&&h.value.value!==B&&(c.value=null),B===""?(d.value=!1,a.value=!1):a.value=!0,n("input",B)}function I(){o.value=!0,A.value!==null&&A.value!==""&&(e.menuItems.length>0||s["no-results"])&&(d.value=!0)}function D(){o.value=!1,d.value=!1}function M(B){!r.value||e.disabled||e.menuItems.length===0&&!s["no-results"]||B.key===" "&&d.value||r.value.delegateKeyNavigation(B)}return t.watch(u,B=>{B!==null&&(A.value=h.value?h.value.label||h.value.value:"",n("input",A.value))}),t.watch(t.toRef(e,"menuItems"),B=>{o.value&&a.value&&(B.length>0||s["no-results"])&&(d.value=!0),B.length===0&&!s["no-results"]&&(d.value=!1),a.value=!1}),{menu:r,menuId:i,highlightedId:y,inputValue:A,modelWrapper:c,expanded:d,onInputBlur:D,rootClasses:m,rootStyle:f,otherAttrs:g,onUpdateInput:E,onInputFocus:I,onKeydown:M}}}),vo="";function an(e,n,l,s,r,i){const a=t.resolveComponent("cdx-text-input"),d=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-lookup",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createVNode(a,t.mergeProps({modelValue:e.inputValue,"onUpdate:modelValue":n[0]||(n[0]=o=>e.inputValue=o)},e.otherAttrs,{class:"cdx-lookup__input",role:"combobox",autocomplete:"off","aria-autocomplete":"list","aria-owns":e.menuId,"aria-expanded":e.expanded,"aria-activedescendant":e.highlightedId,disabled:e.disabled,"onUpdate:modelValue":e.onUpdateInput,onFocus:e.onInputFocus,onBlur:e.onInputBlur,onKeydown:e.onKeydown}),null,16,["modelValue","aria-owns","aria-expanded","aria-activedescendant","disabled","onUpdate:modelValue","onFocus","onBlur","onKeydown"]),t.createVNode(d,t.mergeProps({id:e.menuId,ref:"menu",selected:e.modelWrapper,"onUpdate:selected":n[1]||(n[1]=o=>e.modelWrapper=o),expanded:e.expanded,"onUpdate:expanded":n[2]||(n[2]=o=>e.expanded=o),"menu-items":e.menuItems},e.menuConfig),{default:t.withCtx(({menuItem:o})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:o})]),"no-results":t.withCtx(()=>[t.renderSlot(e.$slots,"no-results")]),_:3},16,["id","selected","expanded","menu-items"])],6)}const sn=k(ln,[["render",an]]),rn=j(_e),dn={notice:Ue,error:qe,warning:Le,success:ze},un=t.defineComponent({name:"CdxMessage",components:{CdxButton:O,CdxIcon:T},props:{type:{type:String,default:"notice",validator:rn},inline:{type:Boolean,default:!1},icon:{type:[String,Object],default:null},fadeIn:{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 l=t.ref(!1),s=t.computed(()=>e.inline===!1&&e.dismissButtonLabel.length>0),r=t.computed(()=>e.autoDismiss===!1?!1:e.autoDismiss===!0?4e3:e.autoDismiss),i=t.computed(()=>({"cdx-message--inline":e.inline,"cdx-message--block":!e.inline,"cdx-message--user-dismissable":s.value,[`cdx-message--${e.type}`]:!0})),a=t.computed(()=>e.icon&&e.type==="notice"?e.icon:dn[e.type]),d=t.ref("");function o(u){l.value||(d.value=u==="user-dismissed"?"cdx-message-leave-active-user":"cdx-message-leave-active-system",l.value=!0,n(u))}return t.onMounted(()=>{r.value&&setTimeout(()=>o("auto-dismissed"),r.value)}),{dismissed:l,userDismissable:s,rootClasses:i,leaveActiveClass:d,computedIcon:a,onDismiss:o,cdxIconClose:ve}}}),qo="",cn=["aria-live","role"],pn={class:"cdx-message__content"};function mn(e,n,l,s,r,i){const a=t.resolveComponent("cdx-icon"),d=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("",!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(a,{class:"cdx-message__icon",icon:e.computedIcon},null,8,["icon"]),t.createElementVNode("div",pn,[t.renderSlot(e.$slots,"default")]),e.userDismissable?(t.openBlock(),t.createBlock(d,{key:0,class:"cdx-message__dismiss-button",type:"quiet","aria-label":e.dismissButtonLabel,onClick:n[0]||(n[0]=o=>e.onDismiss("user-dismissed"))},{default:t.withCtx(()=>[t.createVNode(a,{icon:e.cdxIconClose,"icon-label":e.dismissButtonLabel},null,8,["icon","icon-label"])]),_:1},8,["aria-label"])):t.createCommentVNode("",!0)],10,cn))]),_:3},8,["appear","leave-active-class"])}const fn=k(un,[["render",mn]]),hn=t.defineComponent({name:"CdxRadio",props:{modelValue:{type:[String,Number,Boolean],default:""},inputValue:{type:[String,Number,Boolean],default:!1},name:{type:String,default:""},disabled:{type:Boolean,default:!1},inline:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:n}){const l=t.computed(()=>({"cdx-radio--inline":e.inline})),s=t.ref(),r=()=>{s.value.focus()},i=L(t.toRef(e,"modelValue"),n);return{rootClasses:l,input:s,focusInput:r,wrappedModel:i}}}),Oo="",bn=["name","value","disabled"],gn=t.createElementVNode("span",{class:"cdx-radio__icon"},null,-1),yn={class:"cdx-radio__label-content"};function Cn(e,n,l,s,r,i){return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["cdx-radio",e.rootClasses])},[t.createElementVNode("label",{class:"cdx-radio__label",onClick:n[1]||(n[1]=(...a)=>e.focusInput&&e.focusInput(...a))},[t.withDirectives(t.createElementVNode("input",{ref:"input","onUpdate:modelValue":n[0]||(n[0]=a=>e.wrappedModel=a),class:"cdx-radio__input",type:"radio",name:e.name,value:e.inputValue,disabled:e.disabled},null,8,bn),[[t.vModelRadio,e.wrappedModel]]),gn,t.createElementVNode("span",yn,[t.renderSlot(e.$slots,"default")])])],2)}const Bn=k(hn,[["render",Cn]]),_n=t.defineComponent({name:"CdxSearchInput",components:{CdxButton:O,CdxTextInput:H},inheritAttrs:!1,props:{modelValue:{type:[String,Number],default:""},buttonLabel:{type:String,default:""}},emits:["update:modelValue","submit-click"],setup(e,{emit:n,attrs:l}){const s=L(t.toRef(e,"modelValue"),n),r=t.computed(()=>({"cdx-search-input--has-end-button":!!e.buttonLabel})),{rootClasses:i,rootStyle:a,otherAttrs:d}=K(l,r);return{wrappedModel:s,rootClasses:i,rootStyle:a,otherAttrs:d,handleSubmit:()=>{n("submit-click",s.value)},searchIcon:He}},methods:{focus(){this.$refs.textInput.focus()}}}),Uo="",kn={class:"cdx-search-input__input-wrapper"};function $n(e,n,l,s,r,i){const a=t.resolveComponent("cdx-text-input"),d=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",kn,[t.createVNode(a,t.mergeProps({ref:"textInput",modelValue:e.wrappedModel,"onUpdate:modelValue":n[0]||(n[0]=o=>e.wrappedModel=o),class:"cdx-search-input__text-input","input-type":"search","start-icon":e.searchIcon},e.otherAttrs,{onKeydown:t.withKeys(e.handleSubmit,["enter"])}),null,16,["modelValue","start-icon","onKeydown"]),t.renderSlot(e.$slots,"default")]),e.buttonLabel?(t.openBlock(),t.createBlock(d,{key:0,class:"cdx-search-input__end-button",onClick:e.handleSubmit},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.buttonLabel),1)]),_:1},8,["onClick"])):t.createCommentVNode("",!0)],6)}const ce=k(_n,[["render",$n]]),An=t.defineComponent({name:"CdxSelect",components:{CdxIcon:T,CdxMenu:P},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}},emits:["update:selected"],setup(e,{emit:n}){const l=t.ref(),s=t.ref(),r=R("select-handle"),i=R("select-menu"),a=t.ref(!1),d=L(t.toRef(e,"selected"),n,"update:selected"),o=t.computed(()=>e.menuItems.find(f=>f.value===e.selected)),u=t.computed(()=>o.value?o.value.label||o.value.value:e.defaultLabel),c=t.computed(()=>{if(e.defaultIcon&&!o.value)return e.defaultIcon;if(o.value&&o.value.icon)return o.value.icon}),h=t.computed(()=>({"cdx-select--enabled":!e.disabled,"cdx-select--disabled":e.disabled,"cdx-select--expanded":a.value,"cdx-select--value-selected":!!o.value,"cdx-select--no-selections":!o.value,"cdx-select--has-start-icon":!!c.value})),y=t.computed(()=>{var f,g;return(g=(f=s.value)==null?void 0:f.getHighlightedMenuItem())==null?void 0:g.id});function A(){a.value=!1}function S(){var f;e.disabled||(a.value=!a.value,(f=l.value)==null||f.focus())}function m(f){var g;e.disabled||(g=s.value)==null||g.delegateKeyNavigation(f)}return{handle:l,handleId:r,menu:s,menuId:i,modelWrapper:d,selectedMenuItem:o,highlightedId:y,expanded:a,onBlur:A,currentLabel:u,rootClasses:h,onClick:S,onKeydown:m,startIcon:c,cdxIconExpand:oe}}}),Po="",wn=["aria-disabled"],Sn=["aria-owns","aria-labelledby","aria-activedescendant","aria-expanded"],xn=["id"];function En(e,n,l,s,r,i){const a=t.resolveComponent("cdx-icon"),d=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-select",e.rootClasses]),"aria-disabled":e.disabled},[t.createElementVNode("div",{ref:"handle",class:"cdx-select__handle",tabindex:"0",role:"combobox","aria-autocomplete":"list","aria-owns":e.menuId,"aria-labelledby":e.handleId,"aria-activedescendant":e.highlightedId,"aria-haspopup":"listbox","aria-expanded":e.expanded,onClick:n[0]||(n[0]=(...o)=>e.onClick&&e.onClick(...o)),onBlur:n[1]||(n[1]=(...o)=>e.onBlur&&e.onBlur(...o)),onKeydown:n[2]||(n[2]=(...o)=>e.onKeydown&&e.onKeydown(...o))},[t.createElementVNode("span",{id:e.handleId,role:"textbox","aria-readonly":"true"},[t.renderSlot(e.$slots,"label",{selectedMenuItem:e.selectedMenuItem,defaultLabel:e.defaultLabel},()=>[t.createTextVNode(t.toDisplayString(e.currentLabel),1)])],8,xn),e.startIcon?(t.openBlock(),t.createBlock(a,{key:0,icon:e.startIcon,class:"cdx-select__start-icon"},null,8,["icon"])):t.createCommentVNode("",!0),t.createVNode(a,{icon:e.cdxIconExpand,class:"cdx-select__indicator"},null,8,["icon"])],40,Sn),t.createVNode(d,t.mergeProps({id:e.menuId,ref:"menu",selected:e.modelWrapper,"onUpdate:selected":n[3]||(n[3]=o=>e.modelWrapper=o),expanded:e.expanded,"onUpdate:expanded":n[4]||(n[4]=o=>e.expanded=o),"menu-items":e.menuItems},e.menuConfig),{default:t.withCtx(({menuItem:o})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:o})]),_:3},16,["id","selected","expanded","menu-items"])],10,wn)}const In=k(An,[["render",En]]),Vn=t.defineComponent({name:"CdxTab",props:{name:{type:String,required:!0},label:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(e){const n=t.inject(te),l=t.inject(ne);if(!n||!l)throw new Error("Tab component must be used inside a Tabs component");const s=n.value.get(e.name)||{},r=t.computed(()=>e.name===l.value);return{tab:s,isActive:r}}}),jo="",Dn=["id","aria-hidden","aria-labelledby"];function Mn(e,n,l,s,r,i){return t.withDirectives((t.openBlock(),t.createElementBlock("section",{id:e.tab.id,"aria-hidden":!e.isActive,"aria-labelledby":`${e.tab.id}-label`,class:"cdx-tab",role:"tabpanel",tabindex:"-1"},[t.renderSlot(e.$slots,"default")],8,Dn)),[[t.vShow,e.isActive]])}const Nn=k(Vn,[["render",Mn]]);function ee(e,n){const l=t.ref(!1);let s=!1;if(typeof window!="object"||!("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype))return l;const r=new window.IntersectionObserver(i=>{const a=i[0];a&&(l.value=a.isIntersecting)},n);return t.onMounted(()=>{s=!0,e.value&&r.observe(e.value)}),t.onUnmounted(()=>{s=!1,r.disconnect()}),t.watch(e,i=>{!s||(r.disconnect(),l.value=!1,i&&r.observe(i))}),l}const Tn=t.defineComponent({name:"CdxTabs",components:{CdxButton:O,CdxIcon:T},props:{active:{type:String,required:!0},framed:{type:Boolean,default:!1}},emits:["update:active"],expose:["select","next","prev"],setup(e,{slots:n,emit:l}){const s=t.ref(),r=t.ref(),i=t.ref(),a=t.ref(),d=t.ref(),o=J(s),u=t.computed(()=>{var x;const C=[],$=(x=n.default)==null?void 0:x.call(n);$&&$.forEach(w);function w(_){_&&typeof _=="object"&&"type"in _&&(typeof _.type=="object"&&"name"in _.type&&_.type.name==="CdxTab"?C.push(_):"children"in _&&Array.isArray(_.children)&&_.children.forEach(w))}return C});if(!u.value||u.value.length===0)throw new Error("Slot content cannot be empty");const c=t.computed(()=>u.value.reduce((C,$)=>{var w;if(((w=$.props)==null?void 0:w.name)&&typeof $.props.name=="string"){if(C.get($.props.name))throw new Error("Tab names must be unique");C.set($.props.name,{name:$.props.name,id:R($.props.name),label:$.props.label||$.props.name,disabled:$.props.disabled})}return C},new Map)),h=L(t.toRef(e,"active"),l,"update:active"),y=t.computed(()=>Array.from(c.value.keys())),A=t.computed(()=>y.value.indexOf(h.value)),S=t.computed(()=>{var C;return(C=c.value.get(h.value))==null?void 0:C.id});t.provide(ne,h),t.provide(te,c);const m=t.ref(),f=t.ref(),g=ee(m,{threshold:.95}),E=ee(f,{threshold:.95});function I(C,$){const w=C;w&&($===0?m.value=w:$===y.value.length-1&&(f.value=w))}function D(C){var x;const $=C===h.value,w=!!((x=c.value.get(C))!=null&&x.disabled);return{"cdx-tabs__list__item--selected":$,"cdx-tabs__list__item--enabled":!w,"cdx-tabs__list__item--disabled":w}}const M=t.computed(()=>({"cdx-tabs--framed":e.framed,"cdx-tabs--quiet":!e.framed}));function B(C){if(!r.value||!a.value||!d.value)return 0;const $=o.value==="rtl"?d.value:a.value,w=o.value==="rtl"?a.value:d.value,x=C.offsetLeft,_=x+C.clientWidth,z=r.value.scrollLeft+$.clientWidth,W=r.value.scrollLeft+r.value.clientWidth-w.clientWidth;return x<z?x-z:_>W?_-W:0}function U(C){var _;if(!r.value||!a.value||!d.value)return;const $=C==="next"&&o.value==="ltr"||C==="prev"&&o.value==="rtl"?1:-1;let w=0,x=C==="next"?r.value.firstElementChild:r.value.lastElementChild;for(;x;){const z=C==="next"?x.nextElementSibling:x.previousElementSibling;if(w=B(x),Math.sign(w)===$){z&&Math.abs(w)<.25*r.value.clientWidth&&(w=B(z));break}x=z}r.value.scrollBy({left:w,behavior:"smooth"}),(_=i.value)==null||_.focus()}return t.watch(h,()=>{if(S.value===void 0||!r.value||!a.value||!d.value)return;const C=document.getElementById(`${S.value}-label`);!C||r.value.scrollBy({left:B(C),behavior:"smooth"})}),{activeTab:h,activeTabIndex:A,activeTabId:S,currentDirection:o,rootElement:s,listElement:r,focusHolder:i,prevScroller:a,nextScroller:d,rootClasses:M,tabNames:y,tabsData:c,firstLabelVisible:g,lastLabelVisible:E,getLabelClasses:D,assignTemplateRefIfNecessary:I,scrollTabs:U,cdxIconPrevious:je,cdxIconNext:Pe}},methods:{select(e){const n=this.tabsData.get(e);n&&!(n!=null&&n.disabled)&&(this.activeTab=e)},selectNonDisabled(e,n){const l=this.tabsData.get(this.tabNames[e+n]);l&&(l.disabled?this.selectNonDisabled(e+n,n):this.select(l.name))},next(){this.selectNonDisabled(this.activeTabIndex,1)},prev(){this.selectNonDisabled(this.activeTabIndex,-1)},onLeftArrowKeypress(){this.currentDirection==="rtl"?this.next():this.prev()},onRightArrowKeypress(){this.currentDirection==="rtl"?this.prev():this.next()},onDownArrowKeypress(){var e;this.activeTabId&&((e=document.getElementById(this.activeTabId))==null||e.focus())}}}),Ho="",Fn={ref:"focusHolder",tabindex:"-1"},Ln={ref:"prevScroller",class:"cdx-tabs__prev-scroller"},Rn=["aria-activedescendant"],zn=["id"],Kn=["href","aria-selected","onClick","onKeyup"],vn={ref:"nextScroller",class:"cdx-tabs__next-scroller"},qn={class:"cdx-tabs__content"};function On(e,n,l,s,r,i){const a=t.resolveComponent("cdx-icon"),d=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-tabs",e.rootClasses])},[t.createElementVNode("div",{class:"cdx-tabs__header",tabindex:"0",onKeydown:[n[4]||(n[4]=t.withKeys(t.withModifiers((...o)=>e.onRightArrowKeypress&&e.onRightArrowKeypress(...o),["prevent"]),["right"])),n[5]||(n[5]=t.withKeys(t.withModifiers((...o)=>e.onDownArrowKeypress&&e.onDownArrowKeypress(...o),["prevent"]),["down"])),n[6]||(n[6]=t.withKeys(t.withModifiers((...o)=>e.onLeftArrowKeypress&&e.onLeftArrowKeypress(...o),["prevent"]),["left"]))]},[t.createElementVNode("div",Fn,null,512),t.withDirectives(t.createElementVNode("div",Ln,[t.createVNode(d,{class:"cdx-tabs__scroll-button",type:"quiet",tabindex:"-1","aria-hidden":!0,onMousedown:n[0]||(n[0]=t.withModifiers(()=>{},["prevent"])),onClick:n[1]||(n[1]=o=>e.scrollTabs("prev"))},{default:t.withCtx(()=>[t.createVNode(a,{icon:e.cdxIconPrevious},null,8,["icon"])]),_:1})],512),[[t.vShow,!e.firstLabelVisible]]),t.createElementVNode("ul",{ref:"listElement",class:"cdx-tabs__list",role:"tablist","aria-activedescendant":e.activeTabId},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.tabsData.values(),(o,u)=>(t.openBlock(),t.createElementBlock("li",{id:`${o.id}-label`,key:u,ref_for:!0,ref:c=>e.assignTemplateRefIfNecessary(c,u),class:t.normalizeClass([e.getLabelClasses(o.name),"cdx-tabs__list__item"]),role:"presentation"},[t.createElementVNode("a",{href:`#${o.id}`,role:"tab",tabIndex:"-1","aria-selected":o.name===e.activeTab,onClick:t.withModifiers(c=>e.select(o.name),["prevent"]),onKeyup:t.withKeys(c=>e.select(o.name),["enter"])},t.toDisplayString(o.label),41,Kn)],10,zn))),128))],8,Rn),t.withDirectives(t.createElementVNode("div",vn,[t.createVNode(d,{class:"cdx-tabs__scroll-button",type:"quiet",tabindex:"-1","aria-hidden":!0,onMousedown:n[2]||(n[2]=t.withModifiers(()=>{},["prevent"])),onClick:n[3]||(n[3]=o=>e.scrollTabs("next"))},{default:t.withCtx(()=>[t.createVNode(a,{icon:e.cdxIconNext},null,8,["icon"])]),_:1})],512),[[t.vShow,!e.lastLabelVisible]])],32),t.createElementVNode("div",qn,[t.renderSlot(e.$slots,"default")])],2)}const Un=k(Tn,[["render",On]]),Pn=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}){return{rootClasses: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})),onClick:()=>{n("update:modelValue",!e.modelValue)}}}}),Wo="",jn=["aria-pressed","disabled"];function Hn(e,n,l,s,r,i){return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["cdx-toggle-button",e.rootClasses]),"aria-pressed":e.modelValue,disabled:e.disabled,onClick:n[0]||(n[0]=(...a)=>e.onClick&&e.onClick(...a))},[t.renderSlot(e.$slots,"default")],10,jn)}const pe=k(Pn,[["render",Hn]]),Wn=t.defineComponent({name:"CdxToggleButtonGroup",components:{CdxIcon:T,CdxToggleButton:pe},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}){function l(r){return Array.isArray(e.modelValue)?e.modelValue.indexOf(r.value)!==-1:e.modelValue!==null?e.modelValue===r.value:!1}function s(r,i){if(Array.isArray(e.modelValue)){const a=e.modelValue.indexOf(r.value)!==-1;i&&!a?n("update:modelValue",e.modelValue.concat(r.value)):!i&&a&&n("update:modelValue",e.modelValue.filter(d=>d!==r.value))}else i&&e.modelValue!==r.value&&n("update:modelValue",r.value)}return{getButtonLabel:ae,isSelected:l,onUpdate:s}}}),Qo="",Qn={class:"cdx-toggle-button-group"};function Gn(e,n,l,s,r,i){const a=t.resolveComponent("cdx-icon"),d=t.resolveComponent("cdx-toggle-button");return t.openBlock(),t.createElementBlock("div",Qn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.buttons,o=>(t.openBlock(),t.createBlock(d,{key:o.value,"model-value":e.isSelected(o),disabled:o.disabled||e.disabled,"aria-label":o.ariaLabel,"onUpdate:modelValue":u=>e.onUpdate(o,u)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{button:o,selected:e.isSelected(o)},()=>[o.icon?(t.openBlock(),t.createBlock(a,{key:0,icon:o.icon},null,8,["icon"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(e.getButtonLabel(o)),1)])]),_:2},1032,["model-value","disabled","aria-label","onUpdate:modelValue"]))),128))])}const Jn=k(Wn,[["render",Gn]]),Xn=t.defineComponent({name:"CdxToggleSwitch",inheritAttrs:!1,props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{attrs:n,emit:l}){const s=t.ref(),r=R("toggle-switch"),{rootClasses:i,rootStyle:a,otherAttrs:d}=K(n),o=L(t.toRef(e,"modelValue"),l);return{input:s,inputId:r,rootClasses:i,rootStyle:a,otherAttrs:d,wrappedModel:o,clickInput:()=>{s.value.click()}}}}),Go="",Yn=["for"],Zn=["id","disabled"],eo={key:0,class:"cdx-toggle-switch__label-content"},to=t.createElementVNode("span",{class:"cdx-toggle-switch__switch"},[t.createElementVNode("span",{class:"cdx-toggle-switch__switch__grip"})],-1);function no(e,n,l,s,r,i){return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["cdx-toggle-switch",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("label",{for:e.inputId,class:"cdx-toggle-switch__label"},[t.withDirectives(t.createElementVNode("input",t.mergeProps({id:e.inputId,ref:"input","onUpdate:modelValue":n[0]||(n[0]=a=>e.wrappedModel=a),class:"cdx-toggle-switch__input",type:"checkbox",disabled:e.disabled},e.otherAttrs,{onKeydown:n[1]||(n[1]=t.withKeys(t.withModifiers((...a)=>e.clickInput&&e.clickInput(...a),["prevent"]),["enter"]))}),null,16,Zn),[[t.vModelCheckbox,e.wrappedModel]]),e.$slots.default?(t.openBlock(),t.createElementBlock("span",eo,[t.renderSlot(e.$slots,"default")])):t.createCommentVNode("",!0),to],8,Yn)],6)}const oo=k(Xn,[["render",no]]),lo=t.defineComponent({name:"CdxTypeaheadSearch",components:{CdxIcon:T,CdxMenu:P,CdxSearchInput:ce},inheritAttrs:!1,props:{id:{type:String,required:!0},formAction:{type:String,required:!0},searchResultsLabel:{type:String,required:!0},searchResults:{type:Array,required:!0},buttonLabel:{type:String,default:""},initialInputValue:{type:String,default:""},searchFooterUrl:{type:String,default:""},debounceInterval:{type:Number,default:120},highlightQuery:{type:Boolean,default:!1},showThumbnail:{type:Boolean,default:!1},autoExpandWidth:{type:Boolean,default:!1}},emits:["input","search-result-click","submit"],setup(e,{attrs:n,emit:l,slots:s}){const{searchResults:r,searchFooterUrl:i,debounceInterval:a}=t.toRefs(e),d=t.ref(),o=t.ref(),u=R("typeahead-search-menu"),c=t.ref(!1),h=t.ref(!1),y=t.ref(!1),A=t.ref(!1),S=t.ref(e.initialInputValue),m=t.ref(""),f=t.computed(()=>{var b,N;return(N=(b=o.value)==null?void 0:b.getHighlightedMenuItem())==null?void 0:N.id}),g=t.ref(null),E=t.computed(()=>({"cdx-typeahead-search__menu-message--has-thumbnail":e.showThumbnail})),I=t.computed(()=>e.searchResults.find(b=>b.value===g.value)),D=t.computed(()=>i.value?r.value.concat([{value:q,url:i.value}]):r.value),M=t.computed(()=>({"cdx-typeahead-search--show-thumbnail":e.showThumbnail,"cdx-typeahead-search--expanded":c.value,"cdx-typeahead-search--auto-expand-width":e.showThumbnail&&e.autoExpandWidth})),{rootClasses:B,rootStyle:U,otherAttrs:C}=K(n,M);function $(b){return b}const w=t.computed(()=>({showThumbnail:e.showThumbnail,boldLabel:!0,hideDescriptionOverflow:!0}));let x,_;function z(b,N=!1){I.value&&I.value.label!==b&&I.value.value!==b&&(g.value=null),_!==void 0&&(clearTimeout(_),_=void 0),b===""?c.value=!1:(h.value=!0,s["search-results-pending"]&&(_=setTimeout(()=>{A.value&&(c.value=!0),y.value=!0},500))),x!==void 0&&(clearTimeout(x),x=void 0);const v=()=>{l("input",b)};N?v():x=setTimeout(()=>{v()},a.value)}function W(b){if(b===q){g.value=null,S.value=m.value;return}g.value=b,b!==null&&(S.value=I.value?I.value.label||String(I.value.value):"")}function fo(){A.value=!0,(m.value||y.value)&&(c.value=!0)}function ho(){A.value=!1,c.value=!1}function me(b){const fe=b,{id:N}=fe,v=G(fe,["id"]),Bo={searchResult:v.value!==q?v:null,index:D.value.findIndex(_o=>_o.value===b.value),numberOfResults:r.value.length};l("search-result-click",Bo)}function bo(b){if(b.value===q){S.value=m.value;return}S.value=b.value?b.label||String(b.value):""}function go(b){var N;c.value=!1,(N=o.value)==null||N.clearActive(),me(b)}function yo(){let b=null,N=-1;I.value&&(b=I.value,N=e.searchResults.indexOf(I.value));const v={searchResult:b,index:N,numberOfResults:r.value.length};l("submit",v)}function Co(b){if(!o.value||!m.value||b.key===" "&&c.value)return;const N=o.value.getHighlightedMenuItem();switch(b.key){case"Enter":N&&(N.value===q?window.location.assign(i.value):o.value.delegateKeyNavigation(b,!1)),c.value=!1;break;case"Tab":c.value=!1;break;default:o.value.delegateKeyNavigation(b);break}}return t.onMounted(()=>{e.initialInputValue&&z(e.initialInputValue,!0)}),t.watch(t.toRef(e,"searchResults"),()=>{m.value=S.value.trim(),A.value&&h.value&&m.value.length>0&&(c.value=!0),_!==void 0&&(clearTimeout(_),_=void 0),h.value=!1,y.value=!1}),{form:d,menu:o,menuId:u,highlightedId:f,selection:g,menuMessageClass:E,searchResultsWithFooter:D,asSearchResult:$,inputValue:S,searchQuery:m,expanded:c,showPending:y,rootClasses:B,rootStyle:U,otherAttrs:C,menuConfig:w,onUpdateInputValue:z,onUpdateMenuSelection:W,onFocus:fo,onBlur:ho,onSearchResultClick:me,onSearchResultKeyboardNavigation:bo,onSearchFooterClick:go,onSubmit:yo,onKeydown:Co,MenuFooterValue:q,articleIcon:Re}},methods:{focus(){this.$refs.searchInput.focus()}}}),Jo="",ao=["id","action"],so={class:"cdx-typeahead-search__menu-message__text"},ro={class:"cdx-typeahead-search__menu-message__text"},io=["href","onClickCapture"],uo={class:"cdx-typeahead-search__search-footer__text"},co={class:"cdx-typeahead-search__search-footer__query"};function po(e,n,l,s,r,i){const a=t.resolveComponent("cdx-icon"),d=t.resolveComponent("cdx-menu"),o=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[3]||(n[3]=(...u)=>e.onSubmit&&e.onSubmit(...u))},[t.createVNode(o,t.mergeProps({ref:"searchInput",modelValue:e.inputValue,"onUpdate:modelValue":n[2]||(n[2]=u=>e.inputValue=u),"button-label":e.buttonLabel},e.otherAttrs,{class:"cdx-typeahead-search__input",name:"search",role:"combobox",autocomplete:"off","aria-autocomplete":"list","aria-owns":e.menuId,"aria-expanded":e.expanded,"aria-activedescendant":e.highlightedId,autocapitalize:"off","onUpdate:modelValue":e.onUpdateInputValue,onFocus:e.onFocus,onBlur:e.onBlur,onKeydown:e.onKeydown}),{default:t.withCtx(()=>[t.createVNode(d,t.mergeProps({id:e.menuId,ref:"menu",expanded:e.expanded,"onUpdate:expanded":n[0]||(n[0]=u=>e.expanded=u),"show-pending":e.showPending,selected:e.selection,"menu-items":e.searchResultsWithFooter,"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.searchResultsLabel,"onUpdate:selected":e.onUpdateMenuSelection,onMenuItemClick:n[1]||(n[1]=u=>e.onSearchResultClick(e.asSearchResult(u))),onMenuItemKeyboardNavigation:e.onSearchResultKeyboardNavigation}),{pending:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["cdx-typeahead-search__menu-message",e.menuMessageClass])},[t.createElementVNode("span",so,[t.renderSlot(e.$slots,"search-results-pending")])],2)]),"no-results":t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["cdx-typeahead-search__menu-message",e.menuMessageClass])},[t.createElementVNode("span",ro,[t.renderSlot(e.$slots,"search-no-results-text")])],2)]),default:t.withCtx(({menuItem:u,active:c})=>[u.value===e.MenuFooterValue?(t.openBlock(),t.createElementBlock("a",{key:0,class:t.normalizeClass(["cdx-typeahead-search__search-footer",{"cdx-typeahead-search__search-footer__active":c}]),href:e.asSearchResult(u).url,onClickCapture:t.withModifiers(h=>e.onSearchFooterClick(e.asSearchResult(u)),["stop"])},[t.createVNode(a,{class:"cdx-typeahead-search__search-footer__icon",icon:e.articleIcon},null,8,["icon"]),t.createElementVNode("span",uo,[t.renderSlot(e.$slots,"search-footer-text",{searchQuery:e.searchQuery},()=>[t.createElementVNode("strong",co,t.toDisplayString(e.searchQuery),1)])])],42,io)):t.createCommentVNode("",!0)]),_:3},16,["id","expanded","show-pending","selected","menu-items","search-query","show-no-results-slot","aria-label","onUpdate:selected","onMenuItemKeyboardNavigation"])]),_:3},16,["modelValue","button-label","aria-owns","aria-expanded","aria-activedescendant","onUpdate:modelValue","onFocus","onBlur","onKeydown"]),t.renderSlot(e.$slots,"default")],40,ao)],6)}const mo=k(lo,[["render",po]]);p.CdxButton=O,p.CdxButtonGroup=ut,p.CdxCard=_t,p.CdxCheckbox=xt,p.CdxCombobox=on,p.CdxIcon=T,p.CdxLookup=sn,p.CdxMenu=P,p.CdxMenuItem=de,p.CdxMessage=fn,p.CdxProgressBar=ue,p.CdxRadio=Bn,p.CdxSearchInput=ce,p.CdxSearchResultTitle=ie,p.CdxSelect=In,p.CdxTab=Nn,p.CdxTabs=Un,p.CdxTextInput=H,p.CdxThumbnail=Y,p.CdxToggleButton=pe,p.CdxToggleButtonGroup=Jn,p.CdxToggleSwitch=oo,p.CdxTypeaheadSearch=mo,p.stringHelpers=It,p.useComputedDirection=J,p.useComputedLanguage=le,p.useGeneratedId=R,p.useIntersectionObserver=ee,p.useModelWrapper=L,p.useSplitAttributes=K,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});