1var __defProp = Object.defineProperty; 2var __defProps = Object.defineProperties; 3var __getOwnPropDescs = Object.getOwnPropertyDescriptors; 4var __getOwnPropSymbols = Object.getOwnPropertySymbols; 5var __hasOwnProp = Object.prototype.hasOwnProperty; 6var __propIsEnum = Object.prototype.propertyIsEnumerable; 7var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 8var __spreadValues = (a, b) => { 9 for (var prop in b || (b = {})) 10 if (__hasOwnProp.call(b, prop)) 11 __defNormalProp(a, prop, b[prop]); 12 if (__getOwnPropSymbols) 13 for (var prop of __getOwnPropSymbols(b)) { 14 if (__propIsEnum.call(b, prop)) 15 __defNormalProp(a, prop, b[prop]); 16 } 17 return a; 18}; 19var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); 20var __objRest = (source, exclude) => { 21 var target = {}; 22 for (var prop in source) 23 if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) 24 target[prop] = source[prop]; 25 if (source != null && __getOwnPropSymbols) 26 for (var prop of __getOwnPropSymbols(source)) { 27 if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) 28 target[prop] = source[prop]; 29 } 30 return target; 31}; 32var __async = (__this, __arguments, generator) => { 33 return new Promise((resolve2, reject) => { 34 var fulfilled = (value) => { 35 try { 36 step(generator.next(value)); 37 } catch (e) { 38 reject(e); 39 } 40 }; 41 var rejected = (value) => { 42 try { 43 step(generator.throw(value)); 44 } catch (e) { 45 reject(e); 46 } 47 }; 48 var step = (x) => x.done ? resolve2(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); 49 step((generator = generator.apply(__this, __arguments)).next()); 50 }); 51}; 52var _a; 53import { _ as __vitePreload } from "./common-helpers.DkPT0x6i.js"; 54import { g as ref, f as unref, t as toRaw, D as watchEffect, w as watch, a0 as shallowRef, J as computed, M as getCurrentInstance, b7 as useSortable, r as resolveComponent, o as openBlock, m as createElementBlock, x as createVNode, j as withCtx, y as createTextVNode, q as toDisplayString, l as createCommentVNode, F as Fragment, Q as renderList, k as normalizeClass, v as createBaseVNode, e as createBlock, a3 as withModifiers, p as resolveDynamicComponent, S as withDirectives, T as vShow, W as mergeProps, U as Transition, aA as toRef, i as onMounted, n as nextTick, K as onBeforeUnmount, b8 as useId, h as useTemplateRef, L as renderSlot, _ as normalizeStyle, ao as Teleport, N as provide, I as defineComponent, aJ as createStaticVNode, aC as markRaw, a as axios, A as createSlots, c as createApp, d as createI18n } from "./chunk-vendor.B1BY-hcD.js"; 55import { D as DragHandleDots, w as PinUnpin, x as Pin, P as PopWindowPopOutV2, c as Checkmark, R as RevenueAccelerator, W as WorkspaceReservation, H as H323OrSIP, j as Setting, y as FlowFill, z as SurveyV2, G as AgentAssist, o as Clips, J as AudioConferencing, K as WEMQualityManagement, N as Hub, T as Tasks, O as FileFormatPresentation, Q as FileFormatSpreadsheet, U as FileFormatDocument, V as AIDocs, X as Notes, Y as Whiteboard, Z as Marketplace, _ as Workvivo, $ as TeamChat, a0 as Phone, a1 as Email, a2 as VideoManagement, a3 as RecordFill, a4 as ClinicalNote, a5 as Events, a6 as Webinars, a7 as VideoOn, a8 as AICompanion, a9 as ContactCenter, aa as Agenda, ab as Tickets, ac as ComplianceManager, ad as FileResource, ae as Analytics, af as AllUser, ag as Gift, ah as APIs, ai as AccountInformation, aj as ConferenceRoomConnector, ak as Scheduler, al as ShieldLock, am as PlatformSolutions, an as Refresh, ao as ProxyV2, ap as BandwidthV2, aq as Link, ar as DigitalSignage, as as Summarize, at as Poll, au as TemplateMiscellaneous, av as VideoContent, aw as VideoIncoming, ax as Billing, ay as Profile, az as PhonePowerPack, aA as ZoomRoomPersonal, aB as Attachment, aC as AgentEngagement, aD as KnowledgeBase, aE as IntentManager, aF as VirtualAgent, aG as Participants, n as Integration, aH as ClientBrowser, aI as ProfilePrivacy, aJ as ShieldCheckmark, aK as External, aL as Contact, aM as Team, aN as SSO, aO as SchedulingDisplay, aP as Minimap, aQ as SurveyResults, aR as ReleaseEngagement, aS as SMS, aT as Star, aU as BellNotificationOn, aV as CustomizeV2, aW as MeshFill, aX as Refund, aY as CreditCard, aZ as Adjust, a_ as Home, a$ as Huddles, b0 as EllipsisVertical, m as AIStudio$1, b1 as Keypad10Dots, b2 as Rooms, b3 as Device, b4 as MailAndCalendarProduct, b5 as Wrench } from "./zoom-icons-vue.C38wAiOG.js"; 56import { i as ZmVisuallyHidden, e as ZmIcon, g as ZmTooltip, f as ZmButton, h as ZmBadge, b as ZmInlineChevronIcon, G as createContextMenu, E as ZmSkeletonItem, H as announce, c as ZmScrollbar, F as ZmSkeleton, I as ZmContextMenuHolder, a as ZmContext, d as ZmSideMenu } from "./zoom-ui-vue3.9uHRANFW.js"; 57import { t as trackEvent, g as getSessionStorage, l as locale, s as setSessionStorage, p as post, a as get, h as findActiveMenu, d as prefix, N as NAME_SPACE, e as setupAppErrorHandling } from "./app-shared.DMIWbACC.js"; 58import { u as useCoachMark } from "./app-coach-mark.FpARfaNs.js"; 59const __variableDynamicImportRuntimeHelper = (glob, path, segs) => { 60 const v = glob[path]; 61 if (v) { 62 return typeof v === "function" ? v() : Promise.resolve(v); 63 } 64 return new Promise((_, reject) => { 65 (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)( 66 reject.bind( 67 null, 68 new Error( 69 "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "") 70 ) 71 ) 72 ); 73 }); 74}; 75const PINNED_MENUS_MAX = 20; 76const PINNED_GROUP_KEY = "__pinned_group__"; 77function buildDuplicateLabelKeys(menus) { 78 const labelToKeys = /* @__PURE__ */ new Map(); 79 const walk = (items) => { 80 var _a2; 81 for (const item of toArray(items)) { 82 const menu = toRaw(item); 83 const label = typeof (menu == null ? void 0 : menu.label) === "string" ? menu.label.trim() : ""; 84 const nodeKey = (_a2 = menu == null ? void 0 : menu.key) != null ? _a2 : menu == null ? void 0 : menu.id; 85 if (label && nodeKey) { 86 if (!labelToKeys.has(label)) labelToKeys.set(label, []); 87 labelToKeys.get(label).push(nodeKey); 88 } 89 if (toArray(menu == null ? void 0 : menu.items).length) walk(menu.items); 90 } 91 }; 92 walk(toArray(toRaw(menus))); 93 const keys = /* @__PURE__ */ new Set(); 94 for (const ks of labelToKeys.values()) { 95 if (ks.length >= 2) ks.forEach((k) => keys.add(k)); 96 } 97 return keys; 98} 99function usePinnedMenus({ 100 menus, 101 findMenu, 102 findMenuContext, 103 pinnedMenuIds, 104 onPinnedMenuIdsUpdate 105}) { 106 const pinnedMenus = ref([]); 107 const grabbedKey = ref(null); 108 const getOriginalId = (id) => (id == null ? void 0 : id.startsWith("pinned-")) ? id.slice("pinned-".length) : id; 109 const getPinnedId = (id) => `pinned-${getOriginalId(id)}`; 110 const getMenuOriginalKey = (menuItem) => { 111 var _a2; 112 const raw = (_a2 = menuItem == null ? void 0 : menuItem.key) != null ? _a2 : menuItem == null ? void 0 : menuItem.id; 113 if (raw == null) return null; 114 const str = String(raw); 115 return str.startsWith("pinned-") ? str.slice("pinned-".length) : str; 116 }; 117 const getIds = () => { 118 const raw = pinnedMenuIds == null ? void 0 : pinnedMenuIds.value; 119 return Array.isArray(raw) ? raw : []; 120 }; 121 const buildPinnedItem = (menu, duplicateLabelKeys) => { 122 var _b, _c, _d; 123 const _a2 = menu, { badge: _badge } = _a2, menuWithoutBadge = __objRest(_a2, ["badge"]); 124 const pinnedItem = __spreadProps(__spreadValues({}, menuWithoutBadge), { 125 id: getPinnedId(menu.id), 126 key: getPinnedId(menu.key) 127 }); 128 const context = findMenuContext == null ? void 0 : findMenuContext((_b = menu.key) != null ? _b : menu.id); 129 if (context == null ? void 0 : context.parent) { 130 if (context.parent.icon) pinnedItem.parentIcon = context.parent.icon; 131 } 132 const menuKey = (_c = menu.key) != null ? _c : menu.id; 133 const dupKeys = duplicateLabelKeys != null ? duplicateLabelKeys : buildDuplicateLabelKeys(unref(menus)); 134 if (menuKey && dupKeys.has(menuKey) && ((_d = context == null ? void 0 : context.parent) == null ? void 0 : _d.label)) { 135 pinnedItem.pinnedLabelWithParent = context.parent.label; 136 } 137 return pinnedItem; 138 }; 139 const applyFromOriginalIds = (originalIds) => { 140 if (!(originalIds == null ? void 0 : originalIds.length)) { 141 pinnedMenus.value = []; 142 return; 143 } 144 const duplicateLabelKeys = buildDuplicateLabelKeys(unref(menus)); 145 pinnedMenus.value = originalIds.map((id) => { 146 const menu = findMenu(id); 147 return menu ? buildPinnedItem(menu, duplicateLabelKeys) : null; 148 }
148).filter(Boolean); 149 }; 150 const syncPinnedMenus = () => applyFromOriginalIds(getIds()); 151 const emitPinnedUpdate = (nextIds) => onPinnedMenuIdsUpdate == null ? void 0 : onPinnedMenuIdsUpdate([...nextIds]); 152 const handleItemPin = ({ menuItem } = {}) => { 153 var _a2; 154 const originalId = getOriginalId((_a2 = menuItem == null ? void 0 : menuItem.id) != null ? _a2 : menuItem == null ? void 0 : menuItem.key); 155 const current = [...getIds()]; 156 const idx = current.indexOf(originalId); 157 const isPinned = idx >= 0; 158 if (!isPinned && current.length >= PINNED_MENUS_MAX) return; 159 if (isPinned) { 160 current.splice(idx, 1); 161 } else { 162 current.push(originalId); 163 } 164 emitPinnedUpdate(current); 165 applyFromOriginalIds(current); 166 }; 167 const reorderPinnedMenus = (fromIndex, toIndex) => { 168 const newMenus = [...pinnedMenus.value]; 169 const [moved] = newMenus.splice(fromIndex, 1); 170 newMenus.splice(toIndex, 0, moved); 171 const nextOriginalIds = newMenus.map((m) => getOriginalId(m.id)); 172 emitPinnedUpdate(nextOriginalIds); 173 pinnedMenus.value = newMenus; 174 }; 175 const handleSortableReorder = ({ fromIndex, toIndex }) => { 176 if (!Number.isInteger(fromIndex) || !Number.isInteger(toIndex)) return null; 177 if (fromIndex === toIndex) return null; 178 if (fromIndex < 0 || toIndex < 0) return null; 179 if (fromIndex >= pinnedMenus.value.length || toIndex >= pinnedMenus.value.length) return null; 180 reorderPinnedMenus(fromIndex, toIndex); 181 return { 182 moved: true, 183 newIndex: toIndex, 184 total: pinnedMenus.value.length 185 }; 186 }; 187 const handleKeyboardReorder = ({ menuItem, direction }) => { 188 if (!menuItem || !direction) return null; 189 const index = pinnedMenus.value.findIndex((m) => m.key === menuItem.key); 190 if (index === -1) return null; 191 const newIndex = index + direction; 192 if (newIndex < 0 || newIndex >= pinnedMenus.value.length) return null; 193 return handleSortableReorder({ fromIndex: index, toIndex: newIndex }); 194 }; 195 const isItemGrabbed = (menuItem) => { 196 const key = getMenuOriginalKey(menuItem); 197 return !!key && grabbedKey.value === key; 198 }; 199 const hasGrabbedItem = () => grabbedKey.value != null; 200 const releasePinnedGrab = () => { 201 if (grabbedKey.value != null) grabbedKey.value = null; 202 }; 203 const togglePinnedGrab = (menuItem) => { 204 const key = getMenuOriginalKey(menuItem); 205 if (!key) return null; 206 if (grabbedKey.value === key) { 207 grabbedKey.value = null; 208 return "released"; 209 } 210 grabbedKey.value = key; 211 return "grabbed"; 212 }; 213 const handlePinnedHandleKeydown = ({ event, menuItem }) => { 214 var _a2; 215 if (!event || !menuItem) return null; 216 const code = event.code; 217 if (code === "Space" || code === "Enter") { 218 const state = togglePinnedGrab(menuItem); 219 if (!state) return null; 220 event.preventDefault(); 221 event.stopPropagation(); 222 return { type: "grab", state }; 223 } 224 if (code === "Escape") { 225 if (!isItemGrabbed(menuItem)) return null; 226 releasePinnedGrab(); 227 event.preventDefault(); 228 event.stopPropagation(); 229 return { type: "release-on-escape" }; 230 } 231 if (code === "ArrowUp" || code === "ArrowDown") { 232 if (!isItemGrabbed(menuItem)) return null; 233 const direction = code === "ArrowUp" ? -1 : 1; 234 const result = (_a2 = handleKeyboardReorder({ menuItem, direction })) != null ? _a2 : { moved: false }; 235 event.preventDefault(); 236 event.stopPropagation(); 237 return __spreadValues({ type: "reorder" }, result); 238 } 239 return null; 240 }; 241 return { 242 pinnedMenus, 243 syncPinnedMenus, 244 handleItemPin, 245 handleSortableReorder, 246 handleKeyboardReorder, 247 grabbedKey, 248 isItemGrabbed, 249 hasGrabbedItem, 250 releasePinnedGrab, 251 togglePinnedGrab, 252 handlePinnedHandleKeydown 253 }; 254} 255const NS = "side-menu-v3"; 256const getTreeNodeKey = (item) => { 257 var _a2; 258 return (_a2 = item == null ? void 0 : item.key) != null ? _a2 : item == null ? void 0 : item.id; 259}; 260const toArray = (val) => Array.isArray(val) ? val : []; 261const isEmpty = (val) => !val && val !== 0 || Array.isArray(val) && val.length === 0 || typeof val === "object" && val !== null && !Array.isArray(val) && !Object.keys(val).length; 262const resolve = (obj, ...params) => typeof obj === "function" ? obj(...params) : obj; 263const getPropsData = (props) => { 264 var _a2; 265 return (_a2 = props.menus) != null ? _a2 : []; 266}; 267const collapseTransition = { 268 onBeforeEnter(el) { 269 el.dataset.oldPaddingTop = el.style.paddingTop; 270 el.dataset.oldPaddingBottom = el.style.paddingBottom; 271 el.style.maxHeight = "0"; 272 el.style.paddingTop = "0"; 273 el.style.paddingBottom = "0"; 274 }, 275 onEnter(el) { 276 requestAnimationFrame(() => { 277 el.dataset.oldOverflow = el.style.overflow; 278 el.style.maxHeight = el.scrollHeight ? `${el.scrollHeight}px` : "0"; 279 el.style.paddingTop = el.dataset.oldPaddingTop; 280 el.style.paddingBottom = el.dataset.oldPaddingBottom; 281 el.style.overflow = "hidden"; 282 }); 283 }, 284 onAfterEnter(el) { 285 el.style.maxHeight = ""; 286 el.style.overflow = el.dataset.oldOverflow; 287 }, 288 onBeforeLeave(el) { 289 el.dataset.oldPaddingTop = el.style.paddingTop; 290 el.dataset.oldPaddingBottom = el.style.paddingBottom; 291 el.dataset.oldOverflow = el.style.overflow; 292 el.style.maxHeight = `${el.scrollHeight}px`; 293 el.style.overflow = "hidden"; 294 }, 295 onLeave(el) { 296 if (el.scrollHeight !== 0) { 297 el.style.maxHeight = "0"; 298 el.style.paddingTop = "0"; 299 el.style.paddingBottom = "0"; 300 } 301 }, 302 onAfterLeave(el) { 303 el.style.maxHeight = ""; 304 el.style.overflow = el.dataset.oldOverflow; 305 el.style.paddingTop = el.dataset.oldPaddingTop; 306 el.style.paddingBottom = el.dataset.oldPaddingBottom; 307 }, 308 onLeaveCancelled(el) { 309 el.style.maxHeight = ""; 310 el.style.overflow = el.dataset.oldOverflow; 311 el.style.paddingTop = el.dataset.oldPaddingTop; 312 el.style.paddingBottom = el.dataset.oldPaddingBottom; 313 } 314}; 315function useTree(props, activeItem, injectItems = null) { 316 const instance = getCurrentInstance(); 317 const treeData = shallowRef({}); 318 let _snapshot = {}; 319 let _lastActiveKey = "\0"; 320 const processedItems = shallowRef([]); 321 const getMenusData = () => [ 322 ...injectItems ? toArray(unref(injectItems)) : [], 323 ...getPropsData(props) 324 ]; 325 const normalizedData = computed(() => { 326 const res = {}; 327 const walk = (parent, level, children) => { 328 const parentKey = getTreeNodeKey(parent);
329 if (!parentKey) return; 330 res[parentKey] = { children, level }; 331 children.forEach((item) => { 332 var _a2; 333 if ((_a2 = item.items) == null ? void 0 : _a2.length) walk(item, level + 1, item.items); 334 }); 335 }; 336 getMenusData().forEach((item) => { 337 var _a2; 338 if ((_a2 = item.items) == null ? void 0 : _a2.length) walk(item, 0, item.items); 339 }); 340 return res; 341 }); 342 const getAncestorKeys = (keyOrId, items = getMenusData(), ancestors = []) => { 343 var _a2; 344 if (!keyOrId) return null; 345 for (const menu of toArray(toRaw(items))) { 346 if (menu.key === keyOrId || menu.id === keyOrId) { 347 return ancestors.map((a) => { 348 var _a3; 349 return (_a3 = a.key) != null ? _a3 : a.id; 350 }).filter(Boolean); 351 } 352 if ((_a2 = menu.items) == null ? void 0 : _a2.length) { 353 const found = getAncestorKeys(keyOrId, menu.items, [...ancestors, menu]); 354 if (found !== null) return found; 355 } 356 } 357 return null; 358 }; 359 const updateTreeData = () => { 360 var _a2; 361 const nested = normalizedData.value; 362 const keys = Object.keys(nested); 363 if (!keys.length) { 364 _snapshot = {}; 365 treeData.value = {}; 366 return; 367 } 368 const activeKey = props.activeKey; 369 const activeKeyChanged = activeKey !== _lastActiveKey; 370 _lastActiveKey = activeKey; 371 const ancestorKeys = activeKeyChanged ? new Set((_a2 = getAncestorKeys(activeKey)) != null ? _a2 : []) : /* @__PURE__ */ new Set(); 372 const next = {}; 373 keys.forEach((key) => { 374 const prev = _snapshot[key]; 375 next[key] = __spreadProps(__spreadValues({}, nested[key]), { 376 expanded: ancestorKeys.has(key) ? true : !!((prev == null ? void 0 : prev.expanded) || props.defaultExpandAll) 377 }); 378 }); 379 _snapshot = next; 380 treeData.value = next; 381 }; 382 const toggleTreeExpansion = (item, expanded) => { 383 const key = getTreeNodeKey(item.item); 384 const entry = _snapshot[key]; 385 if (!entry) return; 386 const next = __spreadProps(__spreadValues({}, _snapshot), { 387 [key]: __spreadProps(__spreadValues({}, entry), { expanded: expanded != null ? expanded : !entry.expanded }) 388 }); 389 _snapshot = next; 390 treeData.value = next; 391 }; 392 const expandKeys = (keys) => { 393 if (!keys.length) return; 394 let changed = false; 395 const next = __spreadValues({}, _snapshot); 396 keys.forEach((key) => { 397 if (next[key] && !next[key].expanded) { 398 next[key] = __spreadProps(__spreadValues({}, next[key]), { expanded: true }); 399 changed = true; 400 } 401 }); 402 if (changed) { 403 _snapshot = next; 404 treeData.value = next; 405 } 406 }; 407 const restoreToActivePath = (activeItemNode) => { 408 const ancestorKeys = /* @__PURE__ */ new Set(); 409 let cur = activeItemNode == null ? void 0 : activeItemNode.parent; 410 while (cur) { 411 const key = getTreeNodeKey(cur.item); 412 if (key) ancestorKeys.add(key); 413 cur = cur.parent; 414 } 415 let changed = false; 416 const next = __spreadValues({}, _snapshot); 417 Object.keys(next).forEach((key) => { 418 if (key === PINNED_GROUP_KEY) return; 419 const shouldExpand = ancestorKeys.has(key); 420 if (next[key].expanded !== shouldExpand) { 421 next[key] = __spreadProps(__spreadValues({}, next[key]), { expanded: shouldExpand }); 422 changed = true; 423 } 424 }); 425 if (changed) { 426 _snapshot = next; 427 treeData.value = next; 428 } 429 }; 430 const toStableSegment = (item, fallbackIndex) => { 431 var _a2; 432 const raw = (_a2 = item == null ? void 0 : item.key) != null ? _a2 : item == null ? void 0 : item.id; 433 if (raw == null || raw === "") return `idx_${fallbackIndex}`; 434 return String(raw); 435 }; 436 const createProcessedItems = (items = [], level = 0, parentKey = "", parent = void 0) => { 437 const result = []; 438 items.forEach((item, i) => { 439 var _a2; 440 const segment = toStableSegment(item, i); 441 const key = parentKey ? `${parentKey}/${segment}` : segment; 442 const node = { 443 item, 444 index: i, 445 level, 446 key, 447 parent, 448 parentKey, 449 expanded: (_a2 = _snapshot[item.key]) == null ? void 0 : _a2.expanded 450 }; 451 if (props.activeKey === item.key) activeItem.value = node;
452 node.items = createProcessedItems(item.items, level + 1, key, node); 453 result.push(node); 454 }); 455 return result; 456 }; 457 const findMenuContext = (keyOrId, items = getPropsData(props), parent = null, root = null) => { 458 var _a2; 459 if (!keyOrId) return null; 460 for (const menu of toArray(toRaw(items))) { 461 const currentRoot = root != null ? root : menu; 462 if (menu.key === keyOrId || menu.id === keyOrId) return { menu, parent, root: currentRoot }; 463 if ((_a2 = menu.items) == null ? void 0 : _a2.length) { 464 const found = findMenuContext(keyOrId, menu.items, menu, currentRoot); 465 if (found) return found; 466 } 467 } 468 return null; 469 }; 470 const findMenu = (keyOrId) => { 471 var _a2; 472 return (_a2 = findMenuContext(keyOrId)) == null ? void 0 : _a2.menu; 473 }; 474 const findProcessedItem = (keyOrId, list = processedItems.value) => { 475 var _a2; 476 for (const item of list) { 477 if (item.item.key === keyOrId || item.item.id === keyOrId) return item; 478 if ((_a2 = item.items) == null ? void 0 : _a2.length) { 479 const found = findProcessedItem(keyOrId, item.items); 480 if (found) return found; 481 } 482 } 483 return null; 484 }; 485 const handleFocusout = (e) => { 486 var _a2; 487 const nav = (_a2 = instance == null ? void 0 : instance.vnode.el) == null ? void 0 : _a2.querySelector(`.${NS}__nav`); 488 if (!nav) return; 489 if (e.relatedTarget && nav.contains(e.relatedTarget)) return; 490 queueMicrotask(() => { 491 const ae = document.activeElement; 492 if (ae && nav.contains(ae)) return; 493 restoreToActivePath(activeItem.value); 494 }); 495 }; 496 watchEffect(() => updateTreeData()); 497 watch( 498 treeData, 499 () => { 500 processedItems.value = createProcessedItems(getMenusData()); 501 }, 502 { immediate: true } 503 ); 504 return { 505 processedItems, 506 toggleTreeExpansion, 507 expandKeys, 508 findMenu, 509 findMenuContext, 510 findProcessedItem, 511 handleFocusout 512 }; 513} 514const _hoisted_1$c = ["role"]; 515const _hoisted_2$3 = { 516 key: 0, 517 role: "presentation", 518 class: "side-menu-v3__a11y-hints" 519}; 520const _hoisted_3$3 = ["onFocusin", "onFocusout", "onContextmenu"]; 521const _hoisted_4$2 = { 522 key: 0, 523 class: "side-menu-v3__item-content is-title", 524 role: "none" 525}; 526const _hoisted_5$1 = { class: "side-menu-v3__item-title" }; 527const _hoisted_6$1 = ["tabindex", "aria-pressed", "aria-label", "onFocus", "onBlur", "onKeydown", "onFocusout"]; 528const _hoisted_7$1 = { 529 role: "presentation", 530 class: "side-menu-v3__item-label" 531}; 532const _hoisted_8$1 = { class: "side-menu-v3__item-label-text" }; 533const _hoisted_9$1 = { 534 key: 0, 535 class: "side-menu-v3__item-sub-label" 536}; 537const HINT_HANDLE_PIN_TEXT = "Press Tab to access drag handle and pin button"; 538const HINT_HANDLE_TEXT = "Press Tab to access drag handle"; 539const HINT_PIN_TEXT = "Press Tab to access pin button"; 540const _sfc_main$c = /* @__PURE__ */ Object.assign({ name: "side-menu-v3-sub" }, { 541 __name: "side-menu-sub", 542 props: { 543 menuId: String, 544 level: { type: Number, default: 0 }, 545 items: Array, 546 /** Current route / page key — drives `is-active` only; not updated by mere clicks */ 547 activeKey: { type: [String, Number], default: null }, 548 activeItem: Object, 549 pinAble: { type: Boolean, default: false }, 550 pinnedItemKeys: { type: Set, default: () => /* @__PURE__ */ new Set() }, 551 sortable: { type: Boolean, default: false }, 552 suppressGroupHover: { type: Boolean, default: false }, 553 /** 554 * When true (used inside hover popups), emits item-hover for all group items 555 * regardless of their expanded state. 556 */ 557 hoverAllGroups: { type: Boolean, default: false }, 558 isInHoverPopup: { type: Boolean, default: false }, 559 /** 560 * Predicate `(menuItem) => boolean` that returns true when the given pinned 561 * menu item is currently in the keyboard "grabbed" state. Used to drive the 562 * drag-handle icon swap and `aria-pressed` reflection without forcing this 563 * sub-component to own grab state. 564 */ 565 isItemGrabbed: { type: Function, default: () => false }, 566 /** 567 * Label shown in the right-click context menu on a pinned draggable row. 568 * Mirrors zm-dnd's "Move item" entry which lets mouse users start a drag 569 * without holding the button down. 570 */ 571 contextMoveLabel: { type: String, default: "Move item" } 572 }, 573 emits: [ 574 "item-click", 575 "item-keyboard", 576 "item-pin", 577 "item-hover", 578 "item-hover-leave", 579 "item-expanded-change",
580 "sortable-reorder", 581 "sort-start", 582 "sort-end", 583 "pinned-handle-keyboard", 584 "pinned-handle-focusout", 585 "pinned-context-move" 586 ], 587 setup(__props, { emit: __emit }) { 588 const props = __props; 589 const emit = __emit; 590 const sortableRootRef = ref(null); 591 if (props.sortable && props.level === 0) { 592 useSortable(sortableRootRef, toRef(props, "items"), { 593 watchElement: true, 594 animation: 180, 595 forceFallback: true, 596 fallbackOnBody: true, 597 draggable: ".side-menu-v3__item.is-sortable-draggable", 598 chosenClass: "draggable-chosen", 599 ghostClass: "is-drag-placeholder-row", 600 onStart: () => emit("sort-start"), 601 onEnd: () => emit("sort-end"), 602 // `oldDraggableIndex`/`newDraggableIndex` count only items matching `draggable`, 603 // i.e. they skip the non-draggable "Pinned" title row and map 1:1 to `pinnedMenus`. 604 onUpdate: (evt) => { 605 const fromIndex = evt.oldDraggableIndex; 606 const toIndex = evt.newDraggableIndex; 607 if (fromIndex == null || toIndex == null || fromIndex === toIndex) return; 608 emit("sortable-reorder", { fromIndex, toIndex }); 609 } 610 }); 611 } 612 const isSameMenuItem = (a, b) => { 613 var _a2, _b, _c, _d, _e, _f; 614 if (!a || !b) return false; 615 const normalize = (v) => v == null || v === "" ? "" : String(v); 616 const aMenuKey = normalize((_c = (_a2 = a == null ? void 0 : a.item) == null ? void 0 : _a2.key) != null ? _c : (_b = a == null ? void 0 : a.item) == null ? void 0 : _b.id); 617 const bMenuKey = normalize((_f = (_d = b == null ? void 0 : b.item) == null ? void 0 : _d.key) != null ? _f : (_e = b == null ? void 0 : b.item) == null ? void 0 : _e.id); 618 if (aMenuKey && bMenuKey && aMenuKey === bMenuKey) return true; 619 const aNodeKey = normalize(a == null ? void 0 : a.key); 620 const bNodeKey = normalize(b == null ? void 0 : b.key); 621 return !!(aNodeKey && bNodeKey && aNodeKey === bNodeKey); 622 }; 623 const findFirstFocusableIndex = (items) => (items != null ? items : []).findIndex((item) => !isItemSeparator(item) && !isItemTitle(item)); 624 const containsActiveInList = (items, active) => { 625 var _a2; 626 for (const item of items != null ? items : []) { 627 if (isSameMenuItem(item, active)) return true; 628 if (((_a2 = item.items) == null ? void 0 : _a2.length) && containsActiveInList(item.items, active)) return true; 629 } 630 return false; 631 }; 632 const focusedRowKey = ref(null); 633 const isRowFocused = (processedItem) => focusedRowKey.value === processedItem.key; 634 const isFocusEventDirectlyInRow = (event) => { 635 var _a2, _b; 636 return ((_b = (_a2 = event.target) == null ? void 0 : _a2.closest) == null ? void 0 : _b.call(_a2, "li")) === event.currentTarget; 637 }; 638 const handleRowFocusIn = (event, processedItem) => { 639 if (!isFocusEventDirectlyInRow(event)) return; 640 focusedRowKey.value = processedItem.key; 641 }; 642 const handleRowFocusOut = (event, processedItem) => { 643 var _a2, _b; 644 if (focusedRowKey.value !== processedItem.key) return; 645 if (!isFocusEventDirectlyInRow(event)) return; 646 const li = event.currentTarget; 647 const relatedLi = (_b = (_a2 = event.relatedTarget) == null ? void 0 : _a2.closest) == null ? void 0 : _b.call(_a2, "li"); 648 if (relatedLi === li) return; 649 focusedRowKey.value = null; 650 }; 651 const getTabIndex = (processedItem, index) => { 652 if (isItemSeparator(processedItem)) return void 0; 653 if (focusedRowKey.value != null) { 654 return isRowFocused(processedItem) ? "0" : "-1"; 655 } 656 if (isSameMenuItem(processedItem, props.activeItem)) return "0"; 657 if (props.level !== 0) return "-1"; 658 if (props.activeItem && containsActiveInList(props.items, props.activeItem)) return "-1"; 659 const firstFocusableIndex = findFirstFocusableIndex(props.items); 660 return index === firstFocusableIndex ? "0" : "-1"; 661 }; 662 const getControlTabIndex = (processedItem) => isRowFocused(processedItem) ? "0" : "-1"; 663 const getItemId = (processedItem) => `${props.menuId}_${processedItem.key}`; 664 const getItemProp = (processedItem, name, _params) => resolve(processedItem.item[name], _params); 665 const getItemLabel = (processedItem) => getItemProp(processedItem, "label"); 666 const getItemIcon = (processedItem) => getItemProp(processedItem, "icon") || (getItemProp(processedItem, "_pinned") ? getItemProp(processedItem, "parentIcon") : null); 667 const hoveredItemKey = ref(""); 668 const isPinnedRootHovered = (processedItem) => props.level === 0 && props.sortable && !!getItemProp(processedItem, "_pinned") && hoveredItemKey.value === processedItem.key; 669 const getDisplayIcon = (processedItem) => isPinnedRootHovered(processedItem) ? DragHandleDots : getItemIcon(processedItem); 670 const isPinnedHandle = (processedItem) => props.level === 0 && !!getItemProp(processedItem, "_pinned");
671 const focusedHandleKey = ref(null); 672 const isHandleFocused = (processedItem) => focusedHandleKey.value === processedItem.key; 673 const handleHandleFocus = (processedItem) => { 674 focusedHandleKey.value = processedItem.key; 675 }; 676 const handleHandleBlur = (processedItem) => { 677 if (focusedHandleKey.value === processedItem.key) focusedHandleKey.value = null; 678 }; 679 const getHandleIcon = (processedItem) => { 680 if (props.isItemGrabbed(processedItem.item)) return Checkmark; 681 if (props.sortable && (isPinnedRootHovered(processedItem) || isHandleFocused(processedItem))) { 682 return DragHandleDots; 683 } 684 return getItemIcon(processedItem); 685 }; 686 const getHandleAriaLabel = (processedItem) => { 687 const label = getItemLabel(processedItem) || "Item"; 688 return props.isItemGrabbed(processedItem.item) ? `Reorder ${label}, grabbed. Use up and down arrow keys to move, press space or enter to drop, press escape to cancel.` : `Reorder ${label}. Press space or enter to grab.`; 689 }; 690 const handleHandleKeydown = (event, processedItem) => { 691 emit("pinned-handle-keyboard", { originalEvent: event, processedItem }); 692 }; 693 const handleHandleFocusout = (event, processedItem) => { 694 emit("pinned-handle-focusout", { originalEvent: event, processedItem }); 695 }; 696 const getItemTitle = (processedItem) => getItemProp(processedItem, "title"); 697 const getItemAriaLabel = (processedItem) => { 698 if (isItemTitle(processedItem)) { 699 return getItemTitle(processedItem); 700 } 701 if (!!getItemProp(processedItem, "_pinned") && getItemProp(processedItem, "pinnedLabelWithParent")) { 702 return `${getItemLabel(processedItem)} (${getItemProp(processedItem, "pinnedLabelWithParent")})`.trim(); 703 } 704 return getItemLabel(processedItem); 705 }; 706 const getDescriptionId = (processedItem) => getItemId(processedItem) + "__item"; 707 const getDescribedById = (processedItem) => { 708 var _a2; 709 const ids = []; 710 if (((_a2 = getItemProp(processedItem, "badge")) == null ? void 0 : _a2.type) === "custom") { 711 ids.push(getDescriptionId(processedItem)); 712 } 713 if (hasInnerControls(processedItem)) { 714 ids.push(getHintId(processedItem)); 715 } 716 return ids.length ? ids.join(" ") : void 0; 717 }; 718 const hintHandlePinId = computed(() => `${props.menuId}__hint_handle_pin`); 719 const hintHandleId = computed(() => `${props.menuId}__hint_handle`); 720 const hintPinId = computed(() => `${props.menuId}__hint_pin`); 721 const hasInnerControls = (processedItem) => shouldShowPinButton(processedItem) || isPinnedHandle(processedItem); 722 const anyItemHasInnerControls = computed(() => { 723 var _a2; 724 return ((_a2 = props.items) != null ? _a2 : []).some(hasInnerControls); 725 }); 726 const getHintId = (processedItem) => { 727 const hasHandle = isPinnedHandle(processedItem); 728 const hasPin = shouldShowPinButton(processedItem); 729 if (hasHandle && hasPin) return hintHandlePinId.value; 730 if (hasHandle) return hintHandleId.value; 731 return hintPinId.value; 732 }; 733 const isItemGroup = (processedItem) => !isEmpty(processedItem.items); 734 const expandedSnapshot = ref(/* @__PURE__ */ new Map()); 735 watch( 736 () => props.items, 737 (items) => { 738 if (!(items == null ? void 0 : items.length)) return; 739 for (const processedItem of items) { 740 if (!isItemGroup(processedItem)) continue; 741 const nextExpanded = !!processedItem.expanded; 742 const key = processedItem.key; 743 const prevExpanded = expandedSnapshot.value.get(key); 744 let shouldEmit = false; 745 if (prevExpanded === void 0) { 746 shouldEmit = nextExpanded; 747 } else if (prevExpanded !== nextExpanded) { 748 shouldEmit = true; 749 } 750 if (shouldEmit) { 751 emit("item-expanded-change", { processedItem, expanded: nextExpanded }); 752 } 753 expandedSnapshot.value.set(key, nextExpanded); 754 } 755 }, 756 { deep: true, immediate: true } 757 ); 758 const isItemDisabled = (processedItem) => getItemProp(processedItem, "disabled") || isItemTitle(processedItem); 759 const isItemActive = (processedItem) => { 760 if (isItemSeparator(processedItem) || isItemTitle(processedItem)) return false;
761 if (isItemGroup(processedItem)) return false; 762 const ak = props.activeKey; 763 if (ak == null || ak === "") return false; 764 const { key, id } = processedItem.item || {}; 765 const norm = (v) => v == null || v === "" ? "" : String(v); 766 const cmp = String(ak); 767 return norm(key) === cmp || norm(id) === cmp; 768 }; 769 const isItemSeparator = (processedItem) => !!getItemProp(processedItem, "separator"); 770 const isItemTitle = (processedItem) => !getItemProp(processedItem, "url") && isEmpty(processedItem.items); 771 const isItemPinned = (processedItem) => { 772 var _a2, _b; 773 return !!getItemProp(processedItem, "_pinned") || props.pinnedItemKeys.has((_a2 = processedItem.item) == null ? void 0 : _a2.key) || props.pinnedItemKeys.has((_b = processedItem.item) == null ? void 0 : _b.id); 774 }; 775 const shouldShowPinButton = (processedItem) => { 776 if (isItemSeparator(processedItem) || isItemTitle(processedItem)) { 777 return false; 778 } 779 return props.pinAble && props.level > 0 || props.pinAble && props.isInHoverPopup || processedItem.item._pinned; 780 }; 781 const getPinTooltip = (processedItem) => isItemPinned(processedItem) ? "Unpin" : "Pin"; 782 const getPinAriaLabel = (processedItem) => isItemPinned(processedItem) ? `Unpin ${getItemLabel(processedItem)}` : `Pin ${getItemLabel(processedItem)}`; 783 const handlePinClick = (event, processedItem) => { 784 event.preventDefault(); 785 event.stopPropagation(); 786 emit("item-pin", { menuItem: processedItem.item }); 787 }; 788 const handlePinButtonKeydown = (event) => { 789 if (event.code === "Space" || event.code === "Enter") { 790 event.stopPropagation(); 791 } 792 }; 793 const handleItemContextMenu = (event, processedItem) => { 794 if (!props.sortable || props.level !== 0) return; 795 if (isItemTitle(processedItem) || isItemSeparator(processedItem)) return; 796 if (isItemDisabled(processedItem)) return; 797 const rowEl = event.currentTarget; 798 const helper = createContextMenu(event, { 799 data: [ 800 { 801 label: props.contextMoveLabel, 802 command: () => emit("pinned-context-move", { processedItem, rowEl }) 803 } 804 ] 805 }); 806 helper.open(); 807 event.preventDefault(); 808 event.stopPropagation(); 809 }; 810 let _touchStartX = 0; 811 let _touchStartY = 0; 812 const handleItemTouchStart = (event) => { 813 const touch = event.touches[0]; 814 if (!touch) return; 815 _touchStartX = touch.clientX; 816 _touchStartY = touch.clientY; 817 }; 818 const handleItemTouchEnd = (event, processedItem) => { 819 var _a2; 820 const touch = event.changedTouches[0]; 821 if (!touch) return; 822 if (Math.abs(touch.clientX - _touchStartX) > 10 || Math.abs(touch.clientY - _touchStartY) > 10) 823 return; 824 const url = getItemProp(processedItem, "url"); 825 if (!url) return; 826 if (isItemGroup(processedItem)) return; 827 if (isItemDisabled(processedItem) || isItemSeparator(processedItem)) return; 828 if ((_a2 = processedItem.item) == null ? void 0 : _a2.command) return; 829 trackMenuClick(processedItem); 830 emit("item-click", { originalEvent: event, processedItem }); 831 const target = getItemProp(processedItem, "target"); 832 if (target === "_blank") { 833 window.open(url, "_blank"); 834 } else { 835 window.location.href = url; 836 } 837 }; 838 const handleItemMouseenter = (event, processedItem) => { 839 if (event.pointerType === "touch") return; 840 hoveredItemKey.value = processedItem.key; 841 if (props.suppressGroupHover) return; 842 if (!isItemGroup(processedItem)) return; 843 if (!props.hoverAllGroups && processedItem.expanded) return; 844 emit("item-hover", { triggerEl: event.currentTarget, processedItem }); 845 }; 846 const handleItemMouseleave = (event, processedItem) => { 847 if (event.pointerType === "touch") return; 848 if (hoveredItemKey.value === processedItem.key) hoveredItemKey.value = ""; 849 if (!isItemGroup(processedItem)) return; 850 emit("item-hover-leave", { triggerEl: event.currentTarget, processedItem, originalEvent: event }); 851 }; 852 const trackMenuClick = (processedItem) => { 853 var _a2, _b; 854 const menuItem = processedItem == null ? void 0 : processedItem.item; 855 const label = (_b = (_a2 = menuItem == null ? void 0 : menuItem.labelEn) != null ? _a2 : menuItem == null ? void 0 : menuItem.label) != null ? _b : ""; 856 trackEvent({ 857 linkText: label.toLowerCase(), 858 linkUrl: (menuItem == null ? void 0 : menuItem.url) || "undefined", 859 uiLocation: "web portal navigation - left-hand desktop menu" 860 }); 861 };
862 const handleItemClick = (event, processedItem) => { 863 if (isItemDisabled(processedItem) || isItemSeparator(processedItem)) { 864 event.preventDefault(); 865 return; 866 } 867 if (isItemGroup(processedItem)) { 868 event.preventDefault(); 869 } 870 trackMenuClick(processedItem); 871 if (props.isInHoverPopup && isItemGroup(processedItem)) return; 872 getItemProp(processedItem, "command", { originalEvent: event, item: processedItem.item }); 873 emit("item-click", { originalEvent: event, processedItem }); 874 }; 875 const handleKeydown = (event, processedItem) => { 876 emit("item-keyboard", { originalEvent: event, processedItem }); 877 }; 878 return (_ctx, _cache) => { 879 const _component_side_menu_sub = resolveComponent("side-menu-sub", true); 880 return openBlock(), createElementBlock("ul", { 881 ref_key: "sortableRootRef", 882 ref: sortableRootRef, 883 role: __props.level === 0 ? "tree" : "group" 884 }, [ 885 anyItemHasInnerControls.value ? (openBlock(), createElementBlock("li", _hoisted_2$3, [ 886 createVNode(unref(ZmVisuallyHidden), { id: hintHandlePinId.value }, { 887 default: withCtx(() => [ 888 createTextVNode(toDisplayString(HINT_HANDLE_PIN_TEXT)) 889 ]), 890 _: 1 891 }, 8, ["id"]), 892 createVNode(unref(ZmVisuallyHidden), { id: hintHandleId.value }, { 893 default: withCtx(() => [ 894 createTextVNode(toDisplayString(HINT_HANDLE_TEXT)) 895 ]), 896 _: 1 897 }, 8, ["id"]), 898 createVNode(unref(ZmVisuallyHidden), { id: hintPinId.value }, { 899 default: withCtx(() => [ 900 createTextVNode(toDisplayString(HINT_PIN_TEXT)) 901 ]), 902 _: 1 903 }, 8, ["id"]) 904 ])) : createCommentVNode("", true), 905 (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (processedItem, index) => { 906 return openBlock(), createElementBlock("li", { 907 key: getItemProp(processedItem, "id"), 908 class: normalizeClass([ 909 "side-menu-v3__item", 910 __props.sortable && !isItemTitle(processedItem) && !isItemSeparator(processedItem) && "is-sortable-draggable" 911 ]), 912 role: "none", 913 onFocusin: ($event) => handleRowFocusIn($event, processedItem), 914 onFocusout: ($event) => handleRowFocusOut($event, processedItem), 915 onContextmenu: ($event) => handleItemContextMenu($event, processedItem) 916 }, [ 917 isItemTitle(processedItem) ? (openBlock(), createElementBlock("div", _hoisted_4$2, [ 918 createBaseVNode("span", _hoisted_5$1, toDisplayString(getItemLabel(processedItem)), 1) 919 ])) : (openBlock(), createBlock(resolveDynamicComponent(getItemProp(processedItem, "url") ? "a" : "div"), { 920 key: 1, 921 id: getItemProp(processedItem, "id"), 922 tabindex: getTabIndex(processedItem, index), 923 role: "treeitem", 924 href: getItemProp(processedItem, "url"), 925 target: getItemProp(processedItem, "target"), 926 class: normalizeClass([ 927 "side-menu-v3__item-content", 928 isItemActive(processedItem) && "is-active", 929 isItemSeparator(processedItem) && "is-separator", 930 isItemTitle(processedItem) && "is-title", 931 getItemProp(processedItem, "muted") && "is-muted", 932 isItemDisabled(processedItem) && "is-disabled" 933 ]), 934 "aria-hidden": isItemSeparator(processedItem) || void 0, 935 "aria-current": isItemActive(processedItem) ? "page" : void 0, 936 "aria-owns": isItemGroup(processedItem) ? getItemId(processedItem) + "_list" : void 0, 937 "aria-expanded": isItemGroup(processedItem) ? processedItem.expanded : void 0, 938 "aria-describedby": getDescribedById(processedItem), 939 "aria-disabled": isItemDisabled(processedItem) || void 0, 940 "aria-label": getItemAriaLabel(processedItem), 941 onPointerenter: ($event) => handleItemMouseenter($event, processedItem), 942 onPointerleave: ($event) => handleItemMouseleave($event, processedItem), 943 onTouchstart: handleItemTouchStart, 944 onTouchend: ($event) => handleItemTouchEnd($event, processedItem), 945 onClick: withModifiers(($event) =>
945 handleItemClick($event, processedItem), ["stop"]), 946 onKeydown: ($event) => handleKeydown($event, processedItem) 947 }, { 948 default: withCtx(() => { 949 var _a2; 950 return [ 951 !__props.isInHoverPopup && getItemIcon(processedItem) && (__props.level === 0 || processedItem.item._pinned) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ 952 isPinnedHandle(processedItem) ? (openBlock(), createElementBlock("span", { 953 key: 0, 954 class: normalizeClass(["side-menu-v3__item-handle", { 955 "is-grabbed": __props.isItemGrabbed(processedItem.item), 956 "is-pinnable": isPinnedHandle(processedItem) 957 }]), 958 role: "button", 959 tabindex: getControlTabIndex(processedItem), 960 "aria-pressed": __props.isItemGrabbed(processedItem.item) ? "true" : "false", 961 "aria-label": getHandleAriaLabel(processedItem), 962 onFocus: ($event) => handleHandleFocus(processedItem), 963 onBlur: ($event) => handleHandleBlur(processedItem), 964 onKeydown: ($event) => handleHandleKeydown($event, processedItem), 965 onFocusout: ($event) => handleHandleFocusout($event, processedItem), 966 onClick: _cache[0] || (_cache[0] = withModifiers(() => { 967 }, ["stop"])) 968 }, [ 969 createVNode(unref(ZmIcon), { class: "side-menu-v3__item-icon" }, { 970 default: withCtx(() => [ 971 (openBlock(), createBlock(resolveDynamicComponent(getHandleIcon(processedItem)))) 972 ]), 973 _: 2 974 }, 1024) 975 ], 42, _hoisted_6$1)) : (openBlock(), createBlock(unref(ZmIcon), { 976 key: 1, 977 class: "side-menu-v3__item-icon" 978 }, { 979 default: withCtx(() => [ 980 (openBlock(), createBlock(resolveDynamicComponent(getDisplayIcon(processedItem)))) 981 ]), 982 _: 2 983 }, 1024)) 984 ], 64)) : createCommentVNode("", true), 985 createBaseVNode("span", _hoisted_7$1, [ 986 createBaseVNode("span", _hoisted_8$1, toDisplayString(getItemLabel(processedItem)), 1), 987 !!getItemProp(processedItem, "_pinned") && getItemProp(processedItem, "pinnedLabelWithParent") ? (openBlock(), createElementBlock("span", _hoisted_9$1, toDisplayString(`(${getItemProp(processedItem, "pinnedLabelWithParent")})`), 1)) : createCommentVNode("", true) 988 ]), 989 shouldShowPinButton(processedItem) ? (openBlock(), createBlock(unref(ZmTooltip), { 990 key: 1, 991 content: getPinTooltip(processedItem), 992 arrow: false, 993 "disallow-screen-reader": "", 994 "z-index": 2002, 995 placement: "top" 996 }, { 997 default: withCtx(() => [ 998 createVNode(unref(ZmButton), { 999 type: "text", 1000 size: "sm", 1001 tabindex: getControlTabIndex(processedItem), 1002 class: normalizeClass(["side-menu-v3__item-pin-button", isItemPinned(processedItem) && "is-pinned"]), 1003 icon: isItemPinned(processedItem) ? unref(PinUnpin) : unref(Pin), 1004 "aria-label": getPinAriaLabel(processedItem), 1005 onClick: withModifiers(($event) => handlePinClick($event, processedItem), ["stop"]), 1006 onKeydown: handlePinButtonKeydown 1007 }, null, 8, ["tabindex", "class", "icon", "aria-label", "onClick"]) 1008 ]), 1009 _: 2 1010 }, 1032, ["content"])) : createCommentVNode("", true), 1011 ((_a2 = getItemProp(processedItem, "badge")) == null ? void 0 : _a2.type) === "custom" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [ 1012 createVNode(unref(ZmBadge), { 1013 class: "side-menu-v3__item-badge", 1014 type: "custom", 1015 text: getItemProp(processedItem, "badge").text, 1016 color: getItemProp(processedItem, "badge").
1016color, 1017 inverse: getItemProp(processedItem, "badge").inverse 1018 }, null, 8, ["text", "color", "inverse"]), 1019 createVNode(unref(ZmVisuallyHidden), { 1020 id: getDescriptionId(processedItem) 1021 }, { 1022 default: withCtx(() => [ 1023 createTextVNode(toDisplayString(getItemProp(processedItem, "badge").text), 1) 1024 ]), 1025 _: 2 1026 }, 1032, ["id"]) 1027 ], 64)) : createCommentVNode("", true), 1028 isItemGroup(processedItem) ? (openBlock(), createBlock(unref(ZmInlineChevronIcon), { 1029 key: 3, 1030 size: "16px", 1031 class: normalizeClass([ 1032 "side-menu-v3__submenu-icon", 1033 processedItem.expanded && "side-menu-v3__submenu-icon--expanded" 1034 ]) 1035 }, null, 8, ["class"])) : getItemProp(processedItem, "target") === "_blank" ? (openBlock(), createBlock(unref(ZmIcon), { 1036 key: 4, 1037 class: "side-menu-v3__item-external-icon" 1038 }, { 1039 default: withCtx(() => [ 1040 createVNode(unref(PopWindowPopOutV2)) 1041 ]), 1042 _: 1 1043 })) : createCommentVNode("", true) 1044 ]; 1045 }), 1046 _: 2 1047 }, 1064, ["id", "tabindex", "href", "target", "class", "aria-hidden", "aria-current", "aria-owns", "aria-expanded", "aria-describedby", "aria-disabled", "aria-label", "onPointerenter", "onPointerleave", "onTouchend", "onClick", "onKeydown"])), 1048 createVNode(Transition, mergeProps({ name: "side-menu-v3-collapse" }, { ref_for: true }, unref(collapseTransition)), { 1049 default: withCtx(() => [ 1050 isItemGroup(processedItem) ? withDirectives((openBlock(), createBlock(_component_side_menu_sub, { 1051 key: 0, 1052 id: getItemId(processedItem) + "_list", 1053 "menu-id": __props.menuId, 1054 class: normalizeClass(["side-menu-v3__list", "side-menu-v3__sub", `is-level-${__props.level + 1}`]), 1055 items: processedItem.items, 1056 level: __props.level + 1, 1057 "active-key": __props.activeKey, 1058 "active-item": __props.activeItem, 1059 "aria-label": getItemLabel(processedItem), 1060 "pin-able": __props.pinAble, 1061 "pinned-item-keys": __props.pinnedItemKeys, 1062 "suppress-group-hover": __props.suppressGroupHover, 1063 "hover-all-groups": __props.hoverAllGroups, 1064 onItemClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("item-click", $event)), 1065 onItemKeyboard: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("item-keyboard", $event)), 1066 onItemPin: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("item-pin", $event)), 1067 onItemHover: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("item-hover", $event)), 1068 onItemHoverLeave: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("item-hover-leave", $event)), 1069 onItemExpandedChange: _cache[6] || (_cache[6] = ($event) => _ctx.$emit("item-expanded-change", $event)) 1070 }, null, 8, ["id", "menu-id", "class", "items", "level", "active-key", "active-item", "aria-label", "pin-able", "pinned-item-keys", "suppress-group-hover", "hover-all-groups"])), [ 1071 [vShow, processedItem.expanded] 1072 ]) : createCommentVNode("", true) 1073 ]), 1074 _: 2 1075 }, 1040) 1076 ], 42, _hoisted_3$3); 1077 }), 128)) 1078 ], 8, _hoisted_1$c); 1079 }; 1080 } 1081}); 1082const _hoisted_1$b = { class: "side-menu-v3__item-content mgt-md" }; 1083const _hoisted_2$2 = { class: "side-menu-v3__item-content" }; 1084const _hoisted_3$2 = { class: "side-menu-v3__item-content" }; 1085const _hoisted_4$1 = { class: "side-menu-v3__item-content" }; 1086const _hoisted_5 = { class: "side-menu-v3__item-content" }; 1087const _hoisted_6 = { class: "side-menu-v3__item-content" }; 1088const _hoisted_7 = { class: "side-menu-v3__item-content" }; 1089const _hoisted_8 = { class: "side-menu-v3__item-content" }; 1090const _hoisted_9 = { class: "side-menu-v3__item-content" }; 1091const _sfc_main$b = { 1092 __name: "skeleton-list", 1093 setup(__props) { 1094 return (_ctx, _cache) => { 1095 return openBlock(), createElementBlock(Fragment, null, [ 1096 createBaseVNode("div", _hoisted_1$b, [ 1097 createVNode(unref(ZmSkeletonItem), { 1098 variant: "text", 1099 class: "side-menu-v3__item-icon", 1100 style: { "width": "20px" } 1101 }), 1102 createVNode(unref(ZmSkeletonItem), { 1103 variant: "text", 1104 style: { "width": "58%" } 1105 }) 1106 ]), 1107 createBaseVNode("div", _hoisted_2$2, [ 1108 createVNode(unref(ZmSkeletonItem), { 1109 variant: "text", 1110 class: "side-menu-v3__item-icon", 1111 style: { "width": "20px" } 1112 }), 1113 createVNode(unref(ZmSkeletonItem), { 1114 variant: "text", 1115 style: { "width": "65%" } 1116 }) 1117 ]), 1118 createBaseVNode("div", _hoisted_3$2, [ 1119 createVNode(unref(ZmSkeletonItem), { 1120 variant: "text", 1121 class: "side-menu-v3__item-icon", 1122 style: { "width": "20px" } 1123 }), 1124 createVNode(unref(ZmSkeletonItem), { 1125 variant: "text", 1126 style: { "width": "55%" } 1127 }) 1128 ]), 1129 createBaseVNode("div", _hoisted_4$1, [ 1130 createVNode(unref(ZmSkeletonItem), { 1131 variant: "text", 1132 class: "side-menu-v3__item-icon", 1133 style: { "width": "20px" } 1134 }), 1135 createVNode(unref(ZmSkeletonItem), { 1136 variant: "text", 1137 style: { "width": "62%" } 1138 }) 1139 ]), 1140 createBaseVNode("div", _hoisted_5, [ 1141 createVNode(unref(ZmSkeletonItem), { 1142 variant: "text", 1143 class: "side-menu-v3__item-icon", 1144 style: { "width": "20px" } 1145 }), 1146 createVNode(unref(ZmSkeletonItem), { 1147 variant: "text", 1148 style: { "width": "52%" } 1149 }) 1150 ]), 1151 createBaseVNode("div", _hoisted_6, [ 1152 createVNode(unref(ZmSkeletonItem), { 1153 variant: "text", 1154 class: "side-menu-v3__item-icon", 1155 style: { "width": "20px" } 1156 }), 1157 createVNode(unref(ZmSkeletonItem), { 1158 variant: "text", 1159 style: { "width": "65%" } 1160 }) 1161 ]), 1162 createBaseVNode("div", _hoisted_7, [ 1163 createVNode(unref(ZmSkeletonItem), { 1164 variant: "text", 1165 class: "side-menu-v3__item-icon", 1166 style: { "width": "20px" } 1167 }), 1168 createVNode(unref(ZmSkeletonItem), { 1169 variant: "text", 1170 style: { "width": "55%" } 1171 }) 1172 ]), 1173 createBaseVNode("div", _hoisted_8, [ 1174 createVNode(unref(ZmSkeletonItem), { 1175 variant: "text", 1176 class: "side-menu-v3__item-icon", 1177 style: { "width": "20px" } 1178 }), 1179 createVNode(unref(ZmSkeletonItem), { 1180 variant: "text", 1181 style: { "width": "62%" } 1182 }) 1183 ]), 1184 createBaseVNode("div", _hoisted_9, [ 1185 createVNode(unref(ZmSkeletonItem), { 1186 variant: "text", 1187 class: "side-menu-v3__item-icon", 1188 style: { "width": "20px" } 1189 }), 1190 createVNode(unref(ZmSkeletonItem), { 1191 variant: "text", 1192 style: { "width": "52%" } 1193 }) 1194 ]) 1195 ], 64); 1196 }; 1197 } 1198}; 1199const EVENT_CODE = { 1200 up: "ArrowUp", 1201 down: "ArrowDown", 1202 right: "ArrowRight", 1203 left: "ArrowLeft", 1204 home: "Home", 1205 end: "End", 1206 space: "Space",
1207 enter: "Enter" 1208}; 1209function useA11y(props, emit, toggleTreeExpansion, activeItem) { 1210 const instance = getCurrentInstance(); 1211 let treeItems; 1212 const buildA11y = () => { 1213 var _a2; 1214 treeItems = (_a2 = instance.vnode.el) == null ? void 0 : _a2.querySelectorAll('[role="treeitem"]'); 1215 }; 1216 onMounted(() => buildA11y()); 1217 const resolveTreeItemTarget = (event) => { 1218 var _a2, _b, _c, _d; 1219 return ((_b = (_a2 = event.currentTarget) == null ? void 0 : _a2.closest) == null ? void 0 : _b.call(_a2, '[role="treeitem"]')) || ((_d = (_c = event.target) == null ? void 0 : _c.closest) == null ? void 0 : _d.call(_c, '[role="treeitem"]')) || event.currentTarget; 1220 }; 1221 const ensureTreeItemsReady = () => { 1222 if (!treeItems || treeItems.length === 0) { 1223 buildA11y(); 1224 } 1225 }; 1226 const handleItemKeydown = (event) => __async(this, null, function* () { 1227 var _a2; 1228 ensureTreeItemsReady(); 1229 const { processedItem, originalEvent } = event; 1230 const target = resolveTreeItemTarget(originalEvent); 1231 if (!target) return; 1232 const keyCode = originalEvent.code; 1233 let flag = false; 1234 switch (keyCode) { 1235 case EVENT_CODE.up: 1236 setFocusToPreviousTreeitem(target); 1237 flag = true; 1238 break; 1239 case EVENT_CODE.down: 1240 setFocusToNextTreeitem(target); 1241 flag = true; 1242 break; 1243 case EVENT_CODE.right: 1244 if (isExpandable(target)) { 1245 isExpanded(target) ? setFocusToNextTreeitem(target) : toggleTreeExpansion(processedItem, true); 1246 } 1247 flag = true; 1248 break; 1249 case EVENT_CODE.left: 1250 if (isExpandable(target) && isExpanded(target)) { 1251 toggleTreeExpansion(processedItem, false); 1252 flag = true; 1253 } else if (isInSubtree(target)) { 1254 setFocusToParentTreeitem(target); 1255 flag = true; 1256 } 1257 break; 1258 case EVENT_CODE.home: 1259 setFocusToTreeitem(getVisibleTreeItems()[0]); 1260 flag = true; 1261 break; 1262 case EVENT_CODE.end: 1263 setFocusEndTreeitem(); 1264 flag = true; 1265 break; 1266 case EVENT_CODE.space: 1267 case EVENT_CODE.enter: 1268 if ((_a2 = processedItem.item) == null ? void 0 : _a2.title) return; 1269 toggleTreeExpansion(processedItem); 1270 if (resolve(processedItem.item.url) || resolve(processedItem.item.disabled)) { 1271 flag = false; 1272 } else { 1273 flag = true; 1274 if (isEmpty(processedItem.items)) { 1275 resolve(processedItem.item.command, { originalEvent, item: processedItem.item }); 1276 yield nextTick(); 1277 activeItem.value = processedItem; 1278 } 1279 } 1280 } 1281 if (flag) { 1282 originalEvent.stopPropagation(); 1283 originalEvent.preventDefault(); 1284 } 1285 }); 1286 const getVisibleTreeItems = () => { 1287 if (!treeItems) return []; 1288 return Array.from(treeItems).filter(isVisible); 1289 }; 1290 const isMenuVisible = (el) => { 1291 const style = window.getComputedStyle(el); 1292 return style.display !== "none" && style.visibility !== "hidden" && el.offsetParent !== null && el.clientHeight > 0; 1293 }; 1294 const isVisible = (treeitem) => { 1295 if (treeitem.getAttribute("aria-hidden") === "true" || !isMenuVisible(treeitem)) return false; 1296 if (isInSubtree(treeitem)) { 1297 const parent = getParentTreeitem(treeitem); 1298 if (!parent || parent.getAttribute("aria-expanded") === "false") return false; 1299 } 1300 return true; 1301 }; 1302 const isInSubtree = (treeitem) => { 1303 var _a2, _b; 1304 return ((_b = (_a2 = treeitem.parentNode) == null ? void 0 : _a2.parentNode) == null ? void 0 : _b.getAttribute("role")) === "group"; 1305 }; 1306 const getParentTreeitem = (treeitem) => { 1307 let node = treeitem.parentNode; 1308 if (node) { 1309 node = node.parentNode; 1310 if (node) { 1311 node = node.previousElementSibling; 1312 if ((node == null ? void 0 : node.getAttribute("role")) === "treeitem") return node; 1313 } 1314 } 1315 return null; 1316 }; 1317 const isExpandable = (treeitem) => treeitem.hasAttribute("aria-expanded"); 1318 const isExpanded = (treeitem) => treeitem.getAttribute("aria-expanded") === "true"; 1319 const setFocusToParentTreeitem = (treeitem) => { 1320 if (isInSubtree(treeitem)) { 1321 setFocusToTreeitem(treeitem.parentNode.parentNode.previousElementSibling); 1322 } 1323 }; 1324 const setFocusToTreeitem = (treeitem) => treeitem == null ? void 0 : treeitem.focus(); 1325 const setFocusEndTreeitem = () => { 1326 const visible = getVisibleTreeItems(); 1327 setFocusToTreeitem(visible[visible.length - 1]); 1328 }; 1329 const setFocusToPreviousTreeitem = (treeitem) => { 1330 const visible = getVisibleTreeItems(); 1331 let prev; 1332 for (let i = 0; i < visible.length; i++) { 1333 if (visible[i] === treeitem) break; 1334 prev = visible[i]; 1335 } 1336 if (prev) setFocusToTreeitem(prev); 1337 }; 1338 const setFocusToNextTreeitem = (treeitem) => { 1339 const visible = getVisibleTreeItems(); 1340 let next; 1341 for (let i = visible.length - 1; i >= 0; i--) { 1342 if (visible[i] === treeitem) break; 1343 next = visible[i]; 1344 } 1345 if (next) setFocusToTreeitem(next); 1346 }; 1347 return { buildA11y, handleItemKeydown }; 1348} 1349const DRAG_HANDLE_SELECTOR = ".side-menu-v3__item-handle"; 1350const CONTEXT_DRAG_BODY_CLASS = "side-menu-v3-context-dragging"; 1351function usePinnedReorder({ 1352 pinnedMenus, 1353 handleSortableReorder, 1354 handlePinnedHandleKeydown, 1355 isItemGrabbed, 1356 releasePinnedGrab, 1357 closeAllHoverPopups 1358}) { 1359 const isPinnedSorting = ref(false); 1360 const contextDragCleanup = ref(null); 1361 const handlePinnedSortStart = () => { 1362 isPinnedSorting.value = true; 1363 closeAllHoverPopups == null ? void 0 : closeAllHoverPopups(); 1364 }; 1365 const handlePinnedSortEnd = () => { 1366 isPinnedSorting.value = false;
1367 }; 1368 const handlePinnedSortableReorder = ({ fromIndex, toIndex }) => { 1369 var _a2; 1370 const result = handleSortableReorder({ fromIndex, toIndex }); 1371 if (result == null ? void 0 : result.moved) { 1372 const moved = pinnedMenus.value[result.newIndex]; 1373 const label = (_a2 = moved == null ? void 0 : moved.label) != null ? _a2 : "Item"; 1374 announce(`${label} moved to position ${result.newIndex + 1} of ${result.total}.`); 1375 } 1376 return result; 1377 }; 1378 const handlePinnedHandleKeyboard = (_0) => __async(this, [_0], function* ({ originalEvent, processedItem }) { 1379 var _a2, _b, _c; 1380 const handleEl = originalEvent.currentTarget; 1381 const result = handlePinnedHandleKeydown({ 1382 event: originalEvent, 1383 menuItem: processedItem.item 1384 }); 1385 if (!result) return; 1386 const label = (_b = (_a2 = processedItem.item) == null ? void 0 : _a2.label) != null ? _b : "Item"; 1387 if (result.type === "grab") { 1388 announce( 1389 result.state === "grabbed" ? `${label} grabbed. Use up and down arrow keys to move, press space or enter to drop.` : `${label} dropped.` 1390 ); 1391 return; 1392 } 1393 if (result.type === "release-on-escape") { 1394 announce(`${label} released, position unchanged.`); 1395 return; 1396 } 1397 if (result.type === "reorder") { 1398 if (result.moved) { 1399 const action = originalEvent.code === "ArrowUp" ? "moved up" : "moved down"; 1400 announce(`${label} ${action}, position ${result.newIndex + 1} of ${result.total}.`); 1401 yield nextTick(); 1402 (_c = handleEl == null ? void 0 : handleEl.focus) == null ? void 0 : _c.call(handleEl); 1403 } else { 1404 announce(`${label} cannot move further.`); 1405 } 1406 } 1407 }); 1408 const handlePinnedHandleFocusout = ({ originalEvent }) => { 1409 var _a2; 1410 const next = originalEvent.relatedTarget; 1411 if ((_a2 = next == null ? void 0 : next.closest) == null ? void 0 : _a2.call(next, DRAG_HANDLE_SELECTOR)) return; 1412 setTimeout(() => { 1413 var _a3; 1414 const ae = document.activeElement; 1415 if ((_a3 = ae == null ? void 0 : ae.closest) == null ? void 0 : _a3.call(ae, DRAG_HANDLE_SELECTOR)) return; 1416 releasePinnedGrab(); 1417 }, 0); 1418 }; 1419 const firePointer = (type, x, y, target) => { 1420 (target || document).dispatchEvent( 1421 new PointerEvent(type, { 1422 bubbles: true, 1423 cancelable: true, 1424 view: window, 1425 pointerType: "mouse", 1426 isPrimary: true, 1427 button: 0, 1428 buttons: type === "pointerup" ? 0 : 1, 1429 clientX: x, 1430 clientY: y, 1431 screenX: x, 1432 screenY: y 1433 }) 1434 ); 1435 }; 1436 const handlePinnedContextMove = ({ processedItem, rowEl }) => { 1437 var _a2; 1438 if (!processedItem) return; 1439 const menuItem = processedItem.item; 1440 if (!menuItem || !rowEl) return; 1441 if (contextDragCleanup.value) contextDragCleanup.value({ silent: true }); 1442 if (isItemGrabbed(menuItem)) releasePinnedGrab(); 1443 const initialIndex = pinnedMenus.value.findIndex((m) => m.key === menuItem.key); 1444 if (initialIndex === -1) return; 1445 const label = (_a2 = menuItem.label) != null ? _a2 : "Item"; 1446 const rect = rowEl.getBoundingClientRect(); 1447 const startX = rect.left + rect.width / 2; 1448 const startY = rect.top + rect.height / 2; 1449 let lastX = startX; 1450 let lastY = startY; 1451 closeAllHoverPopups == null ? void 0 : closeAllHoverPopups(); 1452 firePointer("pointerdown", startX, startY, rowEl); 1453 queueMicrotask(() => { 1454 firePointer("pointermove", startX, startY + 8); 1455 document.body.classList.add(CONTEXT_DRAG_BODY_CLASS); 1456 }); 1457 announce( 1458 `${label} grabbed. Move the mouse to reposition, click to drop, press Escape to cancel.` 1459 ); 1460 const trackUserMouse = (e) => { 1461 lastX = e.clientX; 1462 lastY = e.clientY; 1463 }; 1464 let onUserMouseDown; 1465 let onKeydown; 1466 const cleanup = ({ silent = false } = {}) => { 1467 document.removeEventListener("mousemove", trackUserMouse); 1468 document.removeEventListener("mousedown", onUserMouseDown, true); 1469 document.removeEventListener("keydown", onKeydown, true); 1470 document.body.classList.remove(CONTEXT_DRAG_BODY_CLASS); 1471 contextDragCleanup.value = null; 1472 if (silent) return; 1473 }; 1474 onUserMouseDown = (e) => { 1475 const swallowClick = (ce) => { 1476 ce.preventDefault(); 1477 ce.stopPropagation(); 1478 document.removeEventListener("click", swallowClick, true); 1479 }; 1480 document.addEventListener("click", swallowClick, true); 1481 setTimeout(() => document.removeEventListener("click", swallowClick, true), 0); 1482 firePointer("pointerup", e.clientX, e.clientY); 1483 cleanup();
1484 const finalIndex = pinnedMenus.value.findIndex((m) => m.key === menuItem.key); 1485 if (finalIndex !== -1 && finalIndex !== initialIndex) { 1486 announce( 1487 `${label} dropped at position ${finalIndex + 1} of ${pinnedMenus.value.length}.` 1488 ); 1489 } else { 1490 announce(`${label} dropped, position unchanged.`); 1491 } 1492 e.stopPropagation(); 1493 }; 1494 onKeydown = (e) => { 1495 if (e.code !== "Escape") return; 1496 e.preventDefault(); 1497 e.stopPropagation(); 1498 firePointer("pointerup", lastX, lastY); 1499 cleanup(); 1500 queueMicrotask(() => { 1501 const finalIndex = pinnedMenus.value.findIndex((m) => m.key === menuItem.key); 1502 if (finalIndex !== -1 && finalIndex !== initialIndex) { 1503 handleSortableReorder({ fromIndex: finalIndex, toIndex: initialIndex }); 1504 } 1505 announce(`${label} reorder cancelled.`); 1506 }); 1507 }; 1508 document.addEventListener("mousemove", trackUserMouse); 1509 document.addEventListener("mousedown", onUserMouseDown, true); 1510 document.addEventListener("keydown", onKeydown, true); 1511 contextDragCleanup.value = cleanup; 1512 }; 1513 onBeforeUnmount(() => { 1514 if (contextDragCleanup.value) contextDragCleanup.value({ silent: true }); 1515 }); 1516 return { 1517 isPinnedSorting, 1518 handlePinnedSortStart, 1519 handlePinnedSortEnd, 1520 handlePinnedSortableReorder, 1521 handlePinnedHandleKeyboard, 1522 handlePinnedHandleFocusout, 1523 handlePinnedContextMove 1524 }; 1525} 1526const _hoisted_1$a = { 1527 key: 0, 1528 class: "side-menu-v3-wrapper__header" 1529}; 1530const _hoisted_2$1 = ["aria-label"]; 1531const _hoisted_3$1 = { 1532 key: 1, 1533 class: "side-menu-v3-wrapper__footer" 1534}; 1535const _hoisted_4 = ["aria-label", "onMouseenter", "onMouseleave"]; 1536const _sfc_main$a = /* @__PURE__ */ Object.assign({ name: "side-menu-v3" }, { 1537 __name: "side-menu", 1538 props: { 1539 menus: { type: Array, required: true }, 1540 activeKey: { type: String, default: null }, 1541 pinAble: { type: Boolean, default: false }, 1542 pinnedMenuIds: { type: Array, default: () => [] }, 1543 isMobile: { type: Boolean, default: false }, 1544 isLoading: { type: Boolean, default: false }, 1545 showInitialMask: { type: Boolean, default: false }, 1546 ariaLabel: String, 1547 /** When true (default), expanding a group auto-collapses its siblings. */ 1548 accordion: { type: Boolean, default: true }, 1549 adjust: Boolean, 1550 width: { type: Number, default: 280 }, 1551 minWidth: { type: Number, default: 200 }, 1552 maxWidth: { type: Number, default: 400 }, 1553 /** Label of the "Move item" entry inside the pinned right-click context menu. */ 1554 contextMoveLabel: { type: String, default: "Move item" } 1555 }, 1556 emits: ["update:pinnedMenuIds", "item-expanded-change", "item-click"], 1557 setup(__props, { expose: __expose, emit: __emit }) { 1558 const props = __props; 1559 const emit = __emit; 1560 const menuId = useId(); 1561 const scrollbarRef = useTemplateRef("scrollbarRef"); 1562 const mainNavRef = useTemplateRef("mainNavRef"); 1563 const activeItem = ref(); 1564 const hoverStack = ref([]); 1565 const hoverPopupEls = {}; 1566 let _hoverShowTimer = null; 1567 let _hoverHideTimer = null; 1568 let _scrollbarWrapEl = null; 1569 const skipNextFocusoutRestore = ref(false); 1570 watch( 1571 () => hoverStack.value.map((item) => item == null ? void 0 : item.triggerEl), 1572 (newEls, oldEls) => { 1573 const next = new Set(newEls.filter(Boolean)); 1574 const prev = new Set((oldEls != null ? oldEls : []).filter(Boolean)); 1575 prev.forEach((el) => { 1576 if (!next.has(el)) el.classList.remove("is-hover"); 1577 }); 1578 next.forEach((el) => el.classList.add("is-hover")); 1579 } 1580 ); 1581 const getScrollWrap = () => { 1582 var _a2, _b; 1583 return (_b = (_a2 = scrollbarRef.value) == null ? void 0 : _a2.getScrollContainer) == null ? void 0 : _b.call(_a2); 1584 }; 1585 const isPinnedScopeItem = (processedItem) => { 1586 var _a2; 1587 return !!((_a2 = processedItem == null ? void 0 : processedItem.item) == null ? void 0 : _a2._pinnedScope); 1588 }; 1589 const collapseAccordionSiblings = (item) => { 1590 if (!props.accordion) return; 1591 const isPinned = isPinnedScopeItem(item); 1592 const rootList = isPinned ? pinnedProcessedItems.value : processedItems.value; 1593 const siblings = item.parent ? item.parent.items : rootList;
1594 siblings == null ? void 0 : siblings.forEach((s) => { 1595 if (s.key === item.key || !s.expanded) return; 1596 if (isPinned) togglePinnedExpansion(s, false); 1597 else toggleTreeExpansion(s, false); 1598 }); 1599 }; 1600 const clearHoverTimers = () => { 1601 clearTimeout(_hoverShowTimer); 1602 clearTimeout(_hoverHideTimer); 1603 }; 1604 const closeAllHoverPopups = () => { 1605 clearHoverTimers(); 1606 hoverStack.value = []; 1607 }; 1608 const getOptimalTop = (triggerRect, popupHeight) => { 1609 const vh = window.innerHeight; 1610 const MARGIN = 8; 1611 const spaceBelow = vh - triggerRect.top - MARGIN; 1612 const spaceAbove = triggerRect.bottom - MARGIN; 1613 if (popupHeight <= spaceBelow) return triggerRect.top; 1614 if (popupHeight <= spaceAbove) return triggerRect.bottom - popupHeight; 1615 const centered = triggerRect.top + (triggerRect.height - popupHeight) / 2; 1616 return Math.max(MARGIN, Math.min(vh - popupHeight - MARGIN, centered)); 1617 }; 1618 const getSidebarRight = (triggerEl) => { 1619 const wrapper = triggerEl.closest(".side-menu-v3-wrapper"); 1620 return (wrapper != null ? wrapper : triggerEl).getBoundingClientRect().right; 1621 }; 1622 const estimatePopupHeight = (processedItem) => { 1623 var _a2, _b; 1624 const ITEM_H = 36, HEADER_H = 42, POPUP_PD = 16; 1625 return Math.min( 1626 ((_b = (_a2 = processedItem == null ? void 0 : processedItem.items) == null ? void 0 : _a2.length) != null ? _b : 0) * ITEM_H + HEADER_H + POPUP_PD, 1627 window.innerHeight * 0.6 1628 ); 1629 }; 1630 const getPopupLeft = (level, triggerEl) => { 1631 var _a2; 1632 if (level === 0) return getSidebarRight(triggerEl) + 4; 1633 const prevEl = hoverPopupEls[level - 1]; 1634 return ((_a2 = prevEl == null ? void 0 : prevEl.getBoundingClientRect().right) != null ? _a2 : triggerEl.getBoundingClientRect().right) + 4; 1635 }; 1636 const withCollapsedItems = (item) => { 1637 var _a2; 1638 return __spreadProps(__spreadValues({}, item), { 1639 expanded: false, 1640 items: (_a2 = item.items) == null ? void 0 : _a2.map(withCollapsedItems) 1641 }); 1642 }; 1643 const openHoverAt = (level, { processedItem, triggerEl }) => { 1644 clearHoverTimers(); 1645 const delay = hoverStack.value.length > 0 ? 0 : 200; 1646 hoverStack.value = hoverStack.value.slice(0, level); 1647 _hoverShowTimer = setTimeout(() => __async(this, null, function* () { 1648 const rect = triggerEl.getBoundingClientRect(); 1649 const estimatedStyle = { 1650 top: `${getOptimalTop(rect, estimatePopupHeight(processedItem))}px`, 1651 left: `${getPopupLeft(level, triggerEl)}px` 1652 }; 1653 hoverStack.value = [ 1654 ...hoverStack.value.slice(0, level), 1655 { processedItem: withCollapsedItems(processedItem), triggerEl, style: estimatedStyle } 1656 ]; 1657 yield nextTick(); 1658 const popupEl = hoverPopupEls[level]; 1659 if (popupEl) { 1660 hoverStack.value[level] = __spreadProps(__spreadValues({}, hoverStack.value[level]), { 1661 style: { 1662 top: `${getOptimalTop(rect, popupEl.offsetHeight)}px`, 1663 left: `${getPopupLeft(level, triggerEl)}px` 1664 } 1665 }); 1666 } 1667 }), delay); 1668 }; 1669 const onPopupMouseenter = (level) => { 1670 clearHoverTimers(); 1671 if (hoverStack.value.length > level + 1) { 1672 hoverStack.value = hoverStack.value.slice(0, level + 1); 1673 } 1674 }; 1675 const isTooltipNode = (node) => { 1676 var _a2; 1677 return !!((_a2 = node == null ? void 0 : node.closest) == null ? void 0 : _a2.call(node, '[role="tooltip"]')); 1678 }; 1679 const getPopupLevelByNode = (node) => { 1680 var _a2; 1681 if (!node) return -1; 1682 for (const [key, el] of Object.entries(hoverPopupEls)) { 1683 if ((_a2 = el == null ? void 0 : el.contains) == null ? void 0 : _a2.call(el, node)) return Number(key); 1684 } 1685 return -1; 1686 }; 1687 const onPopupMouseleave = (level, event) => { 1688 const relatedTarget = event == null ? void 0 : event.relatedTarget; 1689 const targetPopupLevel = getPopupLevelByNode(relatedTarget); 1690 if (targetPopupLevel >= level + 1 || relatedTarget && isTooltipNode(relatedTarget)) return; 1691 clearHoverTimers(); 1692 _hoverHideTimer = setTimeout(() => { 1693 hoverStack.value = hoverStack.value.slice(0, level); 1694 }, 150); 1695 }; 1696 const onPopupItemHoverLeave = (level, event) => { 1697 const relatedTarget = event == null ? void 0 : event.relatedTarget; 1698 const targetPopupLevel = getPopupLevelByNode(relatedTarget); 1699 if (targetPopupLevel >= level + 1 || relatedTarget && isTooltipNode(relatedTarget)) return; 1700 clearHoverTimers(); 1701 _hoverHideTimer = setTimeout(() => {
1702 hoverStack.value = hoverStack.value.slice(0, level + 1); 1703 }, 150); 1704 }; 1705 const showHoverPopup = ({ triggerEl, processedItem }) => { 1706 if (props.isMobile) return; 1707 if (isPinnedSorting.value) return; 1708 if (processedItem.expanded) return; 1709 openHoverAt(0, { processedItem, triggerEl }); 1710 }; 1711 const handlePopupItemHover = (level, { processedItem, triggerEl }) => { 1712 if (isPinnedSorting.value) return; 1713 openHoverAt(level + 1, { processedItem, triggerEl }); 1714 }; 1715 const onScrollbarScroll = () => { 1716 var _a2; 1717 if (!hoverStack.value.length || !_scrollbarWrapEl) return; 1718 const level0 = hoverStack.value[0]; 1719 if (!level0) return; 1720 const triggerRect = level0.triggerEl.getBoundingClientRect(); 1721 const wrapRect = _scrollbarWrapEl.getBoundingClientRect(); 1722 if (triggerRect.bottom < wrapRect.top || triggerRect.top > wrapRect.bottom) { 1723 closeAllHoverPopups(); 1724 } else { 1725 const popupEl = hoverPopupEls[0]; 1726 const popupH = (_a2 = popupEl == null ? void 0 : popupEl.offsetHeight) != null ? _a2 : estimatePopupHeight(level0.processedItem); 1727 hoverStack.value[0] = __spreadProps(__spreadValues({}, hoverStack.value[0]), { 1728 style: { 1729 top: `${getOptimalTop(triggerRect, popupH)}px`, 1730 left: `${getSidebarRight(level0.triggerEl) + 4}px` 1731 } 1732 }); 1733 } 1734 }; 1735 const { 1736 processedItems, 1737 toggleTreeExpansion, 1738 expandKeys, 1739 findMenu, 1740 findMenuContext, 1741 findProcessedItem, 1742 handleFocusout 1743 } = useTree(props, activeItem); 1744 const { handleItemKeydown: _a11yHandleItemKeydown, buildA11y } = useA11y( 1745 {}, 1746 () => { 1747 }, 1748 toggleTreeExpansion, 1749 activeItem 1750 ); 1751 const handleItemKeydown = (event) => __async(this, null, function* () { 1752 var _a2, _b, _c, _d, _e, _f, _g, _h, _i; 1753 const { processedItem, originalEvent } = event; 1754 const keyCode = originalEvent.code; 1755 if (((_a2 = processedItem.item) == null ? void 0 : _a2._pinned) && originalEvent.altKey) { 1756 if (keyCode === "ArrowUp" || keyCode === "ArrowDown") { 1757 const direction = keyCode === "ArrowUp" ? -1 : 1; 1758 const result = handleKeyboardReorder({ menuItem: processedItem.item, direction }); 1759 originalEvent.stopPropagation(); 1760 originalEvent.preventDefault(); 1761 if (result == null ? void 0 : result.moved) { 1762 const label = (_c = (_b = processedItem.item) == null ? void 0 : _b.label) != null ? _c : "Item"; 1763 const action = direction < 0 ? "moved up" : "moved down"; 1764 announce(`${label} ${action}, new position ${result.newIndex + 1} of ${result.total}`); 1765 yield nextTick(); 1766 if ((_d = processedItem.item) == null ? void 0 : _d.id) { 1767 (_e = document.getElementById(String(processedItem.item.id))) == null ? void 0 : _e.focus(); 1768 } 1769 } 1770 return; 1771 } 1772 } 1773 closeAllHoverPopups(); 1774 if ((_f = processedItem.items) == null ? void 0 : _f.length) { 1775 const isPinned = !!((_g = processedItem.item) == null ? void 0 : _g._pinned); 1776 const expanded = processedItem.expanded; 1777 const doToggle = (next) => { 1778 if (isPinned) togglePinnedExpansion(processedItem, next); 1779 else toggleTreeExpansion(processedItem, next); 1780 }; 1781 if (keyCode === "Space" || keyCode === "Enter") { 1782 originalEvent.preventDefault(); 1783 originalEvent.stopPropagation(); 1784 if (!expanded) collapseAccordionSiblings(processedItem); 1785 doToggle(); 1786 return; 1787 } 1788 if (keyCode === "ArrowRight" && !expanded) { 1789 collapseAccordionSiblings(processedItem); 1790 doToggle(true); 1791 originalEvent.preventDefault(); 1792 originalEvent.stopPropagation(); 1793 return; 1794 } 1795 if (keyCode === "ArrowLeft" && expanded) { 1796 doToggle(false); 1797 originalEvent.preventDefault(); 1798 originalEvent.stopPropagation(); 1799 return; 1800 } 1801 } 1802 if (keyCode === "Space" && ((_h = processedItem.item) == null ? void 0 : _h.url)) { 1803 originalEvent.preventDefault(); 1804 const target = (_i = originalEvent.currentTarget) != null ? _i : originalEvent.target; 1805 target == null ? void 0 : target.click(); 1806 return; 1807 } 1808 return _a11yHandleItemKeydown(event); 1809 }); 1810 const { 1811 pinnedMenus, 1812 syncPinnedMenus, 1813 handleItemPin, 1814 handleKeyboardReorder, 1815 handleSortableReorder, 1816 isItemGrabbed, 1817 releasePinnedGrab, 1818 handlePinnedHandleKeydown 1819 } = usePinnedMenus({ 1820 menus: toRef(props, "menus"), 1821 findMenu, 1822 findMenuContext, 1823 pinnedMenuIds: toRef(props, "pinnedMenuIds"), 1824 onPinnedMenuIdsUpdate: (ids) => emit("update:pinnedMenuIds", ids) 1825 }); 1826 const pinnedItemKeysSet = computed(() => {
1827 const keys = pinnedMenus.value.map((m) => { 1828 var _a2; 1829 const k = (_a2 = m.key) != null ? _a2 : m.id; 1830 return (k == null ? void 0 : k.startsWith("pinned-")) ? k.slice("pinned-".length) : k; 1831 }); 1832 return new Set(keys); 1833 }); 1834 const showPinnedSection = computed(() => props.pinAble && pinnedMenus.value.length > 0); 1835 const pinnedExpandedKeys = ref(/* @__PURE__ */ new Set()); 1836 const getPinnedItemKey = (item) => { 1837 var _a2; 1838 return (_a2 = item == null ? void 0 : item.key) != null ? _a2 : item == null ? void 0 : item.id; 1839 }; 1840 const normalizePinnedKey = (key) => (key == null ? void 0 : key.startsWith("pinned-")) ? key.slice("pinned-".length) : key; 1841 const toStableNodeSegment = (item, fallbackIndex) => { 1842 const rawKey = normalizePinnedKey(getPinnedItemKey(item)); 1843 return rawKey == null || rawKey === "" ? `idx_${fallbackIndex}` : String(rawKey); 1844 }; 1845 const togglePinnedExpansion = (processedItem, expanded) => { 1846 const key = getPinnedItemKey(processedItem == null ? void 0 : processedItem.item); 1847 if (!key) return; 1848 const next = new Set(pinnedExpandedKeys.value); 1849 const nextExpanded = expanded != null ? expanded : !processedItem.expanded; 1850 if (nextExpanded) next.add(key); 1851 else next.delete(key); 1852 pinnedExpandedKeys.value = next; 1853 }; 1854 const buildPinnedProcessedItems = (items, level = 0, parent = void 0, parentKey = "") => { 1855 const list = items.map((item, index) => { 1856 var _a2; 1857 const segment = toStableNodeSegment(item, index); 1858 const nodeKey = parentKey ? `${parentKey}/${segment}` : `pinned/${segment}`; 1859 const menuKey = normalizePinnedKey(getPinnedItemKey(item)); 1860 const pinnedItem = __spreadProps(__spreadValues({}, item), { 1861 _pinned: !!(menuKey && pinnedItemKeysSet.value.has(menuKey)), 1862 // Every node in the pinned tree carries this flag, including descendants 1863 // of pinned root groups. Consumed by `isPinnedScopeItem` to decide which 1864 // toggle / accordion path to take. Decoupled from `_pinned` (root-only). 1865 _pinnedScope: true 1866 }); 1867 const node = { 1868 item: pinnedItem, 1869 index, 1870 level, 1871 key: nodeKey, 1872 parent, 1873 parentKey, 1874 expanded: pinnedExpandedKeys.value.has(getPinnedItemKey(pinnedItem)) 1875 }; 1876 node.items = buildPinnedProcessedItems((_a2 = item.items) != null ? _a2 : [], level + 1, node, nodeKey); 1877 return node; 1878 }); 1879 if (level === 0 && list.length) { 1880 list.unshift({ 1881 item: { 1882 _pinned: true, 1883 _pinnedScope: true, 1884 label: "Pinned" 1885 }, 1886 index: 0, 1887 level: 0, 1888 key: "pinned_0", 1889 parent: void 0, 1890 parentKey: "" 1891 }); 1892 } 1893 return list; 1894 }; 1895 const pinnedProcessedItems = computed(() => buildPinnedProcessedItems(pinnedMenus.value)); 1896 const { 1897 isPinnedSorting, 1898 handlePinnedSortStart, 1899 handlePinnedSortEnd, 1900 handlePinnedSortableReorder, 1901 handlePinnedHandleKeyboard, 1902 handlePinnedHandleFocusout, 1903 handlePinnedContextMove 1904 } = usePinnedReorder({ 1905 pinnedMenus, 1906 handleSortableReorder, 1907 handlePinnedHandleKeydown, 1908 isItemGrabbed, 1909 releasePinnedGrab, 1910 closeAllHoverPopups 1911 }); 1912 const handleSidebarFocusout = (e) => { 1913 if (skipNextFocusoutRestore.value) { 1914 skipNextFocusoutRestore.value = false; 1915 return; 1916 } 1917 handleFocusout(e); 1918 }; 1919 const handleItemClick = (event) => __async(this, null, function* () { 1920 var _a2, _b; 1921 const { processedItem } = event; 1922 closeAllHoverPopups(); 1923 if ((_a2 = processedItem.items) == null ? void 0 : _a2.length) { 1924 if (!processedItem.expanded) collapseAccordionSiblings(processedItem); 1925 if ((_b = processedItem.item) == null ? void 0 : _b._pinned) togglePinnedExpansion(processedItem); 1926 else toggleTreeExpansion(processedItem); 1927 return; 1928 } 1929 if (processedItem.item.url && processedItem.item.target !== "_blank") { 1930 skipNextFocusoutRestore.value = true; 1931 emit("item-click", { processedItem }); 1932 return; 1933 } 1934 yield nextTick(); 1935 activeItem.value = processedItem; 1936 emit("item-click", { processedItem }); 1937 }); 1938 const handleItemPinWithHoverClose = (event) => { 1939 closeAllHoverPopups(); 1940 handleItemPin(event); 1941 }; 1942 const focusMainSidebarTreeitem = (processedItem) => { 1943 var _a2; 1944 const menuId2 = (_a2 = processedItem == null ? void 0 : processedItem.item) == null ? void 0 : _a2.id; 1945 if (menuId2 == null || menuId2 === "") return; 1946 const el = document.getElementById(String(menuId2)); 1947 const nav = mainNavRef.value; 1948 if (el && (nav == null ? void 0 : nav.contains(el))) el.focus(); 1949 }; 1950 const handleHoverPopupItemClick = (_0) => __async(this, [_0], function* ({ processedItem: child }) { 1951 var _a2, _b, _c; 1952 if ((_a2 = child.items) == null ? void 0 : _a2.length) return; 1953 closeAllHoverPopups(); 1954 if (((_b = child.item) == null ? void 0 : _b.url) && ((_c = child.item) == null ? void 0 : _c.target) !== "_blank") { 1955 skipNextFocusoutRestore.value = true; 1956 return; 1957 } 1958 const chain = []; 1959 let cur = child; 1960 while (cur) { 1961 chain.unshift(cur); 1962 cur = cur.parent; 1963 } 1964 const expandWithAccordion = (item) => { 1965 var _a3; 1966 if (!((_a3 = item.items) == null ? void 0 : _a3.length) || item.expanded) return; 1967 collapseAccordionSiblings(item); 1968 toggleTreeExpansion(item, true); 1969 };
1970 chain.slice(0, -1).forEach(expandWithAccordion); 1971 yield nextTick(); 1972 activeItem.value = child; 1973 scrollToActive(); 1974 focusMainSidebarTreeitem(child); 1975 }); 1976 watch(() => props.menus, syncPinnedMenus, { immediate: true }); 1977 watch(() => props.pinnedMenuIds, syncPinnedMenus); 1978 const scrollToActive = () => { 1979 const isVisibleElement = (el) => !!el && el.offsetParent !== null && el.getClientRects().length > 0; 1980 const getActiveElement = (root) => { 1981 var _a2; 1982 const activeCandidates = root == null ? void 0 : root.querySelectorAll(".side-menu-v3__item-content.is-active"); 1983 if (!(activeCandidates == null ? void 0 : activeCandidates.length)) return null; 1984 return (_a2 = Array.from(activeCandidates).find(isVisibleElement)) != null ? _a2 : activeCandidates[0]; 1985 }; 1986 setTimeout(() => { 1987 var _a2, _b; 1988 const scrollWrap = getScrollWrap(); 1989 const activeEl = getActiveElement(scrollWrap); 1990 if (!activeEl) return; 1991 (_b = (_a2 = scrollbarRef.value) == null ? void 0 : _a2.scrollYIntoView) == null ? void 0 : _b.call(_a2, activeEl, 300, 64); 1992 }, 0); 1993 }; 1994 watch(() => props.activeKey, scrollToActive); 1995 watch( 1996 activeItem, 1997 (val, old) => { 1998 if (val && !old) scrollToActive(); 1999 }, 2000 { once: true } 2001 ); 2002 const onDocumentClick = (e) => { 2003 var _a2, _b; 2004 if (!hoverStack.value.length) return; 2005 const target = e.target; 2006 const inSidebar = (_b = (_a2 = scrollbarRef.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b.contains(target); 2007 const inPopup = Object.values(hoverPopupEls).some((el) => el.contains(target)); 2008 if (!inSidebar && !inPopup) closeAllHoverPopups(); 2009 }; 2010 onMounted(() => { 2011 const wrap = getScrollWrap(); 2012 if (wrap) { 2013 _scrollbarWrapEl = wrap; 2014 wrap.addEventListener("scroll", onScrollbarScroll, { passive: true }); 2015 } 2016 document.addEventListener("click", onDocumentClick, { capture: true }); 2017 }); 2018 onBeforeUnmount(() => { 2019 clearHoverTimers(); 2020 if (_scrollbarWrapEl) { 2021 _scrollbarWrapEl.removeEventListener("scroll", onScrollbarScroll); 2022 _scrollbarWrapEl = null; 2023 } 2024 document.removeEventListener("click", onDocumentClick, { capture: true }); 2025 }); 2026 watch(processedItems, () => __async(this, null, function* () { 2027 yield nextTick(); 2028 buildA11y(); 2029 })); 2030 watch(pinnedProcessedItems, () => __async(this, null, function* () { 2031 yield nextTick(); 2032 buildA11y(); 2033 })); 2034 const reset = () => { 2035 activeItem.value = void 0; 2036 }; 2037 const setActive = (keyOrId) => __async(this, null, function* () { 2038 var _a2; 2039 const item = findProcessedItem(keyOrId); 2040 if (!item) return; 2041 const ancestorKeys = []; 2042 let ancestor = item.parent; 2043 while (ancestor) { 2044 ancestorKeys.push((_a2 = ancestor.item.key) != null ? _a2 : ancestor.item.id); 2045 ancestor = ancestor.parent; 2046 } 2047 expandKeys(ancestorKeys); 2048 yield nextTick(); 2049 activeItem.value = item; 2050 scrollToActive(); 2051 }); 2052 const menuRef = { 2053 toggleExpand: (keyOrId, expanded) => { 2054 const item = findProcessedItem(keyOrId); 2055 if (item) toggleTreeExpansion(item, expanded); 2056 } 2057 }; 2058 __expose({ reset, setActive, menuRef }); 2059 return (_ctx, _cache) => { 2060 return openBlock(), createElementBlock("div", { 2061 class: normalizeClass(["side-menu-v3-wrapper", { "show-initial-mask": __props.showInitialMask }]), 2062 onFocusout: handleSidebarFocusout 2063 }, [ 2064 createVNode(unref(ZmSkeleton), { 2065 loading: __props.isLoading, 2066 animated: "" 2067 }, { 2068 template: withCtx(() => [ 2069 createVNode(_sfc_main$b) 2070 ]), 2071 default: withCtx(() => [ 2072 _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_1$a, [ 2073 renderSlot(_ctx.$slots, "header", { isCollapsed: false }) 2074 ])) : createCommentVNode("", true), 2075 createVNode(unref(ZmScrollbar), { 2076 ref_key: "scrollbarRef", 2077 ref: scrollbarRef, 2078 class: "side-menu-v3-wrapper__body" 2079 }, { 2080 default: withCtx(() => [ 2081 createBaseVNode("nav", { 2082 ref_key: "mainNavRef", 2083 ref: mainNavRef, 2084 class: "side-menu-v3__nav", 2085 "aria-label": __props.ariaLabel || "Main navigation" 2086 }, [ 2087 showPinnedSection.value ? (openBlock(), createBlock(_sfc_main$c, { 2088 key: `pinned-${pinnedProcessedItems.value.length > 2 ? "sortable" : "static"}`, 2089 "menu-id": `${unref(menuId)}-pinned`, 2090 class: "side-menu-v3__list side-menu-v3__list--pinned", 2091 items: pinnedProcessedItems.value, 2092 level: 0, 2093 "active-key": __props.activeKey, 2094 "active-item": activeItem.value, 2095 "aria-label": `${__props.ariaLabel || "Menu"} pinned`, 2096 "has-sub-item": false, 2097 "pin-able": __props.pinAble, 2098 "pinned-item-keys": pinnedItemKeysSet.value, 2099 sortable: pinnedProcessedItems.value.length > 2, 2100 "suppress-group-hover": unref(isPinnedSorting), 2101 "is-item-grabbed": unref(isItemGrabbed), 2102 "context-move-label": __props.contextMoveLabel,
2103 onItemClick: handleItemClick, 2104 onItemKeyboard: handleItemKeydown, 2105 onItemPin: handleItemPinWithHoverClose, 2106 onItemHover: showHoverPopup, 2107 onItemHoverLeave: _cache[0] || (_cache[0] = (evt) => onPopupMouseleave(0, evt == null ? void 0 : evt.originalEvent)), 2108 onSortStart: unref(handlePinnedSortStart), 2109 onSortEnd: unref(handlePinnedSortEnd), 2110 onSortableReorder: unref(handlePinnedSortableReorder), 2111 onPinnedHandleKeyboard: unref(handlePinnedHandleKeyboard), 2112 onPinnedHandleFocusout: unref(handlePinnedHandleFocusout), 2113 onPinnedContextMove: unref(handlePinnedContextMove), 2114 onItemExpandedChange: _cache[1] || (_cache[1] = ($event) => emit("item-expanded-change", $event)) 2115 }, null, 8, ["menu-id", "items", "active-key", "active-item", "aria-label", "pin-able", "pinned-item-keys", "sortable", "suppress-group-hover", "is-item-grabbed", "context-move-label", "onSortStart", "onSortEnd", "onSortableReorder", "onPinnedHandleKeyboard", "onPinnedHandleFocusout", "onPinnedContextMove"])) : createCommentVNode("", true), 2116 createVNode(_sfc_main$c, { 2117 "menu-id": unref(menuId), 2118 class: "side-menu-v3__list", 2119 items: unref(processedItems), 2120 level: 0, 2121 "active-key": __props.activeKey, 2122 "active-item": activeItem.value, 2123 "aria-label": __props.ariaLabel, 2124 "pin-able": __props.pinAble, 2125 "pinned-item-keys": pinnedItemKeysSet.value, 2126 onItemClick: handleItemClick, 2127 onItemKeyboard: handleItemKeydown, 2128 onItemPin: handleItemPinWithHoverClose, 2129 onItemHover: showHoverPopup, 2130 onItemHoverLeave: _cache[2] || (_cache[2] = (evt) => onPopupMouseleave(0, evt == null ? void 0 : evt.originalEvent)), 2131 onItemExpandedChange: _cache[3] || (_cache[3] = ($event) => emit("item-expanded-change", $event)) 2132 }, null, 8, ["menu-id", "items", "active-key", "active-item", "aria-label", "pin-able", "pinned-item-keys"]) 2133 ], 8, _hoisted_2$1) 2134 ]), 2135 _: 1 2136 }, 512), 2137 _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_3$1, [ 2138 renderSlot(_ctx.$slots, "footer") 2139 ])) : createCommentVNode("", true) 2140 ]), 2141 _: 3 2142 }, 8, ["loading"]), 2143 (openBlock(), createBlock(Teleport, { to: "body" }, [ 2144 (openBlock(true), createElementBlock(Fragment, null, renderList(hoverStack.value, (stackItem, index) => { 2145 return openBlock(), createBlock(Transition, { 2146 key: index, 2147 name: "side-menu-v3-hover-popup" 2148 }, { 2149 default: withCtx(() => { 2150 var _a2; 2151 return [ 2152 stackItem ? (openBlock(), createElementBlock("div", { 2153 key: 0, 2154 ref_for: true, 2155 ref: (el) => { 2156 if (el) hoverPopupEls[index] = el; 2157 else delete hoverPopupEls[index]; 2158 }, 2159 class: "side-menu-v3__hover-popup", 2160 style: normalizeStyle(stackItem.style), 2161 role: "group", 2162 "aria-label": ((_a2 = stackItem.processedItem.item) == null ? void 0 : _a2.label) || "Submenu", 2163 onMouseenter: ($event) => onPopupMouseenter(index), 2164 onMouseleave: (evt) => onPopupMouseleave(index, evt) 2165 }, [ 2166 createVNode(unref(ZmScrollbar), { 2167 class: "side-menu-v3__hover-popup-scrollbar", 2168 "wrap-class": "side-menu-v3__hover-popup-scrollbar-wrap", 2169 always: "" 2170 }, { 2171 default: withCtx(() => [ 2172 createVNode(_sfc_main$c, { 2173 "menu-id": `${unref(menuId)}-hover-${index}`, 2174 class: "side-menu-v3__list side-menu-v3__hover-popup-list", 2175 items: stackItem.processedItem.items, 2176 level: 0, 2177 "active-key": __props.activeKey, 2178 "active-item": activeItem.value, 2179 templates: _ctx.$slots, 2180 "has-sub-item": false, 2181 "pin-able": __props.pinAble, 2182 "pinned-item-keys": pinnedItemKeysSet.value, 2183 "hover-all-groups": true, 2184 "is-in-hover-popup": true, 2185 onItemClick: handleHoverPopupItemClick, 2186 onItemPin: unref(handleItemPin), 2187 onItemHover: (evt) => handlePopupItemHover(index, evt), 2188 onItemHoverLeave: (evt) => onPopupItemHoverLeave(index, evt == null ? void 0 : evt.originalEvent), 2189 onItemExpandedChange: _cache[4] || (_cache[4] = ($event) => emit("item-expanded-change", $event)) 2190 }, null, 8, ["menu-id", "items", "active-key", "active-item", "templates", "pin-able", "pinned-item-keys", "onItemPin", "onItemHover", "onItemHoverLeave"]) 2191 ]), 2192 _: 2 2193 }, 1024) 2194 ], 44, _hoisted_4)) : createCommentVNode("", true) 2195 ]; 2196 }), 2197 _: 2 2198 }, 1024); 2199 }), 128)) 2200 ])), 2201 createVNode(unref(ZmContextMenuHolder)) 2202 ], 34); 2203 }; 2204 } 2205}); 2206const MOBILE_MQ = "(max-width: 1024px)"; 2207function useMobileResponsive() { 2208 const isMobile = ref(false); 2209 let mql = null; 2210 const sync = () => { 2211 isMobile.value = !!(mql == null ? void 0 : mql.matches); 2212 }; 2213 onMounted(() => { 2214 if (typeof window === "undefined") return; 2215 mql = window.matchMedia(MOBILE_MQ); 2216 sync(); 2217 mql.addEventListener("change", sync); 2218 }); 2219 onBeforeUnmount(() => { 2220 mql == null ? void 0 : mql.removeEventListener("change", sync); 2221 }); 2222 provide("isMobile", isMobile); 2223 return { isMobile }; 2224} 2225function getMenuItemByProps(array, targetValue, propName, parent = null) { 2226 if (targetValue === void 0 || propName === void 0 || propName === "") { 2227 return null; 2228 } 2229 if (!Array.isArray(array)) { 2230 return null; 2231 } 2232 for (const item of array) { 2233 const isMatch = propName === "url" && item[propName] ? item[propName].includes(targetValue) : item[propName] === targetValue; 2234 if (isMatch) { 2235 return { item, parent }; 2236 } 2237 if (Array.isArray(item.items)) { 2238 const found = getMenuItemByProps(item.items, targetValue, propName, item); 2239 if (found) return found; 2240 } 2241 } 2242 return null; 2243} 2244function initializeSideMenuData(rawMenus, suffixCommand) { 2245 const processMenuItem = (item) => { 2246 if (!item) return item; 2247 const processedItem = __spreadProps(__spreadValues({}, item), { 2248 key: item.key || item.id 2249 }); 2250 if (Array.isArray(item.items) && item.items.length > 0) {
2251 processedItem.items = item.items.filter(Boolean).map(processMenuItem); 2252 } else if (item.dynamicSubMenu) { 2253 processedItem.items = []; 2254 } 2255 return processedItem; 2256 }; 2257 if (!Array.isArray(rawMenus)) { 2258 console.warn("[InitializeMenuData] Expected array but received:", typeof rawMenus); 2259 return []; 2260 } 2261 return rawMenus.filter(Boolean).map(processMenuItem); 2262} 2263const MENU_KEYS = { 2264 PBX: "pbx_column_container", 2265 CONTACT_CENTER: "contact_center_column_container", 2266 PHONE_NUMBER: "phone_number_management_column_container", 2267 AI_STUDIO_NEW: "new_ai_studio_column_container", 2268 AI_STUDIO: "ai_studio_column_container", 2269 MAIL_CALENDAR: "sidemenu-mail-calendar-management", 2270 DEVICE_MANAGEMENT: "device-management-menus", 2271 NODE_MANAGEMENT: "node-management-menus", 2272 PRODUCT_CONFIG: "configureProducts", 2273 CX_MANAGEMENT: "cxManagement" 2274}; 2275const KEEP_KEYS = [ 2276 MENU_KEYS.PBX, 2277 MENU_KEYS.PHONE_NUMBER, 2278 MENU_KEYS.CONTACT_CENTER, 2279 MENU_KEYS.AI_STUDIO_NEW, 2280 MENU_KEYS.AI_STUDIO 2281]; 2282const PATH_PATTERNS = { 2283 PBX_PAGE: "/pbx/page/telephone/", 2284 DEVICE: "/device", 2285 NODE: "/node", 2286 MAIL_CALENDAR: "/account/mailcal/" 2287}; 2288const TOKEN_FILTER_PATTERNS = { 2289 ZCC: /^x([-])zm\1.+/i, 2290 DEFAULT: /^x([-_])zm\1.+/i 2291}; 2292const { sideMenuConfig } = window.microsDatas || {}; 2293const { pbxDomain, zccDomain, phoneNumberDomain, aiStudioDomain, zvaDomain } = sideMenuConfig || {}; 2294const PBX = { 2295 tokenUrl: "/pbx/web/getToken", 2296 menuAPI: `${pbxDomain}/api/v2/pbx/web/menu`, 2297 key: "pbx_column_container", 2298 menuPrefix: "pbx" 2299}; 2300const ZCC = { 2301 tokenUrl: "/cci/web/getToken/web", 2302 menuAPI: `${zccDomain}/v1/zoom/web/menu`, 2303 key: "contact_center_column_container", 2304 menuPrefix: "zcc" 2305}; 2306const ZCP = { 2307 tokenUrl: "/cp/web/getToken", 2308 menuAPI: `${phoneNumberDomain}/cp/webapi/menu`, 2309 key: "phone_number_management_column_container", 2310 menuPrefix: "zcp" 2311}; 2312const AIStudioNew = { 2313 tokenUrl: "/ai-studio/web/getToken", 2314 menuAPI: `${zvaDomain}/v1/zoom/ai/studio/menu`, 2315 key: "new_ai_studio_column_container" 2316}; 2317const AIStudio = { 2318 tokenUrl: "/nws/common/2.0/nak?pms=AIStudioNws&pms=AIStudioManagement", 2319 menuAPI: `${aiStudioDomain}/api/v3/caic/zoom/web/menu`, 2320 key: "ai_studio_column_container" 2321}; 2322const ZVA = { 2323 tokenUrl: "/zva/web/getToken", 2324 menuAPI: `${zvaDomain}/v1/zoom/web/menu`, 2325 key: "zva_column_container", 2326 menuPrefix: "zva" 2327}; 2328const MailCalendar = { 2329 key: "sidemenu-mail-calendar-management", 2330 menuPrefix: "mail-calendar" 2331}; 2332function safeJsonParse$1(value, fallback) { 2333 if (typeof value !== "string") return fallback; 2334 try { 2335 return JSON.parse(value); 2336 } catch (e) { 2337 return fallback; 2338 } 2339} 2340function fetchToken(tokenUrl) { 2341 return __async(this, null, function* () { 2342 try { 2343 return yield post(tokenUrl, true)(); 2344 } catch (error) { 2345 console.error("[MenuLoader] Failed to fetch token:", error); 2346 throw error; 2347 } 2348 }); 2349} 2350function fetchMenuWithToken(token, menuAPI, config) { 2351 return __async(this, null, function* () { 2352 const { access_token } = token; 2353 const options = { 2354 Authorization: "Bearer " + access_token, 2355 lang: locale.replace("-", "_") 2356 }; 2357 Object.keys(token).forEach((key) => { 2358 const filterPattern = config.key === MENU_KEYS.CONTACT_CENTER ? TOKEN_FILTER_PATTERNS.ZCC : TOKEN_FILTER_PATTERNS.DEFAULT; 2359 if (filterPattern.test(key)) { 2360 options[key] = token[key]; 2361 } 2362 }); 2363 const menus = yield get(menuAPI, options, true)(); 2364 const fixedMenus = Array.isArray(menus) ? menus : Array.isArray(menus.result) ? menus.result : []; 2365 return fixedMenus.map((menuItem) => { 2366 const { text, key, jsonText, beta, badge, isNew } = menuItem; 2367 const { href } = safeJsonParse$1(jsonText, {}); 2368 const menuData = { 2369 label: text, 2370 url: href, 2371 key 2372 }; 2373 if (beta) { 2374 menuData.badge = { 2375 type: "custom", 2376 text: "BETA", 2377 color: "purple" 2378 }; 2379 } 2380 if (isNew) { 2381 menuData.badge = { 2382 type: "custom", 2383 text: "New", 2384 color: "blue" 2385 }; 2386 } 2387 if (badge) { 2388 menuData.badge = badge; 2389 } 2390 return menuData; 2391 }); 2392 }); 2393} 2394function useLoadMenu() { 2395 return __async(this, arguments, function* (config = {}, forceLoad = false) { 2396 var _a2; 2397 const userid = ((_a2 = window.microsDatas) == null ? void 0 : _a2.userId) || "$sideMenu"; 2398 const prefix2 = userid.substring(0, 6); 2399 const { key, tokenUrl, menuAPI } = config; 2400 if (!forceLoad) { 2401 const menuFromSession = getSessionStorage(`${prefix2}-${key}`); 2402 if (menuFromSession) { 2403 const { locale: cachedLocale, menus } = safeJsonParse$1(menuFromSession, {}); 2404 if (cachedLocale === locale) { 2405 return { 2406 menus: Array.isArray(menus) ? menus : [], 2407 /** Session cache only — no token/menu API round trip; keep registry non-`loaded` upstream */ 2408 fetchedFromNetwork: false 2409 }; 2410 } 2411 } 2412 } 2413 try { 2414 const token = yield fetchToken(tokenUrl); 2415 const menus = yield fetchMenuWithToken(token, menuAPI, config); 2416 if (menus.length) { 2417 setSessionStorage(`${prefix2}-${key}`, JSON.stringify({ locale, menus })); 2418 } 2419 return { menus, fetchedFromNetwork: true }; 2420 } catch (error) { 2421 console.error("[MenuLoader] Failed to load menu:", error); 2422 return { menus: [], fetchedFromNetwork: true, error }; 2423 } 2424 }); 2425} 2426function safeJsonParse(value, fallback) { 2427 if (typeof value !== "string") return fallback; 2428 try { 2429 return JSON.parse(value); 2430 } catch (e) { 2431 return fallback; 2432 } 2433} 2434function fetchConfigData(accessToken) { 2435 return __async(this, null, function* () { 2436 var _a2; 2437 const defaultResponse = { 2438 configs: { 2439 asyncWebportal: { 2440 menus: [ 2441 { 2442 id: "domain", 2443 path: "/domain", 2444 enabled: true, 2445 visiblePermissions: ["mailAndCalendarManagement"], 2446 translationKey: "sidemenu.manage.domain_management", 2447 fallbackTranslation: "Domain Management" 2448 }, 2449 { 2450 id: "mailbox", 2451 path: "/mailbox", 2452 enabled: true, 2453 visiblePermissions: ["mailAndCalendarManagement"], 2454 translationKey: "sidemenu.manage.mailbox_management", 2455 fallbackTranslation: "Mailbox Management" 2456 }, 2457 { 2458 id: "mailinglist", 2459 path: "/mailinglist", 2460 enabled: true, 2461 visiblePermissions: ["mailAndCalendarManagement"], 2462 translationKey: "sidemenu.manage.mailinglist_management", 2463 fallbackTranslation: "Mailing List Management" 2464 }, 2465 { 2466 id: "security", 2467 path: "/security", 2468 enabled: true, 2469 visiblePermissions: ["mailAndCalendarManagement"], 2470 translationKey: "sidemenu.manage.security_management", 2471 fallbackTranslation: "Security Management" 2472 }, 2473 { 2474 id: "legal", 2475 path: "/legal", 2476 enabled: true, 2477 visiblePermissions: ["allLegalCases", "myLegalCases"], 2478 translationKey: "sidemenu.manage.legal_management", 2479 fallbackTranslation: "Legal Management" 2480 } 2481 ] 2482 } 2483 }, 2484 permissions: { 2485 allLegalCases: true, 2486 escrow: false, 2487 mailAndCalendarManagement: true, 2488 myLegalCases: true 2489 } 2490 }; 2491 try { 2492 const response = yield get( 2493 `https://${window.MailcalEmailDomain}/zgroup/v1/configs?configName=asyncWebportal`, 2494 { 2495 Authorization: "Bearer " + accessToken 2496 }, 2497 true 2498 )(); 2499 return ((_a2 = response == null ? void 0 : response.configs) == null ? void 0 : _a2.asyncWebportal) ? response : defaultResponse; 2500 } catch (e) { 2501 return defaultResponse; 2502 } 2503 }); 2504} 2505function processMenus(response) { 2506 const pathPrefix = "/account/mailcal"; 2507 const translations = window.MailcalTranslations || {}; 2508 const processedMenus = []; 2509 const stack = [...response.configs.asyncWebportal.menus].reverse(); 2510 while (stack.length) { 2511 const item = stack.pop(); 2512 if (!item.enabled) { 2513 continue; 2514 } 2515 if (item.children && item.children.length) { 2516 stack.push(...item.children.reverse()); 2517 continue; 2518 } 2519 if (!hasPermission(item.visiblePermissions, response.permissions)) { 2520 continue; 2521 } 2522 const menuItem = { 2523 id: item.id, 2524 url: pathPrefix + item.path.replace(/\/+$/, ""), 2525 key: `menu-mail-calendar-${item.id}`, 2526 label: translations[item.translationKey] || item.fallbackTranslation, 2527 originalItem: item 2528 }; 2529 processedMenus.push(menuItem); 2530 } 2531 return processedMenus; 2532} 2533function hasPermission(visiblePermissions, userPermissions = {}) { 2534 if (!visiblePermissions) return true; 2535 if (visiblePermissions.includes("*")) return true; 2536 return visiblePermissions.some((permission) => userPermissions[permission]); 2537}
2538function useMailCalendar() { 2539 function getMenuData() { 2540 return __async(this, arguments, function* (_config = {}, forceLoad) { 2541 var _a2; 2542 const userid = ((_a2 = window.microsDatas) == null ? void 0 : _a2.userId) || "$sideMenu"; 2543 const prefix2 = userid.substring(0, 6); 2544 if (!forceLoad) { 2545 const menuFromSession = getSessionStorage(`${prefix2}-mail-calendar`); 2546 if (menuFromSession) { 2547 return { 2548 menus: safeJsonParse(menuFromSession, []), 2549 fetchedFromNetwork: false 2550 }; 2551 } 2552 } 2553 const response = yield window.mailAndCalendarManagement.initPromise; 2554 const configData = yield fetchConfigData(response.accessToken); 2555 const processedMenus = processMenus(configData); 2556 setSessionStorage(`${prefix2}-mail-calendar`, JSON.stringify(processedMenus)); 2557 return { menus: processedMenus, fetchedFromNetwork: true }; 2558 }); 2559 } 2560 return { 2561 getMenuData 2562 }; 2563} 2564function getMenuByKeyOrId(menuData, key) { 2565 var _a2; 2566 if (!key || !Array.isArray(menuData)) { 2567 return null; 2568 } 2569 return (_a2 = menuData.find((item) => item.key === key || item.id === key)) != null ? _a2 : null; 2570} 2571function deepCloneMenu(menu) { 2572 if (!menu) return menu; 2573 const cloned = __spreadValues({}, menu); 2574 if (Array.isArray(menu.items)) { 2575 cloned.items = menu.items.map(deepCloneMenu); 2576 } 2577 return cloned; 2578} 2579function filterRenderableMenus(menus = [], keepKeys = []) { 2580 return menus.filter((menu) => !(menu == null ? void 0 : menu.items) || menu.items.length || keepKeys.includes(menu == null ? void 0 : menu.key)); 2581} 2582function enhanceDeviceMenu(deviceMenu, activeKey) { 2583 if (!(deviceMenu == null ? void 0 : deviceMenu.items) || !Array.isArray(deviceMenu.items)) return; 2584 const allowedRoutes = ["/device/order"]; 2585 const isAllowedRoute = allowedRoutes.some((route) => location.pathname.startsWith(route)); 2586 if (!isAllowedRoute) return; 2587 deviceMenu.items.forEach((menu) => { 2588 menu.command = ({ originalEvent, item }) => { 2589 var _a2; 2590 if (window.Vue && ((_a2 = Vue == null ? void 0 : Vue.__config__) == null ? void 0 : _a2.router) && window.location.pathname.startsWith(PATH_PATTERNS.DEVICE)) { 2591 originalEvent.preventDefault(); 2592 Vue.__config__.router.push({ 2593 path: menu.url 2594 }); 2595 activeKey.value = item.key; 2596 return true; 2597 } 2598 return false; 2599 }; 2600 }); 2601} 2602function enhanceNodeMenu(nodeMenu, activeKey) { 2603 if (!(nodeMenu == null ? void 0 : nodeMenu.items) || !Array.isArray(nodeMenu.items)) return; 2604 nodeMenu.items.forEach((menu) => { 2605 menu.command = ({ originalEvent, item }) => { 2606 var _a2; 2607 if (window.Vue && ((_a2 = Vue == null ? void 0 : Vue.__config__) == null ? void 0 : _a2.router) && window.location.pathname.startsWith(PATH_PATTERNS.NODE)) { 2608 originalEvent.preventDefault(); 2609 Vue.__config__.router.push({ 2610 path: menu.url 2611 }); 2612 activeKey.value = item.key; 2613 return true; 2614 } 2615 return false; 2616 }; 2617 }); 2618} 2619function applyMenuIcons(menus, iconMaps2) { 2620 menus.forEach((menu) => { 2621 if (menu) { 2622 menu.icon = iconMaps2[menu.id]; 2623 if (menu.items) { 2624 applyMenuIcons(menu.items, iconMaps2); 2625 } 2626 } 2627 }); 2628} 2629function validateMenuKeys(menus) { 2630 const flatMenus = menus.flatMap((menu) =>
2630 menu ? menu.items : menu).filter(Boolean); 2631 const duplicatedKey = findDuplicateKeys(flatMenus.map((menu) => menu.key)); 2632 if (duplicatedKey.length) { 2633 duplicatedKey.forEach((key) => { 2634 console.error( 2635 `[MenuValidation] Duplicate menu key - "${key}" must be unique:`, 2636 flatMenus.filter((menu) => menu.key === key) 2637 ); 2638 }); 2639 } 2640} 2641function findDuplicateKeys(arr) { 2642 const seen = /* @__PURE__ */ new Set(); 2643 const duplicates = /* @__PURE__ */ new Set(); 2644 for (let item of arr) { 2645 if (seen.has(item)) { 2646 duplicates.add(item); 2647 } else { 2648 seen.add(item); 2649 } 2650 } 2651 return Array.from(duplicates); 2652} 2653function processMenuItems(menuItems = [], config, activeKey) { 2654 return menuItems.map((menuItem) => { 2655 var _a2, _b, _c, _d; 2656 if (config.key === MENU_KEYS.PBX) { 2657 const pathname = (_a2 = menuItem.url) == null ? void 0 : _a2.split("?p")[0]; 2658 const moduleName = pathname.split(PATH_PATTERNS.PBX_PAGE)[1]; 2659 menuItem.key = moduleName; 2660 } 2661 if (config.key === MENU_KEYS.PHONE_NUMBER && ((_b = menuItem.key) == null ? void 0 : _b.includes(" "))) { 2662 menuItem.key = (_c = menuItem.url) == null ? void 0 : _c.split("#/")[1]; 2663 } 2664 if ((config.key === MENU_KEYS.AI_STUDIO || config.key === MENU_KEYS.AI_STUDIO_NEW) && !menuItem.key) { 2665 const pathSegments = ((_d = menuItem.url) == null ? void 0 : _d.split("/").filter(Boolean)) || []; 2666 menuItem.key = pathSegments.join("-"); 2667 } 2668 if (!menuItem.id && menuItem.key) { 2669 menuItem.id = config.menuPrefix ? `${config.menuPrefix}-${menuItem.key}` : menuItem.key; 2670 } 2671 if (config.key === MENU_KEYS.MAIL_CALENDAR) { 2672 menuItem.command = createMailCalendarCommand(menuItem, activeKey); 2673 } else { 2674 menuItem.command = createDefaultCommand(menuItem, activeKey); 2675 } 2676 return menuItem; 2677 }); 2678} 2679function createMailCalendarCommand(menuItem, activeKey) { 2680 return ({ originalEvent, item }) => { 2681 if (window.location.pathname.startsWith(PATH_PATTERNS.MAIL_CALENDAR)) { 2682 originalEvent.preventDefault(); 2683 activeKey.value = item.key; 2684 window.history.pushState(null, "", menuItem.url); 2685 return true; 2686 } 2687 return false; 2688 }; 2689} 2690function createDefaultCommand(menuItem, activeKey) { 2691 return ({ item }) => { 2692 if (menuItem.target !== "_blank") { 2693 activeKey.value = item.key; 2694 } 2695 return false; 2696 }; 2697} 2698const _hoisted_1$9 = { 2699 width: "16", 2700 height: "16", 2701 viewBox: "0 0 16 16", 2702 fill: "none", 2703 xmlns: "http://www.w3.org/2000/svg" 2704}; 2705const _sfc_main$9 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, { 2706 name: "account-management" 2707}), { 2708 __name: "account-management", 2709 setup(__props) { 2710 return (_ctx, _cache) => { 2711 return openBlock(), createElementBlock("svg", _hoisted_1$9, [..._cache[0] || (_cache[0] = [ 2712 createStaticVNode('<g clip-path="url(#clip0_account_management)"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.4611 12.5189C15.1902 12.2199 15.1902 11.7801 15.4611 11.4813L15.8749 11.0241C15.9933 10.8936 16.0346 10.7146 15.9686 10.5549C15.808 10.166 15.585 9.80642 15.3105 9.4873C15.1966 9.35427 15.0112 9.29858 14.8322 9.32958L14.2072 9.43771C13.7969 9.50883 13.3922 9.28909 13.2526 8.91891L13.0406 8.35789C12.9791 8.19632 12.835 8.07322 12.655 8.04705C12.4412 8.01596 12.2227 8 12.0006 8C11.7767 8 11.5564 8.01622 11.3426 8.0475C11.1617 8.07394 11.0176 8.19705 10.957 8.35853L10.745 8.91891C10.6054 9.28909 10.2007 9.50883 9.79042 9.43771L9.1681 9.33003C8.98919 9.29903 8.80377 9.35491 8.68983 9.48794C8.41541 9.80761 8.19152 10.168 8.03084 10.5578C7.96568 10.7175 8.00699 10.8963 8.12441 11.0266L8.53654 11.4812C8.80727 11.78 8.80727 12.2198 8.53654 12.5188L8.12441 12.9732C8.00699 13.1035 7.96568 13.2824 8.03084 13.442C8.19142 13.832 8.41454 14.1922 8.68983 14.5119C8.80367 14.6451 8.98919 14.7009 9.1681 14.6698L9.79042 14.5621C10.2007 14.491 10.6054 14.7107 10.745 15.0809L10.957 15.6415C11.0176 15.803 11.1616 15.9261 11.3426 15.9523C11.5564 15.9838 11.7767 16 12.0006 16C12.2227 16 12.4412 15.9839 12.655 15.9529C12.8349 15.9268 12.9791 15.8037 13.0406 15.6421L13.2526 15.0809C13.3922 14.7107 13.7969 14.491 14.2072 14.5621L14.8322 14.6704C15.0112 14.7012 15.1966 14.6455 15.3105 14.5125C15.585 14.1935 15.808 13.8339 15.9686 13.4449C16.0346 13.2853 15.9933 13.1062 15.8749 12.976L15.4611 12.5189ZM12.0035 13.5137C11.1146 13.5137 10.3939 12.8361 10.3939 12.0001C10.3939 11.1642 11.1145 10.4866 12.0035 10.4866C12.8925 10.4866 13.6131 11.1642 13.6131 12.0001C13.6131 12.836 12.8926 13.5137 12.0035 13.5137Z"></path><path d="M7 1.44324C7.0001 0.745132 7.69787 0.26162 8.35156 0.506714L14.3516 1.75671L14.4912 1.82214C14.802 1.99733 14.9999 2.32868 15 2.69324V7.3905C14.6873 7.18657 14.3524 7.01451 14 6.87683V2.69324L8 1.44324V8.22644C7.59098 8.65986 7.25181 9.15947 7 9.70789V4.32507L2 5.75378V13.9999H6.87695C7.0147 14.3525 7.18754 14.687 7.3916 14.9999H0.5C0.223858 14.9999 0 14.776 0 14.4999C9.32068e-05 14.2238 0.223915 13.9999 0.5 13.9999H1V5.75378C1.00025 5.30754 1.29647 4.91545 1.72559 4.79285L7 3.28503V1.44324ZM5.5 10.9999V11.9999H3.5V10.9999H5.5ZM5.5 7.99988V8.99988H3.5V7.99988H5.5ZM12 4.99988V5.99988H10V4.99988H12Z"></path></g><defs><clipPath id="clip0_account_management"><rect width="16" height="16" fill="white"></rect></clipPath></defs>', 2) 2713 ])]); 2714 }; 2715 } 2716})); 2717const _hoisted_1$8 = { 2718 width: "16", 2719 height: "16", 2720 viewBox: "0 0 16 16", 2721 fill: "none", 2722 xmlns: "http://www.w3.org/2000/svg" 2723}; 2724const _sfc_main$8 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, { 2725 name: "content-management" 2726}), { 2727 __name: "content-management", 2728 setup(__props) { 2729 return (_ctx, _cache) => { 2730 return openBlock(), createElementBlock("svg", _hoisted_1$8, [..._cache[0] || (_cache[0] = [ 2731 createStaticVNode('<path d="M3 1H13C13.5523 1 14 1.44772 14 2V6.5C14 6.77614 14.2239 7 14.5 7C14.7761 7 15 6.77614 15 6.5V2C15 0.895431 14.1046 0 13 0H3C1.89543 0 1 0.895431 1 2V14C1 15.1046 1.89543 16 3 16H6.5C6.77614 16 7 15.7761 7 15.5C7 15.2239 6.77614 15 6.5 15H3C2.44772 15 2 14.5523 2 14V2C2 1.44772 2.44772 1 3 1Z"></path><path d="M4.5 3.5C4.22386 3.5 4 3.72386 4 4C4 4.27614 4.22386 4.5 4.5 4.5H11.5C11.7761 4.5 12 4.27614 12 4C12 3.72386 11.7761 3.5 11.5 3.5H4.5Z"></path><path d="M4 7C4 6.72386 4.22386 6.5 4.5 6.5H8.5C8.77614 6.5 9 6.72386 9 7C9 7.27614 8.77614 7.5 8.5 7.5H4.5C4.22386 7.5 4 7.27614 4 7Z"></path><path d="M4 10C4 9.72386 4.22386 9.5 4.5 9.5H6.5C6.77614 9.5 7 9.72386 7 10C7 10.2761 6.77614 10.5 6.5 10.5H4.5C4.22386 10.5 4 10.2761 4 10Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M15.4611 12.5189C15.1902 12.2199 15.1902 11.7801 15.4611 11.4813L15.8749 11.
27310241C15.9933 10.8936 16.0346 10.7146 15.9686 10.5549C15.808 10.166 15.585 9.80642 15.3105 9.4873C15.1966 9.35427 15.0112 9.29858 14.8322 9.32958L14.2072 9.43771C13.7969 9.50883 13.3922 9.28909 13.2526 8.91891L13.0406 8.35789C12.9791 8.19632 12.835 8.07322 12.655 8.04705C12.4412 8.01596 12.2227 8 12.0006 8C11.7767 8 11.5564 8.01622 11.3426 8.0475C11.1617 8.07394 11.0176 8.19705 10.957 8.35853L10.745 8.91891C10.6054 9.28909 10.2007 9.50883 9.79042 9.43771L9.1681 9.33003C8.98919 9.29903 8.80377 9.35491 8.68983 9.48794C8.41541 9.80761 8.19152 10.168 8.03084 10.5578C7.96568 10.7175 8.00699 10.8963 8.12441 11.0266L8.53654 11.4812C8.80727 11.78 8.80727 12.2198 8.53654 12.5188L8.12441 12.9732C8.00699 13.1035 7.96568 13.2824 8.03084 13.442C8.19142 13.832 8.41454 14.1922 8.68983 14.5119C8.80367 14.6451 8.98919 14.7009 9.1681 14.6698L9.79042 14.5621C10.2007 14.491 10.6054 14.7107 10.745 15.0809L10.957 15.6415C11.0176 15.803 11.1616 15.9261 11.3426 15.9523C11.5564 15.9838 11.7767 16 12.0006 16C12.2227 16 12.4412 15.9839 12.655 15.9529C12.8349 15.9268 12.9791 15.8037 13.0406 15.6421L13.2526 15.0809C13.3922 14.7107 13.7969 14.491 14.2072 14.5621L14.8322 14.6704C15.0112 14.7012 15.1966 14.6455 15.3105 14.5125C15.585 14.1935 15.808 13.8339 15.9686 13.4449C16.0346 13.2853 15.9933 13.1062 15.8749 12.976L15.4611 12.5189ZM12.0035 13.5137C11.1146 13.5137 10.3939 12.8361 10.3939 12.0001C10.3939 11.1642 11.1145 10.4866 12.0035 10.4866C12.8925 10.4866 13.6131 11.1642 13.6131 12.0001C13.6131 12.836 12.8926 13.5137 12.0035 13.5137Z"></path>', 5) 2732 ])]); 2733 }; 2734 } 2735})); 2736const _hoisted_1$7 = { 2737 width: "16", 2738 height: "16", 2739 viewBox: "0 0 16 16", 2740 fill: "none", 2741 xmlns: "http://www.w3.org/2000/svg" 2742}; 2743const _sfc_main$7 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, { 2744 name: "device-policy" 2745}), { 2746 __name: "device-policy", 2747 setup(__props) { 2748 return (_ctx, _cache) => { 2749 return openBlock(), createElementBlock("svg", _hoisted_1$7, [..._cache[0] || (_cache[0] = [ 2750 createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M0.217987 2.09202C0 2.51984 0 3.0799 0 4.2V7.8C0 8.9201 0 9.48016 0.217987 9.90798C0.409734 10.2843 0.715695 10.5903 1.09202 10.782C1.51984 11 2.0799 11 3.2 11H6V13H2.5C2.22386 13 2 13.2239 2 13.5C2 13.7761 2.22386 14 2.5 14H9.5C9.77614 14 10 13.7761 10 13.5C10 13.2239 9.77614 13 9.5 13H7V11H9.8C10.9201 11 11.4802 11 11.908 10.782C12.2843 10.5903 12.5903 10.2843 12.782 9.90798C13 9.48016 13 8.9201 13 7.8V4.2C13 3.0799 13 2.51984 12.782 2.09202C12.5903 1.71569 12.2843 1.40973 11.908 1.21799C11.4802 1 10.9201 1 9.8 1H3.2C2.0799 1 1.51984 1 1.09202 1.21799C0.715695 1.40973 0.409734 1.71569 0.217987 2.09202ZM9.8 2H3.2C2.62345 2 2.25117 2.00078 1.96784 2.02393C1.69617 2.04612 1.59545 2.0838 1.54601 2.10899C1.35785 2.20487 1.20487 2.35785 1.10899 2.54601C1.0838 2.59545 1.04612 2.69617 1.02393 2.96784C1.00078 3.25117 1 3.62345 1 4.2V7.8C1 8.37655 1.00078 8.74883 1.02393 9.03216C1.04612 9.30383 1.0838 9.40455 1.10899 9.45399C1.20487 9.64215 1.35785 9.79513 1.54601 9.89101C1.59545 9.9162 1.69617 9.95388 1.96784 9.97607C2.25117 9.99922 2.62345 10 3.2 10H9.8C10.3766 10 10.7488 9.99922 11.0322 9.97607C11.3038 9.95388 11.4045 9.9162 11.454 9.89101C11.6422 9.79513 11.7951 9.64215 11.891 9.45399C11.9162 9.40455 11.9539 9.30383 11.9761 9.03216C11.9992 8.74883 12 8.37655 12 7.8V4.2C12 3.62345 11.9992 3.25117 11.9761 2.96784C11.9539 2.69617 11.9162 2.59545 11.891 2.54601C11.7951 2.35785 11.6422 2.20487 11.454 2.10899C11.4045 2.0838 11.3038 2.04612 11.0322 2.02393C10.7488 2.00078 10.3766 2 9.8 2Z"></path><rect x="8.5" y="5.5" width="7" height="10" rx="0.5" fill="white" stroke="black"></rect><rect x="10" y="8" width="4" height="1" rx="0.5"></rect><rect x="10" y="10" width="4" height="1" rx="0.5"></rect><rect x="10" y="12" width="3" height="1" rx="0.5"></rect>', 5) 2751 ])]); 2752 }; 2753 } 2754})); 2755const _hoisted_1$6 = { 2756 width: "16", 2757 height: "16", 2758 viewBox: "0 0 16 16", 2759 fill: "none", 2760 xmlns: "http://www.w3.org/2000/svg" 2761}; 2762const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, { 2763 name: "frontline-icon" 2764}), { 2765 __name: "frontline-icon", 2766 setup(__props) { 2767 return (_ctx, _cache) => { 2768 return openBlock(), createElementBlock("svg", _hoisted_1$6, [..._cache[0] || (_cache[0] = [ 2769 createStaticVNode('<path d="M10.5969 5.32088L6.8289 3.64561C6.73065 3.60194 6.6256 3.58017 6.52066 3.58014C6.4036 3.5799 6.28664 3.6067 6.17938 3.66033C5.80417 3.84794 5.65208 4.30419 5.83969 4.6794L5.93019 4.8604C5.97643 4.95288 6.03727 5.03729 6.11038 5.1104L8.20711 7.20713C8.39464 7.39466 8.5 7.64902 8.5 7.91423V10C8.5 11.1046 7.60457 12 6.5 12H3.5L4.00398 12.756C4.3196 13.2294 4.82195 13.546 5.38523 13.6265L7.1799 13.8829C7.705 13.9579 8.2384 13.8212 8.66274 13.503L9.88629 12.5853C9.962 12.5285 10.0336 12.4664 10.1005 12.3995L11.626 10.8741C12.1616 10.3384 12.3487 9.54605 12.1091 8.82738L11.1395 5.91847C11.0506 5.65189 10.8537 5.435 10.5969 5.32088Z"></path><path d="M10.0982 1.50968C9.82737 1.45553 9.56396 1.63114 9.50981 1.90192C9.45565 2.1727 9.63126 2.43611 9.90204 2.49026C11.218 2.75345 12.2466 3.78208 12.5098 5.09803C12.564 5.36881 12.8274 5.54442 13.0982 5.49026C13.3689 5.43611 13.5445 5.1727 13.4904 4.90192C13.148 3.19011 11.81 1.85205 10.0982 1.50968Z"></path>
2769<path d="M11.5258 0.8419C11.6131 0.579928 11.8963 0.438348 12.1582 0.525672C13.2518 0.890197 14.11 1.74833 14.4745 2.8419C14.5618 3.10387 14.4202 3.38703 14.1582 3.47436C13.8963 3.56168 13.6131 3.4201 13.5258 3.15813C13.2608 2.36316 12.637 1.73934 11.842 1.47436C11.5801 1.38703 11.4385 1.10387 11.5258 0.8419Z"></path><path d="M12.8213 11.1768C12.9189 11.0792 13.0772 11.0793 13.1748 11.1768L13.8213 11.8232C13.9189 11.9209 13.9189 12.0791 13.8213 12.1768L12.0488 13.9502C12.0154 13.9836 11.9792 14.0146 11.9414 14.043L11.9355 14.0469L11.9307 14.0508L10.1689 15.4512C10.0712 15.5226 9.93704 15.514 9.84961 15.4307L9.22266 14.7246L9.21289 14.7139L9.20215 14.7041L9.16699 14.6602C9.09939 14.5529 9.12243 14.407 9.22852 14.3271L10.9414 13.043C10.9792 13.0146 11.0154 12.9836 11.0488 12.9502L12.8213 11.1768Z" stroke="black"></path><path d="M6.66699 0C7.40322 0.000161078 8 0.547741 8 1.22266V2.5L7 2V1.22266C7 1.19097 6.98784 1.14445 6.93359 1.09473C6.87792 1.04383 6.7862 1.00008 6.66699 1H1.33301C1.2138 1.00008 1.12208 1.04383 1.06641 1.09473C1.01216 1.14445 1 1.19097 1 1.22266V9.77734C1 9.80903 1.01216 9.85555 1.06641 9.90527C1.12208 9.95617 1.2138 9.99992 1.33301 10H5.50195C5.50727 9.99962 5.55623 9.99507 5.63867 9.96582C5.721 9.93658 5.80581 9.89376 5.87695 9.84277C5.95829 9.78443 5.98937 9.74273 6 9.72461V7.75L7 8.625V9.75C7 10.5 6.05708 10.9965 5.50781 11H1.33301C0.596778 10.9998 0 10.4523 0 9.77734V1.22266C0 0.547741 0.596778 0.000161314 1.33301 0H6.66699Z"></path><circle cx="4" cy="2" r="0.5"></circle>', 6) 2770 ])]); 2771 }; 2772 } 2773})); 2774const _hoisted_1$5 = { 2775 width: "16", 2776 height: "16", 2777 viewBox: "0 0 16 16", 2778 fill: "none", 2779 xmlns: "http://www.w3.org/2000/svg" 2780}; 2781const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, { 2782 name: "phone-integration" 2783}), { 2784 __name: "phone-integration", 2785 setup(__props) { 2786 return (_ctx, _cache) => { 2787 return openBlock(), createElementBlock("svg", _hoisted_1$5, [..._cache[0] || (_cache[0] = [ 2788 createBaseVNode("path", { d: "M14.5 0C15.3285 0 16 0.6713 16 1.5C16 2.3281 15.3285 3 14.5 3C13.848 3 13.2986 2.58127 13.0918 2H9C8.72466 2.00007 8.5 2.22414 8.5 2.5V4H12C13.1045 4 14 4.8955 14 6V10C14 11.1045 13.1045 12 12 12H8.5V13.5C8.5 14.3271 7.8271 15 7 15H2.9082C2.70149 15.5811 2.15209 16 1.5 16C0.671756 15.9999 0 15.3281 0 14.5C0 13.6714 0.671656 13.0001 1.5 13C2.15209 13 2.70149 13.4185 2.9082 14H7C7.2754 14 7.5 13.7754 7.5 13.5V12H4C2.8954 12 2 11.1045 2 10V6C2 4.8955 2.8954 4 4 4H7.5V2.5C7.5 1.67294 8.17276 1.00007 9 1H13.0918C13.2985 0.419 13.8479 0 14.5 0ZM1.5 14C1.22396 14.0001 1 14.2236 1 14.5C1 14.7759 1.22396 14.9999 1.5 15C1.77575 15 1.99935 14.7767 2 14.501V14.499C1.9996 14.2236 1.7759 14 1.5 14ZM4 5C3.44871 5.00013 3 5.44878 3 6V10C3 10.5512 3.44871 10.9999 4 11H12C12.5514 11 13 10.5513 13 10V6C13 5.4487 12.5514 5 12 5H4ZM14.5 1C14.2241 1 14.0004 1.22312 14 1.49902V1.50098C14.0006 1.77667 14.2243 2 14.5 2C14.7763 2 15 1.7758 15 1.5C15 1.2236 14.7762 1 14.5 1Z" }, null, -1), 2789 createBaseVNode("path", { d: "M9.31253 8.32812H9.05615C8.94015 8.32812 8.8289 8.3742 8.74688 8.45625L8.51735 8.6858C8.47112 8.73203 8.40095 8.74845 8.34055 8.72338C7.85988 8.5239 7.4761 8.1401 7.27665 7.65945C7.2516 7.59908 7.268 7.5289 7.31422 7.48268L7.54375 7.25313C7.6258 7.17108 7.67188 7.0598 7.67188 6.94375V6.6875C7.67188 6.44588 7.476 6.25 7.23438 6.25H6.90625C6.54383 6.25 6.25 6.5438 6.25 6.90625C6.25 8.47517 7.52055 9.74733 9.08885 9.74998C9.45233 9.7506 9.75003 9.4572 9.75003 9.09375V8.76562C9.75003 8.524 9.55413 8.32812 9.31253 8.32812Z" }, null, -1) 2790 ])]); 2791 }; 2792 } 2793})); 2794const _hoisted_1$4 = { 2795 width: "16", 2796 height: "16", 2797 viewBox: "0 0 16 16", 2798 fill: "none", 2799 xmlns: "http://www.w3.org/2000/svg" 2800}; 2801const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, { 2802 name: "skype-icon" 2803}), { 2804 __name: "skype-icon", 2805 setup(__props) { 2806 return (_ctx, _cache) => { 2807 return openBlock(), createElementBlock("svg", _hoisted_1$4, [..._cache[0] || (_cache[0] = [ 2808 createBaseVNode("path", { d: "M9.11059 7.39511L7.73364 7.06714C7.21028 6.9383 6.60748 6.7693 6.60
2808748 6.23886C6.60748 5.70843 7.02959 5.33696 7.79283 5.33696C9.33022 5.33696 9.19003 6.47145 9.95327 6.47145C10.3551 6.47145 10.7072 6.21711 10.7072 5.78205C10.7072 4.76469 9.19003 4 7.90343 4C6.50623 4 5.01869 4.63752 5.01869 6.33424C5.01869 7.1508 5.28972 8.02092 6.78816 8.42418L8.64798 8.92282C9.21028 9.07174 9.35203 9.41142 9.35203 9.71931C9.35203 10.2297 8.88006 10.7283 8.02492 10.7283C6.35514 10.7283 6.58723 9.34784 5.69315 9.34784C5.29128 9.34784 5 9.64568 5 10.069C5 10.8956 5.93458 12 8.02492 12C10.014 12 11 10.9709 11 9.59046C11 8.70195 10.6184 7.75654 9.11059 7.39511Z" }, null, -1), 2809 createBaseVNode("defs", null, [ 2810 createBaseVNode("mask", { 2811 id: "mask-skype", 2812 fill: "white" 2813 }, [ 2814 createBaseVNode("path", { d: "M4 0C5.13513 0 6.15867 0.473943 6.88672 1.2334C7.24909 1.17423 7.6209 1.14258 8 1.14258C11.7871 1.14258 14.8574 4.2129 14.8574 8C14.8574 8.37882 14.8247 8.75019 14.7656 9.1123C15.5257 9.84041 16 10.8644 16 12C16 14.2091 14.2091 16 12 16C10.8644 16 9.84041 15.5257 9.1123 14.7656C8.75019 14.8247 8.37882 14.8574 8 14.8574C4.2129 14.8574 1.14258 11.7871 1.14258 8C1.14258 7.6209 1.17423 7.24909 1.2334 6.88672C0.473943 6.15867 0 5.13513 0 4C0 1.79086 1.79086 0 4 0Z" }) 2815 ]) 2816 ], -1), 2817 createBaseVNode("path", { 2818 mask: "url(#mask-skype)", 2819 d: "M6.88672 1.2334L6.16484 1.92542L6.5288 2.30508L7.04786 2.22033L6.88672 1.2334ZM8 1.14258V0.142578V1.14258ZM14.8574 8H15.8574V8H14.8574ZM14.7656 9.1123L13.7787 8.95128L13.694 9.47049L14.0739 9.83442L14.7656 9.1123ZM9.1123 14.7656L9.83442 14.0739L9.47049 13.694L8.95128 13.7787L9.1123 14.7656ZM8 14.8574V15.8574V15.8574V14.85
281974ZM1.14258 8H0.142578V8H1.14258ZM1.2334 6.88672L2.22033 7.04786L2.30508 6.5288L1.92542 6.16484L1.2334 6.88672ZM4 0V1C4.8505 1 5.61686 1.3538 6.16484 1.92542L6.88672 1.2334L7.60859 0.541376C6.70048 -0.405915 5.41977 -1 4 -1V0ZM6.88672 1.2334L7.04786 2.22033C7.35876 2.16957 7.67668 2.14258 8 2.14258V1.14258V0.142578C7.56512 0.142578 7.13941 0.178897 6.72557 0.246468L6.88672 1.2334ZM8 1.14258V2.14258C11.2348 2.14258 13.8574 4.76519 13.8574 8H14.8574H15.8574C15.8574 3.66062 12.3394 0.142578 8 0.142578V1.14258ZM14.8574 8H13.8574C13.8574 8.32112 13.8297 8.63855 13.7787 8.95128L14.7656 9.1123L15.7526 9.27333C15.8197 8.86182 15.8574 8.43652 15.8574 8H14.8574ZM14.7656 9.1123L14.0739 9.83442C14.6459 10.3824 15 11.1491 15 12H16H17C17 10.5796 16.4054 9.29839 15.4574 8.39019L14.7656 9.1123ZM16 12H15C15 13.6569 13.6569 15 12 15V16V17C14.7614 17 17 14.7614 17 12H16ZM12 16V15C11.1491 15 10.3824 14.6459 9.83442 14.0739L9.1123 14.7656L8.39019 15.4574C9.29839 16.4054 10.5796 17 12 17V16ZM9.1123 14.7656L8.95128 13.7787C8.63855 13.8297 8.32112 13.8574 8 13.8574V14.8574V15.8574C8.43652 15.8574 8.86182 15.8197 9.27333 15.7526L9.1123 14.7656ZM8 14.8574V13.8574C4.76519 13.8574 2.14258 11.2348 2.14258 8H1.14258H0.142578C0.142578 12.3394 3.66062 15.8574 8 15.8574V14.85
281974ZM1.14258 8H2.14258C2.14258 7.67668 2.16957 7.35876 2.22033 7.04786L1.2334 6.88672L0.246468 6.72557C0.178897 7.13941 0.142578 7.56512 0.142578 8H1.14258ZM1.2334 6.88672L1.92542 6.16484C1.3538 5.61686 1 4.8505 1 4H0H-1C-1 5.41977 -0.405915 6.70048 0.541376 7.60859L1.2334 6.88672ZM0 4H1C1 2.34315 2.34315 1 4 1V0V-1C1.23858 -1 -1 1.23858 -1 4H0Z" 2820 }, null, -1) 2821 ])]); 2822 }; 2823 } 2824})); 2825const _hoisted_1$3 = { 2826 width: "16", 2827 height: "16", 2828 viewBox: "0 0 16 16", 2829 fill: "none", 2830 xmlns: "http://www.w3.org/2000/svg" 2831}; 2832const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, { 2833 name: "sub-account-management" 2834}), { 2835 __name: "sub-account-management", 2836 setup(__props) { 2837 return (_ctx, _cache) => { 2838 return openBlock(), createElementBlock("svg", _hoisted_1$3, [..._cache[0] || (_cache[0] = [ 2839 createBaseVNode("path", { 2840 "fill-rule": "evenodd", 2841 "clip-rule": "evenodd", 2842 d: "M15.4611 12.5189C15.1902 12.2199 15.1902 11.7801 15.4611 11.4813L15.8749 11.0241C15.9933 10.8936 16.0346 10.7146 15.9686 10.5549C15.808 10.166 15.585 9.80642 15.3105 9.4873C15.1966 9.35427 15.0112 9.29858 14.8322 9.32958L14.2072 9.43771C13.7969 9.50883 13.3922 9.28909 13.2526 8.91891L13.0406 8.35789C12.9791 8.19632 12.835 8.07322 12.655 8.04705C12.4412 8.01596 12.2227 8 12.0006 8C11.7767 8 11.5564 8.01622 11.3426 8.0475C11.1617 8.07394 11.0176 8.19705 10.957 8.35853L10.745 8.91891C10.6054 9.28909 10.2007 9.50883 9.79042 9.43771L9.1681 9.33003C8.98919 9.29903 8.80377 9.35491 8.68983 9.48794C8.41541 9.80761 8.19152 10.168 8.03084 10.5578C7.96568 10.7175 8.00699 10.8963 8.12441 11.0266L8.53654 11.4812C8.80727 11.78 8.80727 12.2198 8.53654 12.5188L8.12441 12.9732C8.00699 13.1035 7.96568 13.2824 8.03084 13.442C8.19142 13.832 8.41454 14.1922 8.68983 14.5119C8.80367 14.6451 8.98919 14.7009 9.1681 14.6698L9.79042 14.5621C10.2007 14.491 10.6054 14.7107 10.745 15.0809L10.957 15.6415C11.0176 15.803 11.1616 15.9261 11.3426 15.9523C11.5564 15.9838 11.7767 16 12.0006 16C12.2227 16 12.4412 15.9839 12.655 15.9529C12.8349 15.9268 12.9791 15.8037 13.0406 15.6421L13.2526 15.0809C13.3922 14.7107 13.7969 14.491 14.2072 14.5621L14.8322 14.6704C15.0112 14.7012 15.1966 14.6455 15.3105 14.5125C15.585 14.1935 15.808 13.8339 15.9686 13.4449C16.0346 13.2853 15.9933 13.1062 15.8749 12.976L15.4611 12.5189ZM12.0035 13.5137C11.1146 13.5137 10.3939 12.8361 10.3939 12.0001C10.3939 11.1642 11.1145 10.4866 12.0035 10.4866C12.8925 10.4866 13.6131 11.1642 13.6131 12.0001C13.6131 12.836 12.8926 13.5137 12.0035 13.5137Z" 2843 }, null, -1), 2844 createBaseVNode("path", { d: "M9.71289 0.386475C10.3543 0.194293 10.9998 0.674885 11 1.34448V6.59155C10.6541 6.6551 10.32 6.7517 10 6.87671V1.34448L4 2.74487V14.0007H6.87695C7.01474 14.3533 7.18751 14.6879 7.3916 15.0007H1.5C1.22409 15.0007 1.00038 14.7766 1 14.5007C1 14.2246 1.22386 14.0007 1.5 14.0007H3V2.74487C3 2.35859 3.22192 2.01206 3.56055 1.84644L3.71289 1.78687L9.71289 0.386475ZM8 8.22632C7.77454 8.46521 7.57076 8.72446 7.39062 9.00073H6V8.00073H8V8.22632ZM8 6.00073H6V5.00073H8V6.00073Z" }, null, -1) 2845 ])]); 2846 }; 2847 } 2848})); 2849const _hoisted_1$2 = { 2850 width: "16", 2851 height: "16", 2852 viewBox: "0 0 16 16", 2853 fill: "none", 2854 xmlns: "http://www.w3.org/2000/svg" 2855}; 2856const _sfc_main$2 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, { 2857 name: "icon-agent-ai" 2858}), { 2859 __name: "agent-ai", 2860 setup(__props) { 2861 return (_ctx, _cache) => { 2862 return openBlock(), createElementBlock("svg", _hoisted_1$2, [..._cache[0] || (_cache[0] = [ 2863 createStaticVNode('<path d="M8 1C8.26586 1 8.53 1.00809 8.79199 1.02344C9.09925 1.04152 9.33301 1.30059 9.33301 1.6084C9.33289 1.96323 9.02522 2.23831 8.6709 2.21875C8.44885 2.20649 8.22519 2.20019 8 2.20019C7.31599 2.20019 6.64569 2.2554 5.99219 2.36035C4.1343 2.65876 2.65878 4.1343 2.36035 5.99219C2.2554 6.64559 2.2002 7.31596 2.2002 8C2.2002 8.68401 2.25542 9.35438 2.36035 10.0078C2.65878 11.8657 4.13428 13.3412 5.99219 13.6396C6.64566 13.7446 7.31596 13.7998 8 13.7998C8.68401 13.7998 9.35431 13.7446 10.0078 13.6396C11.8657 13.3412 13.3412 11.8657 13.6396 10.0078C13.7446 9.35441 13.7998 8.68404 13.7998 8C13.7998 7.77483 13.7935 7.55113 13.7812 7.3291C13.7617 6.97473 14.0367 6.66714 14.3916 6.66699C14.6994 6.66699 14.9586 6.90071 14.9766 7.20801C14.9919 7.47003 15 7.7341 15 8L14.9893 8.55859C14.9669 9.11433 14.9114 9.66151 14.8252 10.1982C14.4446 12.5675 12.5675 14.4447 10.1982 14.8252L9.6582 14.9004C9.11468 14.9658 8.56143 15 8 15C7.43857 15 6.88532 14.9658 6.3418
286314.9004L5.80176 14.8252C3.5065 14.4565 1.67315 12.6834 1.21484 10.4189L1.1748 10.1982C1.08861 9.66151 1.03306 9.11433 1.01074 8.55859L1 8C1 7.25152 1.05986 6.5174 1.1748 5.80176C1.55537 3.43247 3.43248 1.55535 5.80176 1.1748C6.51746 1.05987 7.25151 1 8 1Z"></path><path d="M10.1523 10C10.6805 10 11 10.559 10.623 10.9287C9.94701 11.5911 9.02133 12 8 12C6.97866 12 6.05299 11.5911 5.37695 10.9287C5.00001 10.559 5.31953 10 5.84766 10C6.04031 10 6.22135 10.0834 6.36914 10.207C6.81097 10.5765 7.37886 10.7998 8 10.7998C8.62114 10.7998 9.18903 10.5765 9.63086 10.207C9.77866 10.0834 9.95967 10 10.1523 10Z"></path><path d="M6 5C6.34205 5.00022 6.61914 5.27802 6.61914 5.62012V7.47852C6.61914 7.82062 6.34205 8.09841 6 8.09863C5.65776 8.09863 5.37988 7.82075 5.37988 7.47852V5.62012C5.37988 5.27788 5.65776 5 6 5Z"></path><path d="M10 5C10.3421 5.00016 10.6191 5.27798 10.6191 5.62012V7.47852C10.6191 7.82066 10.3421 8.09847 10 8.09863C9.65776 8.09863 9.37988 7.82075 9.37988 7.47852V5.62012C9.37988 5.27788 9.65776 5 10 5Z"></path><path d="M12.7031 0.703125C12.8001 0.43357 13.1837 0.431017 13.2803 0.703125C13.2972 0.751729 13.3155 0.802787 13.334 0.851562C13.39 0.999321 13.4542 1.14782 13.5264 1.29004C13.5428 1.32247 13.5606 1.35559 13.5781 1.38769C13.6969 1.60465 13.8381 1.8066 14.0078 1.97656C14.1754 2.14425 14.3788 2.28231 14.5986 2.39844C14.634 2.4171 14.6713 2.4343 14.708 2.45215C14.8522 2.5223 15.0023 2.58495 15.1504 2.64062C15.1994 2.65902 15.2495 2.67821 15.2979 2.69531C15.5735 2.79386 15.5626 3.17862 15.2939 3.27344C15.2471 3.28973 15.1985 3.30758 15.1514 3.32519C15.0007 3.38161 14.8502 3.44535 14.7061 3.51758C14.6723 3.53452 14.6368 3.55224 14.6035 3.57031C14.3848 3.68911 14.1814 3.83213 14.0068 4.00586C13.8408 4.1713 13.7107 4.36308 13.6025 4.57031C13.5815 4.61059 13.5605 4.65199 13.541 4.69336C13.4716 4.84056 13.41 4.996 13.3525 5.15234C13.3358 5.19784 13.319 5.24427 13.3027 5.29004C13.2032 5.5672 12.8113 5.55656 12.7227 5.27832L12.6768 5.1416C12.6233 4.9862 12.5628 4.83307 12.4932 4.6875C12.4744 4.64837 12.454 4.60985 12.4336 4.57129C12.318 4.35281 12.1779 4.15142 12.0029 3.97949C11.8337 3.81349 11.6335 3.67834 11.4189 3.56641C11.3801 3.54612 11.3399 3.52638 11.3008 3.50781C11.1533 3.43791 10.9994 3.37698 10.8467 3.32324C10.8009 3.30714 10.7538 3.29141 10.708 3.27637C10.4297 3.18443 10.4325 2.79299 10.7051 2.69727C10.7496 2.68189 10.7958 2.664 10.8408 2.64746C10.9946 2.59092 11.1488 2.52766 11.2959 2.45508C11.3341 2.43621 11.3739 2.41667 11.4111 2.39648C11.6209 2.2826 11.8137 2.1454 11.9736 1.97852L11.9756 1.97754C12.1424 1.80282 12.2826 1.60302 12.4023 1.38574C12.4199 1.35389 12.4376 1.32032 12.4541 1.28809C12.5255 1.14851 12.5907 1.00001 12.6494 0.847656L12.7031 0.703125Z"></path>', 5) 2864 ])]); 2865 }; 2866 } 2867})); 2868const _hoisted_1$1 = { 2869 width: "16", 2870 height: "16", 2871 viewBox: "0 0 16 16", 2872 fill: "none", 2873 xmlns: "http://www.w3.org/2000/svg" 2874}; 2875const _sfc_main$1 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, { 2876 name: "account-delegated" 2877}), { 2878 __name: "account-delegated", 2879 setup(__props) { 2880 return (_ctx, _cache) => { 2881 return openBlock(), createElementBlock("svg", _hoisted_1$1, [..._cache[0] || (_cache[0] = [ 2882 createBaseVNode("path", { d: "M14.554 0.803673C14.5555 0.803802 14.5572 0.803528 14.5588 0.803673C14.7255 0.792273 14.8961 0.848914 15.0237 0.976524C15.1511 1.10391 15.2067 1.27397 15.1956 1.44039C15.1957 1.44242 15.1964 1.44434 15.1965 1.44625C15.2003 1.49283 15.1995 1.54239 15.1995 1.56051V5.40035C15.1995 5.73171 14.9312 5.99994 14.5999 5.99996C14.2685 5.99996 14.0002 5.73172 14.0002 5.40035V2.84762L10.0237 6.82418C9.78937 7.0585 9.41034 7.0585 9.17603 6.82418C8.94173 6.58986 8.94172 6.21083 9.17603 5.97652L13.1526 1.99996H10.5999C10.2685 1.99996 10.0002 1.73172 10.0002 1.40035C10.0003 1.06902 10.2685 0.800743 10.5999 0.800743H14.4397C14.4578 0.800742 14.5073 0.799893 14.554 0.803673Z" }, null, -1), 2883 createBaseVNode("path", { d: "M8.00028 1C8.00028 1.33116 7.73182 1.59961 7.40067 1.59961H7.11551C6.83105 1.59974 6.59993 1.83075 6.59989 2.11523C6.59989 2.83557 6.15381 3.41829 5.60575 3.72559C5.56949 3.74591 5.53302 3.76688 5.49735 3.78809C4.95722 4.10915 4.22901 4.20489 3.60477 3.84473C3.35838 3.7026 3.04296 3.78692 2.90067 4.0332L2.01493 5.56738C1.87312 5.81334 1.95759 6.12842 2.2034 6.27051C2.82565 6.63004 3.10877 7.30612 3.10086 7.93457C3.10059 7.95632 3.09989 7.97816 3.09989 8C3.09989 8.0215 3.10059 8.04304 3.10086 8.06445C3.1087 8.69276 2.82641 9.36963 2.20438 9.72949C1.95824 9.8719 1.87382 10.1863 2.0159 10.4326L2.90067 11.9668C3.04298 12.2129 3.35857 12.2974 3.60477 12.1553C4.229 11.7948 4.95711 11.8899 5.49735 12.2109C5.53288 12.2321 5.56964 12.2532 5.60575 12.2734C6.15378 12.5809 6.59977 13.1635 6.59989 13.8838C6.59989 14.1687 6.83162 14.4003 7.11649 14.4004H8.88504C9.16946 14.4002 9.40065 14.1692 9.40067 13.8848C9.40067 13.1643 9.84717 12.5819 10.3948 12.2744C10.4308 12.2542 10.4668 12.233 10.5022 12.2119C11.0427 11.8901 11.7723 11.7937 12.3968 12.1543C12.6434 12.2965 12.9585 12.2124 13.1009 11.9658L13.9856 10.4336C14.1276 10.1872 14.0432 9.87204 13.7972 9.72949C13.1738 9.36943 12.8916 8.69188 12.8997 8.06348C12.9001 8.02842 12.9291 8 12.9642 8H14.0208C14.0645 8 14.0999 8.03542 14.0999 8.0791C14.0962 8.3
28836853 14.2253 8.59132 14.3968 8.69043C15.2169 9.16425 15.4979 10.2128 15.0247 11.0332L14.1399 12.5654C13.6662 13.3861 12.6168 13.668 11.7962 13.1943C11.6243 13.0952 11.3661 13.0946 11.1165 13.2432C11.0721 13.2696 11.0268 13.295 10.9817 13.3203C10.7284 13.4626 10.5999 13.6867 10.5999 13.8848C10.5999 14.832 9.8322 15.5994 8.88504 15.5996H7.11649C6.16888 15.5995 5.40067 14.8314 5.40067 13.8838C5.40055 13.6856 5.27171 13.4622 5.01883 13.3203C4.97384 13.2951 4.92835 13.2685 4.88407 13.2422C4.63438 13.094 4.37591 13.0953 4.20438 13.1943C3.38419 13.6678 2.33521 13.3866 1.8616 12.5664L0.975863 11.0332C0.502656 10.2133 0.783542 9.16454 1.60282 8.69043C1.77452 8.59103 1.90428 8.36776 1.90067 8.0791V7.91992C1.9043 7.6318 1.77519 7.40892 1.60379 7.30957C0.784237 6.8361 0.502905 5.78758 0.975863 4.96777L1.8616 3.43359C2.33518 2.61331 3.384 2.33228 4.20438 2.80566C4.37604 2.90462 4.63439 2.90518 4.88407 2.75684C4.92853 2.7304 4.97365 2.70404 5.01883 2.67871C5.27183 2.53684 5.40067 2.31333 5.40067 2.11523C5.40071 1.16801 6.1683 0.400519 7.11551 0.400391H7.40067C7.73182 0.400391 8.00028 0.668845 8.00028 1ZM8.00028 5.60014C8.00028 5.93155 7.72426 6.19043 7.4111 6.29887C6.70643 6.54289 6.20047 7.2123 6.20047 8C6.20047 8.99405 7.00624 9.79971 8.00028 9.7998C8.78802 9.7998 9.45745 9.2939 9.70144 8.58923C9.80988 8.27605 10.0688 8 10.4002 8C10.7316 8 11.0065 8.27138 10.941 8.59626C10.6645 9.96747 9.45297 11 8.00028 11C6.3435 10.9999 5.00028 9.6568 5.00028 8C5.00028 6.54738 6.03284 5.33589 7.40397 5.0593C7.72887 4.99376 8.00028 5.2687 8.00028 5.60014Z" }, null, -1) 2884 ])]); 2885 }; 2886 } 2887})); 2888const settingsIconMaps = { 2889 aicompanion: markRaw(AICompanion), 2890 general: markRaw(Setting), 2891 frontline: markRaw(_sfc_main$6), 2892 meeting: markRaw(VideoOn), 2893 webinar: markRaw(Webinars), 2894 zoomevents: markRaw(Events), 2895 clinicalNote: markRaw(ClinicalNote), 2896 recording: markRaw(RecordFill), 2897 videos: markRaw(VideoManagement), 2898 zoomMailCalendar: markRaw(Email), 2899 telephony: markRaw(AudioConferencing), 2900 pbx: markRaw(Phone), 2901 chat: markRaw(TeamChat), 2902 workvivo: markRaw(Workvivo), 2903 zoomapps: markRaw(Marketplace), 2904 onzoom: markRaw(Marketplace), 2905 whiteboard: markRaw(Whiteboard), 2906 notes: markRaw(Notes), 2907 zmDoc: markRaw(AIDocs), 2908 zmPaper: markRaw(FileFormatDocument), 2909 zmSheets: markRaw(FileFormatSpreadsheet), 2910 zmSheet: markRaw(FileFormatSpreadsheet), 2911 zmPresent: markRaw(FileFormatPresentation), 2912 zmSlides: markRaw(FileFormatPresentation), 2913 zmSlide: markRaw(FileFormatPresentation), 2914 zoomTasks: markRaw(Tasks), 2915 zmHub: markRaw(Hub), 2916 iq: markRaw(RevenueAccelerator), 2917 qm: markRaw(WEMQualityManagement), 2918 tsp: markRaw(AudioConferencing), 2919 zoomclips: markRaw(Clips), 2920 zoomassistant: markRaw(AgentAssist), 2921 surveyPoll: markRaw(SurveyV2), 2922 workflows: markRaw(FlowFill), 2923 cobrowse: markRaw(Setting), 2924 crcVideosdkConferencing: markRaw(H323OrSIP), 2925 workspace: markRaw(WorkspaceReservation), 2926 kiwi: markRaw(RevenueAccelerator) 2927}; 2928const iconMaps = { 2929 "personal-menu-item-profile": markRaw(Profile), 2930 "profile-menu-item-reports-new-with-external-biz": markRaw(Agenda), 2931 "personal-menu-item-personal-devices": markRaw(Device), 2932 "personal-menu-item-myphone": markRaw(Phone), 2933 "personal-menu-item-pbx-upgrade": markRaw(Phone), 2934 "personal-menu-item-personal-cci": markRaw(ContactCenter), 2935 "personal-menu-item-recording": markRaw(RecordFill), 2936 "profile-menu-item-admin-center": markRaw(AccountInformation), 2937 "personal-menu-item-summaries": markRaw(Summarize), 2938 "admin-menu-item-companysetup": markRaw(Wrench), 2939 "personal-menu-item-personal-contacts": markRaw(Contact), 2940 "admin-menu-item-dashboard": markRaw(BandwidthV2), 2941 "sidemenu-mail-calendar-management": markRaw(MailAndCalendarProduct), 2942 "sidemenu-user-management": markRaw(AllUser), 2943 "sidemenu-channel": markRaw(TeamChat), 2944 "device-management-menus": markRaw(Device), 2945 "node-management-menus": markRaw(Link), 2946 "room-management": markRaw(Rooms), 2947 "workspaces-management": markRaw(WorkspaceReservation), 2948 "profile-menu-item-reports-new-without-external-biz": markRaw(Agenda), 2949 "profile-menu-item-reports-old-without-data-request": markRaw(Agenda),
2950 "analytics-reports-personal-usage-report": markRaw(ClientBrowser), 2951 "analytics-reports-personal-activity-report": markRaw(Analytics), 2952 pbx_billing_container: markRaw(Phone), 2953 pbx_column_container: markRaw(Phone), 2954 contact_center_column_container: markRaw(ContactCenter), 2955 phone_number_management_column_container: markRaw(Keypad10Dots), 2956 new_ai_studio_column_container: markRaw(AIStudio$1), 2957 "side-menu-advance": markRaw(EllipsisVertical), 2958 "admin-menu-item-spot": markRaw(Huddles), 2959 "single-billing-menu": markRaw(Billing), 2960 "admin-menu-item-node-introduction": markRaw(ProxyV2), 2961 "menu-subacc": markRaw(_sfc_main$3), 2962 "menu-subacc-sub": markRaw(_sfc_main$3), 2963 "menu-account-management": markRaw(_sfc_main$9), 2964 "content-management": markRaw(_sfc_main$8), 2965 "admin-menu-item-home": markRaw(Home), 2966 "admin-menu-item-admin-destination-home": markRaw(Home), 2967 "account-menu-item-reports": markRaw(Agenda), 2968 "account-menu-item-billing": markRaw(Billing), 2969 "menu-billing": markRaw(Adjust), 2970 "menu-billing-payment": markRaw(Billing), 2971 "menu-billing-history": markRaw(CreditCard), 2972 "menu-billing-refer": markRaw(Refund), 2973 "menu-billing-credits": markRaw(AICompanion),
2974 "advance-menu-item-mesh": markRaw(MeshFill), 2975 "configure-products": markRaw(CustomizeV2), 2976 "account-menu-item-profile": markRaw(AccountInformation), 2977 "account-menu-item-notification": markRaw(BellNotificationOn), 2978 "advance-menu-item-branding": markRaw(Star), 2979 "advance-menu-item-sms-campaigns": markRaw(SMS), 2980 "admin-menu-item-ai-management": markRaw(AICompanion), 2981 "account-menu-item-release-control": markRaw(ReleaseEngagement), 2982 "account-menu-feature-request": markRaw(SurveyResults), 2983 "account-menu-item-information-barriers": markRaw(DigitalSignage), 2984 "account-menu-item-location-management": markRaw(Minimap), 2985 "account-menu-item-external-accounts": markRaw(_sfc_main$1), 2986 "account-menu-item-subscription-center": markRaw(AgentEngagement), 2987 "account-menu-item-track": markRaw(SchedulingDisplay), 2988 "account-menu-item-sso": markRaw(SSO), 2989 "advance-menu-item-sso": markRaw(SSO), 2990 "user-menu-item-users": markRaw(Profile), 2991 "user-menu-item-group": markRaw(AllUser), 2992 "user-menu-item-roles": markRaw(Participants), 2993 "user-menu-item-divisions": markRaw(Team), 2994 "user-menu-item-contacts": markRaw(Contact), 2995 "user-menu-item-external-contacts": markRaw(External),
2996 "advance-menu-item-security": markRaw(ShieldCheckmark), 2997 "profile-settings-privacy-setting": markRaw(ProfilePrivacy), 2998 // 'advance-menu-item-privacy-setting': markRaw(ProfilePrivacy), 2999 "personal-menu-item-data-privacy": markRaw(ProfilePrivacy), 3000 "advance-menu-item-tsp": markRaw(AudioConferencing), 3001 "advance-menu-item-docs-migration": markRaw(AIDocs), 3002 "account-menu-item-sipphone": markRaw(_sfc_main$5), 3003 "account-menu-item-clips": markRaw(Clips), 3004 "account-menu-item-videos": markRaw(VideoManagement), 3005 "account-menu-item-docs": markRaw(AIDocs), 3006 "account-menu-item-notes": markRaw(Notes), 3007 "account-menu-item-recording": markRaw(RecordFill), 3008 "admin-menu-item-scheduler": markRaw(Scheduler), 3009 "account-menu-item-survey": markRaw(SurveyV2), 3010 "account-menu-item-tasks": markRaw(Tasks), 3011 "account-menu-item-wallboard": markRaw(Agenda), 3012 "account-menu-item-whiteboard": markRaw(Whiteboard), 3013 "account-menu-item-workflow": markRaw(FlowFill), 3014 "menu-usage-report": markRaw(ClientBrowser), 3015 "menu-activity-report": markRaw(Analytics), 3016 // 'menu-data-subject-requests': markRaw(ComplianceManager), 3017 // 'menu-data-request-history': markRaw(AgentEngagement),
3018 "advance-menu-item-developer": markRaw(Marketplace), 3019 "advance-menu-item-hybrid": markRaw(ConferenceRoomConnector), 3020 "advance-menu-item-integration": markRaw(Integration), 3021 "subacc-menu-item": markRaw(AllUser), 3022 "subacc-menu-item-sub": markRaw(AllUser), 3023 "subacc-menu-item-sub_dashboard": markRaw(BandwidthV2), 3024 "subacc-menu-item-sub_dashboard_admin": markRaw(BandwidthV2), 3025 "subacc-menu-item-sub_list": markRaw(AllUser), 3026 "sub_account-menu-item-resource-management": markRaw(FileResource), 3027 "subacc-menu-item-invoice_history": markRaw(Tickets), 3028 "subacc-menu-item-sub_order_log": markRaw(ComplianceManager), 3029 "subacc-menu-item-sub_order_log-sub": markRaw(ComplianceManager), 3030 "subacc-menu-item-report": markRaw(Analytics), 3031 "subacc-menu-item-sub_report": markRaw(Analytics), 3032 "account-menu-item-dashboard": markRaw(BandwidthV2), 3033 "account-menu-item-setting": markRaw(Setting), 3034 "personal-menu-item-analytics_reports": markRaw(Agenda), 3035 "account-menu-item-roles": markRaw(Participants), 3036 "zoom-support-menus": markRaw(APIs), 3037 "account-menu-item-hub": markRaw(Hub), 3038 "account-menu-item-paper": markRaw(FileFormatDocument), 3039 "account-menu-item-sheet": markRaw(FileFormatSpreadsheet), 3040 "account-menu-item-present": markRaw(FileFormatPresentation), 3041 "analytics-reports-meeting": markRaw(VideoOn), 3042 "analytics-reports-zoom-phone": markRaw(Phone), 3043 "analytics-reports-contact-center": markRaw(Analytics), 3044 "analytics-reports-contact-center-legacy": markRaw(ContactCenter), 3045 "analytics-reports-virtual-agent": markRaw(VirtualAgent), 3046 "analytics-reports-zva-custom-agents": markRaw(AgentAssist), 3047 "analytics-reports-zva-intents": markRaw(IntentManager), 3048 "analytics-reports-zva-knowledge-base": markRaw(KnowledgeBase), 3049 "personal-menu-item-data-request": markRaw(ComplianceManager), 3050 "personal-menu-item-data-history": markRaw(AgentEngagement), 3051 "meeting-menu-item-upcoming": markRaw(VideoIncoming), 3052 "meeting-menu-item-previous": markRaw(VideoContent), 3053 "meeting-menu-item-assets": markRaw(Attachment), 3054 "meeting-menu-item-pmi": markRaw(ZoomRoomPersonal), 3055 "meeting-menu-item-templates": markRaw(TemplateMiscellaneous), 3056 "meeting-menu-item-tsp": markRaw(PhonePowerPack), 3057 "meeting-menu-item-poll-template": markRaw(Poll), 3058 "meeting-menu-item-agendas": markRaw(Agenda), 3059 "meeting-menu-item-whatis": markRaw(Gift), 3060 "meeting-menu-item-pac": markRaw(PhonePowerPack), 3061 "profile-menu-item-profile": markRaw(Profile), 3062 "personal-menu-item-setting": markRaw(Setting), 3063 "profile-menu-item-billing": markRaw(Billing), 3064 "profile-menu-item-reports-simple": markRaw(Agenda), 3065 "profile-menu-item-reports-with-children": markRaw(Agenda), 3066 "webinar-menu-item-upcoming": markRaw(VideoIncoming), 3067 "webinar-menu-item-previous": markRaw(VideoContent), 3068 "webinar-menu-item-templates": markRaw(TemplateMiscellaneous), 3069 "webinar-menu-item-poll-template": markRaw(Poll), 3070 "webinar-menu-item-whatis": markRaw(Gift), 3071 accountLeftNavMeetingSummaryManagement: markRaw(Summarize),
3072 "advance-menu-item-information-barriers": markRaw(DigitalSignage), 3073 "zoom-node-header": markRaw(Link), 3074 "account-menu-item-vrc": markRaw(ConferenceRoomConnector), 3075 "node-menu-item-dashboard": markRaw(BandwidthV2), 3076 "node-menu-item-modules": markRaw(ProxyV2), 3077 "node-menu-item-home": markRaw(ProxyV2), 3078 "node-menu-item-updates": markRaw(Refresh), 3079 "node-menu-item-settings": markRaw(Setting), 3080 "support-buildAPI": markRaw(Marketplace), 3081 "support-document": markRaw(AIDocs), 3082 "support-help-center": markRaw(PlatformSolutions), 3083 agent_management_menu: markRaw(_sfc_main$2), 3084 "account-menu-item-compliance": markRaw(ComplianceManager), 3085 "account-menu-item-phone": markRaw(Phone), 3086 "menu-featuresetting-report": markRaw(Setting), 3087 "security-privacy": markRaw(ShieldLock), 3088 "security-data-privacy": markRaw(ShieldLock), 3089 kiwi_column_container: markRaw(RevenueAccelerator), 3090 kiwi_qm_column_container: markRaw(WEMQualityManagement), 3091 "frontline-management": markRaw(_sfc_main$6), 3092 "advance-menu-item-lync": markRaw(_sfc_main$4),
3093 "advance-menu-item-device-policy": markRaw(_sfc_main$7), 3094 "advance-menu-item-crossHybrid": markRaw(Scheduler), 3095 "account-menu-item-meeting-connector": markRaw(ConferenceRoomConnector), 3096 "admin-nav-list": markRaw(_sfc_main$3), 3097 "profile-menu-item-account-profile": markRaw(AccountInformation), 3098 "advance-menu-item-cpaas": markRaw(APIs), 3099 "account-menu-item-referral": markRaw(Gift), 3100 "contact_center_column_container-dynamic": markRaw(ContactCenter), 3101 "contact_center_column_container-static": markRaw(ContactCenter), 3102 pbx_column_container_dynamic: markRaw(Phone), 3103 pbx_column_container_static: markRaw(Phone), 3104 "admin-menu-item-workforce": markRaw(AllUser), 3105 "menu-billing-report": markRaw(Analytics), 3106 "menu-subacc-customer": markRaw(_sfc_main$3), 3107 "subacc-menu-item-partner_order_history": markRaw(Tickets), 3108 "subacc-menu-item-resource-management": markRaw(FileResource), 3109 "subacc-menu-item-sub_order_log-customer": markRaw(ComplianceManager), 3110 "subacc-menu-item-sub_invoice_history": markRaw(Tickets), 3111 "profile-menu-item-reports-old-with-data-request": markRaw(Agenda), 3112 "personal-menu-item-reports-main": markRaw(Agenda), 3113 "account-menu-item-im": markRaw(TeamChat), 3114 "admin-menu-link-marketplace-management": markRaw(Marketplace), 3115 "support-developerForum": markRaw(Marketplace), 3116 "admin-menu-item-marketplace-management": markRaw(Marketplace), 3117 "settings-policies": markRaw(Setting), 3118 "cx-management": markRaw(ContactCenter) 3119}; 3120for (const key in settingsIconMaps) { 3121 iconMaps[`settings-${key}`] = settingsIconMaps[key]; 3122 iconMaps[`profile-settings-${key}`] = settingsIconMaps[key]; 3123} 3124const { isAccountSetupPBX, pbxVersionSwitch } = ((_a = window.microsDatas) == null ? void 0 : _a.sideMenuConfig) || {}; 3125const shouldLoadPBXVersions = Boolean(isAccountSetupPBX && (pbxVersionSwitch == null ? void 0 : pbxVersionSwitch.pbx_1_6_0)); 3126function createSubMenuEntry(config, condition = true) { 3127 return { config, condition: Boolean(condition), status: "idle" }; 3128} 3129function useMenuAction({ menus, activeKey, activeMenu, myAccountMenu, setActive }) { 3130 const { getMenuData }
3130 = useMailCalendar(); 3131 const subMenuRegistry = { 3132 pbx: createSubMenuEntry(PBX, shouldLoadPBXVersions), 3133 zcc: createSubMenuEntry(ZCC, pbxVersionSwitch == null ? void 0 : pbxVersionSwitch.pbx_1_6_0), 3134 zcp: createSubMenuEntry(ZCP), 3135 aiStudioNew: createSubMenuEntry(AIStudioNew), 3136 aiStudio: createSubMenuEntry(AIStudio), 3137 zva: createSubMenuEntry(ZVA), 3138 mailCalendar: createSubMenuEntry(MailCalendar, window.__user_enabled_mail_and_calendar) 3139 }; 3140 let rawMenus = []; 3141 let buildSeq = 0; 3142 const resolveMenuTarget = (menuList, key) => { 3143 var _a2, _b; 3144 const productMenu = getMenuByKeyOrId(menuList, MENU_KEYS.PRODUCT_CONFIG); 3145 const cxMenu = getMenuByKeyOrId(menuList, MENU_KEYS.CX_MANAGEMENT); 3146 return (_b = (_a2 = getMenuByKeyOrId((productMenu == null ? void 0 : productMenu.items) || [], key)) != null ? _a2 : getMenuByKeyOrId((cxMenu == null ? void 0 : cxMenu.items) || [], key)) != null ? _b : getMenuByKeyOrId(menuList, key); 3147 }; 3148 const prepareMenu = (menuList) => { 3149 var _a2; 3150 myAccountMenu.value = ((_a2 = menuList.filter((menu) => menu.id === "admin-menu-item-my-account")) == null ? void 0 : _a2[0]) || {}; 3151 return menuList.filter((menu) => menu.id !== "admin-menu-item-my-account"); 3152 }; 3153 function fetchMenu() { 3154 return __async(this, null, function* () { 3155 var _a2; 3156 try { 3157 const { data } = yield axios.get("/admin/menu"); 3158 const menu = Array.isArray((_a2 = data == null ? void 0 : data.result) == null ? void 0 : _a2.menu) ? prepareMenu(data.result.menu) : []; 3159 setSessionStorage(`${prefix}-admin-menu`, JSON.stringify(menu)); 3160 return menu; 3161 } catch (error) { 3162 console.error("[AdminMenu] Failed to fetch menu:", error); 3163 return []; 3164 } 3165 }); 3166 } 3167 function resolvePendingSubMenus(menuList) { 3168 return Object.entries(subMenuRegistry).filter(([, { config, condition, status }]) => { 3169 if (!condition || status === "loading" || status === "loaded") return false; 3170 const target = resolveMenuTarget(menuList, config.key); 3171 return !!(target == null ? void 0 : target.dynamicSubMenu); 3172 }).map(([alias, { config }]) => ({ alias, config })); 3173 } 3174 function loadSubMenus(menuList, seq) { 3175 return __async(this, null, function* () { 3176 const pending = resolvePendingSubMenus(menuList); 3177 if (!pending.length) return; 3178 pending.forEach(({ alias }) => { 3179 subMenuRegistry[alias].status = "loading"; 3180 }); 3181 const results = yield Promise.allSettled( 3182 pending.map( 3183 ({ config }) => config.key === MailCalendar.key ? getMenuData(config) : useLoadMenu(config) 3184 ) 3185 ); 3186 if (seq !== buildSeq) { 3187 pending.forEach(({ alias }) => { 3188 var _a2; 3189 if (((_a2 = subMenuRegistry[alias]) == null ? void 0 : _a2.status) === "loading") subMenuRegistry[alias].status = "idle"; 3190 }); 3191 return; 3192 } 3193 results.forEach((result, i) => { 3194 const { alias, config } = pending[i]; 3195 const entry = subMenuRegistry[alias]; 3196 if (result.status === "fulfilled") { 3197 const { menus: items, fetchedFromNetwork } = result.value; 3198 if (!Array.isArray(items)) return; 3199 const processed = processMenuItems(items, config, activeKey); 3200 const target = resolveMenuTarget(menuList, config.key); 3201 if (target) { 3202 target.command = () => refreshSubMenu(alias); 3203 target.items = processed; 3204 } 3205 entry.status = fetchedFromNetwork ? "loaded" : "idle"; 3206 } else { 3207 entry.status = "error"; 3208 console.error(`[AdminMenu] Failed to load sub-menu "${config.key}":`, result.reason); 3209 } 3210 }); 3211 }); 3212 } 3213 function enhanceMenus(menuList) { 3214 var _a2, _b; 3215 if (!Array.isArray(menuList)) return menuList; 3216 const productMenu = getMenuByKeyOrId(menuList, MENU_KEYS.PRODUCT_CONFIG); 3217 const deviceMenu = (_a2 = getMenuByKeyOrId((productMenu == null ? void 0 : productMenu.items) || [], MENU_KEYS.DEVICE_MANAGEMENT)) != null ? _a2 : getMenuByKeyOrId(menuList, MENU_KEYS.DEVICE_MANAGEMENT); 3218 if (deviceMenu) enhanceDeviceMenu(deviceMenu, activeKey); 3219 const nodeMenu = (_b = getMenuByKeyOrId((productMenu == null ? void 0 : productMenu.items) || [], MENU_KEYS.NODE_MANAGEMENT)) != null ? _b : getMenuByKeyOrId(menuList, MENU_KEYS.NODE_MANAGEMENT); 3220 if (nodeMenu) enhanceNodeMenu(nodeMenu, activeKey); 3221 validateMenuKeys(menuList); 3222 return menuList; 3223 } 3224 function renderMenus(shouldAutoActive) { 3225 const enhanced = enhanceMenus(rawMenus); 3226 const filtered = filterRenderableMenus(enhanced, KEEP_KEYS); 3227 const cloned = filtered.map(deepCloneMenu); 3228 try { 3229 if (iconMaps && cloned.length) applyMenuIcons(cloned, iconMaps); 3230 } catch (e) { 3231 console.warn("[AdminMenu] Icons not available, continuing without"); 3232 } 3233 if (cloned.length) menus.value = [...cloned]; 3234 applyDefaultActive(shouldAutoActive, menus.value.length ? menus.value : cloned); 3235 } 3236 function applyDefaultActive(shouldAutoActive = true, menuList = menus.value) { 3237 var _a2, _b; 3238 const { sideMenuActiveKey, sideFreeActiveKey } = window.microsDatas || {}; 3239 const found = findActiveMenu(menuList, sideMenuActiveKey != null ? sideMenuActiveKey : sideFreeActiveKey); 3240 activeMenu.value = found; 3241 if (shouldAutoActive && ((_b = (_a2 = found == null ? void 0 : found.target) == null ? void 0 : _a2.item) == null ? void 0 : _b.key)) {
3242 setActive(found.target.item.key); 3243 } 3244 return found; 3245 } 3246 function build(rawMenuList, shouldAutoActive = true) { 3247 return __async(this, null, function* () { 3248 const seq = ++buildSeq; 3249 Object.values(subMenuRegistry).forEach((entry) => { 3250 entry.status = "idle"; 3251 }); 3252 rawMenus = initializeSideMenuData(rawMenuList); 3253 try { 3254 yield loadSubMenus(rawMenus, seq); 3255 if (seq !== buildSeq) return; 3256 yield nextTick(); 3257 renderMenus(shouldAutoActive); 3258 } catch (error) { 3259 console.error("[AdminMenu] Error building menus:", error); 3260 } 3261 }); 3262 } 3263 function refreshSubMenu(_0) { 3264 return __async(this, arguments, function* (alias, config = {}) { 3265 const entry = subMenuRegistry[alias]; 3266 if (!entry || entry.status === "loading" || entry.status === "loaded") return; 3267 try { 3268 entry.status = "loading"; 3269 const mergedConfig = __spreadValues(__spreadValues({}, entry.config), config); 3270 const loadFn = alias === "mailCalendar" ? getMenuData : useLoadMenu; 3271 const { menus: items, error } = yield loadFn(mergedConfig, true); 3272 if (error) { 3273 entry.status = "error"; 3274 console.error("[AdminMenu] Failed to refresh sub-menu:", error); 3275 return; 3276 } 3277 if (!items.length) { 3278 entry.status = "loaded"; 3279 return; 3280 } 3281 const processed = processMenuItems(items, mergedConfig, activeKey); 3282 const target = resolveMenuTarget(menus.value, mergedConfig.key); 3283 if (target) target.items = processed; 3284 entry.status = "loaded"; 3285 } catch (error) { 3286 entry.status = "error"; 3287 console.error("[AdminMenu] Failed to refresh sub-menu:", error); 3288 } 3289 }); 3290 } 3291 function getMenu(keyOrId) { 3292 return getMenuByKeyOrId(menus.value, keyOrId); 3293 } 3294 return { 3295 fetchMenu, 3296 build, 3297 refreshSubMenu, 3298 applyDefaultActive, 3299 getMenu 3300 }; 3301} 3302function useMenuState() { 3303 const loading = ref(true); 3304 const menus = ref([]); 3305 const activeKey = ref(null); 3306 const activeMenu = ref(null); 3307 const myAccountMenu = ref(null); 3308 function setActive(keyOrId) { 3309 var _a2, _b; 3310 if (!keyOrId) return; 3311 const found = (_a2 = getMenuItemByProps(menus.value, keyOrId, "key")) != null ? _a2 : getMenuItemByProps(menus.value, keyOrId, "id"); 3312 if ((_b = found == null ? void 0 : found.item) == null ? void 0 : _b.key) { 3313 activeKey.value = found.item.key; 3314 } 3315 } 3316 const { fetchMenu, build, refreshSubMenu, applyDefaultActive, getMenu } = useMenuAction({ 3317 menus, 3318 activeKey, 3319 activeMenu, 3320 myAccountMenu, 3321 setActive 3322 }); 3323 onMounted(() => __async(this, null, function* () { 3324 try { 3325 const rawMenu = yield fetchMenu(); 3326 yield build(rawMenu); 3327 window.dispatchEvent(new CustomEvent("admin-side-menu-loaded", { detail: { menus } })); 3328 } catch (error) { 3329 console.error("[AdminMenu] Failed to initialize:", error); 3330 } finally { 3331 loading.value = false; 3332 } 3333 })); 3334 return { 3335 loading, 3336 menus, 3337 activeKey, 3338 activeMenu, 3339 myAccountMenu, 3340 setActive, 3341 refreshSubMenu, 3342 applyDefaultActive, 3343 getMenu 3344 }; 3345} 3346const PINNED_GET_URL = "/admin/menu/pinned"; 3347const PINNED_SAVE_URL = "/admin/menu/pinned/save"; 3348const SESSION_PINNED_KEY = `${prefix}-admin-menu-pinned-ids`; 3349function normalizePinnedIdsFromResponse(result) { 3350 var _a2, _b; 3351 if (Array.isArray(result)) { 3352 return result.filter((id) => typeof id === "string" && id.trim()).map((id) => id.trim()); 3353 } 3354 if (result && typeof result === "object") { 3355 const nested = (_b = (_a2 = result.pinned) != null ? _a2 : result.menuIds) != null ? _b : result.ids; 3356 if (Array.isArray(nested)) { 3357 return nested.filter((id) => typeof id === "string" && id.trim()).map((id) => id.trim()); 3358 } 3359 } 3360 return []; 3361} 3362function persistPinnedSession(ids) { 3363 try { 3364 setSessionStorage(SESSION_PINNED_KEY, JSON.stringify(ids)); 3365 } catch (e) { 3366 } 3367} 3368function hydratePinnedFromSession() { 3369 try { 3370 const raw = getSessionStorage(SESSION_PINNED_KEY); 3371 if (!raw) return []; 3372 const parsed = JSON.parse(raw); 3373 if (!Array.isArray(parsed)) return []; 3374 return parsed.filter((id) => typeof id === "string" && id.trim()).map((id) => id.trim()); 3375 } catch (e) { 3376 return []; 3377 } 3378} 3379function usePinnedMenuIds() { 3380 const pinnedMenuIds = ref(hydratePinnedFromSession()); 3381 function fetchPinnedMenuIds() { 3382 return __async(this, null, function* () {
3383 try { 3384 const { data } = yield axios.get(PINNED_GET_URL); 3385 pinnedMenuIds.value = normalizePinnedIdsFromResponse(data == null ? void 0 : data.result); 3386 persistPinnedSession(pinnedMenuIds.value); 3387 } catch (error) { 3388 console.error("[AdminMenu] Failed to fetch pinned menus:", error); 3389 if (!pinnedMenuIds.value.length) { 3390 pinnedMenuIds.value = []; 3391 } 3392 } 3393 }); 3394 } 3395 function savePinnedMenuIds(ids) { 3396 return __async(this, null, function* () { 3397 const payload = Array.isArray(ids) ? [...ids] : []; 3398 try { 3399 yield axios.post(PINNED_SAVE_URL, payload); 3400 persistPinnedSession(payload); 3401 } catch (error) { 3402 console.error("[AdminMenu] Failed to save pinned menus:", error); 3403 } 3404 }); 3405 } 3406 return { 3407 pinnedMenuIds, 3408 fetchPinnedMenuIds, 3409 savePinnedMenuIds 3410 }; 3411} 3412const _hoisted_1 = ["href"]; 3413const _hoisted_2 = { 3414 class: "fe-popups-icon side-menu-v3__item-icon", 3415 "aria-hidden": "true" 3416}; 3417const _hoisted_3 = { class: "side-menu__item-label" }; 3418const _sfc_main = /* @__PURE__ */ Object.assign({ name: "admin-side-menu" }, { 3419 __name: "admin-menu", 3420 setup(__props, { expose: __expose }) { 3421 var _a2; 3422 const sideMenuRef = ref(null); 3423 const { isVideoSdk } = ((_a2 = window.microsDatas) == null ? void 0 : _a2.sideMenuConfig) || {}; 3424 const { pinnedMenuIds, fetchPinnedMenuIds, savePinnedMenuIds } = usePinnedMenuIds(); 3425 const { isLoggedInMA, isExternalUserView } = window.microsDatas || {}; 3426 const { loading, menus, activeKey, myAccountMenu, setActive, refreshSubMenu, applyDefaultActive } = useMenuState(); 3427 const handleItemExpandedChange = ({ processedItem, expanded }) => { 3428 if (expanded && processedItem.item.dynamicSubMenu) { 3429 processedItem.item.command(); 3430 } 3431 }; 3432 const handlePinnedMenuIdsUpdate = (ids) => { 3433 pinnedMenuIds.value = ids; 3434 savePinnedMenuIds(ids); 3435 }; 3436 const menuRef = sideMenuRef; 3437 const waitForMenuReady = () => __async(this, null, function* () { 3438 let retry = 40; 3439 while (loading.value && retry > 0) { 3440 retry--; 3441 yield new Promise((resolve2) => setTimeout(resolve2, 50)); 3442 } 3443 }); 3444 const setActiveById = (keyOrId, options) => __async(this, null, function* () { 3445 var _a3, _b; 3446 yield waitForMenuReady(); 3447 setActive == null ? void 0 : setActive(keyOrId); 3448 return yield (_b = (_a3 = sideMenuRef.value) == null ? void 0 : _a3.setActive) == null ? void 0 : _b.call(_a3, keyOrId, options); 3449 }); 3450 const reset = () => __async(this, null, function* () { 3451 var _a3, _b; 3452 if (activeKey.value) { 3453 setActive == null ? void 0 : setActive(activeKey.value); 3454 } 3455 return yield (_b = (_a3 = sideMenuRef.value) == null ? void 0 : _a3.reset) == null ? void 0 : _b.call(_a3); 3456 }); 3457 const { shouldShowCoachMark } = useCoachMark(); 3458 const { isMobile } = useMobileResponsive(); 3459 onMounted(() => { 3460 var _a3, _b; 3461 fetchPinnedMenuIds(); 3462 const parent = (_a3 = document.getElementById("sidemenu")) == null ? void 0 : _a3.parentElement; 3463 if ((_b = parent == null ? void 0 : parent.classList) == null ? void 0 : _b.contains("nav-menu")) { 3464 parent.removeAttribute("role"); 3465 parent.removeAttribute("aria-label"); 3466 } 3467 window.addEventListener("hashchange", () => { 3468 applyDefaultActive(); 3469 }); 3470 }); 3471 const toggleExpand = (keyOrId, expanded, options) => __async(this, null, function* () { 3472 var _a3, _b, _c; 3473 return yield (_c = (_b = (_a3 = sideMenuRef.value) == null ? void 0 : _a3.menuRef) == null ? void 0 : _b.toggleExpand) == null ? void 0 : _c.call(_b, keyOrId, expanded, options); 3474 }); 3475 const handleItemClick = () => { 3476 var _a3, _b; 3477 (_b = (_a3 = window.mobileToggleApp) == null ? void 0 : _a3.rootInstance) == null ? void 0 : _b.toggleSideMenu(); 3478 }; 3479 __expose({ 3480 adminSideMenuRef: menuRef, 3481 menusData: menus, 3482 refresh: refreshSubMenu, 3483 findActiveMenu, 3484 setActive: (keyOrId) => { 3485 if (keyOrId) return setActiveById(keyOrId); 3486 applyDefaultActive(); 3487 return null; 3488 }, 3489 toggleExpand, 3490 reset 3491 }); 3492 return (_ctx, _cache) => {
3493 const _component_zm_icon = resolveComponent("zm-icon"); 3494 const _component_zm_context = resolveComponent("zm-context"); 3495 return openBlock(), createBlock(_component_zm_context, { 3496 "system-fonts": false, 3497 namespace: unref(NAME_SPACE) 3498 }, { 3499 default: withCtx(() => [ 3500 createVNode(_sfc_main$a, { 3501 id: "admin-side-menu", 3502 ref_key: "sideMenuRef", 3503 ref: sideMenuRef, 3504 menus: unref(menus), 3505 "active-key": !unref(shouldShowCoachMark) ? unref(activeKey) : null, 3506 "pin-able": !unref(isVideoSdk), 3507 "pinned-menu-ids": unref(pinnedMenuIds), 3508 "is-mobile": unref(isMobile), 3509 "is-loading": unref(loading), 3510 "show-initial-mask": unref(shouldShowCoachMark), 3511 "aria-label": "Admin menu", 3512 "onUpdate:pinnedMenuIds": handlePinnedMenuIdsUpdate, 3513 onItemExpandedChange: handleItemExpandedChange, 3514 onItemClick: handleItemClick 3515 }, createSlots({ _: 2 }, [ 3516 !unref(isVideoSdk) && !unref(isLoggedInMA) && !unref(isExternalUserView) ? { 3517 name: "footer", 3518 fn: withCtx(() => [ 3519 createBaseVNode("a", { 3520 id: "admin-center-button", 3521 class: "side-menu-v3__item-content", 3522 target: "_self", 3523 href: unref(myAccountMenu).url || "/profile" 3524 }, [ 3525 createBaseVNode("i", _hoisted_2, [ 3526 createVNode(_component_zm_icon, null, { 3527 default: withCtx(() => [ 3528 createVNode(unref(Profile)) 3529 ]), 3530 _: 1 3531 }) 3532 ]), 3533 createBaseVNode("span", _hoisted_3, toDisplayString(unref(myAccountMenu).label ? unref(myAccountMenu).label : "My account"), 1) 3534 ], 8, _hoisted_1) 3535 ]), 3536 key: "0" 3537 } : void 0 3538 ]), 1032, ["menus", "active-key", "pin-able", "pinned-menu-ids", "is-mobile", "is-loading", "show-initial-mask"]) 3539 ]), 3540 _: 1 3541 }, 8, ["namespace"]); 3542 }; 3543 } 3544}); 3545function setupI18n() { 3546 return __async(this, null, function* () { 3547 const loadLocaleFile = (localeCode) => __async(this, null, function* () { 3548 try { 3549 return (yield __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({
3549"./locales/en-US.json": () => __vitePreload(() => Promise.resolve().then(() => enUS$1), true ? void 0 : void 0, import.meta.url)
3549 }), `./locales/${localeCode}.json`, 3)).default; 3550 } catch (e) { 3551 return null; 3552 } 3553 }); 3554 const enUSMessage = (yield loadLocaleFile("en-US")) || {}; 3555 const localeMessage = (yield loadLocaleFile(locale)) || enUSMessage; 3556 const mergedLocalesMessage = __spreadValues({}, localeMessage); 3557 const i18n = createI18n({ 3558 locale, 3559 legacy: false, 3560 messageCompiler: false, 3561 fallbackLocale: "en-US", 3562 messages: { 3563 [locale]: mergedLocalesMessage, 3564 "en-US": enUSMessage 3565 } 3566 }); 3567 return i18n; 3568 }); 3569} 3570const elWrap = document.getElementById("skiptocontent"); 3571if (elWrap) { 3572 const anchor = elWrap.querySelector("a"); 3573 anchor == null ? void 0 : anchor.addEventListener("click", (event) => { 3574 event.preventDefault(); 3575 const mainContent = document.getElementById("the-main-content"); 3576 if (mainContent) { 3577 mainContent.focus(); 3578 mainContent.scrollIntoView(); 3579 } 3580 }); 3581} 3582const install = (app) => { 3583 app.use(ZmContext); 3584 app.use(ZmScrollbar); 3585 app.use(ZmSideMenu); 3586 app.use(ZmIcon); 3587 app.use(ZmButton); 3588 app.use(ZmTooltip); 3589 app.use(ZmBadge); 3590 app.use(ZmVisuallyHidden); 3591}; 3592function sideMenu() { 3593 return __async(this, null, function* () { 3594 const sideMenuEl = document.getElementById("sidemenu"); 3595 if (!sideMenuEl) return; 3596 const i18n = yield setupI18n(); 3597 const app = createApp(_sfc_main); 3598 app.use(i18n); 3599 install(app); 3600 setupAppErrorHandling(app, "admin-menu"); 3601 window.sideMenu = app.mount(sideMenuEl); 3602 }); 3603} 3604const sideMenu$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 3605 __proto__: null, 3606 default: sideMenu 3607}, Symbol.toStringTag, { value: "Module" })); 3608const adminMenu = { 3609 backMainAccount: "Back to main account", 3610 backLinkedAccount: "Back to the linked account", 3611 backMyAccount: "Back to My Account" 3612}; 3613const enUS = { 3614 adminMenu 3615}; 3616const enUS$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 3617 __proto__: null, 3618 adminMenu, 3619 default: enUS 3620}, Symbol.toStringTag, { value: "Module" })); 3621export { 3622 _sfc_main$a as _, 3623 __variableDynamicImportRuntimeHelper as a, 3624 iconMaps as i, 3625 sideMenu$1 as s, 3626 useMobileResponsive as u 3627};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.