"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@dialpad/dialtone-icons/vue3"),e=require("vue"),u=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),s={"{win}":t.DtIconLayoutGrid,"{arrow-right}":t.DtIconArrowRight,"{arrow-left}":t.DtIconArrowLeft,"{arrow-up}":t.DtIconArrowUp,"{arrow-down}":t.DtIconArrowDown,"{cmd}":t.DtIconCommand},i={compatConfig:{MODE:3},name:"DtKeyboardShortcut",components:{DtIconLayoutGrid:t.DtIconLayoutGrid,DtIconArrowRight:t.DtIconArrowRight,DtIconArrowLeft:t.DtIconArrowLeft,DtIconArrowUp:t.DtIconArrowUp,DtIconArrowDown:t.DtIconArrowDown,DtIconCommand:t.DtIconCommand,DtIconPlus:t.DtIconPlus},props:{inverted:{type:Boolean,default:!1},shortcut:{type:String,required:!0},screenReaderText:{type:String,default:null}},data(){return{separator:/\+/gi}},computed:{icons(){return{...s,"{plus}":t.DtIconPlus}},shortcutWithSeparator(){return this.shortcut.replace(this.separator,"{plus}")},formattedShortcut(){return Object.keys(s).reduce((c,r)=>c.replace(new RegExp("{"+r+"}","gi"),s[r]),this.shortcutWithSeparator)},formattedShortcutSplit(){const c=Object.keys(this.icons).join("|"),r=new RegExp(`(${c})`,"gi");return this.formattedShortcut.split(r).filter(Boolean)}}},d={key:0,class:"d-keyboard-shortcut--sr-only"},h=["innerHTML"];function p(c,r,o,D,_,a){return e.openBlock(),e.createElementBlock("kbd",{class:e.normalizeClass(["d-keyboard-shortcut",{"d-keyboard-shortcut--inverted":o.inverted}])},[o.screenReaderText?(e.openBlock(),e.createElementBlock("span",d,e.toDisplayString(o.screenReaderText),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.formattedShortcutSplit,(n,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.icons[n]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.icons[n]),{key:`${l}-${n}`,size:"100","aria-hidden":"true",class:e.normalizeClass(["d-keyboard-shortcut__icon",{"d-keyboard-shortcut__icon--inverted":o.inverted}])},null,8,["class"])):(e.openBlock(),e.createElementBlock("span",{key:`${l}-${n}`,"aria-hidden":"true",class:e.normalizeClass(["d-keyboard-shortcut__item",{"d-keyboard-shortcut__item--inverted":o.inverted}]),innerHTML:n},null,10,h))],64))),256))],2)}const m=u._(i,[["render",p]]);exports.default=m;
//# sourceMappingURL=keyboard-shortcut.cjs.map
