"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@dialpad/dialtone-icons/vue3"),o=require("./ivr-node-constants.cjs"),p=require("../../localization/index.cjs"),e=require("vue"),D=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),m=require("../card/card.cjs"),I=require("../button/button.cjs"),N=require("../dropdown/dropdown.cjs"),v=new Map([[o.IVR_NODE_PROMPT_MENU,t.DtIconKeypad],[o.IVR_NODE_PROMPT_COLLECT,t.DtIconDialer],[o.IVR_NODE_PROMPT_PLAY,t.DtIconVolume2],[o.IVR_NODE_EXPERT,t.DtIconExpertNode],[o.IVR_NODE_BRANCH,t.DtIconBranch],[o.IVR_NODE_GO_TO,t.DtIconCallMerge],[o.IVR_NODE_ASSIGN,t.DtIconChevronsRight],[o.IVR_NODE_CUSTOMER_DATA,t.DtIconListBullet],[o.IVR_NODE_TRANSFER,t.DtIconTransfer],[o.IVR_NODE_HANGUP,t.DtIconPhoneHangUp]]),C={compatConfig:{MODE:3},name:"DtRecipeIvrNode",components:{DtCard:m.default,DtButton:I.default,DtDropdown:N.default,DtIconKeypad:t.DtIconKeypad,DtIconDialer:t.DtIconDialer,DtIconVolume2:t.DtIconVolume2,DtIconExpertNode:t.DtIconExpertNode,DtIconBranch:t.DtIconBranch,DtIconCallMerge:t.DtIconCallMerge,DtIconChevronsRight:t.DtIconChevronsRight,DtIconTransfer:t.DtIconTransfer,DtIconPhoneHangUp:t.DtIconPhoneHangUp,DtIconMoreVertical:t.DtIconMoreVertical,DtIconListBullet:t.DtIconListBullet},props:{nodeType:{type:String,required:!0},nodeLabel:{type:String,required:!0},isSelected:{type:Boolean,default:!1},dtmfKey:{type:String,default:null}},emits:["click"],data(){return{isOpen:!1,i18n:new p.DialtoneLocalization}},computed:{nodeListeners(){return{click:n=>this.$emit("click",n)}},nodeIcon(){return v.get(this.nodeType)},nodeClass(){const{normal:n,selected:i}=o.IVR_NODE_CLASS_MAPPING[this.nodeType];return this.isSelected?i:n},isGotoNode(){return this.nodeType===o.IVR_NODE_GO_TO},nodeAriaLabel(){const n=this.nodeType.toUpperCase();return this.i18n.$t(`DIALTONE_IVR_NODE_${n}_ARIA_LABEL`)},menuButtonAriaLabel(){return this.i18n.$t("DIALTONE_IVR_NODE_MENU_BUTTON_ARIA_LABEL")}},methods:{openMenu(){this.isOpen=!0}}},E={class:"d-recipe-ivr-node__header-left"},h={class:"d-recipe-ivr-node__label","data-qa":"ivr-node-label"},O={class:"d-recipe-ivr-node__dropdown-list"};function V(n,i,c,b,d,r){const a=e.resolveComponent("dt-button"),s=e.resolveComponent("dt-icon-more-vertical"),_=e.resolveComponent("dt-dropdown"),u=e.resolveComponent("dt-card");return e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["d-recipe-ivr-node",r.nodeClass]},e.toHandlers(r.nodeListeners,!0)),[c.dtmfKey?(e.openBlock(),e.createElementBlock("div",{key:0,"data-qa":"dt-top-connector-dtmf",class:e.normalizeClass(["d-recipe-ivr-node__connector d-recipe-ivr-node__connector-dtmf",{"d-recipe-ivr-node__connector-dtmf--selected":c.isSelected}])},e.toDisplayString(c.dtmfKey),3)):e.createCommentVNode("",!0),n.$slots.connector?e.renderSlot(n.$slots,"connector",{key:1}):e.createCommentVNode("",!0),!c.dtmfKey&&!n.$slots.connector?(e.openBlock(),e.createElementBlock("div",{key:2,"data-qa":"dt-top-connector",class:e.normalizeClass(["d-recipe-ivr-node__connector",{"d-recipe-ivr-node__connector--selected":c.isSelected}])},null,2)):e.createCommentVNode("",!0),e.createVNode(u,null,{header:e.withCtx(()=>[e.createElementVNode("div",E,[e.createVNode(a,{importance:"clear",kind:"muted","data-qa":"dt-ivr-node-icon","aria-label":r.nodeAriaLabel,title:r.nodeAriaLabel},{icon:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.nodeIcon),{size:"200",class:e.normalizeClass(["",{"d-recipe-ivr-node__goto-icon":r.isGotoNode}])},null,8,["class"]))]),_:1},8,["aria-label","title"]),e.createElementVNode("p",h,e.toDisplayString(c.nodeLabel),1)]),e.createVNode(_,{open:d.isOpen,"onUpdate:open":i[0]||(i[0]=l=>d.isOpen=l),placement:"bottom"},{anchor:e.withCtx(()=>[e.createVNode(a,{importance:"clear",kind:"muted","aria-label":r.menuButtonAriaLabel,title:r.menuButtonAriaLabel,onClick:e.withModifiers(r.openMenu,["stop","prevent"])},{icon:e.withCtx(()=>[e.createVNode(s,{size:"200"})]),_:1},8,["aria-label","title","onClick"])]),list:e.withCtx(({close:l})=>[e.createElementVNode("div",O,[e.renderSlot(n.$slots,"menuItems",{close:l})])]),_:3},8,["open"])]),content:e.withCtx(()=>[e.renderSlot(n.$slots,"content")]),_:3})],16)}const R=D._(C,[["render",V]]);exports.default=R;
//# sourceMappingURL=ivr-node.cjs.map
