@mlightcad/ribbon 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,7 +19,7 @@ A Vue 3 + TypeScript Ribbon UI component library aligned with Syncfusion Ribbon
19
19
  - `MlRibbonGallery`
20
20
  - Schema-driven `custom` items for embedding host Vue components in groups
21
21
  - `MlRibbonTemplateItem`
22
- - File menu and backstage shells; file menu items support optional nested `children` (hover right-start submenus; `@file-menu-select` emits the chosen leaf item `id`)
22
+ - File menu and backstage shells; file menu items support optional nested `children` (hover right-start submenus; `@file-menu-select` emits the chosen leaf item `id`) and per-item `divided: true` separators
23
23
  - Contextual tabs and key tips overlays
24
24
  - Runtime dynamic API for tab/group/item mutations
25
25
  - Size unification with Element Plus (`large/default/small`) via `MlRibbon` `size` prop or global `ElConfigProvider`
@@ -168,7 +168,7 @@ function handleItemClick(payload: {
168
168
  - `hide-key-tips-toggle` whether to hide key tips toggle, default `false`
169
169
  - `show-file-menu` whether to show file menu, default `true`
170
170
  - `show-open-backstage` whether to show `Open backstage` command in File menu, default `true`
171
- - `file-menu-items` `FileMenuItemModel[]` — each item has `id`, `label`, optional `disabled`, and optional recursive `children` for hover submenus (see §4.5)
171
+ - `file-menu-items` `FileMenuItemModel[]` — each item has `id`, `label`, optional `disabled`, optional `divided`, and optional recursive `children` for hover submenus (see §4.5)
172
172
  - `texts` localized UI text overrides
173
173
  - `tooltip-show-after` global tooltip show delay in milliseconds, default `1000`
174
174
  - `tooltip-hide-after` global tooltip hide delay in milliseconds, default `0`
@@ -291,24 +291,30 @@ const tabs = [
291
291
  }
292
292
  ```
293
293
 
294
- ### 4.5 Nested file menu items
294
+ ### 4.5 Nested file menu items and dividers
295
295
 
296
296
  Pass `file-menu-items` as `FileMenuItemModel[]`. Items with a non-empty `children` array render as hover submenus to the right; leaf items without `children` behave like plain commands. `@file-menu-select` always receives the selected leaf command `id` (parents with children do not emit on their own).
297
297
 
298
+ Set `divided: true` on an item (including nested `children`) to show a divider line **above** that row — the same Element Plus `ElDropdownItem` `divided` behavior used by dropdown options. When `show-open-backstage` is enabled, a divider is also drawn automatically above the first configured file menu item.
299
+
298
300
  ```ts
299
301
  import type { FileMenuItemModel } from '@mlightcad/ribbon'
300
302
 
301
303
  const fileMenuItems: FileMenuItemModel[] = [
302
304
  { id: 'new', label: 'New' },
303
305
  { id: 'open', label: 'Open' },
306
+ { id: 'save', label: 'Save' },
304
307
  {
305
308
  id: 'export',
306
309
  label: 'Export',
310
+ divided: true,
307
311
  children: [
308
312
  { id: 'export-dxf', label: 'Export to DXF' },
309
- { id: 'export-pdf', label: 'Export to PDF' },
313
+ { id: 'export-pdf', label: 'Export to PDF', divided: true },
310
314
  ],
311
315
  },
316
+ { id: 'print', label: 'Print', divided: true },
317
+ { id: 'exit', label: 'Exit', divided: true },
312
318
  ]
313
319
  ```
314
320
 
@@ -311,9 +311,14 @@ var J = { class: "ml-ribbon-backstage__nav" }, Y = { class: "ml-ribbon-backstage
311
311
  default: k(() => [(v(!0), i(e, null, x(o.item.children, (e) => (v(), n(l, {
312
312
  key: e.id,
313
313
  item: e,
314
+ divided: e.divided === !0,
314
315
  "popper-class": o.popperClass,
315
316
  onSelect: d
316
- }, null, 8, ["item", "popper-class"]))), 128))]),
317
+ }, null, 8, [
318
+ "item",
319
+ "divided",
320
+ "popper-class"
321
+ ]))), 128))]),
317
322
  _: 1
318
323
  })]),
319
324
  default: k(() => [a("span", Ae, [s(T(o.item.label) + " ", 1), c(D(L), { class: "ml-ribbon-file-menu-submenu__arrow" }, {
@@ -379,7 +384,7 @@ var J = { class: "ml-ribbon-backstage__nav" }, Y = { class: "ml-ribbon-backstage
379
384
  })), (v(!0), i(e, null, x(u.items, (e, t) => (v(), n(je, {
380
385
  key: e.id,
381
386
  item: e,
382
- divided: u.showOpenBackstage !== !1 && t === 0,
387
+ divided: e.divided === !0 || u.showOpenBackstage !== !1 && t === 0,
383
388
  "popper-class": g.value,
384
389
  onSelect: y
385
390
  }, null, 8, [
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`),require(`element-plus`),require(`@element-plus/icons-vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`,`element-plus`,`@element-plus/icons-vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.MlRibbon={},e.Vue,e.ElementPlus,e.ElementPlusIconsVue))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Symbol(`RibbonContext`);function a(e){return e==null||typeof e==`string`?e:typeof e==`object`||typeof e==`function`?(0,t.markRaw)((0,t.toRaw)(e)):e}function o(e){if(!e)return;let t={...e};return`component`in t&&(t.component=a(t.component)),`icon`in t&&(t.icon=a(t.icon)),`activeIcon`in t&&(t.activeIcon=a(t.activeIcon)),`inactiveIcon`in t&&(t.inactiveIcon=a(t.inactiveIcon)),Array.isArray(t.options)&&(t.options=t.options.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return`icon`in t?{...t,icon:a(t.icon)}:t})),Array.isArray(t.categories)&&(t.categories=t.categories.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return{...t,items:Array.isArray(t.items)?t.items.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return{...t,preview:a(t.preview),icon:a(t.icon),component:a(t.component)}}):t.items}})),t}function s(e){return{...e,icon:a(e.icon),props:o(e.props)}}function c(e){return{...e,icon:a(e.icon),footerMenuItems:e.footerMenuItems?.map(s),collections:e.collections?.map(e=>({...e,items:e.items.map(s)}))}}function l(e){return{...e,groups:e.groups?.map(c)}}function u(e){return e.map(l)}function d(e){(!e.collections||e.collections.length===0)&&(e.collections=[{id:`${e.id}-collection-1`,items:[]}])}function f(e,t,n,r,i){let a=e.find(e=>e.id===t);if(!a?.groups)return;let o=a.groups.find(e=>e.id===n);if(!o?.collections)return;let s=o.collections.find(e=>e.id===r);s&&i(s.items)}function p(e,n,r,i,a,o,p,m){let h=(0,t.ref)(r),g=(0,t.ref)(i),_=(0,t.ref)(a),v=(0,t.ref)(o),y=(0,t.ref)(u(n)),b=(0,t.ref)(!1),x=(0,t.ref)(!1),S=(0,t.ref)(!1),C=(0,t.ref)([]),w=(0,t.ref)(``),T=(0,t.ref)(p),E=(0,t.ref)(m),D=(0,t.computed)(()=>y.value.filter(e=>e.visible!==!1)),O={addTab(e){y.value.push(l(e)),v.value||=e.id},removeTab(e){y.value=y.value.filter(t=>t.id!==e),v.value===e&&(v.value=D.value[0]?.id??``)},showTab(e){let t=y.value.find(t=>t.id===e);t&&(t.visible=!0)},hideTab(e){let t=y.value.find(t=>t.id===e);t&&(t.visible=!1)},selectTab(e){v.value=e},addGroup(e,t){let n=y.value.find(t=>t.id===e);n&&(n.groups??=[],d(t),n.groups.push(c(t)))},removeGroup(e,t){let n=y.value.find(t=>t.id===e);n?.groups&&(n.groups=n.groups.filter(e=>e.id!==t))},showGroup(e,t){let n=y.value.find(t=>t.id===e)?.groups?.find(e=>e.id===t);n&&(n.visible=!0)},hideGroup(e,t){let n=y.value.find(t=>t.id===e)?.groups?.find(e=>e.id===t);n&&(n.visible=!1)},addItem(e,t,n,r){f(y.value,e,t,n,e=>e.push(s(r)))},removeItem(e,t,n,r){f(y.value,e,t,n,e=>{let t=e.findIndex(e=>e.id===r);t>=0&&e.splice(t,1)})},updateItem(e,t,n,r,i){f(y.value,e,t,n,e=>{let t=e.find(e=>e.id===r);t&&Object.assign(t,i)})},enableItem(e,t,n,r){O.updateItem(e,t,n,r,{disabled:!1})},disableItem(e,t,n,r){O.updateItem(e,t,n,r,{disabled:!0})},refreshLayout(){b.value=!1},minimize(e){_.value=e},toggleSimplified(){g.value=g.value===`classic`?`simplified`:`classic`}};return{context:{id:e,disabled:h,layout:g,minimized:_,activeTab:v,tabs:y,overflowOpen:b,backdropOpen:x,keyTipsOpen:S,keyTips:C,keyTipsSequence:w,tooltipShowAfter:T,tooltipHideAfter:E,registerKeyTip:e=>{C.value.some(t=>t.id===e.id)||C.value.push(e)},unregisterKeyTip:e=>{C.value=C.value.filter(t=>t.id!==e)},api:O},visibleTabs:D}}var m={class:`ml-ribbon-backstage__nav`},h={class:`ml-ribbon-backstage__content`},g={key:0},_={key:1},v=(0,t.defineComponent)({__name:`RibbonBackstage`,props:{open:{type:Boolean},backLabel:{},title:{},description:{},size:{default:`default`}},emits:[`close`],setup(e,{emit:r}){let i=e,a=r;function o(){a(`close`)}return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDrawer),{"model-value":i.open,size:`100%`,"with-header":!1,direction:`ltr`,onClose:o},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-backstage`,`ml-ribbon-backstage--size-${i.size||`default`}`])},[e.$slots.default?(0,t.renderSlot)(e.$slots,`default`,{key:0,close:o,backLabel:i.backLabel,title:i.title,description:i.description,size:i.size}):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`aside`,m,[(0,t.createVNode)((0,t.unref)(n.ElButton),{type:`primary`,onClick:o},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(i.backLabel),1)]),_:1})]),(0,t.createElementVNode)(`section`,h,[i.title?((0,t.openBlock)(),(0,t.createElementBlock)(`h2`,g,(0,t.toDisplayString)(i.title),1)):(0,t.createCommentVNode)(``,!0),i.description?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,_,(0,t.toDisplayString)(i.description),1)):(0,t.createCommentVNode)(``,!0)])],64))],2)]),_:3},8,[`model-value`]))}}),y={class:`ml-ribbon-tabs`,role:`tablist`},b=[`aria-selected`,`disabled`,`onClick`],x=(0,t.defineComponent)({__name:`RibbonTabs`,props:{tabs:{},activeTab:{},disabled:{type:Boolean}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)(()=>r.tabs.filter(e=>e.visible!==!1));function o(e,t){i(`select`,{id:e,triggerEl:t.currentTarget instanceof HTMLElement?t.currentTarget:null})}return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,y,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-tab`,{"is-active":e.activeTab===n.id}]),role:`tab`,"aria-selected":e.activeTab===n.id,disabled:r.disabled,onClick:e=>o(n.id,e)},(0,t.toDisplayString)(n.title),11,b))),128))]))}}),S={class:`ml-ribbon-contextual-tabs`},C={class:`ml-ribbon-contextual-tabs__normal`},w={class:`ml-ribbon-contextual-tabs__ctx`},T={key:0},E=(0,t.defineComponent)({__name:`RibbonContextualTabs`,props:{tabs:{},activeTab:{},disabled:{type:Boolean}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n;return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,S,[(0,t.createElementVNode)(`div`,C,[(0,t.createVNode)(x,{tabs:r.tabs.filter(e=>!e.contextual),"active-tab":e.activeTab,disabled:r.disabled,onSelect:a[0]||=e=>i(`select`,e)},null,8,[`tabs`,`active-tab`,`disabled`])]),(0,t.createElementVNode)(`div`,w,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.tabs.filter(e=>e.contextual),n=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:n.id,class:`ml-ribbon-contextual-tabs__block`,style:(0,t.normalizeStyle)({"--ctx-color":n.contextualColor||`#67c23a`})},[n.contextualTitle?.trim()?((0,t.openBlock)(),(0,t.createElementBlock)(`small`,T,(0,t.toDisplayString)(n.contextualTitle.trim()),1)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(x,{tabs:[n],"active-tab":e.activeTab,disabled:r.disabled,onSelect:a[1]||=e=>i(`select`,e)},null,8,[`tabs`,`active-tab`,`disabled`])],4))),128))])]))}}),D={class:`ml-ribbon-file-menu-submenu__trigger`},O=(0,t.defineComponent)({__name:`RibbonFileMenuItem`,props:{item:{},divided:{type:Boolean},popperClass:{}},emits:[`select`],setup(e,{emit:i}){let a=e,o=i,s=e=>Array.isArray(e.children)&&e.children.length>0;function c(e){o(`select`,e)}return(e,i)=>{let o=(0,t.resolveComponent)(`RibbonFileMenuItem`,!0);return s(a.item)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:0,divided:a.divided,disabled:a.item.disabled,class:`ml-ribbon-file-menu-submenu`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdown),{trigger:`hover`,placement:`right-start`,teleported:!0,"show-timeout":0,"hide-timeout":100,"popper-class":a.popperClass,onCommand:c},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdownMenu),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.item.children,e=>((0,t.openBlock)(),(0,t.createBlock)(o,{key:e.id,item:e,"popper-class":a.popperClass,onSelect:c},null,8,[`item`,`popper-class`]))),128))]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,D,[(0,t.createTextVNode)((0,t.toDisplayString)(a.item.label)+` `,1),(0,t.createVNode)((0,t.unref)(n.ElIcon),{class:`ml-ribbon-file-menu-submenu__arrow`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.ArrowRight))]),_:1})])]),_:1},8,[`popper-class`])]),_:1},8,[`divided`,`disabled`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:1,divided:a.divided,command:a.item.id,disabled:a.item.disabled},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(a.item.label),1)]),_:1},8,[`divided`,`command`,`disabled`]))}}}),k=[`disabled`],A=(0,t.defineComponent)({__name:`RibbonFileMenu`,props:{items:{},label:{},openBackstageLabel:{},showOpenBackstage:{type:Boolean},disabled:{type:Boolean}},emits:[`select`,`open-backstage`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.ref)(!1),s=(0,n.useGlobalConfig)(`size`,``),c=(0,t.computed)(()=>s.value||`default`),l=(0,t.computed)(()=>`ml-ribbon-file-menu-dropdown ml-ribbon-popper ml-ribbon-popper--size-${c.value}`);function u(e){o.value=e}function d(e){if(e===`__backstage`){a(`open-backstage`);return}a(`select`,e)}return(0,t.watch)(()=>i.disabled,e=>{e&&(o.value=!1)}),(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdown),{trigger:`click`,disabled:i.disabled,"popper-class":l.value,onCommand:d,onVisibleChange:u},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdownMenu),null,{default:(0,t.withCtx)(()=>[i.showOpenBackstage===!1?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:0,command:`__backstage`},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(i.openBackstageLabel),1)]),_:1})),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i.items,(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(O,{key:e.id,item:e,divided:i.showOpenBackstage!==!1&&n===0,"popper-class":l.value,onSelect:d},null,8,[`item`,`divided`,`popper-class`]))),128))]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-tab ml-ribbon-tab--file`,{"is-active":o.value}]),disabled:i.disabled},(0,t.toDisplayString)(i.label),11,k)]),_:1},8,[`disabled`,`popper-class`]))}}),j=(0,t.defineComponent)({__name:`RibbonCollection`,props:{id:{},layout:{default:`row`},rows:{default:3}},setup(e){let n=e,r=(0,t.computed)(()=>({"--ml-ribbon-collection-rows":String(n.rows)}));return(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-collection`,[`ml-ribbon-collection--${n.layout}`]]),style:(0,t.normalizeStyle)(r.value)},[(0,t.renderSlot)(e.$slots,`default`)],6))}}),M={key:3,class:`ml-ribbon-item-host__label ml-ribbon-button__label`},N=(0,t.defineComponent)({name:`MlRibbonButton`,__name:`RibbonButton`,props:{id:{},label:{default:void 0},icon:{default:void 0},disabled:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},ariaLabel:{default:void 0},iconSize:{default:void 0},size:{default:void 0},buttonType:{default:`default`},nativeType:{default:`button`}},emits:[`click`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.computed)(()=>i.label===void 0?i.id:i.label.trim()),s=(0,t.computed)(()=>!i.hideLabel&&o.value.length>0),c=(0,t.computed)(()=>i.ariaLabel?.trim()||o.value||i.id),l=(0,t.computed)(()=>!i.icon||typeof i.icon==`string`?null:i.icon),u=(0,t.computed)(()=>{if(typeof i.icon!=`string`)return null;let e=i.icon.trim();return e.length>0?e:null}),d=(0,t.computed)(()=>s.value?`ml-ribbon-item-host__icon--with-label`:`ml-ribbon-item-host__icon--icon-only`),f=(0,t.computed)(()=>{if(i.iconSize)return{fontSize:i.iconSize}});function p(e){i.disabled||a(`click`,e)}return(r,i)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElButton),{class:`ml-ribbon-button`,"data-ribbon-button-id":e.id,type:e.buttonType,size:e.size,"native-type":e.nativeType,disabled:e.disabled,"aria-label":c.value,onClick:p},{default:(0,t.withCtx)(()=>[r.$slots.icon?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`ml-ribbon-item-host__icon ml-ribbon-button__icon`,d.value]),style:(0,t.normalizeStyle)(f.value),"aria-hidden":`true`},[(0,t.renderSlot)(r.$slots,`icon`)],6)):l.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:1,class:(0,t.normalizeClass)([`ml-ribbon-item-host__icon ml-ribbon-button__icon`,d.value]),style:(0,t.normalizeStyle)(f.value)},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(l.value)))]),_:1},8,[`class`,`style`])):u.value?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:2,class:(0,t.normalizeClass)([`ml-ribbon-item-host__icon ml-ribbon-item-host__icon--class ml-ribbon-button__icon`,[u.value,d.value]]),style:(0,t.normalizeStyle)(f.value),"aria-hidden":`true`},null,6)):(0,t.createCommentVNode)(``,!0),s.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,M,[(0,t.renderSlot)(r.$slots,`label`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(o.value),1)])])):(0,t.createCommentVNode)(``,!0),(0,t.renderSlot)(r.$slots,`default`)]),_:3},8,[`data-ribbon-button-id`,`type`,`size`,`native-type`,`disabled`,`aria-label`]))}}),P=[`data-id`],ee={key:0,class:`ml-ribbon-button-group__label`},F={class:`ml-ribbon-button-group__text`},I=(0,t.defineComponent)({__name:`RibbonButtonGroup`,props:{id:{},label:{},options:{},hideLabel:{type:Boolean,default:!1},wrap:{type:Boolean,default:!0},equalWidth:{type:Boolean,default:!1},buttonSize:{},iconSize:{},tooltipShowAfter:{default:1e3},tooltipHideAfter:{default:0},disabled:{type:Boolean,default:!1}},emits:[`change`],setup(e,{emit:r}){let i=e,a=r;function o(e){i.disabled||a(`change`,e)}function s(e){return typeof e==`string`&&e.trim().length>0}function c(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function l(e){if(typeof e==`string`){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim();return t?t.replace(/\b\w/g,e=>e.toUpperCase()):void 0}if(typeof e==`number`||typeof e==`boolean`)return String(e)}function u(e){return c(e.tooltip)??c(e.label)??l(e.value)}return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-button-group`,{"ml-ribbon-button-group--nowrap":!e.wrap,"ml-ribbon-button-group--equal-width":!e.wrap&&e.equalWidth}]),"data-id":e.id},[!e.hideLabel&&e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ee,(0,t.toDisplayString)(e.label),1)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.ElButtonGroup),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.options,r=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{key:String(r.value),content:u(r),disabled:!u(r),"show-after":e.tooltipShowAfter,"hide-after":e.tooltipHideAfter,placement:`top`,effect:`dark`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(N,{id:String(r.value),class:`ml-ribbon-button-group__button`,label:r.label,icon:r.icon,"icon-size":e.iconSize,size:e.buttonSize,disabled:e.disabled,"hide-label":!s(r.label),"aria-label":u(r)??String(r.value),onClick:e=>o(r.value)},(0,t.createSlots)({_:2},[s(r.label)?{name:`label`,fn:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,F,(0,t.toDisplayString)(r.label),1)]),key:`0`}:void 0]),1032,[`id`,`label`,`icon`,`icon-size`,`size`,`disabled`,`hide-label`,`aria-label`,`onClick`])]),_:2},1032,[`content`,`disabled`,`show-after`,`hide-after`]))),128))]),_:1})],10,P))}}),L={class:`ml-ribbon-item-host__content ml-ribbon-dropdown__content`},R={class:`ml-ribbon-item-host__text-row ml-ribbon-dropdown__text-row`},z={key:0,class:`ml-ribbon-item-host__label ml-ribbon-dropdown__label`},te={class:`ml-ribbon-dropdown-item__content`},ne={class:`ml-ribbon-dropdown-item__row`},re={key:0,class:`ml-ribbon-dropdown-item__check`,"aria-hidden":`true`},B={class:`ml-ribbon-dropdown-item__main`},V={class:`ml-ribbon-dropdown-item__label`},H=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({name:`MlRibbonDropdown`,__name:`RibbonDropdown`,props:{id:{},label:{default:void 0},tooltip:{default:void 0},icon:{default:void 0},options:{default:()=>[]},disabled:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},syncLabelWithSelection:{type:Boolean,default:!1},itemSize:{default:`medium`},tooltipShowAfter:{default:1e3},tooltipHideAfter:{default:0},popperClass:{default:void 0},modelValue:{default:void 0}},emits:[`command`,`click`,`tooltip-change`],setup(e,{emit:i}){let a=e,o=i,s=(0,n.useGlobalConfig)(`size`,``),c=(0,t.computed)(()=>s.value||`default`),l=(0,t.ref)(!1),u=(0,t.ref)(void 0);(0,t.watch)(()=>a.modelValue,e=>{e!==void 0&&(u.value=e)},{immediate:!0});let d=(0,t.computed)(()=>Array.isArray(a.options)?a.options:[]),f=(0,t.computed)(()=>d.value.find(e=>D(e)===u.value)??null),p=(0,t.computed)(()=>{if(f.value&&a.syncLabelWithSelection){let e=k(f.value);if(e)return e}return M(a.label)??a.id}),m=(0,t.computed)(()=>!a.hideLabel&&p.value.length>0),h=(0,t.computed)(()=>a.modelValue!==void 0||a.syncLabelWithSelection),g=(0,t.computed)(()=>{if(f.value){let e=T(f.value);if(e)return e}return!a.icon||typeof a.icon==`string`?null:a.icon}),_=(0,t.computed)(()=>{if(f.value){let e=E(f.value);if(e)return e}if(typeof a.icon!=`string`)return null;let e=a.icon.trim();return e.length>0?e:null}),v=(0,t.computed)(()=>!!(g.value||_.value)),y=(0,t.computed)(()=>j(f.value)??M(a.tooltip)??M(p.value)??M(a.label)??N(a.id)),b=(0,t.computed)(()=>[`ml-ribbon-dropdown-menu`,`ml-ribbon-popper`,`ml-ribbon-popper--size-${c.value}`,a.popperClass].filter(Boolean).join(` `));function x(e){if(a.disabled){l.value=!1;return}l.value=e}function S(){a.disabled||(l.value=!l.value)}function C(e){a.disabled||(u.value=e,o(`tooltip-change`,j(f.value)??y.value),o(`command`,e),l.value=!1)}function w(){if(a.disabled)return;let e=f.value;if(!e){o(`click`);return}o(`command`,D(e))}function T(e){if(!e||typeof e!=`object`)return null;let t=e.icon;return!t||typeof t==`string`?null:t}function E(e){if(!e||typeof e!=`object`)return null;let t=e.icon;return typeof t!=`string`||t.trim().length===0?null:t}function D(e){if(!(!e||typeof e!=`object`))return e.value}function O(e){let t=D(e);if(typeof t==`string`||typeof t==`number`||t&&typeof t==`object`)return t}function k(e){if(!e||typeof e!=`object`)return;let t=e.label;return typeof t==`string`?t:void 0}function A(e){if(typeof e==`string`)return N(e);if(typeof e==`number`||typeof e==`boolean`)return String(e)}function j(e){if(!(!e||typeof e!=`object`))return M(e.tooltip)??k(e)??A(D(e))}function M(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function N(e){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim();return t?t.replace(/\b\w/g,e=>e.toUpperCase()):e}function P(e){return D(e)===u.value}return(i,a)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdown),{class:(0,t.normalizeClass)([`ml-ribbon-dropdown`,[`ml-ribbon-dropdown--item-${e.itemSize}`,{"is-label-hidden":e.hideLabel}]]),trigger:`click`,disabled:e.disabled,"popper-class":b.value,onVisibleChange:x,onCommand:C},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdownMenu),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d.value,a=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:String(D(a)),command:O(a),disabled:a.disabled===!0,divided:a.divided===!0,"aria-current":P(a)?`true`:void 0,class:(0,t.normalizeClass)({"ml-ribbon-dropdown-item--selected":P(a)})},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElTooltip),{content:j(a),disabled:!j(a),"show-after":e.tooltipShowAfter,"hide-after":e.tooltipHideAfter,placement:`top`,effect:`dark`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,te,[(0,t.renderSlot)(i.$slots,`option`,{option:a},()=>[(0,t.createElementVNode)(`span`,ne,[h.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,re,[P(a)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-dropdown-item__check-icon`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.Check))]),_:1})):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,B,[T(a)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-dropdown-item__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(T(a))))]),_:2},1024)):E(a)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-dropdown-item__icon ml-ribbon-dropdown-item__icon--class`,E(a)]),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,V,(0,t.toDisplayString)(k(a)),1)])])],!0)])]),_:2},1032,[`content`,`disabled`,`show-after`,`hide-after`])]),_:2},1032,[`command`,`disabled`,`divided`,`aria-current`,`class`]))),128))]),_:3})]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{type:`default`,disabled:e.disabled,"aria-label":y.value,onClick:S},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,L,[i.$slots.icon||v.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`ml-ribbon-item-host__icon ml-ribbon-item-host__icon--dropdown-primary ml-ribbon-dropdown__icon`,{"ml-ribbon-item-host__icon--class":_.value&&!g.value&&!i.$slots.icon}]),onClick:(0,t.withModifiers)(w,[`stop`])},[(0,t.renderSlot)(i.$slots,`icon`,{selectedOption:f.value},()=>[g.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(g.value)))]),_:1})):_.value?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)(_.value),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0)],!0)],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,R,[m.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,z,[(0,t.renderSlot)(i.$slots,`label`,{selectedOption:f.value,label:p.value},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(p.value),1)],!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.ElIcon),{class:(0,t.normalizeClass)([`ml-ribbon-item-host__dropdown-arrow ml-ribbon-dropdown__arrow`,{"is-open":l.value}])},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(l.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1},8,[`class`])])])]),_:3},8,[`disabled`,`aria-label`])]),_:3},8,[`class`,`disabled`,`popper-class`]))}}),[[`__scopeId`,`data-v-3704c6ba`]]),ie=[`disabled`],ae=[`src`],U={key:3,class:`ml-ribbon-gallery__preview-svg`,role:`presentation`,"aria-hidden":`true`},oe=[`href`],se={class:`ml-ribbon-gallery__label ml-ribbon-gallery__collapsed-label`},ce={class:`ml-ribbon-gallery__panel`},le={key:0,class:`ml-ribbon-gallery__panel-category-title`},W=[`disabled`,`onClick`],G=[`src`],K={key:3,class:`ml-ribbon-gallery__preview-svg`,role:`presentation`,"aria-hidden":`true`},ue=[`href`],de={class:`ml-ribbon-gallery__label`},fe={key:1,class:`ml-ribbon-gallery__title`},pe={key:2,class:`ml-ribbon-gallery__categories`},me={key:0,class:`ml-ribbon-gallery__category-title`},he=[`disabled`,`onClick`],ge=[`src`],q={key:3,class:`ml-ribbon-gallery__preview-svg`,role:`presentation`,"aria-hidden":`true`},_e=[`href`],ve={class:`ml-ribbon-gallery__label`},ye={key:0,class:`ml-ribbon-gallery__controls`,"aria-label":`Gallery navigation`},J=[`disabled`],be=[`disabled`],xe=[`disabled`],Se={key:0,class:`ml-ribbon-gallery__panel-category-title`},Y=[`data-gallery-row-index`,`disabled`,`onClick`],Ce=[`src`],we={key:3,class:`ml-ribbon-gallery__preview-svg`,role:`presentation`,"aria-hidden":`true`},Te=[`href`],Ee={class:`ml-ribbon-gallery__label`},De=6,Oe=64,ke=4,Ae=16,je=4,Me=22,X=(0,t.defineComponent)({name:`MlRibbonGallery`,__name:`RibbonGallery`,props:{id:{},label:{},categories:{},disabled:{type:Boolean,default:!1},modelValue:{},collapsed:{type:Boolean,default:!1},inlineItemLimit:{default:4},inlineItemWidthMode:{default:`fixed`},previewFallback:{}},emits:[`select`],setup(e,{emit:i}){let a=e,o=i,s=(0,t.ref)(``),c=(0,t.ref)(!1),l=(0,t.ref)(0),u=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(null),p=(0,t.ref)(0),m=(0,n.useGlobalConfig)(`size`,``),h=(0,t.computed)(()=>m.value||`default`),g=(0,t.computed)(()=>h.value===`small`?.92:h.value===`large`?1.08:1),_=(0,t.computed)(()=>Math.round(Oe*g.value)),v=(0,t.computed)(()=>Math.round(Me*g.value)),y=(0,t.computed)(()=>a.label?.trim()??``),b=(0,t.computed)(()=>a.categories.filter(e=>e.items.length>0).length),x=(0,t.computed)(()=>a.categories.flatMap(e=>e.items)),S=(0,t.computed)(()=>x.value.find(e=>e.id===s.value)??x.value[0]),C=(0,t.computed)(()=>!Number.isFinite(a.inlineItemLimit)||a.inlineItemLimit<=0?4:Math.floor(a.inlineItemLimit)),w=(0,t.computed)(()=>{let e=C.value,t=x.value.length;return t===0?Math.min(e,1):Math.min(e,t)}),T=(0,t.computed)(()=>Math.max(1,Math.ceil(x.value.length/w.value))),E=(0,t.computed)(()=>Math.min(l.value,T.value-1)),D=(0,t.computed)(()=>j.value&&E.value>0),O=(0,t.computed)(()=>j.value&&E.value<T.value-1),k=(0,t.computed)(()=>{let e=E.value*w.value;return x.value.slice(e,e+w.value)}),A=(0,t.computed)(()=>new Set(k.value.map(e=>e.id))),j=(0,t.computed)(()=>x.value.length>w.value),M=(0,t.computed)(()=>{let e=[`ml-ribbon-gallery-panel`,`ml-ribbon-gallery-panel--${a.collapsed?`collapsed`:`inline`}`,`ml-ribbon-gallery-panel--size-${h.value}`];return a.inlineItemWidthMode===`auto`&&e.push(`ml-ribbon-gallery-panel--item-width-auto`),e.join(` `)}),N=(0,t.computed)(()=>({"--ml-ribbon-gallery-panel-columns":String(w.value),"--ml-ribbon-gallery-panel-item-width":`${_.value}px`})),P=(0,t.computed)(()=>a.inlineItemWidthMode===`auto`?`fit-content`:w.value*_.value+Math.max(0,w.value-1)*ke+De*2+(a.collapsed?Ae:je+v.value)),ee=(0,t.computed)(()=>({modifiers:[{name:`offset`,options:{offset:[p.value,0]}}]}));(0,t.watch)(()=>a.modelValue,e=>{typeof e==`string`&&(s.value=e,te(e))},{immediate:!0}),(0,t.watch)(()=>[x.value.map(e=>e.id).join(`\0`),w.value,s.value],()=>{te()||(l.value=Math.min(l.value,T.value-1))}),(0,t.watch)(c,async e=>{!e||a.collapsed||(ne(),await(0,t.nextTick)(),await(0,t.nextTick)(),re())});function F(e){return e==null||typeof e==`string`?e:typeof e==`object`||typeof e==`function`?(0,t.markRaw)((0,t.toRaw)(e)):e}function I(e){let t=y.value.toLowerCase(),n=e.title.trim().toLowerCase();return b.value>1||!t||n!==t}function L(e){return j.value?e.items.filter(e=>A.value.has(e.id)):e.items}function R(e){if(a.disabled||!j.value)return;let t=E.value+e;l.value=Math.min(Math.max(t,0),T.value-1)}function z(e){let t=x.value.findIndex(t=>t.id===e.id);return t<0?0:Math.floor(t/w.value)}function te(e=s.value){let t=x.value.find(t=>t.id===e);return t?(l.value=z(t),!0):!1}function ne(){let e=u.value,t=d.value;if(!e||!t){p.value=0;return}let n=e.querySelector(`.ml-ribbon-gallery__grid .ml-ribbon-gallery__item`)?.getBoundingClientRect().left??e.getBoundingClientRect().left;p.value=Math.round(n-t.getBoundingClientRect().left-De)}function re(){let e=f.value;e&&e.querySelector(`[data-gallery-row-index="${E.value}"]`)?.scrollIntoView?.({block:`start`})}function B(e){return e.preview&&typeof e.preview!=`string`?F(e.preview):e.icon&&typeof e.icon!=`string`?F(e.icon):null}function V(e){return e.component?F(e.component):null}function H(e){return a.disabled||e.disabled===!0}function X(e){if(typeof e.icon!=`string`)return null;let t=e.icon.trim();return t.length>0?t:null}function Z(e){let t=e.previewSvg??e.svg;if(typeof t!=`string`)return null;let n=t.trim();return n.length>0?n:null}function Ne(e){return e.startsWith(`data:image/svg+xml`)||e.endsWith(`.svg`)}function Pe(e){let t=Z(e);return t?Ne(t):!1}function Fe(e){return typeof e.preview==`string`?e.preview:a.previewFallback}function Q(e){H(e)||(s.value=e.id,l.value=z(e),c.value=!1,o(`select`,e.id))}return(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`galleryRef`,ref:u,class:(0,t.normalizeClass)([`ml-ribbon-gallery`,{"is-disabled":e.disabled,"is-collapsed":e.collapsed,"is-unlabeled":!e.collapsed&&!y.value,"is-inline-item-width-auto":!e.collapsed&&e.inlineItemWidthMode===`auto`}])},[e.collapsed&&S.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:0,visible:c.value,"onUpdate:visible":a[0]||=e=>c.value=e,trigger:`click`,placement:`bottom-start`,disabled:e.disabled,width:P.value,"popper-class":M.value},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__collapsed-button`,{"is-selected":s.value===S.value.id,"is-open":c.value}]),disabled:H(S.value)},[V(S.value)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(V(S.value)),(0,t.mergeProps)({key:0},S.value.componentProps,{item:S.value,selected:s.value===S.value.id,disabled:H(S.value)}),null,16,[`item`,`selected`,`disabled`])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview ml-ribbon-gallery__collapsed-preview`,{"ml-ribbon-gallery__preview--icon":B(S.value)||X(S.value),"ml-ribbon-gallery__preview--svg":Z(S.value)}])},[B(S.value)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-gallery__preview-icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(B(S.value))))]),_:1})):X(S.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview-icon ml-ribbon-gallery__preview-icon--class`,X(S.value)]),"aria-hidden":`true`},null,2)):Z(S.value)&&Pe(S.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:2,class:`ml-ribbon-gallery__preview-svg`,src:Z(S.value)??``,alt:``},null,8,ae)):Z(S.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,U,[(0,t.createElementVNode)(`use`,{href:Z(S.value)??``},null,8,oe)])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createTextVNode)((0,t.toDisplayString)(Fe(S.value)),1)],64))],2),(0,t.createElementVNode)(`div`,se,(0,t.toDisplayString)(S.value.label),1)],64))],10,ie)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ce,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.categories,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-gallery__panel-category`},[I(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`h4`,le,(0,t.toDisplayString)(e.title),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:`ml-ribbon-gallery__panel-grid`,style:(0,t.normalizeStyle)(N.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,r=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:r.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__item ml-ribbon-gallery__panel-item`,{"is-selected":s.value===r.id}]),disabled:H(r),onClick:e=>Q(r)},[(0,t.renderSlot)(i.$slots,`item`,{item:r,category:e,selected:s.value===r.id,disabled:H(r),select:()=>Q(r)},()=>[V(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(V(r)),(0,t.mergeProps)({key:0,ref_for:!0},r.componentProps,{item:r,category:e,selected:s.value===r.id,disabled:H(r)}),null,16,[`item`,`category`,`selected`,`disabled`])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview`,{"ml-ribbon-gallery__preview--icon":B(r)||X(r),"ml-ribbon-gallery__preview--svg":Z(r)}])},[B(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-gallery__preview-icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(B(r))))]),_:2},1024)):X(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview-icon ml-ribbon-gallery__preview-icon--class`,X(r)]),"aria-hidden":`true`},null,2)):Z(r)&&Pe(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:2,class:`ml-ribbon-gallery__preview-svg`,src:Z(r)??``,alt:``},null,8,G)):Z(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,K,[(0,t.createElementVNode)(`use`,{href:Z(r)??``},null,8,ue)])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createTextVNode)((0,t.toDisplayString)(Fe(r)),1)],64))],2),(0,t.createElementVNode)(`div`,de,(0,t.toDisplayString)(r.label),1)],64))])],10,W))),128))],4)]))),128))])]),_:3},8,[`visible`,`disabled`,`width`,`popper-class`])):(0,t.createCommentVNode)(``,!0),!e.collapsed&&y.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fe,(0,t.toDisplayString)(y.value),1)):(0,t.createCommentVNode)(``,!0),e.collapsed?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,pe,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.categories,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-gallery__category`},[y.value&&I(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`h4`,me,(0,t.toDisplayString)(e.title),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:`ml-ribbon-gallery__grid`,style:(0,t.normalizeStyle)({"--ml-ribbon-gallery-inline-columns":String(w.value)})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(L(e),r=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:r.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__item`,{"is-selected":s.value===r.id}]),disabled:H(r),onClick:e=>Q(r)},[(0,t.renderSlot)(i.$slots,`item`,{item:r,category:e,selected:s.value===r.id,disabled:H(r),select:()=>Q(r)},()=>[V(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(V(r)),(0,t.mergeProps)({key:0,ref_for:!0},r.componentProps,{item:r,category:e,selected:s.value===r.id,disabled:H(r)}),null,16,[`item`,`category`,`selected`,`disabled`])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview`,{"ml-ribbon-gallery__preview--icon":B(r)||X(r),"ml-ribbon-gallery__preview--svg":Z(r)}])},[B(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-gallery__preview-icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(B(r))))]),_:2},1024)):X(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview-icon ml-ribbon-gallery__preview-icon--class`,X(r)]),"aria-hidden":`true`},null,2)):Z(r)&&Pe(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:2,class:`ml-ribbon-gallery__preview-svg`,src:Z(r)??``,alt:``},null,8,ge)):Z(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,q,[(0,t.createElementVNode)(`use`,{href:Z(r)??``},null,8,_e)])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createTextVNode)((0,t.toDisplayString)(Fe(r)),1)],64))],2),(0,t.createElementVNode)(`div`,ve,(0,t.toDisplayString)(r.label),1)],64))])],10,he))),128))],4)]))),128)),j.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ye,[(0,t.createElementVNode)(`button`,{type:`button`,class:`ml-ribbon-gallery__control-button`,disabled:e.disabled||!D.value,"aria-label":`Show previous gallery row`,onClick:a[1]||=e=>R(-1)},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.ArrowUp))]),_:1})],8,J),(0,t.createElementVNode)(`button`,{type:`button`,class:`ml-ribbon-gallery__control-button`,disabled:e.disabled||!O.value,"aria-label":`Show next gallery row`,onClick:a[2]||=e=>R(1)},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.ArrowDown))]),_:1})],8,be),(0,t.createVNode)((0,t.unref)(n.ElPopover),{visible:c.value,"onUpdate:visible":a[3]||=e=>c.value=e,trigger:`click`,placement:`bottom-start`,disabled:e.disabled,width:P.value,"popper-class":M.value,"popper-options":ee.value},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{ref_key:`inlineMoreButtonRef`,ref:d,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__control-button ml-ribbon-gallery__more-button`,{"is-open":c.value}]),disabled:e.disabled,"aria-label":`Show more gallery items`,onClick:ne},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.Bottom))]),_:1})],10,xe)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{ref_key:`inlinePanelRef`,ref:f,class:`ml-ribbon-gallery__panel`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.categories,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-gallery__panel-category`},[I(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`h4`,Se,(0,t.toDisplayString)(e.title),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:`ml-ribbon-gallery__panel-grid`,style:(0,t.normalizeStyle)(N.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,r=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:r.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__item ml-ribbon-gallery__panel-item`,{"is-selected":s.value===r.id}]),"data-gallery-row-index":z(r),disabled:H(r),onClick:e=>Q(r)},[(0,t.renderSlot)(i.$slots,`item`,{item:r,category:e,selected:s.value===r.id,disabled:H(r),select:()=>Q(r)},()=>[V(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(V(r)),(0,t.mergeProps)({key:0,ref_for:!0},r.componentProps,{item:r,category:e,selected:s.value===r.id,disabled:H(r)}),null,16,[`item`,`category`,`selected`,`disabled`])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview`,{"ml-ribbon-gallery__preview--icon":B(r)||X(r),"ml-ribbon-gallery__preview--svg":Z(r)}])},[B(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-gallery__preview-icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(B(r))))]),_:2},1024)):X(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview-icon ml-ribbon-gallery__preview-icon--class`,X(r)]),"aria-hidden":`true`},null,2)):Z(r)&&Pe(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:2,class:`ml-ribbon-gallery__preview-svg`,src:Z(r)??``,alt:``},null,8,Ce)):Z(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,we,[(0,t.createElementVNode)(`use`,{href:Z(r)??``},null,8,Te)])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createTextVNode)((0,t.toDisplayString)(Fe(r)),1)],64))],2),(0,t.createElementVNode)(`div`,Ee,(0,t.toDisplayString)(r.label),1)],64))])],10,Y))),128))],4)]))),128))],512)]),_:3},8,[`visible`,`disabled`,`width`,`popper-class`,`popper-options`])])):(0,t.createCommentVNode)(``,!0)]))],2))}}),Z=[`data-id`,`onKeydown`],Ne={key:0,class:`ml-ribbon-input-number__prefix`},Pe={key:2,class:`ml-ribbon-input-number__prefix-label`},Fe=(0,t.defineComponent)({name:`MlRibbonInputNumber`,__name:`RibbonInputNumber`,props:{id:{},modelValue:{default:void 0},width:{default:`96px`},prefixLabel:{default:void 0},prefixIcon:{default:void 0},prefixIconClass:{default:void 0},controlProps:{default:()=>({})},disabled:{type:Boolean,default:!1}},emits:[`change`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.computed)(()=>x(i.width,`96px`)),s=(0,t.computed)(()=>o.value===`100%`),c=(0,t.computed)(()=>s.value?{width:`100%`}:{}),l=(0,t.computed)(()=>s.value?{}:{width:o.value}),u=(0,t.computed)(()=>b(i.prefixLabel)),d=(0,t.computed)(()=>!i.prefixIcon||typeof i.prefixIcon==`string`?null:i.prefixIcon),f=(0,t.computed)(()=>b(i.prefixIconClass??(typeof i.prefixIcon==`string`?i.prefixIcon:void 0))??null),p=(0,t.computed)(()=>!!(u.value||d.value||f.value)),m=(0,t.computed)(()=>u.value??i.id),h=(0,t.ref)(void 0);function g(e){v(e)}function _(e){e.preventDefault(),e.stopPropagation();let t=e.target;if(!(t instanceof HTMLInputElement))return;let n=y(t.value);n===void 0&&t.value.trim().length>0||v(n)}function v(e){Object.is(h.value,e)||(h.value=e,a(`change`,e))}function y(e){let t=e.trim();if(!t)return;let n=Number(t);return Number.isFinite(n)?n:void 0}function b(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function x(e,t){if(typeof e==`number`&&Number.isFinite(e)&&e>0)return`${e}px`;if(typeof e==`string`){let n=e.trim();return n?n.toLowerCase()===`full`?`100%`:n:t}return t}return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-input-number`,{"has-prefix":p.value,"is-full":s.value}]),style:(0,t.normalizeStyle)(c.value),"data-id":e.id,onKeydown:(0,t.withKeys)((0,t.withModifiers)(_,[`stop`,`prevent`]),[`enter`])},[p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Ne,[d.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-input-number__prefix-icon`,"aria-hidden":`true`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(d.value)))]),_:1})):f.value?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-input-number__prefix-icon ml-ribbon-input-number__prefix-icon--class`,f.value]),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0),u.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Pe,(0,t.toDisplayString)(u.value),1)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.ElInputNumber),(0,t.mergeProps)(e.controlProps,{"model-value":e.modelValue,disabled:e.disabled,style:l.value,"aria-label":m.value,onChange:g}),null,16,[`model-value`,`disabled`,`style`,`aria-label`])],46,Z))}}),Q=[`data-id`],Ie={key:0,class:`ml-ribbon-segmented__label`},Le=[`data-option-value`,`aria-label`],Re={key:2,class:`ml-ribbon-segmented__option-label`},ze={key:3,class:`ml-ribbon-segmented__option-sr-label`},Be=(0,t.defineComponent)({__name:`RibbonSegmented`,props:{id:{},label:{default:``},options:{},modelValue:{type:[String,Number,Boolean],default:void 0},direction:{default:`horizontal`},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},tooltipShowAfter:{default:1e3},tooltipHideAfter:{default:0}},emits:[`change`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.computed)(()=>i.label?.trim()??``),s=(0,t.computed)(()=>!i.hideLabel&&o.value.length>0);function c(e){return e}function l(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function u(e){if(typeof e==`string`){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim();return t?t.replace(/\b\w/g,e=>e.toUpperCase()):void 0}if(typeof e==`number`||typeof e==`boolean`)return String(e)}function d(e){let t=c(e);return t.label?.trim()||String(t.value)}function f(e){let t=c(e);return l(t.tooltip)??l(t.label)??u(t.value)}function p(e){let t=c(e).icon;return t&&typeof t!=`string`?t:null}function m(e){let t=c(e).iconClass;if(typeof t==`string`&&t.trim())return t;let n=c(e).icon;return typeof n==`string`&&n.trim()?n.trim():null}function h(e){return!p(e)&&!m(e)}function g(e){return String(c(e).value)}function _(e){return f(e)??g(e)}function v(e){a(`change`,e)}return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ml-ribbon-segmented`,"data-id":e.id},[s.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ie,(0,t.toDisplayString)(o.value),1)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.ElSegmented),{class:`ml-ribbon-segmented__control`,options:e.options,"model-value":e.modelValue,direction:e.direction,block:e.block,disabled:e.disabled,"aria-label":o.value||e.id,onChange:v},{default:(0,t.withCtx)(({item:r})=>[(0,t.createVNode)((0,t.unref)(n.ElTooltip),{content:f(r),disabled:!f(r),"show-after":e.tooltipShowAfter,"hide-after":e.tooltipHideAfter,placement:`top`,effect:`dark`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,{class:`ml-ribbon-segmented__option`,"data-option-value":g(r),"aria-label":_(r)},[p(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-segmented__option-icon`,"aria-hidden":`true`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(p(r))))]),_:2},1024)):m(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-segmented__option-icon ml-ribbon-item-host__icon--class`,m(r)]),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0),h(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Re,(0,t.toDisplayString)(d(r)),1)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ze,(0,t.toDisplayString)(d(r)),1))],8,Le)]),_:2},1032,[`content`,`disabled`,`show-after`,`hide-after`])]),_:1},8,[`options`,`model-value`,`direction`,`block`,`disabled`,`aria-label`])],8,Q))}}),Ve=(0,t.defineComponent)({__name:`RibbonToggleButton`,props:{id:{},label:{default:``},modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},activeIcon:{default:void 0},inactiveIcon:{default:void 0},activeLabel:{default:void 0},inactiveLabel:{default:void 0}},emits:[`change`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(!!r.modelValue);(0,t.watch)(()=>r.modelValue,e=>{a.value=!!e},{immediate:!0});let o=(0,t.computed)(()=>a.value),s=(0,t.computed)(()=>o.value?r.activeIcon??r.inactiveIcon:r.inactiveIcon??r.activeIcon),c=(0,t.computed)(()=>(o.value?r.activeLabel?.trim():r.inactiveLabel?.trim())||r.label?.trim()||r.id),l=(0,t.computed)(()=>!r.hideLabel&&c.value.length>0);function u(){if(r.disabled)return;let e=!a.value;a.value=e,i(`change`,e)}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(N,{id:e.id,class:(0,t.normalizeClass)([`ml-ribbon-toggle`,{"is-active":o.value}]),icon:s.value,label:c.value,disabled:e.disabled,"hide-label":!l.value,"aria-label":c.value,"aria-pressed":String(o.value),onClick:u},null,8,[`id`,`class`,`icon`,`label`,`disabled`,`hide-label`,`aria-label`,`aria-pressed`]))}}),He=[`data-template-id`,`aria-disabled`],Ue=(0,t.defineComponent)({__name:`RibbonTemplateItem`,props:{id:{},item:{},disabled:{type:Boolean}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ml-ribbon-template-item`,"data-template-id":e.id,"aria-disabled":e.disabled},[(0,t.renderSlot)(n.$slots,`default`,{item:e.item,disabled:e.disabled},()=>[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.item.label??e.item.id),1)])],8,He))}}),We=[`data-item-id`],Ge={key:0,class:`ml-ribbon-item-host__keytip`},Ke=(0,t.defineComponent)({__name:`RibbonItemHost`,props:{id:{},item:{},groupId:{},galleryPreviewFallback:{},disabled:{type:Boolean}},emits:[`item-click`],setup(e,{emit:r}){let a=e,o=r,s=(0,t.inject)(i,null),c=(0,t.computed)(()=>Array.isArray(a.item.props?.options)?a.item.props.options:[]),l=(0,n.useGlobalConfig)(`size`,``),u=(0,t.computed)(()=>l.value||`default`),d=(0,t.computed)(()=>me(s?.tooltipShowAfter.value,1e3)),f=(0,t.computed)(()=>me(s?.tooltipHideAfter.value,0)),p=(0,t.computed)(()=>`ml-ribbon-select-dropdown ml-ribbon-popper ml-ribbon-popper--size-${u.value}`),m=(0,t.computed)(()=>a.item.props?.icon||a.item.icon),h=(0,t.computed)(()=>a.item.hideLabel!==!0),g=(0,t.ref)(void 0),_=(0,t.computed)(()=>a.item.type===`dropdown`&&g.value?g.value:pe(a.item.tooltip)??pe(a.item.label)??ve(a.item)??ye(a.item.id)),v=(0,t.computed)(()=>a.item.type!==`buttonGroup`&&a.item.type!==`segmented`),y=(0,t.computed)(()=>!v.value||!_.value),b=(0,t.computed)(()=>_.value??a.item.id),x=(0,t.computed)(()=>a.item.keyTip?.trim().toUpperCase()??``),S=(0,t.computed)(()=>{if(!s?.keyTipsOpen.value||s?.disabled.value||a.disabled===!0||!x.value)return!1;let e=s.keyTipsSequence.value.toLowerCase();return e?x.value.toLowerCase().startsWith(e):!0}),C=(0,t.computed)(()=>a.disabled===!0||a.item.disabled===!0||s?.disabled.value===!0),w=(0,t.computed)(()=>a.item.props?.modelValue),T=(0,t.computed)(()=>a.item.props?.activeLabel),E=(0,t.computed)(()=>a.item.props?.inactiveLabel),D=(0,t.computed)(()=>Array.isArray(a.item.props?.categories)?a.item.props.categories:[]),O=(0,t.computed)(()=>{let e=a.item.props?.modelValue;return typeof e==`string`?e:void 0}),k=(0,t.computed)(()=>{let e=a.item.props?.inlineItemLimit;return typeof e==`number`?e:void 0}),A=(0,t.computed)(()=>a.item.props?.inlineItemWidthMode===`auto`?`auto`:`fixed`),j=(0,t.computed)(()=>{let e=a.item.props?.component;return!e||typeof e==`string`?null:(0,t.markRaw)((0,t.toRaw)(e))}),M=(0,t.computed)(()=>{let e=a.item.props?.componentProps;return!e||typeof e!=`object`||Array.isArray(e)?{}:e}),P=(0,t.computed)(()=>a.item.props?.wrap!==!1),ee=(0,t.computed)(()=>a.item.props?.equalWidth===!0),F=(0,t.computed)(()=>{let e=a.item.props?.buttonSize;if(e===`large`||e===`default`||e===`small`)return e}),L=(0,t.computed)(()=>q(a.item.props?.iconSize)),R=(0,t.computed)(()=>he(a.item.props?.width??a.item.props?.comboWidth,`92px`)),z=(0,t.computed)(()=>a.item.props?.modelValue),te=(0,t.computed)(()=>he(a.item.props?.width??a.item.props?.inputNumberWidth,`96px`)),ne=(0,t.computed)(()=>a.item.props?.modelValue),re=(0,t.computed)(()=>{let e={...a.item.props??{}};return delete e.modelValue,delete e.width,delete e.inputNumberWidth,delete e.prefixLabel,delete e.prefixIcon,delete e.prefixIconClass,delete e.emitValueOnChange,delete e.valuePrefix,delete e.options,delete e.component,delete e.componentProps,e}),B=(0,t.computed)(()=>_e(a.item.props?.labelWrapLines)),V=(0,t.computed)(()=>ge(a.item.props?.labelWrapWidth)),ie=(0,t.computed)(()=>a.item.type===`button`&&a.item.size===`large`&&h.value&&(B.value??0)>1),ae=(0,t.computed)(()=>{if(!ie.value)return{};let e={"--ml-rb-item-label-max-lines":String(B.value??2)};return V.value&&(e[`--ml-rb-item-label-wrap-width`]=V.value),e});(0,t.watch)(()=>a.item.id,()=>{g.value=void 0});function U(){C.value||o(`item-click`,a.id)}function oe(e){if(!C.value){if(typeof e==`string`||typeof e==`number`){o(`item-click`,String(e));return}U()}}function se(e){g.value=e}function ce(e){if(!C.value){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){o(`item-click`,String(e));return}U()}}function le(e){if(C.value)return;let t=e?a.item.props?.activeValue:a.item.props?.inactiveValue;if(typeof t==`string`||typeof t==`number`||typeof t==`boolean`){o(`item-click`,String(t));return}o(`item-click`,String(e))}function W(e){if(!C.value){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){o(`item-click`,String(e));return}U()}}function G(e){C.value||o(`item-click`,e)}function K(e){if(!C.value){if(a.item.props?.emitValueOnChange===!0&&(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)){o(`item-click`,String(e));return}U()}}function ue(e){if(!C.value){if(a.item.props?.emitValueOnChange===!0&&typeof e==`number`&&Number.isFinite(e)){let t=a.item.props?.valuePrefix;o(`item-click`,`${typeof t==`string`?t:``}${e}`);return}U()}}function de(e){if(!C.value){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){o(`item-click`,String(e));return}U()}}function fe(e){if(!e||typeof e!=`object`)return;let t=e.label;return typeof t==`string`?t:void 0}function pe(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function me(e,t){return typeof e!=`number`||Number.isNaN(e)||!Number.isFinite(e)?t:Math.max(0,Math.round(e))}function he(e,t){if(typeof e==`number`&&Number.isFinite(e)&&e>0)return`${e}px`;if(typeof e==`string`){let n=e.trim();return n?n.toLowerCase()===`full`?`100%`:n:t}return t}function ge(e){if(typeof e==`number`&&Number.isFinite(e)&&e>0)return`${e}px`;if(typeof e==`string`){let t=e.trim();return t?t.toLowerCase()===`full`?`100%`:t:void 0}}function q(e){if(typeof e==`number`&&Number.isFinite(e)&&e>0)return`${e}px`;if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function _e(e){if(!(typeof e!=`number`||Number.isNaN(e)||!Number.isFinite(e)))return Math.max(1,Math.round(e))}function ve(e){let t=c.value.map(e=>fe(e)).filter(e=>!!e);if(t.length)return e.type===`buttonGroup`?t.join(` / `):t[0]}function ye(e){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim();return t?t.replace(/\b\w/g,e=>e.toUpperCase()):e}return(r,i)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{content:_.value,disabled:y.value,"show-after":d.value,"hide-after":f.value,placement:`top`,effect:`dark`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-item-host`,[`is-${e.item.size??`medium`}`,`type-${e.item.type}`,{"is-label-hidden":e.item.hideLabel===!0,"is-label-wrap":ie.value}]]),style:(0,t.normalizeStyle)(ae.value),"data-item-id":e.id,role:`group`},[S.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Ge,(0,t.toDisplayString)(x.value),1)):(0,t.createCommentVNode)(``,!0),e.item.type===`buttonGroup`?((0,t.openBlock)(),(0,t.createBlock)(I,{key:1,id:e.item.id,label:e.item.label??``,options:e.item.props?.options??[],"hide-label":e.item.hideLabel===!0,wrap:P.value,"equal-width":ee.value,"button-size":F.value,"icon-size":L.value,"tooltip-show-after":d.value,"tooltip-hide-after":f.value,disabled:C.value,onChange:W},null,8,[`id`,`label`,`options`,`hide-label`,`wrap`,`equal-width`,`button-size`,`icon-size`,`tooltip-show-after`,`tooltip-hide-after`,`disabled`])):e.item.type===`segmented`?((0,t.openBlock)(),(0,t.createBlock)(Be,{key:2,id:e.item.id,label:e.item.label??e.item.id,options:e.item.props?.options??[],"model-value":e.item.props?.modelValue,direction:e.item.props?.direction??`horizontal`,block:e.item.props?.block===!0,disabled:C.value,"hide-label":e.item.hideLabel===!0,"tooltip-show-after":d.value,"tooltip-hide-after":f.value,onChange:ce},null,8,[`id`,`label`,`options`,`model-value`,`direction`,`block`,`disabled`,`hide-label`,`tooltip-show-after`,`tooltip-hide-after`])):e.item.type===`toggle`?((0,t.openBlock)(),(0,t.createBlock)(Ve,{key:3,id:e.item.id,label:e.item.label??e.item.id,"model-value":w.value,"active-icon":e.item.props?.activeIcon??e.item.props?.icon??e.item.icon,"inactive-icon":e.item.props?.inactiveIcon??e.item.props?.icon??e.item.icon,"active-label":T.value,"inactive-label":E.value,disabled:C.value,"hide-label":e.item.hideLabel===!0,onChange:le},null,8,[`id`,`label`,`model-value`,`active-icon`,`inactive-icon`,`active-label`,`inactive-label`,`disabled`,`hide-label`])):e.item.type===`gallery`?((0,t.openBlock)(),(0,t.createBlock)(X,{key:4,id:e.item.id,label:e.item.label??``,categories:D.value,"model-value":O.value,collapsed:e.item.props?.collapsed===!0,"inline-item-limit":k.value,"inline-item-width-mode":A.value,"preview-fallback":a.galleryPreviewFallback,disabled:C.value,onSelect:G},null,8,[`id`,`label`,`categories`,`model-value`,`collapsed`,`inline-item-limit`,`inline-item-width-mode`,`preview-fallback`,`disabled`])):e.item.type===`custom`||e.item.type===`template`?((0,t.openBlock)(),(0,t.createBlock)(Ue,{key:5,id:e.item.id,item:e.item,disabled:C.value},{default:(0,t.withCtx)(()=>[j.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(j.value),(0,t.mergeProps)({key:0},M.value,{item:e.item,"group-id":e.groupId,disabled:C.value,"emit-item-click":de}),null,16,[`item`,`group-id`,`disabled`])):(0,t.renderSlot)(r.$slots,`template`,{key:1,item:e.item,disabled:C.value})]),_:3},8,[`id`,`item`,`disabled`])):e.item.type===`dropdown`?((0,t.openBlock)(),(0,t.createBlock)(H,{key:6,id:e.item.id,label:e.item.label??e.item.id,tooltip:e.item.tooltip,icon:m.value,options:e.item.props?.options??[],"model-value":e.item.props?.modelValue,disabled:C.value,"hide-label":e.item.hideLabel===!0,"item-size":e.item.size??`medium`,"sync-label-with-selection":e.item.props?.syncLabelWithSelection===!0,"tooltip-show-after":d.value,"tooltip-hide-after":f.value,onCommand:oe,onTooltipChange:se,onClick:U},null,8,[`id`,`label`,`tooltip`,`icon`,`options`,`model-value`,`disabled`,`hide-label`,`item-size`,`sync-label-with-selection`,`tooltip-show-after`,`tooltip-hide-after`])):e.item.type===`checkbox`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElCheckbox),{key:7,disabled:C.value,onChange:U},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.item.label),1)]),_:1},8,[`disabled`])):e.item.type===`colorPicker`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElColorPicker),{key:8,disabled:C.value,onChange:U},null,8,[`disabled`])):e.item.type===`comboBox`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElSelect),{key:9,"model-value":z.value,disabled:C.value,"popper-class":p.value,style:(0,t.normalizeStyle)({width:R.value}),onChange:K},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElOption),{key:String(e.value),label:String(e.label),value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`disabled`,`popper-class`,`style`])):e.item.type===`inputNumber`?((0,t.openBlock)(),(0,t.createBlock)(Fe,{key:10,id:e.item.id,"model-value":ne.value,width:te.value,"prefix-label":e.item.props?.prefixLabel,"prefix-icon":e.item.props?.prefixIcon??e.item.props?.icon??e.item.icon,"prefix-icon-class":e.item.props?.prefixIconClass,"control-props":re.value,disabled:C.value,onChange:ue},null,8,[`id`,`model-value`,`width`,`prefix-label`,`prefix-icon`,`prefix-icon-class`,`control-props`,`disabled`])):((0,t.openBlock)(),(0,t.createBlock)(N,{key:11,id:e.item.id,label:e.item.label??e.item.id,icon:m.value,disabled:C.value,"hide-label":!h.value,"aria-label":b.value,onClick:U},null,8,[`id`,`label`,`icon`,`disabled`,`hide-label`,`aria-label`]))],14,We)]),_:3},8,[`content`,`disabled`,`show-after`,`hide-after`]))}}),$=(0,t.defineComponent)({__name:`RibbonGroupContent`,props:{group:{},galleryPreviewFallback:{},disabled:{type:Boolean}},emits:[`item-click`],setup(e,{emit:n}){let r=e,i=n;return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-group__content`,[`ml-ribbon-group__content--${r.group.orientation??`column`}`]])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.group.collections??[],e=>((0,t.openBlock)(),(0,t.createBlock)(j,{id:e.id,key:e.id,layout:e.layout??(r.group.orientation===`row`?`row`:`column`),rows:e.rows},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createBlock)(Ke,{id:e.id,key:e.id,item:e,"group-id":r.group.id,"gallery-preview-fallback":r.galleryPreviewFallback,disabled:r.disabled,onItemClick:n[0]||=e=>i(`item-click`,{groupId:r.group.id,itemId:e})},null,8,[`id`,`item`,`group-id`,`gallery-preview-fallback`,`disabled`]))),128))]),_:2},1032,[`id`,`layout`,`rows`]))),128))],2))}}),qe=[`data-priority`],Je={class:`ml-ribbon-group__body`},Ye={class:`ml-ribbon-group__footer`},Xe={class:`ml-ribbon-group__title`},Ze=[`aria-label`,`aria-expanded`,`disabled`],Qe={class:`ml-ribbon-group__overflow-content`},$e=[`aria-label`,`aria-expanded`,`disabled`],et={class:`ml-ribbon-group__overflow-content`},tt=(0,t.defineComponent)({__name:`RibbonGroup`,props:{id:{},title:{},icon:{},groupIconCss:{},orientation:{},width:{},priority:{},launcher:{type:Boolean},showLauncherIcon:{type:Boolean},groupModel:{},overflowTriggerAriaLabel:{},galleryPreviewFallback:{},disabled:{type:Boolean}},emits:[`item-click`],setup(e,{emit:a}){let o=e,s=a,c=(0,t.inject)(i,null),l=(0,t.computed)(()=>o.width==null),u=(0,t.computed)(()=>{if(typeof o.width!=`number`||Number.isNaN(o.width)||o.width<=0)return;let e=`${o.width}px`;return{width:e,minWidth:e,maxWidth:e,flex:`0 0 ${e}`}}),d=(0,t.computed)(()=>o.disabled===!0||c?.disabled.value===!0),f=(0,t.ref)(null),p=(0,t.ref)([]),m=(0,t.ref)(null),h=(0,t.ref)(null),g=(0,t.ref)(0),_=(0,t.ref)(0),v=(0,n.useGlobalConfig)(`size`,``),y=(0,t.computed)(()=>v.value||`default`),b=(0,t.computed)(()=>`ml-ribbon-group__overflow-popover ml-ribbon-group__overflow-popover--size-${y.value}`),x=(0,t.computed)(()=>({modifiers:[{name:`offset`,options:{offset:[g.value,8]}}]})),S=(0,t.computed)(()=>({modifiers:[{name:`offset`,options:{offset:[_.value,8]}}]})),C=(0,t.computed)(()=>!o.icon||typeof o.icon==`string`?null:o.icon),w=(0,t.computed)(()=>p.value.length>0),T=(0,t.computed)(()=>(o.groupModel?.footerMenuItems?.length??0)>0),E=(0,t.ref)(!1),D=(0,t.ref)(!1),O=(0,t.computed)(()=>{if(!o.groupModel||!p.value.length)return null;let e=new Set(p.value),t=o.groupModel.collections?.map(t=>({...t,items:t.items.filter(t=>e.has(t.id))})).filter(e=>e.items.length>0)??[];return t.length?{...o.groupModel,collections:t}:null}),k=(0,t.computed)(()=>o.groupModel?.footerMenuItems?.length?{id:`${o.groupModel.id}-footer-menu`,title:``,orientation:`row`,collections:[{id:`${o.groupModel.id}-footer-menu-collection`,layout:`row`,items:o.groupModel.footerMenuItems}]}:null);function A(){let e=f.value?.querySelector(`.ml-ribbon-group__content`);if(!e){p.value.length>0&&(p.value=[]);return}let t=e.getBoundingClientRect();if(t.width<=0||t.height<=0){p.value.length>0&&(p.value=[]);return}let n=[];e.querySelectorAll(`.ml-ribbon-item-host[data-item-id]`).forEach(e=>{let r=e.dataset.itemId;if(!r)return;let i=e.getBoundingClientRect();(i.right-t.right>.5||i.bottom-t.bottom>.5||t.left-i.left>.5||t.top-i.top>.5)&&n.push(r)}),p.value.length===n.length&&p.value.every((e,t)=>e===n[t])||(p.value=n)}function j(){(0,t.nextTick)(()=>{z(),M(),N(),A()})}function M(){let e=f.value?.getBoundingClientRect(),t=m.value?.getBoundingClientRect();if(!e||!t){g.value!==0&&(g.value=0);return}let n=Math.round(e.left-t.left);g.value!==n&&(g.value=n)}function N(){let e=f.value?.getBoundingClientRect(),t=h.value?.getBoundingClientRect();if(!e||!t){_.value!==0&&(_.value=0);return}let n=Math.round(e.left-t.left);_.value!==n&&(_.value=n)}function P(e){E.value=e}function ee(e){D.value=e}function F(){d.value||(E.value=!E.value)}function I(){d.value||(D.value=!D.value)}let L=null,R=null;function z(){if(!L)return;let e=f.value?.querySelector(`.ml-ribbon-group__content`)??null;R!==e&&(R&&L.unobserve(R),e&&L.observe(e),R=e)}return(0,t.watch)(()=>o.groupModel,()=>{j()},{deep:!0}),(0,t.watch)(d,e=>{e&&(E.value=!1,D.value=!1)}),(0,t.onMounted)(()=>{typeof ResizeObserver<`u`&&(L=new ResizeObserver(()=>{M(),N(),A()}),f.value&&L.observe(f.value),z()),j()}),(0,t.onUnmounted)(()=>{L?.disconnect()}),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{ref_key:`groupSectionRef`,ref:f,class:(0,t.normalizeClass)([`ml-ribbon-group`,{"ml-ribbon-group--auto-width":l.value}]),"data-priority":e.priority??100,style:(0,t.normalizeStyle)(u.value)},[(0,t.createElementVNode)(`div`,Je,[(0,t.renderSlot)(i.$slots,`default`)]),(0,t.createElementVNode)(`footer`,Ye,[C.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-group__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(C.value)))]),_:1})):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,Xe,(0,t.toDisplayString)(e.title),1),T.value&&k.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:1,trigger:`click`,placement:`bottom-start`,disabled:d.value,"popper-class":b.value,"popper-options":S.value,onShow:a[1]||=e=>P(!0),onHide:a[2]||=e=>P(!1)},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{ref_key:`footerTriggerRef`,ref:h,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-group__footer-trigger`,{"is-open":E.value}]),"aria-label":e.overflowTriggerAriaLabel,"aria-expanded":E.value,disabled:d.value,onClick:F},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(E.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1})],10,Ze)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Qe,[(0,t.createVNode)($,{group:k.value,"gallery-preview-fallback":e.galleryPreviewFallback,disabled:d.value,onItemClick:a[0]||=e=>s(`item-click`,e)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])])]),_:1},8,[`disabled`,`popper-class`,`popper-options`])):(0,t.createCommentVNode)(``,!0),w.value&&O.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:2,trigger:`click`,placement:`bottom-start`,disabled:d.value,"popper-class":b.value,"popper-options":x.value,onShow:a[4]||=e=>ee(!0),onHide:a[5]||=e=>ee(!1)},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{ref_key:`overflowTriggerRef`,ref:m,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-group__overflow-trigger`,{"is-open":D.value}]),"aria-label":e.overflowTriggerAriaLabel,"aria-expanded":D.value,disabled:d.value,onClick:I},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(D.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1})],10,$e)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,et,[(0,t.createVNode)($,{group:O.value,"gallery-preview-fallback":e.galleryPreviewFallback,disabled:d.value,onItemClick:a[3]||=e=>s(`item-click`,e)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])])]),_:1},8,[`disabled`,`popper-class`,`popper-options`])):(0,t.createCommentVNode)(``,!0),e.showLauncherIcon??e.launcher?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElButton),{key:3,link:``,class:`ml-ribbon-group__launcher`,disabled:d.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.Promotion))]),_:1})]),_:1},8,[`disabled`])):(0,t.createCommentVNode)(``,!0)])],14,qe))}}),nt=[`inert`,`aria-disabled`],rt={class:`ml-ribbon__head-left`},it={class:`ml-ribbon__head-right`},at={key:2,class:`ml-ribbon__tabs-extra`},ot=[`data-active-tab`],st={key:0,class:`ml-ribbon-group ml-ribbon-group--overflow`},ct={class:`ml-ribbon-group__body ml-ribbon-group__body--overflow`},lt=[`aria-label`,`disabled`],ut={class:`ml-ribbon-overflow-list`},dt={class:`ml-ribbon-overflow-group__header`},ft=[`data-active-tab`],pt=[`disabled`],mt={class:`ml-ribbon-simplified-group__panel`},ht=[`data-active-tab`],gt={key:0,class:`ml-ribbon-group ml-ribbon-group--overflow`},_t={class:`ml-ribbon-group__body ml-ribbon-group__body--overflow`},vt=[`aria-label`,`disabled`],yt={class:`ml-ribbon-overflow-list`},bt={class:`ml-ribbon-overflow-group__header`},xt=[`data-active-tab`],St=[`disabled`],Ct={class:`ml-ribbon-simplified-group__panel`},wt=40,Tt=(0,t.defineComponent)({__name:`Ribbon`,props:{id:{default:`ml-ribbon-root`},tabs:{},activeTab:{default:``},activeLayout:{default:void 0},layout:{default:`classic`},size:{default:void 0},minimized:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideLayoutSwitcher:{type:Boolean,default:!1},hideMinimizeButton:{type:Boolean,default:!1},hideKeyTipsToggle:{type:Boolean,default:!1},showFileMenu:{type:Boolean,default:!0},showOpenBackstage:{type:Boolean,default:!0},fileMenuItems:{default:()=>[]},texts:{default:()=>({})},tooltipShowAfter:{default:1e3},tooltipHideAfter:{default:0}},emits:[`update:activeTab`,`update:layout`,`update:minimized`,`tabChange`,`layoutChange`,`itemClick`,`overflowOpen`,`overflowClose`,`backstageOpen`,`backstageClose`,`fileMenuSelect`],setup(e,{expose:a,emit:o}){function s(e){return e==null||typeof e==`string`?e:typeof e==`object`||typeof e==`function`?(0,t.markRaw)((0,t.toRaw)(e)):e}function c(e){if(!e)return;let t={...e};return`component`in t&&(t.component=s(t.component)),`icon`in t&&(t.icon=s(t.icon)),`activeIcon`in t&&(t.activeIcon=s(t.activeIcon)),`inactiveIcon`in t&&(t.inactiveIcon=s(t.inactiveIcon)),Array.isArray(t.options)&&(t.options=t.options.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return`icon`in t?{...t,icon:s(t.icon)}:t})),Array.isArray(t.categories)&&(t.categories=t.categories.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return{...t,items:Array.isArray(t.items)?t.items.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return{...t,preview:s(t.preview),icon:s(t.icon),component:s(t.component)}}):t.items}})),t}function l(e){return{...e,icon:s(e.icon),props:c(e.props)}}function u(e){return{...e,icon:s(e.icon),footerMenuItems:e.footerMenuItems?.map(l),collections:e.collections?.map(e=>({...e,items:e.items?.map(l)}))}}function d(e){return e.map(e=>({...e,groups:e.groups?.map(u)}))}function f(e,t){return typeof e!=`number`||Number.isNaN(e)||!Number.isFinite(e)?t:Math.max(0,Math.round(e))}let m={layoutSwitcherTooltip:`Switch ribbon layout`,minimizeTooltip:`Minimize ribbon`,keyTipsToggleText:`Key Tips`,overflowTriggerAriaLabel:`Open overflow groups`,groupOverflowTriggerAriaLabel:`Open group menu`,fileMenuLabel:`File`,fileMenuOpenBackstageLabel:`Open backstage`,backstageBackLabel:`Back`,backstageTitle:`Backstage`,backstageDescription:`Manage your document and settings here.`,keyTipsSequencePrefix:`Sequence:`,keyTipsEmptySequence:`No key sequence`,galleryPreviewFallback:`Preview unavailable`},h=e,g=o,{context:_,visibleTabs:y}=p(h.id,h.tabs,h.disabled,h.activeLayout?String(h.activeLayout).toLowerCase()===`simplified`?`simplified`:`classic`:h.layout,h.minimized,h.activeTab||h.tabs[0]?.id||``,f(h.tooltipShowAfter,1e3),f(h.tooltipHideAfter,0));(0,t.provide)(i,_),(0,t.watch)(()=>h.tabs,e=>{_.tabs.value=d(e),_.tabs.value.some(e=>e.id===_.activeTab.value)||(_.activeTab.value=_.tabs.value[0]?.id||``)},{deep:!0}),(0,t.watch)(()=>h.layout,e=>{e!==_.layout.value&&(_.layout.value=e)}),(0,t.watch)(()=>h.activeLayout,e=>{if(!e)return;let t=String(e).toLowerCase()===`simplified`?`simplified`:`classic`;t!==_.layout.value&&(_.layout.value=t)}),(0,t.watch)(()=>h.minimized,e=>{e!==_.minimized.value&&(_.minimized.value=e)}),(0,t.watch)(()=>h.disabled,e=>{e!==_.disabled.value&&(_.disabled.value=e)}),(0,t.watch)(()=>h.activeTab,e=>{e&&e!==_.activeTab.value&&(_.activeTab.value=e)}),(0,t.watch)(()=>h.tooltipShowAfter,e=>{let t=f(e,1e3);t!==_.tooltipShowAfter.value&&(_.tooltipShowAfter.value=t)}),(0,t.watch)(()=>h.tooltipHideAfter,e=>{let t=f(e,0);t!==_.tooltipHideAfter.value&&(_.tooltipHideAfter.value=t)}),(0,t.watch)(_.activeTab,e=>{g(`update:activeTab`,e),g(`tabChange`,e)}),(0,t.watch)(_.layout,e=>{g(`update:layout`,e),g(`layoutChange`,e)}),(0,t.watch)(_.minimized,e=>{g(`update:minimized`,e)}),(0,t.watch)(_.overflowOpen,e=>{g(e?`overflowOpen`:`overflowClose`)}),(0,t.watch)(_.backdropOpen,e=>{g(e?`backstageOpen`:`backstageClose`)});let b=(0,t.computed)(()=>y.value.find(e=>e.id===_.activeTab.value)),x=(0,t.computed)(()=>new Set(y.value.filter(e=>e.contextual&&e.contextualMode===`exclusive`).map(e=>e.id))),S=(0,t.computed)(()=>ue(b.value)),C=(0,t.computed)(()=>b.value?.groups?.filter(e=>e.visible!==!1)??[]),w=(0,t.ref)(null),T=(0,t.ref)(null),D=(0,t.ref)(null),O=(0,t.ref)(null),k=(0,t.ref)(!1),j=(0,t.ref)(0),M=(0,t.ref)({left:`0px`,top:`0px`,width:`1px`,height:`0px`}),N=(0,t.ref)(new Set),P=(0,t.ref)({}),ee=(0,n.useGlobalConfig)(`size`,``),F=(0,t.computed)(()=>h.size||ee.value||`default`),I=(0,t.computed)(()=>`ml-ribbon-group-popover ml-ribbon-group-popover--size-${F.value}`),L=(0,t.computed)(()=>`ml-ribbon-overflow-popover ml-ribbon-overflow-popover--size-${F.value}`),R=(0,t.computed)(()=>`ml-ribbon-tab-panel-popover ml-ribbon-tab-panel-popover--size-${F.value}`),z=(0,t.computed)(()=>({layoutSwitcherTooltip:h.texts.layoutSwitcherTooltip||m.layoutSwitcherTooltip,minimizeTooltip:h.texts.minimizeTooltip||m.minimizeTooltip,keyTipsToggleText:h.texts.keyTipsToggleText||m.keyTipsToggleText,overflowTriggerAriaLabel:h.texts.overflowTriggerAriaLabel||m.overflowTriggerAriaLabel,groupOverflowTriggerAriaLabel:h.texts.groupOverflowTriggerAriaLabel||m.groupOverflowTriggerAriaLabel,fileMenuLabel:h.texts.fileMenuLabel||m.fileMenuLabel,fileMenuOpenBackstageLabel:h.texts.fileMenuOpenBackstageLabel||m.fileMenuOpenBackstageLabel,backstageBackLabel:h.texts.backstageBackLabel||m.backstageBackLabel,backstageTitle:h.texts.backstageTitle||m.backstageTitle,backstageDescription:h.texts.backstageDescription||m.backstageDescription,keyTipsSequencePrefix:h.texts.keyTipsSequencePrefix||m.keyTipsSequencePrefix,keyTipsEmptySequence:h.texts.keyTipsEmptySequence||m.keyTipsEmptySequence,galleryPreviewFallback:h.texts.galleryPreviewFallback||m.galleryPreviewFallback})),te=(0,t.computed)(()=>f(h.tooltipShowAfter,1e3)),ne=(0,t.computed)(()=>f(h.tooltipHideAfter,0)),re=(0,t.computed)(()=>_.minimized.value?r.ArrowUpBold:r.ArrowDownBold),B=(0,t.computed)(()=>C.value.filter(e=>!N.value.has(e.id))),V=(0,t.computed)(()=>C.value.filter(e=>N.value.has(e.id))),H=(0,t.computed)(()=>{if(!V.value.length)return 220;let e=V.value.reduce((e,t)=>{let n=P.value[t.id]??U(t);return Math.max(e,n)},0),t=Math.ceil(e+40);return Math.max(220,Math.min(720,t))});function ie(e){let t=(e.collections??[]).flatMap(e=>(e.items??[]).map(e=>({...l(e),size:`medium`})));return{...e,orientation:`row`,collections:[{id:`${e.id}-simplified`,layout:`row`,items:t}]}}function ae(e){return e.priority??100}function U(e){return typeof e.width==`number`&&Number.isFinite(e.width)&&e.width>0?e.width:140}function oe(e){let t={};return e.querySelectorAll(`.ml-ribbon-group`).forEach(e=>{let n=e.dataset.groupId;if(!n)return;let r=e.getBoundingClientRect().width;r>0&&(t[n]=r)}),t}function se(){let e=C.value.reduce((e,t)=>{let n=P.value[t.id]??U(t);return e+Math.max(n,U(t))},0);return Math.max(220,e)}function ce(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--ml-rb-overflow-slot-width`));return Number.isFinite(t)&&t>0?t:wt}function le(){if(_.layout.value!==`classic`){N.value=new Set;return}let e=_.minimized.value?O.value:D.value;if(!e)return;let t=C.value;if(!t.length){N.value=new Set;return}let n=Math.round(e.getBoundingClientRect().width),r=ce(e),i=oe(e);P.value={...P.value,...i};let a=t.filter(e=>e.enableGroupOverflow===!1),o=t.filter(e=>e.enableGroupOverflow!==!1).map((e,t)=>({group:e,index:t})),s=new Set,c=[...o].sort((e,t)=>{let n=ae(t.group)-ae(e.group);return n===0?t.index-e.index:n}),l=e=>i[e.id]??U(e),u=a.reduce((e,t)=>e+l(t),0),d=e=>o.filter(({group:t})=>!e.has(t.id)).reduce((e,{group:t})=>e+l(t),0),f=e=>u+d(e)+(e.size>0?r:0),p=0;for(;f(s)>n&&p<c.length;){let e=c[p].group;s.add(e.id),p+=1}N.value=s}function W(){(0,t.nextTick)(()=>{if(_.layout.value!==`classic`||_.minimized.value){le();return}if(N.value.size===0){le();return}N.value=new Set,(0,t.nextTick)(()=>{le()})})}function G(){let e=w.value,t=T.value;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=Number.parseFloat(getComputedStyle(e).borderLeftWidth||`0`)||0,a=Math.max(n.width-i*2,e.clientWidth,r.width,t.clientWidth);j.value=Math.round(a>0?a:_.layout.value===`classic`?se():Math.max(360,C.value.length*120)),M.value={left:`${Math.round(n.left-r.left+i)}px`,top:`0px`,width:`1px`,height:`${Math.round(r.height)}px`}}function K(){k.value=!1}function ue(e){return _.disabled.value?!0:!e||x.value.size===0?!1:!x.value.has(e.id)}function de(e){if(_.disabled.value)return;let t=_.activeTab.value===e.id;if(_.activeTab.value=e.id,!_.minimized.value){K();return}G(),k.value=t?!k.value:!0}function fe(){_.disabled.value||_.api.toggleSimplified()}function pe(){_.disabled.value||(_.minimized.value||K(),_.minimized.value=!_.minimized.value)}function me(e){_.disabled.value||(K(),g(`fileMenuSelect`,e))}function he(){_.disabled.value||(K(),_.backdropOpen.value=!0)}function ge(){_.disabled.value||(_.backdropOpen.value=!1)}function q(e,t){S.value||(g(`itemClick`,{tabId:_.activeTab.value,groupId:e,itemId:t}),_.minimized.value&&K())}function _e(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function ve(){if(S.value){_.keyTips.value=[];return}let e=b.value;if(!e?.groups?.length){_.keyTips.value=[];return}let t=e.groups.filter(e=>e.visible!==!1).flatMap(t=>(t.collections??[]).flatMap(n=>n.items.filter(e=>e.keyTip&&e.disabled!==!0).map(n=>{let r=n.keyTip?.trim().toUpperCase();return r?{id:`${e.id}:${t.id}:${n.id}`,key:r,targetId:n.id,sequence:r.split(``),scope:`item`}:null}).filter(e=>!!e)));_.keyTips.value=t}function ye(e){if(_.disabled.value)return;let t=b.value;if(t?.groups?.length){for(let n of t.groups)if(n.visible!==!1)for(let t of n.collections??[]){let r=t.items.find(t=>t.id===e.targetId&&t.disabled!==!0);if(r){q(n.id,r.id),_.keyTipsOpen.value=!1,_.keyTipsSequence.value=``;return}}}}function J(){_.keyTipsSequence.value=``}function be(e){if(!_.disabled.value&&!_e(e.target)){if(e.altKey&&!e.ctrlKey&&!e.metaKey&&e.key===`Alt`){e.preventDefault(),_.keyTipsOpen.value=!_.keyTipsOpen.value,_.keyTipsOpen.value||J();return}if(_.keyTipsOpen.value&&!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){e.preventDefault(),_.keyTipsOpen.value=!1,J();return}if(e.key===`Backspace`){e.preventDefault(),_.keyTipsSequence.value=_.keyTipsSequence.value.slice(0,-1);return}if(/^[a-z0-9]$/i.test(e.key)){e.preventDefault();let t=`${_.keyTipsSequence.value}${e.key.toUpperCase()}`;_.keyTipsSequence.value=t;let n=t.toLowerCase(),r=_.keyTips.value.find(e=>e.key.toLowerCase()===n);if(r){ye(r);return}_.keyTips.value.some(e=>e.key.toLowerCase().startsWith(n))||J()}}}}function xe(e){return e.icon&&typeof e.icon!=`string`?e.icon:e.groupIconCss?r.Grid:null}function Se(e){k.value=e}(0,t.watch)([C,()=>_.layout.value,()=>_.minimized.value],()=>{W()}),(0,t.watch)([b,()=>_.tabs.value,()=>_.disabled.value],()=>{ve(),J()},{deep:!0,immediate:!0}),(0,t.watch)(()=>_.keyTipsOpen.value,e=>{e||J()}),(0,t.watch)(()=>_.disabled.value,e=>{e&&(_.overflowOpen.value=!1,_.backdropOpen.value=!1,_.keyTipsOpen.value=!1,K(),J())}),(0,t.watch)([()=>_.minimized.value,()=>_.layout.value,b],([e,,t])=>{(!e||!t)&&K()}),(0,t.watch)([D,O],([e,t],[n,r])=>{n&&Y&&Y.unobserve(n),r&&Y&&Y.unobserve(r),e&&Y&&Y.observe(e),t&&Y&&Y.observe(t),(e||t)&&W()},{flush:`post`}),(0,t.watch)(k,e=>{e&&(0,t.nextTick)(()=>{G(),W()})});let Y=null;(0,t.onMounted)(()=>{window.addEventListener(`keydown`,be),window.addEventListener(`resize`,Ce),typeof ResizeObserver<`u`&&(Y=new ResizeObserver(()=>{G(),W()}),D.value&&Y.observe(D.value),O.value&&Y.observe(O.value)),G(),W()}),(0,t.onUnmounted)(()=>{window.removeEventListener(`keydown`,be),window.removeEventListener(`resize`,Ce),Y?.disconnect()});function Ce(){k.value&&G()}return a(_.api),(i,a)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElConfigProvider),{size:h.size},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{ref_key:`ribbonRootRef`,ref:w,key:(0,t.unref)(_).disabled.value?`ml-ribbon-disabled`:`ml-ribbon-enabled`,class:(0,t.normalizeClass)([`ml-ribbon`,[`ml-ribbon--${(0,t.unref)(_).layout.value}`,`ml-ribbon--size-${F.value}`,{"ml-ribbon--disabled":(0,t.unref)(_).disabled.value,"ml-ribbon--minimized":(0,t.unref)(_).minimized.value,"ml-ribbon--keytips-open":(0,t.unref)(_).keyTipsOpen.value}]]),inert:(0,t.unref)(_).disabled.value,"aria-disabled":(0,t.unref)(_).disabled.value},[(0,t.createElementVNode)(`header`,{ref_key:`ribbonHeaderRef`,ref:T,class:`ml-ribbon__header`},[(0,t.createElementVNode)(`div`,rt,[e.showFileMenu?((0,t.openBlock)(),(0,t.createBlock)(A,{key:0,items:e.fileMenuItems,disabled:(0,t.unref)(_).disabled.value,label:z.value.fileMenuLabel,"open-backstage-label":z.value.fileMenuOpenBackstageLabel,"show-open-backstage":e.showOpenBackstage,onSelect:me,onOpenBackstage:he},null,8,[`items`,`disabled`,`label`,`open-backstage-label`,`show-open-backstage`])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(E,{tabs:(0,t.unref)(y),"active-tab":(0,t.unref)(_).activeTab.value,disabled:(0,t.unref)(_).disabled.value,onSelect:de},null,8,[`tabs`,`active-tab`,`disabled`]),h.hideMinimizeButton?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{key:1,content:z.value.minimizeTooltip,"show-after":te.value,"hide-after":ne.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{class:(0,t.normalizeClass)([`ml-ribbon__control`,`ml-ribbon__control--minimize`,(0,t.unref)(_).minimized.value?`ml-ribbon__control--minimize-up`:`ml-ribbon__control--minimize-down`]),icon:re.value,disabled:(0,t.unref)(_).disabled.value,onClick:pe},null,8,[`class`,`icon`,`disabled`])]),_:1},8,[`content`,`show-after`,`hide-after`]))]),(0,t.createElementVNode)(`div`,it,[h.hideLayoutSwitcher?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{key:0,content:z.value.layoutSwitcherTooltip,"show-after":te.value,"hide-after":ne.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{circle:``,class:`ml-ribbon__control ml-ribbon__control--layout`,icon:(0,t.unref)(r.Menu),disabled:(0,t.unref)(_).disabled.value,onClick:fe},null,8,[`icon`,`disabled`])]),_:1},8,[`content`,`show-after`,`hide-after`])),h.hideKeyTipsToggle?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElSwitch),{key:1,"inline-prompt":``,class:`ml-ribbon__control ml-ribbon__control--keytips`,"active-text":z.value.keyTipsToggleText,"inactive-text":z.value.keyTipsToggleText,"model-value":(0,t.unref)(_).keyTipsOpen.value,disabled:(0,t.unref)(_).disabled.value,onChange:a[0]||=e=>(0,t.unref)(_).keyTipsOpen.value=!(0,t.unref)(_).keyTipsOpen.value},null,8,[`active-text`,`inactive-text`,`model-value`,`disabled`])),i.$slots[`tabs-extra`]?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,at,[(0,t.renderSlot)(i.$slots,`tabs-extra`,{activeTab:(0,t.unref)(_).activeTab.value,layout:(0,t.unref)(_).layout.value,minimized:(0,t.unref)(_).minimized.value,disabled:(0,t.unref)(_).disabled.value})])):(0,t.createCommentVNode)(``,!0)]),b.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:0,placement:`bottom-start`,visible:k.value,width:j.value||void 0,disabled:(0,t.unref)(_).disabled.value||!(0,t.unref)(_).minimized.value,"show-arrow":!1,offset:0,"popper-class":R.value,"onUpdate:visible":Se},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,{"aria-hidden":`true`,class:`ml-ribbon__minimized-anchor`,style:(0,t.normalizeStyle)(M.value)},null,4)]),default:(0,t.withCtx)(()=>[(0,t.unref)(_).layout.value===`classic`?((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:0,ref_key:`minimizedClassicPanelRef`,ref:O,class:`ml-ribbon__panel ml-ribbon__panel--floating`,"data-active-tab":b.value.id},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(B.value,e=>((0,t.openBlock)(),(0,t.createBlock)(tt,{id:e.id,key:e.id,"data-group-id":e.id,title:e.title,icon:e.icon,"group-icon-css":e.groupIconCss,orientation:e.orientation,width:e.width,priority:e.priority??100,launcher:e.launcher,"show-launcher-icon":e.showLauncherIcon,"group-model":e,"overflow-trigger-aria-label":z.value.groupOverflowTriggerAriaLabel,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[2]||=e=>q(e.groupId,e.itemId)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)($,{group:e,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[1]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])]),_:2},1032,[`id`,`data-group-id`,`title`,`icon`,`group-icon-css`,`orientation`,`width`,`priority`,`launcher`,`show-launcher-icon`,`group-model`,`overflow-trigger-aria-label`,`gallery-preview-fallback`,`disabled`]))),128)),V.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,st,[(0,t.createElementVNode)(`div`,ct,[(0,t.createVNode)((0,t.unref)(n.ElPopover),{trigger:`click`,placement:`bottom-end`,width:H.value,disabled:S.value,"show-arrow":!1,"popper-class":L.value,onShow:a[4]||=e=>(0,t.unref)(_).overflowOpen.value=!0,onHide:a[5]||=e=>(0,t.unref)(_).overflowOpen.value=!1},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:`ml-ribbon-overflow-trigger`,"aria-label":z.value.overflowTriggerAriaLabel,disabled:S.value},[...a[13]||=[(0,t.createElementVNode)(`span`,{class:`ml-ribbon-overflow-trigger__dots`},`...`,-1)]],8,lt)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ut,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(V.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-overflow-group`},[(0,t.createElementVNode)(`header`,dt,(0,t.toDisplayString)(e.title),1),(0,t.createVNode)($,{group:e,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[3]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])]))),128))])]),_:1},8,[`width`,`disabled`,`popper-class`])]),a[14]||=(0,t.createElementVNode)(`footer`,{class:`ml-ribbon-group__footer ml-ribbon-group__footer--overflow`},null,-1)])):(0,t.createCommentVNode)(``,!0)],8,ot)):((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:1,class:`ml-ribbon__panel ml-ribbon__panel--simplified ml-ribbon__panel--floating`,"data-active-tab":b.value.id},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(C.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:e.id,trigger:`click`,placement:`bottom-start`,width:340,disabled:S.value,"show-arrow":!1,"popper-class":I.value},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`ml-ribbon-simplified-group`,type:`button`,disabled:S.value},[xe(e)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-simplified-group__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(xe(e))))]),_:2},1024)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.title),1)],8,pt)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,mt,[(0,t.createVNode)($,{group:ie(e),"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[6]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])])]),_:2},1032,[`disabled`,`popper-class`]))),128))],8,ft))]),_:1},8,[`visible`,`width`,`disabled`,`popper-class`])):(0,t.createCommentVNode)(``,!0)],512),!(0,t.unref)(_).minimized.value&&b.value&&(0,t.unref)(_).layout.value===`classic`?((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:0,class:`ml-ribbon__panel`,"data-active-tab":b.value.id,ref_key:`classicPanelRef`,ref:D},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(B.value,e=>((0,t.openBlock)(),(0,t.createBlock)(tt,{id:e.id,key:e.id,"data-group-id":e.id,title:e.title,icon:e.icon,"group-icon-css":e.groupIconCss,orientation:e.orientation,width:e.width,priority:e.priority??100,launcher:e.launcher,"show-launcher-icon":e.showLauncherIcon,"group-model":e,"overflow-trigger-aria-label":z.value.groupOverflowTriggerAriaLabel,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[8]||=e=>q(e.groupId,e.itemId)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)($,{group:e,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[7]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])]),_:2},1032,[`id`,`data-group-id`,`title`,`icon`,`group-icon-css`,`orientation`,`width`,`priority`,`launcher`,`show-launcher-icon`,`group-model`,`overflow-trigger-aria-label`,`gallery-preview-fallback`,`disabled`]))),128)),V.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,gt,[(0,t.createElementVNode)(`div`,_t,[(0,t.createVNode)((0,t.unref)(n.ElPopover),{trigger:`click`,placement:`bottom-end`,width:H.value,disabled:S.value,"popper-class":L.value,onShow:a[10]||=e=>(0,t.unref)(_).overflowOpen.value=!0,onHide:a[11]||=e=>(0,t.unref)(_).overflowOpen.value=!1},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:`ml-ribbon-overflow-trigger`,"aria-label":z.value.overflowTriggerAriaLabel,disabled:S.value},[...a[15]||=[(0,t.createElementVNode)(`span`,{class:`ml-ribbon-overflow-trigger__dots`},`...`,-1)]],8,vt)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,yt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(V.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-overflow-group`},[(0,t.createElementVNode)(`header`,bt,(0,t.toDisplayString)(e.title),1),(0,t.createVNode)($,{group:e,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[9]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])]))),128))])]),_:1},8,[`width`,`disabled`,`popper-class`])]),a[16]||=(0,t.createElementVNode)(`footer`,{class:`ml-ribbon-group__footer ml-ribbon-group__footer--overflow`},null,-1)])):(0,t.createCommentVNode)(``,!0)],8,ht)):(0,t.createCommentVNode)(``,!0),!(0,t.unref)(_).minimized.value&&b.value&&(0,t.unref)(_).layout.value===`simplified`?((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:1,class:`ml-ribbon__panel ml-ribbon__panel--simplified`,"data-active-tab":b.value.id},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(C.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:e.id,trigger:`click`,placement:`bottom-start`,width:340,disabled:S.value,"popper-class":I.value},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`ml-ribbon-simplified-group`,type:`button`,disabled:S.value},[xe(e)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-simplified-group__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(xe(e))))]),_:2},1024)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.title),1)],8,St)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Ct,[(0,t.createVNode)($,{group:ie(e),"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[12]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])])]),_:2},1032,[`disabled`,`popper-class`]))),128))],8,xt)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(v,{open:(0,t.unref)(_).backdropOpen.value,size:F.value,"back-label":z.value.backstageBackLabel,title:z.value.backstageTitle,description:z.value.backstageDescription,onClose:ge},(0,t.createSlots)({_:2},[i.$slots.backstage?{name:`default`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(i.$slots,`backstage`,{close:ge,open:(0,t.unref)(_).backdropOpen.value,size:F.value,backLabel:z.value.backstageBackLabel,title:z.value.backstageTitle,description:z.value.backstageDescription,disabled:(0,t.unref)(_).disabled.value})]),key:`0`}:void 0]),1032,[`open`,`size`,`back-label`,`title`,`description`])],10,nt))]),_:3},8,[`size`]))}}),Et={class:`ml-ribbon-tab-definition`,hidden:``},Dt=(0,t.defineComponent)({__name:`RibbonTab`,props:{id:{},title:{},visible:{type:Boolean},contextual:{type:Boolean},contextualColor:{},contextualTitle:{}},setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Et,[(0,t.renderSlot)(e.$slots,`default`)]))}}),Ot={key:0,class:`ml-ribbon-keytips`,"aria-live":`polite`},kt={class:`ml-ribbon-keytips__hint`},At=(0,t.defineComponent)({__name:`RibbonKeyTips`,props:{open:{type:Boolean},tips:{default:()=>[]},sequencePrefix:{},emptySequenceText:{}},emits:[`activate`,`close`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(``),o=(0,t.computed)(()=>a.value?r.tips.filter(e=>e.key.toLowerCase().startsWith(a.value.toLowerCase())):r.tips),s=(0,t.computed)(()=>a.value||r.emptySequenceText||``),c=(0,t.computed)(()=>r.sequencePrefix?`${r.sequencePrefix}${s.value}`:s.value),l=(0,t.computed)(()=>a.value.toLowerCase()),u=(0,t.computed)(()=>r.tips.filter(e=>e.key.toLowerCase()===l.value)),d=(0,t.computed)(()=>r.tips.some(e=>e.key.toLowerCase().startsWith(l.value)));function f(){a.value=``}function p(e){if(r.open&&!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){e.preventDefault(),f(),i(`close`);return}if(e.key===`Backspace`){e.preventDefault(),a.value=a.value.slice(0,-1);return}if(/^[a-z0-9]$/i.test(e.key)){if(e.preventDefault(),a.value+=e.key.toUpperCase(),u.value.length>0){i(`activate`,u.value[0]),f();return}d.value||f()}}}return(0,t.onMounted)(()=>window.addEventListener(`keydown`,p)),(0,t.onUnmounted)(()=>window.removeEventListener(`keydown`,p)),(0,t.watch)(()=>r.open,e=>{e||f()}),(n,r)=>e.open?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ot,[(0,t.createElementVNode)(`div`,kt,(0,t.toDisplayString)(c.value),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.id,class:`ml-ribbon-keytip`},(0,t.toDisplayString)(e.key),1))),128))])):(0,t.createCommentVNode)(``,!0)}});e.MlRibbon=Tt,e.MlRibbonBackstage=v,e.MlRibbonButton=N,e.MlRibbonButtonGroup=I,e.MlRibbonCollection=j,e.MlRibbonContextualTabs=E,e.MlRibbonDropdown=H,e.MlRibbonFileMenu=A,e.MlRibbonGallery=X,e.MlRibbonGroup=tt,e.MlRibbonInputNumber=Fe,e.MlRibbonItemHost=Ke,e.MlRibbonKeyTips=At,e.MlRibbonSegmented=Be,e.MlRibbonTab=Dt,e.MlRibbonTabs=x,e.MlRibbonTemplateItem=Ue,e.MlRibbonToggleButton=Ve});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`),require(`element-plus`),require(`@element-plus/icons-vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`,`element-plus`,`@element-plus/icons-vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.MlRibbon={},e.Vue,e.ElementPlus,e.ElementPlusIconsVue))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Symbol(`RibbonContext`);function a(e){return e==null||typeof e==`string`?e:typeof e==`object`||typeof e==`function`?(0,t.markRaw)((0,t.toRaw)(e)):e}function o(e){if(!e)return;let t={...e};return`component`in t&&(t.component=a(t.component)),`icon`in t&&(t.icon=a(t.icon)),`activeIcon`in t&&(t.activeIcon=a(t.activeIcon)),`inactiveIcon`in t&&(t.inactiveIcon=a(t.inactiveIcon)),Array.isArray(t.options)&&(t.options=t.options.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return`icon`in t?{...t,icon:a(t.icon)}:t})),Array.isArray(t.categories)&&(t.categories=t.categories.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return{...t,items:Array.isArray(t.items)?t.items.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return{...t,preview:a(t.preview),icon:a(t.icon),component:a(t.component)}}):t.items}})),t}function s(e){return{...e,icon:a(e.icon),props:o(e.props)}}function c(e){return{...e,icon:a(e.icon),footerMenuItems:e.footerMenuItems?.map(s),collections:e.collections?.map(e=>({...e,items:e.items.map(s)}))}}function l(e){return{...e,groups:e.groups?.map(c)}}function u(e){return e.map(l)}function d(e){(!e.collections||e.collections.length===0)&&(e.collections=[{id:`${e.id}-collection-1`,items:[]}])}function f(e,t,n,r,i){let a=e.find(e=>e.id===t);if(!a?.groups)return;let o=a.groups.find(e=>e.id===n);if(!o?.collections)return;let s=o.collections.find(e=>e.id===r);s&&i(s.items)}function p(e,n,r,i,a,o,p,m){let h=(0,t.ref)(r),g=(0,t.ref)(i),_=(0,t.ref)(a),v=(0,t.ref)(o),y=(0,t.ref)(u(n)),b=(0,t.ref)(!1),x=(0,t.ref)(!1),S=(0,t.ref)(!1),C=(0,t.ref)([]),w=(0,t.ref)(``),T=(0,t.ref)(p),E=(0,t.ref)(m),D=(0,t.computed)(()=>y.value.filter(e=>e.visible!==!1)),O={addTab(e){y.value.push(l(e)),v.value||=e.id},removeTab(e){y.value=y.value.filter(t=>t.id!==e),v.value===e&&(v.value=D.value[0]?.id??``)},showTab(e){let t=y.value.find(t=>t.id===e);t&&(t.visible=!0)},hideTab(e){let t=y.value.find(t=>t.id===e);t&&(t.visible=!1)},selectTab(e){v.value=e},addGroup(e,t){let n=y.value.find(t=>t.id===e);n&&(n.groups??=[],d(t),n.groups.push(c(t)))},removeGroup(e,t){let n=y.value.find(t=>t.id===e);n?.groups&&(n.groups=n.groups.filter(e=>e.id!==t))},showGroup(e,t){let n=y.value.find(t=>t.id===e)?.groups?.find(e=>e.id===t);n&&(n.visible=!0)},hideGroup(e,t){let n=y.value.find(t=>t.id===e)?.groups?.find(e=>e.id===t);n&&(n.visible=!1)},addItem(e,t,n,r){f(y.value,e,t,n,e=>e.push(s(r)))},removeItem(e,t,n,r){f(y.value,e,t,n,e=>{let t=e.findIndex(e=>e.id===r);t>=0&&e.splice(t,1)})},updateItem(e,t,n,r,i){f(y.value,e,t,n,e=>{let t=e.find(e=>e.id===r);t&&Object.assign(t,i)})},enableItem(e,t,n,r){O.updateItem(e,t,n,r,{disabled:!1})},disableItem(e,t,n,r){O.updateItem(e,t,n,r,{disabled:!0})},refreshLayout(){b.value=!1},minimize(e){_.value=e},toggleSimplified(){g.value=g.value===`classic`?`simplified`:`classic`}};return{context:{id:e,disabled:h,layout:g,minimized:_,activeTab:v,tabs:y,overflowOpen:b,backdropOpen:x,keyTipsOpen:S,keyTips:C,keyTipsSequence:w,tooltipShowAfter:T,tooltipHideAfter:E,registerKeyTip:e=>{C.value.some(t=>t.id===e.id)||C.value.push(e)},unregisterKeyTip:e=>{C.value=C.value.filter(t=>t.id!==e)},api:O},visibleTabs:D}}var m={class:`ml-ribbon-backstage__nav`},h={class:`ml-ribbon-backstage__content`},g={key:0},_={key:1},v=(0,t.defineComponent)({__name:`RibbonBackstage`,props:{open:{type:Boolean},backLabel:{},title:{},description:{},size:{default:`default`}},emits:[`close`],setup(e,{emit:r}){let i=e,a=r;function o(){a(`close`)}return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDrawer),{"model-value":i.open,size:`100%`,"with-header":!1,direction:`ltr`,onClose:o},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-backstage`,`ml-ribbon-backstage--size-${i.size||`default`}`])},[e.$slots.default?(0,t.renderSlot)(e.$slots,`default`,{key:0,close:o,backLabel:i.backLabel,title:i.title,description:i.description,size:i.size}):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`aside`,m,[(0,t.createVNode)((0,t.unref)(n.ElButton),{type:`primary`,onClick:o},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(i.backLabel),1)]),_:1})]),(0,t.createElementVNode)(`section`,h,[i.title?((0,t.openBlock)(),(0,t.createElementBlock)(`h2`,g,(0,t.toDisplayString)(i.title),1)):(0,t.createCommentVNode)(``,!0),i.description?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,_,(0,t.toDisplayString)(i.description),1)):(0,t.createCommentVNode)(``,!0)])],64))],2)]),_:3},8,[`model-value`]))}}),y={class:`ml-ribbon-tabs`,role:`tablist`},b=[`aria-selected`,`disabled`,`onClick`],x=(0,t.defineComponent)({__name:`RibbonTabs`,props:{tabs:{},activeTab:{},disabled:{type:Boolean}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)(()=>r.tabs.filter(e=>e.visible!==!1));function o(e,t){i(`select`,{id:e,triggerEl:t.currentTarget instanceof HTMLElement?t.currentTarget:null})}return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,y,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-tab`,{"is-active":e.activeTab===n.id}]),role:`tab`,"aria-selected":e.activeTab===n.id,disabled:r.disabled,onClick:e=>o(n.id,e)},(0,t.toDisplayString)(n.title),11,b))),128))]))}}),S={class:`ml-ribbon-contextual-tabs`},C={class:`ml-ribbon-contextual-tabs__normal`},w={class:`ml-ribbon-contextual-tabs__ctx`},T={key:0},E=(0,t.defineComponent)({__name:`RibbonContextualTabs`,props:{tabs:{},activeTab:{},disabled:{type:Boolean}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n;return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,S,[(0,t.createElementVNode)(`div`,C,[(0,t.createVNode)(x,{tabs:r.tabs.filter(e=>!e.contextual),"active-tab":e.activeTab,disabled:r.disabled,onSelect:a[0]||=e=>i(`select`,e)},null,8,[`tabs`,`active-tab`,`disabled`])]),(0,t.createElementVNode)(`div`,w,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.tabs.filter(e=>e.contextual),n=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:n.id,class:`ml-ribbon-contextual-tabs__block`,style:(0,t.normalizeStyle)({"--ctx-color":n.contextualColor||`#67c23a`})},[n.contextualTitle?.trim()?((0,t.openBlock)(),(0,t.createElementBlock)(`small`,T,(0,t.toDisplayString)(n.contextualTitle.trim()),1)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(x,{tabs:[n],"active-tab":e.activeTab,disabled:r.disabled,onSelect:a[1]||=e=>i(`select`,e)},null,8,[`tabs`,`active-tab`,`disabled`])],4))),128))])]))}}),D={class:`ml-ribbon-file-menu-submenu__trigger`},O=(0,t.defineComponent)({__name:`RibbonFileMenuItem`,props:{item:{},divided:{type:Boolean},popperClass:{}},emits:[`select`],setup(e,{emit:i}){let a=e,o=i,s=e=>Array.isArray(e.children)&&e.children.length>0;function c(e){o(`select`,e)}return(e,i)=>{let o=(0,t.resolveComponent)(`RibbonFileMenuItem`,!0);return s(a.item)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:0,divided:a.divided,disabled:a.item.disabled,class:`ml-ribbon-file-menu-submenu`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdown),{trigger:`hover`,placement:`right-start`,teleported:!0,"show-timeout":0,"hide-timeout":100,"popper-class":a.popperClass,onCommand:c},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdownMenu),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.item.children,e=>((0,t.openBlock)(),(0,t.createBlock)(o,{key:e.id,item:e,divided:e.divided===!0,"popper-class":a.popperClass,onSelect:c},null,8,[`item`,`divided`,`popper-class`]))),128))]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,D,[(0,t.createTextVNode)((0,t.toDisplayString)(a.item.label)+` `,1),(0,t.createVNode)((0,t.unref)(n.ElIcon),{class:`ml-ribbon-file-menu-submenu__arrow`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.ArrowRight))]),_:1})])]),_:1},8,[`popper-class`])]),_:1},8,[`divided`,`disabled`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:1,divided:a.divided,command:a.item.id,disabled:a.item.disabled},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(a.item.label),1)]),_:1},8,[`divided`,`command`,`disabled`]))}}}),k=[`disabled`],A=(0,t.defineComponent)({__name:`RibbonFileMenu`,props:{items:{},label:{},openBackstageLabel:{},showOpenBackstage:{type:Boolean},disabled:{type:Boolean}},emits:[`select`,`open-backstage`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.ref)(!1),s=(0,n.useGlobalConfig)(`size`,``),c=(0,t.computed)(()=>s.value||`default`),l=(0,t.computed)(()=>`ml-ribbon-file-menu-dropdown ml-ribbon-popper ml-ribbon-popper--size-${c.value}`);function u(e){o.value=e}function d(e){if(e===`__backstage`){a(`open-backstage`);return}a(`select`,e)}return(0,t.watch)(()=>i.disabled,e=>{e&&(o.value=!1)}),(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdown),{trigger:`click`,disabled:i.disabled,"popper-class":l.value,onCommand:d,onVisibleChange:u},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdownMenu),null,{default:(0,t.withCtx)(()=>[i.showOpenBackstage===!1?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:0,command:`__backstage`},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(i.openBackstageLabel),1)]),_:1})),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i.items,(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(O,{key:e.id,item:e,divided:e.divided===!0||i.showOpenBackstage!==!1&&n===0,"popper-class":l.value,onSelect:d},null,8,[`item`,`divided`,`popper-class`]))),128))]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-tab ml-ribbon-tab--file`,{"is-active":o.value}]),disabled:i.disabled},(0,t.toDisplayString)(i.label),11,k)]),_:1},8,[`disabled`,`popper-class`]))}}),j=(0,t.defineComponent)({__name:`RibbonCollection`,props:{id:{},layout:{default:`row`},rows:{default:3}},setup(e){let n=e,r=(0,t.computed)(()=>({"--ml-ribbon-collection-rows":String(n.rows)}));return(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-collection`,[`ml-ribbon-collection--${n.layout}`]]),style:(0,t.normalizeStyle)(r.value)},[(0,t.renderSlot)(e.$slots,`default`)],6))}}),M={key:3,class:`ml-ribbon-item-host__label ml-ribbon-button__label`},N=(0,t.defineComponent)({name:`MlRibbonButton`,__name:`RibbonButton`,props:{id:{},label:{default:void 0},icon:{default:void 0},disabled:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},ariaLabel:{default:void 0},iconSize:{default:void 0},size:{default:void 0},buttonType:{default:`default`},nativeType:{default:`button`}},emits:[`click`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.computed)(()=>i.label===void 0?i.id:i.label.trim()),s=(0,t.computed)(()=>!i.hideLabel&&o.value.length>0),c=(0,t.computed)(()=>i.ariaLabel?.trim()||o.value||i.id),l=(0,t.computed)(()=>!i.icon||typeof i.icon==`string`?null:i.icon),u=(0,t.computed)(()=>{if(typeof i.icon!=`string`)return null;let e=i.icon.trim();return e.length>0?e:null}),d=(0,t.computed)(()=>s.value?`ml-ribbon-item-host__icon--with-label`:`ml-ribbon-item-host__icon--icon-only`),f=(0,t.computed)(()=>{if(i.iconSize)return{fontSize:i.iconSize}});function p(e){i.disabled||a(`click`,e)}return(r,i)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElButton),{class:`ml-ribbon-button`,"data-ribbon-button-id":e.id,type:e.buttonType,size:e.size,"native-type":e.nativeType,disabled:e.disabled,"aria-label":c.value,onClick:p},{default:(0,t.withCtx)(()=>[r.$slots.icon?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`ml-ribbon-item-host__icon ml-ribbon-button__icon`,d.value]),style:(0,t.normalizeStyle)(f.value),"aria-hidden":`true`},[(0,t.renderSlot)(r.$slots,`icon`)],6)):l.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:1,class:(0,t.normalizeClass)([`ml-ribbon-item-host__icon ml-ribbon-button__icon`,d.value]),style:(0,t.normalizeStyle)(f.value)},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(l.value)))]),_:1},8,[`class`,`style`])):u.value?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:2,class:(0,t.normalizeClass)([`ml-ribbon-item-host__icon ml-ribbon-item-host__icon--class ml-ribbon-button__icon`,[u.value,d.value]]),style:(0,t.normalizeStyle)(f.value),"aria-hidden":`true`},null,6)):(0,t.createCommentVNode)(``,!0),s.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,M,[(0,t.renderSlot)(r.$slots,`label`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(o.value),1)])])):(0,t.createCommentVNode)(``,!0),(0,t.renderSlot)(r.$slots,`default`)]),_:3},8,[`data-ribbon-button-id`,`type`,`size`,`native-type`,`disabled`,`aria-label`]))}}),P=[`data-id`],ee={key:0,class:`ml-ribbon-button-group__label`},F={class:`ml-ribbon-button-group__text`},I=(0,t.defineComponent)({__name:`RibbonButtonGroup`,props:{id:{},label:{},options:{},hideLabel:{type:Boolean,default:!1},wrap:{type:Boolean,default:!0},equalWidth:{type:Boolean,default:!1},buttonSize:{},iconSize:{},tooltipShowAfter:{default:1e3},tooltipHideAfter:{default:0},disabled:{type:Boolean,default:!1}},emits:[`change`],setup(e,{emit:r}){let i=e,a=r;function o(e){i.disabled||a(`change`,e)}function s(e){return typeof e==`string`&&e.trim().length>0}function c(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function l(e){if(typeof e==`string`){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim();return t?t.replace(/\b\w/g,e=>e.toUpperCase()):void 0}if(typeof e==`number`||typeof e==`boolean`)return String(e)}function u(e){return c(e.tooltip)??c(e.label)??l(e.value)}return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-button-group`,{"ml-ribbon-button-group--nowrap":!e.wrap,"ml-ribbon-button-group--equal-width":!e.wrap&&e.equalWidth}]),"data-id":e.id},[!e.hideLabel&&e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ee,(0,t.toDisplayString)(e.label),1)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.ElButtonGroup),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.options,r=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{key:String(r.value),content:u(r),disabled:!u(r),"show-after":e.tooltipShowAfter,"hide-after":e.tooltipHideAfter,placement:`top`,effect:`dark`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(N,{id:String(r.value),class:`ml-ribbon-button-group__button`,label:r.label,icon:r.icon,"icon-size":e.iconSize,size:e.buttonSize,disabled:e.disabled,"hide-label":!s(r.label),"aria-label":u(r)??String(r.value),onClick:e=>o(r.value)},(0,t.createSlots)({_:2},[s(r.label)?{name:`label`,fn:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,F,(0,t.toDisplayString)(r.label),1)]),key:`0`}:void 0]),1032,[`id`,`label`,`icon`,`icon-size`,`size`,`disabled`,`hide-label`,`aria-label`,`onClick`])]),_:2},1032,[`content`,`disabled`,`show-after`,`hide-after`]))),128))]),_:1})],10,P))}}),L={class:`ml-ribbon-item-host__content ml-ribbon-dropdown__content`},R={class:`ml-ribbon-item-host__text-row ml-ribbon-dropdown__text-row`},z={key:0,class:`ml-ribbon-item-host__label ml-ribbon-dropdown__label`},te={class:`ml-ribbon-dropdown-item__content`},ne={class:`ml-ribbon-dropdown-item__row`},re={key:0,class:`ml-ribbon-dropdown-item__check`,"aria-hidden":`true`},B={class:`ml-ribbon-dropdown-item__main`},V={class:`ml-ribbon-dropdown-item__label`},H=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({name:`MlRibbonDropdown`,__name:`RibbonDropdown`,props:{id:{},label:{default:void 0},tooltip:{default:void 0},icon:{default:void 0},options:{default:()=>[]},disabled:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},syncLabelWithSelection:{type:Boolean,default:!1},itemSize:{default:`medium`},tooltipShowAfter:{default:1e3},tooltipHideAfter:{default:0},popperClass:{default:void 0},modelValue:{default:void 0}},emits:[`command`,`click`,`tooltip-change`],setup(e,{emit:i}){let a=e,o=i,s=(0,n.useGlobalConfig)(`size`,``),c=(0,t.computed)(()=>s.value||`default`),l=(0,t.ref)(!1),u=(0,t.ref)(void 0);(0,t.watch)(()=>a.modelValue,e=>{e!==void 0&&(u.value=e)},{immediate:!0});let d=(0,t.computed)(()=>Array.isArray(a.options)?a.options:[]),f=(0,t.computed)(()=>d.value.find(e=>D(e)===u.value)??null),p=(0,t.computed)(()=>{if(f.value&&a.syncLabelWithSelection){let e=k(f.value);if(e)return e}return M(a.label)??a.id}),m=(0,t.computed)(()=>!a.hideLabel&&p.value.length>0),h=(0,t.computed)(()=>a.modelValue!==void 0||a.syncLabelWithSelection),g=(0,t.computed)(()=>{if(f.value){let e=T(f.value);if(e)return e}return!a.icon||typeof a.icon==`string`?null:a.icon}),_=(0,t.computed)(()=>{if(f.value){let e=E(f.value);if(e)return e}if(typeof a.icon!=`string`)return null;let e=a.icon.trim();return e.length>0?e:null}),v=(0,t.computed)(()=>!!(g.value||_.value)),y=(0,t.computed)(()=>j(f.value)??M(a.tooltip)??M(p.value)??M(a.label)??N(a.id)),b=(0,t.computed)(()=>[`ml-ribbon-dropdown-menu`,`ml-ribbon-popper`,`ml-ribbon-popper--size-${c.value}`,a.popperClass].filter(Boolean).join(` `));function x(e){if(a.disabled){l.value=!1;return}l.value=e}function S(){a.disabled||(l.value=!l.value)}function C(e){a.disabled||(u.value=e,o(`tooltip-change`,j(f.value)??y.value),o(`command`,e),l.value=!1)}function w(){if(a.disabled)return;let e=f.value;if(!e){o(`click`);return}o(`command`,D(e))}function T(e){if(!e||typeof e!=`object`)return null;let t=e.icon;return!t||typeof t==`string`?null:t}function E(e){if(!e||typeof e!=`object`)return null;let t=e.icon;return typeof t!=`string`||t.trim().length===0?null:t}function D(e){if(!(!e||typeof e!=`object`))return e.value}function O(e){let t=D(e);if(typeof t==`string`||typeof t==`number`||t&&typeof t==`object`)return t}function k(e){if(!e||typeof e!=`object`)return;let t=e.label;return typeof t==`string`?t:void 0}function A(e){if(typeof e==`string`)return N(e);if(typeof e==`number`||typeof e==`boolean`)return String(e)}function j(e){if(!(!e||typeof e!=`object`))return M(e.tooltip)??k(e)??A(D(e))}function M(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function N(e){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim();return t?t.replace(/\b\w/g,e=>e.toUpperCase()):e}function P(e){return D(e)===u.value}return(i,a)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdown),{class:(0,t.normalizeClass)([`ml-ribbon-dropdown`,[`ml-ribbon-dropdown--item-${e.itemSize}`,{"is-label-hidden":e.hideLabel}]]),trigger:`click`,disabled:e.disabled,"popper-class":b.value,onVisibleChange:x,onCommand:C},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdownMenu),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d.value,a=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:String(D(a)),command:O(a),disabled:a.disabled===!0,divided:a.divided===!0,"aria-current":P(a)?`true`:void 0,class:(0,t.normalizeClass)({"ml-ribbon-dropdown-item--selected":P(a)})},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElTooltip),{content:j(a),disabled:!j(a),"show-after":e.tooltipShowAfter,"hide-after":e.tooltipHideAfter,placement:`top`,effect:`dark`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,te,[(0,t.renderSlot)(i.$slots,`option`,{option:a},()=>[(0,t.createElementVNode)(`span`,ne,[h.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,re,[P(a)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-dropdown-item__check-icon`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.Check))]),_:1})):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,B,[T(a)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-dropdown-item__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(T(a))))]),_:2},1024)):E(a)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-dropdown-item__icon ml-ribbon-dropdown-item__icon--class`,E(a)]),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,V,(0,t.toDisplayString)(k(a)),1)])])],!0)])]),_:2},1032,[`content`,`disabled`,`show-after`,`hide-after`])]),_:2},1032,[`command`,`disabled`,`divided`,`aria-current`,`class`]))),128))]),_:3})]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{type:`default`,disabled:e.disabled,"aria-label":y.value,onClick:S},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,L,[i.$slots.icon||v.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`ml-ribbon-item-host__icon ml-ribbon-item-host__icon--dropdown-primary ml-ribbon-dropdown__icon`,{"ml-ribbon-item-host__icon--class":_.value&&!g.value&&!i.$slots.icon}]),onClick:(0,t.withModifiers)(w,[`stop`])},[(0,t.renderSlot)(i.$slots,`icon`,{selectedOption:f.value},()=>[g.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(g.value)))]),_:1})):_.value?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)(_.value),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0)],!0)],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,R,[m.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,z,[(0,t.renderSlot)(i.$slots,`label`,{selectedOption:f.value,label:p.value},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(p.value),1)],!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.ElIcon),{class:(0,t.normalizeClass)([`ml-ribbon-item-host__dropdown-arrow ml-ribbon-dropdown__arrow`,{"is-open":l.value}])},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(l.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1},8,[`class`])])])]),_:3},8,[`disabled`,`aria-label`])]),_:3},8,[`class`,`disabled`,`popper-class`]))}}),[[`__scopeId`,`data-v-3704c6ba`]]),ie=[`disabled`],ae=[`src`],U={key:3,class:`ml-ribbon-gallery__preview-svg`,role:`presentation`,"aria-hidden":`true`},oe=[`href`],se={class:`ml-ribbon-gallery__label ml-ribbon-gallery__collapsed-label`},ce={class:`ml-ribbon-gallery__panel`},le={key:0,class:`ml-ribbon-gallery__panel-category-title`},W=[`disabled`,`onClick`],G=[`src`],K={key:3,class:`ml-ribbon-gallery__preview-svg`,role:`presentation`,"aria-hidden":`true`},ue=[`href`],de={class:`ml-ribbon-gallery__label`},fe={key:1,class:`ml-ribbon-gallery__title`},pe={key:2,class:`ml-ribbon-gallery__categories`},me={key:0,class:`ml-ribbon-gallery__category-title`},he=[`disabled`,`onClick`],ge=[`src`],q={key:3,class:`ml-ribbon-gallery__preview-svg`,role:`presentation`,"aria-hidden":`true`},_e=[`href`],ve={class:`ml-ribbon-gallery__label`},ye={key:0,class:`ml-ribbon-gallery__controls`,"aria-label":`Gallery navigation`},J=[`disabled`],be=[`disabled`],xe=[`disabled`],Se={key:0,class:`ml-ribbon-gallery__panel-category-title`},Y=[`data-gallery-row-index`,`disabled`,`onClick`],Ce=[`src`],we={key:3,class:`ml-ribbon-gallery__preview-svg`,role:`presentation`,"aria-hidden":`true`},Te=[`href`],Ee={class:`ml-ribbon-gallery__label`},De=6,Oe=64,ke=4,Ae=16,je=4,Me=22,X=(0,t.defineComponent)({name:`MlRibbonGallery`,__name:`RibbonGallery`,props:{id:{},label:{},categories:{},disabled:{type:Boolean,default:!1},modelValue:{},collapsed:{type:Boolean,default:!1},inlineItemLimit:{default:4},inlineItemWidthMode:{default:`fixed`},previewFallback:{}},emits:[`select`],setup(e,{emit:i}){let a=e,o=i,s=(0,t.ref)(``),c=(0,t.ref)(!1),l=(0,t.ref)(0),u=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(null),p=(0,t.ref)(0),m=(0,n.useGlobalConfig)(`size`,``),h=(0,t.computed)(()=>m.value||`default`),g=(0,t.computed)(()=>h.value===`small`?.92:h.value===`large`?1.08:1),_=(0,t.computed)(()=>Math.round(Oe*g.value)),v=(0,t.computed)(()=>Math.round(Me*g.value)),y=(0,t.computed)(()=>a.label?.trim()??``),b=(0,t.computed)(()=>a.categories.filter(e=>e.items.length>0).length),x=(0,t.computed)(()=>a.categories.flatMap(e=>e.items)),S=(0,t.computed)(()=>x.value.find(e=>e.id===s.value)??x.value[0]),C=(0,t.computed)(()=>!Number.isFinite(a.inlineItemLimit)||a.inlineItemLimit<=0?4:Math.floor(a.inlineItemLimit)),w=(0,t.computed)(()=>{let e=C.value,t=x.value.length;return t===0?Math.min(e,1):Math.min(e,t)}),T=(0,t.computed)(()=>Math.max(1,Math.ceil(x.value.length/w.value))),E=(0,t.computed)(()=>Math.min(l.value,T.value-1)),D=(0,t.computed)(()=>j.value&&E.value>0),O=(0,t.computed)(()=>j.value&&E.value<T.value-1),k=(0,t.computed)(()=>{let e=E.value*w.value;return x.value.slice(e,e+w.value)}),A=(0,t.computed)(()=>new Set(k.value.map(e=>e.id))),j=(0,t.computed)(()=>x.value.length>w.value),M=(0,t.computed)(()=>{let e=[`ml-ribbon-gallery-panel`,`ml-ribbon-gallery-panel--${a.collapsed?`collapsed`:`inline`}`,`ml-ribbon-gallery-panel--size-${h.value}`];return a.inlineItemWidthMode===`auto`&&e.push(`ml-ribbon-gallery-panel--item-width-auto`),e.join(` `)}),N=(0,t.computed)(()=>({"--ml-ribbon-gallery-panel-columns":String(w.value),"--ml-ribbon-gallery-panel-item-width":`${_.value}px`})),P=(0,t.computed)(()=>a.inlineItemWidthMode===`auto`?`fit-content`:w.value*_.value+Math.max(0,w.value-1)*ke+De*2+(a.collapsed?Ae:je+v.value)),ee=(0,t.computed)(()=>({modifiers:[{name:`offset`,options:{offset:[p.value,0]}}]}));(0,t.watch)(()=>a.modelValue,e=>{typeof e==`string`&&(s.value=e,te(e))},{immediate:!0}),(0,t.watch)(()=>[x.value.map(e=>e.id).join(`\0`),w.value,s.value],()=>{te()||(l.value=Math.min(l.value,T.value-1))}),(0,t.watch)(c,async e=>{!e||a.collapsed||(ne(),await(0,t.nextTick)(),await(0,t.nextTick)(),re())});function F(e){return e==null||typeof e==`string`?e:typeof e==`object`||typeof e==`function`?(0,t.markRaw)((0,t.toRaw)(e)):e}function I(e){let t=y.value.toLowerCase(),n=e.title.trim().toLowerCase();return b.value>1||!t||n!==t}function L(e){return j.value?e.items.filter(e=>A.value.has(e.id)):e.items}function R(e){if(a.disabled||!j.value)return;let t=E.value+e;l.value=Math.min(Math.max(t,0),T.value-1)}function z(e){let t=x.value.findIndex(t=>t.id===e.id);return t<0?0:Math.floor(t/w.value)}function te(e=s.value){let t=x.value.find(t=>t.id===e);return t?(l.value=z(t),!0):!1}function ne(){let e=u.value,t=d.value;if(!e||!t){p.value=0;return}let n=e.querySelector(`.ml-ribbon-gallery__grid .ml-ribbon-gallery__item`)?.getBoundingClientRect().left??e.getBoundingClientRect().left;p.value=Math.round(n-t.getBoundingClientRect().left-De)}function re(){let e=f.value;e&&e.querySelector(`[data-gallery-row-index="${E.value}"]`)?.scrollIntoView?.({block:`start`})}function B(e){return e.preview&&typeof e.preview!=`string`?F(e.preview):e.icon&&typeof e.icon!=`string`?F(e.icon):null}function V(e){return e.component?F(e.component):null}function H(e){return a.disabled||e.disabled===!0}function X(e){if(typeof e.icon!=`string`)return null;let t=e.icon.trim();return t.length>0?t:null}function Z(e){let t=e.previewSvg??e.svg;if(typeof t!=`string`)return null;let n=t.trim();return n.length>0?n:null}function Ne(e){return e.startsWith(`data:image/svg+xml`)||e.endsWith(`.svg`)}function Pe(e){let t=Z(e);return t?Ne(t):!1}function Fe(e){return typeof e.preview==`string`?e.preview:a.previewFallback}function Q(e){H(e)||(s.value=e.id,l.value=z(e),c.value=!1,o(`select`,e.id))}return(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`galleryRef`,ref:u,class:(0,t.normalizeClass)([`ml-ribbon-gallery`,{"is-disabled":e.disabled,"is-collapsed":e.collapsed,"is-unlabeled":!e.collapsed&&!y.value,"is-inline-item-width-auto":!e.collapsed&&e.inlineItemWidthMode===`auto`}])},[e.collapsed&&S.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:0,visible:c.value,"onUpdate:visible":a[0]||=e=>c.value=e,trigger:`click`,placement:`bottom-start`,disabled:e.disabled,width:P.value,"popper-class":M.value},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__collapsed-button`,{"is-selected":s.value===S.value.id,"is-open":c.value}]),disabled:H(S.value)},[V(S.value)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(V(S.value)),(0,t.mergeProps)({key:0},S.value.componentProps,{item:S.value,selected:s.value===S.value.id,disabled:H(S.value)}),null,16,[`item`,`selected`,`disabled`])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview ml-ribbon-gallery__collapsed-preview`,{"ml-ribbon-gallery__preview--icon":B(S.value)||X(S.value),"ml-ribbon-gallery__preview--svg":Z(S.value)}])},[B(S.value)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-gallery__preview-icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(B(S.value))))]),_:1})):X(S.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview-icon ml-ribbon-gallery__preview-icon--class`,X(S.value)]),"aria-hidden":`true`},null,2)):Z(S.value)&&Pe(S.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:2,class:`ml-ribbon-gallery__preview-svg`,src:Z(S.value)??``,alt:``},null,8,ae)):Z(S.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,U,[(0,t.createElementVNode)(`use`,{href:Z(S.value)??``},null,8,oe)])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createTextVNode)((0,t.toDisplayString)(Fe(S.value)),1)],64))],2),(0,t.createElementVNode)(`div`,se,(0,t.toDisplayString)(S.value.label),1)],64))],10,ie)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ce,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.categories,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-gallery__panel-category`},[I(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`h4`,le,(0,t.toDisplayString)(e.title),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:`ml-ribbon-gallery__panel-grid`,style:(0,t.normalizeStyle)(N.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,r=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:r.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__item ml-ribbon-gallery__panel-item`,{"is-selected":s.value===r.id}]),disabled:H(r),onClick:e=>Q(r)},[(0,t.renderSlot)(i.$slots,`item`,{item:r,category:e,selected:s.value===r.id,disabled:H(r),select:()=>Q(r)},()=>[V(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(V(r)),(0,t.mergeProps)({key:0,ref_for:!0},r.componentProps,{item:r,category:e,selected:s.value===r.id,disabled:H(r)}),null,16,[`item`,`category`,`selected`,`disabled`])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview`,{"ml-ribbon-gallery__preview--icon":B(r)||X(r),"ml-ribbon-gallery__preview--svg":Z(r)}])},[B(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-gallery__preview-icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(B(r))))]),_:2},1024)):X(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview-icon ml-ribbon-gallery__preview-icon--class`,X(r)]),"aria-hidden":`true`},null,2)):Z(r)&&Pe(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:2,class:`ml-ribbon-gallery__preview-svg`,src:Z(r)??``,alt:``},null,8,G)):Z(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,K,[(0,t.createElementVNode)(`use`,{href:Z(r)??``},null,8,ue)])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createTextVNode)((0,t.toDisplayString)(Fe(r)),1)],64))],2),(0,t.createElementVNode)(`div`,de,(0,t.toDisplayString)(r.label),1)],64))])],10,W))),128))],4)]))),128))])]),_:3},8,[`visible`,`disabled`,`width`,`popper-class`])):(0,t.createCommentVNode)(``,!0),!e.collapsed&&y.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fe,(0,t.toDisplayString)(y.value),1)):(0,t.createCommentVNode)(``,!0),e.collapsed?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,pe,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.categories,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-gallery__category`},[y.value&&I(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`h4`,me,(0,t.toDisplayString)(e.title),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:`ml-ribbon-gallery__grid`,style:(0,t.normalizeStyle)({"--ml-ribbon-gallery-inline-columns":String(w.value)})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(L(e),r=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:r.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__item`,{"is-selected":s.value===r.id}]),disabled:H(r),onClick:e=>Q(r)},[(0,t.renderSlot)(i.$slots,`item`,{item:r,category:e,selected:s.value===r.id,disabled:H(r),select:()=>Q(r)},()=>[V(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(V(r)),(0,t.mergeProps)({key:0,ref_for:!0},r.componentProps,{item:r,category:e,selected:s.value===r.id,disabled:H(r)}),null,16,[`item`,`category`,`selected`,`disabled`])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview`,{"ml-ribbon-gallery__preview--icon":B(r)||X(r),"ml-ribbon-gallery__preview--svg":Z(r)}])},[B(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-gallery__preview-icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(B(r))))]),_:2},1024)):X(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview-icon ml-ribbon-gallery__preview-icon--class`,X(r)]),"aria-hidden":`true`},null,2)):Z(r)&&Pe(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:2,class:`ml-ribbon-gallery__preview-svg`,src:Z(r)??``,alt:``},null,8,ge)):Z(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,q,[(0,t.createElementVNode)(`use`,{href:Z(r)??``},null,8,_e)])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createTextVNode)((0,t.toDisplayString)(Fe(r)),1)],64))],2),(0,t.createElementVNode)(`div`,ve,(0,t.toDisplayString)(r.label),1)],64))])],10,he))),128))],4)]))),128)),j.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ye,[(0,t.createElementVNode)(`button`,{type:`button`,class:`ml-ribbon-gallery__control-button`,disabled:e.disabled||!D.value,"aria-label":`Show previous gallery row`,onClick:a[1]||=e=>R(-1)},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.ArrowUp))]),_:1})],8,J),(0,t.createElementVNode)(`button`,{type:`button`,class:`ml-ribbon-gallery__control-button`,disabled:e.disabled||!O.value,"aria-label":`Show next gallery row`,onClick:a[2]||=e=>R(1)},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.ArrowDown))]),_:1})],8,be),(0,t.createVNode)((0,t.unref)(n.ElPopover),{visible:c.value,"onUpdate:visible":a[3]||=e=>c.value=e,trigger:`click`,placement:`bottom-start`,disabled:e.disabled,width:P.value,"popper-class":M.value,"popper-options":ee.value},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{ref_key:`inlineMoreButtonRef`,ref:d,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__control-button ml-ribbon-gallery__more-button`,{"is-open":c.value}]),disabled:e.disabled,"aria-label":`Show more gallery items`,onClick:ne},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.Bottom))]),_:1})],10,xe)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{ref_key:`inlinePanelRef`,ref:f,class:`ml-ribbon-gallery__panel`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.categories,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-gallery__panel-category`},[I(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`h4`,Se,(0,t.toDisplayString)(e.title),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:`ml-ribbon-gallery__panel-grid`,style:(0,t.normalizeStyle)(N.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,r=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:r.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__item ml-ribbon-gallery__panel-item`,{"is-selected":s.value===r.id}]),"data-gallery-row-index":z(r),disabled:H(r),onClick:e=>Q(r)},[(0,t.renderSlot)(i.$slots,`item`,{item:r,category:e,selected:s.value===r.id,disabled:H(r),select:()=>Q(r)},()=>[V(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(V(r)),(0,t.mergeProps)({key:0,ref_for:!0},r.componentProps,{item:r,category:e,selected:s.value===r.id,disabled:H(r)}),null,16,[`item`,`category`,`selected`,`disabled`])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview`,{"ml-ribbon-gallery__preview--icon":B(r)||X(r),"ml-ribbon-gallery__preview--svg":Z(r)}])},[B(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-gallery__preview-icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(B(r))))]),_:2},1024)):X(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-gallery__preview-icon ml-ribbon-gallery__preview-icon--class`,X(r)]),"aria-hidden":`true`},null,2)):Z(r)&&Pe(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:2,class:`ml-ribbon-gallery__preview-svg`,src:Z(r)??``,alt:``},null,8,Ce)):Z(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,we,[(0,t.createElementVNode)(`use`,{href:Z(r)??``},null,8,Te)])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createTextVNode)((0,t.toDisplayString)(Fe(r)),1)],64))],2),(0,t.createElementVNode)(`div`,Ee,(0,t.toDisplayString)(r.label),1)],64))])],10,Y))),128))],4)]))),128))],512)]),_:3},8,[`visible`,`disabled`,`width`,`popper-class`,`popper-options`])])):(0,t.createCommentVNode)(``,!0)]))],2))}}),Z=[`data-id`,`onKeydown`],Ne={key:0,class:`ml-ribbon-input-number__prefix`},Pe={key:2,class:`ml-ribbon-input-number__prefix-label`},Fe=(0,t.defineComponent)({name:`MlRibbonInputNumber`,__name:`RibbonInputNumber`,props:{id:{},modelValue:{default:void 0},width:{default:`96px`},prefixLabel:{default:void 0},prefixIcon:{default:void 0},prefixIconClass:{default:void 0},controlProps:{default:()=>({})},disabled:{type:Boolean,default:!1}},emits:[`change`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.computed)(()=>x(i.width,`96px`)),s=(0,t.computed)(()=>o.value===`100%`),c=(0,t.computed)(()=>s.value?{width:`100%`}:{}),l=(0,t.computed)(()=>s.value?{}:{width:o.value}),u=(0,t.computed)(()=>b(i.prefixLabel)),d=(0,t.computed)(()=>!i.prefixIcon||typeof i.prefixIcon==`string`?null:i.prefixIcon),f=(0,t.computed)(()=>b(i.prefixIconClass??(typeof i.prefixIcon==`string`?i.prefixIcon:void 0))??null),p=(0,t.computed)(()=>!!(u.value||d.value||f.value)),m=(0,t.computed)(()=>u.value??i.id),h=(0,t.ref)(void 0);function g(e){v(e)}function _(e){e.preventDefault(),e.stopPropagation();let t=e.target;if(!(t instanceof HTMLInputElement))return;let n=y(t.value);n===void 0&&t.value.trim().length>0||v(n)}function v(e){Object.is(h.value,e)||(h.value=e,a(`change`,e))}function y(e){let t=e.trim();if(!t)return;let n=Number(t);return Number.isFinite(n)?n:void 0}function b(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function x(e,t){if(typeof e==`number`&&Number.isFinite(e)&&e>0)return`${e}px`;if(typeof e==`string`){let n=e.trim();return n?n.toLowerCase()===`full`?`100%`:n:t}return t}return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-input-number`,{"has-prefix":p.value,"is-full":s.value}]),style:(0,t.normalizeStyle)(c.value),"data-id":e.id,onKeydown:(0,t.withKeys)((0,t.withModifiers)(_,[`stop`,`prevent`]),[`enter`])},[p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Ne,[d.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-input-number__prefix-icon`,"aria-hidden":`true`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(d.value)))]),_:1})):f.value?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-input-number__prefix-icon ml-ribbon-input-number__prefix-icon--class`,f.value]),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0),u.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Pe,(0,t.toDisplayString)(u.value),1)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.ElInputNumber),(0,t.mergeProps)(e.controlProps,{"model-value":e.modelValue,disabled:e.disabled,style:l.value,"aria-label":m.value,onChange:g}),null,16,[`model-value`,`disabled`,`style`,`aria-label`])],46,Z))}}),Q=[`data-id`],Ie={key:0,class:`ml-ribbon-segmented__label`},Le=[`data-option-value`,`aria-label`],Re={key:2,class:`ml-ribbon-segmented__option-label`},ze={key:3,class:`ml-ribbon-segmented__option-sr-label`},Be=(0,t.defineComponent)({__name:`RibbonSegmented`,props:{id:{},label:{default:``},options:{},modelValue:{type:[String,Number,Boolean],default:void 0},direction:{default:`horizontal`},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},tooltipShowAfter:{default:1e3},tooltipHideAfter:{default:0}},emits:[`change`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.computed)(()=>i.label?.trim()??``),s=(0,t.computed)(()=>!i.hideLabel&&o.value.length>0);function c(e){return e}function l(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function u(e){if(typeof e==`string`){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim();return t?t.replace(/\b\w/g,e=>e.toUpperCase()):void 0}if(typeof e==`number`||typeof e==`boolean`)return String(e)}function d(e){let t=c(e);return t.label?.trim()||String(t.value)}function f(e){let t=c(e);return l(t.tooltip)??l(t.label)??u(t.value)}function p(e){let t=c(e).icon;return t&&typeof t!=`string`?t:null}function m(e){let t=c(e).iconClass;if(typeof t==`string`&&t.trim())return t;let n=c(e).icon;return typeof n==`string`&&n.trim()?n.trim():null}function h(e){return!p(e)&&!m(e)}function g(e){return String(c(e).value)}function _(e){return f(e)??g(e)}function v(e){a(`change`,e)}return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ml-ribbon-segmented`,"data-id":e.id},[s.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ie,(0,t.toDisplayString)(o.value),1)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.ElSegmented),{class:`ml-ribbon-segmented__control`,options:e.options,"model-value":e.modelValue,direction:e.direction,block:e.block,disabled:e.disabled,"aria-label":o.value||e.id,onChange:v},{default:(0,t.withCtx)(({item:r})=>[(0,t.createVNode)((0,t.unref)(n.ElTooltip),{content:f(r),disabled:!f(r),"show-after":e.tooltipShowAfter,"hide-after":e.tooltipHideAfter,placement:`top`,effect:`dark`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,{class:`ml-ribbon-segmented__option`,"data-option-value":g(r),"aria-label":_(r)},[p(r)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-segmented__option-icon`,"aria-hidden":`true`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(p(r))))]),_:2},1024)):m(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-segmented__option-icon ml-ribbon-item-host__icon--class`,m(r)]),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0),h(r)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Re,(0,t.toDisplayString)(d(r)),1)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ze,(0,t.toDisplayString)(d(r)),1))],8,Le)]),_:2},1032,[`content`,`disabled`,`show-after`,`hide-after`])]),_:1},8,[`options`,`model-value`,`direction`,`block`,`disabled`,`aria-label`])],8,Q))}}),Ve=(0,t.defineComponent)({__name:`RibbonToggleButton`,props:{id:{},label:{default:``},modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},activeIcon:{default:void 0},inactiveIcon:{default:void 0},activeLabel:{default:void 0},inactiveLabel:{default:void 0}},emits:[`change`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(!!r.modelValue);(0,t.watch)(()=>r.modelValue,e=>{a.value=!!e},{immediate:!0});let o=(0,t.computed)(()=>a.value),s=(0,t.computed)(()=>o.value?r.activeIcon??r.inactiveIcon:r.inactiveIcon??r.activeIcon),c=(0,t.computed)(()=>(o.value?r.activeLabel?.trim():r.inactiveLabel?.trim())||r.label?.trim()||r.id),l=(0,t.computed)(()=>!r.hideLabel&&c.value.length>0);function u(){if(r.disabled)return;let e=!a.value;a.value=e,i(`change`,e)}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(N,{id:e.id,class:(0,t.normalizeClass)([`ml-ribbon-toggle`,{"is-active":o.value}]),icon:s.value,label:c.value,disabled:e.disabled,"hide-label":!l.value,"aria-label":c.value,"aria-pressed":String(o.value),onClick:u},null,8,[`id`,`class`,`icon`,`label`,`disabled`,`hide-label`,`aria-label`,`aria-pressed`]))}}),He=[`data-template-id`,`aria-disabled`],Ue=(0,t.defineComponent)({__name:`RibbonTemplateItem`,props:{id:{},item:{},disabled:{type:Boolean}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ml-ribbon-template-item`,"data-template-id":e.id,"aria-disabled":e.disabled},[(0,t.renderSlot)(n.$slots,`default`,{item:e.item,disabled:e.disabled},()=>[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.item.label??e.item.id),1)])],8,He))}}),We=[`data-item-id`],Ge={key:0,class:`ml-ribbon-item-host__keytip`},Ke=(0,t.defineComponent)({__name:`RibbonItemHost`,props:{id:{},item:{},groupId:{},galleryPreviewFallback:{},disabled:{type:Boolean}},emits:[`item-click`],setup(e,{emit:r}){let a=e,o=r,s=(0,t.inject)(i,null),c=(0,t.computed)(()=>Array.isArray(a.item.props?.options)?a.item.props.options:[]),l=(0,n.useGlobalConfig)(`size`,``),u=(0,t.computed)(()=>l.value||`default`),d=(0,t.computed)(()=>me(s?.tooltipShowAfter.value,1e3)),f=(0,t.computed)(()=>me(s?.tooltipHideAfter.value,0)),p=(0,t.computed)(()=>`ml-ribbon-select-dropdown ml-ribbon-popper ml-ribbon-popper--size-${u.value}`),m=(0,t.computed)(()=>a.item.props?.icon||a.item.icon),h=(0,t.computed)(()=>a.item.hideLabel!==!0),g=(0,t.ref)(void 0),_=(0,t.computed)(()=>a.item.type===`dropdown`&&g.value?g.value:pe(a.item.tooltip)??pe(a.item.label)??ve(a.item)??ye(a.item.id)),v=(0,t.computed)(()=>a.item.type!==`buttonGroup`&&a.item.type!==`segmented`),y=(0,t.computed)(()=>!v.value||!_.value),b=(0,t.computed)(()=>_.value??a.item.id),x=(0,t.computed)(()=>a.item.keyTip?.trim().toUpperCase()??``),S=(0,t.computed)(()=>{if(!s?.keyTipsOpen.value||s?.disabled.value||a.disabled===!0||!x.value)return!1;let e=s.keyTipsSequence.value.toLowerCase();return e?x.value.toLowerCase().startsWith(e):!0}),C=(0,t.computed)(()=>a.disabled===!0||a.item.disabled===!0||s?.disabled.value===!0),w=(0,t.computed)(()=>a.item.props?.modelValue),T=(0,t.computed)(()=>a.item.props?.activeLabel),E=(0,t.computed)(()=>a.item.props?.inactiveLabel),D=(0,t.computed)(()=>Array.isArray(a.item.props?.categories)?a.item.props.categories:[]),O=(0,t.computed)(()=>{let e=a.item.props?.modelValue;return typeof e==`string`?e:void 0}),k=(0,t.computed)(()=>{let e=a.item.props?.inlineItemLimit;return typeof e==`number`?e:void 0}),A=(0,t.computed)(()=>a.item.props?.inlineItemWidthMode===`auto`?`auto`:`fixed`),j=(0,t.computed)(()=>{let e=a.item.props?.component;return!e||typeof e==`string`?null:(0,t.markRaw)((0,t.toRaw)(e))}),M=(0,t.computed)(()=>{let e=a.item.props?.componentProps;return!e||typeof e!=`object`||Array.isArray(e)?{}:e}),P=(0,t.computed)(()=>a.item.props?.wrap!==!1),ee=(0,t.computed)(()=>a.item.props?.equalWidth===!0),F=(0,t.computed)(()=>{let e=a.item.props?.buttonSize;if(e===`large`||e===`default`||e===`small`)return e}),L=(0,t.computed)(()=>q(a.item.props?.iconSize)),R=(0,t.computed)(()=>he(a.item.props?.width??a.item.props?.comboWidth,`92px`)),z=(0,t.computed)(()=>a.item.props?.modelValue),te=(0,t.computed)(()=>he(a.item.props?.width??a.item.props?.inputNumberWidth,`96px`)),ne=(0,t.computed)(()=>a.item.props?.modelValue),re=(0,t.computed)(()=>{let e={...a.item.props??{}};return delete e.modelValue,delete e.width,delete e.inputNumberWidth,delete e.prefixLabel,delete e.prefixIcon,delete e.prefixIconClass,delete e.emitValueOnChange,delete e.valuePrefix,delete e.options,delete e.component,delete e.componentProps,e}),B=(0,t.computed)(()=>_e(a.item.props?.labelWrapLines)),V=(0,t.computed)(()=>ge(a.item.props?.labelWrapWidth)),ie=(0,t.computed)(()=>a.item.type===`button`&&a.item.size===`large`&&h.value&&(B.value??0)>1),ae=(0,t.computed)(()=>{if(!ie.value)return{};let e={"--ml-rb-item-label-max-lines":String(B.value??2)};return V.value&&(e[`--ml-rb-item-label-wrap-width`]=V.value),e});(0,t.watch)(()=>a.item.id,()=>{g.value=void 0});function U(){C.value||o(`item-click`,a.id)}function oe(e){if(!C.value){if(typeof e==`string`||typeof e==`number`){o(`item-click`,String(e));return}U()}}function se(e){g.value=e}function ce(e){if(!C.value){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){o(`item-click`,String(e));return}U()}}function le(e){if(C.value)return;let t=e?a.item.props?.activeValue:a.item.props?.inactiveValue;if(typeof t==`string`||typeof t==`number`||typeof t==`boolean`){o(`item-click`,String(t));return}o(`item-click`,String(e))}function W(e){if(!C.value){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){o(`item-click`,String(e));return}U()}}function G(e){C.value||o(`item-click`,e)}function K(e){if(!C.value){if(a.item.props?.emitValueOnChange===!0&&(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)){o(`item-click`,String(e));return}U()}}function ue(e){if(!C.value){if(a.item.props?.emitValueOnChange===!0&&typeof e==`number`&&Number.isFinite(e)){let t=a.item.props?.valuePrefix;o(`item-click`,`${typeof t==`string`?t:``}${e}`);return}U()}}function de(e){if(!C.value){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){o(`item-click`,String(e));return}U()}}function fe(e){if(!e||typeof e!=`object`)return;let t=e.label;return typeof t==`string`?t:void 0}function pe(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function me(e,t){return typeof e!=`number`||Number.isNaN(e)||!Number.isFinite(e)?t:Math.max(0,Math.round(e))}function he(e,t){if(typeof e==`number`&&Number.isFinite(e)&&e>0)return`${e}px`;if(typeof e==`string`){let n=e.trim();return n?n.toLowerCase()===`full`?`100%`:n:t}return t}function ge(e){if(typeof e==`number`&&Number.isFinite(e)&&e>0)return`${e}px`;if(typeof e==`string`){let t=e.trim();return t?t.toLowerCase()===`full`?`100%`:t:void 0}}function q(e){if(typeof e==`number`&&Number.isFinite(e)&&e>0)return`${e}px`;if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function _e(e){if(!(typeof e!=`number`||Number.isNaN(e)||!Number.isFinite(e)))return Math.max(1,Math.round(e))}function ve(e){let t=c.value.map(e=>fe(e)).filter(e=>!!e);if(t.length)return e.type===`buttonGroup`?t.join(` / `):t[0]}function ye(e){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim();return t?t.replace(/\b\w/g,e=>e.toUpperCase()):e}return(r,i)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{content:_.value,disabled:y.value,"show-after":d.value,"hide-after":f.value,placement:`top`,effect:`dark`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-item-host`,[`is-${e.item.size??`medium`}`,`type-${e.item.type}`,{"is-label-hidden":e.item.hideLabel===!0,"is-label-wrap":ie.value}]]),style:(0,t.normalizeStyle)(ae.value),"data-item-id":e.id,role:`group`},[S.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Ge,(0,t.toDisplayString)(x.value),1)):(0,t.createCommentVNode)(``,!0),e.item.type===`buttonGroup`?((0,t.openBlock)(),(0,t.createBlock)(I,{key:1,id:e.item.id,label:e.item.label??``,options:e.item.props?.options??[],"hide-label":e.item.hideLabel===!0,wrap:P.value,"equal-width":ee.value,"button-size":F.value,"icon-size":L.value,"tooltip-show-after":d.value,"tooltip-hide-after":f.value,disabled:C.value,onChange:W},null,8,[`id`,`label`,`options`,`hide-label`,`wrap`,`equal-width`,`button-size`,`icon-size`,`tooltip-show-after`,`tooltip-hide-after`,`disabled`])):e.item.type===`segmented`?((0,t.openBlock)(),(0,t.createBlock)(Be,{key:2,id:e.item.id,label:e.item.label??e.item.id,options:e.item.props?.options??[],"model-value":e.item.props?.modelValue,direction:e.item.props?.direction??`horizontal`,block:e.item.props?.block===!0,disabled:C.value,"hide-label":e.item.hideLabel===!0,"tooltip-show-after":d.value,"tooltip-hide-after":f.value,onChange:ce},null,8,[`id`,`label`,`options`,`model-value`,`direction`,`block`,`disabled`,`hide-label`,`tooltip-show-after`,`tooltip-hide-after`])):e.item.type===`toggle`?((0,t.openBlock)(),(0,t.createBlock)(Ve,{key:3,id:e.item.id,label:e.item.label??e.item.id,"model-value":w.value,"active-icon":e.item.props?.activeIcon??e.item.props?.icon??e.item.icon,"inactive-icon":e.item.props?.inactiveIcon??e.item.props?.icon??e.item.icon,"active-label":T.value,"inactive-label":E.value,disabled:C.value,"hide-label":e.item.hideLabel===!0,onChange:le},null,8,[`id`,`label`,`model-value`,`active-icon`,`inactive-icon`,`active-label`,`inactive-label`,`disabled`,`hide-label`])):e.item.type===`gallery`?((0,t.openBlock)(),(0,t.createBlock)(X,{key:4,id:e.item.id,label:e.item.label??``,categories:D.value,"model-value":O.value,collapsed:e.item.props?.collapsed===!0,"inline-item-limit":k.value,"inline-item-width-mode":A.value,"preview-fallback":a.galleryPreviewFallback,disabled:C.value,onSelect:G},null,8,[`id`,`label`,`categories`,`model-value`,`collapsed`,`inline-item-limit`,`inline-item-width-mode`,`preview-fallback`,`disabled`])):e.item.type===`custom`||e.item.type===`template`?((0,t.openBlock)(),(0,t.createBlock)(Ue,{key:5,id:e.item.id,item:e.item,disabled:C.value},{default:(0,t.withCtx)(()=>[j.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(j.value),(0,t.mergeProps)({key:0},M.value,{item:e.item,"group-id":e.groupId,disabled:C.value,"emit-item-click":de}),null,16,[`item`,`group-id`,`disabled`])):(0,t.renderSlot)(r.$slots,`template`,{key:1,item:e.item,disabled:C.value})]),_:3},8,[`id`,`item`,`disabled`])):e.item.type===`dropdown`?((0,t.openBlock)(),(0,t.createBlock)(H,{key:6,id:e.item.id,label:e.item.label??e.item.id,tooltip:e.item.tooltip,icon:m.value,options:e.item.props?.options??[],"model-value":e.item.props?.modelValue,disabled:C.value,"hide-label":e.item.hideLabel===!0,"item-size":e.item.size??`medium`,"sync-label-with-selection":e.item.props?.syncLabelWithSelection===!0,"tooltip-show-after":d.value,"tooltip-hide-after":f.value,onCommand:oe,onTooltipChange:se,onClick:U},null,8,[`id`,`label`,`tooltip`,`icon`,`options`,`model-value`,`disabled`,`hide-label`,`item-size`,`sync-label-with-selection`,`tooltip-show-after`,`tooltip-hide-after`])):e.item.type===`checkbox`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElCheckbox),{key:7,disabled:C.value,onChange:U},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.item.label),1)]),_:1},8,[`disabled`])):e.item.type===`colorPicker`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElColorPicker),{key:8,disabled:C.value,onChange:U},null,8,[`disabled`])):e.item.type===`comboBox`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElSelect),{key:9,"model-value":z.value,disabled:C.value,"popper-class":p.value,style:(0,t.normalizeStyle)({width:R.value}),onChange:K},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElOption),{key:String(e.value),label:String(e.label),value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`disabled`,`popper-class`,`style`])):e.item.type===`inputNumber`?((0,t.openBlock)(),(0,t.createBlock)(Fe,{key:10,id:e.item.id,"model-value":ne.value,width:te.value,"prefix-label":e.item.props?.prefixLabel,"prefix-icon":e.item.props?.prefixIcon??e.item.props?.icon??e.item.icon,"prefix-icon-class":e.item.props?.prefixIconClass,"control-props":re.value,disabled:C.value,onChange:ue},null,8,[`id`,`model-value`,`width`,`prefix-label`,`prefix-icon`,`prefix-icon-class`,`control-props`,`disabled`])):((0,t.openBlock)(),(0,t.createBlock)(N,{key:11,id:e.item.id,label:e.item.label??e.item.id,icon:m.value,disabled:C.value,"hide-label":!h.value,"aria-label":b.value,onClick:U},null,8,[`id`,`label`,`icon`,`disabled`,`hide-label`,`aria-label`]))],14,We)]),_:3},8,[`content`,`disabled`,`show-after`,`hide-after`]))}}),$=(0,t.defineComponent)({__name:`RibbonGroupContent`,props:{group:{},galleryPreviewFallback:{},disabled:{type:Boolean}},emits:[`item-click`],setup(e,{emit:n}){let r=e,i=n;return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-group__content`,[`ml-ribbon-group__content--${r.group.orientation??`column`}`]])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.group.collections??[],e=>((0,t.openBlock)(),(0,t.createBlock)(j,{id:e.id,key:e.id,layout:e.layout??(r.group.orientation===`row`?`row`:`column`),rows:e.rows},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createBlock)(Ke,{id:e.id,key:e.id,item:e,"group-id":r.group.id,"gallery-preview-fallback":r.galleryPreviewFallback,disabled:r.disabled,onItemClick:n[0]||=e=>i(`item-click`,{groupId:r.group.id,itemId:e})},null,8,[`id`,`item`,`group-id`,`gallery-preview-fallback`,`disabled`]))),128))]),_:2},1032,[`id`,`layout`,`rows`]))),128))],2))}}),qe=[`data-priority`],Je={class:`ml-ribbon-group__body`},Ye={class:`ml-ribbon-group__footer`},Xe={class:`ml-ribbon-group__title`},Ze=[`aria-label`,`aria-expanded`,`disabled`],Qe={class:`ml-ribbon-group__overflow-content`},$e=[`aria-label`,`aria-expanded`,`disabled`],et={class:`ml-ribbon-group__overflow-content`},tt=(0,t.defineComponent)({__name:`RibbonGroup`,props:{id:{},title:{},icon:{},groupIconCss:{},orientation:{},width:{},priority:{},launcher:{type:Boolean},showLauncherIcon:{type:Boolean},groupModel:{},overflowTriggerAriaLabel:{},galleryPreviewFallback:{},disabled:{type:Boolean}},emits:[`item-click`],setup(e,{emit:a}){let o=e,s=a,c=(0,t.inject)(i,null),l=(0,t.computed)(()=>o.width==null),u=(0,t.computed)(()=>{if(typeof o.width!=`number`||Number.isNaN(o.width)||o.width<=0)return;let e=`${o.width}px`;return{width:e,minWidth:e,maxWidth:e,flex:`0 0 ${e}`}}),d=(0,t.computed)(()=>o.disabled===!0||c?.disabled.value===!0),f=(0,t.ref)(null),p=(0,t.ref)([]),m=(0,t.ref)(null),h=(0,t.ref)(null),g=(0,t.ref)(0),_=(0,t.ref)(0),v=(0,n.useGlobalConfig)(`size`,``),y=(0,t.computed)(()=>v.value||`default`),b=(0,t.computed)(()=>`ml-ribbon-group__overflow-popover ml-ribbon-group__overflow-popover--size-${y.value}`),x=(0,t.computed)(()=>({modifiers:[{name:`offset`,options:{offset:[g.value,8]}}]})),S=(0,t.computed)(()=>({modifiers:[{name:`offset`,options:{offset:[_.value,8]}}]})),C=(0,t.computed)(()=>!o.icon||typeof o.icon==`string`?null:o.icon),w=(0,t.computed)(()=>p.value.length>0),T=(0,t.computed)(()=>(o.groupModel?.footerMenuItems?.length??0)>0),E=(0,t.ref)(!1),D=(0,t.ref)(!1),O=(0,t.computed)(()=>{if(!o.groupModel||!p.value.length)return null;let e=new Set(p.value),t=o.groupModel.collections?.map(t=>({...t,items:t.items.filter(t=>e.has(t.id))})).filter(e=>e.items.length>0)??[];return t.length?{...o.groupModel,collections:t}:null}),k=(0,t.computed)(()=>o.groupModel?.footerMenuItems?.length?{id:`${o.groupModel.id}-footer-menu`,title:``,orientation:`row`,collections:[{id:`${o.groupModel.id}-footer-menu-collection`,layout:`row`,items:o.groupModel.footerMenuItems}]}:null);function A(){let e=f.value?.querySelector(`.ml-ribbon-group__content`);if(!e){p.value.length>0&&(p.value=[]);return}let t=e.getBoundingClientRect();if(t.width<=0||t.height<=0){p.value.length>0&&(p.value=[]);return}let n=[];e.querySelectorAll(`.ml-ribbon-item-host[data-item-id]`).forEach(e=>{let r=e.dataset.itemId;if(!r)return;let i=e.getBoundingClientRect();(i.right-t.right>.5||i.bottom-t.bottom>.5||t.left-i.left>.5||t.top-i.top>.5)&&n.push(r)}),p.value.length===n.length&&p.value.every((e,t)=>e===n[t])||(p.value=n)}function j(){(0,t.nextTick)(()=>{z(),M(),N(),A()})}function M(){let e=f.value?.getBoundingClientRect(),t=m.value?.getBoundingClientRect();if(!e||!t){g.value!==0&&(g.value=0);return}let n=Math.round(e.left-t.left);g.value!==n&&(g.value=n)}function N(){let e=f.value?.getBoundingClientRect(),t=h.value?.getBoundingClientRect();if(!e||!t){_.value!==0&&(_.value=0);return}let n=Math.round(e.left-t.left);_.value!==n&&(_.value=n)}function P(e){E.value=e}function ee(e){D.value=e}function F(){d.value||(E.value=!E.value)}function I(){d.value||(D.value=!D.value)}let L=null,R=null;function z(){if(!L)return;let e=f.value?.querySelector(`.ml-ribbon-group__content`)??null;R!==e&&(R&&L.unobserve(R),e&&L.observe(e),R=e)}return(0,t.watch)(()=>o.groupModel,()=>{j()},{deep:!0}),(0,t.watch)(d,e=>{e&&(E.value=!1,D.value=!1)}),(0,t.onMounted)(()=>{typeof ResizeObserver<`u`&&(L=new ResizeObserver(()=>{M(),N(),A()}),f.value&&L.observe(f.value),z()),j()}),(0,t.onUnmounted)(()=>{L?.disconnect()}),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{ref_key:`groupSectionRef`,ref:f,class:(0,t.normalizeClass)([`ml-ribbon-group`,{"ml-ribbon-group--auto-width":l.value}]),"data-priority":e.priority??100,style:(0,t.normalizeStyle)(u.value)},[(0,t.createElementVNode)(`div`,Je,[(0,t.renderSlot)(i.$slots,`default`)]),(0,t.createElementVNode)(`footer`,Ye,[C.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-group__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(C.value)))]),_:1})):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,Xe,(0,t.toDisplayString)(e.title),1),T.value&&k.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:1,trigger:`click`,placement:`bottom-start`,disabled:d.value,"popper-class":b.value,"popper-options":S.value,onShow:a[1]||=e=>P(!0),onHide:a[2]||=e=>P(!1)},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{ref_key:`footerTriggerRef`,ref:h,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-group__footer-trigger`,{"is-open":E.value}]),"aria-label":e.overflowTriggerAriaLabel,"aria-expanded":E.value,disabled:d.value,onClick:F},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(E.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1})],10,Ze)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Qe,[(0,t.createVNode)($,{group:k.value,"gallery-preview-fallback":e.galleryPreviewFallback,disabled:d.value,onItemClick:a[0]||=e=>s(`item-click`,e)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])])]),_:1},8,[`disabled`,`popper-class`,`popper-options`])):(0,t.createCommentVNode)(``,!0),w.value&&O.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:2,trigger:`click`,placement:`bottom-start`,disabled:d.value,"popper-class":b.value,"popper-options":x.value,onShow:a[4]||=e=>ee(!0),onHide:a[5]||=e=>ee(!1)},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{ref_key:`overflowTriggerRef`,ref:m,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-group__overflow-trigger`,{"is-open":D.value}]),"aria-label":e.overflowTriggerAriaLabel,"aria-expanded":D.value,disabled:d.value,onClick:I},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(D.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1})],10,$e)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,et,[(0,t.createVNode)($,{group:O.value,"gallery-preview-fallback":e.galleryPreviewFallback,disabled:d.value,onItemClick:a[3]||=e=>s(`item-click`,e)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])])]),_:1},8,[`disabled`,`popper-class`,`popper-options`])):(0,t.createCommentVNode)(``,!0),e.showLauncherIcon??e.launcher?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElButton),{key:3,link:``,class:`ml-ribbon-group__launcher`,disabled:d.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.Promotion))]),_:1})]),_:1},8,[`disabled`])):(0,t.createCommentVNode)(``,!0)])],14,qe))}}),nt=[`inert`,`aria-disabled`],rt={class:`ml-ribbon__head-left`},it={class:`ml-ribbon__head-right`},at={key:2,class:`ml-ribbon__tabs-extra`},ot=[`data-active-tab`],st={key:0,class:`ml-ribbon-group ml-ribbon-group--overflow`},ct={class:`ml-ribbon-group__body ml-ribbon-group__body--overflow`},lt=[`aria-label`,`disabled`],ut={class:`ml-ribbon-overflow-list`},dt={class:`ml-ribbon-overflow-group__header`},ft=[`data-active-tab`],pt=[`disabled`],mt={class:`ml-ribbon-simplified-group__panel`},ht=[`data-active-tab`],gt={key:0,class:`ml-ribbon-group ml-ribbon-group--overflow`},_t={class:`ml-ribbon-group__body ml-ribbon-group__body--overflow`},vt=[`aria-label`,`disabled`],yt={class:`ml-ribbon-overflow-list`},bt={class:`ml-ribbon-overflow-group__header`},xt=[`data-active-tab`],St=[`disabled`],Ct={class:`ml-ribbon-simplified-group__panel`},wt=40,Tt=(0,t.defineComponent)({__name:`Ribbon`,props:{id:{default:`ml-ribbon-root`},tabs:{},activeTab:{default:``},activeLayout:{default:void 0},layout:{default:`classic`},size:{default:void 0},minimized:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideLayoutSwitcher:{type:Boolean,default:!1},hideMinimizeButton:{type:Boolean,default:!1},hideKeyTipsToggle:{type:Boolean,default:!1},showFileMenu:{type:Boolean,default:!0},showOpenBackstage:{type:Boolean,default:!0},fileMenuItems:{default:()=>[]},texts:{default:()=>({})},tooltipShowAfter:{default:1e3},tooltipHideAfter:{default:0}},emits:[`update:activeTab`,`update:layout`,`update:minimized`,`tabChange`,`layoutChange`,`itemClick`,`overflowOpen`,`overflowClose`,`backstageOpen`,`backstageClose`,`fileMenuSelect`],setup(e,{expose:a,emit:o}){function s(e){return e==null||typeof e==`string`?e:typeof e==`object`||typeof e==`function`?(0,t.markRaw)((0,t.toRaw)(e)):e}function c(e){if(!e)return;let t={...e};return`component`in t&&(t.component=s(t.component)),`icon`in t&&(t.icon=s(t.icon)),`activeIcon`in t&&(t.activeIcon=s(t.activeIcon)),`inactiveIcon`in t&&(t.inactiveIcon=s(t.inactiveIcon)),Array.isArray(t.options)&&(t.options=t.options.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return`icon`in t?{...t,icon:s(t.icon)}:t})),Array.isArray(t.categories)&&(t.categories=t.categories.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return{...t,items:Array.isArray(t.items)?t.items.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return{...t,preview:s(t.preview),icon:s(t.icon),component:s(t.component)}}):t.items}})),t}function l(e){return{...e,icon:s(e.icon),props:c(e.props)}}function u(e){return{...e,icon:s(e.icon),footerMenuItems:e.footerMenuItems?.map(l),collections:e.collections?.map(e=>({...e,items:e.items?.map(l)}))}}function d(e){return e.map(e=>({...e,groups:e.groups?.map(u)}))}function f(e,t){return typeof e!=`number`||Number.isNaN(e)||!Number.isFinite(e)?t:Math.max(0,Math.round(e))}let m={layoutSwitcherTooltip:`Switch ribbon layout`,minimizeTooltip:`Minimize ribbon`,keyTipsToggleText:`Key Tips`,overflowTriggerAriaLabel:`Open overflow groups`,groupOverflowTriggerAriaLabel:`Open group menu`,fileMenuLabel:`File`,fileMenuOpenBackstageLabel:`Open backstage`,backstageBackLabel:`Back`,backstageTitle:`Backstage`,backstageDescription:`Manage your document and settings here.`,keyTipsSequencePrefix:`Sequence:`,keyTipsEmptySequence:`No key sequence`,galleryPreviewFallback:`Preview unavailable`},h=e,g=o,{context:_,visibleTabs:y}=p(h.id,h.tabs,h.disabled,h.activeLayout?String(h.activeLayout).toLowerCase()===`simplified`?`simplified`:`classic`:h.layout,h.minimized,h.activeTab||h.tabs[0]?.id||``,f(h.tooltipShowAfter,1e3),f(h.tooltipHideAfter,0));(0,t.provide)(i,_),(0,t.watch)(()=>h.tabs,e=>{_.tabs.value=d(e),_.tabs.value.some(e=>e.id===_.activeTab.value)||(_.activeTab.value=_.tabs.value[0]?.id||``)},{deep:!0}),(0,t.watch)(()=>h.layout,e=>{e!==_.layout.value&&(_.layout.value=e)}),(0,t.watch)(()=>h.activeLayout,e=>{if(!e)return;let t=String(e).toLowerCase()===`simplified`?`simplified`:`classic`;t!==_.layout.value&&(_.layout.value=t)}),(0,t.watch)(()=>h.minimized,e=>{e!==_.minimized.value&&(_.minimized.value=e)}),(0,t.watch)(()=>h.disabled,e=>{e!==_.disabled.value&&(_.disabled.value=e)}),(0,t.watch)(()=>h.activeTab,e=>{e&&e!==_.activeTab.value&&(_.activeTab.value=e)}),(0,t.watch)(()=>h.tooltipShowAfter,e=>{let t=f(e,1e3);t!==_.tooltipShowAfter.value&&(_.tooltipShowAfter.value=t)}),(0,t.watch)(()=>h.tooltipHideAfter,e=>{let t=f(e,0);t!==_.tooltipHideAfter.value&&(_.tooltipHideAfter.value=t)}),(0,t.watch)(_.activeTab,e=>{g(`update:activeTab`,e),g(`tabChange`,e)}),(0,t.watch)(_.layout,e=>{g(`update:layout`,e),g(`layoutChange`,e)}),(0,t.watch)(_.minimized,e=>{g(`update:minimized`,e)}),(0,t.watch)(_.overflowOpen,e=>{g(e?`overflowOpen`:`overflowClose`)}),(0,t.watch)(_.backdropOpen,e=>{g(e?`backstageOpen`:`backstageClose`)});let b=(0,t.computed)(()=>y.value.find(e=>e.id===_.activeTab.value)),x=(0,t.computed)(()=>new Set(y.value.filter(e=>e.contextual&&e.contextualMode===`exclusive`).map(e=>e.id))),S=(0,t.computed)(()=>ue(b.value)),C=(0,t.computed)(()=>b.value?.groups?.filter(e=>e.visible!==!1)??[]),w=(0,t.ref)(null),T=(0,t.ref)(null),D=(0,t.ref)(null),O=(0,t.ref)(null),k=(0,t.ref)(!1),j=(0,t.ref)(0),M=(0,t.ref)({left:`0px`,top:`0px`,width:`1px`,height:`0px`}),N=(0,t.ref)(new Set),P=(0,t.ref)({}),ee=(0,n.useGlobalConfig)(`size`,``),F=(0,t.computed)(()=>h.size||ee.value||`default`),I=(0,t.computed)(()=>`ml-ribbon-group-popover ml-ribbon-group-popover--size-${F.value}`),L=(0,t.computed)(()=>`ml-ribbon-overflow-popover ml-ribbon-overflow-popover--size-${F.value}`),R=(0,t.computed)(()=>`ml-ribbon-tab-panel-popover ml-ribbon-tab-panel-popover--size-${F.value}`),z=(0,t.computed)(()=>({layoutSwitcherTooltip:h.texts.layoutSwitcherTooltip||m.layoutSwitcherTooltip,minimizeTooltip:h.texts.minimizeTooltip||m.minimizeTooltip,keyTipsToggleText:h.texts.keyTipsToggleText||m.keyTipsToggleText,overflowTriggerAriaLabel:h.texts.overflowTriggerAriaLabel||m.overflowTriggerAriaLabel,groupOverflowTriggerAriaLabel:h.texts.groupOverflowTriggerAriaLabel||m.groupOverflowTriggerAriaLabel,fileMenuLabel:h.texts.fileMenuLabel||m.fileMenuLabel,fileMenuOpenBackstageLabel:h.texts.fileMenuOpenBackstageLabel||m.fileMenuOpenBackstageLabel,backstageBackLabel:h.texts.backstageBackLabel||m.backstageBackLabel,backstageTitle:h.texts.backstageTitle||m.backstageTitle,backstageDescription:h.texts.backstageDescription||m.backstageDescription,keyTipsSequencePrefix:h.texts.keyTipsSequencePrefix||m.keyTipsSequencePrefix,keyTipsEmptySequence:h.texts.keyTipsEmptySequence||m.keyTipsEmptySequence,galleryPreviewFallback:h.texts.galleryPreviewFallback||m.galleryPreviewFallback})),te=(0,t.computed)(()=>f(h.tooltipShowAfter,1e3)),ne=(0,t.computed)(()=>f(h.tooltipHideAfter,0)),re=(0,t.computed)(()=>_.minimized.value?r.ArrowUpBold:r.ArrowDownBold),B=(0,t.computed)(()=>C.value.filter(e=>!N.value.has(e.id))),V=(0,t.computed)(()=>C.value.filter(e=>N.value.has(e.id))),H=(0,t.computed)(()=>{if(!V.value.length)return 220;let e=V.value.reduce((e,t)=>{let n=P.value[t.id]??U(t);return Math.max(e,n)},0),t=Math.ceil(e+40);return Math.max(220,Math.min(720,t))});function ie(e){let t=(e.collections??[]).flatMap(e=>(e.items??[]).map(e=>({...l(e),size:`medium`})));return{...e,orientation:`row`,collections:[{id:`${e.id}-simplified`,layout:`row`,items:t}]}}function ae(e){return e.priority??100}function U(e){return typeof e.width==`number`&&Number.isFinite(e.width)&&e.width>0?e.width:140}function oe(e){let t={};return e.querySelectorAll(`.ml-ribbon-group`).forEach(e=>{let n=e.dataset.groupId;if(!n)return;let r=e.getBoundingClientRect().width;r>0&&(t[n]=r)}),t}function se(){let e=C.value.reduce((e,t)=>{let n=P.value[t.id]??U(t);return e+Math.max(n,U(t))},0);return Math.max(220,e)}function ce(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--ml-rb-overflow-slot-width`));return Number.isFinite(t)&&t>0?t:wt}function le(){if(_.layout.value!==`classic`){N.value=new Set;return}let e=_.minimized.value?O.value:D.value;if(!e)return;let t=C.value;if(!t.length){N.value=new Set;return}let n=Math.round(e.getBoundingClientRect().width),r=ce(e),i=oe(e);P.value={...P.value,...i};let a=t.filter(e=>e.enableGroupOverflow===!1),o=t.filter(e=>e.enableGroupOverflow!==!1).map((e,t)=>({group:e,index:t})),s=new Set,c=[...o].sort((e,t)=>{let n=ae(t.group)-ae(e.group);return n===0?t.index-e.index:n}),l=e=>i[e.id]??U(e),u=a.reduce((e,t)=>e+l(t),0),d=e=>o.filter(({group:t})=>!e.has(t.id)).reduce((e,{group:t})=>e+l(t),0),f=e=>u+d(e)+(e.size>0?r:0),p=0;for(;f(s)>n&&p<c.length;){let e=c[p].group;s.add(e.id),p+=1}N.value=s}function W(){(0,t.nextTick)(()=>{if(_.layout.value!==`classic`||_.minimized.value){le();return}if(N.value.size===0){le();return}N.value=new Set,(0,t.nextTick)(()=>{le()})})}function G(){let e=w.value,t=T.value;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=Number.parseFloat(getComputedStyle(e).borderLeftWidth||`0`)||0,a=Math.max(n.width-i*2,e.clientWidth,r.width,t.clientWidth);j.value=Math.round(a>0?a:_.layout.value===`classic`?se():Math.max(360,C.value.length*120)),M.value={left:`${Math.round(n.left-r.left+i)}px`,top:`0px`,width:`1px`,height:`${Math.round(r.height)}px`}}function K(){k.value=!1}function ue(e){return _.disabled.value?!0:!e||x.value.size===0?!1:!x.value.has(e.id)}function de(e){if(_.disabled.value)return;let t=_.activeTab.value===e.id;if(_.activeTab.value=e.id,!_.minimized.value){K();return}G(),k.value=t?!k.value:!0}function fe(){_.disabled.value||_.api.toggleSimplified()}function pe(){_.disabled.value||(_.minimized.value||K(),_.minimized.value=!_.minimized.value)}function me(e){_.disabled.value||(K(),g(`fileMenuSelect`,e))}function he(){_.disabled.value||(K(),_.backdropOpen.value=!0)}function ge(){_.disabled.value||(_.backdropOpen.value=!1)}function q(e,t){S.value||(g(`itemClick`,{tabId:_.activeTab.value,groupId:e,itemId:t}),_.minimized.value&&K())}function _e(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function ve(){if(S.value){_.keyTips.value=[];return}let e=b.value;if(!e?.groups?.length){_.keyTips.value=[];return}let t=e.groups.filter(e=>e.visible!==!1).flatMap(t=>(t.collections??[]).flatMap(n=>n.items.filter(e=>e.keyTip&&e.disabled!==!0).map(n=>{let r=n.keyTip?.trim().toUpperCase();return r?{id:`${e.id}:${t.id}:${n.id}`,key:r,targetId:n.id,sequence:r.split(``),scope:`item`}:null}).filter(e=>!!e)));_.keyTips.value=t}function ye(e){if(_.disabled.value)return;let t=b.value;if(t?.groups?.length){for(let n of t.groups)if(n.visible!==!1)for(let t of n.collections??[]){let r=t.items.find(t=>t.id===e.targetId&&t.disabled!==!0);if(r){q(n.id,r.id),_.keyTipsOpen.value=!1,_.keyTipsSequence.value=``;return}}}}function J(){_.keyTipsSequence.value=``}function be(e){if(!_.disabled.value&&!_e(e.target)){if(e.altKey&&!e.ctrlKey&&!e.metaKey&&e.key===`Alt`){e.preventDefault(),_.keyTipsOpen.value=!_.keyTipsOpen.value,_.keyTipsOpen.value||J();return}if(_.keyTipsOpen.value&&!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){e.preventDefault(),_.keyTipsOpen.value=!1,J();return}if(e.key===`Backspace`){e.preventDefault(),_.keyTipsSequence.value=_.keyTipsSequence.value.slice(0,-1);return}if(/^[a-z0-9]$/i.test(e.key)){e.preventDefault();let t=`${_.keyTipsSequence.value}${e.key.toUpperCase()}`;_.keyTipsSequence.value=t;let n=t.toLowerCase(),r=_.keyTips.value.find(e=>e.key.toLowerCase()===n);if(r){ye(r);return}_.keyTips.value.some(e=>e.key.toLowerCase().startsWith(n))||J()}}}}function xe(e){return e.icon&&typeof e.icon!=`string`?e.icon:e.groupIconCss?r.Grid:null}function Se(e){k.value=e}(0,t.watch)([C,()=>_.layout.value,()=>_.minimized.value],()=>{W()}),(0,t.watch)([b,()=>_.tabs.value,()=>_.disabled.value],()=>{ve(),J()},{deep:!0,immediate:!0}),(0,t.watch)(()=>_.keyTipsOpen.value,e=>{e||J()}),(0,t.watch)(()=>_.disabled.value,e=>{e&&(_.overflowOpen.value=!1,_.backdropOpen.value=!1,_.keyTipsOpen.value=!1,K(),J())}),(0,t.watch)([()=>_.minimized.value,()=>_.layout.value,b],([e,,t])=>{(!e||!t)&&K()}),(0,t.watch)([D,O],([e,t],[n,r])=>{n&&Y&&Y.unobserve(n),r&&Y&&Y.unobserve(r),e&&Y&&Y.observe(e),t&&Y&&Y.observe(t),(e||t)&&W()},{flush:`post`}),(0,t.watch)(k,e=>{e&&(0,t.nextTick)(()=>{G(),W()})});let Y=null;(0,t.onMounted)(()=>{window.addEventListener(`keydown`,be),window.addEventListener(`resize`,Ce),typeof ResizeObserver<`u`&&(Y=new ResizeObserver(()=>{G(),W()}),D.value&&Y.observe(D.value),O.value&&Y.observe(O.value)),G(),W()}),(0,t.onUnmounted)(()=>{window.removeEventListener(`keydown`,be),window.removeEventListener(`resize`,Ce),Y?.disconnect()});function Ce(){k.value&&G()}return a(_.api),(i,a)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElConfigProvider),{size:h.size},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{ref_key:`ribbonRootRef`,ref:w,key:(0,t.unref)(_).disabled.value?`ml-ribbon-disabled`:`ml-ribbon-enabled`,class:(0,t.normalizeClass)([`ml-ribbon`,[`ml-ribbon--${(0,t.unref)(_).layout.value}`,`ml-ribbon--size-${F.value}`,{"ml-ribbon--disabled":(0,t.unref)(_).disabled.value,"ml-ribbon--minimized":(0,t.unref)(_).minimized.value,"ml-ribbon--keytips-open":(0,t.unref)(_).keyTipsOpen.value}]]),inert:(0,t.unref)(_).disabled.value,"aria-disabled":(0,t.unref)(_).disabled.value},[(0,t.createElementVNode)(`header`,{ref_key:`ribbonHeaderRef`,ref:T,class:`ml-ribbon__header`},[(0,t.createElementVNode)(`div`,rt,[e.showFileMenu?((0,t.openBlock)(),(0,t.createBlock)(A,{key:0,items:e.fileMenuItems,disabled:(0,t.unref)(_).disabled.value,label:z.value.fileMenuLabel,"open-backstage-label":z.value.fileMenuOpenBackstageLabel,"show-open-backstage":e.showOpenBackstage,onSelect:me,onOpenBackstage:he},null,8,[`items`,`disabled`,`label`,`open-backstage-label`,`show-open-backstage`])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(E,{tabs:(0,t.unref)(y),"active-tab":(0,t.unref)(_).activeTab.value,disabled:(0,t.unref)(_).disabled.value,onSelect:de},null,8,[`tabs`,`active-tab`,`disabled`]),h.hideMinimizeButton?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{key:1,content:z.value.minimizeTooltip,"show-after":te.value,"hide-after":ne.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{class:(0,t.normalizeClass)([`ml-ribbon__control`,`ml-ribbon__control--minimize`,(0,t.unref)(_).minimized.value?`ml-ribbon__control--minimize-up`:`ml-ribbon__control--minimize-down`]),icon:re.value,disabled:(0,t.unref)(_).disabled.value,onClick:pe},null,8,[`class`,`icon`,`disabled`])]),_:1},8,[`content`,`show-after`,`hide-after`]))]),(0,t.createElementVNode)(`div`,it,[h.hideLayoutSwitcher?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{key:0,content:z.value.layoutSwitcherTooltip,"show-after":te.value,"hide-after":ne.value},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{circle:``,class:`ml-ribbon__control ml-ribbon__control--layout`,icon:(0,t.unref)(r.Menu),disabled:(0,t.unref)(_).disabled.value,onClick:fe},null,8,[`icon`,`disabled`])]),_:1},8,[`content`,`show-after`,`hide-after`])),h.hideKeyTipsToggle?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElSwitch),{key:1,"inline-prompt":``,class:`ml-ribbon__control ml-ribbon__control--keytips`,"active-text":z.value.keyTipsToggleText,"inactive-text":z.value.keyTipsToggleText,"model-value":(0,t.unref)(_).keyTipsOpen.value,disabled:(0,t.unref)(_).disabled.value,onChange:a[0]||=e=>(0,t.unref)(_).keyTipsOpen.value=!(0,t.unref)(_).keyTipsOpen.value},null,8,[`active-text`,`inactive-text`,`model-value`,`disabled`])),i.$slots[`tabs-extra`]?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,at,[(0,t.renderSlot)(i.$slots,`tabs-extra`,{activeTab:(0,t.unref)(_).activeTab.value,layout:(0,t.unref)(_).layout.value,minimized:(0,t.unref)(_).minimized.value,disabled:(0,t.unref)(_).disabled.value})])):(0,t.createCommentVNode)(``,!0)]),b.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:0,placement:`bottom-start`,visible:k.value,width:j.value||void 0,disabled:(0,t.unref)(_).disabled.value||!(0,t.unref)(_).minimized.value,"show-arrow":!1,offset:0,"popper-class":R.value,"onUpdate:visible":Se},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,{"aria-hidden":`true`,class:`ml-ribbon__minimized-anchor`,style:(0,t.normalizeStyle)(M.value)},null,4)]),default:(0,t.withCtx)(()=>[(0,t.unref)(_).layout.value===`classic`?((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:0,ref_key:`minimizedClassicPanelRef`,ref:O,class:`ml-ribbon__panel ml-ribbon__panel--floating`,"data-active-tab":b.value.id},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(B.value,e=>((0,t.openBlock)(),(0,t.createBlock)(tt,{id:e.id,key:e.id,"data-group-id":e.id,title:e.title,icon:e.icon,"group-icon-css":e.groupIconCss,orientation:e.orientation,width:e.width,priority:e.priority??100,launcher:e.launcher,"show-launcher-icon":e.showLauncherIcon,"group-model":e,"overflow-trigger-aria-label":z.value.groupOverflowTriggerAriaLabel,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[2]||=e=>q(e.groupId,e.itemId)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)($,{group:e,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[1]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])]),_:2},1032,[`id`,`data-group-id`,`title`,`icon`,`group-icon-css`,`orientation`,`width`,`priority`,`launcher`,`show-launcher-icon`,`group-model`,`overflow-trigger-aria-label`,`gallery-preview-fallback`,`disabled`]))),128)),V.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,st,[(0,t.createElementVNode)(`div`,ct,[(0,t.createVNode)((0,t.unref)(n.ElPopover),{trigger:`click`,placement:`bottom-end`,width:H.value,disabled:S.value,"show-arrow":!1,"popper-class":L.value,onShow:a[4]||=e=>(0,t.unref)(_).overflowOpen.value=!0,onHide:a[5]||=e=>(0,t.unref)(_).overflowOpen.value=!1},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:`ml-ribbon-overflow-trigger`,"aria-label":z.value.overflowTriggerAriaLabel,disabled:S.value},[...a[13]||=[(0,t.createElementVNode)(`span`,{class:`ml-ribbon-overflow-trigger__dots`},`...`,-1)]],8,lt)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ut,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(V.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-overflow-group`},[(0,t.createElementVNode)(`header`,dt,(0,t.toDisplayString)(e.title),1),(0,t.createVNode)($,{group:e,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[3]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])]))),128))])]),_:1},8,[`width`,`disabled`,`popper-class`])]),a[14]||=(0,t.createElementVNode)(`footer`,{class:`ml-ribbon-group__footer ml-ribbon-group__footer--overflow`},null,-1)])):(0,t.createCommentVNode)(``,!0)],8,ot)):((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:1,class:`ml-ribbon__panel ml-ribbon__panel--simplified ml-ribbon__panel--floating`,"data-active-tab":b.value.id},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(C.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:e.id,trigger:`click`,placement:`bottom-start`,width:340,disabled:S.value,"show-arrow":!1,"popper-class":I.value},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`ml-ribbon-simplified-group`,type:`button`,disabled:S.value},[xe(e)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-simplified-group__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(xe(e))))]),_:2},1024)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.title),1)],8,pt)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,mt,[(0,t.createVNode)($,{group:ie(e),"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[6]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])])]),_:2},1032,[`disabled`,`popper-class`]))),128))],8,ft))]),_:1},8,[`visible`,`width`,`disabled`,`popper-class`])):(0,t.createCommentVNode)(``,!0)],512),!(0,t.unref)(_).minimized.value&&b.value&&(0,t.unref)(_).layout.value===`classic`?((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:0,class:`ml-ribbon__panel`,"data-active-tab":b.value.id,ref_key:`classicPanelRef`,ref:D},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(B.value,e=>((0,t.openBlock)(),(0,t.createBlock)(tt,{id:e.id,key:e.id,"data-group-id":e.id,title:e.title,icon:e.icon,"group-icon-css":e.groupIconCss,orientation:e.orientation,width:e.width,priority:e.priority??100,launcher:e.launcher,"show-launcher-icon":e.showLauncherIcon,"group-model":e,"overflow-trigger-aria-label":z.value.groupOverflowTriggerAriaLabel,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[8]||=e=>q(e.groupId,e.itemId)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)($,{group:e,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[7]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])]),_:2},1032,[`id`,`data-group-id`,`title`,`icon`,`group-icon-css`,`orientation`,`width`,`priority`,`launcher`,`show-launcher-icon`,`group-model`,`overflow-trigger-aria-label`,`gallery-preview-fallback`,`disabled`]))),128)),V.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,gt,[(0,t.createElementVNode)(`div`,_t,[(0,t.createVNode)((0,t.unref)(n.ElPopover),{trigger:`click`,placement:`bottom-end`,width:H.value,disabled:S.value,"popper-class":L.value,onShow:a[10]||=e=>(0,t.unref)(_).overflowOpen.value=!0,onHide:a[11]||=e=>(0,t.unref)(_).overflowOpen.value=!1},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:`ml-ribbon-overflow-trigger`,"aria-label":z.value.overflowTriggerAriaLabel,disabled:S.value},[...a[15]||=[(0,t.createElementVNode)(`span`,{class:`ml-ribbon-overflow-trigger__dots`},`...`,-1)]],8,vt)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,yt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(V.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-overflow-group`},[(0,t.createElementVNode)(`header`,bt,(0,t.toDisplayString)(e.title),1),(0,t.createVNode)($,{group:e,"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[9]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])]))),128))])]),_:1},8,[`width`,`disabled`,`popper-class`])]),a[16]||=(0,t.createElementVNode)(`footer`,{class:`ml-ribbon-group__footer ml-ribbon-group__footer--overflow`},null,-1)])):(0,t.createCommentVNode)(``,!0)],8,ht)):(0,t.createCommentVNode)(``,!0),!(0,t.unref)(_).minimized.value&&b.value&&(0,t.unref)(_).layout.value===`simplified`?((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:1,class:`ml-ribbon__panel ml-ribbon__panel--simplified`,"data-active-tab":b.value.id},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(C.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:e.id,trigger:`click`,placement:`bottom-start`,width:340,disabled:S.value,"popper-class":I.value},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`ml-ribbon-simplified-group`,type:`button`,disabled:S.value},[xe(e)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-simplified-group__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(xe(e))))]),_:2},1024)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.title),1)],8,St)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Ct,[(0,t.createVNode)($,{group:ie(e),"gallery-preview-fallback":z.value.galleryPreviewFallback,disabled:S.value,onItemClick:a[12]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`,`disabled`])])]),_:2},1032,[`disabled`,`popper-class`]))),128))],8,xt)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(v,{open:(0,t.unref)(_).backdropOpen.value,size:F.value,"back-label":z.value.backstageBackLabel,title:z.value.backstageTitle,description:z.value.backstageDescription,onClose:ge},(0,t.createSlots)({_:2},[i.$slots.backstage?{name:`default`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(i.$slots,`backstage`,{close:ge,open:(0,t.unref)(_).backdropOpen.value,size:F.value,backLabel:z.value.backstageBackLabel,title:z.value.backstageTitle,description:z.value.backstageDescription,disabled:(0,t.unref)(_).disabled.value})]),key:`0`}:void 0]),1032,[`open`,`size`,`back-label`,`title`,`description`])],10,nt))]),_:3},8,[`size`]))}}),Et={class:`ml-ribbon-tab-definition`,hidden:``},Dt=(0,t.defineComponent)({__name:`RibbonTab`,props:{id:{},title:{},visible:{type:Boolean},contextual:{type:Boolean},contextualColor:{},contextualTitle:{}},setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Et,[(0,t.renderSlot)(e.$slots,`default`)]))}}),Ot={key:0,class:`ml-ribbon-keytips`,"aria-live":`polite`},kt={class:`ml-ribbon-keytips__hint`},At=(0,t.defineComponent)({__name:`RibbonKeyTips`,props:{open:{type:Boolean},tips:{default:()=>[]},sequencePrefix:{},emptySequenceText:{}},emits:[`activate`,`close`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(``),o=(0,t.computed)(()=>a.value?r.tips.filter(e=>e.key.toLowerCase().startsWith(a.value.toLowerCase())):r.tips),s=(0,t.computed)(()=>a.value||r.emptySequenceText||``),c=(0,t.computed)(()=>r.sequencePrefix?`${r.sequencePrefix}${s.value}`:s.value),l=(0,t.computed)(()=>a.value.toLowerCase()),u=(0,t.computed)(()=>r.tips.filter(e=>e.key.toLowerCase()===l.value)),d=(0,t.computed)(()=>r.tips.some(e=>e.key.toLowerCase().startsWith(l.value)));function f(){a.value=``}function p(e){if(r.open&&!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){e.preventDefault(),f(),i(`close`);return}if(e.key===`Backspace`){e.preventDefault(),a.value=a.value.slice(0,-1);return}if(/^[a-z0-9]$/i.test(e.key)){if(e.preventDefault(),a.value+=e.key.toUpperCase(),u.value.length>0){i(`activate`,u.value[0]),f();return}d.value||f()}}}return(0,t.onMounted)(()=>window.addEventListener(`keydown`,p)),(0,t.onUnmounted)(()=>window.removeEventListener(`keydown`,p)),(0,t.watch)(()=>r.open,e=>{e||f()}),(n,r)=>e.open?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ot,[(0,t.createElementVNode)(`div`,kt,(0,t.toDisplayString)(c.value),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.id,class:`ml-ribbon-keytip`},(0,t.toDisplayString)(e.key),1))),128))])):(0,t.createCommentVNode)(``,!0)}});e.MlRibbon=Tt,e.MlRibbonBackstage=v,e.MlRibbonButton=N,e.MlRibbonButtonGroup=I,e.MlRibbonCollection=j,e.MlRibbonContextualTabs=E,e.MlRibbonDropdown=H,e.MlRibbonFileMenu=A,e.MlRibbonGallery=X,e.MlRibbonGroup=tt,e.MlRibbonInputNumber=Fe,e.MlRibbonItemHost=Ke,e.MlRibbonKeyTips=At,e.MlRibbonSegmented=Be,e.MlRibbonTab=Dt,e.MlRibbonTabs=x,e.MlRibbonTemplateItem=Ue,e.MlRibbonToggleButton=Ve});
package/dist/types.d.ts CHANGED
@@ -18,6 +18,11 @@ export interface FileMenuItemModel {
18
18
  id: string;
19
19
  label: string;
20
20
  disabled?: boolean;
21
+ /**
22
+ * When true, renders a divider line above this item (Element Plus `divided`).
23
+ * Also applies to nested `children` entries.
24
+ */
25
+ divided?: boolean;
21
26
  children?: FileMenuItemModel[];
22
27
  }
23
28
  export interface RibbonLocaleTexts {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/ribbon",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "type": "module",
5
5
  "main": "./dist/ml-ribbon.es.js",
6
6
  "module": "./dist/ml-ribbon.es.js",