Bug: T251664 Bug: T284105 Bug: T295711 Bug: T300154 Bug: T305411 Bug: T305947 Bug: T306932 Bug: T306933 Bug: T308285 Bug: T309826 Bug: T310551 Bug: T310768 Bug: T312025 Bug: T312167 Bug: T313768 Bug: T313773 Bug: T313938 Bug: T313940 Bug: T314728 Bug: T316139 Bug: T316603 Bug: T316895 Bug: T316924 Bug: T317198 Bug: T317235 Bug: T317538 Bug: T318023 Bug: T318282 Bug: T319026 Bug: T319363 Bug: T320361 Change-Id: I51b9769f20ad6d045ad90d55ae74808e7fc0bc5a
2 lines
63 KiB
JavaScript
2 lines
63 KiB
JavaScript
(function(f,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(f=typeof globalThis!="undefined"?globalThis:f||self,t(f.codex={},f.Vue))})(this,function(f,t){"use strict";var Mo=Object.defineProperty,Do=Object.defineProperties;var No=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var De=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable;var Me=(f,t,S)=>t in f?Mo(f,t,{enumerable:!0,configurable:!0,writable:!0,value:S}):f[t]=S,Te=(f,t)=>{for(var S in t||(t={}))De.call(t,S)&&Me(f,S,t[S]);if(Z)for(var S of Z(t))Ne.call(t,S)&&Me(f,S,t[S]);return f},Le=(f,t)=>Do(f,No(t));var ee=(f,t)=>{var S={};for(var N in f)De.call(f,N)&&t.indexOf(N)<0&&(S[N]=f[N]);if(f!=null&&Z)for(var N of Z(f))t.indexOf(N)<0&&Ne.call(f,N)&&(S[N]=f[N]);return S};var ue=(f,t,S)=>new Promise((N,H)=>{var te=K=>{try{W(S.next(K))}catch(F){H(F)}},ne=K=>{try{W(S.throw(K))}catch(F){H(F)}},W=K=>K.done?N(K.value):Promise.resolve(K.value).then(te,ne);W((S=S.apply(f,t)).next())});const S="cdx",N=["default","progressive","destructive"],H=["normal","primary","quiet"],te=["notice","warning","error","success"],ne=["text","search"],F="cdx-menu-footer-item",ce=Symbol("CdxTabs"),pe=Symbol("CdxActiveTab"),Fe='<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"/>',ve='<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"/>',Re='<path d="M7 14.17 2.83 10l-1.41 1.41L7 17 19 5l-1.41-1.42z"/>',ze='<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"/>',Ke='<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"/>',Oe='<path d="M13.728 1H6.272L1 6.272v7.456L6.272 19h7.456L19 13.728V6.272zM11 15H9v-2h2zm0-4H9V5h2z"/>',qe='<path d="m17.5 4.75-7.5 7.5-7.5-7.5L1 6.25l9 9 9-9z"/>',Pe='<path d="M19 3H1v14h18zM3 14l3.5-4.5 2.5 3L12.5 8l4.5 6z"/><path d="M19 5H1V3h18zm0 12H1v-2h18z"/>',Ue='<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"/>',je='<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"/>',He='<path d="M7 1 5.6 2.5 13 10l-7.4 7.5L7 19l9-9z"/>',We='<path d="m4 10 9 9 1.4-1.5L7 10l7.4-7.5L13 1z"/>',Qe='<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"/>',Ge=Fe,Je=ve,Xe=Re,Ye=ze,Ze=Ke,et=Oe,me=qe,tt=Pe,nt={langCodeMap:{ar:Ue},default:je},ot={ltr:He,shouldFlip:!0},lt={ltr:We,shouldFlip:!0},at=Qe;function st(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 a=n in e.langCodeMap?e.langCodeMap[n]:e.default;return typeof a=="string"||"path"in a?a:a.ltr}function it(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 oe(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 fe(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 rt=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(),a=oe(l),i=fe(l),r=t.computed(()=>e.dir||a.value),s=t.computed(()=>e.lang||i.value),u=t.computed(()=>({"cdx-icon--flipped":r.value==="rtl"&&s.value!==null&&it(e.icon,s.value)})),o=t.computed(()=>st(e.icon,s.value||"",r.value||"ltr")),p=t.computed(()=>typeof o.value=="string"?o.value:""),m=t.computed(()=>typeof o.value!="string"?o.value.path:"");return{rootElement:l,rootClasses:u,iconSvg:p,iconPath:m,onClick:b=>{n("click",b)}}}}),To="",I=(e,n)=>{const l=e.__vccOpts||e;for(const[a,i]of n)l[a]=i;return l},dt=["aria-hidden"],ut={key:0},ct=["innerHTML"],pt=["d"];function mt(e,n,l,a,i,r){return t.openBlock(),t.createElementBlock("span",{ref:"rootElement",class:t.normalizeClass(["cdx-icon",e.rootClasses]),onClick:n[0]||(n[0]=(...s)=>e.onClick&&e.onClick(...s))},[(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",ut,t.toDisplayString(e.iconLabel),1)):t.createCommentVNode("",!0),e.iconSvg?(t.openBlock(),t.createElementBlock("g",{key:1,fill:"currentColor",innerHTML:e.iconSvg},null,8,ct)):(t.openBlock(),t.createElementBlock("path",{key:2,d:e.iconPath,fill:"currentColor"},null,8,pt))],8,dt))],2)}const T=I(rt,[["render",mt]]);function Q(e){return n=>typeof n=="string"&&e.indexOf(n)!==-1}const ft=Q(H),ht=Q(N),bt=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 le(e){const n=[];for(const l of e)typeof l=="string"&&l.trim()!==""?n.push(l):Array.isArray(l)?n.push(...le(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(...le(l.children))));return n}const gt=(e,n)=>{if(!e)return!1;const l=le(e);if(l.length!==1)return!1;const a=l[0],i=typeof a=="object"&&typeof a.type=="object"&&"name"in a.type&&a.type.name===T.name,r=typeof a=="object"&&a.type==="svg";return i||r?(bt(n),!0):!1},yt=t.defineComponent({name:"CdxButton",props:{action:{type:String,default:"default",validator:ht},type:{type:String,default:"normal",validator:ft}},emits:["click"],setup(e,{emit:n,slots:l,attrs:a}){return{rootClasses:t.computed(()=>{var s;return{[`cdx-button--action-${e.action}`]:!0,[`cdx-button--type-${e.type}`]:!0,"cdx-button--framed":e.type!=="quiet","cdx-button--icon-only":gt((s=l.default)==null?void 0:s.call(l),a)}}),onClick:s=>{n("click",s)}}}}),Lo="";function Ct(e,n,l,a,i,r){return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["cdx-button",e.rootClasses]),onClick:n[0]||(n[0]=(...s)=>e.onClick&&e.onClick(...s))},[t.renderSlot(e.$slots,"default")],2)}const U=I(yt,[["render",Ct]]);function he(e){return e.label===void 0?e.value:e.label===null?"":e.label}const _t=t.defineComponent({name:"CdxButtonGroup",components:{CdxButton:U,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:he}}}),Fo="",Bt={class:"cdx-button-group"};function kt(e,n,l,a,i,r){const s=t.resolveComponent("cdx-icon"),u=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",Bt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.buttons,o=>(t.openBlock(),t.createBlock(u,{key:o.value,disabled:o.disabled||e.disabled,"aria-label":o.ariaLabel,onClick:p=>e.$emit("click",o.value)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{button:o},()=>[o.icon?(t.openBlock(),t.createBlock(s,{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 $t=I(_t,[["render",kt]]),wt=t.defineComponent({name:"CdxThumbnail",components:{CdxIcon:T},props:{thumbnail:{type:[Object,null],default:null},placeholderIcon:{type:[String,Object],default:tt}},setup:e=>{const n=t.ref(!1),l=t.ref({}),a=i=>{const r=i.replace(/([\\"\n])/g,"\\$1"),s=new Image;s.onload=()=>{l.value={backgroundImage:`url("${r}")`},n.value=!0},s.onerror=()=>{n.value=!1},s.src=r};return t.onMounted(()=>{var i;(i=e.thumbnail)!=null&&i.url&&a(e.thumbnail.url)}),{thumbnailStyle:l,thumbnailLoaded:n}}}),vo="",St={class:"cdx-thumbnail"},It={key:0,class:"cdx-thumbnail__placeholder"};function At(e,n,l,a,i,r){const s=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("span",St,[e.thumbnailLoaded?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",It,[t.createVNode(s,{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 ae=I(wt,[["render",At]]),xt=t.defineComponent({name:"CdxCard",components:{CdxIcon:T,CdxThumbnail:ae},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"),a=t.computed(()=>n.value?e.url:void 0);return{isLink:n,contentTag:l,cardLink:a}}}),Ro="",Et={class:"cdx-card__text"},Vt={class:"cdx-card__text__title"},Mt={key:0,class:"cdx-card__text__description"},Dt={key:1,class:"cdx-card__text__supporting-text"};function Nt(e,n,l,a,i,r){const s=t.resolveComponent("cdx-thumbnail"),u=t.resolveComponent("cdx-icon");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.contentTag),{href:e.cardLink,class:t.normalizeClass(["cdx-card",{"cdx-card--is-link":e.isLink,"cdx-card--title-only":!e.$slots.description&&!e.$slots["supporting-text"]}])},{default:t.withCtx(()=>[e.thumbnail||e.forceThumbnail?(t.openBlock(),t.createBlock(s,{key:0,thumbnail:e.thumbnail,"placeholder-icon":e.customPlaceholderIcon,class:"cdx-card__thumbnail"},null,8,["thumbnail","placeholder-icon"])):e.icon?(t.openBlock(),t.createBlock(u,{key:1,icon:e.icon,class:"cdx-card__icon"},null,8,["icon"])):t.createCommentVNode("",!0),t.createElementVNode("span",Et,[t.createElementVNode("span",Vt,[t.renderSlot(e.$slots,"title")]),e.$slots.description?(t.openBlock(),t.createElementBlock("span",Mt,[t.renderSlot(e.$slots,"description")])):t.createCommentVNode("",!0),e.$slots["supporting-text"]?(t.openBlock(),t.createElementBlock("span",Dt,[t.renderSlot(e.$slots,"supporting-text")])):t.createCommentVNode("",!0)])]),_:3},8,["href","class"])}const Tt=I(xt,[["render",Nt]]);function v(e,n,l){return t.computed({get:()=>e.value,set:a=>n(l||"update:modelValue",a)})}const Lt=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})),a=t.ref(),i=t.ref(),r=()=>{a.value.focus()},s=()=>{i.value.click()},u=v(t.toRef(e,"modelValue"),n);return{rootClasses:l,input:a,label:i,focusInput:r,clickLabel:s,wrappedModel:u}}}),zo="",Ft=["value","disabled",".indeterminate"],vt=t.createElementVNode("span",{class:"cdx-checkbox__icon"},null,-1),Rt={class:"cdx-checkbox__label-content"};function zt(e,n,l,a,i,r){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]=(...s)=>e.focusInput&&e.focusInput(...s)),onKeydown:n[2]||(n[2]=t.withKeys(t.withModifiers((...s)=>e.clickLabel&&e.clickLabel(...s),["prevent"]),["enter"]))},[t.withDirectives(t.createElementVNode("input",{ref:"input","onUpdate:modelValue":n[0]||(n[0]=s=>e.wrappedModel=s),class:"cdx-checkbox__input",type:"checkbox",value:e.inputValue,disabled:e.disabled,".indeterminate":e.indeterminate},null,8,Ft),[[t.vModelCheckbox,e.wrappedModel]]),vt,t.createElementVNode("span",Rt,[t.renderSlot(e.$slots,"default")])],544)],2)}const Kt=I(Lt,[["render",zt]]);function be(e){return e.replace(/([\\{}()|.?*+\-^$[\]])/g,"\\$1")}const Ot="[\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 ge(e,n){if(!e)return[n,"",""];const l=be(e),a=new RegExp(l+Ot+"*","i").exec(n);if(!a||a.index===void 0)return[n,"",""];const i=a.index,r=i+a[0].length,s=n.slice(i,r),u=n.slice(0,i),o=n.slice(r,n.length);return[u,s,o]}const qt=Object.freeze(Object.defineProperty({__proto__:null,regExpEscape:be,splitStringAtMatch:ge},Symbol.toStringTag,{value:"Module"})),Pt=t.defineComponent({name:"CdxSearchResultTitle",props:{title:{type:String,required:!0},searchQuery:{type:String,default:""}},setup:e=>({titleChunks:t.computed(()=>ge(e.searchQuery,String(e.title)))})}),Ko="",Ut={class:"cdx-search-result-title"},jt={class:"cdx-search-result-title__match"};function Ht(e,n,l,a,i,r){return t.openBlock(),t.createElementBlock("span",Ut,[t.createElementVNode("bdi",null,[t.createTextVNode(t.toDisplayString(e.titleChunks[0]),1),t.createElementVNode("span",jt,t.toDisplayString(e.titleChunks[1]),1),t.createTextVNode(t.toDisplayString(e.titleChunks[2]),1)])])}const ye=I(Pt,[["render",Ht]]),Wt=t.defineComponent({name:"CdxMenuItem",components:{CdxIcon:T,CdxThumbnail:ae,CdxSearchResultTitle:ye},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)},a=()=>{n("change","highlighted",!1)},i=m=>{m.button===0&&n("change","active",!0)},r=()=>{n("change","selected",!0)},s=t.computed(()=>e.searchQuery.length>0),u=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":s.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"),p=t.computed(()=>e.label||String(e.value));return{onMouseEnter:l,onMouseLeave:a,onMouseDown:i,onClick:r,highlightQuery:s,rootClasses:u,contentTag:o,title:p}}}),Oo="",Qt=["id","aria-disabled","aria-selected"],Gt={class:"cdx-menu-item__text"},Jt=["lang"],Xt=t.createTextVNode(t.toDisplayString(" ")+" "),Yt=["lang"],Zt=["lang"];function en(e,n,l,a,i,r){const s=t.resolveComponent("cdx-thumbnail"),u=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]=(...p)=>e.onMouseEnter&&e.onMouseEnter(...p)),onMouseleave:n[1]||(n[1]=(...p)=>e.onMouseLeave&&e.onMouseLeave(...p)),onMousedown:n[2]||(n[2]=t.withModifiers((...p)=>e.onMouseDown&&e.onMouseDown(...p),["prevent"])),onClick:n[3]||(n[3]=(...p)=>e.onClick&&e.onClick(...p))},[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 p,m,C,b,A;return[e.showThumbnail?(t.openBlock(),t.createBlock(s,{key:0,thumbnail:e.thumbnail,class:"cdx-menu-item__thumbnail"},null,8,["thumbnail"])):e.icon?(t.openBlock(),t.createBlock(u,{key:1,icon:e.icon,class:"cdx-menu-item__icon"},null,8,["icon"])):t.createCommentVNode("",!0),t.createElementVNode("span",Gt,[e.highlightQuery?(t.openBlock(),t.createBlock(o,{key:0,title:e.title,"search-query":e.searchQuery,lang:(p=e.language)==null?void 0:p.label},null,8,["title","search-query","lang"])):(t.openBlock(),t.createElementBlock("span",{key:1,class:"cdx-menu-item__text__label",lang:(m=e.language)==null?void 0:m.label},[t.createElementVNode("bdi",null,t.toDisplayString(e.title),1)],8,Jt)),e.match?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[Xt,e.highlightQuery?(t.openBlock(),t.createBlock(o,{key:0,title:e.match,"search-query":e.searchQuery,lang:(C=e.language)==null?void 0:C.match},null,8,["title","search-query","lang"])):(t.openBlock(),t.createElementBlock("span",{key:1,class:"cdx-menu-item__text__match",lang:(b=e.language)==null?void 0:b.match},[t.createElementVNode("bdi",null,t.toDisplayString(e.match),1)],8,Yt))],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,Zt)):t.createCommentVNode("",!0)])]}),_:1},8,["href"]))])],42,Qt)}const Ce=I(Wt,[["render",en]]),tn=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}))}}}),qo="",nn=[t.createElementVNode("div",{class:"cdx-progress-bar__bar"},null,-1)];function on(e,n,l,a,i,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-progress-bar",e.rootClasses]),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100"},nn,2)}const _e=I(tn,[["render",on]]);let se=0;function z(e){const n=t.getCurrentInstance(),l=(n==null?void 0:n.props.id)||(n==null?void 0:n.attrs.id);return e?`${S}-${e}-${se++}`:l?`${S}-${l}-${se++}`:`${S}-${se++}`}function G(e,n){const l=t.ref(!1);let a=!1;if(typeof window!="object"||!("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype))return l;const i=new window.IntersectionObserver(r=>{const s=r[0];s&&(l.value=s.isIntersecting)},n);return t.onMounted(()=>{a=!0,e.value&&i.observe(e.value)}),t.onUnmounted(()=>{a=!1,i.disconnect()}),t.watch(e,r=>{!a||(i.disconnect(),l.value=!1,r&&i.observe(r))}),l}const ln=t.defineComponent({name:"CdxMenu",components:{CdxMenuItem:Ce,CdxProgressBar:_e},props:{menuItems:{type:Array,required:!0},selected:{type:[String,Number,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:["clearActive","getHighlightedMenuItem","delegateKeyNavigation"],setup(e,{emit:n,slots:l}){const a=t.computed(()=>e.menuItems.map(d=>Le(Te({},d),{id:z("menu-item")}))),i=t.computed(()=>l["no-results"]?e.showNoResultsSlot!==null?e.showNoResultsSlot:a.value.length===0:!1),r=t.ref(null),s=t.ref(null);function u(){return a.value.find(d=>d.value===e.selected)}function o(d,c){var h;if(!(c&&c.disabled))switch(d){case"selected":n("update:selected",(h=c==null?void 0:c.value)!=null?h:null),n("update:expanded",!1),s.value=null;break;case"highlighted":r.value=c||null;break;case"active":s.value=c||null;break}}const p=t.computed(()=>{if(r.value!==null)return a.value.findIndex(d=>d.value===r.value.value)});function m(d){!d||(o("highlighted",d),n("menu-item-keyboard-navigation",d))}function C(d){var g;const c=B=>{for(let E=B-1;E>=0;E--)if(!a.value[E].disabled)return a.value[E]};d=d||a.value.length;const h=(g=c(d))!=null?g:c(a.value.length);m(h)}function b(d){const c=g=>a.value.find((B,E)=>!B.disabled&&E>g);d=d!=null?d:-1;const h=c(d)||c(-1);m(h)}function A(d,c=!0){function h(){n("update:expanded",!0),o("highlighted",u())}function g(){c&&(d.preventDefault(),d.stopPropagation())}switch(d.key){case"Enter":case" ":return g(),e.expanded?(r.value&&n("update:selected",r.value.value),n("update:expanded",!1)):h(),!0;case"Tab":return e.expanded&&(r.value&&n("update:selected",r.value.value),n("update:expanded",!1)),!0;case"ArrowUp":return g(),e.expanded?(r.value===null&&o("highlighted",u()),C(p.value)):h(),_(),!0;case"ArrowDown":return g(),e.expanded?(r.value===null&&o("highlighted",u()),b(p.value)):h(),_(),!0;case"Home":return g(),e.expanded?(r.value===null&&o("highlighted",u()),b()):h(),_(),!0;case"End":return g(),e.expanded?(r.value===null&&o("highlighted",u()),C()):h(),_(),!0;case"Escape":return g(),n("update:expanded",!1),!0;default:return!1}}function $(){o("active")}const w=[],k=t.ref(void 0),V=G(k,{threshold:.8});t.watch(V,d=>{d&&n("load-more")});function x(d,c){if(d){w[c]=d.$el;const h=e.visibleItemLimit;if(!h||e.menuItems.length<h)return;const g=Math.min(h,Math.max(2,Math.floor(.2*e.menuItems.length)));c===e.menuItems.length-g&&(k.value=d.$el)}}function _(){if(!e.visibleItemLimit||e.visibleItemLimit>e.menuItems.length||p.value===void 0)return;const d=p.value>=0?p.value:0;w[d].scrollIntoView({behavior:"smooth",block:"nearest"})}const M=t.ref(null);function R(){if(!e.visibleItemLimit||w.length<=e.visibleItemLimit){M.value=null;return}const d=w[0],c=w[e.visibleItemLimit];M.value=L(d,c)}function L(d,c){const h=d.getBoundingClientRect().top;return c.getBoundingClientRect().top-h+2}return t.onMounted(()=>{document.addEventListener("mouseup",$)}),t.onUnmounted(()=>{document.removeEventListener("mouseup",$)}),t.watch(t.toRef(e,"expanded"),d=>ue(this,null,function*(){const c=u();!d&&r.value&&c===void 0&&o("highlighted"),d&&c!==void 0&&o("highlighted",c),d&&(yield t.nextTick(),R(),yield t.nextTick(),_())})),t.watch(t.toRef(e,"menuItems"),d=>ue(this,null,function*(){d.length<w.length&&(w.length=d.length),e.expanded&&(yield t.nextTick(),R(),yield t.nextTick(),_())})),{rootStyle:t.computed(()=>({"max-height":M.value?`${M.value}px`:void 0,"overflow-y":M.value?"scroll":void 0})),assignTemplateRef:x,computedMenuItems:a,computedShowNoResultsSlot:i,highlightedMenuItem:r,activeMenuItem:s,handleMenuItemChange:o,handleKeyNavigation:A}},methods:{getHighlightedMenuItem(){return this.highlightedMenuItem},clearActive(){this.handleMenuItemChange("active")},delegateKeyNavigation(e,n=!0){return this.handleKeyNavigation(e,n)}}}),Uo="",an={key:0,class:"cdx-menu__pending cdx-menu-item"},sn={key:1,class:"cdx-menu__no-results cdx-menu-item"};function rn(e,n,l,a,i,r){const s=t.resolveComponent("cdx-menu-item"),u=t.resolveComponent("cdx-progress-bar");return t.withDirectives((t.openBlock(),t.createElementBlock("ul",{class:"cdx-menu",role:"listbox","aria-multiselectable":"false",style:t.normalizeStyle(e.rootStyle)},[e.showPending&&e.computedMenuItems.length===0&&e.$slots.pending?(t.openBlock(),t.createElementBlock("li",an,[t.renderSlot(e.$slots,"pending")])):t.createCommentVNode("",!0),e.computedShowNoResultsSlot?(t.openBlock(),t.createElementBlock("li",sn,[t.renderSlot(e.$slots,"no-results")])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedMenuItems,(o,p)=>{var m,C;return t.openBlock(),t.createBlock(s,t.mergeProps({key:o.value,ref_for:!0,ref:b=>e.assignTemplateRef(b,p)},o,{selected:o.value===e.selected,active:o.value===((m=e.activeMenuItem)==null?void 0:m.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:(b,A)=>e.handleMenuItemChange(b,A&&o),onClick:b=>e.$emit("menu-item-click",o)}),{default:t.withCtx(()=>{var b,A;return[t.renderSlot(e.$slots,"default",{menuItem:o,active:o.value===((b=e.activeMenuItem)==null?void 0:b.value)&&o.value===((A=e.highlightedMenuItem)==null?void 0:A.value)})]}),_:2},1040,["selected","active","highlighted","show-thumbnail","bold-label","hide-description-overflow","search-query","onChange","onClick"])}),128)),e.showPending?(t.openBlock(),t.createBlock(u,{key:2,class:"cdx-menu__progress-bar",inline:!0})):t.createCommentVNode("",!0)],4)),[[t.vShow,e.expanded]])}const j=I(ln,[["render",rn]]);function q(e,n=t.computed(()=>({}))){const l=t.computed(()=>{const r=ee(n.value,[]);return e.class&&e.class.split(" ").forEach(u=>{r[u]=!0}),r}),a=t.computed(()=>{if("style"in e)return e.style}),i=t.computed(()=>{const o=e,{class:r,style:s}=o;return ee(o,["class","style"])});return{rootClasses:l,rootStyle:a,otherAttrs:i}}const dn=Q(ne),un=t.defineComponent({name:"CdxTextInput",components:{CdxIcon:T},inheritAttrs:!1,expose:["focus"],props:{modelValue:{type:[String,Number],default:""},inputType:{type:String,default:"text",validator:dn},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","keydown","focus","blur"],setup(e,{emit:n,attrs:l}){const a=v(t.toRef(e,"modelValue"),n),i=t.computed(()=>e.clearable&&!!a.value&&!e.disabled),r=t.computed(()=>({"cdx-text-input--has-start-icon":!!e.startIcon,"cdx-text-input--has-end-icon":!!e.endIcon,"cdx-text-input--clearable":i.value})),{rootClasses:s,rootStyle:u,otherAttrs:o}=q(l,r),p=t.computed(()=>({"cdx-text-input__input--has-value":!!a.value}));return{wrappedModel:a,isClearable:i,rootClasses:s,rootStyle:u,otherAttrs:o,inputClasses:p,onClear:()=>{a.value=""},onInput:k=>{n("input",k)},onChange:k=>{n("change",k)},onKeydown:k=>{(k.key==="Home"||k.key==="End")&&!k.ctrlKey&&!k.metaKey||n("keydown",k)},onFocus:k=>{n("focus",k)},onBlur:k=>{n("blur",k)},cdxIconClear:Ye}},methods:{focus(){this.$refs.input.focus()}}}),jo="",cn=["type","disabled"];function pn(e,n,l,a,i,r){const s=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-text-input",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.withDirectives(t.createElementVNode("input",t.mergeProps({ref:"input","onUpdate:modelValue":n[0]||(n[0]=u=>e.wrappedModel=u),class:["cdx-text-input__input",e.inputClasses]},e.otherAttrs,{type:e.inputType,disabled:e.disabled,onInput:n[1]||(n[1]=(...u)=>e.onInput&&e.onInput(...u)),onChange:n[2]||(n[2]=(...u)=>e.onChange&&e.onChange(...u)),onFocus:n[3]||(n[3]=(...u)=>e.onFocus&&e.onFocus(...u)),onBlur:n[4]||(n[4]=(...u)=>e.onBlur&&e.onBlur(...u)),onKeydown:n[5]||(n[5]=(...u)=>e.onKeydown&&e.onKeydown(...u))}),null,16,cn),[[t.vModelDynamic,e.wrappedModel]]),e.startIcon?(t.openBlock(),t.createBlock(s,{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(s,{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(s,{key:2,icon:e.cdxIconClear,class:"cdx-text-input__icon cdx-text-input__clear-icon",onMousedown:n[6]||(n[6]=t.withModifiers(()=>{},["prevent"])),onClick:e.onClear},null,8,["icon","onClick"])):t.createCommentVNode("",!0)],6)}const J=I(un,[["render",pn]]);function X(e){const n=t.ref({width:void 0,height:void 0});if(typeof window!="object"||!("ResizeObserver"in window)||!("ResizeObserverEntry"in window))return n;const l=new window.ResizeObserver(i=>{const r=i[0];r&&(n.value={width:r.borderBoxSize[0].inlineSize,height:r.borderBoxSize[0].blockSize})});let a=!1;return t.onMounted(()=>{a=!0,e.value&&l.observe(e.value)}),t.onUnmounted(()=>{a=!1,l.disconnect()}),t.watch(e,i=>{!a||(l.disconnect(),n.value={width:void 0,height:void 0},i&&l.observe(i))}),n}const ie=t.defineComponent({name:"CdxCombobox",components:{CdxButton:U,CdxIcon:T,CdxMenu:j,CdxTextInput:J},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","load-more"],setup(e,{emit:n,attrs:l,slots:a}){const i=t.ref(),r=t.ref(),s=t.ref(),u=z("combobox"),o=t.toRef(e,"selected"),p=v(o,n,"update:selected"),m=t.ref(!1),C=t.ref(!1),b=t.computed(()=>{var d,c;return(c=(d=s.value)==null?void 0:d.getHighlightedMenuItem())==null?void 0:c.id}),A=t.computed(()=>({"cdx-combobox--disabled":e.disabled})),$=X(r),w=t.computed(()=>{var d;return`${(d=$.value.width)!=null?d:0}px`}),{rootClasses:k,rootStyle:V,otherAttrs:x}=q(l,A);function _(){C.value&&m.value?m.value=!1:(e.menuItems.length>0||a["no-results"])&&(m.value=!0)}function M(){m.value=C.value&&m.value}function R(){e.disabled||(C.value=!0)}function L(){var d;e.disabled||(d=i.value)==null||d.focus()}function O(d){!s.value||e.disabled||e.menuItems.length===0||d.key===" "&&m.value||s.value.delegateKeyNavigation(d)}return t.watch(m,()=>{C.value=!1}),{input:i,inputWrapper:r,currentWidthInPx:w,menu:s,menuId:u,modelWrapper:p,expanded:m,highlightedId:b,onInputFocus:_,onInputBlur:M,onKeydown:O,onButtonClick:L,onButtonMousedown:R,cdxIconExpand:me,rootClasses:k,rootStyle:V,otherAttrs:x}}}),Be=()=>{t.useCssVars(e=>({"1eb055a5":e.currentWidthInPx}))},ke=ie.setup;ie.setup=ke?(e,n)=>(Be(),ke(e,n)):Be;const Ho="",mn={ref:"inputWrapper",class:"cdx-combobox__input-wrapper"};function fn(e,n,l,a,i,r){const s=t.resolveComponent("cdx-text-input"),u=t.resolveComponent("cdx-icon"),o=t.resolveComponent("cdx-button"),p=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",mn,[t.createVNode(s,t.mergeProps({ref:"input",modelValue:e.modelWrapper,"onUpdate:modelValue":n[0]||(n[0]=m=>e.modelWrapper=m)},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(u,{class:"cdx-combobox__expand-icon",icon:e.cdxIconExpand},null,8,["icon"])]),_:1},8,["disabled","onMousedown","onClick"])],512),t.createVNode(p,t.mergeProps({id:e.menuId,ref:"menu",selected:e.modelWrapper,"onUpdate:selected":n[1]||(n[1]=m=>e.modelWrapper=m),expanded:e.expanded,"onUpdate:expanded":n[2]||(n[2]=m=>e.expanded=m),"menu-items":e.menuItems},e.menuConfig,{onLoadMore:n[3]||(n[3]=m=>e.$emit("load-more"))}),{default:t.withCtx(({menuItem:m})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:m})]),"no-results":t.withCtx(()=>[t.renderSlot(e.$slots,"no-results")]),_:3},16,["id","selected","expanded","menu-items"])],6)}const hn=I(ie,[["render",fn]]),re=t.defineComponent({name:"CdxLookup",components:{CdxMenu:j,CdxTextInput:J},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","load-more"],setup:(e,{emit:n,attrs:l,slots:a})=>{const i=t.ref(),r=t.ref(),s=z("lookup-menu"),u=t.ref(!1),o=t.ref(!1),p=t.ref(!1),m=t.toRef(e,"selected"),C=v(m,n,"update:selected"),b=t.computed(()=>e.menuItems.find(c=>c.value===e.selected)),A=t.computed(()=>{var c,h;return(h=(c=r.value)==null?void 0:c.getHighlightedMenuItem())==null?void 0:h.id}),$=t.ref(e.initialInputValue),w=X(i),k=t.computed(()=>{var c;return`${(c=w.value.width)!=null?c:0}px`}),V=t.computed(()=>({"cdx-lookup--disabled":e.disabled,"cdx-lookup--pending":u.value})),{rootClasses:x,rootStyle:_,otherAttrs:M}=q(l,V);function R(c){b.value&&b.value.label!==c&&b.value.value!==c&&(C.value=null),c===""?(o.value=!1,u.value=!1):u.value=!0,n("input",c)}function L(){p.value=!0,$.value!==null&&$.value!==""&&(e.menuItems.length>0||a["no-results"])&&(o.value=!0)}function O(){p.value=!1,o.value=!1}function d(c){!r.value||e.disabled||e.menuItems.length===0&&!a["no-results"]||c.key===" "&&o.value||r.value.delegateKeyNavigation(c)}return t.watch(m,c=>{if(c!==null){const h=b.value?b.value.label||b.value.value:"";$.value!==h&&($.value=h,n("input",$.value))}}),t.watch(t.toRef(e,"menuItems"),c=>{p.value&&u.value&&(c.length>0||a["no-results"])&&(o.value=!0),c.length===0&&!a["no-results"]&&(o.value=!1),u.value=!1}),{rootElement:i,currentWidthInPx:k,menu:r,menuId:s,highlightedId:A,inputValue:$,modelWrapper:C,expanded:o,onInputBlur:O,rootClasses:x,rootStyle:_,otherAttrs:M,onUpdateInput:R,onInputFocus:L,onKeydown:d}}}),$e=()=>{t.useCssVars(e=>({"34b66b04":e.currentWidthInPx}))},we=re.setup;re.setup=we?(e,n)=>($e(),we(e,n)):$e;const Wo="";function bn(e,n,l,a,i,r){const s=t.resolveComponent("cdx-text-input"),u=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-lookup",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createVNode(s,t.mergeProps({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(u,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,{onLoadMore:n[3]||(n[3]=o=>e.$emit("load-more"))}),{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 gn=I(re,[["render",bn]]),yn=Q(te),Cn={notice:nt,error:et,warning:Ge,success:Xe},_n=t.defineComponent({name:"CdxMessage",components:{CdxButton:U,CdxIcon:T},props:{type:{type:String,default:"notice",validator:yn},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),a=t.computed(()=>e.inline===!1&&e.dismissButtonLabel.length>0),i=t.computed(()=>e.autoDismiss===!1?!1:e.autoDismiss===!0?4e3:e.autoDismiss),r=t.computed(()=>({"cdx-message--inline":e.inline,"cdx-message--block":!e.inline,"cdx-message--user-dismissable":a.value,[`cdx-message--${e.type}`]:!0})),s=t.computed(()=>e.icon&&e.type==="notice"?e.icon:Cn[e.type]),u=t.ref("");function o(p){l.value||(u.value=p==="user-dismissed"?"cdx-message-leave-active-user":"cdx-message-leave-active-system",l.value=!0,n(p))}return t.onMounted(()=>{i.value&&setTimeout(()=>o("auto-dismissed"),i.value)}),{dismissed:l,userDismissable:a,rootClasses:r,leaveActiveClass:u,computedIcon:s,onDismiss:o,cdxIconClose:Ze}}}),Qo="",Bn=["aria-live","role"],kn={class:"cdx-message__content"};function $n(e,n,l,a,i,r){const s=t.resolveComponent("cdx-icon"),u=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(s,{class:"cdx-message__icon",icon:e.computedIcon},null,8,["icon"]),t.createElementVNode("div",kn,[t.renderSlot(e.$slots,"default")]),e.userDismissable?(t.openBlock(),t.createBlock(u,{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(s,{icon:e.cdxIconClose,"icon-label":e.dismissButtonLabel},null,8,["icon","icon-label"])]),_:1},8,["aria-label"])):t.createCommentVNode("",!0)],10,Bn))]),_:3},8,["appear","leave-active-class"])}const wn=I(_n,[["render",$n]]),Sn=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})),a=t.ref(),i=()=>{a.value.focus()},r=v(t.toRef(e,"modelValue"),n);return{rootClasses:l,input:a,focusInput:i,wrappedModel:r}}}),Go="",In=["name","value","disabled"],An=t.createElementVNode("span",{class:"cdx-radio__icon"},null,-1),xn={class:"cdx-radio__label-content"};function En(e,n,l,a,i,r){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]=(...s)=>e.focusInput&&e.focusInput(...s))},[t.withDirectives(t.createElementVNode("input",{ref:"input","onUpdate:modelValue":n[0]||(n[0]=s=>e.wrappedModel=s),class:"cdx-radio__input",type:"radio",name:e.name,value:e.inputValue,disabled:e.disabled},null,8,In),[[t.vModelRadio,e.wrappedModel]]),An,t.createElementVNode("span",xn,[t.renderSlot(e.$slots,"default")])])],2)}const Vn=I(Sn,[["render",En]]),Mn=t.defineComponent({name:"CdxSearchInput",components:{CdxButton:U,CdxTextInput:J},inheritAttrs:!1,props:{modelValue:{type:[String,Number],default:""},buttonLabel:{type:String,default:""}},emits:["update:modelValue","submit-click"],setup(e,{emit:n,attrs:l}){const a=v(t.toRef(e,"modelValue"),n),i=t.computed(()=>({"cdx-search-input--has-end-button":!!e.buttonLabel})),{rootClasses:r,rootStyle:s,otherAttrs:u}=q(l,i);return{wrappedModel:a,rootClasses:r,rootStyle:s,otherAttrs:u,handleSubmit:()=>{n("submit-click",a.value)},searchIcon:at}},methods:{focus(){this.$refs.textInput.focus()}}}),Jo="",Dn={class:"cdx-search-input__input-wrapper"};function Nn(e,n,l,a,i,r){const s=t.resolveComponent("cdx-text-input"),u=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",Dn,[t.createVNode(s,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(u,{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 Se=I(Mn,[["render",Nn]]),de=t.defineComponent({name:"CdxSelect",components:{CdxIcon:T,CdxMenu:j},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","load-more"],setup(e,{emit:n}){const l=t.ref(),a=t.ref(),i=z("select-handle"),r=z("select-menu"),s=t.ref(!1),u=v(t.toRef(e,"selected"),n,"update:selected"),o=t.computed(()=>e.menuItems.find(x=>x.value===e.selected)),p=t.computed(()=>o.value?o.value.label||o.value.value:e.defaultLabel),m=X(l),C=t.computed(()=>{var x;return`${(x=m.value.width)!=null?x:0}px`}),b=t.computed(()=>{if(e.defaultIcon&&!o.value)return e.defaultIcon;if(o.value&&o.value.icon)return o.value.icon}),A=t.computed(()=>({"cdx-select--enabled":!e.disabled,"cdx-select--disabled":e.disabled,"cdx-select--expanded":s.value,"cdx-select--value-selected":!!o.value,"cdx-select--no-selections":!o.value,"cdx-select--has-start-icon":!!b.value})),$=t.computed(()=>{var x,_;return(_=(x=a.value)==null?void 0:x.getHighlightedMenuItem())==null?void 0:_.id});function w(){s.value=!1}function k(){var x;e.disabled||(s.value=!s.value,(x=l.value)==null||x.focus())}function V(x){var _;e.disabled||(_=a.value)==null||_.delegateKeyNavigation(x)}return{handle:l,handleId:i,menu:a,menuId:r,modelWrapper:u,selectedMenuItem:o,highlightedId:$,expanded:s,onBlur:w,currentLabel:p,currentWidthInPx:C,rootClasses:A,onClick:k,onKeydown:V,startIcon:b,cdxIconExpand:me}}}),Ie=()=>{t.useCssVars(e=>({eb4ebc46:e.currentWidthInPx}))},Ae=de.setup;de.setup=Ae?(e,n)=>(Ie(),Ae(e,n)):Ie;const Xo="",Tn=["aria-disabled"],Ln=["aria-owns","aria-labelledby","aria-activedescendant","aria-expanded"],Fn=["id"];function vn(e,n,l,a,i,r){const s=t.resolveComponent("cdx-icon"),u=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,Fn),e.startIcon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.startIcon,class:"cdx-select__start-icon"},null,8,["icon"])):t.createCommentVNode("",!0),t.createVNode(s,{icon:e.cdxIconExpand,class:"cdx-select__indicator"},null,8,["icon"])],40,Ln),t.createVNode(u,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,{onLoadMore:n[5]||(n[5]=o=>e.$emit("load-more"))}),{default:t.withCtx(({menuItem:o})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:o})]),_:3},16,["id","selected","expanded","menu-items"])],10,Tn)}const Rn=I(de,[["render",vn]]),zn=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(ce),l=t.inject(pe);if(!n||!l)throw new Error("Tab component must be used inside a Tabs component");const a=n.value.get(e.name)||{},i=t.computed(()=>e.name===l.value);return{tab:a,isActive:i}}}),Yo="",Kn=["id","aria-hidden","aria-labelledby"];function On(e,n,l,a,i,r){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,Kn)),[[t.vShow,e.isActive]])}const qn=I(zn,[["render",On]]),Pn=t.defineComponent({name:"CdxTabs",components:{CdxButton:U,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 a=t.ref(),i=t.ref(),r=t.ref(),s=t.ref(),u=t.ref(),o=oe(a),p=t.computed(()=>{var g;const d=[],c=(g=n.default)==null?void 0:g.call(n);c&&c.forEach(h);function h(B){B&&typeof B=="object"&&"type"in B&&(typeof B.type=="object"&&"name"in B.type&&B.type.name==="CdxTab"?d.push(B):"children"in B&&Array.isArray(B.children)&&B.children.forEach(h))}return d});if(!p.value||p.value.length===0)throw new Error("Slot content cannot be empty");const m=t.computed(()=>p.value.reduce((d,c)=>{var h;if(((h=c.props)==null?void 0:h.name)&&typeof c.props.name=="string"){if(d.get(c.props.name))throw new Error("Tab names must be unique");d.set(c.props.name,{name:c.props.name,id:z(c.props.name),label:c.props.label||c.props.name,disabled:c.props.disabled})}return d},new Map)),C=v(t.toRef(e,"active"),l,"update:active"),b=t.computed(()=>Array.from(m.value.keys())),A=t.computed(()=>b.value.indexOf(C.value)),$=t.computed(()=>{var d;return(d=m.value.get(C.value))==null?void 0:d.id});t.provide(pe,C),t.provide(ce,m);const w=t.ref(),k=t.ref(),V=G(w,{threshold:.95}),x=G(k,{threshold:.95});function _(d,c){const h=d;h&&(c===0?w.value=h:c===b.value.length-1&&(k.value=h))}function M(d){var g;const c=d===C.value,h=!!((g=m.value.get(d))!=null&&g.disabled);return{"cdx-tabs__list__item--selected":c,"cdx-tabs__list__item--enabled":!h,"cdx-tabs__list__item--disabled":h}}const R=t.computed(()=>({"cdx-tabs--framed":e.framed,"cdx-tabs--quiet":!e.framed}));function L(d){if(!i.value||!s.value||!u.value)return 0;const c=o.value==="rtl"?u.value:s.value,h=o.value==="rtl"?s.value:u.value,g=d.offsetLeft,B=g+d.clientWidth,E=i.value.scrollLeft+c.clientWidth,Y=i.value.scrollLeft+i.value.clientWidth-h.clientWidth;return g<E?g-E:B>Y?B-Y:0}function O(d){var B;if(!i.value||!s.value||!u.value)return;const c=d==="next"&&o.value==="ltr"||d==="prev"&&o.value==="rtl"?1:-1;let h=0,g=d==="next"?i.value.firstElementChild:i.value.lastElementChild;for(;g;){const E=d==="next"?g.nextElementSibling:g.previousElementSibling;if(h=L(g),Math.sign(h)===c){E&&Math.abs(h)<.25*i.value.clientWidth&&(h=L(E));break}g=E}i.value.scrollBy({left:h,behavior:"smooth"}),(B=r.value)==null||B.focus()}return t.watch(C,()=>{if($.value===void 0||!i.value||!s.value||!u.value)return;const d=document.getElementById(`${$.value}-label`);!d||i.value.scrollBy({left:L(d),behavior:"smooth"})}),{activeTab:C,activeTabIndex:A,activeTabId:$,currentDirection:o,rootElement:a,listElement:i,focusHolder:r,prevScroller:s,nextScroller:u,rootClasses:R,tabNames:b,tabsData:m,firstLabelVisible:V,lastLabelVisible:x,getLabelClasses:M,assignTemplateRefIfNecessary:_,scrollTabs:O,cdxIconPrevious:lt,cdxIconNext:ot}},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())}}}),Zo="",Un={ref:"focusHolder",tabindex:"-1"},jn={ref:"prevScroller",class:"cdx-tabs__prev-scroller"},Hn=["aria-activedescendant"],Wn=["id"],Qn=["href","aria-selected","onClick","onKeyup"],Gn={ref:"nextScroller",class:"cdx-tabs__next-scroller"},Jn={class:"cdx-tabs__content"};function Xn(e,n,l,a,i,r){const s=t.resolveComponent("cdx-icon"),u=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",Un,null,512),t.withDirectives(t.createElementVNode("div",jn,[t.createVNode(u,{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(s,{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,p)=>(t.openBlock(),t.createElementBlock("li",{id:`${o.id}-label`,key:p,ref_for:!0,ref:m=>e.assignTemplateRefIfNecessary(m,p),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(m=>e.select(o.name),["prevent"]),onKeyup:t.withKeys(m=>e.select(o.name),["enter"])},t.toDisplayString(o.label),41,Qn)],10,Wn))),128))],8,Hn),t.withDirectives(t.createElementVNode("div",Gn,[t.createVNode(u,{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(s,{icon:e.cdxIconNext},null,8,["icon"])]),_:1})],512),[[t.vShow,!e.lastLabelVisible]])],32),t.createElementVNode("div",Jn,[t.renderSlot(e.$slots,"default")])],2)}const Yn=I(Pn,[["render",Xn]]),Zn=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)}}}}),el="",eo=["aria-pressed","disabled"];function to(e,n,l,a,i,r){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]=(...s)=>e.onClick&&e.onClick(...s))},[t.renderSlot(e.$slots,"default")],10,eo)}const xe=I(Zn,[["render",to]]),no=t.defineComponent({name:"CdxToggleButtonGroup",components:{CdxIcon:T,CdxToggleButton:xe},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(i){return Array.isArray(e.modelValue)?e.modelValue.indexOf(i.value)!==-1:e.modelValue!==null?e.modelValue===i.value:!1}function a(i,r){if(Array.isArray(e.modelValue)){const s=e.modelValue.indexOf(i.value)!==-1;r&&!s?n("update:modelValue",e.modelValue.concat(i.value)):!r&&s&&n("update:modelValue",e.modelValue.filter(u=>u!==i.value))}else r&&e.modelValue!==i.value&&n("update:modelValue",i.value)}return{getButtonLabel:he,isSelected:l,onUpdate:a}}}),tl="",oo={class:"cdx-toggle-button-group"};function lo(e,n,l,a,i,r){const s=t.resolveComponent("cdx-icon"),u=t.resolveComponent("cdx-toggle-button");return t.openBlock(),t.createElementBlock("div",oo,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.buttons,o=>(t.openBlock(),t.createBlock(u,{key:o.value,"model-value":e.isSelected(o),disabled:o.disabled||e.disabled,"aria-label":o.ariaLabel,"onUpdate:modelValue":p=>e.onUpdate(o,p)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{button:o,selected:e.isSelected(o)},()=>[o.icon?(t.openBlock(),t.createBlock(s,{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 ao=I(no,[["render",lo]]),so=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 a=t.ref(),i=z("toggle-switch"),{rootClasses:r,rootStyle:s,otherAttrs:u}=q(n),o=v(t.toRef(e,"modelValue"),l);return{input:a,inputId:i,rootClasses:r,rootStyle:s,otherAttrs:u,wrappedModel:o,clickInput:()=>{a.value.click()}}}}),nl="",io=["for"],ro=["id","disabled"],uo={key:0,class:"cdx-toggle-switch__label-content"},co=t.createElementVNode("span",{class:"cdx-toggle-switch__switch"},[t.createElementVNode("span",{class:"cdx-toggle-switch__switch__grip"})],-1);function po(e,n,l,a,i,r){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]=s=>e.wrappedModel=s),class:"cdx-toggle-switch__input",type:"checkbox",disabled:e.disabled},e.otherAttrs,{onKeydown:n[1]||(n[1]=t.withKeys(t.withModifiers((...s)=>e.clickInput&&e.clickInput(...s),["prevent"]),["enter"]))}),null,16,ro),[[t.vModelCheckbox,e.wrappedModel]]),e.$slots.default?(t.openBlock(),t.createElementBlock("span",uo,[t.renderSlot(e.$slots,"default")])):t.createCommentVNode("",!0),co],8,io)],6)}const mo=I(so,[["render",po]]),fo=t.defineComponent({name:"CdxTypeaheadSearch",components:{CdxIcon:T,CdxMenu:j,CdxSearchInput:Se},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},visibleItemLimit:{type:Number,default:null}},emits:["input","search-result-click","submit","load-more"],setup(e,{attrs:n,emit:l,slots:a}){const{searchResults:i,searchFooterUrl:r,debounceInterval:s}=t.toRefs(e),u=t.ref(),o=t.ref(),p=z("typeahead-search-menu"),m=t.ref(!1),C=t.ref(!1),b=t.ref(!1),A=t.ref(!1),$=t.ref(e.initialInputValue),w=t.ref(""),k=t.computed(()=>{var y,D;return(D=(y=o.value)==null?void 0:y.getHighlightedMenuItem())==null?void 0:D.id}),V=t.ref(null),x=t.computed(()=>({"cdx-typeahead-search__menu-message--has-thumbnail":e.showThumbnail})),_=t.computed(()=>e.searchResults.find(y=>y.value===V.value)),M=t.computed(()=>r.value?i.value.concat([{value:F,url:r.value}]):i.value),R=t.computed(()=>({"cdx-typeahead-search--show-thumbnail":e.showThumbnail,"cdx-typeahead-search--expanded":m.value,"cdx-typeahead-search--auto-expand-width":e.showThumbnail&&e.autoExpandWidth})),{rootClasses:L,rootStyle:O,otherAttrs:d}=q(n,R);function c(y){return y}const h=t.computed(()=>({visibleItemLimit:e.visibleItemLimit,showThumbnail:e.showThumbnail,boldLabel:!0,hideDescriptionOverflow:!0}));let g,B;function E(y,D=!1){_.value&&_.value.label!==y&&_.value.value!==y&&(V.value=null),B!==void 0&&(clearTimeout(B),B=void 0),y===""?m.value=!1:(C.value=!0,a["search-results-pending"]&&(B=setTimeout(()=>{A.value&&(m.value=!0),b.value=!0},500))),g!==void 0&&(clearTimeout(g),g=void 0);const P=()=>{l("input",y)};D?P():g=setTimeout(()=>{P()},s.value)}function Y(y){if(y===F){V.value=null,$.value=w.value;return}V.value=y,y!==null&&($.value=_.value?_.value.label||String(_.value.value):"")}function $o(){A.value=!0,(w.value||b.value)&&(m.value=!0)}function wo(){A.value=!1,m.value=!1}function Ee(y){const Ve=y,{id:D}=Ve,P=ee(Ve,["id"]),Eo={searchResult:P.value!==F?P:null,index:M.value.findIndex(Vo=>Vo.value===y.value),numberOfResults:i.value.length};l("search-result-click",Eo)}function So(y){if(y.value===F){$.value=w.value;return}$.value=y.value?y.label||String(y.value):""}function Io(y){var D;m.value=!1,(D=o.value)==null||D.clearActive(),Ee(y)}function Ao(){let y=null,D=-1;_.value&&(y=_.value,D=e.searchResults.indexOf(_.value));const P={searchResult:y,index:D,numberOfResults:i.value.length};l("submit",P)}function xo(y){if(!o.value||!w.value||y.key===" "&&m.value)return;const D=o.value.getHighlightedMenuItem();switch(y.key){case"Enter":D&&(D.value===F?window.location.assign(r.value):o.value.delegateKeyNavigation(y,!1)),m.value=!1;break;case"Tab":m.value=!1;break;default:o.value.delegateKeyNavigation(y);break}}return t.onMounted(()=>{e.initialInputValue&&E(e.initialInputValue,!0)}),t.watch(t.toRef(e,"searchResults"),()=>{w.value=$.value.trim(),A.value&&C.value&&w.value.length>0&&(m.value=!0),B!==void 0&&(clearTimeout(B),B=void 0),C.value=!1,b.value=!1}),{form:u,menu:o,menuId:p,highlightedId:k,selection:V,menuMessageClass:x,searchResultsWithFooter:M,asSearchResult:c,inputValue:$,searchQuery:w,expanded:m,showPending:b,rootClasses:L,rootStyle:O,otherAttrs:d,menuConfig:h,onUpdateInputValue:E,onUpdateMenuSelection:Y,onFocus:$o,onBlur:wo,onSearchResultClick:Ee,onSearchResultKeyboardNavigation:So,onSearchFooterClick:Io,onSubmit:Ao,onKeydown:xo,MenuFooterValue:F,articleIcon:Je}},methods:{focus(){this.$refs.searchInput.focus()}}}),ol="",ho=["id","action"],bo={class:"cdx-typeahead-search__menu-message__text"},go={class:"cdx-typeahead-search__menu-message__text"},yo=["href","onClickCapture"],Co={class:"cdx-typeahead-search__search-footer__text"},_o={class:"cdx-typeahead-search__search-footer__query"};function Bo(e,n,l,a,i,r){const s=t.resolveComponent("cdx-icon"),u=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[4]||(n[4]=(...p)=>e.onSubmit&&e.onSubmit(...p))},[t.createVNode(o,t.mergeProps({ref:"searchInput",modelValue:e.inputValue,"onUpdate:modelValue":n[3]||(n[3]=p=>e.inputValue=p),"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,"onUpdate:modelValue":e.onUpdateInputValue,onFocus:e.onFocus,onBlur:e.onBlur,onKeydown:e.onKeydown}),{default:t.withCtx(()=>[t.createVNode(u,t.mergeProps({id:e.menuId,ref:"menu",expanded:e.expanded,"onUpdate:expanded":n[0]||(n[0]=p=>e.expanded=p),"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]=p=>e.onSearchResultClick(e.asSearchResult(p))),onMenuItemKeyboardNavigation:e.onSearchResultKeyboardNavigation,onLoadMore:n[2]||(n[2]=p=>e.$emit("load-more"))}),{pending:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["cdx-typeahead-search__menu-message",e.menuMessageClass])},[t.createElementVNode("span",bo,[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",go,[t.renderSlot(e.$slots,"search-no-results-text")])],2)]),default:t.withCtx(({menuItem:p,active:m})=>[p.value===e.MenuFooterValue?(t.openBlock(),t.createElementBlock("a",{key:0,class:t.normalizeClass(["cdx-typeahead-search__search-footer",{"cdx-typeahead-search__search-footer__active":m}]),href:e.asSearchResult(p).url,onClickCapture:t.withModifiers(C=>e.onSearchFooterClick(e.asSearchResult(p)),["stop"])},[t.createVNode(s,{class:"cdx-typeahead-search__search-footer__icon",icon:e.articleIcon},null,8,["icon"]),t.createElementVNode("span",Co,[t.renderSlot(e.$slots,"search-footer-text",{searchQuery:e.searchQuery},()=>[t.createElementVNode("strong",_o,t.toDisplayString(e.searchQuery),1)])])],42,yo)):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,ho)],6)}const ko=I(fo,[["render",Bo]]);f.CdxButton=U,f.CdxButtonGroup=$t,f.CdxCard=Tt,f.CdxCheckbox=Kt,f.CdxCombobox=hn,f.CdxIcon=T,f.CdxLookup=gn,f.CdxMenu=j,f.CdxMenuItem=Ce,f.CdxMessage=wn,f.CdxProgressBar=_e,f.CdxRadio=Vn,f.CdxSearchInput=Se,f.CdxSearchResultTitle=ye,f.CdxSelect=Rn,f.CdxTab=qn,f.CdxTabs=Yn,f.CdxTextInput=J,f.CdxThumbnail=ae,f.CdxToggleButton=xe,f.CdxToggleButtonGroup=ao,f.CdxToggleSwitch=mo,f.CdxTypeaheadSearch=ko,f.stringHelpers=qt,f.useComputedDirection=oe,f.useComputedLanguage=fe,f.useGeneratedId=z,f.useIntersectionObserver=G,f.useModelWrapper=v,f.useResizeObserver=X,f.useSplitAttributes=q,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|