var Ps=Object.defineProperty,Ms=Object.defineProperties;var Ts=Object.getOwnPropertyDescriptors;var Pi=Object.getOwnPropertySymbols;var Ss=Object.prototype.hasOwnProperty,Xs=Object.prototype.propertyIsEnumerable;var pn=(o,t,e)=>t in o?Ps(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,b=(o,t)=>{for(var e in t||(t={}))Ss.call(t,e)&&pn(o,e,t[e]);if(Pi)for(var e of Pi(t))Xs.call(t,e)&&pn(o,e,t[e]);return o},tt=(o,t)=>Ms(o,Ts(t));var h=(o,t,e)=>(pn(o,typeof t!="symbol"?t+"":t,e),e);import{J as Ns,E as Mi,B as Fs,a as fs,P as Is,b as ms,H as Ze,F as ps,c as Ws,d as Vs,e as Ti,f as Wn,T as ln,g as Ys,h as Us,i as Zs,W as Qs,I as Ds,j as Ks,k as Es,M as bs,C as xs,l as Si,_ as Cs,p as Xi}from"./vendor.d13e5cc9.js";const ws=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function e(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerpolicy&&(r.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?r.credentials="include":i.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(i){if(i.ep)return;i.ep=!0;const r=e(i);fetch(i.href,r)}};ws();const Hs=[],ys=Hs,Ni=[],Gs={margins:[100,120,100,120],watermark:{data:"",size:120},pageNumber:{format:"\u7B2C{pageNo}\u9875/\u5171{pageCount}\u9875"},placeholder:{data:"\u8BF7\u8F93\u5165\u6B63\u6587"},zone:{tipDisabled:!1},maskMargin:[60,0,30,0]};const Js="0.9.96";var me;(function(o){o.HALF="half",o.ONE_THIRD="one-third",o.QUARTER="quarter"})(me||(me={}));var ke;(function(o){o.ARABIC="arabic",o.CHINESE="chinese"})(ke||(ke={}));var et;(function(o){o.INLINE="inline",o.BLOCK="block",o.SURROUND="surround",o.FLOAT_TOP="float-top",o.FLOAT_BOTTOM="float-bottom"})(et||(et={}));var ze;(function(o){o.BEFORE="before",o.AFTER="after"})(ze||(ze={}));const _="\u200B",Fi=` `,Vn=" ",fi=" ",vs=["\xB7","\u3001",":","\uFF1A",",","\uFF0C",".","\u3002",";","\uFF1B","?","\uFF1F","!","\uFF01"],Ii={[me.HALF]:1/2,[me.ONE_THIRD]:1/3,[me.QUARTER]:1/4},Bs={ENGLISH:"A-Za-z",SPANISH:"A-Za-z\xC1\xC9\xCD\xD3\xDA\xE1\xE9\xED\xF3\xFA\xD1\xF1\xDC\xFC",FRENCH:"A-Za-z\xC0\xC2\xC7\xE0\xE2\xE7\xC9\xE9\xC8\xE8\xCA\xEA\xCB\xEB\xCE\xEE\xCF\xEF\xD4\xF4\xD9\xF9\xDB\xFB\u0178\xFF",GERMAN:"A-Za-z\xC4\xE4\xD6\xF6\xDC\xFC\xDF",RUSSIAN:"\u0410-\u042F\u0430-\u044F\u0401\u0451",PORTUGUESE:"A-Za-z\xC1\xC9\xCD\xD3\xDA\xE1\xE9\xED\xF3\xFA\xC3\xD5\xE3\xF5\xC7\xE7",ITALIAN:"A-Za-z\xC0\xE0\xC8\xE8\xC9\xE9\xCC\xEC\xCD\xED\xCE\xEE\xD3\xF3\xD2\xF2\xD9\xF9",DUTCH:"A-Za-z\xC0\xE0\xC1\xE1\xC2\xE2\xC4\xE4\xC8\xE8\xC9\xE9\xCA\xEA\xCB\xEB\xCC\xEC\xCD\xED\xCE\xEE\xCF\xEF\xD3\xF3\xD2\xF2\xD4\xF4\xD6\xF6\xD9\xF9\xDB\xFB\xDC\xFC",SWEDISH:"A-Za-z\xC5\xE5\xC4\xE4\xD6\xF6",GREEK:"\u0391\u03B1\u0392\u03B2\u0393\u03B3\u0394\u03B4\u0395\u03B5\u0396\u03B6\u0397\u03B7\u0398\u03B8\u0399\u03B9\u039A\u03BA\u039B\u03BB\u039C\u03BC\u039D\u03BD\u039E\u03BE\u039F\u03BF\u03A0\u03C0\u03A1\u03C1\u03A3\u03C3\u03C2\u03A4\u03C4\u03A5\u03C5\u03A6\u03C6\u03A7\u03C7\u03A8\u03C8\u03A9\u03C9"},As="\u65E5";var Rt;(function(o){o.LEFT="left",o.CENTER="center",o.RIGHT="right",o.ALIGNMENT="alignment",o.JUSTIFY="justify"})(Rt||(Rt={}));const Yn=/[0-9.]/,_s=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,ks=/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0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\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,zs=new RegExp(`${ks.source}|${_s.source}`,"g"),$s=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,Un=new RegExp(`^[${_} ]`);function mi(o,t){let e;return function(...n){e&&window.clearTimeout(e),e=window.setTimeout(()=>{o.apply(this,n)},t)}}function qs(o,t){let e=0,n;return function(...i){const r=Date.now();r-e>=t?(window.clearTimeout(n),o.apply(this,i),e=r):(window.clearTimeout(n),n=window.setTimeout(()=>{o.apply(this,i),e=r},t))}}function Zn(o,t){if(!o||typeof o!="object")return o;let e={};return Array.isArray(o)?e=o.map(n=>Zn(n,t)):Object.keys(o).forEach(n=>{if(!t.includes(n))return e[n]=Zn(o[n],t)}),e}function Ot(o){if(!o||typeof o!="object")return o;let t={};return Array.isArray(o)?t=o.map(e=>Ot(e)):Object.keys(o).forEach(e=>t[e]=Ot(o[e])),t}function Qn(o){return o&&o.nodeType===1&&o.tagName.toLowerCase()==="body"}function Rn(o,t,e){if(o&&!Qn(o))for(o=e?o:o.parentNode;o;){if(!t||t(o)||Qn(o))return t&&!t(o)&&Qn(o)?null:o;o=o.parentNode}return null}function Pt(){function o(){return((1+Math.random())*65536|0).toString(16).substring(1)}return o()+o()+"-"+o()+"-"+o()+"-"+o()+"-"+o()+o()+o()}function qt(o){const t=[];if(Intl.Segmenter){const n=new Intl.Segmenter().segment(o);for(const{segment:i}of n)t.push(i)}else{const e=new Map;for(const i of o.matchAll(zs))e.set(i.index,i[0]);let n=0;for(;n=o-1&&(e(s),n=0)};t.addEventListener("click",r)}function an(o){return Object.prototype.toString.call(o)==="[object Object]"}function Wi(o){return Array.isArray(o)}function Vi(o,t){if(an(o)&&an(t)){const e=t;for(const[n,i]of Object.entries(o))e[n]?e[n]=Vi(i,e[n]):e[n]=i}else Wi(o)&&Wi(t)&&t.push(...o);return t}function cn(o){setTimeout(()=>{o()},0)}function Yi(o){const t=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],e=["","\u5341","\u767E","\u5343","\u4E07","\u5341","\u767E","\u5343","\u4EBF","\u5341","\u767E","\u5343","\u4E07","\u5341","\u767E","\u5343","\u4EBF"];if(!o||isNaN(o))return"\u96F6";const n=o.toString().split("");let i="";for(let r=0;rString.fromCharCode(r));return window.btoa(n.join(""))}function no(o){let t=o.parentElement;for(;t;){const n=window.getComputedStyle(t).getPropertyValue("overflow-y");if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"))return t;t=t.parentElement}return document.documentElement}function io(o,t){return o.length!==t.length?!1:!o.some(e=>!t.includes(e))}function so(o,t){if(!an(o)||!an(t))return!1;const e=Object.keys(o),n=Object.keys(t);return e.length!==n.length?!1:!e.some(i=>t[i]!==o[i])}function oo(o,t){const e=o.x,n=o.x+o.width,i=o.y,r=o.y+o.height,s=t.x,l=t.x+t.width,R=t.y,a=t.y+t.height;return!(e>l||na||r `,l=new Image;return l.src=`data:image/svg+xml;base64,${eo(s)}`,l}render(t,e,n,i){const{scale:r}=this.options,s=e.width*r,l=e.height*r;if(this.imageCache.has(e.id)){const R=this.imageCache.get(e.id);t.drawImage(R,n,i,s,l)}else{const R=new Promise((a,c)=>{const u=new Image;u.setAttribute("crossOrigin","Anonymous"),u.src=e.value,u.onload=()=>{this.imageCache.set(e.id,u),a(e),e.imgDisplay===et.FLOAT_BOTTOM?this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}):t.drawImage(u,n,i,s,l)},u.onerror=d=>{const g=this.getFallbackImage(s,l);g.onload=()=>{t.drawImage(g,n,i,s,l),this.imageCache.set(e.id,g)},c(d)}});this.addImageObserver(R)}}}const hn="R".charCodeAt(0);function Qe(o){return bn[o]==null&&Oo(o),bn[o]}function Oo(o){const t=Po[o];if(t==null)return;const e=t.substring(3,5),n=1*e.charCodeAt(0)-hn,i=1*e.charCodeAt(1)-hn,r=t.substring(5),s=[[]];let l=1/0,R=-1/0,a=1/0,c=-1/0,u=0;for(;uf>RfR",797:" 3D`D``D",798:" 3RRR>Rf",799:" 3D`DD``",800:" 3D`DR`R",801:" 3F^FY^K",802:" 3KYK^YF",803:" 3RRRDR`",804:" 3KYKFY^",805:" 3F^FK^Y",806:" 3KYKRYR",807:" 3MWMWWM",808:" 3RRRKRY",809:" 3MWMMWW",810:" 8GRRGPGMHJJHMGPGR",811:" 8GRGRGTHWJZM\\P]R]",812:" 8R]R]T]W\\ZZ\\W]T]R",813:" 8R]]R]P\\MZJWHTGRG",814:" 9D`DOGQKSPTTTYS]Q`O",815:" 9PUUDSGQKPPPTQYS]U`",816:" 9OTODQGSKTPTTSYQ]O`",817:" 9D`DUGSKQPPTPYQ]S`U",818:" 5KYRJYNKVRZ",819:" 5JZJRNKVYZR",820:" 5KYKVKNYVYN",821:" 5JZLXJPZTXL",822:" 23JZJ]L]O\\Q[TXUVVSVOULTJSIQIPJOLNONSOVPXS[U\\X]Z]",823:" 23I]]Z]X\\U[SXPVOSNONLOJPIQISJTLUOVSVVUXT[Q\\O]L]J",824:" 23JZZGXGUHSIPLONNQNUOXPZQ[S[TZUXVUVQUNTLQIOHLGJG",825:" 23G[GJGLHOIQLTNUQVUVXUZT[S[QZPXOUNQNNOLPISHUGXGZ",826:" 21E[EPFRHTJUMVQVUUXSZP[NZLWLSMQNNPLSKVKYL\\M^",827:" 19EYETHVKWPWSVVTXQYNYLXKVKSLPNNQMTMYN\\P_",828:" 26OUQOOQOSQUSUUSUQSOQO RQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",829:" 11RWRMSMUNVOWQWSVUUVSWRW",830:" 9D`DRJR RORUR RZR`R",831:" 5D`DUDO`O`U",832:" 6JZRDJR RRDZR",833:" 9D`DR`R RJYZY RP`T`",834:" 9D`DR`R RDRRb R`RRb",840:" 18KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",841:" 6LXLLLXXXXLLL",842:" 5KYRJKVYVRJ",843:" 6LXRHLRR\\XRRH",844:" 12JZRIPOJOOSMYRUWYUSZOTORI",845:" 6KYRKRY RKRYR",846:" 6MWMMWW RWMMW",847:" 9MWRLRX RMOWU RWOMU",850:" 35NVQNOONQNSOUQVSVUUVSVQUOSNQN ROQOS RPPPT RQOQU RRORU RSOSU RTPTT RUQUS",851:" 27NVNNNVVVVNNN ROOOU RPOPU RQOQU RRORU RSOSU RTOTU RUOUU",852:" 17MWRLMUWURL RROOT RROUT RRRQT RRRST",853:" 17LULRUWUMLR RORTU RORTO RRRTS RRRTQ",854:" 17MWRXWOMORX RRUUP RRUOP RRRSP RRRQP",855:" 17OXXROMOWXR RURPO RURPU RRRPQ RRRPS",856:" 22LXRLNWXPLPVWRL RRRRL RRRLP RRRNW RRRVW RRRXP",857:" 11RYRKRY RRKYNRQ RSMVNSO",860:" 13MWRLRX ROOUO RMUOWQXSXUWWU",861:" 11LXRLRX RLQMOWOXQ RPWTW",862:" 14KYMNWX RWNMX ROLLOKQ RULXOYQ",863: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ZM\\P]T]W\\ZZ\\W]T]P\\MZJWHTGPG",905:" 34AcPALBJCGEEGCJBLAPATBXCZE]G_JaLbPcTcXbZa]__]aZbXcTcPbLaJ_G]EZCXBTAPA",906:" 34fRAPCMDJDGCEA>H@JAMAZB]D_G`M`PaRc RRATCWDZD]C_AfHdJcMcZb]`_]`W`TaRc",909:" 33AcRAPCMDJDGCEABGAKAPBTDXG\\L`Rc RRATCWDZD]C_AbGcKcPbT`X]\\X`Rc RBHbH",997:" 3MWMXWX",998:" 3JZJZZZ",999:" 3JZJ]Z]",1001:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1002:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1003:" 24KYVLWKWOVLTKQKOLNMMPMSNVOWQXTXVWWU RQKOMNPNSOVQX",1004:" 26JZNKNX ROKOX RLKSKVLWMXPXSWVVWSXLX RSKULVMWPWSVVUWSX",1005:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1006:" 20JXNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXQX",1007:" 36K[VLWKWOVLTKQKOLNMMPMSNVOWQXTXVW RQKOMNPNSOVQX RTXUWVU RVSVX RWSWX RTSYS",1008:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1009:" 12NWRKRX RSKSX RPKUK RPXUX",1010:" 19LXSKSURWQX RTKTUSWQXPXNWMUNTOUNV RQKVK",1011:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1012:" 14KXOKOX RPKPX RMKRK RMXWXWTVX",1013:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1014:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1015:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1016:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1017:" 47KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RPWPUQTSTTUUZV[W[XZ RTUUXVZW[",1018:" 37JZNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX RSRTSUWVXWXXW RSRUSVWWX",1019:" 32KZVMWKWOVMULSKQKOLNMNOOPQQTRVSWT RNNOOQPTQVRWSWVVWTXRXPWOVNTNXOV",1020:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1021:" 20J[NKNUOWQXTXVWWUWK ROKOUPWQX RLKQK RUKYK",1022:" 15KYMKRX RNKRU RWKRX RKKPK RTKYK",1023:" 24I[LKOX RMKOT RRKOX RRKUX RSKUT RXKUX RJKOK RVKZK",1024:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1025:" 20LYNKRRRX ROKSR RWKSRSX RLKQK RTKYK RPXUX",1026:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1027:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1028:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1029:" 14KXOKOX RPKPX RMKWKWOVK RMXRX",1030:" 15KYRKLX RRMWX RRKXX RMWVW RLXXX",1031:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1032:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1033:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1034:" 44KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RQOQT RTOTT RQQTQ RQRTR",1035:" 12NWRKRX RSKSX RPKUK RPXUX",1036:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1037:" 15KYRKMX RRNVX RRKWX RKXPX RTXYX",1038:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1039:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1040:" 36JZMJLM RXJWM RPPOS RUPTS RMVLY RXVWY RMKWK RMLWL RPQTQ RPRTR RMWWW RMXWX",1041:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1042:" 21J[NKNX ROKOX RVKVX RWKWX RLKYK RLXQX RTXYX",1043:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1044:" 20K[MKRQ RNKSQMX RMKWKXOVK RNWWW RMXWXXTVX",1045:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1046:" 33KZMONLOKPKQLRORX RXOWLVKUKTLSOSX RMONMOLPLQMRO RXOWMVLULTMSO RPXUX",1047:" 40KZRKRX RSKSX RQNNOMQMRNTQUTUWTXRXQWOTNQN RQNOONQNROTQU RTUVTWRWQVOTN RPKUK RPXUX",1048:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1049:" 33J[RKRX RSKSX RLPMONOOSQU RTUVSWOXOYP RMONROTQUTUVTWRXO RPKUK RPXUX",1050:" 35KZMVNXQXMRMONMOLQKTKVLWMXOXRTXWXXV ROUNRNOOMQK RTKVMWOWRVU RNWPW RUWWW",1051:" 18KYTKKX RSMTX RTKUX RNTTT RIXNX RRXWX",1052:" 34JYPKLX RQKMX RNKUKWLWNVPSQ RUKVLVNUPSQ ROQRQTRUSUUTWQXJX RRQTSTUSWQX",1053:" 25KXVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUU RRKPMOONRNVPX",1054:" 26JYPKLX RQKMX RNKTKVLWNWQVTUVTWQXJX RTKULVNVQUTTVSWQX",1055:" 22JYPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXTXUUSX",1056:" 20JXPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXOX",1057:" 33KYVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUVVS RRKPMOONRNVPX RRXTVUS RSSXS",1058:" 27J[PKLX RQKMX RXKTX RYKUX RNKSK RVK[K ROQVQ RJXOX RRXWX",1059:" 12NWTKPX RUKQX RRKWK RNXSX",1060:" 19LXUKRUQWPX RVKSURWPXOXMWLUMTNUMV RSKXK",1061:" 27JZPKLX RQKMX RYKOR RRPTX RSPUX RNKSK RVK[K RJXOX RRXWX",1062:" 14KXQKMX RRKNX ROKTK RKXUXVUTX",1063:" 30I\\OKKX ROMPX RPKQV RYKPX RYKUX RZKVX RMKPK RYK\\K RIXMX RSXXX",1064:" 21JZPKLX RPKTX RQKTU RXKTX RNKQK RVKZK RJXNX",1065:" 32KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK",1066:" 24JYPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RJXOX",1067:" 46KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK ROWOVPUQURVRZS[T[UZ RRVSZT[",1068:" 35JZPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RSRTWUXVXWW RSRTSUWVX RJXOX",1069:" 28KZWLXLYKXNWLUKRKPLOMOOPPUSVT RONPOURVSVVUWSXPXNWMULXMWNW",1070:" 16KZTKPX RUKQX RPKNNOKZKYNYK RNXSX",1071:" 20J[PKMUMWOXSXUWVUYK RQKNUNWOX RNKSK RWK[K",1072:" 15KYOKPX RPKQV RYKPX RMKRK RVK[K",1073:" 24I[NKMX ROKNV RTKMX RTKSX RUKTV RZKSX RLKQK RXK\\K",1074:" 21KZPKTX RQKUX RYKLX RNKSK RVK[K RJXOX RRXWX",1075:" 20LYPKRQPX RQKSQ RYKSQQX RNKSK RVK[K RNXSX",1076:" 16LYXKLX RYKMX RQKONPKYK RLXUXVUTX",1101:" 32LZQOPPPQOQOPQOTOVQVWWXXX RTOUQUWWX RURRSPTOUOWPXSXTWUU RRSPUPWQX",1102:" 29JYNKNX ROKOX RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLKOK",1103:" 24LXVQUQURVRVQUPSOQOOPNRNUOWQXSXUWVV RQOPPOROUPWQX",1104:" 32L[VKVX RWKWX RVRUPSOQOOPNRNUOWQXSXUWVU RQOPPOROUPWQX RTKWK RVXYX",1105:" 26LXOSVSVRUPSOQOOPNRNUOWQXSXUWVV RUSUQSO RQOPPOROUPWQX",1106:" 20LWTKULUMVMVLTKRKPMPX RRKQMQX RNOSO RNXSX",1107:" 42LYQOOQOSQUSUUSUQSOQO RQOPQPSQU RSUTSTQSO RTPUOVO RPTOUOXPYTYVZ ROWPXTXVYV[T\\P\\N[NYPX",1108:" 28J[NKNX ROKOX RORPPROTOVPWRWX RTOUPVRVX RLKOK RLXQX RTXYX",1109:" 18NWRKRLSLSKRK RRORX RSOSX RPOSO RPXUX",1110:" 23NWSKSLTLTKSK RSOSZR\\ RTOTZR\\P\\O[OZPZP[O[ RQOTO",1111:" 27JZNKNX ROKOX RWOOU RRSVX RSSWX RLKOK RTOYO RLXQX RTXYX",1112:" 12NWRKRX RSKSX RPKSK RPXUX",1113:" 44F_JOJX RKOKX RKRLPNOPORPSRSX RPOQPRRRX RSRTPVOXOZP[R[X RXOYPZRZX RHOKO RHXMX RPXUX RXX]X",1114:" 28J[NONX ROOOX RORPPROTOVPWRWX RTOUPVRVX RLOOO RLXQX RTXYX",1115:" 28LYQOOPNRNUOWQXTXVWWUWRVPTOQO RQOPPOROUPWQX RTXUWVUVRUPTO",1116:" 32JYNON\\ ROOO\\ RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLOOO RL\\Q\\",1117:" 29KYUOU\\ RVOV\\ RURTPROPONPMRMUNWPXRXTWUU RPOOPNRNUOWPX RS\\X\\",1118:" 22KXOOOX RPOPX RPRQPSOUOVPVQUQUPVP RMOPO RMXRX",1119:" 26LYTOUPUQVQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWOVPVPWQX",1120:" 14LWPKPVRXTXUWUV RQKQVRX RNOTO",1121:" 28J[NONUOWQXSXUWVU ROOOUPWQX RVOVX RWOWX RLOOO RTOWO RVXYX",1122:" 15KYNORX ROORV RVORX RLOQO RTOXO",1123:" 24I[LOOX RMOOU RROOX RROUX RSOUU RXOUX RJOOO RVOZO",1124:" 21KYNOUX ROOVX RVONX RLOQO RTOXO RLXPX RSXXX",1125:" 23KYNORX ROORV RVORXP[N\\M\\L[LZMZM[L[ RLOQO RTOXO",1126:" 16LXUONX RVOOX ROONQNOVO RNXVXVVUX",1127:" 32K[QOOPNQMSMUNWPXQXSWUUWRXO RQOOQNSNUOWPX RQOSOUPWWXX RSOTPVWXXYX",1128:" 40KXRKPMOOMUK\\ RQLPNNTL\\ RRKTKVLVNUPRQ RTKULUNTPRQ RRQTRUTUVTWRXQXOWNT RRQSRTTTVRX",1129:" 19KYLQNOPORPSSSXR\\ RLQNPPPRQSS RWOVRSXQ\\",1130:" 39KYSOQOOPNQMSMUNWPXRXTWUVVTVRUPRNQLQKRJTJUKVM RQOOQNSNVPX RRXTVUTUQSO RQLRKTKVM",1131:" 27LXVPTOQOOPOQPRRS RQOPPPQRS RRSOTNUNWPXSXUW RRSPTOUOWPX",1132:" 28LWRKQLQMSNVNVMSNPOOPNRNTOVPWRXSYS[R\\P\\O[ RSNQOPPOROTPVRX",1133:" 26IYJRKPLONOOPOQMX RMONPNQLX ROQPPROTOVPVRS\\ RTOUPURR\\",1134:" 35IYJSKQLPNPOQOVPX RMPNQNUOWPXQXSWTVUTVQVNULTKRKQLQNRPURWS RQXSVTTUQUNTK",1135:" 13NWROPVPWQXSXUWVU RSOQVQWRX",1136:" 26KYOOLX RPOMX RUOVPWPVOTORQOR RORPSRWTXVWWU RORQSSWTX",1137:" 15LXLKNKPLWX RNKOLVX RRPMX RRPNX",1138:" 26KZOOK\\ RPOL\\ RNUNWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1139:" 19JYNOMX ROONUMX RVRVOWOVRTUQWNXMX RLOOO",1140:" 36MXRKQLQMSNVN RTNQOPPPRRSUS RTNROQPQRRS RSSPTOUOWQXSYTZT[S\\Q\\ RSSQTPUPWQX",1141:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1142:" 20IZPPMX RPPNX RTPSX RTPTX RKQMOXO RKQMPXP",1143:" 29JXSOQOOPNQMSJ\\ RQOOQNSK\\ RSOUPVRVTUVTWRXPXNWMU RSOUQUTTVRX",1144:" 28K[YOQOOPNQMSMUNWPXRXTWUVVTVRUPYP RQOOQNSNVPX RRXTVUTUQSO",1145:" 14KZSPQX RSPRX RMQOOXO RMQOPXP",1146:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1147:" 35KZOPNQMSMUNWPXRXUWWUXRXPWOUOTPSRRUO\\ RMUNVPWRWUVWTXR RXQWPUPSR RRUQXP\\",1148:" 17KXMONOPPS[T\\ RNOOPR[T\\U\\ RVOTRNYL\\",1149:" 28I[TKQ\\ RUKP\\ RJRKPLONOOPOVPWSWUVWT RMONPNTOWPXSXUWWTXRYO",1150:" 36JZNPPPPONPMQLSLUMWNXPXQWRUSR RLUNWPWRU RRRRWSXUXWVXTXRWPVOVPWP RRUSWUWWV",1151:" 32KZVOTVTWUXWXXWYU RWOUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1152:" 32JXOKMR RPKNRNVPX RNROPQOSOUPVRVTUVTWRXPXNWMUMR RSOUQUTTVRX RMKPK",1153:" 22KXUPUQVQUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1154:" 35KZWKTVTWUXWXXWYU RXKUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RUKXK",1155:" 23KWNURTTSURUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1156:" 23MXWKXLXKVKTLSNPYO[N\\ RVKULTNQYP[N\\L\\L[M\\ RPOVO",1157:" 34KYVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1158:" 29KZPKLX RQKMX ROQPPROTOVPVRUUUWVX RTOUPURTUTWUXWXXWYU RNKQK",1159:" 26MWSKSLTLTKSK RNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1160:" 26MWTKTLULUKTK RORPPQOSOTPTRRYQ[O\\M\\M[N\\ RROSPSRQYP[O\\",1161:" 32KXPKLX RQKMX RVPUQVQVPUOTORQPROR RORPSQWRXTXUWVU RORQSRWSX RNKQK",1162:" 16NVSKPVPWQXSXTWUU RTKQVQWRX RQKTK",1163:" 46F^GRHPIOKOLPLQJX RJOKPKQIX RLQMPOOQOSPSQQX RQORPRQPX RSQTPVOXOZPZRYUYWZX RXOYPYRXUXWYX[X\\W]U",1164:" 33J[KRLPMOOOPPPQNX RNOOPOQMX RPQQPSOUOWPWRVUVWWX RUOVPVRUUUWVXXXYWZU",1165:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1166:" 35JYKRLPMOOOPPPQM\\ RNOOPOQL\\ RPQROTOVPWRWTVVUWSXQXOVOT RTOVQVTUVSX RJ\\O\\",1167:" 28KYVOR\\ RWOS\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RP\\U\\",1168:" 22LXMRNPOOQORPRQPX RPOQPQQOX RRQSPUOVOWPWQVQWP",1169:" 24LYVPVQWQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWNVOVOW",1170:" 16NWSKPVPWQXSXTWUU RTKQVQWRX RPOUO",1171:" 33IZJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1172:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1173:" 37H\\IRJPKOMONPNRMUMWNX RLOMPMRLULWNXOXQWRV RTORVRWTX RUOSVSWTXUXWWYUZRZOYOZP",1174:" 38JZMRNPPOROSPSR RQORPRRQUPWNXMXLWLVMVLW RXPWQXQXPWOVOTPSRRURWSX RQUQWRXTXVWWU",1175:" 35IYJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\",1176:" 27KYWOWPVQNVMWMX RNQOOROUQ ROPRPUQVQ RNVOVRWUW ROVRXUXVV",1177:" 39H[RKSLSMTMTLRKOKMLLNLX ROKNLMNMX RXKYLYMZMZLXKVKTMTX RVKUMUX RJOWO RJXOX RRXWX",1178:" 29J[UKVLWLWKQKOLNNNX RQKPLONOX RVOVX RWOWX RLOWO RLXQX RTXYX",1179:" 27J[WKQKOLNNNX RQKPLONOX RUKVLVX RWKWX RLOVO RLXQX RTXYX",1180:" 48F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX RYKZL[L[KUKSLRNRX RUKTLSNSX RZOZX R[O[X RHO[O RHXMX RPXUX RXX]X",1181:" 46F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX R[KUKSLRNRX RUKTLSNSX RYKZLZX R[K[X RHOZO RHXMX RPXUX RXX]X",1182:" 12NWRORX RSOSX RPOSO RPXUX",1184:" 21LXVPTOROPPOQNSNUOWQXSXUW RROPQOSOVQX ROSSS",1185:" 35LYSKQLPMOONRNUOWPXRXTWUVVTWQWNVLUKSK RSKQMPOOSOVPX RRXTVUTVPVMUK ROQVQ",1186:" 34KZTKQ\\ RUKP\\ RQONPMRMUNWQXTXWWXUXRWPTOQO RQOOPNRNUOWQX RTXVWWUWRVPTO",1187:" 22LXUPVRVQUPSOQO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WQX RTXUWVUVSUQTP",1207:" 22LYNKNO RVMRTPX RWKTQQX RNMPKRKUM RNMPLRLUMVM",1208:" 51LYQKOLNNOPQQTQVPWNVLTKQK RQKPLONPPQQ RTQUPVNULTK RQQORNTNUOWQXTXVWWUWTVRTQ RQQPROTOUPWQX RTXUWVUVTURTQ",1209:" 36LYOVOUNUNVOWQXSXUWVVWSWNVLTKQKOLNNNPORQSTSWQ RSXUVVSVNULTK RQKPLONOPPRQS",1210:" 6NVRVQWRXSWRV",1211:" 8NVSWRXQWRVSWSYQ[",1212:" 12NVROQPRQSPRO RRVQWRXSWRV",1213:" 14NVROQPRQSPRO RSWRXQWRVSWSYQ[",1214:" 15NVRKQLRSSLRK RRLRO RRVQWRXSWRV",1215:" 29LYNNONOONONNOLQKTKVLWNWOVQSRRSRTST RTKVMVPUQSR RRWRXSXSWRW",1216:" 6OVRKRP RSKRP",1217:" 12LXOKOP RPKOP RUKUP RVKUP",1218:" 10MWQKPLPNQOSOTNTLSKQK",1219:" 9MWRJRP ROKUO RUKOO",1220:" 3KZXHM\\",1221:" 16MWUHSJQMPPPTQWSZU\\ RSJRLQPQTRXSZ",1222:" 16MWOHQJSMTPTTSWQZO\\ RQJRLSPSTRXQZ",1223:" 12MWPHP\\ RQHQ\\ RPHUH RP\\U\\",1224:" 12MWSHS\\ RTHT\\ ROHTH RO\\T\\",1225:" 38LWSHQIPJPLRNSP RQIPL RSNRQ RPJQLSNSPRQPRRSSTSVQXPZ RRSSV RPXQ[ RSTRVPXPZQ[S\\",1226:" 38MXQHSITJTLRNQP RSITL RQNRQ RTJSLQNQPRQTRRSQTQVSXTZ RRSQV RTXS[ RQTRVTXTZS[Q\\",1227:" 4MWTHPRT\\",1228:" 4MWPHTRP\\",1229:" 3OURHR\\",1230:" 6MWPHP\\ RTHT\\",1231:" 3I[LRXR",1232:" 6I[RLRX RLRXR",1233:" 9JZRMRX RMRWR RMXWX",1234:" 9JZRMRX RMMWM RMRWR",1235:" 6JZMMWW RWMMW",1236:" 6NVRQQRRSSRRQ",1237:" 15I[RLQMRNSMRL RLRXR RRVQWRXSWRV",1238:" 6I[LPXP RLTXT",1239:" 9I[WLMX RLPXP RLTXT",1240:" 9I[LNXN RLRXR RLVXV",1241:" 4JZWLMRWX",1242:" 4JZMLWRMX",1243:" 10JZWKMOWS RMTWT RMXWX",1244:" 10JZMKWOMS RMTWT RMXWX",1245:" 21H[YUWUUTTSRPQOONNNLOKQKRLTNUOUQTRSTPUOWNYN",1246:" 16JZLTLRMPOPUSWSXR RLRMQOQUTWTXRXP",1247:" 8JZMSRPWS RMSRQWS",1248:" 7NVSKPO RSKTLPO",1249:" 7NVQKTO RQKPLTO",1250:" 14LXNKOMQNSNUMVK RNKONQOSOUNVK",1251:" 8NVSLRMQLRKSLSNQP",1252:" 8NVSKQMQORPSORNQO",1253:" 8NVQLRMSLRKQLQNSP",1254:" 8NVQKSMSORPQORNSO",1256:" 11JZWMQMONNOMQMSNUOVQWWW",1257:" 11JZMMMSNUOVQWSWUVVUWSWM",1258:" 11JZMMSMUNVOWQWSVUUVSWMW",1259:" 11JZMWMQNOONQMSMUNVOWQWW",1260:" 14JZWMQMONNOMQMSNUOVQWWW RMRUR",1261:" 13I[TOUPXRUTTU RUPWRUT RLRWR",1262:" 13MWRMRX ROPPORLTOUP RPORMTO",1263:" 13I[POOPLROTPU ROPMROT RMRXR",1264:" 13MWRLRW ROTPURXTUUT RPURWTU",1265:" 37KYVSUPSOQOOPNQMSMUNWPXRXTWUVVTWQWNVLTKQKPLQLRK RQOOQNSNVPX RRXTVUTVQVNULTK",1266:" 15JZLKRX RMKRV RXKRX RLKXK RNLWL",1267:" 10G[IOLORW RKORX R[FRX",1268:" 26I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[",1269:" 40I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[ RQNOONQNSOUQVSVUUVSVQUOSNQN",1270:" 26H\\ZRYTWUVUTTSSQPPONNMNKOJQJRKTMUNUPTQSSPTOVNWNYOZQZR",1271:" 26JZXKLX ROKPLPNOOMOLNLLMKOKSLVLXK RUTTUTWUXWXXWXUWTUT",1272:" 41J[YPXPXQYQYPXOWOVPUTTVSWQXOXMWLVLTMSORRPSNSLRKPKOLONPQUWWXXXYW ROXMVMTOR RONPPVWWX",1273:" 29J[UPSOQOPQPRQTSTUS RUOUSVTXTYRYQXNVLSKRKOLMNLQLRMUOWRXSXVW",1274:" 34KZQHQ\\ RTHT\\ RWLVLVMWMWLUKPKNLNNOPVSWT RNNOOVRWTWVVWTXQXOWNVNUOUOVNV",1275:" 12KYRKN\\ RVKR\\ RNQWQ RMVVV",1276:" 40LXTLSLSMTMTLSKQKPLPNQPTRUS RPNQOTQUSUUSW RQPOROTPVSXTY ROTPUSWTYT[S\\Q\\P[PZQZQ[P[",1277:" 29LXRKQLRMSLRK RRMRQ RRQQSRVSSRQ RRVR\\ RPOONNOOPPOTOUNVOUPTO",1278:" 42LXRMSLRKQLRMRQQRSURV RRQSRQURVRZQ[R\\S[RZ RPOONNOOPPOTOUNVOUPTO RPXOWNXOYPXTXUWVXUYTX",1279:" 12LYVKVX RNKVK RQQVQ RNXVX",1281:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRQQRRSSRRQ",1282:" 33LYQKPLPMQN RTKULUMTN RRNPOOQORPTRUSUUTVRVQUOSNRN RRURY RSUSY ROWVW",1283:" 23LYRKPLONOOPQRRSRUQVOVNULSKRK RRRRX RSRSX ROUVU",1284:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRKRY RKRYR",1285:" 25JYRRPQOQMRLTLUMWOXPXRWSUSTRR RWMRR RRMWMWR RRMVNWR",1286:" 25JZLLMKOKQLRNRPQRPSNT ROKPLQNQQPS RVKUX RWKTX RNTXT",1287:" 27JYNKNU ROKNR RNROPQOSOUPVQVTTVTXUYVYWX RSOUQUTTV RLKOK",1288:" 27LYONRKRQ RVNSKSQ RRQPROTOUPWRXSXUWVUVTURSQ RRTRUSUSTRT",1289:" 27JZRKRY RMKMPNRPSTSVRWPWK RLMMKNM RQMRKSM RVMWKXM ROVUV",1290:" 27JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXVXVUUX",1291:" 20LYWKTKQLONNQNSOVQXTYWY RWKTLRNQQQSRVTXWY",1292:" 23JZRRPQOQMRLTLUMWOXPXRWSUSTRR RSLQQ RWMRR RXQSS",1293:" 12KYPMTW RTMPW RMPWT RWPMT",1294:" 34J[OUMULVLXMYOYPXPVNTMRMONMOLQKTKVLWMXOXRWTUVUXVYXYYXYVXUVU RNMPLULWM",1295:" 34J[OOMOLNLLMKOKPLPNNPMRMUNWOXQYTYVXWWXUXRWPUNULVKXKYLYNXOVO RNWPXUXWW",1401:" 21F^KHK\\ RLHL\\ RXHX\\ RYHY\\ RHH\\H RH\\O\\ RU\\\\\\",1402:" 20H]KHRQJ\\ RJHQQ RJHYHZMXH RK[X[ RJ\\Y\\ZWX\\",1403:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",1404:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",1405:" 12KYOBOb RPBPb ROBVB RObVb",1406:" 12KYTBTb RUBUb RNBUB RNbUb",1407:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",1408:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",1409:" 24KYU@RCPFOIOLPOSVTYT\\S_Ra RRCQEPHPKQNTUUXU[T^RaOd",1410:" 24KYO@RCTFUIULTOQVPYP\\Q_Ra RRCSETHTKSNPUOXO[P^RaUd",1411:" 13AXCRGRR` RGSRa RFSRb RX:Rb",1412:" 32F^[CZD[E\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MXNZP[ RWMW[ RXMX[ RIMMM RTMXM RW[[[",2122:" 15I[LMR[ RMMRY RXMR[ RJMPM RTMZM",2123:" 24F^JMN[ RKMNX RRMN[ RRMV[ RSMVX RZMV[ RGMNM RWM]M",2124:" 21H\\LMW[ RMMX[ RXML[ RJMPM RTMZM RJ[P[ RT[Z[",2125:" 22H[LMR[ RMMRY RXMR[P_NaLbKbJaK`La RJMPM RTMZM",2126:" 16I[WML[ RXMM[ RMMLQLMXM RL[X[XWW[",2127:" 40G^QMNNLPKRJUJXKZN[P[RZUWWTYPZM RQMONMPLRKUKXLZN[ RQMSMUNVPXXYZZ[ RSMTNUPWXXZZ[[[",2128:" 57G\\TFQGOIMMLPKTJZIb RTFRGPINMMPLTKZJb RTFVFXGYHYKXMWNTOPO RVFXHXKWMVNTO RPOTPVRWTWWVYUZR[P[NZMYLV RPOSPURVTVWUYTZR[",2129:" 28H\\IPKNMMOMQNROSRSVRZOb RJOLNPNRO RZMYPXRSYP^Nb RYMXPWRSY",2130:" 44I\\VNTMRMONMQLTLWMYNZP[R[UZWWXTXQWOSJRHRFSEUEWFYH RRMPNNQMTMXNZ RR[TZVWWTWPVNTKSISGTFVFYH",2131:" 32I[XPVNTMPMNNNPPRSS RPMONOPQRSS RSSNTLVLXMZP[S[UZWX RSSOTMVMXNZP[",2132:" 31I[TFRGQHQIRJUKZKZJWKSMPOMRLULWMYP[S]T_TaSbQbPa RULQONRMUMWNYP[",2133:" 32G]HQIOKMNMONOPNTL[ RMMNNNPMTK[ RNTPPRNTMVMXNYOYRXWUb RVMXOXRWWTb",2134:" 44F]GQHOJMMMNNNPMUMXNZO[ RLMMNMPLULXMZO[Q[SZUXWUXRYMYIXGVFTFRHRJSMUPWRZT RSZUWVUWRXMXIWGVF",2135:" 15LXRMPTOXOZP[S[UYVW RSMQTPXPZQ[",2136:" 29H\\NMJ[ ROMK[ RXMYNZNYMWMUNQROSMS ROSQTSZT[ ROSPTRZS[U[WZYW",2137:" 23H\\KFMFOGP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" 63H\\PFMGLILLMNPOTOWNXLXIWGTFPF RPFNGMIMLNNPO RTOVNWLWIVGTF RPOMPLQKSKWLYMZP[T[WZXYYWYSXQWPTO RPONPMQLSLWMYNZP[ RT[VZWYXWXSWQVPTO",2209:" 48H\\XMWPURRSQSNRLPKMKLLINGQFSFVGXIYLYRXVWXUZR[O[MZLXLWMVNWMX RQSORMPLMLLMIOGQF RSFUGWIXLXRWVVXTZR[",2210:" 6MWRYQZR[SZRY",2211:" 8MWR[QZRYSZS\\R^Q_",2212:" 12MWRMQNROSNRM RRYQZR[SZRY",2213:" 14MWRMQNROSNRM RR[QZRYSZS\\R^Q_",2214:" 15MWRFQHRTSHRF RRHRN RRYQZR[SZRY",2215:" 32I[MJNKMLLKLJMHNGPFSFVGWHXJXLWNVORQRT RSFUGVHWJWLVNTP RRYQZR[SZRY",2216:" 6NVRFQM RSFQM",2217:" 12JZNFMM ROFMM RVFUM RWFUM",2218:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",2219:" 9JZRFRR RMIWO RWIMO",2220:" 3G][BIb",2221:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",2222:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",2223:" 12KYOBOb RPBPb ROBVB RObVb",2224:" 12KYTBTb RUBUb RNBUB RNbUb",2225:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",2226:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",2227:" 4KYUBNRUb",2228:" 4KYOBVROb",2229:" 3NVRBRb",2230:" 6KYOBOb RUBUb",2231:" 3E_IR[R",2232:" 6E_RIR[ RIR[R",2233:" 9F^RJR[ RJRZR RJ[Z[",2234:" 9F^RJR[ RJJZJ RJRZR",2235:" 6G]KKYY RYKKY",2236:" 6MWRQQRRSSRRQ",2237:" 15E_RIQJRKSJRI RIR[R RRYQZR[SZRY",2238:" 6E_IO[O RIU[U",2239:" 9E_YIK[ RIO[O RIU[U",2240:" 9E_IM[M RIR[R RIW[W",2241:" 4F^ZIJRZ[",2242:" 4F^JIZRJ[",2243:" 10F^ZFJMZT RJVZV RJ[Z[",2244:" 10F^JFZMJT RJVZV RJ[Z[",2245:" 21F_[WYWWVUTRPQOONMNKOJQJSKUMVOVQURTUPWNYM[M",2246:" 24F^IUISJPLONOPPTSVTXTZS[Q RISJQLPNPPQTTVUXUZT[Q[O",2247:" 8G]JTROZT RJTRPZT",2248:" 7LXTFOL RTFUGOL",2249:" 7LXPFUL RPFOGUL",2250:" 18H\\KFLHNJQKSKVJXHYF RKFLINKQLSLVKXIYF",2251:" 8MWRHQGRFSGSIRKQL",2252:" 8MWSFRGQIQKRLSKRJ",2253:" 8MWRHSGRFQGQIRKSL",2254:" 8MWQFRGSISKRLQKRJ",2255:" 10E[HMLMRY RKMR[ R[BR[",2256:" 13F^ZJSJOKMLKNJQJSKVMXOYSZZZ",2257:" 13F^JJJQKULWNYQZSZVYXWYUZQZJ",2258:" 13F^JJQJUKWLYNZQZSYVWXUYQZJZ",2259:" 13F^JZJSKOLMNKQJSJVKXMYOZSZZ",2260:" 16F^ZJSJOKMLKNJQJSKVMXOYSZZZ RJRVR",2261:" 11E_XP[RXT RUMZRUW RIRZR",2262:" 11JZPLRITL RMORJWO RRJR[",2263:" 11E_LPIRLT ROMJROW RJR[R",2264:" 11JZPXR[TX RMURZWU RRIRZ",2265:" 44I\\XRWOVNTMRMONMQLTLWMYNZP[R[UZWXXUYPYKXHWGUFRFPGOHOIPIPH RRMPNNQMTMXNZ RR[TZVXWUXPXKWHUF",2266:" 15H\\JFR[ RKFRY RZFR[ RJFZF RKGYG",2267:" 10AbDMIMRY RHNR[ Rb:R[",2268:" 32F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDU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SP RIJKHMHOIPJQLRPR[ R[M\\L\\J[HYGWGUHTISKRP R\\JZHXHVIUJTLSPS[",2302:" 51F^IGJKKMMOPPTPWOYMZK[G RIGJJKLMNPOTOWNYLZJ[G RPONPMQLSLVMXOZQ[S[UZWXXVXSWQVPTO RPPNQMSMVNY RVYWVWSVQTP",2303:" 30F^MJMV RNKNU RVKVU RWJWV RIGKIMJPKTKWJYI[G RIYKWMVPUTUWVYW[Y",2304:" 48F^[ILIJJILINJPLQNQPPQNQLPJ[J RIMJOKPMQ RQMPKOJMI RIXXXZW[U[SZQXPVPTQSSSUTWIW R[TZRYQWP RSTTVUWWX",2305:" 48F]OUMTLTJUIWIXJZL[M[OZPXPWOUJPINIKJILHOGSGWHYJZLZOYRVUUWUYV[X[YZZX RMSKPJNJKKILH RSGVHXJYLYOXRVU",2306:" 48G_HKKHMKMV RJILLLV RMKPHRKRU ROIQLQU RRKUHWKW[ RTIVLV[ RWKZH[J\\M\\P[SZUXWUYP[ RYIZJ[M[PZSYUWWTYP[",2307:" 41F^ISMSLRKOKMLJNHQGSGVHXJYMYOXRWS[S RITOTMRLOLMMJOHQG RSGUHWJXMXOWRUT[T RKXYX RKYYY",2308:" 30F_GLJIMLMX RIJLMLX RMLPISLSX ROJRMRX RSLVIYLYW[Y RUJXMXXZZ]W",2309:" 33G]ZIJY RZIWJQJ RXKUKQJ RZIYLYR RXKXNYR RQRJR RPSMSJR RQRQY RPSPVQY",2310:" 33F^HOJKOU RJMOWRPWPZO[M[KZIXHWHUITKTMUPVRWUWXUZ RWHVIUKUMWQXTXWWYUZ",2311:" 36F^IOLLPN RKMOORLUN RQMTOWLYN RVMXO[L RIULRPT RKSOURRUT RQSTUWRYT RVSXU[R",2312:" 48F^JHNJPLQOQRPUNWJY RJHMIOJQLRO RRRQUOWMXJY RZHWIUJSLRO RRRSUUWWXZY RZHVJTLSOSRTUVWZY RIP[P RIQ[Q",2317:" 12NVQQQSSSSQQQ RQQSS RSQQS",2318:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2319:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2320:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2321:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2322:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2323:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2324:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2325:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2326:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2327:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2328:" 49JZMLWX RMLONQOTOVNWMWKUKUMTO RONTO RQOWM RVKVN RULWL RWXUVSUPUNVMWMYOYOWPU RUVPU RSUMW RNVNY RMXOX",2329:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLWY",2330:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2331:"103EfNSOUQVSVUUVSVQUOSNQNOONPMSMVNYP[S\\V\\Y[[Y\\W]T]P\\MZJXIUHRHOIMJKLIOHSHXI]KaMcPeTfYf]e`cba RKLJNIRIXJ\\L`NbQdUeYe]d_cba RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU RaLaNcNcLaL RbLbN RaMcM RaVaXcXcVaV RbVbX RaWcW",2332:" 30D`H@Hd RM@Md RW@Wd R\\@\\d RMMWK RMNWL RMOWM RMWWU RMXWV RMYWW",2367:" 12NVQQQSSSSQQQ RQQSS RSQQS",2368:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2369:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2370:" 32H\\PMMNLOKQKSLUMVPWTWWVXUYSYQXOWNTMPM RMNLPLSMUNVPW RWVXTXQWOVNTM",2371:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2372:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2373:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2374:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2375:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2376:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2377:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2378:" 36JZQCVMRTRU RULQS RTITKPRRUUY RW\\UYSXQXOYN[N]O_Ra RW\\UZSYOYO]P_Ra RSXPZN]",2379:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLSY",2380:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2381:" 89IjNQOOQNSNUOVQVSUUSVQVOUNTMQMNNKPISHWH[I^K`NaRaW`[_]]`ZcVfQiMk RWHZI]K_N`R`W_[^]\\`YcTgQi RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU ReLeNgNgLeL RfLfN ReMgM ReVeXgXgVeV RfVfX ReWgW",2382:" 85D`H>Hf RI>If RM>Mf RQBSBSDQDQAR?T>W>Y?[A\\D\\I[LYNWOUOSNRLQNOQNROSQVRXSVUUWUYV[X\\[\\`[cYeWfTfReQcQ`S`SbQb RRBRD RQCSC RY?ZA[D[IZLYN RRLRNPQNRPSRVRX RYVZX[[[`ZcYe RR`Rb RQaSa",2401:" 21AcHBHb RIBIb R[B[b R\\B\\b RDB`B RDbMb RWb`b",2402:" 23BaGBQPFb RFBPP REBPQ REB\\B^I[B RGa\\a RFb\\b^[[b",2403:" 28I[X+U1R8P=OANFMNMVN^OcPgRlUsXy RU1S6Q":2242,"~":2246,"@":2273,"\\":804}[o]}const jt={SUB_SUP_SCALE:.5,SQRT_MAG_SCALE:.5,FRAC_SCALE:.85,LINE_SPACING:.5,FRAC_SPACING:.4};function Mo(o){o=o.replace(/\n/g," ");let t=0;const e=[];let n="";for(;t0&&(o[u].text=="^"||o[u].text=="_"||o[u].text=="'");)u--;c=o[u].bbox.y,o[a].text=="'"?o[a].bbox.y=c:(At(o[a],jt.SUB_SUP_SCALE,null,0,0),ct[o[u].text]&&ct[o[u].text].flags.big?o[a].bbox.y=c-o[a].bbox.h:o[u].text=="\\int"?o[a].bbox.y=c:o[a].bbox.y=c-o[a].bbox.h/2)}else if(o[a].text=="_"){let c=1,u=a;for(;u>0&&(o[u].text=="^"||o[u].text=="_"||o[u].text=="'");)u--;c=o[u].bbox.y+o[u].bbox.h,At(o[a],jt.SUB_SUP_SCALE,null,0,0),ct[o[u].text]&&ct[o[u].text].flags.big?o[a].bbox.y=c:o[u].text=="\\int"?o[a].bbox.y=c-o[a].bbox.h:o[a].bbox.y=c-o[a].bbox.h/2}function e(a,c,u,d,g){let L=a,O=g,M=1/0,P=-1/0;for(;d>0?L=0;){if(o[L].text==c)O++;else if(o[L].text==u){if(O--,O==0)break}else o[L].text=="^"||o[L].text=="_"||o[L].bbox&&(M=Math.min(M,o[L].bbox.y),P=Math.max(P,o[L].bbox.y+o[L].bbox.h));L+=d}return[M,P]}for(let a=0;aa.text=="&"||a.text=="\\\\"))return;const n=[];let i=[],r=[];for(let a=0;a0&&(o.chld[P].text=="^"||o.chld[P].text=="_"||o.chld[P].text=="'");)P--;const T=ct[o.chld[P].text]&&ct[o.chld[P].text].flags.big;if(O.text=="'"){let X=P+1,S=0;for(;X1;Xo(o.chld,c);const g=Di(o.chld);o.text=="\\text"&&(g.x-=1,g.w+=2);for(let L=0;Ln.bbox.w)c=c/Math.max(s.w,1)*n.bbox.w,c+=n.bbox.x;else{c=c/16*i;const d=(n.bbox.w-s.w/16*i)/2;c+=n.bbox.x+d}ct[n.text].flags.yfl?(u=(u-s.ymin)/Math.max(s.ymax-s.ymin,1)*n.bbox.h,u+=n.bbox.y):(u=u/16*i,r&&(u-=(s.ymax+s.ymin)/2/16*i),u+=n.bbox.y+n.bbox.h/2),R.push([c,u])}t.push(R)}}else if(ct[n.text]&&ct[n.text].flags.txt||n.type=="char"){let s=n.bbox.x;const l=!!(ct[n.text]&&ct[n.text].flags.txt);for(let R=Number(l);R16?g*=16/a.w:g+=(16-a.w)/2/16),g+=s,L+=n.bbox.y+n.bbox.h/2,u.push([g,L])}t.push(u)}n.mode=="tt"?s+=i:s+=a.w/16*i}}}return t}function ae(o){return Math.round(o*100)/100}class fo{constructor(t){h(this,"_latex");h(this,"_tree");h(this,"_tokens");h(this,"_polylines");this._latex=t,this._tokens=Mo(t),this._tree=xn(this._tokens),Qi(this._tree.chld),Re(this._tree),No(this._tree),this._polylines=Fo(this._tree)}resolveScale(t){var s,l,R,a;if(t==null)return[16,16,16,16];let e=(s=t.SCALE_X)!=null?s:16,n=(l=t.SCALE_Y)!=null?l:16;if(t.MIN_CHAR_H!=null){let c=0;for(let d=0;d`;t.BG_COLOR&&(R+=``),R+='>endobj 2 0 obj << /Type /Pages /Kids [3 0 R] /Count 1 /MediaBox [0 0 ${s} ${l}] >> endobj 3 0 obj << /Type /Page /Parent 2 0 R /Resources << /Font << /F1 << /Type /Font /Subtype /Type1 /BaseFont /Times-Roman >> >> >> /Contents [`,a="",c=4;for(let d=0;d> stream 1 j 1 J ${(u=t.STROKE_W)!=null?u:1} w `;for(let g=0;g> endobj `,a+=` trailer << /Root 1 0 R /Size 0 >>startxref %%EOF `,R+a}boxes(t){t||(t={});const[e,n,i,r]=this.resolveScale(t),s=[];for(let l=0;l{const u=new Image;u.src=e.laTexSVG,u.onload=()=>{t.drawImage(u,n,i,s,l),this.imageCache.set(e.value,u),a(e)},u.onerror=d=>{c(d)}});this.addImageObserver(R)}}}var ne;(function(o){o.UL="ul",o.OL="ol"})(ne||(ne={}));var ie;(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.CHECKBOX="checkbox"})(ie||(ie={}));var Cn;(function(o){o.DECIMAL="decimal"})(Cn||(Cn={}));var Gt;(function(o){o[o.DISC=ie.DISC]="DISC",o[o.CIRCLE=ie.CIRCLE]="CIRCLE",o[o.SQUARE=ie.SQUARE]="SQUARE",o[o.DECIMAL=Cn.DECIMAL]="DECIMAL",o[o.CHECKBOX=ie.CHECKBOX]="CHECKBOX"})(Gt||(Gt={}));const wn={[ie.DISC]:"\u2022",[ie.CIRCLE]:"\u25E6",[ie.SQUARE]:"\u25AB\uFE0E",[ie.CHECKBOX]:"\u2611\uFE0F"},Io={[ne.OL]:"ol",[ne.UL]:"ul"},mo={[Gt.DISC]:"disc",[Gt.CIRCLE]:"circle",[Gt.SQUARE]:"square",[Gt.DECIMAL]:"decimal",[Gt.CHECKBOX]:"checkbox"};var ht;(function(o){o.FIRST="first",o.SECOND="second",o.THIRD="third",o.FOURTH="fourth",o.FIFTH="fifth",o.SIXTH="sixth"})(ht||(ht={}));const po={defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},Ei={[ht.FIRST]:"defaultFirstSize",[ht.SECOND]:"defaultSecondSize",[ht.THIRD]:"defaultThirdSize",[ht.FOURTH]:"defaultFourthSize",[ht.FIFTH]:"defaultFifthSize",[ht.SIXTH]:"defaultSixthSize"},Hn={[ht.FIRST]:1,[ht.SECOND]:2,[ht.THIRD]:3,[ht.FOURTH]:4,[ht.FIFTH]:5,[ht.SIXTH]:6},Wo={H1:ht.FIRST,H2:ht.SECOND,H3:ht.THIRD,H4:ht.FOURTH,H5:ht.FIFTH,H6:ht.SIXTH};var dt;(function(o){o.TEXT="text",o.SELECT="select",o.CHECKBOX="checkbox",o.RADIO="radio",o.DATE="date"})(dt||(dt={}));var D;(function(o){o.PREFIX="prefix",o.POSTFIX="postfix",o.PLACEHOLDER="placeholder",o.VALUE="value",o.CHECKBOX="checkbox",o.RADIO="radio"})(D||(D={}));var yn;(function(o){o.ROW_START="rowStart",o.VALUE_START="valueStart"})(yn||(yn={}));var Ln;(function(o){o.CONTAIN="contain",o.COVER="cover"})(Ln||(Ln={}));var Ne;(function(o){o.REPEAT="repeat",o.NO_REPEAT="no-repeat",o.REPEAT_X="repeat-x",o.REPEAT_Y="repeat-y"})(Ne||(Ne={}));const Vo={color:"#FFFFFF",image:"",size:Ln.COVER,repeat:Ne.NO_REPEAT,applyPageNumbers:[]};var Vt;(function(o){o.TOP="top",o.MIDDLE="middle",o.BOTTOM="bottom"})(Vt||(Vt={}));const Yo={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff",verticalAlign:Vt.BOTTOM},Uo={placeholderColor:"#9c9b9b",bracketColor:"#000000",prefix:"{",postfix:"}",borderWidth:1,borderColor:"#000000",activeBackgroundColor:""},Zo={bottom:30,maxHeightRadio:me.HALF,disabled:!1,editable:!0},Qo={opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!1},Do={top:30,maxHeightRadio:me.HALF,disabled:!1,editable:!0},Ko={disabled:!0,color:"#CCCCCC",lineWidth:1.5},Eo={font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},Gn={PAGE_NO:"{pageNo}",PAGE_COUNT:"{pageCount}"},bo={bottom:60,size:12,font:"Microsoft YaHei",color:"#000000",rowFlex:Rt.CENTER,format:Gn.PAGE_NO,numberType:ke.ARABIC,disabled:!1,startPageNo:1,fromPageNo:0,maxPageNo:null},xo={data:"",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},Co={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000",verticalAlign:Vt.BOTTOM},wo={lineWidth:1,strokeStyle:"#000000"},Ho={tdPadding:[0,5,5,5],defaultTrMinHeight:42,defaultColMinWidth:40},Jn={data:"",color:"#AEB5C0",opacity:.3,size:200,font:"Microsoft YaHei",repeat:!1,gap:[10,10]},yo={tipDisabled:!0};var On;(function(o){o.PAGE="page",o.CONTINUITY="continuity"})(On||(On={}));const Go={size:12,font:"Microsoft YaHei",color:"#000000",disabled:!0,right:20,type:On.CONTINUITY},Jo={color:"#000000",lineWidth:1,padding:[0,5,0,5],disabled:!0};var se;(function(o){o.COMPONENT="component",o.MENU="menu",o.MAIN="main",o.FOOTER="footer",o.CONTEXTMENU="contextmenu",o.POPUP="popup",o.CATALOG="catalog",o.COMMENT="comment"})(se||(se={}));var Le;(function(o){o.PAGE="page",o.TABLE="table"})(Le||(Le={}));var at;(function(o){o.EDIT="edit",o.CLEAN="clean",o.READONLY="readonly",o.FORM="form",o.PRINT="print",o.DESIGN="design"})(at||(at={}));var lt;(function(o){o.HEADER="header",o.MAIN="main",o.FOOTER="footer"})(lt||(lt={}));var Fe;(function(o){o.PAGING="paging",o.CONTINUITY="continuity"})(Fe||(Fe={}));var ce;(function(o){o.VERTICAL="vertical",o.HORIZONTAL="horizontal"})(ce||(ce={}));var Pn;(function(o){o.BREAK_ALL="break-all",o.BREAK_WORD="break-word"})(Pn||(Pn={}));var Mn;(function(o){o.SPEED="speed",o.COMPATIBILITY="compatibility"})(Mn||(Mn={}));function vn(o={}){const t=b(b({},Ho),o.table),e=b(b({},Do),o.header),n=b(b({},Zo),o.footer),i=b(b({},bo),o.pageNumber),r=b(b({},Jn),o.watermark),s=b(b({},Uo),o.control),l=b(b({},Yo),o.checkbox),R=b(b({},Co),o.radio),a=b(b({},lo),o.cursor),c=b(b({},po),o.title),u=b(b({},xo),o.placeholder),d=b(b({},Qo),o.group),g=b(b({},Eo),o.pageBreak),L=b(b({},yo),o.zone),O=b(b({},Vo),o.background),M=b(b({},Ko),o.lineBreak),P=b(b({},wo),o.separator),T=b(b({},Go),o.lineNumber),X=b(b({},Jo),o.pageBorder);return tt(b({mode:at.EDIT,defaultType:"TEXT",defaultColor:"#000000",defaultFont:"Microsoft YaHei",defaultSize:16,minSize:5,maxSize:72,defaultRowMargin:1,defaultBasicRowMarginHeight:8,defaultTabWidth:32,width:794,height:1123,scale:1,pageGap:20,underlineColor:"#000000",strikeoutColor:"#FF0000",rangeAlpha:.6,rangeColor:"#AECBFA",rangeMinWidth:5,searchMatchAlpha:.6,searchMatchColor:"#FFFF00",searchNavigateMatchColor:"#AAD280",highlightAlpha:.6,resizerColor:"#4182D9",resizerSize:5,marginIndicatorSize:35,marginIndicatorColor:"#BABABA",margins:[100,120,100,120],pageMode:Fe.PAGING,renderMode:Mn.SPEED,defaultHyperlinkColor:"#0000FF",paperDirection:ce.VERTICAL,inactiveAlpha:.6,historyMaxRecordCount:100,wordBreak:Pn.BREAK_WORD,printPixelRatio:3,maskMargin:[0,0,0,0],letterClass:[Bs.ENGLISH],contextMenuDisableKeys:[],scrollContainerSelector:""},o),{table:t,header:e,footer:n,pageNumber:i,watermark:r,control:s,checkbox:l,radio:R,cursor:a,title:c,placeholder:u,group:d,pageBreak:g,zone:L,background:O,lineBreak:M,separator:P,lineNumber:T,pageBorder:X})}function bi(o){const t=[];for(let e=0;eQ.concat(U.value.split("").map(f=>tt(b({},U),{value:f}))),[]);let Y=0;for(let Q=0;QY.concat(Q.value.split("").map(U=>tt(b({},Q),{value:U}))),[]);let m=0;for(let Y=0;Ym.code===d);V&&(Z=[{value:V.value}])}_t(Z,tt(b({},t),{isHandleFirstElement:!1,isForceCompensation:!1}));for(let V=0;V1){o.splice(s,1);const R=qt(l.value);for(let a=0;a{const s=o[r];s!==void 0&&(i[r]=s)}),i}function Tt(o,t={}){const{extraPickAttrs:e}=t,n=Ot(o),i=[];let r=0;for(;r{const L=u[g];L!==void 0&&(d[g]=L)}),a.tdList[c]=d}}}else if(s.type===F.HYPERLINK){const R=s.hyperlinkId;if(R){const a={type:F.HYPERLINK,value:"",url:s.url},c=[];for(;r{$e(O,i,M)});continue}((u=g.valueList)==null?void 0:u.length)&&Ht(o,g.valueList,e,n);const L=[...Ui];Ee(g)||L.push(...pe),$e(L,i,g)}}function _o(o,t){let e="span";o.type===F.SUPERSCRIPT?e="sup":o.type===F.SUBSCRIPT&&(e="sub");const n=document.createElement(e);return n.style.fontFamily=o.font||t.defaultFont,o.rowFlex&&(n.style.textAlign=xi(o.rowFlex)),o.color&&(n.style.color=o.color),o.bold&&(n.style.fontWeight="600"),o.italic&&(n.style.fontStyle="italic"),n.style.fontSize=`${o.size||t.defaultSize}px`,o.highlight&&(n.style.backgroundColor=o.highlight),o.underline&&(n.style.textDecoration="underline"),o.strikeout&&(n.style.textDecoration+=" line-through"),n.innerText=o.value.replace(new RegExp(`${_}`,"g"),` `),n}function wi(o){let t=0;const e=new Map;for(let n=0;n0&&(t+=1);const l=r[s],R=e.get(t)||[];R.push(tt(b({},i),{value:l})),e.set(t,R)}}}return e}function ko(o){var n;const t=[];if(!o.length)return t;let e=((n=o[0])==null?void 0:n.rowFlex)||null;t.push({rowFlex:e,data:[o[0]]});for(let i=1;iS.value).join(""),T.url&&(X.href=T.url),l.append(X)}else if(T.type===F.TITLE){const X=document.createElement(`h${Hn[T.level]}`),S=n(T.valueList);X.innerHTML=S.innerHTML,l.append(X)}else if(T.type===F.LIST){const X=document.createElement(Io[T.listType]);T.listStyle&&(X.style.listStyleType=mo[T.listStyle]);const S=Tt(T.valueList);wi(S).forEach(W=>{const p=document.createElement("li"),Z=n(W);p.innerHTML=Z.innerHTML,X.append(p)}),l.append(X)}else if(T.type===F.IMAGE){const X=document.createElement("img");T.value&&(X.src=T.value,X.width=T.width,X.height=T.height),l.append(X)}else if(T.type===F.SEPARATOR){const X=document.createElement("hr");l.append(X)}else if(T.type===F.CHECKBOX){const X=document.createElement("input");X.type="checkbox",((d=T.checkbox)==null?void 0:d.value)&&X.setAttribute("checked","true"),l.append(X)}else if(T.type===F.RADIO){const X=document.createElement("input");X.type="radio",((g=T.radio)==null?void 0:g.value)&&X.setAttribute("checked","true"),l.append(X)}else if(T.type===F.TAB){const X=document.createElement("span");X.innerHTML=`${fi}${fi}`,l.append(X)}else if(T.type===F.CONTROL){const X=document.createElement("span"),S=n(((L=T.control)==null?void 0:L.value)||[]);X.innerHTML=S.innerHTML,l.append(X)}else if(!T.type||T.type===F.LATEX||ee.includes(T.type)){let X="";if(T.type===F.DATE?X=((O=T.valueList)==null?void 0:O.map(N=>N.value).join(""))||"":X=T.value,!X)continue;const S=_o(T,e);((M=s[P-1])==null?void 0:M.type)===F.TITLE&&(X=X.replace(/^\n/,"")),S.innerText=X.replace(new RegExp(`${_}`,"g"),` `),l.append(S)}}return l}const i=document.createElement("div"),r=ko(o);for(let s=0;s{i.append(c.cloneNode(!0))}):i.append(a)}return i}function zo(o){if(!o||o.nodeType!==3)return null;const t=o.parentNode,e=t.nodeName==="FONT"?t.parentNode:t,n=Bo(e),i=o.textContent,r=window.getComputedStyle(e);if(!i||e.nodeName==="STYLE")return null;const s={value:i,color:r.color,bold:Number(r.fontWeight)>500,italic:r.fontStyle.includes("italic"),size:Math.floor(parseFloat(r.fontSize))};return e.nodeName==="SUB"||r.verticalAlign==="sub"?s.type=F.SUBSCRIPT:(e.nodeName==="SUP"||r.verticalAlign==="super")&&(s.type=F.SUPERSCRIPT),n!==Rt.LEFT&&(s.rowFlex=n),r.backgroundColor!=="rgba(0, 0, 0, 0)"&&(s.highlight=r.backgroundColor),r.textDecorationLine.includes("underline")&&(s.underline=!0),r.textDecorationLine.includes("line-through")&&(s.strikeout=!0),s}function je(o,t){const e=[];function n(s){if(s.nodeType===3){const l=zo(s);l&&e.push(l)}else if(s.nodeType===1){const l=s.childNodes;for(let R=0;R{const g=je(d.innerHTML,t);g.forEach(L=>{L.value===` `&&(L.listWrap=!0)}),g.unshift({value:` `}),u.valueList.push(...g)}),e.push(u)}else if(a.nodeName==="HR")e.push({value:` `,type:F.SEPARATOR});else if(a.nodeName==="IMG"){const{src:c,width:u,height:d}=a;c&&u&&d&&e.push({width:u,height:d,value:c,type:F.IMAGE})}else if(a.nodeName==="TABLE"){const c=a,u={type:F.TABLE,value:` `,colgroup:[],trList:[]};if(c.querySelectorAll("tr").forEach(d=>{const g=window.getComputedStyle(d).height.replace("px",""),L={height:Number(g),tdList:[]};d.querySelectorAll("th,td").forEach(O=>{const M=O,P=je(M.innerHTML,t),T={colspan:M.colSpan,rowspan:M.rowSpan,value:P};M.style.backgroundColor&&(T.backgroundColor=M.style.backgroundColor),L.tdList.push(T)}),u.trList.push(L)}),u.trList.length){const d=u.trList[0].tdList.reduce((L,O)=>L+O.colspan,0),g=Math.ceil(t.innerWidth/d);for(let L=0;L{var l;s.nodeType!==1&&!((l=s.textContent)==null?void 0:l.trim())&&r.push(s)}),r.forEach(s=>s.remove()),n(i),i.remove(),e}function Tn(o){function t(e){var i,r,s,l,R;let n="";for(let a=0;au.value).join("");else if(c.type===F.TITLE)n+=`${t(Tt(c.valueList))}`;else if(c.type===F.LIST){const u=Tt(c.valueList),d=wi(u);let g="";c.listType===ne.UL&&(g=wn[c.listStyle]),d.forEach((L,O)=>{const M=d.size-1===O;n+=` ${g||`${O+1}.`}${t(L)}${M?` `:""}`})}else if(c.type===F.CHECKBOX)n+=((i=c.checkbox)==null?void 0:i.value)?"\u2611":"\u25A1";else if(c.type===F.RADIO)n+=((r=c.radio)==null?void 0:r.value)?"\u2609":"\u25CB";else if(!c.type||c.type===F.LATEX||ee.includes(c.type)){let u="";c.type===F.CONTROL?u=((l=(s=c.control.value)==null?void 0:s[0])==null?void 0:l.value)||"":c.type===F.DATE?u=((R=c.valueList)==null?void 0:R.map(d=>d.value).join(""))||"":u=c.value,n+=u.replace(new RegExp(`${_}`,"g"),` `)}}return n}return t(Tt(o))}function Bn(o){return Zn(o,["metrics","style"])}function Ee(o){return!!(o==null?void 0:o.type)&&(ho.includes(o.type)||o.imgDisplay===et.INLINE)}function $o(o,t){const e=document.createElement(t);for(let n=0;n=0;n--)((e=o[n].imgFloatPosition)==null?void 0:e.pageNo)===t&&o.splice(n,1)}function jo(o){localStorage.setItem(Dn,JSON.stringify({text:o.text,elementList:o.elementList}))}function yi(){const o=localStorage.getItem(Dn);return o?JSON.parse(o):null}function Gi(){localStorage.removeItem(Dn)}function tr(o,t,e){if(!o&&!t&&!e.length)return;const n=new Blob([o],{type:"text/plain"}),i=new Blob([t],{type:"text/html"});if(window.ClipboardItem){const r=new ClipboardItem({[n.type]:n,[i.type]:i});window.navigator.clipboard.write([r])}else{const r=document.createElement("div");r.setAttribute("contenteditable","true"),r.innerHTML=t,document.body.append(r);const s=window.getSelection(),l=document.createRange(),R=document.createElement("span");R.innerText=` `,r.append(R),l.selectNodeContents(r),s==null||s.removeAllRanges(),s==null||s.addRange(l),document.execCommand("copy"),r.remove()}jo({text:o,elementList:e})}function Ji(o,t){const e=qe(o,t);document.body.append(e);const n=e.innerText;e.remove();const i=e.innerHTML;!n&&!i&&!o.length||tr(n,i,Tt(o))}function er(o){let t=!1;for(let e=0;e{const l=new Image,R=s.result;l.src=R,l.onload=()=>{const a={value:R,type:F.IMAGE,width:l.width,height:l.height};~i&&Ht(r,[a],i,{editorOptions:e.getOptions()}),e.insertElementList([a])}}}function nr(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=t.clipboardData;if(!n)return;const{paste:i}=e.getOverride();if(i){const s=i(t);if((s==null?void 0:s.preventDefault)!==!1)return}if(!er(n)){const s=n.getData("text"),l=yi();if(s===(l==null?void 0:l.text)){An(o,l.elementList);return}}Gi();let r=!1;for(let s=0;s{o.input(R)});break}if(l.type==="text/html"&&r){l.getAsString(R=>{vi(o,R)});break}}else if(l.kind==="file"&&l.type.includes("image")){const R=l.getAsFile();R&&_n(o,R)}}}async function ir(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const{paste:n}=e.getOverride();if(n){const s=n();if((s==null?void 0:s.preventDefault)!==!1)return}const i=await navigator.clipboard.readText(),r=yi();if(i===(r==null?void 0:r.text)){An(o,r.elementList);return}if(Gi(),t==null?void 0:t.isPlainText)i&&o.input(i);else{const s=await navigator.clipboard.read();let l=!1;for(const R of s)if(R.types.includes("text/html")){l=!0;break}for(const R of s)if(R.types.includes("text/plain")&&!l){const c=await(await R.getType("text/plain")).text();c&&o.input(c)}else if(R.types.includes("text/html")&&l){const c=await(await R.getType("text/html")).text();c&&vi(o,c)}else if(R.types.some(a=>a.startsWith("image/"))){const a=R.types.find(u=>u.startsWith("image/")),c=await R.getType(a);_n(o,c)}}}class sr{constructor(t,e){h(this,"draw");h(this,"container");h(this,"agentCursorDom");h(this,"canvasEvent");this.draw=t,this.container=t.getContainer(),this.canvasEvent=e;const n=document.createElement("textarea");n.autocomplete="off",n.classList.add(`${k}-inputarea`),n.innerText="",this.container.append(n),this.agentCursorDom=n,n.onkeydown=i=>this._keyDown(i),n.oninput=mi(this._input.bind(this),0),n.onpaste=i=>this._paste(i),n.addEventListener("compositionstart",this._compositionstart.bind(this)),n.addEventListener("compositionend",this._compositionend.bind(this))}getAgentCursorDom(){return this.agentCursorDom}_keyDown(t){this.canvasEvent.keydown(t)}_input(t){const e=t.data;!e||this.canvasEvent.input(e)}_paste(t){this.draw.isReadonly()||!t.clipboardData||(nr(this.canvasEvent,t),t.preventDefault())}_compositionstart(){this.canvasEvent.compositionstart()}_compositionend(t){this.canvasEvent.compositionend(t)}}class or{constructor(t,e){h(this,"ANIMATION_CLASS",`${k}-cursor--animation`);h(this,"draw");h(this,"container");h(this,"options");h(this,"position");h(this,"cursorDom");h(this,"cursorAgent");h(this,"blinkTimeout");this.draw=t,this.container=t.getContainer(),this.position=t.getPosition(),this.options=t.getOptions(),this.cursorDom=document.createElement("div"),this.cursorDom.classList.add(`${k}-cursor`),this.container.append(this.cursorDom),this.cursorAgent=new sr(t,e),this.blinkTimeout=null}getCursorDom(){return this.cursorDom}getAgentDom(){return this.cursorAgent.getAgentCursorDom()}getAgentIsActive(){return this.getAgentDom()===document.activeElement}getAgentDomValue(){return this.getAgentDom().value}clearAgentDomValue(){this.getAgentDom().value=""}_blinkStart(){this.cursorDom.classList.add(this.ANIMATION_CLASS)}_blinkStop(){this.cursorDom.classList.remove(this.ANIMATION_CLASS)}_setBlinkTimeout(){this._clearBlinkTimeout(),this.blinkTimeout=window.setTimeout(()=>{this._blinkStart()},500)}_clearBlinkTimeout(){this.blinkTimeout&&(this._blinkStop(),window.clearTimeout(this.blinkTimeout),this.blinkTimeout=null)}focus(){const t=this.cursorAgent.getAgentCursorDom();document.activeElement!==t&&(t.focus(),t.setSelectionRange(0,0))}drawCursor(t){let e=this.position.getCursorPosition();if(!e)return;const{scale:n,cursor:i}=this.options,{color:r,width:s,isShow:l=!0,isBlink:R=!0,isFocus:a=!0,hitLineStartIndex:c}=b(b({},i),t),u=this.draw.getHeight(),d=this.draw.getPageGap();c&&(e=this.position.getPositionList()[c]);const{metrics:g,coordinate:{leftTop:L,rightTop:O},ascent:M,pageNo:P}=e,S=(this.draw.getZone().isMainActive()?P:this.draw.getPageNo())*(u+d),N=ro*n,W=Math.min(g.height/4,N),p=g.height+W*2,Z=this.cursorAgent.getAgentCursorDom();a&&setTimeout(()=>{this.focus()});const V=g.boundingBoxDescent<0?0:g.boundingBoxDescent,m=L[1]+M+V-(p-W)+S,Y=c?L[0]:O[0];if(Z.style.left=`${Y}px`,Z.style.top=`${m+p-N}px`,!l){this.recoveryCursor();return}const Q=this.draw.isReadonly();this.cursorDom.style.width=`${s*n}px`,this.cursorDom.style.backgroundColor=r,this.cursorDom.style.left=`${Y}px`,this.cursorDom.style.top=`${m}px`,this.cursorDom.style.display=Q?"none":"block",this.cursorDom.style.height=`${p}px`,R?this._setBlinkTimeout():this._clearBlinkTimeout()}recoveryCursor(){this.cursorDom.style.display="none",this._clearBlinkTimeout()}moveCursorToVisible(t){const{cursorPosition:e,direction:n}=t;if(!e||!n)return;const{pageNo:i,coordinate:{leftTop:r,leftBottom:s}}=e,l=i*(this.draw.getHeight()+this.draw.getPageGap())+this.container.getBoundingClientRect().top,R=n===Et.UP,a=s[0],c=R?r[1]+l:s[1]+l,u=no(this.container),d={left:0,right:0,top:0,bottom:0};if(u===document.documentElement)d.right=window.innerWidth,d.bottom=window.innerHeight;else{const{left:L,right:O,top:M,bottom:P}=u.getBoundingClientRect();d.left=L,d.right=O,d.top=M,d.bottom=P}const{maskMargin:g}=this.options;if(d.top+=g[0],d.bottom-=g[2],!(a>=d.left&&a<=d.right&&c>=d.top&&c<=d.bottom)){const{scrollLeft:L,scrollTop:O}=u;R?u.scroll(L,O-(d.top-c)):u.scroll(L,O+c-d.bottom)}}}var kn;(function(o){o[o.LEFT=0]="LEFT",o[o.CENTER=1]="CENTER",o[o.RIGHT=2]="RIGHT"})(kn||(kn={}));const We=typeof navigator!="undefined"&&/Mac OS X/.test(navigator.userAgent),rr=typeof navigator!="undefined"&&/iPad|iPhone/.test(navigator.userAgent);function ue(o){return We?o.metaKey:o.ctrlKey}var z;(function(o){o.Delete="Delete",o.Backspace="Backspace",o.Enter="Enter",o.Left="ArrowLeft",o.Right="ArrowRight",o.Up="ArrowUp",o.Down="ArrowDown",o.ESC="Escape",o.TAB="Tab",o.META="Meta",o.LEFT_BRACKET="[",o.RIGHT_BRACKET="]",o.COMMA=",",o.PERIOD=".",o.LEFT_ANGLE_BRACKET="<",o.RIGHT_ANGLE_BRACKET=">",o.EQUAL="=",o.MINUS="-",o.PLUS="+",o.A="a",o.B="b",o.C="c",o.D="d",o.E="e",o.F="f",o.G="g",o.H="h",o.I="i",o.J="j",o.K="k",o.L="l",o.M="m",o.N="n",o.O="o",o.P="p",o.Q="q",o.R="r",o.S="s",o.T="t",o.U="u",o.V="v",o.W="w",o.X="x",o.Y="y",o.Z="z",o.A_UPPERCASE="A",o.B_UPPERCASE="B",o.C_UPPERCASE="C",o.D_UPPERCASE="D",o.E_UPPERCASE="E",o.F_UPPERCASE="F",o.G_UPPERCASE="G",o.H_UPPERCASE="H",o.I_UPPERCASE="I",o.J_UPPERCASE="J",o.K_UPPERCASE="K",o.L_UPPERCASE="L",o.M_UPPERCASE="M",o.N_UPPERCASE="N",o.O_UPPERCASE="O",o.P_UPPERCASE="P",o.Q_UPPERCASE="Q",o.R_UPPERCASE="R",o.S_UPPERCASE="S",o.T_UPPERCASE="T",o.U_UPPERCASE="U",o.V_UPPERCASE="V",o.W_UPPERCASE="W",o.X_UPPERCASE="X",o.Y_UPPERCASE="Y",o.Z_UPPERCASE="Z",o.ZERO="0",o.ONE="1",o.TWO="2",o.THREE="3",o.FOUR="4",o.FIVE="5",o.SIX="6",o.SEVEN="7",o.EIGHT="8",o.NINE="9"})(z||(z={}));class Sn{constructor(t,e){h(this,"element");h(this,"control");this.element=t,this.control=e}setElement(t){this.element=t}getElement(){return this.element}getCode(){var t;return((t=this.element.control)==null?void 0:t.code)||null}getValue(){const t=this.control.getElementList(),{startIndex:e}=this.control.getRange(),n=t[e],i=[];let r=e;for(;r>0;){const l=t[r];if(l.controlId!==n.controlId||l.controlComponent===D.PREFIX)break;l.controlComponent===D.VALUE&&i.unshift(l),r--}let s=e+1;for(;s0;){const c=r[R];if(c.controlId!==l.controlId||c.controlComponent===D.PREFIX)break;if(c.controlComponent===D.CHECKBOX){const u=c.checkbox;u.value=t.includes(u.code)}R--}let a=s+1;for(;a0;){const c=r[R];if(c.controlId!==l.controlId||c.controlComponent===D.PREFIX)break;if(c.controlComponent===D.RADIO){const u=c.radio;u.value=t.includes(u.code)}R--}let a=s+1;for(;al===e.code);i.splice(s,1)}else(e==null?void 0:e.code)&&i.push(e.code);const r=t.getControl().getActiveControl();r instanceof Sn&&r.setSelect(i)}}function _i(o,t){const{radio:e,control:n}=o;if(!n)t.getRadioParticle().setSelect(o);else{const i=(e==null?void 0:e.code)?[e.code]:[],r=t.getControl().getActiveControl();r instanceof zn&&r.setSelect(i)}}function lr(o,t){var U,f;if(o.button===kn.RIGHT)return;const e=t.getDraw(),n=e.isReadonly(),i=e.getRange(),r=e.getPosition();if(!t.isAllowDrag){const E=i.getRange();if(!n&&E.startIndex!==E.endIndex&&i.getIsPointInRange(o.offsetX,o.offsetY)){Bi(t);return}}const l=o.target.dataset.index;l&&e.setPageNo(Number(l)),t.isAllowSelection=!0;const R=Ot(r.getPositionContext()),a=r.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!a)return;const{index:c,isDirectHit:u,isCheckbox:d,isRadio:g,isImage:L,isTable:O,tdValueIndex:M,hitLineStartIndex:P}=a;t.mouseDownStartPosition=tt(b({},a),{index:O?M:c,x:o.offsetX,y:o.offsetY});const T=e.getElementList(),X=r.getPositionList(),S=O?M:c,N=T[S],W=!!(u&&L),p=!!(u&&d),Z=!!(u&&g);if(~c){let E=S,C=S;if(o.shiftKey){const{startIndex:w}=i.getRange();~w&&r.getPositionContext().tdId===R.tdId&&(S>w?E=w:C=w)}if(i.setRange(E,C),r.setCursorPosition(X[S]),p&&!n)Ai(N,e);else if(Z&&!n)_i(N,e);else if(N.controlComponent===D.VALUE&&(((U=N.control)==null?void 0:U.type)===dt.CHECKBOX||((f=N.control)==null?void 0:f.type)===dt.RADIO)){let w=S;for(;w>0;){const G=T[w];if(G.controlComponent===D.CHECKBOX){Ai(G,e);break}else if(G.controlComponent===D.RADIO){_i(G,e);break}w--}}else e.render({curIndex:S,isCompute:!1,isSubmitHistory:!1,isSetCursor:!W&&!p&&!Z});P&&t.getDraw().getCursor().drawCursor({hitLineStartIndex:P})}const V=e.getPreviewer();if(V.clearResizer(),W){const E={dragDisable:n||!N.controlId&&e.getMode()===at.FORM};N.type===F.LATEX&&(E.mime="svg",E.srcKey="laTexSVG"),V.drawResizer(N,X[S],E),e.getCursor().drawCursor({isShow:!1}),Bi(t),(N.imgDisplay===et.SURROUND||N.imgDisplay===et.FLOAT_TOP||N.imgDisplay===et.FLOAT_BOTTOM)&&e.getImageParticle().createFloatImage(N)}const m=e.getTableTool();m.dispose(),O&&!n&&e.getMode()!==at.FORM&&m.render();const Y=e.getHyperlinkParticle();Y.clearHyperlinkPopup(),N.type===F.HYPERLINK&&(ue(o)?Y.openHyperlink(N):Y.drawHyperlinkPopup(N,X[S]));const Q=e.getDateParticle();Q.clearDatePicker(),N.type===F.DATE&&!n&&Q.renderDatePicker(N,X[S])}function Xn(o){const t=Pt();return Reflect.set(o,"dragId",t),t}function Nn(o,t){return t.findIndex(e=>e.dragId===o)}function ki(o,t,e){const n=e.getDraw();if(o.imgDisplay===et.SURROUND||o.imgDisplay===et.FLOAT_TOP||o.imgDisplay===et.FLOAT_BOTTOM){const i=t.offsetX-e.mouseDownStartPosition.x,r=t.offsetY-e.mouseDownStartPosition.y,s=o.imgFloatPosition;o.imgFloatPosition={x:s.x+i,y:s.y+r,pageNo:n.getPageNo()}}n.getImageParticle().destroyFloatImage()}function Rr(o,t){var e,n,i,r;if(t.isAllowDrop){const s=t.getDraw();if(s.isReadonly()||s.isDisabled()){t.mousedown(o);return}const l=s.getPosition(),R=l.getPositionList(),a=l.getPositionContext(),c=s.getRange(),u=t.cacheRange,d=t.cacheElementList,g=t.cachePositionList,L=c.getRange(),O=u.startIndex===u.endIndex,M=O?u.startIndex-1:u.startIndex,P=u.endIndex;if(L.startIndex>=M&&L.endIndex<=P&&((e=t.cachePositionContext)==null?void 0:e.tdId)===a.tdId){s.clearSideEffect();let It=!1,nt=!1;if(O){const bt=d[P];if(bt.type===F.IMAGE||bt.type===F.LATEX){if(ki(bt,o,t),bt.imgDisplay===et.SURROUND||bt.imgDisplay===et.FLOAT_TOP||bt.imgDisplay===et.FLOAT_BOTTOM)s.getPreviewer().drawResizer(bt),It=!0;else{const $t=g[P];s.getPreviewer().drawResizer(bt,$t)}nt=bt.imgDisplay===et.SURROUND}}c.replaceRange(b({},u)),s.render({isCompute:nt,isSubmitHistory:It,isSetCursor:!1});return}const T=d.slice(M+1,P+1),X=T.find(It=>It.controlId);if(X){const It=d[M+1],nt=d[P];if(!((!It.controlId||It.controlComponent===D.PREFIX)&&(!nt.controlId||nt.controlComponent===D.POSTFIX)||It.controlId===nt.controlId&&It.controlComponent===D.PREFIX&&nt.controlComponent===D.POSTFIX||((n=It.control)==null?void 0:n.type)===dt.TEXT&&It.controlComponent===D.VALUE&&((i=nt.control)==null?void 0:i.type)===dt.TEXT&&nt.controlComponent===D.VALUE)){s.render({curIndex:L.startIndex,isCompute:!1,isSubmitHistory:!1});return}}const S=s.getControl(),N=s.getElementList(),W=!X||!!N[L.startIndex].controlId||!S.getIsElementListContainFullControl(T),p=s.getOptions(),Z=T.map(It=>{if(!It.type||It.type===F.TEXT){const nt={value:It.value},bt=Se;return W||bt.push(...En),bt.forEach($t=>{const Dt=It[$t];Dt!==void 0&&(nt[$t]=Dt)}),nt}else{let nt=Ot(It);return W&&(nt=Te(nt,En)),_t([nt],{isHandleFirstElement:!1,editorOptions:p}),nt}});Ht(N,Z,L.startIndex,{editorOptions:s.getOptions()});const V=d[M],m=g[M],Y=Xn(d[M]),Q=Xn(d[P]),U=Z.length;let f=L.startIndex,E=f+U;const C=S.getActiveControl();if(C&&d[f].controlComponent!==D.POSTFIX?(E=C.setValue(Z),f=E-U):s.spliceElementList(N,f+1,0,...Z),!~E){s.render({isSetCursor:!1});return}const w=Xn(N[f]),G=Xn(N[E]),v=Nn(Y,d),q=Nn(Q,d),st=d[q];st.controlId&&st.controlComponent!==D.POSTFIX?(c.replaceRange(tt(b({},u),{startIndex:v,endIndex:q})),(r=S.getActiveControl())==null||r.cut()):s.spliceElementList(d,v+1,q-v);const Yt=N[L.startIndex],ot=R[L.startIndex];let $=a.index;$&&(Yt.tableId&&!V.tableId?m.index<$&&($-=U):!Yt.tableId&&V.tableId&&ot.index<$&&($+=U),l.setPositionContext(tt(b({},a),{index:$})));const x=Nn(w,N),St=Nn(G,N);c.setRange(O?St:x,St,L.tableId,L.startTdIndex,L.endTdIndex,L.startTrIndex,L.endTrIndex),s.clearSideEffect();let B=null;if(O){const nt=s.getElementList()[St];(nt.type===F.IMAGE||nt.type===F.LATEX)&&(ki(nt,o,t),B=nt)}if(s.render({isSetCursor:!1}),B)if(B.imgDisplay===et.SURROUND||B.imgDisplay===et.FLOAT_TOP||B.imgDisplay===et.FLOAT_BOTTOM)s.getPreviewer().drawResizer(B);else{const nt=l.getPositionList()[St];s.getPreviewer().drawResizer(B,nt)}}else t.isAllowDrag&&t.mousedown(o)}function ar(o,t){const n=t.getDraw().getPageContainer(),{x:i,y:r,width:s,height:l}=n.getBoundingClientRect();o.x>=i&&o.x<=i+s&&o.y>=r&&o.y<=r+l||t.setIsAllowSelection(!1)}function cr(o,t){var S;const e=t.getDraw();if(t.isAllowDrag){const N=o.offsetX,W=o.offsetY,{startIndex:p,endIndex:Z}=t.cacheRange,V=t.cachePositionList;for(let Y=p+1;Y<=Z;Y++){const{coordinate:{leftTop:Q,rightBottom:U}}=V[Y];if(N>=Q[0]&&N<=U[0]&&W>=Q[1]&&W<=U[1])return}const m=(S=t.cacheRange)==null?void 0:S.startIndex;if(m){const Y=t.cacheElementList[m];(Y==null?void 0:Y.type)===F.IMAGE&&(Y.imgDisplay===et.SURROUND||Y.imgDisplay===et.FLOAT_TOP||Y.imgDisplay===et.FLOAT_BOTTOM)&&(e.getPreviewer().clearResizer(),e.getImageParticle().dragFloatImage(o.movementX,o.movementY))}t.dragover(o),t.isAllowDrop=!0;return}if(!t.isAllowSelection||!t.mouseDownStartPosition)return;const i=o.target.dataset.index;i&&e.setPageNo(Number(i));const s=e.getPosition().getPositionByXY({x:o.offsetX,y:o.offsetY});if(!~s.index)return;const{index:l,isTable:R,tdValueIndex:a,tdIndex:c,trIndex:u,tableId:d}=s,{index:g,isTable:L,tdIndex:O,trIndex:M,tableId:P}=t.mouseDownStartPosition,T=R?a:l,X=e.getRange();if(R&&L&&(c!==O||u!==M))X.setRange(T,T,d,O,c,M,u);else{let N=~T?T:0;if((L||R)&&P!==d)return;let W=g;if(W>N&&([W,N]=[N,W]),W===N)return;const p=e.getElementList(),Z=p[W+1],V=p[N];if((Z==null?void 0:Z.controlComponent)===D.PLACEHOLDER&&(V==null?void 0:V.controlComponent)===D.PLACEHOLDER&&Z.controlId===V.controlId)return;X.setRange(W,N)}e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}function ur(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:r,isCrossRowCol:s}=n.getRange(),l=e.getControl();let R;if(s){const a=e.getTableParticle().getRangeRowCol();if(!a)return;let c=!1;for(let u=0;u1&&(e.spliceElementList(L.value,1,L.value.length-1),c=!0)}}R=c?0:null}else if(l.getActiveControl()&&l.getIsRangeCanCaptureEvent())R=l.keydown(o);else{const c=e.getPosition().getCursorPosition();if(!c)return;const{index:u}=c,d=n.getIsCollapsed(),g=e.getElementList();if(d&&u===0){const O=g[u];if(O.value===_){O.listId&&e.getListParticle().unsetList(),o.preventDefault();return}}const L=g[i];if(d&&L.rowFlex&&L.value===_){const O=n.getRangeRowElementList();if(O){const M=g[i-1];O.forEach(P=>{P.rowFlex=M==null?void 0:M.rowFlex})}}d?e.spliceElementList(g,u,1):e.spliceElementList(g,i+1,r-i),R=d?u-1:i}e.getGlobalEvent().setCanvasEventAbility(),R===null?(n.setRange(i,i),e.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(R,R),e.render({curIndex:R}))}function dr(o,t){var c;const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:r,isCrossRowCol:s}=n.getRange(),l=e.getElementList(),R=e.getControl();let a;if(s){const u=e.getTableParticle().getRangeRowCol();if(!u)return;let d=!1;for(let g=0;g1&&(e.spliceElementList(M.value,1,M.value.length-1),d=!0)}}a=d?0:null}else if(R.getActiveControl()&&R.getIsRangeWithinControl())a=R.keydown(o);else if((c=l[r+1])==null?void 0:c.controlId)a=R.removeControl(r+1);else{const u=e.getPosition(),d=u.getCursorPosition();if(!d)return;const{index:g}=d,L=u.getPositionContext();if(L.isDirectHit&&L.isImage)e.spliceElementList(l,g,1),a=g-1;else{const O=n.getIsCollapsed();if(!O)e.spliceElementList(l,i+1,r-i);else{if(!l[g+1])return;e.spliceElementList(l,g+1,1)}a=O?g:i}}e.getGlobalEvent().setCanvasEventAbility(),a===null?(n.setRange(i,i),e.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(a,a),e.render({curIndex:a}))}function hr(o,t){var L,O;const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:r}=n.getRange(),s=n.getIsCollapsed(),l=e.getElementList(),R=l[i],a=l[r];if(s&&a.listId&&a.value===_&&((L=l[r+1])==null?void 0:L.listId)!==a.listId){e.getListParticle().unsetList();return}const c={value:_};if(o.shiftKey&&R.listId&&(c.listWrap=!0),Ht(l,[c],i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()}),!(a.titleId&&a.titleId!==((O=l[r+1])==null?void 0:O.titleId))){const M=Ke(l,r);if(M){const P=[...pe];M.controlComponent!==D.POSTFIX&&P.push(...Se),P.forEach(T=>{const X=M[T];X!==void 0&&(c[T]=X)})}}const u=e.getControl(),d=u.getActiveControl();let g;if(d&&u.getIsRangeWithinControl())g=u.setValue([c]);else{const P=e.getPosition().getCursorPosition();if(!P)return;const{index:T}=P;s?e.spliceElementList(l,T+1,0,c):e.spliceElementList(l,i+1,r-i,c),g=T+1}~g&&(n.setRange(g,g),e.render({curIndex:g})),o.preventDefault()}function gr(o,t){var X,S;const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),r=i.getCursorPosition();if(!r)return;const s=i.getPositionContext(),{index:l}=r;if(l<=0&&!s.isTable)return;const R=e.getRange(),{startIndex:a,endIndex:c}=R.getRange(),u=R.getIsCollapsed(),d=e.getElementList(),g=e.getControl();if(e.getMode()===at.FORM&&g.getActiveControl()&&((X=d[l])==null?void 0:X.controlComponent)===D.PREFIX){g.initNextControl({direction:Et.UP});return}let L=1;if(ue(o)){const N=e.getLetterReg(),W=o.shiftKey&&!u&&a===(r==null?void 0:r.index)?c:a;if(N.test((S=d[W])==null?void 0:S.value)){let p=W-1;for(;p>0;){const Z=d[p];if(!N.test(Z.value))break;L++,p--}}}const O=a-L;let M=O,P=O;if(o.shiftKey&&r&&(a!==c?a===r.index?(M=a,P=c-L):(M=O,P=c):P=c),!o.shiftKey){const N=d[a];if(N.type===F.TABLE){const W=N.trList,p=W.length-1,Z=W[p],V=Z.tdList.length-1,m=Z.tdList[V];i.setPositionContext({isTable:!0,index:a,trIndex:p,tdIndex:V,tdId:m.id,trId:Z.id,tableId:N.id}),M=m.value.length-1,P=M,e.getTableTool().render()}else if(N.tableId&&a===0){const p=e.getOriginalElementList()[s.index].trList;t:for(let Z=0;Zl.length-1&&!R.isTable)return;const a=e.getRange(),{startIndex:c,endIndex:u}=a.getRange(),d=a.getIsCollapsed();let g=e.getElementList();const L=e.getControl();if(e.getMode()===at.FORM&&L.getActiveControl()&&((N=g[s+1])==null?void 0:N.controlComponent)===D.POSTFIX){L.initNextControl({direction:Et.DOWN});return}let O=1;if(ue(o)){const p=e.getLetterReg(),Z=o.shiftKey&&!d&&c===(r==null?void 0:r.index)?u:c;if(p.test((W=g[Z+1])==null?void 0:W.value)){let V=Z+2;for(;VU.length-1&&(C=Y+1,w=0);const G=m[C],v=G.tdList[w];i.setPositionContext({isTable:!0,index:R.index,trIndex:C,tdIndex:w,tdId:v.id,trId:G.id,tableId:p.tableId}),P=0,T=P,e.getTableTool().render()}break t}}}}const X=g.length-1;if(P>X||T>X)return;a.setRange(P,T);const S=P===T;e.render({curIndex:S?P:void 0,isSetCursor:S,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function Or(o,t){const e=t.getDraw();if(e.isReadonly())return;o.preventDefault();const i=e.getControl();if(i.getActiveControl()&&i.getIsRangeWithinControl())i.initNextControl({direction:o.shiftKey?Et.UP:Et.DOWN});else{const s={type:F.TAB,value:""},l=e.getRange(),{startIndex:R}=l.getRange(),a=e.getElementList();Ht(a,[s],R,{editorOptions:e.getOptions()}),e.insertElementList([s])}}function $n(o){const{positionList:t,index:e,isUp:n,rowNo:i,cursorX:r}=o;let s=-1;const l=[];if(n){let R=e-1;for(;R>=0;){const a=t[R];if(R--,a.rowNo!==i){if(l[0]&&l[0].rowNo!==a.rowNo)break;l.unshift(a)}}}else{let R=e+1;for(;Ru)){s=a.index;break}}return s}function Pr(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),r=i.getCursorPosition();if(!r)return;const s=e.getRange(),{startIndex:l,endIndex:R}=s.getRange();let a=i.getPositionList();const c=o.key===z.Up;let u=-1,d=-1;const g=i.getPositionContext();if(!o.shiftKey&&g.isTable&&(c&&r.rowIndex===0||!c&&r.rowIndex===e.getRowCount()-1)){const{index:O,trIndex:M,tdIndex:P,tableId:T}=g;if(c)if(M===0)i.setPositionContext({isTable:!1}),u=O-1,d=u,e.getTableTool().dispose();else{let X=-1,S=-1;const W=e.getOriginalElementList()[O].trList,p=W[M].tdList[P].colIndex;t:for(let m=M-1;m>=0;m--){const Q=W[m].tdList;for(let U=0;U=p&&f.colIndex<=p){X=m,S=U;break t}}}if(!~X||!~S)return;const Z=W[X],V=Z.tdList[S];i.setPositionContext({isTable:!0,index:O,trIndex:X,tdIndex:S,tdId:V.id,trId:Z.id,tableId:T}),u=V.value.length-1,d=u,e.getTableTool().render()}else{const S=e.getOriginalElementList()[O].trList;if(M===S.length-1)i.setPositionContext({isTable:!1}),u=O,d=u,e.getTableTool().dispose();else{let N=-1,W=-1;const p=S[M].tdList[P].colIndex;t:for(let m=M+1;m=p&&f.colIndex<=p){N=m,W=U;break t}}}if(!~N||!~W)return;const Z=S[N],V=Z.tdList[W];i.setPositionContext({isTable:!0,index:O,trIndex:N,tdIndex:W,tdId:V.id,trId:Z.id,tableId:T}),u=V.value.length-1,d=u,e.getTableTool().render()}}}else{let O=r;o.shiftKey&&(l===r.index?O=a[R]:O=a[l]);const{index:M,rowNo:P,rowIndex:T,coordinate:{rightTop:[X]}}=O;if(c&&T===0||!c&&T===e.getRowCount()-1)return;const S=$n({positionList:a,index:M,rowNo:P,isUp:c,cursorX:X});if(S<0)return;u=S,d=S,o.shiftKey&&(l!==R?l===r.index?u=l:d=R:c?d=R:u=l);const W=e.getElementList()[S];if(W.type===F.TABLE){const{scale:p}=e.getOptions(),Z=e.getMargins(),V=W.trList;let m=-1,Y=-1,Q=-1;if(c){t:for(let U=V.length-1;U>=0;U--){const E=V[U].tdList;for(let C=0;C=G&&X<=G+v){const q=w.positionList,st=q[q.length-1],Yt=$n({positionList:q,index:st.index+1,rowNo:st.rowNo-1,isUp:c,cursorX:X})||st.index;m=U,Y=C,Q=Yt;break t}}}}else{t:for(let U=0;U=G&&X<=G+v){const q=w.positionList,st=$n({positionList:q,index:-1,rowNo:-1,isUp:c,cursorX:X})||0;m=U,Y=C,Q=st;break t}}}}if(~m&&~Y&&~Q){const U=V[m],f=U.tdList[Y];i.setPositionContext({isTable:!0,index:S,trIndex:m,tdIndex:Y,tdId:f.id,trId:U.id,tableId:W.id}),u=Q,d=u,a=i.getPositionList(),e.getTableTool().render()}}}if(!~u||!~d)return;u>d&&([u,d]=[d,u]),s.setRange(u,d);const L=u===d;e.render({curIndex:L?u:void 0,isSetCursor:L,isSubmitHistory:!1,isCompute:!1}),e.getCursor().moveCursorToVisible({cursorPosition:a[c?u:d],direction:c?Et.UP:Et.DOWN})}function Mr(o,t){if(t.isComposing)return;const e=t.getDraw();if(o.key===z.Backspace)ur(o,t);else if(o.key===z.Delete)dr(o,t);else if(o.key===z.Enter)hr(o,t);else if(o.key===z.Left)gr(o,t);else if(o.key===z.Right)Lr(o,t);else if(o.key===z.Up||o.key===z.Down)Pr(o,t);else if(ue(o)&&o.key===z.Z){if(e.isReadonly()&&e.getMode()!==at.FORM)return;e.getHistoryManager().undo(),o.preventDefault()}else if(ue(o)&&o.key===z.Y){if(e.isReadonly()&&e.getMode()!==at.FORM)return;e.getHistoryManager().redo(),o.preventDefault()}else if(ue(o)&&o.key===z.C)t.copy(),o.preventDefault();else if(ue(o)&&o.key===z.X)t.cut(),o.preventDefault();else if(ue(o)&&o.key===z.A)t.selectAll(),o.preventDefault();else if(ue(o)&&o.key===z.S){if(e.isReadonly())return;const n=e.getListener();n.saved&&n.saved(e.getValue());const i=e.getEventBus();i.isSubscribe("saved")&&i.emit("saved",e.getValue()),o.preventDefault()}else if(o.key===z.ESC){t.clearPainterStyle();const n=e.getZone();n.isMainActive()||n.setZone(lt.MAIN),o.preventDefault()}else o.key===z.TAB&&Or(o,t)}function zi(o,t){var N;const e=t.getDraw();if(e.isReadonly()||e.isDisabled())return;const i=e.getPosition().getCursorPosition();if(!o||!i)return;const r=t.isComposing;if(r&&((N=t.compositionInfo)==null?void 0:N.value)===o)return;const s=e.getRange();if(!s.getIsCanInput())return;$i(t),r||e.getCursor().clearAgentDomValue();const{TEXT:l,HYPERLINK:R,SUBSCRIPT:a,SUPERSCRIPT:c,DATE:u}=F,d=o.replaceAll(` `,_),{startIndex:g,endIndex:L}=s.getRange(),O=e.getElementList(),M=Ke(O,L);if(!M)return;const P=e.isDesignMode(),T=qt(d).map(W=>{var Z,V;const p={value:W};if(P||!((Z=M.title)==null?void 0:Z.disabled)&&!((V=M.control)==null?void 0:V.disabled)){const m=O[L+1];(!M.type||M.type===l||M.type===R&&(m==null?void 0:m.type)===R||M.type===u&&(m==null?void 0:m.type)===u||M.type===a&&(m==null?void 0:m.type)===a||M.type===c&&(m==null?void 0:m.type)===c)&&Ro.forEach(Y=>{if(Y==="groupIds"&&!(m==null?void 0:m.groupIds))return;const Q=M[Y];Q!==void 0&&(p[Y]=Q)}),r&&(p.underline=!0)}return p}),X=e.getControl();let S;if(X.getActiveControl()&&X.getIsRangeWithinControl())S=X.setValue(T);else{const W=g+1;g!==L&&e.spliceElementList(O,W,L-g),Ht(O,T,g,{editorOptions:e.getOptions()}),e.spliceElementList(O,W,0,...T),S=g+T.length}~S&&(s.setRange(S,S),e.render({curIndex:S,isSubmitHistory:!r})),r&&(t.compositionInfo={elementList:O,value:d,startIndex:S-T.length,endIndex:S})}function $i(o){if(!o.compositionInfo)return;const{elementList:t,startIndex:e,endIndex:n}=o.compositionInfo;t.splice(e+1,n-e),o.getDraw().getRange().setRange(e,e),o.compositionInfo=null}function Tr(o){const t=o.getDraw(),e=t.getRange(),{startIndex:n,endIndex:i}=e.getRange();if(!~n&&!~n||t.isReadonly()||!e.getIsCanInput())return;const r=t.getElementList();let s=n,l=i;if(n===i){const d=t.getPosition().getPositionList(),g=d[n],L=g.rowNo,O=g.pageNo,M=[];for(let T=0;TO)break;X.pageNo===O&&X.rowNo===L&&M.push(T)}const P=M[0]-1;s=P<0?0:P,l=M[M.length-1]}const R=t.getOptions();Ji(r.slice(s+1,l+1),R);const a=t.getControl();let c;a.getActiveControl()&&a.getIsRangeWithinControl()?c=a.cut():(t.spliceElementList(r,s+1,l-s),c=s),e.setRange(c,c),t.render({curIndex:c})}function Sr(o){const t=o.getDraw(),{copy:e}=t.getOverride();if(e){const s=e();if((s==null?void 0:s.preventDefault)!==!1)return}const n=t.getRange();let i=null;if(n.getRange().isCrossRowCol){const s=n.getRangeTableElement();if(!s)return;const l=t.getTableParticle().getRangeRowCol();if(!l)return;const R={type:F.TABLE,value:"",colgroup:[],trList:[]},a=l[0],c=a[0].colIndex,u=a[a.length-1],d=u.colIndex+u.colspan-1;for(let g=c;g<=d;g++)R.colgroup.push(s.colgroup[g]);for(let g=0;g!g.type||g.type!==F.CONTROL&&ee.includes(g.type)?g.value:_).join(""))||"";if(!r)return null;const s=e.index,l=i.startIndex,a=new Intl.Segmenter(void 0,{granularity:"word"}).segment(r);let c=-1,u=-1;for(const{segment:g,index:L,isWordLike:O}of a){const M=L+l;if(O&&s>=M&&s0;){const g=c[u].value;if(R&&Yn.test(g)||!R&&r.test(g))s++,u--;else break}let d=i+1;for(;d0;){const O=r[R],M=r[R-1];if(O.value===_&&!O.listWrap||O.listId!==(M==null?void 0:M.listId)||O.titleId!==(M==null?void 0:M.titleId))break;s++,R--}let a=i+1;for(;ar.length-1)&&(d-=1),c.setRange(u,d),t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}var qi={dblclick:fr,threeClick:Ir};function mr(o){o.isComposing=!0}function pr(o,t){o.isComposing=!1;const e=o.getDraw();if(t.data)setTimeout(()=>{o.compositionInfo&&zi(t.data,o)},1);else{$i(o);const i=e.getRange(),{endIndex:r}=i.getRange();e.render({curIndex:r,isSubmitHistory:!1})}e.getCursor().clearAgentDomValue()}var ji={compositionstart:mr,compositionend:pr};function Wr(o,t){const e=t.getDraw();if(e.isReadonly())return;o.preventDefault();const i=e.getPageContainer();if(!Rn(o.target,T=>T===i,!0))return;const l=o.target.dataset.index;l&&e.setPageNo(Number(l));const R=e.getPosition(),a=R.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!a)return;const{isTable:c,tdValueIndex:u,index:d}=a,g=R.getPositionList(),L=c?u:d;~d&&(e.getRange().setRange(L,L),R.setCursorPosition(g[L]));const O=e.getCursor(),{cursor:{dragColor:M,dragWidth:P}}=e.getOptions();O.drawCursor({width:P,color:M,isBlink:!1})}var Vr={dragover:Wr};class Yr{constructor(t){h(this,"isAllowSelection");h(this,"isComposing");h(this,"compositionInfo");h(this,"isAllowDrag");h(this,"isAllowDrop");h(this,"cacheRange");h(this,"cacheElementList");h(this,"cachePositionList");h(this,"cachePositionContext");h(this,"mouseDownStartPosition");h(this,"draw");h(this,"pageContainer");h(this,"pageList");h(this,"range");h(this,"position");this.draw=t,this.pageContainer=t.getPageContainer(),this.pageList=t.getPageList(),this.range=this.draw.getRange(),this.position=this.draw.getPosition(),this.isAllowSelection=!1,this.isComposing=!1,this.compositionInfo=null,this.isAllowDrag=!1,this.isAllowDrop=!1,this.cacheRange=null,this.cacheElementList=null,this.cachePositionList=null,this.cachePositionContext=null,this.mouseDownStartPosition=null}getDraw(){return this.draw}register(){this.pageContainer.addEventListener("click",this.click.bind(this)),this.pageContainer.addEventListener("mousedown",this.mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this.mouseup.bind(this)),this.pageContainer.addEventListener("mouseleave",this.mouseleave.bind(this)),this.pageContainer.addEventListener("mousemove",this.mousemove.bind(this)),this.pageContainer.addEventListener("dblclick",this.dblclick.bind(this)),this.pageContainer.addEventListener("dragover",this.dragover.bind(this)),this.pageContainer.addEventListener("drop",this.drop.bind(this)),js(this.pageContainer,this.threeClick.bind(this))}setIsAllowSelection(t){this.isAllowSelection=t,t||this.applyPainterStyle()}setIsAllowDrag(t){this.isAllowDrag=t,this.isAllowDrop=t}clearPainterStyle(){this.pageList.forEach(t=>{t.style.cursor="text"}),this.draw.setPainterStyle(null)}applyPainterStyle(){const t=this.draw.getPainterStyle();if(!t||this.draw.isReadonly()||this.draw.isDisabled())return;const n=this.range.getSelection();if(!n)return;const i=Object.keys(t);n.forEach(s=>{i.forEach(l=>{const R=l;s[R]=t[R]})}),this.draw.render({isSetCursor:!1});const r=this.draw.getPainterOptions();(!r||!r.isDblclick)&&this.clearPainterStyle()}selectAll(){const t=this.position.getPositionList();this.range.setRange(0,t.length-1),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}mousemove(t){cr(t,this)}mousedown(t){lr(t,this)}click(){rr&&!this.draw.isReadonly()&&this.draw.getCursor().getAgentDom().focus()}mouseup(t){Rr(t,this)}mouseleave(t){ar(t,this)}keydown(t){Mr(t,this)}dblclick(t){qi.dblclick(this,t)}threeClick(){qi.threeClick(this)}input(t){zi(t,this)}cut(){Tr(this)}copy(){Sr(this)}compositionstart(){ji.compositionstart(this)}compositionend(t){ji.compositionend(this,t)}drop(t){Xr(t,this)}dragover(t){Vr.dragover(t,this)}}class Ur{constructor(t,e){h(this,"draw");h(this,"options");h(this,"cursor");h(this,"canvasEvent");h(this,"range");h(this,"previewer");h(this,"tableTool");h(this,"hyperlinkParticle");h(this,"control");h(this,"dateParticle");h(this,"imageParticle");h(this,"dprMediaQueryList");h(this,"clearSideEffect",t=>{if(!this.cursor)return;const e=(t==null?void 0:t.composedPath()[0])||t.target,n=this.draw.getPageList();if(Rn(e,s=>n.includes(s),!0)){this.setRangeStyle();return}if(Rn(e,s=>!!s&&s.nodeType===1&&!!s.getAttribute(le),!0)){this.setRangeStyle(),this.watchCursorActive();return}this.cursor.recoveryCursor(),this.range.recoveryRangeStyle(),this.previewer.clearResizer(),this.tableTool.dispose(),this.hyperlinkParticle.clearHyperlinkPopup(),this.control.destroyControl(),this.dateParticle.clearDatePicker(),this.imageParticle.destroyFloatImage()});h(this,"setCanvasEventAbility",()=>{this.canvasEvent.setIsAllowDrag(!1),this.canvasEvent.setIsAllowSelection(!1)});h(this,"setRangeStyle",()=>{this.range.setRangeStyle()});h(this,"setPageScale",t=>{if(!t.ctrlKey)return;t.preventDefault();const{scale:e}=this.options;if(t.deltaY<0){const n=e*10+1;n<=30&&this.draw.setPageScale(n/10)}else{const n=e*10-1;n>=5&&this.draw.setPageScale(n/10)}});h(this,"_handleVisibilityChange",()=>{if(document.visibilityState==="visible"){const t=this.range.getRange(),e=!!~t.startIndex&&!!~t.endIndex&&t.startIndex===t.endIndex;this.range.replaceRange(t),this.draw.render({isSetCursor:e,isCompute:!1,isSubmitHistory:!1,curIndex:t.startIndex})}});h(this,"_handleDprChange",()=>{this.draw.setPageDevicePixel()});this.draw=t,this.options=t.getOptions(),this.canvasEvent=e,this.cursor=null,this.range=t.getRange(),this.previewer=t.getPreviewer(),this.tableTool=t.getTableTool(),this.hyperlinkParticle=t.getHyperlinkParticle(),this.dateParticle=t.getDateParticle(),this.imageParticle=t.getImageParticle(),this.control=t.getControl(),this.dprMediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)}register(){this.cursor=this.draw.getCursor(),this.addEvent()}addEvent(){window.addEventListener("blur",this.clearSideEffect),document.addEventListener("keyup",this.setRangeStyle),document.addEventListener("click",this.clearSideEffect),document.addEventListener("mouseup",this.setCanvasEventAbility),document.addEventListener("wheel",this.setPageScale,{passive:!1}),document.addEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.addEventListener("change",this._handleDprChange)}removeEvent(){window.removeEventListener("blur",this.clearSideEffect),document.removeEventListener("keyup",this.setRangeStyle),document.removeEventListener("click",this.clearSideEffect),document.removeEventListener("mouseup",this.setCanvasEventAbility),document.removeEventListener("wheel",this.setPageScale),document.removeEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.removeEventListener("change",this._handleDprChange)}watchCursorActive(){!this.range.getIsCollapsed()||setTimeout(()=>{var t,e;((t=this.cursor)==null?void 0:t.getAgentIsActive())||(e=this.cursor)==null||e.drawCursor({isFocus:!1,isBlink:!1})})}}class Zr{constructor(t){h(this,"undoStack",[]);h(this,"redoStack",[]);h(this,"maxRecordCount");this.maxRecordCount=t.getOptions().historyMaxRecordCount+1}undo(){if(this.undoStack.length>1){const t=this.undoStack.pop();this.redoStack.push(t),this.undoStack.length&&this.undoStack[this.undoStack.length-1]()}}redo(){if(this.redoStack.length){const t=this.redoStack.pop();this.undoStack.push(t),t()}}execute(t){for(this.undoStack.push(t),this.redoStack.length&&(this.redoStack=[]);this.undoStack.length>this.maxRecordCount;)this.undoStack.shift()}isCanUndo(){return this.undoStack.length>1}isCanRedo(){return!!this.redoStack.length}isStackEmpty(){return!this.undoStack.length&&!this.redoStack.length}recovery(){this.undoStack=[],this.redoStack=[]}popUndo(){return this.undoStack.pop()}}class Qr{constructor(t){h(this,"cursorPosition");h(this,"positionContext");h(this,"positionList");h(this,"floatPositionList");h(this,"draw");h(this,"eventBus");h(this,"options");this.positionList=[],this.floatPositionList=[],this.cursorPosition=null,this.positionContext={isTable:!1,isControl:!1},this.draw=t,this.eventBus=t.getEventBus(),this.options=t.getOptions()}getFloatPositionList(){return this.floatPositionList}getTablePositionList(t){const{index:e,trIndex:n,tdIndex:i}=this.positionContext;return t[e].trList[n].tdList[i].positionList||[]}getPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalElementList()):this.getOriginalPositionList()}getMainPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalMainElementList()):this.positionList}getOriginalPositionList(){const t=this.draw.getZone();return t.isHeaderActive()?this.draw.getHeader().getPositionList():t.isFooterActive()?this.draw.getFooter().getPositionList():this.positionList}getOriginalMainPositionList(){return this.positionList}getSelectionPositionList(){const{startIndex:t,endIndex:e}=this.draw.getRange().getRange();return t===e?null:this.getPositionList().slice(t+1,e+1)}setPositionList(t){this.positionList=t}setFloatPositionList(t){this.floatPositionList=t}computePageRowPosition(t){const{positionList:e,rowList:n,pageNo:i,startX:r,startY:s,startRowIndex:l,startIndex:R,innerWidth:a,zone:c}=t,{scale:u,table:{tdPadding:d}}=this.options;let g=r,L=s,O=R;for(let M=0;Mq+st.height,0),G=(f.height-m)*u-w,v=f.verticalAlign===Vt.MIDDLE?G/2:G;Math.floor(v)>0&&f.positionList.forEach(q=>{const{coordinate:{leftTop:st,leftBottom:Yt,rightBottom:ot,rightTop:$}}=q;st[1]+=v,Yt[1]+=v,ot[1]+=v,$[1]+=v})}g=C.x,L=C.y}}g=T,L=X}}g=r,L+=P.height}return{x:g,y:L,index:O}}computePositionList(){var a;this.positionList=[];const t=this.draw.getInnerWidth(),e=this.draw.getPageRowList(),n=this.draw.getMargins(),i=n[3],s=this.draw.getHeader().getExtraHeight(),l=n[0]+s;let R=0;for(let c=0;cc)break;if(V[0]-p<=e&&m[0]>=e&&V[1]<=n&&Y[1]>=n){let Q=S;const U=r[S];if(U.type===F.TABLE)for(let E=0;ES.isLastLetter&&S.pageNo===c);for(let S=0;Sp[1]&&n<=Z[1]){const V=s.findIndex(U=>U.pageNo===c&&U.rowNo===W),m=r[V],Y=s[V],Q=m.listStyle===Gt.CHECKBOX?this.options.margins[3]:Y.coordinate.leftTop[0];if(eV)return{index:-1,zone:lt.FOOTER}}else if(n<=V&&n>=W)return{index:-1,zone:lt.MAIN};const m=this.draw.getMargins();if(n<=m[0])for(let Y=0;Y=U[0]&&e<=f[0]||((M=s[Y+1])==null?void 0:M.rowNo)!==0)return{index:Q.index}}else{const Y=L[L.length-1];if(Y){const Q=Y.rowNo;for(let U=0;U=E[0]&&e<=C[0]||((P=s[U+1])==null?void 0:P.rowNo)!==Q)return{index:f.index}}}}return{index:((T=L[L.length-1])==null?void 0:T.index)||s.length-1}}return{hitLineStartIndex:g,index:d,isControl:!!((X=r[d])==null?void 0:X.controlId)}}getFloatPositionByXY(t){var s;const{x:e,y:n}=t,i=(s=t.pageNo)!=null?s:this.draw.getPageNo(),r=this.draw.getZone().getZone();for(let l=0;l=P.x&&e<=P.x+a.width&&n>=P.y&&n<=P.y+a.height)return c?{index:u,isDirectHit:!0,isImage:!0,isTable:c,trIndex:d,tdIndex:g,tdValueIndex:L,tdId:a.tdId,trId:a.trId,tableId:a.tableId}:{index:R.index,isDirectHit:!0,isImage:!0}}}}adjustPositionContext(t){const e=this.getPositionByXY(t);if(!~e.index)return null;if(e.isControl&&this.draw.getMode()!==at.READONLY){const{index:O,isTable:M,trIndex:P,tdIndex:T,tdValueIndex:X}=e,S=this.draw.getControl(),{newIndex:N}=S.moveCursor({index:O,isTable:M,trIndex:P,tdIndex:T,tdValueIndex:X});M?e.tdValueIndex=N:e.index=N}const{index:n,isCheckbox:i,isRadio:r,isControl:s,isImage:l,isDirectHit:R,isTable:a,trIndex:c,tdIndex:u,tdId:d,trId:g,tableId:L}=e;return this.setPositionContext({isTable:a||!1,isCheckbox:i||!1,isRadio:r||!1,isControl:s||!1,isImage:l||!1,isDirectHit:R||!1,index:n,trIndex:c,tdIndex:u,tdId:d,trId:g,tableId:L}),e}setSurroundPosition(t){var c;const{pageNo:e,row:n,rowElement:i,rowElementRect:r,surroundElementList:s,availableWidth:l}=t;let R=r.x,a=0;if(s.length&&!Ee(i)&&!((c=i.control)==null?void 0:c.minWidth))for(let u=0;ul){i.left=0,n.width-=a;break}}}return{x:R,rowIncreaseWidth:a}}}class Dr{constructor(t){h(this,"draw");h(this,"options");h(this,"range");h(this,"listener");h(this,"eventBus");h(this,"position");h(this,"historyManager");this.draw=t,this.options=t.getOptions(),this.listener=t.getListener(),this.eventBus=t.getEventBus(),this.position=t.getPosition(),this.historyManager=t.getHistoryManager(),this.range={startIndex:-1,endIndex:-1}}getRange(){return this.range}clearRange(){this.setRange(-1,-1)}getIsCollapsed(){const{startIndex:t,endIndex:e}=this.range;return t===e}getIsSelection(){const{startIndex:t,endIndex:e}=this.range;return!~t&&!~e?!1:t!==e}getSelection(){const{startIndex:t,endIndex:e}=this.range;return t===e?null:this.draw.getElementList().slice(t+1,e+1)}getSelectionElementList(){if(this.range.isCrossRowCol){const t=this.draw.getTableParticle().getRangeRowCol();if(!t)return null;const e=[];for(let n=0;n!e.type||ee.includes(e.type)):null}getTextLikeSelectionElementList(){const t=this.getSelectionElementList();return t?t.filter(e=>!e.type||ee.includes(e.type)):null}getRangeRow(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;const n=this.position.getPositionList(),i=new Map;for(let r=t;r=0;){const{pageNo:a,rowNo:c}=n[s];let u=r.get(a);u||(u=[],r.set(a,u)),u.includes(c)||u.unshift(c);const d=i[s],g=i[s-1];if(d.value===_&&!d.listWrap||d.listId!==(g==null?void 0:g.listId)||d.titleId!==(g==null?void 0:g.titleId))break;s--}const l=t===e;if(!l){let a=t+1;for(;a=R[0]&&t<=a[0]&&e>=R[1]&&e<=a[1])return!0}return!1}getKeywordRangeList(t){const e=this.draw.getSearch().getMatchList(t,this.draw.getOriginalElementList()),n=new Map;for(const r of e){const s=n.get(r.groupId);if(s)s.endIndex+=1;else{const{type:l,groupId:R,tableId:a,index:c,tdIndex:u,trIndex:d}=r,g={startIndex:c,endIndex:c};l===Le.TABLE&&(g.tableId=a,g.startTdIndex=u,g.endTdIndex=u,g.startTrIndex=d,g.endTrIndex=d),n.set(R,g)}}const i=[];return n.forEach(r=>{i.push(r)}),i}getIsCanInput(){const{startIndex:t,endIndex:e}=this.getRange();if(!~t&&!~e)return!1;if(t===e)return!0;const n=this.draw.getElementList(),i=n[t],r=n[e];return!i.controlId&&!r.controlId||(!i.controlId||i.controlComponent===D.POSTFIX)&&(!r.controlId||r.controlComponent===D.POSTFIX)||!!i.controlId&&r.controlId===i.controlId&&r.controlComponent!==D.POSTFIX}setRange(t,e,n,i,r,s,l){this.range.startIndex=t,this.range.endIndex=e,this.range.tableId=n,this.range.startTdIndex=i,this.range.endTdIndex=r,this.range.startTrIndex=s,this.range.endTrIndex=l,this.range.isCrossRowCol=!!(i||r||s||l),this.range.zone=this.draw.getZone().getZone();const R=this.draw.getControl();if(~t&&~e){const c=this.draw.getElementList()[t];if(c==null?void 0:c.controlId){R.initControl();return}}R.destroyControl()}replaceRange(t){this.setRange(t.startIndex,t.endIndex,t.tableId,t.startTdIndex,t.endTdIndex,t.startTrIndex,t.endTrIndex)}setRangeStyle(){var f,E;const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const{startIndex:n,endIndex:i,isCrossRowCol:r}=this.range;if(!~n&&!~i)return;let s;if(r){const C=this.draw.getOriginalElementList(),w=this.position.getPositionContext();s=C[w.index]}else{const C=~i?i:0,w=this.draw.getElementList();s=Ke(w,C)}if(!s)return;const l=this.getSelection()||[s],R=s.type||F.TEXT,a=s.font||this.options.defaultFont,c=s.size||this.options.defaultSize,u=!~l.findIndex(C=>!C.bold),d=!~l.findIndex(C=>!C.italic),g=!~l.findIndex(C=>{var w;return!C.underline&&!((w=C.control)==null?void 0:w.underline)}),L=!~l.findIndex(C=>!C.strikeout),O=s.color||null,M=s.highlight||null,P=s.rowFlex||null,T=(f=s.rowMargin)!=null?f:this.options.defaultRowMargin,X=s.dashArray||[],S=s.level||null,N=s.listType||null,W=s.listStyle||null,p=g&&s.textDecoration||null,Z=!!this.draw.getPainterStyle(),V=this.historyManager.isCanUndo(),m=this.historyManager.isCanRedo(),Y=s.groupIds||null,Q=(E=s.extension)!=null?E:null,U={type:R,undo:V,redo:m,painter:Z,font:a,size:c,bold:u,italic:d,underline:g,strikeout:L,color:O,highlight:M,rowFlex:P,rowMargin:T,dashArray:X,level:S,listType:N,listStyle:W,groupIds:Y,textDecoration:p,extension:Q};t&&t(U),e&&this.eventBus.emit("rangeStyleChange",U)}recoveryRangeStyle(){const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const n=this.options.defaultFont,i=this.options.defaultSize,r=this.options.defaultRowMargin,s=!!this.draw.getPainterStyle(),l=this.historyManager.isCanUndo(),R=this.historyManager.isCanRedo(),a={type:null,undo:l,redo:R,painter:s,font:n,size:i,bold:!1,italic:!1,underline:!1,strikeout:!1,color:null,highlight:null,rowFlex:null,rowMargin:r,dashArray:[],level:null,listType:null,listStyle:null,groupIds:null,textDecoration:null,extension:null};t&&t(a),e&&this.eventBus.emit("rangeStyleChange",a)}shrinkBoundary(t={}){const e=t.elementList||this.draw.getElementList(),n=t.range||this.getRange(),{startIndex:i,endIndex:r}=n;if(!~i&&!~r)return;const s=e[i],l=e[r];if(i===r){if(s.controlComponent===D.PLACEHOLDER){let R=i-1;for(;R>0;){const a=e[R];if(a.controlId!==s.controlId||a.controlComponent===D.PREFIX){n.startIndex=R,n.endIndex=R;break}R--}}}else{if(s.controlComponent===D.PLACEHOLDER||l.controlComponent===D.PLACEHOLDER){let R=r-1;for(;R>0;){const a=e[R];if(a.controlId!==l.controlId||a.controlComponent===D.PREFIX){n.startIndex=R,n.endIndex=R;return}R--}}if(s.controlComponent===D.PREFIX){let R=i+1;for(;R0;){const a=e[R];if(a.controlId!==s.controlId||a.controlComponent===D.VALUE){n.startIndex=R;break}else if(a.controlComponent===D.PLACEHOLDER){n.startIndex=R,n.endIndex=R;return}R--}}}}render(t,e,n,i,r){t.save(),t.globalAlpha=this.options.rangeAlpha,t.fillStyle=this.options.rangeColor,t.fillRect(e,n,i,r),t.restore()}toString(){const t=this.getTextLikeSelection();return t?t.map(e=>e.value).join("").replace(new RegExp(_,"g"),""):""}}class Kr{constructor(t){h(this,"draw");h(this,"options");h(this,"imageCache");this.draw=t,this.options=t.getOptions(),this.imageCache=new Map}_renderBackgroundColor(t,e,n,i){t.save(),t.fillStyle=e,t.fillRect(0,0,n,i),t.restore()}_drawImage(t,e,n,i){const{background:r,scale:s}=this.options;if(r.size===Ln.CONTAIN){const l=e.width*s,R=e.height*s;if(!r.repeat||r.repeat===Ne.NO_REPEAT)t.drawImage(e,0,0,l,R);else{let a=0,c=0;const u=r.repeat===Ne.REPEAT||r.repeat===Ne.REPEAT_X?Math.ceil(n*s/l):1,d=r.repeat===Ne.REPEAT||r.repeat===Ne.REPEAT_Y?Math.ceil(i*s/R):1;for(let g=0;g{this.imageCache.set(i.image,s),this._drawImage(t,s,e,n),this.draw.render({isCompute:!1,isSubmitHistory:!1})}}}render(t,e){const{background:{image:n,color:i,applyPageNumbers:r}}=this.options;if(n&&(!(r==null?void 0:r.length)||r.includes(e))){const{width:s,height:l}=this.options;this._renderBackgroundImage(t,s,l)}else{const s=this.draw.getCanvasWidth(e),l=this.draw.getCanvasHeight(e);this._renderBackgroundColor(t,i,s,l)}}}class qn{constructor(){h(this,"fillRect");h(this,"fillColor");h(this,"fillDecorationStyle");this.fillRect=this.clearFillInfo()}clearFillInfo(){return this.fillColor=void 0,this.fillDecorationStyle=void 0,this.fillRect={x:0,y:0,width:0,height:0},this.fillRect}recordFillInfo(t,e,n,i,r,s,l){const R=!this.fillRect.width;if(!R&&(this.fillColor!==s||this.fillDecorationStyle!==l)){this.render(t),this.clearFillInfo(),this.recordFillInfo(t,e,n,i,r,s,l);return}R&&(this.fillRect.x=e,this.fillRect.y=n),r&&this.fillRect.height=0;){const i=this.searchMatchList[t];if(n!==i.groupId){e=!0,this.searchNavigateIndex=t-(this.searchKeyword.length-1);break}t--}if(!e){if(this.searchMatchList[this.searchMatchList.length-1].groupId===n)return null;this.searchNavigateIndex=this.searchMatchList.length-1-(this.searchKeyword.length-1)}}return this.searchNavigateIndex}searchNavigateNext(){if(!this.searchMatchList.length||!this.searchKeyword)return null;if(this.searchNavigateIndex===null)this.searchNavigateIndex=0;else{let t=this.searchNavigateIndex+1,e=!1;const n=this.searchMatchList[this.searchNavigateIndex].groupId;for(;tt+e)}getSearchMatchList(){return this.searchMatchList}getSearchNavigateInfo(){if(!this.searchKeyword||!this.searchMatchList.length)return null;const t=this.searchNavigateIndex!==null?this.searchNavigateIndex/this.searchKeyword.length+1:0;let e=0,n=null;for(let i=0;i!T.type||ee.includes(T.type)&&T.controlComponent!==D.CHECKBOX?T.value:_).filter(Boolean).join("").toLocaleLowerCase(),M=[];let P=O.indexOf(u);for(;P!==-1;)M.push(P),P=O.indexOf(u,P+u.length);for(let T=0;T{const{intersectionPageNo:t,visiblePageNoList:e}=this.getPageVisibleInfo();this.draw.setIntersectionPageNo(t),this.draw.setVisiblePageNoList(e)},150));this.draw=t,this.options=t.getOptions(),this.scrollContainer=this.getScrollContainer(),setTimeout(()=>{window.scrollY||this._observer()}),this._addEvent()}getScrollContainer(){return this.options.scrollContainerSelector&&document.querySelector(this.options.scrollContainerSelector)||document}_addEvent(){this.scrollContainer.addEventListener("scroll",this._observer)}removeEvent(){this.scrollContainer.removeEventListener("scroll",this._observer)}getElementVisibleInfo(t){const e=t.getBoundingClientRect(),n=this.scrollContainer===document?Math.max(document.documentElement.clientHeight,window.innerHeight):this.scrollContainer.clientHeight,i=Math.min(e.bottom,n)-Math.max(e.top,0);return{intersectionHeight:i>0?i:0}}getPageVisibleInfo(){const t=this.draw.getPageList(),e=[];let n=0,i=0;for(let r=0;ri&&(i=l,n=r)}return{intersectionPageNo:n,visiblePageNoList:e}}}class Jr{constructor(t){h(this,"step",5);h(this,"thresholdPoints",[70,40,10,20]);h(this,"selectionContainer");h(this,"rangeManager");h(this,"requestAnimationFrameId");h(this,"isMousedown");h(this,"isMoving");h(this,"clientWidth");h(this,"clientHeight");h(this,"containerRect");h(this,"_mousedown",()=>{if(this.isMousedown=!0,this.clientWidth=this.selectionContainer instanceof Document?document.documentElement.clientWidth:this.selectionContainer.clientWidth,this.clientHeight=this.selectionContainer instanceof Document?document.documentElement.clientHeight:this.selectionContainer.clientHeight,!(this.selectionContainer instanceof Document)){const t=this.selectionContainer.getBoundingClientRect();this.containerRect=t}});h(this,"_mouseup",()=>{this.isMousedown=!1,this._stopMove()});h(this,"_mousemove",t=>{if(!this.isMousedown||this.rangeManager.getIsCollapsed())return;let{x:e,y:n}=t;this.containerRect&&(e=e-this.containerRect.x,n=n-this.containerRect.y),n=0;s--){const l=r.tdList[s],{rowspan:R,rowIndex:a,colIndex:c}=l,u=a+R-1;if(u!==s){const d=r.tdList.splice(s,1)[0];(n=e[u])==null||n.tdList.splice(c,0,d)}}}return e}getRangeRowCol(){const{isTable:t,index:e,trIndex:n,tdIndex:i}=this.draw.getPosition().getPositionContext();if(!t)return null;const{isCrossRowCol:r,startTdIndex:s,endTdIndex:l,startTrIndex:R,endTrIndex:a}=this.range.getRange(),d=this.draw.getOriginalElementList()[e].trList;if(!r)return[[d[n].tdList[i]]];let g=d[R].tdList[s],L=d[a].tdList[l];(g.x>L.x||g.y>L.y)&&([g,L]=[L,g]);const O=g.colIndex,M=L.colIndex+(L.colspan-1),P=g.rowIndex,T=L.rowIndex+(L.rowspan-1),X=[];for(let S=0;S=O&&V<=M&&m>=P&&m<=T&&W.push(Z)}W.length&&X.push(W)}return X.length?X:null}_drawOuterBorder(t){const{ctx:e,startX:n,startY:i,width:r,height:s,isDrawFullBorder:l}=t;e.beginPath();const R=Math.round(n),a=Math.round(i);e.translate(.5,.5),l?e.rect(R,a,r,s):(e.moveTo(R,a+s),e.lineTo(R,a),e.lineTo(R+r,a)),e.stroke(),e.translate(-.5,-.5)}_drawSlash(t,e,n,i){var c,u;const{scale:r}=this.options;t.save();const s=e.width*r,l=e.height*r,R=Math.round(e.x*r+n),a=Math.round(e.y*r+i);((c=e.slashTypes)==null?void 0:c.includes(Ce.FORWARD))&&(t.moveTo(R+s,a),t.lineTo(R,a+l)),((u=e.slashTypes)==null?void 0:u.includes(Ce.BACK))&&(t.moveTo(R,a),t.lineTo(R+s,a+l)),t.stroke(),t.restore()}_drawBorder(t,e,n,i){var L,O,M,P,T,X;const{colgroup:r,trList:s,borderType:l}=e;if(!r||!s)return;const{scale:R}=this.options,a=e.width*R,c=e.height*R,u=l===Jt.EMPTY,d=l===Jt.EXTERNAL,g=l===Jt.INTERNAL;t.save(),l===Jt.DASH&&t.setLineDash([3,3]),t.lineWidth=R,!u&&!g&&this._drawOuterBorder({ctx:t,startX:n,startY:i,width:a,height:c,isDrawFullBorder:d});for(let S=0;Se+n.width,0)}getTableHeight(t){const e=t.trList;return(e==null?void 0:e.length)?this.getTdListByColIndex(e,0).reduce((n,i)=>n+i.height,0):0}getRowCountByColIndex(t,e){return this.getTdListByColIndex(t,e).reduce((n,i)=>n+i.rowspan,0)}getTdListByColIndex(t,e){const n=[];for(let i=0;i=R&&e<=a&&n.push(l)}}return n}getTdListByRowIndex(t,e){const n=[];for(let i=0;i=R&&e<=a&&n.push(l)}}return n}computeRowColInfo(t){const{colgroup:e,trList:n}=t;if(!e||!n)return;let i=0;for(let r=0;r1&&r!==0){const P=s.tdList[R-1],T=P?P.colIndex+P.colspan:R;for(let X=T;X1){const P=n.length-1-r;L=a.rowspan-1===P}const O=l&&g;a.isLastRowTd=g,a.isLastColTd=L,a.isLastTd=O,a.x=i;let M=0;for(let P=0;P=S.colIndex&&cM.x||O.y>M.y)&&([O,M]=[M,O]);const P=O.colIndex,T=M.colIndex+(M.colspan-1),X=O.rowIndex,S=M.rowIndex+(M.rowspan-1);t.save();for(let N=0;N=P&&V<=T&&m>=X&&m<=S){const Y=Z.x*r,Q=Z.y*r,U=Z.width*r,f=Z.height*r;t.globalAlpha=s,t.fillStyle=l,t.fillRect(Y+n,Q+i,U,f)}}}t.restore()}render(t,e,n,i){this._drawBackgroundColor(t,e,n,i),this._drawBorder(t,e,n,i)}}var Oe;(function(o){o.ROW="row",o.COL="col"})(Oe||(Oe={}));class Br{constructor(t){h(this,"MIN_TD_WIDTH",20);h(this,"ROW_COL_OFFSET",18);h(this,"ROW_COL_QUICK_WIDTH",16);h(this,"ROW_COL_QUICK_OFFSET",5);h(this,"ROW_COL_QUICK_POSITION",this.ROW_COL_OFFSET+(this.ROW_COL_OFFSET-this.ROW_COL_QUICK_WIDTH)/2);h(this,"BORDER_VALUE",4);h(this,"TABLE_SELECT_OFFSET",20);h(this,"draw");h(this,"canvas");h(this,"options");h(this,"position");h(this,"range");h(this,"container");h(this,"toolRowContainer");h(this,"toolRowAddBtn");h(this,"toolColAddBtn");h(this,"toolTableSelectBtn");h(this,"toolColContainer");h(this,"toolBorderContainer");h(this,"anchorLine");h(this,"mousedownX");h(this,"mousedownY");this.draw=t,this.canvas=t.getPage(),this.options=t.getOptions(),this.position=t.getPosition(),this.range=t.getRange(),this.container=t.getContainer(),this.toolRowContainer=null,this.toolRowAddBtn=null,this.toolColAddBtn=null,this.toolTableSelectBtn=null,this.toolColContainer=null,this.toolBorderContainer=null,this.anchorLine=null,this.mousedownX=0,this.mousedownY=0}dispose(){var t,e,n,i,r,s;(t=this.toolRowContainer)==null||t.remove(),(e=this.toolRowAddBtn)==null||e.remove(),(n=this.toolColAddBtn)==null||n.remove(),(i=this.toolTableSelectBtn)==null||i.remove(),(r=this.toolColContainer)==null||r.remove(),(s=this.toolBorderContainer)==null||s.remove(),this.toolRowContainer=null,this.toolRowAddBtn=null,this.toolColAddBtn=null,this.toolTableSelectBtn=null,this.toolColContainer=null,this.toolBorderContainer=null}render(){const{isTable:t,index:e,trIndex:n,tdIndex:i}=this.position.getPositionContext();if(!t)return;this.dispose();const{scale:r}=this.options,s=this.draw.getOriginalElementList(),l=this.position.getOriginalPositionList(),R=s[e],a=l[e],{colgroup:c,trList:u}=R,{coordinate:{leftTop:d}}=a,g=this.draw.getHeight(),L=this.draw.getPageGap(),O=this.draw.getPageNo()*(g+L),M=d[0],P=d[1]+O,T=R.trList[n].tdList[i],X=T.rowIndex,S=T.colIndex,N=R.height*r,W=R.width*r,p=document.createElement("div");p.classList.add(`${k}-table-tool__select`),p.style.height=`${N*r}`,p.style.left=`${M}px`,p.style.top=`${P}px`,p.style.transform=`translate(-${this.TABLE_SELECT_OFFSET*r}px, ${-this.TABLE_SELECT_OFFSET*r}px)`,p.onclick=()=>{this.draw.getTableOperate().tableSelectAll()},this.container.append(p),this.toolTableSelectBtn=p;const Z=u.map(E=>E.height),V=document.createElement("div");V.classList.add(`${k}-table-tool__row`),V.style.transform=`translateX(-${this.ROW_COL_OFFSET*r}px)`;for(let E=0;E{const v=this.draw.getTableParticle().getTdListByRowIndex(u,E),q=v[0],st=v[v.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:q.trIndex,tdIndex:q.tdIndex,tableId:R.id}),this.range.setRange(0,0,R.id,q.tdIndex,st.tdIndex,q.trIndex,st.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(V,E)};const G=document.createElement("div");G.classList.add(`${k}-table-tool__anchor`),G.onmousedown=v=>{this._mousedown({evt:v,element:R,index:E,order:Oe.ROW})},w.append(G),w.style.height=`${C}px`,V.append(w)}V.style.left=`${M}px`,V.style.top=`${P}px`,this.container.append(V),this.toolRowContainer=V;const m=document.createElement("div");m.classList.add(`${k}-table-tool__quick__add`),m.style.height=`${N*r}`,m.style.left=`${M}px`,m.style.top=`${P+N}px`,m.style.transform=`translate(-${this.ROW_COL_QUICK_POSITION*r}px, ${this.ROW_COL_QUICK_OFFSET*r}px)`,m.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:u.length-1,tdIndex:0,tableId:R.id}),this.draw.getTableOperate().insertTableBottomRow()},this.container.append(m),this.toolRowAddBtn=m;const Y=c.map(E=>E.width),Q=document.createElement("div");Q.classList.add(`${k}-table-tool__col`),Q.style.transform=`translateY(-${this.ROW_COL_OFFSET*r}px)`;for(let E=0;E{const v=this.draw.getTableParticle().getTdListByColIndex(u,E),q=v[0],st=v[v.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:q.trIndex,tdIndex:q.tdIndex,tableId:R.id}),this.range.setRange(0,0,R.id,q.tdIndex,st.tdIndex,q.trIndex,st.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(Q,E)};const G=document.createElement("div");G.classList.add(`${k}-table-tool__anchor`),G.onmousedown=v=>{this._mousedown({evt:v,element:R,index:E,order:Oe.COL})},w.append(G),w.style.width=`${C}px`,Q.append(w)}Q.style.left=`${M}px`,Q.style.top=`${P}px`,this.container.append(Q),this.toolColContainer=Q;const U=document.createElement("div");U.classList.add(`${k}-table-tool__quick__add`),U.style.height=`${N*r}`,U.style.left=`${M+W}px`,U.style.top=`${P}px`,U.style.transform=`translate(${this.ROW_COL_QUICK_OFFSET*r}px, -${this.ROW_COL_QUICK_POSITION*r}px)`,U.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:0,tdIndex:u[0].tdList.length-1||0,tableId:R.id}),this.draw.getTableOperate().insertTableRightCol()},this.container.append(U),this.toolColAddBtn=U;const f=document.createElement("div");f.classList.add(`${k}-table-tool__border`),f.style.height=`${N}px`,f.style.width=`${W}px`,f.style.left=`${M}px`,f.style.top=`${P}px`;for(let E=0;E{this._mousedown({evt:st,element:R,index:G.rowIndex+G.rowspan-1,order:Oe.ROW})},f.appendChild(v);const q=document.createElement("div");q.classList.add(`${k}-table-tool__border__col`),q.style.width=`${this.BORDER_VALUE}px`,q.style.height=`${G.height*r}px`,q.style.top=`${G.y*r}px`,q.style.left=`${(G.x+G.width)*r-this.BORDER_VALUE/2}px`,q.onmousedown=st=>{this._mousedown({evt:st,element:R,index:G.colIndex+G.colspan-1,order:Oe.COL})},f.appendChild(q)}}this.container.append(f),this.toolBorderContainer=f}_setAnchorActive(t,e){const n=t.children;for(let i=0;i{const N=this._mousemove(S,i,L,O);N&&(P=N.dx,T=N.dy)};document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{var N;let S=!1;if(i===Oe.ROW){const W=r.trList,p=W[n]||W[n-1],{defaultTrMinHeight:Z}=this.options.table;T<0&&p.height+T0&&V&&V-Pp){const Q=r.width;P=p-Q}}P&&(W.length-1!==n&&(W[n+1].width-=P/s),W[n].width+=P/s,S=!0)}}S&&this.draw.render({isSetCursor:!1}),M.remove(),document.removeEventListener("mousemove",X),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),e.preventDefault()}_mousemove(t,e,n,i){if(!this.anchorLine)return null;const r=t.x-this.mousedownX,s=t.y-this.mousedownY;return e===Oe.ROW?this.anchorLine.style.top=`${i+s}px`:this.anchorLine.style.left=`${n+r}px`,t.preventDefault(),{dx:r,dy:s}}}class Ar{constructor(t){h(this,"draw");h(this,"options");h(this,"container");h(this,"hyperlinkPopupContainer");h(this,"hyperlinkDom");this.draw=t,this.options=t.getOptions(),this.container=t.getContainer();const{hyperlinkPopupContainer:e,hyperlinkDom:n}=this._createHyperlinkPopupDom();this.hyperlinkDom=n,this.hyperlinkPopupContainer=e}_createHyperlinkPopupDom(){const t=document.createElement("div");t.classList.add(`${k}-hyperlink-popup`);const e=document.createElement("a");return e.target="_blank",e.rel="noopener",t.append(e),this.container.append(t),{hyperlinkPopupContainer:t,hyperlinkDom:e}}drawHyperlinkPopup(t,e){const{coordinate:{leftTop:[n,i]},lineHeight:r}=e,s=this.draw.getHeight(),l=this.draw.getPageGap(),R=this.draw.getPageNo()*(s+l);this.hyperlinkPopupContainer.style.display="block",this.hyperlinkPopupContainer.style.left=`${n}px`,this.hyperlinkPopupContainer.style.top=`${i+R+r}px`;const a=t.url||"#";this.hyperlinkDom.href=a,this.hyperlinkDom.title=a,this.hyperlinkDom.innerText=a}clearHyperlinkPopup(){this.hyperlinkPopupContainer.style.display="none"}openHyperlink(t){const e=window.open(t.url,"_blank");e&&(e.opener=null)}render(t,e,n,i){t.save(),t.font=e.style,e.color||(e.color=this.options.defaultHyperlinkColor),t.fillStyle=e.color,e.underline===void 0&&(e.underline=!0),t.fillText(e.value,n,i),t.restore()}}class _r{constructor(t,e){h(this,"draw");h(this,"position");h(this,"options");h(this,"elementList");h(this,"rowList");h(this,"positionList");this.draw=t,this.position=t.getPosition(),this.options=t.getOptions(),this.elementList=e||[],this.rowList=[],this.positionList=[]}getRowList(){return this.rowList}setElementList(t){this.elementList=t}getElementList(){return this.elementList}getPositionList(){return this.positionList}compute(){this.recovery(),this._computeRowList(),this._computePositionList()}recovery(){this.rowList=[],this.positionList=[]}_computeRowList(){const t=this.draw.getInnerWidth(),e=this.draw.getMargins(),n=Hi(this.elementList);this.rowList=this.draw.computeRowList({startX:e[3],startY:this.getHeaderTop(),innerWidth:t,elementList:this.elementList,surroundElementList:n})}_computePositionList(){const t=this.getHeaderTop(),e=this.draw.getInnerWidth(),i=this.draw.getMargins()[3],r=t;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:r,innerWidth:e,zone:lt.HEADER})}getHeaderTop(){const{header:{top:t,disabled:e},scale:n}=this.options;return e?0:Math.floor(t*n)}getMaxHeight(){const{header:{maxHeightRadio:t}}=this.options,e=this.draw.getHeight();return Math.floor(e*Ii[t])}getHeight(){const t=this.getMaxHeight(),e=this.getRowHeight();return e>t?t:e}getRowHeight(){return this.rowList.reduce((t,e)=>t+e.height,0)}getExtraHeight(){const t=this.draw.getMargins(),e=this.getHeight(),i=this.getHeaderTop()+e-t[0];return i<=0?0:i}render(t,e){t.globalAlpha=1;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),r=[];let s=0;for(let l=0;li)break;r.push(R),s+=R.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:r,pageNo:e,startIndex:0,innerWidth:n,zone:lt.HEADER})}}class kr{getOffsetY(t){return-t.metrics.height/2}render(t,e,n,i){t.save(),t.font=e.style,e.color&&(t.fillStyle=e.color),t.fillText(e.value,n,i+this.getOffsetY(e)),t.restore()}}class zr{getOffsetY(t){return t.metrics.height/2}render(t,e,n,i){t.save(),t.font=e.style,e.color&&(t.fillStyle=e.color),t.fillText(e.value,n,i+this.getOffsetY(e)),t.restore()}}class $r{constructor(t){h(this,"options");this.options=t.getOptions()}render(t,e,n,i){var a;t.save();const{scale:r,separator:{lineWidth:s,strokeStyle:l}}=this.options;t.lineWidth=s*r,t.strokeStyle=e.color||l,((a=e.dashArray)==null?void 0:a.length)&&t.setLineDash(e.dashArray);const R=Math.round(i);t.translate(0,t.lineWidth/2),t.beginPath(),t.moveTo(n,R),t.lineTo(n+e.width*r,R),t.stroke(),t.restore()}}class qr{constructor(t){h(this,"draw");h(this,"options");h(this,"i18n");this.draw=t,this.options=t.getOptions(),this.i18n=t.getI18n()}render(t,e,n,i){const{pageBreak:{font:r,fontSize:s,lineDash:l}}=this.options,R=this.i18n.t("pageBreak.displayName"),{scale:a,defaultRowMargin:c}=this.options,u=s*a,d=e.width*a,g=this.draw.getDefaultBasicRowMarginHeight()*c;t.save(),t.font=`${u}px ${r}`;const L=t.measureText(R),O=(d-L.width)/2;t.setLineDash(l),t.translate(0,.5+g),t.beginPath(),t.moveTo(n,i),t.lineTo(n+O,i),t.moveTo(n+O+L.width,i),t.lineTo(n+d,i),t.stroke(),t.fillText(R,n+O,i+L.actualBoundingBoxAscent-u/2),t.restore()}}class jr{constructor(t){h(this,"draw");h(this,"options");this.draw=t,this.options=t.getOptions()}render(t){const{watermark:{data:e,opacity:n,font:i,size:r,color:s,repeat:l,gap:R},scale:a}=this.options,c=this.draw.getWidth(),u=this.draw.getHeight();t.save(),t.globalAlpha=n,t.font=`${r*a}px ${i}`;const d=t.measureText(e);if(l){const g=this.draw.getPagePixelRatio(),L=document.createElement("canvas"),O=L.getContext("2d"),M=d.width,P=d.actualBoundingBoxAscent+d.actualBoundingBoxDescent,T=Math.sqrt(Math.pow(M,2)+Math.pow(P,2)),X=T+2*R[0]*a,S=T+2*R[1]*a;L.width=X,L.height=S,L.style.width=`${X*g}px`,L.style.height=`${S*g}px`,O.translate(X/2,S/2),O.rotate(-45*Math.PI/180),O.translate(-X/2,-S/2),O.font=`${r*a}px ${i}`,O.fillStyle=s,O.fillText(e,(X-M)/2,(S-P)/2+d.actualBoundingBoxAscent);const N=t.createPattern(L,"repeat");N&&(t.fillStyle=N,t.fillRect(0,0,c,u))}else{const g=c/2,L=u/2;t.fillStyle=s,t.translate(g,L),t.rotate(-45*Math.PI/180),t.fillText(e,-d.width/2,d.actualBoundingBoxAscent-r/2)}t.restore()}}class tl{constructor(t){h(this,"draw");h(this,"options");h(this,"highlightList");h(this,"highlightMatchResult");this.draw=t.getDraw(),this.options=this.draw.getOptions(),this.highlightList=[],this.highlightMatchResult=[]}getHighlightMatchResult(){return this.highlightMatchResult}getHighlightList(){return this.highlightList}setHighlightList(t){this.highlightList=t}computeHighlightList(){const t=this.draw.getSearch(),e=(n,i)=>{let r=0;for(;rL.id===s.controlId||l.conceptId&&l.conceptId===L.conceptId);if(!~R)continue;const a=r;let c=r;for(;cL.controlComponent===D.VALUE?L:{value:_}),d=this.highlightList[R],{ruleList:g}=d;for(let L=0;Ltt(b(b(b({},P),O),i),{index:P.index+a})))}}};this.highlightMatchResult=[],e(this.draw.getOriginalMainElementList())}renderHighlightList(t,e){var l,R,a;if(!((l=this.highlightMatchResult)==null?void 0:l.length))return;const{searchMatchAlpha:n,searchMatchColor:i}=this.options,r=this.draw.getPosition().getOriginalPositionList(),s=this.draw.getOriginalElementList();t.save();for(let c=0;c0;){const R=e[s];if(R.controlId!==i.controlId||R.controlComponent===D.PREFIX)break;R.controlComponent===D.VALUE&&r.unshift(R),s--}let l=n+1;for(;l0;){const g=r[c];if(g.controlId!==l.controlId||g.controlComponent===D.PREFIX){R=c;break}c--}let u=s+1;for(;uP.code===t);if(!a)return;const c=this.getValue(e)[0],u=c?te(c,Se):te(i[r.startIndex],Xe),d=this.clearSelect(e,{isAddPlaceholder:!1});if(!~d)return;l||this.control.removePlaceholder(d,e);const g=Te(i[d],Se),L=d+1,O=qt(a.value),M=this.control.getDraw();for(let P=0;P{this.setSelect(d.code)},g.append(document.createTextNode(d.value)),r.append(g)}i.append(r);const{coordinate:{leftTop:[s,l]},lineHeight:R}=n,a=this.control.getPreY();i.style.left=`${s}px`,i.style.top=`${l+a+R}px`,this.control.getContainer().append(i),this.selectDom=i}awake(){var n;if(this.isPopup||this.control.getIsDisabledControl())return;const{startIndex:t}=this.control.getRange();((n=this.control.getElementList()[t+1])==null?void 0:n.controlId)===this.element.controlId&&(this._createSelectPopupDom(),this.isPopup=!0)}destroy(){var t;!this.isPopup||((t=this.selectDom)==null||t.remove(),this.isPopup=!1)}}class ts{constructor(t,e){h(this,"element");h(this,"control");h(this,"options");this.options=e.getDraw().getOptions(),this.element=t,this.control=e}setElement(t){this.element=t}getElement(){return this.element}getValue(t={}){const e=t.elementList||this.control.getElementList(),{startIndex:n}=t.range||this.control.getRange(),i=e[n],r=[];let s=n;for(;s>0;){const R=e[s];if(R.controlId!==i.controlId||R.controlComponent===D.PREFIX)break;R.controlComponent===D.VALUE&&r.unshift(R),s--}let l=n+1;for(;l";const R=document.createElement("span");R.classList.add(`${k}-date-title__next-year`),R.innerText=">>",n.append(i),n.append(r),n.append(s),n.append(l),n.append(R);const a=document.createElement("div");a.classList.add(`${k}-date-week`);const{weeks:{sun:c,mon:u,tue:d,wed:g,thu:L,fri:O,sat:M}}=this.lang;[c,u,d,g,L,O,M].forEach(Q=>{const U=document.createElement("span");U.innerText=`${Q}`,a.append(U)});const T=document.createElement("div");T.classList.add(`${k}-date-day`),e.append(n),e.append(a),e.append(T);const X=document.createElement("ul");X.classList.add(`${k}-time-wrap`);let S,N,W;[this.lang.hour,this.lang.minute,this.lang.second].forEach((Q,U)=>{const f=document.createElement("li"),E=document.createElement("span");E.innerText=Q,f.append(E);const C=document.createElement("ol"),w=U===0,G=U===1,v=w?24:60;for(let q=0;q{this._preYear()},this.dom.title.preMonth.onclick=()=>{this._preMonth()},this.dom.title.nextMonth.onclick=()=>{this._nextMonth()},this.dom.title.nextYear.onclick=()=>{this._nextYear()},this.dom.menu.time.onclick=()=>{this.isDatePicker=!this.isDatePicker,this._toggleDateTimePicker()},this.dom.menu.now.onclick=()=>{this._now(),this._submit()},this.dom.menu.submit.onclick=()=>{this.dispose(),this._submit()},this.dom.time.hour.onclick=t=>{if(!this.pickDate)return;const n=t.target.dataset.id;!n||(this.pickDate.setHours(Number(n)),this._setTimePick(!1))},this.dom.time.minute.onclick=t=>{if(!this.pickDate)return;const n=t.target.dataset.id;!n||(this.pickDate.setMinutes(Number(n)),this._setTimePick(!1))},this.dom.time.second.onclick=t=>{if(!this.pickDate)return;const n=t.target.dataset.id;!n||(this.pickDate.setSeconds(Number(n)),this._setTimePick(!1))}}_setPosition(){if(!this.renderOptions)return;const{position:{coordinate:{leftTop:[t,e]},lineHeight:n,pageNo:i}}=this.renderOptions,r=this.draw.getHeight(),s=this.draw.getPageGap(),R=(i!=null?i:this.draw.getPageNo())*(r+s);this.dom.container.style.left=`${t}px`,this.dom.container.style.top=`${e+R+n}px`}isInvalidDate(t){return t.toDateString()==="Invalid Date"}_setValue(){var e;const t=(e=this.renderOptions)==null?void 0:e.value;if(t){const n=new Date(t);this.now=this.isInvalidDate(n)?new Date:n}else this.now=new Date;this.pickDate=new Date(this.now)}_getLang(){const t=this.draw.getI18n(),e=t.t.bind(t);return{now:e("datePicker.now"),confirm:e("datePicker.confirm"),return:e("datePicker.return"),timeSelect:e("datePicker.timeSelect"),weeks:{sun:e("datePicker.weeks.sun"),mon:e("datePicker.weeks.mon"),tue:e("datePicker.weeks.tue"),wed:e("datePicker.weeks.wed"),thu:e("datePicker.weeks.thu"),fri:e("datePicker.weeks.fri"),sat:e("datePicker.weeks.sat")},year:e("datePicker.year"),month:e("datePicker.month"),hour:e("datePicker.hour"),minute:e("datePicker.minute"),second:e("datePicker.second")}}_setLangChange(){this.dom.menu.time.innerText=this.lang.timeSelect,this.dom.menu.now.innerText=this.lang.now,this.dom.menu.submit.innerText=this.lang.confirm;const{weeks:{sun:t,mon:e,tue:n,wed:i,thu:r,fri:s,sat:l}}=this.lang,R=[t,e,n,i,r,s,l];this.dom.datePickerWeek.childNodes.forEach((d,g)=>{const L=d;L.innerText=R[g]});const a=this.dom.time.hour.previousElementSibling;a.innerText=this.lang.hour;const c=this.dom.time.minute.previousElementSibling;c.innerText=this.lang.minute;const u=this.dom.time.second.previousElementSibling;u.innerText=this.lang.second}_update(){const t=new Date,e=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();let r=null,s=null,l=null;this.pickDate&&(r=this.pickDate.getFullYear(),s=this.pickDate.getMonth()+1,l=this.pickDate.getDate());const R=this.now.getFullYear(),a=this.now.getMonth()+1;this.dom.title.now.innerText=`${R}${this.lang.year} ${String(a).padStart(2,"0")}${this.lang.month}`;const u=new Date(R,a,0).getDate();let d=new Date(R,a-1,1).getDay();d===0&&(d=7);const g=new Date(R,a-1,0).getDate();this.dom.day.innerHTML="";const L=g-d+1;for(let M=L;M<=g;M++){const P=document.createElement("div");P.classList.add("disable"),P.innerText=`${M}`,P.onclick=()=>{const T=a-2;this.now=new Date(R,T,M),this._setDatePick(R,T,M)},this.dom.day.append(P)}for(let M=1;M<=u;M++){const P=document.createElement("div");e===R&&n===a&&i===M&&P.classList.add("active"),this.pickDate&&r===R&&s===a&&l===M&&P.classList.add("select"),P.innerText=`${M}`,P.onclick=T=>{const X=a-1;this.now=new Date(R,X,M),this._setDatePick(R,X,M),T.stopPropagation()},this.dom.day.append(P)}const O=6*7-d-u;for(let M=1;M<=O;M++){const P=document.createElement("div");P.classList.add("disable"),P.innerText=`${M}`,P.onclick=()=>{this.now=new Date(R,a,M),this._setDatePick(R,a,M)},this.dom.day.append(P)}}_toggleDateTimePicker(){this.isDatePicker?(this.dom.dateWrap.classList.add("active"),this.dom.timeWrap.classList.remove("active"),this.dom.menu.time.innerText=this.lang.timeSelect):(this.dom.dateWrap.classList.remove("active"),this.dom.timeWrap.classList.add("active"),this.dom.menu.time.innerText=this.lang.return,this._setTimePick())}_setDatePick(t,e,n){var i,r,s;this.now=new Date(t,e,n),(i=this.pickDate)==null||i.setFullYear(t),(r=this.pickDate)==null||r.setMonth(e),(s=this.pickDate)==null||s.setDate(n),this._update()}_setTimePick(t=!0){var c,u,d;const e=((c=this.pickDate)==null?void 0:c.getHours())||0,n=((u=this.pickDate)==null?void 0:u.getMinutes())||0,i=((d=this.pickDate)==null?void 0:d.getSeconds())||0,{hour:r,minute:s,second:l}=this.dom.time;[r,s,l].forEach(g=>{g.querySelectorAll("li").forEach(L=>L.classList.remove("active"))}),[[r,e],[s,n],[l,i]].forEach(([g,L])=>{const O=g.querySelector(`[data-id='${L}']`);O.classList.add("active"),t&&this._scrollIntoView(g,O)})}_scrollIntoView(t,e){if(!e){t.scrollTop=0;return}const n=[];let i=e.offsetParent;for(;i&&t!==i&&t.contains(i);)n.push(i),i=i.offsetParent;const r=e.offsetTop+n.reduce((a,c)=>a+c.offsetTop,0),s=r+e.offsetHeight,l=t.scrollTop,R=l+t.clientHeight;rR&&(t.scrollTop=s-t.clientHeight)}_preMonth(){this.now.setMonth(this.now.getMonth()-1),this._update()}_nextMonth(){this.now.setMonth(this.now.getMonth()+1),this._update()}_preYear(){this.now.setFullYear(this.now.getFullYear()-1),this._update()}_nextYear(){this.now.setFullYear(this.now.getFullYear()+1),this._update()}_now(){this.pickDate=new Date,this.dispose()}_toggleVisible(t){t?this.dom.container.classList.add("active"):this.dom.container.classList.remove("active")}_submit(){var t;if(this.options.onSubmit&&this.pickDate){const e=(t=this.renderOptions)==null?void 0:t.dateFormat,n=this.formatDate(this.pickDate,e);this.options.onSubmit(n)}}formatDate(t,e="yyyy-MM-dd hh:mm:ss"){let n=e;const i={"y+":t.getFullYear().toString(),"M+":(t.getMonth()+1).toString(),"d+":t.getDate().toString(),"h+":t.getHours().toString(),"m+":t.getMinutes().toString(),"s+":t.getSeconds().toString()};for(const r in i){const s=new RegExp("("+r+")").exec(e),l=r;s&&(n=n.replace(s[1],s[1].length===1?i[l]:i[l].padStart(s[1].length,"0")))}return n}render(t){this.renderOptions=t,this.lang=this._getLang(),this._setLangChange(),this._setValue(),this._update(),this._setPosition(),this.isDatePicker=!0,this._toggleDateTimePicker(),this._toggleVisible(!0)}dispose(){this._toggleVisible(!1)}destroy(){this.dom.container.remove()}}class en{constructor(t,e){h(this,"draw");h(this,"element");h(this,"control");h(this,"isPopup");h(this,"datePicker");h(this,"options");const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1,this.datePicker=null}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getValueRange(t={}){const e=t.elementList||this.control.getElementList(),{startIndex:n}=t.range||this.control.getRange(),i=e[n];let r=n;for(;r>0;){const l=e[r];if(l.controlId!==i.controlId||l.controlComponent===D.PREFIX)break;r--}let s=n+1;for(;sR.value).join("")||"",r=(l=this.element.control)==null?void 0:l.dateFormat;this.datePicker.render({value:i,position:t,dateFormat:r}),this.isPopup=!0}destroy(){var t;!this.isPopup||((t=this.datePicker)==null||t.destroy(),this.isPopup=!1)}_setDate(t){t?this.setSelect(t):this.clearSelect(),this.destroy()}}class nl{constructor(t){h(this,"controlBorder");h(this,"draw");h(this,"range");h(this,"listener");h(this,"eventBus");h(this,"controlSearch");h(this,"options");h(this,"controlOptions");h(this,"activeControl");this.controlBorder=new el(t),this.draw=t,this.range=t.getRange(),this.listener=t.getListener(),this.eventBus=t.getEventBus(),this.controlSearch=new tl(this),this.options=t.getOptions(),this.controlOptions=this.options.control,this.activeControl=null}setHighlightList(t){this.controlSearch.setHighlightList(t)}computeHighlightList(){this.controlSearch.getHighlightList().length&&this.controlSearch.computeHighlightList()}renderHighlightList(t,e){this.controlSearch.getHighlightMatchResult().length&&this.controlSearch.renderHighlightList(t,e)}getDraw(){return this.draw}filterAssistElement(t){return t.filter(e=>{var n;if(e.type===F.TABLE){const i=e.trList;for(let r=0;ri.controlId))return!1;let e=0,n=0;for(let i=0;i{var c;const s=this.listener.controlChange,l=this.eventBus.isSubscribe("controlChange");if(!s&&!l)return;let R;const a=(c=this.activeControl)==null?void 0:c.getValue();a&&a.length?R=Tt(a)[0].control:R=De(Ot(i)).control,s&&s(R),l&&this.eventBus.emit("controlChange",R)})}destroyControl(){this.activeControl&&((this.activeControl instanceof tn||this.activeControl instanceof en)&&this.activeControl.destroy(),this.activeControl=null,cn(()=>{const t=this.listener.controlChange,e=this.eventBus.isSubscribe("controlChange");!t&&!e||(t&&t(null),e&&this.eventBus.emit("controlChange",null))}))}repaintControl(t={}){const{curIndex:e,isCompute:n=!0,isSubmitHistory:i=!0,isSetCursor:r=!0}=t;e===void 0?(this.range.clearRange(),this.draw.render({isCompute:n,isSubmitHistory:i,isSetCursor:!1})):(this.range.setRange(e,e),this.draw.render({curIndex:e,isCompute:n,isSetCursor:r,isSubmitHistory:i}))}reAwakeControl(){if(!this.activeControl)return;const t=this.getElementList(),e=this.getRange(),n=t[e.startIndex];this.activeControl.setElement(n),(this.activeControl instanceof en||this.activeControl instanceof tn)&&this.activeControl.getIsPopup()&&(this.activeControl.destroy(),this.activeControl.awake())}moveCursor(t){const{index:e,trIndex:n,tdIndex:i,tdValueIndex:r}=t;let s=this.draw.getOriginalElementList(),l;const R=t.isTable?r:e;if(t.isTable?(s=s[e].trList[n].tdList[i].value,l=s[r]):l=s[e],l.controlComponent===D.VALUE)return{newIndex:R,newElement:l};if(l.controlComponent===D.POSTFIX){let a=R+1;for(;a0;){const c=s[a];if(c.controlId!==l.controlId||c.controlComponent===D.PREFIX)return{newIndex:a,newElement:s[a]};a--}}return{newIndex:R,newElement:l}}removeControl(t,e={}){const n=e.elementList||this.getElementList(),i=n[t];if(!this.draw.isDesignMode()){const{deletable:a=!0}=i.control;if(!a)return null}let r=-1,s=-1,l=t;for(;l>0;){if(n[l].controlId!==i.controlId){r=l;break}l--}let R=t+1;for(;R{let a=0;for(;a{var X;return(X=g==null?void 0:g.find(S=>S.code===T))==null?void 0:X.value}).filter(Boolean).join("");i.push(tt(b({},c.control),{zone:R,value:d||null,innerText:P||null}))}a=L}},s=[{zone:lt.HEADER,elementList:this.draw.getHeaderElementList()},{zone:lt.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:lt.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:l,elementList:R}of s)r(R,l);return i}setValueById(t){let e=!1;const{id:n,conceptId:i,value:r}=t;if(!n&&!i)return;const s=R=>{let a=0;for(;a{let R=0;for(;R{const g=i[d];g&&Reflect.set(c,d,g)});let u=a;for(;u0;c--){const u=R[c];if(u.type===F.TABLE){const g=u.trList||[];for(let L=g.length-1;L>=0;L--){const O=g[L],M=O.tdList;for(let P=M.length-1;P>=0;P--){const T=M[P],X=i(T.value,T.value.length-1);if(X)return{positionContext:{isTable:!0,index:c,trIndex:L,tdIndex:P,tdId:T.id,trId:O.id,tableId:u.id},nextIndex:X.nextIndex}}}}if(!u.controlId||u.controlId===n.controlId)continue;let d=c;for(;d>0;){const g=R[d];if(g.controlComponent===D.VALUE||g.controlComponent===D.PREFIX)break;d--}return{positionContext:{isTable:!1},nextIndex:d}}return null}const{startIndex:r}=this.range.getRange(),s=this.getElementList(),l=i(s,r);if(l)return{positionContext:e.isTable?e:l.positionContext,nextIndex:l.nextIndex};if(n.tableId){const R=this.draw.getOriginalElementList(),{index:a,trIndex:c,tdIndex:u}=e,d=R[a].trList;for(let L=c;L>=0;L--){const O=d[L],M=O.tdList;for(let P=M.length-1;P>=0;P--){if(c===L&&P>=u)continue;const T=M[P],X=i(T.value,T.value.length-1);if(X)return{positionContext:{isTable:!0,index:e.index,trIndex:L,tdIndex:P,tdId:T.id,trId:O.id,tableId:n.tableId},nextIndex:X.nextIndex}}}const g=i(R,a-1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}getNextControlContext(){if(!this.activeControl)return null;const e=this.draw.getPosition().getPositionContext();if(!e)return null;const n=this.activeControl.getElement();function i(R,a){for(let c=a;c=0;){const P=e.elementList[M];if(O+=P.metrics.width,((L=e.elementList[M-1])==null?void 0:L.controlComponent)===D.PREFIX){R=P;break}M--}R&&O0){const O=(R==null?void 0:R.left)||0,M=r-e.width-n.metrics.width,P=Math.min(M,a);n.left=P-O,e.width+=P-O}}}class il{constructor(t){h(this,"draw");h(this,"options");this.draw=t,this.options=t.getOptions()}setSelect(t){const{checkbox:e}=t;e?e.value=!e.value:t.checkbox={value:!0},this.draw.render({isCompute:!1,isSetCursor:!1})}render(t){const{ctx:e,x:n,index:i,row:r}=t;let{y:s}=t;const{checkbox:{gap:l,lineWidth:R,fillStyle:a,strokeStyle:c,verticalAlign:u},scale:d}=this.options,{metrics:g,checkbox:L}=r.elementList[i];if(u===Vt.TOP||u===Vt.MIDDLE){let X=i+1,S=null;for(;Xg.height&&(u===Vt.TOP?s-=N-g.height:u===Vt.MIDDLE&&(s-=(p-g.height)/2))}}const O=Math.round(n+l*d),M=Math.round(s-g.height+R),P=g.width-l*2*d,T=g.height;e.save(),e.beginPath(),e.translate(.5,.5),(L==null?void 0:L.value)?(e.lineWidth=R,e.strokeStyle=a,e.rect(O,M,P,T),e.stroke(),e.beginPath(),e.fillStyle=a,e.fillRect(O,M,P,T),e.beginPath(),e.strokeStyle=c,e.lineWidth=R*2*d,e.moveTo(O+2*d,M+T/2),e.lineTo(O+P/2,M+T-3*d),e.lineTo(O+P-2*d,M+3*d),e.stroke()):(e.lineWidth=R,e.rect(O,M,P,T),e.stroke()),e.closePath(),e.restore()}}class sl{constructor(t){h(this,"draw");h(this,"options");this.draw=t,this.options=t.getOptions()}setSelect(t){const{radio:e}=t;e?e.value=!e.value:t.radio={value:!0},this.draw.render({isCompute:!1,isSetCursor:!1})}render(t){const{ctx:e,x:n,index:i,row:r}=t;let{y:s}=t;const{radio:{gap:l,lineWidth:R,fillStyle:a,strokeStyle:c,verticalAlign:u},scale:d}=this.options,{metrics:g,radio:L}=r.elementList[i];if(u===Vt.TOP||u===Vt.MIDDLE){let X=i+1,S=null;for(;Xg.height&&(u===Vt.TOP?s-=N-g.height:u===Vt.MIDDLE&&(s-=(p-g.height)/2))}}const O=Math.round(n+l*d),M=Math.round(s-g.height+R),P=g.width-l*2*d,T=g.height;e.save(),e.beginPath(),e.translate(.5,.5),e.strokeStyle=(L==null?void 0:L.value)?a:c,e.lineWidth=R,e.arc(O+P/2,M+T/2,P/2,0,Math.PI*2),e.stroke(),(L==null?void 0:L.value)&&(e.beginPath(),e.fillStyle=a,e.arc(O+P/2,M+T/2,P/3,0,Math.PI*2),e.fill()),e.closePath(),e.restore()}}const ns="KCgpPT57KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBmOyhmdW5jdGlvbih0KXt0LlRFWFQ9InRleHQiLHQuVEFCTEU9InRhYmxlIix0LkhZUEVSTElOSz0iaHlwZXJsaW5rIix0LkNPTlRST0w9ImNvbnRyb2wifSkoZnx8KGY9e30pKTt2YXIgcDsoZnVuY3Rpb24odCl7dC5WQUxVRT0idmFsdWUifSkocHx8KHA9e30pKTtjb25zdCBoPSJcdTIwMEIiLGc9YApgO2Z1bmN0aW9uIGEodCl7bGV0IGw9IiIsbj0wO2Zvcig7bjx0Lmxlbmd0aDspe2NvbnN0IG89dFtuXTtpZihvLnR5cGU9PT1mLlRBQkxFKXtpZihvLnRyTGlzdClmb3IobGV0IHI9MDtyPG8udHJMaXN0Lmxlbmd0aDtyKyspe2NvbnN0IHM9by50ckxpc3Rbcl07Zm9yKGxldCBlPTA7ZTxzLnRkTGlzdC5sZW5ndGg7ZSsrKXtjb25zdCBpPXMudGRMaXN0W2VdO2wrPWEoaS52YWx1ZSl9fX1lbHNlIGlmKG8udHlwZT09PWYuSFlQRVJMSU5LKXtjb25zdCByPW8uaHlwZXJsaW5rSWQscz1bXTtmb3IoO248dC5sZW5ndGg7KXtjb25zdCBlPXRbbl07aWYociE9PWUuaHlwZXJsaW5rSWQpe24tLTticmVha31kZWxldGUgZS50eXBlLHMucHVzaChlKSxuKyt9bCs9YShzKX1lbHNlIGlmKG8uY29udHJvbElkKXtjb25zdCByPW8uY29udHJvbElkLHM9W107Zm9yKDtuPHQubGVuZ3RoOyl7Y29uc3QgZT10W25dO2lmKHIhPT1lLmNvbnRyb2xJZCl7bi0tO2JyZWFrfWUuY29udHJvbENvbXBvbmVudD09PXAuVkFMVUUmJihkZWxldGUgZS5jb250cm9sSWQscy5wdXNoKGUpKSxuKyt9bCs9YShzKX1lbHNlKCFvLnR5cGV8fG8udHlwZT09PWYuVEVYVCkmJihsKz1vLnZhbHVlKTtuKyt9cmV0dXJuIGx9ZnVuY3Rpb24gZCh0KXtjb25zdCBsPVtdLG49L1swLTldLyxvPS9bQS1aYS16XS8scj0vXHMvO2xldCBzPSExLGU9ITEsaT0iIjtmdW5jdGlvbiB1KCl7aSYmKGwucHVzaChpKSxpPSIiKX1mb3IoY29uc3QgYyBvZiB0KW8udGVzdChjKT8oc3x8dSgpLGkrPWMscz0hMCxlPSExKTpuLnRlc3QoYyk/KGV8fHUoKSxpKz1jLHM9ITEsZT0hMCk6KHUoKSxzPSExLGU9ITEsci50ZXN0KGMpfHxsLnB1c2goYykpO3JldHVybiB1KCksbH1vbm1lc3NhZ2U9dD0+e2NvbnN0IGw9dC5kYXRhLG89YShsKS5yZXBsYWNlKG5ldyBSZWdFeHAoYF4ke2h9YCksIiIpLnJlcGxhY2UobmV3IFJlZ0V4cChoLCJnIiksZykscj1kKG8pO3Bvc3RNZXNzYWdlKHIubGVuZ3RoKX19KSgpO30pKCk7Cg==",is=typeof window!="undefined"&&window.Blob&&new Blob([atob(ns)],{type:"text/javascript;charset=utf-8"});function ol(){const o=is&&(window.URL||window.webkitURL).createObjectURL(is);try{return o?new Worker(o):new Worker("data:application/javascript;base64,"+ns,{type:"module"})}finally{o&&(window.URL||window.webkitURL).revokeObjectURL(o)}}const ss="KCgpPT57KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBsOyhmdW5jdGlvbih0KXt0LlRFWFQ9InRleHQiLHQuSU1BR0U9ImltYWdlIix0LlRBQkxFPSJ0YWJsZSIsdC5IWVBFUkxJTks9Imh5cGVybGluayIsdC5TVVBFUlNDUklQVD0ic3VwZXJzY3JpcHQiLHQuU1VCU0NSSVBUPSJzdWJzY3JpcHQiLHQuU0VQQVJBVE9SPSJzZXBhcmF0b3IiLHQuUEFHRV9CUkVBSz0icGFnZUJyZWFrIix0LkNPTlRST0w9ImNvbnRyb2wiLHQuQ0hFQ0tCT1g9ImNoZWNrYm94Iix0LlJBRElPPSJyYWRpbyIsdC5MQVRFWD0ibGF0ZXgiLHQuVEFCPSJ0YWIiLHQuREFURT0iZGF0ZSIsdC5CTE9DSz0iYmxvY2siLHQuVElUTEU9InRpdGxlIix0LkxJU1Q9Imxpc3QifSkobHx8KGw9e30pKTt2YXIgYTsoZnVuY3Rpb24odCl7dC5GSVJTVD0iZmlyc3QiLHQuU0VDT05EPSJzZWNvbmQiLHQuVEhJUkQ9InRoaXJkIix0LkZPVVJUSD0iZm91cnRoIix0LkZJRlRIPSJmaWZ0aCIsdC5TSVhUSD0ic2l4dGgifSkoYXx8KGE9e30pKTtjb25zdCBnPXtbYS5GSVJTVF06MSxbYS5TRUNPTkRdOjIsW2EuVEhJUkRdOjMsW2EuRk9VUlRIXTo0LFthLkZJRlRIXTo1LFthLlNJWFRIXTo2fSxMPVtsLlRFWFQsbC5IWVBFUkxJTkssbC5TVUJTQ1JJUFQsbC5TVVBFUlNDUklQVCxsLkNPTlRST0wsbC5EQVRFXSxUPSJcdTIwMEIiO2Z1bmN0aW9uIGQodCl7cmV0dXJuIXQudHlwZXx8TC5pbmNsdWRlcyh0LnR5cGUpfWZ1bmN0aW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V0dXJuIFJ9b25tZXNzYWdlPXQ9Pntjb25zdCBuPXQuZGF0YSx2PWYobik7cG9zdE1lc3NhZ2Uodil9fSkoKTt9KSgpOwo=",os=typeof window!="undefined"&&window.Blob&&new Blob([atob(ss)],{type:"text/javascript;charset=utf-8"});function rl(){const o=os&&(window.URL||window.webkitURL).createObjectURL(os);try{return o?new Worker(o):new Worker("data:application/javascript;base64,"+ss,{type:"module"})}finally{o&&(window.URL||window.webkitURL).revokeObjectURL(o)}}const rs="KCgpPT57KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBuOyhmdW5jdGlvbihvKXtvLlRBQkxFPSJ0YWJsZSJ9KShufHwobj17fSkpO2Z1bmN0aW9uIGMobyl7Y29uc3QgdD1bXTtmb3IoY29uc3QgcyBvZiBvKXtpZihzLnR5cGU9PT1uLlRBQkxFKXtjb25zdCBlPXMudHJMaXN0O2ZvcihsZXQgcj0wO3I8ZS5sZW5ndGg7cisrKXtjb25zdCBpPWVbcl07Zm9yKGxldCB1PTA7dTxpLnRkTGlzdC5sZW5ndGg7dSsrKXtjb25zdCBkPWkudGRMaXN0W3VdO3QucHVzaCguLi5jKGQudmFsdWUpKX19fWlmKCEhcy5ncm91cElkcylmb3IoY29uc3QgZSBvZiBzLmdyb3VwSWRzKXQuaW5jbHVkZXMoZSl8fHQucHVzaChlKX1yZXR1cm4gdH1vbm1lc3NhZ2U9bz0+e2NvbnN0IHQ9by5kYXRhLHM9Yyh0KTtwb3N0TWVzc2FnZShzKX19KSgpO30pKCk7Cg==",ls=typeof window!="undefined"&&window.Blob&&new Blob([atob(rs)],{type:"text/javascript;charset=utf-8"});function ll(){const o=ls&&(window.URL||window.webkitURL).createObjectURL(ls);try{return o?new Worker(o):new Worker("data:application/javascript;base64,"+rs,{type:"module"})}finally{o&&(window.URL||window.webkitURL).revokeObjectURL(o)}}class Rl{constructor(t){h(this,"draw");h(this,"wordCountWorker");h(this,"catalogWorker");h(this,"groupWorker");this.draw=t,this.wordCountWorker=new ol,this.catalogWorker=new rl,this.groupWorker=new ll}getWordCount(){return new Promise((t,e)=>{this.wordCountWorker.onmessage=i=>{t(i.data)},this.wordCountWorker.onerror=i=>{e(i)};const n=this.draw.getOriginalMainElementList();this.wordCountWorker.postMessage(n)})}getCatalog(){return new Promise((t,e)=>{this.catalogWorker.onmessage=r=>{t(r.data)},this.catalogWorker.onerror=r=>{e(r)};const n=this.draw.getOriginalMainElementList(),i=this.draw.getPosition().getOriginalMainPositionList();this.catalogWorker.postMessage({elementList:n,positionList:i})})}getGroupIds(){return new Promise((t,e)=>{this.groupWorker.onmessage=i=>{t(i.data)},this.groupWorker.onerror=i=>{e(i)};const n=this.draw.getOriginalMainElementList();this.groupWorker.postMessage(n)})}}class al{constructor(t){h(this,"container");h(this,"canvas");h(this,"draw");h(this,"options");h(this,"curElement");h(this,"curElementSrc");h(this,"previewerDrawOption");h(this,"curPosition");h(this,"resizerSelection");h(this,"resizerHandleList");h(this,"resizerImageContainer");h(this,"resizerImage");h(this,"resizerSize");h(this,"width");h(this,"height");h(this,"mousedownX");h(this,"mousedownY");h(this,"curHandleIndex");h(this,"previewerContainer");h(this,"previewerImage");h(this,"_keydown",()=>{this.resizerSelection.style.display==="block"&&(this.clearResizer(),document.removeEventListener("keydown",this._keydown))});this.container=t.getContainer(),this.canvas=t.getPage(),this.draw=t,this.options=t.getOptions(),this.curElement=null,this.curElementSrc="",this.previewerDrawOption={},this.curPosition=null;const{resizerSelection:e,resizerHandleList:n,resizerImageContainer:i,resizerImage:r,resizerSize:s}=this._createResizerDom();this.resizerSelection=e,this.resizerHandleList=n,this.resizerImageContainer=i,this.resizerImage=r,this.resizerSize=s,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.previewerContainer=null,this.previewerImage=null}_getElementPosition(t,e=null){var a;let n=0,i=0;const r=this.draw.getHeight(),s=this.draw.getPageGap(),R=((a=e==null?void 0:e.pageNo)!=null?a:this.draw.getPageNo())*(r+s);if(t.imgFloatPosition)n=t.imgFloatPosition.x,i=t.imgFloatPosition.y+R;else if(e){const{coordinate:{leftTop:[c,u]},ascent:d}=e;n=c,i=u+R+d}return{x:n,y:i}}_createResizerDom(){const{scale:t}=this.options,e=document.createElement("div");e.classList.add(`${k}-resizer-selection`),e.style.display="none",e.style.borderColor=this.options.resizerColor,e.style.borderWidth=`${t}px`;const n=[];for(let R=0;R<8;R++){const a=document.createElement("div");a.style.background=this.options.resizerColor,a.classList.add("resizer-handle"),a.classList.add(`handle-${R}`),a.setAttribute("data-index",String(R)),a.onmousedown=this._mousedown.bind(this),e.append(a),n.push(a)}this.container.append(e);const i=document.createElement("div");i.classList.add(`${k}-resizer-size-view`);const r=document.createElement("span");i.append(r),e.append(i);const s=document.createElement("div");s.classList.add(`${k}-resizer-image`),s.style.display="none";const l=document.createElement("img");return s.append(l),this.container.append(s),{resizerSelection:e,resizerHandleList:n,resizerImageContainer:s,resizerImage:l,resizerSize:r}}_mousedown(t){if(this.canvas=this.draw.getPage(),!this.curElement)return;const{scale:e}=this.options;this.mousedownX=t.x,this.mousedownY=t.y;const n=t.target;this.curHandleIndex=Number(n.dataset.index);const i=window.getComputedStyle(n).cursor;document.body.style.cursor=i,this.canvas.style.cursor=i,this.resizerImage.src=this.curElementSrc,this.resizerImageContainer.style.display="block";const{x:r,y:s}=this._getElementPosition(this.curElement,this.curPosition);this.resizerImageContainer.style.left=`${r}px`,this.resizerImageContainer.style.top=`${s}px`,this.resizerImage.style.width=`${this.curElement.width*e}px`,this.resizerImage.style.height=`${this.curElement.height*e}px`;const l=this._mousemove.bind(this);document.addEventListener("mousemove",l),document.addEventListener("mouseup",()=>{var R;this.curElement&&!this.previewerDrawOption.dragDisable&&(this.curElement.width=this.width,this.curElement.height=this.height,this.draw.render({isSetCursor:!0,curIndex:(R=this.curPosition)==null?void 0:R.index})),this.resizerImageContainer.style.display="none",document.removeEventListener("mousemove",l),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),t.preventDefault()}_mousemove(t){if(!this.curElement||this.previewerDrawOption.dragDisable)return;const{scale:e}=this.options;let n=0,i=0;switch(this.curHandleIndex){case 0:{const a=this.mousedownX-t.x,c=this.mousedownY-t.y;n=Math.cbrt(a**3+c**3),i=this.curElement.height*n/this.curElement.width}break;case 1:i=this.mousedownY-t.y;break;case 2:{const a=t.x-this.mousedownX,c=this.mousedownY-t.y;n=Math.cbrt(a**3+c**3),i=this.curElement.height*n/this.curElement.width}break;case 4:{const a=t.x-this.mousedownX,c=t.y-this.mousedownY;n=Math.cbrt(a**3+c**3),i=this.curElement.height*n/this.curElement.width}break;case 3:n=t.x-this.mousedownX;break;case 5:i=t.y-this.mousedownY;break;case 6:{const a=this.mousedownX-t.x,c=t.y-this.mousedownY;n=Math.cbrt(a**3+c**3),i=this.curElement.height*n/this.curElement.width}break;case 7:n=this.mousedownX-t.x;break}const r=this.curElement.width+n/e,s=this.curElement.height+i/e;if(r<=0||s<=0)return;this.width=r,this.height=s;const l=r*e,R=s*e;this.resizerImage.style.width=`${l}px`,this.resizerImage.style.height=`${R}px`,this._updateResizerRect(l,R),this._updateResizerSizeView(l,R),t.preventDefault()}_drawPreviewer(){const t=document.createElement("div");t.classList.add(`${k}-image-previewer`);const e=document.createElement("i");e.classList.add("image-close"),e.onclick=()=>{this._clearPreviewer()},t.append(e);const n=document.createElement("div");n.classList.add(`${k}-image-container`);const i=document.createElement("img");i.src=this.curElementSrc,i.draggable=!1,n.append(i),this.previewerImage=i,t.append(n);let r=0,s=0,l=1,R=0;const a=document.createElement("div");a.classList.add(`${k}-image-menu`);const c=document.createElement("i");c.classList.add("zoom-in"),c.onclick=()=>{l+=.1,this._setPreviewerTransform(l,R,r,s)},a.append(c);const u=document.createElement("i");u.onclick=()=>{l-.1<=.1||(l-=.1,this._setPreviewerTransform(l,R,r,s))},u.classList.add("zoom-out"),a.append(u);const d=document.createElement("i");d.classList.add("rotate"),d.onclick=()=>{R+=1,this._setPreviewerTransform(l,R,r,s)},a.append(d);const g=document.createElement("i");g.classList.add("original-size"),g.onclick=()=>{r=0,s=0,l=1,R=0,this._setPreviewerTransform(l,R,r,s)},a.append(g);const L=document.createElement("i");L.classList.add("image-download"),L.onclick=()=>{var X;const{mime:T}=this.previewerDrawOption;pi(i.src,`${(X=this.curElement)==null?void 0:X.id}.${T||"png"}`)},a.append(L),t.append(a),this.previewerContainer=t,document.body.append(t);let O=0,M=0,P=!1;i.onmousedown=T=>{P=!0,O=T.x,M=T.y,t.style.cursor="move"},t.onmousemove=T=>{!P||(r+=T.x-O,s+=T.y-M,O=T.x,M=T.y,this._setPreviewerTransform(l,R,r,s))},t.onmouseup=()=>{P=!1,t.style.cursor="auto"},t.onwheel=T=>{if(T.preventDefault(),T.stopPropagation(),T.deltaY<0)l+=.1;else{if(l-.1<=.1)return;l-=.1}this._setPreviewerTransform(l,R,r,s)}}_setPreviewerTransform(t,e,n,i){!this.previewerImage||(this.previewerImage.style.left=`${n}px`,this.previewerImage.style.top=`${i}px`,this.previewerImage.style.transform=`scale(${t}) rotate(${e*90}deg)`)}_clearPreviewer(){var t;(t=this.previewerContainer)==null||t.remove(),this.previewerContainer=null,document.body.style.overflow="auto"}_updateResizerRect(t,e){const{resizerSize:n,scale:i}=this.options,r=this.draw.isReadonly();this.resizerSelection.style.width=`${t}px`,this.resizerSelection.style.height=`${e}px`;for(let s=0;s<8;s++){const l=s===0||s===6||s===7?-n:s===1||s===5?t/2:t-n,R=s===0||s===1||s===2?-n:s===3||s===7?e/2-n:e-n;this.resizerHandleList[s].style.transform=`scale(${i})`,this.resizerHandleList[s].style.left=`${l}px`,this.resizerHandleList[s].style.top=`${R}px`,this.resizerHandleList[s].style.display=r?"none":"block"}}_updateResizerSizeView(t,e){this.resizerSize.innerText=`${Math.round(t)} \xD7 ${Math.round(e)}`}render(){this._drawPreviewer(),document.body.style.overflow="hidden"}drawResizer(t,e=null,n={}){this.previewerDrawOption=n,this.curElementSrc=t[n.srcKey||"value"]||"",this.updateResizer(t,e),document.addEventListener("keydown",this._keydown)}updateResizer(t,e=null){const{scale:n}=this.options,i=t.width*n,r=t.height*n;this._updateResizerSizeView(i,r);const{x:s,y:l}=this._getElementPosition(t,e);this.resizerSelection.style.left=`${s}px`,this.resizerSelection.style.top=`${l}px`,this.resizerSelection.style.borderWidth=`${n}px`,this._updateResizerRect(i,r),this.resizerSelection.style.display="block",this.curElement=t,this.curPosition=e,this.width=i,this.height=r}clearResizer(){this.resizerSelection.style.display="none",document.removeEventListener("keydown",this._keydown)}}class cl{constructor(t){h(this,"draw");h(this,"range");h(this,"datePicker");h(this,"options");this.draw=t,this.options=t.getOptions(),this.range=t.getRange(),this.datePicker=new es(t,{onSubmit:this._setValue.bind(this)})}_setValue(t){if(!t)return;const e=this.getDateElementRange();if(!e)return;const[n,i]=e,r=this.draw.getElementList(),s=r[n+1];this.draw.spliceElementList(r,n+1,i-n),this.range.setRange(n,n);const l={type:F.DATE,value:"",dateFormat:s.dateFormat,valueList:[{value:t}]};Ht(r,[l],n,{editorOptions:this.options}),this.draw.insertElementList([l])}getDateElementRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=this.draw.getElementList(),s=r[n];if(s.type!==F.DATE)return null;let l=n;for(;l>=0;){if(r[l].dateId!==s.dateId){t=l;break}l--}let R=n+1;for(;Rs.value).join(""):"";this.datePicker.render({value:r,position:e,dateFormat:t.dateFormat})}}var we;(function(o){o.IFRAME="iframe",o.VIDEO="video"})(we||(we={}));const ii=class{constructor(t){h(this,"element");this.element=t}_defineIframeProperties(t){Object.defineProperties(t,{parent:{get:()=>null},__POWERED_BY_CANVAS_EDITOR__:{get:()=>!0}})}render(t){var i,r;const e=this.element.block,n=document.createElement("iframe");n.setAttribute("data-id",this.element.id),n.sandbox.add(...ii.sandbox),n.style.border="none",n.style.width="100%",n.style.height="100%",((i=e.iframeBlock)==null?void 0:i.src)?n.src=e.iframeBlock.src:((r=e.iframeBlock)==null?void 0:r.srcdoc)&&(n.srcdoc=e.iframeBlock.srcdoc),t.append(n),this._defineIframeProperties(n.contentWindow)}};let jn=ii;h(jn,"sandbox",["allow-scripts","allow-same-origin"]);class ul{constructor(t){h(this,"element");this.element=t}render(t){var i;const e=this.element.block,n=document.createElement("video");n.style.width="100%",n.style.height="100%",n.style.objectFit="contain",n.src=((i=e.videoBlock)==null?void 0:i.src)||"",n.controls=!0,n.crossOrigin="anonymous",t.append(n)}}class dl{constructor(t,e){h(this,"draw");h(this,"element");h(this,"block");h(this,"blockContainer");h(this,"blockItem");this.draw=t.getDraw(),this.blockContainer=t.getBlockContainer(),this.element=e,this.block=null,this.blockItem=this._createBlockItem(),this.blockContainer.append(this.blockItem)}getBlockElement(){return this.element}_createBlockItem(){const t=document.createElement("div");return t.classList.add(`${k}-block-item`),t}render(){const t=this.element.block;t.type===we.IFRAME?(this.block=new jn(this.element),this.block.render(this.blockItem)):t.type===we.VIDEO&&(this.block=new ul(this.element),this.block.render(this.blockItem))}setClientRects(t,e,n){const i=this.draw.getHeight(),r=this.draw.getPageGap(),s=t*(i+r),{metrics:l}=this.element;this.blockItem.style.width=`${l.width}px`,this.blockItem.style.height=`${l.height}px`,this.blockItem.style.left=`${e}px`,this.blockItem.style.top=`${s+n}px`}remove(){this.blockItem.remove()}}class hl{constructor(t){h(this,"draw");h(this,"container");h(this,"blockContainer");h(this,"blockMap");this.draw=t,this.container=t.getContainer(),this.blockMap=new Map,this.blockContainer=this._createBlockContainer(),this.container.append(this.blockContainer)}_createBlockContainer(){const t=document.createElement("div");return t.classList.add(`${k}-block-container`),t}getDraw(){return this.draw}getBlockContainer(){return this.blockContainer}render(t,e,n,i){const r=e.id,s=this.blockMap.get(r);if(s)s.setClientRects(t,n,i);else{const l=new dl(this,e);l.render(),l.setClientRects(t,n,i),this.blockMap.set(r,l)}}clear(){if(!this.blockMap.size)return;const t=this.draw.getElementList(),e=[];for(let n=0;n{const i=n.getBlockElement().id;e.includes(i)||(n.remove(),this.blockMap.delete(i))})}}const gl={global:{cut:"\u526A\u5207",copy:"\u590D\u5236",paste:"\u7C98\u8D34",selectAll:"\u5168\u9009",print:"\u6253\u5370"},control:{delete:"\u5220\u9664\u63A7\u4EF6"},hyperlink:{delete:"\u5220\u9664\u94FE\u63A5",cancel:"\u53D6\u6D88\u94FE\u63A5",edit:"\u7F16\u8F91\u94FE\u63A5"},image:{change:"\u66F4\u6539\u56FE\u7247",saveAs:"\u53E6\u5B58\u4E3A\u56FE\u7247",textWrap:"\u6587\u5B57\u73AF\u7ED5",textWrapType:{embed:"\u5D4C\u5165\u578B",upDown:"\u4E0A\u4E0B\u578B\u73AF\u7ED5",surround:"\u56DB\u5468\u578B\u73AF\u7ED5",floatTop:"\u6D6E\u4E8E\u6587\u5B57\u4E0A\u65B9",floatBottom:"\u886C\u4E8E\u6587\u5B57\u4E0B\u65B9"}},table:{insertRowCol:"\u63D2\u5165\u884C\u5217",insertTopRow:"\u4E0A\u65B9\u63D2\u51651\u884C",insertBottomRow:"\u4E0B\u65B9\u63D2\u51651\u884C",insertLeftCol:"\u5DE6\u4FA7\u63D2\u51651\u5217",insertRightCol:"\u53F3\u4FA7\u63D2\u51651\u5217",deleteRowCol:"\u5220\u9664\u884C\u5217",deleteRow:"\u5220\u96641\u884C",deleteCol:"\u5220\u96641\u5217",deleteTable:"\u5220\u9664\u6574\u4E2A\u8868\u683C",mergeCell:"\u5408\u5E76\u5355\u5143\u683C",mergeCancelCell:"\u53D6\u6D88\u5408\u5E76",verticalAlign:"\u5782\u76F4\u5BF9\u9F50",verticalAlignTop:"\u9876\u7AEF\u5BF9\u9F50",verticalAlignMiddle:"\u5782\u76F4\u5C45\u4E2D",verticalAlignBottom:"\u5E95\u7AEF\u5BF9\u9F50",border:"\u8868\u683C\u8FB9\u6846",borderAll:"\u6240\u6709\u6846\u7EBF",borderEmpty:"\u65E0\u6846\u7EBF",borderDash:"\u865A\u6846\u7EBF",borderExternal:"\u5916\u4FA7\u6846\u7EBF",borderInternal:"\u5185\u4FA7\u6846\u7EBF",borderTd:"\u5355\u5143\u683C\u8FB9\u6846",borderTdTop:"\u4E0A\u8FB9\u6846",borderTdRight:"\u53F3\u8FB9\u6846",borderTdBottom:"\u4E0B\u8FB9\u6846",borderTdLeft:"\u5DE6\u8FB9\u6846",borderTdForward:"\u6B63\u659C\u7EBF",borderTdBack:"\u53CD\u659C\u7EBF"}},Ll={now:"\u6B64\u523B",confirm:"\u786E\u5B9A",return:"\u8FD4\u56DE\u65E5\u671F",timeSelect:"\u65F6\u95F4\u9009\u62E9",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},year:"\u5E74",month:"\u6708",hour:"\u65F6",minute:"\u5206",second:"\u79D2"},Ol={header:"\u9875\u7709",footer:"\u9875\u811A"},Pl={displayName:"\u5206\u9875\u7B26"},Ml={headerTip:"\u53CC\u51FB\u7F16\u8F91\u9875\u7709",footerTip:"\u53CC\u51FB\u7F16\u8F91\u9875\u811A"};var ti={contextmenu:gl,datePicker:Ll,frame:Ol,pageBreak:Pl,zone:Ml};const Tl={global:{cut:"Cut",copy:"Copy",paste:"Paste",selectAll:"Select all",print:"Print"},control:{delete:"Delete control"},hyperlink:{delete:"Delete hyperlink",cancel:"Cancel hyperlink",edit:"Edit hyperlink"},image:{change:"Change image",saveAs:"Save as image",textWrap:"Text wrap",textWrapType:{embed:"Embed",upDown:"Up down",surround:"Surround",floatTop:"Float above text",floatBottom:"Float below text"}},table:{insertRowCol:"Insert row col",insertTopRow:"Insert top 1 row",insertBottomRow:"Insert bottom 1 row",insertLeftCol:"Insert left 1 col",insertRightCol:"Insert right 1 col",deleteRowCol:"Delete row col",deleteRow:"Delete 1 row",deleteCol:"Delete 1 col",deleteTable:"Delete table",mergeCell:"Merge cell",mergeCancelCell:"Cancel merge cell",verticalAlign:"Vertical align",verticalAlignTop:"Top",verticalAlignMiddle:"Middle",verticalAlignBottom:"Bottom",border:"Table border",borderAll:"All",borderEmpty:"Empty",borderDash:"Dash",borderExternal:"External",borderInternal:"Internal",borderTd:"Table cell border",borderTdTop:"Top",borderTdRight:"Right",borderTdBottom:"Bottom",borderTdLeft:"Left",borderTdForward:"Forward",borderTdBack:"Back"}},Sl={now:"Now",confirm:"Confirm",return:"Return",timeSelect:"Time select",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},year:" ",month:" ",hour:"Hour",minute:"Minute",second:"Second"},Xl={header:"Header",footer:"Footer"},Nl={displayName:"Page Break"},Fl={headerTip:"Double click to edit header",footerTip:"Double click to edit footer"};var fl={contextmenu:Tl,datePicker:Sl,frame:Xl,pageBreak:Nl,zone:Fl};class Il{constructor(){h(this,"langMap",new Map([["zhCN",ti],["en",fl]]));h(this,"currentLocale","zhCN")}registerLangMap(t,e){const n=this.langMap.get(t);this.langMap.set(t,Vi(n||ti,e))}getLocale(){return this.currentLocale}setLocale(t){this.currentLocale=t}getLang(){return this.langMap.get(this.currentLocale)||ti}t(t){const e=t.split(".");let n="",i=this.getLang();for(let r=0;r{if(!(this.isDisableMouseMove||!this.draw.getIsPagingMode())&&!!e.offsetY)if(e.target instanceof HTMLCanvasElement){const n=this.zone.getZoneByY(e.offsetY);if(!t.includes(n)){this._updateZoneTip(!1);return}this.currentMoveZone=n,this._updateZoneTip(this.zone.getZone()===lt.MAIN&&(n===lt.HEADER||n===lt.FOOTER),e.x,e.y)}else this._updateZoneTip(!1)},250)),this.pageContainer.addEventListener("mouseenter",()=>{this.isDisableMouseMove=!1}),this.pageContainer.addEventListener("mouseleave",()=>{this.isDisableMouseMove=!0,this._updateZoneTip(!1)})}_drawZoneTip(){const t=document.createElement("div");t.classList.add(`${k}-zone-tip`);const e=document.createElement("span");return t.append(e),this.container.append(t),{tipContainer:t,tipContent:e}}_updateZoneTip(t,e,n){t?(this.tipContainer.classList.add("show"),this.tipContainer.style.left=`${e}px`,this.tipContainer.style.top=`${n}px`,this.tipContent.innerText=this.i18n.t(`zone.${this.currentMoveZone===lt.HEADER?"headerTip":"footerTip"}`)):this.tipContainer.classList.remove("show")}}class Wl{constructor(t){h(this,"INDICATOR_PADDING",2);h(this,"INDICATOR_TITLE_TRANSLATE",[20,5]);h(this,"draw");h(this,"options");h(this,"i18n");h(this,"container");h(this,"currentZone");h(this,"indicatorContainer");this.draw=t,this.i18n=t.getI18n(),this.options=t.getOptions(),this.container=t.getContainer(),this.currentZone=lt.MAIN,this.indicatorContainer=null,this.options.zone.tipDisabled||new pl(t,this)}isHeaderActive(){return this.getZone()===lt.HEADER}isMainActive(){return this.getZone()===lt.MAIN}isFooterActive(){return this.getZone()===lt.FOOTER}getZone(){return this.currentZone}setZone(t){const{header:e,footer:n}=this.options;!e.editable&&t===lt.HEADER||!n.editable&&t===lt.FOOTER||this.currentZone!==t&&(this.currentZone=t,this.draw.getRange().clearRange(),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),this.drawZoneIndicator(),cn(()=>{const i=this.draw.getListener();i.zoneChange&&i.zoneChange(t);const r=this.draw.getEventBus();r.isSubscribe("zoneChange")&&r.emit("zoneChange",t)}))}getZoneByY(t){const e=this.draw.getHeader(),n=e.getHeaderTop()+e.getHeight(),i=this.draw.getFooter(),s=this.draw.getHeight()-(i.getFooterBottom()+i.getHeight());return ts?lt.FOOTER:lt.MAIN}drawZoneIndicator(){if(this._clearZoneIndicator(),!this.isHeaderActive()&&!this.isFooterActive())return;const{scale:t}=this.options,e=this.isHeaderActive(),[n,i]=this.INDICATOR_TITLE_TRANSLATE,r=this.draw.getPageList(),s=this.draw.getMargins(),l=this.draw.getInnerWidth(),R=this.draw.getHeight(),a=this.draw.getPageGap(),c=R+a;this.indicatorContainer=document.createElement("div"),this.indicatorContainer.classList.add(`${k}-zone-indicator`);const u=this.draw.getHeader(),d=this.draw.getFooter(),g=e?u.getHeight():d.getHeight(),L=e?u.getHeaderTop():R-d.getFooterBottom()-g;for(let O=0;Ot?t:e}getRowHeight(){return this.rowList.reduce((t,e)=>t+e.height,0)}getExtraHeight(){const t=this.draw.getMargins(),e=this.getHeight(),i=this.getFooterBottom()+e-t[2];return i<=0?0:i}render(t,e){t.globalAlpha=1;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),r=[];let s=0;for(let l=0;li)break;r.push(R),s+=R.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:r,pageNo:e,startIndex:0,innerWidth:n,zone:lt.FOOTER})}}class Yl{constructor(t){h(this,"draw");h(this,"range");h(this,"options");h(this,"UN_COUNT_STYLE_WIDTH",20);h(this,"MEASURE_BASE_TEXT","0");h(this,"LIST_GAP",10);this.draw=t,this.range=t.getRange(),this.options=t.getOptions()}setList(t,e){if(this.draw.isReadonly())return;const{startIndex:i,endIndex:r}=this.range.getRange();if(!~i&&!~r)return;const s=this.range.getRangeParagraphElementList();if(!s||!s.length)return;if(s.find(u=>u.listType===t&&u.listStyle===e)||!t){this.unsetList();return}const R=Pt();s.forEach(u=>{u.listId=R,u.listType=t,u.listStyle=e});const a=i===r,c=a?r:i;this.draw.render({curIndex:c,isSetCursor:a})}unsetList(){var a;if(this.draw.isReadonly())return;const{startIndex:e,endIndex:n}=this.range.getRange();if(!~e&&!~n)return;const i=(a=this.range.getRangeParagraphElementList())==null?void 0:a.filter(c=>c.listId);if(!i||!i.length)return;const r=this.draw.getElementList(),s=r[n];if(s.listId){let c=n+1;for(;c{delete c.listId,delete c.listType,delete c.listStyle,delete c.listWrap});const l=e===n,R=l?n:e;this.draw.render({curIndex:R,isSetCursor:l})}computeListStyle(t,e){const n=new Map;let i=0,r=e[i].listId,s=[];const l=e.length;for(;i(c.value===_&&(a+=1),a),0);if(!s)return 0;const l=`${this.MEASURE_BASE_TEXT.repeat(String(s).length)}${z.PERIOD}`,R=t.measureText(l);return Math.ceil((R.width+this.LIST_GAP)*n)}drawListStyle(t,e,n){var T;const{elementList:i,offsetX:r,listIndex:s,ascent:l}=e,R=i[0];if(R.value!==_||R.listWrap)return;let a=0;const{defaultTabWidth:c,scale:u,defaultFont:d,defaultSize:g}=this.options;for(let X=1;X{Array.isArray(n.groupIds)||(n.groupIds=[]),n.groupIds.push(e)}),this.draw.render({isSetCursor:!1,isCompute:!1}),e}getElementListByGroupId(t,e){var i,r;const n=[];for(let s=0;sR===t);s.splice(l,1),s.length||delete r.groupIds}this.draw.render({isSetCursor:!1,isCompute:!1})}}getContextByGroupId(t,e){var n,i;for(let r=0;r{const{x:d,y:g,width:L,height:O}=c;(i==null?void 0:i.includes(u))?(t.globalAlpha=l,t.fillStyle=R):(t.globalAlpha=s,t.fillStyle=r),t.fillRect(d,g,L,O)}),t.restore(),this.clearFillInfo()}}class Ql{constructor(t){h(this,"draw");h(this,"eventBus");h(this,"pageContainer");this.draw=t,this.eventBus=this.draw.getEventBus(),this.pageContainer=this.draw.getPageContainer(),this.pageContainer.addEventListener("mousemove",this._mousemove.bind(this)),this.pageContainer.addEventListener("mouseenter",this._mouseenter.bind(this)),this.pageContainer.addEventListener("mouseleave",this._mouseleave.bind(this))}_mousemove(t){!this.eventBus.isSubscribe("mousemove")||this.eventBus.emit("mousemove",t)}_mouseenter(t){!this.eventBus.isSubscribe("mouseenter")||this.eventBus.emit("mouseenter",t)}_mouseleave(t){!this.eventBus.isSubscribe("mouseleave")||this.eventBus.emit("mouseleave",t)}}class Dl{constructor(t){h(this,"draw");h(this,"options");this.draw=t,this.options=t.getOptions()}render(t,e){const{scale:n,lineNumber:{color:i,size:r,font:s,right:l,type:R}}=this.options,a=this.draw.getTextParticle(),c=this.draw.getMargins(),u=this.draw.getPosition().getOriginalMainPositionList(),g=this.draw.getPageRowList()[e];t.save(),t.fillStyle=i,t.font=`${r*n}px ${s}`;for(let L=0;L{El(this.draw,t)})}}class xl{constructor(t){h(this,"draw");h(this,"range");h(this,"position");h(this,"tableTool");h(this,"tableParticle");h(this,"options");this.draw=t,this.range=t.getRange(),this.position=t.getPosition(),this.tableTool=t.getTableTool(),this.tableParticle=t.getTableParticle(),this.options=t.getOptions()}insertTable(t,e){var L;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const{defaultTrMinHeight:r}=this.options.table,s=this.draw.getElementList();let l=0;if((L=s[n])==null?void 0:L.listId){const O=this.position.getPositionList(),{rowIndex:M}=O[n],T=this.draw.getRowList()[M];l=(T==null?void 0:T.offsetX)||0}const R=this.draw.getContextInnerWidth()-l,a=[],c=R/e;for(let O=0;O1&&O.rowIndex+O.rowspan>=u+1&&(O.rowspan+=1)}}}const a=Pt(),c={height:R.height,id:a,tdList:[]};for(let u=0;u1&&M.rowIndex+M.rowspan>=d+1&&(M.rowspan+=1)}}}const c=Pt(),u={height:a.height,id:c,tdList:[]};for(let d=0;ds+l.width,0),r=this.draw.getOriginalInnerWidth();if(i>r){const s=n.filter(R=>R.width>e),l=(i-r)/s.length;for(let R=0;R=e&&(a.width-=l)}}}insertTableLeftCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,tableId:i}=t,s=this.draw.getOriginalElementList()[e],l=s.trList,R=n;for(let u=0;ua&&L.rowspan--}}for(let c=0;c1){const d=Pt(),g=l[n+1];g.tdList.splice(c,0,{id:d,rowspan:u.rowspan-1,colspan:u.colspan,value:[{value:_,size:16,tableId:s.id,trId:g.id,tdId:d}]})}}l.splice(n,1),this.position.setPositionContext({isTable:!1}),this.range.clearRange(),this.draw.render({curIndex:t.index}),this.tableTool.dispose()}deleteTableCol(){var u;const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,trIndex:i}=t,s=this.draw.getOriginalElementList()[e],l=s.trList,a=l[i].tdList[n].colIndex;if(!l.find(d=>d.tdList.length>1)){this.deleteTable();return}for(let d=0;da&&(O.colspan>1?O.colspan--:g.tdList.splice(L,1))}}(u=s.colgroup)==null||u.splice(a,1),this.position.setPositionContext({isTable:!1}),this.range.setRange(0,0),this.draw.render({curIndex:t.index}),this.tableTool.dispose()}deleteTable(){const t=this.position.getPositionContext();if(!t.isTable)return;this.draw.getOriginalElementList().splice(t.index,1);const n=t.index-1;this.position.setPositionContext({isTable:!1,index:n}),this.range.setRange(n,n),this.draw.render({curIndex:n}),this.tableTool.dispose()}mergeTableCell(){const t=this.position.getPositionContext();if(!t.isTable)return;const{isCrossRowCol:e,startTdIndex:n,endTdIndex:i,startTrIndex:r,endTrIndex:s}=this.range.getRange();if(!e)return;const{index:l}=t,c=this.draw.getOriginalElementList()[l].trList;let u=c[r].tdList[n],d=c[s].tdList[i];(u.x>d.x||u.y>d.y)&&([u,d]=[d,u]);const g=u.colIndex,L=d.colIndex+(d.colspan-1),O=u.rowIndex,M=d.rowIndex+(d.rowspan-1),P=[];for(let Q=0;Q=g&&w<=L&&G>=O&&G<=M&&f.push(C)}f.length&&P.push(f)}if(!P.length)return;const T=P[P.length-1],X=P[0][0],S=T[T.length-1],N=X.x,W=X.y,p=S.x+S.width,Z=S.y+S.height;for(let Q=0;QC||W>w||p1){for(let d=1;d1){for(let d=1;d{var l;return!((l=s.borderTypes)==null?void 0:l.includes(t))});n.forEach(s=>{s.borderTypes||(s.borderTypes=[]);const l=s.borderTypes.findIndex(R=>R===t);i?~l||s.borderTypes.push(t):~l&&s.borderTypes.splice(l,1),s.borderTypes.length||delete s.borderTypes});const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r})}tableTdSlashType(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;const n=e.flat(),i=n.some(s=>{var l;return!((l=s.slashTypes)==null?void 0:l.includes(t))});n.forEach(s=>{s.slashTypes||(s.slashTypes=[]);const l=s.slashTypes.findIndex(R=>R===t);i?~l||s.slashTypes.push(t):~l&&s.slashTypes.splice(l,1),s.slashTypes.length||delete s.slashTypes});const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r})}tableTdBackgroundColor(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;for(let i=0;i`[^${R}][${R}]`).join("|")}`),this.rowList=[],this.pageRowList=[],this.painterStyle=null,this.painterOptions=null,this.visiblePageNoList=[],this.intersectionPageNo=0,this.lazyRenderIntersectionObserver=null,this.printModeData=null,this.render({isInit:!0,isSetCursor:!1,isFirstRender:!0})}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}setMode(t){if(this.mode!==t){if(t===at.PRINT){this.printModeData={header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()};const e=Ot(this.printModeData);["header","main","footer"].forEach(i=>{e[i]=this.control.filterAssistElement(e[i])}),this.setEditorData(e)}this.mode===at.PRINT&&this.printModeData&&(this.setEditorData(this.printModeData),this.printModeData=null),this.clearSideEffect(),this.range.clearRange(),this.mode=t,this.options.mode=t,this.render({isSetCursor:!1,isSubmitHistory:!1})}}isReadonly(){switch(this.mode){case at.DESIGN:return!1;case at.READONLY:case at.PRINT:return!0;case at.FORM:return!this.control.getIsRangeWithinControl();default:return!1}}isDisabled(){var r,s,l,R,a;if(this.mode===at.DESIGN)return!1;const{startIndex:t,endIndex:e}=this.range.getRange(),n=this.getElementList();if((r=this.getTd())==null?void 0:r.disabled)return!0;if(t===e){const c=n[t],u=n[t+1];return!!(((s=c==null?void 0:c.title)==null?void 0:s.disabled)&&((l=u==null?void 0:u.title)==null?void 0:l.disabled)||((R=c==null?void 0:c.control)==null?void 0:R.disabled)&&((a=u==null?void 0:u.control)==null?void 0:a.disabled))}return n.slice(t+1,e+1).some(c=>{var u,d;return((u=c.title)==null?void 0:u.disabled)||((d=c.control)==null?void 0:d.disabled)})}isDesignMode(){return this.mode===at.DESIGN}getOriginalWidth(){const{paperDirection:t,width:e,height:n}=this.options;return t===ce.VERTICAL?e:n}getOriginalHeight(){const{paperDirection:t,width:e,height:n}=this.options;return t===ce.VERTICAL?n:e}getWidth(){return Math.floor(this.getOriginalWidth()*this.options.scale)}getHeight(){return Math.floor(this.getOriginalHeight()*this.options.scale)}getMainHeight(){return this.getHeight()-this.getMainOuterHeight()}getMainOuterHeight(){const t=this.getMargins(),e=this.header.getExtraHeight(),n=this.footer.getExtraHeight();return t[0]+t[2]+e+n}getCanvasWidth(t=-1){return this.getPage(t).width}getCanvasHeight(t=-1){return this.getPage(t).height}getInnerWidth(){const t=this.getWidth(),e=this.getMargins();return t-e[1]-e[3]}getOriginalInnerWidth(){const t=this.getOriginalWidth(),e=this.getOriginalMargins();return t-e[1]-e[3]}getContextInnerWidth(){const t=this.position.getPositionContext();if(t.isTable){const{index:e,trIndex:n,tdIndex:i}=t,s=this.getOriginalElementList()[e].trList[n].tdList[i],l=this.getTdPadding();return s.width-l[1]-l[3]}return this.getOriginalInnerWidth()}getMargins(){return this.getOriginalMargins().map(t=>t*this.options.scale)}getOriginalMargins(){const{margins:t,paperDirection:e}=this.options;return e===ce.VERTICAL?t:[t[1],t[2],t[3],t[0]]}getPageGap(){return this.options.pageGap*this.options.scale}getOriginalPageGap(){return this.options.pageGap}getPageNumberBottom(){const{pageNumber:{bottom:t},scale:e}=this.options;return t*e}getMarginIndicatorSize(){return this.options.marginIndicatorSize*this.options.scale}getDefaultBasicRowMarginHeight(){return this.options.defaultBasicRowMarginHeight*this.options.scale}getTdPadding(){const{table:{tdPadding:t},scale:e}=this.options;return t.map(n=>n*e)}getContainer(){return this.container}getPageContainer(){return this.pageContainer}getVisiblePageNoList(){return this.visiblePageNoList}setVisiblePageNoList(t){this.visiblePageNoList=t,this.listener.visiblePageNoListChange&&this.listener.visiblePageNoListChange(this.visiblePageNoList),this.eventBus.isSubscribe("visiblePageNoListChange")&&this.eventBus.emit("visiblePageNoListChange",this.visiblePageNoList)}getIntersectionPageNo(){return this.intersectionPageNo}setIntersectionPageNo(t){this.intersectionPageNo=t,this.listener.intersectionPageNoChange&&this.listener.intersectionPageNoChange(this.intersectionPageNo),this.eventBus.isSubscribe("intersectionPageNoChange")&&this.eventBus.emit("intersectionPageNoChange",this.intersectionPageNo)}getPageNo(){return this.pageNo}setPageNo(t){this.pageNo=t}getPage(t=-1){return this.pageList[~t?t:this.pageNo]}getPageList(){return this.pageList}getPageCount(){return this.pageList.length}getTableRowList(t){const e=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:r}=e;return t[n].trList[i].tdList[r].rowList}getOriginalRowList(){const t=this.getZone();return t.isHeaderActive()?this.header.getRowList():t.isFooterActive()?this.footer.getRowList():this.rowList}getRowList(){return this.position.getPositionContext().isTable?this.getTableRowList(this.getOriginalElementList()):this.getOriginalRowList()}getPageRowList(){return this.pageRowList}getCtx(){return this.ctxList[this.pageNo]}getOptions(){return this.options}getSearch(){return this.search}getGroup(){return this.group}getHistoryManager(){return this.historyManager}getPosition(){return this.position}getZone(){return this.zone}getRange(){return this.range}getLineBreakParticle(){return this.lineBreakParticle}getTextParticle(){return this.textParticle}getHeaderElementList(){return this.header.getElementList()}getTableElementList(t){var s;const e=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:r}=e;return((s=t[n].trList)==null?void 0:s[i].tdList[r].value)||[]}getElementList(){const t=this.position.getPositionContext(),e=this.getOriginalElementList();return t.isTable?this.getTableElementList(e):e}getMainElementList(){return this.position.getPositionContext().isTable?this.getTableElementList(this.elementList):this.elementList}getOriginalElementList(){const t=this.getZone();return t.isHeaderActive()?this.getHeaderElementList():t.isFooterActive()?this.getFooterElementList():this.elementList}getOriginalMainElementList(){return this.elementList}getFooterElementList(){return this.footer.getElementList()}getTd(){const t=this.position.getPositionContext(),{index:e,trIndex:n,tdIndex:i,isTable:r}=t;return r?this.getOriginalElementList()[e].trList[n].tdList[i]:null}insertElementList(t){if(!t.length||!this.range.getIsCanInput())return;const{startIndex:e,endIndex:n}=this.range.getRange();if(!~e&&!~n)return;_t(t,{isHandleFirstElement:!1,editorOptions:this.options});let i=-1,r=this.control.getActiveControl();if(!r&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),r=this.control.getActiveControl()),r&&this.control.getIsRangeWithinControl())i=r.setValue(t,void 0,{isIgnoreDisabledRule:!0});else{const s=this.getElementList(),l=e===n,R=e+1;l||this.spliceElementList(s,R,n-e),this.spliceElementList(s,R,0,...t),i=e+t.length;const a=s[R-1];t[0].listId&&a&&!a.listId&&(a==null?void 0:a.value)===_&&(!a.type||a.type===F.TEXT)&&(s.splice(e,1),i-=1)}~i&&(this.range.setRange(i,i),this.render({curIndex:i}))}appendElementList(t,e={}){if(!t.length)return;_t(t,{isHandleFirstElement:!1,editorOptions:this.options});let n;const{isPrepend:i}=e;i?(this.elementList.splice(1,0,...t),n=t.length):(this.elementList.push(...t),n=this.elementList.length-1),this.range.setRange(n,n),this.render({curIndex:n})}spliceElementList(t,e,n,...i){var s,l,R,a;const r=this.isDesignMode();if(n>0){const c=e+n,u=t[c],d=u==null?void 0:u.listId;if(d&&((s=t[e-1])==null?void 0:s.listId)!==d){let g=c;for(;g=e;){const O=t[L];(r||g!==!1&&((R=O==null?void 0:O.control)==null?void 0:R.deletable)!==!1&&((a=O==null?void 0:O.title)==null?void 0:a.deletable)!==!1)&&t.splice(L,1),L--}}}for(let c=0;cl.toDataURL());return e&&this.setPagePixelRatio(null),r&&this.setMode(i),s}getPainterStyle(){return this.painterStyle&&Object.keys(this.painterStyle).length?this.painterStyle:null}getPainterOptions(){return this.painterOptions}setPainterStyle(t,e){this.painterStyle=t,this.painterOptions=e||null,this.getPainterStyle()&&this.pageList.forEach(n=>n.style.cursor="copy")}setDefaultRange(){!this.elementList.length||setTimeout(()=>{const t=this.elementList.length-1;this.range.setRange(t,t),this.range.setRangeStyle()})}getIsPagingMode(){return this.options.pageMode===Fe.PAGING}setPageMode(t){if(!t||this.options.pageMode===t)return;if(this.options.pageMode=t,t===Fe.PAGING){const{height:i}=this.options,r=this.getPagePixelRatio(),s=this.pageList[0];s.style.height=`${i}px`,s.height=i*r,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(lt.MAIN);const{startIndex:e}=this.range.getRange(),n=this.range.getIsCollapsed();this.render({isSetCursor:!0,curIndex:e,isSubmitHistory:!1}),n||this.cursor.drawCursor({isShow:!1}),setTimeout(()=>{this.listener.pageModeChange&&this.listener.pageModeChange(t),this.eventBus.isSubscribe("pageModeChange")&&this.eventBus.emit("pageModeChange",t)})}setPageScale(t){const e=this.getPagePixelRatio();this.options.scale=t;const n=this.getWidth(),i=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((s,l)=>{s.width=n*e,s.height=i*e,s.style.width=`${n}px`,s.style.height=`${i}px`,s.style.marginBottom=`${this.getPageGap()}px`,this._initPageContext(this.ctxList[l])});const r=this.position.getCursorPosition();this.render({isSubmitHistory:!1,isSetCursor:!!r,curIndex:r==null?void 0:r.index}),this.listener.pageScaleChange&&this.listener.pageScaleChange(t),this.eventBus.isSubscribe("pageScaleChange")&&this.eventBus.emit("pageScaleChange",t)}getPagePixelRatio(){return this.pagePixelRatio||window.devicePixelRatio}setPagePixelRatio(t){!this.pagePixelRatio&&t===window.devicePixelRatio||t===this.pagePixelRatio||(this.pagePixelRatio=t,this.setPageDevicePixel())}setPageDevicePixel(){const t=this.getPagePixelRatio(),e=this.getWidth(),n=this.getHeight();this.pageList.forEach((i,r)=>{i.width=e*t,i.height=n*t,this._initPageContext(this.ctxList[r])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperSize(t,e){this.options.width=t,this.options.height=e;const n=this.getPagePixelRatio(),i=this.getWidth(),r=this.getHeight();this.container.style.width=`${i}px`,this.pageList.forEach((s,l)=>{s.width=i*n,s.height=r*n,s.style.width=`${i}px`,s.style.height=`${r}px`,this._initPageContext(this.ctxList[l])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperDirection(t){const e=this.getPagePixelRatio();this.options.paperDirection=t;const n=this.getWidth(),i=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((r,s)=>{r.width=n*e,r.height=i*e,r.style.width=`${n}px`,r.style.height=`${i}px`,this._initPageContext(this.ctxList[s])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperMargin(t){this.options.margins=t,this.render({isSubmitHistory:!1,isSetCursor:!1})}getValue(t={}){const{pageNo:e,extraPickAttrs:n}=t;let i=this.elementList;Number.isInteger(e)&&e>=0&&es.elementList));const r={header:Tt(this.getHeaderElementList(),{extraPickAttrs:n}),main:Tt(i,{extraPickAttrs:n}),footer:Tt(this.getFooterElementList(),{extraPickAttrs:n})};return{version:Js,data:r,options:Ot(this.options)}}setValue(t,e){const{header:n,main:i,footer:r}=Ot(t);if(!n&&!i&&!r)return;const{isSetCursor:s=!1}=e||{};[n,i,r].forEach(a=>{!a||_t(a,{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData({header:n,main:i,footer:r}),this.historyManager.recovery();const R=s?(i==null?void 0:i.length)?i.length-1:0:void 0;R!==void 0&&this.range.setRange(R,R),this.render({curIndex:R,isSetCursor:s,isFirstRender:!0})}setEditorData(t){const{header:e,main:n,footer:i}=t;e&&this.header.setElementList(e),n&&(this.elementList=n),i&&this.footer.setElementList(i)}_wrapContainer(t){const e=document.createElement("div");return t.append(e),e}_formatContainer(){this.container.style.position="relative",this.container.style.width=`${this.getWidth()}px`,this.container.setAttribute(le,se.MAIN)}_createPageContainer(){const t=document.createElement("div");return t.classList.add(`${k}-page-container`),this.container.append(t),t}_createPage(t){const e=this.getWidth(),n=this.getHeight(),i=document.createElement("canvas");i.style.width=`${e}px`,i.style.height=`${n}px`,i.style.display="block",i.style.backgroundColor="#ffffff",i.style.marginBottom=`${this.getPageGap()}px`,i.setAttribute("data-index",String(t)),this.pageContainer.append(i);const r=this.getPagePixelRatio();i.width=e*r,i.height=n*r,i.style.cursor="text";const s=i.getContext("2d");this._initPageContext(s),this.pageList.push(i),this.ctxList.push(s)}_initPageContext(t){const e=this.getPagePixelRatio();t.scale(e,e),t.letterSpacing="0px",t.wordSpacing="0px",t.direction="ltr"}getElementFont(t,e=1){const{defaultSize:n,defaultFont:i}=this.options,r=t.font||i,s=t.actualSize||t.size||n;return`${t.italic?"italic ":""}${t.bold?"bold ":""}${s*e}px ${r}`}getElementSize(t){return t.actualSize||t.size||this.options.defaultSize}getElementRowMargin(t){var r;const{defaultBasicRowMarginHeight:e,defaultRowMargin:n,scale:i}=this.options;return e*((r=t.rowMargin)!=null?r:n)*i}computeRowList(t){var Y,Q,U,f,E,C,w,G,v,q,st,Yt;const{innerWidth:e,elementList:n,isPagingMode:i=!1,isFromTable:r=!1,startX:s=0,startY:l=0,pageHeight:R=0,mainOuterHeight:a=0,surroundElementList:c=[]}=t,{defaultSize:u,defaultRowMargin:d,scale:g,table:{tdPadding:L},defaultTabWidth:O}=this.options,M=this.getDefaultBasicRowMarginHeight(),T=document.createElement("canvas").getContext("2d"),X=this.listParticle.computeListStyle(T,n),S=[];n.length&&S.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowIndex:0,rowFlex:((Y=n==null?void 0:n[0])==null?void 0:Y.rowFlex)||((Q=n==null?void 0:n[1])==null?void 0:Q.rowFlex)});let N=s,W=l,p=0,Z,V=0,m=0;for(let ot=0;otnt){const Lt=Zt*nt/ut;x.width=nt/g,x.height=Lt/g,B.width=nt,B.height=Lt,B.boundingBoxDescent=Lt}else B.width=ut,B.height=Zt,B.boundingBoxDescent=Zt}B.boundingBoxAscent=0}else if(x.type===F.TABLE){const ut=L[1]+L[3],Zt=L[0]+L[2];if(x.pagingId){let Ut=ot+1,xt=0;for(;Ut!vt.pagingRepeat);x.trList.push(...Nt),x.height+=mt.height,Ut++,xt++}else break}xt&&n.splice(ot+1,xt)}x.pagingIndex=(f=x.pagingIndex)!=null?f:0,this.tableParticle.computeRowColInfo(x);const Lt=x.trList;for(let Ut=0;UtKt+Ct.height,0);Nt.rowList=vt;const Mt=Ft/g+Zt;if(Nt.height{ge.height+=Kt})}let yt=0,ft=0,pt=0;for(;pt0){const Nt=Lt[Ut];Nt.height-=mt,Nt.tdList.forEach(vt=>{vt.height-=mt})}}this.tableParticle.computeRowColInfo(x);const fe=this.tableParticle.getTableHeight(x),ve=this.tableParticle.getTableWidth(x);x.width=ve,x.height=fe;const Be=ve*g,Ae=fe*g;if(B.width=Be,B.height=Ae,B.boundingBoxDescent=Ae,B.boundingBoxAscent=-St,((E=n[ot+1])==null?void 0:E.type)===F.TABLE&&(B.boundingBoxAscent-=St),i){const Ut=this.getHeight(),xt=this.getMainOuterHeight();let mt=xt;for(let Ft=0;FtUt||((C=S[Ft-1])==null?void 0:C.isPageBreak)?mt=xt+Mt.height:mt+=Mt.height}const Nt=St*2*g,vt=x.trList[0].height*g;if((mt+vt+Nt>Ut||x.pagingIndex!==0&&x.trList[0].pagingRepeat)&&(mt=xt),mt+Nt+Ae>Ut){const Ft=x.trList;let Mt=0,yt=0,ft=0;if(Ft.length>1)for(let pt=0;ptUt){const ge=Kt.tdList.reduce((Bt,Ie)=>Bt+Ie.colspan,0);((w=x.colgroup)==null?void 0:w.length)!==ge&&(yt=0);break}else Mt=pt+1,yt=Ft.length-Mt,ft+=Ct}if(yt){const pt=Ft.splice(Mt,yt),Kt=pt.reduce((Me,Ye)=>Me+Ye.height,0),Ct=Kt*g,ge=x.pagingId||Pt();x.pagingId=ge,x.height-=Kt,B.height-=Ct,B.boundingBoxDescent-=Ct;const Bt=Ot(x);Bt.pagingId=ge,Bt.pagingIndex=x.pagingIndex+1;const Ie=Ft.filter(Me=>Me.pagingRepeat);if(Ie.length){const Me=Ot(Ie);Me.forEach(Ye=>Ye.id=Pt()),pt.unshift(...Me)}Bt.trList=pt,Bt.id=Pt(),this.spliceElementList(n,ot+1,0,Bt)}}if(x.pagingId){const Ft=this.position.getPositionContext();if(Ft.isTable){let Mt=-1,yt=-1,ft=ot;for(;ftCt.id===Ft.trId);if(~Kt){Mt=ft,yt=Kt;break}ft++}~Mt&&(Ft.index=Mt,Ft.trIndex=yt,this.position.setPositionContext(Ft))}}}}else if(x.type===F.SEPARATOR){const{separator:{lineWidth:ut}}=this.options;x.width=nt/g,B.width=nt,B.height=ut*g,B.boundingBoxAscent=-St,B.boundingBoxDescent=-St+B.height}else if(x.type===F.PAGE_BREAK)x.width=nt/g,B.width=nt,B.height=u;else if(x.type===F.RADIO||x.controlComponent===D.RADIO){const{width:ut,height:Zt,gap:Lt}=this.options.radio,Qt=ut+Lt*2;x.width=Qt,B.width=Qt*g,B.height=Zt*g}else if(x.type===F.CHECKBOX||x.controlComponent===D.CHECKBOX){const{width:ut,height:Zt,gap:Lt}=this.options.checkbox,Qt=ut+Lt*2;x.width=Qt,B.width=Qt*g,B.height=Zt*g}else if(x.type===F.TAB)B.width=O*g,B.height=u*g,B.boundingBoxDescent=0,B.boundingBoxAscent=B.height;else if(x.type===F.BLOCK){if(!x.width)B.width=nt;else{const ut=x.width*g;B.width=Math.min(ut,nt)}B.height=x.height*g,B.boundingBoxDescent=B.height,B.boundingBoxAscent=0}else{const ut=x.size||u;(x.type===F.SUPERSCRIPT||x.type===F.SUBSCRIPT)&&(x.actualSize=Math.ceil(ut*.6)),B.height=(x.actualSize||ut)*g,T.font=this.getElementFont(x);const Zt=this.textParticle.measureText(T,x);B.width=Zt.width*g,x.letterSpacing&&(B.width+=x.letterSpacing*g),B.boundingBoxAscent=(x.value===_?x.size||u:Zt.actualBoundingBoxAscent)*g,B.boundingBoxDescent=Zt.actualBoundingBoxDescent*g,x.type===F.SUPERSCRIPT?B.boundingBoxAscent+=B.height/2:x.type===F.SUBSCRIPT&&(B.boundingBoxDescent+=B.height/2)}const bt=x.imgDisplay!==et.INLINE&&x.type===F.IMAGE||x.type===F.LATEX?B.height+St:B.boundingBoxAscent+St,$t=St+B.boundingBoxAscent+B.boundingBoxDescent+St,Dt=Object.assign(x,{metrics:B,left:0,style:this.getElementFont(x,g)});((G=Dt.control)==null?void 0:G.minWidth)&&(Dt.controlComponent&&(m+=B.width),Dt.controlComponent===D.POSTFIX&&(this.control.setMinWidthControlInfo({row:$,rowElement:Dt,availableWidth:nt,controlRealWidth:m}),m=0));const gt=n[ot-1];let Pe=n[ot+1],oe=$.width+B.width;if(this.options.wordBreak===Pn.BREAK_WORD&&(!(gt==null?void 0:gt.type)||(gt==null?void 0:gt.type)===F.TEXT)&&(!x.type||x.type===F.TEXT)){const ut=`${(gt==null?void 0:gt.value)||""}${x.value}`;if(this.WORD_LIKE_REG.test(ut)){const{width:Lt,endElement:Qt}=this.textParticle.measureWord(T,n,ot),fe=Lt*g;fe<=nt&&(oe+=fe,Pe=Qt)}oe+=this.textParticle.measurePunctuationWidth(T,Pe)*g}x.listId&&(x.listId!==Z?V=0:x.value===_&&!x.listWrap&&V++),Z=x.listId;const He=this.position.setSurroundPosition({pageNo:p,rowElement:Dt,row:$,rowElementRect:{x:N,y:W,height:$t,width:B.width},availableWidth:nt,surroundElementList:c});N=He.x,oe+=He.rowIncreaseWidth,N+=B.width;const ye=x.type===F.SEPARATOR||x.type===F.TABLE||(gt==null?void 0:gt.type)===F.TABLE||(gt==null?void 0:gt.type)===F.BLOCK||x.type===F.BLOCK||(gt==null?void 0:gt.imgDisplay)===et.INLINE||x.imgDisplay===et.INLINE||(gt==null?void 0:gt.listId)!==x.listId||ot!==0&&x.value===_,Ge=oe>nt,Je=ye||Ge;if(Je){const ut={width:B.width,height:$t,startIndex:ot,elementList:[Dt],ascent:bt,rowIndex:$.rowIndex+1,rowFlex:((v=n[ot])==null?void 0:v.rowFlex)||((q=n[ot+1])==null?void 0:q.rowFlex),isPageBreak:x.type===F.PAGE_BREAK};if(Dt.controlComponent!==D.PREFIX&&((st=Dt.control)==null?void 0:st.indentation)===yn.VALUE_START){const Zt=$.elementList.findIndex(Lt=>Lt.controlId===Dt.controlId&&Lt.controlComponent!==D.PREFIX);if(~Zt){const Qt=this.position.computeRowPosition({row:$,innerWidth:this.getInnerWidth()})[Zt];Qt&&(ut.offsetX=Qt.coordinate.leftTop[0])}}x.listId&&(ut.isList=!0,ut.offsetX=X.get(x.listId),ut.listIndex=V),S.push(ut)}else $.width+=B.width,ot===0&&Ee(n[1])?($.height=M,$.ascent=M):$.height<$t&&($.height=$t,$.ascent=bt),$.elementList.push(Dt);if((Je||ot===n.length-1)&&($.isWidthNotEnough=Ge&&!ye,!$.isSurround&&((gt==null?void 0:gt.rowFlex)===Rt.JUSTIFY||(gt==null?void 0:gt.rowFlex)===Rt.ALIGNMENT&&$.isWidthNotEnough))){const ut=((Yt=$.elementList[0])==null?void 0:Yt.value)===_?$.elementList.slice(1):$.elementList,Zt=(nt-$.width)/(ut.length-1);for(let Lt=0;LtR||x.type===F.PAGE_BREAK)&&(W=l,qo(c,p),p+=1),Dt.left=0;const ut=S[S.length-1];N=this.position.setSurroundPosition({pageNo:p,rowElement:Dt,row:ut,rowElementRect:{x:N,y:W,height:$t,width:B.width},availableWidth:nt,surroundElementList:c}).x,N+=B.width}}return S}_computePageList(){var R;const t=[[]],{pageMode:e,pageNumber:{maxPageNo:n}}=this.options,i=this.getHeight(),r=this.getMainOuterHeight();let s=r,l=0;if(e===Fe.CONTINUITY){t[0]=this.rowList,s+=this.rowList.reduce((d,g)=>d+g.height,0);const a=this.getPagePixelRatio(),c=this.pageList[0],u=Number(c.style.height.replace("px",""));if(s>u)c.style.height=`${s}px`,c.height=s*a;else{const d=si||((R=this.rowList[a-1])==null?void 0:R.isPageBreak)){if(Number.isInteger(n)&&l>=n){this.elementList=this.elementList.slice(0,c.startIndex);break}s=r+c.height,t.push([c]),l++}else s+=c.height,t[l].push(c)}return t}_drawHighlight(t,e){var l;const{control:{activeBackgroundColor:n}}=this.options,{rowList:i,positionList:r}=e,s=(l=this.control.getActiveControl())==null?void 0:l.getElement();for(let R=0;R{n.forEach(i=>{if(i.isIntersecting){const r=Number(i.target.dataset.index);this._drawPage({elementList:e,positionList:t,rowList:this.pageRowList[r],pageNo:r})}})}),this.pageList.forEach(n=>{this.lazyRenderIntersectionObserver.observe(n)})}_immediateRender(){const t=this.position.getOriginalMainPositionList(),e=this.getOriginalMainElementList();for(let n=0;nO){const P=M-O;this.ctxList.splice(O,P),this.pageList.splice(O,P).forEach(T=>T.remove())}l&&g?this._lazyRender():this._immediateRender(),r?u=this.setCursor(u):this.range.getIsSelection()&&this.cursor.focus(),(i&&!c||u!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(u),cn(()=>{s&&this.control.getActiveControl()&&this.control.reAwakeControl(),s&&!this.isReadonly()&&this.position.getPositionContext().isTable&&this.tableTool.render(),s&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator(),L!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(i||a)&&!R&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"))})}setCursor(t){var r;const e=this.position.getPositionContext(),n=this.position.getPositionList();if(e.isTable){const{index:s,trIndex:l,tdIndex:R}=e,c=(r=this.getOriginalElementList()[s].trList)==null?void 0:r[l].tdList[R].positionList;t===void 0&&c&&(t=c.length-1);const u=c==null?void 0:c[t];this.position.setCursorPosition(u||null)}else this.position.setCursorPosition(t!==void 0?n[t]:null);let i=!0;if(t!==void 0&&e.isImage&&e.isDirectHit){const l=this.getElementList()[t];if(uo.includes(l.type)){i=!1;const R=this.position.getCursorPosition();this.previewer.updateResizer(l,R)}}return this.cursor.drawCursor({isShow:i}),t}submitHistory(t){const e=this.position.getPositionContext(),n=Bn(this.elementList),i=Bn(this.header.getElementList()),r=Bn(this.footer.getElementList()),s=Ot(this.range.getRange()),l=this.pageNo,R=Ot(e),a=this.zone.getZone();this.historyManager.execute(()=>{this.zone.setZone(a),this.setPageNo(l),this.position.setPositionContext(Ot(R)),this.header.setElementList(Ot(i)),this.footer.setElementList(Ot(r)),this.elementList=Ot(n),this.range.replaceRange(Ot(s)),this.render({curIndex:t,isSubmitHistory:!1,isSourceHistory:!0})})}destroy(){this.container.remove(),this.globalEvent.removeEvent(),this.scrollObserver.removeEvent(),this.selectionObserver.removeEvent()}clearSideEffect(){this.getPreviewer().clearResizer(),this.getTableTool().dispose(),this.getHyperlinkParticle().clearHyperlinkPopup(),this.getDateParticle().clearDatePicker()}}class wl{constructor(t){h(this,"executeMode");h(this,"executeCut");h(this,"executeCopy");h(this,"executePaste");h(this,"executeSelectAll");h(this,"executeBackspace");h(this,"executeSetRange");h(this,"executeReplaceRange");h(this,"executeSetPositionContext");h(this,"executeForceUpdate");h(this,"executeBlur");h(this,"executeUndo");h(this,"executeRedo");h(this,"executePainter");h(this,"executeApplyPainterStyle");h(this,"executeFormat");h(this,"executeFont");h(this,"executeSize");h(this,"executeSizeAdd");h(this,"executeSizeMinus");h(this,"executeBold");h(this,"executeItalic");h(this,"executeUnderline");h(this,"executeStrikeout");h(this,"executeSuperscript");h(this,"executeSubscript");h(this,"executeColor");h(this,"executeHighlight");h(this,"executeTitle");h(this,"executeList");h(this,"executeRowFlex");h(this,"executeRowMargin");h(this,"executeInsertTable");h(this,"executeInsertTableTopRow");h(this,"executeInsertTableBottomRow");h(this,"executeInsertTableLeftCol");h(this,"executeInsertTableRightCol");h(this,"executeDeleteTableRow");h(this,"executeDeleteTableCol");h(this,"executeDeleteTable");h(this,"executeMergeTableCell");h(this,"executeCancelMergeTableCell");h(this,"executeTableTdVerticalAlign");h(this,"executeTableBorderType");h(this,"executeTableTdBorderType");h(this,"executeTableTdSlashType");h(this,"executeTableTdBackgroundColor");h(this,"executeTableSelectAll");h(this,"executeImage");h(this,"executeHyperlink");h(this,"executeDeleteHyperlink");h(this,"executeCancelHyperlink");h(this,"executeEditHyperlink");h(this,"executeSeparator");h(this,"executePageBreak");h(this,"executeAddWatermark");h(this,"executeDeleteWatermark");h(this,"executeSearch");h(this,"executeSearchNavigatePre");h(this,"executeSearchNavigateNext");h(this,"executeReplace");h(this,"executePrint");h(this,"executeReplaceImageElement");h(this,"executeSaveAsImageElement");h(this,"executeChangeImageDisplay");h(this,"executePageMode");h(this,"executePageScaleRecovery");h(this,"executePageScaleMinus");h(this,"executePageScaleAdd");h(this,"executePaperSize");h(this,"executePaperDirection");h(this,"executeSetPaperMargin");h(this,"executeInsertElementList");h(this,"executeAppendElementList");h(this,"executeUpdateElementById");h(this,"executeSetValue");h(this,"executeRemoveControl");h(this,"executeSetLocale");h(this,"executeLocationCatalog");h(this,"executeWordTool");h(this,"executeSetHTML");h(this,"executeSetGroup");h(this,"executeDeleteGroup");h(this,"executeLocationGroup");h(this,"executeSetZone");h(this,"executeSetControlValue");h(this,"executeSetControlExtension");h(this,"executeSetControlProperties");h(this,"executeSetControlHighlight");h(this,"executeLocationControl");h(this,"executeInsertControl");h(this,"executeUpdateOptions");h(this,"executeInsertTitle");h(this,"executeFocus");h(this,"getCatalog");h(this,"getImage");h(this,"getOptions");h(this,"getValue");h(this,"getHTML");h(this,"getText");h(this,"getWordCount");h(this,"getCursorPosition");h(this,"getRange");h(this,"getRangeText");h(this,"getRangeContext");h(this,"getRangeRow");h(this,"getRangeParagraph");h(this,"getKeywordRangeList");h(this,"getKeywordContext");h(this,"getPaperMargin");h(this,"getSearchNavigateInfo");h(this,"getLocale");h(this,"getGroupIds");h(this,"getControlValue");h(this,"getControlList");h(this,"getContainer");h(this,"getTitleValue");h(this,"getPositionContextByEvent");h(this,"getElementById");this.executeMode=t.mode.bind(t),this.executeCut=t.cut.bind(t),this.executeCopy=t.copy.bind(t),this.executePaste=t.paste.bind(t),this.executeSelectAll=t.selectAll.bind(t),this.executeBackspace=t.backspace.bind(t),this.executeSetRange=t.setRange.bind(t),this.executeReplaceRange=t.replaceRange.bind(t),this.executeSetPositionContext=t.setPositionContext.bind(t),this.executeForceUpdate=t.forceUpdate.bind(t),this.executeBlur=t.blur.bind(t),this.executeUndo=t.undo.bind(t),this.executeRedo=t.redo.bind(t),this.executePainter=t.painter.bind(t),this.executeApplyPainterStyle=t.applyPainterStyle.bind(t),this.executeFormat=t.format.bind(t),this.executeFont=t.font.bind(t),this.executeSize=t.size.bind(t),this.executeSizeAdd=t.sizeAdd.bind(t),this.executeSizeMinus=t.sizeMinus.bind(t),this.executeBold=t.bold.bind(t),this.executeItalic=t.italic.bind(t),this.executeUnderline=t.underline.bind(t),this.executeStrikeout=t.strikeout.bind(t),this.executeSuperscript=t.superscript.bind(t),this.executeSubscript=t.subscript.bind(t),this.executeColor=t.color.bind(t),this.executeHighlight=t.highlight.bind(t),this.executeTitle=t.title.bind(t),this.executeList=t.list.bind(t),this.executeRowFlex=t.rowFlex.bind(t),this.executeRowMargin=t.rowMargin.bind(t),this.executeInsertTable=t.insertTable.bind(t),this.executeInsertTableTopRow=t.insertTableTopRow.bind(t),this.executeInsertTableBottomRow=t.insertTableBottomRow.bind(t),this.executeInsertTableLeftCol=t.insertTableLeftCol.bind(t),this.executeInsertTableRightCol=t.insertTableRightCol.bind(t),this.executeDeleteTableRow=t.deleteTableRow.bind(t),this.executeDeleteTableCol=t.deleteTableCol.bind(t),this.executeDeleteTable=t.deleteTable.bind(t),this.executeMergeTableCell=t.mergeTableCell.bind(t),this.executeCancelMergeTableCell=t.cancelMergeTableCell.bind(t),this.executeTableTdVerticalAlign=t.tableTdVerticalAlign.bind(t),this.executeTableBorderType=t.tableBorderType.bind(t),this.executeTableTdBorderType=t.tableTdBorderType.bind(t),this.executeTableTdSlashType=t.tableTdSlashType.bind(t),this.executeTableTdBackgroundColor=t.tableTdBackgroundColor.bind(t),this.executeTableSelectAll=t.tableSelectAll.bind(t),this.executeImage=t.image.bind(t),this.executeHyperlink=t.hyperlink.bind(t),this.executeDeleteHyperlink=t.deleteHyperlink.bind(t),this.executeCancelHyperlink=t.cancelHyperlink.bind(t),this.executeEditHyperlink=t.editHyperlink.bind(t),this.executeSeparator=t.separator.bind(t),this.executePageBreak=t.pageBreak.bind(t),this.executeAddWatermark=t.addWatermark.bind(t),this.executeDeleteWatermark=t.deleteWatermark.bind(t),this.executeSearch=t.search.bind(t),this.executeSearchNavigatePre=t.searchNavigatePre.bind(t),this.executeSearchNavigateNext=t.searchNavigateNext.bind(t),this.executeReplace=t.replace.bind(t),this.executePrint=t.print.bind(t),this.executeReplaceImageElement=t.replaceImageElement.bind(t),this.executeSaveAsImageElement=t.saveAsImageElement.bind(t),this.executeChangeImageDisplay=t.changeImageDisplay.bind(t),this.executePageMode=t.pageMode.bind(t),this.executePageScaleRecovery=t.pageScaleRecovery.bind(t),this.executePageScaleMinus=t.pageScaleMinus.bind(t),this.executePageScaleAdd=t.pageScaleAdd.bind(t),this.executePaperSize=t.paperSize.bind(t),this.executePaperDirection=t.paperDirection.bind(t),this.executeSetPaperMargin=t.setPaperMargin.bind(t),this.executeInsertElementList=t.insertElementList.bind(t),this.executeAppendElementList=t.appendElementList.bind(t),this.executeUpdateElementById=t.updateElementById.bind(t),this.executeSetValue=t.setValue.bind(t),this.executeRemoveControl=t.removeControl.bind(t),this.executeSetLocale=t.setLocale.bind(t),this.executeLocationCatalog=t.locationCatalog.bind(t),this.executeWordTool=t.wordTool.bind(t),this.executeSetHTML=t.setHTML.bind(t),this.executeSetGroup=t.setGroup.bind(t),this.executeDeleteGroup=t.deleteGroup.bind(t),this.executeLocationGroup=t.locationGroup.bind(t),this.executeSetZone=t.setZone.bind(t),this.executeUpdateOptions=t.updateOptions.bind(t),this.executeInsertTitle=t.insertTitle.bind(t),this.executeFocus=t.focus.bind(t),this.getImage=t.getImage.bind(t),this.getOptions=t.getOptions.bind(t),this.getValue=t.getValue.bind(t),this.getHTML=t.getHTML.bind(t),this.getText=t.getText.bind(t),this.getWordCount=t.getWordCount.bind(t),this.getCursorPosition=t.getCursorPosition.bind(t),this.getRange=t.getRange.bind(t),this.getRangeText=t.getRangeText.bind(t),this.getRangeContext=t.getRangeContext.bind(t),this.getRangeRow=t.getRangeRow.bind(t),this.getRangeParagraph=t.getRangeParagraph.bind(t),this.getKeywordRangeList=t.getKeywordRangeList.bind(t),this.getKeywordContext=t.getKeywordContext.bind(t),this.getCatalog=t.getCatalog.bind(t),this.getPaperMargin=t.getPaperMargin.bind(t),this.getSearchNavigateInfo=t.getSearchNavigateInfo.bind(t),this.getLocale=t.getLocale.bind(t),this.getGroupIds=t.getGroupIds.bind(t),this.getContainer=t.getContainer.bind(t),this.getTitleValue=t.getTitleValue.bind(t),this.getPositionContextByEvent=t.getPositionContextByEvent.bind(t),this.getElementById=t.getElementById.bind(t),this.executeSetControlValue=t.setControlValue.bind(t),this.executeSetControlExtension=t.setControlExtension.bind(t),this.executeSetControlProperties=t.setControlProperties.bind(t),this.executeSetControlHighlight=t.setControlHighlight.bind(t),this.getControlValue=t.getControlValue.bind(t),this.getControlList=t.getControlList.bind(t),this.executeLocationControl=t.locationControl.bind(t),this.executeInsertControl=t.insertControl.bind(t)}}function Hl(o,t){return o===1125&&t===1593?{size:"a3",width:"297mm",height:"420mm"}:o===794&&t===1123?{size:"a4",width:"210mm",height:"297mm"}:o===565&&t===796?{size:"a5",width:"148mm",height:"210mm"}:{size:"",width:`${o}px`,height:`${t}px`}}function yl(o,t){const{width:e,height:n,direction:i=ce.VERTICAL}=t,r=document.createElement("iframe");r.style.visibility="hidden",r.style.position="absolute",r.style.left="0",r.style.top="0",r.style.width="0",r.style.height="0",r.style.border="none",document.body.append(r);const s=r.contentWindow,l=s.document;l.open();const R=document.createElement("div"),a=Hl(e,n);o.forEach(d=>{const g=document.createElement("img");g.style.width=i===ce.HORIZONTAL?a.height:a.width,g.style.height=i===ce.HORIZONTAL?a.width:a.height,g.src=d,R.append(g)});const c=document.createElement("style"),u=` * { margin: 0; padding: 0; } @page { margin: 0; size: ${a.size} ${i===ce.HORIZONTAL?"landscape":"portrait"}; }`;c.append(document.createTextNode(u)),setTimeout(()=>{l.write(`${c.outerHTML}${R.innerHTML}`),s.print(),l.close(),window.addEventListener("mouseover",()=>{r==null||r.remove()},{once:!0})})}class Gl{constructor(t){h(this,"draw");h(this,"range");h(this,"position");h(this,"historyManager");h(this,"canvasEvent");h(this,"options");h(this,"control");h(this,"workerManager");h(this,"searchManager");h(this,"i18n");h(this,"zone");h(this,"tableOperate");this.draw=t,this.range=t.getRange(),this.position=t.getPosition(),this.historyManager=t.getHistoryManager(),this.canvasEvent=t.getCanvasEvent(),this.options=t.getOptions(),this.control=t.getControl(),this.workerManager=t.getWorkerManager(),this.searchManager=t.getSearch(),this.i18n=t.getI18n(),this.zone=t.getZone(),this.tableOperate=t.getTableOperate()}mode(t){this.draw.setMode(t)}cut(){this.draw.isReadonly()||this.draw.isDisabled()||this.canvasEvent.cut()}copy(){this.canvasEvent.copy()}paste(t){this.draw.isReadonly()||this.draw.isDisabled()||ir(this.canvasEvent,t)}selectAll(){this.canvasEvent.selectAll()}backspace(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.draw.getElementList(),{startIndex:n,endIndex:i}=this.range.getRange(),r=n===i;if(r&&e[n].value===_&&n===0)return;r?this.draw.spliceElementList(e,n,1):this.draw.spliceElementList(e,n+1,i-n);const s=r?n-1:n;this.range.setRange(s,s),this.draw.render({curIndex:s})}setRange(t,e,n,i,r,s,l){if(t<0||e<0||ec.id===e);if(!~s)return;const R=r[s].trList[n],a=R.tdList[i];this.position.setPositionContext({isTable:!0,index:s,trIndex:n,tdIndex:i,tdId:a.id,trId:R.id,tableId:e})}else this.position.setPositionContext({isTable:!1})}forceUpdate(t){const{isSubmitHistory:e=!1}=t||{};this.range.clearRange(),this.draw.render({isSubmitHistory:e,isSetCursor:!1})}blur(){this.range.clearRange(),this.draw.getCursor().recoveryCursor()}undo(){this.draw.isReadonly()||this.historyManager.undo()}redo(){this.draw.isReadonly()||this.historyManager.redo()}painter(t){if(!t.isDblclick&&this.draw.getPainterStyle()){this.canvasEvent.clearPainterStyle();return}const e=this.range.getSelection();if(!e)return;const n={};e.forEach(i=>{Se.forEach(s=>{const l=s;n[l]===void 0&&(n[l]=i[l])})}),this.draw.setPainterStyle(n,t)}applyPainterStyle(){this.draw.isReadonly()||this.draw.isDisabled()||this.canvasEvent.applyPainterStyle()}format(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.range.getSelectionElementList();let n={},i=[];if(e==null?void 0:e.length)i=e,n={isSetCursor:!1};else{const{endIndex:r}=this.range.getRange(),l=this.draw.getElementList()[r];(l==null?void 0:l.value)===_&&(i.push(l),n={curIndex:r})}!i.length||(i.forEach(r=>{Se.forEach(s=>{delete r[s]})}),this.draw.render(n))}font(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=this.range.getSelectionElementList();if(n==null?void 0:n.length)n.forEach(i=>{i.font=t}),this.draw.render({isSetCursor:!1});else{const{endIndex:i}=this.range.getRange(),s=this.draw.getElementList()[i];(s==null?void 0:s.value)===_&&(s.font=t,this.draw.render({curIndex:i,isCompute:!1}))}}size(t){const{minSize:e,maxSize:n,defaultSize:i}=this.options;if(tn||this.draw.isReadonly()||this.draw.isDisabled())return;let s={},l=[];const R=this.range.getTextLikeSelectionElementList();if(R==null?void 0:R.length)l=R,s={isSetCursor:!1};else{const{endIndex:c}=this.range.getRange(),d=this.draw.getElementList()[c];(d==null?void 0:d.value)===_&&(l.push(d),s={curIndex:c})}if(!l.length)return;let a=!1;l.forEach(c=>{!c.size&&t===i||c.size&&c.size===t||(c.size=t,a=!0)}),a&&this.draw.render(s)}sizeAdd(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.range.getTextLikeSelectionElementList();let n={},i=[];if(e==null?void 0:e.length)i=e,n={isSetCursor:!1};else{const{endIndex:R}=this.range.getRange(),c=this.draw.getElementList()[R];(c==null?void 0:c.value)===_&&(i.push(c),n={curIndex:R})}if(!i.length)return;const{defaultSize:r,maxSize:s}=this.options;let l=!1;i.forEach(R=>{R.size||(R.size=r),!(R.size>=s)&&(R.size+2>s?R.size=s:R.size+=2,l=!0)}),l&&this.draw.render(n)}sizeMinus(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.range.getTextLikeSelectionElementList();let n={},i=[];if(e==null?void 0:e.length)i=e,n={isSetCursor:!1};else{const{endIndex:R}=this.range.getRange(),c=this.draw.getElementList()[R];(c==null?void 0:c.value)===_&&(i.push(c),n={curIndex:R})}if(!i.length)return;const{defaultSize:r,minSize:s}=this.options;let l=!1;i.forEach(R=>{R.size||(R.size=r),!(R.size<=s)&&(R.size-2!i.bold);e.forEach(i=>{i.bold=!!~n}),this.draw.render({isSetCursor:!1})}else{const{endIndex:n}=this.range.getRange(),r=this.draw.getElementList()[n];(r==null?void 0:r.value)===_&&(r.bold=!r.bold,this.draw.render({curIndex:n,isCompute:!1}))}}italic(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.range.getSelectionElementList();if(e==null?void 0:e.length){const n=e.findIndex(i=>!i.italic);e.forEach(i=>{i.italic=!!~n}),this.draw.render({isSetCursor:!1})}else{const{endIndex:n}=this.range.getRange(),r=this.draw.getElementList()[n];(r==null?void 0:r.value)===_&&(r.italic=!r.italic,this.draw.render({curIndex:n,isCompute:!1}))}}underline(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=this.range.getSelectionElementList();if(n==null?void 0:n.length){const i=n.some(r=>!r.underline||!t&&r.textDecoration||t&&!r.textDecoration||t&&r.textDecoration&&!so(r.textDecoration,t));n.forEach(r=>{r.underline=i,i&&t?r.textDecoration=t:delete r.textDecoration}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{const{endIndex:i}=this.range.getRange(),s=this.draw.getElementList()[i];(s==null?void 0:s.value)===_&&(s.underline=!s.underline,this.draw.render({curIndex:i,isCompute:!1}))}}strikeout(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.range.getSelectionElementList();if(e==null?void 0:e.length){const n=e.findIndex(i=>!i.strikeout);e.forEach(i=>{i.strikeout=!!~n}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{const{endIndex:n}=this.range.getRange(),r=this.draw.getElementList()[n];(r==null?void 0:r.value)===_&&(r.strikeout=!r.strikeout,this.draw.render({curIndex:n,isCompute:!1}))}}superscript(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.range.getSelectionElementList();if(!e)return;const n=e.findIndex(i=>i.type===F.SUPERSCRIPT);e.forEach(i=>{~n?i.type===F.SUPERSCRIPT&&(i.type=F.TEXT,delete i.actualSize):(!i.type||i.type===F.TEXT||i.type===F.SUBSCRIPT)&&(i.type=F.SUPERSCRIPT)}),this.draw.render({isSetCursor:!1})}subscript(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.range.getSelectionElementList();if(!e)return;const n=e.findIndex(i=>i.type===F.SUBSCRIPT);e.forEach(i=>{~n?i.type===F.SUBSCRIPT&&(i.type=F.TEXT,delete i.actualSize):(!i.type||i.type===F.TEXT||i.type===F.SUPERSCRIPT)&&(i.type=F.SUBSCRIPT)}),this.draw.render({isSetCursor:!1})}color(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=this.range.getSelectionElementList();if(n==null?void 0:n.length)n.forEach(i=>{t?i.color=t:delete i.color}),this.draw.render({isSetCursor:!1,isCompute:!1});else{const{endIndex:i}=this.range.getRange(),s=this.draw.getElementList()[i];(s==null?void 0:s.value)===_&&(t?s.color=t:delete s.color,this.draw.render({curIndex:i,isCompute:!1}))}}highlight(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=this.range.getSelectionElementList();if(n==null?void 0:n.length)n.forEach(i=>{t?i.highlight=t:delete i.highlight}),this.draw.render({isSetCursor:!1,isCompute:!1});else{const{endIndex:i}=this.range.getRange(),s=this.draw.getElementList()[i];(s==null?void 0:s.value)===_&&(t?s.highlight=t:delete s.highlight,this.draw.render({curIndex:i,isCompute:!1}))}}title(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.draw.getElementList(),s=n===i?this.range.getRangeParagraphElementList():r.slice(n+1,i+1);if(!s||!s.length)return;const l=Pt(),R=this.draw.getOptions().title;s.forEach(u=>{!u.type&&u.value===_||(t?(u.level=t,u.titleId=l,Ci(u)&&(u.size=R[Ei[t]],u.bold=!0)):u.titleId&&(delete u.titleId,delete u.title,delete u.level,delete u.size,delete u.bold))});const a=n===i,c=a?i:n;this.draw.render({curIndex:c,isSetCursor:a})}list(t,e){this.draw.isReadonly()||this.draw.getListParticle().setList(t,e)}rowFlex(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(R=>{R.rowFlex=t});const s=n===i,l=s?i:n;this.draw.render({curIndex:l,isSetCursor:s})}rowMargin(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(R=>{R.rowMargin=t});const s=n===i,l=s?i:n;this.draw.render({curIndex:l,isSetCursor:s})}insertTable(t,e){this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl()||this.tableOperate.insertTable(t,e)}insertTableTopRow(){this.draw.isReadonly()||this.tableOperate.insertTableTopRow()}insertTableBottomRow(){this.draw.isReadonly()||this.tableOperate.insertTableBottomRow()}insertTableLeftCol(){this.draw.isReadonly()||this.tableOperate.insertTableLeftCol()}insertTableRightCol(){this.draw.isReadonly()||this.tableOperate.insertTableRightCol()}deleteTableRow(){this.draw.isReadonly()||this.tableOperate.deleteTableRow()}deleteTableCol(){this.draw.isReadonly()||this.tableOperate.deleteTableCol()}deleteTable(){this.draw.isReadonly()||this.tableOperate.deleteTable()}mergeTableCell(){this.draw.isReadonly()||this.tableOperate.mergeTableCell()}cancelMergeTableCell(){this.draw.isReadonly()||this.tableOperate.cancelMergeTableCell()}tableTdVerticalAlign(t){this.draw.isReadonly()||this.tableOperate.tableTdVerticalAlign(t)}tableBorderType(t){this.draw.isReadonly()||this.tableOperate.tableBorderType(t)}tableTdBorderType(t){this.draw.isReadonly()||this.tableOperate.tableTdBorderType(t)}tableTdSlashType(t){this.draw.isReadonly()||this.tableOperate.tableTdSlashType(t)}tableTdBackgroundColor(t){this.draw.isReadonly()||this.tableOperate.tableTdBackgroundColor(t)}tableSelectAll(){this.tableOperate.tableSelectAll()}hyperlink(t){if(this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl())return;const{startIndex:i,endIndex:r}=this.range.getRange();if(!~i&&!~r)return;const s=this.draw.getElementList(),{valueList:l,url:R}=t,a=Pt(),c=l==null?void 0:l.map(g=>({url:R,hyperlinkId:a,value:g.value,type:F.HYPERLINK}));if(!c)return;const u=i+1;Ht(s,c,i,{editorOptions:this.options}),this.draw.spliceElementList(s,u,i===r?0:r-i,...c);const d=u+c.length-1;this.range.setRange(d,d),this.draw.render({curIndex:d})}getHyperlinkRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=this.draw.getElementList(),s=r[n];if(s.type!==F.HYPERLINK)return null;let l=n;for(;l>0;){if(r[l].hyperlinkId!==s.hyperlinkId){t=l+1;break}l--}let R=n+1;for(;R0;){const m=l[V],Y=l[V-1];if(m.titleId&&m.titleId!==(Y==null?void 0:Y.titleId)){p=m.titleId,Z=c[V].pageNo;break}V--}return Ot({isCollapsed:i,startElement:R,endElement:a,startPageNo:u,endPageNo:d,rangeRects:g,zone:P,isTable:T,trIndex:X!=null?X:null,tdIndex:S!=null?S:null,tableElement:W,selectionText:r,selectionElementList:s,titleId:p,titleStartPageNo:Z})}getRangeRow(){const t=this.range.getRangeRowElementList();return t?Tt(t):null}getRangeParagraph(){const t=this.range.getRangeParagraphElementList();return t?Tt(t):null}getKeywordRangeList(t){return this.range.getKeywordRangeList(t)}getKeywordContext(t){var s,l,R,a;const e=this.getKeywordRangeList(t);if(!e.length)return null;const n=[],i=this.position.getOriginalMainPositionList(),r=this.draw.getOriginalMainElementList();for(let c=0;cN.id===L);S&&(P=((a=(R=(l=(s=S.trList)==null?void 0:s[O])==null?void 0:l.tdList)==null?void 0:R[M])==null?void 0:a.positionList)||[])}const T=Ot(P[d]),X=Ot(P[g]);n.push({range:u,startPosition:T,endPosition:X})}return n}pageMode(t){this.draw.setPageMode(t)}pageScaleRecovery(){const{scale:t}=this.options;t!==1&&this.draw.setPageScale(1)}pageScaleMinus(){const{scale:t}=this.options,e=t*10-1;e>=5&&this.draw.setPageScale(e/10)}pageScaleAdd(){const{scale:t}=this.options,e=t*10+1;e<=30&&this.draw.setPageScale(e/10)}paperSize(t,e){this.draw.setPaperSize(t,e)}paperDirection(t){this.draw.setPaperDirection(t)}getPaperMargin(){return this.options.margins}setPaperMargin(t){return this.draw.setPaperMargin(t)}insertElementList(t){if(!t.length||this.draw.isReadonly()||this.draw.isDisabled())return;const n=Ot(t),{startIndex:i}=this.range.getRange(),r=this.draw.getElementList();Ht(r,n,i,{isBreakWhenWrap:!0,editorOptions:this.options}),this.draw.insertElementList(n)}appendElementList(t,e){!t.length||this.draw.isReadonly()||this.draw.appendElementList(Ot(t),e)}updateElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;function i(s){for(let l=0;l{let R=0;for(;Rl!==void 0?je(l,{innerWidth:r}):void 0;this.setValue({header:s(e),main:s(n),footer:s(i)})}setGroup(){return this.draw.isReadonly()?null:this.draw.getGroup().setGroup()}deleteGroup(t){this.draw.isReadonly()||this.draw.getGroup().deleteGroup(t)}getGroupIds(){return this.draw.getWorkerManager().getGroupIds()}locationGroup(t){const e=this.draw.getOriginalMainElementList(),n=this.draw.getGroup().getContextByGroupId(e,t);if(!n)return;const{isTable:i,index:r,trIndex:s,tdIndex:l,tdId:R,trId:a,tableId:c,endIndex:u}=n;this.position.setPositionContext({isTable:i,index:r,trIndex:s,tdIndex:l,tdId:R,trId:a,tableId:c}),this.range.setRange(u,u),this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}setZone(t){this.draw.getZone().setZone(t)}getControlValue(t){return this.draw.getControl().getValueById(t)}setControlValue(t){this.draw.getControl().setValueById(t)}setControlExtension(t){this.draw.getControl().setExtensionById(t)}setControlProperties(t){this.draw.getControl().setPropertiesById(t)}setControlHighlight(t){this.draw.getControl().setHighlightList(t),this.draw.render({isSubmitHistory:!1})}updateOptions(t){const e=vn(t);Object.entries(e).forEach(([n,i])=>{Reflect.set(this.options,n,i)}),this.forceUpdate()}getControlList(){return this.draw.getControl().getList()}locationControl(t,e){const n=(e==null?void 0:e.position)===ze.AFTER;function i(s,l){let R=0;for(;R{var a;let R=0;for(;R{$e(l,s,a)}),this.draw.insertElementList([n])}focus(t){const{position:e=ze.AFTER}=t||{},n=e===ze.BEFORE?0:this.draw.getOriginalMainElementList().length-1;this.range.setRange(n,n),this.draw.render({curIndex:n,isCompute:!1,isSubmitHistory:!1});const i=this.draw.getPosition().getPositionList();this.draw.getCursor().moveCursorToVisible({cursorPosition:i[n],direction:Et.DOWN})}}class Jl{constructor(){h(this,"rangeStyleChange");h(this,"visiblePageNoListChange");h(this,"intersectionPageNoChange");h(this,"pageSizeChange");h(this,"pageScaleChange");h(this,"saved");h(this,"contentChange");h(this,"controlChange");h(this,"pageModeChange");h(this,"zoneChange");this.rangeStyleChange=null,this.visiblePageNoListChange=null,this.intersectionPageNoChange=null,this.pageSizeChange=null,this.pageScaleChange=null,this.saved=null,this.contentChange=null,this.controlChange=null,this.pageModeChange=null,this.zoneChange=null}}class vl{constructor(t){h(this,"contextMenuList");h(this,"getContextMenuList");h(this,"shortcutList");h(this,"langMap");const{contextMenu:e,shortcut:n,i18n:i}=t;this.contextMenuList=e.registerContextMenuList.bind(e),this.getContextMenuList=e.getContextMenuList.bind(e),this.shortcutList=n.registerShortcutList.bind(n),this.langMap=i.registerLangMap.bind(i)}}const Rs={SELECTED_TEXT:"%s"},nn={GLOBAL:{CUT:"globalCut",COPY:"globalCopy",PASTE:"globalPaste",SELECT_ALL:"globalSelectAll",PRINT:"globalPrint"},CONTROL:{DELETE:"controlDelete"},HYPERLINK:{DELETE:"hyperlinkDelete",CANCEL:"hyperlinkCancel",EDIT:"hyperlinkEdit"},IMAGE:{CHANGE:"imageChange",SAVE_AS:"imageSaveAs",TEXT_WRAP:"imageTextWrap",TEXT_WRAP_EMBED:"imageTextWrapEmbed",TEXT_WRAP_UP_DOWN:"imageTextWrapUpDown",TEXT_WRAP_SURROUND:"imageTextWrapSurround",TEXT_WRAP_FLOAT_TOP:"imageTextWrapFloatTop",TEXT_WRAP_FLOAT_BOTTOM:"imageTextWrapFloatBottom"},TABLE:{BORDER:"border",BORDER_ALL:"tableBorderAll",BORDER_EMPTY:"tableBorderEmpty",BORDER_DASH:"tableBorderDash",BORDER_EXTERNAL:"tableBorderExternal",BORDER_INTERNAL:"tableBorderInternal",BORDER_TD:"tableBorderTd",BORDER_TD_TOP:"tableBorderTdTop",BORDER_TD_RIGHT:"tableBorderTdRight",BORDER_TD_BOTTOM:"tableBorderTdBottom",BORDER_TD_LEFT:"tableBorderTdLeft",BORDER_TD_FORWARD:"tableBorderTdForward",BORDER_TD_BACK:"tableBorderTdBack",VERTICAL_ALIGN:"tableVerticalAlign",VERTICAL_ALIGN_TOP:"tableVerticalAlignTop",VERTICAL_ALIGN_MIDDLE:"tableVerticalAlignMiddle",VERTICAL_ALIGN_BOTTOM:"tableVerticalAlignBottom",INSERT_ROW_COL:"tableInsertRowCol",INSERT_TOP_ROW:"tableInsertTopRow",INSERT_BOTTOM_ROW:"tableInsertBottomRow",INSERT_LEFT_COL:"tableInsertLeftCol",INSERT_RIGHT_COL:"tableInsertRightCol",DELETE_ROW_COL:"tableDeleteRowCol",DELETE_ROW:"tableDeleteRow",DELETE_COL:"tableDeleteCol",DELETE_TABLE:"tableDeleteTable",MERGE_CELL:"tableMergeCell",CANCEL_MERGE_CELL:"tableCancelMergeCell"}},{CONTROL:{DELETE:Bl}}=nn,Al=[{key:Bl,i18nPath:"contextmenu.control.delete",when:o=>{var t;return!o.isReadonly&&!o.editorHasSelection&&!!((t=o.startElement)==null?void 0:t.controlId)&&o.options.mode!==at.FORM},callback:o=>{o.executeRemoveControl()}}],{GLOBAL:{CUT:_l,COPY:kl,PASTE:zl,SELECT_ALL:$l,PRINT:ql}}=nn,jl=[{key:_l,i18nPath:"contextmenu.global.cut",shortCut:`${We?"\u2318":"Ctrl"} + X`,when:o=>!o.isReadonly,callback:o=>{o.executeCut()}},{key:kl,i18nPath:"contextmenu.global.copy",shortCut:`${We?"\u2318":"Ctrl"} + C`,when:o=>o.editorHasSelection||o.isCrossRowCol,callback:o=>{o.executeCopy()}},{key:zl,i18nPath:"contextmenu.global.paste",shortCut:`${We?"\u2318":"Ctrl"} + V`,when:o=>!o.isReadonly&&o.editorTextFocus,callback:o=>{o.executePaste()}},{key:$l,i18nPath:"contextmenu.global.selectAll",shortCut:`${We?"\u2318":"Ctrl"} + A`,when:o=>o.editorTextFocus,callback:o=>{o.executeSelectAll()}},{isDivider:!0},{key:ql,i18nPath:"contextmenu.global.print",icon:"print",when:()=>!0,callback:o=>{o.executePrint()}}],{HYPERLINK:{DELETE:tR,CANCEL:eR,EDIT:nR}}=nn,iR=[{key:tR,i18nPath:"contextmenu.hyperlink.delete",when:o=>{var t;return!o.isReadonly&&((t=o.startElement)==null?void 0:t.type)===F.HYPERLINK},callback:o=>{o.executeDeleteHyperlink()}},{key:eR,i18nPath:"contextmenu.hyperlink.cancel",when:o=>{var t;return!o.isReadonly&&((t=o.startElement)==null?void 0:t.type)===F.HYPERLINK},callback:o=>{o.executeCancelHyperlink()}},{key:nR,i18nPath:"contextmenu.hyperlink.edit",when:o=>{var t;return!o.isReadonly&&((t=o.startElement)==null?void 0:t.type)===F.HYPERLINK},callback:(o,t)=>{var n;const e=window.prompt("\u7F16\u8F91\u94FE\u63A5",(n=t.startElement)==null?void 0:n.url);e&&o.executeEditHyperlink(e)}}],{IMAGE:{CHANGE:sR,SAVE_AS:oR,TEXT_WRAP:rR,TEXT_WRAP_EMBED:lR,TEXT_WRAP_UP_DOWN:RR,TEXT_WRAP_SURROUND:aR,TEXT_WRAP_FLOAT_TOP:cR,TEXT_WRAP_FLOAT_BOTTOM:uR}}=nn,dR=[{key:sR,i18nPath:"contextmenu.image.change",icon:"image-change",when:o=>{var t;return!o.isReadonly&&!o.editorHasSelection&&((t=o.startElement)==null?void 0:t.type)===F.IMAGE},callback:o=>{const t=document.createElement("input");t.type="file",t.accept=".png, .jpg, .jpeg",t.onchange=()=>{const e=t.files[0],n=new FileReader;n.readAsDataURL(e),n.onload=()=>{const i=n.result;o.executeReplaceImageElement(i)}},t.click()}},{key:oR,i18nPath:"contextmenu.image.saveAs",icon:"image",when:o=>{var t;return!o.editorHasSelection&&((t=o.startElement)==null?void 0:t.type)===F.IMAGE},callback:o=>{o.executeSaveAsImageElement()}},{key:rR,i18nPath:"contextmenu.image.textWrap",when:o=>{var t;return!o.isReadonly&&!o.editorHasSelection&&((t=o.startElement)==null?void 0:t.type)===F.IMAGE},childMenus:[{key:lR,i18nPath:"contextmenu.image.textWrapType.embed",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,et.BLOCK)}},{key:RR,i18nPath:"contextmenu.image.textWrapType.upDown",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,et.INLINE)}},{key:aR,i18nPath:"contextmenu.image.textWrapType.surround",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,et.SURROUND)}},{key:cR,i18nPath:"contextmenu.image.textWrapType.floatTop",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,et.FLOAT_TOP)}},{key:uR,i18nPath:"contextmenu.image.textWrapType.floatBottom",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,et.FLOAT_BOTTOM)}}]}],{TABLE:{BORDER:hR,BORDER_ALL:gR,BORDER_EMPTY:LR,BORDER_DASH:OR,BORDER_EXTERNAL:PR,BORDER_INTERNAL:MR,BORDER_TD:TR,BORDER_TD_TOP:SR,BORDER_TD_LEFT:XR,BORDER_TD_BOTTOM:NR,BORDER_TD_RIGHT:FR,BORDER_TD_BACK:fR,BORDER_TD_FORWARD:IR,VERTICAL_ALIGN:mR,VERTICAL_ALIGN_TOP:pR,VERTICAL_ALIGN_MIDDLE:WR,VERTICAL_ALIGN_BOTTOM:VR,INSERT_ROW_COL:YR,INSERT_TOP_ROW:UR,INSERT_BOTTOM_ROW:ZR,INSERT_LEFT_COL:QR,INSERT_RIGHT_COL:DR,DELETE_ROW_COL:KR,DELETE_ROW:ER,DELETE_COL:bR,DELETE_TABLE:xR,MERGE_CELL:CR,CANCEL_MERGE_CELL:wR}}=nn,HR=[{isDivider:!0},{key:hR,i18nPath:"contextmenu.table.border",icon:"border-all",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==at.FORM,childMenus:[{key:gR,i18nPath:"contextmenu.table.borderAll",icon:"border-all",when:()=>!0,callback:o=>{o.executeTableBorderType(Jt.ALL)}},{key:LR,i18nPath:"contextmenu.table.borderEmpty",icon:"border-empty",when:()=>!0,callback:o=>{o.executeTableBorderType(Jt.EMPTY)}},{key:OR,i18nPath:"contextmenu.table.borderDash",icon:"border-dash",when:()=>!0,callback:o=>{o.executeTableBorderType(Jt.DASH)}},{key:PR,i18nPath:"contextmenu.table.borderExternal",icon:"border-external",when:()=>!0,callback:o=>{o.executeTableBorderType(Jt.EXTERNAL)}},{key:MR,i18nPath:"contextmenu.table.borderInternal",icon:"border-internal",when:()=>!0,callback:o=>{o.executeTableBorderType(Jt.INTERNAL)}},{key:TR,i18nPath:"contextmenu.table.borderTd",icon:"border-td",when:()=>!0,childMenus:[{key:SR,i18nPath:"contextmenu.table.borderTdTop",icon:"border-td-top",when:()=>!0,callback:o=>{o.executeTableTdBorderType(kt.TOP)}},{key:FR,i18nPath:"contextmenu.table.borderTdRight",icon:"border-td-right",when:()=>!0,callback:o=>{o.executeTableTdBorderType(kt.RIGHT)}},{key:NR,i18nPath:"contextmenu.table.borderTdBottom",icon:"border-td-bottom",when:()=>!0,callback:o=>{o.executeTableTdBorderType(kt.BOTTOM)}},{key:XR,i18nPath:"contextmenu.table.borderTdLeft",icon:"border-td-left",when:()=>!0,callback:o=>{o.executeTableTdBorderType(kt.LEFT)}},{key:IR,i18nPath:"contextmenu.table.borderTdForward",icon:"border-td-forward",when:()=>!0,callback:o=>{o.executeTableTdSlashType(Ce.FORWARD)}},{key:fR,i18nPath:"contextmenu.table.borderTdBack",icon:"border-td-back",when:()=>!0,callback:o=>{o.executeTableTdSlashType(Ce.BACK)}}]}]},{key:mR,i18nPath:"contextmenu.table.verticalAlign",icon:"vertical-align",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==at.FORM,childMenus:[{key:pR,i18nPath:"contextmenu.table.verticalAlignTop",icon:"vertical-align-top",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(Vt.TOP)}},{key:WR,i18nPath:"contextmenu.table.verticalAlignMiddle",icon:"vertical-align-middle",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(Vt.MIDDLE)}},{key:VR,i18nPath:"contextmenu.table.verticalAlignBottom",icon:"vertical-align-bottom",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(Vt.BOTTOM)}}]},{key:YR,i18nPath:"contextmenu.table.insertRowCol",icon:"insert-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==at.FORM,childMenus:[{key:UR,i18nPath:"contextmenu.table.insertTopRow",icon:"insert-top-row",when:()=>!0,callback:o=>{o.executeInsertTableTopRow()}},{key:ZR,i18nPath:"contextmenu.table.insertBottomRow",icon:"insert-bottom-row",when:()=>!0,callback:o=>{o.executeInsertTableBottomRow()}},{key:QR,i18nPath:"contextmenu.table.insertLeftCol",icon:"insert-left-col",when:()=>!0,callback:o=>{o.executeInsertTableLeftCol()}},{key:DR,i18nPath:"contextmenu.table.insertRightCol",icon:"insert-right-col",when:()=>!0,callback:o=>{o.executeInsertTableRightCol()}}]},{key:KR,i18nPath:"contextmenu.table.deleteRowCol",icon:"delete-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==at.FORM,childMenus:[{key:ER,i18nPath:"contextmenu.table.deleteRow",icon:"delete-row",when:()=>!0,callback:o=>{o.executeDeleteTableRow()}},{key:bR,i18nPath:"contextmenu.table.deleteCol",icon:"delete-col",when:()=>!0,callback:o=>{o.executeDeleteTableCol()}},{key:xR,i18nPath:"contextmenu.table.deleteTable",icon:"delete-table",when:()=>!0,callback:o=>{o.executeDeleteTable()}}]},{key:CR,i18nPath:"contextmenu.table.mergeCell",icon:"merge-cell",when:o=>!o.isReadonly&&o.isCrossRowCol&&o.options.mode!==at.FORM,callback:o=>{o.executeMergeTableCell()}},{key:wR,i18nPath:"contextmenu.table.mergeCancelCell",icon:"merge-cancel-cell",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==at.FORM,callback:o=>{o.executeCancelMergeTableCell()}}];class yR{constructor(t,e){h(this,"options");h(this,"draw");h(this,"command");h(this,"range");h(this,"position");h(this,"i18n");h(this,"container");h(this,"contextMenuList");h(this,"contextMenuContainerList");h(this,"contextMenuRelationShip");h(this,"context");h(this,"_proxyContextMenuEvent",t=>{this.context=this._getContext();const e=this._filterMenuList(this.contextMenuList);e.some(i=>!i.isDivider)&&(this.dispose(),this._render({contextMenuList:e,left:t.x,top:t.y})),t.preventDefault()});h(this,"_handleSideEffect",t=>{if(this.contextMenuContainerList.length){const e=(t==null?void 0:t.composedPath()[0])||t.target;Rn(e,i=>!!i&&i.nodeType===1&&i.getAttribute(le)===se.CONTEXTMENU,!0)||this.dispose()}});this.options=t.getOptions(),this.draw=t,this.command=e,this.range=t.getRange(),this.position=t.getPosition(),this.i18n=t.getI18n(),this.container=t.getContainer(),this.context=null,this.contextMenuList=[...jl,...HR,...dR,...Al,...iR],this.contextMenuContainerList=[],this.contextMenuRelationShip=new Map,this._addEvent()}getContextMenuList(){return this.contextMenuList}_addEvent(){this.container.addEventListener("contextmenu",this._proxyContextMenuEvent),document.addEventListener("mousedown",this._handleSideEffect)}removeEvent(){this.container.removeEventListener("contextmenu",this._proxyContextMenuEvent),document.removeEventListener("mousedown",this._handleSideEffect)}_filterMenuList(t){var i;const{contextMenuDisableKeys:e}=this.options,n=[];for(let r=0;r!V.isDivider)&&(X.classList.add(`${k}-contextmenu-sub-item`),X.onmouseenter=()=>{this._setHoverStatus(X,!0),this._removeSubMenu(s);const V=X.getBoundingClientRect(),m=V.left+V.width,Y=V.top;R=this._render({contextMenuList:p,left:m,top:Y,parentMenuContainer:s})},X.onmouseleave=V=>{(!R||!R.contains(V.relatedTarget))&&this._setHoverStatus(X,!1)})}else X.onmouseenter=()=>{this._setHoverStatus(X,!0),this._removeSubMenu(s)},X.onmouseleave=()=>{this._setHoverStatus(X,!1)},X.onclick=()=>{T.callback&&this.context&&T.callback(this.command,this.context),this.dispose()};const S=document.createElement("i");X.append(S),T.icon&&S.classList.add(`${k}-contextmenu-${T.icon}`);const N=document.createElement("span"),W=T.i18nPath?this._formatName(this.i18n.t(T.i18nPath)):this._formatName(T.name||"");if(N.append(document.createTextNode(W)),X.append(N),T.shortCut){const p=document.createElement("span");p.classList.add(`${k}-shortcut`),p.append(document.createTextNode(T.shortCut)),X.append(p)}l.append(X)}}s.append(l),s.style.display="block";const a=window.innerWidth,c=s.getBoundingClientRect(),u=c.width,d=n+u>a?n-u:n;s.style.left=`${d}px`;const g=window.innerHeight,L=c.height,O=i+L>g?i-L:i;return s.style.top=`${O}px`,this.contextMenuContainerList.push(s),s}_removeSubMenu(t){const e=this.contextMenuRelationShip.get(t);e&&(this._removeSubMenu(e),e.remove(),this.contextMenuRelationShip.delete(t))}_setHoverStatus(t,e){var n;e?((n=t.parentNode)==null||n.querySelectorAll(`${k}-contextmenu-item`).forEach(i=>i.classList.remove("hover")),t.classList.add("hover")):t.classList.remove("hover")}_formatName(t){const e=Object.values(Rs),n=new RegExp(`${e.join("|")}`);let i=t;if(n.test(i)){const r=new RegExp(Rs.SELECTED_TEXT,"g");if(r.test(i)){const s=this.range.toString();i=i.replace(r,s)}}return i}registerContextMenuList(t){this.contextMenuList.push(...t)}dispose(){this.contextMenuContainerList.forEach(t=>t.remove()),this.contextMenuContainerList=[],this.contextMenuRelationShip.clear()}}const GR=[{key:z.X,ctrl:!0,shift:!0,callback:o=>{o.executeStrikeout()}},{key:z.LEFT_BRACKET,mod:!0,callback:o=>{o.executeSizeAdd()}},{key:z.RIGHT_BRACKET,mod:!0,callback:o=>{o.executeSizeMinus()}},{key:z.B,mod:!0,callback:o=>{o.executeBold()}},{key:z.I,mod:!0,callback:o=>{o.executeItalic()}},{key:z.U,mod:!0,callback:o=>{o.executeUnderline()}},{key:We?z.COMMA:z.RIGHT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSuperscript()}},{key:We?z.PERIOD:z.LEFT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSubscript()}},{key:z.L,mod:!0,callback:o=>{o.executeRowFlex(Rt.LEFT)}},{key:z.E,mod:!0,callback:o=>{o.executeRowFlex(Rt.CENTER)}},{key:z.R,mod:!0,callback:o=>{o.executeRowFlex(Rt.RIGHT)}},{key:z.J,mod:!0,callback:o=>{o.executeRowFlex(Rt.ALIGNMENT)}},{key:z.J,mod:!0,shift:!0,callback:o=>{o.executeRowFlex(Rt.JUSTIFY)}}],JR=[{key:z.ZERO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(null)}},{key:z.ONE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(ht.FIRST)}},{key:z.TWO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(ht.SECOND)}},{key:z.THREE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(ht.THIRD)}},{key:z.FOUR,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(ht.FOURTH)}},{key:z.FIVE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(ht.FIFTH)}},{key:z.SIX,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(ht.SIXTH)}}],vR=[{key:z.I,shift:!0,mod:!0,callback:o=>{o.executeList(ne.UL,Gt.DISC)}},{key:z.U,shift:!0,mod:!0,callback:o=>{o.executeList(ne.OL)}}];class BR{constructor(t,e){h(this,"command");h(this,"globalShortcutList");h(this,"agentShortcutList");h(this,"_globalKeydown",t=>{!this.globalShortcutList.length||this._execute(t,this.globalShortcutList)});this.command=e,this.globalShortcutList=[],this.agentShortcutList=[],this._addShortcutList([...GR,...JR,...vR]),this._addEvent(),t.getCursor().getAgentDom().addEventListener("keydown",this._agentKeydown.bind(this))}_addEvent(){document.addEventListener("keydown",this._globalKeydown)}removeEvent(){document.removeEventListener("keydown",this._globalKeydown)}_addShortcutList(t){for(let e=t.length-1;e>=0;e--){const n=t[e];n.isGlobal?this.globalShortcutList.unshift(n):this.agentShortcutList.unshift(n)}}registerShortcutList(t){this._addShortcutList(t)}_agentKeydown(t){!this.agentShortcutList.length||this._execute(t,this.agentShortcutList)}_execute(t,e){var n;for(let i=0;ii(e))}}off(t,e){if(!t||typeof e!="function")return;const n=this.eventHub.get(t);!n||n.delete(e)}isSubscribe(t){const e=this.eventHub.get(t);return!!e&&e.size>0}}class kR{constructor(){h(this,"paste");h(this,"copy");h(this,"drop")}}class zR{constructor(t,e,n={}){h(this,"command");h(this,"listener");h(this,"eventBus");h(this,"override");h(this,"register");h(this,"destroy");h(this,"use");const i=vn(n);e=Ot(e);let r=[],s=[],l=[];Array.isArray(e)?s=e:(r=e.header||[],s=e.main,l=e.footer||[]),[r,s,l].forEach(g=>{_t(g,{editorOptions:i,isForceCompensation:!0})}),this.listener=new Jl,this.eventBus=new _R,this.override=new kR;const a=new Cl(t,i,{header:r,main:s,footer:l},this.listener,this.eventBus,this.override);this.command=new wl(new Gl(a));const c=new yR(a,this.command),u=new BR(a,this.command);this.register=new vl({contextMenu:c,shortcut:u,i18n:a.getI18n()}),this.destroy=()=>{a.destroy(),u.removeEvent(),c.removeEvent()};const d=new AR(this);this.use=d.use.bind(d)}}class zt{constructor(t){h(this,"options");h(this,"mask");h(this,"container");h(this,"inputList");this.options=t,this.mask=null,this.container=null,this.inputList=[],this._render()}_render(){var M;const{title:t,data:e,onClose:n,onCancel:i,onConfirm:r}=this.options,s=document.createElement("div");s.classList.add("dialog-mask"),s.setAttribute(le,se.COMPONENT),document.body.append(s);const l=document.createElement("div");l.classList.add("dialog-container"),l.setAttribute(le,se.COMPONENT);const R=document.createElement("div");R.classList.add("dialog"),l.append(R);const a=document.createElement("div");a.classList.add("dialog-title");const c=document.createElement("span");c.append(document.createTextNode(t));const u=document.createElement("i");u.onclick=()=>{n&&n(),this._dispose()},a.append(c),a.append(u),R.append(a);const d=document.createElement("div");d.classList.add("dialog-option");for(let P=0;P{const W=document.createElement("option");W.value=N.value,W.label=N.label,S.append(W)})):T.type==="textarea"?S=document.createElement("textarea"):(S=document.createElement("input"),S.type=T.type),T.width&&(S.style.width=`${T.width}px`),T.height&&(S.style.height=`${T.height}px`),S.name=T.name,S.value=T.value||"",S instanceof HTMLSelectElement||(S.placeholder=T.placeholder||""),X.append(S),d.append(X),this.inputList.push(S)}R.append(d);const g=document.createElement("div");g.classList.add("dialog-menu");const L=document.createElement("button");L.classList.add("dialog-menu__cancel"),L.append(document.createTextNode("\u53D6\u6D88")),L.type="button",L.onclick=()=>{i&&i(),this._dispose()},g.append(L);const O=document.createElement("button");O.append(document.createTextNode("\u786E\u5B9A")),O.type="submit",O.onclick=()=>{if(r){const P=this.inputList.map(T=>({name:T.name,value:T.value}));r(P)}this._dispose()},g.append(O),R.append(g),document.body.append(l),this.container=l,this.mask=s}_dispose(){var t,e;(t=this.mask)==null||t.remove(),(e=this.container)==null||e.remove()}}function $R(o){switch(o){case"comment":case"prolog":case"doctype":case"cdata":return{color:"#008000",italic:!0};case"namespace":return{opacity:.7};case"string":return{color:"#A31515"};case"punctuation":case"operator":return{color:"#393A34"};case"url":case"symbol":case"number":case"boolean":case"variable":case"constant":case"inserted":return{color:"#36acaa"};case"atrule":case"keyword":case"attr-value":return{color:"#0000ff"};case"function":return{color:"#b9a40a"};case"deleted":case"tag":return{color:"#9a050f"};case"selector":return{color:"#00009f"};case"important":return{color:"#e90",bold:!0};case"italic":return{italic:!0};case"class-name":case"property":return{color:"#2B91AF"};case"attr-name":case"regex":case"entity":return{color:"#ff0000"};default:return null}}function qR(o){const t=[];function e(n){for(let i=0;i{t&&t(),this._dispose()},l.append(R),l.append(a),s.append(l);const c=document.createElement("div");c.classList.add("signature-operation");const u=document.createElement("div");u.classList.add("signature-operation__undo");const d=document.createElement("i"),g=document.createElement("span");g.innerText="\u64A4\u9500",u.append(d),u.append(g),c.append(u);const L=document.createElement("div");L.classList.add("signature-operation__trash");const O=document.createElement("i"),M=document.createElement("span");M.innerText="\u6E05\u7A7A",L.append(O),L.append(M),c.append(L),s.append(c);const P=document.createElement("div");P.classList.add("signature-canvas");const T=document.createElement("canvas");T.width=this.canvasWidth,T.height=this.canvasHeight,T.style.width=`${this.canvasWidth/this.dpr}px`,T.style.height=`${this.canvasHeight/this.dpr}px`,P.append(T),s.append(P);const X=document.createElement("div");X.classList.add("signature-menu");const S=document.createElement("button");S.classList.add("signature-menu__cancel"),S.append(document.createTextNode("\u53D6\u6D88")),S.type="button",S.onclick=()=>{e&&e(),this._dispose()},X.append(S);const N=document.createElement("button");return N.append(document.createTextNode("\u786E\u5B9A")),N.type="submit",N.onclick=()=>{n&&n(this._toData()),this._dispose()},X.append(N),s.append(X),document.body.append(r),this.container=r,this.mask=i,{mask:i,canvas:T,container:r,trashContainer:L,undoContainer:u}}_bindEvent(){this.trashContainer.onclick=this._clearCanvas.bind(this),this.undoContainer.onclick=this._undo.bind(this),this.canvas.onmousedown=this._startDraw.bind(this),this.canvas.onmousemove=this._draw.bind(this),this.container.onmouseup=this._stopDraw.bind(this),this.container.ontouchmove=this.registerTouchmove.bind(this),this.container.ontouchstart=this.registerTouchstart.bind(this),this.container.ontouchend=this.registerTouchend.bind(this)}_undo(){this.undoStack.length>1&&(this.undoStack.pop(),this.undoStack.length&&this.undoStack[this.undoStack.length-1]())}_saveUndoFn(t){for(this.undoStack.push(t);this.undoStack.length>this.MAX_RECORD_COUNT;)this.undoStack.shift()}_clearUndoFn(){const t=()=>{this.ctx.clearRect(0,0,this.canvasWidth,this.canvasHeight)};this.undoStack=[t]}_clearCanvas(){this._clearUndoFn(),this.ctx.clearRect(0,0,this.canvasWidth,this.canvasHeight)}_startDraw(t){this.isDrawing=!0,this.x=t.offsetX,this.y=t.offsetY,this.ctx.lineWidth=1}_draw(t){if(!this.isDrawing)return;const e=performance.now(),i=Math.sqrt(t.movementX**2+t.movementY**2)/(e-this.preTimeStamp),s=Math.min(5,Math.max(1,5-i*3)),l=.2;this.ctx.lineWidth=this.ctx.lineWidth*(1-l)+s*l;const{offsetX:R,offsetY:a}=t;this.ctx.beginPath(),this.ctx.moveTo(this.x,this.y),this.ctx.lineTo(R,a),this.ctx.stroke(),this.x=R,this.y=a,this.linePoints.push([R,a]),this.isDrawn=!0,this.preTimeStamp=e}_stopDraw(){if(this.isDrawing=!1,this.isDrawn){const t=this.ctx.getImageData(0,0,this.canvasWidth,this.canvasHeight),e=this;this._saveUndoFn(function(){e.ctx.clearRect(0,0,e.canvasWidth,e.canvasHeight),e.ctx.putImageData(t,0,0)}),this.isDrawn=!1}}_toData(){if(!this.linePoints.length)return null;const t=this.linePoints[0][0],e=this.linePoints[0][1];let n=t,i=e,r=t,s=e;for(let L=0;LO[0]&&(n=O[0]),rO[1]&&(i=O[1]),s{o.apply(this,n)},t)}}function ea(o,t){if(!t){o.scrollTop=0;return}const e=[];let n=t.offsetParent;for(;n&&o!==n&&o.contains(n);)e.push(n),n=n.offsetParent;const i=t.offsetTop+e.reduce((R,a)=>R+a.offsetTop,0),r=i+t.offsetHeight,s=o.scrollTop,l=s+o.clientHeight;il&&(o.scrollTop=r-o.clientHeight)}function as(o){(window.requestIdleCallback||window.setTimeout)(()=>{o()})}function na(o){return`data:image/svg+xml;base64,${btoa(decodeURIComponent(o.outerHTML))}`}function ia(o){const t=o.command;t.executeInsertBarcode1D=(e,n,i,r)=>{const s=document.createElement("svg");Ns(s,e,r),t.executeInsertElementList([{type:F.IMAGE,value:na(s),width:n,height:i}])}}function sa(o){return`data:image/svg+xml;base64,${btoa(decodeURIComponent(o.outerHTML))}`}function oa(o){const t=o.command;t.executeInsertBarcode2D=(e,n,i,r)=>{const s=new fs;r||(r=new Map),r.has(Mi.MARGIN)||r.set(Mi.MARGIN,0);const l=s.write(e,n,i,r);l.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.executeInsertElementList([{type:F.IMAGE,value:sa(l),width:n,height:i}])},o.register.contextMenuList([{name:"\u8BC6\u522B\u4E8C\u7EF4\u7801\u94FE\u63A5",icon:"qrcode",when:e=>{var n;return e.startElement===e.endElement&&((n=e.startElement)==null?void 0:n.type)===F.IMAGE},callback:async(e,n)=>{var R;const i=(R=n.startElement)==null?void 0:R.value;if(!i)return;const l=(await new Fs().decodeFromImageUrl(i)).getText();new zt({title:"\u8BC6\u522B\u5185\u5BB9",data:[{type:"text",label:"\u8BC6\u522B\u5185\u5BB9",name:"name",placeholder:"\u8BF7\u8F93\u5165\u6587\u672C",value:l}]})}}])}var de;(function(o){o.SIZE_ADD="size-add",o.SIZE_MINUS="size-minus",o.BOLD="bold",o.ITALIC="italic",o.UNDERLINE="underline",o.STRIKEOUT="strikeout",o.COLOR="color",o.HIGHLIGHT="highlight"})(de||(de={}));const he="ce";function cs(o,t,e){const n=document.createElement("div");n.classList.add(`${he}-picker`),n.classList.add(`${he}-${t}`);const i=document.createElement("div");i.classList.add(`${he}-picker-container`);const r=document.createElement("div");i.append(r),n.append(i),o.append(n);const s="#000000",l=new Is({el:r,theme:"nano",useAsButton:!0,inline:!0,default:s,i18n:{"btn:save":"\u2713"},components:{preview:!0,opacity:!0,hue:!0,interaction:{input:!0,save:!0}}}),R=document.createElement("i");n.append(R);const a=document.createElement("span");a.style.backgroundColor=s,n.append(a),n.onclick=c=>{const u=c.target;i!==u&&!i.contains(u)&&l.show()},l.on("save",c=>{l.hide();const u=c.toHEXA().toString();a.style.backgroundColor=u,e(u)})}const ra=[{key:de.SIZE_ADD,callback(o){o.command.executeSizeAdd()}},{key:de.SIZE_MINUS,callback(o){o.command.executeSizeMinus()}},{isDivider:!0},{key:de.BOLD,callback(o){o.command.executeBold()}},{key:de.ITALIC,callback(o){o.command.executeItalic()}},{key:de.UNDERLINE,callback(o){o.command.executeUnderline()}},{key:de.STRIKEOUT,callback(o){o.command.executeStrikeout()}},{isDivider:!0},{render(o,t){cs(o,de.COLOR,e=>{t.command.executeColor(e)})}},{render(o,t){cs(o,de.HIGHLIGHT,e=>{t.command.executeHighlight(e)})}}];function la(o){const t=document.createElement("div");t.classList.add(`${he}-floating-toolbar`);for(const e of ra)if(e.render)e.render(t,o);else if(e.isDivider){const n=document.createElement("div");n.classList.add(`${he}-divider`),t.append(n)}else{const{key:n,callback:i}=e,r=document.createElement("div");r.classList.add(`${he}-${n}`);const s=document.createElement("i");r.append(s),r.onclick=()=>{i==null||i(o)},t.append(r)}return t}function ei(o,t){t?o.classList.remove("hide"):o.classList.add("hide")}function Fn(o,t){t?o.classList.add("active"):o.classList.remove("active")}function Ra(o){const t=la(o);o.command.getContainer().append(t),o.eventBus.on("rangeStyleChange",n=>{if(n.type===null){ei(t,!1);return}const i=o.command.getRangeContext();if(!i||i.isCollapsed||!i.rangeRects[0]){ei(t,!1);return}const r=i.rangeRects[0];t.style.left=`${r.x}px`,t.style.top=`${r.y+r.height}px`;const s=t.querySelector(`.${he}-bold`);s&&Fn(s,n.bold);const l=t.querySelector(`.${he}-italic`);l&&Fn(l,n.italic);const R=t.querySelector(`.${he}-underline`);R&&Fn(R,n.underline);const a=t.querySelector(`.${he}-strikeout`);a&&Fn(a,n.strikeout),ei(t,!0)})}const aa=6,ca=8.6,ua=40,da={top:Vt.TOP,middle:Vt.MIDDLE,bottom:Vt.BOTTOM,distributed:Vt.TOP,justify:Vt.TOP};function ha(o){return async function(t){const e=new ms.Workbook;await e.xlsx.load(t.arrayBuffer);const n=[];e.eachSheet(function(i){var l;const r=i.columns.map(R=>({width:(R.width||ca)*aa})),s={type:F.TABLE,value:"",colgroup:r,trList:[]};i.eachRow((R,a)=>{var g,L,O,M,P,T;const c=a-1,u=R.model,d=[];if(!!Array.isArray(R.values)){for(let X=1;X{var f,E,C,w,G;Z.push({value:U.text,bold:(f=U.font)==null?void 0:f.bold,italic:(E=U.font)==null?void 0:E.italic,size:(C=U.font)==null?void 0:C.size,strikeout:(w=U.font)==null?void 0:w.strike,underline:!!((G=U.font)==null?void 0:G.underline)})}):Z.push({value:(W==null?void 0:W.toString())||"",bold:(O=N==null?void 0:N.font)==null?void 0:O.bold,italic:(M=N==null?void 0:N.font)==null?void 0:M.italic,size:(P=N==null?void 0:N.font)==null?void 0:P.size,strikeout:(T=N==null?void 0:N.font)==null?void 0:T.strike});let m=1,Y=1;const Q=i.model.rows;for(let U=c;Uc&&E===X-1&&(Y+=1))}}d.push({colspan:m,rowspan:Y,verticalAlign:p,value:Z})}if(d.length){const X=(u==null?void 0:u.height)||ua;s.trList.push({height:X,minHeight:X,tdList:d})}}}),((l=s.trList)==null?void 0:l.length)&&n.push(s)}),n.length&&o.executeSetValue({main:n})}}function ga(o){const t=o.command;t.executeImportExcel=ha(t)}function La(o,t){const e=document.createElement("a");e.href=window.URL.createObjectURL(o),e.download=t,e.click(),window.URL.revokeObjectURL(e.href)}const Oa={[ht.FIRST]:Ze.HEADING_1,[ht.SECOND]:Ze.HEADING_2,[ht.THIRD]:Ze.HEADING_3,[ht.FOURTH]:Ze.HEADING_4,[ht.FIFTH]:Ze.HEADING_5,[ht.SIXTH]:Ze.HEADING_6};function ni(o){var t;return o.type===F.IMAGE?new Ds({type:"png",data:o.value,transformation:{width:o.width,height:o.height}}):o.type===F.HYPERLINK?new Ks({children:[new ln({text:(t=o.valueList)==null?void 0:t.map(e=>e.value).join(""),style:"Hyperlink"})],link:o.url}):o.type===F.TAB?new ln({children:[new Es]}):o.type===F.LATEX?new bs(o.value):new ln({font:o.font,text:o.value,bold:o.bold,size:`${(o.size||16)/.75}pt`,color:xs(o.color).hex()||"#000000",italics:o.italic,strike:o.strikeout,superScript:o.type===F.SUPERSCRIPT,subScript:o.type===F.SUBSCRIPT,underline:o.underline?{}:void 0})}function fn(o){var i,r,s;const t=[];let e=[];function n(){e.length&&(t.push(new Wn({children:e})),e=[])}for(let l=0;lni(a)))||[]}));else if(R.type===F.LIST){n();const a=((r=R.valueList)==null?void 0:r.map(c=>c.value).join("").split(` `).map((c,u)=>new Wn({children:[new ln({text:`${!R.listStyle||R.listStyle===Gt.DECIMAL?`${u+1}. `:"\u2022 "}${c}`})]})))||[];t.push(...a)}else if(R.type===F.TABLE){n();const{trList:a}=R,c=[];for(let u=0;uni(a)))||[]):(/^\n/.test(R.value)&&(n(),R.value=R.value.replace(/^\n/,"")),e.push(ni(R)))}return n(),t}function Pa(o){return function(t){const{fileName:e,isFile:n}=t,{data:{header:i,main:r,footer:s}}=o.getValue(),l=new ps({sections:[{headers:{default:new Ws({children:fn(i||[])})},footers:{default:new Vs({children:fn(s||[])})},children:fn(r||[])}]});n?Ti.toBlob(l).then(R=>{La(R,`${e}.docx`)}):Ti.toBase64String(l).then(R=>{const a={data:JSON.stringify({content:R,title:e}),type:"exportDocx"};window.parent.postMessage(a,"*")})}}function us(o){if(o.children){const t=Cs.map(o.children,us);o=tt(b({},o),{children:t})}return o.type==="paragraph"&&(o=Ma(o)),o}function Ma(o){return o.alignment==="center"&&!o.styleId?tt(b({},o),{styleId:"Heading2"}):o}function Ta(o){return async function(t){const{arrayBuffer:e}=t,n=await Si.convertToHtml({arrayBuffer:e},{transformDocument:us,styleMap:["p[style-name='Normal'] => p","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='Title'] => h1:fresh","p[style-name='Subtitle'] => h2:fresh","p[style-name='Quote'] => blockquote","p[style-name='List Paragraph'] => li","r[style-name='Emphasis'] => em","r[style-name='Strong'] => strong","r[style-name='Underline'] => u","r[style-name='Strikethrough'] => del","r[style-name='Comment Reference'] => sup","b => strong","i => em","u => u","strike => del","comment-reference => sup"],convertImage:Si.images.imgElement(function(i){return i.read("base64").then(function(r){return{src:"data:"+i.contentType+";base64,"+r}})})});o.executeSetHTML({main:n.value})}}function Sa(o){const t=o.command;t.executeImportDocx=Ta(t),t.executeExportDocx=Pa(t)}window.onload=function(){const o=typeof navigator!="undefined"&&/Mac OS X/.test(navigator.userAgent),t=document.querySelector(".editor"),e=new zR(t,{header:[],main:ys,footer:[{value:"",size:12}]},Gs);e.use(ia),e.use(oa),e.use(Ra),e.use(ga),e.use(Sa);const n=document.querySelector("#file-docx"),i=document.querySelector("#file-excel");let r="";Reflect.set(window,"editor",e),window.addEventListener("click",I=>{const K=document.querySelector(".visible");!K||K.contains(I.target)||K.classList.remove("visible")},{capture:!0});const s=document.querySelector(".menu-item__undo");s.title=`\u64A4\u9500(${o?"\u2318":"Ctrl"}+Z)`,s.onclick=function(){console.log("undo"),e.command.executeUndo()};const l=document.querySelector(".menu-item__redo");l.title=`\u91CD\u505A(${o?"\u2318":"Ctrl"}+Y)`,l.onclick=function(){console.log("redo"),e.command.executeRedo()};const R=document.querySelector(".menu-item__painter");let a=!0,c;R.onclick=function(){a?(a=!1,c=window.setTimeout(()=>{console.log("painter-click"),a=!0,e.command.executePainter({isDblclick:!1})},200)):window.clearTimeout(c)},R.ondblclick=function(){console.log("painter-dblclick"),a=!0,window.clearTimeout(c),e.command.executePainter({isDblclick:!0})},document.querySelector(".menu-item__format").onclick=function(){console.log("format"),e.command.executeFormat()};const u=document.querySelector(".menu-item__font"),d=u.querySelector(".select"),g=u.querySelector(".options");u.onclick=function(){console.log("font"),g.classList.toggle("visible")},g.onclick=function(I){const K=I.target;e.command.executeFont(K.dataset.family)};const L=document.querySelector(".menu-item__size"),O=L.querySelector(".select"),M=L.querySelector(".options");L.title="\u8BBE\u7F6E\u5B57\u53F7",L.onclick=function(){console.log("size"),M.classList.toggle("visible")},M.onclick=function(I){const K=I.target;e.command.executeSize(Number(K.dataset.size))};const P=document.querySelector(".menu-item__size-add");P.title=`\u589E\u5927\u5B57\u53F7(${o?"\u2318":"Ctrl"}+[)`,P.onclick=function(){console.log("size-add"),e.command.executeSizeAdd()};const T=document.querySelector(".menu-item__size-minus");T.title=`\u51CF\u5C0F\u5B57\u53F7(${o?"\u2318":"Ctrl"}+])`,T.onclick=function(){console.log("size-minus"),e.command.executeSizeMinus()};const X=document.querySelector(".menu-item__bold");X.title=`\u52A0\u7C97(${o?"\u2318":"Ctrl"}+B)`,X.onclick=function(){console.log("bold"),e.command.executeBold()};const S=document.querySelector(".menu-item__italic");S.title=`\u659C\u4F53(${o?"\u2318":"Ctrl"}+I)`,S.onclick=function(){console.log("italic"),e.command.executeItalic()};const N=document.querySelector(".menu-item__underline");N.title=`\u4E0B\u5212\u7EBF(${o?"\u2318":"Ctrl"}+U)`;const W=N.querySelector(".options");N.querySelector(".select").onclick=function(){W.classList.toggle("visible")},N.querySelector("i").onclick=function(){console.log("underline"),e.command.executeUnderline(),W.classList.remove("visible")},N.querySelector("ul").onmousedown=function(I){const y=I.target.dataset.decorationStyle;e.command.executeUnderline({style:y}),W.classList.remove("visible")};const p=document.querySelector(".menu-item__strikeout");p.onclick=function(){console.log("strikeout"),e.command.executeStrikeout()};const Z=document.querySelector(".menu-item__superscript");Z.title=`\u4E0A\u6807(${o?"\u2318":"Ctrl"}+Shift+,)`,Z.onclick=function(){console.log("superscript"),e.command.executeSuperscript()};const V=document.querySelector(".menu-item__subscript");V.title=`\u4E0B\u6807(${o?"\u2318":"Ctrl"}+Shift+.)`,V.onclick=function(){console.log("subscript"),e.command.executeSubscript()};const m=document.querySelector("#color");m.oninput=function(){e.command.executeColor(m.value)};const Y=document.querySelector(".menu-item__color"),Q=Y.querySelector("span");Y.onclick=function(){console.log("color"),m.click()};const U=document.querySelector("#highlight");U.oninput=function(){e.command.executeHighlight(U.value)};const f=document.querySelector(".menu-item__highlight"),E=f.querySelector("span");f.onclick=function(){console.log("highlight"),U==null||U.click()};const C=document.querySelector(".menu-item__title"),w=C.querySelector(".select"),G=C.querySelector(".options");G.querySelectorAll("li").forEach((I,K)=>{I.title=`Ctrl+${o?"Option":"Alt"}+${K}`}),C.onclick=function(){console.log("title"),G.classList.toggle("visible")},G.onclick=function(I){const y=I.target.dataset.level;e.command.executeTitle(y||null)};const v=document.querySelector(".menu-item__left");v.title=`\u5DE6\u5BF9\u9F50(${o?"\u2318":"Ctrl"}+L)`,v.onclick=function(){console.log("left"),e.command.executeRowFlex(Rt.LEFT)};const q=document.querySelector(".menu-item__center");q.title=`\u5C45\u4E2D\u5BF9\u9F50(${o?"\u2318":"Ctrl"}+E)`,q.onclick=function(){console.log("center"),e.command.executeRowFlex(Rt.CENTER)};const st=document.querySelector(".menu-item__right");st.title=`\u53F3\u5BF9\u9F50(${o?"\u2318":"Ctrl"}+R)`,st.onclick=function(){console.log("right"),e.command.executeRowFlex(Rt.RIGHT)};const Yt=document.querySelector(".menu-item__alignment");Yt.title=`\u4E24\u7AEF\u5BF9\u9F50(${o?"\u2318":"Ctrl"}+J)`,Yt.onclick=function(){console.log("alignment"),e.command.executeRowFlex(Rt.ALIGNMENT)};const ot=document.querySelector(".menu-item__justify");ot.title=`\u5206\u6563\u5BF9\u9F50(${o?"\u2318":"Ctrl"}+Shift+J)`,ot.onclick=function(){console.log("justify"),e.command.executeRowFlex(Rt.JUSTIFY)};const $=document.querySelector(".menu-item__row-margin"),x=$.querySelector(".options");$.onclick=function(){console.log("row-margin"),x.classList.toggle("visible")},x.onclick=function(I){const K=I.target;e.command.executeRowMargin(Number(K.dataset.rowmargin))};const St=document.querySelector(".menu-item__list");St.title=`\u5217\u8868(${o?"\u2318":"Ctrl"}+Shift+U)`;const B=St.querySelector(".options");St.onclick=function(){console.log("list"),B.classList.toggle("visible")},B.onclick=function(I){const K=I.target,y=K.dataset.listType||null,J=K.dataset.listStyle;e.command.executeList(y,J)};const It=document.querySelector(".menu-item__table"),nt=document.querySelector(".menu-item__table__collapse"),bt=document.querySelector(".table-close"),$t=document.querySelector(".table-select"),Dt=document.querySelector(".table-panel"),gt=[];for(let I=0;I<10;I++){const K=document.createElement("tr");K.classList.add("table-row");const y=[];for(let J=0;J<10;J++){const H=document.createElement("td");H.classList.add("table-cel"),K.append(H),y.push(H)}Dt.append(K),gt.push(y)}let Pe=0,oe=0;function He(){gt.forEach(I=>{I.forEach(K=>K.classList.remove("active"))})}function ye(I){$t.innerText=I}function Ge(){He(),ye("\u63D2\u5165"),Pe=0,oe=0,nt.style.display="none"}It.onclick=function(){console.log("table"),nt.style.display="block"},Dt.onmousemove=function(I){const K=16,y=10,J=6,{offsetX:H,offsetY:A}=I;He(),Pe=Math.ceil(H/(K+J))||1,oe=Math.ceil(A/(K+y))||1,gt.forEach((j,it)=>{j.forEach((rt,Xt)=>{Xt{var J,H;const K=(J=I.find(A=>A.name==="name"))==null?void 0:J.value;if(!K)return;const y=(H=I.find(A=>A.name==="url"))==null?void 0:H.value;!y||e.command.executeHyperlink({type:F.HYPERLINK,value:"",url:y,valueList:qt(K).map(A=>({value:A,size:16}))})}})};const Lt=document.querySelector(".menu-item__separator"),Qt=Lt.querySelector(".options");Lt.onclick=function(){console.log("separator"),Qt.classList.toggle("visible")},Qt.onmousedown=function(I){var H;let K=[];const J=(H=I.target.dataset.separator)==null?void 0:H.split(",").map(Number);J&&(J.every(j=>j===0)||(K=J)),e.command.executeSeparator(K)};const fe=document.querySelector(".menu-item__page-break");fe.onclick=function(){console.log("pageBreak"),e.command.executePageBreak()};const ve=document.querySelector(".menu-item__watermark"),Be=ve.querySelector(".options");ve.onclick=function(){console.log("watermark"),Be.classList.toggle("visible")},Be.onmousedown=function(I){const y=I.target.dataset.menu;Be.classList.toggle("visible"),y==="add"?new zt({title:"\u6C34\u5370",data:[{type:"text",label:"\u5185\u5BB9",name:"data",required:!0,placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"},{type:"color",label:"\u989C\u8272",name:"color",required:!0,value:"#AEB5C0"},{type:"number",label:"\u5B57\u4F53\u5927\u5C0F",name:"size",required:!0,value:"120"},{type:"number",label:"\u900F\u660E\u5EA6",name:"opacity",required:!0,value:"0.3"},{type:"select",label:"\u91CD\u590D",name:"repeat",value:"0",required:!1,options:[{label:"\u4E0D\u91CD\u590D",value:"0"},{label:"\u91CD\u590D",value:"1"}]},{type:"number",label:"\u6C34\u5E73\u95F4\u9694",name:"horizontalGap",required:!1,value:"10"},{type:"number",label:"\u5782\u76F4\u95F4\u9694",name:"verticalGap",required:!1,value:"10"}],onConfirm:J=>{if(~J.findIndex(it=>!it.value))return;const A=J.reduce((it,rt)=>(it[rt.name]=rt.value,it),{}),j=A.repeat==="1";e.command.executeAddWatermark({data:A.data,color:A.color,size:Number(A.size),opacity:Number(A.opacity),repeat:j,gap:j&&A.horizontalGap&&A.verticalGap?[Number(A.horizontalGap),Number(A.verticalGap)]:void 0})}}):e.command.executeDeleteWatermark()};const Ae=document.querySelector(".menu-item__codeblock");Ae.onclick=function(){console.log("codeblock"),new zt({title:"\u4EE3\u7801\u5757",data:[{type:"textarea",name:"codeblock",placeholder:"\u8BF7\u8F93\u5165\u4EE3\u7801",width:500,height:300}],onConfirm:I=>{var A;const K=(A=I.find(j=>j.name==="codeblock"))==null?void 0:A.value;if(!K)return;const y=Xi.tokenize(K,Xi.languages.javascript),J=qR(y),H=[];for(let j=0;j{var j,it;const H=(j=J.find(rt=>rt.name==="placeholder"))==null?void 0:j.value;if(!H)return;const A=((it=J.find(rt=>rt.name==="value"))==null?void 0:it.value)||"";e.command.executeInsertElementList([{type:F.CONTROL,value:"",control:{type:y,value:A?[{value:A}]:null,placeholder:H}}])}});break;case dt.SELECT:new zt({title:"\u5217\u4E3E\u63A7\u4EF6",data:[{type:"text",label:"\u5360\u4F4D\u7B26",name:"placeholder",required:!0,placeholder:"\u8BF7\u8F93\u5165\u5360\u4F4D\u7B26"},{type:"text",label:"\u9ED8\u8BA4\u503C",name:"code",placeholder:"\u8BF7\u8F93\u5165\u9ED8\u8BA4\u503C"},{type:"textarea",label:"\u503C\u96C6",name:"valueSets",required:!0,height:100,placeholder:`\u8BF7\u8F93\u5165\u503C\u96C6JSON\uFF0C\u4F8B\uFF1A [{ "value":"\u6709", "code":"98175" }]`}],onConfirm:J=>{var it,rt,Xt;const H=(it=J.find(Wt=>Wt.name==="placeholder"))==null?void 0:it.value;if(!H)return;const A=(rt=J.find(Wt=>Wt.name==="valueSets"))==null?void 0:rt.value;if(!A)return;const j=(Xt=J.find(Wt=>Wt.name==="code"))==null?void 0:Xt.value;e.command.executeInsertElementList([{type:F.CONTROL,value:"",control:{type:y,code:j,value:null,placeholder:H,valueSets:JSON.parse(A)}}])}});break;case dt.CHECKBOX:new zt({title:"\u590D\u9009\u6846\u63A7\u4EF6",data:[{type:"text",label:"\u9ED8\u8BA4\u503C",name:"code",placeholder:"\u8BF7\u8F93\u5165\u9ED8\u8BA4\u503C\uFF0C\u591A\u4E2A\u503C\u4EE5\u82F1\u6587\u9017\u53F7\u5206\u5272"},{type:"textarea",label:"\u503C\u96C6",name:"valueSets",required:!0,height:100,placeholder:`\u8BF7\u8F93\u5165\u503C\u96C6JSON\uFF0C\u4F8B\uFF1A [{ "value":"\u6709", "code":"98175" }]`}],onConfirm:J=>{var j,it;const H=(j=J.find(rt=>rt.name==="valueSets"))==null?void 0:j.value;if(!H)return;const A=(it=J.find(rt=>rt.name==="code"))==null?void 0:it.value;e.command.executeInsertElementList([{type:F.CONTROL,value:"",control:{type:y,code:A,value:null,valueSets:JSON.parse(H)}}])}});break;case dt.RADIO:new zt({title:"\u5355\u9009\u6846\u63A7\u4EF6",data:[{type:"text",label:"\u9ED8\u8BA4\u503C",name:"code",placeholder:"\u8BF7\u8F93\u5165\u9ED8\u8BA4\u503C"},{type:"textarea",label:"\u503C\u96C6",name:"valueSets",required:!0,height:100,placeholder:`\u8BF7\u8F93\u5165\u503C\u96C6JSON\uFF0C\u4F8B\uFF1A [{ "value":"\u6709", "code":"98175" }]`}],onConfirm:J=>{var j,it;const H=(j=J.find(rt=>rt.name==="valueSets"))==null?void 0:j.value;if(!H)return;const A=(it=J.find(rt=>rt.name==="code"))==null?void 0:it.value;e.command.executeInsertElementList([{type:F.CONTROL,value:"",control:{type:y,code:A,value:null,valueSets:JSON.parse(H)}}])}});break;case dt.DATE:new zt({title:"\u65E5\u671F\u63A7\u4EF6",data:[{type:"text",label:"\u5360\u4F4D\u7B26",name:"placeholder",required:!0,placeholder:"\u8BF7\u8F93\u5165\u5360\u4F4D\u7B26"},{type:"text",label:"\u9ED8\u8BA4\u503C",name:"value",placeholder:"\u8BF7\u8F93\u5165\u9ED8\u8BA4\u503C"},{type:"select",label:"\u65E5\u671F\u683C\u5F0F",name:"dateFormat",value:"yyyy-MM-dd hh:mm:ss",required:!0,options:[{label:"yyyy-MM-dd hh:mm:ss",value:"yyyy-MM-dd hh:mm:ss"},{label:"yyyy-MM-dd",value:"yyyy-MM-dd"}]}],onConfirm:J=>{var it,rt,Xt;const H=(it=J.find(Wt=>Wt.name==="placeholder"))==null?void 0:it.value;if(!H)return;const A=((rt=J.find(Wt=>Wt.name==="value"))==null?void 0:rt.value)||"",j=((Xt=J.find(Wt=>Wt.name==="dateFormat"))==null?void 0:Xt.value)||"";e.command.executeInsertElementList([{type:F.CONTROL,value:"",control:{type:y,dateFormat:j,value:A?[{value:A}]:null,placeholder:H}}])}});break}};const mt=document.querySelector(".menu-item__checkbox");mt.onclick=function(){console.log("checkbox"),e.command.executeInsertElementList([{type:F.CHECKBOX,checkbox:{value:!1},value:""}])};const Nt=document.querySelector(".menu-item__radio");Nt.onclick=function(){console.log("radio"),e.command.executeInsertElementList([{type:F.RADIO,checkbox:{value:!1},value:""}])};const vt=document.querySelector(".menu-item__latex");vt.onclick=function(){console.log("LaTeX"),new zt({title:"LaTeX",data:[{type:"textarea",height:100,name:"value",placeholder:"\u8BF7\u8F93\u5165LaTeX\u6587\u672C"}],onConfirm:I=>{var y;const K=(y=I.find(J=>J.name==="value"))==null?void 0:y.value;!K||e.command.executeInsertElementList([{type:F.LATEX,value:K}])}})};const Ft=document.querySelector(".menu-item__date"),Mt=Ft.querySelector(".options");Ft.onclick=function(){console.log("date"),Mt.classList.toggle("visible");const I=document.body.getBoundingClientRect(),K=Mt.getBoundingClientRect();K.left+K.width>I.width?(Mt.style.right="0px",Mt.style.left="unset"):(Mt.style.right="unset",Mt.style.left="0px");const y=new Date,J=y.getFullYear().toString(),H=(y.getMonth()+1).toString().padStart(2,"0"),A=y.getDate().toString().padStart(2,"0"),j=y.getHours().toString().padStart(2,"0"),it=y.getMinutes().toString().padStart(2,"0"),rt=y.getSeconds().toString().padStart(2,"0"),Xt=`${J}-${H}-${A}`,Wt=`${Xt} ${j}:${it}:${rt}`;Mt.querySelector("li:first-child").innerText=Xt,Mt.querySelector("li:last-child").innerText=Wt},Mt.onmousedown=function(I){const K=I.target,y=K.dataset.format;Mt.classList.toggle("visible"),e.command.executeInsertElementList([{type:F.DATE,value:"",dateFormat:y,valueList:[{value:K.innerText.trim()}]}])};const yt=document.querySelector(".menu-item__block");yt.onclick=function(){console.log("block"),new zt({title:"\u5185\u5BB9\u5757",data:[{type:"select",label:"\u7C7B\u578B",name:"type",value:"iframe",required:!0,options:[{label:"\u7F51\u5740",value:"iframe"},{label:"\u89C6\u9891",value:"video"}]},{type:"number",label:"\u5BBD\u5EA6",name:"width",placeholder:"\u8BF7\u8F93\u5165\u5BBD\u5EA6\uFF08\u9ED8\u8BA4\u9875\u9762\u5185\u5BBD\u5EA6\uFF09"},{type:"number",label:"\u9AD8\u5EA6",name:"height",required:!0,placeholder:"\u8BF7\u8F93\u5165\u9AD8\u5EA6"},{type:"input",label:"\u5730\u5740",name:"src",required:!1,placeholder:"\u8BF7\u8F93\u5165\u5730\u5740"},{type:"textarea",label:"HTML",height:100,name:"srcdoc",required:!1,placeholder:"\u8BF7\u8F93\u5165HTML\u4EE3\u7801\uFF08\u4EC5\u7F51\u5740\u7C7B\u578B\u6709\u6548\uFF09"}],onConfirm:I=>{var rt,Xt,Wt,re,_e;const K=(rt=I.find(wt=>wt.name==="type"))==null?void 0:rt.value;if(!K)return;const y=(Xt=I.find(wt=>wt.name==="width"))==null?void 0:Xt.value,J=(Wt=I.find(wt=>wt.name==="height"))==null?void 0:Wt.value;if(!J)return;const H=(re=I.find(wt=>wt.name==="src"))==null?void 0:re.value,A=(_e=I.find(wt=>wt.name==="srcdoc"))==null?void 0:_e.value,j={type:K};if(j.type===we.IFRAME){if(!H&&!A)return;j.iframeBlock={src:H,srcdoc:A}}else if(j.type===we.VIDEO){if(!H)return;j.videoBlock={src:H}}const it={type:F.BLOCK,value:"",height:Number(J),block:j};y&&(it.width=Number(y)),e.command.executeInsertElementList([it])}})};const ft=document.querySelector(".menu-item__search__collapse"),pt=document.querySelector(".menu-item__search__collapse__search input"),Kt=document.querySelector(".menu-item__search__collapse__replace input"),Ct=document.querySelector(".menu-item__search");Ct.title=`\u641C\u7D22\u4E0E\u66FF\u6362(${o?"\u2318":"Ctrl"}+F)`;const ge=ft.querySelector(".search-result");function Bt(){const I=e.command.getSearchNavigateInfo();if(I){const{index:K,count:y}=I;ge.innerText=`${K}/${y}`}else ge.innerText=""}Ct.onclick=function(){console.log("search"),ft.style.display="block";const I=document.body.getBoundingClientRect(),K=Ct.getBoundingClientRect(),y=ft.getBoundingClientRect();K.left+y.width>I.width?(ft.style.right="0px",ft.style.left="unset"):ft.style.right="unset",pt.focus()},ft.querySelector("span").onclick=function(){ft.style.display="none",pt.value="",Kt.value="",e.command.executeSearch(null),Bt()},pt.oninput=function(){e.command.executeSearch(pt.value||null),Bt()},pt.onkeydown=function(I){I.key==="Enter"&&(e.command.executeSearch(pt.value||null),Bt())},ft.querySelector("button").onclick=function(){const I=pt.value,K=Kt.value;I&&K&&I!==K&&e.command.executeReplace(K)},ft.querySelector(".arrow-left").onclick=function(){e.command.executeSearchNavigatePre(),Bt()},ft.querySelector(".arrow-right").onclick=function(){e.command.executeSearchNavigateNext(),Bt()};const Ie=document.querySelector(".menu-item__print");Ie.title=`\u6253\u5370(${o?"\u2318":"Ctrl"}+P)`,Ie.onclick=function(){console.log("print"),e.command.executePrint()};const Me=document.querySelector(".editor-option");Me.onclick=function(){const I=e.command.getOptions();new zt({title:"\u7F16\u8F91\u5668\u914D\u7F6E",data:[{type:"textarea",name:"option",width:350,height:300,required:!0,value:JSON.stringify(I,null,2),placeholder:"\u8BF7\u8F93\u5165\u7F16\u8F91\u5668\u914D\u7F6E"}],onConfirm:K=>{var H;const y=(H=K.find(A=>A.name==="option"))==null?void 0:H.value;if(!y)return;const J=JSON.parse(y);e.command.executeUpdateOptions(J)}})};async function Ye(){const I=await e.command.getCatalog(),K=document.querySelector(".catalog__main");if(K.innerHTML="",I){const y=(J,H)=>{for(let A=0;A{e.command.executeLocationCatalog(j.id)},it.append(rt),j.subCatalog&&j.subCatalog.length&&y(it,j.subCatalog),J.append(it)}};y(K,I)}}let sn=!0;const oi=document.querySelector(".catalog"),ds=document.querySelector(".catalog-mode"),hs=document.querySelector(".catalog__header__close"),ri=()=>{sn=!sn,sn?(oi.style.display="block",Ye()):oi.style.display="none"};ds.onclick=ri,hs.onclick=ri;const li=document.querySelector(".page-mode"),on=li.querySelector(".options");li.onclick=function(){on.classList.toggle("visible")},on.onclick=function(I){const K=I.target;e.command.executePageMode(K.dataset.pageMode)},document.querySelector(".page-scale-percentage").onclick=function(){console.log("page-scale-recovery"),e.command.executePageScaleRecovery()},document.querySelector(".page-scale-minus").onclick=function(){console.log("page-scale-minus"),e.command.executePageScaleMinus()},document.querySelector(".page-scale-add").onclick=function(){console.log("page-scale-add"),e.command.executePageScaleAdd()};const Ri=document.querySelector(".paper-size"),In=Ri.querySelector(".options");Ri.onclick=function(){In.classList.toggle("visible")},In.onclick=function(I){const K=I.target,y=K.dataset.paperSize,[J,H]=y.split("*").map(Number);e.command.executePaperSize(J,H),In.querySelectorAll("li").forEach(A=>A.classList.remove("active")),K.classList.add("active")};const ai=document.querySelector(".paper-direction"),mn=ai.querySelector(".options");ai.onclick=function(){mn.classList.toggle("visible")},mn.onclick=function(I){const K=I.target,y=K.dataset.paperDirection;e.command.executePaperDirection(y),mn.querySelectorAll("li").forEach(J=>J.classList.remove("active")),K.classList.add("active")};const gs=document.querySelector(".paper-margin");gs.onclick=function(){const[I,K,y,J]=e.command.getPaperMargin();new zt({title:"\u9875\u8FB9\u8DDD",data:[{type:"text",label:"\u4E0A\u8FB9\u8DDD",name:"top",required:!0,value:`${I}`,placeholder:"\u8BF7\u8F93\u5165\u4E0A\u8FB9\u8DDD"},{type:"text",label:"\u4E0B\u8FB9\u8DDD",name:"bottom",required:!0,value:`${y}`,placeholder:"\u8BF7\u8F93\u5165\u4E0B\u8FB9\u8DDD"},{type:"text",label:"\u5DE6\u8FB9\u8DDD",name:"left",required:!0,value:`${J}`,placeholder:"\u8BF7\u8F93\u5165\u5DE6\u8FB9\u8DDD"},{type:"text",label:"\u53F3\u8FB9\u8DDD",name:"right",required:!0,value:`${K}`,placeholder:"\u8BF7\u8F93\u5165\u53F3\u8FB9\u8DDD"}],onConfirm:H=>{var Xt,Wt,re,_e;const A=(Xt=H.find(wt=>wt.name==="top"))==null?void 0:Xt.value;if(!A)return;const j=(Wt=H.find(wt=>wt.name==="bottom"))==null?void 0:Wt.value;if(!j)return;const it=(re=H.find(wt=>wt.name==="left"))==null?void 0:re.value;if(!it)return;const rt=(_e=H.find(wt=>wt.name==="right"))==null?void 0:_e.value;!rt||e.command.executeSetPaperMargin([Number(A),Number(rt),Number(j),Number(it)])}})};const ci=document.querySelector(".fullscreen");ci.onclick=ui,window.addEventListener("keydown",I=>{I.key==="F11"&&(ui(),I.preventDefault())}),document.addEventListener("fullscreenchange",()=>{ci.classList.toggle("exist")});function ui(){console.log("fullscreen"),document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()}let rn=0;const di=[{mode:at.EDIT,name:"\u7F16\u8F91\u6A21\u5F0F"},{mode:at.CLEAN,name:"\u6E05\u6D01\u6A21\u5F0F"},{mode:at.READONLY,name:"\u53EA\u8BFB\u6A21\u5F0F"},{mode:at.FORM,name:"\u8868\u5355\u6A21\u5F0F"},{mode:at.PRINT,name:"\u6253\u5370\u6A21\u5F0F"},{mode:at.DESIGN,name:"\u8BBE\u8BA1\u6A21\u5F0F"}],hi=document.querySelector(".editor-mode");hi.onclick=function(){rn===di.length-1?rn=0:rn++;const{name:I,mode:K}=di[rn];hi.innerText=I,e.command.executeMode(K);const y=K===at.READONLY,J=["search","print"];document.querySelectorAll(".menu-item>div").forEach(H=>{const A=H.dataset.menu;y&&(!A||!J.includes(A))?H.classList.add("disable"):H.classList.remove("disable")})};const Ue=document.querySelector(".comment");async function Ls(){const I=await e.command.getGroupIds();for(const K of Ni){const y=Ue.querySelector(`.comment-item[data-id='${K.id}']`);if(I.includes(K.id)){if(!y){const J=document.createElement("div");J.classList.add("comment-item"),J.setAttribute("data-id",K.id),J.onclick=()=>{e.command.executeLocationGroup(K.id)},Ue.append(J);const H=document.createElement("div");H.classList.add("comment-item__title"),H.append(document.createElement("span"));const A=document.createElement("span");A.innerText=K.rangeText,H.append(A);const j=document.createElement("i");j.onclick=()=>{e.command.executeDeleteGroup(K.id)},H.append(j),J.append(H);const it=document.createElement("div");it.classList.add("comment-item__info");const rt=document.createElement("span");rt.innerText=K.userName;const Xt=document.createElement("span");Xt.innerText=K.createdDate,it.append(rt),it.append(Xt),J.append(it);const Wt=document.createElement("div");Wt.classList.add("comment-item__content"),Wt.innerText=K.content,J.append(Wt),Ue.append(J)}}else y==null||y.remove()}}e.listener.rangeStyleChange=function(I){if(I.type===F.SUBSCRIPT?V.classList.add("active"):V.classList.remove("active"),I.type===F.SUPERSCRIPT?Z.classList.add("active"):Z.classList.remove("active"),I.type===F.SEPARATOR?Lt.classList.add("active"):Lt.classList.remove("active"),Qt.querySelectorAll("li").forEach(H=>H.classList.remove("active")),I.type===F.SEPARATOR){const H=I.dashArray.join(",")||"0,0",A=Qt.querySelector(`[data-separator='${H}']`);A&&A.classList.add("active")}g.querySelectorAll("li").forEach(H=>H.classList.remove("active"));const K=g.querySelector(`[data-family='${I.font}']`);K&&(d.innerText=K.innerText,d.style.fontFamily=I.font,K.classList.add("active")),M.querySelectorAll("li").forEach(H=>H.classList.remove("active"));const y=M.querySelector(`[data-size='${I.size}']`);if(y?(O.innerText=y.innerText,y.classList.add("active")):O.innerText=`${I.size}`,I.bold?X.classList.add("active"):X.classList.remove("active"),I.italic?S.classList.add("active"):S.classList.remove("active"),I.underline?N.classList.add("active"):N.classList.remove("active"),I.strikeout?p.classList.add("active"):p.classList.remove("active"),I.color?(Y.classList.add("active"),m.value=I.color,Q.style.backgroundColor=I.color):(Y.classList.remove("active"),m.value="#000000",Q.style.backgroundColor="#000000"),I.highlight?(f.classList.add("active"),U.value=I.highlight,E.style.backgroundColor=I.highlight):(f.classList.remove("active"),U.value="#ffff00",E.style.backgroundColor="#ffff00"),v.classList.remove("active"),q.classList.remove("active"),st.classList.remove("active"),Yt.classList.remove("active"),ot.classList.remove("active"),I.rowFlex&&I.rowFlex==="right"?st.classList.add("active"):I.rowFlex&&I.rowFlex==="center"?q.classList.add("active"):I.rowFlex&&I.rowFlex==="alignment"?Yt.classList.add("active"):I.rowFlex&&I.rowFlex==="justify"?ot.classList.add("active"):v.classList.add("active"),x.querySelectorAll("li").forEach(H=>H.classList.remove("active")),x.querySelector(`[data-rowmargin='${I.rowMargin}']`).classList.add("active"),I.undo?s.classList.remove("no-allow"):s.classList.add("no-allow"),I.redo?l.classList.remove("no-allow"):l.classList.add("no-allow"),I.painter?R.classList.add("active"):R.classList.remove("active"),G.querySelectorAll("li").forEach(H=>H.classList.remove("active")),I.level){const H=G.querySelector(`[data-level='${I.level}']`);w.innerText=H.innerText,H.classList.add("active")}else w.innerText="\u6B63\u6587",G.querySelector("li:first-child").classList.add("active");if(B.querySelectorAll("li").forEach(H=>H.classList.remove("active")),I.listType){St.classList.add("active");const H=I.listType,A=I.listType===ne.OL?Gt.DECIMAL:I.listType,j=B.querySelector(`[data-list-type='${H}'][data-list-style='${A}']`);j&&j.classList.add("active")}else St.classList.remove("active");if(Ue.querySelectorAll(".comment-item").forEach(H=>{H.classList.remove("active")}),I.groupIds){const[H]=I.groupIds,A=Ue.querySelector(`.comment-item[data-id='${H}']`);A&&(A.classList.add("active"),ea(Ue,A))}},e.listener.visiblePageNoListChange=function(I){const K=I.map(y=>y+1).join("\u3001");document.querySelector(".page-no-list").innerText=K},e.listener.pageSizeChange=function(I){document.querySelector(".page-size").innerText=`${I}`},e.listener.intersectionPageNoChange=function(I){document.querySelector(".page-no").innerText=`${I+1}`},e.listener.pageScaleChange=function(I){document.querySelector(".page-scale-percentage").innerText=`${Math.floor(I*10*10)}%`},e.listener.controlChange=function(I){["table","hyperlink","separator","page-break","control"].forEach(y=>{const J=document.querySelector(`.menu-item__${y}`);I?J.classList.add("disable"):J.classList.remove("disable")})},e.listener.pageModeChange=function(I){const K=on.querySelector(`[data-page-mode='${I}']`);on.querySelectorAll("li").forEach(y=>y.classList.remove("active")),K.classList.add("active")};const gi=async function(){const I=await e.command.getWordCount();document.querySelector(".word-count").innerText=`${I||0}`,sn&&as(()=>{Ye()}),as(()=>{Ls()})};e.listener.contentChange=ta(gi,200),gi(),e.listener.saved=function(I){console.log("elementList: ",I)},e.register.contextMenuList([{name:"\u63D2\u5165\u6761\u5F62\u7801",when:I=>!I.isReadonly&&I.editorTextFocus,callback:I=>{const K=window.prompt("\u8BF7\u8F93\u5165\u5185\u5BB9");I.executeInsertBarcode1D(K,200,100)}},{name:"\u63D2\u5165\u4E8C\u7EF4\u7801",when:I=>!I.isReadonly&&I.editorTextFocus,callback:I=>{const K=window.prompt("\u8BF7\u8F93\u5165\u5185\u5BB9");I.executeInsertBarcode2D(K,200,200)}},{name:"\u5BFC\u51FA\u6587\u6863",when:()=>!0,callback:I=>{r==""&&(r=window.prompt("\u8BF7\u8F93\u5165\u6587\u6863\u6807\u9898")),I.executeExportDocx({fileName:r,isFile:!0})}},{name:"\u5BFC\u5165\u6587\u6863",when:()=>!0,callback:()=>{n.click()}},{name:"\u5BFC\u5165excel",when:()=>!0,callback:()=>{i.click()}},{name:"\u6279\u6CE8",when:I=>!I.isReadonly&&I.editorHasSelection&&I.zone===lt.MAIN,callback:I=>{new zt({title:"\u6279\u6CE8",data:[{type:"textarea",label:"\u6279\u6CE8",height:100,name:"value",required:!0,placeholder:"\u8BF7\u8F93\u5165\u6279\u6CE8"}],onConfirm:K=>{var H;const y=(H=K.find(A=>A.name==="value"))==null?void 0:H.value;if(!y)return;const J=I.executeSetGroup();!J||Ni.push({id:J,content:y,userName:"godoos",rangeText:I.getRangeText(),createdDate:new Date().toLocaleString()})}})}},{name:"\u7B7E\u540D",icon:"signature",when:I=>!I.isReadonly&&I.editorTextFocus,callback:I=>{new jR({onConfirm(K){if(!K)return;const{value:y,width:J,height:H}=K;!y||!J||!H||I.executeInsertElementList([{value:y,width:J,height:H,type:F.IMAGE}])}})}},{name:"\u683C\u5F0F\u6574\u7406",icon:"word-tool",when:I=>!I.isReadonly,callback:I=>{I.executeWordTool()}}]),i.onchange=()=>{var y;const I=(y=i==null?void 0:i.files)==null?void 0:y[0];if(!I)return;const K=new FileReader;K.onload=J=>{var A;const H=(A=J==null?void 0:J.target)==null?void 0:A.result;H instanceof ArrayBuffer&&e.command.executeImportExcel({arrayBuffer:H}),i.value=""},K.readAsArrayBuffer(I)},n.onchange=()=>{var y;const I=(y=n==null?void 0:n.files)==null?void 0:y[0];if(!I)return;const K=new FileReader;K.onload=J=>{var A;const H=(A=J==null?void 0:J.target)==null?void 0:A.result;H instanceof ArrayBuffer&&e.command.executeImportDocx({arrayBuffer:H}),n.value=""},K.readAsArrayBuffer(I)};const Li=()=>{r==""&&(r=window.prompt("\u8BF7\u8F93\u5165\u6587\u6863\u6807\u9898")),e.command.executeExportDocx({fileName:r,isFile:!1})};e.register.shortcutList([{key:z.S,mod:!0,isGlobal:!0,callback:()=>{Li()}},{key:z.P,mod:!0,isGlobal:!0,callback:I=>{I.executePrint()}},{key:z.F,mod:!0,isGlobal:!0,callback:I=>{const K=I.getRangeText();Ct.click(),K&&(pt.value=K,e.command.executeSearch(K),Bt())}},{key:z.MINUS,ctrl:!0,isGlobal:!0,callback:I=>{I.executePageScaleMinus()}},{key:z.EQUAL,ctrl:!0,isGlobal:!0,callback:I=>{I.executePageScaleAdd()}},{key:z.ZERO,ctrl:!0,isGlobal:!0,callback:I=>{I.executePageScaleRecovery()}}]),document.querySelector(".menu-item__save").addEventListener("click",()=>{Li()});const Os=I=>{const K=window.atob(I),y=K.length,J=new Uint8Array(y);for(let H=0;H{const K=I.data;if(r=K.title?K.title:"\u672A\u547D\u540D\u6587\u6863",K.type==="init"){const y=K.data;if(!y)return;const J=Os(y.content);e.command.executeImportDocx({arrayBuffer:J})}};window.parent.postMessage({type:"initSuccess"},"*"),window.addEventListener("message",Oi),window.addEventListener("unload",()=>{window.removeEventListener("message",Oi)})};