@norio-office/rich-text 0.8.3 → 0.8.5

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.
@@ -259,7 +259,7 @@
259
259
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
260
260
  <svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M800.768 477.184c-14.336 0-30.72 2.048-45.056 4.096 18.432-51.2 77.824-188.416 237.568-315.392 36.864-28.672-20.48-86.016-59.392-57.344-155.648 116.736-356.352 317.44-356.352 573.44v20.48c0 122.88 100.352 223.232 223.232 223.232S1024 825.344 1024 702.464c0-124.928-100.352-225.28-223.232-225.28zM223.232 477.184c-14.336 0-30.72 2.048-45.056 4.096 18.432-51.2 77.824-188.416 237.568-315.392 36.864-28.672-20.48-86.016-59.392-57.344C200.704 225.28 0 425.984 0 681.984v20.48c0 122.88 100.352 223.232 223.232 223.232s223.232-100.352 223.232-223.232c0-124.928-100.352-225.28-223.232-225.28z" fill="#336DF4" /></svg>`,Yt=`<?xml version="1.0" standalone="no"?>
261
261
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
262
- <svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M338.432 76.8h604.5184a56.832 56.832 0 0 1 0 113.664H338.432a56.832 56.832 0 0 1 0-113.664z m0 384h604.5184a56.832 56.832 0 0 1 0 113.664H338.432a56.832 56.832 0 1 1 0-113.664z m0 384h604.5184a56.832 56.832 0 0 1 0 113.664H338.432a56.832 56.832 0 1 1 0-113.664zM166.6048 51.2v204.8H109.9776V121.8048a172.032 172.032 0 0 1-26.5728 16.896A207.616 207.616 0 0 1 51.2 151.04v-45.8752c19.0464-6.144 33.792-13.4656 44.3904-22.1184 10.496-8.6016 18.7392-19.2 24.6784-31.8464h46.336z m52.4288 563.2H51.2c1.9456-16.5888 7.7824-32.1536 17.5104-46.7456 9.728-14.6432 28.0576-31.8464 54.8864-51.712 16.384-12.1856 26.88-21.504 31.4368-27.7504a31.0784 31.0784 0 0 0 6.8608-18.0224 20.992 20.992 0 0 0-6.7584-15.7184 23.7056 23.7056 0 0 0-17.1008-6.5536 23.8592 23.8592 0 0 0-17.5616 6.7584c-4.5056 4.5056-7.5776 12.3904-9.1136 23.7568L55.296 473.9072c2.2016-15.7696 6.2464-28.0576 12.1344-36.864 5.8368-8.8576 14.08-15.6672 24.7808-20.3776 10.6496-4.7104 25.4464-7.0656 44.288-7.0656 19.712 0 35.0208 2.2528 45.9264 6.7072 10.9568 4.5056 19.5584 11.4176 25.856 20.6848 6.2464 9.3184 9.4208 19.712 9.4208 31.232 0 12.288-3.584 24.064-10.8032 35.1744-7.168 11.2128-20.2752 23.4496-39.2192 36.864a414.72 414.72 0 0 0-22.5792 16.3328c-3.84 3.072-8.2944 7.168-13.4144 12.1856h87.3472V614.4z m-112.8448 239.872l-52.0192-9.3184c4.3008-16.5888 12.6464-29.2864 24.9344-38.0928 12.288-8.8576 29.696-13.2608 52.224-13.2608 25.8048 0 44.544 4.8128 56.064 14.4384a45.4144 45.4144 0 0 1 17.2544 36.352 40.6016 40.6016 0 0 1-7.0144 23.2448c-4.6592 6.912-11.776 13.0048-21.1968 18.2272 7.68 1.8944 13.5168 4.096 17.5616 6.656 6.5536 4.0448 11.6736 9.3696 15.36 15.9744 3.584 6.656 5.4272 14.5408 5.4272 23.7056 0 11.52-3.0208 22.5792-9.0624 33.1776a60.6208 60.6208 0 0 1-26.0608 24.4224c-11.3152 5.7344-26.2656 8.6016-44.6976 8.6016-18.0224 0-32.256-2.0992-42.6496-6.3488a63.6416 63.6416 0 0 1-25.6-18.5856 85.3504 85.3504 0 0 1-15.5136-30.72l54.9888-7.3216c2.1504 11.1104 5.5296 18.7904 10.0352 23.04a24.32 24.32 0 0 0 17.408 6.4512 23.8592 23.8592 0 0 0 18.432-8.1408 30.9248 30.9248 0 0 0 7.3216-21.6064c0-9.216-2.3552-16.2816-7.0656-21.3504a25.088 25.088 0 0 0-19.2512-7.5264c-4.3008 0-10.24 1.024-17.8176 3.2256l2.816-39.3216c3.072 0.4608 5.4272 0.6656 7.168 0.6656a25.088 25.088 0 0 0 18.0224-6.8608 21.8112 21.8112 0 0 0 7.2192-16.384 19.5584 19.5584 0 0 0-5.376-14.4384 20.0704 20.0704 0 0 0-14.848-5.376 21.8112 21.8112 0 0 0-15.872 5.8368c-3.9936 3.9424-6.7584 10.8032-8.192 20.6336z" fill="#5B65F5" /></svg>`,Xt=Object.assign({"./assets/icons/mono/To-do.svg":j,"./assets/icons/mono/add-circle.svg":ce,"./assets/icons/mono/add.svg":le,"./assets/icons/mono/attachment.svg":ue,"./assets/icons/mono/back.svg":de,"./assets/icons/mono/beijingse.svg":fe,"./assets/icons/mono/charutupian.svg":pe,"./assets/icons/mono/close.svg":me,"./assets/icons/mono/code.svg":he,"./assets/icons/mono/codeblock.svg":ge,"./assets/icons/mono/comment.svg":_e,"./assets/icons/mono/cut.svg":ve,"./assets/icons/mono/dagang.svg":ye,"./assets/icons/mono/days.svg":be,"./assets/icons/mono/delete.svg":xe,"./assets/icons/mono/drag.svg":Se,"./assets/icons/mono/edit.svg":Ce,"./assets/icons/mono/fangdayulan.svg":we,"./assets/icons/mono/folder.svg":Te,"./assets/icons/mono/gaoliangkuai.svg":Ee,"./assets/icons/mono/h1.svg":De,"./assets/icons/mono/h2.svg":Oe,"./assets/icons/mono/h3.svg":ke,"./assets/icons/mono/h4.svg":Ae,"./assets/icons/mono/h5.svg":je,"./assets/icons/mono/h6.svg":Me,"./assets/icons/mono/huanyuan.svg":Ne,"./assets/icons/mono/image.svg":Pe,"./assets/icons/mono/jiacu.svg":Fe,"./assets/icons/mono/jianshao.svg":Ie,"./assets/icons/mono/juzhongduiqi.svg":Le,"./assets/icons/mono/kapianyulan.svg":Re,"./assets/icons/mono/link.svg":ze,"./assets/icons/mono/mark.svg":Be,"./assets/icons/mono/merge.svg":Ve,"./assets/icons/mono/quanpingzuidahua.svg":He,"./assets/icons/mono/redo.svg":Ue,"./assets/icons/mono/rubber.svg":We,"./assets/icons/mono/save.svg":Ge,"./assets/icons/mono/shangbiao.svg":Ke,"./assets/icons/mono/shangfangtianjia.svg":qe,"./assets/icons/mono/shezhi.svg":Je,"./assets/icons/mono/shixinxiangyou.svg":Ye,"./assets/icons/mono/smile.svg":Xe,"./assets/icons/mono/split.svg":Ze,"./assets/icons/mono/switch.svg":Qe,"./assets/icons/mono/text-color.svg":$e,"./assets/icons/mono/text.svg":et,"./assets/icons/mono/wenziyulan.svg":tt,"./assets/icons/mono/wuxuliebiao.svg":nt,"./assets/icons/mono/xiabiao.svg":rt,"./assets/icons/mono/xiafangtianjia.svg":it,"./assets/icons/mono/xiahuaxian.svg":at,"./assets/icons/mono/xiangshangcharu.svg":ot,"./assets/icons/mono/xiangxiacharujilu-copy.svg":st,"./assets/icons/mono/xiangxiajiantou.svg":ct,"./assets/icons/mono/xiangyoucharu.svg":lt,"./assets/icons/mono/xiangzuocharu.svg":ut,"./assets/icons/mono/xieti.svg":dt,"./assets/icons/mono/xuanzhuan.svg":ft,"./assets/icons/mono/yanse.svg":pt,"./assets/icons/mono/yanshi.svg":mt,"./assets/icons/mono/yinyong.svg":ht,"./assets/icons/mono/youduiqi.svg":gt,"./assets/icons/mono/youjiantou.svg":_t,"./assets/icons/mono/yousuojin.svg":vt,"./assets/icons/mono/youxuliebiao.svg":yt,"./assets/icons/mono/yulan.svg":bt,"./assets/icons/mono/zhuti.svg":xt,"./assets/icons/mono/zuoduiqi.svg":St,"./assets/icons/mono/zuojiantou.svg":Ct,"./assets/icons/mono/zuosuojin.svg":wt}),Zt=Object.assign({"./assets/icons/color/ai-mark.svg":Tt,"./assets/icons/color/biaoge.svg":Et,"./assets/icons/color/daimakuai.svg":Dt,"./assets/icons/color/daojishi.svg":Ot,"./assets/icons/color/dayin.svg":kt,"./assets/icons/color/duihao.svg":At,"./assets/icons/color/fengexian.svg":jt,"./assets/icons/color/fenlan.svg":Mt,"./assets/icons/color/file.svg":Nt,"./assets/icons/color/gaoliangkuai1.svg":Pt,"./assets/icons/color/jisuangongshi.svg":Ft,"./assets/icons/color/markdown.svg":It,"./assets/icons/color/pdfdaochu.svg":Lt,"./assets/icons/color/renwu.svg":Rt,"./assets/icons/color/rich-text-document.svg":zt,"./assets/icons/color/riqi.svg":Bt,"./assets/icons/color/shipin.svg":Vt,"./assets/icons/color/tupian.svg":Ht,"./assets/icons/color/tupiandaochu.svg":Ut,"./assets/icons/color/wangye.svg":Wt,"./assets/icons/color/wenjianjia.svg":Gt,"./assets/icons/color/wuxuliebiao.svg":Kt,"./assets/icons/color/xiazai.svg":qt,"./assets/icons/color/yinyong.svg":Jt,"./assets/icons/color/youxuliebiao.svg":Yt});function Qt(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.split(`/`).pop()?.replace(/\.svg$/i,``)??e,String(t)]))}var $t=Qt(Xt),en=Qt(Zt),tn=Object.keys($t).sort(),nn=Object.keys(en).sort(),rn=[`data-name`,`title`,`innerHTML`],an=(0,t.defineComponent)({__name:`OfficeColorIcon`,props:{name:{},size:{default:22},backgroundColor:{default:`#ffffff`}},setup(e){let n=e,r=(0,t.computed)(()=>en[n.name]??``),i=(0,t.computed)(()=>typeof n.size==`number`?`${n.size}px`:n.size),a=(0,t.computed)(()=>({width:i.value,height:i.value,backgroundColor:n.backgroundColor}));return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{class:(0,t.normalizeClass)([`norio-office-rich-icon`,{"norio-office-rich-icon--missing":!r.value}]),style:(0,t.normalizeStyle)(a.value),"data-name":e.name,title:r.value?void 0:`Unknown icon: ${e.name}`,innerHTML:r.value},null,14,rn))}}),on=[`data-name`,`title`,`innerHTML`],M=(0,t.defineComponent)({__name:`OfficeIcon`,props:{name:{},size:{default:22},color:{default:`currentColor`},backgroundColor:{default:`#ffffff`}},setup(e){let n=e,r=(0,t.computed)(()=>$t[n.name]??``),i=(0,t.computed)(()=>typeof n.size==`number`?`${n.size}px`:n.size),a=(0,t.computed)(()=>({width:i.value,height:i.value,color:n.color,backgroundColor:n.backgroundColor}));return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{class:(0,t.normalizeClass)([`norio-office-rich-icon`,{"norio-office-rich-icon--missing":!r.value}]),style:(0,t.normalizeStyle)(a.value),"data-name":e.name,title:r.value?void 0:`Unknown icon: ${e.name}`,innerHTML:r.value},null,14,on))}}),sn=(0,t.defineComponent)({__name:`ScrollArea`,props:{maxHeight:{default:``},className:{default:``}},setup(e){let n=e;return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`norio-office-rich-scroll-area`,e.className]),style:(0,t.normalizeStyle)(n.maxHeight?{maxHeight:n.maxHeight}:void 0)},[(0,t.renderSlot)(r.$slots,`default`)],6))}}),cn={key:0,class:`office-collaboration-presence`,"aria-label":`协作状态和成员`},ln={class:`office-collaboration-presence__status`,role:`status`,"aria-live":`polite`},un=[`data-status`],dn={key:0,class:`office-collaboration-presence__divider`,"aria-hidden":`true`},fn={key:1,class:`office-collaboration-presence__avatars`,"aria-label":`协作成员`},pn=[`title`,`aria-label`],mn=[`src`,`onError`],hn={key:1},gn=[`aria-label`,`aria-expanded`],_n=[`aria-label`],vn=[`src`,`onError`],yn={key:1},bn=[`title`],xn=(0,t.defineComponent)({__name:`CollaborationPresence`,props:{presence:{}},setup(e){let n=e,r=`collaboration-members-${(0,t.useId)()}`,i=(0,t.ref)(!1),a=(0,t.ref)(new Set),o=(0,t.computed)(()=>{let e=new Map;for(let t of n.presence?.members??[]){if(typeof t.userId!=`string`||!t.userId.trim())continue;let n=e.get(t.userId);n?!n.avatar&&t.avatar&&e.set(t.userId,{...n,avatar:t.avatar}):e.set(t.userId,t)}return[...e.values()]}),s=(0,t.computed)(()=>o.value.slice(0,5)),c=(0,t.computed)(()=>o.value.slice(5)),l=(0,t.computed)(()=>({connected:`已连接`,offline:`离线`,connecting:`正在连接`})[n.presence?.status??`offline`]),u=(0,t.computed)(()=>`${Math.min(150,c.value.length*38+12)}px`);function d(e){return Array.from(e.name?.trim()||e.userId.trim())[0]||`?`}function f(e){let t=[`#2563eb`,`#16a34a`,`#dc2626`,`#9333ea`,`#ea580c`,`#0891b2`,`#4f46e5`,`#0f766e`],n=0;for(let t of e.userId)n=n*31+t.codePointAt(0)|0;return t[(n>>>0)%t.length]}function p(e){return`${e.userId}:${e.avatar}`}function m(e){a.value=new Set([...a.value,p(e)])}function h(e){return!!e.avatar&&!a.value.has(p(e))}function g(e){e.currentTarget.contains(e.relatedTarget)||(i.value=!1)}function _(e){if(e.target?.closest?.(`[aria-controls="${r}"]`))return;let t=document.getElementById(r)?.getBoundingClientRect();t&&e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top-12&&e.clientY<=t.bottom||(i.value=!1)}return(0,t.watch)(i,e=>{e?(document.addEventListener(`pointermove`,_),document.addEventListener(`pointerdown`,_)):(document.removeEventListener(`pointermove`,_),document.removeEventListener(`pointerdown`,_))}),(0,t.onBeforeUnmount)(()=>{document.removeEventListener(`pointermove`,_),document.removeEventListener(`pointerdown`,_)}),(0,t.watch)(()=>n.presence?.enabled,e=>{e||(i.value=!1)}),(0,t.watch)(c,e=>{e.length||(i.value=!1)}),(n,a)=>e.presence?.enabled?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cn,[(0,t.createElementVNode)(`span`,ln,[(0,t.createElementVNode)(`span`,{class:`office-collaboration-presence__dot`,"data-status":e.presence.status,"aria-hidden":`true`},null,8,un),(0,t.createTextVNode)((0,t.toDisplayString)(l.value),1)]),o.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,dn)):(0,t.createCommentVNode)(``,!0),o.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fn,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.userId,class:`office-collaboration-presence__avatar`,style:(0,t.normalizeStyle)({backgroundColor:f(e)}),title:e.name||e.userId,"aria-label":e.name||e.userId,role:`img`},[h(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:e.avatar,alt:``,referrerpolicy:`no-referrer`,onError:t=>m(e)},null,40,mn)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,hn,(0,t.toDisplayString)(d(e)),1))],12,pn))),128)),c.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`office-collaboration-presence__overflow`,onMouseenter:a[2]||=e=>i.value=!0,onFocusout:g,onKeydown:a[3]||=(0,t.withKeys)((0,t.withModifiers)(e=>i.value=!1,[`stop`,`prevent`]),[`esc`])},[(0,t.createElementVNode)(`button`,{type:`button`,class:`office-collaboration-presence__count`,"aria-label":`其余 ${c.value.length} 位协作成员`,"aria-expanded":i.value,"aria-controls":r,onClick:a[0]||=(0,t.withModifiers)(e=>i.value=!0,[`stop`]),onFocus:a[1]||=e=>i.value=!0},`+`+(0,t.toDisplayString)(c.value.length),41,gn),i.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,id:r,class:`office-collaboration-presence__popover`,style:(0,t.normalizeStyle)({height:u.value}),role:`region`,"aria-label":`其余协作成员`},[(0,t.createVNode)(sn,{class:`office-collaboration-presence__viewport`,"max-height":`150px`},{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.createElementBlock)(`div`,{key:e.userId,class:`office-collaboration-presence__member`},[(0,t.createElementVNode)(`span`,{class:`office-collaboration-presence__avatar`,style:(0,t.normalizeStyle)({backgroundColor:f(e)}),role:`img`,"aria-label":e.name||e.userId},[h(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:e.avatar,alt:``,loading:`lazy`,referrerpolicy:`no-referrer`,onError:t=>m(e)},null,40,vn)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,yn,(0,t.toDisplayString)(d(e)),1))],12,_n),(0,t.createElementVNode)(`span`,{class:`office-collaboration-presence__name`,title:e.name||e.userId},(0,t.toDisplayString)(e.name||e.userId),9,bn)]))),128))]),_:1})],4)):(0,t.createCommentVNode)(``,!0)],32)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)}}),Sn=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Cn=Sn(xn,[[`__scopeId`,`data-v-6d14c476`]]),wn=[[`#FFFFFF`,`#16181D`,`#4C5563`,`#2F6BFF`,`#1DA1F2`,`#19B36B`,`#F2573F`,`#FF8B24`,`#F7C200`,`#9333EA`],[`#F4F5F7`,`#D9DEE7`,`#C2C9D6`,`#DDE9FF`,`#D6EFFB`,`#D8F4E5`,`#FDE1DD`,`#FFE9D2`,`#FFF3C4`,`#F1D8FF`],[`#E6E8EC`,`#BFC6D4`,`#A8B1C4`,`#BED3FF`,`#B9E5F8`,`#B8ECD2`,`#F9C3BC`,`#FFD6AC`,`#FFE58C`,`#E4BCFF`],[`#D1D5DB`,`#9CA3AF`,`#6B7280`,`#8BB2FF`,`#86D3F3`,`#7DDEAB`,`#F69B8F`,`#FFBB79`,`#F9D45C`,`#CE97FF`],[`#9AA4B2`,`#4B5563`,`#374151`,`#4C7DFF`,`#2BAFE3`,`#22C55E`,`#EF6B59`,`#F59E0B`,`#D4A500`,`#A855F7`],[`#6B7280`,`#111827`,`#1F2937`,`#1D4ED8`,`#1473C5`,`#15803D`,`#DC2626`,`#C56A06`,`#A16207`,`#6B21A8`]],Tn=[`#F04438`,`#FF8B24`,`#F7C200`,`#95D13C`,`#19B36B`,`#1DA1F2`,`#1677C8`,`#152A6A`,`#5A2CA0`],En={class:`norio-office-rich-color-menu__section`},Dn={class:`norio-office-rich-color-menu__section`},On={class:`norio-office-rich-color-menu__grid`},kn=[`aria-label`,`aria-pressed`,`title`,`onClick`],An={class:`norio-office-rich-color-menu__section`},jn={class:`norio-office-rich-color-menu__row`},Mn=[`aria-label`,`aria-pressed`,`title`,`onClick`],Nn={class:`norio-office-rich-color-menu__section`},Pn={class:`norio-office-rich-color-menu__row`},Fn=[`aria-label`,`aria-pressed`,`title`,`onClick`],In={class:`norio-office-rich-color-menu__footer`},Ln=[`value`],Rn=(0,t.defineComponent)({__name:`ColorPalettePanel`,props:{color:{},defaultColor:{},recentColors:{}},emits:[`change`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(null);function o(e){return r.color.toLowerCase()===e.toLowerCase()}function s(e){let t=e.target.value;t&&i(`change`,t)}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`norio-office-rich-color-palette`,onMousedown:r[2]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createElementVNode)(`div`,En,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-color-menu__current`,onClick:r[0]||=t=>i(`change`,e.defaultColor)},`默认`)]),(0,t.createElementVNode)(`div`,Dn,[(0,t.createElementVNode)(`div`,On,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(wn).flat(),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-color-menu__swatch`,{"norio-office-rich-color-menu__swatch--active":o(e)}]),style:(0,t.normalizeStyle)({backgroundColor:e}),"aria-label":e,"aria-pressed":o(e),title:e,onClick:t=>i(`change`,e)},null,14,kn))),128))])]),(0,t.createElementVNode)(`div`,An,[r[3]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-color-menu__label`},`标准色`,-1),(0,t.createElementVNode)(`div`,jn,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(Tn),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-color-menu__swatch norio-office-rich-color-menu__swatch--compact`,{"norio-office-rich-color-menu__swatch--active":o(e)}]),style:(0,t.normalizeStyle)({backgroundColor:e}),"aria-label":`标准色 ${e}`,"aria-pressed":o(e),title:e,onClick:t=>i(`change`,e)},null,14,Mn))),128))])]),(0,t.createElementVNode)(`div`,Nn,[r[4]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-color-menu__label`},`最近使用`,-1),(0,t.createElementVNode)(`div`,Pn,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.recentColors.slice(0,10),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-color-menu__swatch norio-office-rich-color-menu__swatch--recent`,{"norio-office-rich-color-menu__swatch--active":o(e)}]),style:(0,t.normalizeStyle)({backgroundColor:e}),"aria-label":`最近使用 ${e}`,"aria-pressed":o(e),title:e,onClick:t=>i(`change`,e)},null,14,Fn))),128)),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Math.max(0,10-e.recentColors.length),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e,class:`norio-office-rich-color-menu__swatch norio-office-rich-color-menu__swatch--empty`}))),128))])]),(0,t.createElementVNode)(`div`,In,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-color-menu__more`,onClick:r[1]||=e=>a.value?.click()},[r[5]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-color-menu__rainbow`},null,-1),r[6]||=(0,t.createElementVNode)(`span`,null,`更多颜色`,-1),(0,t.createVNode)(M,{name:`shixinxiangyou`,size:10,color:`#9ca3af`,"background-color":`transparent`,class:`norio-office-rich-color-menu__arrow`})]),(0,t.createElementVNode)(`input`,{ref_key:`pickerRef`,ref:a,type:`color`,class:`norio-office-rich-color-menu__picker`,"aria-label":`更多颜色取色器`,value:e.color===`transparent`?e.defaultColor:e.color,onInput:s},null,40,Ln)])],32))}}),zn={class:`norio-office-rich-block-colors__label`},Bn={class:`norio-office-rich-block-colors__grid`},Vn=[`aria-label`,`title`,`aria-pressed`,`onClick`],Hn={key:0},Un=[`aria-label`,`aria-expanded`,`onMouseenter`,`onClick`],Wn=(0,t.defineComponent)({__name:`BlockColorPanel`,props:{textColor:{},backgroundColor:{},color:{},kind:{},label:{},presetColors:{},customKind:{},hoverEnabled:{type:Boolean}},emits:[`change`,`custom`,`reset`],setup(e,{emit:n}){let r=e,i=n,a=[null,`#9CA3AF`,`#DC2626`,`#F97316`,`#D4A500`,`#15803D`,`#2F6BFF`,`#9333EA`],o=[null,`#F4F5F7`,`#FDE1DD`,`#FFE9D2`,`#FFF3C4`,`#D8F4E5`,`#DDE9FF`,`#F1D8FF`,`#E6E8EC`,`#D9DEE7`,`#F9C3BC`,`#FFD6AC`,`#FFE58C`,`#B8ECD2`,`#BED3FF`,`#E4BCFF`],s=(0,t.computed)(()=>r.kind?[{key:r.kind,label:r.label||(r.kind===`border`?`边框颜色`:`填充颜色`),colors:r.presetColors?[null,...r.presetColors]:o}]:[{key:`text`,label:`字体颜色`,colors:a},{key:`background`,label:`背景颜色`,colors:o}]);function c(e){return r.kind&&r.label?`自定义${r.label}`:{text:`自定义文字颜色`,background:`自定义背景颜色`,border:`自定义边框颜色`,fill:`自定义填充颜色`}[e]}function l(e,t){return t||(e===`border`||e===`fill`?`无颜色`:`默认`)}function u(e,t){let n=e===`text`?r.textColor:e===`background`?r.backgroundColor:r.color;return(n===`transparent`?``:n??``).toLowerCase()===(t??``).toLowerCase()}function d(e,t){t.currentTarget instanceof HTMLElement&&i(`custom`,e,t.currentTarget)}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`norio-office-rich-block-colors`,onMousedown:r[1]||=(0,t.withModifiers)(()=>{},[`prevent`])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:n.key,class:`norio-office-rich-block-colors__section`},[(0,t.createElementVNode)(`div`,zn,(0,t.toDisplayString)(n.label),1),(0,t.createElementVNode)(`div`,Bn,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n.colors,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e||`default`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-colors__swatch`,{"norio-office-rich-block-colors__swatch--active":u(n.key,e),"norio-office-rich-block-colors__swatch--clear":n.key!==`text`&&!e}]),style:(0,t.normalizeStyle)(n.key===`text`?{color:e||`#273142`}:{backgroundColor:e||`#ffffff`}),"aria-label":`${n.label} ${l(n.key,e)}`,title:`${n.label} ${l(n.key,e)}`,"aria-pressed":u(n.key,e),onClick:t=>i(`change`,n.key,e)},[n.key===`text`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Hn,`A`)):(0,t.createCommentVNode)(``,!0)],14,Vn))),128))]),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-block-colors__custom`,{"norio-office-rich-block-side-menu__item--active":e.customKind===n.key}]),"aria-label":c(n.key),"aria-expanded":e.customKind===n.key,onMouseenter:t=>e.hoverEnabled&&d(n.key,t),onClick:e=>d(n.key,e)},[(0,t.createVNode)(M,{name:`yanse`,size:16,color:`currentColor`,"background-color":`transparent`}),r[2]||=(0,t.createElementVNode)(`span`,null,`自定义颜色`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:12,color:`#9aa4b2`,"background-color":`transparent`})],42,Un)]))),128)),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-color-menu__current norio-office-rich-block-colors__reset`,onClick:r[0]||=e=>i(`reset`)},`恢复默认`)],32))}}),Gn={class:`norio-office-rich-text-bubble__toolbar`,role:`toolbar`,"aria-label":`文字格式`},Kn=[`disabled`,`title`,`aria-label`,`aria-pressed`,`aria-expanded`,`onClick`],qn={key:0,class:`norio-office-rich-toolbar__color-trigger`},Jn={key:1},Yn=[`aria-label`],Xn=[`disabled`,`aria-label`,`aria-pressed`,`aria-expanded`,`onMouseenter`,`onClick`],Zn={key:1,class:`norio-office-rich-text-bubble__option-symbol`},Qn={class:`norio-office-rich-text-bubble__option-label`},$n=[`aria-label`],er=[`disabled`,`aria-label`,`aria-pressed`,`onClick`],tr={class:`norio-office-rich-text-bubble__option-symbol`},nr={class:`norio-office-rich-text-bubble__option-label`},rr=(0,t.defineComponent)({__name:`TextSelectionMenu`,props:{editor:{},actions:{},enabled:{type:Boolean},scope:{},getReferencedVirtualElement:{type:Function}},emits:[`visibility-change`],setup(e,{emit:n}){let i=e,o=i.scope===`table`?`tableBubbleMenu`:`textSelectionBubbleMenu`,c=n,l=(0,t.ref)(null),u=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(null),p=(0,t.ref)(null),m=(0,t.ref)(null),h=(0,t.ref)(null),g=(0,t.ref)(!1),_=(0,t.ref)(!1),v=(0,t.ref)(!1),y=(0,t.ref)(!1),b=(0,t.computed)(()=>_.value||v.value),x=(0,t.computed)(()=>i.enabled&&!g.value&&!b.value&&y.value),S=(0,t.ref)({}),C=(0,t.ref)({}),w=(0,t.computed)(()=>i.actions.find(e=>e.key===m.value)),T=(0,t.computed)(()=>w.value?.options?.find(e=>e.key===h.value)),E=null,D=null,O=null,ee=i.editor.state.selection;function k(){let e=p.value?.getBoundingClientRect(),t=u.value;if(!e||!t)return;let n=Math.min(w.value?.setColor?264:232,window.innerWidth-16),r=Math.min(t.scrollHeight,window.innerHeight-16),i=e.bottom+8+r<=window.innerHeight-8?e.bottom+8:Math.max(8,e.top-r-8);S.value={position:`fixed`,width:`${n}px`,left:`${Math.max(8,Math.min(e.left,window.innerWidth-n-8))}px`,top:`${i}px`,maxHeight:`${window.innerHeight-16}px`},te()}function te(){let e=f.value?.getBoundingClientRect(),t=d.value;if(!e||!t)return;let n=Math.min(184,window.innerWidth-16),r=Math.min(t.scrollHeight,window.innerHeight-16),i=e.right+4+n<=window.innerWidth-8,a=e.left-n-4>=8,o=i?e.right+4:a?e.left-n-4:Math.max(8,Math.min(e.left,window.innerWidth-n-8)),s=i||a?e.top:e.bottom+4+r<=window.innerHeight-8?e.bottom+4:e.top-r-4,c=Math.max(8,Math.min(s,window.innerHeight-r-8));C.value={position:`fixed`,width:`${n}px`,left:`${o}px`,top:`${c}px`,maxHeight:`${window.innerHeight-16}px`}}function ne(){!i.editor.isDestroyed&&!i.editor.state.selection.empty&&!g.value&&l.value?.isConnected&&i.editor.view.dispatch(i.editor.state.tr.setMeta(o,`updatePosition`)),k()}function re({view:e,state:t,element:n}){t.selection.eq(ee)||(g.value=!1);let{$from:r,$to:o}=t.selection,c=t.selection instanceof s.CellSelection||t.selection instanceof a.NodeSelection&&t.selection.node.type.name===`table`||t.selection instanceof a.TextSelection&&Array.from({length:r.depth},(e,t)=>t+1).some(e=>r.node(e).type.name===`table`&&o.depth>=e&&r.start(e)===o.start(e)),l=t.selection instanceof a.TextSelection&&!t.selection.empty&&!!t.doc.textBetween(t.selection.from,t.selection.to).length,u=i.scope===`table`?c&&!t.selection.empty:l&&!c;return i.enabled&&!g.value&&i.editor.isEditable&&u&&(e.hasFocus()||n.contains(document.activeElement))}function A(e,t){e.disabled||(e.options||e.setColor?(p.value=t.currentTarget,m.value=m.value===e.key?null:e.key):(m.value=null,e.run?.()))}function ie(e){e.disabled||(e.run?.(),m.value!==`alignment`&&(m.value=null))}function ae(e,t){h.value=!e.disabled&&e.options?e.key:null,f.value=h.value?t.currentTarget:null}function oe(e,t){e.options?ae(e,t):ie(e)}function se(){let e=i.editor.state.selection;e.eq(ee)||(g.value=!1,m.value=null),ee=e}function j(e){e.target instanceof Node&&!l.value?.contains(e.target)&&(m.value=null,g.value=!0,e.button===0&&i.editor.view.dom.contains(e.target)&&(_.value=!0))}function ce(){_.value=!1}function le(e){(!e.shiftKey||e.key===`Shift`)&&(v.value=!1)}function ue(){_.value=!1,v.value=!1}function de(e){e.target instanceof Node&&i.editor.view.dom.contains(e.target)&&(e.shiftKey&&[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`PageUp`,`PageDown`].includes(e.key)||(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)&&(v.value=!0),e.key===`Escape`&&x.value&&l.value?.isConnected&&(e.preventDefault(),h.value?h.value=null:m.value?m.value=null:g.value=!0,i.editor.commands.focus())}(0,t.watch)(u,e=>{E?.disconnect(),E=null,e&&(k(),E=new ResizeObserver(k),E.observe(e))},{flush:`post`}),(0,t.watch)(l,e=>{O?.disconnect(),O=null,e&&(O=new ResizeObserver(ne),O.observe(e))},{flush:`post`}),(0,t.watch)(d,e=>{D?.disconnect(),D=null,e&&(te(),D=new ResizeObserver(te),D.observe(e))},{flush:`post`}),(0,t.watch)(h,()=>void(0,t.nextTick)(te)),(0,t.watch)(m,()=>{h.value=null,(0,t.nextTick)(k)}),(0,t.watch)(()=>i.enabled,e=>{m.value=null,g.value=!e}),(0,t.watch)(x,e=>c(`visibility-change`,e),{flush:`sync`}),(0,t.watch)(b,e=>{e||(0,t.nextTick)(ne)}),(0,t.onMounted)(()=>{i.editor.on(`selectionUpdate`,se),document.addEventListener(`pointerdown`,j,!0),document.addEventListener(`pointerup`,ce,!0),document.addEventListener(`pointercancel`,ce,!0),document.addEventListener(`keydown`,de,!0),document.addEventListener(`keyup`,le,!0),window.addEventListener(`blur`,ue),window.addEventListener(`resize`,ne),window.addEventListener(`scroll`,ne,!0)}),(0,t.onBeforeUnmount)(()=>{c(`visibility-change`,!1),E?.disconnect(),D?.disconnect(),O?.disconnect(),i.editor.off(`selectionUpdate`,se),document.removeEventListener(`pointerdown`,j,!0),document.removeEventListener(`pointerup`,ce,!0),document.removeEventListener(`pointercancel`,ce,!0),document.removeEventListener(`keydown`,de,!0),document.removeEventListener(`keyup`,le,!0),window.removeEventListener(`blur`,ue),window.removeEventListener(`resize`,ne),window.removeEventListener(`scroll`,ne,!0)});let fe=()=>document.body,pe={strategy:`fixed`,placement:`top`,offset:8,flip:{padding:8},shift:{padding:8,crossAxis:!0},onShow:()=>{y.value=!0},onHide:()=>{m.value=null,y.value=!1},onUpdate:k};return(n,i)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(r.BubbleMenu),{class:(0,t.normalizeClass)(e.scope===`table`?`norio-office-rich-table-bubble-menu`:`norio-office-rich-text-bubble`),"plugin-key":(0,t.unref)(o),editor:e.editor,"should-show":re,"append-to":fe,options:pe,"update-delay":0,"get-referenced-virtual-element":e.getReferencedVirtualElement},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{ref_key:`menuRef`,ref:l,class:`norio-office-rich-text-bubble__content`},[(0,t.createElementVNode)(`div`,Gn,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.actions,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-text-bubble__button`,{"norio-office-rich-text-bubble__button--active":e.active||m.value===e.key,"norio-office-rich-text-bubble__button--select":e.options||e.setColor}]),disabled:e.disabled,title:e.label,"aria-label":e.label,"aria-pressed":e.options||e.setColor?void 0:!!e.active,"aria-expanded":e.options||e.setColor?m.value===e.key:void 0,onMousedown:i[0]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>A(e,t)},[e.setColor?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,qn,[e.icon?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.icon,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Jn,`A`)),(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__color-line`,style:(0,t.normalizeStyle)({backgroundColor:e.color})},null,4)])):e.icon?((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:e.icon,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,class:(0,t.normalizeClass)({"norio-office-rich-toolbar__text-icon--strike":e.key===`strike`})},(0,t.toDisplayString)(e.text),3)),e.options||e.setColor?((0,t.openBlock)(),(0,t.createBlock)(M,{key:3,name:`xiangxiajiantou`,size:10,color:`#9aa4b2`,"background-color":`transparent`})):(0,t.createCommentVNode)(``,!0)],42,Kn))),128))]),(0,t.renderSlot)(n.$slots,`default`),w.value&&(w.value.options||w.value.setColor)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`panelRef`,ref:u,class:`norio-office-rich-text-bubble__panel`,style:(0,t.normalizeStyle)(S.value),role:`dialog`,"aria-label":w.value.label,onMousedown:i[2]||=(0,t.withModifiers)(()=>{},[`stop`])},[w.value.setColor?((0,t.openBlock)(),(0,t.createBlock)(Rn,{key:0,color:w.value.color||w.value.defaultColor,"default-color":w.value.defaultColor,"recent-colors":w.value.recentColors||[],onChange:w.value.setColor},null,8,[`color`,`default-color`,`recent-colors`,`onChange`])):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(w.value.options,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-text-bubble__option`,{"norio-office-rich-text-bubble__option--active":e.active,"norio-office-rich-text-bubble__option--divider":e.divider}]),disabled:e.disabled,"aria-label":e.label,"aria-pressed":!!e.active,"aria-expanded":e.options?h.value===e.key:void 0,style:(0,t.normalizeStyle)(e.fontFamily?{fontFamily:e.fontFamily}:void 0),onMousedown:i[1]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:t=>ae(e,t),onClick:t=>oe(e,t)},[e.icon?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.icon,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):e.text?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Zn,(0,t.toDisplayString)(e.text),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,Qn,(0,t.toDisplayString)(e.label),1),e.options?((0,t.openBlock)(),(0,t.createBlock)(M,{key:2,class:`norio-office-rich-text-bubble__option-arrow`,name:`youjiantou`,size:12,color:`currentColor`,"background-color":`transparent`})):(0,t.createCommentVNode)(``,!0),e.active?((0,t.openBlock)(),(0,t.createBlock)(an,{key:3,name:`duihao`,size:14,"background-color":`transparent`})):(0,t.createCommentVNode)(``,!0)],46,Xn))),128))],44,Yn)):(0,t.createCommentVNode)(``,!0),T.value?.options?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,ref_key:`nestedPanelRef`,ref:d,class:`norio-office-rich-text-bubble__panel norio-office-rich-text-bubble__panel--nested`,style:(0,t.normalizeStyle)(C.value),role:`dialog`,"aria-label":T.value.label,onMousedown:i[4]||=(0,t.withModifiers)(()=>{},[`stop`])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(T.value.options,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-text-bubble__option`,{"norio-office-rich-text-bubble__option--active":e.active}]),disabled:e.disabled,"aria-label":e.label,"aria-pressed":!!e.active,onMousedown:i[3]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>ie(e)},[(0,t.createElementVNode)(`span`,tr,(0,t.toDisplayString)(e.text),1),(0,t.createElementVNode)(`span`,nr,(0,t.toDisplayString)(e.label),1),e.active?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:14,"background-color":`transparent`})):(0,t.createCommentVNode)(``,!0)],42,er))),128))],44,$n)):(0,t.createCommentVNode)(``,!0)],512)]),_:3},8,[`class`,`plugin-key`,`editor`,`get-referenced-virtual-element`])),[[t.vShow,e.enabled&&!g.value&&!b.value]])}}),ir=[{id:`recent`,icon:`🕘`,label:`最近`},{id:`smileys`,icon:`😀`,label:`表情`},{id:`people`,icon:`🙌`,label:`人物`},{id:`animals`,icon:`🐻`,label:`动物`},{id:`food`,icon:`🍎`,label:`食物`},{id:`travel`,icon:`🌍`,label:`出行`},{id:`objects`,icon:`💡`,label:`物品`},{id:`symbols`,icon:`✅`,label:`符号`}],ar=Object.entries({smileys:[[`😀`,`开心`,[`happy`,`smile`]],[`😃`,`大笑`,[`happy`,`joy`]],[`😄`,`咧嘴笑`,[`grin`,`joy`]],[`😁`,`露齿笑`,[`teeth`,`smile`]],[`😆`,`眯眼笑`,[`laugh`]],[`😅`,`汗笑`,[`relief`]],[`😂`,`笑哭`,[`lol`,`cry`]],[`🤣`,`打滚笑`,[`lol`,`laugh`]],[`😊`,`微笑`,[`blush`]],[`😇`,`天使笑`,[`angel`]],[`🙂`,`轻笑`,[`smile`]],[`🙃`,`倒脸`,[`flip`]],[`😉`,`眨眼`,[`wink`]],[`😌`,`放松`,[`calm`]],[`😍`,`爱心眼`,[`love`]],[`🥰`,`喜爱`,[`hearts`]],[`😘`,`飞吻`,[`kiss`]],[`😗`,`亲亲`,[`kiss`]],[`😋`,`馋`,[`yummy`]],[`😎`,`酷`,[`cool`]],[`🤩`,`崇拜`,[`star`]],[`🥳`,`庆祝`,[`party`]],[`😏`,`得意`,[`smirk`]],[`😴`,`困`,[`sleep`]],[`😪`,`想睡`,[`sleepy`]],[`🤤`,`流口水`,[`drool`]],[`😭`,`大哭`,[`cry`,`sad`]],[`😤`,`生气`,[`angry`]],[`😡`,`愤怒`,[`mad`]],[`😱`,`震惊`,[`shock`]],[`🥶`,`冷`,[`cold`]],[`🥵`,`热`,[`hot`]],[`🤔`,`思考`,[`think`]],[`🫡`,`致意`,[`salute`]],[`🤗`,`拥抱`,[`hug`]],[`🤭`,`偷笑`,[`giggle`]],[`🤫`,`嘘`,[`quiet`]],[`🤥`,`说谎`,[`lie`]],[`😷`,`口罩`,[`sick`]],[`🤒`,`发烧`,[`sick`]]],people:[[`👍`,`点赞`,[`ok`,`thumb`]],[`👎`,`点踩`,[`thumb`]],[`👌`,`好`,[`ok`]],[`👋`,`挥手`,[`hello`]],[`👏`,`鼓掌`,[`clap`]],[`🙌`,`举手`,[`hooray`]],[`👐`,`展开双手`,[`open`]],[`🤝`,`握手`,[`deal`]],[`🙏`,`祈祷`,[`thanks`]],[`💪`,`力量`,[`strong`]],[`✍️`,`书写`,[`write`]],[`🫶`,`比心`,[`love`]],[`🤟`,`爱你手势`,[`love`]],[`🤘`,`摇滚`,[`rock`]],[`🤞`,`交叉手指`,[`luck`]],[`🫰`,`捏手`,[`snap`]],[`🫵`,`指向你`,[`point`]],[`👀`,`眼睛`,[`look`]],[`🧠`,`大脑`,[`brain`]],[`💅`,`美甲`,[`nail`]],[`🧑‍💻`,`开发者`,[`coder`]],[`👨‍💻`,`男程序员`,[`coder`]],[`👩‍💻`,`女程序员`,[`coder`]],[`🧑‍🏫`,`老师`,[`teacher`]],[`🧑‍⚕️`,`医生`,[`doctor`]],[`🧑‍🚀`,`宇航员`,[`space`]],[`🧑‍🎨`,`艺术家`,[`art`]],[`🧑‍🍳`,`厨师`,[`cook`]],[`🕺`,`跳舞`,[`dance`]],[`💃`,`舞者`,[`dance`]],[`🧘`,`冥想`,[`meditate`]],[`🏃`,`跑步`,[`run`]],[`🚶`,`步行`,[`walk`]],[`🙋`,`举手提问`,[`question`]],[`🙇`,`鞠躬`,[`bow`]],[`🤦`,`捂脸`,[`facepalm`]],[`🤷`,`耸肩`,[`shrug`]],[`🙅`,`拒绝`,[`no`]],[`🙆`,`同意`,[`ok`]],[`💁`,`提示`,[`guide`]]],animals:[[`🐶`,`小狗`,[`dog`]],[`🐱`,`小猫`,[`cat`]],[`🐭`,`老鼠`,[`mouse`]],[`🐹`,`仓鼠`,[`hamster`]],[`🐰`,`兔子`,[`rabbit`]],[`🦊`,`狐狸`,[`fox`]],[`🐻`,`熊`,[`bear`]],[`🐼`,`熊猫`,[`panda`]],[`🐨`,`考拉`,[`koala`]],[`🐯`,`老虎`,[`tiger`]],[`🦁`,`狮子`,[`lion`]],[`🐮`,`奶牛`,[`cow`]],[`🐷`,`猪`,[`pig`]],[`🐸`,`青蛙`,[`frog`]],[`🐵`,`猴子`,[`monkey`]],[`🐔`,`小鸡`,[`chicken`]],[`🐧`,`企鹅`,[`penguin`]],[`🐦`,`小鸟`,[`bird`]],[`🦄`,`独角兽`,[`unicorn`]],[`🐝`,`蜜蜂`,[`bee`]],[`🦋`,`蝴蝶`,[`butterfly`]],[`🐢`,`乌龟`,[`turtle`]],[`🐬`,`海豚`,[`dolphin`]],[`🐳`,`鲸鱼`,[`whale`]],[`🐙`,`章鱼`,[`octopus`]],[`🦖`,`恐龙`,[`dinosaur`]],[`🌸`,`樱花`,[`flower`]],[`🌼`,`小花`,[`flower`]],[`🌻`,`向日葵`,[`flower`]],[`🌷`,`郁金香`,[`flower`]],[`🌵`,`仙人掌`,[`plant`]],[`🌲`,`松树`,[`tree`]],[`🌳`,`大树`,[`tree`]],[`🍀`,`四叶草`,[`lucky`]],[`🌴`,`棕榈树`,[`tree`]],[`🌈`,`彩虹`,[`rainbow`]],[`☀️`,`太阳`,[`sun`]],[`🌙`,`月亮`,[`moon`]],[`⭐`,`星星`,[`star`]],[`⛄`,`雪人`,[`snow`]]],food:[[`🍎`,`苹果`,[`apple`]],[`🍐`,`梨`,[`pear`]],[`🍊`,`橘子`,[`orange`]],[`🍋`,`柠檬`,[`lemon`]],[`🍌`,`香蕉`,[`banana`]],[`🍉`,`西瓜`,[`watermelon`]],[`🍇`,`葡萄`,[`grape`]],[`🍓`,`草莓`,[`strawberry`]],[`🫐`,`蓝莓`,[`berry`]],[`🍒`,`樱桃`,[`cherry`]],[`🍑`,`桃子`,[`peach`]],[`🥭`,`芒果`,[`mango`]],[`🍍`,`菠萝`,[`pineapple`]],[`🥥`,`椰子`,[`coconut`]],[`🥝`,`猕猴桃`,[`kiwi`]],[`🍅`,`番茄`,[`tomato`]],[`🥑`,`牛油果`,[`avocado`]],[`🥦`,`西兰花`,[`broccoli`]],[`🥕`,`胡萝卜`,[`carrot`]],[`🌽`,`玉米`,[`corn`]],[`🍞`,`面包`,[`bread`]],[`🥐`,`牛角包`,[`croissant`]],[`🥨`,`椒盐卷饼`,[`pretzel`]],[`🧀`,`奶酪`,[`cheese`]],[`🍳`,`煎蛋`,[`egg`]],[`🥞`,`松饼`,[`pancake`]],[`🍔`,`汉堡`,[`burger`]],[`🍟`,`薯条`,[`fries`]],[`🍕`,`披萨`,[`pizza`]],[`🌭`,`热狗`,[`hotdog`]],[`🍿`,`爆米花`,[`popcorn`]],[`🍣`,`寿司`,[`sushi`]],[`🍜`,`拉面`,[`noodle`]],[`🍩`,`甜甜圈`,[`donut`]],[`🍪`,`曲奇`,[`cookie`]],[`🎂`,`蛋糕`,[`cake`]],[`🍰`,`切块蛋糕`,[`cake`]],[`🍫`,`巧克力`,[`chocolate`]],[`🍭`,`棒棒糖`,[`candy`]],[`☕`,`咖啡`,[`coffee`]]],travel:[[`🚗`,`汽车`,[`car`]],[`🚕`,`出租车`,[`taxi`]],[`🚌`,`公交车`,[`bus`]],[`🚎`,`无轨电车`,[`bus`]],[`🏎️`,`赛车`,[`car`]],[`🚓`,`警车`,[`police`]],[`🚑`,`救护车`,[`ambulance`]],[`🚒`,`消防车`,[`fire`]],[`🚚`,`货车`,[`truck`]],[`🚲`,`自行车`,[`bike`]],[`🛵`,`小踏板`,[`scooter`]],[`✈️`,`飞机`,[`plane`]],[`🚀`,`火箭`,[`rocket`]],[`🚁`,`直升机`,[`helicopter`]],[`⛵`,`帆船`,[`boat`]],[`🚤`,`快艇`,[`boat`]],[`🚢`,`轮船`,[`ship`]],[`🚆`,`火车`,[`train`]],[`🚄`,`高铁`,[`train`]],[`🚇`,`地铁`,[`metro`]],[`🏠`,`房子`,[`home`]],[`🏢`,`办公楼`,[`office`]],[`🏫`,`学校`,[`school`]],[`🏥`,`医院`,[`hospital`]],[`🏨`,`酒店`,[`hotel`]],[`🏖️`,`海滩`,[`beach`]],[`🏝️`,`岛屿`,[`island`]],[`🗽`,`自由女神`,[`usa`]],[`🗼`,`铁塔`,[`tower`]],[`⛩️`,`鸟居`,[`japan`]],[`🏞️`,`国家公园`,[`park`]],[`🌋`,`火山`,[`volcano`]],[`🗺️`,`地图`,[`map`]],[`🌍`,`地球`,[`world`]],[`🌤️`,`晴天`,[`weather`]],[`🌧️`,`下雨`,[`rain`]],[`⛈️`,`雷暴`,[`storm`]],[`🌊`,`海浪`,[`wave`]],[`🌌`,`星空`,[`night`]],[`🧭`,`指南针`,[`compass`]]],objects:[[`💡`,`灯泡`,[`idea`]],[`🔦`,`手电筒`,[`light`]],[`🕯️`,`蜡烛`,[`candle`]],[`📌`,`图钉`,[`pin`]],[`📎`,`回形针`,[`paperclip`]],[`✂️`,`剪刀`,[`scissors`]],[`🖊️`,`圆珠笔`,[`pen`]],[`🖋️`,`钢笔`,[`pen`]],[`✏️`,`铅笔`,[`pencil`]],[`📝`,`笔记`,[`note`]],[`📚`,`书籍`,[`books`]],[`📖`,`打开的书`,[`book`]],[`💻`,`电脑`,[`computer`]],[`⌨️`,`键盘`,[`keyboard`]],[`🖥️`,`显示器`,[`screen`]],[`🖨️`,`打印机`,[`printer`]],[`📱`,`手机`,[`phone`]],[`☎️`,`电话`,[`phone`]],[`📷`,`相机`,[`camera`]],[`🎥`,`摄影机`,[`video`]],[`🎧`,`耳机`,[`music`]],[`🎤`,`麦克风`,[`music`]],[`⌚`,`手表`,[`watch`]],[`⏰`,`闹钟`,[`alarm`]],[`🔋`,`电池`,[`battery`]],[`🔌`,`插头`,[`plug`]],[`🧲`,`磁铁`,[`magnet`]],[`🔑`,`钥匙`,[`key`]],[`🧰`,`工具箱`,[`tool`]],[`💎`,`钻石`,[`gem`]],[`🎁`,`礼物`,[`gift`]],[`🛒`,`购物车`,[`shop`]],[`🪑`,`椅子`,[`chair`]],[`🛏️`,`床`,[`bed`]],[`🚪`,`门`,[`door`]],[`🪞`,`镜子`,[`mirror`]],[`🧸`,`玩具熊`,[`toy`]],[`🪄`,`魔法棒`,[`magic`]],[`🏆`,`奖杯`,[`trophy`]],[`📦`,`箱子`,[`box`]]],symbols:[[`❤️`,`红心`,[`heart`]],[`🧡`,`橙心`,[`heart`]],[`💛`,`黄心`,[`heart`]],[`💚`,`绿心`,[`heart`]],[`💙`,`蓝心`,[`heart`]],[`💜`,`紫心`,[`heart`]],[`🖤`,`黑心`,[`heart`]],[`🤍`,`白心`,[`heart`]],[`🤎`,`棕心`,[`heart`]],[`💔`,`心碎`,[`heart`]],[`❣️`,`爱心感叹号`,[`heart`]],[`💕`,`双心`,[`love`]],[`💞`,`旋转爱心`,[`love`]],[`💯`,`一百分`,[`score`]],[`✅`,`完成`,[`done`]],[`☑️`,`已勾选`,[`check`]],[`✔️`,`对勾`,[`check`]],[`❌`,`叉号`,[`close`]],[`⭕`,`圆圈`,[`circle`]],[`⚠️`,`警告`,[`warning`]],[`🚫`,`禁止`,[`forbid`]],[`❓`,`问号`,[`question`]],[`❗`,`感叹号`,[`important`]],[`💢`,`爆炸怒气`,[`angry`]],[`♻️`,`循环`,[`recycle`]],[`🔔`,`铃铛`,[`bell`]],[`🎵`,`音符`,[`music`]],[`🎶`,`双音符`,[`music`]],[`➕`,`加号`,[`plus`]],[`➖`,`减号`,[`minus`]],[`✖️`,`乘号`,[`times`]],[`➗`,`除号`,[`divide`]],[`™️`,`商标`,[`tm`]],[`©️`,`版权`,[`copyright`]],[`®️`,`注册`,[`register`]],[`🔞`,`18禁`,[`adult`]],[`♾️`,`无限`,[`infinity`]],[`🈲`,`禁止`,[`cn`]],[`🈵`,`满`,[`cn`]],[`🉑`,`可`,[`cn`]]]}).flatMap(([e,t])=>t.map(([t,n,r=[]])=>({emoji:t,label:n,keywords:r,category:e}))),or={class:`norio-office-rich-emoji-picker-panel`},sr={class:`norio-office-rich-emoji-picker-panel__section-title`},cr=[`title`,`onClick`],lr={key:1,class:`norio-office-rich-emoji-picker-panel__empty`},ur={class:`norio-office-rich-emoji-picker-panel__footer`},dr=[`title`,`onClick`],fr={class:`norio-office-rich-emoji-picker-panel__tab-icon`,"aria-hidden":`true`},pr=`office-word:recent-emojis`,mr=10,hr=Sn((0,t.defineComponent)({__name:`EmojiPickerPanel`,props:{selectedEmoji:{default:null}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(``),o=(0,t.ref)(`recent`),s=(0,t.ref)([]),c=new Map(ir.map(e=>[e.id,e.label])),l=ir.filter(e=>e.id!==`recent`),u=(0,t.computed)(()=>a.value.trim().length>0),d=(0,t.computed)(()=>s.value.map(e=>ar.find(t=>t.emoji===e)).filter(e=>!!e).slice(0,mr)),f=(0,t.computed)(()=>{let e=a.value.trim().toLowerCase();return e?ar.filter(t=>[t.label,t.emoji,...t.keywords].join(` `).toLowerCase().includes(e)):[]}),p=(0,t.computed)(()=>{if(u.value)return[{key:`search`,title:`搜索结果`,items:f.value}];if(o.value===`recent`){let e=[];d.value.length&&e.push({key:`recent-top`,title:`最近`,items:d.value});for(let t of l){let n=ar.filter(e=>e.category===t.id);n.length&&e.push({key:String(t.id),title:t.label,items:n})}return e}return[{key:String(o.value),title:c.get(o.value)??`表情`,items:ar.filter(e=>e.category===o.value)}]});function m(){if(typeof window<`u`)try{let e=window.localStorage.getItem(pr);if(!e)return;let t=JSON.parse(e);Array.isArray(t)&&(s.value=t.filter(e=>typeof e==`string`).slice(0,mr))}catch{s.value=[]}}function h(e){typeof window<`u`&&window.localStorage.setItem(pr,JSON.stringify(e))}function g(e){let t=[e,...s.value.filter(t=>t!==e)].slice(0,mr);s.value=t,h(t)}function _(e){g(e),i(`select`,e)}function v(e){o.value=e}return(0,t.onMounted)(()=>{m()}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,or,[(0,t.createVNode)(sn,{"class-name":`norio-office-rich-emoji-picker-panel__body`},{default:(0,t.withCtx)(()=>[p.value.length?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(p.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.key,class:`norio-office-rich-emoji-picker-panel__section`},[(0,t.createElementVNode)(`div`,sr,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`norio-office-rich-emoji-picker-panel__grid`,{"norio-office-rich-emoji-picker-panel__grid--recent":e.key===`recent-top`}])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`${e.key}-${n.emoji}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-emoji-picker-panel__item`,{"norio-office-rich-emoji-picker-panel__item--active":r.selectedEmoji===n.emoji}]),title:n.label,onClick:e=>_(n.emoji)},(0,t.toDisplayString)(n.emoji),11,cr))),128))],2)]))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lr,`没有找到匹配的表情`))]),_:1}),(0,t.createElementVNode)(`div`,ur,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(ir),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.id,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-emoji-picker-panel__tab`,{"norio-office-rich-emoji-picker-panel__tab--active":o.value===e.id}]),title:e.label,onClick:t=>v(e.id)},[(0,t.createElementVNode)(`span`,fr,(0,t.toDisplayString)(e.icon),1)],10,dr))),128))])]))}}),[[`__scopeId`,`data-v-c9e9c49a`]]),N=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},gr=/([A-Z])/g,_r=e=>e.replace(gr,`-$1`).toLowerCase(),vr={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},yr=/[&><"']/g,br=e=>String(e).replace(yr,e=>vr[e]),xr=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?xr(e.body[0]):e:e.type===`font`?xr(e.body):e,Sr=new Set([`mathord`,`textord`,`atom`]),Cr=e=>Sr.has(xr(e).type),wr=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},Tr={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function Er(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function Dr(e){return e.default===void 0?Er(Array.isArray(e.type)?e.type[0]:e.type):e.default}function Or(e,t,n,r){var i=n[t];e[t]=i===void 0?Dr(r):r.processor?r.processor(i):i}var kr=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(Tr)){var n=Tr[t];n&&Or(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new N(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=wr(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},Ar=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return zr[Br[this.id]]}sub(){return zr[Vr[this.id]]}fracNum(){return zr[Hr[this.id]]}fracDen(){return zr[Ur[this.id]]}cramp(){return zr[P[this.id]]}text(){return zr[Wr[this.id]]}isTight(){return this.size>=2}},jr=0,Mr=1,Nr=2,Pr=3,Fr=4,Ir=5,Lr=6,Rr=7,zr=[new Ar(jr,0,!1),new Ar(Mr,0,!0),new Ar(Nr,1,!1),new Ar(Pr,1,!0),new Ar(Fr,2,!1),new Ar(Ir,2,!0),new Ar(Lr,3,!1),new Ar(Rr,3,!0)],Br=[Fr,Ir,Fr,Ir,Lr,Rr,Lr,Rr],Vr=[Ir,Ir,Ir,Ir,Rr,Rr,Rr,Rr],Hr=[Nr,Pr,Fr,Ir,Lr,Rr,Lr,Rr],Ur=[Pr,Pr,Ir,Ir,Rr,Rr,Rr,Rr],P=[Mr,Mr,Pr,Pr,Ir,Ir,Rr,Rr],Wr=[jr,Mr,Nr,Pr,Nr,Pr,Nr,Pr],Gr={DISPLAY:zr[jr],TEXT:zr[Nr],SCRIPT:zr[Fr],SCRIPTSCRIPT:zr[Lr]},Kr=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function qr(e){for(var t=0;t<Kr.length;t++)for(var n=Kr[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Jr=[];Kr.forEach(e=>e.blocks.forEach(e=>Jr.push(...e)));function Yr(e){for(var t=0;t<Jr.length;t+=2)if(e>=Jr[t]&&e<=Jr[t+1])return!0;return!1}var Xr=e=>e+` `+e,Zr=80,Qr=function(e,t){return`M95,`+(622+e+t)+`
262
+ <svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M338.432 76.8h604.5184a56.832 56.832 0 0 1 0 113.664H338.432a56.832 56.832 0 0 1 0-113.664z m0 384h604.5184a56.832 56.832 0 0 1 0 113.664H338.432a56.832 56.832 0 1 1 0-113.664z m0 384h604.5184a56.832 56.832 0 0 1 0 113.664H338.432a56.832 56.832 0 1 1 0-113.664zM166.6048 51.2v204.8H109.9776V121.8048a172.032 172.032 0 0 1-26.5728 16.896A207.616 207.616 0 0 1 51.2 151.04v-45.8752c19.0464-6.144 33.792-13.4656 44.3904-22.1184 10.496-8.6016 18.7392-19.2 24.6784-31.8464h46.336z m52.4288 563.2H51.2c1.9456-16.5888 7.7824-32.1536 17.5104-46.7456 9.728-14.6432 28.0576-31.8464 54.8864-51.712 16.384-12.1856 26.88-21.504 31.4368-27.7504a31.0784 31.0784 0 0 0 6.8608-18.0224 20.992 20.992 0 0 0-6.7584-15.7184 23.7056 23.7056 0 0 0-17.1008-6.5536 23.8592 23.8592 0 0 0-17.5616 6.7584c-4.5056 4.5056-7.5776 12.3904-9.1136 23.7568L55.296 473.9072c2.2016-15.7696 6.2464-28.0576 12.1344-36.864 5.8368-8.8576 14.08-15.6672 24.7808-20.3776 10.6496-4.7104 25.4464-7.0656 44.288-7.0656 19.712 0 35.0208 2.2528 45.9264 6.7072 10.9568 4.5056 19.5584 11.4176 25.856 20.6848 6.2464 9.3184 9.4208 19.712 9.4208 31.232 0 12.288-3.584 24.064-10.8032 35.1744-7.168 11.2128-20.2752 23.4496-39.2192 36.864a414.72 414.72 0 0 0-22.5792 16.3328c-3.84 3.072-8.2944 7.168-13.4144 12.1856h87.3472V614.4z m-112.8448 239.872l-52.0192-9.3184c4.3008-16.5888 12.6464-29.2864 24.9344-38.0928 12.288-8.8576 29.696-13.2608 52.224-13.2608 25.8048 0 44.544 4.8128 56.064 14.4384a45.4144 45.4144 0 0 1 17.2544 36.352 40.6016 40.6016 0 0 1-7.0144 23.2448c-4.6592 6.912-11.776 13.0048-21.1968 18.2272 7.68 1.8944 13.5168 4.096 17.5616 6.656 6.5536 4.0448 11.6736 9.3696 15.36 15.9744 3.584 6.656 5.4272 14.5408 5.4272 23.7056 0 11.52-3.0208 22.5792-9.0624 33.1776a60.6208 60.6208 0 0 1-26.0608 24.4224c-11.3152 5.7344-26.2656 8.6016-44.6976 8.6016-18.0224 0-32.256-2.0992-42.6496-6.3488a63.6416 63.6416 0 0 1-25.6-18.5856 85.3504 85.3504 0 0 1-15.5136-30.72l54.9888-7.3216c2.1504 11.1104 5.5296 18.7904 10.0352 23.04a24.32 24.32 0 0 0 17.408 6.4512 23.8592 23.8592 0 0 0 18.432-8.1408 30.9248 30.9248 0 0 0 7.3216-21.6064c0-9.216-2.3552-16.2816-7.0656-21.3504a25.088 25.088 0 0 0-19.2512-7.5264c-4.3008 0-10.24 1.024-17.8176 3.2256l2.816-39.3216c3.072 0.4608 5.4272 0.6656 7.168 0.6656a25.088 25.088 0 0 0 18.0224-6.8608 21.8112 21.8112 0 0 0 7.2192-16.384 19.5584 19.5584 0 0 0-5.376-14.4384 20.0704 20.0704 0 0 0-14.848-5.376 21.8112 21.8112 0 0 0-15.872 5.8368c-3.9936 3.9424-6.7584 10.8032-8.192 20.6336z" fill="#5B65F5" /></svg>`,Xt=Object.assign({"./assets/icons/mono/To-do.svg":j,"./assets/icons/mono/add-circle.svg":ce,"./assets/icons/mono/add.svg":le,"./assets/icons/mono/attachment.svg":ue,"./assets/icons/mono/back.svg":de,"./assets/icons/mono/beijingse.svg":fe,"./assets/icons/mono/charutupian.svg":pe,"./assets/icons/mono/close.svg":me,"./assets/icons/mono/code.svg":he,"./assets/icons/mono/codeblock.svg":ge,"./assets/icons/mono/comment.svg":_e,"./assets/icons/mono/cut.svg":ve,"./assets/icons/mono/dagang.svg":ye,"./assets/icons/mono/days.svg":be,"./assets/icons/mono/delete.svg":xe,"./assets/icons/mono/drag.svg":Se,"./assets/icons/mono/edit.svg":Ce,"./assets/icons/mono/fangdayulan.svg":we,"./assets/icons/mono/folder.svg":Te,"./assets/icons/mono/gaoliangkuai.svg":Ee,"./assets/icons/mono/h1.svg":De,"./assets/icons/mono/h2.svg":Oe,"./assets/icons/mono/h3.svg":ke,"./assets/icons/mono/h4.svg":Ae,"./assets/icons/mono/h5.svg":je,"./assets/icons/mono/h6.svg":Me,"./assets/icons/mono/huanyuan.svg":Ne,"./assets/icons/mono/image.svg":Pe,"./assets/icons/mono/jiacu.svg":Fe,"./assets/icons/mono/jianshao.svg":Ie,"./assets/icons/mono/juzhongduiqi.svg":Le,"./assets/icons/mono/kapianyulan.svg":Re,"./assets/icons/mono/link.svg":ze,"./assets/icons/mono/mark.svg":Be,"./assets/icons/mono/merge.svg":Ve,"./assets/icons/mono/quanpingzuidahua.svg":He,"./assets/icons/mono/redo.svg":Ue,"./assets/icons/mono/rubber.svg":We,"./assets/icons/mono/save.svg":Ge,"./assets/icons/mono/shangbiao.svg":Ke,"./assets/icons/mono/shangfangtianjia.svg":qe,"./assets/icons/mono/shezhi.svg":Je,"./assets/icons/mono/shixinxiangyou.svg":Ye,"./assets/icons/mono/smile.svg":Xe,"./assets/icons/mono/split.svg":Ze,"./assets/icons/mono/switch.svg":Qe,"./assets/icons/mono/text-color.svg":$e,"./assets/icons/mono/text.svg":et,"./assets/icons/mono/wenziyulan.svg":tt,"./assets/icons/mono/wuxuliebiao.svg":nt,"./assets/icons/mono/xiabiao.svg":rt,"./assets/icons/mono/xiafangtianjia.svg":it,"./assets/icons/mono/xiahuaxian.svg":at,"./assets/icons/mono/xiangshangcharu.svg":ot,"./assets/icons/mono/xiangxiacharujilu-copy.svg":st,"./assets/icons/mono/xiangxiajiantou.svg":ct,"./assets/icons/mono/xiangyoucharu.svg":lt,"./assets/icons/mono/xiangzuocharu.svg":ut,"./assets/icons/mono/xieti.svg":dt,"./assets/icons/mono/xuanzhuan.svg":ft,"./assets/icons/mono/yanse.svg":pt,"./assets/icons/mono/yanshi.svg":mt,"./assets/icons/mono/yinyong.svg":ht,"./assets/icons/mono/youduiqi.svg":gt,"./assets/icons/mono/youjiantou.svg":_t,"./assets/icons/mono/yousuojin.svg":vt,"./assets/icons/mono/youxuliebiao.svg":yt,"./assets/icons/mono/yulan.svg":bt,"./assets/icons/mono/zhuti.svg":xt,"./assets/icons/mono/zuoduiqi.svg":St,"./assets/icons/mono/zuojiantou.svg":Ct,"./assets/icons/mono/zuosuojin.svg":wt}),Zt=Object.assign({"./assets/icons/color/ai-mark.svg":Tt,"./assets/icons/color/biaoge.svg":Et,"./assets/icons/color/daimakuai.svg":Dt,"./assets/icons/color/daojishi.svg":Ot,"./assets/icons/color/dayin.svg":kt,"./assets/icons/color/duihao.svg":At,"./assets/icons/color/fengexian.svg":jt,"./assets/icons/color/fenlan.svg":Mt,"./assets/icons/color/file.svg":Nt,"./assets/icons/color/gaoliangkuai1.svg":Pt,"./assets/icons/color/jisuangongshi.svg":Ft,"./assets/icons/color/markdown.svg":It,"./assets/icons/color/pdfdaochu.svg":Lt,"./assets/icons/color/renwu.svg":Rt,"./assets/icons/color/rich-text-document.svg":zt,"./assets/icons/color/riqi.svg":Bt,"./assets/icons/color/shipin.svg":Vt,"./assets/icons/color/tupian.svg":Ht,"./assets/icons/color/tupiandaochu.svg":Ut,"./assets/icons/color/wangye.svg":Wt,"./assets/icons/color/wenjianjia.svg":Gt,"./assets/icons/color/wuxuliebiao.svg":Kt,"./assets/icons/color/xiazai.svg":qt,"./assets/icons/color/yinyong.svg":Jt,"./assets/icons/color/youxuliebiao.svg":Yt});function Qt(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.split(`/`).pop()?.replace(/\.svg$/i,``)??e,String(t)]))}var $t=Qt(Xt),en=Qt(Zt),tn=Object.keys($t).sort(),nn=Object.keys(en).sort(),rn=[`data-name`,`title`,`innerHTML`],an=(0,t.defineComponent)({__name:`OfficeColorIcon`,props:{name:{},size:{default:22},backgroundColor:{default:`#ffffff`}},setup(e){let n=e,r=(0,t.computed)(()=>en[n.name]??``),i=(0,t.computed)(()=>typeof n.size==`number`?`${n.size}px`:n.size),a=(0,t.computed)(()=>({width:i.value,height:i.value,backgroundColor:n.backgroundColor}));return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{class:(0,t.normalizeClass)([`norio-office-rich-icon`,{"norio-office-rich-icon--missing":!r.value}]),style:(0,t.normalizeStyle)(a.value),"data-name":e.name,title:r.value?void 0:`Unknown icon: ${e.name}`,innerHTML:r.value},null,14,rn))}}),on=[`data-name`,`title`,`innerHTML`],M=(0,t.defineComponent)({__name:`OfficeIcon`,props:{name:{},size:{default:22},color:{default:`currentColor`},backgroundColor:{default:`#ffffff`}},setup(e){let n=e,r=(0,t.computed)(()=>$t[n.name]??``),i=(0,t.computed)(()=>typeof n.size==`number`?`${n.size}px`:n.size),a=(0,t.computed)(()=>({width:i.value,height:i.value,color:n.color,backgroundColor:n.backgroundColor}));return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{class:(0,t.normalizeClass)([`norio-office-rich-icon`,{"norio-office-rich-icon--missing":!r.value}]),style:(0,t.normalizeStyle)(a.value),"data-name":e.name,title:r.value?void 0:`Unknown icon: ${e.name}`,innerHTML:r.value},null,14,on))}}),sn=(0,t.defineComponent)({__name:`ScrollArea`,props:{maxHeight:{default:``},className:{default:``}},setup(e){let n=e;return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`norio-office-rich-scroll-area`,e.className]),style:(0,t.normalizeStyle)(n.maxHeight?{maxHeight:n.maxHeight}:void 0)},[(0,t.renderSlot)(r.$slots,`default`)],6))}}),cn={key:0,class:`office-collaboration-presence`,"aria-label":`协作状态和成员`},ln={class:`office-collaboration-presence__status`,role:`status`,"aria-live":`polite`},un=[`data-status`],dn={key:0,class:`office-collaboration-presence__divider`,"aria-hidden":`true`},fn={key:1,class:`office-collaboration-presence__avatars`,"aria-label":`协作成员`},pn=[`title`,`aria-label`],mn=[`src`,`onError`],hn={key:1},gn=[`aria-label`,`aria-expanded`],_n=[`aria-label`],vn=[`src`,`onError`],yn={key:1},bn=[`title`],xn=(0,t.defineComponent)({__name:`CollaborationPresence`,props:{presence:{}},setup(e){let n=e,r=`collaboration-members-${(0,t.useId)()}`,i=(0,t.ref)(!1),a=(0,t.ref)(new Set),o=(0,t.computed)(()=>{let e=new Map;for(let t of n.presence?.members??[]){if(typeof t.userId!=`string`||!t.userId.trim())continue;let n=e.get(t.userId);n?!n.avatar&&t.avatar&&e.set(t.userId,{...n,avatar:t.avatar}):e.set(t.userId,t)}return[...e.values()]}),s=(0,t.computed)(()=>o.value.slice(0,5)),c=(0,t.computed)(()=>o.value.slice(5)),l=(0,t.computed)(()=>({connected:`已连接`,offline:`离线`,connecting:`正在连接`})[n.presence?.status??`offline`]),u=(0,t.computed)(()=>`${Math.min(150,c.value.length*38+12)}px`);function d(e){return Array.from(e.name?.trim()||e.userId.trim())[0]||`?`}function f(e){let t=[`#2563eb`,`#16a34a`,`#dc2626`,`#9333ea`,`#ea580c`,`#0891b2`,`#4f46e5`,`#0f766e`],n=0;for(let t of e.userId)n=n*31+t.codePointAt(0)|0;return t[(n>>>0)%t.length]}function p(e){return`${e.userId}:${e.avatar}`}function m(e){a.value=new Set([...a.value,p(e)])}function h(e){return!!e.avatar&&!a.value.has(p(e))}function g(e){e.currentTarget.contains(e.relatedTarget)||(i.value=!1)}function _(e){if(e.target?.closest?.(`[aria-controls="${r}"]`))return;let t=document.getElementById(r)?.getBoundingClientRect();t&&e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top-12&&e.clientY<=t.bottom||(i.value=!1)}return(0,t.watch)(i,e=>{e?(document.addEventListener(`pointermove`,_),document.addEventListener(`pointerdown`,_)):(document.removeEventListener(`pointermove`,_),document.removeEventListener(`pointerdown`,_))}),(0,t.onBeforeUnmount)(()=>{document.removeEventListener(`pointermove`,_),document.removeEventListener(`pointerdown`,_)}),(0,t.watch)(()=>n.presence?.enabled,e=>{e||(i.value=!1)}),(0,t.watch)(c,e=>{e.length||(i.value=!1)}),(n,a)=>e.presence?.enabled?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cn,[(0,t.createElementVNode)(`span`,ln,[(0,t.createElementVNode)(`span`,{class:`office-collaboration-presence__dot`,"data-status":e.presence.status,"aria-hidden":`true`},null,8,un),(0,t.createTextVNode)((0,t.toDisplayString)(l.value),1)]),o.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,dn)):(0,t.createCommentVNode)(``,!0),o.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fn,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.userId,class:`office-collaboration-presence__avatar`,style:(0,t.normalizeStyle)({backgroundColor:f(e)}),title:e.name||e.userId,"aria-label":e.name||e.userId,role:`img`},[h(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:e.avatar,alt:``,referrerpolicy:`no-referrer`,onError:t=>m(e)},null,40,mn)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,hn,(0,t.toDisplayString)(d(e)),1))],12,pn))),128)),c.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`office-collaboration-presence__overflow`,onMouseenter:a[2]||=e=>i.value=!0,onFocusout:g,onKeydown:a[3]||=(0,t.withKeys)((0,t.withModifiers)(e=>i.value=!1,[`stop`,`prevent`]),[`esc`])},[(0,t.createElementVNode)(`button`,{type:`button`,class:`office-collaboration-presence__count`,"aria-label":`其余 ${c.value.length} 位协作成员`,"aria-expanded":i.value,"aria-controls":r,onClick:a[0]||=(0,t.withModifiers)(e=>i.value=!0,[`stop`]),onFocus:a[1]||=e=>i.value=!0},`+`+(0,t.toDisplayString)(c.value.length),41,gn),i.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,id:r,class:`office-collaboration-presence__popover`,style:(0,t.normalizeStyle)({height:u.value}),role:`region`,"aria-label":`其余协作成员`},[(0,t.createVNode)(sn,{class:`office-collaboration-presence__viewport`,"max-height":`150px`},{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.createElementBlock)(`div`,{key:e.userId,class:`office-collaboration-presence__member`},[(0,t.createElementVNode)(`span`,{class:`office-collaboration-presence__avatar`,style:(0,t.normalizeStyle)({backgroundColor:f(e)}),role:`img`,"aria-label":e.name||e.userId},[h(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:e.avatar,alt:``,loading:`lazy`,referrerpolicy:`no-referrer`,onError:t=>m(e)},null,40,vn)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,yn,(0,t.toDisplayString)(d(e)),1))],12,_n),(0,t.createElementVNode)(`span`,{class:`office-collaboration-presence__name`,title:e.name||e.userId},(0,t.toDisplayString)(e.name||e.userId),9,bn)]))),128))]),_:1})],4)):(0,t.createCommentVNode)(``,!0)],32)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)}}),Sn=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Cn=Sn(xn,[[`__scopeId`,`data-v-6d14c476`]]),wn=[[`#FFFFFF`,`#16181D`,`#4C5563`,`#2F6BFF`,`#1DA1F2`,`#19B36B`,`#F2573F`,`#FF8B24`,`#F7C200`,`#9333EA`],[`#F4F5F7`,`#D9DEE7`,`#C2C9D6`,`#DDE9FF`,`#D6EFFB`,`#D8F4E5`,`#FDE1DD`,`#FFE9D2`,`#FFF3C4`,`#F1D8FF`],[`#E6E8EC`,`#BFC6D4`,`#A8B1C4`,`#BED3FF`,`#B9E5F8`,`#B8ECD2`,`#F9C3BC`,`#FFD6AC`,`#FFE58C`,`#E4BCFF`],[`#D1D5DB`,`#9CA3AF`,`#6B7280`,`#8BB2FF`,`#86D3F3`,`#7DDEAB`,`#F69B8F`,`#FFBB79`,`#F9D45C`,`#CE97FF`],[`#9AA4B2`,`#4B5563`,`#374151`,`#4C7DFF`,`#2BAFE3`,`#22C55E`,`#EF6B59`,`#F59E0B`,`#D4A500`,`#A855F7`],[`#6B7280`,`#111827`,`#1F2937`,`#1D4ED8`,`#1473C5`,`#15803D`,`#DC2626`,`#C56A06`,`#A16207`,`#6B21A8`]],Tn=[`#F04438`,`#FF8B24`,`#F7C200`,`#95D13C`,`#19B36B`,`#1DA1F2`,`#1677C8`,`#152A6A`,`#5A2CA0`],En={class:`norio-office-rich-color-menu__section`},Dn={class:`norio-office-rich-color-menu__section`},On={class:`norio-office-rich-color-menu__grid`},kn=[`aria-label`,`aria-pressed`,`title`,`onClick`],An={class:`norio-office-rich-color-menu__section`},jn={class:`norio-office-rich-color-menu__row`},Mn=[`aria-label`,`aria-pressed`,`title`,`onClick`],Nn={class:`norio-office-rich-color-menu__section`},Pn={class:`norio-office-rich-color-menu__row`},Fn=[`aria-label`,`aria-pressed`,`title`,`onClick`],In={class:`norio-office-rich-color-menu__footer`},Ln=[`value`],Rn=(0,t.defineComponent)({__name:`ColorPalettePanel`,props:{color:{},defaultColor:{},recentColors:{}},emits:[`change`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(null);function o(e){return r.color.toLowerCase()===e.toLowerCase()}function s(e){let t=e.target.value;t&&i(`change`,t)}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`norio-office-rich-color-palette`,onMousedown:r[2]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createElementVNode)(`div`,En,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-color-menu__current`,onClick:r[0]||=t=>i(`change`,e.defaultColor)},`默认`)]),(0,t.createElementVNode)(`div`,Dn,[(0,t.createElementVNode)(`div`,On,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(wn).flat(),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-color-menu__swatch`,{"norio-office-rich-color-menu__swatch--active":o(e)}]),style:(0,t.normalizeStyle)({backgroundColor:e}),"aria-label":e,"aria-pressed":o(e),title:e,onClick:t=>i(`change`,e)},null,14,kn))),128))])]),(0,t.createElementVNode)(`div`,An,[r[3]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-color-menu__label`},`标准色`,-1),(0,t.createElementVNode)(`div`,jn,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(Tn),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-color-menu__swatch norio-office-rich-color-menu__swatch--compact`,{"norio-office-rich-color-menu__swatch--active":o(e)}]),style:(0,t.normalizeStyle)({backgroundColor:e}),"aria-label":`标准色 ${e}`,"aria-pressed":o(e),title:e,onClick:t=>i(`change`,e)},null,14,Mn))),128))])]),(0,t.createElementVNode)(`div`,Nn,[r[4]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-color-menu__label`},`最近使用`,-1),(0,t.createElementVNode)(`div`,Pn,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.recentColors.slice(0,10),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-color-menu__swatch norio-office-rich-color-menu__swatch--recent`,{"norio-office-rich-color-menu__swatch--active":o(e)}]),style:(0,t.normalizeStyle)({backgroundColor:e}),"aria-label":`最近使用 ${e}`,"aria-pressed":o(e),title:e,onClick:t=>i(`change`,e)},null,14,Fn))),128)),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Math.max(0,10-e.recentColors.length),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e,class:`norio-office-rich-color-menu__swatch norio-office-rich-color-menu__swatch--empty`}))),128))])]),(0,t.createElementVNode)(`div`,In,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-color-menu__more`,onClick:r[1]||=e=>a.value?.click()},[r[5]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-color-menu__rainbow`},null,-1),r[6]||=(0,t.createElementVNode)(`span`,null,`更多颜色`,-1),(0,t.createVNode)(M,{name:`shixinxiangyou`,size:10,color:`#9ca3af`,"background-color":`transparent`,class:`norio-office-rich-color-menu__arrow`})]),(0,t.createElementVNode)(`input`,{ref_key:`pickerRef`,ref:a,type:`color`,class:`norio-office-rich-color-menu__picker`,"aria-label":`更多颜色取色器`,value:e.color===`transparent`?e.defaultColor:e.color,onInput:s},null,40,Ln)])],32))}}),zn={class:`norio-office-rich-block-colors__label`},Bn={class:`norio-office-rich-block-colors__grid`},Vn=[`aria-label`,`title`,`aria-pressed`,`onClick`],Hn={key:0},Un=[`aria-label`,`aria-expanded`,`onMouseenter`,`onClick`],Wn=(0,t.defineComponent)({__name:`BlockColorPanel`,props:{textColor:{},backgroundColor:{},color:{},kind:{},label:{},presetColors:{},customKind:{},hoverEnabled:{type:Boolean}},emits:[`change`,`custom`,`reset`],setup(e,{emit:n}){let r=e,i=n,a=[null,`#9CA3AF`,`#DC2626`,`#F97316`,`#D4A500`,`#15803D`,`#2F6BFF`,`#9333EA`],o=[null,`#F4F5F7`,`#FDE1DD`,`#FFE9D2`,`#FFF3C4`,`#D8F4E5`,`#DDE9FF`,`#F1D8FF`,`#E6E8EC`,`#D9DEE7`,`#F9C3BC`,`#FFD6AC`,`#FFE58C`,`#B8ECD2`,`#BED3FF`,`#E4BCFF`],s=(0,t.computed)(()=>r.kind?[{key:r.kind,label:r.label||(r.kind===`border`?`边框颜色`:`填充颜色`),colors:r.presetColors?[null,...r.presetColors]:o}]:[{key:`text`,label:`字体颜色`,colors:a},{key:`background`,label:`背景颜色`,colors:o}]);function c(e){return r.kind&&r.label?`自定义${r.label}`:{text:`自定义文字颜色`,background:`自定义背景颜色`,border:`自定义边框颜色`,fill:`自定义填充颜色`}[e]}function l(e,t){return t||(e===`border`||e===`fill`?`无颜色`:`默认`)}function u(e,t){let n=e===`text`?r.textColor:e===`background`?r.backgroundColor:r.color;return(n===`transparent`?``:n??``).toLowerCase()===(t??``).toLowerCase()}function d(e,t){t.currentTarget instanceof HTMLElement&&i(`custom`,e,t.currentTarget)}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`norio-office-rich-block-colors`,onMousedown:r[1]||=(0,t.withModifiers)(()=>{},[`prevent`])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:n.key,class:`norio-office-rich-block-colors__section`},[(0,t.createElementVNode)(`div`,zn,(0,t.toDisplayString)(n.label),1),(0,t.createElementVNode)(`div`,Bn,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n.colors,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e||`default`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-colors__swatch`,{"norio-office-rich-block-colors__swatch--active":u(n.key,e),"norio-office-rich-block-colors__swatch--clear":n.key!==`text`&&!e}]),style:(0,t.normalizeStyle)(n.key===`text`?{color:e||`#273142`}:{backgroundColor:e||`#ffffff`}),"aria-label":`${n.label} ${l(n.key,e)}`,title:`${n.label} ${l(n.key,e)}`,"aria-pressed":u(n.key,e),onClick:t=>i(`change`,n.key,e)},[n.key===`text`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Hn,`A`)):(0,t.createCommentVNode)(``,!0)],14,Vn))),128))]),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-block-colors__custom`,{"norio-office-rich-block-side-menu__item--active":e.customKind===n.key}]),"aria-label":c(n.key),"aria-expanded":e.customKind===n.key,onMouseenter:t=>e.hoverEnabled&&d(n.key,t),onClick:e=>d(n.key,e)},[(0,t.createVNode)(M,{name:`yanse`,size:16,color:`currentColor`,"background-color":`transparent`}),r[2]||=(0,t.createElementVNode)(`span`,null,`自定义颜色`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:12,color:`#9aa4b2`,"background-color":`transparent`})],42,Un)]))),128)),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-color-menu__current norio-office-rich-block-colors__reset`,onClick:r[0]||=e=>i(`reset`)},`恢复默认`)],32))}}),Gn={class:`norio-office-rich-text-bubble__toolbar`,role:`toolbar`,"aria-label":`文字格式`},Kn=[`disabled`,`title`,`aria-label`,`aria-pressed`,`aria-expanded`,`onClick`],qn={key:0,class:`norio-office-rich-toolbar__color-trigger`},Jn={key:1},Yn=[`aria-label`],Xn=[`disabled`,`aria-label`,`aria-pressed`,`aria-expanded`,`onMouseenter`,`onClick`],Zn={key:1,class:`norio-office-rich-text-bubble__option-symbol`},Qn={class:`norio-office-rich-text-bubble__option-label`},$n=[`aria-label`],er=[`disabled`,`aria-label`,`aria-pressed`,`onClick`],tr={class:`norio-office-rich-text-bubble__option-symbol`},nr={class:`norio-office-rich-text-bubble__option-label`},rr=(0,t.defineComponent)({__name:`TextSelectionMenu`,props:{editor:{},actions:{},enabled:{type:Boolean},scope:{},getReferencedVirtualElement:{type:Function}},emits:[`visibility-change`],setup(e,{emit:n}){let i=e,o=i.scope===`table`?`tableBubbleMenu`:`textSelectionBubbleMenu`,c=n,l=(0,t.ref)(null),u=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(null),p=(0,t.ref)(null),m=(0,t.ref)(null),h=(0,t.ref)(null),g=(0,t.ref)(!1),_=(0,t.ref)(!1),v=(0,t.ref)(!1),y=(0,t.ref)(!1),b=(0,t.ref)(!1),x=(0,t.computed)(()=>_.value||v.value),S=(0,t.computed)(()=>i.enabled&&!g.value&&!y.value&&!x.value&&b.value),C=(0,t.ref)({}),w=(0,t.ref)({}),T=(0,t.computed)(()=>i.actions.find(e=>e.key===m.value)),E=(0,t.computed)(()=>T.value?.options?.find(e=>e.key===h.value)),D=null,O=null,ee=null,k=i.editor.state.selection,te=`top`;function ne(){if(i.scope===`table`)return`top`;let e=i.editor.state.selection;if(!(e instanceof a.TextSelection)||e.empty)return`top`;try{let t=document.createRange(),n=i.editor.view.domAtPos(e.from),r=i.editor.view.domAtPos(e.to);t.setStart(n.node,n.offset),t.setEnd(r.node,r.offset);let a=Array.from(t.getClientRects()).filter(e=>e.width>0&&e.height>0);return a.length>1&&a[a.length-1].top-a[0].top>4?`bottom`:`top`}catch{return`top`}}function re(){let e=ne();e!==te&&(te=e,i.editor.view.dispatch(i.editor.state.tr.setMeta(o,{type:`updateOptions`,options:{options:{placement:e}}})))}function A(){let e=p.value?.getBoundingClientRect(),t=u.value;if(!e||!t)return;let n=Math.min(T.value?.setColor?264:232,window.innerWidth-16),r=Math.min(t.scrollHeight,window.innerHeight-16),i=e.bottom+8+r<=window.innerHeight-8?e.bottom+8:Math.max(8,e.top-r-8);C.value={position:`fixed`,width:`${n}px`,left:`${Math.max(8,Math.min(e.left,window.innerWidth-n-8))}px`,top:`${i}px`,maxHeight:`${window.innerHeight-16}px`},ie()}function ie(){let e=f.value?.getBoundingClientRect(),t=d.value;if(!e||!t)return;let n=Math.min(184,window.innerWidth-16),r=Math.min(t.scrollHeight,window.innerHeight-16),i=e.right+4+n<=window.innerWidth-8,a=e.left-n-4>=8,o=i?e.right+4:a?e.left-n-4:Math.max(8,Math.min(e.left,window.innerWidth-n-8)),s=i||a?e.top:e.bottom+4+r<=window.innerHeight-8?e.bottom+4:e.top-r-4,c=Math.max(8,Math.min(s,window.innerHeight-r-8));w.value={position:`fixed`,width:`${n}px`,left:`${o}px`,top:`${c}px`,maxHeight:`${window.innerHeight-16}px`}}function ae(){!i.editor.isDestroyed&&!i.editor.state.selection.empty&&!g.value&&l.value?.isConnected&&i.editor.view.dispatch(i.editor.state.tr.setMeta(o,`updatePosition`)),A()}function oe(e){let{$from:t,$to:n}=e.selection,r=e.selection instanceof s.CellSelection||e.selection instanceof a.NodeSelection&&e.selection.node.type.name===`table`||e.selection instanceof a.TextSelection&&Array.from({length:t.depth},(e,t)=>t+1).some(e=>t.node(e).type.name===`table`&&n.depth>=e&&t.start(e)===n.start(e)),o=e.selection instanceof a.TextSelection&&!e.selection.empty&&!!e.doc.textBetween(e.selection.from,e.selection.to).length;return i.scope===`table`?r&&!e.selection.empty:o&&!r}function se({view:e,state:t,element:n}){return t.selection.eq(k)||(g.value=!1),i.enabled&&!g.value&&!y.value&&i.editor.isEditable&&oe(t)&&(e.hasFocus()||n.contains(document.activeElement))}function j(e,t){e.disabled||(e.options||e.setColor?(p.value=t.currentTarget,m.value=m.value===e.key?null:e.key):(m.value=null,e.run?.()))}function ce(e){e.disabled||(e.run?.(),m.value!==`alignment`&&(m.value=null))}function le(e,t){h.value=!e.disabled&&e.options?e.key:null,f.value=h.value?t.currentTarget:null}function ue(e,t){e.options?le(e,t):ce(e)}function de(){let e=i.editor.state.selection;e.empty&&(y.value=!1),e.eq(k)||(g.value=!1,m.value=null),k=e}function fe(e){e.target instanceof Node&&!l.value?.contains(e.target)&&(y.value=!1,m.value=null,g.value=!0,e.button===0&&i.editor.view.dom.contains(e.target)&&(_.value=!0))}function pe(){ge()}function me(e){(!e.shiftKey||e.key===`Shift`)&&(v.value=!1)}function he(){_.value=!1,v.value=!1}function ge(){x.value&&(he(),requestAnimationFrame(()=>{!i.editor.isDestroyed&&i.enabled&&!x.value&&oe(i.editor.state)&&(g.value=!1,re(),i.editor.view.dispatch(i.editor.state.tr.setMeta(o,`updatePosition`)))}))}function _e(e){e.target instanceof Node&&i.editor.view.dom.contains(e.target)&&(e.shiftKey&&[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`PageUp`,`PageDown`].includes(e.key)||(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)&&(v.value=!0,y.value=!0),e.key===`Escape`&&S.value&&l.value?.isConnected&&(e.preventDefault(),h.value?h.value=null:m.value?m.value=null:g.value=!0,i.editor.commands.focus())}(0,t.watch)(u,e=>{D?.disconnect(),D=null,e&&(A(),D=new ResizeObserver(A),D.observe(e))},{flush:`post`}),(0,t.watch)(l,e=>{ee?.disconnect(),ee=null,e&&(ee=new ResizeObserver(ae),ee.observe(e))},{flush:`post`}),(0,t.watch)(d,e=>{O?.disconnect(),O=null,e&&(ie(),O=new ResizeObserver(ie),O.observe(e))},{flush:`post`}),(0,t.watch)(h,()=>void(0,t.nextTick)(ie)),(0,t.watch)(m,()=>{h.value=null,(0,t.nextTick)(A)}),(0,t.watch)(()=>i.enabled,e=>{m.value=null,g.value=!e}),(0,t.watch)(S,e=>c(`visibility-change`,e),{flush:`sync`}),(0,t.onMounted)(()=>{i.editor.on(`selectionUpdate`,de),document.addEventListener(`pointerdown`,fe,!0),document.addEventListener(`pointerup`,pe,!0),document.addEventListener(`pointercancel`,he,!0),document.addEventListener(`keydown`,_e,!0),document.addEventListener(`keyup`,me,!0),window.addEventListener(`blur`,he),window.addEventListener(`resize`,ae),window.addEventListener(`scroll`,ae,!0)}),(0,t.onBeforeUnmount)(()=>{c(`visibility-change`,!1),D?.disconnect(),O?.disconnect(),ee?.disconnect(),i.editor.off(`selectionUpdate`,de),document.removeEventListener(`pointerdown`,fe,!0),document.removeEventListener(`pointerup`,pe,!0),document.removeEventListener(`pointercancel`,he,!0),document.removeEventListener(`keydown`,_e,!0),document.removeEventListener(`keyup`,me,!0),window.removeEventListener(`blur`,he),window.removeEventListener(`resize`,ae),window.removeEventListener(`scroll`,ae,!0)});let ve=()=>document.body,ye={strategy:`fixed`,placement:`top`,offset:8,flip:{padding:8},shift:{padding:8,crossAxis:!0},onShow:()=>{b.value=!0},onHide:()=>{m.value=null,b.value=!1},onUpdate:A};return(n,i)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(r.BubbleMenu),{class:(0,t.normalizeClass)(e.scope===`table`?`norio-office-rich-table-bubble-menu`:`norio-office-rich-text-bubble`),"plugin-key":(0,t.unref)(o),editor:e.editor,"should-show":se,"append-to":ve,options:ye,"update-delay":0,"get-referenced-virtual-element":e.getReferencedVirtualElement},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{ref_key:`menuRef`,ref:l,class:`norio-office-rich-text-bubble__content`},[(0,t.createElementVNode)(`div`,Gn,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.actions,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-text-bubble__button`,{"norio-office-rich-text-bubble__button--active":e.active||m.value===e.key,"norio-office-rich-text-bubble__button--select":e.options||e.setColor}]),disabled:e.disabled,title:e.label,"aria-label":e.label,"aria-pressed":e.options||e.setColor?void 0:!!e.active,"aria-expanded":e.options||e.setColor?m.value===e.key:void 0,onMousedown:i[0]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>j(e,t)},[e.setColor?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,qn,[e.icon?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.icon,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Jn,`A`)),(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__color-line`,style:(0,t.normalizeStyle)({backgroundColor:e.color})},null,4)])):e.icon?((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:e.icon,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,class:(0,t.normalizeClass)({"norio-office-rich-toolbar__text-icon--strike":e.key===`strike`})},(0,t.toDisplayString)(e.text),3)),e.options||e.setColor?((0,t.openBlock)(),(0,t.createBlock)(M,{key:3,name:`xiangxiajiantou`,size:10,color:`#9aa4b2`,"background-color":`transparent`})):(0,t.createCommentVNode)(``,!0)],42,Kn))),128))]),(0,t.renderSlot)(n.$slots,`default`),T.value&&(T.value.options||T.value.setColor)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`panelRef`,ref:u,class:`norio-office-rich-text-bubble__panel`,style:(0,t.normalizeStyle)(C.value),role:`dialog`,"aria-label":T.value.label,onMousedown:i[2]||=(0,t.withModifiers)(()=>{},[`stop`])},[T.value.setColor?((0,t.openBlock)(),(0,t.createBlock)(Rn,{key:0,color:T.value.color||T.value.defaultColor,"default-color":T.value.defaultColor,"recent-colors":T.value.recentColors||[],onChange:T.value.setColor},null,8,[`color`,`default-color`,`recent-colors`,`onChange`])):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(T.value.options,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-text-bubble__option`,{"norio-office-rich-text-bubble__option--active":e.active,"norio-office-rich-text-bubble__option--divider":e.divider}]),disabled:e.disabled,"aria-label":e.label,"aria-pressed":!!e.active,"aria-expanded":e.options?h.value===e.key:void 0,style:(0,t.normalizeStyle)(e.fontFamily?{fontFamily:e.fontFamily}:void 0),onMousedown:i[1]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:t=>le(e,t),onClick:t=>ue(e,t)},[e.icon?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.icon,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):e.text?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Zn,(0,t.toDisplayString)(e.text),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,Qn,(0,t.toDisplayString)(e.label),1),e.options?((0,t.openBlock)(),(0,t.createBlock)(M,{key:2,class:`norio-office-rich-text-bubble__option-arrow`,name:`youjiantou`,size:12,color:`currentColor`,"background-color":`transparent`})):(0,t.createCommentVNode)(``,!0),e.active?((0,t.openBlock)(),(0,t.createBlock)(an,{key:3,name:`duihao`,size:14,"background-color":`transparent`})):(0,t.createCommentVNode)(``,!0)],46,Xn))),128))],44,Yn)):(0,t.createCommentVNode)(``,!0),E.value?.options?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,ref_key:`nestedPanelRef`,ref:d,class:`norio-office-rich-text-bubble__panel norio-office-rich-text-bubble__panel--nested`,style:(0,t.normalizeStyle)(w.value),role:`dialog`,"aria-label":E.value.label,onMousedown:i[4]||=(0,t.withModifiers)(()=>{},[`stop`])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(E.value.options,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-text-bubble__option`,{"norio-office-rich-text-bubble__option--active":e.active}]),disabled:e.disabled,"aria-label":e.label,"aria-pressed":!!e.active,onMousedown:i[3]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>ce(e)},[(0,t.createElementVNode)(`span`,tr,(0,t.toDisplayString)(e.text),1),(0,t.createElementVNode)(`span`,nr,(0,t.toDisplayString)(e.label),1),e.active?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:14,"background-color":`transparent`})):(0,t.createCommentVNode)(``,!0)],42,er))),128))],44,$n)):(0,t.createCommentVNode)(``,!0)],512)]),_:3},8,[`class`,`plugin-key`,`editor`,`get-referenced-virtual-element`])),[[t.vShow,e.enabled&&!g.value&&!y.value&&!x.value]])}}),ir=[{id:`recent`,icon:`🕘`,label:`最近`},{id:`smileys`,icon:`😀`,label:`表情`},{id:`people`,icon:`🙌`,label:`人物`},{id:`animals`,icon:`🐻`,label:`动物`},{id:`food`,icon:`🍎`,label:`食物`},{id:`travel`,icon:`🌍`,label:`出行`},{id:`objects`,icon:`💡`,label:`物品`},{id:`symbols`,icon:`✅`,label:`符号`}],ar=Object.entries({smileys:[[`😀`,`开心`,[`happy`,`smile`]],[`😃`,`大笑`,[`happy`,`joy`]],[`😄`,`咧嘴笑`,[`grin`,`joy`]],[`😁`,`露齿笑`,[`teeth`,`smile`]],[`😆`,`眯眼笑`,[`laugh`]],[`😅`,`汗笑`,[`relief`]],[`😂`,`笑哭`,[`lol`,`cry`]],[`🤣`,`打滚笑`,[`lol`,`laugh`]],[`😊`,`微笑`,[`blush`]],[`😇`,`天使笑`,[`angel`]],[`🙂`,`轻笑`,[`smile`]],[`🙃`,`倒脸`,[`flip`]],[`😉`,`眨眼`,[`wink`]],[`😌`,`放松`,[`calm`]],[`😍`,`爱心眼`,[`love`]],[`🥰`,`喜爱`,[`hearts`]],[`😘`,`飞吻`,[`kiss`]],[`😗`,`亲亲`,[`kiss`]],[`😋`,`馋`,[`yummy`]],[`😎`,`酷`,[`cool`]],[`🤩`,`崇拜`,[`star`]],[`🥳`,`庆祝`,[`party`]],[`😏`,`得意`,[`smirk`]],[`😴`,`困`,[`sleep`]],[`😪`,`想睡`,[`sleepy`]],[`🤤`,`流口水`,[`drool`]],[`😭`,`大哭`,[`cry`,`sad`]],[`😤`,`生气`,[`angry`]],[`😡`,`愤怒`,[`mad`]],[`😱`,`震惊`,[`shock`]],[`🥶`,`冷`,[`cold`]],[`🥵`,`热`,[`hot`]],[`🤔`,`思考`,[`think`]],[`🫡`,`致意`,[`salute`]],[`🤗`,`拥抱`,[`hug`]],[`🤭`,`偷笑`,[`giggle`]],[`🤫`,`嘘`,[`quiet`]],[`🤥`,`说谎`,[`lie`]],[`😷`,`口罩`,[`sick`]],[`🤒`,`发烧`,[`sick`]]],people:[[`👍`,`点赞`,[`ok`,`thumb`]],[`👎`,`点踩`,[`thumb`]],[`👌`,`好`,[`ok`]],[`👋`,`挥手`,[`hello`]],[`👏`,`鼓掌`,[`clap`]],[`🙌`,`举手`,[`hooray`]],[`👐`,`展开双手`,[`open`]],[`🤝`,`握手`,[`deal`]],[`🙏`,`祈祷`,[`thanks`]],[`💪`,`力量`,[`strong`]],[`✍️`,`书写`,[`write`]],[`🫶`,`比心`,[`love`]],[`🤟`,`爱你手势`,[`love`]],[`🤘`,`摇滚`,[`rock`]],[`🤞`,`交叉手指`,[`luck`]],[`🫰`,`捏手`,[`snap`]],[`🫵`,`指向你`,[`point`]],[`👀`,`眼睛`,[`look`]],[`🧠`,`大脑`,[`brain`]],[`💅`,`美甲`,[`nail`]],[`🧑‍💻`,`开发者`,[`coder`]],[`👨‍💻`,`男程序员`,[`coder`]],[`👩‍💻`,`女程序员`,[`coder`]],[`🧑‍🏫`,`老师`,[`teacher`]],[`🧑‍⚕️`,`医生`,[`doctor`]],[`🧑‍🚀`,`宇航员`,[`space`]],[`🧑‍🎨`,`艺术家`,[`art`]],[`🧑‍🍳`,`厨师`,[`cook`]],[`🕺`,`跳舞`,[`dance`]],[`💃`,`舞者`,[`dance`]],[`🧘`,`冥想`,[`meditate`]],[`🏃`,`跑步`,[`run`]],[`🚶`,`步行`,[`walk`]],[`🙋`,`举手提问`,[`question`]],[`🙇`,`鞠躬`,[`bow`]],[`🤦`,`捂脸`,[`facepalm`]],[`🤷`,`耸肩`,[`shrug`]],[`🙅`,`拒绝`,[`no`]],[`🙆`,`同意`,[`ok`]],[`💁`,`提示`,[`guide`]]],animals:[[`🐶`,`小狗`,[`dog`]],[`🐱`,`小猫`,[`cat`]],[`🐭`,`老鼠`,[`mouse`]],[`🐹`,`仓鼠`,[`hamster`]],[`🐰`,`兔子`,[`rabbit`]],[`🦊`,`狐狸`,[`fox`]],[`🐻`,`熊`,[`bear`]],[`🐼`,`熊猫`,[`panda`]],[`🐨`,`考拉`,[`koala`]],[`🐯`,`老虎`,[`tiger`]],[`🦁`,`狮子`,[`lion`]],[`🐮`,`奶牛`,[`cow`]],[`🐷`,`猪`,[`pig`]],[`🐸`,`青蛙`,[`frog`]],[`🐵`,`猴子`,[`monkey`]],[`🐔`,`小鸡`,[`chicken`]],[`🐧`,`企鹅`,[`penguin`]],[`🐦`,`小鸟`,[`bird`]],[`🦄`,`独角兽`,[`unicorn`]],[`🐝`,`蜜蜂`,[`bee`]],[`🦋`,`蝴蝶`,[`butterfly`]],[`🐢`,`乌龟`,[`turtle`]],[`🐬`,`海豚`,[`dolphin`]],[`🐳`,`鲸鱼`,[`whale`]],[`🐙`,`章鱼`,[`octopus`]],[`🦖`,`恐龙`,[`dinosaur`]],[`🌸`,`樱花`,[`flower`]],[`🌼`,`小花`,[`flower`]],[`🌻`,`向日葵`,[`flower`]],[`🌷`,`郁金香`,[`flower`]],[`🌵`,`仙人掌`,[`plant`]],[`🌲`,`松树`,[`tree`]],[`🌳`,`大树`,[`tree`]],[`🍀`,`四叶草`,[`lucky`]],[`🌴`,`棕榈树`,[`tree`]],[`🌈`,`彩虹`,[`rainbow`]],[`☀️`,`太阳`,[`sun`]],[`🌙`,`月亮`,[`moon`]],[`⭐`,`星星`,[`star`]],[`⛄`,`雪人`,[`snow`]]],food:[[`🍎`,`苹果`,[`apple`]],[`🍐`,`梨`,[`pear`]],[`🍊`,`橘子`,[`orange`]],[`🍋`,`柠檬`,[`lemon`]],[`🍌`,`香蕉`,[`banana`]],[`🍉`,`西瓜`,[`watermelon`]],[`🍇`,`葡萄`,[`grape`]],[`🍓`,`草莓`,[`strawberry`]],[`🫐`,`蓝莓`,[`berry`]],[`🍒`,`樱桃`,[`cherry`]],[`🍑`,`桃子`,[`peach`]],[`🥭`,`芒果`,[`mango`]],[`🍍`,`菠萝`,[`pineapple`]],[`🥥`,`椰子`,[`coconut`]],[`🥝`,`猕猴桃`,[`kiwi`]],[`🍅`,`番茄`,[`tomato`]],[`🥑`,`牛油果`,[`avocado`]],[`🥦`,`西兰花`,[`broccoli`]],[`🥕`,`胡萝卜`,[`carrot`]],[`🌽`,`玉米`,[`corn`]],[`🍞`,`面包`,[`bread`]],[`🥐`,`牛角包`,[`croissant`]],[`🥨`,`椒盐卷饼`,[`pretzel`]],[`🧀`,`奶酪`,[`cheese`]],[`🍳`,`煎蛋`,[`egg`]],[`🥞`,`松饼`,[`pancake`]],[`🍔`,`汉堡`,[`burger`]],[`🍟`,`薯条`,[`fries`]],[`🍕`,`披萨`,[`pizza`]],[`🌭`,`热狗`,[`hotdog`]],[`🍿`,`爆米花`,[`popcorn`]],[`🍣`,`寿司`,[`sushi`]],[`🍜`,`拉面`,[`noodle`]],[`🍩`,`甜甜圈`,[`donut`]],[`🍪`,`曲奇`,[`cookie`]],[`🎂`,`蛋糕`,[`cake`]],[`🍰`,`切块蛋糕`,[`cake`]],[`🍫`,`巧克力`,[`chocolate`]],[`🍭`,`棒棒糖`,[`candy`]],[`☕`,`咖啡`,[`coffee`]]],travel:[[`🚗`,`汽车`,[`car`]],[`🚕`,`出租车`,[`taxi`]],[`🚌`,`公交车`,[`bus`]],[`🚎`,`无轨电车`,[`bus`]],[`🏎️`,`赛车`,[`car`]],[`🚓`,`警车`,[`police`]],[`🚑`,`救护车`,[`ambulance`]],[`🚒`,`消防车`,[`fire`]],[`🚚`,`货车`,[`truck`]],[`🚲`,`自行车`,[`bike`]],[`🛵`,`小踏板`,[`scooter`]],[`✈️`,`飞机`,[`plane`]],[`🚀`,`火箭`,[`rocket`]],[`🚁`,`直升机`,[`helicopter`]],[`⛵`,`帆船`,[`boat`]],[`🚤`,`快艇`,[`boat`]],[`🚢`,`轮船`,[`ship`]],[`🚆`,`火车`,[`train`]],[`🚄`,`高铁`,[`train`]],[`🚇`,`地铁`,[`metro`]],[`🏠`,`房子`,[`home`]],[`🏢`,`办公楼`,[`office`]],[`🏫`,`学校`,[`school`]],[`🏥`,`医院`,[`hospital`]],[`🏨`,`酒店`,[`hotel`]],[`🏖️`,`海滩`,[`beach`]],[`🏝️`,`岛屿`,[`island`]],[`🗽`,`自由女神`,[`usa`]],[`🗼`,`铁塔`,[`tower`]],[`⛩️`,`鸟居`,[`japan`]],[`🏞️`,`国家公园`,[`park`]],[`🌋`,`火山`,[`volcano`]],[`🗺️`,`地图`,[`map`]],[`🌍`,`地球`,[`world`]],[`🌤️`,`晴天`,[`weather`]],[`🌧️`,`下雨`,[`rain`]],[`⛈️`,`雷暴`,[`storm`]],[`🌊`,`海浪`,[`wave`]],[`🌌`,`星空`,[`night`]],[`🧭`,`指南针`,[`compass`]]],objects:[[`💡`,`灯泡`,[`idea`]],[`🔦`,`手电筒`,[`light`]],[`🕯️`,`蜡烛`,[`candle`]],[`📌`,`图钉`,[`pin`]],[`📎`,`回形针`,[`paperclip`]],[`✂️`,`剪刀`,[`scissors`]],[`🖊️`,`圆珠笔`,[`pen`]],[`🖋️`,`钢笔`,[`pen`]],[`✏️`,`铅笔`,[`pencil`]],[`📝`,`笔记`,[`note`]],[`📚`,`书籍`,[`books`]],[`📖`,`打开的书`,[`book`]],[`💻`,`电脑`,[`computer`]],[`⌨️`,`键盘`,[`keyboard`]],[`🖥️`,`显示器`,[`screen`]],[`🖨️`,`打印机`,[`printer`]],[`📱`,`手机`,[`phone`]],[`☎️`,`电话`,[`phone`]],[`📷`,`相机`,[`camera`]],[`🎥`,`摄影机`,[`video`]],[`🎧`,`耳机`,[`music`]],[`🎤`,`麦克风`,[`music`]],[`⌚`,`手表`,[`watch`]],[`⏰`,`闹钟`,[`alarm`]],[`🔋`,`电池`,[`battery`]],[`🔌`,`插头`,[`plug`]],[`🧲`,`磁铁`,[`magnet`]],[`🔑`,`钥匙`,[`key`]],[`🧰`,`工具箱`,[`tool`]],[`💎`,`钻石`,[`gem`]],[`🎁`,`礼物`,[`gift`]],[`🛒`,`购物车`,[`shop`]],[`🪑`,`椅子`,[`chair`]],[`🛏️`,`床`,[`bed`]],[`🚪`,`门`,[`door`]],[`🪞`,`镜子`,[`mirror`]],[`🧸`,`玩具熊`,[`toy`]],[`🪄`,`魔法棒`,[`magic`]],[`🏆`,`奖杯`,[`trophy`]],[`📦`,`箱子`,[`box`]]],symbols:[[`❤️`,`红心`,[`heart`]],[`🧡`,`橙心`,[`heart`]],[`💛`,`黄心`,[`heart`]],[`💚`,`绿心`,[`heart`]],[`💙`,`蓝心`,[`heart`]],[`💜`,`紫心`,[`heart`]],[`🖤`,`黑心`,[`heart`]],[`🤍`,`白心`,[`heart`]],[`🤎`,`棕心`,[`heart`]],[`💔`,`心碎`,[`heart`]],[`❣️`,`爱心感叹号`,[`heart`]],[`💕`,`双心`,[`love`]],[`💞`,`旋转爱心`,[`love`]],[`💯`,`一百分`,[`score`]],[`✅`,`完成`,[`done`]],[`☑️`,`已勾选`,[`check`]],[`✔️`,`对勾`,[`check`]],[`❌`,`叉号`,[`close`]],[`⭕`,`圆圈`,[`circle`]],[`⚠️`,`警告`,[`warning`]],[`🚫`,`禁止`,[`forbid`]],[`❓`,`问号`,[`question`]],[`❗`,`感叹号`,[`important`]],[`💢`,`爆炸怒气`,[`angry`]],[`♻️`,`循环`,[`recycle`]],[`🔔`,`铃铛`,[`bell`]],[`🎵`,`音符`,[`music`]],[`🎶`,`双音符`,[`music`]],[`➕`,`加号`,[`plus`]],[`➖`,`减号`,[`minus`]],[`✖️`,`乘号`,[`times`]],[`➗`,`除号`,[`divide`]],[`™️`,`商标`,[`tm`]],[`©️`,`版权`,[`copyright`]],[`®️`,`注册`,[`register`]],[`🔞`,`18禁`,[`adult`]],[`♾️`,`无限`,[`infinity`]],[`🈲`,`禁止`,[`cn`]],[`🈵`,`满`,[`cn`]],[`🉑`,`可`,[`cn`]]]}).flatMap(([e,t])=>t.map(([t,n,r=[]])=>({emoji:t,label:n,keywords:r,category:e}))),or={class:`norio-office-rich-emoji-picker-panel`},sr={class:`norio-office-rich-emoji-picker-panel__section-title`},cr=[`title`,`onClick`],lr={key:1,class:`norio-office-rich-emoji-picker-panel__empty`},ur={class:`norio-office-rich-emoji-picker-panel__footer`},dr=[`title`,`onClick`],fr={class:`norio-office-rich-emoji-picker-panel__tab-icon`,"aria-hidden":`true`},pr=`office-word:recent-emojis`,mr=10,hr=Sn((0,t.defineComponent)({__name:`EmojiPickerPanel`,props:{selectedEmoji:{default:null}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(``),o=(0,t.ref)(`recent`),s=(0,t.ref)([]),c=new Map(ir.map(e=>[e.id,e.label])),l=ir.filter(e=>e.id!==`recent`),u=(0,t.computed)(()=>a.value.trim().length>0),d=(0,t.computed)(()=>s.value.map(e=>ar.find(t=>t.emoji===e)).filter(e=>!!e).slice(0,mr)),f=(0,t.computed)(()=>{let e=a.value.trim().toLowerCase();return e?ar.filter(t=>[t.label,t.emoji,...t.keywords].join(` `).toLowerCase().includes(e)):[]}),p=(0,t.computed)(()=>{if(u.value)return[{key:`search`,title:`搜索结果`,items:f.value}];if(o.value===`recent`){let e=[];d.value.length&&e.push({key:`recent-top`,title:`最近`,items:d.value});for(let t of l){let n=ar.filter(e=>e.category===t.id);n.length&&e.push({key:String(t.id),title:t.label,items:n})}return e}return[{key:String(o.value),title:c.get(o.value)??`表情`,items:ar.filter(e=>e.category===o.value)}]});function m(){if(typeof window<`u`)try{let e=window.localStorage.getItem(pr);if(!e)return;let t=JSON.parse(e);Array.isArray(t)&&(s.value=t.filter(e=>typeof e==`string`).slice(0,mr))}catch{s.value=[]}}function h(e){typeof window<`u`&&window.localStorage.setItem(pr,JSON.stringify(e))}function g(e){let t=[e,...s.value.filter(t=>t!==e)].slice(0,mr);s.value=t,h(t)}function _(e){g(e),i(`select`,e)}function v(e){o.value=e}return(0,t.onMounted)(()=>{m()}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,or,[(0,t.createVNode)(sn,{"class-name":`norio-office-rich-emoji-picker-panel__body`},{default:(0,t.withCtx)(()=>[p.value.length?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(p.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.key,class:`norio-office-rich-emoji-picker-panel__section`},[(0,t.createElementVNode)(`div`,sr,(0,t.toDisplayString)(e.title),1),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`norio-office-rich-emoji-picker-panel__grid`,{"norio-office-rich-emoji-picker-panel__grid--recent":e.key===`recent-top`}])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`${e.key}-${n.emoji}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-emoji-picker-panel__item`,{"norio-office-rich-emoji-picker-panel__item--active":r.selectedEmoji===n.emoji}]),title:n.label,onClick:e=>_(n.emoji)},(0,t.toDisplayString)(n.emoji),11,cr))),128))],2)]))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lr,`没有找到匹配的表情`))]),_:1}),(0,t.createElementVNode)(`div`,ur,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(ir),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.id,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-emoji-picker-panel__tab`,{"norio-office-rich-emoji-picker-panel__tab--active":o.value===e.id}]),title:e.label,onClick:t=>v(e.id)},[(0,t.createElementVNode)(`span`,fr,(0,t.toDisplayString)(e.icon),1)],10,dr))),128))])]))}}),[[`__scopeId`,`data-v-c9e9c49a`]]),N=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},gr=/([A-Z])/g,_r=e=>e.replace(gr,`-$1`).toLowerCase(),vr={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},yr=/[&><"']/g,br=e=>String(e).replace(yr,e=>vr[e]),xr=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?xr(e.body[0]):e:e.type===`font`?xr(e.body):e,Sr=new Set([`mathord`,`textord`,`atom`]),Cr=e=>Sr.has(xr(e).type),wr=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},Tr={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function Er(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function Dr(e){return e.default===void 0?Er(Array.isArray(e.type)?e.type[0]:e.type):e.default}function Or(e,t,n,r){var i=n[t];e[t]=i===void 0?Dr(r):r.processor?r.processor(i):i}var kr=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(Tr)){var n=Tr[t];n&&Or(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new N(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=wr(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},Ar=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return zr[Br[this.id]]}sub(){return zr[Vr[this.id]]}fracNum(){return zr[Hr[this.id]]}fracDen(){return zr[Ur[this.id]]}cramp(){return zr[P[this.id]]}text(){return zr[Wr[this.id]]}isTight(){return this.size>=2}},jr=0,Mr=1,Nr=2,Pr=3,Fr=4,Ir=5,Lr=6,Rr=7,zr=[new Ar(jr,0,!1),new Ar(Mr,0,!0),new Ar(Nr,1,!1),new Ar(Pr,1,!0),new Ar(Fr,2,!1),new Ar(Ir,2,!0),new Ar(Lr,3,!1),new Ar(Rr,3,!0)],Br=[Fr,Ir,Fr,Ir,Lr,Rr,Lr,Rr],Vr=[Ir,Ir,Ir,Ir,Rr,Rr,Rr,Rr],Hr=[Nr,Pr,Fr,Ir,Lr,Rr,Lr,Rr],Ur=[Pr,Pr,Ir,Ir,Rr,Rr,Rr,Rr],P=[Mr,Mr,Pr,Pr,Ir,Ir,Rr,Rr],Wr=[jr,Mr,Nr,Pr,Nr,Pr,Nr,Pr],Gr={DISPLAY:zr[jr],TEXT:zr[Nr],SCRIPT:zr[Fr],SCRIPTSCRIPT:zr[Lr]},Kr=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function qr(e){for(var t=0;t<Kr.length;t++)for(var n=Kr[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Jr=[];Kr.forEach(e=>e.blocks.forEach(e=>Jr.push(...e)));function Yr(e){for(var t=0;t<Jr.length;t+=2)if(e>=Jr[t]&&e<=Jr[t+1])return!0;return!1}var Xr=e=>e+` `+e,Zr=80,Qr=function(e,t){return`M95,`+(622+e+t)+`
263
263
  c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
264
264
  c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
265
265
  c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
@@ -2624,6 +2624,13 @@ button.norio-office-rich-editor__file-name:focus-visible {\r
2624
2624
  background: rgba(15, 23, 42, 0.62);\r
2625
2625
  }\r
2626
2626
  \r
2627
+ .norio-office-rich-block-side-menu-focus {\r
2628
+ position: absolute;\r
2629
+ z-index: 1;\r
2630
+ pointer-events: none;\r
2631
+ background: rgba(47, 107, 255, 0.08);\r
2632
+ }\r
2633
+ \r
2627
2634
  .norio-office-rich-marquee-selection-layer {\r
2628
2635
  position: absolute;\r
2629
2636
  inset: 0;\r
@@ -2701,6 +2708,7 @@ button.norio-office-rich-editor__file-name:focus-visible {\r
2701
2708
  border-radius: 2px;\r
2702
2709
  background: rgba(255, 255, 255, 0.98);\r
2703
2710
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);\r
2711
+ animation: norio-office-rich-menu-appear 100ms ease-out;\r
2704
2712
  }\r
2705
2713
  \r
2706
2714
  .norio-office-rich-block-side-control--empty {\r
@@ -2773,6 +2781,7 @@ button.norio-office-rich-editor__file-name:focus-visible {\r
2773
2781
  background: rgba(255, 255, 255, 0.98);\r
2774
2782
  color: #1f2937;\r
2775
2783
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.14);\r
2784
+ animation: norio-office-rich-menu-appear 100ms ease-out;\r
2776
2785
  }\r
2777
2786
  \r
2778
2787
  .norio-office-rich-block-side-menu {\r
@@ -3429,6 +3438,19 @@ button.norio-office-rich-editor__file-name:focus-visible {\r
3429
3438
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);\r
3430
3439
  }\r
3431
3440
  \r
3441
+ @keyframes norio-office-rich-menu-appear {\r
3442
+ from { opacity: 0; }\r
3443
+ to { opacity: 1; }\r
3444
+ }\r
3445
+ \r
3446
+ @media (prefers-reduced-motion: reduce) {\r
3447
+ .norio-office-rich-block-side-control,\r
3448
+ .norio-office-rich-block-side-menu,\r
3449
+ .norio-office-rich-block-side-submenu {\r
3450
+ animation: none;\r
3451
+ }\r
3452
+ }\r
3453
+ \r
3432
3454
  .norio-office-rich-text-bubble__toolbar {\r
3433
3455
  display: flex;\r
3434
3456
  align-items: center;\r
@@ -8099,7 +8121,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
8099
8121
  }`,yc=function(e){bc(e,`.`+gc+mc+vc+`
8100
8122
  .`+_c+hc+vc)},bc=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement(`style`);r.textContent=t,e.appendChild(r)}},xc=function(){function e(){}return e.getOrigin=function(t){var n=e._link;return n?(n.href=t,n.href=n.href,n.protocol+n.hostname+n.port):`about:blank`},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement(`a`),e._origin=e.getOrigin(t.location.href)},e._origin=`about:blank`,e}(),Sc=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(kc(e)||Ec(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o=this;return i(this,function(i){switch(i.label){case 0:return t=xc.isSameOrigin(e),n=!Dc(e)&&this._options.useCORS===!0&&Fo.SUPPORT_CORS_IMAGES&&!t,r=!Dc(e)&&!t&&!kc(e)&&typeof this._options.proxy==`string`&&Fo.SUPPORT_CORS_XHR&&!n,!t&&this._options.allowTaint===!1&&!Dc(e)&&!kc(e)&&!r&&!n?[2]:(a=e,r?[4,this.proxy(a)]:[3,2]);case 1:a=i.sent(),i.label=2;case 2:return this.context.logger.debug(`Added image `+e.substring(0,256)),[4,new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,(Oc(a)||n)&&(r.crossOrigin=`anonymous`),r.src=a,r.complete===!0&&setTimeout(function(){return e(r)},500),o._options.imageTimeout>0&&setTimeout(function(){return t(`Timed out (`+o._options.imageTimeout+`ms) loading image`)},o._options.imageTimeout)})];case 3:return[2,i.sent()]}})})},e.prototype.has=function(e){return this._cache[e]!==void 0},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw Error(`No proxy defined`);var r=e.substring(0,256);return new Promise(function(i,a){var o=Fo.SUPPORT_RESPONSE_TYPE?`blob`:`text`,s=new XMLHttpRequest;s.onload=function(){if(s.status===200){if(o===`text`)i(s.response);else{var e=new FileReader;e.addEventListener(`load`,function(){return i(e.result)},!1),e.addEventListener(`error`,function(e){return a(e)},!1),e.readAsDataURL(s.response)}}else a(`Failed to proxy resource `+r+` with status code `+s.status)},s.onerror=a;var c=n.indexOf(`?`)>-1?`&`:`?`;if(s.open(`GET`,``+n+c+`url=`+encodeURIComponent(e)+`&responseType=`+o),o!==`text`&&s instanceof XMLHttpRequest&&(s.responseType=o),t._options.imageTimeout){var l=t._options.imageTimeout;s.timeout=l,s.ontimeout=function(){return a(`Timed out (`+l+`ms) proxying `+r)}}s.send()})},e}(),Cc=/^data:image\/svg\+xml/i,wc=/^data:image\/.*;base64,/i,Tc=/^data:image\/.*/i,Ec=function(e){return Fo.SUPPORT_SVG_DRAWING||!Ac(e)},Dc=function(e){return Tc.test(e)},Oc=function(e){return wc.test(e)},kc=function(e){return e.substr(0,4)===`blob`},Ac=function(e){return e.substr(-3).toLowerCase()===`svg`||Cc.test(e)},X=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),jc=function(e,t,n){return new X(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},Mc=function(){function e(e,t,n,r){this.type=1,this.start=e,this.startControl=t,this.endControl=n,this.end=r}return e.prototype.subdivide=function(t,n){var r=jc(this.start,this.startControl,t),i=jc(this.startControl,this.endControl,t),a=jc(this.endControl,this.end,t),o=jc(r,i,t),s=jc(i,a,t),c=jc(o,s,t);return n?new e(this.start,r,o,c):new e(c,s,a,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Nc=function(e){return e.type===1},Pc=function(){function e(e){var t=e.styles,n=e.bounds,r=hr(t.borderTopLeftRadius,n.width,n.height),i=r[0],a=r[1],o=hr(t.borderTopRightRadius,n.width,n.height),s=o[0],c=o[1],l=hr(t.borderBottomRightRadius,n.width,n.height),u=l[0],d=l[1],f=hr(t.borderBottomLeftRadius,n.width,n.height),p=f[0],m=f[1],h=[];h.push((i+s)/n.width),h.push((p+u)/n.width),h.push((a+m)/n.height),h.push((c+d)/n.height);var g=Math.max.apply(Math,h);g>1&&(i/=g,a/=g,s/=g,c/=g,u/=g,d/=g,p/=g,m/=g);var _=n.width-s,v=n.height-d,y=n.width-u,b=n.height-m,x=t.borderTopWidth,S=t.borderRightWidth,C=t.borderBottomWidth,w=t.borderLeftWidth,T=N(t.paddingTop,e.bounds.width),E=N(t.paddingRight,e.bounds.width),D=N(t.paddingBottom,e.bounds.width),O=N(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||a>0?Ic(n.left+w/3,n.top+x/3,i-w/3,a-x/3,Fc.TOP_LEFT):new X(n.left+w/3,n.top+x/3),this.topRightBorderDoubleOuterBox=i>0||a>0?Ic(n.left+_,n.top+x/3,s-S/3,c-x/3,Fc.TOP_RIGHT):new X(n.left+n.width-S/3,n.top+x/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?Ic(n.left+y,n.top+v,u-S/3,d-C/3,Fc.BOTTOM_RIGHT):new X(n.left+n.width-S/3,n.top+n.height-C/3),this.bottomLeftBorderDoubleOuterBox=p>0||m>0?Ic(n.left+w/3,n.top+b,p-w/3,m-C/3,Fc.BOTTOM_LEFT):new X(n.left+w/3,n.top+n.height-C/3),this.topLeftBorderDoubleInnerBox=i>0||a>0?Ic(n.left+w*2/3,n.top+x*2/3,i-w*2/3,a-x*2/3,Fc.TOP_LEFT):new X(n.left+w*2/3,n.top+x*2/3),this.topRightBorderDoubleInnerBox=i>0||a>0?Ic(n.left+_,n.top+x*2/3,s-S*2/3,c-x*2/3,Fc.TOP_RIGHT):new X(n.left+n.width-S*2/3,n.top+x*2/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?Ic(n.left+y,n.top+v,u-S*2/3,d-C*2/3,Fc.BOTTOM_RIGHT):new X(n.left+n.width-S*2/3,n.top+n.height-C*2/3),this.bottomLeftBorderDoubleInnerBox=p>0||m>0?Ic(n.left+w*2/3,n.top+b,p-w*2/3,m-C*2/3,Fc.BOTTOM_LEFT):new X(n.left+w*2/3,n.top+n.height-C*2/3),this.topLeftBorderStroke=i>0||a>0?Ic(n.left+w/2,n.top+x/2,i-w/2,a-x/2,Fc.TOP_LEFT):new X(n.left+w/2,n.top+x/2),this.topRightBorderStroke=i>0||a>0?Ic(n.left+_,n.top+x/2,s-S/2,c-x/2,Fc.TOP_RIGHT):new X(n.left+n.width-S/2,n.top+x/2),this.bottomRightBorderStroke=u>0||d>0?Ic(n.left+y,n.top+v,u-S/2,d-C/2,Fc.BOTTOM_RIGHT):new X(n.left+n.width-S/2,n.top+n.height-C/2),this.bottomLeftBorderStroke=p>0||m>0?Ic(n.left+w/2,n.top+b,p-w/2,m-C/2,Fc.BOTTOM_LEFT):new X(n.left+w/2,n.top+n.height-C/2),this.topLeftBorderBox=i>0||a>0?Ic(n.left,n.top,i,a,Fc.TOP_LEFT):new X(n.left,n.top),this.topRightBorderBox=s>0||c>0?Ic(n.left+_,n.top,s,c,Fc.TOP_RIGHT):new X(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||d>0?Ic(n.left+y,n.top+v,u,d,Fc.BOTTOM_RIGHT):new X(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=p>0||m>0?Ic(n.left,n.top+b,p,m,Fc.BOTTOM_LEFT):new X(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||a>0?Ic(n.left+w,n.top+x,Math.max(0,i-w),Math.max(0,a-x),Fc.TOP_LEFT):new X(n.left+w,n.top+x),this.topRightPaddingBox=s>0||c>0?Ic(n.left+Math.min(_,n.width-S),n.top+x,_>n.width+S?0:Math.max(0,s-S),Math.max(0,c-x),Fc.TOP_RIGHT):new X(n.left+n.width-S,n.top+x),this.bottomRightPaddingBox=u>0||d>0?Ic(n.left+Math.min(y,n.width-w),n.top+Math.min(v,n.height-C),Math.max(0,u-S),Math.max(0,d-C),Fc.BOTTOM_RIGHT):new X(n.left+n.width-S,n.top+n.height-C),this.bottomLeftPaddingBox=p>0||m>0?Ic(n.left+w,n.top+Math.min(b,n.height-C),Math.max(0,p-w),Math.max(0,m-C),Fc.BOTTOM_LEFT):new X(n.left+w,n.top+n.height-C),this.topLeftContentBox=i>0||a>0?Ic(n.left+w+O,n.top+x+T,Math.max(0,i-(w+O)),Math.max(0,a-(x+T)),Fc.TOP_LEFT):new X(n.left+w+O,n.top+x+T),this.topRightContentBox=s>0||c>0?Ic(n.left+Math.min(_,n.width+w+O),n.top+x+T,_>n.width+w+O?0:s-w+O,c-(x+T),Fc.TOP_RIGHT):new X(n.left+n.width-(S+E),n.top+x+T),this.bottomRightContentBox=u>0||d>0?Ic(n.left+Math.min(y,n.width-(w+O)),n.top+Math.min(v,n.height+x+T),Math.max(0,u-(S+E)),d-(C+D),Fc.BOTTOM_RIGHT):new X(n.left+n.width-(S+E),n.top+n.height-(C+D)),this.bottomLeftContentBox=p>0||m>0?Ic(n.left+w+O,n.top+b,Math.max(0,p-(w+O)),m-(C+D),Fc.BOTTOM_LEFT):new X(n.left+w+O,n.top+n.height-(C+D))}return e}(),Fc;(function(e){e[e.TOP_LEFT=0]=`TOP_LEFT`,e[e.TOP_RIGHT=1]=`TOP_RIGHT`,e[e.BOTTOM_RIGHT=2]=`BOTTOM_RIGHT`,e[e.BOTTOM_LEFT=3]=`BOTTOM_LEFT`})(Fc||={});var Ic=function(e,t,n,r,i){var a=4*((Math.sqrt(2)-1)/3),o=n*a,s=r*a,c=e+n,l=t+r;switch(i){case Fc.TOP_LEFT:return new Mc(new X(e,l),new X(e,l-s),new X(c-o,t),new X(c,t));case Fc.TOP_RIGHT:return new Mc(new X(e,t),new X(e+o,t),new X(c,l-s),new X(c,l));case Fc.BOTTOM_RIGHT:return new Mc(new X(c,t),new X(c,t+s),new X(e+o,l),new X(e,l));case Fc.BOTTOM_LEFT:default:return new Mc(new X(c,l),new X(c-o,l),new X(e,t+s),new X(e,t))}},Lc=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Rc=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},zc=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Bc=function(){function e(e,t,n){this.offsetX=e,this.offsetY=t,this.matrix=n,this.type=0,this.target=6}return e}(),Vc=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),Hc=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),Uc=function(e){return e.type===0},Wc=function(e){return e.type===1},Gc=function(e){return e.type===2},Kc=function(e,t){return e.length===t.length&&e.some(function(e,n){return e===t[n]})},qc=function(e,t,n,r,i){return e.map(function(e,a){switch(a){case 0:return e.add(t,n);case 1:return e.add(t+r,n);case 2:return e.add(t+r,n+i);case 3:return e.add(t,n+i)}return e})},Jc=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),Yc=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Pc(this.container),this.container.styles.opacity<1&&this.effects.push(new Hc(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new Bc(n,r,i))}if(this.container.styles.overflowX!==0){var a=Lc(this.curves),o=zc(this.curves);Kc(a,o)?this.effects.push(new Vc(a,6)):(this.effects.push(new Vc(a,2)),this.effects.push(new Vc(o,4)))}}return e.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,r=this.effects.slice(0);n;){var i=n.effects.filter(function(e){return!Wc(e)});if(t||n.container.styles.position!==0||!n.parent){if(r.unshift.apply(r,i),t=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var a=Lc(n.curves),o=zc(n.curves);Kc(a,o)||r.unshift(new Vc(o,6))}}else r.unshift.apply(r,i);n=n.parent}return r.filter(function(t){return va(t.target,e)})},e}(),Xc=function(e,t,n,r){e.container.elements.forEach(function(i){var a=va(i.flags,4),o=va(i.flags,2),s=new Yc(i,e);va(i.styles.display,2048)&&r.push(s);var c=va(i.flags,8)?[]:r;if(a||o){var l=a||i.styles.isPositioned()?n:t,u=new Jc(s);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var d=i.styles.zIndex.order;if(d<0){var f=0;l.negativeZIndex.some(function(e,t){return d>e.element.container.styles.zIndex.order?(f=t,!1):f>0}),l.negativeZIndex.splice(f,0,u)}else if(d>0){var p=0;l.positiveZIndex.some(function(e,t){return d>=e.element.container.styles.zIndex.order?(p=t+1,!1):p>0}),l.positiveZIndex.splice(p,0,u)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else i.styles.isFloating()?l.nonPositionedFloats.push(u):l.nonPositionedInlineLevel.push(u);Xc(s,u,a?u:n,c)}else i.styles.isInlineLevel()?t.inlineLevel.push(s):t.nonInlineLevel.push(s),Xc(s,t,n,c);va(i.flags,8)&&Zc(i,c)})},Zc=function(e,t){for(var n=e instanceof $o?e.start:1,r=e instanceof $o&&e.reversed,i=0;i<t.length;i++){var a=t[i];a.container instanceof Qo&&typeof a.container.value==`number`&&a.container.value!==0&&(n=a.container.value),a.listValue=tc(n,a.container.styles.listStyleType,!0),n+=r?-1:1}},Qc=function(e){var t=new Yc(e,null),n=new Jc(t),r=[];return Xc(t,n,n,r),Zc(t.container,r),n},$c=function(e,t){switch(t){case 0:return il(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return il(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return il(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return il(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},el=function(e,t){switch(t){case 0:return il(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return il(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return il(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return il(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},tl=function(e,t){switch(t){case 0:return il(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return il(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return il(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return il(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},nl=function(e,t){switch(t){case 0:return rl(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return rl(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return rl(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return rl(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},rl=function(e,t){var n=[];return Nc(e)?n.push(e.subdivide(.5,!1)):n.push(e),Nc(t)?n.push(t.subdivide(.5,!0)):n.push(t),n},il=function(e,t,n,r){var i=[];return Nc(e)?i.push(e.subdivide(.5,!1)):i.push(e),Nc(n)?i.push(n.subdivide(.5,!0)):i.push(n),Nc(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Nc(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},al=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},ol=function(e){var t=e.styles,n=e.bounds,r=N(t.paddingLeft,n.width),i=N(t.paddingRight,n.width),a=N(t.paddingTop,n.width),o=N(t.paddingBottom,n.width);return n.add(r+t.borderLeftWidth,a+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+i),-(t.borderTopWidth+t.borderBottomWidth+a+o))},sl=function(e,t){return e===0?t.bounds:e===2?ol(t):al(t)},cl=function(e,t){return e===0?t.bounds:e===2?ol(t):al(t)},ll=function(e,t,n){var r=sl(pl(e.styles.backgroundOrigin,t),e),i=cl(pl(e.styles.backgroundClip,t),e),a=fl(pl(e.styles.backgroundSize,t),n,r),o=a[0],s=a[1],c=hr(pl(e.styles.backgroundPosition,t),r.width-o,r.height-s);return[ml(pl(e.styles.backgroundRepeat,t),c,a,r,i),Math.round(r.left+c[0]),Math.round(r.top+c[1]),o,s]},ul=function(e){return nr(e)&&e.value===fi.AUTO},dl=function(e){return typeof e==`number`},fl=function(e,t,n){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1];if(!o)return[0,0];if(ur(o)&&s&&ur(s))return[N(o,n.width),N(s,n.height)];var c=dl(a);if(nr(o)&&(o.value===fi.CONTAIN||o.value===fi.COVER))return dl(a)?n.width/n.height<a==(o.value===fi.COVER)?[n.height*a,n.height]:[n.width,n.width/a]:[n.width,n.height];var l=dl(r),u=dl(i),d=l||u;if(ul(o)&&(!s||ul(s)))return l&&u?[r,i]:!c&&!d?[n.width,n.height]:d&&c?[l?r:i*a,u?i:r/a]:[l?r:n.width,u?i:n.height];if(c){var f=0,p=0;return ur(o)?f=N(o,n.width):ur(s)&&(p=N(s,n.height)),ul(o)?f=p*a:(!s||ul(s))&&(p=f/a),[f,p]}var m=null,h=null;if(ur(o)?m=N(o,n.width):s&&ur(s)&&(h=N(s,n.height)),m!==null&&(!s||ul(s))&&(h=l&&u?m/r*i:n.height),h!==null&&ul(o)&&(m=l&&u?h/i*r:n.width),m!==null&&h!==null)return[m,h];throw Error(`Unable to calculate background-size for element`)},pl=function(e,t){var n=e[t];return n===void 0?e[0]:n},ml=function(e,t,n,r,i){var a=t[0],o=t[1],s=n[0],c=n[1];switch(e){case 2:return[new X(Math.round(r.left),Math.round(r.top+o)),new X(Math.round(r.left+r.width),Math.round(r.top+o)),new X(Math.round(r.left+r.width),Math.round(c+r.top+o)),new X(Math.round(r.left),Math.round(c+r.top+o))];case 3:return[new X(Math.round(r.left+a),Math.round(r.top)),new X(Math.round(r.left+a+s),Math.round(r.top)),new X(Math.round(r.left+a+s),Math.round(r.height+r.top)),new X(Math.round(r.left+a),Math.round(r.height+r.top))];case 1:return[new X(Math.round(r.left+a),Math.round(r.top+o)),new X(Math.round(r.left+a+s),Math.round(r.top+o)),new X(Math.round(r.left+a+s),Math.round(r.top+o+c)),new X(Math.round(r.left+a),Math.round(r.top+o+c))];default:return[new X(Math.round(i.left),Math.round(i.top)),new X(Math.round(i.left+i.width),Math.round(i.top)),new X(Math.round(i.left+i.width),Math.round(i.height+i.top)),new X(Math.round(i.left),Math.round(i.height+i.top))]}},hl=`data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,gl=`Hidden Text`,_l=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var n=this._document.createElement(`div`),r=this._document.createElement(`img`),i=this._document.createElement(`span`),a=this._document.body;n.style.visibility=`hidden`,n.style.fontFamily=e,n.style.fontSize=t,n.style.margin=`0`,n.style.padding=`0`,n.style.whiteSpace=`nowrap`,a.appendChild(n),r.src=hl,r.width=1,r.height=1,r.style.margin=`0`,r.style.padding=`0`,r.style.verticalAlign=`baseline`,i.style.fontFamily=e,i.style.fontSize=t,i.style.margin=`0`,i.style.padding=`0`,i.appendChild(this._document.createTextNode(gl)),n.appendChild(i),n.appendChild(r);var o=r.offsetTop-i.offsetTop+2;n.removeChild(i),n.appendChild(this._document.createTextNode(gl)),n.style.lineHeight=`normal`,r.style.verticalAlign=`super`;var s=r.offsetTop-n.offsetTop+2;return a.removeChild(n),{baseline:o,middle:s}},e.prototype.getMetrics=function(e,t){var n=e+` `+t;return this._data[n]===void 0&&(this._data[n]=this.parseMetrics(e,t)),this._data[n]},e}(),vl=function(){function e(e,t){this.context=e,this.options=t}return e}(),yl=1e4,bl=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r._activeEffects=[],r.canvas=n.canvas?n.canvas:document.createElement(`canvas`),r.ctx=r.canvas.getContext(`2d`),n.canvas||(r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+`px`,r.canvas.style.height=n.height+`px`),r.fontMetrics=new _l(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.ctx.textBaseline=`bottom`,r._activeEffects=[],r.context.logger.debug(`Canvas renderer initialized (`+n.width+`x`+n.height+`) with scale `+n.scale),r}return n.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return t.applyEffect(e)})},n.prototype.applyEffect=function(e){this.ctx.save(),Gc(e)&&(this.ctx.globalAlpha=e.opacity),Uc(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Wc(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},n.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},n.prototype.renderStack=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return t=e.element.container.styles,t.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},n.prototype.renderNode=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:if(va(e.container.flags,16))debugger;return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},n.prototype.renderTextWithLetterSpacing=function(e,t,n){var r=this;t===0?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+n):Bo(e.text).reduce(function(t,i){return r.ctx.fillText(i,t,e.bounds.top+n),t+r.ctx.measureText(i).width},e.bounds.left)},n.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(e){return e===`normal`||e===`small-caps`}).join(``),n=Tl(e.fontFamily).join(`, `),r=er(e.fontSize)?``+e.fontSize.number+e.fontSize.unit:e.fontSize.number+`px`;return[[e.fontStyle,t,e.fontWeight,r,n].join(` `),n,r]},n.prototype.renderTextNode=function(e,t){return r(this,void 0,void 0,function(){var n,r,a,o,s,c,l,u,d=this;return i(this,function(i){return n=this.createFontStyle(t),r=n[0],a=n[1],o=n[2],this.ctx.font=r,this.ctx.direction=t.direction===1?`rtl`:`ltr`,this.ctx.textAlign=`left`,this.ctx.textBaseline=`alphabetic`,s=this.fontMetrics.getMetrics(a,o),c=s.baseline,l=s.middle,u=t.paintOrder,e.textBounds.forEach(function(e){u.forEach(function(n){switch(n){case 0:d.ctx.fillStyle=Er(t.color),d.renderTextWithLetterSpacing(e,t.letterSpacing,c);var r=t.textShadow;r.length&&e.text.trim().length&&(r.slice(0).reverse().forEach(function(n){d.ctx.shadowColor=Er(n.color),d.ctx.shadowOffsetX=n.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=n.offsetY.number*d.options.scale,d.ctx.shadowBlur=n.blur.number,d.renderTextWithLetterSpacing(e,t.letterSpacing,c)}),d.ctx.shadowColor=``,d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),t.textDecorationLine.length&&(d.ctx.fillStyle=Er(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(t){switch(t){case 1:d.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+c),e.bounds.width,1);break;case 2:d.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:d.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+l),e.bounds.width,1)}}));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(d.ctx.strokeStyle=Er(t.webkitTextStrokeColor),d.ctx.lineWidth=t.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?`miter`:`round`,d.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+c)),d.ctx.strokeStyle=``,d.ctx.lineWidth=0,d.ctx.lineJoin=`miter`}})}),[2]})})},n.prototype.renderReplacedElement=function(e,t,n){if(n&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var r=ol(e),i=zc(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},n.prototype.renderNodeContent=function(e){return r(this,void 0,void 0,function(){var t,r,a,s,c,l,u,u,d,f,p,m,h,g,_,v,y,b,x,u,S,h,v;return i(this,function(i){switch(i.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,r=e.curves,a=t.styles,s=0,c=t.textNodes,i.label=1;case 1:return s<c.length?(l=c[s],[4,this.renderTextNode(l,a)]):[3,4];case 2:i.sent(),i.label=3;case 3:return s++,[3,1];case 4:if(!(t instanceof Yo))return[3,8];i.label=5;case 5:return i.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return u=i.sent(),this.renderReplacedElement(t,r,u),[3,8];case 7:return i.sent(),this.context.logger.error(`Error loading image `+t.src),[3,8];case 8:if(t instanceof Xo&&this.renderReplacedElement(t,r,t.canvas),!(t instanceof Zo))return[3,12];i.label=9;case 9:return i.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return u=i.sent(),this.renderReplacedElement(t,r,u),[3,12];case 11:return i.sent(),this.context.logger.error(`Error loading svg `+t.svg.substring(0,255)),[3,12];case 12:return t instanceof ds&&t.tree?(d=new n(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}),[4,d.render(t.tree)]):[3,14];case 13:f=i.sent(),t.width&&t.height&&this.ctx.drawImage(f,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),i.label=14;case 14:if(t instanceof cs&&(p=Math.min(t.bounds.width,t.bounds.height),t.type===is?t.checked&&(this.ctx.save(),this.path([new X(t.bounds.left+p*.39363,t.bounds.top+p*.79),new X(t.bounds.left+p*.16,t.bounds.top+p*.5549),new X(t.bounds.left+p*.27347,t.bounds.top+p*.44071),new X(t.bounds.left+p*.39694,t.bounds.top+p*.5649),new X(t.bounds.left+p*.72983,t.bounds.top+p*.23),new X(t.bounds.left+p*.84,t.bounds.top+p*.34085),new X(t.bounds.left+p*.39363,t.bounds.top+p*.79)]),this.ctx.fillStyle=Er(ss),this.ctx.fill(),this.ctx.restore()):t.type===as&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+p/2,t.bounds.top+p/2,p/4,0,Math.PI*2,!0),this.ctx.fillStyle=Er(ss),this.ctx.fill(),this.ctx.restore())),xl(t)&&t.value.length){switch(m=this.createFontStyle(a),h=m[0],g=m[1],_=this.fontMetrics.getMetrics(h,g).baseline,this.ctx.font=h,this.ctx.fillStyle=Er(a.color),this.ctx.textBaseline=`alphabetic`,this.ctx.textAlign=Cl(t.styles.textAlign),v=ol(t),y=0,t.styles.textAlign){case 1:y+=v.width/2;break;case 2:y+=v.width}b=v.add(y,0,0,-v.height/2+1),this.ctx.save(),this.path([new X(v.left,v.top),new X(v.left+v.width,v.top),new X(v.left+v.width,v.top+v.height),new X(v.left,v.top+v.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Io(t.value,b),a.letterSpacing,_),this.ctx.restore(),this.ctx.textBaseline=`alphabetic`,this.ctx.textAlign=`left`}if(!va(t.styles.display,2048))return[3,20];if(t.styles.listStyleImage===null)return[3,19];if(x=t.styles.listStyleImage,x.type!==0)return[3,18];u=void 0,S=x.url,i.label=15;case 15:return i.trys.push([15,17,,18]),[4,this.context.cache.match(S)];case 16:return u=i.sent(),this.ctx.drawImage(u,t.bounds.left-(u.width+10),t.bounds.top),[3,18];case 17:return i.sent(),this.context.logger.error(`Error loading list-style-image `+S),[3,18];case 18:return[3,20];case 19:e.listValue&&t.styles.listStyleType!==-1&&(h=this.createFontStyle(a)[0],this.ctx.font=h,this.ctx.fillStyle=Er(a.color),this.ctx.textBaseline=`middle`,this.ctx.textAlign=`right`,v=new o(t.bounds.left,t.bounds.top+N(t.styles.paddingTop,t.bounds.width),t.bounds.width,z(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Io(e.listValue,v),a.letterSpacing,z(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline=`bottom`,this.ctx.textAlign=`left`),i.label=20;case 20:return[2]}})})},n.prototype.renderStackContent=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o,r,s,c,r,l,u,r,d,f,r,p,m,r,h,g,r;return i(this,function(i){switch(i.label){case 0:if(va(e.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:i.sent(),t=0,n=e.negativeZIndex,i.label=2;case 2:return t<n.length?(r=n[t],[4,this.renderStack(r)]):[3,5];case 3:i.sent(),i.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:i.sent(),a=0,o=e.nonInlineLevel,i.label=7;case 7:return a<o.length?(r=o[a],[4,this.renderNode(r)]):[3,10];case 8:i.sent(),i.label=9;case 9:return a++,[3,7];case 10:s=0,c=e.nonPositionedFloats,i.label=11;case 11:return s<c.length?(r=c[s],[4,this.renderStack(r)]):[3,14];case 12:i.sent(),i.label=13;case 13:return s++,[3,11];case 14:l=0,u=e.nonPositionedInlineLevel,i.label=15;case 15:return l<u.length?(r=u[l],[4,this.renderStack(r)]):[3,18];case 16:i.sent(),i.label=17;case 17:return l++,[3,15];case 18:d=0,f=e.inlineLevel,i.label=19;case 19:return d<f.length?(r=f[d],[4,this.renderNode(r)]):[3,22];case 20:i.sent(),i.label=21;case 21:return d++,[3,19];case 22:p=0,m=e.zeroOrAutoZIndexOrTransformedOrOpacity,i.label=23;case 23:return p<m.length?(r=m[p],[4,this.renderStack(r)]):[3,26];case 24:i.sent(),i.label=25;case 25:return p++,[3,23];case 26:h=0,g=e.positiveZIndex,i.label=27;case 27:return h<g.length?(r=g[h],[4,this.renderStack(r)]):[3,30];case 28:i.sent(),i.label=29;case 29:return h++,[3,27];case 30:return[2]}})})},n.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},n.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},n.prototype.formatPath=function(e){var t=this;e.forEach(function(e,n){var r=Nc(e)?e.start:e;n===0?t.ctx.moveTo(r.x,r.y):t.ctx.lineTo(r.x,r.y),Nc(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},n.prototype.renderRepeat=function(e,t,n,r){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(n,r),this.ctx.fill(),this.ctx.translate(-n,-r)},n.prototype.resizeImage=function(e,t,n){if(e.width===t&&e.height===n)return e;var r=(this.canvas.ownerDocument??document).createElement(`canvas`);return r.width=Math.max(1,t),r.height=Math.max(1,n),r.getContext(`2d`).drawImage(e,0,0,e.width,e.height,0,0,t,n),r},n.prototype.renderBackgroundImage=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o,s;return i(this,function(c){switch(c.label){case 0:t=e.styles.backgroundImage.length-1,n=function(n){var a,o,s,c,l,u,d,f,p,m,c,l,u,d,f,h,g,_,v,y,b,x,S,C,p,w,c,T,E,d,f,D,l,u,O,ee,k,te,ne,re,A,ie;return i(this,function(i){switch(i.label){case 0:if(n.type!==0)return[3,5];a=void 0,o=n.url,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.context.cache.match(o)];case 2:return a=i.sent(),[3,4];case 3:return i.sent(),r.context.logger.error(`Error loading background-image `+o),[3,4];case 4:return a&&(s=ll(e,t,[a.width,a.height,a.width/a.height]),c=s[0],l=s[1],u=s[2],d=s[3],f=s[4],p=r.ctx.createPattern(r.resizeImage(a,d,f),`repeat`),r.renderRepeat(c,p,l,u)),[3,6];case 5:ni(n)?(m=ll(e,t,[null,null,null]),c=m[0],l=m[1],u=m[2],d=m[3],f=m[4],h=Br(n.angle,d,f),g=h[0],_=h[1],v=h[2],y=h[3],b=h[4],x=document.createElement(`canvas`),x.width=d,x.height=f,S=x.getContext(`2d`),C=S.createLinearGradient(_,y,v,b),Rr(n.stops,g).forEach(function(e){return C.addColorStop(e.stop,Er(e.color))}),S.fillStyle=C,S.fillRect(0,0,d,f),d>0&&f>0&&(p=r.ctx.createPattern(x,`repeat`),r.renderRepeat(c,p,l,u))):ri(n)&&(w=ll(e,t,[null,null,null]),c=w[0],T=w[1],E=w[2],d=w[3],f=w[4],D=n.position.length===0?[pr]:n.position,l=N(D[0],d),u=N(D[D.length-1],f),O=Ur(n,l,u,d,f),ee=O[0],k=O[1],ee>0&&k>0&&(te=r.ctx.createRadialGradient(T+l,E+u,0,T+l,E+u,ee),Rr(n.stops,ee*2).forEach(function(e){return te.addColorStop(e.stop,Er(e.color))}),r.path(c),r.ctx.fillStyle=te,ee===k?r.ctx.fill():(ne=e.bounds.left+.5*e.bounds.width,re=e.bounds.top+.5*e.bounds.height,A=k/ee,ie=1/A,r.ctx.save(),r.ctx.translate(ne,re),r.ctx.transform(1,0,0,A,0,0),r.ctx.translate(-ne,-re),r.ctx.fillRect(T,ie*(E-re)+re,d,f*ie),r.ctx.restore()))),i.label=6;case 6:return t--,[2]}})},r=this,a=0,o=e.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return a<o.length?(s=o[a],[5,n(s)]):[3,4];case 2:c.sent(),c.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},n.prototype.renderSolidBorder=function(e,t,n){return r(this,void 0,void 0,function(){return i(this,function(r){return this.path($c(n,t)),this.ctx.fillStyle=Er(e),this.ctx.fill(),[2]})})},n.prototype.renderDoubleBorder=function(e,t,n,a){return r(this,void 0,void 0,function(){var r,o;return i(this,function(i){switch(i.label){case 0:return t<3?[4,this.renderSolidBorder(e,n,a)]:[3,2];case 1:return i.sent(),[2];case 2:return r=el(a,n),this.path(r),this.ctx.fillStyle=Er(e),this.ctx.fill(),o=tl(a,n),this.path(o),this.ctx.fill(),[2]}})})},n.prototype.renderNodeBackgroundAndBorders=function(e){return r(this,void 0,void 0,function(){var t,n,r,a,o,s,c,l,u=this;return i(this,function(i){switch(i.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,n=!Tr(t.backgroundColor)||t.backgroundImage.length,r=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],a=Sl(pl(t.backgroundClip,0),e.curves),n||t.boxShadow.length?(this.ctx.save(),this.path(a),this.ctx.clip(),Tr(t.backgroundColor)||(this.ctx.fillStyle=Er(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:i.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(t){u.ctx.save();var n=Lc(e.curves),r=t.inset?0:yl,i=qc(n,-r+(t.inset?1:-1)*t.spread.number,(t.inset?1:-1)*t.spread.number,t.spread.number*(t.inset?-2:2),t.spread.number*(t.inset?-2:2));t.inset?(u.path(n),u.ctx.clip(),u.mask(i)):(u.mask(n),u.ctx.clip(),u.path(i)),u.ctx.shadowOffsetX=t.offsetX.number+r,u.ctx.shadowOffsetY=t.offsetY.number,u.ctx.shadowColor=Er(t.color),u.ctx.shadowBlur=t.blur.number,u.ctx.fillStyle=t.inset?Er(t.color):`rgba(0,0,0,1)`,u.ctx.fill(),u.ctx.restore()}),i.label=2;case 2:o=0,s=0,c=r,i.label=3;case 3:return s<c.length?(l=c[s],l.style!==0&&!Tr(l.color)&&l.width>0?l.style===2?[4,this.renderDashedDottedBorder(l.color,l.width,o,e.curves,2)]:[3,5]:[3,11]):[3,13];case 4:return i.sent(),[3,11];case 5:return l.style===3?[4,this.renderDashedDottedBorder(l.color,l.width,o,e.curves,3)]:[3,7];case 6:return i.sent(),[3,11];case 7:return l.style===4?[4,this.renderDoubleBorder(l.color,l.width,o,e.curves)]:[3,9];case 8:return i.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,o,e.curves)];case 10:i.sent(),i.label=11;case 11:o++,i.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},n.prototype.renderDashedDottedBorder=function(e,t,n,a,o){return r(this,void 0,void 0,function(){var r,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,b,x;return i(this,function(i){return this.ctx.save(),r=nl(a,n),s=$c(a,n),o===2&&(this.path(s),this.ctx.clip()),Nc(s[0])?(c=s[0].start.x,l=s[0].start.y):(c=s[0].x,l=s[0].y),Nc(s[1])?(u=s[1].end.x,d=s[1].end.y):(u=s[1].x,d=s[1].y),f=Math.abs(n===0||n===2?c-u:l-d),this.ctx.beginPath(),o===3?this.formatPath(r):this.formatPath(s.slice(0,2)),p=t<3?t*3:t*2,m=t<3?t*2:t,o===3&&(p=t,m=t),h=!0,f<=p*2?h=!1:f<=p*2+m?(g=f/(2*p+m),p*=g,m*=g):(_=Math.floor((f+m)/(p+m)),v=(f-_*p)/(_-1),y=(f-(_+1)*p)/_,m=y<=0||Math.abs(m-v)<Math.abs(m-y)?v:y),h&&(o===3?this.ctx.setLineDash([0,p+m]):this.ctx.setLineDash([p,m])),o===3?(this.ctx.lineCap=`round`,this.ctx.lineWidth=t):this.ctx.lineWidth=t*2+1.1,this.ctx.strokeStyle=Er(e),this.ctx.stroke(),this.ctx.setLineDash([]),o===2&&(Nc(s[0])&&(b=s[3],x=s[0],this.ctx.beginPath(),this.formatPath([new X(b.end.x,b.end.y),new X(x.start.x,x.start.y)]),this.ctx.stroke()),Nc(s[1])&&(b=s[1],x=s[2],this.ctx.beginPath(),this.formatPath([new X(b.end.x,b.end.y),new X(x.start.x,x.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},n.prototype.render=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Er(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=Qc(e),[4,this.renderStack(t)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},n}(vl),xl=function(e){return e instanceof us||e instanceof ls||e instanceof cs&&e.type!==as&&e.type!==is},Sl=function(e,t){switch(e){case 0:return Lc(t);case 2:return Rc(t);default:return zc(t)}},Cl=function(e){switch(e){case 1:return`center`;case 2:return`right`;default:return`left`}},wl=[`-apple-system`,`system-ui`],Tl=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(e){return wl.indexOf(e)===-1}):e},El=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.canvas=n.canvas?n.canvas:document.createElement(`canvas`),r.ctx=r.canvas.getContext(`2d`),r.options=n,r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+`px`,r.canvas.style.height=n.height+`px`,r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.context.logger.debug(`EXPERIMENTAL ForeignObject renderer initialized (`+n.width+`x`+n.height+` at `+n.x+`,`+n.y+`) with scale `+n.scale),r}return n.prototype.render=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return t=No(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,Dl(t)];case 1:return n=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Er(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},n}(vl),Dl=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=n,r.src=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(new XMLSerializer().serializeToString(e))})},Ol=function(){function e(e){var t=e.id,n=e.enabled;this.id=t,this.enabled=n,this.start=Date.now()}return e.prototype.debug=function(){var e=[...arguments];this.enabled&&(typeof window<`u`&&window.console&&typeof console.debug==`function`?console.debug.apply(console,a([this.id,this.getTime()+`ms`],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){var e=[...arguments];this.enabled&&typeof window<`u`&&window.console&&typeof console.info==`function`&&console.info.apply(console,a([this.id,this.getTime()+`ms`],e))},e.prototype.warn=function(){var e=[...arguments];this.enabled&&(typeof window<`u`&&window.console&&typeof console.warn==`function`?console.warn.apply(console,a([this.id,this.getTime()+`ms`],e)):this.info.apply(this,e))},e.prototype.error=function(){var e=[...arguments];this.enabled&&(typeof window<`u`&&window.console&&typeof console.error==`function`?console.error.apply(console,a([this.id,this.getTime()+`ms`],e)):this.info.apply(this,e))},e.instances={},e}(),kl=function(){function e(t,n){this.windowBounds=n,this.instanceName=`#`+e.instanceCount++,this.logger=new Ol({id:this.instanceName,enabled:t.logging}),this.cache=t.cache??new Sc(this,t)}return e.instanceCount=1,e}(),Al=function(e,t){return t===void 0&&(t={}),jl(e,t)};typeof window<`u`&&xc.setContext(window);var jl=function(e,t){return r(void 0,void 0,void 0,function(){var r,a,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,D;return i(this,function(i){switch(i.label){case 0:if(!e||typeof e!=`object`)return[2,Promise.reject(`Invalid element provided as first argument`)];if(r=e.ownerDocument,!r)throw Error(`Element is not attached to a Document`);if(a=r.defaultView,!a)throw Error(`Document is not attached to a Window`);return l={allowTaint:t.allowTaint??!1,imageTimeout:t.imageTimeout??15e3,proxy:t.proxy,useCORS:t.useCORS??!1},u=n({logging:t.logging??!0,cache:t.cache},l),d={windowWidth:t.windowWidth??a.innerWidth,windowHeight:t.windowHeight??a.innerHeight,scrollX:t.scrollX??a.pageXOffset,scrollY:t.scrollY??a.pageYOffset},f=new o(d.scrollX,d.scrollY,d.windowWidth,d.windowHeight),p=new kl(u,f),m=t.foreignObjectRendering??!1,h={allowTaint:t.allowTaint??!1,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:m,copyStyles:m},p.logger.debug(`Starting document clone with size `+f.width+`x`+f.height+` scrolled to `+-f.left+`,`+-f.top),g=new rc(p,e,h),_=g.clonedReferenceElement,_?[4,g.toIFrame(r,f)]:[2,Promise.reject(`Unable to find element in cloned iframe`)];case 1:return v=i.sent(),y=Ds(_)||Ts(_)?c(_.ownerDocument):s(p,_),b=y.width,x=y.height,S=y.left,C=y.top,w=Ml(p,_,t.backgroundColor),T={canvas:t.canvas,backgroundColor:w,scale:t.scale??a.devicePixelRatio??1,x:(t.x??0)+S,y:(t.y??0)+C,width:t.width??Math.ceil(b),height:t.height??Math.ceil(x)},m?(p.logger.debug(`Document cloned, using foreign object rendering`),D=new El(p,T),[4,D.render(_)]):[3,3];case 2:return E=i.sent(),[3,5];case 3:return p.logger.debug(`Document cloned, element located at `+S+`,`+C+` with size `+b+`x`+x+` using computed rendering`),p.logger.debug(`Starting DOM parsing`),O=hs(p,_),w===O.styles.backgroundColor&&(O.styles.backgroundColor=Pr.TRANSPARENT),p.logger.debug(`Starting renderer for element at `+T.x+`,`+T.y+` with size `+T.width+`x`+T.height),D=new bl(p,T),[4,D.render(O)];case 4:E=i.sent(),i.label=5;case 5:return(t.removeContainer??!0)&&(rc.destroy(v)||p.logger.error(`Cannot detach cloned iframe as it is not in the DOM anymore`)),p.logger.debug(`Finished rendering`),[2,E]}})})},Ml=function(e,t,n){var r=t.ownerDocument,i=r.documentElement?Nr(e,getComputedStyle(r.documentElement).backgroundColor):Pr.TRANSPARENT,a=r.body?Nr(e,getComputedStyle(r.body).backgroundColor):Pr.TRANSPARENT,o=typeof n==`string`?Nr(e,n):n===null?Pr.TRANSPARENT:4294967295;return t===r.documentElement?Tr(i)?Tr(a)?o:a:i:o};return Al}))})),Xb=[`data-editable`,`data-mode`,`data-fullscreen`,`data-presentation`,`data-outline-open`,`data-outline-placement`,`data-comments-enabled`,`data-comments-open`,`data-drag-insert-active`],Zb=[`aria-label`],Qb={class:`norio-office-rich-editor__file-name-region`},$b=[`aria-label`,`aria-invalid`],ex=[`title`,`aria-label`],tx=[`title`],nx={key:3,class:`norio-office-rich-editor__file-name-error`,role:`alert`},rx={key:1,class:`norio-office-rich-editor__toolbar`},ix={class:`norio-office-rich-editor__toolbar-shell`},ax={class:`norio-office-rich-editor__toolbar-scroll`},ox={class:`norio-office-rich-editor__toolbar-track`},sx={class:`norio-office-rich-toolbar__group`},cx=[`disabled`],lx=[`disabled`],ux=[`disabled`],dx={key:0,class:`norio-office-rich-toolbar__group`},fx=[`disabled`],px={key:1,class:`norio-office-rich-toolbar__group norio-office-rich-toolbar__group--insert`},mx={key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--insert`},hx={class:`norio-office-rich-insert-menu__main`},gx={class:`norio-office-rich-insert-menu__quick-grid`},_x=[`onClick`],vx={key:0,class:`norio-office-rich-insert-menu__quick-text`},yx={key:0,class:`norio-office-rich-insert-menu__section`},bx=[`onMouseenter`,`onFocus`,`onClick`],xx={class:`norio-office-rich-insert-menu__icon`},Sx={class:`norio-office-rich-insert-menu__label`},Cx={key:1,class:`norio-office-rich-insert-menu__section`},wx=[`onClick`],Tx={class:`norio-office-rich-insert-menu__icon`},Ex={class:`norio-office-rich-insert-menu__label`},Dx={key:2,class:`norio-office-rich-insert-menu__section`},Ox=[`onClick`],kx={class:`norio-office-rich-insert-menu__icon`},Ax={class:`norio-office-rich-insert-menu__label`},jx={class:`norio-office-rich-insert-submenu__title norio-office-rich-insert-submenu__title--preview`},Mx={class:`norio-office-rich-table-grid`},Nx=[`onMouseenter`,`onFocus`,`onClick`],Px={key:1,class:`norio-office-rich-insert-submenu norio-office-rich-insert-submenu--emoji`},Fx={class:`norio-office-rich-insert-submenu__title norio-office-rich-insert-submenu__title--preview`},Ix={class:`norio-office-rich-columns-picker`},Lx={class:`norio-office-rich-columns-picker__grid`},Rx=[`onMouseenter`,`onFocus`,`onClick`],zx={class:`norio-office-rich-countdown-settings`},Bx={class:`norio-office-rich-countdown-settings__header`},Vx={class:`norio-office-rich-countdown-settings__row norio-office-rich-countdown-settings__row--deadline`},Hx={class:`norio-office-rich-countdown-settings__radio`},Ux=[`disabled`],Wx={class:`norio-office-rich-countdown-settings__picker-top`},Gx=[`value`],Kx=[`value`],qx=[`value`],Jx=[`value`],Yx={class:`norio-office-rich-countdown-settings__weekdays`},Xx={class:`norio-office-rich-countdown-settings__calendar`},Zx=[`disabled`,`onClick`],Qx={class:`norio-office-rich-countdown-settings__time-section`},$x={class:`norio-office-rich-countdown-settings__time-panel`},eS=[`min`],tS={class:`norio-office-rich-countdown-settings__row norio-office-rich-countdown-settings__row--duration`},nS={class:`norio-office-rich-countdown-settings__radio`},rS={class:`norio-office-rich-countdown-settings__duration`},iS=[`disabled`],aS=[`disabled`],oS=[`disabled`],sS=[`disabled`],cS={class:`norio-office-rich-countdown-settings__actions`},lS={class:`norio-office-rich-toolbar__group`},uS=[`disabled`],dS={class:`norio-office-rich-toolbar__heading-label`},fS={key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--heading`},pS=[`disabled`,`onClick`],mS={key:1,class:`norio-office-rich-toolbar__menu-check`},hS={class:`norio-office-rich-toolbar__menu-type`},gS={class:`norio-office-rich-toolbar__menu-label`},_S=[`disabled`],vS={class:`norio-office-rich-toolbar__label`},yS={key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--font-family`},bS=[`disabled`,`onClick`],xS={key:1,class:`norio-office-rich-toolbar__menu-check`},SS=[`disabled`],CS={class:`norio-office-rich-toolbar__label`},wS={key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--font-size`},TS=[`disabled`,`onClick`],ES={key:1,class:`norio-office-rich-toolbar__menu-check`},DS={class:`norio-office-rich-toolbar__menu-label`},OS={class:`norio-office-rich-toolbar__group`},kS=[`disabled`],AS={class:`norio-office-rich-toolbar__color-trigger`},jS=[`disabled`],MS={class:`norio-office-rich-toolbar__color-trigger`},NS=[`disabled`],PS=[`disabled`],FS=[`disabled`],IS=[`disabled`],LS=[`disabled`],RS={key:1,class:`norio-office-rich-toolbar__text-icon`},zS={key:0,class:`norio-office-rich-toolbar__menu`},BS=[`disabled`],VS={key:1,class:`norio-office-rich-toolbar__menu-check`},HS=[`disabled`],US={key:1,class:`norio-office-rich-toolbar__menu-check`},WS={class:`norio-office-rich-toolbar__group`},GS=[`disabled`],KS=[`disabled`],qS=[`disabled`],JS=[`disabled`],YS={key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--align`},XS=[`disabled`],ZS={key:1,class:`norio-office-rich-toolbar__menu-check`},QS=[`disabled`],$S={key:1,class:`norio-office-rich-toolbar__menu-check`},eC=[`disabled`],tC={key:1,class:`norio-office-rich-toolbar__menu-check`},nC=[`disabled`],rC=[`disabled`],iC=[`disabled`],aC={key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--quote`},oC={class:`norio-office-rich-color-menu__section`},sC=[`disabled`],cC={class:`norio-office-rich-color-menu__section`},lC={class:`norio-office-rich-color-menu__row`},uC=[`disabled`,`onClick`],dC={class:`norio-office-rich-color-menu__section`},fC={class:`norio-office-rich-color-menu__row`},pC=[`disabled`,`onClick`],mC=[`disabled`],hC=[`disabled`],gC={key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--emoji`},_C={key:2,class:`norio-office-rich-toolbar__group norio-office-rich-toolbar__group--ai-target`},vC=[`disabled`,`title`],yC={class:`norio-office-rich-editor__main`},bC=[`data-placement`,`title`,`aria-label`],xC=[`data-open`,`data-placement`],SC={class:`norio-office-rich-editor__workspace`},CC={class:`norio-office-rich-table-bubble-menu__actions`},wC=[`disabled`],TC=[`disabled`],EC=[`disabled`],DC={key:0,class:`norio-office-rich-table-bubble-menu__menu norio-office-rich-table-bubble-menu__menu--palette`},OC={class:`norio-office-rich-table-bubble-menu__color-grid`},kC=[`onClick`],AC=[`disabled`,`aria-expanded`],jC=[`disabled`],MC=[`disabled`],NC=[`disabled`],PC=[`disabled`],FC=[`disabled`],IC={class:`norio-office-rich-countdown-bubble-menu__toolbar`},LC={key:0,class:`norio-office-rich-countdown-bubble-menu__panel`},RC={class:`norio-office-rich-countdown-settings`},zC={class:`norio-office-rich-countdown-settings__header`},BC={class:`norio-office-rich-countdown-settings__row norio-office-rich-countdown-settings__row--deadline`},VC={class:`norio-office-rich-countdown-settings__radio`},HC=[`disabled`],UC={class:`norio-office-rich-countdown-settings__picker-top`},WC=[`value`],GC=[`value`],KC=[`value`],qC=[`value`],JC={class:`norio-office-rich-countdown-settings__weekdays`},YC={class:`norio-office-rich-countdown-settings__calendar`},XC=[`onClick`],ZC={class:`norio-office-rich-countdown-settings__time-section`},QC={class:`norio-office-rich-countdown-settings__time-panel`},$C=[`min`],ew={class:`norio-office-rich-countdown-settings__row norio-office-rich-countdown-settings__row--duration`},tw={class:`norio-office-rich-countdown-settings__radio`},nw={class:`norio-office-rich-countdown-settings__duration`},rw=[`disabled`],iw=[`disabled`],aw=[`disabled`],ow=[`disabled`],sw={class:`norio-office-rich-countdown-settings__actions`},cw={class:`norio-office-rich-mention-panel__tabs`},lw=[`onClick`],uw={key:0,class:`norio-office-rich-mention-panel__empty`},dw={key:1,class:`norio-office-rich-mention-panel__empty`},fw=[`onClick`,`onDblclick`],pw=[`data-type`],mw=[`src`],hw=[`src`],gw={key:2},_w={class:`norio-office-rich-mention-panel__content`},vw={class:`norio-office-rich-mention-panel__title-row`},yw={class:`norio-office-rich-mention-panel__name`},bw={key:0,class:`norio-office-rich-mention-panel__tag`},xw={key:0,class:`norio-office-rich-mention-panel__meta`},Sw={class:`norio-office-rich-mention-panel__footer`},Cw=[`disabled`],ww=[`data-active`],Tw=[`title`],Ew={key:1},Dw={class:`norio-office-rich-block-side-menu__section`},Ow={class:`norio-office-rich-block-side-menu__quick`},kw=[`onClick`],Aw={key:1},jw={class:`norio-office-rich-block-side-menu__section`},Mw=[`onClick`],Nw={key:0,class:`norio-office-rich-block-side-menu__section norio-office-rich-block-side-menu__section--grid`},Pw=[`title`,`aria-label`,`aria-pressed`,`onClick`],Fw={key:1},Iw=[`aria-expanded`],Lw=[`disabled`],Rw=[`aria-expanded`],zw=[`aria-expanded`],Bw=[`aria-expanded`],Vw=[`aria-expanded`],Hw=[`aria-expanded`],Uw=[`aria-expanded`],Ww=[`aria-expanded`],Gw=[`aria-expanded`],Kw=[`disabled`,`aria-pressed`,`onClick`],qw={key:0,"aria-hidden":`true`},Jw=[`aria-checked`],Yw=[`data-checked`],Xw=[`aria-label`,`title`,`aria-pressed`,`onClick`],Zw={"aria-hidden":`true`},Qw={class:`norio-office-rich-block-side-menu__section`},$w={class:`norio-office-rich-block-side-menu__quick`},eT=[`onClick`],tT={key:1},nT={class:`norio-office-rich-block-side-menu__section`},rT=[`onClick`],iT=[`aria-label`],aT={class:`norio-office-rich-color-menu__section`},oT=[`onClick`],sT=[`onClick`],cT=[`onClick`],lT=[`onClick`],uT={class:`norio-office-rich-comment-panel__header`},dT={key:0,class:`norio-office-rich-comment-panel__empty`},fT={key:1,class:`norio-office-rich-comment-panel__list`},pT=[`onClick`],mT={class:`norio-office-rich-comment-card__anchor`},hT={class:`norio-office-rich-comment-card__actions`},gT=[`disabled`,`onClick`],_T={key:0,class:`norio-office-rich-comment-card__items`},vT=[`src`],yT={key:1},bT={class:`norio-office-rich-comment-item__body`},xT={class:`norio-office-rich-comment-item__meta`},ST=[`value`,`onKeydown`],CT={class:`norio-office-rich-comment-composer__actions`},wT=[`onClick`],TT={class:`norio-office-rich-comment-item__content`},ET={key:0,class:`norio-office-rich-comment-images`},DT=[`onClick`],OT=[`src`,`alt`],kT={class:`norio-office-rich-comment-item__actions`},AT=[`onClick`],jT=[`onClick`],MT=[`onClick`],NT={key:2,class:`norio-office-rich-comment-replies`},PT=[`src`],FT={key:1},IT={class:`norio-office-rich-comment-item__body`},LT={class:`norio-office-rich-comment-item__meta`},RT=[`value`,`onKeydown`],zT={class:`norio-office-rich-comment-composer__actions`},BT=[`onClick`],VT={class:`norio-office-rich-comment-item__content`},HT={key:0,class:`norio-office-rich-comment-images`},UT=[`onClick`],WT=[`src`,`alt`],GT={class:`norio-office-rich-comment-item__actions`},KT=[`onClick`],qT=[`onClick`],JT=[`onClick`],YT={key:0,class:`norio-office-rich-comment-draft-images`},XT=[`src`,`alt`],ZT=[`onClick`],QT=[`placeholder`,`value`,`onInput`,`onKeydown`],$T={class:`norio-office-rich-comment-composer__actions`},eE=[`onClick`],tE=[`onClick`],nE=[`disabled`,`onClick`],rE={key:1,class:`norio-office-rich-comment-card__empty`},iE={key:0,class:`norio-office-rich-comment-draft-images`},aE=[`src`,`alt`],oE=[`onClick`],sE=[`placeholder`,`value`,`onInput`,`onKeydown`],cE={class:`norio-office-rich-comment-composer__actions`},lE=[`onClick`],uE=[`onClick`],dE=[`disabled`,`onClick`],fE={class:`norio-office-rich-mention-panel__tabs`},pE=[`onClick`],mE={key:0,class:`norio-office-rich-mention-panel__empty`},hE={key:1,class:`norio-office-rich-mention-panel__empty`},gE=[`onClick`,`onDblclick`],_E=[`data-type`],vE=[`src`],yE=[`src`],bE={key:2},xE={class:`norio-office-rich-mention-panel__content`},SE={class:`norio-office-rich-mention-panel__title-row`},CE={class:`norio-office-rich-mention-panel__name`},wE={key:0,class:`norio-office-rich-mention-panel__tag`},TE={key:0,class:`norio-office-rich-mention-panel__meta`},EE={class:`norio-office-rich-mention-panel__footer`},DE=[`disabled`],OE=[`innerHTML`],kE={class:`norio-office-rich-comment-image-viewer__stage`},AE=[`src`,`alt`],jE={key:0,class:`norio-office-rich-comment-image-viewer__meta`},ME={key:0,class:`norio-office-rich-comment-image-viewer__name`},NE={key:1,class:`norio-office-rich-comment-image-viewer__desc`},PE={key:4,class:`norio-office-rich-upload-panel`,"aria-live":`polite`},FE={key:0,class:`norio-office-rich-upload-spinner`,"aria-hidden":`true`},IE={key:1,class:`norio-office-rich-upload-panel__error-dot`,"aria-hidden":`true`},LE={class:`norio-office-rich-upload-panel__content`},RE={class:`norio-office-rich-upload-panel__title`},zE={class:`norio-office-rich-upload-panel__meta`},BE=[`onClick`],VE=[`onClick`],HE={class:`norio-office-rich-editor__statusbar`},UE={class:`norio-office-rich-statusbar__side norio-office-rich-statusbar__side--counts`},WE={class:`norio-office-rich-statusbar__item norio-office-rich-statusbar__word-count`},GE={class:`norio-office-rich-statusbar__item norio-office-rich-statusbar__line-count`},KE={class:`norio-office-rich-statusbar__side norio-office-rich-statusbar__side--right`},qE={class:`norio-office-rich-statusbar__group norio-office-rich-statusbar__group--zoom`},JE=[`disabled`],YE={class:`norio-office-rich-statusbar__zoom`},XE=[`disabled`],ZE=[`role`,`aria-label`],QE={key:0,class:`norio-office-rich-slash-menu__section`},$E={class:`norio-office-rich-slash-menu__quick-grid`},eD=[`aria-label`,`aria-selected`,`onMouseenter`,`onClick`],tD={key:1},nD={key:1,class:`norio-office-rich-slash-menu__section`},rD=[`aria-selected`,`onMouseenter`,`onClick`],iD={class:`norio-office-rich-slash-menu__label`},aD={key:2,class:`norio-office-rich-slash-menu__section`},oD=[`aria-selected`,`onMouseenter`,`onClick`],sD={class:`norio-office-rich-slash-menu__label`},cD={key:3,class:`norio-office-rich-slash-menu__empty`},lD=1060,uD=1120,dD=360,fD=420,pD=8,mD=4,hD=`application/x-office-word-blocks+json`,gD=10,_D=4,vD=`#f3c389`,yD=`#fff8ef`,bD=246,xD=8,SD=510,CD=10,wD=26,TD=26,ED=48,DD=560,OD=220,kD=(0,t.defineComponent)({__name:`RichTextEditor`,props:{modelValue:{default:null},documentName:{default:``},showFileHeader:{type:Boolean,default:!0},collaborationPresence:{},mode:{default:`edit`},assetPackaging:{default:null},showToolbar:{type:Boolean,default:!0},showAiTargetButton:{type:Boolean,default:!1},watermark:{default:null},showOutline:{type:Boolean,default:!0},outlinePlacement:{default:`right`},messages:{default:null},featureCodes:{default:null},enabledFeatureItems:{default:null},enabledExportItems:{},enabledInsertMenuItems:{},enabledToolbarActions:{},placeholder:{default:``},mention:{type:Boolean,default:!1},collaboration:{},comments:{default:null},commentUser:{default:null},showComments:{type:Boolean,default:!1},commentMention:{type:Boolean,default:!0},uploadImage:{type:[Function,null],default:null},uploadVideo:{type:[Function,null],default:null},uploadFile:{type:[Function,null],default:null},uploadCommentImage:{type:[Function,null],default:null},onUploadError:{type:[Function,null],default:null},commentMentionProvider:{type:[Function,null],default:null},onCommentMentionSearch:{type:[Function,null],default:null},mentionProvider:{},onMentionSearch:{}},emits:[`update:modelValue`,`update:documentName`,`file-name-change`,`change`,`local-file-upload`,`local-file-click`,`local-file-download`,`upload-error`,`mention-item-click`,`mention-submit`,`outline-change`,`comment-create`,`comment-reply`,`comment-update`,`comment-delete`,`comment-resolve`,`comment-select`,`comment-submit`,`comment-mention-search`,`comment-mention-item-click`,`comment-mention-submit`],setup(e,{expose:c,emit:l}){let u=e,d=l,f=(0,t.toRef)(u,`uploadImage`),{fileName:p,editing:m,draft:h,error:g,input:_,start:v,commit:y,cancel:b,keydown:x,setFileName:S}=a_(u,e=>d(`file-name-change`,e),e=>d(`update:documentName`,e)),C=(0,t.toRef)(u,`uploadVideo`),w=(0,t.toRef)(u,`uploadFile`),T=(0,t.toRef)(u,`uploadCommentImage`),E=(0,t.toRef)(u,`onUploadError`),D=new Map,O=new Set;function ee(e,t){for(let e of O)URL.revokeObjectURL(e);O.clear();for(let e of t)O.add(e);D.clear();for(let[t,n]of e)D.set(t,n)}async function k(e,t){if(!W.value)throw Error(`EDITOR_NOT_READY: Editor is not ready.`);let n=await Jb(e instanceof Blob?await e.arrayBuffer():e),r=structuredClone(n.document),i=new Set,a=new Map,o=new Map;if(t?.resourceResolver?.resolveReference){for(let[e,r]of n.resources)if(r.resource.storage===`external`)try{let n=await t.resourceResolver.resolveReference({id:e,kind:r.resource.kind,source:r.resource.source,mimeType:r.resource.mimeType,name:r.resource.name});n&&o.set(e,n)}catch{}}function s(e){if(typeof e!=`string`)return e;if(!e.startsWith(`nordox:asset/`)){let t=[...n.resources].find(([,t])=>t.resource.storage===`external`&&t.resource.source===e);return t?o.get(t[0])??e:e}let t=e.slice(13),r=n.resources.get(t);if(!r?.bytes)return e;let s=a.get(t);return s||(s=URL.createObjectURL(new Blob([new Uint8Array(r.bytes)],{type:r.resource.mimeType||`application/octet-stream`})),a.set(t,s),i.add(s)),s}function c(e){e.type===`imageBlock`&&Array.isArray(e.attrs?.images)?e.attrs.images=e.attrs.images.map(e=>({...e,src:s(e.src)})):e.type===`videoBlock`&&e.attrs?e.attrs.src=s(e.attrs.src):e.type===`localFileBlock`&&e.attrs&&(e.attrs.url=s(e.attrs.url)),e.content?.forEach(c)}try{c(r),ie(`document-changed`),W.value.commands.setContent(r);for(let[e,t]of a){let r=n.resources.get(e);r&&(r.displayUrl=t)}return ee(n.resources,i),n}catch(e){for(let e of i)URL.revokeObjectURL(e);throw e}}async function te(e={}){if(!W.value)throw Error(`EDITOR_NOT_READY: Editor is not ready.`);let t=await qb(W.value.getJSON(),{...e,title:p.value,existingResources:D,assetPackaging:{...u.assetPackaging,...e.assetPackaging}});return new Blob([new Uint8Array(t)],{type:`application/vnd.norio.nordox+zip`})}let ne=(0,t.ref)(null),re=(0,t.ref)(null),A=(0,t.ref)({active:!1,busy:!1,available:!1,reason:`AI Bridge 尚未连接`});function ie(e){re.value?.clear(e)}function ae(){re.value?.select()}function oe(e){e.target?.closest?.(`.norio-office-rich-ai-target-badge`)||A.value.active&&ie(`content-click`)}let j=(0,t.ref)(null),ce=(0,t.ref)(null),le=(0,t.ref)(null),ue=(0,t.ref)(null),de=(0,t.ref)(null),fe=(0,t.ref)(null),pe=(0,t.ref)(null),me=(0,t.ref)(null),he=(0,t.ref)(null),ge=(0,t.ref)(null),_e=(0,t.ref)(null),ve=(0,t.ref)(null),ye=(0,t.ref)(null),be=(0,t.ref)(null),xe=(0,t.ref)(0),Se=(0,t.ref)(null),Ce=(0,t.ref)(null),we=(0,t.ref)(null),Te=(0,t.ref)(null),Ee=(0,t.ref)(null),De=(0,t.ref)(null),Oe=(0,t.ref)(null),ke=(0,t.ref)(null),Ae=(0,t.ref)(null),je=(0,t.ref)(null),Me=(0,t.ref)(null),Ne=(0,t.ref)(null),Pe=(0,t.ref)(null),Fe=(0,t.ref)(null),Ie=(0,t.ref)(null),Le=(0,t.ref)(null),Re=(0,t.ref)(null),ze=(0,t.ref)(null),Be=(0,t.ref)(null),Ve=(0,t.ref)(null),He=(0,t.ref)(null),Ue=(0,t.ref)(null),We=(0,t.ref)(null),Ge=(0,t.ref)(null),Ke=(0,t.ref)(null),qe=(0,t.ref)(!1),Je=(0,t.ref)(!1),Ye=(0,t.ref)(!1),Xe=(0,t.ref)(null),Ze=`norio-office-rich-outline-${(0,t.useId)()}`,Qe=(0,t.ref)(typeof window>`u`?780:window.innerWidth),$e=(0,t.ref)(typeof window>`u`?900:window.innerHeight),et=(0,t.ref)(!1),tt=(0,t.ref)(null),nt=(0,t.ref)(null),rt=(0,t.ref)(!1),it=(0,t.ref)(null),at=(0,t.ref)(0),ot=(0,t.ref)({left:8,top:8,maxHeight:320}),st=(0,t.ref)(!1),ct=(0,t.ref)(!1),lt=(0,t.ref)(!1),ut=(0,t.ref)(360),dt=(0,t.ref)(0),ft=(0,t.ref)(!1),pt=(0,t.ref)(!1),mt=(0,t.ref)(!1),ht=(0,t.ref)(!1),gt=(0,t.ref)(!1),_t=(0,t.ref)(!1),vt=(0,t.ref)(!1),yt=(0,t.ref)(!1),bt=(0,t.ref)(!1),xt=(0,t.ref)(!1),St=(0,t.ref)(``),Ct=(0,t.ref)(`all`),wt=(0,t.ref)([]),Tt=(0,t.ref)(0),Et=(0,t.ref)(null),Dt=(0,t.ref)({left:0,top:0}),Ot=(0,t.ref)(null),kt=(0,t.ref)([]),At=(0,t.ref)(null),jt=(0,t.ref)({}),Mt=(0,t.ref)({}),Nt=(0,t.ref)({}),Pt=(0,t.ref)(null),Ft=(0,t.ref)(``),It=(0,t.ref)([]),Lt=(0,t.ref)(null),Rt=(0,t.ref)(null),zt=(0,t.ref)(null),Bt=(0,t.ref)({}),Vt=new Map,Ht=(0,t.ref)(!1),Ut=(0,t.ref)(!1),Wt=(0,t.ref)(``),Gt=(0,t.ref)(`all`),Kt=(0,t.ref)([]),qt=(0,t.ref)(0),Jt=(0,t.ref)({left:0,top:0}),Yt=(0,t.ref)(null),Xt=(0,t.ref)(0),Zt=(0,t.ref)(100),Qt=[{key:`paragraph`,label:`正文`},{key:`h1`,label:`标题一`,level:1},{key:`h2`,label:`标题二`,level:2},{key:`h3`,label:`标题三`,level:3},{key:`h4`,label:`标题四`,level:4},{key:`h5`,label:`标题五`,level:5},{key:`h6`,label:`标题六`,level:6}],$t=[`highlight-border`,`highlight-fill`,`quote-border`,`quote-background`],en=[`properties`,`color`,`add-above`,`add-below`,...$t],tn=[{key:`all`,label:`全部`},{key:1,label:`人`},{key:2,label:`文档`}],nn=(0,t.ref)(null),rn=(0,t.ref)(!1),on=(0,t.ref)(``),cn=(0,t.ref)(0),ln=(0,t.ref)(0),un=(0,t.ref)(0),dn=(0,t.ref)(`deadline`),fn=(0,t.ref)(``),pn=(0,t.ref)(`0`),mn=(0,t.ref)(`0`),hn=(0,t.ref)(`1`),gn=(0,t.ref)(`0`),_n=(0,t.ref)(!1),vn=(0,t.ref)(!1),yn=(0,t.ref)(`bottom`),bn=(0,t.ref)(new Date().getFullYear()),xn=(0,t.ref)(new Date().getMonth()),Sn=(0,t.ref)(`00:00`),wn=[`一`,`二`,`三`,`四`,`五`,`六`,`日`],Tn=(0,t.computed)(()=>cn.value>0&&ln.value>0?`${cn.value} x ${ln.value}`:`插入表格`);(0,t.computed)(()=>`选择${un.value}栏`);let En=(0,t.computed)(()=>un.value>0?`选择${un.value}栏`:`选择栏数`);function Dn(e){if(xe.value,!de.value||!e)return;let t=de.value.getBoundingClientRect(),n=e.getBoundingClientRect();return{top:`${n.top-t.top+n.height/2}px`}}let On=(0,t.computed)(()=>Dn(ye.value)),kn=(0,t.computed)(()=>Dn(be.value)),An=(0,t.computed)(()=>{let e=fn.value,t=e?new Date(e):null;return t&&Number.isFinite(t.getTime())?t:null}),jn=(0,t.computed)(()=>{let e=An.value;return e?`${e.getFullYear()}/${String(e.getMonth()+1).padStart(2,`0`)}/${String(e.getDate()).padStart(2,`0`)} ${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`:`请选择时间`}),Mn=(0,t.computed)(()=>new Date(qs())),Nn=(0,t.computed)(()=>{let e=An.value,t=Mn.value;return!e||e.getFullYear()!==t.getFullYear()||e.getMonth()!==t.getMonth()||e.getDate()!==t.getDate()?`00:00`:`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}),Pn=(0,t.computed)(()=>Array.from({length:200},(e,t)=>1900+t)),Fn=(0,t.computed)(()=>Array.from({length:12},(e,t)=>t)),In=(0,t.computed)(()=>{let e=bn.value,t=xn.value,n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t+1,0).getDate(),i=new Date(e,t,0).getDate(),a=An.value,o=new Date,s=Mn.value,c=[];for(let l=0;l<42;l+=1){let u=e,d=t,f=0,p=!0;l<n?(d=t-1,d<0&&(d=11,--u),f=i-n+l+1,p=!1):l>=n+r?(d=t+1,d>11&&(d=0,u+=1),f=l-n-r+1,p=!1):f=l-n+1;let m=o.getFullYear()===u&&o.getMonth()===d&&o.getDate()===f,h=new Date(u,d,f,23,59,59,999).getTime()<s.getTime(),g=!!a&&a.getFullYear()===u&&a.getMonth()===d&&a.getDate()===f;c.push({key:`${u}-${d}-${f}`,year:u,month:d,day:f,label:f,isCurrentMonth:p,isToday:m,isSelected:g,isDisabled:h})}return c}),Ln=(0,t.ref)(null),zn=(0,t.ref)(null),Bn=(0,t.ref)(null),Vn=(0,t.ref)(null),Hn=(0,t.ref)(null),Un=(0,t.ref)([]),Gn=(0,t.ref)([]),Kn=(0,t.ref)([]),qn=(0,t.ref)([]),Jn=(0,t.ref)(null),Yn=(0,t.ref)(null),Xn=[{label:`初号`,value:`42px`},{label:`小初`,value:`36px`},{label:`一号`,value:`28px`},{label:`小一`,value:`26px`},{label:`二号`,value:`24px`},{label:`小二`,value:`22px`},{label:`三号`,value:`21px`},{label:`小三`,value:`20px`},{label:`四号`,value:`18px`},{label:`小四`,value:`16px`},{label:`五号`,value:`14px`},{label:`小五`,value:`12px`}],Zn=[{label:`默认`,value:``},{label:`微软雅黑`,value:`"Microsoft YaHei", "PingFang SC", sans-serif`},{label:`宋体`,value:`"SimSun", serif`},{label:`黑体`,value:`"SimHei", sans-serif`},{label:`楷体`,value:`"KaiTi", serif`},{label:`仿宋`,value:`"FangSong", serif`},{label:`Arial`,value:`Arial, sans-serif`},{label:`Georgia`,value:`Georgia, serif`},{label:`Monospace`,value:`"Consolas", "SFMono-Regular", monospace`}],Qn=[{key:`paragraph`,label:`T`,type:`text`,action:`paragraph`},{key:`h1`,label:`H1`,type:`text`,action:`heading-1`},{key:`h2`,label:`H2`,type:`text`,action:`heading-2`},{key:`h3`,label:`H3`,type:`text`,action:`heading-3`},{key:`h4`,label:`H4`,type:`text`,action:`heading-4`},{key:`h5`,label:`H5`,type:`text`,action:`heading-5`},{key:`h6`,label:`H6`,type:`text`,action:`heading-6`},{key:`bullet`,label:`无序列表`,type:`icon`,iconName:`wuxuliebiao`,action:`bullet-list`},{key:`ordered`,label:`有序列表`,type:`icon`,iconName:`youxuliebiao`,action:`ordered-list`},{key:`task`,label:`待办`,type:`icon`,iconName:`To-do`,action:`task-list`}],$n=[{key:`image`,label:`图片`,colorIconName:`tupian`,action:`image`},{key:`video`,label:`视频`,colorIconName:`shipin`,action:`video`},{key:`table`,label:`表格`,colorIconName:`biaoge`,action:`table`,comingSoon:!0},{key:`local-file`,label:`本地文件`,colorIconName:`file`,action:`local-file`},{key:`columns`,label:`分栏`,colorIconName:`fenlan`,action:`columns`},{key:`highlight-block`,label:`高亮块`,colorIconName:`gaoliangkuai1`,action:`highlight-block`},{key:`code-block`,label:`代码块`,colorIconName:`daimakuai`,action:`code-block`},{key:`formula`,label:`公式`,colorIconName:`jisuangongshi`,action:`formula`},{key:`blockquote`,label:`引用`,colorIconName:`yinyong`,action:`blockquote`},{key:`emoji`,label:`表情符号`,action:`emoji`},{key:`link`,label:`超链接`,colorIconName:`wangye`,action:`link`},{key:`divider`,label:`分隔线`,colorIconName:`fengexian`,action:`divider`}],er=[{key:`countdown`,label:`倒计时`,colorIconName:`daojishi`,action:`countdown`}],tr=[{key:`markdown-import`,label:`Markdown导入`,colorIconName:`markdown`,action:`markdown-import`}],nr=[...$n.filter(e=>![`local-file`,`markdown-import`].includes(e.action)),...er],ir=Qn,ar=[{key:`align-left`,label:`左对齐`,iconName:`zuoduiqi`,action:`align-left`},{key:`align-center`,label:`居中对齐`,iconName:`juzhongduiqi`,action:`align-center`},{key:`align-right`,label:`右对齐`,iconName:`youduiqi`,action:`align-right`},{key:`indent-more`,label:`增加缩进`,iconName:`yousuojin`,action:`indent-more`},{key:`indent-less`,label:`减少缩进`,iconName:`zuosuojin`,action:`indent-less`}],or=new Set([`paragraph`,`heading`,`bulletList`,`orderedList`,`taskList`]),sr=new Set([`paragraph`,`heading`,`bulletList`,`orderedList`]),cr=new Set([`paragraph`,`heading`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`highlightBlock`]),lr=(0,t.computed)(()=>u.featureCodes??u.enabledFeatureItems),ur=(0,t.computed)(()=>u.featureCodes??u.enabledInsertMenuItems),dr=(0,t.computed)(()=>u.featureCodes??u.enabledToolbarActions);function fr(e){return d_(e,lr.value)}let pr=(0,t.computed)(()=>m_(u.messages));function mr(e){return pr.value[e]??p_[e]??e}function N(e){switch(e){case`image`:return mr(`insert.image`);case`video`:return mr(`insert.video`);case`table`:return mr(`insert.table`);case`local-file`:return mr(`insert.localFile`);case`columns`:return mr(`insert.columns`);case`highlight-block`:return mr(`insert.highlightBlock`);case`date`:return mr(`insert.date`);case`code-block`:return mr(`insert.codeBlock`);case`formula`:return mr(`insert.formula`);case`blockquote`:return mr(`insert.blockquote`);case`emoji`:return mr(`insert.emoji`);case`link`:return mr(`insert.link`);case`divider`:return mr(`insert.divider`);case`countdown`:return mr(`insert.countdown`);case`markdown-import`:return mr(`insert.markdownImport`);default:return e}}let gr=[`#C084FC`,`#F472B6`,`#FB7185`,`#F97316`,`#F59E0B`,`#10B981`,`#14B8A6`,`#3B82F6`,`#6366F1`,`#64748B`],_r=[`#FCF5FF`,`#FDF2F8`,`#FFF1F2`,`#FFF7ED`,`#FFFBEB`,`#ECFDF5`,`#F0FDFA`,`#EFF6FF`,`#EEF2FF`,`#F8FAFC`],vr=[...gr,`#06B6D4`,`#84CC16`,`#EAB308`,`#94A3B8`,`#334155`],yr=[..._r,`#ECFEFF`,`#F7FEE7`,`#FEFCE8`,`#F1F5F9`,`#E2E8F0`],br=(0,t.ref)([`#38A169`,`#1DA1F2`]),xr=(0,t.ref)([`#FFF3C4`,`#D8F4E5`]),Sr=(0,t.ref)([]),Cr=(0,t.ref)(null),wr=new Set,Tr=``,Er=(0,t.ref)(0),Dr=(0,t.ref)(0),Or=(0,t.ref)(null),kr=(0,t.ref)(null),Ar=(0,t.ref)(!1),jr=(0,t.ref)([]),Mr=(0,t.ref)(null),Nr=(0,t.ref)(null),Pr=(0,t.ref)(null),Fr=(0,t.ref)(!1),Ir=(0,t.ref)(!1),Lr=(0,t.ref)(!1),Rr=(0,t.ref)(!1),zr=(0,t.ref)(!1),Br=(0,t.ref)(!1),Vr=null,Hr=(0,t.ref)(null),Ur=(0,t.ref)(null),P=(0,t.ref)(null),Wr=(0,t.ref)(null),Gr=(0,t.ref)(null),Kr=(0,t.ref)(null);(0,t.watch)(P,()=>{Kr.value=null});let qr=(0,t.ref)(null),Jr=null,Yr=(0,t.ref)(null),Xr=(0,t.ref)(null),Zr=[null,`#F3F4F6`,`#FDE2E2`,`#FCEFD8`,`#FEF3C7`,`#D9F99D`,`#DCFCE7`,`#DBEAFE`,`#E9D5FF`,`#E5E7EB`,`#D1D5DB`,`#F8B4B4`,`#FCD9BD`,`#FDE68A`,`#BEF264`,`#86EFAC`,`#A5B4FC`,`#C4B5FD`],Qr=(0,t.computed)(()=>u.modelValue?u.modelValue:u.collaboration&&fr(`collaboration`)?{type:`doc`,content:[{type:`paragraph`}]}:{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:`分隔符苟富贵下饭`}]}]}),$r=(0,t.computed)(()=>Je.value||u.mode===`preview`),ei=(0,t.computed)(()=>!$r.value),ti=(0,t.computed)(()=>u.showToolbar&&!$r.value);(0,t.watch)($r,e=>{e&&b()},{flush:`sync`});let ni=(0,t.computed)(()=>fr(`comments`)),ri=(0,t.computed)(()=>u.showOutline?f_(u.outlinePlacement,lr.value):null),ii=(0,t.computed)(()=>ri.value??u.outlinePlacement),ai=(0,t.computed)(()=>!!ri.value),oi=(0,t.computed)(()=>fr(`watermark`)),si=(0,t.computed)(()=>fr(`collaboration`)),ci=(0,t.computed)(()=>si.value?u.collaboration:null),li=(0,t.computed)(()=>u.mention&&fr(`mention`)),ui=(0,t.computed)(()=>u.commentMention!==!1&&fr(`mention`)),di=(0,t.computed)(()=>(ni.value?u.comments??[]:[]).filter(e=>!!e&&typeof e.id==`string`&&!!e.id.trim()).map(e=>({...e,comments:Array.isArray(e.comments)?e.comments:[]}))),fi=(0,t.computed)(()=>di.value.filter(e=>e.status!==`resolved`)),pi=(0,t.computed)(()=>{if(u.commentUser?.id&&u.commentUser.name)return u.commentUser;let e=ci.value?.user;if(!e)return null;let t=e,n=String(t.id??t.userId??t.clientUniqueCode??e.name??``).trim(),r=String(t.name??t.userName??t.displayName??n).trim();return!n||!r?null:{...t,id:n,name:r,color:typeof t.color==`string`&&t.color?t.color:`#4c7dff`}}),mi=(0,t.computed)(()=>{let e=[...fi.value],t=Rt.value;return t&&!e.some(e=>e.id===t.id)&&e.unshift({id:t.id,anchorText:t.anchorText,status:`open`,comments:[]}),e}),F=(0,t.computed)(()=>ni.value&&u.showComments),hi=(0,t.computed)(()=>`评论 (${fi.value.length})`),gi=(0,t.computed)(()=>{if(At.value){let e=mi.value.find(e=>e.id===At.value);if(e)return e}return mi.value[0]??null}),_i=(0,t.computed)(()=>$n.filter(e=>u_(e.key,ur.value)).map(e=>({...e,label:N(e.key)}))),vi=(0,t.computed)(()=>er.filter(e=>u_(e.key,ur.value)).map(e=>({...e,label:N(e.key)}))),yi=(0,t.computed)(()=>tr.filter(e=>u_(e.key,ur.value)).map(e=>({...e,label:N(e.key)}))),bi=(0,t.computed)(()=>[...Qn.map(e=>({key:e.key,label:e.key===`paragraph`?`正文`:e.label,action:e.action,iconName:e.iconName??``,isColorIcon:!1,group:`basic`})),..._i.value.filter(e=>e.action!==`local-file`).map(e=>({key:e.key,label:e.label,action:e.action,iconName:e.colorIconName??e.monoIconName??(e.key===`emoji`?`smile`:``),isColorIcon:!!e.colorIconName,group:`common`})),...vi.value.map(e=>({key:e.key,label:e.label,action:e.action,iconName:e.colorIconName??e.monoIconName??``,isColorIcon:!!e.colorIconName,group:`common`})),..._i.value.filter(e=>e.action===`local-file`).map(e=>({key:e.key,label:e.label,action:e.action,iconName:e.colorIconName??e.monoIconName??``,isColorIcon:!!e.colorIconName,group:`more`})),...yi.value.map(e=>({key:e.key,label:e.label,action:e.action,iconName:e.colorIconName??e.monoIconName??``,isColorIcon:!!e.colorIconName,group:`more`}))]),xi=(0,t.computed)(()=>{let e=(tt.value??``).toLocaleLowerCase();return bi.value.filter(t=>e?`${t.label} ${t.key} ${t.action}`.toLocaleLowerCase().includes(e):t.group!==`more`).map((e,t)=>({...e,index:t}))}),Si=(0,t.computed)(()=>xi.value.filter(e=>e.group===`basic`)),Ci=(0,t.computed)(()=>xi.value.filter(e=>e.group===`common`)),wi=(0,t.computed)(()=>xi.value.filter(e=>e.group===`more`)),Ti=(0,t.computed)(()=>ei.value&&nt.value!==null&&tt.value!==null),Ei=(0,t.computed)(()=>Ti.value||rt.value),Di=(0,t.computed)(()=>({left:`${ot.value.left}px`,top:`${ot.value.top}px`,maxHeight:`${ot.value.maxHeight}px`})),Oi=(0,t.computed)(()=>_i.value.length>0||vi.value.length>0||yi.value.length>0),ki=(0,t.computed)(()=>u_(`emoji`,ur.value)),Ai=(0,t.computed)(()=>u_(`blockquote`,dr.value));(0,t.computed)(()=>mr(`countdown.settingsTitle`)),(0,t.computed)(()=>mr(`formula.insertTitle`));let ji=(0,t.computed)(()=>mr(`insert.label`)),Mi=(0,t.computed)(()=>mr(`insert.section.general`)),Ni=(0,t.computed)(()=>mr(`insert.section.apps`)),Pi=(0,t.computed)(()=>mr(`insert.section.external`)),Fi=(0,t.computed)(()=>W.value?.isActive(`blockquote`)?mr(`quote.cancel`):mr(`quote.apply`)),Ii=(0,t.computed)(()=>mr(`quote.borderColor`)),Li=(0,t.computed)(()=>mr(`quote.backgroundColor`)),Ri=(0,t.computed)(()=>mr(`outline.label`)),zi=(0,t.computed)(()=>mr(`outline.collapse`)),I=(0,t.computed)(()=>mr(`outline.empty.description`)),L=(0,t.computed)(()=>mr(`outline.empty.tip`)),R=(0,t.computed)(()=>`字数: ${ho.value}`),z=(0,t.computed)(()=>`行数: ${go.value}`),B=(0,t.computed)(()=>Je.value?mr(`status.presentation.exit`):mr(`status.presentation.enter`)),Bi=(0,t.computed)(()=>qe.value?mr(`status.fullscreen.exit`):mr(`status.fullscreen.enter`)),V=(0,t.computed)(()=>{if(!$r.value)return 1;let e=Math.max(320,Qe.value-32);return Math.min(1,e/lD)}),Vi=(0,t.computed)(()=>({left:`${Er.value}px`,top:`${Dr.value}px`})),Hi=(0,t.computed)(()=>{if(!j.value||!Or.value||!kr.value)return null;let e=j.value.getBoundingClientRect(),t=za.value||1,n=(Math.min(Or.value.x,kr.value.x)-e.left)/t,r=(Math.min(Or.value.y,kr.value.y)-e.top)/t,i=(Math.max(Or.value.x,kr.value.x)-e.left)/t,a=(Math.max(Or.value.y,kr.value.y)-e.top)/t,o=Math.max(0,Math.min(lD,n)),s=Math.max(0,Math.min(Math.max(j.value.scrollHeight,uD),r)),c=Math.max(0,Math.min(lD,i)),l=Math.max(0,Math.min(Math.max(j.value.scrollHeight,uD),a));return{left:Math.min(o,c),top:Math.min(s,l),width:Math.max(0,Math.abs(c-o)),height:Math.max(0,Math.abs(l-s))}}),Ui=(0,t.computed)(()=>{if(!W.value||!j.value||!jr.value.length)return[];let e=new Set(jr.value),t=j.value.getBoundingClientRect(),n=za.value||1,r=[];return W.value.state.doc.forEach((i,a)=>{if(!e.has(a))return;let o=W.value?.view.nodeDOM(a);if(!(o instanceof HTMLElement))return;let s=o.getBoundingClientRect();r.push({pos:a,from:a,to:a+i.nodeSize,node:i,dom:o,rect:{left:(s.left-t.left)/n,top:(s.top-t.top)/n,width:s.width/n,height:s.height/n}})}),r.sort((e,t)=>e.pos-t.pos)}),Wi=(0,t.computed)(()=>Ui.value.length>0),Gi=(0,t.computed)(()=>Ct.value===`all`?wt.value:wt.value.filter(e=>e.type===Ct.value)),Ki=(0,t.computed)(()=>Gi.value[Tt.value]??null),H=(0,t.computed)(()=>({left:`${Dt.value.left}px`,top:`${Dt.value.top}px`})),qi=(0,t.computed)(()=>Gt.value===`all`?Kt.value:Kt.value.filter(e=>e.type===Gt.value)),U=(0,t.computed)(()=>qi.value[qt.value]??null),Ji=(0,t.computed)(()=>({left:`${Jt.value.left}px`,top:`${Jt.value.top}px`})),W=r_({content:Qr.value,editable:ei.value,placeholder:u.placeholder,collaboration:ci.value,uploadImage:f,uploadVideo:C,onUploadError:Ss,mention:li,onLocalFileClick:e=>{d(`local-file-click`,e)},onLocalFileDownload:e=>{d(`local-file-download`,e)},onMentionClick:e=>{li.value&&d(`mention-item-click`,e)},onMentionTrigger:()=>{li.value&&ia()},onMentionKeyDown:e=>fa(e),onUpdate:e=>{d(`update:modelValue`,e),d(`change`,e)}}),Yi=0;function Xi(e){let t=String(e?.id??``).trim(),n=String(e?.name??``).trim(),r=Number(e?.type??1)===2?2:1;return!t||!n?null:{...e,id:t,name:n,type:r,avatar:e.avatar?String(e.avatar):void 0,icon:e.icon?String(e.icon):void 0,tag:e.tag?String(e.tag):void 0,updatedAt:e.updatedAt?String(e.updatedAt):void 0}}function Zi(e){return{...e,type:Number(e.type)===2?2:1}}function Qi(e){return e.type===1?Kf(e.name):`文`}function $i(e){return e.type===1?Jf(e.id):void 0}function ea(){if(!W.value)return null;let{selection:e,doc:t}=W.value.state;if(!e.empty)return null;let n=e.$from;if(!n.parent.isTextblock)return null;let r=n.start(),i=t.textBetween(r,n.pos,`
8101
8123
  `,`
8102
- `),a=i.lastIndexOf(`@`);if(a<0)return null;let o=i.slice(a+1);return/[\s@]/.test(o)?null:{from:r+a,to:n.pos,query:o}}function ta(){if(!W.value||!Et.value||!j.value)return;let e=W.value.view.coordsAtPos(Et.value.from),t=j.value.getBoundingClientRect(),n=za.value||1,r=Ke.value?.offsetWidth||dD,i=Ke.value?.offsetHeight||fD,a=r*n,o=i*n,s=window.innerWidth||Qe.value,c=window.innerHeight||$e.value,l=Math.max(pD,s-a-pD),u=Math.max(pD,c-o-pD),d=e.bottom+mD,f=e.top-o-mD,p=d+o>c-pD&&f>=pD,m=Math.max(pD,Math.min(l,e.left)),h=Math.max(pD,Math.min(u,p?f:d));Dt.value={left:Math.max(pD,Math.min(lD-r-pD,(m-t.left)/n)),top:Math.max(pD,(h-t.top)/n)}}async function na(e){if(!li.value)return;let t=++Yi;xt.value=!0;try{let n=u.onMentionSearch??u.mentionProvider,r=n?await n(e):[];if(t!==Yi)return;wt.value=(Array.isArray(r)?r:[]).map(Xi).filter(e=>!!e),Tt.value=0}catch{t===Yi&&(wt.value=[],Tt.value=0)}finally{t===Yi&&(xt.value=!1)}}function ra(){bt.value=!1,Et.value=null,St.value=``,wt.value=[],Tt.value=0,Yi+=1,xt.value=!1}function ia(){if(!li.value||!W.value||!ei.value)return;let e=ea();e?(Et.value={from:e.from,to:e.to},St.value=e.query,Ct.value=`all`,bt.value=!0,ta(),(0,t.nextTick)(ta),na({query:e.query,type:Ct.value})):ra()}function aa(){if(!li.value){(bt.value||Et.value||wt.value.length||xt.value)&&ra();return}if(!bt.value)return;let e=ea();e?(Et.value={from:e.from,to:e.to},ta(),(0,t.nextTick)(ta),e.query!==St.value&&(St.value=e.query,na({query:e.query,type:Ct.value}))):ra()}function oa(e){li.value&&(Ct.value=e,Tt.value=0,na({query:St.value,type:e}))}function sa(e,t){li.value&&(Tt.value=t,d(`mention-item-click`,Zi(e)))}function ca(e){let t=Gi.value.length;t&&(Tt.value=(Tt.value+e+t)%t)}function la(e){if(!li.value||!W.value||!Et.value)return!1;let t=Zi(e),n=W.value.chain().focus().deleteRange(Et.value).insertContent([{type:`mention`,attrs:t},{type:`text`,text:` `}]).run();return n&&(d(`mention-submit`,t),ra()),n}function ua(e){let t=Xi(e);return!li.value||!t||!W.value?!1:W.value.chain().focus().insertContent([{type:`mention`,attrs:Zi(t)},{type:`text`,text:` `}]).run()}function da(){li.value&&Ki.value&&la(Ki.value)}function fa(e){return!li.value||!bt.value?!1:e.key===`Escape`?(ra(),!0):e.key===`ArrowDown`?(ca(1),!0):e.key===`ArrowUp`?(ca(-1),!0):e.key===`Enter`&&Ki.value?(da(),!0):!1}let pa=0;function ma(e){return Xi(e)}function ha(e){return Zi(e)}function ga(e){return`@${e.name}`}function _a(e){return`${e.type}:${e.id}`}function va(e,t){let n=ha(t),r=_a(n);return[...e.filter(e=>_a(e)!==r),n]}function ya(e,t){return t.filter(t=>e.includes(ga(t)))}function ba(e,t){return Nt.value[ad(e,t)]??[]}function xa(e,t,n){let r=ad(e,n);Nt.value={...Nt.value,[r]:t}}function Sa(e){let t=e.selectionStart??0;if(t!==(e.selectionEnd??t))return null;let n=e.value.slice(0,t),r=n.lastIndexOf(`@`);if(r<0)return null;let i=n.slice(r+1);return/[\s@]/.test(i)?null:{from:r,to:t,query:i}}function Ca(){let e=Yt.value;if(!e)return;let t=e.textarea.getBoundingClientRect(),n=le.value?.offsetWidth||dD,r=le.value?.offsetHeight||fD,i=window.innerWidth||Qe.value,a=window.innerHeight||$e.value,o=t.bottom+mD,s=t.top-r-mD,c=o+r>a-pD&&s>=pD;Jt.value={left:Math.max(pD,Math.min(i-n-pD,t.left)),top:Math.max(pD,Math.min(a-r-pD,c?s:o))}}function wa(){Ht.value=!1,Yt.value=null,Wt.value=``,Kt.value=[],qt.value=0,pa+=1,Ut.value=!1}async function Ta(e){if(!ui.value)return;d(`comment-mention-search`,e);let t=++pa;Ut.value=!0;try{let n=u.onCommentMentionSearch??u.commentMentionProvider,r=n?await n(e):[];if(t!==pa)return;Kt.value=(Array.isArray(r)?r:[]).map(ma).filter(e=>!!e),qt.value=0}catch{t===pa&&(Kt.value=[],qt.value=0)}finally{t===pa&&(Ut.value=!1)}}function Ea(e,n){if(!ui.value||!e||!ei.value){wa();return}let r=Sa(e);if(!r){wa();return}let i=n.mode===`edit`?Ft.value:od(n.threadId,n.parentId);Yt.value={...n,textarea:e,range:r},Wt.value=r.query,Gt.value=`all`,Ht.value=!0,Ca(),(0,t.nextTick)(Ca),Ta({query:r.query,type:Gt.value,threadId:n.threadId,commentId:n.commentId,parentId:n.parentId,content:i})}function Da(e){if(!ui.value||!Yt.value)return;let t=Yt.value,n=t.mode===`edit`?Ft.value:od(t.threadId,t.parentId);Gt.value=e,qt.value=0,Ta({query:Wt.value,type:e,threadId:t.threadId,commentId:t.commentId,parentId:t.parentId,content:n})}function Oa(e,t){ui.value&&(qt.value=t,d(`comment-mention-item-click`,ha(e)))}function ka(e){let t=qi.value.length;t&&(qt.value=(qt.value+e+t)%t)}function Aa(e){let n=Yt.value;if(!ui.value||!n)return!1;let r=ha(e),i=n.mode===`edit`?Ft.value:od(n.threadId,n.parentId),a=`${ga(r)} `,o=`${i.slice(0,n.range.from)}${a}${i.slice(n.range.to)}`,s=n.range.from+a.length;return n.mode===`edit`?(Ft.value=o,It.value=va(It.value,r)):(sd(n.threadId,o,n.parentId),xa(n.threadId,va(ba(n.threadId,n.parentId),r),n.parentId)),d(`comment-mention-submit`,r),wa(),(0,t.nextTick)(()=>{n.textarea.focus(),n.textarea.setSelectionRange(s,s)}),!0}function ja(){ui.value&&U.value&&Aa(U.value)}function G(e){return!ui.value||!Ht.value?!1:e.key===`Escape`?(wa(),!0):e.key===`ArrowDown`?(ka(1),!0):e.key===`ArrowUp`?(ka(-1),!0):(e.key===`Enter`||e.key===`Tab`)&&U.value?(ja(),!0):!1}function Ma(e){return e.replace(/\s+/g,` `).trim()||`未命名标题`}function K(){if(!W.value)return[];let e=[];return W.value.state.doc.descendants((t,n)=>{t.type.name===`heading`&&e.push({pos:n,level:Math.min(6,Math.max(1,Number(t.attrs.level??1))),text:Ma(t.textContent)})}),e}function Na(e){if(!W.value)return null;let t=W.value.state.selection.from,n=null;for(let r of e){if(r.pos>t)break;n=r.pos}return n}function Pa(){return{items:Sr.value.map(e=>({...e})),activePos:Cr.value}}function Fa(){let e=Pa(),t=JSON.stringify(e);t!==Tr&&(Tr=t,d(`outline-change`,e),wr.forEach(t=>t(e)))}function Ia(){let e=K();Sr.value=e,Cr.value=Na(e),Fa()}function La(){Qe.value=window.innerWidth,$e.value=window.innerHeight}function Ra(){if(!ne.value)return;let e=ne.value.querySelector(`.norio-office-rich-toolbar__group--insert .norio-office-rich-toolbar__button--select .norio-office-rich-toolbar__label`);e&&(e.textContent=ji.value);let t=ne.value.querySelectorAll(`.norio-office-rich-insert-menu__title`),n=0;_i.value.length&&t[n]&&(t[n].textContent=Mi.value,n+=1),vi.value.length&&t[n]&&(t[n].textContent=Ni.value,n+=1),yi.value.length&&t[n]&&(t[n].textContent=Pi.value);let r=ne.value.querySelector(`.norio-office-rich-toolbar__menu--quote .norio-office-rich-color-menu__current`);r&&(r.textContent=Fi.value);let i=ne.value.querySelectorAll(`.norio-office-rich-toolbar__menu--quote .norio-office-rich-color-menu__label`);i[0]&&(i[0].textContent=Ii.value),i[1]&&(i[1].textContent=Li.value);let a=ne.value.querySelector(`.norio-office-rich-statusbar__label--presentation`);a&&(a.textContent=B.value);let o=ne.value.querySelector(`.norio-office-rich-statusbar__label--fullscreen`);o&&(o.textContent=Bi.value);let s=ne.value.querySelector(`.norio-office-rich-statusbar__word-count span`);s&&(s.textContent=R.value);let c=ne.value.querySelector(`.norio-office-rich-statusbar__line-count span`);c&&(c.textContent=z.value)}let za=(0,t.computed)(()=>Zt.value/100*V.value),Ba=(0,t.computed)(()=>({"--norio-office-rich-page-width":`${lD}px`,"--norio-office-rich-page-height":`${uD}px`,"--norio-office-rich-page-scale":String(za.value)})),Va=(0,t.computed)(()=>{if(!oi.value)return null;let e=String(u.watermark?.text??``).trim();return e?{text:e,color:u.watermark?.color||`rgba(15, 23, 42, 0.12)`,fontSize:Math.max(12,Math.min(96,Number(u.watermark?.fontSize??18)||18)),rotate:Math.max(-90,Math.min(90,Number(u.watermark?.rotate??-24)||-24)),showInEdit:u.watermark?.showInEdit??!0}:null}),Ha=(0,t.computed)(()=>Va.value?!ei.value||Va.value.showInEdit:!1),Ua=(0,t.computed)(()=>{let e=Va.value;return e?{"--norio-office-rich-watermark-color":e.color,"--norio-office-rich-watermark-font-size":`${e.fontSize}px`,"--norio-office-rich-watermark-rotate":`${e.rotate}deg`}:{}}),Wa=Array.from({length:96},(e,t)=>t),Ga=(0,t.computed)(()=>{Xt.value;let e=W.value?.state.selection,t=e&&!(e instanceof a.NodeSelection)&&!e.empty,n=e instanceof a.NodeSelection&&[`imageBlock`,`videoBlock`,`linkBlock`,`table`].includes(e.node.type.name);return!ei.value||Fr.value||Ir.value||Lr.value||Rr.value||zr.value||Br.value||Ei.value||!!Or.value||Wi.value||!!t||n}),Ka=(0,t.computed)(()=>Ga.value?null:Pr.value??Nr.value);(0,t.watch)(Ga,e=>{e&&(jc(),Nr.value=null)},{flush:`sync`}),(0,t.watch)(Br,e=>{e||(ct.value=!1,lt.value=!1)});let qa=(0,t.computed)(()=>{let e=Ka.value;return e&&Lc(e)?ir:[]}),Ja=(0,t.computed)(()=>{let e=Ka.value?.node;return e?e.type.name===`heading`?`heading-${e.attrs.level}`:{paragraph:`paragraph`,bulletList:`bullet-list`,orderedList:`ordered-list`,taskList:`task-list`}[e.type.name]??null:null}),Ya=(0,t.computed)(()=>{let e=Ka.value;return e&&Rc(e)?ar:[]}),Xa=(0,t.computed)(()=>{let e=Ka.value;return!e||!P.value?!1:P.value===`properties`?Ya.value.length>0:P.value===`color`?Bc(e):P.value===`table-theme`?e.node.type.name===`table`&&Wr.value!==null:P.value===`divider-style`||P.value===`divider-color`?e.node.type.name===`horizontalRule`:P.value?.startsWith(`highlight-`)?e.node.type.name===`highlightBlock`&&Gr.value!==null:!P.value?.startsWith(`quote-`)||e.node.type.name===`blockquote`&&Gr.value!==null}),Za=(0,t.ref)(0),Qa=null;(0,t.watch)(De,e=>{if(Qa?.disconnect(),Qa=null,Za.value=0,!e)return;let t=()=>{let t=e.getBoundingClientRect().height/(za.value||1);t>0&&(Za.value=t)};t(),Qa=new ResizeObserver(t),Qa.observe(e)},{flush:`post`});let q=(0,t.computed)(()=>(dt.value,Math.min(Qe.value,ne.value?.clientWidth??Qe.value)<806*za.value)),$a=(0,t.computed)(()=>Za.value?Za.value:Hr.value===`actions`?380:Hr.value===`insert`?680:SD),eo=(0,t.computed)(()=>[`color`,`divider-color`,...$t].includes(P.value??``)?264:bD),to=(0,t.computed)(()=>P.value===`properties`?Math.max(56,Ya.value.length*48):P.value===`color`||P.value===`divider-color`?P.value===`color`?290:438:P.value===`divider-style`?134:$t.includes(P.value??``)?180:P.value===`highlight-settings`?64:680),no=(0,t.computed)(()=>{dt.value;let e=Ka.value;if(!e)return null;let t=e.node.isTextblock?Number.parseFloat(getComputedStyle(e.dom).lineHeight):wD,n=e.isEmpty?e.rect.height:Math.min(e.rect.height,t||wD),r=e.isEmpty?TD:ED,i=W.value?.view.dom,a=i?.getBoundingClientRect(),o=a?_c(a.left,a.top):null,s=i&&o?o.x+(Number.parseFloat(getComputedStyle(i).paddingLeft)||0):e.rect.left;return{left:Math.max(s-(j.value?.clientLeft??0)-r-CD,8),top:Math.max(e.rect.top-(j.value?.clientTop??0)+(n-wD)/2,8)}}),ro=(0,t.computed)(()=>{let e=no.value;return e?{left:`${e.left}px`,top:`${e.top}px`}:{}});function io(){let e=ne.value?.querySelector(`.norio-office-rich-editor__main`);if(e instanceof HTMLElement){let t=e.getBoundingClientRect(),n=Math.max(0,t.left),r=Math.max(0,t.top),i=Math.min(Qe.value,t.right),a=Math.min($e.value,t.bottom);return new DOMRect(n,r,Math.max(0,i-n),Math.max(0,a-r))}return{left:0,top:0,right:Qe.value,bottom:$e.value,width:Qe.value,height:$e.value}}function ao(e){if(!j.value)return e;j.value.getBoundingClientRect();let t=io(),n=za.value||1,r=Math.max((t.bottom-t.top-16)/n,120);return Math.min(e,r)}function oo(e,t,n=bD,r=SD,i=!0){if(!j.value)return{left:e,top:t};let a=j.value.getBoundingClientRect(),o=io(),s=za.value||1,c=i?ao(r):r,l=a.left+j.value.clientLeft*s,u=a.top+j.value.clientTop*s,d=(o.left+8-l)/s,f=(o.right-8-l)/s-n,p=(o.top+8-u)/s,m=(o.bottom-8-u)/s-c;return{left:Math.min(Math.max(e,Math.min(d,f)),Math.max(d,f)),top:i?Math.min(Math.max(t,Math.min(p,m)),Math.max(p,m)):Math.max(p,Math.min(t,Math.max(p,m)))}}let so=(0,t.computed)(()=>{dt.value;let e=Ka.value,t=Hr.value===`actions`?Ur.value??no.value:no.value;if(!e||!t)return null;let n=e.isEmpty?TD:ED,r=t.left,i=t.top,a=r-bD-xD,o=r+n+xD,s=j.value?.getBoundingClientRect(),c=za.value||1;return oo((s?s.left+a*c>=8:a>=8)?a:o,Hr.value===`actions`?i+(wD-$a.value)/2:e.isEmpty?i+wD+xD:i,bD,$a.value,!1)}),co=(0,t.computed)(()=>so.value?{left:`${so.value.left}px`,top:`${so.value.top}px`}:{}),lo=(0,t.computed)(()=>{dt.value;let e=Ka.value,t=so.value;if(!e||!t||!j.value)return{};let n=j.value.getBoundingClientRect(),r=za.value||1,i=eo.value;if(q.value&&en.includes(P.value??``))return uo(i,to.value+42);if([`properties`,`color`,`divider-style`,`divider-color`,`highlight-settings`,...$t].includes(P.value??``)){let e={properties:Ve.value,color:He.value,"divider-style":Pe.value,"divider-color":Fe.value,"highlight-border":Oe.value,"highlight-fill":ke.value,"quote-border":Oe.value,"quote-background":ke.value,"highlight-settings":Ae.value}[P.value]?.getBoundingClientRect();return e?fo(e,i,to.value):{}}let a=oo(n.left+(t.left+bD)*r+i*r<=io().right-8?t.left+bD:t.left-i,[`add-above`,`add-below`].includes(P.value??``)?t.top:t.top+42,i,to.value);return{left:`${a.left}px`,top:`${a.top}px`,width:`${i}px`,maxHeight:`${ao(to.value)}px`}});function uo(e,t){let n=so.value;if(!j.value||!n)return{};let r=j.value.getBoundingClientRect(),i=za.value||1,a=io(),o=Math.max(0,a.left)+8,s=Math.min(Qe.value,a.right)-8,c=Math.max(0,a.top)+8,l=Math.min($e.value,a.bottom)-8,u=Math.min(e,Math.max(0,(s-o)/i)),d=Math.max(0,(l-c)/i),f=Math.max(o,Math.min(r.left+n.left*i,s-u*i)),p=Math.max(c,Math.min(r.top+n.top*i,l-Math.min(t,d)*i));return{left:`${(f-r.left)/i}px`,top:`${(p-r.top)/i}px`,width:`${u}px`,maxHeight:`${d}px`}}function fo(e,t,n){if(!j.value)return{};let r=j.value.getBoundingClientRect(),i=za.value||1,a=io(),o=Math.max(0,a.left)+8,s=Math.min(Qe.value,a.right)-8,c=Math.max(0,a.top)+8,l=Math.min($e.value,a.bottom)-8,u=Math.min(t,Math.max(0,(s-o)/i)),d=Math.max(0,(l-c)/i),f=Math.min(n,d),p=e.right+xD*i,m=p+u*i<=s?p:e.left-(u+xD)*i,h=Math.max(o,Math.min(m,s-u*i)),g=Math.max(c,Math.min(e.top,l-f*i));return{left:`${(h-r.left)/i}px`,top:`${(g-r.top)/i}px`,width:`${u}px`,maxHeight:`${d}px`}}let po=(0,t.computed)(()=>{if(dt.value,q.value)return uo(264,460);let e=Ue.value?.getBoundingClientRect();return e?fo(e,264,400):{}}),mo=(0,t.computed)(()=>{let e=Xr.value;return e?{left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${e.height}px`,"--norio-office-rich-block-drag-ghost-scale":String(e.scale),"--norio-office-rich-block-drag-ghost-source-width":`${e.sourceWidth}px`,"--norio-office-rich-block-drag-ghost-source-height":`${e.sourceHeight}px`}:{}}),ho=(0,t.computed)(()=>(W.value?.getText()??``).replace(/\s+/g,``).length),go=(0,t.computed)(()=>{let e=W.value?.getText()??``;return Math.max(1,e.split(/\n+/).filter(Boolean).length)}),J=(0,t.computed)(()=>{if(Xt.value,!W.value)return`正文`;for(let e of Qt)if(e.level&&W.value.isActive(`heading`,{level:e.level}))return`标题 ${e.level}`;return`正文`}),_o=(0,t.computed)(()=>(Xt.value,W.value?.isActive(`superscript`)?{icon:`shangbiao`,text:``}:W.value?.isActive(`subscript`)?{icon:`xiabiao`,text:``}:{icon:``,text:`AV`})),vo=(0,t.computed)(()=>{Xt.value;let e=W.value?.getAttributes(`textStyle`).fontSize;return e?Xn.find(t=>t.value===e)?.label??e.replace(`px`,``):`小四`}),yo=(0,t.computed)(()=>{Xt.value;let e=W.value?.getAttributes(`textStyle`).fontFamily;return e?Zn.find(t=>t.value===e)?.label??`默认`:`默认`}),bo=(0,t.computed)(()=>(Xt.value,W.value?.isActive(`heading`)?W.value.getAttributes(`heading`).textAlign||`left`:W.value?.getAttributes(`paragraph`).textAlign||`left`)),xo=(0,t.computed)(()=>(Xt.value,W.value?.getAttributes(`textStyle`).color||`#333333`)),So=(0,t.computed)(()=>(Xt.value,W.value?.getAttributes(`textStyle`).backgroundColor||`#FFF3C4`)),Co=(0,t.computed)(()=>W.value?.getAttributes(`blockquote`).quoteBorderColor||gr[0]),wo=(0,t.computed)(()=>W.value?.getAttributes(`blockquote`).quoteBackgroundColor||_r[0]),To=(0,t.computed)(()=>{if(Xt.value,!W.value?.isActive(`table`))return{isCellSelection:!1,isRowSelection:!1,isColumnSelection:!1};let e=W.value.state.selection,t=e instanceof s.CellSelection;return{isCellSelection:t,isRowSelection:t&&e.isRowSelection(),isColumnSelection:t&&e.isColSelection()}}),Eo=(0,t.computed)(()=>{if(Xt.value,!W.value?.isActive(`table`))return null;try{return(0,s.selectionCell)(W.value.state).nodeAfter?.attrs.backgroundColor||null}catch{return null}}),Do=(0,t.computed)(()=>(Xt.value,Ql(W.value?.getAttributes(`table`).tableTheme))),Oo=(0,t.computed)(()=>{Xt.value;let e=Wr.value,t=e===null?null:W.value?.state.doc.nodeAt(e);return t?.type.name===`table`?Ql(t.attrs.tableTheme):null}),ko=(0,t.computed)(()=>{if(Xt.value,dt.value,P.value!==`table-theme`||!Ne.value||!j.value)return{};let e=Ne.value.getBoundingClientRect(),t=j.value.getBoundingClientRect(),n=io(),r=Math.max(0,n.left)+8,i=Math.min(Qe.value,n.right)-8,a=Math.max(0,n.top)+8,o=Math.min($e.value,n.bottom)-8,s=za.value||1,c=Math.min(360,(i-r)/s),l=Math.max(120,(o-a)/s),u=Math.min(ut.value,l),d=e.right+8*s,f=d+c*s<=i?d:e.left-(c+8)*s,p=Math.max(r,Math.min(f,i-c*s)),m=Math.max(a,Math.min(e.top,o-u*s));return{left:`${(p-t.left)/s}px`,top:`${(m-t.top)/s}px`,width:`${c}px`,maxHeight:`${l}px`}}),Ao=(0,t.computed)(()=>{if(Xt.value,dt.value,!lt.value||!Me.value)return{};let e=Me.value.getBoundingClientRect(),t=io(),n={left:Math.max(0,t.left),right:Math.min(Qe.value,t.right),top:Math.max(0,t.top),bottom:Math.min($e.value,t.bottom)},r=za.value||1,i=Math.min(360,(n.right-n.left-16)/r),a=Math.max(120,(n.bottom-n.top-16)/r),o=Math.min(ut.value,a),s=e.bottom+8*r,c=s+o*r<=n.bottom-8?s:e.top-(o+8)*r,l=Math.max(n.top+8,Math.min(c,n.bottom-8-o*r));return{left:`${(Math.max(n.left+8,Math.min(e.left,n.right-8-i*r))-e.left)/r}px`,top:`${(l-e.top)/r}px`,width:`${i}px`,maxHeight:`${a}px`}}),jo=(0,t.computed)(()=>{Xt.value;let e=Gr.value,t=e===null?null:W.value?.state.doc.nodeAt(e),n=t?.type.name===`highlightBlock`?t.attrs:{};return{borderColor:String(n.borderColor??vD),backgroundColor:String(n.backgroundColor??yD),emojiEnabled:n.emojiEnabled!==!1}}),Mo=(0,t.computed)(()=>{Xt.value;let e=Pr.value,t=e&&W.value?.state.doc.nodeAt(e.pos),n={text:null,background:null},r=!1;return t?.descendants(e=>{if(!e.isText||r)return;let t=e.marks.find(e=>e.type.name===`textStyle`);n.text=t?.attrs.color??null,n.background=t?.attrs.backgroundColor??null,r=!0}),n}),No=(0,t.computed)(()=>{let e=Ka.value;return e?zc(e):[]}),Po=(0,t.computed)(()=>{let e=No.value.map(({node:e})=>e.attrs.textAlign||`left`);return e.every(t=>t===e[0])?e[0]||`left`:``}),Fo=(0,t.computed)(()=>No.value.some(({node:e})=>Number(e.attrs.indent??0)<8)),Io=(0,t.computed)(()=>No.value.some(({node:e})=>Number(e.attrs.indent??0)>0)),Lo=(0,t.computed)(()=>Cp(Ka.value?.node.attrs.lineStyle)),Ro=(0,t.computed)(()=>wp(Ka.value?.node.attrs.lineColor)??`#dfe5ee`),zo=(0,t.computed)(()=>{let e=W.value?.getAttributes(`countdownBlock`)??{};return{mode:e.mode===`duration`?`duration`:`deadline`,targetTimestamp:Number(e.targetTimestamp??0)||0}});function Bo(e){Xt.value;try{return!!W.value&&e(W.value)}catch{return!1}}function Vo(e){Xt.value;try{return e()}catch{return!1}}let Ho=(0,t.computed)(()=>!!W.value&&Vo(()=>W.value.can().chain().focus().mergeCells().run())),Uo=(0,t.computed)(()=>!!W.value&&Vo(()=>W.value.can().chain().focus().splitCell().run())),Wo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().undo().run())),Go=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().redo().run())),Ko=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().unsetAllMarks().clearNodes().run())),qo=(0,t.computed)(()=>(Xt.value,ni.value&&u.showComments&&!!W.value&&ei.value&&!!pi.value)),Jo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setParagraph().run())||Bo(e=>e.can().chain().focus().toggleHeading({level:1}).run())),Yo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setFontFamily(Zn[1]?.value??``).run())||Bo(e=>e.can().chain().focus().unsetFontFamily().run())),Xo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setFontSize(Xn[0]?.value??`16px`).run())),Zo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setColor(`#333333`).run())),Qo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setBackgroundColor(`#FFF3C4`).run())),$o=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleBold().run())),es=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleItalic().run())),ts=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleUnderline().run())),ns=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleStrike().run())),rs=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleSuperscript().run())||Bo(e=>e.can().chain().focus().toggleSubscript().run())),is=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleBulletList().run())),as=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleOrderedList().run())),os=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleTaskList().run())),ss=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setTextAlign(`left`).run())||Bo(e=>e.can().chain().focus().setTextAlign(`center`).run())||Bo(e=>e.can().chain().focus().setTextAlign(`right`).run())),cs=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().decreaseIndent().run())),ls=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().increaseIndent().run())),us=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleBlockquote().run())),ds=(0,t.computed)(()=>us.value||!!W.value?.isActive(`blockquote`)),fs=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleCode().run())),ps=(0,t.computed)(()=>{Xt.value;let e=e=>!!W.value?.isActive(e),t=t=>{let n=t?!!W.value?.isActive(`heading`,{level:t}):e(`paragraph`)&&![`bulletList`,`orderedList`,`taskList`,`blockquote`,`highlightBlock`].some(e);return{key:t?`heading-${t}`:`paragraph`,label:t?`${[`一`,`二`,`三`,`四`,`五`,`六`][t-1]}级标题`:`正文`,text:t?`H${t}`:`T`,active:n,disabled:!n&&!Hf(t),run:()=>pf(t)}},n=[t(),t(1),t(2),t(3),{key:`other-headings`,label:`其他标题`,text:`Hn`,active:[4,5,6].some(e=>!!W.value?.isActive(`heading`,{level:e})),options:[t(4),t(5),t(6)]},{key:`orderedList`,label:`有序列表`,icon:`youxuliebiao`,active:e(`orderedList`),disabled:!as.value,run:Pf},{key:`bulletList`,label:`无序列表`,icon:`wuxuliebiao`,active:e(`bulletList`),disabled:!is.value,run:Nf},{key:`taskList`,label:`任务`,icon:`To-do`,active:e(`taskList`),disabled:!os.value,run:Ff}];u_(`code-block`,ur.value)&&n.push({key:`codeBlock`,label:`代码块`,icon:`codeblock`,active:e(`codeBlock`),disabled:!Bo(e=>e.can().chain().focus().toggleCodeBlock().run()),run:()=>Tl()?.toggleCodeBlock().run()});let r=[];Ai.value&&r.push({key:`blockquote`,label:`引用`,icon:`yinyong`,active:e(`blockquote`),disabled:!us.value,run:()=>Tl()?.toggleBlockquote().run()}),u_(`highlight-block`,ur.value)&&r.push({key:`highlightBlock`,label:`高亮块`,icon:`gaoliangkuai`,active:e(`highlightBlock`),disabled:!Bo(e=>e.can().chain().focus().toggleWrap(`highlightBlock`).run()),run:()=>Tl()?.toggleWrap(`highlightBlock`).run()}),r[0]&&(r[0].divider=!0),n.push(...r);let i=n.find(e=>e.active&&e.key!==`other-headings`);return[{key:`heading`,label:`正文和标题`,icon:i?.icon,text:i?.text||(W.value?.isActive(`heading`)?`H${W.value.getAttributes(`heading`).level}`:`T`),disabled:!n.some(e=>e.options?e.options.some(e=>!e.disabled):!e.disabled),options:n},{key:`font`,label:`字体`,text:yo.value,disabled:!Yo.value,options:Zn.map(e=>({key:e.label,label:e.label,fontFamily:e.value,active:yo.value===e.label,disabled:!Uf(e.value),run:()=>_f(e.value)}))},{key:`size`,label:`字号`,text:vo.value,disabled:!Xo.value,options:Xn.map(e=>({key:e.label,label:e.label,active:vo.value===e.label,disabled:!Wf(e.value),run:()=>bf(e.value)}))},{key:`text-color`,label:`文字颜色`,color:xo.value,defaultColor:`#333333`,recentColors:br.value,setColor:Sf,disabled:!Zo.value},{key:`background-color`,label:`文字背景颜色`,icon:`beijingse`,color:So.value,defaultColor:`#FFF3C4`,recentColors:xr.value,setColor:wf,disabled:!Qo.value},{key:`bold`,label:`加粗`,icon:`jiacu`,active:e(`bold`),disabled:!$o.value,run:Of},{key:`italic`,label:`斜体`,icon:`xieti`,active:e(`italic`),disabled:!es.value,run:kf},{key:`underline`,label:`下划线`,icon:`xiahuaxian`,active:e(`underline`),disabled:!ts.value,run:Af},{key:`strike`,label:`删除线`,text:`S`,active:e(`strike`),disabled:!ns.value,run:jf},{key:`script`,label:`上下标`,icon:_o.value.icon||void 0,text:_o.value.text,active:e(`superscript`)||e(`subscript`),disabled:!rs.value,options:[{key:`superscript`,label:`上标`,icon:`shangbiao`,active:e(`superscript`),disabled:!qf(),run:zf},{key:`subscript`,label:`下标`,icon:`xiabiao`,active:e(`subscript`),disabled:!Yf(),run:Bf}]},{key:`alignment`,label:`对齐和缩进`,icon:bo.value===`center`?`juzhongduiqi`:bo.value===`right`?`youduiqi`:`zuoduiqi`,disabled:!ss.value,options:[...[`left`,`center`,`right`].map((e,t)=>({key:e,label:[`左对齐`,`居中对齐`,`右对齐`][t],icon:[`zuoduiqi`,`juzhongduiqi`,`youduiqi`][t],active:bo.value===e,disabled:!Gf(e),run:()=>Gl(e)})),{key:`indent-more`,label:`增加缩进`,icon:`yousuojin`,divider:!0,disabled:!ls.value,run:mf},{key:`indent-less`,label:`减少缩进`,icon:`zuosuojin`,disabled:!cs.value,run:hf}]},{key:`code`,label:`行内代码`,icon:`code`,active:e(`code`),disabled:!fs.value,run:Mf},{key:`clear`,label:`清除格式`,icon:`rubber`,disabled:!Ko.value,run:Vf}]}),ms=(0,t.computed)(()=>ps.value.filter(e=>![`heading`,`script`,`code`,`clear`].includes(e.key))),hs=(0,t.computed)(()=>!!W.value?.isActive(`table`)),gs=(0,t.computed)(()=>(Xt.value,W.value?.state.selection instanceof a.TextSelection&&!W.value.state.selection.empty&&W.value.isActive(`table`))),_s=(0,t.computed)(()=>To.value.isRowSelection||gs.value),vs=(0,t.computed)(()=>To.value.isColumnSelection||gs.value),ys=(0,t.computed)(()=>!!W.value?.isActive(`table`)&&(To.value.isRowSelection||To.value.isColumnSelection||To.value.isCellSelection));(0,t.computed)(()=>{let e=Hn.value;if(e)return{left:`${e.left+e.width/2}px`,top:`${e.top+e.height+12}px`}});function bs(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`image-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function xs(e,t){return{assetId:t.assetId,url:t.url,name:t.name||e.name,size:t.size??e.size,mimeType:t.mimeType||e.type||``,alt:t.alt,description:t.description}}function Ss(e){E.value?.(e),d(`upload-error`,e)}function Cs(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`upload-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function ws(e){return e instanceof Error&&e.message?e.message:`上传失败,请重试。`}function Ts(e){return e===`image`?`图片`:e===`video`?`视频`:`文件`}function Es(e){return`${Ts(e.kind)}${e.status===`uploading`?`上传中`:`上传失败`}`}function Ds(e){kt.value=kt.value.filter(t=>t.id!==e)}function Os(e,t){kt.value=kt.value.map(n=>n.id===e?{...n,...t}:n)}async function ks(e,t,n,r){let i=Cs(),a={id:i,kind:e,fileName:t,status:`uploading`,retry:()=>void 0},o=async()=>{Os(i,{status:`uploading`,message:void 0});try{let e=await n();return Ds(i),e}catch(e){return Os(i,{status:`error`,message:ws(e)}),r(e),null}};return a.retry=()=>{o()},kt.value=[a,...kt.value],await o()}async function As(e,t){let n=t===`image`?f.value:t===`video`?C.value:w.value;if(n)return xs(e,await n({file:e,kind:t}));throw Error(`Missing upload${t[0].toUpperCase()}${t.slice(1)} hook.`)}function js(e){let t=e,n=t.detail;n?.file&&n.kind&&(t.stopPropagation(),n.handled=!0,As(n.file,n.kind).then(n.resolve,n.reject))}function Ms(){if(!j.value)return null;let e=j.value.cloneNode(!0);return e.querySelectorAll(`.norio-office-rich-image-block__image-link[data-image-link]`).forEach(e=>{let t=document.createElement(`a`);t.className=e.className,t.href=e.dataset.imageLink??``,t.target=e.dataset.imageLinkTarget===`_self`?`_self`:`_blank`,t.rel=`noreferrer noopener`,t.append(...Array.from(e.childNodes)),e.replaceWith(t)}),e.querySelectorAll(`.norio-office-rich-image-block__caption-desc`).forEach(e=>{e.removeAttribute(`hidden`),e.textContent||e.closest(`.norio-office-rich-image-block__caption`)?.remove()}),e.style.transform=`none`,e.style.transformOrigin=`top left`,e.style.boxShadow=`none`,e.style.margin=`0`,e.style.width=`${lD}px`,e.style.minHeight=`${Math.max(j.value.scrollHeight,uD)}px`,e.style.height=`auto`,e.querySelectorAll(`.norio-office-rich-table-column-track,.norio-office-rich-table-row-track,.norio-office-rich-table-add-row,.norio-office-rich-table-add-column,.norio-office-rich-columns__overlay,.norio-office-rich-table-bubble-menu,.norio-office-rich-countdown-bubble-menu,.norio-office-rich-code-block__toolbar,.norio-office-rich-code-block__menu,.norio-office-rich-code-block__settings-menu,.norio-office-rich-code-block__line-numbers,.norio-office-rich-image-block__toolbar,.norio-office-rich-video-block__toolbar,.norio-office-rich-link-block__toolbar,.norio-office-rich-local-file-block__actions,.norio-office-rich-countdown-block__actions,.norio-office-rich-block-side-control,.norio-office-rich-block-side-menu,.norio-office-rich-block-side-submenu,.norio-office-rich-drag-insert-indicator,.norio-office-rich-upload-panel,.column-resize-handle,.ProseMirror-gapcursor,.norio-office-rich-video-block,[data-type="video-block"],.norio-office-rich-formula-editor,.norio-office-rich-marquee-selection-layer,.collaboration-carets__caret,.collaboration-carets__label,[aria-hidden="true"],button,input,textarea,select`.split(`,`).join(`, `)).forEach(e=>{e.remove()}),e.querySelectorAll(`[contenteditable]`).forEach(e=>{e.removeAttribute(`contenteditable`),e.removeAttribute(`tabindex`),e.removeAttribute(`spellcheck`),e.removeAttribute(`autocapitalize`),e.removeAttribute(`autocorrect`),e.removeAttribute(`data-placeholder`)}),e.querySelectorAll(`.ProseMirror-selectednode`).forEach(e=>{e.classList.remove(`ProseMirror-selectednode`)}),e.querySelectorAll(`.norio-office-rich-formula-block--selected`).forEach(e=>{e.classList.remove(`norio-office-rich-formula-block--selected`)}),e.querySelectorAll(`.collaboration-carets__selection`).forEach(e=>{e.classList.remove(`collaboration-carets__selection`),e.removeAttribute(`data-user`),e.removeAttribute(`style`)}),e}async function Ns(){let e=Ms();if(!e)return null;let n=document.createElement(`div`);n.style.position=`fixed`,n.style.left=`-20000px`,n.style.top=`0`,n.style.padding=`0`,n.style.margin=`0`,n.style.background=`#ffffff`,n.style.zIndex=`-1`,n.appendChild(e),document.body.appendChild(n);try{await(0,t.nextTick)();let{default:n}=await Promise.resolve().then(()=>se(Yb(),1));return await n(e,{backgroundColor:`#ffffff`,scale:2,useCORS:!0,logging:!1,width:lD,height:e.scrollHeight,windowWidth:lD,windowHeight:e.scrollHeight})}finally{n.remove()}}function Ps(e,t,n){return new Promise(r=>{e.toBlob(e=>r(e),t,n)})}async function Fs(e={}){let t=await Ns();return t?await Ps(t,e.type===`image/jpeg`?`image/jpeg`:`image/png`,typeof e.quality==`number`?Math.max(0,Math.min(1,e.quality)):void 0):null}function Is(e){return Number(e.toFixed(2)).toString()}function Ls(e){return Array.from(e||` `).map(e=>{let t=e.codePointAt(0)??32;return(t<=65535?t:9633).toString(16).padStart(4,`0`).toUpperCase()}).join(``)}function Rs(e){return Array.from(e||` `).map(e=>(e.codePointAt(0)??32)&255).map(e=>e.toString(16).padStart(2,`0`).toUpperCase()).join(``)}function zs(e){if(!e)return null;let t=e.trim().toLowerCase();if(!t||t===`transparent`)return null;let n=t.match(/^rgba?\(([^)]+)\)$/);if(n){let e=n[1].split(`,`).map(e=>e.trim());return(e[3]===void 0?1:Number(e[3]))<=0?null:{r:Math.max(0,Math.min(255,Number.parseFloat(e[0])||0))/255,g:Math.max(0,Math.min(255,Number.parseFloat(e[1])||0))/255,b:Math.max(0,Math.min(255,Number.parseFloat(e[2])||0))/255}}let r=t.startsWith(`#`)?t.slice(1):t;return/^[0-9a-f]{3}$/i.test(r)?{r:Number.parseInt(r[0]+r[0],16)/255,g:Number.parseInt(r[1]+r[1],16)/255,b:Number.parseInt(r[2]+r[2],16)/255}:/^[0-9a-f]{6}$/i.test(r)?{r:Number.parseInt(r.slice(0,2),16)/255,g:Number.parseInt(r.slice(2,4),16)/255,b:Number.parseInt(r.slice(4,6),16)/255}:null}function Bs(e){let t=window.getComputedStyle(e);return t.display!==`none`&&t.visibility!==`hidden`&&Number(t.opacity||`1`)>0}function Vs(e){let t=zs(e);return t?!(t.r>.995&&t.g>.995&&t.b>.995):!1}function Hs(e){let t=e.getBoundingClientRect(),n=lD,r=Math.max(e.scrollHeight,uD),i=[{commands:[]}],a=()=>i[i.length-1],o=e=>e-t.left,s=e=>e-t.top,c=(e,t,n,i,o={})=>{if(n<=0||i<=0)return;let s=zs(o.fill);s&&a().commands.push(`q ${Is(s.r)} ${Is(s.g)} ${Is(s.b)} rg ${Is(e)} ${Is(r-t-i)} ${Is(n)} ${Is(i)} re f Q`);let c=zs(o.stroke);c&&a().commands.push(`q ${Is(c.r)} ${Is(c.g)} ${Is(c.b)} RG ${Is(e)} ${Is(r-t-i)} ${Is(n)} ${Is(i)} re S Q`)},l=(e,t,n,i,o)=>{if(!e)return;let s=zs(o)??{r:15/255,g:23/255,b:42/255},c=Array.from(e).every(e=>(e.codePointAt(0)??0)<=255),l=c?`F2`:`F1`,u=c?Rs(e):Ls(e);a().commands.push(`BT /${l} ${Is(i)} Tf ${Is(s.r)} ${Is(s.g)} ${Is(s.b)} rg ${Is(t)} ${Is(r-n)} Td <${u}> Tj ET`)};e.querySelectorAll(`*`).forEach(e=>{if(!Bs(e))return;let t=window.getComputedStyle(e),n=e.getBoundingClientRect(),r=o(n.left),i=s(n.top),a=t.backgroundColor,l=t.borderColor,u=[`Top`,`Right`,`Bottom`,`Left`].some(e=>Number.parseFloat(t[`border${e}Width`])>0);(Vs(a)||u)&&c(r,i,n.width,n.height,{fill:Vs(a)?a:null,stroke:u?l:null})});let u=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){if(!(e.textContent??``).trim())return NodeFilter.FILTER_REJECT;let t=e.parentElement;return!t||!Bs(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),d=document.createRange();for(;u.nextNode();){let e=u.currentNode,t=e.textContent??``,n=e.parentElement;if(!n)continue;let r=window.getComputedStyle(n),i=Number.parseFloat(r.fontSize||`14`)||14,a=Number.parseFloat(r.lineHeight||``),c=Number.isFinite(a)?a:i*1.4,f=r.color||`#0f172a`,p=``,m=0,h=0,g=0,_=0,v=()=>{p.trim()&&l(p,m,g,i,f),p=``};Array.from(t).forEach((t,n)=>{if(!t.trim()){v();return}d.setStart(e,n),d.setEnd(e,n+t.length);let r=d.getBoundingClientRect();if(r.width<=0||r.height<=0){v();return}let a=o(r.left),l=s(r.top),u=l+Math.min(c,r.height)*.82,f=p&&Math.abs(l-h)<2&&Math.abs(a-_)<Math.max(i*.8,8),y=!p||Array.from(p).every(e=>(e.codePointAt(0)??0)<=255)===(t.codePointAt(0)??0)<=255;(!f||!y)&&(v(),m=a,h=l,g=u),p||(m=a,h=l,g=u),p+=t,_=o(r.right)}),v()}d.detach();let f=[],p=(e=``)=>(f.push(e),f.length),m=(e,t)=>{f[e-1]=t},h=p(),g=p(`<< /Type /Font /Subtype /Type0 /BaseFont /STSong-Light /Encoding /UniGB-UCS2-H /DescendantFonts [${p(`<< /Type /Font /Subtype /CIDFontType0 /BaseFont /STSong-Light /FontDescriptor ${p(`<< /Type /FontDescriptor /FontName /STSong-Light /Flags 6 /FontBBox [0 -200 1000 900] /Ascent 880 /Descent -120 /CapHeight 880 /StemV 80 /ItalicAngle 0 >>`)} 0 R /DW 1000 /CIDSystemInfo << /Registry (Adobe) /Ordering (GB1) /Supplement 2 >> >>`)} 0 R] >>`),_=p(`<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>`),v=i.map(e=>{let t=e.commands.join(`
8124
+ `),a=i.lastIndexOf(`@`);if(a<0)return null;let o=i.slice(a+1);return/[\s@]/.test(o)?null:{from:r+a,to:n.pos,query:o}}function ta(){if(!W.value||!Et.value||!j.value)return;let e=W.value.view.coordsAtPos(Et.value.from),t=j.value.getBoundingClientRect(),n=za.value||1,r=Ke.value?.offsetWidth||dD,i=Ke.value?.offsetHeight||fD,a=r*n,o=i*n,s=window.innerWidth||Qe.value,c=window.innerHeight||$e.value,l=Math.max(pD,s-a-pD),u=Math.max(pD,c-o-pD),d=e.bottom+mD,f=e.top-o-mD,p=d+o>c-pD&&f>=pD,m=Math.max(pD,Math.min(l,e.left)),h=Math.max(pD,Math.min(u,p?f:d));Dt.value={left:Math.max(pD,Math.min(lD-r-pD,(m-t.left)/n)),top:Math.max(pD,(h-t.top)/n)}}async function na(e){if(!li.value)return;let t=++Yi;xt.value=!0;try{let n=u.onMentionSearch??u.mentionProvider,r=n?await n(e):[];if(t!==Yi)return;wt.value=(Array.isArray(r)?r:[]).map(Xi).filter(e=>!!e),Tt.value=0}catch{t===Yi&&(wt.value=[],Tt.value=0)}finally{t===Yi&&(xt.value=!1)}}function ra(){bt.value=!1,Et.value=null,St.value=``,wt.value=[],Tt.value=0,Yi+=1,xt.value=!1}function ia(){if(!li.value||!W.value||!ei.value)return;let e=ea();e?(Et.value={from:e.from,to:e.to},St.value=e.query,Ct.value=`all`,bt.value=!0,ta(),(0,t.nextTick)(ta),na({query:e.query,type:Ct.value})):ra()}function aa(){if(!li.value){(bt.value||Et.value||wt.value.length||xt.value)&&ra();return}if(!bt.value)return;let e=ea();e?(Et.value={from:e.from,to:e.to},ta(),(0,t.nextTick)(ta),e.query!==St.value&&(St.value=e.query,na({query:e.query,type:Ct.value}))):ra()}function oa(e){li.value&&(Ct.value=e,Tt.value=0,na({query:St.value,type:e}))}function sa(e,t){li.value&&(Tt.value=t,d(`mention-item-click`,Zi(e)))}function ca(e){let t=Gi.value.length;t&&(Tt.value=(Tt.value+e+t)%t)}function la(e){if(!li.value||!W.value||!Et.value)return!1;let t=Zi(e),n=W.value.chain().focus().deleteRange(Et.value).insertContent([{type:`mention`,attrs:t},{type:`text`,text:` `}]).run();return n&&(d(`mention-submit`,t),ra()),n}function ua(e){let t=Xi(e);return!li.value||!t||!W.value?!1:W.value.chain().focus().insertContent([{type:`mention`,attrs:Zi(t)},{type:`text`,text:` `}]).run()}function da(){li.value&&Ki.value&&la(Ki.value)}function fa(e){return!li.value||!bt.value?!1:e.key===`Escape`?(ra(),!0):e.key===`ArrowDown`?(ca(1),!0):e.key===`ArrowUp`?(ca(-1),!0):e.key===`Enter`&&Ki.value?(da(),!0):!1}let pa=0;function ma(e){return Xi(e)}function ha(e){return Zi(e)}function ga(e){return`@${e.name}`}function _a(e){return`${e.type}:${e.id}`}function va(e,t){let n=ha(t),r=_a(n);return[...e.filter(e=>_a(e)!==r),n]}function ya(e,t){return t.filter(t=>e.includes(ga(t)))}function ba(e,t){return Nt.value[od(e,t)]??[]}function xa(e,t,n){let r=od(e,n);Nt.value={...Nt.value,[r]:t}}function Sa(e){let t=e.selectionStart??0;if(t!==(e.selectionEnd??t))return null;let n=e.value.slice(0,t),r=n.lastIndexOf(`@`);if(r<0)return null;let i=n.slice(r+1);return/[\s@]/.test(i)?null:{from:r,to:t,query:i}}function Ca(){let e=Yt.value;if(!e)return;let t=e.textarea.getBoundingClientRect(),n=le.value?.offsetWidth||dD,r=le.value?.offsetHeight||fD,i=window.innerWidth||Qe.value,a=window.innerHeight||$e.value,o=t.bottom+mD,s=t.top-r-mD,c=o+r>a-pD&&s>=pD;Jt.value={left:Math.max(pD,Math.min(i-n-pD,t.left)),top:Math.max(pD,Math.min(a-r-pD,c?s:o))}}function wa(){Ht.value=!1,Yt.value=null,Wt.value=``,Kt.value=[],qt.value=0,pa+=1,Ut.value=!1}async function Ta(e){if(!ui.value)return;d(`comment-mention-search`,e);let t=++pa;Ut.value=!0;try{let n=u.onCommentMentionSearch??u.commentMentionProvider,r=n?await n(e):[];if(t!==pa)return;Kt.value=(Array.isArray(r)?r:[]).map(ma).filter(e=>!!e),qt.value=0}catch{t===pa&&(Kt.value=[],qt.value=0)}finally{t===pa&&(Ut.value=!1)}}function Ea(e,n){if(!ui.value||!e||!ei.value){wa();return}let r=Sa(e);if(!r){wa();return}let i=n.mode===`edit`?Ft.value:sd(n.threadId,n.parentId);Yt.value={...n,textarea:e,range:r},Wt.value=r.query,Gt.value=`all`,Ht.value=!0,Ca(),(0,t.nextTick)(Ca),Ta({query:r.query,type:Gt.value,threadId:n.threadId,commentId:n.commentId,parentId:n.parentId,content:i})}function Da(e){if(!ui.value||!Yt.value)return;let t=Yt.value,n=t.mode===`edit`?Ft.value:sd(t.threadId,t.parentId);Gt.value=e,qt.value=0,Ta({query:Wt.value,type:e,threadId:t.threadId,commentId:t.commentId,parentId:t.parentId,content:n})}function Oa(e,t){ui.value&&(qt.value=t,d(`comment-mention-item-click`,ha(e)))}function ka(e){let t=qi.value.length;t&&(qt.value=(qt.value+e+t)%t)}function Aa(e){let n=Yt.value;if(!ui.value||!n)return!1;let r=ha(e),i=n.mode===`edit`?Ft.value:sd(n.threadId,n.parentId),a=`${ga(r)} `,o=`${i.slice(0,n.range.from)}${a}${i.slice(n.range.to)}`,s=n.range.from+a.length;return n.mode===`edit`?(Ft.value=o,It.value=va(It.value,r)):(cd(n.threadId,o,n.parentId),xa(n.threadId,va(ba(n.threadId,n.parentId),r),n.parentId)),d(`comment-mention-submit`,r),wa(),(0,t.nextTick)(()=>{n.textarea.focus(),n.textarea.setSelectionRange(s,s)}),!0}function ja(){ui.value&&U.value&&Aa(U.value)}function G(e){return!ui.value||!Ht.value?!1:e.key===`Escape`?(wa(),!0):e.key===`ArrowDown`?(ka(1),!0):e.key===`ArrowUp`?(ka(-1),!0):(e.key===`Enter`||e.key===`Tab`)&&U.value?(ja(),!0):!1}function Ma(e){return e.replace(/\s+/g,` `).trim()||`未命名标题`}function K(){if(!W.value)return[];let e=[];return W.value.state.doc.descendants((t,n)=>{t.type.name===`heading`&&e.push({pos:n,level:Math.min(6,Math.max(1,Number(t.attrs.level??1))),text:Ma(t.textContent)})}),e}function Na(e){if(!W.value)return null;let t=W.value.state.selection.from,n=null;for(let r of e){if(r.pos>t)break;n=r.pos}return n}function Pa(){return{items:Sr.value.map(e=>({...e})),activePos:Cr.value}}function Fa(){let e=Pa(),t=JSON.stringify(e);t!==Tr&&(Tr=t,d(`outline-change`,e),wr.forEach(t=>t(e)))}function Ia(){let e=K();Sr.value=e,Cr.value=Na(e),Fa()}function La(){Qe.value=window.innerWidth,$e.value=window.innerHeight}function Ra(){if(!ne.value)return;let e=ne.value.querySelector(`.norio-office-rich-toolbar__group--insert .norio-office-rich-toolbar__button--select .norio-office-rich-toolbar__label`);e&&(e.textContent=ji.value);let t=ne.value.querySelectorAll(`.norio-office-rich-insert-menu__title`),n=0;_i.value.length&&t[n]&&(t[n].textContent=Mi.value,n+=1),vi.value.length&&t[n]&&(t[n].textContent=Ni.value,n+=1),yi.value.length&&t[n]&&(t[n].textContent=Pi.value);let r=ne.value.querySelector(`.norio-office-rich-toolbar__menu--quote .norio-office-rich-color-menu__current`);r&&(r.textContent=Fi.value);let i=ne.value.querySelectorAll(`.norio-office-rich-toolbar__menu--quote .norio-office-rich-color-menu__label`);i[0]&&(i[0].textContent=Ii.value),i[1]&&(i[1].textContent=Li.value);let a=ne.value.querySelector(`.norio-office-rich-statusbar__label--presentation`);a&&(a.textContent=B.value);let o=ne.value.querySelector(`.norio-office-rich-statusbar__label--fullscreen`);o&&(o.textContent=Bi.value);let s=ne.value.querySelector(`.norio-office-rich-statusbar__word-count span`);s&&(s.textContent=R.value);let c=ne.value.querySelector(`.norio-office-rich-statusbar__line-count span`);c&&(c.textContent=z.value)}let za=(0,t.computed)(()=>Zt.value/100*V.value),Ba=(0,t.computed)(()=>({"--norio-office-rich-page-width":`${lD}px`,"--norio-office-rich-page-height":`${uD}px`,"--norio-office-rich-page-scale":String(za.value)})),Va=(0,t.computed)(()=>{if(!oi.value)return null;let e=String(u.watermark?.text??``).trim();return e?{text:e,color:u.watermark?.color||`rgba(15, 23, 42, 0.12)`,fontSize:Math.max(12,Math.min(96,Number(u.watermark?.fontSize??18)||18)),rotate:Math.max(-90,Math.min(90,Number(u.watermark?.rotate??-24)||-24)),showInEdit:u.watermark?.showInEdit??!0}:null}),Ha=(0,t.computed)(()=>Va.value?!ei.value||Va.value.showInEdit:!1),Ua=(0,t.computed)(()=>{let e=Va.value;return e?{"--norio-office-rich-watermark-color":e.color,"--norio-office-rich-watermark-font-size":`${e.fontSize}px`,"--norio-office-rich-watermark-rotate":`${e.rotate}deg`}:{}}),Wa=Array.from({length:96},(e,t)=>t),Ga=(0,t.computed)(()=>{Xt.value;let e=W.value?.state.selection,t=e&&!(e instanceof a.NodeSelection)&&!e.empty,n=e instanceof a.NodeSelection&&[`imageBlock`,`videoBlock`,`linkBlock`,`table`].includes(e.node.type.name);return!ei.value||Fr.value||Ir.value||Lr.value||Rr.value||zr.value||Br.value||Ei.value||!!Or.value||Wi.value||!!t||n}),Ka=(0,t.computed)(()=>Ga.value?null:Pr.value??Nr.value);(0,t.watch)(Ga,e=>{e&&(Mc(),Nr.value=null)},{flush:`sync`}),(0,t.watch)(Br,e=>{e||(ct.value=!1,lt.value=!1)});let qa=(0,t.computed)(()=>{let e=Ka.value;return e&&Rc(e)?ir:[]}),Ja=(0,t.computed)(()=>{let e=Ka.value?.node;return e?e.type.name===`heading`?`heading-${e.attrs.level}`:{paragraph:`paragraph`,bulletList:`bullet-list`,orderedList:`ordered-list`,taskList:`task-list`}[e.type.name]??null:null}),Ya=(0,t.computed)(()=>{let e=Ka.value;return e&&zc(e)?ar:[]}),Xa=(0,t.computed)(()=>{let e=Ka.value;return!e||!P.value?!1:P.value===`properties`?Ya.value.length>0:P.value===`color`?Vc(e):P.value===`table-theme`?e.node.type.name===`table`&&Wr.value!==null:P.value===`divider-style`||P.value===`divider-color`?e.node.type.name===`horizontalRule`:P.value?.startsWith(`highlight-`)?e.node.type.name===`highlightBlock`&&Gr.value!==null:!P.value?.startsWith(`quote-`)||e.node.type.name===`blockquote`&&Gr.value!==null}),Za=(0,t.ref)(0),Qa=null;(0,t.watch)(De,e=>{if(Qa?.disconnect(),Qa=null,Za.value=0,!e)return;let t=()=>{let t=e.getBoundingClientRect().height/(za.value||1);t>0&&(Za.value=t)};t(),Qa=new ResizeObserver(t),Qa.observe(e)},{flush:`post`});let q=(0,t.computed)(()=>(dt.value,Math.min(Qe.value,ne.value?.clientWidth??Qe.value)<806*za.value)),$a=(0,t.computed)(()=>Za.value?Za.value:Hr.value===`actions`?380:Hr.value===`insert`?680:SD),eo=(0,t.computed)(()=>[`color`,`divider-color`,...$t].includes(P.value??``)?264:bD),to=(0,t.computed)(()=>P.value===`properties`?Math.max(56,Ya.value.length*48):P.value===`color`||P.value===`divider-color`?P.value===`color`?290:438:P.value===`divider-style`?134:$t.includes(P.value??``)?180:P.value===`highlight-settings`?64:680),no=(0,t.computed)(()=>{dt.value;let e=Ka.value;if(!e)return null;let t=e.node.isTextblock?Number.parseFloat(getComputedStyle(e.dom).lineHeight):wD,n=e.isEmpty?e.rect.height:Math.min(e.rect.height,t||wD),r=e.isEmpty?TD:ED,i=W.value?.view.dom,a=i?.getBoundingClientRect(),o=a?_c(a.left,a.top):null,s=i&&o?o.x+(Number.parseFloat(getComputedStyle(i).paddingLeft)||0):e.rect.left;return{left:Math.max(s-(j.value?.clientLeft??0)-r-CD,8),top:Math.max(e.rect.top-(j.value?.clientTop??0)+(n-wD)/2,8)}}),ro=(0,t.computed)(()=>{let e=no.value;return e?{left:`${e.left}px`,top:`${e.top}px`}:{}});function io(){let e=ne.value?.querySelector(`.norio-office-rich-editor__main`);if(e instanceof HTMLElement){let t=e.getBoundingClientRect(),n=Math.max(0,t.left),r=Math.max(0,t.top),i=Math.min(Qe.value,t.right),a=Math.min($e.value,t.bottom);return new DOMRect(n,r,Math.max(0,i-n),Math.max(0,a-r))}return{left:0,top:0,right:Qe.value,bottom:$e.value,width:Qe.value,height:$e.value}}function ao(e){if(!j.value)return e;j.value.getBoundingClientRect();let t=io(),n=za.value||1,r=Math.max((t.bottom-t.top-16)/n,120);return Math.min(e,r)}function oo(e,t,n=bD,r=SD,i=!0){if(!j.value)return{left:e,top:t};let a=j.value.getBoundingClientRect(),o=io(),s=za.value||1,c=i?ao(r):r,l=a.left+j.value.clientLeft*s,u=a.top+j.value.clientTop*s,d=(o.left+8-l)/s,f=(o.right-8-l)/s-n,p=(o.top+8-u)/s,m=(o.bottom-8-u)/s-c;return{left:Math.min(Math.max(e,Math.min(d,f)),Math.max(d,f)),top:i?Math.min(Math.max(t,Math.min(p,m)),Math.max(p,m)):Math.max(p,Math.min(t,Math.max(p,m)))}}let so=(0,t.computed)(()=>{dt.value;let e=Ka.value,t=Hr.value===`actions`?Ur.value??no.value:no.value;if(!e||!t)return null;let n=e.isEmpty?TD:ED,r=t.left,i=t.top,a=r-bD-xD,o=r+n+xD,s=j.value?.getBoundingClientRect(),c=za.value||1;return oo((s?s.left+a*c>=8:a>=8)?a:o,Hr.value===`actions`?i+(wD-$a.value)/2:e.isEmpty?i+wD+xD:i,bD,$a.value,!1)}),co=(0,t.computed)(()=>so.value?{left:`${so.value.left}px`,top:`${so.value.top}px`}:{}),lo=(0,t.computed)(()=>{dt.value;let e=Ka.value,t=so.value;if(!e||!t||!j.value)return{};let n=j.value.getBoundingClientRect(),r=za.value||1,i=eo.value;if(q.value&&en.includes(P.value??``))return uo(i,to.value+42);if([`properties`,`color`,`divider-style`,`divider-color`,`highlight-settings`,...$t].includes(P.value??``)){let e={properties:Ve.value,color:He.value,"divider-style":Pe.value,"divider-color":Fe.value,"highlight-border":Oe.value,"highlight-fill":ke.value,"quote-border":Oe.value,"quote-background":ke.value,"highlight-settings":Ae.value}[P.value]?.getBoundingClientRect();return e?fo(e,i,to.value):{}}let a=oo(n.left+(t.left+bD)*r+i*r<=io().right-8?t.left+bD:t.left-i,[`add-above`,`add-below`].includes(P.value??``)?t.top:t.top+42,i,to.value);return{left:`${a.left}px`,top:`${a.top}px`,width:`${i}px`,maxHeight:`${ao(to.value)}px`}});function uo(e,t){let n=so.value;if(!j.value||!n)return{};let r=j.value.getBoundingClientRect(),i=za.value||1,a=io(),o=Math.max(0,a.left)+8,s=Math.min(Qe.value,a.right)-8,c=Math.max(0,a.top)+8,l=Math.min($e.value,a.bottom)-8,u=Math.min(e,Math.max(0,(s-o)/i)),d=Math.max(0,(l-c)/i),f=Math.max(o,Math.min(r.left+n.left*i,s-u*i)),p=Math.max(c,Math.min(r.top+n.top*i,l-Math.min(t,d)*i));return{left:`${(f-r.left)/i}px`,top:`${(p-r.top)/i}px`,width:`${u}px`,maxHeight:`${d}px`}}function fo(e,t,n){if(!j.value)return{};let r=j.value.getBoundingClientRect(),i=za.value||1,a=io(),o=Math.max(0,a.left)+8,s=Math.min(Qe.value,a.right)-8,c=Math.max(0,a.top)+8,l=Math.min($e.value,a.bottom)-8,u=Math.min(t,Math.max(0,(s-o)/i)),d=Math.max(0,(l-c)/i),f=Math.min(n,d),p=e.right+xD*i,m=p+u*i<=s?p:e.left-(u+xD)*i,h=Math.max(o,Math.min(m,s-u*i)),g=Math.max(c,Math.min(e.top,l-f*i));return{left:`${(h-r.left)/i}px`,top:`${(g-r.top)/i}px`,width:`${u}px`,maxHeight:`${d}px`}}let po=(0,t.computed)(()=>{if(dt.value,q.value)return uo(264,460);let e=Ue.value?.getBoundingClientRect();return e?fo(e,264,400):{}}),mo=(0,t.computed)(()=>{let e=Xr.value;return e?{left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${e.height}px`,"--norio-office-rich-block-drag-ghost-scale":String(e.scale),"--norio-office-rich-block-drag-ghost-source-width":`${e.sourceWidth}px`,"--norio-office-rich-block-drag-ghost-source-height":`${e.sourceHeight}px`}:{}}),ho=(0,t.computed)(()=>(W.value?.getText()??``).replace(/\s+/g,``).length),go=(0,t.computed)(()=>{let e=W.value?.getText()??``;return Math.max(1,e.split(/\n+/).filter(Boolean).length)}),J=(0,t.computed)(()=>{if(Xt.value,!W.value)return`正文`;for(let e of Qt)if(e.level&&W.value.isActive(`heading`,{level:e.level}))return`标题 ${e.level}`;return`正文`}),_o=(0,t.computed)(()=>(Xt.value,W.value?.isActive(`superscript`)?{icon:`shangbiao`,text:``}:W.value?.isActive(`subscript`)?{icon:`xiabiao`,text:``}:{icon:``,text:`AV`})),vo=(0,t.computed)(()=>{Xt.value;let e=W.value?.getAttributes(`textStyle`).fontSize;return e?Xn.find(t=>t.value===e)?.label??e.replace(`px`,``):`小四`}),yo=(0,t.computed)(()=>{Xt.value;let e=W.value?.getAttributes(`textStyle`).fontFamily;return e?Zn.find(t=>t.value===e)?.label??`默认`:`默认`}),bo=(0,t.computed)(()=>(Xt.value,W.value?.isActive(`heading`)?W.value.getAttributes(`heading`).textAlign||`left`:W.value?.getAttributes(`paragraph`).textAlign||`left`)),xo=(0,t.computed)(()=>(Xt.value,W.value?.getAttributes(`textStyle`).color||`#333333`)),So=(0,t.computed)(()=>(Xt.value,W.value?.getAttributes(`textStyle`).backgroundColor||`#FFF3C4`)),Co=(0,t.computed)(()=>W.value?.getAttributes(`blockquote`).quoteBorderColor||gr[0]),wo=(0,t.computed)(()=>W.value?.getAttributes(`blockquote`).quoteBackgroundColor||_r[0]),To=(0,t.computed)(()=>{if(Xt.value,!W.value?.isActive(`table`))return{isCellSelection:!1,isRowSelection:!1,isColumnSelection:!1};let e=W.value.state.selection,t=e instanceof s.CellSelection;return{isCellSelection:t,isRowSelection:t&&e.isRowSelection(),isColumnSelection:t&&e.isColSelection()}}),Eo=(0,t.computed)(()=>{if(Xt.value,!W.value?.isActive(`table`))return null;try{return(0,s.selectionCell)(W.value.state).nodeAfter?.attrs.backgroundColor||null}catch{return null}}),Do=(0,t.computed)(()=>(Xt.value,Ql(W.value?.getAttributes(`table`).tableTheme))),Oo=(0,t.computed)(()=>{Xt.value;let e=Wr.value,t=e===null?null:W.value?.state.doc.nodeAt(e);return t?.type.name===`table`?Ql(t.attrs.tableTheme):null}),ko=(0,t.computed)(()=>{if(Xt.value,dt.value,P.value!==`table-theme`||!Ne.value||!j.value)return{};let e=Ne.value.getBoundingClientRect(),t=j.value.getBoundingClientRect(),n=io(),r=Math.max(0,n.left)+8,i=Math.min(Qe.value,n.right)-8,a=Math.max(0,n.top)+8,o=Math.min($e.value,n.bottom)-8,s=za.value||1,c=Math.min(360,(i-r)/s),l=Math.max(120,(o-a)/s),u=Math.min(ut.value,l),d=e.right+8*s,f=d+c*s<=i?d:e.left-(c+8)*s,p=Math.max(r,Math.min(f,i-c*s)),m=Math.max(a,Math.min(e.top,o-u*s));return{left:`${(p-t.left)/s}px`,top:`${(m-t.top)/s}px`,width:`${c}px`,maxHeight:`${l}px`}}),Ao=(0,t.computed)(()=>{if(Xt.value,dt.value,!lt.value||!Me.value)return{};let e=Me.value.getBoundingClientRect(),t=io(),n={left:Math.max(0,t.left),right:Math.min(Qe.value,t.right),top:Math.max(0,t.top),bottom:Math.min($e.value,t.bottom)},r=za.value||1,i=Math.min(360,(n.right-n.left-16)/r),a=Math.max(120,(n.bottom-n.top-16)/r),o=Math.min(ut.value,a),s=e.bottom+8*r,c=s+o*r<=n.bottom-8?s:e.top-(o+8)*r,l=Math.max(n.top+8,Math.min(c,n.bottom-8-o*r));return{left:`${(Math.max(n.left+8,Math.min(e.left,n.right-8-i*r))-e.left)/r}px`,top:`${(l-e.top)/r}px`,width:`${i}px`,maxHeight:`${a}px`}}),jo=(0,t.computed)(()=>{Xt.value;let e=Gr.value,t=e===null?null:W.value?.state.doc.nodeAt(e),n=t?.type.name===`highlightBlock`?t.attrs:{};return{borderColor:String(n.borderColor??vD),backgroundColor:String(n.backgroundColor??yD),emojiEnabled:n.emojiEnabled!==!1}}),Mo=(0,t.computed)(()=>{Xt.value;let e=Pr.value,t=e&&W.value?.state.doc.nodeAt(e.pos),n={text:null,background:null},r=!1;return t?.descendants(e=>{if(!e.isText||r)return;let t=e.marks.find(e=>e.type.name===`textStyle`);n.text=t?.attrs.color??null,n.background=t?.attrs.backgroundColor??null,r=!0}),n}),No=(0,t.computed)(()=>{let e=Ka.value;return e?Bc(e):[]}),Po=(0,t.computed)(()=>{let e=No.value.map(({node:e})=>e.attrs.textAlign||`left`);return e.every(t=>t===e[0])?e[0]||`left`:``}),Fo=(0,t.computed)(()=>No.value.some(({node:e})=>Number(e.attrs.indent??0)<8)),Io=(0,t.computed)(()=>No.value.some(({node:e})=>Number(e.attrs.indent??0)>0)),Lo=(0,t.computed)(()=>Cp(Ka.value?.node.attrs.lineStyle)),Ro=(0,t.computed)(()=>wp(Ka.value?.node.attrs.lineColor)??`#dfe5ee`),zo=(0,t.computed)(()=>{let e=W.value?.getAttributes(`countdownBlock`)??{};return{mode:e.mode===`duration`?`duration`:`deadline`,targetTimestamp:Number(e.targetTimestamp??0)||0}});function Bo(e){Xt.value;try{return!!W.value&&e(W.value)}catch{return!1}}function Vo(e){Xt.value;try{return e()}catch{return!1}}let Ho=(0,t.computed)(()=>!!W.value&&Vo(()=>W.value.can().chain().focus().mergeCells().run())),Uo=(0,t.computed)(()=>!!W.value&&Vo(()=>W.value.can().chain().focus().splitCell().run())),Wo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().undo().run())),Go=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().redo().run())),Ko=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().unsetAllMarks().clearNodes().run())),qo=(0,t.computed)(()=>(Xt.value,ni.value&&u.showComments&&!!W.value&&ei.value&&!!pi.value)),Jo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setParagraph().run())||Bo(e=>e.can().chain().focus().toggleHeading({level:1}).run())),Yo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setFontFamily(Zn[1]?.value??``).run())||Bo(e=>e.can().chain().focus().unsetFontFamily().run())),Xo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setFontSize(Xn[0]?.value??`16px`).run())),Zo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setColor(`#333333`).run())),Qo=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setBackgroundColor(`#FFF3C4`).run())),$o=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleBold().run())),es=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleItalic().run())),ts=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleUnderline().run())),ns=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleStrike().run())),rs=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleSuperscript().run())||Bo(e=>e.can().chain().focus().toggleSubscript().run())),is=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleBulletList().run())),as=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleOrderedList().run())),os=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleTaskList().run())),ss=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().setTextAlign(`left`).run())||Bo(e=>e.can().chain().focus().setTextAlign(`center`).run())||Bo(e=>e.can().chain().focus().setTextAlign(`right`).run())),cs=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().decreaseIndent().run())),ls=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().increaseIndent().run())),us=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleBlockquote().run())),ds=(0,t.computed)(()=>us.value||!!W.value?.isActive(`blockquote`)),fs=(0,t.computed)(()=>Bo(e=>e.can().chain().focus().toggleCode().run())),ps=(0,t.computed)(()=>{Xt.value;let e=e=>!!W.value?.isActive(e),t=t=>{let n=t?!!W.value?.isActive(`heading`,{level:t}):e(`paragraph`)&&![`bulletList`,`orderedList`,`taskList`,`blockquote`,`highlightBlock`].some(e);return{key:t?`heading-${t}`:`paragraph`,label:t?`${[`一`,`二`,`三`,`四`,`五`,`六`][t-1]}级标题`:`正文`,text:t?`H${t}`:`T`,active:n,disabled:!n&&!Uf(t),run:()=>mf(t)}},n=[t(),t(1),t(2),t(3),{key:`other-headings`,label:`其他标题`,text:`Hn`,active:[4,5,6].some(e=>!!W.value?.isActive(`heading`,{level:e})),options:[t(4),t(5),t(6)]},{key:`orderedList`,label:`有序列表`,icon:`youxuliebiao`,active:e(`orderedList`),disabled:!as.value,run:Ff},{key:`bulletList`,label:`无序列表`,icon:`wuxuliebiao`,active:e(`bulletList`),disabled:!is.value,run:Pf},{key:`taskList`,label:`任务`,icon:`To-do`,active:e(`taskList`),disabled:!os.value,run:If}];u_(`code-block`,ur.value)&&n.push({key:`codeBlock`,label:`代码块`,icon:`codeblock`,active:e(`codeBlock`),disabled:!Bo(e=>e.can().chain().focus().toggleCodeBlock().run()),run:()=>El()?.toggleCodeBlock().run()});let r=[];Ai.value&&r.push({key:`blockquote`,label:`引用`,icon:`yinyong`,active:e(`blockquote`),disabled:!us.value,run:()=>El()?.toggleBlockquote().run()}),u_(`highlight-block`,ur.value)&&r.push({key:`highlightBlock`,label:`高亮块`,icon:`gaoliangkuai`,active:e(`highlightBlock`),disabled:!Bo(e=>e.can().chain().focus().toggleWrap(`highlightBlock`).run()),run:()=>El()?.toggleWrap(`highlightBlock`).run()}),r[0]&&(r[0].divider=!0),n.push(...r);let i=n.find(e=>e.active&&e.key!==`other-headings`);return[{key:`heading`,label:`正文和标题`,icon:i?.icon,text:i?.text||(W.value?.isActive(`heading`)?`H${W.value.getAttributes(`heading`).level}`:`T`),disabled:!n.some(e=>e.options?e.options.some(e=>!e.disabled):!e.disabled),options:n},{key:`font`,label:`字体`,text:yo.value,disabled:!Yo.value,options:Zn.map(e=>({key:e.label,label:e.label,fontFamily:e.value,active:yo.value===e.label,disabled:!Wf(e.value),run:()=>vf(e.value)}))},{key:`size`,label:`字号`,text:vo.value,disabled:!Xo.value,options:Xn.map(e=>({key:e.label,label:e.label,active:vo.value===e.label,disabled:!Gf(e.value),run:()=>xf(e.value)}))},{key:`text-color`,label:`文字颜色`,color:xo.value,defaultColor:`#333333`,recentColors:br.value,setColor:Cf,disabled:!Zo.value},{key:`background-color`,label:`文字背景颜色`,icon:`beijingse`,color:So.value,defaultColor:`#FFF3C4`,recentColors:xr.value,setColor:Tf,disabled:!Qo.value},{key:`bold`,label:`加粗`,icon:`jiacu`,active:e(`bold`),disabled:!$o.value,run:kf},{key:`italic`,label:`斜体`,icon:`xieti`,active:e(`italic`),disabled:!es.value,run:Af},{key:`underline`,label:`下划线`,icon:`xiahuaxian`,active:e(`underline`),disabled:!ts.value,run:jf},{key:`strike`,label:`删除线`,text:`S`,active:e(`strike`),disabled:!ns.value,run:Mf},{key:`script`,label:`上下标`,icon:_o.value.icon||void 0,text:_o.value.text,active:e(`superscript`)||e(`subscript`),disabled:!rs.value,options:[{key:`superscript`,label:`上标`,icon:`shangbiao`,active:e(`superscript`),disabled:!Yf(),run:Bf},{key:`subscript`,label:`下标`,icon:`xiabiao`,active:e(`subscript`),disabled:!Xf(),run:Vf}]},{key:`alignment`,label:`对齐和缩进`,icon:bo.value===`center`?`juzhongduiqi`:bo.value===`right`?`youduiqi`:`zuoduiqi`,disabled:!ss.value,options:[...[`left`,`center`,`right`].map((e,t)=>({key:e,label:[`左对齐`,`居中对齐`,`右对齐`][t],icon:[`zuoduiqi`,`juzhongduiqi`,`youduiqi`][t],active:bo.value===e,disabled:!qf(e),run:()=>Kl(e)})),{key:`indent-more`,label:`增加缩进`,icon:`yousuojin`,divider:!0,disabled:!ls.value,run:hf},{key:`indent-less`,label:`减少缩进`,icon:`zuosuojin`,disabled:!cs.value,run:gf}]},{key:`code`,label:`行内代码`,icon:`code`,active:e(`code`),disabled:!fs.value,run:Nf},{key:`clear`,label:`清除格式`,icon:`rubber`,disabled:!Ko.value,run:Hf}]}),ms=(0,t.computed)(()=>ps.value.filter(e=>![`heading`,`script`,`code`,`clear`].includes(e.key))),hs=(0,t.computed)(()=>!!W.value?.isActive(`table`)),gs=(0,t.computed)(()=>(Xt.value,W.value?.state.selection instanceof a.TextSelection&&!W.value.state.selection.empty&&W.value.isActive(`table`))),_s=(0,t.computed)(()=>To.value.isRowSelection||gs.value),vs=(0,t.computed)(()=>To.value.isColumnSelection||gs.value),ys=(0,t.computed)(()=>!!W.value?.isActive(`table`)&&(To.value.isRowSelection||To.value.isColumnSelection||To.value.isCellSelection));(0,t.computed)(()=>{let e=Hn.value;if(e)return{left:`${e.left+e.width/2}px`,top:`${e.top+e.height+12}px`}});function bs(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`image-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function xs(e,t){return{assetId:t.assetId,url:t.url,name:t.name||e.name,size:t.size??e.size,mimeType:t.mimeType||e.type||``,alt:t.alt,description:t.description}}function Ss(e){E.value?.(e),d(`upload-error`,e)}function Cs(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`upload-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function ws(e){return e instanceof Error&&e.message?e.message:`上传失败,请重试。`}function Ts(e){return e===`image`?`图片`:e===`video`?`视频`:`文件`}function Es(e){return`${Ts(e.kind)}${e.status===`uploading`?`上传中`:`上传失败`}`}function Ds(e){kt.value=kt.value.filter(t=>t.id!==e)}function Os(e,t){kt.value=kt.value.map(n=>n.id===e?{...n,...t}:n)}async function ks(e,t,n,r){let i=Cs(),a={id:i,kind:e,fileName:t,status:`uploading`,retry:()=>void 0},o=async()=>{Os(i,{status:`uploading`,message:void 0});try{let e=await n();return Ds(i),e}catch(e){return Os(i,{status:`error`,message:ws(e)}),r(e),null}};return a.retry=()=>{o()},kt.value=[a,...kt.value],await o()}async function As(e,t){let n=t===`image`?f.value:t===`video`?C.value:w.value;if(n)return xs(e,await n({file:e,kind:t}));throw Error(`Missing upload${t[0].toUpperCase()}${t.slice(1)} hook.`)}function js(e){let t=e,n=t.detail;n?.file&&n.kind&&(t.stopPropagation(),n.handled=!0,As(n.file,n.kind).then(n.resolve,n.reject))}function Ms(){if(!j.value)return null;let e=j.value.cloneNode(!0);return e.querySelectorAll(`.norio-office-rich-image-block__image-link[data-image-link]`).forEach(e=>{let t=document.createElement(`a`);t.className=e.className,t.href=e.dataset.imageLink??``,t.target=e.dataset.imageLinkTarget===`_self`?`_self`:`_blank`,t.rel=`noreferrer noopener`,t.append(...Array.from(e.childNodes)),e.replaceWith(t)}),e.querySelectorAll(`.norio-office-rich-image-block__caption-desc`).forEach(e=>{e.removeAttribute(`hidden`),e.textContent||e.closest(`.norio-office-rich-image-block__caption`)?.remove()}),e.style.transform=`none`,e.style.transformOrigin=`top left`,e.style.boxShadow=`none`,e.style.margin=`0`,e.style.width=`${lD}px`,e.style.minHeight=`${Math.max(j.value.scrollHeight,uD)}px`,e.style.height=`auto`,e.querySelectorAll(`.norio-office-rich-table-column-track,.norio-office-rich-table-row-track,.norio-office-rich-table-add-row,.norio-office-rich-table-add-column,.norio-office-rich-columns__overlay,.norio-office-rich-table-bubble-menu,.norio-office-rich-countdown-bubble-menu,.norio-office-rich-code-block__toolbar,.norio-office-rich-code-block__menu,.norio-office-rich-code-block__settings-menu,.norio-office-rich-code-block__line-numbers,.norio-office-rich-image-block__toolbar,.norio-office-rich-video-block__toolbar,.norio-office-rich-link-block__toolbar,.norio-office-rich-local-file-block__actions,.norio-office-rich-countdown-block__actions,.norio-office-rich-block-side-control,.norio-office-rich-block-side-menu,.norio-office-rich-block-side-submenu,.norio-office-rich-drag-insert-indicator,.norio-office-rich-upload-panel,.column-resize-handle,.ProseMirror-gapcursor,.norio-office-rich-video-block,[data-type="video-block"],.norio-office-rich-formula-editor,.norio-office-rich-marquee-selection-layer,.collaboration-carets__caret,.collaboration-carets__label,[aria-hidden="true"],button,input,textarea,select`.split(`,`).join(`, `)).forEach(e=>{e.remove()}),e.querySelectorAll(`[contenteditable]`).forEach(e=>{e.removeAttribute(`contenteditable`),e.removeAttribute(`tabindex`),e.removeAttribute(`spellcheck`),e.removeAttribute(`autocapitalize`),e.removeAttribute(`autocorrect`),e.removeAttribute(`data-placeholder`)}),e.querySelectorAll(`.ProseMirror-selectednode`).forEach(e=>{e.classList.remove(`ProseMirror-selectednode`)}),e.querySelectorAll(`.norio-office-rich-formula-block--selected`).forEach(e=>{e.classList.remove(`norio-office-rich-formula-block--selected`)}),e.querySelectorAll(`.collaboration-carets__selection`).forEach(e=>{e.classList.remove(`collaboration-carets__selection`),e.removeAttribute(`data-user`),e.removeAttribute(`style`)}),e}async function Ns(){let e=Ms();if(!e)return null;let n=document.createElement(`div`);n.style.position=`fixed`,n.style.left=`-20000px`,n.style.top=`0`,n.style.padding=`0`,n.style.margin=`0`,n.style.background=`#ffffff`,n.style.zIndex=`-1`,n.appendChild(e),document.body.appendChild(n);try{await(0,t.nextTick)();let{default:n}=await Promise.resolve().then(()=>se(Yb(),1));return await n(e,{backgroundColor:`#ffffff`,scale:2,useCORS:!0,logging:!1,width:lD,height:e.scrollHeight,windowWidth:lD,windowHeight:e.scrollHeight})}finally{n.remove()}}function Ps(e,t,n){return new Promise(r=>{e.toBlob(e=>r(e),t,n)})}async function Fs(e={}){let t=await Ns();return t?await Ps(t,e.type===`image/jpeg`?`image/jpeg`:`image/png`,typeof e.quality==`number`?Math.max(0,Math.min(1,e.quality)):void 0):null}function Is(e){return Number(e.toFixed(2)).toString()}function Ls(e){return Array.from(e||` `).map(e=>{let t=e.codePointAt(0)??32;return(t<=65535?t:9633).toString(16).padStart(4,`0`).toUpperCase()}).join(``)}function Rs(e){return Array.from(e||` `).map(e=>(e.codePointAt(0)??32)&255).map(e=>e.toString(16).padStart(2,`0`).toUpperCase()).join(``)}function zs(e){if(!e)return null;let t=e.trim().toLowerCase();if(!t||t===`transparent`)return null;let n=t.match(/^rgba?\(([^)]+)\)$/);if(n){let e=n[1].split(`,`).map(e=>e.trim());return(e[3]===void 0?1:Number(e[3]))<=0?null:{r:Math.max(0,Math.min(255,Number.parseFloat(e[0])||0))/255,g:Math.max(0,Math.min(255,Number.parseFloat(e[1])||0))/255,b:Math.max(0,Math.min(255,Number.parseFloat(e[2])||0))/255}}let r=t.startsWith(`#`)?t.slice(1):t;return/^[0-9a-f]{3}$/i.test(r)?{r:Number.parseInt(r[0]+r[0],16)/255,g:Number.parseInt(r[1]+r[1],16)/255,b:Number.parseInt(r[2]+r[2],16)/255}:/^[0-9a-f]{6}$/i.test(r)?{r:Number.parseInt(r.slice(0,2),16)/255,g:Number.parseInt(r.slice(2,4),16)/255,b:Number.parseInt(r.slice(4,6),16)/255}:null}function Bs(e){let t=window.getComputedStyle(e);return t.display!==`none`&&t.visibility!==`hidden`&&Number(t.opacity||`1`)>0}function Vs(e){let t=zs(e);return t?!(t.r>.995&&t.g>.995&&t.b>.995):!1}function Hs(e){let t=e.getBoundingClientRect(),n=lD,r=Math.max(e.scrollHeight,uD),i=[{commands:[]}],a=()=>i[i.length-1],o=e=>e-t.left,s=e=>e-t.top,c=(e,t,n,i,o={})=>{if(n<=0||i<=0)return;let s=zs(o.fill);s&&a().commands.push(`q ${Is(s.r)} ${Is(s.g)} ${Is(s.b)} rg ${Is(e)} ${Is(r-t-i)} ${Is(n)} ${Is(i)} re f Q`);let c=zs(o.stroke);c&&a().commands.push(`q ${Is(c.r)} ${Is(c.g)} ${Is(c.b)} RG ${Is(e)} ${Is(r-t-i)} ${Is(n)} ${Is(i)} re S Q`)},l=(e,t,n,i,o)=>{if(!e)return;let s=zs(o)??{r:15/255,g:23/255,b:42/255},c=Array.from(e).every(e=>(e.codePointAt(0)??0)<=255),l=c?`F2`:`F1`,u=c?Rs(e):Ls(e);a().commands.push(`BT /${l} ${Is(i)} Tf ${Is(s.r)} ${Is(s.g)} ${Is(s.b)} rg ${Is(t)} ${Is(r-n)} Td <${u}> Tj ET`)};e.querySelectorAll(`*`).forEach(e=>{if(!Bs(e))return;let t=window.getComputedStyle(e),n=e.getBoundingClientRect(),r=o(n.left),i=s(n.top),a=t.backgroundColor,l=t.borderColor,u=[`Top`,`Right`,`Bottom`,`Left`].some(e=>Number.parseFloat(t[`border${e}Width`])>0);(Vs(a)||u)&&c(r,i,n.width,n.height,{fill:Vs(a)?a:null,stroke:u?l:null})});let u=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){if(!(e.textContent??``).trim())return NodeFilter.FILTER_REJECT;let t=e.parentElement;return!t||!Bs(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),d=document.createRange();for(;u.nextNode();){let e=u.currentNode,t=e.textContent??``,n=e.parentElement;if(!n)continue;let r=window.getComputedStyle(n),i=Number.parseFloat(r.fontSize||`14`)||14,a=Number.parseFloat(r.lineHeight||``),c=Number.isFinite(a)?a:i*1.4,f=r.color||`#0f172a`,p=``,m=0,h=0,g=0,_=0,v=()=>{p.trim()&&l(p,m,g,i,f),p=``};Array.from(t).forEach((t,n)=>{if(!t.trim()){v();return}d.setStart(e,n),d.setEnd(e,n+t.length);let r=d.getBoundingClientRect();if(r.width<=0||r.height<=0){v();return}let a=o(r.left),l=s(r.top),u=l+Math.min(c,r.height)*.82,f=p&&Math.abs(l-h)<2&&Math.abs(a-_)<Math.max(i*.8,8),y=!p||Array.from(p).every(e=>(e.codePointAt(0)??0)<=255)===(t.codePointAt(0)??0)<=255;(!f||!y)&&(v(),m=a,h=l,g=u),p||(m=a,h=l,g=u),p+=t,_=o(r.right)}),v()}d.detach();let f=[],p=(e=``)=>(f.push(e),f.length),m=(e,t)=>{f[e-1]=t},h=p(),g=p(`<< /Type /Font /Subtype /Type0 /BaseFont /STSong-Light /Encoding /UniGB-UCS2-H /DescendantFonts [${p(`<< /Type /Font /Subtype /CIDFontType0 /BaseFont /STSong-Light /FontDescriptor ${p(`<< /Type /FontDescriptor /FontName /STSong-Light /Flags 6 /FontBBox [0 -200 1000 900] /Ascent 880 /Descent -120 /CapHeight 880 /StemV 80 /ItalicAngle 0 >>`)} 0 R /DW 1000 /CIDSystemInfo << /Registry (Adobe) /Ordering (GB1) /Supplement 2 >> >>`)} 0 R] >>`),_=p(`<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>`),v=i.map(e=>{let t=e.commands.join(`
8103
8125
  `),i=p(`<< /Length ${t.length} >>\nstream\n${t}\nendstream`);return p(`<< /Type /Page /Parent ${h} 0 R /MediaBox [0 0 ${Is(n)} ${Is(r)}] /Resources << /Font << /F1 ${g} 0 R /F2 ${_} 0 R >> >> /Contents ${i} 0 R >>`)});m(h,`<< /Type /Pages /Kids [${v.map(e=>`${e} 0 R`).join(` `)}] /Count ${v.length} >>`);let y=p(`<< /Type /Catalog /Pages ${h} 0 R >>`),b=`%PDF-1.4
8104
8126
  `,x=[0];f.forEach((e,t)=>{x[t+1]=b.length,b+=`${t+1} 0 obj\n${e}\nendobj\n`});let S=b.length;b+=`xref\n0 ${f.length+1}\n`,b+=`0000000000 65535 f
8105
8127
  `;for(let e=1;e<=f.length;e+=1)b+=`${String(x[e]).padStart(10,`0`)} 00000 n \n`;return b+=`trailer\n<< /Size ${f.length+1} /Root ${y} 0 R >>\nstartxref\n${S}\n%%EOF`,new Blob([b],{type:`application/pdf`})}async function Us(){let e=Ms();if(!e)return null;let n=document.createElement(`div`);n.style.position=`fixed`,n.style.left=`-20000px`,n.style.top=`0`,n.style.padding=`0`,n.style.margin=`0`,n.style.background=`#ffffff`,n.style.zIndex=`-1`,n.appendChild(e),document.body.appendChild(n);try{return await(0,t.nextTick)(),Hs(e)}finally{n.remove()}}function Ws(e){return`<!doctype html>
@@ -8138,4 +8160,4 @@ body {
8138
8160
  ${e}
8139
8161
  </div>
8140
8162
  </body>
8141
- </html>`}function Gs(){let e=Ms();return e?Ws(e.outerHTML):null}function Ks(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}T${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`}function qs(){let e=new Date;return e.setSeconds(0,0),e.setMinutes(e.getMinutes()+1),Ks(e)}function Js(e,t){let n=new Date(e),r=`${String(n.getHours()).padStart(2,`0`)}:${String(n.getMinutes()).padStart(2,`0`)}`,[i,a]=String(t||r).split(`:`);n.setHours(Xs(i,23),Xs(a,59),0,0);let o=Mn.value;n.getTime()<o.getTime()&&n.setTime(o.getTime()),fn.value=Ks(n),bn.value=n.getFullYear(),xn.value=n.getMonth(),Sn.value=`${String(n.getHours()).padStart(2,`0`)}:${String(n.getMinutes()).padStart(2,`0`)}`}function Ys(){dn.value=`deadline`,_n.value=!1,vn.value=!1,Js(new Date(qs())),pn.value=`0`,mn.value=`0`,hn.value=`1`,gn.value=`0`}function Xs(e,t){let n=Number.parseInt(e||`0`,10);return!Number.isFinite(n)||n<0?0:typeof t==`number`?Math.min(t,n):n}function Zs(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;pn.value=String(n),mn.value=String(r),hn.value=String(i),gn.value=String(a)}function Qs(e){let t=Number(e.targetTimestamp??0)||Date.now()+6e4,n=e.mode===`duration`?`duration`:`deadline`;dn.value=n,Js(new Date(t)),Zs(Math.max(1e3,t-Date.now())),_n.value=!1}function $s(e,t,n){let r=new Date(e,t,n);new Date(e,t,n,23,59,59,999).getTime()<Mn.value.getTime()||Js(r,Sn.value)}function ec(){Js(new Date,Nn.value)}function Y(e){bn.value=Number.parseInt(e,10)||new Date().getFullYear()}function tc(e){xn.value=Number.parseInt(e,10)||0}function nc(e){Js(An.value??new Date,e)}function rc(){nc(Sn.value),_n.value=!1}function ic(){if(!W.value?.isActive(`countdownBlock`))return;let e=!vn.value;vn.value=e,_n.value=!1,e&&Qs(zo.value)}function ac(){if(!Se.value){yn.value=`bottom`;return}let e=Se.value.getBoundingClientRect(),t=Ce.value?.offsetHeight??420,n=window.innerHeight-e.bottom-16,r=e.top-16;yn.value=n>=t||n>=r?`bottom`:`top`}function oc(){dn.value===`deadline`&&(_n.value=!_n.value,_n.value&&(0,t.nextTick)(ac))}function sc(){if(!W.value)return null;let{state:e}=W.value,{$from:t}=e.selection,n=t.depth;if(n<=0)return{from:e.selection.from,to:e.selection.from,isEmpty:!1};let r=t.node(n),i=r.isTextblock&&r.textContent.trim().length===0;return{from:t.before(n),to:i?t.after(n):t.before(n),isEmpty:i}}function cc(){qe.value=document.fullscreenElement===ne.value,qe.value||(Je.value=!1)}async function lc(){Je.value=!1,document.fullscreenElement===ne.value&&await document.exitFullscreen()}function uc(e){Zt.value=Math.max(50,Math.min(200,e))}function dc(){ai.value&&(Ye.value=!Ye.value,(0,t.nextTick)(()=>{window.requestAnimationFrame(()=>{(Ye.value?ne.value?.querySelector(`.norio-office-rich-outline--internal .norio-office-rich-outline__collapse`):Xe.value)?.focus({preventScroll:!0})})}))}function fc(e){return W.value?(W.value.chain().focus(e+1).run(),Ia(),(0,t.nextTick)(()=>{let t=W.value?.view.nodeDOM(e),n=Od();t instanceof HTMLElement&&n&&kd(t,n)}),!0):!1}function pc(){jr.value=[]}function mc(){Or.value=null,kr.value=null,Ar.value=!1}function hc(e){let t=e instanceof Element?e:null;return t?!!t.closest(`button,input,textarea,select,a,.norio-office-rich-outline,.norio-office-rich-statusbar__button,.norio-office-rich-toolbar__button,.norio-office-rich-table-column-track,.norio-office-rich-table-row-track,.norio-office-rich-table-track__dot,.norio-office-rich-columns__overlay,.norio-office-rich-columns__divider-hitbox,.norio-office-rich-columns__add-button,.norio-office-rich-video-block__toolbar,.norio-office-rich-video-block__handle,.norio-office-rich-video-block__bottom-bar,.norio-office-rich-image-block__toolbar,.norio-office-rich-image-block__handle,.norio-office-rich-image-block__bottom-bar,.norio-office-rich-image-block__side-tools,.norio-office-rich-link-block__toolbar,.norio-office-rich-link-block__handle,.norio-office-rich-link-block__bottom-bar,.norio-office-rich-block-side-control,.norio-office-rich-block-side-menu,.norio-office-rich-block-side-submenu,.norio-office-rich-formula-editor`.split(`,`).join(`, `)):!1}function gc(e){let t=e instanceof Element?e:e?.parentElement??null;return t?!!t.closest([`.norio-office-rich-editor__toolbar`,`.norio-office-rich-toolbar__menu`,`.norio-office-rich-block-side-control`,`.norio-office-rich-block-side-menu`,`.norio-office-rich-block-side-submenu`].join(`, `)):!1}function _c(e,t){if(!j.value)return null;let n=j.value.getBoundingClientRect(),r=za.value||1;return{x:(e-n.left)/r,y:(t-n.top)/r}}function vc(e,t){return e.left<t.left+t.width&&e.left+e.width>t.left&&e.top<t.top+t.height&&e.top+e.height>t.top}function yc(){if(!W.value||!j.value)return[];let e=j.value.getBoundingClientRect(),t=za.value||1,n=[];return W.value.state.doc.forEach((r,i)=>{let a=W.value?.view.nodeDOM(i);if(!(a instanceof HTMLElement))return;let o=a.getBoundingClientRect();o.width<=0||o.height<=0||n.push({pos:i,from:i,to:i+r.nodeSize,node:r,dom:a,rect:{left:(o.left-e.left)/t,top:(o.top-e.top)/t,width:o.width/t,height:o.height/t}})}),n}function bc(e){let{node:t}=e,n=t.type.name,r=n===`paragraph`&&t.textContent.trim().length===0&&t.childCount===0;if(r)return{isEmpty:r,textIcon:`+`,label:`插入`};if(n===`heading`){let e=Number(t.attrs.level??1);return{isEmpty:r,textIcon:`H${e}`,label:`标题 ${e}`}}return{isEmpty:r,...{paragraph:{textIcon:`T`,label:`正文`},bulletList:{iconName:`wuxuliebiao`,label:`无序列表`},orderedList:{iconName:`youxuliebiao`,label:`有序列表`},taskList:{iconName:`To-do`,label:`任务`},blockquote:{iconName:`yinyong`,label:`引用`},codeBlock:{iconName:`codeblock`,label:`代码块`},horizontalRule:{textIcon:`—`,label:`分隔线`},imageBlock:{iconName:`image`,label:`图片`},videoBlock:{textIcon:`▶`,label:`视频`},localFileBlock:{iconName:`attachment`,label:`本地文件`},linkBlock:{iconName:`link`,label:`链接`},countdownBlock:{iconName:`days`,label:`倒计时`},highlightBlock:{iconName:`gaoliangkuai`,label:`高亮块`},formulaBlock:{textIcon:`fx`,label:`公式`},columnsBlock:{iconName:`split`,label:`分栏`},table:{textIcon:`▦`,label:`表格`}}[n]??{textIcon:`T`,label:`块`}}}function xc(e){return{...e,...bc(e)}}function Sc(e,t){let n=_c(e,t);if(!n)return null;let r=yc(),i=vl(),a=i?i.left-ED-CD-12:0,o=i?i.left+i.width+28:lD;return r.map(xc).find(e=>n.y>=e.rect.top-8&&n.y<=e.rect.top+e.rect.height+8&&n.x>=a&&n.x<=o)??null}function Cc(){Fr.value=!0,jc(),Nr.value=null}function wc(){let e=window.getSelection(),t=W.value?.view.dom;Rr.value=!!t&&!!e&&!e.isCollapsed&&!!e.anchorNode&&t.contains(e.anchorNode)&&!!e.focusNode&&t.contains(e.focusNode)}function Tc(e){ei.value&&e.target instanceof Node&&W.value?.view.dom.contains(e.target)&&(e instanceof KeyboardEvent&&!e.isComposing&&![`Enter`,`Backspace`,`Delete`,`Tab`].includes(e.key)&&(e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)||(Cc(),Ir.value=!0,Vr!==null&&clearTimeout(Vr),Vr=setTimeout(()=>{Ir.value=!1,Vr=null},300)))}function Ec(e){e.target instanceof Node&&W.value?.view.dom.contains(e.target)&&(Lr.value=!0,Tc(e))}function Dc(e){e.target instanceof Node&&W.value?.view.dom.contains(e.target)&&(Lr.value=!1,Tc(e),(0,t.nextTick)(zl))}function Oc(e){if(!ei.value||Je.value||Yr.value){Nr.value=null;return}let t=e.target;t instanceof Element&&t.closest(`.norio-office-rich-block-side-control, .norio-office-rich-block-side-menu, .norio-office-rich-block-side-submenu, .norio-office-rich-block-side-table-theme`)||(e.buttons||Ir.value||Lr.value||Or.value||Wi.value?Nr.value=null:(Fr.value=!1,wc(),Ga.value?Nr.value=null:Nr.value=Sc(e.clientX,e.clientY)))}function kc(e){let t=e.relatedTarget;t instanceof Element&&t.closest(`.norio-office-rich-block-side-control, .norio-office-rich-block-side-menu, .norio-office-rich-block-side-submenu, .norio-office-rich-block-side-table-theme`)||!Hr.value&&!P.value&&(Nr.value=null)}function Ac(e){Nr.value=e,Pr.value=e}function X(e,t){if(Ga.value)return;let n=t===`actions`&&Hr.value===t&&Pr.value?.pos===e.pos&&Ur.value;Ac(e),n||(Ur.value=t===`actions`?no.value:null),Hr.value=t,P.value=null,Wr.value=null,Gr.value=t===`actions`&&!e.node.isLeaf?e.pos:null,Kr.value=null}function jc(){Hr.value=null,Ur.value=null,P.value=null,Wr.value=null,Gr.value=null,Kr.value=null,Ue.value=null,Pr.value=null}function Mc(e,t){return t===`add-above`?{from:e.from,to:e.from}:t===`add-below`?{from:e.to,to:e.to}:e.isEmpty?{from:e.from,to:e.to}:{from:e.to,to:e.to}}function Nc(e){return e===`image`?{type:`imageBlock`,attrs:{images:[{id:bs()}],widthPercent:100}}:e===`video`?{type:`videoBlock`,attrs:{src:``,name:``,description:``,mimeType:`video/mp4`,align:`left`,widthPercent:100,height:220}}:e===`link`?{type:`linkBlock`,attrs:{title:``,url:``,displayMode:`preview`,align:`left`,widthPercent:100,height:420}}:e===`countdown`?{type:`countdownBlock`,attrs:{targetTimestamp:0,mode:`duration`,color:`#ff8b00`,reminderEnabled:!0}}:e===`emoji`?{type:`paragraph`,content:[{type:`text`,text:`😀`}]}:e===`columns`?Iu(2):e===`formula`?{type:`formulaBlock`,attrs:{latex:``}}:Lu(e)}function Pc(e){if(!W.value||!Pr.value||!Hr.value)return;let t=Pr.value,n=Mc(t,P.value===`add-above`||P.value===`add-below`?P.value:Hr.value);if(e===`table`){W.value.chain().focus().insertContentAt(n,(0,i.createTable)(W.value.schema,3,3,!1).toJSON(),{updateSelection:!0}).run(),jc(),au();return}let r=Nc(e);r?(W.value.chain().focus().insertContentAt(n,r,{updateSelection:!0}).run(),jc(),au()):jc()}function Fc(e){if(!W.value)return!1;let t=Math.min(e.from+1,Math.max(e.from,e.to-1));return W.value.chain().focus(t).run(),!0}function Ic(e){return e.node.type.name}function Lc(e){return or.has(Ic(e))}function Rc(e){return sr.has(Ic(e))}function zc(e){let t=[];return[`paragraph`,`heading`].includes(e.node.type.name)?[{pos:e.pos,node:e.node}]:(Rc(e)&&e.node.descendants((n,r)=>{if([`paragraph`,`heading`].includes(n.type.name))return t.push({pos:e.pos+1+r,node:n}),!1}),t)}function Bc(e){return cr.has(Ic(e))}function Vc(e,t){if(!W.value)return!1;let{state:n,view:r}=W.value;return r.dispatch(n.tr.setMeta(`officeBlockSideAttrs`,e.pos).setNodeMarkup(e.pos,void 0,{...e.node.attrs,...t})),!0}function Hc(e){let t=Gr.value,n=Pr.value,r=t===null?null:W.value?.state.doc.nodeAt(t);return!ei.value||!W.value?.isEditable||!n||t===null||r?.type.name!==`highlightBlock`?!1:Vc({...n,pos:t,node:r},e)}let Uc=(0,t.computed)(()=>{let e=P.value;if(!$t.includes(e??``))return null;let t=e===`quote-border`||e===`quote-background`,n=e===`highlight-border`||e===`quote-border`,r=t?n?`quoteBorderColor`:`quoteBackgroundColor`:n?`borderColor`:`backgroundColor`,i=t?(n?gr[0]:_r[0]).toLowerCase():n?vD:yD,a=Pr.value?.node;return{nodeType:t?`blockquote`:`highlightBlock`,attribute:r,kind:n?`border`:`fill`,label:n?`边框颜色`:t?`背景颜色`:`填充颜色`,color:String(a?.attrs[r]??i),defaultColor:i,presetColors:t?n?vr:yr:void 0}});function Wc(e){let t=Uc.value,n=Gr.value,r=Pr.value,i=n===null?null:W.value?.state.doc.nodeAt(n);t&&ei.value&&W.value?.isEditable&&r&&n!==null&&i?.type.name===t.nodeType&&Vc({...r,pos:n,node:i},{[t.attribute]:e})&&e!==`transparent`&&(br.value=[e,...br.value.filter(t=>t.toLowerCase()!==e.toLowerCase())].slice(0,10))}function Gc(){Hc({emojiEnabled:!jo.value.emojiEnabled})}function Kc(e){let t=Pr.value,n=t&&W.value?.state.doc.nodeAt(t.pos);ei.value&&t&&n?.type.name===`horizontalRule`&&(Vc({...t,node:n},e),Ac({...t,node:W.value.state.doc.nodeAt(t.pos)}))}function qc(e){let t=wp(e);t&&(Kc({lineColor:t===`#dfe5ee`?null:t}),br.value=[t,...br.value.filter(e=>e.toLowerCase()!==t)].slice(0,10))}function Jc(e){let t=Pr.value;if(W.value&&t&&qa.value.some(t=>t.action===e)){if(Fc(t),e===`paragraph`)W.value.chain().focus().setParagraph().run();else if(e.startsWith(`heading-`)){let t=Number(e.replace(`heading-`,``));W.value.chain().focus().toggleHeading({level:t}).run()}else e===`bullet-list`?W.value.chain().focus().toggleBulletList().run():e===`ordered-list`?W.value.chain().focus().toggleOrderedList().run():e===`task-list`&&W.value.chain().focus().toggleTaskList().run();jc(),au()}}function Yc(e){let t=Pr.value,n=t&&W.value?.state.doc.nodeAt(t.pos);if(!ei.value||!W.value?.isEditable||!t||!n||!Rc(t))return;let r=e.startsWith(`align-`)?e.slice(6):void 0;if(r!==void 0&&![`left`,`center`,`right`].includes(r)||r===void 0&&e!==`indent-more`&&e!==`indent-less`)return;let i=W.value.state.tr.setMeta(`officeBlockSideAttrs`,t.pos);for(let a of zc({...t,node:n})){let t={...a.node.attrs};r===void 0?t.indent=Math.max(0,Math.min(8,Number(t.indent??0)+(e===`indent-more`?1:-1))):t.textAlign=r,(t.textAlign!==a.node.attrs.textAlign||t.indent!==a.node.attrs.indent)&&i.setNodeMarkup(a.pos,void 0,t)}i.docChanged&&W.value.view.dispatch(i)}function Xc(e){let t=Pr.value;if(!ei.value||!W.value?.isEditable||!t||!Bc(t))return;let{state:n,view:r}=W.value,i=n.doc.nodeAt(t.pos),a=n.schema.marks.textStyle;if(!i||i.type.name!==t.node.type.name||!a)return;let o=n.tr;n.doc.nodesBetween(t.pos+1,t.pos+i.nodeSize-1,(t,n)=>{if(!t.isText)return;let r={...t.marks.find(e=>e.type===a)?.attrs,...e};Object.values(r).some(e=>e!=null&&e!==``)?o.addMark(n,n+t.nodeSize,a.create(r)):o.removeMark(n,n+t.nodeSize,a)}),o.docChanged&&r.dispatch(o)}function Zc(e,t){if((e===`text`||e===`background`)&&(Xc(e===`text`?{color:t}:{backgroundColor:t}),t)){let n=e===`text`?br:xr;n.value=[t,...n.value.filter(e=>e.toLowerCase()!==t.toLowerCase())].slice(0,10)}}function Qc(){Xc({color:null,backgroundColor:null})}function $c(e,t){Ue.value=t,Kr.value=e}function el(e){let t=Kr.value;t===`border`||t===`fill`?Wc(e??`transparent`):t&&Zc(t,e)}let tl=(0,t.computed)(()=>{let e=Kr.value,t=Uc.value;return(e===`border`||e===`fill`)&&t?{label:`自定义${t.label}选择`,color:t.color,defaultColor:t.defaultColor,recentColors:br.value}:{label:e===`text`?`自定义文字颜色选择`:`自定义背景颜色选择`,color:e===`text`?Mo.value.text:Mo.value.background,defaultColor:e===`text`?`#273142`:`#FFFFFF`,recentColors:e===`text`?br.value:xr.value}});function nl(e){return rl(new o.Slice(o.Fragment.from(e.node),0,0))}function rl(e){if(!W.value)return null;let t=W.value.view.serializeForClipboard(e);return{json:t.slice.openStart===0&&t.slice.openEnd===0?t.slice.content.toJSON():void 0,html:t.dom.innerHTML,text:t.text}}function il(e,t){return e.clipboardData?(e.clipboardData.clearData(),e.clipboardData.setData(`text/html`,t.html),e.clipboardData.setData(`text/plain`,t.text),t.json?.length&&e.clipboardData.setData(hD,JSON.stringify(t.json)),e.preventDefault(),e.stopPropagation(),qr.value=t,!0):!1}async function al(e){if(!W.value)return!1;let t=nl(e);qr.value=t;let n={payload:t,written:!1};Jr=n;try{W.value.view.focus(),document.execCommand(`copy`)||(n.written=!1)}catch{}finally{Jr=null}if(n.written)return!0;try{return!navigator.clipboard?.write||typeof ClipboardItem>`u`?!1:(await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t.html],{type:`text/html`}),"text/plain":new Blob([t.text],{type:`text/plain`})})]),!0)}catch{return!1}}async function ol(e){if(!W.value||!ei.value)return;let t=W.value.state.doc;await al(e)&&W.value?.state.doc===t&&ll(e)}async function sl(){try{if(navigator.clipboard?.read){let e=await navigator.clipboard.read();for(let t of e){let e=t.types.includes(`text/html`)?await(await t.getType(`text/html`)).text():``,n=t.types.includes(`text/plain`)?await(await t.getType(`text/plain`)).text():``;if(e||n)return{html:e,text:n}}return null}if(navigator.clipboard?.readText){let e=await navigator.clipboard.readText();return e?{html:``,text:e}:null}}catch{}return qr.value}async function cl(e){if(!W.value||!ei.value)return;let t=W.value.state.doc,n=await sl();if(!n||!W.value||W.value.state.doc!==t)return;let r=n.json?.length?n.json:n.html||n.text.split(/\r\n?|\n/).map(e=>({type:`paragraph`,content:e?[{type:`text`,text:e}]:[]}));W.value.chain().focus().insertContentAt({from:e.to,to:e.to},r,{updateSelection:!0}).run(),jc()}function ll(e){W.value&&ei.value&&(W.value.chain().focus().deleteRange({from:e.from,to:e.to}).run(),jc(),Nr.value=null)}function ul(e,t){if(!W.value||!ei.value||Je.value)return;e.preventDefault(),e.stopPropagation(),Ac(t),Hr.value=null,P.value=null,Gr.value=null,Kr.value=null,Yr.value={from:t.from,to:t.to,content:t.node.toJSON()};let n=t.dom.getBoundingClientRect(),r=Math.min(1,DD/Math.max(n.width,1),OD/Math.max(n.height,1)),i=(e.clientX-n.left)*r,a=(e.clientY-n.top)*r;Xr.value={html:t.dom.outerHTML,left:e.clientX-i,top:e.clientY-a,width:n.width*r,height:n.height*r,sourceWidth:n.width,sourceHeight:n.height,scale:r,offsetX:i,offsetY:a};let o=e=>{Xr.value&&={...Xr.value,left:e.clientX-Xr.value.offsetX,top:e.clientY-Xr.value.offsetY};let t=yl(e.clientX,e.clientY);t?Mr.value=t:Mr.value=null},s=e=>{document.removeEventListener(`mousemove`,o),document.removeEventListener(`mouseup`,s);let t=Yr.value,n=Mr.value??yl(e.clientX,e.clientY);if(Mr.value=null,Yr.value=null,Xr.value=null,!t||!n||n.range.from>=t.from&&n.range.from<=t.to)return;let r=n.range.from;r>t.from&&(r-=t.to-t.from),W.value?.chain().focus().deleteRange({from:t.from,to:t.to}).insertContentAt(r,t.content,{updateSelection:!0}).run(),jc(),Nr.value=null};document.addEventListener(`mousemove`,o),document.addEventListener(`mouseup`,s),o(e)}function dl(e){return e.type.startsWith(`image/`)}function fl(e){return e.type.startsWith(`video/`)}function pl(e){return!dl(e)&&!fl(e)}function ml(e){return e?Array.from(e.items??[]).some(e=>e.kind===`file`)?!0:Array.from(e.files??[]).length>0:!1}function hl(e){return e?Array.from(e.files??[]).filter(dl).slice(0,4):[]}function gl(e){return e?Array.from(e.files??[]).find(fl)??null:null}function _l(e){return e?Array.from(e.files??[]).filter(pl):[]}function vl(){if(!j.value)return null;let e=j.value.getBoundingClientRect(),t=j.value.querySelector(`.norio-office-rich-prosemirror`),n=t?.getBoundingClientRect(),r=za.value||1,i=t?getComputedStyle(t):null,a=Number.parseFloat(i?.paddingLeft??`0`)||0,o=Number.parseFloat(i?.paddingRight??`0`)||0;return n?{left:(n.left-e.left+a)/r,width:Math.max((n.width-a-o)/r,320)}:{left:98,width:864}}function yl(e,t){if(!W.value||!j.value)return null;let n=_c(e,t),r=vl();if(!n||!r)return null;let i=yc();if(!i.length){let i=W.value.view.posAtCoords({left:e,top:t})?.pos??W.value.state.doc.content.size;return{left:r.left,top:Math.max(52,n.y),width:r.width,range:{from:i,to:i}}}for(let e of i){let t=e.rect.top+e.rect.height/2;if(n.y<t)return{left:r.left,top:e.rect.top,width:r.width,range:{from:e.from,to:e.from}}}let a=i[i.length-1];return{left:r.left,top:a.rect.top+a.rect.height,width:r.width,range:{from:a.to,to:a.to}}}function bl(e){if(!ei.value||Je.value||W.value?.view.dragging||!ml(e.dataTransfer))return Mr.value=null,!1;let t=yl(e.clientX,e.clientY);return t?(e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),Mr.value=t,!0):(Mr.value=null,!1)}function xl(){if(!Ar.value||!Hi.value)return;let e=yc().filter(e=>vc(e.rect,Hi.value)).map(e=>e.pos);jr.value=e}function Sl(){if(!W.value)return null;let e=o.Fragment.fromArray(Ui.value.map(e=>e.node));return rl(new o.Slice(e,0,0))}function Cl(){if(!W.value)return null;if(Ui.value.length){let e=[...Ui.value].sort((e,t)=>e.from-t.from);return{from:e[0].from,to:e[e.length-1].to}}let e=W.value.state.selection;return{from:e.from,to:e.to}}function wl(){if(!W.value||!Ui.value.length)return null;let e=[...Ui.value].sort((e,t)=>e.from-t.from),t=Math.max(0,Math.min(W.value.state.doc.content.size,e[0].from+1)),n=Math.max(t,Math.min(W.value.state.doc.content.size,e[e.length-1].to-1));return t<n?{from:t,to:n}:null}function Tl(){let e=W.value?.chain().focus(),t=wl();return e&&t?e.setTextSelection(t):e}function El(e){if(!W.value||!ei.value||!e.length)return!1;let t=Cl();if(!t)return!1;let n=W.value.chain().focus().insertContentAt(t,e,{updateSelection:!0}).run();return n&&pc(),n}function Dl(){if(!W.value||!ei.value||!Ui.value.length)return;let e=Ui.value.map(e=>({from:e.from,to:e.to})).sort((e,t)=>t.from-e.from),t=W.value.chain().focus();e.forEach(e=>{t=t.deleteRange(e)}),t.run(),pc()}function Ol(e){if(!ei.value||Je.value||e.button!==0||!j.value||!j.value.contains(e.target)||(e.target instanceof Node&&W.value?.view.dom.contains(e.target)&&Cc(),hc(e.target)))return;mc(),pc();let t=W.value?.view.dom;if(!t)return;let n=j.value.getBoundingClientRect(),r=t.getBoundingClientRect(),i=getComputedStyle(t),a=t.offsetWidth>0?r.width/t.offsetWidth:za.value||1,o=r.left+(Number.parseFloat(i.paddingLeft)||0)*a,s=r.right-(Number.parseFloat(i.paddingRight)||0)*a;!(e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom)||e.clientX>=o&&e.clientX<=s||(e.preventDefault(),Or.value={x:e.clientX,y:e.clientY},kr.value={x:e.clientX,y:e.clientY})}function kl(e){bl(e)}function Al(e){bl(e)}function jl(e){if(!j.value||!Mr.value)return;let t=j.value.getBoundingClientRect();e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom||(Mr.value=null)}async function Ml(e){if(!W.value||!ei.value||Je.value||W.value.view.dragging||!ml(e.dataTransfer)){Mr.value=null;return}e.preventDefault(),e.stopPropagation();let t=gl(e.dataTransfer),n=hl(e.dataTransfer),r=_l(e.dataTransfer),i=Mr.value??yl(e.clientX,e.clientY);Mr.value=null,(t||n.length||r.length)&&i&&(t?await ks(`video`,t.name,async()=>{let e=await As(t,`video`);return W.value?.chain().focus().insertContentAt(i.range,{type:`videoBlock`,attrs:{assetId:e.assetId||``,src:e.url,name:e.name,description:e.description||``,mimeType:e.mimeType||`video/mp4`,align:`left`,widthPercent:100,height:220}},{updateSelection:!0}).run(),!0},e=>Ss({kind:`video`,fileName:t.name,error:e})):(n.length&&await ks(`image`,n.length>1?`${n[0]?.name||`图片`} 等 ${n.length} 张图片`:n[0]?.name||`图片`,async()=>{let e=await Promise.all(n.map(async e=>{let t=await As(e,`image`);return{assetId:t.assetId,src:t.url,alt:t.alt||t.name,name:t.name,description:t.description||``,link:``,rotation:0}}));return W.value?.chain().focus().insertContentAt(i.range,{type:`imageBlock`,attrs:{images:e.map(Yu),widthPercent:100,align:`left`,height:146}},{updateSelection:!0}).run(),!0},e=>Ss({kind:`image`,fileName:n[0]?.name||``,error:e})),r.length&&await ks(`file`,r.length>1?`${r[0]?.name||`文件`} 等 ${r.length} 个文件`:r[0]?.name||`文件`,async()=>{let e=await Promise.all(r.map(async e=>{let t=await As(e,`file`);return{assetId:t.assetId,url:t.url,name:t.name,size:t.size,mimeType:t.mimeType}})),t=W.value?.state.selection.from??i.range.from,a=n.length?{from:t,to:t}:i.range;return W.value?.chain().focus().insertContentAt(a,e.map(e=>({type:`localFileBlock`,attrs:{assetId:e.assetId||``,url:e.url,name:e.name,size:Math.max(0,Number(e.size??0)||0),mimeType:e.mimeType||``}})),{updateSelection:!0}).run()&&e.forEach(e=>d(`local-file-upload`,e)),!0},e=>Ss({kind:`file`,fileName:r[0]?.name||``,error:e}))))}function Nl(){Or.value&&(!Ar.value&&!jr.value.length||xl(),mc())}function Pl(){Oi.value&&(et.value=!et.value,et.value||(nn.value=null,cn.value=0,ln.value=0,un.value=0),Ys(),ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function Fl(){if(!W.value||!ei.value||Lr.value||!W.value.isFocused)return null;let e=W.value.state.selection;if(!(e instanceof a.TextSelection)||!e.empty||e.$from.parent.type.name!==`paragraph`)return null;let{$from:t}=e;if(t.parentOffset!==t.parent.content.size)return null;let n=t.parent.textContent,r=/^\/([^\s/]*)$/.exec(n);return r?{from:t.start(),to:e.from,query:r[1]}:null}function Il(e=!1){e&&nt.value&&(it.value=`${nt.value.from}:${tt.value}`),tt.value=null,nt.value=null,at.value=0}function Ll(){if(!Ti.value||!W.value)return;let e=W.value.view.coordsAtPos(nt.value.to),t=Math.min(250,window.innerWidth-16),n=Math.min(680,(fe.value?.scrollHeight??678)+2,window.innerHeight-16),r=e.bottom+8+n<=window.innerHeight-8;ot.value={left:Math.max(8,Math.min(e.left,window.innerWidth-t-8)),top:Math.max(8,Math.min(r?e.bottom+8:e.top-n-8,window.innerHeight-n-8)),maxHeight:n}}function zl(){let e=Fl();e?it.value===`${e.from}:${e.query}`?Il():((tt.value!==e.query||nt.value?.from!==e.from)&&(at.value=0),tt.value=e.query,nt.value={from:e.from,to:e.to},(0,t.nextTick)(Ll)):(it.value=null,Il())}function Bl(e){let t=Fl();t&&nt.value&&t.from===nt.value.from&&t.to===nt.value.to&&(Il(),W.value?.chain().focus().deleteRange({from:t.from,to:t.to}).run(),e.action===`table`?Tu(3,3):e.action===`columns`?zu(2):e.action===`emoji`?rt.value=!0:lf(e.action))}function Vl(e){rt.value=!1,Ru(e)}function Hl(e){if(rt.value&&e.key===`Escape`)return e.preventDefault(),e.stopPropagation(),rt.value=!1,!0;if(!Ti.value||!W.value?.view.dom.contains(e.target))return!1;if(e.key===`Escape`)return e.preventDefault(),e.stopPropagation(),Il(!0),!0;let t=xi.value;return(e.key===`ArrowDown`||e.key===`ArrowUp`)&&t.length?(e.preventDefault(),e.stopPropagation(),at.value=(at.value+(e.key===`ArrowDown`?1:-1)+t.length)%t.length,fe.value?.querySelectorAll(`[role="option"]`)[at.value]?.scrollIntoView({block:`nearest`}),!0):(e.key===`Enter`||e.key===`Tab`)&&t[at.value]?(e.preventDefault(),e.stopPropagation(),Bl(t[at.value]),!0):!1}function Ul(e){Hl(e)||Tc(e)}function Wl(){ss.value&&(st.value=!st.value,et.value=!1)}function Gl(e){Tl()?.setTextAlign(e).run(),st.value=!1}function Kl(e){nn.value=e,e!==`table`&&(cn.value=0,ln.value=0),e!==`columns`&&(un.value=0),e!==`countdown`&&(_n.value=!1),e===`countdown`&&!fn.value&&Ys()}function ql(e,t){cn.value=e,ln.value=t}function Jl(){cn.value=0,ln.value=0}function Yl(e){un.value=e}function Zl(){un.value=0}function $l(e){if(e instanceof HTMLElement){ye.value=e;return}let t=e&&`$el`in e?e.$el:null;ye.value=t instanceof HTMLElement?t:null}function eu(e){let t=e.target;xe.value=t instanceof HTMLElement?t.scrollTop:0}function tu(e,t){return(e instanceof Element?e:e?.parentElement??null)?.closest(t)??null}function nu(){ap?.(),ap=null,zn.value?.classList.remove(`norio-office-rich-table-wrapper--active`),Ln.value=null,zn.value=null,Hn.value=null,Un.value=[],Gn.value=[],Kn.value=[],qn.value=[],Jn.value=null,Yn.value=null}function ru(){if(!W.value?.isActive(`countdownBlock`)){Bn.value=null,Vn.value=null,vn.value=!1;return}let e=W.value.state.selection;if(e instanceof a.NodeSelection&&e.node.type.name===`countdownBlock`){let t=W.value.view.nodeDOM(e.from);Bn.value=t instanceof HTMLElement?t:null,Vn.value=e.from}else Bn.value=tu(window.getSelection()?.anchorNode??null,`.norio-office-rich-countdown-block`),Vn.value=null}function iu(){if(!W.value?.isActive(`table`)||!j.value){nu();return}let e=W.value.state.selection,t=e instanceof a.NodeSelection&&e.node.type.name===`table`?e.from:null;for(let n=e.$from.depth;t===null&&n>0;--n)e.$from.node(n).type.name===`table`&&(t=e.$from.before(n));let n=t===null?null:W.value.view.nodeDOM(t),r=n instanceof HTMLTableElement?n:n instanceof Element?n.querySelector(`table`):null,i=r?.closest(`.tableWrapper`);if(!r||!i){nu();return}if(zn.value&&zn.value!==i&&zn.value.classList.remove(`norio-office-rich-table-wrapper--active`),zn.value!==i){ap?.();let e=()=>{au()};i.addEventListener(`scroll`,e,{passive:!0}),ap=()=>{i.removeEventListener(`scroll`,e)}}i.classList.add(`norio-office-rich-table-wrapper--active`),Ln.value=r,zn.value=i;let o=j.value.getBoundingClientRect(),s=i.getBoundingClientRect(),c=za.value||1;Hn.value={left:(s.left-o.left)/c,top:(s.top-o.top)/c,width:s.width/c,height:s.height/c};let l=r.rows.item(0),u=[],d=[];if(l){let e=Array.from(l.cells).map((e,t)=>{let n=e.getBoundingClientRect(),r=Math.max(n.left,s.left),i=Math.min(n.right,s.right)-r;return i<8?null:{index:t,left:(r-o.left)/c,width:i/c,rawLeft:n.left,rawRight:n.right}}).filter(e=>!!e);u.push(...e.map(e=>({index:e.index,left:e.left,width:e.width}))),e.forEach((t,n)=>{t.rawLeft>=s.left-.5&&d.push({key:`column-before-${t.index}`,insertIndex:t.index,left:(t.rawLeft-o.left)/c}),n===e.length-1&&t.rawRight<=s.right+.5&&d.push({key:`column-after-${t.index}`,insertIndex:t.index+1,left:(t.rawRight-o.left)/c})})}let f=[],p=[],m=Array.from(r.rows).map((e,t)=>{let n=(e.cells.item(0)??e).getBoundingClientRect(),r=Math.max(n.top,s.top),i=Math.min(n.bottom,s.bottom)-r;return i<8?null:{index:t,top:(r-o.top)/c,height:i/c,rawTop:n.top,rawBottom:n.bottom}}).filter(e=>!!e);f.push(...m.map(e=>({index:e.index,top:e.top,height:e.height}))),m.forEach((e,t)=>{e.rawTop>=s.top-.5&&p.push({key:`row-before-${e.index}`,insertIndex:e.index,top:(e.rawTop-o.top)/c}),t===m.length-1&&e.rawBottom<=s.bottom+.5&&p.push({key:`row-after-${e.index}`,insertIndex:e.index+1,top:(e.rawBottom-o.top)/c})}),Un.value=u,Gn.value=f,Kn.value=d,qn.value=p}function au(){(0,t.nextTick)(()=>{iu(),ru()})}function ou(){return!1}function su(){return Ln.value?{getBoundingClientRect:()=>Ln.value.getBoundingClientRect(),contextElement:Ln.value}:null}function cu(){return Bn.value?{getBoundingClientRect:()=>Bn.value.getBoundingClientRect(),contextElement:Bn.value}:null}function fu(){lt.value=!1,ct.value=!ct.value}function pu(){ct.value=!1,lt.value=!lt.value}function mu(){(Hr.value||lt.value||[`table-theme`,`properties`,`color`,`divider-style`,`divider-color`,`highlight-settings`,...$t].includes(P.value??``))&&(dt.value+=1)}function hu(){let e=Ka.value;W.value?.isEditable&&e?.node.type.name===`table`&&(Ac(e),Wr.value=e.from,P.value=`table-theme`,lt.value=!1,ct.value=!1)}function gu(e){Wr.value!==null&&yu(Wr.value,e)}function _u(){P.value=null,Wr.value=null}function vu(e){if(!W.value?.isEditable)return;let t=W.value.state.selection,n=t instanceof a.NodeSelection&&t.node.type.name===`table`?{node:t.node,pos:t.from,start:t.from+1}:(0,s.findTable)(t.$from);n&&yu(n.pos,e)}function yu(e,t){if(!W.value?.isEditable)return;let n=W.value.state.doc.nodeAt(e);if(n?.type.name!==`table`)return;let r=Ql(t),i=W.value.state.tr.setNodeMarkup(e,void 0,{...n.attrs,tableTheme:r});n.forEach((t,n)=>{t.forEach((t,r)=>{t.attrs.backgroundColor&&i.setNodeMarkup(e+n+r+2,void 0,{...t.attrs,backgroundColor:null})})}),W.value.view.dispatch(i),au()}function bu(e){W.value&&(W.value.chain().focus().setCellAttribute(`backgroundColor`,e).run(),ct.value=!1,au())}function xu(e){if(!W.value||!Ln.value)return;let t=(0,s.findTable)(W.value.state.selection.$from);if(!t)return;let n=s.TableMap.get(t.node);if(e<0||e>=n.width)return;let r=t.start+n.positionAt(0,e,t.node),i=t.start+n.positionAt(n.height-1,e,t.node),a=W.value.state.doc.resolve(r),o=W.value.state.doc.resolve(i),c=s.CellSelection.colSelection(a,o);W.value.view.dispatch(W.value.state.tr.setSelection(c).scrollIntoView()),Jn.value=e,Yn.value=null,au()}function Su(e){if(!W.value||!Ln.value)return;let t=(0,s.findTable)(W.value.state.selection.$from);if(!t)return;let n=s.TableMap.get(t.node);if(e<0||e>=n.height)return;let r=t.start+n.positionAt(e,0,t.node),i=t.start+n.positionAt(e,n.width-1,t.node),a=W.value.state.doc.resolve(r),o=W.value.state.doc.resolve(i),c=s.CellSelection.rowSelection(a,o);W.value.view.dispatch(W.value.state.tr.setSelection(c).scrollIntoView()),Yn.value=e,Jn.value=null,au()}function Cu(e){if(!W.value||!Ln.value)return;let t=Ln.value.rows.item(0),n=t?Array.from(t.cells):[];if(n.length!==0){if(e<=0){let e=n[0],t=W.value.view.posAtDOM(e,0)+1;W.value.chain().focus(t).addColumnBefore().run()}else{let t=n[Math.min(e-1,n.length-1)],r=W.value.view.posAtDOM(t,0)+1;W.value.chain().focus(r).addColumnAfter().run()}Jn.value=null,Yn.value=null,au()}}function wu(e){if(!W.value||!Ln.value)return;let t=Array.from(Ln.value.rows);if(t.length!==0){if(e<=0){let e=t[0].cells.item(0);if(!e)return;let n=W.value.view.posAtDOM(e,0)+1;W.value.chain().focus(n).addRowBefore().run()}else{let n=t[Math.min(e-1,t.length-1)].cells.item(0);if(!n)return;let r=W.value.view.posAtDOM(n,0)+1;W.value.chain().focus(r).addRowAfter().run()}Jn.value=null,Yn.value=null,au()}}function Tu(e,t){if(!W.value)return;let n=sc();n?(W.value.chain().focus().deleteRange(n).insertTable({rows:e,cols:t,withHeaderRow:!1}).run(),et.value=!1,nn.value=null,Jl(),au()):(et.value=!1,nn.value=null,Jl())}function Eu(){_s.value&&(W.value?.chain().focus().addRowBefore().run(),au())}function Du(){_s.value&&(W.value?.chain().focus().addRowAfter().run(),au())}function Ou(){vs.value&&(W.value?.chain().focus().addColumnBefore().run(),au())}function ku(){vs.value&&(W.value?.chain().focus().addColumnAfter().run(),au())}function Au(){W.value?.chain().focus().deleteRow().run(),au()}function ju(){W.value?.chain().focus().deleteColumn().run(),au()}function Mu(){W.value?.chain().focus().mergeCells().run(),au()}function Nu(){W.value?.chain().focus().splitCell().run(),au()}function Pu(){if(!W.value)return;let e=W.value.state.selection,t=W.value.state.tr;if(e instanceof s.CellSelection){let n=[];e.forEachCell((e,t)=>{n.push({pos:t,node:e})});for(let e=n.length-1;e>=0;--e){let r=n[e];if(!r.node)continue;let i=r.node.type.createAndFill(r.node.attrs);i&&t.replaceWith(r.pos,r.pos+r.node.nodeSize,i)}W.value.view.dispatch(t.scrollIntoView()),au()}else try{let e=(0,s.selectionCell)(W.value.state),t=e.nodeAfter;if(!t)return;let n=t.type.createAndFill(t.attrs);if(!n)return;let r=W.value.state.tr.replaceWith(e.pos,e.pos+t.nodeSize,n);W.value.view.dispatch(r.scrollIntoView()),au()}catch{}}function Fu(){W.value&&ys.value&&(To.value.isRowSelection?Au():To.value.isColumnSelection?ju():Pu())}function Iu(e){return{type:`columnsBlock`,attrs:{widths:Array.from({length:e},()=>100/e)},content:Array.from({length:e},()=>({type:`columnsColumn`,content:[{type:`paragraph`}]}))}}function Lu(e){switch(e){case`paragraph`:return{type:`paragraph`};case`heading-1`:return{type:`heading`,attrs:{level:1}};case`heading-2`:return{type:`heading`,attrs:{level:2}};case`heading-3`:return{type:`heading`,attrs:{level:3}};case`heading-4`:return{type:`heading`,attrs:{level:4}};case`heading-5`:return{type:`heading`,attrs:{level:5}};case`heading-6`:return{type:`heading`,attrs:{level:6}};case`bullet-list`:return{type:`bulletList`,content:[{type:`listItem`,content:[{type:`paragraph`}]}]};case`ordered-list`:return{type:`orderedList`,content:[{type:`listItem`,content:[{type:`paragraph`}]}]};case`task-list`:return{type:`taskList`,content:[{type:`taskItem`,attrs:{checked:!1},content:[{type:`paragraph`}]}]};case`code-block`:return{type:`codeBlock`,attrs:{language:`plain_text`,wrapLines:!1,darkTheme:!1,fixedHeight:!1}};case`highlight-block`:return{type:`highlightBlock`,attrs:{titleEnabled:!0,emojiEnabled:!0,title:`高亮块`,emoji:`✍️`},content:[{type:`paragraph`}]};case`blockquote`:return{type:`blockquote`,content:[{type:`paragraph`}]};case`divider`:return[{type:`horizontalRule`},{type:`paragraph`}];default:return null}}function Ru(e){W.value&&(W.value.chain().focus().insertContent(e).run(),et.value=!1,yt.value=!1,nn.value=null,Jl())}function zu(e){if(!W.value)return;let t=sc();t?(W.value.chain().focus().insertContentAt({from:t.from,to:t.to},Iu(e),{updateSelection:!0}).run(),et.value=!1,nn.value=null,Jl(),Zl()):(et.value=!1,nn.value=null,Jl(),Zl())}function Bu(){if(!W.value)return;let e=sc();e?(W.value.chain().focus().insertContentAt({from:e.from,to:e.to},{type:`countdownBlock`,attrs:{targetTimestamp:0,mode:`duration`,color:`#ff8b00`,reminderEnabled:!0}},{updateSelection:!0}).run(),et.value=!1,nn.value=null,Ys()):(et.value=!1,nn.value=null,Ys())}function Vu(){if(dn.value===`deadline`)return new Date(fn.value).getTime();let e=Xs(pn.value),t=Xs(mn.value,23),n=Xs(hn.value,59),r=Xs(gn.value,59);return Date.now()+(((e*24+t)*60+n)*60+r)*1e3}function Hu(){if(!W.value||Vn.value===null)return;let e=Vu();!Number.isFinite(e)||e<=Date.now()||(W.value.chain().focus().setNodeSelection(Vn.value).updateAttributes(`countdownBlock`,{targetTimestamp:Math.floor(e),mode:dn.value}).run(),_n.value=!1,vn.value=!1,au())}function Uu(){if(!W.value||Vn.value===null)return;let e=W.value.state.doc.nodeAt(Vn.value);e&&e.type.name===`countdownBlock`&&(W.value.chain().focus().deleteRange({from:Vn.value,to:Vn.value+e.nodeSize}).run(),_n.value=!1,vn.value=!1,Bn.value=null,Vn.value=null)}function Wu(){rn.value=!1,on.value=``}function Gu(){pe.value&&(pe.value.value=``,pe.value.click())}async function Ku(e){if(!W.value)return;let t=e.target,n=t.files?.[0];if(!n)return;let r=await n.text();if(!r.trim()){t.value=``;return}let i=ly(r),{$from:a}=W.value.state.selection,o=a.depth>0?a.node(1):null,s=o?a.before(1):W.value.state.selection.from,c=o?.isTextblock&&!o.textContent.trim()?a.after(1):s;W.value.chain().focus().insertContentAt({from:s,to:c},i,{updateSelection:!0}).run(),et.value=!1,nn.value=null,Jl(),t.value=``}function qu(e){if(!W.value)return;let t=sc();t?(W.value.chain().focus().insertContentAt({from:t.from,to:t.to},{type:`formulaBlock`,attrs:{latex:e}},{updateSelection:!0}).run(),Wu(),et.value=!1,nn.value=null,Jl()):(Wu(),et.value=!1,nn.value=null,Jl())}function Ju(e){if(!W.value)return!1;let t=sc();return t?(W.value.chain().focus().insertContentAt({from:t.from,to:t.to},e,{updateSelection:!0}).run(),!0):!1}function Yu(e){return{id:bs(),assetId:e.assetId,src:e.src,alt:e.alt||e.name||``,name:e.name||e.alt||``,description:e.description||``,descriptionVisible:e.descriptionVisible,link:e.link||``,linkTarget:e.linkTarget,rotation:Number(e.rotation??0)||0}}function Xu(e){let t=(Array.isArray(e)?e:[e]).filter(e=>e?.src).slice(0,4);return t.length?Ju({type:`imageBlock`,attrs:{images:t.map(Yu),widthPercent:100,align:`left`,height:146}}):!1}function Zu(e){return e.src?Ju({type:`videoBlock`,attrs:{assetId:e.assetId||``,src:e.src,name:e.name||``,description:e.description||``,mimeType:e.mimeType||`video/mp4`,align:e.align||`left`,widthPercent:Math.max(30,Math.min(100,Number(e.widthPercent??100)||100)),height:Math.max(180,Math.min(640,Number(e.height??220)||220))}}):!1}function Qu(e){if(!e.url||!e.name)return!1;let t=e.displayMode===`card`||e.displayMode===`preview`?e.displayMode:`text`;return Ju({type:`linkBlock`,attrs:{title:e.name,url:e.url,displayMode:t,align:e.align||`left`,widthPercent:Math.max(30,Math.min(100,Number(e.widthPercent??100)||100)),height:Math.max(240,Math.min(860,Number(e.height??420)||420))}})}function $u(e){return!e.url||!e.name?!1:Ju({type:`localFileBlock`,attrs:{assetId:e.assetId||``,url:e.url,name:e.name,size:Math.max(0,Number(e.size??0)||0),mimeType:e.mimeType||``}})}function ed(e){return typeof crypto<`u`&&`randomUUID`in crypto?`${e}-${crypto.randomUUID()}`:`${e}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function td(){return pi.value}function nd(e){return(e?.name||e?.id||`?`).slice(0,2).toUpperCase()}function rd(e){return{backgroundColor:e?.color||`#4c7dff`}}function id(e){if(!e)return``;let t=new Date(e);if(Number.isNaN(t.getTime()))return``;let n=Date.now()-t.getTime(),r=6e4,i=60*r;return n<r?`刚刚`:n<i?`${Math.max(1,Math.floor(n/r))} 分钟前`:n<864e5?`${Math.floor(n/i)} 小时前`:t.toLocaleDateString()}function ad(e,t){return t?`${e}:${t}`:e}function od(e,t){return jt.value[ad(e,t)]??``}function sd(e,t,n){let r=ad(e,n);jt.value={...jt.value,[r]:t}}function cd(e,t,n){let r=t.target;sd(e,r?.value??``,n),Ea(r,{mode:`draft`,threadId:e,parentId:n})}function ld(e,t,n){G(t)?(t.preventDefault(),t.stopPropagation()):(t.ctrlKey||t.metaKey)&&t.key===`Enter`&&(t.preventDefault(),Ld(e,n))}function ud(e,t){return Mt.value[ad(e,t)]??[]}function dd(e,t,n){let r=ad(e,n);Mt.value={...Mt.value,[r]:t}}function fd(e,t){let n=ad(e,t),{[n]:r,...i}=jt.value,{[n]:a,...o}=Mt.value,{[n]:s,...c}=Nt.value;jt.value=i,Mt.value=o,Nt.value=c}function pd(e){return e.comments.filter(e=>!e.parentId)}function md(e,t){let n=[],r=t=>{e.comments.filter(e=>e.parentId===t).forEach(e=>{n.push(e),r(e.id)})};return r(t.id),n}function hd(e,t){return t?e.comments.find(e=>e.id===t)??null:null}function gd(e){return Bt.value[e]??null}function _d(e){return hd(e,gd(e.id)??void 0)}function vd(e,t){let n=gd(e.id);return n?n===t.id||md(e,t).some(e=>e.id===n):!1}function yd(e,t){Bt.value={...Bt.value,[e.id]:t.id},At.value=e.id}function bd(e,t){let{[e]:n,...r}=Bt.value;Bt.value=r,fd(e,t)}function xd(e){return e.anchorText?.trim()||`已标注内容`}function Sd(){if(!W.value)return null;let e=W.value.state.selection;if(!e.empty&&!(e instanceof s.CellSelection))return{from:e.from,to:e.to};let t=sc();return t&&t.to>t.from?t:null}function Cd(e){return W.value&&W.value.state.doc.textBetween(e.from,e.to,` `).replace(/\s+/g,` `).trim()||`已标注内容`}function wd(e,t){if(!W.value||!e||t.to<=t.from)return!1;let n=W.value.state.schema.marks.commentMark;if(!n)return!1;let r=W.value.state.tr,i=!1,a=n.create({threadId:e});return W.value.state.doc.nodesBetween(t.from,t.to,(e,n)=>{if(!e.isText||!e.textContent.trim())return;let o=Math.max(n,t.from),s=Math.min(n+e.nodeSize,t.to);s<=o||(r=r.addMark(o,s,a),i=!0)}),i?(W.value.view.dispatch(r.scrollIntoView()),W.value.commands.focus(),!0):!1}function Td(e){if(!W.value||!e)return!1;let t=W.value.state.schema.marks.commentMark;if(!t)return!1;let n=W.value.state.tr,r=!1;return W.value.state.doc.descendants((i,a)=>{i.isText&&i.marks.some(n=>n.type===t&&n.attrs.threadId===e)&&(n=n.removeMark(a,a+i.nodeSize,t),r=!0)}),r&&W.value.view.dispatch(n),r}function Ed(e,t){t instanceof HTMLElement?Vt.set(e,t):Vt.delete(e)}function Dd(){return ce.value?.querySelector(`.norio-office-rich-comment-panel__scroll`)??null}function Od(){return ne.value?.querySelector(`.norio-office-rich-editor__scroll`)??null}function kd(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top-r.top,a=Math.max(12,(r.height-n.height)/2),o=Math.max(0,t.scrollTop+i-a);t.scrollTo({top:o,behavior:`smooth`})}function Ad(e){let t=j.value?.querySelectorAll(`[data-comment-thread-id]`)??[];return Array.from(t).find(t=>t.dataset.commentThreadId===e)??null}function jd(e){(0,t.nextTick)(()=>{let t=()=>{let t=Ad(e),n=Od();t&&n&&kd(t,n)};typeof window<`u`&&typeof window.requestAnimationFrame==`function`?(window.requestAnimationFrame(()=>window.requestAnimationFrame(t)),typeof window.setTimeout==`function`&&window.setTimeout(t,120)):t()})}function Md(e){(0,t.nextTick)(()=>{let t=Vt.get(e),n=Dd();t&&n&&kd(t,n)})}function Nd(e){if(!W.value||!e)return!1;let t=W.value.state.schema.marks.commentMark;if(!t)return!1;let n=null,r=null;if(W.value.state.doc.descendants((i,a)=>{if(n!==null||!i.isText)return!1;if(i.marks.some(n=>n.type===t&&n.attrs.threadId===e))return n=a,r=a+i.nodeSize,!1}),n===null||r===null)return!1;At.value=e;let i=a.TextSelection.create(W.value.state.doc,n,r);return W.value.view.dispatch(W.value.state.tr.setSelection(i)),W.value.view.dom.focus({preventScroll:!0}),jd(e),!0}function Pd(e,t={}){At.value=e.id,t.focusEditor!==!1&&(Nd(e.id)||jd(e.id)),t.scrollCommentCard&&Md(e.id),d(`comment-select`,e)}function Fd(){let e=td();if(!W.value||!e||!qo.value)return;let t=Sd();if(!t)return;let n=ed(`comment-thread`),r=Cd(t);wd(n,t)&&(Rt.value={id:n,anchorText:r},At.value=n,sd(n,``),dd(n,[]))}function Id(e){Rt.value?.id===e&&(Td(e),Rt.value=null,At.value=mi.value[0]?.id??null),fd(e)}function Ld(e,t){let n=td(),r=od(e,t).trim(),i=ud(e,t),a=ya(r,ba(e,t)),o=mi.value.find(t=>t.id===e),s=o?hd(o,t):null;if(!n||!r&&!i.length)return;let c=new Date().toISOString();if(Rt.value?.id===e){let t=ed(`comment`),o={threadId:e,commentId:t,anchorText:Rt.value.anchorText,content:r,images:i,mentions:a,author:n,createdAt:c};d(`comment-create`,o),d(`comment-submit`,{action:`create`,threadId:e,commentId:t,content:r,images:i,mentions:a,author:n,createdAt:c}),Rt.value=null}else{let o=ed(`comment`),l={threadId:e,commentId:o,parentId:t,targetCommentId:s?.id,targetUserId:s?.author.id,targetUserName:s?.author.name,content:r,images:i,mentions:a,author:n,createdAt:c};if(d(`comment-reply`,l),d(`comment-submit`,{action:`reply`,threadId:e,commentId:o,targetCommentId:s?.id,targetUserId:s?.author.id,targetUserName:s?.author.name,content:r,images:i,mentions:a,author:n,createdAt:c}),t){let{[e]:t,...n}=Bt.value;Bt.value=n}}fd(e,t)}function Rd(e,t){Pt.value=`${e}:${t.id}`,Ft.value=t.content,It.value=t.mentions??[]}function zd(e,t){return Pt.value===`${e}:${t.id}`}function Bd(e){let t=e.target;Ft.value=t?.value??``;let[n=``,r=``]=Pt.value?.split(`:`)??[];Ea(t,{mode:`edit`,threadId:n,commentId:r})}function Vd(e,t,n){G(n)?(n.preventDefault(),n.stopPropagation()):(n.ctrlKey||n.metaKey)&&n.key===`Enter`&&(n.preventDefault(),Ud(e,t))}function Hd(){Pt.value=null,Ft.value=``,It.value=[],wa()}function Ud(e,t){let n=Ft.value.trim(),r=ya(n,It.value);if(!n)return;let i=new Date().toISOString(),a={threadId:e,commentId:t.id,content:n,images:t.images,mentions:r,author:pi.value??void 0,updatedAt:i};d(`comment-update`,a),d(`comment-submit`,{action:`update`,threadId:e,commentId:t.id,content:n,images:t.images,mentions:r,author:pi.value??void 0,updatedAt:i}),Hd()}function Wd(e,t){d(`comment-delete`,{threadId:e,commentId:t?.id}),t||Td(e)}function Gd(e){Lt.value=ad(e,gd(e)??void 0),_e.value&&(_e.value.value=``,_e.value.click())}async function Kd(e){let t=T.value??f.value;if(!t)throw Error(`Missing uploadCommentImage hook.`);return xs(e,await t({file:e,kind:`image`}))}async function qd(e){let t=e.target,n=t?.files?.[0],r=Lt.value;Lt.value=null,!n||!r?t&&(t.value=``):n.type.startsWith(`image/`)?(await ks(`image`,n.name,async()=>{let e=await Kd(n),[t=``,i]=r.split(`:`);return dd(t,[...ud(t,i),e],i),!0},e=>Ss({kind:`image`,fileName:n.name,error:e})),t&&(t.value=``)):(Ss({kind:`image`,fileName:n.name,error:Error(`Please select an image file.`)}),t&&(t.value=``))}function Jd(e,t,n){dd(e,ud(e,n).filter((e,n)=>n!==t),n)}function Yd(e){e.url&&(zt.value=e)}function Xd(){zt.value=null}function Zd(e){if(!ni.value||!u.showComments)return;let t=(e.target?.closest?.(`[data-comment-thread-id]`))?.dataset.commentThreadId;if(!t)return;let n=mi.value.find(e=>e.id===t);n?Pd(n,{focusEditor:!1,scrollCommentCard:!0}):At.value=t}function Qd(){me.value?.click()}function $d(e,t){let n=e[t];return typeof n==`string`?n:``}function ef(e,t,n=0){let r=Number(e[t]??n);return Number.isFinite(r)?r:n}function tf(){if(!W.value)return[];let e=[];return W.value.state.doc.descendants(t=>{t.type.name===`imageBlock`&&(Array.isArray(t.attrs.images)?t.attrs.images:[]).forEach(t=>{if(!t||typeof t!=`object`)return;let n=t,r=$d(n,`src`);r&&e.push({src:r,alt:$d(n,`alt`)||void 0,name:$d(n,`name`)||void 0,description:$d(n,`description`)||void 0,descriptionVisible:typeof n.descriptionVisible==`boolean`?n.descriptionVisible:void 0,link:$d(n,`link`)||void 0,linkTarget:n.linkTarget===`_self`?`_self`:`_blank`,rotation:ef(n,`rotation`,0)})})}),e}function nf(){if(!W.value)return[];let e=[];return W.value.state.doc.descendants(t=>{if(t.type.name!==`videoBlock`)return;let n=t.attrs,r=$d(n,`src`);if(!r)return;let i=$d(n,`align`);e.push({src:r,name:$d(n,`name`)||void 0,description:$d(n,`description`)||void 0,mimeType:$d(n,`mimeType`)||void 0,align:i===`center`||i===`right`?i:`left`,widthPercent:ef(n,`widthPercent`,100),height:ef(n,`height`,220)})}),e}function rf(){if(!W.value)return[];let e=[];return W.value.state.doc.descendants(t=>{let n=t.attrs;if(t.type.name===`linkBlock`){let t=$d(n,`url`),r=$d(n,`title`);if(!t||!r)return;let i=$d(n,`displayMode`),a=$d(n,`align`);e.push({kind:`file`,url:t,name:r,displayMode:i===`card`||i===`preview`?i:`text`,align:a===`center`||a===`right`?a:`left`,widthPercent:ef(n,`widthPercent`,100),height:ef(n,`height`,420)})}else if(t.type.name===`localFileBlock`){let t=$d(n,`url`),r=$d(n,`name`);if(!t||!r)return;e.push({kind:`local-file`,url:t,name:r,size:ef(n,`size`,0),mimeType:$d(n,`mimeType`)||void 0})}}),e}function af(e){let t=sc();et.value=!1,nn.value=null,Jl(),Ot.value=t;let n=e===`image`?he.value:ge.value;n&&(n.value=``,n.click())}async function of(e){let t=e.target,n=t?.files?.[0],r=Ot.value??sc();Ot.value=null,n?n.type.startsWith(`image/`)?(await ks(`image`,n.name,async()=>{let e=await As(n,`image`),t={type:`imageBlock`,attrs:{images:[Yu({assetId:e.assetId,src:e.url,alt:e.alt||e.name,name:e.name,description:e.description||``,link:``,rotation:0})],widthPercent:100}};return r?(W.value?.chain().focus().insertContentAt({from:r.from,to:r.to},t,{updateSelection:!0}).run(),!0):(W.value?.chain().focus().insertContent(t,{updateSelection:!0}).run(),!0)},e=>Ss({kind:`image`,fileName:n.name,error:e})),t&&(t.value=``)):(Ss({kind:`image`,fileName:n.name,error:Error(`Please select an image file.`)}),t&&(t.value=``)):t&&(t.value=``)}async function sf(e){let t=e.target,n=t?.files?.[0],r=Ot.value??sc();Ot.value=null,n?n.type.startsWith(`video/`)?(await ks(`video`,n.name,async()=>{let e=await As(n,`video`),t={type:`videoBlock`,attrs:{assetId:e.assetId||``,src:e.url,name:e.name,description:e.description||``,mimeType:e.mimeType||`video/mp4`,align:`left`,widthPercent:100,height:220}};return r?(W.value?.chain().focus().insertContentAt({from:r.from,to:r.to},t,{updateSelection:!0}).run(),!0):(W.value?.chain().focus().insertContent(t,{updateSelection:!0}).run(),!0)},e=>Ss({kind:`video`,fileName:n.name,error:e})),t&&(t.value=``)):(Ss({kind:`video`,fileName:n.name,error:Error(`Please select a video file.`)}),t&&(t.value=``)):t&&(t.value=``)}async function cf(e){let t=e.target,n=t?.files?.[0];n&&await ks(`file`,n.name,async()=>{let e=await As(n,`file`),t={assetId:e.assetId,url:e.url,name:e.name,size:e.size,mimeType:e.mimeType};return $u(t)&&d(`local-file-upload`,t),t},e=>Ss({kind:`file`,fileName:n.name,error:e})),t&&(t.value=``)}function lf(e){if(!W.value)return;if(e===`table`){Kl(`table`);return}if(e===`emoji`){Kl(`emoji`);return}if(e===`columns`){Kl(`columns`);return}if(e===`countdown`){Bu();return}if(e===`formula`){on.value=``,rn.value=!0,et.value=!1,nn.value=null,Jl();return}if(e===`markdown-import`){et.value=!1,nn.value=null,Jl(),Gu();return}if(e===`local-file`){et.value=!1,nn.value=null,Jl(),Qd();return}if(e===`image`){af(`image`);return}if(e===`video`){af(`video`);return}if(e===`link`){let e=sc();if(!e){et.value=!1;return}W.value.chain().focus().insertContentAt({from:e.from,to:e.to},{type:`linkBlock`,attrs:{title:``,url:``,displayMode:`preview`,align:`left`,widthPercent:100,height:420}},{updateSelection:!0}).run(),et.value=!1,nn.value=null,Jl();return}let t=Lu(e);if(!t){et.value=!1,nn.value=null,Jl();return}let n=sc();n?(W.value.chain().focus().insertContentAt({from:n.from,to:n.to},t,{updateSelection:!0}).run(),et.value=!1,nn.value=null,Jl()):(et.value=!1,nn.value=null,Jl())}function uf(){Tl()?.setParagraph().run()}function df(e){Tl()?.toggleHeading({level:e}).run()}function ff(){Jo.value&&(ft.value=!ft.value,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function pf(e){e?df(e):uf(),ft.value=!1}function mf(){Tl()?.increaseIndent().run()}function hf(){Tl()?.decreaseIndent().run()}function gf(){Yo.value&&(pt.value=!pt.value,ft.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function _f(e){let t=Tl();t&&(e?t.setFontFamily(e).run():t.unsetFontFamily().run(),pt.value=!1)}function vf(){rs.value&&(mt.value=!mt.value,ft.value=!1,pt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function yf(){Xo.value&&(ht.value=!ht.value,ft.value=!1,pt.value=!1,mt.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function bf(e){Tl()?.setFontSize(e).run(),ht.value=!1}function xf(){Zo.value&&(gt.value=!gt.value,ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,_t.value=!1,vt.value=!1)}function Sf(e){Tl()?.setColor(e).run(),br.value=[e,...br.value.filter(t=>t!==e)].slice(0,10)}function Cf(){Qo.value&&(_t.value=!_t.value,ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,vt.value=!1)}function wf(e){Tl()?.setBackgroundColor(e).run(),Tf(e)}function Tf(e){xr.value=[e,...xr.value.filter(t=>t.toLowerCase()!==e.toLowerCase())].slice(0,10)}function Ef(){Ai.value&&ds.value&&(vt.value=!vt.value,ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,yt.value=!1)}function Df(){ei.value&&(yt.value=!yt.value,et.value=!1,nn.value=null,ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function Of(){Tl()?.toggleBold().run()}function kf(){Tl()?.toggleItalic().run()}function Af(){Tl()?.toggleUnderline().run()}function jf(){Tl()?.toggleStrike().run()}function Mf(){Tl()?.toggleCode().run()}function Nf(){Tl()?.toggleBulletList().run()}function Pf(){Tl()?.toggleOrderedList().run()}function Ff(){Tl()?.toggleTaskList().run()}function If(){Tl()?.toggleBlockquote().run()}function Lf(e){W.value?.isActive(`blockquote`)&&W.value?.chain().focus().setQuoteStyle({quoteBorderColor:e,quoteBackgroundColor:wo.value}).run()}function Rf(e){W.value?.isActive(`blockquote`)&&W.value?.chain().focus().setQuoteStyle({quoteBorderColor:Co.value,quoteBackgroundColor:e}).run()}function zf(){Tl()?.unsetSubscript().toggleSuperscript().run(),mt.value=!1}function Bf(){Tl()?.unsetSuperscript().toggleSubscript().run(),mt.value=!1}function Vf(){Tl()?.unsetAllMarks().clearNodes().run()}function Hf(e){return Bo(e?t=>t.can().chain().focus().toggleHeading({level:e}).run():e=>e.can().chain().focus().setParagraph().run())}function Uf(e){return Bo(e?t=>t.can().chain().focus().setFontFamily(e).run():e=>e.can().chain().focus().unsetFontFamily().run())}function Wf(e){return Bo(t=>t.can().chain().focus().setFontSize(e).run())}function Gf(e){return Bo(t=>t.can().chain().focus().setTextAlign(e).run())}function qf(){return Bo(e=>e.can().chain().focus().toggleSuperscript().run())}function Yf(){return Bo(e=>e.can().chain().focus().toggleSubscript().run())}function Xf(e){let t=e.target,n=t instanceof Element?t:null;Ei.value&&!fe.value?.contains(t)&&(Il(!0),rt.value=!1),Wi.value&&!j.value?.contains(t)&&!gc(t)&&pc(),(!t||!ue.value?.contains(t))&&(et.value=!1,nn.value=null,Jl()),n?.closest(`.norio-office-rich-block-side-control, .norio-office-rich-block-side-menu, .norio-office-rich-block-side-submenu, .norio-office-rich-block-side-table-theme`)||jc(),_n.value&&t&&!Se.value?.contains(t)&&!Ce.value?.contains(t)&&!(vn.value&&we.value?.contains(t))&&!(nn.value===`countdown`&&ue.value?.contains(t))&&(_n.value=!1),vn.value&&t&&!Te.value?.contains(t)&&!we.value?.contains(t)&&(vn.value=!1),(!t||!Ee.value?.contains(t))&&(st.value=!1),(!t||!Re.value?.contains(t))&&(mt.value=!1),(!t||!Ie.value?.contains(t))&&(ft.value=!1),(!t||!Le.value?.contains(t))&&(pt.value=!1),(!t||!ze.value?.contains(t))&&(ht.value=!1),(!t||!Be.value?.contains(t))&&(gt.value=!1),(!t||!We.value?.contains(t))&&(_t.value=!1),(!t||!Ge.value?.contains(t))&&(vt.value=!1),(!t||!ve.value?.contains(t))&&(yt.value=!1),bt.value&&t&&!Ke.value?.contains(t)&&!j.value?.contains(t)&&ra(),Ht.value&&t&&!le.value?.contains(t)&&!n?.closest?.(`.norio-office-rich-comment-composer`)&&wa(),(!t||!je.value?.contains(t))&&(ct.value=!1),(!t||!Me.value?.contains(t))&&(lt.value=!1),zn.value&&n&&zn.value.contains(n)&&cp(),window.setTimeout(()=>{au()},0)}function Zf(e){if(Je.value&&(Er.value=e.clientX,Dr.value=e.clientY),Or.value){kr.value={x:e.clientX,y:e.clientY};let t=e.clientX-Or.value.x,n=e.clientY-Or.value.y;!Ar.value&&Math.abs(t)>=12&&Math.abs(n)>=12&&(Ar.value=!0,window.getSelection()?.removeAllRanges()),Ar.value&&(e.preventDefault(),xl())}if(!e.buttons)return;let t=e.target,n=t instanceof Element?t:null;zn.value&&n&&zn.value.contains(n)&&cp()}function Qf(e){if(e.key===`Escape`&&Je.value)e.preventDefault(),lc();else if(e.key===`Escape`&&Kr.value)Kr.value=null;else if(e.key===`Escape`&&[`properties`,`color`,`divider-style`,`divider-color`,`highlight-settings`,...$t].includes(P.value??``))jc();else if(e.key===`Escape`&&P.value===`table-theme`)_u();else if(e.key===`Escape`&&lt.value)lt.value=!1;else if(e.key===`Escape`&&zt.value)Xd();else if(bt.value&&fa(e))e.preventDefault();else if(Ht.value&&G(e))e.preventDefault();else if(e.key===`Escape`&&Wi.value)pc(),mc();else{if((e.ctrlKey||e.metaKey)&&Wi.value&&$f(e.target)){let t=e.key.toLowerCase();if(t===`c`||t===`x`){e.preventDefault(),document.execCommand(t===`c`?`copy`:`cut`);return}}(e.key===`Delete`||e.key===`Backspace`)&&Wi.value&&ei.value&&(e.preventDefault(),Dl())}}function $f(e){if(!W.value||!(e instanceof Node))return!1;let t=e instanceof Element?e:e.parentElement;return t?.closest(`input, textarea, select`)||t?.closest(`[contenteditable]`)?.getAttribute(`contenteditable`)===`false`?!1:W.value.view.dom.contains(e)||Wi.value&&(ne.value?.contains(e)||e===document.body)}function ep(e){if(Jr)Jr.written=il(e,Jr.payload);else if($f(e.target)){if(Wi.value){let t=Sl();t&&il(e,t)}else W.value&&!W.value.state.selection.empty&&(qr.value=rl(W.value.state.selection.content()))}}function tp(e){if($f(e.target)&&ei.value){if(Wi.value){let t=Sl();t&&il(e,t)&&Dl()}else W.value&&!W.value.state.selection.empty&&(qr.value=rl(W.value.state.selection.content()))}}function np(e){if(e&&W.value)try{let t=JSON.parse(e);if(!Array.isArray(t)||!t.length)return;for(let e of t){let t=W.value.state.schema.nodeFromJSON(e);if(!t.isBlock)return;t.check()}return t}catch{return}}function rp(e){if(!ei.value||!e.clipboardData||!$f(e.target))return;let t=e.clipboardData.getData(`text/html`),n=e.clipboardData.getData(`text/plain`),r=np(e.clipboardData.getData(hD));(t||n||r)&&(qr.value={html:t,text:n,json:r}),r&&(Wi.value||!t&&!n&&!W.value?.state.selection.$from.parent.type.spec.code)&&(e.preventDefault(),e.stopPropagation(),El(r))}(0,t.watch)(()=>ci.value?.user,e=>{W.value&&e&&ci.value?.provider&&W.value.commands.updateUser(e)},{deep:!0});let ip=null,ap=null,op=null,sp=null;function cp(){sp?.();let e=()=>{iu(),op=window.requestAnimationFrame(e)},t=()=>{sp?.(),iu()};op=window.requestAnimationFrame(e),document.addEventListener(`mouseup`,t,{once:!0}),sp=()=>{op!==null&&(window.cancelAnimationFrame(op),op=null),document.removeEventListener(`mouseup`,t),sp=null}}function lp(){if(ip?.(),ip=null,!W.value)return;let e=({transaction:e}={})=>{e?.getMeta(`textSelectionBubbleMenu`)!==`updatePosition`&&e?.getMeta(`tableBubbleMenu`)!==`updatePosition`&&(Xt.value+=1,W.value?.isActive(`table`)||(lt.value=!1),au(),Ia(),aa(),zl())},n=({transaction:e})=>{let n=Gr.value;if(n!==null&&e.docChanged){let r=Pr.value?.node.type.name,i=e.mapping.mapResult(n+1,-1),a=i.pos-1,o=a>=0?e.doc.nodeAt(a):null;i.deletedAcross||!o||o.type.name!==r?jc():(Gr.value=a,Pr.value&&Ac({...Pr.value,pos:a,from:a,to:a+o.nodeSize,node:o}),(0,t.nextTick)(()=>{if(Gr.value!==a)return;let e=yc().find(e=>e.pos===a);e&&Ac(xc(e))}))}e.docChanged&&Pr.value?.node.type.name===`horizontalRule`&&e.getMeta(`officeBlockSideAttrs`)!==Pr.value.pos&&jc();let r=Wr.value;if(P.value!==`table-theme`||r===null||!e.docChanged)return;let i=e.mapping.mapResult(r+1,-1);i.deletedAcross||i.pos<1||e.doc.nodeAt(i.pos-1)?.type.name!==`table`?jc():(Wr.value=i.pos-1,(0,t.nextTick)(()=>{if(P.value!==`table-theme`)return;let e=yc().find(e=>e.from===Wr.value);e&&Ac(xc(e))}))};W.value.on(`transaction`,n),W.value.on(`selectionUpdate`,e),W.value.on(`transaction`,e),W.value.on(`focus`,e),W.value.on(`blur`,e),ip=()=>{W.value?.off(`transaction`,n),W.value?.off(`selectionUpdate`,e),W.value?.off(`transaction`,e),W.value?.off(`focus`,e),W.value?.off(`blur`,e)},au(),Ia()}return(0,t.onMounted)(()=>{La(),document.addEventListener(`selectionchange`,wc),document.addEventListener(`fullscreenchange`,cc),document.addEventListener(`mousedown`,Xf),document.addEventListener(`mousemove`,Zf),document.addEventListener(`mouseup`,Nl),document.addEventListener(`keydown`,Qf),document.addEventListener(`copy`,ep,!0),document.addEventListener(`cut`,tp,!0),document.addEventListener(`paste`,rp,!0),window.addEventListener(`resize`,au),window.addEventListener(`resize`,ac),window.addEventListener(`resize`,ta),window.addEventListener(`resize`,Ca),window.addEventListener(`resize`,La),window.addEventListener(`resize`,Ll),window.addEventListener(`scroll`,ta,!0),window.addEventListener(`scroll`,Ca,!0),window.addEventListener(`scroll`,mu,!0),window.addEventListener(`scroll`,Ll,!0),lp(),(0,t.nextTick)(Ra)}),(0,t.onBeforeUnmount)(()=>{ie(`dispose`),ee(new Map,new Set),document.removeEventListener(`selectionchange`,wc),Vr!==null&&clearTimeout(Vr),Qa?.disconnect(),document.removeEventListener(`fullscreenchange`,cc),document.removeEventListener(`mousedown`,Xf),document.removeEventListener(`mousemove`,Zf),document.removeEventListener(`mouseup`,Nl),document.removeEventListener(`keydown`,Qf),document.removeEventListener(`copy`,ep,!0),document.removeEventListener(`cut`,tp,!0),document.removeEventListener(`paste`,rp,!0),window.removeEventListener(`resize`,au),window.removeEventListener(`resize`,ac),window.removeEventListener(`resize`,ta),window.removeEventListener(`resize`,Ca),window.removeEventListener(`resize`,La),window.removeEventListener(`resize`,Ll),window.removeEventListener(`scroll`,ta,!0),window.removeEventListener(`scroll`,Ca,!0),window.removeEventListener(`scroll`,mu,!0),window.removeEventListener(`scroll`,Ll,!0),sp?.(),ip?.(),nu()}),(0,t.watch)(ei,e=>{W.value?.setEditable(e,!1),e||(ie(`mode-changed`),Il(),rt.value=!1,jc(),Nr.value=null,mc(),pc(),ra(),ct.value=!1,lt.value=!1)},{flush:`sync`}),(0,t.watch)(ti,e=>{e||(et.value=!1,nn.value=null,st.value=!1,ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1,yt.value=!1,_n.value=!1)}),(0,t.watch)(li,e=>{e||ra()}),(0,t.watch)(ui,e=>{e||wa()}),(0,t.watch)(mi,e=>{e.length?(!At.value||!e.some(e=>e.id===At.value))&&(At.value=e[0]?.id??null):At.value=null}),(0,t.watch)(()=>u.modelValue,e=>{if(!W.value||!e||ci.value)return;let t=W.value.getJSON();JSON.stringify(t)!==JSON.stringify(e)&&(ie(`document-changed`),W.value.commands.setContent(e,{emitUpdate:!1}),Ia())}),(0,t.watch)(dn,e=>{e!==`deadline`&&(_n.value=!1)}),(0,t.watch)(_n,e=>{e&&(0,t.nextTick)(ac)}),(0,t.watch)(Sn,e=>{_n.value&&dn.value===`deadline`&&/^\d{2}:\d{2}$/.test(e)&&nc(e)}),(0,t.watch)(W,()=>{lp(),Ia(),(0,t.nextTick)(Ra)}),(0,t.watch)(za,()=>{au()}),(0,t.watch)([pr,_i,vi,yi,et,ti,Je,qe,ho,go],()=>{(0,t.nextTick)(Ra)}),c({getFileName:()=>p.value,setFileName:S,exportPdf:Us,exportImage:Fs,exportHtml:Gs,exportNordox:te,openNordox:k,getAiAdapter:()=>({getEditor:()=>W.value??null,isCollaborationConfigured:()=>!!u.collaboration,bindAiTargetControls:e=>{re.value=e},setAiTargetUiState:e=>{A.value=e},getSelectedBlocks:()=>Ui.value.map(e=>({from:e.from,to:e.to,nodeId:e.node.attrs.aiId}))}),insertImage:Xu,insertVideo:Zu,insertFile:Qu,insertLocalFile:$u,insertMention:ua,openLocalFilePicker:Qd,focus:()=>{W.value?.commands.focus()},getJSON:()=>W.value?.getJSON()??null,getText:()=>W.value?.getText()??``,getImages:tf,getVideos:nf,getFiles:rf,getOutlineItems:()=>Pa().items,getActiveOutlinePos:()=>Cr.value,focusOutlineItem:fc,onOutlineChange:e=>(wr.add(e),e(Pa()),()=>{wr.delete(e)}),focusCommentThread:Nd}),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`rootRef`,ref:ne,class:`norio-office-rich-editor`,"data-editable":ei.value,"data-mode":$r.value?`preview`:`edit`,"data-fullscreen":qe.value,"data-presentation":Je.value,"data-outline-open":ai.value&&Ye.value,"data-outline-placement":ii.value,"data-comments-enabled":ni.value,"data-comments-open":F.value,"data-drag-insert-active":!!Mr.value,onClickCapture:Zd,onNorioOfficeRichUploadRequest:js},[e.showFileHeader&&!Je.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`norio-office-rich-editor__file-header`,"aria-label":pr.value[`file.header`]},[(0,t.createVNode)(an,{name:`rich-text-document`,size:26,"background-color":`transparent`,"aria-hidden":`true`}),(0,t.createElementVNode)(`div`,Qb,[(0,t.unref)(m)?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,ref_key:`fileNameInput`,ref:_,"onUpdate:modelValue":a[0]||=e=>(0,t.isRef)(h)?h.value=e:null,class:`norio-office-rich-editor__file-name-input`,type:`text`,maxlength:`255`,"aria-label":pr.value[`file.name`],"aria-invalid":!!(0,t.unref)(g),onBlur:a[1]||=(...e)=>(0,t.unref)(y)&&(0,t.unref)(y)(...e),onKeydown:a[2]||=(...e)=>(0,t.unref)(x)&&(0,t.unref)(x)(...e),onInput:a[3]||=e=>g.value=``},null,40,$b)),[[t.vModelText,(0,t.unref)(h)]]):$r.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,class:`norio-office-rich-editor__file-name`,title:(0,t.unref)(p)},(0,t.toDisplayString)((0,t.unref)(p)),9,tx)):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`norio-office-rich-editor__file-name`,title:(0,t.unref)(p),"aria-label":pr.value[`file.rename`],onClick:a[4]||=(0,t.withModifiers)((...e)=>(0,t.unref)(v)&&(0,t.unref)(v)(...e),[`stop`])},(0,t.toDisplayString)((0,t.unref)(p)),9,ex)),(0,t.unref)(g)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,nx,(0,t.toDisplayString)((0,t.unref)(g)),1)):(0,t.createCommentVNode)(``,!0)]),(0,t.createVNode)(Cn,{presence:u.collaborationPresence},null,8,[`presence`])],8,Zb)):(0,t.createCommentVNode)(``,!0),ti.value?((0,t.openBlock)(),(0,t.createElementBlock)(`header`,rx,[(0,t.createElementVNode)(`div`,ix,[(0,t.createElementVNode)(`div`,ax,[(0,t.createElementVNode)(`div`,ox,[(0,t.createElementVNode)(`div`,sx,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button`,disabled:!Wo.value,onClick:a[5]||=e=>(0,t.unref)(W)?.chain().focus().undo().run()},[(0,t.createVNode)(M,{name:`back`,size:16,color:`#4b5563`,"background-color":`transparent`})],8,cx),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button`,disabled:!Go.value,onClick:a[6]||=e=>(0,t.unref)(W)?.chain().focus().redo().run()},[(0,t.createVNode)(M,{name:`redo`,size:16,color:`#4b5563`,"background-color":`transparent`})],8,lx),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button`,disabled:!Ko.value,onClick:Vf},[(0,t.createVNode)(M,{name:`rubber`,size:16,color:`#4b5563`,"background-color":`transparent`})],8,ux)]),ni.value&&u.showComments?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dx,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":!!gi.value}]),disabled:!qo.value,title:`添加评论`,onClick:Fd},[(0,t.createVNode)(M,{name:`comment`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,fx)])):(0,t.createCommentVNode)(``,!0),Oi.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,px,[(0,t.createElementVNode)(`div`,{ref_key:`insertMenuRef`,ref:ue,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select`,{"norio-office-rich-toolbar__button--active":et.value}]),onClick:Pl},[(0,t.createVNode)(M,{name:`add-circle`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[134]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__label`},`插入`,-1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],2),et.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,mx,[(0,t.createElementVNode)(`div`,{ref_key:`insertMenuPanelRef`,ref:de,class:`norio-office-rich-insert-menu`},[(0,t.createVNode)(sn,{"class-name":`norio-office-rich-insert-menu__scroll`,"max-height":`calc(100vh - 100px)`,onScroll:eu},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,hx,[(0,t.createElementVNode)(`div`,gx,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Qn,e=>(0,t.createElementVNode)(`button`,{key:e.key,type:`button`,class:`norio-office-rich-insert-menu__quick-item`,onMouseenter:a[7]||=e=>Kl(null),onClick:t=>lf(e.action)},[e.type===`text`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,vx,(0,t.toDisplayString)(e.label),1)):((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:e.iconName,size:16,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`]))],40,_x)),64))]),_i.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yx,[a[135]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-insert-menu__title`},`通用`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_i.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-insert-menu__item`,{"norio-office-rich-insert-menu__item--active":nn.value===e.key}]),ref_for:!0,ref:e.key===`columns`?$l:void 0,onMouseenter:t=>Kl(e.key===`table`||e.key===`emoji`||e.key===`columns`?e.key:null),onFocus:t=>Kl(e.key===`table`||e.key===`emoji`||e.key===`columns`?e.key:null),onClick:t=>lf(e.action)},[(0,t.createElementVNode)(`span`,xx,[e.colorIconName?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.colorIconName,size:18,"background-color":`transparent`},null,8,[`name`])):e.key===`emoji`?((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:`smile`,size:16,color:`#4b5563`,"background-color":`transparent`})):e.monoIconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:2,name:e.monoIconName,size:16,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`span`,Sx,(0,t.toDisplayString)(e.label),1),e.key===`table`||e.key===`emoji`||e.key===`columns`?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:`youjiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})):(0,t.createCommentVNode)(``,!0)],42,bx))),128))])):(0,t.createCommentVNode)(``,!0),vi.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Cx,[a[136]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-insert-menu__title`},`小应用`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(vi.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-insert-menu__item`,{"norio-office-rich-insert-menu__item--active":nn.value===e.key}]),onMouseenter:a[8]||=e=>Kl(null),onFocus:a[9]||=e=>Kl(null),onClick:t=>lf(e.action)},[(0,t.createElementVNode)(`span`,Tx,[e.colorIconName?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.colorIconName,size:18,"background-color":`transparent`},null,8,[`name`])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`span`,Ex,(0,t.toDisplayString)(e.label),1)],42,wx))),128))])):(0,t.createCommentVNode)(``,!0),yi.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Dx,[a[137]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-insert-menu__title`},`外部内容`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(yi.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:`norio-office-rich-insert-menu__item`,onMouseenter:a[10]||=e=>Kl(null),onFocus:a[11]||=e=>Kl(null),onClick:t=>lf(e.action)},[(0,t.createElementVNode)(`span`,kx,[e.colorIconName?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.colorIconName,size:18,"background-color":`transparent`},null,8,[`name`])):e.monoIconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:e.monoIconName,size:16,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`span`,Ax,(0,t.toDisplayString)(e.label),1)],40,Ox))),128))])):(0,t.createCommentVNode)(``,!0)])]),_:1}),nn.value===`table`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`norio-office-rich-insert-submenu norio-office-rich-insert-submenu--table`,onMouseleave:Jl},[a[138]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-insert-submenu__title`},`插入表格`,-1),(0,t.createElementVNode)(`div`,jx,(0,t.toDisplayString)(Tn.value),1),(0,t.createElementVNode)(`div`,Mx,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(80,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-grid__cell`,{"norio-office-rich-table-grid__cell--active":Math.ceil(e/gD)<=cn.value&&(e-1)%gD+1<=ln.value}]),onMouseenter:t=>ql(Math.ceil(e/gD),(e-1)%gD+1),onFocus:t=>ql(Math.ceil(e/gD),(e-1)%gD+1),onClick:t=>Tu(Math.ceil(e/gD),(e-1)%gD+1)},null,42,Nx))),128))]),a[139]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-insert-submenu__footer`},null,-1)],32)):(0,t.createCommentVNode)(``,!0),nn.value===`emoji`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Px,[(0,t.createVNode)(hr,{onSelect:Ru})])):(0,t.createCommentVNode)(``,!0),nn.value===`columns`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`norio-office-rich-insert-submenu norio-office-rich-insert-submenu--columns`,style:(0,t.normalizeStyle)(On.value),onMouseleave:Zl},[(0,t.createElementVNode)(`div`,Fx,(0,t.toDisplayString)(En.value),1),(0,t.createElementVNode)(`div`,Ix,[(0,t.createElementVNode)(`div`,Lx,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_D,e=>(0,t.createElementVNode)(`button`,{key:`columns-count-${e}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-columns-picker__cell`,{"norio-office-rich-columns-picker__cell--active":e<=un.value}]),onMouseenter:t=>Yl(e),onFocus:t=>Yl(e),onClick:t=>zu(e)},null,42,Rx)),64))])])],36)):(0,t.createCommentVNode)(``,!0),nn.value===`countdown`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:`norio-office-rich-insert-submenu norio-office-rich-insert-submenu--countdown`,style:(0,t.normalizeStyle)(kn.value)},[(0,t.createElementVNode)(`div`,zx,[(0,t.createElementVNode)(`div`,Bx,[a[140]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-countdown-settings__title`},`倒计时设置`,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__close`,onClick:a[12]||=e=>Kl(null)},[(0,t.createVNode)(M,{name:`close`,size:16,color:`#6b7280`,"background-color":`transparent`})])]),(0,t.createElementVNode)(`label`,Vx,[(0,t.createElementVNode)(`span`,Hx,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[13]||=e=>dn.value=e,type:`radio`,value:`deadline`},null,512),[[t.vModelRadio,dn.value]]),a[141]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__radio-dot`},null,-1)]),a[142]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__label`},`截止时间`,-1),(0,t.createElementVNode)(`button`,{ref_key:`countdownDateTriggerRef`,ref:Se,type:`button`,class:`norio-office-rich-countdown-settings__datetime`,disabled:dn.value!==`deadline`,onClick:oc},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(jn.value),1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#6b7280`,"background-color":`transparent`})],8,Ux)]),dn.value===`deadline`&&_n.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`countdownPickerRef`,ref:Ce,class:(0,t.normalizeClass)([`norio-office-rich-countdown-settings__picker-panel`,`norio-office-rich-countdown-settings__picker-panel--${yn.value}`])},[(0,t.createElementVNode)(`div`,Wx,[(0,t.createElementVNode)(`select`,{class:`norio-office-rich-countdown-settings__picker-select norio-office-rich-countdown-settings__picker-select--year`,value:String(bn.value),onChange:a[14]||=e=>Y(e.target.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Pn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e,value:e},(0,t.toDisplayString)(e),9,Kx))),128))],40,Gx),(0,t.createElementVNode)(`select`,{class:`norio-office-rich-countdown-settings__picker-select norio-office-rich-countdown-settings__picker-select--month`,value:String(xn.value),onChange:a[15]||=e=>tc(e.target.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Fn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e,value:e},(0,t.toDisplayString)(e+1),9,Jx))),128))],40,qx),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__today`,onClick:ec},` 今 `)]),(0,t.createElementVNode)(`div`,Yx,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(wn,e=>(0,t.createElementVNode)(`span`,{key:e,class:`norio-office-rich-countdown-settings__weekday`},(0,t.toDisplayString)(e),1)),64))]),(0,t.createElementVNode)(`div`,Xx,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(In.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-countdown-settings__day`,{"norio-office-rich-countdown-settings__day--muted":!e.isCurrentMonth,"norio-office-rich-countdown-settings__day--today":e.isToday,"norio-office-rich-countdown-settings__day--selected":e.isSelected,"norio-office-rich-countdown-settings__day--disabled":e.isDisabled}]),disabled:e.isDisabled,onClick:t=>$s(e.year,e.month,e.day)},(0,t.toDisplayString)(e.label),11,Zx))),128))]),(0,t.createElementVNode)(`div`,Qx,[a[143]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-countdown-settings__time-label`},`设置时间`,-1),(0,t.createElementVNode)(`div`,$x,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[16]||=e=>Sn.value=e,class:`norio-office-rich-countdown-settings__time-input`,type:`time`,step:`60`,min:Nn.value,onInput:a[17]||=e=>nc(Sn.value),onChange:a[18]||=e=>nc(Sn.value)},null,40,eS),[[t.vModelText,Sn.value]]),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__time-confirm`,onClick:rc},` 确定 `)])])],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`label`,tS,[(0,t.createElementVNode)(`span`,nS,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[19]||=e=>dn.value=e,type:`radio`,value:`duration`},null,512),[[t.vModelRadio,dn.value]]),a[144]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__radio-dot`},null,-1)]),a[149]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__label`},`计时长度`,-1),(0,t.createElementVNode)(`div`,rS,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[20]||=e=>pn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,disabled:dn.value!==`duration`},null,8,iS),[[t.vModelText,pn.value]]),a[145]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`天`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[21]||=e=>mn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`23`,disabled:dn.value!==`duration`},null,8,aS),[[t.vModelText,mn.value]]),a[146]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`时`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[22]||=e=>hn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`59`,disabled:dn.value!==`duration`},null,8,oS),[[t.vModelText,hn.value]]),a[147]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`分`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[23]||=e=>gn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`59`,disabled:dn.value!==`duration`},null,8,sS),[[t.vModelText,gn.value]]),a[148]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`秒`,-1)])]),(0,t.createElementVNode)(`div`,cS,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__button norio-office-rich-countdown-settings__button--secondary`,onClick:a[24]||=e=>Kl(null)},` 取消 `),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__button norio-office-rich-countdown-settings__button--primary`,onClick:Bu},` 确定 `)])])],4)):(0,t.createCommentVNode)(``,!0)],512)])):(0,t.createCommentVNode)(``,!0)],512)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,lS,[(0,t.createElementVNode)(`div`,{ref_key:`headingMenuRef`,ref:Ie,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select norio-office-rich-toolbar__button--heading`,disabled:!Jo.value,onClick:ff},[(0,t.createElementVNode)(`span`,dS,(0,t.toDisplayString)(J.value),1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],8,uS),ft.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fS,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Qt,e=>(0,t.createElementVNode)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--heading`,{"norio-office-rich-toolbar__menu-item--active":e.level?(0,t.unref)(W)?.isActive(`heading`,{level:e.level}):!(0,t.unref)(W)?.isActive(`heading`)}]),disabled:!Hf(e.level),onClick:t=>pf(e.level)},[(e.level?(0,t.unref)(W)?.isActive(`heading`,{level:e.level}):!(0,t.unref)(W)?.isActive(`heading`))?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,mS)),(0,t.createElementVNode)(`span`,hS,(0,t.toDisplayString)(e.level?`H${e.level}`:`T`),1),(0,t.createElementVNode)(`span`,gS,(0,t.toDisplayString)(e.label),1)],10,pS)),64))])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`div`,{ref_key:`fontFamilyMenuRef`,ref:Le,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select norio-office-rich-toolbar__button--font-family`,disabled:!Yo.value,onClick:gf},[(0,t.createElementVNode)(`span`,vS,(0,t.toDisplayString)(yo.value),1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],8,_S),pt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yS,[(0,t.createVNode)(sn,{"class-name":`norio-office-rich-toolbar__menu-scroll`,"max-height":`360px`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Zn,e=>(0,t.createElementVNode)(`button`,{key:e.label,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--font-family`,{"norio-office-rich-toolbar__menu-item--active":yo.value===e.label}]),disabled:!Uf(e.value),onClick:t=>_f(e.value)},[yo.value===e.label?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,xS)),(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`,style:(0,t.normalizeStyle)(e.value?{fontFamily:e.value}:void 0)},(0,t.toDisplayString)(e.label),5)],10,bS)),64))]),_:1})])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`div`,{ref_key:`fontSizeMenuRef`,ref:ze,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select norio-office-rich-toolbar__button--font-size`,disabled:!Xo.value,onClick:yf},[(0,t.createElementVNode)(`span`,CS,(0,t.toDisplayString)(vo.value),1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],8,SS),ht.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wS,[(0,t.createVNode)(sn,{"class-name":`norio-office-rich-toolbar__menu-scroll`,"max-height":`520px`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Xn,e=>(0,t.createElementVNode)(`button`,{key:e.label,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--font-size`,{"norio-office-rich-toolbar__menu-item--active":vo.value===e.label}]),disabled:!Wf(e.value),onClick:t=>bf(e.value)},[vo.value===e.label?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ES)),(0,t.createElementVNode)(`span`,DS,(0,t.toDisplayString)(e.label),1)],10,TS)),64))]),_:1})])):(0,t.createCommentVNode)(``,!0)],512)]),(0,t.createElementVNode)(`div`,OS,[(0,t.createElementVNode)(`div`,{ref_key:`colorMenuRef`,ref:Be,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select norio-office-rich-toolbar__button--color`,disabled:!Zo.value,onClick:xf},[(0,t.createElementVNode)(`span`,AS,[a[150]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__color-text`},`A`,-1),(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__color-line`,style:(0,t.normalizeStyle)({backgroundColor:xo.value})},null,4)]),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],8,kS),gt.value?((0,t.openBlock)(),(0,t.createBlock)(Rn,{key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--color`,color:xo.value,"default-color":`#333333`,"recent-colors":br.value,onChange:Sf},null,8,[`color`,`recent-colors`])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`div`,{ref_key:`highlightMenuRef`,ref:We,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select norio-office-rich-toolbar__button--color`,disabled:!Qo.value,onClick:Cf},[(0,t.createElementVNode)(`span`,MS,[(0,t.createVNode)(M,{name:`beijingse`,size:14,color:`#4b5563`,"background-color":`transparent`}),(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__color-line`,style:(0,t.normalizeStyle)({backgroundColor:So.value})},null,4)]),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],8,jS),_t.value?((0,t.openBlock)(),(0,t.createBlock)(Rn,{key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--color`,color:So.value,"default-color":`#FFF3C4`,"recent-colors":xr.value,onChange:wf},null,8,[`color`,`recent-colors`])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`bold`)}]),disabled:!$o.value,onClick:Of},[(0,t.createVNode)(M,{name:`jiacu`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,NS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`italic`)}]),disabled:!es.value,onClick:kf},[(0,t.createVNode)(M,{name:`xieti`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,PS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`underline`)}]),disabled:!ts.value,onClick:Af},[(0,t.createVNode)(M,{name:`xiahuaxian`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,FS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`strike`)}]),disabled:!ns.value,onClick:jf},[...a[151]||=[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__text-icon norio-office-rich-toolbar__text-icon--strike`},`S`,-1)]],10,IS),(0,t.createElementVNode)(`div`,{ref_key:`scriptMenuRef`,ref:Re,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`superscript`)||(0,t.unref)(W)?.isActive(`subscript`)}]),disabled:!rs.value,onClick:vf},[_o.value.icon?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:_o.value.icon,size:16,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RS,(0,t.toDisplayString)(_o.value.text),1)),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],10,LS),mt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,zS,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item`,{"norio-office-rich-toolbar__menu-item--active":(0,t.unref)(W)?.isActive(`superscript`)}]),disabled:!qf(),onClick:zf},[(0,t.unref)(W)?.isActive(`superscript`)?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,VS)),(0,t.createVNode)(M,{name:`shangbiao`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[152]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`},`上标`,-1),a[153]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-shortcut`},`Ctrl+Shift+.`,-1)],10,BS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item`,{"norio-office-rich-toolbar__menu-item--active":(0,t.unref)(W)?.isActive(`subscript`)}]),disabled:!Yf(),onClick:Bf},[(0,t.unref)(W)?.isActive(`subscript`)?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,US)),(0,t.createVNode)(M,{name:`xiabiao`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[154]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`},`下标`,-1),a[155]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-shortcut`},`Ctrl+Shift+,`,-1)],10,HS)])):(0,t.createCommentVNode)(``,!0)],512)]),(0,t.createElementVNode)(`div`,WS,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`bulletList`)}]),disabled:!is.value,onClick:Nf},[(0,t.createVNode)(M,{name:`wuxuliebiao`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,GS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`orderedList`)}]),disabled:!as.value,onClick:Pf},[(0,t.createVNode)(M,{name:`youxuliebiao`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,KS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`taskList`)}]),disabled:!os.value,onClick:Ff},[(0,t.createVNode)(M,{name:`To-do`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,qS),(0,t.createElementVNode)(`div`,{ref_key:`alignMenuRef`,ref:Ee,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select`,{"norio-office-rich-toolbar__button--active":st.value}]),disabled:!ss.value,onClick:Wl},[(0,t.createVNode)(M,{name:bo.value===`center`?`juzhongduiqi`:bo.value===`right`?`youduiqi`:`zuoduiqi`,size:16,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`]),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],10,JS),st.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,YS,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--align`,{"norio-office-rich-toolbar__menu-item--active":bo.value===`left`}]),disabled:!Gf(`left`),onClick:a[25]||=e=>Gl(`left`)},[bo.value===`left`?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ZS)),(0,t.createVNode)(M,{name:`zuoduiqi`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[156]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`},`左对齐`,-1)],10,XS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--align`,{"norio-office-rich-toolbar__menu-item--active":bo.value===`center`}]),disabled:!Gf(`center`),onClick:a[26]||=e=>Gl(`center`)},[bo.value===`center`?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,$S)),(0,t.createVNode)(M,{name:`juzhongduiqi`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[157]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`},`居中对齐`,-1)],10,QS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--align`,{"norio-office-rich-toolbar__menu-item--active":bo.value===`right`}]),disabled:!Gf(`right`),onClick:a[27]||=e=>Gl(`right`)},[bo.value===`right`?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,tC)),(0,t.createVNode)(M,{name:`youduiqi`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[158]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`},`右对齐`,-1)],10,eC)])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button`,disabled:!cs.value,onClick:hf},[(0,t.createVNode)(M,{name:`zuosuojin`,size:16,color:`#4b5563`,"background-color":`transparent`})],8,nC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button`,disabled:!ls.value,onClick:mf},[(0,t.createVNode)(M,{name:`yousuojin`,size:16,color:`#4b5563`,"background-color":`transparent`})],8,rC),Ai.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`quoteMenuRef`,ref:Ge,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`blockquote`)}]),disabled:!ds.value,onClick:Ef},[(0,t.createVNode)(M,{name:`yinyong`,size:16,color:`#4b5563`,"background-color":`transparent`}),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],10,iC),vt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,aC,[(0,t.createElementVNode)(`div`,oC,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-color-menu__current`,disabled:!us.value,onClick:If},(0,t.toDisplayString)((0,t.unref)(W)?.isActive(`blockquote`)?`取消引用`:`应用引用`),9,sC)]),(0,t.createElementVNode)(`div`,cC,[a[159]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-color-menu__label`},`边框颜色`,-1),(0,t.createElementVNode)(`div`,lC,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(gr,e=>(0,t.createElementVNode)(`button`,{key:`quote-border-${e}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-color-menu__swatch norio-office-rich-color-menu__swatch--compact`,{"norio-office-rich-color-menu__swatch--active":Co.value===e}]),disabled:!(0,t.unref)(W)?.isActive(`blockquote`),style:(0,t.normalizeStyle)({backgroundColor:e}),onClick:t=>Lf(e)},null,14,uC)),64))])]),(0,t.createElementVNode)(`div`,dC,[a[160]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-color-menu__label`},`背景颜色`,-1),(0,t.createElementVNode)(`div`,fC,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_r,e=>(0,t.createElementVNode)(`button`,{key:`quote-bg-${e}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-color-menu__swatch norio-office-rich-color-menu__swatch--compact`,{"norio-office-rich-color-menu__swatch--active":wo.value===e}]),disabled:!(0,t.unref)(W)?.isActive(`blockquote`),style:(0,t.normalizeStyle)({backgroundColor:e}),onClick:t=>Rf(e)},null,14,pC)),64))])])])):(0,t.createCommentVNode)(``,!0)],512)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`code`)}]),disabled:!fs.value,onClick:Mf},[(0,t.createVNode)(M,{name:`code`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,mC),ki.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,ref_key:`emojiToolbarMenuRef`,ref:ve,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":yt.value}]),disabled:!ei.value,title:`表情符号`,onClick:Df},[(0,t.createVNode)(M,{name:`smile`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,hC),yt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,gC,[(0,t.createVNode)(hr,{onSelect:Ru})])):(0,t.createCommentVNode)(``,!0)],512)):(0,t.createCommentVNode)(``,!0)]),u.showAiTargetButton?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_C,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--ai-target`,{"norio-office-rich-toolbar__button--active":A.value.active}]),disabled:!ei.value||!re.value||!A.value.available||A.value.busy,title:re.value?A.value.busy?`请先停止当前修改,再选择新的范围`:A.value.reason||`将当前选区或光标位置交给 AI 编辑`:`AI Bridge 尚未连接`,"aria-label":`将当前选区或光标位置交给 AI 编辑`,onMousedown:a[28]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:ae},[(0,t.createVNode)(an,{name:`ai-mark`,size:17,"background-color":`transparent`,"aria-hidden":`true`})],42,vC)])):(0,t.createCommentVNode)(``,!0)])])])])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,yC,[ai.value&&!Ye.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,ref_key:`outlineTriggerRef`,ref:Xe,type:`button`,class:`norio-office-rich-outline-trigger`,"data-placement":ii.value,title:Ri.value,"aria-label":Ri.value,"aria-controls":Ze,"aria-expanded":!1,onClick:dc},[(0,t.createVNode)(M,{name:`dagang`,size:18,color:`currentColor`,"background-color":`transparent`})],8,bC)):(0,t.createCommentVNode)(``,!0),ai.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,id:Ze,class:`norio-office-rich-outline-shell`,"data-open":Ye.value,"data-placement":ii.value,onKeydown:a[29]||=(0,t.withKeys)((0,t.withModifiers)(e=>Ye.value&&dc(),[`prevent`,`stop`]),[`esc`])},[(0,t.createVNode)(Xl,{internal:``,open:Ye.value,placement:ii.value,title:Ri.value,"collapse-title":zi.value,"empty-description":I.value,"empty-tip":L.value,items:Sr.value,"active-pos":Cr.value,onToggle:dc,onSelect:fc},null,8,[`open`,`placement`,`title`,`collapse-title`,`empty-description`,`empty-tip`,`items`,`active-pos`])],40,xC)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`section`,SC,[(0,t.createVNode)(sn,{"class-name":`norio-office-rich-editor__scroll`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:`norio-office-rich-editor__stage`,style:(0,t.normalizeStyle)(Ba.value)},[(0,t.createElementVNode)(`div`,{ref_key:`pageRef`,ref:j,class:`norio-office-rich-editor__page`,onMousedownCapture:Ol,onKeydownCapture:Ul,onBeforeinputCapture:Tc,onCompositionstartCapture:Ec,onCompositionendCapture:Dc,onMousemove:Oc,onMouseleave:kc,onDragenterCapture:kl,onDragoverCapture:Al,onDragleaveCapture:jl,onDropCapture:Ml},[(0,t.unref)(W)?((0,t.openBlock)(),(0,t.createBlock)(rr,{key:0,onVisibilityChange:a[30]||=e=>zr.value=e,editor:(0,t.unref)(W),actions:ps.value,enabled:ei.value&&!Je.value&&!Hr.value&&!Wi.value},null,8,[`editor`,`actions`,`enabled`])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(W)?((0,t.openBlock)(),(0,t.createBlock)(rr,{key:1,scope:`table`,editor:(0,t.unref)(W),actions:ms.value,enabled:ei.value&&!Je.value&&!Hr.value&&!Wi.value,onVisibilityChange:a[46]||=e=>Br.value=e,"get-referenced-virtual-element":su},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,CC,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!Ho.value,title:`合并单元格`,onMousedown:a[31]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Mu},[(0,t.createVNode)(M,{name:`merge`,size:14,color:Ho.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,wC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!Uo.value,title:`拆分单元格`,onMousedown:a[32]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Nu},[(0,t.createVNode)(M,{name:`split`,size:14,color:Uo.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,TC),(0,t.createElementVNode)(`div`,{ref_key:`tableActionColorMenuRef`,ref:je,class:`norio-office-rich-table-bubble-menu__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-bubble-menu__button`,{"norio-office-rich-table-bubble-menu__button--active":ct.value}]),disabled:!hs.value,title:`设置单元格背景色`,onMousedown:a[33]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:fu},[(0,t.createVNode)(M,{name:`yanse`,size:14,color:hs.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],42,EC),ct.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,DC,[a[161]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-table-bubble-menu__menu-title`},`单元格背景颜色`,-1),(0,t.createElementVNode)(`div`,OC,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Zr,e=>(0,t.createElementVNode)(`button`,{key:`table-cell-${e??`none`}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-bubble-menu__color-swatch`,{"norio-office-rich-table-bubble-menu__color-swatch--active":Eo.value===e,"norio-office-rich-table-bubble-menu__color-swatch--none":e===null}]),style:(0,t.normalizeStyle)(e?{backgroundColor:e}:void 0),onMousedown:a[34]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>bu(e)},null,46,kC)),64))]),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__reset`,onMousedown:a[35]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:a[36]||=e=>bu(null)},` 恢复默认 `,32)])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`div`,{ref_key:`tableThemeMenuRef`,ref:Me,class:`norio-office-rich-table-bubble-menu__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-bubble-menu__button`,{"norio-office-rich-table-bubble-menu__button--active":lt.value}]),disabled:!hs.value,title:`表格主题色`,"aria-label":`表格主题色`,"aria-expanded":lt.value,onMousedown:a[37]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:pu},[(0,t.createVNode)(M,{name:`zhuti`,size:14,color:hs.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],42,AC),lt.value?((0,t.openBlock)(),(0,t.createBlock)(lu,{key:0,theme:Do.value,"recent-colors":xr.value,style:(0,t.normalizeStyle)(Ao.value),onChange:vu,onColorUsed:Tf,onClear:a[38]||=e=>vu(null),onClose:a[39]||=e=>lt.value=!1,onResize:a[40]||=e=>ut.value=e,onReposition:mu},null,8,[`theme`,`recent-colors`,`style`])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!_s.value,title:`上增加一行`,onMousedown:a[41]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Eu},[(0,t.createVNode)(M,{name:`xiangshangcharu`,size:14,color:_s.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,jC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!_s.value,title:`下增加一行`,onMousedown:a[42]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Du},[(0,t.createVNode)(M,{name:`xiangxiacharujilu-copy`,size:14,color:_s.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,MC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!vs.value,title:`左增加一列`,onMousedown:a[43]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Ou},[(0,t.createVNode)(M,{name:`xiangzuocharu`,size:14,color:vs.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,NC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!vs.value,title:`右增加一列`,onMousedown:a[44]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:ku},[(0,t.createVNode)(M,{name:`xiangyoucharu`,size:14,color:vs.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,PC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button norio-office-rich-table-bubble-menu__button--danger`,disabled:!ys.value,title:`删除`,onMousedown:a[45]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Fu},[(0,t.createVNode)(M,{name:`delete`,size:14,color:ys.value?`#dc2626`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,FC)])]),_:1},8,[`editor`,`actions`,`enabled`])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(W)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(r.BubbleMenu),{key:2,"plugin-key":`countdownBlockBubbleMenu`,class:`norio-office-rich-countdown-bubble-menu`,editor:(0,t.unref)(W),"should-show":ou,"get-referenced-virtual-element":cu,options:{placement:`top`}},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,IC,[(0,t.createElementVNode)(`div`,{ref_key:`countdownBubbleMenuRef`,ref:we,class:`norio-office-rich-countdown-bubble-menu__dropdown`},[(0,t.createElementVNode)(`button`,{ref_key:`countdownBubbleEditButtonRef`,ref:Te,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-countdown-bubble-menu__button norio-office-rich-countdown-bubble-menu__button--edit`,{"norio-office-rich-countdown-bubble-menu__button--active":vn.value}]),title:`编辑`,"aria-label":`编辑`,onMousedown:a[47]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:ic},[(0,t.createVNode)(M,{name:`edit`,size:14,color:`#374151`,"background-color":`transparent`}),a[162]||=(0,t.createElementVNode)(`span`,null,`编辑`,-1)],34),vn.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,LC,[(0,t.createElementVNode)(`div`,RC,[(0,t.createElementVNode)(`div`,zC,[a[163]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-countdown-settings__title`},`倒计时设置`,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__close`,onClick:a[48]||=e=>vn.value=!1},[(0,t.createVNode)(M,{name:`close`,size:16,color:`#6b7280`,"background-color":`transparent`})])]),(0,t.createElementVNode)(`label`,BC,[(0,t.createElementVNode)(`span`,VC,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[49]||=e=>dn.value=e,type:`radio`,value:`deadline`},null,512),[[t.vModelRadio,dn.value]]),a[164]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__radio-dot`},null,-1)]),a[165]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__label`},`截止时间`,-1),(0,t.createElementVNode)(`button`,{ref_key:`countdownDateTriggerRef`,ref:Se,type:`button`,class:`norio-office-rich-countdown-settings__datetime`,disabled:dn.value!==`deadline`,onClick:oc},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(jn.value),1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#6b7280`,"background-color":`transparent`})],8,HC)]),dn.value===`deadline`&&_n.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`countdownPickerRef`,ref:Ce,class:(0,t.normalizeClass)([`norio-office-rich-countdown-settings__picker-panel`,`norio-office-rich-countdown-settings__picker-panel--${yn.value}`])},[(0,t.createElementVNode)(`div`,UC,[(0,t.createElementVNode)(`select`,{class:`norio-office-rich-countdown-settings__picker-select norio-office-rich-countdown-settings__picker-select--year`,value:String(bn.value),onChange:a[50]||=e=>Y(e.target.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Pn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e,value:e},(0,t.toDisplayString)(e),9,GC))),128))],40,WC),(0,t.createElementVNode)(`select`,{class:`norio-office-rich-countdown-settings__picker-select norio-office-rich-countdown-settings__picker-select--month`,value:String(xn.value),onChange:a[51]||=e=>tc(e.target.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Fn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e,value:e},(0,t.toDisplayString)(e+1),9,qC))),128))],40,KC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__today`,onClick:ec},` 今 `)]),(0,t.createElementVNode)(`div`,JC,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(wn,e=>(0,t.createElementVNode)(`span`,{key:e,class:`norio-office-rich-countdown-settings__weekday`},(0,t.toDisplayString)(e),1)),64))]),(0,t.createElementVNode)(`div`,YC,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(In.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-countdown-settings__day`,{"norio-office-rich-countdown-settings__day--muted":!e.isCurrentMonth,"norio-office-rich-countdown-settings__day--today":e.isToday,"norio-office-rich-countdown-settings__day--selected":e.isSelected}]),onClick:t=>$s(e.year,e.month,e.day)},(0,t.toDisplayString)(e.label),11,XC))),128))]),(0,t.createElementVNode)(`div`,ZC,[a[166]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-countdown-settings__time-label`},`设置时间`,-1),(0,t.createElementVNode)(`div`,QC,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[52]||=e=>Sn.value=e,class:`norio-office-rich-countdown-settings__time-input`,type:`time`,step:`60`,min:Nn.value,onInput:a[53]||=e=>nc(Sn.value),onChange:a[54]||=e=>nc(Sn.value)},null,40,$C),[[t.vModelText,Sn.value]]),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__time-confirm`,onClick:rc},` 确定 `)])])],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`label`,ew,[(0,t.createElementVNode)(`span`,tw,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[55]||=e=>dn.value=e,type:`radio`,value:`duration`},null,512),[[t.vModelRadio,dn.value]]),a[167]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__radio-dot`},null,-1)]),a[172]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__label`},`计时长度`,-1),(0,t.createElementVNode)(`div`,nw,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[56]||=e=>pn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,disabled:dn.value!==`duration`},null,8,rw),[[t.vModelText,pn.value]]),a[168]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`天`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[57]||=e=>mn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`23`,disabled:dn.value!==`duration`},null,8,iw),[[t.vModelText,mn.value]]),a[169]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`时`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[58]||=e=>hn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`59`,disabled:dn.value!==`duration`},null,8,aw),[[t.vModelText,hn.value]]),a[170]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`分`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[59]||=e=>gn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`59`,disabled:dn.value!==`duration`},null,8,ow),[[t.vModelText,gn.value]]),a[171]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`秒`,-1)])]),(0,t.createElementVNode)(`div`,sw,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__button norio-office-rich-countdown-settings__button--secondary`,onClick:a[60]||=e=>vn.value=!1},` 取消 `),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__button norio-office-rich-countdown-settings__button--primary`,onClick:Hu},` 确定 `)])])])):(0,t.createCommentVNode)(``,!0)],512),a[173]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-bubble-menu__divider`},null,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-bubble-menu__button norio-office-rich-countdown-bubble-menu__button--danger`,title:`删除`,"aria-label":`删除`,onMousedown:a[61]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Uu},[(0,t.createVNode)(M,{name:`delete`,size:14,color:`#dc2626`,"background-color":`transparent`})],32)])]),_:1},8,[`editor`])):(0,t.createCommentVNode)(``,!0),Ha.value&&Va.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:`norio-office-rich-editor__watermark`,style:(0,t.normalizeStyle)(Ua.value),"aria-hidden":`true`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(Wa),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e,class:`norio-office-rich-editor__watermark-text`},(0,t.toDisplayString)(Va.value.text),1))),128))],4)):(0,t.createCommentVNode)(``,!0),(0,t.unref)(W)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.EditorContent),{key:4,editor:(0,t.unref)(W),class:`norio-office-rich-editor__content`,onClickCapture:oe},null,8,[`editor`])):(0,t.createCommentVNode)(``,!0),li.value&&bt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:5,ref_key:`mentionPanelRef`,ref:Ke,class:`norio-office-rich-mention-panel`,style:(0,t.normalizeStyle)(H.value),onMousedown:a[62]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createElementVNode)(`div`,cw,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(tn,e=>(0,t.createElementVNode)(`button`,{key:String(e.key),type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-mention-panel__tab`,{"norio-office-rich-mention-panel__tab--active":Ct.value===e.key}]),onClick:t=>oa(e.key)},(0,t.toDisplayString)(e.label),11,lw)),64))]),(0,t.createVNode)(sn,{class:`norio-office-rich-mention-panel__scroll`},{default:(0,t.withCtx)(()=>[xt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,uw,`加载中...`)):Gi.value.length?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:2},(0,t.renderList)(Gi.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`${e.type}-${e.id}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-mention-panel__item`,{"norio-office-rich-mention-panel__item--active":n===Tt.value}]),onClick:t=>sa(e,n),onDblclick:t=>la(e)},[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-mention-panel__avatar`,"data-type":e.type,style:(0,t.normalizeStyle)($i(e))},[e.type===1&&e.avatar?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:e.avatar,alt:``},null,8,mw)):e.type===2&&e.icon?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:e.icon,alt:``},null,8,hw)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,gw,(0,t.toDisplayString)(Qi(e)),1))],12,pw),(0,t.createElementVNode)(`span`,_w,[(0,t.createElementVNode)(`span`,vw,[(0,t.createElementVNode)(`span`,yw,(0,t.toDisplayString)(e.name),1),e.tag?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,bw,(0,t.toDisplayString)(e.tag),1)):(0,t.createCommentVNode)(``,!0)]),e.type===2&&e.updatedAt?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,xw,` 最近修改:`+(0,t.toDisplayString)(e.updatedAt),1)):(0,t.createCommentVNode)(``,!0)])],42,fw))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dw,`暂无可提及内容`))]),_:1}),(0,t.createElementVNode)(`div`,Sw,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-mention-panel__submit`,disabled:!Ki.value,onClick:da},` 提及 `,8,Cw)])],36)):(0,t.createCommentVNode)(``,!0),Hi.value||Wi.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:6,class:`norio-office-rich-marquee-selection-layer`,"data-active":Ar.value,"aria-hidden":`true`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Ui.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:`marquee-block-${e.pos}`,class:`norio-office-rich-marquee-selection-layer__block`,style:(0,t.normalizeStyle)({left:`${e.rect.left}px`,top:`${e.rect.top}px`,width:`${e.rect.width}px`,height:`${e.rect.height}px`})},null,4))),128)),Hi.value&&Ar.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`norio-office-rich-marquee-selection-layer__box`,style:(0,t.normalizeStyle)({left:`${Hi.value.left}px`,top:`${Hi.value.top}px`,width:`${Hi.value.width}px`,height:`${Hi.value.height}px`})},null,4)):(0,t.createCommentVNode)(``,!0)],8,ww)):(0,t.createCommentVNode)(``,!0),Ka.value&&ei.value&&!Je.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:7,class:(0,t.normalizeClass)([`norio-office-rich-block-side-control`,{"norio-office-rich-block-side-control--empty":Ka.value.isEmpty}]),style:(0,t.normalizeStyle)(ro.value),onMouseenter:a[70]||=e=>Ac(Ka.value),onMouseleave:kc},[Ka.value.isEmpty?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`norio-office-rich-block-side-control__button norio-office-rich-block-side-control__button--empty`,title:`插入`,onMousedown:a[63]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[64]||=e=>X(Ka.value,`insert`),onClick:a[65]||=e=>X(Ka.value,`insert`)},[(0,t.createVNode)(M,{name:`add`,size:12,color:`currentColor`,"background-color":`transparent`})],32)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-block-side-control__button`,title:Ka.value.label,onMousedown:a[66]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[67]||=e=>X(Ka.value,`actions`),onClick:a[68]||=e=>X(Ka.value,`actions`)},[Ka.value.iconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:Ka.value.iconName,size:14,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Ew,(0,t.toDisplayString)(Ka.value.textIcon),1))],40,Tw),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-block-side-control__button norio-office-rich-block-side-control__button--drag`,title:`拖动`,onMousedown:a[69]||=e=>ul(e,Ka.value)},[(0,t.createVNode)(M,{name:`drag`,size:12,color:`#9aa4b2`,"background-color":`transparent`})],32)],64))],38)):(0,t.createCommentVNode)(``,!0),Ka.value&&Hr.value?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:8,ref_key:`blockSideMenuRef`,ref:De,class:`norio-office-rich-block-side-menu`,style:(0,t.normalizeStyle)(co.value),onMouseenter:a[102]||=e=>Ac(Ka.value),onMouseleave:kc,onMousedown:a[103]||=(0,t.withModifiers)(()=>{},[`stop`])},[Hr.value===`insert`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,Dw,[a[174]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-block-side-menu__title`},`基础`,-1),(0,t.createElementVNode)(`div`,Ow,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Qn,e=>(0,t.createElementVNode)(`button`,{key:`block-quick-${e.key}`,type:`button`,class:`norio-office-rich-block-side-menu__quick-button`,onClick:t=>Pc(e.action)},[e.type===`icon`?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.iconName||``,size:17,color:`#1f2937`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Aw,(0,t.toDisplayString)(e.label),1))],8,kw)),64))])]),(0,t.createElementVNode)(`div`,jw,[a[175]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-block-side-menu__title`},`常用`,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(nr,e=>(0,t.createElementVNode)(`button`,{key:`block-insert-${e.key}`,type:`button`,class:`norio-office-rich-block-side-menu__item`,onClick:t=>Pc(e.action)},[e.colorIconName?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.colorIconName},null,8,[`name`])):((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:`smile`,size:17,color:`#64748b`,"background-color":`transparent`})),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(N(e.key)),1)],8,Mw)),64))])],64)):Hr.value===`actions`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[qa.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Nw,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(qa.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`block-transform-${e.key}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__quick-button`,{"norio-office-rich-block-side-menu__quick-button--active":Ja.value===e.action}]),title:e.label,"aria-label":e.label,"aria-pressed":Ja.value===e.action,onMousedown:a[71]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>Jc(e.action)},[e.type===`icon`?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.iconName||``,size:18,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Fw,(0,t.toDisplayString)(e.label),1))],42,Pw))),128))])):(0,t.createCommentVNode)(``,!0),Ya.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,ref_key:`blockSidePropertiesTriggerRef`,ref:Ve,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":P.value===`properties`}]),onMouseenter:a[72]||=e=>P.value=`properties`,onClick:a[73]||=e=>P.value=`properties`,onMousedown:a[74]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createVNode)(M,{name:`zuoduiqi`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[176]||=(0,t.createElementVNode)(`span`,null,`缩进和对齐`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],34)):(0,t.createCommentVNode)(``,!0),Bc(Ka.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,ref_key:`blockSideColorTriggerRef`,ref:He,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":P.value===`color`}]),"aria-expanded":P.value===`color`,onMousedown:a[75]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[76]||=e=>P.value=`color`,onClick:a[77]||=e=>P.value=`color`},[(0,t.createVNode)(M,{name:`yanse`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[177]||=(0,t.createElementVNode)(`span`,null,`颜色`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Iw)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--strong":Ya.value.length>0||Bc(Ka.value)}]),onClick:a[78]||=e=>ol(Ka.value)},[(0,t.createVNode)(M,{name:`cut`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[178]||=(0,t.createElementVNode)(`span`,null,`剪切`,-1)],2),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-block-side-menu__item`,onClick:a[79]||=e=>al(Ka.value)},[(0,t.createVNode)(M,{name:`xiangxiacharujilu-copy`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[179]||=(0,t.createElementVNode)(`span`,null,`复制`,-1)]),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-block-side-menu__item`,disabled:!ei.value,onClick:a[80]||=e=>cl(Ka.value)},[(0,t.createVNode)(M,{name:`xiangxiacharujilu-copy`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[180]||=(0,t.createElementVNode)(`span`,null,`粘贴`,-1)],8,Lw),Ka.value.node.type.name===`table`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,ref_key:`blockSideTableThemeTriggerRef`,ref:Ne,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-block-side-menu__item--strong`,{"norio-office-rich-block-side-menu__item--active":P.value===`table-theme`}]),"aria-expanded":P.value===`table-theme`,onMousedown:a[81]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:hu,onClick:hu},[(0,t.createVNode)(M,{name:`zhuti`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[181]||=(0,t.createElementVNode)(`span`,null,`主题色`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Rw)):(0,t.createCommentVNode)(``,!0),[`highlightBlock`,`blockquote`].includes(Ka.value.node.type.name)?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createElementVNode)(`button`,{ref_key:`blockSideSurfaceBorderTriggerRef`,ref:Oe,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-block-side-menu__item--strong`,{"norio-office-rich-block-side-menu__item--active":[`highlight-border`,`quote-border`].includes(P.value||``)}]),"aria-expanded":[`highlight-border`,`quote-border`].includes(P.value||``),onMousedown:a[82]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[83]||=e=>P.value=Ka.value.node.type.name===`blockquote`?`quote-border`:`highlight-border`,onClick:a[84]||=e=>P.value=Ka.value.node.type.name===`blockquote`?`quote-border`:`highlight-border`},[(0,t.createVNode)(M,{name:`yanse`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[182]||=(0,t.createElementVNode)(`span`,null,`边框颜色`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,zw),(0,t.createElementVNode)(`button`,{ref_key:`blockSideSurfaceFillTriggerRef`,ref:ke,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":[`highlight-fill`,`quote-background`].includes(P.value||``)}]),"aria-expanded":[`highlight-fill`,`quote-background`].includes(P.value||``),onMousedown:a[85]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[86]||=e=>P.value=Ka.value.node.type.name===`blockquote`?`quote-background`:`highlight-fill`,onClick:a[87]||=e=>P.value=Ka.value.node.type.name===`blockquote`?`quote-background`:`highlight-fill`},[(0,t.createVNode)(M,{name:`beijingse`,size:18,color:`#4b5563`,"background-color":`transparent`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(Ka.value.node.type.name===`blockquote`?`背景颜色`:`填充颜色`),1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Bw),Ka.value.node.type.name===`highlightBlock`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,ref_key:`blockSideHighlightSettingsTriggerRef`,ref:Ae,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":P.value===`highlight-settings`}]),"aria-expanded":P.value===`highlight-settings`,onMousedown:a[88]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[89]||=e=>P.value=`highlight-settings`,onClick:a[90]||=e=>P.value=`highlight-settings`},[(0,t.createVNode)(M,{name:`shezhi`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[183]||=(0,t.createElementVNode)(`span`,null,`设置`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Vw)):(0,t.createCommentVNode)(``,!0)],64)):(0,t.createCommentVNode)(``,!0),Ka.value.node.type.name===`horizontalRule`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:5},[(0,t.createElementVNode)(`button`,{ref_key:`blockSideDividerStyleTriggerRef`,ref:Pe,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-block-side-menu__item--strong`,{"norio-office-rich-block-side-menu__item--active":P.value===`divider-style`}]),"aria-expanded":P.value===`divider-style`,onMousedown:a[91]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[92]||=e=>P.value=`divider-style`,onClick:a[93]||=e=>P.value=`divider-style`},[(0,t.createVNode)(an,{name:`fengexian`,size:18,"background-color":`transparent`}),a[184]||=(0,t.createElementVNode)(`span`,null,`样式`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Hw),(0,t.createElementVNode)(`button`,{ref_key:`blockSideDividerColorTriggerRef`,ref:Fe,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":P.value===`divider-color`}]),"aria-expanded":P.value===`divider-color`,onMousedown:a[94]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[95]||=e=>P.value=`divider-color`,onClick:a[96]||=e=>P.value=`divider-color`},[(0,t.createVNode)(M,{name:`yanse`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[185]||=(0,t.createElementVNode)(`span`,null,`颜色`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Uw)],64)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-block-side-menu__item norio-office-rich-block-side-menu__item--strong`,onClick:a[97]||=e=>ll(Ka.value)},[(0,t.createVNode)(M,{name:`delete`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[186]||=(0,t.createElementVNode)(`span`,null,`删除`,-1)]),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-block-side-menu__item--strong`,{"norio-office-rich-block-side-menu__item--active":P.value===`add-above`}]),"aria-expanded":P.value===`add-above`,"aria-haspopup":`true`,onMouseenter:a[98]||=e=>!q.value&&(P.value=`add-above`),onClick:a[99]||=e=>P.value=`add-above`},[(0,t.createVNode)(M,{name:`shangfangtianjia`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[187]||=(0,t.createElementVNode)(`span`,null,`在上方添加`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Ww),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":P.value===`add-below`}]),"aria-expanded":P.value===`add-below`,"aria-haspopup":`true`,onMouseenter:a[100]||=e=>!q.value&&(P.value=`add-below`),onClick:a[101]||=e=>P.value=`add-below`},[(0,t.createVNode)(M,{name:`xiafangtianjia`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[188]||=(0,t.createElementVNode)(`span`,null,`在下方添加`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Gw)],64)):(0,t.createCommentVNode)(``,!0)],36)),[[t.vShow,!(q.value&&en.includes(P.value||``))]]):(0,t.createCommentVNode)(``,!0),Ka.value&&Xa.value&&P.value===`table-theme`?((0,t.openBlock)(),(0,t.createBlock)(lu,{key:9,class:`norio-office-rich-block-side-table-theme`,theme:Oo.value,"recent-colors":xr.value,style:(0,t.normalizeStyle)(ko.value),onChange:gu,onColorUsed:Tf,onClear:a[104]||=e=>gu(null),onClose:_u,onResize:a[105]||=e=>ut.value=e,onReposition:mu,onMouseenter:a[106]||=e=>Ac(Ka.value),onMouseleave:kc,onMousedown:a[107]||=(0,t.withModifiers)(()=>{},[`stop`])},null,8,[`theme`,`recent-colors`,`style`])):(0,t.createCommentVNode)(``,!0),Ka.value&&Xa.value&&P.value!==`table-theme`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:10,class:(0,t.normalizeClass)([`norio-office-rich-block-side-submenu`,{"norio-office-rich-block-side-submenu--properties":P.value===`properties`,"norio-office-rich-block-side-submenu--color":P.value===`divider-color`}]),style:(0,t.normalizeStyle)(lo.value),onMouseenter:a[115]||=e=>Ac(Ka.value),onMouseleave:kc,onMousedown:a[116]||=(0,t.withModifiers)(()=>{},[`stop`])},[q.value&&en.includes(P.value||``)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`norio-office-rich-block-side-menu__back`,"aria-label":`返回句柄菜单`,onMousedown:a[108]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:a[109]||=e=>P.value=null},[(0,t.createVNode)(M,{name:`zuojiantou`,size:14,color:`currentColor`,"background-color":`transparent`}),a[189]||=(0,t.createElementVNode)(`span`,null,`返回`,-1)],32)):(0,t.createCommentVNode)(``,!0),P.value===`properties`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(Ya.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`block-property-${e.key}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--strong":e.action===`indent-more`,"norio-office-rich-block-side-menu__item--active":e.action===`align-${Po.value}`}]),disabled:e.action===`indent-less`?!Io.value:e.action===`indent-more`&&!Fo.value,"aria-pressed":e.action.startsWith(`align-`)?e.action===`align-${Po.value}`:void 0,onMousedown:a[110]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>Yc(e.action)},[(0,t.createVNode)(M,{name:e.iconName,size:18,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`]),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.label),1),e.action===`align-${Po.value}`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,qw,`✓`)):(0,t.createCommentVNode)(``,!0)],42,Kw))),128)):Uc.value?((0,t.openBlock)(),(0,t.createBlock)(Wn,{key:2,kind:Uc.value.kind,label:Uc.value.label,"preset-colors":Uc.value.presetColors,color:Uc.value.color,"custom-kind":Kr.value,"hover-enabled":!q.value,onChange:a[111]||=(e,t)=>Wc(t??`transparent`),onCustom:$c,onReset:a[112]||=e=>Wc(Uc.value.defaultColor)},null,8,[`kind`,`label`,`preset-colors`,`color`,`custom-kind`,`hover-enabled`])):P.value===`highlight-settings`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,type:`button`,class:`norio-office-rich-code-block__setting-row`,role:`switch`,"aria-checked":jo.value.emojiEnabled,onMousedown:a[113]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Gc},[a[191]||=(0,t.createElementVNode)(`span`,null,`启用表情`,-1),(0,t.createElementVNode)(`span`,{class:`norio-office-rich-code-block__switch`,"data-checked":jo.value.emojiEnabled?`true`:`false`,"aria-hidden":`true`},[...a[190]||=[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-code-block__switch-thumb`},null,-1)]],8,Yw)],40,Jw)):P.value===`divider-style`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:4},(0,t.renderList)((0,t.unref)(Sp),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.value,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-divider-style-option`,{"norio-office-rich-block-side-menu__item--active":Lo.value===e.value}]),"aria-label":e.label,title:e.label,"aria-pressed":Lo.value===e.value,onMousedown:a[114]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>Kc({lineStyle:e.value})},[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-divider-style-option__preview`,style:(0,t.normalizeStyle)({borderTopStyle:e.value}),"aria-hidden":`true`},null,4),(0,t.createElementVNode)(`span`,Zw,(0,t.toDisplayString)(Lo.value===e.value?`✓`:``),1)],42,Xw))),128)):P.value===`divider-color`?((0,t.openBlock)(),(0,t.createBlock)(Rn,{key:5,color:Ro.value,"default-color":(0,t.unref)(xp),"recent-colors":br.value,onChange:qc},null,8,[`color`,`default-color`,`recent-colors`])):P.value===`color`?((0,t.openBlock)(),(0,t.createBlock)(Wn,{key:6,"text-color":Mo.value.text,"background-color":Mo.value.background,"custom-kind":Kr.value,"hover-enabled":!q.value,onChange:Zc,onCustom:$c,onReset:Qc},null,8,[`text-color`,`background-color`,`custom-kind`,`hover-enabled`])):P.value===`add-above`||P.value===`add-below`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:7},[(0,t.createElementVNode)(`div`,Qw,[a[192]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-block-side-menu__title`},`基础`,-1),(0,t.createElementVNode)(`div`,$w,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Qn,e=>(0,t.createElementVNode)(`button`,{key:`block-add-quick-${e.key}`,type:`button`,class:`norio-office-rich-block-side-menu__quick-button`,onClick:t=>Pc(e.action)},[e.type===`icon`?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.iconName||``,size:17,color:`#1f2937`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,tT,(0,t.toDisplayString)(e.label),1))],8,eT)),64))])]),(0,t.createElementVNode)(`div`,nT,[a[193]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-block-side-menu__title`},`常用`,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(nr,e=>(0,t.createElementVNode)(`button`,{key:`block-add-insert-${e.key}`,type:`button`,class:`norio-office-rich-block-side-menu__item`,onClick:t=>Pc(e.action)},[e.colorIconName?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.colorIconName},null,8,[`name`])):((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:`smile`,size:17,color:`#64748b`,"background-color":`transparent`})),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(N(e.key)),1)],8,rT)),64))])],64)):(0,t.createCommentVNode)(``,!0)],38)),[[t.vShow,!(q.value&&Kr.value)]]):(0,t.createCommentVNode)(``,!0),Ka.value&&Xa.value&&Kr.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:11,class:`norio-office-rich-block-side-submenu norio-office-rich-block-side-submenu--color norio-office-rich-block-side-submenu--tertiary`,style:(0,t.normalizeStyle)(po.value),role:`dialog`,"aria-label":tl.value.label,onMouseenter:a[121]||=e=>Ac(Ka.value),onMouseleave:kc,onMousedown:a[122]||=(0,t.withModifiers)(()=>{},[`stop`])},[q.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`norio-office-rich-block-side-menu__back norio-office-rich-block-colors__palette-back`,"aria-label":`返回颜色菜单`,onMousedown:a[117]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:a[118]||=e=>Kr.value=null},[(0,t.createVNode)(M,{name:`zuojiantou`,size:14,color:`currentColor`,"background-color":`transparent`}),a[194]||=(0,t.createElementVNode)(`span`,null,`返回`,-1)],32)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(Rn,{color:tl.value.color||tl.value.defaultColor,"default-color":tl.value.defaultColor,"recent-colors":tl.value.recentColors,onChange:el},null,8,[`color`,`default-color`,`recent-colors`]),(0,t.createElementVNode)(`div`,aT,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-color-menu__current`,onMousedown:a[119]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:a[120]||=e=>el(null)},`清除颜色`,32)])],44,iT)):(0,t.createCommentVNode)(``,!0),Mr.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:12,class:`norio-office-rich-drag-insert-indicator`,style:(0,t.normalizeStyle)({left:`${Mr.value.left}px`,top:`${Mr.value.top}px`,width:`${Mr.value.width}px`}),"aria-hidden":`true`},[...a[195]||=[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-drag-insert-indicator__line`},null,-1)]],4)):(0,t.createCommentVNode)(``,!0),ei.value&&Hn.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:13,class:`norio-office-rich-table-column-track`,style:(0,t.normalizeStyle)({left:`${Hn.value.left}px`,top:`${Hn.value.top-14}px`,width:`${Hn.value.width}px`})},[a[196]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-table-column-track__line`},null,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Un.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`table-column-segment-${e.index}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-column-track__segment`,{"norio-office-rich-table-column-track__segment--active":Jn.value===e.index}]),style:(0,t.normalizeStyle)({left:`${e.left-Hn.value.left}px`,width:`${e.width}px`}),onMousedown:a[123]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>xu(e.index)},null,46,oT))),128)),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Kn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:`norio-office-rich-table-track__dot norio-office-rich-table-track__dot--column`,title:`插入列`,"aria-label":`插入列`,style:(0,t.normalizeStyle)({left:`${e.left-Hn.value.left}px`}),onMousedown:a[124]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>Cu(e.insertIndex)},null,44,sT))),128))],4)):(0,t.createCommentVNode)(``,!0),ei.value&&Hn.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:14,class:`norio-office-rich-table-row-track`,style:(0,t.normalizeStyle)({left:`${Hn.value.left-14}px`,top:`${Hn.value.top}px`,height:`${Hn.value.height}px`})},[a[197]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-table-row-track__line`},null,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Gn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`table-row-segment-${e.index}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-row-track__segment`,{"norio-office-rich-table-row-track__segment--active":Yn.value===e.index}]),style:(0,t.normalizeStyle)({top:`${e.top-Hn.value.top}px`,height:`${e.height}px`}),onMousedown:a[125]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>Su(e.index)},null,46,cT))),128)),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(qn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:`norio-office-rich-table-track__dot norio-office-rich-table-track__dot--row`,title:`插入行`,"aria-label":`插入行`,style:(0,t.normalizeStyle)({top:`${e.top-Hn.value.top}px`}),onMousedown:a[126]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>wu(e.insertIndex)},null,44,lT))),128))],4)):(0,t.createCommentVNode)(``,!0),(0,t.createCommentVNode)(``,!0)],544)],4)]),_:1})]),F.value?((0,t.openBlock)(),(0,t.createElementBlock)(`aside`,{key:2,ref_key:`commentPanelRef`,ref:ce,class:`norio-office-rich-comment-panel`,"aria-label":`评论`},[(0,t.createElementVNode)(`div`,uT,[(0,t.createElementVNode)(`strong`,null,(0,t.toDisplayString)(hi.value),1)]),(0,t.createVNode)(sn,{"class-name":`norio-office-rich-comment-panel__scroll`},{default:(0,t.withCtx)(()=>[mi.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fT,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(mi.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`article`,{key:e.id,ref_for:!0,ref:t=>Ed(e.id,t),class:(0,t.normalizeClass)([`norio-office-rich-comment-card`,{"norio-office-rich-comment-card--active":gi.value?.id===e.id,"norio-office-rich-comment-card--pending":Rt.value?.id===e.id}]),onClick:t=>Pd(e)},[a[200]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-comment-card__topline`},null,-1),(0,t.createElementVNode)(`div`,mT,(0,t.toDisplayString)(xd(e)),1),(0,t.createElementVNode)(`div`,hT,[(0,t.createElementVNode)(`button`,{type:`button`,title:`删除`,disabled:Rt.value?.id===e.id,onClick:(0,t.withModifiers)(t=>Wd(e.id),[`stop`])},[(0,t.createVNode)(M,{name:`delete`,size:13,color:`#dc2626`,"background-color":`transparent`})],8,gT)]),e.comments.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_T,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(pd(e),n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:`norio-office-rich-comment-item`},[(0,t.createElementVNode)(`div`,{class:`norio-office-rich-comment-item__avatar`,style:(0,t.normalizeStyle)(rd(n.author))},[n.author.avatar?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:n.author.avatar,alt:``},null,8,vT)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,yT,(0,t.toDisplayString)(nd(n.author)),1))],4),(0,t.createElementVNode)(`div`,bT,[(0,t.createElementVNode)(`div`,xT,[(0,t.createElementVNode)(`strong`,null,(0,t.toDisplayString)(n.author.name),1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(id(n.updatedAt||n.createdAt)),1)]),zd(e.id,n)?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`textarea`,{class:`norio-office-rich-comment-composer__input`,value:Ft.value,rows:`2`,onInput:Bd,onKeydown:t=>Vd(e.id,n,t)},null,40,ST),(0,t.createElementVNode)(`div`,CT,[(0,t.createElementVNode)(`button`,{type:`button`,onClick:(0,t.withModifiers)(Hd,[`stop`])},`取消`),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-comment-composer__submit`,onClick:(0,t.withModifiers)(t=>Ud(e.id,n),[`stop`])},` 保存 `,8,wT)])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,TT,(0,t.toDisplayString)(n.content),1),n.images?.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ET,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n.images,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.url,type:`button`,class:`norio-office-rich-comment-images__item`,onClick:(0,t.withModifiers)(t=>Yd(e),[`stop`])},[(0,t.createElementVNode)(`img`,{src:e.url,alt:e.alt||e.name||``},null,8,OT)],8,DT))),128))])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,kT,[(0,t.createElementVNode)(`button`,{type:`button`,onClick:(0,t.withModifiers)(t=>yd(e,n),[`stop`])},`回复`,8,AT),n.author.id===pi.value?.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,onClick:(0,t.withModifiers)(t=>Rd(e.id,n),[`stop`])},`编辑`,8,jT)):(0,t.createCommentVNode)(``,!0),n.author.id===pi.value?.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,onClick:(0,t.withModifiers)(t=>Wd(e.id,n),[`stop`])},`删除`,8,MT)):(0,t.createCommentVNode)(``,!0)])],64)),md(e,n).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,NT,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(md(e,n),n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:`norio-office-rich-comment-item norio-office-rich-comment-item--reply`},[(0,t.createElementVNode)(`div`,{class:`norio-office-rich-comment-item__avatar`,style:(0,t.normalizeStyle)(rd(n.author))},[n.author.avatar?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:n.author.avatar,alt:``},null,8,PT)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,FT,(0,t.toDisplayString)(nd(n.author)),1))],4),(0,t.createElementVNode)(`div`,IT,[(0,t.createElementVNode)(`div`,LT,[(0,t.createElementVNode)(`strong`,null,(0,t.toDisplayString)(n.author.name),1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(id(n.updatedAt||n.createdAt)),1)]),zd(e.id,n)?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`textarea`,{class:`norio-office-rich-comment-composer__input`,value:Ft.value,rows:`2`,onInput:Bd,onKeydown:t=>Vd(e.id,n,t)},null,40,RT),(0,t.createElementVNode)(`div`,zT,[(0,t.createElementVNode)(`button`,{type:`button`,onClick:(0,t.withModifiers)(Hd,[`stop`])},`取消`),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-comment-composer__submit`,onClick:(0,t.withModifiers)(t=>Ud(e.id,n),[`stop`])},` 保存 `,8,BT)])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,VT,(0,t.toDisplayString)(n.content),1),n.images?.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,HT,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n.images,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.url,type:`button`,class:`norio-office-rich-comment-images__item`,onClick:(0,t.withModifiers)(t=>Yd(e),[`stop`])},[(0,t.createElementVNode)(`img`,{src:e.url,alt:e.alt||e.name||``},null,8,WT)],8,UT))),128))])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,GT,[(0,t.createElementVNode)(`button`,{type:`button`,onClick:(0,t.withModifiers)(t=>yd(e,n),[`stop`])},`回复`,8,KT),n.author.id===pi.value?.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,onClick:(0,t.withModifiers)(t=>Rd(e.id,n),[`stop`])},`编辑`,8,qT)):(0,t.createCommentVNode)(``,!0),n.author.id===pi.value?.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,onClick:(0,t.withModifiers)(t=>Wd(e.id,n),[`stop`])},`删除`,8,JT)):(0,t.createCommentVNode)(``,!0)])],64))])]))),128))])):(0,t.createCommentVNode)(``,!0),vd(e,n)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:`norio-office-rich-comment-composer norio-office-rich-comment-composer--inline`,onClick:a[128]||=(0,t.withModifiers)(()=>{},[`stop`])},[ud(e.id,gd(e.id)??void 0).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,YT,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(ud(e.id,gd(e.id)??void 0),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:`${n.url}-${r}`,class:`norio-office-rich-comment-draft-images__item`},[(0,t.createElementVNode)(`img`,{src:n.url,alt:n.alt||n.name||``},null,8,XT),(0,t.createElementVNode)(`button`,{type:`button`,onClick:t=>Jd(e.id,r,gd(e.id)??void 0)},`x`,8,ZT)]))),128))])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`textarea`,{class:`norio-office-rich-comment-composer__input`,placeholder:`回复 ${_d(e)?.author.name??``}`,value:od(e.id,gd(e.id)??void 0),rows:`2`,onInput:t=>cd(e.id,t,gd(e.id)??void 0),onKeydown:t=>ld(e.id,t,gd(e.id)??void 0)},null,40,QT),(0,t.createElementVNode)(`div`,$T,[(0,t.createElementVNode)(`button`,{type:`button`,title:`上传图片`,onClick:t=>Gd(e.id)},[(0,t.createVNode)(M,{name:`image`,size:14,color:`#667085`,"background-color":`transparent`})],8,eE),a[198]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-comment-composer__spacer`},null,-1),(0,t.createElementVNode)(`button`,{type:`button`,onClick:t=>bd(e.id,gd(e.id)??``)},`取消`,8,tE),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-comment-composer__submit`,disabled:!pi.value||!od(e.id,gd(e.id)??void 0).trim()&&!ud(e.id,gd(e.id)??void 0).length,onClick:t=>Ld(e.id,gd(e.id)??void 0)},` 回复 `,8,nE)])])):(0,t.createCommentVNode)(``,!0)])]))),128))])):Rt.value?.id===e.id?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,rE,` 暂无回复 `)),(gi.value?.id===e.id||Rt.value?.id===e.id)&&!_d(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`norio-office-rich-comment-composer`,onClick:a[129]||=(0,t.withModifiers)(()=>{},[`stop`])},[ud(e.id).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,iE,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(ud(e.id),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:`${n.url}-${r}`,class:`norio-office-rich-comment-draft-images__item`},[(0,t.createElementVNode)(`img`,{src:n.url,alt:n.alt||n.name||``},null,8,aE),(0,t.createElementVNode)(`button`,{type:`button`,onClick:t=>Jd(e.id,r)},`×`,8,oE)]))),128))])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`textarea`,{class:`norio-office-rich-comment-composer__input`,placeholder:Rt.value?.id===e.id?`输入评论`:`回复`,value:od(e.id),rows:`2`,onInput:t=>cd(e.id,t),onKeydown:t=>ld(e.id,t)},null,40,sE),(0,t.createElementVNode)(`div`,cE,[(0,t.createElementVNode)(`button`,{type:`button`,title:`上传图片`,onClick:t=>Gd(e.id)},[(0,t.createVNode)(M,{name:`image`,size:14,color:`#667085`,"background-color":`transparent`})],8,lE),a[199]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-comment-composer__spacer`},null,-1),Rt.value?.id===e.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,onClick:t=>Id(e.id)},` 取消 `,8,uE)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-comment-composer__submit`,disabled:!pi.value||!od(e.id).trim()&&!ud(e.id).length,onClick:t=>Ld(e.id)},(0,t.toDisplayString)(Rt.value?.id===e.id?`发布`:`回复`),9,dE)])])):(0,t.createCommentVNode)(``,!0)],10,pT))),128))])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dT,` 暂无评论 `))]),_:1})],512)):(0,t.createCommentVNode)(``,!0)]),ui.value&&Ht.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,ref_key:`commentMentionPanelRef`,ref:le,class:`norio-office-rich-mention-panel norio-office-rich-comment-mention-panel`,style:(0,t.normalizeStyle)(Ji.value),onMousedown:a[130]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createElementVNode)(`div`,fE,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(tn,e=>(0,t.createElementVNode)(`button`,{key:`comment-${String(e.key)}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-mention-panel__tab`,{"norio-office-rich-mention-panel__tab--active":Gt.value===e.key}]),onClick:t=>Da(e.key)},(0,t.toDisplayString)(e.label),11,pE)),64))]),(0,t.createVNode)(sn,{class:`norio-office-rich-mention-panel__scroll`},{default:(0,t.withCtx)(()=>[Ut.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,mE,`加载中...`)):qi.value.length?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:2},(0,t.renderList)(qi.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`comment-${e.type}-${e.id}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-mention-panel__item`,{"norio-office-rich-mention-panel__item--active":n===qt.value}]),onClick:t=>Oa(e,n),onDblclick:t=>Aa(e)},[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-mention-panel__avatar`,"data-type":e.type,style:(0,t.normalizeStyle)($i(e))},[e.type===1&&e.avatar?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:e.avatar,alt:``},null,8,vE)):e.type===2&&e.icon?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:e.icon,alt:``},null,8,yE)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,bE,(0,t.toDisplayString)(Qi(e)),1))],12,_E),(0,t.createElementVNode)(`span`,xE,[(0,t.createElementVNode)(`span`,SE,[(0,t.createElementVNode)(`span`,CE,(0,t.toDisplayString)(e.name),1),e.tag?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,wE,(0,t.toDisplayString)(e.tag),1)):(0,t.createCommentVNode)(``,!0)]),e.type===2&&e.updatedAt?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,TE,` 最近修改:`+(0,t.toDisplayString)(e.updatedAt),1)):(0,t.createCommentVNode)(``,!0)])],42,gE))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,hE,`暂无可提及内容`))]),_:1}),(0,t.createElementVNode)(`div`,EE,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-mention-panel__submit`,disabled:!U.value,onClick:ja},` 提及 `,8,DE)])],36)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[Xr.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`norio-office-rich-block-drag-ghost`,style:(0,t.normalizeStyle)(mo.value),"aria-hidden":`true`},[(0,t.createElementVNode)(`div`,{class:`norio-office-rich-block-drag-ghost__content norio-office-rich-prosemirror`,innerHTML:Xr.value.html},null,8,OE)],4)):(0,t.createCommentVNode)(``,!0)])),(0,t.createVNode)(Rl,{open:rn.value,value:on.value,title:`插入 LaTeX 公式`,"submit-label":`插入`,onClose:Wu,onSubmit:qu},null,8,[`open`,`value`]),(0,t.createElementVNode)(`input`,{ref_key:`markdownImportInputRef`,ref:pe,type:`file`,accept:`.md,.markdown,text/markdown,text/plain`,hidden:``,onChange:Ku},null,544),(0,t.createElementVNode)(`input`,{ref_key:`localFileInputRef`,ref:me,type:`file`,hidden:``,onChange:cf},null,544),(0,t.createElementVNode)(`input`,{ref_key:`imageUploadInputRef`,ref:he,type:`file`,accept:`image/*`,hidden:``,onChange:of},null,544),(0,t.createElementVNode)(`input`,{ref_key:`videoUploadInputRef`,ref:ge,type:`file`,accept:`video/*`,hidden:``,onChange:sf},null,544),(0,t.createElementVNode)(`input`,{ref_key:`commentImageInputRef`,ref:_e,type:`file`,accept:`image/*`,hidden:``,onChange:qd},null,544),zt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:`norio-office-rich-comment-image-viewer`,role:`dialog`,"aria-modal":`true`,onClick:(0,t.withModifiers)(Xd,[`self`])},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-comment-image-viewer__close`,"aria-label":`Close image preview`,onClick:Xd},[(0,t.createVNode)(M,{name:`close`,size:20,color:`#ffffff`,"background-color":`transparent`})]),(0,t.createElementVNode)(`div`,kE,[(0,t.createElementVNode)(`img`,{class:`norio-office-rich-comment-image-viewer__image`,src:zt.value.url,alt:zt.value.alt||zt.value.name||``},null,8,AE),zt.value.name||zt.value.description?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,jE,[zt.value.name?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ME,(0,t.toDisplayString)(zt.value.name),1)):(0,t.createCommentVNode)(``,!0),zt.value.description?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,NE,(0,t.toDisplayString)(zt.value.description),1)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)])])):(0,t.createCommentVNode)(``,!0),kt.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,PE,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(kt.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:(0,t.normalizeClass)([`norio-office-rich-upload-panel__item`,{"norio-office-rich-upload-panel__item--uploading":e.status===`uploading`,"norio-office-rich-upload-panel__item--error":e.status===`error`}])},[e.status===`uploading`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,FE)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,IE,`!`)),(0,t.createElementVNode)(`div`,LE,[(0,t.createElementVNode)(`div`,RE,(0,t.toDisplayString)(Es(e)),1),(0,t.createElementVNode)(`div`,zE,(0,t.toDisplayString)(e.message||e.fileName),1)]),e.status===`error`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,type:`button`,class:`norio-office-rich-upload-panel__button`,onClick:e.retry},` 重试 `,8,BE)):(0,t.createCommentVNode)(``,!0),e.status===`error`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,type:`button`,class:`norio-office-rich-upload-panel__button norio-office-rich-upload-panel__button--ghost`,onClick:t=>Ds(e.id)},` 关闭 `,8,VE)):(0,t.createCommentVNode)(``,!0)],2))),128))])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`footer`,HE,[(0,t.createElementVNode)(`div`,UE,[(0,t.createElementVNode)(`div`,WE,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(R.value),1)]),(0,t.createElementVNode)(`div`,GE,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(z.value),1)])]),(0,t.createElementVNode)(`div`,KE,[(0,t.createElementVNode)(`div`,qE,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-statusbar__button norio-office-rich-statusbar__button--icon`,title:`缩小`,"aria-label":`缩小`,disabled:Zt.value<=50,onClick:a[131]||=e=>uc(Zt.value-10)},[(0,t.createVNode)(M,{name:`jianshao`,size:13,color:`currentColor`,"background-color":`transparent`})],8,JE),(0,t.createElementVNode)(`div`,YE,(0,t.toDisplayString)(Zt.value)+`%`,1),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-statusbar__button norio-office-rich-statusbar__button--icon`,title:`放大`,"aria-label":`放大`,disabled:Zt.value>=200,onClick:a[132]||=e=>uc(Zt.value+10)},[(0,t.createVNode)(M,{name:`add`,size:13,color:`currentColor`,"background-color":`transparent`})],8,XE)])])]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:`norio-office-rich-editor__presentation-pointer`,style:(0,t.normalizeStyle)(Vi.value),"aria-hidden":`true`},null,4),[[t.vShow,Je.value]]),((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:qe.value&&ne.value?ne.value:`body`},[Ei.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`slashMenuRef`,ref:fe,class:`norio-office-rich-slash-menu`,style:(0,t.normalizeStyle)(Di.value),role:Ti.value?`listbox`:void 0,"aria-label":Ti.value?`斜杠命令`:`表情符号`,onMousedown:a[133]||=(0,t.withModifiers)(()=>{},[`prevent`])},[Ti.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[Si.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,QE,[a[201]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-slash-menu__title`},`基础`,-1),(0,t.createElementVNode)(`div`,$E,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Si.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,role:`option`,class:(0,t.normalizeClass)([`norio-office-rich-slash-menu__quick-item`,{"norio-office-rich-slash-menu__item--active":e.index===at.value}]),"aria-label":e.label,"aria-selected":e.index===at.value,onMouseenter:t=>at.value=e.index,onClick:t=>Bl(e)},[e.iconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.iconName,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,tD,(0,t.toDisplayString)(e.key===`paragraph`?`T`:e.label),1))],42,eD))),128))])])):(0,t.createCommentVNode)(``,!0),Ci.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,nD,[a[202]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-slash-menu__title`},`常用`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Ci.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,role:`option`,class:(0,t.normalizeClass)([`norio-office-rich-slash-menu__item`,{"norio-office-rich-slash-menu__item--active":e.index===at.value}]),"aria-selected":e.index===at.value,onMouseenter:t=>at.value=e.index,onClick:t=>Bl(e)},[e.iconName&&e.isColorIcon?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.iconName,size:20,"background-color":`transparent`},null,8,[`name`])):e.iconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:e.iconName,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,iD,(0,t.toDisplayString)(e.label),1)],42,rD))),128))])):(0,t.createCommentVNode)(``,!0),wi.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,aD,[a[203]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-slash-menu__title`},`更多`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(wi.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,role:`option`,class:(0,t.normalizeClass)([`norio-office-rich-slash-menu__item`,{"norio-office-rich-slash-menu__item--active":e.index===at.value}]),"aria-selected":e.index===at.value,onMouseenter:t=>at.value=e.index,onClick:t=>Bl(e)},[e.iconName&&e.isColorIcon?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.iconName,size:20,"background-color":`transparent`},null,8,[`name`])):e.iconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:e.iconName,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,sD,(0,t.toDisplayString)(e.label),1)],42,oD))),128))])):(0,t.createCommentVNode)(``,!0),xi.value.length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cD,`无匹配命令`))],64)):((0,t.openBlock)(),(0,t.createBlock)(hr,{key:1,onSelect:Vl}))],44,ZE)):(0,t.createCommentVNode)(``,!0)],8,[`to`]))],40,Xb))}}),AD=(0,t.defineComponent)({__name:`RichTextOutline`,props:{editor:{},open:{type:Boolean,default:!0},placement:{default:`right`},title:{default:`大纲`},collapseTitle:{default:`收起大纲`},emptyDescription:{default:`对文档内容应用“标题”样式,即可自动生成大纲。`},emptyTip:{default:``},showCollapse:{type:Boolean,default:!1}},emits:[`toggle`,`select`,`change`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)([]),o=(0,t.ref)(null),s=null;function c(){return(0,t.unref)(r.editor)}function l(e){a.value=e.items,o.value=e.activePos,i(`change`,e)}function u(){let e=c();l({items:e?.getOutlineItems()??[],activePos:e?.getActiveOutlinePos()??null})}function d(){s?.(),s=null;let e=c();e?s=e.onOutlineChange(l):u()}function f(e){i(`select`,e),c()?.focusOutlineItem(e)}return(0,t.watch)(()=>c(),d,{immediate:!0}),(0,t.onBeforeUnmount)(()=>{s?.()}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(Xl,{standalone:``,open:e.open,placement:e.placement,title:e.title,"collapse-title":e.collapseTitle,"empty-description":e.emptyDescription,"empty-tip":e.emptyTip,"show-collapse":e.showCollapse,items:a.value,"active-pos":o.value,onToggle:r[0]||=e=>i(`toggle`),onSelect:f},null,8,[`open`,`placement`,`title`,`collapse-title`,`empty-description`,`empty-tip`,`show-collapse`,`items`,`active-pos`]))}}),jD=kD;e.OfficeColorIcon=an,e.OfficeIcon=M,e.RICH_TEXT_EDITOR_EXPORT_CODES=s_,e.RICH_TEXT_EDITOR_FEATURE_CODES=o_,e.RICH_TEXT_EDITOR_INSERT_MENU_CODES=c_,e.RICH_TEXT_EDITOR_TOOLBAR_ACTION_CODES=l_,e.RichTextEditor=kD,e.RichTextOutline=AD,e.ScrollArea=sn,e.colorIconNames=nn,e.default=jD,e.isRichTextCodeEnabled=u_,e.isRichTextFeatureCodeEnabled=d_,e.monoIconNames=tn,e.resolveRichTextOutlinePlacement=f_});
8163
+ </html>`}function Gs(){let e=Ms();return e?Ws(e.outerHTML):null}function Ks(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}T${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`}function qs(){let e=new Date;return e.setSeconds(0,0),e.setMinutes(e.getMinutes()+1),Ks(e)}function Js(e,t){let n=new Date(e),r=`${String(n.getHours()).padStart(2,`0`)}:${String(n.getMinutes()).padStart(2,`0`)}`,[i,a]=String(t||r).split(`:`);n.setHours(Xs(i,23),Xs(a,59),0,0);let o=Mn.value;n.getTime()<o.getTime()&&n.setTime(o.getTime()),fn.value=Ks(n),bn.value=n.getFullYear(),xn.value=n.getMonth(),Sn.value=`${String(n.getHours()).padStart(2,`0`)}:${String(n.getMinutes()).padStart(2,`0`)}`}function Ys(){dn.value=`deadline`,_n.value=!1,vn.value=!1,Js(new Date(qs())),pn.value=`0`,mn.value=`0`,hn.value=`1`,gn.value=`0`}function Xs(e,t){let n=Number.parseInt(e||`0`,10);return!Number.isFinite(n)||n<0?0:typeof t==`number`?Math.min(t,n):n}function Zs(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;pn.value=String(n),mn.value=String(r),hn.value=String(i),gn.value=String(a)}function Qs(e){let t=Number(e.targetTimestamp??0)||Date.now()+6e4,n=e.mode===`duration`?`duration`:`deadline`;dn.value=n,Js(new Date(t)),Zs(Math.max(1e3,t-Date.now())),_n.value=!1}function $s(e,t,n){let r=new Date(e,t,n);new Date(e,t,n,23,59,59,999).getTime()<Mn.value.getTime()||Js(r,Sn.value)}function ec(){Js(new Date,Nn.value)}function Y(e){bn.value=Number.parseInt(e,10)||new Date().getFullYear()}function tc(e){xn.value=Number.parseInt(e,10)||0}function nc(e){Js(An.value??new Date,e)}function rc(){nc(Sn.value),_n.value=!1}function ic(){if(!W.value?.isActive(`countdownBlock`))return;let e=!vn.value;vn.value=e,_n.value=!1,e&&Qs(zo.value)}function ac(){if(!Se.value){yn.value=`bottom`;return}let e=Se.value.getBoundingClientRect(),t=Ce.value?.offsetHeight??420,n=window.innerHeight-e.bottom-16,r=e.top-16;yn.value=n>=t||n>=r?`bottom`:`top`}function oc(){dn.value===`deadline`&&(_n.value=!_n.value,_n.value&&(0,t.nextTick)(ac))}function sc(){if(!W.value)return null;let{state:e}=W.value,{$from:t}=e.selection,n=t.depth;if(n<=0)return{from:e.selection.from,to:e.selection.from,isEmpty:!1};let r=t.node(n),i=r.isTextblock&&r.textContent.trim().length===0;return{from:t.before(n),to:i?t.after(n):t.before(n),isEmpty:i}}function cc(){qe.value=document.fullscreenElement===ne.value,qe.value||(Je.value=!1)}async function lc(){Je.value=!1,document.fullscreenElement===ne.value&&await document.exitFullscreen()}function uc(e){Zt.value=Math.max(50,Math.min(200,e))}function dc(){ai.value&&(Ye.value=!Ye.value,(0,t.nextTick)(()=>{window.requestAnimationFrame(()=>{(Ye.value?ne.value?.querySelector(`.norio-office-rich-outline--internal .norio-office-rich-outline__collapse`):Xe.value)?.focus({preventScroll:!0})})}))}function fc(e){return W.value?(W.value.chain().focus(e+1).run(),Ia(),(0,t.nextTick)(()=>{let t=W.value?.view.nodeDOM(e),n=kd();t instanceof HTMLElement&&n&&Ad(t,n)}),!0):!1}function pc(){jr.value=[]}function mc(){Or.value=null,kr.value=null,Ar.value=!1}function hc(e){let t=e instanceof Element?e:null;return t?!!t.closest(`button,input,textarea,select,a,.norio-office-rich-outline,.norio-office-rich-statusbar__button,.norio-office-rich-toolbar__button,.norio-office-rich-table-column-track,.norio-office-rich-table-row-track,.norio-office-rich-table-track__dot,.norio-office-rich-columns__overlay,.norio-office-rich-columns__divider-hitbox,.norio-office-rich-columns__add-button,.norio-office-rich-video-block__toolbar,.norio-office-rich-video-block__handle,.norio-office-rich-video-block__bottom-bar,.norio-office-rich-image-block__toolbar,.norio-office-rich-image-block__handle,.norio-office-rich-image-block__bottom-bar,.norio-office-rich-image-block__side-tools,.norio-office-rich-link-block__toolbar,.norio-office-rich-link-block__handle,.norio-office-rich-link-block__bottom-bar,.norio-office-rich-block-side-control,.norio-office-rich-block-side-menu,.norio-office-rich-block-side-submenu,.norio-office-rich-formula-editor`.split(`,`).join(`, `)):!1}function gc(e){let t=e instanceof Element?e:e?.parentElement??null;return t?!!t.closest([`.norio-office-rich-editor__toolbar`,`.norio-office-rich-toolbar__menu`,`.norio-office-rich-block-side-control`,`.norio-office-rich-block-side-menu`,`.norio-office-rich-block-side-submenu`].join(`, `)):!1}function _c(e,t){if(!j.value)return null;let n=j.value.getBoundingClientRect(),r=za.value||1;return{x:(e-n.left)/r,y:(t-n.top)/r}}function vc(e,t){return e.left<t.left+t.width&&e.left+e.width>t.left&&e.top<t.top+t.height&&e.top+e.height>t.top}function yc(){if(!W.value||!j.value)return[];let e=j.value.getBoundingClientRect(),t=za.value||1,n=[];return W.value.state.doc.forEach((r,i)=>{let a=W.value?.view.nodeDOM(i);if(!(a instanceof HTMLElement))return;let o=a.getBoundingClientRect();o.width<=0||o.height<=0||n.push({pos:i,from:i,to:i+r.nodeSize,node:r,dom:a,rect:{left:(o.left-e.left)/t,top:(o.top-e.top)/t,width:o.width/t,height:o.height/t}})}),n}function bc(e){let{node:t}=e,n=t.type.name,r=n===`paragraph`&&t.textContent.trim().length===0&&t.childCount===0;if(r)return{isEmpty:r,textIcon:`+`,label:`插入`};if(n===`heading`){let e=Number(t.attrs.level??1);return{isEmpty:r,textIcon:`H${e}`,label:`标题 ${e}`}}return{isEmpty:r,...{paragraph:{textIcon:`T`,label:`正文`},bulletList:{iconName:`wuxuliebiao`,label:`无序列表`},orderedList:{iconName:`youxuliebiao`,label:`有序列表`},taskList:{iconName:`To-do`,label:`任务`},blockquote:{iconName:`yinyong`,label:`引用`},codeBlock:{iconName:`codeblock`,label:`代码块`},horizontalRule:{textIcon:`—`,label:`分隔线`},imageBlock:{iconName:`image`,label:`图片`},videoBlock:{textIcon:`▶`,label:`视频`},localFileBlock:{iconName:`attachment`,label:`本地文件`},linkBlock:{iconName:`link`,label:`链接`},countdownBlock:{iconName:`days`,label:`倒计时`},highlightBlock:{iconName:`gaoliangkuai`,label:`高亮块`},formulaBlock:{textIcon:`fx`,label:`公式`},columnsBlock:{iconName:`split`,label:`分栏`},table:{textIcon:`▦`,label:`表格`}}[n]??{textIcon:`T`,label:`块`}}}function xc(e){return{...e,...bc(e)}}function Sc(e,t,n){let r=_c(e,t);if(!r)return null;let i=yl(),a=i?i.left-ED-CD-12:0,o=i?i.left+i.width+28:lD;if(n?.dom.isConnected&&W.value?.state.doc.nodeAt(n.pos)?.eq(n.node)){let e=j.value.getBoundingClientRect(),t=n.dom.getBoundingClientRect(),i=za.value||1,s={left:(t.left-e.left)/i,top:(t.top-e.top)/i,width:t.width/i,height:t.height/i};if(r.y>=s.top&&r.y<=s.top+s.height&&r.x>=a&&r.x<=o){let e=n.rect;return e.left===s.left&&e.top===s.top&&e.width===s.width&&e.height===s.height?n:{...n,rect:s}}}return yc().map(xc).find(e=>r.y>=e.rect.top-8&&r.y<=e.rect.top+e.rect.height+8&&r.x>=a&&r.x<=o)??null}function Cc(){Fr.value=!0,Mc(),Nr.value=null}function wc(){let e=window.getSelection(),t=W.value?.view.dom;Rr.value=!!t&&!!e&&!e.isCollapsed&&!!e.anchorNode&&t.contains(e.anchorNode)&&!!e.focusNode&&t.contains(e.focusNode)}function Tc(e){ei.value&&e.target instanceof Node&&W.value?.view.dom.contains(e.target)&&(e instanceof KeyboardEvent&&!e.isComposing&&![`Enter`,`Backspace`,`Delete`,`Tab`].includes(e.key)&&(e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)||(Cc(),Ir.value=!0,Vr!==null&&clearTimeout(Vr),Vr=setTimeout(()=>{Ir.value=!1,Vr=null},300)))}function Ec(e){e.target instanceof Node&&W.value?.view.dom.contains(e.target)&&(Lr.value=!0,Tc(e))}function Dc(e){e.target instanceof Node&&W.value?.view.dom.contains(e.target)&&(Lr.value=!1,Tc(e),(0,t.nextTick)(Bl))}function Oc(e){if(!ei.value||Je.value||Yr.value){Nr.value=null;return}let t=e.target;if(t instanceof Element&&t.closest(`.norio-office-rich-block-side-control, .norio-office-rich-block-side-menu, .norio-office-rich-block-side-submenu, .norio-office-rich-block-side-table-theme`))return;if(e.buttons||Ir.value||Lr.value||Or.value||Wi.value||(Fr.value=!1,wc(),Ga.value)){Nr.value=null;return}let n=Sc(e.clientX,e.clientY,Nr.value);n!==Nr.value&&(Nr.value=n)}function kc(e){let t=e.relatedTarget;t instanceof Element&&t.closest(`.norio-office-rich-block-side-control, .norio-office-rich-block-side-menu, .norio-office-rich-block-side-submenu, .norio-office-rich-block-side-table-theme`)||!Hr.value&&!P.value&&(Nr.value=null)}function Ac(e){Nr.value=e,Pr.value=e}function X(e){Nr.value=e,Hr.value&&(Pr.value=e)}function jc(e,t){if(Ga.value)return;if(Hr.value===t&&Pr.value?.pos===e.pos){Mc();return}let n=t===`actions`&&Hr.value===t&&Pr.value?.pos===e.pos&&Ur.value;Ac(e),n||(Ur.value=t===`actions`?no.value:null),Hr.value=t,P.value=null,Wr.value=null,Gr.value=t===`actions`&&!e.node.isLeaf?e.pos:null,Kr.value=null}function Mc(){Hr.value=null,Ur.value=null,P.value=null,Wr.value=null,Gr.value=null,Kr.value=null,Ue.value=null,Pr.value=null}function Nc(e,t){return t===`add-above`?{from:e.from,to:e.from}:t===`add-below`?{from:e.to,to:e.to}:e.isEmpty?{from:e.from,to:e.to}:{from:e.to,to:e.to}}function Pc(e){return e===`image`?{type:`imageBlock`,attrs:{images:[{id:bs()}],widthPercent:100}}:e===`video`?{type:`videoBlock`,attrs:{src:``,name:``,description:``,mimeType:`video/mp4`,align:`left`,widthPercent:100,height:220}}:e===`link`?{type:`linkBlock`,attrs:{title:``,url:``,displayMode:`preview`,align:`left`,widthPercent:100,height:420}}:e===`countdown`?{type:`countdownBlock`,attrs:{targetTimestamp:0,mode:`duration`,color:`#ff8b00`,reminderEnabled:!0}}:e===`emoji`?{type:`paragraph`,content:[{type:`text`,text:`😀`}]}:e===`columns`?Lu(2):e===`formula`?{type:`formulaBlock`,attrs:{latex:``}}:Ru(e)}function Fc(e){if(!W.value||!Pr.value||!Hr.value)return;let t=Pr.value,n=Nc(t,P.value===`add-above`||P.value===`add-below`?P.value:Hr.value);if(e===`table`){W.value.chain().focus().insertContentAt(n,(0,i.createTable)(W.value.schema,3,3,!1).toJSON(),{updateSelection:!0}).run(),Mc(),ou();return}let r=Pc(e);r?(W.value.chain().focus().insertContentAt(n,r,{updateSelection:!0}).run(),Mc(),ou()):Mc()}function Ic(e){if(!W.value)return!1;let t=Math.min(e.from+1,Math.max(e.from,e.to-1));return W.value.chain().focus(t).run(),!0}function Lc(e){return e.node.type.name}function Rc(e){return or.has(Lc(e))}function zc(e){return sr.has(Lc(e))}function Bc(e){let t=[];return[`paragraph`,`heading`].includes(e.node.type.name)?[{pos:e.pos,node:e.node}]:(zc(e)&&e.node.descendants((n,r)=>{if([`paragraph`,`heading`].includes(n.type.name))return t.push({pos:e.pos+1+r,node:n}),!1}),t)}function Vc(e){return cr.has(Lc(e))}function Hc(e,t){if(!W.value)return!1;let{state:n,view:r}=W.value;return r.dispatch(n.tr.setMeta(`officeBlockSideAttrs`,e.pos).setNodeMarkup(e.pos,void 0,{...e.node.attrs,...t})),!0}function Uc(e){let t=Gr.value,n=Pr.value,r=t===null?null:W.value?.state.doc.nodeAt(t);return!ei.value||!W.value?.isEditable||!n||t===null||r?.type.name!==`highlightBlock`?!1:Hc({...n,pos:t,node:r},e)}let Wc=(0,t.computed)(()=>{let e=P.value;if(!$t.includes(e??``))return null;let t=e===`quote-border`||e===`quote-background`,n=e===`highlight-border`||e===`quote-border`,r=t?n?`quoteBorderColor`:`quoteBackgroundColor`:n?`borderColor`:`backgroundColor`,i=t?(n?gr[0]:_r[0]).toLowerCase():n?vD:yD,a=Pr.value?.node;return{nodeType:t?`blockquote`:`highlightBlock`,attribute:r,kind:n?`border`:`fill`,label:n?`边框颜色`:t?`背景颜色`:`填充颜色`,color:String(a?.attrs[r]??i),defaultColor:i,presetColors:t?n?vr:yr:void 0}});function Gc(e){let t=Wc.value,n=Gr.value,r=Pr.value,i=n===null?null:W.value?.state.doc.nodeAt(n);t&&ei.value&&W.value?.isEditable&&r&&n!==null&&i?.type.name===t.nodeType&&Hc({...r,pos:n,node:i},{[t.attribute]:e})&&e!==`transparent`&&(br.value=[e,...br.value.filter(t=>t.toLowerCase()!==e.toLowerCase())].slice(0,10))}function Kc(){Uc({emojiEnabled:!jo.value.emojiEnabled})}function qc(e){let t=Pr.value,n=t&&W.value?.state.doc.nodeAt(t.pos);ei.value&&t&&n?.type.name===`horizontalRule`&&(Hc({...t,node:n},e),Ac({...t,node:W.value.state.doc.nodeAt(t.pos)}))}function Jc(e){let t=wp(e);t&&(qc({lineColor:t===`#dfe5ee`?null:t}),br.value=[t,...br.value.filter(e=>e.toLowerCase()!==t)].slice(0,10))}function Yc(e){let t=Pr.value;if(W.value&&t&&qa.value.some(t=>t.action===e)){if(Ic(t),e===`paragraph`)W.value.chain().focus().setParagraph().run();else if(e.startsWith(`heading-`)){let t=Number(e.replace(`heading-`,``));W.value.chain().focus().toggleHeading({level:t}).run()}else e===`bullet-list`?W.value.chain().focus().toggleBulletList().run():e===`ordered-list`?W.value.chain().focus().toggleOrderedList().run():e===`task-list`&&W.value.chain().focus().toggleTaskList().run();Mc(),ou()}}function Xc(e){let t=Pr.value,n=t&&W.value?.state.doc.nodeAt(t.pos);if(!ei.value||!W.value?.isEditable||!t||!n||!zc(t))return;let r=e.startsWith(`align-`)?e.slice(6):void 0;if(r!==void 0&&![`left`,`center`,`right`].includes(r)||r===void 0&&e!==`indent-more`&&e!==`indent-less`)return;let i=W.value.state.tr.setMeta(`officeBlockSideAttrs`,t.pos);for(let a of Bc({...t,node:n})){let t={...a.node.attrs};r===void 0?t.indent=Math.max(0,Math.min(8,Number(t.indent??0)+(e===`indent-more`?1:-1))):t.textAlign=r,(t.textAlign!==a.node.attrs.textAlign||t.indent!==a.node.attrs.indent)&&i.setNodeMarkup(a.pos,void 0,t)}i.docChanged&&W.value.view.dispatch(i)}function Zc(e){let t=Pr.value;if(!ei.value||!W.value?.isEditable||!t||!Vc(t))return;let{state:n,view:r}=W.value,i=n.doc.nodeAt(t.pos),a=n.schema.marks.textStyle;if(!i||i.type.name!==t.node.type.name||!a)return;let o=n.tr;n.doc.nodesBetween(t.pos+1,t.pos+i.nodeSize-1,(t,n)=>{if(!t.isText)return;let r={...t.marks.find(e=>e.type===a)?.attrs,...e};Object.values(r).some(e=>e!=null&&e!==``)?o.addMark(n,n+t.nodeSize,a.create(r)):o.removeMark(n,n+t.nodeSize,a)}),o.docChanged&&r.dispatch(o)}function Qc(e,t){if((e===`text`||e===`background`)&&(Zc(e===`text`?{color:t}:{backgroundColor:t}),t)){let n=e===`text`?br:xr;n.value=[t,...n.value.filter(e=>e.toLowerCase()!==t.toLowerCase())].slice(0,10)}}function $c(){Zc({color:null,backgroundColor:null})}function el(e,t){Ue.value=t,Kr.value=e}function tl(e){let t=Kr.value;t===`border`||t===`fill`?Gc(e??`transparent`):t&&Qc(t,e)}let nl=(0,t.computed)(()=>{let e=Kr.value,t=Wc.value;return(e===`border`||e===`fill`)&&t?{label:`自定义${t.label}选择`,color:t.color,defaultColor:t.defaultColor,recentColors:br.value}:{label:e===`text`?`自定义文字颜色选择`:`自定义背景颜色选择`,color:e===`text`?Mo.value.text:Mo.value.background,defaultColor:e===`text`?`#273142`:`#FFFFFF`,recentColors:e===`text`?br.value:xr.value}});function rl(e){return il(new o.Slice(o.Fragment.from(e.node),0,0))}function il(e){if(!W.value)return null;let t=W.value.view.serializeForClipboard(e);return{json:t.slice.openStart===0&&t.slice.openEnd===0?t.slice.content.toJSON():void 0,html:t.dom.innerHTML,text:t.text}}function al(e,t){return e.clipboardData?(e.clipboardData.clearData(),e.clipboardData.setData(`text/html`,t.html),e.clipboardData.setData(`text/plain`,t.text),t.json?.length&&e.clipboardData.setData(hD,JSON.stringify(t.json)),e.preventDefault(),e.stopPropagation(),qr.value=t,!0):!1}async function ol(e){if(!W.value)return!1;let t=rl(e);qr.value=t;let n={payload:t,written:!1};Jr=n;try{W.value.view.focus(),document.execCommand(`copy`)||(n.written=!1)}catch{}finally{Jr=null}if(n.written)return!0;try{return!navigator.clipboard?.write||typeof ClipboardItem>`u`?!1:(await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t.html],{type:`text/html`}),"text/plain":new Blob([t.text],{type:`text/plain`})})]),!0)}catch{return!1}}async function sl(e){if(!W.value||!ei.value)return;let t=W.value.state.doc;await ol(e)&&W.value?.state.doc===t&&ul(e)}async function cl(){try{if(navigator.clipboard?.read){let e=await navigator.clipboard.read();for(let t of e){let e=t.types.includes(`text/html`)?await(await t.getType(`text/html`)).text():``,n=t.types.includes(`text/plain`)?await(await t.getType(`text/plain`)).text():``;if(e||n)return{html:e,text:n}}return null}if(navigator.clipboard?.readText){let e=await navigator.clipboard.readText();return e?{html:``,text:e}:null}}catch{}return qr.value}async function ll(e){if(!W.value||!ei.value)return;let t=W.value.state.doc,n=await cl();if(!n||!W.value||W.value.state.doc!==t)return;let r=n.json?.length?n.json:n.html||n.text.split(/\r\n?|\n/).map(e=>({type:`paragraph`,content:e?[{type:`text`,text:e}]:[]}));W.value.chain().focus().insertContentAt({from:e.to,to:e.to},r,{updateSelection:!0}).run(),Mc()}function ul(e){W.value&&ei.value&&(W.value.chain().focus().deleteRange({from:e.from,to:e.to}).run(),Mc(),Nr.value=null)}function dl(e,t){if(!W.value||!ei.value||Je.value)return;e.preventDefault(),e.stopPropagation(),Ac(t),Hr.value=null,P.value=null,Gr.value=null,Kr.value=null,Yr.value={from:t.from,to:t.to,content:t.node.toJSON()};let n=t.dom.getBoundingClientRect(),r=Math.min(1,DD/Math.max(n.width,1),OD/Math.max(n.height,1)),i=(e.clientX-n.left)*r,a=(e.clientY-n.top)*r;Xr.value={html:t.dom.outerHTML,left:e.clientX-i,top:e.clientY-a,width:n.width*r,height:n.height*r,sourceWidth:n.width,sourceHeight:n.height,scale:r,offsetX:i,offsetY:a};let o=e=>{Xr.value&&={...Xr.value,left:e.clientX-Xr.value.offsetX,top:e.clientY-Xr.value.offsetY};let t=bl(e.clientX,e.clientY);t?Mr.value=t:Mr.value=null},s=e=>{document.removeEventListener(`mousemove`,o),document.removeEventListener(`mouseup`,s);let t=Yr.value,n=Mr.value??bl(e.clientX,e.clientY);if(Mr.value=null,Yr.value=null,Xr.value=null,!t||!n||n.range.from>=t.from&&n.range.from<=t.to)return;let r=n.range.from;r>t.from&&(r-=t.to-t.from),W.value?.chain().focus().deleteRange({from:t.from,to:t.to}).insertContentAt(r,t.content,{updateSelection:!0}).run(),Mc(),Nr.value=null};document.addEventListener(`mousemove`,o),document.addEventListener(`mouseup`,s),o(e)}function fl(e){return e.type.startsWith(`image/`)}function pl(e){return e.type.startsWith(`video/`)}function ml(e){return!fl(e)&&!pl(e)}function hl(e){return e?Array.from(e.items??[]).some(e=>e.kind===`file`)?!0:Array.from(e.files??[]).length>0:!1}function gl(e){return e?Array.from(e.files??[]).filter(fl).slice(0,4):[]}function _l(e){return e?Array.from(e.files??[]).find(pl)??null:null}function vl(e){return e?Array.from(e.files??[]).filter(ml):[]}function yl(){if(!j.value)return null;let e=j.value.getBoundingClientRect(),t=j.value.querySelector(`.norio-office-rich-prosemirror`),n=t?.getBoundingClientRect(),r=za.value||1,i=t?getComputedStyle(t):null,a=Number.parseFloat(i?.paddingLeft??`0`)||0,o=Number.parseFloat(i?.paddingRight??`0`)||0;return n?{left:(n.left-e.left+a)/r,width:Math.max((n.width-a-o)/r,320)}:{left:98,width:864}}function bl(e,t){if(!W.value||!j.value)return null;let n=_c(e,t),r=yl();if(!n||!r)return null;let i=yc();if(!i.length){let i=W.value.view.posAtCoords({left:e,top:t})?.pos??W.value.state.doc.content.size;return{left:r.left,top:Math.max(52,n.y),width:r.width,range:{from:i,to:i}}}for(let e of i){let t=e.rect.top+e.rect.height/2;if(n.y<t)return{left:r.left,top:e.rect.top,width:r.width,range:{from:e.from,to:e.from}}}let a=i[i.length-1];return{left:r.left,top:a.rect.top+a.rect.height,width:r.width,range:{from:a.to,to:a.to}}}function xl(e){if(!ei.value||Je.value||W.value?.view.dragging||!hl(e.dataTransfer))return Mr.value=null,!1;let t=bl(e.clientX,e.clientY);return t?(e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),Mr.value=t,!0):(Mr.value=null,!1)}function Sl(){if(!Ar.value||!Hi.value)return;let e=yc().filter(e=>vc(e.rect,Hi.value)).map(e=>e.pos);jr.value=e}function Cl(){if(!W.value)return null;let e=o.Fragment.fromArray(Ui.value.map(e=>e.node));return il(new o.Slice(e,0,0))}function wl(){if(!W.value)return null;if(Ui.value.length){let e=[...Ui.value].sort((e,t)=>e.from-t.from);return{from:e[0].from,to:e[e.length-1].to}}let e=W.value.state.selection;return{from:e.from,to:e.to}}function Tl(){if(!W.value||!Ui.value.length)return null;let e=[...Ui.value].sort((e,t)=>e.from-t.from),t=Math.max(0,Math.min(W.value.state.doc.content.size,e[0].from+1)),n=Math.max(t,Math.min(W.value.state.doc.content.size,e[e.length-1].to-1));return t<n?{from:t,to:n}:null}function El(){let e=W.value?.chain().focus(),t=Tl();return e&&t?e.setTextSelection(t):e}function Dl(e){if(!W.value||!ei.value||!e.length)return!1;let t=wl();if(!t)return!1;let n=W.value.chain().focus().insertContentAt(t,e,{updateSelection:!0}).run();return n&&pc(),n}function Ol(){if(!W.value||!ei.value||!Ui.value.length)return;let e=Ui.value.map(e=>({from:e.from,to:e.to})).sort((e,t)=>t.from-e.from),t=W.value.chain().focus();e.forEach(e=>{t=t.deleteRange(e)}),t.run(),pc()}function kl(e){if(!ei.value||Je.value||e.button!==0||!j.value||!j.value.contains(e.target)||(e.target instanceof Node&&W.value?.view.dom.contains(e.target)&&Cc(),hc(e.target)))return;mc(),pc();let t=W.value?.view.dom;if(!t)return;let n=j.value.getBoundingClientRect(),r=t.getBoundingClientRect(),i=getComputedStyle(t),a=t.offsetWidth>0?r.width/t.offsetWidth:za.value||1,o=r.left+(Number.parseFloat(i.paddingLeft)||0)*a,s=r.right-(Number.parseFloat(i.paddingRight)||0)*a;!(e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom)||e.clientX>=o&&e.clientX<=s||(e.preventDefault(),Or.value={x:e.clientX,y:e.clientY},kr.value={x:e.clientX,y:e.clientY})}function Al(e){xl(e)}function jl(e){xl(e)}function Ml(e){if(!j.value||!Mr.value)return;let t=j.value.getBoundingClientRect();e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom||(Mr.value=null)}async function Nl(e){if(!W.value||!ei.value||Je.value||W.value.view.dragging||!hl(e.dataTransfer)){Mr.value=null;return}e.preventDefault(),e.stopPropagation();let t=_l(e.dataTransfer),n=gl(e.dataTransfer),r=vl(e.dataTransfer),i=Mr.value??bl(e.clientX,e.clientY);Mr.value=null,(t||n.length||r.length)&&i&&(t?await ks(`video`,t.name,async()=>{let e=await As(t,`video`);return W.value?.chain().focus().insertContentAt(i.range,{type:`videoBlock`,attrs:{assetId:e.assetId||``,src:e.url,name:e.name,description:e.description||``,mimeType:e.mimeType||`video/mp4`,align:`left`,widthPercent:100,height:220}},{updateSelection:!0}).run(),!0},e=>Ss({kind:`video`,fileName:t.name,error:e})):(n.length&&await ks(`image`,n.length>1?`${n[0]?.name||`图片`} 等 ${n.length} 张图片`:n[0]?.name||`图片`,async()=>{let e=await Promise.all(n.map(async e=>{let t=await As(e,`image`);return{assetId:t.assetId,src:t.url,alt:t.alt||t.name,name:t.name,description:t.description||``,link:``,rotation:0}}));return W.value?.chain().focus().insertContentAt(i.range,{type:`imageBlock`,attrs:{images:e.map(Xu),widthPercent:100,align:`left`,height:146}},{updateSelection:!0}).run(),!0},e=>Ss({kind:`image`,fileName:n[0]?.name||``,error:e})),r.length&&await ks(`file`,r.length>1?`${r[0]?.name||`文件`} 等 ${r.length} 个文件`:r[0]?.name||`文件`,async()=>{let e=await Promise.all(r.map(async e=>{let t=await As(e,`file`);return{assetId:t.assetId,url:t.url,name:t.name,size:t.size,mimeType:t.mimeType}})),t=W.value?.state.selection.from??i.range.from,a=n.length?{from:t,to:t}:i.range;return W.value?.chain().focus().insertContentAt(a,e.map(e=>({type:`localFileBlock`,attrs:{assetId:e.assetId||``,url:e.url,name:e.name,size:Math.max(0,Number(e.size??0)||0),mimeType:e.mimeType||``}})),{updateSelection:!0}).run()&&e.forEach(e=>d(`local-file-upload`,e)),!0},e=>Ss({kind:`file`,fileName:r[0]?.name||``,error:e}))))}function Pl(){Or.value&&(!Ar.value&&!jr.value.length||Sl(),mc())}function Fl(){Oi.value&&(et.value=!et.value,et.value||(nn.value=null,cn.value=0,ln.value=0,un.value=0),Ys(),ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function Il(){if(!W.value||!ei.value||Lr.value||!W.value.isFocused)return null;let e=W.value.state.selection;if(!(e instanceof a.TextSelection)||!e.empty||e.$from.parent.type.name!==`paragraph`)return null;let{$from:t}=e;if(t.parentOffset!==t.parent.content.size)return null;let n=t.parent.textContent,r=/^\/([^\s/]*)$/.exec(n);return r?{from:t.start(),to:e.from,query:r[1]}:null}function Ll(e=!1){e&&nt.value&&(it.value=`${nt.value.from}:${tt.value}`),tt.value=null,nt.value=null,at.value=0}function zl(){if(!Ti.value||!W.value)return;let e=W.value.view.coordsAtPos(nt.value.to),t=Math.min(250,window.innerWidth-16),n=Math.min(680,(fe.value?.scrollHeight??678)+2,window.innerHeight-16),r=e.bottom+8+n<=window.innerHeight-8;ot.value={left:Math.max(8,Math.min(e.left,window.innerWidth-t-8)),top:Math.max(8,Math.min(r?e.bottom+8:e.top-n-8,window.innerHeight-n-8)),maxHeight:n}}function Bl(){let e=Il();e?it.value===`${e.from}:${e.query}`?Ll():((tt.value!==e.query||nt.value?.from!==e.from)&&(at.value=0),tt.value=e.query,nt.value={from:e.from,to:e.to},(0,t.nextTick)(zl)):(it.value=null,Ll())}function Vl(e){let t=Il();t&&nt.value&&t.from===nt.value.from&&t.to===nt.value.to&&(Ll(),W.value?.chain().focus().deleteRange({from:t.from,to:t.to}).run(),e.action===`table`?Eu(3,3):e.action===`columns`?Bu(2):e.action===`emoji`?rt.value=!0:uf(e.action))}function Hl(e){rt.value=!1,zu(e)}function Ul(e){if(rt.value&&e.key===`Escape`)return e.preventDefault(),e.stopPropagation(),rt.value=!1,!0;if(!Ti.value||!W.value?.view.dom.contains(e.target))return!1;if(e.key===`Escape`)return e.preventDefault(),e.stopPropagation(),Ll(!0),!0;let t=xi.value;return(e.key===`ArrowDown`||e.key===`ArrowUp`)&&t.length?(e.preventDefault(),e.stopPropagation(),at.value=(at.value+(e.key===`ArrowDown`?1:-1)+t.length)%t.length,fe.value?.querySelectorAll(`[role="option"]`)[at.value]?.scrollIntoView({block:`nearest`}),!0):(e.key===`Enter`||e.key===`Tab`)&&t[at.value]?(e.preventDefault(),e.stopPropagation(),Vl(t[at.value]),!0):!1}function Wl(e){Ul(e)||Tc(e)}function Gl(){ss.value&&(st.value=!st.value,et.value=!1)}function Kl(e){El()?.setTextAlign(e).run(),st.value=!1}function ql(e){nn.value=e,e!==`table`&&(cn.value=0,ln.value=0),e!==`columns`&&(un.value=0),e!==`countdown`&&(_n.value=!1),e===`countdown`&&!fn.value&&Ys()}function Jl(e,t){cn.value=e,ln.value=t}function Yl(){cn.value=0,ln.value=0}function Zl(e){un.value=e}function $l(){un.value=0}function eu(e){if(e instanceof HTMLElement){ye.value=e;return}let t=e&&`$el`in e?e.$el:null;ye.value=t instanceof HTMLElement?t:null}function tu(e){let t=e.target;xe.value=t instanceof HTMLElement?t.scrollTop:0}function nu(e,t){return(e instanceof Element?e:e?.parentElement??null)?.closest(t)??null}function ru(){op?.(),op=null,zn.value?.classList.remove(`norio-office-rich-table-wrapper--active`),Ln.value=null,zn.value=null,Hn.value=null,Un.value=[],Gn.value=[],Kn.value=[],qn.value=[],Jn.value=null,Yn.value=null}function iu(){if(!W.value?.isActive(`countdownBlock`)){Bn.value=null,Vn.value=null,vn.value=!1;return}let e=W.value.state.selection;if(e instanceof a.NodeSelection&&e.node.type.name===`countdownBlock`){let t=W.value.view.nodeDOM(e.from);Bn.value=t instanceof HTMLElement?t:null,Vn.value=e.from}else Bn.value=nu(window.getSelection()?.anchorNode??null,`.norio-office-rich-countdown-block`),Vn.value=null}function au(){if(!W.value?.isActive(`table`)||!j.value){ru();return}let e=W.value.state.selection,t=e instanceof a.NodeSelection&&e.node.type.name===`table`?e.from:null;for(let n=e.$from.depth;t===null&&n>0;--n)e.$from.node(n).type.name===`table`&&(t=e.$from.before(n));let n=t===null?null:W.value.view.nodeDOM(t),r=n instanceof HTMLTableElement?n:n instanceof Element?n.querySelector(`table`):null,i=r?.closest(`.tableWrapper`);if(!r||!i){ru();return}if(zn.value&&zn.value!==i&&zn.value.classList.remove(`norio-office-rich-table-wrapper--active`),zn.value!==i){op?.();let e=()=>{ou()};i.addEventListener(`scroll`,e,{passive:!0}),op=()=>{i.removeEventListener(`scroll`,e)}}i.classList.add(`norio-office-rich-table-wrapper--active`),Ln.value=r,zn.value=i;let o=j.value.getBoundingClientRect(),s=i.getBoundingClientRect(),c=za.value||1;Hn.value={left:(s.left-o.left)/c,top:(s.top-o.top)/c,width:s.width/c,height:s.height/c};let l=r.rows.item(0),u=[],d=[];if(l){let e=Array.from(l.cells).map((e,t)=>{let n=e.getBoundingClientRect(),r=Math.max(n.left,s.left),i=Math.min(n.right,s.right)-r;return i<8?null:{index:t,left:(r-o.left)/c,width:i/c,rawLeft:n.left,rawRight:n.right}}).filter(e=>!!e);u.push(...e.map(e=>({index:e.index,left:e.left,width:e.width}))),e.forEach((t,n)=>{t.rawLeft>=s.left-.5&&d.push({key:`column-before-${t.index}`,insertIndex:t.index,left:(t.rawLeft-o.left)/c}),n===e.length-1&&t.rawRight<=s.right+.5&&d.push({key:`column-after-${t.index}`,insertIndex:t.index+1,left:(t.rawRight-o.left)/c})})}let f=[],p=[],m=Array.from(r.rows).map((e,t)=>{let n=(e.cells.item(0)??e).getBoundingClientRect(),r=Math.max(n.top,s.top),i=Math.min(n.bottom,s.bottom)-r;return i<8?null:{index:t,top:(r-o.top)/c,height:i/c,rawTop:n.top,rawBottom:n.bottom}}).filter(e=>!!e);f.push(...m.map(e=>({index:e.index,top:e.top,height:e.height}))),m.forEach((e,t)=>{e.rawTop>=s.top-.5&&p.push({key:`row-before-${e.index}`,insertIndex:e.index,top:(e.rawTop-o.top)/c}),t===m.length-1&&e.rawBottom<=s.bottom+.5&&p.push({key:`row-after-${e.index}`,insertIndex:e.index+1,top:(e.rawBottom-o.top)/c})}),Un.value=u,Gn.value=f,Kn.value=d,qn.value=p}function ou(){(0,t.nextTick)(()=>{au(),iu()})}function su(){return!1}function cu(){return Ln.value?{getBoundingClientRect:()=>Ln.value.getBoundingClientRect(),contextElement:Ln.value}:null}function fu(){return Bn.value?{getBoundingClientRect:()=>Bn.value.getBoundingClientRect(),contextElement:Bn.value}:null}function pu(){lt.value=!1,ct.value=!ct.value}function mu(){ct.value=!1,lt.value=!lt.value}function hu(){(Hr.value||lt.value||[`table-theme`,`properties`,`color`,`divider-style`,`divider-color`,`highlight-settings`,...$t].includes(P.value??``))&&(dt.value+=1)}function gu(){let e=Ka.value;W.value?.isEditable&&e?.node.type.name===`table`&&(Ac(e),Wr.value=e.from,P.value=`table-theme`,lt.value=!1,ct.value=!1)}function _u(e){Wr.value!==null&&bu(Wr.value,e)}function vu(){P.value=null,Wr.value=null}function yu(e){if(!W.value?.isEditable)return;let t=W.value.state.selection,n=t instanceof a.NodeSelection&&t.node.type.name===`table`?{node:t.node,pos:t.from,start:t.from+1}:(0,s.findTable)(t.$from);n&&bu(n.pos,e)}function bu(e,t){if(!W.value?.isEditable)return;let n=W.value.state.doc.nodeAt(e);if(n?.type.name!==`table`)return;let r=Ql(t),i=W.value.state.tr.setNodeMarkup(e,void 0,{...n.attrs,tableTheme:r});n.forEach((t,n)=>{t.forEach((t,r)=>{t.attrs.backgroundColor&&i.setNodeMarkup(e+n+r+2,void 0,{...t.attrs,backgroundColor:null})})}),W.value.view.dispatch(i),ou()}function xu(e){W.value&&(W.value.chain().focus().setCellAttribute(`backgroundColor`,e).run(),ct.value=!1,ou())}function Su(e){if(!W.value||!Ln.value)return;let t=(0,s.findTable)(W.value.state.selection.$from);if(!t)return;let n=s.TableMap.get(t.node);if(e<0||e>=n.width)return;let r=t.start+n.positionAt(0,e,t.node),i=t.start+n.positionAt(n.height-1,e,t.node),a=W.value.state.doc.resolve(r),o=W.value.state.doc.resolve(i),c=s.CellSelection.colSelection(a,o);W.value.view.dispatch(W.value.state.tr.setSelection(c).scrollIntoView()),Jn.value=e,Yn.value=null,ou()}function Cu(e){if(!W.value||!Ln.value)return;let t=(0,s.findTable)(W.value.state.selection.$from);if(!t)return;let n=s.TableMap.get(t.node);if(e<0||e>=n.height)return;let r=t.start+n.positionAt(e,0,t.node),i=t.start+n.positionAt(e,n.width-1,t.node),a=W.value.state.doc.resolve(r),o=W.value.state.doc.resolve(i),c=s.CellSelection.rowSelection(a,o);W.value.view.dispatch(W.value.state.tr.setSelection(c).scrollIntoView()),Yn.value=e,Jn.value=null,ou()}function wu(e){if(!W.value||!Ln.value)return;let t=Ln.value.rows.item(0),n=t?Array.from(t.cells):[];if(n.length!==0){if(e<=0){let e=n[0],t=W.value.view.posAtDOM(e,0)+1;W.value.chain().focus(t).addColumnBefore().run()}else{let t=n[Math.min(e-1,n.length-1)],r=W.value.view.posAtDOM(t,0)+1;W.value.chain().focus(r).addColumnAfter().run()}Jn.value=null,Yn.value=null,ou()}}function Tu(e){if(!W.value||!Ln.value)return;let t=Array.from(Ln.value.rows);if(t.length!==0){if(e<=0){let e=t[0].cells.item(0);if(!e)return;let n=W.value.view.posAtDOM(e,0)+1;W.value.chain().focus(n).addRowBefore().run()}else{let n=t[Math.min(e-1,t.length-1)].cells.item(0);if(!n)return;let r=W.value.view.posAtDOM(n,0)+1;W.value.chain().focus(r).addRowAfter().run()}Jn.value=null,Yn.value=null,ou()}}function Eu(e,t){if(!W.value)return;let n=sc();n?(W.value.chain().focus().deleteRange(n).insertTable({rows:e,cols:t,withHeaderRow:!1}).run(),et.value=!1,nn.value=null,Yl(),ou()):(et.value=!1,nn.value=null,Yl())}function Du(){_s.value&&(W.value?.chain().focus().addRowBefore().run(),ou())}function Ou(){_s.value&&(W.value?.chain().focus().addRowAfter().run(),ou())}function ku(){vs.value&&(W.value?.chain().focus().addColumnBefore().run(),ou())}function Au(){vs.value&&(W.value?.chain().focus().addColumnAfter().run(),ou())}function ju(){W.value?.chain().focus().deleteRow().run(),ou()}function Mu(){W.value?.chain().focus().deleteColumn().run(),ou()}function Nu(){W.value?.chain().focus().mergeCells().run(),ou()}function Pu(){W.value?.chain().focus().splitCell().run(),ou()}function Fu(){if(!W.value)return;let e=W.value.state.selection,t=W.value.state.tr;if(e instanceof s.CellSelection){let n=[];e.forEachCell((e,t)=>{n.push({pos:t,node:e})});for(let e=n.length-1;e>=0;--e){let r=n[e];if(!r.node)continue;let i=r.node.type.createAndFill(r.node.attrs);i&&t.replaceWith(r.pos,r.pos+r.node.nodeSize,i)}W.value.view.dispatch(t.scrollIntoView()),ou()}else try{let e=(0,s.selectionCell)(W.value.state),t=e.nodeAfter;if(!t)return;let n=t.type.createAndFill(t.attrs);if(!n)return;let r=W.value.state.tr.replaceWith(e.pos,e.pos+t.nodeSize,n);W.value.view.dispatch(r.scrollIntoView()),ou()}catch{}}function Iu(){W.value&&ys.value&&(To.value.isRowSelection?ju():To.value.isColumnSelection?Mu():Fu())}function Lu(e){return{type:`columnsBlock`,attrs:{widths:Array.from({length:e},()=>100/e)},content:Array.from({length:e},()=>({type:`columnsColumn`,content:[{type:`paragraph`}]}))}}function Ru(e){switch(e){case`paragraph`:return{type:`paragraph`};case`heading-1`:return{type:`heading`,attrs:{level:1}};case`heading-2`:return{type:`heading`,attrs:{level:2}};case`heading-3`:return{type:`heading`,attrs:{level:3}};case`heading-4`:return{type:`heading`,attrs:{level:4}};case`heading-5`:return{type:`heading`,attrs:{level:5}};case`heading-6`:return{type:`heading`,attrs:{level:6}};case`bullet-list`:return{type:`bulletList`,content:[{type:`listItem`,content:[{type:`paragraph`}]}]};case`ordered-list`:return{type:`orderedList`,content:[{type:`listItem`,content:[{type:`paragraph`}]}]};case`task-list`:return{type:`taskList`,content:[{type:`taskItem`,attrs:{checked:!1},content:[{type:`paragraph`}]}]};case`code-block`:return{type:`codeBlock`,attrs:{language:`plain_text`,wrapLines:!1,darkTheme:!1,fixedHeight:!1}};case`highlight-block`:return{type:`highlightBlock`,attrs:{titleEnabled:!0,emojiEnabled:!0,title:`高亮块`,emoji:`✍️`},content:[{type:`paragraph`}]};case`blockquote`:return{type:`blockquote`,content:[{type:`paragraph`}]};case`divider`:return[{type:`horizontalRule`},{type:`paragraph`}];default:return null}}function zu(e){W.value&&(W.value.chain().focus().insertContent(e).run(),et.value=!1,yt.value=!1,nn.value=null,Yl())}function Bu(e){if(!W.value)return;let t=sc();t?(W.value.chain().focus().insertContentAt({from:t.from,to:t.to},Lu(e),{updateSelection:!0}).run(),et.value=!1,nn.value=null,Yl(),$l()):(et.value=!1,nn.value=null,Yl(),$l())}function Vu(){if(!W.value)return;let e=sc();e?(W.value.chain().focus().insertContentAt({from:e.from,to:e.to},{type:`countdownBlock`,attrs:{targetTimestamp:0,mode:`duration`,color:`#ff8b00`,reminderEnabled:!0}},{updateSelection:!0}).run(),et.value=!1,nn.value=null,Ys()):(et.value=!1,nn.value=null,Ys())}function Hu(){if(dn.value===`deadline`)return new Date(fn.value).getTime();let e=Xs(pn.value),t=Xs(mn.value,23),n=Xs(hn.value,59),r=Xs(gn.value,59);return Date.now()+(((e*24+t)*60+n)*60+r)*1e3}function Uu(){if(!W.value||Vn.value===null)return;let e=Hu();!Number.isFinite(e)||e<=Date.now()||(W.value.chain().focus().setNodeSelection(Vn.value).updateAttributes(`countdownBlock`,{targetTimestamp:Math.floor(e),mode:dn.value}).run(),_n.value=!1,vn.value=!1,ou())}function Wu(){if(!W.value||Vn.value===null)return;let e=W.value.state.doc.nodeAt(Vn.value);e&&e.type.name===`countdownBlock`&&(W.value.chain().focus().deleteRange({from:Vn.value,to:Vn.value+e.nodeSize}).run(),_n.value=!1,vn.value=!1,Bn.value=null,Vn.value=null)}function Gu(){rn.value=!1,on.value=``}function Ku(){pe.value&&(pe.value.value=``,pe.value.click())}async function qu(e){if(!W.value)return;let t=e.target,n=t.files?.[0];if(!n)return;let r=await n.text();if(!r.trim()){t.value=``;return}let i=ly(r),{$from:a}=W.value.state.selection,o=a.depth>0?a.node(1):null,s=o?a.before(1):W.value.state.selection.from,c=o?.isTextblock&&!o.textContent.trim()?a.after(1):s;W.value.chain().focus().insertContentAt({from:s,to:c},i,{updateSelection:!0}).run(),et.value=!1,nn.value=null,Yl(),t.value=``}function Ju(e){if(!W.value)return;let t=sc();t?(W.value.chain().focus().insertContentAt({from:t.from,to:t.to},{type:`formulaBlock`,attrs:{latex:e}},{updateSelection:!0}).run(),Gu(),et.value=!1,nn.value=null,Yl()):(Gu(),et.value=!1,nn.value=null,Yl())}function Yu(e){if(!W.value)return!1;let t=sc();return t?(W.value.chain().focus().insertContentAt({from:t.from,to:t.to},e,{updateSelection:!0}).run(),!0):!1}function Xu(e){return{id:bs(),assetId:e.assetId,src:e.src,alt:e.alt||e.name||``,name:e.name||e.alt||``,description:e.description||``,descriptionVisible:e.descriptionVisible,link:e.link||``,linkTarget:e.linkTarget,rotation:Number(e.rotation??0)||0}}function Zu(e){let t=(Array.isArray(e)?e:[e]).filter(e=>e?.src).slice(0,4);return t.length?Yu({type:`imageBlock`,attrs:{images:t.map(Xu),widthPercent:100,align:`left`,height:146}}):!1}function Qu(e){return e.src?Yu({type:`videoBlock`,attrs:{assetId:e.assetId||``,src:e.src,name:e.name||``,description:e.description||``,mimeType:e.mimeType||`video/mp4`,align:e.align||`left`,widthPercent:Math.max(30,Math.min(100,Number(e.widthPercent??100)||100)),height:Math.max(180,Math.min(640,Number(e.height??220)||220))}}):!1}function $u(e){if(!e.url||!e.name)return!1;let t=e.displayMode===`card`||e.displayMode===`preview`?e.displayMode:`text`;return Yu({type:`linkBlock`,attrs:{title:e.name,url:e.url,displayMode:t,align:e.align||`left`,widthPercent:Math.max(30,Math.min(100,Number(e.widthPercent??100)||100)),height:Math.max(240,Math.min(860,Number(e.height??420)||420))}})}function ed(e){return!e.url||!e.name?!1:Yu({type:`localFileBlock`,attrs:{assetId:e.assetId||``,url:e.url,name:e.name,size:Math.max(0,Number(e.size??0)||0),mimeType:e.mimeType||``}})}function td(e){return typeof crypto<`u`&&`randomUUID`in crypto?`${e}-${crypto.randomUUID()}`:`${e}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function nd(){return pi.value}function rd(e){return(e?.name||e?.id||`?`).slice(0,2).toUpperCase()}function id(e){return{backgroundColor:e?.color||`#4c7dff`}}function ad(e){if(!e)return``;let t=new Date(e);if(Number.isNaN(t.getTime()))return``;let n=Date.now()-t.getTime(),r=6e4,i=60*r;return n<r?`刚刚`:n<i?`${Math.max(1,Math.floor(n/r))} 分钟前`:n<864e5?`${Math.floor(n/i)} 小时前`:t.toLocaleDateString()}function od(e,t){return t?`${e}:${t}`:e}function sd(e,t){return jt.value[od(e,t)]??``}function cd(e,t,n){let r=od(e,n);jt.value={...jt.value,[r]:t}}function ld(e,t,n){let r=t.target;cd(e,r?.value??``,n),Ea(r,{mode:`draft`,threadId:e,parentId:n})}function ud(e,t,n){G(t)?(t.preventDefault(),t.stopPropagation()):(t.ctrlKey||t.metaKey)&&t.key===`Enter`&&(t.preventDefault(),Rd(e,n))}function dd(e,t){return Mt.value[od(e,t)]??[]}function fd(e,t,n){let r=od(e,n);Mt.value={...Mt.value,[r]:t}}function pd(e,t){let n=od(e,t),{[n]:r,...i}=jt.value,{[n]:a,...o}=Mt.value,{[n]:s,...c}=Nt.value;jt.value=i,Mt.value=o,Nt.value=c}function md(e){return e.comments.filter(e=>!e.parentId)}function hd(e,t){let n=[],r=t=>{e.comments.filter(e=>e.parentId===t).forEach(e=>{n.push(e),r(e.id)})};return r(t.id),n}function gd(e,t){return t?e.comments.find(e=>e.id===t)??null:null}function _d(e){return Bt.value[e]??null}function vd(e){return gd(e,_d(e.id)??void 0)}function yd(e,t){let n=_d(e.id);return n?n===t.id||hd(e,t).some(e=>e.id===n):!1}function bd(e,t){Bt.value={...Bt.value,[e.id]:t.id},At.value=e.id}function xd(e,t){let{[e]:n,...r}=Bt.value;Bt.value=r,pd(e,t)}function Sd(e){return e.anchorText?.trim()||`已标注内容`}function Cd(){if(!W.value)return null;let e=W.value.state.selection;if(!e.empty&&!(e instanceof s.CellSelection))return{from:e.from,to:e.to};let t=sc();return t&&t.to>t.from?t:null}function wd(e){return W.value&&W.value.state.doc.textBetween(e.from,e.to,` `).replace(/\s+/g,` `).trim()||`已标注内容`}function Td(e,t){if(!W.value||!e||t.to<=t.from)return!1;let n=W.value.state.schema.marks.commentMark;if(!n)return!1;let r=W.value.state.tr,i=!1,a=n.create({threadId:e});return W.value.state.doc.nodesBetween(t.from,t.to,(e,n)=>{if(!e.isText||!e.textContent.trim())return;let o=Math.max(n,t.from),s=Math.min(n+e.nodeSize,t.to);s<=o||(r=r.addMark(o,s,a),i=!0)}),i?(W.value.view.dispatch(r.scrollIntoView()),W.value.commands.focus(),!0):!1}function Ed(e){if(!W.value||!e)return!1;let t=W.value.state.schema.marks.commentMark;if(!t)return!1;let n=W.value.state.tr,r=!1;return W.value.state.doc.descendants((i,a)=>{i.isText&&i.marks.some(n=>n.type===t&&n.attrs.threadId===e)&&(n=n.removeMark(a,a+i.nodeSize,t),r=!0)}),r&&W.value.view.dispatch(n),r}function Dd(e,t){t instanceof HTMLElement?Vt.set(e,t):Vt.delete(e)}function Od(){return ce.value?.querySelector(`.norio-office-rich-comment-panel__scroll`)??null}function kd(){return ne.value?.querySelector(`.norio-office-rich-editor__scroll`)??null}function Ad(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top-r.top,a=Math.max(12,(r.height-n.height)/2),o=Math.max(0,t.scrollTop+i-a);t.scrollTo({top:o,behavior:`smooth`})}function jd(e){let t=j.value?.querySelectorAll(`[data-comment-thread-id]`)??[];return Array.from(t).find(t=>t.dataset.commentThreadId===e)??null}function Md(e){(0,t.nextTick)(()=>{let t=()=>{let t=jd(e),n=kd();t&&n&&Ad(t,n)};typeof window<`u`&&typeof window.requestAnimationFrame==`function`?(window.requestAnimationFrame(()=>window.requestAnimationFrame(t)),typeof window.setTimeout==`function`&&window.setTimeout(t,120)):t()})}function Nd(e){(0,t.nextTick)(()=>{let t=Vt.get(e),n=Od();t&&n&&Ad(t,n)})}function Pd(e){if(!W.value||!e)return!1;let t=W.value.state.schema.marks.commentMark;if(!t)return!1;let n=null,r=null;if(W.value.state.doc.descendants((i,a)=>{if(n!==null||!i.isText)return!1;if(i.marks.some(n=>n.type===t&&n.attrs.threadId===e))return n=a,r=a+i.nodeSize,!1}),n===null||r===null)return!1;At.value=e;let i=a.TextSelection.create(W.value.state.doc,n,r);return W.value.view.dispatch(W.value.state.tr.setSelection(i)),W.value.view.dom.focus({preventScroll:!0}),Md(e),!0}function Fd(e,t={}){At.value=e.id,t.focusEditor!==!1&&(Pd(e.id)||Md(e.id)),t.scrollCommentCard&&Nd(e.id),d(`comment-select`,e)}function Id(){let e=nd();if(!W.value||!e||!qo.value)return;let t=Cd();if(!t)return;let n=td(`comment-thread`),r=wd(t);Td(n,t)&&(Rt.value={id:n,anchorText:r},At.value=n,cd(n,``),fd(n,[]))}function Ld(e){Rt.value?.id===e&&(Ed(e),Rt.value=null,At.value=mi.value[0]?.id??null),pd(e)}function Rd(e,t){let n=nd(),r=sd(e,t).trim(),i=dd(e,t),a=ya(r,ba(e,t)),o=mi.value.find(t=>t.id===e),s=o?gd(o,t):null;if(!n||!r&&!i.length)return;let c=new Date().toISOString();if(Rt.value?.id===e){let t=td(`comment`),o={threadId:e,commentId:t,anchorText:Rt.value.anchorText,content:r,images:i,mentions:a,author:n,createdAt:c};d(`comment-create`,o),d(`comment-submit`,{action:`create`,threadId:e,commentId:t,content:r,images:i,mentions:a,author:n,createdAt:c}),Rt.value=null}else{let o=td(`comment`),l={threadId:e,commentId:o,parentId:t,targetCommentId:s?.id,targetUserId:s?.author.id,targetUserName:s?.author.name,content:r,images:i,mentions:a,author:n,createdAt:c};if(d(`comment-reply`,l),d(`comment-submit`,{action:`reply`,threadId:e,commentId:o,targetCommentId:s?.id,targetUserId:s?.author.id,targetUserName:s?.author.name,content:r,images:i,mentions:a,author:n,createdAt:c}),t){let{[e]:t,...n}=Bt.value;Bt.value=n}}pd(e,t)}function zd(e,t){Pt.value=`${e}:${t.id}`,Ft.value=t.content,It.value=t.mentions??[]}function Bd(e,t){return Pt.value===`${e}:${t.id}`}function Vd(e){let t=e.target;Ft.value=t?.value??``;let[n=``,r=``]=Pt.value?.split(`:`)??[];Ea(t,{mode:`edit`,threadId:n,commentId:r})}function Hd(e,t,n){G(n)?(n.preventDefault(),n.stopPropagation()):(n.ctrlKey||n.metaKey)&&n.key===`Enter`&&(n.preventDefault(),Wd(e,t))}function Ud(){Pt.value=null,Ft.value=``,It.value=[],wa()}function Wd(e,t){let n=Ft.value.trim(),r=ya(n,It.value);if(!n)return;let i=new Date().toISOString(),a={threadId:e,commentId:t.id,content:n,images:t.images,mentions:r,author:pi.value??void 0,updatedAt:i};d(`comment-update`,a),d(`comment-submit`,{action:`update`,threadId:e,commentId:t.id,content:n,images:t.images,mentions:r,author:pi.value??void 0,updatedAt:i}),Ud()}function Gd(e,t){d(`comment-delete`,{threadId:e,commentId:t?.id}),t||Ed(e)}function Kd(e){Lt.value=od(e,_d(e)??void 0),_e.value&&(_e.value.value=``,_e.value.click())}async function qd(e){let t=T.value??f.value;if(!t)throw Error(`Missing uploadCommentImage hook.`);return xs(e,await t({file:e,kind:`image`}))}async function Jd(e){let t=e.target,n=t?.files?.[0],r=Lt.value;Lt.value=null,!n||!r?t&&(t.value=``):n.type.startsWith(`image/`)?(await ks(`image`,n.name,async()=>{let e=await qd(n),[t=``,i]=r.split(`:`);return fd(t,[...dd(t,i),e],i),!0},e=>Ss({kind:`image`,fileName:n.name,error:e})),t&&(t.value=``)):(Ss({kind:`image`,fileName:n.name,error:Error(`Please select an image file.`)}),t&&(t.value=``))}function Yd(e,t,n){fd(e,dd(e,n).filter((e,n)=>n!==t),n)}function Xd(e){e.url&&(zt.value=e)}function Zd(){zt.value=null}function Qd(e){if(!ni.value||!u.showComments)return;let t=(e.target?.closest?.(`[data-comment-thread-id]`))?.dataset.commentThreadId;if(!t)return;let n=mi.value.find(e=>e.id===t);n?Fd(n,{focusEditor:!1,scrollCommentCard:!0}):At.value=t}function $d(){me.value?.click()}function ef(e,t){let n=e[t];return typeof n==`string`?n:``}function tf(e,t,n=0){let r=Number(e[t]??n);return Number.isFinite(r)?r:n}function nf(){if(!W.value)return[];let e=[];return W.value.state.doc.descendants(t=>{t.type.name===`imageBlock`&&(Array.isArray(t.attrs.images)?t.attrs.images:[]).forEach(t=>{if(!t||typeof t!=`object`)return;let n=t,r=ef(n,`src`);r&&e.push({src:r,alt:ef(n,`alt`)||void 0,name:ef(n,`name`)||void 0,description:ef(n,`description`)||void 0,descriptionVisible:typeof n.descriptionVisible==`boolean`?n.descriptionVisible:void 0,link:ef(n,`link`)||void 0,linkTarget:n.linkTarget===`_self`?`_self`:`_blank`,rotation:tf(n,`rotation`,0)})})}),e}function rf(){if(!W.value)return[];let e=[];return W.value.state.doc.descendants(t=>{if(t.type.name!==`videoBlock`)return;let n=t.attrs,r=ef(n,`src`);if(!r)return;let i=ef(n,`align`);e.push({src:r,name:ef(n,`name`)||void 0,description:ef(n,`description`)||void 0,mimeType:ef(n,`mimeType`)||void 0,align:i===`center`||i===`right`?i:`left`,widthPercent:tf(n,`widthPercent`,100),height:tf(n,`height`,220)})}),e}function af(){if(!W.value)return[];let e=[];return W.value.state.doc.descendants(t=>{let n=t.attrs;if(t.type.name===`linkBlock`){let t=ef(n,`url`),r=ef(n,`title`);if(!t||!r)return;let i=ef(n,`displayMode`),a=ef(n,`align`);e.push({kind:`file`,url:t,name:r,displayMode:i===`card`||i===`preview`?i:`text`,align:a===`center`||a===`right`?a:`left`,widthPercent:tf(n,`widthPercent`,100),height:tf(n,`height`,420)})}else if(t.type.name===`localFileBlock`){let t=ef(n,`url`),r=ef(n,`name`);if(!t||!r)return;e.push({kind:`local-file`,url:t,name:r,size:tf(n,`size`,0),mimeType:ef(n,`mimeType`)||void 0})}}),e}function of(e){let t=sc();et.value=!1,nn.value=null,Yl(),Ot.value=t;let n=e===`image`?he.value:ge.value;n&&(n.value=``,n.click())}async function sf(e){let t=e.target,n=t?.files?.[0],r=Ot.value??sc();Ot.value=null,n?n.type.startsWith(`image/`)?(await ks(`image`,n.name,async()=>{let e=await As(n,`image`),t={type:`imageBlock`,attrs:{images:[Xu({assetId:e.assetId,src:e.url,alt:e.alt||e.name,name:e.name,description:e.description||``,link:``,rotation:0})],widthPercent:100}};return r?(W.value?.chain().focus().insertContentAt({from:r.from,to:r.to},t,{updateSelection:!0}).run(),!0):(W.value?.chain().focus().insertContent(t,{updateSelection:!0}).run(),!0)},e=>Ss({kind:`image`,fileName:n.name,error:e})),t&&(t.value=``)):(Ss({kind:`image`,fileName:n.name,error:Error(`Please select an image file.`)}),t&&(t.value=``)):t&&(t.value=``)}async function cf(e){let t=e.target,n=t?.files?.[0],r=Ot.value??sc();Ot.value=null,n?n.type.startsWith(`video/`)?(await ks(`video`,n.name,async()=>{let e=await As(n,`video`),t={type:`videoBlock`,attrs:{assetId:e.assetId||``,src:e.url,name:e.name,description:e.description||``,mimeType:e.mimeType||`video/mp4`,align:`left`,widthPercent:100,height:220}};return r?(W.value?.chain().focus().insertContentAt({from:r.from,to:r.to},t,{updateSelection:!0}).run(),!0):(W.value?.chain().focus().insertContent(t,{updateSelection:!0}).run(),!0)},e=>Ss({kind:`video`,fileName:n.name,error:e})),t&&(t.value=``)):(Ss({kind:`video`,fileName:n.name,error:Error(`Please select a video file.`)}),t&&(t.value=``)):t&&(t.value=``)}async function lf(e){let t=e.target,n=t?.files?.[0];n&&await ks(`file`,n.name,async()=>{let e=await As(n,`file`),t={assetId:e.assetId,url:e.url,name:e.name,size:e.size,mimeType:e.mimeType};return ed(t)&&d(`local-file-upload`,t),t},e=>Ss({kind:`file`,fileName:n.name,error:e})),t&&(t.value=``)}function uf(e){if(!W.value)return;if(e===`table`){ql(`table`);return}if(e===`emoji`){ql(`emoji`);return}if(e===`columns`){ql(`columns`);return}if(e===`countdown`){Vu();return}if(e===`formula`){on.value=``,rn.value=!0,et.value=!1,nn.value=null,Yl();return}if(e===`markdown-import`){et.value=!1,nn.value=null,Yl(),Ku();return}if(e===`local-file`){et.value=!1,nn.value=null,Yl(),$d();return}if(e===`image`){of(`image`);return}if(e===`video`){of(`video`);return}if(e===`link`){let e=sc();if(!e){et.value=!1;return}W.value.chain().focus().insertContentAt({from:e.from,to:e.to},{type:`linkBlock`,attrs:{title:``,url:``,displayMode:`preview`,align:`left`,widthPercent:100,height:420}},{updateSelection:!0}).run(),et.value=!1,nn.value=null,Yl();return}let t=Ru(e);if(!t){et.value=!1,nn.value=null,Yl();return}let n=sc();n?(W.value.chain().focus().insertContentAt({from:n.from,to:n.to},t,{updateSelection:!0}).run(),et.value=!1,nn.value=null,Yl()):(et.value=!1,nn.value=null,Yl())}function df(){El()?.setParagraph().run()}function ff(e){El()?.toggleHeading({level:e}).run()}function pf(){Jo.value&&(ft.value=!ft.value,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function mf(e){e?ff(e):df(),ft.value=!1}function hf(){El()?.increaseIndent().run()}function gf(){El()?.decreaseIndent().run()}function _f(){Yo.value&&(pt.value=!pt.value,ft.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function vf(e){let t=El();t&&(e?t.setFontFamily(e).run():t.unsetFontFamily().run(),pt.value=!1)}function yf(){rs.value&&(mt.value=!mt.value,ft.value=!1,pt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function bf(){Xo.value&&(ht.value=!ht.value,ft.value=!1,pt.value=!1,mt.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function xf(e){El()?.setFontSize(e).run(),ht.value=!1}function Sf(){Zo.value&&(gt.value=!gt.value,ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,_t.value=!1,vt.value=!1)}function Cf(e){El()?.setColor(e).run(),br.value=[e,...br.value.filter(t=>t!==e)].slice(0,10)}function wf(){Qo.value&&(_t.value=!_t.value,ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,vt.value=!1)}function Tf(e){El()?.setBackgroundColor(e).run(),Ef(e)}function Ef(e){xr.value=[e,...xr.value.filter(t=>t.toLowerCase()!==e.toLowerCase())].slice(0,10)}function Df(){Ai.value&&ds.value&&(vt.value=!vt.value,ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,yt.value=!1)}function Of(){ei.value&&(yt.value=!yt.value,et.value=!1,nn.value=null,ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1)}function kf(){El()?.toggleBold().run()}function Af(){El()?.toggleItalic().run()}function jf(){El()?.toggleUnderline().run()}function Mf(){El()?.toggleStrike().run()}function Nf(){El()?.toggleCode().run()}function Pf(){El()?.toggleBulletList().run()}function Ff(){El()?.toggleOrderedList().run()}function If(){El()?.toggleTaskList().run()}function Lf(){El()?.toggleBlockquote().run()}function Rf(e){W.value?.isActive(`blockquote`)&&W.value?.chain().focus().setQuoteStyle({quoteBorderColor:e,quoteBackgroundColor:wo.value}).run()}function zf(e){W.value?.isActive(`blockquote`)&&W.value?.chain().focus().setQuoteStyle({quoteBorderColor:Co.value,quoteBackgroundColor:e}).run()}function Bf(){El()?.unsetSubscript().toggleSuperscript().run(),mt.value=!1}function Vf(){El()?.unsetSuperscript().toggleSubscript().run(),mt.value=!1}function Hf(){El()?.unsetAllMarks().clearNodes().run()}function Uf(e){return Bo(e?t=>t.can().chain().focus().toggleHeading({level:e}).run():e=>e.can().chain().focus().setParagraph().run())}function Wf(e){return Bo(e?t=>t.can().chain().focus().setFontFamily(e).run():e=>e.can().chain().focus().unsetFontFamily().run())}function Gf(e){return Bo(t=>t.can().chain().focus().setFontSize(e).run())}function qf(e){return Bo(t=>t.can().chain().focus().setTextAlign(e).run())}function Yf(){return Bo(e=>e.can().chain().focus().toggleSuperscript().run())}function Xf(){return Bo(e=>e.can().chain().focus().toggleSubscript().run())}function Zf(e){let t=e.target,n=t instanceof Element?t:null;Ei.value&&!fe.value?.contains(t)&&(Ll(!0),rt.value=!1),Wi.value&&!j.value?.contains(t)&&!gc(t)&&pc(),(!t||!ue.value?.contains(t))&&(et.value=!1,nn.value=null,Yl()),n?.closest(`.norio-office-rich-block-side-control, .norio-office-rich-block-side-menu, .norio-office-rich-block-side-submenu, .norio-office-rich-block-side-table-theme`)||Mc(),_n.value&&t&&!Se.value?.contains(t)&&!Ce.value?.contains(t)&&!(vn.value&&we.value?.contains(t))&&!(nn.value===`countdown`&&ue.value?.contains(t))&&(_n.value=!1),vn.value&&t&&!Te.value?.contains(t)&&!we.value?.contains(t)&&(vn.value=!1),(!t||!Ee.value?.contains(t))&&(st.value=!1),(!t||!Re.value?.contains(t))&&(mt.value=!1),(!t||!Ie.value?.contains(t))&&(ft.value=!1),(!t||!Le.value?.contains(t))&&(pt.value=!1),(!t||!ze.value?.contains(t))&&(ht.value=!1),(!t||!Be.value?.contains(t))&&(gt.value=!1),(!t||!We.value?.contains(t))&&(_t.value=!1),(!t||!Ge.value?.contains(t))&&(vt.value=!1),(!t||!ve.value?.contains(t))&&(yt.value=!1),bt.value&&t&&!Ke.value?.contains(t)&&!j.value?.contains(t)&&ra(),Ht.value&&t&&!le.value?.contains(t)&&!n?.closest?.(`.norio-office-rich-comment-composer`)&&wa(),(!t||!je.value?.contains(t))&&(ct.value=!1),(!t||!Me.value?.contains(t))&&(lt.value=!1),zn.value&&n&&zn.value.contains(n)&&lp(),window.setTimeout(()=>{ou()},0)}function Qf(e){if(Je.value&&(Er.value=e.clientX,Dr.value=e.clientY),Or.value){kr.value={x:e.clientX,y:e.clientY};let t=e.clientX-Or.value.x,n=e.clientY-Or.value.y;!Ar.value&&Math.abs(t)>=12&&Math.abs(n)>=12&&(Ar.value=!0,window.getSelection()?.removeAllRanges()),Ar.value&&(e.preventDefault(),Sl())}if(!e.buttons)return;let t=e.target,n=t instanceof Element?t:null;zn.value&&n&&zn.value.contains(n)&&lp()}function $f(e){if(e.key===`Escape`&&Je.value)e.preventDefault(),lc();else if(e.key===`Escape`&&Kr.value)Kr.value=null;else if(e.key===`Escape`&&[`properties`,`color`,`divider-style`,`divider-color`,`highlight-settings`,...$t].includes(P.value??``))Mc();else if(e.key===`Escape`&&P.value===`table-theme`)vu();else if(e.key===`Escape`&&lt.value)lt.value=!1;else if(e.key===`Escape`&&zt.value)Zd();else if(bt.value&&fa(e))e.preventDefault();else if(Ht.value&&G(e))e.preventDefault();else if(e.key===`Escape`&&Wi.value)pc(),mc();else{if((e.ctrlKey||e.metaKey)&&Wi.value&&ep(e.target)){let t=e.key.toLowerCase();if(t===`c`||t===`x`){e.preventDefault(),document.execCommand(t===`c`?`copy`:`cut`);return}}(e.key===`Delete`||e.key===`Backspace`)&&Wi.value&&ei.value&&(e.preventDefault(),Ol())}}function ep(e){if(!W.value||!(e instanceof Node))return!1;let t=e instanceof Element?e:e.parentElement;return t?.closest(`input, textarea, select`)||t?.closest(`[contenteditable]`)?.getAttribute(`contenteditable`)===`false`?!1:W.value.view.dom.contains(e)||Wi.value&&(ne.value?.contains(e)||e===document.body)}function tp(e){if(Jr)Jr.written=al(e,Jr.payload);else if(ep(e.target)){if(Wi.value){let t=Cl();t&&al(e,t)}else W.value&&!W.value.state.selection.empty&&(qr.value=il(W.value.state.selection.content()))}}function np(e){if(ep(e.target)&&ei.value){if(Wi.value){let t=Cl();t&&al(e,t)&&Ol()}else W.value&&!W.value.state.selection.empty&&(qr.value=il(W.value.state.selection.content()))}}function rp(e){if(e&&W.value)try{let t=JSON.parse(e);if(!Array.isArray(t)||!t.length)return;for(let e of t){let t=W.value.state.schema.nodeFromJSON(e);if(!t.isBlock)return;t.check()}return t}catch{return}}function ip(e){if(!ei.value||!e.clipboardData||!ep(e.target))return;let t=e.clipboardData.getData(`text/html`),n=e.clipboardData.getData(`text/plain`),r=rp(e.clipboardData.getData(hD));(t||n||r)&&(qr.value={html:t,text:n,json:r}),r&&(Wi.value||!t&&!n&&!W.value?.state.selection.$from.parent.type.spec.code)&&(e.preventDefault(),e.stopPropagation(),Dl(r))}(0,t.watch)(()=>ci.value?.user,e=>{W.value&&e&&ci.value?.provider&&W.value.commands.updateUser(e)},{deep:!0});let ap=null,op=null,sp=null,cp=null;function lp(){cp?.();let e=()=>{au(),sp=window.requestAnimationFrame(e)},t=()=>{cp?.(),au()};sp=window.requestAnimationFrame(e),document.addEventListener(`mouseup`,t,{once:!0}),cp=()=>{sp!==null&&(window.cancelAnimationFrame(sp),sp=null),document.removeEventListener(`mouseup`,t),cp=null}}function up(){if(ap?.(),ap=null,!W.value)return;let e=({transaction:e}={})=>{e?.getMeta(`textSelectionBubbleMenu`)!==`updatePosition`&&e?.getMeta(`tableBubbleMenu`)!==`updatePosition`&&(Xt.value+=1,W.value?.isActive(`table`)||(lt.value=!1),ou(),Ia(),aa(),Bl())},n=({transaction:e})=>{let n=Gr.value;if(n!==null&&e.docChanged){let r=Pr.value?.node.type.name,i=e.mapping.mapResult(n+1,-1),a=i.pos-1,o=a>=0?e.doc.nodeAt(a):null;i.deletedAcross||!o||o.type.name!==r?Mc():(Gr.value=a,Pr.value&&Ac({...Pr.value,pos:a,from:a,to:a+o.nodeSize,node:o}),(0,t.nextTick)(()=>{if(Gr.value!==a)return;let e=yc().find(e=>e.pos===a);e&&Ac(xc(e))}))}e.docChanged&&Pr.value?.node.type.name===`horizontalRule`&&e.getMeta(`officeBlockSideAttrs`)!==Pr.value.pos&&Mc();let r=Wr.value;if(P.value!==`table-theme`||r===null||!e.docChanged)return;let i=e.mapping.mapResult(r+1,-1);i.deletedAcross||i.pos<1||e.doc.nodeAt(i.pos-1)?.type.name!==`table`?Mc():(Wr.value=i.pos-1,(0,t.nextTick)(()=>{if(P.value!==`table-theme`)return;let e=yc().find(e=>e.from===Wr.value);e&&Ac(xc(e))}))};W.value.on(`transaction`,n),W.value.on(`selectionUpdate`,e),W.value.on(`transaction`,e),W.value.on(`focus`,e),W.value.on(`blur`,e),ap=()=>{W.value?.off(`transaction`,n),W.value?.off(`selectionUpdate`,e),W.value?.off(`transaction`,e),W.value?.off(`focus`,e),W.value?.off(`blur`,e)},ou(),Ia()}return(0,t.onMounted)(()=>{La(),document.addEventListener(`selectionchange`,wc),document.addEventListener(`fullscreenchange`,cc),document.addEventListener(`mousedown`,Zf),document.addEventListener(`mousemove`,Qf),document.addEventListener(`mouseup`,Pl),document.addEventListener(`keydown`,$f),document.addEventListener(`copy`,tp,!0),document.addEventListener(`cut`,np,!0),document.addEventListener(`paste`,ip,!0),window.addEventListener(`resize`,ou),window.addEventListener(`resize`,ac),window.addEventListener(`resize`,ta),window.addEventListener(`resize`,Ca),window.addEventListener(`resize`,La),window.addEventListener(`resize`,zl),window.addEventListener(`scroll`,ta,!0),window.addEventListener(`scroll`,Ca,!0),window.addEventListener(`scroll`,hu,!0),window.addEventListener(`scroll`,zl,!0),up(),(0,t.nextTick)(Ra)}),(0,t.onBeforeUnmount)(()=>{ie(`dispose`),ee(new Map,new Set),document.removeEventListener(`selectionchange`,wc),Vr!==null&&clearTimeout(Vr),Qa?.disconnect(),document.removeEventListener(`fullscreenchange`,cc),document.removeEventListener(`mousedown`,Zf),document.removeEventListener(`mousemove`,Qf),document.removeEventListener(`mouseup`,Pl),document.removeEventListener(`keydown`,$f),document.removeEventListener(`copy`,tp,!0),document.removeEventListener(`cut`,np,!0),document.removeEventListener(`paste`,ip,!0),window.removeEventListener(`resize`,ou),window.removeEventListener(`resize`,ac),window.removeEventListener(`resize`,ta),window.removeEventListener(`resize`,Ca),window.removeEventListener(`resize`,La),window.removeEventListener(`resize`,zl),window.removeEventListener(`scroll`,ta,!0),window.removeEventListener(`scroll`,Ca,!0),window.removeEventListener(`scroll`,hu,!0),window.removeEventListener(`scroll`,zl,!0),cp?.(),ap?.(),ru()}),(0,t.watch)(ei,e=>{W.value?.setEditable(e,!1),e||(ie(`mode-changed`),Ll(),rt.value=!1,Mc(),Nr.value=null,mc(),pc(),ra(),ct.value=!1,lt.value=!1)},{flush:`sync`}),(0,t.watch)(ti,e=>{e||(et.value=!1,nn.value=null,st.value=!1,ft.value=!1,pt.value=!1,mt.value=!1,ht.value=!1,gt.value=!1,_t.value=!1,vt.value=!1,yt.value=!1,_n.value=!1)}),(0,t.watch)(li,e=>{e||ra()}),(0,t.watch)(ui,e=>{e||wa()}),(0,t.watch)(mi,e=>{e.length?(!At.value||!e.some(e=>e.id===At.value))&&(At.value=e[0]?.id??null):At.value=null}),(0,t.watch)(()=>u.modelValue,e=>{if(!W.value||!e||ci.value)return;let t=W.value.getJSON();JSON.stringify(t)!==JSON.stringify(e)&&(ie(`document-changed`),W.value.commands.setContent(e,{emitUpdate:!1}),Ia())}),(0,t.watch)(dn,e=>{e!==`deadline`&&(_n.value=!1)}),(0,t.watch)(_n,e=>{e&&(0,t.nextTick)(ac)}),(0,t.watch)(Sn,e=>{_n.value&&dn.value===`deadline`&&/^\d{2}:\d{2}$/.test(e)&&nc(e)}),(0,t.watch)(W,()=>{up(),Ia(),(0,t.nextTick)(Ra)}),(0,t.watch)(za,()=>{ou()}),(0,t.watch)([pr,_i,vi,yi,et,ti,Je,qe,ho,go],()=>{(0,t.nextTick)(Ra)}),c({getFileName:()=>p.value,setFileName:S,exportPdf:Us,exportImage:Fs,exportHtml:Gs,exportNordox:te,openNordox:k,getAiAdapter:()=>({getEditor:()=>W.value??null,isCollaborationConfigured:()=>!!u.collaboration,bindAiTargetControls:e=>{re.value=e},setAiTargetUiState:e=>{A.value=e},getSelectedBlocks:()=>Ui.value.map(e=>({from:e.from,to:e.to,nodeId:e.node.attrs.aiId}))}),insertImage:Zu,insertVideo:Qu,insertFile:$u,insertLocalFile:ed,insertMention:ua,openLocalFilePicker:$d,focus:()=>{W.value?.commands.focus()},getJSON:()=>W.value?.getJSON()??null,getText:()=>W.value?.getText()??``,getImages:nf,getVideos:rf,getFiles:af,getOutlineItems:()=>Pa().items,getActiveOutlinePos:()=>Cr.value,focusOutlineItem:fc,onOutlineChange:e=>(wr.add(e),e(Pa()),()=>{wr.delete(e)}),focusCommentThread:Pd}),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`rootRef`,ref:ne,class:`norio-office-rich-editor`,"data-editable":ei.value,"data-mode":$r.value?`preview`:`edit`,"data-fullscreen":qe.value,"data-presentation":Je.value,"data-outline-open":ai.value&&Ye.value,"data-outline-placement":ii.value,"data-comments-enabled":ni.value,"data-comments-open":F.value,"data-drag-insert-active":!!Mr.value,onClickCapture:Qd,onNorioOfficeRichUploadRequest:js},[e.showFileHeader&&!Je.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`norio-office-rich-editor__file-header`,"aria-label":pr.value[`file.header`]},[(0,t.createVNode)(an,{name:`rich-text-document`,size:26,"background-color":`transparent`,"aria-hidden":`true`}),(0,t.createElementVNode)(`div`,Qb,[(0,t.unref)(m)?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,ref_key:`fileNameInput`,ref:_,"onUpdate:modelValue":a[0]||=e=>(0,t.isRef)(h)?h.value=e:null,class:`norio-office-rich-editor__file-name-input`,type:`text`,maxlength:`255`,"aria-label":pr.value[`file.name`],"aria-invalid":!!(0,t.unref)(g),onBlur:a[1]||=(...e)=>(0,t.unref)(y)&&(0,t.unref)(y)(...e),onKeydown:a[2]||=(...e)=>(0,t.unref)(x)&&(0,t.unref)(x)(...e),onInput:a[3]||=e=>g.value=``},null,40,$b)),[[t.vModelText,(0,t.unref)(h)]]):$r.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,class:`norio-office-rich-editor__file-name`,title:(0,t.unref)(p)},(0,t.toDisplayString)((0,t.unref)(p)),9,tx)):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`norio-office-rich-editor__file-name`,title:(0,t.unref)(p),"aria-label":pr.value[`file.rename`],onClick:a[4]||=(0,t.withModifiers)((...e)=>(0,t.unref)(v)&&(0,t.unref)(v)(...e),[`stop`])},(0,t.toDisplayString)((0,t.unref)(p)),9,ex)),(0,t.unref)(g)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,nx,(0,t.toDisplayString)((0,t.unref)(g)),1)):(0,t.createCommentVNode)(``,!0)]),(0,t.createVNode)(Cn,{presence:u.collaborationPresence},null,8,[`presence`])],8,Zb)):(0,t.createCommentVNode)(``,!0),ti.value?((0,t.openBlock)(),(0,t.createElementBlock)(`header`,rx,[(0,t.createElementVNode)(`div`,ix,[(0,t.createElementVNode)(`div`,ax,[(0,t.createElementVNode)(`div`,ox,[(0,t.createElementVNode)(`div`,sx,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button`,disabled:!Wo.value,onClick:a[5]||=e=>(0,t.unref)(W)?.chain().focus().undo().run()},[(0,t.createVNode)(M,{name:`back`,size:16,color:`#4b5563`,"background-color":`transparent`})],8,cx),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button`,disabled:!Go.value,onClick:a[6]||=e=>(0,t.unref)(W)?.chain().focus().redo().run()},[(0,t.createVNode)(M,{name:`redo`,size:16,color:`#4b5563`,"background-color":`transparent`})],8,lx),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button`,disabled:!Ko.value,onClick:Hf},[(0,t.createVNode)(M,{name:`rubber`,size:16,color:`#4b5563`,"background-color":`transparent`})],8,ux)]),ni.value&&u.showComments?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dx,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":!!gi.value}]),disabled:!qo.value,title:`添加评论`,onClick:Id},[(0,t.createVNode)(M,{name:`comment`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,fx)])):(0,t.createCommentVNode)(``,!0),Oi.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,px,[(0,t.createElementVNode)(`div`,{ref_key:`insertMenuRef`,ref:ue,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select`,{"norio-office-rich-toolbar__button--active":et.value}]),onClick:Fl},[(0,t.createVNode)(M,{name:`add-circle`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[132]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__label`},`插入`,-1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],2),et.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,mx,[(0,t.createElementVNode)(`div`,{ref_key:`insertMenuPanelRef`,ref:de,class:`norio-office-rich-insert-menu`},[(0,t.createVNode)(sn,{"class-name":`norio-office-rich-insert-menu__scroll`,"max-height":`calc(100vh - 100px)`,onScroll:tu},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,hx,[(0,t.createElementVNode)(`div`,gx,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Qn,e=>(0,t.createElementVNode)(`button`,{key:e.key,type:`button`,class:`norio-office-rich-insert-menu__quick-item`,onMouseenter:a[7]||=e=>ql(null),onClick:t=>uf(e.action)},[e.type===`text`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,vx,(0,t.toDisplayString)(e.label),1)):((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:e.iconName,size:16,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`]))],40,_x)),64))]),_i.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yx,[a[133]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-insert-menu__title`},`通用`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_i.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-insert-menu__item`,{"norio-office-rich-insert-menu__item--active":nn.value===e.key}]),ref_for:!0,ref:e.key===`columns`?eu:void 0,onMouseenter:t=>ql(e.key===`table`||e.key===`emoji`||e.key===`columns`?e.key:null),onFocus:t=>ql(e.key===`table`||e.key===`emoji`||e.key===`columns`?e.key:null),onClick:t=>uf(e.action)},[(0,t.createElementVNode)(`span`,xx,[e.colorIconName?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.colorIconName,size:18,"background-color":`transparent`},null,8,[`name`])):e.key===`emoji`?((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:`smile`,size:16,color:`#4b5563`,"background-color":`transparent`})):e.monoIconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:2,name:e.monoIconName,size:16,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`span`,Sx,(0,t.toDisplayString)(e.label),1),e.key===`table`||e.key===`emoji`||e.key===`columns`?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:`youjiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})):(0,t.createCommentVNode)(``,!0)],42,bx))),128))])):(0,t.createCommentVNode)(``,!0),vi.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Cx,[a[134]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-insert-menu__title`},`小应用`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(vi.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-insert-menu__item`,{"norio-office-rich-insert-menu__item--active":nn.value===e.key}]),onMouseenter:a[8]||=e=>ql(null),onFocus:a[9]||=e=>ql(null),onClick:t=>uf(e.action)},[(0,t.createElementVNode)(`span`,Tx,[e.colorIconName?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.colorIconName,size:18,"background-color":`transparent`},null,8,[`name`])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`span`,Ex,(0,t.toDisplayString)(e.label),1)],42,wx))),128))])):(0,t.createCommentVNode)(``,!0),yi.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Dx,[a[135]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-insert-menu__title`},`外部内容`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(yi.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:`norio-office-rich-insert-menu__item`,onMouseenter:a[10]||=e=>ql(null),onFocus:a[11]||=e=>ql(null),onClick:t=>uf(e.action)},[(0,t.createElementVNode)(`span`,kx,[e.colorIconName?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.colorIconName,size:18,"background-color":`transparent`},null,8,[`name`])):e.monoIconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:e.monoIconName,size:16,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`span`,Ax,(0,t.toDisplayString)(e.label),1)],40,Ox))),128))])):(0,t.createCommentVNode)(``,!0)])]),_:1}),nn.value===`table`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`norio-office-rich-insert-submenu norio-office-rich-insert-submenu--table`,onMouseleave:Yl},[a[136]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-insert-submenu__title`},`插入表格`,-1),(0,t.createElementVNode)(`div`,jx,(0,t.toDisplayString)(Tn.value),1),(0,t.createElementVNode)(`div`,Mx,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(80,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-grid__cell`,{"norio-office-rich-table-grid__cell--active":Math.ceil(e/gD)<=cn.value&&(e-1)%gD+1<=ln.value}]),onMouseenter:t=>Jl(Math.ceil(e/gD),(e-1)%gD+1),onFocus:t=>Jl(Math.ceil(e/gD),(e-1)%gD+1),onClick:t=>Eu(Math.ceil(e/gD),(e-1)%gD+1)},null,42,Nx))),128))]),a[137]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-insert-submenu__footer`},null,-1)],32)):(0,t.createCommentVNode)(``,!0),nn.value===`emoji`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Px,[(0,t.createVNode)(hr,{onSelect:zu})])):(0,t.createCommentVNode)(``,!0),nn.value===`columns`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`norio-office-rich-insert-submenu norio-office-rich-insert-submenu--columns`,style:(0,t.normalizeStyle)(On.value),onMouseleave:$l},[(0,t.createElementVNode)(`div`,Fx,(0,t.toDisplayString)(En.value),1),(0,t.createElementVNode)(`div`,Ix,[(0,t.createElementVNode)(`div`,Lx,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_D,e=>(0,t.createElementVNode)(`button`,{key:`columns-count-${e}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-columns-picker__cell`,{"norio-office-rich-columns-picker__cell--active":e<=un.value}]),onMouseenter:t=>Zl(e),onFocus:t=>Zl(e),onClick:t=>Bu(e)},null,42,Rx)),64))])])],36)):(0,t.createCommentVNode)(``,!0),nn.value===`countdown`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:`norio-office-rich-insert-submenu norio-office-rich-insert-submenu--countdown`,style:(0,t.normalizeStyle)(kn.value)},[(0,t.createElementVNode)(`div`,zx,[(0,t.createElementVNode)(`div`,Bx,[a[138]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-countdown-settings__title`},`倒计时设置`,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__close`,onClick:a[12]||=e=>ql(null)},[(0,t.createVNode)(M,{name:`close`,size:16,color:`#6b7280`,"background-color":`transparent`})])]),(0,t.createElementVNode)(`label`,Vx,[(0,t.createElementVNode)(`span`,Hx,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[13]||=e=>dn.value=e,type:`radio`,value:`deadline`},null,512),[[t.vModelRadio,dn.value]]),a[139]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__radio-dot`},null,-1)]),a[140]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__label`},`截止时间`,-1),(0,t.createElementVNode)(`button`,{ref_key:`countdownDateTriggerRef`,ref:Se,type:`button`,class:`norio-office-rich-countdown-settings__datetime`,disabled:dn.value!==`deadline`,onClick:oc},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(jn.value),1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#6b7280`,"background-color":`transparent`})],8,Ux)]),dn.value===`deadline`&&_n.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`countdownPickerRef`,ref:Ce,class:(0,t.normalizeClass)([`norio-office-rich-countdown-settings__picker-panel`,`norio-office-rich-countdown-settings__picker-panel--${yn.value}`])},[(0,t.createElementVNode)(`div`,Wx,[(0,t.createElementVNode)(`select`,{class:`norio-office-rich-countdown-settings__picker-select norio-office-rich-countdown-settings__picker-select--year`,value:String(bn.value),onChange:a[14]||=e=>Y(e.target.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Pn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e,value:e},(0,t.toDisplayString)(e),9,Kx))),128))],40,Gx),(0,t.createElementVNode)(`select`,{class:`norio-office-rich-countdown-settings__picker-select norio-office-rich-countdown-settings__picker-select--month`,value:String(xn.value),onChange:a[15]||=e=>tc(e.target.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Fn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e,value:e},(0,t.toDisplayString)(e+1),9,Jx))),128))],40,qx),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__today`,onClick:ec},` 今 `)]),(0,t.createElementVNode)(`div`,Yx,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(wn,e=>(0,t.createElementVNode)(`span`,{key:e,class:`norio-office-rich-countdown-settings__weekday`},(0,t.toDisplayString)(e),1)),64))]),(0,t.createElementVNode)(`div`,Xx,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(In.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-countdown-settings__day`,{"norio-office-rich-countdown-settings__day--muted":!e.isCurrentMonth,"norio-office-rich-countdown-settings__day--today":e.isToday,"norio-office-rich-countdown-settings__day--selected":e.isSelected,"norio-office-rich-countdown-settings__day--disabled":e.isDisabled}]),disabled:e.isDisabled,onClick:t=>$s(e.year,e.month,e.day)},(0,t.toDisplayString)(e.label),11,Zx))),128))]),(0,t.createElementVNode)(`div`,Qx,[a[141]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-countdown-settings__time-label`},`设置时间`,-1),(0,t.createElementVNode)(`div`,$x,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[16]||=e=>Sn.value=e,class:`norio-office-rich-countdown-settings__time-input`,type:`time`,step:`60`,min:Nn.value,onInput:a[17]||=e=>nc(Sn.value),onChange:a[18]||=e=>nc(Sn.value)},null,40,eS),[[t.vModelText,Sn.value]]),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__time-confirm`,onClick:rc},` 确定 `)])])],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`label`,tS,[(0,t.createElementVNode)(`span`,nS,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[19]||=e=>dn.value=e,type:`radio`,value:`duration`},null,512),[[t.vModelRadio,dn.value]]),a[142]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__radio-dot`},null,-1)]),a[147]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__label`},`计时长度`,-1),(0,t.createElementVNode)(`div`,rS,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[20]||=e=>pn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,disabled:dn.value!==`duration`},null,8,iS),[[t.vModelText,pn.value]]),a[143]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`天`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[21]||=e=>mn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`23`,disabled:dn.value!==`duration`},null,8,aS),[[t.vModelText,mn.value]]),a[144]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`时`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[22]||=e=>hn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`59`,disabled:dn.value!==`duration`},null,8,oS),[[t.vModelText,hn.value]]),a[145]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`分`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[23]||=e=>gn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`59`,disabled:dn.value!==`duration`},null,8,sS),[[t.vModelText,gn.value]]),a[146]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`秒`,-1)])]),(0,t.createElementVNode)(`div`,cS,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__button norio-office-rich-countdown-settings__button--secondary`,onClick:a[24]||=e=>ql(null)},` 取消 `),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__button norio-office-rich-countdown-settings__button--primary`,onClick:Vu},` 确定 `)])])],4)):(0,t.createCommentVNode)(``,!0)],512)])):(0,t.createCommentVNode)(``,!0)],512)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,lS,[(0,t.createElementVNode)(`div`,{ref_key:`headingMenuRef`,ref:Ie,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select norio-office-rich-toolbar__button--heading`,disabled:!Jo.value,onClick:pf},[(0,t.createElementVNode)(`span`,dS,(0,t.toDisplayString)(J.value),1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],8,uS),ft.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fS,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Qt,e=>(0,t.createElementVNode)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--heading`,{"norio-office-rich-toolbar__menu-item--active":e.level?(0,t.unref)(W)?.isActive(`heading`,{level:e.level}):!(0,t.unref)(W)?.isActive(`heading`)}]),disabled:!Uf(e.level),onClick:t=>mf(e.level)},[(e.level?(0,t.unref)(W)?.isActive(`heading`,{level:e.level}):!(0,t.unref)(W)?.isActive(`heading`))?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,mS)),(0,t.createElementVNode)(`span`,hS,(0,t.toDisplayString)(e.level?`H${e.level}`:`T`),1),(0,t.createElementVNode)(`span`,gS,(0,t.toDisplayString)(e.label),1)],10,pS)),64))])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`div`,{ref_key:`fontFamilyMenuRef`,ref:Le,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select norio-office-rich-toolbar__button--font-family`,disabled:!Yo.value,onClick:_f},[(0,t.createElementVNode)(`span`,vS,(0,t.toDisplayString)(yo.value),1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],8,_S),pt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yS,[(0,t.createVNode)(sn,{"class-name":`norio-office-rich-toolbar__menu-scroll`,"max-height":`360px`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Zn,e=>(0,t.createElementVNode)(`button`,{key:e.label,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--font-family`,{"norio-office-rich-toolbar__menu-item--active":yo.value===e.label}]),disabled:!Wf(e.value),onClick:t=>vf(e.value)},[yo.value===e.label?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,xS)),(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`,style:(0,t.normalizeStyle)(e.value?{fontFamily:e.value}:void 0)},(0,t.toDisplayString)(e.label),5)],10,bS)),64))]),_:1})])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`div`,{ref_key:`fontSizeMenuRef`,ref:ze,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select norio-office-rich-toolbar__button--font-size`,disabled:!Xo.value,onClick:bf},[(0,t.createElementVNode)(`span`,CS,(0,t.toDisplayString)(vo.value),1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],8,SS),ht.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wS,[(0,t.createVNode)(sn,{"class-name":`norio-office-rich-toolbar__menu-scroll`,"max-height":`520px`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Xn,e=>(0,t.createElementVNode)(`button`,{key:e.label,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--font-size`,{"norio-office-rich-toolbar__menu-item--active":vo.value===e.label}]),disabled:!Gf(e.value),onClick:t=>xf(e.value)},[vo.value===e.label?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ES)),(0,t.createElementVNode)(`span`,DS,(0,t.toDisplayString)(e.label),1)],10,TS)),64))]),_:1})])):(0,t.createCommentVNode)(``,!0)],512)]),(0,t.createElementVNode)(`div`,OS,[(0,t.createElementVNode)(`div`,{ref_key:`colorMenuRef`,ref:Be,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select norio-office-rich-toolbar__button--color`,disabled:!Zo.value,onClick:Sf},[(0,t.createElementVNode)(`span`,AS,[a[148]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__color-text`},`A`,-1),(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__color-line`,style:(0,t.normalizeStyle)({backgroundColor:xo.value})},null,4)]),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],8,kS),gt.value?((0,t.openBlock)(),(0,t.createBlock)(Rn,{key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--color`,color:xo.value,"default-color":`#333333`,"recent-colors":br.value,onChange:Cf},null,8,[`color`,`recent-colors`])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`div`,{ref_key:`highlightMenuRef`,ref:We,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select norio-office-rich-toolbar__button--color`,disabled:!Qo.value,onClick:wf},[(0,t.createElementVNode)(`span`,MS,[(0,t.createVNode)(M,{name:`beijingse`,size:14,color:`#4b5563`,"background-color":`transparent`}),(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__color-line`,style:(0,t.normalizeStyle)({backgroundColor:So.value})},null,4)]),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],8,jS),_t.value?((0,t.openBlock)(),(0,t.createBlock)(Rn,{key:0,class:`norio-office-rich-toolbar__menu norio-office-rich-toolbar__menu--color`,color:So.value,"default-color":`#FFF3C4`,"recent-colors":xr.value,onChange:Tf},null,8,[`color`,`recent-colors`])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`bold`)}]),disabled:!$o.value,onClick:kf},[(0,t.createVNode)(M,{name:`jiacu`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,NS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`italic`)}]),disabled:!es.value,onClick:Af},[(0,t.createVNode)(M,{name:`xieti`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,PS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`underline`)}]),disabled:!ts.value,onClick:jf},[(0,t.createVNode)(M,{name:`xiahuaxian`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,FS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`strike`)}]),disabled:!ns.value,onClick:Mf},[...a[149]||=[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__text-icon norio-office-rich-toolbar__text-icon--strike`},`S`,-1)]],10,IS),(0,t.createElementVNode)(`div`,{ref_key:`scriptMenuRef`,ref:Re,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`superscript`)||(0,t.unref)(W)?.isActive(`subscript`)}]),disabled:!rs.value,onClick:yf},[_o.value.icon?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:_o.value.icon,size:16,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RS,(0,t.toDisplayString)(_o.value.text),1)),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],10,LS),mt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,zS,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item`,{"norio-office-rich-toolbar__menu-item--active":(0,t.unref)(W)?.isActive(`superscript`)}]),disabled:!Yf(),onClick:Bf},[(0,t.unref)(W)?.isActive(`superscript`)?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,VS)),(0,t.createVNode)(M,{name:`shangbiao`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[150]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`},`上标`,-1),a[151]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-shortcut`},`Ctrl+Shift+.`,-1)],10,BS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item`,{"norio-office-rich-toolbar__menu-item--active":(0,t.unref)(W)?.isActive(`subscript`)}]),disabled:!Xf(),onClick:Vf},[(0,t.unref)(W)?.isActive(`subscript`)?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,US)),(0,t.createVNode)(M,{name:`xiabiao`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[152]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`},`下标`,-1),a[153]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-shortcut`},`Ctrl+Shift+,`,-1)],10,HS)])):(0,t.createCommentVNode)(``,!0)],512)]),(0,t.createElementVNode)(`div`,WS,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`bulletList`)}]),disabled:!is.value,onClick:Pf},[(0,t.createVNode)(M,{name:`wuxuliebiao`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,GS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`orderedList`)}]),disabled:!as.value,onClick:Ff},[(0,t.createVNode)(M,{name:`youxuliebiao`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,KS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`taskList`)}]),disabled:!os.value,onClick:If},[(0,t.createVNode)(M,{name:`To-do`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,qS),(0,t.createElementVNode)(`div`,{ref_key:`alignMenuRef`,ref:Ee,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select`,{"norio-office-rich-toolbar__button--active":st.value}]),disabled:!ss.value,onClick:Gl},[(0,t.createVNode)(M,{name:bo.value===`center`?`juzhongduiqi`:bo.value===`right`?`youduiqi`:`zuoduiqi`,size:16,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`]),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],10,JS),st.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,YS,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--align`,{"norio-office-rich-toolbar__menu-item--active":bo.value===`left`}]),disabled:!qf(`left`),onClick:a[25]||=e=>Kl(`left`)},[bo.value===`left`?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ZS)),(0,t.createVNode)(M,{name:`zuoduiqi`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[154]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`},`左对齐`,-1)],10,XS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--align`,{"norio-office-rich-toolbar__menu-item--active":bo.value===`center`}]),disabled:!qf(`center`),onClick:a[26]||=e=>Kl(`center`)},[bo.value===`center`?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,$S)),(0,t.createVNode)(M,{name:`juzhongduiqi`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[155]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`},`居中对齐`,-1)],10,QS),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__menu-item norio-office-rich-toolbar__menu-item--align`,{"norio-office-rich-toolbar__menu-item--active":bo.value===`right`}]),disabled:!qf(`right`),onClick:a[27]||=e=>Kl(`right`)},[bo.value===`right`?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:`duihao`,size:16,"background-color":`transparent`})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,tC)),(0,t.createVNode)(M,{name:`youduiqi`,size:16,color:`#4b5563`,"background-color":`transparent`}),a[156]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-toolbar__menu-label`},`右对齐`,-1)],10,eC)])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button`,disabled:!cs.value,onClick:gf},[(0,t.createVNode)(M,{name:`zuosuojin`,size:16,color:`#4b5563`,"background-color":`transparent`})],8,nC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-toolbar__button`,disabled:!ls.value,onClick:hf},[(0,t.createVNode)(M,{name:`yousuojin`,size:16,color:`#4b5563`,"background-color":`transparent`})],8,rC),Ai.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`quoteMenuRef`,ref:Ge,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--select`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`blockquote`)}]),disabled:!ds.value,onClick:Df},[(0,t.createVNode)(M,{name:`yinyong`,size:16,color:`#4b5563`,"background-color":`transparent`}),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#9ca3af`,"background-color":`transparent`})],10,iC),vt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,aC,[(0,t.createElementVNode)(`div`,oC,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-color-menu__current`,disabled:!us.value,onClick:Lf},(0,t.toDisplayString)((0,t.unref)(W)?.isActive(`blockquote`)?`取消引用`:`应用引用`),9,sC)]),(0,t.createElementVNode)(`div`,cC,[a[157]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-color-menu__label`},`边框颜色`,-1),(0,t.createElementVNode)(`div`,lC,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(gr,e=>(0,t.createElementVNode)(`button`,{key:`quote-border-${e}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-color-menu__swatch norio-office-rich-color-menu__swatch--compact`,{"norio-office-rich-color-menu__swatch--active":Co.value===e}]),disabled:!(0,t.unref)(W)?.isActive(`blockquote`),style:(0,t.normalizeStyle)({backgroundColor:e}),onClick:t=>Rf(e)},null,14,uC)),64))])]),(0,t.createElementVNode)(`div`,dC,[a[158]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-color-menu__label`},`背景颜色`,-1),(0,t.createElementVNode)(`div`,fC,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_r,e=>(0,t.createElementVNode)(`button`,{key:`quote-bg-${e}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-color-menu__swatch norio-office-rich-color-menu__swatch--compact`,{"norio-office-rich-color-menu__swatch--active":wo.value===e}]),disabled:!(0,t.unref)(W)?.isActive(`blockquote`),style:(0,t.normalizeStyle)({backgroundColor:e}),onClick:t=>zf(e)},null,14,pC)),64))])])])):(0,t.createCommentVNode)(``,!0)],512)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":(0,t.unref)(W)?.isActive(`code`)}]),disabled:!fs.value,onClick:Nf},[(0,t.createVNode)(M,{name:`code`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,mC),ki.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,ref_key:`emojiToolbarMenuRef`,ref:ve,class:`norio-office-rich-toolbar__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button`,{"norio-office-rich-toolbar__button--active":yt.value}]),disabled:!ei.value,title:`表情符号`,onClick:Of},[(0,t.createVNode)(M,{name:`smile`,size:16,color:`#4b5563`,"background-color":`transparent`})],10,hC),yt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,gC,[(0,t.createVNode)(hr,{onSelect:zu})])):(0,t.createCommentVNode)(``,!0)],512)):(0,t.createCommentVNode)(``,!0)]),u.showAiTargetButton?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_C,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-toolbar__button norio-office-rich-toolbar__button--ai-target`,{"norio-office-rich-toolbar__button--active":A.value.active}]),disabled:!ei.value||!re.value||!A.value.available||A.value.busy,title:re.value?A.value.busy?`请先停止当前修改,再选择新的范围`:A.value.reason||`将当前选区或光标位置交给 AI 编辑`:`AI Bridge 尚未连接`,"aria-label":`将当前选区或光标位置交给 AI 编辑`,onMousedown:a[28]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:ae},[(0,t.createVNode)(an,{name:`ai-mark`,size:17,"background-color":`transparent`,"aria-hidden":`true`})],42,vC)])):(0,t.createCommentVNode)(``,!0)])])])])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,yC,[ai.value&&!Ye.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,ref_key:`outlineTriggerRef`,ref:Xe,type:`button`,class:`norio-office-rich-outline-trigger`,"data-placement":ii.value,title:Ri.value,"aria-label":Ri.value,"aria-controls":Ze,"aria-expanded":!1,onClick:dc},[(0,t.createVNode)(M,{name:`dagang`,size:18,color:`currentColor`,"background-color":`transparent`})],8,bC)):(0,t.createCommentVNode)(``,!0),ai.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,id:Ze,class:`norio-office-rich-outline-shell`,"data-open":Ye.value,"data-placement":ii.value,onKeydown:a[29]||=(0,t.withKeys)((0,t.withModifiers)(e=>Ye.value&&dc(),[`prevent`,`stop`]),[`esc`])},[(0,t.createVNode)(Xl,{internal:``,open:Ye.value,placement:ii.value,title:Ri.value,"collapse-title":zi.value,"empty-description":I.value,"empty-tip":L.value,items:Sr.value,"active-pos":Cr.value,onToggle:dc,onSelect:fc},null,8,[`open`,`placement`,`title`,`collapse-title`,`empty-description`,`empty-tip`,`items`,`active-pos`])],40,xC)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`section`,SC,[(0,t.createVNode)(sn,{"class-name":`norio-office-rich-editor__scroll`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:`norio-office-rich-editor__stage`,style:(0,t.normalizeStyle)(Ba.value)},[(0,t.createElementVNode)(`div`,{ref_key:`pageRef`,ref:j,class:`norio-office-rich-editor__page`,onMousedownCapture:kl,onKeydownCapture:Wl,onBeforeinputCapture:Tc,onCompositionstartCapture:Ec,onCompositionendCapture:Dc,onMousemove:Oc,onMouseleave:kc,onDragenterCapture:Al,onDragoverCapture:jl,onDragleaveCapture:Ml,onDropCapture:Nl},[(0,t.unref)(W)?((0,t.openBlock)(),(0,t.createBlock)(rr,{key:0,onVisibilityChange:a[30]||=e=>zr.value=e,editor:(0,t.unref)(W),actions:ps.value,enabled:ei.value&&!Je.value&&!Hr.value&&!Wi.value},null,8,[`editor`,`actions`,`enabled`])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(W)?((0,t.openBlock)(),(0,t.createBlock)(rr,{key:1,scope:`table`,editor:(0,t.unref)(W),actions:ms.value,enabled:ei.value&&!Je.value&&!Hr.value&&!Wi.value,onVisibilityChange:a[46]||=e=>Br.value=e,"get-referenced-virtual-element":cu},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,CC,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!Ho.value,title:`合并单元格`,onMousedown:a[31]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Nu},[(0,t.createVNode)(M,{name:`merge`,size:14,color:Ho.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,wC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!Uo.value,title:`拆分单元格`,onMousedown:a[32]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Pu},[(0,t.createVNode)(M,{name:`split`,size:14,color:Uo.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,TC),(0,t.createElementVNode)(`div`,{ref_key:`tableActionColorMenuRef`,ref:je,class:`norio-office-rich-table-bubble-menu__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-bubble-menu__button`,{"norio-office-rich-table-bubble-menu__button--active":ct.value}]),disabled:!hs.value,title:`设置单元格背景色`,onMousedown:a[33]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:pu},[(0,t.createVNode)(M,{name:`yanse`,size:14,color:hs.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],42,EC),ct.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,DC,[a[159]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-table-bubble-menu__menu-title`},`单元格背景颜色`,-1),(0,t.createElementVNode)(`div`,OC,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Zr,e=>(0,t.createElementVNode)(`button`,{key:`table-cell-${e??`none`}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-bubble-menu__color-swatch`,{"norio-office-rich-table-bubble-menu__color-swatch--active":Eo.value===e,"norio-office-rich-table-bubble-menu__color-swatch--none":e===null}]),style:(0,t.normalizeStyle)(e?{backgroundColor:e}:void 0),onMousedown:a[34]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>xu(e)},null,46,kC)),64))]),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__reset`,onMousedown:a[35]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:a[36]||=e=>xu(null)},` 恢复默认 `,32)])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`div`,{ref_key:`tableThemeMenuRef`,ref:Me,class:`norio-office-rich-table-bubble-menu__dropdown`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-bubble-menu__button`,{"norio-office-rich-table-bubble-menu__button--active":lt.value}]),disabled:!hs.value,title:`表格主题色`,"aria-label":`表格主题色`,"aria-expanded":lt.value,onMousedown:a[37]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:mu},[(0,t.createVNode)(M,{name:`zhuti`,size:14,color:hs.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],42,AC),lt.value?((0,t.openBlock)(),(0,t.createBlock)(lu,{key:0,theme:Do.value,"recent-colors":xr.value,style:(0,t.normalizeStyle)(Ao.value),onChange:yu,onColorUsed:Ef,onClear:a[38]||=e=>yu(null),onClose:a[39]||=e=>lt.value=!1,onResize:a[40]||=e=>ut.value=e,onReposition:hu},null,8,[`theme`,`recent-colors`,`style`])):(0,t.createCommentVNode)(``,!0)],512),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!_s.value,title:`上增加一行`,onMousedown:a[41]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Du},[(0,t.createVNode)(M,{name:`xiangshangcharu`,size:14,color:_s.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,jC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!_s.value,title:`下增加一行`,onMousedown:a[42]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Ou},[(0,t.createVNode)(M,{name:`xiangxiacharujilu-copy`,size:14,color:_s.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,MC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!vs.value,title:`左增加一列`,onMousedown:a[43]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:ku},[(0,t.createVNode)(M,{name:`xiangzuocharu`,size:14,color:vs.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,NC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button`,disabled:!vs.value,title:`右增加一列`,onMousedown:a[44]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Au},[(0,t.createVNode)(M,{name:`xiangyoucharu`,size:14,color:vs.value?`#4b5563`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,PC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-table-bubble-menu__button norio-office-rich-table-bubble-menu__button--danger`,disabled:!ys.value,title:`删除`,onMousedown:a[45]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Iu},[(0,t.createVNode)(M,{name:`delete`,size:14,color:ys.value?`#dc2626`:`#c5ccd8`,"background-color":`transparent`},null,8,[`color`])],40,FC)])]),_:1},8,[`editor`,`actions`,`enabled`])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(W)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(r.BubbleMenu),{key:2,"plugin-key":`countdownBlockBubbleMenu`,class:`norio-office-rich-countdown-bubble-menu`,editor:(0,t.unref)(W),"should-show":su,"get-referenced-virtual-element":fu,options:{placement:`top`}},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,IC,[(0,t.createElementVNode)(`div`,{ref_key:`countdownBubbleMenuRef`,ref:we,class:`norio-office-rich-countdown-bubble-menu__dropdown`},[(0,t.createElementVNode)(`button`,{ref_key:`countdownBubbleEditButtonRef`,ref:Te,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-countdown-bubble-menu__button norio-office-rich-countdown-bubble-menu__button--edit`,{"norio-office-rich-countdown-bubble-menu__button--active":vn.value}]),title:`编辑`,"aria-label":`编辑`,onMousedown:a[47]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:ic},[(0,t.createVNode)(M,{name:`edit`,size:14,color:`#374151`,"background-color":`transparent`}),a[160]||=(0,t.createElementVNode)(`span`,null,`编辑`,-1)],34),vn.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,LC,[(0,t.createElementVNode)(`div`,RC,[(0,t.createElementVNode)(`div`,zC,[a[161]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-countdown-settings__title`},`倒计时设置`,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__close`,onClick:a[48]||=e=>vn.value=!1},[(0,t.createVNode)(M,{name:`close`,size:16,color:`#6b7280`,"background-color":`transparent`})])]),(0,t.createElementVNode)(`label`,BC,[(0,t.createElementVNode)(`span`,VC,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[49]||=e=>dn.value=e,type:`radio`,value:`deadline`},null,512),[[t.vModelRadio,dn.value]]),a[162]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__radio-dot`},null,-1)]),a[163]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__label`},`截止时间`,-1),(0,t.createElementVNode)(`button`,{ref_key:`countdownDateTriggerRef`,ref:Se,type:`button`,class:`norio-office-rich-countdown-settings__datetime`,disabled:dn.value!==`deadline`,onClick:oc},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(jn.value),1),(0,t.createVNode)(M,{name:`xiangxiajiantou`,size:12,color:`#6b7280`,"background-color":`transparent`})],8,HC)]),dn.value===`deadline`&&_n.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`countdownPickerRef`,ref:Ce,class:(0,t.normalizeClass)([`norio-office-rich-countdown-settings__picker-panel`,`norio-office-rich-countdown-settings__picker-panel--${yn.value}`])},[(0,t.createElementVNode)(`div`,UC,[(0,t.createElementVNode)(`select`,{class:`norio-office-rich-countdown-settings__picker-select norio-office-rich-countdown-settings__picker-select--year`,value:String(bn.value),onChange:a[50]||=e=>Y(e.target.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Pn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e,value:e},(0,t.toDisplayString)(e),9,GC))),128))],40,WC),(0,t.createElementVNode)(`select`,{class:`norio-office-rich-countdown-settings__picker-select norio-office-rich-countdown-settings__picker-select--month`,value:String(xn.value),onChange:a[51]||=e=>tc(e.target.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Fn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e,value:e},(0,t.toDisplayString)(e+1),9,qC))),128))],40,KC),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__today`,onClick:ec},` 今 `)]),(0,t.createElementVNode)(`div`,JC,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(wn,e=>(0,t.createElementVNode)(`span`,{key:e,class:`norio-office-rich-countdown-settings__weekday`},(0,t.toDisplayString)(e),1)),64))]),(0,t.createElementVNode)(`div`,YC,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(In.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-countdown-settings__day`,{"norio-office-rich-countdown-settings__day--muted":!e.isCurrentMonth,"norio-office-rich-countdown-settings__day--today":e.isToday,"norio-office-rich-countdown-settings__day--selected":e.isSelected}]),onClick:t=>$s(e.year,e.month,e.day)},(0,t.toDisplayString)(e.label),11,XC))),128))]),(0,t.createElementVNode)(`div`,ZC,[a[164]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-countdown-settings__time-label`},`设置时间`,-1),(0,t.createElementVNode)(`div`,QC,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[52]||=e=>Sn.value=e,class:`norio-office-rich-countdown-settings__time-input`,type:`time`,step:`60`,min:Nn.value,onInput:a[53]||=e=>nc(Sn.value),onChange:a[54]||=e=>nc(Sn.value)},null,40,$C),[[t.vModelText,Sn.value]]),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__time-confirm`,onClick:rc},` 确定 `)])])],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`label`,ew,[(0,t.createElementVNode)(`span`,tw,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[55]||=e=>dn.value=e,type:`radio`,value:`duration`},null,512),[[t.vModelRadio,dn.value]]),a[165]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__radio-dot`},null,-1)]),a[170]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__label`},`计时长度`,-1),(0,t.createElementVNode)(`div`,nw,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[56]||=e=>pn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,disabled:dn.value!==`duration`},null,8,rw),[[t.vModelText,pn.value]]),a[166]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`天`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[57]||=e=>mn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`23`,disabled:dn.value!==`duration`},null,8,iw),[[t.vModelText,mn.value]]),a[167]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`时`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[58]||=e=>hn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`59`,disabled:dn.value!==`duration`},null,8,aw),[[t.vModelText,hn.value]]),a[168]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`分`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":a[59]||=e=>gn.value=e,class:`norio-office-rich-countdown-settings__number`,type:`number`,min:`0`,max:`59`,disabled:dn.value!==`duration`},null,8,ow),[[t.vModelText,gn.value]]),a[169]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-settings__unit`},`秒`,-1)])]),(0,t.createElementVNode)(`div`,sw,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__button norio-office-rich-countdown-settings__button--secondary`,onClick:a[60]||=e=>vn.value=!1},` 取消 `),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-settings__button norio-office-rich-countdown-settings__button--primary`,onClick:Uu},` 确定 `)])])])):(0,t.createCommentVNode)(``,!0)],512),a[171]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-countdown-bubble-menu__divider`},null,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-countdown-bubble-menu__button norio-office-rich-countdown-bubble-menu__button--danger`,title:`删除`,"aria-label":`删除`,onMousedown:a[61]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Wu},[(0,t.createVNode)(M,{name:`delete`,size:14,color:`#dc2626`,"background-color":`transparent`})],32)])]),_:1},8,[`editor`])):(0,t.createCommentVNode)(``,!0),Ha.value&&Va.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:`norio-office-rich-editor__watermark`,style:(0,t.normalizeStyle)(Ua.value),"aria-hidden":`true`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(Wa),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e,class:`norio-office-rich-editor__watermark-text`},(0,t.toDisplayString)(Va.value.text),1))),128))],4)):(0,t.createCommentVNode)(``,!0),(0,t.unref)(W)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.EditorContent),{key:4,editor:(0,t.unref)(W),class:`norio-office-rich-editor__content`,onClickCapture:oe},null,8,[`editor`])):(0,t.createCommentVNode)(``,!0),li.value&&bt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:5,ref_key:`mentionPanelRef`,ref:Ke,class:`norio-office-rich-mention-panel`,style:(0,t.normalizeStyle)(H.value),onMousedown:a[62]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createElementVNode)(`div`,cw,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(tn,e=>(0,t.createElementVNode)(`button`,{key:String(e.key),type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-mention-panel__tab`,{"norio-office-rich-mention-panel__tab--active":Ct.value===e.key}]),onClick:t=>oa(e.key)},(0,t.toDisplayString)(e.label),11,lw)),64))]),(0,t.createVNode)(sn,{class:`norio-office-rich-mention-panel__scroll`},{default:(0,t.withCtx)(()=>[xt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,uw,`加载中...`)):Gi.value.length?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:2},(0,t.renderList)(Gi.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`${e.type}-${e.id}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-mention-panel__item`,{"norio-office-rich-mention-panel__item--active":n===Tt.value}]),onClick:t=>sa(e,n),onDblclick:t=>la(e)},[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-mention-panel__avatar`,"data-type":e.type,style:(0,t.normalizeStyle)($i(e))},[e.type===1&&e.avatar?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:e.avatar,alt:``},null,8,mw)):e.type===2&&e.icon?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:e.icon,alt:``},null,8,hw)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,gw,(0,t.toDisplayString)(Qi(e)),1))],12,pw),(0,t.createElementVNode)(`span`,_w,[(0,t.createElementVNode)(`span`,vw,[(0,t.createElementVNode)(`span`,yw,(0,t.toDisplayString)(e.name),1),e.tag?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,bw,(0,t.toDisplayString)(e.tag),1)):(0,t.createCommentVNode)(``,!0)]),e.type===2&&e.updatedAt?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,xw,` 最近修改:`+(0,t.toDisplayString)(e.updatedAt),1)):(0,t.createCommentVNode)(``,!0)])],42,fw))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dw,`暂无可提及内容`))]),_:1}),(0,t.createElementVNode)(`div`,Sw,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-mention-panel__submit`,disabled:!Ki.value,onClick:da},` 提及 `,8,Cw)])],36)):(0,t.createCommentVNode)(``,!0),Ka.value&&Hr.value===`actions`&&![`table`,`imageBlock`,`videoBlock`,`linkBlock`].includes(Ka.value.node.type.name)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:6,class:`norio-office-rich-block-side-menu-focus`,style:(0,t.normalizeStyle)({left:`${Ka.value.rect.left}px`,top:`${Ka.value.rect.top}px`,width:`${Ka.value.rect.width}px`,height:`${Ka.value.rect.height}px`}),"aria-hidden":`true`},null,4)):(0,t.createCommentVNode)(``,!0),Hi.value||Wi.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:7,class:`norio-office-rich-marquee-selection-layer`,"data-active":Ar.value,"aria-hidden":`true`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Ui.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:`marquee-block-${e.pos}`,class:`norio-office-rich-marquee-selection-layer__block`,style:(0,t.normalizeStyle)({left:`${e.rect.left}px`,top:`${e.rect.top}px`,width:`${e.rect.width}px`,height:`${e.rect.height}px`})},null,4))),128)),Hi.value&&Ar.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`norio-office-rich-marquee-selection-layer__box`,style:(0,t.normalizeStyle)({left:`${Hi.value.left}px`,top:`${Hi.value.top}px`,width:`${Hi.value.width}px`,height:`${Hi.value.height}px`})},null,4)):(0,t.createCommentVNode)(``,!0)],8,ww)):(0,t.createCommentVNode)(``,!0),Ka.value&&ei.value&&!Je.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:8,class:(0,t.normalizeClass)([`norio-office-rich-block-side-control`,{"norio-office-rich-block-side-control--empty":Ka.value.isEmpty}]),style:(0,t.normalizeStyle)(ro.value),onMouseenter:a[68]||=e=>X(Ka.value),onMouseleave:kc},[Ka.value.isEmpty?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`norio-office-rich-block-side-control__button norio-office-rich-block-side-control__button--empty`,title:`插入`,onMousedown:a[63]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:a[64]||=e=>jc(Ka.value,`insert`)},[(0,t.createVNode)(M,{name:`add`,size:12,color:`currentColor`,"background-color":`transparent`})],32)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-block-side-control__button`,title:Ka.value.label,onMousedown:a[65]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:a[66]||=e=>jc(Ka.value,`actions`)},[Ka.value.iconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:Ka.value.iconName,size:14,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Ew,(0,t.toDisplayString)(Ka.value.textIcon),1))],40,Tw),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-block-side-control__button norio-office-rich-block-side-control__button--drag`,title:`拖动`,onMousedown:a[67]||=e=>dl(e,Ka.value)},[(0,t.createVNode)(M,{name:`drag`,size:12,color:`#9aa4b2`,"background-color":`transparent`})],32)],64))],38)):(0,t.createCommentVNode)(``,!0),Ka.value&&Hr.value?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:9,ref_key:`blockSideMenuRef`,ref:De,class:`norio-office-rich-block-side-menu`,style:(0,t.normalizeStyle)(co.value),onMouseenter:a[100]||=e=>Ac(Ka.value),onMouseleave:kc,onMousedown:a[101]||=(0,t.withModifiers)(()=>{},[`stop`])},[Hr.value===`insert`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,Dw,[a[172]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-block-side-menu__title`},`基础`,-1),(0,t.createElementVNode)(`div`,Ow,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Qn,e=>(0,t.createElementVNode)(`button`,{key:`block-quick-${e.key}`,type:`button`,class:`norio-office-rich-block-side-menu__quick-button`,onClick:t=>Fc(e.action)},[e.type===`icon`?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.iconName||``,size:17,color:`#1f2937`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Aw,(0,t.toDisplayString)(e.label),1))],8,kw)),64))])]),(0,t.createElementVNode)(`div`,jw,[a[173]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-block-side-menu__title`},`常用`,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(nr,e=>(0,t.createElementVNode)(`button`,{key:`block-insert-${e.key}`,type:`button`,class:`norio-office-rich-block-side-menu__item`,onClick:t=>Fc(e.action)},[e.colorIconName?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.colorIconName},null,8,[`name`])):((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:`smile`,size:17,color:`#64748b`,"background-color":`transparent`})),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(N(e.key)),1)],8,Mw)),64))])],64)):Hr.value===`actions`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[qa.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Nw,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(qa.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`block-transform-${e.key}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__quick-button`,{"norio-office-rich-block-side-menu__quick-button--active":Ja.value===e.action}]),title:e.label,"aria-label":e.label,"aria-pressed":Ja.value===e.action,onMousedown:a[69]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>Yc(e.action)},[e.type===`icon`?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.iconName||``,size:18,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Fw,(0,t.toDisplayString)(e.label),1))],42,Pw))),128))])):(0,t.createCommentVNode)(``,!0),Ya.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,ref_key:`blockSidePropertiesTriggerRef`,ref:Ve,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":P.value===`properties`}]),onMouseenter:a[70]||=e=>P.value=`properties`,onClick:a[71]||=e=>P.value=`properties`,onMousedown:a[72]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createVNode)(M,{name:`zuoduiqi`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[174]||=(0,t.createElementVNode)(`span`,null,`缩进和对齐`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],34)):(0,t.createCommentVNode)(``,!0),Vc(Ka.value)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,ref_key:`blockSideColorTriggerRef`,ref:He,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":P.value===`color`}]),"aria-expanded":P.value===`color`,onMousedown:a[73]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[74]||=e=>P.value=`color`,onClick:a[75]||=e=>P.value=`color`},[(0,t.createVNode)(M,{name:`yanse`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[175]||=(0,t.createElementVNode)(`span`,null,`颜色`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Iw)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--strong":Ya.value.length>0||Vc(Ka.value)}]),onClick:a[76]||=e=>sl(Ka.value)},[(0,t.createVNode)(M,{name:`cut`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[176]||=(0,t.createElementVNode)(`span`,null,`剪切`,-1)],2),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-block-side-menu__item`,onClick:a[77]||=e=>ol(Ka.value)},[(0,t.createVNode)(M,{name:`xiangxiacharujilu-copy`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[177]||=(0,t.createElementVNode)(`span`,null,`复制`,-1)]),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-block-side-menu__item`,disabled:!ei.value,onClick:a[78]||=e=>ll(Ka.value)},[(0,t.createVNode)(M,{name:`xiangxiacharujilu-copy`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[178]||=(0,t.createElementVNode)(`span`,null,`粘贴`,-1)],8,Lw),Ka.value.node.type.name===`table`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,ref_key:`blockSideTableThemeTriggerRef`,ref:Ne,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-block-side-menu__item--strong`,{"norio-office-rich-block-side-menu__item--active":P.value===`table-theme`}]),"aria-expanded":P.value===`table-theme`,onMousedown:a[79]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:gu,onClick:gu},[(0,t.createVNode)(M,{name:`zhuti`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[179]||=(0,t.createElementVNode)(`span`,null,`主题色`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Rw)):(0,t.createCommentVNode)(``,!0),[`highlightBlock`,`blockquote`].includes(Ka.value.node.type.name)?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:4},[(0,t.createElementVNode)(`button`,{ref_key:`blockSideSurfaceBorderTriggerRef`,ref:Oe,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-block-side-menu__item--strong`,{"norio-office-rich-block-side-menu__item--active":[`highlight-border`,`quote-border`].includes(P.value||``)}]),"aria-expanded":[`highlight-border`,`quote-border`].includes(P.value||``),onMousedown:a[80]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[81]||=e=>P.value=Ka.value.node.type.name===`blockquote`?`quote-border`:`highlight-border`,onClick:a[82]||=e=>P.value=Ka.value.node.type.name===`blockquote`?`quote-border`:`highlight-border`},[(0,t.createVNode)(M,{name:`yanse`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[180]||=(0,t.createElementVNode)(`span`,null,`边框颜色`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,zw),(0,t.createElementVNode)(`button`,{ref_key:`blockSideSurfaceFillTriggerRef`,ref:ke,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":[`highlight-fill`,`quote-background`].includes(P.value||``)}]),"aria-expanded":[`highlight-fill`,`quote-background`].includes(P.value||``),onMousedown:a[83]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[84]||=e=>P.value=Ka.value.node.type.name===`blockquote`?`quote-background`:`highlight-fill`,onClick:a[85]||=e=>P.value=Ka.value.node.type.name===`blockquote`?`quote-background`:`highlight-fill`},[(0,t.createVNode)(M,{name:`beijingse`,size:18,color:`#4b5563`,"background-color":`transparent`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(Ka.value.node.type.name===`blockquote`?`背景颜色`:`填充颜色`),1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Bw),Ka.value.node.type.name===`highlightBlock`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,ref_key:`blockSideHighlightSettingsTriggerRef`,ref:Ae,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":P.value===`highlight-settings`}]),"aria-expanded":P.value===`highlight-settings`,onMousedown:a[86]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[87]||=e=>P.value=`highlight-settings`,onClick:a[88]||=e=>P.value=`highlight-settings`},[(0,t.createVNode)(M,{name:`shezhi`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[181]||=(0,t.createElementVNode)(`span`,null,`设置`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Vw)):(0,t.createCommentVNode)(``,!0)],64)):(0,t.createCommentVNode)(``,!0),Ka.value.node.type.name===`horizontalRule`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:5},[(0,t.createElementVNode)(`button`,{ref_key:`blockSideDividerStyleTriggerRef`,ref:Pe,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-block-side-menu__item--strong`,{"norio-office-rich-block-side-menu__item--active":P.value===`divider-style`}]),"aria-expanded":P.value===`divider-style`,onMousedown:a[89]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[90]||=e=>P.value=`divider-style`,onClick:a[91]||=e=>P.value=`divider-style`},[(0,t.createVNode)(an,{name:`fengexian`,size:18,"background-color":`transparent`}),a[182]||=(0,t.createElementVNode)(`span`,null,`样式`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Hw),(0,t.createElementVNode)(`button`,{ref_key:`blockSideDividerColorTriggerRef`,ref:Fe,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":P.value===`divider-color`}]),"aria-expanded":P.value===`divider-color`,onMousedown:a[92]||=(0,t.withModifiers)(()=>{},[`prevent`]),onMouseenter:a[93]||=e=>P.value=`divider-color`,onClick:a[94]||=e=>P.value=`divider-color`},[(0,t.createVNode)(M,{name:`yanse`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[183]||=(0,t.createElementVNode)(`span`,null,`颜色`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Uw)],64)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-block-side-menu__item norio-office-rich-block-side-menu__item--strong`,onClick:a[95]||=e=>ul(Ka.value)},[(0,t.createVNode)(M,{name:`delete`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[184]||=(0,t.createElementVNode)(`span`,null,`删除`,-1)]),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-block-side-menu__item--strong`,{"norio-office-rich-block-side-menu__item--active":P.value===`add-above`}]),"aria-expanded":P.value===`add-above`,"aria-haspopup":`true`,onMouseenter:a[96]||=e=>!q.value&&(P.value=`add-above`),onClick:a[97]||=e=>P.value=`add-above`},[(0,t.createVNode)(M,{name:`shangfangtianjia`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[185]||=(0,t.createElementVNode)(`span`,null,`在上方添加`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Ww),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--active":P.value===`add-below`}]),"aria-expanded":P.value===`add-below`,"aria-haspopup":`true`,onMouseenter:a[98]||=e=>!q.value&&(P.value=`add-below`),onClick:a[99]||=e=>P.value=`add-below`},[(0,t.createVNode)(M,{name:`xiafangtianjia`,size:18,color:`#4b5563`,"background-color":`transparent`}),a[186]||=(0,t.createElementVNode)(`span`,null,`在下方添加`,-1),(0,t.createVNode)(M,{name:`youjiantou`,size:14,color:`#9aa4b2`,"background-color":`transparent`})],42,Gw)],64)):(0,t.createCommentVNode)(``,!0)],36)),[[t.vShow,!(q.value&&en.includes(P.value||``))]]):(0,t.createCommentVNode)(``,!0),Ka.value&&Xa.value&&P.value===`table-theme`?((0,t.openBlock)(),(0,t.createBlock)(lu,{key:10,class:`norio-office-rich-block-side-table-theme`,theme:Oo.value,"recent-colors":xr.value,style:(0,t.normalizeStyle)(ko.value),onChange:_u,onColorUsed:Ef,onClear:a[102]||=e=>_u(null),onClose:vu,onResize:a[103]||=e=>ut.value=e,onReposition:hu,onMouseenter:a[104]||=e=>Ac(Ka.value),onMouseleave:kc,onMousedown:a[105]||=(0,t.withModifiers)(()=>{},[`stop`])},null,8,[`theme`,`recent-colors`,`style`])):(0,t.createCommentVNode)(``,!0),Ka.value&&Xa.value&&P.value!==`table-theme`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:11,class:(0,t.normalizeClass)([`norio-office-rich-block-side-submenu`,{"norio-office-rich-block-side-submenu--properties":P.value===`properties`,"norio-office-rich-block-side-submenu--color":P.value===`divider-color`}]),style:(0,t.normalizeStyle)(lo.value),onMouseenter:a[113]||=e=>Ac(Ka.value),onMouseleave:kc,onMousedown:a[114]||=(0,t.withModifiers)(()=>{},[`stop`])},[q.value&&en.includes(P.value||``)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`norio-office-rich-block-side-menu__back`,"aria-label":`返回句柄菜单`,onMousedown:a[106]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:a[107]||=e=>P.value=null},[(0,t.createVNode)(M,{name:`zuojiantou`,size:14,color:`currentColor`,"background-color":`transparent`}),a[187]||=(0,t.createElementVNode)(`span`,null,`返回`,-1)],32)):(0,t.createCommentVNode)(``,!0),P.value===`properties`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(Ya.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`block-property-${e.key}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item`,{"norio-office-rich-block-side-menu__item--strong":e.action===`indent-more`,"norio-office-rich-block-side-menu__item--active":e.action===`align-${Po.value}`}]),disabled:e.action===`indent-less`?!Io.value:e.action===`indent-more`&&!Fo.value,"aria-pressed":e.action.startsWith(`align-`)?e.action===`align-${Po.value}`:void 0,onMousedown:a[108]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>Xc(e.action)},[(0,t.createVNode)(M,{name:e.iconName,size:18,color:`#4b5563`,"background-color":`transparent`},null,8,[`name`]),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.label),1),e.action===`align-${Po.value}`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,qw,`✓`)):(0,t.createCommentVNode)(``,!0)],42,Kw))),128)):Wc.value?((0,t.openBlock)(),(0,t.createBlock)(Wn,{key:2,kind:Wc.value.kind,label:Wc.value.label,"preset-colors":Wc.value.presetColors,color:Wc.value.color,"custom-kind":Kr.value,"hover-enabled":!q.value,onChange:a[109]||=(e,t)=>Gc(t??`transparent`),onCustom:el,onReset:a[110]||=e=>Gc(Wc.value.defaultColor)},null,8,[`kind`,`label`,`preset-colors`,`color`,`custom-kind`,`hover-enabled`])):P.value===`highlight-settings`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,type:`button`,class:`norio-office-rich-code-block__setting-row`,role:`switch`,"aria-checked":jo.value.emojiEnabled,onMousedown:a[111]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:Kc},[a[189]||=(0,t.createElementVNode)(`span`,null,`启用表情`,-1),(0,t.createElementVNode)(`span`,{class:`norio-office-rich-code-block__switch`,"data-checked":jo.value.emojiEnabled?`true`:`false`,"aria-hidden":`true`},[...a[188]||=[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-code-block__switch-thumb`},null,-1)]],8,Yw)],40,Jw)):P.value===`divider-style`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:4},(0,t.renderList)((0,t.unref)(Sp),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.value,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-block-side-menu__item norio-office-rich-divider-style-option`,{"norio-office-rich-block-side-menu__item--active":Lo.value===e.value}]),"aria-label":e.label,title:e.label,"aria-pressed":Lo.value===e.value,onMousedown:a[112]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>qc({lineStyle:e.value})},[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-divider-style-option__preview`,style:(0,t.normalizeStyle)({borderTopStyle:e.value}),"aria-hidden":`true`},null,4),(0,t.createElementVNode)(`span`,Zw,(0,t.toDisplayString)(Lo.value===e.value?`✓`:``),1)],42,Xw))),128)):P.value===`divider-color`?((0,t.openBlock)(),(0,t.createBlock)(Rn,{key:5,color:Ro.value,"default-color":(0,t.unref)(xp),"recent-colors":br.value,onChange:Jc},null,8,[`color`,`default-color`,`recent-colors`])):P.value===`color`?((0,t.openBlock)(),(0,t.createBlock)(Wn,{key:6,"text-color":Mo.value.text,"background-color":Mo.value.background,"custom-kind":Kr.value,"hover-enabled":!q.value,onChange:Qc,onCustom:el,onReset:$c},null,8,[`text-color`,`background-color`,`custom-kind`,`hover-enabled`])):P.value===`add-above`||P.value===`add-below`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:7},[(0,t.createElementVNode)(`div`,Qw,[a[190]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-block-side-menu__title`},`基础`,-1),(0,t.createElementVNode)(`div`,$w,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Qn,e=>(0,t.createElementVNode)(`button`,{key:`block-add-quick-${e.key}`,type:`button`,class:`norio-office-rich-block-side-menu__quick-button`,onClick:t=>Fc(e.action)},[e.type===`icon`?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.iconName||``,size:17,color:`#1f2937`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,tT,(0,t.toDisplayString)(e.label),1))],8,eT)),64))])]),(0,t.createElementVNode)(`div`,nT,[a[191]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-block-side-menu__title`},`常用`,-1),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(nr,e=>(0,t.createElementVNode)(`button`,{key:`block-add-insert-${e.key}`,type:`button`,class:`norio-office-rich-block-side-menu__item`,onClick:t=>Fc(e.action)},[e.colorIconName?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.colorIconName},null,8,[`name`])):((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:`smile`,size:17,color:`#64748b`,"background-color":`transparent`})),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(N(e.key)),1)],8,rT)),64))])],64)):(0,t.createCommentVNode)(``,!0)],38)),[[t.vShow,!(q.value&&Kr.value)]]):(0,t.createCommentVNode)(``,!0),Ka.value&&Xa.value&&Kr.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:12,class:`norio-office-rich-block-side-submenu norio-office-rich-block-side-submenu--color norio-office-rich-block-side-submenu--tertiary`,style:(0,t.normalizeStyle)(po.value),role:`dialog`,"aria-label":nl.value.label,onMouseenter:a[119]||=e=>Ac(Ka.value),onMouseleave:kc,onMousedown:a[120]||=(0,t.withModifiers)(()=>{},[`stop`])},[q.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`norio-office-rich-block-side-menu__back norio-office-rich-block-colors__palette-back`,"aria-label":`返回颜色菜单`,onMousedown:a[115]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:a[116]||=e=>Kr.value=null},[(0,t.createVNode)(M,{name:`zuojiantou`,size:14,color:`currentColor`,"background-color":`transparent`}),a[192]||=(0,t.createElementVNode)(`span`,null,`返回`,-1)],32)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(Rn,{color:nl.value.color||nl.value.defaultColor,"default-color":nl.value.defaultColor,"recent-colors":nl.value.recentColors,onChange:tl},null,8,[`color`,`default-color`,`recent-colors`]),(0,t.createElementVNode)(`div`,aT,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-color-menu__current`,onMousedown:a[117]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:a[118]||=e=>tl(null)},`清除颜色`,32)])],44,iT)):(0,t.createCommentVNode)(``,!0),Mr.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:13,class:`norio-office-rich-drag-insert-indicator`,style:(0,t.normalizeStyle)({left:`${Mr.value.left}px`,top:`${Mr.value.top}px`,width:`${Mr.value.width}px`}),"aria-hidden":`true`},[...a[193]||=[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-drag-insert-indicator__line`},null,-1)]],4)):(0,t.createCommentVNode)(``,!0),ei.value&&Hn.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:14,class:`norio-office-rich-table-column-track`,style:(0,t.normalizeStyle)({left:`${Hn.value.left}px`,top:`${Hn.value.top-14}px`,width:`${Hn.value.width}px`})},[a[194]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-table-column-track__line`},null,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Un.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`table-column-segment-${e.index}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-column-track__segment`,{"norio-office-rich-table-column-track__segment--active":Jn.value===e.index}]),style:(0,t.normalizeStyle)({left:`${e.left-Hn.value.left}px`,width:`${e.width}px`}),onMousedown:a[121]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>Su(e.index)},null,46,oT))),128)),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Kn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:`norio-office-rich-table-track__dot norio-office-rich-table-track__dot--column`,title:`插入列`,"aria-label":`插入列`,style:(0,t.normalizeStyle)({left:`${e.left-Hn.value.left}px`}),onMousedown:a[122]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>wu(e.insertIndex)},null,44,sT))),128))],4)):(0,t.createCommentVNode)(``,!0),ei.value&&Hn.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:15,class:`norio-office-rich-table-row-track`,style:(0,t.normalizeStyle)({left:`${Hn.value.left-14}px`,top:`${Hn.value.top}px`,height:`${Hn.value.height}px`})},[a[195]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-table-row-track__line`},null,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Gn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`table-row-segment-${e.index}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-table-row-track__segment`,{"norio-office-rich-table-row-track__segment--active":Yn.value===e.index}]),style:(0,t.normalizeStyle)({top:`${e.top-Hn.value.top}px`,height:`${e.height}px`}),onMousedown:a[123]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>Cu(e.index)},null,46,cT))),128)),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(qn.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,class:`norio-office-rich-table-track__dot norio-office-rich-table-track__dot--row`,title:`插入行`,"aria-label":`插入行`,style:(0,t.normalizeStyle)({top:`${e.top-Hn.value.top}px`}),onMousedown:a[124]||=(0,t.withModifiers)(()=>{},[`prevent`]),onClick:t=>Tu(e.insertIndex)},null,44,lT))),128))],4)):(0,t.createCommentVNode)(``,!0),(0,t.createCommentVNode)(``,!0)],544)],4)]),_:1})]),F.value?((0,t.openBlock)(),(0,t.createElementBlock)(`aside`,{key:2,ref_key:`commentPanelRef`,ref:ce,class:`norio-office-rich-comment-panel`,"aria-label":`评论`},[(0,t.createElementVNode)(`div`,uT,[(0,t.createElementVNode)(`strong`,null,(0,t.toDisplayString)(hi.value),1)]),(0,t.createVNode)(sn,{"class-name":`norio-office-rich-comment-panel__scroll`},{default:(0,t.withCtx)(()=>[mi.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fT,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(mi.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`article`,{key:e.id,ref_for:!0,ref:t=>Dd(e.id,t),class:(0,t.normalizeClass)([`norio-office-rich-comment-card`,{"norio-office-rich-comment-card--active":gi.value?.id===e.id,"norio-office-rich-comment-card--pending":Rt.value?.id===e.id}]),onClick:t=>Fd(e)},[a[198]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-comment-card__topline`},null,-1),(0,t.createElementVNode)(`div`,mT,(0,t.toDisplayString)(Sd(e)),1),(0,t.createElementVNode)(`div`,hT,[(0,t.createElementVNode)(`button`,{type:`button`,title:`删除`,disabled:Rt.value?.id===e.id,onClick:(0,t.withModifiers)(t=>Gd(e.id),[`stop`])},[(0,t.createVNode)(M,{name:`delete`,size:13,color:`#dc2626`,"background-color":`transparent`})],8,gT)]),e.comments.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_T,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(md(e),n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:`norio-office-rich-comment-item`},[(0,t.createElementVNode)(`div`,{class:`norio-office-rich-comment-item__avatar`,style:(0,t.normalizeStyle)(id(n.author))},[n.author.avatar?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:n.author.avatar,alt:``},null,8,vT)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,yT,(0,t.toDisplayString)(rd(n.author)),1))],4),(0,t.createElementVNode)(`div`,bT,[(0,t.createElementVNode)(`div`,xT,[(0,t.createElementVNode)(`strong`,null,(0,t.toDisplayString)(n.author.name),1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(ad(n.updatedAt||n.createdAt)),1)]),Bd(e.id,n)?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`textarea`,{class:`norio-office-rich-comment-composer__input`,value:Ft.value,rows:`2`,onInput:Vd,onKeydown:t=>Hd(e.id,n,t)},null,40,ST),(0,t.createElementVNode)(`div`,CT,[(0,t.createElementVNode)(`button`,{type:`button`,onClick:(0,t.withModifiers)(Ud,[`stop`])},`取消`),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-comment-composer__submit`,onClick:(0,t.withModifiers)(t=>Wd(e.id,n),[`stop`])},` 保存 `,8,wT)])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,TT,(0,t.toDisplayString)(n.content),1),n.images?.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ET,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n.images,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.url,type:`button`,class:`norio-office-rich-comment-images__item`,onClick:(0,t.withModifiers)(t=>Xd(e),[`stop`])},[(0,t.createElementVNode)(`img`,{src:e.url,alt:e.alt||e.name||``},null,8,OT)],8,DT))),128))])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,kT,[(0,t.createElementVNode)(`button`,{type:`button`,onClick:(0,t.withModifiers)(t=>bd(e,n),[`stop`])},`回复`,8,AT),n.author.id===pi.value?.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,onClick:(0,t.withModifiers)(t=>zd(e.id,n),[`stop`])},`编辑`,8,jT)):(0,t.createCommentVNode)(``,!0),n.author.id===pi.value?.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,onClick:(0,t.withModifiers)(t=>Gd(e.id,n),[`stop`])},`删除`,8,MT)):(0,t.createCommentVNode)(``,!0)])],64)),hd(e,n).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,NT,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(hd(e,n),n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:`norio-office-rich-comment-item norio-office-rich-comment-item--reply`},[(0,t.createElementVNode)(`div`,{class:`norio-office-rich-comment-item__avatar`,style:(0,t.normalizeStyle)(id(n.author))},[n.author.avatar?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:n.author.avatar,alt:``},null,8,PT)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,FT,(0,t.toDisplayString)(rd(n.author)),1))],4),(0,t.createElementVNode)(`div`,IT,[(0,t.createElementVNode)(`div`,LT,[(0,t.createElementVNode)(`strong`,null,(0,t.toDisplayString)(n.author.name),1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(ad(n.updatedAt||n.createdAt)),1)]),Bd(e.id,n)?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`textarea`,{class:`norio-office-rich-comment-composer__input`,value:Ft.value,rows:`2`,onInput:Vd,onKeydown:t=>Hd(e.id,n,t)},null,40,RT),(0,t.createElementVNode)(`div`,zT,[(0,t.createElementVNode)(`button`,{type:`button`,onClick:(0,t.withModifiers)(Ud,[`stop`])},`取消`),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-comment-composer__submit`,onClick:(0,t.withModifiers)(t=>Wd(e.id,n),[`stop`])},` 保存 `,8,BT)])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,VT,(0,t.toDisplayString)(n.content),1),n.images?.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,HT,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n.images,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.url,type:`button`,class:`norio-office-rich-comment-images__item`,onClick:(0,t.withModifiers)(t=>Xd(e),[`stop`])},[(0,t.createElementVNode)(`img`,{src:e.url,alt:e.alt||e.name||``},null,8,WT)],8,UT))),128))])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,GT,[(0,t.createElementVNode)(`button`,{type:`button`,onClick:(0,t.withModifiers)(t=>bd(e,n),[`stop`])},`回复`,8,KT),n.author.id===pi.value?.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,onClick:(0,t.withModifiers)(t=>zd(e.id,n),[`stop`])},`编辑`,8,qT)):(0,t.createCommentVNode)(``,!0),n.author.id===pi.value?.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,onClick:(0,t.withModifiers)(t=>Gd(e.id,n),[`stop`])},`删除`,8,JT)):(0,t.createCommentVNode)(``,!0)])],64))])]))),128))])):(0,t.createCommentVNode)(``,!0),yd(e,n)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:`norio-office-rich-comment-composer norio-office-rich-comment-composer--inline`,onClick:a[126]||=(0,t.withModifiers)(()=>{},[`stop`])},[dd(e.id,_d(e.id)??void 0).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,YT,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(dd(e.id,_d(e.id)??void 0),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:`${n.url}-${r}`,class:`norio-office-rich-comment-draft-images__item`},[(0,t.createElementVNode)(`img`,{src:n.url,alt:n.alt||n.name||``},null,8,XT),(0,t.createElementVNode)(`button`,{type:`button`,onClick:t=>Yd(e.id,r,_d(e.id)??void 0)},`x`,8,ZT)]))),128))])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`textarea`,{class:`norio-office-rich-comment-composer__input`,placeholder:`回复 ${vd(e)?.author.name??``}`,value:sd(e.id,_d(e.id)??void 0),rows:`2`,onInput:t=>ld(e.id,t,_d(e.id)??void 0),onKeydown:t=>ud(e.id,t,_d(e.id)??void 0)},null,40,QT),(0,t.createElementVNode)(`div`,$T,[(0,t.createElementVNode)(`button`,{type:`button`,title:`上传图片`,onClick:t=>Kd(e.id)},[(0,t.createVNode)(M,{name:`image`,size:14,color:`#667085`,"background-color":`transparent`})],8,eE),a[196]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-comment-composer__spacer`},null,-1),(0,t.createElementVNode)(`button`,{type:`button`,onClick:t=>xd(e.id,_d(e.id)??``)},`取消`,8,tE),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-comment-composer__submit`,disabled:!pi.value||!sd(e.id,_d(e.id)??void 0).trim()&&!dd(e.id,_d(e.id)??void 0).length,onClick:t=>Rd(e.id,_d(e.id)??void 0)},` 回复 `,8,nE)])])):(0,t.createCommentVNode)(``,!0)])]))),128))])):Rt.value?.id===e.id?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,rE,` 暂无回复 `)),(gi.value?.id===e.id||Rt.value?.id===e.id)&&!vd(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`norio-office-rich-comment-composer`,onClick:a[127]||=(0,t.withModifiers)(()=>{},[`stop`])},[dd(e.id).length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,iE,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(dd(e.id),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:`${n.url}-${r}`,class:`norio-office-rich-comment-draft-images__item`},[(0,t.createElementVNode)(`img`,{src:n.url,alt:n.alt||n.name||``},null,8,aE),(0,t.createElementVNode)(`button`,{type:`button`,onClick:t=>Yd(e.id,r)},`×`,8,oE)]))),128))])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`textarea`,{class:`norio-office-rich-comment-composer__input`,placeholder:Rt.value?.id===e.id?`输入评论`:`回复`,value:sd(e.id),rows:`2`,onInput:t=>ld(e.id,t),onKeydown:t=>ud(e.id,t)},null,40,sE),(0,t.createElementVNode)(`div`,cE,[(0,t.createElementVNode)(`button`,{type:`button`,title:`上传图片`,onClick:t=>Kd(e.id)},[(0,t.createVNode)(M,{name:`image`,size:14,color:`#667085`,"background-color":`transparent`})],8,lE),a[197]||=(0,t.createElementVNode)(`span`,{class:`norio-office-rich-comment-composer__spacer`},null,-1),Rt.value?.id===e.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,onClick:t=>Ld(e.id)},` 取消 `,8,uE)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-comment-composer__submit`,disabled:!pi.value||!sd(e.id).trim()&&!dd(e.id).length,onClick:t=>Rd(e.id)},(0,t.toDisplayString)(Rt.value?.id===e.id?`发布`:`回复`),9,dE)])])):(0,t.createCommentVNode)(``,!0)],10,pT))),128))])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dT,` 暂无评论 `))]),_:1})],512)):(0,t.createCommentVNode)(``,!0)]),ui.value&&Ht.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,ref_key:`commentMentionPanelRef`,ref:le,class:`norio-office-rich-mention-panel norio-office-rich-comment-mention-panel`,style:(0,t.normalizeStyle)(Ji.value),onMousedown:a[128]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createElementVNode)(`div`,fE,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(tn,e=>(0,t.createElementVNode)(`button`,{key:`comment-${String(e.key)}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-mention-panel__tab`,{"norio-office-rich-mention-panel__tab--active":Gt.value===e.key}]),onClick:t=>Da(e.key)},(0,t.toDisplayString)(e.label),11,pE)),64))]),(0,t.createVNode)(sn,{class:`norio-office-rich-mention-panel__scroll`},{default:(0,t.withCtx)(()=>[Ut.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,mE,`加载中...`)):qi.value.length?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:2},(0,t.renderList)(qi.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:`comment-${e.type}-${e.id}`,type:`button`,class:(0,t.normalizeClass)([`norio-office-rich-mention-panel__item`,{"norio-office-rich-mention-panel__item--active":n===qt.value}]),onClick:t=>Oa(e,n),onDblclick:t=>Aa(e)},[(0,t.createElementVNode)(`span`,{class:`norio-office-rich-mention-panel__avatar`,"data-type":e.type,style:(0,t.normalizeStyle)($i(e))},[e.type===1&&e.avatar?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:e.avatar,alt:``},null,8,vE)):e.type===2&&e.icon?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:e.icon,alt:``},null,8,yE)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,bE,(0,t.toDisplayString)(Qi(e)),1))],12,_E),(0,t.createElementVNode)(`span`,xE,[(0,t.createElementVNode)(`span`,SE,[(0,t.createElementVNode)(`span`,CE,(0,t.toDisplayString)(e.name),1),e.tag?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,wE,(0,t.toDisplayString)(e.tag),1)):(0,t.createCommentVNode)(``,!0)]),e.type===2&&e.updatedAt?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,TE,` 最近修改:`+(0,t.toDisplayString)(e.updatedAt),1)):(0,t.createCommentVNode)(``,!0)])],42,gE))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,hE,`暂无可提及内容`))]),_:1}),(0,t.createElementVNode)(`div`,EE,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-mention-panel__submit`,disabled:!U.value,onClick:ja},` 提及 `,8,DE)])],36)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[Xr.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`norio-office-rich-block-drag-ghost`,style:(0,t.normalizeStyle)(mo.value),"aria-hidden":`true`},[(0,t.createElementVNode)(`div`,{class:`norio-office-rich-block-drag-ghost__content norio-office-rich-prosemirror`,innerHTML:Xr.value.html},null,8,OE)],4)):(0,t.createCommentVNode)(``,!0)])),(0,t.createVNode)(Rl,{open:rn.value,value:on.value,title:`插入 LaTeX 公式`,"submit-label":`插入`,onClose:Gu,onSubmit:Ju},null,8,[`open`,`value`]),(0,t.createElementVNode)(`input`,{ref_key:`markdownImportInputRef`,ref:pe,type:`file`,accept:`.md,.markdown,text/markdown,text/plain`,hidden:``,onChange:qu},null,544),(0,t.createElementVNode)(`input`,{ref_key:`localFileInputRef`,ref:me,type:`file`,hidden:``,onChange:lf},null,544),(0,t.createElementVNode)(`input`,{ref_key:`imageUploadInputRef`,ref:he,type:`file`,accept:`image/*`,hidden:``,onChange:sf},null,544),(0,t.createElementVNode)(`input`,{ref_key:`videoUploadInputRef`,ref:ge,type:`file`,accept:`video/*`,hidden:``,onChange:cf},null,544),(0,t.createElementVNode)(`input`,{ref_key:`commentImageInputRef`,ref:_e,type:`file`,accept:`image/*`,hidden:``,onChange:Jd},null,544),zt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:`norio-office-rich-comment-image-viewer`,role:`dialog`,"aria-modal":`true`,onClick:(0,t.withModifiers)(Zd,[`self`])},[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-comment-image-viewer__close`,"aria-label":`Close image preview`,onClick:Zd},[(0,t.createVNode)(M,{name:`close`,size:20,color:`#ffffff`,"background-color":`transparent`})]),(0,t.createElementVNode)(`div`,kE,[(0,t.createElementVNode)(`img`,{class:`norio-office-rich-comment-image-viewer__image`,src:zt.value.url,alt:zt.value.alt||zt.value.name||``},null,8,AE),zt.value.name||zt.value.description?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,jE,[zt.value.name?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ME,(0,t.toDisplayString)(zt.value.name),1)):(0,t.createCommentVNode)(``,!0),zt.value.description?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,NE,(0,t.toDisplayString)(zt.value.description),1)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)])])):(0,t.createCommentVNode)(``,!0),kt.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,PE,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(kt.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:(0,t.normalizeClass)([`norio-office-rich-upload-panel__item`,{"norio-office-rich-upload-panel__item--uploading":e.status===`uploading`,"norio-office-rich-upload-panel__item--error":e.status===`error`}])},[e.status===`uploading`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,FE)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,IE,`!`)),(0,t.createElementVNode)(`div`,LE,[(0,t.createElementVNode)(`div`,RE,(0,t.toDisplayString)(Es(e)),1),(0,t.createElementVNode)(`div`,zE,(0,t.toDisplayString)(e.message||e.fileName),1)]),e.status===`error`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,type:`button`,class:`norio-office-rich-upload-panel__button`,onClick:e.retry},` 重试 `,8,BE)):(0,t.createCommentVNode)(``,!0),e.status===`error`?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,type:`button`,class:`norio-office-rich-upload-panel__button norio-office-rich-upload-panel__button--ghost`,onClick:t=>Ds(e.id)},` 关闭 `,8,VE)):(0,t.createCommentVNode)(``,!0)],2))),128))])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`footer`,HE,[(0,t.createElementVNode)(`div`,UE,[(0,t.createElementVNode)(`div`,WE,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(R.value),1)]),(0,t.createElementVNode)(`div`,GE,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(z.value),1)])]),(0,t.createElementVNode)(`div`,KE,[(0,t.createElementVNode)(`div`,qE,[(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-statusbar__button norio-office-rich-statusbar__button--icon`,title:`缩小`,"aria-label":`缩小`,disabled:Zt.value<=50,onClick:a[129]||=e=>uc(Zt.value-10)},[(0,t.createVNode)(M,{name:`jianshao`,size:13,color:`currentColor`,"background-color":`transparent`})],8,JE),(0,t.createElementVNode)(`div`,YE,(0,t.toDisplayString)(Zt.value)+`%`,1),(0,t.createElementVNode)(`button`,{type:`button`,class:`norio-office-rich-statusbar__button norio-office-rich-statusbar__button--icon`,title:`放大`,"aria-label":`放大`,disabled:Zt.value>=200,onClick:a[130]||=e=>uc(Zt.value+10)},[(0,t.createVNode)(M,{name:`add`,size:13,color:`currentColor`,"background-color":`transparent`})],8,XE)])])]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:`norio-office-rich-editor__presentation-pointer`,style:(0,t.normalizeStyle)(Vi.value),"aria-hidden":`true`},null,4),[[t.vShow,Je.value]]),((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:qe.value&&ne.value?ne.value:`body`},[Ei.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`slashMenuRef`,ref:fe,class:`norio-office-rich-slash-menu`,style:(0,t.normalizeStyle)(Di.value),role:Ti.value?`listbox`:void 0,"aria-label":Ti.value?`斜杠命令`:`表情符号`,onMousedown:a[131]||=(0,t.withModifiers)(()=>{},[`prevent`])},[Ti.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[Si.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,QE,[a[199]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-slash-menu__title`},`基础`,-1),(0,t.createElementVNode)(`div`,$E,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Si.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,role:`option`,class:(0,t.normalizeClass)([`norio-office-rich-slash-menu__quick-item`,{"norio-office-rich-slash-menu__item--active":e.index===at.value}]),"aria-label":e.label,"aria-selected":e.index===at.value,onMouseenter:t=>at.value=e.index,onClick:t=>Vl(e)},[e.iconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:0,name:e.iconName,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,tD,(0,t.toDisplayString)(e.key===`paragraph`?`T`:e.label),1))],42,eD))),128))])])):(0,t.createCommentVNode)(``,!0),Ci.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,nD,[a[200]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-slash-menu__title`},`常用`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(Ci.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,role:`option`,class:(0,t.normalizeClass)([`norio-office-rich-slash-menu__item`,{"norio-office-rich-slash-menu__item--active":e.index===at.value}]),"aria-selected":e.index===at.value,onMouseenter:t=>at.value=e.index,onClick:t=>Vl(e)},[e.iconName&&e.isColorIcon?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.iconName,size:20,"background-color":`transparent`},null,8,[`name`])):e.iconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:e.iconName,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,iD,(0,t.toDisplayString)(e.label),1)],42,rD))),128))])):(0,t.createCommentVNode)(``,!0),wi.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,aD,[a[201]||=(0,t.createElementVNode)(`div`,{class:`norio-office-rich-slash-menu__title`},`更多`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(wi.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.key,type:`button`,role:`option`,class:(0,t.normalizeClass)([`norio-office-rich-slash-menu__item`,{"norio-office-rich-slash-menu__item--active":e.index===at.value}]),"aria-selected":e.index===at.value,onMouseenter:t=>at.value=e.index,onClick:t=>Vl(e)},[e.iconName&&e.isColorIcon?((0,t.openBlock)(),(0,t.createBlock)(an,{key:0,name:e.iconName,size:20,"background-color":`transparent`},null,8,[`name`])):e.iconName?((0,t.openBlock)(),(0,t.createBlock)(M,{key:1,name:e.iconName,size:16,color:`currentColor`,"background-color":`transparent`},null,8,[`name`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,sD,(0,t.toDisplayString)(e.label),1)],42,oD))),128))])):(0,t.createCommentVNode)(``,!0),xi.value.length?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cD,`无匹配命令`))],64)):((0,t.openBlock)(),(0,t.createBlock)(hr,{key:1,onSelect:Hl}))],44,ZE)):(0,t.createCommentVNode)(``,!0)],8,[`to`]))],40,Xb))}}),AD=(0,t.defineComponent)({__name:`RichTextOutline`,props:{editor:{},open:{type:Boolean,default:!0},placement:{default:`right`},title:{default:`大纲`},collapseTitle:{default:`收起大纲`},emptyDescription:{default:`对文档内容应用“标题”样式,即可自动生成大纲。`},emptyTip:{default:``},showCollapse:{type:Boolean,default:!1}},emits:[`toggle`,`select`,`change`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)([]),o=(0,t.ref)(null),s=null;function c(){return(0,t.unref)(r.editor)}function l(e){a.value=e.items,o.value=e.activePos,i(`change`,e)}function u(){let e=c();l({items:e?.getOutlineItems()??[],activePos:e?.getActiveOutlinePos()??null})}function d(){s?.(),s=null;let e=c();e?s=e.onOutlineChange(l):u()}function f(e){i(`select`,e),c()?.focusOutlineItem(e)}return(0,t.watch)(()=>c(),d,{immediate:!0}),(0,t.onBeforeUnmount)(()=>{s?.()}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(Xl,{standalone:``,open:e.open,placement:e.placement,title:e.title,"collapse-title":e.collapseTitle,"empty-description":e.emptyDescription,"empty-tip":e.emptyTip,"show-collapse":e.showCollapse,items:a.value,"active-pos":o.value,onToggle:r[0]||=e=>i(`toggle`),onSelect:f},null,8,[`open`,`placement`,`title`,`collapse-title`,`empty-description`,`empty-tip`,`show-collapse`,`items`,`active-pos`]))}}),jD=kD;e.OfficeColorIcon=an,e.OfficeIcon=M,e.RICH_TEXT_EDITOR_EXPORT_CODES=s_,e.RICH_TEXT_EDITOR_FEATURE_CODES=o_,e.RICH_TEXT_EDITOR_INSERT_MENU_CODES=c_,e.RICH_TEXT_EDITOR_TOOLBAR_ACTION_CODES=l_,e.RichTextEditor=kD,e.RichTextOutline=AD,e.ScrollArea=sn,e.colorIconNames=nn,e.default=jD,e.isRichTextCodeEnabled=u_,e.isRichTextFeatureCodeEnabled=d_,e.monoIconNames=tn,e.resolveRichTextOutlinePlacement=f_});