ht-emr 0.7.60 → 0.7.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="canvas-editor-style",e.appendChild(document.createTextNode(`.ce-select-control-popup{max-width:160px;min-width:69px;max-height:225px;position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;display:flex;flex-direction:column;overflow:hidden}.ce-select-control-search{display:block;width:calc(100% - 16px);height:28px;margin:8px;padding:0 8px;border:1px solid #dcdfe6;border-radius:3px;outline:none;box-sizing:border-box;color:#606266;font-size:13px;line-height:28px}.ce-select-control-search:focus{border-color:var(--COLOR-HOVER, #5175f4)}.ce-select-control-popup ul{list-style:none;padding:3px 0;margin:0;min-height:0;overflow-y:auto;box-sizing:border-box}.ce-select-control-popup ul li{font-size:13px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#666;height:36px;line-height:36px;box-sizing:border-box;cursor:pointer}.ce-select-control-popup ul li:hover,.ce-select-control-popup ul li.keyboard-active{background-color:#eef2fd}.ce-select-control-popup ul li.active{color:var(--COLOR-HOVER, #5175f4);font-weight:700}.ce-select-control-popup ul li.ce-select-control-empty{color:#909399;cursor:default;text-align:center}.ce-select-control-popup ul li.ce-select-control-empty:hover{background-color:transparent}.ce-calculator{position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;padding:8px;width:200px}.ce-calculator-display{width:100%;height:40px;line-height:40px;text-align:right;padding:0 10px;margin-bottom:8px;border:1px solid #e4e7ed;border-radius:4px;background-color:#f5f7fa;font-size:16px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}.ce-calculator-buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ce-calculator-button{width:100%;height:36px;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;font-size:14px;cursor:pointer;transition:all .2s;box-sizing:border-box}.ce-calculator-button:hover{background-color:#eef2fd;border-color:#c6d1ff}.ce-calculator-button:active{background-color:#e1e8ff}.ce-calculator-button.operator{background-color:#f5f7fa}.ce-calculator-button.operator:hover{background-color:#eef2fd}.ce-calculator-button.equal{background-color:var(--COLOR-HOVER, #5175f4);color:#fff;border-color:var(--COLOR-HOVER, #5175f4)}.ce-calculator-button.equal:hover{background-color:var(--COLOR-HOVER, #6a84ff);border-color:var(--COLOR-HOVER, #6a84ff)}.ce-calculator-button.utility{background-color:#f0f2f5}.ce-calculator-button.utility:hover{background-color:#e6e8eb}.ce-date-container{display:none;width:300px;overflow:hidden;left:0;right:0;position:absolute;z-index:1;color:#606266;background:#fff;border-radius:4px;padding:10px;-webkit-user-select:none;user-select:none;border:1px solid #e4e7ed;box-shadow:0 2px 12px #0000001a}.ce-date-container.active{display:block}.ce-date-wrap{display:none}.ce-date-wrap.active{display:block}.ce-date-title{display:flex;justify-content:center;align-items:center;text-align:center;color:#606266;font-size:16px}.ce-date-title>span{display:inline-block}.ce-date-title>span:not(.ce-date-title__now){font-family:cursive;cursor:pointer}.ce-date-title>span:not(.ce-date-title__now):hover{color:#5175f4}.ce-date-title .ce-date-title__pre-year,.ce-date-title .ce-date-title__pre-month{width:15%}.ce-date-title .ce-date-title__now{width:40%}.ce-date-title .ce-date-title__next-year,.ce-date-title .ce-date-title__next-month{width:15%}.ce-date-week{width:100%;display:flex;justify-content:center;margin-top:15px;padding-bottom:5px;border-bottom:1px solid #e4e7ed}.ce-date-week>span{list-style:none;width:calc(100%/7);text-align:center;color:#606266;font-size:14px}.ce-date-day{width:100%;display:flex;flex-wrap:wrap;align-items:center;margin-top:5px}.ce-date-day>div{width:calc(100%/7);height:40px;text-align:center;color:#606266;font-size:14px;cursor:pointer;line-height:40px;border-radius:4px}.ce-date-day>div:hover{color:#5175f4;opacity:.8}.ce-date-day>div.active{color:#5175f4;font-weight:700}.ce-date-day>div.disable{color:#c0c4cc}.ce-date-day>div.select{color:#fff;background-color:#5175f4}.ce-time-wrap{display:none;padding:10px;height:286px}.ce-time-wrap ::-webkit-scrollbar{width:0}.ce-time-wrap.active{display:flex}.ce-time-wrap li{list-style:none}.ce-time-wrap>li{width:33.3%;height:100%;text-align:center}.ce-time-wrap>li>span{transform:translateY(-5px);display:inline-block}.ce-time-wrap>li>ol{height:calc(100% - 20px);overflow-y:auto;border:1px solid #e2e2e2;position:relative}.ce-time-wrap>li:first-child>ol{border-right:0}.ce-time-wrap>li:last-child>ol{border-left:0}.ce-time-wrap>li>ol>li{line-height:30px;cursor:pointer;transition:all .3s}.ce-time-wrap>li>ol>li:hover{background-color:#eaeaea}.ce-time-wrap>li>ol>li.active{color:#fff;background:#5175f4}.ce-date-menu{width:100%;height:28px;display:flex;justify-content:flex-end;align-items:center;padding-top:10px;position:relative;border-top:1px solid #e4e7ed}.ce-date-menu button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;appearance:none;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;-webkit-user-select:none;user-select:none;padding:7px 15px;font-size:12px;border-radius:3px;margin:0 0 0 10px}.ce-date-menu button:hover{color:#5175f4;border-color:#5175f4}.ce-date-menu button.ce-date-menu__time{border:1px solid transparent;position:absolute;left:0;margin-left:0}.ce-date-menu button.ce-date-menu__time:hover{color:#5175f4}.ce-block-item{position:absolute;z-index:0;background-color:#fff;border:1px solid rgb(235 236 240)}.ce-block-item .ce-resizer-selection{width:100%;height:100%}.ce-block-item .ce-resizer-mask{position:absolute;inset:0;z-index:1;background-color:transparent}.ce-table-tool__row{position:absolute;width:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed}.ce-table-tool__row .ce-table-tool__row__item{width:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__row .ce-table-tool__row__item:after{content:"";position:absolute;bottom:0;left:2px;width:8px;height:1px;background-color:#c0c6cf}.ce-table-tool__row .ce-table-tool__row__item:hover{background-color:#dadce0}.ce-table-tool__row .ce-table-tool__row__item:last-child:after{display:none}.ce-table-tool__quick__add{width:16px;height:16px;position:absolute;border-radius:50%;background-color:#e2e6ed;cursor:pointer}.ce-table-tool__quick__add:after{content:"+";color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-55%)}.ce-table-tool__select{width:16px;height:18px;position:absolute;border-radius:3px;cursor:pointer}.ce-table-tool__select:hover{background-color:#e2e6ed}.ce-table-tool__select:after{content:":::";color:#aaaaab;position:absolute;top:50%;left:50%;transform:translate(-75%,-50%) rotate(-90deg)}.ce-table-tool__col{position:absolute;height:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed;display:flex}.ce-table-tool__col .ce-table-tool__col__item{height:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__col .ce-table-tool__col__item:after{content:"";position:absolute;top:2px;left:-1px;width:1px;height:8px;z-index:1;background-color:#c0c6cf}.ce-table-tool__col .ce-table-tool__col__item:hover{background-color:#dadce0}.ce-table-tool__col .ce-table-tool__col__item:first-child:after{display:none}.ce-table-tool__row .ce-table-tool__row__item.active,.ce-table-tool__col .ce-table-tool__col__item.active{background-color:#c4d7fa}.ce-table-tool__col .ce-table-tool__anchor{right:-5px;width:10px;height:12px;z-index:9;position:absolute;cursor:col-resize}.ce-table-tool__row .ce-table-tool__anchor{bottom:-5px;left:0;width:12px;height:10px;z-index:9;position:absolute;cursor:row-resize}.ce-table-anchor__line{z-index:9;position:absolute;border:1px dotted #000000}.ce-table-tool__border{position:absolute;z-index:1;background:transparent;pointer-events:none}.ce-table-tool__border__row{position:absolute;cursor:row-resize;pointer-events:auto}.ce-table-tool__border__col{position:absolute;cursor:col-resize;pointer-events:auto}.ce-resizer-selection{position:absolute;border:1px solid;pointer-events:none}.ce-resizer-selection .resizer-handle{position:absolute;z-index:9;width:10px;height:10px;box-shadow:0 1px 4px #0000004d;border-radius:5px;border:2px solid #ffffff;box-sizing:border-box;pointer-events:initial}.ce-resizer-selection .handle-0{cursor:nw-resize}.ce-resizer-selection .handle-1{cursor:n-resize}.ce-resizer-selection .handle-2{cursor:ne-resize}.ce-resizer-selection .handle-3{cursor:e-resize}.ce-resizer-selection .handle-4{cursor:se-resize}.ce-resizer-selection .handle-5{cursor:s-resize}.ce-resizer-selection .handle-6{cursor:sw-resize}.ce-resizer-selection .handle-7{cursor:w-resize}.ce-resizer-size-view{display:flex;align-items:center;height:20px;white-space:nowrap;position:absolute;z-index:9;top:-30px;left:0;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px}.ce-resizer-size-view span{color:#fff;font-size:12px}.ce-resizer-image{position:absolute;opacity:.5}.ce-image-previewer{position:fixed;left:0;top:0;z-index:1000;width:100%;height:100%;overflow:hidden;background:#f2f4f7;display:flex;align-items:center;justify-content:center;animation:previewerAnimation .3s}@keyframes previewerAnimation{0%{opacity:.1}to{opacity:1}}.ce-image-previewer .image-close{width:24px;height:24px;display:inline-block;position:absolute;right:50px;top:30px;z-index:99;cursor:pointer;background:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.97%207l1.415%201.414-7.779%207.778%207.779%207.779-1.414%201.414-7.779-7.779-7.778%207.779L7%2023.97l7.778-7.779L7%208.414%208.414%207l7.778%207.778L23.971%207z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e") no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .image-close:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-container{position:relative}.ce-image-previewer .ce-image-container img{cursor:move;position:relative}.ce-image-previewer .ce-image-menu{height:50px;position:absolute;bottom:50px;z-index:99;display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i{width:32px;height:32px;margin:0 8px;cursor:pointer;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .ce-image-menu i:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-menu i.zoom-in{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%2014v-4h2v4h4v2h-4v4h-2v-4h-4v-2h4zm8.749%2010.163A11.952%2011.952%200%200115%2027C8.373%2027%203%2021.627%203%2015S8.373%203%2015%203s12%205.373%2012%2012c0%202.954-1.067%205.658-2.837%207.749l4.908%204.908-1.414%201.414-4.908-4.908zM15%2025c5.523%200%2010-4.477%2010-10S20.523%205%2015%205%205%209.477%205%2015s4.477%2010%2010%2010z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.zoom-out{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22.749%2024.163A11.952%2011.952%200%200115%2027C8.373%2027%203%2021.627%203%2015S8.373%203%2015%203s12%205.373%2012%2012c0%202.954-1.067%205.658-2.837%207.749l4.908%204.908-1.414%201.414-4.908-4.908zM15%2025c5.523%200%2010-4.477%2010-10S20.523%205%2015%205%205%209.477%205%2015s4.477%2010%2010%2010zm-5-11h10v2H10v-2z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.rotate{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M16%204c6.627%200%2012%205.373%2012%2012a11.97%2011.97%200%2001-4%208.944V23h-.86A9.968%209.968%200%200026%2016c0-5.523-4.477-10-10-10S6%2010.477%206%2016c0%205.185%203.947%209.449%209%209.95v2.009C8.84%2027.451%204%2022.291%204%2016%204%209.373%209.373%204%2016%204z'%20fill-rule='nonzero'/%3e%3cpath%20d='M19.879%2027.328l1.767-6.717%204.95%204.95z'/%3e%3c/g%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.original-size{background-image:url("data:image/svg+xml,%3csvg%20width='32'%20height='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%204h24v24H4V4zm2%202v20h20V6H6zm4%205h2v10h-2V11zm5%202h2v2h-2v-2zm0%204h2v2h-2v-2zm5-6h2v10h-2V11z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.image-download{background-image:url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.5%2015v3.5h15V15H21v5H3v-5h1.5zm8.232-11.226v9.196l4.05-4.05%201.06%201.06-5.834%205.834-5.833-5.833%201.06-1.06%203.998%203.996V3.774h1.5z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu .image-navigate{display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i.image-pre{background-image:url("data:image/svg+xml,%3csvg%20width='20'%20height='20'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.5%204.063L6.875%2010l5.625%205.938'%20stroke='%233D4757'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu i.image-next{background-image:url("data:image/svg+xml,%3csvg%20width='20'%20height='20'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.5%204.063L13.125%2010%207.5%2015.938'%20stroke='%233D4757'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e")}.ce-image-previewer .ce-image-menu .image-count{color:#000;font-size:20px}.ce-image-previewer .ce-image-menu i.disabled{cursor:not-allowed;opacity:.5}.ce-contextmenu-container{z-index:9;position:fixed;display:none;padding:4px;overflow-x:hidden;overflow-y:auto;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.ce-contextmenu-content{display:flex;flex-direction:column}.ce-contextmenu-content .ce-contextmenu-sub-item:after{position:absolute;content:"";width:16px;height:16px;right:12px;background:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M0%200h16v16H0z'/%3e%3cg%20fill='%23767C85'%3e%3cpath%20d='M7%2012.243l-.707-.707%204.243-4.243.707.707z'/%3e%3cpath%20d='M6.293%204.464L7%203.757%2011.243%208l-.707.707z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-content .ce-contextmenu-item{min-width:140px;padding:0 32px 0 16px;height:30px;display:flex;align-items:center;white-space:nowrap;box-sizing:border-box;cursor:pointer}.ce-contextmenu-content .ce-contextmenu-item.hover{background:#1937580a}.ce-contextmenu-content .ce-contextmenu-item span{max-width:300px;font-size:12px;color:#3d4757;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ce-contextmenu-content .ce-contextmenu-item span.ce-shortcut{color:#767c85;height:30px;flex:1;text-align:right;line-height:30px;margin-left:20px}.ce-contextmenu-content .ce-contextmenu-item i{width:16px;height:16px;vertical-align:middle;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;flex-shrink:0;margin-right:8px}.ce-contextmenu-divider{background-color:#e2e6ed;margin:4px 16px;height:1px}.ce-contextmenu-print{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M12%204h-1V2H5v2H4V2a1%201%200%20011-1h6a1%201%200%20011%201v2zm0%205v4a1%201%200%2001-1%201H5a1%201%200%2001-1-1V9h1v4h6V9h1z'/%3e%3cpath%20d='M12%2012v-1h2V5H2v6h2v1H2a1%201%200%2001-1-1V5a1%201%200%20011-1h12a1%201%200%20011%201v6a1%201%200%2001-1%201h-2z'/%3e%3cpath%20d='M3%208h10v1H3zm8-2h2v1h-2z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-image{background-image:url("data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_插入图片-16px-'%3e%3cg%20id='Group-19'%20transform='translate(1%201)'%3e%3cpath%20id='Combined-Shape'%20class='st0'%20d='M1%200h12c.6%200%201%20.4%201%201v11c0%20.6-.4%201-1%201H1c-.6%200-1-.4-1-1V1c0-.6.4-1%201-1zm0%201v11h12V1H1z'/%3e%3ccircle%20id='椭圆形'%20class='st0'%20cx='10'%20cy='4'%20r='1'/%3e%3cpath%20id='Path'%20class='st0'%20d='M8.5%2011.2l-4-4.1L1%2010.7V9.2c1.7-1.6%202.7-2.5%203-2.8.4-.5.7-.4%201%200L8.5%2010%2011%207.3c.4-.5.6-.5%201-.1l2%202.8v1.5l-2.5-3.4-3%203.1z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-image-change{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(2%204)'%20fill='%233D4757'%3e%3ccircle%20fill-rule='nonzero'%20cx='3'%20cy='1'%20r='1'/%3e%3cpath%20d='M7.473%208.223L3.47%204.107%200%207.667v-1.5C1.715%204.6%202.707%203.664%202.975%203.358c.402-.457.651-.39%201.042%200L7.473%207%209.96%204.349c.414-.462.62-.462%201.011-.071L13%207.06v1.5l-2.51-3.41-3.017%203.072z'/%3e%3c/g%3e%3cpath%20d='M6%201.5H1.5v12h13v-4V13a.5.5%200%2001-.5.5H2a.5.5%200%2001-.5-.5V2a.5.5%200%2001.5-.5h4zm8.5%208V6l-.5.5h1l-.5-.5v3.5zM6%201.5h4L9.5%201v1l.5-.5H6z'%20stroke='%233D4757'/%3e%3cpath%20d='M13.085%201.316l-3.814%204a1%201%200%20001.458%201.368l3.815-4a1%201%200%2010-1.459-1.368z'%20fill='%233D4757'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-row-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%233D4757'%20d='M8.5%205.5h6v4h-6z'/%3e%3cpath%20fill='%233D4757'%20d='M4%207v1h2V7zm-3%20.5L4%205v5zM1%201h12v1H1zm0%2012h12v1H1z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-top-row{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M8%205H7v3h1zm-.5-3L10%205H5z'/%3e%3crect%20stroke='%233D4757'%20x='1.5'%20y='10.5'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-bottom-row{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M7%2011h1V8H7zm.5%203L5%2011h5z'/%3e%3crect%20stroke='%233D4757'%20x='1.5'%20y='2.5'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-left-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M11%207v1h3V7zm-3%20.5L11%205v5z'/%3e%3crect%20stroke='%233D4757'%20transform='rotate(90%204%207.5)'%20x='-2'%20y='6'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-insert-right-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M5%208V7H2v1zm3-.5L5%2010V5z'/%3e%3crect%20stroke='%233D4757'%20transform='rotate(90%2012%207.5)'%20x='6'%20y='6'%20width='12'%20height='3'%20rx='1'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-row-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%23929AA8'%20d='M8.5%206.5h6v2h-6z'/%3e%3cpath%20fill='%233D4757'%20d='M2%2012h11v1H2zM2%202h11v1H2zm.63%203L7%209.35l-.635.65L2%205.63z'/%3e%3cpath%20fill='%233D4757'%20d='M2%209.363L6.355%205%207%205.707%202.695%2010z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-row{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%23929AA8'%20d='M8.5%205.5h6v4h-6z'/%3e%3cpath%20fill='%233D4757'%20d='M1%2013h12v1H1zM1%201h12v1H1zm0%204h1v1H1zm1%201h1v1H2zm1%201h1v1H3zm1-1h1v1H4zm1-1h1v1H5zM4%208h1v1H4zM2%208h1v1H2zm3%201h1v1H5zM1%209h1v1H1z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-col{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%23929AA8'%20d='M5.5%207.5v-6h4v6z'/%3e%3cpath%20fill='%233D4757'%20d='M13%2015V3h1v12zM1%2015V3h1v12zm4%200v-1h1v1zm1-1v-1h1v1zm1-1v-1h1v1zm-1-1v-1h1v1zm-1-1v-1h1v1zm3%201v-1h1v1zm0%202v-1h1v1zm1-3v-1h1v1zm0%204v-1h1v1z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-delete-table{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M14%2013h-1v-3H2v3H1v-3a1%201%200%20011-1h11a1%201%200%20011%201v3z'%20fill-rule='nonzero'/%3e%3cpath%20d='M5.625%202L10%206.375%209.375%207%205%202.625z'/%3e%3cpath%20d='M5%206.375L9.375%202l.625.625L5.625%207z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-merge-cell{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M6%201v1H2v11h4v1H2a1%201%200%2001-1-1V2a1%201%200%20011-1h4zm3%200h4a1%201%200%20011%201v11a1%201%200%2001-1%201H9v-1h4V2H9V1z'/%3e%3cpath%20fill-rule='nonzero'%20d='M6%201h1v4H6zm2%200h1v4H8z'/%3e%3cpath%20d='M8%207.5L10%206v3zm-1%200L5%206v3z'/%3e%3cpath%20d='M9%207h3v1H9zM3%207h3v1H3z'/%3e%3cpath%20fill-rule='nonzero'%20d='M8%2010h1v4H8zm-2%200h1v4H6z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-merge-cancel-cell{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M6%201v1H2v11h4v1H2a1%201%200%2001-1-1V2a1%201%200%20011-1h4zm3%200h4a1%201%200%20011%201v11a1%201%200%2001-1%201H9v-1h4V2H9V1z'/%3e%3cpath%20fill-rule='nonzero'%20d='M6%201h1v4H6zm2%200h1v4H8z'/%3e%3cpath%20d='M3%207.5L5%206v3zm9%200L10%206v3z'/%3e%3cpath%20d='M4%207h3v1H4zm4%200h3v1H8z'/%3e%3cpath%20fill-rule='nonzero'%20d='M8%2010h1v4H8zm-2%200h1v4H6z'/%3e%3c/g%3e%3c/svg%3e")}.ce-contextmenu-vertical-align{background-image:url("data:image/svg+xml,%3csvg%20height='16'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2zm0-3h8v1H2zm0-3h12v1H2zm0-6h12v1H2zm0%203h8v1H2z'%20fill='%233d4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-vertical-align-top{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8%208H7v6h1zm-.5-3L10%208H5zM2%203h11v1H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-vertical-align-middle{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8%2012H7v3h1zm-.5-3l2.5%203H5zM7%203h1V0H7zm.5%203L5%203h5zM2%207h11v1H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-vertical-align-bottom{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%209h1V3H7zm.5%203L5%209h5zM2%2013h11v1H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.ce-contextmenu-border-all{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M3%208h11v1H3z'/%3e%3cpath%20fill='%233D4757'%20d='M9%203v11H8V3z'/%3e%3c/svg%3e")}.ce-contextmenu-border-empty{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13%203h-1V2h1a1%201%200%20011%201v1h-1V3zm-3-1v1H8.5v2h-1V3H6V2h4zM4%202v1H3v1H2V3a1%201%200%20011-1h1zM2%206h1v1.5h2v1H3V10H2V6zm0%206h1v1h1v1H3a1%201%200%2001-1-1v-1zm4%202v-1h1.5v-2h1v2H10v1H6zm6%200v-1h1v-1h1v1a1%201%200%2001-1%201h-1zm2-4h-1V8.5h-2v-1h2V6h1v4zM8.5%207.5v-1h-1v1h-1v1h1v1h1v-1h1v-1h-1z'%20fill='%23AAACB0'/%3e%3c/svg%3e")}.ce-contextmenu-border-dash{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13%203h-1V2h1a1%201%200%20011%201v1h-1V3zm-3-1v1H8.5v2h-1V3H6V2h4zM4%202v1H3v1H2V3a1%201%200%20011-1h1zM2%206h1v1.5h2v1H3V10H2V6zm0%206h1v1h1v1H3a1%201%200%2001-1-1v-1zm4%202v-1h1.5v-2h1v2H10v1H6zm6%200v-1h1v-1h1v1a1%201%200%2001-1%201h-1zm2-4h-1V8.5h-2v-1h2V6h1v4zM8.5%207.5v-1h-1v1h-1v1h1v1h1v-1h1v-1h-1z'%20fill='%23000000'/%3e%3c/svg%3e")}.ce-contextmenu-border-external{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%233D4757'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%205V3H8v2h1zm0%209v-2H8v2h1zM5%208H3v1h2V8zm9%200h-2v1h2V8zM9%207v1h1v1H9v1H8V9H7V8h1V7h1z'%20fill='%23AAACB0'/%3e%3c/svg%3e")}.ce-contextmenu-border-internal{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9%205V3H8v2h1zm0%209v-2H8v2h1zM5%208H3v1h2V8zm9%200h-2v1h2V8zM9%207v1h1v1H9v1H8V9H7V8h1V7h1z'%20fill='%233D4757'/%3e%3c/svg%3e")}.ce-contextmenu-border-td{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20d='M8.5%202.5%20v6%20h-6'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-top{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M2.5%203%20h12'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-left{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M3%203%20v11'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-bottom{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M2.5%2014%20h12'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-right{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'/%3e%3cpath%20stroke='%233D4757'%20stroke-width='2'%20d='M14%203%20v11'/%3e%3c/svg%3e")}.ce-contextmenu-border-td-forward{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'%20/%3e%3cpath%20stroke='%233D4757'%20d='M14%203%20l-11%2011'%20/%3e%3c/svg%3e")}.ce-contextmenu-border-td-back{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.5%203a.5.5%200%2001.5-.5h11a.5.5%200%2001.5.5v11a.5.5%200%2001-.5.5H3a.5.5%200%2001-.5-.5V3z'%20stroke='%23AAACB0'%20/%3e%3cpath%20stroke='%233D4757'%20d='M3%203%20l11%2011'%20/%3e%3c/svg%3e")}.ce-hyperlink-popup{background:#fff;box-shadow:0 2px 12px #626b8433;border-radius:2px;color:#3d4757;padding:12px 16px;position:absolute;z-index:1;text-align:center;display:none}.ce-hyperlink-popup a{min-width:100px;max-width:300px;font-size:12px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;text-decoration:none;border-bottom-width:1px;border-bottom-style:solid;color:#00f}.ce-zone-indicator>div{padding:3px 6px;color:#000;font-size:12px;background:#dae7fc;position:absolute;transform-origin:0 0}.ce-zone-indicator-border__top,.ce-zone-indicator-border__bottom,.ce-zone-indicator-border__left,.ce-zone-indicator-border__right{display:block;position:absolute;z-index:0}.ce-zone-indicator-border__top{border-top:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__bottom{border-top:2px dashed rgb(238,238,238);width:100%}.ce-zone-indicator-border__left{border-left:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__right{border-right:2px dashed rgb(238,238,238)}.ce-zone-tip{display:none;align-items:center;height:30px;white-space:nowrap;position:fixed;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px;z-index:9;transition:all .3s;outline:none;-webkit-user-select:none;user-select:none;pointer-events:none;transform:translate(10px,10px)}.ce-zone-tip.show{display:flex}.ce-zone-tip span{color:#fff;font-size:12px}.ce-inputarea{min-width:60px!important;min-height:0;margin:0;padding:0;left:0;top:0;letter-spacing:0;font-size:12px;position:absolute;z-index:-1;outline:none;resize:none;border:none;overflow:hidden;color:transparent;-webkit-user-select:none;user-select:none;caret-color:transparent;background-color:transparent;white-space:pre}.ce-cursor{width:1px;height:20px;left:0;right:0;position:absolute;outline:none;background-color:#000;pointer-events:none}.ce-cursor.ce-cursor--animation{animation-duration:1s;animation-iteration-count:infinite;animation-name:cursorAnimation}@keyframes cursorAnimation{0%{opacity:1}13%{opacity:0}50%{opacity:0}63%{opacity:1}to{opacity:1}}.ce-float-image{position:absolute;opacity:.5;pointer-events:none}.ce-button-input-modal{position:fixed;top:0;left:0;width:100%;height:100%;background:transparent;display:flex;justify-content:center;align-items:center;z-index:2000}.ce-button-input-modal__content{background:#fff;border-radius:8px;padding:20px;min-width:320px;max-width:480px;box-shadow:0 4px 20px #00000026}.ce-button-input-modal__title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px}.ce-button-input-modal__textarea{width:100%;min-height:100px;padding:10px 12px;border:1px solid #dcdfe6;border-radius:4px;font-size:13px;line-height:1.5;resize:vertical;outline:none;box-sizing:border-box;font-family:inherit}.ce-button-input-modal__textarea:focus{border-color:#5175f4}.ce-button-input-modal__textarea::placeholder{color:#c0c4cc}.ce-button-input-modal__buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.ce-button-input-modal__cancel,.ce-button-input-modal__confirm{padding:8px 16px;font-size:13px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.ce-button-input-modal__cancel:hover{color:#5175f4;border-color:#5175f4}.ce-button-input-modal__confirm{background:#5175f4;border-color:#5175f4;color:#fff}.ce-button-input-modal__confirm:hover{background:#409eff;border-color:#409eff}.ce-button-edit-modal{position:fixed;top:0;left:0;width:100%;height:100%;background:transparent;display:flex;justify-content:center;align-items:center;z-index:1000}.ce-button-edit-modal__content{background:#fff;border-radius:8px;padding:20px;min-width:320px;max-width:480px;box-shadow:0 4px 20px #00000026}.ce-button-edit-modal__title{font-size:14px;font-weight:500;color:#333;margin-bottom:16px}.ce-button-edit-modal__form{display:flex;flex-direction:column;gap:12px}.ce-button-edit-modal__field{display:flex;align-items:center;gap:8px}.ce-button-edit-modal__field label{min-width:80px;font-size:13px;color:#606266}.ce-button-edit-modal__field input{flex:1;padding:8px 12px;border:1px solid #dcdfe6;border-radius:4px;font-size:13px;outline:none;box-sizing:border-box}.ce-button-edit-modal__field input:focus{border-color:#5175f4}.ce-button-edit-modal__field input::placeholder{color:#c0c4cc}.ce-button-edit-modal__buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.ce-button-edit-modal__cancel,.ce-button-edit-modal__confirm{padding:8px 16px;font-size:13px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.ce-button-edit-modal__cancel:hover{color:#5175f4;border-color:#5175f4}.ce-button-edit-modal__confirm{background:#5175f4;border-color:#5175f4;color:#fff}.ce-button-edit-modal__confirm:hover{background:#409eff;border-color:#409eff}.ce-number-input-modal{position:fixed;top:0;left:0;width:100%;height:100%;background:transparent;display:flex;justify-content:center;align-items:center;z-index:2000}.ce-number-input-modal__content{background:#fff;border-radius:8px;padding:20px;min-width:300px;max-width:400px;box-shadow:0 4px 20px #00000026}.ce-number-input-modal__title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px}.ce-number-input-modal__hint{font-size:12px;color:#909399;margin-bottom:12px}.ce-number-input-modal__input{width:100%;padding:10px 12px;border:1px solid #dcdfe6;border-radius:4px;font-size:13px;outline:none;box-sizing:border-box}.ce-number-input-modal__input:focus{border-color:#5175f4}.ce-number-input-modal__input::placeholder{color:#c0c4cc}.ce-number-input-modal__error{font-size:12px;color:#f56c6c;margin-top:8px}.ce-number-input-modal__buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.ce-number-input-modal__cancel,.ce-number-input-modal__confirm{padding:8px 16px;font-size:13px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.ce-number-input-modal__cancel:hover{color:#5175f4;border-color:#5175f4}.ce-number-input-modal__confirm{background:#5175f4;border-color:#5175f4;color:#fff}.ce-number-input-modal__confirm:hover{background:#409eff;border-color:#409eff}.tooth-position-edit-modal,.tooth-position-create-modal{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000}.tooth-position-modal__container{position:relative;top:auto;left:auto;transform:none;background:#fff;border-radius:8px;box-shadow:0 4px 12px #00000026;min-width:400px;max-width:90vw;max-height:calc(100vh - 48px);display:flex;flex-direction:column;pointer-events:auto}.tooth-position-modal__header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #e8e8e8}.tooth-position-modal__header span{font-size:16px;font-weight:500;color:#333}.tooth-position-modal__close{font-size:20px;cursor:pointer;color:#999;line-height:1}.tooth-position-modal__close:hover{color:#333}.tooth-position-modal__content{padding:20px;max-height:60vh;overflow-y:auto}.tooth-section{margin-bottom:20px}.tooth-section:last-child{margin-bottom:0}.tooth-section-title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px;padding-left:8px;border-left:3px solid #1890ff}.tooth-row{display:flex;align-items:center;margin-bottom:8px}.tooth-row:last-child{margin-bottom:0}.tooth-row-label{width:30px;font-size:13px;color:#666}.tooth-buttons{display:flex;gap:8px;flex-wrap:wrap}.letter-buttons{margin-left:30px}.tooth-checkbox{display:flex;align-items:center;cursor:pointer}.tooth-checkbox input{display:none}.tooth-checkbox span{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid #d9d9d9;border-radius:4px;background:#f5f5f5;font-size:14px;color:#333;transition:all .2s}.tooth-checkbox input:checked+span{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-checkbox:hover span{border-color:#1890ff}.tooth-position-modal__footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 20px;border-top:1px solid #e8e8e8}.tooth-position-modal__footer .btn-cancel,.tooth-position-modal__footer .btn-confirm{padding:8px 20px;font-size:14px;border-radius:4px;cursor:pointer;border:1px solid #dcdfe6;background:#fff;color:#606266;transition:all .2s}.tooth-position-modal__footer .btn-cancel:hover{color:#1890ff;border-color:#1890ff}.tooth-position-modal__footer .btn-confirm{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-position-modal__footer .btn-confirm:hover{background:#40a9ff;border-color:#40a9ff}.tooth-grid-container{display:flex;flex-direction:column;align-items:center;padding:15px 20px;background:#fafafa;border-radius:8px;margin-bottom:15px;position:relative}.tooth-quick-buttons{display:flex;gap:6px;margin-bottom:16px}.tooth-quick-buttons-left{display:flex;flex-direction:column;gap:6px;flex:1}.tooth-quick-buttons-row{display:flex;gap:6px}.tooth-quick-btn{padding:6px 12px;font-size:12px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;background:#fff;color:#333;transition:all .2s;white-space:nowrap}.tooth-quick-btn:hover{border-color:#1890ff;color:#1890ff}.tooth-quick-btn.selected{background:#0ff;border-color:#0ff;color:#fff}.tooth-quick-btn--clear{background:#ff6b6b;border-color:#ff6b6b;color:#fff}.tooth-quick-btn--clear:hover{background:#ff5252;border-color:#ff5252;color:#fff}.tooth-grid-container:before{content:"";position:absolute;left:50%;top:20px;bottom:20px;width:2px;background:#000;transform:translate(-50%);z-index:1}.tooth-grid-container:after{content:"";position:absolute;left:20px;right:20px;top:50%;height:2px;background:#000;transform:translateY(-50%);z-index:1}.tooth-grid-letter-row,.tooth-grid-number-row{display:flex;align-items:center;justify-content:center;position:relative;z-index:2}.tooth-grid-half{display:flex;align-items:center;justify-content:center;gap:4px}.tooth-grid-half.left{justify-content:flex-end;padding-right:15px}.tooth-grid-half.right{justify-content:flex-start;padding-left:15px}.tooth-grid-divider-v,.tooth-grid-divider-h{display:none}.tooth-grid-number-item{width:34px;height:32px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:500;color:#333;cursor:pointer;background:#fff;transition:all .2s;box-sizing:border-box;border:1px solid #d9d9d9;border-radius:12px}.upper-number-row .tooth-grid-number-item{border-top:none;border-radius:0 0 12px 12px}.lower-number-row .tooth-grid-number-item{border-bottom:none;border-radius:12px 12px 0 0}.tooth-grid-number-item[data-value="1"],.tooth-grid-number-item[data-value="2"],.tooth-grid-number-item[data-value="3"]{border-radius:50px}.upper-number-row .tooth-grid-number-item[data-value="1"],.upper-number-row .tooth-grid-number-item[data-value="2"],.upper-number-row .tooth-grid-number-item[data-value="3"]{border-top:none!important;border-radius:0 0 50px 50px!important}.lower-number-row .tooth-grid-number-item[data-value="1"],.lower-number-row .tooth-grid-number-item[data-value="2"],.lower-number-row .tooth-grid-number-item[data-value="3"]{border-bottom:none!important;border-radius:50px 50px 0 0!important}.tooth-grid-number-item:hover{border-color:#1890ff;color:#1890ff}.tooth-grid-number-item.selected{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-grid-letter-item{width:34px;height:32px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:500;color:#333;cursor:pointer;background:#fff;border:1px solid #d9d9d9;transition:all .2s;box-sizing:border-box;border-radius:12px}.upper-letter-row .tooth-grid-letter-item{border-top:none;border-radius:0 0 12px 12px}.lower-letter-row .tooth-grid-letter-item{border-bottom:none;border-radius:12px 12px 0 0}.tooth-grid-letter-item[data-value=A],.tooth-grid-letter-item[data-value=B],.tooth-grid-letter-item[data-value=C]{border-radius:50px}.upper-letter-row .tooth-grid-letter-item[data-value=A],.upper-letter-row .tooth-grid-letter-item[data-value=B],.upper-letter-row .tooth-grid-letter-item[data-value=C]{border-top:none!important;border-radius:0 0 50px 50px!important}.lower-letter-row .tooth-grid-letter-item[data-value=A],.lower-letter-row .tooth-grid-letter-item[data-value=B],.lower-letter-row .tooth-grid-letter-item[data-value=C]{border-bottom:none!important;border-radius:50px 50px 0 0!important}.tooth-grid-letter-item:hover{border-color:#1890ff;color:#1890ff}.tooth-grid-letter-item.selected{background:#1890ff;border-color:#1890ff;color:#fff}.tooth-grid-letter-row.hidden,.tooth-grid-number-row.hidden{display:none}.tooth-grid-letter-row{margin-bottom:8px}.tooth-grid-number-row.upper-number-row{margin-bottom:15px}.tooth-grid-number-row.lower-number-row{margin-top:15px}.tooth-grid-letter-row.lower-letter-row{margin-top:8px}.tooth-preview-section{padding-top:10px;border-top:1px solid #e8e8e8}.tooth-preview-title{font-size:14px;font-weight:500;color:#333;margin-bottom:12px}.tooth-preview-wrapper{display:flex;gap:15px}.tooth-preview-container{display:flex;justify-content:center;align-items:center;padding:10px;background:#fafafa;border-radius:8px;flex:1;min-height:60px}.tooth-preview-grid{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:0;width:100%;min-height:70px;position:relative}.tooth-preview-grid:before{content:"";position:absolute;left:50%;top:0;bottom:0;width:1px;background:#000;transform:translate(-50%)}.tooth-preview-grid:after{content:"";position:absolute;top:50%;left:0;right:0;height:1px;background:#000;transform:translateY(-50%)}.tooth-preview-quadrant{display:flex;align-items:center;padding:5px 10px;font-size:12px;flex-wrap:wrap;gap:4px;justify-content:center}.tooth-preview-upper-left{justify-content:flex-end}.tooth-preview-upper-right{justify-content:flex-start}.tooth-preview-lower-left{justify-content:flex-end}.tooth-preview-lower-right{justify-content:flex-start}.tooth-preview-tooth{position:relative;display:inline;margin:0 4px}.tooth-preview-tooth-value{font-size:12px}.tooth-preview-tooth-value--deciduous{font-size:10px}.tooth-preview-tooth-bracket{font-size:12px}.tooth-preview-supernumerary{font-size:9px;vertical-align:super;margin:0 1px}.tooth-preview-surface{font-size:9px;vertical-align:super;margin-left:1px}.tooth-extra-panel{width:100px;display:flex;flex-direction:column;gap:10px}.tooth-surface-panel{background:#fafafa;border-radius:8px;padding:10px 20px}.tooth-surface-title{font-size:12px;font-weight:500;color:#333;margin-bottom:8px;text-align:center}.tooth-surface-grid{display:flex;flex-direction:column;gap:4px;align-items:center}.tooth-surface-row{display:flex;gap:4px;justify-content:center}.tooth-surface-item{width:30px;height:30px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:500;color:#333;cursor:pointer;background:#fff;border:1px dashed #d9d9d9;border-radius:5px;transition:all .2s;box-sizing:border-box}.tooth-surface-item--indent{margin-left:17px}.tooth-surface-item:hover{border-color:#1890ff;color:#1890ff}.tooth-surface-item.selected{background:#1890ff;border-color:#1890ff;border-style:solid;color:#fff}.tooth-supernumerary-panel{background:#fafafa;border-radius:8px;padding:10px 20px}.tooth-supernumerary-title{font-size:12px;font-weight:500;color:#333;margin-bottom:4px;text-align:center}.tooth-supernumerary-hint{font-size:10px;color:#999;font-weight:400}.tooth-supernumerary-grid{display:flex;gap:8px;justify-content:center;margin-top:8px}.tooth-supernumerary-item{width:30px;height:35px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:500;color:#333;cursor:pointer;background:#fff;border:1px solid #d9d9d9;border-bottom:none;border-radius:50px;transition:all .2s;box-sizing:border-box}.tooth-supernumerary-item:hover{border-color:#1890ff;color:#1890ff}.tooth-supernumerary-item.selected{background:#1890ff;border-color:#1890ff;color:#fff}.ce-button-input-modal,.ce-button-edit-modal,.ce-number-input-modal,.tooth-position-edit-modal,.tooth-position-create-modal{inset:0;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box;overflow:auto;background:transparent;pointer-events:none}.ce-button-input-modal__content,.ce-button-edit-modal__content,.ce-number-input-modal__content,.tooth-position-modal__container{pointer-events:auto}.ce-button-input-modal__content,.ce-button-edit-modal__content,.ce-number-input-modal__content{max-height:calc(100vh - 48px);overflow:auto}.tooth-position-modal__mask{display:none}.tooth-position-modal__container{position:relative;top:auto;left:auto;transform:none;display:flex;flex-direction:column;max-height:calc(100vh - 48px)}.ant-modal-mask{display:none!important}.ant-modal-wrap{position:fixed!important;inset:0!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:24px!important;box-sizing:border-box!important;overflow:auto!important;pointer-events:none!important}.ant-modal{top:auto!important;margin:0!important;padding-bottom:0!important;max-width:calc(100vw - 48px)!important;max-height:calc(100vh - 48px)!important;pointer-events:auto!important}.ant-modal-content{max-height:calc(100vh - 48px)!important;overflow:auto!important}.dialog-mask{display:none}.dialog-container{position:fixed;inset:0;overflow:auto;z-index:999;margin:0;padding:24px;box-sizing:border-box;display:flex;justify-content:center;align-items:center;pointer-events:none}.dialog{position:relative;padding:0 30px 30px;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px;max-height:calc(100vh - 48px);overflow:auto;pointer-events:auto}.dialog-title{position:relative;border-bottom:1px solid #e2e6ed;margin-bottom:30px;height:60px;display:flex;align-items:center;justify-content:space-between}.dialog-title i{width:16px;height:16px;cursor:pointer;display:inline-block;background:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.9%208.192l4.242%204.243-.707.707L8.192%208.9%203.95%2013.142l-.707-.707%204.242-4.243L3.243%203.95l.707-.707%204.242%204.242%204.243-4.242.707.707L8.9%208.192z'%20fill='%236A6A6A'%20fill-rule='evenodd'/%3e%3c/svg%3e")}.dialog-option__item{margin-bottom:18px;display:flex;align-items:center;justify-content:space-between}.dialog-option__item span{margin-right:12px;font-size:14px;color:#3d4757;position:relative}.dialog-option__item input,.dialog-option__item textarea,.dialog-option__item select{width:276px;height:30px;border-radius:2px;border:1px solid #d3d3d3;min-height:30px;padding:5px;box-sizing:border-box;outline:none;appearance:none;-webkit-user-select:none;user-select:none;font-family:inherit}.dialog-option__item input:focus,.dialog-option__item textarea:focus{border-color:#4991f2}.dialog-option__item--require:before{content:"*";color:#f56c6c;margin-right:4px;position:absolute;left:-8px}.dialog-menu{display:flex;align-items:center;justify-content:flex-end}.dialog-menu button{position:relative;display:inline-block;border:1px solid #e2e6ed;border-radius:2px;background:#fff;line-height:22px;padding:0 16px;white-space:nowrap;cursor:pointer}.dialog-menu button:hover{background:#1937580a}.dialog-menu__cancel{margin-right:16px}.dialog-menu button[type=submit]{color:#fff;background:#4991f2;border-color:#4991f2}.dialog-menu button[type=submit]:hover{background:#5b9cf3;border-color:#5b9cf3}.dialog-radio-group{display:flex;flex-direction:column;gap:8px}.dialog-radio-group--horizontal{flex-direction:row;gap:16px}.dialog-radio-item{display:flex;align-items:center;cursor:pointer;font-size:14px;color:#3d4757}.dialog-radio-item input[type=radio]{width:16px;height:16px;margin:0 6px 0 0;cursor:pointer;appearance:auto}.dialog-radio-item span{margin:0}`)),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- (function(s,Cn){typeof exports=="object"&&typeof module<"u"?Cn(exports):typeof define=="function"&&define.amd?define(["exports"],Cn):(s=typeof globalThis<"u"?globalThis:s||self,Cn(s["canvas-editor"]={}))})(this,(function(s){"use strict";const Cn="0.7.60";s.MaxHeightRatio=void 0,(function(o){o.HALF="half",o.ONE_THIRD="one-third",o.QUARTER="quarter"})(s.MaxHeightRatio||(s.MaxHeightRatio={})),s.NumberType=void 0,(function(o){o.ARABIC="arabic",o.CHINESE="chinese"})(s.NumberType||(s.NumberType={})),s.ImageDisplay=void 0,(function(o){o.INLINE="inline",o.BLOCK="block",o.SURROUND="surround",o.FLOAT_TOP="float-top",o.FLOAT_BOTTOM="float-bottom"})(s.ImageDisplay||(s.ImageDisplay={})),s.LocationPosition=void 0,(function(o){o.BEFORE="before",o.AFTER="after",o.OUTER_BEFORE="outer-before",o.OUTER_AFTER="outer-after"})(s.LocationPosition||(s.LocationPosition={})),s.FlexDirection=void 0,(function(o){o.ROW="row",o.COLUMN="column"})(s.FlexDirection||(s.FlexDirection={}));const _="​",Zs=`
3
- `,gi=" ",Qs="&nbsp;",da=["·","、",":",":",",",",",".","。",";",";","?","?","!","!"],Ks={[s.MaxHeightRatio.HALF]:1/2,[s.MaxHeightRatio.ONE_THIRD]:1/3,[s.MaxHeightRatio.QUARTER]:1/4},Ti={ENGLISH:"A-Za-z",NUMBER:"0-9.$¥",SPANISH:"A-Za-zÁÉÍÓÚáéíóúÑñÜü",FRENCH:"A-Za-zÀÂÇàâçÉéÈèÊêËëÎîÏïÔôÙùÛûŸÿ",GERMAN:"A-Za-zÄäÖöÜüß",RUSSIAN:"А-Яа-яЁё",PORTUGUESE:"A-Za-zÁÉÍÓÚáéíóúÃÕãõÇç",ITALIAN:"A-Za-zÀàÈèÉéÌìÍíÎîÓóÒòÙù",DUTCH:"A-Za-zÀàÁáÂâÄäÈèÉéÊêËëÌìÍíÎîÏïÓóÒòÔôÖöÙùÛûÜü",SWEDISH:"A-Za-zÅåÄäÖö",GREEK:"ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩω"},ua="中";s.RowFlex=void 0,(function(o){o.LEFT="left",o.CENTER="center",o.RIGHT="right",o.ALIGNMENT="alignment",o.JUSTIFY="justify"})(s.RowFlex||(s.RowFlex={}));const fi=/[0-9.]/,ha=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,Ra=/[#*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\u26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\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\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,ga=new RegExp(`${Ra.source}|${ha.source}`,"g"),Ta=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,mi=new RegExp(`^[${_}
4
- ]`),fa=/\s/;function ma(o,t){let e;return function(...n){e&&window.clearTimeout(e),e=window.setTimeout(()=>{o.apply(this,n)},t)}}function Ca(o,t){let e=0,n;return function(...i){const l=Date.now();l-e>=t?(window.clearTimeout(n),o.apply(this,i),e=l):(window.clearTimeout(n),n=window.setTimeout(()=>{o.apply(this,i),e=l},t))}}function Ci(o,t){if(!o||typeof o!="object")return o;let e={};return Array.isArray(o)?e=o.map(n=>Ci(n,t)):Object.keys(o).forEach(n=>{t.includes(n)||(e[n]=Ci(o[n],t))}),e}function rt(o){if(typeof structuredClone=="function")return structuredClone(o);if(!o||typeof o!="object")return o;let t={};return Array.isArray(o)?t=o.map(e=>rt(e)):Object.keys(o).forEach(e=>{t[e]=rt(o[e])}),t}function pi(o){return o&&o.nodeType===1&&o.tagName.toLowerCase()==="body"}function Hs(o,t,e){if(o&&!pi(o))for(o=o;o;){if(!t||t(o)||pi(o))return t&&!t(o)&&pi(o)?null:o;o=o.parentNode}return null}function ft(){function o(){return((1+Math.random())*65536|0).toString(16).substring(1)}return o()+o()+"-"+o()+"-"+o()+"-"+o()+"-"+o()+o()+o()}function Nt(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(ga))e.set(i.index,i[0]);let n=0;for(;n<o.length;){const i=e.get(n);i?(t.push(i),n+=i.length):(t.push(o[n]),n++)}}return t}function As(o,t){const e=document.createElement("a");e.href=o,e.download=t,e.click()}function pa(o,t){Ia(3,o,t)}function Ia(o,t,e){let n=0,i=0,l=null,r=null;const a=function(c){const d=new Date().getTime(),u=l!==null&&r!==null&&Math.abs(c.clientX-l)<=5&&Math.abs(c.clientY-r)<=5;n=d-i<300&&u?n+1:0,i=d,l=c.clientX,r=c.clientY,n>=o-1&&(e(c),n=0)};t.addEventListener("click",a)}function Oo(o){return Object.prototype.toString.call(o)==="[object Object]"}function Ii(o){return Array.isArray(o)}function Ei(o){return Object.prototype.toString.call(o)==="[object Number]"}function Ea(o){return Object.prototype.toString.call(o)==="[object String]"}function _s(o,t){if(Oo(o)&&Oo(t)){const e=t;for(const[n,i]of Object.entries(o))e[n]?e[n]=_s(i,e[n]):e[n]=i}else Ii(o)&&Ii(t)&&t.push(...o);return t}function Li(o){if(typeof queueMicrotask=="function"){queueMicrotask(()=>{o()});return}if(typeof Promise<"u"){Promise.resolve().then(()=>{o()});return}setTimeout(()=>{o()},0)}function La(o){const t=["零","一","二","三","四","五","六","七","八","九"],e=["","十","百","千","万","十","百","千","亿","十","百","千","万","十","百","千","亿"];if(!o||isNaN(o))return"零";const n=o.toString().split("");let i="";for(let l=0;l<n.length;l++){const r=n.length-1-l;i=`${e[l]}${i}`,i=`${t[Number(n[r])]}${i}`}return i=i.replace(/零(千|百|十)/g,"零").replace(/十零/g,"十"),i=i.replace(/零+/g,"零"),i=i.replace(/零亿/g,"亿").replace(/零万/g,"万"),i=i.replace(/亿万/g,"亿"),i=i.replace(/零+$/,""),i=i.replace(/^一十/g,"十"),i}function dn(o,t,e){for(let n=0;n<o.length;n++){const i=o[n],l=t[i];l!==void 0?e[i]=l:delete e[i]}}function Bs(o,t){if(!(!t.length||!o.length))for(let e=o.length-1;e>=0;e--)t.includes(o[e])&&o.splice(e,1)}function xt(o,t){const e={};for(const n in o)t.includes(n)&&(e[n]=o[n]);return e}function Ee(o,t){const e={};for(const n in o)t.includes(n)||(e[n]=o[n]);return e}function Pa(o){const e=new TextEncoder().encode(o),n=Array.from(e,l=>String.fromCharCode(l));return window.btoa(n.join(""))}function Ma(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 ks(o,t){return o.length!==t.length?!1:!o.some(e=>!t.includes(e))}function Oa(o,t){if(!Oo(o)||!Oo(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 Sa(o,t){const e=o.x,n=o.x+o.width,i=o.y,l=o.y+o.height,r=t.x,a=t.x+t.width,c=t.y,d=t.y+t.height;return!(e>a||n<r||i>d||l<c)}function Gs(o){return o==null}function So(o){return o.replace(/\r\n|\r/g,`
5
- `)}function xs(o,t,e=0){const n=Math.max(0,Math.floor(e));if(n>=o.length)return typeof t=="string"&&t===""?{index:o.length,length:0}:{index:-1,length:0};if(typeof t=="string"){if(t==="")return{index:n,length:0};const c=o.indexOf(t,n);return c===-1?{index:-1,length:0}:{index:c,length:t.length}}const i=t.flags,l=i.includes("g")?i:i+"g",r=new RegExp(t.source,l);r.lastIndex=n;const a=r.exec(o);return a?{index:a.index,length:a[0].length}:{index:-1,length:0}}function Pi(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((c,d)=>c+d.offsetTop,0),l=i+t.offsetHeight,r=o.scrollTop,a=r+o.clientHeight;i<r?o.scrollTop=i:l>a&&(o.scrollTop=l-o.clientHeight)}function re(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function Da(o,t){return o.performance.enabled&&t>=o.performance.threshold}function Mi(o,t,e,n=[],i){if(!Da(o,e))return;const l={duration:Number(e.toFixed(2)),breakdown:n.map(r=>({label:r.label,duration:Number(r.duration.toFixed(2))})),...i};console.log(`[canvas-editor perf] ${t}`,l)}const Js=12,Fa={width:1,color:"#000000",dragWidth:2,dragColor:"#0000FF",dragFloatImageDisabled:!1},ve="editor-component",st="ce",so=`${st}-clipboard`,Do={print:{imagePreviewerDisabled:!1,backgroundDisabled:!1},compare:{imagePreviewerDisabled:!1,backgroundDisabled:!1},readonly:{imagePreviewerDisabled:!1},form:{controlDeletableDisabled:!1,inputTraceEnabled:!0,deleteTraceEnabled:!0}};var zt;(function(o){o.UP="top",o.DOWN="down",o.LEFT="left",o.RIGHT="right"})(zt||(zt={}));const pn=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),Xa=typeof navigator<"u"&&/iPad|iPhone/.test(navigator.userAgent),ya=/Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Na=typeof navigator<"u"&&/Firefox/.test(navigator.userAgent);s.ElementType=void 0,(function(o){o.TEXT="text",o.TEXTFIELD="TextField",o.BUTTON="button",o.IMAGE="image",o.TABLE="table",o.HYPERLINK="hyperlink",o.SUPERSCRIPT="superscript",o.SUBSCRIPT="subscript",o.SEPARATOR="separator",o.PAGE_BREAK="pageBreak",o.CONTROL="control",o.AREA="area",o.CHECKBOX="checkbox",o.RADIO="radio",o.LATEX="latex",o.TAB="tab",o.DATE="date",o.BLOCK="block",o.TITLE="title",o.LIST="list",o.SPLIT_TAG="splitTag",o.LABEL="label",o.MENSTRUAL_HISTORY="menstrualHistory",o.FETAL_HEART_POSITION="fetalHeartPosition",o.TOOTH_POSITION="toothPosition",o.SPECIAL_SYMBOLS="specialSymbols",o.MACRO="macro",o.CUSTOM_MACRO="customMacro",o.REUSABLE_ITEM="reusableItem",o.SUB_TEMPLATE="subTemplate"})(s.ElementType||(s.ElementType={}));const Ne=["bold","color","highlight","font","size","italic","underline","strikeout","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],ce=["rowFlex","vertical","rowMargin"],ba=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","vertical","url","areaId","hyperlinkId","dateId","dateFormat","groupIds","templateId","subTemplateContent","subTemplateRelation","subTemplateConditions","rowMargin","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],Va=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","vertical","rowMargin","dashArray","trList","tdPadding","tableEditable","tableToolDisabled","borderType","borderColor","borderWidth","borderExternalWidth","translateX","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","imgPreviewDisabled","imgCrop","imgCaption","textDecoration","extension","externalId","areaId","area","hide","label","labelId","lineWidth","deletePerson","newElEditPerson","deleteTime","newElEditTime","dictCode","macroConfig","menstrualData","menstrualHistoryId","fetalHeartData","fetalHeartPositionId","toothPositionData","toothPositionId","reusableItemConfig","templateId","subTemplateContent","subTemplateRelation","subTemplateConditions","subTemplateExpanded"],Wa=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],In=["tdId","trId","tableId"],Oi=["level","titleId","title"],Wn=["listId","listType","listStyle"],Si=["control","controlId","controlComponent"],ue=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"],un=["areaId","area"],Di=[...In,...Oi,...Wn,...un],Le=[s.ElementType.TEXT,s.ElementType.HYPERLINK,s.ElementType.SUBSCRIPT,s.ElementType.SUPERSCRIPT,s.ElementType.CONTROL,s.ElementType.DATE],Ua=[s.ElementType.IMAGE,s.ElementType.LATEX],Ya=[s.ElementType.BLOCK,s.ElementType.PAGE_BREAK,s.ElementType.SEPARATOR,s.ElementType.TABLE],wa=["HR","TABLE","UL","OL"],va=[s.ElementType.TITLE,s.ElementType.LIST];class Un{static sandbox=["allow-scripts","allow-same-origin"];static allow=["fullscreen"];element;constructor(t){this.element=t}_defineIframeProperties(t){Object.defineProperties(t,{parent:{get:()=>null},__POWERED_BY_CANVAS_EDITOR__:{get:()=>!0}})}render(t){const{iframeBlock:e}=this.element.block||{},n=document.createElement("iframe");n.setAttribute("data-id",this.element.id),n.sandbox.add(...e?.sandbox||Un.sandbox),n.setAttribute("allow",[e?.allow||Un.allow].join(" ")),n.style.border="none",n.style.width="100%",n.style.height="100%",e?.src?n.src=e.src:e?.srcdoc&&(n.srcdoc=e.srcdoc),t.append(n),this._defineIframeProperties(n.contentWindow)}}class $s{draw;options;imageCache;container;floatImageContainer;floatImage;constructor(t){this.draw=t,this.options=t.getOptions(),this.container=t.getContainer(),this.imageCache=new Map,this.floatImageContainer=null,this.floatImage=null}getOriginalMainImageList(){const t=[],e=n=>{for(const i of n)if(i.type===s.ElementType.TABLE){const l=i.trList;for(let r=0;r<l.length;r++){const a=l[r];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c];e(d.value)}}}else i.type===s.ElementType.IMAGE&&t.push(i)};return e(this.draw.getOriginalMainElementList()),t}_countImagesBeforeTarget(t,e){let n=0;for(const i of t){if(i===e)break;if(i.type===s.ElementType.TABLE){const l=i.trList;for(const r of l)for(const a of r.tdList)n+=this._countImagesBeforeTarget(a.value,e)}else i.type===s.ElementType.IMAGE&&n++}return n}createFloatImage(t){const{scale:e}=this.options;let n=this.floatImageContainer,i=this.floatImage;n||(n=document.createElement("div"),n.classList.add(`${st}-float-image`),this.container.append(n),this.floatImageContainer=n),i||(i=document.createElement("img"),n.append(i),this.floatImage=i),n.style.display="none",i.style.width=`${t.width*e}px`,i.style.height=`${t.height*e}px`;const l=this.draw.getHeight(),r=this.draw.getPageGap(),a=this.draw.getPageNo()*(l+r),c=t.imgFloatPosition;n.style.left=`${c.x*e}px`,n.style.top=`${a+c.y*e}px`,i.src=t.value}dragFloatImage(t,e){if(!this.floatImageContainer)return;this.floatImageContainer.style.display="block";const n=parseFloat(this.floatImageContainer.style.left)+t,i=parseFloat(this.floatImageContainer.style.top)+e;this.floatImageContainer.style.left=`${n}px`,this.floatImageContainer.style.top=`${i}px`}destroyFloatImage(){this.floatImageContainer&&(this.floatImageContainer.style.display="none")}addImageObserver(t){this.draw.getImageObserver().add(t)}getFallbackImage(t,e){const i=(t-Math.ceil(t/8)*8)/2,l=(e-Math.ceil(e/8)*8)/2,r=`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${e}" viewBox="0 0 ${t} ${e}">
2
+ (function(s,Cn){typeof exports=="object"&&typeof module<"u"?Cn(exports):typeof define=="function"&&define.amd?define(["exports"],Cn):(s=typeof globalThis<"u"?globalThis:s||self,Cn(s["canvas-editor"]={}))})(this,(function(s){"use strict";const Cn="0.7.61";s.MaxHeightRatio=void 0,(function(o){o.HALF="half",o.ONE_THIRD="one-third",o.QUARTER="quarter"})(s.MaxHeightRatio||(s.MaxHeightRatio={})),s.NumberType=void 0,(function(o){o.ARABIC="arabic",o.CHINESE="chinese"})(s.NumberType||(s.NumberType={})),s.ImageDisplay=void 0,(function(o){o.INLINE="inline",o.BLOCK="block",o.SURROUND="surround",o.FLOAT_TOP="float-top",o.FLOAT_BOTTOM="float-bottom"})(s.ImageDisplay||(s.ImageDisplay={})),s.LocationPosition=void 0,(function(o){o.BEFORE="before",o.AFTER="after",o.OUTER_BEFORE="outer-before",o.OUTER_AFTER="outer-after"})(s.LocationPosition||(s.LocationPosition={})),s.FlexDirection=void 0,(function(o){o.ROW="row",o.COLUMN="column"})(s.FlexDirection||(s.FlexDirection={}));const _="​",Zs=`
3
+ `,Ti=" ",Qs="&nbsp;",da=["·","、",":",":",",",",",".","。",";",";","?","?","!","!"],Ks={[s.MaxHeightRatio.HALF]:1/2,[s.MaxHeightRatio.ONE_THIRD]:1/3,[s.MaxHeightRatio.QUARTER]:1/4},fi={ENGLISH:"A-Za-z",NUMBER:"0-9.$¥",SPANISH:"A-Za-zÁÉÍÓÚáéíóúÑñÜü",FRENCH:"A-Za-zÀÂÇàâçÉéÈèÊêËëÎîÏïÔôÙùÛûŸÿ",GERMAN:"A-Za-zÄäÖöÜüß",RUSSIAN:"А-Яа-яЁё",PORTUGUESE:"A-Za-zÁÉÍÓÚáéíóúÃÕãõÇç",ITALIAN:"A-Za-zÀàÈèÉéÌìÍíÎîÓóÒòÙù",DUTCH:"A-Za-zÀàÁáÂâÄäÈèÉéÊêËëÌìÍíÎîÏïÓóÒòÔôÖöÙùÛûÜü",SWEDISH:"A-Za-zÅåÄäÖö",GREEK:"ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩω"},ua="中";s.RowFlex=void 0,(function(o){o.LEFT="left",o.CENTER="center",o.RIGHT="right",o.ALIGNMENT="alignment",o.JUSTIFY="justify"})(s.RowFlex||(s.RowFlex={}));const mi=/[0-9.]/,ha=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,Ra=/[#*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\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\u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DDDE\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,ga=new RegExp(`${Ra.source}|${ha.source}`,"g"),Ta=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,Ci=new RegExp(`^[${_}
4
+ ]`),fa=/\s/;function ma(o,t){let e;return function(...n){e&&window.clearTimeout(e),e=window.setTimeout(()=>{o.apply(this,n)},t)}}function Ca(o,t){let e=0,n;return function(...i){const l=Date.now();l-e>=t?(window.clearTimeout(n),o.apply(this,i),e=l):(window.clearTimeout(n),n=window.setTimeout(()=>{o.apply(this,i),e=l},t))}}function pi(o,t){if(!o||typeof o!="object")return o;let e={};return Array.isArray(o)?e=o.map(n=>pi(n,t)):Object.keys(o).forEach(n=>{t.includes(n)||(e[n]=pi(o[n],t))}),e}function rt(o){if(typeof structuredClone=="function")return structuredClone(o);if(!o||typeof o!="object")return o;let t={};return Array.isArray(o)?t=o.map(e=>rt(e)):Object.keys(o).forEach(e=>{t[e]=rt(o[e])}),t}function Ii(o){return o&&o.nodeType===1&&o.tagName.toLowerCase()==="body"}function Hs(o,t,e){if(o&&!Ii(o))for(o=o;o;){if(!t||t(o)||Ii(o))return t&&!t(o)&&Ii(o)?null:o;o=o.parentNode}return null}function ft(){function o(){return((1+Math.random())*65536|0).toString(16).substring(1)}return o()+o()+"-"+o()+"-"+o()+"-"+o()+"-"+o()+o()+o()}function Nt(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(ga))e.set(i.index,i[0]);let n=0;for(;n<o.length;){const i=e.get(n);i?(t.push(i),n+=i.length):(t.push(o[n]),n++)}}return t}function As(o,t){const e=document.createElement("a");e.href=o,e.download=t,e.click()}function pa(o,t){Ia(3,o,t)}function Ia(o,t,e){let n=0,i=0,l=null,r=null;const a=function(c){const d=new Date().getTime(),u=l!==null&&r!==null&&Math.abs(c.clientX-l)<=5&&Math.abs(c.clientY-r)<=5;n=d-i<300&&u?n+1:0,i=d,l=c.clientX,r=c.clientY,n>=o-1&&(e(c),n=0)};t.addEventListener("click",a)}function Oo(o){return Object.prototype.toString.call(o)==="[object Object]"}function Ei(o){return Array.isArray(o)}function Li(o){return Object.prototype.toString.call(o)==="[object Number]"}function Ea(o){return Object.prototype.toString.call(o)==="[object String]"}function _s(o,t){if(Oo(o)&&Oo(t)){const e=t;for(const[n,i]of Object.entries(o))e[n]?e[n]=_s(i,e[n]):e[n]=i}else Ei(o)&&Ei(t)&&t.push(...o);return t}function Pi(o){if(typeof queueMicrotask=="function"){queueMicrotask(()=>{o()});return}if(typeof Promise<"u"){Promise.resolve().then(()=>{o()});return}setTimeout(()=>{o()},0)}function La(o){const t=["零","一","二","三","四","五","六","七","八","九"],e=["","十","百","千","万","十","百","千","亿","十","百","千","万","十","百","千","亿"];if(!o||isNaN(o))return"零";const n=o.toString().split("");let i="";for(let l=0;l<n.length;l++){const r=n.length-1-l;i=`${e[l]}${i}`,i=`${t[Number(n[r])]}${i}`}return i=i.replace(/零(千|百|十)/g,"零").replace(/十零/g,"十"),i=i.replace(/零+/g,"零"),i=i.replace(/零亿/g,"亿").replace(/零万/g,"万"),i=i.replace(/亿万/g,"亿"),i=i.replace(/零+$/,""),i=i.replace(/^一十/g,"十"),i}function dn(o,t,e){for(let n=0;n<o.length;n++){const i=o[n],l=t[i];l!==void 0?e[i]=l:delete e[i]}}function Bs(o,t){if(!(!t.length||!o.length))for(let e=o.length-1;e>=0;e--)t.includes(o[e])&&o.splice(e,1)}function xt(o,t){const e={};for(const n in o)t.includes(n)&&(e[n]=o[n]);return e}function Ee(o,t){const e={};for(const n in o)t.includes(n)||(e[n]=o[n]);return e}function Pa(o){const e=new TextEncoder().encode(o),n=Array.from(e,l=>String.fromCharCode(l));return window.btoa(n.join(""))}function Ma(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 ks(o,t){return o.length!==t.length?!1:!o.some(e=>!t.includes(e))}function Oa(o,t){if(!Oo(o)||!Oo(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 Sa(o,t){const e=o.x,n=o.x+o.width,i=o.y,l=o.y+o.height,r=t.x,a=t.x+t.width,c=t.y,d=t.y+t.height;return!(e>a||n<r||i>d||l<c)}function Gs(o){return o==null}function So(o){return o.replace(/\r\n|\r/g,`
5
+ `)}function xs(o,t,e=0){const n=Math.max(0,Math.floor(e));if(n>=o.length)return typeof t=="string"&&t===""?{index:o.length,length:0}:{index:-1,length:0};if(typeof t=="string"){if(t==="")return{index:n,length:0};const c=o.indexOf(t,n);return c===-1?{index:-1,length:0}:{index:c,length:t.length}}const i=t.flags,l=i.includes("g")?i:i+"g",r=new RegExp(t.source,l);r.lastIndex=n;const a=r.exec(o);return a?{index:a.index,length:a[0].length}:{index:-1,length:0}}function Mi(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((c,d)=>c+d.offsetTop,0),l=i+t.offsetHeight,r=o.scrollTop,a=r+o.clientHeight;i<r?o.scrollTop=i:l>a&&(o.scrollTop=l-o.clientHeight)}function re(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}function Da(o,t){return o.performance.enabled&&t>=o.performance.threshold}function Oi(o,t,e,n=[],i){if(!Da(o,e))return;const l={duration:Number(e.toFixed(2)),breakdown:n.map(r=>({label:r.label,duration:Number(r.duration.toFixed(2))})),...i};console.log(`[canvas-editor perf] ${t}`,l)}const Js=12,Fa={width:1,color:"#000000",dragWidth:2,dragColor:"#0000FF",dragFloatImageDisabled:!1},ve="editor-component",st="ce",so=`${st}-clipboard`,Do={print:{imagePreviewerDisabled:!1,backgroundDisabled:!1},compare:{imagePreviewerDisabled:!1,backgroundDisabled:!1},readonly:{imagePreviewerDisabled:!1},form:{controlDeletableDisabled:!1,inputTraceEnabled:!0,deleteTraceEnabled:!0}};var zt;(function(o){o.UP="top",o.DOWN="down",o.LEFT="left",o.RIGHT="right"})(zt||(zt={}));const pn=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),Xa=typeof navigator<"u"&&/iPad|iPhone/.test(navigator.userAgent),ya=/Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Na=typeof navigator<"u"&&/Firefox/.test(navigator.userAgent);s.ElementType=void 0,(function(o){o.TEXT="text",o.TEXTFIELD="TextField",o.BUTTON="button",o.IMAGE="image",o.TABLE="table",o.HYPERLINK="hyperlink",o.SUPERSCRIPT="superscript",o.SUBSCRIPT="subscript",o.SEPARATOR="separator",o.PAGE_BREAK="pageBreak",o.CONTROL="control",o.AREA="area",o.CHECKBOX="checkbox",o.RADIO="radio",o.LATEX="latex",o.TAB="tab",o.DATE="date",o.BLOCK="block",o.TITLE="title",o.LIST="list",o.SPLIT_TAG="splitTag",o.LABEL="label",o.MENSTRUAL_HISTORY="menstrualHistory",o.FETAL_HEART_POSITION="fetalHeartPosition",o.TOOTH_POSITION="toothPosition",o.SPECIAL_SYMBOLS="specialSymbols",o.MACRO="macro",o.CUSTOM_MACRO="customMacro",o.REUSABLE_ITEM="reusableItem",o.SUB_TEMPLATE="subTemplate"})(s.ElementType||(s.ElementType={}));const Ne=["bold","color","highlight","font","size","italic","underline","strikeout","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],ce=["rowFlex","vertical","rowMargin"],ba=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","vertical","url","areaId","hyperlinkId","dateId","dateFormat","groupIds","templateId","subTemplateContent","subTemplateRelation","subTemplateConditions","rowMargin","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],Va=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","vertical","rowMargin","dashArray","trList","tdPadding","tableEditable","tableToolDisabled","borderType","borderColor","borderWidth","borderExternalWidth","translateX","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","imgPreviewDisabled","imgCrop","imgCaption","textDecoration","extension","externalId","areaId","area","hide","label","labelId","lineWidth","deletePerson","newElEditPerson","deleteTime","newElEditTime","dictCode","macroConfig","menstrualData","menstrualHistoryId","fetalHeartData","fetalHeartPositionId","toothPositionData","toothPositionId","reusableItemConfig","templateId","subTemplateContent","subTemplateRelation","subTemplateConditions","subTemplateExpanded"],Wa=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],In=["tdId","trId","tableId"],Si=["level","titleId","title"],Un=["listId","listType","listStyle"],Di=["control","controlId","controlComponent"],ue=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"],un=["areaId","area"],Fi=[...In,...Si,...Un,...un],Le=[s.ElementType.TEXT,s.ElementType.HYPERLINK,s.ElementType.SUBSCRIPT,s.ElementType.SUPERSCRIPT,s.ElementType.CONTROL,s.ElementType.DATE],Ua=[s.ElementType.IMAGE,s.ElementType.LATEX],Ya=[s.ElementType.BLOCK,s.ElementType.PAGE_BREAK,s.ElementType.SEPARATOR,s.ElementType.TABLE],wa=["HR","TABLE","UL","OL"],va=[s.ElementType.TITLE,s.ElementType.LIST];class Yn{static sandbox=["allow-scripts","allow-same-origin"];static allow=["fullscreen"];element;constructor(t){this.element=t}_defineIframeProperties(t){Object.defineProperties(t,{parent:{get:()=>null},__POWERED_BY_CANVAS_EDITOR__:{get:()=>!0}})}render(t){const{iframeBlock:e}=this.element.block||{},n=document.createElement("iframe");n.setAttribute("data-id",this.element.id),n.sandbox.add(...e?.sandbox||Yn.sandbox),n.setAttribute("allow",[e?.allow||Yn.allow].join(" ")),n.style.border="none",n.style.width="100%",n.style.height="100%",e?.src?n.src=e.src:e?.srcdoc&&(n.srcdoc=e.srcdoc),t.append(n),this._defineIframeProperties(n.contentWindow)}}class $s{draw;options;imageCache;container;floatImageContainer;floatImage;constructor(t){this.draw=t,this.options=t.getOptions(),this.container=t.getContainer(),this.imageCache=new Map,this.floatImageContainer=null,this.floatImage=null}getOriginalMainImageList(){const t=[],e=n=>{for(const i of n)if(i.type===s.ElementType.TABLE){const l=i.trList;for(let r=0;r<l.length;r++){const a=l[r];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c];e(d.value)}}}else i.type===s.ElementType.IMAGE&&t.push(i)};return e(this.draw.getOriginalMainElementList()),t}_countImagesBeforeTarget(t,e){let n=0;for(const i of t){if(i===e)break;if(i.type===s.ElementType.TABLE){const l=i.trList;for(const r of l)for(const a of r.tdList)n+=this._countImagesBeforeTarget(a.value,e)}else i.type===s.ElementType.IMAGE&&n++}return n}createFloatImage(t){const{scale:e}=this.options;let n=this.floatImageContainer,i=this.floatImage;n||(n=document.createElement("div"),n.classList.add(`${st}-float-image`),this.container.append(n),this.floatImageContainer=n),i||(i=document.createElement("img"),n.append(i),this.floatImage=i),n.style.display="none",i.style.width=`${t.width*e}px`,i.style.height=`${t.height*e}px`;const l=this.draw.getHeight(),r=this.draw.getPageGap(),a=this.draw.getPageNo()*(l+r),c=t.imgFloatPosition;n.style.left=`${c.x*e}px`,n.style.top=`${a+c.y*e}px`,i.src=t.value}dragFloatImage(t,e){if(!this.floatImageContainer)return;this.floatImageContainer.style.display="block";const n=parseFloat(this.floatImageContainer.style.left)+t,i=parseFloat(this.floatImageContainer.style.top)+e;this.floatImageContainer.style.left=`${n}px`,this.floatImageContainer.style.top=`${i}px`}destroyFloatImage(){this.floatImageContainer&&(this.floatImageContainer.style.display="none")}addImageObserver(t){this.draw.getImageObserver().add(t)}getFallbackImage(t,e){const i=(t-Math.ceil(t/8)*8)/2,l=(e-Math.ceil(e/8)*8)/2,r=`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${e}" viewBox="0 0 ${t} ${e}">
6
6
  <rect width="${t}" height="${e}" fill="url(#mosaic)" />
7
7
  <defs>
8
8
  <pattern id="mosaic" x="${i}" y="${l}" width="16" height="16" patternUnits="userSpaceOnUse">
@@ -10,7 +10,7 @@
10
10
  <rect width="8" height="8" fill="#cccccc" transform="translate(8, 8)" />
11
11
  </pattern>
12
12
  </defs>
13
- </svg>`,a=new Image;return a.src=`data:image/svg+xml;base64,${Pa(r)}`,a}_drawImageWithCrop(t,e,n,i,l,r,a){if(n.imgCrop){const{x:c,y:d,width:u,height:h}=n.imgCrop;t.drawImage(e,c,d,u,h,i,l,r,a)}else t.drawImage(e,i,l,r,a)}_renderCaption(t,e,n,i,l,r){if(!e.imgCaption?.value)return;const{scale:a,imgCaption:c}=this.options;let d=e.imgCaption.value;if(d.includes("{imageNo}")){const I=this.draw.getOriginalMainElementList(),m=this._countImagesBeforeTarget(I,e)+1;d=d.replace(/\{imageNo\}/g,String(m))}const u=(e.imgCaption.size||c.size)*a,h=e.imgCaption.font||c.font,R=e.imgCaption.color||c.color;t.save(),t.font=`${u}px ${h}`,t.fillStyle=R,t.textAlign="center";let T=d;const g=t.measureText(d);if(g.width>l){let I=0,m=d.length;for(;I<m;){const L=Math.ceil((I+m)/2),O=d.substring(0,L);t.measureText(O+"...").width<=l?I=L:m=L-1}T=d.substring(0,I)+"..."}const f=(e.imgCaption.top??c.top)*a,C=i+r+f+g.actualBoundingBoxAscent,p=n+l/2;t.fillText(T,p,C),t.restore()}render(t,e,n,i){const{scale:l}=this.options,r=e.width*l,a=e.height*l;if(this.imageCache.has(e.value)){const c=this.imageCache.get(e.value);this._drawImageWithCrop(t,c,e,n,i,r,a),this._renderCaption(t,e,n,i,r,a)}else{const c=this.draw.getRenderCount(),d=new Promise((u,h)=>{const R=new Image;R.setAttribute("crossOrigin","Anonymous"),R.src=e.value,R.onload=()=>{this.imageCache.set(e.value,R),u(e),c===this.draw.getRenderCount()&&(e.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM?this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}):(this._drawImageWithCrop(t,R,e,n,i,r,a),this._renderCaption(t,e,n,i,r,a)))},R.onerror=T=>{const g=this.getFallbackImage(r,a);g.onload=()=>{this._drawImageWithCrop(t,g,e,n,i,r,a),this.imageCache.set(e.value,g),this._renderCaption(t,e,n,i,r,a)},h(T)}});this.addImageObserver(d)}}}const Fo=82;function Yn(o){return Fi[o]==null&&Za(o),Fi[o]}function Za(o){const t=Qa[o];if(t==null)return;const e=t.substring(3,5),n=1*e.charCodeAt(0)-Fo,i=1*e.charCodeAt(1)-Fo,l=t.substring(5),r=[[]];let a=1/0,c=-1/0,d=1/0,u=-1/0,h=0;for(;h<l.length;){const R=l.substring(h,h+2);if(R==" R")r.push([]);else{const T=R.charCodeAt(0)-Fo-n,g=R.charCodeAt(1)-Fo;a=Math.min(g,a),c=Math.max(g,c),d=Math.min(T,d),u=Math.max(T,u),r[r.length-1].push([T,g])}h+=2}Fi[o]={w:i-n,xmin:d,xmax:u,ymin:a,ymax:c,polylines:r}}const Fi={},Qa={1:" 9MWRMNV RRMVV RPSTS",2:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",3:" 11MXVNTMRMPNOPOSPURVTVVU",4:" 12MWOMOV ROMRMTNUPUSTURVOV",5:" 12MWOMOV ROMUM ROQSQ ROVUV",6:" 9MVOMOV ROMUM ROQSQ",7:" 15MXVNTMRMPNOPOSPURVTVVUVR RSRVR",8:" 9MWOMOV RUMUV ROQUQ",9:" 3PTRMRV",10:" 7NUSMSTRVPVOTOS",11:" 9MWOMOV RUMOS RQQUV",12:" 6MVOMOV ROVUV",13:" 12LXNMNV RNMRV RVMRV RVMVV",14:" 9MWOMOV ROMUV RUMUV",15:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",16:" 10MWOMOV ROMSMUNUQSROR",17:" 17MXRMPNOPOSPURVSVUUVSVPUNSMRM RSTVW",18:" 13MWOMOV ROMSMUNUQSROR RRRUV",19:" 13MWUNSMQMONOOPPTRUSUUSVQVOU",20:" 6MWRMRV RNMVM",21:" 9MXOMOSPURVSVUUVSVM",22:" 6MWNMRV RVMRV",23:" 12LXNMPV RRMPV RRMTV RVMTV",24:" 6MWOMUV RUMOV",25:" 7MWNMRQRV RVMRQ",26:" 9MWUMOV ROMUM ROVUV",27:" 9MWRMNV RRMVV RPSTS",28:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",29:" 6MVOMOV ROMUM",30:" 9MWRMNV RRMVV RNVVV",31:" 12MWOMOV ROMUM ROQSQ ROVUV",32:" 9MWUMOV ROMUM ROVUV",33:" 9MWOMOV RUMUV ROQUQ",34:" 20MXRMPNOPOSPURVSVUUVSVPUNSMRM RQQTR RTQQR",35:" 3PTRMRV",36:" 9MWOMOV RUMOS RQQUV",37:" 6MWRMNV RRMVV",38:" 12LXNMNV RNMRV RVMRV RVMVV",39:" 9MWOMOV ROMUV RUMUV",40:" 12MWOMUM RPQTR RTQPR ROVUV",41:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",42:" 9MWOMOV RUMUV ROMUM",43:" 10MWOMOV ROMSMUNUQSROR",44:" 10MWOMRQOV ROMUM ROVUV",45:" 6MWRMRV RNMVM",46:" 15MWNONNOMPMQNRPRV RVOVNUMTMSNRP",47:" 13LXRMRV RPONPNSPTTTVSVPTOPO",48:" 6MWOMUV RUMOV",49:" 12LXRMRV RNOOPOSQTSTUSUPVO",50:" 13MXOVQVOROPPNRMSMUNVPVRTVVV",200:" 12MWRMPNOPOSPURVTUUSUPTNRM",201:" 4MWPORMRV",202:" 9MWONQMSMUNUPTROVUV",203:" 15MWONQMSMUNUPSQ RRQSQURUUSVQVOU",204:" 7MWSMSV RSMNSVS",205:" 14MWPMOQQPRPTQUSTURVQVOU RPMTM",206:" 14MWTMRMPNOPOSPURVTUUSTQRPPQOS",207:" 6MWUMQV ROMUM",208:" 19MWQMONOPQQSQUPUNSMQM RQQOROUQVSVUUURSQ",209:" 14MWUPTRRSPROPPNRMTNUPUSTURVPV",210:" 6PURURVSVSURU",211:" 7PUSVRVRUSUSWRY",212:" 12PURPRQSQSPRP RRURVSVSURU",213:" 13PURPRQSQSPRP RSVRVRUSUSWRY",214:" 12PURMRR RSMSR RRURVSVSURU",215:" 17NWPNRMSMUNUPRQRRSRSQUP RRURVSVSURU",216:" 3PTRMRQ",217:" 6NVPMPQ RTMTQ",218:" 10NVQMPNPPQQSQTPTNSMQM",219:" 16MWUNSMQMONOPQQTRUSUUSVQVOU RRLRW",220:" 3MWVLNW",221:" 7OVTLRNQPQSRUTW",222:" 7NUPLRNSPSSRUPW",223:" 3PTRLRW",224:" 3LXNRVR",225:" 6LXRNRV RNRVR",226:" 6LXNPVP RNTVT",227:" 6MWOOUU RUOOU",228:" 9MWRORU ROPUT RUPOT",229:" 6PURQRRSRSQRQ",230:" 7PUSMRORQSQSPRP",231:" 7PUSNRNRMSMSORQ",232:" 7LXSOVRSU RNRVR",233:" 12MXRLPW RULSW ROPVP ROSVS",234:" 21LXVRURTSSURVOVNUNSORRQSPSNRMPMONOPQSSUUVVV",235:" 20LXNNOQOSNV RVNUQUSVV RNNQOSOVN RNVQUSUVV",501:" 9I[RFJ[ RRFZ[ RMTWT",502:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",503:" 19H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZV",504:" 16G\\KFK[ RKFRFUGWIXKYNYSXVWXUZR[K[",505:" 12H[LFL[ RLFYF RLPTP RL[Y[",506:" 9HZLFL[ RLFYF RLPTP",507:" 23H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZVZS RUSZS",508:" 9G]KFK[ RYFY[ RKPYP",509:" 3NVRFR[",510:" 11JZVFVVUYTZR[P[NZMYLVLT",511:" 9G\\KFK[ RYFKT RPOY[",512:" 6HYLFL[ RL[X[",513:" 12F^JFJ[ RJFR[ RZFR[ RZFZ[",514:" 9G]KFK[ RKFY[ RYFY[",515:" 22G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF",516:" 14G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ",517:" 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RSWY]",518:" 17G\\KFK[ RKFTFWGXHYJYLXNWOTPKP RRPY[",519:" 21H\\YIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",520:" 6JZRFR[ RKFYF",521:" 11G]KFKULXNZQ[S[VZXXYUYF",522:" 6I[JFR[ RZFR[",523:" 12F^HFM[ RRFM[ RRFW[ R\\FW[",524:" 6H\\KFY[ RYFK[",525:" 7I[JFRPR[ RZFRP",526:" 9H\\YFK[ RKFYF RK[Y[",527:" 9I[RFJ[ RRFZ[ RMTWT",528:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",529:" 6HYLFL[ RLFXF",530:" 9I[RFJ[ RRFZ[ RJ[Z[",531:" 12H[LFL[ RLFYF RLPTP RL[Y[",532:" 9H\\YFK[ RKFYF RK[Y[",533:" 9G]KFK[ RYFY[ RKPYP",534:" 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF ROPUP",535:" 3NVRFR[",536:" 9G\\KFK[ RYFKT RPOY[",537:" 6I[RFJ[ RRFZ[",538:" 12F^JFJ[ RJFR[ RZFR[ RZFZ[",539:" 9G]KFK[ RKFY[ RYFY[",540:" 9I[KFYF ROPUP RK[Y[",541:" 22G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF",542:" 9G]KFK[ RYFY[ RKFYF",543:" 14G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ",544:" 10I[KFRPK[ RKFYF RK[Y[",545:" 6JZRFR[ RKFYF",546:" 19I[KKKILGMFOFPGQIRMR[ RYKYIXGWFUFTGSIRM",547:" 21H\\RFR[ RPKMLLMKOKRLTMUPVTVWUXTYRYOXMWLTKPK",548:" 6H\\KFY[ RK[YF",549:" 18G]RFR[ RILJLKMLQ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[T[VZXX",605:" 18I[LSXSXQWOVNTMQMONMPLSLUMXOZQ[T[VZXX",606:" 9MYWFUFSGRJR[ ROMVM",607:" 23I\\XMX]W`VaTbQbOa RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",608:" 11I\\MFM[ RMQPNRMUMWNXQX[",609:" 9NVQFRGSFREQF RRMR[",610:" 12MWRFSGTFSERF RSMS^RaPbNb",611:" 9IZMFM[ RWMMW RQSX[",612:" 3NVRFR[",613:" 19CaGMG[ RGQJNLMOMQNRQR[ RRQUNWMZM\\N]Q][",614:" 11I\\MMM[ RMQPNRMUMWNXQX[",615:" 18I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM",616:" 18H[LMLb RLPNNPMSMUNWPXSXUWXUZS[P[NZLX",617:" 18I\\XMXb RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",618:" 9KXOMO[ ROSPPRNTMWM",619:" 18J[XPWNTMQMNNMPNRPSUTWUXWXXWZT[Q[NZMX",620:" 9MYRFRWSZU[W[ ROMVM",621:" 11I\\MMMWNZP[S[UZXW RXMX[",622:" 6JZLMR[ RXMR[",623:" 12G]JMN[ RRMN[ RRMV[ RZMV[",624:" 6J[MMX[ RXMM[",625:" 10JZLMR[ RXMR[P_NaLbKb",626:" 9J[XMM[ RMMXM RM[X[",627:" 24H]QMONMPLRKUKXLZN[P[RZUWWTYPZM RQMSMTNUPWXXZY[Z[",628:" 31I\\UFSGQIOMNPMTLZKb RUFWFYHYKXMWNUORO RROTPVRWTWWVYUZS[Q[OZNYMV",629:" 17I\\JPLNNMOMQNROSRSVR[ RZMYPXRR[P_Ob",630:" 24I[TMQMONMPLSLVMYNZP[R[TZVXWUWRVOTMRKQIQGRFTFVGXI",631:" 19JZWOVNTMQMONOPPRSS RSSOTMVMXNZP[S[UZWX",632:" 23JYTFRGQHQIRJUKXK RXKTMQONRMUMWNYP[S]T_TaSbQbP`",633:" 19H\\IQJOLMNMONOPNTL[ RNTPPRNTMVMXOXRWWTb",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ZYY",683:" 26I[WUWRVOUNSMQMONMPLSLVMYNZP[R[TZVXWUXPXKWHVGTFRFPGNI",684:" 16JZWNUMRMPNNPMSMVNYOZQ[T[VZ RMTUT",685:" 23J[TFRGPJOLNOMTMXNZO[Q[SZUWVUWRXMXIWGVFTF RNPWP",686:" 21H\\VFNb RQMNNLPKSKVLXNZQ[S[VZXXYUYRXPVNSMQM",687:" 16I[XOWNTMQMNNMOLQLSMUOWSZT\\T^S_Q_",700:" 18H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF",701:" 5H\\NJPISFS[",702:" 15H\\LKLJMHNGPFTFVGWHXJXLWNUQK[Y[",703:" 16H\\MFXFRNUNWOXPYSYUXXVZS[P[MZLYKW",704:" 7H\\UFKTZT RUFU[",705:" 18H\\WFMFLOMNPMSMVNXPYSYUXXVZS[P[MZLYKW",706:" 24H\\XIWGTFRFOGMJLOLTMXOZR[S[VZXXYUYTXQVOSNRNOOMQLT",707:" 6H\\YFO[ RKFYF",708:" 30H\\PFMGLILKMMONSOVPXRYTYWXYWZT[P[MZLYKWKTLRNPQOUNWMXKXIWGTFPF",709:" 24H\\XMWPURRSQSNRLPKMKLLINGQFRFUGWIXMXRWWUZR[P[MZLX",710:" 6MWRYQZR[SZRY",711:" 9MWSZR[QZRYSZS\\R^Q_",712:" 12MWRMQNROSNRM RRYQZR[SZRY",713:" 15MWRMQNROSNRM RSZR[QZRYSZS\\R^Q_",714:" 9MWRFRT RRYQZR[SZRY",715:" 21I[LKLJMHNGPFTFVGWHXJXLWNVORQRT RRYQZR[SZRY",716:" 3NVRFRM",717:" 6JZNFNM RVFVM",718:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",719:" 27H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",720:" 3G][BIb",721:" 11KYVBTDRGPKOPOTPYR]T`Vb",722:" 11KYNBPDRGTKUPUTTYR]P`Nb",723:" 3NVRBRb",724:" 3E_IR[R",725:" 6E_RIR[ RIR[R",726:" 6E_IO[O RIU[U",727:" 6G]KKYY RYKKY",728:" 9JZRLRX RMOWU RWOMU",729:" 6MWRQQRRSSRRQ",730:" 8MWSFRGQIQKRLSKRJ",731:" 8MWRHQGRFSGSIRKQL",732:" 9E_UMXP[RXTUW RIR[R",733:" 12H]SBLb RYBRb RLOZO RKUYU",734:" 35E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y",735:" 28G]IIJKKOKUJYI[ R[IZKYOYUZY[[ RIIKJOKUKYJ[I RI[KZOYUYYZ[[",737:" 6KYOBO[ RUBU[",738:" 6F^RBR[ RI[[[",739:" 4F^[BI[[[",740:" 18E_RIQJRKSJRI RIYHZI[JZIY R[YZZ[[\\Z[Y",741:" 33F^RHNLKPJSJUKWMXOXQWRU RRHVLYPZSZUYWWXUXSWRU RRUQYP\\ RRUSYT\\ RP\\T\\",742:" 26F^RNQKPINHMHKIJKJOKRLTNWR\\ RRNSKTIVHWHYIZKZOYRXTVWR\\",743:" 20F^RGPJLOIR RRGTJXO[R RIRLUPZR] R[RXUTZR]",744:" 48F^RTTWVXXXZW[U[SZQXPVPSQ RSQUOVMVKUISHQHOINKNMOOQQ RQQNPLPJQISIUJWLXNXPWRT RRTQYP\\ RRTSYT\\ RP\\T\\",745:" 55F^RRR[Q\\ RRVQ\\ RRIQHOHNINKONRR RRISHUHVIVKUNRR RRRNOLNJNIOIQJR RRRVOXNZN[O[QZR RRRNULVJVIUISJR RRRVUXVZV[U[SZR",746:" 55F^ISJSLTMVMXLZ RISIRJQLQMRNTNWMYLZ RRGPIOLOOQUQXPZR\\ RRGTIULUOSUSXTZR\\ R[S[RZQXQWRVTVWWYXZ R[SZSXTWVWXXZ RKVYV",750:" 18PSSRRSQSPRPQQPRPSQSSRUQV RQQQRRRRQQQ",751:" 16PTQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",752:" 9NVPOTU RTOPU RNRVR",753:" 28MWRKQMOPMR RRKSMUPWR RRMOQ RRMUQ RROPQ RROTQ RQQSQ RMRWR",754:" 26MWMRMQNOONQMSMUNVOWQWR RPNTN ROOUO RNPVP RNQVQ RMRWR",755:" 14LRLFLRRRLF RLIPQ RLLOR RLOMQ",756:" 10MWRKQMOPMR RRKSMUPWR",757:" 11MWWRWQVOUNSMQMONNOMQMR",758:" 13G]]R]P\\MZJWHTGPGMHJJHMGPGR",759:" 11MWMRMSNUOVQWSWUVVUWSWR",760:" 7LXLPNRQSSSVRXP",761:" 6RURUTTURTPRO",762:" 7RVRRUPVNVLUKTK",763:" 7NRRROPNNNLOKPK",764:" 21MWWHVGTFQFOGNHMJMLNNOOUSVTWVWXVZU[S\\P\\N[MZ",765:" 21G]IWHVGTGQHOINKMMMONPOTUUVWWYW[V\\U]S]P\\N[M",766:" 31G]RRTUUVWWYW[V\\U]S]Q\\O[NYMWMUNTOPUOVMWKWIVHUGSGQHOINKMMMONPORR",767:" 22H\\KFK[ RHF[FQP[Z RZV[Y\\[ RZVZY RWYZY RWYZZ\\[",768:" 30KYUARBPCNELHKLKRLUNWQXSXVWXUYR RKPLMNKQJSJVKXMYPYVXZV]T_R`Oa",796:" 3>f>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:" 18I[NII[ RVI[[ RMM[[ RWMI[ RNIVI RMMWM",864:" 21I[RGRV RMJWP RWJMP RIVL\\ R[VX\\ RIV[V RL\\X\\",865:" 11G[MJSV RKPSL RG\\[\\[RG\\",866:" 14LXPLPPLPLTPTPXTXTTXTXPTPTLPL",867:" 32KYYPXNVLSKQKNLLNKQKSLVNXQYSYVXXVYT RYPWNUMSMQNPOOQOSPUQVSWUWWVYT",868:" 10KYRJKVYVRJ RRZYNKNRZ",869:" 34G]PIPGQFSFTGTI RGZHXJVKTLPLKMJOIUIWJXKXPYTZV\\X]Z RGZ]Z RQZP[Q\\S\\T[SZ",870:" 64JZRMRS RRSQ\\ RRSS\\ RQ\\S\\ RRMQJPHNG RQJNG RRMSJTHVG RSJVG RRMNKLKJM RPLLLJM RRMVKXKZM RTLXLZM RRMPNOOOR RRMPOOR RRMTNUOUR RRMTOUR",871:" 94JZRIRK RRNRP RRSRU RRYQ\\ RRYS\\ RQ\\S\\ RRGQIPJ RRGSITJ RPJRITJ RRKPNNOMN RRKTNVOWN RNOPORNTOVO RRPPSNTLTKRKSLT RRPTSVTXTYRYSXT RNTPTRSTTVT RRUPXOYMZLZKYJWJYLZ RRUTXUYWZXZYYZWZYXZ RMZOZRYUZWZ",872:" 40JZRYQ\\ RRYS\\ RQ\\S\\ RRYUZXZZXZUYTWTYRZOYMWLUMVJUHSGQGOHNJOMMLKMJOKRMTKTJUJXLZOZRY",873:" 32JZRYQ\\ RRYS\\ RQ\\S\\ RRYVXVVXUXRZQZLYIXHVHTGPGNHLHKIJLJQLRLUNVNXRY",874:" 15I[IPKR RLKNP RRGRO RXKVP R[PYR",899:" 6QSRQQRRSSRRQ",900:" 10PTQPPQPSQTSTTSTQSPQP",901:" 14NVQNOONQNSOUQVSVUUVSVQUOSNQN",902:" 18MWQMONNOMQMSNUOVQWSWUVVUWSWQVOUNSMQM",903:" 18KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",904:" 22G]PGMHJJHMGPGTHWJZM\\P]T]W\\ZZ\\W]T]P\\MZJWHTGPG",905:" 34AcPALBJCGEEGCJBLAPATBXCZE]G_JaLbPcTcXbZa]__]aZbXcTcPbLaJ_G]EZCXBTAPA",906:" 34<hP<K=G?DAAD?G=K<P<T=Y?]A`DcGeKgPhThYg]e`cc`e]gYhThPgKeGcD`A]?Y=T<P<",907:" 50){O)I*E+@-;073370;-@+E*I)O)U*[+_-d0i3m7q;t@wEyIzO{U{[z_ydwitmqqmtiwdy_z[{U{OzIyEw@t;q7m3i0d-_+[*U)O)",908:" 34>fRAPCMDJDGCEA>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:" 22LXUPVRVQUPSOQOOPNRNTOVRX RQOOQOTPVRXSYS[R\\P\\",1191:" 45I[VKWLXLVKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RZK[L[KYKWLVNSYR[Q\\ RYKXLWNTYS[Q\\O\\O[P\\ RLOYO",1192:" 38IZVKWLXLXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RVOTVTWUXWXXWYU RWOUVUWVX RLOWO",1193:" 38IZVKWL RXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RWKTVTWUXWXXWYU RXKUVUWVX RLOVO",1194:" 63F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L\\L\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ RZOXVXWYX[X\\W]U R[OYVYWZX RIO[O",1195:" 63F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L R\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ R[KXVXWYX[X\\W]U R\\KYVYWZX RIOZO",1196:" 20MWNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1200:" 28LYQKOLNONTOWQXTXVWWTWOVLTKQK RQKPLOOOTPWQX RTXUWVTVOULTK",1201:" 10LYPNSKSX RRLRX ROXVX",1202:" 35LYOMONNNNMOLQKTKVLWNVPTQQROSNUNX RTKULVNUPTQ RNWOVPVSWVWWV RPVSXVXWVWU",1203:" 39LYOMONNNNMOLQKTKVLWNVPTQ RTKULVNUPTQ RRQTQVRWTWUVWTXQXOWNVNUOUOV RTQURVTVUUWTX",1204:" 13LYSMSX RTKTX RTKMTXT RQXVX",1205:" 33LYOKNQ ROKVK ROLSLVK RNQOPQOTOVPWRWUVWTXQXOWNVNUOUOV RTOUPVRVUUWTX",1206:" 36LYVMVNWNWMVLTKRKPLOMNPNUOWQXTXVWWUWSVQTPQPNR RRKPMOPOUPWQX 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 RQ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MMM RIbPb",2117:" 33H\\WMWb RXMXb RWPUNSMQMNNLPKSKULXNZQ[S[UZWX RQMONMPLSLUMXOZQ[ RTb[b",2118:" 23IZNMN[ ROMO[ ROSPPRNTMWMXNXOWPVOWN RKMOM RK[R[",2119:" 32J[WOXMXQWOVNTMPMNNMOMQNRPSUUWVXW RMPNQPRUTWUXVXYWZU[Q[OZNYMWM[NY",2120:" 16KZPFPWQZS[U[WZXX RQFQWRZS[ RMMUM",2121:" 28G]LMLXMZP[R[UZWX RMMMXNZP[ 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]HQIOKMNM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U RQ[X[",2205:" 39H\\MFKP RKPMNPMSMVNXPYSYUXXVZS[P[MZLYKWKVLUMVLW RSMUNWPXSXUWXUZS[ RMFWF RMGRGWF",2206:" 48H\\WIVJWKXJXIWGUFRFOGMILKKOKULXNZQ[S[VZXXYUYTXQVOSNRNOOMQLT RRFPGNIMKLOLUMXOZQ[ RS[UZWXXUXTWQUOSN",2207:" 31H\\KFKL RKJLHNFPFUIWIXHYF RLHNGPGUI RYFYIXLTQSSRVR[ RXLSQRSQVQ[",2208:" 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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OWRPWPZO[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^GfHfIeIdHc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PMRNSQS[ RHQKOMNONQORQR[S[ RSQVNXM[M]N^Q^[ RSQVOXNZN\\O]Q][^[",2614:" 25H\\LML[M[ RLMMMM[ RMQPNRMUMWNXQX[ RMQPORNTNVOWQW[X[",2615:" 36I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM RQNOONPMSMUNXOYQZTZVYWXXUXSWPVOTNQN",2616:" 36H\\LMLbMb RLMMMMb RMPONQMTMVNXPYSYUXXVZT[Q[OZMX RMPQNTNVOWPXSXUWXVYTZQZMX",2617:" 36H\\WMWbXb RWMXMXb RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX",2618:" 21KYOMO[P[ ROMPMP[ RPSQPSNUMXM RPSQQSOUNXNXM",2619:" 50J[XPWNTMQMNNMPNRPSUUWV RVUWWWXVZ RWYTZQZNY ROZNXMX RXPWPVN RWOTNQNNO RONNPOR RNQPRUTWUXWXXWZT[Q[NZMX",2620:" 16MXRFR[S[ RRFSFS[ ROMVMVN ROMONVN",2621:" 25H\\LMLWMZO[R[TZWW RLMMMMWNYPZRZTYWW RWMW[X[ RWMXMX[",2622:" 14JZLMR[ RLMMMRY RXMWMRY RXMR[",2623:" 26F^IMN[ RIMJMNX RRMNX RRPN[ RRPV[ RRMVX R[MZMVX R[MV[",2624:" 16I[LMW[X[ RLMMMX[ RXMWML[ RXMM[L[",2625:" 17JZLMR[ RLMMMRY RXMWMRYNb RXMR[ObNb",2626:" 20I[VNL[ RXMNZ RLMXM RLMLNVN RNZXZX[ RL[X[",2651:" 33K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRTXTZV[XZYY[V RWRUXUZV[",2652:" 23LZLVNSPO RSFMXMZO[P[RZTXUUURVVWWXWZV RTFNXNZO[",2653:" 22LXTSSTTTTSSRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[",2654:" 33K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RZFTXTZ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NX RXXUZ",2720:" 8G^[BIbJb R[B\\BJb",2721:" 24KYUBSDQGOKNPNTOYQ]S`UbVb RUBVBTDRGPKOPOTPYR]T`Vb",2722:" 24KYNBPDRGTKUPUTTYR]P`NbOb RNBOBQDSGUKVPVTUYS]Q`Ob",2723:" 39JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO",2724:" 8F_JQ[Q[R RJQJR[R",2725:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",2726:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",2727:" 11NWSFRGRM RSGRM RSFTGRM",2728:" 22I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM",2729:" 30KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF",2750:" 42H]TFQGOIMLLOKSKVLYMZO[Q[TZVXXUYRZNZKYHXGVFTF RTFRGPINLMOLSLVMYO[ RQ[SZUXWUXRYNYKXHVF",2751:" 15H]TJO[ RVFP[ RVFSIPKNL RUIQKNL",2752:" 42H]OJPKOLNKNJOHPGSFVFYGZIZKYMWOTQPSMUKWI[ RVFXGYIYKXMVOPS RJYKXMXRZUZWYXW RMXR[U[WZXW",2753:" 50H]OJPKOLNKNJOHPGSFVFYGZIZKYMVOSP RVFXGYIYKXMVO RQPSPVQWRXTXWWYVZS[O[LZKYJWJVKULVKW RSPUQVRWTWWVYUZS[",2754:" 10H]XGR[ RYFS[ RYFJUZU",2755:" 39H]QFLP RQF[F RQGVG[F RLPMOPNSNVOWPXRXUWXUZR[O[LZKYJWJVKULVKW RSNUOVPWRWUVXTZR[",2756:" 46H]YIXJYKZJZIYGWFTFQGOIMLLOKSKWLYMZO[R[UZWXXVXSWQVPTOQOOPMRLT RTFRGPINLMOLSLXMZ RR[TZVXWVWRVP",2757:" 30H]NFLL R[FZIXLSRQUPWO[ RXLRRPUOWN[ RMIPFRFWI RNHPGRGWIYIZH[F",2758:" 63H]SFPGOHNJNMOOQPTPXOYNZLZIYGVFSF RSFQGPHOJOMPOQP RTPWOXNYLYIXGVF RQPMQKSJUJXKZN[R[VZWYXWXTWRVQTP RQPNQLSKUKXLZN[ RR[UZVYWWWSVQ",2759:" 46H]YMXOVQTRQROQNPMNMKNIPGSFVFXGYHZJZNYRXUVXTZQ[N[LZKXKWLVMWLX ROQNONKOIQGSF RXGYIYNXRWUUXSZQ[",2760:" 6MXPYOZP[QZPY",2761:" 8MXP[OZPYQZQ[P]N_",2762:" 11MXSMRNSOTNSM RPYOZP[QZ",2763:" 14MXSMRNSOTNSM RP[OZPYQZQ[P]N_",2764:" 17MXUFTGRS RUGRS RUFVGRS RPYOZP[QZPY",2765:" 34H]OJPKOLNKNJOHPGSFWFZG[I[KZMYNSPQQQSRTTT RWFYGZIZKYMXNVO RPYOZP[QZPY",2766:" 8MXVFTHSJSKTLUKTJ",2767:" 8MXUHTGUFVGVHUJSL",2768:" 55E_\\N[O\\P]O]N\\M[MYNWPRXPZN[K[HZGXGVHTISKRPPROTMUKUITGRFPGOIOLPRQUSXUZW[Y[ZYZX RK[IZHXHVITJSPP ROLPQQTSWUYWZYZZY",2769:" 41H]TBL_ RYBQ_ RZJYKZL[K[JZHYGVFRFOGMIMKNMONVRXT RMKOMVQWRXTXWWYVZS[O[LZKYJWJVKULVKW",2770:" 3G]_BEb",2771:" 20KZZBVESHQKOONTNXO]P`Qb RVESIQMPPOUOZP_Qb",2772:" 20JYSBTDUGVLVPUUSYQ\\N_Jb RSBTEUJUOTTSWQ[N_",2773:" 9J[TFTR ROIYO RYIOO",2774:" 3E_IR[R",2775:" 6E_RIR[ RIR[R",2776:" 6E_IO[O RIU[U",2777:" 6NWUFSM RVFSM",2778:" 12I[PFNM RQFNM RYFWM RZFWM",2779:" 14KZSFQGPIPKQMSNUNWMXKXIWGUFSF",2801:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2802:" 31G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RJMQM RNTPTSSTRVNWMXMYNXOWN RPTSUTVVZW[ RPTRUSVUZV[X[YZZX RJ[Q[",2912:" 22G]NMNQMWLZK[J[IZJYKZ RWMW[ RXMX[ RKM[M RT[[[",2913:" 30G^LML[ RLMR[ RMMRY RXMR[ RXMX[ RYMY[ RIMMM RXM\\M RI[O[ RU[\\[",2914:" 27G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RMTWT RI[P[ RT[[[",2915:" 36H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM",2916:" 21G]LML[ RMMM[ RWMW[ RXMX[ RIM[M RI[P[ RT[[[",2917:" 36G\\LMLb RMMMb RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIMMM RIbPb",2918:" 28H[WPVQWRXQXPVNTMQMNNLPKSKULXNZQ[S[VZXX RQMONMPLSLUMXOZQ[",2919:" 16I\\RMR[ RSMS[ RMMLRLMYMYRXM RO[V[",2920:" 22I[LMR[ RMMRY RXMR[P_NaLbKbJaK`La RJMPM RTMZM",2921:" 52H]RFRb RSFSb ROFSF RRPQNPMNMLNKQKWLZN[P[QZRX RNMMNLQLWMZN[ RWMXNYQYWXZW[ RSPTNUMWMYNZQZWYZW[U[TZSX RObVb",2922:" 21H\\LMW[ RMMX[ RXML[ RJMPM RTMZM RJ[P[ RT[Z[",2923:" 23G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RI[[[[`Z[",2924:" 28G]LMLTMVPWRWUVWT RMMMTNVPW RWMW[ RXMX[ RIMPM RTM[M RT[[[",2925:" 30CbHMH[ RIMI[ RRMR[ RSMS[ R\\M\\[ R]M][ REMLM ROMVM RYM`M RE[`[",2926:" 32CbHMH[ RIMI[ RRMR[ RSMS[ R\\M\\[ R]M][ REMLM ROMVM RYM`M RE[`[``_[",2927:" 27H]QMQ[ RRMR[ RLMKRKMUM RRTVTYUZWZXYZV[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OWRWVVYUZS[ RIbQb RJMLN RKMLO RLaJb RL`Kb RN`Ob RNaPb",3117:" 55H\\VNVb RWOWa RUNWNXMXb RVPUNSMQMNNLPKSKULXNZQ[S[UZVX RMPLRLVMX RQMONNOMRMVNYOZQ[ RSb[b RVaTb RV`Ub RX`Yb RXaZb",3118:" 43IZNMN[ RONOZ RKMPMP[ RWOWNVNVPXPXNWMUMSNQPPS RK[S[ RLMNN RMMNO RNZL[ RNYM[ RPYQ[ RPZR[",3119:" 43J[WOXMXQWOVNTMPMNNMOMQNSPTUUWVXY RNNMQ RNRPSUTWU RXVWZ RMONQPRUSWTXVXYWZU[Q[OZNYMWM[NY",3120:" 22KZPHPVQYRZT[V[XZYX RQHQWRY RPHRFRWSZT[ RMMVM",3121:" 43G^LMLVMYNZP[S[UZVYWW RMNMWNY RIMNMNWOZP[ RWMW[\\[ RXNXZ RTMYMY[ RJMLN RKMLO RYYZ[ RYZ[[",3122:" 31I[LMR[ RMMRY RNMSY RXNSYR[ RJMQM RTMZM RKMNO RPMNN RVMXN RYMXN",3123:" 45F^JMN[ RKMNX RLMOX RRMOXN[ RRMV[ RSMVX RRMTMWX RZNWXV[ RGMOM RWM]M RHMKN RNMLN RXMZN R\\MZN",3124:" 48H\\LMV[ RMMW[ RNMX[ RWNMZ RJMQM RTMZM RJ[P[ RS[Z[ RKMMN RPMNN RUMWN RYMWN RMZK[ RMZO[ RVZT[ RWZY[",3125:" 40H[LMR[ RMMRY RNMSY RXNSYP_NaLbJbIaI_K_KaJaJ` RJMQM RTMZM RKMNO RPMNN RVMXN RYMXN",3126:" 41I[VML[ RWMM[ RXMN[ RXMLMLQ RL[X[XW RMMLQ RNMLP ROMLO RQMLN RS[XZ RU[XY RV[XX RW[XW",3151:" 50G]WMUTUXVZW[Y[[Y\\W RXMVTVZ RWMYMWTVX RUTUQTNRMPMMNKQJTJVKYLZN[P[RZSYTWUT RNNLQKTKWLY RPMNOMQLTLWMZN[",3152:" 52I\\PFNMMSMWNYOZQ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YNWOSPQQQSSTTT RUFZG RYGZIZKYMXNVO RWFXGYIYKXMWNSPRQRSST RPXOYOZP[Q[RZRYQXPX RPYPZQZQYPY",3266:" 22MXWFUGTHSJSLTMUMVLVKUJTJ RUGTITJ RTKTLULUKTK",3267:" 22MXVIUITHTGUFVFWGWIVKULSM RUGUHVHVGUG RVIVJUL",3268:" 72E_\\O\\N[N[P]P]N\\M[MYNWPRXPZN[K[HZGXGVHTISKRPPROTMUKUITGRFPGOIOLPRQURWTZV[X[YYYX RL[HZ RIZHXHVITJSLR RPPQSTYVZ RK[JZIXIVJTKSMRRO ROLPOQRSVUYWZXZYY",3269:" 52H]TBL_ RYBQ_ RZKZJYJYL[L[JZHYGVFRFOGMIMLNNPPVSWUWXVZ RNLONVRWT ROGNINKOMUPWRXTXWWYVZS[O[LZKYJWJULULWKWKV",3270:" 8G^_BEbFb R_B`BFb",3271:" 32JZZBXCUERHPKNOMSMXN\\O_Qb RSHQKOONTN\\ RZBWDTGRJQLPOOSN\\ RNTO]P`Qb",3272:" 32JZSBUEVHWLWQVUTYR\\O_LaJb RVHVPUUSYQ\\ RSBTDUGVP RVHUQTUSXRZP]M`Jb",3273:" 39J[TFSGUQTR RTFTR RTFUGSQTR ROIPIXOYO ROIYO ROIOJYNYO RYIXIPOOO RYIOO RYIYJONOO",3274:" 8F_JQ[Q[R RJQJR[R",3275:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",3276:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",3277:" 11MWUFTGRM RUGRM RUFVGRM",3278:" 22H\\PFOGMM RPGMM RPFQGMM RZFYGWM RZGWM RZF[GWM",3279:" 30KZSFQGPIPKQMSNUNWMXKXIWGUFSF RSFPIQMUNXKWGSF RUFQGPKSNWMXIUF",3301:" 62F^IHJIIJHIIGKFMFOGPHQKQOPRNTLUIV ROHPKPPOR RMFNGOJOPNSLU RLVOY RKVOZ RIVN[UV R\\G[H\\H\\G[FYFWGVHUJUYW[[W RWHV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G RVFUHTIRIPHOHNI RNKPP RNPNTO` ROONOONO[ RPPPTO` RLPNP RPPUMWNXPXRWTSV RUNWO RTNVOWQWRVTUU RUUWVXXX[W]U_R` RUVWW RSVTVVWWYW\\V^",3429:" 62J[PIOLNNMOKP RPIPXQYO[ ROONOONOXNYOZPYOX RKPNPNXMYO[ RPPUMWNXPXRWTSV RUNWO RTNVOWQWRVTUU RUUWVXXX[W]U_R` RUVWW RSVTVVWWYW\\V^",3501:" 60G]LINGPFRFSGZW[X]X RQGRHYXZZ[YYX RNGPGQHXXYZZ[[[]X RLMMLOKPKQL RPLPM RMLOLPN RG[IYKXNXPY RJYNYOZ RG[JZMZN[PY RRJLX RNSVS",3502:"110F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RRIQJPLPU RQKQS RRIRRQTPU RRIXFZG[I[KYMUO RXGZIZK RVGXHYIYLWN RWNZP[R[X RYPZRZW RWNXOYQYX RJ[MYPXTXWY RLZOYTYVZ RJ[NZSZU[WYYX[X RUOUX RURYR RUUYU",3503:" 69E]NGLHJJILHOHSIVJXMZP[S[VZXYZW[U RJKINISKWNYQZTZWY RNGLIKKJNJRKUNXQYTYWXYW[U RPJPV RQJQT RRIRSQUPV RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RWIWX",3504:" 72G^IFWFYGZIZX RKGWGYIYW RIFJGLHWHXIXX ROKNLMNMOKOJPJRKQMQMV RNMNT RKPNP ROKOSNUMV RI[LYOXSXVY RKZNYSYUZ RI[MZRZT[VYXXZX RRHRX RRMTNVNXM RRSTRVRXS",3505:" 94G]IHKFMFOGQF RLGNG RIHKGMHOHQF RNKMLLNLOJOIPIRJQLQLW RMMMU RJPMP RNKNTMVLW RQMRJSHTGVFXF[G RTHVGXGZH RRJSIUHWHYI[G RQURRSPTOVOXP RTPVPWQ RRRSQUQVRXP RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RQMQX",3506:" 91F]JHLFOFQGSF RMGPG RJHLGNHQHSF RPKOLNNNOLOKPKRLQNQNV ROMOT RLPOP RPKPSOUNV RSJSYRZQZMXKXIYG[ RTJTX RTPXP RPZOZMYJY RUIUOXO RXQUQUWTYP[N[LZJZG[ RSJUIXFZG\\G]F RWGYH[H RVHXIZI\\H]F RXIXW",3507:" 87E^NGLHJJILHOHRIUJWLYNZQ[U[XZZX[V[SZQYPWOUO RJKINISJV RNGLIKKJNJSKVLXNZ RYXZWZSYQ RU[WZXYYWYSXQWPUO RPJPW RQJQU RRIRTQVPW RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RYHUOU[ RUSYS RUVYV",3508:"112F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZOYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOWNYLZM[P[TZXX[ RXMYNZPZUYX RWNXNYPYUX[ RUOUY RURYR RUUYU",3509:" 67I\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZSZOXMXKYI[ RWKWW RRZQZOYLY RYHXJXVWXUZS[P[NZKZI[",3510:" 65H\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZ RWKWW RYHXJXVWXUZR[O[LZJXJVKULUMVLWKW RJVMV",3511:"115F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZNYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOXLYM[N RWMYN[N R[NYQWSUU RWSYTZX[Z\\Z RYVZZ RWSXTYZZ[[[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ZIZXYY ROHOX RWHWX RONRN RORRR RWNZN RWRZR",3524:" 65G]HIJGLFNFOGWYXZZZ RMGNHVYWZ RJGLGMHUZV[X[ZZ\\X RWFYG[G\\F RWGXHZH RVHWIYI[H\\F RH[IYKXMXNY RJYLYMZ RH[IZKZM[ RWFSO RQRM[ RLPPP RSPXP",3525:" 86G^JFKGLILOJOIPIRJQLQLXJY RLHMJMX RJPMP RNYQYSZ RJFLGMHNJNXRXUY RJYMYPZR[UYXX RRJUIWHYFZG\\HZIZ^Y`WbUaQ`L` RYIZHYGXHYIYY RWHXIXXZ[ RXaV`S` RY`V_P_L` RRJRX RRMTNVNXM RRSTRVRXS",3526:" 57H\\XGWIROOSMWJ[ RVKNV RZFWJUNRRMXLZ RJHLFOGUGZF RKGOHSHWG RJHNIRIVHXG RLZNYRXVXZY RMZQYUYYZ RJ[OZUZX[ZY RMPQP RTPXP",3601:" 53J[PRNTMVMXNZP[RYUX RMVNXOYQZ RNTNVOXQYRY RNPPPSOUNVMXOWPWXXYYY RONNOQO RTOWOVNVYWZ RMOOMPNROUPUYW[YY RMORT",3602:" 44I[LHMJMXKY RNJMHNGNXQZ RLHOFOXQYRZ RKYMYOZP[RZUYWY ROPROTNUMVNXOYOWPWY RTNVOVX RROSOUPUY",3603:" 35JXNONXLYMYOZP[ ROOOYQZ RPOPXRYSYQZP[ RNORNTMUNWOXO RSNTOVO RPORNTPVPXO",3604:" 41IZRMPNMOMXKY RNONXQZ RRMOOOXQYRZ RKYMYOZP[RZUYWY RMHPFQIWOWY RPINHOGPIVOVX RMHUPUY",3605:" 32JXNONXLYMYOZP[ ROOOYQZ RPOPXRYSYQZP[ RNORNTMWQURPU RSNVQ RPORNUR",3606:" 41JWNHNXLYMYOZP[ ROHOYQZ RPHPXRYSYQZP[ RNHQGSFTGVHWH RRGSHUH RPHQGSIUIWH RKMNM RPMTM",3607:" 56I[MOMXKYLYNZO[PZRYUX RNPNYPZ ROOOXQYRY RMOOORNTMUNWOYOWPW\\V_T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POTMUNWOXO RSNTOVO RRNTPVPXO",3619:" 59JZMOMSOTUTWUWY RNONS RVUVY RPNOOOSQT RSTUUUYTZ RMOPNRMTNVNWM RQNSN RPNROTOVN RWYTZR[PZNZL[ RSZQZ RTZRYOYL[ RWMVOTROWL[",3620:" 28MWPHQJQXOYPYRZS[ RRJQHRGRYTZ RPHSFSXUYVYTZS[ RNMQM RSMVM",3621:" 47I[KOLOMPMXKY RLNNONYPZ RKOMMOOOXQYRY RKYLYNZO[PZRYUX RUMVNXOYOWPWXXYYY RTNVOVYWZ RUMSOUPUYW[YY",3622:" 36I[LMMOMXP[RYUXWX RMNNONXQZ RLMNNOOOWPXRY RUMVNXOYOWPWX RTNVOVW RUMSOUPUX",3623:" 57E_HMIOIXL[NYQX RINJOJXMZ RHMJNKOKWLXNY RQMOOQPQXT[VYYX[X RPNRORXUZ RQMRNTOSPSWTXVY RYMZN\\O]O[P[X RXNZOZW RYMWOYPYX",3624:" 59H[KOLONPOQSYTZV[XY RMNOOTYVZ RKOMMONPOTWUXWYXY RRSUMVNXNYM RUNVOWO RTOVPXOYM RQUN[MZKZJ[ RNZMYLY ROYMXKYJ[ RMTPT RSTVT",3625:" 60I[KOLOMPMXKY RLNNONYPZ RKOMMOOOXQYRY RKYLYNZO[PZRYUX RUMVNXOYOWPW\\V_TaRbQaO`M` RTNVOV\\ RSaQ`P` RUMSOUPUZV]V_ RTaS`Q_O_M`",3626:" 38I[XML[ RLONPQPTOXM RMNOOSO RLONMPNTNXM RL[PYSXVXXY RQYUYWZ RL[PZTZV[XY RNTVT",3700:" 42H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJYLYNZO[QZVYXY",3701:" 27H\\OHPIQKQXOY RQIPHQGRIRYTZ ROHRFSHSXUYVY ROYPYRZS[TZVY",3702:" 48H\\LHNHPGQFSGVHXH RPHRG RLHNIPIRHSG RVHVP RWIWO RXHXPQPNQLSKVK[ RK[OYSXVXZY RNZQYVYYZ RK[PZUZX[ZY",3703:" 57H\\LHMHOGPFRGVHXH ROHQG RLHNIPIRG RVHVO RWIWN RXHXOVOSPQQ RQPSQVRXRXY RWSWX RVRVY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3704:" 41H\\UFKPKUTU RVUZU[V[TZU RLPLT RMNMU RTGTXRY RUJVHUGUYWZ RUFWHVJVXXYYY RRYSYUZV[WZYY",3705:" 53H\\LFLO RLFXF RMGVG RLHUHWGXF RVLUMSNOOLO RSNTNVOVY RUMWNWX RVLWMYNZNXOXY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3706:" 59H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHRGTFUGWHXH RSGUH RRGTIVIXH RNPOPSOUNVM RSOTOVPVY RUNWPWX RVMWNYOZOXPXY RJYLYNZO[QZVYXY",3707:" 38H\\KHMFPGUGZF RLGOHTHWG RKHOIRIVHZF RZFYHWKSOQRPUPXQ[ RRQQTQWRZ RUMSPRSRVSYQ[",3708:" 71H\\LILO RMJMN RNINO RLINISHUGVF RSHTHVIVO RUGWHWN RVFWGYHZHXIXO RLONOVRXR RXOVONRLR RLRLXJY RMSMXPZ RNRNXPYQZ RVRVY RWSWX RXRXY RJYLYNZO[QZVYXY",3709:" 60H\\LHLQJR RMIMROS RNHNQPRQR RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJRKRMSNTOSQRUQVQ RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3710:" 11LXRXPZR[TZRX RRYQZSZRY",3711:" 14LXR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3712:" 22LXRMPORPTORM RRNQOSORN RRXPZR[TZRX RRYQZSZRY",3713:" 25LXRMPORPTORM RRNQOSORN RR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3714:" 30LXRFQGOHQIRT RRISHRGQHRIRT RRFSGUHSIRT RRXPZR[TZRX RRYQZSZRY",3715:" 51I[LJMHNGQFSFVGWHXJXLWNUPSQ RMJNH RVHWIWMVN RLJNKNIOGQF RSFUGVIVMUOSQ RRQRTSQQQRT RRXPZR[TZRX RRYQZSZRY",3716:" 14LXTFRGQIQKRMTKRIRG RRJRLSKRJ",3717:" 14LXRLRJPHRFSHSJRLPM RRGQHRIRG",3718:" 62E_YNZO[O\\N RXOYP[P RXPYQZQ[P\\N RYNST RRUL[HVNP ROOSKOFJLPRTXVZX[Z[[Z\\X RLZIV RRKOG RKLPQTWVYXZ[Z RMZIU RRLNG RKKQQUWVXXY[Y\\X",3719:" 60H\\PBP_ RTBT_ RTFVGWIWKYJXHWGTFPFMGKIKLLNOPURWSXUXXWZ RXJWH RLLMNOOUQWRXT RMYLW RMGLILKMMONUPXRYTYWXYWZT[P[MZLYKWMVMXNZP[",3720:" 8G^[BIbJb R[B\\BJb",3721:" 27KYUBSDQGOKNPNTOYQ]S`Ub RQHPKOOOUPYQ\\ RSDRFQIPOPUQ[R^S`",3722:" 27KYOBQDSGUKVPVTUYS]Q`Ob RSHTKUOUUTYS\\ RQDRFSITOTUS[R^Q`",3723:" 39JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO",3724:" 8F_JQ[Q[R RJQJR[R",3725:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",3726:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",3727:" 11NWSFRGRM RSGRM RSFTGRM",3728:" 22I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM",3729:" 30KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF",3801:" 52E_NHLIJKIMHPHSIUKV RJLIOISJU RNHLJKLJOJRKVKXJZH[ RVHXHXYVY RYHYY RZGZZ RHFKGQHVHZG\\F RJPXP RH[KZQYVYZZ\\[",3802:" 65E_LGLZ RMGMZ RPFNGNZP[ RHJJHLGPFUFXGZIZKY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 RTNVOVXUYVZWYVX RRNUPUXTYV[",3915:" 28JZMPMXP[UYWX RNPNXPZ ROOOWRZ RMPOOTMWPWX RTNVPVX RRNUQUY",3916:" 47IZLMMOMXKYMYM_LbN` RNON` RLMNNOOOXQYRZ RNYOYQZ ROZP[UYWX ROZO_PbN` ROORNTMWPWX RTNVPVX RRNUQUY",3917:" 31J[MPMXP[UY RNPNXPZ ROOOWRZ RMPOOTMWPW_XbV` RTNVPV` RRNUQU_TbV`",3918:" 31KXMONOOPOXNYP[ RONPOPXOYPZQYPX RMOOMQOQXRYP[ RQOUMWOUPSN RTNVO",3919:" 41JZMPMSOUURWTWX RNPNSOT ROOOSPT RUSVTVX RTSUTUY RMPSMVNTOQN RRNUN RWXQ[MYOXSZ ROYQZ",3920:" 27MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[ RNMQM RSMVM",3921:" 40I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPWXXYYY RVPWOVNUOVPVYWZ RVMTOUPUYW[YY",3922:" 36I[LMMOMXQ[SYWW RMNNONXQZ RLMNNOOOWRYSY RVMXOWPWW RVPWOVNUOVPVW RVMTOUPUX",3923:" 59E_HMIOIXM[OYQX RINJOJXMZ RHMJNKOKWNYOY RRMPOQPQXU[WY[W RRPSORNQORPRXUZ RRMTOSPSWVYWY RZM\\O[P[W RZP[OZNYOZPZW RZMXOYPYX",3924:" 39I[LONPUZV[XY RMNOOUYWZ RLONMONVXXY RXMVMVOXOXMVOSS RQUNYL[N[NYLYL[ RNTQT RSTVT",3925:" 49I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPW]V_U`SaQaO`MaObQa RVPWOVNUOVPV^U_ RPaNa RVMTOUPU^T`Sa",3926:" 43L[RNOPOORNTMWOWSRU RTNVOVS RRNUPUSTT RRUWWW]V_U`SaQaO`MaObQa RVWV^U_ RPaNa RTVUWU^T`Sa"},Wt={"\\frac":{glyph:0,arity:2,flags:{}},"\\binom":{glyph:0,arity:2,flags:{}},"\\sqrt":{glyph:2267,arity:1,flags:{opt:!0,xfl:!0,yfl:!0}},"^":{glyph:0,arity:1,flags:{}},_:{glyph:0,arity:1,flags:{}},"(":{glyph:2221,arity:0,flags:{yfl:!0}},")":{glyph:2222,arity:0,flags:{yfl:!0}},"[":{glyph:2223,arity:0,flags:{yfl:!0}},"]":{glyph:2224,arity:0,flags:{yfl:!0}},"\\langle":{glyph:2227,arity:0,flags:{yfl:!0}},"\\rangle":{glyph:2228,arity:0,flags:{yfl:!0}},"|":{glyph:2229,arity:0,flags:{yfl:!0}},"\\|":{glyph:2230,arity:0,flags:{yfl:!0}},"\\{":{glyph:2225,arity:0,flags:{yfl:!0}},"\\}":{glyph:2226,arity:0,flags:{yfl:!0}},"\\#":{glyph:2275,arity:0,flags:{}},"\\$":{glyph:2274,arity:0,flags:{}},"\\&":{glyph:2273,arity:0,flags:{}},"\\%":{glyph:2271,arity:0,flags:{}},"\\begin":{glyph:0,arity:1,flags:{}},"\\end":{glyph:0,arity:1,flags:{}},"\\left":{glyph:0,arity:1,flags:{}},"\\right":{glyph:0,arity:1,flags:{}},"\\middle":{glyph:0,arity:1,flags:{}},"\\cdot":{glyph:2236,arity:0,flags:{}},"\\pm":{glyph:2233,arity:0,flags:{}},"\\mp":{glyph:2234,arity:0,flags:{}},"\\times":{glyph:2235,arity:0,flags:{}},"\\div":{glyph:2237,arity:0,flags:{}},"\\leqq":{glyph:2243,arity:0,flags:{}},"\\geqq":{glyph:2244,arity:0,flags:{}},"\\leq":{glyph:2243,arity:0,flags:{}},"\\geq":{glyph:2244,arity:0,flags:{}},"\\propto":{glyph:2245,arity:0,flags:{}},"\\sim":{glyph:2246,arity:0,flags:{}},"\\equiv":{glyph:2240,arity:0,flags:{}},"\\dagger":{glyph:2277,arity:0,flags:{}},"\\ddagger":{glyph:2278,arity:0,flags:{}},"\\ell":{glyph:662,arity:0,flags:{}},"\\vec":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overrightarrow":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overleftarrow":{glyph:2263,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\bar":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\overline":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\widehat":{glyph:2247,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\hat":{glyph:2247,arity:1,flags:{hat:!0}},"\\acute":{glyph:2248,arity:1,flags:{hat:!0}},"\\grave":{glyph:2249,arity:1,flags:{hat:!0}},"\\breve":{glyph:2250,arity:1,flags:{hat:!0}},"\\tilde":{glyph:2246,arity:1,flags:{hat:!0}},"\\underline":{glyph:2231,arity:1,flags:{mat:!0,xfl:!0}},"\\not":{glyph:2220,arity:1,flags:{}},"\\neq":{glyph:2239,arity:1,flags:{}},"\\ne":{glyph:2239,arity:1,flags:{}},"\\exists":{glyph:2279,arity:0,flags:{}},"\\in":{glyph:2260,arity:0,flags:{}},"\\subset":{glyph:2256,arity:0,flags:{}},"\\supset":{glyph:2258,arity:0,flags:{}},"\\cup":{glyph:2257,arity:0,flags:{}},"\\cap":{glyph:2259,arity:0,flags:{}},"\\infty":{glyph:2270,arity:0,flags:{}},"\\partial":{glyph:2265,arity:0,flags:{}},"\\nabla":{glyph:2266,arity:0,flags:{}},"\\aleph":{glyph:2077,arity:0,flags:{}},"\\wp":{glyph:2190,arity:0,flags:{}},"\\therefore":{glyph:740,arity:0,flags:{}},"\\mid":{glyph:2229,arity:0,flags:{}},"\\sum":{glyph:2402,arity:0,flags:{big:!0}},"\\prod":{glyph:2401,arity:0,flags:{big:!0}},"\\bigoplus":{glyph:2284,arity:0,flags:{big:!0}},"\\bigodot":{glyph:2281,arity:0,flags:{big:!0}},"\\int":{glyph:2412,arity:0,flags:{yfl:!0}},"\\oint":{glyph:2269,arity:0,flags:{yfl:!0}},"\\oplus":{glyph:1284,arity:0,flags:{}},"\\odot":{glyph:1281,arity:0,flags:{}},"\\perp":{glyph:738,arity:0,flags:{}},"\\angle":{glyph:739,arity:0,flags:{}},"\\triangle":{glyph:842,arity:0,flags:{}},"\\Box":{glyph:841,arity:0,flags:{}},"\\rightarrow":{glyph:2261,arity:0,flags:{}},"\\to":{glyph:2261,arity:0,flags:{}},"\\leftarrow":{glyph:2263,arity:0,flags:{}},"\\gets":{glyph:2263,arity:0,flags:{}},"\\circ":{glyph:902,arity:0,flags:{}},"\\bigcirc":{glyph:904,arity:0,flags:{}},"\\bullet":{glyph:828,arity:0,flags:{}},"\\star":{glyph:856,arity:0,flags:{}},"\\diamond":{glyph:743,arity:0,flags:{}},"\\ast":{glyph:728,arity:0,flags:{}},"\\log":{glyph:0,arity:0,flags:{txt:!0}},"\\ln":{glyph:0,arity:0,flags:{txt:!0}},"\\exp":{glyph:0,arity:0,flags:{txt:!0}},"\\mod":{glyph:0,arity:0,flags:{txt:!0}},"\\lim":{glyph:0,arity:0,flags:{txt:!0,big:!0}},"\\sin":{glyph:0,arity:0,flags:{txt:!0}},"\\cos":{glyph:0,arity:0,flags:{txt:!0}},"\\tan":{glyph:0,arity:0,flags:{txt:!0}},"\\csc":{glyph:0,arity:0,flags:{txt:!0}},"\\sec":{glyph:0,arity:0,flags:{txt:!0}},"\\cot":{glyph:0,arity:0,flags:{txt:!0}},"\\sinh":{glyph:0,arity:0,flags:{txt:!0}},"\\cosh":{glyph:0,arity:0,flags:{txt:!0}},"\\tanh":{glyph:0,arity:0,flags:{txt:!0}},"\\csch":{glyph:0,arity:0,flags:{txt:!0}},"\\sech":{glyph:0,arity:0,flags:{txt:!0}},"\\coth":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsin":{glyph:0,arity:0,flags:{txt:!0}},"\\arccos":{glyph:0,arity:0,flags:{txt:!0}},"\\arctan":{glyph:0,arity:0,flags:{txt:!0}},"\\arccsc":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsec":{glyph:0,arity:0,flags:{txt:!0}},"\\arccot":{glyph:0,arity:0,flags:{txt:!0}},"\\text":{glyph:0,arity:1,flags:{}},"\\mathnormal":{glyph:0,arity:1,flags:{}},"\\mathrm":{glyph:0,arity:1,flags:{}},"\\mathit":{glyph:0,arity:1,flags:{}},"\\mathbf":{glyph:0,arity:1,flags:{}},"\\mathsf":{glyph:0,arity:1,flags:{}},"\\mathtt":{glyph:0,arity:1,flags:{}},"\\mathfrak":{glyph:0,arity:1,flags:{}},"\\mathcal":{glyph:0,arity:1,flags:{}},"\\mathbb":{glyph:0,arity:1,flags:{}},"\\mathscr":{glyph:0,arity:1,flags:{}},"\\rm":{glyph:0,arity:1,flags:{}},"\\it":{glyph:0,arity:1,flags:{}},"\\bf":{glyph:0,arity:1,flags:{}},"\\sf":{glyph:0,arity:1,flags:{}},"\\tt":{glyph:0,arity:1,flags:{}},"\\frak":{glyph:0,arity:1,flags:{}},"\\cal":{glyph:0,arity:1,flags:{}},"\\bb":{glyph:0,arity:1,flags:{}},"\\scr":{glyph:0,arity:1,flags:{}},"\\quad":{glyph:0,arity:0,flags:{}},"\\,":{glyph:0,arity:0,flags:{}},"\\.":{glyph:0,arity:0,flags:{}},"\\;":{glyph:0,arity:0,flags:{}},"\\!":{glyph:0,arity:0,flags:{}},"\\alpha":{glyph:2127,flags:{}},"\\beta":{glyph:2128,flags:{}},"\\gamma":{glyph:2129,flags:{}},"\\delta":{glyph:2130,flags:{}},"\\varepsilon":{glyph:2131,flags:{}},"\\zeta":{glyph:2132,flags:{}},"\\eta":{glyph:2133,flags:{}},"\\vartheta":{glyph:2134,flags:{}},"\\iota":{glyph:2135,flags:{}},"\\kappa":{glyph:2136,flags:{}},"\\lambda":{glyph:2137,flags:{}},"\\mu":{glyph:2138,flags:{}},"\\nu":{glyph:2139,flags:{}},"\\xi":{glyph:2140,flags:{}},"\\omicron":{glyph:2141,flags:{}},"\\pi":{glyph:2142,flags:{}},"\\rho":{glyph:2143,flags:{}},"\\sigma":{glyph:2144,flags:{}},"\\tau":{glyph:2145,flags:{}},"\\upsilon":{glyph:2146,flags:{}},"\\varphi":{glyph:2147,flags:{}},"\\chi":{glyph:2148,flags:{}},"\\psi":{glyph:2149,flags:{}},"\\omega":{glyph:2150,flags:{}},"\\epsilon":{glyph:2184,flags:{}},"\\theta":{glyph:2185,flags:{}},"\\phi":{glyph:2186,flags:{}},"\\varsigma":{glyph:2187,flags:{}},"\\Alpha":{glyph:2027,flags:{}},"\\Beta":{glyph:2028,flags:{}},"\\Gamma":{glyph:2029,flags:{}},"\\Delta":{glyph:2030,flags:{}},"\\Epsilon":{glyph:2031,flags:{}},"\\Zeta":{glyph:2032,flags:{}},"\\Eta":{glyph:2033,flags:{}},"\\Theta":{glyph:2034,flags:{}},"\\Iota":{glyph:2035,flags:{}},"\\Kappa":{glyph:2036,flags:{}},"\\Lambda":{glyph:2037,flags:{}},"\\Mu":{glyph:2038,flags:{}},"\\Nu":{glyph:2039,flags:{}},"\\Xi":{glyph:2040,flags:{}},"\\Omicron":{glyph:2041,flags:{}},"\\Pi":{glyph:2042,flags:{}},"\\Rho":{glyph:2043,flags:{}},"\\Sigma":{glyph:2044,flags:{}},"\\Tau":{glyph:2045,flags:{}},"\\Upsilon":{glyph:2046,flags:{}},"\\Phi":{glyph:2047,flags:{}},"\\Chi":{glyph:2048,flags:{}},"\\Psi":{glyph:2049,flags:{}},"\\Omega":{glyph:2050,flags:{}}};function Xo(o,t="math"){const e=o.charCodeAt(0);if(65<=e&&e<=90){const n=e-65;return t=="text"||t=="rm"?n+2001:t=="tt"?n+501:t=="bf"||t=="bb"?n+3001:t=="sf"?n+2501:t=="frak"?n+3301:t=="scr"||t=="cal"?n+2551:n+2051}if(97<=e&&e<=122){const n=e-97;return t=="text"||t=="rm"?n+2101:t=="tt"?n+601:t=="bf"||t=="bb"?n+3101:t=="sf"?n+2601:t=="frak"?n+3401:t=="scr"||t=="cal"?n+2651:n+2151}if(48<=e&&e<=57){const n=e-48;return t=="it"?n+2750:t=="bf"?n+3200:t=="tt"?n+700:n+2200}return{".":2210,",":2211,":":2212,";":2213,"!":2214,"?":2215,"'":2216,'"':2217,"*":2219,"/":2220,"-":2231,"+":2232,"=":2238,"<":2241,">":2242,"~":2246,"@":2273,"\\":804}[o]}const Se={SUB_SUP_SCALE:.5,SQRT_MAG_SCALE:.5,FRAC_SCALE:.85,LINE_SPACING:.5,FRAC_SPACING:.4};function Ka(o){o=o.replace(/\n/g," ");let t=0;const e=[];let n="";for(;t<o.length;)o[t]==" "?n.length&&(e.push(n),n=""):o[t]=="\\"?n.length==1&&n[0]=="\\"?(n+=o[t],e.push(n),n=""):(n.length&&e.push(n),n=o[t]):/[A-Za-z0-9\.]/.test(o[t])?n+=o[t]:(n.length&&n!="\\"&&(e.push(n),n=""),n+=o[t],e.push(n),n=""),t++;return n.length&&e.push(n),e}function Ha(o){return{type:Wt[o]?"symb":"char",mode:"math",text:o,chld:[],bbox:null}}function Xi(o){let t=0,e={type:"node",text:"",mode:"math",chld:[],bbox:null};function n(){if(o[t]!="[")return null;let l=0,r=t;for(;r<o.length;){if(o[r]=="[")l++;else if(o[r]=="]"&&(l--,!l))break;r++}const a=Xi(o.slice(t+1,r));return t=r,a}function i(l){let r=t,a=r,c=0,d=0;const u=[];for(;r<o.length;){if(o[r]=="{")c||(a=r),c++;else if(o[r]=="}"){if(c--,!c&&(u.push(Xi(o.slice(a+1,r))),d++,d==l))break}else if(c==0&&(u.push(Ha(o[r])),d++,d==l))break;r++}return t=r,u}for(t=0;t<o.length;t++){const l=Wt[o[t]],r={type:"",text:o[t],mode:"math",chld:[],bbox:null};if(l)if(l.arity){t++,r.type="func";let a=null;l.flags.opt&&(a=n(),a&&t++);const c=i(l.arity);r.chld=c,a&&r.chld.push(a)}else r.type="symb";else o[t]=="{"?(r.type="node",r.text="",r.chld=i(1)):r.type="char";e.chld.push(r)}return e.chld.length==1&&(e=e.chld[0]),e}function zs(o){let t=0;for(;t<o.length;){if(o[t].text=="\\begin"){let e;for(e=t;e<o.length&&o[e].text!="\\end";e++);const n=o.splice(t+1,e-(t+1));zs(n),o[t].text=o[t].chld[0].text,o[t].chld=n,o.splice(t+1,1)}t++}}function pe(o,t,e,n,i,l){if(e==null&&(e=t),!!o.bbox){l&&(o.bbox.x*=t,o.bbox.y*=e),o.bbox.w*=t,o.bbox.h*=e;for(let r=0;r<o.chld.length;r++)pe(o.chld[r],t,e,0,0,!0);o.bbox.x+=n,o.bbox.y+=i}}function js(o){let t=1/0,e=-1/0,n=1/0,i=-1/0;for(let l=0;l<o.length;l++)o[l].bbox&&(t=Math.min(t,o[l].bbox.x),n=Math.min(n,o[l].bbox.y),e=Math.max(e,o[l].bbox.x+o[l].bbox.w),i=Math.max(i,o[l].bbox.y+o[l].bbox.h));return{x:t,y:n,w:e-t,h:i-n}}function Aa(o){if(!o.length)return null;const t=js(o);for(let n=0;n<o.length;n++)o[n].bbox&&(o[n].bbox.x-=t.x,o[n].bbox.y-=t.y);return{type:"node",text:"",mode:"math",chld:o,bbox:t}}function _a(o,t="center"){for(let d=0;d<o.length;d++)if(o[d].text=="^"||o[d].text=="'"){let u=0,h=d;for(;h>0&&(o[h].text=="^"||o[h].text=="_"||o[h].text=="'");)h--;u=o[h].bbox.y,o[d].text=="'"?o[d].bbox.y=u:(pe(o[d],Se.SUB_SUP_SCALE,null,0,0),Wt[o[h].text]&&Wt[o[h].text].flags.big?o[d].bbox.y=u-o[d].bbox.h:o[h].text=="\\int"?o[d].bbox.y=u:o[d].bbox.y=u-o[d].bbox.h/2)}else if(o[d].text=="_"){let u=1,h=d;for(;h>0&&(o[h].text=="^"||o[h].text=="_"||o[h].text=="'");)h--;u=o[h].bbox.y+o[h].bbox.h,pe(o[d],Se.SUB_SUP_SCALE,null,0,0),Wt[o[h].text]&&Wt[o[h].text].flags.big?o[d].bbox.y=u:o[h].text=="\\int"?o[d].bbox.y=u-o[d].bbox.h:o[d].bbox.y=u-o[d].bbox.h/2}function e(d,u,h,R,T){let g=d,f=T,C=1/0,p=-1/0;for(;R>0?g<o.length:g>=0;){if(o[g].text==u)f++;else if(o[g].text==h){if(f--,f==0)break}else o[g].text=="^"||o[g].text=="_"||o[g].bbox&&(C=Math.min(C,o[g].bbox.y),p=Math.max(p,o[g].bbox.y+o[g].bbox.h));g+=R}return[C,p]}for(let d=0;d<o.length;d++)if(o[d].text=="\\left"){const[u,h]=e(d,"\\left","\\right",1,0);u!=1/0&&h!=-1/0&&(o[d].bbox.y=u,pe(o[d],1,(h-u)/o[d].bbox.h,0,0))}else if(o[d].text=="\\right"){const[u,h]=e(d,"\\right","\\left",-1,0);u!=1/0&&h!=-1/0&&(o[d].bbox.y=u,pe(o[d],1,(h-u)/o[d].bbox.h,0,0))}else if(o[d].text=="\\middle"){const[u,h]=e(d,"\\right","\\left",-1,1),[R,T]=e(d,"\\left","\\right",1,1),g=Math.min(u,R),f=Math.max(h,T);g!=1/0&&f!=-1/0&&(o[d].bbox.y=g,pe(o[d],1,(f-g)/o[d].bbox.h,0,0))}if(!o.some(d=>d.text=="&"||d.text=="\\\\"))return;const n=[];let i=[],l=[];for(let d=0;d<o.length;d++)o[d].text=="&"?(i.push(l),l=[]):o[d].text=="\\\\"?(l.length&&(i.push(l),l=[]),n.push(i),i=[]):l.push(o[d]);l.length&&i.push(l),i.length&&n.push(i);const r=[],a=[];for(let d=0;d<n.length;d++){const u=[];for(let h=0;h<n[d].length;h++){const R=Aa(n[d][h]);R&&(r[h]=r[h]||0,r[h]=Math.max(R.bbox.w+1,r[h])),u[h]=R}a.push(u)}const c=[];for(let d=0;d<a.length;d++){let u=1/0,h=-1/0;for(let R=0;R<a[d].length;R++)a[d][R]&&(u=Math.min(u,a[d][R].bbox.y),h=Math.max(h,a[d][R].bbox.y+a[d][R].bbox.h));c.push([u,h])}for(let d=0;d<c.length;d++)(c[d][0]==1/0||c[d][1]==1/0)&&(c[d][0]=d==0?0:c[d-1][1],c[d][1]=c[d][0]+2);for(let d=1;d<a.length;d++){const u=c[d-1][1]-c[d][0]+Se.LINE_SPACING;for(let h=0;h<a[d].length;h++)a[d][h]&&(a[d][h].bbox.y+=u);c[d][0]+=u,c[d][1]+=u}o.splice(0,o.length);for(let d=0;d<a.length;d++){let u=0;for(let h=0;h<a[d].length;h++){const R=a[d][h];if(!R){u+=r[h];continue}R.bbox.x+=u,u+=r[h]-R.bbox.w,t=="center"?R.bbox.x+=(r[h]-R.bbox.w)/2:t=="left"||(t=="right"||t=="equation"&&h!=a[d].length-1)&&(R.bbox.x+=r[h]-R.bbox.w),o.push(R)}}}function Ze(o,t="math"){const e={"\\text":"text","\\mathnormal":"math","\\mathrm":"rm","\\mathit":"it","\\mathbf":"bf","\\mathsf":"sf","\\mathtt":"tt","\\mathfrak":"frak","\\mathcal":"cal","\\mathbb":"bb","\\mathscr":"scr","\\rm":"rm","\\it":"it","\\bf":"bf","\\sf":"tt","\\tt":"tt","\\frak":"frak","\\cal":"cal","\\bb":"bb","\\scr":"scr"}[o.text]??t;if(!o.chld.length){if(Wt[o.text])if(Wt[o.text].flags.big)o.text=="\\lim"?o.bbox={x:0,y:0,w:3.5,h:2}:o.bbox={x:0,y:-.5,w:3,h:3};else if(Wt[o.text].flags.txt){let n=0;for(let i=1;i<o.text.length;i++)n+=Yn(Xo(o.text[i],"text")).w;n/=16,o.bbox={x:0,y:0,w:n,h:2}}else if(Wt[o.text].glyph){let n=Yn(Wt[o.text].glyph).w;n/=16,o.text=="\\int"||o.text=="\\oint"?o.bbox={x:0,y:-1.5,w:n,h:5}:o.bbox={x:0,y:0,w:n,h:2}}else o.bbox={x:0,y:0,w:1,h:2};else{let n=0;for(let i=0;i<o.text.length;i++)Yn(Xo(o.text[i],e))&&(e=="tt"?n+=16:n+=Yn(Xo(o.text[i],e)).w);n/=16,o.bbox={x:0,y:0,w:n,h:2}}o.mode=e;return}if(o.text=="\\frac"){const n=o.chld[0],i=o.chld[1],l=Se.FRAC_SCALE;Ze(n),Ze(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const r=Math.max(n.bbox.w,i.bbox.w)*l;pe(n,l,null,(r-n.bbox.w*l)/2,0),pe(i,l,null,(r-i.bbox.w*l)/2,n.bbox.h+Se.FRAC_SPACING),o.bbox={x:0,y:-n.bbox.h+1-Se.FRAC_SPACING/2,w:r,h:n.bbox.h+i.bbox.h+Se.FRAC_SPACING}}else if(o.text=="\\binom"){const n=o.chld[0],i=o.chld[1];Ze(n),Ze(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const l=Math.max(n.bbox.w,i.bbox.w);pe(n,1,null,(l-n.bbox.w)/2+1,0),pe(i,1,null,(l-i.bbox.w)/2+1,n.bbox.h),o.bbox={x:0,y:-n.bbox.h+1,w:l+2,h:n.bbox.h+i.bbox.h}}else if(o.text=="\\sqrt"){const n=o.chld[0];Ze(n);const i=o.chld[1];let l=0;i&&(Ze(i),l=Math.max(i.bbox.w*Se.SQRT_MAG_SCALE-.5,0),pe(i,Se.SQRT_MAG_SCALE,null,0,.5)),pe(n,1,null,1+l,.5),o.bbox={x:0,y:2-n.bbox.h-.5,w:n.bbox.w+1+l,h:n.bbox.h+.5}}else if(Wt[o.text]&&Wt[o.text].flags.hat){const n=o.chld[0];Ze(n);const i=n.bbox.y-.5;n.bbox.y=.5,o.bbox={x:0,y:i,w:n.bbox.w,h:n.bbox.h+.5}}else if(Wt[o.text]&&Wt[o.text].flags.mat){const n=o.chld[0];Ze(n),o.bbox={x:0,y:0,w:n.bbox.w,h:n.bbox.h+.5}}else{let n=0,i=0,l=1;for(let h=0;h<o.chld.length;h++){const R=o.chld[h],T={"\\quad":2,"\\,":6/18,"\\:":8/18,"\\;":10/18,"\\!":-6/18}[R.text]??null;if(R.text=="\\\\"){i+=l,n=0,l=1;continue}else{if(R.text=="&")continue;if(T!=null){n+=T;continue}else{if(Ze(R,e),pe(R,1,null,n,i),R.text=="^"||R.text=="_"||R.text=="'"){let g=h;for(;g>0&&(o.chld[g].text=="^"||o.chld[g].text=="_"||o.chld[g].text=="'");)g--;const f=Wt[o.chld[g].text]&&Wt[o.chld[g].text].flags.big;if(R.text=="'"){let C=g+1,p=0;for(;C<h;)o.chld[C].text=="'"&&p++,C++;R.bbox.x=o.chld[g].bbox.x+o.chld[g].bbox.w+R.bbox.w*p,n=Math.max(n,R.bbox.x+R.bbox.w)}else if(f){const C=o.chld[g].bbox.x+(o.chld[g].bbox.w-R.bbox.w*Se.SUB_SUP_SCALE)/2;R.bbox.x=C,n=Math.max(n,o.chld[g].bbox.x+o.chld[g].bbox.w+(R.bbox.w*Se.SUB_SUP_SCALE-o.chld[g].bbox.w)/2)}else R.bbox.x=o.chld[g].bbox.x+o.chld[g].bbox.w,n=Math.max(n,R.bbox.x+R.bbox.w*Se.SUB_SUP_SCALE)}else n+=R.bbox.w;t=="text"&&(n+=1),l=Math.max(R.bbox.y+R.bbox.h-i,l)}}}i+=l;const r={bmatrix:["[","]"],pmatrix:["(",")"],Bmatrix:["\\{","\\}"],cases:["\\{"]},a={bmatrix:"center",pmatrix:"center",Bmatrix:"center",cases:"left",matrix:"center",aligned:"equation"}[o.text]??"left",c=!!r[o.text],d=!!r[o.text]&&r[o.text].length>1;_a(o.chld,a);const u=js(o.chld);o.text=="\\text"&&(u.x-=1,u.w+=2);for(let h=0;h<o.chld.length;h++)pe(o.chld[h],1,null,-u.x+(c?1.5:0),-u.y);o.bbox={x:0,y:0,w:u.w+1.5*Number(c)+1.5*Number(d),h:u.h},c&&o.chld.unshift({type:"symb",text:r[o.text][0],mode:o.mode,chld:[],bbox:{x:0,y:0,w:1,h:u.h}}),d&&o.chld.push({type:"symb",text:r[o.text][1],mode:o.mode,chld:[],bbox:{x:u.w+2,y:0,w:1,h:u.h}}),(c||d||o.text=="matrix")&&(o.type="node",o.text="",o.bbox.y-=(o.bbox.h-2)/2)}}function Ba(o){function t(n,i,l){const r=[];if(n.bbox){if(i+=n.bbox.x,l+=n.bbox.y,n.text=="\\frac"){const a=n.chld[1].bbox.y-(n.chld[0].bbox.y+n.chld[0].bbox.h),c={type:"symb",mode:n.mode,text:"\\bar",bbox:{x:i,y:l+(n.chld[1].bbox.y-a/2)-a/2,w:n.bbox.w,h:a},chld:[]};r.push(c)}else if(n.text=="\\sqrt"){const a=n.chld[0].bbox.y,c=Math.max(0,n.chld[0].bbox.x-n.chld[0].bbox.h/2),d={type:"symb",mode:n.mode,text:"\\sqrt",bbox:{x:i+c,y:l+a/2,w:n.chld[0].bbox.x-c,h:n.bbox.h-a/2},chld:[]};r.push(d),r.push({type:"symb",text:"\\bar",mode:n.mode,bbox:{x:i+n.chld[0].bbox.x,y:l,w:n.bbox.w-n.chld[0].bbox.x,h:a},chld:[]})}else if(n.text=="\\binom"){const a=Math.min(n.chld[0].bbox.x,n.chld[1].bbox.x),c={type:"symb",mode:n.mode,text:"(",bbox:{x:i,y:l,w:a,h:n.bbox.h},chld:[]};r.push(c),r.push({type:"symb",text:")",mode:n.mode,bbox:{x:i+n.bbox.w-a,y:l,w:a,h:n.bbox.h},chld:[]})}else if(Wt[n.text]&&Wt[n.text].flags.hat){const a=n.chld[0].bbox.y,c={type:"symb",mode:n.mode,text:n.text,bbox:{x:i,y:l,w:n.bbox.w,h:a},chld:[]};r.push(c)}else if(Wt[n.text]&&Wt[n.text].flags.mat){const a=n.chld[0].bbox.h,c={type:"symb",text:n.text,mode:n.mode,bbox:{x:i,y:l+a,w:n.bbox.w,h:n.bbox.h-a},chld:[]};r.push(c)}else if(n.type!="node"&&n.text!="^"&&n.text!="_"){const a={type:n.type=="func"?"symb":n.type,text:n.text,mode:n.mode,bbox:{x:i,y:l,w:n.bbox.w,h:n.bbox.h},chld:[]};r.push(a)}}for(let a=0;a<n.chld.length;a++){const c=t(n.chld[a],i,l);r.push(...c)}return r}const e=t(o,-o.bbox.x,-o.bbox.y);o.type="node",o.text="",o.chld=e}function ka(o){const t=[];for(let e=0;e<o.chld.length;e++){const n=o.chld[e];let i=n.bbox.h/2,l=!1;if(Wt[n.text]&&Wt[n.text].flags.hat&&!Wt[n.text].flags.xfl&&!Wt[n.text].flags.yfl&&(i*=4,l=!0),Wt[n.text]&&Wt[n.text].glyph){const r=Yn(Wt[n.text].glyph);for(let a=0;a<r.polylines.length;a++){const c=[];for(let d=0;d<r.polylines[a].length;d++){let u=r.polylines[a][d][0],h=r.polylines[a][d][1];if(Wt[n.text].flags.xfl)u=(u-r.xmin)/Math.max(r.xmax-r.xmin,1)*n.bbox.w,u+=n.bbox.x;else if(r.w/16*i>n.bbox.w)u=u/Math.max(r.w,1)*n.bbox.w,u+=n.bbox.x;else{u=u/16*i;const R=(n.bbox.w-r.w/16*i)/2;u+=n.bbox.x+R}if(Wt[n.text].flags.yfl)h=(h-r.ymin)/Math.max(r.ymax-r.ymin,1)*n.bbox.h,h+=n.bbox.y;else{if(h=h/16*i,l){const R=(r.ymax+r.ymin)/2;h-=R/16*i}h+=n.bbox.y+n.bbox.h/2}c.push([u,h])}t.push(c)}}else if(Wt[n.text]&&Wt[n.text].flags.txt||n.type=="char"){let r=n.bbox.x;const a=!!(Wt[n.text]&&Wt[n.text].flags.txt);for(let c=Number(a);c<n.text.length;c++){const d=Yn(Xo(n.text[c],a?"text":n.mode));if(!d){console.warn("unmapped character: "+n.text[c]);continue}for(let u=0;u<d.polylines.length;u++){const h=[];for(let R=0;R<d.polylines[u].length;R++){let T=d.polylines[u][R][0],g=d.polylines[u][R][1];T/=16,g/=16,T*=i,g*=i,n.mode=="tt"&&(d.w>16?T*=16/d.w:T+=(16-d.w)/2/16),T+=r,g+=n.bbox.y+n.bbox.h/2,h.push([T,g])}t.push(h)}n.mode=="tt"?r+=i:r+=d.w/16*i}}}return t}function Qe(o){return Math.round(o*100)/100}class Ga{_latex;_tree;_tokens;_polylines;constructor(t){this._latex=t,this._tokens=Ka(t),this._tree=Xi(this._tokens),zs(this._tree.chld),Ze(this._tree),Ba(this._tree),this._polylines=ka(this._tree)}resolveScale(t){if(t==null)return[16,16,16,16];let e=t.SCALE_X??16,n=t.SCALE_Y??16;if(t.MIN_CHAR_H!=null){let r=0;for(let c=0;c<this._tree.chld.length;c++){const d=this._tree.chld[c];(d.type=="char"||Wt[d.text]&&(Wt[d.text].flags.txt||!Object.keys(Wt[d.text].flags).length))&&(r=Math.min(d.bbox.h,r))}const a=Math.max(1,t.MIN_CHAR_H/r);e*=a,n*=a}if(t.MAX_W!=null){const r=e;e=Math.min(e,t.MAX_W/this._tree.bbox.w),n*=e/r}if(t.MAX_H!=null){const r=n;n=Math.min(n,t.MAX_H/this._tree.bbox.h),e*=n/r}const i=t.MARGIN_X??e,l=t.MARGIN_Y??n;return[i,l,e,n]}polylines(t){t||(t={});const e=[],[n,i,l,r]=this.resolveScale(t);for(let a=0;a<this._polylines.length;a++){e.push([]);for(let c=0;c<this._polylines[a].length;c++){const[d,u]=this._polylines[a][c];e[e.length-1].push([n+d*l,i+u*r])}}return e}pathd(t){t||(t={});let e="";const[n,i,l,r]=this.resolveScale(t);for(let a=0;a<this._polylines.length;a++)for(let c=0;c<this._polylines[a].length;c++){const[d,u]=this._polylines[a][c];e+=c?"L":"M",e+=`${Qe(n+d*l)} ${Qe(i+u*r)}`}return e}svg(t){t||(t={});const[e,n,i,l]=this.resolveScale(t),r=Qe(this._tree.bbox.w*i+e*2),a=Qe(this._tree.bbox.h*l+n*2);let c=`<svg
13
+ </svg>`,a=new Image;return a.src=`data:image/svg+xml;base64,${Pa(r)}`,a}_drawImageWithCrop(t,e,n,i,l,r,a){if(n.imgCrop){const{x:c,y:d,width:u,height:h}=n.imgCrop;t.drawImage(e,c,d,u,h,i,l,r,a)}else t.drawImage(e,i,l,r,a)}_renderCaption(t,e,n,i,l,r){if(!e.imgCaption?.value)return;const{scale:a,imgCaption:c}=this.options;let d=e.imgCaption.value;if(d.includes("{imageNo}")){const I=this.draw.getOriginalMainElementList(),m=this._countImagesBeforeTarget(I,e)+1;d=d.replace(/\{imageNo\}/g,String(m))}const u=(e.imgCaption.size||c.size)*a,h=e.imgCaption.font||c.font,R=e.imgCaption.color||c.color;t.save(),t.font=`${u}px ${h}`,t.fillStyle=R,t.textAlign="center";let T=d;const g=t.measureText(d);if(g.width>l){let I=0,m=d.length;for(;I<m;){const L=Math.ceil((I+m)/2),O=d.substring(0,L);t.measureText(O+"...").width<=l?I=L:m=L-1}T=d.substring(0,I)+"..."}const f=(e.imgCaption.top??c.top)*a,C=i+r+f+g.actualBoundingBoxAscent,p=n+l/2;t.fillText(T,p,C),t.restore()}render(t,e,n,i){const{scale:l}=this.options,r=e.width*l,a=e.height*l;if(this.imageCache.has(e.value)){const c=this.imageCache.get(e.value);this._drawImageWithCrop(t,c,e,n,i,r,a),this._renderCaption(t,e,n,i,r,a)}else{const c=this.draw.getRenderCount(),d=new Promise((u,h)=>{const R=new Image;R.setAttribute("crossOrigin","Anonymous"),R.src=e.value,R.onload=()=>{this.imageCache.set(e.value,R),u(e),c===this.draw.getRenderCount()&&(e.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM?this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}):(this._drawImageWithCrop(t,R,e,n,i,r,a),this._renderCaption(t,e,n,i,r,a)))},R.onerror=T=>{const g=this.getFallbackImage(r,a);g.onload=()=>{this._drawImageWithCrop(t,g,e,n,i,r,a),this.imageCache.set(e.value,g),this._renderCaption(t,e,n,i,r,a)},h(T)}});this.addImageObserver(d)}}}const Fo=82;function wn(o){return Xi[o]==null&&Za(o),Xi[o]}function Za(o){const t=Qa[o];if(t==null)return;const e=t.substring(3,5),n=1*e.charCodeAt(0)-Fo,i=1*e.charCodeAt(1)-Fo,l=t.substring(5),r=[[]];let a=1/0,c=-1/0,d=1/0,u=-1/0,h=0;for(;h<l.length;){const R=l.substring(h,h+2);if(R==" R")r.push([]);else{const T=R.charCodeAt(0)-Fo-n,g=R.charCodeAt(1)-Fo;a=Math.min(g,a),c=Math.max(g,c),d=Math.min(T,d),u=Math.max(T,u),r[r.length-1].push([T,g])}h+=2}Xi[o]={w:i-n,xmin:d,xmax:u,ymin:a,ymax:c,polylines:r}}const Xi={},Qa={1:" 9MWRMNV RRMVV RPSTS",2:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",3:" 11MXVNTMRMPNOPOSPURVTVVU",4:" 12MWOMOV ROMRMTNUPUSTURVOV",5:" 12MWOMOV ROMUM ROQSQ ROVUV",6:" 9MVOMOV ROMUM ROQSQ",7:" 15MXVNTMRMPNOPOSPURVTVVUVR RSRVR",8:" 9MWOMOV RUMUV ROQUQ",9:" 3PTRMRV",10:" 7NUSMSTRVPVOTOS",11:" 9MWOMOV RUMOS RQQUV",12:" 6MVOMOV ROVUV",13:" 12LXNMNV RNMRV RVMRV RVMVV",14:" 9MWOMOV ROMUV RUMUV",15:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",16:" 10MWOMOV ROMSMUNUQSROR",17:" 17MXRMPNOPOSPURVSVUUVSVPUNSMRM RSTVW",18:" 13MWOMOV ROMSMUNUQSROR RRRUV",19:" 13MWUNSMQMONOOPPTRUSUUSVQVOU",20:" 6MWRMRV RNMVM",21:" 9MXOMOSPURVSVUUVSVM",22:" 6MWNMRV RVMRV",23:" 12LXNMPV RRMPV RRMTV RVMTV",24:" 6MWOMUV RUMOV",25:" 7MWNMRQRV RVMRQ",26:" 9MWUMOV ROMUM ROVUV",27:" 9MWRMNV RRMVV RPSTS",28:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",29:" 6MVOMOV ROMUM",30:" 9MWRMNV RRMVV RNVVV",31:" 12MWOMOV ROMUM ROQSQ ROVUV",32:" 9MWUMOV ROMUM ROVUV",33:" 9MWOMOV RUMUV ROQUQ",34:" 20MXRMPNOPOSPURVSVUUVSVPUNSMRM RQQTR RTQQR",35:" 3PTRMRV",36:" 9MWOMOV RUMOS RQQUV",37:" 6MWRMNV RRMVV",38:" 12LXNMNV RNMRV RVMRV RVMVV",39:" 9MWOMOV ROMUV RUMUV",40:" 12MWOMUM RPQTR RTQPR ROVUV",41:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",42:" 9MWOMOV RUMUV ROMUM",43:" 10MWOMOV ROMSMUNUQSROR",44:" 10MWOMRQOV ROMUM ROVUV",45:" 6MWRMRV RNMVM",46:" 15MWNONNOMPMQNRPRV RVOVNUMTMSNRP",47:" 13LXRMRV RPONPNSPTTTVSVPTOPO",48:" 6MWOMUV RUMOV",49:" 12LXRMRV RNOOPOSQTSTUSUPVO",50:" 13MXOVQVOROPPNRMSMUNVPVRTVVV",200:" 12MWRMPNOPOSPURVTUUSUPTNRM",201:" 4MWPORMRV",202:" 9MWONQMSMUNUPTROVUV",203:" 15MWONQMSMUNUPSQ RRQSQURUUSVQVOU",204:" 7MWSMSV RSMNSVS",205:" 14MWPMOQQPRPTQUSTURVQVOU RPMTM",206:" 14MWTMRMPNOPOSPURVTUUSTQRPPQOS",207:" 6MWUMQV ROMUM",208:" 19MWQMONOPQQSQUPUNSMQM RQQOROUQVSVUUURSQ",209:" 14MWUPTRRSPROPPNRMTNUPUSTURVPV",210:" 6PURURVSVSURU",211:" 7PUSVRVRUSUSWRY",212:" 12PURPRQSQSPRP RRURVSVSURU",213:" 13PURPRQSQSPRP RSVRVRUSUSWRY",214:" 12PURMRR RSMSR RRURVSVSURU",215:" 17NWPNRMSMUNUPRQRRSRSQUP RRURVSVSURU",216:" 3PTRMRQ",217:" 6NVPMPQ RTMTQ",218:" 10NVQMPNPPQQSQTPTNSMQM",219:" 16MWUNSMQMONOPQQTRUSUUSVQVOU RRLRW",220:" 3MWVLNW",221:" 7OVTLRNQPQSRUTW",222:" 7NUPLRNSPSSRUPW",223:" 3PTRLRW",224:" 3LXNRVR",225:" 6LXRNRV RNRVR",226:" 6LXNPVP RNTVT",227:" 6MWOOUU RUOOU",228:" 9MWRORU ROPUT RUPOT",229:" 6PURQRRSRSQRQ",230:" 7PUSMRORQSQSPRP",231:" 7PUSNRNRMSMSORQ",232:" 7LXSOVRSU RNRVR",233:" 12MXRLPW RULSW ROPVP ROSVS",234:" 21LXVRURTSSURVOVNUNSORRQSPSNRMPMONOPQSSUUVVV",235:" 20LXNNOQOSNV RVNUQUSVV RNNQOSOVN RNVQUSUVV",501:" 9I[RFJ[ RRFZ[ RMTWT",502:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",503:" 19H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZV",504:" 16G\\KFK[ RKFRFUGWIXKYNYSXVWXUZR[K[",505:" 12H[LFL[ RLFYF RLPTP RL[Y[",506:" 9HZLFL[ RLFYF RLPTP",507:" 23H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZVZS RUSZS",508:" 9G]KFK[ RYFY[ RKPYP",509:" 3NVRFR[",510:" 11JZVFVVUYTZR[P[NZMYLVLT",511:" 9G\\KFK[ RYFKT RPOY[",512:" 6HYLFL[ RL[X[",513:" 12F^JFJ[ RJFR[ RZFR[ RZFZ[",514:" 9G]KFK[ RKFY[ RYFY[",515:" 22G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF",516:" 14G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ",517:" 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RSWY]",518:" 17G\\KFK[ RKFTFWGXHYJYLXNWOTPKP RRPY[",519:" 21H\\YIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",520:" 6JZRFR[ RKFYF",521:" 11G]KFKULXNZQ[S[VZXXYUYF",522:" 6I[JFR[ RZFR[",523:" 12F^HFM[ RRFM[ RRFW[ R\\FW[",524:" 6H\\KFY[ RYFK[",525:" 7I[JFRPR[ RZFRP",526:" 9H\\YFK[ RKFYF RK[Y[",527:" 9I[RFJ[ RRFZ[ RMTWT",528:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",529:" 6HYLFL[ RLFXF",530:" 9I[RFJ[ RRFZ[ RJ[Z[",531:" 12H[LFL[ RLFYF RLPT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XWXXWZT[Q[NZMX",620:" 9MYRFRWSZU[W[ ROMVM",621:" 11I\\MMMWNZP[S[UZXW RXMX[",622:" 6JZLMR[ RXMR[",623:" 12G]JMN[ RRMN[ RRMV[ RZMV[",624:" 6J[MMX[ RXMM[",625:" 10JZLMR[ RXMR[P_NaLbKb",626:" 9J[XMM[ RMMXM RM[X[",627:" 24H]QMONMPLRKUKXLZN[P[RZUWWTYPZM RQMSMTNUPWXXZY[Z[",628:" 31I\\UFSGQIOMNPMTLZKb RUFWFYHYKXMWNUORO RROTPVRWTWWVYUZS[Q[OZNYMV",629:" 17I\\JPLNNMOMQNROSRSVR[ RZMYPXRR[P_Ob",630:" 24I[TMQMONMPLSLVMYNZP[R[TZVXWUWRVOTMRKQIQGRFTFVGXI",631:" 19JZWOVNTMQMONOPPRSS RSSOTMVMXNZP[S[UZWX",632:" 23JYTFRGQHQIRJUKXK RXKTMQONRMUMWNYP[S]T_TaSbQbP`",633:" 19H\\IQJOLMNMONOPNTL[ RNTPPRNTMVMXOXRWWTb",634:" 27G\\HQIOKMMMNNNPMUMXNZO[Q[SZUWVUWRXMXJWGUFSFRHRJSMUPWRZT",635:" 9LWRMPTOXOZP[R[TYUW",636:" 19I[OMK[ RYNXMWMUNQROSNS RNSPTQUSZT[U[VZ",637:" 9JZKFMFOGPHX[ RRML[",638:" 21H]OMIb RNQMVMYO[Q[SZUXWT RYMWTVXVZW[Y[[Y\\W",639:" 14I[LMOMNSMXL[ RYMXPWRUURXOZL[",640:" 29JZTFRGQHQIRJUKXK RUKRLPMOOOQQSTTVT RTTPUNVMXMZO\\S^T_TaRbPb",641:" 18J[RMPNNPMSMVNYOZQ[S[UZWXXUXRWOVNTMRM",642:" 13G]PML[ RUMVSWXX[ RIPKNNM[M",643:" 19I[MSMVNYOZQ[S[UZWXXUXRWOVNTMRMPNNPMSIb",644:" 18I][MQMONMPLSLVMYNZP[R[TZVXWUWRVOUNSM",645:" 8H\\SMP[ RJPLNOMZM",646:" 16H\\IQJO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QLT",707:" 6H\\YFO[ RKFYF",708:" 30H\\PFMGLILKMMONSOVPXRYTYWXYWZT[P[MZLYKWKTLRNPQOUNWMXKXIWGTFPF",709:" 24H\\XMWPURRSQSNRLPKMKLLINGQFRFUGWIXMXRWWUZR[P[MZLX",710:" 6MWRYQZR[SZRY",711:" 9MWSZR[QZRYSZS\\R^Q_",712:" 12MWRMQNROSNRM RRYQZR[SZRY",713:" 15MWRMQNROSNRM RSZR[QZRYSZS\\R^Q_",714:" 9MWRFRT RRYQZR[SZRY",715:" 21I[LKLJMHNGPFTFVGWHXJXLWNVORQRT RRYQZR[SZRY",716:" 3NVRFRM",717:" 6JZNFNM RVFVM",718:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",719:" 27H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",720:" 3G][BIb",721:" 11KYVBTDRGPKOPOTPYR]T`Vb",722:" 11KYNBPDRGTKUPUTTYR]P`Nb",723:" 3NVRBRb",724:" 3E_IR[R",725:" 6E_RIR[ RIR[R",726:" 6E_IO[O RIU[U",727:" 6G]KKYY RYKKY",728:" 9JZRLRX RMOWU RWOMU",729:" 6MWRQQRRSSRRQ",730:" 8MWSFRGQIQKRLSKRJ",731:" 8MWRHQGRFSGSIRKQL",732:" 9E_UMXP[RXTUW RIR[R",733:" 12H]SBLb RYBRb RLOZO RKUYU",734:" 35E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y",735:" 28G]IIJKKOKUJYI[ R[IZKYOYUZY[[ RIIKJOKUKYJ[I RI[KZOYUYYZ[[",737:" 6KYOBO[ RUBU[",738:" 6F^RBR[ RI[[[",739:" 4F^[BI[[[",740:" 18E_RIQJRKSJRI RIYHZI[JZIY R[YZZ[[\\Z[Y",741:" 33F^RHNLKPJSJUKWMXOXQWRU RRHVLYPZSZUYWWXUXSWRU RRUQYP\\ RRUSYT\\ RP\\T\\",742:" 26F^RNQKPINHMHKIJKJOKRLTNWR\\ RRNSKTIVHWHYIZKZOYRXTVWR\\",743:" 20F^RGPJLOIR RRGTJXO[R RIRLUPZR] R[RXUTZR]",744:" 48F^RTTWVXXXZW[U[SZQXPVPSQ RSQUOVMVKUISHQHOINKNMOOQQ RQQNPLPJQISIUJWLXNXPWRT RRTQYP\\ RRTSYT\\ RP\\T\\",745:" 55F^RRR[Q\\ RRVQ\\ RRIQHOHNINKONRR RRISHUHVIVKUNRR RRRNOLNJNIOIQJR RRRVOXNZN[O[QZR RRRNULVJVIUISJR RRRVUXVZV[U[SZR",746:" 55F^ISJSLTMVMXLZ RISIRJQLQMRNTNWMYLZ RRGPIOLOOQUQXPZR\\ RRGTIULUOSUSXTZR\\ R[S[RZQXQWRVTVWWYXZ R[SZSXTWVWXXZ RKVYV",750:" 18PSSRRSQSPRPQQPRPSQSSRUQV RQQQRRRRQQQ",751:" 16PTQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",752:" 9NVPOTU RTOPU RNRVR",753:" 28MWRKQMOPMR RRKSMUPWR RRMOQ RRMUQ RROPQ RROTQ RQQSQ RMRWR",754:" 26MWMRMQNOONQMSMUNVOWQWR RPNTN ROOUO RNPVP RNQVQ RMRWR",755:" 14LRLFLRRRLF RLIPQ RLLOR RLOMQ",756:" 10MWRKQMOPMR RRKSMUPWR",757:" 11MWWRWQVOUNSMQMONNOMQMR",758:" 13G]]R]P\\MZJWHTGPGMHJJHMGPGR",759:" 11MWMRMSNUOVQWSWUVVUWSWR",760:" 7LXLPNRQSSSVRXP",761:" 6RURUTTURTPRO",762:" 7RVRRUPVNVLUKTK",763:" 7NRRROPNNNLOKPK",764:" 21MWWHVGTFQFOGNHMJMLNNOOUSVTWVWXVZU[S\\P\\N[MZ",765:" 21G]IWHVGTGQHOINKMMMONPOTUUVWWYW[V\\U]S]P\\N[M",766:" 31G]RRTUUVWWYW[V\\U]S]Q\\O[NYMWMUNTOPUOVMWKWIVHUGSGQHOINKMMMONPORR",767:" 22H\\KFK[ RHF[FQP[Z RZV[Y\\[ RZVZY RWYZY RWYZZ\\[",768:" 30KYUARBPCNELHKLKRLUNWQXSXVWXUYR RKPLMNKQJSJVKXMYPYVXZV]T_R`Oa",796:" 3>f>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:" 18I[NII[ RVI[[ RMM[[ RWMI[ RNIVI RMMWM",864:" 21I[RGRV RMJWP RWJMP RIVL\\ R[VX\\ RIV[V RL\\X\\",865:" 11G[MJSV RKPSL RG\\[\\[RG\\",866:" 14LXPLPPLPLTPTPXTXTTXTXPTPTLPL",867:" 32KYYPXNVLSKQKNLLNKQKSLVNXQYSYVXXVYT RYPWNUMSMQNPOOQOSPUQVSWUWWVYT",868:" 10KYRJKVYVRJ RRZYNKNRZ",869:" 34G]PIPGQFSFTGTI RGZHXJVKTLPLKMJOIUIWJXKXPYTZV\\X]Z RGZ]Z RQZP[Q\\S\\T[SZ",870:" 64JZRMRS RRSQ\\ RRSS\\ RQ\\S\\ RRMQJPHNG RQJNG RRMSJTHVG RSJVG RRMNKLKJM RPLLLJ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cKcPbT`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:" 22LXUPVRVQUPSOQOOPNRNTOVRX RQOOQOTPVRXSYS[R\\P\\",1191:" 45I[VKWLXLVKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RZK[L[KYKWLVNSYR[Q\\ RYKXLWNTYS[Q\\O\\O[P\\ RLOYO",1192:" 38IZVKWLXLXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RVOTVTWUXWXXWYU RWOUVUWVX RLOWO",1193:" 38IZVKWL RXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RWKTVTWUXWXXWYU RXKUVUWVX RLOVO",1194:" 63F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L\\L\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ RZOXVXWYX[X\\W]U R[OYVYWZX RIO[O",1195:" 63F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L R\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ R[KXVXWYX[X\\W]U R\\KYVYWZX RIOZO",1196:" 20MWNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1200:" 28LYQKOLNONTOWQXTXVWWTWOVLTKQK RQKPLOOOTPWQX RTXUWVTVOULTK",1201:" 10LYPNSKSX RRLRX ROXVX",1202:" 35LYOMONNNNMOLQKTKVLWNVPTQQROSNUNX RTKULVNUPTQ RNWOVPVSWVWWV RPVSXVXWVWU",1203:" 39LYOMONNNNMOLQKTKVLWNVPTQ RTKULVNUPTQ RRQTQVRWTWUVWTXQXOWNVNUOUOV RTQURVTVUUWTX",1204:" 13LYSMSX RTKTX RTKMTXT RQXVX",1205:" 33LYOKNQ ROKVK ROLSLVK RNQOPQOTOVPWRWUVWTXQXOWNVNUOUOV RTOUPVRVUUWTX",1206:" 36LYVMVNWNWMVLTKRKPLOMNPNUOWQXTXVWWUWSVQTPQPNR RRKPMOPOUPWQX 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:" 23JZRRPQOQMRLTLUM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2019:" 34H\\XIYFYLXIVGSFPFMGKIKKLMMNOOUQWRYT RKKMMONUPWQXRYTYXWZT[Q[NZLXKUK[LX",2020:" 16I\\RFR[ RSFS[ RLFKLKFZFZLYF RO[V[",2021:" 23F^KFKULXNZQ[S[VZXXYUYF RLFLUMXOZQ[ RHFOF RVF\\F",2022:" 15H\\KFR[ RLFRX RYFR[ RIFOF RUF[F",2023:" 24F^JFN[ RKFNV RRFN[ RRFV[ RSFVV RZFV[ RGFNF RWF]F",2024:" 21H\\KFX[ RLFY[ RYFK[ RIFOF RUF[F RI[O[ RU[[[",2025:" 20H]KFRQR[ RLFSQS[ RZFSQ RIFOF RVF\\F RO[V[",2026:" 16H\\XFK[ RYFL[ RLFKLKFYF RK[Y[YUX[",2027:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2028:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2029:" 14I[NFN[ ROFO[ RKFZFZLYF RK[R[",2030:" 15H\\RFJ[ RRFZ[ RRIY[ RKZYZ RJ[Z[",2031:" 22G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[",2032:" 16H\\XFK[ RYFL[ RLFKLKFYF RK[Y[YUX[",2033:" 27F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RLPXP RH[O[ RU[\\[",2034:" 56G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF ROMOT RUMUT ROPUP ROQUQ",2035:" 12MXRFR[ RSFS[ ROFVF RO[V[",2036:" 27F\\KFK[ RLFL[ RYFLS RQOY[ RPOX[ RHFOF RUF[F RH[O[ RU[[[",2037:" 15H\\RFK[ RRFY[ RRIX[ RI[O[ RU[[[",2038:" 30F_KFK[ RLFRX RKFR[ RYFR[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FM[ RMPONRMTMWNXPX[ RTMVNWPW[ RIFMF RI[P[ RT[[[",2109:" 18MXRFQGRHSGRF RRMR[ RSMS[ ROMSM RO[V[",2110:" 25MXSFRGSHTGSF RTMT_SaQbObNaN`O_P`Oa RSMS_RaQb RPMTM",2111:" 27G\\LFL[ RMFM[ RWMMW RRSX[ RQSW[ RIFMF RTMZM RI[P[ RT[Z[",2112:" 12MXRFR[ RSFS[ ROFSF RO[V[",2113:" 44BcGMG[ RHMH[ RHPJNMMOMRNSPS[ ROMQNRPR[ RSPUNXMZM]N^P^[ RZM\\N]P][ RDMHM RD[K[ RO[V[ RZ[a[",2114:" 28G]LML[ RMMM[ RMPONRMTMWNXPX[ RTMVNWPW[ RIMMM RI[P[ RT[[[",2115:" 36H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM",2116:" 36G\\LMLb RMMMb RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIMMM RIbPb",2117:" 33H\\WMWb RXMXb RWPUNSMQMNNLPKSKULXNZQ[S[UZWX RQMONMPLSLUMXOZQ[ RTb[b",2118:" 23IZNMN[ ROMO[ ROSPPRNTMWMXNXOWPVOWN RKMOM RK[R[",2119:" 32J[WOXMXQWOVNTMPMNNMOMQNRPSUUWVXW RMPNQPRUTWUXVXYWZU[Q[OZNYMWM[NY",2120:" 16KZPFPWQZS[U[WZXX RQFQWRZS[ RMMUM",2121:" 28G]LMLXMZP[R[UZWX RMMMXNZP[ 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[W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" 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` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia",2269:" 50F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia RQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",2270:" 26F_\\S[UYVWVUUTTQPPONNLNJOIQISJULVNVPUQTTPUOWNYN[O\\Q\\S",2271:" 32F^[FI[ RNFPHPJOLMMKMIKIIJ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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[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NZMX",2620:" 16MXRFR[S[ RRFSFS[ ROMVMVN ROMONVN",2621:" 25H\\LMLWMZO[R[TZWW RLMMMMWNYPZRZTYWW RWMW[X[ RWMXMX[",2622:" 14JZLMR[ RLMMMRY RXMWMRY RXMR[",2623:" 26F^IMN[ RIMJMNX RRMNX RRPN[ RRPV[ RRMVX R[MZMVX R[MV[",2624:" 16I[LMW[X[ RLMMMX[ RXMWML[ RXMM[L[",2625:" 17JZLMR[ RLMMMRY RXMWMRYNb RXMR[ObNb",2626:" 20I[VNL[ RXMNZ RLMXM RLMLNVN RNZXZX[ RL[X[",2651:" 33K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRTXTZV[XZYY[V RWRUXUZV[",2652:" 23LZLVNSPO RSFMXMZO[P[RZTXUUURVVWWXWZV RTFNXNZO[",2653:" 22LXTSSTTTTSSRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[",2654:" 33K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RZFTXTZV[XZYY[V R[FUXUZV[",2655:" 23LXOYQXRWSUSSRRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[",2656:" 27OXRRUOWLXIXGWFUGTIKdKfLgNfOcPZQ[S[UZVYXV RTISNRRO[M`Kd",2657:" 38K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRPd RWRT[R`PdOfMgLfLdMaO_R]V[YY[V",2658:" 30L[LVNSPO RSFL[ RTFM[ ROUQSSRTRVSVUUXUZV[ RTRUSUUTXTZV[XZYY[V",2659:" 19NVSLRMSNTMSL RQROXOZQ[SZTYVV RRRPXPZQ[",2660:" 24NVSLRMSNTMSL RQRKd RRRO[M`KdJfHgGfGdHaJ_M]Q[TYVV",2661:" 31LZLVNSPO RSFL[ RTFM[ RURUSVSURTRRTOU ROURVSZT[ ROUQVRZT[U[XYZV",2662:" 17NVNVPSRO RUFOXOZQ[SZTYVV RVFPXPZQ[",2663:" 45E^EVG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 RTZS^",2714:" 24MXRFRTST RRFSFST RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",2715:" 58I\\LKLJMHNGQFTFWGXHYJYLXNWOUPRQ RLKMKMJNHQGTGWHXJXLWNUORP RMIPG RUGXI RXMTP RRPRTSTSP RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",2716:" 24MXTFRGQIQLRMSMTLTKSJRJQK RRKRLSLSKRK RRGQK RQIRJ",2717:" 24MXTHSIRIQHQGRFSFTGTJSLQM RRGRHSHSGRG RSITJ RTHSL",2718:" 71F_\\MZMXNWPUVTXSYQZMZKYJWJUKSLRQOSMTKTISGQFPFNGMIMKNNPQUWXZZ[\\[ R\\M\\NZNXO RYNXPVVUXSZQ[M[KZJYIWIUJSLQQNRMSKSIRG RSHQGPGNH ROGNINKONQQVWXYZZ\\Z\\[",2719:" 51I\\RBR_S_ RRBSBS_ RWIYIWGTFQFNGLILKMMNNVRWSXUXWWYTZQZOYNX RWIVHTGQGNHMIMKNMVQXSYUYWXYWZT[Q[NZLXNX RXXUZ",2720:" 8G^[BIbJb R[B\\BJb",2721:" 24KYUBSDQGOKNPNTOYQ]S`UbVb RUBVBTDRGPKOPOTPYR]T`Vb",2722:" 24KYNBPDRGTKUPUTTYR]P`NbOb RNBOBQDSGUKVPVTUYS]Q`Ob",2723:" 39JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO",2724:" 8F_JQ[Q[R RJQJR[R",2725:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",2726:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",2727:" 11NWSFRGRM RSGRM RSFTGRM",2728:" 22I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM",2729:" 30KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF",2750:" 42H]TFQGOIMLLOKSKVLYMZO[Q[TZVXXUYR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H RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[",3069:" 44G^ZH[H\\F[L[JZHYGVFRFOGMIMLNNPPVSWUWXVZ RNLONVRWT ROGNINKOMUPWRXTXWWYVZS[O[LZKYJWJUI[JYKY",3070:" 54G]TFN[ RUFO[ RVFP[ RMFKL R]F\\L RMF]F RK[S[ RNFKL RPFLI RRFMG RYF\\G RZF\\H R[F\\I R\\F\\L ROZL[ ROYM[ RPYQ[ ROZR[",3071:" 48F_NFKQJUJXKZN[R[UZWXXU\\G ROFLQKUKYLZ RPFMQLULYN[ RKFSF RYF_F RLFOG RMFNH RQFOH RRFOG RZF\\G R^F\\G",3072:" 35H\\NFNHOYO[ ROGPX RPFQW R[GO[ RLFSF RXF^F RMFNH RQFPH RRFOG RYF[G R]F[G",3073:" 57E_MFMHKYK[ RNGLX ROFMW RUFMWK[ RUFUHSYS[ RVGTX RWFUW R]GUWS[ RJFRF RUFWF RZF`F RKFNG RLFMH RPFNI RQFNG R[F]G R_F]G",3074:" 54G]NFT[ ROFU[ RPFV[ R[GIZ RLFSF RXF^F RF[L[ RQ[X[ RMFOH RQFPH RRFPG RYF[G R]F[G RIZG[ RIZK[ RTZR[ RTYS[ RUYW[",3075:" 51G]MFQPN[ RNFRPO[ ROFSPP[ R\\GSP RKFRF RYF_F RK[S[ RLFNG RPFOH RQFNG RZF\\G R^F\\G ROZL[ ROYM[ RPYQ[ ROZR[",3076:" 35G]ZFH[ R[FI[ R\\FJ[ R\\FNFLL RH[V[XU ROFLL RPFMI RRFNG RR[VZ RT[WX RU[XU",3101:" 54I]NPNOOOOQMQMONNPMTMVNWOXQXXYZZ[ RVOWQWXXZ RTMUNVPVXWZZ[[[ RVRUSPTMULWLXMZP[S[UZVX RNUMWMXNZ RUSQTOUNWNXOZP[",3102:" 47G\\LFL[MZOZ RMGMY RIFNFNZ RNPONQMSMVNXPYSYUXXVZS[Q[OZNX RWPXRXVWX RSMUNVOWRWVVYUZS[ RJFLG RKFLH",3103:" 34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[R[X RYPZRZW RWNXOYQYX RJ[MYPXTXWY RLZOYTYVZ RJ[NZSZU[WYYX[X RUOUX RURYR RUUYU",3503:" 69E]NGLHJJILHOHSIVJXMZP[S[VZXYZW[U RJKINISKWNYQZTZWY RNGLIKKJNJRKUNXQYTYWXYW[U RPJPV RQJQT RRIRSQUPV RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RWIWX",3504:" 72G^IFWFYGZIZX RKGWGYIYW RIFJGLHWHXIXX ROKNLMNMOKOJPJRKQMQMV RNMNT RKPNP ROKOSNUMV RI[LYOXSXVY RKZNYSYUZ RI[MZRZT[VYXXZX RRHRX RRMTNVNXM RRSTRVRXS",3505:" 94G]IHKFMFOGQF RLGNG RIHKGMHOHQF RNKMLLNLOJOIPIRJQLQLW RMMMU RJPMP RNKNTMVLW RQMRJSHTGVFXF[G RTHVGXGZH RRJSIUHWHYI[G RQURRSPTOVOXP RTPVPWQ RRRSQUQVRXP RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RQMQX",3506:" 91F]JHLFOFQGSF RMGPG RJHLGNHQHSF RPKOLNNNOLOKPKRLQNQNV ROMOT RLPOP RPKPSOUNV RSJSYRZQZMXKXIYG[ RTJTX RTPXP RPZOZMYJY RUIUOXO RXQUQUWTYP[N[LZJZG[ RSJUIXFZG\\G]F RWGYH[H RVHXIZI\\H]F RXIXW",3507:" 87E^NGLHJJILHOHRIUJWLYNZQ[U[XZZX[V[SZQYPWOUO RJKINISJV RNGLIKKJNJSKVLXNZ RYXZWZSYQ RU[WZXYYWYSXQWPUO RPJPW RQJQU RRIRTQVPW RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RYHUOU[ RUSYS RUVYV",3508:"112F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZOYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTG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 RNTNVOXQYRY RNPPPSOUNVMXOWPWXXYYY RONNOQO RTOWOVNVYWZ RMOOMPNROUPUYW[YY RMORT",3602:" 44I[LHMJMXKY RNJMHNGNXQZ RLHOFOXQYRZ RKYMYOZP[RZUYWY ROPROTNUMVNXOYOWPWY RTNVOVX RROSOUPUY",3603:" 35JXNONXLYMYOZP[ ROOOYQZ RPOPXRYSYQZP[ RNORNTMUNWOXO RSNTOVO RPORNTPVPXO",3604:" 41IZRMPNMOMXKY RNONXQZ RRMOOOXQYRZ RKYMYOZP[RZUYWY RMHPFQIWOWY RPINHOGPIVOVX RMHUPUY",3605:" 32JXNONXLYMYOZP[ ROOOYQZ RPOPXRYSYQZP[ RNORNTMWQURPU RSNVQ RPORNUR",3606:" 41JWNHNXLYMYOZP[ ROHOYQZ RPHPXRYSYQZP[ RNHQGSFTGVHWH RRGSHUH RPHQGSIUIWH RKMNM RPMTM",3607:" 56I[MOMXKYLYNZO[PZRYUX RNPNYPZ ROOOXQYRY RMOOORNTMUNWOYOWPW\\V_TaRbQaO`M` RSNVPV\\ RSaQ`P` RRNSOUPUZV]V_ RTaS`Q_O_M`",3608:" 47I[LHMJMXKYLYNZO[ RNJMHNGNYPZ RLHOFOXQYO[ ROPROTNUMVNXOYOWPWYU[T] RTNVOVYU[ RROSOUPUYT]T`UbVbT`",3609:" 35MWRFPHRITHRF RRGQHSHRG RRMQNOOQPQYS[UY RRPSORNQORPRYSZ RRMSNUOSPSXTYUY",3610:" 39MWRFPHRITHRF RRGQHSHRG RRMQNOOQPQYS[T] RRPSORNQORPRYS[ RRMSNUOSPSYT]T`RbPbPaRb",3611:" 50IZLHMJMXKYLYNZO[ RNJMHNGNYPZ RLHOFOXQYO[ ROPRNTMVPSROU RSNUP RRNTQ RSRTSVXWYXY RSSTTUYVZ RRSSTTYV[XY",3612:" 22MWPHQJQXOYPYRZS[ RRJQHRGRYTZ RPHSFSXUYVYTZS[",3613:" 67E_GOHOIPIXGYHYJZK[ RINJOJYLZ RGO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 59H[KOLONPOQSYTZV[XY RMNOOTYVZ RKOMMONPOTWUXWYXY RRSUMVNXNYM RUNVOWO RTOVPXOYM RQUN[MZKZJ[ RNZMYLY ROYMXKYJ[ RMTPT RSTVT",3625:" 60I[KOLOMPMXKY RLNNONYPZ RKOMMOOOXQYRY RKYLYNZO[PZRYUX RUMVNXOYOWPW\\V_TaRbQaO`M` RTNVOV\\ RSaQ`P` RUMSOUPUZV]V_ RTaS`Q_O_M`",3626:" 38I[XML[ RLONPQPTOXM RMNOOSO RLONMPNTNXM RL[PYSXVXXY RQYUYWZ RL[PZTZV[XY RNTVT",3700:" 42H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJYLYNZO[QZVYXY",3701:" 27H\\OHPIQKQXOY RQIPHQGRIRYTZ ROHRFSHSXUYVY ROYPYRZS[TZVY",3702:" 48H\\LHNHPGQFSGVHXH RPHRG RLHNIPIRHSG RVHVP RWIWO RXHXPQPNQLSKVK[ RK[OYSXVXZY RNZQYVYYZ RK[PZUZX[ZY",3703:" 57H\\LHMHOGPFRGVHXH ROHQG RLHNIPIRG RVHVO RWIWN RXHXOVOSPQQ RQPSQVRXRXY RWSWX RVRVY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3704:" 41H\\UFKPKUTU RVUZU[V[TZU RLPLT RMNMU RTGTXRY RUJVHUGUYWZ RUFWHVJVXXYYY RRYSYUZV[WZYY",3705:" 53H\\LFLO RLFXF RMGVG RLHUHWGXF RVLUMSNOOLO RSNTNVOVY RUMWNWX RVLWMYNZNXOXY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3706:" 59H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHRGTFUGWHXH RSGUH RRGTIVIXH RNPOPSOUNVM RSOTOVPVY RUNWPWX RVMWNYOZOXPXY RJYLYNZO[QZVYXY",3707:" 38H\\KHMFPGUGZF RLGOHTHWG RKHOIRIVHZF RZFYHWKSOQRPUPXQ[ RRQQTQWRZ RUMSPRSRVSYQ[",3708:" 71H\\LILO RMJMN RNINO RLINISHUGVF RSHTHVIVO RUGWHWN RVFWGYHZHXIXO RLONOVRXR RXOVONRLR RLRLXJY RMSMXPZ RNRNXPYQZ RVRVY RWSWX RXRXY RJYLYNZO[QZVYXY",3709:" 60H\\LHLQJR RMIMROS RNHNQPRQR RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJRKRMSNTOSQRUQVQ RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3710:" 11LXRXPZR[TZRX RRYQZSZRY",3711:" 14LXR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3712:" 22LXRMPORPTORM RRNQOSORN RRXPZR[TZRX RRYQZSZRY",3713:" 25LXRMPORPTORM RRNQOSORN RR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3714:" 30LXRFQGOHQIRT RRISHRGQHRIRT RRFSGUHSIRT RRXPZR[TZRX RRYQZSZRY",3715:" 51I[LJMHNGQFSFVGWHXJXLWNUPSQ RMJNH RVHWIWMVN RLJNKNIOGQF RSFUGVIVMUOSQ RRQRTSQQQRT RRXPZR[TZRX RRYQZSZRY",3716:" 14LXTFRGQIQKRMTKRIRG RRJRLSKRJ",3717:" 14LXRLRJPHRFSHSJRLPM RRGQHRIRG",3718:" 62E_YNZO[O\\N RXOYP[P RXPYQZQ[P\\N RYNST RRUL[HVNP ROOSKOFJLPRTXVZX[Z[[Z\\X RLZIV RRKOG RKLPQTWVYXZ[Z RMZIU RRLNG RKKQQUWVXXY[Y\\X",3719:" 60H\\PBP_ RTBT_ RTFVGWIWKYJXHWGTFPFMGKIKLLNOPURWSXUXXWZ RXJWH RLLMNOOUQWRXT RMYLW RMGLILKMMONUPXRYTYWXYWZT[P[MZLYKWMVMXNZP[",3720:" 8G^[BIbJb R[B\\BJb",3721:" 27KYUBSDQGOKNPNTOYQ]S`Ub RQHPKOOOUPYQ\\ RSDRFQIPOPUQ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T`UbVbT` RTNVPVYU[ RRNUQUZT]",3909:" 37MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQXPYR[ RRPSORNQORPRXQYRZSYRX RRMTOSPSXTYR[",3910:" 37MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQYT] RRPSORNQORPRYS[ RRMTOSPSZT]T`RbPaPbRb",3911:" 51IZNHLFMJMXLYN[ RNHNXMYNZOYNX RNHPFOJOXPYN[ ROPRNTMVPSROU RSNUP RRNTQ RRSSTTYV[XY RSSTUUYVZ RSRTSVXWYXY",3912:" 21MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[",3913:" 66E_GOHOIPIXHYJ[ RINJOJXIYJZKYJX RGOIMKOKXLYJ[ RKONNPMSOSXTYR[ RPNRORXQYRZSYRX RNNQPQXPYR[ RSOVNXM[O[X\\YZ[ RXNZOZXYYZZ[YZX RVNYPYXXYZ[",3914:" 44I[KOLOMPMXLYN[ RMNNONXMYNZOYNX RKOMMOOOXPYN[ ROORNTMWOWXXYV[ RTNVOVXUYVZWYVX RRNUPUXTYV[",3915:" 28JZMPMXP[UYWX RNPNXPZ ROOOWRZ RMPOOTMWPWX RTNVPVX RRNUQUY",3916:" 47IZLMMOMXKYMYM_LbN` RNON` RLMNNOOOXQYRZ RNYOYQZ ROZP[UYWX ROZO_PbN` ROORNTMWPWX RTNVPVX RRNUQUY",3917:" 31J[MPMXP[UY RNPNXPZ ROOOWRZ RMPOOTMWPW_XbV` RTNVPV` RRNUQU_TbV`",3918:" 31KXMONOOPOXNYP[ RONPOPXOYPZQYPX RMOOMQOQXRYP[ RQOUMWOUPSN RTNVO",3919:" 41JZMPMSOUURWTWX RNPNSOT ROOOSPT RUSVTVX RTSUTUY RMPSMVNTOQN RRNUN RWXQ[MYOXSZ ROYQZ",3920:" 27MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[ RNMQM RSMVM",3921:" 40I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPWXXYYY RVPWOVNUOVPVYWZ RVMTOUPUYW[YY",3922:" 36I[LMMOMXQ[SYWW RMNNONXQZ RLMNNOOOWRYSY RVMXOWPWW RVPWOVNUOVPVW RVMTOUPUX",3923:" 59E_HMIOIXM[OYQX RINJOJXMZ RHMJNKOKWNYOY RRMPOQPQXU[WY[W RRPSORNQORPRXUZ RRMTOSPSWVYWY RZM\\O[P[W RZP[OZNYOZPZW RZMXOYPYX",3924:" 39I[LONPUZV[XY RMNOOUYWZ RLONMONVXXY RXMVMVOXOXMVOSS RQUNYL[N[NYLYL[ RNTQT RSTVT",3925:" 49I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPW]V_U`SaQaO`MaObQa RVPWOVNUOVPV^U_ RPaNa RVMTOUPU^T`Sa",3926:" 43L[RNOPOORNTMWOWSRU RTNVOVS RRNUPUSTT RRUWWW]V_U`SaQaO`MaObQa RVWV^U_ RPaNa RTVUWU^T`Sa"},Wt={"\\frac":{glyph:0,arity:2,flags:{}},"\\binom":{glyph:0,arity:2,flags:{}},"\\sqrt":{glyph:2267,arity:1,flags:{opt:!0,xfl:!0,yfl:!0}},"^":{glyph:0,arity:1,flags:{}},_:{glyph:0,arity:1,flags:{}},"(":{glyph:2221,arity:0,flags:{yfl:!0}},")":{glyph:2222,arity:0,flags:{yfl:!0}},"[":{glyph:2223,arity:0,flags:{yfl:!0}},"]":{glyph:2224,arity:0,flags:{yfl:!0}},"\\langle":{glyph:2227,arity:0,flags:{yfl:!0}},"\\rangle":{glyph:2228,arity:0,flags:{yfl:!0}},"|":{glyph:2229,arity:0,flags:{yfl:!0}},"\\|":{glyph:2230,arity:0,flags:{yfl:!0}},"\\{":{glyph:2225,arity:0,flags:{yfl:!0}},"\\}":{glyph:2226,arity:0,flags:{yfl:!0}},"\\#":{glyph:2275,arity:0,flags:{}},"\\$":{glyph:2274,arity:0,flags:{}},"\\&":{glyph:2273,arity:0,flags:{}},"\\%":{glyph:2271,arity:0,flags:{}},"\\begin":{glyph:0,arity:1,flags:{}},"\\end":{glyph:0,arity:1,flags:{}},"\\left":{glyph:0,arity:1,flags:{}},"\\right":{glyph:0,arity:1,flags:{}},"\\middle":{glyph:0,arity:1,flags:{}},"\\cdot":{glyph:2236,arity:0,flags:{}},"\\pm":{glyph:2233,arity:0,flags:{}},"\\mp":{glyph:2234,arity:0,flags:{}},"\\times":{glyph:2235,arity:0,flags:{}},"\\div":{glyph:2237,arity:0,flags:{}},"\\leqq":{glyph:2243,arity:0,flags:{}},"\\geqq":{glyph:2244,arity:0,flags:{}},"\\leq":{glyph:2243,arity:0,flags:{}},"\\geq":{glyph:2244,arity:0,flags:{}},"\\propto":{glyph:2245,arity:0,flags:{}},"\\sim":{glyph:2246,arity:0,flags:{}},"\\equiv":{glyph:2240,arity:0,flags:{}},"\\dagger":{glyph:2277,arity:0,flags:{}},"\\ddagger":{glyph:2278,arity:0,flags:{}},"\\ell":{glyph:662,arity:0,flags:{}},"\\vec":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overrightarrow":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overleftarrow":{glyph:2263,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\bar":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\overline":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\widehat":{glyph:2247,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\hat":{glyph:2247,arity:1,flags:{hat:!0}},"\\acute":{glyph:2248,arity:1,flags:{hat:!0}},"\\grave":{glyph:2249,arity:1,flags:{hat:!0}},"\\breve":{glyph:2250,arity:1,flags:{hat:!0}},"\\tilde":{glyph:2246,arity:1,flags:{hat:!0}},"\\underline":{glyph:2231,arity:1,flags:{mat:!0,xfl:!0}},"\\not":{glyph:2220,arity:1,flags:{}},"\\neq":{glyph:2239,arity:1,flags:{}},"\\ne":{glyph:2239,arity:1,flags:{}},"\\exists":{glyph:2279,arity:0,flags:{}},"\\in":{glyph:2260,arity:0,flags:{}},"\\subset":{glyph:2256,arity:0,flags:{}},"\\supset":{glyph:2258,arity:0,flags:{}},"\\cup":{glyph:2257,arity:0,flags:{}},"\\cap":{glyph:2259,arity:0,flags:{}},"\\infty":{glyph:2270,arity:0,flags:{}},"\\partial":{glyph:2265,arity:0,flags:{}},"\\nabla":{glyph:2266,arity:0,flags:{}},"\\aleph":{glyph:2077,arity:0,flags:{}},"\\wp":{glyph:2190,arity:0,flags:{}},"\\therefore":{glyph:740,arity:0,flags:{}},"\\mid":{glyph:2229,arity:0,flags:{}},"\\sum":{glyph:2402,arity:0,flags:{big:!0}},"\\prod":{glyph:2401,arity:0,flags:{big:!0}},"\\bigoplus":{glyph:2284,arity:0,flags:{big:!0}},"\\bigodot":{glyph:2281,arity:0,flags:{big:!0}},"\\int":{glyph:2412,arity:0,flags:{yfl:!0}},"\\oint":{glyph:2269,arity:0,flags:{yfl:!0}},"\\oplus":{glyph:1284,arity:0,flags:{}},"\\odot":{glyph:1281,arity:0,flags:{}},"\\perp":{glyph:738,arity:0,flags:{}},"\\angle":{glyph:739,arity:0,flags:{}},"\\triangle":{glyph:842,arity:0,flags:{}},"\\Box":{glyph:841,arity:0,flags:{}},"\\rightarrow":{glyph:2261,arity:0,flags:{}},"\\to":{glyph:2261,arity:0,flags:{}},"\\leftarrow":{glyph:2263,arity:0,flags:{}},"\\gets":{glyph:2263,arity:0,flags:{}},"\\circ":{glyph:902,arity:0,flags:{}},"\\bigcirc":{glyph:904,arity:0,flags:{}},"\\bullet":{glyph:828,arity:0,flags:{}},"\\star":{glyph:856,arity:0,flags:{}},"\\diamond":{glyph:743,arity:0,flags:{}},"\\ast":{glyph:728,arity:0,flags:{}},"\\log":{glyph:0,arity:0,flags:{txt:!0}},"\\ln":{glyph:0,arity:0,flags:{txt:!0}},"\\exp":{glyph:0,arity:0,flags:{txt:!0}},"\\mod":{glyph:0,arity:0,flags:{txt:!0}},"\\lim":{glyph:0,arity:0,flags:{txt:!0,big:!0}},"\\sin":{glyph:0,arity:0,flags:{txt:!0}},"\\cos":{glyph:0,arity:0,flags:{txt:!0}},"\\tan":{glyph:0,arity:0,flags:{txt:!0}},"\\csc":{glyph:0,arity:0,flags:{txt:!0}},"\\sec":{glyph:0,arity:0,flags:{txt:!0}},"\\cot":{glyph:0,arity:0,flags:{txt:!0}},"\\sinh":{glyph:0,arity:0,flags:{txt:!0}},"\\cosh":{glyph:0,arity:0,flags:{txt:!0}},"\\tanh":{glyph:0,arity:0,flags:{txt:!0}},"\\csch":{glyph:0,arity:0,flags:{txt:!0}},"\\sech":{glyph:0,arity:0,flags:{txt:!0}},"\\coth":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsin":{glyph:0,arity:0,flags:{txt:!0}},"\\arccos":{glyph:0,arity:0,flags:{txt:!0}},"\\arctan":{glyph:0,arity:0,flags:{txt:!0}},"\\arccsc":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsec":{glyph:0,arity:0,flags:{txt:!0}},"\\arccot":{glyph:0,arity:0,flags:{txt:!0}},"\\text":{glyph:0,arity:1,flags:{}},"\\mathnormal":{glyph:0,arity:1,flags:{}},"\\mathrm":{glyph:0,arity:1,flags:{}},"\\mathit":{glyph:0,arity:1,flags:{}},"\\mathbf":{glyph:0,arity:1,flags:{}},"\\mathsf":{glyph:0,arity:1,flags:{}},"\\mathtt":{glyph:0,arity:1,flags:{}},"\\mathfrak":{glyph:0,arity:1,flags:{}},"\\mathcal":{glyph:0,arity:1,flags:{}},"\\mathbb":{glyph:0,arity:1,flags:{}},"\\mathscr":{glyph:0,arity:1,flags:{}},"\\rm":{glyph:0,arity:1,flags:{}},"\\it":{glyph:0,arity:1,flags:{}},"\\bf":{glyph:0,arity:1,flags:{}},"\\sf":{glyph:0,arity:1,flags:{}},"\\tt":{glyph:0,arity:1,flags:{}},"\\frak":{glyph:0,arity:1,flags:{}},"\\cal":{glyph:0,arity:1,flags:{}},"\\bb":{glyph:0,arity:1,flags:{}},"\\scr":{glyph:0,arity:1,flags:{}},"\\quad":{glyph:0,arity:0,flags:{}},"\\,":{glyph:0,arity:0,flags:{}},"\\.":{glyph:0,arity:0,flags:{}},"\\;":{glyph:0,arity:0,flags:{}},"\\!":{glyph:0,arity:0,flags:{}},"\\alpha":{glyph:2127,flags:{}},"\\beta":{glyph:2128,flags:{}},"\\gamma":{glyph:2129,flags:{}},"\\delta":{glyph:2130,flags:{}},"\\varepsilon":{glyph:2131,flags:{}},"\\zeta":{glyph:2132,flags:{}},"\\eta":{glyph:2133,flags:{}},"\\vartheta":{glyph:2134,flags:{}},"\\iota":{glyph:2135,flags:{}},"\\kappa":{glyph:2136,flags:{}},"\\lambda":{glyph:2137,flags:{}},"\\mu":{glyph:2138,flags:{}},"\\nu":{glyph:2139,flags:{}},"\\xi":{glyph:2140,flags:{}},"\\omicron":{glyph:2141,flags:{}},"\\pi":{glyph:2142,flags:{}},"\\rho":{glyph:2143,flags:{}},"\\sigma":{glyph:2144,flags:{}},"\\tau":{glyph:2145,flags:{}},"\\upsilon":{glyph:2146,flags:{}},"\\varphi":{glyph:2147,flags:{}},"\\chi":{glyph:2148,flags:{}},"\\psi":{glyph:2149,flags:{}},"\\omega":{glyph:2150,flags:{}},"\\epsilon":{glyph:2184,flags:{}},"\\theta":{glyph:2185,flags:{}},"\\phi":{glyph:2186,flags:{}},"\\varsigma":{glyph:2187,flags:{}},"\\Alpha":{glyph:2027,flags:{}},"\\Beta":{glyph:2028,flags:{}},"\\Gamma":{glyph:2029,flags:{}},"\\Delta":{glyph:2030,flags:{}},"\\Epsilon":{glyph:2031,flags:{}},"\\Zeta":{glyph:2032,flags:{}},"\\Eta":{glyph:2033,flags:{}},"\\Theta":{glyph:2034,flags:{}},"\\Iota":{glyph:2035,flags:{}},"\\Kappa":{glyph:2036,flags:{}},"\\Lambda":{glyph:2037,flags:{}},"\\Mu":{glyph:2038,flags:{}},"\\Nu":{glyph:2039,flags:{}},"\\Xi":{glyph:2040,flags:{}},"\\Omicron":{glyph:2041,flags:{}},"\\Pi":{glyph:2042,flags:{}},"\\Rho":{glyph:2043,flags:{}},"\\Sigma":{glyph:2044,flags:{}},"\\Tau":{glyph:2045,flags:{}},"\\Upsilon":{glyph:2046,flags:{}},"\\Phi":{glyph:2047,flags:{}},"\\Chi":{glyph:2048,flags:{}},"\\Psi":{glyph:2049,flags:{}},"\\Omega":{glyph:2050,flags:{}}};function Xo(o,t="math"){const e=o.charCodeAt(0);if(65<=e&&e<=90){const n=e-65;return t=="text"||t=="rm"?n+2001:t=="tt"?n+501:t=="bf"||t=="bb"?n+3001:t=="sf"?n+2501:t=="frak"?n+3301:t=="scr"||t=="cal"?n+2551:n+2051}if(97<=e&&e<=122){const n=e-97;return t=="text"||t=="rm"?n+2101:t=="tt"?n+601:t=="bf"||t=="bb"?n+3101:t=="sf"?n+2601:t=="frak"?n+3401:t=="scr"||t=="cal"?n+2651:n+2151}if(48<=e&&e<=57){const n=e-48;return t=="it"?n+2750:t=="bf"?n+3200:t=="tt"?n+700:n+2200}return{".":2210,",":2211,":":2212,";":2213,"!":2214,"?":2215,"'":2216,'"':2217,"*":2219,"/":2220,"-":2231,"+":2232,"=":2238,"<":2241,">":2242,"~":2246,"@":2273,"\\":804}[o]}const Se={SUB_SUP_SCALE:.5,SQRT_MAG_SCALE:.5,FRAC_SCALE:.85,LINE_SPACING:.5,FRAC_SPACING:.4};function Ka(o){o=o.replace(/\n/g," ");let t=0;const e=[];let n="";for(;t<o.length;)o[t]==" "?n.length&&(e.push(n),n=""):o[t]=="\\"?n.length==1&&n[0]=="\\"?(n+=o[t],e.push(n),n=""):(n.length&&e.push(n),n=o[t]):/[A-Za-z0-9\.]/.test(o[t])?n+=o[t]:(n.length&&n!="\\"&&(e.push(n),n=""),n+=o[t],e.push(n),n=""),t++;return n.length&&e.push(n),e}function Ha(o){return{type:Wt[o]?"symb":"char",mode:"math",text:o,chld:[],bbox:null}}function yi(o){let t=0,e={type:"node",text:"",mode:"math",chld:[],bbox:null};function n(){if(o[t]!="[")return null;let l=0,r=t;for(;r<o.length;){if(o[r]=="[")l++;else if(o[r]=="]"&&(l--,!l))break;r++}const a=yi(o.slice(t+1,r));return t=r,a}function i(l){let r=t,a=r,c=0,d=0;const u=[];for(;r<o.length;){if(o[r]=="{")c||(a=r),c++;else if(o[r]=="}"){if(c--,!c&&(u.push(yi(o.slice(a+1,r))),d++,d==l))break}else if(c==0&&(u.push(Ha(o[r])),d++,d==l))break;r++}return t=r,u}for(t=0;t<o.length;t++){const l=Wt[o[t]],r={type:"",text:o[t],mode:"math",chld:[],bbox:null};if(l)if(l.arity){t++,r.type="func";let a=null;l.flags.opt&&(a=n(),a&&t++);const c=i(l.arity);r.chld=c,a&&r.chld.push(a)}else r.type="symb";else o[t]=="{"?(r.type="node",r.text="",r.chld=i(1)):r.type="char";e.chld.push(r)}return e.chld.length==1&&(e=e.chld[0]),e}function zs(o){let t=0;for(;t<o.length;){if(o[t].text=="\\begin"){let e;for(e=t;e<o.length&&o[e].text!="\\end";e++);const n=o.splice(t+1,e-(t+1));zs(n),o[t].text=o[t].chld[0].text,o[t].chld=n,o.splice(t+1,1)}t++}}function Ce(o,t,e,n,i,l){if(e==null&&(e=t),!!o.bbox){l&&(o.bbox.x*=t,o.bbox.y*=e),o.bbox.w*=t,o.bbox.h*=e;for(let r=0;r<o.chld.length;r++)Ce(o.chld[r],t,e,0,0,!0);o.bbox.x+=n,o.bbox.y+=i}}function js(o){let t=1/0,e=-1/0,n=1/0,i=-1/0;for(let l=0;l<o.length;l++)o[l].bbox&&(t=Math.min(t,o[l].bbox.x),n=Math.min(n,o[l].bbox.y),e=Math.max(e,o[l].bbox.x+o[l].bbox.w),i=Math.max(i,o[l].bbox.y+o[l].bbox.h));return{x:t,y:n,w:e-t,h:i-n}}function Aa(o){if(!o.length)return null;const t=js(o);for(let n=0;n<o.length;n++)o[n].bbox&&(o[n].bbox.x-=t.x,o[n].bbox.y-=t.y);return{type:"node",text:"",mode:"math",chld:o,bbox:t}}function _a(o,t="center"){for(let d=0;d<o.length;d++)if(o[d].text=="^"||o[d].text=="'"){let u=0,h=d;for(;h>0&&(o[h].text=="^"||o[h].text=="_"||o[h].text=="'");)h--;u=o[h].bbox.y,o[d].text=="'"?o[d].bbox.y=u:(Ce(o[d],Se.SUB_SUP_SCALE,null,0,0),Wt[o[h].text]&&Wt[o[h].text].flags.big?o[d].bbox.y=u-o[d].bbox.h:o[h].text=="\\int"?o[d].bbox.y=u:o[d].bbox.y=u-o[d].bbox.h/2)}else if(o[d].text=="_"){let u=1,h=d;for(;h>0&&(o[h].text=="^"||o[h].text=="_"||o[h].text=="'");)h--;u=o[h].bbox.y+o[h].bbox.h,Ce(o[d],Se.SUB_SUP_SCALE,null,0,0),Wt[o[h].text]&&Wt[o[h].text].flags.big?o[d].bbox.y=u:o[h].text=="\\int"?o[d].bbox.y=u-o[d].bbox.h:o[d].bbox.y=u-o[d].bbox.h/2}function e(d,u,h,R,T){let g=d,f=T,C=1/0,p=-1/0;for(;R>0?g<o.length:g>=0;){if(o[g].text==u)f++;else if(o[g].text==h){if(f--,f==0)break}else o[g].text=="^"||o[g].text=="_"||o[g].bbox&&(C=Math.min(C,o[g].bbox.y),p=Math.max(p,o[g].bbox.y+o[g].bbox.h));g+=R}return[C,p]}for(let d=0;d<o.length;d++)if(o[d].text=="\\left"){const[u,h]=e(d,"\\left","\\right",1,0);u!=1/0&&h!=-1/0&&(o[d].bbox.y=u,Ce(o[d],1,(h-u)/o[d].bbox.h,0,0))}else if(o[d].text=="\\right"){const[u,h]=e(d,"\\right","\\left",-1,0);u!=1/0&&h!=-1/0&&(o[d].bbox.y=u,Ce(o[d],1,(h-u)/o[d].bbox.h,0,0))}else if(o[d].text=="\\middle"){const[u,h]=e(d,"\\right","\\left",-1,1),[R,T]=e(d,"\\left","\\right",1,1),g=Math.min(u,R),f=Math.max(h,T);g!=1/0&&f!=-1/0&&(o[d].bbox.y=g,Ce(o[d],1,(f-g)/o[d].bbox.h,0,0))}if(!o.some(d=>d.text=="&"||d.text=="\\\\"))return;const n=[];let i=[],l=[];for(let d=0;d<o.length;d++)o[d].text=="&"?(i.push(l),l=[]):o[d].text=="\\\\"?(l.length&&(i.push(l),l=[]),n.push(i),i=[]):l.push(o[d]);l.length&&i.push(l),i.length&&n.push(i);const r=[],a=[];for(let d=0;d<n.length;d++){const u=[];for(let h=0;h<n[d].length;h++){const R=Aa(n[d][h]);R&&(r[h]=r[h]||0,r[h]=Math.max(R.bbox.w+1,r[h])),u[h]=R}a.push(u)}const c=[];for(let d=0;d<a.length;d++){let u=1/0,h=-1/0;for(let R=0;R<a[d].length;R++)a[d][R]&&(u=Math.min(u,a[d][R].bbox.y),h=Math.max(h,a[d][R].bbox.y+a[d][R].bbox.h));c.push([u,h])}for(let d=0;d<c.length;d++)(c[d][0]==1/0||c[d][1]==1/0)&&(c[d][0]=d==0?0:c[d-1][1],c[d][1]=c[d][0]+2);for(let d=1;d<a.length;d++){const u=c[d-1][1]-c[d][0]+Se.LINE_SPACING;for(let h=0;h<a[d].length;h++)a[d][h]&&(a[d][h].bbox.y+=u);c[d][0]+=u,c[d][1]+=u}o.splice(0,o.length);for(let d=0;d<a.length;d++){let u=0;for(let h=0;h<a[d].length;h++){const R=a[d][h];if(!R){u+=r[h];continue}R.bbox.x+=u,u+=r[h]-R.bbox.w,t=="center"?R.bbox.x+=(r[h]-R.bbox.w)/2:t=="left"||(t=="right"||t=="equation"&&h!=a[d].length-1)&&(R.bbox.x+=r[h]-R.bbox.w),o.push(R)}}}function Ze(o,t="math"){const e={"\\text":"text","\\mathnormal":"math","\\mathrm":"rm","\\mathit":"it","\\mathbf":"bf","\\mathsf":"sf","\\mathtt":"tt","\\mathfrak":"frak","\\mathcal":"cal","\\mathbb":"bb","\\mathscr":"scr","\\rm":"rm","\\it":"it","\\bf":"bf","\\sf":"tt","\\tt":"tt","\\frak":"frak","\\cal":"cal","\\bb":"bb","\\scr":"scr"}[o.text]??t;if(!o.chld.length){if(Wt[o.text])if(Wt[o.text].flags.big)o.text=="\\lim"?o.bbox={x:0,y:0,w:3.5,h:2}:o.bbox={x:0,y:-.5,w:3,h:3};else if(Wt[o.text].flags.txt){let n=0;for(let i=1;i<o.text.length;i++)n+=wn(Xo(o.text[i],"text")).w;n/=16,o.bbox={x:0,y:0,w:n,h:2}}else if(Wt[o.text].glyph){let n=wn(Wt[o.text].glyph).w;n/=16,o.text=="\\int"||o.text=="\\oint"?o.bbox={x:0,y:-1.5,w:n,h:5}:o.bbox={x:0,y:0,w:n,h:2}}else o.bbox={x:0,y:0,w:1,h:2};else{let n=0;for(let i=0;i<o.text.length;i++)wn(Xo(o.text[i],e))&&(e=="tt"?n+=16:n+=wn(Xo(o.text[i],e)).w);n/=16,o.bbox={x:0,y:0,w:n,h:2}}o.mode=e;return}if(o.text=="\\frac"){const n=o.chld[0],i=o.chld[1],l=Se.FRAC_SCALE;Ze(n),Ze(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const r=Math.max(n.bbox.w,i.bbox.w)*l;Ce(n,l,null,(r-n.bbox.w*l)/2,0),Ce(i,l,null,(r-i.bbox.w*l)/2,n.bbox.h+Se.FRAC_SPACING),o.bbox={x:0,y:-n.bbox.h+1-Se.FRAC_SPACING/2,w:r,h:n.bbox.h+i.bbox.h+Se.FRAC_SPACING}}else if(o.text=="\\binom"){const n=o.chld[0],i=o.chld[1];Ze(n),Ze(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const l=Math.max(n.bbox.w,i.bbox.w);Ce(n,1,null,(l-n.bbox.w)/2+1,0),Ce(i,1,null,(l-i.bbox.w)/2+1,n.bbox.h),o.bbox={x:0,y:-n.bbox.h+1,w:l+2,h:n.bbox.h+i.bbox.h}}else if(o.text=="\\sqrt"){const n=o.chld[0];Ze(n);const i=o.chld[1];let l=0;i&&(Ze(i),l=Math.max(i.bbox.w*Se.SQRT_MAG_SCALE-.5,0),Ce(i,Se.SQRT_MAG_SCALE,null,0,.5)),Ce(n,1,null,1+l,.5),o.bbox={x:0,y:2-n.bbox.h-.5,w:n.bbox.w+1+l,h:n.bbox.h+.5}}else if(Wt[o.text]&&Wt[o.text].flags.hat){const n=o.chld[0];Ze(n);const i=n.bbox.y-.5;n.bbox.y=.5,o.bbox={x:0,y:i,w:n.bbox.w,h:n.bbox.h+.5}}else if(Wt[o.text]&&Wt[o.text].flags.mat){const n=o.chld[0];Ze(n),o.bbox={x:0,y:0,w:n.bbox.w,h:n.bbox.h+.5}}else{let n=0,i=0,l=1;for(let h=0;h<o.chld.length;h++){const R=o.chld[h],T={"\\quad":2,"\\,":6/18,"\\:":8/18,"\\;":10/18,"\\!":-6/18}[R.text]??null;if(R.text=="\\\\"){i+=l,n=0,l=1;continue}else{if(R.text=="&")continue;if(T!=null){n+=T;continue}else{if(Ze(R,e),Ce(R,1,null,n,i),R.text=="^"||R.text=="_"||R.text=="'"){let g=h;for(;g>0&&(o.chld[g].text=="^"||o.chld[g].text=="_"||o.chld[g].text=="'");)g--;const f=Wt[o.chld[g].text]&&Wt[o.chld[g].text].flags.big;if(R.text=="'"){let C=g+1,p=0;for(;C<h;)o.chld[C].text=="'"&&p++,C++;R.bbox.x=o.chld[g].bbox.x+o.chld[g].bbox.w+R.bbox.w*p,n=Math.max(n,R.bbox.x+R.bbox.w)}else if(f){const C=o.chld[g].bbox.x+(o.chld[g].bbox.w-R.bbox.w*Se.SUB_SUP_SCALE)/2;R.bbox.x=C,n=Math.max(n,o.chld[g].bbox.x+o.chld[g].bbox.w+(R.bbox.w*Se.SUB_SUP_SCALE-o.chld[g].bbox.w)/2)}else R.bbox.x=o.chld[g].bbox.x+o.chld[g].bbox.w,n=Math.max(n,R.bbox.x+R.bbox.w*Se.SUB_SUP_SCALE)}else n+=R.bbox.w;t=="text"&&(n+=1),l=Math.max(R.bbox.y+R.bbox.h-i,l)}}}i+=l;const r={bmatrix:["[","]"],pmatrix:["(",")"],Bmatrix:["\\{","\\}"],cases:["\\{"]},a={bmatrix:"center",pmatrix:"center",Bmatrix:"center",cases:"left",matrix:"center",aligned:"equation"}[o.text]??"left",c=!!r[o.text],d=!!r[o.text]&&r[o.text].length>1;_a(o.chld,a);const u=js(o.chld);o.text=="\\text"&&(u.x-=1,u.w+=2);for(let h=0;h<o.chld.length;h++)Ce(o.chld[h],1,null,-u.x+(c?1.5:0),-u.y);o.bbox={x:0,y:0,w:u.w+1.5*Number(c)+1.5*Number(d),h:u.h},c&&o.chld.unshift({type:"symb",text:r[o.text][0],mode:o.mode,chld:[],bbox:{x:0,y:0,w:1,h:u.h}}),d&&o.chld.push({type:"symb",text:r[o.text][1],mode:o.mode,chld:[],bbox:{x:u.w+2,y:0,w:1,h:u.h}}),(c||d||o.text=="matrix")&&(o.type="node",o.text="",o.bbox.y-=(o.bbox.h-2)/2)}}function Ba(o){function t(n,i,l){const r=[];if(n.bbox){if(i+=n.bbox.x,l+=n.bbox.y,n.text=="\\frac"){const a=n.chld[1].bbox.y-(n.chld[0].bbox.y+n.chld[0].bbox.h),c={type:"symb",mode:n.mode,text:"\\bar",bbox:{x:i,y:l+(n.chld[1].bbox.y-a/2)-a/2,w:n.bbox.w,h:a},chld:[]};r.push(c)}else if(n.text=="\\sqrt"){const a=n.chld[0].bbox.y,c=Math.max(0,n.chld[0].bbox.x-n.chld[0].bbox.h/2),d={type:"symb",mode:n.mode,text:"\\sqrt",bbox:{x:i+c,y:l+a/2,w:n.chld[0].bbox.x-c,h:n.bbox.h-a/2},chld:[]};r.push(d),r.push({type:"symb",text:"\\bar",mode:n.mode,bbox:{x:i+n.chld[0].bbox.x,y:l,w:n.bbox.w-n.chld[0].bbox.x,h:a},chld:[]})}else if(n.text=="\\binom"){const a=Math.min(n.chld[0].bbox.x,n.chld[1].bbox.x),c={type:"symb",mode:n.mode,text:"(",bbox:{x:i,y:l,w:a,h:n.bbox.h},chld:[]};r.push(c),r.push({type:"symb",text:")",mode:n.mode,bbox:{x:i+n.bbox.w-a,y:l,w:a,h:n.bbox.h},chld:[]})}else if(Wt[n.text]&&Wt[n.text].flags.hat){const a=n.chld[0].bbox.y,c={type:"symb",mode:n.mode,text:n.text,bbox:{x:i,y:l,w:n.bbox.w,h:a},chld:[]};r.push(c)}else if(Wt[n.text]&&Wt[n.text].flags.mat){const a=n.chld[0].bbox.h,c={type:"symb",text:n.text,mode:n.mode,bbox:{x:i,y:l+a,w:n.bbox.w,h:n.bbox.h-a},chld:[]};r.push(c)}else if(n.type!="node"&&n.text!="^"&&n.text!="_"){const a={type:n.type=="func"?"symb":n.type,text:n.text,mode:n.mode,bbox:{x:i,y:l,w:n.bbox.w,h:n.bbox.h},chld:[]};r.push(a)}}for(let a=0;a<n.chld.length;a++){const c=t(n.chld[a],i,l);r.push(...c)}return r}const e=t(o,-o.bbox.x,-o.bbox.y);o.type="node",o.text="",o.chld=e}function ka(o){const t=[];for(let e=0;e<o.chld.length;e++){const n=o.chld[e];let i=n.bbox.h/2,l=!1;if(Wt[n.text]&&Wt[n.text].flags.hat&&!Wt[n.text].flags.xfl&&!Wt[n.text].flags.yfl&&(i*=4,l=!0),Wt[n.text]&&Wt[n.text].glyph){const r=wn(Wt[n.text].glyph);for(let a=0;a<r.polylines.length;a++){const c=[];for(let d=0;d<r.polylines[a].length;d++){let u=r.polylines[a][d][0],h=r.polylines[a][d][1];if(Wt[n.text].flags.xfl)u=(u-r.xmin)/Math.max(r.xmax-r.xmin,1)*n.bbox.w,u+=n.bbox.x;else if(r.w/16*i>n.bbox.w)u=u/Math.max(r.w,1)*n.bbox.w,u+=n.bbox.x;else{u=u/16*i;const R=(n.bbox.w-r.w/16*i)/2;u+=n.bbox.x+R}if(Wt[n.text].flags.yfl)h=(h-r.ymin)/Math.max(r.ymax-r.ymin,1)*n.bbox.h,h+=n.bbox.y;else{if(h=h/16*i,l){const R=(r.ymax+r.ymin)/2;h-=R/16*i}h+=n.bbox.y+n.bbox.h/2}c.push([u,h])}t.push(c)}}else if(Wt[n.text]&&Wt[n.text].flags.txt||n.type=="char"){let r=n.bbox.x;const a=!!(Wt[n.text]&&Wt[n.text].flags.txt);for(let c=Number(a);c<n.text.length;c++){const d=wn(Xo(n.text[c],a?"text":n.mode));if(!d){console.warn("unmapped character: "+n.text[c]);continue}for(let u=0;u<d.polylines.length;u++){const h=[];for(let R=0;R<d.polylines[u].length;R++){let T=d.polylines[u][R][0],g=d.polylines[u][R][1];T/=16,g/=16,T*=i,g*=i,n.mode=="tt"&&(d.w>16?T*=16/d.w:T+=(16-d.w)/2/16),T+=r,g+=n.bbox.y+n.bbox.h/2,h.push([T,g])}t.push(h)}n.mode=="tt"?r+=i:r+=d.w/16*i}}}return t}function Qe(o){return Math.round(o*100)/100}class Ga{_latex;_tree;_tokens;_polylines;constructor(t){this._latex=t,this._tokens=Ka(t),this._tree=yi(this._tokens),zs(this._tree.chld),Ze(this._tree),Ba(this._tree),this._polylines=ka(this._tree)}resolveScale(t){if(t==null)return[16,16,16,16];let e=t.SCALE_X??16,n=t.SCALE_Y??16;if(t.MIN_CHAR_H!=null){let r=0;for(let c=0;c<this._tree.chld.length;c++){const d=this._tree.chld[c];(d.type=="char"||Wt[d.text]&&(Wt[d.text].flags.txt||!Object.keys(Wt[d.text].flags).length))&&(r=Math.min(d.bbox.h,r))}const a=Math.max(1,t.MIN_CHAR_H/r);e*=a,n*=a}if(t.MAX_W!=null){const r=e;e=Math.min(e,t.MAX_W/this._tree.bbox.w),n*=e/r}if(t.MAX_H!=null){const r=n;n=Math.min(n,t.MAX_H/this._tree.bbox.h),e*=n/r}const i=t.MARGIN_X??e,l=t.MARGIN_Y??n;return[i,l,e,n]}polylines(t){t||(t={});const e=[],[n,i,l,r]=this.resolveScale(t);for(let a=0;a<this._polylines.length;a++){e.push([]);for(let c=0;c<this._polylines[a].length;c++){const[d,u]=this._polylines[a][c];e[e.length-1].push([n+d*l,i+u*r])}}return e}pathd(t){t||(t={});let e="";const[n,i,l,r]=this.resolveScale(t);for(let a=0;a<this._polylines.length;a++)for(let c=0;c<this._polylines[a].length;c++){const[d,u]=this._polylines[a][c];e+=c?"L":"M",e+=`${Qe(n+d*l)} ${Qe(i+u*r)}`}return e}svg(t){t||(t={});const[e,n,i,l]=this.resolveScale(t),r=Qe(this._tree.bbox.w*i+e*2),a=Qe(this._tree.bbox.h*l+n*2);let c=`<svg
14
14
  xmlns="http://www.w3.org/2000/svg"
15
15
  width="${r}" height="${a}"
16
16
  fill="none" stroke="${t.FG_COLOR??"black"}" stroke-width="${t.STROKE_W??1}"
@@ -58,38 +58,38 @@ trailer
58
58
  >>startxref
59
59
 
60
60
  %%EOF
61
- `,c+d}boxes(t){t||(t={});const[e,n,i,l]=this.resolveScale(t),r=[];for(let a=0;a<this._tree.chld.length;a++){const{x:c,y:d,w:u,h}=this._tree.chld[a].bbox;r.push({x:e+c*i,y:n+d*l,w:u*i,h:h*l})}return r}box(t){t||(t={});const[e,n,i,l]=this.resolveScale(t);return{x:e+this._tree.bbox.x*i,y:n+this._tree.bbox.y*l,w:this._tree.bbox.w*i,h:this._tree.bbox.h*l}}}class qs extends $s{static convertLaTextToSVG(t){return new Ga(t).svg({SCALE_X:10,SCALE_Y:10,MARGIN_X:0,MARGIN_Y:0})}render(t,e,n,i){const{scale:l}=this.options,r=e.width*l,a=e.height*l;if(this.imageCache.has(e.value)){const c=this.imageCache.get(e.value);t.drawImage(c,n,i,r,a)}else{const c=new Promise((d,u)=>{const h=new Image;h.src=e.laTexSVG,h.onload=()=>{t.drawImage(h,n,i,r,a),this.imageCache.set(e.value,h),d(e)},h.onerror=R=>{u(R)}});this.addImageObserver(c)}}}s.ListType=void 0,(function(o){o.UL="ul",o.OL="ol"})(s.ListType||(s.ListType={}));var En;(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.CHECKBOX="checkbox"})(En||(En={}));var tr;(function(o){o.DECIMAL="decimal"})(tr||(tr={})),s.ListStyle=void 0,(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.DECIMAL="decimal",o.CHECKBOX="checkbox"})(s.ListStyle||(s.ListStyle={}));const xa={inheritStyle:!1},yi={[En.DISC]:"•",[En.CIRCLE]:"◦",[En.SQUARE]:"▫︎",[En.CHECKBOX]:"☑️"},Ja={[s.ListType.OL]:"ol",[s.ListType.UL]:"ul"},$a={[s.ListStyle.DISC]:"disc",[s.ListStyle.CIRCLE]:"circle",[s.ListStyle.SQUARE]:"square",[s.ListStyle.DECIMAL]:"decimal",[s.ListStyle.CHECKBOX]:"checkbox"};s.TitleLevel=void 0,(function(o){o.FIRST="first",o.SECOND="second",o.THIRD="third",o.FOURTH="fourth",o.FIFTH="fifth",o.SIXTH="sixth"})(s.TitleLevel||(s.TitleLevel={}));const za={defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},er={[s.TitleLevel.FIRST]:"defaultFirstSize",[s.TitleLevel.SECOND]:"defaultSecondSize",[s.TitleLevel.THIRD]:"defaultThirdSize",[s.TitleLevel.FOURTH]:"defaultFourthSize",[s.TitleLevel.FIFTH]:"defaultFifthSize",[s.TitleLevel.SIXTH]:"defaultSixthSize"},Ni={[s.TitleLevel.FIRST]:1,[s.TitleLevel.SECOND]:2,[s.TitleLevel.THIRD]:3,[s.TitleLevel.FOURTH]:4,[s.TitleLevel.FIFTH]:5,[s.TitleLevel.SIXTH]:6},ja={H1:s.TitleLevel.FIRST,H2:s.TitleLevel.SECOND,H3:s.TitleLevel.THIRD,H4:s.TitleLevel.FOURTH,H5:s.TitleLevel.FIFTH,H6:s.TitleLevel.SIXTH};s.BlockType=void 0,(function(o){o.IFRAME="iframe",o.VIDEO="video"})(s.BlockType||(s.BlockType={})),s.ControlType=void 0,(function(o){o.TEXT="text",o.SELECT="select",o.CHECKBOX="checkbox",o.RADIO="radio",o.DATE="date",o.NUMBER="number",o.TEXTFIELD="TextField",o.BUTTON="button",o.MENSTRUAL_HISTORY="menstrualHistory"})(s.ControlType||(s.ControlType={})),s.ControlComponent=void 0,(function(o){o.PREFIX="prefix",o.POSTFIX="postfix",o.PRE_TEXT="preText",o.PRETEXTFIX="preTextFix",o.PRETEXTFIX_TEXT="preTextFixText",o.POSTTEXTFIX="postTextFix",o.POSTTEXTFIX_TEXT="postTextFixText",o.POST_TEXT="postText",o.PLACEHOLDER="placeholder",o.TEXTFIXLABEL="textFixLabel",o.VALUE="value",o.DELETEPERSON="deletePerson",o.CHECKBOX="checkbox",o.RADIO="radio",o.UNDERLINE="underline"})(s.ControlComponent||(s.ControlComponent={})),s.ControlIndentation=void 0,(function(o){o.ROW_START="rowStart",o.VALUE_START="valueStart"})(s.ControlIndentation||(s.ControlIndentation={})),s.ControlState=void 0,(function(o){o.ACTIVE="active",o.INACTIVE="inactive"})(s.ControlState||(s.ControlState={}));var nr;(function(o){o.NUMBER="number",o.OPERATOR="operator",o.UTILITY="utility",o.EQUAL="equal"})(nr||(nr={})),s.EditorComponent=void 0,(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"})(s.EditorComponent||(s.EditorComponent={}));var Ke;(function(o){o.PAGE="page",o.TABLE="table"})(Ke||(Ke={})),s.EditorMode=void 0,(function(o){o.EDIT="edit",o.CLEAN="clean",o.READONLY="readonly",o.FORM="form",o.PRINT="print",o.COMPARE="compare",o.DESIGN="design",o.GRAFFITI="graffiti"})(s.EditorMode||(s.EditorMode={})),s.EditorZone=void 0,(function(o){o.HEADER="header",o.MAIN="main",o.FOOTER="footer"})(s.EditorZone||(s.EditorZone={})),s.PageMode=void 0,(function(o){o.PAGING="paging",o.CONTINUITY="continuity"})(s.PageMode||(s.PageMode={})),s.PaperDirection=void 0,(function(o){o.VERTICAL="vertical",o.HORIZONTAL="horizontal"})(s.PaperDirection||(s.PaperDirection={})),s.WordBreak=void 0,(function(o){o.BREAK_ALL="break-all",o.BREAK_WORD="break-word"})(s.WordBreak||(s.WordBreak={})),s.RenderMode=void 0,(function(o){o.SPEED="speed",o.COMPATIBILITY="compatibility"})(s.RenderMode||(s.RenderMode={})),s.TableBorder=void 0,(function(o){o.ALL="all",o.EMPTY="empty",o.EXTERNAL="external",o.INTERNAL="internal",o.DASH="dash"})(s.TableBorder||(s.TableBorder={})),s.TdBorder=void 0,(function(o){o.TOP="top",o.RIGHT="right",o.BOTTOM="bottom",o.LEFT="left"})(s.TdBorder||(s.TdBorder={})),s.TdSlash=void 0,(function(o){o.FORWARD="forward",o.BACK="back"})(s.TdSlash||(s.TdSlash={})),s.BackgroundSize=void 0,(function(o){o.CONTAIN="contain",o.COVER="cover"})(s.BackgroundSize||(s.BackgroundSize={})),s.BackgroundRepeat=void 0,(function(o){o.REPEAT="repeat",o.NO_REPEAT="no-repeat",o.REPEAT_X="repeat-x",o.REPEAT_Y="repeat-y"})(s.BackgroundRepeat||(s.BackgroundRepeat={}));const qa={color:"#FFFFFF",image:"",size:s.BackgroundSize.COVER,repeat:s.BackgroundRepeat.NO_REPEAT,applyPageNumbers:[]};s.VerticalAlign=void 0,(function(o){o.TOP="top",o.MIDDLE="middle",o.BOTTOM="bottom"})(s.VerticalAlign||(s.VerticalAlign={}));const tc={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff",verticalAlign:s.VerticalAlign.BOTTOM},ec={placeholderColor:"#9c9b9b",bracketColor:"#2284FE",textFixColor:"blue",prefix:"[",postfix:"]",preTextFix:"{",postTextFix:"}",textFixLabel:"",preTextFixText:"",postTextFixText:"",borderWidth:1,borderColor:"#000000",activeBackgroundColor:"",disabledBackgroundColor:"",existValueBackgroundColor:"",noValueBackgroundColor:"",inlineControlBackgroundColor:"#BFF7D7"},nc={bottom:30,inactiveAlpha:1,maxHeightRadio:s.MaxHeightRatio.HALF,disabled:!1,editable:!0},oc={opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!1,deletable:!0},ic={top:30,inactiveAlpha:1,maxHeightRadio:s.MaxHeightRatio.HALF,disabled:!1,editable:!0},sc={defaultColor:"#1976d2",defaultBackgroundColor:"#e3f2fd",defaultBorderRadius:4,defaultPadding:[4,4,4,4]},rc={color:"#666666",font:"Microsoft YaHei",size:12,top:5},lc={disabled:!0,color:"#CCCCCC",lineWidth:1.5},ac={font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},ro={PAGE_NO:"{pageNo}",PAGE_COUNT:"{pageCount}"},cc={bottom:60,size:12,font:"Microsoft YaHei",color:"#000000",rowFlex:s.RowFlex.CENTER,format:ro.PAGE_NO,numberType:s.NumberType.ARABIC,disabled:!1,startPageNo:1,fromPageNo:0,maxPageNo:null},or={data:"",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},dc={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000",verticalAlign:s.VerticalAlign.BOTTOM},uc={lineWidth:1,strokeStyle:"#000000"},hc={tdPadding:[5,5,5,5],defaultTrMinHeight:24,defaultColMinWidth:40,defaultBorderColor:"#000000",overflow:!0};s.WatermarkType=void 0,(function(o){o.TEXT="text",o.IMAGE="image"})(s.WatermarkType||(s.WatermarkType={}));const bi={data:"",type:s.WatermarkType.TEXT,width:0,height:0,color:"#AEB5C0",opacity:.3,size:200,font:"Microsoft YaHei",repeat:!1,gap:[10,10],numberType:s.NumberType.ARABIC},Rc={tipDisabled:!0};s.LineNumberType=void 0,(function(o){o.PAGE="page",o.CONTINUITY="continuity"})(s.LineNumberType||(s.LineNumberType={}));const gc={size:12,font:"Microsoft YaHei",color:"#000000",disabled:!0,right:20,type:s.LineNumberType.CONTINUITY},Tc={color:"#000000",lineWidth:1,padding:[0,5,0,5],disabled:!0},fc={top:0,left:5},mc={defaultLineColor:"#000000",defaultLineWidth:2},Cc={disabled:!0,color:"#CCCCCC",radius:1};function yo(o={}){const t={...hc,...o.table},e={...ic,...o.header},n={...nc,...o.footer},i={...cc,...o.pageNumber},l={...bi,...o.watermark},r={...ec,...o.control},a={...tc,...o.checkbox},c={...dc,...o.radio},d={...Fa,...o.cursor},u={...za,...o.title},h={...or,...o.placeholder},R={...oc,...o.group},T={...ac,...o.pageBreak},g={...Rc,...o.zone},f={...qa,...o.background},C={...lc,...o.lineBreak},p={...Cc,...o.whiteSpace},I={...uc,...o.separator},m={...gc,...o.lineNumber},L={...Tc,...o.pageBorder},O={...fc,...o.badge},P={...mc,...o.graffiti},S={...sc,...o.label},y={...rc,...o.imgCaption},Y={...xa,...o.list},b={print:{...Do.print,...o.modeRule?.print},compare:{...Do.compare,...o.modeRule?.compare},readonly:{...Do.readonly,...o.modeRule?.readonly},form:{...Do.form,...o.modeRule?.form}};return{mode:s.EditorMode.EDIT,locale:"zhCN",defaultType:"TEXT",defaultColor:"#000000",defaultFont:"SimSun",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,highlightMarginHeight:8,resizerColor:"#4182D9",resizerSize:5,marginIndicatorSize:35,marginIndicatorColor:"#BABABA",margins:[75.591,56.693,56.693,56.693],pageMode:s.PageMode.PAGING,renderMode:s.RenderMode.SPEED,defaultHyperlinkColor:"#0000FF",paperDirection:s.PaperDirection.VERTICAL,inactiveAlpha:.6,historyMaxRecordCount:100,wordBreak:s.WordBreak.BREAK_WORD,printPixelRatio:3,maskMargin:[0,0,0,0],letterClass:[Ti.ENGLISH,Ti.NUMBER],contextMenuDisableKeys:[],shortcutDisableKeys:[],scrollContainerSelector:"",pageOuterSelectionDisable:!1,...o,table:t,header:e,footer:n,pageNumber:i,watermark:l,control:r,checkbox:a,radio:c,cursor:d,title:u,placeholder:h,group:R,pageBreak:T,zone:g,background:f,lineBreak:C,whiteSpace:p,separator:I,lineNumber:m,pageBorder:L,badge:O,modeRule:b,graffiti:P,label:S,imgCaption:y,list:Y,performance:{enabled:!1,threshold:16,...o.performance}}}const ir=new Map,pc=[s.ControlType.SELECT,s.ControlType.DATE,s.ControlType.CHECKBOX,s.ControlType.RADIO];function be(o,t){return o&&pc.includes(o)?[""]:Nt(t)}function sr(o){return ir.get(o)}function No(o,t){ir.set(o,t)}function lo(o){return o?.controlId?{controlId:o.controlId,originControlId:o.originControlId||null,subTemplateInstanceId:o.subTemplateInstanceId||o.subTemplateParentId||null}:null}function kt(o,t){const e=lo(o),n=lo(t);return!!(e&&n&&e.controlId===n.controlId&&e.originControlId===n.originControlId&&e.subTemplateInstanceId===n.subTemplateInstanceId)}function Vi(o){const t=[];for(let e=0;e<o.length;e++){const n=o[e],i=Nt(n.value);for(let l=0;l<i.length;l++)t.push({...n,value:i[l]})}return t}const rr=new Set([s.ControlComponent.PREFIX,s.ControlComponent.POSTFIX,s.ControlComponent.PRE_TEXT,s.ControlComponent.POST_TEXT,s.ControlComponent.PRETEXTFIX,s.ControlComponent.PRETEXTFIX_TEXT,s.ControlComponent.POSTTEXTFIX,s.ControlComponent.POSTTEXTFIX_TEXT,s.ControlComponent.PLACEHOLDER,s.ControlComponent.TEXTFIXLABEL,s.ControlComponent.CHECKBOX,s.ControlComponent.RADIO,s.ControlComponent.UNDERLINE]),Ic=["请选择","双击获取日期","格式化日期时间"],Ec=" ";function Wi(o){return(o||[]).map(t=>t.value===_?`
62
- `:t.value||"").join("")}function wn(o){const t=Number(o?.indentChars??0);return{newline:o?.newline===!0,indentChars:Math.max(0,Math.min(20,Number.isFinite(t)?Math.floor(t):0))}}function me(o){return o?.buttonValueLayout===!0}function Ln(o,t){const e=Nt(o),n=wn(t?.valueLayout),i=n.indentChars>0;if(!n.newline&&!i||!e.length)return e.map(c=>({value:c}));const l=[],r=(c,d=!1)=>{Nt(c).forEach((u,h)=>{const R={value:u,buttonValueLayout:!0};d&&h===0&&Object.assign(R,{buttonValueLayoutPrefixOffset:!0}),l.push(R)})},a=Ec.repeat(n.indentChars);return n.newline?r(`
61
+ `,c+d}boxes(t){t||(t={});const[e,n,i,l]=this.resolveScale(t),r=[];for(let a=0;a<this._tree.chld.length;a++){const{x:c,y:d,w:u,h}=this._tree.chld[a].bbox;r.push({x:e+c*i,y:n+d*l,w:u*i,h:h*l})}return r}box(t){t||(t={});const[e,n,i,l]=this.resolveScale(t);return{x:e+this._tree.bbox.x*i,y:n+this._tree.bbox.y*l,w:this._tree.bbox.w*i,h:this._tree.bbox.h*l}}}class qs extends $s{static convertLaTextToSVG(t){return new Ga(t).svg({SCALE_X:10,SCALE_Y:10,MARGIN_X:0,MARGIN_Y:0})}render(t,e,n,i){const{scale:l}=this.options,r=e.width*l,a=e.height*l;if(this.imageCache.has(e.value)){const c=this.imageCache.get(e.value);t.drawImage(c,n,i,r,a)}else{const c=new Promise((d,u)=>{const h=new Image;h.src=e.laTexSVG,h.onload=()=>{t.drawImage(h,n,i,r,a),this.imageCache.set(e.value,h),d(e)},h.onerror=R=>{u(R)}});this.addImageObserver(c)}}}s.ListType=void 0,(function(o){o.UL="ul",o.OL="ol"})(s.ListType||(s.ListType={}));var En;(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.CHECKBOX="checkbox"})(En||(En={}));var tr;(function(o){o.DECIMAL="decimal"})(tr||(tr={})),s.ListStyle=void 0,(function(o){o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.DECIMAL="decimal",o.CHECKBOX="checkbox"})(s.ListStyle||(s.ListStyle={}));const xa={inheritStyle:!1},Ni={[En.DISC]:"•",[En.CIRCLE]:"◦",[En.SQUARE]:"▫︎",[En.CHECKBOX]:"☑️"},Ja={[s.ListType.OL]:"ol",[s.ListType.UL]:"ul"},$a={[s.ListStyle.DISC]:"disc",[s.ListStyle.CIRCLE]:"circle",[s.ListStyle.SQUARE]:"square",[s.ListStyle.DECIMAL]:"decimal",[s.ListStyle.CHECKBOX]:"checkbox"};s.TitleLevel=void 0,(function(o){o.FIRST="first",o.SECOND="second",o.THIRD="third",o.FOURTH="fourth",o.FIFTH="fifth",o.SIXTH="sixth"})(s.TitleLevel||(s.TitleLevel={}));const za={defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},er={[s.TitleLevel.FIRST]:"defaultFirstSize",[s.TitleLevel.SECOND]:"defaultSecondSize",[s.TitleLevel.THIRD]:"defaultThirdSize",[s.TitleLevel.FOURTH]:"defaultFourthSize",[s.TitleLevel.FIFTH]:"defaultFifthSize",[s.TitleLevel.SIXTH]:"defaultSixthSize"},bi={[s.TitleLevel.FIRST]:1,[s.TitleLevel.SECOND]:2,[s.TitleLevel.THIRD]:3,[s.TitleLevel.FOURTH]:4,[s.TitleLevel.FIFTH]:5,[s.TitleLevel.SIXTH]:6},ja={H1:s.TitleLevel.FIRST,H2:s.TitleLevel.SECOND,H3:s.TitleLevel.THIRD,H4:s.TitleLevel.FOURTH,H5:s.TitleLevel.FIFTH,H6:s.TitleLevel.SIXTH};s.BlockType=void 0,(function(o){o.IFRAME="iframe",o.VIDEO="video"})(s.BlockType||(s.BlockType={})),s.ControlType=void 0,(function(o){o.TEXT="text",o.SELECT="select",o.CHECKBOX="checkbox",o.RADIO="radio",o.DATE="date",o.NUMBER="number",o.TEXTFIELD="TextField",o.BUTTON="button",o.MENSTRUAL_HISTORY="menstrualHistory"})(s.ControlType||(s.ControlType={})),s.ControlComponent=void 0,(function(o){o.PREFIX="prefix",o.POSTFIX="postfix",o.PRE_TEXT="preText",o.PRETEXTFIX="preTextFix",o.PRETEXTFIX_TEXT="preTextFixText",o.POSTTEXTFIX="postTextFix",o.POSTTEXTFIX_TEXT="postTextFixText",o.POST_TEXT="postText",o.PLACEHOLDER="placeholder",o.TEXTFIXLABEL="textFixLabel",o.VALUE="value",o.DELETEPERSON="deletePerson",o.CHECKBOX="checkbox",o.RADIO="radio",o.UNDERLINE="underline"})(s.ControlComponent||(s.ControlComponent={})),s.ControlIndentation=void 0,(function(o){o.ROW_START="rowStart",o.VALUE_START="valueStart"})(s.ControlIndentation||(s.ControlIndentation={})),s.ControlState=void 0,(function(o){o.ACTIVE="active",o.INACTIVE="inactive"})(s.ControlState||(s.ControlState={}));var nr;(function(o){o.NUMBER="number",o.OPERATOR="operator",o.UTILITY="utility",o.EQUAL="equal"})(nr||(nr={})),s.EditorComponent=void 0,(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"})(s.EditorComponent||(s.EditorComponent={}));var Ke;(function(o){o.PAGE="page",o.TABLE="table"})(Ke||(Ke={})),s.EditorMode=void 0,(function(o){o.EDIT="edit",o.CLEAN="clean",o.READONLY="readonly",o.FORM="form",o.PRINT="print",o.COMPARE="compare",o.DESIGN="design",o.GRAFFITI="graffiti"})(s.EditorMode||(s.EditorMode={})),s.EditorZone=void 0,(function(o){o.HEADER="header",o.MAIN="main",o.FOOTER="footer"})(s.EditorZone||(s.EditorZone={})),s.PageMode=void 0,(function(o){o.PAGING="paging",o.CONTINUITY="continuity"})(s.PageMode||(s.PageMode={})),s.PaperDirection=void 0,(function(o){o.VERTICAL="vertical",o.HORIZONTAL="horizontal"})(s.PaperDirection||(s.PaperDirection={})),s.WordBreak=void 0,(function(o){o.BREAK_ALL="break-all",o.BREAK_WORD="break-word"})(s.WordBreak||(s.WordBreak={})),s.RenderMode=void 0,(function(o){o.SPEED="speed",o.COMPATIBILITY="compatibility"})(s.RenderMode||(s.RenderMode={})),s.TableBorder=void 0,(function(o){o.ALL="all",o.EMPTY="empty",o.EXTERNAL="external",o.INTERNAL="internal",o.DASH="dash"})(s.TableBorder||(s.TableBorder={})),s.TdBorder=void 0,(function(o){o.TOP="top",o.RIGHT="right",o.BOTTOM="bottom",o.LEFT="left"})(s.TdBorder||(s.TdBorder={})),s.TdSlash=void 0,(function(o){o.FORWARD="forward",o.BACK="back"})(s.TdSlash||(s.TdSlash={})),s.BackgroundSize=void 0,(function(o){o.CONTAIN="contain",o.COVER="cover"})(s.BackgroundSize||(s.BackgroundSize={})),s.BackgroundRepeat=void 0,(function(o){o.REPEAT="repeat",o.NO_REPEAT="no-repeat",o.REPEAT_X="repeat-x",o.REPEAT_Y="repeat-y"})(s.BackgroundRepeat||(s.BackgroundRepeat={}));const qa={color:"#FFFFFF",image:"",size:s.BackgroundSize.COVER,repeat:s.BackgroundRepeat.NO_REPEAT,applyPageNumbers:[]};s.VerticalAlign=void 0,(function(o){o.TOP="top",o.MIDDLE="middle",o.BOTTOM="bottom"})(s.VerticalAlign||(s.VerticalAlign={}));const tc={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff",verticalAlign:s.VerticalAlign.BOTTOM},ec={placeholderColor:"#9c9b9b",bracketColor:"#2284FE",textFixColor:"blue",prefix:"[",postfix:"]",preTextFix:"{",postTextFix:"}",textFixLabel:"",preTextFixText:"",postTextFixText:"",borderWidth:1,borderColor:"#000000",activeBackgroundColor:"",disabledBackgroundColor:"",existValueBackgroundColor:"",noValueBackgroundColor:"",inlineControlBackgroundColor:"#BFF7D7"},nc={bottom:30,inactiveAlpha:1,maxHeightRadio:s.MaxHeightRatio.HALF,disabled:!1,editable:!0},oc={opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!1,deletable:!0},ic={top:30,inactiveAlpha:1,maxHeightRadio:s.MaxHeightRatio.HALF,disabled:!1,editable:!0},sc={defaultColor:"#1976d2",defaultBackgroundColor:"#e3f2fd",defaultBorderRadius:4,defaultPadding:[4,4,4,4]},rc={color:"#666666",font:"Microsoft YaHei",size:12,top:5},lc={disabled:!0,color:"#CCCCCC",lineWidth:1.5},ac={font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},ro={PAGE_NO:"{pageNo}",PAGE_COUNT:"{pageCount}"},cc={bottom:60,size:12,font:"Microsoft YaHei",color:"#000000",rowFlex:s.RowFlex.CENTER,format:ro.PAGE_NO,numberType:s.NumberType.ARABIC,disabled:!1,startPageNo:1,fromPageNo:0,maxPageNo:null},or={data:"",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},dc={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000",verticalAlign:s.VerticalAlign.BOTTOM},uc={lineWidth:1,strokeStyle:"#000000"},hc={tdPadding:[5,5,5,5],defaultTrMinHeight:24,defaultColMinWidth:40,defaultBorderColor:"#000000",overflow:!0};s.WatermarkType=void 0,(function(o){o.TEXT="text",o.IMAGE="image"})(s.WatermarkType||(s.WatermarkType={}));const Vi={data:"",type:s.WatermarkType.TEXT,width:0,height:0,color:"#AEB5C0",opacity:.3,size:200,font:"Microsoft YaHei",repeat:!1,gap:[10,10],numberType:s.NumberType.ARABIC},Rc={tipDisabled:!0};s.LineNumberType=void 0,(function(o){o.PAGE="page",o.CONTINUITY="continuity"})(s.LineNumberType||(s.LineNumberType={}));const gc={size:12,font:"Microsoft YaHei",color:"#000000",disabled:!0,right:20,type:s.LineNumberType.CONTINUITY},Tc={color:"#000000",lineWidth:1,padding:[0,5,0,5],disabled:!0},fc={top:0,left:5},mc={defaultLineColor:"#000000",defaultLineWidth:2},Cc={disabled:!0,color:"#CCCCCC",radius:1};function yo(o={}){const t={...hc,...o.table},e={...ic,...o.header},n={...nc,...o.footer},i={...cc,...o.pageNumber},l={...Vi,...o.watermark},r={...ec,...o.control},a={...tc,...o.checkbox},c={...dc,...o.radio},d={...Fa,...o.cursor},u={...za,...o.title},h={...or,...o.placeholder},R={...oc,...o.group},T={...ac,...o.pageBreak},g={...Rc,...o.zone},f={...qa,...o.background},C={...lc,...o.lineBreak},p={...Cc,...o.whiteSpace},I={...uc,...o.separator},m={...gc,...o.lineNumber},L={...Tc,...o.pageBorder},O={...fc,...o.badge},P={...mc,...o.graffiti},S={...sc,...o.label},y={...rc,...o.imgCaption},Y={...xa,...o.list},b={print:{...Do.print,...o.modeRule?.print},compare:{...Do.compare,...o.modeRule?.compare},readonly:{...Do.readonly,...o.modeRule?.readonly},form:{...Do.form,...o.modeRule?.form}};return{mode:s.EditorMode.EDIT,locale:"zhCN",defaultType:"TEXT",defaultColor:"#000000",defaultFont:"SimSun",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,highlightMarginHeight:8,resizerColor:"#4182D9",resizerSize:5,marginIndicatorSize:35,marginIndicatorColor:"#BABABA",margins:[75.591,56.693,56.693,56.693],pageMode:s.PageMode.PAGING,renderMode:s.RenderMode.SPEED,defaultHyperlinkColor:"#0000FF",paperDirection:s.PaperDirection.VERTICAL,inactiveAlpha:.6,historyMaxRecordCount:100,wordBreak:s.WordBreak.BREAK_WORD,printPixelRatio:3,maskMargin:[0,0,0,0],letterClass:[fi.ENGLISH,fi.NUMBER],contextMenuDisableKeys:[],shortcutDisableKeys:[],scrollContainerSelector:"",pageOuterSelectionDisable:!1,...o,table:t,header:e,footer:n,pageNumber:i,watermark:l,control:r,checkbox:a,radio:c,cursor:d,title:u,placeholder:h,group:R,pageBreak:T,zone:g,background:f,lineBreak:C,whiteSpace:p,separator:I,lineNumber:m,pageBorder:L,badge:O,modeRule:b,graffiti:P,label:S,imgCaption:y,list:Y,performance:{enabled:!1,threshold:16,...o.performance}}}const ir=new Map,pc=[s.ControlType.SELECT,s.ControlType.DATE,s.ControlType.CHECKBOX,s.ControlType.RADIO];function be(o,t){return o&&pc.includes(o)?[""]:Nt(t)}function sr(o){return ir.get(o)}function No(o,t){ir.set(o,t)}function lo(o){return o?.controlId?{controlId:o.controlId,originControlId:o.originControlId||null,subTemplateInstanceId:o.subTemplateInstanceId||o.subTemplateParentId||null}:null}function kt(o,t){const e=lo(o),n=lo(t);return!!(e&&n&&e.controlId===n.controlId&&e.originControlId===n.originControlId&&e.subTemplateInstanceId===n.subTemplateInstanceId)}function Wi(o){const t=[];for(let e=0;e<o.length;e++){const n=o[e],i=Nt(n.value);for(let l=0;l<i.length;l++)t.push({...n,value:i[l]})}return t}const rr=new Set([s.ControlComponent.PREFIX,s.ControlComponent.POSTFIX,s.ControlComponent.PRE_TEXT,s.ControlComponent.POST_TEXT,s.ControlComponent.PRETEXTFIX,s.ControlComponent.PRETEXTFIX_TEXT,s.ControlComponent.POSTTEXTFIX,s.ControlComponent.POSTTEXTFIX_TEXT,s.ControlComponent.PLACEHOLDER,s.ControlComponent.TEXTFIXLABEL,s.ControlComponent.CHECKBOX,s.ControlComponent.RADIO,s.ControlComponent.UNDERLINE]),Ic=["请选择","双击获取日期","格式化日期时间"],Ec=" ";function Ui(o){return(o||[]).map(t=>t.value===_?`
62
+ `:t.value||"").join("")}function vn(o){const t=Number(o?.indentChars??0);return{newline:o?.newline===!0,indentChars:Math.max(0,Math.min(20,Number.isFinite(t)?Math.floor(t):0))}}function fe(o){return o?.buttonValueLayout===!0}function Ln(o,t){const e=Nt(o),n=vn(t?.valueLayout),i=n.indentChars>0;if(!n.newline&&!i||!e.length)return e.map(c=>({value:c}));const l=[],r=(c,d=!1)=>{Nt(c).forEach((u,h)=>{const R={value:u,buttonValueLayout:!0};d&&h===0&&Object.assign(R,{buttonValueLayoutPrefixOffset:!0}),l.push(R)})},a=Ec.repeat(n.indentChars);return n.newline?r(`
63
63
  ${a}`):i&&r(a,!0),e.forEach(c=>{l.push({value:c}),c===`
64
64
  `&&i&&r(a)}),n.newline&&r(`
65
- ${a}`),l}function lr(o){return Wi(o.value)}function Ui(o){return o.placeholder||""}function vn(){return{color:"#1677FF",highlight:void 0}}function bo(o){return{color:o,highlight:void 0}}function ar(o){return o===s.EditorMode.READONLY}function Lc(o){const t=[];return o.filter(Boolean).forEach(e=>{t.push(e,`获取${e}`,`获取 ${e}`,`请选择${e}`,`请选择 ${e}`,`请输入${e}`,`请输入 ${e}`)}),t}function He(o,t=[]){if(!o)return"";const e=o.replace(new RegExp(`${_}`,"g"),`
66
- `),n=e.trim();return n?[...Ic,...Lc(t)].includes(n)?"":e:""}function Yi(o,t){const e=He(o,[t?.label||""]);if(!e)return[];const n=t?xt(t,[...ce,"font","size","bold","italic","underline","strikeout","rowFlex","rowMargin","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime","color"]):{};return Nt(e).map(i=>({...n,type:s.ElementType.TEXT,value:i===`
67
- `?_:i}))}function Vo(o){const t=(o.code||"").split(",").map(n=>n.trim()).filter(Boolean);if(!t.length||!o.valueSets?.length)return"";const e=o.multiSelectDelimiter||",";return t.map(n=>o.valueSets?.find(i=>i.code===n)?.value).filter(n=>!!n).join(e)}function cr(o){return o.type===s.ElementType.REUSABLE_ITEM?He(o.reusableItemConfig?.value||"",[o.label||""]):o.type===s.ElementType.CUSTOM_MACRO?He(o.macroConfig?.value||o.value||"",[o.label||""]):o.type===s.ElementType.MACRO?He(o.value||"",[o.label||""]):""}function Pc(o){const t=o.control;if(!t)return[];const e=[t.placeholder||"",t.label||""];if(t.type===s.ControlType.CHECKBOX||t.type===s.ControlType.RADIO){const r=He(Vo(t),e);if(r)return Yi(r,o)}const i=Zn(t.value||[]);return He(Uo(i),e)?i:t.type===s.ControlType.SELECT?Yi(He(Vo(t),e),o):[]}function Mc(o){if(!o)return"";const t=[o.placeholder||"",o.label||""];if(o.type===s.ControlType.CHECKBOX||o.type===s.ControlType.RADIO){const i=He(Vo(o),t);if(i)return i}const n=He(Uo(o.value||[]),t);return n||(o.type===s.ControlType.SELECT?He(Vo(o),t):"")}function Wo(o){return ae(o)||o.controlComponent&&rr.has(o.controlComponent)?"":o.type===s.ElementType.CONTROL?Mc(o.control):o.type===s.ElementType.MACRO||o.type===s.ElementType.CUSTOM_MACRO||o.type===s.ElementType.REUSABLE_ITEM?cr(o):o.type===s.ElementType.TABLE?o.trList?.map(t=>t.tdList.map(e=>Uo(e.value||[])).join(" ")).join(`
65
+ ${a}`),l}function lr(o){return Ui(o.value)}function Yi(o){return o.placeholder||""}function Zn(){return{color:"#1677FF",highlight:void 0}}function bo(o){return{color:o,highlight:void 0}}function ar(o){return o===s.EditorMode.READONLY}function Lc(o){const t=[];return o.filter(Boolean).forEach(e=>{t.push(e,`获取${e}`,`获取 ${e}`,`请选择${e}`,`请选择 ${e}`,`请输入${e}`,`请输入 ${e}`)}),t}function He(o,t=[]){if(!o)return"";const e=o.replace(new RegExp(`${_}`,"g"),`
66
+ `),n=e.trim();return n?[...Ic,...Lc(t)].includes(n)?"":e:""}function wi(o,t){const e=He(o,[t?.label||""]);if(!e)return[];const n=t?xt(t,[...ce,"font","size","bold","italic","underline","strikeout","rowFlex","rowMargin","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime","color"]):{};return Nt(e).map(i=>({...n,type:s.ElementType.TEXT,value:i===`
67
+ `?_:i}))}function Vo(o){const t=(o.code||"").split(",").map(n=>n.trim()).filter(Boolean);if(!t.length||!o.valueSets?.length)return"";const e=o.multiSelectDelimiter||",";return t.map(n=>o.valueSets?.find(i=>i.code===n)?.value).filter(n=>!!n).join(e)}function cr(o){return o.type===s.ElementType.REUSABLE_ITEM?He(o.reusableItemConfig?.value||"",[o.label||""]):o.type===s.ElementType.CUSTOM_MACRO?He(o.macroConfig?.value||o.value||"",[o.label||""]):o.type===s.ElementType.MACRO?He(o.value||"",[o.label||""]):""}function Pc(o){const t=o.control;if(!t)return[];const e=[t.placeholder||"",t.label||""];if(t.type===s.ControlType.CHECKBOX||t.type===s.ControlType.RADIO){const r=He(Vo(t),e);if(r)return wi(r,o)}const i=Qn(t.value||[]);return He(Uo(i),e)?i:t.type===s.ControlType.SELECT?wi(He(Vo(t),e),o):[]}function Mc(o){if(!o)return"";const t=[o.placeholder||"",o.label||""];if(o.type===s.ControlType.CHECKBOX||o.type===s.ControlType.RADIO){const i=He(Vo(o),t);if(i)return i}const n=He(Uo(o.value||[]),t);return n||(o.type===s.ControlType.SELECT?He(Vo(o),t):"")}function Wo(o){return ae(o)||o.controlComponent&&rr.has(o.controlComponent)?"":o.type===s.ElementType.CONTROL?Mc(o.control):o.type===s.ElementType.MACRO||o.type===s.ElementType.CUSTOM_MACRO||o.type===s.ElementType.REUSABLE_ITEM?cr(o):o.type===s.ElementType.TABLE?o.trList?.map(t=>t.tdList.map(e=>Uo(e.value||[])).join(" ")).join(`
68
68
  `)||"":o.type===s.ElementType.TAB?" ":o.valueList?.length?Uo(o.valueList):o.value||""}function Uo(o){return o.map(t=>Wo(t)).join("")}function Oc(o){const t=o.menstrualData;if(!t)return"~";const{periodMin:e,periodMax:n,menarcheAge:i,isMenopause:l,menopauseAge:r,lastPeriod:a,cycleMin:c,cycleMax:d}=t,u=e||n?`${e||""}~${n||""}`:"~",h=c||d?`${c||""}~${d||""}`:"~",R=[i?`${i}岁`:"",l?r?`${r}岁`:"":a||""].filter(Boolean);return[u,...R,h].filter(Boolean).join(" ")}function dr(o){return(o||"").replace(new RegExp(`${_}`,"g"),`
69
- `)}function wi(o){let t="";for(let e=0;e<o.length;e++){const n=o[e];if(!ae(n))if(n.type===s.ElementType.TABLE){t&&!t.endsWith(`
69
+ `)}function vi(o){let t="";for(let e=0;e<o.length;e++){const n=o[e];if(!ae(n))if(n.type===s.ElementType.TABLE){t&&!t.endsWith(`
70
70
  `)&&(t+=`
71
- `);const i=n.trList||[];for(let l=0;l<i.length;l++){const r=i[l];for(let a=0;a<r.tdList.length;a++){const c=r.tdList[a],d=wi(c.value||[]),u=a===0,h=r.tdList.length-1===a;t+=`${u?"":" "}${d}${h?`
72
- `:""}`}}}else n.type===s.ElementType.TAB?t+=" ":n.type===s.ElementType.CHECKBOX?t+=n.checkbox?.value?"☑":"□":n.type===s.ElementType.RADIO?t+=n.radio?.value?"☉":"○":n.type===s.ElementType.MENSTRUAL_HISTORY?t+=Oc(n):n.type===s.ElementType.MACRO||n.type===s.ElementType.CUSTOM_MACRO||n.type===s.ElementType.REUSABLE_ITEM?t+=dr(Wo(n)):n.valueList?.length?t+=wi(n.valueList):t+=dr(n.value)}return t}function Zn(o=[]){const t=[];return o.forEach(e=>{if(ae(e)||e.controlComponent&&rr.has(e.controlComponent))return;if(e.type===s.ElementType.TABLE){const i=rt(e);i.trList?.forEach(l=>{l.tdList.forEach(r=>{r.value=Zn(r.value||[])})}),t.push(i);return}if(e.type===s.ElementType.CONTROL&&e.control){t.push(...Pc(e));return}if(e.type===s.ElementType.MACRO||e.type===s.ElementType.CUSTOM_MACRO||e.type===s.ElementType.REUSABLE_ITEM){t.push(...Yi(cr(e),e));return}if(e.valueList?.length){const i=rt(e);i.valueList=Zn(e.valueList),t.push(i);return}const n=rt(e);delete n.control,delete n.controlId,delete n.originControlId,delete n.controlComponent,n.type===s.ElementType.CONTROL&&(n.type=s.ElementType.TEXT),(n.value===`
71
+ `);const i=n.trList||[];for(let l=0;l<i.length;l++){const r=i[l];for(let a=0;a<r.tdList.length;a++){const c=r.tdList[a],d=vi(c.value||[]),u=a===0,h=r.tdList.length-1===a;t+=`${u?"":" "}${d}${h?`
72
+ `:""}`}}}else n.type===s.ElementType.TAB?t+=" ":n.type===s.ElementType.CHECKBOX?t+=n.checkbox?.value?"☑":"□":n.type===s.ElementType.RADIO?t+=n.radio?.value?"☉":"○":n.type===s.ElementType.MENSTRUAL_HISTORY?t+=Oc(n):n.type===s.ElementType.MACRO||n.type===s.ElementType.CUSTOM_MACRO||n.type===s.ElementType.REUSABLE_ITEM?t+=dr(Wo(n)):n.valueList?.length?t+=vi(n.valueList):t+=dr(n.value)}return t}function Qn(o=[]){const t=[];return o.forEach(e=>{if(ae(e)||e.controlComponent&&rr.has(e.controlComponent))return;if(e.type===s.ElementType.TABLE){const i=rt(e);i.trList?.forEach(l=>{l.tdList.forEach(r=>{r.value=Qn(r.value||[])})}),t.push(i);return}if(e.type===s.ElementType.CONTROL&&e.control){t.push(...Pc(e));return}if(e.type===s.ElementType.MACRO||e.type===s.ElementType.CUSTOM_MACRO||e.type===s.ElementType.REUSABLE_ITEM){t.push(...wi(cr(e),e));return}if(e.valueList?.length){const i=rt(e);i.valueList=Qn(e.valueList),t.push(i);return}const n=rt(e);delete n.control,delete n.controlId,delete n.originControlId,delete n.controlComponent,n.type===s.ElementType.CONTROL&&(n.type=s.ElementType.TEXT),(n.value===`
73
73
  `||n.value===`\r
74
- `)&&(n.value=_),t.push(n)}),t}function ee(o,t){const{isHandleFirstElement:e=!0,isForceCompensation:n=!1,editorOptions:i}=t,l=o[0];(n||e&&l?.type!==s.ElementType.LIST&&(l?.type&&l.type!==s.ElementType.TEXT||!mi.test(l?.value)))&&o.unshift({value:_});let r=0;for(;r<o.length;){let a=o[r];if(a.type===s.ElementType.TITLE){o.splice(r,1);const c=a.valueList||[];if(ee(c,{...t,isHandleFirstElement:!1,isForceCompensation:!1}),c.length){const d=a.titleId||ft(),u=i.title;for(let h=0;h<c.length;h++){const R=c[h];R.title=a.title,a.level&&(R.titleId=d,R.level=a.level),Yo(R)&&(R.size||(R.size=u[er[R.level]]),R.bold===void 0&&(R.bold=!0)),o.splice(r,0,R),r++}}r--}else if(a.type===s.ElementType.LIST){o.splice(r,1);const c=a.valueList||[];if(ee(c,{...t,isHandleFirstElement:!0,isForceCompensation:!1}),c.length){const d=ft();for(let u=0;u<c.length;u++){const h=c[u];h.listId=d,h.listType=a.listType,h.listStyle=a.listStyle,o.splice(r,0,h),r++}}r--}else if(a.type===s.ElementType.AREA){o.splice(r,1);const c=a?.valueList||[];if(ee(c,{...t,isHandleFirstElement:!0,isForceCompensation:!0}),c.length){const d=ft();for(let u=0;u<c.length;u++){const h=c[u];if(h.areaId=a.areaId||d,h.area=a.area,h.areaIndex=u,h.type===s.ElementType.TABLE){const R=h.trList;for(let T=0;T<R.length;T++){const g=R[T];for(let f=0;f<g.tdList.length;f++){const p=g.tdList[f].value;for(let I=0;I<p.length;I++){const m=p[I];m.areaId=a.areaId||d,m.area=a.area}}}}o.splice(r,0,h),r++}}r--}else if(a.type===s.ElementType.TABLE){const c=a.id||ft();if(a.id=c,a.trList){const{defaultTrMinHeight:d}=i.table;for(let u=0;u<a.trList.length;u++){const h=a.trList[u],R=h.id||ft();h.id=R,(!h.minHeight||h.minHeight<d)&&(h.minHeight=d),h.height<h.minHeight&&(h.height=h.minHeight);for(let T=0;T<h.tdList.length;T++){const g=h.tdList[T],f=g.id||ft();g.id=f,ee(g.value,{...t,isHandleFirstElement:!0,isForceCompensation:!0}),!g.value[0].size&&g.value[1]?.size&&Yo(g.value[1])&&(g.value[0].size=g.value[1].size);for(let C=0;C<g.value.length;C++){const p=g.value[C];p.tdId=f,p.trId=R,p.tableId=c}}}}}else if(a.type===s.ElementType.HYPERLINK){o.splice(r,1);const c=Vi(a.valueList||[]);if(c.length){const d=ft();for(let u=0;u<c.length;u++){const h=c[u];h.type=a.type,h.url=a.url,h.hyperlinkId=d,o.splice(r,0,h),r++}}r--}else if(a.type===s.ElementType.DATE){o.splice(r,1);const c=Vi(a.valueList||[]);if(c.length){const d=ft();for(let u=0;u<c.length;u++){const h=c[u];h.type=a.type,h.dateFormat=a.dateFormat,h.dateId=d,o.splice(r,0,h),r++}}r--}else if(a.type===s.ElementType.CONTROL){if(!a.control){r++;continue}if(!a.controlComponent)if(a.control.type=="TextField"){const{preTextFix:c,postTextFix:d,preTextFixText:u,postTextFixText:h,value:R,placeholder:T,code:g,type:f,valueSets:C}=a.control,p=f,{editorOptions:{control:I,checkbox:m,radio:L}}=t,O=a.controlId||ft();o.splice(r,1);const P=xt(a,[...Di,...ce]),S=xt(a.control,ue),y={...S,color:i.control.textFixColor,fontWeight:"blod"},Y={...S,color:void 0},b=Nt(c||I.preTextFix);for(let V=0;V<b.length;V++){const N=b[V];o.splice(r,0,{...P,...y,controlId:O,value:N,type:a.type,control:a.control,controlComponent:s.ControlComponent.PRETEXTFIX}),r++}if(u){const V=Nt(u);for(let N=0;N<V.length;N++){const X=V[N];o.splice(r,0,{...P,...S,controlId:O,value:X,type:a.type,control:a.control,controlComponent:s.ControlComponent.PRETEXTFIX_TEXT}),r++}}if(R&&R.length||p===s.ControlType.CHECKBOX||p===s.ControlType.RADIO||p===s.ControlType.SELECT&&g&&(!R||!R.length)){let V=R?rt(R):[];if(p===s.ControlType.CHECKBOX){const N=g?g.split(","):[];if(Array.isArray(C)&&C.length){const X=V.reduce((E,U)=>E.concat(U.value.split("").map(F=>({...U,value:F}))),[]);let D=0;for(let E=0;E<C.length;E++){const U=C[E];o.splice(r,0,{...P,...S,controlId:O,value:"",type:a.type,control:a.control,controlComponent:s.ControlComponent.CHECKBOX,checkbox:{code:U.code,value:N.includes(U.code)}}),r++;const F=Nt(U.value);for(let Z=0;Z<F.length;Z++){const Q=F[Z],W=Z===F.length-1;o.splice(r,0,{...P,...Y,...X[D],controlId:O,value:Q===`
74
+ `)&&(n.value=_),t.push(n)}),t}function ee(o,t){const{isHandleFirstElement:e=!0,isForceCompensation:n=!1,editorOptions:i}=t,l=o[0];(n||e&&l?.type!==s.ElementType.LIST&&(l?.type&&l.type!==s.ElementType.TEXT||!Ci.test(l?.value)))&&o.unshift({value:_});let r=0;for(;r<o.length;){let a=o[r];if(a.type===s.ElementType.TITLE){o.splice(r,1);const c=a.valueList||[];if(ee(c,{...t,isHandleFirstElement:!1,isForceCompensation:!1}),c.length){const d=a.titleId||ft(),u=i.title;for(let h=0;h<c.length;h++){const R=c[h];R.title=a.title,a.level&&(R.titleId=d,R.level=a.level),Yo(R)&&(R.size||(R.size=u[er[R.level]]),R.bold===void 0&&(R.bold=!0)),o.splice(r,0,R),r++}}r--}else if(a.type===s.ElementType.LIST){o.splice(r,1);const c=a.valueList||[];if(ee(c,{...t,isHandleFirstElement:!0,isForceCompensation:!1}),c.length){const d=ft();for(let u=0;u<c.length;u++){const h=c[u];h.listId=d,h.listType=a.listType,h.listStyle=a.listStyle,o.splice(r,0,h),r++}}r--}else if(a.type===s.ElementType.AREA){o.splice(r,1);const c=a?.valueList||[];if(ee(c,{...t,isHandleFirstElement:!0,isForceCompensation:!0}),c.length){const d=ft();for(let u=0;u<c.length;u++){const h=c[u];if(h.areaId=a.areaId||d,h.area=a.area,h.areaIndex=u,h.type===s.ElementType.TABLE){const R=h.trList;for(let T=0;T<R.length;T++){const g=R[T];for(let f=0;f<g.tdList.length;f++){const p=g.tdList[f].value;for(let I=0;I<p.length;I++){const m=p[I];m.areaId=a.areaId||d,m.area=a.area}}}}o.splice(r,0,h),r++}}r--}else if(a.type===s.ElementType.TABLE){const c=a.id||ft();if(a.id=c,a.trList){const{defaultTrMinHeight:d}=i.table;for(let u=0;u<a.trList.length;u++){const h=a.trList[u],R=h.id||ft();h.id=R,(!h.minHeight||h.minHeight<d)&&(h.minHeight=d),h.height<h.minHeight&&(h.height=h.minHeight);for(let T=0;T<h.tdList.length;T++){const g=h.tdList[T],f=g.id||ft();g.id=f,ee(g.value,{...t,isHandleFirstElement:!0,isForceCompensation:!0}),!g.value[0].size&&g.value[1]?.size&&Yo(g.value[1])&&(g.value[0].size=g.value[1].size);for(let C=0;C<g.value.length;C++){const p=g.value[C];p.tdId=f,p.trId=R,p.tableId=c}}}}}else if(a.type===s.ElementType.HYPERLINK){o.splice(r,1);const c=Wi(a.valueList||[]);if(c.length){const d=ft();for(let u=0;u<c.length;u++){const h=c[u];h.type=a.type,h.url=a.url,h.hyperlinkId=d,o.splice(r,0,h),r++}}r--}else if(a.type===s.ElementType.DATE){o.splice(r,1);const c=Wi(a.valueList||[]);if(c.length){const d=ft();for(let u=0;u<c.length;u++){const h=c[u];h.type=a.type,h.dateFormat=a.dateFormat,h.dateId=d,o.splice(r,0,h),r++}}r--}else if(a.type===s.ElementType.CONTROL){if(!a.control){r++;continue}if(!a.controlComponent)if(a.control.type=="TextField"){const{preTextFix:c,postTextFix:d,preTextFixText:u,postTextFixText:h,value:R,placeholder:T,code:g,type:f,valueSets:C}=a.control,p=f,{editorOptions:{control:I,checkbox:m,radio:L}}=t,O=a.controlId||ft();o.splice(r,1);const P=xt(a,[...Fi,...ce]),S=xt(a.control,ue),y={...S,color:i.control.textFixColor,fontWeight:"blod"},Y={...S,color:void 0},b=Nt(c||I.preTextFix);for(let V=0;V<b.length;V++){const N=b[V];o.splice(r,0,{...P,...y,controlId:O,value:N,type:a.type,control:a.control,controlComponent:s.ControlComponent.PRETEXTFIX}),r++}if(u){const V=Nt(u);for(let N=0;N<V.length;N++){const X=V[N];o.splice(r,0,{...P,...S,controlId:O,value:X,type:a.type,control:a.control,controlComponent:s.ControlComponent.PRETEXTFIX_TEXT}),r++}}if(R&&R.length||p===s.ControlType.CHECKBOX||p===s.ControlType.RADIO||p===s.ControlType.SELECT&&g&&(!R||!R.length)){let V=R?rt(R):[];if(p===s.ControlType.CHECKBOX){const N=g?g.split(","):[];if(Array.isArray(C)&&C.length){const X=V.reduce((E,U)=>E.concat(U.value.split("").map(F=>({...U,value:F}))),[]);let D=0;for(let E=0;E<C.length;E++){const U=C[E];o.splice(r,0,{...P,...S,controlId:O,value:"",type:a.type,control:a.control,controlComponent:s.ControlComponent.CHECKBOX,checkbox:{code:U.code,value:N.includes(U.code)}}),r++;const F=Nt(U.value);for(let Z=0;Z<F.length;Z++){const Q=F[Z],W=Z===F.length-1;o.splice(r,0,{...P,...Y,...X[D],controlId:O,value:Q===`
75
75
  `?_:Q,letterSpacing:W?m.gap:0,control:a.control,controlComponent:s.ControlComponent.VALUE}),D++,r++}}}}else if(p===s.ControlType.RADIO){if(Array.isArray(C)&&C.length){const N=V.reduce((D,E)=>D.concat(E.value.split("").map(U=>({...E,value:U}))),[]);let X=0;for(let D=0;D<C.length;D++){const E=C[D];o.splice(r,0,{...P,...S,controlId:O,value:"",type:a.type,control:a.control,controlComponent:s.ControlComponent.RADIO,radio:{code:E.code,value:g===E.code}}),r++;const U=Nt(E.value);for(let F=0;F<U.length;F++){const Z=U[F],Q=F===U.length-1;o.splice(r,0,{...P,...Y,...N[X],controlId:O,value:Z===`
76
- `?_:Z,letterSpacing:Q?L.gap:0,control:a.control,controlComponent:s.ControlComponent.VALUE}),X++,r++}}}}else{if((!R||!R.length)&&Array.isArray(C)&&C.length){const X=g?g.split(",").map(D=>D.trim()).filter(D=>D):[];if(X.length>1){const D=[];for(const E of X){const U=C.find(F=>F.code===E);U&&D.push({value:U.value})}D.length>0&&(V=D)}else if(X.length===1){const D=C.find(E=>E.code===X[0]);D&&(V=[{value:D.value}])}}const N=wn(a.control.valueLayout);p===s.ControlType.BUTTON&&(N.newline||N.indentChars>0)&&(V=[{value:Wi(V)}]);for(let X=0;X<V.length;X++){const D=V[X];if(D.type===s.ElementType.CONTROL&&D.control){const E=D,U=E.controlId||ft(),F=E.control?.value||[],Z=E.control?.placeholder||"",Q=E.control?.type,W=Q===s.ControlType.TEXTFIELD,K=Q===s.ControlType.TEXT||Q===s.ControlType.NUMBER,k=Q===s.ControlType.CHECKBOX,B=Q===s.ControlType.RADIO,H=Q===s.ControlType.BUTTON,A=W?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX,v=W?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX,ct={...P,controlId:U,type:s.ElementType.CONTROL,control:E.control},bt=W?i.control.textFixColor:K?"#87d068":H?vn().color:i.control.bracketColor,Qt=H?vn().highlight:void 0,Ce=W?E.control?.preTextFix||I.preTextFix:E.control?.prefix||I.prefix,Gt=be(Q,Ce);for(let z=0;z<Gt.length;z++)o.splice(r,0,{...ct,color:bt,highlight:Qt,originControlId:O,value:Gt[z],controlComponent:A}),r++;if(H){const z=lr(E.control);if(z){const G=Ln(z,E.control),J=bo(i.defaultColor);for(let it=0;it<G.length;it++){const q=G[it];o.splice(r,0,{...ct,...J,originControlId:O,value:q.value===`
77
- `?_:q.value,buttonValueLayout:q.buttonValueLayout,buttonValueLayoutPrefixOffset:q.buttonValueLayoutPrefixOffset,controlComponent:s.ControlComponent.VALUE}),r++}}else{const G=Ui(E.control),J=Nt(G);for(let it=0;it<J.length;it++){const q=J[it];o.splice(r,0,{...ct,color:i.control.placeholderColor,originControlId:O,value:q===`
76
+ `?_:Z,letterSpacing:Q?L.gap:0,control:a.control,controlComponent:s.ControlComponent.VALUE}),X++,r++}}}}else{if((!R||!R.length)&&Array.isArray(C)&&C.length){const X=g?g.split(",").map(D=>D.trim()).filter(D=>D):[];if(X.length>1){const D=[];for(const E of X){const U=C.find(F=>F.code===E);U&&D.push({value:U.value})}D.length>0&&(V=D)}else if(X.length===1){const D=C.find(E=>E.code===X[0]);D&&(V=[{value:D.value}])}}const N=vn(a.control.valueLayout);p===s.ControlType.BUTTON&&(N.newline||N.indentChars>0)&&(V=[{value:Ui(V)}]);for(let X=0;X<V.length;X++){const D=V[X];if(D.type===s.ElementType.CONTROL&&D.control){const E=D,U=E.controlId||ft(),F=E.control?.value||[],Z=E.control?.placeholder||"",Q=E.control?.type,W=Q===s.ControlType.TEXTFIELD,K=Q===s.ControlType.TEXT||Q===s.ControlType.NUMBER,k=Q===s.ControlType.CHECKBOX,B=Q===s.ControlType.RADIO,H=Q===s.ControlType.BUTTON,A=W?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX,v=W?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX,ct={...P,controlId:U,type:s.ElementType.CONTROL,control:E.control},bt=W?i.control.textFixColor:K?"#87d068":H?Zn().color:i.control.bracketColor,Qt=H?Zn().highlight:void 0,me=W?E.control?.preTextFix||I.preTextFix:E.control?.prefix||I.prefix,Gt=be(Q,me);for(let z=0;z<Gt.length;z++)o.splice(r,0,{...ct,color:bt,highlight:Qt,originControlId:O,value:Gt[z],controlComponent:A}),r++;if(H){const z=lr(E.control);if(z){const G=Ln(z,E.control),J=bo(i.defaultColor);for(let it=0;it<G.length;it++){const q=G[it];o.splice(r,0,{...ct,...J,originControlId:O,value:q.value===`
77
+ `?_:q.value,buttonValueLayout:q.buttonValueLayout,buttonValueLayoutPrefixOffset:q.buttonValueLayoutPrefixOffset,controlComponent:s.ControlComponent.VALUE}),r++}}else{const G=Yi(E.control),J=Nt(G);for(let it=0;it<J.length;it++){const q=J[it];o.splice(r,0,{...ct,color:i.control.placeholderColor,originControlId:O,value:q===`
78
78
  `?_:q,controlComponent:s.ControlComponent.PLACEHOLDER}),r++}}}else if(k){const z=E.control?.valueSets||[],G=E.control?.code||"",J=G?G.split(","):[];for(let it=0;it<z.length;it++){const q=z[it];o.splice(r,0,{...ct,originControlId:O,value:"",controlComponent:s.ControlComponent.CHECKBOX,checkbox:{code:q.code,value:J.includes(q.code)}}),r++;const ut=Nt(q.value||"");for(let gt=0;gt<ut.length;gt++){const Ot=ut[gt],Et=gt===ut.length-1;o.splice(r,0,{...ct,...Y,originControlId:O,value:Ot===`
79
79
  `?_:Ot,letterSpacing:Et?m.gap:0,controlComponent:s.ControlComponent.VALUE}),r++}}}else if(B){const z=E.control?.valueSets||[],G=E.control?.code||"";for(let J=0;J<z.length;J++){const it=z[J];o.splice(r,0,{...ct,originControlId:O,value:"",controlComponent:s.ControlComponent.RADIO,radio:{code:it.code,value:G===it.code}}),r++;const q=Nt(it.value||"");for(let ut=0;ut<q.length;ut++){const gt=q[ut],Ot=ut===q.length-1;o.splice(r,0,{...ct,...Y,originControlId:O,value:gt===`
80
80
  `?_:gt,letterSpacing:Ot?L.gap:0,controlComponent:s.ControlComponent.VALUE}),r++}}}else if(F.length>0)for(let z=0;z<F.length;z++){const G=F[z];if(G.type===s.ElementType.CONTROL&&G.control){const J=G,it=J.controlId||ft(),q=J.control?.value||[],ut=J.control?.type,gt=ut===s.ControlType.TEXTFIELD,Ot=ut===s.ControlType.TEXT||ut===s.ControlType.NUMBER,Et={...ct,controlId:it,control:J.control},yt=gt?i.control.textFixColor:Ot?"#87d068":i.control.bracketColor,Mt=gt?J.control?.preTextFix||I.preTextFix:J.control?.prefix||I.prefix,Ft=be(ut,Mt);for(let pt=0;pt<Ft.length;pt++)o.splice(r,0,{...Et,color:yt,originControlId:U,value:Ft[pt],controlComponent:gt?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX}),r++;for(let pt=0;pt<q.length;pt++){const ht=q[pt];if(ht.type===s.ElementType.MENSTRUAL_HISTORY||ht.type===s.ElementType.FETAL_HEART_POSITION||ht.type===s.ElementType.TOOTH_POSITION||ht.type===s.ElementType.IMAGE||ht.type===s.ElementType.MACRO||ht.type===s.ElementType.CUSTOM_MACRO||ht.type===s.ElementType.REUSABLE_ITEM||ht.type===s.ElementType.SUB_TEMPLATE||ht.type===s.ElementType.LIST||ht.type===s.ElementType.SPECIAL_SYMBOLS){const Ct=ht.id||ft();ht.id||(ht.id=Ct);const St=J.control?.value?.find(Kt=>Kt.id===Ct||Kt.type===ht.type&&Kt.value===ht.value);St&&No(Ct,St),o.splice(r,0,{...Et,...ht,id:Ct,originControlId:U,controlComponent:s.ControlComponent.VALUE,type:ht.type})}else o.splice(r,0,{...Et,...Y,...ht,originControlId:U,value:ht.value===`
81
- `?_:ht.value,controlComponent:s.ControlComponent.VALUE});r++}if(q.length===0){const pt=J.control?.placeholder||"";if(pt){const ht=Nt(pt);for(let Lt=0;Lt<ht.length;Lt++)o.splice(r,0,{...Et,color:i.control.placeholderColor,originControlId:U,value:ht[Lt],controlComponent:s.ControlComponent.PLACEHOLDER}),r++}}const Vt=gt?J.control?.postTextFix||I.postTextFix:J.control?.postfix||I.postfix,_t=be(ut,Vt);for(let pt=0;pt<_t.length;pt++)o.splice(r,0,{...Et,color:yt,originControlId:U,value:_t[pt],controlComponent:gt?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX}),r++}else{if(G.type===s.ElementType.MENSTRUAL_HISTORY||G.type===s.ElementType.FETAL_HEART_POSITION||G.type===s.ElementType.TOOTH_POSITION||G.type===s.ElementType.IMAGE||G.type===s.ElementType.MACRO||G.type===s.ElementType.CUSTOM_MACRO||G.type===s.ElementType.REUSABLE_ITEM||G.type===s.ElementType.SUB_TEMPLATE||G.type===s.ElementType.LIST||G.type===s.ElementType.SPECIAL_SYMBOLS){const it=G.id||ft();G.id||(G.id=it);const q=E.control?.value?.find(ut=>ut.id===it||ut.type===G.type&&ut.value===G.value);q&&No(it,q),o.splice(r,0,{...ct,...G,id:it,originControlId:O,controlComponent:s.ControlComponent.VALUE,type:G.type})}else o.splice(r,0,{...ct,...Y,...G,originControlId:O,value:G.value===`
81
+ `?_:ht.value,controlComponent:s.ControlComponent.VALUE});r++}if(q.length===0){const pt=J.control?.placeholder||"";if(pt){const ht=Nt(pt);for(let Lt=0;Lt<ht.length;Lt++)o.splice(r,0,{...Et,color:i.control.placeholderColor,originControlId:U,value:ht[Lt],controlComponent:s.ControlComponent.PLACEHOLDER}),r++}}const Vt=gt?J.control?.postTextFix||I.postTextFix:J.control?.postfix||I.postfix,Bt=be(ut,Vt);for(let pt=0;pt<Bt.length;pt++)o.splice(r,0,{...Et,color:yt,originControlId:U,value:Bt[pt],controlComponent:gt?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX}),r++}else{if(G.type===s.ElementType.MENSTRUAL_HISTORY||G.type===s.ElementType.FETAL_HEART_POSITION||G.type===s.ElementType.TOOTH_POSITION||G.type===s.ElementType.IMAGE||G.type===s.ElementType.MACRO||G.type===s.ElementType.CUSTOM_MACRO||G.type===s.ElementType.REUSABLE_ITEM||G.type===s.ElementType.SUB_TEMPLATE||G.type===s.ElementType.LIST||G.type===s.ElementType.SPECIAL_SYMBOLS){const it=G.id||ft();G.id||(G.id=it);const q=E.control?.value?.find(ut=>ut.id===it||ut.type===G.type&&ut.value===G.value);q&&No(it,q),o.splice(r,0,{...ct,...G,id:it,originControlId:O,controlComponent:s.ControlComponent.VALUE,type:G.type})}else o.splice(r,0,{...ct,...Y,...G,originControlId:O,value:G.value===`
82
82
  `?_:G.value,controlComponent:s.ControlComponent.VALUE});r++}}else if(Z){const z=Nt(Z);for(let G=0;G<z.length;G++)o.splice(r,0,{...ct,color:i.control.placeholderColor,originControlId:O,value:z[G],controlComponent:s.ControlComponent.PLACEHOLDER}),r++}else if((Q===s.ControlType.SELECT||Q===s.ControlType.DATE||Q===s.ControlType.NUMBER)&&!E.control?.code&&Z){const G=Nt(Z);for(let J=0;J<G.length;J++)o.splice(r,0,{...ct,color:i.control.placeholderColor,originControlId:O,value:G[J],controlComponent:s.ControlComponent.PLACEHOLDER}),r++}const Re=W?E.control?.postTextFix||I.postTextFix:E.control?.postfix||I.postfix,nt=be(Q,Re);for(let z=0;z<nt.length;z++)o.splice(r,0,{...ct,color:bt,highlight:Qt,originControlId:O,value:nt[z],controlComponent:v}),r++}else if(D.type===s.ElementType.MENSTRUAL_HISTORY||D.type===s.ElementType.FETAL_HEART_POSITION||D.type===s.ElementType.TOOTH_POSITION||D.type===s.ElementType.IMAGE||D.type===s.ElementType.MACRO||D.type===s.ElementType.CUSTOM_MACRO||D.type===s.ElementType.REUSABLE_ITEM||D.type===s.ElementType.SUB_TEMPLATE||D.type===s.ElementType.LIST||D.type===s.ElementType.SPECIAL_SYMBOLS){const E=D.id||ft();D.id||(D.id=E);const U=R?.find(F=>F.id===E||F.type===D.type&&F.value===D.value);U&&No(E,U),o.splice(r,0,{...P,...D,id:E,controlId:O,control:a.control,controlComponent:s.ControlComponent.VALUE,type:D.type}),r++}else{const E=p===s.ControlType.BUTTON?Ln(D.value||"",a.control):Nt(D.value||"").map(U=>({value:U}));for(let U=0;U<E.length;U++){const F=E[U];o.splice(r,0,{...P,...Y,...p===s.ControlType.BUTTON?bo(i.defaultColor):{},...D,buttonValueLayout:F.buttonValueLayout,buttonValueLayoutPrefixOffset:F.buttonValueLayoutPrefixOffset,controlId:O,value:F.value===`
83
83
  `?_:F.value,type:p===s.ControlType.BUTTON?s.ElementType.CONTROL:D.type||s.ElementType.TEXT,control:a.control,controlComponent:s.ControlComponent.VALUE}),r++}}}}}else if(T){const V={...S,color:i.control.placeholderColor},N=Nt(T);for(let X=0;X<N.length;X++){const D=N[X];o.splice(r,0,{...P,...V,controlId:O,value:D===`
84
- `?_:D,type:a.type,control:a.control,controlComponent:s.ControlComponent.PLACEHOLDER}),r++}}if(h){const V=Nt(h);for(let N=0;N<V.length;N++){const X=V[N];o.splice(r,0,{...P,...S,controlId:O,value:X,type:a.type,control:a.control,controlComponent:s.ControlComponent.POSTTEXTFIX_TEXT}),r++}}const M=Nt(d||I.postTextFix);for(let V=0;V<M.length;V++){const N=M[V];o.splice(r,0,{...P,...y,controlId:O,value:N,type:a.type,control:a.control,controlComponent:s.ControlComponent.POSTTEXTFIX}),r++}r--}else{const{prefix:c,postfix:d,preText:u,postText:h,value:R,placeholder:T,code:g,type:f,valueSets:C}=a.control,{editorOptions:{control:p,checkbox:I,radio:m}}=t,L=a.controlId||ft();o.splice(r,1);const O=xt(a,[...Di,...ce]),P=xt(a.control,ue),S={...P,color:f===s.ControlType.TEXT||f===s.ControlType.NUMBER?"#87d068":f===s.ControlType.BUTTON?vn().color:i.control.bracketColor,highlight:f===s.ControlType.BUTTON?vn().highlight:void 0},y={...P,color:void 0},Y=f===s.ControlType.BUTTON?Ui(a.control):T,b=be(f,c||p.prefix);for(let V=0;V<b.length;V++){const N=b[V];o.splice(r,0,{...O,...S,controlId:L,value:N===`
84
+ `?_:D,type:a.type,control:a.control,controlComponent:s.ControlComponent.PLACEHOLDER}),r++}}if(h){const V=Nt(h);for(let N=0;N<V.length;N++){const X=V[N];o.splice(r,0,{...P,...S,controlId:O,value:X,type:a.type,control:a.control,controlComponent:s.ControlComponent.POSTTEXTFIX_TEXT}),r++}}const M=Nt(d||I.postTextFix);for(let V=0;V<M.length;V++){const N=M[V];o.splice(r,0,{...P,...y,controlId:O,value:N,type:a.type,control:a.control,controlComponent:s.ControlComponent.POSTTEXTFIX}),r++}r--}else{const{prefix:c,postfix:d,preText:u,postText:h,value:R,placeholder:T,code:g,type:f,valueSets:C}=a.control,{editorOptions:{control:p,checkbox:I,radio:m}}=t,L=a.controlId||ft();o.splice(r,1);const O=xt(a,[...Fi,...ce]),P=xt(a.control,ue),S={...P,color:f===s.ControlType.TEXT||f===s.ControlType.NUMBER?"#87d068":f===s.ControlType.BUTTON?Zn().color:i.control.bracketColor,highlight:f===s.ControlType.BUTTON?Zn().highlight:void 0},y={...P,color:void 0},Y=f===s.ControlType.BUTTON?Yi(a.control):T,b=be(f,c||p.prefix);for(let V=0;V<b.length;V++){const N=b[V];o.splice(r,0,{...O,...S,controlId:L,value:N===`
85
85
  `?_:N,type:a.type,control:a.control,controlComponent:s.ControlComponent.PREFIX}),r++}if(u){const V=Nt(u);for(let N=0;N<V.length;N++){const X=V[N];o.splice(r,0,{...O,...P,controlId:L,value:X,type:a.type,control:a.control,controlComponent:s.ControlComponent.PRE_TEXT}),r++}}if(R&&R.length||f===s.ControlType.CHECKBOX||f===s.ControlType.RADIO||f===s.ControlType.SELECT&&g&&(!R||!R.length)){let V=R?rt(R):[];if(f===s.ControlType.CHECKBOX){const N=g?g.split(","):[];if(Array.isArray(C)&&C.length){const X=V.reduce((E,U)=>E.concat(U.value.split("").map(F=>({...U,value:F}))),[]);let D=0;for(let E=0;E<C.length;E++){const U=C[E];o.splice(r,0,{...O,...P,controlId:L,value:"",type:a.type,control:a.control,controlComponent:s.ControlComponent.CHECKBOX,checkbox:{code:U.code,value:N.includes(U.code)}}),r++;const F=Nt(U.value);for(let Z=0;Z<F.length;Z++){const Q=F[Z],W=Z===F.length-1;o.splice(r,0,{...O,...y,...X[D],controlId:L,value:Q===`
86
86
  `?_:Q,letterSpacing:W?I.gap:0,control:a.control,controlComponent:s.ControlComponent.VALUE}),D++,r++}}}}else if(f===s.ControlType.RADIO){if(Array.isArray(C)&&C.length){const N=V.reduce((D,E)=>D.concat(E.value.split("").map(U=>({...E,value:U}))),[]);let X=0;for(let D=0;D<C.length;D++){const E=C[D];o.splice(r,0,{...O,...P,controlId:L,value:"",type:a.type,control:a.control,controlComponent:s.ControlComponent.RADIO,radio:{code:E.code,value:g===E.code}}),r++;const U=Nt(E.value);for(let F=0;F<U.length;F++){const Z=U[F],Q=F===U.length-1;o.splice(r,0,{...O,...y,...N[X],controlId:L,value:Z===`
87
- `?_:Z,letterSpacing:Q?m.gap:0,control:a.control,controlComponent:s.ControlComponent.VALUE}),X++,r++}}}}else{if((!R||!R.length)&&Array.isArray(C)&&C.length){const X=g?g.split(","):[];if(X.length>1){const D=[];for(const E of X){const U=C.find(F=>F.code===E.trim());U&&D.push({value:U.value})}D.length>0&&(V=D)}else{const D=C.find(E=>E.code===g);D&&(V=[{value:D.value}])}}const N=wn(a.control.valueLayout);f===s.ControlType.BUTTON&&(N.newline||N.indentChars>0)&&(V=[{value:Wi(V)}]);for(let X=0;X<V.length;X++){const D=V[X];if(D.type===s.ElementType.CONTROL&&D.control){const E=D,U=E.controlId||ft(),F=E.control?.value||[],Z=E.control?.placeholder||"",Q=E.control?.type,W=Q===s.ControlType.TEXTFIELD,K=Q===s.ControlType.TEXT||Q===s.ControlType.NUMBER,k=Q===s.ControlType.CHECKBOX,B=Q===s.ControlType.RADIO,H=Q===s.ControlType.BUTTON,A=W?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX,v=W?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX,ct={...O,controlId:U,type:s.ElementType.CONTROL,control:E.control},bt=W?i.control.textFixColor:K?"#87d068":H?vn().color:i.control.bracketColor,Qt=H?vn().highlight:void 0,Ce=W?E.control?.preTextFix||p.preTextFix:E.control?.prefix||p.prefix,Gt=be(Q,Ce);for(let z=0;z<Gt.length;z++)o.splice(r,0,{...ct,color:bt,highlight:Qt,originControlId:L,value:Gt[z],controlComponent:A}),r++;if(H){const z=lr(E.control);if(z){const G=Ln(z,E.control),J=bo(i.defaultColor);for(let it=0;it<G.length;it++){const q=G[it];o.splice(r,0,{...ct,...J,originControlId:L,value:q.value===`
88
- `?_:q.value,buttonValueLayout:q.buttonValueLayout,buttonValueLayoutPrefixOffset:q.buttonValueLayoutPrefixOffset,controlComponent:s.ControlComponent.VALUE}),r++}}else{const G=Ui(E.control),J=Nt(G);for(let it=0;it<J.length;it++){const q=J[it];o.splice(r,0,{...ct,color:i.control.placeholderColor,originControlId:L,value:q===`
87
+ `?_:Z,letterSpacing:Q?m.gap:0,control:a.control,controlComponent:s.ControlComponent.VALUE}),X++,r++}}}}else{if((!R||!R.length)&&Array.isArray(C)&&C.length){const X=g?g.split(","):[];if(X.length>1){const D=[];for(const E of X){const U=C.find(F=>F.code===E.trim());U&&D.push({value:U.value})}D.length>0&&(V=D)}else{const D=C.find(E=>E.code===g);D&&(V=[{value:D.value}])}}const N=vn(a.control.valueLayout);f===s.ControlType.BUTTON&&(N.newline||N.indentChars>0)&&(V=[{value:Ui(V)}]);for(let X=0;X<V.length;X++){const D=V[X];if(D.type===s.ElementType.CONTROL&&D.control){const E=D,U=E.controlId||ft(),F=E.control?.value||[],Z=E.control?.placeholder||"",Q=E.control?.type,W=Q===s.ControlType.TEXTFIELD,K=Q===s.ControlType.TEXT||Q===s.ControlType.NUMBER,k=Q===s.ControlType.CHECKBOX,B=Q===s.ControlType.RADIO,H=Q===s.ControlType.BUTTON,A=W?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX,v=W?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX,ct={...O,controlId:U,type:s.ElementType.CONTROL,control:E.control},bt=W?i.control.textFixColor:K?"#87d068":H?Zn().color:i.control.bracketColor,Qt=H?Zn().highlight:void 0,me=W?E.control?.preTextFix||p.preTextFix:E.control?.prefix||p.prefix,Gt=be(Q,me);for(let z=0;z<Gt.length;z++)o.splice(r,0,{...ct,color:bt,highlight:Qt,originControlId:L,value:Gt[z],controlComponent:A}),r++;if(H){const z=lr(E.control);if(z){const G=Ln(z,E.control),J=bo(i.defaultColor);for(let it=0;it<G.length;it++){const q=G[it];o.splice(r,0,{...ct,...J,originControlId:L,value:q.value===`
88
+ `?_:q.value,buttonValueLayout:q.buttonValueLayout,buttonValueLayoutPrefixOffset:q.buttonValueLayoutPrefixOffset,controlComponent:s.ControlComponent.VALUE}),r++}}else{const G=Yi(E.control),J=Nt(G);for(let it=0;it<J.length;it++){const q=J[it];o.splice(r,0,{...ct,color:i.control.placeholderColor,originControlId:L,value:q===`
89
89
  `?_:q,controlComponent:s.ControlComponent.PLACEHOLDER}),r++}}}else if(k){const z=E.control?.valueSets||[],G=E.control?.code||"",J=G?G.split(","):[];for(let it=0;it<z.length;it++){const q=z[it];o.splice(r,0,{...ct,...P,originControlId:L,value:"",controlComponent:s.ControlComponent.CHECKBOX,checkbox:{code:q.code,value:J.includes(q.code)}}),r++;const ut=Nt(q.value||"");for(let gt=0;gt<ut.length;gt++){const Ot=ut[gt],Et=gt===ut.length-1;o.splice(r,0,{...ct,...y,originControlId:L,value:Ot===`
90
90
  `?_:Ot,letterSpacing:Et?I.gap:0,controlComponent:s.ControlComponent.VALUE}),r++}}}else if(B){const z=E.control?.valueSets||[],G=E.control?.code||"";for(let J=0;J<z.length;J++){const it=z[J];o.splice(r,0,{...ct,...P,originControlId:L,value:"",controlComponent:s.ControlComponent.RADIO,radio:{code:it.code,value:G===it.code}}),r++;const q=Nt(it.value||"");for(let ut=0;ut<q.length;ut++){const gt=q[ut],Ot=ut===q.length-1;o.splice(r,0,{...ct,...y,originControlId:L,value:gt===`
91
91
  `?_:gt,letterSpacing:Ot?m.gap:0,controlComponent:s.ControlComponent.VALUE}),r++}}}else if(F.length>0)for(let z=0;z<F.length;z++){const G=F[z];if(G.type===s.ElementType.CONTROL&&G.control){const J=G,it=J.controlId||ft(),q=J.control?.value||[],ut=J.control?.type,gt=ut===s.ControlType.TEXTFIELD,Ot=ut===s.ControlType.TEXT||ut===s.ControlType.NUMBER,Et={...ct,controlId:it,control:J.control},yt=gt?i.control.textFixColor:Ot?"#87d068":i.control.bracketColor,Mt=gt?J.control?.preTextFix||p.preTextFix:J.control?.prefix||p.prefix,Ft=be(ut,Mt);for(let pt=0;pt<Ft.length;pt++)o.splice(r,0,{...Et,color:yt,originControlId:U,value:Ft[pt],controlComponent:gt?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX}),r++;for(let pt=0;pt<q.length;pt++){const ht=q[pt];if(ht.type===s.ElementType.MENSTRUAL_HISTORY||ht.type===s.ElementType.FETAL_HEART_POSITION||ht.type===s.ElementType.TOOTH_POSITION||ht.type===s.ElementType.IMAGE||ht.type===s.ElementType.MACRO||ht.type===s.ElementType.CUSTOM_MACRO||ht.type===s.ElementType.REUSABLE_ITEM||ht.type===s.ElementType.SUB_TEMPLATE||ht.type===s.ElementType.SPECIAL_SYMBOLS){const Ct=ht.id||ft();o.splice(r,0,{...Et,...ht,id:Ct,originControlId:U,controlComponent:s.ControlComponent.VALUE,type:ht.type})}else o.splice(r,0,{...Et,...y,...ht,originControlId:U,value:ht.value===`
92
- `?_:ht.value,controlComponent:s.ControlComponent.VALUE});r++}if(q.length===0){const pt=J.control?.placeholder||"";if(pt){const ht=Nt(pt);for(let Lt=0;Lt<ht.length;Lt++)o.splice(r,0,{...Et,color:i.control.placeholderColor,originControlId:U,value:ht[Lt],controlComponent:s.ControlComponent.PLACEHOLDER}),r++}}const Vt=gt?J.control?.postTextFix||p.postTextFix:J.control?.postfix||p.postfix,_t=be(ut,Vt);for(let pt=0;pt<_t.length;pt++)o.splice(r,0,{...Et,color:yt,originControlId:U,value:_t[pt],controlComponent:gt?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX}),r++}else o.splice(r,0,{...ct,...y,...G,originControlId:L,value:G.value===`
92
+ `?_:ht.value,controlComponent:s.ControlComponent.VALUE});r++}if(q.length===0){const pt=J.control?.placeholder||"";if(pt){const ht=Nt(pt);for(let Lt=0;Lt<ht.length;Lt++)o.splice(r,0,{...Et,color:i.control.placeholderColor,originControlId:U,value:ht[Lt],controlComponent:s.ControlComponent.PLACEHOLDER}),r++}}const Vt=gt?J.control?.postTextFix||p.postTextFix:J.control?.postfix||p.postfix,Bt=be(ut,Vt);for(let pt=0;pt<Bt.length;pt++)o.splice(r,0,{...Et,color:yt,originControlId:U,value:Bt[pt],controlComponent:gt?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX}),r++}else o.splice(r,0,{...ct,...y,...G,originControlId:L,value:G.value===`
93
93
  `?_:G.value,controlComponent:s.ControlComponent.VALUE}),r++}else if(Z){const z=Nt(Z);for(let G=0;G<z.length;G++)o.splice(r,0,{...ct,color:i.control.placeholderColor,originControlId:L,value:z[G],controlComponent:s.ControlComponent.PLACEHOLDER}),r++}else if((Q===s.ControlType.SELECT||Q===s.ControlType.DATE||Q===s.ControlType.NUMBER)&&!E.control?.code&&Z){const G=Nt(Z);for(let J=0;J<G.length;J++)o.splice(r,0,{...ct,color:i.control.placeholderColor,originControlId:L,value:G[J],controlComponent:s.ControlComponent.PLACEHOLDER}),r++}const Re=W?E.control?.postTextFix||p.postTextFix:E.control?.postfix||p.postfix,nt=be(Q,Re);for(let z=0;z<nt.length;z++)o.splice(r,0,{...ct,color:bt,highlight:Qt,originControlId:L,value:nt[z],controlComponent:v}),r++}else if(D.type===s.ElementType.MENSTRUAL_HISTORY||D.type===s.ElementType.FETAL_HEART_POSITION||D.type===s.ElementType.TOOTH_POSITION||D.type===s.ElementType.IMAGE||D.type===s.ElementType.MACRO||D.type===s.ElementType.CUSTOM_MACRO||D.type===s.ElementType.REUSABLE_ITEM||D.type===s.ElementType.SUB_TEMPLATE||D.type===s.ElementType.LIST||D.type===s.ElementType.SPECIAL_SYMBOLS){const E=D.id||ft();D.id||(D.id=E);const U=a.control?.value;if(U){const F=U.find(Z=>Z.id===E||Z.type===D.type&&Z.value===D.value);F&&No(E,F)}o.splice(r,0,{...O,...D,id:E,controlId:L,control:a.control,controlComponent:s.ControlComponent.VALUE,type:D.type}),r++}else{const E=f===s.ControlType.BUTTON?Ln(D.value||"",a.control):Nt(D.value||"").map(U=>({value:U}));for(let U=0;U<E.length;U++){const F=E[U];o.splice(r,0,{...O,...y,...f===s.ControlType.BUTTON?bo(i.defaultColor):{},...D,buttonValueLayout:F.buttonValueLayout,buttonValueLayoutPrefixOffset:F.buttonValueLayoutPrefixOffset,controlId:L,value:F.value===`
94
94
  `?_:F.value,type:f===s.ControlType.BUTTON?s.ElementType.CONTROL:D.type||s.ElementType.TEXT,control:a.control,controlComponent:s.ControlComponent.VALUE}),r++}}}}}else if(Y){const V={...P,color:i.control.placeholderColor},N=Nt(Y);for(let X=0;X<N.length;X++){const D=N[X];o.splice(r,0,{...O,...V,controlId:L,value:D===`
95
95
  `?_:D,type:a.type,control:a.control,controlComponent:s.ControlComponent.PLACEHOLDER}),r++}}if(h){const V=Nt(h);for(let N=0;N<V.length;N++){const X=V[N];o.splice(r,0,{...O,...P,controlId:L,value:X,type:a.type,control:a.control,controlComponent:s.ControlComponent.POST_TEXT}),r++}}const M=be(f,d||p.postfix);for(let V=0;V<M.length;V++){const N=M[V];o.splice(r,0,{...O,...S,controlId:L,value:N===`
@@ -97,39 +97,39 @@ ${a}`),l}function lr(o){return Wi(o.value)}function Ui(o){return o.placeholder||
97
97
  `||a.value==`\r
98
98
  `)&&(a.value=_),(a.type===s.ElementType.IMAGE||a.type===s.ElementType.BLOCK)&&(a.id=a.id||ft()),a.type===s.ElementType.LATEX){const{svg:c,width:d,height:u}=qs.convertLaTextToSVG(a.value);a.width=a.width||d,a.height=a.height||u,a.laTexSVG=c,a.id=a.id||ft()}(a.type===s.ElementType.MACRO||a.type===s.ElementType.CUSTOM_MACRO||a.type===s.ElementType.REUSABLE_ITEM)&&(a.id=a.id||ft()),(a.type===s.ElementType.MENSTRUAL_HISTORY||a.type===s.ElementType.TOOTH_POSITION||a.type===s.ElementType.FETAL_HEART_POSITION||a.type===s.ElementType.SPECIAL_SYMBOLS)&&(a.id=a.id||ft()),r++}}function Sc(o,t){const e=Object.keys(o),n=Object.keys(t);if(e.length!==n.length)return!1;for(let i=0;i<e.length;i++){const l=e[i];if(l!=="value"&&!(l==="groupIds"&&Array.isArray(o[l])&&Array.isArray(t[l])&&ks(o[l],t[l]))&&o[l]!==t[l])return!1}return!0}function hn(o,t={}){const{extraPickAttrs:e}=t,n=[...Va];e&&n.push(...e);const i={value:o?.value===_?`
99
99
  `:o?.value};return o&&n.forEach(l=>{const r=o[l];r!==void 0&&(i[l]=r)}),i}function Ut(o,t={}){const{extraPickAttrs:e,isClassifyArea:n=!1,isClone:i=!0,editorOptions:l}=t,r=(i?rt(o):o).filter(R=>R.type!==s.ElementType.SPLIT_TAG),a=[];let c=0;const d=R=>R===s.ControlComponent.PREFIX||R===s.ControlComponent.PRETEXTFIX||R===s.ControlComponent.PRETEXTFIX_TEXT||R===s.ControlComponent.PRE_TEXT,u=R=>{const T=l?.control;switch(R.controlComponent){case s.ControlComponent.PRETEXTFIX:return R.control?.preTextFix||T?.preTextFix||"";case s.ControlComponent.PRETEXTFIX_TEXT:return R.control?.preTextFixText||T?.preTextFixText||"";case s.ControlComponent.PRE_TEXT:return R.control?.preText||"";default:return R.control?.prefix||T?.prefix||""}},h=(R,T)=>{if(R.value!==_||!R.controlId||!d(R.controlComponent)||!T||T.controlId!==R.controlId||(T.originControlId||null)!==(R.originControlId||null)||T.controlComponent!==R.controlComponent||T.value===_)return!1;const g=R.control?.type;return be(g,u(R))[0]!==`
100
- `};for(;c<r.length;){let R=r[c];if(h(R,r[c+1])&&(R=rt(R),delete R.type,delete R.control,delete R.controlId,delete R.originControlId,delete R.controlComponent),c===0&&R.value===_&&!R.listId&&(!R.type||R.type===s.ElementType.TEXT)){c++;continue}if(R.areaId){const g=R.areaId,f=R.area,C=[];for(;c<r.length;){const I=r[c];if(g!==I.areaId){c--;break}delete I.area,delete I.areaId,C.push(I),c++}const p=Ut(C,t);if(n){const I={type:s.ElementType.AREA,value:"",areaId:g,area:f};I.valueList=p,R=I}else{a.splice(c,0,...p);continue}}else if(R.titleId&&R.level){const g=R.titleId;if(g){const f=R.level,C={type:s.ElementType.TITLE,title:R.title,titleId:g,value:"",level:f},p=[];for(;c<r.length;){const I=r[c];if(g!==I.titleId){c--;break}delete I.level,delete I.title,p.push(I),c++}C.valueList=Ut(p,t),R=C}}else if(R.listId&&R.listType){const g=R.listId;if(g){const f=R.listType,C=R.listStyle,p=R?.label,I={type:s.ElementType.LIST,value:"",label:p||"",listId:g,listType:f,listStyle:C},m=[];for(;c<r.length;){const L=r[c];if(g!==L.listId){c--;break}delete L.listType,delete L.listStyle,m.push(L),c++}I.valueList=Ut(m,t),R=I}}else if(R.type===s.ElementType.TABLE){if(R.pagingId){let g=c+1,f=0;for(;g<r.length;){const C=r[g];if(C.pagingId===R.pagingId){R.height+=C.height;const p=C.trList.filter(I=>!I.pagingRepeat).filter(I=>(I.tdList=I.tdList.filter(m=>{if(m.originalId){for(let L=0;L<R.trList.length;L++){const P=R.trList[L].tdList.find(({id:S})=>S===m.originalId);if(P){m.value[0]?.type===s.ElementType.SPLIT_TAG&&m.value.splice(0,1),P.value.push(...m.value),P.rowspan=P.originalRowspan??P.rowspan;break}}return!1}return!0}),!I.originalId));R.trList.push(...p),R.trList?.forEach(I=>I.minHeight=I.originalMinHeight??I.minHeight),g++,f++}else break}c+=f}if(R.trList)for(let g=0;g<R.trList.length;g++){const f=R.trList[g];delete f.id;for(let C=0;C<f.tdList.length;C++){const p=f.tdList[C],I={colspan:p.colspan,rowspan:p.rowspan,value:Ut(p.value,{...t,isClassifyArea:!1})};Wa.forEach(m=>{const L=p[m];L!==void 0&&(I[m]=L)}),f.tdList[C]=I}}}else if(R.type===s.ElementType.HYPERLINK){const g=R.hyperlinkId;if(g){const f={type:s.ElementType.HYPERLINK,value:"",url:R.url},C=[];for(;c<r.length;){const p=r[c];if(g!==p.hyperlinkId){c--;break}delete p.type,delete p.url,C.push(p),c++}f.valueList=Ut(C,t),R=f}}else if(R.type===s.ElementType.DATE){const g=R.dateId;if(g){const f={type:s.ElementType.DATE,value:"",dateFormat:R.dateFormat},C=[];for(;c<r.length;){const p=r[c];if(g!==p.dateId){c--;break}delete p.type,delete p.dateFormat,C.push(p),c++}f.valueList=Ut(C,t),R=f}}else if(R.type!==s.ElementType.BUTTON){if(R.controlId){const g=R.controlId;if(!(R.controlComponent===s.ControlComponent.PREFIX||R.controlComponent===s.ControlComponent.PRETEXTFIX||R.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&R.controlComponent===s.ControlComponent.VALUE){if(R.type===s.ElementType.MENSTRUAL_HISTORY||R.type===s.ElementType.FETAL_HEART_POSITION||R.type===s.ElementType.TOOTH_POSITION||R.type===s.ElementType.IMAGE||R.type===s.ElementType.MACRO||R.type===s.ElementType.CUSTOM_MACRO||R.type===s.ElementType.REUSABLE_ITEM||R.type===s.ElementType.LIST||R.type===s.ElementType.SPECIAL_SYMBOLS){let m=!1;for(let L=c-1;L>=0;L--){const O=r[L],P=O.controlComponent===s.ControlComponent.PREFIX||O.controlComponent===s.ControlComponent.PRETEXTFIX||O.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT;if(O.controlId===g&&P){m=!0;break}if(O.controlId!==g)break}if(!m){const L=rt(R);delete L.controlId,delete L.control,delete L.controlComponent,delete L.originControlId,a.push(L),c++;continue}}c++;continue}if(R.controlComponent===s.ControlComponent.PLACEHOLDER||R.controlComponent===s.ControlComponent.POSTFIX||R.controlComponent===s.ControlComponent.POSTTEXTFIX||R.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||R.controlComponent===s.ControlComponent.POST_TEXT||R.controlComponent===s.ControlComponent.PRE_TEXT||R.controlComponent===s.ControlComponent.CHECKBOX||R.controlComponent===s.ControlComponent.RADIO){c++;continue}const C=(I,m,L,O)=>{if(O===s.ControlType.CHECKBOX||O===s.ControlType.RADIO){let S=-1;for(let y=I;y<r.length&&r[y].controlId===m;y++)S=y;return S}const P=L?[s.ControlComponent.POSTTEXTFIX,s.ControlComponent.POSTTEXTFIX_TEXT]:[s.ControlComponent.POSTFIX];for(let S=I;S<r.length;S++){const y=r[S];if(y.controlId===m&&P.includes(y.controlComponent))return S}return-1},p=(I,m,L)=>{const O=[];let P=I;for(;P<=m;){const S=r[P];if(me(S)){P++;continue}if(S.controlId&&S.controlId!==L&&S.control){const V=S.control?.type,N=V===s.ControlType.TEXTFIELD,X=N?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX,D=S.controlComponent===X,E=V===s.ControlType.CHECKBOX||V===s.ControlType.RADIO;if(D||E&&(S.controlComponent===s.ControlComponent.CHECKBOX||S.controlComponent===s.ControlComponent.RADIO)){const U=C(P+1,S.controlId,N,V);if(U!==-1){const F=r.slice(P,U+1).map(Q=>{const W=rt(Q);return delete W.originControlId,W}),Z=Ut(F,t);Z.length>0&&O.push(Z[0]),P=U+1;continue}}}if(!(S.controlId===L&&(S.controlComponent===s.ControlComponent.VALUE||!S.controlComponent)&&(!S.originControlId||S.originControlId===L)||S.originControlId===L&&S.controlComponent===s.ControlComponent.VALUE||S.controlId===L&&(S.controlComponent===s.ControlComponent.CHECKBOX||S.controlComponent===s.ControlComponent.RADIO)&&!S.originControlId)){P++;continue}if(S.type===s.ElementType.MENSTRUAL_HISTORY||S.type===s.ElementType.FETAL_HEART_POSITION||S.type===s.ElementType.TOOTH_POSITION||S.type===s.ElementType.IMAGE||S.type===s.ElementType.MACRO||S.type===s.ElementType.CUSTOM_MACRO||S.type===s.ElementType.REUSABLE_ITEM||S.type===s.ElementType.SUB_TEMPLATE||S.type===s.ElementType.LIST||S.type===s.ElementType.SPECIAL_SYMBOLS){const V=rt(S);delete V.controlId,delete V.control,delete V.controlComponent,delete V.originControlId,O.push(V),P++;continue}if(S.controlComponent===s.ControlComponent.CHECKBOX||S.controlComponent===s.ControlComponent.RADIO){O.push(rt(S)),P++;continue}const b=R.control?.type;if(b===s.ControlType.CHECKBOX||b===s.ControlType.RADIO){let V=P-1,N=!1;for(;V>=I-1;){const X=r[V];if(X.controlId===L&&!X.originControlId)if(X.controlComponent===s.ControlComponent.CHECKBOX){N=X.checkbox?.value===!0;break}else if(X.controlComponent===s.ControlComponent.RADIO){N=X.radio?.value===!0;break}else if(X.controlComponent===s.ControlComponent.VALUE){V--;continue}else break;V--}if(N){const X={value:S.value||""},D=[...ce,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const E of D){const U=S[E];if(U!==void 0){if(E==="color"&&l){const F=l.control?.bracketColor,Z=l.control?.placeholderColor;if(U===F||U===Z)continue}X[E]=U}}O.push(X)}}else{const V={value:S.value||""},N=[...ce,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const X of N){const D=S[X];if(D!==void 0){if(X==="color"&&l){const E=l.control?.bracketColor,U=l.control?.placeholderColor;if(D===E||D===U)continue}V[X]=D}}O.push(V)}P++}return O};if(R.controlComponent===s.ControlComponent.PREFIX){const I=R.control?.type===s.ControlType.TEXTFIELD,m=C(c+1,g,I);if(m!==-1){const L=p(c+1,m-1,g),O=xt(R,ue),S=R.control?.type===s.ControlType.BUTTON&&!R.control?.buttonText?L.length?L:null:L,y={...R.control,...O,value:S},Y={...xt(R,ce),type:s.ElementType.CONTROL,value:"",control:y,controlId:g};R=hn(Y,{extraPickAttrs:e}),c=m}}if(R.controlComponent===s.ControlComponent.PRETEXTFIX){const I=C(c+1,g,!0);if(I!==-1){const m=p(c+1,I-1,g),L=xt(R,ue),O={...R.control,...L,value:m},P={...xt(R,ce),type:s.ElementType.CONTROL,value:"",control:O,controlId:g};R=hn(P,{extraPickAttrs:e}),c=I}}if(R.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){const I=C(c+1,g,!0);if(I!==-1){const m=p(c+1,I-1,g),L=xt(R,ue),O={...R.control,...L,value:m},P={...xt(R,ce),type:s.ElementType.CONTROL,value:"",control:O,controlId:g};R=hn(P,{extraPickAttrs:e}),c=I}}}}const T=hn(R,{extraPickAttrs:e});if(!R.type||R.type===s.ElementType.TEXT||R.type===s.ElementType.SUBSCRIPT||R.type===s.ElementType.SUPERSCRIPT)for(;c<r.length;){const g=r[c+1];if(c++,g&&Sc(T,hn(g,{extraPickAttrs:e}))){const f=g.value===_?`
101
- `:g.value;T.value+=f}else break}else c++;a.push(T)}return a}function ur(o){switch(window.getComputedStyle(o).textAlign){case"left":case"start":return s.RowFlex.LEFT;case"center":return s.RowFlex.CENTER;case"right":case"end":return s.RowFlex.RIGHT;case"justify":return s.RowFlex.ALIGNMENT;case"justify-all":return s.RowFlex.JUSTIFY;default:return s.RowFlex.LEFT}}function hr(o){return o===s.RowFlex.ALIGNMENT?"justify":o}function Dc(o){switch(o){case s.RowFlex.LEFT:return"flex-start";case s.RowFlex.CENTER:return"center";case s.RowFlex.RIGHT:return"flex-end";case s.RowFlex.ALIGNMENT:case s.RowFlex.JUSTIFY:return"space-between";default:return"flex-start"}}function Yo(o){return!o.type||Le.includes(o.type)}function Fc(o){return!o.type||o.type===s.ElementType.TEXT}function Rr(o){return o.filter(t=>Yo(t)).map(t=>t.value).join("").replace(new RegExp(_,"g"),"")}function Qn(o,t){const e=o[t];if(!e)return null;const n=o[t+1];return!e.listId&&e.value===_&&n&&n.value!==_&&e.areaId===n.areaId?n:e}function le(o,t,e,n){let i=Qn(o,e);if(!i)return;const{isBreakWhenWrap:l=!1,editorOptions:r,ignoreContextKeys:a=[]}=n||{},{mode:c}=r||{};c!==s.EditorMode.DESIGN&&i.title?.disabled&&(i=Ee(i,Oi));let d=!1;for(let u=0;u<t.length;u++){const h=t[u];if(l&&!i.listId&&mi.test(h.value)&&(d=!0),d||!i.listId&&h.type===s.ElementType.LIST){const T=[...In,...ce,...un];Bs(T,a),dn(T,i,h),h.valueList?.forEach(g=>{dn(T,i,g)});continue}h.valueList?.length&&le(o,h.valueList,e,n);const R=[...Di];An(h)||R.push(...ce),Bs(R,a),dn(R,i,h)}}function Xc(o,t){let e="span";o.type===s.ElementType.SUPERSCRIPT?e="sup":o.type===s.ElementType.SUBSCRIPT&&(e="sub");const n=document.createElement(e);return n.style.fontFamily=o.font||t.defaultFont,o.rowFlex&&(n.style.textAlign=hr(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",n.style.textDecorationStyle=o.textDecoration?.style||"solid"),o.strikeout&&(n.style.textDecoration+=" line-through"),o.type&&n.setAttribute("data-type",o.type),o.rowMargin&&(n.style.lineHeight=(o.rowMargin??t.defaultRowMargin).toString()),n.innerText=o.value.replace(new RegExp(`${_}`,"g"),`
102
- `),n}function gr(o){let t=0;const e=new Map;for(let n=0;n<o.length;n++){const i=o[n];if(n===0){if(i.checkbox)continue;i.value=i.value.replace(mi,"")}if(i.listWrap){const l=e.get(t)||[];l.push(i),e.set(t,l)}else{const l=i.value.split(`
103
- `);for(let r=0;r<l.length;r++){r>0&&(t+=1);const a=l[r],c=e.get(t)||[];c.push({...i,value:a}),e.set(t,c)}}}return e}function yc(o){const t=[];if(!o.length)return t;let e=o[0]?.rowFlex||null;t.push({rowFlex:e,data:[o[0]]});for(let n=1;n<o.length;n++){const i=o[n],l=i.rowFlex||null;e===l&&!An(i)&&!An(o[n-1])?t[t.length-1].data.push(i):(t.push({rowFlex:l,data:[i]}),e=l)}for(let n=0;n<t.length;n++){const i=t[n];i.data=Ut(i.data)}return t}function Kn(o,t){const e=yo(t),n=ar(e.mode)?Zn(Ut(o,{editorOptions:e})):o;function i(a){const c=document.createElement("div");for(let d=0;d<a.length;d++){const u=a[d];if(u.type===s.ElementType.TABLE){const h=document.createElement("table");h.setAttribute("cellSpacing","0"),h.setAttribute("cellpadding","0"),h.setAttribute("border","0");const R="1px solid #000000";!u.borderType||u.borderType===s.TableBorder.ALL?(h.style.borderTop=R,h.style.borderLeft=R):u.borderType===s.TableBorder.EXTERNAL&&(h.style.border=R),h.style.width=`${u.width}px`;const T=document.createElement("colgroup");for(let f=0;f<u.colgroup.length;f++){const C=u.colgroup[f],p=document.createElement("col");p.setAttribute("width",`${C.width}`),T.append(p)}h.append(T);const g=u.trList;for(let f=0;f<g.length;f++){const C=document.createElement("tr"),p=g[f];C.style.height=`${p.height}px`;for(let I=0;I<p.tdList.length;I++){const m=document.createElement("td");(!u.borderType||u.borderType===s.TableBorder.ALL)&&(m.style.borderBottom=m.style.borderRight="1px solid");const L=p.tdList[I];m.colSpan=L.colspan,m.rowSpan=L.rowspan,m.style.verticalAlign=L.verticalAlign||"top",L.borderTypes?.includes(s.TdBorder.TOP)&&(m.style.borderTop=R),L.borderTypes?.includes(s.TdBorder.RIGHT)&&(m.style.borderRight=R),L.borderTypes?.includes(s.TdBorder.BOTTOM)&&(m.style.borderBottom=R),L.borderTypes?.includes(s.TdBorder.LEFT)&&(m.style.borderLeft=R);const O=Kn(L.value,t);m.innerHTML=O.innerHTML,L.backgroundColor&&(m.style.backgroundColor=L.backgroundColor),C.append(m)}h.append(C)}c.append(h)}else if(u.type===s.ElementType.HYPERLINK){const h=document.createElement("a");h.innerText=u.valueList.map(R=>R.value).join(""),u.url&&(h.href=u.url),c.append(h)}else if(u.type===s.ElementType.TITLE){const h=document.createElement(`h${Ni[u.level]}`),R=i(u.valueList);h.innerHTML=R.innerHTML,c.append(h)}else if(u.type===s.ElementType.LIST){const h=document.createElement(Ja[u.listType]);u.listStyle&&(h.style.listStyleType=$a[u.listStyle]);const R=Ut(u.valueList);gr(R).forEach(g=>{const f=document.createElement("li"),C=i(g);f.innerHTML=C.innerHTML,h.append(f)}),c.append(h)}else if(u.type===s.ElementType.IMAGE){const h=document.createElement("img");u.value&&(h.src=u.value,h.width=u.width,h.height=u.height),c.append(h)}else if(u.type===s.ElementType.BLOCK){if(u.block?.type===s.BlockType.VIDEO){const h=u.block.videoBlock?.src;if(h){const R=document.createElement("video");R.style.display="block",R.controls=!0,R.src=h,R.width=u.width||t?.width||window.innerWidth,R.height=u.height,c.append(R)}}else if(u.block?.type===s.BlockType.IFRAME){const{src:h,srcdoc:R,sandbox:T,allow:g}=u.block.iframeBlock||{};if(h||R){const f=document.createElement("iframe");f.sandbox.add(...T||Un.sandbox),f.setAttribute("allow",[g||Un.allow].join(" ")),f.style.display="block",f.style.border="none",h?f.src=h:R&&(f.srcdoc=R),f.width=`${u.width||t?.width||window.innerWidth}`,f.height=`${u.height}`,c.append(f)}}}else if(u.type===s.ElementType.SEPARATOR){const h=document.createElement("hr");u.dashArray?.length&&h.setAttribute("data-dash-array",u.dashArray.join(",")),c.append(h)}else if(u.type===s.ElementType.CHECKBOX){const h=document.createElement("input");h.type="checkbox",u.checkbox?.value&&h.setAttribute("checked","true"),c.append(h)}else if(u.type===s.ElementType.RADIO){const h=document.createElement("input");h.type="radio",u.radio?.value&&h.setAttribute("checked","true"),c.append(h)}else if(u.type===s.ElementType.TAB){const h=document.createElement("span");h.innerHTML=`${Qs}${Qs}`,c.append(h)}else if(u.type===s.ElementType.CONTROL){const h=document.createElement("span"),R=i(u.control?.value||[]);h.innerHTML=R.innerHTML,c.append(h)}else if(u.type===s.ElementType.PAGE_BREAK){const h=document.createElement("div");h.style.breakAfter="page",c.append(h)}else if(!u.type||u.type===s.ElementType.LATEX||Le.includes(u.type)){let h="";if(u.type===s.ElementType.DATE?h=u.valueList?.map(T=>T.value).join("")||"":h=u.value,!h)continue;const R=Xc(u,e);a[d-1]?.type===s.ElementType.TITLE&&(h=h.replace(/^\n/,"")),R.innerText=h.replace(new RegExp(`${_}`,"g"),`
104
- `),c.append(R)}}return c}const l=document.createElement("div"),r=yc(n);for(let a=0;a<r.length;a++){const c=r[a],d=!c.rowFlex||c.rowFlex===s.RowFlex.LEFT,u=document.createElement("div");if(!d){const h=c.data[0];An(h)?(u.style.display="flex",u.style.justifyContent=Dc(h.rowFlex)):(u.style.textAlign=hr(c.rowFlex),c.rowFlex==="justify"&&(u.style.textAlignLast="justify"))}u.innerHTML=i(c.data).innerHTML,d?u.childNodes.forEach(h=>{l.append(h.cloneNode(!0))}):l.append(u)}return l}function Nc(o){if(!o||o.nodeType!==3)return null;const t=o.parentNode,e=t.nodeName==="FONT"?t.parentNode:t,n=ur(e),i=o.textContent,l=window.getComputedStyle(e);if(!i||e.nodeName==="STYLE")return null;const r={value:i,color:l.color,bold:Number(l.fontWeight)>500,italic:l.fontStyle.includes("italic"),size:Math.floor(parseFloat(l.fontSize))};return e.nodeName==="SUB"||l.verticalAlign==="sub"?r.type=s.ElementType.SUBSCRIPT:(e.nodeName==="SUP"||l.verticalAlign==="super")&&(r.type=s.ElementType.SUPERSCRIPT),n!==s.RowFlex.LEFT&&(r.rowFlex=n),l.backgroundColor!=="rgba(0, 0, 0, 0)"&&(r.highlight=l.backgroundColor),l.textDecorationLine.includes("underline")&&(r.underline=!0),l.textDecorationLine.includes("line-through")&&(r.strikeout=!0),r}function Hn(o,t){const e=[];function n(c){if(c.nodeType===3){const d=Nc(c);d&&e.push(d)}else if(c.nodeType===1){const d=c.childNodes;for(let u=0;u<d.length;u++){const h=d[u];if(h.nodeName==="BR")e.push({value:`
105
- `});else if(h.nodeName==="A"){const R=h,T=R.innerText;T&&e.push({type:s.ElementType.HYPERLINK,value:"",valueList:[{value:T}],url:R.href})}else if(/H[1-6]/.test(h.nodeName)){const T=Hn(bc(h,"div").outerHTML,t);e.push({value:"",type:s.ElementType.TITLE,level:ja[h.nodeName],valueList:T}),h.nextSibling&&!wa.includes(h.nextSibling.nodeName)&&e.push({value:`
106
- `})}else if(h.nodeName==="UL"||h.nodeName==="OL"){const R=h,T={value:"",type:s.ElementType.LIST,valueList:[]};h.nodeName==="OL"?T.listType=s.ListType.OL:(T.listType=s.ListType.UL,T.listStyle=R.style.listStyleType),R.querySelectorAll("li").forEach(g=>{const f=Hn(g.innerHTML,t);f.forEach(C=>{C.value===`
100
+ `};for(;c<r.length;){let R=r[c];if(h(R,r[c+1])&&(R=rt(R),delete R.type,delete R.control,delete R.controlId,delete R.originControlId,delete R.controlComponent),c===0&&R.value===_&&!R.listId&&(!R.type||R.type===s.ElementType.TEXT)){c++;continue}if(R.areaId){const g=R.areaId,f=R.area,C=[];for(;c<r.length;){const I=r[c];if(g!==I.areaId){c--;break}delete I.area,delete I.areaId,C.push(I),c++}const p=Ut(C,t);if(n){const I={type:s.ElementType.AREA,value:"",areaId:g,area:f};I.valueList=p,R=I}else{a.splice(c,0,...p);continue}}else if(R.titleId&&R.level){const g=R.titleId;if(g){const f=R.level,C={type:s.ElementType.TITLE,title:R.title,titleId:g,value:"",level:f},p=[];for(;c<r.length;){const I=r[c];if(g!==I.titleId){c--;break}delete I.level,delete I.title,p.push(I),c++}C.valueList=Ut(p,t),R=C}}else if(R.listId&&R.listType){const g=R.listId;if(g){const f=R.listType,C=R.listStyle,p=R?.label,I={type:s.ElementType.LIST,value:"",label:p||"",listId:g,listType:f,listStyle:C},m=[];for(;c<r.length;){const L=r[c];if(g!==L.listId){c--;break}delete L.listType,delete L.listStyle,m.push(L),c++}I.valueList=Ut(m,t),R=I}}else if(R.type===s.ElementType.TABLE){if(R.pagingId){let g=c+1,f=0;for(;g<r.length;){const C=r[g];if(C.pagingId===R.pagingId){R.height+=C.height;const p=C.trList.filter(I=>!I.pagingRepeat).filter(I=>(I.tdList=I.tdList.filter(m=>{if(m.originalId){for(let L=0;L<R.trList.length;L++){const P=R.trList[L].tdList.find(({id:S})=>S===m.originalId);if(P){m.value[0]?.type===s.ElementType.SPLIT_TAG&&m.value.splice(0,1),P.value.push(...m.value),P.rowspan=P.originalRowspan??P.rowspan;break}}return!1}return!0}),!I.originalId));R.trList.push(...p),R.trList?.forEach(I=>I.minHeight=I.originalMinHeight??I.minHeight),g++,f++}else break}c+=f}if(R.trList)for(let g=0;g<R.trList.length;g++){const f=R.trList[g];delete f.id;for(let C=0;C<f.tdList.length;C++){const p=f.tdList[C],I={colspan:p.colspan,rowspan:p.rowspan,value:Ut(p.value,{...t,isClassifyArea:!1})};Wa.forEach(m=>{const L=p[m];L!==void 0&&(I[m]=L)}),f.tdList[C]=I}}}else if(R.type===s.ElementType.HYPERLINK){const g=R.hyperlinkId;if(g){const f={type:s.ElementType.HYPERLINK,value:"",url:R.url},C=[];for(;c<r.length;){const p=r[c];if(g!==p.hyperlinkId){c--;break}delete p.type,delete p.url,C.push(p),c++}f.valueList=Ut(C,t),R=f}}else if(R.type===s.ElementType.DATE){const g=R.dateId;if(g){const f={type:s.ElementType.DATE,value:"",dateFormat:R.dateFormat},C=[];for(;c<r.length;){const p=r[c];if(g!==p.dateId){c--;break}delete p.type,delete p.dateFormat,C.push(p),c++}f.valueList=Ut(C,t),R=f}}else if(R.type!==s.ElementType.BUTTON){if(R.controlId){const g=R.controlId;if(!(R.controlComponent===s.ControlComponent.PREFIX||R.controlComponent===s.ControlComponent.PRETEXTFIX||R.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&R.controlComponent===s.ControlComponent.VALUE){if(R.type===s.ElementType.MENSTRUAL_HISTORY||R.type===s.ElementType.FETAL_HEART_POSITION||R.type===s.ElementType.TOOTH_POSITION||R.type===s.ElementType.IMAGE||R.type===s.ElementType.MACRO||R.type===s.ElementType.CUSTOM_MACRO||R.type===s.ElementType.REUSABLE_ITEM||R.type===s.ElementType.LIST||R.type===s.ElementType.SPECIAL_SYMBOLS){let m=!1;for(let L=c-1;L>=0;L--){const O=r[L],P=O.controlComponent===s.ControlComponent.PREFIX||O.controlComponent===s.ControlComponent.PRETEXTFIX||O.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT;if(O.controlId===g&&P){m=!0;break}if(O.controlId!==g)break}if(!m){const L=rt(R);delete L.controlId,delete L.control,delete L.controlComponent,delete L.originControlId,a.push(L),c++;continue}}c++;continue}if(R.controlComponent===s.ControlComponent.PLACEHOLDER||R.controlComponent===s.ControlComponent.POSTFIX||R.controlComponent===s.ControlComponent.POSTTEXTFIX||R.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||R.controlComponent===s.ControlComponent.POST_TEXT||R.controlComponent===s.ControlComponent.PRE_TEXT||R.controlComponent===s.ControlComponent.CHECKBOX||R.controlComponent===s.ControlComponent.RADIO){c++;continue}const C=(I,m,L,O)=>{if(O===s.ControlType.CHECKBOX||O===s.ControlType.RADIO){let S=-1;for(let y=I;y<r.length&&r[y].controlId===m;y++)S=y;return S}const P=L?[s.ControlComponent.POSTTEXTFIX,s.ControlComponent.POSTTEXTFIX_TEXT]:[s.ControlComponent.POSTFIX];for(let S=I;S<r.length;S++){const y=r[S];if(y.controlId===m&&P.includes(y.controlComponent))return S}return-1},p=(I,m,L)=>{const O=[];let P=I;for(;P<=m;){const S=r[P];if(fe(S)){P++;continue}if(S.controlId&&S.controlId!==L&&S.control){const V=S.control?.type,N=V===s.ControlType.TEXTFIELD,X=N?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX,D=S.controlComponent===X,E=V===s.ControlType.CHECKBOX||V===s.ControlType.RADIO;if(D||E&&(S.controlComponent===s.ControlComponent.CHECKBOX||S.controlComponent===s.ControlComponent.RADIO)){const U=C(P+1,S.controlId,N,V);if(U!==-1){const F=r.slice(P,U+1).map(Q=>{const W=rt(Q);return delete W.originControlId,W}),Z=Ut(F,t);Z.length>0&&O.push(Z[0]),P=U+1;continue}}}if(!(S.controlId===L&&(S.controlComponent===s.ControlComponent.VALUE||!S.controlComponent)&&(!S.originControlId||S.originControlId===L)||S.originControlId===L&&S.controlComponent===s.ControlComponent.VALUE||S.controlId===L&&(S.controlComponent===s.ControlComponent.CHECKBOX||S.controlComponent===s.ControlComponent.RADIO)&&!S.originControlId)){P++;continue}if(S.type===s.ElementType.MENSTRUAL_HISTORY||S.type===s.ElementType.FETAL_HEART_POSITION||S.type===s.ElementType.TOOTH_POSITION||S.type===s.ElementType.IMAGE||S.type===s.ElementType.MACRO||S.type===s.ElementType.CUSTOM_MACRO||S.type===s.ElementType.REUSABLE_ITEM||S.type===s.ElementType.SUB_TEMPLATE||S.type===s.ElementType.LIST||S.type===s.ElementType.SPECIAL_SYMBOLS){const V=rt(S);delete V.controlId,delete V.control,delete V.controlComponent,delete V.originControlId,O.push(V),P++;continue}if(S.controlComponent===s.ControlComponent.CHECKBOX||S.controlComponent===s.ControlComponent.RADIO){O.push(rt(S)),P++;continue}const b=R.control?.type;if(b===s.ControlType.CHECKBOX||b===s.ControlType.RADIO){let V=P-1,N=!1;for(;V>=I-1;){const X=r[V];if(X.controlId===L&&!X.originControlId)if(X.controlComponent===s.ControlComponent.CHECKBOX){N=X.checkbox?.value===!0;break}else if(X.controlComponent===s.ControlComponent.RADIO){N=X.radio?.value===!0;break}else if(X.controlComponent===s.ControlComponent.VALUE){V--;continue}else break;V--}if(N){const X={value:S.value||""},D=[...ce,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const E of D){const U=S[E];if(U!==void 0){if(E==="color"&&l){const F=l.control?.bracketColor,Z=l.control?.placeholderColor;if(U===F||U===Z)continue}X[E]=U}}O.push(X)}}else{const V={value:S.value||""},N=[...ce,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const X of N){const D=S[X];if(D!==void 0){if(X==="color"&&l){const E=l.control?.bracketColor,U=l.control?.placeholderColor;if(D===E||D===U)continue}V[X]=D}}O.push(V)}P++}return O};if(R.controlComponent===s.ControlComponent.PREFIX){const I=R.control?.type===s.ControlType.TEXTFIELD,m=C(c+1,g,I);if(m!==-1){const L=p(c+1,m-1,g),O=xt(R,ue),S=R.control?.type===s.ControlType.BUTTON&&!R.control?.buttonText?L.length?L:null:L,y={...R.control,...O,value:S},Y={...xt(R,ce),type:s.ElementType.CONTROL,value:"",control:y,controlId:g};R=hn(Y,{extraPickAttrs:e}),c=m}}if(R.controlComponent===s.ControlComponent.PRETEXTFIX){const I=C(c+1,g,!0);if(I!==-1){const m=p(c+1,I-1,g),L=xt(R,ue),O={...R.control,...L,value:m},P={...xt(R,ce),type:s.ElementType.CONTROL,value:"",control:O,controlId:g};R=hn(P,{extraPickAttrs:e}),c=I}}if(R.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){const I=C(c+1,g,!0);if(I!==-1){const m=p(c+1,I-1,g),L=xt(R,ue),O={...R.control,...L,value:m},P={...xt(R,ce),type:s.ElementType.CONTROL,value:"",control:O,controlId:g};R=hn(P,{extraPickAttrs:e}),c=I}}}}const T=hn(R,{extraPickAttrs:e});if(!R.type||R.type===s.ElementType.TEXT||R.type===s.ElementType.SUBSCRIPT||R.type===s.ElementType.SUPERSCRIPT)for(;c<r.length;){const g=r[c+1];if(c++,g&&Sc(T,hn(g,{extraPickAttrs:e}))){const f=g.value===_?`
101
+ `:g.value;T.value+=f}else break}else c++;a.push(T)}return a}function ur(o){switch(window.getComputedStyle(o).textAlign){case"left":case"start":return s.RowFlex.LEFT;case"center":return s.RowFlex.CENTER;case"right":case"end":return s.RowFlex.RIGHT;case"justify":return s.RowFlex.ALIGNMENT;case"justify-all":return s.RowFlex.JUSTIFY;default:return s.RowFlex.LEFT}}function hr(o){return o===s.RowFlex.ALIGNMENT?"justify":o}function Dc(o){switch(o){case s.RowFlex.LEFT:return"flex-start";case s.RowFlex.CENTER:return"center";case s.RowFlex.RIGHT:return"flex-end";case s.RowFlex.ALIGNMENT:case s.RowFlex.JUSTIFY:return"space-between";default:return"flex-start"}}function Yo(o){return!o.type||Le.includes(o.type)}function Fc(o){return!o.type||o.type===s.ElementType.TEXT}function Rr(o){return o.filter(t=>Yo(t)).map(t=>t.value).join("").replace(new RegExp(_,"g"),"")}function Kn(o,t){const e=o[t];if(!e)return null;const n=o[t+1];return!e.listId&&e.value===_&&n&&n.value!==_&&e.areaId===n.areaId?n:e}function le(o,t,e,n){let i=Kn(o,e);if(!i)return;const{isBreakWhenWrap:l=!1,editorOptions:r,ignoreContextKeys:a=[]}=n||{},{mode:c}=r||{};c!==s.EditorMode.DESIGN&&i.title?.disabled&&(i=Ee(i,Si));let d=!1;for(let u=0;u<t.length;u++){const h=t[u];if(l&&!i.listId&&Ci.test(h.value)&&(d=!0),d||!i.listId&&h.type===s.ElementType.LIST){const T=[...In,...ce,...un];Bs(T,a),dn(T,i,h),h.valueList?.forEach(g=>{dn(T,i,g)});continue}h.valueList?.length&&le(o,h.valueList,e,n);const R=[...Fi];_n(h)||R.push(...ce),Bs(R,a),dn(R,i,h)}}function Xc(o,t){let e="span";o.type===s.ElementType.SUPERSCRIPT?e="sup":o.type===s.ElementType.SUBSCRIPT&&(e="sub");const n=document.createElement(e);return n.style.fontFamily=o.font||t.defaultFont,o.rowFlex&&(n.style.textAlign=hr(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",n.style.textDecorationStyle=o.textDecoration?.style||"solid"),o.strikeout&&(n.style.textDecoration+=" line-through"),o.type&&n.setAttribute("data-type",o.type),o.rowMargin&&(n.style.lineHeight=(o.rowMargin??t.defaultRowMargin).toString()),n.innerText=o.value.replace(new RegExp(`${_}`,"g"),`
102
+ `),n}function gr(o){let t=0;const e=new Map;for(let n=0;n<o.length;n++){const i=o[n];if(n===0){if(i.checkbox)continue;i.value=i.value.replace(Ci,"")}if(i.listWrap){const l=e.get(t)||[];l.push(i),e.set(t,l)}else{const l=i.value.split(`
103
+ `);for(let r=0;r<l.length;r++){r>0&&(t+=1);const a=l[r],c=e.get(t)||[];c.push({...i,value:a}),e.set(t,c)}}}return e}function yc(o){const t=[];if(!o.length)return t;let e=o[0]?.rowFlex||null;t.push({rowFlex:e,data:[o[0]]});for(let n=1;n<o.length;n++){const i=o[n],l=i.rowFlex||null;e===l&&!_n(i)&&!_n(o[n-1])?t[t.length-1].data.push(i):(t.push({rowFlex:l,data:[i]}),e=l)}for(let n=0;n<t.length;n++){const i=t[n];i.data=Ut(i.data)}return t}function Hn(o,t){const e=yo(t),n=ar(e.mode)?Qn(Ut(o,{editorOptions:e})):o;function i(a){const c=document.createElement("div");for(let d=0;d<a.length;d++){const u=a[d];if(u.type===s.ElementType.TABLE){const h=document.createElement("table");h.setAttribute("cellSpacing","0"),h.setAttribute("cellpadding","0"),h.setAttribute("border","0");const R="1px solid #000000";!u.borderType||u.borderType===s.TableBorder.ALL?(h.style.borderTop=R,h.style.borderLeft=R):u.borderType===s.TableBorder.EXTERNAL&&(h.style.border=R),h.style.width=`${u.width}px`;const T=document.createElement("colgroup");for(let f=0;f<u.colgroup.length;f++){const C=u.colgroup[f],p=document.createElement("col");p.setAttribute("width",`${C.width}`),T.append(p)}h.append(T);const g=u.trList;for(let f=0;f<g.length;f++){const C=document.createElement("tr"),p=g[f];C.style.height=`${p.height}px`;for(let I=0;I<p.tdList.length;I++){const m=document.createElement("td");(!u.borderType||u.borderType===s.TableBorder.ALL)&&(m.style.borderBottom=m.style.borderRight="1px solid");const L=p.tdList[I];m.colSpan=L.colspan,m.rowSpan=L.rowspan,m.style.verticalAlign=L.verticalAlign||"top",L.borderTypes?.includes(s.TdBorder.TOP)&&(m.style.borderTop=R),L.borderTypes?.includes(s.TdBorder.RIGHT)&&(m.style.borderRight=R),L.borderTypes?.includes(s.TdBorder.BOTTOM)&&(m.style.borderBottom=R),L.borderTypes?.includes(s.TdBorder.LEFT)&&(m.style.borderLeft=R);const O=Hn(L.value,t);m.innerHTML=O.innerHTML,L.backgroundColor&&(m.style.backgroundColor=L.backgroundColor),C.append(m)}h.append(C)}c.append(h)}else if(u.type===s.ElementType.HYPERLINK){const h=document.createElement("a");h.innerText=u.valueList.map(R=>R.value).join(""),u.url&&(h.href=u.url),c.append(h)}else if(u.type===s.ElementType.TITLE){const h=document.createElement(`h${bi[u.level]}`),R=i(u.valueList);h.innerHTML=R.innerHTML,c.append(h)}else if(u.type===s.ElementType.LIST){const h=document.createElement(Ja[u.listType]);u.listStyle&&(h.style.listStyleType=$a[u.listStyle]);const R=Ut(u.valueList);gr(R).forEach(g=>{const f=document.createElement("li"),C=i(g);f.innerHTML=C.innerHTML,h.append(f)}),c.append(h)}else if(u.type===s.ElementType.IMAGE){const h=document.createElement("img");u.value&&(h.src=u.value,h.width=u.width,h.height=u.height),c.append(h)}else if(u.type===s.ElementType.BLOCK){if(u.block?.type===s.BlockType.VIDEO){const h=u.block.videoBlock?.src;if(h){const R=document.createElement("video");R.style.display="block",R.controls=!0,R.src=h,R.width=u.width||t?.width||window.innerWidth,R.height=u.height,c.append(R)}}else if(u.block?.type===s.BlockType.IFRAME){const{src:h,srcdoc:R,sandbox:T,allow:g}=u.block.iframeBlock||{};if(h||R){const f=document.createElement("iframe");f.sandbox.add(...T||Yn.sandbox),f.setAttribute("allow",[g||Yn.allow].join(" ")),f.style.display="block",f.style.border="none",h?f.src=h:R&&(f.srcdoc=R),f.width=`${u.width||t?.width||window.innerWidth}`,f.height=`${u.height}`,c.append(f)}}}else if(u.type===s.ElementType.SEPARATOR){const h=document.createElement("hr");u.dashArray?.length&&h.setAttribute("data-dash-array",u.dashArray.join(",")),c.append(h)}else if(u.type===s.ElementType.CHECKBOX){const h=document.createElement("input");h.type="checkbox",u.checkbox?.value&&h.setAttribute("checked","true"),c.append(h)}else if(u.type===s.ElementType.RADIO){const h=document.createElement("input");h.type="radio",u.radio?.value&&h.setAttribute("checked","true"),c.append(h)}else if(u.type===s.ElementType.TAB){const h=document.createElement("span");h.innerHTML=`${Qs}${Qs}`,c.append(h)}else if(u.type===s.ElementType.CONTROL){const h=document.createElement("span"),R=i(u.control?.value||[]);h.innerHTML=R.innerHTML,c.append(h)}else if(u.type===s.ElementType.PAGE_BREAK){const h=document.createElement("div");h.style.breakAfter="page",c.append(h)}else if(!u.type||u.type===s.ElementType.LATEX||Le.includes(u.type)){let h="";if(u.type===s.ElementType.DATE?h=u.valueList?.map(T=>T.value).join("")||"":h=u.value,!h)continue;const R=Xc(u,e);a[d-1]?.type===s.ElementType.TITLE&&(h=h.replace(/^\n/,"")),R.innerText=h.replace(new RegExp(`${_}`,"g"),`
104
+ `),c.append(R)}}return c}const l=document.createElement("div"),r=yc(n);for(let a=0;a<r.length;a++){const c=r[a],d=!c.rowFlex||c.rowFlex===s.RowFlex.LEFT,u=document.createElement("div");if(!d){const h=c.data[0];_n(h)?(u.style.display="flex",u.style.justifyContent=Dc(h.rowFlex)):(u.style.textAlign=hr(c.rowFlex),c.rowFlex==="justify"&&(u.style.textAlignLast="justify"))}u.innerHTML=i(c.data).innerHTML,d?u.childNodes.forEach(h=>{l.append(h.cloneNode(!0))}):l.append(u)}return l}function Nc(o){if(!o||o.nodeType!==3)return null;const t=o.parentNode,e=t.nodeName==="FONT"?t.parentNode:t,n=ur(e),i=o.textContent,l=window.getComputedStyle(e);if(!i||e.nodeName==="STYLE")return null;const r={value:i,color:l.color,bold:Number(l.fontWeight)>500,italic:l.fontStyle.includes("italic"),size:Math.floor(parseFloat(l.fontSize))};return e.nodeName==="SUB"||l.verticalAlign==="sub"?r.type=s.ElementType.SUBSCRIPT:(e.nodeName==="SUP"||l.verticalAlign==="super")&&(r.type=s.ElementType.SUPERSCRIPT),n!==s.RowFlex.LEFT&&(r.rowFlex=n),l.backgroundColor!=="rgba(0, 0, 0, 0)"&&(r.highlight=l.backgroundColor),l.textDecorationLine.includes("underline")&&(r.underline=!0),l.textDecorationLine.includes("line-through")&&(r.strikeout=!0),r}function An(o,t){const e=[];function n(c){if(c.nodeType===3){const d=Nc(c);d&&e.push(d)}else if(c.nodeType===1){const d=c.childNodes;for(let u=0;u<d.length;u++){const h=d[u];if(h.nodeName==="BR")e.push({value:`
105
+ `});else if(h.nodeName==="A"){const R=h,T=R.innerText;T&&e.push({type:s.ElementType.HYPERLINK,value:"",valueList:[{value:T}],url:R.href})}else if(/H[1-6]/.test(h.nodeName)){const T=An(bc(h,"div").outerHTML,t);e.push({value:"",type:s.ElementType.TITLE,level:ja[h.nodeName],valueList:T}),h.nextSibling&&!wa.includes(h.nextSibling.nodeName)&&e.push({value:`
106
+ `})}else if(h.nodeName==="UL"||h.nodeName==="OL"){const R=h,T={value:"",type:s.ElementType.LIST,valueList:[]};h.nodeName==="OL"?T.listType=s.ListType.OL:(T.listType=s.ListType.UL,T.listStyle=R.style.listStyleType),R.querySelectorAll("li").forEach(g=>{const f=An(g.innerHTML,t);f.forEach(C=>{C.value===`
107
107
  `&&(C.listWrap=!0)}),f.unshift({value:`
108
108
  `}),T.valueList.push(...f)}),e.push(T)}else if(h.nodeName==="HR")e.push({value:`
109
109
  `,type:s.ElementType.SEPARATOR});else if(h.nodeName==="IMG"){const{src:R,width:T,height:g}=h;R&&T&&g&&e.push({width:T,height:g,value:R,type:s.ElementType.IMAGE,rowFlex:ur(h.parentElement)})}else if(h.nodeName==="VIDEO"){const{src:R,width:T,height:g}=h;R&&T&&g&&e.push({value:"",type:s.ElementType.BLOCK,block:{type:s.BlockType.VIDEO,videoBlock:{src:R}},width:T,height:g})}else if(h.nodeName==="IFRAME"){const{src:R,srcdoc:T,width:g,height:f}=h;(R||T)&&g&&f&&e.push({value:"",type:s.ElementType.BLOCK,block:{type:s.BlockType.IFRAME,iframeBlock:{src:R,srcdoc:T}},width:parseInt(g),height:parseInt(f)})}else if(h.nodeName==="TABLE"){const R=h,T={type:s.ElementType.TABLE,value:`
110
- `,colgroup:[],trList:[]},g=R.querySelectorAll("colgroup col");if(R.querySelectorAll("tr").forEach(f=>{const C=Number(window.getComputedStyle(f).height.replace("px","")),p={height:C,minHeight:C,tdList:[]};f.querySelectorAll("th,td").forEach(I=>{const m=I,L=Hn(m.innerHTML,t),O={colspan:m.colSpan,rowspan:m.rowSpan,value:L,verticalAlign:window.getComputedStyle(I).verticalAlign,width:parseFloat(window.getComputedStyle(I).width)};m.style.backgroundColor&&(O.backgroundColor=m.style.backgroundColor),p.tdList.push(O)}),T.trList.push(p)}),T.trList.length){const f=T.trList[0].tdList.reduce((p,I)=>p+I.colspan,0),C=Math.ceil(t.innerWidth/f);for(let p=0;p<f;p++){const I=g[p]?.getAttribute("width");T.colgroup.push({width:I?parseFloat(I):C})}e.push(T)}}else if(h.nodeName==="INPUT"&&h.type===s.ControlComponent.CHECKBOX)e.push({type:s.ElementType.CHECKBOX,value:"",checkbox:{value:h.checked}});else if(h.nodeName==="INPUT"&&h.type===s.ControlComponent.RADIO)e.push({type:s.ElementType.RADIO,value:"",radio:{value:h.checked}});else if(n(h),h.nodeType===1&&u!==d.length-1){const R=h;window.getComputedStyle(R).display==="block"&&!/(\n|\r\n)$/.test(R.textContent)&&e.push({value:`
111
- `})}}}}const i=document.createElement("div");document.body.appendChild(i);const l=i.attachShadow({mode:"open"}),r=document.createElement("div");r.innerHTML=o,l.appendChild(r);const a=[];return r.childNodes.forEach(c=>{c.nodeType!==1&&!c.textContent?.trim()&&a.push(c)}),a.forEach(c=>c.remove()),n(r),i.remove(),e}function Pn(o,t){const e=t?yo(t):void 0;if(e?.mode===s.EditorMode.COMPARE)return wi(o);const n=ar(e?.mode)?Zn(Ut(o,{editorOptions:e})):Ut(o);function i(l){let r="";for(let a=0;a<l.length;a++){const c=l[a];if(c.type===s.ElementType.TABLE){r+=`
110
+ `,colgroup:[],trList:[]},g=R.querySelectorAll("colgroup col");if(R.querySelectorAll("tr").forEach(f=>{const C=Number(window.getComputedStyle(f).height.replace("px","")),p={height:C,minHeight:C,tdList:[]};f.querySelectorAll("th,td").forEach(I=>{const m=I,L=An(m.innerHTML,t),O={colspan:m.colSpan,rowspan:m.rowSpan,value:L,verticalAlign:window.getComputedStyle(I).verticalAlign,width:parseFloat(window.getComputedStyle(I).width)};m.style.backgroundColor&&(O.backgroundColor=m.style.backgroundColor),p.tdList.push(O)}),T.trList.push(p)}),T.trList.length){const f=T.trList[0].tdList.reduce((p,I)=>p+I.colspan,0),C=Math.ceil(t.innerWidth/f);for(let p=0;p<f;p++){const I=g[p]?.getAttribute("width");T.colgroup.push({width:I?parseFloat(I):C})}e.push(T)}}else if(h.nodeName==="INPUT"&&h.type===s.ControlComponent.CHECKBOX)e.push({type:s.ElementType.CHECKBOX,value:"",checkbox:{value:h.checked}});else if(h.nodeName==="INPUT"&&h.type===s.ControlComponent.RADIO)e.push({type:s.ElementType.RADIO,value:"",radio:{value:h.checked}});else if(n(h),h.nodeType===1&&u!==d.length-1){const R=h;window.getComputedStyle(R).display==="block"&&!/(\n|\r\n)$/.test(R.textContent)&&e.push({value:`
111
+ `})}}}}const i=document.createElement("div");document.body.appendChild(i);const l=i.attachShadow({mode:"open"}),r=document.createElement("div");r.innerHTML=o,l.appendChild(r);const a=[];return r.childNodes.forEach(c=>{c.nodeType!==1&&!c.textContent?.trim()&&a.push(c)}),a.forEach(c=>c.remove()),n(r),i.remove(),e}function Pn(o,t){const e=t?yo(t):void 0;if(e?.mode===s.EditorMode.COMPARE)return vi(o);const n=ar(e?.mode)?Qn(Ut(o,{editorOptions:e})):Ut(o);function i(l){let r="";for(let a=0;a<l.length;a++){const c=l[a];if(c.type===s.ElementType.TABLE){r+=`
112
112
  `;const d=c.trList;for(let u=0;u<d.length;u++){const h=d[u];for(let R=0;R<h.tdList.length;R++){const T=h.tdList[R],g=i(Ut(T.value)),f=R===0,C=h.tdList.length-1===R;r+=`${f?"":" "}${g}${C?`
113
- `:""}`}}}else if(c.type===s.ElementType.TAB)r+=" ";else if(c.type===s.ElementType.HYPERLINK)r+=c.valueList.map(d=>d.value).join("");else if(c.type===s.ElementType.TITLE)r+=`${i(Ut(c.valueList))}`;else if(c.type===s.ElementType.LIST){const d=Ut(c.valueList),u=gr(d);let h="";c.listType===s.ListType.UL&&(h=yi[c.listStyle]),u.forEach((R,T)=>{const g=u.size-1===T;r+=`
113
+ `:""}`}}}else if(c.type===s.ElementType.TAB)r+=" ";else if(c.type===s.ElementType.HYPERLINK)r+=c.valueList.map(d=>d.value).join("");else if(c.type===s.ElementType.TITLE)r+=`${i(Ut(c.valueList))}`;else if(c.type===s.ElementType.LIST){const d=Ut(c.valueList),u=gr(d);let h="";c.listType===s.ListType.UL&&(h=Ni[c.listStyle]),u.forEach((R,T)=>{const g=u.size-1===T;r+=`
114
114
  ${h||`${T+1}.`}${i(R)}${g?`
115
115
  `:""}`})}else if(c.type===s.ElementType.CHECKBOX)r+=c.checkbox?.value?"☑":"□";else if(c.type===s.ElementType.RADIO)r+=c.radio?.value?"☉":"○";else if(!c.type||c.type===s.ElementType.LATEX||Le.includes(c.type)){let d="";if(c.type===s.ElementType.CONTROL){const u=c.control.value?.[0]?.value||"";d=u?`${c.control?.preText||""}${u}${c.control?.postText||""}`:""}else c.type===s.ElementType.DATE?d=c.valueList?.map(u=>u.value).join("")||"":d=c.value;r+=d.replace(new RegExp(`${_}`,"g"),`
116
- `)}}return r}return i(n)}function vi(o){return Ci(o,["metrics","style"])}function An(o){return!!o?.type&&(Ya.includes(o.type)||o.imgDisplay===s.ImageDisplay.INLINE)}function bc(o,t){const e=document.createElement(t);for(let n=0;n<o.attributes.length;n++){const i=o.attributes[n];e.setAttribute(i.name,i.value)}return e.innerHTML=o.innerHTML,e}function Zi(o){const t=[];for(let e=0;e<o.length;e++){const n=o[e];n?.imgDisplay===s.ImageDisplay.SURROUND&&t.push(n)}return t}function Vc(o,t){for(let e=o.length-1;e>=0;e--)o[e].imgFloatPosition?.pageNo===t&&o.splice(e,1)}function ae(o){return o?!!(o.hide||o.control?.hide||o.area?.hide):!0}function _n(o,t,e=s.LocationPosition.BEFORE){if(!ae(o[t]))return t;let n=t;if(e===s.LocationPosition.BEFORE)for(n=t-1;n>0;){if(!ae(o[n]))return n;n--}else for(n=t+1;n<o.length;){if(!ae(o[n]))return n;n++}return n}const Tr=`${so}-control`;function fr(o){localStorage.setItem(so,JSON.stringify({text:o.text,elementList:o.elementList}))}function mr(){const o=localStorage.getItem(so);return o?JSON.parse(o):null}function Cr(){localStorage.removeItem(so)}function Wc(o){localStorage.setItem(Tr,JSON.stringify(o))}function pr(){const o=localStorage.getItem(Tr);return o?JSON.parse(o):null}function Uc(){return!!pr()?.element}async function Yc(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 l=new ClipboardItem({[n.type]:n,[i.type]:i});await window.navigator.clipboard.write([l])}else{const l=document.createElement("div");l.setAttribute("contenteditable","true"),l.innerHTML=t,document.body.append(l);const r=window.getSelection(),a=document.createRange(),c=document.createElement("span");c.innerText=`
117
- `,l.append(c),a.selectNodeContents(l),r?.removeAllRanges(),r?.addRange(a),document.execCommand("copy"),l.remove()}fr({text:o,elementList:e})}async function wc(o){if(!o)return;const t=[{value:o}],e=()=>{const n=document.createElement("textarea");n.value=o,n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy"),n.remove()};if(window.navigator.clipboard?.writeText)try{await window.navigator.clipboard.writeText(o)}catch{e()}else e();fr({text:o,elementList:t})}async function Ir(o,t){const e=Kn(o,t);document.body.append(e);const n=e.innerText;e.remove();const i=e.innerHTML;!n&&!i&&!o.length||await Yc(n,i,Ut(o))}function vc(o){let t=!1;for(let e=0;e<o.items.length;e++)if(o.items[e].kind==="file"){t=!0;break}return t}function Qi(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled()||e.getControl().getIsDisabledPasteControl())return;const n=e.getRange(),{startIndex:i}=n.getRange(),l=e.getElementList();if(~i&&!n.getIsSelectAll()){const r=l[i];if(r?.titleId||r?.listId){let a=0;for(;a<t.length;){const c=t[a];if(r.titleId&&/^\n/.test(c.value))break;if(va.includes(c.type)){if(t.splice(a,1),c.valueList)for(let d=0;d<c.valueList.length;d++){const u=c.valueList[d];u.value===_||u.value===`
118
- `||(t.splice(a,0,u),a++)}a--}a++}}le(l,t,i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()})}e.insertElementList(t)}function Er(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=Hn(t,{innerWidth:e.getOriginalInnerWidth()});Qi(o,n)}function Ki(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=e.getRange(),{startIndex:i}=n.getRange(),l=e.getElementList(),r=new FileReader;r.readAsDataURL(t),r.onload=()=>{const a=new Image,c=r.result;a.src=c,a.onload=()=>{const d={value:c,type:s.ElementType.IMAGE,width:a.width,height:a.height};~i&&le(l,[d],i,{editorOptions:e.getOptions()}),e.insertElementList([d])}}}function Zc(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&&i(t)?.preventDefault!==!1)return;if(!vc(n)){const r=n.getData("text"),a=mr();if(a&&So(r)===So(a.text)){Qi(o,a.elementList);return}}Cr();let l=!1;for(let r=0;r<n.items.length;r++)if(n.items[r].type==="text/html"){l=!0;break}for(let r=0;r<n.items.length;r++){const a=n.items[r];if(a.kind==="string"){if(a.type==="text/plain"&&!l){a.getAsString(c=>{o.input(c)});break}if(a.type==="text/html"&&l){a.getAsString(c=>{Er(o,c)});break}}else if(a.kind==="file"&&a.type.includes("image")){const c=a.getAsFile();c&&Ki(o,c)}}}async function Qc(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const{paste:n}=e.getOverride();if(n&&n()?.preventDefault!==!1)return;const i=await navigator.clipboard.readText(),l=mr();if(l&&So(i)===So(l.text)){Qi(o,l.elementList);return}if(Cr(),t?.isPlainText)i&&o.input(i);else{const r=await navigator.clipboard.read();let a=!1;for(const c of r)if(c.types.includes("text/html")){a=!0;break}for(const c of r)if(c.types.includes("text/plain")&&!a){const u=await(await c.getType("text/plain")).text();u&&o.input(u)}else if(c.types.includes("text/html")&&a){const u=await(await c.getType("text/html")).text();u&&Er(o,u)}else if(c.types.some(d=>d.startsWith("image/"))){const d=c.types.find(h=>h.startsWith("image/")),u=await c.getType(d);Ki(o,u)}}}class Kc{draw;container;agentCursorDom;canvasEvent;eventBus;constructor(t,e){this.draw=t,this.container=t.getContainer(),this.canvasEvent=e,this.eventBus=t.getEventBus();const n=document.createElement("textarea");n.autocomplete="off",n.classList.add(`${st}-inputarea`),n.innerText="",this.container.append(n),this.agentCursorDom=n,n.onkeydown=i=>this._keyDown(i),n.oninput=this._input.bind(this),n.onpaste=i=>this._paste(i),n.addEventListener("compositionstart",this._compositionstart.bind(this)),n.addEventListener("compositionupdate",this._compositionupdate.bind(this)),n.addEventListener("compositionend",this._compositionend.bind(this)),n.addEventListener("keydown",this._keydown.bind(this)),this.eventBus.on("rangeStyleChange",i=>{this.agentCursorDom.style.fontSize=Math.max(i.size,18)+"px"})}getAgentCursorDom(){return this.agentCursorDom}_keyDown(t){this.draw.isInteractionSuspended()||this.canvasEvent.keydown(t)}_input(t){if(this.draw.isInteractionSuspended())return;const e=t.data;e&&this.canvasEvent.input(e),this.eventBus.isSubscribe("input")&&this.eventBus.emit("input",t)}_paste(t){this.draw.isInteractionSuspended()||(this.draw.flushPendingRender(),this.draw.isReadonly())||!t.clipboardData||(Zc(this.canvasEvent,t),t.preventDefault())}_compositionstart(){this.draw.isInteractionSuspended()||(this.agentCursorDom.style.zIndex="1000",this.agentCursorDom.style.width="0px",this.agentCursorDom.style.color="#000",this.agentCursorDom.style.background="#fff",this.canvasEvent.compositionstart())}_compositionupdate(){if(this.draw.isInteractionSuspended())return;this.agentCursorDom.style.width="9999px";let t=this.agentCursorDom.scrollWidth;const e=this.container.clientWidth,n=Math.max(e-this.agentCursorDom.offsetLeft,100);t>n&&(t=n),this.agentCursorDom.style.width=t+"px"}_compositionend(t){this.draw.isInteractionSuspended()||(this.agentCursorDom.style.zIndex="-1",this.agentCursorDom.style.width="0px",this.agentCursorDom.style.color="",this.agentCursorDom.style.background="",this.canvasEvent.compositionend(t))}_keydown(t){this.draw.isInteractionSuspended()||this.canvasEvent.isComposing&&t.code==="Escape"&&this.canvasEvent.compositionCancel()}}class Hc{ANIMATION_CLASS=`${st}-cursor--animation`;draw;container;options;position;cursorDom;cursorAgent;blinkTimeout;focusTimeout;visibilityFrameId;hitLineStartIndex;constructor(t,e){this.draw=t,this.container=t.getContainer(),this.position=t.getPosition(),this.options=t.getOptions(),this.cursorDom=document.createElement("div"),this.cursorDom.classList.add(`${st}-cursor`),this.container.append(this.cursorDom),this.cursorAgent=new Kc(t,e),this.blinkTimeout=null,this.focusTimeout=null,this.visibilityFrameId=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=""}getHitLineStartIndex(){return this.hitLineStartIndex}_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(){if(this.draw.isInteractionSuspended()||ya&&this.draw.isReadonly())return;const t=this.cursorAgent.getAgentCursorDom();document.activeElement!==t&&(t.focus(),t.setSelectionRange(0,0))}_clearFocusTimeout(){this.focusTimeout!==null&&(window.clearTimeout(this.focusTimeout),this.focusTimeout=null)}requestFocus(){this._clearFocusTimeout(),this.focusTimeout=window.setTimeout(()=>{this.focusTimeout=null,this.focus()})}_clearVisibilityFrame(){this.visibilityFrameId!==null&&(window.cancelAnimationFrame(this.visibilityFrameId),this.visibilityFrameId=null)}cancelPendingVisibilityCheck(){this._clearVisibilityFrame()}drawCursor(t){if(this.draw.isInteractionSuspended()){this.recoveryCursor();return}let e=this.position.getCursorPosition();if(!e)return;const{scale:n,cursor:i}=this.options,{color:l,width:r,isShow:a=!0,isBlink:c=!0,isFocus:d=!0,hitLineStartIndex:u}={...i,...t},h=this.draw.getHeight(),R=this.draw.getPageGap();this.hitLineStartIndex=u,u&&(e=this.position.getPositionList()[u]);const{metrics:T,coordinate:{leftTop:g,rightTop:f},ascent:C,pageNo:p}=e,L=(this.draw.getZone().isMainActive()?p:this.draw.getPageNo())*(h+R),O=Js*n,P=Math.min(T.height/4,O),S=T.height+P*2,y=this.cursorAgent.getAgentCursorDom();this._clearFocusTimeout(),d&&document.activeElement!==y&&this.requestFocus();const Y=T.boundingBoxDescent<0?0:T.boundingBoxDescent,b=g[1]+C+Y-(S-P)+L,M=u?g[0]:f[0];if(y.style.left=`${M}px`,y.style.top=`${b+S-O}px`,!a){this.recoveryCursor();return}const V=this.cursorDom.style.top,N=this.draw.isReadonly();this.cursorDom.style.width=`${r*n}px`,this.cursorDom.style.backgroundColor=l,this.cursorDom.style.left=`${M}px`,this.cursorDom.style.top=`${b}px`,this.cursorDom.style.display=N?"none":"block",this.cursorDom.style.height=`${S}px`,c?this._setBlinkTimeout():this._clearBlinkTimeout(),this._clearVisibilityFrame(),this.visibilityFrameId=window.requestAnimationFrame(()=>{this.visibilityFrameId=null,this.moveCursorToVisible({cursorPosition:e,direction:parseInt(V)>b?zt.UP:zt.DOWN})})}recoveryCursor(){this.cursorDom.style.display="none",this._clearBlinkTimeout(),this._clearFocusTimeout(),this._clearVisibilityFrame()}moveCursorToVisible(t){const{cursorPosition:e,direction:n}=t;if(!e||!n)return;const{pageNo:i,coordinate:{leftTop:l,leftBottom:r}}=e,a=Ma(this.container),c={left:0,right:0,top:0,bottom:0},d=a===document.documentElement;if(d)c.right=window.innerWidth,c.bottom=window.innerHeight;else{const{left:f,right:C,top:p,bottom:I}=a.getBoundingClientRect();c.left=f,c.right=C,c.top=p,c.bottom=I}const u=i*(this.draw.getHeight()+this.draw.getPageGap())+this.container.getBoundingClientRect().top,h=n===zt.UP,R=r[0]+(d?0:c.left),T=h?l[1]+u:r[1]+u,{maskMargin:g}=this.options;if(c.top+=g[0],c.bottom-=g[2],!(R>=c.left&&R<=c.right&&T>=c.top&&T<=c.bottom)){const{scrollLeft:f,scrollTop:C}=a;h?a.scroll(f,C-(c.top-T)):a.scroll(f,C+T-c.bottom)}}}var Mn;(function(o){o[o.LEFT=0]="LEFT",o[o.CENTER=1]="CENTER",o[o.RIGHT=2]="RIGHT"})(Mn||(Mn={}));function Ae(o){return pn?o.metaKey:o.ctrlKey}s.KeyMap=void 0,(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"})(s.KeyMap||(s.KeyMap={}));class wo{element;control;constructor(t,e){this.element=t,this.control=e}setElement(t){this.element=t}getElement(){return this.element}getCode(){return this.element.control?.code||null}getValue(){const t=this.control.getElementList(),{startIndex:e}=this.control.getRange(),n=t[e],i=[];let l=e;for(;l>0;){const a=t[l];if(a.controlId!==n.controlId||a.controlComponent===s.ControlComponent.PREFIX||a.controlComponent===s.ControlComponent.PRE_TEXT)break;a.controlComponent===s.ControlComponent.VALUE&&i.unshift(a),l--}let r=e+1;for(;r<t.length;){const a=t[r];if(a.controlId!==n.controlId||a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT)break;a.controlComponent===s.ControlComponent.VALUE&&i.push(a),r++}return i}setValue(){return-1}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const{control:i}=this.element,l=e.elementList||this.control.getElementList(),{startIndex:r}=e.range||this.control.getRange(),a=l[r];let c=r;for(;c>0;){const u=l[c];if(u.controlId!==a.controlId||u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT)break;if(u.controlComponent===s.ControlComponent.CHECKBOX){const h=u.checkbox;h.value=t.includes(h.code)}c--}let d=r+1;for(;d<l.length;){const u=l[d];if(u.controlId!==a.controlId||u.controlComponent===s.ControlComponent.POSTFIX||u.controlComponent===s.ControlComponent.POST_TEXT)break;if(u.controlComponent===s.ControlComponent.CHECKBOX){const h=u.checkbox;h.value=t.includes(h.code)}d++}i.code=t.join(","),this.control.repaintControl({curIndex:r,isSetCursor:!1}),this.control.emitControlContentChange({context:e})}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getRange();this.control.shrinkBoundary();const{startIndex:n,endIndex:i}=e;return t.key===s.KeyMap.Backspace||t.key===s.KeyMap.Delete?this.control.removeControl(n):i}cut(){return-1}}class Hi extends wo{setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const{control:i}=this.element,l=e.elementList||this.control.getElementList(),{startIndex:r}=e.range||this.control.getRange(),a=l[r];let c=r;for(;c>0;){const u=l[c];if(u.controlId!==a.controlId||u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT)break;if(u.controlComponent===s.ControlComponent.RADIO){const h=u.radio;h.value=t.includes(h.code)}c--}let d=r+1;for(;d<l.length;){const u=l[d];if(u.controlId!==a.controlId||u.controlComponent===s.ControlComponent.POSTFIX||u.controlComponent===s.ControlComponent.POST_TEXT)break;if(u.controlComponent===s.ControlComponent.RADIO){const h=u.radio;h.value=t.includes(h.code)}d++}i.code=t.join(","),this.control.repaintControl({curIndex:r,isSetCursor:!1}),this.control.emitControlContentChange({context:e})}}function Lr(o){const t=o.getDraw(),e=t.getPosition(),n=t.getRange();o.isAllowDrag=!0,o.cacheRange=rt(n.getRange()),o.cacheElementList=t.getElementList(),o.cachePositionList=e.getPositionList(),o.cachePositionContext=e.getPositionContext()}function Pr(o,t){const{checkbox:e,control:n}=o;if(!n)t.getCheckboxParticle().setSelect(o);else{const i=n?.code?n.code.split(","):[];if(e?.value){const r=i.findIndex(a=>a===e.code);i.splice(r,1)}else e?.code&&i.push(e.code);const l=t.getControl().getActiveControl();l instanceof wo&&l.setSelect(i)}}function Mr(o,t){const{radio:e,control:n}=o;if(!n)t.getRadioParticle().setSelect(o);else{const i=e?.code?[e.code]:[],l=t.getControl().getActiveControl();l instanceof Hi&&l.setSelect(i)}}function Ac(o,t){const e=t.getDraw();let n=e.isReadonly();const i=e.isSelectionDisabled(),l=e.getRange(),r=e.getPosition(),a=l.getRange();if(o.button===Mn.RIGHT&&(a.isCrossRowCol||!l.getIsCollapsed()))return;const d=o.target.dataset.index;if(d&&e.setPageNo(Number(d)),!t.isAllowDrag&&!n&&a.startIndex!==a.endIndex&&l.getIsPointInRange(o.offsetX,o.offsetY,e.getPageNo())){Lr(t);return}t.isAllowSelection=!i;const u=rt(r.getPositionContext()),h=r.getPositionByXY({x:o.offsetX,y:o.offsetY}),R=r.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!R)return;const{index:T,isDirectHit:g,isCheckbox:f,isRadio:C,isControl:p,isImage:I,isLabel:m,isMacro:L,isTable:O,tdValueIndex:P,hitLineStartIndex:S}=R;t.mouseDownStartPosition={...R,index:O?P:T,originalIndex:T,x:o.offsetX,y:o.offsetY};const y=e.getElementList(),Y=r.getPositionList(),b=O?P:T;let M;O?M=e.getTd().value[P]:M=y[b];const V=O&&e.getTd()?.value||y,N=O&&e.getTd()?.positionList||Y,X=!!(g&&I),D=!!(g&&f),E=!!(g&&C),U=!!(g&&m),F=!!(g&&L),Z=w=>w&&(w.type===s.ElementType.MACRO||w.type===s.ElementType.CUSTOM_MACRO||w.type===s.ElementType.REUSABLE_ITEM||w.type===s.ElementType.SUB_TEMPLATE||w.type===s.ElementType.MENSTRUAL_HISTORY||w.type===s.ElementType.FETAL_HEART_POSITION||w.type===s.ElementType.TOOTH_POSITION||w.type===s.ElementType.LIST||w.type===s.ElementType.SPECIAL_SYMBOLS),Q=w=>w&&!!w.originControlId&&!!w.controlId,W=w=>!!(w&&w.originControlId&&w.controlId&&(w.controlComponent===s.ControlComponent.POSTFIX||w.controlComponent===s.ControlComponent.POSTTEXTFIX||w.controlComponent===s.ControlComponent.POST_TEXT||w.controlComponent===s.ControlComponent.PLACEHOLDER)),K=w=>!!(w&&w.originControlId&&w.controlId&&(w.controlComponent===s.ControlComponent.PREFIX||w.controlComponent===s.ControlComponent.PRE_TEXT||w.controlComponent===s.ControlComponent.PRETEXTFIX||w.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||w.controlComponent===s.ControlComponent.PLACEHOLDER)),k=w=>{if(!w)return null;const x=new Set;let ot=w,Rt=null;for(;ot&&!x.has(ot);){x.add(ot);let It;for(let $t=0;$t<y.length;$t++){const Zt=y[$t];if(Zt.controlId===ot&&Zt.control?.type&&(It=Zt,Zt.controlComponent===s.ControlComponent.PREFIX||Zt.controlComponent===s.ControlComponent.PRE_TEXT||Zt.controlComponent===s.ControlComponent.PRETEXTFIX||Zt.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT))break}if(!It)break;It.control?.type===s.ControlType.TEXT&&(Rt=ot),ot=It.originControlId||null}return Rt},B=e.getMode()===s.EditorMode.FORM,H=B&&M?.control?.type===s.ControlType.TEXT,A=B&&!H?e.getControl().getActiveTextControlLimit():null;let v=b;const ct=(w,x)=>!!w&&!!x&&w.controlId===x,bt=(w,x,ot)=>{if(ot){for(let Rt=x;Rt>=0;Rt--){const It=w[Rt];if(ct(It,ot)&&!It.originControlId&&It.control?.type)return It.control.type;if(It.controlId&&It.controlId!==ot&&It.originControlId!==ot)break}for(let Rt=x+1;Rt<w.length;Rt++){const It=w[Rt];if(ct(It,ot)&&!It.originControlId&&It.control?.type)return It.control.type;if(It.controlId&&It.controlId!==ot&&It.originControlId!==ot)break}}},Qt=(w,x)=>!!(B&&w?.controlId&&!w.originControlId&&bt(V,x,w.controlId)===s.ControlType.TEXTFIELD),Ce=(w,x)=>!!(B&&w?.controlId&&!w.originControlId&&(bt(V,x,w.controlId)===s.ControlType.TEXT||bt(V,x,w.controlId)===s.ControlType.NUMBER)),Gt=N[b],Re=V[b-1],nt=V[b+1],z=6,G=[s.ControlType.SELECT,s.ControlType.DATE,s.ControlType.BUTTON],J=(w,x)=>kt(w,x),it=(w,x)=>{if(w?.control?.type)return w.control.type;if(w?.controlId){for(let ot=x;ot>=0;ot--){const Rt=V[ot];if(!J(w,Rt))break;if(Rt.control?.type)return Rt.control.type}for(let ot=x+1;ot<V.length;ot++){const Rt=V[ot];if(!J(w,Rt))break;if(Rt.control?.type)return Rt.control.type}}},q=(w,x)=>{const ot=it(w,x);return!!(ot&&G.includes(ot))},ut=w=>!!(w&&(w.controlComponent===s.ControlComponent.POSTFIX||w.controlComponent===s.ControlComponent.POST_TEXT||w.controlComponent===s.ControlComponent.POSTTEXTFIX||w.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)),gt=w=>!!(w&&(w.controlComponent===s.ControlComponent.PREFIX||w.controlComponent===s.ControlComponent.PRE_TEXT||w.controlComponent===s.ControlComponent.PRETEXTFIX||w.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)),Ot=(w,x)=>{if(!w?.controlId)return-1;for(let ot=x;ot>=0;ot--){const Rt=V[ot];if(!J(w,Rt))break;if(Rt.controlComponent===s.ControlComponent.VALUE)return ot}for(let ot=x+1;ot<V.length;ot++){const Rt=V[ot];if(!J(w,Rt))break;if(Rt.controlComponent===s.ControlComponent.VALUE)return ot}return-1},Et=(w,x)=>{if(!w)return!1;if(w.controlComponent===s.ControlComponent.VALUE||w.controlComponent===s.ControlComponent.PLACEHOLDER)return!0;const ot=it(w,x),Rt=ot===s.ControlType.SELECT||ot===s.ControlType.DATE,It=w.controlComponent===s.ControlComponent.PRE_TEXT||w.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||w.controlComponent===s.ControlComponent.TEXTFIXLABEL;return!!(Rt&&It&&w.value&&Ot(w,x)===-1)},yt=w=>{const x=N[w];if(!x)return!1;const{coordinate:{leftTop:ot,rightTop:Rt,leftBottom:It}}=x;return o.offsetX>=ot[0]&&o.offsetX<Rt[0]&&o.offsetY>=ot[1]&&o.offsetY<=It[1]},Mt=(w,x)=>{if(e.getMode()!==s.EditorMode.EDIT||!w?.originControlId||w.controlComponent!==s.ControlComponent.VALUE||it(w,x)!==s.ControlType.BUTTON||w.control?.buttonText||bt(V,x,w.originControlId)!==s.ControlType.TEXTFIELD||!yt(x))return!1;let ot=-1;for(let Vn=x;Vn<V.length;Vn++){const Mo=V[Vn];if(!J(w,Mo))break;const $e=N[Vn];Mo.controlComponent===s.ControlComponent.VALUE&&$e&&$e.coordinate.rightTop[0]>$e.coordinate.leftTop[0]&&(ot=Vn)}if(ot===-1)return!1;const Rt=N[ot],{coordinate:{leftTop:It,rightTop:$t,leftBottom:Zt}}=Rt;return o.offsetX>=It[0]-2&&o.offsetX<=$t[0]&&o.offsetY>=It[1]&&o.offsetY<=Zt[1]},Ft=(w,x)=>!(!g||!q(w,x)||!yt(x)||Mt(w,x)||!Et(w,x)||ut(w)||gt(w)&&!w?.value),Vt=()=>[h.isTable?h.tdValueIndex:h.index,b,b+1,b-1,b+2,b-2].filter((x,ot,Rt)=>typeof x=="number"&&x>=0&&x<V.length&&Rt.indexOf(x)===ot),_t=()=>{if(!g)return null;for(const w of Vt()){const x=V[w];if(Ft(x,w))return{element:x,index:w}}return null},pt=()=>{if(!g)return-1;for(const w of Vt())if(Mt(V[w],w))return w;return-1},ht=w=>{const x=V[w];let ot=w;for(let Rt=w+1;Rt<V.length&&J(x,V[Rt]);Rt++)ot=Rt;return ot},Lt=w=>{const x=V[w];if(!me(x)||it(x,w)!==s.ControlType.BUTTON||x.control?.buttonText||x.control?.editable===!1)return w;let ot=w;for(let Rt=w+1;Rt<V.length;Rt++){const It=V[Rt];if(!J(x,It)||!me(It))break;ot=Rt}return ot},Ct=Vt().some(w=>q(V[w],w)),St=_t(),Kt=pt(),ge=w=>(w?.control?.type===s.ControlType.TEXTFIELD||w?.control?.type===s.ControlType.TEXT)&&(w.controlComponent===s.ControlComponent.POSTFIX||w.controlComponent===s.ControlComponent.POST_TEXT||w.controlComponent===s.ControlComponent.POSTTEXTFIX||w.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT),Tt=w=>w?.type===s.ElementType.CONTROL&&(w.controlComponent===s.ControlComponent.POSTFIX||w.controlComponent===s.ControlComponent.POST_TEXT||w.controlComponent===s.ControlComponent.POSTTEXTFIX||w.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT),tt=w=>w?.type===s.ElementType.CONTROL&&(w.controlComponent===s.ControlComponent.PREFIX||w.controlComponent===s.ControlComponent.PRE_TEXT||w.controlComponent===s.ControlComponent.PRETEXTFIX||w.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT),Dt=(w,x)=>!!(e.getMode()===s.EditorMode.EDIT&&w?.originControlId&&ge(w)&&x?.controlId===w.originControlId&&!x.originControlId&&x.control?.type===s.ControlType.TEXTFIELD&&ge(x)),vt=(w,x)=>!!(e.getMode()===s.EditorMode.EDIT&&w?.originControlId&&ge(w)&&x?.controlId===w.originControlId&&!x.originControlId&&x.control?.type===s.ControlType.TEXTFIELD&&x.controlComponent===s.ControlComponent.VALUE),jt=(w,x,ot)=>!!(e.getMode()===s.EditorMode.EDIT&&w?.originControlId&&ot?.originControlId===w.originControlId&&w.controlId&&ot.controlId&&w.controlId!==ot.controlId&&Tt(w)&&tt(ot)&&bt(V,x,w.originControlId)===s.ControlType.TEXTFIELD),at=Dt(M,nt),Pt=vt(M,nt),et=jt(M,b,nt),$=jt(Re,b-1,M),ne=!!(e.getMode()===s.EditorMode.EDIT&&p&&g&&ge(M)&&!at&&!Pt&&!et&&Re?.controlId===M.controlId&&(Re.originControlId||null)===(M.originControlId||null)&&(Re.controlComponent===s.ControlComponent.VALUE||Re.controlComponent===s.ControlComponent.PLACEHOLDER)),qt=!!(B&&Ce(M,b)&&Tt(M)&&Gt&&o.offsetX>=Gt.coordinate.leftTop[0]),Te=(w,x,ot)=>!!(B&&W(w)&&bt(V,x,w?.originControlId)===ot&&(ot===s.ControlType.TEXTFIELD?Qt(V[x+1],x+1):Ce(V[x+1],x+1))),Bt=(w,x,ot)=>!!(B&&K(w)&&bt(V,x,w?.originControlId)===ot&&(ot===s.ControlType.TEXTFIELD?Qt(V[x-1],x-1):Ce(V[x-1],x-1))),te=Te(M,b,s.ControlType.TEXTFIELD),oo=!!(B&&Gt&&Qt(M,b)&&Te(Re,b-1,s.ControlType.TEXTFIELD)&&o.offsetX<=Gt.coordinate.leftTop[0]+z),mn=!!(B&&Gt&&Qt(M,b)&&Bt(nt,b+1,s.ControlType.TEXTFIELD)&&o.offsetX>=Gt.coordinate.rightTop[0]-z),Me=!!(B&&Gt&&te&&o.offsetX>Gt.coordinate.rightTop[0]),we=!!(B&&Gt&&K(M)&&bt(V,b,M.originControlId)===s.ControlType.TEXTFIELD&&Qt(Re,b-1)&&o.offsetX<Gt.coordinate.leftTop[0]),Rm=Qt(M,b)||te||oo||mn||Me||we,gm=Te(M,b,s.ControlType.TEXT),ea=w=>{const x=V[w],ot=Y[w];if(!ot||!Ce(x,w))return-1;const Rt=V[w-1];return!Te(Rt,w-1,s.ControlType.TEXT)||o.offsetX>ot.coordinate.leftTop[0]+z?-1:w-1},ws=ea(b),na=ea(b-1),oa=ws!==-1||na!==-1,ia=!!(B&&Gt&&K(M)&&bt(V,b,M.originControlId)===s.ControlType.TEXT&&Ce(Re,b-1)&&o.offsetX<Gt.coordinate.leftTop[0]),Tm=!!(B&&Gt&&Ce(M,b)&&Bt(nt,b+1,s.ControlType.TEXT)&&o.offsetX>=Gt.coordinate.rightTop[0]-z),fm=gm||oa||ia||Tm;if(at||Pt||et?v=b:$||ne||qt?v=Math.max(b-1,0):oa?v=ws!==-1?ws:na:ia&&(v=Math.max(b-1,0)),St){v=Lt(St.index);const w=r.getPositionContext();r.setPositionContext({...w,index:w.isTable?w.index:v,isControl:!0,isDirectHit:!0})}else Kt!==-1?v=ht(Kt):q(M,b)&&Gt&&!yt(b)&&o.offsetX>Gt.coordinate.rightTop[0]&&(v=ht(b));let sa=!1;if(B&&A?.parentControlId&&M?.controlId===A.parentControlId&&!M?.originControlId)for(let w=b;w>=0;w--){const x=y[w];if(ct(x,A.parentControlId)){x.control?.type===s.ControlType.TEXTFIELD&&(sa=!0);break}if(x.controlId!==A.parentControlId)break}const ra=!!(A&&(!M?.controlId||M.controlId===A.controlId&&(M.originControlId||null)===A.originControlId&&(M.subTemplateInstanceId||M.subTemplateParentId||null)===A.subTemplateInstanceId||A.parentControlId&&M.controlId===A.parentControlId&&!M.originControlId&&sa));if(B&&!H&&(M?.controlId||M?.originControlId)){let w;const x=M.originControlId||M.controlId;for(let ot=b;ot>=0;ot--){const Rt=y[ot];if(ct(Rt,x)&&Rt.control?.type){w=Rt.control.type;break}if(Rt.controlId!==M.controlId&&Rt.controlId!==x)break}if(w!==s.ControlType.TEXT){if(w===s.ControlType.TEXTFIELD){const ot=M.controlComponent;if(!Q(M)){if(!(M.controlComponent===s.ControlComponent.VALUE&&Z(M))){if(ot===s.ControlComponent.PRETEXTFIX||ot===s.ControlComponent.PRETEXTFIX_TEXT||ot===s.ControlComponent.POSTTEXTFIX||ot===s.ControlComponent.POSTTEXTFIX_TEXT||ot===s.ControlComponent.TEXTFIXLABEL||ot===s.ControlComponent.PREFIX||ot===s.ControlComponent.POSTFIX||ot===s.ControlComponent.PRE_TEXT||ot===s.ControlComponent.POST_TEXT||ot===s.ControlComponent.PLACEHOLDER)for(let Rt=b+1;Rt<y.length;Rt++){const It=y[Rt];if(It.controlId!==x&&It.originControlId!==x)break;if(It.controlComponent===s.ControlComponent.VALUE&&!Z(It)){v=Rt;break}if(It.controlComponent===s.ControlComponent.POSTTEXTFIX||It.controlComponent===s.ControlComponent.POSTFIX){for(let $t=b-1;$t>=0;$t--){const Zt=y[$t];if(Zt.controlId!==x&&Zt.originControlId!==x)break;if(Zt.controlComponent===s.ControlComponent.VALUE&&!Z(Zt)){v=$t;break}}break}}else if(ot===s.ControlComponent.VALUE&&b>0){const Rt=y[b-1];if(Rt&&(Rt.controlId===x||Rt.originControlId===x)&&Rt.controlComponent===s.ControlComponent.VALUE&&Z(Rt)){let It=!1;for(let $t=b-2;$t>=0;$t--){const Zt=y[$t];if(Zt.controlId!==x&&Zt.originControlId!==x||Zt.controlComponent!==s.ControlComponent.VALUE&&!Zt.originControlId&&Zt.controlId===x)break;if(!Z(Zt)){v=$t+1,It=!0;break}}if(!It)for(let $t=b;$t<y.length;$t++){const Zt=y[$t];if(Zt.controlId!==x&&Zt.originControlId!==x||(Zt.controlComponent===s.ControlComponent.POSTTEXTFIX||Zt.controlComponent===s.ControlComponent.POSTFIX)&&!Zt.originControlId&&Zt.controlId===x)break;if(!Z(Zt)){v=$t,It=!0;break}}}}}}}}}if(B&&M?.control?.type===s.ControlType.TEXT&&M?.originControlId&&M.controlComponent===s.ControlComponent.PLACEHOLDER&&k(M.originControlId)&&(v=b),~T&&Rm&&!St)t.isAllowSelection=!1,e.getControl().destroyControl({isEmitEvent:!1}),e.render({isCompute:!1,isSubmitHistory:!1,isSetCursor:!1});else if(~T&&!i){ra&&(v=Math.min(Math.max(v,A.startIndex),A.endIndex));let w=v,x=v;if(o.shiftKey){const{startIndex:It}=l.getRange();~It&&r.getPositionContext().tdId===u.tdId&&(b>It?w=It:x=It)}ra&&(w=Math.min(Math.max(w,A.startIndex),A.endIndex),x=Math.min(Math.max(x,A.startIndex),A.endIndex),v=Math.min(Math.max(v,A.startIndex),A.endIndex));const ot=e.getControl(),Rt=!!St;ot.setPopupAwakeDisabled(o.button===Mn.RIGHT||fm&&!Rt||Ct&&!Rt);try{l.setRange(w,x)}finally{ot.setPopupAwakeDisabled(!1)}if(r.setCursorPosition(N[v]),n=e.isReadonly(),D&&!n)Pr(M,e);else if(E&&!n)Mr(M,e);else if(!n&&M.controlComponent===s.ControlComponent.VALUE&&(M.control?.type===s.ControlType.CHECKBOX||M.control?.type===s.ControlType.RADIO)){let It=b;for(;It>0;){const $t=y[It];if($t.controlComponent===s.ControlComponent.CHECKBOX){Pr($t,e);break}else if($t.controlComponent===s.ControlComponent.RADIO){Mr($t,e);break}It--}}else{const $t=!!(!!(St&&it(St.element,St.index)===s.ControlType.BUTTON&&!St.element.control?.buttonText)&&St?.element.control?.editable===!1);let Zt=!1;if(B&&M?.controlId&&M?.controlComponent===s.ControlComponent.VALUE&&!M.originControlId){let io=!1;for(let Oe=b;Oe>=0;Oe--){const ze=y[Oe];if(ze.controlId!==M.controlId){if(ze.originControlId===M.controlId){io=!0;continue}break}if(ze.control?.type===s.ControlType.TEXTFIELD){if(io)break;Zt=!0;break}}if(!io&&!Zt)for(let Oe=b+1;Oe<y.length;Oe++){const ze=y[Oe];if(ze.controlId!==M.controlId){if(ze.originControlId===M.controlId){io=!0;continue}break}}io&&(Zt=!1)}const Ri=Zt&&Z(M),Vn=F&&!Ri?v:void 0,Mo=!X&&!D&&!E&&!($t&&B)&&!Ri;e.render({curIndex:F&&!Ri?Vn:v,isCompute:!1,isSubmitHistory:!1,isSetCursor:Mo}),Mo&&e.getCursor().requestFocus();const $e=V[v];if(!n&&Rt&&$e?.controlId&&o.button===Mn.LEFT){const Oe=e.getControl().getActiveControl(),ze=Oe?.getElement()?.control?.type;Oe&&(ze===s.ControlType.SELECT||ze===s.ControlType.DATE||ze===s.ControlType.BUTTON)&&Oe.getElement()?.controlId===$e.controlId&&$e.controlComponent!==s.ControlComponent.POSTFIX&&$e.controlComponent!==s.ControlComponent.POSTTEXTFIX&&$e.controlComponent!==s.ControlComponent.POSTTEXTFIX_TEXT&&$e.controlComponent!==s.ControlComponent.POST_TEXT&&typeof Oe.awake=="function"&&Oe.awake(o)}}S&&t.getDraw().getCursor().drawCursor({hitLineStartIndex:S})}const Je=e.getEventBus();if(U&&Je.isSubscribe("labelMousedown")&&Je.emit("labelMousedown",{evt:o,element:M}),F&&(M.type===s.ElementType.MACRO||M.type===s.ElementType.CUSTOM_MACRO||M.type===s.ElementType.REUSABLE_ITEM)){const w=e.getMode();if(w===s.EditorMode.EDIT&&M.type===s.ElementType.CUSTOM_MACRO)Je.isSubscribe("macroClick")&&Je.emit("macroClick",{evt:o,element:M});else if(w===s.EditorMode.FORM&&o.button===Mn.LEFT){let x=!1;(M.type===s.ElementType.CUSTOM_MACRO||M.type===s.ElementType.REUSABLE_ITEM)&&(o.preventDefault(),x=e.getMacroParticle().activateInlineEditor(M,b,o.offsetX)),!x&&Je.isSubscribe("macroValueChange")&&Je.emit("macroValueChange",{evt:o,element:M})}}o.button===Mn.LEFT&&F&&M.type===s.ElementType.SUB_TEMPLATE&&!M.subTemplateExpanded&&e.getMode()===s.EditorMode.FORM&&Je.isSubscribe("subTemplateClick")&&Je.emit("subTemplateClick",{evt:o,element:M});const la=e.getPreviewer();if(la.clearResizer(),X){if(!e.isPrintLikeMode()){const w={dragDisable:n||!M.controlId&&e.getMode()===s.EditorMode.FORM};M.type===s.ElementType.LATEX&&(w.mime="svg",w.srcKey="laTexSVG"),la.drawResizer(M,Y[b],w),e.getCursor().drawCursor({isShow:!1}),Lr(t),(M.imgDisplay===s.ImageDisplay.SURROUND||M.imgDisplay===s.ImageDisplay.FLOAT_TOP||M.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM)&&e.getImageParticle().createFloatImage(M)}Je.isSubscribe("imageMousedown")&&Je.emit("imageMousedown",{evt:o,element:M})}const aa=e.getTableTool();aa.dispose(),O&&!n&&aa.render();const vs=e.getHyperlinkParticle();vs.clearHyperlinkPopup(),M.type===s.ElementType.HYPERLINK&&(Ae(o)?vs.openHyperlink(M):vs.drawHyperlinkPopup(M,Y[b]));const ca=e.getDateParticle();ca.clearDatePicker(),M.type===s.ElementType.DATE&&!n&&ca.renderDatePicker(M,Y[b]),e.getMenstrualHistoryParticle().clearMenstrualHistoryEditor(),e.getFetalHeartPositionParticle().clearFetalHeartPositionEditor(),e.getToothPositionParticle().clearToothPositionEditor()}function vo(o){const t=ft();return Reflect.set(o,"dragId",t),t}function Zo(o,t){return t.findIndex(e=>e.dragId===o)}function Or(o,t,e){const n=e.getDraw();if(o.imgDisplay===s.ImageDisplay.SURROUND||o.imgDisplay===s.ImageDisplay.FLOAT_TOP||o.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM){const i=t.offsetX-e.mouseDownStartPosition.x,l=t.offsetY-e.mouseDownStartPosition.y,r=o.imgFloatPosition;o.imgFloatPosition={x:r.x+i,y:r.y+l,pageNo:n.getPageNo()}}n.getImageParticle().destroyFloatImage()}function _c(o,t){if(t.isAllowDrop){const e=t.getDraw();if(e.isReadonly()||e.isDisabled()){t.mousedown(o);return}const n=e.getPosition(),i=n.getPositionList(),l=n.getPositionContext(),r=e.getRange(),a=t.cacheRange,c=t.cacheElementList,d=t.cachePositionList,u=t.cachePositionContext,h=r.getRange(),R=a.startIndex===a.endIndex,T=R?a.startIndex-1:a.startIndex,g=a.endIndex;if(h.startIndex>=T&&h.endIndex<=g&&t.cachePositionContext?.tdId===l.tdId){e.clearSideEffect();let H=!1,A=!1;if(R){const v=c[g];if(v.type===s.ElementType.IMAGE||v.type===s.ElementType.LATEX){if(Or(v,o,t),v.imgDisplay===s.ImageDisplay.SURROUND||v.imgDisplay===s.ImageDisplay.FLOAT_TOP||v.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(v),H=!0;else{const ct=d[g];e.getPreviewer().drawResizer(v,ct)}A=v.imgDisplay===s.ImageDisplay.SURROUND}}r.replaceRange({...a}),e.render({isCompute:A,isSubmitHistory:H,isSetCursor:!1});return}const f=c.slice(T+1,g+1),C=f.find(H=>H.controlId);if(C){const H=c[T+1],A=c[g];if(!((!H.controlId||H.controlComponent===s.ControlComponent.PREFIX)&&(!A.controlId||A.controlComponent===s.ControlComponent.POSTFIX)||H.controlId===A.controlId&&H.controlComponent===s.ControlComponent.PREFIX&&A.controlComponent===s.ControlComponent.POSTFIX||H.control?.type===s.ControlType.TEXT&&H.controlComponent===s.ControlComponent.VALUE&&A.control?.type===s.ControlType.TEXT&&A.controlComponent===s.ControlComponent.VALUE)){e.render({curIndex:h.startIndex,isCompute:!1,isSubmitHistory:!1});return}}const p=e.getControl(),I=e.getElementList(),m=!C||!!I[h.startIndex].controlId||!p.getIsElementListContainFullControl(f),L=e.getOptions(),O=f.map(H=>{if(!H.type||H.type===s.ElementType.TEXT){const A={value:H.value},v=Ne;return m||v.push(...Si),v.forEach(ct=>{const bt=H[ct];bt!==void 0&&(A[ct]=bt)}),A}else{let A=rt(H);return m&&(A=Ee(A,Si)),ee([A],{isHandleFirstElement:!1,editorOptions:L}),A}});le(I,O,h.startIndex,{editorOptions:e.getOptions()});const P=c[T],S=d[T],y=vo(c[T]),Y=vo(c[g]),b=O.length;let M=h.startIndex,V=M+b;const N=p.getActiveControl();if(N&&c[M].controlComponent!==s.ControlComponent.POSTFIX?(V=N.setValue(O),M=V-b):e.spliceElementList(I,M+1,0,O),!~V){e.render({isSetCursor:!1});return}const X=vo(I[M]),D=vo(I[V]),E=Zo(y,c),U=Zo(Y,c),F=c[U];if(F.controlId&&F.controlComponent!==s.ControlComponent.POSTFIX)r.replaceRange({...a,startIndex:E,endIndex:U}),p.getActiveControl()?.cut();else{let H=!0;if(u?.isTable){const{tableId:A,trIndex:v,tdIndex:ct}=u;H=!e.getOriginalElementList().some(Qt=>Qt.id===A&&Qt?.trList?.[v]?.tdList?.[ct]?.deletable===!1)}H&&e.spliceElementList(c,E+1,U-E)}const Z=I[h.startIndex],Q=i[h.startIndex];let W=l.index;W&&(Z.tableId&&!P.tableId?S.index<W&&(W-=b):!Z.tableId&&P.tableId&&Q.index<W&&(W+=b),n.setPositionContext({...l,index:W}));const K=Zo(X,I),k=Zo(D,I);r.setRange(R?k:K,k,h.tableId,h.startTdIndex,h.endTdIndex,h.startTrIndex,h.endTrIndex),e.clearSideEffect();let B=null;if(R){const A=e.getElementList()[k];(A.type===s.ElementType.IMAGE||A.type===s.ElementType.LATEX)&&(Or(A,o,t),B=A)}if(e.render({isSetCursor:!1}),N?p.emitControlContentChange():P.controlId&&p.emitControlContentChange({context:{range:a,elementList:c},controlElement:P}),B)if(B.imgDisplay===s.ImageDisplay.SURROUND||B.imgDisplay===s.ImageDisplay.FLOAT_TOP||B.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(B);else{const A=n.getPositionList()[k];e.getPreviewer().drawResizer(B,A)}}else t.isAllowDrag&&t.cacheRange?.startIndex!==t.cacheRange?.endIndex&&t.mousedown(o)}function Bc(o,t){const e=t.getDraw();if(!e.getOptions().pageOuterSelectionDisable)return;const n=e.getPageContainer(),{x:i,y:l,width:r,height:a}=n.getBoundingClientRect();o.x>=i&&o.x<=i+r&&o.y>=l&&o.y<=l+a||t.setIsAllowSelection(!1)}function kc(o,t){const e=t.getDraw(),n=e.getControl(),i=e.getPageList(),l=e.getPageNo(),r=i[l],a=e.getPosition(),c=a.getPositionByXY({x:o.offsetX,y:o.offsetY});if(~c.index){const D=c.isTable?e.getTdByPosition({...c,isTable:!0,index:c.index}):null,E=c.isTable&&D?.value||e.getElementList(),U=c.isTable&&D?.positionList||a.getPositionList(),F=c.isTable?c.tdValueIndex:c.index,Z=e.getMode(),Q=Z===s.EditorMode.EDIT||Z===s.EditorMode.FORM,W=[F,F+1,F-1,F+2,F-2].filter((H,A,v)=>H>=0&&H<E.length&&v.indexOf(H)===A),K=H=>{const A=U[H];if(!A)return!1;const{coordinate:{leftTop:v,rightTop:ct,leftBottom:bt}}=A;return ct[0]>v[0]&&o.offsetX>=v[0]&&o.offsetX<ct[0]&&o.offsetY>=v[1]&&o.offsetY<=bt[1]},k=Q&&W.some(H=>{const v=E[H]?.control?.type;return v!==s.ControlType.SELECT&&v!==s.ControlType.DATE?!1:K(H)}),B=W.some(H=>{const A=E[H];return!!(A?.control?.type===s.ControlType.BUTTON&&!A.control.buttonText&&(A.controlComponent===s.ControlComponent.VALUE||A.controlComponent===s.ControlComponent.PLACEHOLDER)&&K(H))});r&&(k||B)?r.style.cursor="pointer":r&&(r.style.cursor="text")}else r&&(r.style.cursor="text");if(t.isAllowDrag){if(e.isContentReadonly()){t.setIsAllowDrag(!1);return}const D=o.offsetX,E=o.offsetY,{startIndex:U,endIndex:F}=t.cacheRange,Z=t.cachePositionList;for(let W=U+1;W<=F;W++){const{coordinate:{leftTop:K,rightBottom:k}}=Z[W];if(D>=K[0]&&D<=k[0]&&E>=K[1]&&E<=k[1])return}const Q=t.cacheRange?.startIndex;if(Q){const W=t.cacheElementList[Q];W?.type===s.ElementType.IMAGE&&(W.imgDisplay===s.ImageDisplay.SURROUND||W.imgDisplay===s.ImageDisplay.FLOAT_TOP||W.imgDisplay===s.ImageDisplay.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 u=o.target.dataset.index;u&&e.setPageNo(Number(u));const h=e.getPosition(),R=h.getPositionByXY({x:o.offsetX,y:o.offsetY});if(!~R.index)return;const{index:T,isTable:g,tdValueIndex:f,tdIndex:C,trIndex:p,tableId:I,trId:m,tdId:L}=R;let O=g?f:T;if(R.isControl&&e.getMode()!==s.EditorMode.READONLY){const{newIndex:D}=n.moveCursor({index:T,isTable:g,trIndex:p,tdIndex:C,tdValueIndex:f});O=D}const{index:P,isTable:S,tdIndex:y,tdId:Y,trIndex:b,tableId:M}=t.mouseDownStartPosition,V=O,N=e.getRange();let X;if(L!==Y&&L&&Y){const D=e.getTdByPosition({...t.mouseDownStartPosition,isTable:!!t.mouseDownStartPosition.tableId,index:t.mouseDownStartPosition.originalIndex??t.mouseDownStartPosition.index}),E=e.getTdByPosition({...R,isTable:!!R.tableId,index:R.index});if(e.isSplitTd(D,E)){const U=(D.valueStartIndex??0)+P,F=(E.valueStartIndex??0)+f;X=[{index:U,element:D.value[P],originalId:D.originalId,isCurrent:!1,length:D.value.length,startIndex:D.valueStartIndex??0},{index:F,element:E.value[f],originalId:E.originalId,isCurrent:!0,length:E.value.length,startIndex:E.valueStartIndex??0}]}}if(g&&S&&L!==Y&&!X)N.setRange(V,V,I,y,C,b,p),h.setPositionContext({isTable:!!g,index:T,trIndex:p,tdIndex:C,tdId:L,trId:m,tableId:I});else{let D=~V?V:0;if((S||g)&&M!==I&&!X)return;h.setPositionContext({isTable:!!g,index:T,trIndex:p,tdIndex:C,tdId:L,trId:m,tableId:I});let E=P,U,F;if(X)[{element:U},{element:F}]=X;else{const W=e.getElementList();U=W[E+1],F=W[D]}if(E===D||U?.controlComponent===s.ControlComponent.PLACEHOLDER&&F?.controlComponent===s.ControlComponent.PLACEHOLDER&&U.controlId===F.controlId)return;if(E>D&&([E,D]=[D,E]),e.getMode()===s.EditorMode.FORM){const K=n.getActiveControl()?.getElement()?.control?.type===s.ControlType.TEXT?null:n.getActiveTextControlLimit();K&&(E=Math.min(Math.max(E,K.startIndex),K.endIndex),D=Math.min(Math.max(D,K.startIndex),K.endIndex));const k=e.getElementList(),B=k[E],H=k[D];if(B?.control?.type===s.ControlType.TEXTFIELD||H?.control?.type===s.ControlType.TEXTFIELD){const A=B?.controlId||H?.controlId;if(A){let v=-1,ct=-1;for(let bt=E;bt>=0;bt--){const Qt=k[bt];if(Qt.controlId!==A)break;if(Qt.controlComponent===s.ControlComponent.PRETEXTFIX||Qt.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||Qt.controlComponent===s.ControlComponent.TEXTFIXLABEL||Qt.controlComponent===s.ControlComponent.PREFIX||Qt.controlComponent===s.ControlComponent.PRE_TEXT){v=bt+1;break}}for(let bt=D;bt<k.length;bt++){const Qt=k[bt];if(Qt.controlId!==A)break;if(Qt.controlComponent===s.ControlComponent.POSTTEXTFIX||Qt.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||Qt.controlComponent===s.ControlComponent.POSTFIX||Qt.controlComponent===s.ControlComponent.POST_TEXT){ct=bt-1;break}}v!==-1&&E<v&&(E=v),ct!==-1&&D>ct&&(D=ct)}}}let Q;if(X){const[W,K]=X.sort((k,B)=>k.index-B.index);Q={originalId:X[0].originalId??X[1].originalId,startIndex:W.index,endIndex:K.index},W.isCurrent?(E=W.index,D=W.length-1):(E=0,D=Q.endIndex-K.startIndex)}N.setRange(E,D,void 0,void 0,void 0,void 0,void 0,Q)}e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}function Ai(o,t){const e=o[t]?.subTemplateParentId;if(!e)return-1;for(let n=t-1;n>=0;n--){const i=o[n];if(i.type===s.ElementType.SUB_TEMPLATE&&i.id===e)return n}return-1}function _i(o,t,e){const n=o[t];if(!n?.subTemplateParentId||!(e==="leading"?new Set([s.ControlComponent.PREFIX,s.ControlComponent.PRE_TEXT,s.ControlComponent.PRETEXTFIX,s.ControlComponent.PRETEXTFIX_TEXT]):new Set([s.ControlComponent.POSTFIX,s.ControlComponent.POST_TEXT,s.ControlComponent.POSTTEXTFIX,s.ControlComponent.POSTTEXTFIX_TEXT])).has(n.controlComponent))return-1;const l=Ai(o,t);if(l===-1)return-1;const r=o[l];let a=r.control?.type;for(let d=l-1;d>=0&&!a;d--){const u=o[d];u.controlId===r.controlId&&(u.originControlId||null)===(r.originControlId||null)&&(a=u.control?.type)}return!!(r.controlId&&r.controlComponent===s.ControlComponent.VALUE&&n.controlId&&(a===s.ControlType.TEXT||a===s.ControlType.TEXTFIELD))?l:-1}function On(o,t,e){const n=o[t];if(n?.type!==s.ElementType.SUB_TEMPLATE)return null;const i=n.controlId?{controlId:n.controlId,originControlId:n.originControlId||null,subTemplateParentId:n.subTemplateParentId||null}:null,l=e.getSubTemplateRuntimeEndIndex(o,t,n.id);if(e.spliceElementList(o,t,l-t),i){const r=a=>a.controlId===i.controlId&&(a.originControlId||null)===i.originControlId&&(a.subTemplateParentId||null)===i.subTemplateParentId;for(let a=Math.min(t-1,o.length-1);a>=0;a--){const c=o[a];if(r(c)&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)){e.getControl().addPlaceholder(a,{elementList:o});break}}}return Math.max(0,t-1)}function Qo(o,t){if(!t)return null;const e=new Set;let n=t,i=null;for(;n&&!e.has(n);){e.add(n);let l=null;for(let r=0;r<o.length;r++){const a=o[r];if(a.controlId===n&&a.control?.type&&(l=a,a.controlComponent===s.ControlComponent.PREFIX||a.controlComponent===s.ControlComponent.PRE_TEXT||a.controlComponent===s.ControlComponent.PRETEXTFIX||a.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT))break}if(!l)break;l.control?.type==="text"&&(i=n),n=l.originControlId||null}return i}function Bi(o,t){return!!o&&!!t&&o.controlId===t}function Gc(o){const t=o.getDraw(),e=t.getRange(),n=e.getRange(),i=t.getElementList(),l=i[n.startIndex];if(!ae(l)||t.getMode()===s.EditorMode.FORM&&l?.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;let r=n.startIndex;for(;r>0;){const a=i[r];if(a.type===s.ElementType.SUB_TEMPLATE&&a.subTemplateExpanded){const u=On(i,r,t);return u===null?!1:(n.startIndex=u,n.endIndex=u,e.replaceRange(n),t.getGlobalEvent().setCanvasEventAbility(),t.render({curIndex:u}),!0)}let c=null;a.controlId?(c=t.getControl().removeControl(r),c!==null&&(r=c)):(t.spliceElementList(i,r,1),c=r-1,r--);const d=i[c];if(!d||!ae(d)){if(c){n.startIndex=c,n.endIndex=c,e.replaceRange(n);const u=t.getPosition(),h=u.getPositionList();u.setCursorPosition(h[c])}break}}return!1}function xc(o,t,e){if(e.originControlId){const n=Qo(o,e.originControlId);if(!n)return{isInParent:!1};for(let i=t;i<o.length;i++){const l=o[i];if(l.controlId===n)return l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX||l.controlComponent===s.ControlComponent.POST_TEXT?{isInParent:!1}:{isInParent:!0,parentControlId:n};if(l.controlId&&l.controlId!==n&&l.originControlId!==n)break}}if(!e.originControlId&&e.controlId){const n=o[t];if(n?.controlId&&n.controlId!==e.controlId&&(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.PRETEXTFIX))for(let i=t-1;i>=0;i--){const l=o[i];if(l.controlId===e.controlId&&(l.controlComponent===s.ControlComponent.PREFIX||l.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let r=i-1;r>=0;r--){const a=o[r],c=Qo(o,a.controlId);if(c&&c!==e.controlId&&(a.controlComponent===s.ControlComponent.PRETEXTFIX||a.controlComponent===s.ControlComponent.PREFIX))return{isInParent:!0,parentControlId:c};if(a.controlId&&a.controlId!==e.controlId&&(a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POSTTEXTFIX))return{isInParent:!1}}break}}if(n?.controlId&&n.controlId!==e.controlId&&!n.originControlId&&(n.controlComponent===s.ControlComponent.POSTFIX||n.controlComponent===s.ControlComponent.POSTTEXTFIX)){if(e.originControlId===n.controlId){const i=Qo(o,n.controlId);if(i)return{isInParent:!0,parentControlId:i}}return{isInParent:!1}}}return{isInParent:!1}}function Jc(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:l,isCrossRowCol:r}=n.getRange(),a=e.getElementList(),c=n.getIsCollapsed();if(c){const h=_i(a,i,"trailing");if(h!==-1){const R=On(a,h,e);if(R===null)return;e.getGlobalEvent().setCanvasEventAbility(),n.setRange(R,R),e.render({curIndex:R});return}if(Gc(t))return}const d=e.getControl();let u;if(c&&i>0){const h=a[i-1],R=a[i],T=R?.control?.type===s.ControlType.TEXT&&R.controlComponent===s.ControlComponent.PLACEHOLDER,g=e.getMode()===s.EditorMode.FORM&&R?.control?.type===s.ControlType.NUMBER&&!d.getIsExistValueByElementListIndex(a,i)&&(R.controlComponent===s.ControlComponent.PREFIX||R.controlComponent===s.ControlComponent.PRE_TEXT||R.controlComponent===s.ControlComponent.PLACEHOLDER||R.controlComponent===s.ControlComponent.POSTFIX||R.controlComponent===s.ControlComponent.POST_TEXT);if(e.getMode()===s.EditorMode.FORM&&T)return;if(h?.subTemplateParentId&&R?.subTemplateParentId!==h.subTemplateParentId&&!T&&!(h.type===s.ElementType.SUB_TEMPLATE&&R?.subTemplateParentId===h.id)){const X=Ai(a,i-1);if(X!==-1){const D=On(a,X,e);if(D===null)return;e.getGlobalEvent().setCanvasEventAbility(),n.setRange(D,D),e.render({curIndex:D});return}}const C=e.getPosition().getPositionList(),p=C[i],I=C[i-1],m=p&&I&&p.rowIndex===I.rowIndex,L=h?.controlComponent===s.ControlComponent.PREFIX||h?.controlComponent===s.ControlComponent.PRETEXTFIX||h?.controlComponent===s.ControlComponent.PRE_TEXT||h?.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT,O=h?.controlComponent===s.ControlComponent.POSTFIX||h?.controlComponent===s.ControlComponent.POSTTEXTFIX||h?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||h?.controlComponent===s.ControlComponent.POST_TEXT,P=!!h?.controlId,S=R?.controlComponent===s.ControlComponent.PLACEHOLDER,y=R?.controlComponent===s.ControlComponent.POSTFIX||R?.controlComponent===s.ControlComponent.POSTTEXTFIX||R?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||R?.controlComponent===s.ControlComponent.POST_TEXT,Y=R?.control?.type===s.ControlType.TEXT&&(R.controlComponent===s.ControlComponent.PREFIX||R.controlComponent===s.ControlComponent.PRE_TEXT),b=y&&h?.controlId===R?.controlId&&h?.originControlId===R?.originControlId&&h?.controlComponent===s.ControlComponent.VALUE,M=!!R&&!R.controlId&&!R.control;if(S&&L&&P&&m||g)return;const{isInParent:V,parentControlId:N}=xc(a,i,h);if(O&&P&&m&&V&&!(R?.controlId===N&&!R?.originControlId&&(R?.controlComponent===s.ControlComponent.VALUE||R?.controlComponent===s.ControlComponent.PLACEHOLDER))){if(h.originControlId&&N)for(let D=i;D<a.length;D++){const E=a[D];if(Bi(E,N)){if(E.controlComponent===s.ControlComponent.VALUE){n.setRange(D,D),e.render({curIndex:D,isSubmitHistory:!1});return}if(E.controlComponent===s.ControlComponent.POSTFIX||E.controlComponent===s.ControlComponent.POSTTEXTFIX||E.controlComponent===s.ControlComponent.POST_TEXT)return}E.controlId!==N&&E.originControlId}return}if(O&&P&&m&&!V&&!(M&&!S&&!y)){if(Y)return;if(T)return;{const X=i-1;u=d.removeControl(X),e.getGlobalEvent().setCanvasEventAbility(),u===null?(n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1})):(n.setRange(u,u),e.render({curIndex:u}));return}}if(y&&R?.originControlId&&V&&N&&m){for(let X=i+1;X<a.length;X++){const D=a[X];if(Bi(D,N)){if(D.controlComponent===s.ControlComponent.VALUE||D.controlComponent===s.ControlComponent.PLACEHOLDER){n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1});return}break}if(D.controlId&&D.controlId!==N&&D.originControlId!==N)break}for(let X=i-1;X>=0;X--){const D=a[X];if(Bi(D,N)){if(D.controlComponent===s.ControlComponent.VALUE||D.controlComponent===s.ControlComponent.PLACEHOLDER){n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1});return}break}if(D.controlId&&D.controlId!==N&&D.originControlId!==N)break}return}if(e.getMode()===s.EditorMode.FORM&&y&&R?.originControlId&&m){const X=Qo(a,R.originControlId);if(!X)return;for(let D=i-1;D>=0;D--){const E=a[D];if(E.controlId===X&&!E.originControlId){if(E.controlComponent===s.ControlComponent.VALUE||E.controlComponent===s.ControlComponent.PLACEHOLDER){n.setRange(D,D),e.render({curIndex:D,isSubmitHistory:!1});return}if(E.controlComponent===s.ControlComponent.PREFIX||E.controlComponent===s.ControlComponent.PRE_TEXT||E.controlComponent===s.ControlComponent.PRETEXTFIX||E.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)return}if(E.controlId&&E.controlId!==X&&E.originControlId!==X)break}return}if(y&&R?.controlId&&m&&!b){const X=i;u=d.removeControl(X),e.getGlobalEvent().setCanvasEventAbility(),u===null?(n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1})):(n.setRange(u,u),e.render({curIndex:u}));return}}if(r){const h=e.getTableParticle().getRangeRowCol();if(!h)return;let R=!1;for(let T=0;T<h.length;T++){const g=h[T];for(let f=0;f<g.length;f++){const C=g[f];C.value.length>1&&(e.spliceElementList(C.value,1,C.value.length-1),R=!0)}}u=R?0:null}else if(d.getActiveControl()&&d.getIsRangeCanCaptureEvent())u=d.keydown(o),u!==null&&d.emitControlContentChange();else{const h=e.getPosition().getCursorPosition();if(!h)return;const{index:R}=h,T=n.getIsCollapsed(),g=e.getElementList();if(T&&R===0){const I=g[R];if(I.value===_){I.listId&&e.getListParticle().unsetList(),o.preventDefault();return}}const f=g[i];if(T&&f.rowFlex&&f.value===_){const I=n.getRangeRowElementList();if(I){const m=g[i-1];I.forEach(L=>{L.rowFlex=m?.rowFlex})}}const C=f.value===_?g[i-1]:f,p=g[l+1];if(C?.titleId&&p?.titleId&&C.level===p.level&&C.titleId!==p.titleId){const I=C.titleId,m=p.titleId;let L=l+1;for(;L<g.length&&g[L]?.titleId===m;)g[L].titleId=I,L++}T?e.spliceElementList(g,R,1):e.spliceElementList(g,i+1,l-i),u=T?R-1:i}e.getGlobalEvent().setCanvasEventAbility(),u===null?(n.setRange(i,i),e.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(u,u),e.render({curIndex:u}))}function $c(o){const t=o.getDraw(),e=t.getRange(),n=e.getRange(),i=t.getElementList(),l=i[n.startIndex+1];if(!ae(l)||t.getMode()===s.EditorMode.FORM&&l?.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;const r=n.startIndex+1;for(;r<i.length;){const a=i[r];if(a.type===s.ElementType.SUB_TEMPLATE&&a.subTemplateExpanded){const u=On(i,r,t);return u===null?!1:(e.setRange(u,u),t.getGlobalEvent().setCanvasEventAbility(),t.render({curIndex:u}),!0)}let c=null;a.controlId?c=t.getControl().removeControl(r):(t.spliceElementList(i,r,1),c=r);const d=i[c];if(!d||!ae(d))break}return!1}function zc(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:l,isCrossRowCol:r,splitTdRange:a}=n.getRange(),c=e.getElementList(),d=e.getControl();if(n.getIsCollapsed()){const h=_i(c,l+1,"leading");if(h!==-1){const R=On(c,h,e);if(R===null)return;e.getGlobalEvent().setCanvasEventAbility(),n.setRange(R,R),e.render({curIndex:R});return}if($c(t))return}let u;if(r){const h=e.getTableParticle().getRangeRowCol();if(!h)return;let R=!1;for(let T=0;T<h.length;T++){const g=h[T];for(let f=0;f<g.length;f++){const C=g[f];C.value.length>1&&(e.spliceElementList(C.value,1,C.value.length-1),R=!0)}}u=R?0:null}else if(d.getActiveControl()&&d.getIsRangeWithinControl())u=d.keydown(o),u!==null&&d.emitControlContentChange();else if(c[l+1]?.controlId)u=d.removeControl(l+1);else if(n.getIsCollapsed()&&c[l+1]?.subTemplateParentId){const h=Ai(c,l+1);h!==-1?u=On(c,h,e):u=null}else{e.removeSplitTdOtherRangeElements();const h=e.getPosition(),R=h.getCursorPosition();if(!R)return;const{index:T}=R,g=h.getPositionContext();if(g.isDirectHit&&g.isImage)e.spliceElementList(c,T,1),u=T-1;else{const f=n.getIsCollapsed();if(!f)e.spliceElementList(c,i+1,l-i);else if(c[T+1])e.spliceElementList(c,T+1,1);else{let C=!0;if(g.isTable){const p=e.getTd();if(p?.linkTdNextId){const I=e.getTdById(p.linkTdNextId);I&&(C=!1,e.spliceElementList(I.value,1,1))}}if(C)return}u=f?T:i,u===0&&a&&(u=e.fixPosition(!0)??u)}}e.getGlobalEvent().setCanvasEventAbility(),u===null?(n.setRange(i,i),e.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(u,u),e.render({curIndex:u}))}function jc(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:l}=n.getRange(),r=n.getIsCollapsed(),a=e.getElementList(),c=a[i],d=a[l];if(r&&d.listId&&d.value===_&&a[l+1]?.listId!==d.listId){e.getListParticle().unsetList();return}let u={value:_};if(o.shiftKey&&c.listId&&(u.listWrap=!0),le(a,[u],i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()}),o.shiftKey&&d.areaId&&d.areaId!==a[l+1]?.areaId&&(u=Ee(u,un)),!(a[i+1]?.titleId&&(!c.titleId||c.titleId!==a[i+1]?.titleId))&&!(d.titleId&&d.titleId!==a[l+1]?.titleId)){const C=n.getRangeAnchorStyle(a,l);if(C){const p=[...ce],I=C.controlComponent===s.ControlComponent.POSTFIX||C.controlComponent===s.ControlComponent.POSTTEXTFIX||C.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||C.controlComponent===s.ControlComponent.POST_TEXT,m=C.control?.type===s.ControlType.BUTTON&&!C.control?.buttonText;!I&&!m&&p.push(...Ne),p.forEach(L=>{const O=C[L];O!==void 0&&(u[L]=O)})}}const h=e.getControl(),R=h.getActiveControl();let T;const g=R?.getElement();if(g?.control?.type===s.ControlType.BUTTON&&!g.control?.buttonText&&h.getIsRangeWithinControl())T=R.setValue([u]),~T&&h.emitControlContentChange();else if(R&&h.getIsRangeWithinControl())T=h.setValue([u]),h.emitControlContentChange();else{const p=e.getPosition().getCursorPosition();if(!p)return;const{index:I}=p;if(r){if(e.spliceElementList(a,I+1,0,[u]),d.titleId&&a[I+2]?.titleId===d.titleId){const m=ft();let L=I+2;for(;L<a.length&&a[L]?.titleId===d.titleId;)a[L].titleId=m,L++}}else e.spliceElementList(a,i+1,l-i,[u]);T=I+1}~T&&(n.setRange(T,T),e.render({curIndex:T})),o.preventDefault()}function Sr(o){return o&&(o.type===s.ElementType.MACRO||o.type===s.ElementType.CUSTOM_MACRO||o.type===s.ElementType.REUSABLE_ITEM||o.type===s.ElementType.SUB_TEMPLATE||o.type===s.ElementType.MENSTRUAL_HISTORY||o.type===s.ElementType.FETAL_HEART_POSITION||o.type===s.ElementType.TOOTH_POSITION||o.type===s.ElementType.LIST||o.type===s.ElementType.SPECIAL_SYMBOLS)}function qc(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),l=i.getCursorPosition();if(!l)return;const r=i.getPositionContext(),{index:a}=l;if(a<=0&&!r.isTable)return;const c=e.getRange(),{startIndex:d,endIndex:u}=c.getRange(),h=c.getIsCollapsed(),R=e.getElementList(),T=e.getControl(),g=e.getMode()===s.EditorMode.FORM,f=T.getActiveControl()?.getElement()?.control?.type,C=g&&(f===s.ControlType.TEXT||f===s.ControlType.NUMBER),p=g?T.getActiveTextControlLimit():null,I=R[a],m=I?.controlComponent===s.ControlComponent.PREFIX||I?.controlComponent===s.ControlComponent.PRETEXTFIX||I?.controlComponent===s.ControlComponent.PRE_TEXT;let L=!1;if(m&&I?.originControlId){const M=I.originControlId;for(let V=a-1;V>=0;V--){const N=R[V];if(N.controlId===M&&!N.originControlId){L=!0;break}if(N.controlId&&N.controlId!==M&&N.originControlId!==M)break}}if(g&&!C&&T.getActiveControl()&&m&&!p&&!L){T.initNextControl({direction:zt.UP});return}let O=1;if(Ae(o)){const M=e.getLetterReg(),V=o.shiftKey&&!h&&d===l?.index?u:d;if(M.test(R[V]?.value)){let N=V-1;for(;N>0;){const X=R[N];if(!M.test(X.value))break;O++,N--}}}if(g&&!C){const M=R[d],V=M?.controlId;if(V&&M?.controlComponent===s.ControlComponent.VALUE){let N=!1;for(let X=d;X>=0;X--){const D=R[X];if(D.controlId!==V)break;if(D.control?.type===s.ControlType.TEXTFIELD){N=!0;break}}if(N){if(M.controlComponent===s.ControlComponent.VALUE&&Sr(M))return;const X=d-O;if(X>=0){const D=R[X];if(D&&D.controlId===V&&D.controlComponent===s.ControlComponent.VALUE&&Sr(D))return}}}}const P=p?Math.max(d-O,p.startIndex):d-O;let S=P,y=P;if(o.shiftKey&&l&&(d!==u?d===l.index?(S=d,y=u-O):(S=P,y=u):y=u),!o.shiftKey){const M=R[d];if(M.type===s.ElementType.TABLE){const V=M.trList,N=V.length-1,X=V[N],D=X.tdList.length-1,E=X.tdList[D];i.setPositionContext({isTable:!0,index:d,trIndex:N,tdIndex:D,tdId:E.id,trId:X.id,tableId:M.id}),S=E.value.length-1,y=S}else if(M.tableId&&d===0){const N=e.getOriginalElementList()[r.index],X=e.getTd();if(X?.linkTdPrevId){const D=e.getTdById(X.linkTdPrevId);D&&(i.setPositionContext({...r,isTable:!0,index:D.tableIndex,trIndex:D.trIndex,tdId:D.id,trId:D.trId,tableId:D.tableId}),S=D.value.length-1,y=S)}else{const D=N.trList;t:for(let E=0;E<D.length;E++){const U=D[E];if(U.id!==M.trId)continue;const F=U.tdList;for(let Z=0;Z<F.length;Z++)if(F[Z].id===M.tdId){if(E===0&&Z===0)i.setPositionContext({isTable:!1}),S=r.index-1,y=S,e.getTableTool().dispose();else{let W=E,K=Z-1;K<0&&(W=E-1,K=D[W].tdList.length-1);const k=D[W],B=k.tdList[K];i.setPositionContext({isTable:!0,index:r.index,trIndex:W,tdIndex:K,tdId:B.id,trId:k.id,tableId:M.tableId}),S=B.value.length-1,y=S}break t}}}}}if(!~S||!~y)return;const Y=e.getElementList();S=_n(Y,S),y=_n(Y,y),c.setRange(S,y);const b=S===y;e.updateTableTool(),e.render({curIndex:b?S:void 0,isSetCursor:b,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function Dr(o){return o&&(o.type===s.ElementType.MACRO||o.type===s.ElementType.CUSTOM_MACRO||o.type===s.ElementType.REUSABLE_ITEM||o.type===s.ElementType.SUB_TEMPLATE||o.type===s.ElementType.MENSTRUAL_HISTORY||o.type===s.ElementType.FETAL_HEART_POSITION||o.type===s.ElementType.TOOTH_POSITION||o.type===s.ElementType.LIST||o.type===s.ElementType.SPECIAL_SYMBOLS)}function td(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),l=i.getCursorPosition();if(!l)return;const{index:r}=l,a=i.getPositionList(),c=i.getPositionContext();if(r>a.length-1&&!c.isTable)return;const d=e.getRange(),{startIndex:u,endIndex:h}=d.getRange(),R=d.getIsCollapsed();let T=e.getElementList();const g=e.getControl(),f=e.getMode()===s.EditorMode.FORM,C=g.getActiveControl()?.getElement()?.control?.type,p=f&&(C===s.ControlType.TEXT||C===s.ControlType.NUMBER),I=f?g.getActiveTextControlLimit():null,m=T[r],L=m?.controlComponent===s.ControlComponent.POSTFIX||m?.controlComponent===s.ControlComponent.POSTTEXTFIX||m?.controlComponent===s.ControlComponent.POST_TEXT;let O=!1;if(L&&m?.originControlId){const N=m.originControlId;for(let X=r+1;X<T.length;X++){const D=T[X];if(D.controlId===N&&!D.originControlId){O=!0;break}if(D.controlId&&D.controlId!==N&&D.originControlId!==N)break}}if(f&&!p&&g.getActiveControl()&&L&&!I&&!O){g.initNextControl({direction:zt.DOWN});return}let P=1;if(Ae(o)){const N=e.getLetterReg(),X=o.shiftKey&&!R&&u===l?.index?h:u;if(N.test(T[X+1]?.value)){let D=X+2;for(;D<T.length;){const E=T[D];if(!N.test(E.value))break;P++,D++}}}if(f&&!p){const N=T[h],X=N?.controlId;if(X&&N?.controlComponent===s.ControlComponent.VALUE){let D=!1;for(let E=h;E>=0;E--){const U=T[E];if(U.controlId!==X)break;if(U.control?.type===s.ControlType.TEXTFIELD){D=!0;break}}if(D){if(N.controlComponent===s.ControlComponent.VALUE&&Dr(N))return;const E=h+P;if(E<T.length){const U=T[E];if(U&&U.controlId===X&&U.controlComponent===s.ControlComponent.VALUE&&Dr(U))return}}}}const S=I?Math.min(h+P,I.endIndex):h+P;let y=S,Y=S;if(o.shiftKey&&l&&(u!==h?u===l.index?(y=u,Y=S):(y=u+P,Y=h):y=u),!o.shiftKey){const N=T[h],X=T[h+1];if(X?.type===s.ElementType.TABLE){const E=X.trList[0],U=E.tdList[0];i.setPositionContext({isTable:!0,index:h+1,trIndex:0,tdIndex:0,tdId:U.id,trId:E.id,tableId:X.id}),y=0,Y=0}else if(N.tableId&&!X){const D=e.getTd(),E=D?.linkTdNextId?e.getTdById(D.linkTdNextId):void 0;if(E?.value.length)i.setPositionContext({...c,isTable:!0,index:E.tableIndex,trIndex:E.trIndex,tdId:E.id,trId:E.trId,tableId:E.tableId}),y=0,Y=y;else{const F=e.getOriginalElementList()[c.index].trList;t:for(let Z=0;Z<F.length;Z++){const Q=F[Z];if(Q.id!==N.trId)continue;const W=Q.tdList;for(let K=0;K<W.length;K++)if(W[K].id===N.tdId){if(Z===F.length-1&&K===W.length-1)i.setPositionContext({isTable:!1}),y=c.index,Y=y,T=e.getElementList(),e.getTableTool().dispose();else{let B=Z,H=K+1;H>W.length-1&&(B=Z+1,H=0);const A=F[B],v=A.tdList[H];i.setPositionContext({isTable:!0,index:c.index,trIndex:B,tdIndex:H,tdId:v.id,trId:A.id,tableId:N.tableId}),y=0,Y=y}break t}}}}}const b=T.length-1;if(y>b||Y>b)return;const M=e.getElementList();y=_n(M,y,s.LocationPosition.AFTER),Y=_n(M,Y,s.LocationPosition.AFTER),d.setRange(y,Y);const V=y===Y;e.updateTableTool(),e.render({curIndex:V?y:void 0,isSetCursor:V,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function ed(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getMode()===s.EditorMode.FORM,l=e.getControl(),r=e.getRange(),a=e.getElementList(),{startIndex:c,endIndex:d}=r.getRange(),u=a[c],h=a[d],R=c>0?a[c-1]:null,T=l.getIsRangeWithinControl()||!!u?.controlId||!!h?.controlId||!!R?.controlId;let g=l.getActiveControl();if(i&&T&&(l.initControl(),g=l.getActiveControl()),i&&T)o.preventDefault(),l.initNextControl({direction:o.shiftKey?zt.UP:zt.DOWN});else if(g&&l.getIsRangeWithinControl())o.preventDefault(),l.initNextControl({direction:o.shiftKey?zt.UP:zt.DOWN});else{o.preventDefault();const f=r.getRangeAnchorStyle(a,d),p={...f?xt(f,Ne):null,type:s.ElementType.TAB,value:""};le(a,[p],c,{editorOptions:e.getOptions()}),e.insertElementList([p])}}function ki(o){const{positionList:t,index:e,isUp:n,rowNo:i,cursorX:l}=o;let r=-1;const a=[];if(n){let c=e-1;for(;c>=0;){const d=t[c];if(c--,d.rowNo!==i){if(a[0]&&a[0].rowNo!==d.rowNo)break;a.unshift(d)}}}else{let c=e+1;for(;c<t.length;){const d=t[c];if(c++,d.rowNo!==i){if(a[0]&&a[0].rowNo!==d.rowNo)break;a.push(d)}}}for(let c=0;c<a.length;c++){const d=a[c],{coordinate:{leftTop:[u],rightTop:[h]}}=d;if(c===a.length-1&&(r=d.index),!(l<u||l>h)){r=d.index;break}}return r}function nd(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),l=i.getCursorPosition();if(!l)return;const r=e.getRange(),{startIndex:a,endIndex:c}=r.getRange();let d=i.getPositionList();const u=o.key===s.KeyMap.Up;let h=-1,R=-1;const T=i.getPositionContext();if(!o.shiftKey&&T.isTable&&(u&&l.rowIndex===0||!u&&l.rowIndex===e.getRowCount()-1)){const{index:f,trIndex:C,tdIndex:p,tableId:I}=T;if(u){const m=e.getOriginalElementList();if(C===0)if(m[f].originalId){const O=f-1,P=m[O];for(let S=P.trList.length-1;S>=0;S--){const y=P.trList[S].tdList.find(Y=>Y.tdIndex===p);if(y?.value.length){i.setPositionContext({isTable:!0,tableId:P.id,index:O,trIndex:S,tdIndex:p}),h=y.value.length-1,R=y.value.length-1;break}}}else i.setPositionContext({isTable:!1}),h=f-1,R=h,e.getTableTool().dispose();else{let L=-1,O=-1;const P=m[f].trList,S=P[C].tdList[p].colIndex;t:for(let b=C-1;b>=0;b--){const V=P[b].tdList;for(let N=0;N<V.length;N++){const X=V[N];if(X.colIndex===S||X.colIndex+X.colspan-1>=S&&X.colIndex<=S){L=b,O=N;break t}}}if(!~L||!~O)return;const y=P[L],Y=y.tdList[O];i.setPositionContext({isTable:!0,index:f,trIndex:L,tdIndex:O,tdId:Y.id,trId:y.id,tableId:I}),h=Y.value.length-1,R=h}}else{const m=e.getOriginalElementList(),L=m[f],O=L.trList;if(C===O.length-1){const P=f+1,S=m[P];if(S&&[L.id,L.originalId].includes(S.originalId)){for(let Y=p;Y>=0;Y--)if(S.trList[0].tdList[Y].value.length){i.setPositionContext({isTable:!0,index:P,tableId:S.id,trIndex:0,tdIndex:Y}),h=0,R=0;break}}else i.setPositionContext({isTable:!1}),h=f,R=h,e.getTableTool().dispose()}else{let P=-1,S=-1;const y=O[C].tdList[p].colIndex;t:for(let M=C+1;M<O.length;M++){const N=O[M].tdList;for(let X=0;X<N.length;X++){const D=N[X];if(D.colIndex===y||D.colIndex+D.colspan-1>=y&&D.colIndex<=y){P=M,S=X;break t}}}if(!~P||!~S)return;const Y=O[P],b=Y.tdList[S];i.setPositionContext({isTable:!0,index:f,trIndex:P,tdIndex:S,tdId:b.id,trId:Y.id,tableId:I}),h=b.value.length-1,R=h}}}else{let f=l;o.shiftKey&&(a===l.index?f=d[c]:f=d[a]);const{index:C,rowNo:p,rowIndex:I,coordinate:{rightTop:[m]}}=f;if(u&&I===0||!u&&I===e.getRowCount()-1)return;const L=ki({positionList:d,index:C,rowNo:p,isUp:u,cursorX:m});if(L<0)return;h=L,R=L,o.shiftKey&&(a!==c?a===l.index?h=a:R=c:u?R=c:h=a);const P=e.getElementList()[L];if(P.type===s.ElementType.TABLE){const{scale:S}=e.getOptions(),y=e.getMargins(),Y=P.trList;let b=-1,M=-1,V=-1;if(u)t:for(let N=Y.length-1;N>=0;N--){const D=Y[N].tdList;for(let E=0;E<D.length;E++){const U=D[E],F=U.x*S+y[3],Z=U.width*S;if(m>=F&&m<=F+Z){const Q=U.positionList,W=Q[Q.length-1],K=ki({positionList:Q,index:W.index+1,rowNo:W.rowNo-1,isUp:u,cursorX:m})||W.index;b=N,M=E,V=K;break t}}}else t:for(let N=0;N<Y.length;N++){const D=Y[N].tdList;for(let E=0;E<D.length;E++){const U=D[E],F=U.x*S+y[3],Z=U.width*S;if(m>=F&&m<=F+Z){const Q=U.positionList,W=ki({positionList:Q,index:-1,rowNo:-1,isUp:u,cursorX:m})||0;b=N,M=E,V=W;break t}}}if(~b&&~M&&~V){const N=Y[b],X=N.tdList[M];i.setPositionContext({isTable:!0,index:L,trIndex:b,tdIndex:M,tdId:X.id,trId:N.id,tableId:P.id}),h=V,R=h,d=i.getPositionList()}}}if(!~h||!~R)return;h>R&&([h,R]=[R,h]),r.setRange(h,R);const g=h===R;e.render({curIndex:g?h:void 0,isSetCursor:g,isSubmitHistory:!1,isCompute:!1}),g||(e.getCursor().moveCursorToVisible({cursorPosition:d[u?h:R],direction:u?zt.UP:zt.DOWN}),e.updateTableTool())}function od(o){return o.key.length===1&&!o.ctrlKey&&!o.metaKey&&!o.altKey}function id(o,t){const e=t.getDraw();if(e.isReadonly()&&e.getMode()!==s.EditorMode.FORM)return!1;const n=e.getRange();if(!n.getIsCanInput())return!1;const i=e.getControl();if(!i.getActiveControl()&&i.getIsRangeWithinControl()){i.setPopupAwakeDisabled(!0);try{i.initControl()}finally{i.setPopupAwakeDisabled(!1)}}const l=i.getActiveControl();if(l?.getElement()?.control?.type!==s.ControlType.DATE||!i.getIsRangeWithinControl())return!1;const{startIndex:r,endIndex:a}=n.getRange(),c=e.getElementList(),d=c[r],u=c[a],h=l.getElement(),R=p=>!!p?.controlId&&p.controlId===h.controlId&&(p.originControlId||null)===(h.originControlId||null),T=u?.controlComponent===s.ControlComponent.POSTFIX||u?.controlComponent===s.ControlComponent.POST_TEXT||u?.controlComponent===s.ControlComponent.POSTTEXTFIX||u?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT,g=c[a+1],f=!!(u?.originControlId&&u.controlComponent===s.ControlComponent.VALUE&&R(g)&&(g.controlComponent===s.ControlComponent.POSTFIX||g.controlComponent===s.ControlComponent.POST_TEXT||g.controlComponent===s.ControlComponent.POSTTEXTFIX||g.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT));return!R(d)||!R(u)||T||f?!1:(o.preventDefault(),l.awake?.(),!0)}function sd(o,t){if(o.key!==" "&&o.key!=="Spacebar"&&o.code!=="Space")return!1;const e=t.getDraw();if(e.isReadonly()||e.isDisabled())return!1;const n=e.getRange(),i=e.getControl();if(!i.getActiveControl()&&i.getIsRangeWithinControl()){i.setPopupAwakeDisabled(!0);try{i.initControl()}finally{i.setPopupAwakeDisabled(!1)}}const l=i.getActiveControl(),r=l?.getElement();if(r?.control?.type!==s.ControlType.BUTTON||r.control.buttonText||r.control.editable===!1||!i.getIsRangeWithinControl())return!1;const a=l.setValue([{value:" "}]);return~a&&(i.emitControlContentChange(),n.setRange(a,a),e.render({curIndex:a,isSubmitHistory:!0,traceLabel:"keydown:button-space"})),o.preventDefault(),!0}function rd(o,t){if(t.isComposing)return;const e=t.getDraw();if(!e.getMacroParticle().keydown(o))if(o.key===s.KeyMap.Backspace)Jc(o,t);else if(o.key===s.KeyMap.Delete)zc(o,t);else if(o.key===s.KeyMap.Enter)jc(o,t);else if(o.key===s.KeyMap.Left)qc(o,t);else if(o.key===s.KeyMap.Right)td(o,t);else if(o.key===s.KeyMap.Up||o.key===s.KeyMap.Down)nd(o,t);else{if(sd(o,t))return;if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.Z){if(e.isReadonly()&&e.getMode()!==s.EditorMode.FORM)return;e.getHistoryManager().undo(),o.preventDefault()}else if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.Y){if(e.isReadonly()&&e.getMode()!==s.EditorMode.FORM)return;e.getHistoryManager().redo(),o.preventDefault()}else if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.C)t.copy(),o.preventDefault();else if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.X)t.cut(),o.preventDefault();else if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.A)t.selectAll(),o.preventDefault();else if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.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===s.KeyMap.ESC){t.clearPainterStyle();const n=e.getZone();n.isMainActive()||n.setZone(s.EditorZone.MAIN),o.preventDefault()}else o.key===s.KeyMap.TAB?ed(o,t):od(o)&&id(o,t)}}function ld(o){return/[\u4e00-\u9fa5\u3000-\u303f\uff00-\uffef]/.test(o)}function ad(o){return/[a-zA-Z]/.test(o)}function cd(o,t){return ld(o)?t:ad(o)?"Times New Roman":t}function Ko(o){return o?.type===s.ElementType.CONTROL&&(o.controlComponent===s.ControlComponent.PREFIX||o.controlComponent===s.ControlComponent.PRE_TEXT||o.controlComponent===s.ControlComponent.PRETEXTFIX||o.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)}function De(o){return o?.type===s.ElementType.CONTROL&&(o.controlComponent===s.ControlComponent.POSTFIX||o.controlComponent===s.ControlComponent.POST_TEXT||o.controlComponent===s.ControlComponent.POSTTEXTFIX||o.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)}function Gi(o){return!!o?.originControlId&&Ko(o)}function ao(o){return!!o?.originControlId&&De(o)}function dd(o,t){return!o||!t?!1:!!o.originControlId&&!!t.originControlId&&o.originControlId===t.originControlId&&o.controlId!==t.controlId}function Rn(o,t,e){if(!t)return null;const n=new Set;let i=t,l=null;for(;i&&!n.has(i);){n.add(i);let r;for(let a=0;a<o.length;a++){const c=o[a];if(c.controlId===i&&c.control?.type&&(r=c,c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT))break}if(!r)break;(r.control?.type===s.ControlType.TEXT||e===s.EditorMode.EDIT&&r.control?.type===s.ControlType.TEXTFIELD)&&(l=i),i=r.originControlId||null}return l}function je(o,t){return!!o&&!!t&&o.controlId===t}function Fr(o,t){if(t)return o.find(e=>e.controlId===t&&!e.originControlId&&!!e.control?.type)}function Xr(o,t,e){if(!t?.originControlId||e?.originControlId!==t.originControlId||!t.controlId||!e.controlId||t.controlId===e.controlId||!De(t)||!Ko(e))return;const n=Fr(o,t.originControlId);if(n?.control?.type===s.ControlType.TEXTFIELD)return n}function xi(o,t,e){Ne.forEach(n=>{delete o[n]}),ue.forEach(n=>{const i=t?.[n];i!==void 0&&(o[n]=i)}),t?.type===s.ControlType.TEXT&&o.color?.toLowerCase()==="#87d068"?o.color=e:o.color||(o.color=e)}function Ji(o,t,e,n){o.controlId=t,o.control=e,o.controlComponent=s.ControlComponent.VALUE,delete o.originControlId,xi(o,e,n)}function $i(o,t,e="input"){const n=re(),i=t.getDraw(),l=i.getControl(),r=i.getOptions(),a=i.getElementList();if(i.isDisabled()||i.getMacroParticle().input(o,t.isComposing)||i.isReadonly())return;const d=i.getPosition().getCursorPosition();if(!o||!d)return;const u=t.isComposing;if(u&&t.compositionInfo?.value===o)return;const h=i.getRange();if(!h.getIsCanInput())return;const R=h.getRange(),T=R.startIndex===R.endIndex?R.endIndex:R.startIndex,g=Tt=>{l.setPopupAwakeDisabled(!0);try{return Tt()}finally{l.setPopupAwakeDisabled(!1)}},f=()=>{g(()=>l.initControl())},C=(Tt,tt)=>{g(()=>{h.setRange(Tt,tt)})};let p=l.getActiveControl();const I=i.getElementList()[h.getRange().endIndex],m=I?.control?.type===s.ControlType.TEXT&&!!I?.originControlId&&(I.controlComponent===s.ControlComponent.PREFIX||I.controlComponent===s.ControlComponent.PRE_TEXT||I.controlComponent===s.ControlComponent.PRETEXTFIX||I.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||I.controlComponent===s.ControlComponent.POSTFIX||I.controlComponent===s.ControlComponent.POST_TEXT||I.controlComponent===s.ControlComponent.POSTTEXTFIX||I.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||I.controlComponent===s.ControlComponent.PLACEHOLDER);if(!p&&(l.getIsRangeWithinControl()||m)&&(f(),p=l.getActiveControl()),p){const Tt=p.getElement(),tt=i.getElementList()[h.getRange().endIndex],Dt=kt(Tt,tt),vt=!!tt&&tt.controlComponent===s.ControlComponent.VALUE&&!!tt.controlId&&!tt.originControlId&&h.getRange().endIndex>0&&i.getElementList()[h.getRange().endIndex-1]?.originControlId===tt.controlId;(!Dt||vt)&&(f(),p=l.getActiveControl())}const{endIndex:L}=h.getRange(),O=i.getElementList(),P=O[L],S=O[L+1];if(P?.type===s.ElementType.SUB_TEMPLATE&&S?.type===s.ElementType.SUB_TEMPLATE)return;const y=i.getMode()===s.EditorMode.FORM;if(y){const Tt=i.getPosition().getPositionContext().isTable&&i.isTableEditable()&&!p&&!l.getIsRangeWithinControl(),tt=h.getRange();if(!(i.getElementList()[tt.endIndex]?.control?.type===s.ControlType.TEXT)&&!Tt){const jt=l.getActiveTextControlLimit();if(!p||!l.getIsRangeWithinControl()&&!l.getIsRangeInPostfix())return;if(jt){const $=h.getRange();if($.startIndex<jt.startIndex||$.endIndex>jt.endIndex){const ne=Math.min(Math.max($.endIndex,jt.startIndex),jt.endIndex);g(()=>{h.setRange(ne,ne),i.render({curIndex:ne,isSubmitHistory:!1})});return}}const{endIndex:at}=h.getRange(),Pt=i.getElementList(),et=Pt[at];if(!et?.originControlId){if(et?.controlId&&et?.controlComponent===s.ControlComponent.VALUE){let $=!1;for(let ne=at;ne>=0;ne--){const qt=Pt[ne];if(qt.controlId!==et.controlId||qt.originControlId)break;if(qt.control?.type===s.ControlType.TEXTFIELD){$=!0;break}}if($)return}}}}const Y=h.getDefaultStyle()||t.compositionInfo?.defaultStyle||null,b=t.compositionInfo?.perfStartTime,M=hd(t,i.getElementList());u||i.getCursor().clearAgentDomValue();const{TEXT:V,HYPERLINK:N,SUBSCRIPT:X,SUPERSCRIPT:D,DATE:E,TAB:U}=s.ElementType,F=o.replaceAll(`
119
- `,_),{startIndex:Z,endIndex:Q}=h.getRange(),W=h.getRangeAnchorStyle(M,Z);if(!W)return;const K=Z>0?M[Z-1]:null,k=!!(W.controlId||W.control),H={...!k&&K?K:W,...Y},A=i.isDesignMode(),v=M[Q+1],ct=Rn(M,W.originControlId,i.getMode()),bt=Rn(M,v?.originControlId,i.getMode()),Qt=!W.originControlId&&!v?.originControlId&&De(W)&&Ko(v)&&!!W.controlId&&!!v.controlId&&W.controlId!==v.controlId,Ce=ao(W)&&Gi(v)&&!ct&&!bt,Gt=i.getMode()===s.EditorMode.EDIT?Xr(M,W,v):void 0,Re=!!W.originControlId&&De(W)&&v?.controlId===W.originControlId&&!v.originControlId&&v.control?.type===s.ControlType.TEXTFIELD&&De(v),nt=!!W.originControlId&&De(W)&&v?.controlId===W.originControlId&&!v.originControlId&&v.control?.type===s.ControlType.TEXTFIELD&&v.controlComponent===s.ControlComponent.VALUE,G=!!ct&&ct===bt&&!!W.controlId&&!!v?.controlId&&W.controlId!==v.controlId&&(ao(W)||Gi(v))?ct:null;if(y&&(Qt||Ce))return;const J=Ko(v)&&!v?.originControlId,it=(()=>{const Tt=p?.getElement();if(!y||Tt?.control?.type!==s.ControlType.TEXT||!W.subTemplateParentId||!De(W)||!v||v.subTemplateParentId===W.subTemplateParentId||!kt(v,Tt))return!1;for(let tt=Z-1;tt>=0;tt--){const Dt=M[tt];if(Dt.type===s.ElementType.SUB_TEMPLATE&&Dt.id===W.subTemplateParentId)return Dt.controlId===Tt.controlId&&(Dt.originControlId||null)===(Tt.originControlId||null)}return!1})(),q=De(W)&&!W.originControlId&&!it||W.type===s.ElementType.CONTROL&&W.controlComponent===s.ControlComponent.VALUE&&v?.type!==s.ElementType.CONTROL&&!W.originControlId,ut=[s.ControlType.SELECT,s.ControlType.DATE,s.ControlType.BUTTON],gt=(Tt,tt)=>{if(Tt?.control?.type)return Tt.control.type;if(Tt?.controlId){for(let Dt=tt;Dt>=0;Dt--){const vt=M[Dt];if(!kt(Tt,vt))break;if(vt.control?.type)return vt.control.type}for(let Dt=tt+1;Dt<M.length;Dt++){const vt=M[Dt];if(!kt(Tt,vt))break;if(vt.control?.type)return vt.control.type}}},Ot=(Tt,tt)=>{const Dt=gt(Tt,tt);return!!(Dt&&ut.includes(Dt))},Et=Tt=>{const tt=M[Tt];let Dt=Tt;for(let vt=Tt+1;vt<M.length&&kt(tt,M[vt]);vt++)Dt=vt;return Dt},yt=!!(Ot(W,Z)&&W.controlComponent===s.ControlComponent.VALUE&&!W.originControlId&&kt(W,v)&&De(v)&&!v?.value),Ft=!!((Ot(W,Z)||gt(W,Z)===s.ControlType.NUMBER)&&W.controlComponent===s.ControlComponent.VALUE&&W.originControlId&&kt(W,v)&&De(v))?Rn(M,W.originControlId,i.getMode()):null,Vt=Fr(M,Ft),_t=J||q||yt,pt=_t?{...W,type:void 0,control:void 0,controlId:void 0,controlComponent:void 0,originControlId:void 0,color:r.defaultColor,highlight:void 0}:W,ht=_t||k?pt:H,Lt=Nt(F).map(Tt=>{const tt={value:Tt};if(A||!ht.title?.disabled&&!ht.control?.disabled){const Dt=M[Q+1];(!ht.type||ht.type===V||ht.type===N&&Dt?.type===N||ht.type===E&&Dt?.type===E||ht.type===X&&Dt?.type===X||ht.type===D&&Dt?.type===D)&&ba.forEach(vt=>{if(vt==="groupIds"&&!Dt?.groupIds)return;const jt=ht[vt];jt!==void 0&&(tt[vt]=jt)}),(Y||ht.type===U)&&Ne.forEach(vt=>{const jt=Y?.[vt]||ht[vt];jt!==void 0&&(tt[vt]=jt)}),u&&(tt.underline=!0)}if(!_t){const Dt=W.originControlId&&(W.controlComponent===s.ControlComponent.POSTFIX||W.controlComponent===s.ControlComponent.POSTTEXTFIX||W.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||W.controlComponent===s.ControlComponent.POST_TEXT);if(Re||nt||Gt){const at=Gt||v;tt.controlId=at.controlId,tt.control=at.control,tt.controlComponent=s.ControlComponent.VALUE,delete tt.originControlId,xi(tt,at.control,r.defaultColor)}const vt=!W.originControlId&&W.controlId&&(W.controlComponent===s.ControlComponent.POSTFIX||W.controlComponent===s.ControlComponent.POSTTEXTFIX||W.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||W.controlComponent===s.ControlComponent.POST_TEXT)&&v?.controlId&&v.controlId!==W.controlId&&dd(W,v),jt=W.controlId&&W.originControlId&&(W.controlComponent===s.ControlComponent.VALUE||W.controlComponent===s.ControlComponent.PLACEHOLDER);if(!Re&&!nt&&!Gt&&Dt&&!tt.controlId){const at=Rn(M,W.originControlId,i.getMode());if(!at)return tt;let Pt=null;for(let et=Z;et>=0;et--){const $=M[et];if(je($,at)&&$.control){Pt=$.control;break}}tt.controlId=at,tt.controlComponent=s.ControlComponent.VALUE,Pt&&(tt.control=Pt),xi(tt,Pt,r.defaultColor)}else if(vt&&!tt.controlId){if(v?.controlId&&v.controlId!==W.controlId)if(v.controlComponent===s.ControlComponent.PREFIX||v.controlComponent===s.ControlComponent.PRETEXTFIX)for(let at=Z;at>=0;at--){const Pt=M[at];if(Pt.controlId===W.controlId&&(Pt.controlComponent===s.ControlComponent.PREFIX||Pt.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let et=at-1;et>=0;et--){const $=M[et];if($.controlId&&$.controlId!==W.controlId&&($.controlComponent===s.ControlComponent.PRETEXTFIX||$.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||$.controlComponent===s.ControlComponent.PREFIX||$.controlComponent===s.ControlComponent.PRE_TEXT)){tt.controlId=$.controlId,tt.controlComponent=s.ControlComponent.VALUE,$.control&&(tt.control=$.control);break}if($.controlId&&$.controlId!==W.controlId&&($.controlComponent===s.ControlComponent.POSTFIX||$.controlComponent===s.ControlComponent.POSTTEXTFIX))break}break}}else(v.controlComponent===s.ControlComponent.POSTFIX||v.controlComponent===s.ControlComponent.POSTTEXTFIX)&&(tt.controlId=v.controlId,tt.controlComponent=s.ControlComponent.VALUE,v.control&&(tt.control=v.control));if(!tt.controlId)for(let at=Z;at>=0;at--){const Pt=M[at];if(Pt.controlId===W.controlId&&(Pt.controlComponent===s.ControlComponent.PREFIX||Pt.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let et=at-1;et>=0;et--){const $=M[et];if($.controlId&&$.controlId!==W.controlId&&($.controlComponent===s.ControlComponent.PRETEXTFIX||$.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||$.controlComponent===s.ControlComponent.PREFIX||$.controlComponent===s.ControlComponent.PRE_TEXT)){tt.controlId=$.controlId,tt.controlComponent=s.ControlComponent.VALUE,$.control&&(tt.control=$.control);break}if($.controlId&&$.controlId!==W.controlId&&($.controlComponent===s.ControlComponent.POSTFIX||$.controlComponent===s.ControlComponent.POSTTEXTFIX))break}break}}}else if(jt&&!tt.controlId){const at=W.controlId;let Pt=W.control;if(!Pt)for(let et=Z;et>=0;et--){const $=M[et];if($.controlId===at&&$.control&&(Pt=$.control,$.controlComponent===s.ControlComponent.PREFIX||$.controlComponent===s.ControlComponent.PRETEXTFIX))break}tt.controlId=at,tt.originControlId=W.originControlId,tt.controlComponent=s.ControlComponent.VALUE,Pt&&(tt.control=Pt)}else if(W.controlId){let at=W.control;if(!at)for(let Pt=Z;Pt>=0;Pt--){const et=M[Pt];if(je(et,W.controlId)&&et.control){at=et.control;break}}tt.controlId||(tt.controlId=W.controlId),at&&!tt.control&&(tt.control=at),tt.controlComponent||(tt.controlComponent=s.ControlComponent.VALUE)}else if(!tt.controlId&&!tt.control&&v?.originControlId&&(v.controlComponent===s.ControlComponent.PREFIX||v.controlComponent===s.ControlComponent.PRETEXTFIX)){const at=Rn(M,v.originControlId,i.getMode());if(!at)return tt;let Pt=null;for(let et=Q;et>=0;et--){const $=M[et];if(je($,at)&&$.control){Pt=$.control;break}}tt.controlId=at,tt.controlComponent=s.ControlComponent.VALUE,Pt&&(tt.control=Pt)}}if(Tt&&Tt!==_){const Dt=cd(Tt,r.defaultFont);tt.font=Dt}return tt});let Ct;const St=a[T],Kt=a[T+1],ge=a[T-1];if(u)Ct=Z;else{const Tt=et=>{if(Lt?.length)for(let $=0;$<Lt.length;$++)M.splice(et+$,0,Lt[$]);return et+Lt.length-1},tt=Z+1,Dt=yt?Et(Z)+1:tt,vt=()=>{let et=null,$,ne=null;const qt=i.getMode()===s.EditorMode.EDIT?Xr(a,St,Kt):void 0;if(qt?.controlId?(et=qt.controlId,$=qt.control?.type):i.getMode()===s.EditorMode.EDIT&&ao(St)&&Kt?.controlId===St.originControlId&&!Kt.originControlId&&Kt.control?.type===s.ControlType.TEXTFIELD&&(Kt.controlComponent===s.ControlComponent.VALUE||De(Kt))?(et=St.originControlId,$=s.ControlType.TEXTFIELD):ao(St)?et=Rn(a,St.originControlId,i.getMode()):Gi(Kt)?et=Rn(a,Kt.originControlId,i.getMode()):G?et=G:St?.control?.type===s.ControlType.TEXT&&St.controlId&&!St.originControlId&&De(St)&&ge?.originControlId===St.controlId&&(et=St.controlId,ne={startIndex:T-1,endIndex:T-1}),!et)return null;if(!$)for(let Bt=T;Bt>=0;Bt--){const te=a[Bt];if(je(te,et)&&te.control?.type){$=te.control.type;break}if(te.controlId&&te.controlId!==et&&te.originControlId!==et)break}return $!==s.ControlType.TEXT&&!(i.getMode()===s.EditorMode.EDIT&&$===s.ControlType.TEXTFIELD)?null:{parentControlId:et,activationIndex:(()=>{for(let Bt=T+1;Bt<a.length;Bt++){const te=a[Bt];if(je(te,et))return Bt;if(te.controlId&&te.controlId!==et&&te.originControlId!==et)break}for(let Bt=T;Bt>=0;Bt--){const te=a[Bt];if(je(te,et))return Bt;if(te.controlId&&te.controlId!==et&&te.originControlId!==et)break}return T})(),boundaryRange:ne}},jt=p?.getElement(),at=!!(jt?.control?.type===s.ControlType.BUTTON&&!jt.control?.buttonText&&jt.control?.editable!==!1&&l.getIsRangeWithinControl());Z!==Q&&!at&&(i.removeSplitTdOtherRangeElements(),i.spliceElementList(M,tt,Q-Z));const Pt=vt();if(Ft&&Vt?.control){const et=Et(Z);Lt.forEach($=>{Ji($,Ft,Vt.control,r.defaultColor)}),le(M,Lt,et,{editorOptions:r}),i.spliceElementList(M,et+1,0,Lt),Ct=et+Lt.length}else if(Pt){const{parentControlId:et,activationIndex:$,boundaryRange:ne}=Pt;C($,$),f();const qt=l.getActiveControl(),Te=Kt?.controlId===et&&!Kt?.originControlId&&Kt?.controlComponent===s.ControlComponent.VALUE?T+1:-1,Bt=!!(St?.originControlId&&ao(St)&&Te!==-1),te=ne||(Bt?{startIndex:T,endIndex:T}:Te!==-1?{startIndex:T,endIndex:Te}:{startIndex:Z,endIndex:Q});C(te.startIndex,te.endIndex),qt&&qt.getElement()?.controlId===et&&(qt.getElement()?.control?.type===s.ControlType.TEXT||qt.getElement()?.control?.type===s.ControlType.TEXTFIELD)?(Lt.forEach(oo=>{Ji(oo,et,qt.getElement().control,r.defaultColor)}),Ct=qt.setValue(Lt,{range:te,elementList:M}),l.emitControlContentChange(),C(Ct,Ct),f()):_t?Ct=Tt(Dt):(Ct=l.setValue(Lt),l.emitControlContentChange())}else if(_t)Ct=Tt(Dt);else if(St?.originControlId&&(St.controlComponent===s.ControlComponent.POSTFIX||St.controlComponent===s.ControlComponent.POST_TEXT||St.controlComponent===s.ControlComponent.POSTTEXTFIX||St.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))if(p?.getElement()?.control?.type===s.ControlType.TEXT&&p.getElement()?.controlId===St.controlId&&(p.getElement()?.originControlId||null)===(St.originControlId||null))Ct=l.setValue(Lt),l.emitControlContentChange();else{const $=Rn(a,St.originControlId,i.getMode());if(!$){Ct=Tt(tt);return}let ne;for(let Te=T;Te>=0;Te--){const Bt=a[Te];if(je(Bt,$)&&Bt.control?.type){ne=Bt.control.type;break}if(Bt.controlId&&Bt.controlId!==$&&Bt.originControlId!==$)break}if(ne===s.ControlType.TEXT||i.getMode()===s.EditorMode.EDIT&&ne===s.ControlType.TEXTFIELD){const Te=()=>{for(let Me=T+1;Me<a.length;Me++){const we=a[Me];if(je(we,$))return Me;if(we.controlId&&we.controlId!==$&&we.originControlId!==$)break}for(let Me=T;Me>=0;Me--){const we=a[Me];if(je(we,$))return Me;if(we.controlId&&we.controlId!==$&&we.originControlId!==$)break}return T},Bt=Kt?.controlId===$&&Kt?.controlComponent===s.ControlComponent.VALUE?T+1:-1,te=Bt!==-1?{startIndex:T,endIndex:Bt}:{startIndex:T,endIndex:T},oo=Te();C(oo,oo),f();const mn=l.getActiveControl();C(te.startIndex,te.endIndex),mn&&mn.getElement()?.controlId===$&&(mn.getElement()?.control?.type===s.ControlType.TEXT||mn.getElement()?.control?.type===s.ControlType.TEXTFIELD)?(Lt.forEach(Me=>{Ji(Me,$,mn.getElement().control,r.defaultColor)}),Ct=mn.setValue(Lt,{range:te,elementList:M}),l.emitControlContentChange(),C(Ct,Ct),f()):Ct=Tt(tt)}else Ct=Tt(tt)}else if((St?.control?.type===s.ControlType.SELECT||Kt?.control?.type===s.ControlType.SELECT)&&p?.getElement()?.control?.type===s.ControlType.SELECT&&l.getIsRangeWithinControl()){const et=l.getActiveControl();et&&typeof et.awake=="function"&&et.awake(),Ct=Z}else if(p?.getElement()?.control?.type===s.ControlType.DATE&&l.getIsRangeWithinControl()){const et=l.getActiveControl();et&&typeof et.awake=="function"&&et.awake(),Ct=Z}else!_t&&(St?.control?.type===s.ControlType.BUTTON||Kt?.control?.type===s.ControlType.BUTTON)?p?.getElement()?.control?.type===s.ControlType.BUTTON&&p.getElement()?.control?.editable!==!1&&l.getIsRangeWithinControl()?(Ct=l.setValue(Lt),l.emitControlContentChange()):Ct=Z:p&&l.getIsRangeWithinControl()?(Ct=l.setValue(Lt),l.emitControlContentChange()):(St?.type==="control"||Kt?.type==="control")&&!_t?Ct=Tt(tt):(le(M,Lt,Z,{editorOptions:r}),i.spliceElementList(M,tt,0,Lt),Ct=Z+Lt.length)}if(~Ct&&!u){const Tt=re()-n,tt=re();g(()=>{h.setRange(Ct,Ct);const Dt=i.getElementList()[Ct],vt=Dt?.controlComponent===s.ControlComponent.VALUE&&(Dt.control?.type===s.ControlType.TEXT||Dt.control?.type===s.ControlType.TEXTFIELD),jt={curIndex:Ct,isSubmitHistory:!u,traceLabel:`input:${e}`};vt?i.requestRender(jt):i.render(jt)}),Mi(r,`input:${e}`,re()-n,[{label:"mutate",duration:Tt},{label:"renderSchedule",duration:re()-tt}],{isComposing:u,textLength:Lt.length,compositionChainDuration:e==="compositionend"&&b!==void 0?Number((re()-b).toFixed(2)):void 0})}u&&(t.compositionInfo={value:F,startIndex:Ct,endIndex:Q,defaultStyle:Y,perfStartTime:n})}function ud(o){o.compositionInfo&&(o.compositionInfo=null)}function hd(o,t){if(!o.compositionInfo||o.isComposing)return t;const{startIndex:e,endIndex:n}=o.compositionInfo;return e!==n&&(o.getDraw().removeSplitTdOtherRangeElements(),o.getDraw().spliceElementList(t,e+1,n-e),o.getDraw().getRange().setRange(e,e)),o.compositionInfo=null,t}async function Rd(o){const t=o.getDraw(),e=t.getRange(),{startIndex:n,endIndex:i}=e.getRange();if(!~n&&!~n||t.isReadonly()||!e.getIsCanInput())return;const l=t.getElementList();let r=n,a=i;if(n===i){const R=t.getPosition().getPositionList(),T=R[n],g=T.rowNo,f=T.pageNo,C=[];for(let I=0;I<R.length;I++){const m=R[I];if(m.pageNo>f)break;m.pageNo===f&&m.rowNo===g&&C.push(I)}const p=C[0]-1;r=p<0?0:p,a=C[C.length-1]}const c=t.getOptions();await Ir(l.slice(r+1,a+1),c);const d=t.getControl();let u;d.getActiveControl()&&d.getIsRangeWithinControl()?(u=d.cut(),d.emitControlContentChange()):(t.spliceElementList(l,r+1,a-r),u=r),e.setRange(u,u),t.render({curIndex:u})}function gd(o){return o.replace(/^(?:\r\n|\r|\n)+|(?:\r\n|\r|\n)+$/g,"")}async function Td(o,t){const e=o.getDraw(),n=e.getMode()===s.EditorMode.COMPARE,i=n||t?.isPlainText,{copy:l}=e.getOverride();if(l&&l()?.preventDefault!==!1)return;const r=e.getRange();let a=null;if(r.getRange().isCrossRowCol){const d=r.getRangeTableElement();if(!d)return;const u=e.getTableParticle().getRangeRowCol();if(!u)return;const h={type:s.ElementType.TABLE,value:"",colgroup:[],trList:[]},R=u[0],T=R[0].colIndex,g=R[R.length-1],f=g.colIndex+g.colspan-1;for(let C=T;C<=f;C++)h.colgroup.push(d.colgroup[C]);for(let C=0;C<u.length;C++){const p=u[C],I=d.trList[p[0].rowIndex],m={tdList:[],height:I.height,minHeight:I.minHeight};for(let L=0;L<p.length;L++)m.tdList.push(p[L]);h.trList.push(m)}a=n?[h]:Ut([h])}else a=r.getIsCollapsed()?r.getRangeRowElementList():r.getSelectionElementList();if(i&&a?.length){const d=Pn(a,e.getOptions());await wc(n?gd(d):d);return}a?.length&&await Ir(a,e.getOptions())}function fd(o,t){const e=t.getDraw(),{drop:n}=e.getOverride();if(n&&n(o)?.preventDefault!==!1)return;o.preventDefault();const i=o.dataTransfer?.getData("text");if(i)t.input(i);else{const l=o.dataTransfer?.files;if(!l)return;for(let r=0;r<l.length;r++){const a=l[r];a.type.startsWith("image")&&Ki(t,a)}}}function yr(o){if(!Intl.Segmenter)return null;const t=o.getDraw(),e=t.getPosition().getCursorPosition();if(!e)return null;const i=t.getRange().getRangeParagraphInfo();if(!i)return null;const l=i?.elementList?.map(R=>!R.type||R.type!==s.ElementType.CONTROL&&Le.includes(R.type)?R.value:_).join("")||"";if(!l)return null;const r=e.isFirstLetter||t.getCursor().getHitLineStartIndex()?e.index+1:e.index,a=i.startIndex,d=new Intl.Segmenter(void 0,{granularity:"word"}).segment(l);let u=-1,h=-1;for(const{segment:R,index:T,isWordLike:g}of d){const f=T+a;if(g&&r>=f&&r<f+R.length){u=f-1,h=u+R.length;break}}return~u&&~h?{startIndex:u,endIndex:h}:null}function md(o){const t=o.getDraw(),e=t.getPosition().getCursorPosition();if(!e)return null;const{value:n,index:i}=e,l=t.getLetterReg();let r=0,a=0;const c=fi.test(n);if(c||l.test(n)){const u=t.getElementList();let h=i-1;for(;h>0;){const T=u[h].value;if(c&&fi.test(T)||!c&&l.test(T))r++,h--;else break}let R=i+1;for(;R<u.length;){const T=u[R].value;if(c&&fi.test(T)||!c&&l.test(T))a++,R++;else break}}const d=i-r-1;return d<0?null:{startIndex:d,endIndex:i+a}}function Cd(o,t){const e=o.getDraw();if(!t.isDirectHit)return!1;let n,i;if(t.isTable){const r=e.getOriginalElementList()[t.index]?.trList?.[t.trIndex]?.tdList[t.tdIndex];n=r?.value[t.tdValueIndex],i=r?.positionList?.[t.tdValueIndex]}else n=e.getOriginalElementList()[t.index],i=e.getPosition().getOriginalPositionList()[t.index];return!n||!i?!1:(e.getMenstrualHistoryParticle().clearMenstrualHistoryEditor(),e.getFetalHeartPositionParticle().clearFetalHeartPositionEditor(),e.getToothPositionParticle().clearToothPositionEditor(),n.type===s.ElementType.MENSTRUAL_HISTORY?(e.getMenstrualHistoryParticle().renderMenstrualHistoryEditor(n,i),!0):n.type===s.ElementType.FETAL_HEART_POSITION?(e.getFetalHeartPositionParticle().renderFetalHeartPositionEditor(n,i),!0):n.type===s.ElementType.TOOTH_POSITION?(e.getToothPositionParticle().renderToothPositionEditor(n,i),!0):!1)}function pd(o,t){const e=o.getDraw(),n=e.getPosition(),i=n.getPositionByXY({x:t.offsetX,y:t.offsetY});if((e.getMode()===s.EditorMode.EDIT||e.getMode()===s.EditorMode.FORM)&&Cd(o,i))return;if(e.getMode()===s.EditorMode.FORM){const c=i.isTable&&e.getTd()?.value||e.getElementList(),d=i.isTable?i.tdValueIndex:i.index,u=c[d],h=Id(c,u),R=e.getEventBus();if(i.isDirectHit&&h?.controlId&&h.control?.type===s.ControlType.BUTTON&&!h.control.buttonText&&R.isSubscribe("buttonChange")){const T=c.filter(g=>g.controlId===h.controlId&&(g.originControlId||null)===(h.originControlId||null));R.emit("buttonChange",{evt:t,element:rt(h),elementList:rt(T),controlId:h.controlId,control:rt(h.control)});return}}if(i.isImage&&i.isDirectHit){const c=e.getElementList(),d=e.getEventBus(),u=c[i.index];if(d.isSubscribe("imageDblclick")&&d.emit("imageDblclick",{evt:t,element:u}),u.imgPreviewDisabled)return;e.getPreviewer().render();return}if(e.getIsPagingMode()&&e.getMode()===s.EditorMode.EDIT&&!~i.index&&i.zone){e.getZone().setZone(i.zone),e.clearSideEffect(),n.setPositionContext({isTable:!1});return}if((i.isCheckbox||i.isRadio)&&i.isDirectHit)return;const r=e.getRange(),a=yr(o)||md(o);a&&(r.setRange(a.startIndex,a.endIndex),e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),r.setRangeStyle())}function Id(o,t){if(!t?.controlId)return null;const e=t.originControlId||null,n=l=>!!(l&&l.controlId===t.controlId&&(l.originControlId||null)===e);if(t.control?.type===s.ControlType.BUTTON)return t;const i=o.indexOf(t);for(let l=i;l>=0;l--){const r=o[l];if(!n(r))break;if(r.control?.type===s.ControlType.BUTTON)return r}for(let l=i+1;l<o.length;l++){const r=o[l];if(!n(r))break;if(r.control?.type===s.ControlType.BUTTON)return r}return null}function Ed(o){const t=o.getDraw(),e=t.getControl();if(e.getActiveControl()&&e.selectValue())return;const i=t.getPosition().getCursorPosition();if(!i)return;const{index:l}=i,r=t.getElementList();let a=0,c=0,d=l-1;for(;d>0;){const g=r[d],f=r[d-1];if(g.value===_&&!g.listWrap||g.listId!==f?.listId||g.titleId!==f?.titleId)break;a++,d--}let u=l+1;for(;u<r.length;){const g=r[u],f=r[u+1];if(g.value===_&&!g.listWrap||g.listId!==f?.listId||g.titleId!==f?.titleId)break;c++,u++}const h=t.getRange();let R=l-a-1;if(r[R]?.value!==_&&(R-=1),R<0)return;let T=l+c+1;(r[T]?.value===_||T>r.length-1)&&(T-=1),h.setRange(R,T),t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}const Nr={dblclick:pd,threeClick:Ed};function Ld(o){o.isComposing=!0,o.getDraw().getMacroParticle().compositionStart()}function Pd(o,t){const e=re();o.isComposing=!1;const n=o.getDraw(),i=n.getOptions();if(n.getMacroParticle().compositionEnd(t.data)){n.getCursor().clearAgentDomValue();return}if(t.data)o.compositionInfo&&(o.compositionInfo.perfStartTime=e),Na?setTimeout(()=>{o.compositionInfo&&$i(t.data,o,"compositionend")},1):o.compositionInfo&&$i(t.data,o,"compositionend");else{const a=o.compositionInfo?.cancel;if(ud(o),!a){const c=n.getRange(),{endIndex:d}=c.getRange();n.render({curIndex:d,isSubmitHistory:!1,traceLabel:"compositionend:empty"})}}n.getCursor().clearAgentDomValue(),Mi(i,"compositionend",re()-e,[],{hasData:!!t.data,dataLength:t.data?.length||0})}function Md(o){o.compositionInfo&&(o.compositionInfo.cancel=!0)}const zi={compositionstart:Ld,compositionend:Pd,compositionCancel:Md};function Od(o,t){const e=t.getDraw();if(e.isReadonly())return;o.preventDefault();const i=e.getPageContainer();if(!Hs(o.target,m=>m===i))return;const a=o.target.dataset.index;a&&e.setPageNo(Number(a));const c=e.getPosition(),d=c.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!d)return;const{isTable:u,tdValueIndex:h,index:R}=d,T=c.getPositionList(),g=u?h:R;~R&&(e.getRange().setRange(g,g),c.setCursorPosition(T[g]));const f=e.getCursor(),{cursor:{dragColor:C,dragWidth:p,dragFloatImageDisabled:I}}=e.getOptions();if(I){const m=t.cacheElementList?.[t.cacheRange.startIndex];if(m?.type===s.ElementType.IMAGE&&(m.imgDisplay===s.ImageDisplay.FLOAT_TOP||m.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM||m.imgDisplay===s.ImageDisplay.SURROUND))return}f.drawCursor({width:p,color:C,isBlink:!1,isFocus:!1})}const Sd={dragover:Od};class Dd{isAllowSelection;isComposing;compositionInfo;isAllowDrag;isAllowDrop;cacheRange;cacheElementList;cachePositionList;cachePositionContext;mouseDownStartPosition;draw;pageContainer;pageList;range;position;constructor(t){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)),pa(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;let n=this.range.getSelection();if(!n){const r=yr(this);r&&(n=this.draw.getElementList().slice(r.startIndex+1,r.endIndex+1))}if(!n)return;const i=Object.keys(t);n.forEach(r=>{i.forEach(a=>{const c=a;Reflect.set(r,c,t[c])})}),this.draw.render({isSetCursor:!1});const l=this.draw.getPainterOptions();(!l||!l.isDblclick)&&this.clearPainterStyle()}selectAll(){if(!this.draw.isSelectionDisabled())if(this.position.getPositionContext().isTable)this.draw.getTableOperate().tableSelectAll();else{const t=this.position.getPositionList();this.range.setRange(0,t.length-1),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}}mousemove(t){this.draw.isInteractionSuspended()||kc(t,this)}mousedown(t){this.draw.isInteractionSuspended()||(this.draw.flushPendingRender(),Ac(t,this))}click(){this.draw.isInteractionSuspended()||Xa&&!this.draw.isReadonly()&&this.draw.getCursor().getAgentDom().focus()}mouseup(t){this.draw.isInteractionSuspended()||_c(t,this)}mouseleave(t){this.draw.isInteractionSuspended()||Bc(t,this)}keydown(t){if(this.draw.isInteractionSuspended())return;t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey||this.draw.flushPendingRender(),rd(t,this)}dblclick(t){this.draw.isInteractionSuspended()||Nr.dblclick(this,t)}threeClick(){this.draw.isInteractionSuspended()||Nr.threeClick(this)}input(t,e="input"){this.draw.isInteractionSuspended()||$i(t,this,e)}async cut(){this.draw.isInteractionSuspended()||await Rd(this)}async copy(t){this.draw.isInteractionSuspended()||await Td(this,t)}compositionstart(){this.draw.isInteractionSuspended()||(this.draw.flushPendingRender(),zi.compositionstart(this))}compositionend(t){this.draw.isInteractionSuspended()||zi.compositionend(this,t)}compositionCancel(){this.draw.isInteractionSuspended()||zi.compositionCancel(this)}drop(t){this.draw.isInteractionSuspended()||fd(t,this)}dragover(t){this.draw.isInteractionSuspended()||Sd.dragover(t,this)}}const br={PAGE_SCALE:"pageScale"};class Fd{draw;options;cursor;canvasEvent;range;previewer;tableTool;hyperlinkParticle;control;dateParticle;imageParticle;dprMediaQueryList;constructor(t,e){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("mousedown",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("mousedown",this.clearSideEffect),document.removeEventListener("mouseup",this.setCanvasEventAbility),document.removeEventListener("wheel",this.setPageScale),document.removeEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.removeEventListener("change",this._handleDprChange)}clearSideEffect=t=>{if(!this.cursor)return;if(this.draw.isInteractionSuspended()){this.resetSideEffect();return}const e=t?.composedPath?.()[0]||t.target;if(this.draw.isTargetInsideEditor(e)){this.watchCursorActive();return}this.resetSideEffect()};resetSideEffect=()=>{this.cursor&&(this.cursor.recoveryCursor(),this.range.recoveryRangeStyle(),this.previewer.clearResizer(),this.tableTool.dispose(),this.hyperlinkParticle.clearHyperlinkPopup(),this.control.destroyControl(),this.dateParticle.clearDatePicker(),this.imageParticle.destroyFloatImage())};setCanvasEventAbility=()=>{this.canvasEvent.setIsAllowDrag(!1),this.canvasEvent.setIsAllowSelection(!1)};watchCursorActive(){this.range.getIsCollapsed()&&setTimeout(()=>{this.cursor?.getAgentIsActive()||this.cursor?.drawCursor({isFocus:!1,isBlink:!1})})}setPageScale=t=>{if(this.draw.isInteractionSuspended()||!this.draw.isTargetInsideEditor(t.target)||this.options.shortcutDisableKeys.includes(br.PAGE_SCALE)||!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)}};_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})}};_handleDprChange=()=>{this.draw.setPageDevicePixel()}}class Xd{undoStack=[];redoStack=[];maxRecordCount;constructor(t){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 yd{cursorPosition;positionContext;positionList;floatPositionList;draw;eventBus;options;constructor(t){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:l,startY:r,startRowIndex:a,startIndex:c,innerWidth:d,zone:u}=t,{scale:h,table:{tdPadding:R}}=this.options;let T=l,g=r,f=c;for(let C=0;C<n.length;C++){const p=n[C];if(!p.isSurround){const O=p.width+(p.offsetX||0);p.rowFlex===s.RowFlex.CENTER?T+=(d-O)/2:p.rowFlex===s.RowFlex.RIGHT&&(T+=d-O)}T+=p.offsetX||0,g+=p.offsetY||0;const I=T,m=g,L=p.elementList.some(O=>!ae(O)&&O.type===s.ElementType.IMAGE&&O.controlComponent===s.ControlComponent.VALUE&&(O.control?.type===s.ControlType.TEXT||O.control?.type===s.ControlType.TEXTFIELD)&&O.imgDisplay!==s.ImageDisplay.SURROUND&&O.imgDisplay!==s.ImageDisplay.FLOAT_TOP&&O.imgDisplay!==s.ImageDisplay.FLOAT_BOTTOM);for(let O=0;O<p.elementList.length;O++){const P=p.elementList[O],S=P.metrics;let y=!ae(P)&&(P.imgDisplay!==s.ImageDisplay.INLINE&&P.type===s.ElementType.IMAGE||P.type===s.ElementType.LATEX)?p.ascent-S.height:p.ascent;const Y=P.vertical||(L?s.VerticalAlign.MIDDLE:void 0);if(Y&&!ae(P)){const M=P.type===s.ElementType.IMAGE||P.type===s.ElementType.LATEX,V=M?0:S.boundingBoxAscent,N=M?Math.max(S.height,S.boundingBoxAscent+S.boundingBoxDescent):S.boundingBoxAscent+S.boundingBoxDescent;Y===s.VerticalAlign.TOP?y=V:Y===s.VerticalAlign.MIDDLE?y=(p.height-N)/2+V:Y===s.VerticalAlign.BOTTOM&&(y=p.height-N+V)}P.left&&(T+=P.left),P.translateX&&(T+=P.translateX*h);const b={pageNo:i,index:f,value:P.value,rowIndex:a+C,rowNo:C,metrics:S,left:P.left||0,ascent:y,lineHeight:p.height,isFirstLetter:O===0,isLastLetter:O===p.elementList.length-1,coordinate:{leftTop:[T,g],leftBottom:[T,g+p.height],rightTop:[T+S.width,g],rightBottom:[T+S.width,g+p.height]}};if(P.imgDisplay===s.ImageDisplay.SURROUND||P.imgDisplay===s.ImageDisplay.FLOAT_TOP||P.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM){const M=e[e.length-1];M&&(b.metrics=M.metrics,b.coordinate=M.coordinate),P.imgFloatPosition||(P.imgFloatPosition={x:T,y:g,pageNo:i}),this.floatPositionList.push({pageNo:i,element:P,position:b,isTable:t.isTable,index:t.index,tdIndex:t.tdIndex,trIndex:t.trIndex,tdValueIndex:f,zone:u})}if(e.push(b),f++,T+=S.width,P.type===s.ElementType.TABLE&&!ae(P)){const M=P.tdPadding||R,V=M[1]+M[3],N=M[0]+M[2];for(let X=0;X<P.trList.length;X++){const D=P.trList[X];for(let E=0;E<D.tdList.length;E++){const U=D.tdList[E];U.positionList=[];const F=U.rowList,Z=this.computePageRowPosition({positionList:U.positionList,rowList:F,pageNo:i,startRowIndex:0,startIndex:0,startX:(U.x+M[3])*h+I+(P.translateX||0)*h,startY:(U.y+M[0])*h+m,innerWidth:(U.width-V)*h,isTable:!0,index:f-1,tdIndex:E,trIndex:X,zone:u});if(U.verticalAlign===s.VerticalAlign.MIDDLE||U.verticalAlign===s.VerticalAlign.BOTTOM){const Q=F.reduce((k,B)=>k+B.height,0),W=(U.height-N)*h-Q,K=U.verticalAlign===s.VerticalAlign.MIDDLE?W/2:W;Math.floor(K)>0&&U.positionList.forEach(k=>{const{coordinate:{leftTop:B,leftBottom:H,rightBottom:A,rightTop:v}}=k;B[1]+=K,H[1]+=K,A[1]+=K,v[1]+=K})}T=Z.x,g=Z.y}}T=I,g=m}}T=l,g+=p.height}return{x:T,y:g,index:f}}computePositionList(){this.positionList=[];const t=this.draw.getInnerWidth(),e=this.draw.getPageRowList(),n=this.draw.getMargins(),i=n[3],r=this.draw.getHeader().getExtraHeight(),a=n[0]+r;let c=0;for(let d=0;d<e.length;d++){const u=e[d];if(!u?.length)continue;const h=u[0].startIndex;this.computePageRowPosition({positionList:this.positionList,rowList:u,pageNo:d,startRowIndex:c,startIndex:h,startX:i,startY:a,innerWidth:t}),c+=u.length}}computeRowPosition(t){const{row:e,innerWidth:n}=t,i=[];return this.computePageRowPosition({positionList:i,innerWidth:n,rowList:[rt(e)],pageNo:0,startX:0,startY:0,startIndex:0,startRowIndex:0}),i}setCursorPosition(t){this.cursorPosition=t}getCursorPosition(){return this.cursorPosition}getPositionContext(){return this.positionContext}setPositionContext(t){this.eventBus.emit("positionContextChange",{value:t,oldValue:this.positionContext}),this.positionContext=t}getPositionByXY(t){const{x:e,y:n,isTable:i}=t;let{elementList:l,positionList:r}=t;l||(l=this.draw.getOriginalElementList()),r||(r=this.getOriginalPositionList());const a=this.draw.getZone(),c=t.pageNo??this.draw.getPageNo(),d=a.isMainActive(),u=d?c:0;if(!i){const f=this.getFloatPositionByXY({...t,imgDisplays:[s.ImageDisplay.FLOAT_TOP,s.ImageDisplay.SURROUND]});if(f)return f}for(let f=0;f<r.length;f++){const{index:C,pageNo:p,left:I,isFirstLetter:m,coordinate:{leftTop:L,rightTop:O,leftBottom:P}}=r[f];if(u!==p)continue;if(p>u)break;const S=l[C];if(!(ae(S)&&!this.draw.isDesignMode())&&L[0]-I<=e&&O[0]>=e&&L[1]<=n&&P[1]>=n){let y=f;if(S?.controlId&&I>0&&e<L[0]){const b=S.controlComponent===s.ControlComponent.POSTFIX||S.controlComponent===s.ControlComponent.POST_TEXT||S.controlComponent===s.ControlComponent.POSTTEXTFIX||S.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT,M=f>0?l[r[f-1].index]:void 0,V=M?.controlId===S.controlId&&(M.originControlId||null)===(S.originControlId||null);return{index:b&&V?r[f-1].index:C,isControl:!0}}if(S.type===s.ElementType.TABLE)for(let b=0;b<S.trList.length;b++){const M=S.trList[b];for(let V=0;V<M.tdList.length;V++){const N=M.tdList[V],X=this.getPositionByXY({x:e,y:n,td:N,pageNo:c,tablePosition:r[f],isTable:!0,elementList:N.value,positionList:N.positionList});if(~X.index){const{index:D,hitLineStartIndex:E}=X,U=N.value[D];return{index:C,isCheckbox:X.isCheckbox||U.type===s.ElementType.CHECKBOX||U.controlComponent===s.ControlComponent.CHECKBOX,isRadio:U.type===s.ElementType.RADIO||U.controlComponent===s.ControlComponent.RADIO,isControl:!!U.controlId,isImage:X.isImage,isLabel:X.isLabel,isMacro:X.isMacro,isDirectHit:X.isDirectHit,isTable:!0,tdIndex:V,trIndex:b,tdValueIndex:D,tdId:N.id,trId:M.id,tableId:S.id,hitLineStartIndex:E}}}}if(S.type===s.ElementType.IMAGE||S.type===s.ElementType.LATEX)return{index:y,isDirectHit:!0,isImage:!0};if(S.type===s.ElementType.MENSTRUAL_HISTORY)return{index:y,isDirectHit:!0};if(S.type===s.ElementType.FETAL_HEART_POSITION)return{index:y,isDirectHit:!0};if(S.type===s.ElementType.TOOTH_POSITION){const{scale:b}=this.options,M=S.width*b;return e>=L[0]&&e<=L[0]+M?{index:y,isDirectHit:!0}:{index:y}}if(S.type===s.ElementType.CHECKBOX||S.controlComponent===s.ControlComponent.CHECKBOX)return{index:y,isDirectHit:!0,isCheckbox:!0};if(S.type===s.ElementType.LABEL)return{index:y,isDirectHit:!0,isLabel:!0};if(S.type===s.ElementType.MACRO||S.type===s.ElementType.CUSTOM_MACRO||S.type===s.ElementType.REUSABLE_ITEM||S.type===s.ElementType.SUB_TEMPLATE)return{index:y,isDirectHit:!0,isMacro:!0};if(S.type===s.ElementType.TAB&&S.listStyle===s.ListStyle.CHECKBOX){let b=y-1;for(;b>0;){const M=l[b];if(M.value===_&&M.listStyle===s.ListStyle.CHECKBOX)break;b--}return{index:b,isDirectHit:!0,isCheckbox:!0}}if(S.type===s.ElementType.RADIO||S.controlComponent===s.ControlComponent.RADIO)return{index:y,isDirectHit:!0,isRadio:!0};let Y;if(l[C].value!==_){const b=O[0]-L[0];e<L[0]+b/2&&(y=f-1,m&&(Y=f))}return{isDirectHit:!0,hitLineStartIndex:Y,index:y,isControl:!!S.controlId}}}if(!i){const f=this.getFloatPositionByXY({...t,imgDisplays:[s.ImageDisplay.FLOAT_BOTTOM]});if(f)return f}let h=!1,R=-1,T;if(i){const{scale:f}=this.options,{td:C,tablePosition:p}=t;if(C&&p){const{leftTop:I}=p.coordinate,m=C.x*f+I[0],L=C.y*f+I[1],O=C.width*f,P=C.height*f;if(!(m<e&&e<m+O&&L<n&&n<L+P))return{index:R}}}const g=r.filter(f=>f.isLastLetter&&f.pageNo===u);for(let f=0;f<g.length;f++){const{index:C,rowNo:p,coordinate:{leftTop:I,leftBottom:m}}=g[f];if(n>I[1]&&n<=m[1]){const L=r.findIndex(y=>y.pageNo===u&&y.rowNo===p),O=l[L],P=r[L],S=O.listStyle===s.ListStyle.CHECKBOX?this.draw.getMargins()[3]:P.coordinate.leftTop[0];if(e<S)~L?P.value===_?R=L:(R=L-1,T=L):R=C;else{if(O.listStyle===s.ListStyle.CHECKBOX&&e<I[0])return{index:L,isDirectHit:!0,isCheckbox:!0};R=C}h=!0;break}}if(!h){if(this.draw.getIsPagingMode()){const C=this.draw.getHeader(),p=C.getHeight(),I=C.getHeaderTop()+p,m=this.draw.getFooter(),O=this.draw.getHeight()-(m.getFooterBottom()+m.getHeight());if(d){if(n<I)return{index:-1,zone:s.EditorZone.HEADER};if(n>O)return{index:-1,zone:s.EditorZone.FOOTER}}else if(n<=O&&n>=I)return{index:-1,zone:s.EditorZone.MAIN}}const f=this.draw.getMargins();if(n<=f[0])for(let C=0;C<r.length;C++){const p=r[C];if(p.pageNo!==u||p.rowNo!==0)continue;const{leftTop:I,rightTop:m}=p.coordinate;if(e<=f[3]||e>=I[0]&&e<=m[0]||r[C+1]?.rowNo!==0)return{index:p.index}}else{const C=g[g.length-1];if(C){const p=C.rowNo;for(let I=0;I<r.length;I++){const m=r[I];if(m.pageNo!==u||m.rowNo!==p)continue;const{leftTop:L,rightTop:O}=m.coordinate;if(e<=f[3]||e>=L[0]&&e<=O[0]||r[I+1]?.rowNo!==p)return{index:m.index}}}}return{index:g[g.length-1]?.index||r.length-1}}return{hitLineStartIndex:T,index:R,isControl:!!l[R]?.controlId}}getFloatPositionByXY(t){const{x:e,y:n}=t,i=t.pageNo??this.draw.getPageNo(),l=this.draw.getZone().getZone(),{scale:r}=this.options;for(let a=0;a<this.floatPositionList.length;a++){const{position:c,element:d,isTable:u,index:h,trIndex:R,tdIndex:T,tdValueIndex:g,zone:f,pageNo:C}=this.floatPositionList[a];if(i===C&&d.type===s.ElementType.IMAGE&&d.imgDisplay&&t.imgDisplays.includes(d.imgDisplay)&&(!f||f===l)){const p=d.imgFloatPosition,I=p.x*r,m=p.y*r,L=d.width*r,O=d.height*r;if(e>=I&&e<=I+L&&n>=m&&n<=m+O)return u?{index:h,isDirectHit:!0,isImage:!0,isTable:u,trIndex:R,tdIndex:T,tdValueIndex:g,tdId:d.tdId,trId:d.trId,tableId:d.tableId}:{index:c.index,isDirectHit:!0,isImage:!0}}}}adjustPositionContext(t){const e=this.getPositionByXY(t);if(!~e.index)return null;if(e.isControl&&this.draw.getMode()!==s.EditorMode.READONLY){const{index:C,isTable:p,trIndex:I,tdIndex:m,tdValueIndex:L}=e,O=this.draw.getControl(),{newIndex:P}=O.moveCursor({index:C,isTable:p,trIndex:I,tdIndex:m,tdValueIndex:L});p?e.tdValueIndex=P:e.index=P}const{index:n,isCheckbox:i,isRadio:l,isControl:r,isImage:a,isLabel:c,isDirectHit:d,isTable:u,trIndex:h,tdIndex:R,tdId:T,trId:g,tableId:f}=e;return this.setPositionContext({isTable:u||!1,isCheckbox:i||!1,isRadio:l||!1,isControl:r||!1,isImage:a||!1,isLabel:c||!1,isDirectHit:d||!1,index:n,trIndex:h,tdIndex:R,tdId:T,trId:g,tableId:f}),e}setSurroundPosition(t){const{scale:e}=this.options,{pageNo:n,row:i,rowElement:l,rowElementRect:r,surroundElementList:a,availableWidth:c}=t;let d=r.x,u=0;if(a.length&&!An(l)&&!l.control?.minWidth)for(let h=0;h<a.length;h++){const R=a[h],T=R.imgFloatPosition;if(T.pageNo!==n)continue;const g={...T,x:T.x*e,y:T.y*e,width:R.width*e,height:R.height*e};if(Sa(r,g)){i.isSurround=!0;const f=g.width+g.x-r.x;if(l.left=f,i.width+=f,u+=f,d=g.x+g.width,i.width+l.metrics.width>c){l.left=0,i.width-=u;break}}}return{x:d,rowIncreaseWidth:u}}}class Nd{draw;options;range;listener;eventBus;position;historyManager;defaultStyle;lastRangeStyle;constructor(t){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},this.defaultStyle=null,this.lastRangeStyle=null}_isSameRangeStyle(t,e){if(!t||!["type","undo","redo","painter","font","size","bold","italic","underline","strikeout","deletePerson","color","highlight","rowFlex","vertical","rowMargin","level","listType","listStyle","textDecoration","extension"].every(c=>t[c]===e[c])||!(t.dashArray.length===e.dashArray.length&&t.dashArray.every((c,d)=>c===e.dashArray[d])))return!1;const r=t.groupIds||[],a=e.groupIds||[];return r.length===a.length&&r.every((c,d)=>c===a[d])}_emitRangeStyle(t){this._isSameRangeStyle(this.lastRangeStyle,t)||(this.lastRangeStyle={...t,dashArray:[...t.dashArray],groupIds:t.groupIds?[...t.groupIds]:null},this.listener.rangeStyleChange?.(t),this.eventBus.isSubscribe("rangeStyleChange")&&this.eventBus.emit("rangeStyleChange",t))}getRange(){return this.range}clearRange(){this.setRange(-1,-1)}setDefaultStyle(t){t?this.defaultStyle={...this.defaultStyle,...t}:this.defaultStyle=null}getDefaultStyle(){return this.defaultStyle}getRangeAnchorStyle(t,e){const n=Qn(t,e);return n?{...n,...this.defaultStyle}:null}getIsRangeChange(t,e,n,i,l,r,a){return this.range.startIndex!==t||this.range.endIndex!==e||this.range.tableId!==n||this.range.startTdIndex!==i||this.range.endTdIndex!==l||this.range.startTrIndex!==r||this.range.endTrIndex!==a}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,splitTdRange:n}=this.range;if(t===e)return null;if(n)return this.draw.getSplitTdValues(n.originalId).slice(n.startIndex+1,n.endIndex+1);const i=this.draw.getElementList();return i.slice(i[t]?.value===_?t: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<t.length;n++){const i=t[n];for(let l=0;l<i.length;l++){const r=i[l];e.push(...r.value)}}return e}return this.getSelection()}getTextLikeSelection(){const t=this.getSelection();return t?t.filter(e=>!e.type||Le.includes(e.type)):null}getTextLikeSelectionElementList(){const t=this.getSelectionElementList();return t?t.filter(e=>!e.type||Le.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 l=t;l<e+1;l++){const{pageNo:r,rowNo:a}=n[l],c=i.get(r);c?c.has(a)||c.add(a):i.set(r,new Set([a]))}return i}getRangeRowElementList(){const{startIndex:t,endIndex:e,isCrossRowCol:n}=this.range;if(!~t&&!~e)return null;if(n)return this.getSelectionElementList();const i=this.getRangeRow();if(!i)return null;const l=this.position.getPositionList(),r=this.draw.getElementList(),a=[];for(let c=0;c<l.length;c++){const d=l[c],u=i.get(d.pageNo);u&&u.has(d.rowNo)&&a.push(r[c])}return a}getRangeParagraph(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;const n=this.position.getPositionList(),i=this.draw.getElementList(),l=new Map;let r=t;for(;r>=0;){const{pageNo:d,rowNo:u}=n[r];let h=l.get(d);h||(h=[],l.set(d,h)),h.includes(u)||h.unshift(u);const R=i[r],T=i[r-1];if(R.value===_&&!R.listWrap||R.listId!==T?.listId||R.titleId!==T?.titleId)break;r--}const a=t===e;if(!a){let d=t+1;for(;d<e;){const{pageNo:u,rowNo:h}=n[d];let R=l.get(u);R||(R=[],l.set(u,R)),R.includes(h)||R.push(h),d++}}let c=e;for(a&&i[t].value===_&&(c+=1);c<n.length;){const d=i[c],u=i[c+1];if(d.value===_&&!d.listWrap||d.listId!==u?.listId||d.titleId!==u?.titleId)break;const{pageNo:h,rowNo:R}=n[c];let T=l.get(h);T||(T=[],l.set(h,T)),T.includes(R)||T.push(R),c++}return l}getRangeParagraphInfo(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;let n=-1;const i=[],l=this.getRangeParagraph();if(!l)return null;const r=this.draw.getElementList(),a=this.position.getPositionList();for(let c=0;c<a.length;c++){const d=a[c],u=l.get(d.pageNo);u&&u.includes(d.rowNo)&&(~n||(n=d.index),i.push(r[c]))}return i.length?{elementList:i,startIndex:n}:null}getRangeParagraphElementList(){return this.getRangeParagraphInfo()?.elementList||null}getRangeTableElement(){const t=this.position.getPositionContext();return t.isTable?this.draw.getOriginalElementList()[t.index]:null}getIsSelectAll(){const t=this.draw.getElementList(),{startIndex:e,endIndex:n}=this.range;return e===0&&t.length-1===n&&!this.position.getPositionContext().isTable}getIsPointInRange(t,e,n){const{startIndex:i,endIndex:l}=this.range,r=this.position.getPositionList();for(let a=i+1;a<=l&&r[a];a++){const{coordinate:{leftTop:d,rightBottom:u},pageNo:h}=r[a];if(n===h&&t>=d[0]&&t<=u[0]&&e>=d[1]&&e<=u[1])return!0}return!1}getKeywordRangeList(t){const e=this.draw.getSearch().getMatchList(t,this.draw.getOriginalElementList()),n=new Map;for(const l of e){const r=n.get(l.groupId);if(r)r.endIndex+=1;else{const{type:a,groupId:c,tableId:d,index:u,tdIndex:h,trIndex:R}=l,T={startIndex:u,endIndex:u};a===Ke.TABLE&&(T.tableId=d,T.startTdIndex=h,T.endTdIndex=h,T.startTrIndex=R,T.endTrIndex=R),n.set(c,T)}}const i=[];return n.forEach(l=>{i.push(l)}),i}getIsCanInput(){const{range:{startIndex:t,endIndex:e},elementList:n}=this.getRangeElement(),i=n[t];if(!i)return!1;if(t===e)return(i.controlComponent!==s.ControlComponent.PRE_TEXT||n[t+1]?.controlComponent!==s.ControlComponent.PRE_TEXT)&&i.controlComponent!==s.ControlComponent.POST_TEXT;const l=n[e];return l?!i.controlId&&!l.controlId||(!i.controlId||i.controlComponent===s.ControlComponent.POSTFIX)&&(!l.controlId||l.controlComponent===s.ControlComponent.POSTFIX)||!!i.controlId&&l.controlId===i.controlId&&l.controlComponent!==s.ControlComponent.PRE_TEXT&&l.controlComponent!==s.ControlComponent.POST_TEXT&&l.controlComponent!==s.ControlComponent.POSTFIX:!1}setRange(t,e,n,i,l,r,a,c){this.getIsRangeChange(t,e,n,i,l,r,a)&&(this.range.startIndex=t,this.range.endIndex=e,this.range.tableId=n,this.range.startTdIndex=i,this.range.endTdIndex=l,this.range.startTrIndex=r,this.range.endTrIndex=a,this.range.isCrossRowCol=!!(i||l||r||a),this.range.splitTdRange=c,this.setDefaultStyle(null)),this.range.zone=this.draw.getZone().getZone();const u=this.draw.getControl();if(~t&&~e&&!!this.draw.getElementList()[t]?.controlId&&!this.draw.isContentReadonly()){u.initControl();return}u.destroyControl()}replaceRange(t){this.setRange(t.startIndex,t.endIndex,t.tableId,t.startTdIndex,t.endTdIndex,t.startTrIndex,t.endTrIndex)}shrinkRange(){const{startIndex:t,endIndex:e}=this.range;t===e||!~t&&!~e||this.replaceRange({...this.range,startIndex:e})}setRangeStyle(){const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const{startIndex:n,endIndex:i,isCrossRowCol:l}=this.range;if(!~n&&!~i)return;let r;if(l){const E=this.draw.getOriginalElementList(),U=this.position.getPositionContext();r=E[U.index]}else{const E=~i?i:0,U=this.draw.getElementList();r=this.getRangeAnchorStyle(U,E)}if(!r)return;const a=this.getSelection()||[r],c=r.type||s.ElementType.TEXT,d=r.font||this.options.defaultFont,u=r.size||this.options.defaultSize,h=!~a.findIndex(E=>!E.bold),R=!~a.findIndex(E=>!E.italic),T=!~a.findIndex(E=>!E.underline&&!E.control?.underline),g=!~a.findIndex(E=>!E.strikeout),f=r.color||null,C=r.highlight||null,p=r.rowFlex||null,I=r.vertical||null,m=r.rowMargin??this.options.defaultRowMargin,L=r.dashArray||[],O=r.level||null,P=r.listType||null,S=r.listStyle||null,y=T&&r.textDecoration||null,Y=!!this.draw.getPainterStyle(),b=this.historyManager.isCanUndo(),M=this.historyManager.isCanRedo(),V=r.groupIds||null,N=r.extension??null,X=r.deletePerson??"",D={type:c,undo:b,redo:M,painter:Y,font:d,size:u,bold:h,italic:R,underline:T,strikeout:g,deletePerson:X,color:f,highlight:C,rowFlex:p,vertical:I,rowMargin:m,dashArray:L,level:O,listType:P,listStyle:S,groupIds:V,textDecoration:y,extension:N};this._emitRangeStyle(D)}recoveryRangeStyle(){const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const n=this.options.defaultFont,i=this.options.defaultSize,l=this.options.defaultRowMargin,r=!!this.draw.getPainterStyle(),a=this.historyManager.isCanUndo(),c=this.historyManager.isCanRedo(),u={type:null,undo:a,redo:c,painter:r,font:n,size:i,bold:!1,italic:!1,underline:!1,strikeout:!1,deletePerson:"123",color:null,highlight:null,rowFlex:null,rowMargin:l,dashArray:[],level:null,listType:null,listStyle:null,groupIds:null,textDecoration:null,extension:null,vertical:null};this._emitRangeStyle(u)}shrinkBoundary(t={}){const{elementList:e,range:n}=this.getRangeElement(t),{startIndex:i,endIndex:l}=n;if(!~i&&!~l)return;const r=e[i],a=e[l];if(i===l){if(r.controlComponent===s.ControlComponent.PLACEHOLDER&&r.originControlId&&r.control?.type==="text")return;if(r.controlComponent===s.ControlComponent.PLACEHOLDER){let c=i-1;for(;c>0;){const d=e[c];if(d.controlId===r.controlId&&(d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT||d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)){n.startIndex=c,n.endIndex=c;break}if(d.controlId!==r.controlId&&!d.originControlId)break;c--}}if(r.controlComponent===s.ControlComponent.TEXTFIXLABEL){let c=i-1;for(;c>0;){const d=e[c];if(d.controlId!==r.controlId||d.controlComponent===s.ControlComponent.VALUE||d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){n.startIndex=c,n.endIndex=c;break}c--}}}else{if(r.controlComponent===s.ControlComponent.PLACEHOLDER||a.controlComponent===s.ControlComponent.PLACEHOLDER||r.controlComponent===s.ControlComponent.TEXTFIXLABEL||a.controlComponent===s.ControlComponent.TEXTFIXLABEL){let c=l-1;for(;c>0;){const d=e[c];if(d.controlId!==a.controlId||d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT||d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){n.startIndex=c,n.endIndex=c;return}c--}}if(r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT||r.controlComponent===s.ControlComponent.PRETEXTFIX||r.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){let c=i+1;for(;c<e.length;){const d=e[c];if(d.controlId!==r.controlId||d.controlComponent===s.ControlComponent.VALUE){n.startIndex=c-1;break}else if(d.controlComponent===s.ControlComponent.PLACEHOLDER){n.startIndex=c-1,n.endIndex=c-1;return}c++}}if(a.controlComponent!==s.ControlComponent.VALUE){let c=l-1;for(;c>0;){const d=e[c];if(d.controlId!==r.controlId||d.controlComponent===s.ControlComponent.VALUE){n.endIndex=c;break}else if(d.controlComponent===s.ControlComponent.PLACEHOLDER){n.startIndex=c,n.endIndex=c;return}c--}}}}render(t,e,n,i,l){t.save(),t.globalAlpha=this.options.rangeAlpha,t.fillStyle=this.options.rangeColor,t.fillRect(e,n,i,l),t.restore()}toString(){const t=this.getTextLikeSelection();return t?t.map(e=>e.value).join("").replace(new RegExp(_,"g"),""):""}getRangeElement(t={}){const e=t.elementList||this.draw.getElementList(),n=t.range||this.getRange(),{splitTdRange:i}=n,l={elementList:e,range:n};return i&&(l.range=i,l.elementList=this.draw.getSplitTdValues(i.originalId)??[]),l}}class bd{draw;options;imageCache;constructor(t){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:l,scale:r}=this.options;if(l.size===s.BackgroundSize.CONTAIN){const a=e.width*r,c=e.height*r;if(!l.repeat||l.repeat===s.BackgroundRepeat.NO_REPEAT)t.drawImage(e,0,0,a,c);else{let d=0,u=0;const h=l.repeat===s.BackgroundRepeat.REPEAT||l.repeat===s.BackgroundRepeat.REPEAT_X?Math.ceil(n*r/a):1,R=l.repeat===s.BackgroundRepeat.REPEAT||l.repeat===s.BackgroundRepeat.REPEAT_Y?Math.ceil(i*r/c):1;for(let T=0;T<h;T++){for(let g=0;g<R;g++)t.drawImage(e,d,u,a,c),u+=c;u=0,d+=a}}}else t.drawImage(e,0,0,n*r,i*r)}_renderBackgroundImage(t,e,n){const{background:i}=this.options,l=this.imageCache.get(i.image);if(l)this._drawImage(t,l,e,n);else{const r=new Image;r.setAttribute("crossOrigin","Anonymous"),r.src=i.image,r.onload=()=>{this.imageCache.set(i.image,r),this._drawImage(t,r,e,n),this.draw.render({isCompute:!1,isSubmitHistory:!1})}}}render(t,e){const{background:{image:n,color:i,applyPageNumbers:l}}=this.options;if(n&&(!l?.length||l.includes(e))){const{width:r,height:a}=this.options;this._renderBackgroundImage(t,r,a)}else{const r=this.draw.getCanvasWidth(e),a=this.draw.getCanvasHeight(e);this._renderBackgroundColor(t,i,r,a)}}}class ji{fillRect;fillColor;fillDecorationStyle;constructor(){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,l,r,a){const c=!this.fillRect.width;if(!c&&(this.fillColor!==r||this.fillDecorationStyle!==a)){this.render(t),this.clearFillInfo(),this.recordFillInfo(t,e,n,i,l,r,a);return}c&&(this.fillRect.x=e,this.fillRect.y=n),l&&this.fillRect.height<l&&(this.fillRect.height=l),this.fillRect.width+=i,this.fillColor=r,this.fillDecorationStyle=a}}class Vd extends ji{options;constructor(t){super(),this.options=t.getOptions()}render(t){if(!this.fillRect.width)return;const{highlightAlpha:e}=this.options,{x:n,y:i,width:l,height:r}=this.fillRect;t.save(),t.globalAlpha=e,t.fillStyle=this.fillColor,t.fillRect(n,i,l,r),t.restore(),this.clearFillInfo()}}class Wd{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e){const{marginIndicatorColor:n,pageMode:i}=this.options,l=this.draw.getWidth(),r=i===s.PageMode.CONTINUITY?this.draw.getCanvasHeight(e)/this.draw.getPagePixelRatio():this.draw.getHeight(),a=this.draw.getMargins(),c=this.draw.getMarginIndicatorSize();t.save(),t.translate(.5,.5),t.strokeStyle=n,t.beginPath();const d=[a[3],a[0]],u=[l-a[1],a[0]],h=[a[3],r-a[2]],R=[l-a[1],r-a[2]];t.moveTo(d[0]-c,d[1]),t.lineTo(...d),t.lineTo(d[0],d[1]-c),t.moveTo(u[0]+c,u[1]),t.lineTo(...u),t.lineTo(u[0],u[1]-c),t.moveTo(h[0]-c,h[1]),t.lineTo(...h),t.lineTo(h[0],h[1]+c),t.moveTo(R[0]+c,R[1]),t.lineTo(...R),t.lineTo(R[0],R[1]+c),t.stroke(),t.restore()}}class Ud{draw;options;position;range;searchKeyword;searchNavigateIndex;searchOptions;searchMatchList;constructor(t){this.draw=t,this.options=t.getOptions(),this.position=t.getPosition(),this.range=t.getRange(),this.searchNavigateIndex=null,this.searchOptions=null,this.searchKeyword=null,this.searchMatchList=[]}getSearchKeyword(){return this.searchKeyword}setSearchKeyword(t,e){this.searchKeyword=t,this.searchNavigateIndex=null,this.searchOptions=e||null}searchNavigatePre(){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(;t>=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(;t<this.searchMatchList.length;){const i=this.searchMatchList[t];if(n!==i.groupId){e=!0,this.searchNavigateIndex=t;break}t++}if(!e){if(this.searchMatchList[0].groupId===n)return null;this.searchNavigateIndex=0}}return this.searchNavigateIndex}searchNavigateScrollIntoView(t){const{coordinate:{leftTop:e,leftBottom:n,rightTop:i},pageNo:l}=t,r=this.draw.getHeight(),a=this.draw.getPageGap(),c=l*(r+a),d=document.createElement("div");d.style.position="absolute";const u=50;d.style.width=`${i[0]-e[0]+u}px`,d.style.height=`${n[1]-e[1]+u}px`,d.style.left=`${e[0]}px`,d.style.top=`${e[1]+c}px`,this.draw.getContainer().append(d),d.scrollIntoView(!1),d.remove()}getSearchNavigateIndexList(){return this.searchNavigateIndex===null||!this.searchKeyword?[]:new Array(this.searchKeyword.length).fill(this.searchNavigateIndex).map((t,e)=>t+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<this.searchMatchList.length;i++){const l=this.searchMatchList[i];n!==l.groupId&&(n=l.groupId,e+=1)}return{index:t,count:e}}getMatchList(t,e){const{isRegEnable:n=!1,isIgnoreCase:i=!0}=this.searchOptions||{},l=i?t.toLocaleLowerCase():t,r=[],a=[],c=e.length,d=[];for(let T=0;T<c;T++)e[T].type===s.ElementType.TABLE&&d.push(T);let u=0,h=0;for(;h<c-1;){const T=d.length?d[u]:c,g=e.slice(h,T);g.length&&a.push({index:h,type:Ke.PAGE,elementList:g});const f=e[T];f&&a.push({index:T,type:Ke.TABLE,elementList:[f]}),h=T+1,u++}function R(T,g,f,C){if(!T)return;let p=f.map(P=>!P.type||Le.includes(P.type)&&P.controlComponent!==s.ControlComponent.CHECKBOX&&P.controlComponent!==s.ControlComponent.RADIO&&!P.hide&&!P.control?.hide&&!P.area?.hide?P.value:_).filter(Boolean).join("");i&&(p=p.toLocaleLowerCase());const I=[],m=n?new RegExp(T):T;let{index:L,length:O}=xs(p,m);for(;L!==-1&&O!==0;){I.push({index:L,length:O});const P=xs(p,m,L+O);L=P.index,O=P.length}for(let P=0;P<I.length;P++){const{index:S,length:y}=I[P],Y=ft();for(let b=0;b<y;b++){const M=S+b+(C?.startIndex||0);r.push({type:g,index:M,groupId:Y,...C})}}}for(let T=0;T<a.length;T++){const g=a[T];if(g.type===Ke.TABLE){const f=g.elementList[0];for(let C=0;C<f.trList.length;C++){const p=f.trList[C];for(let I=0;I<p.tdList.length;I++){const m=p.tdList[I],L={tableId:f.id,tableIndex:g.index,trIndex:C,tdIndex:I,tdId:m.id};R(l,g.type,m.value,L)}}}else R(l,g.type,g.elementList,{startIndex:g.index})}return r}compute(t){const e=this.searchOptions?.isLimitSelection&&!this.range.getIsCollapsed(),n=e?this.range.getSelectionElementList():this.draw.getOriginalElementList();if(!n?.length||(this.searchMatchList=this.getMatchList(t,n),!e||!this.searchMatchList.length))return;const{startIndex:i}=this.range.getRange(),l=i+1;for(const r of this.searchMatchList)r.type===Ke.TABLE?r.tableIndex+=l:r.index+=l}render(t,e){if(!this.searchMatchList||!this.searchMatchList.length||!this.searchKeyword)return;const{searchMatchAlpha:n,searchMatchColor:i,searchNavigateMatchColor:l}=this.options,r=this.position.getOriginalPositionList(),a=this.draw.getOriginalElementList();t.save(),t.globalAlpha=n;for(let c=0;c<this.searchMatchList.length;c++){const d=this.searchMatchList[c];let u=null;if(d.type===Ke.TABLE){const{tableIndex:L,trIndex:O,tdIndex:P,index:S}=d;u=a[L]?.trList[O].tdList[P]?.positionList[S]}else u=r[d.index];if(!u)continue;const{coordinate:{leftTop:h,leftBottom:R,rightTop:T},pageNo:g}=u;if(g!==e)continue;if(this.getSearchNavigateIndexList().includes(c)){t.fillStyle=l;const L=this.searchMatchList[c-1];(!L||L.groupId!==d.groupId)&&this.searchNavigateScrollIntoView(u)}else t.fillStyle=i;const C=h[0],p=h[1],I=T[0]-h[0],m=R[1]-h[1];t.fillRect(C,p,I,m)}t.restore()}replace(t,e){if(this.draw.isReadonly()||t==null)return;let i=this.getSearchMatchList();const l=e?.index;if(Ei(l)){const f=[];i.forEach(C=>{const p=f[f.length-1];!p||p[0].groupId!==C.groupId?f.push([C]):p.push(C)}),i=f[l]}if(!i?.length)return;const r=this.draw.isDesignMode();let a=0,c=0,d="",u="",h=-1;const R=this.draw.getOriginalElementList();for(let f=0;f<i.length;f++){const C=i[f];if(C.type===Ke.TABLE){const{tableIndex:p,trIndex:I,tdIndex:m,index:L,tdId:O}=C;u&&O!==u&&(c=0),u=O;const P=p+a,S=R[P].trList[I].tdList[m].value,y=L+c,Y=S[y];if(!r&&(Y?.control?.deletable===!1||Y?.title?.deletable===!1))continue;if(t===""){this.draw.spliceElementList(S,y,1),c--,~h||(h=f);continue}if(d===C.groupId){this.draw.spliceElementList(S,y,1),c--;continue}~h||(h=f);for(let b=0;b<t.length;b++){const M=t[b];b===0?Y.value=M:(this.draw.spliceElementList(S,y+b,0,[{...Y,value:M}]),c++)}}else{const p=C.index+a,I=R[p];if(!r&&(I?.control?.deletable===!1||I?.title?.deletable===!1)||I.type===s.ElementType.CONTROL&&I.controlComponent!==s.ControlComponent.VALUE)continue;if(t===""){this.draw.spliceElementList(R,p,1),a--,~h||(h=f);continue}if(~h||(h=f),d===C.groupId){this.draw.spliceElementList(R,p,1),a--;continue}for(let m=0;m<t.length;m++){const L=t[m];m===0?I.value=L:(this.draw.spliceElementList(R,p+m,0,[{...I,value:L}]),a++)}}d=C.groupId}if(!~h)return;const T=i[h],g=T.index+(t.length-1);if(T.type===Ke.TABLE){const{tableIndex:f,trIndex:C,tdIndex:p,index:I}=T,m=R[f].trList[C].tdList[p].value[I];this.position.setPositionContext({isTable:!0,index:f,trIndex:C,tdIndex:p,tdId:m.tdId,trId:m.trId,tableId:m.tableId})}else this.position.setPositionContext({isTable:!1});this.draw.getRange().setRange(g,g),this.draw.render({curIndex:g})}}class Yd extends ji{options;constructor(t){super(),this.options=t.getOptions()}render(t){if(!this.fillRect.width)return;const{scale:e,strikeoutColor:n}=this.options,{x:i,y:l,width:r}=this.fillRect;t.save(),t.lineWidth=e,t.strokeStyle=n;const a=l-3;t.beginPath(),t.moveTo(i,a),t.lineTo(i+r,a),t.stroke(),t.beginPath(),t.moveTo(i,l+3.5),t.lineTo(i+r,l+3.5),t.stroke(),t.restore(),this.clearFillInfo()}}s.TextDecorationStyle=void 0,(function(o){o.SOLID="solid",o.DOUBLE="double",o.DASHED="dashed",o.DOTTED="dotted",o.WAVY="wavy"})(s.TextDecorationStyle||(s.TextDecorationStyle={}));var Bn;(function(o){o.SOLID="solid",o.DASHED="dashed",o.DOTTED="dotted"})(Bn||(Bn={}));class wd extends ji{options;constructor(t){super(),this.options=t.getOptions()}_drawLine(t,e,n,i,l){const r=e+i;switch(t.beginPath(),l){case Bn.DASHED:t.setLineDash([3,1]);break;case Bn.DOTTED:t.setLineDash([1,1]);break}t.moveTo(e,n),t.lineTo(r,n),t.stroke()}_drawDouble(t,e,n,i){const r=e+i,a=n+3*this.options.scale;this.options.mode===s.EditorMode.PRINT||this.options.mode===s.EditorMode.COMPARE?t.strokeStyle="transparent":t.strokeStyle="red",t.beginPath(),t.moveTo(e,n),t.lineTo(r,n),t.stroke(),t.beginPath(),t.moveTo(e,a),t.lineTo(r,a),t.stroke()}_drawWave(t,e,n,i){const{scale:l}=this.options,r=1.2*l,a=1/l,c=n+2*r;t.beginPath();for(let d=0;d<i;d++){const u=r*Math.sin(a*d);t.lineTo(e+d,c+u)}t.stroke()}render(t){if(!this.fillRect.width)return;const{underlineColor:e,scale:n}=this.options,{x:i,y:l,width:r}=this.fillRect;t.save(),t.strokeStyle=this.fillColor||e,t.lineWidth=n;const a=Math.floor(l+2*t.lineWidth)+.5;switch(this.fillDecorationStyle){case s.TextDecorationStyle.WAVY:this._drawWave(t,i,a,r);break;case s.TextDecorationStyle.DOUBLE:this._drawDouble(t,i,a,r);break;case s.TextDecorationStyle.DASHED:this._drawLine(t,i,a,r,Bn.DASHED);break;case s.TextDecorationStyle.DOTTED:this._drawLine(t,i,a,r,Bn.DOTTED);break;default:this._drawLine(t,i,a,r);break}t.restore(),this.clearFillInfo()}}class vd{draw;options;ctx;curX;curY;text;curStyle;curColor;cacheMeasureText;constructor(t){this.draw=t,this.options=t.getOptions(),this.ctx=t.getCtx(),this.curX=-1,this.curY=-1,this.text="",this.curStyle="",this.cacheMeasureText=new Map}measureBasisWord(t,e){t.save(),t.font=e;const n=this.measureText(t,{value:ua});return t.restore(),n}measureWord(t,e,n){const i=this.draw.getLetterReg();let l=0,r=null,a=n;for(;a<e.length;){const c=e[a];if(c.type&&c.type!==s.ElementType.TEXT||!i.test(c.value)){r=c;break}l+=this.measureText(t,c).width,a++}return{width:l,endElement:r}}buttonMeasureWord(t,e,n){const i=this.draw.getLetterReg();let l=0,r=null,a=n;for(;a<e.length;){const c=e[a];if(c.type&&c.type!==s.ElementType.TEXT||!i.test(c.value)){r=c;break}l+=this.measureText(t,c).width,a++}return{width:l,endElement:r}}measurePunctuationWidth(t,e){return!e||!da.includes(e.value)?0:(t.font=this.draw.getElementFont(e),this.measureText(t,e).width)}measureText(t,e){if(e.width){const r=t.measureText(e.value);return{width:e.width,actualBoundingBoxAscent:r.actualBoundingBoxAscent,actualBoundingBoxDescent:r.actualBoundingBoxDescent,actualBoundingBoxLeft:r.actualBoundingBoxLeft,actualBoundingBoxRight:r.actualBoundingBoxRight,fontBoundingBoxAscent:r.fontBoundingBoxAscent,fontBoundingBoxDescent:r.fontBoundingBoxDescent}}const n=`${e.value}${t.font}`,i=this.cacheMeasureText.get(n);if(i)return i;const l=t.measureText(e.value);return this.cacheMeasureText.set(n,l),l}getBasisWordBoundingBoxAscent(t,e){return this.measureBasisWord(t,e).actualBoundingBoxAscent}complete(){this._render(),this.text=""}record(t,e,n,i){if(this.ctx=t,this.options.renderMode===s.RenderMode.COMPATIBILITY){this._setCurXY(n,i),this.text=e.value,this.curStyle=e.style,this.curColor=e.color,this.complete();return}this.text||this._setCurXY(n,i),(this.curStyle&&e.style!==this.curStyle||e.color!==this.curColor)&&(this.complete(),this._setCurXY(n,i)),this.text+=e.value,this.curStyle=e.style,this.curColor=e.color}_setCurXY(t,e){this.curX=t,this.curY=e}_render(){!this.text||!~this.curX||!~this.curX||(this.ctx.save(),this.ctx.font=this.curStyle,this.ctx.fillStyle=this.curColor||this.options.defaultColor,this.ctx.fillText(this.text,this.curX,this.curY),this.ctx.restore())}}class kn{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}static formatNumberPlaceholder(t,e,n,i){const l=i===s.NumberType.CHINESE?La(e):`${e}`;return t.replace(n,l)}render(t,e){const{scale:n,pageNumber:{size:i,font:l,color:r,rowFlex:a,numberType:c,format:d,startPageNo:u,fromPageNo:h}}=this.options;if(e<h)return;let R=d;const T=new RegExp(ro.PAGE_NO);T.test(R)&&(R=kn.formatNumberPlaceholder(R,e+u-h,T,c));const g=new RegExp(ro.PAGE_COUNT);g.test(R)&&(R=kn.formatNumberPlaceholder(R,this.draw.getPageCount()-h,g,c));const f=this.draw.getWidth(),C=this.draw.getHeight(),p=this.draw.getPageNumberBottom(),I=C-p;t.save(),t.fillStyle=r,t.font=`${i*n}px ${l}`;let m=0;const L=this.draw.getMargins(),{width:O}=t.measureText(R);a===s.RowFlex.CENTER?m=(f-O)/2:a===s.RowFlex.RIGHT?m=f-O-L[1]:m=L[3],t.fillText(R,m,I),t.restore()}}class Zd{draw;options;scrollContainer;constructor(t){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 l=0;l<t.length;l++){const r=t[l],{intersectionHeight:a}=this.getElementVisibleInfo(r);if(i&&!a)break;a&&e.push(l),a>i&&(i=a,n=l)}return{intersectionPageNo:n,visiblePageNoList:e}}_observer=ma(()=>{const{intersectionPageNo:t,visiblePageNoList:e}=this.getPageVisibleInfo();this.draw.setIntersectionPageNo(t),this.draw.setVisiblePageNoList(e)},150)}class Qd{draw;step=5;thresholdPoints=[70,40,10,20];selectionContainer;rangeManager;requestAnimationFrameId;isMousedown;isMoving;clientWidth;clientHeight;containerRect;constructor(t){this.draw=t,this.rangeManager=t.getRange();const{scrollContainerSelector:e}=t.getOptions();this.selectionContainer=e&&document.querySelector(e)||document,this.requestAnimationFrameId=null,this.isMousedown=!1,this.isMoving=!1,this.clientWidth=0,this.clientHeight=0,this.containerRect=null,this._addEvent()}_addEvent(){const t=this.selectionContainer;t.addEventListener("mousedown",this._mousedown),t.addEventListener("mousemove",this._mousemove),t.addEventListener("mouseup",this._mouseup),document.addEventListener("mouseleave",this._mouseup)}removeEvent(){const t=this.selectionContainer;t.removeEventListener("mousedown",this._mousedown),t.removeEventListener("mousemove",this._mousemove),t.removeEventListener("mouseup",this._mouseup),document.removeEventListener("mouseleave",this._mouseup)}_mousedown=t=>{if(this.draw.isInteractionSuspended()){this._mouseup();return}if(!this.draw.isTargetInsideEditor(t.target)){this._mouseup();return}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 e=this.selectionContainer.getBoundingClientRect();this.containerRect=e}};_mouseup=()=>{this.isMousedown=!1,this._stopMove()};_mousemove=t=>{if(this.draw.isInteractionSuspended()||!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<this.thresholdPoints[0]?this._startMove(zt.UP):this.clientHeight-n<=this.thresholdPoints[1]?this._startMove(zt.DOWN):e<this.thresholdPoints[2]?this._startMove(zt.LEFT):this.clientWidth-e<this.thresholdPoints[3]?this._startMove(zt.RIGHT):this._stopMove()};_move(t){const e=this.selectionContainer instanceof Document?window:this.selectionContainer,n=this.selectionContainer instanceof Document?window.scrollX:e.scrollLeft,i=this.selectionContainer instanceof Document?window.scrollY:e.scrollTop;t===zt.DOWN?e.scrollTo(n,i+this.step):t===zt.UP?e.scrollTo(n,i-this.step):t===zt.LEFT?e.scrollTo(n-this.step,i):e.scrollTo(n+this.step,i),this.requestAnimationFrameId=window.requestAnimationFrame(this._move.bind(this,t))}_startMove(t){this.isMoving||(this.isMoving=!0,this._move(t))}_stopMove(){this.requestAnimationFrameId&&(window.cancelAnimationFrame(this.requestAnimationFrameId),this.requestAnimationFrameId=null,this.isMoving=!1)}}class Kd{draw;range;options;constructor(t){this.draw=t,this.range=t.getRange(),this.options=t.getOptions()}getTrListGroupByCol(t){const e=rt(t);for(let n=0;n<t.length;n++){const i=e[n];for(let l=i.tdList.length-1;l>=0;l--){const r=i.tdList[l],{rowspan:a,rowIndex:c,colIndex:d}=r,u=c+a-1;if(u!==l){const h=i.tdList.splice(l,1)[0];e[u]?.tdList.splice(d,0,h)}}}return e}getRangeRowCol(){const{isTable:t,index:e,trIndex:n,tdIndex:i}=this.draw.getPosition().getPositionContext();if(!t)return null;const{isCrossRowCol:l,startTdIndex:r,endTdIndex:a,startTrIndex:c,endTrIndex:d}=this.range.getRange(),R=this.draw.getOriginalElementList()[e].trList;if(!l)return[[R[n].tdList[i]]];let T=R[c].tdList[r],g=R[d].tdList[a];(T.x>g.x||T.y>g.y)&&([T,g]=[g,T]);const f=T.colIndex,C=g.colIndex+(g.colspan-1),p=T.rowIndex,I=g.rowIndex+(g.rowspan-1),m=[];for(let L=0;L<R.length;L++){const O=R[L],P=[];for(let S=0;S<O.tdList.length;S++){const y=O.tdList[S],Y=y.colIndex,b=y.rowIndex;Y>=f&&Y<=C&&b>=p&&b<=I&&P.push(y)}P.length&&m.push(P)}return m.length?m:null}_drawOuterBorder(t){const{ctx:e,startX:n,startY:i,width:l,height:r,isDrawFullBorder:a,borderExternalWidth:c,skipTopBorderRanges:d=[]}=t,{scale:u}=this.options,h=this._mergeHorizontalBorderRanges(d,l),R=e.lineWidth;c&&(e.lineWidth=c*u),e.beginPath();const T=Math.round(n),g=Math.round(i);e.translate(.5,.5),a&&!h.length?e.rect(T,g,l,r):(a?(e.moveTo(T,g),e.lineTo(T,g+r),e.lineTo(T+l,g+r),e.lineTo(T+l,g)):(e.moveTo(T,g+r),e.lineTo(T,g)),this._drawHorizontalBorder(e,T,g,l,h)),e.stroke(),c&&(e.lineWidth=R),e.translate(-.5,-.5)}_drawHorizontalBorder(t,e,n,i,l){if(!l.length){t.lineTo(e+i,n);return}let r=0;l.forEach(([a,c])=>{r<a&&(t.moveTo(e+r,n),t.lineTo(e+a,n)),r=Math.max(r,c)}),r<i&&(t.moveTo(e+r,n),t.lineTo(e+i,n))}_mergeHorizontalBorderRanges(t,e){return t.map(([i,l])=>[Math.max(0,Math.min(i,e)),Math.max(0,Math.min(l,e))]).filter(([i,l])=>l>i).sort(([i],[l])=>i-l).reduce((i,l)=>{const r=i[i.length-1];return!r||l[0]>r[1]?i.push(l):l[1]>r[1]&&(r[1]=l[1]),i},[])}_getPagingContinuationTopBorderRanges(t,e){const{scale:n}=this.options,i=[];for(let l=0;l<t.length;l++){const r=t[l];for(let a=0;a<r.tdList.length;a++){const c=r.tdList[a];!c.linkTdPrevId||c.y!==0||i.push([c.x*n,(c.x+c.width)*n])}}return this._mergeHorizontalBorderRanges(i,e)}_drawSlash(t,e,n,i){const{scale:l}=this.options;t.save();const r=e.width*l,a=e.height*l,c=Math.round(e.x*l+n),d=Math.round(e.y*l+i);e.slashTypes?.includes(s.TdSlash.FORWARD)&&(t.moveTo(c+r,d),t.lineTo(c,d+a)),e.slashTypes?.includes(s.TdSlash.BACK)&&(t.moveTo(c,d),t.lineTo(c+r,d+a)),t.stroke(),t.restore()}_drawBorder(t,e,n,i){const{colgroup:l,trList:r,borderType:a,borderColor:c,borderWidth:d=1,borderExternalWidth:u}=e;if(!l||!r)return;const{scale:h,table:{defaultBorderColor:R}}=this.options,T=e.width*h,g=e.height*h,f=this._getPagingContinuationTopBorderRanges(r,T),C=a===s.TableBorder.EMPTY,p=a===s.TableBorder.EXTERNAL,I=a===s.TableBorder.INTERNAL;t.save(),a===s.TableBorder.DASH&&t.setLineDash([3,3]),t.lineWidth=d*h,t.strokeStyle=c||R,!C&&!I&&this._drawOuterBorder({ctx:t,startX:n,startY:i,width:T,height:g,borderExternalWidth:u,isDrawFullBorder:p,skipTopBorderRanges:f});for(let m=0;m<r.length;m++){const L=r[m];for(let O=0;O<L.tdList.length;O++){const P=L.tdList[O];if(P.slashTypes?.length&&this._drawSlash(t,P,n,i),!P.borderTypes?.length&&(C||p))continue;const S=P.width*h,y=P.height*h,Y=Math.round(P.x*h+n+S),b=Math.round(P.y*h+i),M=!!P.linkTdPrevId,V=!!P.linkTdNextId;if(t.translate(.5,.5),t.beginPath(),!M&&P.borderTypes?.includes(s.TdBorder.TOP)&&(t.moveTo(Y-S,b),t.lineTo(Y,b),t.stroke()),P.borderTypes?.includes(s.TdBorder.RIGHT)&&(t.moveTo(Y,b),t.lineTo(Y,b+y),t.stroke()),P.borderTypes?.includes(s.TdBorder.BOTTOM)&&(t.moveTo(Y,b+y),t.lineTo(Y-S,b+y),t.stroke()),P.borderTypes?.includes(s.TdBorder.LEFT)&&(t.moveTo(Y-S,b),t.lineTo(Y-S,b+y),t.stroke()),!C&&!p){if((!I||P.colIndex+P.colspan<l.length)&&(t.moveTo(Y,b),t.lineTo(Y,b+y),u&&u!==d&&P.colIndex+P.colspan===l.length)){const N=t.lineWidth;t.lineWidth=u*h,t.stroke(),t.beginPath(),t.lineWidth=N}if(V||!I||P.rowIndex+P.rowspan<r.length){const N=u&&u!==d&&P.rowIndex+P.rowspan===r.length;if(N&&(t.stroke(),t.beginPath()),t.moveTo(Y,b+y),t.lineTo(Y-S,b+y),N){const X=t.lineWidth;t.lineWidth=u*h,t.stroke(),t.beginPath(),t.lineWidth=X}}t.stroke()}t.translate(-.5,-.5)}}t.restore()}_drawBackgroundColor(t,e,n,i){const{trList:l}=e;if(!l)return;const{scale:r}=this.options;for(let a=0;a<l.length;a++){const c=l[a];for(let d=0;d<c.tdList.length;d++){const u=c.tdList[d];if(!u.backgroundColor)continue;t.save();const h=u.width*r,R=u.height*r,T=Math.round(u.x*r+n),g=Math.round(u.y*r+i);t.fillStyle=u.backgroundColor,t.fillRect(T,g,h,R),t.restore()}}}getTableWidth(t){return t.colgroup.reduce((e,n)=>e+n.width,0)}getTableHeight(t){const e=t.trList;return 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<t.length;i++){const l=t[i].tdList;for(let r=0;r<l.length;r++){const a=l[r],c=a.colIndex,d=c+a.colspan-1;e>=c&&e<=d&&n.push(a)}}return n}getTdListByRowIndex(t,e){const n=[];for(let i=0;i<t.length;i++){const l=t[i].tdList;for(let r=0;r<l.length;r++){const a=l[r],c=a.rowIndex,d=c+a.rowspan-1;e>=c&&e<=d&&n.push(a)}}return n}computeRowColInfo(t){const{colgroup:e,trList:n}=t;if(!e||!n)return;let i=0;for(let l=0;l<n.length;l++){const r=n[l],a=n.length-1===l;for(let c=0;c<r.tdList.length;c++){const d=r.tdList[c];let u=0;if(n.length>1&&l!==0){const p=r.tdList[c-1],I=p?p.colIndex+p.colspan:c;for(let m=I;m<e.length;m++)if(this.getRowCountByColIndex(n.slice(0,l),m)===l){u=m;let O=0;for(let P=0;P<m;P++)O+=e[P].width;i=O;break}}else{const p=r.tdList[c-1];p&&(u=p.colIndex+p.colspan)}let h=0;for(let p=0;p<d.colspan;p++)h+=e[p+u].width;let R=0;for(let p=0;p<d.rowspan;p++){const I=n[p+l]||n[l];R+=I.height}const T=r.tdList.length-1===c;let g=a;if(!g&&d.rowspan>1){const p=n.length-1-l;g=d.rowspan-1===p}const f=a&&T;d.isLastRowTd=T,d.isLastColTd=g,d.isLastTd=f,d.x=i;let C=0;for(let p=0;p<l;p++){const I=n[p].tdList;for(let m=0;m<I.length;m++){const L=I[m];if(u>=L.colIndex&&u<L.colIndex+L.colspan){C+=L.height;break}}}d.y=C,d.width=h,d.height=R,d.rowIndex=l,d.colIndex=u,d.trIndex=l,d.tdIndex=c,i+=h,T&&!f&&(i=0)}}}drawRange(t,e,n,i){const{scale:l,rangeAlpha:r,rangeColor:a}=this.options,{type:c,trList:d}=e;if(!d||c!==s.ElementType.TABLE)return;const{isCrossRowCol:u,startTdIndex:h,endTdIndex:R,startTrIndex:T,endTrIndex:g}=this.range.getRange();if(!u)return;let f=d[T].tdList[h],C=d[g].tdList[R];(f.x>C.x||f.y>C.y)&&([f,C]=[C,f]);const p=f.colIndex,I=C.colIndex+(C.colspan-1),m=f.rowIndex,L=C.rowIndex+(C.rowspan-1);t.save();for(let O=0;O<d.length;O++){const P=d[O];for(let S=0;S<P.tdList.length;S++){const y=P.tdList[S],Y=y.colIndex,b=y.rowIndex;if(Y>=p&&Y<=I&&b>=m&&b<=L){const M=y.x*l,V=y.y*l,N=y.width*l,X=y.height*l;t.globalAlpha=r,t.fillStyle=a,t.fillRect(M+n,V+i,N,X)}}}t.restore()}render(t,e,n,i){this._drawBackgroundColor(t,e,n,i),this._drawBorder(t,e,n,i)}findPreRowSpanTd(t,e,n){for(let i=e;i>=0;i--){const l=t[i].tdList.find(r=>r.colIndex===n);if(l)return l}}computeTrHeight(t,e){const{scale:n,table:{tdPadding:i,defaultTrMinHeight:l}}=this.options,r=t.tdPadding||i,a=r[0]+r[2],c=t.trList;for(let h=0;h<c.length;h++){const R=c[h];R.height=R.minHeight||l,R.minHeight=R.height}this.computeRowColInfo(t);const d={},u={};for(let h=0;h<c.length;h++){const R=c[h];if(!R.tdList.length){R.height=0;continue}const T=[],g=[];for(let C=0;C<t.colgroup.length;C++){const p=R.tdList.find(I=>I.colIndex===C);if(p){const I=e?e(p):p.rowList,m=I.reduce((O,P)=>O+P.height,0);p.rowList=I;const L=m/n+a;p.mainHeight=L,p.rowspan>1?(u[p.colIndex]=p.id,d[p.id]={td:p,rowSpan:[h,h+p.rowspan-1],preHeight:0,preMinHeight:0,extraHeight:L},g.push(L)):p.height<L?(p.height=L,p.realHeight=L,T.push(L)):T.push(p.height)}else{const I=d[u[C]];I?.rowSpan[1]==h&&T.push(I.extraHeight)}}const f=Math.max(...T.length?T:g);Object.values(d).forEach(C=>{C.rowSpan[0]<=h&&C.rowSpan[1]>=h&&(C.extraHeight-=f,C.preHeight+=f,C.preMinHeight+=R.minHeight)}),R.height=f;for(let C=0;C<t.colgroup.length;C++){const p=R.tdList.find(I=>I.colIndex===C)??this.findPreRowSpanTd(c,h,C);if(p){const I=d[p.id]?.preHeight??0,m=d[p.id]?.preMinHeight??R.minHeight;p.height=f+I,p.realHeight=f+I,p.realMinHeight=m}}}this.computeRowColInfo(t)}}var _e;(function(o){o.ROW="row",o.COL="col"})(_e||(_e={}));class Hd{MIN_TD_WIDTH=20;ROW_COL_OFFSET=18;ROW_COL_QUICK_WIDTH=16;ROW_COL_QUICK_OFFSET=5;ROW_COL_QUICK_POSITION=this.ROW_COL_OFFSET+(this.ROW_COL_OFFSET-this.ROW_COL_QUICK_WIDTH)/2;BORDER_VALUE=4;TABLE_SELECT_OFFSET=20;draw;canvas;options;position;range;container;toolRowContainer;toolRowAddBtn;toolColAddBtn;toolTableSelectBtn;toolColContainer;toolBorderContainer;anchorLine;mousedownX;mousedownY;constructor(t){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(){this.toolRowContainer?.remove(),this.toolRowAddBtn?.remove(),this.toolColAddBtn?.remove(),this.toolTableSelectBtn?.remove(),this.toolColContainer?.remove(),this.toolBorderContainer?.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 l=this.draw.getOriginalElementList(),r=this.position.getOriginalPositionList(),a=l[e];if(a.tableToolDisabled&&!this.draw.isDesignMode())return;const{scale:c,table:{overflow:d}}=this.options,u=r[e],{colgroup:h,trList:R}=a,{coordinate:{leftTop:T}}=u,g=this.draw.getHeight(),f=this.draw.getPageGap(),C=this.draw.getPageNo()*(g+f),p=T[0],I=T[1]+C,m=a.trList[n].tdList[i],L=m.rowIndex,O=m.colIndex,P=a.height*c,S=a.width*c,y=document.createElement("div");y.classList.add(`${st}-table-tool__select`),y.style.height=`${P*c}`,y.style.left=`${p}px`,y.style.top=`${I}px`,y.style.transform=`translate(-${this.TABLE_SELECT_OFFSET*c}px, ${-this.TABLE_SELECT_OFFSET*c}px)`,y.onclick=()=>{this.draw.getTableOperate().tableSelectAll()},this.container.append(y),this.toolTableSelectBtn=y;const Y=R.map(E=>E.height),b=document.createElement("div");b.classList.add(`${st}-table-tool__row`),b.style.transform=`translateX(-${this.ROW_COL_OFFSET*c}px)`;for(let E=0;E<Y.length;E++){const U=Y[E]*c,F=document.createElement("div");F.classList.add(`${st}-table-tool__row__item`),E===L&&F.classList.add("active"),F.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByRowIndex(R,E),W=Q[0],K=Q[Q.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:W.trIndex,tdIndex:W.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,W.tdIndex,K.tdIndex,W.trIndex,K.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(b,E)};const Z=document.createElement("div");Z.classList.add(`${st}-table-tool__anchor`),Z.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:E,order:_e.ROW})},F.append(Z),F.style.height=`${U}px`,b.append(F)}b.style.left=`${p}px`,b.style.top=`${I}px`,this.container.append(b),this.toolRowContainer=b;const M=document.createElement("div");M.classList.add(`${st}-table-tool__quick__add`),M.style.height=`${P*c}`,M.style.left=`${p}px`,M.style.top=`${I+P}px`,M.style.transform=`translate(-${this.ROW_COL_QUICK_POSITION*c}px, ${this.ROW_COL_QUICK_OFFSET*c}px)`,M.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:R.length-1,tdIndex:0,tableId:a.id}),this.draw.getTableOperate().insertTableBottomRow()},this.container.append(M),this.toolRowAddBtn=M;const V=h.map(E=>E.width),N=document.createElement("div");N.classList.add(`${st}-table-tool__col`),N.style.transform=`translateY(-${this.ROW_COL_OFFSET*c}px)`;for(let E=0;E<V.length;E++){const U=V[E]*c,F=document.createElement("div");F.classList.add(`${st}-table-tool__col__item`),E===O&&F.classList.add("active"),F.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByColIndex(R,E),W=Q[0],K=Q[Q.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:W.trIndex,tdIndex:W.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,W.tdIndex,K.tdIndex,W.trIndex,K.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(N,E)};const Z=document.createElement("div");Z.classList.add(`${st}-table-tool__anchor`),Z.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:E,order:_e.COL})},F.append(Z),F.style.width=`${U}px`,N.append(F)}N.style.left=`${p}px`,N.style.top=`${I}px`,this.container.append(N),this.toolColContainer=N;const X=document.createElement("div");X.classList.add(`${st}-table-tool__quick__add`),X.style.height=`${P*c}`,X.style.left=`${p+S}px`,X.style.top=`${I}px`,X.style.transform=`translate(${this.ROW_COL_QUICK_OFFSET*c}px, -${this.ROW_COL_QUICK_POSITION*c}px)`,X.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:0,tdIndex:R[0].tdList.length-1||0,tableId:a.id}),this.draw.getTableOperate().insertTableRightCol()},this.container.append(X),this.toolColAddBtn=X;const D=document.createElement("div");D.classList.add(`${st}-table-tool__border`),D.style.height=`${P}px`,D.style.width=`${S}px`,D.style.left=`${p}px`,D.style.top=`${I}px`;for(let E=0;E<R.length;E++){const U=R[E];for(let F=0;F<U.tdList.length;F++){const Z=U.tdList[F],Q=document.createElement("div");Q.classList.add(`${st}-table-tool__border__row`),Q.style.width=`${Z.width*c}px`,Q.style.height=`${this.BORDER_VALUE}px`,Q.style.top=`${(Z.y+Z.height)*c-this.BORDER_VALUE/2}px`,Q.style.left=`${Z.x*c}px`,Q.onmousedown=K=>{this._mousedown({evt:K,element:a,index:Z.rowIndex+Z.rowspan-1,order:_e.ROW})},D.appendChild(Q);const W=document.createElement("div");if(W.classList.add(`${st}-table-tool__border__col`),W.style.width=`${this.BORDER_VALUE}px`,W.style.height=`${Z.height*c}px`,W.style.top=`${Z.y*c}px`,W.style.left=`${(Z.x+Z.width)*c-this.BORDER_VALUE/2}px`,W.onmousedown=K=>{this._mousedown({evt:K,element:a,index:Z.colIndex+Z.colspan-1,order:_e.COL})},D.appendChild(W),d&&Z.colIndex===0){const K=document.createElement("div");K.classList.add(`${st}-table-tool__border__col`),K.style.width=`${this.BORDER_VALUE}px`,K.style.height=`${Z.height*c}px`,K.style.top=`${Z.y*c}px`,K.style.left=`${Z.x*c-this.BORDER_VALUE/2}px`,K.onmousedown=k=>{this._mousedown({evt:k,element:a,index:0,isLeftStartBorder:!0,order:_e.COL})},D.appendChild(K)}}}this.container.append(D),this.toolBorderContainer=D}_setAnchorActive(t,e){const n=t.children;for(let i=0;i<n.length;i++){const l=n[i];i===e?l.classList.add("active"):l.classList.remove("active")}}_mousedown(t){const{evt:e,index:n,order:i,element:l,isLeftStartBorder:r}=t;this.canvas=this.draw.getPage();const{scale:a,table:{overflow:c}}=this.options,d=this.draw.getWidth(),u=this.draw.getHeight(),h=this.draw.getPageGap(),R=this.draw.getPageNo()*(u+h),T=this.position.getPositionContext(),C=(this.position.getOriginalPositionList()[T.index]?.coordinate?.leftTop?.[0]||0)*a,p=this.draw.getMargins(),I=p[0],m=p[1],L=I,O=d-m;this.mousedownX=e.x,this.mousedownY=e.y;const P=e.target,S=this.canvas.getBoundingClientRect(),y=window.getComputedStyle(P).cursor;document.body.style.cursor=y,this.canvas.style.cursor=y;let Y=0,b=0;const M=document.createElement("div");M.classList.add(`${st}-table-anchor__line`),i===_e.ROW?(M.classList.add(`${st}-table-anchor__line__row`),M.style.width=`${d}px`,Y=0,b=R+this.mousedownY-S.top):(M.classList.add(`${st}-table-anchor__line__col`),M.style.height=`${u}px`,Y=this.mousedownX-S.left,b=R),M.style.left=`${Y}px`,M.style.top=`${b}px`,this.container.append(M),this.anchorLine=M;let V=0,N=0;const X=D=>{const E=this._mousemove(D,i,Y,b);E&&(V=E.dx,N=E.dy)};document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{let D=!1;if(i===_e.ROW){const E=l.trList,U=E[n]||E[n-1],{defaultTrMinHeight:F}=this.options.table;N<0&&U.height+N<F&&(N=F-U.height),N&&(U.height+=N,U.minHeight=U.height,D=!0)}else{const{colgroup:E}=l;if(E&&V)if(c&&r){E[n].width-V/a<=this.MIN_TD_WIDTH&&(V=(E[n].width-this.MIN_TD_WIDTH)*a);const U=C+(l.translateX||0)*a;U+V<L&&(V=L-U),E[n].width-=V/a,l.width-=V/a,l.translateX=(l.translateX||0)+V/a,D=!0}else{const U=E[n].width;V<0&&U*a+V<this.MIN_TD_WIDTH*a&&(V=this.MIN_TD_WIDTH*a-U*a);const F=E[n+1]?.width;if(V>0&&F&&F*a-V<this.MIN_TD_WIDTH*a&&(V=F*a-this.MIN_TD_WIDTH*a),n===E.length-1){const Q=C+(l.translateX||0)*a+l.width*a;Q+V>O&&(V=O-Q)}V&&(E.length-1!==n&&(E[n+1].width-=V/a),E[n].width+=V/a,D=!0)}}D&&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 l=t.x-this.mousedownX,r=t.y-this.mousedownY;return e===_e.ROW?this.anchorLine.style.top=`${i+r}px`:this.anchorLine.style.left=`${n+l}px`,t.preventDefault(),{dx:l,dy:r}}}class Ad{draw;options;container;hyperlinkPopupContainer;hyperlinkDom;constructor(t){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(`${st}-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:l}=e,r=this.draw.getHeight(),a=this.draw.getPageGap(),c=this.draw.getPageNo()*(r+a);this.hyperlinkPopupContainer.style.display="block",this.hyperlinkPopupContainer.style.left=`${n}px`,this.hyperlinkPopupContainer.style.top=`${i+c+l}px`;const d=t.url||"#";this.hyperlinkDom.href=d,this.hyperlinkDom.title=d,this.hyperlinkDom.innerText=d}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 _d{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:l,label:{defaultBackgroundColor:r,defaultColor:a,defaultBorderRadius:c,defaultPadding:d}}=this.options,u=e.label?.backgroundColor||r,h=e.label?.color||a,R=e.label?.borderRadius||c,T=e.label?.padding||d;t.save(),t.font=e.style;const{width:g,height:f,boundingBoxAscent:C}=e.metrics;t.fillStyle=u,this._drawRoundedRect(t,n,i-C,g,f+(T[0]+T[3])*l,R*l),t.fill(),t.fillStyle=h,t.fillText(e.value,n+T[3]*l,i),t.restore()}_drawRoundedRect(t,e,n,i,l,r){t.beginPath(),t.moveTo(e+r,n),t.lineTo(e+i-r,n),t.quadraticCurveTo(e+i,n,e+i,n+r),t.lineTo(e+i,n+l-r),t.quadraticCurveTo(e+i,n+l,e+i-r,n+l),t.lineTo(e+r,n+l),t.quadraticCurveTo(e,n+l,e,n+l-r),t.lineTo(e,n+r),t.quadraticCurveTo(e,n,e+r,n),t.closePath()}}const Sn=/[\r\n\u200B]/;class Bd{options;draw;activeInlineEditor;constructor(t){this.draw=t,this.options=t.getOptions(),this.activeInlineEditor=null}render(t,e,n,i){const l=this.draw.getMode(),r=e.macroConfig;if(l===s.EditorMode.READONLY&&e.type!=="subTemplate"){this._renderPlainText(t,e,n,i,Wo(e));return}if(l===s.EditorMode.EDIT){const c=e.label||e.value||"";this._renderEditMode(t,e,n,i,c);return}if(e.type==="macro"){const c=e.label||"",d=e.value||`获取 ${c}`;this._renderPlainText(t,e,n,i,d);return}if(e.type==="customMacro"){const c=r?.type||"text",d=r?.value||"",u=e.label||"";if(l===s.EditorMode.FORM)c==="select"?this._renderSelectControl(t,e,n,i,d):this._renderTextControl(t,e,n,i,d);else{const h=d||`获取 ${u}`;this._renderPlainText(t,e,n,i,h)}return}if(e.type==="reusableItem"){const d=e.reusableItemConfig?.value||"",u=e.label||"";if(l===s.EditorMode.FORM)this._renderTextControl(t,e,n,i,d);else{const h=d||`获取 ${u}`;this._renderPlainText(t,e,n,i,h)}return}if(e.type==="subTemplate"){const c=e.label||"子模板";l===s.EditorMode.FORM?e.subTemplateExpanded||this._renderEditMode(t,e,n,i,c):this._renderPlainText(t,e,n,i,c);return}const a=e.value||e.label||"";this._renderPlainText(t,e,n,i,a)}activateInlineEditor(t,e,n){const i=t.type===s.ElementType.CUSTOM_MACRO,l=t.type===s.ElementType.REUSABLE_ITEM;if(this.draw.getMode()!==s.EditorMode.FORM||!i&&!l)return!1;const r=i?this._ensureMacroConfig(t):void 0,a=r?.type||"text",c=this.activeInlineEditor;if(c&&c.elementId===t.id&&c.elementType===t.type&&(t.id||c.index===e)&&c.type===a){if(a==="text"){const T=this._getCursorOffset(t,e,n);c.cursorOffset=T,c.selectionOffset=T,this._syncInlineCursor()}return this._focusInputAgent(),!0}this.clearInlineEditor();const d=T=>{const g=T.target,f=this.activeInlineEditor?.popup;g instanceof Node&&f?.contains(g)||g!==this.draw.getCursor().getAgentDom()&&this.clearInlineEditor()},u=this._getCursorOffset(t,e,n),h=this.draw.getPosition(),R=h.getPositionList()[e];return this.draw.getRange().setRange(e,e),R&&h.setCursorPosition(R),this.activeInlineEditor={elementId:t.id,index:e,elementType:t.type,type:a,popup:null,cursorOffset:u,selectionOffset:u,compositionRange:null,initialValue:this._getInlineEditorValue(t),initialCode:r?.code,initialUnderline:t.underline,initialStrikeout:t.strikeout,initialTextDecoration:t.textDecoration?{...t.textDecoration}:void 0,outsideHandler:d},window.setTimeout(()=>{this.activeInlineEditor?.outsideHandler===d&&document.addEventListener("mousedown",d,!0)}),a==="select"?(this._createSelectPopup(t),this.draw.getCursor().recoveryCursor()):this._syncInlineCursor(),this._focusInputAgent(),!0}input(t,e=!1){const n=this.activeInlineEditor;if(!n||n.type!=="text"||!t)return!1;const i=t.replace(/\r\n?/g,`
116
+ `)}}return r}return i(n)}function Zi(o){return pi(o,["metrics","style"])}function _n(o){return!!o?.type&&(Ya.includes(o.type)||o.imgDisplay===s.ImageDisplay.INLINE)}function bc(o,t){const e=document.createElement(t);for(let n=0;n<o.attributes.length;n++){const i=o.attributes[n];e.setAttribute(i.name,i.value)}return e.innerHTML=o.innerHTML,e}function Qi(o){const t=[];for(let e=0;e<o.length;e++){const n=o[e];n?.imgDisplay===s.ImageDisplay.SURROUND&&t.push(n)}return t}function Vc(o,t){for(let e=o.length-1;e>=0;e--)o[e].imgFloatPosition?.pageNo===t&&o.splice(e,1)}function ae(o){return o?!!(o.hide||o.control?.hide||o.area?.hide):!0}function Bn(o,t,e=s.LocationPosition.BEFORE){if(!ae(o[t]))return t;let n=t;if(e===s.LocationPosition.BEFORE)for(n=t-1;n>0;){if(!ae(o[n]))return n;n--}else for(n=t+1;n<o.length;){if(!ae(o[n]))return n;n++}return n}const Tr=`${so}-control`;function fr(o){localStorage.setItem(so,JSON.stringify({text:o.text,elementList:o.elementList}))}function mr(){const o=localStorage.getItem(so);return o?JSON.parse(o):null}function Cr(){localStorage.removeItem(so)}function Wc(o){localStorage.setItem(Tr,JSON.stringify(o))}function pr(){const o=localStorage.getItem(Tr);return o?JSON.parse(o):null}function Uc(){return!!pr()?.element}async function Yc(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 l=new ClipboardItem({[n.type]:n,[i.type]:i});await window.navigator.clipboard.write([l])}else{const l=document.createElement("div");l.setAttribute("contenteditable","true"),l.innerHTML=t,document.body.append(l);const r=window.getSelection(),a=document.createRange(),c=document.createElement("span");c.innerText=`
117
+ `,l.append(c),a.selectNodeContents(l),r?.removeAllRanges(),r?.addRange(a),document.execCommand("copy"),l.remove()}fr({text:o,elementList:e})}async function wc(o){if(!o)return;const t=[{value:o}],e=()=>{const n=document.createElement("textarea");n.value=o,n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy"),n.remove()};if(window.navigator.clipboard?.writeText)try{await window.navigator.clipboard.writeText(o)}catch{e()}else e();fr({text:o,elementList:t})}async function Ir(o,t){const e=Hn(o,t);document.body.append(e);const n=e.innerText;e.remove();const i=e.innerHTML;!n&&!i&&!o.length||await Yc(n,i,Ut(o))}function vc(o){let t=!1;for(let e=0;e<o.items.length;e++)if(o.items[e].kind==="file"){t=!0;break}return t}function Ki(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled()||e.getControl().getIsDisabledPasteControl())return;const n=e.getRange(),{startIndex:i}=n.getRange(),l=e.getElementList();if(~i&&!n.getIsSelectAll()){const r=l[i];if(r?.titleId||r?.listId){let a=0;for(;a<t.length;){const c=t[a];if(r.titleId&&/^\n/.test(c.value))break;if(va.includes(c.type)){if(t.splice(a,1),c.valueList)for(let d=0;d<c.valueList.length;d++){const u=c.valueList[d];u.value===_||u.value===`
118
+ `||(t.splice(a,0,u),a++)}a--}a++}}le(l,t,i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()})}e.insertElementList(t)}function Er(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=An(t,{innerWidth:e.getOriginalInnerWidth()});Ki(o,n)}function Hi(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const n=e.getRange(),{startIndex:i}=n.getRange(),l=e.getElementList(),r=new FileReader;r.readAsDataURL(t),r.onload=()=>{const a=new Image,c=r.result;a.src=c,a.onload=()=>{const d={value:c,type:s.ElementType.IMAGE,width:a.width,height:a.height};~i&&le(l,[d],i,{editorOptions:e.getOptions()}),e.insertElementList([d])}}}function Zc(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&&i(t)?.preventDefault!==!1)return;if(!vc(n)){const r=n.getData("text"),a=mr();if(a&&So(r)===So(a.text)){Ki(o,a.elementList);return}}Cr();let l=!1;for(let r=0;r<n.items.length;r++)if(n.items[r].type==="text/html"){l=!0;break}for(let r=0;r<n.items.length;r++){const a=n.items[r];if(a.kind==="string"){if(a.type==="text/plain"&&!l){a.getAsString(c=>{o.input(c)});break}if(a.type==="text/html"&&l){a.getAsString(c=>{Er(o,c)});break}}else if(a.kind==="file"&&a.type.includes("image")){const c=a.getAsFile();c&&Hi(o,c)}}}async function Qc(o,t){const e=o.getDraw();if(e.isReadonly()||e.isDisabled())return;const{paste:n}=e.getOverride();if(n&&n()?.preventDefault!==!1)return;const i=await navigator.clipboard.readText(),l=mr();if(l&&So(i)===So(l.text)){Ki(o,l.elementList);return}if(Cr(),t?.isPlainText)i&&o.input(i);else{const r=await navigator.clipboard.read();let a=!1;for(const c of r)if(c.types.includes("text/html")){a=!0;break}for(const c of r)if(c.types.includes("text/plain")&&!a){const u=await(await c.getType("text/plain")).text();u&&o.input(u)}else if(c.types.includes("text/html")&&a){const u=await(await c.getType("text/html")).text();u&&Er(o,u)}else if(c.types.some(d=>d.startsWith("image/"))){const d=c.types.find(h=>h.startsWith("image/")),u=await c.getType(d);Hi(o,u)}}}class Kc{draw;container;agentCursorDom;canvasEvent;eventBus;constructor(t,e){this.draw=t,this.container=t.getContainer(),this.canvasEvent=e,this.eventBus=t.getEventBus();const n=document.createElement("textarea");n.autocomplete="off",n.classList.add(`${st}-inputarea`),n.innerText="",this.container.append(n),this.agentCursorDom=n,n.onkeydown=i=>this._keyDown(i),n.oninput=this._input.bind(this),n.onpaste=i=>this._paste(i),n.addEventListener("compositionstart",this._compositionstart.bind(this)),n.addEventListener("compositionupdate",this._compositionupdate.bind(this)),n.addEventListener("compositionend",this._compositionend.bind(this)),n.addEventListener("keydown",this._keydown.bind(this)),this.eventBus.on("rangeStyleChange",i=>{this.agentCursorDom.style.fontSize=Math.max(i.size,18)+"px"})}getAgentCursorDom(){return this.agentCursorDom}_keyDown(t){this.draw.isInteractionSuspended()||this.canvasEvent.keydown(t)}_input(t){if(this.draw.isInteractionSuspended())return;const e=t.data;e&&this.canvasEvent.input(e),this.eventBus.isSubscribe("input")&&this.eventBus.emit("input",t)}_paste(t){this.draw.isInteractionSuspended()||(this.draw.flushPendingRender(),this.draw.isReadonly())||!t.clipboardData||(Zc(this.canvasEvent,t),t.preventDefault())}_compositionstart(){this.draw.isInteractionSuspended()||(this.agentCursorDom.style.zIndex="1000",this.agentCursorDom.style.width="0px",this.agentCursorDom.style.color="#000",this.agentCursorDom.style.background="#fff",this.canvasEvent.compositionstart())}_compositionupdate(){if(this.draw.isInteractionSuspended())return;this.agentCursorDom.style.width="9999px";let t=this.agentCursorDom.scrollWidth;const e=this.container.clientWidth,n=Math.max(e-this.agentCursorDom.offsetLeft,100);t>n&&(t=n),this.agentCursorDom.style.width=t+"px"}_compositionend(t){this.draw.isInteractionSuspended()||(this.agentCursorDom.style.zIndex="-1",this.agentCursorDom.style.width="0px",this.agentCursorDom.style.color="",this.agentCursorDom.style.background="",this.canvasEvent.compositionend(t))}_keydown(t){this.draw.isInteractionSuspended()||this.canvasEvent.isComposing&&t.code==="Escape"&&this.canvasEvent.compositionCancel()}}class Hc{ANIMATION_CLASS=`${st}-cursor--animation`;draw;container;options;position;cursorDom;cursorAgent;blinkTimeout;focusTimeout;visibilityFrameId;hitLineStartIndex;constructor(t,e){this.draw=t,this.container=t.getContainer(),this.position=t.getPosition(),this.options=t.getOptions(),this.cursorDom=document.createElement("div"),this.cursorDom.classList.add(`${st}-cursor`),this.container.append(this.cursorDom),this.cursorAgent=new Kc(t,e),this.blinkTimeout=null,this.focusTimeout=null,this.visibilityFrameId=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=""}getHitLineStartIndex(){return this.hitLineStartIndex}_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(){if(this.draw.isInteractionSuspended()||ya&&this.draw.isReadonly())return;const t=this.cursorAgent.getAgentCursorDom();document.activeElement!==t&&(t.focus(),t.setSelectionRange(0,0))}_clearFocusTimeout(){this.focusTimeout!==null&&(window.clearTimeout(this.focusTimeout),this.focusTimeout=null)}requestFocus(){this._clearFocusTimeout(),this.focusTimeout=window.setTimeout(()=>{this.focusTimeout=null,this.focus()})}_clearVisibilityFrame(){this.visibilityFrameId!==null&&(window.cancelAnimationFrame(this.visibilityFrameId),this.visibilityFrameId=null)}cancelPendingVisibilityCheck(){this._clearVisibilityFrame()}drawCursor(t){if(this.draw.isInteractionSuspended()){this.recoveryCursor();return}let e=this.position.getCursorPosition();if(!e)return;const{scale:n,cursor:i}=this.options,{color:l,width:r,isShow:a=!0,isBlink:c=!0,isFocus:d=!0,hitLineStartIndex:u}={...i,...t},h=this.draw.getHeight(),R=this.draw.getPageGap();this.hitLineStartIndex=u,u&&(e=this.position.getPositionList()[u]);const{metrics:T,coordinate:{leftTop:g,rightTop:f},ascent:C,pageNo:p}=e,L=(this.draw.getZone().isMainActive()?p:this.draw.getPageNo())*(h+R),O=Js*n,P=Math.min(T.height/4,O),S=T.height+P*2,y=this.cursorAgent.getAgentCursorDom();this._clearFocusTimeout(),d&&document.activeElement!==y&&this.requestFocus();const Y=T.boundingBoxDescent<0?0:T.boundingBoxDescent,b=g[1]+C+Y-(S-P)+L,M=u?g[0]:f[0];if(y.style.left=`${M}px`,y.style.top=`${b+S-O}px`,!a){this.recoveryCursor();return}const V=this.cursorDom.style.top,N=this.draw.isReadonly();this.cursorDom.style.width=`${r*n}px`,this.cursorDom.style.backgroundColor=l,this.cursorDom.style.left=`${M}px`,this.cursorDom.style.top=`${b}px`,this.cursorDom.style.display=N?"none":"block",this.cursorDom.style.height=`${S}px`,c?this._setBlinkTimeout():this._clearBlinkTimeout(),this._clearVisibilityFrame(),this.visibilityFrameId=window.requestAnimationFrame(()=>{this.visibilityFrameId=null,this.moveCursorToVisible({cursorPosition:e,direction:parseInt(V)>b?zt.UP:zt.DOWN})})}recoveryCursor(){this.cursorDom.style.display="none",this._clearBlinkTimeout(),this._clearFocusTimeout(),this._clearVisibilityFrame()}moveCursorToVisible(t){const{cursorPosition:e,direction:n}=t;if(!e||!n)return;const{pageNo:i,coordinate:{leftTop:l,leftBottom:r}}=e,a=Ma(this.container),c={left:0,right:0,top:0,bottom:0},d=a===document.documentElement;if(d)c.right=window.innerWidth,c.bottom=window.innerHeight;else{const{left:f,right:C,top:p,bottom:I}=a.getBoundingClientRect();c.left=f,c.right=C,c.top=p,c.bottom=I}const u=i*(this.draw.getHeight()+this.draw.getPageGap())+this.container.getBoundingClientRect().top,h=n===zt.UP,R=r[0]+(d?0:c.left),T=h?l[1]+u:r[1]+u,{maskMargin:g}=this.options;if(c.top+=g[0],c.bottom-=g[2],!(R>=c.left&&R<=c.right&&T>=c.top&&T<=c.bottom)){const{scrollLeft:f,scrollTop:C}=a;h?a.scroll(f,C-(c.top-T)):a.scroll(f,C+T-c.bottom)}}}var Mn;(function(o){o[o.LEFT=0]="LEFT",o[o.CENTER=1]="CENTER",o[o.RIGHT=2]="RIGHT"})(Mn||(Mn={}));function Ae(o){return pn?o.metaKey:o.ctrlKey}s.KeyMap=void 0,(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"})(s.KeyMap||(s.KeyMap={}));class wo{element;control;constructor(t,e){this.element=t,this.control=e}setElement(t){this.element=t}getElement(){return this.element}getCode(){return this.element.control?.code||null}getValue(){const t=this.control.getElementList(),{startIndex:e}=this.control.getRange(),n=t[e],i=[];let l=e;for(;l>0;){const a=t[l];if(a.controlId!==n.controlId||a.controlComponent===s.ControlComponent.PREFIX||a.controlComponent===s.ControlComponent.PRE_TEXT)break;a.controlComponent===s.ControlComponent.VALUE&&i.unshift(a),l--}let r=e+1;for(;r<t.length;){const a=t[r];if(a.controlId!==n.controlId||a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT)break;a.controlComponent===s.ControlComponent.VALUE&&i.push(a),r++}return i}setValue(){return-1}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const{control:i}=this.element,l=e.elementList||this.control.getElementList(),{startIndex:r}=e.range||this.control.getRange(),a=l[r];let c=r;for(;c>0;){const u=l[c];if(u.controlId!==a.controlId||u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT)break;if(u.controlComponent===s.ControlComponent.CHECKBOX){const h=u.checkbox;h.value=t.includes(h.code)}c--}let d=r+1;for(;d<l.length;){const u=l[d];if(u.controlId!==a.controlId||u.controlComponent===s.ControlComponent.POSTFIX||u.controlComponent===s.ControlComponent.POST_TEXT)break;if(u.controlComponent===s.ControlComponent.CHECKBOX){const h=u.checkbox;h.value=t.includes(h.code)}d++}i.code=t.join(","),this.control.repaintControl({curIndex:r,isSetCursor:!1}),this.control.emitControlContentChange({context:e})}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getRange();this.control.shrinkBoundary();const{startIndex:n,endIndex:i}=e;return t.key===s.KeyMap.Backspace||t.key===s.KeyMap.Delete?this.control.removeControl(n):i}cut(){return-1}}class Ai extends wo{setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const{control:i}=this.element,l=e.elementList||this.control.getElementList(),{startIndex:r}=e.range||this.control.getRange(),a=l[r];let c=r;for(;c>0;){const u=l[c];if(u.controlId!==a.controlId||u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT)break;if(u.controlComponent===s.ControlComponent.RADIO){const h=u.radio;h.value=t.includes(h.code)}c--}let d=r+1;for(;d<l.length;){const u=l[d];if(u.controlId!==a.controlId||u.controlComponent===s.ControlComponent.POSTFIX||u.controlComponent===s.ControlComponent.POST_TEXT)break;if(u.controlComponent===s.ControlComponent.RADIO){const h=u.radio;h.value=t.includes(h.code)}d++}i.code=t.join(","),this.control.repaintControl({curIndex:r,isSetCursor:!1}),this.control.emitControlContentChange({context:e})}}function _i(o,t){const e=o[t]?.subTemplateParentId;if(!e)return-1;for(let n=t-1;n>=0;n--){const i=o[n];if(i.type===s.ElementType.SUB_TEMPLATE&&i.id===e)return n}return-1}function vo(o,t,e){const n=o[t];if(!n?.subTemplateParentId||!(e==="leading"?new Set([s.ControlComponent.PREFIX,s.ControlComponent.PRE_TEXT,s.ControlComponent.PRETEXTFIX,s.ControlComponent.PRETEXTFIX_TEXT]):new Set([s.ControlComponent.POSTFIX,s.ControlComponent.POST_TEXT,s.ControlComponent.POSTTEXTFIX,s.ControlComponent.POSTTEXTFIX_TEXT])).has(n.controlComponent))return-1;const l=_i(o,t);if(l===-1)return-1;const r=o[l];let a=r.control?.type;for(let d=l-1;d>=0&&!a;d--){const u=o[d];u.controlId===r.controlId&&(u.originControlId||null)===(r.originControlId||null)&&(a=u.control?.type)}return!!(r.controlId&&r.controlComponent===s.ControlComponent.VALUE&&n.controlId&&(a===s.ControlType.TEXT||a===s.ControlType.TEXTFIELD))?l:-1}function On(o,t,e){const n=o[t];if(n?.type!==s.ElementType.SUB_TEMPLATE)return null;const i=n.controlId?{controlId:n.controlId,originControlId:n.originControlId||null,subTemplateParentId:n.subTemplateParentId||null}:null,l=e.getSubTemplateRuntimeEndIndex(o,t,n.id);if(e.spliceElementList(o,t,l-t),i){const r=a=>a.controlId===i.controlId&&(a.originControlId||null)===i.originControlId&&(a.subTemplateParentId||null)===i.subTemplateParentId;for(let a=Math.min(t-1,o.length-1);a>=0;a--){const c=o[a];if(r(c)&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)){e.getControl().addPlaceholder(a,{elementList:o});break}}}return Math.max(0,t-1)}function Lr(o){const t=o.getDraw(),e=t.getPosition(),n=t.getRange();o.isAllowDrag=!0,o.cacheRange=rt(n.getRange()),o.cacheElementList=t.getElementList(),o.cachePositionList=e.getPositionList(),o.cachePositionContext=e.getPositionContext()}function Pr(o,t){const{checkbox:e,control:n}=o;if(!n)t.getCheckboxParticle().setSelect(o);else{const i=n?.code?n.code.split(","):[];if(e?.value){const r=i.findIndex(a=>a===e.code);i.splice(r,1)}else e?.code&&i.push(e.code);const l=t.getControl().getActiveControl();l instanceof wo&&l.setSelect(i)}}function Mr(o,t){const{radio:e,control:n}=o;if(!n)t.getRadioParticle().setSelect(o);else{const i=e?.code?[e.code]:[],l=t.getControl().getActiveControl();l instanceof Ai&&l.setSelect(i)}}function Ac(o,t){const e=t.getDraw();let n=e.isReadonly();const i=e.isSelectionDisabled(),l=e.getRange(),r=e.getPosition(),a=l.getRange();if(o.button===Mn.RIGHT&&(a.isCrossRowCol||!l.getIsCollapsed()))return;const d=o.target.dataset.index;if(d&&e.setPageNo(Number(d)),!t.isAllowDrag&&!n&&a.startIndex!==a.endIndex&&l.getIsPointInRange(o.offsetX,o.offsetY,e.getPageNo())){Lr(t);return}t.isAllowSelection=!i;const u=rt(r.getPositionContext()),h=r.getPositionByXY({x:o.offsetX,y:o.offsetY}),R=r.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!R)return;const{index:T,isDirectHit:g,isCheckbox:f,isRadio:C,isControl:p,isImage:I,isLabel:m,isMacro:L,isTable:O,tdValueIndex:P,hitLineStartIndex:S}=R;t.mouseDownStartPosition={...R,index:O?P:T,originalIndex:T,x:o.offsetX,y:o.offsetY};const y=e.getElementList(),Y=r.getPositionList(),b=O?P:T;let M;O?M=e.getTd().value[P]:M=y[b];const V=O&&e.getTd()?.value||y,N=O&&e.getTd()?.positionList||Y,X=!!(g&&I),D=!!(g&&f),E=!!(g&&C),U=!!(g&&m),F=!!(g&&L),Z=w=>w&&(w.type===s.ElementType.MACRO||w.type===s.ElementType.CUSTOM_MACRO||w.type===s.ElementType.REUSABLE_ITEM||w.type===s.ElementType.SUB_TEMPLATE||w.type===s.ElementType.MENSTRUAL_HISTORY||w.type===s.ElementType.FETAL_HEART_POSITION||w.type===s.ElementType.TOOTH_POSITION||w.type===s.ElementType.LIST||w.type===s.ElementType.SPECIAL_SYMBOLS),Q=w=>w&&!!w.originControlId&&!!w.controlId,W=w=>!!(w&&w.originControlId&&w.controlId&&(w.controlComponent===s.ControlComponent.POSTFIX||w.controlComponent===s.ControlComponent.POSTTEXTFIX||w.controlComponent===s.ControlComponent.POST_TEXT||w.controlComponent===s.ControlComponent.PLACEHOLDER)),K=w=>!!(w&&w.originControlId&&w.controlId&&(w.controlComponent===s.ControlComponent.PREFIX||w.controlComponent===s.ControlComponent.PRE_TEXT||w.controlComponent===s.ControlComponent.PRETEXTFIX||w.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||w.controlComponent===s.ControlComponent.PLACEHOLDER)),k=w=>{if(!w)return null;const x=new Set;let ot=w,Rt=null;for(;ot&&!x.has(ot);){x.add(ot);let It;for(let $t=0;$t<y.length;$t++){const Zt=y[$t];if(Zt.controlId===ot&&Zt.control?.type&&(It=Zt,Zt.controlComponent===s.ControlComponent.PREFIX||Zt.controlComponent===s.ControlComponent.PRE_TEXT||Zt.controlComponent===s.ControlComponent.PRETEXTFIX||Zt.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT))break}if(!It)break;It.control?.type===s.ControlType.TEXT&&(Rt=ot),ot=It.originControlId||null}return Rt},B=e.getMode()===s.EditorMode.FORM,H=B&&M?.control?.type===s.ControlType.TEXT,A=B&&!H?e.getControl().getActiveTextControlLimit():null;let v=b;const ct=(w,x)=>!!w&&!!x&&w.controlId===x,bt=(w,x,ot)=>{if(ot){for(let Rt=x;Rt>=0;Rt--){const It=w[Rt];if(ct(It,ot)&&!It.originControlId&&It.control?.type)return It.control.type;if(It.controlId&&It.controlId!==ot&&It.originControlId!==ot)break}for(let Rt=x+1;Rt<w.length;Rt++){const It=w[Rt];if(ct(It,ot)&&!It.originControlId&&It.control?.type)return It.control.type;if(It.controlId&&It.controlId!==ot&&It.originControlId!==ot)break}}},Qt=(w,x)=>!!(B&&w?.controlId&&!w.originControlId&&bt(V,x,w.controlId)===s.ControlType.TEXTFIELD),me=(w,x)=>!!(B&&w?.controlId&&!w.originControlId&&(bt(V,x,w.controlId)===s.ControlType.TEXT||bt(V,x,w.controlId)===s.ControlType.NUMBER)),Gt=N[b],Re=V[b-1],nt=V[b+1],z=6,G=[s.ControlType.SELECT,s.ControlType.DATE,s.ControlType.BUTTON],J=(w,x)=>kt(w,x),it=(w,x)=>{if(w?.control?.type)return w.control.type;if(w?.controlId){for(let ot=x;ot>=0;ot--){const Rt=V[ot];if(!J(w,Rt))break;if(Rt.control?.type)return Rt.control.type}for(let ot=x+1;ot<V.length;ot++){const Rt=V[ot];if(!J(w,Rt))break;if(Rt.control?.type)return Rt.control.type}}},q=(w,x)=>{const ot=it(w,x);return!!(ot&&G.includes(ot))},ut=w=>!!(w&&(w.controlComponent===s.ControlComponent.POSTFIX||w.controlComponent===s.ControlComponent.POST_TEXT||w.controlComponent===s.ControlComponent.POSTTEXTFIX||w.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)),gt=w=>!!(w&&(w.controlComponent===s.ControlComponent.PREFIX||w.controlComponent===s.ControlComponent.PRE_TEXT||w.controlComponent===s.ControlComponent.PRETEXTFIX||w.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)),Ot=(w,x)=>{if(!w?.controlId)return-1;for(let ot=x;ot>=0;ot--){const Rt=V[ot];if(!J(w,Rt))break;if(Rt.controlComponent===s.ControlComponent.VALUE)return ot}for(let ot=x+1;ot<V.length;ot++){const Rt=V[ot];if(!J(w,Rt))break;if(Rt.controlComponent===s.ControlComponent.VALUE)return ot}return-1},Et=(w,x)=>{if(!w)return!1;if(w.controlComponent===s.ControlComponent.VALUE||w.controlComponent===s.ControlComponent.PLACEHOLDER)return!0;const ot=it(w,x),Rt=ot===s.ControlType.SELECT||ot===s.ControlType.DATE,It=w.controlComponent===s.ControlComponent.PRE_TEXT||w.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||w.controlComponent===s.ControlComponent.TEXTFIXLABEL;return!!(Rt&&It&&w.value&&Ot(w,x)===-1)},yt=w=>{const x=N[w];if(!x)return!1;const{coordinate:{leftTop:ot,rightTop:Rt,leftBottom:It}}=x;return o.offsetX>=ot[0]&&o.offsetX<Rt[0]&&o.offsetY>=ot[1]&&o.offsetY<=It[1]},Mt=(w,x)=>{if(e.getMode()!==s.EditorMode.EDIT||!w?.originControlId||w.controlComponent!==s.ControlComponent.VALUE||it(w,x)!==s.ControlType.BUTTON||w.control?.buttonText||bt(V,x,w.originControlId)!==s.ControlType.TEXTFIELD||!yt(x))return!1;let ot=-1;for(let Wn=x;Wn<V.length;Wn++){const Mo=V[Wn];if(!J(w,Mo))break;const $e=N[Wn];Mo.controlComponent===s.ControlComponent.VALUE&&$e&&$e.coordinate.rightTop[0]>$e.coordinate.leftTop[0]&&(ot=Wn)}if(ot===-1)return!1;const Rt=N[ot],{coordinate:{leftTop:It,rightTop:$t,leftBottom:Zt}}=Rt;return o.offsetX>=It[0]-2&&o.offsetX<=$t[0]&&o.offsetY>=It[1]&&o.offsetY<=Zt[1]},Ft=(w,x)=>!(!g||!q(w,x)||!yt(x)||Mt(w,x)||!Et(w,x)||ut(w)||gt(w)&&!w?.value),Vt=()=>[h.isTable?h.tdValueIndex:h.index,b,b+1,b-1,b+2,b-2].filter((x,ot,Rt)=>typeof x=="number"&&x>=0&&x<V.length&&Rt.indexOf(x)===ot),Bt=()=>{if(!g)return null;for(const w of Vt()){const x=V[w];if(Ft(x,w))return{element:x,index:w}}return null},pt=()=>{if(!g)return-1;for(const w of Vt())if(Mt(V[w],w))return w;return-1},ht=w=>{const x=V[w];let ot=w;for(let Rt=w+1;Rt<V.length&&J(x,V[Rt]);Rt++)ot=Rt;return ot},Lt=w=>{const x=V[w];if(!fe(x)||it(x,w)!==s.ControlType.BUTTON||x.control?.buttonText||x.control?.editable===!1)return w;let ot=w;for(let Rt=w+1;Rt<V.length;Rt++){const It=V[Rt];if(!J(x,It)||!fe(It))break;ot=Rt}return ot},Ct=Vt().some(w=>q(V[w],w)),St=Bt(),Kt=pt(),ge=w=>(w?.control?.type===s.ControlType.TEXTFIELD||w?.control?.type===s.ControlType.TEXT)&&(w.controlComponent===s.ControlComponent.POSTFIX||w.controlComponent===s.ControlComponent.POST_TEXT||w.controlComponent===s.ControlComponent.POSTTEXTFIX||w.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT),Tt=w=>w?.type===s.ElementType.CONTROL&&(w.controlComponent===s.ControlComponent.POSTFIX||w.controlComponent===s.ControlComponent.POST_TEXT||w.controlComponent===s.ControlComponent.POSTTEXTFIX||w.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT),tt=w=>w?.type===s.ElementType.CONTROL&&(w.controlComponent===s.ControlComponent.PREFIX||w.controlComponent===s.ControlComponent.PRE_TEXT||w.controlComponent===s.ControlComponent.PRETEXTFIX||w.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT),Dt=(w,x)=>!!(e.getMode()===s.EditorMode.EDIT&&w?.originControlId&&ge(w)&&x?.controlId===w.originControlId&&!x.originControlId&&x.control?.type===s.ControlType.TEXTFIELD&&ge(x)),vt=(w,x)=>!!(e.getMode()===s.EditorMode.EDIT&&w?.originControlId&&ge(w)&&x?.controlId===w.originControlId&&!x.originControlId&&x.control?.type===s.ControlType.TEXTFIELD&&x.controlComponent===s.ControlComponent.VALUE),jt=(w,x,ot)=>!!(e.getMode()===s.EditorMode.EDIT&&w?.originControlId&&ot?.originControlId===w.originControlId&&w.controlId&&ot.controlId&&w.controlId!==ot.controlId&&Tt(w)&&tt(ot)&&bt(V,x,w.originControlId)===s.ControlType.TEXTFIELD),at=Dt(M,nt),Pt=vt(M,nt),et=jt(M,b,nt),$=jt(Re,b-1,M),ne=!!(M?.subTemplateParentId&&Tt(M)&&nt?.subTemplateParentId!==M.subTemplateParentId&&vo(V,b,"trailing")!==-1),qt=!!(e.getMode()===s.EditorMode.EDIT&&p&&g&&ge(M)&&!at&&!Pt&&!et&&Re?.controlId===M.controlId&&(Re.originControlId||null)===(M.originControlId||null)&&(Re.controlComponent===s.ControlComponent.VALUE||Re.controlComponent===s.ControlComponent.PLACEHOLDER)),Ie=!!(B&&!ne&&me(M,b)&&Tt(M)&&Gt&&o.offsetX>=Gt.coordinate.leftTop[0]),_t=(w,x,ot)=>!!(B&&W(w)&&bt(V,x,w?.originControlId)===ot&&(ot===s.ControlType.TEXTFIELD?Qt(V[x+1],x+1):me(V[x+1],x+1))),te=(w,x,ot)=>!!(B&&K(w)&&bt(V,x,w?.originControlId)===ot&&(ot===s.ControlType.TEXTFIELD?Qt(V[x-1],x-1):me(V[x-1],x-1))),Vn=_t(M,b,s.ControlType.TEXTFIELD),mn=!!(B&&Gt&&Qt(M,b)&&_t(Re,b-1,s.ControlType.TEXTFIELD)&&o.offsetX<=Gt.coordinate.leftTop[0]+z),Me=!!(B&&Gt&&Qt(M,b)&&te(nt,b+1,s.ControlType.TEXTFIELD)&&o.offsetX>=Gt.coordinate.rightTop[0]-z),we=!!(B&&Gt&&Vn&&o.offsetX>Gt.coordinate.rightTop[0]),Rm=!!(B&&Gt&&K(M)&&bt(V,b,M.originControlId)===s.ControlType.TEXTFIELD&&Qt(Re,b-1)&&o.offsetX<Gt.coordinate.leftTop[0]),gm=Qt(M,b)||Vn||mn||Me||we||Rm,Tm=_t(M,b,s.ControlType.TEXT),ea=w=>{const x=V[w],ot=Y[w];if(!ot||!me(x,w))return-1;const Rt=V[w-1];return!_t(Rt,w-1,s.ControlType.TEXT)||o.offsetX>ot.coordinate.leftTop[0]+z?-1:w-1},ws=ea(b),na=ea(b-1),oa=ws!==-1||na!==-1,ia=!!(B&&Gt&&K(M)&&bt(V,b,M.originControlId)===s.ControlType.TEXT&&me(Re,b-1)&&o.offsetX<Gt.coordinate.leftTop[0]),fm=!!(B&&Gt&&me(M,b)&&te(nt,b+1,s.ControlType.TEXT)&&o.offsetX>=Gt.coordinate.rightTop[0]-z),mm=Tm||oa||ia||fm;if(at||Pt||et?v=b:$||qt||Ie?v=Math.max(b-1,0):oa?v=ws!==-1?ws:na:ia&&(v=Math.max(b-1,0)),St){v=Lt(St.index);const w=r.getPositionContext();r.setPositionContext({...w,index:w.isTable?w.index:v,isControl:!0,isDirectHit:!0})}else Kt!==-1?v=ht(Kt):q(M,b)&&Gt&&!yt(b)&&o.offsetX>Gt.coordinate.rightTop[0]&&(v=ht(b));let sa=!1;if(B&&A?.parentControlId&&M?.controlId===A.parentControlId&&!M?.originControlId)for(let w=b;w>=0;w--){const x=y[w];if(ct(x,A.parentControlId)){x.control?.type===s.ControlType.TEXTFIELD&&(sa=!0);break}if(x.controlId!==A.parentControlId)break}const ra=!!(A&&(!M?.controlId||M.controlId===A.controlId&&(M.originControlId||null)===A.originControlId&&(M.subTemplateInstanceId||M.subTemplateParentId||null)===A.subTemplateInstanceId||A.parentControlId&&M.controlId===A.parentControlId&&!M.originControlId&&sa));if(B&&!H&&(M?.controlId||M?.originControlId)){let w;const x=M.originControlId||M.controlId;for(let ot=b;ot>=0;ot--){const Rt=y[ot];if(ct(Rt,x)&&Rt.control?.type){w=Rt.control.type;break}if(Rt.controlId!==M.controlId&&Rt.controlId!==x)break}if(w!==s.ControlType.TEXT){if(w===s.ControlType.TEXTFIELD){const ot=M.controlComponent;if(!Q(M)){if(!(M.controlComponent===s.ControlComponent.VALUE&&Z(M))){if(ot===s.ControlComponent.PRETEXTFIX||ot===s.ControlComponent.PRETEXTFIX_TEXT||ot===s.ControlComponent.POSTTEXTFIX||ot===s.ControlComponent.POSTTEXTFIX_TEXT||ot===s.ControlComponent.TEXTFIXLABEL||ot===s.ControlComponent.PREFIX||ot===s.ControlComponent.POSTFIX||ot===s.ControlComponent.PRE_TEXT||ot===s.ControlComponent.POST_TEXT||ot===s.ControlComponent.PLACEHOLDER)for(let Rt=b+1;Rt<y.length;Rt++){const It=y[Rt];if(It.controlId!==x&&It.originControlId!==x)break;if(It.controlComponent===s.ControlComponent.VALUE&&!Z(It)){v=Rt;break}if(It.controlComponent===s.ControlComponent.POSTTEXTFIX||It.controlComponent===s.ControlComponent.POSTFIX){for(let $t=b-1;$t>=0;$t--){const Zt=y[$t];if(Zt.controlId!==x&&Zt.originControlId!==x)break;if(Zt.controlComponent===s.ControlComponent.VALUE&&!Z(Zt)){v=$t;break}}break}}else if(ot===s.ControlComponent.VALUE&&b>0){const Rt=y[b-1];if(Rt&&(Rt.controlId===x||Rt.originControlId===x)&&Rt.controlComponent===s.ControlComponent.VALUE&&Z(Rt)){let It=!1;for(let $t=b-2;$t>=0;$t--){const Zt=y[$t];if(Zt.controlId!==x&&Zt.originControlId!==x||Zt.controlComponent!==s.ControlComponent.VALUE&&!Zt.originControlId&&Zt.controlId===x)break;if(!Z(Zt)){v=$t+1,It=!0;break}}if(!It)for(let $t=b;$t<y.length;$t++){const Zt=y[$t];if(Zt.controlId!==x&&Zt.originControlId!==x||(Zt.controlComponent===s.ControlComponent.POSTTEXTFIX||Zt.controlComponent===s.ControlComponent.POSTFIX)&&!Zt.originControlId&&Zt.controlId===x)break;if(!Z(Zt)){v=$t,It=!0;break}}}}}}}}}if(B&&M?.control?.type===s.ControlType.TEXT&&M?.originControlId&&M.controlComponent===s.ControlComponent.PLACEHOLDER&&k(M.originControlId)&&(v=b),~T&&gm&&!St)t.isAllowSelection=!1,e.getControl().destroyControl({isEmitEvent:!1}),e.render({isCompute:!1,isSubmitHistory:!1,isSetCursor:!1});else if(~T&&!i){ra&&(v=Math.min(Math.max(v,A.startIndex),A.endIndex));let w=v,x=v;if(o.shiftKey){const{startIndex:It}=l.getRange();~It&&r.getPositionContext().tdId===u.tdId&&(b>It?w=It:x=It)}ra&&(w=Math.min(Math.max(w,A.startIndex),A.endIndex),x=Math.min(Math.max(x,A.startIndex),A.endIndex),v=Math.min(Math.max(v,A.startIndex),A.endIndex));const ot=e.getControl(),Rt=!!St;ot.setPopupAwakeDisabled(o.button===Mn.RIGHT||mm&&!Rt||Ct&&!Rt);try{l.setRange(w,x)}finally{ot.setPopupAwakeDisabled(!1)}if(r.setCursorPosition(N[v]),n=e.isReadonly(),D&&!n)Pr(M,e);else if(E&&!n)Mr(M,e);else if(!n&&M.controlComponent===s.ControlComponent.VALUE&&(M.control?.type===s.ControlType.CHECKBOX||M.control?.type===s.ControlType.RADIO)){let It=b;for(;It>0;){const $t=y[It];if($t.controlComponent===s.ControlComponent.CHECKBOX){Pr($t,e);break}else if($t.controlComponent===s.ControlComponent.RADIO){Mr($t,e);break}It--}}else{const $t=!!(!!(St&&it(St.element,St.index)===s.ControlType.BUTTON&&!St.element.control?.buttonText)&&St?.element.control?.editable===!1);let Zt=!1;if(B&&M?.controlId&&M?.controlComponent===s.ControlComponent.VALUE&&!M.originControlId){let io=!1;for(let Oe=b;Oe>=0;Oe--){const ze=y[Oe];if(ze.controlId!==M.controlId){if(ze.originControlId===M.controlId){io=!0;continue}break}if(ze.control?.type===s.ControlType.TEXTFIELD){if(io)break;Zt=!0;break}}if(!io&&!Zt)for(let Oe=b+1;Oe<y.length;Oe++){const ze=y[Oe];if(ze.controlId!==M.controlId){if(ze.originControlId===M.controlId){io=!0;continue}break}}io&&(Zt=!1)}const gi=Zt&&Z(M),Wn=F&&!gi?v:void 0,Mo=!X&&!D&&!E&&!($t&&B)&&!gi;e.render({curIndex:F&&!gi?Wn:v,isCompute:!1,isSubmitHistory:!1,isSetCursor:Mo}),Mo&&e.getCursor().requestFocus();const $e=V[v];if(!n&&Rt&&$e?.controlId&&o.button===Mn.LEFT){const Oe=e.getControl().getActiveControl(),ze=Oe?.getElement()?.control?.type;Oe&&(ze===s.ControlType.SELECT||ze===s.ControlType.DATE||ze===s.ControlType.BUTTON)&&Oe.getElement()?.controlId===$e.controlId&&$e.controlComponent!==s.ControlComponent.POSTFIX&&$e.controlComponent!==s.ControlComponent.POSTTEXTFIX&&$e.controlComponent!==s.ControlComponent.POSTTEXTFIX_TEXT&&$e.controlComponent!==s.ControlComponent.POST_TEXT&&typeof Oe.awake=="function"&&Oe.awake(o)}}S&&t.getDraw().getCursor().drawCursor({hitLineStartIndex:S})}const Je=e.getEventBus();if(U&&Je.isSubscribe("labelMousedown")&&Je.emit("labelMousedown",{evt:o,element:M}),F&&(M.type===s.ElementType.MACRO||M.type===s.ElementType.CUSTOM_MACRO||M.type===s.ElementType.REUSABLE_ITEM)){const w=e.getMode();if(w===s.EditorMode.EDIT&&M.type===s.ElementType.CUSTOM_MACRO)Je.isSubscribe("macroClick")&&Je.emit("macroClick",{evt:o,element:M});else if(w===s.EditorMode.FORM&&o.button===Mn.LEFT){let x=!1;(M.type===s.ElementType.CUSTOM_MACRO||M.type===s.ElementType.REUSABLE_ITEM)&&(o.preventDefault(),x=e.getMacroParticle().activateInlineEditor(M,b,o.offsetX)),!x&&Je.isSubscribe("macroValueChange")&&Je.emit("macroValueChange",{evt:o,element:M})}}o.button===Mn.LEFT&&F&&M.type===s.ElementType.SUB_TEMPLATE&&!M.subTemplateExpanded&&e.getMode()===s.EditorMode.FORM&&Je.isSubscribe("subTemplateClick")&&Je.emit("subTemplateClick",{evt:o,element:M});const la=e.getPreviewer();if(la.clearResizer(),X){if(!e.isPrintLikeMode()){const w={dragDisable:n||!M.controlId&&e.getMode()===s.EditorMode.FORM};M.type===s.ElementType.LATEX&&(w.mime="svg",w.srcKey="laTexSVG"),la.drawResizer(M,Y[b],w),e.getCursor().drawCursor({isShow:!1}),Lr(t),(M.imgDisplay===s.ImageDisplay.SURROUND||M.imgDisplay===s.ImageDisplay.FLOAT_TOP||M.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM)&&e.getImageParticle().createFloatImage(M)}Je.isSubscribe("imageMousedown")&&Je.emit("imageMousedown",{evt:o,element:M})}const aa=e.getTableTool();aa.dispose(),O&&!n&&aa.render();const vs=e.getHyperlinkParticle();vs.clearHyperlinkPopup(),M.type===s.ElementType.HYPERLINK&&(Ae(o)?vs.openHyperlink(M):vs.drawHyperlinkPopup(M,Y[b]));const ca=e.getDateParticle();ca.clearDatePicker(),M.type===s.ElementType.DATE&&!n&&ca.renderDatePicker(M,Y[b]),e.getMenstrualHistoryParticle().clearMenstrualHistoryEditor(),e.getFetalHeartPositionParticle().clearFetalHeartPositionEditor(),e.getToothPositionParticle().clearToothPositionEditor()}function Zo(o){const t=ft();return Reflect.set(o,"dragId",t),t}function Qo(o,t){return t.findIndex(e=>e.dragId===o)}function Or(o,t,e){const n=e.getDraw();if(o.imgDisplay===s.ImageDisplay.SURROUND||o.imgDisplay===s.ImageDisplay.FLOAT_TOP||o.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM){const i=t.offsetX-e.mouseDownStartPosition.x,l=t.offsetY-e.mouseDownStartPosition.y,r=o.imgFloatPosition;o.imgFloatPosition={x:r.x+i,y:r.y+l,pageNo:n.getPageNo()}}n.getImageParticle().destroyFloatImage()}function _c(o,t){if(t.isAllowDrop){const e=t.getDraw();if(e.isReadonly()||e.isDisabled()){t.mousedown(o);return}const n=e.getPosition(),i=n.getPositionList(),l=n.getPositionContext(),r=e.getRange(),a=t.cacheRange,c=t.cacheElementList,d=t.cachePositionList,u=t.cachePositionContext,h=r.getRange(),R=a.startIndex===a.endIndex,T=R?a.startIndex-1:a.startIndex,g=a.endIndex;if(h.startIndex>=T&&h.endIndex<=g&&t.cachePositionContext?.tdId===l.tdId){e.clearSideEffect();let H=!1,A=!1;if(R){const v=c[g];if(v.type===s.ElementType.IMAGE||v.type===s.ElementType.LATEX){if(Or(v,o,t),v.imgDisplay===s.ImageDisplay.SURROUND||v.imgDisplay===s.ImageDisplay.FLOAT_TOP||v.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(v),H=!0;else{const ct=d[g];e.getPreviewer().drawResizer(v,ct)}A=v.imgDisplay===s.ImageDisplay.SURROUND}}r.replaceRange({...a}),e.render({isCompute:A,isSubmitHistory:H,isSetCursor:!1});return}const f=c.slice(T+1,g+1),C=f.find(H=>H.controlId);if(C){const H=c[T+1],A=c[g];if(!((!H.controlId||H.controlComponent===s.ControlComponent.PREFIX)&&(!A.controlId||A.controlComponent===s.ControlComponent.POSTFIX)||H.controlId===A.controlId&&H.controlComponent===s.ControlComponent.PREFIX&&A.controlComponent===s.ControlComponent.POSTFIX||H.control?.type===s.ControlType.TEXT&&H.controlComponent===s.ControlComponent.VALUE&&A.control?.type===s.ControlType.TEXT&&A.controlComponent===s.ControlComponent.VALUE)){e.render({curIndex:h.startIndex,isCompute:!1,isSubmitHistory:!1});return}}const p=e.getControl(),I=e.getElementList(),m=!C||!!I[h.startIndex].controlId||!p.getIsElementListContainFullControl(f),L=e.getOptions(),O=f.map(H=>{if(!H.type||H.type===s.ElementType.TEXT){const A={value:H.value},v=Ne;return m||v.push(...Di),v.forEach(ct=>{const bt=H[ct];bt!==void 0&&(A[ct]=bt)}),A}else{let A=rt(H);return m&&(A=Ee(A,Di)),ee([A],{isHandleFirstElement:!1,editorOptions:L}),A}});le(I,O,h.startIndex,{editorOptions:e.getOptions()});const P=c[T],S=d[T],y=Zo(c[T]),Y=Zo(c[g]),b=O.length;let M=h.startIndex,V=M+b;const N=p.getActiveControl();if(N&&c[M].controlComponent!==s.ControlComponent.POSTFIX?(V=N.setValue(O),M=V-b):e.spliceElementList(I,M+1,0,O),!~V){e.render({isSetCursor:!1});return}const X=Zo(I[M]),D=Zo(I[V]),E=Qo(y,c),U=Qo(Y,c),F=c[U];if(F.controlId&&F.controlComponent!==s.ControlComponent.POSTFIX)r.replaceRange({...a,startIndex:E,endIndex:U}),p.getActiveControl()?.cut();else{let H=!0;if(u?.isTable){const{tableId:A,trIndex:v,tdIndex:ct}=u;H=!e.getOriginalElementList().some(Qt=>Qt.id===A&&Qt?.trList?.[v]?.tdList?.[ct]?.deletable===!1)}H&&e.spliceElementList(c,E+1,U-E)}const Z=I[h.startIndex],Q=i[h.startIndex];let W=l.index;W&&(Z.tableId&&!P.tableId?S.index<W&&(W-=b):!Z.tableId&&P.tableId&&Q.index<W&&(W+=b),n.setPositionContext({...l,index:W}));const K=Qo(X,I),k=Qo(D,I);r.setRange(R?k:K,k,h.tableId,h.startTdIndex,h.endTdIndex,h.startTrIndex,h.endTrIndex),e.clearSideEffect();let B=null;if(R){const A=e.getElementList()[k];(A.type===s.ElementType.IMAGE||A.type===s.ElementType.LATEX)&&(Or(A,o,t),B=A)}if(e.render({isSetCursor:!1}),N?p.emitControlContentChange():P.controlId&&p.emitControlContentChange({context:{range:a,elementList:c},controlElement:P}),B)if(B.imgDisplay===s.ImageDisplay.SURROUND||B.imgDisplay===s.ImageDisplay.FLOAT_TOP||B.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM)e.getPreviewer().drawResizer(B);else{const A=n.getPositionList()[k];e.getPreviewer().drawResizer(B,A)}}else t.isAllowDrag&&t.cacheRange?.startIndex!==t.cacheRange?.endIndex&&t.mousedown(o)}function Bc(o,t){const e=t.getDraw();if(!e.getOptions().pageOuterSelectionDisable)return;const n=e.getPageContainer(),{x:i,y:l,width:r,height:a}=n.getBoundingClientRect();o.x>=i&&o.x<=i+r&&o.y>=l&&o.y<=l+a||t.setIsAllowSelection(!1)}function kc(o,t){const e=t.getDraw(),n=e.getControl(),i=e.getPageList(),l=e.getPageNo(),r=i[l],a=e.getPosition(),c=a.getPositionByXY({x:o.offsetX,y:o.offsetY});if(~c.index){const D=c.isTable?e.getTdByPosition({...c,isTable:!0,index:c.index}):null,E=c.isTable&&D?.value||e.getElementList(),U=c.isTable&&D?.positionList||a.getPositionList(),F=c.isTable?c.tdValueIndex:c.index,Z=e.getMode(),Q=Z===s.EditorMode.EDIT||Z===s.EditorMode.FORM,W=[F,F+1,F-1,F+2,F-2].filter((H,A,v)=>H>=0&&H<E.length&&v.indexOf(H)===A),K=H=>{const A=U[H];if(!A)return!1;const{coordinate:{leftTop:v,rightTop:ct,leftBottom:bt}}=A;return ct[0]>v[0]&&o.offsetX>=v[0]&&o.offsetX<ct[0]&&o.offsetY>=v[1]&&o.offsetY<=bt[1]},k=Q&&W.some(H=>{const v=E[H]?.control?.type;return v!==s.ControlType.SELECT&&v!==s.ControlType.DATE?!1:K(H)}),B=W.some(H=>{const A=E[H];return!!(A?.control?.type===s.ControlType.BUTTON&&!A.control.buttonText&&(A.controlComponent===s.ControlComponent.VALUE||A.controlComponent===s.ControlComponent.PLACEHOLDER)&&K(H))});r&&(k||B)?r.style.cursor="pointer":r&&(r.style.cursor="text")}else r&&(r.style.cursor="text");if(t.isAllowDrag){if(e.isContentReadonly()){t.setIsAllowDrag(!1);return}const D=o.offsetX,E=o.offsetY,{startIndex:U,endIndex:F}=t.cacheRange,Z=t.cachePositionList;for(let W=U+1;W<=F;W++){const{coordinate:{leftTop:K,rightBottom:k}}=Z[W];if(D>=K[0]&&D<=k[0]&&E>=K[1]&&E<=k[1])return}const Q=t.cacheRange?.startIndex;if(Q){const W=t.cacheElementList[Q];W?.type===s.ElementType.IMAGE&&(W.imgDisplay===s.ImageDisplay.SURROUND||W.imgDisplay===s.ImageDisplay.FLOAT_TOP||W.imgDisplay===s.ImageDisplay.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 u=o.target.dataset.index;u&&e.setPageNo(Number(u));const h=e.getPosition(),R=h.getPositionByXY({x:o.offsetX,y:o.offsetY});if(!~R.index)return;const{index:T,isTable:g,tdValueIndex:f,tdIndex:C,trIndex:p,tableId:I,trId:m,tdId:L}=R;let O=g?f:T;if(R.isControl&&e.getMode()!==s.EditorMode.READONLY){const{newIndex:D}=n.moveCursor({index:T,isTable:g,trIndex:p,tdIndex:C,tdValueIndex:f});O=D}const{index:P,isTable:S,tdIndex:y,tdId:Y,trIndex:b,tableId:M}=t.mouseDownStartPosition,V=O,N=e.getRange();let X;if(L!==Y&&L&&Y){const D=e.getTdByPosition({...t.mouseDownStartPosition,isTable:!!t.mouseDownStartPosition.tableId,index:t.mouseDownStartPosition.originalIndex??t.mouseDownStartPosition.index}),E=e.getTdByPosition({...R,isTable:!!R.tableId,index:R.index});if(e.isSplitTd(D,E)){const U=(D.valueStartIndex??0)+P,F=(E.valueStartIndex??0)+f;X=[{index:U,element:D.value[P],originalId:D.originalId,isCurrent:!1,length:D.value.length,startIndex:D.valueStartIndex??0},{index:F,element:E.value[f],originalId:E.originalId,isCurrent:!0,length:E.value.length,startIndex:E.valueStartIndex??0}]}}if(g&&S&&L!==Y&&!X)N.setRange(V,V,I,y,C,b,p),h.setPositionContext({isTable:!!g,index:T,trIndex:p,tdIndex:C,tdId:L,trId:m,tableId:I});else{let D=~V?V:0;if((S||g)&&M!==I&&!X)return;h.setPositionContext({isTable:!!g,index:T,trIndex:p,tdIndex:C,tdId:L,trId:m,tableId:I});let E=P,U,F;if(X)[{element:U},{element:F}]=X;else{const W=e.getElementList();U=W[E+1],F=W[D]}if(E===D||U?.controlComponent===s.ControlComponent.PLACEHOLDER&&F?.controlComponent===s.ControlComponent.PLACEHOLDER&&U.controlId===F.controlId)return;if(E>D&&([E,D]=[D,E]),e.getMode()===s.EditorMode.FORM){const K=n.getActiveControl()?.getElement()?.control?.type===s.ControlType.TEXT?null:n.getActiveTextControlLimit();K&&(E=Math.min(Math.max(E,K.startIndex),K.endIndex),D=Math.min(Math.max(D,K.startIndex),K.endIndex));const k=e.getElementList(),B=k[E],H=k[D];if(B?.control?.type===s.ControlType.TEXTFIELD||H?.control?.type===s.ControlType.TEXTFIELD){const A=B?.controlId||H?.controlId;if(A){let v=-1,ct=-1;for(let bt=E;bt>=0;bt--){const Qt=k[bt];if(Qt.controlId!==A)break;if(Qt.controlComponent===s.ControlComponent.PRETEXTFIX||Qt.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||Qt.controlComponent===s.ControlComponent.TEXTFIXLABEL||Qt.controlComponent===s.ControlComponent.PREFIX||Qt.controlComponent===s.ControlComponent.PRE_TEXT){v=bt+1;break}}for(let bt=D;bt<k.length;bt++){const Qt=k[bt];if(Qt.controlId!==A)break;if(Qt.controlComponent===s.ControlComponent.POSTTEXTFIX||Qt.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||Qt.controlComponent===s.ControlComponent.POSTFIX||Qt.controlComponent===s.ControlComponent.POST_TEXT){ct=bt-1;break}}v!==-1&&E<v&&(E=v),ct!==-1&&D>ct&&(D=ct)}}}let Q;if(X){const[W,K]=X.sort((k,B)=>k.index-B.index);Q={originalId:X[0].originalId??X[1].originalId,startIndex:W.index,endIndex:K.index},W.isCurrent?(E=W.index,D=W.length-1):(E=0,D=Q.endIndex-K.startIndex)}N.setRange(E,D,void 0,void 0,void 0,void 0,void 0,Q)}e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}function Ko(o,t){if(!t)return null;const e=new Set;let n=t,i=null;for(;n&&!e.has(n);){e.add(n);let l=null;for(let r=0;r<o.length;r++){const a=o[r];if(a.controlId===n&&a.control?.type&&(l=a,a.controlComponent===s.ControlComponent.PREFIX||a.controlComponent===s.ControlComponent.PRE_TEXT||a.controlComponent===s.ControlComponent.PRETEXTFIX||a.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT))break}if(!l)break;l.control?.type==="text"&&(i=n),n=l.originControlId||null}return i}function Bi(o,t){return!!o&&!!t&&o.controlId===t}function Gc(o){const t=o.getDraw(),e=t.getRange(),n=e.getRange(),i=t.getElementList(),l=i[n.startIndex];if(!ae(l)||t.getMode()===s.EditorMode.FORM&&l?.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;let r=n.startIndex;for(;r>0;){const a=i[r];if(a.type===s.ElementType.SUB_TEMPLATE&&a.subTemplateExpanded){const u=On(i,r,t);return u===null?!1:(n.startIndex=u,n.endIndex=u,e.replaceRange(n),t.getGlobalEvent().setCanvasEventAbility(),t.render({curIndex:u}),!0)}let c=null;a.controlId?(c=t.getControl().removeControl(r),c!==null&&(r=c)):(t.spliceElementList(i,r,1),c=r-1,r--);const d=i[c];if(!d||!ae(d)){if(c){n.startIndex=c,n.endIndex=c,e.replaceRange(n);const u=t.getPosition(),h=u.getPositionList();u.setCursorPosition(h[c])}break}}return!1}function xc(o,t,e){if(e.originControlId){const n=Ko(o,e.originControlId);if(!n)return{isInParent:!1};for(let i=t;i<o.length;i++){const l=o[i];if(l.controlId===n)return l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX||l.controlComponent===s.ControlComponent.POST_TEXT?{isInParent:!1}:{isInParent:!0,parentControlId:n};if(l.controlId&&l.controlId!==n&&l.originControlId!==n)break}}if(!e.originControlId&&e.controlId){const n=o[t];if(n?.controlId&&n.controlId!==e.controlId&&(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.PRETEXTFIX))for(let i=t-1;i>=0;i--){const l=o[i];if(l.controlId===e.controlId&&(l.controlComponent===s.ControlComponent.PREFIX||l.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let r=i-1;r>=0;r--){const a=o[r],c=Ko(o,a.controlId);if(c&&c!==e.controlId&&(a.controlComponent===s.ControlComponent.PRETEXTFIX||a.controlComponent===s.ControlComponent.PREFIX))return{isInParent:!0,parentControlId:c};if(a.controlId&&a.controlId!==e.controlId&&(a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POSTTEXTFIX))return{isInParent:!1}}break}}if(n?.controlId&&n.controlId!==e.controlId&&!n.originControlId&&(n.controlComponent===s.ControlComponent.POSTFIX||n.controlComponent===s.ControlComponent.POSTTEXTFIX)){if(e.originControlId===n.controlId){const i=Ko(o,n.controlId);if(i)return{isInParent:!0,parentControlId:i}}return{isInParent:!1}}}return{isInParent:!1}}function Jc(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:l,isCrossRowCol:r}=n.getRange(),a=e.getElementList(),c=n.getIsCollapsed();if(c){const h=vo(a,i,"trailing");if(h!==-1){const R=On(a,h,e);if(R===null)return;e.getGlobalEvent().setCanvasEventAbility(),n.setRange(R,R),e.render({curIndex:R});return}if(Gc(t))return}const d=e.getControl();let u;if(c&&i>0){const h=a[i-1],R=a[i],T=R?.control?.type===s.ControlType.TEXT&&R.controlComponent===s.ControlComponent.PLACEHOLDER,g=e.getMode()===s.EditorMode.FORM&&R?.control?.type===s.ControlType.NUMBER&&!d.getIsExistValueByElementListIndex(a,i)&&(R.controlComponent===s.ControlComponent.PREFIX||R.controlComponent===s.ControlComponent.PRE_TEXT||R.controlComponent===s.ControlComponent.PLACEHOLDER||R.controlComponent===s.ControlComponent.POSTFIX||R.controlComponent===s.ControlComponent.POST_TEXT);if(e.getMode()===s.EditorMode.FORM&&T)return;if(h?.subTemplateParentId&&R?.subTemplateParentId!==h.subTemplateParentId&&!T&&!(h.type===s.ElementType.SUB_TEMPLATE&&R?.subTemplateParentId===h.id)){const X=_i(a,i-1);if(X!==-1){const D=On(a,X,e);if(D===null)return;e.getGlobalEvent().setCanvasEventAbility(),n.setRange(D,D),e.render({curIndex:D});return}}const C=e.getPosition().getPositionList(),p=C[i],I=C[i-1],m=p&&I&&p.rowIndex===I.rowIndex,L=h?.controlComponent===s.ControlComponent.PREFIX||h?.controlComponent===s.ControlComponent.PRETEXTFIX||h?.controlComponent===s.ControlComponent.PRE_TEXT||h?.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT,O=h?.controlComponent===s.ControlComponent.POSTFIX||h?.controlComponent===s.ControlComponent.POSTTEXTFIX||h?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||h?.controlComponent===s.ControlComponent.POST_TEXT,P=!!h?.controlId,S=R?.controlComponent===s.ControlComponent.PLACEHOLDER,y=R?.controlComponent===s.ControlComponent.POSTFIX||R?.controlComponent===s.ControlComponent.POSTTEXTFIX||R?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||R?.controlComponent===s.ControlComponent.POST_TEXT,Y=R?.control?.type===s.ControlType.TEXT&&(R.controlComponent===s.ControlComponent.PREFIX||R.controlComponent===s.ControlComponent.PRE_TEXT),b=y&&h?.controlId===R?.controlId&&h?.originControlId===R?.originControlId&&h?.controlComponent===s.ControlComponent.VALUE,M=!!R&&!R.controlId&&!R.control;if(S&&L&&P&&m||g)return;const{isInParent:V,parentControlId:N}=xc(a,i,h);if(O&&P&&m&&V&&!(R?.controlId===N&&!R?.originControlId&&(R?.controlComponent===s.ControlComponent.VALUE||R?.controlComponent===s.ControlComponent.PLACEHOLDER))){if(h.originControlId&&N)for(let D=i;D<a.length;D++){const E=a[D];if(Bi(E,N)){if(E.controlComponent===s.ControlComponent.VALUE){n.setRange(D,D),e.render({curIndex:D,isSubmitHistory:!1});return}if(E.controlComponent===s.ControlComponent.POSTFIX||E.controlComponent===s.ControlComponent.POSTTEXTFIX||E.controlComponent===s.ControlComponent.POST_TEXT)return}E.controlId!==N&&E.originControlId}return}if(O&&P&&m&&!V&&!(M&&!S&&!y)){if(Y)return;if(T)return;{const X=i-1;u=d.removeControl(X),e.getGlobalEvent().setCanvasEventAbility(),u===null?(n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1})):(n.setRange(u,u),e.render({curIndex:u}));return}}if(y&&R?.originControlId&&V&&N&&m){for(let X=i+1;X<a.length;X++){const D=a[X];if(Bi(D,N)){if(D.controlComponent===s.ControlComponent.VALUE||D.controlComponent===s.ControlComponent.PLACEHOLDER){n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1});return}break}if(D.controlId&&D.controlId!==N&&D.originControlId!==N)break}for(let X=i-1;X>=0;X--){const D=a[X];if(Bi(D,N)){if(D.controlComponent===s.ControlComponent.VALUE||D.controlComponent===s.ControlComponent.PLACEHOLDER){n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1});return}break}if(D.controlId&&D.controlId!==N&&D.originControlId!==N)break}return}if(e.getMode()===s.EditorMode.FORM&&y&&R?.originControlId&&m){const X=Ko(a,R.originControlId);if(!X)return;for(let D=i-1;D>=0;D--){const E=a[D];if(E.controlId===X&&!E.originControlId){if(E.controlComponent===s.ControlComponent.VALUE||E.controlComponent===s.ControlComponent.PLACEHOLDER){n.setRange(D,D),e.render({curIndex:D,isSubmitHistory:!1});return}if(E.controlComponent===s.ControlComponent.PREFIX||E.controlComponent===s.ControlComponent.PRE_TEXT||E.controlComponent===s.ControlComponent.PRETEXTFIX||E.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)return}if(E.controlId&&E.controlId!==X&&E.originControlId!==X)break}return}if(y&&R?.controlId&&m&&!b){const X=i;u=d.removeControl(X),e.getGlobalEvent().setCanvasEventAbility(),u===null?(n.setRange(X,X),e.render({curIndex:X,isSubmitHistory:!1})):(n.setRange(u,u),e.render({curIndex:u}));return}}if(r){const h=e.getTableParticle().getRangeRowCol();if(!h)return;let R=!1;for(let T=0;T<h.length;T++){const g=h[T];for(let f=0;f<g.length;f++){const C=g[f];C.value.length>1&&(e.spliceElementList(C.value,1,C.value.length-1),R=!0)}}u=R?0:null}else if(d.getActiveControl()&&d.getIsRangeCanCaptureEvent())u=d.keydown(o),u!==null&&d.emitControlContentChange();else{const h=e.getPosition().getCursorPosition();if(!h)return;const{index:R}=h,T=n.getIsCollapsed(),g=e.getElementList();if(T&&R===0){const I=g[R];if(I.value===_){I.listId&&e.getListParticle().unsetList(),o.preventDefault();return}}const f=g[i];if(T&&f.rowFlex&&f.value===_){const I=n.getRangeRowElementList();if(I){const m=g[i-1];I.forEach(L=>{L.rowFlex=m?.rowFlex})}}const C=f.value===_?g[i-1]:f,p=g[l+1];if(C?.titleId&&p?.titleId&&C.level===p.level&&C.titleId!==p.titleId){const I=C.titleId,m=p.titleId;let L=l+1;for(;L<g.length&&g[L]?.titleId===m;)g[L].titleId=I,L++}T?e.spliceElementList(g,R,1):e.spliceElementList(g,i+1,l-i),u=T?R-1:i}e.getGlobalEvent().setCanvasEventAbility(),u===null?(n.setRange(i,i),e.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(u,u),e.render({curIndex:u}))}function $c(o){const t=o.getDraw(),e=t.getRange(),n=e.getRange(),i=t.getElementList(),l=i[n.startIndex+1];if(!ae(l)||t.getMode()===s.EditorMode.FORM&&l?.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;const r=n.startIndex+1;for(;r<i.length;){const a=i[r];if(a.type===s.ElementType.SUB_TEMPLATE&&a.subTemplateExpanded){const u=On(i,r,t);return u===null?!1:(e.setRange(u,u),t.getGlobalEvent().setCanvasEventAbility(),t.render({curIndex:u}),!0)}let c=null;a.controlId?c=t.getControl().removeControl(r):(t.spliceElementList(i,r,1),c=r);const d=i[c];if(!d||!ae(d))break}return!1}function zc(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:l,isCrossRowCol:r,splitTdRange:a}=n.getRange(),c=e.getElementList(),d=e.getControl();if(n.getIsCollapsed()){const h=vo(c,l+1,"leading");if(h!==-1){const R=On(c,h,e);if(R===null)return;e.getGlobalEvent().setCanvasEventAbility(),n.setRange(R,R),e.render({curIndex:R});return}if($c(t))return}let u;if(r){const h=e.getTableParticle().getRangeRowCol();if(!h)return;let R=!1;for(let T=0;T<h.length;T++){const g=h[T];for(let f=0;f<g.length;f++){const C=g[f];C.value.length>1&&(e.spliceElementList(C.value,1,C.value.length-1),R=!0)}}u=R?0:null}else if(d.getActiveControl()&&d.getIsRangeWithinControl())u=d.keydown(o),u!==null&&d.emitControlContentChange();else if(c[l+1]?.controlId)u=d.removeControl(l+1);else if(n.getIsCollapsed()&&c[l+1]?.subTemplateParentId){const h=_i(c,l+1);h!==-1?u=On(c,h,e):u=null}else{e.removeSplitTdOtherRangeElements();const h=e.getPosition(),R=h.getCursorPosition();if(!R)return;const{index:T}=R,g=h.getPositionContext();if(g.isDirectHit&&g.isImage)e.spliceElementList(c,T,1),u=T-1;else{const f=n.getIsCollapsed();if(!f)e.spliceElementList(c,i+1,l-i);else if(c[T+1])e.spliceElementList(c,T+1,1);else{let C=!0;if(g.isTable){const p=e.getTd();if(p?.linkTdNextId){const I=e.getTdById(p.linkTdNextId);I&&(C=!1,e.spliceElementList(I.value,1,1))}}if(C)return}u=f?T:i,u===0&&a&&(u=e.fixPosition(!0)??u)}}e.getGlobalEvent().setCanvasEventAbility(),u===null?(n.setRange(i,i),e.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(u,u),e.render({curIndex:u}))}function jc(o,t){const e=t.getDraw();if(e.isReadonly())return;const n=e.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:l}=n.getRange(),r=n.getIsCollapsed(),a=e.getElementList(),c=a[i],d=a[l];if(r&&d.listId&&d.value===_&&a[l+1]?.listId!==d.listId){e.getListParticle().unsetList();return}let u={value:_};if(o.shiftKey&&c.listId&&(u.listWrap=!0),le(a,[u],i,{isBreakWhenWrap:!0,editorOptions:e.getOptions()}),o.shiftKey&&d.areaId&&d.areaId!==a[l+1]?.areaId&&(u=Ee(u,un)),!(a[i+1]?.titleId&&(!c.titleId||c.titleId!==a[i+1]?.titleId))&&!(d.titleId&&d.titleId!==a[l+1]?.titleId)){const C=n.getRangeAnchorStyle(a,l);if(C){const p=[...ce],I=C.controlComponent===s.ControlComponent.POSTFIX||C.controlComponent===s.ControlComponent.POSTTEXTFIX||C.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||C.controlComponent===s.ControlComponent.POST_TEXT,m=C.control?.type===s.ControlType.BUTTON&&!C.control?.buttonText;!I&&!m&&p.push(...Ne),p.forEach(L=>{const O=C[L];O!==void 0&&(u[L]=O)})}}const h=e.getControl(),R=h.getActiveControl();let T;const g=R?.getElement();if(g?.control?.type===s.ControlType.BUTTON&&!g.control?.buttonText&&h.getIsRangeWithinControl())T=R.setValue([u]),~T&&h.emitControlContentChange();else if(R&&h.getIsRangeWithinControl())T=h.setValue([u]),h.emitControlContentChange();else{const p=e.getPosition().getCursorPosition();if(!p)return;const{index:I}=p;if(r){if(e.spliceElementList(a,I+1,0,[u]),d.titleId&&a[I+2]?.titleId===d.titleId){const m=ft();let L=I+2;for(;L<a.length&&a[L]?.titleId===d.titleId;)a[L].titleId=m,L++}}else e.spliceElementList(a,i+1,l-i,[u]);T=I+1}~T&&(n.setRange(T,T),e.render({curIndex:T})),o.preventDefault()}function Sr(o){return o&&(o.type===s.ElementType.MACRO||o.type===s.ElementType.CUSTOM_MACRO||o.type===s.ElementType.REUSABLE_ITEM||o.type===s.ElementType.SUB_TEMPLATE||o.type===s.ElementType.MENSTRUAL_HISTORY||o.type===s.ElementType.FETAL_HEART_POSITION||o.type===s.ElementType.TOOTH_POSITION||o.type===s.ElementType.LIST||o.type===s.ElementType.SPECIAL_SYMBOLS)}function qc(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),l=i.getCursorPosition();if(!l)return;const r=i.getPositionContext(),{index:a}=l;if(a<=0&&!r.isTable)return;const c=e.getRange(),{startIndex:d,endIndex:u}=c.getRange(),h=c.getIsCollapsed(),R=e.getElementList(),T=e.getControl(),g=e.getMode()===s.EditorMode.FORM,f=T.getActiveControl()?.getElement()?.control?.type,C=g&&(f===s.ControlType.TEXT||f===s.ControlType.NUMBER),p=g?T.getActiveTextControlLimit():null,I=R[a],m=I?.controlComponent===s.ControlComponent.PREFIX||I?.controlComponent===s.ControlComponent.PRETEXTFIX||I?.controlComponent===s.ControlComponent.PRE_TEXT;let L=!1;if(m&&I?.originControlId){const M=I.originControlId;for(let V=a-1;V>=0;V--){const N=R[V];if(N.controlId===M&&!N.originControlId){L=!0;break}if(N.controlId&&N.controlId!==M&&N.originControlId!==M)break}}if(g&&!C&&T.getActiveControl()&&m&&!p&&!L){T.initNextControl({direction:zt.UP});return}let O=1;if(Ae(o)){const M=e.getLetterReg(),V=o.shiftKey&&!h&&d===l?.index?u:d;if(M.test(R[V]?.value)){let N=V-1;for(;N>0;){const X=R[N];if(!M.test(X.value))break;O++,N--}}}if(g&&!C){const M=R[d],V=M?.controlId;if(V&&M?.controlComponent===s.ControlComponent.VALUE){let N=!1;for(let X=d;X>=0;X--){const D=R[X];if(D.controlId!==V)break;if(D.control?.type===s.ControlType.TEXTFIELD){N=!0;break}}if(N){if(M.controlComponent===s.ControlComponent.VALUE&&Sr(M))return;const X=d-O;if(X>=0){const D=R[X];if(D&&D.controlId===V&&D.controlComponent===s.ControlComponent.VALUE&&Sr(D))return}}}}const P=p?Math.max(d-O,p.startIndex):d-O;let S=P,y=P;if(o.shiftKey&&l&&(d!==u?d===l.index?(S=d,y=u-O):(S=P,y=u):y=u),!o.shiftKey){const M=R[d];if(M.type===s.ElementType.TABLE){const V=M.trList,N=V.length-1,X=V[N],D=X.tdList.length-1,E=X.tdList[D];i.setPositionContext({isTable:!0,index:d,trIndex:N,tdIndex:D,tdId:E.id,trId:X.id,tableId:M.id}),S=E.value.length-1,y=S}else if(M.tableId&&d===0){const N=e.getOriginalElementList()[r.index],X=e.getTd();if(X?.linkTdPrevId){const D=e.getTdById(X.linkTdPrevId);D&&(i.setPositionContext({...r,isTable:!0,index:D.tableIndex,trIndex:D.trIndex,tdId:D.id,trId:D.trId,tableId:D.tableId}),S=D.value.length-1,y=S)}else{const D=N.trList;t:for(let E=0;E<D.length;E++){const U=D[E];if(U.id!==M.trId)continue;const F=U.tdList;for(let Z=0;Z<F.length;Z++)if(F[Z].id===M.tdId){if(E===0&&Z===0)i.setPositionContext({isTable:!1}),S=r.index-1,y=S,e.getTableTool().dispose();else{let W=E,K=Z-1;K<0&&(W=E-1,K=D[W].tdList.length-1);const k=D[W],B=k.tdList[K];i.setPositionContext({isTable:!0,index:r.index,trIndex:W,tdIndex:K,tdId:B.id,trId:k.id,tableId:M.tableId}),S=B.value.length-1,y=S}break t}}}}}if(!~S||!~y)return;const Y=e.getElementList();S=Bn(Y,S),y=Bn(Y,y),c.setRange(S,y);const b=S===y;e.updateTableTool(),e.render({curIndex:b?S:void 0,isSetCursor:b,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function Dr(o){return o&&(o.type===s.ElementType.MACRO||o.type===s.ElementType.CUSTOM_MACRO||o.type===s.ElementType.REUSABLE_ITEM||o.type===s.ElementType.SUB_TEMPLATE||o.type===s.ElementType.MENSTRUAL_HISTORY||o.type===s.ElementType.FETAL_HEART_POSITION||o.type===s.ElementType.TOOTH_POSITION||o.type===s.ElementType.LIST||o.type===s.ElementType.SPECIAL_SYMBOLS)}function td(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),l=i.getCursorPosition();if(!l)return;const{index:r}=l,a=i.getPositionList(),c=i.getPositionContext();if(r>a.length-1&&!c.isTable)return;const d=e.getRange(),{startIndex:u,endIndex:h}=d.getRange(),R=d.getIsCollapsed();let T=e.getElementList();const g=e.getControl(),f=e.getMode()===s.EditorMode.FORM,C=g.getActiveControl()?.getElement()?.control?.type,p=f&&(C===s.ControlType.TEXT||C===s.ControlType.NUMBER),I=f?g.getActiveTextControlLimit():null,m=T[r],L=m?.controlComponent===s.ControlComponent.POSTFIX||m?.controlComponent===s.ControlComponent.POSTTEXTFIX||m?.controlComponent===s.ControlComponent.POST_TEXT;let O=!1;if(L&&m?.originControlId){const N=m.originControlId;for(let X=r+1;X<T.length;X++){const D=T[X];if(D.controlId===N&&!D.originControlId){O=!0;break}if(D.controlId&&D.controlId!==N&&D.originControlId!==N)break}}if(f&&!p&&g.getActiveControl()&&L&&!I&&!O){g.initNextControl({direction:zt.DOWN});return}let P=1;if(Ae(o)){const N=e.getLetterReg(),X=o.shiftKey&&!R&&u===l?.index?h:u;if(N.test(T[X+1]?.value)){let D=X+2;for(;D<T.length;){const E=T[D];if(!N.test(E.value))break;P++,D++}}}if(f&&!p){const N=T[h],X=N?.controlId;if(X&&N?.controlComponent===s.ControlComponent.VALUE){let D=!1;for(let E=h;E>=0;E--){const U=T[E];if(U.controlId!==X)break;if(U.control?.type===s.ControlType.TEXTFIELD){D=!0;break}}if(D){if(N.controlComponent===s.ControlComponent.VALUE&&Dr(N))return;const E=h+P;if(E<T.length){const U=T[E];if(U&&U.controlId===X&&U.controlComponent===s.ControlComponent.VALUE&&Dr(U))return}}}}const S=I?Math.min(h+P,I.endIndex):h+P;let y=S,Y=S;if(o.shiftKey&&l&&(u!==h?u===l.index?(y=u,Y=S):(y=u+P,Y=h):y=u),!o.shiftKey){const N=T[h],X=T[h+1];if(X?.type===s.ElementType.TABLE){const E=X.trList[0],U=E.tdList[0];i.setPositionContext({isTable:!0,index:h+1,trIndex:0,tdIndex:0,tdId:U.id,trId:E.id,tableId:X.id}),y=0,Y=0}else if(N.tableId&&!X){const D=e.getTd(),E=D?.linkTdNextId?e.getTdById(D.linkTdNextId):void 0;if(E?.value.length)i.setPositionContext({...c,isTable:!0,index:E.tableIndex,trIndex:E.trIndex,tdId:E.id,trId:E.trId,tableId:E.tableId}),y=0,Y=y;else{const F=e.getOriginalElementList()[c.index].trList;t:for(let Z=0;Z<F.length;Z++){const Q=F[Z];if(Q.id!==N.trId)continue;const W=Q.tdList;for(let K=0;K<W.length;K++)if(W[K].id===N.tdId){if(Z===F.length-1&&K===W.length-1)i.setPositionContext({isTable:!1}),y=c.index,Y=y,T=e.getElementList(),e.getTableTool().dispose();else{let B=Z,H=K+1;H>W.length-1&&(B=Z+1,H=0);const A=F[B],v=A.tdList[H];i.setPositionContext({isTable:!0,index:c.index,trIndex:B,tdIndex:H,tdId:v.id,trId:A.id,tableId:N.tableId}),y=0,Y=y}break t}}}}}const b=T.length-1;if(y>b||Y>b)return;const M=e.getElementList();y=Bn(M,y,s.LocationPosition.AFTER),Y=Bn(M,Y,s.LocationPosition.AFTER),d.setRange(y,Y);const V=y===Y;e.updateTableTool(),e.render({curIndex:V?y:void 0,isSetCursor:V,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function ed(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getMode()===s.EditorMode.FORM,l=e.getControl(),r=e.getRange(),a=e.getElementList(),{startIndex:c,endIndex:d}=r.getRange(),u=a[c],h=a[d],R=c>0?a[c-1]:null,T=l.getIsRangeWithinControl()||!!u?.controlId||!!h?.controlId||!!R?.controlId;let g=l.getActiveControl();if(i&&T&&(l.initControl(),g=l.getActiveControl()),i&&T)o.preventDefault(),l.initNextControl({direction:o.shiftKey?zt.UP:zt.DOWN});else if(g&&l.getIsRangeWithinControl())o.preventDefault(),l.initNextControl({direction:o.shiftKey?zt.UP:zt.DOWN});else{o.preventDefault();const f=r.getRangeAnchorStyle(a,d),p={...f?xt(f,Ne):null,type:s.ElementType.TAB,value:""};le(a,[p],c,{editorOptions:e.getOptions()}),e.insertElementList([p])}}function ki(o){const{positionList:t,index:e,isUp:n,rowNo:i,cursorX:l}=o;let r=-1;const a=[];if(n){let c=e-1;for(;c>=0;){const d=t[c];if(c--,d.rowNo!==i){if(a[0]&&a[0].rowNo!==d.rowNo)break;a.unshift(d)}}}else{let c=e+1;for(;c<t.length;){const d=t[c];if(c++,d.rowNo!==i){if(a[0]&&a[0].rowNo!==d.rowNo)break;a.push(d)}}}for(let c=0;c<a.length;c++){const d=a[c],{coordinate:{leftTop:[u],rightTop:[h]}}=d;if(c===a.length-1&&(r=d.index),!(l<u||l>h)){r=d.index;break}}return r}function nd(o,t){const e=t.getDraw();if(e.isReadonly())return;const i=e.getPosition(),l=i.getCursorPosition();if(!l)return;const r=e.getRange(),{startIndex:a,endIndex:c}=r.getRange();let d=i.getPositionList();const u=o.key===s.KeyMap.Up;let h=-1,R=-1;const T=i.getPositionContext();if(!o.shiftKey&&T.isTable&&(u&&l.rowIndex===0||!u&&l.rowIndex===e.getRowCount()-1)){const{index:f,trIndex:C,tdIndex:p,tableId:I}=T;if(u){const m=e.getOriginalElementList();if(C===0)if(m[f].originalId){const O=f-1,P=m[O];for(let S=P.trList.length-1;S>=0;S--){const y=P.trList[S].tdList.find(Y=>Y.tdIndex===p);if(y?.value.length){i.setPositionContext({isTable:!0,tableId:P.id,index:O,trIndex:S,tdIndex:p}),h=y.value.length-1,R=y.value.length-1;break}}}else i.setPositionContext({isTable:!1}),h=f-1,R=h,e.getTableTool().dispose();else{let L=-1,O=-1;const P=m[f].trList,S=P[C].tdList[p].colIndex;t:for(let b=C-1;b>=0;b--){const V=P[b].tdList;for(let N=0;N<V.length;N++){const X=V[N];if(X.colIndex===S||X.colIndex+X.colspan-1>=S&&X.colIndex<=S){L=b,O=N;break t}}}if(!~L||!~O)return;const y=P[L],Y=y.tdList[O];i.setPositionContext({isTable:!0,index:f,trIndex:L,tdIndex:O,tdId:Y.id,trId:y.id,tableId:I}),h=Y.value.length-1,R=h}}else{const m=e.getOriginalElementList(),L=m[f],O=L.trList;if(C===O.length-1){const P=f+1,S=m[P];if(S&&[L.id,L.originalId].includes(S.originalId)){for(let Y=p;Y>=0;Y--)if(S.trList[0].tdList[Y].value.length){i.setPositionContext({isTable:!0,index:P,tableId:S.id,trIndex:0,tdIndex:Y}),h=0,R=0;break}}else i.setPositionContext({isTable:!1}),h=f,R=h,e.getTableTool().dispose()}else{let P=-1,S=-1;const y=O[C].tdList[p].colIndex;t:for(let M=C+1;M<O.length;M++){const N=O[M].tdList;for(let X=0;X<N.length;X++){const D=N[X];if(D.colIndex===y||D.colIndex+D.colspan-1>=y&&D.colIndex<=y){P=M,S=X;break t}}}if(!~P||!~S)return;const Y=O[P],b=Y.tdList[S];i.setPositionContext({isTable:!0,index:f,trIndex:P,tdIndex:S,tdId:b.id,trId:Y.id,tableId:I}),h=b.value.length-1,R=h}}}else{let f=l;o.shiftKey&&(a===l.index?f=d[c]:f=d[a]);const{index:C,rowNo:p,rowIndex:I,coordinate:{rightTop:[m]}}=f;if(u&&I===0||!u&&I===e.getRowCount()-1)return;const L=ki({positionList:d,index:C,rowNo:p,isUp:u,cursorX:m});if(L<0)return;h=L,R=L,o.shiftKey&&(a!==c?a===l.index?h=a:R=c:u?R=c:h=a);const P=e.getElementList()[L];if(P.type===s.ElementType.TABLE){const{scale:S}=e.getOptions(),y=e.getMargins(),Y=P.trList;let b=-1,M=-1,V=-1;if(u)t:for(let N=Y.length-1;N>=0;N--){const D=Y[N].tdList;for(let E=0;E<D.length;E++){const U=D[E],F=U.x*S+y[3],Z=U.width*S;if(m>=F&&m<=F+Z){const Q=U.positionList,W=Q[Q.length-1],K=ki({positionList:Q,index:W.index+1,rowNo:W.rowNo-1,isUp:u,cursorX:m})||W.index;b=N,M=E,V=K;break t}}}else t:for(let N=0;N<Y.length;N++){const D=Y[N].tdList;for(let E=0;E<D.length;E++){const U=D[E],F=U.x*S+y[3],Z=U.width*S;if(m>=F&&m<=F+Z){const Q=U.positionList,W=ki({positionList:Q,index:-1,rowNo:-1,isUp:u,cursorX:m})||0;b=N,M=E,V=W;break t}}}if(~b&&~M&&~V){const N=Y[b],X=N.tdList[M];i.setPositionContext({isTable:!0,index:L,trIndex:b,tdIndex:M,tdId:X.id,trId:N.id,tableId:P.id}),h=V,R=h,d=i.getPositionList()}}}if(!~h||!~R)return;h>R&&([h,R]=[R,h]),r.setRange(h,R);const g=h===R;e.render({curIndex:g?h:void 0,isSetCursor:g,isSubmitHistory:!1,isCompute:!1}),g||(e.getCursor().moveCursorToVisible({cursorPosition:d[u?h:R],direction:u?zt.UP:zt.DOWN}),e.updateTableTool())}function od(o){return o.key.length===1&&!o.ctrlKey&&!o.metaKey&&!o.altKey}function id(o,t){const e=t.getDraw();if(e.isReadonly()&&e.getMode()!==s.EditorMode.FORM)return!1;const n=e.getRange();if(!n.getIsCanInput())return!1;const i=e.getControl();if(!i.getActiveControl()&&i.getIsRangeWithinControl()){i.setPopupAwakeDisabled(!0);try{i.initControl()}finally{i.setPopupAwakeDisabled(!1)}}const l=i.getActiveControl();if(l?.getElement()?.control?.type!==s.ControlType.DATE||!i.getIsRangeWithinControl())return!1;const{startIndex:r,endIndex:a}=n.getRange(),c=e.getElementList(),d=c[r],u=c[a],h=l.getElement(),R=p=>!!p?.controlId&&p.controlId===h.controlId&&(p.originControlId||null)===(h.originControlId||null),T=u?.controlComponent===s.ControlComponent.POSTFIX||u?.controlComponent===s.ControlComponent.POST_TEXT||u?.controlComponent===s.ControlComponent.POSTTEXTFIX||u?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT,g=c[a+1],f=!!(u?.originControlId&&u.controlComponent===s.ControlComponent.VALUE&&R(g)&&(g.controlComponent===s.ControlComponent.POSTFIX||g.controlComponent===s.ControlComponent.POST_TEXT||g.controlComponent===s.ControlComponent.POSTTEXTFIX||g.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT));return!R(d)||!R(u)||T||f?!1:(o.preventDefault(),l.awake?.(),!0)}function sd(o,t){if(o.key!==" "&&o.key!=="Spacebar"&&o.code!=="Space")return!1;const e=t.getDraw();if(e.isReadonly()||e.isDisabled())return!1;const n=e.getRange(),i=e.getControl();if(!i.getActiveControl()&&i.getIsRangeWithinControl()){i.setPopupAwakeDisabled(!0);try{i.initControl()}finally{i.setPopupAwakeDisabled(!1)}}const l=i.getActiveControl(),r=l?.getElement();if(r?.control?.type!==s.ControlType.BUTTON||r.control.buttonText||r.control.editable===!1||!i.getIsRangeWithinControl())return!1;const a=l.setValue([{value:" "}]);return~a&&(i.emitControlContentChange(),n.setRange(a,a),e.render({curIndex:a,isSubmitHistory:!0,traceLabel:"keydown:button-space"})),o.preventDefault(),!0}function rd(o,t){if(t.isComposing)return;const e=t.getDraw();if(!e.getMacroParticle().keydown(o))if(o.key===s.KeyMap.Backspace)Jc(o,t);else if(o.key===s.KeyMap.Delete)zc(o,t);else if(o.key===s.KeyMap.Enter)jc(o,t);else if(o.key===s.KeyMap.Left)qc(o,t);else if(o.key===s.KeyMap.Right)td(o,t);else if(o.key===s.KeyMap.Up||o.key===s.KeyMap.Down)nd(o,t);else{if(sd(o,t))return;if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.Z){if(e.isReadonly()&&e.getMode()!==s.EditorMode.FORM)return;e.getHistoryManager().undo(),o.preventDefault()}else if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.Y){if(e.isReadonly()&&e.getMode()!==s.EditorMode.FORM)return;e.getHistoryManager().redo(),o.preventDefault()}else if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.C)t.copy(),o.preventDefault();else if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.X)t.cut(),o.preventDefault();else if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.A)t.selectAll(),o.preventDefault();else if(Ae(o)&&o.key.toLocaleLowerCase()===s.KeyMap.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===s.KeyMap.ESC){t.clearPainterStyle();const n=e.getZone();n.isMainActive()||n.setZone(s.EditorZone.MAIN),o.preventDefault()}else o.key===s.KeyMap.TAB?ed(o,t):od(o)&&id(o,t)}}function ld(o){return/[\u4e00-\u9fa5\u3000-\u303f\uff00-\uffef]/.test(o)}function ad(o){return/[a-zA-Z]/.test(o)}function cd(o,t){return ld(o)?t:ad(o)?"Times New Roman":t}function Ho(o){return o?.type===s.ElementType.CONTROL&&(o.controlComponent===s.ControlComponent.PREFIX||o.controlComponent===s.ControlComponent.PRE_TEXT||o.controlComponent===s.ControlComponent.PRETEXTFIX||o.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)}function De(o){return o?.type===s.ElementType.CONTROL&&(o.controlComponent===s.ControlComponent.POSTFIX||o.controlComponent===s.ControlComponent.POST_TEXT||o.controlComponent===s.ControlComponent.POSTTEXTFIX||o.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)}function Gi(o){return!!o?.originControlId&&Ho(o)}function ao(o){return!!o?.originControlId&&De(o)}function dd(o,t){return!o||!t?!1:!!o.originControlId&&!!t.originControlId&&o.originControlId===t.originControlId&&o.controlId!==t.controlId}function Rn(o,t,e){if(!t)return null;const n=new Set;let i=t,l=null;for(;i&&!n.has(i);){n.add(i);let r;for(let a=0;a<o.length;a++){const c=o[a];if(c.controlId===i&&c.control?.type&&(r=c,c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT))break}if(!r)break;(r.control?.type===s.ControlType.TEXT||e===s.EditorMode.EDIT&&r.control?.type===s.ControlType.TEXTFIELD)&&(l=i),i=r.originControlId||null}return l}function je(o,t){return!!o&&!!t&&o.controlId===t}function Fr(o,t){if(t)return o.find(e=>e.controlId===t&&!e.originControlId&&!!e.control?.type)}function Xr(o,t,e){if(!t?.originControlId||e?.originControlId!==t.originControlId||!t.controlId||!e.controlId||t.controlId===e.controlId||!De(t)||!Ho(e))return;const n=Fr(o,t.originControlId);if(n?.control?.type===s.ControlType.TEXTFIELD)return n}function xi(o,t,e){Ne.forEach(n=>{delete o[n]}),ue.forEach(n=>{const i=t?.[n];i!==void 0&&(o[n]=i)}),t?.type===s.ControlType.TEXT&&o.color?.toLowerCase()==="#87d068"?o.color=e:o.color||(o.color=e)}function Ji(o,t,e,n){o.controlId=t,o.control=e,o.controlComponent=s.ControlComponent.VALUE,delete o.originControlId,xi(o,e,n)}function $i(o,t,e="input"){const n=re(),i=t.getDraw(),l=i.getControl(),r=i.getOptions(),a=i.getElementList();if(i.isDisabled()||i.getMacroParticle().input(o,t.isComposing)||i.isReadonly())return;const d=i.getPosition().getCursorPosition();if(!o||!d)return;const u=t.isComposing;if(u&&t.compositionInfo?.value===o)return;const h=i.getRange();if(!h.getIsCanInput())return;const R=h.getRange(),T=R.startIndex===R.endIndex?R.endIndex:R.startIndex,g=Tt=>{l.setPopupAwakeDisabled(!0);try{return Tt()}finally{l.setPopupAwakeDisabled(!1)}},f=()=>{g(()=>l.initControl())},C=(Tt,tt)=>{g(()=>{h.setRange(Tt,tt)})};let p=l.getActiveControl();const I=i.getElementList()[h.getRange().endIndex],m=I?.control?.type===s.ControlType.TEXT&&!!I?.originControlId&&(I.controlComponent===s.ControlComponent.PREFIX||I.controlComponent===s.ControlComponent.PRE_TEXT||I.controlComponent===s.ControlComponent.PRETEXTFIX||I.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||I.controlComponent===s.ControlComponent.POSTFIX||I.controlComponent===s.ControlComponent.POST_TEXT||I.controlComponent===s.ControlComponent.POSTTEXTFIX||I.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||I.controlComponent===s.ControlComponent.PLACEHOLDER);if(!p&&(l.getIsRangeWithinControl()||m)&&(f(),p=l.getActiveControl()),p){const Tt=p.getElement(),tt=i.getElementList()[h.getRange().endIndex],Dt=kt(Tt,tt),vt=!!tt&&tt.controlComponent===s.ControlComponent.VALUE&&!!tt.controlId&&!tt.originControlId&&h.getRange().endIndex>0&&i.getElementList()[h.getRange().endIndex-1]?.originControlId===tt.controlId;(!Dt||vt)&&(f(),p=l.getActiveControl())}const{endIndex:L}=h.getRange(),O=i.getElementList(),P=O[L],S=O[L+1];if(P?.type===s.ElementType.SUB_TEMPLATE&&S?.type===s.ElementType.SUB_TEMPLATE)return;const y=i.getMode()===s.EditorMode.FORM;if(y){const Tt=i.getPosition().getPositionContext().isTable&&i.isTableEditable()&&!p&&!l.getIsRangeWithinControl(),tt=h.getRange();if(!(i.getElementList()[tt.endIndex]?.control?.type===s.ControlType.TEXT)&&!Tt){const jt=l.getActiveTextControlLimit();if(!p||!l.getIsRangeWithinControl()&&!l.getIsRangeInPostfix())return;if(jt){const $=h.getRange();if($.startIndex<jt.startIndex||$.endIndex>jt.endIndex){const ne=Math.min(Math.max($.endIndex,jt.startIndex),jt.endIndex);g(()=>{h.setRange(ne,ne),i.render({curIndex:ne,isSubmitHistory:!1})});return}}const{endIndex:at}=h.getRange(),Pt=i.getElementList(),et=Pt[at];if(!et?.originControlId){if(et?.controlId&&et?.controlComponent===s.ControlComponent.VALUE){let $=!1;for(let ne=at;ne>=0;ne--){const qt=Pt[ne];if(qt.controlId!==et.controlId||qt.originControlId)break;if(qt.control?.type===s.ControlType.TEXTFIELD){$=!0;break}}if($)return}}}}const Y=h.getDefaultStyle()||t.compositionInfo?.defaultStyle||null,b=t.compositionInfo?.perfStartTime,M=hd(t,i.getElementList());u||i.getCursor().clearAgentDomValue();const{TEXT:V,HYPERLINK:N,SUBSCRIPT:X,SUPERSCRIPT:D,DATE:E,TAB:U}=s.ElementType,F=o.replaceAll(`
119
+ `,_),{startIndex:Z,endIndex:Q}=h.getRange(),W=h.getRangeAnchorStyle(M,Z);if(!W)return;const K=Z>0?M[Z-1]:null,k=!!(W.controlId||W.control),H={...!k&&K?K:W,...Y},A=i.isDesignMode(),v=M[Q+1],ct=Rn(M,W.originControlId,i.getMode()),bt=Rn(M,v?.originControlId,i.getMode()),Qt=!W.originControlId&&!v?.originControlId&&De(W)&&Ho(v)&&!!W.controlId&&!!v.controlId&&W.controlId!==v.controlId,me=ao(W)&&Gi(v)&&!ct&&!bt,Gt=i.getMode()===s.EditorMode.EDIT?Xr(M,W,v):void 0,Re=!!W.originControlId&&De(W)&&v?.controlId===W.originControlId&&!v.originControlId&&v.control?.type===s.ControlType.TEXTFIELD&&De(v),nt=!!W.originControlId&&De(W)&&v?.controlId===W.originControlId&&!v.originControlId&&v.control?.type===s.ControlType.TEXTFIELD&&v.controlComponent===s.ControlComponent.VALUE,G=!!ct&&ct===bt&&!!W.controlId&&!!v?.controlId&&W.controlId!==v.controlId&&(ao(W)||Gi(v))?ct:null;if(y&&(Qt||me))return;const J=Ho(v)&&!v?.originControlId,it=(()=>{const Tt=p?.getElement();if(!y||Tt?.control?.type!==s.ControlType.TEXT||!W.subTemplateParentId||!De(W)||!v||v.subTemplateParentId===W.subTemplateParentId||!kt(v,Tt))return!1;for(let tt=Z-1;tt>=0;tt--){const Dt=M[tt];if(Dt.type===s.ElementType.SUB_TEMPLATE&&Dt.id===W.subTemplateParentId)return Dt.controlId===Tt.controlId&&(Dt.originControlId||null)===(Tt.originControlId||null)}return!1})(),q=De(W)&&!W.originControlId&&!it||W.type===s.ElementType.CONTROL&&W.controlComponent===s.ControlComponent.VALUE&&v?.type!==s.ElementType.CONTROL&&!W.originControlId,ut=[s.ControlType.SELECT,s.ControlType.DATE,s.ControlType.BUTTON],gt=(Tt,tt)=>{if(Tt?.control?.type)return Tt.control.type;if(Tt?.controlId){for(let Dt=tt;Dt>=0;Dt--){const vt=M[Dt];if(!kt(Tt,vt))break;if(vt.control?.type)return vt.control.type}for(let Dt=tt+1;Dt<M.length;Dt++){const vt=M[Dt];if(!kt(Tt,vt))break;if(vt.control?.type)return vt.control.type}}},Ot=(Tt,tt)=>{const Dt=gt(Tt,tt);return!!(Dt&&ut.includes(Dt))},Et=Tt=>{const tt=M[Tt];let Dt=Tt;for(let vt=Tt+1;vt<M.length&&kt(tt,M[vt]);vt++)Dt=vt;return Dt},yt=!!(Ot(W,Z)&&W.controlComponent===s.ControlComponent.VALUE&&!W.originControlId&&kt(W,v)&&De(v)&&!v?.value),Ft=!!((Ot(W,Z)||gt(W,Z)===s.ControlType.NUMBER)&&W.controlComponent===s.ControlComponent.VALUE&&W.originControlId&&kt(W,v)&&De(v))?Rn(M,W.originControlId,i.getMode()):null,Vt=Fr(M,Ft),Bt=J||q||yt,pt=Bt?{...W,type:void 0,control:void 0,controlId:void 0,controlComponent:void 0,originControlId:void 0,color:r.defaultColor,highlight:void 0}:W,ht=Bt||k?pt:H,Lt=Nt(F).map(Tt=>{const tt={value:Tt};if(A||!ht.title?.disabled&&!ht.control?.disabled){const Dt=M[Q+1];(!ht.type||ht.type===V||ht.type===N&&Dt?.type===N||ht.type===E&&Dt?.type===E||ht.type===X&&Dt?.type===X||ht.type===D&&Dt?.type===D)&&ba.forEach(vt=>{if(vt==="groupIds"&&!Dt?.groupIds)return;const jt=ht[vt];jt!==void 0&&(tt[vt]=jt)}),(Y||ht.type===U)&&Ne.forEach(vt=>{const jt=Y?.[vt]||ht[vt];jt!==void 0&&(tt[vt]=jt)}),u&&(tt.underline=!0)}if(!Bt){const Dt=W.originControlId&&(W.controlComponent===s.ControlComponent.POSTFIX||W.controlComponent===s.ControlComponent.POSTTEXTFIX||W.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||W.controlComponent===s.ControlComponent.POST_TEXT);if(Re||nt||Gt){const at=Gt||v;tt.controlId=at.controlId,tt.control=at.control,tt.controlComponent=s.ControlComponent.VALUE,delete tt.originControlId,xi(tt,at.control,r.defaultColor)}const vt=!W.originControlId&&W.controlId&&(W.controlComponent===s.ControlComponent.POSTFIX||W.controlComponent===s.ControlComponent.POSTTEXTFIX||W.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||W.controlComponent===s.ControlComponent.POST_TEXT)&&v?.controlId&&v.controlId!==W.controlId&&dd(W,v),jt=W.controlId&&W.originControlId&&(W.controlComponent===s.ControlComponent.VALUE||W.controlComponent===s.ControlComponent.PLACEHOLDER);if(!Re&&!nt&&!Gt&&Dt&&!tt.controlId){const at=Rn(M,W.originControlId,i.getMode());if(!at)return tt;let Pt=null;for(let et=Z;et>=0;et--){const $=M[et];if(je($,at)&&$.control){Pt=$.control;break}}tt.controlId=at,tt.controlComponent=s.ControlComponent.VALUE,Pt&&(tt.control=Pt),xi(tt,Pt,r.defaultColor)}else if(vt&&!tt.controlId){if(v?.controlId&&v.controlId!==W.controlId)if(v.controlComponent===s.ControlComponent.PREFIX||v.controlComponent===s.ControlComponent.PRETEXTFIX)for(let at=Z;at>=0;at--){const Pt=M[at];if(Pt.controlId===W.controlId&&(Pt.controlComponent===s.ControlComponent.PREFIX||Pt.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let et=at-1;et>=0;et--){const $=M[et];if($.controlId&&$.controlId!==W.controlId&&($.controlComponent===s.ControlComponent.PRETEXTFIX||$.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||$.controlComponent===s.ControlComponent.PREFIX||$.controlComponent===s.ControlComponent.PRE_TEXT)){tt.controlId=$.controlId,tt.controlComponent=s.ControlComponent.VALUE,$.control&&(tt.control=$.control);break}if($.controlId&&$.controlId!==W.controlId&&($.controlComponent===s.ControlComponent.POSTFIX||$.controlComponent===s.ControlComponent.POSTTEXTFIX))break}break}}else(v.controlComponent===s.ControlComponent.POSTFIX||v.controlComponent===s.ControlComponent.POSTTEXTFIX)&&(tt.controlId=v.controlId,tt.controlComponent=s.ControlComponent.VALUE,v.control&&(tt.control=v.control));if(!tt.controlId)for(let at=Z;at>=0;at--){const Pt=M[at];if(Pt.controlId===W.controlId&&(Pt.controlComponent===s.ControlComponent.PREFIX||Pt.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let et=at-1;et>=0;et--){const $=M[et];if($.controlId&&$.controlId!==W.controlId&&($.controlComponent===s.ControlComponent.PRETEXTFIX||$.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||$.controlComponent===s.ControlComponent.PREFIX||$.controlComponent===s.ControlComponent.PRE_TEXT)){tt.controlId=$.controlId,tt.controlComponent=s.ControlComponent.VALUE,$.control&&(tt.control=$.control);break}if($.controlId&&$.controlId!==W.controlId&&($.controlComponent===s.ControlComponent.POSTFIX||$.controlComponent===s.ControlComponent.POSTTEXTFIX))break}break}}}else if(jt&&!tt.controlId){const at=W.controlId;let Pt=W.control;if(!Pt)for(let et=Z;et>=0;et--){const $=M[et];if($.controlId===at&&$.control&&(Pt=$.control,$.controlComponent===s.ControlComponent.PREFIX||$.controlComponent===s.ControlComponent.PRETEXTFIX))break}tt.controlId=at,tt.originControlId=W.originControlId,tt.controlComponent=s.ControlComponent.VALUE,Pt&&(tt.control=Pt)}else if(W.controlId){let at=W.control;if(!at)for(let Pt=Z;Pt>=0;Pt--){const et=M[Pt];if(je(et,W.controlId)&&et.control){at=et.control;break}}tt.controlId||(tt.controlId=W.controlId),at&&!tt.control&&(tt.control=at),tt.controlComponent||(tt.controlComponent=s.ControlComponent.VALUE)}else if(!tt.controlId&&!tt.control&&v?.originControlId&&(v.controlComponent===s.ControlComponent.PREFIX||v.controlComponent===s.ControlComponent.PRETEXTFIX)){const at=Rn(M,v.originControlId,i.getMode());if(!at)return tt;let Pt=null;for(let et=Q;et>=0;et--){const $=M[et];if(je($,at)&&$.control){Pt=$.control;break}}tt.controlId=at,tt.controlComponent=s.ControlComponent.VALUE,Pt&&(tt.control=Pt)}}if(Tt&&Tt!==_){const Dt=cd(Tt,r.defaultFont);tt.font=Dt}return tt});let Ct;const St=a[T],Kt=a[T+1],ge=a[T-1];if(u)Ct=Z;else{const Tt=et=>{if(Lt?.length)for(let $=0;$<Lt.length;$++)M.splice(et+$,0,Lt[$]);return et+Lt.length-1},tt=Z+1,Dt=yt?Et(Z)+1:tt,vt=()=>{let et=null,$,ne=null;const qt=i.getMode()===s.EditorMode.EDIT?Xr(a,St,Kt):void 0;if(qt?.controlId?(et=qt.controlId,$=qt.control?.type):i.getMode()===s.EditorMode.EDIT&&ao(St)&&Kt?.controlId===St.originControlId&&!Kt.originControlId&&Kt.control?.type===s.ControlType.TEXTFIELD&&(Kt.controlComponent===s.ControlComponent.VALUE||De(Kt))?(et=St.originControlId,$=s.ControlType.TEXTFIELD):ao(St)?et=Rn(a,St.originControlId,i.getMode()):Gi(Kt)?et=Rn(a,Kt.originControlId,i.getMode()):G?et=G:St?.control?.type===s.ControlType.TEXT&&St.controlId&&!St.originControlId&&De(St)&&ge?.originControlId===St.controlId&&(et=St.controlId,ne={startIndex:T-1,endIndex:T-1}),!et)return null;if(!$)for(let _t=T;_t>=0;_t--){const te=a[_t];if(je(te,et)&&te.control?.type){$=te.control.type;break}if(te.controlId&&te.controlId!==et&&te.originControlId!==et)break}return $!==s.ControlType.TEXT&&!(i.getMode()===s.EditorMode.EDIT&&$===s.ControlType.TEXTFIELD)?null:{parentControlId:et,activationIndex:(()=>{for(let _t=T+1;_t<a.length;_t++){const te=a[_t];if(je(te,et))return _t;if(te.controlId&&te.controlId!==et&&te.originControlId!==et)break}for(let _t=T;_t>=0;_t--){const te=a[_t];if(je(te,et))return _t;if(te.controlId&&te.controlId!==et&&te.originControlId!==et)break}return T})(),boundaryRange:ne}},jt=p?.getElement(),at=!!(jt?.control?.type===s.ControlType.BUTTON&&!jt.control?.buttonText&&jt.control?.editable!==!1&&l.getIsRangeWithinControl());Z!==Q&&!at&&(i.removeSplitTdOtherRangeElements(),i.spliceElementList(M,tt,Q-Z));const Pt=vt();if(Ft&&Vt?.control){const et=Et(Z);Lt.forEach($=>{Ji($,Ft,Vt.control,r.defaultColor)}),le(M,Lt,et,{editorOptions:r}),i.spliceElementList(M,et+1,0,Lt),Ct=et+Lt.length}else if(Pt){const{parentControlId:et,activationIndex:$,boundaryRange:ne}=Pt;C($,$),f();const qt=l.getActiveControl(),Ie=Kt?.controlId===et&&!Kt?.originControlId&&Kt?.controlComponent===s.ControlComponent.VALUE?T+1:-1,_t=!!(St?.originControlId&&ao(St)&&Ie!==-1),te=ne||(_t?{startIndex:T,endIndex:T}:Ie!==-1?{startIndex:T,endIndex:Ie}:{startIndex:Z,endIndex:Q});C(te.startIndex,te.endIndex),qt&&qt.getElement()?.controlId===et&&(qt.getElement()?.control?.type===s.ControlType.TEXT||qt.getElement()?.control?.type===s.ControlType.TEXTFIELD)?(Lt.forEach(Vn=>{Ji(Vn,et,qt.getElement().control,r.defaultColor)}),Ct=qt.setValue(Lt,{range:te,elementList:M}),l.emitControlContentChange(),C(Ct,Ct),f()):Bt?Ct=Tt(Dt):(Ct=l.setValue(Lt),l.emitControlContentChange())}else if(Bt)Ct=Tt(Dt);else if(St?.originControlId&&(St.controlComponent===s.ControlComponent.POSTFIX||St.controlComponent===s.ControlComponent.POST_TEXT||St.controlComponent===s.ControlComponent.POSTTEXTFIX||St.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))if(p?.getElement()?.control?.type===s.ControlType.TEXT&&p.getElement()?.controlId===St.controlId&&(p.getElement()?.originControlId||null)===(St.originControlId||null))Ct=l.setValue(Lt),l.emitControlContentChange();else{const $=Rn(a,St.originControlId,i.getMode());if(!$){Ct=Tt(tt);return}let ne;for(let Ie=T;Ie>=0;Ie--){const _t=a[Ie];if(je(_t,$)&&_t.control?.type){ne=_t.control.type;break}if(_t.controlId&&_t.controlId!==$&&_t.originControlId!==$)break}if(ne===s.ControlType.TEXT||i.getMode()===s.EditorMode.EDIT&&ne===s.ControlType.TEXTFIELD){const Ie=()=>{for(let Me=T+1;Me<a.length;Me++){const we=a[Me];if(je(we,$))return Me;if(we.controlId&&we.controlId!==$&&we.originControlId!==$)break}for(let Me=T;Me>=0;Me--){const we=a[Me];if(je(we,$))return Me;if(we.controlId&&we.controlId!==$&&we.originControlId!==$)break}return T},_t=Kt?.controlId===$&&Kt?.controlComponent===s.ControlComponent.VALUE?T+1:-1,te=_t!==-1?{startIndex:T,endIndex:_t}:{startIndex:T,endIndex:T},Vn=Ie();C(Vn,Vn),f();const mn=l.getActiveControl();C(te.startIndex,te.endIndex),mn&&mn.getElement()?.controlId===$&&(mn.getElement()?.control?.type===s.ControlType.TEXT||mn.getElement()?.control?.type===s.ControlType.TEXTFIELD)?(Lt.forEach(Me=>{Ji(Me,$,mn.getElement().control,r.defaultColor)}),Ct=mn.setValue(Lt,{range:te,elementList:M}),l.emitControlContentChange(),C(Ct,Ct),f()):Ct=Tt(tt)}else Ct=Tt(tt)}else if((St?.control?.type===s.ControlType.SELECT||Kt?.control?.type===s.ControlType.SELECT)&&p?.getElement()?.control?.type===s.ControlType.SELECT&&l.getIsRangeWithinControl()){const et=l.getActiveControl();et&&typeof et.awake=="function"&&et.awake(),Ct=Z}else if(p?.getElement()?.control?.type===s.ControlType.DATE&&l.getIsRangeWithinControl()){const et=l.getActiveControl();et&&typeof et.awake=="function"&&et.awake(),Ct=Z}else!Bt&&(St?.control?.type===s.ControlType.BUTTON||Kt?.control?.type===s.ControlType.BUTTON)?p?.getElement()?.control?.type===s.ControlType.BUTTON&&p.getElement()?.control?.editable!==!1&&l.getIsRangeWithinControl()?(Ct=l.setValue(Lt),l.emitControlContentChange()):Ct=Z:p&&l.getIsRangeWithinControl()?(Ct=l.setValue(Lt),l.emitControlContentChange()):(St?.type==="control"||Kt?.type==="control")&&!Bt?Ct=Tt(tt):(le(M,Lt,Z,{editorOptions:r}),i.spliceElementList(M,tt,0,Lt),Ct=Z+Lt.length)}if(~Ct&&!u){const Tt=re()-n,tt=re();g(()=>{h.setRange(Ct,Ct);const Dt=i.getElementList()[Ct],vt=Dt?.controlComponent===s.ControlComponent.VALUE&&(Dt.control?.type===s.ControlType.TEXT||Dt.control?.type===s.ControlType.TEXTFIELD),jt={curIndex:Ct,isSubmitHistory:!u,traceLabel:`input:${e}`};vt?i.requestRender(jt):i.render(jt)}),Oi(r,`input:${e}`,re()-n,[{label:"mutate",duration:Tt},{label:"renderSchedule",duration:re()-tt}],{isComposing:u,textLength:Lt.length,compositionChainDuration:e==="compositionend"&&b!==void 0?Number((re()-b).toFixed(2)):void 0})}u&&(t.compositionInfo={value:F,startIndex:Ct,endIndex:Q,defaultStyle:Y,perfStartTime:n})}function ud(o){o.compositionInfo&&(o.compositionInfo=null)}function hd(o,t){if(!o.compositionInfo||o.isComposing)return t;const{startIndex:e,endIndex:n}=o.compositionInfo;return e!==n&&(o.getDraw().removeSplitTdOtherRangeElements(),o.getDraw().spliceElementList(t,e+1,n-e),o.getDraw().getRange().setRange(e,e)),o.compositionInfo=null,t}async function Rd(o){const t=o.getDraw(),e=t.getRange(),{startIndex:n,endIndex:i}=e.getRange();if(!~n&&!~n||t.isReadonly()||!e.getIsCanInput())return;const l=t.getElementList();let r=n,a=i;if(n===i){const R=t.getPosition().getPositionList(),T=R[n],g=T.rowNo,f=T.pageNo,C=[];for(let I=0;I<R.length;I++){const m=R[I];if(m.pageNo>f)break;m.pageNo===f&&m.rowNo===g&&C.push(I)}const p=C[0]-1;r=p<0?0:p,a=C[C.length-1]}const c=t.getOptions();await Ir(l.slice(r+1,a+1),c);const d=t.getControl();let u;d.getActiveControl()&&d.getIsRangeWithinControl()?(u=d.cut(),d.emitControlContentChange()):(t.spliceElementList(l,r+1,a-r),u=r),e.setRange(u,u),t.render({curIndex:u})}function gd(o){return o.replace(/^(?:\r\n|\r|\n)+|(?:\r\n|\r|\n)+$/g,"")}async function Td(o,t){const e=o.getDraw(),n=e.getMode()===s.EditorMode.COMPARE,i=n||t?.isPlainText,{copy:l}=e.getOverride();if(l&&l()?.preventDefault!==!1)return;const r=e.getRange();let a=null;if(r.getRange().isCrossRowCol){const d=r.getRangeTableElement();if(!d)return;const u=e.getTableParticle().getRangeRowCol();if(!u)return;const h={type:s.ElementType.TABLE,value:"",colgroup:[],trList:[]},R=u[0],T=R[0].colIndex,g=R[R.length-1],f=g.colIndex+g.colspan-1;for(let C=T;C<=f;C++)h.colgroup.push(d.colgroup[C]);for(let C=0;C<u.length;C++){const p=u[C],I=d.trList[p[0].rowIndex],m={tdList:[],height:I.height,minHeight:I.minHeight};for(let L=0;L<p.length;L++)m.tdList.push(p[L]);h.trList.push(m)}a=n?[h]:Ut([h])}else a=r.getIsCollapsed()?r.getRangeRowElementList():r.getSelectionElementList();if(i&&a?.length){const d=Pn(a,e.getOptions());await wc(n?gd(d):d);return}a?.length&&await Ir(a,e.getOptions())}function fd(o,t){const e=t.getDraw(),{drop:n}=e.getOverride();if(n&&n(o)?.preventDefault!==!1)return;o.preventDefault();const i=o.dataTransfer?.getData("text");if(i)t.input(i);else{const l=o.dataTransfer?.files;if(!l)return;for(let r=0;r<l.length;r++){const a=l[r];a.type.startsWith("image")&&Hi(t,a)}}}function yr(o){if(!Intl.Segmenter)return null;const t=o.getDraw(),e=t.getPosition().getCursorPosition();if(!e)return null;const i=t.getRange().getRangeParagraphInfo();if(!i)return null;const l=i?.elementList?.map(R=>!R.type||R.type!==s.ElementType.CONTROL&&Le.includes(R.type)?R.value:_).join("")||"";if(!l)return null;const r=e.isFirstLetter||t.getCursor().getHitLineStartIndex()?e.index+1:e.index,a=i.startIndex,d=new Intl.Segmenter(void 0,{granularity:"word"}).segment(l);let u=-1,h=-1;for(const{segment:R,index:T,isWordLike:g}of d){const f=T+a;if(g&&r>=f&&r<f+R.length){u=f-1,h=u+R.length;break}}return~u&&~h?{startIndex:u,endIndex:h}:null}function md(o){const t=o.getDraw(),e=t.getPosition().getCursorPosition();if(!e)return null;const{value:n,index:i}=e,l=t.getLetterReg();let r=0,a=0;const c=mi.test(n);if(c||l.test(n)){const u=t.getElementList();let h=i-1;for(;h>0;){const T=u[h].value;if(c&&mi.test(T)||!c&&l.test(T))r++,h--;else break}let R=i+1;for(;R<u.length;){const T=u[R].value;if(c&&mi.test(T)||!c&&l.test(T))a++,R++;else break}}const d=i-r-1;return d<0?null:{startIndex:d,endIndex:i+a}}function Cd(o,t){const e=o.getDraw();if(!t.isDirectHit)return!1;let n,i;if(t.isTable){const r=e.getOriginalElementList()[t.index]?.trList?.[t.trIndex]?.tdList[t.tdIndex];n=r?.value[t.tdValueIndex],i=r?.positionList?.[t.tdValueIndex]}else n=e.getOriginalElementList()[t.index],i=e.getPosition().getOriginalPositionList()[t.index];return!n||!i?!1:(e.getMenstrualHistoryParticle().clearMenstrualHistoryEditor(),e.getFetalHeartPositionParticle().clearFetalHeartPositionEditor(),e.getToothPositionParticle().clearToothPositionEditor(),n.type===s.ElementType.MENSTRUAL_HISTORY?(e.getMenstrualHistoryParticle().renderMenstrualHistoryEditor(n,i),!0):n.type===s.ElementType.FETAL_HEART_POSITION?(e.getFetalHeartPositionParticle().renderFetalHeartPositionEditor(n,i),!0):n.type===s.ElementType.TOOTH_POSITION?(e.getToothPositionParticle().renderToothPositionEditor(n,i),!0):!1)}function pd(o,t){const e=o.getDraw(),n=e.getPosition(),i=n.getPositionByXY({x:t.offsetX,y:t.offsetY});if((e.getMode()===s.EditorMode.EDIT||e.getMode()===s.EditorMode.FORM)&&Cd(o,i))return;if(e.getMode()===s.EditorMode.FORM){const c=i.isTable&&e.getTd()?.value||e.getElementList(),d=i.isTable?i.tdValueIndex:i.index,u=c[d],h=Id(c,u),R=e.getEventBus();if(i.isDirectHit&&h?.controlId&&h.control?.type===s.ControlType.BUTTON&&!h.control.buttonText&&R.isSubscribe("buttonChange")){const T=c.filter(g=>g.controlId===h.controlId&&(g.originControlId||null)===(h.originControlId||null));R.emit("buttonChange",{evt:t,element:rt(h),elementList:rt(T),controlId:h.controlId,control:rt(h.control)});return}}if(i.isImage&&i.isDirectHit){const c=e.getElementList(),d=e.getEventBus(),u=c[i.index];if(d.isSubscribe("imageDblclick")&&d.emit("imageDblclick",{evt:t,element:u}),u.imgPreviewDisabled)return;e.getPreviewer().render();return}if(e.getIsPagingMode()&&e.getMode()===s.EditorMode.EDIT&&!~i.index&&i.zone){e.getZone().setZone(i.zone),e.clearSideEffect(),n.setPositionContext({isTable:!1});return}if((i.isCheckbox||i.isRadio)&&i.isDirectHit)return;const r=e.getRange(),a=yr(o)||md(o);a&&(r.setRange(a.startIndex,a.endIndex),e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),r.setRangeStyle())}function Id(o,t){if(!t?.controlId)return null;const e=t.originControlId||null,n=l=>!!(l&&l.controlId===t.controlId&&(l.originControlId||null)===e);if(t.control?.type===s.ControlType.BUTTON)return t;const i=o.indexOf(t);for(let l=i;l>=0;l--){const r=o[l];if(!n(r))break;if(r.control?.type===s.ControlType.BUTTON)return r}for(let l=i+1;l<o.length;l++){const r=o[l];if(!n(r))break;if(r.control?.type===s.ControlType.BUTTON)return r}return null}function Ed(o){const t=o.getDraw(),e=t.getControl();if(e.getActiveControl()&&e.selectValue())return;const i=t.getPosition().getCursorPosition();if(!i)return;const{index:l}=i,r=t.getElementList();let a=0,c=0,d=l-1;for(;d>0;){const g=r[d],f=r[d-1];if(g.value===_&&!g.listWrap||g.listId!==f?.listId||g.titleId!==f?.titleId)break;a++,d--}let u=l+1;for(;u<r.length;){const g=r[u],f=r[u+1];if(g.value===_&&!g.listWrap||g.listId!==f?.listId||g.titleId!==f?.titleId)break;c++,u++}const h=t.getRange();let R=l-a-1;if(r[R]?.value!==_&&(R-=1),R<0)return;let T=l+c+1;(r[T]?.value===_||T>r.length-1)&&(T-=1),h.setRange(R,T),t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}const Nr={dblclick:pd,threeClick:Ed};function Ld(o){o.isComposing=!0,o.getDraw().getMacroParticle().compositionStart()}function Pd(o,t){const e=re();o.isComposing=!1;const n=o.getDraw(),i=n.getOptions();if(n.getMacroParticle().compositionEnd(t.data)){n.getCursor().clearAgentDomValue();return}if(t.data)o.compositionInfo&&(o.compositionInfo.perfStartTime=e),Na?setTimeout(()=>{o.compositionInfo&&$i(t.data,o,"compositionend")},1):o.compositionInfo&&$i(t.data,o,"compositionend");else{const a=o.compositionInfo?.cancel;if(ud(o),!a){const c=n.getRange(),{endIndex:d}=c.getRange();n.render({curIndex:d,isSubmitHistory:!1,traceLabel:"compositionend:empty"})}}n.getCursor().clearAgentDomValue(),Oi(i,"compositionend",re()-e,[],{hasData:!!t.data,dataLength:t.data?.length||0})}function Md(o){o.compositionInfo&&(o.compositionInfo.cancel=!0)}const zi={compositionstart:Ld,compositionend:Pd,compositionCancel:Md};function Od(o,t){const e=t.getDraw();if(e.isReadonly())return;o.preventDefault();const i=e.getPageContainer();if(!Hs(o.target,m=>m===i))return;const a=o.target.dataset.index;a&&e.setPageNo(Number(a));const c=e.getPosition(),d=c.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!d)return;const{isTable:u,tdValueIndex:h,index:R}=d,T=c.getPositionList(),g=u?h:R;~R&&(e.getRange().setRange(g,g),c.setCursorPosition(T[g]));const f=e.getCursor(),{cursor:{dragColor:C,dragWidth:p,dragFloatImageDisabled:I}}=e.getOptions();if(I){const m=t.cacheElementList?.[t.cacheRange.startIndex];if(m?.type===s.ElementType.IMAGE&&(m.imgDisplay===s.ImageDisplay.FLOAT_TOP||m.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM||m.imgDisplay===s.ImageDisplay.SURROUND))return}f.drawCursor({width:p,color:C,isBlink:!1,isFocus:!1})}const Sd={dragover:Od};class Dd{isAllowSelection;isComposing;compositionInfo;isAllowDrag;isAllowDrop;cacheRange;cacheElementList;cachePositionList;cachePositionContext;mouseDownStartPosition;draw;pageContainer;pageList;range;position;constructor(t){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)),pa(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;let n=this.range.getSelection();if(!n){const r=yr(this);r&&(n=this.draw.getElementList().slice(r.startIndex+1,r.endIndex+1))}if(!n)return;const i=Object.keys(t);n.forEach(r=>{i.forEach(a=>{const c=a;Reflect.set(r,c,t[c])})}),this.draw.render({isSetCursor:!1});const l=this.draw.getPainterOptions();(!l||!l.isDblclick)&&this.clearPainterStyle()}selectAll(){if(!this.draw.isSelectionDisabled())if(this.position.getPositionContext().isTable)this.draw.getTableOperate().tableSelectAll();else{const t=this.position.getPositionList();this.range.setRange(0,t.length-1),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}}mousemove(t){this.draw.isInteractionSuspended()||kc(t,this)}mousedown(t){this.draw.isInteractionSuspended()||(this.draw.flushPendingRender(),Ac(t,this))}click(){this.draw.isInteractionSuspended()||Xa&&!this.draw.isReadonly()&&this.draw.getCursor().getAgentDom().focus()}mouseup(t){this.draw.isInteractionSuspended()||_c(t,this)}mouseleave(t){this.draw.isInteractionSuspended()||Bc(t,this)}keydown(t){if(this.draw.isInteractionSuspended())return;t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey||this.draw.flushPendingRender(),rd(t,this)}dblclick(t){this.draw.isInteractionSuspended()||Nr.dblclick(this,t)}threeClick(){this.draw.isInteractionSuspended()||Nr.threeClick(this)}input(t,e="input"){this.draw.isInteractionSuspended()||$i(t,this,e)}async cut(){this.draw.isInteractionSuspended()||await Rd(this)}async copy(t){this.draw.isInteractionSuspended()||await Td(this,t)}compositionstart(){this.draw.isInteractionSuspended()||(this.draw.flushPendingRender(),zi.compositionstart(this))}compositionend(t){this.draw.isInteractionSuspended()||zi.compositionend(this,t)}compositionCancel(){this.draw.isInteractionSuspended()||zi.compositionCancel(this)}drop(t){this.draw.isInteractionSuspended()||fd(t,this)}dragover(t){this.draw.isInteractionSuspended()||Sd.dragover(t,this)}}const br={PAGE_SCALE:"pageScale"};class Fd{draw;options;cursor;canvasEvent;range;previewer;tableTool;hyperlinkParticle;control;dateParticle;imageParticle;dprMediaQueryList;constructor(t,e){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("mousedown",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("mousedown",this.clearSideEffect),document.removeEventListener("mouseup",this.setCanvasEventAbility),document.removeEventListener("wheel",this.setPageScale),document.removeEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.removeEventListener("change",this._handleDprChange)}clearSideEffect=t=>{if(!this.cursor)return;if(this.draw.isInteractionSuspended()){this.resetSideEffect();return}const e=t?.composedPath?.()[0]||t.target;if(this.draw.isTargetInsideEditor(e)){this.watchCursorActive();return}this.resetSideEffect()};resetSideEffect=()=>{this.cursor&&(this.cursor.recoveryCursor(),this.range.recoveryRangeStyle(),this.previewer.clearResizer(),this.tableTool.dispose(),this.hyperlinkParticle.clearHyperlinkPopup(),this.control.destroyControl(),this.dateParticle.clearDatePicker(),this.imageParticle.destroyFloatImage())};setCanvasEventAbility=()=>{this.canvasEvent.setIsAllowDrag(!1),this.canvasEvent.setIsAllowSelection(!1)};watchCursorActive(){this.range.getIsCollapsed()&&setTimeout(()=>{this.cursor?.getAgentIsActive()||this.cursor?.drawCursor({isFocus:!1,isBlink:!1})})}setPageScale=t=>{if(this.draw.isInteractionSuspended()||!this.draw.isTargetInsideEditor(t.target)||this.options.shortcutDisableKeys.includes(br.PAGE_SCALE)||!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)}};_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})}};_handleDprChange=()=>{this.draw.setPageDevicePixel()}}class Xd{undoStack=[];redoStack=[];maxRecordCount;constructor(t){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 yd{cursorPosition;positionContext;positionList;floatPositionList;draw;eventBus;options;constructor(t){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:l,startY:r,startRowIndex:a,startIndex:c,innerWidth:d,zone:u}=t,{scale:h,table:{tdPadding:R}}=this.options;let T=l,g=r,f=c;for(let C=0;C<n.length;C++){const p=n[C];if(!p.isSurround){const O=p.width+(p.offsetX||0);p.rowFlex===s.RowFlex.CENTER?T+=(d-O)/2:p.rowFlex===s.RowFlex.RIGHT&&(T+=d-O)}T+=p.offsetX||0,g+=p.offsetY||0;const I=T,m=g,L=p.elementList.some(O=>!ae(O)&&O.type===s.ElementType.IMAGE&&O.controlComponent===s.ControlComponent.VALUE&&(O.control?.type===s.ControlType.TEXT||O.control?.type===s.ControlType.TEXTFIELD)&&O.imgDisplay!==s.ImageDisplay.SURROUND&&O.imgDisplay!==s.ImageDisplay.FLOAT_TOP&&O.imgDisplay!==s.ImageDisplay.FLOAT_BOTTOM);for(let O=0;O<p.elementList.length;O++){const P=p.elementList[O],S=P.metrics;let y=!ae(P)&&(P.imgDisplay!==s.ImageDisplay.INLINE&&P.type===s.ElementType.IMAGE||P.type===s.ElementType.LATEX)?p.ascent-S.height:p.ascent;const Y=P.vertical||(L?s.VerticalAlign.MIDDLE:void 0);if(Y&&!ae(P)){const M=P.type===s.ElementType.IMAGE||P.type===s.ElementType.LATEX,V=M?0:S.boundingBoxAscent,N=M?Math.max(S.height,S.boundingBoxAscent+S.boundingBoxDescent):S.boundingBoxAscent+S.boundingBoxDescent;Y===s.VerticalAlign.TOP?y=V:Y===s.VerticalAlign.MIDDLE?y=(p.height-N)/2+V:Y===s.VerticalAlign.BOTTOM&&(y=p.height-N+V)}P.left&&(T+=P.left),P.translateX&&(T+=P.translateX*h);const b={pageNo:i,index:f,value:P.value,rowIndex:a+C,rowNo:C,metrics:S,left:P.left||0,ascent:y,lineHeight:p.height,isFirstLetter:O===0,isLastLetter:O===p.elementList.length-1,coordinate:{leftTop:[T,g],leftBottom:[T,g+p.height],rightTop:[T+S.width,g],rightBottom:[T+S.width,g+p.height]}};if(P.imgDisplay===s.ImageDisplay.SURROUND||P.imgDisplay===s.ImageDisplay.FLOAT_TOP||P.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM){const M=e[e.length-1];M&&(b.metrics=M.metrics,b.coordinate=M.coordinate),P.imgFloatPosition||(P.imgFloatPosition={x:T,y:g,pageNo:i}),this.floatPositionList.push({pageNo:i,element:P,position:b,isTable:t.isTable,index:t.index,tdIndex:t.tdIndex,trIndex:t.trIndex,tdValueIndex:f,zone:u})}if(e.push(b),f++,T+=S.width,P.type===s.ElementType.TABLE&&!ae(P)){const M=P.tdPadding||R,V=M[1]+M[3],N=M[0]+M[2];for(let X=0;X<P.trList.length;X++){const D=P.trList[X];for(let E=0;E<D.tdList.length;E++){const U=D.tdList[E];U.positionList=[];const F=U.rowList,Z=this.computePageRowPosition({positionList:U.positionList,rowList:F,pageNo:i,startRowIndex:0,startIndex:0,startX:(U.x+M[3])*h+I+(P.translateX||0)*h,startY:(U.y+M[0])*h+m,innerWidth:(U.width-V)*h,isTable:!0,index:f-1,tdIndex:E,trIndex:X,zone:u});if(U.verticalAlign===s.VerticalAlign.MIDDLE||U.verticalAlign===s.VerticalAlign.BOTTOM){const Q=F.reduce((k,B)=>k+B.height,0),W=(U.height-N)*h-Q,K=U.verticalAlign===s.VerticalAlign.MIDDLE?W/2:W;Math.floor(K)>0&&U.positionList.forEach(k=>{const{coordinate:{leftTop:B,leftBottom:H,rightBottom:A,rightTop:v}}=k;B[1]+=K,H[1]+=K,A[1]+=K,v[1]+=K})}T=Z.x,g=Z.y}}T=I,g=m}}T=l,g+=p.height}return{x:T,y:g,index:f}}computePositionList(){this.positionList=[];const t=this.draw.getInnerWidth(),e=this.draw.getPageRowList(),n=this.draw.getMargins(),i=n[3],r=this.draw.getHeader().getExtraHeight(),a=n[0]+r;let c=0;for(let d=0;d<e.length;d++){const u=e[d];if(!u?.length)continue;const h=u[0].startIndex;this.computePageRowPosition({positionList:this.positionList,rowList:u,pageNo:d,startRowIndex:c,startIndex:h,startX:i,startY:a,innerWidth:t}),c+=u.length}}computeRowPosition(t){const{row:e,innerWidth:n}=t,i=[];return this.computePageRowPosition({positionList:i,innerWidth:n,rowList:[rt(e)],pageNo:0,startX:0,startY:0,startIndex:0,startRowIndex:0}),i}setCursorPosition(t){this.cursorPosition=t}getCursorPosition(){return this.cursorPosition}getPositionContext(){return this.positionContext}setPositionContext(t){this.eventBus.emit("positionContextChange",{value:t,oldValue:this.positionContext}),this.positionContext=t}getPositionByXY(t){const{x:e,y:n,isTable:i}=t;let{elementList:l,positionList:r}=t;l||(l=this.draw.getOriginalElementList()),r||(r=this.getOriginalPositionList());const a=this.draw.getZone(),c=t.pageNo??this.draw.getPageNo(),d=a.isMainActive(),u=d?c:0;if(!i){const f=this.getFloatPositionByXY({...t,imgDisplays:[s.ImageDisplay.FLOAT_TOP,s.ImageDisplay.SURROUND]});if(f)return f}for(let f=0;f<r.length;f++){const{index:C,pageNo:p,left:I,isFirstLetter:m,coordinate:{leftTop:L,rightTop:O,leftBottom:P}}=r[f];if(u!==p)continue;if(p>u)break;const S=l[C];if(!(ae(S)&&!this.draw.isDesignMode())&&L[0]-I<=e&&O[0]>=e&&L[1]<=n&&P[1]>=n){let y=f;if(S?.controlId&&I>0&&e<L[0]){const b=S.controlComponent===s.ControlComponent.POSTFIX||S.controlComponent===s.ControlComponent.POST_TEXT||S.controlComponent===s.ControlComponent.POSTTEXTFIX||S.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT,M=f>0?l[r[f-1].index]:void 0,V=M?.controlId===S.controlId&&(M.originControlId||null)===(S.originControlId||null);return{index:b&&V?r[f-1].index:C,isControl:!0}}if(S.type===s.ElementType.TABLE)for(let b=0;b<S.trList.length;b++){const M=S.trList[b];for(let V=0;V<M.tdList.length;V++){const N=M.tdList[V],X=this.getPositionByXY({x:e,y:n,td:N,pageNo:c,tablePosition:r[f],isTable:!0,elementList:N.value,positionList:N.positionList});if(~X.index){const{index:D,hitLineStartIndex:E}=X,U=N.value[D];return{index:C,isCheckbox:X.isCheckbox||U.type===s.ElementType.CHECKBOX||U.controlComponent===s.ControlComponent.CHECKBOX,isRadio:U.type===s.ElementType.RADIO||U.controlComponent===s.ControlComponent.RADIO,isControl:!!U.controlId,isImage:X.isImage,isLabel:X.isLabel,isMacro:X.isMacro,isDirectHit:X.isDirectHit,isTable:!0,tdIndex:V,trIndex:b,tdValueIndex:D,tdId:N.id,trId:M.id,tableId:S.id,hitLineStartIndex:E}}}}if(S.type===s.ElementType.IMAGE||S.type===s.ElementType.LATEX)return{index:y,isDirectHit:!0,isImage:!0};if(S.type===s.ElementType.MENSTRUAL_HISTORY)return{index:y,isDirectHit:!0};if(S.type===s.ElementType.FETAL_HEART_POSITION)return{index:y,isDirectHit:!0};if(S.type===s.ElementType.TOOTH_POSITION){const{scale:b}=this.options,M=S.width*b;return e>=L[0]&&e<=L[0]+M?{index:y,isDirectHit:!0}:{index:y}}if(S.type===s.ElementType.CHECKBOX||S.controlComponent===s.ControlComponent.CHECKBOX)return{index:y,isDirectHit:!0,isCheckbox:!0};if(S.type===s.ElementType.LABEL)return{index:y,isDirectHit:!0,isLabel:!0};if(S.type===s.ElementType.MACRO||S.type===s.ElementType.CUSTOM_MACRO||S.type===s.ElementType.REUSABLE_ITEM||S.type===s.ElementType.SUB_TEMPLATE)return{index:y,isDirectHit:!0,isMacro:!0};if(S.type===s.ElementType.TAB&&S.listStyle===s.ListStyle.CHECKBOX){let b=y-1;for(;b>0;){const M=l[b];if(M.value===_&&M.listStyle===s.ListStyle.CHECKBOX)break;b--}return{index:b,isDirectHit:!0,isCheckbox:!0}}if(S.type===s.ElementType.RADIO||S.controlComponent===s.ControlComponent.RADIO)return{index:y,isDirectHit:!0,isRadio:!0};let Y;if(l[C].value!==_){const b=O[0]-L[0];e<L[0]+b/2&&(y=f-1,m&&(Y=f))}return{isDirectHit:!0,hitLineStartIndex:Y,index:y,isControl:!!S.controlId}}}if(!i){const f=this.getFloatPositionByXY({...t,imgDisplays:[s.ImageDisplay.FLOAT_BOTTOM]});if(f)return f}let h=!1,R=-1,T;if(i){const{scale:f}=this.options,{td:C,tablePosition:p}=t;if(C&&p){const{leftTop:I}=p.coordinate,m=C.x*f+I[0],L=C.y*f+I[1],O=C.width*f,P=C.height*f;if(!(m<e&&e<m+O&&L<n&&n<L+P))return{index:R}}}const g=r.filter(f=>f.isLastLetter&&f.pageNo===u);for(let f=0;f<g.length;f++){const{index:C,rowNo:p,coordinate:{leftTop:I,leftBottom:m}}=g[f];if(n>I[1]&&n<=m[1]){const L=r.findIndex(y=>y.pageNo===u&&y.rowNo===p),O=l[L],P=r[L],S=O.listStyle===s.ListStyle.CHECKBOX?this.draw.getMargins()[3]:P.coordinate.leftTop[0];if(e<S)~L?P.value===_?R=L:(R=L-1,T=L):R=C;else{if(O.listStyle===s.ListStyle.CHECKBOX&&e<I[0])return{index:L,isDirectHit:!0,isCheckbox:!0};R=C}h=!0;break}}if(!h){if(this.draw.getIsPagingMode()){const C=this.draw.getHeader(),p=C.getHeight(),I=C.getHeaderTop()+p,m=this.draw.getFooter(),O=this.draw.getHeight()-(m.getFooterBottom()+m.getHeight());if(d){if(n<I)return{index:-1,zone:s.EditorZone.HEADER};if(n>O)return{index:-1,zone:s.EditorZone.FOOTER}}else if(n<=O&&n>=I)return{index:-1,zone:s.EditorZone.MAIN}}const f=this.draw.getMargins();if(n<=f[0])for(let C=0;C<r.length;C++){const p=r[C];if(p.pageNo!==u||p.rowNo!==0)continue;const{leftTop:I,rightTop:m}=p.coordinate;if(e<=f[3]||e>=I[0]&&e<=m[0]||r[C+1]?.rowNo!==0)return{index:p.index}}else{const C=g[g.length-1];if(C){const p=C.rowNo;for(let I=0;I<r.length;I++){const m=r[I];if(m.pageNo!==u||m.rowNo!==p)continue;const{leftTop:L,rightTop:O}=m.coordinate;if(e<=f[3]||e>=L[0]&&e<=O[0]||r[I+1]?.rowNo!==p)return{index:m.index}}}}return{index:g[g.length-1]?.index||r.length-1}}return{hitLineStartIndex:T,index:R,isControl:!!l[R]?.controlId}}getFloatPositionByXY(t){const{x:e,y:n}=t,i=t.pageNo??this.draw.getPageNo(),l=this.draw.getZone().getZone(),{scale:r}=this.options;for(let a=0;a<this.floatPositionList.length;a++){const{position:c,element:d,isTable:u,index:h,trIndex:R,tdIndex:T,tdValueIndex:g,zone:f,pageNo:C}=this.floatPositionList[a];if(i===C&&d.type===s.ElementType.IMAGE&&d.imgDisplay&&t.imgDisplays.includes(d.imgDisplay)&&(!f||f===l)){const p=d.imgFloatPosition,I=p.x*r,m=p.y*r,L=d.width*r,O=d.height*r;if(e>=I&&e<=I+L&&n>=m&&n<=m+O)return u?{index:h,isDirectHit:!0,isImage:!0,isTable:u,trIndex:R,tdIndex:T,tdValueIndex:g,tdId:d.tdId,trId:d.trId,tableId:d.tableId}:{index:c.index,isDirectHit:!0,isImage:!0}}}}adjustPositionContext(t){const e=this.getPositionByXY(t);if(!~e.index)return null;if(e.isControl&&this.draw.getMode()!==s.EditorMode.READONLY){const{index:C,isTable:p,trIndex:I,tdIndex:m,tdValueIndex:L}=e,O=this.draw.getControl(),{newIndex:P}=O.moveCursor({index:C,isTable:p,trIndex:I,tdIndex:m,tdValueIndex:L});p?e.tdValueIndex=P:e.index=P}const{index:n,isCheckbox:i,isRadio:l,isControl:r,isImage:a,isLabel:c,isDirectHit:d,isTable:u,trIndex:h,tdIndex:R,tdId:T,trId:g,tableId:f}=e;return this.setPositionContext({isTable:u||!1,isCheckbox:i||!1,isRadio:l||!1,isControl:r||!1,isImage:a||!1,isLabel:c||!1,isDirectHit:d||!1,index:n,trIndex:h,tdIndex:R,tdId:T,trId:g,tableId:f}),e}setSurroundPosition(t){const{scale:e}=this.options,{pageNo:n,row:i,rowElement:l,rowElementRect:r,surroundElementList:a,availableWidth:c}=t;let d=r.x,u=0;if(a.length&&!_n(l)&&!l.control?.minWidth)for(let h=0;h<a.length;h++){const R=a[h],T=R.imgFloatPosition;if(T.pageNo!==n)continue;const g={...T,x:T.x*e,y:T.y*e,width:R.width*e,height:R.height*e};if(Sa(r,g)){i.isSurround=!0;const f=g.width+g.x-r.x;if(l.left=f,i.width+=f,u+=f,d=g.x+g.width,i.width+l.metrics.width>c){l.left=0,i.width-=u;break}}}return{x:d,rowIncreaseWidth:u}}}class Nd{draw;options;range;listener;eventBus;position;historyManager;defaultStyle;lastRangeStyle;constructor(t){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},this.defaultStyle=null,this.lastRangeStyle=null}_isSameRangeStyle(t,e){if(!t||!["type","undo","redo","painter","font","size","bold","italic","underline","strikeout","deletePerson","color","highlight","rowFlex","vertical","rowMargin","level","listType","listStyle","textDecoration","extension"].every(c=>t[c]===e[c])||!(t.dashArray.length===e.dashArray.length&&t.dashArray.every((c,d)=>c===e.dashArray[d])))return!1;const r=t.groupIds||[],a=e.groupIds||[];return r.length===a.length&&r.every((c,d)=>c===a[d])}_emitRangeStyle(t){this._isSameRangeStyle(this.lastRangeStyle,t)||(this.lastRangeStyle={...t,dashArray:[...t.dashArray],groupIds:t.groupIds?[...t.groupIds]:null},this.listener.rangeStyleChange?.(t),this.eventBus.isSubscribe("rangeStyleChange")&&this.eventBus.emit("rangeStyleChange",t))}getRange(){return this.range}clearRange(){this.setRange(-1,-1)}setDefaultStyle(t){t?this.defaultStyle={...this.defaultStyle,...t}:this.defaultStyle=null}getDefaultStyle(){return this.defaultStyle}getRangeAnchorStyle(t,e){const n=Kn(t,e);return n?{...n,...this.defaultStyle}:null}getIsRangeChange(t,e,n,i,l,r,a){return this.range.startIndex!==t||this.range.endIndex!==e||this.range.tableId!==n||this.range.startTdIndex!==i||this.range.endTdIndex!==l||this.range.startTrIndex!==r||this.range.endTrIndex!==a}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,splitTdRange:n}=this.range;if(t===e)return null;if(n)return this.draw.getSplitTdValues(n.originalId).slice(n.startIndex+1,n.endIndex+1);const i=this.draw.getElementList();return i.slice(i[t]?.value===_?t: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<t.length;n++){const i=t[n];for(let l=0;l<i.length;l++){const r=i[l];e.push(...r.value)}}return e}return this.getSelection()}getTextLikeSelection(){const t=this.getSelection();return t?t.filter(e=>!e.type||Le.includes(e.type)):null}getTextLikeSelectionElementList(){const t=this.getSelectionElementList();return t?t.filter(e=>!e.type||Le.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 l=t;l<e+1;l++){const{pageNo:r,rowNo:a}=n[l],c=i.get(r);c?c.has(a)||c.add(a):i.set(r,new Set([a]))}return i}getRangeRowElementList(){const{startIndex:t,endIndex:e,isCrossRowCol:n}=this.range;if(!~t&&!~e)return null;if(n)return this.getSelectionElementList();const i=this.getRangeRow();if(!i)return null;const l=this.position.getPositionList(),r=this.draw.getElementList(),a=[];for(let c=0;c<l.length;c++){const d=l[c],u=i.get(d.pageNo);u&&u.has(d.rowNo)&&a.push(r[c])}return a}getRangeParagraph(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;const n=this.position.getPositionList(),i=this.draw.getElementList(),l=new Map;let r=t;for(;r>=0;){const{pageNo:d,rowNo:u}=n[r];let h=l.get(d);h||(h=[],l.set(d,h)),h.includes(u)||h.unshift(u);const R=i[r],T=i[r-1];if(R.value===_&&!R.listWrap||R.listId!==T?.listId||R.titleId!==T?.titleId)break;r--}const a=t===e;if(!a){let d=t+1;for(;d<e;){const{pageNo:u,rowNo:h}=n[d];let R=l.get(u);R||(R=[],l.set(u,R)),R.includes(h)||R.push(h),d++}}let c=e;for(a&&i[t].value===_&&(c+=1);c<n.length;){const d=i[c],u=i[c+1];if(d.value===_&&!d.listWrap||d.listId!==u?.listId||d.titleId!==u?.titleId)break;const{pageNo:h,rowNo:R}=n[c];let T=l.get(h);T||(T=[],l.set(h,T)),T.includes(R)||T.push(R),c++}return l}getRangeParagraphInfo(){const{startIndex:t,endIndex:e}=this.range;if(!~t&&!~e)return null;let n=-1;const i=[],l=this.getRangeParagraph();if(!l)return null;const r=this.draw.getElementList(),a=this.position.getPositionList();for(let c=0;c<a.length;c++){const d=a[c],u=l.get(d.pageNo);u&&u.includes(d.rowNo)&&(~n||(n=d.index),i.push(r[c]))}return i.length?{elementList:i,startIndex:n}:null}getRangeParagraphElementList(){return this.getRangeParagraphInfo()?.elementList||null}getRangeTableElement(){const t=this.position.getPositionContext();return t.isTable?this.draw.getOriginalElementList()[t.index]:null}getIsSelectAll(){const t=this.draw.getElementList(),{startIndex:e,endIndex:n}=this.range;return e===0&&t.length-1===n&&!this.position.getPositionContext().isTable}getIsPointInRange(t,e,n){const{startIndex:i,endIndex:l}=this.range,r=this.position.getPositionList();for(let a=i+1;a<=l&&r[a];a++){const{coordinate:{leftTop:d,rightBottom:u},pageNo:h}=r[a];if(n===h&&t>=d[0]&&t<=u[0]&&e>=d[1]&&e<=u[1])return!0}return!1}getKeywordRangeList(t){const e=this.draw.getSearch().getMatchList(t,this.draw.getOriginalElementList()),n=new Map;for(const l of e){const r=n.get(l.groupId);if(r)r.endIndex+=1;else{const{type:a,groupId:c,tableId:d,index:u,tdIndex:h,trIndex:R}=l,T={startIndex:u,endIndex:u};a===Ke.TABLE&&(T.tableId=d,T.startTdIndex=h,T.endTdIndex=h,T.startTrIndex=R,T.endTrIndex=R),n.set(c,T)}}const i=[];return n.forEach(l=>{i.push(l)}),i}getIsCanInput(){const{range:{startIndex:t,endIndex:e},elementList:n}=this.getRangeElement(),i=n[t];if(!i)return!1;if(t===e)return(i.controlComponent!==s.ControlComponent.PRE_TEXT||n[t+1]?.controlComponent!==s.ControlComponent.PRE_TEXT)&&i.controlComponent!==s.ControlComponent.POST_TEXT;const l=n[e];return l?!i.controlId&&!l.controlId||(!i.controlId||i.controlComponent===s.ControlComponent.POSTFIX)&&(!l.controlId||l.controlComponent===s.ControlComponent.POSTFIX)||!!i.controlId&&l.controlId===i.controlId&&l.controlComponent!==s.ControlComponent.PRE_TEXT&&l.controlComponent!==s.ControlComponent.POST_TEXT&&l.controlComponent!==s.ControlComponent.POSTFIX:!1}setRange(t,e,n,i,l,r,a,c){this.getIsRangeChange(t,e,n,i,l,r,a)&&(this.range.startIndex=t,this.range.endIndex=e,this.range.tableId=n,this.range.startTdIndex=i,this.range.endTdIndex=l,this.range.startTrIndex=r,this.range.endTrIndex=a,this.range.isCrossRowCol=!!(i||l||r||a),this.range.splitTdRange=c,this.setDefaultStyle(null)),this.range.zone=this.draw.getZone().getZone();const u=this.draw.getControl();if(~t&&~e&&!!this.draw.getElementList()[t]?.controlId&&!this.draw.isContentReadonly()){u.initControl();return}u.destroyControl()}replaceRange(t){this.setRange(t.startIndex,t.endIndex,t.tableId,t.startTdIndex,t.endTdIndex,t.startTrIndex,t.endTrIndex)}shrinkRange(){const{startIndex:t,endIndex:e}=this.range;t===e||!~t&&!~e||this.replaceRange({...this.range,startIndex:e})}setRangeStyle(){const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const{startIndex:n,endIndex:i,isCrossRowCol:l}=this.range;if(!~n&&!~i)return;let r;if(l){const E=this.draw.getOriginalElementList(),U=this.position.getPositionContext();r=E[U.index]}else{const E=~i?i:0,U=this.draw.getElementList();r=this.getRangeAnchorStyle(U,E)}if(!r)return;const a=this.getSelection()||[r],c=r.type||s.ElementType.TEXT,d=r.font||this.options.defaultFont,u=r.size||this.options.defaultSize,h=!~a.findIndex(E=>!E.bold),R=!~a.findIndex(E=>!E.italic),T=!~a.findIndex(E=>!E.underline&&!E.control?.underline),g=!~a.findIndex(E=>!E.strikeout),f=r.color||null,C=r.highlight||null,p=r.rowFlex||null,I=r.vertical||null,m=r.rowMargin??this.options.defaultRowMargin,L=r.dashArray||[],O=r.level||null,P=r.listType||null,S=r.listStyle||null,y=T&&r.textDecoration||null,Y=!!this.draw.getPainterStyle(),b=this.historyManager.isCanUndo(),M=this.historyManager.isCanRedo(),V=r.groupIds||null,N=r.extension??null,X=r.deletePerson??"",D={type:c,undo:b,redo:M,painter:Y,font:d,size:u,bold:h,italic:R,underline:T,strikeout:g,deletePerson:X,color:f,highlight:C,rowFlex:p,vertical:I,rowMargin:m,dashArray:L,level:O,listType:P,listStyle:S,groupIds:V,textDecoration:y,extension:N};this._emitRangeStyle(D)}recoveryRangeStyle(){const t=this.listener.rangeStyleChange,e=this.eventBus.isSubscribe("rangeStyleChange");if(!t&&!e)return;const n=this.options.defaultFont,i=this.options.defaultSize,l=this.options.defaultRowMargin,r=!!this.draw.getPainterStyle(),a=this.historyManager.isCanUndo(),c=this.historyManager.isCanRedo(),u={type:null,undo:a,redo:c,painter:r,font:n,size:i,bold:!1,italic:!1,underline:!1,strikeout:!1,deletePerson:"123",color:null,highlight:null,rowFlex:null,rowMargin:l,dashArray:[],level:null,listType:null,listStyle:null,groupIds:null,textDecoration:null,extension:null,vertical:null};this._emitRangeStyle(u)}shrinkBoundary(t={}){const{elementList:e,range:n}=this.getRangeElement(t),{startIndex:i,endIndex:l}=n;if(!~i&&!~l)return;const r=e[i],a=e[l];if(i===l){if(r.controlComponent===s.ControlComponent.PLACEHOLDER&&r.originControlId&&r.control?.type==="text")return;if(r.controlComponent===s.ControlComponent.PLACEHOLDER){let c=i-1;for(;c>0;){const d=e[c];if(d.controlId===r.controlId&&(d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT||d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)){n.startIndex=c,n.endIndex=c;break}if(d.controlId!==r.controlId&&!d.originControlId)break;c--}}if(r.controlComponent===s.ControlComponent.TEXTFIXLABEL){let c=i-1;for(;c>0;){const d=e[c];if(d.controlId!==r.controlId||d.controlComponent===s.ControlComponent.VALUE||d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){n.startIndex=c,n.endIndex=c;break}c--}}}else{if(r.controlComponent===s.ControlComponent.PLACEHOLDER||a.controlComponent===s.ControlComponent.PLACEHOLDER||r.controlComponent===s.ControlComponent.TEXTFIXLABEL||a.controlComponent===s.ControlComponent.TEXTFIXLABEL){let c=l-1;for(;c>0;){const d=e[c];if(d.controlId!==a.controlId||d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT||d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){n.startIndex=c,n.endIndex=c;return}c--}}if(r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT||r.controlComponent===s.ControlComponent.PRETEXTFIX||r.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){let c=i+1;for(;c<e.length;){const d=e[c];if(d.controlId!==r.controlId||d.controlComponent===s.ControlComponent.VALUE){n.startIndex=c-1;break}else if(d.controlComponent===s.ControlComponent.PLACEHOLDER){n.startIndex=c-1,n.endIndex=c-1;return}c++}}if(a.controlComponent!==s.ControlComponent.VALUE){let c=l-1;for(;c>0;){const d=e[c];if(d.controlId!==r.controlId||d.controlComponent===s.ControlComponent.VALUE){n.endIndex=c;break}else if(d.controlComponent===s.ControlComponent.PLACEHOLDER){n.startIndex=c,n.endIndex=c;return}c--}}}}render(t,e,n,i,l){t.save(),t.globalAlpha=this.options.rangeAlpha,t.fillStyle=this.options.rangeColor,t.fillRect(e,n,i,l),t.restore()}toString(){const t=this.getTextLikeSelection();return t?t.map(e=>e.value).join("").replace(new RegExp(_,"g"),""):""}getRangeElement(t={}){const e=t.elementList||this.draw.getElementList(),n=t.range||this.getRange(),{splitTdRange:i}=n,l={elementList:e,range:n};return i&&(l.range=i,l.elementList=this.draw.getSplitTdValues(i.originalId)??[]),l}}class bd{draw;options;imageCache;constructor(t){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:l,scale:r}=this.options;if(l.size===s.BackgroundSize.CONTAIN){const a=e.width*r,c=e.height*r;if(!l.repeat||l.repeat===s.BackgroundRepeat.NO_REPEAT)t.drawImage(e,0,0,a,c);else{let d=0,u=0;const h=l.repeat===s.BackgroundRepeat.REPEAT||l.repeat===s.BackgroundRepeat.REPEAT_X?Math.ceil(n*r/a):1,R=l.repeat===s.BackgroundRepeat.REPEAT||l.repeat===s.BackgroundRepeat.REPEAT_Y?Math.ceil(i*r/c):1;for(let T=0;T<h;T++){for(let g=0;g<R;g++)t.drawImage(e,d,u,a,c),u+=c;u=0,d+=a}}}else t.drawImage(e,0,0,n*r,i*r)}_renderBackgroundImage(t,e,n){const{background:i}=this.options,l=this.imageCache.get(i.image);if(l)this._drawImage(t,l,e,n);else{const r=new Image;r.setAttribute("crossOrigin","Anonymous"),r.src=i.image,r.onload=()=>{this.imageCache.set(i.image,r),this._drawImage(t,r,e,n),this.draw.render({isCompute:!1,isSubmitHistory:!1})}}}render(t,e){const{background:{image:n,color:i,applyPageNumbers:l}}=this.options;if(n&&(!l?.length||l.includes(e))){const{width:r,height:a}=this.options;this._renderBackgroundImage(t,r,a)}else{const r=this.draw.getCanvasWidth(e),a=this.draw.getCanvasHeight(e);this._renderBackgroundColor(t,i,r,a)}}}class ji{fillRect;fillColor;fillDecorationStyle;constructor(){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,l,r,a){const c=!this.fillRect.width;if(!c&&(this.fillColor!==r||this.fillDecorationStyle!==a)){this.render(t),this.clearFillInfo(),this.recordFillInfo(t,e,n,i,l,r,a);return}c&&(this.fillRect.x=e,this.fillRect.y=n),l&&this.fillRect.height<l&&(this.fillRect.height=l),this.fillRect.width+=i,this.fillColor=r,this.fillDecorationStyle=a}}class Vd extends ji{options;constructor(t){super(),this.options=t.getOptions()}render(t){if(!this.fillRect.width)return;const{highlightAlpha:e}=this.options,{x:n,y:i,width:l,height:r}=this.fillRect;t.save(),t.globalAlpha=e,t.fillStyle=this.fillColor,t.fillRect(n,i,l,r),t.restore(),this.clearFillInfo()}}class Wd{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e){const{marginIndicatorColor:n,pageMode:i}=this.options,l=this.draw.getWidth(),r=i===s.PageMode.CONTINUITY?this.draw.getCanvasHeight(e)/this.draw.getPagePixelRatio():this.draw.getHeight(),a=this.draw.getMargins(),c=this.draw.getMarginIndicatorSize();t.save(),t.translate(.5,.5),t.strokeStyle=n,t.beginPath();const d=[a[3],a[0]],u=[l-a[1],a[0]],h=[a[3],r-a[2]],R=[l-a[1],r-a[2]];t.moveTo(d[0]-c,d[1]),t.lineTo(...d),t.lineTo(d[0],d[1]-c),t.moveTo(u[0]+c,u[1]),t.lineTo(...u),t.lineTo(u[0],u[1]-c),t.moveTo(h[0]-c,h[1]),t.lineTo(...h),t.lineTo(h[0],h[1]+c),t.moveTo(R[0]+c,R[1]),t.lineTo(...R),t.lineTo(R[0],R[1]+c),t.stroke(),t.restore()}}class Ud{draw;options;position;range;searchKeyword;searchNavigateIndex;searchOptions;searchMatchList;constructor(t){this.draw=t,this.options=t.getOptions(),this.position=t.getPosition(),this.range=t.getRange(),this.searchNavigateIndex=null,this.searchOptions=null,this.searchKeyword=null,this.searchMatchList=[]}getSearchKeyword(){return this.searchKeyword}setSearchKeyword(t,e){this.searchKeyword=t,this.searchNavigateIndex=null,this.searchOptions=e||null}searchNavigatePre(){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(;t>=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(;t<this.searchMatchList.length;){const i=this.searchMatchList[t];if(n!==i.groupId){e=!0,this.searchNavigateIndex=t;break}t++}if(!e){if(this.searchMatchList[0].groupId===n)return null;this.searchNavigateIndex=0}}return this.searchNavigateIndex}searchNavigateScrollIntoView(t){const{coordinate:{leftTop:e,leftBottom:n,rightTop:i},pageNo:l}=t,r=this.draw.getHeight(),a=this.draw.getPageGap(),c=l*(r+a),d=document.createElement("div");d.style.position="absolute";const u=50;d.style.width=`${i[0]-e[0]+u}px`,d.style.height=`${n[1]-e[1]+u}px`,d.style.left=`${e[0]}px`,d.style.top=`${e[1]+c}px`,this.draw.getContainer().append(d),d.scrollIntoView(!1),d.remove()}getSearchNavigateIndexList(){return this.searchNavigateIndex===null||!this.searchKeyword?[]:new Array(this.searchKeyword.length).fill(this.searchNavigateIndex).map((t,e)=>t+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<this.searchMatchList.length;i++){const l=this.searchMatchList[i];n!==l.groupId&&(n=l.groupId,e+=1)}return{index:t,count:e}}getMatchList(t,e){const{isRegEnable:n=!1,isIgnoreCase:i=!0}=this.searchOptions||{},l=i?t.toLocaleLowerCase():t,r=[],a=[],c=e.length,d=[];for(let T=0;T<c;T++)e[T].type===s.ElementType.TABLE&&d.push(T);let u=0,h=0;for(;h<c-1;){const T=d.length?d[u]:c,g=e.slice(h,T);g.length&&a.push({index:h,type:Ke.PAGE,elementList:g});const f=e[T];f&&a.push({index:T,type:Ke.TABLE,elementList:[f]}),h=T+1,u++}function R(T,g,f,C){if(!T)return;let p=f.map(P=>!P.type||Le.includes(P.type)&&P.controlComponent!==s.ControlComponent.CHECKBOX&&P.controlComponent!==s.ControlComponent.RADIO&&!P.hide&&!P.control?.hide&&!P.area?.hide?P.value:_).filter(Boolean).join("");i&&(p=p.toLocaleLowerCase());const I=[],m=n?new RegExp(T):T;let{index:L,length:O}=xs(p,m);for(;L!==-1&&O!==0;){I.push({index:L,length:O});const P=xs(p,m,L+O);L=P.index,O=P.length}for(let P=0;P<I.length;P++){const{index:S,length:y}=I[P],Y=ft();for(let b=0;b<y;b++){const M=S+b+(C?.startIndex||0);r.push({type:g,index:M,groupId:Y,...C})}}}for(let T=0;T<a.length;T++){const g=a[T];if(g.type===Ke.TABLE){const f=g.elementList[0];for(let C=0;C<f.trList.length;C++){const p=f.trList[C];for(let I=0;I<p.tdList.length;I++){const m=p.tdList[I],L={tableId:f.id,tableIndex:g.index,trIndex:C,tdIndex:I,tdId:m.id};R(l,g.type,m.value,L)}}}else R(l,g.type,g.elementList,{startIndex:g.index})}return r}compute(t){const e=this.searchOptions?.isLimitSelection&&!this.range.getIsCollapsed(),n=e?this.range.getSelectionElementList():this.draw.getOriginalElementList();if(!n?.length||(this.searchMatchList=this.getMatchList(t,n),!e||!this.searchMatchList.length))return;const{startIndex:i}=this.range.getRange(),l=i+1;for(const r of this.searchMatchList)r.type===Ke.TABLE?r.tableIndex+=l:r.index+=l}render(t,e){if(!this.searchMatchList||!this.searchMatchList.length||!this.searchKeyword)return;const{searchMatchAlpha:n,searchMatchColor:i,searchNavigateMatchColor:l}=this.options,r=this.position.getOriginalPositionList(),a=this.draw.getOriginalElementList();t.save(),t.globalAlpha=n;for(let c=0;c<this.searchMatchList.length;c++){const d=this.searchMatchList[c];let u=null;if(d.type===Ke.TABLE){const{tableIndex:L,trIndex:O,tdIndex:P,index:S}=d;u=a[L]?.trList[O].tdList[P]?.positionList[S]}else u=r[d.index];if(!u)continue;const{coordinate:{leftTop:h,leftBottom:R,rightTop:T},pageNo:g}=u;if(g!==e)continue;if(this.getSearchNavigateIndexList().includes(c)){t.fillStyle=l;const L=this.searchMatchList[c-1];(!L||L.groupId!==d.groupId)&&this.searchNavigateScrollIntoView(u)}else t.fillStyle=i;const C=h[0],p=h[1],I=T[0]-h[0],m=R[1]-h[1];t.fillRect(C,p,I,m)}t.restore()}replace(t,e){if(this.draw.isReadonly()||t==null)return;let i=this.getSearchMatchList();const l=e?.index;if(Li(l)){const f=[];i.forEach(C=>{const p=f[f.length-1];!p||p[0].groupId!==C.groupId?f.push([C]):p.push(C)}),i=f[l]}if(!i?.length)return;const r=this.draw.isDesignMode();let a=0,c=0,d="",u="",h=-1;const R=this.draw.getOriginalElementList();for(let f=0;f<i.length;f++){const C=i[f];if(C.type===Ke.TABLE){const{tableIndex:p,trIndex:I,tdIndex:m,index:L,tdId:O}=C;u&&O!==u&&(c=0),u=O;const P=p+a,S=R[P].trList[I].tdList[m].value,y=L+c,Y=S[y];if(!r&&(Y?.control?.deletable===!1||Y?.title?.deletable===!1))continue;if(t===""){this.draw.spliceElementList(S,y,1),c--,~h||(h=f);continue}if(d===C.groupId){this.draw.spliceElementList(S,y,1),c--;continue}~h||(h=f);for(let b=0;b<t.length;b++){const M=t[b];b===0?Y.value=M:(this.draw.spliceElementList(S,y+b,0,[{...Y,value:M}]),c++)}}else{const p=C.index+a,I=R[p];if(!r&&(I?.control?.deletable===!1||I?.title?.deletable===!1)||I.type===s.ElementType.CONTROL&&I.controlComponent!==s.ControlComponent.VALUE)continue;if(t===""){this.draw.spliceElementList(R,p,1),a--,~h||(h=f);continue}if(~h||(h=f),d===C.groupId){this.draw.spliceElementList(R,p,1),a--;continue}for(let m=0;m<t.length;m++){const L=t[m];m===0?I.value=L:(this.draw.spliceElementList(R,p+m,0,[{...I,value:L}]),a++)}}d=C.groupId}if(!~h)return;const T=i[h],g=T.index+(t.length-1);if(T.type===Ke.TABLE){const{tableIndex:f,trIndex:C,tdIndex:p,index:I}=T,m=R[f].trList[C].tdList[p].value[I];this.position.setPositionContext({isTable:!0,index:f,trIndex:C,tdIndex:p,tdId:m.tdId,trId:m.trId,tableId:m.tableId})}else this.position.setPositionContext({isTable:!1});this.draw.getRange().setRange(g,g),this.draw.render({curIndex:g})}}class Yd extends ji{options;constructor(t){super(),this.options=t.getOptions()}render(t){if(!this.fillRect.width)return;const{scale:e,strikeoutColor:n}=this.options,{x:i,y:l,width:r}=this.fillRect;t.save(),t.lineWidth=e,t.strokeStyle=n;const a=l-3;t.beginPath(),t.moveTo(i,a),t.lineTo(i+r,a),t.stroke(),t.beginPath(),t.moveTo(i,l+3.5),t.lineTo(i+r,l+3.5),t.stroke(),t.restore(),this.clearFillInfo()}}s.TextDecorationStyle=void 0,(function(o){o.SOLID="solid",o.DOUBLE="double",o.DASHED="dashed",o.DOTTED="dotted",o.WAVY="wavy"})(s.TextDecorationStyle||(s.TextDecorationStyle={}));var kn;(function(o){o.SOLID="solid",o.DASHED="dashed",o.DOTTED="dotted"})(kn||(kn={}));class wd extends ji{options;constructor(t){super(),this.options=t.getOptions()}_drawLine(t,e,n,i,l){const r=e+i;switch(t.beginPath(),l){case kn.DASHED:t.setLineDash([3,1]);break;case kn.DOTTED:t.setLineDash([1,1]);break}t.moveTo(e,n),t.lineTo(r,n),t.stroke()}_drawDouble(t,e,n,i){const r=e+i,a=n+3*this.options.scale;this.options.mode===s.EditorMode.PRINT||this.options.mode===s.EditorMode.COMPARE?t.strokeStyle="transparent":t.strokeStyle="red",t.beginPath(),t.moveTo(e,n),t.lineTo(r,n),t.stroke(),t.beginPath(),t.moveTo(e,a),t.lineTo(r,a),t.stroke()}_drawWave(t,e,n,i){const{scale:l}=this.options,r=1.2*l,a=1/l,c=n+2*r;t.beginPath();for(let d=0;d<i;d++){const u=r*Math.sin(a*d);t.lineTo(e+d,c+u)}t.stroke()}render(t){if(!this.fillRect.width)return;const{underlineColor:e,scale:n}=this.options,{x:i,y:l,width:r}=this.fillRect;t.save(),t.strokeStyle=this.fillColor||e,t.lineWidth=n;const a=Math.floor(l+2*t.lineWidth)+.5;switch(this.fillDecorationStyle){case s.TextDecorationStyle.WAVY:this._drawWave(t,i,a,r);break;case s.TextDecorationStyle.DOUBLE:this._drawDouble(t,i,a,r);break;case s.TextDecorationStyle.DASHED:this._drawLine(t,i,a,r,kn.DASHED);break;case s.TextDecorationStyle.DOTTED:this._drawLine(t,i,a,r,kn.DOTTED);break;default:this._drawLine(t,i,a,r);break}t.restore(),this.clearFillInfo()}}class vd{draw;options;ctx;curX;curY;text;curStyle;curColor;cacheMeasureText;constructor(t){this.draw=t,this.options=t.getOptions(),this.ctx=t.getCtx(),this.curX=-1,this.curY=-1,this.text="",this.curStyle="",this.cacheMeasureText=new Map}measureBasisWord(t,e){t.save(),t.font=e;const n=this.measureText(t,{value:ua});return t.restore(),n}measureWord(t,e,n){const i=this.draw.getLetterReg();let l=0,r=null,a=n;for(;a<e.length;){const c=e[a];if(c.type&&c.type!==s.ElementType.TEXT||!i.test(c.value)){r=c;break}l+=this.measureText(t,c).width,a++}return{width:l,endElement:r}}buttonMeasureWord(t,e,n){const i=this.draw.getLetterReg();let l=0,r=null,a=n;for(;a<e.length;){const c=e[a];if(c.type&&c.type!==s.ElementType.TEXT||!i.test(c.value)){r=c;break}l+=this.measureText(t,c).width,a++}return{width:l,endElement:r}}measurePunctuationWidth(t,e){return!e||!da.includes(e.value)?0:(t.font=this.draw.getElementFont(e),this.measureText(t,e).width)}measureText(t,e){if(e.width){const r=t.measureText(e.value);return{width:e.width,actualBoundingBoxAscent:r.actualBoundingBoxAscent,actualBoundingBoxDescent:r.actualBoundingBoxDescent,actualBoundingBoxLeft:r.actualBoundingBoxLeft,actualBoundingBoxRight:r.actualBoundingBoxRight,fontBoundingBoxAscent:r.fontBoundingBoxAscent,fontBoundingBoxDescent:r.fontBoundingBoxDescent}}const n=`${e.value}${t.font}`,i=this.cacheMeasureText.get(n);if(i)return i;const l=t.measureText(e.value);return this.cacheMeasureText.set(n,l),l}getBasisWordBoundingBoxAscent(t,e){return this.measureBasisWord(t,e).actualBoundingBoxAscent}complete(){this._render(),this.text=""}record(t,e,n,i){if(this.ctx=t,this.options.renderMode===s.RenderMode.COMPATIBILITY){this._setCurXY(n,i),this.text=e.value,this.curStyle=e.style,this.curColor=e.color,this.complete();return}this.text||this._setCurXY(n,i),(this.curStyle&&e.style!==this.curStyle||e.color!==this.curColor)&&(this.complete(),this._setCurXY(n,i)),this.text+=e.value,this.curStyle=e.style,this.curColor=e.color}_setCurXY(t,e){this.curX=t,this.curY=e}_render(){!this.text||!~this.curX||!~this.curX||(this.ctx.save(),this.ctx.font=this.curStyle,this.ctx.fillStyle=this.curColor||this.options.defaultColor,this.ctx.fillText(this.text,this.curX,this.curY),this.ctx.restore())}}class Gn{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}static formatNumberPlaceholder(t,e,n,i){const l=i===s.NumberType.CHINESE?La(e):`${e}`;return t.replace(n,l)}render(t,e){const{scale:n,pageNumber:{size:i,font:l,color:r,rowFlex:a,numberType:c,format:d,startPageNo:u,fromPageNo:h}}=this.options;if(e<h)return;let R=d;const T=new RegExp(ro.PAGE_NO);T.test(R)&&(R=Gn.formatNumberPlaceholder(R,e+u-h,T,c));const g=new RegExp(ro.PAGE_COUNT);g.test(R)&&(R=Gn.formatNumberPlaceholder(R,this.draw.getPageCount()-h,g,c));const f=this.draw.getWidth(),C=this.draw.getHeight(),p=this.draw.getPageNumberBottom(),I=C-p;t.save(),t.fillStyle=r,t.font=`${i*n}px ${l}`;let m=0;const L=this.draw.getMargins(),{width:O}=t.measureText(R);a===s.RowFlex.CENTER?m=(f-O)/2:a===s.RowFlex.RIGHT?m=f-O-L[1]:m=L[3],t.fillText(R,m,I),t.restore()}}class Zd{draw;options;scrollContainer;constructor(t){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 l=0;l<t.length;l++){const r=t[l],{intersectionHeight:a}=this.getElementVisibleInfo(r);if(i&&!a)break;a&&e.push(l),a>i&&(i=a,n=l)}return{intersectionPageNo:n,visiblePageNoList:e}}_observer=ma(()=>{const{intersectionPageNo:t,visiblePageNoList:e}=this.getPageVisibleInfo();this.draw.setIntersectionPageNo(t),this.draw.setVisiblePageNoList(e)},150)}class Qd{draw;step=5;thresholdPoints=[70,40,10,20];selectionContainer;rangeManager;requestAnimationFrameId;isMousedown;isMoving;clientWidth;clientHeight;containerRect;constructor(t){this.draw=t,this.rangeManager=t.getRange();const{scrollContainerSelector:e}=t.getOptions();this.selectionContainer=e&&document.querySelector(e)||document,this.requestAnimationFrameId=null,this.isMousedown=!1,this.isMoving=!1,this.clientWidth=0,this.clientHeight=0,this.containerRect=null,this._addEvent()}_addEvent(){const t=this.selectionContainer;t.addEventListener("mousedown",this._mousedown),t.addEventListener("mousemove",this._mousemove),t.addEventListener("mouseup",this._mouseup),document.addEventListener("mouseleave",this._mouseup)}removeEvent(){const t=this.selectionContainer;t.removeEventListener("mousedown",this._mousedown),t.removeEventListener("mousemove",this._mousemove),t.removeEventListener("mouseup",this._mouseup),document.removeEventListener("mouseleave",this._mouseup)}_mousedown=t=>{if(this.draw.isInteractionSuspended()){this._mouseup();return}if(!this.draw.isTargetInsideEditor(t.target)){this._mouseup();return}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 e=this.selectionContainer.getBoundingClientRect();this.containerRect=e}};_mouseup=()=>{this.isMousedown=!1,this._stopMove()};_mousemove=t=>{if(this.draw.isInteractionSuspended()||!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<this.thresholdPoints[0]?this._startMove(zt.UP):this.clientHeight-n<=this.thresholdPoints[1]?this._startMove(zt.DOWN):e<this.thresholdPoints[2]?this._startMove(zt.LEFT):this.clientWidth-e<this.thresholdPoints[3]?this._startMove(zt.RIGHT):this._stopMove()};_move(t){const e=this.selectionContainer instanceof Document?window:this.selectionContainer,n=this.selectionContainer instanceof Document?window.scrollX:e.scrollLeft,i=this.selectionContainer instanceof Document?window.scrollY:e.scrollTop;t===zt.DOWN?e.scrollTo(n,i+this.step):t===zt.UP?e.scrollTo(n,i-this.step):t===zt.LEFT?e.scrollTo(n-this.step,i):e.scrollTo(n+this.step,i),this.requestAnimationFrameId=window.requestAnimationFrame(this._move.bind(this,t))}_startMove(t){this.isMoving||(this.isMoving=!0,this._move(t))}_stopMove(){this.requestAnimationFrameId&&(window.cancelAnimationFrame(this.requestAnimationFrameId),this.requestAnimationFrameId=null,this.isMoving=!1)}}class Kd{draw;range;options;constructor(t){this.draw=t,this.range=t.getRange(),this.options=t.getOptions()}getTrListGroupByCol(t){const e=rt(t);for(let n=0;n<t.length;n++){const i=e[n];for(let l=i.tdList.length-1;l>=0;l--){const r=i.tdList[l],{rowspan:a,rowIndex:c,colIndex:d}=r,u=c+a-1;if(u!==l){const h=i.tdList.splice(l,1)[0];e[u]?.tdList.splice(d,0,h)}}}return e}getRangeRowCol(){const{isTable:t,index:e,trIndex:n,tdIndex:i}=this.draw.getPosition().getPositionContext();if(!t)return null;const{isCrossRowCol:l,startTdIndex:r,endTdIndex:a,startTrIndex:c,endTrIndex:d}=this.range.getRange(),R=this.draw.getOriginalElementList()[e].trList;if(!l)return[[R[n].tdList[i]]];let T=R[c].tdList[r],g=R[d].tdList[a];(T.x>g.x||T.y>g.y)&&([T,g]=[g,T]);const f=T.colIndex,C=g.colIndex+(g.colspan-1),p=T.rowIndex,I=g.rowIndex+(g.rowspan-1),m=[];for(let L=0;L<R.length;L++){const O=R[L],P=[];for(let S=0;S<O.tdList.length;S++){const y=O.tdList[S],Y=y.colIndex,b=y.rowIndex;Y>=f&&Y<=C&&b>=p&&b<=I&&P.push(y)}P.length&&m.push(P)}return m.length?m:null}_drawOuterBorder(t){const{ctx:e,startX:n,startY:i,width:l,height:r,isDrawFullBorder:a,borderExternalWidth:c,skipTopBorderRanges:d=[]}=t,{scale:u}=this.options,h=this._mergeHorizontalBorderRanges(d,l),R=e.lineWidth;c&&(e.lineWidth=c*u),e.beginPath();const T=Math.round(n),g=Math.round(i);e.translate(.5,.5),a&&!h.length?e.rect(T,g,l,r):(a?(e.moveTo(T,g),e.lineTo(T,g+r),e.lineTo(T+l,g+r),e.lineTo(T+l,g)):(e.moveTo(T,g+r),e.lineTo(T,g)),this._drawHorizontalBorder(e,T,g,l,h)),e.stroke(),c&&(e.lineWidth=R),e.translate(-.5,-.5)}_drawHorizontalBorder(t,e,n,i,l){if(!l.length){t.lineTo(e+i,n);return}let r=0;l.forEach(([a,c])=>{r<a&&(t.moveTo(e+r,n),t.lineTo(e+a,n)),r=Math.max(r,c)}),r<i&&(t.moveTo(e+r,n),t.lineTo(e+i,n))}_mergeHorizontalBorderRanges(t,e){return t.map(([i,l])=>[Math.max(0,Math.min(i,e)),Math.max(0,Math.min(l,e))]).filter(([i,l])=>l>i).sort(([i],[l])=>i-l).reduce((i,l)=>{const r=i[i.length-1];return!r||l[0]>r[1]?i.push(l):l[1]>r[1]&&(r[1]=l[1]),i},[])}_getPagingContinuationTopBorderRanges(t,e){const{scale:n}=this.options,i=[];for(let l=0;l<t.length;l++){const r=t[l];for(let a=0;a<r.tdList.length;a++){const c=r.tdList[a];!c.linkTdPrevId||c.y!==0||i.push([c.x*n,(c.x+c.width)*n])}}return this._mergeHorizontalBorderRanges(i,e)}_drawSlash(t,e,n,i){const{scale:l}=this.options;t.save();const r=e.width*l,a=e.height*l,c=Math.round(e.x*l+n),d=Math.round(e.y*l+i);e.slashTypes?.includes(s.TdSlash.FORWARD)&&(t.moveTo(c+r,d),t.lineTo(c,d+a)),e.slashTypes?.includes(s.TdSlash.BACK)&&(t.moveTo(c,d),t.lineTo(c+r,d+a)),t.stroke(),t.restore()}_drawBorder(t,e,n,i){const{colgroup:l,trList:r,borderType:a,borderColor:c,borderWidth:d=1,borderExternalWidth:u}=e;if(!l||!r)return;const{scale:h,table:{defaultBorderColor:R}}=this.options,T=e.width*h,g=e.height*h,f=this._getPagingContinuationTopBorderRanges(r,T),C=a===s.TableBorder.EMPTY,p=a===s.TableBorder.EXTERNAL,I=a===s.TableBorder.INTERNAL;t.save(),a===s.TableBorder.DASH&&t.setLineDash([3,3]),t.lineWidth=d*h,t.strokeStyle=c||R,!C&&!I&&this._drawOuterBorder({ctx:t,startX:n,startY:i,width:T,height:g,borderExternalWidth:u,isDrawFullBorder:p,skipTopBorderRanges:f});for(let m=0;m<r.length;m++){const L=r[m];for(let O=0;O<L.tdList.length;O++){const P=L.tdList[O];if(P.slashTypes?.length&&this._drawSlash(t,P,n,i),!P.borderTypes?.length&&(C||p))continue;const S=P.width*h,y=P.height*h,Y=Math.round(P.x*h+n+S),b=Math.round(P.y*h+i),M=!!P.linkTdPrevId,V=!!P.linkTdNextId;if(t.translate(.5,.5),t.beginPath(),!M&&P.borderTypes?.includes(s.TdBorder.TOP)&&(t.moveTo(Y-S,b),t.lineTo(Y,b),t.stroke()),P.borderTypes?.includes(s.TdBorder.RIGHT)&&(t.moveTo(Y,b),t.lineTo(Y,b+y),t.stroke()),P.borderTypes?.includes(s.TdBorder.BOTTOM)&&(t.moveTo(Y,b+y),t.lineTo(Y-S,b+y),t.stroke()),P.borderTypes?.includes(s.TdBorder.LEFT)&&(t.moveTo(Y-S,b),t.lineTo(Y-S,b+y),t.stroke()),!C&&!p){if((!I||P.colIndex+P.colspan<l.length)&&(t.moveTo(Y,b),t.lineTo(Y,b+y),u&&u!==d&&P.colIndex+P.colspan===l.length)){const N=t.lineWidth;t.lineWidth=u*h,t.stroke(),t.beginPath(),t.lineWidth=N}if(V||!I||P.rowIndex+P.rowspan<r.length){const N=u&&u!==d&&P.rowIndex+P.rowspan===r.length;if(N&&(t.stroke(),t.beginPath()),t.moveTo(Y,b+y),t.lineTo(Y-S,b+y),N){const X=t.lineWidth;t.lineWidth=u*h,t.stroke(),t.beginPath(),t.lineWidth=X}}t.stroke()}t.translate(-.5,-.5)}}t.restore()}_drawBackgroundColor(t,e,n,i){const{trList:l}=e;if(!l)return;const{scale:r}=this.options;for(let a=0;a<l.length;a++){const c=l[a];for(let d=0;d<c.tdList.length;d++){const u=c.tdList[d];if(!u.backgroundColor)continue;t.save();const h=u.width*r,R=u.height*r,T=Math.round(u.x*r+n),g=Math.round(u.y*r+i);t.fillStyle=u.backgroundColor,t.fillRect(T,g,h,R),t.restore()}}}getTableWidth(t){return t.colgroup.reduce((e,n)=>e+n.width,0)}getTableHeight(t){const e=t.trList;return 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<t.length;i++){const l=t[i].tdList;for(let r=0;r<l.length;r++){const a=l[r],c=a.colIndex,d=c+a.colspan-1;e>=c&&e<=d&&n.push(a)}}return n}getTdListByRowIndex(t,e){const n=[];for(let i=0;i<t.length;i++){const l=t[i].tdList;for(let r=0;r<l.length;r++){const a=l[r],c=a.rowIndex,d=c+a.rowspan-1;e>=c&&e<=d&&n.push(a)}}return n}computeRowColInfo(t){const{colgroup:e,trList:n}=t;if(!e||!n)return;let i=0;for(let l=0;l<n.length;l++){const r=n[l],a=n.length-1===l;for(let c=0;c<r.tdList.length;c++){const d=r.tdList[c];let u=0;if(n.length>1&&l!==0){const p=r.tdList[c-1],I=p?p.colIndex+p.colspan:c;for(let m=I;m<e.length;m++)if(this.getRowCountByColIndex(n.slice(0,l),m)===l){u=m;let O=0;for(let P=0;P<m;P++)O+=e[P].width;i=O;break}}else{const p=r.tdList[c-1];p&&(u=p.colIndex+p.colspan)}let h=0;for(let p=0;p<d.colspan;p++)h+=e[p+u].width;let R=0;for(let p=0;p<d.rowspan;p++){const I=n[p+l]||n[l];R+=I.height}const T=r.tdList.length-1===c;let g=a;if(!g&&d.rowspan>1){const p=n.length-1-l;g=d.rowspan-1===p}const f=a&&T;d.isLastRowTd=T,d.isLastColTd=g,d.isLastTd=f,d.x=i;let C=0;for(let p=0;p<l;p++){const I=n[p].tdList;for(let m=0;m<I.length;m++){const L=I[m];if(u>=L.colIndex&&u<L.colIndex+L.colspan){C+=L.height;break}}}d.y=C,d.width=h,d.height=R,d.rowIndex=l,d.colIndex=u,d.trIndex=l,d.tdIndex=c,i+=h,T&&!f&&(i=0)}}}drawRange(t,e,n,i){const{scale:l,rangeAlpha:r,rangeColor:a}=this.options,{type:c,trList:d}=e;if(!d||c!==s.ElementType.TABLE)return;const{isCrossRowCol:u,startTdIndex:h,endTdIndex:R,startTrIndex:T,endTrIndex:g}=this.range.getRange();if(!u)return;let f=d[T].tdList[h],C=d[g].tdList[R];(f.x>C.x||f.y>C.y)&&([f,C]=[C,f]);const p=f.colIndex,I=C.colIndex+(C.colspan-1),m=f.rowIndex,L=C.rowIndex+(C.rowspan-1);t.save();for(let O=0;O<d.length;O++){const P=d[O];for(let S=0;S<P.tdList.length;S++){const y=P.tdList[S],Y=y.colIndex,b=y.rowIndex;if(Y>=p&&Y<=I&&b>=m&&b<=L){const M=y.x*l,V=y.y*l,N=y.width*l,X=y.height*l;t.globalAlpha=r,t.fillStyle=a,t.fillRect(M+n,V+i,N,X)}}}t.restore()}render(t,e,n,i){this._drawBackgroundColor(t,e,n,i),this._drawBorder(t,e,n,i)}findPreRowSpanTd(t,e,n){for(let i=e;i>=0;i--){const l=t[i].tdList.find(r=>r.colIndex===n);if(l)return l}}computeTrHeight(t,e){const{scale:n,table:{tdPadding:i,defaultTrMinHeight:l}}=this.options,r=t.tdPadding||i,a=r[0]+r[2],c=t.trList;for(let h=0;h<c.length;h++){const R=c[h];R.height=R.minHeight||l,R.minHeight=R.height}this.computeRowColInfo(t);const d={},u={};for(let h=0;h<c.length;h++){const R=c[h];if(!R.tdList.length){R.height=0;continue}const T=[],g=[];for(let C=0;C<t.colgroup.length;C++){const p=R.tdList.find(I=>I.colIndex===C);if(p){const I=e?e(p):p.rowList,m=I.reduce((O,P)=>O+P.height,0);p.rowList=I;const L=m/n+a;p.mainHeight=L,p.rowspan>1?(u[p.colIndex]=p.id,d[p.id]={td:p,rowSpan:[h,h+p.rowspan-1],preHeight:0,preMinHeight:0,extraHeight:L},g.push(L)):p.height<L?(p.height=L,p.realHeight=L,T.push(L)):T.push(p.height)}else{const I=d[u[C]];I?.rowSpan[1]==h&&T.push(I.extraHeight)}}const f=Math.max(...T.length?T:g);Object.values(d).forEach(C=>{C.rowSpan[0]<=h&&C.rowSpan[1]>=h&&(C.extraHeight-=f,C.preHeight+=f,C.preMinHeight+=R.minHeight)}),R.height=f;for(let C=0;C<t.colgroup.length;C++){const p=R.tdList.find(I=>I.colIndex===C)??this.findPreRowSpanTd(c,h,C);if(p){const I=d[p.id]?.preHeight??0,m=d[p.id]?.preMinHeight??R.minHeight;p.height=f+I,p.realHeight=f+I,p.realMinHeight=m}}}this.computeRowColInfo(t)}}var _e;(function(o){o.ROW="row",o.COL="col"})(_e||(_e={}));class Hd{MIN_TD_WIDTH=20;ROW_COL_OFFSET=18;ROW_COL_QUICK_WIDTH=16;ROW_COL_QUICK_OFFSET=5;ROW_COL_QUICK_POSITION=this.ROW_COL_OFFSET+(this.ROW_COL_OFFSET-this.ROW_COL_QUICK_WIDTH)/2;BORDER_VALUE=4;TABLE_SELECT_OFFSET=20;draw;canvas;options;position;range;container;toolRowContainer;toolRowAddBtn;toolColAddBtn;toolTableSelectBtn;toolColContainer;toolBorderContainer;anchorLine;mousedownX;mousedownY;constructor(t){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(){this.toolRowContainer?.remove(),this.toolRowAddBtn?.remove(),this.toolColAddBtn?.remove(),this.toolTableSelectBtn?.remove(),this.toolColContainer?.remove(),this.toolBorderContainer?.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 l=this.draw.getOriginalElementList(),r=this.position.getOriginalPositionList(),a=l[e];if(a.tableToolDisabled&&!this.draw.isDesignMode())return;const{scale:c,table:{overflow:d}}=this.options,u=r[e],{colgroup:h,trList:R}=a,{coordinate:{leftTop:T}}=u,g=this.draw.getHeight(),f=this.draw.getPageGap(),C=this.draw.getPageNo()*(g+f),p=T[0],I=T[1]+C,m=a.trList[n].tdList[i],L=m.rowIndex,O=m.colIndex,P=a.height*c,S=a.width*c,y=document.createElement("div");y.classList.add(`${st}-table-tool__select`),y.style.height=`${P*c}`,y.style.left=`${p}px`,y.style.top=`${I}px`,y.style.transform=`translate(-${this.TABLE_SELECT_OFFSET*c}px, ${-this.TABLE_SELECT_OFFSET*c}px)`,y.onclick=()=>{this.draw.getTableOperate().tableSelectAll()},this.container.append(y),this.toolTableSelectBtn=y;const Y=R.map(E=>E.height),b=document.createElement("div");b.classList.add(`${st}-table-tool__row`),b.style.transform=`translateX(-${this.ROW_COL_OFFSET*c}px)`;for(let E=0;E<Y.length;E++){const U=Y[E]*c,F=document.createElement("div");F.classList.add(`${st}-table-tool__row__item`),E===L&&F.classList.add("active"),F.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByRowIndex(R,E),W=Q[0],K=Q[Q.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:W.trIndex,tdIndex:W.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,W.tdIndex,K.tdIndex,W.trIndex,K.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(b,E)};const Z=document.createElement("div");Z.classList.add(`${st}-table-tool__anchor`),Z.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:E,order:_e.ROW})},F.append(Z),F.style.height=`${U}px`,b.append(F)}b.style.left=`${p}px`,b.style.top=`${I}px`,this.container.append(b),this.toolRowContainer=b;const M=document.createElement("div");M.classList.add(`${st}-table-tool__quick__add`),M.style.height=`${P*c}`,M.style.left=`${p}px`,M.style.top=`${I+P}px`,M.style.transform=`translate(-${this.ROW_COL_QUICK_POSITION*c}px, ${this.ROW_COL_QUICK_OFFSET*c}px)`,M.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:R.length-1,tdIndex:0,tableId:a.id}),this.draw.getTableOperate().insertTableBottomRow()},this.container.append(M),this.toolRowAddBtn=M;const V=h.map(E=>E.width),N=document.createElement("div");N.classList.add(`${st}-table-tool__col`),N.style.transform=`translateY(-${this.ROW_COL_OFFSET*c}px)`;for(let E=0;E<V.length;E++){const U=V[E]*c,F=document.createElement("div");F.classList.add(`${st}-table-tool__col__item`),E===O&&F.classList.add("active"),F.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByColIndex(R,E),W=Q[0],K=Q[Q.length-1];this.position.setPositionContext({index:e,isTable:!0,trIndex:W.trIndex,tdIndex:W.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,W.tdIndex,K.tdIndex,W.trIndex,K.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(N,E)};const Z=document.createElement("div");Z.classList.add(`${st}-table-tool__anchor`),Z.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:E,order:_e.COL})},F.append(Z),F.style.width=`${U}px`,N.append(F)}N.style.left=`${p}px`,N.style.top=`${I}px`,this.container.append(N),this.toolColContainer=N;const X=document.createElement("div");X.classList.add(`${st}-table-tool__quick__add`),X.style.height=`${P*c}`,X.style.left=`${p+S}px`,X.style.top=`${I}px`,X.style.transform=`translate(${this.ROW_COL_QUICK_OFFSET*c}px, -${this.ROW_COL_QUICK_POSITION*c}px)`,X.onclick=()=>{this.position.setPositionContext({index:e,isTable:!0,trIndex:0,tdIndex:R[0].tdList.length-1||0,tableId:a.id}),this.draw.getTableOperate().insertTableRightCol()},this.container.append(X),this.toolColAddBtn=X;const D=document.createElement("div");D.classList.add(`${st}-table-tool__border`),D.style.height=`${P}px`,D.style.width=`${S}px`,D.style.left=`${p}px`,D.style.top=`${I}px`;for(let E=0;E<R.length;E++){const U=R[E];for(let F=0;F<U.tdList.length;F++){const Z=U.tdList[F],Q=document.createElement("div");Q.classList.add(`${st}-table-tool__border__row`),Q.style.width=`${Z.width*c}px`,Q.style.height=`${this.BORDER_VALUE}px`,Q.style.top=`${(Z.y+Z.height)*c-this.BORDER_VALUE/2}px`,Q.style.left=`${Z.x*c}px`,Q.onmousedown=K=>{this._mousedown({evt:K,element:a,index:Z.rowIndex+Z.rowspan-1,order:_e.ROW})},D.appendChild(Q);const W=document.createElement("div");if(W.classList.add(`${st}-table-tool__border__col`),W.style.width=`${this.BORDER_VALUE}px`,W.style.height=`${Z.height*c}px`,W.style.top=`${Z.y*c}px`,W.style.left=`${(Z.x+Z.width)*c-this.BORDER_VALUE/2}px`,W.onmousedown=K=>{this._mousedown({evt:K,element:a,index:Z.colIndex+Z.colspan-1,order:_e.COL})},D.appendChild(W),d&&Z.colIndex===0){const K=document.createElement("div");K.classList.add(`${st}-table-tool__border__col`),K.style.width=`${this.BORDER_VALUE}px`,K.style.height=`${Z.height*c}px`,K.style.top=`${Z.y*c}px`,K.style.left=`${Z.x*c-this.BORDER_VALUE/2}px`,K.onmousedown=k=>{this._mousedown({evt:k,element:a,index:0,isLeftStartBorder:!0,order:_e.COL})},D.appendChild(K)}}}this.container.append(D),this.toolBorderContainer=D}_setAnchorActive(t,e){const n=t.children;for(let i=0;i<n.length;i++){const l=n[i];i===e?l.classList.add("active"):l.classList.remove("active")}}_mousedown(t){const{evt:e,index:n,order:i,element:l,isLeftStartBorder:r}=t;this.canvas=this.draw.getPage();const{scale:a,table:{overflow:c}}=this.options,d=this.draw.getWidth(),u=this.draw.getHeight(),h=this.draw.getPageGap(),R=this.draw.getPageNo()*(u+h),T=this.position.getPositionContext(),C=(this.position.getOriginalPositionList()[T.index]?.coordinate?.leftTop?.[0]||0)*a,p=this.draw.getMargins(),I=p[0],m=p[1],L=I,O=d-m;this.mousedownX=e.x,this.mousedownY=e.y;const P=e.target,S=this.canvas.getBoundingClientRect(),y=window.getComputedStyle(P).cursor;document.body.style.cursor=y,this.canvas.style.cursor=y;let Y=0,b=0;const M=document.createElement("div");M.classList.add(`${st}-table-anchor__line`),i===_e.ROW?(M.classList.add(`${st}-table-anchor__line__row`),M.style.width=`${d}px`,Y=0,b=R+this.mousedownY-S.top):(M.classList.add(`${st}-table-anchor__line__col`),M.style.height=`${u}px`,Y=this.mousedownX-S.left,b=R),M.style.left=`${Y}px`,M.style.top=`${b}px`,this.container.append(M),this.anchorLine=M;let V=0,N=0;const X=D=>{const E=this._mousemove(D,i,Y,b);E&&(V=E.dx,N=E.dy)};document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{let D=!1;if(i===_e.ROW){const E=l.trList,U=E[n]||E[n-1],{defaultTrMinHeight:F}=this.options.table;N<0&&U.height+N<F&&(N=F-U.height),N&&(U.height+=N,U.minHeight=U.height,D=!0)}else{const{colgroup:E}=l;if(E&&V)if(c&&r){E[n].width-V/a<=this.MIN_TD_WIDTH&&(V=(E[n].width-this.MIN_TD_WIDTH)*a);const U=C+(l.translateX||0)*a;U+V<L&&(V=L-U),E[n].width-=V/a,l.width-=V/a,l.translateX=(l.translateX||0)+V/a,D=!0}else{const U=E[n].width;V<0&&U*a+V<this.MIN_TD_WIDTH*a&&(V=this.MIN_TD_WIDTH*a-U*a);const F=E[n+1]?.width;if(V>0&&F&&F*a-V<this.MIN_TD_WIDTH*a&&(V=F*a-this.MIN_TD_WIDTH*a),n===E.length-1){const Q=C+(l.translateX||0)*a+l.width*a;Q+V>O&&(V=O-Q)}V&&(E.length-1!==n&&(E[n+1].width-=V/a),E[n].width+=V/a,D=!0)}}D&&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 l=t.x-this.mousedownX,r=t.y-this.mousedownY;return e===_e.ROW?this.anchorLine.style.top=`${i+r}px`:this.anchorLine.style.left=`${n+l}px`,t.preventDefault(),{dx:l,dy:r}}}class Ad{draw;options;container;hyperlinkPopupContainer;hyperlinkDom;constructor(t){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(`${st}-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:l}=e,r=this.draw.getHeight(),a=this.draw.getPageGap(),c=this.draw.getPageNo()*(r+a);this.hyperlinkPopupContainer.style.display="block",this.hyperlinkPopupContainer.style.left=`${n}px`,this.hyperlinkPopupContainer.style.top=`${i+c+l}px`;const d=t.url||"#";this.hyperlinkDom.href=d,this.hyperlinkDom.title=d,this.hyperlinkDom.innerText=d}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 _d{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:l,label:{defaultBackgroundColor:r,defaultColor:a,defaultBorderRadius:c,defaultPadding:d}}=this.options,u=e.label?.backgroundColor||r,h=e.label?.color||a,R=e.label?.borderRadius||c,T=e.label?.padding||d;t.save(),t.font=e.style;const{width:g,height:f,boundingBoxAscent:C}=e.metrics;t.fillStyle=u,this._drawRoundedRect(t,n,i-C,g,f+(T[0]+T[3])*l,R*l),t.fill(),t.fillStyle=h,t.fillText(e.value,n+T[3]*l,i),t.restore()}_drawRoundedRect(t,e,n,i,l,r){t.beginPath(),t.moveTo(e+r,n),t.lineTo(e+i-r,n),t.quadraticCurveTo(e+i,n,e+i,n+r),t.lineTo(e+i,n+l-r),t.quadraticCurveTo(e+i,n+l,e+i-r,n+l),t.lineTo(e+r,n+l),t.quadraticCurveTo(e,n+l,e,n+l-r),t.lineTo(e,n+r),t.quadraticCurveTo(e,n,e+r,n),t.closePath()}}const Sn=/[\r\n\u200B]/;class Bd{options;draw;activeInlineEditor;constructor(t){this.draw=t,this.options=t.getOptions(),this.activeInlineEditor=null}render(t,e,n,i){const l=this.draw.getMode(),r=e.macroConfig;if(l===s.EditorMode.READONLY&&e.type!=="subTemplate"){this._renderPlainText(t,e,n,i,Wo(e));return}if(l===s.EditorMode.EDIT){const c=e.label||e.value||"";this._renderEditMode(t,e,n,i,c);return}if(e.type==="macro"){const c=e.label||"",d=e.value||`获取 ${c}`;this._renderPlainText(t,e,n,i,d);return}if(e.type==="customMacro"){const c=r?.type||"text",d=r?.value||"",u=e.label||"";if(l===s.EditorMode.FORM)c==="select"?this._renderSelectControl(t,e,n,i,d):this._renderTextControl(t,e,n,i,d);else{const h=d||`获取 ${u}`;this._renderPlainText(t,e,n,i,h)}return}if(e.type==="reusableItem"){const d=e.reusableItemConfig?.value||"",u=e.label||"";if(l===s.EditorMode.FORM)this._renderTextControl(t,e,n,i,d);else{const h=d||`获取 ${u}`;this._renderPlainText(t,e,n,i,h)}return}if(e.type==="subTemplate"){const c=e.label||"子模板";l===s.EditorMode.FORM?e.subTemplateExpanded||this._renderEditMode(t,e,n,i,c):this._renderPlainText(t,e,n,i,c);return}const a=e.value||e.label||"";this._renderPlainText(t,e,n,i,a)}activateInlineEditor(t,e,n){const i=t.type===s.ElementType.CUSTOM_MACRO,l=t.type===s.ElementType.REUSABLE_ITEM;if(this.draw.getMode()!==s.EditorMode.FORM||!i&&!l)return!1;const r=i?this._ensureMacroConfig(t):void 0,a=r?.type||"text",c=this.activeInlineEditor;if(c&&c.elementId===t.id&&c.elementType===t.type&&(t.id||c.index===e)&&c.type===a){if(a==="text"){const T=this._getCursorOffset(t,e,n);c.cursorOffset=T,c.selectionOffset=T,this._syncInlineCursor()}return this._focusInputAgent(),!0}this.clearInlineEditor();const d=T=>{const g=T.target,f=this.activeInlineEditor?.popup;g instanceof Node&&f?.contains(g)||g!==this.draw.getCursor().getAgentDom()&&this.clearInlineEditor()},u=this._getCursorOffset(t,e,n),h=this.draw.getPosition(),R=h.getPositionList()[e];return this.draw.getRange().setRange(e,e),R&&h.setCursorPosition(R),this.activeInlineEditor={elementId:t.id,index:e,elementType:t.type,type:a,popup:null,cursorOffset:u,selectionOffset:u,compositionRange:null,initialValue:this._getInlineEditorValue(t),initialCode:r?.code,initialUnderline:t.underline,initialStrikeout:t.strikeout,initialTextDecoration:t.textDecoration?{...t.textDecoration}:void 0,outsideHandler:d},window.setTimeout(()=>{this.activeInlineEditor?.outsideHandler===d&&document.addEventListener("mousedown",d,!0)}),a==="select"?(this._createSelectPopup(t),this.draw.getCursor().recoveryCursor()):this._syncInlineCursor(),this._focusInputAgent(),!0}input(t,e=!1){const n=this.activeInlineEditor;if(!n||n.type!=="text"||!t)return!1;const i=t.replace(/\r\n?/g,`
120
120
  `);if(!i)return!0;const l=this._getInlineEditorElement(n);if(!l)return this.clearInlineEditor({isSubmitHistory:!1}),!0;const r=Array.from(this._getInlineEditorValue(l));let a=Math.min(n.cursorOffset,n.selectionOffset),c=Math.max(n.cursorOffset,n.selectionOffset);e&&n.compositionRange&&(a=n.compositionRange.start,c=n.compositionRange.end);const d=Array.from(i);r.splice(a,c-a,...d);const u=a+d.length;return n.cursorOffset=u,n.selectionOffset=u,n.compositionRange=e?{start:a,end:u}:null,this._setInlineEditorValue(l,r.join("")),this._renderActiveEditor(),!0}compositionStart(){const t=this.activeInlineEditor;return!t||t.type!=="text"?!1:(t.compositionRange={start:Math.min(t.cursorOffset,t.selectionOffset),end:Math.max(t.cursorOffset,t.selectionOffset)},!0)}compositionEnd(t){const e=this.activeInlineEditor;if(!e||e.type!=="text")return!1;if(e.compositionRange){const n=this._getInlineEditorElement(e);if(n){if(!t){const r=Array.from(this._getInlineEditorValue(n));return r.splice(e.compositionRange.start,e.compositionRange.end-e.compositionRange.start),e.cursorOffset=e.compositionRange.start,e.selectionOffset=e.cursorOffset,this._setInlineEditorValue(n,r.join("")),this._renderActiveEditor(),e.compositionRange=null,!0}const i=this._getInlineEditorValue(n),l=Array.from(i).slice(e.compositionRange.start,e.compositionRange.end).join("");t&&l!==t&&this.input(t,!0)}}else t&&this.input(t);return e.compositionRange=null,!0}keydown(t){const e=this.activeInlineEditor;if(!e)return!1;if(e.type==="select")return t.key==="Escape"&&this.clearInlineEditor({isSubmitHistory:!1,isRestore:!0}),t.key==="Escape"||t.key==="Enter"||t.key==="Backspace"||t.key==="Delete"||t.key.startsWith("Arrow")?(t.preventDefault(),t.stopImmediatePropagation(),!0):!1;const n=this._getInlineEditorElement(e);if(!n)return!1;const i=Array.from(this._getInlineEditorValue(n)),l=Math.min(e.cursorOffset,e.selectionOffset),r=Math.max(e.cursorOffset,e.selectionOffset),a=l!==r;if((t.ctrlKey||t.metaKey)&&t.key.toLowerCase()==="a")e.selectionOffset=0,e.cursorOffset=i.length,this._renderActiveEditor();else if(t.key==="ArrowLeft"||t.key==="ArrowRight"){const c=t.key==="ArrowLeft"?-1:1;!t.shiftKey&&a?(e.cursorOffset=c<0?l:r,e.selectionOffset=e.cursorOffset):(e.cursorOffset=Math.max(0,Math.min(i.length,e.cursorOffset+c)),t.shiftKey||(e.selectionOffset=e.cursorOffset)),this._renderActiveEditor()}else if(t.key==="Home"||t.key==="End")e.cursorOffset=t.key==="Home"?0:i.length,t.shiftKey||(e.selectionOffset=e.cursorOffset),this._renderActiveEditor();else if(t.key==="Backspace"||t.key==="Delete")a?(i.splice(l,r-l),e.cursorOffset=l):t.key==="Backspace"&&e.cursorOffset>0?(i.splice(e.cursorOffset-1,1),e.cursorOffset--):t.key==="Delete"&&e.cursorOffset<i.length&&i.splice(e.cursorOffset,1),e.selectionOffset=e.cursorOffset,this._setInlineEditorValue(n,i.join("")),this._renderActiveEditor();else if(t.key==="Enter")this.input(`
121
- `);else if(t.key==="Tab")this.clearInlineEditor();else if(t.key==="Escape")this.clearInlineEditor({isSubmitHistory:!1,isRestore:!0});else return!1;return t.preventDefault(),t.stopImmediatePropagation(),!0}clearInlineEditor(t={}){const e=this.activeInlineEditor;if(!e)return;this.activeInlineEditor=null;const{isSubmitHistory:n=!0,isRestore:i=!1}=t;document.removeEventListener("mousedown",e.outsideHandler,!0);const l=this._getInlineEditorElement(e);if(l&&i&&this._restoreInlineEditorValue(l,e),e.popup?.remove(),l){const r=this._getInlineEditorValue(l),a=l.macroConfig?.code,c=r!==e.initialValue||a!==e.initialCode;this.draw.render({curIndex:e.index,isSubmitHistory:c&&!i&&n})}}_renderPlainText(t,e,n,i,l){t.save(),t.font=e.style,t.fillStyle=e.color||"#000000",t.textBaseline="alphabetic";const r=this._getMacroLineHeight(e);l.split(Sn).forEach((a,c)=>{t.fillText(a,n,i+c*r)}),t.restore()}_renderEditMode(t,e,n,i,l){const{scale:r}=this.options,a=e.type==="customMacro",c=e.type==="reusableItem",d=e.type==="subTemplate";let u,h;d?(u="#722ed1",h="#f9f0ff"):c?(u="#52c41a",h="#f6ffed"):a?(u="#fa8c16",h="#fff7e6"):(u="#1677ff",h="#e6f4ff"),t.save(),t.font=e.style;const R=t.measureText(l),T=R.actualBoundingBoxAscent+R.actualBoundingBoxDescent,g=8*r,f=4*r,C=4*r,p=R.width+g*2,I=T+f*2,m=e.metrics,L=n,O=i-m.boundingBoxAscent+(m.boundingBoxAscent+m.boundingBoxDescent-I)/2;t.fillStyle=h,this._drawRoundedRect(t,L,O,p,I,C),t.fill(),t.fillStyle=u,t.textBaseline="middle",t.fillText(l,n+g,O+I/2),t.restore()}_renderTextControl(t,e,n,i,l){const{control:r}=this.options,{placeholderColor:a}=r;t.save(),t.font=e.style;const d=`请输入${e.label||""}`,h=(l||d).split(Sn),R=this._getMacroLineHeight(e),T=h.map(p=>t.measureText(p)),g=T[T.length-1];t.fillStyle=this._getControlColor(e),t.textBaseline="alphabetic",t.fillText("[",n,i);const f=n+t.measureText("[").width;this._renderTextSelection(t,e,f,i,l,R),t.fillStyle=l?this._getValueColor(e):a,h.forEach((p,I)=>{t.fillText(p,f,i+I*R)});const C=f+g.width;t.fillStyle=this._getControlColor(e),t.fillText("]",C,i+(h.length-1)*R),t.restore()}_renderSelectControl(t,e,n,i,l){const{scale:r,control:a}=this.options,{placeholderColor:c}=a;t.save(),t.font=e.style;const u=`请选择${e.label||""}`,h=l||u,R=t.measureText(h),T=R.actualBoundingBoxAscent+R.actualBoundingBoxDescent;t.fillStyle=this._getControlColor(e),t.textBaseline="alphabetic",t.fillText("[",n,i);const g=n+t.measureText("[").width;t.fillStyle=l?this._getValueColor(e):c,t.fillText(h,g,i);const f=g+R.width+2*r,C=i-T/2;t.beginPath(),t.moveTo(f,C-2*r),t.lineTo(f+5*r,C-2*r),t.lineTo(f+2.5*r,C+2*r),t.closePath(),t.fillStyle=this._getControlColor(e),t.fill();const p=f+6*r;t.fillStyle=this._getControlColor(e),t.fillText("]",p,i),t.restore()}_drawRoundedRect(t,e,n,i,l,r){t.beginPath(),t.moveTo(e+r,n),t.lineTo(e+i-r,n),t.quadraticCurveTo(e+i,n,e+i,n+r),t.lineTo(e+i,n+l-r),t.quadraticCurveTo(e+i,n+l,e+i-r,n+l),t.lineTo(e+r,n+l),t.quadraticCurveTo(e,n+l,e,n+l-r),t.lineTo(e,n+r),t.quadraticCurveTo(e,n,e+r,n),t.closePath()}_createSelectPopup(t){const e=this.activeInlineEditor;if(!e)return;const n=this._ensureMacroConfig(t);if(!n.items?.length)return;const i=this._getInlineEditorPosition(e);if(!i)return;const l=document.createElement("div");l.classList.add(`${st}-select-control-popup`,`${st}-macro-select-popup`),l.setAttribute(ve,s.EditorComponent.POPUP),l.style.setProperty("--COLOR-HOVER",this._getControlColor(t));const r=document.createElement("ul"),a=n.code||n.items?.find(h=>h.value===n.value)?.code||"";n.items.forEach(h=>{const R=document.createElement("li");R.textContent=h.value,R.dataset.code=h.code,h.code===a&&R.classList.add("active"),R.onclick=()=>{const T=h.code===a?"":h.code;this._setInlineEditorValue(t,"",T),this.clearInlineEditor()},r.append(R)}),l.append(r);const c=i.pageNo*(this.draw.getHeight()+this.draw.getPageGap()),[d,u]=i.coordinate.leftTop;l.style.left=`${d}px`,l.style.top=`${u+c+i.lineHeight}px`,this.draw.getContainer().append(l),e.popup=l}_getCursorOffset(t,e,n){const i=Array.from(this._getInlineEditorValue(t));if(n===void 0||!i.length)return i.length;const l=this.draw.getPosition().getPositionList()[e];if(!l)return i.length;const r=this.draw.getCtx();r.save(),r.font=this.draw.getElementFont(t);const a=l.coordinate.leftTop[0]+r.measureText("[").width;let c=0;for(let d=0;d<i.length;d++){const u=r.measureText(i[d]).width;if(n<a+c+u/2)return r.restore(),d;c+=u}return r.restore(),i.length}_focusInputAgent(){window.setTimeout(()=>{this.activeInlineEditor&&this.draw.getCursor().focus()})}_renderActiveEditor(){const t=this.activeInlineEditor;t&&(this.draw.render({curIndex:t.index,isSubmitHistory:!1}),this._syncInlineCursor())}_syncInlineCursor(){const t=this.activeInlineEditor;if(!t||t.type!=="text")return;const e=this._getInlineEditorElement(t),n=this._getInlineEditorPosition(t);if(!e||!n)return;const i=this.draw.getCtx();i.save(),i.font=this.draw.getElementFont(e);const l=Array.from(this._getInlineEditorValue(e)),r=this._getMacroLineStart(l,t.cursorOffset),a=l.slice(r,t.cursorOffset).join(""),c=l.slice(0,t.cursorOffset).filter(P=>Sn.test(P)).length,d=n.coordinate.leftTop[0]+i.measureText("[").width+i.measureText(a).width;i.restore();const u=this.draw.getCursor(),h=u.getCursorDom(),{scale:R}=this.options,T=this._getMacroLineHeight(e),g=Js*R,f=Math.min(T/4,g),C=T+f*2,p=l.filter(P=>Sn.test(P)).length+1,I=Math.max(n.metrics.boundingBoxDescent-T*(p-1),0),m=n.pageNo*(this.draw.getHeight()+this.draw.getPageGap()),L=n.coordinate.leftTop[1]+n.ascent+I-(C-f)+c*T+m,O=u.getAgentDom();h.style.left=`${d}px`,h.style.top=`${L}px`,h.style.height=`${C}px`,h.style.backgroundColor=this._getControlColor(e),h.style.display="block",O.style.left=`${d}px`,O.style.top=`${L+C-g}px`}_renderTextSelection(t,e,n,i,l,r){const a=this.activeInlineEditor;if(!a||a.type!=="text"||!l||!this._getIsActiveElement(e,a))return;const c=Math.min(a.cursorOffset,a.selectionOffset),d=Math.max(a.cursorOffset,a.selectionOffset);if(c===d)return;const u=Array.from(l);let R=this._getMacroLineStart(u,c);for(;R<=d;){const T=u.findIndex((p,I)=>I>=R&&Sn.test(p)),g=T===-1?u.length:T,f=Math.max(c,R),C=Math.min(d,g);if(f<C){const p=u.slice(R,f).join(""),I=u.slice(f,C).join(""),m=t.measureText(I||p);t.save(),t.globalAlpha=.2,t.fillStyle=this._getControlColor(e),t.fillRect(n+t.measureText(p).width,i+this._getMacroLineIndex(u,R)*r-m.actualBoundingBoxAscent,t.measureText(I).width,m.actualBoundingBoxAscent+m.actualBoundingBoxDescent),t.restore()}if(g>=d||g===u.length)break;R=g+1}}_getMacroLineHeight(t){const{scale:e,defaultSize:n}=this.options;return(t.size||n)*e}_getMacroLineStart(t,e){for(let n=Math.min(e-1,t.length-1);n>=0;n--)if(Sn.test(t[n]))return n+1;return 0}_getMacroLineIndex(t,e){return t.slice(0,e).filter(n=>Sn.test(n)).length}_getIsActiveElement(t,e){const n=this._getInlineEditorElement(e);return!!(n&&(n===t||n.id&&n.id===t.id))}_getControlColor(t){return t.type===s.ElementType.REUSABLE_ITEM?"#1677ff":"#fa8c16"}_getValueColor(t){return t.color||this.options.defaultColor}_getInlineEditorElement(t){const e=this.draw.getElementList()[t.index];return e?.id===t.elementId?e:t.elementId?this.draw.getElementList().find(n=>n.id===t.elementId)||null:e||null}_getInlineEditorPosition(t){return this.draw.getPosition().getPositionList()[t.index]||null}_ensureMacroConfig(t){return t.macroConfig||(t.macroConfig={type:"text"}),t.macroConfig}_getInlineEditorValue(t){return t.type===s.ElementType.REUSABLE_ITEM?t.reusableItemConfig?.value||"":t.macroConfig?.value||""}_setInlineEditorValue(t,e,n){if(t.type===s.ElementType.REUSABLE_ITEM){t.reusableItemConfig?t.reusableItemConfig.value=e:t.reusableItemConfig={value:e};return}const i=this._ensureMacroConfig(t);i.type==="select"?(i.code=n||void 0,i.value=this._getSelectLabelByCode(i,n)):i.value=e}_restoreInlineEditorValue(t,e){if(t.type===s.ElementType.REUSABLE_ITEM){this._setInlineEditorValue(t,e.initialValue),t.underline=e.initialUnderline,t.strikeout=e.initialStrikeout,t.textDecoration=e.initialTextDecoration;return}const n=this._ensureMacroConfig(t);n.value=e.initialValue,e.type==="select"&&(n.code=e.initialCode)}_getSelectLabelByCode(t,e){return e&&t.items?.find(n=>n.code===e)?.value||""}}class kd{draw;position;zone;options;elementList;rowList;positionList;constructor(t,e){this.draw=t,this.position=t.getPosition(),this.zone=t.getZone(),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=Zi(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],l=t;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:l,innerWidth:e,zone:s.EditorZone.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*Ks[t])}getHeight(){if(this.options.header.disabled)return 0;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.save(),t.globalAlpha=this.zone.isHeaderActive()?1:this.options.header.inactiveAlpha;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),l=[];let r=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(r+c.height>i)break;l.push(c),r+=c.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:l,pageNo:e,startIndex:0,innerWidth:n,zone:s.EditorZone.HEADER}),t.restore()}}class Gd{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 xd{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 Jd{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){t.save();const{scale:l,separator:{lineWidth:r,strokeStyle:a}}=this.options;t.lineWidth=(e.lineWidth||r)*l,t.strokeStyle=e.color||a,e.dashArray?.length&&t.setLineDash(e.dashArray);const c=Math.round(i);t.translate(0,t.lineWidth/2),t.beginPath(),t.moveTo(n,c),t.lineTo(n+e.width*l,c),t.stroke(),t.restore()}}class $d{draw;options;i18n;constructor(t){this.draw=t,this.options=t.getOptions(),this.i18n=t.getI18n()}render(t,e,n,i){const{pageBreak:{font:l,fontSize:r,lineDash:a}}=this.options,c=this.i18n.t("pageBreak.displayName"),{scale:d,defaultRowMargin:u}=this.options,h=r*d,R=e.width*d,T=this.draw.getDefaultBasicRowMarginHeight()*u;t.save(),t.font=`${h}px ${l}`;const g=t.measureText(c),f=(R-g.width)/2;t.setLineDash(a),t.translate(0,.5+T),t.beginPath(),t.moveTo(n,i),t.lineTo(n+f,i),t.moveTo(n+f+g.width,i),t.lineTo(n+R,i),t.stroke(),t.fillText(c,n+f,i+g.actualBoundingBoxAscent-h/2),t.restore()}}class zd{draw;options;imageCache;constructor(t){this.draw=t,this.options=t.getOptions(),this.imageCache=new Map}renderText(t,e){const{watermark:{data:n,opacity:i,font:l,size:r,color:a,repeat:c,gap:d,numberType:u},scale:h}=this.options,R=this.draw.getWidth(),T=this.draw.getHeight();t.save(),t.globalAlpha=i,t.font=`${r*h}px ${l}`;let g=n;const f=new RegExp(ro.PAGE_NO);f.test(g)&&(g=kn.formatNumberPlaceholder(g,e+1,f,u));const C=new RegExp(ro.PAGE_COUNT);C.test(g)&&(g=kn.formatNumberPlaceholder(g,this.draw.getPageCount(),C,u));const p=t.measureText(g);if(c){const I=this.draw.getPagePixelRatio(),m=document.createElement("canvas"),L=m.getContext("2d"),O=p.width,P=p.actualBoundingBoxAscent+p.actualBoundingBoxDescent,S=Math.sqrt(Math.pow(O,2)+Math.pow(P,2)),y=S+2*d[0]*h,Y=S+2*d[1]*h;m.width=y,m.height=Y,m.style.width=`${y*I}px`,m.style.height=`${Y*I}px`,L.translate(y/2,Y/2),L.rotate(-45*Math.PI/180),L.translate(-y/2,-Y/2),L.font=`${r*h}px ${l}`,L.fillStyle=a,L.fillText(g,(y-O)/2,(Y-P)/2+p.actualBoundingBoxAscent);const b=t.createPattern(m,"repeat");b&&(t.fillStyle=b,t.fillRect(0,0,R,T))}else{const I=R/2,m=T/2;t.fillStyle=a,t.translate(I,m),t.rotate(-45*Math.PI/180),t.fillText(g,-p.width/2,p.actualBoundingBoxAscent-r*h/2)}t.restore()}renderImage(t){const{watermark:{width:e,height:n,data:i,opacity:l,repeat:r,gap:a},scale:c}=this.options;if(!this.imageCache.has(i)){const T=new Image;T.setAttribute("crossOrigin","Anonymous"),T.src=i,T.onload=()=>{this.imageCache.set(i,T),this.draw.render({isCompute:!1,isSubmitHistory:!1})};return}const d=this.draw.getWidth(),u=this.draw.getHeight(),h=e*c,R=n*c;if(t.save(),t.globalAlpha=l,r){const T=this.draw.getPagePixelRatio(),g=document.createElement("canvas"),f=g.getContext("2d"),C=Math.sqrt(Math.pow(h,2)+Math.pow(R,2)),p=C+2*a[0]*c,I=C+2*a[1]*c;g.width=p,g.height=I,g.style.width=`${p*T}px`,g.style.height=`${I*T}px`,f.translate(p/2,I/2),f.rotate(-45*Math.PI/180),f.translate(-p/2,-I/2),f.drawImage(this.imageCache.get(i),(p-h)/2,(I-R)/2,h,R);const m=t.createPattern(g,"repeat");m&&(t.fillStyle=m,t.fillRect(0,0,d,u))}else{const T=d/2,g=u/2;t.translate(T,g),t.rotate(-45*Math.PI/180),t.drawImage(this.imageCache.get(i),-h/2,-R/2,h,R)}t.restore()}render(t,e){this.options.watermark.type===s.WatermarkType.IMAGE?this.renderImage(t):this.renderText(t,e)}}class jd{draw;control;options;highlightList;highlightMatchResult;constructor(t){this.draw=t.getDraw(),this.control=t,this.options=this.draw.getOptions(),this.highlightList=[],this.highlightMatchResult=[]}getControlHighlight(t,e){const{control:{activeBackgroundColor:n,disabledBackgroundColor:i,existValueBackgroundColor:l,noValueBackgroundColor:r,inlineControlBackgroundColor:a}}=this.options,c=t[e],d=this.draw.isPrintLikeMode(),u=this.draw.getMode(),h=u===s.EditorMode.EDIT||u===s.EditorMode.FORM,R=this.control.getActiveControl()?.getElement(),T=this._getControlType(t,e);let g=!1,f=!1,C=!1,p=!1;c.highlight||(g=!d&&!!n&&!!R&&c.controlId===R.controlId&&!this.control.getIsRangeInPostfix()),g||(f=!d&&!!i&&!!c.control?.disabled),f||(C=!d&&!!l&&!!c.controlId&&this.control.getIsExistValueByElementListIndex(t,e)),C||(p=!d&&!!r&&!!c.controlId&&!this.control.getIsExistValueByElementListIndex(t,e));const I=h&&!!a&&(T===s.ControlType.SELECT||T===s.ControlType.DATE);return(g?n:"")||(f?i:"")||(C?l:"")||(p?r:"")||(I?a:"")}getIsInlineControlBackground(t,e){const n=this.draw.getMode(),i=this._getControlType(t,e);return!!((n===s.EditorMode.EDIT||n===s.EditorMode.FORM)&&this.options.control.inlineControlBackgroundColor&&(i===s.ControlType.SELECT||i===s.ControlType.DATE))}_getControlType(t,e){const n=t[e];if(n.control?.type)return n.control.type;if(n.controlId){for(let i=e-1;i>=0;i--){const l=t[i];if(l.controlId!==n.controlId)break;if(l.control?.type)return l.control.type}for(let i=e+1;i<t.length;i++){const l=t[i];if(l.controlId!==n.controlId)break;if(l.control?.type)return l.control.type}}}getHighlightMatchResult(){return this.highlightMatchResult}getHighlightList(){return this.highlightList}setHighlightList(t){this.highlightList=t}computeHighlightList(){const t=this.draw.getSearch(),e=(n,i)=>{let l=0;for(;l<n.length;){const r=n[l];if(l++,r.type===s.ElementType.TABLE){const g=r.trList;for(let f=0;f<g.length;f++){const C=g[f];for(let p=0;p<C.tdList.length;p++){const I=C.tdList[p],m={tableId:r.id,tableIndex:l-1,trIndex:f,tdIndex:p,tdId:I.id};e(I.value,m)}}}const a=r?.control;if(!a)continue;const c=this.highlightList.findIndex(g=>g.id===r.controlId||a.conceptId&&a.conceptId===g.conceptId);if(!~c)continue;const d=l;let u=l;for(;u<n.length&&n[u].controlId===r.controlId;)u++;l=u;const h=n.slice(d,u).map(g=>g.controlComponent===s.ControlComponent.VALUE?g:{value:_}),R=this.highlightList[c],{ruleList:T}=R;for(let g=0;g<T.length;g++){const f=T[g],C=t.getMatchList(f.keyword,h);this.highlightMatchResult.push(...C.map(p=>({...p,...f,...i,index:p.index+d})))}}};this.highlightMatchResult=[],e(this.draw.getOriginalMainElementList())}renderHighlightList(t,e){if(!this.highlightMatchResult?.length)return;const{searchMatchAlpha:n,searchMatchColor:i}=this.options,l=this.draw.getPosition().getOriginalPositionList(),r=this.draw.getOriginalElementList();t.save();for(let a=0;a<this.highlightMatchResult.length;a++){const c=this.highlightMatchResult[a];let d=null;if(c.tableId){const{tableIndex:I,trIndex:m,tdIndex:L,index:O}=c;d=r[I]?.trList[m].tdList[L]?.positionList[O]}else d=l[c.index];if(!d)continue;const{coordinate:{leftTop:u,leftBottom:h,rightTop:R},pageNo:T}=d;if(T!==e)continue;t.fillStyle=c.backgroundColor||i,t.globalAlpha=c.alpha||n;const g=u[0],f=u[1],C=R[0]-u[0],p=h[1]-u[1];t.fillRect(g,f,C,p)}t.restore()}}const Vr={error:{borderColor:"#ff4d4f",backgroundColor:"rgba(255,77,79,0.08)"},warning:{borderColor:"#faad14",backgroundColor:"rgba(250,173,20,0.08)"},warn:{borderColor:"#faad14",backgroundColor:"rgba(250,173,20,0.08)"},info:{borderColor:"#1677ff",backgroundColor:"rgba(22,119,255,0.08)"}},qd="#ff4d4f",tu=5e3,qi=4;class eu{draw;options;marks;underlineTimer;underlineVisible;constructor(t){this.draw=t,this.options=t.getOptions(),this.marks=[],this.underlineTimer=null,this.underlineVisible=!1}setMarks(t){this._clearUnderlineTimer(),this.marks=t.slice(),this.underlineVisible=this.marks.length>0,this.marks.length&&(this.underlineTimer=window.setTimeout(()=>{this.underlineVisible=!1,this.underlineTimer=null,this.draw.render({isSetCursor:!1,isSubmitHistory:!1})},tu))}getMarks(){return this.marks}render(t,e,n,i,l,r,a){if(!this.marks.length||this.draw.isPrintLikeMode())return;const c=this._getRegions(e,n,i,l,r,a);if(c.length){t.save();for(let d=0;d<c.length;d++){const u=c[d],h=this._getStyle(u.mark),R=Math.max(1,this.options.scale),T=u.x-R,g=u.y-R,f=Math.max(1,u.width+R*2),C=Math.max(1,u.height+R*2),p=Math.max(2,this.options.scale*2);if(this.underlineVisible&&h.borderColor&&u.hasUnderline&&(t.lineWidth=p,t.strokeStyle=h.borderColor,t.beginPath(),t.moveTo(u.underlineX,u.underlineY),t.lineTo(u.underlineRight,u.underlineY),t.stroke()),u.drawRequired){this._renderRequiredMark(t,u,T);continue}if(h.borderColor){t.lineWidth=p;const I=Math.min(Math.max(8*this.options.scale,C*.3),C/2),m=T+f,L=g+C;t.beginPath(),u.drawLeft&&(t.moveTo(T+I,g),t.lineTo(T,g),t.lineTo(T,L)),u.drawRight&&(t.moveTo(m-I,L),t.lineTo(m,L),t.lineTo(m,g)),t.stroke()}}t.restore()}}_getRegions(t,e,n,i,l,r){const a=this._getParentMap(t),c=this.marks.map(R=>this._getTargetControlIds(t,R)),d=c.map(R=>this._getTitleTargets(t,R)),u=[];for(let R=0;R<n.length;R++){const T=n[R],g=new Map,f=e[T.startIndex],C=f?Math.min(f.coordinate.leftTop[0],f.coordinate.leftBottom[0])-(T.offsetX||0):0,p=f?C+(r||this.draw.getInnerWidth()):0;for(let I=0;I<T.elementList.length;I++){const m=T.elementList[I],L=T.startIndex+I,O=e[L];if(!O||l===s.EditorZone.MAIN&&O.pageNo!==i)continue;const P=this._getTargetIdsForElement(this._getQualityTargetId(m),c,a);for(let W=0;W<d.length;W++){const K=d[W].get(L);K&&K.forEach(k=>{P.some(B=>B.markIndex===W&&B.controlId===k)||P.push({markIndex:W,controlId:k})})}if(!P.length)continue;const S=O.coordinate.leftTop,y=O.coordinate.rightTop,Y=O.coordinate.leftBottom,b=O.coordinate.rightBottom,M=Math.min(S[0],Y[0]),V=Math.max(y[0],b[0]),N=Math.min(S[1],y[1]),X=Math.max(Y[1],b[1]),D=O.metrics.boundingBoxAscent+O.metrics.boundingBoxDescent,E=N+O.ascent-O.metrics.boundingBoxAscent,U=D>0?E:N,F=D>0?E+D:X,Z=this._isButtonElement(m),Q=f?Math.max(M,Math.min(V,p)):V;for(let W=0;W<P.length;W++){const{markIndex:K,controlId:k}=P[W],B=`${K}:${k}:${T.startIndex}`,H=g.get(B),A={x:M,y:U,right:V,bottom:F};if(H){const v=this._mergeBounds(H,A);H.x=v.x,H.y=v.y,H.width=Math.max(1,v.right-v.x),H.height=Math.max(1,v.bottom-v.y),Z||(H.hasUnderline?(H.underlineX=Math.min(H.underlineX,M),H.underlineY=Math.max(H.underlineY,F+qi),H.underlineRight=Math.max(H.underlineRight,Q)):(H.underlineX=M,H.underlineY=F+qi,H.underlineRight=Q),H.hasUnderline=!0)}else g.set(B,{mark:this.marks[K],targetKey:`${K}:${k}`,x:M,y:U,width:Math.max(1,V-M),height:Math.max(1,F-U),baseline:N+O.ascent,font:m.style||this.draw.getElementFont(m,this.options.scale),underlineX:M,underlineY:F+qi,underlineRight:Q,hasUnderline:!Z,drawLeft:!1,drawRight:!1,drawRequired:!1})}}u.push(...g.values())}const h=new Map;for(let R=0;R<u.length;R++){const T=u[R],g=h.get(T.targetKey)||[];g.push(T),h.set(T.targetKey,g)}return h.forEach(R=>{this._isRequiredMark(R[0].mark)?R[0].drawRequired=!0:(R[0].drawLeft=!0,R[R.length-1].drawRight=!0)}),u}_renderRequiredMark(t,e,n){t.save(),t.font=e.font,t.fillStyle=e.mark.style?.borderColor||qd,t.textBaseline="alphabetic";const i=t.measureText("*").width,l=Math.max(2,this.options.scale*2);t.fillText("*",n-i-l,e.baseline),t.restore()}_clearUnderlineTimer(){this.underlineTimer!==null&&(window.clearTimeout(this.underlineTimer),this.underlineTimer=null)}_mergeBounds(t,e){return{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),right:Math.max(t.x+t.width,e.right),bottom:Math.max(t.y+t.height,e.bottom)}}_getParentMap(t){const e=new Map;for(let n=0;n<t.length;n++){const i=t[n],l=this._getQualityTargetId(i);l&&i.originControlId&&e.set(l,i.originControlId)}return e}_getTitleTargets(t,e){const n=new Map;return e.forEach(i=>{const l=t.findIndex(R=>this._getQualityTargetId(R)===i);if(l<0)return;const r=t[l],a=r.control,c=this._getTitleTextBefore(t,l);if(!c)return;const d=[a?.label,a?.placeholder].concat(this._isMacroElement(r)?[r.label]:[]).filter(Boolean).map(R=>this._normalizeTitleText(R)),u=this._normalizeTitleText(c);if(!d.some(R=>R===u||R.includes(u)||u.includes(R)))return;let h=l-1;for(;h>=0&&this._isTitleValueElement(t[h]);){let R=n.get(h);R||(R=new Set,n.set(h,R)),R.add(i),h--}}),n}_getTitleTextBefore(t,e){const n=t[e-1];if(n?.type===s.ElementType.TITLE)return n.valueList?.map(r=>r.value).join("")||"";if(!this._isTitleValueElement(n))return"";const i=n.titleId;let l=e-1;for(;l>=0&&this._isTitleValueElement(t[l])&&t[l].titleId===i;)l--;return t.slice(l+1,e).map(r=>r.value).join("")}_isTitleValueElement(t){return!!t?.titleId&&!!t.level}_normalizeTitleText(t){return t.replace(/\s/g,"").replace(/[::]+$/,"")}_getTargetControlIds(t,e){const n=new Set,i=e.id?"id":e.conceptId?"conceptId":e.code?"code":null;if(!i)return n;for(let l=0;l<t.length;l++){const r=t[l],a=this._getQualityTargetId(r);if(!a)continue;const c=r.control?.conceptId||r.conceptId,d=r.control?.code||r.macroConfig?.code||r.dictCode;(i==="id"&&a===e.id||i==="conceptId"&&c===e.conceptId||i==="code"&&d===e.code)&&n.add(a)}return n}_getQualityTargetId(t){if(t.controlId)return t.controlId;if(this._isMacroElement(t))return t.id}_isMacroElement(t){return[s.ElementType.MACRO,s.ElementType.CUSTOM_MACRO,s.ElementType.REUSABLE_ITEM].includes(t.type)}_getTargetIdsForElement(t,e,n){if(!t)return[];const i=[];for(let l=0;l<e.length;l++){const r=e[l];let a=t;const c=new Set;for(;a&&!c.has(a);){if(r.has(a)){i.push({markIndex:l,controlId:a});break}c.add(a),a=n.get(a)}}return i}_getStyle(t){return{...Vr[t.type?.toLowerCase()||"error"]||Vr.error,...t.style}}_isRequiredMark(t){return t.required===!0||["required","required-empty","required_empty"].includes(t.type?.toLowerCase()||"")}_isButtonElement(t){return t.type===s.ElementType.BUTTON||t.control?.type===s.ControlType.BUTTON&&!t.control.buttonText}}class nu{borderRect;options;constructor(t){this.borderRect=this.clearBorderInfo(),this.options=t.getOptions()}clearBorderInfo(){return this.borderRect={x:0,y:0,width:0,height:0},this.borderRect}recordBorderInfo(t,e,n,i){!this.borderRect.width&&(this.borderRect.x=t,this.borderRect.y=e,this.borderRect.height=i),this.borderRect.width+=n}render(t){if(!this.borderRect.width)return;const{scale:e,control:{borderWidth:n,borderColor:i}}=this.options,{x:l,y:r,width:a,height:c}=this.borderRect;t.save(),t.translate(0,1*e),t.lineWidth=n*e,t.strokeStyle=i,t.beginPath(),t.rect(l,r,a,c),t.stroke(),t.restore(),this.clearBorderInfo()}}class co{draw;element;control;isPopup;selectDom;options;VALUE_DELIMITER=",";DEFAULT_MULTI_SELECT_DELIMITER=",";constructor(t,e){const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1,this.selectDom=null}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getCodes(){return this.element?.control?.code?this.element.control.code.split(","):[]}getText(t){if(!this.element?.control)return null;const e=this.element.control;if(!e.valueSets?.length)return null;const n=e?.multiSelectDelimiter||this.DEFAULT_MULTI_SELECT_DELIMITER,i=e.valueSets,l=[];return t.forEach(r=>{const a=i.find(c=>c.code===r);a&&!Gs(a.value)&&l.push(a.value)}),l.join(n)||null}getValue(t={}){const{elementList:e,range:n}=this.control.mergeControl(t),{startIndex:i}=n,l=e[i],r=[];let a=i;for(;a>=0;){const d=e[a];if(!d||d.controlId!==l.controlId||d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT)break;d.controlComponent===s.ControlComponent.VALUE&&r.unshift(d),a--}let c=i+1;for(;c<e.length;){const d=e[c];if(d.controlId!==l.controlId||d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POST_TEXT)break;d.controlComponent===s.ControlComponent.VALUE&&r.push(d),c++}return r}setValue(t,e={},n={}){if(!this.element.control?.selectExclusiveOptions?.inputAble||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:r,endIndex:a}=l,c=this.control.getDraw();r!==a?c.spliceElementList(i,r+1,a-r):this.control.removePlaceholder(r,{elementList:i});const d=i[r],u=d.type&&!Le.includes(d.type)||d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT?xt(d,["control","controlId",...ue]):Ee(d,["type"]),h=l.startIndex+1;for(let R=0;R<t.length;R++){const T={...u,...t[R],controlComponent:s.ControlComponent.VALUE};le(i,[T],r,{editorOptions:this.options}),c.spliceElementList(i,h+R,0,[T])}return h+t.length-1}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:l}=n,r=e[i],a=e[l],c=this.element.control?.selectExclusiveOptions?.inputAble;if(t.key===s.KeyMap.Backspace)return i!==l?c?(this.draw.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect():r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT||a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT||r.controlComponent===s.ControlComponent.PLACEHOLDER?this.control.removeControl(i):c?(this.draw.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1):this.clearSelect();if(t.key===s.KeyMap.Delete){if(i!==l)return c?(this.draw.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect();{const d=e[l+1];return(r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT)&&d.controlComponent===s.ControlComponent.PLACEHOLDER||d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POST_TEXT||r.controlComponent===s.ControlComponent.PLACEHOLDER?this.control.removeControl(i):c?(this.draw.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect()}}return l}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();return t===e?t:this.clearSelect()}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const l=t.elementList||this.control.getElementList(),{startIndex:r}=t.range||this.control.getRange(),a=l[r];let c=-1,d=-1,u=r;for(;u>0;){const T=l[u];if(T.controlId!==a.controlId||T.controlComponent===s.ControlComponent.PREFIX||T.controlComponent===s.ControlComponent.PRE_TEXT){c=u;break}u--}let h=r+1;for(;h<l.length;){const T=l[h];if(T.controlId!==a.controlId||T.controlComponent===s.ControlComponent.POSTFIX||T.controlComponent===s.ControlComponent.POST_TEXT){d=h-1;break}h++}return!~c||!~d?-1:(this.control.getDraw().spliceElementList(l,c+1,d-c,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(u,t),this.control.setControlProperties({code:void 0},{elementList:l,range:{startIndex:u,endIndex:u}}),u)}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const i=e.elementList||this.control.getElementList(),l=e.range||this.control.getRange(),r=this.element.control,a=t?.split(this.VALUE_DELIMITER)||[],c=r.code,d=r.code?.split(this.VALUE_DELIMITER)||[],u=r.isMultiSelect;if(!u&&t===c||u&&ks(d,a)){this.control.repaintControl({curIndex:l.startIndex,isCompute:!1,isSubmitHistory:!1}),this.destroy();return}const h=r.valueSets;if(!Array.isArray(h)||!h.length)return;const R=this.getText(a);if(!R){if(c){const L=this.clearSelect(e,{isIgnoreDeletedRule:n.isIgnoreDeletedRule});~L&&(this.control.repaintControl({curIndex:L}),this.control.emitControlContentChange({controlValue:[]}))}return}const T=this.getValue(e)[0],g=T?xt(T,Ne):xt(i[l.startIndex],ue),f=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~f)return;c||this.control.removePlaceholder(f,e);const C=Ee(i[f],Ne),p=f+1,I=Nt(R),m=this.control.getDraw();for(let L=0;L<I.length;L++){const O={...g,...C,type:s.ElementType.TEXT,value:I[L],controlComponent:s.ControlComponent.VALUE};(O.color===this.options.control.bracketColor||O.color===this.options.control.placeholderColor)&&(O.color=this.options.defaultColor),le(i,[O],f,{editorOptions:this.options}),m.spliceElementList(i,p+L,0,[O])}if(this.control.setControlProperties({code:t},{elementList:i,range:{startIndex:f,endIndex:f}}),!e.range){const L=p+I.length-1;this.control.repaintControl({curIndex:L}),this.control.emitControlContentChange({context:e}),u||this.destroy()}}_createSelectPopupDom(){const t=this.element.control,e=t.valueSets;if(!Array.isArray(e)||!e.length)return;const n=this.control.getPosition();if(!n)return;const i=document.createElement("div");i.classList.add(`${st}-select-control-popup`),i.setAttribute(ve,s.EditorComponent.POPUP);const l=g=>{g.stopPropagation()};i.addEventListener("mousedown",l),i.addEventListener("mouseup",l),i.addEventListener("click",l),i.addEventListener("keydown",l),i.addEventListener("input",l);const r=document.createElement("input");r.type="search",r.classList.add(`${st}-select-control-search`),r.placeholder=this.draw.getI18n().t("select.search")||"搜索选项",r.setAttribute("aria-label",r.placeholder);const a=document.createElement("ul");a.setAttribute("role","listbox");const c=(g="")=>{for(;a.firstChild;)a.removeChild(a.firstChild);const f=g.trim().toLocaleLowerCase(),C=e.filter(O=>f?[O.value,O.code].some(P=>P.toLocaleLowerCase().includes(f)):!0),p=this.getCodes(),I=C.findIndex(O=>p.includes(O.code)),m=I>=0?I:0;let L=null;for(let O=0;O<C.length;O++){const P=C[O],S=document.createElement("li");S.setAttribute("role","option"),p.includes(P.code)&&(S.classList.add("active"),L=S),O===m&&(S.classList.add("keyboard-active"),S.setAttribute("aria-selected","true")),S.onclick=()=>{const y=this.getCodes(),Y=y.findIndex(b=>b===P.code);t.isMultiSelect?~Y?y.splice(Y,1):y.push(P.code):~Y?y.length=0:y.splice(0,y.length,P.code),this.setSelect(y.join(this.VALUE_DELIMITER)),t.isMultiSelect&&c(r.value)},S.append(document.createTextNode(P.value)),a.append(S)}if(!C.length){const O=document.createElement("li");O.classList.add(`${st}-select-control-empty`),O.textContent=this.draw.getI18n().t("select.empty")||"无匹配项",a.append(O)}L&&Pi(i,L)};r.addEventListener("input",()=>{c(r.value)}),r.addEventListener("keydown",g=>{if(g.key==="ArrowDown"||g.key==="ArrowUp"){g.preventDefault();const f=Array.from(a.querySelectorAll("li:not(.ce-select-control-empty)"));if(!f.length)return;const C=f.findIndex(m=>m.classList.contains("keyboard-active")),p=g.key==="ArrowDown"?1:-1,I=C<0?p>0?0:f.length-1:(C+p+f.length)%f.length;f.forEach((m,L)=>{const O=L===I;m.classList.toggle("keyboard-active",O),m.setAttribute("aria-selected",String(O))}),Pi(i,f[I]);return}if(g.key==="Enter"){g.preventDefault(),a.querySelector("li.keyboard-active")?.click();return}g.key==="Escape"&&this.destroy()}),i.append(r,a);const{coordinate:{leftTop:[d,u]},lineHeight:h}=n,R=this.control.getPreY();i.style.left=`${d}px`,i.style.top=`${u+R+h}px`,this.control.getContainer().append(i),this.selectDom=i,c(),Li(()=>{window.setTimeout(()=>{this.selectDom===i&&i.isConnected&&r.focus()})})}awake(){if(this.isPopup||this.control.getIsDisabledControl())return;const{startIndex:t}=this.control.getRange(),n=this.control.getElementList()[t];!n||n.controlId!==this.element.controlId||n.controlComponent===s.ControlComponent.POSTFIX||n.controlComponent===s.ControlComponent.POSTTEXTFIX||n.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||n.controlComponent===s.ControlComponent.POST_TEXT||(this._createSelectPopupDom(),this.isPopup=!0)}destroy(){this.isPopup&&(this.selectDom?.remove(),this.isPopup=!1)}}var Wr;function lt(){return Wr.apply(null,arguments)}function ou(o){Wr=o}function Ve(o){return o instanceof Array||Object.prototype.toString.call(o)==="[object Array]"}function Dn(o){return o!=null&&Object.prototype.toString.call(o)==="[object Object]"}function Ht(o,t){return Object.prototype.hasOwnProperty.call(o,t)}function ts(o){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(o).length===0;var t;for(t in o)if(Ht(o,t))return!1;return!0}function Ie(o){return o===void 0}function qe(o){return typeof o=="number"||Object.prototype.toString.call(o)==="[object Number]"}function uo(o){return o instanceof Date||Object.prototype.toString.call(o)==="[object Date]"}function Ur(o,t){var e=[],n,i=o.length;for(n=0;n<i;++n)e.push(t(o[n],n));return e}function gn(o,t){for(var e in t)Ht(t,e)&&(o[e]=t[e]);return Ht(t,"toString")&&(o.toString=t.toString),Ht(t,"valueOf")&&(o.valueOf=t.valueOf),o}function Be(o,t,e,n){return al(o,t,e,n,!0).utc()}function iu(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Xt(o){return o._pf==null&&(o._pf=iu()),o._pf}var es;Array.prototype.some?es=Array.prototype.some:es=function(o){var t=Object(this),e=t.length>>>0,n;for(n=0;n<e;n++)if(n in t&&o.call(this,t[n],n,t))return!0;return!1};function ns(o){var t=null,e=!1,n=o._d&&!isNaN(o._d.getTime());if(n&&(t=Xt(o),e=es.call(t.parsedDateParts,function(i){return i!=null}),n=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&e),o._strict&&(n=n&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(o))o._isValid=n;else return n;return o._isValid}function Ho(o){var t=Be(NaN);return o!=null?gn(Xt(t),o):Xt(t).userInvalidated=!0,t}var Yr=lt.momentProperties=[],os=!1;function is(o,t){var e,n,i,l=Yr.length;if(Ie(t._isAMomentObject)||(o._isAMomentObject=t._isAMomentObject),Ie(t._i)||(o._i=t._i),Ie(t._f)||(o._f=t._f),Ie(t._l)||(o._l=t._l),Ie(t._strict)||(o._strict=t._strict),Ie(t._tzm)||(o._tzm=t._tzm),Ie(t._isUTC)||(o._isUTC=t._isUTC),Ie(t._offset)||(o._offset=t._offset),Ie(t._pf)||(o._pf=Xt(t)),Ie(t._locale)||(o._locale=t._locale),l>0)for(e=0;e<l;e++)n=Yr[e],i=t[n],Ie(i)||(o[n]=i);return o}function ho(o){is(this,o),this._d=new Date(o._d!=null?o._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),os===!1&&(os=!0,lt.updateOffset(this),os=!1)}function We(o){return o instanceof ho||o!=null&&o._isAMomentObject!=null}function wr(o){lt.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+o)}function Fe(o,t){var e=!0;return gn(function(){if(lt.deprecationHandler!=null&&lt.deprecationHandler(null,o),e){var n=[],i,l,r,a=arguments.length;for(l=0;l<a;l++){if(i="",typeof arguments[l]=="object"){i+=`
121
+ `);else if(t.key==="Tab")this.clearInlineEditor();else if(t.key==="Escape")this.clearInlineEditor({isSubmitHistory:!1,isRestore:!0});else return!1;return t.preventDefault(),t.stopImmediatePropagation(),!0}clearInlineEditor(t={}){const e=this.activeInlineEditor;if(!e)return;this.activeInlineEditor=null;const{isSubmitHistory:n=!0,isRestore:i=!1}=t;document.removeEventListener("mousedown",e.outsideHandler,!0);const l=this._getInlineEditorElement(e);if(l&&i&&this._restoreInlineEditorValue(l,e),e.popup?.remove(),l){const r=this._getInlineEditorValue(l),a=l.macroConfig?.code,c=r!==e.initialValue||a!==e.initialCode;this.draw.render({curIndex:e.index,isSubmitHistory:c&&!i&&n})}}_renderPlainText(t,e,n,i,l){t.save(),t.font=e.style,t.fillStyle=e.color||"#000000",t.textBaseline="alphabetic";const r=this._getMacroLineHeight(e);l.split(Sn).forEach((a,c)=>{t.fillText(a,n,i+c*r)}),t.restore()}_renderEditMode(t,e,n,i,l){const{scale:r}=this.options,a=e.type==="customMacro",c=e.type==="reusableItem",d=e.type==="subTemplate";let u,h;d?(u="#722ed1",h="#f9f0ff"):c?(u="#52c41a",h="#f6ffed"):a?(u="#fa8c16",h="#fff7e6"):(u="#1677ff",h="#e6f4ff"),t.save(),t.font=e.style;const R=t.measureText(l),T=R.actualBoundingBoxAscent+R.actualBoundingBoxDescent,g=8*r,f=4*r,C=4*r,p=R.width+g*2,I=T+f*2,m=e.metrics,L=n,O=i-m.boundingBoxAscent+(m.boundingBoxAscent+m.boundingBoxDescent-I)/2;t.fillStyle=h,this._drawRoundedRect(t,L,O,p,I,C),t.fill(),t.fillStyle=u,t.textBaseline="middle",t.fillText(l,n+g,O+I/2),t.restore()}_renderTextControl(t,e,n,i,l){const{control:r}=this.options,{placeholderColor:a}=r;t.save(),t.font=e.style;const d=`请输入${e.label||""}`,h=(l||d).split(Sn),R=this._getMacroLineHeight(e),T=h.map(p=>t.measureText(p)),g=T[T.length-1];t.fillStyle=this._getControlColor(e),t.textBaseline="alphabetic",t.fillText("[",n,i);const f=n+t.measureText("[").width;this._renderTextSelection(t,e,f,i,l,R),t.fillStyle=l?this._getValueColor(e):a,h.forEach((p,I)=>{t.fillText(p,f,i+I*R)});const C=f+g.width;t.fillStyle=this._getControlColor(e),t.fillText("]",C,i+(h.length-1)*R),t.restore()}_renderSelectControl(t,e,n,i,l){const{scale:r,control:a}=this.options,{placeholderColor:c}=a;t.save(),t.font=e.style;const u=`请选择${e.label||""}`,h=l||u,R=t.measureText(h),T=R.actualBoundingBoxAscent+R.actualBoundingBoxDescent;t.fillStyle=this._getControlColor(e),t.textBaseline="alphabetic",t.fillText("[",n,i);const g=n+t.measureText("[").width;t.fillStyle=l?this._getValueColor(e):c,t.fillText(h,g,i);const f=g+R.width+2*r,C=i-T/2;t.beginPath(),t.moveTo(f,C-2*r),t.lineTo(f+5*r,C-2*r),t.lineTo(f+2.5*r,C+2*r),t.closePath(),t.fillStyle=this._getControlColor(e),t.fill();const p=f+6*r;t.fillStyle=this._getControlColor(e),t.fillText("]",p,i),t.restore()}_drawRoundedRect(t,e,n,i,l,r){t.beginPath(),t.moveTo(e+r,n),t.lineTo(e+i-r,n),t.quadraticCurveTo(e+i,n,e+i,n+r),t.lineTo(e+i,n+l-r),t.quadraticCurveTo(e+i,n+l,e+i-r,n+l),t.lineTo(e+r,n+l),t.quadraticCurveTo(e,n+l,e,n+l-r),t.lineTo(e,n+r),t.quadraticCurveTo(e,n,e+r,n),t.closePath()}_createSelectPopup(t){const e=this.activeInlineEditor;if(!e)return;const n=this._ensureMacroConfig(t);if(!n.items?.length)return;const i=this._getInlineEditorPosition(e);if(!i)return;const l=document.createElement("div");l.classList.add(`${st}-select-control-popup`,`${st}-macro-select-popup`),l.setAttribute(ve,s.EditorComponent.POPUP),l.style.setProperty("--COLOR-HOVER",this._getControlColor(t));const r=document.createElement("ul"),a=n.code||n.items?.find(h=>h.value===n.value)?.code||"";n.items.forEach(h=>{const R=document.createElement("li");R.textContent=h.value,R.dataset.code=h.code,h.code===a&&R.classList.add("active"),R.onclick=()=>{const T=h.code===a?"":h.code;this._setInlineEditorValue(t,"",T),this.clearInlineEditor()},r.append(R)}),l.append(r);const c=i.pageNo*(this.draw.getHeight()+this.draw.getPageGap()),[d,u]=i.coordinate.leftTop;l.style.left=`${d}px`,l.style.top=`${u+c+i.lineHeight}px`,this.draw.getContainer().append(l),e.popup=l}_getCursorOffset(t,e,n){const i=Array.from(this._getInlineEditorValue(t));if(n===void 0||!i.length)return i.length;const l=this.draw.getPosition().getPositionList()[e];if(!l)return i.length;const r=this.draw.getCtx();r.save(),r.font=this.draw.getElementFont(t);const a=l.coordinate.leftTop[0]+r.measureText("[").width;let c=0;for(let d=0;d<i.length;d++){const u=r.measureText(i[d]).width;if(n<a+c+u/2)return r.restore(),d;c+=u}return r.restore(),i.length}_focusInputAgent(){window.setTimeout(()=>{this.activeInlineEditor&&this.draw.getCursor().focus()})}_renderActiveEditor(){const t=this.activeInlineEditor;t&&(this.draw.render({curIndex:t.index,isSubmitHistory:!1}),this._syncInlineCursor())}_syncInlineCursor(){const t=this.activeInlineEditor;if(!t||t.type!=="text")return;const e=this._getInlineEditorElement(t),n=this._getInlineEditorPosition(t);if(!e||!n)return;const i=this.draw.getCtx();i.save(),i.font=this.draw.getElementFont(e);const l=Array.from(this._getInlineEditorValue(e)),r=this._getMacroLineStart(l,t.cursorOffset),a=l.slice(r,t.cursorOffset).join(""),c=l.slice(0,t.cursorOffset).filter(P=>Sn.test(P)).length,d=n.coordinate.leftTop[0]+i.measureText("[").width+i.measureText(a).width;i.restore();const u=this.draw.getCursor(),h=u.getCursorDom(),{scale:R}=this.options,T=this._getMacroLineHeight(e),g=Js*R,f=Math.min(T/4,g),C=T+f*2,p=l.filter(P=>Sn.test(P)).length+1,I=Math.max(n.metrics.boundingBoxDescent-T*(p-1),0),m=n.pageNo*(this.draw.getHeight()+this.draw.getPageGap()),L=n.coordinate.leftTop[1]+n.ascent+I-(C-f)+c*T+m,O=u.getAgentDom();h.style.left=`${d}px`,h.style.top=`${L}px`,h.style.height=`${C}px`,h.style.backgroundColor=this._getControlColor(e),h.style.display="block",O.style.left=`${d}px`,O.style.top=`${L+C-g}px`}_renderTextSelection(t,e,n,i,l,r){const a=this.activeInlineEditor;if(!a||a.type!=="text"||!l||!this._getIsActiveElement(e,a))return;const c=Math.min(a.cursorOffset,a.selectionOffset),d=Math.max(a.cursorOffset,a.selectionOffset);if(c===d)return;const u=Array.from(l);let R=this._getMacroLineStart(u,c);for(;R<=d;){const T=u.findIndex((p,I)=>I>=R&&Sn.test(p)),g=T===-1?u.length:T,f=Math.max(c,R),C=Math.min(d,g);if(f<C){const p=u.slice(R,f).join(""),I=u.slice(f,C).join(""),m=t.measureText(I||p);t.save(),t.globalAlpha=.2,t.fillStyle=this._getControlColor(e),t.fillRect(n+t.measureText(p).width,i+this._getMacroLineIndex(u,R)*r-m.actualBoundingBoxAscent,t.measureText(I).width,m.actualBoundingBoxAscent+m.actualBoundingBoxDescent),t.restore()}if(g>=d||g===u.length)break;R=g+1}}_getMacroLineHeight(t){const{scale:e,defaultSize:n}=this.options;return(t.size||n)*e}_getMacroLineStart(t,e){for(let n=Math.min(e-1,t.length-1);n>=0;n--)if(Sn.test(t[n]))return n+1;return 0}_getMacroLineIndex(t,e){return t.slice(0,e).filter(n=>Sn.test(n)).length}_getIsActiveElement(t,e){const n=this._getInlineEditorElement(e);return!!(n&&(n===t||n.id&&n.id===t.id))}_getControlColor(t){return t.type===s.ElementType.REUSABLE_ITEM?"#1677ff":"#fa8c16"}_getValueColor(t){return t.color||this.options.defaultColor}_getInlineEditorElement(t){const e=this.draw.getElementList()[t.index];return e?.id===t.elementId?e:t.elementId?this.draw.getElementList().find(n=>n.id===t.elementId)||null:e||null}_getInlineEditorPosition(t){return this.draw.getPosition().getPositionList()[t.index]||null}_ensureMacroConfig(t){return t.macroConfig||(t.macroConfig={type:"text"}),t.macroConfig}_getInlineEditorValue(t){return t.type===s.ElementType.REUSABLE_ITEM?t.reusableItemConfig?.value||"":t.macroConfig?.value||""}_setInlineEditorValue(t,e,n){if(t.type===s.ElementType.REUSABLE_ITEM){t.reusableItemConfig?t.reusableItemConfig.value=e:t.reusableItemConfig={value:e};return}const i=this._ensureMacroConfig(t);i.type==="select"?(i.code=n||void 0,i.value=this._getSelectLabelByCode(i,n)):i.value=e}_restoreInlineEditorValue(t,e){if(t.type===s.ElementType.REUSABLE_ITEM){this._setInlineEditorValue(t,e.initialValue),t.underline=e.initialUnderline,t.strikeout=e.initialStrikeout,t.textDecoration=e.initialTextDecoration;return}const n=this._ensureMacroConfig(t);n.value=e.initialValue,e.type==="select"&&(n.code=e.initialCode)}_getSelectLabelByCode(t,e){return e&&t.items?.find(n=>n.code===e)?.value||""}}class kd{draw;position;zone;options;elementList;rowList;positionList;constructor(t,e){this.draw=t,this.position=t.getPosition(),this.zone=t.getZone(),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=Qi(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],l=t;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:l,innerWidth:e,zone:s.EditorZone.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*Ks[t])}getHeight(){if(this.options.header.disabled)return 0;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.save(),t.globalAlpha=this.zone.isHeaderActive()?1:this.options.header.inactiveAlpha;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),l=[];let r=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(r+c.height>i)break;l.push(c),r+=c.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:l,pageNo:e,startIndex:0,innerWidth:n,zone:s.EditorZone.HEADER}),t.restore()}}class Gd{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 xd{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 Jd{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){t.save();const{scale:l,separator:{lineWidth:r,strokeStyle:a}}=this.options;t.lineWidth=(e.lineWidth||r)*l,t.strokeStyle=e.color||a,e.dashArray?.length&&t.setLineDash(e.dashArray);const c=Math.round(i);t.translate(0,t.lineWidth/2),t.beginPath(),t.moveTo(n,c),t.lineTo(n+e.width*l,c),t.stroke(),t.restore()}}class $d{draw;options;i18n;constructor(t){this.draw=t,this.options=t.getOptions(),this.i18n=t.getI18n()}render(t,e,n,i){const{pageBreak:{font:l,fontSize:r,lineDash:a}}=this.options,c=this.i18n.t("pageBreak.displayName"),{scale:d,defaultRowMargin:u}=this.options,h=r*d,R=e.width*d,T=this.draw.getDefaultBasicRowMarginHeight()*u;t.save(),t.font=`${h}px ${l}`;const g=t.measureText(c),f=(R-g.width)/2;t.setLineDash(a),t.translate(0,.5+T),t.beginPath(),t.moveTo(n,i),t.lineTo(n+f,i),t.moveTo(n+f+g.width,i),t.lineTo(n+R,i),t.stroke(),t.fillText(c,n+f,i+g.actualBoundingBoxAscent-h/2),t.restore()}}class zd{draw;options;imageCache;constructor(t){this.draw=t,this.options=t.getOptions(),this.imageCache=new Map}renderText(t,e){const{watermark:{data:n,opacity:i,font:l,size:r,color:a,repeat:c,gap:d,numberType:u},scale:h}=this.options,R=this.draw.getWidth(),T=this.draw.getHeight();t.save(),t.globalAlpha=i,t.font=`${r*h}px ${l}`;let g=n;const f=new RegExp(ro.PAGE_NO);f.test(g)&&(g=Gn.formatNumberPlaceholder(g,e+1,f,u));const C=new RegExp(ro.PAGE_COUNT);C.test(g)&&(g=Gn.formatNumberPlaceholder(g,this.draw.getPageCount(),C,u));const p=t.measureText(g);if(c){const I=this.draw.getPagePixelRatio(),m=document.createElement("canvas"),L=m.getContext("2d"),O=p.width,P=p.actualBoundingBoxAscent+p.actualBoundingBoxDescent,S=Math.sqrt(Math.pow(O,2)+Math.pow(P,2)),y=S+2*d[0]*h,Y=S+2*d[1]*h;m.width=y,m.height=Y,m.style.width=`${y*I}px`,m.style.height=`${Y*I}px`,L.translate(y/2,Y/2),L.rotate(-45*Math.PI/180),L.translate(-y/2,-Y/2),L.font=`${r*h}px ${l}`,L.fillStyle=a,L.fillText(g,(y-O)/2,(Y-P)/2+p.actualBoundingBoxAscent);const b=t.createPattern(m,"repeat");b&&(t.fillStyle=b,t.fillRect(0,0,R,T))}else{const I=R/2,m=T/2;t.fillStyle=a,t.translate(I,m),t.rotate(-45*Math.PI/180),t.fillText(g,-p.width/2,p.actualBoundingBoxAscent-r*h/2)}t.restore()}renderImage(t){const{watermark:{width:e,height:n,data:i,opacity:l,repeat:r,gap:a},scale:c}=this.options;if(!this.imageCache.has(i)){const T=new Image;T.setAttribute("crossOrigin","Anonymous"),T.src=i,T.onload=()=>{this.imageCache.set(i,T),this.draw.render({isCompute:!1,isSubmitHistory:!1})};return}const d=this.draw.getWidth(),u=this.draw.getHeight(),h=e*c,R=n*c;if(t.save(),t.globalAlpha=l,r){const T=this.draw.getPagePixelRatio(),g=document.createElement("canvas"),f=g.getContext("2d"),C=Math.sqrt(Math.pow(h,2)+Math.pow(R,2)),p=C+2*a[0]*c,I=C+2*a[1]*c;g.width=p,g.height=I,g.style.width=`${p*T}px`,g.style.height=`${I*T}px`,f.translate(p/2,I/2),f.rotate(-45*Math.PI/180),f.translate(-p/2,-I/2),f.drawImage(this.imageCache.get(i),(p-h)/2,(I-R)/2,h,R);const m=t.createPattern(g,"repeat");m&&(t.fillStyle=m,t.fillRect(0,0,d,u))}else{const T=d/2,g=u/2;t.translate(T,g),t.rotate(-45*Math.PI/180),t.drawImage(this.imageCache.get(i),-h/2,-R/2,h,R)}t.restore()}render(t,e){this.options.watermark.type===s.WatermarkType.IMAGE?this.renderImage(t):this.renderText(t,e)}}class jd{draw;control;options;highlightList;highlightMatchResult;constructor(t){this.draw=t.getDraw(),this.control=t,this.options=this.draw.getOptions(),this.highlightList=[],this.highlightMatchResult=[]}getControlHighlight(t,e){const{control:{activeBackgroundColor:n,disabledBackgroundColor:i,existValueBackgroundColor:l,noValueBackgroundColor:r,inlineControlBackgroundColor:a}}=this.options,c=t[e],d=this.draw.isPrintLikeMode(),u=this.draw.getMode(),h=u===s.EditorMode.EDIT||u===s.EditorMode.FORM,R=this.control.getActiveControl()?.getElement(),T=this._getControlType(t,e);let g=!1,f=!1,C=!1,p=!1;c.highlight||(g=!d&&!!n&&!!R&&c.controlId===R.controlId&&!this.control.getIsRangeInPostfix()),g||(f=!d&&!!i&&!!c.control?.disabled),f||(C=!d&&!!l&&!!c.controlId&&this.control.getIsExistValueByElementListIndex(t,e)),C||(p=!d&&!!r&&!!c.controlId&&!this.control.getIsExistValueByElementListIndex(t,e));const I=h&&!!a&&(T===s.ControlType.SELECT||T===s.ControlType.DATE);return(g?n:"")||(f?i:"")||(C?l:"")||(p?r:"")||(I?a:"")}getIsInlineControlBackground(t,e){const n=this.draw.getMode(),i=this._getControlType(t,e);return!!((n===s.EditorMode.EDIT||n===s.EditorMode.FORM)&&this.options.control.inlineControlBackgroundColor&&(i===s.ControlType.SELECT||i===s.ControlType.DATE))}_getControlType(t,e){const n=t[e];if(n.control?.type)return n.control.type;if(n.controlId){for(let i=e-1;i>=0;i--){const l=t[i];if(l.controlId!==n.controlId)break;if(l.control?.type)return l.control.type}for(let i=e+1;i<t.length;i++){const l=t[i];if(l.controlId!==n.controlId)break;if(l.control?.type)return l.control.type}}}getHighlightMatchResult(){return this.highlightMatchResult}getHighlightList(){return this.highlightList}setHighlightList(t){this.highlightList=t}computeHighlightList(){const t=this.draw.getSearch(),e=(n,i)=>{let l=0;for(;l<n.length;){const r=n[l];if(l++,r.type===s.ElementType.TABLE){const g=r.trList;for(let f=0;f<g.length;f++){const C=g[f];for(let p=0;p<C.tdList.length;p++){const I=C.tdList[p],m={tableId:r.id,tableIndex:l-1,trIndex:f,tdIndex:p,tdId:I.id};e(I.value,m)}}}const a=r?.control;if(!a)continue;const c=this.highlightList.findIndex(g=>g.id===r.controlId||a.conceptId&&a.conceptId===g.conceptId);if(!~c)continue;const d=l;let u=l;for(;u<n.length&&n[u].controlId===r.controlId;)u++;l=u;const h=n.slice(d,u).map(g=>g.controlComponent===s.ControlComponent.VALUE?g:{value:_}),R=this.highlightList[c],{ruleList:T}=R;for(let g=0;g<T.length;g++){const f=T[g],C=t.getMatchList(f.keyword,h);this.highlightMatchResult.push(...C.map(p=>({...p,...f,...i,index:p.index+d})))}}};this.highlightMatchResult=[],e(this.draw.getOriginalMainElementList())}renderHighlightList(t,e){if(!this.highlightMatchResult?.length)return;const{searchMatchAlpha:n,searchMatchColor:i}=this.options,l=this.draw.getPosition().getOriginalPositionList(),r=this.draw.getOriginalElementList();t.save();for(let a=0;a<this.highlightMatchResult.length;a++){const c=this.highlightMatchResult[a];let d=null;if(c.tableId){const{tableIndex:I,trIndex:m,tdIndex:L,index:O}=c;d=r[I]?.trList[m].tdList[L]?.positionList[O]}else d=l[c.index];if(!d)continue;const{coordinate:{leftTop:u,leftBottom:h,rightTop:R},pageNo:T}=d;if(T!==e)continue;t.fillStyle=c.backgroundColor||i,t.globalAlpha=c.alpha||n;const g=u[0],f=u[1],C=R[0]-u[0],p=h[1]-u[1];t.fillRect(g,f,C,p)}t.restore()}}const Vr={error:{borderColor:"#ff4d4f",backgroundColor:"rgba(255,77,79,0.08)"},warning:{borderColor:"#faad14",backgroundColor:"rgba(250,173,20,0.08)"},warn:{borderColor:"#faad14",backgroundColor:"rgba(250,173,20,0.08)"},info:{borderColor:"#1677ff",backgroundColor:"rgba(22,119,255,0.08)"}},qd="#ff4d4f",tu=5e3,qi=4;class eu{draw;options;marks;underlineTimer;underlineVisible;constructor(t){this.draw=t,this.options=t.getOptions(),this.marks=[],this.underlineTimer=null,this.underlineVisible=!1}setMarks(t){this._clearUnderlineTimer(),this.marks=t.slice(),this.underlineVisible=this.marks.length>0,this.marks.length&&(this.underlineTimer=window.setTimeout(()=>{this.underlineVisible=!1,this.underlineTimer=null,this.draw.render({isSetCursor:!1,isSubmitHistory:!1})},tu))}getMarks(){return this.marks}render(t,e,n,i,l,r,a){if(!this.marks.length||this.draw.isPrintLikeMode())return;const c=this._getRegions(e,n,i,l,r,a);if(c.length){t.save();for(let d=0;d<c.length;d++){const u=c[d],h=this._getStyle(u.mark),R=Math.max(1,this.options.scale),T=u.x-R,g=u.y-R,f=Math.max(1,u.width+R*2),C=Math.max(1,u.height+R*2),p=Math.max(2,this.options.scale*2);if(this.underlineVisible&&h.borderColor&&u.hasUnderline&&(t.lineWidth=p,t.strokeStyle=h.borderColor,t.beginPath(),t.moveTo(u.underlineX,u.underlineY),t.lineTo(u.underlineRight,u.underlineY),t.stroke()),u.drawRequired){this._renderRequiredMark(t,u,T);continue}if(h.borderColor){t.lineWidth=p;const I=Math.min(Math.max(8*this.options.scale,C*.3),C/2),m=T+f,L=g+C;t.beginPath(),u.drawLeft&&(t.moveTo(T+I,g),t.lineTo(T,g),t.lineTo(T,L)),u.drawRight&&(t.moveTo(m-I,L),t.lineTo(m,L),t.lineTo(m,g)),t.stroke()}}t.restore()}}_getRegions(t,e,n,i,l,r){const a=this._getParentMap(t),c=this.marks.map(R=>this._getTargetControlIds(t,R)),d=c.map(R=>this._getTitleTargets(t,R)),u=[];for(let R=0;R<n.length;R++){const T=n[R],g=new Map,f=e[T.startIndex],C=f?Math.min(f.coordinate.leftTop[0],f.coordinate.leftBottom[0])-(T.offsetX||0):0,p=f?C+(r||this.draw.getInnerWidth()):0;for(let I=0;I<T.elementList.length;I++){const m=T.elementList[I],L=T.startIndex+I,O=e[L];if(!O||l===s.EditorZone.MAIN&&O.pageNo!==i)continue;const P=this._getTargetIdsForElement(this._getQualityTargetId(m),c,a);for(let W=0;W<d.length;W++){const K=d[W].get(L);K&&K.forEach(k=>{P.some(B=>B.markIndex===W&&B.controlId===k)||P.push({markIndex:W,controlId:k})})}if(!P.length)continue;const S=O.coordinate.leftTop,y=O.coordinate.rightTop,Y=O.coordinate.leftBottom,b=O.coordinate.rightBottom,M=Math.min(S[0],Y[0]),V=Math.max(y[0],b[0]),N=Math.min(S[1],y[1]),X=Math.max(Y[1],b[1]),D=O.metrics.boundingBoxAscent+O.metrics.boundingBoxDescent,E=N+O.ascent-O.metrics.boundingBoxAscent,U=D>0?E:N,F=D>0?E+D:X,Z=this._isButtonElement(m),Q=f?Math.max(M,Math.min(V,p)):V;for(let W=0;W<P.length;W++){const{markIndex:K,controlId:k}=P[W],B=`${K}:${k}:${T.startIndex}`,H=g.get(B),A={x:M,y:U,right:V,bottom:F};if(H){const v=this._mergeBounds(H,A);H.x=v.x,H.y=v.y,H.width=Math.max(1,v.right-v.x),H.height=Math.max(1,v.bottom-v.y),Z||(H.hasUnderline?(H.underlineX=Math.min(H.underlineX,M),H.underlineY=Math.max(H.underlineY,F+qi),H.underlineRight=Math.max(H.underlineRight,Q)):(H.underlineX=M,H.underlineY=F+qi,H.underlineRight=Q),H.hasUnderline=!0)}else g.set(B,{mark:this.marks[K],targetKey:`${K}:${k}`,x:M,y:U,width:Math.max(1,V-M),height:Math.max(1,F-U),baseline:N+O.ascent,font:m.style||this.draw.getElementFont(m,this.options.scale),underlineX:M,underlineY:F+qi,underlineRight:Q,hasUnderline:!Z,drawLeft:!1,drawRight:!1,drawRequired:!1})}}u.push(...g.values())}const h=new Map;for(let R=0;R<u.length;R++){const T=u[R],g=h.get(T.targetKey)||[];g.push(T),h.set(T.targetKey,g)}return h.forEach(R=>{this._isRequiredMark(R[0].mark)?R[0].drawRequired=!0:(R[0].drawLeft=!0,R[R.length-1].drawRight=!0)}),u}_renderRequiredMark(t,e,n){t.save(),t.font=e.font,t.fillStyle=e.mark.style?.borderColor||qd,t.textBaseline="alphabetic";const i=t.measureText("*").width,l=Math.max(2,this.options.scale*2);t.fillText("*",n-i-l,e.baseline),t.restore()}_clearUnderlineTimer(){this.underlineTimer!==null&&(window.clearTimeout(this.underlineTimer),this.underlineTimer=null)}_mergeBounds(t,e){return{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),right:Math.max(t.x+t.width,e.right),bottom:Math.max(t.y+t.height,e.bottom)}}_getParentMap(t){const e=new Map;for(let n=0;n<t.length;n++){const i=t[n],l=this._getQualityTargetId(i);l&&i.originControlId&&e.set(l,i.originControlId)}return e}_getTitleTargets(t,e){const n=new Map;return e.forEach(i=>{const l=t.findIndex(R=>this._getQualityTargetId(R)===i);if(l<0)return;const r=t[l],a=r.control,c=this._getTitleTextBefore(t,l);if(!c)return;const d=[a?.label,a?.placeholder].concat(this._isMacroElement(r)?[r.label]:[]).filter(Boolean).map(R=>this._normalizeTitleText(R)),u=this._normalizeTitleText(c);if(!d.some(R=>R===u||R.includes(u)||u.includes(R)))return;let h=l-1;for(;h>=0&&this._isTitleValueElement(t[h]);){let R=n.get(h);R||(R=new Set,n.set(h,R)),R.add(i),h--}}),n}_getTitleTextBefore(t,e){const n=t[e-1];if(n?.type===s.ElementType.TITLE)return n.valueList?.map(r=>r.value).join("")||"";if(!this._isTitleValueElement(n))return"";const i=n.titleId;let l=e-1;for(;l>=0&&this._isTitleValueElement(t[l])&&t[l].titleId===i;)l--;return t.slice(l+1,e).map(r=>r.value).join("")}_isTitleValueElement(t){return!!t?.titleId&&!!t.level}_normalizeTitleText(t){return t.replace(/\s/g,"").replace(/[::]+$/,"")}_getTargetControlIds(t,e){const n=new Set,i=e.id?"id":e.conceptId?"conceptId":e.code?"code":null;if(!i)return n;for(let l=0;l<t.length;l++){const r=t[l],a=this._getQualityTargetId(r);if(!a)continue;const c=r.control?.conceptId||r.conceptId,d=r.control?.code||r.macroConfig?.code||r.dictCode;(i==="id"&&a===e.id||i==="conceptId"&&c===e.conceptId||i==="code"&&d===e.code)&&n.add(a)}return n}_getQualityTargetId(t){if(t.controlId)return t.controlId;if(this._isMacroElement(t))return t.id}_isMacroElement(t){return[s.ElementType.MACRO,s.ElementType.CUSTOM_MACRO,s.ElementType.REUSABLE_ITEM].includes(t.type)}_getTargetIdsForElement(t,e,n){if(!t)return[];const i=[];for(let l=0;l<e.length;l++){const r=e[l];let a=t;const c=new Set;for(;a&&!c.has(a);){if(r.has(a)){i.push({markIndex:l,controlId:a});break}c.add(a),a=n.get(a)}}return i}_getStyle(t){return{...Vr[t.type?.toLowerCase()||"error"]||Vr.error,...t.style}}_isRequiredMark(t){return t.required===!0||["required","required-empty","required_empty"].includes(t.type?.toLowerCase()||"")}_isButtonElement(t){return t.type===s.ElementType.BUTTON||t.control?.type===s.ControlType.BUTTON&&!t.control.buttonText}}class nu{borderRect;options;constructor(t){this.borderRect=this.clearBorderInfo(),this.options=t.getOptions()}clearBorderInfo(){return this.borderRect={x:0,y:0,width:0,height:0},this.borderRect}recordBorderInfo(t,e,n,i){!this.borderRect.width&&(this.borderRect.x=t,this.borderRect.y=e,this.borderRect.height=i),this.borderRect.width+=n}render(t){if(!this.borderRect.width)return;const{scale:e,control:{borderWidth:n,borderColor:i}}=this.options,{x:l,y:r,width:a,height:c}=this.borderRect;t.save(),t.translate(0,1*e),t.lineWidth=n*e,t.strokeStyle=i,t.beginPath(),t.rect(l,r,a,c),t.stroke(),t.restore(),this.clearBorderInfo()}}class co{draw;element;control;isPopup;selectDom;options;VALUE_DELIMITER=",";DEFAULT_MULTI_SELECT_DELIMITER=",";constructor(t,e){const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1,this.selectDom=null}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getCodes(){return this.element?.control?.code?this.element.control.code.split(","):[]}getText(t){if(!this.element?.control)return null;const e=this.element.control;if(!e.valueSets?.length)return null;const n=e?.multiSelectDelimiter||this.DEFAULT_MULTI_SELECT_DELIMITER,i=e.valueSets,l=[];return t.forEach(r=>{const a=i.find(c=>c.code===r);a&&!Gs(a.value)&&l.push(a.value)}),l.join(n)||null}getValue(t={}){const{elementList:e,range:n}=this.control.mergeControl(t),{startIndex:i}=n,l=e[i],r=[];let a=i;for(;a>=0;){const d=e[a];if(!d||d.controlId!==l.controlId||d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT)break;d.controlComponent===s.ControlComponent.VALUE&&r.unshift(d),a--}let c=i+1;for(;c<e.length;){const d=e[c];if(d.controlId!==l.controlId||d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POST_TEXT)break;d.controlComponent===s.ControlComponent.VALUE&&r.push(d),c++}return r}setValue(t,e={},n={}){if(!this.element.control?.selectExclusiveOptions?.inputAble||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:r,endIndex:a}=l,c=this.control.getDraw();r!==a?c.spliceElementList(i,r+1,a-r):this.control.removePlaceholder(r,{elementList:i});const d=i[r],u=d.type&&!Le.includes(d.type)||d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT?xt(d,["control","controlId",...ue]):Ee(d,["type"]),h=l.startIndex+1;for(let R=0;R<t.length;R++){const T={...u,...t[R],controlComponent:s.ControlComponent.VALUE};le(i,[T],r,{editorOptions:this.options}),c.spliceElementList(i,h+R,0,[T])}return h+t.length-1}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:l}=n,r=e[i],a=e[l],c=this.element.control?.selectExclusiveOptions?.inputAble;if(t.key===s.KeyMap.Backspace)return i!==l?c?(this.draw.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect():r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT||a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT||r.controlComponent===s.ControlComponent.PLACEHOLDER?this.control.removeControl(i):c?(this.draw.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1):this.clearSelect();if(t.key===s.KeyMap.Delete){if(i!==l)return c?(this.draw.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect();{const d=e[l+1];return(r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT)&&d.controlComponent===s.ControlComponent.PLACEHOLDER||d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POST_TEXT||r.controlComponent===s.ControlComponent.PLACEHOLDER?this.control.removeControl(i):c?(this.draw.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect()}}return l}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();return t===e?t:this.clearSelect()}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const l=t.elementList||this.control.getElementList(),{startIndex:r}=t.range||this.control.getRange(),a=l[r];let c=-1,d=-1,u=r;for(;u>0;){const T=l[u];if(T.controlId!==a.controlId||T.controlComponent===s.ControlComponent.PREFIX||T.controlComponent===s.ControlComponent.PRE_TEXT){c=u;break}u--}let h=r+1;for(;h<l.length;){const T=l[h];if(T.controlId!==a.controlId||T.controlComponent===s.ControlComponent.POSTFIX||T.controlComponent===s.ControlComponent.POST_TEXT){d=h-1;break}h++}return!~c||!~d?-1:(this.control.getDraw().spliceElementList(l,c+1,d-c,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(u,t),this.control.setControlProperties({code:void 0},{elementList:l,range:{startIndex:u,endIndex:u}}),u)}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const i=e.elementList||this.control.getElementList(),l=e.range||this.control.getRange(),r=this.element.control,a=t?.split(this.VALUE_DELIMITER)||[],c=r.code,d=r.code?.split(this.VALUE_DELIMITER)||[],u=r.isMultiSelect;if(!u&&t===c||u&&ks(d,a)){this.control.repaintControl({curIndex:l.startIndex,isCompute:!1,isSubmitHistory:!1}),this.destroy();return}const h=r.valueSets;if(!Array.isArray(h)||!h.length)return;const R=this.getText(a);if(!R){if(c){const L=this.clearSelect(e,{isIgnoreDeletedRule:n.isIgnoreDeletedRule});~L&&(this.control.repaintControl({curIndex:L}),this.control.emitControlContentChange({controlValue:[]}))}return}const T=this.getValue(e)[0],g=T?xt(T,Ne):xt(i[l.startIndex],ue),f=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~f)return;c||this.control.removePlaceholder(f,e);const C=Ee(i[f],Ne),p=f+1,I=Nt(R),m=this.control.getDraw();for(let L=0;L<I.length;L++){const O={...g,...C,type:s.ElementType.TEXT,value:I[L],controlComponent:s.ControlComponent.VALUE};(O.color===this.options.control.bracketColor||O.color===this.options.control.placeholderColor)&&(O.color=this.options.defaultColor),le(i,[O],f,{editorOptions:this.options}),m.spliceElementList(i,p+L,0,[O])}if(this.control.setControlProperties({code:t},{elementList:i,range:{startIndex:f,endIndex:f}}),!e.range){const L=p+I.length-1;this.control.repaintControl({curIndex:L}),this.control.emitControlContentChange({context:e}),u||this.destroy()}}_createSelectPopupDom(){const t=this.element.control,e=t.valueSets;if(!Array.isArray(e)||!e.length)return;const n=this.control.getPosition();if(!n)return;const i=document.createElement("div");i.classList.add(`${st}-select-control-popup`),i.setAttribute(ve,s.EditorComponent.POPUP);const l=g=>{g.stopPropagation()};i.addEventListener("mousedown",l),i.addEventListener("mouseup",l),i.addEventListener("click",l),i.addEventListener("keydown",l),i.addEventListener("input",l);const r=document.createElement("input");r.type="search",r.classList.add(`${st}-select-control-search`),r.placeholder=this.draw.getI18n().t("select.search")||"搜索选项",r.setAttribute("aria-label",r.placeholder);const a=document.createElement("ul");a.setAttribute("role","listbox");const c=(g="")=>{for(;a.firstChild;)a.removeChild(a.firstChild);const f=g.trim().toLocaleLowerCase(),C=e.filter(O=>f?[O.value,O.code].some(P=>P.toLocaleLowerCase().includes(f)):!0),p=this.getCodes(),I=C.findIndex(O=>p.includes(O.code)),m=I>=0?I:0;let L=null;for(let O=0;O<C.length;O++){const P=C[O],S=document.createElement("li");S.setAttribute("role","option"),p.includes(P.code)&&(S.classList.add("active"),L=S),O===m&&(S.classList.add("keyboard-active"),S.setAttribute("aria-selected","true")),S.onclick=()=>{const y=this.getCodes(),Y=y.findIndex(b=>b===P.code);t.isMultiSelect?~Y?y.splice(Y,1):y.push(P.code):~Y?y.length=0:y.splice(0,y.length,P.code),this.setSelect(y.join(this.VALUE_DELIMITER)),t.isMultiSelect&&c(r.value)},S.append(document.createTextNode(P.value)),a.append(S)}if(!C.length){const O=document.createElement("li");O.classList.add(`${st}-select-control-empty`),O.textContent=this.draw.getI18n().t("select.empty")||"无匹配项",a.append(O)}L&&Mi(i,L)};r.addEventListener("input",()=>{c(r.value)}),r.addEventListener("keydown",g=>{if(g.key==="ArrowDown"||g.key==="ArrowUp"){g.preventDefault();const f=Array.from(a.querySelectorAll("li:not(.ce-select-control-empty)"));if(!f.length)return;const C=f.findIndex(m=>m.classList.contains("keyboard-active")),p=g.key==="ArrowDown"?1:-1,I=C<0?p>0?0:f.length-1:(C+p+f.length)%f.length;f.forEach((m,L)=>{const O=L===I;m.classList.toggle("keyboard-active",O),m.setAttribute("aria-selected",String(O))}),Mi(i,f[I]);return}if(g.key==="Enter"){g.preventDefault(),a.querySelector("li.keyboard-active")?.click();return}g.key==="Escape"&&this.destroy()}),i.append(r,a);const{coordinate:{leftTop:[d,u]},lineHeight:h}=n,R=this.control.getPreY();i.style.left=`${d}px`,i.style.top=`${u+R+h}px`,this.control.getContainer().append(i),this.selectDom=i,c(),Pi(()=>{window.setTimeout(()=>{this.selectDom===i&&i.isConnected&&r.focus()})})}awake(){if(this.isPopup||this.control.getIsDisabledControl())return;const{startIndex:t}=this.control.getRange(),n=this.control.getElementList()[t];!n||n.controlId!==this.element.controlId||n.controlComponent===s.ControlComponent.POSTFIX||n.controlComponent===s.ControlComponent.POSTTEXTFIX||n.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||n.controlComponent===s.ControlComponent.POST_TEXT||(this._createSelectPopupDom(),this.isPopup=!0)}destroy(){this.isPopup&&(this.selectDom?.remove(),this.isPopup=!1)}}var Wr;function lt(){return Wr.apply(null,arguments)}function ou(o){Wr=o}function Ve(o){return o instanceof Array||Object.prototype.toString.call(o)==="[object Array]"}function Dn(o){return o!=null&&Object.prototype.toString.call(o)==="[object Object]"}function Ht(o,t){return Object.prototype.hasOwnProperty.call(o,t)}function ts(o){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(o).length===0;var t;for(t in o)if(Ht(o,t))return!1;return!0}function pe(o){return o===void 0}function qe(o){return typeof o=="number"||Object.prototype.toString.call(o)==="[object Number]"}function uo(o){return o instanceof Date||Object.prototype.toString.call(o)==="[object Date]"}function Ur(o,t){var e=[],n,i=o.length;for(n=0;n<i;++n)e.push(t(o[n],n));return e}function gn(o,t){for(var e in t)Ht(t,e)&&(o[e]=t[e]);return Ht(t,"toString")&&(o.toString=t.toString),Ht(t,"valueOf")&&(o.valueOf=t.valueOf),o}function Be(o,t,e,n){return al(o,t,e,n,!0).utc()}function iu(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Xt(o){return o._pf==null&&(o._pf=iu()),o._pf}var es;Array.prototype.some?es=Array.prototype.some:es=function(o){var t=Object(this),e=t.length>>>0,n;for(n=0;n<e;n++)if(n in t&&o.call(this,t[n],n,t))return!0;return!1};function ns(o){var t=null,e=!1,n=o._d&&!isNaN(o._d.getTime());if(n&&(t=Xt(o),e=es.call(t.parsedDateParts,function(i){return i!=null}),n=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&e),o._strict&&(n=n&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(o))o._isValid=n;else return n;return o._isValid}function Ao(o){var t=Be(NaN);return o!=null?gn(Xt(t),o):Xt(t).userInvalidated=!0,t}var Yr=lt.momentProperties=[],os=!1;function is(o,t){var e,n,i,l=Yr.length;if(pe(t._isAMomentObject)||(o._isAMomentObject=t._isAMomentObject),pe(t._i)||(o._i=t._i),pe(t._f)||(o._f=t._f),pe(t._l)||(o._l=t._l),pe(t._strict)||(o._strict=t._strict),pe(t._tzm)||(o._tzm=t._tzm),pe(t._isUTC)||(o._isUTC=t._isUTC),pe(t._offset)||(o._offset=t._offset),pe(t._pf)||(o._pf=Xt(t)),pe(t._locale)||(o._locale=t._locale),l>0)for(e=0;e<l;e++)n=Yr[e],i=t[n],pe(i)||(o[n]=i);return o}function ho(o){is(this,o),this._d=new Date(o._d!=null?o._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),os===!1&&(os=!0,lt.updateOffset(this),os=!1)}function We(o){return o instanceof ho||o!=null&&o._isAMomentObject!=null}function wr(o){lt.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+o)}function Fe(o,t){var e=!0;return gn(function(){if(lt.deprecationHandler!=null&&lt.deprecationHandler(null,o),e){var n=[],i,l,r,a=arguments.length;for(l=0;l<a;l++){if(i="",typeof arguments[l]=="object"){i+=`
122
122
  [`+l+"] ";for(r in arguments[0])Ht(arguments[0],r)&&(i+=r+": "+arguments[0][r]+", ");i=i.slice(0,-2)}else i=arguments[l];n.push(i)}wr(o+`
123
123
  Arguments: `+Array.prototype.slice.call(n).join("")+`
124
- `+new Error().stack),e=!1}return t.apply(this,arguments)},t)}var vr={};function Zr(o,t){lt.deprecationHandler!=null&&lt.deprecationHandler(o,t),vr[o]||(wr(t),vr[o]=!0)}lt.suppressDeprecationWarnings=!1,lt.deprecationHandler=null;function ke(o){return typeof Function<"u"&&o instanceof Function||Object.prototype.toString.call(o)==="[object Function]"}function su(o){var t,e;for(e in o)Ht(o,e)&&(t=o[e],ke(t)?this[e]=t:this["_"+e]=t);this._config=o,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function ss(o,t){var e=gn({},o),n;for(n in t)Ht(t,n)&&(Dn(o[n])&&Dn(t[n])?(e[n]={},gn(e[n],o[n]),gn(e[n],t[n])):t[n]!=null?e[n]=t[n]:delete e[n]);for(n in o)Ht(o,n)&&!Ht(t,n)&&Dn(o[n])&&(e[n]=gn({},e[n]));return e}function rs(o){o!=null&&this.set(o)}var ls;Object.keys?ls=Object.keys:ls=function(o){var t,e=[];for(t in o)Ht(o,t)&&e.push(t);return e};var ru={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function lu(o,t,e){var n=this._calendar[o]||this._calendar.sameElse;return ke(n)?n.call(t,e):n}function Ge(o,t,e){var n=""+Math.abs(o),i=t-n.length,l=o>=0;return(l?e?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var as=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ao=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,cs={},Gn={};function mt(o,t,e,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),o&&(Gn[o]=i),t&&(Gn[t[0]]=function(){return Ge(i.apply(this,arguments),t[1],t[2])}),e&&(Gn[e]=function(){return this.localeData().ordinal(i.apply(this,arguments),o)})}function au(o){return o.match(/\[[\s\S]/)?o.replace(/^\[|\]$/g,""):o.replace(/\\/g,"")}function cu(o){var t=o.match(as),e,n;for(e=0,n=t.length;e<n;e++)Gn[t[e]]?t[e]=Gn[t[e]]:t[e]=au(t[e]);return function(i){var l="",r;for(r=0;r<n;r++)l+=ke(t[r])?t[r].call(i,o):t[r];return l}}function _o(o,t){return o.isValid()?(t=Qr(t,o.localeData()),cs[t]=cs[t]||cu(t),cs[t](o)):o.localeData().invalidDate()}function Qr(o,t){var e=5;function n(i){return t.longDateFormat(i)||i}for(Ao.lastIndex=0;e>=0&&Ao.test(o);)o=o.replace(Ao,n),Ao.lastIndex=0,e-=1;return o}var du={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function uu(o){var t=this._longDateFormat[o],e=this._longDateFormat[o.toUpperCase()];return t||!e?t:(this._longDateFormat[o]=e.match(as).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[o])}var hu="Invalid date";function Ru(){return this._invalidDate}var gu="%d",Tu=/\d{1,2}/;function fu(o){return this._ordinal.replace("%d",o)}var mu={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Cu(o,t,e,n){var i=this._relativeTime[e];return ke(i)?i(o,t,e,n):i.replace(/%d/i,o)}function pu(o,t){var e=this._relativeTime[o>0?"future":"past"];return ke(e)?e(t):e.replace(/%s/i,t)}var Kr={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Xe(o){return typeof o=="string"?Kr[o]||Kr[o.toLowerCase()]:void 0}function ds(o){var t={},e,n;for(n in o)Ht(o,n)&&(e=Xe(n),e&&(t[e]=o[n]));return t}var Iu={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Eu(o){var t=[],e;for(e in o)Ht(o,e)&&t.push({unit:e,priority:Iu[e]});return t.sort(function(n,i){return n.priority-i.priority}),t}var Hr=/\d/,Pe=/\d\d/,Ar=/\d{3}/,us=/\d{4}/,Bo=/[+-]?\d{6}/,oe=/\d\d?/,_r=/\d\d\d\d?/,Br=/\d\d\d\d\d\d?/,ko=/\d{1,3}/,hs=/\d{1,4}/,Go=/[+-]?\d{1,6}/,xn=/\d+/,xo=/[+-]?\d+/,Lu=/Z|[+-]\d\d:?\d\d/gi,Jo=/Z|[+-]\d\d(?::?\d\d)?/gi,Pu=/[+-]?\d+(\.\d{1,3})?/,Ro=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Jn=/^[1-9]\d?/,Rs=/^([1-9]\d|\d)/,$o;$o={};function dt(o,t,e){$o[o]=ke(t)?t:function(n,i){return n&&e?e:t}}function Mu(o,t){return Ht($o,o)?$o[o](t._strict,t._locale):new RegExp(Ou(o))}function Ou(o){return tn(o.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,l){return e||n||i||l}))}function tn(o){return o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ye(o){return o<0?Math.ceil(o)||0:Math.floor(o)}function Yt(o){var t=+o,e=0;return t!==0&&isFinite(t)&&(e=ye(t)),e}var gs={};function Jt(o,t){var e,n=t,i;for(typeof o=="string"&&(o=[o]),qe(t)&&(n=function(l,r){r[t]=Yt(l)}),i=o.length,e=0;e<i;e++)gs[o[e]]=n}function go(o,t){Jt(o,function(e,n,i,l){i._w=i._w||{},t(e,i._w,i,l)})}function Su(o,t,e){t!=null&&Ht(gs,o)&&gs[o](t,e._a,e,o)}function zo(o){return o%4===0&&o%100!==0||o%400===0}var fe=0,en=1,xe=2,he=3,Ue=4,nn=5,Fn=6,Du=7,Fu=8;mt("Y",0,0,function(){var o=this.year();return o<=9999?Ge(o,4):"+"+o}),mt(0,["YY",2],0,function(){return this.year()%100}),mt(0,["YYYY",4],0,"year"),mt(0,["YYYYY",5],0,"year"),mt(0,["YYYYYY",6,!0],0,"year"),dt("Y",xo),dt("YY",oe,Pe),dt("YYYY",hs,us),dt("YYYYY",Go,Bo),dt("YYYYYY",Go,Bo),Jt(["YYYYY","YYYYYY"],fe),Jt("YYYY",function(o,t){t[fe]=o.length===2?lt.parseTwoDigitYear(o):Yt(o)}),Jt("YY",function(o,t){t[fe]=lt.parseTwoDigitYear(o)}),Jt("Y",function(o,t){t[fe]=parseInt(o,10)});function To(o){return zo(o)?366:365}lt.parseTwoDigitYear=function(o){return Yt(o)+(Yt(o)>68?1900:2e3)};var kr=$n("FullYear",!0);function Xu(){return zo(this.year())}function $n(o,t){return function(e){return e!=null?(Gr(this,o,e),lt.updateOffset(this,t),this):fo(this,o)}}function fo(o,t){if(!o.isValid())return NaN;var e=o._d,n=o._isUTC;switch(t){case"Milliseconds":return n?e.getUTCMilliseconds():e.getMilliseconds();case"Seconds":return n?e.getUTCSeconds():e.getSeconds();case"Minutes":return n?e.getUTCMinutes():e.getMinutes();case"Hours":return n?e.getUTCHours():e.getHours();case"Date":return n?e.getUTCDate():e.getDate();case"Day":return n?e.getUTCDay():e.getDay();case"Month":return n?e.getUTCMonth():e.getMonth();case"FullYear":return n?e.getUTCFullYear():e.getFullYear();default:return NaN}}function Gr(o,t,e){var n,i,l,r,a;if(!(!o.isValid()||isNaN(e))){switch(n=o._d,i=o._isUTC,t){case"Milliseconds":return void(i?n.setUTCMilliseconds(e):n.setMilliseconds(e));case"Seconds":return void(i?n.setUTCSeconds(e):n.setSeconds(e));case"Minutes":return void(i?n.setUTCMinutes(e):n.setMinutes(e));case"Hours":return void(i?n.setUTCHours(e):n.setHours(e));case"Date":return void(i?n.setUTCDate(e):n.setDate(e));case"FullYear":break;default:return}l=e,r=o.month(),a=o.date(),a=a===29&&r===1&&!zo(l)?28:a,i?n.setUTCFullYear(l,r,a):n.setFullYear(l,r,a)}}function yu(o){return o=Xe(o),ke(this[o])?this[o]():this}function Nu(o,t){if(typeof o=="object"){o=ds(o);var e=Eu(o),n,i=e.length;for(n=0;n<i;n++)this[e[n].unit](o[e[n].unit])}else if(o=Xe(o),ke(this[o]))return this[o](t);return this}function bu(o,t){return(o%t+t)%t}var de;Array.prototype.indexOf?de=Array.prototype.indexOf:de=function(o){var t;for(t=0;t<this.length;++t)if(this[t]===o)return t;return-1};function Ts(o,t){if(isNaN(o)||isNaN(t))return NaN;var e=bu(t,12);return o+=(t-e)/12,e===1?zo(o)?29:28:31-e%7%2}mt("M",["MM",2],"Mo",function(){return this.month()+1}),mt("MMM",0,0,function(o){return this.localeData().monthsShort(this,o)}),mt("MMMM",0,0,function(o){return this.localeData().months(this,o)}),dt("M",oe,Jn),dt("MM",oe,Pe),dt("MMM",function(o,t){return t.monthsShortRegex(o)}),dt("MMMM",function(o,t){return t.monthsRegex(o)}),Jt(["M","MM"],function(o,t){t[en]=Yt(o)-1}),Jt(["MMM","MMMM"],function(o,t,e,n){var i=e._locale.monthsParse(o,n,e._strict);i!=null?t[en]=i:Xt(e).invalidMonth=o});var Vu="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),xr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Jr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Wu=Ro,Uu=Ro;function Yu(o,t){return o?Ve(this._months)?this._months[o.month()]:this._months[(this._months.isFormat||Jr).test(t)?"format":"standalone"][o.month()]:Ve(this._months)?this._months:this._months.standalone}function wu(o,t){return o?Ve(this._monthsShort)?this._monthsShort[o.month()]:this._monthsShort[Jr.test(t)?"format":"standalone"][o.month()]:Ve(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function vu(o,t,e){var n,i,l,r=o.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)l=Be([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(l,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(l,"").toLocaleLowerCase();return e?t==="MMM"?(i=de.call(this._shortMonthsParse,r),i!==-1?i:null):(i=de.call(this._longMonthsParse,r),i!==-1?i:null):t==="MMM"?(i=de.call(this._shortMonthsParse,r),i!==-1?i:(i=de.call(this._longMonthsParse,r),i!==-1?i:null)):(i=de.call(this._longMonthsParse,r),i!==-1?i:(i=de.call(this._shortMonthsParse,r),i!==-1?i:null))}function Zu(o,t,e){var n,i,l;if(this._monthsParseExact)return vu.call(this,o,t,e);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=Be([2e3,n]),e&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!e&&!this._monthsParse[n]&&(l="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(l.replace(".",""),"i")),e&&t==="MMMM"&&this._longMonthsParse[n].test(o))return n;if(e&&t==="MMM"&&this._shortMonthsParse[n].test(o))return n;if(!e&&this._monthsParse[n].test(o))return n}}function $r(o,t){if(!o.isValid())return o;if(typeof t=="string"){if(/^\d+$/.test(t))t=Yt(t);else if(t=o.localeData().monthsParse(t),!qe(t))return o}var e=t,n=o.date();return n=n<29?n:Math.min(n,Ts(o.year(),e)),o._isUTC?o._d.setUTCMonth(e,n):o._d.setMonth(e,n),o}function zr(o){return o!=null?($r(this,o),lt.updateOffset(this,!0),this):fo(this,"Month")}function Qu(){return Ts(this.year(),this.month())}function Ku(o){return this._monthsParseExact?(Ht(this,"_monthsRegex")||jr.call(this),o?this._monthsShortStrictRegex:this._monthsShortRegex):(Ht(this,"_monthsShortRegex")||(this._monthsShortRegex=Wu),this._monthsShortStrictRegex&&o?this._monthsShortStrictRegex:this._monthsShortRegex)}function Hu(o){return this._monthsParseExact?(Ht(this,"_monthsRegex")||jr.call(this),o?this._monthsStrictRegex:this._monthsRegex):(Ht(this,"_monthsRegex")||(this._monthsRegex=Uu),this._monthsStrictRegex&&o?this._monthsStrictRegex:this._monthsRegex)}function jr(){function o(c,d){return d.length-c.length}var t=[],e=[],n=[],i,l,r,a;for(i=0;i<12;i++)l=Be([2e3,i]),r=tn(this.monthsShort(l,"")),a=tn(this.months(l,"")),t.push(r),e.push(a),n.push(a),n.push(r);t.sort(o),e.sort(o),n.sort(o),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Au(o,t,e,n,i,l,r){var a;return o<100&&o>=0?(a=new Date(o+400,t,e,n,i,l,r),isFinite(a.getFullYear())&&a.setFullYear(o)):a=new Date(o,t,e,n,i,l,r),a}function mo(o){var t,e;return o<100&&o>=0?(e=Array.prototype.slice.call(arguments),e[0]=o+400,t=new Date(Date.UTC.apply(null,e)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(o)):t=new Date(Date.UTC.apply(null,arguments)),t}function jo(o,t,e){var n=7+t-e,i=(7+mo(o,0,n).getUTCDay()-t)%7;return-i+n-1}function qr(o,t,e,n,i){var l=(7+e-n)%7,r=jo(o,n,i),a=1+7*(t-1)+l+r,c,d;return a<=0?(c=o-1,d=To(c)+a):a>To(o)?(c=o+1,d=a-To(o)):(c=o,d=a),{year:c,dayOfYear:d}}function Co(o,t,e){var n=jo(o.year(),t,e),i=Math.floor((o.dayOfYear()-n-1)/7)+1,l,r;return i<1?(r=o.year()-1,l=i+on(r,t,e)):i>on(o.year(),t,e)?(l=i-on(o.year(),t,e),r=o.year()+1):(r=o.year(),l=i),{week:l,year:r}}function on(o,t,e){var n=jo(o,t,e),i=jo(o+1,t,e);return(To(o)-n+i)/7}mt("w",["ww",2],"wo","week"),mt("W",["WW",2],"Wo","isoWeek"),dt("w",oe,Jn),dt("ww",oe,Pe),dt("W",oe,Jn),dt("WW",oe,Pe),go(["w","ww","W","WW"],function(o,t,e,n){t[n.substr(0,1)]=Yt(o)});function _u(o){return Co(o,this._week.dow,this._week.doy).week}var Bu={dow:0,doy:6};function ku(){return this._week.dow}function Gu(){return this._week.doy}function xu(o){var t=this.localeData().week(this);return o==null?t:this.add((o-t)*7,"d")}function Ju(o){var t=Co(this,1,4).week;return o==null?t:this.add((o-t)*7,"d")}mt("d",0,"do","day"),mt("dd",0,0,function(o){return this.localeData().weekdaysMin(this,o)}),mt("ddd",0,0,function(o){return this.localeData().weekdaysShort(this,o)}),mt("dddd",0,0,function(o){return this.localeData().weekdays(this,o)}),mt("e",0,0,"weekday"),mt("E",0,0,"isoWeekday"),dt("d",oe),dt("e",oe),dt("E",oe),dt("dd",function(o,t){return t.weekdaysMinRegex(o)}),dt("ddd",function(o,t){return t.weekdaysShortRegex(o)}),dt("dddd",function(o,t){return t.weekdaysRegex(o)}),go(["dd","ddd","dddd"],function(o,t,e,n){var i=e._locale.weekdaysParse(o,n,e._strict);i!=null?t.d=i:Xt(e).invalidWeekday=o}),go(["d","e","E"],function(o,t,e,n){t[n]=Yt(o)});function $u(o,t){return typeof o!="string"?o:isNaN(o)?(o=t.weekdaysParse(o),typeof o=="number"?o:null):parseInt(o,10)}function zu(o,t){return typeof o=="string"?t.weekdaysParse(o)%7||7:isNaN(o)?null:o}function fs(o,t){return o.slice(t,7).concat(o.slice(0,t))}var ju="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),tl="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),qu="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),th=Ro,eh=Ro,nh=Ro;function oh(o,t){var e=Ve(this._weekdays)?this._weekdays:this._weekdays[o&&o!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return o===!0?fs(e,this._week.dow):o?e[o.day()]:e}function ih(o){return o===!0?fs(this._weekdaysShort,this._week.dow):o?this._weekdaysShort[o.day()]:this._weekdaysShort}function sh(o){return o===!0?fs(this._weekdaysMin,this._week.dow):o?this._weekdaysMin[o.day()]:this._weekdaysMin}function rh(o,t,e){var n,i,l,r=o.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)l=Be([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(l,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(l,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(l,"").toLocaleLowerCase();return e?t==="dddd"?(i=de.call(this._weekdaysParse,r),i!==-1?i:null):t==="ddd"?(i=de.call(this._shortWeekdaysParse,r),i!==-1?i:null):(i=de.call(this._minWeekdaysParse,r),i!==-1?i:null):t==="dddd"?(i=de.call(this._weekdaysParse,r),i!==-1||(i=de.call(this._shortWeekdaysParse,r),i!==-1)?i:(i=de.call(this._minWeekdaysParse,r),i!==-1?i:null)):t==="ddd"?(i=de.call(this._shortWeekdaysParse,r),i!==-1||(i=de.call(this._weekdaysParse,r),i!==-1)?i:(i=de.call(this._minWeekdaysParse,r),i!==-1?i:null)):(i=de.call(this._minWeekdaysParse,r),i!==-1||(i=de.call(this._weekdaysParse,r),i!==-1)?i:(i=de.call(this._shortWeekdaysParse,r),i!==-1?i:null))}function lh(o,t,e){var n,i,l;if(this._weekdaysParseExact)return rh.call(this,o,t,e);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=Be([2e3,1]).day(n),e&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(l="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(l.replace(".",""),"i")),e&&t==="dddd"&&this._fullWeekdaysParse[n].test(o))return n;if(e&&t==="ddd"&&this._shortWeekdaysParse[n].test(o))return n;if(e&&t==="dd"&&this._minWeekdaysParse[n].test(o))return n;if(!e&&this._weekdaysParse[n].test(o))return n}}function ah(o){if(!this.isValid())return o!=null?this:NaN;var t=fo(this,"Day");return o!=null?(o=$u(o,this.localeData()),this.add(o-t,"d")):t}function ch(o){if(!this.isValid())return o!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return o==null?t:this.add(o-t,"d")}function dh(o){if(!this.isValid())return o!=null?this:NaN;if(o!=null){var t=zu(o,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function uh(o){return this._weekdaysParseExact?(Ht(this,"_weekdaysRegex")||ms.call(this),o?this._weekdaysStrictRegex:this._weekdaysRegex):(Ht(this,"_weekdaysRegex")||(this._weekdaysRegex=th),this._weekdaysStrictRegex&&o?this._weekdaysStrictRegex:this._weekdaysRegex)}function hh(o){return this._weekdaysParseExact?(Ht(this,"_weekdaysRegex")||ms.call(this),o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Ht(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=eh),this._weekdaysShortStrictRegex&&o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Rh(o){return this._weekdaysParseExact?(Ht(this,"_weekdaysRegex")||ms.call(this),o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Ht(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nh),this._weekdaysMinStrictRegex&&o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ms(){function o(u,h){return h.length-u.length}var t=[],e=[],n=[],i=[],l,r,a,c,d;for(l=0;l<7;l++)r=Be([2e3,1]).day(l),a=tn(this.weekdaysMin(r,"")),c=tn(this.weekdaysShort(r,"")),d=tn(this.weekdays(r,"")),t.push(a),e.push(c),n.push(d),i.push(a),i.push(c),i.push(d);t.sort(o),e.sort(o),n.sort(o),i.sort(o),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Cs(){return this.hours()%12||12}function gh(){return this.hours()||24}mt("H",["HH",2],0,"hour"),mt("h",["hh",2],0,Cs),mt("k",["kk",2],0,gh),mt("hmm",0,0,function(){return""+Cs.apply(this)+Ge(this.minutes(),2)}),mt("hmmss",0,0,function(){return""+Cs.apply(this)+Ge(this.minutes(),2)+Ge(this.seconds(),2)}),mt("Hmm",0,0,function(){return""+this.hours()+Ge(this.minutes(),2)}),mt("Hmmss",0,0,function(){return""+this.hours()+Ge(this.minutes(),2)+Ge(this.seconds(),2)});function el(o,t){mt(o,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}el("a",!0),el("A",!1);function nl(o,t){return t._meridiemParse}dt("a",nl),dt("A",nl),dt("H",oe,Rs),dt("h",oe,Jn),dt("k",oe,Jn),dt("HH",oe,Pe),dt("hh",oe,Pe),dt("kk",oe,Pe),dt("hmm",_r),dt("hmmss",Br),dt("Hmm",_r),dt("Hmmss",Br),Jt(["H","HH"],he),Jt(["k","kk"],function(o,t,e){var n=Yt(o);t[he]=n===24?0:n}),Jt(["a","A"],function(o,t,e){e._isPm=e._locale.isPM(o),e._meridiem=o}),Jt(["h","hh"],function(o,t,e){t[he]=Yt(o),Xt(e).bigHour=!0}),Jt("hmm",function(o,t,e){var n=o.length-2;t[he]=Yt(o.substr(0,n)),t[Ue]=Yt(o.substr(n)),Xt(e).bigHour=!0}),Jt("hmmss",function(o,t,e){var n=o.length-4,i=o.length-2;t[he]=Yt(o.substr(0,n)),t[Ue]=Yt(o.substr(n,2)),t[nn]=Yt(o.substr(i)),Xt(e).bigHour=!0}),Jt("Hmm",function(o,t,e){var n=o.length-2;t[he]=Yt(o.substr(0,n)),t[Ue]=Yt(o.substr(n))}),Jt("Hmmss",function(o,t,e){var n=o.length-4,i=o.length-2;t[he]=Yt(o.substr(0,n)),t[Ue]=Yt(o.substr(n,2)),t[nn]=Yt(o.substr(i))});function Th(o){return(o+"").toLowerCase().charAt(0)==="p"}var fh=/[ap]\.?m?\.?/i,mh=$n("Hours",!0);function Ch(o,t,e){return o>11?e?"pm":"PM":e?"am":"AM"}var ol={calendar:ru,longDateFormat:du,invalidDate:hu,ordinal:gu,dayOfMonthOrdinalParse:Tu,relativeTime:mu,months:Vu,monthsShort:xr,week:Bu,weekdays:ju,weekdaysMin:qu,weekdaysShort:tl,meridiemParse:fh},se={},po={},Io;function ph(o,t){var e,n=Math.min(o.length,t.length);for(e=0;e<n;e+=1)if(o[e]!==t[e])return e;return n}function il(o){return o&&o.toLowerCase().replace("_","-")}function Ih(o){for(var t=0,e,n,i,l;t<o.length;){for(l=il(o[t]).split("-"),e=l.length,n=il(o[t+1]),n=n?n.split("-"):null;e>0;){if(i=qo(l.slice(0,e).join("-")),i)return i;if(n&&n.length>=e&&ph(l,n)>=e-1)break;e--}t++}return Io}function Eh(o){return!!(o&&o.match("^[^/\\\\]*$"))}function qo(o){var t=null,e;if(se[o]===void 0&&typeof module<"u"&&module&&module.exports&&Eh(o))try{t=Io._abbr,e=require,e("./locale/"+o),Tn(t)}catch{se[o]=null}return se[o]}function Tn(o,t){var e;return o&&(Ie(t)?e=sn(o):e=ps(o,t),e?Io=e:typeof console<"u"&&console.warn&&console.warn("Locale "+o+" not found. Did you forget to load it?")),Io._abbr}function ps(o,t){if(t!==null){var e,n=ol;if(t.abbr=o,se[o]!=null)Zr("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=se[o]._config;else if(t.parentLocale!=null)if(se[t.parentLocale]!=null)n=se[t.parentLocale]._config;else if(e=qo(t.parentLocale),e!=null)n=e._config;else return po[t.parentLocale]||(po[t.parentLocale]=[]),po[t.parentLocale].push({name:o,config:t}),null;return se[o]=new rs(ss(n,t)),po[o]&&po[o].forEach(function(i){ps(i.name,i.config)}),Tn(o),se[o]}else return delete se[o],null}function Lh(o,t){if(t!=null){var e,n,i=ol;se[o]!=null&&se[o].parentLocale!=null?se[o].set(ss(se[o]._config,t)):(n=qo(o),n!=null&&(i=n._config),t=ss(i,t),n==null&&(t.abbr=o),e=new rs(t),e.parentLocale=se[o],se[o]=e),Tn(o)}else se[o]!=null&&(se[o].parentLocale!=null?(se[o]=se[o].parentLocale,o===Tn()&&Tn(o)):se[o]!=null&&delete se[o]);return se[o]}function sn(o){var t;if(o&&o._locale&&o._locale._abbr&&(o=o._locale._abbr),!o)return Io;if(!Ve(o)){if(t=qo(o),t)return t;o=[o]}return Ih(o)}function Ph(){return ls(se)}function Is(o){var t,e=o._a;return e&&Xt(o).overflow===-2&&(t=e[en]<0||e[en]>11?en:e[xe]<1||e[xe]>Ts(e[fe],e[en])?xe:e[he]<0||e[he]>24||e[he]===24&&(e[Ue]!==0||e[nn]!==0||e[Fn]!==0)?he:e[Ue]<0||e[Ue]>59?Ue:e[nn]<0||e[nn]>59?nn:e[Fn]<0||e[Fn]>999?Fn:-1,Xt(o)._overflowDayOfYear&&(t<fe||t>xe)&&(t=xe),Xt(o)._overflowWeeks&&t===-1&&(t=Du),Xt(o)._overflowWeekday&&t===-1&&(t=Fu),Xt(o).overflow=t),o}var Mh=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Oh=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sh=/Z|[+-]\d\d(?::?\d\d)?/,ti=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Es=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Dh=/^\/?Date\((-?\d+)/i,Fh=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Xh={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function sl(o){var t,e,n=o._i,i=Mh.exec(n)||Oh.exec(n),l,r,a,c,d=ti.length,u=Es.length;if(i){for(Xt(o).iso=!0,t=0,e=d;t<e;t++)if(ti[t][1].exec(i[1])){r=ti[t][0],l=ti[t][2]!==!1;break}if(r==null){o._isValid=!1;return}if(i[3]){for(t=0,e=u;t<e;t++)if(Es[t][1].exec(i[3])){a=(i[2]||" ")+Es[t][0];break}if(a==null){o._isValid=!1;return}}if(!l&&a!=null){o._isValid=!1;return}if(i[4])if(Sh.exec(i[4]))c="Z";else{o._isValid=!1;return}o._f=r+(a||"")+(c||""),Ps(o)}else o._isValid=!1}function yh(o,t,e,n,i,l){var r=[Nh(o),xr.indexOf(t),parseInt(e,10),parseInt(n,10),parseInt(i,10)];return l&&r.push(parseInt(l,10)),r}function Nh(o){var t=parseInt(o,10);return t<=49?2e3+t:t<=999?1900+t:t}function bh(o){return o.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Vh(o,t,e){if(o){var n=tl.indexOf(o),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return Xt(e).weekdayMismatch=!0,e._isValid=!1,!1}return!0}function Wh(o,t,e){if(o)return Xh[o];if(t)return 0;var n=parseInt(e,10),i=n%100,l=(n-i)/100;return l*60+i}function rl(o){var t=Fh.exec(bh(o._i)),e;if(t){if(e=yh(t[4],t[3],t[2],t[5],t[6],t[7]),!Vh(t[1],e,o))return;o._a=e,o._tzm=Wh(t[8],t[9],t[10]),o._d=mo.apply(null,o._a),o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),Xt(o).rfc2822=!0}else o._isValid=!1}function Uh(o){var t=Dh.exec(o._i);if(t!==null){o._d=new Date(+t[1]);return}if(sl(o),o._isValid===!1)delete o._isValid;else return;if(rl(o),o._isValid===!1)delete o._isValid;else return;o._strict?o._isValid=!1:lt.createFromInputFallback(o)}lt.createFromInputFallback=Fe("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(o){o._d=new Date(o._i+(o._useUTC?" UTC":""))});function zn(o,t,e){return o??t??e}function Yh(o){var t=new Date(lt.now());return o._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ls(o){var t,e,n=[],i,l,r;if(!o._d){for(i=Yh(o),o._w&&o._a[xe]==null&&o._a[en]==null&&wh(o),o._dayOfYear!=null&&(r=zn(o._a[fe],i[fe]),(o._dayOfYear>To(r)||o._dayOfYear===0)&&(Xt(o)._overflowDayOfYear=!0),e=mo(r,0,o._dayOfYear),o._a[en]=e.getUTCMonth(),o._a[xe]=e.getUTCDate()),t=0;t<3&&o._a[t]==null;++t)o._a[t]=n[t]=i[t];for(;t<7;t++)o._a[t]=n[t]=o._a[t]==null?t===2?1:0:o._a[t];o._a[he]===24&&o._a[Ue]===0&&o._a[nn]===0&&o._a[Fn]===0&&(o._nextDay=!0,o._a[he]=0),o._d=(o._useUTC?mo:Au).apply(null,n),l=o._useUTC?o._d.getUTCDay():o._d.getDay(),o._tzm!=null&&o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),o._nextDay&&(o._a[he]=24),o._w&&typeof o._w.d<"u"&&o._w.d!==l&&(Xt(o).weekdayMismatch=!0)}}function wh(o){var t,e,n,i,l,r,a,c,d;t=o._w,t.GG!=null||t.W!=null||t.E!=null?(l=1,r=4,e=zn(t.GG,o._a[fe],Co(ie(),1,4).year),n=zn(t.W,1),i=zn(t.E,1),(i<1||i>7)&&(c=!0)):(l=o._locale._week.dow,r=o._locale._week.doy,d=Co(ie(),l,r),e=zn(t.gg,o._a[fe],d.year),n=zn(t.w,d.week),t.d!=null?(i=t.d,(i<0||i>6)&&(c=!0)):t.e!=null?(i=t.e+l,(t.e<0||t.e>6)&&(c=!0)):i=l),n<1||n>on(e,l,r)?Xt(o)._overflowWeeks=!0:c!=null?Xt(o)._overflowWeekday=!0:(a=qr(e,n,i,l,r),o._a[fe]=a.year,o._dayOfYear=a.dayOfYear)}lt.ISO_8601=function(){},lt.RFC_2822=function(){};function Ps(o){if(o._f===lt.ISO_8601){sl(o);return}if(o._f===lt.RFC_2822){rl(o);return}o._a=[],Xt(o).empty=!0;var t=""+o._i,e,n,i,l,r,a=t.length,c=0,d,u;for(i=Qr(o._f,o._locale).match(as)||[],u=i.length,e=0;e<u;e++)l=i[e],n=(t.match(Mu(l,o))||[])[0],n&&(r=t.substr(0,t.indexOf(n)),r.length>0&&Xt(o).unusedInput.push(r),t=t.slice(t.indexOf(n)+n.length),c+=n.length),Gn[l]?(n?Xt(o).empty=!1:Xt(o).unusedTokens.push(l),Su(l,n,o)):o._strict&&!n&&Xt(o).unusedTokens.push(l);Xt(o).charsLeftOver=a-c,t.length>0&&Xt(o).unusedInput.push(t),o._a[he]<=12&&Xt(o).bigHour===!0&&o._a[he]>0&&(Xt(o).bigHour=void 0),Xt(o).parsedDateParts=o._a.slice(0),Xt(o).meridiem=o._meridiem,o._a[he]=vh(o._locale,o._a[he],o._meridiem),d=Xt(o).era,d!==null&&(o._a[fe]=o._locale.erasConvertYear(d,o._a[fe])),Ls(o),Is(o)}function vh(o,t,e){var n;return e==null?t:o.meridiemHour!=null?o.meridiemHour(t,e):(o.isPM!=null&&(n=o.isPM(e),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function Zh(o){var t,e,n,i,l,r,a=!1,c=o._f.length;if(c===0){Xt(o).invalidFormat=!0,o._d=new Date(NaN);return}for(i=0;i<c;i++)l=0,r=!1,t=is({},o),o._useUTC!=null&&(t._useUTC=o._useUTC),t._f=o._f[i],Ps(t),ns(t)&&(r=!0),l+=Xt(t).charsLeftOver,l+=Xt(t).unusedTokens.length*10,Xt(t).score=l,a?l<n&&(n=l,e=t):(n==null||l<n||r)&&(n=l,e=t,r&&(a=!0));gn(o,e||t)}function Qh(o){if(!o._d){var t=ds(o._i),e=t.day===void 0?t.date:t.day;o._a=Ur([t.year,t.month,e,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)}),Ls(o)}}function Kh(o){var t=new ho(Is(ll(o)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function ll(o){var t=o._i,e=o._f;return o._locale=o._locale||sn(o._l),t===null||e===void 0&&t===""?Ho({nullInput:!0}):(typeof t=="string"&&(o._i=t=o._locale.preparse(t)),We(t)?new ho(Is(t)):(uo(t)?o._d=t:Ve(e)?Zh(o):e?Ps(o):Hh(o),ns(o)||(o._d=null),o))}function Hh(o){var t=o._i;Ie(t)?o._d=new Date(lt.now()):uo(t)?o._d=new Date(t.valueOf()):typeof t=="string"?Uh(o):Ve(t)?(o._a=Ur(t.slice(0),function(e){return parseInt(e,10)}),Ls(o)):Dn(t)?Qh(o):qe(t)?o._d=new Date(t):lt.createFromInputFallback(o)}function al(o,t,e,n,i){var l={};return(t===!0||t===!1)&&(n=t,t=void 0),(e===!0||e===!1)&&(n=e,e=void 0),(Dn(o)&&ts(o)||Ve(o)&&o.length===0)&&(o=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=i,l._l=e,l._i=o,l._f=t,l._strict=n,Kh(l)}function ie(o,t,e,n){return al(o,t,e,n,!1)}var Ah=Fe("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=ie.apply(null,arguments);return this.isValid()&&o.isValid()?o<this?this:o:Ho()}),_h=Fe("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=ie.apply(null,arguments);return this.isValid()&&o.isValid()?o>this?this:o:Ho()});function cl(o,t){var e,n;if(t.length===1&&Ve(t[0])&&(t=t[0]),!t.length)return ie();for(e=t[0],n=1;n<t.length;++n)(!t[n].isValid()||t[n][o](e))&&(e=t[n]);return e}function Bh(){var o=[].slice.call(arguments,0);return cl("isBefore",o)}function kh(){var o=[].slice.call(arguments,0);return cl("isAfter",o)}var Gh=function(){return Date.now?Date.now():+new Date},Eo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function xh(o){var t,e=!1,n,i=Eo.length;for(t in o)if(Ht(o,t)&&!(de.call(Eo,t)!==-1&&(o[t]==null||!isNaN(o[t]))))return!1;for(n=0;n<i;++n)if(o[Eo[n]]){if(e)return!1;parseFloat(o[Eo[n]])!==Yt(o[Eo[n]])&&(e=!0)}return!0}function Jh(){return this._isValid}function $h(){return Ye(NaN)}function ei(o){var t=ds(o),e=t.year||0,n=t.quarter||0,i=t.month||0,l=t.week||t.isoWeek||0,r=t.day||0,a=t.hour||0,c=t.minute||0,d=t.second||0,u=t.millisecond||0;this._isValid=xh(t),this._milliseconds=+u+d*1e3+c*6e4+a*1e3*60*60,this._days=+r+l*7,this._months=+i+n*3+e*12,this._data={},this._locale=sn(),this._bubble()}function ni(o){return o instanceof ei}function Ms(o){return o<0?Math.round(-1*o)*-1:Math.round(o)}function zh(o,t,e){var n=Math.min(o.length,t.length),i=Math.abs(o.length-t.length),l=0,r;for(r=0;r<n;r++)Yt(o[r])!==Yt(t[r])&&l++;return l+i}function dl(o,t){mt(o,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+Ge(~~(e/60),2)+t+Ge(~~e%60,2)})}dl("Z",":"),dl("ZZ",""),dt("Z",Jo),dt("ZZ",Jo),Jt(["Z","ZZ"],function(o,t,e){e._useUTC=!0,e._tzm=Os(Jo,o)});var jh=/([\+\-]|\d\d)/gi;function Os(o,t){var e=(t||"").match(o),n,i,l;return e===null?null:(n=e[e.length-1]||[],i=(n+"").match(jh)||["-",0,0],l=+(i[1]*60)+Yt(i[2]),l===0?0:i[0]==="+"?l:-l)}function Ss(o,t){var e,n;return t._isUTC?(e=t.clone(),n=(We(o)||uo(o)?o.valueOf():ie(o).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+n),lt.updateOffset(e,!1),e):ie(o).local()}function Ds(o){return-Math.round(o._d.getTimezoneOffset())}lt.updateOffset=function(){};function qh(o,t,e){var n=this._offset||0,i;if(!this.isValid())return o!=null?this:NaN;if(o!=null){if(typeof o=="string"){if(o=Os(Jo,o),o===null)return this}else Math.abs(o)<16&&!e&&(o=o*60);return!this._isUTC&&t&&(i=Ds(this)),this._offset=o,this._isUTC=!0,i!=null&&this.add(i,"m"),n!==o&&(!t||this._changeInProgress?gl(this,Ye(o-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,lt.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:Ds(this)}function tR(o,t){return o!=null?(typeof o!="string"&&(o=-o),this.utcOffset(o,t),this):-this.utcOffset()}function eR(o){return this.utcOffset(0,o)}function nR(o){return this._isUTC&&(this.utcOffset(0,o),this._isUTC=!1,o&&this.subtract(Ds(this),"m")),this}function oR(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var o=Os(Lu,this._i);o!=null?this.utcOffset(o):this.utcOffset(0,!0)}return this}function iR(o){return this.isValid()?(o=o?ie(o).utcOffset():0,(this.utcOffset()-o)%60===0):!1}function sR(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function rR(){if(!Ie(this._isDSTShifted))return this._isDSTShifted;var o={},t;return is(o,this),o=ll(o),o._a?(t=o._isUTC?Be(o._a):ie(o._a),this._isDSTShifted=this.isValid()&&zh(o._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function lR(){return this.isValid()?!this._isUTC:!1}function aR(){return this.isValid()?this._isUTC:!1}function ul(){return this.isValid()?this._isUTC&&this._offset===0:!1}var cR=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,dR=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ye(o,t){var e=o,n=null,i,l,r;return ni(o)?e={ms:o._milliseconds,d:o._days,M:o._months}:qe(o)||!isNaN(+o)?(e={},t?e[t]=+o:e.milliseconds=+o):(n=cR.exec(o))?(i=n[1]==="-"?-1:1,e={y:0,d:Yt(n[xe])*i,h:Yt(n[he])*i,m:Yt(n[Ue])*i,s:Yt(n[nn])*i,ms:Yt(Ms(n[Fn]*1e3))*i}):(n=dR.exec(o))?(i=n[1]==="-"?-1:1,e={y:Xn(n[2],i),M:Xn(n[3],i),w:Xn(n[4],i),d:Xn(n[5],i),h:Xn(n[6],i),m:Xn(n[7],i),s:Xn(n[8],i)}):e==null?e={}:typeof e=="object"&&("from"in e||"to"in e)&&(r=uR(ie(e.from),ie(e.to)),e={},e.ms=r.milliseconds,e.M=r.months),l=new ei(e),ni(o)&&Ht(o,"_locale")&&(l._locale=o._locale),ni(o)&&Ht(o,"_isValid")&&(l._isValid=o._isValid),l}Ye.fn=ei.prototype,Ye.invalid=$h;function Xn(o,t){var e=o&&parseFloat(o.replace(",","."));return(isNaN(e)?0:e)*t}function hl(o,t){var e={};return e.months=t.month()-o.month()+(t.year()-o.year())*12,o.clone().add(e.months,"M").isAfter(t)&&--e.months,e.milliseconds=+t-+o.clone().add(e.months,"M"),e}function uR(o,t){var e;return o.isValid()&&t.isValid()?(t=Ss(t,o),o.isBefore(t)?e=hl(o,t):(e=hl(t,o),e.milliseconds=-e.milliseconds,e.months=-e.months),e):{milliseconds:0,months:0}}function Rl(o,t){return function(e,n){var i,l;return n!==null&&!isNaN(+n)&&(Zr(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),l=e,e=n,n=l),i=Ye(e,n),gl(this,i,o),this}}function gl(o,t,e,n){var i=t._milliseconds,l=Ms(t._days),r=Ms(t._months);o.isValid()&&(n=n??!0,r&&$r(o,fo(o,"Month")+r*e),l&&Gr(o,"Date",fo(o,"Date")+l*e),i&&o._d.setTime(o._d.valueOf()+i*e),n&&lt.updateOffset(o,l||r))}var hR=Rl(1,"add"),RR=Rl(-1,"subtract");function Tl(o){return typeof o=="string"||o instanceof String}function gR(o){return We(o)||uo(o)||Tl(o)||qe(o)||fR(o)||TR(o)||o===null||o===void 0}function TR(o){var t=Dn(o)&&!ts(o),e=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,l,r=n.length;for(i=0;i<r;i+=1)l=n[i],e=e||Ht(o,l);return t&&e}function fR(o){var t=Ve(o),e=!1;return t&&(e=o.filter(function(n){return!qe(n)&&Tl(o)}).length===0),t&&e}function mR(o){var t=Dn(o)&&!ts(o),e=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,l;for(i=0;i<n.length;i+=1)l=n[i],e=e||Ht(o,l);return t&&e}function CR(o,t){var e=o.diff(t,"days",!0);return e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"}function pR(o,t){arguments.length===1&&(arguments[0]?gR(arguments[0])?(o=arguments[0],t=void 0):mR(arguments[0])&&(t=arguments[0],o=void 0):(o=void 0,t=void 0));var e=o||ie(),n=Ss(e,this).startOf("day"),i=lt.calendarFormat(this,n)||"sameElse",l=t&&(ke(t[i])?t[i].call(this,e):t[i]);return this.format(l||this.localeData().calendar(i,this,ie(e)))}function IR(){return new ho(this)}function ER(o,t){var e=We(o)?o:ie(o);return this.isValid()&&e.isValid()?(t=Xe(t)||"millisecond",t==="millisecond"?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf()):!1}function LR(o,t){var e=We(o)?o:ie(o);return this.isValid()&&e.isValid()?(t=Xe(t)||"millisecond",t==="millisecond"?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf()):!1}function PR(o,t,e,n){var i=We(o)?o:ie(o),l=We(t)?t:ie(t);return this.isValid()&&i.isValid()&&l.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(i,e):!this.isBefore(i,e))&&(n[1]===")"?this.isBefore(l,e):!this.isAfter(l,e))):!1}function MR(o,t){var e=We(o)?o:ie(o),n;return this.isValid()&&e.isValid()?(t=Xe(t)||"millisecond",t==="millisecond"?this.valueOf()===e.valueOf():(n=e.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf())):!1}function OR(o,t){return this.isSame(o,t)||this.isAfter(o,t)}function SR(o,t){return this.isSame(o,t)||this.isBefore(o,t)}function DR(o,t,e){var n,i,l;if(!this.isValid())return NaN;if(n=Ss(o,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,t=Xe(t),t){case"year":l=oi(this,n)/12;break;case"month":l=oi(this,n);break;case"quarter":l=oi(this,n)/3;break;case"second":l=(this-n)/1e3;break;case"minute":l=(this-n)/6e4;break;case"hour":l=(this-n)/36e5;break;case"day":l=(this-n-i)/864e5;break;case"week":l=(this-n-i)/6048e5;break;default:l=this-n}return e?l:ye(l)}function oi(o,t){if(o.date()<t.date())return-oi(t,o);var e=(t.year()-o.year())*12+(t.month()-o.month()),n=o.clone().add(e,"months"),i,l;return t-n<0?(i=o.clone().add(e-1,"months"),l=(t-n)/(n-i)):(i=o.clone().add(e+1,"months"),l=(t-n)/(i-n)),-(e+l)||0}lt.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",lt.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function FR(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function XR(o){if(!this.isValid())return null;var t=o!==!0,e=t?this.clone().utc():this;return e.year()<0||e.year()>9999?_o(e,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ke(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",_o(e,"Z")):_o(e,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function yR(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var o="moment",t="",e,n,i,l;return this.isLocal()||(o=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),e="["+o+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",l=t+'[")]',this.format(e+n+i+l)}function NR(o){o||(o=this.isUtc()?lt.defaultFormatUtc:lt.defaultFormat);var t=_o(this,o);return this.localeData().postformat(t)}function bR(o,t){return this.isValid()&&(We(o)&&o.isValid()||ie(o).isValid())?Ye({to:this,from:o}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function VR(o){return this.from(ie(),o)}function WR(o,t){return this.isValid()&&(We(o)&&o.isValid()||ie(o).isValid())?Ye({from:this,to:o}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function UR(o){return this.to(ie(),o)}function fl(o){var t;return o===void 0?this._locale._abbr:(t=sn(o),t!=null&&(this._locale=t),this)}var ml=Fe("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(o){return o===void 0?this.localeData():this.locale(o)});function Cl(){return this._locale}var ii=1e3,jn=60*ii,si=60*jn,pl=(365*400+97)*24*si;function qn(o,t){return(o%t+t)%t}function Il(o,t,e){return o<100&&o>=0?new Date(o+400,t,e)-pl:new Date(o,t,e).valueOf()}function El(o,t,e){return o<100&&o>=0?Date.UTC(o+400,t,e)-pl:Date.UTC(o,t,e)}function YR(o){var t,e;if(o=Xe(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?El:Il,o){case"year":t=e(this.year(),0,1);break;case"quarter":t=e(this.year(),this.month()-this.month()%3,1);break;case"month":t=e(this.year(),this.month(),1);break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=e(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=qn(t+(this._isUTC?0:this.utcOffset()*jn),si);break;case"minute":t=this._d.valueOf(),t-=qn(t,jn);break;case"second":t=this._d.valueOf(),t-=qn(t,ii);break}return this._d.setTime(t),lt.updateOffset(this,!0),this}function wR(o){var t,e;if(o=Xe(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?El:Il,o){case"year":t=e(this.year()+1,0,1)-1;break;case"quarter":t=e(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=e(this.year(),this.month()+1,1)-1;break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=e(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=si-qn(t+(this._isUTC?0:this.utcOffset()*jn),si)-1;break;case"minute":t=this._d.valueOf(),t+=jn-qn(t,jn)-1;break;case"second":t=this._d.valueOf(),t+=ii-qn(t,ii)-1;break}return this._d.setTime(t),lt.updateOffset(this,!0),this}function vR(){return this._d.valueOf()-(this._offset||0)*6e4}function ZR(){return Math.floor(this.valueOf()/1e3)}function QR(){return new Date(this.valueOf())}function KR(){var o=this;return[o.year(),o.month(),o.date(),o.hour(),o.minute(),o.second(),o.millisecond()]}function HR(){var o=this;return{years:o.year(),months:o.month(),date:o.date(),hours:o.hours(),minutes:o.minutes(),seconds:o.seconds(),milliseconds:o.milliseconds()}}function AR(){return this.isValid()?this.toISOString():null}function _R(){return ns(this)}function BR(){return gn({},Xt(this))}function kR(){return Xt(this).overflow}function GR(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}mt("N",0,0,"eraAbbr"),mt("NN",0,0,"eraAbbr"),mt("NNN",0,0,"eraAbbr"),mt("NNNN",0,0,"eraName"),mt("NNNNN",0,0,"eraNarrow"),mt("y",["y",1],"yo","eraYear"),mt("y",["yy",2],0,"eraYear"),mt("y",["yyy",3],0,"eraYear"),mt("y",["yyyy",4],0,"eraYear"),dt("N",Fs),dt("NN",Fs),dt("NNN",Fs),dt("NNNN",ig),dt("NNNNN",sg),Jt(["N","NN","NNN","NNNN","NNNNN"],function(o,t,e,n){var i=e._locale.erasParse(o,n,e._strict);i?Xt(e).era=i:Xt(e).invalidEra=o}),dt("y",xn),dt("yy",xn),dt("yyy",xn),dt("yyyy",xn),dt("yo",rg),Jt(["y","yy","yyy","yyyy"],fe),Jt(["yo"],function(o,t,e,n){var i;e._locale._eraYearOrdinalRegex&&(i=o.match(e._locale._eraYearOrdinalRegex)),e._locale.eraYearOrdinalParse?t[fe]=e._locale.eraYearOrdinalParse(o,i):t[fe]=parseInt(o,10)});function xR(o,t){var e,n,i,l=this._eras||sn("en")._eras;for(e=0,n=l.length;e<n;++e)switch(typeof l[e].since==="string"&&(i=lt(l[e].since).startOf("day"),l[e].since=i.valueOf()),typeof l[e].until){case"undefined":l[e].until=1/0;break;case"string":i=lt(l[e].until).startOf("day").valueOf(),l[e].until=i.valueOf();break}return l}function JR(o,t,e){var n,i,l=this.eras(),r,a,c;for(o=o.toUpperCase(),n=0,i=l.length;n<i;++n)if(r=l[n].name.toUpperCase(),a=l[n].abbr.toUpperCase(),c=l[n].narrow.toUpperCase(),e)switch(t){case"N":case"NN":case"NNN":if(a===o)return l[n];break;case"NNNN":if(r===o)return l[n];break;case"NNNNN":if(c===o)return l[n];break}else if([r,a,c].indexOf(o)>=0)return l[n]}function $R(o,t){var e=o.since<=o.until?1:-1;return t===void 0?lt(o.since).year():lt(o.since).year()+(t-o.offset)*e}function zR(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].name;return""}function jR(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].narrow;return""}function qR(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].abbr;return""}function tg(){var o,t,e,n,i=this.localeData().eras();for(o=0,t=i.length;o<t;++o)if(e=i[o].since<=i[o].until?1:-1,n=this.clone().startOf("day").valueOf(),i[o].since<=n&&n<=i[o].until||i[o].until<=n&&n<=i[o].since)return(this.year()-lt(i[o].since).year())*e+i[o].offset;return this.year()}function eg(o){return Ht(this,"_erasNameRegex")||Xs.call(this),o?this._erasNameRegex:this._erasRegex}function ng(o){return Ht(this,"_erasAbbrRegex")||Xs.call(this),o?this._erasAbbrRegex:this._erasRegex}function og(o){return Ht(this,"_erasNarrowRegex")||Xs.call(this),o?this._erasNarrowRegex:this._erasRegex}function Fs(o,t){return t.erasAbbrRegex(o)}function ig(o,t){return t.erasNameRegex(o)}function sg(o,t){return t.erasNarrowRegex(o)}function rg(o,t){return t._eraYearOrdinalRegex||xn}function Xs(){var o=[],t=[],e=[],n=[],i,l,r,a,c,d=this.eras();for(i=0,l=d.length;i<l;++i)r=tn(d[i].name),a=tn(d[i].abbr),c=tn(d[i].narrow),t.push(r),o.push(a),e.push(c),n.push(r),n.push(a),n.push(c);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+e.join("|")+")","i")}mt(0,["gg",2],0,function(){return this.weekYear()%100}),mt(0,["GG",2],0,function(){return this.isoWeekYear()%100});function ri(o,t){mt(0,[o,o.length],0,t)}ri("gggg","weekYear"),ri("ggggg","weekYear"),ri("GGGG","isoWeekYear"),ri("GGGGG","isoWeekYear"),dt("G",xo),dt("g",xo),dt("GG",oe,Pe),dt("gg",oe,Pe),dt("GGGG",hs,us),dt("gggg",hs,us),dt("GGGGG",Go,Bo),dt("ggggg",Go,Bo),go(["gggg","ggggg","GGGG","GGGGG"],function(o,t,e,n){t[n.substr(0,2)]=Yt(o)}),go(["gg","GG"],function(o,t,e,n){t[n]=lt.parseTwoDigitYear(o)});function lg(o){return Ll.call(this,o,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function ag(o){return Ll.call(this,o,this.isoWeek(),this.isoWeekday(),1,4)}function cg(){return on(this.year(),1,4)}function dg(){return on(this.isoWeekYear(),1,4)}function ug(){var o=this.localeData()._week;return on(this.year(),o.dow,o.doy)}function hg(){var o=this.localeData()._week;return on(this.weekYear(),o.dow,o.doy)}function Ll(o,t,e,n,i){var l;return o==null?Co(this,n,i).year:(l=on(o,n,i),t>l&&(t=l),Rg.call(this,o,t,e,n,i))}function Rg(o,t,e,n,i){var l=qr(o,t,e,n,i),r=mo(l.year,0,l.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}mt("Q",0,"Qo","quarter"),dt("Q",Hr),Jt("Q",function(o,t){t[en]=(Yt(o)-1)*3});function gg(o){return o==null?Math.ceil((this.month()+1)/3):this.month((o-1)*3+this.month()%3)}mt("D",["DD",2],"Do","date"),dt("D",oe,Jn),dt("DD",oe,Pe),dt("Do",function(o,t){return o?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Jt(["D","DD"],xe),Jt("Do",function(o,t){t[xe]=Yt(o.match(oe)[0])});var Pl=$n("Date",!0);mt("DDD",["DDDD",3],"DDDo","dayOfYear"),dt("DDD",ko),dt("DDDD",Ar),Jt(["DDD","DDDD"],function(o,t,e){e._dayOfYear=Yt(o)});function Tg(o){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return o==null?t:this.add(o-t,"d")}mt("m",["mm",2],0,"minute"),dt("m",oe,Rs),dt("mm",oe,Pe),Jt(["m","mm"],Ue);var fg=$n("Minutes",!1);mt("s",["ss",2],0,"second"),dt("s",oe,Rs),dt("ss",oe,Pe),Jt(["s","ss"],nn);var mg=$n("Seconds",!1);mt("S",0,0,function(){return~~(this.millisecond()/100)}),mt(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),mt(0,["SSS",3],0,"millisecond"),mt(0,["SSSS",4],0,function(){return this.millisecond()*10}),mt(0,["SSSSS",5],0,function(){return this.millisecond()*100}),mt(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),mt(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),mt(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),mt(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),dt("S",ko,Hr),dt("SS",ko,Pe),dt("SSS",ko,Ar);var fn,Ml;for(fn="SSSS";fn.length<=9;fn+="S")dt(fn,xn);function Cg(o,t){t[Fn]=Yt(("0."+o)*1e3)}for(fn="S";fn.length<=9;fn+="S")Jt(fn,Cg);Ml=$n("Milliseconds",!1),mt("z",0,0,"zoneAbbr"),mt("zz",0,0,"zoneName");function pg(){return this._isUTC?"UTC":""}function Ig(){return this._isUTC?"Coordinated Universal Time":""}var j=ho.prototype;j.add=hR,j.calendar=pR,j.clone=IR,j.diff=DR,j.endOf=wR,j.format=NR,j.from=bR,j.fromNow=VR,j.to=WR,j.toNow=UR,j.get=yu,j.invalidAt=kR,j.isAfter=ER,j.isBefore=LR,j.isBetween=PR,j.isSame=MR,j.isSameOrAfter=OR,j.isSameOrBefore=SR,j.isValid=_R,j.lang=ml,j.locale=fl,j.localeData=Cl,j.max=_h,j.min=Ah,j.parsingFlags=BR,j.set=Nu,j.startOf=YR,j.subtract=RR,j.toArray=KR,j.toObject=HR,j.toDate=QR,j.toISOString=XR,j.inspect=yR,typeof Symbol<"u"&&Symbol.for!=null&&(j[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),j.toJSON=AR,j.toString=FR,j.unix=ZR,j.valueOf=vR,j.creationData=GR,j.eraName=zR,j.eraNarrow=jR,j.eraAbbr=qR,j.eraYear=tg,j.year=kr,j.isLeapYear=Xu,j.weekYear=lg,j.isoWeekYear=ag,j.quarter=j.quarters=gg,j.month=zr,j.daysInMonth=Qu,j.week=j.weeks=xu,j.isoWeek=j.isoWeeks=Ju,j.weeksInYear=ug,j.weeksInWeekYear=hg,j.isoWeeksInYear=cg,j.isoWeeksInISOWeekYear=dg,j.date=Pl,j.day=j.days=ah,j.weekday=ch,j.isoWeekday=dh,j.dayOfYear=Tg,j.hour=j.hours=mh,j.minute=j.minutes=fg,j.second=j.seconds=mg,j.millisecond=j.milliseconds=Ml,j.utcOffset=qh,j.utc=eR,j.local=nR,j.parseZone=oR,j.hasAlignedHourOffset=iR,j.isDST=sR,j.isLocal=lR,j.isUtcOffset=aR,j.isUtc=ul,j.isUTC=ul,j.zoneAbbr=pg,j.zoneName=Ig,j.dates=Fe("dates accessor is deprecated. Use date instead.",Pl),j.months=Fe("months accessor is deprecated. Use month instead",zr),j.years=Fe("years accessor is deprecated. Use year instead",kr),j.zone=Fe("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",tR),j.isDSTShifted=Fe("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",rR);function Eg(o){return ie(o*1e3)}function Lg(){return ie.apply(null,arguments).parseZone()}function Ol(o){return o}var At=rs.prototype;At.calendar=lu,At.longDateFormat=uu,At.invalidDate=Ru,At.ordinal=fu,At.preparse=Ol,At.postformat=Ol,At.relativeTime=Cu,At.pastFuture=pu,At.set=su,At.eras=xR,At.erasParse=JR,At.erasConvertYear=$R,At.erasAbbrRegex=ng,At.erasNameRegex=eg,At.erasNarrowRegex=og,At.months=Yu,At.monthsShort=wu,At.monthsParse=Zu,At.monthsRegex=Hu,At.monthsShortRegex=Ku,At.week=_u,At.firstDayOfYear=Gu,At.firstDayOfWeek=ku,At.weekdays=oh,At.weekdaysMin=sh,At.weekdaysShort=ih,At.weekdaysParse=lh,At.weekdaysRegex=uh,At.weekdaysShortRegex=hh,At.weekdaysMinRegex=Rh,At.isPM=Th,At.meridiem=Ch;function li(o,t,e,n){var i=sn(),l=Be().set(n,t);return i[e](l,o)}function Sl(o,t,e){if(qe(o)&&(t=o,o=void 0),o=o||"",t!=null)return li(o,t,e,"month");var n,i=[];for(n=0;n<12;n++)i[n]=li(o,n,e,"month");return i}function ys(o,t,e,n){typeof o=="boolean"?(qe(t)&&(e=t,t=void 0),t=t||""):(t=o,e=t,o=!1,qe(t)&&(e=t,t=void 0),t=t||"");var i=sn(),l=o?i._week.dow:0,r,a=[];if(e!=null)return li(t,(e+l)%7,n,"day");for(r=0;r<7;r++)a[r]=li(t,(r+l)%7,n,"day");return a}function Pg(o,t){return Sl(o,t,"months")}function Mg(o,t){return Sl(o,t,"monthsShort")}function Og(o,t,e){return ys(o,t,e,"weekdays")}function Sg(o,t,e){return ys(o,t,e,"weekdaysShort")}function Dg(o,t,e){return ys(o,t,e,"weekdaysMin")}Tn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(o){var t=o%10,e=Yt(o%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return o+e}}),lt.lang=Fe("moment.lang is deprecated. Use moment.locale instead.",Tn),lt.langData=Fe("moment.langData is deprecated. Use moment.localeData instead.",sn);var rn=Math.abs;function Fg(){var o=this._data;return this._milliseconds=rn(this._milliseconds),this._days=rn(this._days),this._months=rn(this._months),o.milliseconds=rn(o.milliseconds),o.seconds=rn(o.seconds),o.minutes=rn(o.minutes),o.hours=rn(o.hours),o.months=rn(o.months),o.years=rn(o.years),this}function Dl(o,t,e,n){var i=Ye(t,e);return o._milliseconds+=n*i._milliseconds,o._days+=n*i._days,o._months+=n*i._months,o._bubble()}function Xg(o,t){return Dl(this,o,t,1)}function yg(o,t){return Dl(this,o,t,-1)}function Fl(o){return o<0?Math.floor(o):Math.ceil(o)}function Ng(){var o=this._milliseconds,t=this._days,e=this._months,n=this._data,i,l,r,a,c;return o>=0&&t>=0&&e>=0||o<=0&&t<=0&&e<=0||(o+=Fl(Ns(e)+t)*864e5,t=0,e=0),n.milliseconds=o%1e3,i=ye(o/1e3),n.seconds=i%60,l=ye(i/60),n.minutes=l%60,r=ye(l/60),n.hours=r%24,t+=ye(r/24),c=ye(Xl(t)),e+=c,t-=Fl(Ns(c)),a=ye(e/12),e%=12,n.days=t,n.months=e,n.years=a,this}function Xl(o){return o*4800/146097}function Ns(o){return o*146097/4800}function bg(o){if(!this.isValid())return NaN;var t,e,n=this._milliseconds;if(o=Xe(o),o==="month"||o==="quarter"||o==="year")switch(t=this._days+n/864e5,e=this._months+Xl(t),o){case"month":return e;case"quarter":return e/3;case"year":return e/12}else switch(t=this._days+Math.round(Ns(this._months)),o){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+o)}}function ln(o){return function(){return this.as(o)}}var yl=ln("ms"),Vg=ln("s"),Wg=ln("m"),Ug=ln("h"),Yg=ln("d"),wg=ln("w"),vg=ln("M"),Zg=ln("Q"),Qg=ln("y"),Kg=yl;function Hg(){return Ye(this)}function Ag(o){return o=Xe(o),this.isValid()?this[o+"s"]():NaN}function yn(o){return function(){return this.isValid()?this._data[o]:NaN}}var _g=yn("milliseconds"),Bg=yn("seconds"),kg=yn("minutes"),Gg=yn("hours"),xg=yn("days"),Jg=yn("months"),$g=yn("years");function zg(){return ye(this.days()/7)}var an=Math.round,to={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function jg(o,t,e,n,i){return i.relativeTime(t||1,!!e,o,n)}function qg(o,t,e,n){var i=Ye(o).abs(),l=an(i.as("s")),r=an(i.as("m")),a=an(i.as("h")),c=an(i.as("d")),d=an(i.as("M")),u=an(i.as("w")),h=an(i.as("y")),R=l<=e.ss&&["s",l]||l<e.s&&["ss",l]||r<=1&&["m"]||r<e.m&&["mm",r]||a<=1&&["h"]||a<e.h&&["hh",a]||c<=1&&["d"]||c<e.d&&["dd",c];return e.w!=null&&(R=R||u<=1&&["w"]||u<e.w&&["ww",u]),R=R||d<=1&&["M"]||d<e.M&&["MM",d]||h<=1&&["y"]||["yy",h],R[2]=t,R[3]=+o>0,R[4]=n,jg.apply(null,R)}function tT(o){return o===void 0?an:typeof o=="function"?(an=o,!0):!1}function eT(o,t){return to[o]===void 0?!1:t===void 0?to[o]:(to[o]=t,o==="s"&&(to.ss=t-1),!0)}function nT(o,t){if(!this.isValid())return this.localeData().invalidDate();var e=!1,n=to,i,l;return typeof o=="object"&&(t=o,o=!1),typeof o=="boolean"&&(e=o),typeof t=="object"&&(n=Object.assign({},to,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),i=this.localeData(),l=qg(this,!e,n,i),e&&(l=i.pastFuture(+this,l)),i.postformat(l)}var bs=Math.abs;function eo(o){return(o>0)-(o<0)||+o}function ai(){if(!this.isValid())return this.localeData().invalidDate();var o=bs(this._milliseconds)/1e3,t=bs(this._days),e=bs(this._months),n,i,l,r,a=this.asSeconds(),c,d,u,h;return a?(n=ye(o/60),i=ye(n/60),o%=60,n%=60,l=ye(e/12),e%=12,r=o?o.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",d=eo(this._months)!==eo(a)?"-":"",u=eo(this._days)!==eo(a)?"-":"",h=eo(this._milliseconds)!==eo(a)?"-":"",c+"P"+(l?d+l+"Y":"")+(e?d+e+"M":"")+(t?u+t+"D":"")+(i||n||o?"T":"")+(i?h+i+"H":"")+(n?h+n+"M":"")+(o?h+r+"S":"")):"P0D"}var wt=ei.prototype;wt.isValid=Jh,wt.abs=Fg,wt.add=Xg,wt.subtract=yg,wt.as=bg,wt.asMilliseconds=yl,wt.asSeconds=Vg,wt.asMinutes=Wg,wt.asHours=Ug,wt.asDays=Yg,wt.asWeeks=wg,wt.asMonths=vg,wt.asQuarters=Zg,wt.asYears=Qg,wt.valueOf=Kg,wt._bubble=Ng,wt.clone=Hg,wt.get=Ag,wt.milliseconds=_g,wt.seconds=Bg,wt.minutes=kg,wt.hours=Gg,wt.days=xg,wt.weeks=zg,wt.months=Jg,wt.years=$g,wt.humanize=nT,wt.toISOString=ai,wt.toString=ai,wt.toJSON=ai,wt.locale=fl,wt.localeData=Cl,wt.toIsoString=Fe("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ai),wt.lang=ml,mt("X",0,0,"unix"),mt("x",0,0,"valueOf"),dt("x",xo),dt("X",Pu),Jt("X",function(o,t,e){e._d=new Date(parseFloat(o)*1e3)}),Jt("x",function(o,t,e){e._d=new Date(Yt(o))});lt.version="2.30.1",ou(ie),lt.fn=j,lt.min=Bh,lt.max=kh,lt.now=Gh,lt.utc=Be,lt.unix=Eg,lt.months=Pg,lt.isDate=uo,lt.locale=Tn,lt.invalid=Ho,lt.duration=Ye,lt.isMoment=We,lt.weekdays=Og,lt.parseZone=Lg,lt.localeData=sn,lt.isDuration=ni,lt.monthsShort=Mg,lt.weekdaysMin=Dg,lt.defineLocale=ps,lt.updateLocale=Lh,lt.locales=Ph,lt.weekdaysShort=Sg,lt.normalizeUnits=Xe,lt.relativeTimeRounding=tT,lt.relativeTimeThreshold=eT,lt.calendarFormat=CR,lt.prototype=j,lt.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const oT=new Set([s.ElementType.IMAGE,s.ElementType.MACRO,s.ElementType.CUSTOM_MACRO,s.ElementType.MENSTRUAL_HISTORY,s.ElementType.FETAL_HEART_POSITION,s.ElementType.TOOTH_POSITION]);class Vs{draws;ranges;element;control;options;position;constructor(t,e){const n=e.getDraw();this.draws=n,this.position=n.getPosition(),this.ranges=n.getRange(),this.options=n.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();let{startIndex:n}=t.range||this.control.getRange();const i=this.control.getDraw(),l=t?null:i.getTd();n>=e.length&&(n=e.length-1);const r=e[n],a=[];let c=l,d=e,u=n;for(;;){if(u<0&&c?.linkTdPrevId){const f=i.getTdById(c.linkTdPrevId);if(f){d=f.value,u=d.length-1,c=f;continue}}if(u<0)break;const g=d[u];if(g.controlId!==r.controlId||g.controlComponent===s.ControlComponent.PREFIX||g.controlComponent===s.ControlComponent.PRE_TEXT)break;g.controlComponent===s.ControlComponent.VALUE&&a.unshift(g),u--}c=l;let h=e,R=n+1;for(;;){if(R>=h.length&&c?.linkTdNextId){const f=i.getTdById(c.linkTdNextId);if(f){h=f.value,R=0,c=f;continue}}const g=h[R];if(!g||g.controlId!==r.controlId||g.controlComponent===s.ControlComponent.POSTFIX||g.controlComponent===s.ControlComponent.POST_TEXT)break;g.controlComponent===s.ControlComponent.VALUE&&a.push(g),R++}return a.filter(g=>g.type!==s.ElementType.SPLIT_TAG)}removeNextControlElement(t,e){const n=this.control.getDraw();if(e=e??n.getTd()?.linkTdNextId,e){const i=n.getTdById(e);if(i){if(i.value.length){if(i.value[1].controlId===t)return n.spliceElementList(i.value,1,1),i.value[1]}else if(i.linkTdNextId)return this.removeNextControlElement(t,i.linkTdNextId)}}}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const i=e.range||this.control.getRange(),l=e.elementList||this.control.getElementList(),r=l[i.startIndex],a=l[i.startIndex+1],c=M=>!!(M&&(M.controlComponent===s.ControlComponent.POSTFIX||M.controlComponent===s.ControlComponent.POST_TEXT||M.controlComponent===s.ControlComponent.POSTTEXTFIX||M.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)),d=!!(r?.originControlId&&c(r)&&a?.controlId===r.originControlId&&!a.originControlId&&a.control?.type===s.ControlType.TEXTFIELD&&c(a));let u=this.element.controlId||r?.controlId,h=this.element.originControlId||(this.element.controlId===r?.controlId?r?.originControlId:void 0),R=this.element.control||r.control;const T=!!(r?.controlId&&r.controlId!==this.element.controlId&&!r.originControlId&&r.control?.type===s.ControlType.TEXTFIELD);d?(u=r.originControlId,h=void 0,R=a.control):T&&(u=r.controlId,h=void 0,R=r.control);const g=(()=>{if(!u||!r?.subTemplateParentId||!c(r)||!kt(a,this.element)||a?.subTemplateParentId===r.subTemplateParentId)return!1;for(let M=i.startIndex-1;M>=0;M--){const V=l[M];if(V.type===s.ElementType.SUB_TEMPLATE&&V.id===r.subTemplateParentId)return V.controlId===u&&(V.originControlId||null)===(h||null)}return!1})(),f=!!u&&(g||r?.controlId!==u&&this._findNearestTextAncestorId(l,r?.originControlId)===u);!f&&!d&&!T&&(this.control.mergeControl(e),this.control.shrinkBoundary(e));const{startIndex:C,endIndex:p}=i,I=this.control.getDraw();C!==p?I.spliceElementList(l,C+1,p-C,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):f||d||T?this._removePlaceholdersByControl(l,u,h||null):this.control.removePlaceholder(C,{elementList:l});const m=l[C];f||d||T?this._removePlaceholdersByControl(l,u,h||null):this._removeControlPlaceholders(l,C);const L=m.type&&!Le.includes(m.type)||m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRE_TEXT?xt(m,["control","controlId","originControlId","subTemplateParentId","subTemplateInstanceId",...ue]):Ee(m,["type"]);g&&(delete L.subTemplateParentId,delete L.subTemplateInstanceId);const O=f||d||T,P=M=>{ue.forEach(V=>{delete M[V];const N=R?.[V];N!==void 0&&(M[V]=N)}),delete M.underline,delete M.textDecoration,R?.type===s.ControlType.TEXT&&M.color?.toLowerCase()==="#87d068"?M.color=this.options.defaultColor:M.color||(M.color=this.options.defaultColor)};O&&P(L),L.controlId=u,R&&(L.control=R),h?L.originControlId=h:delete L.originControlId;const S=this.options.mode===s.EditorMode.FORM&&this.options.modeRule.form.inputTraceEnabled,y=i.startIndex+1,Y=[],b=M=>{const V=Y.length?Y:l,N=Y.length?Y.length-1:d||g?i.startIndex+1:i.startIndex;le(V,[M],N,{editorOptions:this.options}),Y.push(M)};for(let M=0;M<t.length;M++){const V=t[M];if(V.type===s.ElementType.CONTROL&&V.control){const N=V,X=N.controlId||ft(),D=N.control?.value||[],E=N.control?.type,U=E===s.ControlType.TEXTFIELD,F=U?this.options.control.textFixColor:E===s.ControlType.TEXT||E===s.ControlType.NUMBER?"#87d068":this.options.control.bracketColor,Q={...Ee(L,["underline","textDecoration"]),controlId:X,type:s.ElementType.CONTROL,control:N.control,originControlId:u},W=U?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX,K=U?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX,k=U?N.control?.preTextFix||this.options.control.preTextFix:N.control?.prefix||this.options.control.prefix;for(let H=0;H<k.length;H++){const A={...Q,color:F,value:k[H],controlComponent:W};b(A)}for(let H=0;H<D.length;H++){const A=D[H],v={...Q,...A,controlComponent:s.ControlComponent.VALUE};(v.color===this.options.control.bracketColor||v.color===this.options.control.placeholderColor)&&(v.color=this.options.defaultColor),b(v)}if(D.length===0){const H=N.control?.placeholder||"";for(let A=0;A<H.length;A++){const v={...Q,value:H[A],controlComponent:s.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};b(v)}}const B=U?N.control?.postTextFix||this.options.control.postTextFix:N.control?.postfix||this.options.control.postfix;for(let H=0;H<B.length;H++){const A={...Q,color:F,value:B[H],controlComponent:K};b(A)}}else if(V.type||V.value){(m.controlComponent===s.ControlComponent.PRE_TEXT||m.controlComponent===s.ControlComponent.POST_TEXT||m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.POSTFIX)&&(L.color=this.options.defaultColor);const X=Ee(V,["control","controlId","controlComponent","originControlId"]),D={...L,...X,controlComponent:s.ControlComponent.VALUE};g&&(delete D.subTemplateParentId,delete D.subTemplateInstanceId),O&&P(D),(D.color===this.options.control.bracketColor||D.color===this.options.control.placeholderColor||D.color===this.options.control.textFixColor)&&(D.color=this.options.defaultColor),D.strikeout&&delete D.strikeout,S&&(D.textDecoration={style:s.TextDecorationStyle.DOUBLE},D.underline=!0),b(D)}}return Y.length&&I.spliceElementList(l,y,0,Y),i.startIndex+Y.length}_removeControlPlaceholders(t,e){const n=t[e];if(!n?.controlId)return;const i=a=>!!a&&a.controlId===n.controlId&&a.originControlId===n.originControlId;let l=e;for(;l>=0&&i(t[l]);)l--;let r=e+1;for(;r<t.length&&i(t[r]);)r++;for(let a=r-1;a>l;a--)t[a].controlComponent===s.ControlComponent.PLACEHOLDER&&t.splice(a,1)}_removePlaceholdersByControl(t,e,n){if(e)for(let i=t.length-1;i>=0;i--){const l=t[i];l.controlId===e&&(l.originControlId||null)===n&&l.controlComponent===s.ControlComponent.PLACEHOLDER&&t.splice(i,1)}}_findNearestTextAncestorId(t,e){if(!e)return null;const n=new Set;let i=e,l=null;for(;i&&!n.has(i);){n.add(i);let r;for(let a=0;a<t.length;a++){const c=t[a];if(c.controlId===i&&c.control?.type&&(r=c,c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT))break}if(!r)break;(r.control?.type===s.ControlType.TEXT||this.options.mode===s.EditorMode.EDIT&&r.control?.type===s.ControlType.TEXTFIELD)&&(l=i),i=r.originControlId||null}return l}clearValue(t={},e={}){if(!e.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const n=t.elementList||this.control.getElementList(),i=t.range||this.control.getValueRange()||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:l,endIndex:r}=i;return this.control.getDraw().spliceElementList(n,l+1,r-l,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),e.isAddPlaceholder!==!1&&(this.getValue(t).length||this.control.addPlaceholder(l,t)),l}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange(),i=W=>!!(W?.type&&oT.has(W.type)&&W.controlId&&W.controlComponent===s.ControlComponent.VALUE),l=W=>{const K=e[W];if(!i(K))return null;const k=K.controlId,B=K.originControlId||null,H=v=>v?.controlId===k&&(v?.originControlId||null)===B;if(this.draws.spliceElementList(e,W,1),!e.some(v=>H(v)&&v.controlComponent===s.ControlComponent.VALUE)){const v=e.findIndex(ct=>H(ct)&&(ct.controlComponent===s.ControlComponent.PREFIX||ct.controlComponent===s.ControlComponent.PRE_TEXT));v>=0&&this.control.addPlaceholder(v)}for(let v=Math.min(W-1,e.length-1);v>=0;v--){const ct=e[v];if(!H(ct))break;if(ct.controlComponent===s.ControlComponent.VALUE||ct.controlComponent===s.ControlComponent.PLACEHOLDER)return v}for(let v=Math.max(0,W);v<e.length;v++){const ct=e[v];if(!H(ct))break;if(ct.controlComponent===s.ControlComponent.VALUE||ct.controlComponent===s.ControlComponent.PLACEHOLDER)return v}return Math.max(0,W-1)};this.control.shrinkBoundary();const{startIndex:r,endIndex:a}=n,c=e[r],d=e[a],u=this.control.getDraw(),h=e[a+1];if(r===a){if(t.key===s.KeyMap.Backspace){const W=i(c)?r:i(e[r-1])?r-1:-1;if(W>=0)return l(W)}if(t.key===s.KeyMap.Delete){const W=i(c)?r:i(h)?a+1:-1;if(W>=0)return l(W)}}const R=this.options.mode===s.EditorMode.FORM,T=this.element.controlId||c.controlId,g=this.element.originControlId||c.originControlId||null,f=[];for(let W=0;W<e.length;W++){const K=e[W];K.controlId===T&&(K.originControlId||null)===g&&K.controlComponent===s.ControlComponent.VALUE&&f.push(W)}const C=!!(r!==a&&f.length&&r<f[0]&&a>=f[f.length-1]),p=W=>{if(!W)return null;const K=new Set;let k=W,B=null;for(;k&&!K.has(k);){K.add(k);let H;for(let A=0;A<e.length;A++){const v=e[A];if(v.controlId===k&&v.control?.type&&(H=v,v.controlComponent===s.ControlComponent.PREFIX||v.controlComponent===s.ControlComponent.PRE_TEXT||v.controlComponent===s.ControlComponent.PRETEXTFIX||v.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT))break}if(!H)break;(H.control?.type===s.ControlType.TEXT||this.options.mode===s.EditorMode.EDIT&&H.control?.type===s.ControlType.TEXTFIELD)&&(B=k),k=H.originControlId||null}return B},I=p(g),m=!!I,L=c.controlId===T&&(c.originControlId||null)===g,O=c.controlComponent===s.ControlComponent.VALUE,P=W=>{for(let K=r-1;K>=0;K--){const k=e[K];if(k.controlId===W&&!k.originControlId){if(k.controlComponent===s.ControlComponent.VALUE||k.controlComponent===s.ControlComponent.PLACEHOLDER)return K;if(k.controlComponent===s.ControlComponent.PREFIX||k.controlComponent===s.ControlComponent.PRE_TEXT||k.controlComponent===s.ControlComponent.PRETEXTFIX||k.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)break}if(k.controlId&&k.controlId!==W&&k.originControlId!==W)break}return-1},S=(W,K,k)=>{const B=A=>A?.controlId===K&&(A?.originControlId||null)===k;let H=-1;for(let A=W;A>=0;A--){const v=e[A];if(B(v)){if(v.controlComponent===s.ControlComponent.VALUE||v.controlComponent===s.ControlComponent.PLACEHOLDER)return A;if(v.controlComponent===s.ControlComponent.PREFIX||v.controlComponent===s.ControlComponent.PRE_TEXT||v.controlComponent===s.ControlComponent.PRETEXTFIX||v.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){H=A;break}}if(v.controlId&&v.controlId!==K&&v.originControlId!==K)break}for(let A=W+1;A<e.length;A++){const v=e[A];if(B(v)){if(v.controlComponent===s.ControlComponent.VALUE||v.controlComponent===s.ControlComponent.PLACEHOLDER)return A;if(v.controlComponent===s.ControlComponent.POSTFIX||v.controlComponent===s.ControlComponent.POST_TEXT||v.controlComponent===s.ControlComponent.POSTTEXTFIX||v.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){H===-1&&(H=A);break}}if(v.controlId&&v.controlId!==K&&v.originControlId!==K)break}return H>=0?H:W},Y=m&&L&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.TEXTFIXLABEL),b=e[a+1],M=!!b?.originControlId&&!!b?.controlId&&b.originControlId!==b.controlId&&(b.controlComponent===s.ControlComponent.PREFIX||b.controlComponent===s.ControlComponent.PRE_TEXT||b.controlComponent===s.ControlComponent.PRETEXTFIX||b.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||b.controlComponent===s.ControlComponent.PLACEHOLDER||b.controlComponent===s.ControlComponent.TEXTFIXLABEL),V=!!b?.originControlId&&!!b?.controlId&&b.originControlId!==b.controlId&&(b.controlComponent===s.ControlComponent.PREFIX||b.controlComponent===s.ControlComponent.PRE_TEXT||b.controlComponent===s.ControlComponent.PRETEXTFIX||b.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||b.controlComponent===s.ControlComponent.POSTFIX||b.controlComponent===s.ControlComponent.POST_TEXT||b.controlComponent===s.ControlComponent.POSTTEXTFIX||b.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||b.controlComponent===s.ControlComponent.PLACEHOLDER||b.controlComponent===s.ControlComponent.TEXTFIXLABEL),N=W=>this.options.mode===s.EditorMode.FORM?r:this.control.removeControl(W),X=c.controlComponent===s.ControlComponent.VALUE&&!c.originControlId&&!!b?.originControlId&&!!T&&p(b.originControlId)===T,D=W=>!!W&&W.controlId===c.controlId&&(W.originControlId||null)===(c.originControlId||null),E=W=>W?.controlComponent===s.ControlComponent.POSTFIX||W?.controlComponent===s.ControlComponent.POST_TEXT||W?.controlComponent===s.ControlComponent.POSTTEXTFIX||W?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT,U=()=>{const W=c.controlId,K=c.originControlId||null;return u.spliceElementList(e,r,1),e.some(B=>B.controlId===W&&(B.originControlId||null)===K&&B.controlComponent===s.ControlComponent.VALUE)||this.control.addPlaceholder(r-1),Math.max(r-1,0)},F=c.controlComponent===s.ControlComponent.VALUE&&!!c.originControlId&&D(b)&&E(b),Z=!!T&&!this.control.getIsExistValueByElementListIndex(e,r),Q=()=>{if(c.controlComponent!==s.ControlComponent.VALUE)return null;let W=r;for(let B=r;B>=0;B--){const H=e[B];if(!(H.controlId===c.controlId&&(H.originControlId||null)===(c.originControlId||null))||H.controlComponent!==s.ControlComponent.VALUE)break;if(!H.strikeout){W=B;break}}const K=e[W];if(!K||K.strikeout)return null;K.strikeout=!0,K.deletePerson="SWJ",K.deleteTime=lt(new Date).format("YYYY-MM-DD HH:mm:ss");let k=Math.max(W-1,0);for(let B=W-1;B>=0;B--){const H=e[B];if(!(H.controlId===K.controlId&&(H.originControlId||null)===(K.originControlId||null))){k=B;break}if(H.controlComponent!==s.ControlComponent.VALUE){k=B;break}if(!H.strikeout){k=B;break}k=Math.max(B-1,0)}return this.draws.render({curIndex:k,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),queueMicrotask(()=>{this.ranges.setRange(k,k),this.draws.setCursor(k)}),k};if(t.key===s.KeyMap.Backspace){if(r===a&&Z&&(c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))return r;if(R&&r===a&&I&&!L&&(c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)){const K=P(I);return K>=0?K:r}if(r===a&&Y&&!(R&&c.controlComponent===s.ControlComponent.VALUE&&!c.originControlId))return N(r);if(this.options.mode===s.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&!C&&(!m||O)){if(r===a&&c.controlComponent===s.ControlComponent.VALUE){const K=Q();if(K!==null)return K}return r===a&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER)?r:this.strikeout()}else{if(r===a&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER))return r;if(r!==a){u.spliceElementList(e,r+1,a-r);const K=e[r+1];return(K?.controlComponent===s.ControlComponent.POSTFIX||K?.controlComponent===s.ControlComponent.POST_TEXT||K?.controlComponent===s.ControlComponent.POSTTEXTFIX||K?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(r),r===0&&e[0].type===s.ElementType.SPLIT_TAG?u.fixPosition(!0)??r:r}else{const K=e[r-1],k=e[r+1];return!c.originControlId&&K?.controlId===c.controlId&&K?.originControlId===c.originControlId&&K?.controlComponent===s.ControlComponent.VALUE&&(c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&this.options.mode!==s.EditorMode.FORM?(u.spliceElementList(e,r-1,1),this.getValue().length||this.control.addPlaceholder(r-2),r-2):E(k)?k.originControlId?F?U():X?(u.spliceElementList(e,r,1),this.getValue().length||this.control.addPlaceholder(r-1),S(Math.max(r-1,0),c.controlId,c.originControlId||null)):N(r):(u.spliceElementList(e,r,1),this.control.addPlaceholder(r-1),S(Math.max(r-1,0),c.controlId,c.originControlId||null)):(u.spliceElementList(e,r,1),r===1&&e[0].type===s.ElementType.SPLIT_TAG||r===0?u.fixPosition(!0)??r-1:S(Math.max(r-1,0),c.controlId,c.originControlId||null))}}}else if(t.key===s.KeyMap.Delete){if(r===a&&Z&&(c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))return a;if(r===a&&(M||V)){if(X){const B=e[a+1];if(B?.controlComponent===s.ControlComponent.VALUE&&B.controlId===c.controlId&&!B.originControlId)return u.spliceElementList(e,a+1,1),this.getValue().length||this.control.addPlaceholder(r),r}return N(a+1)}const W=e[a+1],K=!!c.originControlId;if(this.options.mode===s.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&!C&&(!K||c.controlComponent===s.ControlComponent.VALUE))return d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POST_TEXT||d.controlComponent===s.ControlComponent.POSTTEXTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER?a:r===a&&(W?.controlComponent===s.ControlComponent.POSTFIX||W?.controlComponent===s.ControlComponent.POST_TEXT||W?.controlComponent===s.ControlComponent.POSTTEXTFIX||W?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)?W.originControlId?X?(u.spliceElementList(e,r+1,1),this.getValue().length||this.control.addPlaceholder(r),r):N(r+1):(u.spliceElementList(e,r+1,1),this.control.addPlaceholder(r),r):this.strikeout();{const B=e[a+1];if(c.controlComponent===s.ControlComponent.PLACEHOLDER)return a;if(r===a&&(B?.controlComponent===s.ControlComponent.POSTFIX||B?.controlComponent===s.ControlComponent.POST_TEXT||B?.controlComponent===s.ControlComponent.POSTTEXTFIX||B?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))return B.originControlId?X?(u.spliceElementList(e,r+1,1),this.getValue().length||this.control.addPlaceholder(r),r):N(r+1):(u.spliceElementList(e,r+1,1),this.control.addPlaceholder(r),r);if(r!==a){u.spliceElementList(e,r+1,a-r);const H=e[r+1];return E(H)&&this.control.addPlaceholder(r),r===0&&e[0].type===s.ElementType.SPLIT_TAG?u.fixPosition(!0)??r:r}else return B?(u.spliceElementList(e,r+1,1),r===0&&e[0].type===s.ElementType.SPLIT_TAG?u.fixPosition(!0)??r:r):(u.getTd()?.linkTdNextId&&c.controlId&&this.removeNextControlElement(c.controlId),a)}}return a}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();n.spliceElementList(i,t+1,e-t);const l=i[t+1];return(l?.controlComponent===s.ControlComponent.POSTFIX||l?.controlComponent===s.ControlComponent.POST_TEXT||l?.controlComponent===s.ControlComponent.POSTTEXTFIX||l?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(t),t}strikeout(t){const e=this.control.getRange(),{endIndex:n}=e,{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draws.isReadonly()||this.draws.isDisabled()))return null;const r=this.ranges.getSelectionElementList(),a=this.position.getCursorPosition(),c=lt(new Date).format("YYYY-MM-DD HH:mm:ss"),d=R=>{queueMicrotask(()=>{this.ranges.setRange(R,R),this.draws.setCursor(R)})},u=R=>{const T=this.control.getElementList(),g=T[R],f=g?.controlId,C=g?.originControlId||null;let p=-1;for(let I=R-1;I>=0;I--){const m=T[I];if(m.controlId===f&&(m.originControlId||null)===C&&m.controlComponent===s.ControlComponent.VALUE)return I;if(C){if(m.controlId&&m.controlId!==f&&m.originControlId!==C)break}else{if(m.controlId===f&&(m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRE_TEXT||m.controlComponent===s.ControlComponent.PRETEXTFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)){p=I;break}if(m.controlId&&m.controlId!==f&&!m.originControlId)break;if(m.originControlId===f&&(m.controlComponent===s.ControlComponent.POSTFIX||m.controlComponent===s.ControlComponent.POST_TEXT||m.controlComponent===s.ControlComponent.POSTTEXTFIX||m.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))return I}}if(p>=0){const I=p+1,m=T[I];return m?.controlId===f&&(m.controlComponent===s.ControlComponent.PLACEHOLDER||m.controlComponent===s.ControlComponent.VALUE)?I:p}return R},h=R=>{const T=this.control.getElementList(),g=T[R];if(!g?.controlId||g.controlComponent===s.ControlComponent.VALUE&&(g.metrics?.width??0)>0)return R;for(let f=R+1;f<T.length;f++){const C=T[f];if(C.controlId!==g.controlId||(C.originControlId||null)!==(g.originControlId||null))break;if(C.controlComponent===s.ControlComponent.VALUE&&(C.metrics?.width??0)>0)return f}for(let f=R-1;f>=0;f--){const C=T[f];if(C.controlId!==g.controlId||(C.originControlId||null)!==(g.originControlId||null))break;if(C.controlComponent===s.ControlComponent.VALUE&&(C.metrics?.width??0)>0)return f}return R};if(r?.length){if(!this.element.strikeout){const R=r.findIndex(T=>!T.strikeout);return r.forEach(T=>{T.deletePerson="SWJ",T.deleteTime=c,T.strikeout=!!~R}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),this.control.getRange().endIndex??null}}else{const R=h(a.index),T=this.control.getElementList()[R],g=this.control.getElementList();if(!this.control.getElementList()[R].strikeout&&T?.metrics.width>0){this.control.getElementList()[R].strikeout=!0,this.control.getElementList()[R].deletePerson="SWJ",this.control.getElementList()[R].deleteTime=c;const f=u(R);return this.ranges.setRange(f,f),this.draws.render({curIndex:f,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),d(f),f??null}else if(n>=0&&n<g.length&&g[n]?.metrics?.width!==void 0&&g[n].metrics.width<=0&&!g[n]?.strikeout){g.splice(n,1);const f=n-1;return this.ranges.setRange(f,f),this.draws.render({curIndex:f,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),d(f),f??null}}return n??null}strikeoute(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:l}=this.ranges.getRange(),a=this.draws.getElementList()[l];this.ranges.setDefaultStyle({strikeout:a.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}class Nl{draw;options;now;dom;renderOptions;isDatePicker;pickDate;lang;constructor(t,e={}){this.draw=t,this.options=e,this.lang=this._getLang(),this.now=new Date,this.dom=this._createDom(),this.renderOptions=null,this.isDatePicker=!0,this.pickDate=null,this._bindEvent()}_createDom(){const t=document.createElement("div");t.classList.add(`${st}-date-container`),t.setAttribute(ve,s.EditorComponent.POPUP);const e=document.createElement("div");e.classList.add(`${st}-date-wrap`);const n=document.createElement("div");n.classList.add(`${st}-date-title`);const i=document.createElement("span");i.classList.add(`${st}-date-title__pre-year`),i.innerText="<<";const l=document.createElement("span");l.classList.add(`${st}-date-title__pre-month`),l.innerText="<";const r=document.createElement("span");r.classList.add(`${st}-date-title__now`);const a=document.createElement("span");a.classList.add(`${st}-date-title__next-month`),a.innerText=">";const c=document.createElement("span");c.classList.add(`${st}-date-title__next-year`),c.innerText=">>",n.append(i),n.append(l),n.append(r),n.append(a),n.append(c);const d=document.createElement("div");d.classList.add(`${st}-date-week`);const{weeks:{sun:u,mon:h,tue:R,wed:T,thu:g,fri:f,sat:C}}=this.lang;[u,h,R,T,g,f,C].forEach(V=>{const N=document.createElement("span");N.innerText=`${V}`,d.append(N)});const I=document.createElement("div");I.classList.add(`${st}-date-day`),e.append(n),e.append(d),e.append(I);const m=document.createElement("ul");m.classList.add(`${st}-time-wrap`);let L,O,P;[this.lang.hour,this.lang.minute,this.lang.second].forEach((V,N)=>{const X=document.createElement("li"),D=document.createElement("span");D.innerText=V,X.append(D);const E=document.createElement("ol"),U=N===0,F=N===1,Z=U?24:60;for(let Q=0;Q<Z;Q++){const W=document.createElement("li");W.innerText=`${String(Q).padStart(2,"0")}`,W.setAttribute("data-id",`${Q}`),E.append(W)}U?L=E:F?O=E:P=E,X.append(E),m.append(X)});const y=document.createElement("div");y.classList.add(`${st}-date-menu`);const Y=document.createElement("button");Y.classList.add(`${st}-date-menu__time`),Y.innerText=this.lang.timeSelect;const b=document.createElement("button");b.classList.add(`${st}-date-menu__now`),b.innerText=this.lang.now;const M=document.createElement("button");return M.classList.add(`${st}-date-menu__submit`),M.innerText=this.lang.confirm,y.append(Y),y.append(b),y.append(M),t.append(e),t.append(m),t.append(y),this.draw.getContainer().append(t),{container:t,dateWrap:e,datePickerWeek:d,timeWrap:m,title:{preYear:i,preMonth:l,now:r,nextMonth:a,nextYear:c},day:I,time:{hour:L,minute:O,second:P},menu:{time:Y,now:b,submit:M}}}_bindEvent(){this.dom.title.preYear.onclick=()=>{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,l=this.draw.getHeight(),r=this.draw.getPageGap(),c=(i??this.draw.getPageNo())*(l+r);this.dom.container.style.left=`${t}px`,this.dom.container.style.top=`${e+c+n}px`}isInvalidDate(t){return t.toDateString()==="Invalid Date"}_setValue(){const t=this.renderOptions?.value;if(t){const e=new Date(t);this.now=this.isInvalidDate(e)?new Date:e}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:l,fri:r,sat:a}}=this.lang,c=[t,e,n,i,l,r,a];this.dom.datePickerWeek.childNodes.forEach((R,T)=>{const g=R;g.innerText=c[T]});const d=this.dom.time.hour.previousElementSibling;d.innerText=this.lang.hour;const u=this.dom.time.minute.previousElementSibling;u.innerText=this.lang.minute;const h=this.dom.time.second.previousElementSibling;h.innerText=this.lang.second}_update(){const t=new Date,e=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();let l=null,r=null,a=null;this.pickDate&&(l=this.pickDate.getFullYear(),r=this.pickDate.getMonth()+1,a=this.pickDate.getDate());const c=this.now.getFullYear(),d=this.now.getMonth()+1;this.dom.title.now.innerText=`${c}${this.lang.year} ${String(d).padStart(2,"0")}${this.lang.month}`;const h=new Date(c,d,0).getDate();let R=new Date(c,d-1,1).getDay();R===0&&(R=7);const T=new Date(c,d-1,0).getDate();this.dom.day.innerHTML="";const g=T-R+1;for(let C=g;C<=T;C++){const p=document.createElement("div");p.classList.add("disable"),p.innerText=`${C}`,p.onclick=()=>{const I=d-2;this.now=new Date(c,I,C),this._setDatePick(c,I,C)},this.dom.day.append(p)}for(let C=1;C<=h;C++){const p=document.createElement("div");e===c&&n===d&&i===C&&p.classList.add("active"),this.pickDate&&l===c&&r===d&&a===C&&p.classList.add("select"),p.innerText=`${C}`,p.onclick=I=>{const m=d-1;this.now=new Date(c,m,C),this._setDatePick(c,m,C),I.stopPropagation()},this.dom.day.append(p)}const f=42-R-h;for(let C=1;C<=f;C++){const p=document.createElement("div");p.classList.add("disable"),p.innerText=`${C}`,p.onclick=()=>{this.now=new Date(c,d,C),this._setDatePick(c,d,C)},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){this.now=new Date(t,e,n),this.pickDate?.setFullYear(t),this.pickDate?.setMonth(e),this.pickDate?.setDate(n),this._update()}_setTimePick(t=!0){const e=this.pickDate?.getHours()||0,n=this.pickDate?.getMinutes()||0,i=this.pickDate?.getSeconds()||0,{hour:l,minute:r,second:a}=this.dom.time;[l,r,a].forEach(u=>{u.querySelectorAll("li").forEach(h=>h.classList.remove("active"))}),[[l,e],[r,n],[a,i]].forEach(([u,h])=>{const R=u.querySelector(`[data-id='${h}']`);R.classList.add("active"),t&&Pi(u,R)})}_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(){if(this.options.onSubmit&&this.pickDate){const t=this.renderOptions?.dateFormat,e=this.formatDate(this.pickDate,t);this.options.onSubmit(e)}}formatDate(t,e="YYYY-MM-DD HH:mm:ss"){let n=e;const i=t.getFullYear().toString(),l=(t.getMonth()+1).toString(),r=t.getDate().toString(),a=t.getHours(),c=a%12===0?12:a%12,d=t.getMinutes().toString(),u=t.getSeconds().toString(),h=t.getMilliseconds().toString(),R={"y+":i,"Y+":i,"M+":l,"d+":r,"D+":r,"h+":c.toString(),"H+":a.toString(),"m+":d,"s+":u,"S+":h};for(const T in R){const g=new RegExp("("+T+")").exec(e),f=T;g&&(n=n.replace(g[1],g[1].length===1?R[f]:R[f].padStart(g[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 Lo{draw;element;control;isPopup;datePicker;options;constructor(t,e){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}getValue(t={}){const e=t.elementList||this.control.getElementList(),n=this.control.getValueRange(t);if(!n)return[];const i=[],{startIndex:l,endIndex:r}=n;for(let a=l;a<=r;a++){const c=e[a];c.controlComponent===s.ControlComponent.VALUE&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:r,endIndex:a}=l,c=this.control.getDraw();r!==a?c.spliceElementList(i,r+1,a-r):this.control.removePlaceholder(r,{elementList:i});const d=i[r],u=d.type&&!Le.includes(d.type)||d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT?xt(d,["control","controlId",...ue]):Ee(d,["type"]),h=l.startIndex+1;for(let R=0;R<t.length;R++){const T={...u,...t[R],controlComponent:s.ControlComponent.VALUE};le(i,[T],r,{editorOptions:this.options}),c.spliceElementList(i,h+R,0,[T])}return h+t.length-1}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const l=this.control.getValueRange(t);if(!l)return-1;const{startIndex:r,endIndex:a}=l;if(!~r||!~a)return-1;const c=t.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(c,r+1,a-r,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(r,t),r}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const i=e.elementList||this.control.getElementList(),l=e.range||this.control.getRange(),r=this.getValue(e)[0],a=r?xt(r,Ne):xt(i[l.startIndex],ue),c=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~c)return;const d=Ee(i[c],Ne),u=c+1,h=this.control.getDraw();for(let R=0;R<t.length;R++){const T={...a,...d,type:s.ElementType.TEXT,value:t[R],controlComponent:s.ControlComponent.VALUE};(T.color===this.options.control.bracketColor||T.color===this.options.control.placeholderColor)&&(T.color=this.options.defaultColor),le(i,[T],c,{editorOptions:this.options}),h.spliceElementList(i,u+R,0,[T])}if(!e.range){const R=u+t.length-1;this.control.repaintControl({curIndex:R}),this.control.emitControlContentChange({context:e}),this.destroy()}}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:l}=n,r=e[i],a=e[l],c=this.control.getDraw();if(t.key===s.KeyMap.Backspace)return i!==l?(c.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT||a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT||r.controlComponent===s.ControlComponent.PLACEHOLDER?this.control.removeControl(i):(c.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(t.key===s.KeyMap.Delete){if(i!==l)return c.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i;{const d=e[l+1];return(r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT)&&d.controlComponent===s.ControlComponent.PLACEHOLDER||d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POST_TEXT||r.controlComponent===s.ControlComponent.PLACEHOLDER?this.control.removeControl(i):(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}}return l}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const t=this.control.getPosition();if(!t)return;const e=this.draw.getElementList(),{startIndex:n}=this.control.getRange();if(e[n+1]?.controlId!==this.element.controlId)return;this.datePicker=new Nl(this.draw,{onSubmit:this._setDate.bind(this)});const i=this.getValue().map(r=>r.value).join("")||"",l=this.element.control?.dateFormat;this.datePicker.render({value:i,position:t,dateFormat:l}),this.isPopup=!0}destroy(){this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}_setDate(t){t?this.setSelect(t):this.clearSelect(),this.destroy()}}class ci extends Vs{isPopup;inputPopup;constructor(t,e){super(t,e),this.isPopup=!1,this.inputPopup=null}getIsPopup(){return this.isPopup}setValue(t,e={},n={}){if(t.some(I=>!Fc(I)))return-1;const i=e.elementList||this.control.getElementList(),l=e.range||this.control.getRange();this.control.shrinkBoundary(e);const r=rt(t),{startIndex:a,endIndex:c}=l,d=i[a];let u=null;for(let I=a;I>=0;I--)if(i[I].controlComponent===s.ControlComponent.PREFIX){u=i[I];break}const h=u?.control||this.element.control;if(this.control.getIsExistValueByElementListIndex(i,a)){let I=a;for(;I>0;){const L=i[I];if(L.controlId!==d.controlId||L.controlComponent===s.ControlComponent.PREFIX||L.controlComponent===s.ControlComponent.PRE_TEXT)break;r.unshift(L),I--}let m=c+1;for(;m<i.length;){const L=i[m];if(L.controlId!==d.controlId||L.controlComponent===s.ControlComponent.POSTFIX||L.controlComponent===s.ControlComponent.POST_TEXT)break;r.push(L),m++}}const R=Rr(r);if(!/^[+-]?(?:\d+)?(?:\.\d*)?(?:[eE][+-]?\d*)?$/.test(R))return-1;const g=h?.numberExclusiveOptions,f=g?.maxLength??null,C=g?.decimalPlaces??null,p=R.replace(/[+\-.eE]/g,"").length;if(f!=null&&p>f||C!=null&&(R.split(/[eE]/)[0].split(".")[1]||"").length>C)return-1;if(e.range||e.elementList){const I=Number(R),m=g?.minValue,L=g?.maxValue;if(!Number.isFinite(I)||m!=null&&I<m||L!=null&&I>L)return-1}return super.setValue(t,e,n)}_setNumberValue(t){const e=this.control.getElementList(),n=this.control.getRange(),{startIndex:i}=n;let l=null;for(let S=i;S>=0;S--)if(e[S].controlComponent===s.ControlComponent.PREFIX){l=e[S];break}const a=(l?.control||this.element.control)?.numberExclusiveOptions,c=a?.minValue,d=a?.maxValue,u=a?.minLength,h=a?.maxLength,R=t.trim(),T=R.replace(/[+\-.eE]/g,"").length,g=Number(R);if(u!=null&&T<u||h!=null&&T>h||c!=null&&g<c||d!=null&&g>d)return!1;let f=i;for(let S=i;S>=0;S--)if(e[S].controlComponent===s.ControlComponent.PREFIX){f=S;break}let C=f+1;for(let S=f+1;S<e.length;S++)if(e[S].controlComponent===s.ControlComponent.POSTFIX){C=S;break}const p=this.options.mode===s.EditorMode.FORM,I=p&&this.options.modeRule.form.inputTraceEnabled,m=p&&this.options.modeRule.form.deleteTraceEnabled,L=lt(new Date).format("YYYY-MM-DD HH:mm:ss");if(m)for(let S=f+1;S<C;S++){const y=e[S];y.controlComponent===s.ControlComponent.VALUE&&!y.strikeout&&y.value&&(y.strikeout=!0,y.deletePerson="SYSTEM",y.deleteTime=L),y.controlComponent===s.ControlComponent.PLACEHOLDER&&(this.control.getDraw().spliceElementList(e,S,1),C--,S--)}else{const S=f+1,y=C-S;y>0&&this.control.getDraw().spliceElementList(e,S,y),C=f+1}C=f+1;for(let S=f+1;S<e.length;S++)if(e[S].controlComponent===s.ControlComponent.POSTFIX){C=S;break}const O=[];for(let S=0;S<R.length;S++){const y={type:s.ElementType.TEXT,value:R[S],controlComponent:s.ControlComponent.VALUE,controlId:e[f].controlId,originControlId:e[f].originControlId,control:e[f].control};I&&(y.textDecoration={style:s.TextDecorationStyle.DOUBLE},y.underline=!0),O.push(y)}for(let S=0;S<O.length;S++)this.control.getDraw().spliceElementList(e,C+S,0,[O[S]]);const P=C+O.length-1;return this.control.getDraw().getRange().setRange(P,P),this.control.emitControlContentChange(),this.control.repaintControl({curIndex:P}),!0}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const t=this.control.getElementList(),e=this.control.getRange(),{startIndex:n}=e,i=t[n];if(!i||i.controlId!==this.element.controlId)return;let l=null;for(let g=n;g>=0;g--)if(t[g].controlComponent===s.ControlComponent.PREFIX){l=t[g];break}const r=l?.control||this.element.control,c=this.getValue().filter(g=>!g.strikeout),d=c.length>0?Rr(c):"",u=r?.numberExclusiveOptions,h=u?.minValue,R=u?.maxValue,T=u?.decimalPlaces;this.inputPopup=new iT({control:this.control,currentValue:d,minValue:h,maxValue:R,decimalPlaces:T,onConfirm:g=>{if(!g||g.trim()==="")return this._clearNumberValue(),!0;const f=Number(g);return Number.isNaN(f)||!Number.isFinite(f)?!1:this._setNumberValue(g)},onTab:g=>{this.destroy(),setTimeout(()=>{this.control.initNextControl({direction:g})})},onClose:()=>{this.destroy()}}),this.inputPopup.create(),this.isPopup=!0}_clearNumberValue(){const t=this.control.getElementList(),e=this.control.getRange(),{startIndex:n}=e;let i=n;for(let c=n;c>=0;c--)if(t[c].controlComponent===s.ControlComponent.PREFIX){i=c;break}let l=i+1;for(let c=i+1;c<t.length;c++)if(t[c].controlComponent===s.ControlComponent.POSTFIX){l=c;break}const r=i+1,a=l-r;a>0&&this.control.getDraw().spliceElementList(t,r,a),this.control.addPlaceholder(i),this.control.getDraw().getRange().setRange(i,i),this.control.emitControlContentChange(),this.control.repaintControl({curIndex:i})}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:l}=n,r=e[i],a=e[l],c=this.control.getDraw(),d=c.getMode()===s.EditorMode.FORM;if(t.key==="Backspace")return r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT||r.controlComponent===s.ControlComponent.PLACEHOLDER?d?i:this.control.removeControl(i):a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT?i:i!==l?(c.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):(c.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(t.key==="Delete"){const u=e[l+1];return r.controlComponent===s.ControlComponent.PLACEHOLDER||a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT?d?l:this.control.removeControl(i):r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT||u?.controlComponent===s.ControlComponent.POSTFIX||u?.controlComponent===s.ControlComponent.POST_TEXT?l:i!==l?(c.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}return l}destroy(){this.inputPopup&&(this.inputPopup.destroy(),this.inputPopup=null),this.isPopup=!1}}class iT{options;popupDom;constructor(t){this.options=t,this.popupDom=null}create(){const{currentValue:t,minValue:e,maxValue:n,decimalPlaces:i,onConfirm:l,onTab:r,onClose:a}=this.options,c=document.createElement("div");c.classList.add(`${st}-number-input-modal`),c.setAttribute(ve,s.EditorComponent.POPUP);const d=m=>{if(m.type==="mouseup"){const L=this.options.control.getDraw().getCanvasEvent();L.setIsAllowDrag(!1),L.setIsAllowSelection(!1)}m.stopPropagation()};c.addEventListener("mousedown",d),c.addEventListener("mouseup",d),c.addEventListener("click",d),c.addEventListener("keydown",d),c.addEventListener("input",d);const u=document.createElement("div");u.classList.add(`${st}-number-input-modal__content`);const h=document.createElement("div");if(h.classList.add(`${st}-number-input-modal__title`),h.textContent="请输入数值",u.appendChild(h),e!==void 0||n!==void 0){const m=document.createElement("div");m.classList.add(`${st}-number-input-modal__hint`);let L="有效范围:";e!==void 0&&n!==void 0?L+=`${e} ~ ${n}`:e!==void 0?L+=`≥ ${e}`:L+=`≤ ${n}`,i!=null&&(L+=`,保留${i}位小数`),m.textContent=L,u.appendChild(m)}const R=document.createElement("input");R.classList.add(`${st}-number-input-modal__input`),R.type="number",R.value=t,R.placeholder="请输入数值",e!==void 0&&(R.min=String(e)),n!==void 0&&(R.max=String(n)),i!=null&&(R.step=(1/Math.pow(10,i)).toString()),setTimeout(()=>{R.focus(),R.select()},100),u.appendChild(R);const T=document.createElement("div");T.classList.add(`${st}-number-input-modal__error`),T.style.display="none",u.appendChild(T);const g=document.createElement("div");g.classList.add(`${st}-number-input-modal__buttons`);const f=document.createElement("button");f.classList.add(`${st}-number-input-modal__cancel`),f.textContent="取消",f.onclick=()=>{a()},g.appendChild(f);const C=document.createElement("button");C.classList.add(`${st}-number-input-modal__confirm`),C.textContent="确定";const p=()=>{const m=R.value.trim();if(!m)return l("");const L=parseFloat(m);return Number.isNaN(L)||!Number.isFinite(L)?(T.textContent="请输入有效的数值",T.style.display="block",!1):i!=null&&(m.split(".")[1]||"").length>i?(T.textContent=`小数位数不能超过${i}位`,T.style.display="block",!1):e!==void 0&&L<e?(T.textContent=`数值不能小于 ${e}`,T.style.display="block",!1):n!==void 0&&L>n?(T.textContent=`数值不能大于 ${n}`,T.style.display="block",!1):(T.style.display="none",l(m))};C.onclick=()=>{p()&&a()},g.appendChild(C),u.appendChild(g),c.appendChild(u),R.onkeydown=m=>{m.key==="Enter"?C.click():m.key==="Tab"?(m.preventDefault(),p()&&(a(),r(m.shiftKey?zt.UP:zt.DOWN))):m.key==="Escape"&&a()},this.options.control.getContainer().appendChild(c),this.popupDom=c}destroy(){this.popupDom&&(this.popupDom.remove(),this.popupDom=null)}}class sT{options;mask;container;inputList;optionItemContainers;data;constructor(t){this.options=t,this.mask=null,this.container=null,this.inputList=[],this.optionItemContainers=[],this.data=t.data,this._render()}_getFieldValue(t){const e=this.inputList.filter(n=>n.name===t);if(e.length!==0){for(const n of e)if(n instanceof HTMLInputElement&&n.type==="radio"&&n.checked)return n.value;return e[0].value}}_updateFieldVisibility(){this.data.forEach((t,e)=>{if(t.visibleWhen){const{field:n,value:i}=t.visibleWhen,l=this._getFieldValue(n),r=this.optionItemContainers[e];if(r){const a=l===i;r.style.display=a?"":"none"}}})}_render(){const{title:t,onClose:e,onCancel:n,onConfirm:i}=this.options,l=document.createElement("div");l.classList.add("dialog-mask"),l.setAttribute(ve,s.EditorComponent.COMPONENT),document.body.append(l);const r=document.createElement("div");r.classList.add("dialog-container"),r.setAttribute(ve,s.EditorComponent.COMPONENT);const a=document.createElement("div");a.classList.add("dialog"),r.append(a);const c=document.createElement("div");c.classList.add("dialog-title");const d=document.createElement("span");d.append(document.createTextNode(t));const u=document.createElement("i");u.onclick=()=>{e&&e(),this._dispose()},c.append(d),c.append(u),a.append(c);const h=document.createElement("div");h.classList.add("dialog-option");for(let f=0;f<this.data.length;f++){const C=this.data[f],p=document.createElement("div");if(p.classList.add("dialog-option__item"),C.visible===!1&&(p.style.display="none"),C.label){const I=document.createElement("span");I.append(document.createTextNode(C.label)),p.append(I),C.required&&I.classList.add("dialog-option__item--require")}if(C.type==="radio"){const I=document.createElement("div");I.classList.add("dialog-radio-group"),C.horizontal&&I.classList.add("dialog-radio-group--horizontal"),C.options?.forEach(m=>{const L=document.createElement("label");L.classList.add("dialog-radio-item");const O=document.createElement("input");O.type="radio",O.name=C.name,O.value=m.value,m.value===(C.value||"")&&(O.checked=!0);const P=document.createElement("span");P.textContent=m.label,L.append(O),L.append(P),I.append(L),O.addEventListener("change",()=>{this._updateFieldVisibility()}),this.inputList.push(O)}),p.append(I)}else if(C.type==="select"){const I=document.createElement("select"),m=C.value||"";C.options?.forEach(L=>{const O=document.createElement("option");O.value=L.value,O.label=L.label,L.value===m&&(O.selected=!0),I.append(O)}),I.name=C.name,I.value=m,I.addEventListener("change",()=>{this._updateFieldVisibility()}),C.width&&(I.style.width=`${C.width}px`),p.append(I),this.inputList.push(I)}else if(C.type==="textarea"){const I=document.createElement("textarea");I.name=C.name,I.value=C.value||"",I.placeholder=C.placeholder||"",C.width&&(I.style.width=`${C.width}px`),C.height&&(I.style.height=`${C.height}px`),p.append(I),this.inputList.push(I)}else{const I=document.createElement("input");I.type=C.type,I.name=C.name,I.value=C.value||"",I.placeholder=C.placeholder||"",C.width&&(I.style.width=`${C.width}px`),C.height&&(I.style.height=`${C.height}px`),p.append(I),this.inputList.push(I)}h.append(p),this.optionItemContainers.push(p)}a.append(h);const R=document.createElement("div");R.classList.add("dialog-menu");const T=document.createElement("button");T.classList.add("dialog-menu__cancel"),T.append(document.createTextNode("取消")),T.type="button",T.onclick=()=>{n&&n(),this._dispose()},R.append(T);const g=document.createElement("button");g.append(document.createTextNode("确定")),g.type="submit",g.onclick=()=>{if(i){const f=new Set,C=[];for(const p of this.inputList)if(!f.has(p.name))if(p instanceof HTMLInputElement&&p.type==="radio"){const I=this.inputList.find(m=>m.name===p.name&&m instanceof HTMLInputElement&&m.checked);I&&(C.push({name:p.name,value:I.value}),f.add(p.name))}else C.push({name:p.name,value:p.value}),f.add(p.name);i(C)}this._dispose()},R.append(g),a.append(R),document.body.append(r),this.container=r,this.mask=l,this._updateFieldVisibility()}_dispose(){this.mask?.remove(),this.container?.remove()}}function rT(o,t){const e=o.trim();if(!e)return;const n=t?.key===e;return{...n?t:{},key:e,label:n&&t?.label?t.label:e,writeTarget:t?.writeTarget||"self",writeMode:t?.writeMode||"replaceOnConfirm"}}class Nn{draw;element;control;isPopup;datePicker;options;range;static isDeleting=!1;inputModal=null;constructor(t,e){const n=e.getDraw();this.draw=n,this.range=n.getRange(),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}getValue(t={}){const e=t.elementList||this.control.getElementList(),n=this.control.getValueRange(t);if(!n)return[];const i=[],{startIndex:l,endIndex:r}=n;for(let a=l;a<=r;a++){const c=e[a];c.controlComponent===s.ControlComponent.VALUE&&!me(c)&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&(this.control.getIsDisabledControl(e)||this.element.control?.editable===!1))return-1;const i=e.elementList||this.control.getElementList(),l=e.range||this.control.getRange(),{startIndex:r,endIndex:a}=l,c=i[r],d=this.element.controlId||c.controlId,u=this.element.originControlId||c.originControlId||null;if(!d)return-1;const h=this.getButtonControlBounds(i,d,u);if(!h)return-1;const R=this.getButtonBusinessOffset(i,h,r),T=this.getButtonBusinessOffset(i,h,a),g=this.getButtonBusinessElements(i,h),f=this.splitButtonBusinessElements(t),C=[...g.slice(0,R),...f,...g.slice(T)];return this.replaceButtonBusinessElements(i,h,C,R+f.length)}isSameButtonElement(t,e,n){return!!(t&&t.controlId===e&&(t.originControlId||null)===n)}getButtonControlBounds(t,e,n){let i=-1,l=-1;for(let r=0;r<t.length;r++){const a=t[r];this.isSameButtonElement(a,e,n)&&(i===-1&&a.controlComponent===s.ControlComponent.PREFIX&&(i=r),a.controlComponent===s.ControlComponent.POSTFIX&&(l=r))}return i===-1||l===-1?null:{controlId:e,originControlId:n,prefixIndex:i,postfixIndex:l}}getButtonBusinessOffset(t,e,n){let i=0;const l=Math.min(n,e.postfixIndex-1);for(let r=e.prefixIndex+1;r<=l;r++){const a=t[r];this.isSameButtonElement(a,e.controlId,e.originControlId)&&a.controlComponent===s.ControlComponent.VALUE&&!me(a)&&i++}return i}toButtonBusinessElement(t){const e={value:t.value===`
125
- `?_:t.value||""};return[...ce,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"].forEach(i=>{const l=t[i];l!==void 0&&(e[i]=l)}),e}splitButtonBusinessElements(t){const e=[];return t.forEach(n=>{me(n)||Nt(n.value===_?`
124
+ `+new Error().stack),e=!1}return t.apply(this,arguments)},t)}var vr={};function Zr(o,t){lt.deprecationHandler!=null&&lt.deprecationHandler(o,t),vr[o]||(wr(t),vr[o]=!0)}lt.suppressDeprecationWarnings=!1,lt.deprecationHandler=null;function ke(o){return typeof Function<"u"&&o instanceof Function||Object.prototype.toString.call(o)==="[object Function]"}function su(o){var t,e;for(e in o)Ht(o,e)&&(t=o[e],ke(t)?this[e]=t:this["_"+e]=t);this._config=o,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function ss(o,t){var e=gn({},o),n;for(n in t)Ht(t,n)&&(Dn(o[n])&&Dn(t[n])?(e[n]={},gn(e[n],o[n]),gn(e[n],t[n])):t[n]!=null?e[n]=t[n]:delete e[n]);for(n in o)Ht(o,n)&&!Ht(t,n)&&Dn(o[n])&&(e[n]=gn({},e[n]));return e}function rs(o){o!=null&&this.set(o)}var ls;Object.keys?ls=Object.keys:ls=function(o){var t,e=[];for(t in o)Ht(o,t)&&e.push(t);return e};var ru={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function lu(o,t,e){var n=this._calendar[o]||this._calendar.sameElse;return ke(n)?n.call(t,e):n}function Ge(o,t,e){var n=""+Math.abs(o),i=t-n.length,l=o>=0;return(l?e?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var as=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,_o=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,cs={},xn={};function mt(o,t,e,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),o&&(xn[o]=i),t&&(xn[t[0]]=function(){return Ge(i.apply(this,arguments),t[1],t[2])}),e&&(xn[e]=function(){return this.localeData().ordinal(i.apply(this,arguments),o)})}function au(o){return o.match(/\[[\s\S]/)?o.replace(/^\[|\]$/g,""):o.replace(/\\/g,"")}function cu(o){var t=o.match(as),e,n;for(e=0,n=t.length;e<n;e++)xn[t[e]]?t[e]=xn[t[e]]:t[e]=au(t[e]);return function(i){var l="",r;for(r=0;r<n;r++)l+=ke(t[r])?t[r].call(i,o):t[r];return l}}function Bo(o,t){return o.isValid()?(t=Qr(t,o.localeData()),cs[t]=cs[t]||cu(t),cs[t](o)):o.localeData().invalidDate()}function Qr(o,t){var e=5;function n(i){return t.longDateFormat(i)||i}for(_o.lastIndex=0;e>=0&&_o.test(o);)o=o.replace(_o,n),_o.lastIndex=0,e-=1;return o}var du={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function uu(o){var t=this._longDateFormat[o],e=this._longDateFormat[o.toUpperCase()];return t||!e?t:(this._longDateFormat[o]=e.match(as).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[o])}var hu="Invalid date";function Ru(){return this._invalidDate}var gu="%d",Tu=/\d{1,2}/;function fu(o){return this._ordinal.replace("%d",o)}var mu={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Cu(o,t,e,n){var i=this._relativeTime[e];return ke(i)?i(o,t,e,n):i.replace(/%d/i,o)}function pu(o,t){var e=this._relativeTime[o>0?"future":"past"];return ke(e)?e(t):e.replace(/%s/i,t)}var Kr={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Xe(o){return typeof o=="string"?Kr[o]||Kr[o.toLowerCase()]:void 0}function ds(o){var t={},e,n;for(n in o)Ht(o,n)&&(e=Xe(n),e&&(t[e]=o[n]));return t}var Iu={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Eu(o){var t=[],e;for(e in o)Ht(o,e)&&t.push({unit:e,priority:Iu[e]});return t.sort(function(n,i){return n.priority-i.priority}),t}var Hr=/\d/,Pe=/\d\d/,Ar=/\d{3}/,us=/\d{4}/,ko=/[+-]?\d{6}/,oe=/\d\d?/,_r=/\d\d\d\d?/,Br=/\d\d\d\d\d\d?/,Go=/\d{1,3}/,hs=/\d{1,4}/,xo=/[+-]?\d{1,6}/,Jn=/\d+/,Jo=/[+-]?\d+/,Lu=/Z|[+-]\d\d:?\d\d/gi,$o=/Z|[+-]\d\d(?::?\d\d)?/gi,Pu=/[+-]?\d+(\.\d{1,3})?/,Ro=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,$n=/^[1-9]\d?/,Rs=/^([1-9]\d|\d)/,zo;zo={};function dt(o,t,e){zo[o]=ke(t)?t:function(n,i){return n&&e?e:t}}function Mu(o,t){return Ht(zo,o)?zo[o](t._strict,t._locale):new RegExp(Ou(o))}function Ou(o){return tn(o.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,l){return e||n||i||l}))}function tn(o){return o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ye(o){return o<0?Math.ceil(o)||0:Math.floor(o)}function Yt(o){var t=+o,e=0;return t!==0&&isFinite(t)&&(e=ye(t)),e}var gs={};function Jt(o,t){var e,n=t,i;for(typeof o=="string"&&(o=[o]),qe(t)&&(n=function(l,r){r[t]=Yt(l)}),i=o.length,e=0;e<i;e++)gs[o[e]]=n}function go(o,t){Jt(o,function(e,n,i,l){i._w=i._w||{},t(e,i._w,i,l)})}function Su(o,t,e){t!=null&&Ht(gs,o)&&gs[o](t,e._a,e,o)}function jo(o){return o%4===0&&o%100!==0||o%400===0}var Te=0,en=1,xe=2,he=3,Ue=4,nn=5,Fn=6,Du=7,Fu=8;mt("Y",0,0,function(){var o=this.year();return o<=9999?Ge(o,4):"+"+o}),mt(0,["YY",2],0,function(){return this.year()%100}),mt(0,["YYYY",4],0,"year"),mt(0,["YYYYY",5],0,"year"),mt(0,["YYYYYY",6,!0],0,"year"),dt("Y",Jo),dt("YY",oe,Pe),dt("YYYY",hs,us),dt("YYYYY",xo,ko),dt("YYYYYY",xo,ko),Jt(["YYYYY","YYYYYY"],Te),Jt("YYYY",function(o,t){t[Te]=o.length===2?lt.parseTwoDigitYear(o):Yt(o)}),Jt("YY",function(o,t){t[Te]=lt.parseTwoDigitYear(o)}),Jt("Y",function(o,t){t[Te]=parseInt(o,10)});function To(o){return jo(o)?366:365}lt.parseTwoDigitYear=function(o){return Yt(o)+(Yt(o)>68?1900:2e3)};var kr=zn("FullYear",!0);function Xu(){return jo(this.year())}function zn(o,t){return function(e){return e!=null?(Gr(this,o,e),lt.updateOffset(this,t),this):fo(this,o)}}function fo(o,t){if(!o.isValid())return NaN;var e=o._d,n=o._isUTC;switch(t){case"Milliseconds":return n?e.getUTCMilliseconds():e.getMilliseconds();case"Seconds":return n?e.getUTCSeconds():e.getSeconds();case"Minutes":return n?e.getUTCMinutes():e.getMinutes();case"Hours":return n?e.getUTCHours():e.getHours();case"Date":return n?e.getUTCDate():e.getDate();case"Day":return n?e.getUTCDay():e.getDay();case"Month":return n?e.getUTCMonth():e.getMonth();case"FullYear":return n?e.getUTCFullYear():e.getFullYear();default:return NaN}}function Gr(o,t,e){var n,i,l,r,a;if(!(!o.isValid()||isNaN(e))){switch(n=o._d,i=o._isUTC,t){case"Milliseconds":return void(i?n.setUTCMilliseconds(e):n.setMilliseconds(e));case"Seconds":return void(i?n.setUTCSeconds(e):n.setSeconds(e));case"Minutes":return void(i?n.setUTCMinutes(e):n.setMinutes(e));case"Hours":return void(i?n.setUTCHours(e):n.setHours(e));case"Date":return void(i?n.setUTCDate(e):n.setDate(e));case"FullYear":break;default:return}l=e,r=o.month(),a=o.date(),a=a===29&&r===1&&!jo(l)?28:a,i?n.setUTCFullYear(l,r,a):n.setFullYear(l,r,a)}}function yu(o){return o=Xe(o),ke(this[o])?this[o]():this}function Nu(o,t){if(typeof o=="object"){o=ds(o);var e=Eu(o),n,i=e.length;for(n=0;n<i;n++)this[e[n].unit](o[e[n].unit])}else if(o=Xe(o),ke(this[o]))return this[o](t);return this}function bu(o,t){return(o%t+t)%t}var de;Array.prototype.indexOf?de=Array.prototype.indexOf:de=function(o){var t;for(t=0;t<this.length;++t)if(this[t]===o)return t;return-1};function Ts(o,t){if(isNaN(o)||isNaN(t))return NaN;var e=bu(t,12);return o+=(t-e)/12,e===1?jo(o)?29:28:31-e%7%2}mt("M",["MM",2],"Mo",function(){return this.month()+1}),mt("MMM",0,0,function(o){return this.localeData().monthsShort(this,o)}),mt("MMMM",0,0,function(o){return this.localeData().months(this,o)}),dt("M",oe,$n),dt("MM",oe,Pe),dt("MMM",function(o,t){return t.monthsShortRegex(o)}),dt("MMMM",function(o,t){return t.monthsRegex(o)}),Jt(["M","MM"],function(o,t){t[en]=Yt(o)-1}),Jt(["MMM","MMMM"],function(o,t,e,n){var i=e._locale.monthsParse(o,n,e._strict);i!=null?t[en]=i:Xt(e).invalidMonth=o});var Vu="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),xr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Jr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Wu=Ro,Uu=Ro;function Yu(o,t){return o?Ve(this._months)?this._months[o.month()]:this._months[(this._months.isFormat||Jr).test(t)?"format":"standalone"][o.month()]:Ve(this._months)?this._months:this._months.standalone}function wu(o,t){return o?Ve(this._monthsShort)?this._monthsShort[o.month()]:this._monthsShort[Jr.test(t)?"format":"standalone"][o.month()]:Ve(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function vu(o,t,e){var n,i,l,r=o.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)l=Be([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(l,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(l,"").toLocaleLowerCase();return e?t==="MMM"?(i=de.call(this._shortMonthsParse,r),i!==-1?i:null):(i=de.call(this._longMonthsParse,r),i!==-1?i:null):t==="MMM"?(i=de.call(this._shortMonthsParse,r),i!==-1?i:(i=de.call(this._longMonthsParse,r),i!==-1?i:null)):(i=de.call(this._longMonthsParse,r),i!==-1?i:(i=de.call(this._shortMonthsParse,r),i!==-1?i:null))}function Zu(o,t,e){var n,i,l;if(this._monthsParseExact)return vu.call(this,o,t,e);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=Be([2e3,n]),e&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!e&&!this._monthsParse[n]&&(l="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(l.replace(".",""),"i")),e&&t==="MMMM"&&this._longMonthsParse[n].test(o))return n;if(e&&t==="MMM"&&this._shortMonthsParse[n].test(o))return n;if(!e&&this._monthsParse[n].test(o))return n}}function $r(o,t){if(!o.isValid())return o;if(typeof t=="string"){if(/^\d+$/.test(t))t=Yt(t);else if(t=o.localeData().monthsParse(t),!qe(t))return o}var e=t,n=o.date();return n=n<29?n:Math.min(n,Ts(o.year(),e)),o._isUTC?o._d.setUTCMonth(e,n):o._d.setMonth(e,n),o}function zr(o){return o!=null?($r(this,o),lt.updateOffset(this,!0),this):fo(this,"Month")}function Qu(){return Ts(this.year(),this.month())}function Ku(o){return this._monthsParseExact?(Ht(this,"_monthsRegex")||jr.call(this),o?this._monthsShortStrictRegex:this._monthsShortRegex):(Ht(this,"_monthsShortRegex")||(this._monthsShortRegex=Wu),this._monthsShortStrictRegex&&o?this._monthsShortStrictRegex:this._monthsShortRegex)}function Hu(o){return this._monthsParseExact?(Ht(this,"_monthsRegex")||jr.call(this),o?this._monthsStrictRegex:this._monthsRegex):(Ht(this,"_monthsRegex")||(this._monthsRegex=Uu),this._monthsStrictRegex&&o?this._monthsStrictRegex:this._monthsRegex)}function jr(){function o(c,d){return d.length-c.length}var t=[],e=[],n=[],i,l,r,a;for(i=0;i<12;i++)l=Be([2e3,i]),r=tn(this.monthsShort(l,"")),a=tn(this.months(l,"")),t.push(r),e.push(a),n.push(a),n.push(r);t.sort(o),e.sort(o),n.sort(o),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Au(o,t,e,n,i,l,r){var a;return o<100&&o>=0?(a=new Date(o+400,t,e,n,i,l,r),isFinite(a.getFullYear())&&a.setFullYear(o)):a=new Date(o,t,e,n,i,l,r),a}function mo(o){var t,e;return o<100&&o>=0?(e=Array.prototype.slice.call(arguments),e[0]=o+400,t=new Date(Date.UTC.apply(null,e)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(o)):t=new Date(Date.UTC.apply(null,arguments)),t}function qo(o,t,e){var n=7+t-e,i=(7+mo(o,0,n).getUTCDay()-t)%7;return-i+n-1}function qr(o,t,e,n,i){var l=(7+e-n)%7,r=qo(o,n,i),a=1+7*(t-1)+l+r,c,d;return a<=0?(c=o-1,d=To(c)+a):a>To(o)?(c=o+1,d=a-To(o)):(c=o,d=a),{year:c,dayOfYear:d}}function Co(o,t,e){var n=qo(o.year(),t,e),i=Math.floor((o.dayOfYear()-n-1)/7)+1,l,r;return i<1?(r=o.year()-1,l=i+on(r,t,e)):i>on(o.year(),t,e)?(l=i-on(o.year(),t,e),r=o.year()+1):(r=o.year(),l=i),{week:l,year:r}}function on(o,t,e){var n=qo(o,t,e),i=qo(o+1,t,e);return(To(o)-n+i)/7}mt("w",["ww",2],"wo","week"),mt("W",["WW",2],"Wo","isoWeek"),dt("w",oe,$n),dt("ww",oe,Pe),dt("W",oe,$n),dt("WW",oe,Pe),go(["w","ww","W","WW"],function(o,t,e,n){t[n.substr(0,1)]=Yt(o)});function _u(o){return Co(o,this._week.dow,this._week.doy).week}var Bu={dow:0,doy:6};function ku(){return this._week.dow}function Gu(){return this._week.doy}function xu(o){var t=this.localeData().week(this);return o==null?t:this.add((o-t)*7,"d")}function Ju(o){var t=Co(this,1,4).week;return o==null?t:this.add((o-t)*7,"d")}mt("d",0,"do","day"),mt("dd",0,0,function(o){return this.localeData().weekdaysMin(this,o)}),mt("ddd",0,0,function(o){return this.localeData().weekdaysShort(this,o)}),mt("dddd",0,0,function(o){return this.localeData().weekdays(this,o)}),mt("e",0,0,"weekday"),mt("E",0,0,"isoWeekday"),dt("d",oe),dt("e",oe),dt("E",oe),dt("dd",function(o,t){return t.weekdaysMinRegex(o)}),dt("ddd",function(o,t){return t.weekdaysShortRegex(o)}),dt("dddd",function(o,t){return t.weekdaysRegex(o)}),go(["dd","ddd","dddd"],function(o,t,e,n){var i=e._locale.weekdaysParse(o,n,e._strict);i!=null?t.d=i:Xt(e).invalidWeekday=o}),go(["d","e","E"],function(o,t,e,n){t[n]=Yt(o)});function $u(o,t){return typeof o!="string"?o:isNaN(o)?(o=t.weekdaysParse(o),typeof o=="number"?o:null):parseInt(o,10)}function zu(o,t){return typeof o=="string"?t.weekdaysParse(o)%7||7:isNaN(o)?null:o}function fs(o,t){return o.slice(t,7).concat(o.slice(0,t))}var ju="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),tl="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),qu="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),th=Ro,eh=Ro,nh=Ro;function oh(o,t){var e=Ve(this._weekdays)?this._weekdays:this._weekdays[o&&o!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return o===!0?fs(e,this._week.dow):o?e[o.day()]:e}function ih(o){return o===!0?fs(this._weekdaysShort,this._week.dow):o?this._weekdaysShort[o.day()]:this._weekdaysShort}function sh(o){return o===!0?fs(this._weekdaysMin,this._week.dow):o?this._weekdaysMin[o.day()]:this._weekdaysMin}function rh(o,t,e){var n,i,l,r=o.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)l=Be([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(l,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(l,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(l,"").toLocaleLowerCase();return e?t==="dddd"?(i=de.call(this._weekdaysParse,r),i!==-1?i:null):t==="ddd"?(i=de.call(this._shortWeekdaysParse,r),i!==-1?i:null):(i=de.call(this._minWeekdaysParse,r),i!==-1?i:null):t==="dddd"?(i=de.call(this._weekdaysParse,r),i!==-1||(i=de.call(this._shortWeekdaysParse,r),i!==-1)?i:(i=de.call(this._minWeekdaysParse,r),i!==-1?i:null)):t==="ddd"?(i=de.call(this._shortWeekdaysParse,r),i!==-1||(i=de.call(this._weekdaysParse,r),i!==-1)?i:(i=de.call(this._minWeekdaysParse,r),i!==-1?i:null)):(i=de.call(this._minWeekdaysParse,r),i!==-1||(i=de.call(this._weekdaysParse,r),i!==-1)?i:(i=de.call(this._shortWeekdaysParse,r),i!==-1?i:null))}function lh(o,t,e){var n,i,l;if(this._weekdaysParseExact)return rh.call(this,o,t,e);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=Be([2e3,1]).day(n),e&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(l="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(l.replace(".",""),"i")),e&&t==="dddd"&&this._fullWeekdaysParse[n].test(o))return n;if(e&&t==="ddd"&&this._shortWeekdaysParse[n].test(o))return n;if(e&&t==="dd"&&this._minWeekdaysParse[n].test(o))return n;if(!e&&this._weekdaysParse[n].test(o))return n}}function ah(o){if(!this.isValid())return o!=null?this:NaN;var t=fo(this,"Day");return o!=null?(o=$u(o,this.localeData()),this.add(o-t,"d")):t}function ch(o){if(!this.isValid())return o!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return o==null?t:this.add(o-t,"d")}function dh(o){if(!this.isValid())return o!=null?this:NaN;if(o!=null){var t=zu(o,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function uh(o){return this._weekdaysParseExact?(Ht(this,"_weekdaysRegex")||ms.call(this),o?this._weekdaysStrictRegex:this._weekdaysRegex):(Ht(this,"_weekdaysRegex")||(this._weekdaysRegex=th),this._weekdaysStrictRegex&&o?this._weekdaysStrictRegex:this._weekdaysRegex)}function hh(o){return this._weekdaysParseExact?(Ht(this,"_weekdaysRegex")||ms.call(this),o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Ht(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=eh),this._weekdaysShortStrictRegex&&o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Rh(o){return this._weekdaysParseExact?(Ht(this,"_weekdaysRegex")||ms.call(this),o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Ht(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nh),this._weekdaysMinStrictRegex&&o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ms(){function o(u,h){return h.length-u.length}var t=[],e=[],n=[],i=[],l,r,a,c,d;for(l=0;l<7;l++)r=Be([2e3,1]).day(l),a=tn(this.weekdaysMin(r,"")),c=tn(this.weekdaysShort(r,"")),d=tn(this.weekdays(r,"")),t.push(a),e.push(c),n.push(d),i.push(a),i.push(c),i.push(d);t.sort(o),e.sort(o),n.sort(o),i.sort(o),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Cs(){return this.hours()%12||12}function gh(){return this.hours()||24}mt("H",["HH",2],0,"hour"),mt("h",["hh",2],0,Cs),mt("k",["kk",2],0,gh),mt("hmm",0,0,function(){return""+Cs.apply(this)+Ge(this.minutes(),2)}),mt("hmmss",0,0,function(){return""+Cs.apply(this)+Ge(this.minutes(),2)+Ge(this.seconds(),2)}),mt("Hmm",0,0,function(){return""+this.hours()+Ge(this.minutes(),2)}),mt("Hmmss",0,0,function(){return""+this.hours()+Ge(this.minutes(),2)+Ge(this.seconds(),2)});function el(o,t){mt(o,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}el("a",!0),el("A",!1);function nl(o,t){return t._meridiemParse}dt("a",nl),dt("A",nl),dt("H",oe,Rs),dt("h",oe,$n),dt("k",oe,$n),dt("HH",oe,Pe),dt("hh",oe,Pe),dt("kk",oe,Pe),dt("hmm",_r),dt("hmmss",Br),dt("Hmm",_r),dt("Hmmss",Br),Jt(["H","HH"],he),Jt(["k","kk"],function(o,t,e){var n=Yt(o);t[he]=n===24?0:n}),Jt(["a","A"],function(o,t,e){e._isPm=e._locale.isPM(o),e._meridiem=o}),Jt(["h","hh"],function(o,t,e){t[he]=Yt(o),Xt(e).bigHour=!0}),Jt("hmm",function(o,t,e){var n=o.length-2;t[he]=Yt(o.substr(0,n)),t[Ue]=Yt(o.substr(n)),Xt(e).bigHour=!0}),Jt("hmmss",function(o,t,e){var n=o.length-4,i=o.length-2;t[he]=Yt(o.substr(0,n)),t[Ue]=Yt(o.substr(n,2)),t[nn]=Yt(o.substr(i)),Xt(e).bigHour=!0}),Jt("Hmm",function(o,t,e){var n=o.length-2;t[he]=Yt(o.substr(0,n)),t[Ue]=Yt(o.substr(n))}),Jt("Hmmss",function(o,t,e){var n=o.length-4,i=o.length-2;t[he]=Yt(o.substr(0,n)),t[Ue]=Yt(o.substr(n,2)),t[nn]=Yt(o.substr(i))});function Th(o){return(o+"").toLowerCase().charAt(0)==="p"}var fh=/[ap]\.?m?\.?/i,mh=zn("Hours",!0);function Ch(o,t,e){return o>11?e?"pm":"PM":e?"am":"AM"}var ol={calendar:ru,longDateFormat:du,invalidDate:hu,ordinal:gu,dayOfMonthOrdinalParse:Tu,relativeTime:mu,months:Vu,monthsShort:xr,week:Bu,weekdays:ju,weekdaysMin:qu,weekdaysShort:tl,meridiemParse:fh},se={},po={},Io;function ph(o,t){var e,n=Math.min(o.length,t.length);for(e=0;e<n;e+=1)if(o[e]!==t[e])return e;return n}function il(o){return o&&o.toLowerCase().replace("_","-")}function Ih(o){for(var t=0,e,n,i,l;t<o.length;){for(l=il(o[t]).split("-"),e=l.length,n=il(o[t+1]),n=n?n.split("-"):null;e>0;){if(i=ti(l.slice(0,e).join("-")),i)return i;if(n&&n.length>=e&&ph(l,n)>=e-1)break;e--}t++}return Io}function Eh(o){return!!(o&&o.match("^[^/\\\\]*$"))}function ti(o){var t=null,e;if(se[o]===void 0&&typeof module<"u"&&module&&module.exports&&Eh(o))try{t=Io._abbr,e=require,e("./locale/"+o),Tn(t)}catch{se[o]=null}return se[o]}function Tn(o,t){var e;return o&&(pe(t)?e=sn(o):e=ps(o,t),e?Io=e:typeof console<"u"&&console.warn&&console.warn("Locale "+o+" not found. Did you forget to load it?")),Io._abbr}function ps(o,t){if(t!==null){var e,n=ol;if(t.abbr=o,se[o]!=null)Zr("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=se[o]._config;else if(t.parentLocale!=null)if(se[t.parentLocale]!=null)n=se[t.parentLocale]._config;else if(e=ti(t.parentLocale),e!=null)n=e._config;else return po[t.parentLocale]||(po[t.parentLocale]=[]),po[t.parentLocale].push({name:o,config:t}),null;return se[o]=new rs(ss(n,t)),po[o]&&po[o].forEach(function(i){ps(i.name,i.config)}),Tn(o),se[o]}else return delete se[o],null}function Lh(o,t){if(t!=null){var e,n,i=ol;se[o]!=null&&se[o].parentLocale!=null?se[o].set(ss(se[o]._config,t)):(n=ti(o),n!=null&&(i=n._config),t=ss(i,t),n==null&&(t.abbr=o),e=new rs(t),e.parentLocale=se[o],se[o]=e),Tn(o)}else se[o]!=null&&(se[o].parentLocale!=null?(se[o]=se[o].parentLocale,o===Tn()&&Tn(o)):se[o]!=null&&delete se[o]);return se[o]}function sn(o){var t;if(o&&o._locale&&o._locale._abbr&&(o=o._locale._abbr),!o)return Io;if(!Ve(o)){if(t=ti(o),t)return t;o=[o]}return Ih(o)}function Ph(){return ls(se)}function Is(o){var t,e=o._a;return e&&Xt(o).overflow===-2&&(t=e[en]<0||e[en]>11?en:e[xe]<1||e[xe]>Ts(e[Te],e[en])?xe:e[he]<0||e[he]>24||e[he]===24&&(e[Ue]!==0||e[nn]!==0||e[Fn]!==0)?he:e[Ue]<0||e[Ue]>59?Ue:e[nn]<0||e[nn]>59?nn:e[Fn]<0||e[Fn]>999?Fn:-1,Xt(o)._overflowDayOfYear&&(t<Te||t>xe)&&(t=xe),Xt(o)._overflowWeeks&&t===-1&&(t=Du),Xt(o)._overflowWeekday&&t===-1&&(t=Fu),Xt(o).overflow=t),o}var Mh=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Oh=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sh=/Z|[+-]\d\d(?::?\d\d)?/,ei=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Es=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Dh=/^\/?Date\((-?\d+)/i,Fh=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Xh={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function sl(o){var t,e,n=o._i,i=Mh.exec(n)||Oh.exec(n),l,r,a,c,d=ei.length,u=Es.length;if(i){for(Xt(o).iso=!0,t=0,e=d;t<e;t++)if(ei[t][1].exec(i[1])){r=ei[t][0],l=ei[t][2]!==!1;break}if(r==null){o._isValid=!1;return}if(i[3]){for(t=0,e=u;t<e;t++)if(Es[t][1].exec(i[3])){a=(i[2]||" ")+Es[t][0];break}if(a==null){o._isValid=!1;return}}if(!l&&a!=null){o._isValid=!1;return}if(i[4])if(Sh.exec(i[4]))c="Z";else{o._isValid=!1;return}o._f=r+(a||"")+(c||""),Ps(o)}else o._isValid=!1}function yh(o,t,e,n,i,l){var r=[Nh(o),xr.indexOf(t),parseInt(e,10),parseInt(n,10),parseInt(i,10)];return l&&r.push(parseInt(l,10)),r}function Nh(o){var t=parseInt(o,10);return t<=49?2e3+t:t<=999?1900+t:t}function bh(o){return o.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Vh(o,t,e){if(o){var n=tl.indexOf(o),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return Xt(e).weekdayMismatch=!0,e._isValid=!1,!1}return!0}function Wh(o,t,e){if(o)return Xh[o];if(t)return 0;var n=parseInt(e,10),i=n%100,l=(n-i)/100;return l*60+i}function rl(o){var t=Fh.exec(bh(o._i)),e;if(t){if(e=yh(t[4],t[3],t[2],t[5],t[6],t[7]),!Vh(t[1],e,o))return;o._a=e,o._tzm=Wh(t[8],t[9],t[10]),o._d=mo.apply(null,o._a),o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),Xt(o).rfc2822=!0}else o._isValid=!1}function Uh(o){var t=Dh.exec(o._i);if(t!==null){o._d=new Date(+t[1]);return}if(sl(o),o._isValid===!1)delete o._isValid;else return;if(rl(o),o._isValid===!1)delete o._isValid;else return;o._strict?o._isValid=!1:lt.createFromInputFallback(o)}lt.createFromInputFallback=Fe("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(o){o._d=new Date(o._i+(o._useUTC?" UTC":""))});function jn(o,t,e){return o??t??e}function Yh(o){var t=new Date(lt.now());return o._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ls(o){var t,e,n=[],i,l,r;if(!o._d){for(i=Yh(o),o._w&&o._a[xe]==null&&o._a[en]==null&&wh(o),o._dayOfYear!=null&&(r=jn(o._a[Te],i[Te]),(o._dayOfYear>To(r)||o._dayOfYear===0)&&(Xt(o)._overflowDayOfYear=!0),e=mo(r,0,o._dayOfYear),o._a[en]=e.getUTCMonth(),o._a[xe]=e.getUTCDate()),t=0;t<3&&o._a[t]==null;++t)o._a[t]=n[t]=i[t];for(;t<7;t++)o._a[t]=n[t]=o._a[t]==null?t===2?1:0:o._a[t];o._a[he]===24&&o._a[Ue]===0&&o._a[nn]===0&&o._a[Fn]===0&&(o._nextDay=!0,o._a[he]=0),o._d=(o._useUTC?mo:Au).apply(null,n),l=o._useUTC?o._d.getUTCDay():o._d.getDay(),o._tzm!=null&&o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),o._nextDay&&(o._a[he]=24),o._w&&typeof o._w.d<"u"&&o._w.d!==l&&(Xt(o).weekdayMismatch=!0)}}function wh(o){var t,e,n,i,l,r,a,c,d;t=o._w,t.GG!=null||t.W!=null||t.E!=null?(l=1,r=4,e=jn(t.GG,o._a[Te],Co(ie(),1,4).year),n=jn(t.W,1),i=jn(t.E,1),(i<1||i>7)&&(c=!0)):(l=o._locale._week.dow,r=o._locale._week.doy,d=Co(ie(),l,r),e=jn(t.gg,o._a[Te],d.year),n=jn(t.w,d.week),t.d!=null?(i=t.d,(i<0||i>6)&&(c=!0)):t.e!=null?(i=t.e+l,(t.e<0||t.e>6)&&(c=!0)):i=l),n<1||n>on(e,l,r)?Xt(o)._overflowWeeks=!0:c!=null?Xt(o)._overflowWeekday=!0:(a=qr(e,n,i,l,r),o._a[Te]=a.year,o._dayOfYear=a.dayOfYear)}lt.ISO_8601=function(){},lt.RFC_2822=function(){};function Ps(o){if(o._f===lt.ISO_8601){sl(o);return}if(o._f===lt.RFC_2822){rl(o);return}o._a=[],Xt(o).empty=!0;var t=""+o._i,e,n,i,l,r,a=t.length,c=0,d,u;for(i=Qr(o._f,o._locale).match(as)||[],u=i.length,e=0;e<u;e++)l=i[e],n=(t.match(Mu(l,o))||[])[0],n&&(r=t.substr(0,t.indexOf(n)),r.length>0&&Xt(o).unusedInput.push(r),t=t.slice(t.indexOf(n)+n.length),c+=n.length),xn[l]?(n?Xt(o).empty=!1:Xt(o).unusedTokens.push(l),Su(l,n,o)):o._strict&&!n&&Xt(o).unusedTokens.push(l);Xt(o).charsLeftOver=a-c,t.length>0&&Xt(o).unusedInput.push(t),o._a[he]<=12&&Xt(o).bigHour===!0&&o._a[he]>0&&(Xt(o).bigHour=void 0),Xt(o).parsedDateParts=o._a.slice(0),Xt(o).meridiem=o._meridiem,o._a[he]=vh(o._locale,o._a[he],o._meridiem),d=Xt(o).era,d!==null&&(o._a[Te]=o._locale.erasConvertYear(d,o._a[Te])),Ls(o),Is(o)}function vh(o,t,e){var n;return e==null?t:o.meridiemHour!=null?o.meridiemHour(t,e):(o.isPM!=null&&(n=o.isPM(e),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function Zh(o){var t,e,n,i,l,r,a=!1,c=o._f.length;if(c===0){Xt(o).invalidFormat=!0,o._d=new Date(NaN);return}for(i=0;i<c;i++)l=0,r=!1,t=is({},o),o._useUTC!=null&&(t._useUTC=o._useUTC),t._f=o._f[i],Ps(t),ns(t)&&(r=!0),l+=Xt(t).charsLeftOver,l+=Xt(t).unusedTokens.length*10,Xt(t).score=l,a?l<n&&(n=l,e=t):(n==null||l<n||r)&&(n=l,e=t,r&&(a=!0));gn(o,e||t)}function Qh(o){if(!o._d){var t=ds(o._i),e=t.day===void 0?t.date:t.day;o._a=Ur([t.year,t.month,e,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)}),Ls(o)}}function Kh(o){var t=new ho(Is(ll(o)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function ll(o){var t=o._i,e=o._f;return o._locale=o._locale||sn(o._l),t===null||e===void 0&&t===""?Ao({nullInput:!0}):(typeof t=="string"&&(o._i=t=o._locale.preparse(t)),We(t)?new ho(Is(t)):(uo(t)?o._d=t:Ve(e)?Zh(o):e?Ps(o):Hh(o),ns(o)||(o._d=null),o))}function Hh(o){var t=o._i;pe(t)?o._d=new Date(lt.now()):uo(t)?o._d=new Date(t.valueOf()):typeof t=="string"?Uh(o):Ve(t)?(o._a=Ur(t.slice(0),function(e){return parseInt(e,10)}),Ls(o)):Dn(t)?Qh(o):qe(t)?o._d=new Date(t):lt.createFromInputFallback(o)}function al(o,t,e,n,i){var l={};return(t===!0||t===!1)&&(n=t,t=void 0),(e===!0||e===!1)&&(n=e,e=void 0),(Dn(o)&&ts(o)||Ve(o)&&o.length===0)&&(o=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=i,l._l=e,l._i=o,l._f=t,l._strict=n,Kh(l)}function ie(o,t,e,n){return al(o,t,e,n,!1)}var Ah=Fe("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=ie.apply(null,arguments);return this.isValid()&&o.isValid()?o<this?this:o:Ao()}),_h=Fe("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=ie.apply(null,arguments);return this.isValid()&&o.isValid()?o>this?this:o:Ao()});function cl(o,t){var e,n;if(t.length===1&&Ve(t[0])&&(t=t[0]),!t.length)return ie();for(e=t[0],n=1;n<t.length;++n)(!t[n].isValid()||t[n][o](e))&&(e=t[n]);return e}function Bh(){var o=[].slice.call(arguments,0);return cl("isBefore",o)}function kh(){var o=[].slice.call(arguments,0);return cl("isAfter",o)}var Gh=function(){return Date.now?Date.now():+new Date},Eo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function xh(o){var t,e=!1,n,i=Eo.length;for(t in o)if(Ht(o,t)&&!(de.call(Eo,t)!==-1&&(o[t]==null||!isNaN(o[t]))))return!1;for(n=0;n<i;++n)if(o[Eo[n]]){if(e)return!1;parseFloat(o[Eo[n]])!==Yt(o[Eo[n]])&&(e=!0)}return!0}function Jh(){return this._isValid}function $h(){return Ye(NaN)}function ni(o){var t=ds(o),e=t.year||0,n=t.quarter||0,i=t.month||0,l=t.week||t.isoWeek||0,r=t.day||0,a=t.hour||0,c=t.minute||0,d=t.second||0,u=t.millisecond||0;this._isValid=xh(t),this._milliseconds=+u+d*1e3+c*6e4+a*1e3*60*60,this._days=+r+l*7,this._months=+i+n*3+e*12,this._data={},this._locale=sn(),this._bubble()}function oi(o){return o instanceof ni}function Ms(o){return o<0?Math.round(-1*o)*-1:Math.round(o)}function zh(o,t,e){var n=Math.min(o.length,t.length),i=Math.abs(o.length-t.length),l=0,r;for(r=0;r<n;r++)Yt(o[r])!==Yt(t[r])&&l++;return l+i}function dl(o,t){mt(o,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+Ge(~~(e/60),2)+t+Ge(~~e%60,2)})}dl("Z",":"),dl("ZZ",""),dt("Z",$o),dt("ZZ",$o),Jt(["Z","ZZ"],function(o,t,e){e._useUTC=!0,e._tzm=Os($o,o)});var jh=/([\+\-]|\d\d)/gi;function Os(o,t){var e=(t||"").match(o),n,i,l;return e===null?null:(n=e[e.length-1]||[],i=(n+"").match(jh)||["-",0,0],l=+(i[1]*60)+Yt(i[2]),l===0?0:i[0]==="+"?l:-l)}function Ss(o,t){var e,n;return t._isUTC?(e=t.clone(),n=(We(o)||uo(o)?o.valueOf():ie(o).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+n),lt.updateOffset(e,!1),e):ie(o).local()}function Ds(o){return-Math.round(o._d.getTimezoneOffset())}lt.updateOffset=function(){};function qh(o,t,e){var n=this._offset||0,i;if(!this.isValid())return o!=null?this:NaN;if(o!=null){if(typeof o=="string"){if(o=Os($o,o),o===null)return this}else Math.abs(o)<16&&!e&&(o=o*60);return!this._isUTC&&t&&(i=Ds(this)),this._offset=o,this._isUTC=!0,i!=null&&this.add(i,"m"),n!==o&&(!t||this._changeInProgress?gl(this,Ye(o-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,lt.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:Ds(this)}function tR(o,t){return o!=null?(typeof o!="string"&&(o=-o),this.utcOffset(o,t),this):-this.utcOffset()}function eR(o){return this.utcOffset(0,o)}function nR(o){return this._isUTC&&(this.utcOffset(0,o),this._isUTC=!1,o&&this.subtract(Ds(this),"m")),this}function oR(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var o=Os(Lu,this._i);o!=null?this.utcOffset(o):this.utcOffset(0,!0)}return this}function iR(o){return this.isValid()?(o=o?ie(o).utcOffset():0,(this.utcOffset()-o)%60===0):!1}function sR(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function rR(){if(!pe(this._isDSTShifted))return this._isDSTShifted;var o={},t;return is(o,this),o=ll(o),o._a?(t=o._isUTC?Be(o._a):ie(o._a),this._isDSTShifted=this.isValid()&&zh(o._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function lR(){return this.isValid()?!this._isUTC:!1}function aR(){return this.isValid()?this._isUTC:!1}function ul(){return this.isValid()?this._isUTC&&this._offset===0:!1}var cR=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,dR=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ye(o,t){var e=o,n=null,i,l,r;return oi(o)?e={ms:o._milliseconds,d:o._days,M:o._months}:qe(o)||!isNaN(+o)?(e={},t?e[t]=+o:e.milliseconds=+o):(n=cR.exec(o))?(i=n[1]==="-"?-1:1,e={y:0,d:Yt(n[xe])*i,h:Yt(n[he])*i,m:Yt(n[Ue])*i,s:Yt(n[nn])*i,ms:Yt(Ms(n[Fn]*1e3))*i}):(n=dR.exec(o))?(i=n[1]==="-"?-1:1,e={y:Xn(n[2],i),M:Xn(n[3],i),w:Xn(n[4],i),d:Xn(n[5],i),h:Xn(n[6],i),m:Xn(n[7],i),s:Xn(n[8],i)}):e==null?e={}:typeof e=="object"&&("from"in e||"to"in e)&&(r=uR(ie(e.from),ie(e.to)),e={},e.ms=r.milliseconds,e.M=r.months),l=new ni(e),oi(o)&&Ht(o,"_locale")&&(l._locale=o._locale),oi(o)&&Ht(o,"_isValid")&&(l._isValid=o._isValid),l}Ye.fn=ni.prototype,Ye.invalid=$h;function Xn(o,t){var e=o&&parseFloat(o.replace(",","."));return(isNaN(e)?0:e)*t}function hl(o,t){var e={};return e.months=t.month()-o.month()+(t.year()-o.year())*12,o.clone().add(e.months,"M").isAfter(t)&&--e.months,e.milliseconds=+t-+o.clone().add(e.months,"M"),e}function uR(o,t){var e;return o.isValid()&&t.isValid()?(t=Ss(t,o),o.isBefore(t)?e=hl(o,t):(e=hl(t,o),e.milliseconds=-e.milliseconds,e.months=-e.months),e):{milliseconds:0,months:0}}function Rl(o,t){return function(e,n){var i,l;return n!==null&&!isNaN(+n)&&(Zr(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),l=e,e=n,n=l),i=Ye(e,n),gl(this,i,o),this}}function gl(o,t,e,n){var i=t._milliseconds,l=Ms(t._days),r=Ms(t._months);o.isValid()&&(n=n??!0,r&&$r(o,fo(o,"Month")+r*e),l&&Gr(o,"Date",fo(o,"Date")+l*e),i&&o._d.setTime(o._d.valueOf()+i*e),n&&lt.updateOffset(o,l||r))}var hR=Rl(1,"add"),RR=Rl(-1,"subtract");function Tl(o){return typeof o=="string"||o instanceof String}function gR(o){return We(o)||uo(o)||Tl(o)||qe(o)||fR(o)||TR(o)||o===null||o===void 0}function TR(o){var t=Dn(o)&&!ts(o),e=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,l,r=n.length;for(i=0;i<r;i+=1)l=n[i],e=e||Ht(o,l);return t&&e}function fR(o){var t=Ve(o),e=!1;return t&&(e=o.filter(function(n){return!qe(n)&&Tl(o)}).length===0),t&&e}function mR(o){var t=Dn(o)&&!ts(o),e=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,l;for(i=0;i<n.length;i+=1)l=n[i],e=e||Ht(o,l);return t&&e}function CR(o,t){var e=o.diff(t,"days",!0);return e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"}function pR(o,t){arguments.length===1&&(arguments[0]?gR(arguments[0])?(o=arguments[0],t=void 0):mR(arguments[0])&&(t=arguments[0],o=void 0):(o=void 0,t=void 0));var e=o||ie(),n=Ss(e,this).startOf("day"),i=lt.calendarFormat(this,n)||"sameElse",l=t&&(ke(t[i])?t[i].call(this,e):t[i]);return this.format(l||this.localeData().calendar(i,this,ie(e)))}function IR(){return new ho(this)}function ER(o,t){var e=We(o)?o:ie(o);return this.isValid()&&e.isValid()?(t=Xe(t)||"millisecond",t==="millisecond"?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf()):!1}function LR(o,t){var e=We(o)?o:ie(o);return this.isValid()&&e.isValid()?(t=Xe(t)||"millisecond",t==="millisecond"?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf()):!1}function PR(o,t,e,n){var i=We(o)?o:ie(o),l=We(t)?t:ie(t);return this.isValid()&&i.isValid()&&l.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(i,e):!this.isBefore(i,e))&&(n[1]===")"?this.isBefore(l,e):!this.isAfter(l,e))):!1}function MR(o,t){var e=We(o)?o:ie(o),n;return this.isValid()&&e.isValid()?(t=Xe(t)||"millisecond",t==="millisecond"?this.valueOf()===e.valueOf():(n=e.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf())):!1}function OR(o,t){return this.isSame(o,t)||this.isAfter(o,t)}function SR(o,t){return this.isSame(o,t)||this.isBefore(o,t)}function DR(o,t,e){var n,i,l;if(!this.isValid())return NaN;if(n=Ss(o,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,t=Xe(t),t){case"year":l=ii(this,n)/12;break;case"month":l=ii(this,n);break;case"quarter":l=ii(this,n)/3;break;case"second":l=(this-n)/1e3;break;case"minute":l=(this-n)/6e4;break;case"hour":l=(this-n)/36e5;break;case"day":l=(this-n-i)/864e5;break;case"week":l=(this-n-i)/6048e5;break;default:l=this-n}return e?l:ye(l)}function ii(o,t){if(o.date()<t.date())return-ii(t,o);var e=(t.year()-o.year())*12+(t.month()-o.month()),n=o.clone().add(e,"months"),i,l;return t-n<0?(i=o.clone().add(e-1,"months"),l=(t-n)/(n-i)):(i=o.clone().add(e+1,"months"),l=(t-n)/(i-n)),-(e+l)||0}lt.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",lt.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function FR(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function XR(o){if(!this.isValid())return null;var t=o!==!0,e=t?this.clone().utc():this;return e.year()<0||e.year()>9999?Bo(e,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ke(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Bo(e,"Z")):Bo(e,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function yR(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var o="moment",t="",e,n,i,l;return this.isLocal()||(o=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),e="["+o+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",l=t+'[")]',this.format(e+n+i+l)}function NR(o){o||(o=this.isUtc()?lt.defaultFormatUtc:lt.defaultFormat);var t=Bo(this,o);return this.localeData().postformat(t)}function bR(o,t){return this.isValid()&&(We(o)&&o.isValid()||ie(o).isValid())?Ye({to:this,from:o}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function VR(o){return this.from(ie(),o)}function WR(o,t){return this.isValid()&&(We(o)&&o.isValid()||ie(o).isValid())?Ye({from:this,to:o}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function UR(o){return this.to(ie(),o)}function fl(o){var t;return o===void 0?this._locale._abbr:(t=sn(o),t!=null&&(this._locale=t),this)}var ml=Fe("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(o){return o===void 0?this.localeData():this.locale(o)});function Cl(){return this._locale}var si=1e3,qn=60*si,ri=60*qn,pl=(365*400+97)*24*ri;function to(o,t){return(o%t+t)%t}function Il(o,t,e){return o<100&&o>=0?new Date(o+400,t,e)-pl:new Date(o,t,e).valueOf()}function El(o,t,e){return o<100&&o>=0?Date.UTC(o+400,t,e)-pl:Date.UTC(o,t,e)}function YR(o){var t,e;if(o=Xe(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?El:Il,o){case"year":t=e(this.year(),0,1);break;case"quarter":t=e(this.year(),this.month()-this.month()%3,1);break;case"month":t=e(this.year(),this.month(),1);break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=e(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=to(t+(this._isUTC?0:this.utcOffset()*qn),ri);break;case"minute":t=this._d.valueOf(),t-=to(t,qn);break;case"second":t=this._d.valueOf(),t-=to(t,si);break}return this._d.setTime(t),lt.updateOffset(this,!0),this}function wR(o){var t,e;if(o=Xe(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?El:Il,o){case"year":t=e(this.year()+1,0,1)-1;break;case"quarter":t=e(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=e(this.year(),this.month()+1,1)-1;break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=e(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ri-to(t+(this._isUTC?0:this.utcOffset()*qn),ri)-1;break;case"minute":t=this._d.valueOf(),t+=qn-to(t,qn)-1;break;case"second":t=this._d.valueOf(),t+=si-to(t,si)-1;break}return this._d.setTime(t),lt.updateOffset(this,!0),this}function vR(){return this._d.valueOf()-(this._offset||0)*6e4}function ZR(){return Math.floor(this.valueOf()/1e3)}function QR(){return new Date(this.valueOf())}function KR(){var o=this;return[o.year(),o.month(),o.date(),o.hour(),o.minute(),o.second(),o.millisecond()]}function HR(){var o=this;return{years:o.year(),months:o.month(),date:o.date(),hours:o.hours(),minutes:o.minutes(),seconds:o.seconds(),milliseconds:o.milliseconds()}}function AR(){return this.isValid()?this.toISOString():null}function _R(){return ns(this)}function BR(){return gn({},Xt(this))}function kR(){return Xt(this).overflow}function GR(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}mt("N",0,0,"eraAbbr"),mt("NN",0,0,"eraAbbr"),mt("NNN",0,0,"eraAbbr"),mt("NNNN",0,0,"eraName"),mt("NNNNN",0,0,"eraNarrow"),mt("y",["y",1],"yo","eraYear"),mt("y",["yy",2],0,"eraYear"),mt("y",["yyy",3],0,"eraYear"),mt("y",["yyyy",4],0,"eraYear"),dt("N",Fs),dt("NN",Fs),dt("NNN",Fs),dt("NNNN",ig),dt("NNNNN",sg),Jt(["N","NN","NNN","NNNN","NNNNN"],function(o,t,e,n){var i=e._locale.erasParse(o,n,e._strict);i?Xt(e).era=i:Xt(e).invalidEra=o}),dt("y",Jn),dt("yy",Jn),dt("yyy",Jn),dt("yyyy",Jn),dt("yo",rg),Jt(["y","yy","yyy","yyyy"],Te),Jt(["yo"],function(o,t,e,n){var i;e._locale._eraYearOrdinalRegex&&(i=o.match(e._locale._eraYearOrdinalRegex)),e._locale.eraYearOrdinalParse?t[Te]=e._locale.eraYearOrdinalParse(o,i):t[Te]=parseInt(o,10)});function xR(o,t){var e,n,i,l=this._eras||sn("en")._eras;for(e=0,n=l.length;e<n;++e)switch(typeof l[e].since==="string"&&(i=lt(l[e].since).startOf("day"),l[e].since=i.valueOf()),typeof l[e].until){case"undefined":l[e].until=1/0;break;case"string":i=lt(l[e].until).startOf("day").valueOf(),l[e].until=i.valueOf();break}return l}function JR(o,t,e){var n,i,l=this.eras(),r,a,c;for(o=o.toUpperCase(),n=0,i=l.length;n<i;++n)if(r=l[n].name.toUpperCase(),a=l[n].abbr.toUpperCase(),c=l[n].narrow.toUpperCase(),e)switch(t){case"N":case"NN":case"NNN":if(a===o)return l[n];break;case"NNNN":if(r===o)return l[n];break;case"NNNNN":if(c===o)return l[n];break}else if([r,a,c].indexOf(o)>=0)return l[n]}function $R(o,t){var e=o.since<=o.until?1:-1;return t===void 0?lt(o.since).year():lt(o.since).year()+(t-o.offset)*e}function zR(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].name;return""}function jR(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].narrow;return""}function qR(){var o,t,e,n=this.localeData().eras();for(o=0,t=n.length;o<t;++o)if(e=this.clone().startOf("day").valueOf(),n[o].since<=e&&e<=n[o].until||n[o].until<=e&&e<=n[o].since)return n[o].abbr;return""}function tg(){var o,t,e,n,i=this.localeData().eras();for(o=0,t=i.length;o<t;++o)if(e=i[o].since<=i[o].until?1:-1,n=this.clone().startOf("day").valueOf(),i[o].since<=n&&n<=i[o].until||i[o].until<=n&&n<=i[o].since)return(this.year()-lt(i[o].since).year())*e+i[o].offset;return this.year()}function eg(o){return Ht(this,"_erasNameRegex")||Xs.call(this),o?this._erasNameRegex:this._erasRegex}function ng(o){return Ht(this,"_erasAbbrRegex")||Xs.call(this),o?this._erasAbbrRegex:this._erasRegex}function og(o){return Ht(this,"_erasNarrowRegex")||Xs.call(this),o?this._erasNarrowRegex:this._erasRegex}function Fs(o,t){return t.erasAbbrRegex(o)}function ig(o,t){return t.erasNameRegex(o)}function sg(o,t){return t.erasNarrowRegex(o)}function rg(o,t){return t._eraYearOrdinalRegex||Jn}function Xs(){var o=[],t=[],e=[],n=[],i,l,r,a,c,d=this.eras();for(i=0,l=d.length;i<l;++i)r=tn(d[i].name),a=tn(d[i].abbr),c=tn(d[i].narrow),t.push(r),o.push(a),e.push(c),n.push(r),n.push(a),n.push(c);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+e.join("|")+")","i")}mt(0,["gg",2],0,function(){return this.weekYear()%100}),mt(0,["GG",2],0,function(){return this.isoWeekYear()%100});function li(o,t){mt(0,[o,o.length],0,t)}li("gggg","weekYear"),li("ggggg","weekYear"),li("GGGG","isoWeekYear"),li("GGGGG","isoWeekYear"),dt("G",Jo),dt("g",Jo),dt("GG",oe,Pe),dt("gg",oe,Pe),dt("GGGG",hs,us),dt("gggg",hs,us),dt("GGGGG",xo,ko),dt("ggggg",xo,ko),go(["gggg","ggggg","GGGG","GGGGG"],function(o,t,e,n){t[n.substr(0,2)]=Yt(o)}),go(["gg","GG"],function(o,t,e,n){t[n]=lt.parseTwoDigitYear(o)});function lg(o){return Ll.call(this,o,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function ag(o){return Ll.call(this,o,this.isoWeek(),this.isoWeekday(),1,4)}function cg(){return on(this.year(),1,4)}function dg(){return on(this.isoWeekYear(),1,4)}function ug(){var o=this.localeData()._week;return on(this.year(),o.dow,o.doy)}function hg(){var o=this.localeData()._week;return on(this.weekYear(),o.dow,o.doy)}function Ll(o,t,e,n,i){var l;return o==null?Co(this,n,i).year:(l=on(o,n,i),t>l&&(t=l),Rg.call(this,o,t,e,n,i))}function Rg(o,t,e,n,i){var l=qr(o,t,e,n,i),r=mo(l.year,0,l.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}mt("Q",0,"Qo","quarter"),dt("Q",Hr),Jt("Q",function(o,t){t[en]=(Yt(o)-1)*3});function gg(o){return o==null?Math.ceil((this.month()+1)/3):this.month((o-1)*3+this.month()%3)}mt("D",["DD",2],"Do","date"),dt("D",oe,$n),dt("DD",oe,Pe),dt("Do",function(o,t){return o?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Jt(["D","DD"],xe),Jt("Do",function(o,t){t[xe]=Yt(o.match(oe)[0])});var Pl=zn("Date",!0);mt("DDD",["DDDD",3],"DDDo","dayOfYear"),dt("DDD",Go),dt("DDDD",Ar),Jt(["DDD","DDDD"],function(o,t,e){e._dayOfYear=Yt(o)});function Tg(o){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return o==null?t:this.add(o-t,"d")}mt("m",["mm",2],0,"minute"),dt("m",oe,Rs),dt("mm",oe,Pe),Jt(["m","mm"],Ue);var fg=zn("Minutes",!1);mt("s",["ss",2],0,"second"),dt("s",oe,Rs),dt("ss",oe,Pe),Jt(["s","ss"],nn);var mg=zn("Seconds",!1);mt("S",0,0,function(){return~~(this.millisecond()/100)}),mt(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),mt(0,["SSS",3],0,"millisecond"),mt(0,["SSSS",4],0,function(){return this.millisecond()*10}),mt(0,["SSSSS",5],0,function(){return this.millisecond()*100}),mt(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),mt(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),mt(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),mt(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),dt("S",Go,Hr),dt("SS",Go,Pe),dt("SSS",Go,Ar);var fn,Ml;for(fn="SSSS";fn.length<=9;fn+="S")dt(fn,Jn);function Cg(o,t){t[Fn]=Yt(("0."+o)*1e3)}for(fn="S";fn.length<=9;fn+="S")Jt(fn,Cg);Ml=zn("Milliseconds",!1),mt("z",0,0,"zoneAbbr"),mt("zz",0,0,"zoneName");function pg(){return this._isUTC?"UTC":""}function Ig(){return this._isUTC?"Coordinated Universal Time":""}var j=ho.prototype;j.add=hR,j.calendar=pR,j.clone=IR,j.diff=DR,j.endOf=wR,j.format=NR,j.from=bR,j.fromNow=VR,j.to=WR,j.toNow=UR,j.get=yu,j.invalidAt=kR,j.isAfter=ER,j.isBefore=LR,j.isBetween=PR,j.isSame=MR,j.isSameOrAfter=OR,j.isSameOrBefore=SR,j.isValid=_R,j.lang=ml,j.locale=fl,j.localeData=Cl,j.max=_h,j.min=Ah,j.parsingFlags=BR,j.set=Nu,j.startOf=YR,j.subtract=RR,j.toArray=KR,j.toObject=HR,j.toDate=QR,j.toISOString=XR,j.inspect=yR,typeof Symbol<"u"&&Symbol.for!=null&&(j[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),j.toJSON=AR,j.toString=FR,j.unix=ZR,j.valueOf=vR,j.creationData=GR,j.eraName=zR,j.eraNarrow=jR,j.eraAbbr=qR,j.eraYear=tg,j.year=kr,j.isLeapYear=Xu,j.weekYear=lg,j.isoWeekYear=ag,j.quarter=j.quarters=gg,j.month=zr,j.daysInMonth=Qu,j.week=j.weeks=xu,j.isoWeek=j.isoWeeks=Ju,j.weeksInYear=ug,j.weeksInWeekYear=hg,j.isoWeeksInYear=cg,j.isoWeeksInISOWeekYear=dg,j.date=Pl,j.day=j.days=ah,j.weekday=ch,j.isoWeekday=dh,j.dayOfYear=Tg,j.hour=j.hours=mh,j.minute=j.minutes=fg,j.second=j.seconds=mg,j.millisecond=j.milliseconds=Ml,j.utcOffset=qh,j.utc=eR,j.local=nR,j.parseZone=oR,j.hasAlignedHourOffset=iR,j.isDST=sR,j.isLocal=lR,j.isUtcOffset=aR,j.isUtc=ul,j.isUTC=ul,j.zoneAbbr=pg,j.zoneName=Ig,j.dates=Fe("dates accessor is deprecated. Use date instead.",Pl),j.months=Fe("months accessor is deprecated. Use month instead",zr),j.years=Fe("years accessor is deprecated. Use year instead",kr),j.zone=Fe("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",tR),j.isDSTShifted=Fe("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",rR);function Eg(o){return ie(o*1e3)}function Lg(){return ie.apply(null,arguments).parseZone()}function Ol(o){return o}var At=rs.prototype;At.calendar=lu,At.longDateFormat=uu,At.invalidDate=Ru,At.ordinal=fu,At.preparse=Ol,At.postformat=Ol,At.relativeTime=Cu,At.pastFuture=pu,At.set=su,At.eras=xR,At.erasParse=JR,At.erasConvertYear=$R,At.erasAbbrRegex=ng,At.erasNameRegex=eg,At.erasNarrowRegex=og,At.months=Yu,At.monthsShort=wu,At.monthsParse=Zu,At.monthsRegex=Hu,At.monthsShortRegex=Ku,At.week=_u,At.firstDayOfYear=Gu,At.firstDayOfWeek=ku,At.weekdays=oh,At.weekdaysMin=sh,At.weekdaysShort=ih,At.weekdaysParse=lh,At.weekdaysRegex=uh,At.weekdaysShortRegex=hh,At.weekdaysMinRegex=Rh,At.isPM=Th,At.meridiem=Ch;function ai(o,t,e,n){var i=sn(),l=Be().set(n,t);return i[e](l,o)}function Sl(o,t,e){if(qe(o)&&(t=o,o=void 0),o=o||"",t!=null)return ai(o,t,e,"month");var n,i=[];for(n=0;n<12;n++)i[n]=ai(o,n,e,"month");return i}function ys(o,t,e,n){typeof o=="boolean"?(qe(t)&&(e=t,t=void 0),t=t||""):(t=o,e=t,o=!1,qe(t)&&(e=t,t=void 0),t=t||"");var i=sn(),l=o?i._week.dow:0,r,a=[];if(e!=null)return ai(t,(e+l)%7,n,"day");for(r=0;r<7;r++)a[r]=ai(t,(r+l)%7,n,"day");return a}function Pg(o,t){return Sl(o,t,"months")}function Mg(o,t){return Sl(o,t,"monthsShort")}function Og(o,t,e){return ys(o,t,e,"weekdays")}function Sg(o,t,e){return ys(o,t,e,"weekdaysShort")}function Dg(o,t,e){return ys(o,t,e,"weekdaysMin")}Tn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(o){var t=o%10,e=Yt(o%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return o+e}}),lt.lang=Fe("moment.lang is deprecated. Use moment.locale instead.",Tn),lt.langData=Fe("moment.langData is deprecated. Use moment.localeData instead.",sn);var rn=Math.abs;function Fg(){var o=this._data;return this._milliseconds=rn(this._milliseconds),this._days=rn(this._days),this._months=rn(this._months),o.milliseconds=rn(o.milliseconds),o.seconds=rn(o.seconds),o.minutes=rn(o.minutes),o.hours=rn(o.hours),o.months=rn(o.months),o.years=rn(o.years),this}function Dl(o,t,e,n){var i=Ye(t,e);return o._milliseconds+=n*i._milliseconds,o._days+=n*i._days,o._months+=n*i._months,o._bubble()}function Xg(o,t){return Dl(this,o,t,1)}function yg(o,t){return Dl(this,o,t,-1)}function Fl(o){return o<0?Math.floor(o):Math.ceil(o)}function Ng(){var o=this._milliseconds,t=this._days,e=this._months,n=this._data,i,l,r,a,c;return o>=0&&t>=0&&e>=0||o<=0&&t<=0&&e<=0||(o+=Fl(Ns(e)+t)*864e5,t=0,e=0),n.milliseconds=o%1e3,i=ye(o/1e3),n.seconds=i%60,l=ye(i/60),n.minutes=l%60,r=ye(l/60),n.hours=r%24,t+=ye(r/24),c=ye(Xl(t)),e+=c,t-=Fl(Ns(c)),a=ye(e/12),e%=12,n.days=t,n.months=e,n.years=a,this}function Xl(o){return o*4800/146097}function Ns(o){return o*146097/4800}function bg(o){if(!this.isValid())return NaN;var t,e,n=this._milliseconds;if(o=Xe(o),o==="month"||o==="quarter"||o==="year")switch(t=this._days+n/864e5,e=this._months+Xl(t),o){case"month":return e;case"quarter":return e/3;case"year":return e/12}else switch(t=this._days+Math.round(Ns(this._months)),o){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+o)}}function ln(o){return function(){return this.as(o)}}var yl=ln("ms"),Vg=ln("s"),Wg=ln("m"),Ug=ln("h"),Yg=ln("d"),wg=ln("w"),vg=ln("M"),Zg=ln("Q"),Qg=ln("y"),Kg=yl;function Hg(){return Ye(this)}function Ag(o){return o=Xe(o),this.isValid()?this[o+"s"]():NaN}function yn(o){return function(){return this.isValid()?this._data[o]:NaN}}var _g=yn("milliseconds"),Bg=yn("seconds"),kg=yn("minutes"),Gg=yn("hours"),xg=yn("days"),Jg=yn("months"),$g=yn("years");function zg(){return ye(this.days()/7)}var an=Math.round,eo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function jg(o,t,e,n,i){return i.relativeTime(t||1,!!e,o,n)}function qg(o,t,e,n){var i=Ye(o).abs(),l=an(i.as("s")),r=an(i.as("m")),a=an(i.as("h")),c=an(i.as("d")),d=an(i.as("M")),u=an(i.as("w")),h=an(i.as("y")),R=l<=e.ss&&["s",l]||l<e.s&&["ss",l]||r<=1&&["m"]||r<e.m&&["mm",r]||a<=1&&["h"]||a<e.h&&["hh",a]||c<=1&&["d"]||c<e.d&&["dd",c];return e.w!=null&&(R=R||u<=1&&["w"]||u<e.w&&["ww",u]),R=R||d<=1&&["M"]||d<e.M&&["MM",d]||h<=1&&["y"]||["yy",h],R[2]=t,R[3]=+o>0,R[4]=n,jg.apply(null,R)}function tT(o){return o===void 0?an:typeof o=="function"?(an=o,!0):!1}function eT(o,t){return eo[o]===void 0?!1:t===void 0?eo[o]:(eo[o]=t,o==="s"&&(eo.ss=t-1),!0)}function nT(o,t){if(!this.isValid())return this.localeData().invalidDate();var e=!1,n=eo,i,l;return typeof o=="object"&&(t=o,o=!1),typeof o=="boolean"&&(e=o),typeof t=="object"&&(n=Object.assign({},eo,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),i=this.localeData(),l=qg(this,!e,n,i),e&&(l=i.pastFuture(+this,l)),i.postformat(l)}var bs=Math.abs;function no(o){return(o>0)-(o<0)||+o}function ci(){if(!this.isValid())return this.localeData().invalidDate();var o=bs(this._milliseconds)/1e3,t=bs(this._days),e=bs(this._months),n,i,l,r,a=this.asSeconds(),c,d,u,h;return a?(n=ye(o/60),i=ye(n/60),o%=60,n%=60,l=ye(e/12),e%=12,r=o?o.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",d=no(this._months)!==no(a)?"-":"",u=no(this._days)!==no(a)?"-":"",h=no(this._milliseconds)!==no(a)?"-":"",c+"P"+(l?d+l+"Y":"")+(e?d+e+"M":"")+(t?u+t+"D":"")+(i||n||o?"T":"")+(i?h+i+"H":"")+(n?h+n+"M":"")+(o?h+r+"S":"")):"P0D"}var wt=ni.prototype;wt.isValid=Jh,wt.abs=Fg,wt.add=Xg,wt.subtract=yg,wt.as=bg,wt.asMilliseconds=yl,wt.asSeconds=Vg,wt.asMinutes=Wg,wt.asHours=Ug,wt.asDays=Yg,wt.asWeeks=wg,wt.asMonths=vg,wt.asQuarters=Zg,wt.asYears=Qg,wt.valueOf=Kg,wt._bubble=Ng,wt.clone=Hg,wt.get=Ag,wt.milliseconds=_g,wt.seconds=Bg,wt.minutes=kg,wt.hours=Gg,wt.days=xg,wt.weeks=zg,wt.months=Jg,wt.years=$g,wt.humanize=nT,wt.toISOString=ci,wt.toString=ci,wt.toJSON=ci,wt.locale=fl,wt.localeData=Cl,wt.toIsoString=Fe("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ci),wt.lang=ml,mt("X",0,0,"unix"),mt("x",0,0,"valueOf"),dt("x",Jo),dt("X",Pu),Jt("X",function(o,t,e){e._d=new Date(parseFloat(o)*1e3)}),Jt("x",function(o,t,e){e._d=new Date(Yt(o))});lt.version="2.30.1",ou(ie),lt.fn=j,lt.min=Bh,lt.max=kh,lt.now=Gh,lt.utc=Be,lt.unix=Eg,lt.months=Pg,lt.isDate=uo,lt.locale=Tn,lt.invalid=Ao,lt.duration=Ye,lt.isMoment=We,lt.weekdays=Og,lt.parseZone=Lg,lt.localeData=sn,lt.isDuration=oi,lt.monthsShort=Mg,lt.weekdaysMin=Dg,lt.defineLocale=ps,lt.updateLocale=Lh,lt.locales=Ph,lt.weekdaysShort=Sg,lt.normalizeUnits=Xe,lt.relativeTimeRounding=tT,lt.relativeTimeThreshold=eT,lt.calendarFormat=CR,lt.prototype=j,lt.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const oT=new Set([s.ElementType.IMAGE,s.ElementType.MACRO,s.ElementType.CUSTOM_MACRO,s.ElementType.MENSTRUAL_HISTORY,s.ElementType.FETAL_HEART_POSITION,s.ElementType.TOOTH_POSITION]);class Vs{draws;ranges;element;control;options;position;constructor(t,e){const n=e.getDraw();this.draws=n,this.position=n.getPosition(),this.ranges=n.getRange(),this.options=n.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();let{startIndex:n}=t.range||this.control.getRange();const i=this.control.getDraw(),l=t?null:i.getTd();n>=e.length&&(n=e.length-1);const r=e[n],a=[];let c=l,d=e,u=n;for(;;){if(u<0&&c?.linkTdPrevId){const f=i.getTdById(c.linkTdPrevId);if(f){d=f.value,u=d.length-1,c=f;continue}}if(u<0)break;const g=d[u];if(g.controlId!==r.controlId||g.controlComponent===s.ControlComponent.PREFIX||g.controlComponent===s.ControlComponent.PRE_TEXT)break;g.controlComponent===s.ControlComponent.VALUE&&a.unshift(g),u--}c=l;let h=e,R=n+1;for(;;){if(R>=h.length&&c?.linkTdNextId){const f=i.getTdById(c.linkTdNextId);if(f){h=f.value,R=0,c=f;continue}}const g=h[R];if(!g||g.controlId!==r.controlId||g.controlComponent===s.ControlComponent.POSTFIX||g.controlComponent===s.ControlComponent.POST_TEXT)break;g.controlComponent===s.ControlComponent.VALUE&&a.push(g),R++}return a.filter(g=>g.type!==s.ElementType.SPLIT_TAG)}removeNextControlElement(t,e){const n=this.control.getDraw();if(e=e??n.getTd()?.linkTdNextId,e){const i=n.getTdById(e);if(i){if(i.value.length){if(i.value[1].controlId===t)return n.spliceElementList(i.value,1,1),i.value[1]}else if(i.linkTdNextId)return this.removeNextControlElement(t,i.linkTdNextId)}}}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const i=e.range||this.control.getRange(),l=e.elementList||this.control.getElementList(),r=l[i.startIndex],a=l[i.startIndex+1],c=M=>!!(M&&(M.controlComponent===s.ControlComponent.POSTFIX||M.controlComponent===s.ControlComponent.POST_TEXT||M.controlComponent===s.ControlComponent.POSTTEXTFIX||M.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)),d=!!(r?.originControlId&&c(r)&&a?.controlId===r.originControlId&&!a.originControlId&&a.control?.type===s.ControlType.TEXTFIELD&&c(a));let u=this.element.controlId||r?.controlId,h=this.element.originControlId||(this.element.controlId===r?.controlId?r?.originControlId:void 0),R=this.element.control||r.control;const T=!!(r?.controlId&&r.controlId!==this.element.controlId&&!r.originControlId&&r.control?.type===s.ControlType.TEXTFIELD);d?(u=r.originControlId,h=void 0,R=a.control):T&&(u=r.controlId,h=void 0,R=r.control);const g=(()=>{if(!u||!r?.subTemplateParentId||!c(r)||!kt(a,this.element)||a?.subTemplateParentId===r.subTemplateParentId)return!1;for(let M=i.startIndex-1;M>=0;M--){const V=l[M];if(V.type===s.ElementType.SUB_TEMPLATE&&V.id===r.subTemplateParentId)return V.controlId===u&&(V.originControlId||null)===(h||null)}return!1})(),f=!!u&&(g||r?.controlId!==u&&this._findNearestTextAncestorId(l,r?.originControlId)===u);!f&&!d&&!T&&(this.control.mergeControl(e),this.control.shrinkBoundary(e));const{startIndex:C,endIndex:p}=i,I=this.control.getDraw();C!==p?I.spliceElementList(l,C+1,p-C,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):f||d||T?this._removePlaceholdersByControl(l,u,h||null):this.control.removePlaceholder(C,{elementList:l});const m=l[C];f||d||T?this._removePlaceholdersByControl(l,u,h||null):this._removeControlPlaceholders(l,C);const L=m.type&&!Le.includes(m.type)||m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRE_TEXT?xt(m,["control","controlId","originControlId","subTemplateParentId","subTemplateInstanceId",...ue]):Ee(m,["type"]);g&&(delete L.subTemplateParentId,delete L.subTemplateInstanceId);const O=f||d||T,P=M=>{ue.forEach(V=>{delete M[V];const N=R?.[V];N!==void 0&&(M[V]=N)}),delete M.underline,delete M.textDecoration,R?.type===s.ControlType.TEXT&&M.color?.toLowerCase()==="#87d068"?M.color=this.options.defaultColor:M.color||(M.color=this.options.defaultColor)};O&&P(L),L.controlId=u,R&&(L.control=R),h?L.originControlId=h:delete L.originControlId;const S=this.options.mode===s.EditorMode.FORM&&this.options.modeRule.form.inputTraceEnabled,y=i.startIndex+1,Y=[],b=M=>{const V=Y.length?Y:l,N=Y.length?Y.length-1:d||g?i.startIndex+1:i.startIndex;le(V,[M],N,{editorOptions:this.options}),Y.push(M)};for(let M=0;M<t.length;M++){const V=t[M];if(V.type===s.ElementType.CONTROL&&V.control){const N=V,X=N.controlId||ft(),D=N.control?.value||[],E=N.control?.type,U=E===s.ControlType.TEXTFIELD,F=U?this.options.control.textFixColor:E===s.ControlType.TEXT||E===s.ControlType.NUMBER?"#87d068":this.options.control.bracketColor,Q={...Ee(L,["underline","textDecoration"]),controlId:X,type:s.ElementType.CONTROL,control:N.control,originControlId:u},W=U?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX,K=U?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX,k=U?N.control?.preTextFix||this.options.control.preTextFix:N.control?.prefix||this.options.control.prefix;for(let H=0;H<k.length;H++){const A={...Q,color:F,value:k[H],controlComponent:W};b(A)}for(let H=0;H<D.length;H++){const A=D[H],v={...Q,...A,controlComponent:s.ControlComponent.VALUE};(v.color===this.options.control.bracketColor||v.color===this.options.control.placeholderColor)&&(v.color=this.options.defaultColor),b(v)}if(D.length===0){const H=N.control?.placeholder||"";for(let A=0;A<H.length;A++){const v={...Q,value:H[A],controlComponent:s.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};b(v)}}const B=U?N.control?.postTextFix||this.options.control.postTextFix:N.control?.postfix||this.options.control.postfix;for(let H=0;H<B.length;H++){const A={...Q,color:F,value:B[H],controlComponent:K};b(A)}}else if(V.type||V.value){(m.controlComponent===s.ControlComponent.PRE_TEXT||m.controlComponent===s.ControlComponent.POST_TEXT||m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.POSTFIX)&&(L.color=this.options.defaultColor);const X=Ee(V,["control","controlId","controlComponent","originControlId"]),D={...L,...X,controlComponent:s.ControlComponent.VALUE};g&&(delete D.subTemplateParentId,delete D.subTemplateInstanceId),O&&P(D),(D.color===this.options.control.bracketColor||D.color===this.options.control.placeholderColor||D.color===this.options.control.textFixColor)&&(D.color=this.options.defaultColor),D.strikeout&&delete D.strikeout,S&&(D.textDecoration={style:s.TextDecorationStyle.DOUBLE},D.underline=!0),b(D)}}return Y.length&&I.spliceElementList(l,y,0,Y),i.startIndex+Y.length}_removeControlPlaceholders(t,e){const n=t[e];if(!n?.controlId)return;const i=a=>!!a&&a.controlId===n.controlId&&a.originControlId===n.originControlId;let l=e;for(;l>=0&&i(t[l]);)l--;let r=e+1;for(;r<t.length&&i(t[r]);)r++;for(let a=r-1;a>l;a--)t[a].controlComponent===s.ControlComponent.PLACEHOLDER&&t.splice(a,1)}_removePlaceholdersByControl(t,e,n){if(e)for(let i=t.length-1;i>=0;i--){const l=t[i];l.controlId===e&&(l.originControlId||null)===n&&l.controlComponent===s.ControlComponent.PLACEHOLDER&&t.splice(i,1)}}_findNearestTextAncestorId(t,e){if(!e)return null;const n=new Set;let i=e,l=null;for(;i&&!n.has(i);){n.add(i);let r;for(let a=0;a<t.length;a++){const c=t[a];if(c.controlId===i&&c.control?.type&&(r=c,c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT))break}if(!r)break;(r.control?.type===s.ControlType.TEXT||this.options.mode===s.EditorMode.EDIT&&r.control?.type===s.ControlType.TEXTFIELD)&&(l=i),i=r.originControlId||null}return l}clearValue(t={},e={}){if(!e.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const n=t.elementList||this.control.getElementList(),i=t.range||this.control.getValueRange()||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:l,endIndex:r}=i;return this.control.getDraw().spliceElementList(n,l+1,r-l,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),e.isAddPlaceholder!==!1&&(this.getValue(t).length||this.control.addPlaceholder(l,t)),l}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange(),i=W=>!!(W?.type&&oT.has(W.type)&&W.controlId&&W.controlComponent===s.ControlComponent.VALUE),l=W=>{const K=e[W];if(!i(K))return null;const k=K.controlId,B=K.originControlId||null,H=v=>v?.controlId===k&&(v?.originControlId||null)===B;if(this.draws.spliceElementList(e,W,1),!e.some(v=>H(v)&&v.controlComponent===s.ControlComponent.VALUE)){const v=e.findIndex(ct=>H(ct)&&(ct.controlComponent===s.ControlComponent.PREFIX||ct.controlComponent===s.ControlComponent.PRE_TEXT));v>=0&&this.control.addPlaceholder(v)}for(let v=Math.min(W-1,e.length-1);v>=0;v--){const ct=e[v];if(!H(ct))break;if(ct.controlComponent===s.ControlComponent.VALUE||ct.controlComponent===s.ControlComponent.PLACEHOLDER)return v}for(let v=Math.max(0,W);v<e.length;v++){const ct=e[v];if(!H(ct))break;if(ct.controlComponent===s.ControlComponent.VALUE||ct.controlComponent===s.ControlComponent.PLACEHOLDER)return v}return Math.max(0,W-1)};this.control.shrinkBoundary();const{startIndex:r,endIndex:a}=n,c=e[r],d=e[a],u=this.control.getDraw(),h=e[a+1];if(r===a){if(t.key===s.KeyMap.Backspace){const W=i(c)?r:i(e[r-1])?r-1:-1;if(W>=0)return l(W)}if(t.key===s.KeyMap.Delete){const W=i(c)?r:i(h)?a+1:-1;if(W>=0)return l(W)}}const R=this.options.mode===s.EditorMode.FORM,T=this.element.controlId||c.controlId,g=this.element.originControlId||c.originControlId||null,f=[];for(let W=0;W<e.length;W++){const K=e[W];K.controlId===T&&(K.originControlId||null)===g&&K.controlComponent===s.ControlComponent.VALUE&&f.push(W)}const C=!!(r!==a&&f.length&&r<f[0]&&a>=f[f.length-1]),p=W=>{if(!W)return null;const K=new Set;let k=W,B=null;for(;k&&!K.has(k);){K.add(k);let H;for(let A=0;A<e.length;A++){const v=e[A];if(v.controlId===k&&v.control?.type&&(H=v,v.controlComponent===s.ControlComponent.PREFIX||v.controlComponent===s.ControlComponent.PRE_TEXT||v.controlComponent===s.ControlComponent.PRETEXTFIX||v.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT))break}if(!H)break;(H.control?.type===s.ControlType.TEXT||this.options.mode===s.EditorMode.EDIT&&H.control?.type===s.ControlType.TEXTFIELD)&&(B=k),k=H.originControlId||null}return B},I=p(g),m=!!I,L=c.controlId===T&&(c.originControlId||null)===g,O=c.controlComponent===s.ControlComponent.VALUE,P=W=>{for(let K=r-1;K>=0;K--){const k=e[K];if(k.controlId===W&&!k.originControlId){if(k.controlComponent===s.ControlComponent.VALUE||k.controlComponent===s.ControlComponent.PLACEHOLDER)return K;if(k.controlComponent===s.ControlComponent.PREFIX||k.controlComponent===s.ControlComponent.PRE_TEXT||k.controlComponent===s.ControlComponent.PRETEXTFIX||k.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)break}if(k.controlId&&k.controlId!==W&&k.originControlId!==W)break}return-1},S=(W,K,k)=>{const B=A=>A?.controlId===K&&(A?.originControlId||null)===k;let H=-1;for(let A=W;A>=0;A--){const v=e[A];if(B(v)){if(v.controlComponent===s.ControlComponent.VALUE||v.controlComponent===s.ControlComponent.PLACEHOLDER)return A;if(v.controlComponent===s.ControlComponent.PREFIX||v.controlComponent===s.ControlComponent.PRE_TEXT||v.controlComponent===s.ControlComponent.PRETEXTFIX||v.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){H=A;break}}if(v.controlId&&v.controlId!==K&&v.originControlId!==K)break}for(let A=W+1;A<e.length;A++){const v=e[A];if(B(v)){if(v.controlComponent===s.ControlComponent.VALUE||v.controlComponent===s.ControlComponent.PLACEHOLDER)return A;if(v.controlComponent===s.ControlComponent.POSTFIX||v.controlComponent===s.ControlComponent.POST_TEXT||v.controlComponent===s.ControlComponent.POSTTEXTFIX||v.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){H===-1&&(H=A);break}}if(v.controlId&&v.controlId!==K&&v.originControlId!==K)break}return H>=0?H:W},Y=m&&L&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.TEXTFIXLABEL),b=e[a+1],M=!!b?.originControlId&&!!b?.controlId&&b.originControlId!==b.controlId&&(b.controlComponent===s.ControlComponent.PREFIX||b.controlComponent===s.ControlComponent.PRE_TEXT||b.controlComponent===s.ControlComponent.PRETEXTFIX||b.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||b.controlComponent===s.ControlComponent.PLACEHOLDER||b.controlComponent===s.ControlComponent.TEXTFIXLABEL),V=!!b?.originControlId&&!!b?.controlId&&b.originControlId!==b.controlId&&(b.controlComponent===s.ControlComponent.PREFIX||b.controlComponent===s.ControlComponent.PRE_TEXT||b.controlComponent===s.ControlComponent.PRETEXTFIX||b.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||b.controlComponent===s.ControlComponent.POSTFIX||b.controlComponent===s.ControlComponent.POST_TEXT||b.controlComponent===s.ControlComponent.POSTTEXTFIX||b.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||b.controlComponent===s.ControlComponent.PLACEHOLDER||b.controlComponent===s.ControlComponent.TEXTFIXLABEL),N=W=>this.options.mode===s.EditorMode.FORM?r:this.control.removeControl(W),X=c.controlComponent===s.ControlComponent.VALUE&&!c.originControlId&&!!b?.originControlId&&!!T&&p(b.originControlId)===T,D=W=>!!W&&W.controlId===c.controlId&&(W.originControlId||null)===(c.originControlId||null),E=W=>W?.controlComponent===s.ControlComponent.POSTFIX||W?.controlComponent===s.ControlComponent.POST_TEXT||W?.controlComponent===s.ControlComponent.POSTTEXTFIX||W?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT,U=()=>{const W=c.controlId,K=c.originControlId||null;return u.spliceElementList(e,r,1),e.some(B=>B.controlId===W&&(B.originControlId||null)===K&&B.controlComponent===s.ControlComponent.VALUE)||this.control.addPlaceholder(r-1),Math.max(r-1,0)},F=c.controlComponent===s.ControlComponent.VALUE&&!!c.originControlId&&D(b)&&E(b),Z=!!T&&!this.control.getIsExistValueByElementListIndex(e,r),Q=()=>{if(c.controlComponent!==s.ControlComponent.VALUE)return null;let W=r;for(let B=r;B>=0;B--){const H=e[B];if(!(H.controlId===c.controlId&&(H.originControlId||null)===(c.originControlId||null))||H.controlComponent!==s.ControlComponent.VALUE)break;if(!H.strikeout){W=B;break}}const K=e[W];if(!K||K.strikeout)return null;K.strikeout=!0,K.deletePerson="SWJ",K.deleteTime=lt(new Date).format("YYYY-MM-DD HH:mm:ss");let k=Math.max(W-1,0);for(let B=W-1;B>=0;B--){const H=e[B];if(!(H.controlId===K.controlId&&(H.originControlId||null)===(K.originControlId||null))){k=B;break}if(H.controlComponent!==s.ControlComponent.VALUE){k=B;break}if(!H.strikeout){k=B;break}k=Math.max(B-1,0)}return this.draws.render({curIndex:k,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),queueMicrotask(()=>{this.ranges.setRange(k,k),this.draws.setCursor(k)}),k};if(t.key===s.KeyMap.Backspace){if(r===a&&Z&&(c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))return r;if(R&&r===a&&I&&!L&&(c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)){const K=P(I);return K>=0?K:r}if(r===a&&Y&&!(R&&c.controlComponent===s.ControlComponent.VALUE&&!c.originControlId))return N(r);if(this.options.mode===s.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&!C&&(!m||O)){if(r===a&&c.controlComponent===s.ControlComponent.VALUE){const K=Q();if(K!==null)return K}return r===a&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER)?r:this.strikeout()}else{if(r===a&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER))return r;if(r!==a){u.spliceElementList(e,r+1,a-r);const K=e[r+1];return(K?.controlComponent===s.ControlComponent.POSTFIX||K?.controlComponent===s.ControlComponent.POST_TEXT||K?.controlComponent===s.ControlComponent.POSTTEXTFIX||K?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(r),r===0&&e[0].type===s.ElementType.SPLIT_TAG?u.fixPosition(!0)??r:r}else{const K=e[r-1],k=e[r+1];return!c.originControlId&&K?.controlId===c.controlId&&K?.originControlId===c.originControlId&&K?.controlComponent===s.ControlComponent.VALUE&&(c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&this.options.mode!==s.EditorMode.FORM?(u.spliceElementList(e,r-1,1),this.getValue().length||this.control.addPlaceholder(r-2),r-2):E(k)?k.originControlId?F?U():X?(u.spliceElementList(e,r,1),this.getValue().length||this.control.addPlaceholder(r-1),S(Math.max(r-1,0),c.controlId,c.originControlId||null)):N(r):(u.spliceElementList(e,r,1),this.control.addPlaceholder(r-1),S(Math.max(r-1,0),c.controlId,c.originControlId||null)):(u.spliceElementList(e,r,1),r===1&&e[0].type===s.ElementType.SPLIT_TAG||r===0?u.fixPosition(!0)??r-1:S(Math.max(r-1,0),c.controlId,c.originControlId||null))}}}else if(t.key===s.KeyMap.Delete){if(r===a&&Z&&(c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))return a;if(r===a&&(M||V)){if(X){const B=e[a+1];if(B?.controlComponent===s.ControlComponent.VALUE&&B.controlId===c.controlId&&!B.originControlId)return u.spliceElementList(e,a+1,1),this.getValue().length||this.control.addPlaceholder(r),r}return N(a+1)}const W=e[a+1],K=!!c.originControlId;if(this.options.mode===s.EditorMode.FORM&&this.options.modeRule.form.deleteTraceEnabled&&!C&&(!K||c.controlComponent===s.ControlComponent.VALUE))return d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POST_TEXT||d.controlComponent===s.ControlComponent.POSTTEXTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER?a:r===a&&(W?.controlComponent===s.ControlComponent.POSTFIX||W?.controlComponent===s.ControlComponent.POST_TEXT||W?.controlComponent===s.ControlComponent.POSTTEXTFIX||W?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)?W.originControlId?X?(u.spliceElementList(e,r+1,1),this.getValue().length||this.control.addPlaceholder(r),r):N(r+1):(u.spliceElementList(e,r+1,1),this.control.addPlaceholder(r),r):this.strikeout();{const B=e[a+1];if(c.controlComponent===s.ControlComponent.PLACEHOLDER)return a;if(r===a&&(B?.controlComponent===s.ControlComponent.POSTFIX||B?.controlComponent===s.ControlComponent.POST_TEXT||B?.controlComponent===s.ControlComponent.POSTTEXTFIX||B?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))return B.originControlId?X?(u.spliceElementList(e,r+1,1),this.getValue().length||this.control.addPlaceholder(r),r):N(r+1):(u.spliceElementList(e,r+1,1),this.control.addPlaceholder(r),r);if(r!==a){u.spliceElementList(e,r+1,a-r);const H=e[r+1];return E(H)&&this.control.addPlaceholder(r),r===0&&e[0].type===s.ElementType.SPLIT_TAG?u.fixPosition(!0)??r:r}else return B?(u.spliceElementList(e,r+1,1),r===0&&e[0].type===s.ElementType.SPLIT_TAG?u.fixPosition(!0)??r:r):(u.getTd()?.linkTdNextId&&c.controlId&&this.removeNextControlElement(c.controlId),a)}}return a}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();n.spliceElementList(i,t+1,e-t);const l=i[t+1];return(l?.controlComponent===s.ControlComponent.POSTFIX||l?.controlComponent===s.ControlComponent.POST_TEXT||l?.controlComponent===s.ControlComponent.POSTTEXTFIX||l?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(t),t}strikeout(t){const e=this.control.getRange(),{endIndex:n}=e,{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draws.isReadonly()||this.draws.isDisabled()))return null;const r=this.ranges.getSelectionElementList(),a=this.position.getCursorPosition(),c=lt(new Date).format("YYYY-MM-DD HH:mm:ss"),d=R=>{queueMicrotask(()=>{this.ranges.setRange(R,R),this.draws.setCursor(R)})},u=R=>{const T=this.control.getElementList(),g=T[R],f=g?.controlId,C=g?.originControlId||null;let p=-1;for(let I=R-1;I>=0;I--){const m=T[I];if(m.controlId===f&&(m.originControlId||null)===C&&m.controlComponent===s.ControlComponent.VALUE)return I;if(C){if(m.controlId&&m.controlId!==f&&m.originControlId!==C)break}else{if(m.controlId===f&&(m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRE_TEXT||m.controlComponent===s.ControlComponent.PRETEXTFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)){p=I;break}if(m.controlId&&m.controlId!==f&&!m.originControlId)break;if(m.originControlId===f&&(m.controlComponent===s.ControlComponent.POSTFIX||m.controlComponent===s.ControlComponent.POST_TEXT||m.controlComponent===s.ControlComponent.POSTTEXTFIX||m.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))return I}}if(p>=0){const I=p+1,m=T[I];return m?.controlId===f&&(m.controlComponent===s.ControlComponent.PLACEHOLDER||m.controlComponent===s.ControlComponent.VALUE)?I:p}return R},h=R=>{const T=this.control.getElementList(),g=T[R];if(!g?.controlId||g.controlComponent===s.ControlComponent.VALUE&&(g.metrics?.width??0)>0)return R;for(let f=R+1;f<T.length;f++){const C=T[f];if(C.controlId!==g.controlId||(C.originControlId||null)!==(g.originControlId||null))break;if(C.controlComponent===s.ControlComponent.VALUE&&(C.metrics?.width??0)>0)return f}for(let f=R-1;f>=0;f--){const C=T[f];if(C.controlId!==g.controlId||(C.originControlId||null)!==(g.originControlId||null))break;if(C.controlComponent===s.ControlComponent.VALUE&&(C.metrics?.width??0)>0)return f}return R};if(r?.length){if(!this.element.strikeout){const R=r.findIndex(T=>!T.strikeout);return r.forEach(T=>{T.deletePerson="SWJ",T.deleteTime=c,T.strikeout=!!~R}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),this.control.getRange().endIndex??null}}else{const R=h(a.index),T=this.control.getElementList()[R],g=this.control.getElementList();if(!this.control.getElementList()[R].strikeout&&T?.metrics.width>0){this.control.getElementList()[R].strikeout=!0,this.control.getElementList()[R].deletePerson="SWJ",this.control.getElementList()[R].deleteTime=c;const f=u(R);return this.ranges.setRange(f,f),this.draws.render({curIndex:f,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),d(f),f??null}else if(n>=0&&n<g.length&&g[n]?.metrics?.width!==void 0&&g[n].metrics.width<=0&&!g[n]?.strikeout){g.splice(n,1);const f=n-1;return this.ranges.setRange(f,f),this.draws.render({curIndex:f,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1}),this.ranges.setDefaultStyle({strikeout:!1}),d(f),f??null}}return n??null}strikeoute(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:l}=this.ranges.getRange(),a=this.draws.getElementList()[l];this.ranges.setDefaultStyle({strikeout:a.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}class Nl{draw;options;now;dom;renderOptions;isDatePicker;pickDate;lang;constructor(t,e={}){this.draw=t,this.options=e,this.lang=this._getLang(),this.now=new Date,this.dom=this._createDom(),this.renderOptions=null,this.isDatePicker=!0,this.pickDate=null,this._bindEvent()}_createDom(){const t=document.createElement("div");t.classList.add(`${st}-date-container`),t.setAttribute(ve,s.EditorComponent.POPUP);const e=document.createElement("div");e.classList.add(`${st}-date-wrap`);const n=document.createElement("div");n.classList.add(`${st}-date-title`);const i=document.createElement("span");i.classList.add(`${st}-date-title__pre-year`),i.innerText="<<";const l=document.createElement("span");l.classList.add(`${st}-date-title__pre-month`),l.innerText="<";const r=document.createElement("span");r.classList.add(`${st}-date-title__now`);const a=document.createElement("span");a.classList.add(`${st}-date-title__next-month`),a.innerText=">";const c=document.createElement("span");c.classList.add(`${st}-date-title__next-year`),c.innerText=">>",n.append(i),n.append(l),n.append(r),n.append(a),n.append(c);const d=document.createElement("div");d.classList.add(`${st}-date-week`);const{weeks:{sun:u,mon:h,tue:R,wed:T,thu:g,fri:f,sat:C}}=this.lang;[u,h,R,T,g,f,C].forEach(V=>{const N=document.createElement("span");N.innerText=`${V}`,d.append(N)});const I=document.createElement("div");I.classList.add(`${st}-date-day`),e.append(n),e.append(d),e.append(I);const m=document.createElement("ul");m.classList.add(`${st}-time-wrap`);let L,O,P;[this.lang.hour,this.lang.minute,this.lang.second].forEach((V,N)=>{const X=document.createElement("li"),D=document.createElement("span");D.innerText=V,X.append(D);const E=document.createElement("ol"),U=N===0,F=N===1,Z=U?24:60;for(let Q=0;Q<Z;Q++){const W=document.createElement("li");W.innerText=`${String(Q).padStart(2,"0")}`,W.setAttribute("data-id",`${Q}`),E.append(W)}U?L=E:F?O=E:P=E,X.append(E),m.append(X)});const y=document.createElement("div");y.classList.add(`${st}-date-menu`);const Y=document.createElement("button");Y.classList.add(`${st}-date-menu__time`),Y.innerText=this.lang.timeSelect;const b=document.createElement("button");b.classList.add(`${st}-date-menu__now`),b.innerText=this.lang.now;const M=document.createElement("button");return M.classList.add(`${st}-date-menu__submit`),M.innerText=this.lang.confirm,y.append(Y),y.append(b),y.append(M),t.append(e),t.append(m),t.append(y),this.draw.getContainer().append(t),{container:t,dateWrap:e,datePickerWeek:d,timeWrap:m,title:{preYear:i,preMonth:l,now:r,nextMonth:a,nextYear:c},day:I,time:{hour:L,minute:O,second:P},menu:{time:Y,now:b,submit:M}}}_bindEvent(){this.dom.title.preYear.onclick=()=>{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,l=this.draw.getHeight(),r=this.draw.getPageGap(),c=(i??this.draw.getPageNo())*(l+r);this.dom.container.style.left=`${t}px`,this.dom.container.style.top=`${e+c+n}px`}isInvalidDate(t){return t.toDateString()==="Invalid Date"}_setValue(){const t=this.renderOptions?.value;if(t){const e=new Date(t);this.now=this.isInvalidDate(e)?new Date:e}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:l,fri:r,sat:a}}=this.lang,c=[t,e,n,i,l,r,a];this.dom.datePickerWeek.childNodes.forEach((R,T)=>{const g=R;g.innerText=c[T]});const d=this.dom.time.hour.previousElementSibling;d.innerText=this.lang.hour;const u=this.dom.time.minute.previousElementSibling;u.innerText=this.lang.minute;const h=this.dom.time.second.previousElementSibling;h.innerText=this.lang.second}_update(){const t=new Date,e=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();let l=null,r=null,a=null;this.pickDate&&(l=this.pickDate.getFullYear(),r=this.pickDate.getMonth()+1,a=this.pickDate.getDate());const c=this.now.getFullYear(),d=this.now.getMonth()+1;this.dom.title.now.innerText=`${c}${this.lang.year} ${String(d).padStart(2,"0")}${this.lang.month}`;const h=new Date(c,d,0).getDate();let R=new Date(c,d-1,1).getDay();R===0&&(R=7);const T=new Date(c,d-1,0).getDate();this.dom.day.innerHTML="";const g=T-R+1;for(let C=g;C<=T;C++){const p=document.createElement("div");p.classList.add("disable"),p.innerText=`${C}`,p.onclick=()=>{const I=d-2;this.now=new Date(c,I,C),this._setDatePick(c,I,C)},this.dom.day.append(p)}for(let C=1;C<=h;C++){const p=document.createElement("div");e===c&&n===d&&i===C&&p.classList.add("active"),this.pickDate&&l===c&&r===d&&a===C&&p.classList.add("select"),p.innerText=`${C}`,p.onclick=I=>{const m=d-1;this.now=new Date(c,m,C),this._setDatePick(c,m,C),I.stopPropagation()},this.dom.day.append(p)}const f=42-R-h;for(let C=1;C<=f;C++){const p=document.createElement("div");p.classList.add("disable"),p.innerText=`${C}`,p.onclick=()=>{this.now=new Date(c,d,C),this._setDatePick(c,d,C)},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){this.now=new Date(t,e,n),this.pickDate?.setFullYear(t),this.pickDate?.setMonth(e),this.pickDate?.setDate(n),this._update()}_setTimePick(t=!0){const e=this.pickDate?.getHours()||0,n=this.pickDate?.getMinutes()||0,i=this.pickDate?.getSeconds()||0,{hour:l,minute:r,second:a}=this.dom.time;[l,r,a].forEach(u=>{u.querySelectorAll("li").forEach(h=>h.classList.remove("active"))}),[[l,e],[r,n],[a,i]].forEach(([u,h])=>{const R=u.querySelector(`[data-id='${h}']`);R.classList.add("active"),t&&Mi(u,R)})}_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(){if(this.options.onSubmit&&this.pickDate){const t=this.renderOptions?.dateFormat,e=this.formatDate(this.pickDate,t);this.options.onSubmit(e)}}formatDate(t,e="YYYY-MM-DD HH:mm:ss"){let n=e;const i=t.getFullYear().toString(),l=(t.getMonth()+1).toString(),r=t.getDate().toString(),a=t.getHours(),c=a%12===0?12:a%12,d=t.getMinutes().toString(),u=t.getSeconds().toString(),h=t.getMilliseconds().toString(),R={"y+":i,"Y+":i,"M+":l,"d+":r,"D+":r,"h+":c.toString(),"H+":a.toString(),"m+":d,"s+":u,"S+":h};for(const T in R){const g=new RegExp("("+T+")").exec(e),f=T;g&&(n=n.replace(g[1],g[1].length===1?R[f]:R[f].padStart(g[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 Lo{draw;element;control;isPopup;datePicker;options;constructor(t,e){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}getValue(t={}){const e=t.elementList||this.control.getElementList(),n=this.control.getValueRange(t);if(!n)return[];const i=[],{startIndex:l,endIndex:r}=n;for(let a=l;a<=r;a++){const c=e[a];c.controlComponent===s.ControlComponent.VALUE&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:r,endIndex:a}=l,c=this.control.getDraw();r!==a?c.spliceElementList(i,r+1,a-r):this.control.removePlaceholder(r,{elementList:i});const d=i[r],u=d.type&&!Le.includes(d.type)||d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT?xt(d,["control","controlId",...ue]):Ee(d,["type"]),h=l.startIndex+1;for(let R=0;R<t.length;R++){const T={...u,...t[R],controlComponent:s.ControlComponent.VALUE};le(i,[T],r,{editorOptions:this.options}),c.spliceElementList(i,h+R,0,[T])}return h+t.length-1}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const l=this.control.getValueRange(t);if(!l)return-1;const{startIndex:r,endIndex:a}=l;if(!~r||!~a)return-1;const c=t.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(c,r+1,a-r,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(r,t),r}setSelect(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return;const i=e.elementList||this.control.getElementList(),l=e.range||this.control.getRange(),r=this.getValue(e)[0],a=r?xt(r,Ne):xt(i[l.startIndex],ue),c=this.clearSelect(e,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~c)return;const d=Ee(i[c],Ne),u=c+1,h=this.control.getDraw();for(let R=0;R<t.length;R++){const T={...a,...d,type:s.ElementType.TEXT,value:t[R],controlComponent:s.ControlComponent.VALUE};(T.color===this.options.control.bracketColor||T.color===this.options.control.placeholderColor)&&(T.color=this.options.defaultColor),le(i,[T],c,{editorOptions:this.options}),h.spliceElementList(i,u+R,0,[T])}if(!e.range){const R=u+t.length-1;this.control.repaintControl({curIndex:R}),this.control.emitControlContentChange({context:e}),this.destroy()}}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:l}=n,r=e[i],a=e[l],c=this.control.getDraw();if(t.key===s.KeyMap.Backspace)return i!==l?(c.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT||a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT||r.controlComponent===s.ControlComponent.PLACEHOLDER?this.control.removeControl(i):(c.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(t.key===s.KeyMap.Delete){if(i!==l)return c.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i;{const d=e[l+1];return(r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT)&&d.controlComponent===s.ControlComponent.PLACEHOLDER||d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POST_TEXT||r.controlComponent===s.ControlComponent.PLACEHOLDER?this.control.removeControl(i):(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}}return l}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const t=this.control.getPosition();if(!t)return;const e=this.draw.getElementList(),{startIndex:n}=this.control.getRange();if(e[n+1]?.controlId!==this.element.controlId)return;this.datePicker=new Nl(this.draw,{onSubmit:this._setDate.bind(this)});const i=this.getValue().map(r=>r.value).join("")||"",l=this.element.control?.dateFormat;this.datePicker.render({value:i,position:t,dateFormat:l}),this.isPopup=!0}destroy(){this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}_setDate(t){t?this.setSelect(t):this.clearSelect(),this.destroy()}}class di extends Vs{isPopup;inputPopup;constructor(t,e){super(t,e),this.isPopup=!1,this.inputPopup=null}getIsPopup(){return this.isPopup}setValue(t,e={},n={}){if(t.some(I=>!Fc(I)))return-1;const i=e.elementList||this.control.getElementList(),l=e.range||this.control.getRange();this.control.shrinkBoundary(e);const r=rt(t),{startIndex:a,endIndex:c}=l,d=i[a];let u=null;for(let I=a;I>=0;I--)if(i[I].controlComponent===s.ControlComponent.PREFIX){u=i[I];break}const h=u?.control||this.element.control;if(this.control.getIsExistValueByElementListIndex(i,a)){let I=a;for(;I>0;){const L=i[I];if(L.controlId!==d.controlId||L.controlComponent===s.ControlComponent.PREFIX||L.controlComponent===s.ControlComponent.PRE_TEXT)break;r.unshift(L),I--}let m=c+1;for(;m<i.length;){const L=i[m];if(L.controlId!==d.controlId||L.controlComponent===s.ControlComponent.POSTFIX||L.controlComponent===s.ControlComponent.POST_TEXT)break;r.push(L),m++}}const R=Rr(r);if(!/^[+-]?(?:\d+)?(?:\.\d*)?(?:[eE][+-]?\d*)?$/.test(R))return-1;const g=h?.numberExclusiveOptions,f=g?.maxLength??null,C=g?.decimalPlaces??null,p=R.replace(/[+\-.eE]/g,"").length;if(f!=null&&p>f||C!=null&&(R.split(/[eE]/)[0].split(".")[1]||"").length>C)return-1;if(e.range||e.elementList){const I=Number(R),m=g?.minValue,L=g?.maxValue;if(!Number.isFinite(I)||m!=null&&I<m||L!=null&&I>L)return-1}return super.setValue(t,e,n)}_setNumberValue(t){const e=this.control.getElementList(),n=this.control.getRange(),{startIndex:i}=n;let l=null;for(let S=i;S>=0;S--)if(e[S].controlComponent===s.ControlComponent.PREFIX){l=e[S];break}const a=(l?.control||this.element.control)?.numberExclusiveOptions,c=a?.minValue,d=a?.maxValue,u=a?.minLength,h=a?.maxLength,R=t.trim(),T=R.replace(/[+\-.eE]/g,"").length,g=Number(R);if(u!=null&&T<u||h!=null&&T>h||c!=null&&g<c||d!=null&&g>d)return!1;let f=i;for(let S=i;S>=0;S--)if(e[S].controlComponent===s.ControlComponent.PREFIX){f=S;break}let C=f+1;for(let S=f+1;S<e.length;S++)if(e[S].controlComponent===s.ControlComponent.POSTFIX){C=S;break}const p=this.options.mode===s.EditorMode.FORM,I=p&&this.options.modeRule.form.inputTraceEnabled,m=p&&this.options.modeRule.form.deleteTraceEnabled,L=lt(new Date).format("YYYY-MM-DD HH:mm:ss");if(m)for(let S=f+1;S<C;S++){const y=e[S];y.controlComponent===s.ControlComponent.VALUE&&!y.strikeout&&y.value&&(y.strikeout=!0,y.deletePerson="SYSTEM",y.deleteTime=L),y.controlComponent===s.ControlComponent.PLACEHOLDER&&(this.control.getDraw().spliceElementList(e,S,1),C--,S--)}else{const S=f+1,y=C-S;y>0&&this.control.getDraw().spliceElementList(e,S,y),C=f+1}C=f+1;for(let S=f+1;S<e.length;S++)if(e[S].controlComponent===s.ControlComponent.POSTFIX){C=S;break}const O=[];for(let S=0;S<R.length;S++){const y={type:s.ElementType.TEXT,value:R[S],controlComponent:s.ControlComponent.VALUE,controlId:e[f].controlId,originControlId:e[f].originControlId,control:e[f].control};I&&(y.textDecoration={style:s.TextDecorationStyle.DOUBLE},y.underline=!0),O.push(y)}for(let S=0;S<O.length;S++)this.control.getDraw().spliceElementList(e,C+S,0,[O[S]]);const P=C+O.length-1;return this.control.getDraw().getRange().setRange(P,P),this.control.emitControlContentChange(),this.control.repaintControl({curIndex:P}),!0}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const t=this.control.getElementList(),e=this.control.getRange(),{startIndex:n}=e,i=t[n];if(!i||i.controlId!==this.element.controlId)return;let l=null;for(let g=n;g>=0;g--)if(t[g].controlComponent===s.ControlComponent.PREFIX){l=t[g];break}const r=l?.control||this.element.control,c=this.getValue().filter(g=>!g.strikeout),d=c.length>0?Rr(c):"",u=r?.numberExclusiveOptions,h=u?.minValue,R=u?.maxValue,T=u?.decimalPlaces;this.inputPopup=new iT({control:this.control,currentValue:d,minValue:h,maxValue:R,decimalPlaces:T,onConfirm:g=>{if(!g||g.trim()==="")return this._clearNumberValue(),!0;const f=Number(g);return Number.isNaN(f)||!Number.isFinite(f)?!1:this._setNumberValue(g)},onTab:g=>{this.destroy(),setTimeout(()=>{this.control.initNextControl({direction:g})})},onClose:()=>{this.destroy()}}),this.inputPopup.create(),this.isPopup=!0}_clearNumberValue(){const t=this.control.getElementList(),e=this.control.getRange(),{startIndex:n}=e;let i=n;for(let c=n;c>=0;c--)if(t[c].controlComponent===s.ControlComponent.PREFIX){i=c;break}let l=i+1;for(let c=i+1;c<t.length;c++)if(t[c].controlComponent===s.ControlComponent.POSTFIX){l=c;break}const r=i+1,a=l-r;a>0&&this.control.getDraw().spliceElementList(t,r,a),this.control.addPlaceholder(i),this.control.getDraw().getRange().setRange(i,i),this.control.emitControlContentChange(),this.control.repaintControl({curIndex:i})}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:l}=n,r=e[i],a=e[l],c=this.control.getDraw(),d=c.getMode()===s.EditorMode.FORM;if(t.key==="Backspace")return r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT||r.controlComponent===s.ControlComponent.PLACEHOLDER?d?i:this.control.removeControl(i):a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT?i:i!==l?(c.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):(c.spliceElementList(e,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(t.key==="Delete"){const u=e[l+1];return r.controlComponent===s.ControlComponent.PLACEHOLDER||a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT?d?l:this.control.removeControl(i):r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRE_TEXT||u?.controlComponent===s.ControlComponent.POSTFIX||u?.controlComponent===s.ControlComponent.POST_TEXT?l:i!==l?(c.spliceElementList(e,i+1,l-i),this.getValue().length||this.control.addPlaceholder(i),i):(c.spliceElementList(e,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}return l}destroy(){this.inputPopup&&(this.inputPopup.destroy(),this.inputPopup=null),this.isPopup=!1}}class iT{options;popupDom;constructor(t){this.options=t,this.popupDom=null}create(){const{currentValue:t,minValue:e,maxValue:n,decimalPlaces:i,onConfirm:l,onTab:r,onClose:a}=this.options,c=document.createElement("div");c.classList.add(`${st}-number-input-modal`),c.setAttribute(ve,s.EditorComponent.POPUP);const d=m=>{if(m.type==="mouseup"){const L=this.options.control.getDraw().getCanvasEvent();L.setIsAllowDrag(!1),L.setIsAllowSelection(!1)}m.stopPropagation()};c.addEventListener("mousedown",d),c.addEventListener("mouseup",d),c.addEventListener("click",d),c.addEventListener("keydown",d),c.addEventListener("input",d);const u=document.createElement("div");u.classList.add(`${st}-number-input-modal__content`);const h=document.createElement("div");if(h.classList.add(`${st}-number-input-modal__title`),h.textContent="请输入数值",u.appendChild(h),e!==void 0||n!==void 0){const m=document.createElement("div");m.classList.add(`${st}-number-input-modal__hint`);let L="有效范围:";e!==void 0&&n!==void 0?L+=`${e} ~ ${n}`:e!==void 0?L+=`≥ ${e}`:L+=`≤ ${n}`,i!=null&&(L+=`,保留${i}位小数`),m.textContent=L,u.appendChild(m)}const R=document.createElement("input");R.classList.add(`${st}-number-input-modal__input`),R.type="number",R.value=t,R.placeholder="请输入数值",e!==void 0&&(R.min=String(e)),n!==void 0&&(R.max=String(n)),i!=null&&(R.step=(1/Math.pow(10,i)).toString()),setTimeout(()=>{R.focus(),R.select()},100),u.appendChild(R);const T=document.createElement("div");T.classList.add(`${st}-number-input-modal__error`),T.style.display="none",u.appendChild(T);const g=document.createElement("div");g.classList.add(`${st}-number-input-modal__buttons`);const f=document.createElement("button");f.classList.add(`${st}-number-input-modal__cancel`),f.textContent="取消",f.onclick=()=>{a()},g.appendChild(f);const C=document.createElement("button");C.classList.add(`${st}-number-input-modal__confirm`),C.textContent="确定";const p=()=>{const m=R.value.trim();if(!m)return l("");const L=parseFloat(m);return Number.isNaN(L)||!Number.isFinite(L)?(T.textContent="请输入有效的数值",T.style.display="block",!1):i!=null&&(m.split(".")[1]||"").length>i?(T.textContent=`小数位数不能超过${i}位`,T.style.display="block",!1):e!==void 0&&L<e?(T.textContent=`数值不能小于 ${e}`,T.style.display="block",!1):n!==void 0&&L>n?(T.textContent=`数值不能大于 ${n}`,T.style.display="block",!1):(T.style.display="none",l(m))};C.onclick=()=>{p()&&a()},g.appendChild(C),u.appendChild(g),c.appendChild(u),R.onkeydown=m=>{m.key==="Enter"?C.click():m.key==="Tab"?(m.preventDefault(),p()&&(a(),r(m.shiftKey?zt.UP:zt.DOWN))):m.key==="Escape"&&a()},this.options.control.getContainer().appendChild(c),this.popupDom=c}destroy(){this.popupDom&&(this.popupDom.remove(),this.popupDom=null)}}class sT{options;mask;container;inputList;optionItemContainers;data;constructor(t){this.options=t,this.mask=null,this.container=null,this.inputList=[],this.optionItemContainers=[],this.data=t.data,this._render()}_getFieldValue(t){const e=this.inputList.filter(n=>n.name===t);if(e.length!==0){for(const n of e)if(n instanceof HTMLInputElement&&n.type==="radio"&&n.checked)return n.value;return e[0].value}}_updateFieldVisibility(){this.data.forEach((t,e)=>{if(t.visibleWhen){const{field:n,value:i}=t.visibleWhen,l=this._getFieldValue(n),r=this.optionItemContainers[e];if(r){const a=l===i;r.style.display=a?"":"none"}}})}_render(){const{title:t,onClose:e,onCancel:n,onConfirm:i}=this.options,l=document.createElement("div");l.classList.add("dialog-mask"),l.setAttribute(ve,s.EditorComponent.COMPONENT),document.body.append(l);const r=document.createElement("div");r.classList.add("dialog-container"),r.setAttribute(ve,s.EditorComponent.COMPONENT);const a=document.createElement("div");a.classList.add("dialog"),r.append(a);const c=document.createElement("div");c.classList.add("dialog-title");const d=document.createElement("span");d.append(document.createTextNode(t));const u=document.createElement("i");u.onclick=()=>{e&&e(),this._dispose()},c.append(d),c.append(u),a.append(c);const h=document.createElement("div");h.classList.add("dialog-option");for(let f=0;f<this.data.length;f++){const C=this.data[f],p=document.createElement("div");if(p.classList.add("dialog-option__item"),C.visible===!1&&(p.style.display="none"),C.label){const I=document.createElement("span");I.append(document.createTextNode(C.label)),p.append(I),C.required&&I.classList.add("dialog-option__item--require")}if(C.type==="radio"){const I=document.createElement("div");I.classList.add("dialog-radio-group"),C.horizontal&&I.classList.add("dialog-radio-group--horizontal"),C.options?.forEach(m=>{const L=document.createElement("label");L.classList.add("dialog-radio-item");const O=document.createElement("input");O.type="radio",O.name=C.name,O.value=m.value,m.value===(C.value||"")&&(O.checked=!0);const P=document.createElement("span");P.textContent=m.label,L.append(O),L.append(P),I.append(L),O.addEventListener("change",()=>{this._updateFieldVisibility()}),this.inputList.push(O)}),p.append(I)}else if(C.type==="select"){const I=document.createElement("select"),m=C.value||"";C.options?.forEach(L=>{const O=document.createElement("option");O.value=L.value,O.label=L.label,L.value===m&&(O.selected=!0),I.append(O)}),I.name=C.name,I.value=m,I.addEventListener("change",()=>{this._updateFieldVisibility()}),C.width&&(I.style.width=`${C.width}px`),p.append(I),this.inputList.push(I)}else if(C.type==="textarea"){const I=document.createElement("textarea");I.name=C.name,I.value=C.value||"",I.placeholder=C.placeholder||"",C.width&&(I.style.width=`${C.width}px`),C.height&&(I.style.height=`${C.height}px`),p.append(I),this.inputList.push(I)}else{const I=document.createElement("input");I.type=C.type,I.name=C.name,I.value=C.value||"",I.placeholder=C.placeholder||"",C.width&&(I.style.width=`${C.width}px`),C.height&&(I.style.height=`${C.height}px`),p.append(I),this.inputList.push(I)}h.append(p),this.optionItemContainers.push(p)}a.append(h);const R=document.createElement("div");R.classList.add("dialog-menu");const T=document.createElement("button");T.classList.add("dialog-menu__cancel"),T.append(document.createTextNode("取消")),T.type="button",T.onclick=()=>{n&&n(),this._dispose()},R.append(T);const g=document.createElement("button");g.append(document.createTextNode("确定")),g.type="submit",g.onclick=()=>{if(i){const f=new Set,C=[];for(const p of this.inputList)if(!f.has(p.name))if(p instanceof HTMLInputElement&&p.type==="radio"){const I=this.inputList.find(m=>m.name===p.name&&m instanceof HTMLInputElement&&m.checked);I&&(C.push({name:p.name,value:I.value}),f.add(p.name))}else C.push({name:p.name,value:p.value}),f.add(p.name);i(C)}this._dispose()},R.append(g),a.append(R),document.body.append(r),this.container=r,this.mask=l,this._updateFieldVisibility()}_dispose(){this.mask?.remove(),this.container?.remove()}}function rT(o,t){const e=o.trim();if(!e)return;const n=t?.key===e;return{...n?t:{},key:e,label:n&&t?.label?t.label:e,writeTarget:t?.writeTarget||"self",writeMode:t?.writeMode||"replaceOnConfirm"}}class Nn{draw;element;control;isPopup;datePicker;options;range;static isDeleting=!1;inputModal=null;constructor(t,e){const n=e.getDraw();this.draw=n,this.range=n.getRange(),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}getValue(t={}){const e=t.elementList||this.control.getElementList(),n=this.control.getValueRange(t);if(!n)return[];const i=[],{startIndex:l,endIndex:r}=n;for(let a=l;a<=r;a++){const c=e[a];c.controlComponent===s.ControlComponent.VALUE&&!fe(c)&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&(this.control.getIsDisabledControl(e)||this.element.control?.editable===!1))return-1;const i=e.elementList||this.control.getElementList(),l=e.range||this.control.getRange(),{startIndex:r,endIndex:a}=l,c=i[r],d=this.element.controlId||c.controlId,u=this.element.originControlId||c.originControlId||null;if(!d)return-1;const h=this.getButtonControlBounds(i,d,u);if(!h)return-1;const R=this.getButtonBusinessOffset(i,h,r),T=this.getButtonBusinessOffset(i,h,a),g=this.getButtonBusinessElements(i,h),f=this.splitButtonBusinessElements(t),C=[...g.slice(0,R),...f,...g.slice(T)];return this.replaceButtonBusinessElements(i,h,C,R+f.length)}isSameButtonElement(t,e,n){return!!(t&&t.controlId===e&&(t.originControlId||null)===n)}getButtonControlBounds(t,e,n){let i=-1,l=-1;for(let r=0;r<t.length;r++){const a=t[r];this.isSameButtonElement(a,e,n)&&(i===-1&&a.controlComponent===s.ControlComponent.PREFIX&&(i=r),a.controlComponent===s.ControlComponent.POSTFIX&&(l=r))}return i===-1||l===-1?null:{controlId:e,originControlId:n,prefixIndex:i,postfixIndex:l}}getButtonBusinessOffset(t,e,n){let i=0;const l=Math.min(n,e.postfixIndex-1);for(let r=e.prefixIndex+1;r<=l;r++){const a=t[r];this.isSameButtonElement(a,e.controlId,e.originControlId)&&a.controlComponent===s.ControlComponent.VALUE&&!fe(a)&&i++}return i}toButtonBusinessElement(t){const e={value:t.value===`
125
+ `?_:t.value||""};return[...ce,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"].forEach(i=>{const l=t[i];l!==void 0&&(e[i]=l)}),e}splitButtonBusinessElements(t){const e=[];return t.forEach(n=>{fe(n)||Nt(n.value===_?`
126
126
  `:n.value||"").forEach(i=>{e.push(this.toButtonBusinessElement({...n,value:i===`
127
- `?_:i}))})}),e}getButtonBusinessElements(t,e){const n=[];for(let i=e.prefixIndex+1;i<e.postfixIndex;i++){const l=t[i];this.isSameButtonElement(l,e.controlId,e.originControlId)&&l.controlComponent===s.ControlComponent.VALUE&&!me(l)&&n.push(this.toButtonBusinessElement(l))}return n}getButtonBusinessText(t){return t.map(e=>e.value===_?`
127
+ `?_:i}))})}),e}getButtonBusinessElements(t,e){const n=[];for(let i=e.prefixIndex+1;i<e.postfixIndex;i++){const l=t[i];this.isSameButtonElement(l,e.controlId,e.originControlId)&&l.controlComponent===s.ControlComponent.VALUE&&!fe(l)&&n.push(this.toButtonBusinessElement(l))}return n}getButtonBusinessText(t){return t.map(e=>e.value===_?`
128
128
  `:e.value||"").join("")}createButtonRenderedValueElements(t,e,n){const i=t[e.prefixIndex],l=i.control||this.element.control;if(!l)return[];const r=xt(i,["control","controlId","originControlId",...ue,...ce]);r.control=l,r.controlId=e.controlId,e.originControlId?r.originControlId=e.originControlId:delete r.originControlId;const a=this.splitButtonBusinessElements(n),c=Ln(this.getButtonBusinessText(a),l);let d=0;return c.map(u=>{const h=u.buttonValueLayout?null:a[d++],R={...r,...h||{},value:u.value===`
129
- `?_:u.value,type:s.ElementType.CONTROL,control:l,controlId:e.controlId,controlComponent:s.ControlComponent.VALUE};return e.originControlId?R.originControlId=e.originControlId:delete R.originControlId,u.buttonValueLayout?(R.buttonValueLayout=!0,R.buttonValueLayoutPrefixOffset=u.buttonValueLayoutPrefixOffset,R.color=this.options.defaultColor,R.highlight=void 0):(delete R.buttonValueLayout,delete R.buttonValueLayoutPrefixOffset,R.color=h?.color||this.options.defaultColor),R})}getCursorIndexByBusinessOffset(t,e,n){let i=0,l=e.prefixIndex;for(let r=e.prefixIndex+1;r<e.postfixIndex;r++){const a=t[r];if(!(!this.isSameButtonElement(a,e.controlId,e.originControlId)||a.controlComponent!==s.ControlComponent.VALUE)){if(me(a)){i===n&&(l=r);continue}if(i++,l=r,i===n){let c=r+1;for(;c<e.postfixIndex&&me(t[c]);)l=c,c++;return l}}}return l}replaceButtonBusinessElements(t,e,n,i){const l=n.length?rt(n):null,r=this.createButtonRenderedValueElements(t,e,n);t.splice(e.prefixIndex+1,Math.max(e.postfixIndex-e.prefixIndex-1,0),...r);const a=e.prefixIndex+r.length+1;for(let u=e.prefixIndex;u<=a;u++){const h=t[u];this.isSameButtonElement(h,e.controlId,e.originControlId)&&h.control&&(h.control.value=l?rt(l):null)}const c={...e,postfixIndex:a};return l?this.getCursorIndexByBusinessOffset(t,c,i):(this.syncButtonPlaceholderElements(e.controlId,t[e.prefixIndex]?.control?.placeholder||""),e.prefixIndex)}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const l=this.control.getValueRange(t);if(!l)return-1;const{startIndex:r,endIndex:a}=l;if(!~r||!~a)return-1;const c=t.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(c,r+1,a-r,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(r,t),r}keydown(t){if(this.control.getIsDisabledControl()||this.element.control?.editable===!1)return null;const e=this.control.getElementList(),n=this.control.getRange(),{startIndex:i,endIndex:l}=n,r=e[i],a=e[l],c=this.element.controlId||a?.controlId,d=this.element.originControlId||a?.originControlId||null;if(!c)return null;if(!!a?.originControlId&&!!a?.controlId&&a.originControlId!==a.controlId&&a.control?.type===s.ControlType.BUTTON&&!a.control?.buttonText&&a.control?.editable===!1&&(t.key===s.KeyMap.Backspace||t.key===s.KeyMap.Delete))return this.control.removeControl(l);const h=this.getButtonControlBounds(e,c,d);if(!h)return null;const R=this.getButtonBusinessElements(e,h),T=(g,f)=>{const C=Math.max(0,g),p=Math.min(R.length,f),I=[...R.slice(0,C),...R.slice(p)];return this.replaceButtonBusinessElements(e,h,I,C)};if(i!==l){const g=this.getButtonBusinessOffset(e,h,i),f=this.getButtonBusinessOffset(e,h,l);return T(g,f)}if(t.key===s.KeyMap.Backspace){const g=this.getButtonBusinessOffset(e,h,l);return g<=0?this.getCursorIndexByBusinessOffset(e,h,0):T(g-1,g)}if(t.key===s.KeyMap.Delete){const g=this.getButtonBusinessOffset(e,h,l);return g>=R.length?this.getCursorIndexByBusinessOffset(e,h,R.length):r?.controlComponent===s.ControlComponent.PREFIX&&a?.controlComponent===s.ControlComponent.PREFIX?T(0,1):T(g,g+1)}return null}removeByValue(t,e){return Nn.isDeleting=!0,new Promise(n=>{for(let c=t.length-1;c>=0;c--)(t[c].type=="control"||t[c].type=="text")&&t[c].controlId===e&&t.splice(c,1);const{startIndex:i,endIndex:l}=this.range.getRange(),r=!0,a=l;this.draw.render({curIndex:a,isSetCursor:r}),setTimeout(()=>{Nn.isDeleting=!1},300),n(!0)})}cut(){if(this.control.getIsDisabledControl()||this.element.control?.editable===!1)return-1;const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getElementList(),i=n[t],l=this.element.controlId||i?.controlId,r=this.element.originControlId||i?.originControlId||null;if(!l)return-1;const a=this.getButtonControlBounds(n,l,r);if(!a)return-1;const c=this.getButtonBusinessOffset(n,a,t),d=this.getButtonBusinessOffset(n,a,e),u=this.getButtonBusinessElements(n,a),h=[...u.slice(0,c),...u.slice(d)];return this.replaceButtonBusinessElements(n,a,h,c)}awake(t){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl()||Nn.isDeleting||!this.control.getPosition())return;const n=this.draw.getElementList(),{startIndex:i}=this.control.getRange();if(n[i]?.controlId!==this.element?.controlId)return;const l=this.control.getDraw().getPosition().getPositionContext();if(!l.isDirectHit||l.index!==i||n[l.index]?.controlId!==this.element?.controlId)return;const r=n[i]?.controlId,a=n[i]?.control;if(r?.endsWith("_text")||a?.buttonText)return;const c=n[i].controlId;if(!c)return;const d=n.filter(h=>h.controlId===c),u=d[0];if(u?.control&&this.options.mode!="form"&&this.options.mode=="edit"){const h=this.draw.getEventBus();if(t&&h.isSubscribe("buttonClick")){const R={evt:t,element:rt(u),elementList:rt(d),controlId:c,control:rt(u.control)};h.emit("buttonClick",R)}this.showEditModal(d)}}closeInputModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}syncButtonPlaceholderElements(t,e){const n=this.control.getElementList(),i=[];let l=null,r=-1,a=!1;if(n.forEach((u,h)=>{u.controlId!==t||u.control?.type!==s.ControlType.BUTTON||(u.control.placeholder=e,l||=u,u.controlComponent===s.ControlComponent.VALUE&&!me(u)&&(a=!0),u.controlComponent===s.ControlComponent.PLACEHOLDER&&i.push({element:u,index:h}),r===-1&&u.controlComponent===s.ControlComponent.POSTFIX&&(r=h))}),!l)return;const c=i.length?Math.min(...i.map(u=>u.index)):r;i.length&&i.sort((u,h)=>h.index-u.index).forEach(u=>{n.splice(u.index,1)});const d=Nt(e);!d.length||a&&!i.length||c<0||d.forEach((u,h)=>{const R={...xt(l,[...ue,...ce]),value:u===`
129
+ `?_:u.value,type:s.ElementType.CONTROL,control:l,controlId:e.controlId,controlComponent:s.ControlComponent.VALUE};return e.originControlId?R.originControlId=e.originControlId:delete R.originControlId,u.buttonValueLayout?(R.buttonValueLayout=!0,R.buttonValueLayoutPrefixOffset=u.buttonValueLayoutPrefixOffset,R.color=this.options.defaultColor,R.highlight=void 0):(delete R.buttonValueLayout,delete R.buttonValueLayoutPrefixOffset,R.color=h?.color||this.options.defaultColor),R})}getCursorIndexByBusinessOffset(t,e,n){let i=0,l=e.prefixIndex;for(let r=e.prefixIndex+1;r<e.postfixIndex;r++){const a=t[r];if(!(!this.isSameButtonElement(a,e.controlId,e.originControlId)||a.controlComponent!==s.ControlComponent.VALUE)){if(fe(a)){i===n&&(l=r);continue}if(i++,l=r,i===n){let c=r+1;for(;c<e.postfixIndex&&fe(t[c]);)l=c,c++;return l}}}return l}replaceButtonBusinessElements(t,e,n,i){const l=n.length?rt(n):null,r=this.createButtonRenderedValueElements(t,e,n);t.splice(e.prefixIndex+1,Math.max(e.postfixIndex-e.prefixIndex-1,0),...r);const a=e.prefixIndex+r.length+1;for(let u=e.prefixIndex;u<=a;u++){const h=t[u];this.isSameButtonElement(h,e.controlId,e.originControlId)&&h.control&&(h.control.value=l?rt(l):null)}const c={...e,postfixIndex:a};return l?this.getCursorIndexByBusinessOffset(t,c,i):(this.syncButtonPlaceholderElements(e.controlId,t[e.prefixIndex]?.control?.placeholder||""),e.prefixIndex)}clearSelect(t={},e={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=e;if(!n&&this.control.getIsDisabledControl(t))return-1;const l=this.control.getValueRange(t);if(!l)return-1;const{startIndex:r,endIndex:a}=l;if(!~r||!~a)return-1;const c=t.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(c,r+1,a-r,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(r,t),r}keydown(t){if(this.control.getIsDisabledControl()||this.element.control?.editable===!1)return null;const e=this.control.getElementList(),n=this.control.getRange(),{startIndex:i,endIndex:l}=n,r=e[i],a=e[l],c=this.element.controlId||a?.controlId,d=this.element.originControlId||a?.originControlId||null;if(!c)return null;if(!!a?.originControlId&&!!a?.controlId&&a.originControlId!==a.controlId&&a.control?.type===s.ControlType.BUTTON&&!a.control?.buttonText&&a.control?.editable===!1&&(t.key===s.KeyMap.Backspace||t.key===s.KeyMap.Delete))return this.control.removeControl(l);const h=this.getButtonControlBounds(e,c,d);if(!h)return null;const R=this.getButtonBusinessElements(e,h),T=(g,f)=>{const C=Math.max(0,g),p=Math.min(R.length,f),I=[...R.slice(0,C),...R.slice(p)];return this.replaceButtonBusinessElements(e,h,I,C)};if(i!==l){const g=this.getButtonBusinessOffset(e,h,i),f=this.getButtonBusinessOffset(e,h,l);return T(g,f)}if(t.key===s.KeyMap.Backspace){const g=this.getButtonBusinessOffset(e,h,l);return g<=0?this.getCursorIndexByBusinessOffset(e,h,0):T(g-1,g)}if(t.key===s.KeyMap.Delete){const g=this.getButtonBusinessOffset(e,h,l);return g>=R.length?this.getCursorIndexByBusinessOffset(e,h,R.length):r?.controlComponent===s.ControlComponent.PREFIX&&a?.controlComponent===s.ControlComponent.PREFIX?T(0,1):T(g,g+1)}return null}removeByValue(t,e){return Nn.isDeleting=!0,new Promise(n=>{for(let c=t.length-1;c>=0;c--)(t[c].type=="control"||t[c].type=="text")&&t[c].controlId===e&&t.splice(c,1);const{startIndex:i,endIndex:l}=this.range.getRange(),r=!0,a=l;this.draw.render({curIndex:a,isSetCursor:r}),setTimeout(()=>{Nn.isDeleting=!1},300),n(!0)})}cut(){if(this.control.getIsDisabledControl()||this.element.control?.editable===!1)return-1;const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getElementList(),i=n[t],l=this.element.controlId||i?.controlId,r=this.element.originControlId||i?.originControlId||null;if(!l)return-1;const a=this.getButtonControlBounds(n,l,r);if(!a)return-1;const c=this.getButtonBusinessOffset(n,a,t),d=this.getButtonBusinessOffset(n,a,e),u=this.getButtonBusinessElements(n,a),h=[...u.slice(0,c),...u.slice(d)];return this.replaceButtonBusinessElements(n,a,h,c)}awake(t){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl()||Nn.isDeleting||!this.control.getPosition())return;const n=this.draw.getElementList(),{startIndex:i}=this.control.getRange();if(n[i]?.controlId!==this.element?.controlId)return;const l=this.control.getDraw().getPosition().getPositionContext();if(!l.isDirectHit||l.index!==i||n[l.index]?.controlId!==this.element?.controlId)return;const r=n[i]?.controlId,a=n[i]?.control;if(r?.endsWith("_text")||a?.buttonText)return;const c=n[i].controlId;if(!c)return;const d=n.filter(h=>h.controlId===c),u=d[0];if(u?.control&&this.options.mode!="form"&&this.options.mode=="edit"){const h=this.draw.getEventBus();if(t&&h.isSubscribe("buttonClick")){const R={evt:t,element:rt(u),elementList:rt(d),controlId:c,control:rt(u.control)};h.emit("buttonClick",R)}this.showEditModal(d)}}closeInputModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}syncButtonPlaceholderElements(t,e){const n=this.control.getElementList(),i=[];let l=null,r=-1,a=!1;if(n.forEach((u,h)=>{u.controlId!==t||u.control?.type!==s.ControlType.BUTTON||(u.control.placeholder=e,l||=u,u.controlComponent===s.ControlComponent.VALUE&&!fe(u)&&(a=!0),u.controlComponent===s.ControlComponent.PLACEHOLDER&&i.push({element:u,index:h}),r===-1&&u.controlComponent===s.ControlComponent.POSTFIX&&(r=h))}),!l)return;const c=i.length?Math.min(...i.map(u=>u.index)):r;i.length&&i.sort((u,h)=>h.index-u.index).forEach(u=>{n.splice(u.index,1)});const d=Nt(e);!d.length||a&&!i.length||c<0||d.forEach((u,h)=>{const R={...xt(l,[...ue,...ce]),value:u===`
130
130
  `?_:u,controlId:t,type:s.ElementType.CONTROL,control:l.control,controlComponent:s.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor,hide:a};le(n,[R],c-1+h,{editorOptions:this.options}),n.splice(c+h,0,R)})}getControlValueText(t){return(t||[]).map(e=>e.value===_?`
131
131
  `:e.value||"").join("")}rebuildButtonValueElements(t){const e=this.control.getElementList(),n=e.findIndex(u=>u.controlId===t&&u.control?.type===s.ControlType.BUTTON&&u.controlComponent===s.ControlComponent.PREFIX);if(n<0)return;const i=e.findIndex((u,h)=>h>n&&u.controlId===t&&u.control?.type===s.ControlType.BUTTON&&u.controlComponent===s.ControlComponent.POSTFIX);if(i<0)return;const l=e[n].control;if(!l?.value?.length)return;const r=this.getControlValueText(l.value),a=Ln(r,l),c={...xt(e[n],[...ue,...ce]),controlId:t,type:s.ElementType.CONTROL,control:l,controlComponent:s.ControlComponent.VALUE,color:this.options.defaultColor,highlight:void 0},d=a.map(u=>({...c,value:u.value===`
132
- `?_:u.value,buttonValueLayout:u.buttonValueLayout,buttonValueLayoutPrefixOffset:u.buttonValueLayoutPrefixOffset}));e.splice(n+1,Math.max(i-n-1,0),...d)}showEditModal(t){const e=t[0]?.control||{},n=e.buttonLabel||e.label||"事件",i=e.placeholder||"",l=e.code||"",r=e.action?.key||"",a=e.editable!==!1?"true":"false",c=wn(e.valueLayout),d=c.newline?"true":"false",u=String(c.indentChars);this.isPopup=!0,new sT({title:"修改事件控件属性",data:[{type:"text",label:"显示文本",name:"buttonLabel",required:!0,placeholder:"请输入显示文本",value:n},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词",value:i},{type:"text",label:"事件代码",name:"code",placeholder:"请输入事件代码",value:l},{type:"text",label:"执行事件",name:"actionKey",placeholder:"请输入跳转功能名",value:r},{type:"radio",label:"是否可编辑",name:"editable",options:[{label:"是",value:"true"},{label:"否",value:"false"}],value:a,horizontal:!0},{type:"radio",label:"值另起一行",name:"valueLayoutNewline",options:[{label:"是",value:"true"},{label:"否",value:"false"}],value:d,horizontal:!0},{type:"number",label:"缩进字符数",name:"valueLayoutIndentChars",placeholder:"0-20",value:u}],onClose:()=>{this.isPopup=!1},onCancel:()=>{this.isPopup=!1},onConfirm:h=>{const R=h.find(O=>O.name==="buttonLabel")?.value?.trim()||"事件",T=h.find(O=>O.name==="placeholder")?.value||"",g=h.find(O=>O.name==="code")?.value?.trim()||"",f=h.find(O=>O.name==="actionKey")?.value?.trim()||"",C=rT(f,e.action),p=h.find(O=>O.name==="editable")?.value!=="false",I=wn({newline:h.find(O=>O.name==="valueLayoutNewline")?.value==="true",indentChars:Number(h.find(O=>O.name==="valueLayoutIndentChars")?.value)}),m=this.control.getElementList(),L=t[0]?.controlId;if(L){for(let O=0;O<m.length;O++){const P=m[O];P.controlId===L&&P.control&&(P.control.buttonLabel=R,P.control.label=R,P.control.placeholder=T,P.control.code=g,P.control.editable=p,P.control.valueLayout=I,C?P.control.action=C:delete P.control.action)}this.rebuildButtonValueElements(L),this.syncButtonPlaceholderElements(L,T)}this.draw.render({curIndex:this.control.getRange().endIndex,isSubmitHistory:!0}),this.isPopup=!1}})}destroy(){this.inputModal&&this.closeInputModal(),this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}}class bl{draws;ranges;element;control;options;position;constructor(t,e){const n=e.getDraw();this.draws=n,this.position=n.getPosition(),this.ranges=n.getRange(),this.options=n.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();let{startIndex:n}=t.range||this.control.getRange();const i=this.control.getDraw(),l=t?null:i.getTd();n>=e.length&&(n=e.length-1);const r=e[n],a=[];let c=l;if(r.controlComponent===s.ControlComponent.PRETEXTFIX||r.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){let g=n+1;for(;g<e.length;){const f=e[g];if(f.controlId!==r.controlId||f.controlComponent!==s.ControlComponent.PRETEXTFIX&&f.controlComponent!==s.ControlComponent.PRETEXTFIX_TEXT){n=g-1;break}g++}}let d=e,u=n;for(;;){if(u<0&&c?.linkTdPrevId){const f=i.getTdById(c.linkTdPrevId);if(f){d=f.value,u=d.length-1,c=f;continue}}if(u<0)break;const g=d[u];if(g.controlId!==r.controlId||g.controlComponent===s.ControlComponent.PRETEXTFIX||g.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||g.controlComponent===s.ControlComponent.TEXTFIXLABEL)break;g.controlComponent===s.ControlComponent.VALUE&&a.unshift(g),u--}c=l;let h=e,R=n+1;for(;;){if(R>=h.length&&c?.linkTdNextId){const f=i.getTdById(c.linkTdNextId);if(f){h=f.value,R=0,c=f;continue}}const g=h[R];if(!g||g.controlId!==r.controlId||g.controlComponent===s.ControlComponent.POSTTEXTFIX||g.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||g.controlComponent===s.ControlComponent.TEXTFIXLABEL)break;g.controlComponent===s.ControlComponent.VALUE&&a.push(g),R++}return a.filter(g=>g.type!==s.ElementType.SPLIT_TAG)}removeNextControlElement(t,e){const n=this.control.getDraw();if(e=e??n.getTd()?.linkTdNextId,e){const i=n.getTdById(e);if(i){if(i.value.length){if(i.value[1].controlId===t)return n.spliceElementList(i.value,1,1),i.value[1]}else if(i.linkTdNextId)return this.removeNextControlElement(t,i.linkTdNextId)}}}setValue(t,e={},n={}){if(this.options.mode===s.EditorMode.FORM||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:r,endIndex:a}=l,c=this.control.getDraw();r!==a?c.spliceElementList(i,r+1,a-r,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):this.control.removePlaceholder(r,{elementList:i});const d=i[r],u=i[r+1];let h=d.originControlId||d.controlId,R=d.originControlId&&(d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===s.ControlComponent.POST_TEXT);if(!R&&d.controlId&&(d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===s.ControlComponent.POST_TEXT)&&u?.controlId&&u.controlId!==d.controlId)if(u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRETEXTFIX)for(let p=r;p>=0;p--){const I=i[p];if(I.controlId===d.controlId&&(I.controlComponent===s.ControlComponent.PREFIX||I.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let m=p-1;m>=0;m--){const L=i[m];if(L.controlId&&L.controlId!==d.controlId&&(L.controlComponent===s.ControlComponent.PRETEXTFIX||L.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||L.controlComponent===s.ControlComponent.PREFIX||L.controlComponent===s.ControlComponent.PRE_TEXT)){h=L.controlId,R=!0;break}if(L.controlId&&L.controlId!==d.controlId&&(L.controlComponent===s.ControlComponent.POSTFIX||L.controlComponent===s.ControlComponent.POSTTEXTFIX))break}break}}else(u.controlComponent===s.ControlComponent.POSTFIX||u.controlComponent===s.ControlComponent.POSTTEXTFIX)&&(h=u.controlId,R=!0);if(!R&&d.controlId&&(d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===s.ControlComponent.POST_TEXT))for(let p=r;p>=0;p--){const I=i[p];if(I.controlId===d.controlId&&(I.controlComponent===s.ControlComponent.PREFIX||I.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let m=p-1;m>=0;m--){const L=i[m];if(L.controlId&&L.controlId!==d.controlId&&(L.controlComponent===s.ControlComponent.PRETEXTFIX||L.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||L.controlComponent===s.ControlComponent.PREFIX||L.controlComponent===s.ControlComponent.PRE_TEXT)){h=L.controlId,R=!0;break}if(L.controlId&&L.controlId!==d.controlId&&(L.controlComponent===s.ControlComponent.POSTFIX||L.controlComponent===s.ControlComponent.POSTTEXTFIX))break}break}}const T=d.type&&!Le.includes(d.type)||d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT?xt(d,["control","controlId",...ue]):Ee(d,["type"]);R&&(T.controlId=h,delete T.originControlId);const g=l.startIndex+1,f=[],C=p=>{const I=f.length?f:i,m=f.length?f.length-1:l.startIndex;le(I,[p],m,{editorOptions:this.options}),f.push(p)};for(let p=0;p<t.length;p++){const I=t[p];if(I.type===s.ElementType.CONTROL&&I.control){const m=I,L=m.controlId||ft(),O=m.control?.value||[],P=m.control?.type,S=P===s.ControlType.TEXTFIELD,y=S?this.options.control.textFixColor:P===s.ControlType.TEXT||P===s.ControlType.NUMBER?"#87d068":this.options.control.bracketColor,Y={...T,controlId:L,type:s.ElementType.CONTROL,control:m.control,originControlId:h},b=S?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX,M=S?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX,V=S?m.control?.preTextFix||this.options.control.preTextFix:m.control?.prefix||this.options.control.prefix;for(let X=0;X<V.length;X++){const D={...Y,color:y,value:V[X],controlComponent:b};C(D)}for(let X=0;X<O.length;X++){const D=O[X],E={...Y,...D,controlComponent:s.ControlComponent.VALUE,type:D.type};(E.color===this.options.control.textFixColor||E.color===this.options.control.placeholderColor)&&(E.color=this.options.defaultColor),C(E)}if(O.length===0){const X=m.control?.placeholder||"";for(let D=0;D<X.length;D++){const E={...Y,value:X[D],controlComponent:s.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};C(E)}}const N=S?m.control?.postTextFix||this.options.control.postTextFix:m.control?.postfix||this.options.control.postfix;for(let X=0;X<N.length;X++){const D={...Y,color:y,value:N[X],controlComponent:M};C(D)}}else if(I.type||I.value){T.color=this.options.defaultColor;const m={...T,...I,controlComponent:s.ControlComponent.VALUE};R&&(m.color=this.element.control?.color??this.options.defaultColor,this.element.control?.highlight?m.highlight=this.element.control.highlight:delete m.highlight),(m.color===this.options.control.textFixColor||m.color===this.options.control.placeholderColor)&&(m.color=this.options.defaultColor),C(m)}}return f.length&&c.spliceElementList(i,g,0,f),l.startIndex+f.length}clearValue(t={},e={}){if(!e.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const n=t.elementList||this.control.getElementList(),i=t.range||this.control.getValueRange()||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:l,endIndex:r}=i;return this.control.getDraw().spliceElementList(n,l+1,r-l,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),e.isAddPlaceholder!==!1&&(this.getValue(t).length||this.control.addPlaceholder(l,t)),l}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange(),i=n.startIndex,l=n.endIndex;if(t.key===s.KeyMap.Backspace&&i===l&&i>0){const C=e[i-1],p=C?.controlComponent===s.ControlComponent.POSTFIX||C?.controlComponent===s.ControlComponent.POSTTEXTFIX,I=C?.controlComponent===s.ControlComponent.PLACEHOLDER,m=!!C?.controlId,O=this.draws.getPosition().getPositionList(),P=O[i],S=O[i-1],y=P&&S&&P.rowIndex===S.rowIndex;if((p||I)&&m&&y)return this.control.removeControl(i-1)}this.control.shrinkBoundary();const{startIndex:r,endIndex:a}=n,c=e[r],d=this.control.getDraw(),u=e[a+1],h=!!c?.originControlId&&!!c?.controlId&&c.originControlId!==c.controlId,R=h&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.TEXTFIXLABEL),T=h&&c.control?.type===s.ControlType.BUTTON&&c.controlComponent===s.ControlComponent.VALUE,g=!!u?.originControlId&&!!u?.controlId&&u.originControlId!==u.controlId&&(u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT||u.controlComponent===s.ControlComponent.PRETEXTFIX||u.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||u.controlComponent===s.ControlComponent.PLACEHOLDER||u.controlComponent===s.ControlComponent.TEXTFIXLABEL),f=!!u?.originControlId&&!!u?.controlId&&u.originControlId!==u.controlId&&u.control?.type===s.ControlType.BUTTON;if(t.key===s.KeyMap.Backspace){if(r===a&&(T||R&&c.controlComponent!==s.ControlComponent.POSTFIX&&c.controlComponent!==s.ControlComponent.POST_TEXT&&c.controlComponent!==s.ControlComponent.POSTTEXTFIX&&c.controlComponent!==s.ControlComponent.POSTTEXTFIX_TEXT))return this.control.removeControl(r);if(this.options.mode===s.EditorMode.FORM)this.strikeout();else{if(r!==a)return e.slice(r,a+1).some(I=>I.controlComponent===s.ControlComponent.POSTTEXTFIX||I.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)?r:(d.spliceElementList(e,r+1,a-r),this.getValue().length||this.control.addPlaceholder(r),r===0&&e[0].type===s.ElementType.SPLIT_TAG?d.fixPosition(!0)??r:r);{const C=e[r-1];return C?.controlId===c.controlId&&C?.originControlId===c.originControlId&&C?.controlComponent===s.ControlComponent.VALUE&&(c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)?(d.spliceElementList(e,r-1,1),this.getValue().length||this.control.addPlaceholder(r-2),r-2):c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===s.ControlComponent.TEXTFIXLABEL||c.controlComponent===s.ControlComponent.PLACEHOLDER?r:(d.spliceElementList(e,r,1),this.getValue().length||this.control.addPlaceholder(r-1),r===1&&e[0].type===s.ElementType.SPLIT_TAG||r===0?d.fixPosition(!0)??r-1:r-1)}}}else if(t.key===s.KeyMap.Delete){if(r===a&&(R||T))return this.control.removeControl(r);if(r===a&&(g||f))return this.control.removeControl(a+1);if(this.options.mode===s.EditorMode.FORM)this.strikeout();else return r!==a?(d.spliceElementList(e,r+1,a-r),this.getValue().length||this.control.addPlaceholder(r),r===0&&e[0].type===s.ElementType.SPLIT_TAG?d.fixPosition(!0)??r:r):(u||d.getTd()?.linkTdNextId&&c.controlId&&this.removeNextControlElement(c.controlId),u&&((c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&(u.controlComponent===s.ControlComponent.PLACEHOLDER||u.controlComponent===s.ControlComponent.TEXTFIXLABEL)||u.controlComponent===s.ControlComponent.POSTTEXTFIX||u.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.TEXTFIXLABEL)?r:(d.spliceElementList(e,r+1,1),this.getValue().length||this.control.addPlaceholder(r),r===0&&e[0].type===s.ElementType.SPLIT_TAG?d.fixPosition(!0)??r:r))}return a}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}strikeout(t,e={},n={}){const{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draws.isReadonly()||this.draws.isDisabled()))return;const r=this.ranges.getSelectionElementList(),a=this.position.getCursorPosition(),c=lt(new Date).format("YYYY-MM-DD HH:mm:ss");if(r?.length){if(!this.element.strikeout){const d=r.findIndex(u=>!u.strikeout);r.forEach(u=>{u.deletePerson="SWJ",u.deleteTime=c,u.strikeout=!!~d}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),setTimeout(()=>{this.strikeoute()},100)}}else{const d=this.control.getElementList()[a.index];if(!this.control.getElementList()[a.index].strikeout&&d?.metrics.width>0){this.control.getElementList()[a.index].strikeout=!0,this.control.getElementList()[a.index].deletePerson="SWJ",this.control.getElementList()[a.index].deleteTime=c;const u=--a.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const R=u;this.draws.render({curIndex:R,isSetCursor:!0}),a.index=u,this.position.setCursorPosition(a),this.ranges.setRange(u,u)},100)}else{const{elementList:u,range:h}=this.control.mergeControl(n),R=h.startIndex;if(R>=0&&R<u.length&&u[R]?.metrics?.width!==void 0&&u[R].metrics.width<=0&&!u[R]?.strikeout){this.draws.spliceElementList(u,h.startIndex,1,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule});const T=!0,g=h.startIndex-1;this.draws.render({curIndex:g,isSetCursor:T}),a.index=g,delete a.value,this.position.setCursorPosition(a),this.ranges.setRange(g,g)}}}}strikeoute(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:l}=this.ranges.getRange(),a=this.draws.getElementList()[l];this.ranges.setDefaultStyle({strikeout:a.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}const lT={indent:"        ",divider:"────────────────"};class Vl{draw;element;control;options;isPopup;inputModal=null;constructor(t,e){const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(t={}){const e=t.elementList||this.control.getElementList(),n=this.control.getValueRange(t);if(!n)return[];const i=[],{startIndex:l,endIndex:r}=n;for(let a=l;a<=r;a++){const c=e[a];c.controlComponent===s.ControlComponent.VALUE&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e),r=this.control.getDraw(),{startIndex:a}=l,d=i[a].controlId;let u=a;for(let m=a;m>=0;m--){const L=i[m];if(L.controlId!==d)break;if(L.controlComponent===s.ControlComponent.PREFIX){u=m;break}}let h=a;for(let m=a;m<i.length;m++){const L=i[m];if(L.controlId!==d){h=m;break}if(L.controlComponent===s.ControlComponent.POSTFIX){h=m;break}}const R=u+1,T=h-1,g=Math.max(0,T-R+1),f=i[u],C=xt(f,["control","controlId",...ue]),p=u+1,I=t.map(m=>{const L={...C,...m,value:m.value===`
132
+ `?_:u.value,buttonValueLayout:u.buttonValueLayout,buttonValueLayoutPrefixOffset:u.buttonValueLayoutPrefixOffset}));e.splice(n+1,Math.max(i-n-1,0),...d)}showEditModal(t){const e=t[0]?.control||{},n=e.buttonLabel||e.label||"事件",i=e.placeholder||"",l=e.code||"",r=e.action?.key||"",a=e.editable!==!1?"true":"false",c=vn(e.valueLayout),d=c.newline?"true":"false",u=String(c.indentChars);this.isPopup=!0,new sT({title:"修改事件控件属性",data:[{type:"text",label:"显示文本",name:"buttonLabel",required:!0,placeholder:"请输入显示文本",value:n},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词",value:i},{type:"text",label:"事件代码",name:"code",placeholder:"请输入事件代码",value:l},{type:"text",label:"执行事件",name:"actionKey",placeholder:"请输入跳转功能名",value:r},{type:"radio",label:"是否可编辑",name:"editable",options:[{label:"是",value:"true"},{label:"否",value:"false"}],value:a,horizontal:!0},{type:"radio",label:"值另起一行",name:"valueLayoutNewline",options:[{label:"是",value:"true"},{label:"否",value:"false"}],value:d,horizontal:!0},{type:"number",label:"缩进字符数",name:"valueLayoutIndentChars",placeholder:"0-20",value:u}],onClose:()=>{this.isPopup=!1},onCancel:()=>{this.isPopup=!1},onConfirm:h=>{const R=h.find(O=>O.name==="buttonLabel")?.value?.trim()||"事件",T=h.find(O=>O.name==="placeholder")?.value||"",g=h.find(O=>O.name==="code")?.value?.trim()||"",f=h.find(O=>O.name==="actionKey")?.value?.trim()||"",C=rT(f,e.action),p=h.find(O=>O.name==="editable")?.value!=="false",I=vn({newline:h.find(O=>O.name==="valueLayoutNewline")?.value==="true",indentChars:Number(h.find(O=>O.name==="valueLayoutIndentChars")?.value)}),m=this.control.getElementList(),L=t[0]?.controlId;if(L){for(let O=0;O<m.length;O++){const P=m[O];P.controlId===L&&P.control&&(P.control.buttonLabel=R,P.control.label=R,P.control.placeholder=T,P.control.code=g,P.control.editable=p,P.control.valueLayout=I,C?P.control.action=C:delete P.control.action)}this.rebuildButtonValueElements(L),this.syncButtonPlaceholderElements(L,T)}this.draw.render({curIndex:this.control.getRange().endIndex,isSubmitHistory:!0}),this.isPopup=!1}})}destroy(){this.inputModal&&this.closeInputModal(),this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}}class bl{draws;ranges;element;control;options;position;constructor(t,e){const n=e.getDraw();this.draws=n,this.position=n.getPosition(),this.ranges=n.getRange(),this.options=n.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();let{startIndex:n}=t.range||this.control.getRange();const i=this.control.getDraw(),l=t?null:i.getTd();n>=e.length&&(n=e.length-1);const r=e[n],a=[];let c=l;if(r.controlComponent===s.ControlComponent.PRETEXTFIX||r.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){let g=n+1;for(;g<e.length;){const f=e[g];if(f.controlId!==r.controlId||f.controlComponent!==s.ControlComponent.PRETEXTFIX&&f.controlComponent!==s.ControlComponent.PRETEXTFIX_TEXT){n=g-1;break}g++}}let d=e,u=n;for(;;){if(u<0&&c?.linkTdPrevId){const f=i.getTdById(c.linkTdPrevId);if(f){d=f.value,u=d.length-1,c=f;continue}}if(u<0)break;const g=d[u];if(g.controlId!==r.controlId||g.controlComponent===s.ControlComponent.PRETEXTFIX||g.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||g.controlComponent===s.ControlComponent.TEXTFIXLABEL)break;g.controlComponent===s.ControlComponent.VALUE&&a.unshift(g),u--}c=l;let h=e,R=n+1;for(;;){if(R>=h.length&&c?.linkTdNextId){const f=i.getTdById(c.linkTdNextId);if(f){h=f.value,R=0,c=f;continue}}const g=h[R];if(!g||g.controlId!==r.controlId||g.controlComponent===s.ControlComponent.POSTTEXTFIX||g.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||g.controlComponent===s.ControlComponent.TEXTFIXLABEL)break;g.controlComponent===s.ControlComponent.VALUE&&a.push(g),R++}return a.filter(g=>g.type!==s.ElementType.SPLIT_TAG)}removeNextControlElement(t,e){const n=this.control.getDraw();if(e=e??n.getTd()?.linkTdNextId,e){const i=n.getTdById(e);if(i){if(i.value.length){if(i.value[1].controlId===t)return n.spliceElementList(i.value,1,1),i.value[1]}else if(i.linkTdNextId)return this.removeNextControlElement(t,i.linkTdNextId)}}}setValue(t,e={},n={}){if(this.options.mode===s.EditorMode.FORM||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e);this.control.shrinkBoundary(e);const{startIndex:r,endIndex:a}=l,c=this.control.getDraw();r!==a?c.spliceElementList(i,r+1,a-r,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):this.control.removePlaceholder(r,{elementList:i});const d=i[r],u=i[r+1];let h=d.originControlId||d.controlId,R=d.originControlId&&(d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===s.ControlComponent.POST_TEXT);if(!R&&d.controlId&&(d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===s.ControlComponent.POST_TEXT)&&u?.controlId&&u.controlId!==d.controlId)if(u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRETEXTFIX)for(let p=r;p>=0;p--){const I=i[p];if(I.controlId===d.controlId&&(I.controlComponent===s.ControlComponent.PREFIX||I.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let m=p-1;m>=0;m--){const L=i[m];if(L.controlId&&L.controlId!==d.controlId&&(L.controlComponent===s.ControlComponent.PRETEXTFIX||L.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||L.controlComponent===s.ControlComponent.PREFIX||L.controlComponent===s.ControlComponent.PRE_TEXT)){h=L.controlId,R=!0;break}if(L.controlId&&L.controlId!==d.controlId&&(L.controlComponent===s.ControlComponent.POSTFIX||L.controlComponent===s.ControlComponent.POSTTEXTFIX))break}break}}else(u.controlComponent===s.ControlComponent.POSTFIX||u.controlComponent===s.ControlComponent.POSTTEXTFIX)&&(h=u.controlId,R=!0);if(!R&&d.controlId&&(d.controlComponent===s.ControlComponent.POSTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX||d.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||d.controlComponent===s.ControlComponent.POST_TEXT))for(let p=r;p>=0;p--){const I=i[p];if(I.controlId===d.controlId&&(I.controlComponent===s.ControlComponent.PREFIX||I.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let m=p-1;m>=0;m--){const L=i[m];if(L.controlId&&L.controlId!==d.controlId&&(L.controlComponent===s.ControlComponent.PRETEXTFIX||L.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||L.controlComponent===s.ControlComponent.PREFIX||L.controlComponent===s.ControlComponent.PRE_TEXT)){h=L.controlId,R=!0;break}if(L.controlId&&L.controlId!==d.controlId&&(L.controlComponent===s.ControlComponent.POSTFIX||L.controlComponent===s.ControlComponent.POSTTEXTFIX))break}break}}const T=d.type&&!Le.includes(d.type)||d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT?xt(d,["control","controlId",...ue]):Ee(d,["type"]);R&&(T.controlId=h,delete T.originControlId);const g=l.startIndex+1,f=[],C=p=>{const I=f.length?f:i,m=f.length?f.length-1:l.startIndex;le(I,[p],m,{editorOptions:this.options}),f.push(p)};for(let p=0;p<t.length;p++){const I=t[p];if(I.type===s.ElementType.CONTROL&&I.control){const m=I,L=m.controlId||ft(),O=m.control?.value||[],P=m.control?.type,S=P===s.ControlType.TEXTFIELD,y=S?this.options.control.textFixColor:P===s.ControlType.TEXT||P===s.ControlType.NUMBER?"#87d068":this.options.control.bracketColor,Y={...T,controlId:L,type:s.ElementType.CONTROL,control:m.control,originControlId:h},b=S?s.ControlComponent.PRETEXTFIX:s.ControlComponent.PREFIX,M=S?s.ControlComponent.POSTTEXTFIX:s.ControlComponent.POSTFIX,V=S?m.control?.preTextFix||this.options.control.preTextFix:m.control?.prefix||this.options.control.prefix;for(let X=0;X<V.length;X++){const D={...Y,color:y,value:V[X],controlComponent:b};C(D)}for(let X=0;X<O.length;X++){const D=O[X],E={...Y,...D,controlComponent:s.ControlComponent.VALUE,type:D.type};(E.color===this.options.control.textFixColor||E.color===this.options.control.placeholderColor)&&(E.color=this.options.defaultColor),C(E)}if(O.length===0){const X=m.control?.placeholder||"";for(let D=0;D<X.length;D++){const E={...Y,value:X[D],controlComponent:s.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor};C(E)}}const N=S?m.control?.postTextFix||this.options.control.postTextFix:m.control?.postfix||this.options.control.postfix;for(let X=0;X<N.length;X++){const D={...Y,color:y,value:N[X],controlComponent:M};C(D)}}else if(I.type||I.value){T.color=this.options.defaultColor;const m={...T,...I,controlComponent:s.ControlComponent.VALUE};R&&(m.color=this.element.control?.color??this.options.defaultColor,this.element.control?.highlight?m.highlight=this.element.control.highlight:delete m.highlight),(m.color===this.options.control.textFixColor||m.color===this.options.control.placeholderColor)&&(m.color=this.options.defaultColor),C(m)}}return f.length&&c.spliceElementList(i,g,0,f),l.startIndex+f.length}clearValue(t={},e={}){if(!e.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const n=t.elementList||this.control.getElementList(),i=t.range||this.control.getValueRange()||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:l,endIndex:r}=i;return this.control.getDraw().spliceElementList(n,l+1,r-l,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule}),e.isAddPlaceholder!==!1&&(this.getValue(t).length||this.control.addPlaceholder(l,t)),l}keydown(t){if(this.control.getIsDisabledControl())return null;const e=this.control.getElementList(),n=this.control.getRange(),i=n.startIndex,l=n.endIndex;if(t.key===s.KeyMap.Backspace&&i===l&&i>0){const C=e[i-1],p=C?.controlComponent===s.ControlComponent.POSTFIX||C?.controlComponent===s.ControlComponent.POSTTEXTFIX,I=C?.controlComponent===s.ControlComponent.PLACEHOLDER,m=!!C?.controlId,O=this.draws.getPosition().getPositionList(),P=O[i],S=O[i-1],y=P&&S&&P.rowIndex===S.rowIndex;if((p||I)&&m&&y)return this.control.removeControl(i-1)}this.control.shrinkBoundary();const{startIndex:r,endIndex:a}=n,c=e[r],d=this.control.getDraw(),u=e[a+1],h=!!c?.originControlId&&!!c?.controlId&&c.originControlId!==c.controlId,R=h&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.TEXTFIXLABEL),T=h&&c.control?.type===s.ControlType.BUTTON&&c.controlComponent===s.ControlComponent.VALUE,g=!!u?.originControlId&&!!u?.controlId&&u.originControlId!==u.controlId&&(u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT||u.controlComponent===s.ControlComponent.PRETEXTFIX||u.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||u.controlComponent===s.ControlComponent.PLACEHOLDER||u.controlComponent===s.ControlComponent.TEXTFIXLABEL),f=!!u?.originControlId&&!!u?.controlId&&u.originControlId!==u.controlId&&u.control?.type===s.ControlType.BUTTON;if(t.key===s.KeyMap.Backspace){if(r===a&&(T||R&&c.controlComponent!==s.ControlComponent.POSTFIX&&c.controlComponent!==s.ControlComponent.POST_TEXT&&c.controlComponent!==s.ControlComponent.POSTTEXTFIX&&c.controlComponent!==s.ControlComponent.POSTTEXTFIX_TEXT))return this.control.removeControl(r);if(this.options.mode===s.EditorMode.FORM)this.strikeout();else{if(r!==a)return e.slice(r,a+1).some(I=>I.controlComponent===s.ControlComponent.POSTTEXTFIX||I.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)?r:(d.spliceElementList(e,r+1,a-r),this.getValue().length||this.control.addPlaceholder(r),r===0&&e[0].type===s.ElementType.SPLIT_TAG?d.fixPosition(!0)??r:r);{const C=e[r-1];return C?.controlId===c.controlId&&C?.originControlId===c.originControlId&&C?.controlComponent===s.ControlComponent.VALUE&&(c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)?(d.spliceElementList(e,r-1,1),this.getValue().length||this.control.addPlaceholder(r-2),r-2):c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===s.ControlComponent.TEXTFIXLABEL||c.controlComponent===s.ControlComponent.PLACEHOLDER?r:(d.spliceElementList(e,r,1),this.getValue().length||this.control.addPlaceholder(r-1),r===1&&e[0].type===s.ElementType.SPLIT_TAG||r===0?d.fixPosition(!0)??r-1:r-1)}}}else if(t.key===s.KeyMap.Delete){if(r===a&&(R||T))return this.control.removeControl(r);if(r===a&&(g||f))return this.control.removeControl(a+1);if(this.options.mode===s.EditorMode.FORM)this.strikeout();else return r!==a?(d.spliceElementList(e,r+1,a-r),this.getValue().length||this.control.addPlaceholder(r),r===0&&e[0].type===s.ElementType.SPLIT_TAG?d.fixPosition(!0)??r:r):(u||d.getTd()?.linkTdNextId&&c.controlId&&this.removeNextControlElement(c.controlId),u&&((c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&(u.controlComponent===s.ControlComponent.PLACEHOLDER||u.controlComponent===s.ControlComponent.TEXTFIXLABEL)||u.controlComponent===s.ControlComponent.POSTTEXTFIX||u.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.TEXTFIXLABEL)?r:(d.spliceElementList(e,r+1,1),this.getValue().length||this.control.addPlaceholder(r),r===0&&e[0].type===s.ElementType.SPLIT_TAG?d.fixPosition(!0)??r:r))}return a}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}strikeout(t,e={},n={}){const{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draws.isReadonly()||this.draws.isDisabled()))return;const r=this.ranges.getSelectionElementList(),a=this.position.getCursorPosition(),c=lt(new Date).format("YYYY-MM-DD HH:mm:ss");if(r?.length){if(!this.element.strikeout){const d=r.findIndex(u=>!u.strikeout);r.forEach(u=>{u.deletePerson="SWJ",u.deleteTime=c,u.strikeout=!!~d}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),setTimeout(()=>{this.strikeoute()},100)}}else{const d=this.control.getElementList()[a.index];if(!this.control.getElementList()[a.index].strikeout&&d?.metrics.width>0){this.control.getElementList()[a.index].strikeout=!0,this.control.getElementList()[a.index].deletePerson="SWJ",this.control.getElementList()[a.index].deleteTime=c;const u=--a.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const R=u;this.draws.render({curIndex:R,isSetCursor:!0}),a.index=u,this.position.setCursorPosition(a),this.ranges.setRange(u,u)},100)}else{const{elementList:u,range:h}=this.control.mergeControl(n),R=h.startIndex;if(R>=0&&R<u.length&&u[R]?.metrics?.width!==void 0&&u[R].metrics.width<=0&&!u[R]?.strikeout){this.draws.spliceElementList(u,h.startIndex,1,[],{isIgnoreDeletedRule:e.isIgnoreDeletedRule});const T=!0,g=h.startIndex-1;this.draws.render({curIndex:g,isSetCursor:T}),a.index=g,delete a.value,this.position.setCursorPosition(a),this.ranges.setRange(g,g)}}}}strikeoute(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:l}=this.ranges.getRange(),a=this.draws.getElementList()[l];this.ranges.setDefaultStyle({strikeout:a.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}const lT={indent:"        ",divider:"────────────────"};class Vl{draw;element;control;options;isPopup;inputModal=null;constructor(t,e){const n=e.getDraw();this.draw=n,this.options=n.getOptions(),this.element=t,this.control=e,this.isPopup=!1}setElement(t){this.element=t}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(t={}){const e=t.elementList||this.control.getElementList(),n=this.control.getValueRange(t);if(!n)return[];const i=[],{startIndex:l,endIndex:r}=n;for(let a=l;a<=r;a++){const c=e[a];c.controlComponent===s.ControlComponent.VALUE&&i.push(c)}return i}setValue(t,e={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const{elementList:i,range:l}=this.control.mergeControl(e),r=this.control.getDraw(),{startIndex:a}=l,d=i[a].controlId;let u=a;for(let m=a;m>=0;m--){const L=i[m];if(L.controlId!==d)break;if(L.controlComponent===s.ControlComponent.PREFIX){u=m;break}}let h=a;for(let m=a;m<i.length;m++){const L=i[m];if(L.controlId!==d){h=m;break}if(L.controlComponent===s.ControlComponent.POSTFIX){h=m;break}}const R=u+1,T=h-1,g=Math.max(0,T-R+1),f=i[u],C=xt(f,["control","controlId",...ue]),p=u+1,I=t.map(m=>{const L={...C,...m,value:m.value===`
133
133
  `?_:m.value,controlComponent:s.ControlComponent.VALUE};return(L.color===this.options.control.bracketColor||L.color===this.options.control.placeholderColor)&&(L.color=this.options.defaultColor),L});return le(i,I,u,{editorOptions:this.options}),r.spliceElementList(i,p,g,I),p+I.length-1}keydown(t){if(this.control.getIsDisabledControl()||this.options.mode===s.EditorMode.FORM)return null;const e=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i}=n,l=e[i];if(t.key===s.KeyMap.Backspace||t.key===s.KeyMap.Delete){const r=l.controlId;let a=i,c=i;for(;a>0&&e[a-1].controlId===r;)a--;for(;c<e.length-1&&e[c+1].controlId===r;)c++;return this.draw.spliceElementList(e,a,c-a+1),a>0?a-1:0}return null}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:t,endIndex:e}=this.control.getRange();if(t===e)return t;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,t+1,e-t),this.getValue().length||this.control.addPlaceholder(t),t}awake(){if(this.options.mode===s.EditorMode.PRINT||this.options.mode===s.EditorMode.COMPARE||this.isPopup||this.control.getIsDisabledControl())return;let t=!1;const e=this.control.getElementList(),n=this.element.controlId;for(let i=0;i<e.length;i++){const l=e[i];l.controlId===n&&l.control&&l.control._justCreated&&(t=!0,delete l.control._justCreated)}t||this.showMenstrualHistoryDialog()}generateDisplayText(t){const{indent:e,divider:n}=lT,{isMenopause:i,periodMin:l,periodMax:r,menarcheAge:a,cycleMin:c,cycleMax:d}=t,u=`${e}月经持续${l}~${r}天`,h=`${e}生理周期持续${c}~${d}天${_}`;let R;return i?R=`初潮年龄${a}岁${n}闭经年龄${t.menopauseAge||"_"}岁`:R=`初潮年龄${a}岁${n}末次日期${t.lastPeriod||"____-__-__"}`,`${_} ${u}
134
134
  ${R}
135
135
  ${h} `}textToElements(t){const e=[],n=t.split(`
@@ -209,8 +209,8 @@ ${h} `}textToElements(t){const e=[],n=t.split(`
209
209
  <button class="btn-confirm">确认</button>
210
210
  </div>
211
211
  </div>
212
- `,document.body.appendChild(this.inputModal);const e=this.inputModal.querySelector(".menstrual-history-modal__mask"),n=this.inputModal.querySelector(".menstrual-history-modal__container"),i=this.inputModal.querySelector(".menstrual-history-modal__close"),l=this.inputModal.querySelector(".btn-cancel"),r=this.inputModal.querySelector(".btn-confirm"),a=this.inputModal.querySelector("#mh-edit-notMenopause"),c=this.inputModal.querySelector("#mh-edit-isMenopauseForm"),d=this.inputModal.querySelectorAll('input[name="mh-edit-isMenopause"]'),u=()=>{this.closeModal()};n.addEventListener("click",h=>{h.stopPropagation()}),e.addEventListener("click",u),i.addEventListener("click",u),l.addEventListener("click",u),d.forEach(h=>{h.addEventListener("change",()=>{const R=h.value==="true";a.style.display=R?"none":"block",c.style.display=R?"block":"none"})}),r.addEventListener("click",h=>{h.preventDefault(),h.stopPropagation();const R=this.inputModal;if(!R)return;const T=R.querySelector('input[name="mh-edit-isMenopause"]:checked')?.value==="true";let g;T?g={isMenopause:!0,periodMin:R.querySelector("#mh-edit-periodMin2")?.value||"_",periodMax:R.querySelector("#mh-edit-periodMax2")?.value||"_",menarcheAge:R.querySelector("#mh-edit-menarcheAge2")?.value||"_",menopauseAge:R.querySelector("#mh-edit-menopauseAge")?.value||"_",cycleMin:R.querySelector("#mh-edit-cycleMin2")?.value||"_",cycleMax:R.querySelector("#mh-edit-cycleMax2")?.value||"_"}:g={isMenopause:!1,periodMin:R.querySelector("#mh-edit-periodMin")?.value||"_",periodMax:R.querySelector("#mh-edit-periodMax")?.value||"_",menarcheAge:R.querySelector("#mh-edit-menarcheAge1")?.value||"_",lastPeriod:R.querySelector("#mh-edit-lastPeriod")?.value||"____-__-__",cycleMin:R.querySelector("#mh-edit-cycleMin")?.value||"_",cycleMax:R.querySelector("#mh-edit-cycleMax")?.value||"_"};const f=this.control.getElementList(),C=this.element.controlId;for(let L=0;L<f.length;L++){const O=f[L];O.controlId===C&&O.control&&(O.control.menstrualData=g)}const p=this.generateDisplayText(g),I=this.textToElements(p);this.closeModal();const m=this.setValue(I);m!==-1&&(this.control.repaintControl({curIndex:m}),this.control.emitControlContentChange({}))})}closeModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}destroy(){this.closeModal()}}class aT{controlBorder;textFieldUnderline;draw;range;listener;eventBus;controlSearch;controlQuality;options;controlOptions;activeControl;activeControlValue;preElement;isPopupAwakeDisabled;constructor(t){this.controlBorder=new nu(t),this.textFieldUnderline=new cT(t),this.draw=t,this.range=t.getRange(),this.listener=t.getListener(),this.eventBus=t.getEventBus(),this.controlSearch=new jd(this),this.controlQuality=new eu(t),this.options=t.getOptions(),this.controlOptions=this.options.control,this.activeControl=null,this.activeControlValue=[],this.preElement=null,this.isPopupAwakeDisabled=!1}setPopupAwakeDisabled(t){this.isPopupAwakeDisabled=t}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)}setQualityMarks(t){this.controlQuality.setMarks(t)}getQualityMarks(){return this.controlQuality.getMarks()}renderQualityMarks(t,e,n,i,l,r,a){this.controlQuality.render(t,e,n,i,l,r,a)}getDraw(){return this.draw}filterAssistElement(t){const e=this.options.mode===s.EditorMode.PRINT||this.options.mode===s.EditorMode.COMPARE;return t.filter((n,i)=>{if(n.type===s.ElementType.TABLE){const l=n.trList;for(let r=0;r<l.length;r++){const a=l[r];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c];d.value=this.filterAssistElement(d.value)}}}if(!n.controlId)return!0;if(n.control?.type===s.ControlType.MENSTRUAL_HISTORY&&e&&(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.POSTFIX)||n.control?.type===s.ControlType.SELECT&&e&&(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.POSTFIX)||n.control?.type===s.ControlType.NUMBER&&e&&(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.POSTFIX)||n.control?.type===s.ControlType.TEXT&&e&&n.strikeout&&n.deletePerson)return!1;if(n.control?.minWidth){if(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.POSTFIX)return n.value="",!0}else{const l=this.options.mode===s.EditorMode.FORM;if(n.control?.preText&&n.controlComponent===s.ControlComponent.PRE_TEXT){if(l)return!0;let r=!1,a=i+1;for(;a<t.length;){const c=t[a];if(n.controlId!==c.controlId)break;if(c.controlComponent===s.ControlComponent.VALUE){r=!0;break}a++}return r}if(n.control?.postText&&n.controlComponent===s.ControlComponent.POST_TEXT){if(l)return!0;let r=!1,a=i-1;for(;a<t.length;){const c=t[a];if(n.controlId!==c.controlId)break;if(c.controlComponent===s.ControlComponent.VALUE){r=!0;break}a--}return r}}if(n.control?.preTextFix&&n.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){let l=!1,r=i+1;for(;r<t.length;){const a=t[r];if(n.controlId!==a.controlId)break;if(a.controlComponent===s.ControlComponent.VALUE){l=!0;break}r++}return l}if(n.control?.postTextFix&&n.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){let l=!1,r=i-1;for(;r<t.length;){const a=t[r];if(n.controlId!==a.controlId)break;if(a.controlComponent===s.ControlComponent.VALUE){l=!0;break}r--}return l}return n.controlComponent!==s.ControlComponent.PREFIX&&n.controlComponent!==s.ControlComponent.POSTFIX&&n.controlComponent!==s.ControlComponent.PLACEHOLDER&&n.controlComponent!==s.ControlComponent.PRETEXTFIX&&n.controlComponent!==s.ControlComponent.POSTTEXTFIX&&n.controlComponent!==s.ControlComponent.TEXTFIXLABEL})}getIsRangeCanCaptureEvent(){if(!this.activeControl)return!1;const{startIndex:t,endIndex:e}=this.getRange();if(!~t&&!~e)return!1;const n=this.getElementList(),i=n[t];if(i.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;if(t===e&&t>0){const r=n[t-1],a=r?.controlComponent===s.ControlComponent.POSTFIX||r?.controlComponent===s.ControlComponent.POSTTEXTFIX,c=r?.controlComponent===s.ControlComponent.PLACEHOLDER,d=!!r?.controlId,u=!!r?.originControlId;let h=!1;if(u){const p=r.originControlId;for(let I=t;I<n.length;I++){const m=n[I];if(m.controlId===p&&!m.originControlId){h=!0;break}if(m.controlId&&m.controlId!==p&&m.originControlId!==p)break}}const T=this.draw.getPosition().getPositionList(),g=T[t],f=T[t-1],C=g&&f&&g.rowIndex===f.rowIndex;if((a||c)&&d&&C&&!h)return!1}if(t===e&&(i.controlComponent===s.ControlComponent.POSTFIX||i.controlComponent===s.ControlComponent.POSTTEXTFIX))return!0;const l=n[e];return!!(i.controlId&&i.controlId===l.controlId&&l.controlComponent!==s.ControlComponent.POSTFIX&&l.controlComponent!==s.ControlComponent.POSTTEXTFIX)}getIsRangeInPostfix(){if(!this.activeControl)return!1;const{startIndex:t,endIndex:e}=this.getRange();if(t!==e)return!1;const i=this.getElementList()[t];return i.controlComponent===s.ControlComponent.POSTFIX||i.controlComponent===s.ControlComponent.POSTTEXTFIX}getIsRangeWithinControl(){const{range:{startIndex:t,endIndex:e},elementList:n}=this.range.getRangeElement();if(!~t&&!~e)return!1;const i=n[t],l=n[e];if(i?.controlId&&i.controlId===l.controlId&&l.controlComponent!==s.ControlComponent.POSTFIX&&l.controlComponent!==s.ControlComponent.POSTTEXTFIX&&l.controlComponent!==s.ControlComponent.POSTTEXTFIX_TEXT&&l.controlComponent!==s.ControlComponent.POST_TEXT||(l?.control?.type===s.ControlType.TEXT||this.draw.getMode()===s.EditorMode.EDIT&&l?.control?.type===s.ControlType.TEXTFIELD)&&l.controlId&&!l.originControlId&&(l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||l.controlComponent===s.ControlComponent.POST_TEXT)&&n[e-1]?.originControlId===l.controlId)return!0;if(l?.originControlId&&(l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX)){const r=l.originControlId;for(let a=e+1;a<n.length;a++){const c=n[a];if(c.controlId===r)return!0;if(c.controlId&&c.controlId!==r&&c.originControlId!==r)break}}if(!l?.originControlId&&l?.controlId&&(l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX)){const r=n[e+1];if(r?.controlId&&r.controlId!==l.controlId&&(r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRETEXTFIX)&&r.originControlId||r?.controlId&&r.controlId!==l.controlId&&(r.controlComponent===s.ControlComponent.POSTFIX||r.controlComponent===s.ControlComponent.POSTTEXTFIX)&&r.originControlId)return!0;for(let a=e;a>=0;a--){const c=n[a];if(c.controlId===l.controlId&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let d=a-1;d>=0;d--){const u=n[d];if(u.controlId&&u.controlId!==l.controlId&&(u.controlComponent===s.ControlComponent.PRETEXTFIX||u.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT))return!0;if(u.controlId&&u.controlId!==l.controlId&&(u.controlComponent===s.ControlComponent.POSTFIX||u.controlComponent===s.ControlComponent.POSTTEXTFIX))break}break}}}if(l?.originControlId){const r=l.originControlId;for(let a=e+1;a<n.length;a++){const c=n[a];if(c.controlId===r)return!0;if(c.controlId&&c.controlId!==r&&c.originControlId!==r)break}}if(!i?.controlId&&this.activeControl){const a=this.activeControl.getElement()?.controlId;if(a)for(let c=t;c>=0;c--){const d=n[c];if(d.controlId===a&&!d.originControlId){if(d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT)for(let u=e;u<n.length;u++){const h=n[u];if(h.controlId===a&&!h.originControlId){if(h.controlComponent===s.ControlComponent.POSTTEXTFIX||h.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||h.controlComponent===s.ControlComponent.POSTFIX||h.controlComponent===s.ControlComponent.POST_TEXT)return!0;break}}break}}}return!1}getIsElementListContainFullControl(t){if(!t.some(i=>i.controlId))return!1;let e=0,n=0;for(let i=0;i<t.length;i++){const l=t[i];l.controlComponent===s.ControlComponent.PREFIX||l.controlComponent===s.ControlComponent.PRETEXTFIX?e++:(l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX)&&n++}return!e||!n?!1:e===n}getIsDisabledControl(t={}){if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:e,endIndex:n}=t.range||this.range.getRange();if(e===n&&~e&&~n){const l=(t.elementList||this.getElementList())[e];if(l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX)return!1}return!!this.activeControl.getElement()?.control?.disabled}getIsDisabledPasteControl(t={}){if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:e,endIndex:n}=t.range||this.range.getRange();return e===n&&~e&&~n&&(t.elementList||this.getElementList())[e].controlComponent===s.ControlComponent.POSTFIX?!1:!!this.activeControl.getElement()?.control?.pasteDisabled}getIsExistValueByElementListIndex(t,e){const n=t[e];if(!n.controlId)return!1;if(n.control?.type===s.ControlType.CHECKBOX||n.control?.type===s.ControlType.RADIO)return!!n.control?.code;if(n.controlComponent===s.ControlComponent.VALUE)return!0;if(n.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;if(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.PRE_TEXT){let i=e+1;for(;i<t.length;){const l=t[i];if(l.controlId!==n.controlId)return!1;if(l.controlComponent===s.ControlComponent.VALUE)return!0;if(l.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;i++}}if(n.controlComponent===s.ControlComponent.PRETEXTFIX||n.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){let i=e+1;for(;i<t.length;){const l=t[i];if(l.controlId!==n.controlId)return!1;if(l.controlComponent===s.ControlComponent.VALUE)return!0;if(l.controlComponent===s.ControlComponent.PLACEHOLDER||l.controlComponent===s.ControlComponent.TEXTFIXLABEL)return!1;i++}}if(n.controlComponent===s.ControlComponent.POSTFIX||n.controlComponent===s.ControlComponent.POSTTEXTFIX){let i=e-1;for(;i>=0;){const l=t[i];if(l.controlId!==n.controlId)return!1;if(l.controlComponent===s.ControlComponent.VALUE)return!0;if(l.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;i--}}return!1}getControlHighlight(t,e){return this.controlSearch.getControlHighlight(t,e)}getIsInlineControlBackground(t,e){return this.controlSearch.getIsInlineControlBackground(t,e)}getContainer(){return this.draw.getContainer()}getElementList(){return this.draw.getElementList()}getPosition(){const t=this.draw.getPosition().getPositionList(),{endIndex:e}=this.range.getRange();return t[e]||null}getPreY(){const t=this.draw.getHeight(),e=this.draw.getPageGap();return(this.getPosition()?.pageNo??this.draw.getPageNo())*(t+e)}getRange(){return this.range.getRange()}getValueRange(t={}){const e=t.elementList||this.getElementList(),{startIndex:n}=t.range||this.getRange(),i=e[n];if(!lo(i))return null;let l=n;for(;l>0;){const a=e[l];if(!kt(a,i)||a.controlComponent===s.ControlComponent.PREFIX||a.controlComponent===s.ControlComponent.PRE_TEXT||a.controlComponent===s.ControlComponent.PRETEXTFIX||a.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)break;l--}let r=n+1;for(;r<e.length;){const a=e[r];if(!kt(a,i)||a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT||a.controlComponent===s.ControlComponent.POSTTEXTFIX||a.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)break;r++}return l===r?null:{startIndex:l,endIndex:r-1}}shrinkBoundary(t={}){this.range.shrinkBoundary(t)}getActiveControl(){return this.activeControl}getActiveTextControlLimit(){if(!this.activeControl)return null;const t=this.activeControl.getElement(),e=t?.controlId,n=t?.originControlId||null,i=t?.subTemplateInstanceId||t?.subTemplateParentId||null;if(!e||t.control?.type!==s.ControlType.TEXT&&t.control?.type!==s.ControlType.NUMBER)return null;const l=this.getElementList(),r=n||null;let a=-1,c=-1,d=-1,u=-1;for(let T=0;T<l.length;T++){const g=l[T];g.controlId!==e||(g.subTemplateInstanceId||g.subTemplateParentId||null)!==i||(n?g.originControlId!==n:g.originControlId)||(a===-1&&(a=T),c=T,(g.controlComponent===s.ControlComponent.PREFIX||g.controlComponent===s.ControlComponent.PRE_TEXT||g.controlComponent===s.ControlComponent.PRETEXTFIX||g.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&(d=T),u===-1&&(g.controlComponent===s.ControlComponent.POSTFIX||g.controlComponent===s.ControlComponent.POST_TEXT||g.controlComponent===s.ControlComponent.POSTTEXTFIX||g.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&(u=T))}if(a===-1)return null;const h=d!==-1?d:a,R=u!==-1?u-1:c;return e?{controlId:e,originControlId:n,subTemplateInstanceId:i,parentControlId:r,startIndex:h,endIndex:R<h?h:R}:null}getActiveNestedTextLimit(){const t=this.getActiveTextControlLimit();return!t?.parentControlId||!this.getElementList().some(n=>n.controlId===t.parentControlId&&!n.originControlId&&n.control?.type===s.ControlType.TEXTFIELD)?null:{controlId:t.controlId,parentControlId:t.parentControlId,startIndex:t.startIndex,endIndex:t.endIndex}}getControlElementList(t={}){const e=t.elementList||this.getElementList(),{startIndex:n}=t.range||this.getRange(),i=e[n];if(!lo(i))return[];const l=[];let r=n;for(;r>0;){const c=e[r];if(!kt(c,i))break;l.unshift(c),r--}let a=n+1;for(;a<e.length;){const c=e[a];if(!kt(c,i))break;l.push(c),a++}return l}updateActiveControlValue(){this.activeControl&&(this.activeControlValue=this.getControlElementList())}emitControlChange(t){if(!this.activeControl)return;const e=this.eventBus.isSubscribe("controlChange");if(!this.listener.controlChange&&!e)return;let n;const i=this.activeControlValue,l=this.activeControl.getElement();i?.length?n=i[0].control:(n=hn(rt(l)).control,n.value=[]);const r={state:t,control:n,controlId:l.controlId};this.listener.controlChange?.(r),e&&this.eventBus.emit("controlChange",r)}initControl(){if(this.draw.isContentReadonly())return;const t=this.getElementList(),e=this.getRange(),n=t[e.startIndex],i=t[e.startIndex+1],l=this.draw.getMode()===s.EditorMode.FORM&&(n.controlComponent===s.ControlComponent.POSTFIX||n.controlComponent===s.ControlComponent.POST_TEXT||n.controlComponent===s.ControlComponent.POSTTEXTFIX||n.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT);let r=null;if(l&&n.originControlId&&i?.controlId===n.originControlId&&!kt(n,i))r=i;else if(l&&n.subTemplateParentId&&i&&i.subTemplateParentId!==n.subTemplateParentId)for(let g=e.startIndex-1;g>=0;g--){const f=t[g];if(f.type===s.ElementType.SUB_TEMPLATE&&f.id===n.subTemplateParentId){f.controlId===i.controlId&&(f.originControlId||null)===(i.originControlId||null)&&(r=i);break}}let a=null;if(r)for(let g=e.startIndex+1;g>=0;g--){const f=t[g];if(kt(r,f)&&f.control?.type===s.ControlType.TEXT){a=f;break}}if(this.activeControl&&a&&this.destroyControl(),this.activeControl){if(this.activeControl instanceof co||this.activeControl instanceof Lo||this.activeControl instanceof Nn){const g=this.activeControl.getElement();kt(n,g)?n.controlComponent===s.ControlComponent.POSTFIX?this.activeControl.destroy():this.isPopupAwakeDisabled||this.activeControl.awake():this.destroyControl()}if(this.activeControl){const g=this.activeControl.getElement(),f=n.controlId,C=n.originControlId||null,p=g.controlId,I=g.originControlId||null;if(f&&kt(n,g)){this.updateActiveControlValue(),this.preElement=n;return}if(n.originControlId&&n.originControlId===p&&C===I){const m=this.activeControl.getElement();if(!((m?.control?.type===s.ControlType.TEXTFIELD||m?.control?.type===s.ControlType.TEXT)&&n.controlId!==p)){this.updateActiveControlValue(),this.preElement=n;return}}if(n.originControlId&&n.controlId&&n.controlId,!n.originControlId&&n.controlId&&n.controlId!==p&&(this.activeControl.getElement()?.originControlId,n.controlId),n.controlId&&n.originControlId&&kt(n,g)){this.updateActiveControlValue(),this.preElement=n;return}if(!f){const m=this.getElementList(),L=this.getRange(),{startIndex:O}=L;let P=null;for(let S=O;S>=0;S--){const y=m[S];if(y.controlComponent===s.ControlComponent.PRETEXTFIX||y.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||y.controlComponent===s.ControlComponent.PREFIX||y.controlComponent===s.ControlComponent.PRE_TEXT){P=y.controlId||null;break}if(y.controlId&&y.controlId!==p||y.controlComponent===s.ControlComponent.POSTTEXTFIX||y.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||y.controlComponent===s.ControlComponent.POSTFIX||y.controlComponent===s.ControlComponent.POST_TEXT)break}if(P===p){this.updateActiveControlValue(),this.preElement=n;return}}}}if(this.destroyControl(),this.draw.isReadonly())return;let d=a?.control||n.control,u=a||n;if(!a&&n.originControlId&&!d){let g;for(let I=this.range.getRange().startIndex;I>=0;I--){const m=t[I];if(kt(m,n)&&m.control&&(g=m.control,u=m,m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX||m.controlComponent===s.ControlComponent.PRE_TEXT||m.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)||m.controlId&&!kt(m,n)&&m.controlId!==n.originControlId&&m.originControlId!==n.originControlId)break}const f=n.originControlId;let C,p;for(let I=this.range.getRange().startIndex;I>=0;I--){const m=t[I];if(m.controlId===f&&m.control){C=m.control,p=m;break}if(m.controlId===f&&(m.controlComponent===s.ControlComponent.PRETEXTFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRE_TEXT)){m.control&&(C=m.control,p=m);break}}this.draw.getMode()===s.EditorMode.FORM&&C?.type===s.ControlType.TEXTFIELD&&g&&g.type!==s.ControlType.TEXTFIELD||this.draw.getMode()===s.EditorMode.FORM&&C?.type===s.ControlType.TEXT&&g?d=g:C?(d=C,p&&(u=p)):g&&(d=g)}else if(!d&&n.controlId){const g=this.getElementList();for(let f=this.range.getRange().startIndex;f>=0;f--){const C=g[f];if(!kt(C,n))break;if(C.control){d=C.control,u=C;break}if(C.controlComponent===s.ControlComponent.PRETEXTFIX||C.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||C.controlComponent===s.ControlComponent.PREFIX||C.controlComponent===s.ControlComponent.PRE_TEXT)break}}if(!d)return;if(d?.type===s.ControlType.TEXTFIELD&&this.draw.getMode()!==s.EditorMode.EDIT)if(n.originControlId){const g=n.controlId;for(let f=this.range.getRange().startIndex;f>=0;f--){const C=t[f];if(C.controlId===g&&kt(C,n)&&C.control&&C.control.type!==s.ControlType.TEXTFIELD){d=C.control,u=C;break}if(C.controlComponent===s.ControlComponent.PREFIX||C.controlComponent===s.ControlComponent.PRETEXTFIX)break}if(d?.type===s.ControlType.TEXTFIELD)return}else return;const h=this.draw.getPosition().getPositionContext(),R=this.range.getRange().startIndex,T=!!(h.isDirectHit&&h.index===R&&t[h.index]?.controlId===u.controlId);if(d?.type===s.ControlType.TEXTFIELD)this.activeControl=new bl(u,this);else if(d.type===s.ControlType.TEXT)this.activeControl=new Vs(u,this);else if(d.type===s.ControlType.SELECT){const g=new co(u,this);this.activeControl=g,!this.isPopupAwakeDisabled&&(T||this.draw.getMode()===s.EditorMode.FORM)&&g.awake()}else if(d.type===s.ControlType.CHECKBOX)this.activeControl=new wo(u,this);else if(d.type===s.ControlType.RADIO)this.activeControl=new Hi(u,this);else if(d.type===s.ControlType.DATE){const g=new Lo(u,this);this.activeControl=g,!this.isPopupAwakeDisabled&&(T||this.draw.getMode()===s.EditorMode.FORM)&&g.awake()}else if(d.type===s.ControlType.NUMBER)this.activeControl=new ci(u,this);else if(d.type===s.ControlType.BUTTON){const g=new Nn(u,this);if(this.activeControl=g,!this.isPopupAwakeDisabled&&T&&(g.awake(),this.draw.getMode()!==s.EditorMode.FORM||u.control?.editable===!1))return}else if(d.type===s.ControlType.MENSTRUAL_HISTORY){const g=new Vl(u,this);this.activeControl=g,this.isPopupAwakeDisabled||g.awake()}this.updateActiveControlValue(),this.preElement=u,u.controlComponent!==s.ControlComponent.POSTFIX&&u.controlComponent!==s.ControlComponent.POSTTEXTFIX&&this.emitControlChange(s.ControlState.ACTIVE)}destroyControl(t={}){if(!this.activeControl)return;const{isEmitEvent:e=!0}=t;(this.activeControl instanceof co||this.activeControl instanceof Lo||this.activeControl instanceof ci||this.activeControl instanceof Vl)&&this.activeControl.destroy(),e&&this.preElement?.controlComponent!==s.ControlComponent.POSTFIX&&this.preElement?.controlComponent!==s.ControlComponent.POSTTEXTFIX&&this.emitControlChange(s.ControlState.INACTIVE),this.preElement=null,this.activeControl=null,this.activeControlValue=[]}repaintControl(t={}){const{curIndex:e,isCompute:n=!0,isSubmitHistory:i=!0,isSetCursor:l=!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:l,isSubmitHistory:i}))}emitControlContentChange(t){const e=this.eventBus.isSubscribe("controlContentChange");if(!e&&!this.listener.controlContentChange)return;const n=t?.controlElement||this.activeControl?.getElement();if(!n)return;const i=t?.context?.elementList||this.getElementList(),{startIndex:l}=t?.context?.range||this.getRange();if(!i[l]?.controlId)return;const r=t?.controlValue||this.getControlElementList(t?.context);let a;if(r?.length?a=Ut(r)[0].control:(a=n.control,a.value=[]),!a)return;const c={control:a,controlId:n.controlId};this.listener.controlContentChange?.(c),e&&this.eventBus.emit("controlContentChange",c)}reAwakeControl(){if(!this.activeControl)return;const t=this.getElementList(),e=this.getRange(),n=t[e.startIndex];this.activeControl.setElement(n),(this.activeControl instanceof Lo||this.activeControl instanceof co)&&this.activeControl.getIsPopup()&&(this.activeControl.destroy(),this.activeControl.awake())}selectValue(){const t=this.getElementList(),{startIndex:e}=this.getRange(),n=t[e];if(!n?.controlId||n.controlComponent!==s.ControlComponent.VALUE&&t[e+1]?.controlComponent===s.ControlComponent.VALUE)return!1;let i=e;for(;i>0&&t[i].controlComponent===s.ControlComponent.VALUE;)i--;let l=e+1;for(;l<t.length;){if(t[l].controlComponent!==s.ControlComponent.VALUE){l--;break}l++}if(i!==l){const r=this.range.getRange();return this.range.replaceRange({...r,startIndex:i,endIndex:l}),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),!0}return!1}moveCursor(t){const{index:e,trIndex:n,tdIndex:i,tdValueIndex:l}=t;let r=this.draw.getOriginalElementList(),a;const c=t.isTable?l:e;if(t.isTable?(r=r[e].trList[n].tdList[i].value,a=r[l]):a=r[e],a.control?.hide||a.area?.hide){const d=_n(r,c);return{newIndex:d,newElement:r[d]}}if(a.controlComponent===s.ControlComponent.VALUE)return{newIndex:c,newElement:a};if(a.controlComponent===s.ControlComponent.POSTFIX){let d=c+1;for(;d<r.length;){const u=r[d];if(!kt(u,a))return{newIndex:d-1,newElement:r[d-1]};if(d===r.length-1)return{newIndex:d,newElement:r[d]};d++}}else if(a.controlComponent===s.ControlComponent.PREFIX||a.controlComponent===s.ControlComponent.PRE_TEXT){let d=c+1;for(;d<r.length;){const u=r[d];if(!kt(u,a)||u.controlComponent!==s.ControlComponent.PREFIX&&u.controlComponent!==s.ControlComponent.PRE_TEXT)return{newIndex:d-1,newElement:r[d-1]};d++}}else if(a.controlComponent===s.ControlComponent.PLACEHOLDER){let d=c-1;for(;d>0;){const u=r[d];if(!kt(u,a)||u.controlComponent===s.ControlComponent.VALUE||u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT||u.controlComponent===s.ControlComponent.PRETEXTFIX||u.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d,newElement:r[d]};d--}}else if(a.controlComponent===s.ControlComponent.POST_TEXT||a.controlComponent===s.ControlComponent.TEXTFIXLABEL||a.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){let d=c-1;for(;d>0;){const u=r[d];if(!kt(u,a)||u.controlComponent===s.ControlComponent.VALUE||u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT||u.controlComponent===s.ControlComponent.PRETEXTFIX||u.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d,newElement:r[d]};d--}}else if(a.controlComponent===s.ControlComponent.POSTTEXTFIX){let d=c+1;for(;d<r.length;){const u=r[d];if(!kt(u,a))return{newIndex:d-1,newElement:r[d-1]};if(d===r.length-1)return{newIndex:d,newElement:r[d]};d++}}else if(a.controlComponent===s.ControlComponent.PRETEXTFIX||a.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){let d=c+1;for(;d<r.length;){const u=r[d];if(!kt(u,a)||u.controlComponent!==s.ControlComponent.PRETEXTFIX&&u.controlComponent!==s.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d-1,newElement:r[d-1]};d++}}return{newIndex:c,newElement:a}}removeControl(t,e={}){const n=e.elementList||this.getElementList(),i=n[t];if(!this.draw.isDesignMode()&&!i?.control?.hide&&!i?.area?.hide){const{deletable:m=!0}=i.control;if(!m)return null;const L=this.draw.getMode();if(L===s.EditorMode.FORM&&this.options.modeRule[L].controlDeletableDisabled)return null}let l=-1,r=-1;const a=!!i.originControlId,c=i.controlId,d=i.originControlId,u=i.control?.type===s.ControlType.BUTTON&&!i.control?.buttonText?`${c}_text`:"";let h=t;for(;h>=0;){const m=n[h];let L=!1;if(a?L=m.controlId===c&&m.originControlId===d:L=m.controlId===c&&!m.originControlId,!L){l=h;break}h--}let R=t;for(;R<n.length;){const m=n[R];let L=!1;if(a?L=m.controlId===c&&m.originControlId===d:L=m.controlId===c&&!m.originControlId,!L){r=R-1;break}R++}if(R===n.length&&(r=R-1),!~l&&!~r)return t;l=~l?l:0;const T=n[l+1],g=T.control,f=g?.type&&[s.ControlType.TEXT,s.ControlType.TEXTFIELD,s.ControlType.DATE,s.ControlType.NUMBER,s.ControlType.SELECT,s.ControlType.BUTTON].includes(g.type);let C=n[0]?.type===s.ElementType.SPLIT_TAG;if(!e.removeNext&&f&&!a&&T.controlComponent!==s.ControlComponent.PREFIX&&T.type!==s.ElementType.SPLIT_TAG)if(e.removePrev)e.removePrev();else{const m=this.draw.getTd();m&&this.createRemoveControlHandler(m,i.controlId,!0)}if(!e.removeNext&&f&&!a&&T.controlComponent!==s.ControlComponent.PRETEXTFIX&&T.type!==s.ElementType.SPLIT_TAG)if(e.removePrev)e.removePrev();else{const m=this.draw.getTd();m&&this.createRemoveControlHandler(m,i.controlId,!0)}if(!e.removePrev&&f&&!a&&n[r].controlComponent!==s.ControlComponent.POSTFIX)if(e.removeNext)e.removeNext();else{const m=this.draw.getTd();C=!!m?.linkTdNextId,m&&this.createRemoveControlHandler(m,i.controlId,!1)}if(!e.removePrev&&f&&!a&&n[r].controlComponent!==s.ControlComponent.POSTTEXTFIX)if(e.removeNext)e.removeNext();else{const m=this.draw.getTd();C=!!m?.linkTdNextId,m&&this.createRemoveControlHandler(m,i.controlId,!1)}this.draw.spliceElementList(n,l+1,r-l);let p=0;if(u)for(let m=n.length-1;m>=0;m--)n[m].controlId===u&&(m<=l&&p++,n.splice(m,1));const I=l-p;return!e.elementList&&C&&l===0?this.draw.fixPosition(!0)??I:I}createRemoveControlHandler(t,e,n){if(n){const i=this.draw.getTdById(t.linkTdPrevId);i&&i.value.splice(-1)[0]?.controlId===e&&this.removeControl(i.value.length-1,{elementList:i.value,removePrev:()=>{this.createRemoveControlHandler(i,e,n)}})}else{const i=this.draw.getTdById(t.linkTdNextId);i&&i.value[1]?.controlId===e&&this.removeControl(1,{elementList:i.value,removeNext:()=>{this.createRemoveControlHandler(i,e,n)}})}}removePlaceholder(t,e={}){const n=e.elementList||this.getElementList(),i=n[t],l=n[t+1];if(i.controlComponent===s.ControlComponent.PLACEHOLDER||i.controlComponent===s.ControlComponent.TEXTFIXLABEL||l?.controlComponent===s.ControlComponent.PLACEHOLDER||l?.controlComponent===s.ControlComponent.TEXTFIXLABEL){let r=!1,a=t;for(;a<n.length;){const c=n[a];if(c.controlId!==i.controlId)break;c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.TEXTFIXLABEL?(r||(r=!0,this.draw.getHistoryManager().popUndo(),this.draw.submitHistory(t)),n.splice(a,1)):a++}}}addPlaceholder(t,e={}){const n=e.elementList||this.getElementList(),i=n[t],l=i.control,r=l.placeholder;if(!r)return;l.placeholder=r;let a=t;for(;a>=0;){const f=n[a];if(f.controlId!==i.controlId){a++;break}if(f.controlComponent===s.ControlComponent.PREFIX||f.controlComponent===s.ControlComponent.PRE_TEXT||f.controlComponent===s.ControlComponent.PRETEXTFIX||f.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)break;a--}a<0&&(a=0);const c=a+1;if(c<n.length){const f=n[c];if(f.controlId===i.controlId&&(f.controlComponent===s.ControlComponent.PLACEHOLDER||f.controlComponent===s.ControlComponent.VALUE&&!me(f)))return}let d=!1,u=a+1;for(;u<n.length;){const f=n[u];if(f.controlId===i.controlId){if(f.controlComponent===s.ControlComponent.POSTFIX||f.controlComponent===s.ControlComponent.POST_TEXT||f.controlComponent===s.ControlComponent.POSTTEXTFIX||f.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)break}else if(f.controlId!==i.controlId&&(f.controlComponent===s.ControlComponent.VALUE||f.controlComponent===s.ControlComponent.PREFIX||f.controlComponent===s.ControlComponent.PRE_TEXT)){d=!0;break}u++}if(d)return;const h=Nt(r),R=xt(i,ue),T=xt(i,["originControlId","subTemplateParentId","subTemplateInstanceId"]),g=a+1;for(let f=0;f<h.length;f++){const C=h[f],p={...R,...T,value:C===`
213
- `?_:C,controlId:i.controlId,type:s.ElementType.CONTROL,control:i.control,controlComponent:s.ControlComponent.PLACEHOLDER,color:this.controlOptions.placeholderColor};le(n,[p],a,{editorOptions:this.options}),this.draw.spliceElementList(n,g+f,0,[p])}}setValue(t){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.setValue(t)}setControlProperties(t,e={}){const n=e.elementList||this.getElementList(),{startIndex:i}=e.range||this.getRange(),l=n[i];let r=i;for(;r>0;){const c=n[r];if(c.controlId!==l.controlId)break;c.control={...c.control,...t},r--}let a=i+1;for(;a<n.length;){const c=n[a];if(c.controlId!==l.controlId)break;c.control={...c.control,...t},a++}}keydown(t){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.keydown(t)}cut(){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.cut()}getValueById(t){const{id:e,groupId:n,conceptId:i,areaId:l}=t,r=[];if(!e&&!i&&!n)return r;const a=new Set,c=(u,h)=>{let R=0;for(;R<u.length;){const T=u[R];if(R++,T.type===s.ElementType.TABLE){const L=T.trList;for(let O=0;O<L.length;O++){const P=L[O];for(let S=0;S<P.tdList.length;S++){const y=P.tdList[S],Y=y.originalId??y.id;a.has(Y)||(a.add(Y),y.linkTdNextId?c(this.draw.getSplitTdValues(Y),h):c(y.value,h))}}}if(!T.control||n&&T.control.groupId!==n||e&&T.controlId!==e||i&&T.control.conceptId!==i||l&&T.areaId!==l)continue;const{type:g,code:f,valueSets:C}=T.control;let p=R,I="";const m=[];for(;p<u.length;){const L=u[p];if(L.controlId!==T.controlId)break;(g===s.ControlType.TEXT||g===s.ControlType.TEXTFIELD||g===s.ControlType.DATE||g===s.ControlType.NUMBER)&&L.controlComponent===s.ControlComponent.VALUE&&(I+=L.value,m.push(Ee(L,Si))),p++}if(g===s.ControlType.TEXT||g===s.ControlType.TEXTFIELD||g===s.ControlType.DATE||g===s.ControlType.NUMBER)r.push({...T.control,zone:h,value:I||null,innerText:I||null,elementList:Ut(m)});else if(g===s.ControlType.SELECT||g===s.ControlType.CHECKBOX||g===s.ControlType.RADIO){const L=f?.split(",").map(O=>C?.find(P=>P.code===O)?.value).filter(Boolean).join("");r.push({...T.control,zone:h,value:f||null,innerText:L||null})}R=p}},d=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:u,elementList:h}of d)c(h,u);return r}setValueListById(t){if(!t.length)return;let e=!1,n=!1;const i=(r,a)=>{let c=0;for(;c<r.length;){const d=r[c];if(c++,d.type===s.ElementType.TABLE){const m=d.trList;for(let L=0;L<m.length;L++){const O=m[L];for(let P=0;P<O.tdList.length;P++){const S=O.tdList[P];i(S.value,S.id)}}}if(!d.control||d.type===s.ElementType.SPLIT_TAG)continue;const u=t.find(m=>(!m.groupId||m.groupId===d.control?.groupId)&&(m.id&&d.controlId===m.id||m.conceptId&&d.control.conceptId===m.conceptId||m.areaId&&d.areaId===m.areaId));if(!u)continue;const{value:h,isSubmitHistory:R=!0}=u;e=!0,R&&(n=!0);const{type:T}=d.control,{range:g,fullRange:f}=this.mergeControl({elementList:r,range:{startIndex:c,endIndex:c},tdId:a}),C={range:f??g,elementList:r,tdId:a},p={isIgnoreDisabledRule:!0,isIgnoreDeletedRule:!0};if(T===s.ControlType.TEXTFIELD){const m=Array.isArray(h)?h:h?[{value:h}]:[];m.length&&ee(m,{isHandleFirstElement:!1,editorOptions:this.options});const L=new bl(d,this);this.activeControl=L,m.length?L.setValue(m,C,p):L.clearValue(C,p)}else if(T===s.ControlType.TEXT){const m=Array.isArray(h)?h:h?[{value:h}]:[];m.length&&ee(m,{isHandleFirstElement:!1,editorOptions:this.options});const L=new Vs(d,this);this.activeControl=L,m.length?L.setValue(m,C,p):L.clearValue(C,p)}else if(T===s.ControlType.SELECT){if(Array.isArray(h))continue;const m=new co(d,this);this.activeControl=m,h?m.setSelect(h,C,p):m.clearSelect(C,p)}else if(T===s.ControlType.CHECKBOX){if(Array.isArray(h))continue;const m=new wo(d,this);this.activeControl=m;const L=h?h.split(","):[];m.setSelect(L,C,p)}else if(T===s.ControlType.RADIO){if(Array.isArray(h))continue;const m=new Hi(d,this);this.activeControl=m;const L=h?[h]:[];m.setSelect(L,C,p)}else if(T===s.ControlType.DATE){const m=new Lo(d,this);this.activeControl=m,Ii(h)?(h.length&&ee(h,{isHandleFirstElement:!1,editorOptions:this.options}),m.setValue(h,C,p)):Ea(h)?m.setSelect(h,C,p):m.clearSelect(C,p)}else if(T===s.ControlType.NUMBER){const m=Array.isArray(h)?h:h?[{value:h}]:[];m.length&&ee(m,{isHandleFirstElement:!1,editorOptions:this.options});const L=new ci(d,this);this.activeControl=L,m.length?L.setValue(m,C,p):L.clearValue(C,p)}else if(T===s.ControlType.BUTTON){const m=Array.isArray(h)?h:h?[{value:h}]:[];m.length&&ee(m,{isHandleFirstElement:!1,editorOptions:this.options});const L=new Nn(d,this);this.activeControl=L,m.length?L.setValue(m,C,p):L.clearSelect(C,p)}this.emitControlContentChange({context:C}),this.activeControl=null;let I=c;for(;I<r.length&&r[I].controlId===d.controlId;)I++;c=I}};this.destroyControl({isEmitEvent:!1});const l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const r of l)i(r);e&&(n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1}))}setExtensionListById(t){if(!t.length)return;const e=i=>{let l=0;for(;l<i.length;){const r=i[l];if(l++,r.type===s.ElementType.TABLE){const u=r.trList;for(let h=0;h<u.length;h++){const R=u[h];for(let T=0;T<R.tdList.length;T++){const g=R.tdList[T];e(g.value)}}}if(!r.control)continue;const a=t.find(u=>u.id&&r.controlId===u.id||u.conceptId&&r.control.conceptId===u.conceptId||u.areaId&&r.areaId===u.areaId);if(!a)continue;const{extension:c}=a;this.setControlProperties({extension:c},{elementList:i,range:{startIndex:l,endIndex:l}});let d=l;for(;d<i.length&&i[d].controlId===r.controlId;)d++;l=d}},n=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const i of n)e(i)}setPropertiesListById(t){if(!t.length)return;let e=!1,n=!1;const i=r=>{let a=0;for(;a<r.length;){const c=r[a];if(a++,c.type===s.ElementType.TABLE){const T=c.trList;for(let g=0;g<T.length;g++){const f=T[g];for(let C=0;C<f.tdList.length;C++){const p=f.tdList[C];i(p.value)}}}if(!c.control)continue;const d=t.find(T=>T.id&&c.controlId===T.id||T.conceptId&&c.control.conceptId===T.conceptId||T.areaId&&c.areaId===T.areaId);if(!d)continue;const{properties:u,isSubmitHistory:h=!0}=d;if(e=!0,h&&(n=!0),this.setControlProperties({...c.control,...u,value:c.control.value},{elementList:r,range:{startIndex:a-1,endIndex:a-1}}),ue.forEach(T=>{const g=u[T];g&&Reflect.set(c,T,g)}),c.control?.type===s.ControlType.NUMBER&&u.numberExclusiveOptions){const T={...c.control.numberExclusiveOptions,...u.numberExclusiveOptions},g=T?.minValue,f=T?.maxValue,C=new ci(c,this),p=C.getValue({elementList:r,range:{startIndex:a-1,endIndex:a-1}});if(p.length>0){const I=p.map(L=>L.value).join(""),m=Number(I);!Number.isNaN(m)&&Number.isFinite(m)&&(g!=null&&m<g||f!=null&&m>f)&&C.clearValue({elementList:r,range:{startIndex:a-1,endIndex:a-1}},{isAddPlaceholder:!0})}}let R=a;for(;R<r.length&&r[R].controlId===c.controlId;)R++;a=R}},l={header:this.draw.getHeaderElementList(),main:this.draw.getOriginalMainElementList(),footer:this.draw.getFooterElementList()};for(const r in l){const a=l[r];i(a)}if(e){for(const r in l){const a=r,c=Ut(l[a],{isClassifyArea:!0,extraPickAttrs:["id","controlId"]});l[a]=c,ee(c,{editorOptions:this.options,isForceCompensation:!0})}this.draw.setEditorData(l),n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1})}}getList(){const t=[];function e(i){for(let l=0;l<i.length;l++){const r=i[l];if(r.type===s.ElementType.TABLE){const a=r.trList;for(let c=0;c<a.length;c++){const d=a[c];for(let u=0;u<d.tdList.length;u++){const R=d.tdList[u].value;e(R)}}}if(r.controlId){const a=Ee(r,[...Oi,...Wn]);t.push(a)}}}const n=[this.draw.getHeader().getElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooter().getElementList()];for(const i of n)e(i);return Ut(t,{extraPickAttrs:["controlId"]})}recordBorderInfo(t,e,n,i){this.controlBorder.recordBorderInfo(t,e,n,i)}drawBorder(t){this.controlBorder.render(t)}startTextFieldUnderline(t,e,n){this.textFieldUnderline.startTextFieldValue(t,e,n)}recordTextFieldUnderlineWidth(t){this.textFieldUnderline.recordValueWidth(t)}drawTextFieldUnderline(t){this.textFieldUnderline.endTextFieldValue(t)}_getControlIdentity(t){return lo(t)}_isSameControlIdentity(t,e){return!!(e&&t.controlId===e.controlId&&(t.originControlId||null)===e.originControlId&&(t.subTemplateInstanceId||t.subTemplateParentId||null)===e.subTemplateInstanceId)}_isNestedParentControlElement(t,e){return!!(e?.originControlId&&t.controlId===e.originControlId&&!t.originControlId)}_isNestedTextContainerElement(t,e){if(!e.controlId||e.originControlId)return!1;let n=!1,i=!1;for(let l=0;l<t.length;l++){const r=t[l];if(r.controlId===e.controlId&&!r.originControlId?(r.control?.type===s.ControlType.TEXT||r.control?.type===s.ControlType.TEXTFIELD)&&(n=!0):r.originControlId===e.controlId&&(i=!0),n&&i)return!0}return!1}_getCurrentControlIdentity(t){const e=this.getElementList()[t],n=this._getControlIdentity(this.activeControl?.getElement()),i=this._getControlIdentity(e);return i&&(!n||this._isSameControlIdentity(e,n)||i.originControlId===n.controlId)?i:n}_getControlNavigationIndex(t,e,n){const i=this._getControlIdentity(t[e]);if(!i)return e;let l=e;for(;l>0&&this._isSameControlIdentity(t[l-1],i);)l--;let r=e;for(;r+1<t.length&&this._isSameControlIdentity(t[r+1],i);)r++;if(n===zt.DOWN){let a=-1;for(let c=l;c<=r;c++){const d=t[c];if(d.controlComponent===s.ControlComponent.CHECKBOX||d.controlComponent===s.ControlComponent.RADIO||d.controlComponent===s.ControlComponent.VALUE)return c;a===-1&&(d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT||d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&(a=c)}return~a?a:l}for(let a=r;a>=l;a--)if(t[a].controlComponent===s.ControlComponent.VALUE)return a;return l}_isTrailingNestedControlBoundary(t,e,n){const i=t[e];return!n||!i?.originControlId||i.originControlId!==n.controlId||i.controlComponent!==s.ControlComponent.POSTFIX&&i.controlComponent!==s.ControlComponent.POST_TEXT&&i.controlComponent!==s.ControlComponent.POSTTEXTFIX&&i.controlComponent!==s.ControlComponent.POSTTEXTFIX_TEXT?!1:this._isSameControlIdentity(t[e-1],this._getControlIdentity(i))||this._isSameControlIdentity(t[e-1],n)}getPreControlContext(){const e=this.draw.getPosition().getPositionContext();if(!e)return null;const{startIndex:n}=this.range.getRange(),i=this.getElementList(),l=this.activeControl?.getElement()||i[n],r=this._getCurrentControlIdentity(n),a=(d,u)=>{for(let h=u;h>0;h--){const R=d[h];if(R.type===s.ElementType.TABLE){const T=R.trList||[];for(let g=T.length-1;g>=0;g--){const f=T[g],C=f.tdList;for(let p=C.length-1;p>=0;p--){const I=C[p],m=a(I.value,I.value.length-1);if(m)return{positionContext:{isTable:!0,index:h,trIndex:g,tdIndex:p,tdId:I.id,trId:f.id,tableId:R.id},nextIndex:m.nextIndex}}}}if(!(!R.controlId||this._isSameControlIdentity(R,r)||this._isTrailingNestedControlBoundary(d,h,r)||this._isNestedParentControlElement(R,r)||this._isNestedTextContainerElement(d,R)))return{positionContext:{isTable:!1},nextIndex:this._getControlNavigationIndex(d,h,zt.UP)}}return null},c=a(i,n);if(c)return{positionContext:e.isTable?e:c.positionContext,nextIndex:c.nextIndex};if(l.tableId){const d=this.draw.getOriginalElementList(),{index:u,trIndex:h,tdIndex:R}=e,T=d[u].trList;for(let f=h;f>=0;f--){const C=T[f],p=C.tdList;for(let I=p.length-1;I>=0;I--){if(h===f&&I>=R)continue;const m=p[I],L=a(m.value,m.value.length-1);if(L)return{positionContext:{isTable:!0,index:e.index,trIndex:f,tdIndex:I,tdId:m.id,trId:C.id,tableId:l.tableId},nextIndex:L.nextIndex}}}const g=a(d,u-1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}getNextControlContext(){const e=this.draw.getPosition().getPositionContext();if(!e)return null;const{endIndex:n}=this.range.getRange(),i=this.getElementList(),l=this.activeControl?.getElement()||i[n],r=this._getCurrentControlIdentity(n),a=(d,u)=>{for(let h=u;h<d.length;h++){const R=d[h];if(R.type===s.ElementType.TABLE){const T=R.trList||[];for(let g=0;g<T.length;g++){const f=T[g],C=f.tdList;for(let p=0;p<C.length;p++){const I=C[p],m=a(I.value,0);if(m)return{positionContext:{isTable:!0,index:h,trIndex:g,tdIndex:p,tdId:I.id,trId:f.id,tableId:R.id},nextIndex:m.nextIndex}}}}if(!(!R.controlId||this._isSameControlIdentity(R,r)||this._isTrailingNestedControlBoundary(d,h,r)||this._isNestedParentControlElement(R,r)||this._isNestedTextContainerElement(d,R)))return{positionContext:{isTable:!1},nextIndex:this._getControlNavigationIndex(d,h,zt.DOWN)}}return null},c=a(i,n);if(c)return{positionContext:e.isTable?e:c.positionContext,nextIndex:c.nextIndex};if(l.tableId){const d=this.draw.getOriginalElementList(),{index:u,trIndex:h,tdIndex:R}=e,T=d[u].trList;for(let f=h;f<T.length;f++){const C=T[f],p=C.tdList;for(let I=0;I<p.length;I++){if(h===f&&I<=R)continue;const m=p[I],L=a(m.value,0);if(L)return{positionContext:{isTable:!0,index:e.index,trIndex:f,tdIndex:I,tdId:m.id,trId:C.id,tableId:l.tableId},nextIndex:L.nextIndex}}}const g=a(d,u+1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}initNextControl(t={}){const{direction:e=zt.DOWN}=t;let n=null;if(e===zt.UP?n=this.getPreControlContext():n=this.getNextControlContext(),!n)return;const{nextIndex:i,positionContext:l}=n,r=this.draw.getPosition();r.setPositionContext(l),this.draw.getRange().replaceRange({startIndex:i,endIndex:i}),this.draw.render({curIndex:i,isCompute:!1,isSetCursor:!0,isSubmitHistory:!1});const a=r.getPositionList();this.draw.getCursor().moveCursorToVisible({cursorPosition:a[i],direction:e})}setMinWidthControlInfo(t){const{row:e,rowElement:n,controlRealWidth:i,availableWidth:l}=t;if(!n.control?.minWidth)return;const{scale:r}=this.options,a=n.control.minWidth*r;let c=null;if(n.control?.minWidth&&(n.control?.rowFlex===s.RowFlex.CENTER||n.control?.rowFlex===s.RowFlex.RIGHT)){let u=n.metrics.width,h=e.elementList.length-1;for(;h>=0;){const R=e.elementList[h];if(u+=R.metrics.width,e.elementList[h-1]?.controlComponent===s.ControlComponent.PREFIX){c=R;break}h--}c&&u<a&&(n.control.rowFlex===s.RowFlex.CENTER?c.left=(a-u)/2:n.control.rowFlex===s.RowFlex.RIGHT&&(c.left=a-u-n.metrics.width))}const d=a-i;if(d>0){const u=c?.left||0,h=l-e.width-n.metrics.width,R=Math.min(h,d);n.left=R-u,e.width+=R-u}}mergeControl(t={}){const e=t.elementList||this.getElementList(),n=t.range||this.getRange(),{startIndex:i}=n,l=t.tdId??this.draw.getPosition().getPositionContext().tdId,r=l?this.draw.getTdById(l):void 0,a=e[i];if(!a?.controlId)return{range:n,elementList:[],tdId:l};const c={startIndex:i,endIndex:i},d=[];let u=!1,h=i,R=r,T=e;for(;h>=0;){const p=T[h];if(p.controlId!==a.controlId)break;if(p.type!==s.ElementType.SPLIT_TAG&&(d.unshift(p),u&&(T.splice(h,1),e[0].type===s.ElementType.SPLIT_TAG?e.splice(0,1):(n.startIndex++,n.endIndex++),e.unshift(p)),c.startIndex=h),h===0&&p.controlComponent!==s.ControlComponent.PREFIX&&R?.linkTdPrevId&&(R=this.draw.getTdById(R.linkTdPrevId),R)){T=R.value,h=R.value.length-1,u=!0;continue}if(h===0&&p.controlComponent!==s.ControlComponent.PRETEXTFIX&&R?.linkTdPrevId&&(R=this.draw.getTdById(R.linkTdPrevId),R)){T=R.value,h=R.value.length-1,u=!0;continue}h--}u=!1;let g=i+1,f=r,C=e;for(;g<C.length;){const p=C[g];if(p.controlId!==a.controlId)break;if(p.type!==s.ElementType.SPLIT_TAG&&(d.push(p),u&&(C.splice(g,1),e.push(p),g--)),g===C.length-1&&p.controlComponent!==s.ControlComponent.POSTFIX&&f?.linkTdNextId&&(f=this.draw.getTdById(f.linkTdNextId),f)){C=f.value,g=0,u=!0;continue}if(g===C.length-1&&p.controlComponent!==s.ControlComponent.POSTTEXTFIX&&f?.linkTdNextId&&(f=this.draw.getTdById(f.linkTdNextId),f)){C=f.value,g=0,u=!0;continue}g++}return c.endIndex=c.startIndex+d.length,{range:n,elementList:e,tdId:l,fullRange:{startIndex:c.startIndex,endIndex:c.endIndex-2}}}}class cT{options;currentTextFieldId=null;valueStartX=0;valueWidth=0;valueY=0;constructor(t){this.options=t.getOptions()}startTextFieldValue(t,e,n){this.currentTextFieldId=t,this.valueStartX=e,this.valueY=n,this.valueWidth=0}recordValueWidth(t){this.valueWidth+=t}endTextFieldValue(t){if(!this.currentTextFieldId||this.valueWidth<=0){this.reset();return}const{scale:e}=this.options;t.save(),t.strokeStyle=this.options.defaultColor,t.lineWidth=e,t.beginPath();const n=this.valueY-.5*e;t.moveTo(this.valueStartX,n),t.lineTo(this.valueStartX+this.valueWidth,n),t.stroke(),t.restore(),this.reset()}reset(){this.currentTextFieldId=null,this.valueStartX=0,this.valueWidth=0,this.valueY=0}}function di(o,t){const e=n=>{for(let i=0;i<n.length;i++){const l=n[i];if(t(l),l.valueList?.length&&e(l.valueList),l.control?.value?.length&&e(l.control.value),l.type===s.ElementType.TABLE&&l.trList?.length)for(let r=0;r<l.trList.length;r++){const a=l.trList[r];for(let c=0;c<a.tdList.length;c++)e(a.tdList[c].value)}}};e(o)}function Ws(o,t){const e=t.id||ft(),n=t.subTemplateInstanceId||ft();let i=!1;t.id!==e&&(t.id=e,i=!0),t.subTemplateInstanceId!==n&&(t.subTemplateInstanceId=n,i=!0);const l=r=>{for(let a=0;a<r.length;a++){const c=r[a];if(c.subTemplateParentId&&c.subTemplateParentId!==e)continue;c.subTemplateParentId!==e&&(c.subTemplateParentId=e,i=!0);const d=c.type===s.ElementType.SUB_TEMPLATE?c.subTemplateInstanceId||ft():n;if(c.subTemplateInstanceId!==d&&(c.subTemplateInstanceId=d,i=!0),c.valueList?.length&&l(c.valueList),c.type===s.ElementType.TABLE&&c.trList?.length)for(let u=0;u<c.trList.length;u++){const h=c.trList[u];for(let R=0;R<h.tdList.length;R++)l(h.tdList[R].value)}}};return l(o),i}function Wl(o){const t=e=>{for(let n=0;n<e.length;n++){const i=e[n];if(delete i.subTemplateParentId,delete i.subTemplateInstanceId,i.subTemplateContent?.length&&t(i.subTemplateContent),i.valueList?.length&&t(i.valueList),i.control?.value?.length&&t(i.control.value),i.type===s.ElementType.TABLE&&i.trList?.length)for(let l=0;l<i.trList.length;l++){const r=i.trList[l];for(let a=0;a<r.tdList.length;a++)t(r.tdList[a].value)}}};t(o)}function dT(o){const t=o.control;return t?t.type===s.ControlType.TEXT||t.type===s.ControlType.TEXTFIELD||t.type===s.ControlType.DATE||t.type===s.ControlType.NUMBER?Pn(t.value||[])||null:(t.type===s.ControlType.SELECT||t.type===s.ControlType.CHECKBOX||t.type===s.ControlType.RADIO)&&t.code?.split(",").map(e=>t.valueSets?.find(n=>n.code===e)?.value).filter(Boolean).join("")||null:null}function uT(o){const t=new Map,e=new Set,n=new Set,i=(l,r,a)=>{if(!l||r==null)return;const c=t.get(l)||[];c.push({label:l,source:a,value:r}),t.set(l,c)};return di(o,l=>{l.control&&l.controlId&&!e.has(l.controlId)&&(e.add(l.controlId),i(l.control.label,dT(l),"control"));const r=l.id;if(r&&!n.has(r)&&(l.type===s.ElementType.MACRO||l.type===s.ElementType.CUSTOM_MACRO||l.type===s.ElementType.REUSABLE_ITEM)){n.add(r);let a;l.type===s.ElementType.MACRO?a=l.value:l.type===s.ElementType.CUSTOM_MACRO?a=l.macroConfig?.value:l.type===s.ElementType.REUSABLE_ITEM&&(a=l.reusableItemConfig?.value),i(l.label,a,"macro")}}),t}function Us(o){const t=o.replace(/,/g,"").match(/[-+]?(?:\d+(?:\.\d+)?|\.\d+)/);if(!t)return null;const e=Number(t[0]);return Number.isFinite(e)?e:null}function hT(o,t){const{rangeMin:e,rangeMax:n,source:i="all"}=o;if(e==null||n==null)return!1;const l=Us(e),r=Us(n);return l==null||r==null||l>r?!1:t.some(a=>{if(i!=="all"&&a.source!==i)return!1;const c=Us(a.value);return c!=null&&c>=l&&c<=r})}function Ul(o,t){const{label:e,value:n,regex:i,source:l="all"}=o;if(!e)return!1;const r=t.get(e);if(!r?.length)return!1;if(o.matchMode==="range")return hT(o,r);const a=n??i;if(a==null||a==="")return!1;if(n!=null)return r.some(d=>l!=="all"&&d.source!==l?!1:d.value.trim()===n.trim());let c;try{c=new RegExp(a)}catch(d){return console.warn("子模板匹配正则无效:",a,d),!1}return r.some(d=>l!=="all"&&d.source!==l?!1:c.test(d.value))}function RT(o,t,e="and"){return o?.length?e==="or"?o.some(n=>Ul(n,t)):o.every(n=>Ul(n,t)):!0}class gT{draw;options;constructor(t){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:l}=t;let{y:r}=t;const{checkbox:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:u,verticalAlign:h},scale:R}=this.options,T=l.elementList[i],{metrics:g,checkbox:f}=T,C=T.controlComponent?0:a;if(h===s.VerticalAlign.TOP||h===s.VerticalAlign.MIDDLE){let O=i+1,P=null;for(;O<l.elementList.length&&(P=l.elementList[O],!(P.value!==_&&P.value!==gi));)O++;if(P){const{metrics:{boundingBoxAscent:S,boundingBoxDescent:y}}=P,Y=S+y;Y>g.height&&(h===s.VerticalAlign.TOP?r-=S-g.height:h===s.VerticalAlign.MIDDLE&&(r-=(Y-g.height)/2))}}const p=Math.round(n+C*R),I=Math.round(r-g.height+c),m=g.width-(C+a)*R,L=g.height;e.save(),e.beginPath(),e.translate(.5,.5),f?.value?(e.lineWidth=c,e.strokeStyle=d,e.rect(p,I,m,L),e.stroke(),e.beginPath(),e.fillStyle=d,e.fillRect(p,I,m,L),e.beginPath(),e.strokeStyle=u,e.lineWidth=c*2*R,e.moveTo(p+2*R,I+L/2),e.lineTo(p+m/2,I+L-3*R),e.lineTo(p+m-2*R,I+3*R),e.stroke()):(e.lineWidth=c,e.rect(p,I,m,L),e.stroke()),e.closePath(),e.restore()}}class TT{draw;options;constructor(t){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:l}=t;let{y:r}=t;const{radio:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:u,verticalAlign:h},scale:R}=this.options,T=l.elementList[i],{metrics:g,radio:f}=T,C=T.controlComponent?0:a;if(h===s.VerticalAlign.TOP||h===s.VerticalAlign.MIDDLE){let O=i+1,P=null;for(;O<l.elementList.length&&(P=l.elementList[O],!(P.value!==_&&P.value!==gi));)O++;if(P){const{metrics:{boundingBoxAscent:S,boundingBoxDescent:y}}=P,Y=S+y;Y>g.height&&(h===s.VerticalAlign.TOP?r-=S-g.height:h===s.VerticalAlign.MIDDLE&&(r-=(Y-g.height)/2))}}const p=Math.round(n+C*R),I=Math.round(r-g.height+c),m=g.width-(C+a)*R,L=g.height;e.save(),e.beginPath(),e.translate(.5,.5),e.strokeStyle=f?.value?d:u,e.lineWidth=c,e.arc(p+m/2,I+L/2,m/2,0,Math.PI*2),e.stroke(),f?.value&&(e.beginPath(),e.fillStyle=d,e.arc(p+m/2,I+L/2,m/3,0,Math.PI*2),e.fill()),e.closePath(),e.restore()}}const ui={fontSize:11,smallFontSize:9,lineHeight:12,dividerWidth:40,gap:4,totalHeight:36};class fT{draw;options;inputModal=null;isPopup=!1;measureContext=null;sizeCache=new WeakMap;constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=ui,n=this.options.scale,i=t.menstrualData,l=[n,i?.isMenopause?1:0,i?.periodMin||"",i?.periodMax||"",i?.menarcheAge||"",i?.lastPeriod||"",i?.menopauseAge||"",i?.cycleMin||"",i?.cycleMax||""].join("|"),r=this.sizeCache.get(t);if(r?.key===l)return r.size;const a=e.fontSize*n,c=e.smallFontSize*n,d=e.gap*n,u=e.dividerWidth*n;this.measureContext||(this.measureContext=document.createElement("canvas").getContext("2d"));const h=this.measureContext;h.font=`${a}px "Microsoft YaHei", sans-serif`;let R=u;h.font=`${c}px "Microsoft YaHei", sans-serif`;let T=0;if(i){const C=this.getValue(i.menarcheAge);h.font=`${a}px "Microsoft YaHei", sans-serif`,C&&(R+=h.measureText(`${C}岁`).width+d);let p="";if(i.isMenopause){const P=this.getValue(i.menopauseAge);P&&(p=`${P}岁`)}else{const P=this.getValue(i.lastPeriod);P&&(p=P)}p&&(R+=h.measureText(p).width+d),h.font=`${c}px "Microsoft YaHei", sans-serif`;const I=this.getValue(i.periodMin),m=this.getValue(i.periodMax);if(I||m){const P=`${I||""}~${m||""}`;T=Math.max(T,h.measureText(P).width)}const L=this.getValue(i.cycleMin),O=this.getValue(i.cycleMax);if(L||O){const P=`${L||""}~${O||""}`;T=Math.max(T,h.measureText(P).width)}}else h.font=`${a}px "Microsoft YaHei", sans-serif`,T=h.measureText("~").width;const f={width:Math.max(R,T),height:e.totalHeight*n};return this.sizeCache.set(t,{key:l,size:f}),f}getValue(t){return!t||t===""||t==="_"||t==="____-__-__"?"":t}render(t){const{ctx:e,x:n,y:i,element:l}=t,r=l.menstrualData,a=this.options.scale;e.save(),e.font=`${ui.fontSize*a}px "Microsoft YaHei", sans-serif`,e.fillStyle=this.options.defaultColor,e.textBaseline="bottom",r?this.renderWithData(e,n,i,r,a):this.renderEmpty(e,n,i,a),e.restore()}renderEmpty(t,e,n,i){const l=ui,r=l.fontSize*i,a=l.lineHeight*i,c=l.dividerWidth*i,d=n-a*1.5,u=e+c/2;t.font=`${r}px "Microsoft YaHei", sans-serif`;const h=t.measureText("~").width,R=u-h/2;t.fillText("~",R,d+a);const T=d+a*2;this.drawDivider(t,e,T-r/2,c,i),t.fillText("~",R,T+a)}renderWithData(t,e,n,i,l){const r=ui,a=r.fontSize*l,c=r.smallFontSize*l,d=r.lineHeight*l,u=r.gap*l,h=r.dividerWidth*l,R=n-d*2,T=R+d*2;t.font=`${a}px "Microsoft YaHei", sans-serif`;const g=this.getValue(i.menarcheAge);let f=e;if(g){const X=`${g}岁`;t.fillText(X,e,T),f=e+t.measureText(X).width+u}const C=f+h/2,p=R+d;t.font=`${c}px "Microsoft YaHei", sans-serif`;const I=this.getValue(i.periodMin),m=this.getValue(i.periodMax);let L="";I||m?L=`${I||""}~${m||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,L="~");const O=t.measureText(L).width,P=C-O/2;t.fillText(L,P,p),this.drawDivider(t,f,T-a/2,h,l),t.font=`${a}px "Microsoft YaHei", sans-serif`;let S="";if(i.isMenopause){const X=this.getValue(i.menopauseAge);X&&(S=`${X}岁`)}else{const X=this.getValue(i.lastPeriod);X&&(S=X)}S&&t.fillText(S,f+h+u,T);const y=T+d;t.font=`${c}px "Microsoft YaHei", sans-serif`;const Y=this.getValue(i.cycleMin),b=this.getValue(i.cycleMax);let M="";Y||b?M=`${Y||""}~${b||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,M="~");const V=t.measureText(M).width,N=C-V/2;t.fillText(M,N,y)}drawDivider(t,e,n,i,l){t.save(),t.beginPath(),t.strokeStyle=this.options.defaultColor,t.lineWidth=.5*l,t.moveTo(e,n),t.lineTo(e+i,n),t.stroke(),t.restore()}clearMenstrualHistoryEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderMenstrualHistoryEditor(t,e){if(this.options.mode===s.EditorMode.PRINT||this.options.mode===s.EditorMode.COMPARE)return;(this.isPopup||this.inputModal)&&this.clearMenstrualHistoryEditor(),this.isPopup=!0;const n=t.menstrualData;this.inputModal=document.createElement("div"),this.inputModal.className="menstrual-history-edit-modal",this.inputModal.setAttribute("editor-component","menstrual-history-edit-modal"),this.inputModal.innerHTML=`
212
+ `,document.body.appendChild(this.inputModal);const e=this.inputModal.querySelector(".menstrual-history-modal__mask"),n=this.inputModal.querySelector(".menstrual-history-modal__container"),i=this.inputModal.querySelector(".menstrual-history-modal__close"),l=this.inputModal.querySelector(".btn-cancel"),r=this.inputModal.querySelector(".btn-confirm"),a=this.inputModal.querySelector("#mh-edit-notMenopause"),c=this.inputModal.querySelector("#mh-edit-isMenopauseForm"),d=this.inputModal.querySelectorAll('input[name="mh-edit-isMenopause"]'),u=()=>{this.closeModal()};n.addEventListener("click",h=>{h.stopPropagation()}),e.addEventListener("click",u),i.addEventListener("click",u),l.addEventListener("click",u),d.forEach(h=>{h.addEventListener("change",()=>{const R=h.value==="true";a.style.display=R?"none":"block",c.style.display=R?"block":"none"})}),r.addEventListener("click",h=>{h.preventDefault(),h.stopPropagation();const R=this.inputModal;if(!R)return;const T=R.querySelector('input[name="mh-edit-isMenopause"]:checked')?.value==="true";let g;T?g={isMenopause:!0,periodMin:R.querySelector("#mh-edit-periodMin2")?.value||"_",periodMax:R.querySelector("#mh-edit-periodMax2")?.value||"_",menarcheAge:R.querySelector("#mh-edit-menarcheAge2")?.value||"_",menopauseAge:R.querySelector("#mh-edit-menopauseAge")?.value||"_",cycleMin:R.querySelector("#mh-edit-cycleMin2")?.value||"_",cycleMax:R.querySelector("#mh-edit-cycleMax2")?.value||"_"}:g={isMenopause:!1,periodMin:R.querySelector("#mh-edit-periodMin")?.value||"_",periodMax:R.querySelector("#mh-edit-periodMax")?.value||"_",menarcheAge:R.querySelector("#mh-edit-menarcheAge1")?.value||"_",lastPeriod:R.querySelector("#mh-edit-lastPeriod")?.value||"____-__-__",cycleMin:R.querySelector("#mh-edit-cycleMin")?.value||"_",cycleMax:R.querySelector("#mh-edit-cycleMax")?.value||"_"};const f=this.control.getElementList(),C=this.element.controlId;for(let L=0;L<f.length;L++){const O=f[L];O.controlId===C&&O.control&&(O.control.menstrualData=g)}const p=this.generateDisplayText(g),I=this.textToElements(p);this.closeModal();const m=this.setValue(I);m!==-1&&(this.control.repaintControl({curIndex:m}),this.control.emitControlContentChange({}))})}closeModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}destroy(){this.closeModal()}}class aT{controlBorder;textFieldUnderline;draw;range;listener;eventBus;controlSearch;controlQuality;options;controlOptions;activeControl;activeControlValue;preElement;isPopupAwakeDisabled;constructor(t){this.controlBorder=new nu(t),this.textFieldUnderline=new cT(t),this.draw=t,this.range=t.getRange(),this.listener=t.getListener(),this.eventBus=t.getEventBus(),this.controlSearch=new jd(this),this.controlQuality=new eu(t),this.options=t.getOptions(),this.controlOptions=this.options.control,this.activeControl=null,this.activeControlValue=[],this.preElement=null,this.isPopupAwakeDisabled=!1}setPopupAwakeDisabled(t){this.isPopupAwakeDisabled=t}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)}setQualityMarks(t){this.controlQuality.setMarks(t)}getQualityMarks(){return this.controlQuality.getMarks()}renderQualityMarks(t,e,n,i,l,r,a){this.controlQuality.render(t,e,n,i,l,r,a)}getDraw(){return this.draw}filterAssistElement(t){const e=this.options.mode===s.EditorMode.PRINT||this.options.mode===s.EditorMode.COMPARE;return t.filter((n,i)=>{if(n.type===s.ElementType.TABLE){const l=n.trList;for(let r=0;r<l.length;r++){const a=l[r];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c];d.value=this.filterAssistElement(d.value)}}}if(!n.controlId)return!0;if(n.control?.type===s.ControlType.MENSTRUAL_HISTORY&&e&&(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.POSTFIX)||n.control?.type===s.ControlType.SELECT&&e&&(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.POSTFIX)||n.control?.type===s.ControlType.NUMBER&&e&&(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.POSTFIX)||n.control?.type===s.ControlType.TEXT&&e&&n.strikeout&&n.deletePerson)return!1;if(n.control?.minWidth){if(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.POSTFIX)return n.value="",!0}else{const l=this.options.mode===s.EditorMode.FORM;if(n.control?.preText&&n.controlComponent===s.ControlComponent.PRE_TEXT){if(l)return!0;let r=!1,a=i+1;for(;a<t.length;){const c=t[a];if(n.controlId!==c.controlId)break;if(c.controlComponent===s.ControlComponent.VALUE){r=!0;break}a++}return r}if(n.control?.postText&&n.controlComponent===s.ControlComponent.POST_TEXT){if(l)return!0;let r=!1,a=i-1;for(;a<t.length;){const c=t[a];if(n.controlId!==c.controlId)break;if(c.controlComponent===s.ControlComponent.VALUE){r=!0;break}a--}return r}}if(n.control?.preTextFix&&n.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){let l=!1,r=i+1;for(;r<t.length;){const a=t[r];if(n.controlId!==a.controlId)break;if(a.controlComponent===s.ControlComponent.VALUE){l=!0;break}r++}return l}if(n.control?.postTextFix&&n.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){let l=!1,r=i-1;for(;r<t.length;){const a=t[r];if(n.controlId!==a.controlId)break;if(a.controlComponent===s.ControlComponent.VALUE){l=!0;break}r--}return l}return n.controlComponent!==s.ControlComponent.PREFIX&&n.controlComponent!==s.ControlComponent.POSTFIX&&n.controlComponent!==s.ControlComponent.PLACEHOLDER&&n.controlComponent!==s.ControlComponent.PRETEXTFIX&&n.controlComponent!==s.ControlComponent.POSTTEXTFIX&&n.controlComponent!==s.ControlComponent.TEXTFIXLABEL})}getIsRangeCanCaptureEvent(){if(!this.activeControl)return!1;const{startIndex:t,endIndex:e}=this.getRange();if(!~t&&!~e)return!1;const n=this.getElementList(),i=n[t];if(i.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;if(t===e&&t>0){const r=n[t-1],a=r?.controlComponent===s.ControlComponent.POSTFIX||r?.controlComponent===s.ControlComponent.POSTTEXTFIX,c=r?.controlComponent===s.ControlComponent.PLACEHOLDER,d=!!r?.controlId,u=!!r?.originControlId;let h=!1;if(u){const p=r.originControlId;for(let I=t;I<n.length;I++){const m=n[I];if(m.controlId===p&&!m.originControlId){h=!0;break}if(m.controlId&&m.controlId!==p&&m.originControlId!==p)break}}const T=this.draw.getPosition().getPositionList(),g=T[t],f=T[t-1],C=g&&f&&g.rowIndex===f.rowIndex;if((a||c)&&d&&C&&!h)return!1}if(t===e&&(i.controlComponent===s.ControlComponent.POSTFIX||i.controlComponent===s.ControlComponent.POSTTEXTFIX))return!0;const l=n[e];return!!(i.controlId&&i.controlId===l.controlId&&l.controlComponent!==s.ControlComponent.POSTFIX&&l.controlComponent!==s.ControlComponent.POSTTEXTFIX)}getIsRangeInPostfix(){if(!this.activeControl)return!1;const{startIndex:t,endIndex:e}=this.getRange();if(t!==e)return!1;const i=this.getElementList()[t];return i.controlComponent===s.ControlComponent.POSTFIX||i.controlComponent===s.ControlComponent.POSTTEXTFIX}getIsRangeWithinControl(){const{range:{startIndex:t,endIndex:e},elementList:n}=this.range.getRangeElement();if(!~t&&!~e)return!1;const i=n[t],l=n[e];if(i?.controlId&&i.controlId===l.controlId&&l.controlComponent!==s.ControlComponent.POSTFIX&&l.controlComponent!==s.ControlComponent.POSTTEXTFIX&&l.controlComponent!==s.ControlComponent.POSTTEXTFIX_TEXT&&l.controlComponent!==s.ControlComponent.POST_TEXT||(l?.control?.type===s.ControlType.TEXT||this.draw.getMode()===s.EditorMode.EDIT&&l?.control?.type===s.ControlType.TEXTFIELD)&&l.controlId&&!l.originControlId&&(l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||l.controlComponent===s.ControlComponent.POST_TEXT)&&n[e-1]?.originControlId===l.controlId)return!0;if(l?.originControlId&&(l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX)){const r=l.originControlId;for(let a=e+1;a<n.length;a++){const c=n[a];if(c.controlId===r)return!0;if(c.controlId&&c.controlId!==r&&c.originControlId!==r)break}}if(!l?.originControlId&&l?.controlId&&(l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX)){const r=n[e+1];if(r?.controlId&&r.controlId!==l.controlId&&(r.controlComponent===s.ControlComponent.PREFIX||r.controlComponent===s.ControlComponent.PRETEXTFIX)&&r.originControlId||r?.controlId&&r.controlId!==l.controlId&&(r.controlComponent===s.ControlComponent.POSTFIX||r.controlComponent===s.ControlComponent.POSTTEXTFIX)&&r.originControlId)return!0;for(let a=e;a>=0;a--){const c=n[a];if(c.controlId===l.controlId&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX)){for(let d=a-1;d>=0;d--){const u=n[d];if(u.controlId&&u.controlId!==l.controlId&&(u.controlComponent===s.ControlComponent.PRETEXTFIX||u.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT))return!0;if(u.controlId&&u.controlId!==l.controlId&&(u.controlComponent===s.ControlComponent.POSTFIX||u.controlComponent===s.ControlComponent.POSTTEXTFIX))break}break}}}if(l?.originControlId){const r=l.originControlId;for(let a=e+1;a<n.length;a++){const c=n[a];if(c.controlId===r)return!0;if(c.controlId&&c.controlId!==r&&c.originControlId!==r)break}}if(!i?.controlId&&this.activeControl){const a=this.activeControl.getElement()?.controlId;if(a)for(let c=t;c>=0;c--){const d=n[c];if(d.controlId===a&&!d.originControlId){if(d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT)for(let u=e;u<n.length;u++){const h=n[u];if(h.controlId===a&&!h.originControlId){if(h.controlComponent===s.ControlComponent.POSTTEXTFIX||h.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||h.controlComponent===s.ControlComponent.POSTFIX||h.controlComponent===s.ControlComponent.POST_TEXT)return!0;break}}break}}}return!1}getIsElementListContainFullControl(t){if(!t.some(i=>i.controlId))return!1;let e=0,n=0;for(let i=0;i<t.length;i++){const l=t[i];l.controlComponent===s.ControlComponent.PREFIX||l.controlComponent===s.ControlComponent.PRETEXTFIX?e++:(l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX)&&n++}return!e||!n?!1:e===n}getIsDisabledControl(t={}){if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:e,endIndex:n}=t.range||this.range.getRange();if(e===n&&~e&&~n){const l=(t.elementList||this.getElementList())[e];if(l.controlComponent===s.ControlComponent.POSTFIX||l.controlComponent===s.ControlComponent.POSTTEXTFIX)return!1}return!!this.activeControl.getElement()?.control?.disabled}getIsDisabledPasteControl(t={}){if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:e,endIndex:n}=t.range||this.range.getRange();return e===n&&~e&&~n&&(t.elementList||this.getElementList())[e].controlComponent===s.ControlComponent.POSTFIX?!1:!!this.activeControl.getElement()?.control?.pasteDisabled}getIsExistValueByElementListIndex(t,e){const n=t[e];if(!n.controlId)return!1;if(n.control?.type===s.ControlType.CHECKBOX||n.control?.type===s.ControlType.RADIO)return!!n.control?.code;if(n.controlComponent===s.ControlComponent.VALUE)return!0;if(n.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;if(n.controlComponent===s.ControlComponent.PREFIX||n.controlComponent===s.ControlComponent.PRE_TEXT){let i=e+1;for(;i<t.length;){const l=t[i];if(l.controlId!==n.controlId)return!1;if(l.controlComponent===s.ControlComponent.VALUE)return!0;if(l.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;i++}}if(n.controlComponent===s.ControlComponent.PRETEXTFIX||n.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){let i=e+1;for(;i<t.length;){const l=t[i];if(l.controlId!==n.controlId)return!1;if(l.controlComponent===s.ControlComponent.VALUE)return!0;if(l.controlComponent===s.ControlComponent.PLACEHOLDER||l.controlComponent===s.ControlComponent.TEXTFIXLABEL)return!1;i++}}if(n.controlComponent===s.ControlComponent.POSTFIX||n.controlComponent===s.ControlComponent.POSTTEXTFIX){let i=e-1;for(;i>=0;){const l=t[i];if(l.controlId!==n.controlId)return!1;if(l.controlComponent===s.ControlComponent.VALUE)return!0;if(l.controlComponent===s.ControlComponent.PLACEHOLDER)return!1;i--}}return!1}getControlHighlight(t,e){return this.controlSearch.getControlHighlight(t,e)}getIsInlineControlBackground(t,e){return this.controlSearch.getIsInlineControlBackground(t,e)}getContainer(){return this.draw.getContainer()}getElementList(){return this.draw.getElementList()}getPosition(){const t=this.draw.getPosition().getPositionList(),{endIndex:e}=this.range.getRange();return t[e]||null}getPreY(){const t=this.draw.getHeight(),e=this.draw.getPageGap();return(this.getPosition()?.pageNo??this.draw.getPageNo())*(t+e)}getRange(){return this.range.getRange()}getValueRange(t={}){const e=t.elementList||this.getElementList(),{startIndex:n}=t.range||this.getRange(),i=e[n];if(!lo(i))return null;let l=n;for(;l>0;){const a=e[l];if(!kt(a,i)||a.controlComponent===s.ControlComponent.PREFIX||a.controlComponent===s.ControlComponent.PRE_TEXT||a.controlComponent===s.ControlComponent.PRETEXTFIX||a.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)break;l--}let r=n+1;for(;r<e.length;){const a=e[r];if(!kt(a,i)||a.controlComponent===s.ControlComponent.POSTFIX||a.controlComponent===s.ControlComponent.POST_TEXT||a.controlComponent===s.ControlComponent.POSTTEXTFIX||a.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)break;r++}return l===r?null:{startIndex:l,endIndex:r-1}}shrinkBoundary(t={}){this.range.shrinkBoundary(t)}getActiveControl(){return this.activeControl}getActiveTextControlLimit(){if(!this.activeControl)return null;const t=this.activeControl.getElement(),e=t?.controlId,n=t?.originControlId||null,i=t?.subTemplateInstanceId||t?.subTemplateParentId||null;if(!e||t.control?.type!==s.ControlType.TEXT&&t.control?.type!==s.ControlType.NUMBER)return null;const l=this.getElementList(),r=n||null;let a=-1,c=-1,d=-1,u=-1;for(let T=0;T<l.length;T++){const g=l[T];g.controlId!==e||(g.subTemplateInstanceId||g.subTemplateParentId||null)!==i||(n?g.originControlId!==n:g.originControlId)||(a===-1&&(a=T),c=T,(g.controlComponent===s.ControlComponent.PREFIX||g.controlComponent===s.ControlComponent.PRE_TEXT||g.controlComponent===s.ControlComponent.PRETEXTFIX||g.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&(d=T),u===-1&&(g.controlComponent===s.ControlComponent.POSTFIX||g.controlComponent===s.ControlComponent.POST_TEXT||g.controlComponent===s.ControlComponent.POSTTEXTFIX||g.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&(u=T))}if(a===-1)return null;const h=d!==-1?d:a,R=u!==-1?u-1:c;return e?{controlId:e,originControlId:n,subTemplateInstanceId:i,parentControlId:r,startIndex:h,endIndex:R<h?h:R}:null}getActiveNestedTextLimit(){const t=this.getActiveTextControlLimit();return!t?.parentControlId||!this.getElementList().some(n=>n.controlId===t.parentControlId&&!n.originControlId&&n.control?.type===s.ControlType.TEXTFIELD)?null:{controlId:t.controlId,parentControlId:t.parentControlId,startIndex:t.startIndex,endIndex:t.endIndex}}getControlElementList(t={}){const e=t.elementList||this.getElementList(),{startIndex:n}=t.range||this.getRange(),i=e[n];if(!lo(i))return[];const l=[];let r=n;for(;r>0;){const c=e[r];if(!kt(c,i))break;l.unshift(c),r--}let a=n+1;for(;a<e.length;){const c=e[a];if(!kt(c,i))break;l.push(c),a++}return l}updateActiveControlValue(){this.activeControl&&(this.activeControlValue=this.getControlElementList())}emitControlChange(t){if(!this.activeControl)return;const e=this.eventBus.isSubscribe("controlChange");if(!this.listener.controlChange&&!e)return;let n;const i=this.activeControlValue,l=this.activeControl.getElement();i?.length?n=i[0].control:(n=hn(rt(l)).control,n.value=[]);const r={state:t,control:n,controlId:l.controlId};this.listener.controlChange?.(r),e&&this.eventBus.emit("controlChange",r)}initControl(){if(this.draw.isContentReadonly())return;const t=this.getElementList(),e=this.getRange(),n=t[e.startIndex],i=t[e.startIndex+1],l=this.draw.getMode()===s.EditorMode.FORM&&(n.controlComponent===s.ControlComponent.POSTFIX||n.controlComponent===s.ControlComponent.POST_TEXT||n.controlComponent===s.ControlComponent.POSTTEXTFIX||n.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT);let r=null;if(l&&n.originControlId&&i?.controlId===n.originControlId&&!kt(n,i))r=i;else if(l&&n.subTemplateParentId&&i&&i.subTemplateParentId!==n.subTemplateParentId)for(let g=e.startIndex-1;g>=0;g--){const f=t[g];if(f.type===s.ElementType.SUB_TEMPLATE&&f.id===n.subTemplateParentId){f.controlId===i.controlId&&(f.originControlId||null)===(i.originControlId||null)&&(r=i);break}}let a=null;if(r)for(let g=e.startIndex+1;g>=0;g--){const f=t[g];if(kt(r,f)&&f.control?.type===s.ControlType.TEXT){a=f;break}}if(this.activeControl&&a&&this.destroyControl(),this.activeControl){if(this.activeControl instanceof co||this.activeControl instanceof Lo||this.activeControl instanceof Nn){const g=this.activeControl.getElement();kt(n,g)?n.controlComponent===s.ControlComponent.POSTFIX?this.activeControl.destroy():this.isPopupAwakeDisabled||this.activeControl.awake():this.destroyControl()}if(this.activeControl){const g=this.activeControl.getElement(),f=n.controlId,C=n.originControlId||null,p=g.controlId,I=g.originControlId||null;if(f&&kt(n,g)){this.updateActiveControlValue(),this.preElement=n;return}if(n.originControlId&&n.originControlId===p&&C===I){const m=this.activeControl.getElement();if(!((m?.control?.type===s.ControlType.TEXTFIELD||m?.control?.type===s.ControlType.TEXT)&&n.controlId!==p)){this.updateActiveControlValue(),this.preElement=n;return}}if(n.originControlId&&n.controlId&&n.controlId,!n.originControlId&&n.controlId&&n.controlId!==p&&(this.activeControl.getElement()?.originControlId,n.controlId),n.controlId&&n.originControlId&&kt(n,g)){this.updateActiveControlValue(),this.preElement=n;return}if(!f){const m=this.getElementList(),L=this.getRange(),{startIndex:O}=L;let P=null;for(let S=O;S>=0;S--){const y=m[S];if(y.controlComponent===s.ControlComponent.PRETEXTFIX||y.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||y.controlComponent===s.ControlComponent.PREFIX||y.controlComponent===s.ControlComponent.PRE_TEXT){P=y.controlId||null;break}if(y.controlId&&y.controlId!==p||y.controlComponent===s.ControlComponent.POSTTEXTFIX||y.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||y.controlComponent===s.ControlComponent.POSTFIX||y.controlComponent===s.ControlComponent.POST_TEXT)break}if(P===p){this.updateActiveControlValue(),this.preElement=n;return}}}}if(this.destroyControl(),this.draw.isReadonly())return;let d=a?.control||n.control,u=a||n;if(!a&&n.originControlId&&!d){let g;for(let I=this.range.getRange().startIndex;I>=0;I--){const m=t[I];if(kt(m,n)&&m.control&&(g=m.control,u=m,m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX||m.controlComponent===s.ControlComponent.PRE_TEXT||m.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)||m.controlId&&!kt(m,n)&&m.controlId!==n.originControlId&&m.originControlId!==n.originControlId)break}const f=n.originControlId;let C,p;for(let I=this.range.getRange().startIndex;I>=0;I--){const m=t[I];if(m.controlId===f&&m.control){C=m.control,p=m;break}if(m.controlId===f&&(m.controlComponent===s.ControlComponent.PRETEXTFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRE_TEXT)){m.control&&(C=m.control,p=m);break}}this.draw.getMode()===s.EditorMode.FORM&&C?.type===s.ControlType.TEXTFIELD&&g&&g.type!==s.ControlType.TEXTFIELD||this.draw.getMode()===s.EditorMode.FORM&&C?.type===s.ControlType.TEXT&&g?d=g:C?(d=C,p&&(u=p)):g&&(d=g)}else if(!d&&n.controlId){const g=this.getElementList();for(let f=this.range.getRange().startIndex;f>=0;f--){const C=g[f];if(!kt(C,n))break;if(C.control){d=C.control,u=C;break}if(C.controlComponent===s.ControlComponent.PRETEXTFIX||C.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||C.controlComponent===s.ControlComponent.PREFIX||C.controlComponent===s.ControlComponent.PRE_TEXT)break}}if(!d)return;if(d?.type===s.ControlType.TEXTFIELD&&this.draw.getMode()!==s.EditorMode.EDIT)if(n.originControlId){const g=n.controlId;for(let f=this.range.getRange().startIndex;f>=0;f--){const C=t[f];if(C.controlId===g&&kt(C,n)&&C.control&&C.control.type!==s.ControlType.TEXTFIELD){d=C.control,u=C;break}if(C.controlComponent===s.ControlComponent.PREFIX||C.controlComponent===s.ControlComponent.PRETEXTFIX)break}if(d?.type===s.ControlType.TEXTFIELD)return}else return;const h=this.draw.getPosition().getPositionContext(),R=this.range.getRange().startIndex,T=!!(h.isDirectHit&&h.index===R&&t[h.index]?.controlId===u.controlId);if(d?.type===s.ControlType.TEXTFIELD)this.activeControl=new bl(u,this);else if(d.type===s.ControlType.TEXT)this.activeControl=new Vs(u,this);else if(d.type===s.ControlType.SELECT){const g=new co(u,this);this.activeControl=g,!this.isPopupAwakeDisabled&&(T||this.draw.getMode()===s.EditorMode.FORM)&&g.awake()}else if(d.type===s.ControlType.CHECKBOX)this.activeControl=new wo(u,this);else if(d.type===s.ControlType.RADIO)this.activeControl=new Ai(u,this);else if(d.type===s.ControlType.DATE){const g=new Lo(u,this);this.activeControl=g,!this.isPopupAwakeDisabled&&(T||this.draw.getMode()===s.EditorMode.FORM)&&g.awake()}else if(d.type===s.ControlType.NUMBER)this.activeControl=new di(u,this);else if(d.type===s.ControlType.BUTTON){const g=new Nn(u,this);if(this.activeControl=g,!this.isPopupAwakeDisabled&&T&&(g.awake(),this.draw.getMode()!==s.EditorMode.FORM||u.control?.editable===!1))return}else if(d.type===s.ControlType.MENSTRUAL_HISTORY){const g=new Vl(u,this);this.activeControl=g,this.isPopupAwakeDisabled||g.awake()}this.updateActiveControlValue(),this.preElement=u,u.controlComponent!==s.ControlComponent.POSTFIX&&u.controlComponent!==s.ControlComponent.POSTTEXTFIX&&this.emitControlChange(s.ControlState.ACTIVE)}destroyControl(t={}){if(!this.activeControl)return;const{isEmitEvent:e=!0}=t;(this.activeControl instanceof co||this.activeControl instanceof Lo||this.activeControl instanceof di||this.activeControl instanceof Vl)&&this.activeControl.destroy(),e&&this.preElement?.controlComponent!==s.ControlComponent.POSTFIX&&this.preElement?.controlComponent!==s.ControlComponent.POSTTEXTFIX&&this.emitControlChange(s.ControlState.INACTIVE),this.preElement=null,this.activeControl=null,this.activeControlValue=[]}repaintControl(t={}){const{curIndex:e,isCompute:n=!0,isSubmitHistory:i=!0,isSetCursor:l=!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:l,isSubmitHistory:i}))}emitControlContentChange(t){const e=this.eventBus.isSubscribe("controlContentChange");if(!e&&!this.listener.controlContentChange)return;const n=t?.controlElement||this.activeControl?.getElement();if(!n)return;const i=t?.context?.elementList||this.getElementList(),{startIndex:l}=t?.context?.range||this.getRange();if(!i[l]?.controlId)return;const r=t?.controlValue||this.getControlElementList(t?.context);let a;if(r?.length?a=Ut(r)[0].control:(a=n.control,a.value=[]),!a)return;const c={control:a,controlId:n.controlId};this.listener.controlContentChange?.(c),e&&this.eventBus.emit("controlContentChange",c)}reAwakeControl(){if(!this.activeControl)return;const t=this.getElementList(),e=this.getRange(),n=t[e.startIndex];this.activeControl.setElement(n),(this.activeControl instanceof Lo||this.activeControl instanceof co)&&this.activeControl.getIsPopup()&&(this.activeControl.destroy(),this.activeControl.awake())}selectValue(){const t=this.getElementList(),{startIndex:e}=this.getRange(),n=t[e];if(!n?.controlId||n.controlComponent!==s.ControlComponent.VALUE&&t[e+1]?.controlComponent===s.ControlComponent.VALUE)return!1;let i=e;for(;i>0&&t[i].controlComponent===s.ControlComponent.VALUE;)i--;let l=e+1;for(;l<t.length;){if(t[l].controlComponent!==s.ControlComponent.VALUE){l--;break}l++}if(i!==l){const r=this.range.getRange();return this.range.replaceRange({...r,startIndex:i,endIndex:l}),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),!0}return!1}moveCursor(t){const{index:e,trIndex:n,tdIndex:i,tdValueIndex:l}=t;let r=this.draw.getOriginalElementList(),a;const c=t.isTable?l:e;if(t.isTable?(r=r[e].trList[n].tdList[i].value,a=r[l]):a=r[e],a.control?.hide||a.area?.hide){const d=Bn(r,c);return{newIndex:d,newElement:r[d]}}if(a.controlComponent===s.ControlComponent.VALUE)return{newIndex:c,newElement:a};if(a.controlComponent===s.ControlComponent.POSTFIX){let d=c+1;for(;d<r.length;){const u=r[d];if(!kt(u,a))return{newIndex:d-1,newElement:r[d-1]};if(d===r.length-1)return{newIndex:d,newElement:r[d]};d++}}else if(a.controlComponent===s.ControlComponent.PREFIX||a.controlComponent===s.ControlComponent.PRE_TEXT){let d=c+1;for(;d<r.length;){const u=r[d];if(!kt(u,a)||u.controlComponent!==s.ControlComponent.PREFIX&&u.controlComponent!==s.ControlComponent.PRE_TEXT)return{newIndex:d-1,newElement:r[d-1]};d++}}else if(a.controlComponent===s.ControlComponent.PLACEHOLDER){let d=c-1;for(;d>0;){const u=r[d];if(!kt(u,a)||u.controlComponent===s.ControlComponent.VALUE||u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT||u.controlComponent===s.ControlComponent.PRETEXTFIX||u.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d,newElement:r[d]};d--}}else if(a.controlComponent===s.ControlComponent.POST_TEXT||a.controlComponent===s.ControlComponent.TEXTFIXLABEL||a.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){let d=c-1;for(;d>0;){const u=r[d];if(!kt(u,a)||u.controlComponent===s.ControlComponent.VALUE||u.controlComponent===s.ControlComponent.PREFIX||u.controlComponent===s.ControlComponent.PRE_TEXT||u.controlComponent===s.ControlComponent.PRETEXTFIX||u.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d,newElement:r[d]};d--}}else if(a.controlComponent===s.ControlComponent.POSTTEXTFIX){let d=c+1;for(;d<r.length;){const u=r[d];if(!kt(u,a))return{newIndex:d-1,newElement:r[d-1]};if(d===r.length-1)return{newIndex:d,newElement:r[d]};d++}}else if(a.controlComponent===s.ControlComponent.PRETEXTFIX||a.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){let d=c+1;for(;d<r.length;){const u=r[d];if(!kt(u,a)||u.controlComponent!==s.ControlComponent.PRETEXTFIX&&u.controlComponent!==s.ControlComponent.PRETEXTFIX_TEXT)return{newIndex:d-1,newElement:r[d-1]};d++}}return{newIndex:c,newElement:a}}removeControl(t,e={}){const n=e.elementList||this.getElementList(),i=n[t];if(!this.draw.isDesignMode()&&!i?.control?.hide&&!i?.area?.hide){const{deletable:m=!0}=i.control;if(!m)return null;const L=this.draw.getMode();if(L===s.EditorMode.FORM&&this.options.modeRule[L].controlDeletableDisabled)return null}let l=-1,r=-1;const a=!!i.originControlId,c=i.controlId,d=i.originControlId,u=i.control?.type===s.ControlType.BUTTON&&!i.control?.buttonText?`${c}_text`:"";let h=t;for(;h>=0;){const m=n[h];let L=!1;if(a?L=m.controlId===c&&m.originControlId===d:L=m.controlId===c&&!m.originControlId,!L){l=h;break}h--}let R=t;for(;R<n.length;){const m=n[R];let L=!1;if(a?L=m.controlId===c&&m.originControlId===d:L=m.controlId===c&&!m.originControlId,!L){r=R-1;break}R++}if(R===n.length&&(r=R-1),!~l&&!~r)return t;l=~l?l:0;const T=n[l+1],g=T.control,f=g?.type&&[s.ControlType.TEXT,s.ControlType.TEXTFIELD,s.ControlType.DATE,s.ControlType.NUMBER,s.ControlType.SELECT,s.ControlType.BUTTON].includes(g.type);let C=n[0]?.type===s.ElementType.SPLIT_TAG;if(!e.removeNext&&f&&!a&&T.controlComponent!==s.ControlComponent.PREFIX&&T.type!==s.ElementType.SPLIT_TAG)if(e.removePrev)e.removePrev();else{const m=this.draw.getTd();m&&this.createRemoveControlHandler(m,i.controlId,!0)}if(!e.removeNext&&f&&!a&&T.controlComponent!==s.ControlComponent.PRETEXTFIX&&T.type!==s.ElementType.SPLIT_TAG)if(e.removePrev)e.removePrev();else{const m=this.draw.getTd();m&&this.createRemoveControlHandler(m,i.controlId,!0)}if(!e.removePrev&&f&&!a&&n[r].controlComponent!==s.ControlComponent.POSTFIX)if(e.removeNext)e.removeNext();else{const m=this.draw.getTd();C=!!m?.linkTdNextId,m&&this.createRemoveControlHandler(m,i.controlId,!1)}if(!e.removePrev&&f&&!a&&n[r].controlComponent!==s.ControlComponent.POSTTEXTFIX)if(e.removeNext)e.removeNext();else{const m=this.draw.getTd();C=!!m?.linkTdNextId,m&&this.createRemoveControlHandler(m,i.controlId,!1)}this.draw.spliceElementList(n,l+1,r-l);let p=0;if(u)for(let m=n.length-1;m>=0;m--)n[m].controlId===u&&(m<=l&&p++,n.splice(m,1));const I=l-p;return!e.elementList&&C&&l===0?this.draw.fixPosition(!0)??I:I}createRemoveControlHandler(t,e,n){if(n){const i=this.draw.getTdById(t.linkTdPrevId);i&&i.value.splice(-1)[0]?.controlId===e&&this.removeControl(i.value.length-1,{elementList:i.value,removePrev:()=>{this.createRemoveControlHandler(i,e,n)}})}else{const i=this.draw.getTdById(t.linkTdNextId);i&&i.value[1]?.controlId===e&&this.removeControl(1,{elementList:i.value,removeNext:()=>{this.createRemoveControlHandler(i,e,n)}})}}removePlaceholder(t,e={}){const n=e.elementList||this.getElementList(),i=n[t],l=n[t+1];if(i.controlComponent===s.ControlComponent.PLACEHOLDER||i.controlComponent===s.ControlComponent.TEXTFIXLABEL||l?.controlComponent===s.ControlComponent.PLACEHOLDER||l?.controlComponent===s.ControlComponent.TEXTFIXLABEL){let r=!1,a=t;for(;a<n.length;){const c=n[a];if(c.controlId!==i.controlId)break;c.controlComponent===s.ControlComponent.PLACEHOLDER||c.controlComponent===s.ControlComponent.TEXTFIXLABEL?(r||(r=!0,this.draw.getHistoryManager().popUndo(),this.draw.submitHistory(t)),n.splice(a,1)):a++}}}addPlaceholder(t,e={}){const n=e.elementList||this.getElementList(),i=n[t],l=i.control,r=l.placeholder;if(!r)return;l.placeholder=r;let a=t;for(;a>=0;){const f=n[a];if(f.controlId!==i.controlId){a++;break}if(f.controlComponent===s.ControlComponent.PREFIX||f.controlComponent===s.ControlComponent.PRE_TEXT||f.controlComponent===s.ControlComponent.PRETEXTFIX||f.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)break;a--}a<0&&(a=0);const c=a+1;if(c<n.length){const f=n[c];if(f.controlId===i.controlId&&(f.controlComponent===s.ControlComponent.PLACEHOLDER||f.controlComponent===s.ControlComponent.VALUE&&!fe(f)))return}let d=!1,u=a+1;for(;u<n.length;){const f=n[u];if(f.controlId===i.controlId){if(f.controlComponent===s.ControlComponent.POSTFIX||f.controlComponent===s.ControlComponent.POST_TEXT||f.controlComponent===s.ControlComponent.POSTTEXTFIX||f.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)break}else if(f.controlId!==i.controlId&&(f.controlComponent===s.ControlComponent.VALUE||f.controlComponent===s.ControlComponent.PREFIX||f.controlComponent===s.ControlComponent.PRE_TEXT)){d=!0;break}u++}if(d)return;const h=Nt(r),R=xt(i,ue),T=xt(i,["originControlId","subTemplateParentId","subTemplateInstanceId"]),g=a+1;for(let f=0;f<h.length;f++){const C=h[f],p={...R,...T,value:C===`
213
+ `?_:C,controlId:i.controlId,type:s.ElementType.CONTROL,control:i.control,controlComponent:s.ControlComponent.PLACEHOLDER,color:this.controlOptions.placeholderColor};le(n,[p],a,{editorOptions:this.options}),this.draw.spliceElementList(n,g+f,0,[p])}}setValue(t){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.setValue(t)}setControlProperties(t,e={}){const n=e.elementList||this.getElementList(),{startIndex:i}=e.range||this.getRange(),l=n[i];let r=i;for(;r>0;){const c=n[r];if(c.controlId!==l.controlId)break;c.control={...c.control,...t},r--}let a=i+1;for(;a<n.length;){const c=n[a];if(c.controlId!==l.controlId)break;c.control={...c.control,...t},a++}}keydown(t){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.keydown(t)}cut(){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.cut()}getValueById(t){const{id:e,groupId:n,conceptId:i,areaId:l}=t,r=[];if(!e&&!i&&!n)return r;const a=new Set,c=(u,h)=>{let R=0;for(;R<u.length;){const T=u[R];if(R++,T.type===s.ElementType.TABLE){const L=T.trList;for(let O=0;O<L.length;O++){const P=L[O];for(let S=0;S<P.tdList.length;S++){const y=P.tdList[S],Y=y.originalId??y.id;a.has(Y)||(a.add(Y),y.linkTdNextId?c(this.draw.getSplitTdValues(Y),h):c(y.value,h))}}}if(!T.control||n&&T.control.groupId!==n||e&&T.controlId!==e||i&&T.control.conceptId!==i||l&&T.areaId!==l)continue;const{type:g,code:f,valueSets:C}=T.control;let p=R,I="";const m=[];for(;p<u.length;){const L=u[p];if(L.controlId!==T.controlId)break;(g===s.ControlType.TEXT||g===s.ControlType.TEXTFIELD||g===s.ControlType.DATE||g===s.ControlType.NUMBER)&&L.controlComponent===s.ControlComponent.VALUE&&(I+=L.value,m.push(Ee(L,Di))),p++}if(g===s.ControlType.TEXT||g===s.ControlType.TEXTFIELD||g===s.ControlType.DATE||g===s.ControlType.NUMBER)r.push({...T.control,zone:h,value:I||null,innerText:I||null,elementList:Ut(m)});else if(g===s.ControlType.SELECT||g===s.ControlType.CHECKBOX||g===s.ControlType.RADIO){const L=f?.split(",").map(O=>C?.find(P=>P.code===O)?.value).filter(Boolean).join("");r.push({...T.control,zone:h,value:f||null,innerText:L||null})}R=p}},d=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:u,elementList:h}of d)c(h,u);return r}setValueListById(t){if(!t.length)return;let e=!1,n=!1;const i=(r,a)=>{let c=0;for(;c<r.length;){const d=r[c];if(c++,d.type===s.ElementType.TABLE){const m=d.trList;for(let L=0;L<m.length;L++){const O=m[L];for(let P=0;P<O.tdList.length;P++){const S=O.tdList[P];i(S.value,S.id)}}}if(!d.control||d.type===s.ElementType.SPLIT_TAG)continue;const u=t.find(m=>(!m.groupId||m.groupId===d.control?.groupId)&&(m.id&&d.controlId===m.id||m.conceptId&&d.control.conceptId===m.conceptId||m.areaId&&d.areaId===m.areaId));if(!u)continue;const{value:h,isSubmitHistory:R=!0}=u;e=!0,R&&(n=!0);const{type:T}=d.control,{range:g,fullRange:f}=this.mergeControl({elementList:r,range:{startIndex:c,endIndex:c},tdId:a}),C={range:f??g,elementList:r,tdId:a},p={isIgnoreDisabledRule:!0,isIgnoreDeletedRule:!0};if(T===s.ControlType.TEXTFIELD){const m=Array.isArray(h)?h:h?[{value:h}]:[];m.length&&ee(m,{isHandleFirstElement:!1,editorOptions:this.options});const L=new bl(d,this);this.activeControl=L,m.length?L.setValue(m,C,p):L.clearValue(C,p)}else if(T===s.ControlType.TEXT){const m=Array.isArray(h)?h:h?[{value:h}]:[];m.length&&ee(m,{isHandleFirstElement:!1,editorOptions:this.options});const L=new Vs(d,this);this.activeControl=L,m.length?L.setValue(m,C,p):L.clearValue(C,p)}else if(T===s.ControlType.SELECT){if(Array.isArray(h))continue;const m=new co(d,this);this.activeControl=m,h?m.setSelect(h,C,p):m.clearSelect(C,p)}else if(T===s.ControlType.CHECKBOX){if(Array.isArray(h))continue;const m=new wo(d,this);this.activeControl=m;const L=h?h.split(","):[];m.setSelect(L,C,p)}else if(T===s.ControlType.RADIO){if(Array.isArray(h))continue;const m=new Ai(d,this);this.activeControl=m;const L=h?[h]:[];m.setSelect(L,C,p)}else if(T===s.ControlType.DATE){const m=new Lo(d,this);this.activeControl=m,Ei(h)?(h.length&&ee(h,{isHandleFirstElement:!1,editorOptions:this.options}),m.setValue(h,C,p)):Ea(h)?m.setSelect(h,C,p):m.clearSelect(C,p)}else if(T===s.ControlType.NUMBER){const m=Array.isArray(h)?h:h?[{value:h}]:[];m.length&&ee(m,{isHandleFirstElement:!1,editorOptions:this.options});const L=new di(d,this);this.activeControl=L,m.length?L.setValue(m,C,p):L.clearValue(C,p)}else if(T===s.ControlType.BUTTON){const m=Array.isArray(h)?h:h?[{value:h}]:[];m.length&&ee(m,{isHandleFirstElement:!1,editorOptions:this.options});const L=new Nn(d,this);this.activeControl=L,m.length?L.setValue(m,C,p):L.clearSelect(C,p)}this.emitControlContentChange({context:C}),this.activeControl=null;let I=c;for(;I<r.length&&r[I].controlId===d.controlId;)I++;c=I}};this.destroyControl({isEmitEvent:!1});const l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const r of l)i(r);e&&(n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1}))}setExtensionListById(t){if(!t.length)return;const e=i=>{let l=0;for(;l<i.length;){const r=i[l];if(l++,r.type===s.ElementType.TABLE){const u=r.trList;for(let h=0;h<u.length;h++){const R=u[h];for(let T=0;T<R.tdList.length;T++){const g=R.tdList[T];e(g.value)}}}if(!r.control)continue;const a=t.find(u=>u.id&&r.controlId===u.id||u.conceptId&&r.control.conceptId===u.conceptId||u.areaId&&r.areaId===u.areaId);if(!a)continue;const{extension:c}=a;this.setControlProperties({extension:c},{elementList:i,range:{startIndex:l,endIndex:l}});let d=l;for(;d<i.length&&i[d].controlId===r.controlId;)d++;l=d}},n=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const i of n)e(i)}setPropertiesListById(t){if(!t.length)return;let e=!1,n=!1;const i=r=>{let a=0;for(;a<r.length;){const c=r[a];if(a++,c.type===s.ElementType.TABLE){const T=c.trList;for(let g=0;g<T.length;g++){const f=T[g];for(let C=0;C<f.tdList.length;C++){const p=f.tdList[C];i(p.value)}}}if(!c.control)continue;const d=t.find(T=>T.id&&c.controlId===T.id||T.conceptId&&c.control.conceptId===T.conceptId||T.areaId&&c.areaId===T.areaId);if(!d)continue;const{properties:u,isSubmitHistory:h=!0}=d;if(e=!0,h&&(n=!0),this.setControlProperties({...c.control,...u,value:c.control.value},{elementList:r,range:{startIndex:a-1,endIndex:a-1}}),ue.forEach(T=>{const g=u[T];g&&Reflect.set(c,T,g)}),c.control?.type===s.ControlType.NUMBER&&u.numberExclusiveOptions){const T={...c.control.numberExclusiveOptions,...u.numberExclusiveOptions},g=T?.minValue,f=T?.maxValue,C=new di(c,this),p=C.getValue({elementList:r,range:{startIndex:a-1,endIndex:a-1}});if(p.length>0){const I=p.map(L=>L.value).join(""),m=Number(I);!Number.isNaN(m)&&Number.isFinite(m)&&(g!=null&&m<g||f!=null&&m>f)&&C.clearValue({elementList:r,range:{startIndex:a-1,endIndex:a-1}},{isAddPlaceholder:!0})}}let R=a;for(;R<r.length&&r[R].controlId===c.controlId;)R++;a=R}},l={header:this.draw.getHeaderElementList(),main:this.draw.getOriginalMainElementList(),footer:this.draw.getFooterElementList()};for(const r in l){const a=l[r];i(a)}if(e){for(const r in l){const a=r,c=Ut(l[a],{isClassifyArea:!0,extraPickAttrs:["id","controlId"]});l[a]=c,ee(c,{editorOptions:this.options,isForceCompensation:!0})}this.draw.setEditorData(l),n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1})}}getList(){const t=[];function e(i){for(let l=0;l<i.length;l++){const r=i[l];if(r.type===s.ElementType.TABLE){const a=r.trList;for(let c=0;c<a.length;c++){const d=a[c];for(let u=0;u<d.tdList.length;u++){const R=d.tdList[u].value;e(R)}}}if(r.controlId){const a=Ee(r,[...Si,...Un]);t.push(a)}}}const n=[this.draw.getHeader().getElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooter().getElementList()];for(const i of n)e(i);return Ut(t,{extraPickAttrs:["controlId"]})}recordBorderInfo(t,e,n,i){this.controlBorder.recordBorderInfo(t,e,n,i)}drawBorder(t){this.controlBorder.render(t)}startTextFieldUnderline(t,e,n){this.textFieldUnderline.startTextFieldValue(t,e,n)}recordTextFieldUnderlineWidth(t){this.textFieldUnderline.recordValueWidth(t)}drawTextFieldUnderline(t){this.textFieldUnderline.endTextFieldValue(t)}_getControlIdentity(t){return lo(t)}_isSameControlIdentity(t,e){return!!(e&&t.controlId===e.controlId&&(t.originControlId||null)===e.originControlId&&(t.subTemplateInstanceId||t.subTemplateParentId||null)===e.subTemplateInstanceId)}_isNestedParentControlElement(t,e){return!!(e?.originControlId&&t.controlId===e.originControlId&&!t.originControlId)}_isNestedTextContainerElement(t,e){if(!e.controlId||e.originControlId)return!1;let n=!1,i=!1;for(let l=0;l<t.length;l++){const r=t[l];if(r.controlId===e.controlId&&!r.originControlId?(r.control?.type===s.ControlType.TEXT||r.control?.type===s.ControlType.TEXTFIELD)&&(n=!0):r.originControlId===e.controlId&&(i=!0),n&&i)return!0}return!1}_getCurrentControlIdentity(t){const e=this.getElementList()[t],n=this._getControlIdentity(this.activeControl?.getElement()),i=this._getControlIdentity(e);return i&&(!n||this._isSameControlIdentity(e,n)||i.originControlId===n.controlId)?i:n}_getControlNavigationIndex(t,e,n){const i=this._getControlIdentity(t[e]);if(!i)return e;let l=e;for(;l>0&&this._isSameControlIdentity(t[l-1],i);)l--;let r=e;for(;r+1<t.length&&this._isSameControlIdentity(t[r+1],i);)r++;if(n===zt.DOWN){let a=-1;for(let c=l;c<=r;c++){const d=t[c];if(d.controlComponent===s.ControlComponent.CHECKBOX||d.controlComponent===s.ControlComponent.RADIO||d.controlComponent===s.ControlComponent.VALUE)return c;a===-1&&(d.controlComponent===s.ControlComponent.PREFIX||d.controlComponent===s.ControlComponent.PRE_TEXT||d.controlComponent===s.ControlComponent.PRETEXTFIX||d.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&(a=c)}return~a?a:l}for(let a=r;a>=l;a--)if(t[a].controlComponent===s.ControlComponent.VALUE)return a;return l}_isTrailingNestedControlBoundary(t,e,n){const i=t[e];return!n||!i?.originControlId||i.originControlId!==n.controlId||i.controlComponent!==s.ControlComponent.POSTFIX&&i.controlComponent!==s.ControlComponent.POST_TEXT&&i.controlComponent!==s.ControlComponent.POSTTEXTFIX&&i.controlComponent!==s.ControlComponent.POSTTEXTFIX_TEXT?!1:this._isSameControlIdentity(t[e-1],this._getControlIdentity(i))||this._isSameControlIdentity(t[e-1],n)}getPreControlContext(){const e=this.draw.getPosition().getPositionContext();if(!e)return null;const{startIndex:n}=this.range.getRange(),i=this.getElementList(),l=this.activeControl?.getElement()||i[n],r=this._getCurrentControlIdentity(n),a=(d,u)=>{for(let h=u;h>0;h--){const R=d[h];if(R.type===s.ElementType.TABLE){const T=R.trList||[];for(let g=T.length-1;g>=0;g--){const f=T[g],C=f.tdList;for(let p=C.length-1;p>=0;p--){const I=C[p],m=a(I.value,I.value.length-1);if(m)return{positionContext:{isTable:!0,index:h,trIndex:g,tdIndex:p,tdId:I.id,trId:f.id,tableId:R.id},nextIndex:m.nextIndex}}}}if(!(!R.controlId||this._isSameControlIdentity(R,r)||this._isTrailingNestedControlBoundary(d,h,r)||this._isNestedParentControlElement(R,r)||this._isNestedTextContainerElement(d,R)))return{positionContext:{isTable:!1},nextIndex:this._getControlNavigationIndex(d,h,zt.UP)}}return null},c=a(i,n);if(c)return{positionContext:e.isTable?e:c.positionContext,nextIndex:c.nextIndex};if(l.tableId){const d=this.draw.getOriginalElementList(),{index:u,trIndex:h,tdIndex:R}=e,T=d[u].trList;for(let f=h;f>=0;f--){const C=T[f],p=C.tdList;for(let I=p.length-1;I>=0;I--){if(h===f&&I>=R)continue;const m=p[I],L=a(m.value,m.value.length-1);if(L)return{positionContext:{isTable:!0,index:e.index,trIndex:f,tdIndex:I,tdId:m.id,trId:C.id,tableId:l.tableId},nextIndex:L.nextIndex}}}const g=a(d,u-1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}getNextControlContext(){const e=this.draw.getPosition().getPositionContext();if(!e)return null;const{endIndex:n}=this.range.getRange(),i=this.getElementList(),l=this.activeControl?.getElement()||i[n],r=this._getCurrentControlIdentity(n),a=(d,u)=>{for(let h=u;h<d.length;h++){const R=d[h];if(R.type===s.ElementType.TABLE){const T=R.trList||[];for(let g=0;g<T.length;g++){const f=T[g],C=f.tdList;for(let p=0;p<C.length;p++){const I=C[p],m=a(I.value,0);if(m)return{positionContext:{isTable:!0,index:h,trIndex:g,tdIndex:p,tdId:I.id,trId:f.id,tableId:R.id},nextIndex:m.nextIndex}}}}if(!(!R.controlId||this._isSameControlIdentity(R,r)||this._isTrailingNestedControlBoundary(d,h,r)||this._isNestedParentControlElement(R,r)||this._isNestedTextContainerElement(d,R)))return{positionContext:{isTable:!1},nextIndex:this._getControlNavigationIndex(d,h,zt.DOWN)}}return null},c=a(i,n);if(c)return{positionContext:e.isTable?e:c.positionContext,nextIndex:c.nextIndex};if(l.tableId){const d=this.draw.getOriginalElementList(),{index:u,trIndex:h,tdIndex:R}=e,T=d[u].trList;for(let f=h;f<T.length;f++){const C=T[f],p=C.tdList;for(let I=0;I<p.length;I++){if(h===f&&I<=R)continue;const m=p[I],L=a(m.value,0);if(L)return{positionContext:{isTable:!0,index:e.index,trIndex:f,tdIndex:I,tdId:m.id,trId:C.id,tableId:l.tableId},nextIndex:L.nextIndex}}}const g=a(d,u+1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}initNextControl(t={}){const{direction:e=zt.DOWN}=t;let n=null;if(e===zt.UP?n=this.getPreControlContext():n=this.getNextControlContext(),!n)return;const{nextIndex:i,positionContext:l}=n,r=this.draw.getPosition();r.setPositionContext(l),this.draw.getRange().replaceRange({startIndex:i,endIndex:i}),this.draw.render({curIndex:i,isCompute:!1,isSetCursor:!0,isSubmitHistory:!1});const a=r.getPositionList();this.draw.getCursor().moveCursorToVisible({cursorPosition:a[i],direction:e})}setMinWidthControlInfo(t){const{row:e,rowElement:n,controlRealWidth:i,availableWidth:l}=t;if(!n.control?.minWidth)return;const{scale:r}=this.options,a=n.control.minWidth*r;let c=null;if(n.control?.minWidth&&(n.control?.rowFlex===s.RowFlex.CENTER||n.control?.rowFlex===s.RowFlex.RIGHT)){let u=n.metrics.width,h=e.elementList.length-1;for(;h>=0;){const R=e.elementList[h];if(u+=R.metrics.width,e.elementList[h-1]?.controlComponent===s.ControlComponent.PREFIX){c=R;break}h--}c&&u<a&&(n.control.rowFlex===s.RowFlex.CENTER?c.left=(a-u)/2:n.control.rowFlex===s.RowFlex.RIGHT&&(c.left=a-u-n.metrics.width))}const d=a-i;if(d>0){const u=c?.left||0,h=l-e.width-n.metrics.width,R=Math.min(h,d);n.left=R-u,e.width+=R-u}}mergeControl(t={}){const e=t.elementList||this.getElementList(),n=t.range||this.getRange(),{startIndex:i}=n,l=t.tdId??this.draw.getPosition().getPositionContext().tdId,r=l?this.draw.getTdById(l):void 0,a=e[i];if(!a?.controlId)return{range:n,elementList:[],tdId:l};const c={startIndex:i,endIndex:i},d=[];let u=!1,h=i,R=r,T=e;for(;h>=0;){const p=T[h];if(p.controlId!==a.controlId)break;if(p.type!==s.ElementType.SPLIT_TAG&&(d.unshift(p),u&&(T.splice(h,1),e[0].type===s.ElementType.SPLIT_TAG?e.splice(0,1):(n.startIndex++,n.endIndex++),e.unshift(p)),c.startIndex=h),h===0&&p.controlComponent!==s.ControlComponent.PREFIX&&R?.linkTdPrevId&&(R=this.draw.getTdById(R.linkTdPrevId),R)){T=R.value,h=R.value.length-1,u=!0;continue}if(h===0&&p.controlComponent!==s.ControlComponent.PRETEXTFIX&&R?.linkTdPrevId&&(R=this.draw.getTdById(R.linkTdPrevId),R)){T=R.value,h=R.value.length-1,u=!0;continue}h--}u=!1;let g=i+1,f=r,C=e;for(;g<C.length;){const p=C[g];if(p.controlId!==a.controlId)break;if(p.type!==s.ElementType.SPLIT_TAG&&(d.push(p),u&&(C.splice(g,1),e.push(p),g--)),g===C.length-1&&p.controlComponent!==s.ControlComponent.POSTFIX&&f?.linkTdNextId&&(f=this.draw.getTdById(f.linkTdNextId),f)){C=f.value,g=0,u=!0;continue}if(g===C.length-1&&p.controlComponent!==s.ControlComponent.POSTTEXTFIX&&f?.linkTdNextId&&(f=this.draw.getTdById(f.linkTdNextId),f)){C=f.value,g=0,u=!0;continue}g++}return c.endIndex=c.startIndex+d.length,{range:n,elementList:e,tdId:l,fullRange:{startIndex:c.startIndex,endIndex:c.endIndex-2}}}}class cT{options;currentTextFieldId=null;valueStartX=0;valueWidth=0;valueY=0;constructor(t){this.options=t.getOptions()}startTextFieldValue(t,e,n){this.currentTextFieldId=t,this.valueStartX=e,this.valueY=n,this.valueWidth=0}recordValueWidth(t){this.valueWidth+=t}endTextFieldValue(t){if(!this.currentTextFieldId||this.valueWidth<=0){this.reset();return}const{scale:e}=this.options;t.save(),t.strokeStyle=this.options.defaultColor,t.lineWidth=e,t.beginPath();const n=this.valueY-.5*e;t.moveTo(this.valueStartX,n),t.lineTo(this.valueStartX+this.valueWidth,n),t.stroke(),t.restore(),this.reset()}reset(){this.currentTextFieldId=null,this.valueStartX=0,this.valueWidth=0,this.valueY=0}}function ui(o,t){const e=n=>{for(let i=0;i<n.length;i++){const l=n[i];if(t(l),l.valueList?.length&&e(l.valueList),l.control?.value?.length&&e(l.control.value),l.type===s.ElementType.TABLE&&l.trList?.length)for(let r=0;r<l.trList.length;r++){const a=l.trList[r];for(let c=0;c<a.tdList.length;c++)e(a.tdList[c].value)}}};e(o)}function Ws(o,t){const e=t.id||ft(),n=t.subTemplateInstanceId||ft();let i=!1;t.id!==e&&(t.id=e,i=!0),t.subTemplateInstanceId!==n&&(t.subTemplateInstanceId=n,i=!0);const l=r=>{for(let a=0;a<r.length;a++){const c=r[a];if(c.subTemplateParentId&&c.subTemplateParentId!==e)continue;c.subTemplateParentId!==e&&(c.subTemplateParentId=e,i=!0);const d=c.type===s.ElementType.SUB_TEMPLATE?c.subTemplateInstanceId||ft():n;if(c.subTemplateInstanceId!==d&&(c.subTemplateInstanceId=d,i=!0),c.valueList?.length&&l(c.valueList),c.type===s.ElementType.TABLE&&c.trList?.length)for(let u=0;u<c.trList.length;u++){const h=c.trList[u];for(let R=0;R<h.tdList.length;R++)l(h.tdList[R].value)}}};return l(o),i}function Wl(o){const t=e=>{for(let n=0;n<e.length;n++){const i=e[n];if(delete i.subTemplateParentId,delete i.subTemplateInstanceId,i.subTemplateContent?.length&&t(i.subTemplateContent),i.valueList?.length&&t(i.valueList),i.control?.value?.length&&t(i.control.value),i.type===s.ElementType.TABLE&&i.trList?.length)for(let l=0;l<i.trList.length;l++){const r=i.trList[l];for(let a=0;a<r.tdList.length;a++)t(r.tdList[a].value)}}};t(o)}function dT(o){const t=o.control;return t?t.type===s.ControlType.TEXT||t.type===s.ControlType.TEXTFIELD||t.type===s.ControlType.DATE||t.type===s.ControlType.NUMBER?Pn(t.value||[])||null:(t.type===s.ControlType.SELECT||t.type===s.ControlType.CHECKBOX||t.type===s.ControlType.RADIO)&&t.code?.split(",").map(e=>t.valueSets?.find(n=>n.code===e)?.value).filter(Boolean).join("")||null:null}function uT(o){const t=new Map,e=new Set,n=new Set,i=(l,r,a)=>{if(!l||r==null)return;const c=t.get(l)||[];c.push({label:l,source:a,value:r}),t.set(l,c)};return ui(o,l=>{l.control&&l.controlId&&!e.has(l.controlId)&&(e.add(l.controlId),i(l.control.label,dT(l),"control"));const r=l.id;if(r&&!n.has(r)&&(l.type===s.ElementType.MACRO||l.type===s.ElementType.CUSTOM_MACRO||l.type===s.ElementType.REUSABLE_ITEM)){n.add(r);let a;l.type===s.ElementType.MACRO?a=l.value:l.type===s.ElementType.CUSTOM_MACRO?a=l.macroConfig?.value:l.type===s.ElementType.REUSABLE_ITEM&&(a=l.reusableItemConfig?.value),i(l.label,a,"macro")}}),t}function Us(o){const t=o.replace(/,/g,"").match(/[-+]?(?:\d+(?:\.\d+)?|\.\d+)/);if(!t)return null;const e=Number(t[0]);return Number.isFinite(e)?e:null}function hT(o,t){const{rangeMin:e,rangeMax:n,source:i="all"}=o;if(e==null||n==null)return!1;const l=Us(e),r=Us(n);return l==null||r==null||l>r?!1:t.some(a=>{if(i!=="all"&&a.source!==i)return!1;const c=Us(a.value);return c!=null&&c>=l&&c<=r})}function Ul(o,t){const{label:e,value:n,regex:i,source:l="all"}=o;if(!e)return!1;const r=t.get(e);if(!r?.length)return!1;if(o.matchMode==="range")return hT(o,r);const a=n??i;if(a==null||a==="")return!1;if(n!=null)return r.some(d=>l!=="all"&&d.source!==l?!1:d.value.trim()===n.trim());let c;try{c=new RegExp(a)}catch(d){return console.warn("子模板匹配正则无效:",a,d),!1}return r.some(d=>l!=="all"&&d.source!==l?!1:c.test(d.value))}function RT(o,t,e="and"){return o?.length?e==="or"?o.some(n=>Ul(n,t)):o.every(n=>Ul(n,t)):!0}class gT{draw;options;constructor(t){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:l}=t;let{y:r}=t;const{checkbox:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:u,verticalAlign:h},scale:R}=this.options,T=l.elementList[i],{metrics:g,checkbox:f}=T,C=T.controlComponent?0:a;if(h===s.VerticalAlign.TOP||h===s.VerticalAlign.MIDDLE){let O=i+1,P=null;for(;O<l.elementList.length&&(P=l.elementList[O],!(P.value!==_&&P.value!==Ti));)O++;if(P){const{metrics:{boundingBoxAscent:S,boundingBoxDescent:y}}=P,Y=S+y;Y>g.height&&(h===s.VerticalAlign.TOP?r-=S-g.height:h===s.VerticalAlign.MIDDLE&&(r-=(Y-g.height)/2))}}const p=Math.round(n+C*R),I=Math.round(r-g.height+c),m=g.width-(C+a)*R,L=g.height;e.save(),e.beginPath(),e.translate(.5,.5),f?.value?(e.lineWidth=c,e.strokeStyle=d,e.rect(p,I,m,L),e.stroke(),e.beginPath(),e.fillStyle=d,e.fillRect(p,I,m,L),e.beginPath(),e.strokeStyle=u,e.lineWidth=c*2*R,e.moveTo(p+2*R,I+L/2),e.lineTo(p+m/2,I+L-3*R),e.lineTo(p+m-2*R,I+3*R),e.stroke()):(e.lineWidth=c,e.rect(p,I,m,L),e.stroke()),e.closePath(),e.restore()}}class TT{draw;options;constructor(t){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:l}=t;let{y:r}=t;const{radio:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:u,verticalAlign:h},scale:R}=this.options,T=l.elementList[i],{metrics:g,radio:f}=T,C=T.controlComponent?0:a;if(h===s.VerticalAlign.TOP||h===s.VerticalAlign.MIDDLE){let O=i+1,P=null;for(;O<l.elementList.length&&(P=l.elementList[O],!(P.value!==_&&P.value!==Ti));)O++;if(P){const{metrics:{boundingBoxAscent:S,boundingBoxDescent:y}}=P,Y=S+y;Y>g.height&&(h===s.VerticalAlign.TOP?r-=S-g.height:h===s.VerticalAlign.MIDDLE&&(r-=(Y-g.height)/2))}}const p=Math.round(n+C*R),I=Math.round(r-g.height+c),m=g.width-(C+a)*R,L=g.height;e.save(),e.beginPath(),e.translate(.5,.5),e.strokeStyle=f?.value?d:u,e.lineWidth=c,e.arc(p+m/2,I+L/2,m/2,0,Math.PI*2),e.stroke(),f?.value&&(e.beginPath(),e.fillStyle=d,e.arc(p+m/2,I+L/2,m/3,0,Math.PI*2),e.fill()),e.closePath(),e.restore()}}const hi={fontSize:11,smallFontSize:9,lineHeight:12,dividerWidth:40,gap:4,totalHeight:36};class fT{draw;options;inputModal=null;isPopup=!1;measureContext=null;sizeCache=new WeakMap;constructor(t){this.draw=t,this.options=t.getOptions()}computeSize(t){const e=hi,n=this.options.scale,i=t.menstrualData,l=[n,i?.isMenopause?1:0,i?.periodMin||"",i?.periodMax||"",i?.menarcheAge||"",i?.lastPeriod||"",i?.menopauseAge||"",i?.cycleMin||"",i?.cycleMax||""].join("|"),r=this.sizeCache.get(t);if(r?.key===l)return r.size;const a=e.fontSize*n,c=e.smallFontSize*n,d=e.gap*n,u=e.dividerWidth*n;this.measureContext||(this.measureContext=document.createElement("canvas").getContext("2d"));const h=this.measureContext;h.font=`${a}px "Microsoft YaHei", sans-serif`;let R=u;h.font=`${c}px "Microsoft YaHei", sans-serif`;let T=0;if(i){const C=this.getValue(i.menarcheAge);h.font=`${a}px "Microsoft YaHei", sans-serif`,C&&(R+=h.measureText(`${C}岁`).width+d);let p="";if(i.isMenopause){const P=this.getValue(i.menopauseAge);P&&(p=`${P}岁`)}else{const P=this.getValue(i.lastPeriod);P&&(p=P)}p&&(R+=h.measureText(p).width+d),h.font=`${c}px "Microsoft YaHei", sans-serif`;const I=this.getValue(i.periodMin),m=this.getValue(i.periodMax);if(I||m){const P=`${I||""}~${m||""}`;T=Math.max(T,h.measureText(P).width)}const L=this.getValue(i.cycleMin),O=this.getValue(i.cycleMax);if(L||O){const P=`${L||""}~${O||""}`;T=Math.max(T,h.measureText(P).width)}}else h.font=`${a}px "Microsoft YaHei", sans-serif`,T=h.measureText("~").width;const f={width:Math.max(R,T),height:e.totalHeight*n};return this.sizeCache.set(t,{key:l,size:f}),f}getValue(t){return!t||t===""||t==="_"||t==="____-__-__"?"":t}render(t){const{ctx:e,x:n,y:i,element:l}=t,r=l.menstrualData,a=this.options.scale;e.save(),e.font=`${hi.fontSize*a}px "Microsoft YaHei", sans-serif`,e.fillStyle=this.options.defaultColor,e.textBaseline="bottom",r?this.renderWithData(e,n,i,r,a):this.renderEmpty(e,n,i,a),e.restore()}renderEmpty(t,e,n,i){const l=hi,r=l.fontSize*i,a=l.lineHeight*i,c=l.dividerWidth*i,d=n-a*1.5,u=e+c/2;t.font=`${r}px "Microsoft YaHei", sans-serif`;const h=t.measureText("~").width,R=u-h/2;t.fillText("~",R,d+a);const T=d+a*2;this.drawDivider(t,e,T-r/2,c,i),t.fillText("~",R,T+a)}renderWithData(t,e,n,i,l){const r=hi,a=r.fontSize*l,c=r.smallFontSize*l,d=r.lineHeight*l,u=r.gap*l,h=r.dividerWidth*l,R=n-d*2,T=R+d*2;t.font=`${a}px "Microsoft YaHei", sans-serif`;const g=this.getValue(i.menarcheAge);let f=e;if(g){const X=`${g}岁`;t.fillText(X,e,T),f=e+t.measureText(X).width+u}const C=f+h/2,p=R+d;t.font=`${c}px "Microsoft YaHei", sans-serif`;const I=this.getValue(i.periodMin),m=this.getValue(i.periodMax);let L="";I||m?L=`${I||""}~${m||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,L="~");const O=t.measureText(L).width,P=C-O/2;t.fillText(L,P,p),this.drawDivider(t,f,T-a/2,h,l),t.font=`${a}px "Microsoft YaHei", sans-serif`;let S="";if(i.isMenopause){const X=this.getValue(i.menopauseAge);X&&(S=`${X}岁`)}else{const X=this.getValue(i.lastPeriod);X&&(S=X)}S&&t.fillText(S,f+h+u,T);const y=T+d;t.font=`${c}px "Microsoft YaHei", sans-serif`;const Y=this.getValue(i.cycleMin),b=this.getValue(i.cycleMax);let M="";Y||b?M=`${Y||""}~${b||""}`:(t.font=`${a}px "Microsoft YaHei", sans-serif`,M="~");const V=t.measureText(M).width,N=C-V/2;t.fillText(M,N,y)}drawDivider(t,e,n,i,l){t.save(),t.beginPath(),t.strokeStyle=this.options.defaultColor,t.lineWidth=.5*l,t.moveTo(e,n),t.lineTo(e+i,n),t.stroke(),t.restore()}clearMenstrualHistoryEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderMenstrualHistoryEditor(t,e){if(this.options.mode===s.EditorMode.PRINT||this.options.mode===s.EditorMode.COMPARE)return;(this.isPopup||this.inputModal)&&this.clearMenstrualHistoryEditor(),this.isPopup=!0;const n=t.menstrualData;this.inputModal=document.createElement("div"),this.inputModal.className="menstrual-history-edit-modal",this.inputModal.setAttribute("editor-component","menstrual-history-edit-modal"),this.inputModal.innerHTML=`
214
214
  <div class="menstrual-history-modal__mask"></div>
215
215
  <div class="menstrual-history-modal__container">
216
216
  <div class="menstrual-history-modal__header">
@@ -533,7 +533,7 @@ ${h} `}textToElements(t){const e=[],n=t.split(`
533
533
  ${m}
534
534
  </span>`},l=(u,h,R)=>{const T=[];return h.forEach(g=>{T.push(i(R,g))}),u.forEach(g=>{T.push(i(R,g))}),T.join(" ")},r=e.querySelector(".tooth-preview-upper-left"),a=e.querySelector(".tooth-preview-upper-right"),c=e.querySelector(".tooth-preview-lower-left"),d=e.querySelector(".tooth-preview-lower-right");r&&(r.innerHTML=l(t?.upperLeft||[],t?.upperLeftLetter||[],"upperLeft")),a&&(a.innerHTML=l(t?.upperRight||[],t?.upperRightLetter||[],"upperRight")),c&&(c.innerHTML=l(t?.lowerLeft||[],t?.lowerLeftLetter||[],"lowerLeft")),d&&(d.innerHTML=l(t?.lowerRight||[],t?.lowerRightLetter||[],"lowerRight"))}bindExtraPanelEvents(){const t=this.inputModal;if(!t)return;t.querySelectorAll(".tooth-surface-item").forEach(i=>{i.addEventListener("click",()=>{if(!this.finallyAdd)return;const l=i.dataset.surface;if(!l)return;const r=`${this.finallyAdd.position}-${this.finallyAdd.value}`;this.toothSurfaceMap[r]||(this.toothSurfaceMap[r]=[]);const a=this.toothSurfaceMap[r],c=a.indexOf(l);c>-1?(a.splice(c,1),i.classList.remove("selected")):(a.push(l),i.classList.add("selected")),this.updatePreview()})}),t.querySelectorAll(".tooth-supernumerary-item").forEach(i=>{i.addEventListener("click",()=>{if(!this.finallyAdd)return;const l=i.dataset.supernumerary;if(!l)return;const r=`${this.finallyAdd.position}-${this.finallyAdd.value}`;this.supernumeraryToothMap[r]===l?(delete this.supernumeraryToothMap[r],i.classList.remove("selected")):(t.querySelectorAll(".tooth-supernumerary-item").forEach(a=>a.classList.remove("selected")),this.supernumeraryToothMap[r]=l,i.classList.add("selected")),this.updatePreview()})}),this.updateExtraPanelSelection()}updateExtraPanelSelection(){const t=this.inputModal;if(!t||!this.finallyAdd)return;const e=`${this.finallyAdd.position}-${this.finallyAdd.value}`,n=this.toothSurfaceMap[e]||[];t.querySelectorAll(".tooth-surface-item").forEach(l=>{const r=l.dataset.surface;n.includes(r||"")?l.classList.add("selected"):l.classList.remove("selected")});const i=this.supernumeraryToothMap[e];t.querySelectorAll(".tooth-supernumerary-item").forEach(l=>{l.dataset.supernumerary===i?l.classList.add("selected"):l.classList.remove("selected")})}}const vl='(function(){"use strict";function f(i){let s="",n=0;for(;n<i.length;){const t=i[n];if(t.type==="table"){if(t.trList)for(let l=0;l<t.trList.length;l++){const o=t.trList[l];for(let e=0;e<o.tdList.length;e++){const r=o.tdList[e];s+=f(r.value)}}}else if(t.type==="hyperlink"){const l=t.hyperlinkId,o=[];for(;n<i.length;){const e=i[n];if(l!==e.hyperlinkId){n--;break}delete e.type,o.push(e),n++}s+=f(o)}else if(t.controlId){if(!t.control?.hide){const l=t.controlId,o=[];for(;n<i.length;){const e=i[n];if(l!==e.controlId){n--;break}e.controlComponent==="value"&&(delete e.controlId,o.push(e)),n++}s+=f(o)}}else(!t.type||t.type==="text")&&!t.area?.hide&&(s+=t.value);n++}return s}function p(i){const s=[],n=/[0-9]/,t=/[A-Za-z]/,l=/\\s/;let o=!1,e=!1,r="";function a(){r&&(s.push(r),r="")}for(const c of i)t.test(c)?(o||a(),r+=c,o=!0,e=!1):n.test(c)?(e||a(),r+=c,o=!1,e=!0):(a(),o=!1,e=!1,l.test(c)||s.push(c));return a(),s}onmessage=i=>{const s=i.data,t=f(s).replace(new RegExp("^​"),"").replace(new RegExp("​","g"),`\n`),l=p(t);postMessage(l.length)}})();\n',Zl=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",vl],{type:"text/javascript;charset=utf-8"});function pT(o){let t;try{if(t=Zl&&(self.URL||self.webkitURL).createObjectURL(Zl),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(vl),{name:o?.name})}}const Ql=`(function(){"use strict";const v={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6},E=["text","hyperlink","subscript","superscript","control","date","label"],L="​";function m(c){return!c.type||E.includes(c.type)}function I(c){const{elementList:r,positionList:d}=c,p=[];let u=0;for(;u<r.length;){const t=r[u],l=(e,n,s)=>{const g=e.titleId,a={type:"title",value:"",level:e.level,titleId:g,pageNo:d[u].pageNo},o=[];for(;s<n.length;){const i=n[s];if(g!==i.titleId){s--;break}o.push(i),s++}return a.value=o.filter(i=>m(i)).map(i=>i.value).join("").replace(new RegExp(L,"g"),""),{position:s,titleElement:a}};if(t.titleId){const{position:e,titleElement:n}=l(t,r,u);u=e,p.push(n)}if(t.type==="table"){const e=t.trList;for(let n=0;n<e.length;n++){const s=e[n];for(let g=0;g<s.tdList.length;g++){const a=s.tdList[g].value;if(a.length>1){let o=1;for(;o<a.length;){if(a[o]?.titleId){const{titleElement:i,position:N}=l(a[o],a,o);p.push(i),o=N}o++}}}}}u++}if(!p.length)return null;const f=(t,l)=>{const e=l.subCatalog[l.subCatalog.length-1],n=v[e?.level],s=v[t.level];e&&s>n?f(t,e):l.subCatalog.push({id:t.titleId,name:t.value,level:t.level,pageNo:t.pageNo,subCatalog:[]})},h=[];for(let t=0;t<p.length;t++){const l=p[t],e=h[h.length-1],n=v[e?.level],s=v[l.level];e&&s>n?f(l,e):h.push({id:l.titleId,name:l.value,level:l.level,pageNo:l.pageNo,subCatalog:[]})}return h}onmessage=c=>{const r=c.data,d=I(r);postMessage(d)}})();
535
535
  `,Kl=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Ql],{type:"text/javascript;charset=utf-8"});function IT(o){let t;try{if(t=Kl&&(self.URL||self.webkitURL).createObjectURL(Kl),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Ql),{name:o?.name})}}const Hl=`(function(){"use strict";function u(e){const t=[];for(const s of e){if(s.type==="table"){const o=s.trList;for(let n=0;n<o.length;n++){const c=o[n];for(let r=0;r<c.tdList.length;r++){const i=c.tdList[r];t.push(...u(i.value))}}}if(s.groupIds)for(const o of s.groupIds)t.includes(o)||t.push(o)}return t}onmessage=e=>{const t=e.data,s=u(t);postMessage(s)}})();
536
- `,Al=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Hl],{type:"text/javascript;charset=utf-8"});function ET(o){let t;try{if(t=Al&&(self.URL||self.webkitURL).createObjectURL(Al),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Hl),{name:o?.name})}}const _l='(function(){"use strict";var H=(D=>(D.HALF="half",D.ONE_THIRD="one-third",D.QUARTER="quarter",D))(H||{}),K=(D=>(D.ARABIC="arabic",D.CHINESE="chinese",D))(K||{});const y="​";H.HALF+"",1/2,H.ONE_THIRD+"",1/3,H.QUARTER+"",1/4;const uD=/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/,FD=/[#*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\\u27BF\\u2B50]|\\u26D3\\uFE0F?(?:\\u200D\\uD83D\\uDCA5)?|\\u26F9(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\u2764\\uFE0F?(?:\\u200D(?:\\uD83D\\uDD25|\\uD83E\\uDE79))?|\\uD83C(?:[\\uDC04\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]\\uFE0F?|[\\uDF85\\uDFC2\\uDFC7](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDFC4\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FE0F?)?|[\\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\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C[\\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,tD=new RegExp(`${FD.source}|${uD.source}`,"g");function g(D){if(typeof structuredClone=="function")return structuredClone(D);if(!D||typeof D!="object")return D;let r={};return Array.isArray(D)?r=D.map(i=>g(i)):Object.keys(D).forEach(i=>{r[i]=g(D[i])}),r}function eD(D){const r=[];if(Intl.Segmenter){const T=new Intl.Segmenter().segment(D);for(const{segment:d}of T)r.push(d)}else{const i=new Map;for(const d of D.matchAll(tD))i.set(d.index,d[0]);let T=0;for(;T<D.length;){const d=i.get(T);d?(r.push(d),T+=d.length):(r.push(D[T]),T++)}}return r}function _(D,r){const i={};for(const T in D)r.includes(T)&&(i[T]=D[T]);return i}function ED(D,r){return D.length!==r.length?!1:!D.some(i=>!r.includes(i))}var t=(D=>(D.TEXT="text",D.TEXTFIELD="TextField",D.BUTTON="button",D.IMAGE="image",D.TABLE="table",D.HYPERLINK="hyperlink",D.SUPERSCRIPT="superscript",D.SUBSCRIPT="subscript",D.SEPARATOR="separator",D.PAGE_BREAK="pageBreak",D.CONTROL="control",D.AREA="area",D.CHECKBOX="checkbox",D.RADIO="radio",D.LATEX="latex",D.TAB="tab",D.DATE="date",D.BLOCK="block",D.TITLE="title",D.LIST="list",D.SPLIT_TAG="splitTag",D.LABEL="label",D.MENSTRUAL_HISTORY="menstrualHistory",D.FETAL_HEART_POSITION="fetalHeartPosition",D.TOOTH_POSITION="toothPosition",D.SPECIAL_SYMBOLS="specialSymbols",D.MACRO="macro",D.CUSTOM_MACRO="customMacro",D.REUSABLE_ITEM="reusableItem",D.SUB_TEMPLATE="subTemplate",D))(t||{});const N=["rowFlex","vertical","rowMargin"],CD=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","vertical","rowMargin","dashArray","trList","tdPadding","tableEditable","tableToolDisabled","borderType","borderColor","borderWidth","borderExternalWidth","translateX","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","imgPreviewDisabled","imgCrop","imgCaption","textDecoration","extension","externalId","areaId","area","hide","label","labelId","lineWidth","deletePerson","newElEditPerson","deleteTime","newElEditTime","dictCode","macroConfig","menstrualData","menstrualHistoryId","fetalHeartData","fetalHeartPositionId","toothPositionData","toothPositionId","reusableItemConfig","templateId","subTemplateContent","subTemplateRelation","subTemplateConditions","subTemplateExpanded"],oD=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],Y=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"];t.TEXT,t.HYPERLINK,t.SUBSCRIPT,t.SUPERSCRIPT,t.CONTROL,t.DATE,t.IMAGE,t.LATEX,t.BLOCK,t.PAGE_BREAK,t.SEPARATOR,t.TABLE,t.TITLE,t.LIST;var G=(D=>(D.UL="ul",D.OL="ol",D))(G||{}),k=(D=>(D.DISC="disc",D.CIRCLE="circle",D.SQUARE="square",D.CHECKBOX="checkbox",D))(k||{}),m=(D=>(D.DISC="disc",D.CIRCLE="circle",D.SQUARE="square",D.DECIMAL="decimal",D.CHECKBOX="checkbox",D))(m||{});k.DISC+"",k.CIRCLE+"",k.SQUARE+"",k.CHECKBOX+"",G.OL+"",G.UL+"",m.DISC+"",m.CIRCLE+"",m.SQUARE+"",m.DECIMAL+"",m.CHECKBOX+"";var p=(D=>(D.FIRST="first",D.SECOND="second",D.THIRD="third",D.FOURTH="fourth",D.FIFTH="fifth",D.SIXTH="sixth",D))(p||{});p.FIRST+"",p.SECOND+"",p.THIRD+"",p.FOURTH+"",p.FIFTH+"",p.SIXTH+"",p.FIRST+"",p.SECOND+"",p.THIRD+"",p.FOURTH+"",p.FIFTH+"",p.SIXTH+"",p.FIRST,p.SECOND,p.THIRD,p.FOURTH,p.FIFTH,p.SIXTH;var h=(D=>(D.TEXT="text",D.SELECT="select",D.CHECKBOX="checkbox",D.RADIO="radio",D.DATE="date",D.NUMBER="number",D.TEXTFIELD="TextField",D.BUTTON="button",D.MENSTRUAL_HISTORY="menstrualHistory",D))(h||{}),F=(D=>(D.PREFIX="prefix",D.POSTFIX="postfix",D.PRE_TEXT="preText",D.PRETEXTFIX="preTextFix",D.PRETEXTFIX_TEXT="preTextFixText",D.POSTTEXTFIX="postTextFix",D.POSTTEXTFIX_TEXT="postTextFixText",D.POST_TEXT="postText",D.PLACEHOLDER="placeholder",D.TEXTFIXLABEL="textFixLabel",D.VALUE="value",D.DELETEPERSON="deletePerson",D.CHECKBOX="checkbox",D.RADIO="radio",D.UNDERLINE="underline",D))(F||{}),q=(D=>(D.LEFT="left",D.CENTER="center",D.RIGHT="right",D.ALIGNMENT="alignment",D.JUSTIFY="justify",D))(q||{}),W=(D=>(D.CONTAIN="contain",D.COVER="cover",D))(W||{}),Z=(D=>(D.REPEAT="repeat",D.NO_REPEAT="no-repeat",D.REPEAT_X="repeat-x",D.REPEAT_Y="repeat-y",D))(Z||{});W.COVER,Z.NO_REPEAT;var z=(D=>(D.TOP="top",D.MIDDLE="middle",D.BOTTOM="bottom",D))(z||{});z.BOTTOM,H.HALF,H.HALF,q.CENTER,K.ARABIC,z.BOTTOM;var J=(D=>(D.TEXT="text",D.IMAGE="image",D))(J||{});J.TEXT,K.ARABIC;var $=(D=>(D.PAGE="page",D.CONTINUITY="continuity",D))($||{});$.CONTINUITY;const nD=[h.SELECT,h.DATE,h.CHECKBOX,h.RADIO];function rD(D,r){return D&&nD.includes(D)?[""]:eD(r)}F.PREFIX,F.POSTFIX,F.PRE_TEXT,F.POST_TEXT,F.PRETEXTFIX,F.PRETEXTFIX_TEXT,F.POSTTEXTFIX,F.POSTTEXTFIX_TEXT,F.PLACEHOLDER,F.TEXTFIXLABEL,F.CHECKBOX,F.RADIO,F.UNDERLINE;function lD(D){return D?.buttonValueLayout===!0}function iD(D,r){const i=Object.keys(D),T=Object.keys(r);if(i.length!==T.length)return!1;for(let d=0;d<i.length;d++){const f=i[d];if(f!=="value"&&!(f==="groupIds"&&Array.isArray(D[f])&&Array.isArray(r[f])&&ED(D[f],r[f]))&&D[f]!==r[f])return!1}return!0}function U(D,r={}){const{extraPickAttrs:i}=r,T=[...CD];i&&T.push(...i);const d={value:D?.value===y?`\n`:D?.value};return D&&T.forEach(f=>{const s=D[f];s!==void 0&&(d[f]=s)}),d}function P(D,r={}){const{extraPickAttrs:i,isClassifyArea:T=!1,isClone:d=!0,editorOptions:f}=r,s=(d?g(D):D).filter(u=>u.type!==t.SPLIT_TAG),M=[];let E=0;const sD=u=>u===F.PREFIX||u===F.PRETEXTFIX||u===F.PRETEXTFIX_TEXT||u===F.PRE_TEXT,cD=u=>{const L=f?.control;switch(u.controlComponent){case F.PRETEXTFIX:return u.control?.preTextFix||L?.preTextFix||"";case F.PRETEXTFIX_TEXT:return u.control?.preTextFixText||L?.preTextFixText||"";case F.PRE_TEXT:return u.control?.preText||"";default:return u.control?.prefix||L?.prefix||""}},BD=(u,L)=>{if(u.value!==y||!u.controlId||!sD(u.controlComponent)||!L||L.controlId!==u.controlId||(L.originControlId||null)!==(u.originControlId||null)||L.controlComponent!==u.controlComponent||L.value===y)return!1;const o=u.control?.type;return rD(o,cD(u))[0]!==`\n`};for(;E<s.length;){let u=s[E];if(BD(u,s[E+1])&&(u=g(u),delete u.type,delete u.control,delete u.controlId,delete u.originControlId,delete u.controlComponent),E===0&&u.value===y&&!u.listId&&(!u.type||u.type===t.TEXT)){E++;continue}if(u.areaId){const o=u.areaId,A=u.area,c=[];for(;E<s.length;){const C=s[E];if(o!==C.areaId){E--;break}delete C.area,delete C.areaId,c.push(C),E++}const l=P(c,r);if(T){const C={type:t.AREA,value:"",areaId:o,area:A};C.valueList=l,u=C}else{M.splice(E,0,...l);continue}}else if(u.titleId&&u.level){const o=u.titleId;if(o){const A=u.level,c={type:t.TITLE,title:u.title,titleId:o,value:"",level:A},l=[];for(;E<s.length;){const C=s[E];if(o!==C.titleId){E--;break}delete C.level,delete C.title,l.push(C),E++}c.valueList=P(l,r),u=c}}else if(u.listId&&u.listType){const o=u.listId;if(o){const A=u.listType,c=u.listStyle,l=u?.label,C={type:t.LIST,value:"",label:l||"",listId:o,listType:A,listStyle:c},B=[];for(;E<s.length;){const n=s[E];if(o!==n.listId){E--;break}delete n.listType,delete n.listStyle,B.push(n),E++}C.valueList=P(B,r),u=C}}else if(u.type===t.TABLE){if(u.pagingId){let o=E+1,A=0;for(;o<s.length;){const c=s[o];if(c.pagingId===u.pagingId){u.height+=c.height;const l=c.trList.filter(C=>!C.pagingRepeat).filter(C=>(C.tdList=C.tdList.filter(B=>{if(B.originalId){for(let n=0;n<u.trList.length;n++){const a=u.trList[n].tdList.find(({id:e})=>e===B.originalId);if(a){B.value[0]?.type===t.SPLIT_TAG&&B.value.splice(0,1),a.value.push(...B.value),a.rowspan=a.originalRowspan??a.rowspan;break}}return!1}return!0}),!C.originalId));u.trList.push(...l),u.trList?.forEach(C=>C.minHeight=C.originalMinHeight??C.minHeight),o++,A++}else break}E+=A}if(u.trList)for(let o=0;o<u.trList.length;o++){const A=u.trList[o];delete A.id;for(let c=0;c<A.tdList.length;c++){const l=A.tdList[c],C={colspan:l.colspan,rowspan:l.rowspan,value:P(l.value,{...r,isClassifyArea:!1})};oD.forEach(B=>{const n=l[B];n!==void 0&&(C[B]=n)}),A.tdList[c]=C}}}else if(u.type===t.HYPERLINK){const o=u.hyperlinkId;if(o){const A={type:t.HYPERLINK,value:"",url:u.url},c=[];for(;E<s.length;){const l=s[E];if(o!==l.hyperlinkId){E--;break}delete l.type,delete l.url,c.push(l),E++}A.valueList=P(c,r),u=A}}else if(u.type===t.DATE){const o=u.dateId;if(o){const A={type:t.DATE,value:"",dateFormat:u.dateFormat},c=[];for(;E<s.length;){const l=s[E];if(o!==l.dateId){E--;break}delete l.type,delete l.dateFormat,c.push(l),E++}A.valueList=P(c,r),u=A}}else if(u.type!==t.BUTTON){if(u.controlId){const o=u.controlId;if(!(u.controlComponent===F.PREFIX||u.controlComponent===F.PRETEXTFIX||u.controlComponent===F.PRETEXTFIX_TEXT)&&u.controlComponent===F.VALUE){if(u.type===t.MENSTRUAL_HISTORY||u.type===t.FETAL_HEART_POSITION||u.type===t.TOOTH_POSITION||u.type===t.IMAGE||u.type===t.MACRO||u.type===t.CUSTOM_MACRO||u.type===t.REUSABLE_ITEM||u.type===t.LIST||u.type===t.SPECIAL_SYMBOLS){let B=!1;for(let n=E-1;n>=0;n--){const I=s[n],a=I.controlComponent===F.PREFIX||I.controlComponent===F.PRETEXTFIX||I.controlComponent===F.PRETEXTFIX_TEXT;if(I.controlId===o&&a){B=!0;break}if(I.controlId!==o)break}if(!B){const n=g(u);delete n.controlId,delete n.control,delete n.controlComponent,delete n.originControlId,M.push(n),E++;continue}}E++;continue}if(u.controlComponent===F.PLACEHOLDER||u.controlComponent===F.POSTFIX||u.controlComponent===F.POSTTEXTFIX||u.controlComponent===F.POSTTEXTFIX_TEXT||u.controlComponent===F.POST_TEXT||u.controlComponent===F.PRE_TEXT||u.controlComponent===F.CHECKBOX||u.controlComponent===F.RADIO){E++;continue}const c=(C,B,n,I)=>{if(I===h.CHECKBOX||I===h.RADIO){let e=-1;for(let X=C;X<s.length&&s[X].controlId===B;X++)e=X;return e}const a=n?[F.POSTTEXTFIX,F.POSTTEXTFIX_TEXT]:[F.POSTFIX];for(let e=C;e<s.length;e++){const X=s[e];if(X.controlId===B&&a.includes(X.controlComponent))return e}return-1},l=(C,B,n)=>{const I=[];let a=C;for(;a<=B;){const e=s[a];if(lD(e)){a++;continue}if(e.controlId&&e.controlId!==n&&e.control){const O=e.control?.type,x=O===h.TEXTFIELD,R=x?F.PRETEXTFIX:F.PREFIX,v=e.controlComponent===R,b=O===h.CHECKBOX||O===h.RADIO;if(v||b&&(e.controlComponent===F.CHECKBOX||e.controlComponent===F.RADIO)){const S=c(a+1,e.controlId,x,O);if(S!==-1){const Q=s.slice(a,S+1).map(aD=>{const DD=g(aD);return delete DD.originControlId,DD}),w=P(Q,r);w.length>0&&I.push(w[0]),a=S+1;continue}}}if(!(e.controlId===n&&(e.controlComponent===F.VALUE||!e.controlComponent)&&(!e.originControlId||e.originControlId===n)||e.originControlId===n&&e.controlComponent===F.VALUE||e.controlId===n&&(e.controlComponent===F.CHECKBOX||e.controlComponent===F.RADIO)&&!e.originControlId)){a++;continue}if(e.type===t.MENSTRUAL_HISTORY||e.type===t.FETAL_HEART_POSITION||e.type===t.TOOTH_POSITION||e.type===t.IMAGE||e.type===t.MACRO||e.type===t.CUSTOM_MACRO||e.type===t.REUSABLE_ITEM||e.type===t.SUB_TEMPLATE||e.type===t.LIST||e.type===t.SPECIAL_SYMBOLS){const O=g(e);delete O.controlId,delete O.control,delete O.controlComponent,delete O.originControlId,I.push(O),a++;continue}if(e.controlComponent===F.CHECKBOX||e.controlComponent===F.RADIO){I.push(g(e)),a++;continue}const j=u.control?.type;if(j===h.CHECKBOX||j===h.RADIO){let O=a-1,x=!1;for(;O>=C-1;){const R=s[O];if(R.controlId===n&&!R.originControlId)if(R.controlComponent===F.CHECKBOX){x=R.checkbox?.value===!0;break}else if(R.controlComponent===F.RADIO){x=R.radio?.value===!0;break}else if(R.controlComponent===F.VALUE){O--;continue}else break;O--}if(x){const R={value:e.value||""},v=[...N,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const b of v){const S=e[b];if(S!==void 0){if(b==="color"&&f){const Q=f.control?.bracketColor,w=f.control?.placeholderColor;if(S===Q||S===w)continue}R[b]=S}}I.push(R)}}else{const O={value:e.value||""},x=[...N,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const R of x){const v=e[R];if(v!==void 0){if(R==="color"&&f){const b=f.control?.bracketColor,S=f.control?.placeholderColor;if(v===b||v===S)continue}O[R]=v}}I.push(O)}a++}return I};if(u.controlComponent===F.PREFIX){const C=u.control?.type===h.TEXTFIELD,B=c(E+1,o,C);if(B!==-1){const n=l(E+1,B-1,o),I=_(u,Y),e=u.control?.type===h.BUTTON&&!u.control?.buttonText?n.length?n:null:n,X={...u.control,...I,value:e},V={..._(u,N),type:t.CONTROL,value:"",control:X,controlId:o};u=U(V,{extraPickAttrs:i}),E=B}}if(u.controlComponent===F.PRETEXTFIX){const C=c(E+1,o,!0);if(C!==-1){const B=l(E+1,C-1,o),n=_(u,Y),I={...u.control,...n,value:B},a={..._(u,N),type:t.CONTROL,value:"",control:I,controlId:o};u=U(a,{extraPickAttrs:i}),E=C}}if(u.controlComponent===F.PRETEXTFIX_TEXT){const C=c(E+1,o,!0);if(C!==-1){const B=l(E+1,C-1,o),n=_(u,Y),I={...u.control,...n,value:B},a={..._(u,N),type:t.CONTROL,value:"",control:I,controlId:o};u=U(a,{extraPickAttrs:i}),E=C}}}}const L=U(u,{extraPickAttrs:i});if(!u.type||u.type===t.TEXT||u.type===t.SUBSCRIPT||u.type===t.SUPERSCRIPT)for(;E<s.length;){const o=s[E+1];if(E++,o&&iD(L,U(o,{extraPickAttrs:i}))){const A=o.value===y?`\n`:o.value;L.value+=A}else break}else E++;M.push(L)}return M}onmessage=D=>{const r=D.data,{options:i,data:T}=r,{extraPickAttrs:d=[]}=i||{},f={header:P(T.header,{extraPickAttrs:d,isClone:!1}),main:P(T.main,{extraPickAttrs:d,isClassifyArea:!0,isClone:!1}),footer:P(T.footer,{extraPickAttrs:d,isClone:!1})};postMessage(f)}})();\n',Bl=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",_l],{type:"text/javascript;charset=utf-8"});function LT(o){let t;try{if(t=Bl&&(self.URL||self.webkitURL).createObjectURL(Bl),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(_l),{name:o?.name})}}class PT{draw;wordCountWorker;catalogWorker;groupWorker;valueWorker;constructor(t){this.draw=t,this.wordCountWorker=new pT,this.catalogWorker=new IT,this.groupWorker=new ET,this.valueWorker=new LT}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=l=>{t(l.data)},this.catalogWorker.onerror=l=>{e(l)};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)})}getValue(t){return new Promise((e,n)=>{this.valueWorker.onmessage=i=>{e({version:Cn,data:i.data,options:rt(this.draw.getOptions())})},this.valueWorker.onerror=i=>{n(i)},this.valueWorker.postMessage({data:this.draw.getOriginValue(t),options:t})})}}class MT{container;canvas;draw;options;curElement;curElementSrc;previewerDrawOption;curPosition;eventBus;imageList;curShowElement;imageCount;imagePre;imageNext;resizerSelection;resizerHandleList;resizerImageContainer;resizerImage;resizerSize;width;height;mousedownX;mousedownY;curHandleIndex;previewerContainer;previewerImage;constructor(t){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,this.eventBus=t.getEventBus(),this.imageList=[],this.curShowElement=null,this.imageCount=null,this.imagePre=null,this.imageNext=null;const{resizerSelection:e,resizerHandleList:n,resizerImageContainer:i,resizerImage:l,resizerSize:r}=this._createResizerDom();this.resizerSelection=e,this.resizerHandleList=n,this.resizerImageContainer=i,this.resizerImage=l,this.resizerSize=r,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){const{scale:n}=this.options;let i=0,l=0;const r=this.draw.getHeight(),a=this.draw.getPageGap(),d=(e?.pageNo??this.draw.getPageNo())*(r+a);if(t.imgFloatPosition)i=t.imgFloatPosition.x*n,l=t.imgFloatPosition.y*n+d;else if(e){const{coordinate:{leftTop:[u,h]},ascent:R}=e;i=u,l=h+d+R}return{x:i,y:l}}_createResizerDom(){const{scale:t}=this.options,e=document.createElement("div");e.classList.add(`${st}-resizer-selection`),e.style.display="none",e.style.borderColor=this.options.resizerColor,e.style.borderWidth=`${t}px`;const n=[];for(let c=0;c<8;c++){const d=document.createElement("div");d.style.background=this.options.resizerColor,d.classList.add("resizer-handle"),d.classList.add(`handle-${c}`),d.setAttribute("data-index",String(c)),d.onmousedown=this._mousedown.bind(this),e.append(d),n.push(d)}this.container.append(e);const i=document.createElement("div");i.classList.add(`${st}-resizer-size-view`);const l=document.createElement("span");i.append(l),e.append(i);const r=document.createElement("div");r.classList.add(`${st}-resizer-image`),r.style.display="none";const a=document.createElement("img");return r.append(a),this.container.append(r),{resizerSelection:e,resizerHandleList:n,resizerImageContainer:r,resizerImage:a,resizerSize:l}}_keydown=()=>{this.resizerSelection.style.display==="block"&&(this.clearResizer(),document.removeEventListener("keydown",this._keydown))};_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:l,y:r}=this._getElementPosition(this.curElement,this.curPosition);this.resizerImageContainer.style.left=`${l}px`,this.resizerImageContainer.style.top=`${r}px`,this.resizerImage.style.width=`${this.curElement.width*e}px`,this.resizerImage.style.height=`${this.curElement.height*e}px`;const a=this._mousemove.bind(this);document.addEventListener("mousemove",a),document.addEventListener("mouseup",()=>{this.curElement&&!this.previewerDrawOption.dragDisable&&(this.curElement.width=this.width,this.curElement.height=this.height,this.draw.render({isSetCursor:!0,curIndex:this.curPosition?.index})),this.resizerImageContainer.style.display="none",document.removeEventListener("mousemove",a),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 d=this.mousedownX-t.x,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 1:i=this.mousedownY-t.y;break;case 2:{const d=t.x-this.mousedownX,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 4:{const d=t.x-this.mousedownX,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**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 d=this.mousedownX-t.x,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 7:n=this.mousedownX-t.x;break}const l=this.curElement.width+n/e,r=this.curElement.height+i/e;if(l<=0||r<=0)return;this.width=l,this.height=r;const a=l*e,c=r*e;this.resizerImage.style.width=`${a}px`,this.resizerImage.style.height=`${c}px`,this._updateResizerRect(a,c),this._updateResizerSizeView(a,c),t.preventDefault(),this.eventBus.isSubscribe("imageSizeChange")&&this.eventBus.emit("imageSizeChange",{element:this.curElement})}_drawPreviewer(){const t=document.createElement("div");t.classList.add(`${st}-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(`${st}-image-container`);const i=document.createElement("img");i.src=this.curElementSrc,i.draggable=!1,n.append(i),this.previewerImage=i,t.append(n);let l=0,r=0,a=1,c=0;const d=document.createElement("div");d.classList.add(`${st}-image-menu`);const u=document.createElement("div");u.classList.add("image-navigate");const h=document.createElement("i");h.classList.add("image-pre"),h.onclick=()=>{const P=this.imageList.findIndex(S=>S.id===this.curShowElement?.id);P<=0||(this.curShowElement=this.imageList[P-1],i.src=this.curShowElement.value,this._updateImageNavigate())},u.append(h),this.imagePre=h;const R=document.createElement("span");R.classList.add("image-count"),this.imageCount=R,u.append(R);const T=document.createElement("i");T.classList.add("image-next"),T.onclick=()=>{const P=this.imageList.findIndex(S=>S.id===this.curShowElement?.id);P>=this.imageList.length-1||(this.curShowElement=this.imageList[P+1],i.src=this.curShowElement.value,this._updateImageNavigate())},this.imageNext=T,u.append(T),d.append(u);const g=document.createElement("i");g.classList.add("zoom-in"),g.onclick=()=>{a+=.1,this._setPreviewerTransform(a,c,l,r)},d.append(g);const f=document.createElement("i");f.onclick=()=>{a-.1<=.1||(a-=.1,this._setPreviewerTransform(a,c,l,r))},f.classList.add("zoom-out"),d.append(f);const C=document.createElement("i");C.classList.add("rotate"),C.onclick=()=>{c+=1,this._setPreviewerTransform(a,c,l,r)},d.append(C);const p=document.createElement("i");p.classList.add("original-size"),p.onclick=()=>{l=0,r=0,a=1,c=0,this._setPreviewerTransform(a,c,l,r)},d.append(p);const I=document.createElement("i");I.classList.add("image-download"),I.onclick=()=>{const{mime:P}=this.previewerDrawOption;As(i.src,`${this.curElement?.id}.${P||"png"}`)},d.append(I),t.append(d),this.previewerContainer=t,document.body.append(t);let m=0,L=0,O=!1;i.onmousedown=P=>{O=!0,m=P.x,L=P.y,t.style.cursor="move"},t.onmousemove=P=>{O&&(l+=P.x-m,r+=P.y-L,m=P.x,L=P.y,this._setPreviewerTransform(a,c,l,r))},t.onmouseup=()=>{O=!1,t.style.cursor="auto"},t.onwheel=P=>{if(P.preventDefault(),P.stopPropagation(),P.deltaY<0)a+=.1;else{if(a-.1<=.1)return;a-=.1}this._setPreviewerTransform(a,c,l,r)},this._updateImageNavigate()}_updateImageNavigate(){const t=this.imageList.findIndex(e=>e.id===this.curShowElement?.id);this.imageCount.innerText=`${t+1} / ${this.imageList.length}`,t<=0?this.imagePre.classList.add("disabled"):this.imagePre.classList.remove("disabled"),t>=this.imageList.length-1?this.imageNext.classList.add("disabled"):this.imageNext.classList.remove("disabled")}_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(){this.previewerContainer?.remove(),this.previewerContainer=null,document.body.style.overflow="auto"}_updateResizerRect(t,e){const{resizerSize:n,scale:i}=this.options,l=this.draw.isReadonly();this.resizerSelection.style.width=`${t}px`,this.resizerSelection.style.height=`${e}px`;for(let r=0;r<8;r++){const a=r===0||r===6||r===7?-n:r===1||r===5?t/2:t-n,c=r===0||r===1||r===2?-n:r===3||r===7?e/2-n:e-n;this.resizerHandleList[r].style.transform=`scale(${i})`,this.resizerHandleList[r].style.left=`${a}px`,this.resizerHandleList[r].style.top=`${c}px`,this.resizerHandleList[r].style.display=l?"none":"block"}}_updateResizerSizeView(t,e){this.resizerSize.innerText=`${Math.round(t)} × ${Math.round(e)}`}render(){const t=this.draw.getMode();!this.curElement||this.curElement.imgToolDisabled&&!this.draw.isDesignMode()||t===s.EditorMode.PRINT&&this.options.modeRule[s.EditorMode.PRINT]?.imagePreviewerDisabled||t===s.EditorMode.COMPARE&&this.options.modeRule[s.EditorMode.COMPARE]?.imagePreviewerDisabled||t===s.EditorMode.READONLY&&this.options.modeRule[s.EditorMode.READONLY]?.imagePreviewerDisabled||(this.imageList=this.draw.getImageParticle().getOriginalMainImageList(),this.curShowElement=this.curElement,this._drawPreviewer(),document.body.style.overflow="hidden")}drawResizer(t,e=null,n={}){const i=this.draw.getMode();t.imgToolDisabled&&!this.draw.isDesignMode()||i===s.EditorMode.PRINT&&this.options.modeRule[s.EditorMode.PRINT]?.imagePreviewerDisabled||i===s.EditorMode.COMPARE&&this.options.modeRule[s.EditorMode.COMPARE]?.imagePreviewerDisabled||i===s.EditorMode.READONLY&&this.options.modeRule[s.EditorMode.READONLY]?.imagePreviewerDisabled||(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,l=t.height*n;this._updateResizerSizeView(i,l);const{x:r,y:a}=this._getElementPosition(t,e);this.resizerSelection.style.left=`${r}px`,this.resizerSelection.style.top=`${a}px`,this.resizerSelection.style.borderWidth=`${n}px`,this._updateResizerRect(i,l),this.resizerSelection.style.display="block",this.curElement=t,this.curPosition=e,this.width=i,this.height=l}clearResizer(){this.resizerSelection.style.display="none",document.removeEventListener("keydown",this._keydown)}}class OT{draw;range;datePicker;options;constructor(t){this.draw=t,this.options=t.getOptions(),this.range=t.getRange(),this.datePicker=new Nl(t,{onSubmit:this._setValue.bind(this)})}_setValue(t){if(!t)return;const e=this.getDateElementRange();if(!e)return;const[n,i]=e,l=this.draw.getElementList(),r=l[n+1];this.draw.spliceElementList(l,n+1,i-n),this.range.setRange(n,n);const a={type:s.ElementType.DATE,value:"",dateFormat:r.dateFormat,valueList:[{value:t}]};le(l,[a],n,{editorOptions:this.options}),this.draw.insertElementList([a])}getDateElementRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const l=this.draw.getElementList(),r=l[n];if(r.type!==s.ElementType.DATE)return null;let a=n;for(;a>=0;){if(l[a].dateId!==r.dateId){t=a;break}a--}let c=n+1;for(;c<l.length;){if(l[c].dateId!==r.dateId){e=c-1;break}c++}return c===l.length&&(e=c-1),!~t||!~e?null:[t,e]}clearDatePicker(){this.datePicker.dispose()}renderDatePicker(t,e){const n=this.draw.getElementList(),i=this.getDateElementRange(),l=i?n.slice(i[0]+1,i[1]+1).map(r=>r.value).join(""):"";this.datePicker.render({value:l,position:e,dateFormat:t.dateFormat})}}class kl{element;videoCache;constructor(t){this.element=t,this.videoCache=new Map}snapshot(t,e,n){return new Promise((i,l)=>{const r=this.element.block?.videoBlock?.src||"";if(this.videoCache.has(r)){const a=this.videoCache.get(r);t.drawImage(a,e,n,this.element.metrics.width,this.element.metrics.height),i(this.element)}else{const a=document.createElement("video");a.src=r,a.muted=!0,a.crossOrigin="anonymous",a.onloadeddata=()=>{t.drawImage(a,e,n,this.element.metrics.width,this.element.metrics.height),this.videoCache.set(r,a),i(this.element)},a.onerror=c=>{l(c)},a.play().then(()=>{a.pause()})}})}render(t){const e=this.element.block,n=document.createElement("video");n.style.width="100%",n.style.height="100%",n.style.objectFit="contain",n.src=e.videoBlock?.src||"",n.controls=!0,t.append(n)}}class ST{draw;options;element;block;blockContainer;blockItem;blockCache;resizerMask;resizerSelection;resizerHandleList;width;height;mousedownX;mousedownY;curHandleIndex;isAllowResize;constructor(t,e){this.draw=t.getDraw(),this.options=this.draw.getOptions(),this.blockContainer=t.getBlockContainer(),this.element=e,this.block=null;const{blockItem:n,resizerMask:i,resizerSelection:l,resizerHandleList:r}=this._createBlockItem();this.blockItem=n,this.blockContainer.append(this.blockItem),this.blockCache=new Map,this.resizerMask=i,this.resizerSelection=l,this.resizerHandleList=r,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.isAllowResize=!1}getBlockElement(){return this.element}getBlockWidth(){return this.element.width||this.element.metrics.width}_createBlockItem(){const{scale:t,resizerColor:e}=this.options,n=document.createElement("div");n.classList.add(`${st}-block-item`);const i=document.createElement("div");i.style.display="none",i.classList.add(`${st}-resizer-selection`),i.style.borderColor=e,i.style.borderWidth=`${t}px`;const l=[];for(let a=0;a<8;a++){const c=document.createElement("div");c.style.background=e,c.classList.add("resizer-handle"),c.classList.add(`handle-${a}`),c.setAttribute("data-index",String(a)),c.onmousedown=this._mousedown.bind(this),i.append(c),l.push(c)}const r=document.createElement("div");return r.classList.add(`${st}-resizer-mask`),r.style.display="none",n.append(r),n.onmouseenter=()=>{if(this.draw.isReadonly())return;const{width:c,height:d}=this.element.metrics;this._updateResizerRect(c,d),i.style.display="block"},n.onmouseleave=()=>{this.isAllowResize||(i.style.display="none")},n.append(i),{blockItem:n,resizerMask:r,resizerSelection:i,resizerHandleList:l}}_updateResizerRect(t,e){const{resizerSize:n,scale:i}=this.options;this.resizerSelection.style.width=`${t}px`,this.resizerSelection.style.height=`${e}px`;for(let l=0;l<8;l++){const r=l===0||l===6||l===7?-n:l===1||l===5?t/2:t-n,a=l===0||l===1||l===2?-n:l===3||l===7?e/2-n:e-n;this.resizerHandleList[l].style.transform=`scale(${i})`,this.resizerHandleList[l].style.left=`${r}px`,this.resizerHandleList[l].style.top=`${a}px`}}_mousedown(t){const e=this.draw.getPage();this.mousedownX=t.x,this.mousedownY=t.y,this.isAllowResize=!0;const n=t.target;this.curHandleIndex=Number(n.dataset.index),this.resizerMask.style.display="block";const i=window.getComputedStyle(n).cursor;document.body.style.cursor=i,e.style.cursor=i;const l=this._mousemove.bind(this);document.addEventListener("mousemove",l),document.addEventListener("mouseup",()=>{this.element.width=Math.min(this.width,this.draw.getInnerWidth()),this.element.height=this.height,this.isAllowResize=!1,this.resizerSelection.style.display="none",this.resizerMask.style.display="none",document.removeEventListener("mousemove",l),document.body.style.cursor="",e.style.cursor="text",this.draw.render()},{once:!0}),t.preventDefault()}_mousemove(t){if(!this.isAllowResize)return;const{scale:e}=this.options;let n=0,i=0;switch(this.curHandleIndex){case 0:{const d=this.mousedownX-t.x,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 1:i=this.mousedownY-t.y;break;case 2:{const d=t.x-this.mousedownX,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 4:{const d=t.x-this.mousedownX,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 3:n=t.x-this.mousedownX;break;case 5:i=t.y-this.mousedownY;break;case 6:{const d=this.mousedownX-t.x,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 7:n=this.mousedownX-t.x;break}const l=this.getBlockWidth()+n/e,r=this.element.height+i/e;if(l<=0||r<=0)return;this.width=l,this.height=r;const a=l*e,c=r*e;this._updateResizerRect(a,c),this.blockItem.style.width=`${a}px`,this.blockItem.style.height=`${c}px`,t.preventDefault()}snapshot(t,e,n){if(this.element.block.type===s.BlockType.VIDEO)if(this.blockItem.style.display="none",this.blockCache.has(this.element.id))this.blockCache.get(this.element.id).snapshot(t,e,n);else{this.block=new kl(this.element);const l=this.block.snapshot(t,e,n);this.draw.getImageObserver().add(l),this.blockCache.set(this.element.id,this.block)}}render(){const t=this.element.block;t.type===s.BlockType.IFRAME?(this.block=new Un(this.element),this.block.render(this.blockItem)):t.type===s.BlockType.VIDEO&&(this.block=new kl(this.element),this.block.render(this.blockItem))}setClientRects(t,e,n){const i=this.draw.getHeight(),l=this.draw.getPageGap(),r=t*(i+l),{metrics:a}=this.element;this.blockItem.style.display="block",this.blockItem.style.width=`${a.width}px`,this.blockItem.style.height=`${a.height}px`,this.blockItem.style.left=`${e}px`,this.blockItem.style.top=`${r+n}px`}remove(){this.blockItem.remove()}}class DT{draw;container;blockContainer;blockMap;constructor(t){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(`${st}-block-container`),t}getDraw(){return this.draw}getBlockContainer(){return this.blockContainer}render(t,e,n,i,l){const r=n.id;let a=this.blockMap.get(r);a||(a=new ST(this,n),a.render(),this.blockMap.set(r,a)),this.draw.isPrintLikeMode()?a.snapshot(t,i,l):a.setClientRects(e,i,l)}clear(){if(!this.blockMap.size)return;const t=this.draw.getOriginalMainElementList(),e=[];for(let n=0;n<t.length;n++){const i=t[n];i.type===s.ElementType.BLOCK&&e.push(i.id)}this.blockMap.forEach(n=>{const i=n.getBlockElement().id;e.includes(i)||(n.remove(),this.blockMap.delete(i))})}}const Ys={contextmenu:{global:{cut:"剪切",copy:"复制",paste:"粘贴",selectAll:"全选",print:"打印",cancel:"取消"},control:{delete:"删除控件",editAttribute:"修改元素配置",addExpression:"添加表达式",addMenstrualHistory:"月经史",addFetalHeartPosition:"胎心位置"},hyperlink:{delete:"删除链接",cancel:"取消链接",edit:"编辑链接"},image:{change:"更改图片",saveAs:"另存为图片",textWrap:"文字环绕",textWrapType:{embed:"嵌入型",upDown:"上下型环绕",surround:"四周型环绕",floatTop:"浮于文字上方",floatBottom:"衬于文字下方"}},table:{insertRowCol:"插入行列",insertTopRow:"上方插入1行",insertBottomRow:"下方插入1行",insertLeftCol:"左侧插入1列",insertRightCol:"右侧插入1列",deleteRowCol:"删除行列",deleteRow:"删除1行",deleteCol:"删除1列",deleteTable:"删除整个表格",mergeCell:"合并单元格",mergeCancelCell:"取消合并",verticalAlign:"垂直对齐",verticalAlignTop:"顶端对齐",verticalAlignMiddle:"垂直居中",verticalAlignBottom:"底端对齐",border:"表格边框",borderAll:"所有框线",borderEmpty:"无框线",borderDash:"虚框线",borderExternal:"外侧框线",borderInternal:"内侧框线",borderTd:"单元格边框",borderTdTop:"上边框",borderTdRight:"右边框",borderTdBottom:"下边框",borderTdLeft:"左边框",borderTdForward:"正斜线",borderTdBack:"反斜线",tableProperties:"表格属性"}},datePicker:{now:"此刻",confirm:"确定",return:"返回日期",timeSelect:"时间选择",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},year:"年",month:"月",hour:"时",minute:"分",second:"秒"},select:{search:"搜索选项",empty:"无匹配项"},frame:{header:"页眉",footer:"页脚"},pageBreak:{displayName:"分页符"},zone:{headerTip:"双击编辑页眉",footerTip:"双击编辑页脚"}},FT={contextmenu:{global:{cut:"Cut",copy:"Copy",paste:"Paste",selectAll:"Select all",print:"Print",cancel:"Cancel"},control:{delete:"Delete control",editAttribute:"Edit element config",addExpression:"Add expression",addMenstrualHistory:"Menstrual History",addFetalHeartPosition:"Fetal Heart Position"},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",tableProperties:"Table Properties"}},datePicker:{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"},select:{search:"Search options",empty:"No matching options"},frame:{header:"Header",footer:"Footer"},pageBreak:{displayName:"Page Break"},zone:{headerTip:"Double click to edit header",footerTip:"Double click to edit footer"}};class XT{currentLocale;langMap=new Map([["zhCN",Ys],["en",FT]]);constructor(t){this.currentLocale=t}registerLangMap(t,e){const n=this.langMap.get(t);this.langMap.set(t,_s(n||Ys,e))}getLocale(){return this.currentLocale}setLocale(t){this.currentLocale=t}getLang(){return this.langMap.get(this.currentLocale)||Ys}t(t){const e=t.split(".");let n="",i=this.getLang();for(let l=0;l<e.length;l++){const r=e[l],a=Reflect.get(i,r);if(a)n=i=a;else return""}return n}}class yT{promiseList;constructor(){this.promiseList=[]}add(t){this.promiseList.push(t)}clearAll(){this.promiseList=[]}allSettled(){return Promise.allSettled(this.promiseList)}}class NT{draw;zone;i18n;container;pageContainer;isDisableMouseMove;tipContainer;tipContent;currentMoveZone;constructor(t,e){this.draw=t,this.zone=e,this.i18n=t.getI18n(),this.container=t.getContainer(),this.pageContainer=t.getPageContainer();const{tipContainer:n,tipContent:i}=this._drawZoneTip();this.tipContainer=n,this.tipContent=i,this.isDisableMouseMove=!0,this.currentMoveZone=s.EditorZone.MAIN;const l=[],{header:r,footer:a}=t.getOptions();r.disabled||l.push(s.EditorZone.HEADER),a.disabled||l.push(s.EditorZone.FOOTER),l.length&&this._watchMouseMoveZoneChange(l)}_watchMouseMoveZoneChange(t){this.pageContainer.addEventListener("mousemove",Ca(e=>{if(!(this.isDisableMouseMove||!this.draw.getIsPagingMode())){if(this.draw.getMode()!==s.EditorMode.EDIT){this._updateZoneTip(!1);return}if(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()===s.EditorZone.MAIN&&(n===s.EditorZone.HEADER||n===s.EditorZone.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(`${st}-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===s.EditorZone.HEADER?"headerTip":"footerTip"}`)):this.tipContainer.classList.remove("show")}}class bT{INDICATOR_PADDING=2;INDICATOR_TITLE_TRANSLATE=[20,5];draw;options;i18n;container;currentZone;indicatorContainer;constructor(t){this.draw=t,this.i18n=t.getI18n(),this.options=t.getOptions(),this.container=t.getContainer(),this.currentZone=s.EditorZone.MAIN,this.indicatorContainer=null,this.options.zone.tipDisabled||new NT(t,this)}isHeaderActive(){return this.getZone()===s.EditorZone.HEADER}isMainActive(){return this.getZone()===s.EditorZone.MAIN}isFooterActive(){return this.getZone()===s.EditorZone.FOOTER}getZone(){return this.currentZone}setZone(t){const{header:e,footer:n}=this.options;!e.editable&&t===s.EditorZone.HEADER||!n.editable&&t===s.EditorZone.FOOTER||this.currentZone!==t&&(this.currentZone=t,this.draw.getRange().clearRange(),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),this.drawZoneIndicator(),Li(()=>{const i=this.draw.getListener();i.zoneChange&&i.zoneChange(t);const l=this.draw.getEventBus();l.isSubscribe("zoneChange")&&l.emit("zoneChange",t)}))}getZoneByY(t){const e=this.draw.getHeader(),n=e.getHeaderTop()+e.getHeight(),i=this.draw.getFooter(),r=this.draw.getHeight()-(i.getFooterBottom()+i.getHeight());return t<n?s.EditorZone.HEADER:t>r?s.EditorZone.FOOTER:s.EditorZone.MAIN}drawZoneIndicator(){if(this._clearZoneIndicator(),!this.isHeaderActive()&&!this.isFooterActive())return;const{scale:t}=this.options,e=this.isHeaderActive(),[n,i]=this.INDICATOR_TITLE_TRANSLATE,l=this.draw.getPageList(),r=this.draw.getMargins(),a=this.draw.getInnerWidth(),c=this.draw.getHeight(),d=this.draw.getPageGap(),u=c+d;this.indicatorContainer=document.createElement("div"),this.indicatorContainer.classList.add(`${st}-zone-indicator`);const h=this.draw.getHeader(),R=this.draw.getFooter(),T=e?h.getHeight():R.getHeight(),g=e?h.getHeaderTop():c-R.getFooterBottom()-T;for(let f=0;f<l.length;f++){const C=u*f+g,p=r[3]-this.INDICATOR_PADDING,I=r[3]+a+this.INDICATOR_PADDING,m=e?C-this.INDICATOR_PADDING:C+T+this.INDICATOR_PADDING,L=e?C+T+this.INDICATOR_PADDING:C-this.INDICATOR_PADDING,O=document.createElement("div");O.innerText=this.i18n.t(`frame.${e?"header":"footer"}`),O.style.top=`${L}px`,O.style.transform=`translate(${n*t}px, ${i*t}px) scale(${t})`,this.indicatorContainer.append(O);const P=document.createElement("span");P.classList.add(`${st}-zone-indicator-border__top`),P.style.top=`${m}px`,P.style.width=`${a}px`,P.style.marginLeft=`${r[3]}px`,this.indicatorContainer.append(P);const S=document.createElement("span");S.classList.add(`${st}-zone-indicator-border__left`),S.style.top=`${C}px`,S.style.height=`${T}px`,S.style.left=`${p}px`,this.indicatorContainer.append(S);const y=document.createElement("span");y.classList.add(`${st}-zone-indicator-border__bottom`),y.style.top=`${L}px`,this.indicatorContainer.append(y);const Y=document.createElement("span");Y.classList.add(`${st}-zone-indicator-border__right`),Y.style.top=`${C}px`,Y.style.height=`${T}px`,Y.style.left=`${I}px`,this.indicatorContainer.append(Y)}this.container.append(this.indicatorContainer)}_clearZoneIndicator(){this.indicatorContainer?.remove(),this.indicatorContainer=null}}class VT{draw;position;zone;options;elementList;rowList;positionList;constructor(t,e){this.draw=t,this.position=t.getPosition(),this.zone=t.getZone(),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();this.rowList=this.draw.computeRowList({innerWidth:t,elementList:this.elementList})}_computePositionList(){const t=this.getFooterBottom(),e=this.draw.getInnerWidth(),i=this.draw.getMargins()[3],l=this.draw.getHeight(),r=this.getHeight(),a=l-t-r;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:a,innerWidth:e,zone:s.EditorZone.FOOTER})}getFooterBottom(){const{footer:{bottom:t,disabled:e},scale:n}=this.options;return e?0:Math.floor(t*n)}getMaxHeight(){const{footer:{maxHeightRadio:t}}=this.options,e=this.draw.getHeight();return Math.floor(e*Ks[t])}getHeight(){if(this.options.footer.disabled)return 0;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.getFooterBottom()+e-t[2];return i<=0?0:i}render(t,e){t.save(),t.globalAlpha=this.zone.isFooterActive()?1:this.options.footer.inactiveAlpha;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),l=[];let r=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(r+c.height>i)break;l.push(c),r+=c.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:l,pageNo:e,startIndex:0,innerWidth:n,zone:s.EditorZone.FOOTER}),t.restore()}}class WT{draw;range;options;UN_COUNT_STYLE_WIDTH=20;MEASURE_BASE_TEXT="0";LIST_GAP=10;constructor(t){this.draw=t,this.range=t.getRange(),this.options=t.getOptions()}setList(t,e){if(this.draw.isReadonly())return;const{startIndex:i,endIndex:l}=this.range.getRange();if(!~i&&!~l)return;const r=this.range.getRangeParagraphElementList();if(!r||!r.length)return;if(r.find(h=>h.listType===t&&h.listStyle===e)||!t){this.unsetList();return}const c=ft();r.forEach(h=>{h.listId=c,h.listType=t,h.listStyle=e});const d=i===l,u=d?l:i;this.draw.render({curIndex:u,isSetCursor:d})}unsetList(){if(this.draw.isReadonly())return;const{startIndex:e,endIndex:n}=this.range.getRange();if(!~e&&!~n)return;const i=this.range.getRangeParagraphElementList()?.filter(d=>d.listId);if(!i||!i.length)return;const l=this.draw.getElementList(),r=l[n];if(r.listId){let d=n+1;for(;d<l.length;){const u=l[d];if(u.value===_&&!u.listWrap)break;if(u.listId!==r.listId){this.draw.spliceElementList(l,d,0,[{value:_}]);break}d++}}i.forEach(d=>{delete d.listId,delete d.listType,delete d.listStyle,delete d.listWrap});const a=e===n,c=a?n:e;this.draw.render({curIndex:c,isSetCursor:a})}computeListStyle(t,e){const n=new Map;let i=0,l=e[i]?.listId,r=[];const a=e.length;for(;i<a;){const c=e[i];if(l&&l===c.listId)r.push(c);else if(c.listId&&c.listId!==l){if(r.length){const d=this.getListStyleWidth(t,r);n.set(l,d)}l=c.listId,r=l?[c]:[]}i++}if(r.length){const c=this.getListStyleWidth(t,r);n.set(l,c)}return n}findStyledElement(t){let e=t[0];for(let n=1;n<t.length;n++){const i=t[n];if(i.font||i.size||i.bold||i.italic){e=i;break}}return e}getListFontStyle(t,e){if(this.options.list.inheritStyle){const n=this.findStyledElement(t);return this.draw.getElementFont(n,e)}else{const{defaultFont:n,defaultSize:i}=this.options;return`${i*e}px ${n}`}}getListStyleWidth(t,e){const{scale:n,checkbox:i}=this.options,l=e[0];if(l.listStyle&&l.listStyle!==s.ListStyle.DECIMAL)return l.listStyle===s.ListStyle.CHECKBOX?(i.width+this.LIST_GAP)*n:this.UN_COUNT_STYLE_WIDTH*n;const r=e.reduce((d,u)=>(u.value===_&&(d+=1),d),0);if(!r)return 0;t.save(),t.font=this.getListFontStyle(e,n);const a=`${this.MEASURE_BASE_TEXT.repeat(String(r).length)}${s.KeyMap.PERIOD}`,c=t.measureText(a);return t.restore(),Math.ceil((c.width+this.LIST_GAP)*n)}drawListStyle(t,e,n){const{elementList:i,offsetX:l,listIndex:r,ascent:a}=e,c=i[0];if(c.value!==_||c.listWrap)return;let d=0;const{defaultTabWidth:u,scale:h}=this.options;for(let C=1;C<i.length&&i[C]?.type===s.ElementType.TAB;C++)d+=u*h;const{coordinate:{leftTop:[R,T]}}=n,g=R-l+d,f=T+a;if(c.listStyle===s.ListStyle.CHECKBOX){const{width:C,height:p,gap:I}=this.options.checkbox,m={...c,checkbox:{value:!!c.checkbox?.value},metrics:{...c.metrics,width:(C+I*2)*h,height:p*h}};this.draw.getCheckboxParticle().render({ctx:t,x:g-I*h,y:f,index:0,row:{...e,elementList:[m,...e.elementList]}})}else{let C="";if(c.listType===s.ListType.UL?C=yi[c.listStyle]||yi[En.DISC]:C=`${r+1}${s.KeyMap.PERIOD}`,!C)return;t.save(),t.font=this.getListFontStyle(i,h),t.fillText(C,g,f),t.restore()}}}class Po{options;static WIDTH=12;static HEIGHT=9;static GAP=3;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:l,lineBreak:{color:r,lineWidth:a}}=this.options;t.save(),t.beginPath();const c=i-Po.HEIGHT*l/2,d=n+e.metrics.width;t.translate(d,c),t.scale(l,l),t.strokeStyle=r,t.lineWidth=a,t.lineCap="round",t.lineJoin="round",t.beginPath(),t.moveTo(8,0),t.lineTo(12,0),t.lineTo(12,6),t.lineTo(3,6),t.moveTo(3,6),t.lineTo(6,3),t.moveTo(3,6),t.lineTo(6,9),t.stroke(),t.closePath(),t.restore()}}class Gl{draw;position;options;elementList;rowList;positionList;constructor(t){this.draw=t,this.position=t.getPosition(),this.options=t.getOptions(),this.elementList=[],this.rowList=[],this.positionList=[]}_recovery(){this.elementList=[],this.rowList=[],this.positionList=[]}_compute(t){this._computeRowList(),this._computePositionList(t)}_computeRowList(){const t=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:t,elementList:this.elementList})}_computePositionList(t){const{lineBreak:e,scale:n}=this.options,i=this.draw.getHeader().getExtraHeight(),l=this.draw.getInnerWidth(),r=this.draw.getMargins();let a=r[3];e.disabled||(a+=(Po.WIDTH+Po.GAP)*n);const c=t?.startY||r[0]+i;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:a,startY:c,innerWidth:l})}render(t,e){const{placeholder:n=this.options.placeholder}=e||{},{data:i,font:l,size:r,color:a,opacity:c}=n;this._recovery(),this.elementList=[{value:i,font:l,size:r,color:a}],ee(this.elementList,{editorOptions:this.options,isForceCompensation:!0}),this._compute(e);const d=this.draw.getInnerWidth();t.save(),t.globalAlpha=c,this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:this.rowList,pageNo:0,startIndex:0,innerWidth:d,isDrawLineBreak:!1}),t.restore()}}class UT{draw;options;range;fillRectMap;constructor(t){this.draw=t,this.options=t.getOptions(),this.range=t.getRange(),this.fillRectMap=new Map}setGroup(){if(this.draw.isReadonly()||this.draw.getZone().getZone()!==s.EditorZone.MAIN)return null;const t=this.range.getSelection();if(!t)return null;const e=ft();return t.forEach(n=>{Array.isArray(n.groupIds)||(n.groupIds=[]),n.groupIds.push(e)}),this.draw.render({isSetCursor:!1,isCompute:!1}),e}getElementListByGroupId(t,e){const n=[];for(let i=0;i<t.length;i++){const l=t[i];if(l.type===s.ElementType.TABLE){const r=l.trList;for(let a=0;a<r.length;a++){const c=r[a];for(let d=0;d<c.tdList.length;d++){const u=c.tdList[d],h=this.getElementListByGroupId(u.value,e);if(h.length)return n.push(...h),n}}}if(l?.groupIds?.includes(e)&&(n.push(l),!t[i+1]?.groupIds?.includes(e)))break}return n}deleteGroup(t){if(this.draw.isReadonly())return;const e=this.draw.getOriginalMainElementList(),n=this.getElementListByGroupId(e,t);if(n.length){for(let i=0;i<n.length;i++){const l=n[i],r=l.groupIds,a=r.findIndex(c=>c===t);r.splice(a,1),r.length||delete l.groupIds}this.draw.render({isSetCursor:!1,isCompute:!1})}}getContextByGroupId(t,e){for(let n=0;n<t.length;n++){const i=t[n];if(i.type===s.ElementType.TABLE){const r=i.trList;for(let a=0;a<r.length;a++){const c=r[a];for(let d=0;d<c.tdList.length;d++){const u=c.tdList[d],h=this.getContextByGroupId(u.value,e);if(h)return{...h,isTable:!0,index:n,trIndex:a,tdIndex:d,tdId:u.id,trId:c.id,tableId:i.tableId}}}}const l=t[n+1];if(i.groupIds?.includes(e)&&!l?.groupIds?.includes(e))return{isTable:!1,startIndex:n,endIndex:n}}return null}clearFillInfo(){this.fillRectMap.clear()}recordFillInfo(t,e,n,i,l){const r=t.groupIds;if(r)for(const a of r){const c=this.fillRectMap.get(a);c?c.width+=i:this.fillRectMap.set(a,{x:e,y:n,width:i,height:l})}}render(t){if(!this.fillRectMap.size)return;const e=this.range.getRange(),i=this.draw.getElementList()[e.endIndex]?.groupIds,{group:{backgroundColor:l,opacity:r,activeOpacity:a,activeBackgroundColor:c}}=this.options;t.save(),this.fillRectMap.forEach((d,u)=>{const{x:h,y:R,width:T,height:g}=d;i?.includes(u)?(t.globalAlpha=a,t.fillStyle=c):(t.globalAlpha=r,t.fillStyle=l),t.fillRect(h,R,T,g)}),t.restore(),this.clearFillInfo()}}class YT{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:l,whiteSpace:{color:r,radius:a}}=this.options,c=e.metrics;t.save(),t.fillStyle=r,t.beginPath(),t.arc(n+c.width/2,i,a*l,0,Math.PI*2),t.fill(),t.closePath(),t.restore()}}class wT{draw;eventBus;pageContainer;constructor(t){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)),this.pageContainer.addEventListener("mousedown",this._mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this._mouseup.bind(this)),this.pageContainer.addEventListener("click",this._click.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)}_mousedown(t){this.eventBus.isSubscribe("mousedown")&&this.eventBus.emit("mousedown",t)}_mouseup(t){this.eventBus.isSubscribe("mouseup")&&this.eventBus.emit("mouseup",t)}_click(t){this.eventBus.isSubscribe("click")&&this.eventBus.emit("click",t)}}class vT{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e){const{scale:n,lineNumber:{color:i,size:l,font:r,right:a,type:c}}=this.options,d=this.draw.getTextParticle(),u=this.draw.getMargins(),h=this.draw.getPosition().getOriginalMainPositionList(),T=this.draw.getPageRowList()[e];t.save(),t.fillStyle=i,t.font=`${l*n}px ${r}`;for(let g=0;g<T.length;g++){const f=T[g],{coordinate:{leftBottom:C}}=h[f.startIndex],p=c===s.LineNumberType.PAGE?g+1:f.rowIndex+1,I=d.measureText(t,{value:`${p}`}),m=u[3]-(I.width+a)*n,L=C[1]-I.actualBoundingBoxAscent*n;t.fillText(`${p}`,m,L)}t.restore()}}class ZT{draw;header;footer;options;constructor(t){this.draw=t,this.header=t.getHeader(),this.footer=t.getFooter(),this.options=t.getOptions()}render(t){const{scale:e,pageBorder:{color:n,lineWidth:i,padding:l}}=this.options;t.save(),t.translate(.5,.5),t.strokeStyle=n,t.lineWidth=i*e;const r=this.draw.getMargins(),a=r[3]-l[3]*e,c=r[0]+this.header.getExtraHeight()-l[0]*e,d=this.draw.getInnerWidth()+(l[1]+l[3])*e,u=this.draw.getHeight()-c-this.footer.getExtraHeight()-r[2]+l[2]*e;t.rect(a,c,d,u),t.stroke(),t.restore()}}function QT(o,t){const{value:e,oldValue:n}=t;n.isTable&&!e.isTable&&o.getTableTool().dispose()}class KT{draw;eventBus;constructor(t){this.draw=t,this.eventBus=t.getEventBus(),this.execute()}execute(){this.eventBus.on("positionContextChange",t=>{QT(this.draw,t)})}}class HT{draw;range;position;tableTool;tableParticle;options;constructor(t){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,n=!1){const{startIndex:i,endIndex:l}=this.range.getRange();if(!~i&&!~l)return;const{defaultTrMinHeight:r}=this.options.table,a=this.draw.getElementList();let c=0;if(a[i]?.listId){const f=this.position.getPositionList(),{rowIndex:C}=f[i];c=this.draw.getRowList()[C]?.offsetX||0}const d=this.draw.getContextInnerWidth()-c,u=[],h=d/e;for(let f=0;f<e;f++)u.push({width:h});const R=[];for(let f=0;f<t;f++){const C=[],p={height:r,tdList:C};for(let I=0;I<e;I++)C.push({colspan:1,rowspan:1,value:[]});R.push(p)}const T={type:s.ElementType.TABLE,value:"",tableEditable:n,colgroup:u,trList:R};ee([T],{editorOptions:this.options}),le(a,[T],i,{editorOptions:this.options});const g=i+1;this.draw.spliceElementList(a,g,i===l?0:l-i,[T]),this.range.setRange(g,g),this.draw.render({curIndex:g,isSetCursor:!1})}insertTableTopRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tableId:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=a[n];if(c.tdList.length<r.colgroup.length){const h=c.tdList[0].rowIndex;for(let R=0;R<n;R++){const T=a[R];for(let g=0;g<T.tdList.length;g++){const f=T.tdList[g];f.rowspan>1&&f.rowIndex+f.rowspan>=h+1&&(f.rowspan+=1)}}}const d=ft(),u={height:c.height,id:d,tdList:[]};for(let h=0;h<c.tdList.length;h++){const R=c.tdList[h],T=ft();u.tdList.push({id:T,rowspan:1,colspan:R.colspan,value:[{value:_,size:16,tableId:i,trId:d,tdId:T}]})}a.splice(n,0,u),this.position.setPositionContext({isTable:!0,index:e,trIndex:n,tdIndex:0,tdId:u.tdList[0].id,trId:u.id,tableId:i}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableBottomRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tableId:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=a[n],d=a.length-1===n?c:a[n+1];if(d.tdList.length<r.colgroup.length){const R=d.tdList[0].rowIndex;for(let T=0;T<n+1;T++){const g=a[T];for(let f=0;f<g.tdList.length;f++){const C=g.tdList[f];C.rowspan>1&&C.rowIndex+C.rowspan>=R+1&&(C.rowspan+=1)}}}const u=ft(),h={height:d.height,id:u,tdList:[]};for(let R=0;R<d.tdList.length;R++){const T=d.tdList[R],g=ft();h.tdList.push({id:g,rowspan:1,colspan:T.colspan,value:[{value:_,size:16,tableId:i,trId:u,tdId:g}]})}a.splice(n+1,0,h),this.position.setPositionContext({isTable:!0,index:e,trIndex:n+1,tdIndex:0,tdId:h.tdList[0].id,trId:h.id,tableId:r.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}adjustColWidth(t){if(t.type!==s.ElementType.TABLE)return;const{defaultColMinWidth:e}=this.options.table,n=t.colgroup,i=n.reduce((r,a)=>r+a.width,0),l=this.draw.getOriginalInnerWidth();if(i>l){const r=n.filter(c=>c.width>e),a=(i-l)/r.length;for(let c=0;c<n.length;c++){const d=n[c];d.width-a>=e&&(d.width-=a)}}}insertTableLeftCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,tableId:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=n;for(let h=0;h<a.length;h++){const R=a[h],T=ft();R.tdList.splice(c,0,{id:T,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:i,trId:R.id,tdId:T}]})}const{defaultColMinWidth:d}=this.options.table;r.colgroup.splice(c,0,{width:d}),this.adjustColWidth(r),this.position.setPositionContext({isTable:!0,index:e,trIndex:0,tdIndex:c,tdId:a[0].tdList[c].id,trId:a[0].id,tableId:i}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableRightCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,tableId:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=n+1;for(let h=0;h<a.length;h++){const R=a[h],T=ft();R.tdList.splice(c,0,{id:T,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:i,trId:R.id,tdId:T}]})}const{defaultColMinWidth:d}=this.options.table;r.colgroup.splice(c,0,{width:d}),this.adjustColWidth(r),this.position.setPositionContext({isTable:!0,index:e,trIndex:0,tdIndex:c,tdId:a[0].tdList[c].id,trId:a[0].id,tableId:r.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}deleteTableRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tdIndex:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=a[n],d=c.tdList[i].rowIndex;if(a.length<=1&&r.pagingIndex===0){this.deleteTable();return}for(let u=0;u<d;u++){const R=a[u].tdList;for(let T=0;T<R.length;T++){const g=R[T];g.rowIndex+g.rowspan>d&&g.rowspan--}}for(let u=0;u<c.tdList.length;u++){const h=c.tdList[u];if(h.rowspan>1){const R=ft(),T=a[n+1];T.tdList.splice(u,0,{id:R,rowspan:h.rowspan-1,colspan:h.colspan,value:[{value:_,size:16,tableId:r.id,trId:T.id,tdId:R}]})}}a.splice(n,1),this.position.setPositionContext({isTable:!1}),this.range.clearRange(),this.draw.render({curIndex:t.index}),this.tableTool.dispose()}deleteTableCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,trIndex:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,d=a[i].tdList[n].colIndex;if(!a.find(h=>h.tdList.length>1)){this.deleteTable();return}for(let h=0;h<a.length;h++){const R=a[h];for(let T=0;T<R.tdList.length;T++){const g=R.tdList[T];g.colIndex<=d&&g.colIndex+g.colspan>d&&(g.colspan>1?g.colspan--:R.tdList.splice(T,1))}}r.colgroup?.splice(d,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;const e=this.draw.getOriginalElementList(),n=e[t.index];let i=1,l=t.index;if(n.pagingId){l=t.index-n.pagingIndex;for(let a=l+1;a<e.length&&e[a].pagingId===n.pagingId;a++)i++}e.splice(l,i);const r=l-1;this.position.setPositionContext({isTable:!1,index:r}),this.range.setRange(r,r),this.draw.render({curIndex:r}),this.tableTool.dispose()}mergeTableCell(){const t=this.position.getPositionContext();if(!t.isTable)return;const{isCrossRowCol:e,startTdIndex:n,endTdIndex:i,startTrIndex:l,endTrIndex:r}=this.range.getRange();if(!e)return;const{index:a}=t,u=this.draw.getOriginalElementList()[a].trList;let h=u[l].tdList[n],R=u[r].tdList[i];(h.x>R.x||h.y>R.y)&&([h,R]=[R,h]);const T=h.colIndex,g=R.colIndex+(R.colspan-1),f=h.rowIndex,C=R.rowIndex+(R.rowspan-1),p=[];for(let N=0;N<u.length;N++){const X=u[N],D=[];for(let E=0;E<X.tdList.length;E++){const U=X.tdList[E],F=U.colIndex,Z=U.rowIndex;F>=T&&F<=g&&Z>=f&&Z<=C&&D.push(U)}D.length&&p.push(D)}if(!p.length)return;const I=p[p.length-1],m=p[0][0],L=I[I.length-1],O=m.x,P=m.y,S=L.x+L.width,y=L.y+L.height;for(let N=0;N<p.length;N++){const X=p[N];for(let D=0;D<X.length;D++){const E=X[D],U=E.x,F=E.y,Z=U+E.width,Q=F+E.height;if(O>U||P>F||S<Z||y<Q)return}}const Y=[],b=p[0][0],M=b.value[0];for(let N=0;N<p.length;N++){const X=p[N];for(let D=0;D<X.length;D++){const E=X[D];if(!(N===0&&D===0)){Y.push(E.id);const F=E.value.length>1?0:1;for(let Z=F;Z<E.value.length;Z++){const Q=E.value[Z];dn(In,M,Q),b.value.push(Q)}}N===0&&D!==0&&(b.colspan+=E.colspan),N!==0&&b.colIndex===E.colIndex&&(b.rowspan+=E.rowspan)}}for(let N=0;N<u.length;N++){const X=u[N];let D=0;for(;D<X.tdList.length;){const E=X.tdList[D];Y.includes(E.id)&&(X.tdList.splice(D,1),D--),D++}}this.position.setPositionContext({...t,trIndex:b.trIndex,tdIndex:b.tdIndex});const V=b.value.length-1;this.range.setRange(V,V),this.draw.render(),this.tableTool.render()}cancelMergeTableCell(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,trIndex:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=a[i],d=c.tdList[n];if(d.rowspan===1&&d.colspan===1)return;const u=d.colspan;if(d.colspan>1){for(let R=1;R<d.colspan;R++){const T=ft();c.tdList.splice(n+R,0,{id:T,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:r.id,trId:c.id,tdId:T}]})}d.colspan=1}if(d.rowspan>1){for(let R=1;R<d.rowspan;R++){const T=a[i+R];for(let g=0;g<u;g++){const f=ft();T.tdList.splice(d.colIndex,0,{id:f,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:r.id,trId:T.id,tdId:f}]})}}d.rowspan=1}const h=d.value.length-1;this.range.setRange(h,h),this.draw.render(),this.tableTool.render()}splitVerticalTableCell(){const t=this.position.getPositionContext();if(!t.isTable||this.range.getRange().isCrossRowCol)return;const{index:n,tdIndex:i,trIndex:l}=t,a=this.draw.getOriginalElementList()[n],c=a.trList,d=c[l],u=d.tdList[i];a.colgroup.splice(i+1,0,{width:this.options.table.defaultColMinWidth});for(let h=0;h<c.length;h++){const R=c[h];let T=0;for(;T<R.tdList.length;){const g=R.tdList[T];if(g.rowIndex!==u.rowIndex)g.colIndex<=u.colIndex&&g.colIndex+g.colspan>u.colIndex&&g.colspan++;else if(g.id===u.id){const f=ft();d.tdList.splice(T+u.colspan,0,{id:f,rowspan:u.rowspan,colspan:1,value:[{value:_,size:16,tableId:a.id,trId:R.id,tdId:f}]}),T++}T++}}this.draw.render(),this.tableTool.render()}splitHorizontalTableCell(){const t=this.position.getPositionContext();if(!t.isTable||this.range.getRange().isCrossRowCol)return;const{index:n,tdIndex:i,trIndex:l}=t,a=this.draw.getOriginalElementList()[n],c=a.trList,u=c[l].tdList[i];let h=-1,R=0;for(;R<c.length;){if(R===h){R++;continue}const T=c[R];let g=0;for(;g<T.tdList.length;){const f=T.tdList[g];if(f.id===u.id){const C=ft(),p=ft();c.splice(R+u.rowspan,0,{id:C,height:this.options.table.defaultTrMinHeight,tdList:[{id:p,rowspan:1,colspan:u.colspan,value:[{value:_,size:16,tableId:a.id,trId:C,tdId:p}]}]}),h=R+u.rowspan}else f.rowIndex>=u.rowIndex&&f.rowIndex<u.rowIndex+u.rowspan&&f.rowIndex+f.rowspan>=u.rowIndex+u.rowspan&&f.rowspan++;g++}R++}this.draw.render(),this.tableTool.render()}tableTdVerticalAlign(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;for(let i=0;i<e.length;i++){const l=e[i];for(let r=0;r<l.length;r++){const a=l[r];!a||a.verticalAlign===t||!a.verticalAlign&&t===s.VerticalAlign.TOP||(a.verticalAlign=t)}}const{endIndex:n}=this.range.getRange();this.draw.render({curIndex:n})}tableBorderType(t){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:n}=e,l=this.draw.getOriginalElementList()[n];if(!l.borderType&&t===s.TableBorder.ALL||l.borderType===t)return;l.borderType=t;const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r})}tableBorderColor(t){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:n}=e,l=this.draw.getOriginalElementList()[n];if(!l.borderColor&&t===this.options.table.defaultBorderColor||l.borderColor===t)return;l.borderColor=t;const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r,isCompute:!1})}tableTdBorderType(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;const n=e.flat(),i=n.some(r=>!r.borderTypes?.includes(t));n.forEach(r=>{r.borderTypes||(r.borderTypes=[]);const a=r.borderTypes.findIndex(c=>c===t);i?~a||r.borderTypes.push(t):~a&&r.borderTypes.splice(a,1),r.borderTypes.length||delete r.borderTypes});const{endIndex:l}=this.range.getRange();this.draw.render({curIndex:l})}tableTdSlashType(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;const n=e.flat(),i=n.some(r=>!r.slashTypes?.includes(t));n.forEach(r=>{r.slashTypes||(r.slashTypes=[]);const a=r.slashTypes.findIndex(c=>c===t);i?~a||r.slashTypes.push(t):~a&&r.slashTypes.splice(a,1),r.slashTypes.length||delete r.slashTypes});const{endIndex:l}=this.range.getRange();this.draw.render({curIndex:l})}tableTdBackgroundColor(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;for(let i=0;i<e.length;i++){const l=e[i];for(let r=0;r<l.length;r++){const a=l[r];a.backgroundColor=t}}const{endIndex:n}=this.range.getRange();this.range.setRange(n,n),this.draw.render({isCompute:!1})}tableSelectAll(){const t=this.position.getPositionContext(),{index:e,tableId:n,isTable:i}=t;if(!i||!n)return;const{startIndex:l,endIndex:r}=this.range.getRange(),c=this.draw.getOriginalElementList()[e].trList,d=c.length-1,u=c[d].tdList.length-1;this.range.replaceRange({startIndex:l,endIndex:r,tableId:n,startTdIndex:0,endTdIndex:u,startTrIndex:0,endTrIndex:d}),this.draw.render({isSetCursor:!1,isCompute:!1,isSubmitHistory:!1})}tableProperties(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e}=t,i=this.draw.getOriginalElementList()[e],l=this.draw.getOptions().table.tdPadding,r=i.tdPadding||l,a=document.createElement("div");a.className="table-properties-modal",a.setAttribute("editor-component","table-properties-modal"),a.innerHTML=`
536
+ `,Al=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Hl],{type:"text/javascript;charset=utf-8"});function ET(o){let t;try{if(t=Al&&(self.URL||self.webkitURL).createObjectURL(Al),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Hl),{name:o?.name})}}const _l='(function(){"use strict";var H=(D=>(D.HALF="half",D.ONE_THIRD="one-third",D.QUARTER="quarter",D))(H||{}),K=(D=>(D.ARABIC="arabic",D.CHINESE="chinese",D))(K||{});const y="​";H.HALF+"",1/2,H.ONE_THIRD+"",1/3,H.QUARTER+"",1/4;const uD=/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/,FD=/[#*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\\u27BF\\u2B50]|\\u26D3\\uFE0F?(?:\\u200D\\uD83D\\uDCA5)?|\\u26F9(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\u2764\\uFE0F?(?:\\u200D(?:\\uD83D\\uDD25|\\uD83E\\uDE79))?|\\uD83C(?:[\\uDC04\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]\\uFE0F?|[\\uDF85\\uDFC2\\uDFC7](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDFC4\\uDFCA](?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDFCB\\uDFCC](?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF43\\uDF45-\\uDF4A\\uDF4C-\\uDF7C\\uDF7E-\\uDF84\\uDF86-\\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34\\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\\u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E0F?))?|\\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,tD=new RegExp(`${FD.source}|${uD.source}`,"g");function g(D){if(typeof structuredClone=="function")return structuredClone(D);if(!D||typeof D!="object")return D;let r={};return Array.isArray(D)?r=D.map(i=>g(i)):Object.keys(D).forEach(i=>{r[i]=g(D[i])}),r}function eD(D){const r=[];if(Intl.Segmenter){const T=new Intl.Segmenter().segment(D);for(const{segment:d}of T)r.push(d)}else{const i=new Map;for(const d of D.matchAll(tD))i.set(d.index,d[0]);let T=0;for(;T<D.length;){const d=i.get(T);d?(r.push(d),T+=d.length):(r.push(D[T]),T++)}}return r}function _(D,r){const i={};for(const T in D)r.includes(T)&&(i[T]=D[T]);return i}function ED(D,r){return D.length!==r.length?!1:!D.some(i=>!r.includes(i))}var t=(D=>(D.TEXT="text",D.TEXTFIELD="TextField",D.BUTTON="button",D.IMAGE="image",D.TABLE="table",D.HYPERLINK="hyperlink",D.SUPERSCRIPT="superscript",D.SUBSCRIPT="subscript",D.SEPARATOR="separator",D.PAGE_BREAK="pageBreak",D.CONTROL="control",D.AREA="area",D.CHECKBOX="checkbox",D.RADIO="radio",D.LATEX="latex",D.TAB="tab",D.DATE="date",D.BLOCK="block",D.TITLE="title",D.LIST="list",D.SPLIT_TAG="splitTag",D.LABEL="label",D.MENSTRUAL_HISTORY="menstrualHistory",D.FETAL_HEART_POSITION="fetalHeartPosition",D.TOOTH_POSITION="toothPosition",D.SPECIAL_SYMBOLS="specialSymbols",D.MACRO="macro",D.CUSTOM_MACRO="customMacro",D.REUSABLE_ITEM="reusableItem",D.SUB_TEMPLATE="subTemplate",D))(t||{});const N=["rowFlex","vertical","rowMargin"],CD=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","vertical","rowMargin","dashArray","trList","tdPadding","tableEditable","tableToolDisabled","borderType","borderColor","borderWidth","borderExternalWidth","translateX","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","imgPreviewDisabled","imgCrop","imgCaption","textDecoration","extension","externalId","areaId","area","hide","label","labelId","lineWidth","deletePerson","newElEditPerson","deleteTime","newElEditTime","dictCode","macroConfig","menstrualData","menstrualHistoryId","fetalHeartData","fetalHeartPositionId","toothPositionData","toothPositionId","reusableItemConfig","templateId","subTemplateContent","subTemplateRelation","subTemplateConditions","subTemplateExpanded"],oD=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],Y=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"];t.TEXT,t.HYPERLINK,t.SUBSCRIPT,t.SUPERSCRIPT,t.CONTROL,t.DATE,t.IMAGE,t.LATEX,t.BLOCK,t.PAGE_BREAK,t.SEPARATOR,t.TABLE,t.TITLE,t.LIST;var G=(D=>(D.UL="ul",D.OL="ol",D))(G||{}),k=(D=>(D.DISC="disc",D.CIRCLE="circle",D.SQUARE="square",D.CHECKBOX="checkbox",D))(k||{}),m=(D=>(D.DISC="disc",D.CIRCLE="circle",D.SQUARE="square",D.DECIMAL="decimal",D.CHECKBOX="checkbox",D))(m||{});k.DISC+"",k.CIRCLE+"",k.SQUARE+"",k.CHECKBOX+"",G.OL+"",G.UL+"",m.DISC+"",m.CIRCLE+"",m.SQUARE+"",m.DECIMAL+"",m.CHECKBOX+"";var p=(D=>(D.FIRST="first",D.SECOND="second",D.THIRD="third",D.FOURTH="fourth",D.FIFTH="fifth",D.SIXTH="sixth",D))(p||{});p.FIRST+"",p.SECOND+"",p.THIRD+"",p.FOURTH+"",p.FIFTH+"",p.SIXTH+"",p.FIRST+"",p.SECOND+"",p.THIRD+"",p.FOURTH+"",p.FIFTH+"",p.SIXTH+"",p.FIRST,p.SECOND,p.THIRD,p.FOURTH,p.FIFTH,p.SIXTH;var h=(D=>(D.TEXT="text",D.SELECT="select",D.CHECKBOX="checkbox",D.RADIO="radio",D.DATE="date",D.NUMBER="number",D.TEXTFIELD="TextField",D.BUTTON="button",D.MENSTRUAL_HISTORY="menstrualHistory",D))(h||{}),F=(D=>(D.PREFIX="prefix",D.POSTFIX="postfix",D.PRE_TEXT="preText",D.PRETEXTFIX="preTextFix",D.PRETEXTFIX_TEXT="preTextFixText",D.POSTTEXTFIX="postTextFix",D.POSTTEXTFIX_TEXT="postTextFixText",D.POST_TEXT="postText",D.PLACEHOLDER="placeholder",D.TEXTFIXLABEL="textFixLabel",D.VALUE="value",D.DELETEPERSON="deletePerson",D.CHECKBOX="checkbox",D.RADIO="radio",D.UNDERLINE="underline",D))(F||{}),q=(D=>(D.LEFT="left",D.CENTER="center",D.RIGHT="right",D.ALIGNMENT="alignment",D.JUSTIFY="justify",D))(q||{}),W=(D=>(D.CONTAIN="contain",D.COVER="cover",D))(W||{}),Z=(D=>(D.REPEAT="repeat",D.NO_REPEAT="no-repeat",D.REPEAT_X="repeat-x",D.REPEAT_Y="repeat-y",D))(Z||{});W.COVER,Z.NO_REPEAT;var z=(D=>(D.TOP="top",D.MIDDLE="middle",D.BOTTOM="bottom",D))(z||{});z.BOTTOM,H.HALF,H.HALF,q.CENTER,K.ARABIC,z.BOTTOM;var J=(D=>(D.TEXT="text",D.IMAGE="image",D))(J||{});J.TEXT,K.ARABIC;var $=(D=>(D.PAGE="page",D.CONTINUITY="continuity",D))($||{});$.CONTINUITY;const nD=[h.SELECT,h.DATE,h.CHECKBOX,h.RADIO];function rD(D,r){return D&&nD.includes(D)?[""]:eD(r)}F.PREFIX,F.POSTFIX,F.PRE_TEXT,F.POST_TEXT,F.PRETEXTFIX,F.PRETEXTFIX_TEXT,F.POSTTEXTFIX,F.POSTTEXTFIX_TEXT,F.PLACEHOLDER,F.TEXTFIXLABEL,F.CHECKBOX,F.RADIO,F.UNDERLINE;function lD(D){return D?.buttonValueLayout===!0}function iD(D,r){const i=Object.keys(D),T=Object.keys(r);if(i.length!==T.length)return!1;for(let d=0;d<i.length;d++){const f=i[d];if(f!=="value"&&!(f==="groupIds"&&Array.isArray(D[f])&&Array.isArray(r[f])&&ED(D[f],r[f]))&&D[f]!==r[f])return!1}return!0}function U(D,r={}){const{extraPickAttrs:i}=r,T=[...CD];i&&T.push(...i);const d={value:D?.value===y?`\n`:D?.value};return D&&T.forEach(f=>{const s=D[f];s!==void 0&&(d[f]=s)}),d}function P(D,r={}){const{extraPickAttrs:i,isClassifyArea:T=!1,isClone:d=!0,editorOptions:f}=r,s=(d?g(D):D).filter(u=>u.type!==t.SPLIT_TAG),M=[];let E=0;const sD=u=>u===F.PREFIX||u===F.PRETEXTFIX||u===F.PRETEXTFIX_TEXT||u===F.PRE_TEXT,cD=u=>{const L=f?.control;switch(u.controlComponent){case F.PRETEXTFIX:return u.control?.preTextFix||L?.preTextFix||"";case F.PRETEXTFIX_TEXT:return u.control?.preTextFixText||L?.preTextFixText||"";case F.PRE_TEXT:return u.control?.preText||"";default:return u.control?.prefix||L?.prefix||""}},BD=(u,L)=>{if(u.value!==y||!u.controlId||!sD(u.controlComponent)||!L||L.controlId!==u.controlId||(L.originControlId||null)!==(u.originControlId||null)||L.controlComponent!==u.controlComponent||L.value===y)return!1;const o=u.control?.type;return rD(o,cD(u))[0]!==`\n`};for(;E<s.length;){let u=s[E];if(BD(u,s[E+1])&&(u=g(u),delete u.type,delete u.control,delete u.controlId,delete u.originControlId,delete u.controlComponent),E===0&&u.value===y&&!u.listId&&(!u.type||u.type===t.TEXT)){E++;continue}if(u.areaId){const o=u.areaId,A=u.area,c=[];for(;E<s.length;){const C=s[E];if(o!==C.areaId){E--;break}delete C.area,delete C.areaId,c.push(C),E++}const l=P(c,r);if(T){const C={type:t.AREA,value:"",areaId:o,area:A};C.valueList=l,u=C}else{M.splice(E,0,...l);continue}}else if(u.titleId&&u.level){const o=u.titleId;if(o){const A=u.level,c={type:t.TITLE,title:u.title,titleId:o,value:"",level:A},l=[];for(;E<s.length;){const C=s[E];if(o!==C.titleId){E--;break}delete C.level,delete C.title,l.push(C),E++}c.valueList=P(l,r),u=c}}else if(u.listId&&u.listType){const o=u.listId;if(o){const A=u.listType,c=u.listStyle,l=u?.label,C={type:t.LIST,value:"",label:l||"",listId:o,listType:A,listStyle:c},B=[];for(;E<s.length;){const n=s[E];if(o!==n.listId){E--;break}delete n.listType,delete n.listStyle,B.push(n),E++}C.valueList=P(B,r),u=C}}else if(u.type===t.TABLE){if(u.pagingId){let o=E+1,A=0;for(;o<s.length;){const c=s[o];if(c.pagingId===u.pagingId){u.height+=c.height;const l=c.trList.filter(C=>!C.pagingRepeat).filter(C=>(C.tdList=C.tdList.filter(B=>{if(B.originalId){for(let n=0;n<u.trList.length;n++){const a=u.trList[n].tdList.find(({id:e})=>e===B.originalId);if(a){B.value[0]?.type===t.SPLIT_TAG&&B.value.splice(0,1),a.value.push(...B.value),a.rowspan=a.originalRowspan??a.rowspan;break}}return!1}return!0}),!C.originalId));u.trList.push(...l),u.trList?.forEach(C=>C.minHeight=C.originalMinHeight??C.minHeight),o++,A++}else break}E+=A}if(u.trList)for(let o=0;o<u.trList.length;o++){const A=u.trList[o];delete A.id;for(let c=0;c<A.tdList.length;c++){const l=A.tdList[c],C={colspan:l.colspan,rowspan:l.rowspan,value:P(l.value,{...r,isClassifyArea:!1})};oD.forEach(B=>{const n=l[B];n!==void 0&&(C[B]=n)}),A.tdList[c]=C}}}else if(u.type===t.HYPERLINK){const o=u.hyperlinkId;if(o){const A={type:t.HYPERLINK,value:"",url:u.url},c=[];for(;E<s.length;){const l=s[E];if(o!==l.hyperlinkId){E--;break}delete l.type,delete l.url,c.push(l),E++}A.valueList=P(c,r),u=A}}else if(u.type===t.DATE){const o=u.dateId;if(o){const A={type:t.DATE,value:"",dateFormat:u.dateFormat},c=[];for(;E<s.length;){const l=s[E];if(o!==l.dateId){E--;break}delete l.type,delete l.dateFormat,c.push(l),E++}A.valueList=P(c,r),u=A}}else if(u.type!==t.BUTTON){if(u.controlId){const o=u.controlId;if(!(u.controlComponent===F.PREFIX||u.controlComponent===F.PRETEXTFIX||u.controlComponent===F.PRETEXTFIX_TEXT)&&u.controlComponent===F.VALUE){if(u.type===t.MENSTRUAL_HISTORY||u.type===t.FETAL_HEART_POSITION||u.type===t.TOOTH_POSITION||u.type===t.IMAGE||u.type===t.MACRO||u.type===t.CUSTOM_MACRO||u.type===t.REUSABLE_ITEM||u.type===t.LIST||u.type===t.SPECIAL_SYMBOLS){let B=!1;for(let n=E-1;n>=0;n--){const I=s[n],a=I.controlComponent===F.PREFIX||I.controlComponent===F.PRETEXTFIX||I.controlComponent===F.PRETEXTFIX_TEXT;if(I.controlId===o&&a){B=!0;break}if(I.controlId!==o)break}if(!B){const n=g(u);delete n.controlId,delete n.control,delete n.controlComponent,delete n.originControlId,M.push(n),E++;continue}}E++;continue}if(u.controlComponent===F.PLACEHOLDER||u.controlComponent===F.POSTFIX||u.controlComponent===F.POSTTEXTFIX||u.controlComponent===F.POSTTEXTFIX_TEXT||u.controlComponent===F.POST_TEXT||u.controlComponent===F.PRE_TEXT||u.controlComponent===F.CHECKBOX||u.controlComponent===F.RADIO){E++;continue}const c=(C,B,n,I)=>{if(I===h.CHECKBOX||I===h.RADIO){let e=-1;for(let X=C;X<s.length&&s[X].controlId===B;X++)e=X;return e}const a=n?[F.POSTTEXTFIX,F.POSTTEXTFIX_TEXT]:[F.POSTFIX];for(let e=C;e<s.length;e++){const X=s[e];if(X.controlId===B&&a.includes(X.controlComponent))return e}return-1},l=(C,B,n)=>{const I=[];let a=C;for(;a<=B;){const e=s[a];if(lD(e)){a++;continue}if(e.controlId&&e.controlId!==n&&e.control){const O=e.control?.type,x=O===h.TEXTFIELD,R=x?F.PRETEXTFIX:F.PREFIX,v=e.controlComponent===R,b=O===h.CHECKBOX||O===h.RADIO;if(v||b&&(e.controlComponent===F.CHECKBOX||e.controlComponent===F.RADIO)){const S=c(a+1,e.controlId,x,O);if(S!==-1){const Q=s.slice(a,S+1).map(aD=>{const DD=g(aD);return delete DD.originControlId,DD}),w=P(Q,r);w.length>0&&I.push(w[0]),a=S+1;continue}}}if(!(e.controlId===n&&(e.controlComponent===F.VALUE||!e.controlComponent)&&(!e.originControlId||e.originControlId===n)||e.originControlId===n&&e.controlComponent===F.VALUE||e.controlId===n&&(e.controlComponent===F.CHECKBOX||e.controlComponent===F.RADIO)&&!e.originControlId)){a++;continue}if(e.type===t.MENSTRUAL_HISTORY||e.type===t.FETAL_HEART_POSITION||e.type===t.TOOTH_POSITION||e.type===t.IMAGE||e.type===t.MACRO||e.type===t.CUSTOM_MACRO||e.type===t.REUSABLE_ITEM||e.type===t.SUB_TEMPLATE||e.type===t.LIST||e.type===t.SPECIAL_SYMBOLS){const O=g(e);delete O.controlId,delete O.control,delete O.controlComponent,delete O.originControlId,I.push(O),a++;continue}if(e.controlComponent===F.CHECKBOX||e.controlComponent===F.RADIO){I.push(g(e)),a++;continue}const j=u.control?.type;if(j===h.CHECKBOX||j===h.RADIO){let O=a-1,x=!1;for(;O>=C-1;){const R=s[O];if(R.controlId===n&&!R.originControlId)if(R.controlComponent===F.CHECKBOX){x=R.checkbox?.value===!0;break}else if(R.controlComponent===F.RADIO){x=R.radio?.value===!0;break}else if(R.controlComponent===F.VALUE){O--;continue}else break;O--}if(x){const R={value:e.value||""},v=[...N,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const b of v){const S=e[b];if(S!==void 0){if(b==="color"&&f){const Q=f.control?.bracketColor,w=f.control?.placeholderColor;if(S===Q||S===w)continue}R[b]=S}}I.push(R)}}else{const O={value:e.value||""},x=[...N,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const R of x){const v=e[R];if(v!==void 0){if(R==="color"&&f){const b=f.control?.bracketColor,S=f.control?.placeholderColor;if(v===b||v===S)continue}O[R]=v}}I.push(O)}a++}return I};if(u.controlComponent===F.PREFIX){const C=u.control?.type===h.TEXTFIELD,B=c(E+1,o,C);if(B!==-1){const n=l(E+1,B-1,o),I=_(u,Y),e=u.control?.type===h.BUTTON&&!u.control?.buttonText?n.length?n:null:n,X={...u.control,...I,value:e},V={..._(u,N),type:t.CONTROL,value:"",control:X,controlId:o};u=U(V,{extraPickAttrs:i}),E=B}}if(u.controlComponent===F.PRETEXTFIX){const C=c(E+1,o,!0);if(C!==-1){const B=l(E+1,C-1,o),n=_(u,Y),I={...u.control,...n,value:B},a={..._(u,N),type:t.CONTROL,value:"",control:I,controlId:o};u=U(a,{extraPickAttrs:i}),E=C}}if(u.controlComponent===F.PRETEXTFIX_TEXT){const C=c(E+1,o,!0);if(C!==-1){const B=l(E+1,C-1,o),n=_(u,Y),I={...u.control,...n,value:B},a={..._(u,N),type:t.CONTROL,value:"",control:I,controlId:o};u=U(a,{extraPickAttrs:i}),E=C}}}}const L=U(u,{extraPickAttrs:i});if(!u.type||u.type===t.TEXT||u.type===t.SUBSCRIPT||u.type===t.SUPERSCRIPT)for(;E<s.length;){const o=s[E+1];if(E++,o&&iD(L,U(o,{extraPickAttrs:i}))){const A=o.value===y?`\n`:o.value;L.value+=A}else break}else E++;M.push(L)}return M}onmessage=D=>{const r=D.data,{options:i,data:T}=r,{extraPickAttrs:d=[]}=i||{},f={header:P(T.header,{extraPickAttrs:d,isClone:!1}),main:P(T.main,{extraPickAttrs:d,isClassifyArea:!0,isClone:!1}),footer:P(T.footer,{extraPickAttrs:d,isClone:!1})};postMessage(f)}})();\n',Bl=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",_l],{type:"text/javascript;charset=utf-8"});function LT(o){let t;try{if(t=Bl&&(self.URL||self.webkitURL).createObjectURL(Bl),!t)throw"";const e=new Worker(t,{name:o?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(_l),{name:o?.name})}}class PT{draw;wordCountWorker;catalogWorker;groupWorker;valueWorker;constructor(t){this.draw=t,this.wordCountWorker=new pT,this.catalogWorker=new IT,this.groupWorker=new ET,this.valueWorker=new LT}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=l=>{t(l.data)},this.catalogWorker.onerror=l=>{e(l)};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)})}getValue(t){return new Promise((e,n)=>{this.valueWorker.onmessage=i=>{e({version:Cn,data:i.data,options:rt(this.draw.getOptions())})},this.valueWorker.onerror=i=>{n(i)},this.valueWorker.postMessage({data:this.draw.getOriginValue(t),options:t})})}}class MT{container;canvas;draw;options;curElement;curElementSrc;previewerDrawOption;curPosition;eventBus;imageList;curShowElement;imageCount;imagePre;imageNext;resizerSelection;resizerHandleList;resizerImageContainer;resizerImage;resizerSize;width;height;mousedownX;mousedownY;curHandleIndex;previewerContainer;previewerImage;constructor(t){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,this.eventBus=t.getEventBus(),this.imageList=[],this.curShowElement=null,this.imageCount=null,this.imagePre=null,this.imageNext=null;const{resizerSelection:e,resizerHandleList:n,resizerImageContainer:i,resizerImage:l,resizerSize:r}=this._createResizerDom();this.resizerSelection=e,this.resizerHandleList=n,this.resizerImageContainer=i,this.resizerImage=l,this.resizerSize=r,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){const{scale:n}=this.options;let i=0,l=0;const r=this.draw.getHeight(),a=this.draw.getPageGap(),d=(e?.pageNo??this.draw.getPageNo())*(r+a);if(t.imgFloatPosition)i=t.imgFloatPosition.x*n,l=t.imgFloatPosition.y*n+d;else if(e){const{coordinate:{leftTop:[u,h]},ascent:R}=e;i=u,l=h+d+R}return{x:i,y:l}}_createResizerDom(){const{scale:t}=this.options,e=document.createElement("div");e.classList.add(`${st}-resizer-selection`),e.style.display="none",e.style.borderColor=this.options.resizerColor,e.style.borderWidth=`${t}px`;const n=[];for(let c=0;c<8;c++){const d=document.createElement("div");d.style.background=this.options.resizerColor,d.classList.add("resizer-handle"),d.classList.add(`handle-${c}`),d.setAttribute("data-index",String(c)),d.onmousedown=this._mousedown.bind(this),e.append(d),n.push(d)}this.container.append(e);const i=document.createElement("div");i.classList.add(`${st}-resizer-size-view`);const l=document.createElement("span");i.append(l),e.append(i);const r=document.createElement("div");r.classList.add(`${st}-resizer-image`),r.style.display="none";const a=document.createElement("img");return r.append(a),this.container.append(r),{resizerSelection:e,resizerHandleList:n,resizerImageContainer:r,resizerImage:a,resizerSize:l}}_keydown=()=>{this.resizerSelection.style.display==="block"&&(this.clearResizer(),document.removeEventListener("keydown",this._keydown))};_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:l,y:r}=this._getElementPosition(this.curElement,this.curPosition);this.resizerImageContainer.style.left=`${l}px`,this.resizerImageContainer.style.top=`${r}px`,this.resizerImage.style.width=`${this.curElement.width*e}px`,this.resizerImage.style.height=`${this.curElement.height*e}px`;const a=this._mousemove.bind(this);document.addEventListener("mousemove",a),document.addEventListener("mouseup",()=>{this.curElement&&!this.previewerDrawOption.dragDisable&&(this.curElement.width=this.width,this.curElement.height=this.height,this.draw.render({isSetCursor:!0,curIndex:this.curPosition?.index})),this.resizerImageContainer.style.display="none",document.removeEventListener("mousemove",a),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 d=this.mousedownX-t.x,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 1:i=this.mousedownY-t.y;break;case 2:{const d=t.x-this.mousedownX,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 4:{const d=t.x-this.mousedownX,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**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 d=this.mousedownX-t.x,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**3),i=this.curElement.height*n/this.curElement.width}break;case 7:n=this.mousedownX-t.x;break}const l=this.curElement.width+n/e,r=this.curElement.height+i/e;if(l<=0||r<=0)return;this.width=l,this.height=r;const a=l*e,c=r*e;this.resizerImage.style.width=`${a}px`,this.resizerImage.style.height=`${c}px`,this._updateResizerRect(a,c),this._updateResizerSizeView(a,c),t.preventDefault(),this.eventBus.isSubscribe("imageSizeChange")&&this.eventBus.emit("imageSizeChange",{element:this.curElement})}_drawPreviewer(){const t=document.createElement("div");t.classList.add(`${st}-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(`${st}-image-container`);const i=document.createElement("img");i.src=this.curElementSrc,i.draggable=!1,n.append(i),this.previewerImage=i,t.append(n);let l=0,r=0,a=1,c=0;const d=document.createElement("div");d.classList.add(`${st}-image-menu`);const u=document.createElement("div");u.classList.add("image-navigate");const h=document.createElement("i");h.classList.add("image-pre"),h.onclick=()=>{const P=this.imageList.findIndex(S=>S.id===this.curShowElement?.id);P<=0||(this.curShowElement=this.imageList[P-1],i.src=this.curShowElement.value,this._updateImageNavigate())},u.append(h),this.imagePre=h;const R=document.createElement("span");R.classList.add("image-count"),this.imageCount=R,u.append(R);const T=document.createElement("i");T.classList.add("image-next"),T.onclick=()=>{const P=this.imageList.findIndex(S=>S.id===this.curShowElement?.id);P>=this.imageList.length-1||(this.curShowElement=this.imageList[P+1],i.src=this.curShowElement.value,this._updateImageNavigate())},this.imageNext=T,u.append(T),d.append(u);const g=document.createElement("i");g.classList.add("zoom-in"),g.onclick=()=>{a+=.1,this._setPreviewerTransform(a,c,l,r)},d.append(g);const f=document.createElement("i");f.onclick=()=>{a-.1<=.1||(a-=.1,this._setPreviewerTransform(a,c,l,r))},f.classList.add("zoom-out"),d.append(f);const C=document.createElement("i");C.classList.add("rotate"),C.onclick=()=>{c+=1,this._setPreviewerTransform(a,c,l,r)},d.append(C);const p=document.createElement("i");p.classList.add("original-size"),p.onclick=()=>{l=0,r=0,a=1,c=0,this._setPreviewerTransform(a,c,l,r)},d.append(p);const I=document.createElement("i");I.classList.add("image-download"),I.onclick=()=>{const{mime:P}=this.previewerDrawOption;As(i.src,`${this.curElement?.id}.${P||"png"}`)},d.append(I),t.append(d),this.previewerContainer=t,document.body.append(t);let m=0,L=0,O=!1;i.onmousedown=P=>{O=!0,m=P.x,L=P.y,t.style.cursor="move"},t.onmousemove=P=>{O&&(l+=P.x-m,r+=P.y-L,m=P.x,L=P.y,this._setPreviewerTransform(a,c,l,r))},t.onmouseup=()=>{O=!1,t.style.cursor="auto"},t.onwheel=P=>{if(P.preventDefault(),P.stopPropagation(),P.deltaY<0)a+=.1;else{if(a-.1<=.1)return;a-=.1}this._setPreviewerTransform(a,c,l,r)},this._updateImageNavigate()}_updateImageNavigate(){const t=this.imageList.findIndex(e=>e.id===this.curShowElement?.id);this.imageCount.innerText=`${t+1} / ${this.imageList.length}`,t<=0?this.imagePre.classList.add("disabled"):this.imagePre.classList.remove("disabled"),t>=this.imageList.length-1?this.imageNext.classList.add("disabled"):this.imageNext.classList.remove("disabled")}_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(){this.previewerContainer?.remove(),this.previewerContainer=null,document.body.style.overflow="auto"}_updateResizerRect(t,e){const{resizerSize:n,scale:i}=this.options,l=this.draw.isReadonly();this.resizerSelection.style.width=`${t}px`,this.resizerSelection.style.height=`${e}px`;for(let r=0;r<8;r++){const a=r===0||r===6||r===7?-n:r===1||r===5?t/2:t-n,c=r===0||r===1||r===2?-n:r===3||r===7?e/2-n:e-n;this.resizerHandleList[r].style.transform=`scale(${i})`,this.resizerHandleList[r].style.left=`${a}px`,this.resizerHandleList[r].style.top=`${c}px`,this.resizerHandleList[r].style.display=l?"none":"block"}}_updateResizerSizeView(t,e){this.resizerSize.innerText=`${Math.round(t)} × ${Math.round(e)}`}render(){const t=this.draw.getMode();!this.curElement||this.curElement.imgToolDisabled&&!this.draw.isDesignMode()||t===s.EditorMode.PRINT&&this.options.modeRule[s.EditorMode.PRINT]?.imagePreviewerDisabled||t===s.EditorMode.COMPARE&&this.options.modeRule[s.EditorMode.COMPARE]?.imagePreviewerDisabled||t===s.EditorMode.READONLY&&this.options.modeRule[s.EditorMode.READONLY]?.imagePreviewerDisabled||(this.imageList=this.draw.getImageParticle().getOriginalMainImageList(),this.curShowElement=this.curElement,this._drawPreviewer(),document.body.style.overflow="hidden")}drawResizer(t,e=null,n={}){const i=this.draw.getMode();t.imgToolDisabled&&!this.draw.isDesignMode()||i===s.EditorMode.PRINT&&this.options.modeRule[s.EditorMode.PRINT]?.imagePreviewerDisabled||i===s.EditorMode.COMPARE&&this.options.modeRule[s.EditorMode.COMPARE]?.imagePreviewerDisabled||i===s.EditorMode.READONLY&&this.options.modeRule[s.EditorMode.READONLY]?.imagePreviewerDisabled||(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,l=t.height*n;this._updateResizerSizeView(i,l);const{x:r,y:a}=this._getElementPosition(t,e);this.resizerSelection.style.left=`${r}px`,this.resizerSelection.style.top=`${a}px`,this.resizerSelection.style.borderWidth=`${n}px`,this._updateResizerRect(i,l),this.resizerSelection.style.display="block",this.curElement=t,this.curPosition=e,this.width=i,this.height=l}clearResizer(){this.resizerSelection.style.display="none",document.removeEventListener("keydown",this._keydown)}}class OT{draw;range;datePicker;options;constructor(t){this.draw=t,this.options=t.getOptions(),this.range=t.getRange(),this.datePicker=new Nl(t,{onSubmit:this._setValue.bind(this)})}_setValue(t){if(!t)return;const e=this.getDateElementRange();if(!e)return;const[n,i]=e,l=this.draw.getElementList(),r=l[n+1];this.draw.spliceElementList(l,n+1,i-n),this.range.setRange(n,n);const a={type:s.ElementType.DATE,value:"",dateFormat:r.dateFormat,valueList:[{value:t}]};le(l,[a],n,{editorOptions:this.options}),this.draw.insertElementList([a])}getDateElementRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const l=this.draw.getElementList(),r=l[n];if(r.type!==s.ElementType.DATE)return null;let a=n;for(;a>=0;){if(l[a].dateId!==r.dateId){t=a;break}a--}let c=n+1;for(;c<l.length;){if(l[c].dateId!==r.dateId){e=c-1;break}c++}return c===l.length&&(e=c-1),!~t||!~e?null:[t,e]}clearDatePicker(){this.datePicker.dispose()}renderDatePicker(t,e){const n=this.draw.getElementList(),i=this.getDateElementRange(),l=i?n.slice(i[0]+1,i[1]+1).map(r=>r.value).join(""):"";this.datePicker.render({value:l,position:e,dateFormat:t.dateFormat})}}class kl{element;videoCache;constructor(t){this.element=t,this.videoCache=new Map}snapshot(t,e,n){return new Promise((i,l)=>{const r=this.element.block?.videoBlock?.src||"";if(this.videoCache.has(r)){const a=this.videoCache.get(r);t.drawImage(a,e,n,this.element.metrics.width,this.element.metrics.height),i(this.element)}else{const a=document.createElement("video");a.src=r,a.muted=!0,a.crossOrigin="anonymous",a.onloadeddata=()=>{t.drawImage(a,e,n,this.element.metrics.width,this.element.metrics.height),this.videoCache.set(r,a),i(this.element)},a.onerror=c=>{l(c)},a.play().then(()=>{a.pause()})}})}render(t){const e=this.element.block,n=document.createElement("video");n.style.width="100%",n.style.height="100%",n.style.objectFit="contain",n.src=e.videoBlock?.src||"",n.controls=!0,t.append(n)}}class ST{draw;options;element;block;blockContainer;blockItem;blockCache;resizerMask;resizerSelection;resizerHandleList;width;height;mousedownX;mousedownY;curHandleIndex;isAllowResize;constructor(t,e){this.draw=t.getDraw(),this.options=this.draw.getOptions(),this.blockContainer=t.getBlockContainer(),this.element=e,this.block=null;const{blockItem:n,resizerMask:i,resizerSelection:l,resizerHandleList:r}=this._createBlockItem();this.blockItem=n,this.blockContainer.append(this.blockItem),this.blockCache=new Map,this.resizerMask=i,this.resizerSelection=l,this.resizerHandleList=r,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.isAllowResize=!1}getBlockElement(){return this.element}getBlockWidth(){return this.element.width||this.element.metrics.width}_createBlockItem(){const{scale:t,resizerColor:e}=this.options,n=document.createElement("div");n.classList.add(`${st}-block-item`);const i=document.createElement("div");i.style.display="none",i.classList.add(`${st}-resizer-selection`),i.style.borderColor=e,i.style.borderWidth=`${t}px`;const l=[];for(let a=0;a<8;a++){const c=document.createElement("div");c.style.background=e,c.classList.add("resizer-handle"),c.classList.add(`handle-${a}`),c.setAttribute("data-index",String(a)),c.onmousedown=this._mousedown.bind(this),i.append(c),l.push(c)}const r=document.createElement("div");return r.classList.add(`${st}-resizer-mask`),r.style.display="none",n.append(r),n.onmouseenter=()=>{if(this.draw.isReadonly())return;const{width:c,height:d}=this.element.metrics;this._updateResizerRect(c,d),i.style.display="block"},n.onmouseleave=()=>{this.isAllowResize||(i.style.display="none")},n.append(i),{blockItem:n,resizerMask:r,resizerSelection:i,resizerHandleList:l}}_updateResizerRect(t,e){const{resizerSize:n,scale:i}=this.options;this.resizerSelection.style.width=`${t}px`,this.resizerSelection.style.height=`${e}px`;for(let l=0;l<8;l++){const r=l===0||l===6||l===7?-n:l===1||l===5?t/2:t-n,a=l===0||l===1||l===2?-n:l===3||l===7?e/2-n:e-n;this.resizerHandleList[l].style.transform=`scale(${i})`,this.resizerHandleList[l].style.left=`${r}px`,this.resizerHandleList[l].style.top=`${a}px`}}_mousedown(t){const e=this.draw.getPage();this.mousedownX=t.x,this.mousedownY=t.y,this.isAllowResize=!0;const n=t.target;this.curHandleIndex=Number(n.dataset.index),this.resizerMask.style.display="block";const i=window.getComputedStyle(n).cursor;document.body.style.cursor=i,e.style.cursor=i;const l=this._mousemove.bind(this);document.addEventListener("mousemove",l),document.addEventListener("mouseup",()=>{this.element.width=Math.min(this.width,this.draw.getInnerWidth()),this.element.height=this.height,this.isAllowResize=!1,this.resizerSelection.style.display="none",this.resizerMask.style.display="none",document.removeEventListener("mousemove",l),document.body.style.cursor="",e.style.cursor="text",this.draw.render()},{once:!0}),t.preventDefault()}_mousemove(t){if(!this.isAllowResize)return;const{scale:e}=this.options;let n=0,i=0;switch(this.curHandleIndex){case 0:{const d=this.mousedownX-t.x,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 1:i=this.mousedownY-t.y;break;case 2:{const d=t.x-this.mousedownX,u=this.mousedownY-t.y;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 4:{const d=t.x-this.mousedownX,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 3:n=t.x-this.mousedownX;break;case 5:i=t.y-this.mousedownY;break;case 6:{const d=this.mousedownX-t.x,u=t.y-this.mousedownY;n=Math.cbrt(d**3+u**3),i=this.element.height*n/this.getBlockWidth()}break;case 7:n=this.mousedownX-t.x;break}const l=this.getBlockWidth()+n/e,r=this.element.height+i/e;if(l<=0||r<=0)return;this.width=l,this.height=r;const a=l*e,c=r*e;this._updateResizerRect(a,c),this.blockItem.style.width=`${a}px`,this.blockItem.style.height=`${c}px`,t.preventDefault()}snapshot(t,e,n){if(this.element.block.type===s.BlockType.VIDEO)if(this.blockItem.style.display="none",this.blockCache.has(this.element.id))this.blockCache.get(this.element.id).snapshot(t,e,n);else{this.block=new kl(this.element);const l=this.block.snapshot(t,e,n);this.draw.getImageObserver().add(l),this.blockCache.set(this.element.id,this.block)}}render(){const t=this.element.block;t.type===s.BlockType.IFRAME?(this.block=new Yn(this.element),this.block.render(this.blockItem)):t.type===s.BlockType.VIDEO&&(this.block=new kl(this.element),this.block.render(this.blockItem))}setClientRects(t,e,n){const i=this.draw.getHeight(),l=this.draw.getPageGap(),r=t*(i+l),{metrics:a}=this.element;this.blockItem.style.display="block",this.blockItem.style.width=`${a.width}px`,this.blockItem.style.height=`${a.height}px`,this.blockItem.style.left=`${e}px`,this.blockItem.style.top=`${r+n}px`}remove(){this.blockItem.remove()}}class DT{draw;container;blockContainer;blockMap;constructor(t){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(`${st}-block-container`),t}getDraw(){return this.draw}getBlockContainer(){return this.blockContainer}render(t,e,n,i,l){const r=n.id;let a=this.blockMap.get(r);a||(a=new ST(this,n),a.render(),this.blockMap.set(r,a)),this.draw.isPrintLikeMode()?a.snapshot(t,i,l):a.setClientRects(e,i,l)}clear(){if(!this.blockMap.size)return;const t=this.draw.getOriginalMainElementList(),e=[];for(let n=0;n<t.length;n++){const i=t[n];i.type===s.ElementType.BLOCK&&e.push(i.id)}this.blockMap.forEach(n=>{const i=n.getBlockElement().id;e.includes(i)||(n.remove(),this.blockMap.delete(i))})}}const Ys={contextmenu:{global:{cut:"剪切",copy:"复制",paste:"粘贴",selectAll:"全选",print:"打印",cancel:"取消"},control:{delete:"删除控件",editAttribute:"修改元素配置",addExpression:"添加表达式",addMenstrualHistory:"月经史",addFetalHeartPosition:"胎心位置"},hyperlink:{delete:"删除链接",cancel:"取消链接",edit:"编辑链接"},image:{change:"更改图片",saveAs:"另存为图片",textWrap:"文字环绕",textWrapType:{embed:"嵌入型",upDown:"上下型环绕",surround:"四周型环绕",floatTop:"浮于文字上方",floatBottom:"衬于文字下方"}},table:{insertRowCol:"插入行列",insertTopRow:"上方插入1行",insertBottomRow:"下方插入1行",insertLeftCol:"左侧插入1列",insertRightCol:"右侧插入1列",deleteRowCol:"删除行列",deleteRow:"删除1行",deleteCol:"删除1列",deleteTable:"删除整个表格",mergeCell:"合并单元格",mergeCancelCell:"取消合并",verticalAlign:"垂直对齐",verticalAlignTop:"顶端对齐",verticalAlignMiddle:"垂直居中",verticalAlignBottom:"底端对齐",border:"表格边框",borderAll:"所有框线",borderEmpty:"无框线",borderDash:"虚框线",borderExternal:"外侧框线",borderInternal:"内侧框线",borderTd:"单元格边框",borderTdTop:"上边框",borderTdRight:"右边框",borderTdBottom:"下边框",borderTdLeft:"左边框",borderTdForward:"正斜线",borderTdBack:"反斜线",tableProperties:"表格属性"}},datePicker:{now:"此刻",confirm:"确定",return:"返回日期",timeSelect:"时间选择",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},year:"年",month:"月",hour:"时",minute:"分",second:"秒"},select:{search:"搜索选项",empty:"无匹配项"},frame:{header:"页眉",footer:"页脚"},pageBreak:{displayName:"分页符"},zone:{headerTip:"双击编辑页眉",footerTip:"双击编辑页脚"}},FT={contextmenu:{global:{cut:"Cut",copy:"Copy",paste:"Paste",selectAll:"Select all",print:"Print",cancel:"Cancel"},control:{delete:"Delete control",editAttribute:"Edit element config",addExpression:"Add expression",addMenstrualHistory:"Menstrual History",addFetalHeartPosition:"Fetal Heart Position"},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",tableProperties:"Table Properties"}},datePicker:{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"},select:{search:"Search options",empty:"No matching options"},frame:{header:"Header",footer:"Footer"},pageBreak:{displayName:"Page Break"},zone:{headerTip:"Double click to edit header",footerTip:"Double click to edit footer"}};class XT{currentLocale;langMap=new Map([["zhCN",Ys],["en",FT]]);constructor(t){this.currentLocale=t}registerLangMap(t,e){const n=this.langMap.get(t);this.langMap.set(t,_s(n||Ys,e))}getLocale(){return this.currentLocale}setLocale(t){this.currentLocale=t}getLang(){return this.langMap.get(this.currentLocale)||Ys}t(t){const e=t.split(".");let n="",i=this.getLang();for(let l=0;l<e.length;l++){const r=e[l],a=Reflect.get(i,r);if(a)n=i=a;else return""}return n}}class yT{promiseList;constructor(){this.promiseList=[]}add(t){this.promiseList.push(t)}clearAll(){this.promiseList=[]}allSettled(){return Promise.allSettled(this.promiseList)}}class NT{draw;zone;i18n;container;pageContainer;isDisableMouseMove;tipContainer;tipContent;currentMoveZone;constructor(t,e){this.draw=t,this.zone=e,this.i18n=t.getI18n(),this.container=t.getContainer(),this.pageContainer=t.getPageContainer();const{tipContainer:n,tipContent:i}=this._drawZoneTip();this.tipContainer=n,this.tipContent=i,this.isDisableMouseMove=!0,this.currentMoveZone=s.EditorZone.MAIN;const l=[],{header:r,footer:a}=t.getOptions();r.disabled||l.push(s.EditorZone.HEADER),a.disabled||l.push(s.EditorZone.FOOTER),l.length&&this._watchMouseMoveZoneChange(l)}_watchMouseMoveZoneChange(t){this.pageContainer.addEventListener("mousemove",Ca(e=>{if(!(this.isDisableMouseMove||!this.draw.getIsPagingMode())){if(this.draw.getMode()!==s.EditorMode.EDIT){this._updateZoneTip(!1);return}if(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()===s.EditorZone.MAIN&&(n===s.EditorZone.HEADER||n===s.EditorZone.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(`${st}-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===s.EditorZone.HEADER?"headerTip":"footerTip"}`)):this.tipContainer.classList.remove("show")}}class bT{INDICATOR_PADDING=2;INDICATOR_TITLE_TRANSLATE=[20,5];draw;options;i18n;container;currentZone;indicatorContainer;constructor(t){this.draw=t,this.i18n=t.getI18n(),this.options=t.getOptions(),this.container=t.getContainer(),this.currentZone=s.EditorZone.MAIN,this.indicatorContainer=null,this.options.zone.tipDisabled||new NT(t,this)}isHeaderActive(){return this.getZone()===s.EditorZone.HEADER}isMainActive(){return this.getZone()===s.EditorZone.MAIN}isFooterActive(){return this.getZone()===s.EditorZone.FOOTER}getZone(){return this.currentZone}setZone(t){const{header:e,footer:n}=this.options;!e.editable&&t===s.EditorZone.HEADER||!n.editable&&t===s.EditorZone.FOOTER||this.currentZone!==t&&(this.currentZone=t,this.draw.getRange().clearRange(),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),this.drawZoneIndicator(),Pi(()=>{const i=this.draw.getListener();i.zoneChange&&i.zoneChange(t);const l=this.draw.getEventBus();l.isSubscribe("zoneChange")&&l.emit("zoneChange",t)}))}getZoneByY(t){const e=this.draw.getHeader(),n=e.getHeaderTop()+e.getHeight(),i=this.draw.getFooter(),r=this.draw.getHeight()-(i.getFooterBottom()+i.getHeight());return t<n?s.EditorZone.HEADER:t>r?s.EditorZone.FOOTER:s.EditorZone.MAIN}drawZoneIndicator(){if(this._clearZoneIndicator(),!this.isHeaderActive()&&!this.isFooterActive())return;const{scale:t}=this.options,e=this.isHeaderActive(),[n,i]=this.INDICATOR_TITLE_TRANSLATE,l=this.draw.getPageList(),r=this.draw.getMargins(),a=this.draw.getInnerWidth(),c=this.draw.getHeight(),d=this.draw.getPageGap(),u=c+d;this.indicatorContainer=document.createElement("div"),this.indicatorContainer.classList.add(`${st}-zone-indicator`);const h=this.draw.getHeader(),R=this.draw.getFooter(),T=e?h.getHeight():R.getHeight(),g=e?h.getHeaderTop():c-R.getFooterBottom()-T;for(let f=0;f<l.length;f++){const C=u*f+g,p=r[3]-this.INDICATOR_PADDING,I=r[3]+a+this.INDICATOR_PADDING,m=e?C-this.INDICATOR_PADDING:C+T+this.INDICATOR_PADDING,L=e?C+T+this.INDICATOR_PADDING:C-this.INDICATOR_PADDING,O=document.createElement("div");O.innerText=this.i18n.t(`frame.${e?"header":"footer"}`),O.style.top=`${L}px`,O.style.transform=`translate(${n*t}px, ${i*t}px) scale(${t})`,this.indicatorContainer.append(O);const P=document.createElement("span");P.classList.add(`${st}-zone-indicator-border__top`),P.style.top=`${m}px`,P.style.width=`${a}px`,P.style.marginLeft=`${r[3]}px`,this.indicatorContainer.append(P);const S=document.createElement("span");S.classList.add(`${st}-zone-indicator-border__left`),S.style.top=`${C}px`,S.style.height=`${T}px`,S.style.left=`${p}px`,this.indicatorContainer.append(S);const y=document.createElement("span");y.classList.add(`${st}-zone-indicator-border__bottom`),y.style.top=`${L}px`,this.indicatorContainer.append(y);const Y=document.createElement("span");Y.classList.add(`${st}-zone-indicator-border__right`),Y.style.top=`${C}px`,Y.style.height=`${T}px`,Y.style.left=`${I}px`,this.indicatorContainer.append(Y)}this.container.append(this.indicatorContainer)}_clearZoneIndicator(){this.indicatorContainer?.remove(),this.indicatorContainer=null}}class VT{draw;position;zone;options;elementList;rowList;positionList;constructor(t,e){this.draw=t,this.position=t.getPosition(),this.zone=t.getZone(),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();this.rowList=this.draw.computeRowList({innerWidth:t,elementList:this.elementList})}_computePositionList(){const t=this.getFooterBottom(),e=this.draw.getInnerWidth(),i=this.draw.getMargins()[3],l=this.draw.getHeight(),r=this.getHeight(),a=l-t-r;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:a,innerWidth:e,zone:s.EditorZone.FOOTER})}getFooterBottom(){const{footer:{bottom:t,disabled:e},scale:n}=this.options;return e?0:Math.floor(t*n)}getMaxHeight(){const{footer:{maxHeightRadio:t}}=this.options,e=this.draw.getHeight();return Math.floor(e*Ks[t])}getHeight(){if(this.options.footer.disabled)return 0;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.getFooterBottom()+e-t[2];return i<=0?0:i}render(t,e){t.save(),t.globalAlpha=this.zone.isFooterActive()?1:this.options.footer.inactiveAlpha;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),l=[];let r=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(r+c.height>i)break;l.push(c),r+=c.height}this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:l,pageNo:e,startIndex:0,innerWidth:n,zone:s.EditorZone.FOOTER}),t.restore()}}class WT{draw;range;options;UN_COUNT_STYLE_WIDTH=20;MEASURE_BASE_TEXT="0";LIST_GAP=10;constructor(t){this.draw=t,this.range=t.getRange(),this.options=t.getOptions()}setList(t,e){if(this.draw.isReadonly())return;const{startIndex:i,endIndex:l}=this.range.getRange();if(!~i&&!~l)return;const r=this.range.getRangeParagraphElementList();if(!r||!r.length)return;if(r.find(h=>h.listType===t&&h.listStyle===e)||!t){this.unsetList();return}const c=ft();r.forEach(h=>{h.listId=c,h.listType=t,h.listStyle=e});const d=i===l,u=d?l:i;this.draw.render({curIndex:u,isSetCursor:d})}unsetList(){if(this.draw.isReadonly())return;const{startIndex:e,endIndex:n}=this.range.getRange();if(!~e&&!~n)return;const i=this.range.getRangeParagraphElementList()?.filter(d=>d.listId);if(!i||!i.length)return;const l=this.draw.getElementList(),r=l[n];if(r.listId){let d=n+1;for(;d<l.length;){const u=l[d];if(u.value===_&&!u.listWrap)break;if(u.listId!==r.listId){this.draw.spliceElementList(l,d,0,[{value:_}]);break}d++}}i.forEach(d=>{delete d.listId,delete d.listType,delete d.listStyle,delete d.listWrap});const a=e===n,c=a?n:e;this.draw.render({curIndex:c,isSetCursor:a})}computeListStyle(t,e){const n=new Map;let i=0,l=e[i]?.listId,r=[];const a=e.length;for(;i<a;){const c=e[i];if(l&&l===c.listId)r.push(c);else if(c.listId&&c.listId!==l){if(r.length){const d=this.getListStyleWidth(t,r);n.set(l,d)}l=c.listId,r=l?[c]:[]}i++}if(r.length){const c=this.getListStyleWidth(t,r);n.set(l,c)}return n}findStyledElement(t){let e=t[0];for(let n=1;n<t.length;n++){const i=t[n];if(i.font||i.size||i.bold||i.italic){e=i;break}}return e}getListFontStyle(t,e){if(this.options.list.inheritStyle){const n=this.findStyledElement(t);return this.draw.getElementFont(n,e)}else{const{defaultFont:n,defaultSize:i}=this.options;return`${i*e}px ${n}`}}getListStyleWidth(t,e){const{scale:n,checkbox:i}=this.options,l=e[0];if(l.listStyle&&l.listStyle!==s.ListStyle.DECIMAL)return l.listStyle===s.ListStyle.CHECKBOX?(i.width+this.LIST_GAP)*n:this.UN_COUNT_STYLE_WIDTH*n;const r=e.reduce((d,u)=>(u.value===_&&(d+=1),d),0);if(!r)return 0;t.save(),t.font=this.getListFontStyle(e,n);const a=`${this.MEASURE_BASE_TEXT.repeat(String(r).length)}${s.KeyMap.PERIOD}`,c=t.measureText(a);return t.restore(),Math.ceil((c.width+this.LIST_GAP)*n)}drawListStyle(t,e,n){const{elementList:i,offsetX:l,listIndex:r,ascent:a}=e,c=i[0];if(c.value!==_||c.listWrap)return;let d=0;const{defaultTabWidth:u,scale:h}=this.options;for(let C=1;C<i.length&&i[C]?.type===s.ElementType.TAB;C++)d+=u*h;const{coordinate:{leftTop:[R,T]}}=n,g=R-l+d,f=T+a;if(c.listStyle===s.ListStyle.CHECKBOX){const{width:C,height:p,gap:I}=this.options.checkbox,m={...c,checkbox:{value:!!c.checkbox?.value},metrics:{...c.metrics,width:(C+I*2)*h,height:p*h}};this.draw.getCheckboxParticle().render({ctx:t,x:g-I*h,y:f,index:0,row:{...e,elementList:[m,...e.elementList]}})}else{let C="";if(c.listType===s.ListType.UL?C=Ni[c.listStyle]||Ni[En.DISC]:C=`${r+1}${s.KeyMap.PERIOD}`,!C)return;t.save(),t.font=this.getListFontStyle(i,h),t.fillText(C,g,f),t.restore()}}}class Po{options;static WIDTH=12;static HEIGHT=9;static GAP=3;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:l,lineBreak:{color:r,lineWidth:a}}=this.options;t.save(),t.beginPath();const c=i-Po.HEIGHT*l/2,d=n+e.metrics.width;t.translate(d,c),t.scale(l,l),t.strokeStyle=r,t.lineWidth=a,t.lineCap="round",t.lineJoin="round",t.beginPath(),t.moveTo(8,0),t.lineTo(12,0),t.lineTo(12,6),t.lineTo(3,6),t.moveTo(3,6),t.lineTo(6,3),t.moveTo(3,6),t.lineTo(6,9),t.stroke(),t.closePath(),t.restore()}}class Gl{draw;position;options;elementList;rowList;positionList;constructor(t){this.draw=t,this.position=t.getPosition(),this.options=t.getOptions(),this.elementList=[],this.rowList=[],this.positionList=[]}_recovery(){this.elementList=[],this.rowList=[],this.positionList=[]}_compute(t){this._computeRowList(),this._computePositionList(t)}_computeRowList(){const t=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:t,elementList:this.elementList})}_computePositionList(t){const{lineBreak:e,scale:n}=this.options,i=this.draw.getHeader().getExtraHeight(),l=this.draw.getInnerWidth(),r=this.draw.getMargins();let a=r[3];e.disabled||(a+=(Po.WIDTH+Po.GAP)*n);const c=t?.startY||r[0]+i;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:a,startY:c,innerWidth:l})}render(t,e){const{placeholder:n=this.options.placeholder}=e||{},{data:i,font:l,size:r,color:a,opacity:c}=n;this._recovery(),this.elementList=[{value:i,font:l,size:r,color:a}],ee(this.elementList,{editorOptions:this.options,isForceCompensation:!0}),this._compute(e);const d=this.draw.getInnerWidth();t.save(),t.globalAlpha=c,this.draw.drawRow(t,{elementList:this.elementList,positionList:this.positionList,rowList:this.rowList,pageNo:0,startIndex:0,innerWidth:d,isDrawLineBreak:!1}),t.restore()}}class UT{draw;options;range;fillRectMap;constructor(t){this.draw=t,this.options=t.getOptions(),this.range=t.getRange(),this.fillRectMap=new Map}setGroup(){if(this.draw.isReadonly()||this.draw.getZone().getZone()!==s.EditorZone.MAIN)return null;const t=this.range.getSelection();if(!t)return null;const e=ft();return t.forEach(n=>{Array.isArray(n.groupIds)||(n.groupIds=[]),n.groupIds.push(e)}),this.draw.render({isSetCursor:!1,isCompute:!1}),e}getElementListByGroupId(t,e){const n=[];for(let i=0;i<t.length;i++){const l=t[i];if(l.type===s.ElementType.TABLE){const r=l.trList;for(let a=0;a<r.length;a++){const c=r[a];for(let d=0;d<c.tdList.length;d++){const u=c.tdList[d],h=this.getElementListByGroupId(u.value,e);if(h.length)return n.push(...h),n}}}if(l?.groupIds?.includes(e)&&(n.push(l),!t[i+1]?.groupIds?.includes(e)))break}return n}deleteGroup(t){if(this.draw.isReadonly())return;const e=this.draw.getOriginalMainElementList(),n=this.getElementListByGroupId(e,t);if(n.length){for(let i=0;i<n.length;i++){const l=n[i],r=l.groupIds,a=r.findIndex(c=>c===t);r.splice(a,1),r.length||delete l.groupIds}this.draw.render({isSetCursor:!1,isCompute:!1})}}getContextByGroupId(t,e){for(let n=0;n<t.length;n++){const i=t[n];if(i.type===s.ElementType.TABLE){const r=i.trList;for(let a=0;a<r.length;a++){const c=r[a];for(let d=0;d<c.tdList.length;d++){const u=c.tdList[d],h=this.getContextByGroupId(u.value,e);if(h)return{...h,isTable:!0,index:n,trIndex:a,tdIndex:d,tdId:u.id,trId:c.id,tableId:i.tableId}}}}const l=t[n+1];if(i.groupIds?.includes(e)&&!l?.groupIds?.includes(e))return{isTable:!1,startIndex:n,endIndex:n}}return null}clearFillInfo(){this.fillRectMap.clear()}recordFillInfo(t,e,n,i,l){const r=t.groupIds;if(r)for(const a of r){const c=this.fillRectMap.get(a);c?c.width+=i:this.fillRectMap.set(a,{x:e,y:n,width:i,height:l})}}render(t){if(!this.fillRectMap.size)return;const e=this.range.getRange(),i=this.draw.getElementList()[e.endIndex]?.groupIds,{group:{backgroundColor:l,opacity:r,activeOpacity:a,activeBackgroundColor:c}}=this.options;t.save(),this.fillRectMap.forEach((d,u)=>{const{x:h,y:R,width:T,height:g}=d;i?.includes(u)?(t.globalAlpha=a,t.fillStyle=c):(t.globalAlpha=r,t.fillStyle=l),t.fillRect(h,R,T,g)}),t.restore(),this.clearFillInfo()}}class YT{options;constructor(t){this.options=t.getOptions()}render(t,e,n,i){const{scale:l,whiteSpace:{color:r,radius:a}}=this.options,c=e.metrics;t.save(),t.fillStyle=r,t.beginPath(),t.arc(n+c.width/2,i,a*l,0,Math.PI*2),t.fill(),t.closePath(),t.restore()}}class wT{draw;eventBus;pageContainer;constructor(t){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)),this.pageContainer.addEventListener("mousedown",this._mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this._mouseup.bind(this)),this.pageContainer.addEventListener("click",this._click.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)}_mousedown(t){this.eventBus.isSubscribe("mousedown")&&this.eventBus.emit("mousedown",t)}_mouseup(t){this.eventBus.isSubscribe("mouseup")&&this.eventBus.emit("mouseup",t)}_click(t){this.eventBus.isSubscribe("click")&&this.eventBus.emit("click",t)}}class vT{draw;options;constructor(t){this.draw=t,this.options=t.getOptions()}render(t,e){const{scale:n,lineNumber:{color:i,size:l,font:r,right:a,type:c}}=this.options,d=this.draw.getTextParticle(),u=this.draw.getMargins(),h=this.draw.getPosition().getOriginalMainPositionList(),T=this.draw.getPageRowList()[e];t.save(),t.fillStyle=i,t.font=`${l*n}px ${r}`;for(let g=0;g<T.length;g++){const f=T[g],{coordinate:{leftBottom:C}}=h[f.startIndex],p=c===s.LineNumberType.PAGE?g+1:f.rowIndex+1,I=d.measureText(t,{value:`${p}`}),m=u[3]-(I.width+a)*n,L=C[1]-I.actualBoundingBoxAscent*n;t.fillText(`${p}`,m,L)}t.restore()}}class ZT{draw;header;footer;options;constructor(t){this.draw=t,this.header=t.getHeader(),this.footer=t.getFooter(),this.options=t.getOptions()}render(t){const{scale:e,pageBorder:{color:n,lineWidth:i,padding:l}}=this.options;t.save(),t.translate(.5,.5),t.strokeStyle=n,t.lineWidth=i*e;const r=this.draw.getMargins(),a=r[3]-l[3]*e,c=r[0]+this.header.getExtraHeight()-l[0]*e,d=this.draw.getInnerWidth()+(l[1]+l[3])*e,u=this.draw.getHeight()-c-this.footer.getExtraHeight()-r[2]+l[2]*e;t.rect(a,c,d,u),t.stroke(),t.restore()}}function QT(o,t){const{value:e,oldValue:n}=t;n.isTable&&!e.isTable&&o.getTableTool().dispose()}class KT{draw;eventBus;constructor(t){this.draw=t,this.eventBus=t.getEventBus(),this.execute()}execute(){this.eventBus.on("positionContextChange",t=>{QT(this.draw,t)})}}class HT{draw;range;position;tableTool;tableParticle;options;constructor(t){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,n=!1){const{startIndex:i,endIndex:l}=this.range.getRange();if(!~i&&!~l)return;const{defaultTrMinHeight:r}=this.options.table,a=this.draw.getElementList();let c=0;if(a[i]?.listId){const f=this.position.getPositionList(),{rowIndex:C}=f[i];c=this.draw.getRowList()[C]?.offsetX||0}const d=this.draw.getContextInnerWidth()-c,u=[],h=d/e;for(let f=0;f<e;f++)u.push({width:h});const R=[];for(let f=0;f<t;f++){const C=[],p={height:r,tdList:C};for(let I=0;I<e;I++)C.push({colspan:1,rowspan:1,value:[]});R.push(p)}const T={type:s.ElementType.TABLE,value:"",tableEditable:n,colgroup:u,trList:R};ee([T],{editorOptions:this.options}),le(a,[T],i,{editorOptions:this.options});const g=i+1;this.draw.spliceElementList(a,g,i===l?0:l-i,[T]),this.range.setRange(g,g),this.draw.render({curIndex:g,isSetCursor:!1})}insertTableTopRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tableId:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=a[n];if(c.tdList.length<r.colgroup.length){const h=c.tdList[0].rowIndex;for(let R=0;R<n;R++){const T=a[R];for(let g=0;g<T.tdList.length;g++){const f=T.tdList[g];f.rowspan>1&&f.rowIndex+f.rowspan>=h+1&&(f.rowspan+=1)}}}const d=ft(),u={height:c.height,id:d,tdList:[]};for(let h=0;h<c.tdList.length;h++){const R=c.tdList[h],T=ft();u.tdList.push({id:T,rowspan:1,colspan:R.colspan,value:[{value:_,size:16,tableId:i,trId:d,tdId:T}]})}a.splice(n,0,u),this.position.setPositionContext({isTable:!0,index:e,trIndex:n,tdIndex:0,tdId:u.tdList[0].id,trId:u.id,tableId:i}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableBottomRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tableId:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=a[n],d=a.length-1===n?c:a[n+1];if(d.tdList.length<r.colgroup.length){const R=d.tdList[0].rowIndex;for(let T=0;T<n+1;T++){const g=a[T];for(let f=0;f<g.tdList.length;f++){const C=g.tdList[f];C.rowspan>1&&C.rowIndex+C.rowspan>=R+1&&(C.rowspan+=1)}}}const u=ft(),h={height:d.height,id:u,tdList:[]};for(let R=0;R<d.tdList.length;R++){const T=d.tdList[R],g=ft();h.tdList.push({id:g,rowspan:1,colspan:T.colspan,value:[{value:_,size:16,tableId:i,trId:u,tdId:g}]})}a.splice(n+1,0,h),this.position.setPositionContext({isTable:!0,index:e,trIndex:n+1,tdIndex:0,tdId:h.tdList[0].id,trId:h.id,tableId:r.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}adjustColWidth(t){if(t.type!==s.ElementType.TABLE)return;const{defaultColMinWidth:e}=this.options.table,n=t.colgroup,i=n.reduce((r,a)=>r+a.width,0),l=this.draw.getOriginalInnerWidth();if(i>l){const r=n.filter(c=>c.width>e),a=(i-l)/r.length;for(let c=0;c<n.length;c++){const d=n[c];d.width-a>=e&&(d.width-=a)}}}insertTableLeftCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,tableId:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=n;for(let h=0;h<a.length;h++){const R=a[h],T=ft();R.tdList.splice(c,0,{id:T,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:i,trId:R.id,tdId:T}]})}const{defaultColMinWidth:d}=this.options.table;r.colgroup.splice(c,0,{width:d}),this.adjustColWidth(r),this.position.setPositionContext({isTable:!0,index:e,trIndex:0,tdIndex:c,tdId:a[0].tdList[c].id,trId:a[0].id,tableId:i}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableRightCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,tableId:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=n+1;for(let h=0;h<a.length;h++){const R=a[h],T=ft();R.tdList.splice(c,0,{id:T,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:i,trId:R.id,tdId:T}]})}const{defaultColMinWidth:d}=this.options.table;r.colgroup.splice(c,0,{width:d}),this.adjustColWidth(r),this.position.setPositionContext({isTable:!0,index:e,trIndex:0,tdIndex:c,tdId:a[0].tdList[c].id,trId:a[0].id,tableId:r.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}deleteTableRow(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,trIndex:n,tdIndex:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=a[n],d=c.tdList[i].rowIndex;if(a.length<=1&&r.pagingIndex===0){this.deleteTable();return}for(let u=0;u<d;u++){const R=a[u].tdList;for(let T=0;T<R.length;T++){const g=R[T];g.rowIndex+g.rowspan>d&&g.rowspan--}}for(let u=0;u<c.tdList.length;u++){const h=c.tdList[u];if(h.rowspan>1){const R=ft(),T=a[n+1];T.tdList.splice(u,0,{id:R,rowspan:h.rowspan-1,colspan:h.colspan,value:[{value:_,size:16,tableId:r.id,trId:T.id,tdId:R}]})}}a.splice(n,1),this.position.setPositionContext({isTable:!1}),this.range.clearRange(),this.draw.render({curIndex:t.index}),this.tableTool.dispose()}deleteTableCol(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,trIndex:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,d=a[i].tdList[n].colIndex;if(!a.find(h=>h.tdList.length>1)){this.deleteTable();return}for(let h=0;h<a.length;h++){const R=a[h];for(let T=0;T<R.tdList.length;T++){const g=R.tdList[T];g.colIndex<=d&&g.colIndex+g.colspan>d&&(g.colspan>1?g.colspan--:R.tdList.splice(T,1))}}r.colgroup?.splice(d,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;const e=this.draw.getOriginalElementList(),n=e[t.index];let i=1,l=t.index;if(n.pagingId){l=t.index-n.pagingIndex;for(let a=l+1;a<e.length&&e[a].pagingId===n.pagingId;a++)i++}e.splice(l,i);const r=l-1;this.position.setPositionContext({isTable:!1,index:r}),this.range.setRange(r,r),this.draw.render({curIndex:r}),this.tableTool.dispose()}mergeTableCell(){const t=this.position.getPositionContext();if(!t.isTable)return;const{isCrossRowCol:e,startTdIndex:n,endTdIndex:i,startTrIndex:l,endTrIndex:r}=this.range.getRange();if(!e)return;const{index:a}=t,u=this.draw.getOriginalElementList()[a].trList;let h=u[l].tdList[n],R=u[r].tdList[i];(h.x>R.x||h.y>R.y)&&([h,R]=[R,h]);const T=h.colIndex,g=R.colIndex+(R.colspan-1),f=h.rowIndex,C=R.rowIndex+(R.rowspan-1),p=[];for(let N=0;N<u.length;N++){const X=u[N],D=[];for(let E=0;E<X.tdList.length;E++){const U=X.tdList[E],F=U.colIndex,Z=U.rowIndex;F>=T&&F<=g&&Z>=f&&Z<=C&&D.push(U)}D.length&&p.push(D)}if(!p.length)return;const I=p[p.length-1],m=p[0][0],L=I[I.length-1],O=m.x,P=m.y,S=L.x+L.width,y=L.y+L.height;for(let N=0;N<p.length;N++){const X=p[N];for(let D=0;D<X.length;D++){const E=X[D],U=E.x,F=E.y,Z=U+E.width,Q=F+E.height;if(O>U||P>F||S<Z||y<Q)return}}const Y=[],b=p[0][0],M=b.value[0];for(let N=0;N<p.length;N++){const X=p[N];for(let D=0;D<X.length;D++){const E=X[D];if(!(N===0&&D===0)){Y.push(E.id);const F=E.value.length>1?0:1;for(let Z=F;Z<E.value.length;Z++){const Q=E.value[Z];dn(In,M,Q),b.value.push(Q)}}N===0&&D!==0&&(b.colspan+=E.colspan),N!==0&&b.colIndex===E.colIndex&&(b.rowspan+=E.rowspan)}}for(let N=0;N<u.length;N++){const X=u[N];let D=0;for(;D<X.tdList.length;){const E=X.tdList[D];Y.includes(E.id)&&(X.tdList.splice(D,1),D--),D++}}this.position.setPositionContext({...t,trIndex:b.trIndex,tdIndex:b.tdIndex});const V=b.value.length-1;this.range.setRange(V,V),this.draw.render(),this.tableTool.render()}cancelMergeTableCell(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e,tdIndex:n,trIndex:i}=t,r=this.draw.getOriginalElementList()[e],a=r.trList,c=a[i],d=c.tdList[n];if(d.rowspan===1&&d.colspan===1)return;const u=d.colspan;if(d.colspan>1){for(let R=1;R<d.colspan;R++){const T=ft();c.tdList.splice(n+R,0,{id:T,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:r.id,trId:c.id,tdId:T}]})}d.colspan=1}if(d.rowspan>1){for(let R=1;R<d.rowspan;R++){const T=a[i+R];for(let g=0;g<u;g++){const f=ft();T.tdList.splice(d.colIndex,0,{id:f,rowspan:1,colspan:1,value:[{value:_,size:16,tableId:r.id,trId:T.id,tdId:f}]})}}d.rowspan=1}const h=d.value.length-1;this.range.setRange(h,h),this.draw.render(),this.tableTool.render()}splitVerticalTableCell(){const t=this.position.getPositionContext();if(!t.isTable||this.range.getRange().isCrossRowCol)return;const{index:n,tdIndex:i,trIndex:l}=t,a=this.draw.getOriginalElementList()[n],c=a.trList,d=c[l],u=d.tdList[i];a.colgroup.splice(i+1,0,{width:this.options.table.defaultColMinWidth});for(let h=0;h<c.length;h++){const R=c[h];let T=0;for(;T<R.tdList.length;){const g=R.tdList[T];if(g.rowIndex!==u.rowIndex)g.colIndex<=u.colIndex&&g.colIndex+g.colspan>u.colIndex&&g.colspan++;else if(g.id===u.id){const f=ft();d.tdList.splice(T+u.colspan,0,{id:f,rowspan:u.rowspan,colspan:1,value:[{value:_,size:16,tableId:a.id,trId:R.id,tdId:f}]}),T++}T++}}this.draw.render(),this.tableTool.render()}splitHorizontalTableCell(){const t=this.position.getPositionContext();if(!t.isTable||this.range.getRange().isCrossRowCol)return;const{index:n,tdIndex:i,trIndex:l}=t,a=this.draw.getOriginalElementList()[n],c=a.trList,u=c[l].tdList[i];let h=-1,R=0;for(;R<c.length;){if(R===h){R++;continue}const T=c[R];let g=0;for(;g<T.tdList.length;){const f=T.tdList[g];if(f.id===u.id){const C=ft(),p=ft();c.splice(R+u.rowspan,0,{id:C,height:this.options.table.defaultTrMinHeight,tdList:[{id:p,rowspan:1,colspan:u.colspan,value:[{value:_,size:16,tableId:a.id,trId:C,tdId:p}]}]}),h=R+u.rowspan}else f.rowIndex>=u.rowIndex&&f.rowIndex<u.rowIndex+u.rowspan&&f.rowIndex+f.rowspan>=u.rowIndex+u.rowspan&&f.rowspan++;g++}R++}this.draw.render(),this.tableTool.render()}tableTdVerticalAlign(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;for(let i=0;i<e.length;i++){const l=e[i];for(let r=0;r<l.length;r++){const a=l[r];!a||a.verticalAlign===t||!a.verticalAlign&&t===s.VerticalAlign.TOP||(a.verticalAlign=t)}}const{endIndex:n}=this.range.getRange();this.draw.render({curIndex:n})}tableBorderType(t){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:n}=e,l=this.draw.getOriginalElementList()[n];if(!l.borderType&&t===s.TableBorder.ALL||l.borderType===t)return;l.borderType=t;const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r})}tableBorderColor(t){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:n}=e,l=this.draw.getOriginalElementList()[n];if(!l.borderColor&&t===this.options.table.defaultBorderColor||l.borderColor===t)return;l.borderColor=t;const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r,isCompute:!1})}tableTdBorderType(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;const n=e.flat(),i=n.some(r=>!r.borderTypes?.includes(t));n.forEach(r=>{r.borderTypes||(r.borderTypes=[]);const a=r.borderTypes.findIndex(c=>c===t);i?~a||r.borderTypes.push(t):~a&&r.borderTypes.splice(a,1),r.borderTypes.length||delete r.borderTypes});const{endIndex:l}=this.range.getRange();this.draw.render({curIndex:l})}tableTdSlashType(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;const n=e.flat(),i=n.some(r=>!r.slashTypes?.includes(t));n.forEach(r=>{r.slashTypes||(r.slashTypes=[]);const a=r.slashTypes.findIndex(c=>c===t);i?~a||r.slashTypes.push(t):~a&&r.slashTypes.splice(a,1),r.slashTypes.length||delete r.slashTypes});const{endIndex:l}=this.range.getRange();this.draw.render({curIndex:l})}tableTdBackgroundColor(t){const e=this.tableParticle.getRangeRowCol();if(!e)return;for(let i=0;i<e.length;i++){const l=e[i];for(let r=0;r<l.length;r++){const a=l[r];a.backgroundColor=t}}const{endIndex:n}=this.range.getRange();this.range.setRange(n,n),this.draw.render({isCompute:!1})}tableSelectAll(){const t=this.position.getPositionContext(),{index:e,tableId:n,isTable:i}=t;if(!i||!n)return;const{startIndex:l,endIndex:r}=this.range.getRange(),c=this.draw.getOriginalElementList()[e].trList,d=c.length-1,u=c[d].tdList.length-1;this.range.replaceRange({startIndex:l,endIndex:r,tableId:n,startTdIndex:0,endTdIndex:u,startTrIndex:0,endTrIndex:d}),this.draw.render({isSetCursor:!1,isCompute:!1,isSubmitHistory:!1})}tableProperties(){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:e}=t,i=this.draw.getOriginalElementList()[e],l=this.draw.getOptions().table.tdPadding,r=i.tdPadding||l,a=document.createElement("div");a.className="table-properties-modal",a.setAttribute("editor-component","table-properties-modal"),a.innerHTML=`
537
537
  <div class="table-properties-modal__mask"></div>
538
538
  <div class="table-properties-modal__container">
539
539
  <div class="table-properties-modal__header">
@@ -563,7 +563,7 @@ ${h} `}textToElements(t){const e=[],n=t.split(`
563
563
  <button class="btn-confirm">确定</button>
564
564
  </div>
565
565
  </div>
566
- `,document.body.appendChild(a);const c=a.querySelector(".table-properties-modal__mask"),d=a.querySelector(".table-properties-modal__close"),u=a.querySelector(".btn-cancel"),h=a.querySelector(".btn-confirm"),R=()=>{a.remove()};c.addEventListener("click",R),d.addEventListener("click",R),u.addEventListener("click",R),h.addEventListener("click",()=>{const T=parseInt(a.querySelector("#tdPaddingTop").value)||0,g=parseInt(a.querySelector("#tdPaddingRight").value)||0,f=parseInt(a.querySelector("#tdPaddingBottom").value)||0,C=parseInt(a.querySelector("#tdPaddingLeft").value)||0;i.tdPadding=[T,g,f,C],R();const{endIndex:p}=this.range.getRange();this.draw.render({curIndex:p,isCompute:!0})})}}s.AreaMode=void 0,(function(o){o.EDIT="edit",o.READONLY="readonly",o.FORM="form"})(s.AreaMode||(s.AreaMode={}));class AT{draw;zone;range;position;options;areaInfoMap=new Map;constructor(t){this.draw=t,this.options=t.getOptions(),this.zone=t.getZone(),this.range=t.getRange(),this.position=t.getPosition()}getAreaInfo(){return this.areaInfoMap}getActiveAreaId(){if(!this.areaInfoMap.size)return null;const{startIndex:t}=this.range.getRange();return this.draw.getElementList()[t]?.areaId||null}getActiveAreaInfo(){const t=this.getActiveAreaId();return t&&this.areaInfoMap.get(t)||null}isReadonly(){const t=this.getActiveAreaInfo();if(!t?.area)return!1;switch(t.area.mode){case s.AreaMode.EDIT:return!1;case s.AreaMode.READONLY:return!0;case s.AreaMode.FORM:return!this.draw.getControl().getIsRangeWithinControl();default:return!1}}insertArea(t){const{id:e,value:n,area:i,position:l,range:r}=t;if(this.zone.getZone()!==s.EditorZone.MAIN&&this.zone.setZone(s.EditorZone.MAIN),this.draw.getPosition().setPositionContext({isTable:!1}),r&&!this.getActiveAreaId()){const{startIndex:c,endIndex:d}=r,u=this.draw.getOriginalMainElementList();if(!u[c]||!u[d])return null;this.range.setRange(r.startIndex,r.endIndex)}else if(l===s.LocationPosition.BEFORE)this.range.setRange(0,0);else{const d=this.draw.getOriginalMainElementList().length-1;this.range.setRange(d,d)}const a=e||ft();return this.draw.insertElementList([{type:s.ElementType.AREA,value:"",areaId:a,valueList:n,area:rt(i)}]),a}render(t,e){if(!this.areaInfoMap.size)return;t.save();const n=this.draw.getMargins(),i=this.draw.getInnerWidth();for(const l of this.areaInfoMap){const{area:r,positionList:a}=l[1];if(r?.hide||!r?.backgroundColor&&!r?.borderColor&&!r?.placeholder)continue;const c=a.filter(g=>g.pageNo===e);if(!c.length)continue;t.translate(.5,.5);const d=c[0],u=c[c.length-1],h=n[3],R=Math.ceil(d.coordinate.leftTop[1]),T=Math.ceil(u.coordinate.rightBottom[1]-R);t.textBaseline="middle",r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fillRect(h,R,i,T)),r.borderColor&&(t.strokeStyle=r.borderColor,t.strokeRect(h,R,i,T)),r.placeholder&&a.length<=1&&new Gl(this.draw).render(t,{placeholder:{...or,...r.placeholder},startY:d.coordinate.leftTop[1]}),t.translate(-.5,-.5)}t.restore()}compute(){this.areaInfoMap.clear();const t=this.draw.getOriginalMainElementList(),e=this.position.getOriginalMainPositionList();for(let n=0;n<t.length;n++){const i=t[n],l=i.areaId;if(l){const r=this.areaInfoMap.get(l);r?(r.elementList.push(i),r.positionList.push(e[n])):this.areaInfoMap.set(l,{id:l,area:i.area,elementList:[i],positionList:[e[n]]})}}}getAreaValue(t={}){const e=t.id||this.getActiveAreaId();if(!e)return null;const n=this.areaInfoMap.get(e);return n?{area:n.area,id:n.id,startPageNo:n.positionList[0].pageNo,endPageNo:n.positionList[n.positionList.length-1].pageNo,value:Ut(n.elementList)}:null}getContextByAreaId(t,e){const n=this.draw.getOriginalMainElementList();for(let i=0;i<n.length;i++){const l=n[i];if(e?.position===s.LocationPosition.OUTER_BEFORE){if(n[i+1]?.areaId!==t)continue}else if(e?.position===s.LocationPosition.AFTER){if(!(l.areaId===t&&n[i+1]?.areaId!==t))continue}else if(e?.position===s.LocationPosition.OUTER_AFTER){if(!(l.areaId!==t&&n[i-1]?.areaId===t))continue}else if(l.areaId!==t)continue;const r=this.position.getOriginalMainPositionList();return{range:{startIndex:i,endIndex:i},elementPosition:r[i]}}return null}setAreaProperties(t){const e=t.id||this.getActiveAreaId();if(!e)return;const n=this.areaInfoMap.get(e);if(!n)return;n.area||(n.area={});let i=!1;const l=["top","hide"];Object.entries(t.properties).forEach(([r,a])=>{if(Gs(a))return;const c=r;n.area[c]=a,l.includes(c)&&(i=!0)}),this.draw.render({isCompute:i,isSetCursor:!1})}setAreaValue(t){const e=t.id||this.getActiveAreaId();if(!e)return;const n=this.areaInfoMap.get(e);if(!n)return;const{positionList:i}=n,l=this.draw.getOriginalMainElementList(),r=t.value;ee([{type:s.ElementType.AREA,value:"",valueList:r,areaId:n.id,area:n.area}],{editorOptions:this.options}),this.draw.spliceElementList(l,i[0].index,i.length,r,{isIgnoreDeletedRule:!0}),this.draw.render({isSetCursor:!1})}}class _T{draw;options;imageCache;mainBadge;areaBadgeMap;constructor(t){this.draw=t,this.options=t.getOptions(),this.imageCache=new Map,this.mainBadge=null,this.areaBadgeMap=new Map}setMainBadge(t){this.mainBadge=t}setAreaBadgeMap(t){this.areaBadgeMap.clear(),t.forEach(e=>{this.areaBadgeMap.set(e.areaId,e.badge)})}_drawImage(t,e,n,i,l,r){if(this.imageCache.has(r)){const a=this.imageCache.get(r);t.drawImage(a,e,n,i,l)}else{const a=new Image;a.setAttribute("crossOrigin","Anonymous"),a.src=r,a.onload=()=>{this.imageCache.set(r,a),t.drawImage(a,e,n,i,l)}}}render(t,e){if(e===0&&this.mainBadge){const{scale:n,badge:i}=this.options,{left:l,top:r,width:a,height:c,value:d}=this.mainBadge,u=this.draw.getMargins()[0]+this.draw.getHeader().getExtraHeight(),h=(l||i.left)*n,R=(r||i.top)*n+u;this._drawImage(t,h,R,a*n,c*n,d)}if(this.areaBadgeMap.size){const n=this.draw.getArea().getAreaInfo();if(n.size){const{scale:i,badge:l}=this.options;for(const r of n){const{positionList:a}=r[1],c=a[0];if(c.pageNo!==e)continue;const d=this.areaBadgeMap.get(r[0]);if(!d)continue;const{left:u,top:h,width:R,height:T,value:g}=d,f=(u||l.left)*i,C=(h||l.top)*i+c.coordinate.leftTop[1];this._drawImage(t,f,C,R*i,T*i,g)}}}}}class BT{draw;options;data;pageContainer;isDrawing=!1;startStroke=null;constructor(t,e){this.draw=t,this.options=t.getOptions(),this.data=e||[],this.pageContainer=t.getPageContainer(),this.register()}register(){this.pageContainer.addEventListener("mousedown",this.start.bind(this)),this.pageContainer.addEventListener("mouseup",this.stop.bind(this)),this.pageContainer.addEventListener("mouseleave",this.stop.bind(this)),this.pageContainer.addEventListener("mousemove",this.drawing.bind(this))}start(t){if(!this.draw.isGraffitiMode())return;this.isDrawing=!0;const{scale:e}=this.options;this.startStroke={lineColor:this.options.graffiti.defaultLineColor,lineWidth:this.options.graffiti.defaultLineWidth,points:[t.offsetX/e,t.offsetY/e]}}stop(){this.isDrawing=!1}drawing(t){if(!this.isDrawing||!this.draw.isGraffitiMode())return;const{offsetX:e,offsetY:n}=t,i=2;if(this.startStroke&&Math.abs(this.startStroke.points[0]-e)<i&&Math.abs(this.startStroke.points[1]-n)<i)return;const l=this.draw.getPageNo();let r=this.data.find(d=>d.pageNo===l);if(this.startStroke&&(r||(r={pageNo:l,strokes:[]},this.data.push(r)),r.strokes.push(this.startStroke),this.startStroke=null),!r?.strokes?.length)return;const{scale:a}=this.options;r.strokes[r.strokes.length-1].points.push(e/a,n/a),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1})}getValue(){return this.data}compute(){const t=this.draw.getPageRowList().length;for(let e=this.data.length-1;e>=0;e--)this.data[e].pageNo>t-1&&this.data.splice(e,1)}clear(){this.data=[]}render(t,e){const n=this.data.find(a=>a.pageNo===e)?.strokes;if(!n?.length)return;const{graffiti:{defaultLineColor:i,defaultLineWidth:l},scale:r}=this.options;t.save();for(let a=0;a<n.length;a++){const c=n[a];t.beginPath(),t.strokeStyle=c.lineColor||i,t.lineWidth=(c.lineWidth||l)*r,t.moveTo(c.points[0]*r,c.points[1]*r);for(let d=2;d<c.points.length;d+=2)t.lineTo(c.points[d]*r,c.points[d+1]*r);t.stroke()}t.restore()}}const xl=1024,bn=/[\r\n\u200B]/,kT=['[aria-modal="true"]','[role="dialog"]','[data-overlay-active="true"]',".ant-modal-root",".ant-modal-wrap",".ant-modal",".ant-drawer",".ant-select-dropdown",".ant-picker-dropdown",".ant-dropdown",".ant-popover",".ant-tooltip",".ant-cascader-dropdown",".ant-mentions-dropdown"].join(", ");function Jl(o,t,e){for(let n=0;n<e.length;n+=xl){const i=e.slice(n,n+xl);o.splice(t+n,0,...i)}}class GT{container;pageContainer;pageList;ctxList;pageNo;renderCount;pendingRenderFrameId;pendingRenderOption;pagePixelRatio;mode;options;position;zone;elementList;listener;eventBus;override;i18n;canvasEvent;globalEvent;cursor;range;margin;background;badge;search;group;area;underline;strikeout;highlight;historyManager;previewer;imageParticle;laTexParticle;textParticle;tableParticle;tableTool;tableOperate;pageNumber;lineNumber;waterMark;placeholder;header;footer;hyperlinkParticle;labelParticle;macroParticle;dateParticle;separatorParticle;pageBreakParticle;superscriptParticle;subscriptParticle;checkboxParticle;radioParticle;menstrualHistoryParticle;fetalHeartPositionParticle;toothPositionParticle;blockParticle;listParticle;lineBreakParticle;whiteSpaceParticle;control;pageBorder;workerManager;scrollObserver;selectionObserver;imageObserver;graffiti;command;interactionPaused;overlayActiveCount;globalShortcutSuspended;LETTER_REG;WORD_LIKE_REG;rowList;pageRowList;painterStyle;painterOptions;visiblePageNoList;intersectionPageNo;lazyRenderIntersectionObserver;printModeData;readonlyModeData;splitTdValueMap=new Map;tdMap=new Map;constructor(t,e,n,i,l,r){this.container=this._wrapContainer(t),this.pageList=[],this.ctxList=[],this.pageNo=0,this.renderCount=0,this.pendingRenderFrameId=null,this.pendingRenderOption=null,this.pagePixelRatio=null,this.mode=e.mode,this.options=e,this.elementList=n.main,this.listener=i,this.eventBus=l,this.override=r,this._formatContainer(),this.pageContainer=this._createPageContainer(),this._createPage(0),this.i18n=new XT(e.locale),this.historyManager=new Xd(this),this.position=new yd(this),this.zone=new bT(this),this.range=new Nd(this),this.margin=new Wd(this),this.background=new bd(this),this.badge=new _T(this),this.search=new Ud(this),this.group=new UT(this),this.area=new AT(this),this.underline=new wd(this),this.strikeout=new Yd(this),this.highlight=new Vd(this),this.previewer=new MT(this),this.imageParticle=new $s(this),this.laTexParticle=new qs(this),this.textParticle=new vd(this),this.tableParticle=new Kd(this),this.tableTool=new Hd(this),this.tableOperate=new HT(this),this.pageNumber=new kn(this),this.lineNumber=new vT(this),this.waterMark=new zd(this),this.placeholder=new Gl(this),this.header=new kd(this,n.header),this.footer=new VT(this,n.footer),this.hyperlinkParticle=new Ad(this),this.labelParticle=new _d(this),this.macroParticle=new Bd(this),this.dateParticle=new OT(this),this.separatorParticle=new Jd(this),this.pageBreakParticle=new $d(this),this.superscriptParticle=new Gd,this.subscriptParticle=new xd,this.checkboxParticle=new gT(this),this.radioParticle=new TT(this),this.menstrualHistoryParticle=new fT(this),this.fetalHeartPositionParticle=new mT(this),this.toothPositionParticle=new CT(this),this.blockParticle=new DT(this),this.listParticle=new WT(this),this.lineBreakParticle=new Po(this),this.whiteSpaceParticle=new YT(this),this.control=new aT(this),this.pageBorder=new ZT(this),this.graffiti=new BT(this,n.graffiti),this.scrollObserver=new Zd(this),this.selectionObserver=new Qd(this),this.imageObserver=new yT,new wT(this),this.canvasEvent=new Dd(this),this.cursor=new Hc(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new Fd(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new PT(this),new KT(this);const{letterClass:a}=e;this.LETTER_REG=new RegExp(`[${a.join("")}]`),this.WORD_LIKE_REG=new RegExp(`${a.map(c=>`[^${c}][${c}]`).join("|")}`),this.rowList=[],this.pageRowList=[],this.painterStyle=null,this.painterOptions=null,this.visiblePageNoList=[],this.intersectionPageNo=0,this.lazyRenderIntersectionObserver=null,this.printModeData=null,this.readonlyModeData=null,this.interactionPaused=!1,this.overlayActiveCount=0,this.globalShortcutSuspended=!1,this.isPrintLikeMode()&&this.setPrintData(),this.mode===s.EditorMode.READONLY&&this.setReadonlyData(),this.mode,s.EditorMode.FORM,this.render({isInit:!0,isSetCursor:!1,isFirstRender:!0})}setPrintData(){this.printModeData||(this.printModeData=rt({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const t=rt(this.printModeData);["header","main","footer"].forEach(l=>{t[l]=this.control.filterAssistElement(t[l])});const n=t,i=this.removeStrikeout(n);t.main=i.main.filter(l=>!l.strikeout),this.setEditorData(i)}removeStrikeout(t){if(Array.isArray(t))return t.map(e=>this.removeStrikeout(e)).filter(e=>!(e&&typeof e=="object"&&"strikeout"in e&&e.strikeout===!0));if(t&&typeof t=="object"){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=this.removeStrikeout(t[n]));return e}return t}clearPrintData(){this.printModeData&&(this.setEditorData(rt(this.printModeData)),this.printModeData=null)}setReadonlyData(){this.readonlyModeData||(this.readonlyModeData=rt({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const t=rt(this.readonlyModeData);["header","main","footer"].forEach(n=>{const i=Ut(t[n],{editorOptions:this.options});t[n]=Zn(i),ee(t[n],{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData(t)}clearReadonlyData(){if(this.readonlyModeData){const t=rt(this.readonlyModeData);this.readonlyModeData=null,this.setEditorData(t)}}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}isPrintLikeMode(t=this.mode){return t===s.EditorMode.PRINT||t===s.EditorMode.COMPARE}getIsButtonRowStartPrefix(t,e,n){const i=t[e];if(this.isPrintLikeMode()||i.control?.type!==s.ControlType.BUTTON||i.control.buttonText||i.control.minWidth||i.controlComponent!==s.ControlComponent.PREFIX||!i.value)return!1;const l=t[e+1];return!l||l.controlId!==i.controlId||(l.originControlId||null)!==(i.originControlId||null)||l.controlComponent!==s.ControlComponent.VALUE||l.buttonValueLayout?!1:n.elementList.every(r=>r.value===_||ae(r))}getElementLayoutWidth(t){return t.control?.type===s.ControlType.BUTTON&&!t.control.buttonText&&t.controlComponent===s.ControlComponent.PREFIX&&t.left&&t.left<0?Math.max(0,t.metrics.width+t.left):t.metrics.width}isContentReadonly(){if(this.mode===s.EditorMode.COMPARE)return!0;if(this.area.getActiveAreaInfo()?.area?.mode)return this.area.isReadonly();switch(this.mode){case s.EditorMode.DESIGN:return!1;case s.EditorMode.READONLY:case s.EditorMode.PRINT:case s.EditorMode.GRAFFITI:return!0;case s.EditorMode.FORM:if(this.getIsInteractiveControlAtCursor())return!1;if(this.position.getPositionContext().isTable)return!this.isTableEditable()||this.getTd()?.disabled===!0;if(this.control.getIsRangeWithinControl()){const t=this.getElementList(),{startIndex:e}=this.range.getRange(),n=t[e];if(n?.control?.type===s.ControlType.TEXTFIELD){const i=n.controlId;if(i){for(let l=0;l<t.length;l++)if(t[l].originControlId===i&&t[l].controlId!==i)return!1}return!0}}return!this.control.getIsRangeWithinControl();default:return!1}}isSelectionDisabled(){return this.mode===s.EditorMode.COMPARE?!1:this.area.getActiveAreaInfo()?.area?.mode?this.area.isReadonly():this.mode===s.EditorMode.READONLY||this.mode===s.EditorMode.PRINT||this.mode===s.EditorMode.GRAFFITI}getIsInteractiveControlAtCursor(){const{startIndex:t}=this.range.getRange(),e=this.getElementList(),n=e[t];if(!n?.controlId||this.position.getPositionContext().isTable&&this.getTd()?.disabled)return!1;let i=n.control?.type;if(!i)for(let l=t;l>=0;l--){const r=e[l];if(!kt(r,n))break;if(r.control?.type){i=r.control.type;break}}return i?i!==s.ControlType.TEXTFIELD:!1}setMode(t){if(this.mode===t)return;const e=this.mode;this.macroParticle.clearInlineEditor({isSubmitHistory:!1}),this.mode=t,this.options.mode=t;const n=this.isPrintLikeMode(t);this.isPrintLikeMode(e)&&this.clearPrintData(),e===s.EditorMode.READONLY&&t!==s.EditorMode.READONLY&&this.clearReadonlyData(),n&&!this.printModeData&&(this.printModeData=rt({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const i=new Map,l=a=>{a.forEach(c=>{c.controlId&&(c.controlComponent==="value"&&i.set(c.controlId,!0),c.checked&&i.set(c.controlId,!0))})};l(this.elementList),this.elementList.forEach(a=>{a.type==="table"&&a.trList?.forEach(c=>{c.tdList?.forEach(d=>{l(d.value)})})});const r=a=>{a.forEach(c=>{if(!(!c.control&&!c.controlId)&&(c.controlComponent==="value"&&c.strikeout&&(n?c.hide=!0:c.hide=!1),!!c.control&&!(c.type!=="control"&&c.control.type!=="button"))){if(c.control.type==="TextField"&&(c.controlComponent==="placeholder"||c.controlComponent==="preTextFix"||c.controlComponent==="preTextFixText"||c.controlComponent==="postTextFix"||c.controlComponent==="postTextFixText"||c.controlComponent==="textFixLabel")&&(t===s.EditorMode.EDIT?c.hide=!1:c.hide=!0),c.control.type==="text"&&(c.controlComponent==="placeholder"||c.controlComponent==="prefix"||c.controlComponent==="postfix")&&(t===s.EditorMode.EDIT||t===s.EditorMode.FORM?c.hide=!1:c.hide=!0),c.control.type==="number"||c.control.type==="select"||c.control.type==="date"||c.control.type==="checkbox"||c.control.type==="radio"){if(c.controlComponent==="placeholder"||c.controlComponent==="prefix"||c.controlComponent==="postfix"){const u=i.get(c.controlId);c.control.type==="select"&&n||n&&!u?c.hide=!0:c.hide=!1}c.control.type==="number"&&c.controlComponent==="value"&&(n&&c.strikeout?c.hide=!0:!n&&c.strikeout&&(c.hide=!1))}c.control.type==="button"&&(c.hide=!1,c.control.hide=!1),c.control.type==="menstrualHistory"&&(c.controlComponent==="prefix"||c.controlComponent==="postfix")&&(n?c.hide=!0:c.hide=!1)}})};r(this.elementList),this.elementList.forEach(a=>{a.type==="table"&&a.trList.forEach(c=>{c.tdList.forEach(d=>{r(d.value)})})}),t===s.EditorMode.FORM?(this.elementList.filter(a=>a.type==="control").map(a=>{a.control?.type==="button"&&(a.controlComponent==="prefix"||a.controlComponent==="postfix"?(a.color="#1677FF",a.highlight="transparent"):a.controlComponent==="value"&&(a.color=this.options.defaultColor,a.highlight="transparent"))}),this.hideTextFieldWhitespace(this.elementList,!0),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):t===s.EditorMode.EDIT?(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!1,!0)),n?(this.elementList.filter(a=>a?.control?.type==="button").map(a=>{(a?.controlComponent==="prefix"||a?.controlComponent==="postfix")&&(a.color="transparent",a.highlight="transparent"),a?.controlComponent==="value"&&!a.control.buttonText&&(a.color=this.options.defaultColor,a.highlight="transparent")}),this.setPrintData()):(this.clearPrintData(),this.elementList.filter(a=>a?.control?.type==="button").map(a=>{(a?.controlComponent==="prefix"||a?.controlComponent==="postfix")&&(a.color="#1677FF",a.highlight="transparent"),a?.controlComponent==="value"&&!a.control.buttonText&&(a.color=this.options.defaultColor,a.highlight="transparent"),a?.type==="text"&&a.control.buttonText&&(a.color="#000"),a?.type==="control"&&a?.controlComponent==="value"&&a.control.buttonText&&(a.color="#000",a.highlight="transparent")})),t===s.EditorMode.READONLY&&this.setReadonlyData(),this.clearSideEffect(),this.control.destroyControl(),this.range.clearRange(),this.render({isSetCursor:!1,isSubmitHistory:!1})}hideTextFieldWhitespace(t,e){const n=a=>a?/^[\s\u00A0\u2000-\u200B\u3000\n\r\t]+$/.test(a):!1,i=(a,c)=>{for(let d=0;d<a.length;d++){const u=a[d];if(u.type===s.ElementType.TABLE&&u.trList)for(const h of u.trList)for(const R of h.tdList)i(R.value,c);u.originControlId&&u.controlId&&u.originControlId!==u.controlId&&c.add(u.originControlId)}},l=new Set;e&&i(t,l),(a=>{for(let c=0;c<a.length;c++){const d=a[c];if(d.type===s.ElementType.TABLE&&d.trList)for(const u of d.trList)for(const h of u.tdList)this.hideTextFieldWhitespace(h.value,e);d.control?.type===s.ControlType.TEXTFIELD&&d.controlComponent===s.ControlComponent.VALUE&&n(d.value)&&(d.controlId&&l.has(d.controlId)?d.hide=!1:d.hide=e)}})(t)}getSubTemplateRuntimeEndIndex(t,e,n){if(!n)return e+1;const i=new Set([n]);let l=e+1;for(;l<t.length;){const r=t[l];if(!r.subTemplateParentId||!i.has(r.subTemplateParentId))break;r.type===s.ElementType.SUB_TEMPLATE&&r.id&&i.add(r.id),l++}return l}syncSubTemplateRuntimeContent(){const t=new Set,e=n=>{if(!t.has(n)){t.add(n);for(let i=n.length-1;i>=0;i--){const l=n[i];if(l.type===s.ElementType.SUB_TEMPLATE&&l.id){const r=this.getSubTemplateRuntimeEndIndex(n,i,l.id),a=n.slice(i+1,r).filter(c=>c.subTemplateParentId===l.id);if(a.length){const c=Ut(a,{extraPickAttrs:["id","controlId"],editorOptions:this.options});Wl(c),l.subTemplateContent=c}}if(l.valueList?.length&&e(l.valueList),l.control?.value?.length&&e(l.control.value),l.type===s.ElementType.TABLE&&l.trList?.length)for(let r=0;r<l.trList.length;r++){const a=l.trList[r];for(let c=0;c<a.tdList.length;c++)e(a.tdList[c].value)}}}};e(this.getHeaderElementList()),e(this.elementList),e(this.getFooterElementList())}getLegacySubTemplateRuntimeEndIndex(t,e,n){if(!n.subTemplateExpanded||!n.subTemplateContent?.length)return e+1;const i=new Set;di(n.subTemplateContent,r=>{r.controlId&&i.add(r.controlId)});const l=(r,a)=>{const c=rt(r);ee(c,{isHandleFirstElement:!1,editorOptions:this.options});const d=[{expectedIndex:0,actualIndex:a}];for(;d.length;){let{expectedIndex:u,actualIndex:h}=d.pop(),R=!0;for(;u<c.length;){const T=t[h],g=c[u],f=!!(g.controlId&&i.has(g.controlId));if(!T||T.subTemplateParentId||T.type!==g.type||T.value!==g.value||f&&T.controlId!==g.controlId||T.controlComponent!==g.controlComponent){R=!1;break}const C=h+1;if(g.type===s.ElementType.SUB_TEMPLATE&&g.subTemplateContent?.length){const p=l(g.subTemplateContent,C);if(p!=null){d.push({expectedIndex:u+1,actualIndex:C}),u++,h=p;continue}}u++,h=C}if(R)return h}return null};return l(n.subTemplateContent,e+1)??e+1}syncSubTemplateExpandedState(t,e,n,i,l){let r=!1;n.id||(n.id=ft(),r=!0);let a=this.getSubTemplateRuntimeEndIndex(t,e,n.id);if(a===e+1&&n.subTemplateExpanded){const c=this.getLegacySubTemplateRuntimeEndIndex(t,e,n);c>e+1&&(t.splice(e+1,c-e-1),a=e+1,r=!0)}if(i&&!n.subTemplateContent?.length&&(i=!1),n.subTemplateExpanded!==i&&(n.subTemplateExpanded=i,r=!0),!!n.hide!==l&&(n.hide=l,r=!0),!i)return a>e+1&&(t.splice(e+1,a-e-1),r=!0),r;if(a===e+1){const c=rt(n.subTemplateContent||[]);ee(c,{isHandleFirstElement:!1,editorOptions:this.options}),Ws(c,n),c.length&&(t.splice(e+1,0,...c),r=!0)}else{const c=t.slice(e+1,a).filter(d=>d.subTemplateParentId===n.id);r=Ws(c,n)||r}return r}applySubTemplateRuntimeState(t,e){const n=i=>{let l=!1,r=0;for(;r<i.length;){const a=i[r];if(a.type===s.ElementType.SUB_TEMPLATE){const c=!!a.subTemplateConditions?.length;if(this.mode===s.EditorMode.EDIT)l=this.syncSubTemplateExpandedState(i,r,a,!0,!0)||l;else if((this.mode===s.EditorMode.FORM||this.isPrintLikeMode())&&c){const d=e?RT(a.subTemplateConditions,e,a.subTemplateRelation):!1;l=this.syncSubTemplateExpandedState(i,r,a,d,!0)||l}else(this.mode===s.EditorMode.FORM||this.isPrintLikeMode())&&!c?l=this.syncSubTemplateExpandedState(i,r,a,!0,!0)||l:this.mode!==s.EditorMode.FORM&&!this.isPrintLikeMode()&&(l=this.syncSubTemplateExpandedState(i,r,a,!1,!1)||l)}if(a.valueList?.length&&(l=n(a.valueList)||l),a.control?.value?.length&&(l=n(a.control.value)||l),a.type===s.ElementType.TABLE&&a.trList?.length)for(let c=0;c<a.trList.length;c++){const d=a.trList[c];for(let u=0;u<d.tdList.length;u++)l=n(d.tdList[u].value)||l}r++}return l};return n(t)}updateTextFieldPlaceholderVisibility(t,e,n){const i=[s.ControlType.TEXT,s.ControlType.TEXTFIELD,s.ControlType.SELECT,s.ControlType.DATE,s.ControlType.CHECKBOX,s.ControlType.RADIO,s.ControlType.NUMBER];(r=>{let a=0;for(;a<r.length;){const c=r[a];if(c.type===s.ElementType.TABLE&&c.trList)for(const d of c.trList)for(const u of d.tdList)this.updateTextFieldPlaceholderVisibility(u.value,e,n);if(c.control?.type&&i.includes(c.control.type)&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PRE_TEXT)){const d=c.controlId,u=c.control.type;let h=!1,R=!1,T=!1;const g=[],f=[],C=[];let p=-1,I=a;for(;I<r.length;){const m=r[I];if(m.controlId!==d){const L=m.controlId;let O=u===s.ControlType.TEXT,P=I;if(O)for(;P<r.length&&r[P].controlId===L;)P++;else for(;P<r.length;){const S=r[P];if(S.controlId!==L)break;S.controlComponent===s.ControlComponent.VALUE&&(S.value&&S.value.trim()||S.type===s.ElementType.MENSTRUAL_HISTORY||S.type===s.ElementType.FETAL_HEART_POSITION||S.type===s.ElementType.TOOTH_POSITION||S.type===s.ElementType.IMAGE||S.type===s.ElementType.MACRO||S.type===s.ElementType.CUSTOM_MACRO)&&(O=!0),P++}O&&(R=!0),I=P;continue}if((m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&f.push(I),m.controlComponent===s.ControlComponent.VALUE&&m.value&&m.value.trim()&&(h=!0),m.controlComponent===s.ControlComponent.VALUE&&(m.type===s.ElementType.MENSTRUAL_HISTORY||m.type===s.ElementType.FETAL_HEART_POSITION||m.type===s.ElementType.TOOTH_POSITION||m.type===s.ElementType.IMAGE||m.type===s.ElementType.MACRO||m.type===s.ElementType.CUSTOM_MACRO)&&(h=!0),m.controlComponent===s.ControlComponent.VALUE&&m.control&&m.control.type!==u&&(R=!0),m.controlComponent===s.ControlComponent.PLACEHOLDER&&(T=!0,g.push(I)),m.controlComponent===s.ControlComponent.POSTFIX||m.controlComponent===s.ControlComponent.POSTTEXTFIX||m.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){C.push(I),p=I;break}I++}if(h||R){if(T&&g.length>0)for(const m of g)r[m].hide=!0}else if(T&&g.length>0)for(const m of g)r[m].hide=!e;else e&&c.control?.placeholder&&(p>0?this.control.addPlaceholder(p-1):this.control.addPlaceholder(a));if(n)if(e&&(h||R)){for(const m of f)r[m].hide=!0;for(const m of C)r[m].hide=!0}else if(e){for(const m of f)r[m].hide=!1;for(const m of C)r[m].hide=!1}else{for(const m of f)r[m].hide=!0;for(const m of C)r[m].hide=!0}else{for(const m of f)r[m].hide=!1;for(const m of C)r[m].hide=!1}a=I}a++}})(t)}isReadonly(){return this.isContentReadonly()}isTableEditable(){const{index:t,isTable:e}=this.position.getPositionContext();if(!e||t===void 0)return!1;const n=this.getOriginalElementList()[t];return n?.type===s.ElementType.TABLE&&n.tableEditable===!0}isDisabled(){if(this.mode===s.EditorMode.DESIGN)return!1;const{startIndex:t,endIndex:e}=this.range.getRange(),n=this.getElementList();if(this.getTd()?.disabled)return!0;if(t===e){const l=n[t],r=n[t+1];return!!(l?.title?.disabled&&r?.title?.disabled&&l.titleId===r.titleId||l?.control?.disabled&&r?.control?.disabled&&l.controlId===r.controlId)}return n.slice(t+1,e+1).some(l=>l.title?.disabled||l.control?.disabled)}isDesignMode(){return this.mode===s.EditorMode.DESIGN}isPrintMode(){return this.mode===s.EditorMode.PRINT}isGraffitiMode(){return this.mode===s.EditorMode.GRAFFITI}getOriginalWidth(){const{paperDirection:t,width:e,height:n}=this.options;return t===s.PaperDirection.VERTICAL?e:n}getOriginalHeight(){const{paperDirection:t,width:e,height:n}=this.options;return t===s.PaperDirection.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,r=this.getOriginalElementList()[e],a=r.trList[n].tdList[i],c=this.getTdPadding(r);return a.width-c[1]-c[3]}return this.getOriginalInnerWidth()}getMargins(){return this.getOriginalMargins().map(t=>t*this.options.scale)}getOriginalMargins(){const{margins:t,paperDirection:e}=this.options;return e===s.PaperDirection.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}getHighlightMarginHeight(){return this.options.highlightMarginHeight*this.options.scale}getTdPadding(t){const{table:{tdPadding:e},scale:n}=this.options;return(t?.tdPadding||e).map(l=>l*n)}getContainer(){return this.container}getPageContainer(){return this.pageContainer}getEventTarget(t){return t instanceof Element?t:t instanceof Node?t.parentElement:null}isTargetInsideEditor(t){const e=this.getEventTarget(t);return e?this.container.contains(e)?!0:!!Hs(e,n=>!!n&&n.nodeType===1&&!!n.getAttribute(ve)):!1}isTargetInsideExternalOverlay(t){const e=this.getEventTarget(t);return!e||this.isTargetInsideEditor(e)?!1:!!e.closest(kT)}pauseInteraction(){this.interactionPaused=!0,this.flushPendingRender(),this.cursor?.getAgentDom().blur(),this.globalEvent?.resetSideEffect()}resumeInteraction(){this.interactionPaused=!1}setOverlayActive(t){this.overlayActiveCount=t?1:0,t&&(this.flushPendingRender(),this.cursor?.getAgentDom().blur(),this.globalEvent?.resetSideEffect())}suspendGlobalShortcut(t){this.globalShortcutSuspended=t}isInteractionSuspended(){return this.interactionPaused||this.overlayActiveCount>0}isGlobalShortcutActive(){return!this.globalShortcutSuspended&&!this.isInteractionSuspended()}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}getRenderCount(){return this.renderCount}requestRender(t){const e={...t||{}};(e.isSubmitHistory??!0)&&(this.submitHistory(e.curIndex),e.isSubmitHistory=!1,e.isContentChange=!0),this.pendingRenderOption=e,this.cursor.cancelPendingVisibilityCheck(),this.pendingRenderFrameId===null&&(this.pendingRenderFrameId=window.requestAnimationFrame(()=>{const n=this.pendingRenderOption||void 0;this.pendingRenderFrameId=null,this.pendingRenderOption=null,this.render(n)}))}flushPendingRender(){const t=this._takePendingRenderOption();t&&this.render(t)}_takePendingRenderOption(){if(this.pendingRenderFrameId===null)return null;window.cancelAnimationFrame(this.pendingRenderFrameId);const t=this.pendingRenderOption||{};return this.pendingRenderFrameId=null,this.pendingRenderOption=null,t}_cancelPendingRender(){this._takePendingRenderOption()}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:l}=e;return t[n].trList[i].tdList[l].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}getArea(){return this.area}getBadge(){return this.badge}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){const e=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:l}=e;return t[n]?.trList?.[i].tdList[l].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:l}=t;return l?this.getOriginalElementList()[e].trList[n].tdList[i]:null}getTdByPosition(t){const{index:e,trIndex:n,tdIndex:i,isTable:l}=t;return l?this.getOriginalElementList()[e].trList[n].tdList[i]:null}insertElementTextField(t,e={}){if(!t.length||!this.range.getIsCanInput())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const l=this.getElementList(),{isSubmitHistory:r=!0}=e;ee(t,{isHandleFirstElement:!1,editorOptions:this.options});let a=-1,c=this.control.getActiveControl();if(!c&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),c=this.control.getActiveControl()),c&&this.control.getIsRangeWithinControl()){const d=n===i,u=n+1;d||this.newSpliceElementList(l,u,i-n),this.newSpliceElementList(l,u,0,t),a=n+t.length}else{const d=n===i,u=n+1;d||this.newSpliceElementList(l,u,i-n),this.newSpliceElementList(l,u,0,t),a=n+t.length;const h=l[u-1];t[0].listId&&h&&!h.listId&&h?.value===_&&(!h.type||h.type===s.ElementType.TEXTFIELD)&&(l.splice(n,1),a-=1)}this.control.destroyControl(),~a&&(this.range.setRange(a,a),this.render({curIndex:a,isSubmitHistory:r}))}insertElementList(t,e={}){if(!t.length||!this.range.getIsCanInput())return;let{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const{isSubmitHistory:l=!0}=e;ee(t,{isHandleFirstElement:!1,editorOptions:this.options});let r=-1,a=this.control.getActiveControl();if(!a&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),a=this.control.getActiveControl()),a&&this.control.getIsRangeWithinControl()){const c=this.getElementList(),d=n===i;if(d&&(c[n]?.control?.type===s.ControlType.TEXTFIELD||c[n]?.control?.type===s.ControlType.TEXT)){this.range.shrinkBoundary();const P=this.range.getRange();n=P.startIndex,i=P.endIndex}const u=n+1,h=c[n],R=c[u],T=P=>!!(P&&(P.controlComponent===s.ControlComponent.POSTFIX||P.controlComponent===s.ControlComponent.POST_TEXT||P.controlComponent===s.ControlComponent.POSTTEXTFIX||P.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)),g=P=>!!(P&&(P.controlComponent===s.ControlComponent.PREFIX||P.controlComponent===s.ControlComponent.PRE_TEXT||P.controlComponent===s.ControlComponent.PRETEXTFIX||P.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)),f=P=>{if(P)return c.find(S=>S.controlId===P&&!S.originControlId&&!!S.control?.type)},C=h?.originControlId&&R?.originControlId===h.originControlId&&h.controlId&&R.controlId&&h.controlId!==R.controlId&&T(h)&&g(R)?f(h.originControlId):void 0,p=C?.control?.type===s.ControlType.TEXTFIELD,I=!!(h?.originControlId&&T(h)&&R?.controlId===h.originControlId&&!R.originControlId&&R.control?.type===s.ControlType.TEXTFIELD&&T(R)),m=!!(h?.originControlId&&T(h)&&R?.controlId===h.originControlId&&!R.originControlId&&R.control?.type===s.ControlType.TEXTFIELD&&R.controlComponent===s.ControlComponent.VALUE);if(h?.controlComponent===s.ControlComponent.PRE_TEXT||h?.controlComponent===s.ControlComponent.POST_TEXT||h?.controlComponent===s.ControlComponent.PREFIX||h?.controlComponent===s.ControlComponent.POSTFIX)for(let P=0;P<t.length;P++)t[P].control||(t[P].color=this.options.defaultColor);d&&!I&&!m&&(c[n]?.control?.type===s.ControlType.TEXTFIELD||c[n]?.control?.type===s.ControlType.TEXT)&&this.control.removePlaceholder(n),d||this.newSpliceElementList(c,u,i-n);const O=I||m||p?h.originControlId:c[n]?.controlId||c[n-1]?.controlId||c[n+1]?.controlId;for(let P=0;P<t.length;P++){if((I||m||p)&&!t[P].control&&(t[P].controlId=O,t[P].control=p?C?.control:R.control,t[P].controlComponent=s.ControlComponent.VALUE,delete t[P].originControlId),t[P]?.control?.type=="button"&&!t[P]?.control?.buttonText&&(t[P]?.controlComponent==="prefix"||t[P]?.controlComponent==="postfix"?(t[P].color="#1677FF",t[P].highlight="transparent"):(t[P].color=this.options.defaultColor,t[P].highlight="transparent")),t[P]?.type===s.ElementType.MENSTRUAL_HISTORY||t[P]?.type===s.ElementType.FETAL_HEART_POSITION||t[P]?.type===s.ElementType.TOOTH_POSITION||t[P]?.type===s.ElementType.IMAGE||t[P]?.type===s.ElementType.MACRO||t[P]?.type===s.ElementType.CUSTOM_MACRO||t[P]?.type===s.ElementType.REUSABLE_ITEM||t[P]?.type===s.ElementType.SUB_TEMPLATE||t[P]?.type===s.ElementType.SPECIAL_SYMBOLS){t[P].controlComponent=s.ControlComponent.VALUE;let S=c[n]?.controlId;S||(S=c[n-1]?.controlId),S||(S=c[n+1]?.controlId),!t[P].controlId&&S&&(t[P].controlId=S)}O&&t[P]?.control&&t[P].controlId&&t[P].controlId!==O&&(t[P].originControlId=O)}this.newSpliceElementList(c,u,0,t),r=n+t.length}else{const c=this.getElementList(),d=n===i,u=n+1;if(c[u]?.control?.type=="TextField"||c[n]?.control?.type=="TextField"){d||this.newSpliceElementList(c,u,i-n);for(let h=0;h<t.length;h++)if(t[h]?.type===s.ElementType.MENSTRUAL_HISTORY||t[h]?.type===s.ElementType.FETAL_HEART_POSITION||t[h]?.type===s.ElementType.TOOTH_POSITION||t[h]?.type===s.ElementType.MACRO||t[h]?.type===s.ElementType.CUSTOM_MACRO||t[h]?.type===s.ElementType.REUSABLE_ITEM||t[h]?.type===s.ElementType.SUB_TEMPLATE||t[h]?.type===s.ElementType.SPECIAL_SYMBOLS){t[h].controlComponent=s.ControlComponent.VALUE;const R=c[n]?.controlId||c[u]?.controlId;!t[h].controlId&&R&&(t[h].controlId=R)}this.newSpliceElementList(c,u,0,t),r=n+t.length}else{d||this.spliceElementList(c,u,i-n);for(let R=0;R<t.length;R++)t[R]?.control?.type=="button"&&!t[R]?.control?.buttonText&&(t[R]?.controlComponent==="prefix"||t[R]?.controlComponent==="postfix"?(t[R].color="#1677FF",t[R].highlight="transparent"):(t[R].color=this.options.defaultColor,t[R].highlight="transparent"));this.spliceElementList(c,u,0,t),r=n+t.length;const h=c[u-1];t[0].listId&&h&&!h.listId&&h?.value===_&&(!h.type||h.type===s.ElementType.TEXT)&&(c.splice(n,1),r-=1)}}~r&&(this.range.setRange(r,r),this.render({curIndex:r,isSubmitHistory:l}))}appendElementList(t,e={}){if(!t.length)return;ee(t,{isHandleFirstElement:!1,editorOptions:this.options});let n;const{isPrepend:i,isSubmitHistory:l=!0}=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,isSubmitHistory:l})}spliceElementList(t,e,n,i,l){const{isIgnoreDeletedRule:r=!1}=l||{},{group:a,modeRule:c}=this.options;if(n>0){const d=e+n,h=t[d]?.listId;if(h&&t[e-1]?.listId!==h){let R=d;for(;R<t.length;){const T=t[R];if(T.listId!==h||T.value===_)break;delete T.listId,delete T.listType,delete T.listStyle,R++}}if(!r&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const R=this.getTd()?.deletable;let T=d-1;for(;T>=e;){const g=t[T];(ae(g)||R!==!1&&g?.control?.deletable!==!1&&(!g.controlId||this.mode!==s.EditorMode.FORM||!c[this.mode].controlDeletableDisabled)&&g?.title?.deletable!==!1&&(a.deletable!==!1||!g.groupIds?.length)&&(g?.area?.deletable!==!1||g?.areaIndex!==0))&&t.splice(T,1),T--}}else t.splice(e,n)}if(i?.length){let d=t[e];for(let u=0;u<i.length;u++){const h=i[u].value===_&&(d?.controlComponent===s.ControlComponent.PREFIX||d?.controlComponent===s.ControlComponent.PRE_TEXT||d?.controlComponent===s.ControlComponent.PRETEXTFIX||d?.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT);!i[u].controlComponent&&d?.controlComponent&&!h&&(i[u].controlId=d.controlId,i[u].control=d.control,i[u].controlComponent=d.controlComponent),d=i[u]}Jl(t,e,i)}}newSpliceElementList(t,e,n,i,l){const{isIgnoreDeletedRule:r=!1}=l||{},{group:a,modeRule:c}=this.options;if(n>0){const u=e+n,R=t[u]?.listId;if(R&&t[e-1]?.listId!==R){let T=u;for(;T<t.length;){const g=t[T];if(g.listId!==R||g.value===_)break;delete g.listId,delete g.listType,delete g.listStyle,T++}}if(!r&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const T=this.getTd()?.deletable;let g=u-1;for(;g>=e;){const f=t[g];(ae(f)||T!==!1&&f?.control?.deletable!==!1&&(!f.controlId||this.mode!==s.EditorMode.FORM||!c[this.mode].controlDeletableDisabled)&&f?.title?.deletable!==!1&&(a.deletable!==!1||!f.groupIds?.length)&&(f?.area?.deletable!==!1||f?.areaIndex!==0))&&t.splice(g,1),g--}}else t.splice(e,n)}const d=t[e]?.controlId;if(i?.length){for(let u=0;u<i.length;u++)d&&i[u].controlId!==d&&(i[u].originControlId=d);Jl(t,e,i)}}getCanvasEvent(){return this.canvasEvent}getGlobalEvent(){return this.globalEvent}getListener(){return this.listener}getEventBus(){return this.eventBus}getOverride(){return this.override}getCursor(){return this.cursor}getPreviewer(){return this.previewer}getImageParticle(){return this.imageParticle}getTableTool(){return this.tableTool}getTableOperate(){return this.tableOperate}getTableParticle(){return this.tableParticle}getHeader(){return this.header}getFooter(){return this.footer}getHyperlinkParticle(){return this.hyperlinkParticle}getMacroParticle(){return this.macroParticle}getDateParticle(){return this.dateParticle}getListParticle(){return this.listParticle}getCheckboxParticle(){return this.checkboxParticle}getRadioParticle(){return this.radioParticle}getMenstrualHistoryParticle(){return this.menstrualHistoryParticle}getFetalHeartPositionParticle(){return this.fetalHeartPositionParticle}getToothPositionParticle(){return this.toothPositionParticle}getControl(){return this.control}getWorkerManager(){return this.workerManager}getImageObserver(){return this.imageObserver}getI18n(){return this.i18n}getGraffiti(){return this.graffiti}setCommand(t){this.command=t}getCommand(){return this.command}getRowCount(){return this.getRowList().length}async getDataURL(t={}){const{pixelRatio:e,mode:n}=t;e&&this.setPagePixelRatio(e);const i=this.mode,l=!!n&&i!==n;l&&this.setMode(n),this.render({isLazy:!1,isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),await this.imageObserver.allSettled();const r=this.pageList.map(a=>a.toDataURL());return e&&this.setPagePixelRatio(null),l&&this.setMode(i),r}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===s.PageMode.PAGING}setPageMode(t){if(!t||this.options.pageMode===t)return;if(this.options.pageMode=t,t===s.PageMode.PAGING){const{height:i}=this.options,l=this.getPagePixelRatio(),r=this.pageList[0];r.style.height=`${i}px`,r.height=i*l,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(s.EditorZone.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((r,a)=>{r.width=n*e,r.height=i*e,r.style.width=`${n}px`,r.style.height=`${i}px`,r.style.marginBottom=`${this.getPageGap()}px`,this._initPageContext(this.ctxList[a])});const l=this.position.getCursorPosition();this.render({isSubmitHistory:!1,isSetCursor:!!l,curIndex:l?.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,l)=>{i.width=e*t,i.height=n*t,this._initPageContext(this.ctxList[l])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperSize(t,e){this.options.width=t,this.options.height=e;const n=this.getPagePixelRatio(),i=this.getWidth(),l=this.getHeight();this.container.style.width=`${i}px`,this.pageList.forEach((r,a)=>{r.width=i*n,r.height=l*n,r.style.width=`${i}px`,r.style.height=`${l}px`,this._initPageContext(this.ctxList[a])}),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((l,r)=>{l.width=n*e,l.height=i*e,l.style.width=`${n}px`,l.style.height=`${i}px`,this._initPageContext(this.ctxList[r])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperMargin(t){this.options.margins=t,this.render({isSubmitHistory:!1,isSetCursor:!1})}getOriginValue(t={}){const{pageNo:e}=t,n=this.readonlyModeData;let i=n?.main||this.elementList;return Number.isInteger(e)&&e>=0&&e<this.pageRowList.length&&(i=this.pageRowList[e].flatMap(r=>r.elementList)),{header:n?.header||this.getHeaderElementList(),main:i,footer:n?.footer||this.getFooterElementList(),graffiti:this.graffiti.getValue()}}removeSubTemplateRuntimeElements(t){const e=rt(t),n=r=>{for(let a=r.length-1;a>=0;a--){const c=r[a];if(c.subTemplateParentId){r.splice(a,1);continue}c.valueList?.length&&(c.valueList=i(c.valueList)),c.control?.value?.length&&(c.control.value=i(c.control.value)),c.type===s.ElementType.TABLE&&c.trList?.length&&c.trList.forEach(d=>{d.tdList.forEach(u=>{u.value=i(u.value)})})}return r},i=r=>n(r),l=n(e);return Wl(l),l}getValue(t={}){this.syncSubTemplateRuntimeContent();const e=this.getOriginValue(t),{extraPickAttrs:n}=t,i={header:Ut(this.removeSubTemplateRuntimeElements(e.header),{extraPickAttrs:n,editorOptions:this.options}),main:Ut(this.removeSubTemplateRuntimeElements(e.main),{extraPickAttrs:n,isClassifyArea:!0,editorOptions:this.options}),footer:Ut(this.removeSubTemplateRuntimeElements(e.footer),{extraPickAttrs:n,editorOptions:this.options}),graffiti:e.graffiti};return{version:Cn,data:i,options:rt(this.options)}}setValue(t,e){const{header:n,main:i,footer:l}=rt(t);if(!n&&!i&&!l)return;const{isSetCursor:r=!1}=e||{};[n,i,l].forEach(d=>{d&&ee(d,{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData({header:n,main:i,footer:l}),this.mode===s.EditorMode.READONLY?(this.readonlyModeData=null,this.setReadonlyData()):this.isPrintLikeMode()&&(this.printModeData=null,this.setPrintData()),this.historyManager.recovery();const c=r?i?.length?i.length-1:0:void 0;c!==void 0&&this.range.setRange(c,c),this.render({curIndex:c,isSetCursor:r,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(ve,s.EditorComponent.MAIN)}_createPageContainer(){const t=document.createElement("div");return t.classList.add(`${st}-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 l=this.getPagePixelRatio();i.width=e*l,i.height=n*l,i.style.cursor="text";const r=i.getContext("2d");this._initPageContext(r),this.pageList.push(i),this.ctxList.push(r)}_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,l=t.font||i,r=t.actualSize||t.size||n;return`${t.italic?"italic ":""}${t.bold?"bold ":""}${r*e}px ${l}`}getElementSize(t){return t.actualSize||t.size||this.options.defaultSize}getElementRowMargin(t){const{defaultSize:e,defaultBasicRowMarginHeight:n,defaultRowMargin:i,scale:l}=this.options,r=t.size||e;let a=1;return r<12?a=r/12:r>30&&(a=1+(r-30)/30),n*a*(t.rowMargin??i)*l}computeRowList(t){const{innerWidth:e,elementList:n,isPagingMode:i=!1,isFromTable:l=!1,startX:r=0,startY:a=0,pageHeight:c=0,mainOuterHeight:d=0,surroundElementList:u=[]}=t,{defaultSize:h,scale:R,imgCaption:T,table:{tdPadding:g,defaultTrMinHeight:f},defaultTabWidth:C}=this.options,p=this.getDefaultBasicRowMarginHeight(),m=document.createElement("canvas").getContext("2d"),L=this.listParticle.computeListStyle(m,n),O=[],P=this._collectTextControlValueSet(n),S=this._collectTextControlHasContentSet(n);n.length&&O.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowIndex:0,rowFlex:n?.[0]?.rowFlex||n?.[1]?.rowFlex});let y=r,Y=a,b=0,M,V=0,N=0;for(let X=0;X<n.length;X++){const D=O[O.length-1],E=n[X];this.clearElementEffect(E);const U=this.getElementRowMargin(E),F={width:0,height:0,boundingBoxAscent:0,boundingBoxDescent:0},Z=D.offsetX||E.listId&&L.get(E.listId)||0,Q=e-Z,W=D.elementList.length===1;if(y+=W?Z:0,Y+=W&&D.offsetY||0,(E.control?.type===s.ControlType.TEXTFIELD||E.control?.type===s.ControlType.TEXT)&&!this.isDesignMode()&&(E.controlComponent===s.ControlComponent.PRETEXTFIX||E.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||E.controlComponent===s.ControlComponent.POSTTEXTFIX||E.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||E.controlComponent===s.ControlComponent.TEXTFIXLABEL||E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.PREFIX||E.controlComponent===s.ControlComponent.POSTFIX)){const nt=E.control?.type===s.ControlType.TEXTFIELD,z=E.controlId,G=!!z&&!!P?.has(z);if(nt){const J=!!z&&!!S?.has(z);this.mode===s.EditorMode.EDIT?E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.TEXTFIXLABEL?E.hide=J:E.hide=!1:E.hide=!0}else{const J=!!z&&!!S?.has(z);this.mode===s.EditorMode.EDIT||this.mode===s.EditorMode.FORM?E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.TEXTFIXLABEL?E.hide=J:E.hide=!1:E.hide=!0}}if(ae(E)&&!this.isDesignMode()){const nt=D.elementList[D.elementList.length-1];F.height=nt?.metrics.height||this.options.defaultSize*R,F.boundingBoxAscent=nt?.metrics.boundingBoxAscent||0,F.boundingBoxDescent=nt?.metrics.boundingBoxDescent||0}else if(E.type===s.ElementType.IMAGE||E.type===s.ElementType.LATEX)if(E.imgDisplay===s.ImageDisplay.SURROUND||E.imgDisplay===s.ImageDisplay.FLOAT_TOP||E.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM)F.width=0,F.height=0,F.boundingBoxDescent=0;else{const nt=E.width*R,z=E.height*R;if(nt>Q){const G=z*Q/nt;E.width=Q/R,E.height=G/R,F.width=Q,F.height=G,F.boundingBoxDescent=G}else F.width=nt,F.height=z,F.boundingBoxDescent=z;if(E.imgCaption?.value){const G=E.imgCaption.size||T.size,J=E.imgCaption.top??T.top,it=(G+J)*R;F.boundingBoxAscent+=it}}else if(E.type===s.ElementType.TABLE){const nt=E.tdPadding||g;if(E.pagingId){let q=X+1,ut=0;for(;q<n.length;){const gt=n[q];if(gt.pagingId===E.pagingId){const Ot=gt.trList.filter(Et=>!Et.pagingRepeat).filter(Et=>(Et.tdList=Et.tdList.filter(yt=>{if(yt.originalId){for(let Mt=0;Mt<E.trList.length;Mt++){const Ft=E.trList[Mt],Vt=Ft.tdList.find(({id:_t})=>_t===yt.originalId);if(Vt){yt.value[0]?.type===s.ElementType.SPLIT_TAG&&yt.value.splice(0,1),Vt.value.push(...yt.value.map(_t=>this.updateElementTableInfo(_t,E,Ft,Vt))),Vt.rowspan=Vt.originalRowspan??Vt.rowspan;break}}return!1}return!0}),!Et.originalId));E.trList.push(...Ot),E.height+=gt.height,q++,ut++}else break}ut&&n.splice(X+1,ut)}E.pagingIndex=E.pagingIndex??0,this.tableParticle.computeTrHeight(E,q=>this.computeRowList({innerWidth:(q.width-(nt[1]+nt[3]))*R,elementList:q.value,isFromTable:!0,isPagingMode:i})),E.trList?.forEach(q=>{q.tdList.forEach(ut=>{this.tdMap.set(ut.id,ut)})});const z=this.tableParticle.getTableHeight(E),G=this.tableParticle.getTableWidth(E);E.width=G,E.height=z;const J=G*R,it=z*R;if(F.width=J,F.height=it,F.boundingBoxDescent=it,F.boundingBoxAscent=-U,n[X+1]?.type===s.ElementType.TABLE&&(F.boundingBoxAscent-=U),i){const q=this.getHeight(),ut=this.getMainOuterHeight();let gt=ut;for(let Mt=0;Mt<O.length;Mt++){const Ft=O[Mt],Vt=Ft.offsetY||0;Ft.height+gt+Vt>q||O[Mt-1]?.isPageBreak?gt=ut+Ft.height+Vt:gt+=Ft.height+Vt}const Ot=U*2,Et=E.trList[0].height*R;(gt+Et+Ot>q||E.pagingIndex!==0&&E.trList[0].pagingRepeat||n[X-1]?.type===s.ElementType.PAGE_BREAK)&&(gt=ut);let yt=q-(gt+Ot);if(it>yt){const Mt=E.trList;let Ft=0,Vt=0,_t=0;for(let pt=0;pt<Mt.length;pt++){const ht=Mt[pt],Lt=ht.height*R;if(gt+Ot+_t+Lt>q){const Ct=ht;let St=0;const Kt={...rt(Ct),id:ft(),originalId:Ct.originalId??Ct.id,minHeight:void 0,tdList:E.colgroup.map((at,Pt)=>{if(St--,St>0)return;const et=Ct.tdList.find(qt=>qt.colIndex===Pt),$=et??this.tableParticle.findPreRowSpanTd(Mt,pt,Pt);et&&(St=et.colspan);const ne=ft();return $.originalRowspan=$.rowspan,et?{...et,id:ne,originalId:et.originalId??et.id,linkTdPrevId:et.id,tdIndex:Pt,original:$}:{id:ne,originalId:$.originalId??$.id,linkTdPrevId:$.id,tdIndex:Pt,colIndex:Pt,colspan:1,rowspan:1,value:[],rowList:[],original:$}}).filter(at=>!!at)},ge=Kt.tdList,Tt=ge.map(at=>at.original);Tt.forEach((at,Pt)=>{const et=[];let $=yt;if(at.rowspan>1){const qt=Mt.slice(at.trIndex,at.trIndex+pt-at.trIndex);$+=qt.reduce((Te,Bt)=>Bt.height*R+Te,0)}for(;at.mainHeight*R>$&&at.rowList?.length;){const qt=at.rowList.pop();at.value.splice(at.value.length-qt.elementList.length),et.unshift(qt),at.mainHeight-=qt.height}const ne=ge[Pt];ne.rowList=et,ne.value=et.map(qt=>qt.elementList).flat()});let tt=!0;const Dt=Ct.tdList.some(at=>at.rowList?.length),vt=Kt.tdList.some(at=>at.rowList?.length),jt=Ct.minHeight>yt;if(vt||jt){(Dt||!vt&&jt)&&(jt&&(Ct.originalMinHeight=Ct.minHeight,Ct.minHeight=yt,Kt.minHeight=Math.max(Ct.originalMinHeight-yt,f)),Kt.tdList.forEach(at=>{at.original.linkTdNextId=at.id,at.value.length&&at.value[0].value!==_&&at.value.unshift({...at.original.value.slice(-1).pop(),value:_,type:s.ElementType.SPLIT_TAG})}),Mt.splice(Ft+1,0,Kt),Ft+=1,Vt=Mt.length-Ft,tt=!1),Tt.forEach(at=>{if(at.rowspan>1){const Pt=at.rowspan-(pt-at.trIndex);at.rowspan=pt-at.trIndex+(Dt?1:0);const et=Kt.tdList.find($=>$.colIndex===at.colIndex);Dt?et.rowspan=Pt:(et.original.linkTdNextId=et.id,Ct.tdList.push({...at,...et,rowspan:Pt}),Ct.tdList.sort(($,ne)=>$.colIndex-ne.colIndex),et.value=[])}}),tt&&Tt.forEach((at,Pt)=>{at.value.push(...ge[Pt].value)});break}}Ft=pt+1,Vt=Mt.length-Ft,_t+=Lt,yt-=Lt}if(Vt){const pt=Mt.splice(Ft,Vt),ht=E.pagingId||ft();E.pagingId=ht;const Lt=rt(E);Lt.originalId=E.originalId??E.id,Lt.pagingId=ht,Lt.pagingIndex=E.pagingIndex+1;const Ct=Mt.filter(ge=>ge.pagingRepeat);if(Ct.length){const ge=rt(Ct);ge.forEach(Tt=>Tt.id=ft()),pt.unshift(...ge)}Lt.trList=pt,Lt.id=ft(),Lt.trList?.forEach(ge=>{ge.tdList.forEach(Tt=>{if(delete Tt.valueStartIndex,Tt.linkTdPrevId){const tt=this.getTdById(Tt.linkTdPrevId);Tt.valueStartIndex=tt?(tt.valueStartIndex??0)+tt.value.length:0,this.splitTdValueMap.has(Tt.originalId)?this.splitTdValueMap.get(Tt.originalId).push(...Tt.value):tt&&this.splitTdValueMap.set(Tt.originalId,[...tt.value,...Tt.value])}Tt.value.forEach(tt=>this.updateElementTableInfo(tt,Lt,ge,Tt))})}),this.spliceElementList(n,X+1,0,[Lt]),this.tableParticle.computeTrHeight(E);const St=this.tableParticle.getTableHeight(E),Kt=St*R;E.height=St,F.height=Kt,F.boundingBoxDescent=Kt}}if(E.pagingId){const Mt=this.position.getPositionContext();if(Mt.isTable){let Ft=-1,Vt=-1,_t=X;for(;_t<n.length;){const pt=n[_t];if(pt.pagingId!==E.pagingId)break;const ht=pt.trList.findIndex(Lt=>Lt.id===Mt.trId);if(~ht){Ft=_t,Vt=ht;break}_t++}~Ft&&(Mt.index=Ft,Mt.trIndex=Vt,this.position.setPositionContext(Mt))}}}this.initTableElementIndex(E,X)}else if(E.type===s.ElementType.SEPARATOR){const{separator:{lineWidth:nt}}=this.options,z=E.lineWidth||nt;E.width=Q/R,F.width=Q,F.height=z*R,F.boundingBoxAscent=-U,F.boundingBoxDescent=-U+F.height}else if(E.type===s.ElementType.PAGE_BREAK)E.width=Q/R,F.width=Q,F.height=h;else if(E.type===s.ElementType.RADIO||E.controlComponent===s.ControlComponent.RADIO){const{width:nt,height:z,gap:G}=this.options.radio,J=nt+G*(E.controlComponent?1:2);E.width=J,F.width=J*R,F.height=z*R}else if(E.type===s.ElementType.CHECKBOX||E.controlComponent===s.ControlComponent.CHECKBOX){const{width:nt,height:z,gap:G}=this.options.checkbox,J=nt+G*(E.controlComponent?1:2);E.width=J,F.width=J*R,F.height=z*R}else if(E.type===s.ElementType.MENSTRUAL_HISTORY){const nt=this.menstrualHistoryParticle.computeSize(E);E.width=nt.width/R,F.width=nt.width,F.height=nt.height,F.boundingBoxAscent=nt.height,F.boundingBoxDescent=0}else if(E.type===s.ElementType.FETAL_HEART_POSITION){const nt=this.fetalHeartPositionParticle.computeSize();E.width=nt.width/R,F.width=nt.width,F.height=nt.height,F.boundingBoxAscent=nt.height/2,F.boundingBoxDescent=nt.height/2}else if(E.type===s.ElementType.TOOTH_POSITION){const nt=this.toothPositionParticle.computeSize(E);E.width=nt.width/R,F.width=nt.width,F.height=nt.height,F.boundingBoxAscent=nt.height/2,F.boundingBoxDescent=nt.height/2}else if(E.type===s.ElementType.TAB)F.width=C*R,F.height=h*R,F.boundingBoxDescent=0,F.boundingBoxAscent=this.textParticle.getBasisWordBoundingBoxAscent(m,m.font);else if(E.type===s.ElementType.BLOCK){if(!E.width)F.width=Q;else{const nt=E.width*R;F.width=Math.min(nt,Q)}F.height=E.height*R,F.boundingBoxDescent=F.height,F.boundingBoxAscent=0}else if(E.type===s.ElementType.LABEL){const{defaultSize:nt,label:{defaultPadding:z}}=this.options;m.font=this.getElementFont(E);const G=this.textParticle.measureText(m,E);F.width=(G.width+z[1]+z[3])*R,F.height=(E.size||nt)*R,F.boundingBoxDescent=0,F.boundingBoxAscent=(z[0]+G.actualBoundingBoxAscent)*R}else if(E.type===s.ElementType.MACRO||E.type===s.ElementType.CUSTOM_MACRO||E.type===s.ElementType.REUSABLE_ITEM||E.type===s.ElementType.SUB_TEMPLATE){const{defaultSize:nt}=this.options;m.font=this.getElementFont(E);const z=this.getMode(),G=z===s.EditorMode.EDIT,J=z===s.EditorMode.FORM;if(z===s.EditorMode.READONLY&&E.type!==s.ElementType.SUB_TEMPLATE){const q=Wo(E).split(bn),ut=q.reduce((Et,yt)=>Math.max(Et,m.measureText(yt).width),0),gt=(E.size||nt)*R,Ot=m.measureText(q[0]);F.width=ut,F.height=gt*q.length,F.boundingBoxDescent=Ot.actualBoundingBoxDescent+gt*(q.length-1),F.boundingBoxAscent=Ot.actualBoundingBoxAscent}else if(G){const it=E.label||E.value||"";m.font=this.getElementFont(E);const q=m.measureText(it),ut=8*R,gt=4*R;F.width=q.width+ut*2;const Ot=q.actualBoundingBoxAscent+q.actualBoundingBoxDescent;F.height=Ot+gt*2;const Et=this.textParticle.measureBasisWord(m,this.getElementFont(E));F.boundingBoxAscent=Et.actualBoundingBoxAscent*R,F.boundingBoxDescent=Et.actualBoundingBoxDescent*R}else if(E.type===s.ElementType.CUSTOM_MACRO){const it=E.macroConfig,q=it?.value||"";if(J){const ut=it?.type||"text",gt=this.textParticle.measureText(m,E),Ot=E.label||"";if(ut==="select"){const Et=q||`请选择${Ot}`,yt=m.measureText(Et),Mt=m.measureText("[").width,Ft=6*R+2*R;F.width=Mt+yt.width+Ft+Mt}else{const yt=(q||`请输入${Ot}`).split(bn),Mt=yt.reduce((_t,pt)=>Math.max(_t,m.measureText(pt).width),0),Ft=m.measureText("[").width,Vt=(E.size||nt)*R;F.width=Ft+Mt+Ft,F.height=Vt*yt.length,F.boundingBoxAscent=gt.actualBoundingBoxAscent*R,F.boundingBoxDescent=gt.actualBoundingBoxDescent*R+Vt*(yt.length-1)}ut==="select"&&(F.height=(E.size||nt)*R,F.boundingBoxDescent=gt.actualBoundingBoxDescent*R,F.boundingBoxAscent=gt.actualBoundingBoxAscent*R)}else{const ut=E.label||"",Ot=(q||`请输入${ut}`).split(bn),Et=Ot.reduce((Ft,Vt)=>Math.max(Ft,m.measureText(Vt).width),0),yt=(E.size||nt)*R,Mt=m.measureText(Ot[0]);F.width=Et,F.height=yt*Ot.length,F.boundingBoxDescent=Mt.actualBoundingBoxDescent+yt*(Ot.length-1),F.boundingBoxAscent=Mt.actualBoundingBoxAscent}}else if(E.type===s.ElementType.REUSABLE_ITEM){const q=E.reusableItemConfig?.value||"",ut=E.label||"";if(J){const gt=this.textParticle.measureText(m,E),Et=(q||`请输入${ut}`).split(bn),yt=Et.reduce((Vt,_t)=>Math.max(Vt,m.measureText(_t).width),0),Mt=m.measureText("[").width,Ft=(E.size||nt)*R;F.width=Mt+yt+Mt,F.height=Ft*Et.length,F.boundingBoxDescent=gt.actualBoundingBoxDescent*R+Ft*(Et.length-1),F.boundingBoxAscent=gt.actualBoundingBoxAscent*R}else{const Ot=(q||`获取 ${ut}`).split(bn),Et=Ot.reduce((Ft,Vt)=>Math.max(Ft,m.measureText(Vt).width),0),yt=(E.size||nt)*R,Mt=m.measureText(Ot[0]);F.width=Et,F.height=yt*Ot.length,F.boundingBoxDescent=Mt.actualBoundingBoxDescent+yt*(Ot.length-1),F.boundingBoxAscent=Mt.actualBoundingBoxAscent}}else if(E.type===s.ElementType.SUB_TEMPLATE){const it=E.label||"子模板";if(J){const q=m.measureText(it),ut=8*R,gt=4*R,Ot=q.actualBoundingBoxAscent+q.actualBoundingBoxDescent;F.width=q.width+ut*2,F.height=Ot+gt*2;const Et=this.textParticle.measureBasisWord(m,this.getElementFont(E));F.boundingBoxAscent=Et.actualBoundingBoxAscent*R,F.boundingBoxDescent=Et.actualBoundingBoxDescent*R}else{const q=m.measureText(it);F.width=q.width,F.height=(E.size||nt)*R,F.boundingBoxDescent=q.actualBoundingBoxDescent,F.boundingBoxAscent=q.actualBoundingBoxAscent}}else{const it=E.label||"",q=E.value||`获取 ${it}`,ut=m.measureText(q);F.width=ut.width,F.height=(E.size||nt)*R,F.boundingBoxDescent=ut.actualBoundingBoxDescent,F.boundingBoxAscent=ut.actualBoundingBoxAscent}}else{const nt=E.size||h;(E.type===s.ElementType.SUPERSCRIPT||E.type===s.ElementType.SUBSCRIPT)&&(E.actualSize=Math.ceil(nt*.6)),F.height=(E.actualSize||nt)*R,m.font=this.getElementFont(E);const z=this.textParticle.measureText(m,E),G=E.buttonValueLayoutPrefixOffset?m.measureText("[").width:0;F.width=Math.max(0,z.width-G)*R,E.letterSpacing&&(F.width+=E.letterSpacing*R);const J=this.textParticle.measureBasisWord(m,E.font);F.boundingBoxAscent=J.actualBoundingBoxAscent*R,F.boundingBoxDescent=J.actualBoundingBoxDescent*R,E.type===s.ElementType.SUPERSCRIPT?F.boundingBoxAscent+=F.height/2:E.type===s.ElementType.SUBSCRIPT&&(F.boundingBoxDescent+=F.height/2)}const K=!ae(E)&&(E.imgDisplay!==s.ImageDisplay.INLINE&&E.type===s.ElementType.IMAGE||E.type===s.ElementType.LATEX)?F.height+U:F.boundingBoxAscent+U,k=U+F.boundingBoxAscent+F.boundingBoxDescent+U,B=Object.assign(E,{metrics:F,left:0,style:this.getElementFont(E,R)});this.getIsButtonRowStartPrefix(n,X,D)&&(B.left=-F.width);const H=this.getElementLayoutWidth(B);B.control?.minWidth&&(B.controlComponent&&(N+=F.width),B.controlComponent===s.ControlComponent.POSTFIX&&(this.control.setMinWidthControlInfo({row:D,rowElement:B,availableWidth:Q,controlRealWidth:N}),N=0));const A=n[X-1];let v=n[X+1],ct=D.width+H;if(this.options.wordBreak===s.WordBreak.BREAK_WORD&&(!A?.type||A?.type===s.ElementType.TEXT)&&(!E.type||E.type===s.ElementType.TEXT)){const nt=`${A?.value||""}${E.value}`;if(this.WORD_LIKE_REG.test(nt)){const{width:G,endElement:J}=this.textParticle.measureWord(m,n,X),it=G*R;J&&it<=Q?(ct+=it,v=J):A&&(ct+=it)}const z=this.textParticle.measurePunctuationWidth(m,v);ct+=z*R}E.listId&&(E.listId!==M?V=0:E.value===_&&!E.listWrap&&V++),M=E.listId;const bt=this.position.setSurroundPosition({pageNo:b,rowElement:B,row:D,rowElementRect:{x:y,y:Y,height:k,width:H},availableWidth:Q,surroundElementList:u});y=bt.x,ct+=bt.rowIncreaseWidth,y+=H;let Qt=!1;if(this.mode===s.EditorMode.FORM&&E.control?.type===s.ControlType.BUTTON&&E.controlComponent===s.ControlComponent.PREFIX&&D.elementList.filter(nt=>nt.controlId!==E.controlId).length>0){const nt=E.controlId;if(n.some(G=>G.controlId===`${nt}_text`&&G.control?.type===s.ControlType.BUTTON)){let G=0;for(let J=X;J<n.length;J++){const it=n[J];if(it.controlId!==nt)break;m.font=this.getElementFont(it);const q=this.textParticle.measureText(m,it);if(G+=q.width*R,it.controlComponent===s.ControlComponent.POSTFIX)break}for(let J=0;J<n.length;J++){const it=n[J];if(it.controlId===`${nt}_text`){m.font=this.getElementFont(it);const q=this.textParticle.measureText(m,it);G+=q.width*R}}Qt=D.width+G>Q}}const Ce=E.type===s.ElementType.SEPARATOR||E.type===s.ElementType.TABLE||A?.type===s.ElementType.TABLE||A?.type===s.ElementType.CUSTOM_MACRO&&bn.test(A.macroConfig?.value||"")||A?.type===s.ElementType.REUSABLE_ITEM&&bn.test(A.reusableItemConfig?.value||"")||A?.type===s.ElementType.BLOCK||E.type===s.ElementType.BLOCK||A?.imgDisplay===s.ImageDisplay.INLINE||E.imgDisplay===s.ImageDisplay.INLINE||A?.listId!==E.listId||A?.areaId!==E.areaId&&!E.area?.hide||E.control?.flexDirection===s.FlexDirection.COLUMN&&(E.controlComponent===s.ControlComponent.CHECKBOX||E.controlComponent===s.ControlComponent.RADIO)&&A?.controlComponent===s.ControlComponent.VALUE||X!==0&&E.value===_&&!E.area?.hide||Qt,Gt=ct>Q,Re=Ce||Gt;if(Re){const nt={width:H,height:k,startIndex:X,elementList:[B],ascent:K,rowIndex:D.rowIndex+1,rowFlex:n[X]?.rowFlex||n[X+1]?.rowFlex,isPageBreak:E.type===s.ElementType.PAGE_BREAK};if(B.controlComponent!==s.ControlComponent.PREFIX&&B.control?.indentation===s.ControlIndentation.VALUE_START){const z=D.elementList.findIndex(G=>G.controlId===B.controlId&&G.controlComponent!==s.ControlComponent.PREFIX);if(~z){const J=this.position.computeRowPosition({row:D,innerWidth:this.getInnerWidth()})[z];J&&(nt.offsetX=J.coordinate.leftTop[0])}}E.listId&&(nt.isList=!0,nt.offsetX=L.get(E.listId),nt.listIndex=V),nt.offsetY=!l&&E.area?.top&&E.areaId!==n[X-1]?.areaId?E.area.top*R:0,O.push(nt)}else D.width+=H,X===0&&(An(n[1])||n[1]?.areaId)?(D.height=p,D.ascent=p):D.height<k&&(D.height=k,D.ascent=K),D.elementList.push(B);if((Re||X===n.length-1)&&(D.isWidthNotEnough=Gt&&!Ce,!D.isSurround&&(A?.rowFlex===s.RowFlex.JUSTIFY||A?.rowFlex===s.RowFlex.ALIGNMENT&&D.isWidthNotEnough))){const nt=D.elementList[0]?.value===_?D.elementList.slice(1):D.elementList,z=(Q-D.width)/(nt.length-1);for(let G=0;G<nt.length-1;G++){const J=nt[G];J.metrics.width+=z}D.width=Q}if(Re){y=r,Y+=D.height,i&&!l&&c&&(Y-a+d+k>c||E.type===s.ElementType.PAGE_BREAK)&&(Y=a,Vc(u,b),b+=1),B.left=0;const nt=O[O.length-1];y=this.position.setSurroundPosition({pageNo:b,rowElement:B,row:nt,rowElementRect:{x:y,y:Y,height:k,width:H},availableWidth:Q,surroundElementList:u}).x,y+=H}}return O}_collectTextControlValueSet(t){if(this.isDesignMode()||this.mode===s.EditorMode.EDIT)return null;const e=new Set;for(let i=0;i<t.length;i++){const l=t[i];l.controlId&&(l.control?.type===s.ControlType.TEXT||l.control?.type===s.ControlType.TEXTFIELD)&&e.add(l.controlId)}const n=new Set;for(let i=0;i<t.length;i++){const l=t[i];l.controlId&&l.controlComponent===s.ControlComponent.VALUE&&e.has(l.controlId)&&n.add(l.controlId)}return n}_collectTextControlHasContentSet(t){if(this.isDesignMode())return null;const e=new Set;let n=0;for(;n<t.length;){const i=t[n];if(i.controlId&&(i.control?.type===s.ControlType.TEXT||i.control?.type===s.ControlType.TEXTFIELD)&&(i.controlComponent===s.ControlComponent.PREFIX||i.controlComponent===s.ControlComponent.PRE_TEXT||i.controlComponent===s.ControlComponent.PRETEXTFIX||i.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)){const l=i.controlId;let r=!1,a=n+1;for(;a<t.length;){const c=t[a];if(c.controlId===l&&(c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))break;if(c.controlId===l&&c.controlComponent===s.ControlComponent.VALUE&&(r=!0),c.controlId!==l&&c.controlId){(i.control?.type===s.ControlType.TEXT||c.controlComponent===s.ControlComponent.VALUE)&&(r=!0);const d=c.controlId;for(a++;a<t.length&&t[a].controlId===d;)a++;continue}a++}r&&e.add(l)}n++}return e}_computePageList(){const t=[[]],{pageMode:e,pageNumber:{maxPageNo:n}}=this.options,i=this.getHeight(),l=this.getMainOuterHeight();let r=l,a=0;if(e===s.PageMode.CONTINUITY){t[0]=this.rowList,r+=this.rowList.reduce((h,R)=>h+R.height+(R.offsetY||0),0);const c=this.getPagePixelRatio(),d=this.pageList[0],u=Number(d.style.height.replace("px",""));if(r>u)d.style.height=`${r}px`,d.height=r*c;else{const h=r<i?i:r;d.style.height=`${h}px`,d.height=h*c}this._initPageContext(this.ctxList[0])}else for(let c=0;c<this.rowList.length;c++){const d=this.rowList[c],u=d.offsetY||0;if(d.height+u+r>i||this.rowList[c-1]?.isPageBreak){if(Number.isInteger(n)&&a>=n){this.elementList=this.elementList.slice(0,d.startIndex);break}r=l+d.height+u,t.push([d]),a++}else r+=d.height+u,t[a].push(d)}return t}_drawHighlight(t,e){const{rowList:n,positionList:i,elementList:l}=e,r=this.getDefaultBasicRowMarginHeight(),a=this.getHighlightMarginHeight();for(let c=0;c<n.length;c++){const d=n[c];let u="";for(let h=0;h<d.elementList.length;h++){const R=d.elementList[h],T=d.startIndex+h,g=l[T]===R?T:l.indexOf(R),f=~g?g:T,C=this.control.getControlHighlight(l,f),p=R.highlight||C;if(p){u&&u!==p&&this.highlight.render(t);const I=i[f],{coordinate:{leftTop:[m,L]}}=I,O=R.left||0,P=!R.highlight&&!!C&&this.control.getIsInlineControlBackground(l,f),S=P?L+I.ascent-R.metrics.boundingBoxAscent-a:L+r-a,y=P?R.metrics.boundingBoxAscent+R.metrics.boundingBoxDescent+2*a:d.height-2*r+2*a;this.highlight.recordFillInfo(t,m-O,S,R.metrics.width+O,y,p)}else u&&this.highlight.render(t);u=p}this.highlight.render(t)}}validateNumber(t){return/^\d+$/.test(t)}drawRow(t,e){this._drawHighlight(t,e);const{scale:n,table:{tdPadding:i},group:l,lineBreak:r,whiteSpace:a}=this.options,{rowList:c,pageNo:d,elementList:u,positionList:h,startIndex:R,zone:T,isDrawLineBreak:g=!r.disabled,td:f,isDrawWhiteSpace:C=!a.disabled}=e,p=this.isPrintLikeMode(),I=this.isSelectionDisabled(),{isCrossRowCol:m,tableId:L}=this.range.getRange();let O=R;for(let P=0;P<c.length;P++){const S=c[P],y={x:0,y:0,width:0,height:0};let Y=null;for(let b=0;b<S.elementList.length;b++){const M=S.elementList[b],V=M.metrics,{ascent:N,coordinate:{leftTop:[X,D]}}=h[S.startIndex+b],E=S.elementList[b-1];if(ae(M)&&!this.isDesignMode())this.textParticle.complete();else if(M.type===s.ElementType.IMAGE)this.textParticle.complete(),M.imgDisplay!==s.ImageDisplay.SURROUND&&M.imgDisplay!==s.ImageDisplay.FLOAT_TOP&&M.imgDisplay!==s.ImageDisplay.FLOAT_BOTTOM&&this.imageParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.LATEX)this.textParticle.complete(),this.laTexParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.TABLE)m&&(y.x=X,y.y=D,Y=M),this.tableParticle.render(t,M,X,D);else if(M.type===s.ElementType.HYPERLINK)this.textParticle.complete(),this.hyperlinkParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.LABEL)this.textParticle.complete(),this.labelParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.MACRO||M.type===s.ElementType.CUSTOM_MACRO||M.type===s.ElementType.REUSABLE_ITEM||M.type===s.ElementType.SUB_TEMPLATE)this.textParticle.complete(),this.macroParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.DATE){const K=S.elementList[b+1];(!E||E.dateId!==M.dateId)&&this.textParticle.complete(),this.textParticle.record(t,M,X,D+N),(!K||K.dateId!==M.dateId)&&this.textParticle.complete()}else if(M.type===s.ElementType.SUPERSCRIPT)this.textParticle.complete(),this.superscriptParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.SUBSCRIPT)this.underline.render(t),this.textParticle.complete(),this.subscriptParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.SEPARATOR)this.separatorParticle.render(t,M,X,D);else if(M.type===s.ElementType.PAGE_BREAK)this.mode!==s.EditorMode.CLEAN&&!p&&this.pageBreakParticle.render(t,M,X,D);else if(M.type===s.ElementType.CHECKBOX||M.controlComponent===s.ControlComponent.CHECKBOX)this.textParticle.complete(),this.checkboxParticle.render({ctx:t,x:X,y:D+N,index:b,row:S});else if(M.type===s.ElementType.RADIO||M.controlComponent===s.ControlComponent.RADIO)this.textParticle.complete(),this.radioParticle.render({ctx:t,x:X,y:D+N,index:b,row:S});else if(M.type===s.ElementType.MENSTRUAL_HISTORY)this.textParticle.complete(),this.menstrualHistoryParticle.render({ctx:t,x:X,y:D+N,index:b,row:S,element:M});else if(M.type===s.ElementType.FETAL_HEART_POSITION)this.textParticle.complete(),this.fetalHeartPositionParticle.render({ctx:t,x:X,y:D+N,index:b,row:S,element:M});else if(M.type===s.ElementType.TOOTH_POSITION)this.textParticle.complete(),this.toothPositionParticle.render({ctx:t,x:X,y:D+N,index:b,row:S,element:M});else if(M.type===s.ElementType.TAB)this.textParticle.complete();else if(M.rowFlex===s.RowFlex.ALIGNMENT||M.rowFlex===s.RowFlex.JUSTIFY)this.textParticle.record(t,M,X,D+N),this.textParticle.complete();else if(M.type===s.ElementType.BLOCK)this.textParticle.complete(),this.blockParticle.render(t,d,M,X,D+N);else{const K=M.buttonValueLayoutPrefixOffset===!0;(M.left||K)&&this.textParticle.complete(),this.textParticle.record(t,M,X,D+N),(K||M.width||M.letterSpacing||Ta.test(M.value))&&this.textParticle.complete()}if(g&&!p&&this.mode!==s.EditorMode.CLEAN&&!S.isWidthNotEnough&&b===S.elementList.length-1&&this.lineBreakParticle.render(t,M,X,D+S.height/2),C&&fa.test(M.value)&&this.whiteSpaceParticle.render(t,M,X,D+S.height/2),M.control?.border){E?.control?.border&&E.controlId!==M.controlId&&this.control.drawBorder(t);const K=this.getElementRowMargin(M);this.control.recordBorderInfo(X,D+K,M.metrics.width,S.height-2*K)}else E?.control?.border&&this.control.drawBorder(t);if(M.control?.type===s.ControlType.TEXT){const K=M.controlComponent===s.ControlComponent.VALUE,k=M.controlComponent===s.ControlComponent.POSTFIX||M.controlComponent===s.ControlComponent.POST_TEXT,B=!!E&&E.originControlId===M.controlId&&(E.controlComponent===s.ControlComponent.POSTFIX||E.controlComponent===s.ControlComponent.POST_TEXT||E.controlComponent===s.ControlComponent.POSTTEXTFIX||E.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT);M.originControlId&&(M.controlComponent===s.ControlComponent.PREFIX||M.controlComponent===s.ControlComponent.PRE_TEXT||M.controlComponent===s.ControlComponent.PRETEXTFIX||M.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&this.control.drawTextFieldUnderline(t),K&&M.control?.underline&&!M.underline&&((!E||E.controlId!==M.controlId||B||E.controlComponent!==s.ControlComponent.VALUE&&E.controlComponent!==s.ControlComponent.PLACEHOLDER)&&this.control.startTextFieldUnderline(M.controlId,X,D+S.height),this.control.recordTextFieldUnderlineWidth(M.metrics.width)),k&&this.control.drawTextFieldUnderline(t),M.originControlId&&(M.controlComponent===s.ControlComponent.POSTFIX||M.controlComponent===s.ControlComponent.POST_TEXT||M.controlComponent===s.ControlComponent.POSTTEXTFIX||M.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.drawTextFieldUnderline(t)}else E?.control?.type===s.ControlType.TEXT&&this.control.drawTextFieldUnderline(t);if(M.type!==s.ElementType.REUSABLE_ITEM&&(M.underline||M.control?.underline)&&M.controlComponent!==s.ControlComponent.PLACEHOLDER&&!(M.control?.type===s.ControlType.TEXT&&M.control?.underline&&!M.underline)){E?.type===s.ElementType.SUBSCRIPT&&M.type!==s.ElementType.SUBSCRIPT&&this.underline.render(t);const K=this.getElementRowMargin(M),k=M.left||0;let B=0;M.type===s.ElementType.SUBSCRIPT&&(B=this.subscriptParticle.getOffsetY(M));const H=M.control?.underline?this.options.underlineColor:M.color;this.underline.recordFillInfo(t,X-k,D+S.height-K+B,V.width+k,0,H,M.textDecoration?.style)}else(E?.underline||E?.control?.underline)&&(E?.control?.type===s.ControlType.TEXT&&E?.control?.underline&&!E.underline||this.underline.render(t));if(M.type!==s.ElementType.REUSABLE_ITEM&&M.strikeout){if(!M.type||Le.includes(M.type)){E&&(E.type===s.ElementType.SUBSCRIPT&&M.type!==s.ElementType.SUBSCRIPT||E.type===s.ElementType.SUPERSCRIPT&&M.type!==s.ElementType.SUPERSCRIPT||this.getElementSize(E)!==this.getElementSize(M))&&this.strikeout.render(t);const K=this.textParticle.measureBasisWord(t,this.getElementFont(M));let k=D+N+K.actualBoundingBoxDescent*n-V.height/2;M.type===s.ElementType.SUBSCRIPT?k+=this.subscriptParticle.getOffsetY(M):M.type===s.ElementType.SUPERSCRIPT&&(k+=this.superscriptParticle.getOffsetY(M)),this.strikeout.recordFillInfo(t,X,k,V.width)}}else E?.strikeout&&this.strikeout.render(t);const{zone:U,splitTdRange:F}=this.range.getRange();let{startIndex:Z,endIndex:Q}=this.range.getRange(),W=!1;if(f&&F&&[f.originalId,f.id].includes(F.originalId)&&(W=!0,Z=F.startIndex-(f.valueStartIndex??0),Q=F.endIndex-(f.valueStartIndex??0)),U===T&&Z!==Q&&Z<=O&&O<=Q){const K=this.position.getPositionContext();if(!K.isTable&&!M.tdId||K.tdId===M.tdId||W)if(Z===O){const k=u[Z+1];k&&k.value===_&&(y.x=X+V.width,y.y=D,y.height=S.height,y.width+=this.options.rangeMinWidth)}else{let k=V.width;k===0&&S.elementList.length===1&&(k=this.options.rangeMinWidth),y.width||(y.x=X,y.y=D,y.height=S.height),y.width+=k}}if(!l.disabled&&M.groupIds&&this.group.recordFillInfo(M,X,D,V.width,S.height),O++,M.type===s.ElementType.TABLE&&!ae(M)){const K=M.tdPadding||i,k=K[1]+K[3];for(let B=0;B<M.trList.length;B++){const H=M.trList[B];for(let A=0;A<H.tdList.length;A++){const v=H.tdList[A];this.drawRow(t,{elementList:v.value,positionList:v.positionList,rowList:v.rowList,pageNo:d,startIndex:0,innerWidth:(v.width-k)*n,zone:T,isDrawLineBreak:g,td:v})}}}}if(S.isList&&this.listParticle.drawListStyle(t,S,h[S.startIndex]),this.textParticle.complete(),this.control.drawBorder(t),this.underline.render(t),this.strikeout.render(t),this.group.render(t),!I){if(y.width&&y.height){const{x:b,y:M,width:V,height:N}=y;this.range.render(t,b,M,V,N)}if(m&&Y&&Y.id===L){const{coordinate:{leftTop:[b,M]}}=h[S.startIndex];this.tableParticle.drawRange(t,Y,b,M)}}}this.control.renderQualityMarks(t,e.elementList,e.positionList,e.rowList,e.pageNo,e.zone,e.innerWidth)}_drawFloat(t,e){const{scale:n}=this.options,i=this.position.getFloatPositionList(),{imgDisplays:l,pageNo:r}=e;for(let a=0;a<i.length;a++){const c=i[a],d=c.element;if((r===c.pageNo||c.zone===s.EditorZone.HEADER||c.zone==s.EditorZone.FOOTER)&&d.imgDisplay&&l.includes(d.imgDisplay)&&d.type===s.ElementType.IMAGE){const u=d.imgFloatPosition;this.imageParticle.render(t,d,u.x*n,u.y*n)}}}_clearPage(t){const e=this.ctxList[t],n=this.pageList[t];e.clearRect(0,0,Math.max(n.width,this.getWidth()),Math.max(n.height,this.getHeight())),this.blockParticle.clear()}_drawPage(t){const{elementList:e,positionList:n,rowList:i,pageNo:l}=t,{inactiveAlpha:r,pageMode:a,header:c,footer:d,pageNumber:u,lineNumber:h,pageBorder:R}=this.options,T=this.isPrintLikeMode(),g=this.mode===s.EditorMode.COMPARE?this.options.modeRule[s.EditorMode.COMPARE]:this.options.modeRule[s.EditorMode.PRINT],f=this.getInnerWidth(),C=this.ctxList[l];C.globalAlpha=this.zone.isMainActive()?1:r,this._clearPage(l),(!T||!g?.backgroundDisabled)&&this.background.render(C,l),T||this.area.render(C,l),a!==s.PageMode.CONTINUITY&&this.options.watermark.data&&this.waterMark.render(C,l),T||this.margin.render(C,l),this._drawFloat(C,{pageNo:l,imgDisplays:[s.ImageDisplay.FLOAT_BOTTOM]}),T||this.control.renderHighlightList(C,l);const p=i[0]?.startIndex;this.drawRow(C,{elementList:e,positionList:n,rowList:i,pageNo:l,startIndex:p,innerWidth:f,zone:s.EditorZone.MAIN}),this.getIsPagingMode()&&(c.disabled||this.header.render(C,l),u.disabled||this.pageNumber.render(C,l),d.disabled||this.footer.render(C,l)),this._drawFloat(C,{pageNo:l,imgDisplays:[s.ImageDisplay.FLOAT_TOP,s.ImageDisplay.SURROUND]}),!T&&this.search.getSearchKeyword()&&this.search.render(C,l),this.elementList.length<=1&&!this.elementList[0]?.listId&&this.placeholder.render(C),h.disabled||this.lineNumber.render(C,l),R.disabled||this.pageBorder.render(C),this.badge.render(C,l),this.isGraffitiMode()&&this.graffiti.render(C,l)}_disconnectLazyRender(){this.lazyRenderIntersectionObserver?.disconnect()}_lazyRender(t){const e=this.position.getOriginalMainPositionList(),n=this.getOriginalMainElementList();this._disconnectLazyRender(),t!==void 0&&t>=0&&t<this.pageRowList.length&&this._drawPage({elementList:n,positionList:e,rowList:this.pageRowList[t],pageNo:t}),this.lazyRenderIntersectionObserver=new IntersectionObserver(i=>{i.forEach(l=>{if(l.isIntersecting){const r=Number(l.target.dataset.index);this._drawPage({elementList:n,positionList:e,rowList:this.pageRowList[r],pageNo:r})}})}),this.pageList.forEach((i,l)=>{l!==t&&this.lazyRenderIntersectionObserver.observe(i)})}_immediateRender(){const t=this.position.getOriginalMainPositionList(),e=this.getOriginalMainElementList();for(let n=0;n<this.pageRowList.length;n++)this._drawPage({elementList:e,positionList:t,rowList:this.pageRowList[n],pageNo:n})}render(t){const e=this._takePendingRenderOption();if(e){const E=t||{};t={...e,...E,curIndex:E.curIndex??e.curIndex,isCompute:(e.isCompute??!0)||(E.isCompute??!0),isSubmitHistory:(e.isSubmitHistory??!0)||(E.isSubmitHistory??!0)}}const n=re(),i=[],l=(E,U)=>{i.push({label:E,duration:re()-U})};this.renderCount++,this.syncSubTemplateRuntimeContent();const r=this.mode===s.EditorMode.EDIT||this.mode===s.EditorMode.FORM||this.isPrintLikeMode()?uT([...this.getHeaderElementList(),...this.elementList,...this.getFooterElementList()]):null,a=this.applySubTemplateRuntimeState(this.getHeaderElementList(),r)||this.applySubTemplateRuntimeState(this.elementList,r)||this.applySubTemplateRuntimeState(this.getFooterElementList(),r);let{curIndex:c}=t||{},{endIndex:d}=this.range.getRange();const{isCrossRowCol:u}=this.range.getRange();if(!u&&~d){const E=this.getElementList(),U=E[d],Z=U?.type===s.ElementType.SUB_TEMPLATE&&U.subTemplateExpanded?s.LocationPosition.AFTER:s.LocationPosition.BEFORE,Q=_n(E,d,Z);Q!==d&&!ae(E[Q])&&((c===void 0||c===d)&&(c=Q),this.range.setRange(Q,Q),d=Q)}let h;const R=this.position.getPositionContext();if(u)h=this.getOriginalElementList()[R.index];else{const E=~d?d:0,U=this.getElementList();h=Qn(U,E)}const{header:T,footer:g}=this.options,{isSubmitHistory:f=!0,isSetCursor:C=!0,isLazy:p=!0,isInit:I=!1,isSourceHistory:m=!1,isContentChange:L=!1,isFirstRender:O=!1,isDel:P=!1}=t||{};let{isCompute:S=!0}=t||{};a&&(S=!0);const{traceLabel:y}=t||{},Y=this.getInnerWidth(),b=this.getIsPagingMode(),M=this.pageRowList.length;if(S){if(this.splitTdValueMap.clear(),this.tdMap.clear(),this.position.setFloatPositionList([]),b){if(!T.disabled){const v=re();this.header.compute(),l("header.compute",v)}if(!g.disabled){const v=re();this.footer.compute(),l("footer.compute",v)}}const E=this.getMargins(),U=this.getHeight(),F=this.header.getExtraHeight(),Z=this.getMainOuterHeight(),Q=E[3],W=E[0]+F,K=Zi(this.elementList),k=re();this.rowList=this.computeRowList({startX:Q,startY:W,pageHeight:U,mainOuterHeight:Z,isPagingMode:b,innerWidth:Y,surroundElementList:K,elementList:this.elementList}),l("computeRowList",k);const B=re();this.pageRowList=this._computePageList(),l("computePageList",B);const H=re();this.position.computePositionList(),l("computePositionList",H);const A=re();if(this.area.compute(),l("area.compute",A),!this.isPrintLikeMode()){const v=this.search.getSearchKeyword();if(v){const bt=re();this.search.compute(v),l("search.compute",bt)}const ct=re();this.control.computeHighlightList(),l("control.computeHighlightList",ct)}if(this.isGraffitiMode()){const v=re();this.graffiti.compute(),l("graffiti.compute",v)}}this.imageObserver.clearAll(),this.cursor.recoveryCursor();for(let E=0;E<this.pageRowList.length;E++)this.pageList[E]||this._createPage(E);const V=this.pageRowList.length,N=this.pageList.length;if(N>V){const E=N-V;this.ctxList.splice(V,E),this.pageList.splice(V,E).forEach(U=>U.remove())}const X=re();if(p&&b){let E=this.pageNo;c!==void 0&&this.zone.isMainActive()&&(E=this.position.getPositionList()[c]?.pageNo??E),this._lazyRender(E)}else this._immediateRender();if(l(p&&b?"lazyRender":"immediateRender",X),C){if(S&&h?.tableId){const{index:E}=R,F=this.getOriginalElementList()[E];if(h.tableId!==F?.id){const Q=this.findTableChildrenElement(!0,h.tableId,h);Q&&R.index!==Q.originalIndex&&(R.index=Q.originalIndex,R.tableId=Q.table.id,R.trIndex=Q.trIndex,R.trId=Q.tr.id,R.tdIndex=Q.tdIndex,R.tdId=Q.td.id,c=Q.elementIndex,this.position.setPositionContext(R),this.range.setRange(c,c),this.updateTableTool())}const Z=this.getElementList();Z[d]!==h&&(c=Z.findIndex(Q=>Q===h))}c=this.setCursor(c)}else this.range.getIsSelection()&&this.cursor.focus();if(P){let E;const U=this.position.getPositionContext();E=this.range.getRange().startIndex-1,U.index=E}(f&&!O||c!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(c);const D=re();Li(()=>{const E=re();this.pendingRenderFrameId===null&&(this.range.setRangeStyle(),S&&this.control.getActiveControl()&&this.control.reAwakeControl(),S&&!this.isReadonly()&&R.isTable&&this.getOriginalElementList()[R.index].type===s.ElementType.TABLE&&this.tableTool.render(),S&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator()),M!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(f||m||L)&&!I&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"));const U=re();Mi(this.options,y||"render",U-n,[...i,{label:"nextTick.wait",duration:E-D},{label:"nextTick.callback",duration:U-E}],{isCompute:S,pageCount:this.pageRowList.length})}),C&&this.fixPosition()}fixPosition(t=!1){let e;const n=this.position.getPositionContext();if(n.isTable){const i=this.getElementList(),l=this.range.getRange().startIndex;if(t||l>=i.length){const r=this.getTd(),a=n.index+(t?-1:1),d=this.getOriginalElementList()[a];if(!d?.trList)return;e=l-i.length;for(let u=0;u<d.trList.length;u++){const h=d.trList[u],R=h.tdList.find(T=>t?r?.linkTdPrevId===T.id:r?.id===T.linkTdPrevId);if(R){n.index=a,n.trIndex=u,n.tableId=d.id,n.trId=h.id,n.tdId=R?.id,e=t?R.value.length-1:e+(R.value[0]?.type===s.ElementType.SPLIT_TAG?1:0);break}}if(this.position.setPositionContext(n),this.range.setRange(e,e),this.setCursor(e),e===0)return this.fixPosition(t);this.updateTableTool()}}return e}getInlineBackgroundControlType(t,e){if(e===void 0)return;const n=t[e],i=n?.controlId;return i?n.control?.type?n.control.type:t.find(r=>r.controlId===i&&r.originControlId===n.originControlId&&!!r.control?.type)?.control?.type:void 0}getIsHideInlineBackgroundControlCursor(t,e){if(this.options.mode!==s.EditorMode.EDIT&&this.options.mode!==s.EditorMode.FORM)return!1;const n=e!==void 0?t[e]:void 0;if(n?.controlComponent===s.ControlComponent.POSTFIX||n?.controlComponent===s.ControlComponent.POST_TEXT||n?.controlComponent===s.ControlComponent.POSTTEXTFIX||n?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)return!1;const i=this.getInlineBackgroundControlType(t,e);return!!(i&&[s.ControlType.SELECT,s.ControlType.DATE].includes(i))}setCursor(t){const e=this.position.getPositionContext(),n=this.position.getPositionList(),i=this.getElementList();if(e.isTable){const{index:r,trIndex:a,tdIndex:c}=e,u=this.getOriginalElementList()[r].trList?.[a].tdList[c].positionList;t===void 0&&u&&(t=u.length-1);const h=u?.[t];this.position.setCursorPosition(h||null)}else t!==void 0&&t>=n.length&&(t=n.length-1),this.position.setCursorPosition(t!==void 0&&t>=0?n[t]:null);let l=!0;if(t!==void 0&&e.isImage&&e.isDirectHit){const r=i[t];if(r&&Ua.includes(r.type)){l=!1;const a=this.position.getCursorPosition();this.previewer.updateResizer(r,a)}}return l&&this.getIsHideInlineBackgroundControlCursor(i,t)&&(l=!1),this.cursor.drawCursor({isShow:l}),t}submitHistory(t){const e=this.position.getPositionContext(),n=vi(this.elementList),i=vi(this.header.getElementList()),l=vi(this.footer.getElementList()),r=rt(this.range.getRange()),a=this.pageNo,c=rt(e),d=this.zone.getZone();this.historyManager.execute(()=>{this.zone.setZone(d),this.setPageNo(a),this.position.setPositionContext(rt(c)),this.header.setElementList(rt(i)),this.footer.setElementList(rt(l)),this.elementList=rt(n),this.range.replaceRange(rt(r)),this.render({curIndex:t,isSubmitHistory:!1,isSourceHistory:!0})})}destroy(){this._cancelPendingRender(),this.macroParticle.clearInlineEditor({isSubmitHistory:!1}),this._cancelPendingRender(),this.cursor.recoveryCursor(),this.container.remove(),this.globalEvent.removeEvent(),this.scrollObserver.removeEvent(),this.selectionObserver.removeEvent()}clearSideEffect(){this.getMacroParticle().clearInlineEditor({isSubmitHistory:!1}),this.getPreviewer().clearResizer(),this.getTableTool().dispose(),this.getHyperlinkParticle().clearHyperlinkPopup(),this.getDateParticle().clearDatePicker()}updateTableTool(){if(this.position.getPositionContext().isTable){const t=this.position.getPositionList();t.length&&(this.setPageNo(t[0].pageNo),this.getTableTool().render())}}initTableElementIndex(t,e){t.trList?.forEach((n,i)=>{n.tdList.forEach((l,r)=>{l.tableIndex=e,l.tableId=t.id,l.trIndex=i,l.trId=n.id,l.tdIndex=r,this.tdMap.set(l.id,l)})})}clearElementEffect(t){t.trList?.forEach(e=>{e.minHeight=e.originalMinHeight??e.minHeight,delete e.originalMinHeight,e.tdList.forEach(n=>{delete n.linkTdNextId})})}updateElementTableInfo(t,e,n,i){return t.tableId=e.id,t.trId=n.id,t.tdId=i.id,t}findTableChildrenElement(t,e,n){const i=this.position.getPositionContext(),{index:l}=i,r=this.getOriginalElementList();let a=l;t&&(a=l>r.length?r.length-1:l);for(let c=a;t?c>=0:c<r.length;t?c--:c++){const d=r[c];if(d&&[d.originalId,d.id].includes(e))for(const[u,h]of d.trList.entries())for(const[R,T]of h.tdList.entries()){const g=T.value.findIndex(typeof n=="function"?n:f=>f===n);if(g>=0)return{originalIndex:c,table:d,tr:h,trIndex:u,td:T,tdIndex:R,elementIndex:g}}}}getTdById(t){return this.tdMap.get(t)}getLinkTdPrevHasValue(t){const e=this.getTdById(t);if(e)return e.value.length?e:this.getLinkTdPrevHasValue(e.linkTdPrevId)}getFirstLinkTd(t){const e=this.getTdById(t);return e?.linkTdPrevId?this.getLastLinkTd(e.linkTdPrevId):e}getLastLinkTd(t){const e=this.getTdById(t);return e?.linkTdNextId?this.getLastLinkTd(e.linkTdNextId):e}removeLinkTd(t,e){const n=this.getTdById(e);if(n){if(n.linkTdPrevId){const i=this.getTdById(n.linkTdPrevId);i&&(delete i.linkTdNextId,this.removeLinkTd(t,n.linkTdPrevId))}if(n.linkTdNextId){const i=this.getTdById(n.linkTdNextId);i&&(delete i.linkTdPrevId,this.removeLinkTd(t,n.linkTdNextId))}t[n.tableIndex].trList[n.trIndex].tdList.splice(n.tdIndex,1),this.initTableElementIndex(t[n.tableIndex],n.tableIndex)}}removeLinkTdControl(t,e){const n=this.getTdById(t);if(n){for(let i=0;i<n.value.length;i++)n.value[i].control===e&&(n.value.splice(i,1),i--);n.linkTdNextId&&this.removeLinkTdControl(n.linkTdNextId,e)}}isSplitTd(t,e){return(!!t?.originalId||!!e?.originalId)&&(t?.originalId===e?.originalId||t?.id===e?.originalId||t?.originalId===e?.id)}getSplitTdValues(t){return this.splitTdValueMap.get(t)}removeSplitTdOtherRangeElements(){const{splitTdRange:t}=this.range.getRange();if(!t)return;const{startIndex:e,endIndex:n}=t;let i=this.getTd();if(i)if((i.valueStartIndex??0)>=e){let l=-1;for(;l<0;){const r=this.getTdById(i.linkTdPrevId);if(r){l=e-(r.valueStartIndex??0);const a=Math.max(0,l);this.spliceElementList(r.value,a+1,r.value.length-a-1),i=r}else l=0}}else{let l=1;for(;l>0;){const r=this.getTdById(i.linkTdNextId);if(r){const a=r.valueStartIndex??0;l=n-(a+r.value.length);const c=Math.min(r.value.length,n-a+1);this.spliceElementList(r.value,0,c),i=r}else l=0}}}getTablesByPagingId(t,e,n){const i=[],l=[];if(t[n].pagingId===e){i.push(n),l.push(t[n]);for(let r=n-1;r>=0&&t[r].pagingId===e;r--)l.unshift(t[r]),i.push(r);for(let r=n+1;r<t.length&&t[r].pagingId===e;r++)l.push(t[r]),i.push(r)}return{list:l,startIndex:i.sort()[0]}}}class $l{executeMode;executeCut;executeCopy;executePaste;executeSelectAll;executeBackspace;executeSetRange;executeReplaceRange;executeSetPositionContext;executeForceUpdate;executeBlur;executeHideCursor;executeUndo;executeRedo;executePainter;executeApplyPainterStyle;executeFormat;executeFont;executeButton;executeEditElementAttribute;executeTriggerControlEditAttribute;executeCopyControl;executePasteControl;executeSize;executeSizeAdd;executeSizeMinus;executeBold;executeItalic;executeUnderline;executeStrikeout;executeSuperscript;executeSubscript;executeColor;executeHighlight;executeTitle;executeList;executeRowFlex;executeVertical;executeRowMargin;executeInsertTable;executeInsertTableTopRow;executeInsertTableBottomRow;executeInsertTableLeftCol;executeInsertTableRightCol;executeDeleteTableRow;executeDeleteTableCol;executeDeleteTable;executeMergeTableCell;executeCancelMergeTableCell;executeSplitVerticalTableCell;executeSplitHorizontalTableCell;executeTableTdVerticalAlign;executeTableBorderType;executeTableBorderColor;executeTableTdBorderType;executeTableTdSlashType;executeTableTdBackgroundColor;executeTableSelectAll;executeTableProperties;executeImage;executeHyperlink;executeDeleteHyperlink;executeCancelHyperlink;executeEditHyperlink;executeSeparator;executePageBreak;executeAddWatermark;executeDeleteWatermark;executeSearch;executeSearchNavigatePre;executeSearchNavigateNext;executeReplace;executePrint;executeReplaceImageElement;executeSaveAsImageElement;executeSetImageCrop;executeSetImageCaption;executeChangeImageDisplay;executePageMode;executePageScale;executePageScaleRecovery;executePageScaleMinus;executePageScaleAdd;executePaperSize;executePaperDirection;executeSetPaperMargin;executeSetMainBadge;executeSetAreaBadge;executeInsertElementList;executeInsertArea;executeSetAreaValue;executeSetAreaProperties;executeLocationArea;executeClearGraffiti;executeAppendElementList;executeUpdateElementById;executeDeleteElementById;executeSetValue;executeRemoveControl;executeTranslate;executeSetLocale;executeLocationCatalog;executeWordTool;executeSetHTML;executeSetGroup;executeDeleteGroup;executeLocationGroup;executeSetZone;executeSetControlValue;executeSetControlValueList;executeSetControlExtension;executeSetControlExtensionList;executeSetControlProperties;executeSetControlPropertiesList;executeSetControlHighlight;executeSetControlQualityMarks;executeSetButtonContent;executeLocationControl;executeInsertControl;executeInsertTextField;executeJumpControl;executeUpdateOptions;executeSetFormModeTrace;executeInsertTitle;executeFocus;executeComputeElementListHeight;getCatalog;getImage;getPageMode;getOptions;getValue;getValueAsync;getAreaValue;getHTML;getText;getWordCount;getCursorPosition;getRemainingContentHeight;getRange;getRangeText;getRangeContext;getRangeRow;getRangeParagraph;getKeywordRangeList;getKeywordContext;getPaperMargin;getSearchNavigateInfo;getLocale;getGroupIds;getControlValue;getButtonContent;getControlList;getContainer;getTitleValue;getPositionContextByEvent;getElementById;getMacroValue;getMacroList;setMacroValue;setMacroValueList;updateMacroProperties;locationMacro;insertSubTemplate;updateSubTemplate;expandSubTemplate;collapseSubTemplate;toggleSubTemplate;constructor(t){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.executeHideCursor=t.hideCursor.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.executeButton=t.buttonText.bind(t),this.executeEditElementAttribute=t.editElementAttribute.bind(t),this.executeTriggerControlEditAttribute=t.triggerControlEditAttribute.bind(t),this.executeCopyControl=t.copyControl.bind(t),this.executePasteControl=t.pasteControl.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.executeVertical=t.vertical.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.executeSplitVerticalTableCell=t.splitVerticalTableCell.bind(t),this.executeSplitHorizontalTableCell=t.splitHorizontalTableCell.bind(t),this.executeTableTdVerticalAlign=t.tableTdVerticalAlign.bind(t),this.executeTableBorderType=t.tableBorderType.bind(t),this.executeTableBorderColor=t.tableBorderColor.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.executeTableProperties=t.tableProperties.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.executeSetImageCrop=t.setImageCrop.bind(t),this.executeSetImageCaption=t.setImageCaption.bind(t),this.executeChangeImageDisplay=t.changeImageDisplay.bind(t),this.executePageMode=t.pageMode.bind(t),this.executePageScale=t.pageScale.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.executeSetMainBadge=t.setMainBadge.bind(t),this.executeSetAreaBadge=t.setAreaBadge.bind(t),this.getAreaValue=t.getAreaValue.bind(t),this.executeInsertArea=t.insertArea.bind(t),this.executeSetAreaValue=t.setAreaValue.bind(t),this.executeSetAreaProperties=t.setAreaProperties.bind(t),this.executeLocationArea=t.locationArea.bind(t),this.executeClearGraffiti=t.clearGraffiti.bind(t),this.executeInsertElementList=t.insertElementList.bind(t),this.executeAppendElementList=t.appendElementList.bind(t),this.executeUpdateElementById=t.updateElementById.bind(t),this.executeDeleteElementById=t.deleteElementById.bind(t),this.executeSetValue=t.setValue.bind(t),this.executeRemoveControl=t.removeControl.bind(t),this.executeTranslate=t.translate.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.executeSetFormModeTrace=t.setFormModeTrace.bind(t),this.executeInsertTitle=t.insertTitle.bind(t),this.executeFocus=t.focus.bind(t),this.executeComputeElementListHeight=t.computeElementListHeight.bind(t),this.getImage=t.getImage.bind(t),this.getPageMode=t.getPageMode.bind(t),this.getOptions=t.getOptions.bind(t),this.getValue=t.getValue.bind(t),this.getValueAsync=t.getValueAsync.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.getRemainingContentHeight=t.getRemainingContentHeight.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.executeSetControlValueList=t.setControlValueList.bind(t),this.executeSetControlExtension=t.setControlExtension.bind(t),this.executeSetControlExtensionList=t.setControlExtensionList.bind(t),this.executeSetControlProperties=t.setControlProperties.bind(t),this.executeSetControlPropertiesList=t.setControlPropertiesList.bind(t),this.executeSetControlHighlight=t.setControlHighlight.bind(t),this.executeSetControlQualityMarks=t.setControlQualityMarks.bind(t),this.executeSetButtonContent=t.setButtonContent.bind(t),this.getControlValue=t.getControlValue.bind(t),this.getButtonContent=t.getButtonContent.bind(t),this.getControlList=t.getControlList.bind(t),this.executeLocationControl=t.locationControl.bind(t),this.executeInsertControl=t.insertControl.bind(t),this.executeInsertTextField=t.insertTextField.bind(t),this.executeJumpControl=t.jumpControl.bind(t),this.getMacroValue=t.getMacroValue.bind(t),this.getMacroList=t.getMacroList.bind(t),this.setMacroValue=t.setMacroValue.bind(t),this.setMacroValueList=t.setMacroValueList.bind(t),this.updateMacroProperties=t.updateMacroProperties.bind(t),this.locationMacro=t.locationMacro.bind(t),this.insertSubTemplate=t.insertSubTemplate.bind(t),this.updateSubTemplate=t.updateSubTemplate.bind(t),this.expandSubTemplate=t.expandSubTemplate.bind(t),this.collapseSubTemplate=t.collapseSubTemplate.bind(t),this.toggleSubTemplate=t.toggleSubTemplate.bind(t)}}function xT(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 JT(o,t){const{width:e,height:n,direction:i=s.PaperDirection.VERTICAL}=t,l=document.createElement("iframe");l.style.visibility="hidden",l.style.position="absolute",l.style.left="0",l.style.top="0",l.style.width="0",l.style.height="0",l.style.border="none",document.body.append(l);const r=l.contentWindow,a=r.document;a.open();const c=document.createElement("div"),d=xT(e,n);o.forEach(R=>{const T=document.createElement("img");T.style.width=i===s.PaperDirection.HORIZONTAL?d.height:d.width,T.style.height=i===s.PaperDirection.HORIZONTAL?d.width:d.height,T.src=R,c.append(T)});const u=document.createElement("style"),h=`
566
+ `,document.body.appendChild(a);const c=a.querySelector(".table-properties-modal__mask"),d=a.querySelector(".table-properties-modal__close"),u=a.querySelector(".btn-cancel"),h=a.querySelector(".btn-confirm"),R=()=>{a.remove()};c.addEventListener("click",R),d.addEventListener("click",R),u.addEventListener("click",R),h.addEventListener("click",()=>{const T=parseInt(a.querySelector("#tdPaddingTop").value)||0,g=parseInt(a.querySelector("#tdPaddingRight").value)||0,f=parseInt(a.querySelector("#tdPaddingBottom").value)||0,C=parseInt(a.querySelector("#tdPaddingLeft").value)||0;i.tdPadding=[T,g,f,C],R();const{endIndex:p}=this.range.getRange();this.draw.render({curIndex:p,isCompute:!0})})}}s.AreaMode=void 0,(function(o){o.EDIT="edit",o.READONLY="readonly",o.FORM="form"})(s.AreaMode||(s.AreaMode={}));class AT{draw;zone;range;position;options;areaInfoMap=new Map;constructor(t){this.draw=t,this.options=t.getOptions(),this.zone=t.getZone(),this.range=t.getRange(),this.position=t.getPosition()}getAreaInfo(){return this.areaInfoMap}getActiveAreaId(){if(!this.areaInfoMap.size)return null;const{startIndex:t}=this.range.getRange();return this.draw.getElementList()[t]?.areaId||null}getActiveAreaInfo(){const t=this.getActiveAreaId();return t&&this.areaInfoMap.get(t)||null}isReadonly(){const t=this.getActiveAreaInfo();if(!t?.area)return!1;switch(t.area.mode){case s.AreaMode.EDIT:return!1;case s.AreaMode.READONLY:return!0;case s.AreaMode.FORM:return!this.draw.getControl().getIsRangeWithinControl();default:return!1}}insertArea(t){const{id:e,value:n,area:i,position:l,range:r}=t;if(this.zone.getZone()!==s.EditorZone.MAIN&&this.zone.setZone(s.EditorZone.MAIN),this.draw.getPosition().setPositionContext({isTable:!1}),r&&!this.getActiveAreaId()){const{startIndex:c,endIndex:d}=r,u=this.draw.getOriginalMainElementList();if(!u[c]||!u[d])return null;this.range.setRange(r.startIndex,r.endIndex)}else if(l===s.LocationPosition.BEFORE)this.range.setRange(0,0);else{const d=this.draw.getOriginalMainElementList().length-1;this.range.setRange(d,d)}const a=e||ft();return this.draw.insertElementList([{type:s.ElementType.AREA,value:"",areaId:a,valueList:n,area:rt(i)}]),a}render(t,e){if(!this.areaInfoMap.size)return;t.save();const n=this.draw.getMargins(),i=this.draw.getInnerWidth();for(const l of this.areaInfoMap){const{area:r,positionList:a}=l[1];if(r?.hide||!r?.backgroundColor&&!r?.borderColor&&!r?.placeholder)continue;const c=a.filter(g=>g.pageNo===e);if(!c.length)continue;t.translate(.5,.5);const d=c[0],u=c[c.length-1],h=n[3],R=Math.ceil(d.coordinate.leftTop[1]),T=Math.ceil(u.coordinate.rightBottom[1]-R);t.textBaseline="middle",r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fillRect(h,R,i,T)),r.borderColor&&(t.strokeStyle=r.borderColor,t.strokeRect(h,R,i,T)),r.placeholder&&a.length<=1&&new Gl(this.draw).render(t,{placeholder:{...or,...r.placeholder},startY:d.coordinate.leftTop[1]}),t.translate(-.5,-.5)}t.restore()}compute(){this.areaInfoMap.clear();const t=this.draw.getOriginalMainElementList(),e=this.position.getOriginalMainPositionList();for(let n=0;n<t.length;n++){const i=t[n],l=i.areaId;if(l){const r=this.areaInfoMap.get(l);r?(r.elementList.push(i),r.positionList.push(e[n])):this.areaInfoMap.set(l,{id:l,area:i.area,elementList:[i],positionList:[e[n]]})}}}getAreaValue(t={}){const e=t.id||this.getActiveAreaId();if(!e)return null;const n=this.areaInfoMap.get(e);return n?{area:n.area,id:n.id,startPageNo:n.positionList[0].pageNo,endPageNo:n.positionList[n.positionList.length-1].pageNo,value:Ut(n.elementList)}:null}getContextByAreaId(t,e){const n=this.draw.getOriginalMainElementList();for(let i=0;i<n.length;i++){const l=n[i];if(e?.position===s.LocationPosition.OUTER_BEFORE){if(n[i+1]?.areaId!==t)continue}else if(e?.position===s.LocationPosition.AFTER){if(!(l.areaId===t&&n[i+1]?.areaId!==t))continue}else if(e?.position===s.LocationPosition.OUTER_AFTER){if(!(l.areaId!==t&&n[i-1]?.areaId===t))continue}else if(l.areaId!==t)continue;const r=this.position.getOriginalMainPositionList();return{range:{startIndex:i,endIndex:i},elementPosition:r[i]}}return null}setAreaProperties(t){const e=t.id||this.getActiveAreaId();if(!e)return;const n=this.areaInfoMap.get(e);if(!n)return;n.area||(n.area={});let i=!1;const l=["top","hide"];Object.entries(t.properties).forEach(([r,a])=>{if(Gs(a))return;const c=r;n.area[c]=a,l.includes(c)&&(i=!0)}),this.draw.render({isCompute:i,isSetCursor:!1})}setAreaValue(t){const e=t.id||this.getActiveAreaId();if(!e)return;const n=this.areaInfoMap.get(e);if(!n)return;const{positionList:i}=n,l=this.draw.getOriginalMainElementList(),r=t.value;ee([{type:s.ElementType.AREA,value:"",valueList:r,areaId:n.id,area:n.area}],{editorOptions:this.options}),this.draw.spliceElementList(l,i[0].index,i.length,r,{isIgnoreDeletedRule:!0}),this.draw.render({isSetCursor:!1})}}class _T{draw;options;imageCache;mainBadge;areaBadgeMap;constructor(t){this.draw=t,this.options=t.getOptions(),this.imageCache=new Map,this.mainBadge=null,this.areaBadgeMap=new Map}setMainBadge(t){this.mainBadge=t}setAreaBadgeMap(t){this.areaBadgeMap.clear(),t.forEach(e=>{this.areaBadgeMap.set(e.areaId,e.badge)})}_drawImage(t,e,n,i,l,r){if(this.imageCache.has(r)){const a=this.imageCache.get(r);t.drawImage(a,e,n,i,l)}else{const a=new Image;a.setAttribute("crossOrigin","Anonymous"),a.src=r,a.onload=()=>{this.imageCache.set(r,a),t.drawImage(a,e,n,i,l)}}}render(t,e){if(e===0&&this.mainBadge){const{scale:n,badge:i}=this.options,{left:l,top:r,width:a,height:c,value:d}=this.mainBadge,u=this.draw.getMargins()[0]+this.draw.getHeader().getExtraHeight(),h=(l||i.left)*n,R=(r||i.top)*n+u;this._drawImage(t,h,R,a*n,c*n,d)}if(this.areaBadgeMap.size){const n=this.draw.getArea().getAreaInfo();if(n.size){const{scale:i,badge:l}=this.options;for(const r of n){const{positionList:a}=r[1],c=a[0];if(c.pageNo!==e)continue;const d=this.areaBadgeMap.get(r[0]);if(!d)continue;const{left:u,top:h,width:R,height:T,value:g}=d,f=(u||l.left)*i,C=(h||l.top)*i+c.coordinate.leftTop[1];this._drawImage(t,f,C,R*i,T*i,g)}}}}}class BT{draw;options;data;pageContainer;isDrawing=!1;startStroke=null;constructor(t,e){this.draw=t,this.options=t.getOptions(),this.data=e||[],this.pageContainer=t.getPageContainer(),this.register()}register(){this.pageContainer.addEventListener("mousedown",this.start.bind(this)),this.pageContainer.addEventListener("mouseup",this.stop.bind(this)),this.pageContainer.addEventListener("mouseleave",this.stop.bind(this)),this.pageContainer.addEventListener("mousemove",this.drawing.bind(this))}start(t){if(!this.draw.isGraffitiMode())return;this.isDrawing=!0;const{scale:e}=this.options;this.startStroke={lineColor:this.options.graffiti.defaultLineColor,lineWidth:this.options.graffiti.defaultLineWidth,points:[t.offsetX/e,t.offsetY/e]}}stop(){this.isDrawing=!1}drawing(t){if(!this.isDrawing||!this.draw.isGraffitiMode())return;const{offsetX:e,offsetY:n}=t,i=2;if(this.startStroke&&Math.abs(this.startStroke.points[0]-e)<i&&Math.abs(this.startStroke.points[1]-n)<i)return;const l=this.draw.getPageNo();let r=this.data.find(d=>d.pageNo===l);if(this.startStroke&&(r||(r={pageNo:l,strokes:[]},this.data.push(r)),r.strokes.push(this.startStroke),this.startStroke=null),!r?.strokes?.length)return;const{scale:a}=this.options;r.strokes[r.strokes.length-1].points.push(e/a,n/a),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1})}getValue(){return this.data}compute(){const t=this.draw.getPageRowList().length;for(let e=this.data.length-1;e>=0;e--)this.data[e].pageNo>t-1&&this.data.splice(e,1)}clear(){this.data=[]}render(t,e){const n=this.data.find(a=>a.pageNo===e)?.strokes;if(!n?.length)return;const{graffiti:{defaultLineColor:i,defaultLineWidth:l},scale:r}=this.options;t.save();for(let a=0;a<n.length;a++){const c=n[a];t.beginPath(),t.strokeStyle=c.lineColor||i,t.lineWidth=(c.lineWidth||l)*r,t.moveTo(c.points[0]*r,c.points[1]*r);for(let d=2;d<c.points.length;d+=2)t.lineTo(c.points[d]*r,c.points[d+1]*r);t.stroke()}t.restore()}}const xl=1024,bn=/[\r\n\u200B]/,kT=['[aria-modal="true"]','[role="dialog"]','[data-overlay-active="true"]',".ant-modal-root",".ant-modal-wrap",".ant-modal",".ant-drawer",".ant-select-dropdown",".ant-picker-dropdown",".ant-dropdown",".ant-popover",".ant-tooltip",".ant-cascader-dropdown",".ant-mentions-dropdown"].join(", ");function Jl(o,t,e){for(let n=0;n<e.length;n+=xl){const i=e.slice(n,n+xl);o.splice(t+n,0,...i)}}class GT{container;pageContainer;pageList;ctxList;pageNo;renderCount;pendingRenderFrameId;pendingRenderOption;pagePixelRatio;mode;options;position;zone;elementList;listener;eventBus;override;i18n;canvasEvent;globalEvent;cursor;range;margin;background;badge;search;group;area;underline;strikeout;highlight;historyManager;previewer;imageParticle;laTexParticle;textParticle;tableParticle;tableTool;tableOperate;pageNumber;lineNumber;waterMark;placeholder;header;footer;hyperlinkParticle;labelParticle;macroParticle;dateParticle;separatorParticle;pageBreakParticle;superscriptParticle;subscriptParticle;checkboxParticle;radioParticle;menstrualHistoryParticle;fetalHeartPositionParticle;toothPositionParticle;blockParticle;listParticle;lineBreakParticle;whiteSpaceParticle;control;pageBorder;workerManager;scrollObserver;selectionObserver;imageObserver;graffiti;command;interactionPaused;overlayActiveCount;globalShortcutSuspended;LETTER_REG;WORD_LIKE_REG;rowList;pageRowList;painterStyle;painterOptions;visiblePageNoList;intersectionPageNo;lazyRenderIntersectionObserver;printModeData;readonlyModeData;splitTdValueMap=new Map;tdMap=new Map;constructor(t,e,n,i,l,r){this.container=this._wrapContainer(t),this.pageList=[],this.ctxList=[],this.pageNo=0,this.renderCount=0,this.pendingRenderFrameId=null,this.pendingRenderOption=null,this.pagePixelRatio=null,this.mode=e.mode,this.options=e,this.elementList=n.main,this.listener=i,this.eventBus=l,this.override=r,this._formatContainer(),this.pageContainer=this._createPageContainer(),this._createPage(0),this.i18n=new XT(e.locale),this.historyManager=new Xd(this),this.position=new yd(this),this.zone=new bT(this),this.range=new Nd(this),this.margin=new Wd(this),this.background=new bd(this),this.badge=new _T(this),this.search=new Ud(this),this.group=new UT(this),this.area=new AT(this),this.underline=new wd(this),this.strikeout=new Yd(this),this.highlight=new Vd(this),this.previewer=new MT(this),this.imageParticle=new $s(this),this.laTexParticle=new qs(this),this.textParticle=new vd(this),this.tableParticle=new Kd(this),this.tableTool=new Hd(this),this.tableOperate=new HT(this),this.pageNumber=new Gn(this),this.lineNumber=new vT(this),this.waterMark=new zd(this),this.placeholder=new Gl(this),this.header=new kd(this,n.header),this.footer=new VT(this,n.footer),this.hyperlinkParticle=new Ad(this),this.labelParticle=new _d(this),this.macroParticle=new Bd(this),this.dateParticle=new OT(this),this.separatorParticle=new Jd(this),this.pageBreakParticle=new $d(this),this.superscriptParticle=new Gd,this.subscriptParticle=new xd,this.checkboxParticle=new gT(this),this.radioParticle=new TT(this),this.menstrualHistoryParticle=new fT(this),this.fetalHeartPositionParticle=new mT(this),this.toothPositionParticle=new CT(this),this.blockParticle=new DT(this),this.listParticle=new WT(this),this.lineBreakParticle=new Po(this),this.whiteSpaceParticle=new YT(this),this.control=new aT(this),this.pageBorder=new ZT(this),this.graffiti=new BT(this,n.graffiti),this.scrollObserver=new Zd(this),this.selectionObserver=new Qd(this),this.imageObserver=new yT,new wT(this),this.canvasEvent=new Dd(this),this.cursor=new Hc(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new Fd(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new PT(this),new KT(this);const{letterClass:a}=e;this.LETTER_REG=new RegExp(`[${a.join("")}]`),this.WORD_LIKE_REG=new RegExp(`${a.map(c=>`[^${c}][${c}]`).join("|")}`),this.rowList=[],this.pageRowList=[],this.painterStyle=null,this.painterOptions=null,this.visiblePageNoList=[],this.intersectionPageNo=0,this.lazyRenderIntersectionObserver=null,this.printModeData=null,this.readonlyModeData=null,this.interactionPaused=!1,this.overlayActiveCount=0,this.globalShortcutSuspended=!1,this.isPrintLikeMode()&&this.setPrintData(),this.mode===s.EditorMode.READONLY&&this.setReadonlyData(),this.mode,s.EditorMode.FORM,this.render({isInit:!0,isSetCursor:!1,isFirstRender:!0})}setPrintData(){this.printModeData||(this.printModeData=rt({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const t=rt(this.printModeData);["header","main","footer"].forEach(l=>{t[l]=this.control.filterAssistElement(t[l])});const n=t,i=this.removeStrikeout(n);t.main=i.main.filter(l=>!l.strikeout),this.setEditorData(i)}removeStrikeout(t){if(Array.isArray(t))return t.map(e=>this.removeStrikeout(e)).filter(e=>!(e&&typeof e=="object"&&"strikeout"in e&&e.strikeout===!0));if(t&&typeof t=="object"){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=this.removeStrikeout(t[n]));return e}return t}clearPrintData(){this.printModeData&&(this.setEditorData(rt(this.printModeData)),this.printModeData=null)}setReadonlyData(){this.readonlyModeData||(this.readonlyModeData=rt({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const t=rt(this.readonlyModeData);["header","main","footer"].forEach(n=>{const i=Ut(t[n],{editorOptions:this.options});t[n]=Qn(i),ee(t[n],{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData(t)}clearReadonlyData(){if(this.readonlyModeData){const t=rt(this.readonlyModeData);this.readonlyModeData=null,this.setEditorData(t)}}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}isPrintLikeMode(t=this.mode){return t===s.EditorMode.PRINT||t===s.EditorMode.COMPARE}getIsButtonRowStartPrefix(t,e,n){const i=t[e];if(this.isPrintLikeMode()||i.control?.type!==s.ControlType.BUTTON||i.control.buttonText||i.control.minWidth||i.controlComponent!==s.ControlComponent.PREFIX||!i.value)return!1;const l=t[e+1];return!l||l.controlId!==i.controlId||(l.originControlId||null)!==(i.originControlId||null)||l.controlComponent!==s.ControlComponent.VALUE||l.buttonValueLayout?!1:n.elementList.every(r=>r.value===_||ae(r))}getElementLayoutWidth(t){return t.control?.type===s.ControlType.BUTTON&&!t.control.buttonText&&t.controlComponent===s.ControlComponent.PREFIX&&t.left&&t.left<0?Math.max(0,t.metrics.width+t.left):t.metrics.width}isContentReadonly(){if(this.mode===s.EditorMode.COMPARE)return!0;if(this.area.getActiveAreaInfo()?.area?.mode)return this.area.isReadonly();switch(this.mode){case s.EditorMode.DESIGN:return!1;case s.EditorMode.READONLY:case s.EditorMode.PRINT:case s.EditorMode.GRAFFITI:return!0;case s.EditorMode.FORM:if(this.getIsInteractiveControlAtCursor())return!1;if(this.position.getPositionContext().isTable)return!this.isTableEditable()||this.getTd()?.disabled===!0;if(this.control.getIsRangeWithinControl()){const t=this.getElementList(),{startIndex:e}=this.range.getRange(),n=t[e];if(n?.control?.type===s.ControlType.TEXTFIELD){const i=n.controlId;if(i){for(let l=0;l<t.length;l++)if(t[l].originControlId===i&&t[l].controlId!==i)return!1}return!0}}return!this.control.getIsRangeWithinControl();default:return!1}}isSelectionDisabled(){return this.mode===s.EditorMode.COMPARE?!1:this.area.getActiveAreaInfo()?.area?.mode?this.area.isReadonly():this.mode===s.EditorMode.READONLY||this.mode===s.EditorMode.PRINT||this.mode===s.EditorMode.GRAFFITI}getIsInteractiveControlAtCursor(){const{startIndex:t}=this.range.getRange(),e=this.getElementList(),n=e[t];if(!n?.controlId||this.position.getPositionContext().isTable&&this.getTd()?.disabled)return!1;let i=n.control?.type;if(!i)for(let l=t;l>=0;l--){const r=e[l];if(!kt(r,n))break;if(r.control?.type){i=r.control.type;break}}return i?i!==s.ControlType.TEXTFIELD:!1}setMode(t){if(this.mode===t)return;const e=this.mode;this.macroParticle.clearInlineEditor({isSubmitHistory:!1}),this.mode=t,this.options.mode=t;const n=this.isPrintLikeMode(t);this.isPrintLikeMode(e)&&this.clearPrintData(),e===s.EditorMode.READONLY&&t!==s.EditorMode.READONLY&&this.clearReadonlyData(),n&&!this.printModeData&&(this.printModeData=rt({header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()}));const i=new Map,l=a=>{a.forEach(c=>{c.controlId&&(c.controlComponent==="value"&&i.set(c.controlId,!0),c.checked&&i.set(c.controlId,!0))})};l(this.elementList),this.elementList.forEach(a=>{a.type==="table"&&a.trList?.forEach(c=>{c.tdList?.forEach(d=>{l(d.value)})})});const r=a=>{a.forEach(c=>{if(!(!c.control&&!c.controlId)&&(c.controlComponent==="value"&&c.strikeout&&(n?c.hide=!0:c.hide=!1),!!c.control&&!(c.type!=="control"&&c.control.type!=="button"))){if(c.control.type==="TextField"&&(c.controlComponent==="placeholder"||c.controlComponent==="preTextFix"||c.controlComponent==="preTextFixText"||c.controlComponent==="postTextFix"||c.controlComponent==="postTextFixText"||c.controlComponent==="textFixLabel")&&(t===s.EditorMode.EDIT?c.hide=!1:c.hide=!0),c.control.type==="text"&&(c.controlComponent==="placeholder"||c.controlComponent==="prefix"||c.controlComponent==="postfix")&&(t===s.EditorMode.EDIT||t===s.EditorMode.FORM?c.hide=!1:c.hide=!0),c.control.type==="number"||c.control.type==="select"||c.control.type==="date"||c.control.type==="checkbox"||c.control.type==="radio"){if(c.controlComponent==="placeholder"||c.controlComponent==="prefix"||c.controlComponent==="postfix"){const u=i.get(c.controlId);c.control.type==="select"&&n||n&&!u?c.hide=!0:c.hide=!1}c.control.type==="number"&&c.controlComponent==="value"&&(n&&c.strikeout?c.hide=!0:!n&&c.strikeout&&(c.hide=!1))}c.control.type==="button"&&(c.hide=!1,c.control.hide=!1),c.control.type==="menstrualHistory"&&(c.controlComponent==="prefix"||c.controlComponent==="postfix")&&(n?c.hide=!0:c.hide=!1)}})};r(this.elementList),this.elementList.forEach(a=>{a.type==="table"&&a.trList.forEach(c=>{c.tdList.forEach(d=>{r(d.value)})})}),t===s.EditorMode.FORM?(this.elementList.filter(a=>a.type==="control").map(a=>{a.control?.type==="button"&&(a.controlComponent==="prefix"||a.controlComponent==="postfix"?(a.color="#1677FF",a.highlight="transparent"):a.controlComponent==="value"&&(a.color=this.options.defaultColor,a.highlight="transparent"))}),this.hideTextFieldWhitespace(this.elementList,!0),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):t===s.EditorMode.EDIT?(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!1,!0)),n?(this.elementList.filter(a=>a?.control?.type==="button").map(a=>{(a?.controlComponent==="prefix"||a?.controlComponent==="postfix")&&(a.color="transparent",a.highlight="transparent"),a?.controlComponent==="value"&&!a.control.buttonText&&(a.color=this.options.defaultColor,a.highlight="transparent")}),this.setPrintData()):(this.clearPrintData(),this.elementList.filter(a=>a?.control?.type==="button").map(a=>{(a?.controlComponent==="prefix"||a?.controlComponent==="postfix")&&(a.color="#1677FF",a.highlight="transparent"),a?.controlComponent==="value"&&!a.control.buttonText&&(a.color=this.options.defaultColor,a.highlight="transparent"),a?.type==="text"&&a.control.buttonText&&(a.color="#000"),a?.type==="control"&&a?.controlComponent==="value"&&a.control.buttonText&&(a.color="#000",a.highlight="transparent")})),t===s.EditorMode.READONLY&&this.setReadonlyData(),this.clearSideEffect(),this.control.destroyControl(),this.range.clearRange(),this.render({isSetCursor:!1,isSubmitHistory:!1})}hideTextFieldWhitespace(t,e){const n=a=>a?/^[\s\u00A0\u2000-\u200B\u3000\n\r\t]+$/.test(a):!1,i=(a,c)=>{for(let d=0;d<a.length;d++){const u=a[d];if(u.type===s.ElementType.TABLE&&u.trList)for(const h of u.trList)for(const R of h.tdList)i(R.value,c);u.originControlId&&u.controlId&&u.originControlId!==u.controlId&&c.add(u.originControlId)}},l=new Set;e&&i(t,l),(a=>{for(let c=0;c<a.length;c++){const d=a[c];if(d.type===s.ElementType.TABLE&&d.trList)for(const u of d.trList)for(const h of u.tdList)this.hideTextFieldWhitespace(h.value,e);d.control?.type===s.ControlType.TEXTFIELD&&d.controlComponent===s.ControlComponent.VALUE&&n(d.value)&&(d.controlId&&l.has(d.controlId)?d.hide=!1:d.hide=e)}})(t)}getSubTemplateRuntimeEndIndex(t,e,n){if(!n)return e+1;const i=new Set([n]);let l=e+1;for(;l<t.length;){const r=t[l];if(!r.subTemplateParentId||!i.has(r.subTemplateParentId))break;r.type===s.ElementType.SUB_TEMPLATE&&r.id&&i.add(r.id),l++}return l}syncSubTemplateRuntimeContent(){const t=new Set,e=n=>{if(!t.has(n)){t.add(n);for(let i=n.length-1;i>=0;i--){const l=n[i];if(l.type===s.ElementType.SUB_TEMPLATE&&l.id){const r=this.getSubTemplateRuntimeEndIndex(n,i,l.id),a=n.slice(i+1,r).filter(c=>c.subTemplateParentId===l.id);if(a.length){const c=Ut(a,{extraPickAttrs:["id","controlId"],editorOptions:this.options});Wl(c),l.subTemplateContent=c}}if(l.valueList?.length&&e(l.valueList),l.control?.value?.length&&e(l.control.value),l.type===s.ElementType.TABLE&&l.trList?.length)for(let r=0;r<l.trList.length;r++){const a=l.trList[r];for(let c=0;c<a.tdList.length;c++)e(a.tdList[c].value)}}}};e(this.getHeaderElementList()),e(this.elementList),e(this.getFooterElementList())}getLegacySubTemplateRuntimeEndIndex(t,e,n){if(!n.subTemplateExpanded||!n.subTemplateContent?.length)return e+1;const i=new Set;ui(n.subTemplateContent,r=>{r.controlId&&i.add(r.controlId)});const l=(r,a)=>{const c=rt(r);ee(c,{isHandleFirstElement:!1,editorOptions:this.options});const d=[{expectedIndex:0,actualIndex:a}];for(;d.length;){let{expectedIndex:u,actualIndex:h}=d.pop(),R=!0;for(;u<c.length;){const T=t[h],g=c[u],f=!!(g.controlId&&i.has(g.controlId));if(!T||T.subTemplateParentId||T.type!==g.type||T.value!==g.value||f&&T.controlId!==g.controlId||T.controlComponent!==g.controlComponent){R=!1;break}const C=h+1;if(g.type===s.ElementType.SUB_TEMPLATE&&g.subTemplateContent?.length){const p=l(g.subTemplateContent,C);if(p!=null){d.push({expectedIndex:u+1,actualIndex:C}),u++,h=p;continue}}u++,h=C}if(R)return h}return null};return l(n.subTemplateContent,e+1)??e+1}syncSubTemplateExpandedState(t,e,n,i,l){let r=!1;n.id||(n.id=ft(),r=!0);let a=this.getSubTemplateRuntimeEndIndex(t,e,n.id);if(a===e+1&&n.subTemplateExpanded){const c=this.getLegacySubTemplateRuntimeEndIndex(t,e,n);c>e+1&&(t.splice(e+1,c-e-1),a=e+1,r=!0)}if(i&&!n.subTemplateContent?.length&&(i=!1),n.subTemplateExpanded!==i&&(n.subTemplateExpanded=i,r=!0),!!n.hide!==l&&(n.hide=l,r=!0),!i)return a>e+1&&(t.splice(e+1,a-e-1),r=!0),r;if(a===e+1){const c=rt(n.subTemplateContent||[]);ee(c,{isHandleFirstElement:!1,editorOptions:this.options}),Ws(c,n),c.length&&(t.splice(e+1,0,...c),r=!0)}else{const c=t.slice(e+1,a).filter(d=>d.subTemplateParentId===n.id);r=Ws(c,n)||r}return r}applySubTemplateRuntimeState(t,e){const n=i=>{let l=!1,r=0;for(;r<i.length;){const a=i[r];if(a.type===s.ElementType.SUB_TEMPLATE){const c=!!a.subTemplateConditions?.length;if(this.mode===s.EditorMode.EDIT)l=this.syncSubTemplateExpandedState(i,r,a,!0,!0)||l;else if((this.mode===s.EditorMode.FORM||this.isPrintLikeMode())&&c){const d=e?RT(a.subTemplateConditions,e,a.subTemplateRelation):!1;l=this.syncSubTemplateExpandedState(i,r,a,d,!0)||l}else(this.mode===s.EditorMode.FORM||this.isPrintLikeMode())&&!c?l=this.syncSubTemplateExpandedState(i,r,a,!0,!0)||l:this.mode!==s.EditorMode.FORM&&!this.isPrintLikeMode()&&(l=this.syncSubTemplateExpandedState(i,r,a,!1,!1)||l)}if(a.valueList?.length&&(l=n(a.valueList)||l),a.control?.value?.length&&(l=n(a.control.value)||l),a.type===s.ElementType.TABLE&&a.trList?.length)for(let c=0;c<a.trList.length;c++){const d=a.trList[c];for(let u=0;u<d.tdList.length;u++)l=n(d.tdList[u].value)||l}r++}return l};return n(t)}updateTextFieldPlaceholderVisibility(t,e,n){const i=[s.ControlType.TEXT,s.ControlType.TEXTFIELD,s.ControlType.SELECT,s.ControlType.DATE,s.ControlType.CHECKBOX,s.ControlType.RADIO,s.ControlType.NUMBER];(r=>{let a=0;for(;a<r.length;){const c=r[a];if(c.type===s.ElementType.TABLE&&c.trList)for(const d of c.trList)for(const u of d.tdList)this.updateTextFieldPlaceholderVisibility(u.value,e,n);if(c.control?.type&&i.includes(c.control.type)&&(c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PRE_TEXT)){const d=c.controlId,u=c.control.type;let h=!1,R=!1,T=!1;const g=[],f=[],C=[];let p=-1,I=a;for(;I<r.length;){const m=r[I];if(m.controlId!==d){const L=m.controlId;let O=u===s.ControlType.TEXT,P=I;if(O)for(;P<r.length&&r[P].controlId===L;)P++;else for(;P<r.length;){const S=r[P];if(S.controlId!==L)break;S.controlComponent===s.ControlComponent.VALUE&&(S.value&&S.value.trim()||S.type===s.ElementType.MENSTRUAL_HISTORY||S.type===s.ElementType.FETAL_HEART_POSITION||S.type===s.ElementType.TOOTH_POSITION||S.type===s.ElementType.IMAGE||S.type===s.ElementType.MACRO||S.type===s.ElementType.CUSTOM_MACRO)&&(O=!0),P++}O&&(R=!0),I=P;continue}if((m.controlComponent===s.ControlComponent.PREFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX||m.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&f.push(I),m.controlComponent===s.ControlComponent.VALUE&&m.value&&m.value.trim()&&(h=!0),m.controlComponent===s.ControlComponent.VALUE&&(m.type===s.ElementType.MENSTRUAL_HISTORY||m.type===s.ElementType.FETAL_HEART_POSITION||m.type===s.ElementType.TOOTH_POSITION||m.type===s.ElementType.IMAGE||m.type===s.ElementType.MACRO||m.type===s.ElementType.CUSTOM_MACRO)&&(h=!0),m.controlComponent===s.ControlComponent.VALUE&&m.control&&m.control.type!==u&&(R=!0),m.controlComponent===s.ControlComponent.PLACEHOLDER&&(T=!0,g.push(I)),m.controlComponent===s.ControlComponent.POSTFIX||m.controlComponent===s.ControlComponent.POSTTEXTFIX||m.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT){C.push(I),p=I;break}I++}if(h||R){if(T&&g.length>0)for(const m of g)r[m].hide=!0}else if(T&&g.length>0)for(const m of g)r[m].hide=!e;else e&&c.control?.placeholder&&(p>0?this.control.addPlaceholder(p-1):this.control.addPlaceholder(a));if(n)if(e&&(h||R)){for(const m of f)r[m].hide=!0;for(const m of C)r[m].hide=!0}else if(e){for(const m of f)r[m].hide=!1;for(const m of C)r[m].hide=!1}else{for(const m of f)r[m].hide=!0;for(const m of C)r[m].hide=!0}else{for(const m of f)r[m].hide=!1;for(const m of C)r[m].hide=!1}a=I}a++}})(t)}isReadonly(){return this.isContentReadonly()}isTableEditable(){const{index:t,isTable:e}=this.position.getPositionContext();if(!e||t===void 0)return!1;const n=this.getOriginalElementList()[t];return n?.type===s.ElementType.TABLE&&n.tableEditable===!0}isDisabled(){if(this.mode===s.EditorMode.DESIGN)return!1;const{startIndex:t,endIndex:e}=this.range.getRange(),n=this.getElementList();if(this.getTd()?.disabled)return!0;if(t===e){const l=n[t],r=n[t+1];return!!(l?.title?.disabled&&r?.title?.disabled&&l.titleId===r.titleId||l?.control?.disabled&&r?.control?.disabled&&l.controlId===r.controlId)}return n.slice(t+1,e+1).some(l=>l.title?.disabled||l.control?.disabled)}isDesignMode(){return this.mode===s.EditorMode.DESIGN}isPrintMode(){return this.mode===s.EditorMode.PRINT}isGraffitiMode(){return this.mode===s.EditorMode.GRAFFITI}getOriginalWidth(){const{paperDirection:t,width:e,height:n}=this.options;return t===s.PaperDirection.VERTICAL?e:n}getOriginalHeight(){const{paperDirection:t,width:e,height:n}=this.options;return t===s.PaperDirection.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,r=this.getOriginalElementList()[e],a=r.trList[n].tdList[i],c=this.getTdPadding(r);return a.width-c[1]-c[3]}return this.getOriginalInnerWidth()}getMargins(){return this.getOriginalMargins().map(t=>t*this.options.scale)}getOriginalMargins(){const{margins:t,paperDirection:e}=this.options;return e===s.PaperDirection.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}getHighlightMarginHeight(){return this.options.highlightMarginHeight*this.options.scale}getTdPadding(t){const{table:{tdPadding:e},scale:n}=this.options;return(t?.tdPadding||e).map(l=>l*n)}getContainer(){return this.container}getPageContainer(){return this.pageContainer}getEventTarget(t){return t instanceof Element?t:t instanceof Node?t.parentElement:null}isTargetInsideEditor(t){const e=this.getEventTarget(t);return e?this.container.contains(e)?!0:!!Hs(e,n=>!!n&&n.nodeType===1&&!!n.getAttribute(ve)):!1}isTargetInsideExternalOverlay(t){const e=this.getEventTarget(t);return!e||this.isTargetInsideEditor(e)?!1:!!e.closest(kT)}pauseInteraction(){this.interactionPaused=!0,this.flushPendingRender(),this.cursor?.getAgentDom().blur(),this.globalEvent?.resetSideEffect()}resumeInteraction(){this.interactionPaused=!1}setOverlayActive(t){this.overlayActiveCount=t?1:0,t&&(this.flushPendingRender(),this.cursor?.getAgentDom().blur(),this.globalEvent?.resetSideEffect())}suspendGlobalShortcut(t){this.globalShortcutSuspended=t}isInteractionSuspended(){return this.interactionPaused||this.overlayActiveCount>0}isGlobalShortcutActive(){return!this.globalShortcutSuspended&&!this.isInteractionSuspended()}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}getRenderCount(){return this.renderCount}requestRender(t){const e={...t||{}};(e.isSubmitHistory??!0)&&(this.submitHistory(e.curIndex),e.isSubmitHistory=!1,e.isContentChange=!0),this.pendingRenderOption=e,this.cursor.cancelPendingVisibilityCheck(),this.pendingRenderFrameId===null&&(this.pendingRenderFrameId=window.requestAnimationFrame(()=>{const n=this.pendingRenderOption||void 0;this.pendingRenderFrameId=null,this.pendingRenderOption=null,this.render(n)}))}flushPendingRender(){const t=this._takePendingRenderOption();t&&this.render(t)}_takePendingRenderOption(){if(this.pendingRenderFrameId===null)return null;window.cancelAnimationFrame(this.pendingRenderFrameId);const t=this.pendingRenderOption||{};return this.pendingRenderFrameId=null,this.pendingRenderOption=null,t}_cancelPendingRender(){this._takePendingRenderOption()}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:l}=e;return t[n].trList[i].tdList[l].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}getArea(){return this.area}getBadge(){return this.badge}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){const e=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:l}=e;return t[n]?.trList?.[i].tdList[l].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:l}=t;return l?this.getOriginalElementList()[e].trList[n].tdList[i]:null}getTdByPosition(t){const{index:e,trIndex:n,tdIndex:i,isTable:l}=t;return l?this.getOriginalElementList()[e].trList[n].tdList[i]:null}insertElementTextField(t,e={}){if(!t.length||!this.range.getIsCanInput())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const l=this.getElementList(),{isSubmitHistory:r=!0}=e;ee(t,{isHandleFirstElement:!1,editorOptions:this.options});let a=-1,c=this.control.getActiveControl();if(!c&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),c=this.control.getActiveControl()),c&&this.control.getIsRangeWithinControl()){const d=n===i,u=n+1;d||this.newSpliceElementList(l,u,i-n),this.newSpliceElementList(l,u,0,t),a=n+t.length}else{const d=n===i,u=n+1;d||this.newSpliceElementList(l,u,i-n),this.newSpliceElementList(l,u,0,t),a=n+t.length;const h=l[u-1];t[0].listId&&h&&!h.listId&&h?.value===_&&(!h.type||h.type===s.ElementType.TEXTFIELD)&&(l.splice(n,1),a-=1)}this.control.destroyControl(),~a&&(this.range.setRange(a,a),this.render({curIndex:a,isSubmitHistory:r}))}insertElementList(t,e={}){if(!t.length||!this.range.getIsCanInput())return;let{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const{isSubmitHistory:l=!0}=e;ee(t,{isHandleFirstElement:!1,editorOptions:this.options});let r=-1,a=this.control.getActiveControl();if(!a&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),a=this.control.getActiveControl()),a&&this.control.getIsRangeWithinControl()){const c=this.getElementList(),d=n===i;if(d&&(c[n]?.control?.type===s.ControlType.TEXTFIELD||c[n]?.control?.type===s.ControlType.TEXT)){this.range.shrinkBoundary();const P=this.range.getRange();n=P.startIndex,i=P.endIndex}const u=n+1,h=c[n],R=c[u],T=P=>!!(P&&(P.controlComponent===s.ControlComponent.POSTFIX||P.controlComponent===s.ControlComponent.POST_TEXT||P.controlComponent===s.ControlComponent.POSTTEXTFIX||P.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)),g=P=>!!(P&&(P.controlComponent===s.ControlComponent.PREFIX||P.controlComponent===s.ControlComponent.PRE_TEXT||P.controlComponent===s.ControlComponent.PRETEXTFIX||P.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)),f=P=>{if(P)return c.find(S=>S.controlId===P&&!S.originControlId&&!!S.control?.type)},C=h?.originControlId&&R?.originControlId===h.originControlId&&h.controlId&&R.controlId&&h.controlId!==R.controlId&&T(h)&&g(R)?f(h.originControlId):void 0,p=C?.control?.type===s.ControlType.TEXTFIELD,I=!!(h?.originControlId&&T(h)&&R?.controlId===h.originControlId&&!R.originControlId&&R.control?.type===s.ControlType.TEXTFIELD&&T(R)),m=!!(h?.originControlId&&T(h)&&R?.controlId===h.originControlId&&!R.originControlId&&R.control?.type===s.ControlType.TEXTFIELD&&R.controlComponent===s.ControlComponent.VALUE);if(h?.controlComponent===s.ControlComponent.PRE_TEXT||h?.controlComponent===s.ControlComponent.POST_TEXT||h?.controlComponent===s.ControlComponent.PREFIX||h?.controlComponent===s.ControlComponent.POSTFIX)for(let P=0;P<t.length;P++)t[P].control||(t[P].color=this.options.defaultColor);d&&!I&&!m&&(c[n]?.control?.type===s.ControlType.TEXTFIELD||c[n]?.control?.type===s.ControlType.TEXT)&&this.control.removePlaceholder(n),d||this.newSpliceElementList(c,u,i-n);const O=I||m||p?h.originControlId:c[n]?.controlId||c[n-1]?.controlId||c[n+1]?.controlId;for(let P=0;P<t.length;P++){if((I||m||p)&&!t[P].control&&(t[P].controlId=O,t[P].control=p?C?.control:R.control,t[P].controlComponent=s.ControlComponent.VALUE,delete t[P].originControlId),t[P]?.control?.type=="button"&&!t[P]?.control?.buttonText&&(t[P]?.controlComponent==="prefix"||t[P]?.controlComponent==="postfix"?(t[P].color="#1677FF",t[P].highlight="transparent"):(t[P].color=this.options.defaultColor,t[P].highlight="transparent")),t[P]?.type===s.ElementType.MENSTRUAL_HISTORY||t[P]?.type===s.ElementType.FETAL_HEART_POSITION||t[P]?.type===s.ElementType.TOOTH_POSITION||t[P]?.type===s.ElementType.IMAGE||t[P]?.type===s.ElementType.MACRO||t[P]?.type===s.ElementType.CUSTOM_MACRO||t[P]?.type===s.ElementType.REUSABLE_ITEM||t[P]?.type===s.ElementType.SUB_TEMPLATE||t[P]?.type===s.ElementType.SPECIAL_SYMBOLS){t[P].controlComponent=s.ControlComponent.VALUE;let S=c[n]?.controlId;S||(S=c[n-1]?.controlId),S||(S=c[n+1]?.controlId),!t[P].controlId&&S&&(t[P].controlId=S)}O&&t[P]?.control&&t[P].controlId&&t[P].controlId!==O&&(t[P].originControlId=O)}this.newSpliceElementList(c,u,0,t),r=n+t.length}else{const c=this.getElementList(),d=n===i,u=n+1;if(c[u]?.control?.type=="TextField"||c[n]?.control?.type=="TextField"){d||this.newSpliceElementList(c,u,i-n);for(let h=0;h<t.length;h++)if(t[h]?.type===s.ElementType.MENSTRUAL_HISTORY||t[h]?.type===s.ElementType.FETAL_HEART_POSITION||t[h]?.type===s.ElementType.TOOTH_POSITION||t[h]?.type===s.ElementType.MACRO||t[h]?.type===s.ElementType.CUSTOM_MACRO||t[h]?.type===s.ElementType.REUSABLE_ITEM||t[h]?.type===s.ElementType.SUB_TEMPLATE||t[h]?.type===s.ElementType.SPECIAL_SYMBOLS){t[h].controlComponent=s.ControlComponent.VALUE;const R=c[n]?.controlId||c[u]?.controlId;!t[h].controlId&&R&&(t[h].controlId=R)}this.newSpliceElementList(c,u,0,t),r=n+t.length}else{d||this.spliceElementList(c,u,i-n);for(let R=0;R<t.length;R++)t[R]?.control?.type=="button"&&!t[R]?.control?.buttonText&&(t[R]?.controlComponent==="prefix"||t[R]?.controlComponent==="postfix"?(t[R].color="#1677FF",t[R].highlight="transparent"):(t[R].color=this.options.defaultColor,t[R].highlight="transparent"));this.spliceElementList(c,u,0,t),r=n+t.length;const h=c[u-1];t[0].listId&&h&&!h.listId&&h?.value===_&&(!h.type||h.type===s.ElementType.TEXT)&&(c.splice(n,1),r-=1)}}~r&&(this.range.setRange(r,r),this.render({curIndex:r,isSubmitHistory:l}))}appendElementList(t,e={}){if(!t.length)return;ee(t,{isHandleFirstElement:!1,editorOptions:this.options});let n;const{isPrepend:i,isSubmitHistory:l=!0}=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,isSubmitHistory:l})}spliceElementList(t,e,n,i,l){const{isIgnoreDeletedRule:r=!1}=l||{},{group:a,modeRule:c}=this.options;if(n>0){const d=e+n,h=t[d]?.listId;if(h&&t[e-1]?.listId!==h){let R=d;for(;R<t.length;){const T=t[R];if(T.listId!==h||T.value===_)break;delete T.listId,delete T.listType,delete T.listStyle,R++}}if(!r&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const R=this.getTd()?.deletable;let T=d-1;for(;T>=e;){const g=t[T];(ae(g)||R!==!1&&g?.control?.deletable!==!1&&(!g.controlId||this.mode!==s.EditorMode.FORM||!c[this.mode].controlDeletableDisabled)&&g?.title?.deletable!==!1&&(a.deletable!==!1||!g.groupIds?.length)&&(g?.area?.deletable!==!1||g?.areaIndex!==0))&&t.splice(T,1),T--}}else t.splice(e,n)}if(i?.length){let d=t[e];for(let u=0;u<i.length;u++){const h=i[u].value===_&&(d?.controlComponent===s.ControlComponent.PREFIX||d?.controlComponent===s.ControlComponent.PRE_TEXT||d?.controlComponent===s.ControlComponent.PRETEXTFIX||d?.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT);!i[u].controlComponent&&d?.controlComponent&&!h&&(i[u].controlId=d.controlId,i[u].control=d.control,i[u].controlComponent=d.controlComponent),d=i[u]}Jl(t,e,i)}}newSpliceElementList(t,e,n,i,l){const{isIgnoreDeletedRule:r=!1}=l||{},{group:a,modeRule:c}=this.options;if(n>0){const u=e+n,R=t[u]?.listId;if(R&&t[e-1]?.listId!==R){let T=u;for(;T<t.length;){const g=t[T];if(g.listId!==R||g.value===_)break;delete g.listId,delete g.listType,delete g.listStyle,T++}}if(!r&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const T=this.getTd()?.deletable;let g=u-1;for(;g>=e;){const f=t[g];(ae(f)||T!==!1&&f?.control?.deletable!==!1&&(!f.controlId||this.mode!==s.EditorMode.FORM||!c[this.mode].controlDeletableDisabled)&&f?.title?.deletable!==!1&&(a.deletable!==!1||!f.groupIds?.length)&&(f?.area?.deletable!==!1||f?.areaIndex!==0))&&t.splice(g,1),g--}}else t.splice(e,n)}const d=t[e]?.controlId;if(i?.length){for(let u=0;u<i.length;u++)d&&i[u].controlId!==d&&(i[u].originControlId=d);Jl(t,e,i)}}getCanvasEvent(){return this.canvasEvent}getGlobalEvent(){return this.globalEvent}getListener(){return this.listener}getEventBus(){return this.eventBus}getOverride(){return this.override}getCursor(){return this.cursor}getPreviewer(){return this.previewer}getImageParticle(){return this.imageParticle}getTableTool(){return this.tableTool}getTableOperate(){return this.tableOperate}getTableParticle(){return this.tableParticle}getHeader(){return this.header}getFooter(){return this.footer}getHyperlinkParticle(){return this.hyperlinkParticle}getMacroParticle(){return this.macroParticle}getDateParticle(){return this.dateParticle}getListParticle(){return this.listParticle}getCheckboxParticle(){return this.checkboxParticle}getRadioParticle(){return this.radioParticle}getMenstrualHistoryParticle(){return this.menstrualHistoryParticle}getFetalHeartPositionParticle(){return this.fetalHeartPositionParticle}getToothPositionParticle(){return this.toothPositionParticle}getControl(){return this.control}getWorkerManager(){return this.workerManager}getImageObserver(){return this.imageObserver}getI18n(){return this.i18n}getGraffiti(){return this.graffiti}setCommand(t){this.command=t}getCommand(){return this.command}getRowCount(){return this.getRowList().length}async getDataURL(t={}){const{pixelRatio:e,mode:n}=t;e&&this.setPagePixelRatio(e);const i=this.mode,l=!!n&&i!==n;l&&this.setMode(n),this.render({isLazy:!1,isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),await this.imageObserver.allSettled();const r=this.pageList.map(a=>a.toDataURL());return e&&this.setPagePixelRatio(null),l&&this.setMode(i),r}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===s.PageMode.PAGING}setPageMode(t){if(!t||this.options.pageMode===t)return;if(this.options.pageMode=t,t===s.PageMode.PAGING){const{height:i}=this.options,l=this.getPagePixelRatio(),r=this.pageList[0];r.style.height=`${i}px`,r.height=i*l,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(s.EditorZone.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((r,a)=>{r.width=n*e,r.height=i*e,r.style.width=`${n}px`,r.style.height=`${i}px`,r.style.marginBottom=`${this.getPageGap()}px`,this._initPageContext(this.ctxList[a])});const l=this.position.getCursorPosition();this.render({isSubmitHistory:!1,isSetCursor:!!l,curIndex:l?.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,l)=>{i.width=e*t,i.height=n*t,this._initPageContext(this.ctxList[l])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperSize(t,e){this.options.width=t,this.options.height=e;const n=this.getPagePixelRatio(),i=this.getWidth(),l=this.getHeight();this.container.style.width=`${i}px`,this.pageList.forEach((r,a)=>{r.width=i*n,r.height=l*n,r.style.width=`${i}px`,r.style.height=`${l}px`,this._initPageContext(this.ctxList[a])}),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((l,r)=>{l.width=n*e,l.height=i*e,l.style.width=`${n}px`,l.style.height=`${i}px`,this._initPageContext(this.ctxList[r])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperMargin(t){this.options.margins=t,this.render({isSubmitHistory:!1,isSetCursor:!1})}getOriginValue(t={}){const{pageNo:e}=t,n=this.readonlyModeData;let i=n?.main||this.elementList;return Number.isInteger(e)&&e>=0&&e<this.pageRowList.length&&(i=this.pageRowList[e].flatMap(r=>r.elementList)),{header:n?.header||this.getHeaderElementList(),main:i,footer:n?.footer||this.getFooterElementList(),graffiti:this.graffiti.getValue()}}removeSubTemplateRuntimeElements(t){const e=rt(t),n=r=>{for(let a=r.length-1;a>=0;a--){const c=r[a];if(c.subTemplateParentId){r.splice(a,1);continue}c.valueList?.length&&(c.valueList=i(c.valueList)),c.control?.value?.length&&(c.control.value=i(c.control.value)),c.type===s.ElementType.TABLE&&c.trList?.length&&c.trList.forEach(d=>{d.tdList.forEach(u=>{u.value=i(u.value)})})}return r},i=r=>n(r),l=n(e);return Wl(l),l}getValue(t={}){this.syncSubTemplateRuntimeContent();const e=this.getOriginValue(t),{extraPickAttrs:n}=t,i={header:Ut(this.removeSubTemplateRuntimeElements(e.header),{extraPickAttrs:n,editorOptions:this.options}),main:Ut(this.removeSubTemplateRuntimeElements(e.main),{extraPickAttrs:n,isClassifyArea:!0,editorOptions:this.options}),footer:Ut(this.removeSubTemplateRuntimeElements(e.footer),{extraPickAttrs:n,editorOptions:this.options}),graffiti:e.graffiti};return{version:Cn,data:i,options:rt(this.options)}}setValue(t,e){const{header:n,main:i,footer:l}=rt(t);if(!n&&!i&&!l)return;const{isSetCursor:r=!1}=e||{};[n,i,l].forEach(d=>{d&&ee(d,{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData({header:n,main:i,footer:l}),this.mode===s.EditorMode.READONLY?(this.readonlyModeData=null,this.setReadonlyData()):this.isPrintLikeMode()&&(this.printModeData=null,this.setPrintData()),this.historyManager.recovery();const c=r?i?.length?i.length-1:0:void 0;c!==void 0&&this.range.setRange(c,c),this.render({curIndex:c,isSetCursor:r,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(ve,s.EditorComponent.MAIN)}_createPageContainer(){const t=document.createElement("div");return t.classList.add(`${st}-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 l=this.getPagePixelRatio();i.width=e*l,i.height=n*l,i.style.cursor="text";const r=i.getContext("2d");this._initPageContext(r),this.pageList.push(i),this.ctxList.push(r)}_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,l=t.font||i,r=t.actualSize||t.size||n;return`${t.italic?"italic ":""}${t.bold?"bold ":""}${r*e}px ${l}`}getElementSize(t){return t.actualSize||t.size||this.options.defaultSize}getElementRowMargin(t){const{defaultSize:e,defaultBasicRowMarginHeight:n,defaultRowMargin:i,scale:l}=this.options,r=t.size||e;let a=1;return r<12?a=r/12:r>30&&(a=1+(r-30)/30),n*a*(t.rowMargin??i)*l}computeRowList(t){const{innerWidth:e,elementList:n,isPagingMode:i=!1,isFromTable:l=!1,startX:r=0,startY:a=0,pageHeight:c=0,mainOuterHeight:d=0,surroundElementList:u=[]}=t,{defaultSize:h,scale:R,imgCaption:T,table:{tdPadding:g,defaultTrMinHeight:f},defaultTabWidth:C}=this.options,p=this.getDefaultBasicRowMarginHeight(),m=document.createElement("canvas").getContext("2d"),L=this.listParticle.computeListStyle(m,n),O=[],P=this._collectTextControlValueSet(n),S=this._collectTextControlHasContentSet(n);n.length&&O.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowIndex:0,rowFlex:n?.[0]?.rowFlex||n?.[1]?.rowFlex});let y=r,Y=a,b=0,M,V=0,N=0;for(let X=0;X<n.length;X++){const D=O[O.length-1],E=n[X];this.clearElementEffect(E);const U=this.getElementRowMargin(E),F={width:0,height:0,boundingBoxAscent:0,boundingBoxDescent:0},Z=D.offsetX||E.listId&&L.get(E.listId)||0,Q=e-Z,W=D.elementList.length===1;if(y+=W?Z:0,Y+=W&&D.offsetY||0,(E.control?.type===s.ControlType.TEXTFIELD||E.control?.type===s.ControlType.TEXT)&&!this.isDesignMode()&&(E.controlComponent===s.ControlComponent.PRETEXTFIX||E.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||E.controlComponent===s.ControlComponent.POSTTEXTFIX||E.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT||E.controlComponent===s.ControlComponent.TEXTFIXLABEL||E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.PREFIX||E.controlComponent===s.ControlComponent.POSTFIX)){const nt=E.control?.type===s.ControlType.TEXTFIELD,z=E.controlId,G=!!z&&!!P?.has(z);if(nt){const J=!!z&&!!S?.has(z);this.mode===s.EditorMode.EDIT?E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.TEXTFIXLABEL?E.hide=J:E.hide=!1:E.hide=!0}else{const J=!!z&&!!S?.has(z);this.mode===s.EditorMode.EDIT||this.mode===s.EditorMode.FORM?E.controlComponent===s.ControlComponent.PLACEHOLDER||E.controlComponent===s.ControlComponent.TEXTFIXLABEL?E.hide=J:E.hide=!1:E.hide=!0}}if(ae(E)&&!this.isDesignMode()){const nt=D.elementList[D.elementList.length-1];F.height=nt?.metrics.height||this.options.defaultSize*R,F.boundingBoxAscent=nt?.metrics.boundingBoxAscent||0,F.boundingBoxDescent=nt?.metrics.boundingBoxDescent||0}else if(E.type===s.ElementType.IMAGE||E.type===s.ElementType.LATEX)if(E.imgDisplay===s.ImageDisplay.SURROUND||E.imgDisplay===s.ImageDisplay.FLOAT_TOP||E.imgDisplay===s.ImageDisplay.FLOAT_BOTTOM)F.width=0,F.height=0,F.boundingBoxDescent=0;else{const nt=E.width*R,z=E.height*R;if(nt>Q){const G=z*Q/nt;E.width=Q/R,E.height=G/R,F.width=Q,F.height=G,F.boundingBoxDescent=G}else F.width=nt,F.height=z,F.boundingBoxDescent=z;if(E.imgCaption?.value){const G=E.imgCaption.size||T.size,J=E.imgCaption.top??T.top,it=(G+J)*R;F.boundingBoxAscent+=it}}else if(E.type===s.ElementType.TABLE){const nt=E.tdPadding||g;if(E.pagingId){let q=X+1,ut=0;for(;q<n.length;){const gt=n[q];if(gt.pagingId===E.pagingId){const Ot=gt.trList.filter(Et=>!Et.pagingRepeat).filter(Et=>(Et.tdList=Et.tdList.filter(yt=>{if(yt.originalId){for(let Mt=0;Mt<E.trList.length;Mt++){const Ft=E.trList[Mt],Vt=Ft.tdList.find(({id:Bt})=>Bt===yt.originalId);if(Vt){yt.value[0]?.type===s.ElementType.SPLIT_TAG&&yt.value.splice(0,1),Vt.value.push(...yt.value.map(Bt=>this.updateElementTableInfo(Bt,E,Ft,Vt))),Vt.rowspan=Vt.originalRowspan??Vt.rowspan;break}}return!1}return!0}),!Et.originalId));E.trList.push(...Ot),E.height+=gt.height,q++,ut++}else break}ut&&n.splice(X+1,ut)}E.pagingIndex=E.pagingIndex??0,this.tableParticle.computeTrHeight(E,q=>this.computeRowList({innerWidth:(q.width-(nt[1]+nt[3]))*R,elementList:q.value,isFromTable:!0,isPagingMode:i})),E.trList?.forEach(q=>{q.tdList.forEach(ut=>{this.tdMap.set(ut.id,ut)})});const z=this.tableParticle.getTableHeight(E),G=this.tableParticle.getTableWidth(E);E.width=G,E.height=z;const J=G*R,it=z*R;if(F.width=J,F.height=it,F.boundingBoxDescent=it,F.boundingBoxAscent=-U,n[X+1]?.type===s.ElementType.TABLE&&(F.boundingBoxAscent-=U),i){const q=this.getHeight(),ut=this.getMainOuterHeight();let gt=ut;for(let Mt=0;Mt<O.length;Mt++){const Ft=O[Mt],Vt=Ft.offsetY||0;Ft.height+gt+Vt>q||O[Mt-1]?.isPageBreak?gt=ut+Ft.height+Vt:gt+=Ft.height+Vt}const Ot=U*2,Et=E.trList[0].height*R;(gt+Et+Ot>q||E.pagingIndex!==0&&E.trList[0].pagingRepeat||n[X-1]?.type===s.ElementType.PAGE_BREAK)&&(gt=ut);let yt=q-(gt+Ot);if(it>yt){const Mt=E.trList;let Ft=0,Vt=0,Bt=0;for(let pt=0;pt<Mt.length;pt++){const ht=Mt[pt],Lt=ht.height*R;if(gt+Ot+Bt+Lt>q){const Ct=ht;let St=0;const Kt={...rt(Ct),id:ft(),originalId:Ct.originalId??Ct.id,minHeight:void 0,tdList:E.colgroup.map((at,Pt)=>{if(St--,St>0)return;const et=Ct.tdList.find(qt=>qt.colIndex===Pt),$=et??this.tableParticle.findPreRowSpanTd(Mt,pt,Pt);et&&(St=et.colspan);const ne=ft();return $.originalRowspan=$.rowspan,et?{...et,id:ne,originalId:et.originalId??et.id,linkTdPrevId:et.id,tdIndex:Pt,original:$}:{id:ne,originalId:$.originalId??$.id,linkTdPrevId:$.id,tdIndex:Pt,colIndex:Pt,colspan:1,rowspan:1,value:[],rowList:[],original:$}}).filter(at=>!!at)},ge=Kt.tdList,Tt=ge.map(at=>at.original);Tt.forEach((at,Pt)=>{const et=[];let $=yt;if(at.rowspan>1){const qt=Mt.slice(at.trIndex,at.trIndex+pt-at.trIndex);$+=qt.reduce((Ie,_t)=>_t.height*R+Ie,0)}for(;at.mainHeight*R>$&&at.rowList?.length;){const qt=at.rowList.pop();at.value.splice(at.value.length-qt.elementList.length),et.unshift(qt),at.mainHeight-=qt.height}const ne=ge[Pt];ne.rowList=et,ne.value=et.map(qt=>qt.elementList).flat()});let tt=!0;const Dt=Ct.tdList.some(at=>at.rowList?.length),vt=Kt.tdList.some(at=>at.rowList?.length),jt=Ct.minHeight>yt;if(vt||jt){(Dt||!vt&&jt)&&(jt&&(Ct.originalMinHeight=Ct.minHeight,Ct.minHeight=yt,Kt.minHeight=Math.max(Ct.originalMinHeight-yt,f)),Kt.tdList.forEach(at=>{at.original.linkTdNextId=at.id,at.value.length&&at.value[0].value!==_&&at.value.unshift({...at.original.value.slice(-1).pop(),value:_,type:s.ElementType.SPLIT_TAG})}),Mt.splice(Ft+1,0,Kt),Ft+=1,Vt=Mt.length-Ft,tt=!1),Tt.forEach(at=>{if(at.rowspan>1){const Pt=at.rowspan-(pt-at.trIndex);at.rowspan=pt-at.trIndex+(Dt?1:0);const et=Kt.tdList.find($=>$.colIndex===at.colIndex);Dt?et.rowspan=Pt:(et.original.linkTdNextId=et.id,Ct.tdList.push({...at,...et,rowspan:Pt}),Ct.tdList.sort(($,ne)=>$.colIndex-ne.colIndex),et.value=[])}}),tt&&Tt.forEach((at,Pt)=>{at.value.push(...ge[Pt].value)});break}}Ft=pt+1,Vt=Mt.length-Ft,Bt+=Lt,yt-=Lt}if(Vt){const pt=Mt.splice(Ft,Vt),ht=E.pagingId||ft();E.pagingId=ht;const Lt=rt(E);Lt.originalId=E.originalId??E.id,Lt.pagingId=ht,Lt.pagingIndex=E.pagingIndex+1;const Ct=Mt.filter(ge=>ge.pagingRepeat);if(Ct.length){const ge=rt(Ct);ge.forEach(Tt=>Tt.id=ft()),pt.unshift(...ge)}Lt.trList=pt,Lt.id=ft(),Lt.trList?.forEach(ge=>{ge.tdList.forEach(Tt=>{if(delete Tt.valueStartIndex,Tt.linkTdPrevId){const tt=this.getTdById(Tt.linkTdPrevId);Tt.valueStartIndex=tt?(tt.valueStartIndex??0)+tt.value.length:0,this.splitTdValueMap.has(Tt.originalId)?this.splitTdValueMap.get(Tt.originalId).push(...Tt.value):tt&&this.splitTdValueMap.set(Tt.originalId,[...tt.value,...Tt.value])}Tt.value.forEach(tt=>this.updateElementTableInfo(tt,Lt,ge,Tt))})}),this.spliceElementList(n,X+1,0,[Lt]),this.tableParticle.computeTrHeight(E);const St=this.tableParticle.getTableHeight(E),Kt=St*R;E.height=St,F.height=Kt,F.boundingBoxDescent=Kt}}if(E.pagingId){const Mt=this.position.getPositionContext();if(Mt.isTable){let Ft=-1,Vt=-1,Bt=X;for(;Bt<n.length;){const pt=n[Bt];if(pt.pagingId!==E.pagingId)break;const ht=pt.trList.findIndex(Lt=>Lt.id===Mt.trId);if(~ht){Ft=Bt,Vt=ht;break}Bt++}~Ft&&(Mt.index=Ft,Mt.trIndex=Vt,this.position.setPositionContext(Mt))}}}this.initTableElementIndex(E,X)}else if(E.type===s.ElementType.SEPARATOR){const{separator:{lineWidth:nt}}=this.options,z=E.lineWidth||nt;E.width=Q/R,F.width=Q,F.height=z*R,F.boundingBoxAscent=-U,F.boundingBoxDescent=-U+F.height}else if(E.type===s.ElementType.PAGE_BREAK)E.width=Q/R,F.width=Q,F.height=h;else if(E.type===s.ElementType.RADIO||E.controlComponent===s.ControlComponent.RADIO){const{width:nt,height:z,gap:G}=this.options.radio,J=nt+G*(E.controlComponent?1:2);E.width=J,F.width=J*R,F.height=z*R}else if(E.type===s.ElementType.CHECKBOX||E.controlComponent===s.ControlComponent.CHECKBOX){const{width:nt,height:z,gap:G}=this.options.checkbox,J=nt+G*(E.controlComponent?1:2);E.width=J,F.width=J*R,F.height=z*R}else if(E.type===s.ElementType.MENSTRUAL_HISTORY){const nt=this.menstrualHistoryParticle.computeSize(E);E.width=nt.width/R,F.width=nt.width,F.height=nt.height,F.boundingBoxAscent=nt.height,F.boundingBoxDescent=0}else if(E.type===s.ElementType.FETAL_HEART_POSITION){const nt=this.fetalHeartPositionParticle.computeSize();E.width=nt.width/R,F.width=nt.width,F.height=nt.height,F.boundingBoxAscent=nt.height/2,F.boundingBoxDescent=nt.height/2}else if(E.type===s.ElementType.TOOTH_POSITION){const nt=this.toothPositionParticle.computeSize(E);E.width=nt.width/R,F.width=nt.width,F.height=nt.height,F.boundingBoxAscent=nt.height/2,F.boundingBoxDescent=nt.height/2}else if(E.type===s.ElementType.TAB)F.width=C*R,F.height=h*R,F.boundingBoxDescent=0,F.boundingBoxAscent=this.textParticle.getBasisWordBoundingBoxAscent(m,m.font);else if(E.type===s.ElementType.BLOCK){if(!E.width)F.width=Q;else{const nt=E.width*R;F.width=Math.min(nt,Q)}F.height=E.height*R,F.boundingBoxDescent=F.height,F.boundingBoxAscent=0}else if(E.type===s.ElementType.LABEL){const{defaultSize:nt,label:{defaultPadding:z}}=this.options;m.font=this.getElementFont(E);const G=this.textParticle.measureText(m,E);F.width=(G.width+z[1]+z[3])*R,F.height=(E.size||nt)*R,F.boundingBoxDescent=0,F.boundingBoxAscent=(z[0]+G.actualBoundingBoxAscent)*R}else if(E.type===s.ElementType.MACRO||E.type===s.ElementType.CUSTOM_MACRO||E.type===s.ElementType.REUSABLE_ITEM||E.type===s.ElementType.SUB_TEMPLATE){const{defaultSize:nt}=this.options;m.font=this.getElementFont(E);const z=this.getMode(),G=z===s.EditorMode.EDIT,J=z===s.EditorMode.FORM;if(z===s.EditorMode.READONLY&&E.type!==s.ElementType.SUB_TEMPLATE){const q=Wo(E).split(bn),ut=q.reduce((Et,yt)=>Math.max(Et,m.measureText(yt).width),0),gt=(E.size||nt)*R,Ot=m.measureText(q[0]);F.width=ut,F.height=gt*q.length,F.boundingBoxDescent=Ot.actualBoundingBoxDescent+gt*(q.length-1),F.boundingBoxAscent=Ot.actualBoundingBoxAscent}else if(G){const it=E.label||E.value||"";m.font=this.getElementFont(E);const q=m.measureText(it),ut=8*R,gt=4*R;F.width=q.width+ut*2;const Ot=q.actualBoundingBoxAscent+q.actualBoundingBoxDescent;F.height=Ot+gt*2;const Et=this.textParticle.measureBasisWord(m,this.getElementFont(E));F.boundingBoxAscent=Et.actualBoundingBoxAscent*R,F.boundingBoxDescent=Et.actualBoundingBoxDescent*R}else if(E.type===s.ElementType.CUSTOM_MACRO){const it=E.macroConfig,q=it?.value||"";if(J){const ut=it?.type||"text",gt=this.textParticle.measureText(m,E),Ot=E.label||"";if(ut==="select"){const Et=q||`请选择${Ot}`,yt=m.measureText(Et),Mt=m.measureText("[").width,Ft=6*R+2*R;F.width=Mt+yt.width+Ft+Mt}else{const yt=(q||`请输入${Ot}`).split(bn),Mt=yt.reduce((Bt,pt)=>Math.max(Bt,m.measureText(pt).width),0),Ft=m.measureText("[").width,Vt=(E.size||nt)*R;F.width=Ft+Mt+Ft,F.height=Vt*yt.length,F.boundingBoxAscent=gt.actualBoundingBoxAscent*R,F.boundingBoxDescent=gt.actualBoundingBoxDescent*R+Vt*(yt.length-1)}ut==="select"&&(F.height=(E.size||nt)*R,F.boundingBoxDescent=gt.actualBoundingBoxDescent*R,F.boundingBoxAscent=gt.actualBoundingBoxAscent*R)}else{const ut=E.label||"",Ot=(q||`请输入${ut}`).split(bn),Et=Ot.reduce((Ft,Vt)=>Math.max(Ft,m.measureText(Vt).width),0),yt=(E.size||nt)*R,Mt=m.measureText(Ot[0]);F.width=Et,F.height=yt*Ot.length,F.boundingBoxDescent=Mt.actualBoundingBoxDescent+yt*(Ot.length-1),F.boundingBoxAscent=Mt.actualBoundingBoxAscent}}else if(E.type===s.ElementType.REUSABLE_ITEM){const q=E.reusableItemConfig?.value||"",ut=E.label||"";if(J){const gt=this.textParticle.measureText(m,E),Et=(q||`请输入${ut}`).split(bn),yt=Et.reduce((Vt,Bt)=>Math.max(Vt,m.measureText(Bt).width),0),Mt=m.measureText("[").width,Ft=(E.size||nt)*R;F.width=Mt+yt+Mt,F.height=Ft*Et.length,F.boundingBoxDescent=gt.actualBoundingBoxDescent*R+Ft*(Et.length-1),F.boundingBoxAscent=gt.actualBoundingBoxAscent*R}else{const Ot=(q||`获取 ${ut}`).split(bn),Et=Ot.reduce((Ft,Vt)=>Math.max(Ft,m.measureText(Vt).width),0),yt=(E.size||nt)*R,Mt=m.measureText(Ot[0]);F.width=Et,F.height=yt*Ot.length,F.boundingBoxDescent=Mt.actualBoundingBoxDescent+yt*(Ot.length-1),F.boundingBoxAscent=Mt.actualBoundingBoxAscent}}else if(E.type===s.ElementType.SUB_TEMPLATE){const it=E.label||"子模板";if(J){const q=m.measureText(it),ut=8*R,gt=4*R,Ot=q.actualBoundingBoxAscent+q.actualBoundingBoxDescent;F.width=q.width+ut*2,F.height=Ot+gt*2;const Et=this.textParticle.measureBasisWord(m,this.getElementFont(E));F.boundingBoxAscent=Et.actualBoundingBoxAscent*R,F.boundingBoxDescent=Et.actualBoundingBoxDescent*R}else{const q=m.measureText(it);F.width=q.width,F.height=(E.size||nt)*R,F.boundingBoxDescent=q.actualBoundingBoxDescent,F.boundingBoxAscent=q.actualBoundingBoxAscent}}else{const it=E.label||"",q=E.value||`获取 ${it}`,ut=m.measureText(q);F.width=ut.width,F.height=(E.size||nt)*R,F.boundingBoxDescent=ut.actualBoundingBoxDescent,F.boundingBoxAscent=ut.actualBoundingBoxAscent}}else{const nt=E.size||h;(E.type===s.ElementType.SUPERSCRIPT||E.type===s.ElementType.SUBSCRIPT)&&(E.actualSize=Math.ceil(nt*.6)),F.height=(E.actualSize||nt)*R,m.font=this.getElementFont(E);const z=this.textParticle.measureText(m,E),G=E.buttonValueLayoutPrefixOffset?m.measureText("[").width:0;F.width=Math.max(0,z.width-G)*R,E.letterSpacing&&(F.width+=E.letterSpacing*R);const J=this.textParticle.measureBasisWord(m,E.font);F.boundingBoxAscent=J.actualBoundingBoxAscent*R,F.boundingBoxDescent=J.actualBoundingBoxDescent*R,E.type===s.ElementType.SUPERSCRIPT?F.boundingBoxAscent+=F.height/2:E.type===s.ElementType.SUBSCRIPT&&(F.boundingBoxDescent+=F.height/2)}const K=!ae(E)&&(E.imgDisplay!==s.ImageDisplay.INLINE&&E.type===s.ElementType.IMAGE||E.type===s.ElementType.LATEX)?F.height+U:F.boundingBoxAscent+U,k=U+F.boundingBoxAscent+F.boundingBoxDescent+U,B=Object.assign(E,{metrics:F,left:0,style:this.getElementFont(E,R)});this.getIsButtonRowStartPrefix(n,X,D)&&(B.left=-F.width);const H=this.getElementLayoutWidth(B);B.control?.minWidth&&(B.controlComponent&&(N+=F.width),B.controlComponent===s.ControlComponent.POSTFIX&&(this.control.setMinWidthControlInfo({row:D,rowElement:B,availableWidth:Q,controlRealWidth:N}),N=0));const A=n[X-1];let v=n[X+1],ct=D.width+H;if(this.options.wordBreak===s.WordBreak.BREAK_WORD&&(!A?.type||A?.type===s.ElementType.TEXT)&&(!E.type||E.type===s.ElementType.TEXT)){const nt=`${A?.value||""}${E.value}`;if(this.WORD_LIKE_REG.test(nt)){const{width:G,endElement:J}=this.textParticle.measureWord(m,n,X),it=G*R;J&&it<=Q?(ct+=it,v=J):A&&(ct+=it)}const z=this.textParticle.measurePunctuationWidth(m,v);ct+=z*R}E.listId&&(E.listId!==M?V=0:E.value===_&&!E.listWrap&&V++),M=E.listId;const bt=this.position.setSurroundPosition({pageNo:b,rowElement:B,row:D,rowElementRect:{x:y,y:Y,height:k,width:H},availableWidth:Q,surroundElementList:u});y=bt.x,ct+=bt.rowIncreaseWidth,y+=H;let Qt=!1;if(this.mode===s.EditorMode.FORM&&E.control?.type===s.ControlType.BUTTON&&E.controlComponent===s.ControlComponent.PREFIX&&D.elementList.filter(nt=>nt.controlId!==E.controlId).length>0){const nt=E.controlId;if(n.some(G=>G.controlId===`${nt}_text`&&G.control?.type===s.ControlType.BUTTON)){let G=0;for(let J=X;J<n.length;J++){const it=n[J];if(it.controlId!==nt)break;m.font=this.getElementFont(it);const q=this.textParticle.measureText(m,it);if(G+=q.width*R,it.controlComponent===s.ControlComponent.POSTFIX)break}for(let J=0;J<n.length;J++){const it=n[J];if(it.controlId===`${nt}_text`){m.font=this.getElementFont(it);const q=this.textParticle.measureText(m,it);G+=q.width*R}}Qt=D.width+G>Q}}const me=E.type===s.ElementType.SEPARATOR||E.type===s.ElementType.TABLE||A?.type===s.ElementType.TABLE||A?.type===s.ElementType.CUSTOM_MACRO&&bn.test(A.macroConfig?.value||"")||A?.type===s.ElementType.REUSABLE_ITEM&&bn.test(A.reusableItemConfig?.value||"")||A?.type===s.ElementType.BLOCK||E.type===s.ElementType.BLOCK||A?.imgDisplay===s.ImageDisplay.INLINE||E.imgDisplay===s.ImageDisplay.INLINE||A?.listId!==E.listId||A?.areaId!==E.areaId&&!E.area?.hide||E.control?.flexDirection===s.FlexDirection.COLUMN&&(E.controlComponent===s.ControlComponent.CHECKBOX||E.controlComponent===s.ControlComponent.RADIO)&&A?.controlComponent===s.ControlComponent.VALUE||X!==0&&E.value===_&&!E.area?.hide||Qt,Gt=ct>Q,Re=me||Gt;if(Re){const nt={width:H,height:k,startIndex:X,elementList:[B],ascent:K,rowIndex:D.rowIndex+1,rowFlex:n[X]?.rowFlex||n[X+1]?.rowFlex,isPageBreak:E.type===s.ElementType.PAGE_BREAK};if(B.controlComponent!==s.ControlComponent.PREFIX&&B.control?.indentation===s.ControlIndentation.VALUE_START){const z=D.elementList.findIndex(G=>G.controlId===B.controlId&&G.controlComponent!==s.ControlComponent.PREFIX);if(~z){const J=this.position.computeRowPosition({row:D,innerWidth:this.getInnerWidth()})[z];J&&(nt.offsetX=J.coordinate.leftTop[0])}}E.listId&&(nt.isList=!0,nt.offsetX=L.get(E.listId),nt.listIndex=V),nt.offsetY=!l&&E.area?.top&&E.areaId!==n[X-1]?.areaId?E.area.top*R:0,O.push(nt)}else D.width+=H,X===0&&(_n(n[1])||n[1]?.areaId)?(D.height=p,D.ascent=p):D.height<k&&(D.height=k,D.ascent=K),D.elementList.push(B);if((Re||X===n.length-1)&&(D.isWidthNotEnough=Gt&&!me,!D.isSurround&&(A?.rowFlex===s.RowFlex.JUSTIFY||A?.rowFlex===s.RowFlex.ALIGNMENT&&D.isWidthNotEnough))){const nt=D.elementList[0]?.value===_?D.elementList.slice(1):D.elementList,z=(Q-D.width)/(nt.length-1);for(let G=0;G<nt.length-1;G++){const J=nt[G];J.metrics.width+=z}D.width=Q}if(Re){y=r,Y+=D.height,i&&!l&&c&&(Y-a+d+k>c||E.type===s.ElementType.PAGE_BREAK)&&(Y=a,Vc(u,b),b+=1),B.left=0;const nt=O[O.length-1];y=this.position.setSurroundPosition({pageNo:b,rowElement:B,row:nt,rowElementRect:{x:y,y:Y,height:k,width:H},availableWidth:Q,surroundElementList:u}).x,y+=H}}return O}_collectTextControlValueSet(t){if(this.isDesignMode()||this.mode===s.EditorMode.EDIT)return null;const e=new Set;for(let i=0;i<t.length;i++){const l=t[i];l.controlId&&(l.control?.type===s.ControlType.TEXT||l.control?.type===s.ControlType.TEXTFIELD)&&e.add(l.controlId)}const n=new Set;for(let i=0;i<t.length;i++){const l=t[i];l.controlId&&l.controlComponent===s.ControlComponent.VALUE&&e.has(l.controlId)&&n.add(l.controlId)}return n}_collectTextControlHasContentSet(t){if(this.isDesignMode())return null;const e=new Set;let n=0;for(;n<t.length;){const i=t[n];if(i.controlId&&(i.control?.type===s.ControlType.TEXT||i.control?.type===s.ControlType.TEXTFIELD)&&(i.controlComponent===s.ControlComponent.PREFIX||i.controlComponent===s.ControlComponent.PRE_TEXT||i.controlComponent===s.ControlComponent.PRETEXTFIX||i.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)){const l=i.controlId;let r=!1,a=n+1;for(;a<t.length;){const c=t[a];if(c.controlId===l&&(c.controlComponent===s.ControlComponent.POSTFIX||c.controlComponent===s.ControlComponent.POST_TEXT||c.controlComponent===s.ControlComponent.POSTTEXTFIX||c.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT))break;if(c.controlId===l&&c.controlComponent===s.ControlComponent.VALUE&&(r=!0),c.controlId!==l&&c.controlId){(i.control?.type===s.ControlType.TEXT||c.controlComponent===s.ControlComponent.VALUE)&&(r=!0);const d=c.controlId;for(a++;a<t.length&&t[a].controlId===d;)a++;continue}a++}r&&e.add(l)}n++}return e}_computePageList(){const t=[[]],{pageMode:e,pageNumber:{maxPageNo:n}}=this.options,i=this.getHeight(),l=this.getMainOuterHeight();let r=l,a=0;if(e===s.PageMode.CONTINUITY){t[0]=this.rowList,r+=this.rowList.reduce((h,R)=>h+R.height+(R.offsetY||0),0);const c=this.getPagePixelRatio(),d=this.pageList[0],u=Number(d.style.height.replace("px",""));if(r>u)d.style.height=`${r}px`,d.height=r*c;else{const h=r<i?i:r;d.style.height=`${h}px`,d.height=h*c}this._initPageContext(this.ctxList[0])}else for(let c=0;c<this.rowList.length;c++){const d=this.rowList[c],u=d.offsetY||0;if(d.height+u+r>i||this.rowList[c-1]?.isPageBreak){if(Number.isInteger(n)&&a>=n){this.elementList=this.elementList.slice(0,d.startIndex);break}r=l+d.height+u,t.push([d]),a++}else r+=d.height+u,t[a].push(d)}return t}_drawHighlight(t,e){const{rowList:n,positionList:i,elementList:l}=e,r=this.getDefaultBasicRowMarginHeight(),a=this.getHighlightMarginHeight();for(let c=0;c<n.length;c++){const d=n[c];let u="";for(let h=0;h<d.elementList.length;h++){const R=d.elementList[h],T=d.startIndex+h,g=l[T]===R?T:l.indexOf(R),f=~g?g:T,C=this.control.getControlHighlight(l,f),p=R.highlight||C;if(p){u&&u!==p&&this.highlight.render(t);const I=i[f],{coordinate:{leftTop:[m,L]}}=I,O=R.left||0,P=!R.highlight&&!!C&&this.control.getIsInlineControlBackground(l,f),S=P?L+I.ascent-R.metrics.boundingBoxAscent-a:L+r-a,y=P?R.metrics.boundingBoxAscent+R.metrics.boundingBoxDescent+2*a:d.height-2*r+2*a;this.highlight.recordFillInfo(t,m-O,S,R.metrics.width+O,y,p)}else u&&this.highlight.render(t);u=p}this.highlight.render(t)}}validateNumber(t){return/^\d+$/.test(t)}drawRow(t,e){this._drawHighlight(t,e);const{scale:n,table:{tdPadding:i},group:l,lineBreak:r,whiteSpace:a}=this.options,{rowList:c,pageNo:d,elementList:u,positionList:h,startIndex:R,zone:T,isDrawLineBreak:g=!r.disabled,td:f,isDrawWhiteSpace:C=!a.disabled}=e,p=this.isPrintLikeMode(),I=this.isSelectionDisabled(),{isCrossRowCol:m,tableId:L}=this.range.getRange();let O=R;for(let P=0;P<c.length;P++){const S=c[P],y={x:0,y:0,width:0,height:0};let Y=null;for(let b=0;b<S.elementList.length;b++){const M=S.elementList[b],V=M.metrics,{ascent:N,coordinate:{leftTop:[X,D]}}=h[S.startIndex+b],E=S.elementList[b-1];if(ae(M)&&!this.isDesignMode())this.textParticle.complete();else if(M.type===s.ElementType.IMAGE)this.textParticle.complete(),M.imgDisplay!==s.ImageDisplay.SURROUND&&M.imgDisplay!==s.ImageDisplay.FLOAT_TOP&&M.imgDisplay!==s.ImageDisplay.FLOAT_BOTTOM&&this.imageParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.LATEX)this.textParticle.complete(),this.laTexParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.TABLE)m&&(y.x=X,y.y=D,Y=M),this.tableParticle.render(t,M,X,D);else if(M.type===s.ElementType.HYPERLINK)this.textParticle.complete(),this.hyperlinkParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.LABEL)this.textParticle.complete(),this.labelParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.MACRO||M.type===s.ElementType.CUSTOM_MACRO||M.type===s.ElementType.REUSABLE_ITEM||M.type===s.ElementType.SUB_TEMPLATE)this.textParticle.complete(),this.macroParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.DATE){const K=S.elementList[b+1];(!E||E.dateId!==M.dateId)&&this.textParticle.complete(),this.textParticle.record(t,M,X,D+N),(!K||K.dateId!==M.dateId)&&this.textParticle.complete()}else if(M.type===s.ElementType.SUPERSCRIPT)this.textParticle.complete(),this.superscriptParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.SUBSCRIPT)this.underline.render(t),this.textParticle.complete(),this.subscriptParticle.render(t,M,X,D+N);else if(M.type===s.ElementType.SEPARATOR)this.separatorParticle.render(t,M,X,D);else if(M.type===s.ElementType.PAGE_BREAK)this.mode!==s.EditorMode.CLEAN&&!p&&this.pageBreakParticle.render(t,M,X,D);else if(M.type===s.ElementType.CHECKBOX||M.controlComponent===s.ControlComponent.CHECKBOX)this.textParticle.complete(),this.checkboxParticle.render({ctx:t,x:X,y:D+N,index:b,row:S});else if(M.type===s.ElementType.RADIO||M.controlComponent===s.ControlComponent.RADIO)this.textParticle.complete(),this.radioParticle.render({ctx:t,x:X,y:D+N,index:b,row:S});else if(M.type===s.ElementType.MENSTRUAL_HISTORY)this.textParticle.complete(),this.menstrualHistoryParticle.render({ctx:t,x:X,y:D+N,index:b,row:S,element:M});else if(M.type===s.ElementType.FETAL_HEART_POSITION)this.textParticle.complete(),this.fetalHeartPositionParticle.render({ctx:t,x:X,y:D+N,index:b,row:S,element:M});else if(M.type===s.ElementType.TOOTH_POSITION)this.textParticle.complete(),this.toothPositionParticle.render({ctx:t,x:X,y:D+N,index:b,row:S,element:M});else if(M.type===s.ElementType.TAB)this.textParticle.complete();else if(M.rowFlex===s.RowFlex.ALIGNMENT||M.rowFlex===s.RowFlex.JUSTIFY)this.textParticle.record(t,M,X,D+N),this.textParticle.complete();else if(M.type===s.ElementType.BLOCK)this.textParticle.complete(),this.blockParticle.render(t,d,M,X,D+N);else{const K=M.buttonValueLayoutPrefixOffset===!0;(M.left||K)&&this.textParticle.complete(),this.textParticle.record(t,M,X,D+N),(K||M.width||M.letterSpacing||Ta.test(M.value))&&this.textParticle.complete()}if(g&&!p&&this.mode!==s.EditorMode.CLEAN&&!S.isWidthNotEnough&&b===S.elementList.length-1&&this.lineBreakParticle.render(t,M,X,D+S.height/2),C&&fa.test(M.value)&&this.whiteSpaceParticle.render(t,M,X,D+S.height/2),M.control?.border){E?.control?.border&&E.controlId!==M.controlId&&this.control.drawBorder(t);const K=this.getElementRowMargin(M);this.control.recordBorderInfo(X,D+K,M.metrics.width,S.height-2*K)}else E?.control?.border&&this.control.drawBorder(t);if(M.control?.type===s.ControlType.TEXT){const K=M.controlComponent===s.ControlComponent.VALUE,k=M.controlComponent===s.ControlComponent.POSTFIX||M.controlComponent===s.ControlComponent.POST_TEXT,B=!!E&&E.originControlId===M.controlId&&(E.controlComponent===s.ControlComponent.POSTFIX||E.controlComponent===s.ControlComponent.POST_TEXT||E.controlComponent===s.ControlComponent.POSTTEXTFIX||E.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT);M.originControlId&&(M.controlComponent===s.ControlComponent.PREFIX||M.controlComponent===s.ControlComponent.PRE_TEXT||M.controlComponent===s.ControlComponent.PRETEXTFIX||M.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT)&&this.control.drawTextFieldUnderline(t),K&&M.control?.underline&&!M.underline&&((!E||E.controlId!==M.controlId||B||E.controlComponent!==s.ControlComponent.VALUE&&E.controlComponent!==s.ControlComponent.PLACEHOLDER)&&this.control.startTextFieldUnderline(M.controlId,X,D+S.height),this.control.recordTextFieldUnderlineWidth(M.metrics.width)),k&&this.control.drawTextFieldUnderline(t),M.originControlId&&(M.controlComponent===s.ControlComponent.POSTFIX||M.controlComponent===s.ControlComponent.POST_TEXT||M.controlComponent===s.ControlComponent.POSTTEXTFIX||M.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)&&this.control.drawTextFieldUnderline(t)}else E?.control?.type===s.ControlType.TEXT&&this.control.drawTextFieldUnderline(t);if(M.type!==s.ElementType.REUSABLE_ITEM&&(M.underline||M.control?.underline)&&M.controlComponent!==s.ControlComponent.PLACEHOLDER&&!(M.control?.type===s.ControlType.TEXT&&M.control?.underline&&!M.underline)){E?.type===s.ElementType.SUBSCRIPT&&M.type!==s.ElementType.SUBSCRIPT&&this.underline.render(t);const K=this.getElementRowMargin(M),k=M.left||0;let B=0;M.type===s.ElementType.SUBSCRIPT&&(B=this.subscriptParticle.getOffsetY(M));const H=M.control?.underline?this.options.underlineColor:M.color;this.underline.recordFillInfo(t,X-k,D+S.height-K+B,V.width+k,0,H,M.textDecoration?.style)}else(E?.underline||E?.control?.underline)&&(E?.control?.type===s.ControlType.TEXT&&E?.control?.underline&&!E.underline||this.underline.render(t));if(M.type!==s.ElementType.REUSABLE_ITEM&&M.strikeout){if(!M.type||Le.includes(M.type)){E&&(E.type===s.ElementType.SUBSCRIPT&&M.type!==s.ElementType.SUBSCRIPT||E.type===s.ElementType.SUPERSCRIPT&&M.type!==s.ElementType.SUPERSCRIPT||this.getElementSize(E)!==this.getElementSize(M))&&this.strikeout.render(t);const K=this.textParticle.measureBasisWord(t,this.getElementFont(M));let k=D+N+K.actualBoundingBoxDescent*n-V.height/2;M.type===s.ElementType.SUBSCRIPT?k+=this.subscriptParticle.getOffsetY(M):M.type===s.ElementType.SUPERSCRIPT&&(k+=this.superscriptParticle.getOffsetY(M)),this.strikeout.recordFillInfo(t,X,k,V.width)}}else E?.strikeout&&this.strikeout.render(t);const{zone:U,splitTdRange:F}=this.range.getRange();let{startIndex:Z,endIndex:Q}=this.range.getRange(),W=!1;if(f&&F&&[f.originalId,f.id].includes(F.originalId)&&(W=!0,Z=F.startIndex-(f.valueStartIndex??0),Q=F.endIndex-(f.valueStartIndex??0)),U===T&&Z!==Q&&Z<=O&&O<=Q){const K=this.position.getPositionContext();if(!K.isTable&&!M.tdId||K.tdId===M.tdId||W)if(Z===O){const k=u[Z+1];k&&k.value===_&&(y.x=X+V.width,y.y=D,y.height=S.height,y.width+=this.options.rangeMinWidth)}else{let k=V.width;k===0&&S.elementList.length===1&&(k=this.options.rangeMinWidth),y.width||(y.x=X,y.y=D,y.height=S.height),y.width+=k}}if(!l.disabled&&M.groupIds&&this.group.recordFillInfo(M,X,D,V.width,S.height),O++,M.type===s.ElementType.TABLE&&!ae(M)){const K=M.tdPadding||i,k=K[1]+K[3];for(let B=0;B<M.trList.length;B++){const H=M.trList[B];for(let A=0;A<H.tdList.length;A++){const v=H.tdList[A];this.drawRow(t,{elementList:v.value,positionList:v.positionList,rowList:v.rowList,pageNo:d,startIndex:0,innerWidth:(v.width-k)*n,zone:T,isDrawLineBreak:g,td:v})}}}}if(S.isList&&this.listParticle.drawListStyle(t,S,h[S.startIndex]),this.textParticle.complete(),this.control.drawBorder(t),this.underline.render(t),this.strikeout.render(t),this.group.render(t),!I){if(y.width&&y.height){const{x:b,y:M,width:V,height:N}=y;this.range.render(t,b,M,V,N)}if(m&&Y&&Y.id===L){const{coordinate:{leftTop:[b,M]}}=h[S.startIndex];this.tableParticle.drawRange(t,Y,b,M)}}}this.control.renderQualityMarks(t,e.elementList,e.positionList,e.rowList,e.pageNo,e.zone,e.innerWidth)}_drawFloat(t,e){const{scale:n}=this.options,i=this.position.getFloatPositionList(),{imgDisplays:l,pageNo:r}=e;for(let a=0;a<i.length;a++){const c=i[a],d=c.element;if((r===c.pageNo||c.zone===s.EditorZone.HEADER||c.zone==s.EditorZone.FOOTER)&&d.imgDisplay&&l.includes(d.imgDisplay)&&d.type===s.ElementType.IMAGE){const u=d.imgFloatPosition;this.imageParticle.render(t,d,u.x*n,u.y*n)}}}_clearPage(t){const e=this.ctxList[t],n=this.pageList[t];e.clearRect(0,0,Math.max(n.width,this.getWidth()),Math.max(n.height,this.getHeight())),this.blockParticle.clear()}_drawPage(t){const{elementList:e,positionList:n,rowList:i,pageNo:l}=t,{inactiveAlpha:r,pageMode:a,header:c,footer:d,pageNumber:u,lineNumber:h,pageBorder:R}=this.options,T=this.isPrintLikeMode(),g=this.mode===s.EditorMode.COMPARE?this.options.modeRule[s.EditorMode.COMPARE]:this.options.modeRule[s.EditorMode.PRINT],f=this.getInnerWidth(),C=this.ctxList[l];C.globalAlpha=this.zone.isMainActive()?1:r,this._clearPage(l),(!T||!g?.backgroundDisabled)&&this.background.render(C,l),T||this.area.render(C,l),a!==s.PageMode.CONTINUITY&&this.options.watermark.data&&this.waterMark.render(C,l),T||this.margin.render(C,l),this._drawFloat(C,{pageNo:l,imgDisplays:[s.ImageDisplay.FLOAT_BOTTOM]}),T||this.control.renderHighlightList(C,l);const p=i[0]?.startIndex;this.drawRow(C,{elementList:e,positionList:n,rowList:i,pageNo:l,startIndex:p,innerWidth:f,zone:s.EditorZone.MAIN}),this.getIsPagingMode()&&(c.disabled||this.header.render(C,l),u.disabled||this.pageNumber.render(C,l),d.disabled||this.footer.render(C,l)),this._drawFloat(C,{pageNo:l,imgDisplays:[s.ImageDisplay.FLOAT_TOP,s.ImageDisplay.SURROUND]}),!T&&this.search.getSearchKeyword()&&this.search.render(C,l),this.elementList.length<=1&&!this.elementList[0]?.listId&&this.placeholder.render(C),h.disabled||this.lineNumber.render(C,l),R.disabled||this.pageBorder.render(C),this.badge.render(C,l),this.isGraffitiMode()&&this.graffiti.render(C,l)}_disconnectLazyRender(){this.lazyRenderIntersectionObserver?.disconnect()}_lazyRender(t){const e=this.position.getOriginalMainPositionList(),n=this.getOriginalMainElementList();this._disconnectLazyRender(),t!==void 0&&t>=0&&t<this.pageRowList.length&&this._drawPage({elementList:n,positionList:e,rowList:this.pageRowList[t],pageNo:t}),this.lazyRenderIntersectionObserver=new IntersectionObserver(i=>{i.forEach(l=>{if(l.isIntersecting){const r=Number(l.target.dataset.index);this._drawPage({elementList:n,positionList:e,rowList:this.pageRowList[r],pageNo:r})}})}),this.pageList.forEach((i,l)=>{l!==t&&this.lazyRenderIntersectionObserver.observe(i)})}_immediateRender(){const t=this.position.getOriginalMainPositionList(),e=this.getOriginalMainElementList();for(let n=0;n<this.pageRowList.length;n++)this._drawPage({elementList:e,positionList:t,rowList:this.pageRowList[n],pageNo:n})}render(t){const e=this._takePendingRenderOption();if(e){const E=t||{};t={...e,...E,curIndex:E.curIndex??e.curIndex,isCompute:(e.isCompute??!0)||(E.isCompute??!0),isSubmitHistory:(e.isSubmitHistory??!0)||(E.isSubmitHistory??!0)}}const n=re(),i=[],l=(E,U)=>{i.push({label:E,duration:re()-U})};this.renderCount++,this.syncSubTemplateRuntimeContent();const r=this.mode===s.EditorMode.EDIT||this.mode===s.EditorMode.FORM||this.isPrintLikeMode()?uT([...this.getHeaderElementList(),...this.elementList,...this.getFooterElementList()]):null,a=this.applySubTemplateRuntimeState(this.getHeaderElementList(),r)||this.applySubTemplateRuntimeState(this.elementList,r)||this.applySubTemplateRuntimeState(this.getFooterElementList(),r);let{curIndex:c}=t||{},{endIndex:d}=this.range.getRange();const{isCrossRowCol:u}=this.range.getRange();if(!u&&~d){const E=this.getElementList(),U=E[d],Z=U?.type===s.ElementType.SUB_TEMPLATE&&U.subTemplateExpanded?s.LocationPosition.AFTER:s.LocationPosition.BEFORE,Q=Bn(E,d,Z);Q!==d&&!ae(E[Q])&&((c===void 0||c===d)&&(c=Q),this.range.setRange(Q,Q),d=Q)}let h;const R=this.position.getPositionContext();if(u)h=this.getOriginalElementList()[R.index];else{const E=~d?d:0,U=this.getElementList();h=Kn(U,E)}const{header:T,footer:g}=this.options,{isSubmitHistory:f=!0,isSetCursor:C=!0,isLazy:p=!0,isInit:I=!1,isSourceHistory:m=!1,isContentChange:L=!1,isFirstRender:O=!1,isDel:P=!1}=t||{};let{isCompute:S=!0}=t||{};a&&(S=!0);const{traceLabel:y}=t||{},Y=this.getInnerWidth(),b=this.getIsPagingMode(),M=this.pageRowList.length;if(S){if(this.splitTdValueMap.clear(),this.tdMap.clear(),this.position.setFloatPositionList([]),b){if(!T.disabled){const v=re();this.header.compute(),l("header.compute",v)}if(!g.disabled){const v=re();this.footer.compute(),l("footer.compute",v)}}const E=this.getMargins(),U=this.getHeight(),F=this.header.getExtraHeight(),Z=this.getMainOuterHeight(),Q=E[3],W=E[0]+F,K=Qi(this.elementList),k=re();this.rowList=this.computeRowList({startX:Q,startY:W,pageHeight:U,mainOuterHeight:Z,isPagingMode:b,innerWidth:Y,surroundElementList:K,elementList:this.elementList}),l("computeRowList",k);const B=re();this.pageRowList=this._computePageList(),l("computePageList",B);const H=re();this.position.computePositionList(),l("computePositionList",H);const A=re();if(this.area.compute(),l("area.compute",A),!this.isPrintLikeMode()){const v=this.search.getSearchKeyword();if(v){const bt=re();this.search.compute(v),l("search.compute",bt)}const ct=re();this.control.computeHighlightList(),l("control.computeHighlightList",ct)}if(this.isGraffitiMode()){const v=re();this.graffiti.compute(),l("graffiti.compute",v)}}this.imageObserver.clearAll(),this.cursor.recoveryCursor();for(let E=0;E<this.pageRowList.length;E++)this.pageList[E]||this._createPage(E);const V=this.pageRowList.length,N=this.pageList.length;if(N>V){const E=N-V;this.ctxList.splice(V,E),this.pageList.splice(V,E).forEach(U=>U.remove())}const X=re();if(p&&b){let E=this.pageNo;c!==void 0&&this.zone.isMainActive()&&(E=this.position.getPositionList()[c]?.pageNo??E),this._lazyRender(E)}else this._immediateRender();if(l(p&&b?"lazyRender":"immediateRender",X),C){if(S&&h?.tableId){const{index:E}=R,F=this.getOriginalElementList()[E];if(h.tableId!==F?.id){const Q=this.findTableChildrenElement(!0,h.tableId,h);Q&&R.index!==Q.originalIndex&&(R.index=Q.originalIndex,R.tableId=Q.table.id,R.trIndex=Q.trIndex,R.trId=Q.tr.id,R.tdIndex=Q.tdIndex,R.tdId=Q.td.id,c=Q.elementIndex,this.position.setPositionContext(R),this.range.setRange(c,c),this.updateTableTool())}const Z=this.getElementList();Z[d]!==h&&(c=Z.findIndex(Q=>Q===h))}c=this.setCursor(c)}else this.range.getIsSelection()&&this.cursor.focus();if(P){let E;const U=this.position.getPositionContext();E=this.range.getRange().startIndex-1,U.index=E}(f&&!O||c!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(c);const D=re();Pi(()=>{const E=re();this.pendingRenderFrameId===null&&(this.range.setRangeStyle(),S&&this.control.getActiveControl()&&this.control.reAwakeControl(),S&&!this.isReadonly()&&R.isTable&&this.getOriginalElementList()[R.index].type===s.ElementType.TABLE&&this.tableTool.render(),S&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator()),M!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(f||m||L)&&!I&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"));const U=re();Oi(this.options,y||"render",U-n,[...i,{label:"nextTick.wait",duration:E-D},{label:"nextTick.callback",duration:U-E}],{isCompute:S,pageCount:this.pageRowList.length})}),C&&this.fixPosition()}fixPosition(t=!1){let e;const n=this.position.getPositionContext();if(n.isTable){const i=this.getElementList(),l=this.range.getRange().startIndex;if(t||l>=i.length){const r=this.getTd(),a=n.index+(t?-1:1),d=this.getOriginalElementList()[a];if(!d?.trList)return;e=l-i.length;for(let u=0;u<d.trList.length;u++){const h=d.trList[u],R=h.tdList.find(T=>t?r?.linkTdPrevId===T.id:r?.id===T.linkTdPrevId);if(R){n.index=a,n.trIndex=u,n.tableId=d.id,n.trId=h.id,n.tdId=R?.id,e=t?R.value.length-1:e+(R.value[0]?.type===s.ElementType.SPLIT_TAG?1:0);break}}if(this.position.setPositionContext(n),this.range.setRange(e,e),this.setCursor(e),e===0)return this.fixPosition(t);this.updateTableTool()}}return e}getInlineBackgroundControlType(t,e){if(e===void 0)return;const n=t[e],i=n?.controlId;return i?n.control?.type?n.control.type:t.find(r=>r.controlId===i&&r.originControlId===n.originControlId&&!!r.control?.type)?.control?.type:void 0}getIsHideInlineBackgroundControlCursor(t,e){if(this.options.mode!==s.EditorMode.EDIT&&this.options.mode!==s.EditorMode.FORM)return!1;const n=e!==void 0?t[e]:void 0;if(n?.controlComponent===s.ControlComponent.POSTFIX||n?.controlComponent===s.ControlComponent.POST_TEXT||n?.controlComponent===s.ControlComponent.POSTTEXTFIX||n?.controlComponent===s.ControlComponent.POSTTEXTFIX_TEXT)return!1;const i=this.getInlineBackgroundControlType(t,e);return!!(i&&[s.ControlType.SELECT,s.ControlType.DATE].includes(i))}setCursor(t){const e=this.position.getPositionContext(),n=this.position.getPositionList(),i=this.getElementList();if(e.isTable){const{index:r,trIndex:a,tdIndex:c}=e,u=this.getOriginalElementList()[r].trList?.[a].tdList[c].positionList;t===void 0&&u&&(t=u.length-1);const h=u?.[t];this.position.setCursorPosition(h||null)}else t!==void 0&&t>=n.length&&(t=n.length-1),this.position.setCursorPosition(t!==void 0&&t>=0?n[t]:null);let l=!0;if(t!==void 0&&e.isImage&&e.isDirectHit){const r=i[t];if(r&&Ua.includes(r.type)){l=!1;const a=this.position.getCursorPosition();this.previewer.updateResizer(r,a)}}return l&&this.getIsHideInlineBackgroundControlCursor(i,t)&&(l=!1),this.cursor.drawCursor({isShow:l}),t}submitHistory(t){const e=this.position.getPositionContext(),n=Zi(this.elementList),i=Zi(this.header.getElementList()),l=Zi(this.footer.getElementList()),r=rt(this.range.getRange()),a=this.pageNo,c=rt(e),d=this.zone.getZone();this.historyManager.execute(()=>{this.zone.setZone(d),this.setPageNo(a),this.position.setPositionContext(rt(c)),this.header.setElementList(rt(i)),this.footer.setElementList(rt(l)),this.elementList=rt(n),this.range.replaceRange(rt(r)),this.render({curIndex:t,isSubmitHistory:!1,isSourceHistory:!0})})}destroy(){this._cancelPendingRender(),this.macroParticle.clearInlineEditor({isSubmitHistory:!1}),this._cancelPendingRender(),this.cursor.recoveryCursor(),this.container.remove(),this.globalEvent.removeEvent(),this.scrollObserver.removeEvent(),this.selectionObserver.removeEvent()}clearSideEffect(){this.getMacroParticle().clearInlineEditor({isSubmitHistory:!1}),this.getPreviewer().clearResizer(),this.getTableTool().dispose(),this.getHyperlinkParticle().clearHyperlinkPopup(),this.getDateParticle().clearDatePicker()}updateTableTool(){if(this.position.getPositionContext().isTable){const t=this.position.getPositionList();t.length&&(this.setPageNo(t[0].pageNo),this.getTableTool().render())}}initTableElementIndex(t,e){t.trList?.forEach((n,i)=>{n.tdList.forEach((l,r)=>{l.tableIndex=e,l.tableId=t.id,l.trIndex=i,l.trId=n.id,l.tdIndex=r,this.tdMap.set(l.id,l)})})}clearElementEffect(t){t.trList?.forEach(e=>{e.minHeight=e.originalMinHeight??e.minHeight,delete e.originalMinHeight,e.tdList.forEach(n=>{delete n.linkTdNextId})})}updateElementTableInfo(t,e,n,i){return t.tableId=e.id,t.trId=n.id,t.tdId=i.id,t}findTableChildrenElement(t,e,n){const i=this.position.getPositionContext(),{index:l}=i,r=this.getOriginalElementList();let a=l;t&&(a=l>r.length?r.length-1:l);for(let c=a;t?c>=0:c<r.length;t?c--:c++){const d=r[c];if(d&&[d.originalId,d.id].includes(e))for(const[u,h]of d.trList.entries())for(const[R,T]of h.tdList.entries()){const g=T.value.findIndex(typeof n=="function"?n:f=>f===n);if(g>=0)return{originalIndex:c,table:d,tr:h,trIndex:u,td:T,tdIndex:R,elementIndex:g}}}}getTdById(t){return this.tdMap.get(t)}getLinkTdPrevHasValue(t){const e=this.getTdById(t);if(e)return e.value.length?e:this.getLinkTdPrevHasValue(e.linkTdPrevId)}getFirstLinkTd(t){const e=this.getTdById(t);return e?.linkTdPrevId?this.getLastLinkTd(e.linkTdPrevId):e}getLastLinkTd(t){const e=this.getTdById(t);return e?.linkTdNextId?this.getLastLinkTd(e.linkTdNextId):e}removeLinkTd(t,e){const n=this.getTdById(e);if(n){if(n.linkTdPrevId){const i=this.getTdById(n.linkTdPrevId);i&&(delete i.linkTdNextId,this.removeLinkTd(t,n.linkTdPrevId))}if(n.linkTdNextId){const i=this.getTdById(n.linkTdNextId);i&&(delete i.linkTdPrevId,this.removeLinkTd(t,n.linkTdNextId))}t[n.tableIndex].trList[n.trIndex].tdList.splice(n.tdIndex,1),this.initTableElementIndex(t[n.tableIndex],n.tableIndex)}}removeLinkTdControl(t,e){const n=this.getTdById(t);if(n){for(let i=0;i<n.value.length;i++)n.value[i].control===e&&(n.value.splice(i,1),i--);n.linkTdNextId&&this.removeLinkTdControl(n.linkTdNextId,e)}}isSplitTd(t,e){return(!!t?.originalId||!!e?.originalId)&&(t?.originalId===e?.originalId||t?.id===e?.originalId||t?.originalId===e?.id)}getSplitTdValues(t){return this.splitTdValueMap.get(t)}removeSplitTdOtherRangeElements(){const{splitTdRange:t}=this.range.getRange();if(!t)return;const{startIndex:e,endIndex:n}=t;let i=this.getTd();if(i)if((i.valueStartIndex??0)>=e){let l=-1;for(;l<0;){const r=this.getTdById(i.linkTdPrevId);if(r){l=e-(r.valueStartIndex??0);const a=Math.max(0,l);this.spliceElementList(r.value,a+1,r.value.length-a-1),i=r}else l=0}}else{let l=1;for(;l>0;){const r=this.getTdById(i.linkTdNextId);if(r){const a=r.valueStartIndex??0;l=n-(a+r.value.length);const c=Math.min(r.value.length,n-a+1);this.spliceElementList(r.value,0,c),i=r}else l=0}}}getTablesByPagingId(t,e,n){const i=[],l=[];if(t[n].pagingId===e){i.push(n),l.push(t[n]);for(let r=n-1;r>=0&&t[r].pagingId===e;r--)l.unshift(t[r]),i.push(r);for(let r=n+1;r<t.length&&t[r].pagingId===e;r++)l.push(t[r]),i.push(r)}return{list:l,startIndex:i.sort()[0]}}}class $l{executeMode;executeCut;executeCopy;executePaste;executeSelectAll;executeBackspace;executeSetRange;executeReplaceRange;executeSetPositionContext;executeForceUpdate;executeBlur;executeHideCursor;executeUndo;executeRedo;executePainter;executeApplyPainterStyle;executeFormat;executeFont;executeButton;executeEditElementAttribute;executeTriggerControlEditAttribute;executeCopyControl;executePasteControl;executeSize;executeSizeAdd;executeSizeMinus;executeBold;executeItalic;executeUnderline;executeStrikeout;executeSuperscript;executeSubscript;executeColor;executeHighlight;executeTitle;executeList;executeRowFlex;executeVertical;executeRowMargin;executeInsertTable;executeInsertTableTopRow;executeInsertTableBottomRow;executeInsertTableLeftCol;executeInsertTableRightCol;executeDeleteTableRow;executeDeleteTableCol;executeDeleteTable;executeMergeTableCell;executeCancelMergeTableCell;executeSplitVerticalTableCell;executeSplitHorizontalTableCell;executeTableTdVerticalAlign;executeTableBorderType;executeTableBorderColor;executeTableTdBorderType;executeTableTdSlashType;executeTableTdBackgroundColor;executeTableSelectAll;executeTableProperties;executeImage;executeHyperlink;executeDeleteHyperlink;executeCancelHyperlink;executeEditHyperlink;executeSeparator;executePageBreak;executeAddWatermark;executeDeleteWatermark;executeSearch;executeSearchNavigatePre;executeSearchNavigateNext;executeReplace;executePrint;executeReplaceImageElement;executeSaveAsImageElement;executeSetImageCrop;executeSetImageCaption;executeChangeImageDisplay;executePageMode;executePageScale;executePageScaleRecovery;executePageScaleMinus;executePageScaleAdd;executePaperSize;executePaperDirection;executeSetPaperMargin;executeSetMainBadge;executeSetAreaBadge;executeInsertElementList;executeInsertArea;executeSetAreaValue;executeSetAreaProperties;executeLocationArea;executeClearGraffiti;executeAppendElementList;executeUpdateElementById;executeDeleteElementById;executeSetValue;executeRemoveControl;executeTranslate;executeSetLocale;executeLocationCatalog;executeWordTool;executeSetHTML;executeSetGroup;executeDeleteGroup;executeLocationGroup;executeSetZone;executeSetControlValue;executeSetControlValueList;executeSetControlExtension;executeSetControlExtensionList;executeSetControlProperties;executeSetControlPropertiesList;executeSetControlHighlight;executeSetControlQualityMarks;executeSetButtonContent;executeLocationControl;executeInsertControl;executeInsertTextField;executeJumpControl;executeUpdateOptions;executeSetFormModeTrace;executeInsertTitle;executeFocus;executeComputeElementListHeight;getCatalog;getImage;getPageMode;getOptions;getValue;getValueAsync;getAreaValue;getHTML;getText;getWordCount;getCursorPosition;getRemainingContentHeight;getRange;getRangeText;getRangeContext;getRangeRow;getRangeParagraph;getKeywordRangeList;getKeywordContext;getPaperMargin;getSearchNavigateInfo;getLocale;getGroupIds;getControlValue;getButtonContent;getControlList;getContainer;getTitleValue;getPositionContextByEvent;getElementById;getMacroValue;getMacroList;setMacroValue;setMacroValueList;updateMacroProperties;locationMacro;insertSubTemplate;updateSubTemplate;expandSubTemplate;collapseSubTemplate;toggleSubTemplate;constructor(t){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.executeHideCursor=t.hideCursor.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.executeButton=t.buttonText.bind(t),this.executeEditElementAttribute=t.editElementAttribute.bind(t),this.executeTriggerControlEditAttribute=t.triggerControlEditAttribute.bind(t),this.executeCopyControl=t.copyControl.bind(t),this.executePasteControl=t.pasteControl.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.executeVertical=t.vertical.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.executeSplitVerticalTableCell=t.splitVerticalTableCell.bind(t),this.executeSplitHorizontalTableCell=t.splitHorizontalTableCell.bind(t),this.executeTableTdVerticalAlign=t.tableTdVerticalAlign.bind(t),this.executeTableBorderType=t.tableBorderType.bind(t),this.executeTableBorderColor=t.tableBorderColor.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.executeTableProperties=t.tableProperties.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.executeSetImageCrop=t.setImageCrop.bind(t),this.executeSetImageCaption=t.setImageCaption.bind(t),this.executeChangeImageDisplay=t.changeImageDisplay.bind(t),this.executePageMode=t.pageMode.bind(t),this.executePageScale=t.pageScale.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.executeSetMainBadge=t.setMainBadge.bind(t),this.executeSetAreaBadge=t.setAreaBadge.bind(t),this.getAreaValue=t.getAreaValue.bind(t),this.executeInsertArea=t.insertArea.bind(t),this.executeSetAreaValue=t.setAreaValue.bind(t),this.executeSetAreaProperties=t.setAreaProperties.bind(t),this.executeLocationArea=t.locationArea.bind(t),this.executeClearGraffiti=t.clearGraffiti.bind(t),this.executeInsertElementList=t.insertElementList.bind(t),this.executeAppendElementList=t.appendElementList.bind(t),this.executeUpdateElementById=t.updateElementById.bind(t),this.executeDeleteElementById=t.deleteElementById.bind(t),this.executeSetValue=t.setValue.bind(t),this.executeRemoveControl=t.removeControl.bind(t),this.executeTranslate=t.translate.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.executeSetFormModeTrace=t.setFormModeTrace.bind(t),this.executeInsertTitle=t.insertTitle.bind(t),this.executeFocus=t.focus.bind(t),this.executeComputeElementListHeight=t.computeElementListHeight.bind(t),this.getImage=t.getImage.bind(t),this.getPageMode=t.getPageMode.bind(t),this.getOptions=t.getOptions.bind(t),this.getValue=t.getValue.bind(t),this.getValueAsync=t.getValueAsync.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.getRemainingContentHeight=t.getRemainingContentHeight.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.executeSetControlValueList=t.setControlValueList.bind(t),this.executeSetControlExtension=t.setControlExtension.bind(t),this.executeSetControlExtensionList=t.setControlExtensionList.bind(t),this.executeSetControlProperties=t.setControlProperties.bind(t),this.executeSetControlPropertiesList=t.setControlPropertiesList.bind(t),this.executeSetControlHighlight=t.setControlHighlight.bind(t),this.executeSetControlQualityMarks=t.setControlQualityMarks.bind(t),this.executeSetButtonContent=t.setButtonContent.bind(t),this.getControlValue=t.getControlValue.bind(t),this.getButtonContent=t.getButtonContent.bind(t),this.getControlList=t.getControlList.bind(t),this.executeLocationControl=t.locationControl.bind(t),this.executeInsertControl=t.insertControl.bind(t),this.executeInsertTextField=t.insertTextField.bind(t),this.executeJumpControl=t.jumpControl.bind(t),this.getMacroValue=t.getMacroValue.bind(t),this.getMacroList=t.getMacroList.bind(t),this.setMacroValue=t.setMacroValue.bind(t),this.setMacroValueList=t.setMacroValueList.bind(t),this.updateMacroProperties=t.updateMacroProperties.bind(t),this.locationMacro=t.locationMacro.bind(t),this.insertSubTemplate=t.insertSubTemplate.bind(t),this.updateSubTemplate=t.updateSubTemplate.bind(t),this.expandSubTemplate=t.expandSubTemplate.bind(t),this.collapseSubTemplate=t.collapseSubTemplate.bind(t),this.toggleSubTemplate=t.toggleSubTemplate.bind(t)}}function xT(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 JT(o,t){const{width:e,height:n,direction:i=s.PaperDirection.VERTICAL}=t,l=document.createElement("iframe");l.style.visibility="hidden",l.style.position="absolute",l.style.left="0",l.style.top="0",l.style.width="0",l.style.height="0",l.style.border="none",document.body.append(l);const r=l.contentWindow,a=r.document;a.open();const c=document.createElement("div"),d=xT(e,n);o.forEach(R=>{const T=document.createElement("img");T.style.width=i===s.PaperDirection.HORIZONTAL?d.height:d.width,T.style.height=i===s.PaperDirection.HORIZONTAL?d.width:d.height,T.src=R,c.append(T)});const u=document.createElement("style"),h=`
567
567
  * {
568
568
  margin: 0;
569
569
  padding: 0;
@@ -571,14 +571,14 @@ ${h} `}textToElements(t){const e=[],n=t.split(`
571
571
  @page {
572
572
  margin: 0;
573
573
  size: ${d.size} ${i===s.PaperDirection.HORIZONTAL?"landscape":"portrait"};
574
- }`;u.append(document.createTextNode(h)),setTimeout(()=>{a.write(`${u.outerHTML}${c.innerHTML}`),r.print(),a.close(),window.addEventListener("mouseover",()=>{l?.remove()},{once:!0})})}const $T=[s.ControlType.TEXT,s.ControlType.TEXTFIELD],zl=["id","titleId","listId","areaId","hyperlinkId","dateId","labelId","tableId","trId","tdId","pagingId","menstrualHistoryId","fetalHeartPositionId","toothPositionId"];function hi(o,t){for(let e=0;e<o.length;e++){const n=o[e];if(n.type===s.ElementType.CONTROL&&n.controlId===t&&n.control)return rt(n);if(n.control?.value?.length){const i=hi(n.control.value,t);if(i)return i}if(n.valueList?.length){const i=hi(n.valueList,t);if(i)return i}if(n.type===s.ElementType.TABLE&&n.trList?.length)for(let i=0;i<n.trList.length;i++){const l=n.trList[i];for(let r=0;r<l.tdList.length;r++){const a=l.tdList[r],c=hi(a.value,t);if(c)return c}}}return null}function zT(o){const t=new Map,e=new Map,n=a=>a&&(t.has(a)||t.set(a,ft()),t.get(a)),i=a=>a&&(e.has(a)||e.set(a,ft()),e.get(a)),l=a=>{a.controlId&&(a.controlId=n(a.controlId)),a.originControlId&&(a.originControlId=n(a.originControlId));for(let c=0;c<zl.length;c++){const d=zl[c],u=a[d];if(typeof u=="string"){const h=a;h[d]=i(u)}}a.groupIds?.length&&(a.groupIds=a.groupIds.map(c=>i(c))),a.valueList?.length&&a.valueList.forEach(l),a.control?.value?.length&&a.control.value.forEach(l),a.trList?.length&&a.trList.forEach(c=>{const d=c;typeof d.id=="string"&&(d.id=i(d.id)),c.tdList.forEach(u=>{const h=u;typeof h.id=="string"&&(h.id=i(h.id)),u.value.forEach(l)})})},r=rt(o);return l(r),r}function jT(o,t,e){let n=-1;const i=!!e;for(let l=0;l<o.length;l++){const r=o[l];if(i?r.controlId===t&&r.originControlId===e:r.controlId===t&&!r.originControlId)n=l;else if(~n)break}return n}class qT{draw;range;position;historyManager;canvasEvent;options;control;workerManager;searchManager;i18n;zone;tableOperate;constructor(t){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()}getButtonContentControlId(t){return`${t}_text`}getButtonContentText(t){return t.filter(e=>!me(e)).map(e=>e.value===_?`
575
- `:e.value||"").join("")}hasButtonContent(t){return t?.length?t.some(e=>!me(e)&&(!!(e.type&&e.type!==s.ElementType.TEXT&&e.type!==s.ElementType.CONTROL)||(e.value===_?`
576
- `:e.value||"").length>0)):!1}syncButtonPlaceholderElements(t,e,n){const i=[];let l=null,r=-1,a=!1;if(t.forEach((u,h)=>{u.controlId!==e||u.control?.type!==s.ControlType.BUTTON||(u.control.placeholder=n,l||=u,u.controlComponent===s.ControlComponent.VALUE&&!me(u)&&(a=!0),u.controlComponent===s.ControlComponent.PLACEHOLDER&&i.push({element:u,index:h}),r===-1&&u.controlComponent===s.ControlComponent.POSTFIX&&(r=h))}),!l)return;const c=i.length?Math.min(...i.map(u=>u.index)):r;i.length&&i.sort((u,h)=>h.index-u.index).forEach(u=>{t.splice(u.index,1)});const d=Nt(n);!d.length||a&&!i.length||c<0||d.forEach((u,h)=>{const R={...xt(l,ce),value:u===`
577
- `?_:u,controlId:e,type:s.ElementType.CONTROL,control:l.control,controlComponent:s.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor,hide:a};le(t,[R],c-1+h,{editorOptions:this.options}),t.splice(c+h,0,R)})}normalizeButtonContentValue(t){return Array.isArray(t)?rt(t):[{value:t}]}getButtonContentResult(t){if(!t?.length)return null;const e=this.getButtonContentText(t);return t.some(i=>!!i.type&&i.type!==s.ElementType.TEXT&&i.type!==s.ElementType.CONTROL)?rt(t):e}isSameButtonControlElement(t,e){return!!(t&&t.controlId===e.element.controlId&&(t.originControlId||null)===(e.element.originControlId||null))}getButtonControlRange(t){let e=t.index;for(;e>0&&this.isSameButtonControlElement(t.elementList[e-1],t);)e--;let n=t.index;for(;n+1<t.elementList.length&&this.isSameButtonControlElement(t.elementList[n+1],t);)n++;return{startIndex:e,endIndex:n}}getButtonRenderedValue(t){const{startIndex:e,endIndex:n}=this.getButtonControlRange(t),i=[];for(let l=e;l<=n;l++){const r=t.elementList[l];if(this.isSameButtonControlElement(r,t)&&r.controlComponent===s.ControlComponent.VALUE&&!me(r)){const a={value:r.value||""};[...ce,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"].forEach(d=>{const u=r[d];u!==void 0&&(a[d]=u)}),i.push(a)}}return i}getButtonBusinessValue(t){const e=this.getButtonRenderedValue(t);if(e.length)return e;const n=this.getButtonContentControlId(t.element.controlId),i=t.elementList.find(c=>c.controlId===n&&c.control?.type===s.ControlType.BUTTON&&!!c.control.buttonText);if(i?.control?.value?.length)return rt(i.control.value);const l=t.element.control?.value||[],r=this.getButtonContentText(l),a=t.element.control?.buttonLabel||t.element.control?.label||"";return!this.hasButtonContent(l)||r===a?[]:rt(l)}findButtonControlContext(t){const e=(i,l)=>{for(let r=0;r<i.length;r++){const a=i[r];if(a.type===s.ElementType.TABLE&&a.trList?.length)for(const c of a.trList)for(const d of c.tdList){const u=e(d.value,l);if(u)return u}if(a.controlId===t&&a.control?.type===s.ControlType.BUTTON&&!a.control.buttonText)return{elementList:i,index:r,element:a,zone:l}}return null},n=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:i,elementList:l}of n){const r=e(l,i);if(r)return r}return null}removeButtonBusinessElements(t){const e=this.getButtonContentControlId(t.element.controlId);for(let n=t.elementList.length-1;n>=0;n--)t.elementList[n].controlId===e&&t.elementList.splice(n,1)}appendButtonContentValue(t,e){if(!t.length)return e;if(!e.length)return t;const n=this.getButtonContentText(t),i=this.getButtonContentText(e);return n.trim()?i.trim()?[{value:n.endsWith(`
574
+ }`;u.append(document.createTextNode(h)),setTimeout(()=>{a.write(`${u.outerHTML}${c.innerHTML}`),r.print(),a.close(),window.addEventListener("mouseover",()=>{l?.remove()},{once:!0})})}const $T=[s.ControlType.TEXT,s.ControlType.TEXTFIELD],zl=["id","titleId","listId","areaId","hyperlinkId","dateId","labelId","tableId","trId","tdId","pagingId","menstrualHistoryId","fetalHeartPositionId","toothPositionId"];function Ri(o,t){for(let e=0;e<o.length;e++){const n=o[e];if(n.type===s.ElementType.CONTROL&&n.controlId===t&&n.control)return rt(n);if(n.control?.value?.length){const i=Ri(n.control.value,t);if(i)return i}if(n.valueList?.length){const i=Ri(n.valueList,t);if(i)return i}if(n.type===s.ElementType.TABLE&&n.trList?.length)for(let i=0;i<n.trList.length;i++){const l=n.trList[i];for(let r=0;r<l.tdList.length;r++){const a=l.tdList[r],c=Ri(a.value,t);if(c)return c}}}return null}function zT(o){const t=new Map,e=new Map,n=a=>a&&(t.has(a)||t.set(a,ft()),t.get(a)),i=a=>a&&(e.has(a)||e.set(a,ft()),e.get(a)),l=a=>{a.controlId&&(a.controlId=n(a.controlId)),a.originControlId&&(a.originControlId=n(a.originControlId));for(let c=0;c<zl.length;c++){const d=zl[c],u=a[d];if(typeof u=="string"){const h=a;h[d]=i(u)}}a.groupIds?.length&&(a.groupIds=a.groupIds.map(c=>i(c))),a.valueList?.length&&a.valueList.forEach(l),a.control?.value?.length&&a.control.value.forEach(l),a.trList?.length&&a.trList.forEach(c=>{const d=c;typeof d.id=="string"&&(d.id=i(d.id)),c.tdList.forEach(u=>{const h=u;typeof h.id=="string"&&(h.id=i(h.id)),u.value.forEach(l)})})},r=rt(o);return l(r),r}function jT(o,t,e){let n=-1;const i=!!e;for(let l=0;l<o.length;l++){const r=o[l];if(i?r.controlId===t&&r.originControlId===e:r.controlId===t&&!r.originControlId)n=l;else if(~n)break}return n}class qT{draw;range;position;historyManager;canvasEvent;options;control;workerManager;searchManager;i18n;zone;tableOperate;constructor(t){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()}getButtonContentControlId(t){return`${t}_text`}getButtonContentText(t){return t.filter(e=>!fe(e)).map(e=>e.value===_?`
575
+ `:e.value||"").join("")}hasButtonContent(t){return t?.length?t.some(e=>!fe(e)&&(!!(e.type&&e.type!==s.ElementType.TEXT&&e.type!==s.ElementType.CONTROL)||(e.value===_?`
576
+ `:e.value||"").length>0)):!1}syncButtonPlaceholderElements(t,e,n){const i=[];let l=null,r=-1,a=!1;if(t.forEach((u,h)=>{u.controlId!==e||u.control?.type!==s.ControlType.BUTTON||(u.control.placeholder=n,l||=u,u.controlComponent===s.ControlComponent.VALUE&&!fe(u)&&(a=!0),u.controlComponent===s.ControlComponent.PLACEHOLDER&&i.push({element:u,index:h}),r===-1&&u.controlComponent===s.ControlComponent.POSTFIX&&(r=h))}),!l)return;const c=i.length?Math.min(...i.map(u=>u.index)):r;i.length&&i.sort((u,h)=>h.index-u.index).forEach(u=>{t.splice(u.index,1)});const d=Nt(n);!d.length||a&&!i.length||c<0||d.forEach((u,h)=>{const R={...xt(l,ce),value:u===`
577
+ `?_:u,controlId:e,type:s.ElementType.CONTROL,control:l.control,controlComponent:s.ControlComponent.PLACEHOLDER,color:this.options.control.placeholderColor,hide:a};le(t,[R],c-1+h,{editorOptions:this.options}),t.splice(c+h,0,R)})}normalizeButtonContentValue(t){return Array.isArray(t)?rt(t):[{value:t}]}getButtonContentResult(t){if(!t?.length)return null;const e=this.getButtonContentText(t);return t.some(i=>!!i.type&&i.type!==s.ElementType.TEXT&&i.type!==s.ElementType.CONTROL)?rt(t):e}isSameButtonControlElement(t,e){return!!(t&&t.controlId===e.element.controlId&&(t.originControlId||null)===(e.element.originControlId||null))}getButtonControlRange(t){let e=t.index;for(;e>0&&this.isSameButtonControlElement(t.elementList[e-1],t);)e--;let n=t.index;for(;n+1<t.elementList.length&&this.isSameButtonControlElement(t.elementList[n+1],t);)n++;return{startIndex:e,endIndex:n}}getButtonRenderedValue(t){const{startIndex:e,endIndex:n}=this.getButtonControlRange(t),i=[];for(let l=e;l<=n;l++){const r=t.elementList[l];if(this.isSameButtonControlElement(r,t)&&r.controlComponent===s.ControlComponent.VALUE&&!fe(r)){const a={value:r.value||""};[...ce,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"].forEach(d=>{const u=r[d];u!==void 0&&(a[d]=u)}),i.push(a)}}return i}getButtonBusinessValue(t){const e=this.getButtonRenderedValue(t);if(e.length)return e;const n=this.getButtonContentControlId(t.element.controlId),i=t.elementList.find(c=>c.controlId===n&&c.control?.type===s.ControlType.BUTTON&&!!c.control.buttonText);if(i?.control?.value?.length)return rt(i.control.value);const l=t.element.control?.value||[],r=this.getButtonContentText(l),a=t.element.control?.buttonLabel||t.element.control?.label||"";return!this.hasButtonContent(l)||r===a?[]:rt(l)}findButtonControlContext(t){const e=(i,l)=>{for(let r=0;r<i.length;r++){const a=i[r];if(a.type===s.ElementType.TABLE&&a.trList?.length)for(const c of a.trList)for(const d of c.tdList){const u=e(d.value,l);if(u)return u}if(a.controlId===t&&a.control?.type===s.ControlType.BUTTON&&!a.control.buttonText)return{elementList:i,index:r,element:a,zone:l}}return null},n=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:i,elementList:l}of n){const r=e(l,i);if(r)return r}return null}removeButtonBusinessElements(t){const e=this.getButtonContentControlId(t.element.controlId);for(let n=t.elementList.length-1;n>=0;n--)t.elementList[n].controlId===e&&t.elementList.splice(n,1)}appendButtonContentValue(t,e){if(!t.length)return e;if(!e.length)return t;const n=this.getButtonContentText(t),i=this.getButtonContentText(e);return n.trim()?i.trim()?[{value:n.endsWith(`
578
578
  `)||i.startsWith(`
579
579
  `)?n:`${n}
580
- `},{value:i}]:t:e}createButtonBusinessElements(t,e){const n=this.getButtonContentText(e),i=t.element.control,l=t.element.controlId,r=xt(t.element,[...In,...ce,...Wn,...un]),a=t.element.originControlId,c={...r,controlId:l,originControlId:a,type:s.ElementType.CONTROL,control:i,hide:!1},d=[];return Ln(n,i).forEach(h=>{d.push({...c,value:h.value===`
581
- `?_:h.value,buttonValueLayout:h.buttonValueLayout,buttonValueLayoutPrefixOffset:h.buttonValueLayoutPrefixOffset,controlComponent:s.ControlComponent.VALUE,color:this.options.defaultColor,highlight:void 0})}),d}replaceButtonRenderedValue(t,e,n){const{startIndex:i,endIndex:l}=this.getButtonControlRange(t);let r=i,a=l;for(let T=i;T<=l;T++){const g=t.elementList[T];if(g.controlComponent===s.ControlComponent.PREFIX)r=T;else if(g.controlComponent===s.ControlComponent.POSTFIX){a=T;break}}const c=r+1,d=Math.max(a-r-1,0);t.elementList.splice(c,d,...e);const h=this.hasButtonContent(n)?rt(n):null,R=r+e.length+1;for(let T=r;T<=R;T++){const g=t.elementList[T];this.isSameButtonControlElement(g,t)&&g.control&&(g.control.value=h?rt(h):null,g.control.hide=!1)}return e.length?r+e.length:r}getIsRangeInTextField(){const{startIndex:t}=this.range.getRange(),e=this.draw.getElementList(),n=e[t];if(!n)return!1;let i=null;const l=r=>{if(!r)return null;for(let a=t;a>=0;a--){const c=e[a];if(c.controlId===r&&c.control?.type===s.ControlType.TEXTFIELD&&(c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT))return r}return null};return i=l(n.controlId)||l(n.originControlId),!!i}mode(t){this.draw.setMode(t)}async cut(){this.draw.isReadonly()||this.draw.isDisabled()||await this.canvasEvent.cut()}async copy(t){await this.canvasEvent.copy(t)}paste(t){this.draw.isReadonly()||this.draw.isDisabled()||Qc(this.canvasEvent,t)}copyControl(t){if(!t)return;const e=Ut(this.draw.getElementList(),{editorOptions:this.options}),n=hi(e,t);n&&Wc({element:n})}pasteControl(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=pr();if(!e?.element)return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const l=this.draw.getElementList(),r=zT(e.element),a=r.controlId;if(!a)return;const c=Vi([r]);if(!c.length)return;ee(c,{isHandleFirstElement:!1,editorOptions:this.options});let d=n,u=n,h=i,R=!1,T;const g=n===i;let f=this.control.getActiveControl();!f&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),f=this.control.getActiveControl());const C=f?.getElement();if(C?.control?.type&&$T.includes(C.control.type)&&this.control.getIsRangeWithinControl()){R=!0,T=C.controlId;const m=l[n];g&&(m?.control?.type===s.ControlType.TEXTFIELD||m?.control?.type===s.ControlType.TEXT)&&this.control.removePlaceholder(n)}else if(C?.controlId){const m=jT(l,C.controlId,C.originControlId);~m&&(d=m,u=m,h=m)}le(l,c,d,{isBreakWhenWrap:!0,editorOptions:this.options}),T&&c.forEach(m=>{m.controlId===a&&!m.originControlId&&(m.originControlId=T)});const p=d+1;u!==h&&this.draw.spliceElementList(l,u+1,h-u),this.draw.spliceElementList(l,p,0,c);const I=d+c.length;this.range.setRange(I,I),this.draw.render({curIndex:I}),R&&this.control.emitControlContentChange()}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(),l=n===i;if(l&&e[n].value===_&&n===0)return;l?this.draw.spliceElementList(e,n,1):this.draw.spliceElementList(e,n+1,i-n);const r=l?n-1:n;this.range.setRange(r,r),this.draw.render({curIndex:r})}setRange(t,e,n,i,l,r,a){if(t<0||e<0||e<t)return;this.range.setRange(t,e,n,i,l,r,a);const c=t===e;this.draw.render({curIndex:c?t:void 0,isCompute:!1,isSubmitHistory:!1,isSetCursor:c})}replaceRange(t){this.setRange(t.startIndex,t.endIndex,t.tableId,t.startTdIndex,t.endTdIndex,t.startTrIndex,t.endTrIndex)}setPositionContext(t){const{tableId:e,startTrIndex:n,startTdIndex:i}=t,l=this.draw.getOriginalElementList();if(e){const r=l.findIndex(u=>u.id===e);if(!~r)return;const c=l[r].trList[n],d=c.tdList[i];this.position.setPositionContext({isTable:!0,index:r,trIndex:n,tdIndex:i,tdId:d.id,trId:c.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.draw.flushPendingRender(),this.range.clearRange();const t=this.draw.getCursor();t.recoveryCursor(),t.getAgentDom().blur()}hideCursor(){this.draw.getCursor().recoveryCursor()}undo(){this.draw.isReadonly()||(this.draw.flushPendingRender(),this.historyManager.undo())}redo(){this.draw.isReadonly()||(this.draw.flushPendingRender(),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=>{Ne.forEach(r=>{const a=r;n[a]===void 0&&Reflect.set(n,a,i[a])})}),this.draw.setPainterStyle(n,t)}applyPainterStyle(){this.draw.isReadonly()||this.draw.isDisabled()||this.canvasEvent.applyPainterStyle()}format(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();let l={},r=[];if(i?.length)r=i,l={isSetCursor:!1};else{const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===_&&(r.push(d),l={curIndex:a})}r.length&&(r.forEach(a=>{Ne.forEach(c=>{delete a[c]})}),this.draw.render(l))}buttonText(t){if(t)if([...Array.isArray(t.element)?t.element:t.elementList||[t.element]].filter(l=>l.newButtonValue&&l.newButtonValue.length>0).length){const l=t.controlId;this.removeButtonElementsByControlId(l+"_text").then(()=>{setTimeout(()=>{this.insertButtonValue(t)},500)})}else{const l=t.controlId;l&&this.removeButtonElementsByControlId(l+"_text")}}triggerControlEditAttribute(t,e){const n=this.draw.getElementList(),i=[];t&&di(n,a=>{a.controlId===t&&i.push(a)});const l=i.length?i:e?[e]:[];this.draw.getEventBus().emit("controlEditAttribute",{controlId:t,element:l,targetElement:e||i[0]||null,isControl:!!t})}editElementAttribute(t){const e=this.draw.getElementList();if(t.controlId&&t.type==="button"){const n=Object.prototype.hasOwnProperty.call(t,"action"),i=[];let l="",r="",a=!1,c=!1,d="",u=!1;e.forEach((p,I)=>{if(p.controlId!==t.controlId||p.control?.type!==s.ControlType.BUTTON)return;const m=p.control.buttonLabel||p.control.label||"";!l&&m&&(l=m),u||(u=!0,d=p.control.placeholder||"");const L=p.control.value||[],O=this.getButtonContentText(L);O.trim()&&O!==m&&(a=!0),O.trim()&&O===m&&(c=!0),p.controlComponent===s.ControlComponent.VALUE&&(i.push(I),r+=p.value===_?`
582
- `:p.value||"")});const h=!!(!a&&l&&(r===l||c)),R=t.placeholder!==void 0?t.placeholder:d;if(h&&i.sort((p,I)=>I-p).forEach(p=>{e.splice(p,1)}),e.forEach(p=>{p.controlId===t.controlId&&p.control?.type===s.ControlType.BUTTON&&(t.label!==void 0&&(p.control.buttonLabel=t.label,p.control.label=t.label),p.control.placeholder=R,t.code!==void 0&&(p.control.code=t.code),h&&(p.control.value=null),p.control.hide=!1,n&&(t.action?p.control.action=t.action:delete p.control.action),t.editable!==void 0&&(p.control.editable=t.editable),t.valueLayout!==void 0&&(p.control.valueLayout=wn(t.valueLayout)),p.hide=!1)}),t.valueLayout!==void 0){const p=this.findButtonControlContext(t.controlId);if(p){const I=this.getButtonBusinessValue(p),m=this.createButtonBusinessElements(p,I);this.replaceButtonRenderedValue(p,m,I)}}this.syncButtonPlaceholderElements(e,t.controlId,R);const{startIndex:T,endIndex:g}=this.range.getRange(),f=!0,C=g;this.draw.render({curIndex:C,isSetCursor:f})}else if(t.controlId){const n=t.controlId;if(e.forEach(l=>{l.controlId===n&&l.control&&(t.label!==void 0&&(l.control.label=t.label),t.placeholder!==void 0&&(l.control.placeholder=t.placeholder),t.code!==void 0&&(l.control.code=t.code),t.value!==void 0&&(l.control.value=t.value?[{value:t.value}]:null),t.valueSets!==void 0&&(l.control.valueSets=t.valueSets),t.dateFormat!==void 0&&(l.control.dateFormat=t.dateFormat),t.numberExclusiveOptions!==void 0&&(l.control.numberExclusiveOptions=t.numberExclusiveOptions),t.underline!==void 0&&(l.control.underline=t.underline))}),t.placeholder!==void 0){const l=t.placeholder,r=[];if(e.forEach((a,c)=>{a.controlId===n&&a.controlComponent==="placeholder"&&r.push({element:a,index:c})}),r.length===l.length)r.forEach((a,c)=>{a.element.value=l[c]===`
580
+ `},{value:i}]:t:e}createButtonBusinessElements(t,e){const n=this.getButtonContentText(e),i=t.element.control,l=t.element.controlId,r=xt(t.element,[...In,...ce,...Un,...un]),a=t.element.originControlId,c={...r,controlId:l,originControlId:a,type:s.ElementType.CONTROL,control:i,hide:!1},d=[];return Ln(n,i).forEach(h=>{d.push({...c,value:h.value===`
581
+ `?_:h.value,buttonValueLayout:h.buttonValueLayout,buttonValueLayoutPrefixOffset:h.buttonValueLayoutPrefixOffset,controlComponent:s.ControlComponent.VALUE,color:this.options.defaultColor,highlight:void 0})}),d}replaceButtonRenderedValue(t,e,n){const{startIndex:i,endIndex:l}=this.getButtonControlRange(t);let r=i,a=l;for(let T=i;T<=l;T++){const g=t.elementList[T];if(g.controlComponent===s.ControlComponent.PREFIX)r=T;else if(g.controlComponent===s.ControlComponent.POSTFIX){a=T;break}}const c=r+1,d=Math.max(a-r-1,0);t.elementList.splice(c,d,...e);const h=this.hasButtonContent(n)?rt(n):null,R=r+e.length+1;for(let T=r;T<=R;T++){const g=t.elementList[T];this.isSameButtonControlElement(g,t)&&g.control&&(g.control.value=h?rt(h):null,g.control.hide=!1)}return e.length?r+e.length:r}getIsRangeInTextField(){const{startIndex:t}=this.range.getRange(),e=this.draw.getElementList(),n=e[t];if(!n)return!1;let i=null;const l=r=>{if(!r)return null;for(let a=t;a>=0;a--){const c=e[a];if(c.controlId===r&&c.control?.type===s.ControlType.TEXTFIELD&&(c.controlComponent===s.ControlComponent.PRETEXTFIX||c.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT||c.controlComponent===s.ControlComponent.PREFIX||c.controlComponent===s.ControlComponent.PRE_TEXT))return r}return null};return i=l(n.controlId)||l(n.originControlId),!!i}mode(t){this.draw.setMode(t)}async cut(){this.draw.isReadonly()||this.draw.isDisabled()||await this.canvasEvent.cut()}async copy(t){await this.canvasEvent.copy(t)}paste(t){this.draw.isReadonly()||this.draw.isDisabled()||Qc(this.canvasEvent,t)}copyControl(t){if(!t)return;const e=Ut(this.draw.getElementList(),{editorOptions:this.options}),n=Ri(e,t);n&&Wc({element:n})}pasteControl(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=pr();if(!e?.element)return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const l=this.draw.getElementList(),r=zT(e.element),a=r.controlId;if(!a)return;const c=Wi([r]);if(!c.length)return;ee(c,{isHandleFirstElement:!1,editorOptions:this.options});let d=n,u=n,h=i,R=!1,T;const g=n===i;let f=this.control.getActiveControl();!f&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),f=this.control.getActiveControl());const C=f?.getElement();if(C?.control?.type&&$T.includes(C.control.type)&&this.control.getIsRangeWithinControl()){R=!0,T=C.controlId;const m=l[n];g&&(m?.control?.type===s.ControlType.TEXTFIELD||m?.control?.type===s.ControlType.TEXT)&&this.control.removePlaceholder(n)}else if(C?.controlId){const m=jT(l,C.controlId,C.originControlId);~m&&(d=m,u=m,h=m)}le(l,c,d,{isBreakWhenWrap:!0,editorOptions:this.options}),T&&c.forEach(m=>{m.controlId===a&&!m.originControlId&&(m.originControlId=T)});const p=d+1;u!==h&&this.draw.spliceElementList(l,u+1,h-u),this.draw.spliceElementList(l,p,0,c);const I=d+c.length;this.range.setRange(I,I),this.draw.render({curIndex:I}),R&&this.control.emitControlContentChange()}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(),l=n===i;if(l&&e[n].value===_&&n===0)return;l?this.draw.spliceElementList(e,n,1):this.draw.spliceElementList(e,n+1,i-n);const r=l?n-1:n;this.range.setRange(r,r),this.draw.render({curIndex:r})}setRange(t,e,n,i,l,r,a){if(t<0||e<0||e<t)return;this.range.setRange(t,e,n,i,l,r,a);const c=t===e;this.draw.render({curIndex:c?t:void 0,isCompute:!1,isSubmitHistory:!1,isSetCursor:c})}replaceRange(t){this.setRange(t.startIndex,t.endIndex,t.tableId,t.startTdIndex,t.endTdIndex,t.startTrIndex,t.endTrIndex)}setPositionContext(t){const{tableId:e,startTrIndex:n,startTdIndex:i}=t,l=this.draw.getOriginalElementList();if(e){const r=l.findIndex(u=>u.id===e);if(!~r)return;const c=l[r].trList[n],d=c.tdList[i];this.position.setPositionContext({isTable:!0,index:r,trIndex:n,tdIndex:i,tdId:d.id,trId:c.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.draw.flushPendingRender(),this.range.clearRange();const t=this.draw.getCursor();t.recoveryCursor(),t.getAgentDom().blur()}hideCursor(){this.draw.getCursor().recoveryCursor()}undo(){this.draw.isReadonly()||(this.draw.flushPendingRender(),this.historyManager.undo())}redo(){this.draw.isReadonly()||(this.draw.flushPendingRender(),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=>{Ne.forEach(r=>{const a=r;n[a]===void 0&&Reflect.set(n,a,i[a])})}),this.draw.setPainterStyle(n,t)}applyPainterStyle(){this.draw.isReadonly()||this.draw.isDisabled()||this.canvasEvent.applyPainterStyle()}format(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();let l={},r=[];if(i?.length)r=i,l={isSetCursor:!1};else{const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===_&&(r.push(d),l={curIndex:a})}r.length&&(r.forEach(a=>{Ne.forEach(c=>{delete a[c]})}),this.draw.render(l))}buttonText(t){if(t)if([...Array.isArray(t.element)?t.element:t.elementList||[t.element]].filter(l=>l.newButtonValue&&l.newButtonValue.length>0).length){const l=t.controlId;this.removeButtonElementsByControlId(l+"_text").then(()=>{setTimeout(()=>{this.insertButtonValue(t)},500)})}else{const l=t.controlId;l&&this.removeButtonElementsByControlId(l+"_text")}}triggerControlEditAttribute(t,e){const n=this.draw.getElementList(),i=[];t&&ui(n,a=>{a.controlId===t&&i.push(a)});const l=i.length?i:e?[e]:[];this.draw.getEventBus().emit("controlEditAttribute",{controlId:t,element:l,targetElement:e||i[0]||null,isControl:!!t})}editElementAttribute(t){const e=this.draw.getElementList();if(t.controlId&&t.type==="button"){const n=Object.prototype.hasOwnProperty.call(t,"action"),i=[];let l="",r="",a=!1,c=!1,d="",u=!1;e.forEach((p,I)=>{if(p.controlId!==t.controlId||p.control?.type!==s.ControlType.BUTTON)return;const m=p.control.buttonLabel||p.control.label||"";!l&&m&&(l=m),u||(u=!0,d=p.control.placeholder||"");const L=p.control.value||[],O=this.getButtonContentText(L);O.trim()&&O!==m&&(a=!0),O.trim()&&O===m&&(c=!0),p.controlComponent===s.ControlComponent.VALUE&&(i.push(I),r+=p.value===_?`
582
+ `:p.value||"")});const h=!!(!a&&l&&(r===l||c)),R=t.placeholder!==void 0?t.placeholder:d;if(h&&i.sort((p,I)=>I-p).forEach(p=>{e.splice(p,1)}),e.forEach(p=>{p.controlId===t.controlId&&p.control?.type===s.ControlType.BUTTON&&(t.label!==void 0&&(p.control.buttonLabel=t.label,p.control.label=t.label),p.control.placeholder=R,t.code!==void 0&&(p.control.code=t.code),h&&(p.control.value=null),p.control.hide=!1,n&&(t.action?p.control.action=t.action:delete p.control.action),t.editable!==void 0&&(p.control.editable=t.editable),t.valueLayout!==void 0&&(p.control.valueLayout=vn(t.valueLayout)),p.hide=!1)}),t.valueLayout!==void 0){const p=this.findButtonControlContext(t.controlId);if(p){const I=this.getButtonBusinessValue(p),m=this.createButtonBusinessElements(p,I);this.replaceButtonRenderedValue(p,m,I)}}this.syncButtonPlaceholderElements(e,t.controlId,R);const{startIndex:T,endIndex:g}=this.range.getRange(),f=!0,C=g;this.draw.render({curIndex:C,isSetCursor:f})}else if(t.controlId){const n=t.controlId;if(e.forEach(l=>{l.controlId===n&&l.control&&(t.label!==void 0&&(l.control.label=t.label),t.placeholder!==void 0&&(l.control.placeholder=t.placeholder),t.code!==void 0&&(l.control.code=t.code),t.value!==void 0&&(l.control.value=t.value?[{value:t.value}]:null),t.valueSets!==void 0&&(l.control.valueSets=t.valueSets),t.dateFormat!==void 0&&(l.control.dateFormat=t.dateFormat),t.numberExclusiveOptions!==void 0&&(l.control.numberExclusiveOptions=t.numberExclusiveOptions),t.underline!==void 0&&(l.control.underline=t.underline))}),t.placeholder!==void 0){const l=t.placeholder,r=[];if(e.forEach((a,c)=>{a.controlId===n&&a.controlComponent==="placeholder"&&r.push({element:a,index:c})}),r.length===l.length)r.forEach((a,c)=>{a.element.value=l[c]===`
583
583
  `?_:l[c]});else if(r.length>0){const a={...r[0].element};r.sort((d,u)=>u.index-d.index).forEach(d=>{e.splice(d.index,1)});const c=Math.min(...r.map(d=>d.index));for(let d=0;d<l.length;d++){const u=l[d]===`
584
- `?_:l[d];e.splice(c+d,0,{...a,value:u})}}}const{endIndex:i}=this.range.getRange();this.draw.render({curIndex:i,isSetCursor:!0})}}delButton(t,e){return new Promise(n=>{for(let i=t.length-1;i>=0;i--)e.some(r=>r.controlId===t[i].controlId&&r.type===t[i].type)&&t.splice(i,1);n(!0)})}editButton(t,e,n){const i=this.draw.getElementList();n=n+1;for(let d=0;d<e.label.length;d++){const u={value:e.label[d],controlId:e.controlId,type:s.ElementType.CONTROL,control:{type:"button",buttonLabel:e.label,code:e.code,value:[{value:e.label}],label:e.label,hide:!1},controlComponent:"value",color:"#fff",highlight:"#1677FF",style:"16px Microsoft YaHei",hide:!1};i.splice(n+d,0,u)}const{startIndex:l,endIndex:r}=this.range.getRange(),a=!0,c=r;this.draw.render({curIndex:c,isSetCursor:a})}removeButtonElementsByControlId(t){return new Promise(e=>{const n=this.draw.getElementList();for(let c=n.length-1;c>=0;c--)n[c].controlId===t&&n.splice(c,1);const{startIndex:i,endIndex:l}=this.range.getRange(),r=!0,a=l;this.draw.render({curIndex:a,isSetCursor:r}),e(!0)})}removeByValue(t,e){return new Promise(n=>{for(let c=t.length-1;c>=0;c--)(t[c].type=="control"||t[c].type=="text"||t[c].type=="buttonText")&&t[c].control?.buttonLabel===e&&t[c].control?.buttonText&&t.splice(c,1);const{startIndex:i,endIndex:l}=this.range.getRange(),r=!0,a=l;this.draw.render({curIndex:a,isSetCursor:r}),n(!0)})}insertButtonValue(t){const e=this.draw.getElementList(),n=t.controlId,l=(Array.isArray(t.element)?t.element:t.elementList||[t.element])[0],r=l.newButtonValue,a=l.control.buttonLabel,c=l.control.code;if(!r||!r.length)return;let d=-1;for(let I=0;I<e.length;I++)if(e[I].controlId===n&&e[I].control?.type==="button"){d=I;break}if(d===-1)return;const u=n+"_text",h=[];for(let I=0;I<r.length;I++){const m=r[I];h.push({value:m.value,code:m.code})}const R={type:"button",buttonLabel:a,buttonText:!0,label:a,code:c,value:h,hide:!1},T=[];T.push({value:"[",controlId:u,type:s.ElementType.CONTROL,control:R,controlComponent:s.ControlComponent.PREFIX,color:"#1677FF",hide:!1});for(let I=0;I<r.length;I++){const m=r[I],L=r.length>1?`${I+1}.${m.value}`:m.value,O=Nt(L);for(let P=0;P<O.length;P++)T.push({value:O[P],controlId:u,type:s.ElementType.CONTROL,control:R,controlComponent:s.ControlComponent.VALUE,color:"#000",hide:!1});r.length>1&&I<r.length-1&&T.push({value:_,controlId:u,type:s.ElementType.CONTROL,control:R,controlComponent:s.ControlComponent.VALUE,color:"#000",hide:!1})}T.push({value:"]",controlId:u,type:s.ElementType.CONTROL,control:R,controlComponent:s.ControlComponent.POSTFIX,color:"#1677FF",hide:!1});for(let I=0;I<T.length;I++)e.splice(d+I,0,T[I]);const{startIndex:g,endIndex:f}=this.range.getRange(),C=!0,p=f;this.draw.render({curIndex:p,isSetCursor:C})}font(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length)l.forEach(r=>{r.font=t}),this.draw.render({isSetCursor:!1});else{let r=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({font:t}),d?.value===_?d.font=t:r=!1,this.draw.render({isSubmitHistory:r,curIndex:a,isCompute:!1})}}size(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{minSize:l,maxSize:r,defaultSize:a}=this.options;if(t<l||t>r)return;let c={},d=[];const u=this.range.getTextLikeSelectionElementList();if(u?.length)d=u,c={isSetCursor:!1};else{const{endIndex:R}=this.range.getRange(),g=this.draw.getElementList()[R];this.range.setDefaultStyle({size:t}),g?.value===_?(d.push(g),c={curIndex:R}):this.draw.render({curIndex:R,isCompute:!1,isSubmitHistory:!1})}if(!d.length)return;let h=!1;d.forEach(R=>{!R.size&&t===a||R.size&&R.size===t||(R.size=t,h=!0)}),h&&this.draw.render(c)}sizeAdd(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,maxSize:l}=this.options,r=this.range.getTextLikeSelectionElementList();let a={},c=[];if(r?.length)c=r,a={isSetCursor:!1};else{const{endIndex:u}=this.range.getRange(),R=this.draw.getElementList()[u],g=this.range.getDefaultStyle()?.size||R.size||i;this.range.setDefaultStyle({size:g+2>l?l:g+2}),R?.value===_?(c.push(R),a={curIndex:u}):this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(u=>{u.size||(u.size=i),!(u.size>=l)&&(u.size+2>l?u.size=l:u.size+=2,d=!0)}),d&&this.draw.render(a)}sizeMinus(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,minSize:l}=this.options,r=this.range.getTextLikeSelectionElementList();let a={},c=[];if(r?.length)c=r,a={isSetCursor:!1};else{const{endIndex:u}=this.range.getRange(),R=this.draw.getElementList()[u],g=this.range.getDefaultStyle()?.size||R.size||i;this.range.setDefaultStyle({size:g-2<l?l:g-2}),R?.value===_?(c.push(R),a={curIndex:u}):this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(u=>{u.size||(u.size=i),!(u.size<=l)&&(u.size-2<l?u.size=l:u.size-=2,d=!0)}),d&&this.draw.render(a)}bold(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const l=i.findIndex(r=>!r.bold);i.forEach(r=>{r.bold=!!~l}),this.draw.render({isSetCursor:!1})}else{let l=!0;const{endIndex:r}=this.range.getRange(),c=this.draw.getElementList()[r];this.range.setDefaultStyle({bold:c.bold?!1:!this.range.getDefaultStyle()?.bold}),c?.value===_?c.bold=!c.bold:l=!1,this.draw.render({isSubmitHistory:l,curIndex:r,isCompute:!1})}}italic(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const l=i.findIndex(r=>!r.italic);i.forEach(r=>{r.italic=!!~l}),this.draw.render({isSetCursor:!1})}else{let l=!0;const{endIndex:r}=this.range.getRange(),c=this.draw.getElementList()[r];this.range.setDefaultStyle({italic:c.italic?!1:!this.range.getDefaultStyle()?.italic}),c?.value===_?c.italic=!c.italic:l=!1,this.draw.render({isSubmitHistory:l,curIndex:r,isCompute:!1})}}underline(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length){const r=l.some(a=>!a.underline||!t&&a.textDecoration||t&&!a.textDecoration||t&&a.textDecoration&&!Oa(a.textDecoration,t));l.forEach(a=>{a.underline=r,r&&t?a.textDecoration=t:delete a.textDecoration}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let r=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({underline:d?.underline?!1:!this.range.getDefaultStyle()?.underline}),d?.value===_?d.underline=!d.underline:r=!1,this.draw.render({isSubmitHistory:r,curIndex:a,isCompute:!1})}}strikeout(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const l=i.findIndex(r=>!r.strikeout);i.forEach(r=>{r.strikeout=!!~l}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let l=!0;const{endIndex:r}=this.range.getRange(),c=this.draw.getElementList()[r];this.range.setDefaultStyle({strikeout:c.strikeout?!1:!this.range.getDefaultStyle()?.strikeout}),c?.value===_?c.strikeout=!c.strikeout:l=!1,this.draw.render({isSubmitHistory:l,curIndex:r,isCompute:!1})}}superscript(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(!i)return;const l=i.findIndex(r=>r.type===s.ElementType.SUPERSCRIPT);i.forEach(r=>{~l?r.type===s.ElementType.SUPERSCRIPT&&(r.type=s.ElementType.TEXT,delete r.actualSize):(!r.type||r.type===s.ElementType.TEXT||r.type===s.ElementType.SUBSCRIPT)&&(r.type=s.ElementType.SUPERSCRIPT)}),this.draw.render({isSetCursor:!1})}subscript(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(!i)return;const l=i.findIndex(r=>r.type===s.ElementType.SUBSCRIPT);i.forEach(r=>{~l?r.type===s.ElementType.SUBSCRIPT&&(r.type=s.ElementType.TEXT,delete r.actualSize):(!r.type||r.type===s.ElementType.TEXT||r.type===s.ElementType.SUPERSCRIPT)&&(r.type=s.ElementType.SUBSCRIPT)}),this.draw.render({isSetCursor:!1})}color(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length)l.forEach(r=>{t?r.color=t:delete r.color}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let r=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({color:t||void 0}),d?.value===_?t?d.color=t:delete d.color:r=!1,this.draw.render({isSubmitHistory:r,curIndex:a,isCompute:!1})}}highlight(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length)l.forEach(r=>{t?r.highlight=t:delete r.highlight}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let r=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({highlight:t||void 0}),d?.value===_?t?d.highlight=t:delete d.highlight:r=!1,this.draw.render({isSubmitHistory:r,curIndex:a,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 l=this.draw.getElementList(),r=n===i?this.range.getRangeParagraphElementList():l.slice(n+1,i+1);if(!r||!r.length)return;const a=ft(),c=this.draw.getOptions().title;r.forEach(h=>{!h.type&&h.value===_||(t?(h.level=t,h.titleId=a,Yo(h)&&(h.size=c[er[t]],h.bold=!0)):h.titleId&&(delete h.titleId,delete h.title,delete h.level,delete h.size,delete h.bold))});const d=n===i,u=d?i:n;this.draw.render({curIndex:u,isSetCursor:d})}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 l=this.range.getRangeRowElementList();if(!l)return;l.forEach(c=>{c.rowFlex=t});const r=n===i,a=r?i:n;this.draw.render({curIndex:a,isSetCursor:r})}vertical(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const l=this.range.getRangeRowElementList();if(!l)return;l.forEach(c=>{c.vertical=t});const r=n===i,a=r?i:n;this.draw.render({curIndex:a,isSetCursor:r})}rowMargin(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const l=this.range.getRangeRowElementList();if(!l)return;l.forEach(c=>{c.rowMargin=t});const r=n===i,a=r?i:n;this.draw.render({curIndex:a,isSetCursor:r})}insertTable(t,e,n=!1){this.draw.isReadonly()||this.draw.isDisabled()||this.getIsRangeInTextField()||this.control.getActiveControl()||this.tableOperate.insertTable(t,e,n)}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()}splitVerticalTableCell(){this.draw.isReadonly()||this.tableOperate.splitVerticalTableCell()}splitHorizontalTableCell(){this.draw.isReadonly()||this.tableOperate.splitHorizontalTableCell()}tableTdVerticalAlign(t){this.draw.isReadonly()||this.tableOperate.tableTdVerticalAlign(t)}tableBorderType(t){this.draw.isReadonly()||this.tableOperate.tableBorderType(t)}tableBorderColor(t){this.draw.isReadonly()||this.tableOperate.tableBorderColor(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()}tableProperties(){this.draw.isReadonly()||this.tableOperate.tableProperties()}hyperlink(t){const{valueList:e,url:n,hyperlinkId:i}=t;if(!n||!e?.length||this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl())return;const{startIndex:a,endIndex:c}=this.range.getRange();!~a&&!~c||this.insertElementList([{type:s.ElementType.HYPERLINK,value:"",valueList:e,url:n,hyperlinkId:i||ft()}])}getHyperlinkRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const l=this.draw.getElementList(),r=l[n];if(r.type!==s.ElementType.HYPERLINK)return null;let a=n;for(;a>0;){if(l[a].hyperlinkId!==r.hyperlinkId){t=a+1;break}a--}let c=n+1;for(;c<l.length;){if(l[c].hyperlinkId!==r.hyperlinkId){e=c-1;break}c++}return c===l.length&&(e=c-1),!~t||!~e?null:[t,e]}deleteHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.getHyperlinkRange();if(!e)return;const n=this.draw.getElementList(),[i,l]=e;this.draw.spliceElementList(n,i,l-i+1),this.draw.getHyperlinkParticle().clearHyperlinkPopup();const r=i-1;this.range.setRange(r,r),this.draw.render({curIndex:r})}cancelHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.getHyperlinkRange();if(!e)return;const n=this.draw.getElementList(),[i,l]=e;for(let a=i;a<=l;a++){const c=n[a];delete c.type,delete c.url,delete c.hyperlinkId,delete c.underline}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r,isCompute:!1})}editHyperlink(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=this.getHyperlinkRange();if(!n)return;const i=this.draw.getElementList(),[l,r]=n;for(let c=l;c<=r;c++){const d=i[c];d.url=t}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:a}=this.range.getRange();this.draw.render({curIndex:a,isCompute:!1})}separator(t,e){if(this.draw.isReadonly()||this.draw.isDisabled()||this.getIsRangeInTextField()||this.control.getActiveControl())return;const{startIndex:l,endIndex:r}=this.range.getRange();if(!~l&&!~r)return;const a=this.draw.getElementList();let c=-1;const d=a[r+1];if(d&&d.type===s.ElementType.SEPARATOR){if(d.dashArray&&d.dashArray.join()===t.join())return;c=r,Object.assign(d,{dashArray:t,...e})}else{const u={value:Zs,type:s.ElementType.SEPARATOR,dashArray:t,...e};le(a,[u],l,{editorOptions:this.options}),l!==0&&a[l].value===_?(this.draw.spliceElementList(a,l,1,[u]),c=l-1):(this.draw.spliceElementList(a,l+1,0,[u]),c=l)}this.range.setRange(c,c),this.draw.render({curIndex:c})}pageBreak(){this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl()||this.insertElementList([{type:s.ElementType.PAGE_BREAK,value:Zs}])}addWatermark(t){if(this.draw.isReadonly())return;const n=this.draw.getOptions(),{color:i,size:l,opacity:r,font:a,gap:c}=bi;n.watermark.data=t.data,n.watermark.type=t.type||s.WatermarkType.TEXT,t.width&&(n.watermark.width=t.width),t.height&&(n.watermark.height=t.height),n.watermark.color=t.color||i,n.watermark.opacity=t.opacity||r,n.watermark.size=t.size||l,n.watermark.font=t.font||a,n.watermark.repeat=!!t.repeat,t.numberType&&(n.watermark.numberType=t.numberType),n.watermark.gap=t.gap||c,this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1})}deleteWatermark(){if(this.draw.isReadonly())return;const e=this.draw.getOptions();e.watermark&&e.watermark.data&&(e.watermark={...bi},this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1}))}image(t){if(this.draw.isReadonly()||this.draw.isDisabled())return null;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=this.draw.getElementList()[n],a=r?.control?.type===s.ControlType.TEXT||r?.control?.type===s.ControlType.TEXTFIELD;a&&this.range.getRangeRowElementList()?.forEach(d=>{d.vertical=s.VerticalAlign.MIDDLE});const c=t.id||ft();return this.insertElementList([{...t,id:c,type:s.ElementType.IMAGE,vertical:a?s.VerticalAlign.MIDDLE:void 0}]),c}search(t,e){this.searchManager.setSearchKeyword(t,e),this.draw.render({isSubmitHistory:!1})}searchNavigatePre(){this.searchManager.searchNavigatePre()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}searchNavigateNext(){this.searchManager.searchNavigateNext()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}getSearchNavigateInfo(){return this.searchManager.getSearchNavigateInfo()}replace(t,e){this.draw.getSearch().replace(t,e)}async print(){const{scale:t,printPixelRatio:e,paperDirection:n,width:i,height:l}=this.options;t!==1&&this.draw.setPageScale(1);const r=await this.draw.getDataURL({pixelRatio:e,mode:s.EditorMode.PRINT});JT(r,{width:i,height:l,direction:n}),t!==1&&this.draw.setPageScale(t)}replaceImageElement(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==s.ElementType.IMAGE||(i.value=t,this.draw.render({isSetCursor:!1}))}saveAsImageElement(){const{startIndex:t}=this.range.getRange(),n=this.draw.getElementList()[t];!n||n.type!==s.ElementType.IMAGE||As(n.value,`${n.id}.png`)}setImageCrop(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==s.ElementType.IMAGE||(i.imgCrop=t,this.draw.render({isSetCursor:!1,isCompute:!1}))}setImageCaption(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];i?.type===s.ElementType.IMAGE&&(i.imgCaption=t,this.draw.render({isSetCursor:!1}))}changeImageDisplay(t,e){if(t.imgDisplay===e)return;t.imgDisplay=e;const{startIndex:n,endIndex:i}=this.range.getRange();if(e===s.ImageDisplay.SURROUND||e===s.ImageDisplay.FLOAT_TOP||e===s.ImageDisplay.FLOAT_BOTTOM){const l=this.position.getPositionList(),{pageNo:r,coordinate:{leftTop:a}}=l[n];t.imgFloatPosition={pageNo:r,x:a[0],y:a[1]}}else delete t.imgFloatPosition;this.draw.getPreviewer().clearResizer(),this.draw.render({isSetCursor:!0,curIndex:i})}getImage(t){return this.draw.getDataURL(t)}getPageMode(){return this.options}getOptions(){return this.options}getValue(t){return this.draw.getValue(t)}getValueAsync(t){return this.draw.getWorkerManager().getValue(t)}getAreaValue(t){return this.draw.getArea().getAreaValue(t)}getHTML(){const t=this.options,e=this.draw.getHeaderElementList(),n=this.draw.getOriginalMainElementList(),i=this.draw.getFooterElementList();return{header:Kn(e,t).innerHTML,main:Kn(n,t).innerHTML,footer:Kn(i,t).innerHTML}}getText(){const t=this.options,e=this.draw.getHeaderElementList(),n=this.draw.getOriginalMainElementList(),i=this.draw.getFooterElementList();return{header:Pn(e,t),main:Pn(n,t),footer:Pn(i,t)}}getWordCount(){return this.workerManager.getWordCount()}getCursorPosition(){return this.position.getCursorPosition()}getRemainingContentHeight(){if(!this.draw.getIsPagingMode())return 0;const t=this.draw.getPageRowList(),e=t.length-1,i=(t[e]||[]).reduce((c,d)=>c+d.height+(d.offsetY||0),0),l=this.draw.getHeight(),r=this.draw.getMainOuterHeight(),a=l-(r+i);return a>0?a:0}computeElementListHeight(t){if(!t.length)return 0;const e=this.draw.getInnerWidth();if(e<=0)return 0;const n=rt(t);ee(n,{isHandleFirstElement:!1,editorOptions:this.options});const i=Zi(n);return this.draw.computeRowList({innerWidth:e,elementList:n,surroundElementList:i}).reduce((r,a)=>r+a.height+(a.offsetY||0),0)}getRange(){return rt(this.range.getRange())}getRangeText(){return this.range.toString()}getRangeContext(){const t=this.range.getRange(),{startIndex:e,endIndex:n}=t;if(!~e&&!~n)return null;const i=e===n,l=this.range.toString(),r=Ut(this.range.getSelectionElementList()||[]),a=this.draw.getElementList(),c=hn(a[i?e:e+1],{extraPickAttrs:["id","controlComponent"]}),d=hn(a[n],{extraPickAttrs:["id","controlComponent"]}),u=this.draw.getRowList(),h=this.position.getPositionList(),R=h[e],T=h[n],g=R?.pageNo,f=T?.pageNo,C=R?.rowIndex,p=T?.rowIndex,I=u[C],m=u[p];let L=0,O=0;this.draw.getCursor().getHitLineStartIndex()||(L=I?.elementList[0]?.value===_?R?.index-I?.startIndex:R?.index-I?.startIndex+1),R===T?O=L:O=m.elementList[0]?.value===_?T.index-m.startIndex:T.index-m.startIndex+1;const P=[],S=this.draw.getOriginalHeight(),y=this.draw.getOriginalPageGap(),Y=this.position.getSelectionPositionList();if(Y){let Z=null,Q=0,W=null;for(let K=0;K<Y.length;K++){const{rowNo:k,pageNo:B,coordinate:{leftTop:H,rightTop:A},lineHeight:v}=Y[K];Z===null||Z!==k?(W&&P.push(W),W={x:H[0],y:H[1]+B*(S+y),width:A[0]-H[0],height:v},Z=k,Q=H[0]):W.width=A[0]-Q,K===Y.length-1&&W&&P.push(W)}}else{const Q=this.position.getPositionList()[n],{coordinate:{rightTop:W},pageNo:K,lineHeight:k}=Q;P.push({x:W[0],y:W[1]+K*(S+y),width:0,height:k})}const b=this.draw.getZone().getZone(),{isTable:M,trIndex:V,tdIndex:N,index:X}=this.position.getPositionContext();let D=null;if(M){const Q=this.draw.getOriginalElementList()[X]||null;Q&&(D=Ut([Q])[0])}let E=null,U=null,F=e-1;for(;F>0;){const Z=a[F],Q=a[F-1];if(Z.titleId&&Z.titleId!==Q?.titleId){E=Z.titleId,U=h[F].pageNo;break}F--}return rt({isCollapsed:i,startElement:c,endElement:d,startPageNo:g,endPageNo:f,startRowNo:C,endRowNo:p,startColNo:L,endColNo:O,rangeRects:P,zone:b,isTable:M,trIndex:V??null,tdIndex:N??null,tableElement:D,selectionText:l,selectionElementList:r,titleId:E,titleStartPageNo:U})}getRangeRow(){const t=this.range.getRangeRowElementList();return t?Ut(t):null}getRangeParagraph(){const t=this.range.getRangeParagraphElementList();return t?Ut(t):null}getKeywordRangeList(t){return this.range.getKeywordRangeList(t)}getKeywordContext(t){const e=this.getKeywordRangeList(t);if(!e.length)return null;const n=[],i=this.position.getOriginalMainPositionList(),l=this.draw.getOriginalMainElementList();for(let r=0;r<e.length;r++){const a=e[r],{startIndex:c,endIndex:d,tableId:u,startTrIndex:h,startTdIndex:R}=a;let T=i;if(a.tableId){const C=l.find(p=>p.id===u);C&&(T=C.trList?.[h]?.tdList?.[R]?.positionList||[])}const g=rt(T[c]),f=rt(T[d]);n.push({range:a,startPosition:g,endPosition:f})}return n}pageMode(t){this.draw.setPageMode(t)}pageScale(t){t!==this.options.scale&&this.draw.setPageScale(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)}setMainBadge(t){this.draw.getBadge().setMainBadge(t),this.draw.render({isCompute:!1,isSubmitHistory:!1})}setAreaBadge(t){this.draw.getBadge().setAreaBadgeMap(t),this.draw.render({isCompute:!1,isSubmitHistory:!1})}insertElementList(t,e={}){if(!t.length||this.draw.isReadonly()||this.draw.isDisabled())return;const{isReplace:i=!0,ignoreContextKeys:l}=e;i||this.range.shrinkRange();const r=rt(t),{startIndex:a}=this.range.getRange(),c=this.draw.getElementList();le(c,r,a,{ignoreContextKeys:l,isBreakWhenWrap:!0,editorOptions:this.options}),this.draw.insertElementList(r,e)}appendElementList(t,e){!t.length||this.draw.isReadonly()||this.draw.appendElementList(rt(t),e)}updateElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;const i=[];function l(a,c=!1){let d=0;for(;d<a.length;){const u=a[d];if(d++,u.type===s.ElementType.TABLE){const h=u.trList;for(let R=0;R<h.length;R++){const T=h[R];for(let g=0;g<T.tdList.length;g++){const f=T.tdList[g];l(f.value,c)}}}u.type===s.ElementType.CONTROL&&u.control?.value&&l(u.control.value,!0),(e&&u.id===e||n&&u.conceptId===n)&&i.push({elementList:a,index:d-1,isInsideControl:c})}}const r=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const a of r)l(a);if(i.length){for(let a=0;a<i.length;a++){const{elementList:c,index:d,isInsideControl:u}=i[a],h=c[d],R=h.controlId&&h.controlComponent===s.ControlComponent.VALUE;if(u||R){if(Object.assign(h,t.properties),h.id){const T=sr(h.id);T&&Object.assign(T,t.properties)}}else{const T=Ut([{...h,...t.properties}],{extraPickAttrs:["id"]});T.length>0&&T[0]?(dn(un,h,T[0]),ee(T,{isHandleFirstElement:!1,editorOptions:this.options}),c[d]=T[0]):Object.assign(h,t.properties)}}this.draw.render({isSetCursor:!1})}}deleteElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;let i=!1;function l(a){let c=0;for(;c<a.length;){const d=a[c];if(d.type===s.ElementType.TABLE){const u=d.trList;for(let h=0;h<u.length;h++){const R=u[h];for(let T=0;T<R.tdList.length;T++){const g=R.tdList[T];l(g.value)}}}d.type===s.ElementType.CONTROL&&d.control?.value&&l(d.control.value),(e&&d.id===e||n&&d.conceptId===n)&&(i=!0,a.splice(c,1),c--),c++}}const r=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const a of r)l(a);i&&this.draw.render({isSetCursor:!1})}getElementById(t){const{id:e,conceptId:n}=t,i=[];if(!e&&!n)return i;const l=new Set,r=new Set,a=d=>{let u=0;for(;u<d.length;){const h=d[u];if(u++,!l.has(h)){if(l.add(h),h.type===s.ElementType.TABLE){const R=h.trList;for(let T=0;T<R.length;T++){const g=R[T];for(let f=0;f<g.tdList.length;f++){const C=g.tdList[f];a(C.value)}}}if(h.valueList?.length&&a(h.valueList),h.control?.value?.length&&a(h.control.value),!(e&&h.id!==e||n&&h.conceptId!==n)){if(e&&h.id){if(r.has(h.id))continue;r.add(h.id)}i.push(h)}}}},c=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const d of c)a(d);return Ut(i,{extraPickAttrs:["id"]})}setValue(t,e){this.draw.setValue(t,e)}removeControl(t){if(t?.id||t?.conceptId){const{id:e,conceptId:n}=t;let i=!1;const l=a=>{let c=a.length-1;for(;c>=0;){const d=a[c];if(d.type===s.ElementType.TABLE){const u=d.trList;for(let h=0;h<u.length;h++){const R=u[h];for(let T=0;T<R.tdList.length;T++){const g=R.tdList[T];l(g.value)}}}c--,!(!d.control||e&&d.controlId!==e||n&&d.control.conceptId!==n)&&(i=!0,a.splice(c+1,1))}},r=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const a of r)l(a);i&&this.draw.render({isSetCursor:!1})}else{const{startIndex:e,endIndex:n}=this.range.getRange();if(e!==n)return;const i=this.draw.getElementList(),l=i[e],r=_i(i,e,"leading");if(r!==-1){const u=On(i,r,this.draw);if(u===null)return;this.range.setRange(u,u),this.draw.render({curIndex:u});return}if(l?.type===s.ElementType.MENSTRUAL_HISTORY||l?.type===s.ElementType.FETAL_HEART_POSITION||l?.type===s.ElementType.TOOTH_POSITION||l?.type===s.ElementType.IMAGE&&!!l.controlId&&l.controlComponent==="value"){this.draw.spliceElementList(i,e,1);const u=Math.max(0,e-1);this.range.setRange(u,u),this.draw.render({curIndex:u});return}if(!l?.controlId)return;const d=this.draw.getControl().removeControl(e);if(d===null)return;this.range.setRange(d,d),this.draw.render({curIndex:d})}}translate(t){return this.i18n.t(t)}setLocale(t){this.i18n.setLocale(t)}getLocale(){return this.i18n.getLocale()}getCatalog(){return this.workerManager.getCatalog()}locationCatalog(t){const e=this.draw.getOriginalElementList();function n(p,I){for(let m=0;m<p.length;m++){const L=p[m];if(L.type===s.ElementType.TABLE){const O=L.trList;for(let P=0;P<O.length;P++){const S=O[P];for(let y=0;y<S.tdList.length;y++){const Y=S.tdList[y],b=n(Y.value,I);if(b)return{...b,isTable:!0,index:m,trIndex:P,tdIndex:y,tdId:Y.id,trId:S.id,tableId:L.id}}}}if(L.titleId===I){let O=m;for(;O<p.length;){if(p[O+1]?.titleId!==I)return{isTable:!1,startIndex:O,endIndex:O};O++}}}return null}const i=n(e,t);if(!i)return;const{isTable:l,index:r,startTdIndex:a,endTdIndex:c,startTrIndex:d,endTrIndex:u,trIndex:h,tdIndex:R,tdId:T,trId:g,tableId:f,endIndex:C}=i;this.position.setPositionContext({isTable:l,index:r,trIndex:h,tdIndex:R,tdId:T,trId:g,tableId:f}),this.range.setRange(C,C,f,a,c,d,u),this.draw.render({curIndex:C,isCompute:!1,isSubmitHistory:!1})}wordTool(){const t=this.draw.getMainElementList();let e=!1;for(let n=0;n<t.length;n++)if(t[n].value===_)for(;n+1<t.length;){const l=t[n+1];if(l.value!==_&&l.value!==gi)break;t.splice(n+1,1),e=!0}if(e)this.draw.render({isSetCursor:!1});else{const n=this.range.getIsCollapsed();this.draw.getCursor().drawCursor({isShow:n})}}setHTML(t){const{header:e,main:n,footer:i}=t,l=this.draw.getOriginalInnerWidth(),r=a=>a!==void 0?Hn(a,{innerWidth:l}):void 0;this.setValue({header:r(e),main:r(n),footer:r(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:l,trIndex:r,tdIndex:a,tdId:c,trId:d,tableId:u,endIndex:h}=n;this.position.setPositionContext({isTable:i,index:l,trIndex:r,tdIndex:a,tdId:c,trId:d,tableId:u}),this.range.setRange(h,h),this.draw.render({curIndex:h,isCompute:!1,isSubmitHistory:!1})}setZone(t){this.draw.getZone().setZone(t)}getControlValue(t){return this.draw.getControl().getValueById(t)}getButtonContent(t){const{controlId:e}=t;if(!e)return null;const n=this.findButtonControlContext(e);return n?this.getButtonContentResult(this.getButtonBusinessValue(n)):null}setButtonContent(t){if(!(this.draw.getMode()===s.EditorMode.FORM)&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{controlId:i,mode:l,isSubmitHistory:r=!0}=t;if(!i)return;const a=this.findButtonControlContext(i);if(!a)return;const c=this.getButtonBusinessValue(a),d=this.normalizeButtonContentValue(t.value),u=l==="append"?this.appendButtonContentValue(c,d):d;this.removeButtonBusinessElements(a);const h=this.findButtonControlContext(i);if(!h)return;const R=this.createButtonBusinessElements(h,u),T=this.replaceButtonRenderedValue(h,R,u);this.syncButtonPlaceholderElements(h.elementList,i,h.element.control?.placeholder||""),r||this.historyManager.recovery(),this.draw.render({curIndex:T,isSubmitHistory:r,isSetCursor:!0})}setControlValue(t){this.draw.getControl().setValueListById([t])}setControlValueList(t){this.draw.getControl().setValueListById(t)}setControlExtension(t){this.draw.getControl().setExtensionListById([t])}setControlExtensionList(t){this.draw.getControl().setExtensionListById(t)}setControlProperties(t){this.draw.getControl().setPropertiesListById([t])}setControlPropertiesList(t){this.draw.getControl().setPropertiesListById(t)}setControlHighlight(t){this.draw.getControl().setHighlightList(t),this.draw.render({isSubmitHistory:!1})}setControlQualityMarks(t){this.draw.getControl().setQualityMarks(t),this.draw.render({isSetCursor:!1,isSubmitHistory:!1})}updateOptions(t){const e=yo(t);Object.entries(e).forEach(([n,i])=>{Reflect.set(this.options,n,i)}),this.forceUpdate()}setFormModeTrace(t){Object.assign(this.options.modeRule.form,t),this.forceUpdate()}getControlList(){return this.draw.getControl().getList()}locationControl(t,e){if(!t)return;function n(r,a,c){let d=0;for(;d<r.length;){const u=r[d];if(d++,u.type===s.ElementType.TABLE){const R=u.trList;for(let T=0;T<R.length;T++){const g=R[T];for(let f=0;f<g.tdList.length;f++){const C=g.tdList[f],p=n(C.value,a,c);if(p)return{...p,positionContext:{isTable:!0,index:d-1,trIndex:T,tdIndex:f,tdId:C.id,trId:g.id,tableId:u.id}}}}}if(!c(u))continue;let h=d-1;if(e?.position===s.LocationPosition.OUTER_AFTER){if(!(u.controlComponent===s.ControlComponent.POSTFIX&&r[d+1]?.controlComponent!==s.ControlComponent.POST_TEXT))continue}else if(e?.position===s.LocationPosition.OUTER_BEFORE)h-=1;else if(e?.position===s.LocationPosition.AFTER){if(h-=1,u.controlComponent!==s.ControlComponent.PLACEHOLDER&&u.controlComponent!==s.ControlComponent.POSTFIX&&u.controlComponent!==s.ControlComponent.POST_TEXT)continue}else if(u.controlComponent!==s.ControlComponent.PREFIX&&u.controlComponent!==s.ControlComponent.PRE_TEXT||r[d]?.controlComponent===s.ControlComponent.PREFIX||r[d]?.controlComponent===s.ControlComponent.PRE_TEXT)continue;return{zone:a,range:{startIndex:h,endIndex:h},positionContext:{isTable:!1}}}return null}const i=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}],l=[r=>r.controlId===t,r=>r.control?.conceptId===t,r=>r.control?.code===t];for(let r=0;r<l.length;r++)for(const a of i){const c=n(a.elementList,a.zone,l[r]);if(c){this.setZone(c.zone),this.position.setPositionContext(c.positionContext),this.range.replaceRange(c.range),this.draw.render({curIndex:c.range.startIndex,isCompute:!1,isSubmitHistory:!1});return}}}insertTextField(t){if(this.draw.isReadonly()||this.draw.isDisabled()||!t)return;const n=rt(t),{startIndex:i}=this.range.getRange(),l=this.draw.getElementList(),r=Qn(l,i);if(!r)return;const a=[...In,...ce,...Wn,...un];dn(a,r,n),this.draw.insertElementTextField([n])}insertControl(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=rt(t),{startIndex:i}=this.range.getRange(),l=this.draw.getElementList(),r=Qn(l,i);if(!r)return;const a=l[i],c=a?.controlComponent===s.ControlComponent.POSTFIX||a?.controlComponent===s.ControlComponent.POSTTEXTFIX;let d=!1;if(a?.controlId&&!c)for(let h=i;h>=0;h--){const R=l[h];if(R.controlId!==a.controlId)break;if(R.controlComponent===s.ControlComponent.PRETEXTFIX||R.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){R.control?.type===s.ControlType.TEXTFIELD&&(d=!0);break}}if(!d&&!c){const h=l[i-1];if(h?.controlId)for(let R=i-1;R>=0;R--){const T=l[R];if(T.controlId!==h.controlId)break;if(T.controlComponent===s.ControlComponent.PRETEXTFIX||T.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){T.control?.type===s.ControlType.TEXTFIELD&&(d=!0);break}}}if(d&&t.control?.type===s.ControlType.TEXTFIELD)return;const u=[...In,...ce,...Wn,...un];dn(u,r,n),this.draw.insertElementList([n])}jumpControl(t){this.draw.getControl().initNextControl({direction:t?.direction})}getContainer(){return this.draw.getContainer()}getTitleValue(t){const{conceptId:e}=t,n=[],i=(r,a)=>{let c=0;for(;c<r.length;){const d=r[c];if(c++,d.type===s.ElementType.TABLE){const R=d.trList;for(let T=0;T<R.length;T++){const g=R[T];for(let f=0;f<g.tdList.length;f++){const C=g.tdList[f];i(C.value,a)}}}if(d?.title?.conceptId!==e)continue;const u=[];let h=c;for(;h<r.length;){const R=r[h];if(h++,d.titleId!==R.titleId){if(R.level&&Ni[R.level]<=Ni[d.level])break;u.push(R)}}n.push({...d.title,value:Pn(u),elementList:Ut(u),zone:a}),c=h}},l=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:r,elementList:a}of l)i(a,r);return n}getPositionContextByEvent(t,e={}){const n=t.target?.dataset.index;if(!n)return null;const{isMustDirectHit:i=!0}=e,l=Number(n),r=this.position.getPositionByXY({x:t.offsetX,y:t.offsetY,pageNo:l}),{isDirectHit:a,isTable:c,index:d,trIndex:u,tdIndex:h,tdValueIndex:R,zone:T}=r;if(i&&!a||T&&T!==this.zone.getZone())return null;let g=null,f=null;const C=this.draw.getOriginalElementList();let p=null;const I=this.position.getOriginalPositionList();if(c){const L=C[d].trList?.[u].tdList[h];f=L?.value[R]||null,p=L?.positionList?.[R]||null,g={element:C[d],trIndex:u,tdIndex:h}}else f=C[d]||null,p=I[d]||null;let m=null;if(p){const{pageNo:L,coordinate:{leftTop:O,rightTop:P},lineHeight:S}=p,y=this.draw.getOriginalHeight(),Y=this.draw.getOriginalPageGap();m={x:O[0],y:O[1]+L*(y+Y),width:P[0]-O[0],height:S}}return{pageNo:l,element:f,rangeRect:m,tableInfo:g}}insertTitle(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=rt(t),{startIndex:i}=this.range.getRange(),l=this.draw.getElementList(),r=Qn(l,i);if(!r)return;const a=[...In,...ce,...Wn,...un];n.valueList?.forEach(c=>{dn(a,r,c)}),this.draw.insertElementList([n])}focus(t){const{position:e=s.LocationPosition.AFTER,isMoveCursorToVisible:n=!0,rowNo:i,range:l}=t||{};let r=-1;if(l)this.range.replaceRange(l),r=e===s.LocationPosition.BEFORE?l.startIndex:l.endIndex;else if(Ei(i)){const c=this.draw.getOriginalRowList();if(r=e===s.LocationPosition.BEFORE?c[i]?.startIndex:c[i+1]?.startIndex-1,!Ei(r))return;this.range.setRange(r,r)}else r=e===s.LocationPosition.BEFORE?0:this.draw.getOriginalMainElementList().length-1,this.range.setRange(r,r);const a={isCompute:!1,isSetCursor:!1,isSubmitHistory:!1};n&&~r&&this.range.getIsCollapsed()&&(a.curIndex=r,a.isSetCursor=!0),this.draw.render(a)}insertArea(t){return this.draw.getArea().insertArea(t)}setAreaValue(t){return this.draw.getArea().setAreaValue(t)}setAreaProperties(t){this.draw.getArea().setAreaProperties(t)}locationArea(t,e){if(e?.isAppendLastLineBreak&&e?.position===s.LocationPosition.OUTER_AFTER){const l=this.draw.getOriginalMainElementList();l[l.length-1].areaId===t&&this.draw.appendElementList([{value:_}],{isSubmitHistory:!1})}const n=this.draw.getArea().getContextByAreaId(t,e);if(!n)return;const{range:{endIndex:i}}=n;this.position.setPositionContext({isTable:!1}),this.range.setRange(i,i),this.draw.render({curIndex:i,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1})}clearGraffiti(){this.draw.getGraffiti().clear(),this.draw.isGraffitiMode()&&this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1})}getMacroValue(t){const{id:e,dictCode:n,label:i,areaId:l}=t,r=[],a=(d,u)=>{for(const h of d){if(h.type===s.ElementType.TABLE){const T=h.trList;for(const g of T)for(const f of g.tdList)a(f.value,u);continue}if(h.type!==s.ElementType.MACRO&&h.type!==s.ElementType.CUSTOM_MACRO&&h.type!==s.ElementType.REUSABLE_ITEM||e&&h.id!==e||n&&h.dictCode!==n||i&&h.label!==i||l&&h.areaId!==l)continue;const R={id:h.id,type:h.type,label:h.label,dictCode:h.dictCode,zone:u};h.type===s.ElementType.MACRO?R.value=h.value:h.type===s.ElementType.CUSTOM_MACRO?(R.macroConfig=h.macroConfig,R.value=h.macroConfig?.value):h.type===s.ElementType.REUSABLE_ITEM&&(R.reusableItemConfig=h.reusableItemConfig,R.value=h.reusableItemConfig?.value),r.push(R)}},c=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:d,elementList:u}of c)a(u,d);return r}getMacroList(){const t=[],e=i=>{for(const l of i){if(l.type===s.ElementType.TABLE){const r=l.trList;for(const a of r)for(const c of a.tdList)e(c.value);continue}(l.type===s.ElementType.MACRO||l.type===s.ElementType.CUSTOM_MACRO||l.type===s.ElementType.REUSABLE_ITEM)&&t.push(l)}},n=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const i of n)e(i);return t}setMacroValue(t){const{id:e,dictCode:n,label:i,areaId:l,value:r,code:a,isSubmitHistory:c=!0}=t;let d=!1;const u=R=>{for(let T=0;T<R.length;T++){const g=R[T];if(g.type===s.ElementType.TABLE){const f=g.trList;for(const C of f)for(const p of C.tdList)u(p.value);continue}g.type!==s.ElementType.MACRO&&g.type!==s.ElementType.CUSTOM_MACRO&&g.type!==s.ElementType.REUSABLE_ITEM||e&&g.id!==e||n&&g.dictCode!==n||i&&g.label!==i||l&&g.areaId!==l||(d=!0,g.type===s.ElementType.MACRO?g.value=r:g.type===s.ElementType.CUSTOM_MACRO?g.macroConfig?(g.macroConfig.value=r,a!==void 0&&(g.macroConfig.code=a)):g.macroConfig={type:"text",value:r}:g.type===s.ElementType.REUSABLE_ITEM&&(g.reusableItemConfig?g.reusableItemConfig.value=r:g.reusableItemConfig={value:r}))}},h=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const R of h)u(R);d&&this.draw.render({isSubmitHistory:c,isSetCursor:!1})}setMacroValueList(t){if(!t.length)return;let e=!1,n=!1;const i=r=>{for(let a=0;a<r.length;a++){const c=r[a];if(c.type===s.ElementType.TABLE){const T=c.trList;for(const g of T)for(const f of g.tdList)i(f.value);continue}if(c.type!==s.ElementType.MACRO&&c.type!==s.ElementType.CUSTOM_MACRO&&c.type!==s.ElementType.REUSABLE_ITEM)continue;const d=t.find(T=>T.id&&c.id===T.id||T.dictCode&&c.dictCode===T.dictCode||T.label&&c.label===T.label||T.areaId&&c.areaId===T.areaId);if(!d)continue;const{value:u,code:h,isSubmitHistory:R=!0}=d;e=!0,R&&(n=!0),c.type===s.ElementType.MACRO?c.value=u:c.type===s.ElementType.CUSTOM_MACRO?c.macroConfig?(c.macroConfig.value=u,h!==void 0&&(c.macroConfig.code=h)):c.macroConfig={type:"text",value:u}:c.type===s.ElementType.REUSABLE_ITEM&&(c.reusableItemConfig?c.reusableItemConfig.value=u:c.reusableItemConfig={value:u})}},l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const r of l)i(r);e&&(n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1}))}updateMacroProperties(t){const{id:e,dictCode:n,label:i,areaId:l,properties:r,isSubmitHistory:a=!0}=t;let c=!1;const d=h=>{for(let R=0;R<h.length;R++){const T=h[R];if(T.type===s.ElementType.TABLE){const g=T.trList;for(const f of g)for(const C of f.tdList)d(C.value);continue}T.type!==s.ElementType.MACRO&&T.type!==s.ElementType.CUSTOM_MACRO&&T.type!==s.ElementType.REUSABLE_ITEM||e&&T.id!==e||n&&T.dictCode!==n||i&&T.label!==i||l&&T.areaId!==l||(c=!0,Object.assign(T,r))}},u=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const h of u)d(h);c&&this.draw.render({isSubmitHistory:a,isSetCursor:!1})}locationMacro(t){const{id:e,dictCode:n,label:i,areaId:l}=t,r=(c,d)=>{for(let u=0;u<c.length;u++){const h=c[u];if(h.type===s.ElementType.TABLE){const R=h.trList;for(let T=0;T<R.length;T++){const g=R[T];for(let f=0;f<g.tdList.length;f++){const C=g.tdList[f],p=r(C.value,d);if(p)return{...p,isTable:!0,index:u,trIndex:T,tdIndex:f,tableId:h.tableId,trId:g.id,tdId:C.id}}}}if(!(h.type!==s.ElementType.MACRO&&h.type!==s.ElementType.CUSTOM_MACRO&&h.type!==s.ElementType.REUSABLE_ITEM)&&!(e&&h.id!==e)&&!(n&&h.dictCode!==n)&&!(i&&h.label!==i)&&!(l&&h.areaId!==l))return{zone:d,index:u}}return null},a=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:c,elementList:d}of a){const u=r(d,c);if(u){this.setZone(u.zone),this.position.setPositionContext({isTable:u.isTable||!1,index:u.index,trIndex:u.trIndex,tdIndex:u.tdIndex,tableId:u.tableId,trId:u.trId,tdId:u.tdId}),this.range.replaceRange({startIndex:u.index,endIndex:u.index}),this.draw.render({curIndex:u.index,isCompute:!1,isSubmitHistory:!1});break}}}insertSubTemplate(t){const{label:e,templateId:n,content:i,conditions:l,relation:r="and",isSubmitHistory:a=!0}=t,c={id:ft(),value:e,type:s.ElementType.SUB_TEMPLATE,label:e,templateId:n,subTemplateContent:i?.map(d=>rt(d)),subTemplateRelation:r,subTemplateConditions:l?.map(d=>({...d})),subTemplateExpanded:this.options.mode===s.EditorMode.FORM&&!l?.length};this.insertElementList([c],{isSubmitHistory:a})}updateSubTemplate(t){const{id:e,properties:n,isSubmitHistory:i=!0}=t;if(!e)return;const l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];let r=!1;for(let a=0;a<l.length;a++)di(l[a],c=>{c.id!==e||c.type!==s.ElementType.SUB_TEMPLATE||(Object.assign(c,{...n,value:n.label??c.value,subTemplateContent:n.subTemplateContent?n.subTemplateContent.map(d=>rt(d)):c.subTemplateContent?.map(d=>rt(d)),subTemplateConditions:n.subTemplateConditions?n.subTemplateConditions.map(d=>({...d})):c.subTemplateConditions?.map(d=>({...d}))}),r=!0)});r&&this.draw.render({isSubmitHistory:i,isCompute:!0})}expandSubTemplate(t){const{id:e,content:n,isSubmitHistory:i=!0}=t,l=this.draw.getOriginalMainElementList();for(let r=0;r<l.length;r++){const a=l[r];if(a.type===s.ElementType.SUB_TEMPLATE&&(!e||a.id===e)){const c=n||a.subTemplateContent;if(!c?.length){console.warn("子模板内容为空,无法展开");return}a.subTemplateExpanded=!0,a.hide=!0;const d=rt(c);ee(d,{isHandleFirstElement:!1,editorOptions:this.options}),Ws(d,a),l.splice(r+1,0,...d),this.draw.render({isSubmitHistory:i,isCompute:!0});return}}}collapseSubTemplate(t){const{id:e,isSubmitHistory:n=!0}=t;this.draw.syncSubTemplateRuntimeContent();const i=this.draw.getOriginalMainElementList();for(let l=0;l<i.length;l++){const r=i[l];if(r.type===s.ElementType.SUB_TEMPLATE&&(!e||r.id===e)){r.subTemplateExpanded=!1,r.hide=!1;const a=this.draw.getSubTemplateRuntimeEndIndex(i,l,r.id);a>l+1&&i.splice(l+1,a-l-1),this.draw.render({isSubmitHistory:n,isCompute:!0});return}}}toggleSubTemplate(t){const{id:e,content:n,isSubmitHistory:i=!0}=t,l=this.draw.getOriginalMainElementList();for(let r=0;r<l.length;r++){const a=l[r];if(a.type===s.ElementType.SUB_TEMPLATE&&(!e||a.id===e)){a.subTemplateExpanded?this.collapseSubTemplate({id:e,isSubmitHistory:i}):this.expandSubTemplate({id:e,content:n,isSubmitHistory:i});return}}}}class tf{rangeStyleChange;visiblePageNoListChange;intersectionPageNoChange;pageSizeChange;pageScaleChange;saved;contentChange;controlChange;controlContentChange;pageModeChange;zoneChange;constructor(){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.controlContentChange=null,this.pageModeChange=null,this.zoneChange=null}}class ef{contextMenu;contextMenuList;getContextMenuList;shortcutList;langMap;constructor(t){const{contextMenu:e,shortcut:n,i18n:i}=t;this.contextMenu=e,this.contextMenuList=e.registerContextMenuList.bind(e),this.getContextMenuList=e.getContextMenuList.bind(e),this.shortcutList=n.registerShortcutList.bind(n),this.langMap=i.registerLangMap.bind(i)}disposeContextMenu(){this.contextMenu.dispose()}}const jl={SELECTED_TEXT:"%s"},no={GLOBAL:{CUT:"globalCut",COPY:"globalCopy",PASTE:"globalPaste",SELECT_ALL:"globalSelectAll",PRINT:"globalPrint"},CONTROL:{DELETE:"controlDelete",EDIT_ATTRIBUTE:"controlEditAttribute",COPY:"controlCopy",PASTE:"controlPaste"},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",TABLE_PROPERTIES:"tableProperties"}},{CONTROL:{DELETE:nf,EDIT_ATTRIBUTE:of,COPY:sf,PASTE:rf}}=no;function lf(o,t){if(t!==s.EditorMode.EDIT)return!1;const n=o?.control?.type,i=o?.controlComponent,l=n===s.ControlType.TEXT||n===s.ControlType.TEXTFIELD||n===s.ControlType.NUMBER||n===s.ControlType.SELECT||n===s.ControlType.DATE||n===s.ControlType.CHECKBOX||n===s.ControlType.RADIO||n===s.ControlType.BUTTON,r=i==="prefix"||i==="preText"||i==="preTextFix"||i==="textFixLabel"||n===s.ControlType.BUTTON&&(i==="value"||i==="placeholder");return l&&r}function ql(o){return o.hitElement||o.hitTableElement}const af=[s.ElementType.MENSTRUAL_HISTORY,s.ElementType.FETAL_HEART_POSITION,s.ElementType.TOOTH_POSITION];function cf(o){return af.includes(o?.type)||o?.type===s.ElementType.IMAGE&&!!o.controlId&&o.controlComponent==="value"}const df=[{key:sf,name:"复制控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&lf(o.startElement,o.options.mode),callback:(o,t)=>{const e=t.startElement?.controlId;e&&o.executeCopyControl(e)}},{key:rf,name:"粘贴控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.editorTextFocus&&o.options.mode===s.EditorMode.EDIT&&Uc(),callback:o=>{o.executePasteControl()}},{key:nf,i18nPath:"contextmenu.control.delete",when:o=>{const t=cf(o.startElement);return!o.isReadonly&&!o.editorHasSelection&&(!!o.startElement?.controlId||t)&&(o.options.mode!==s.EditorMode.FORM||t)},callback:o=>{o.executeRemoveControl()}},{key:of,i18nPath:"contextmenu.control.editAttribute",when:o=>{const t=ql(o);return!o.isReadonly&&!o.editorHasSelection&&o.options.mode===s.EditorMode.EDIT&&!!t},callback:(o,t)=>{const e=ql(t);e&&o.executeTriggerControlEditAttribute(e.controlId,e)}}],{GLOBAL:{CUT:uf,COPY:hf,PASTE:Rf,SELECT_ALL:gf,PRINT:Tf}}=no,ff=[{key:uf,i18nPath:"contextmenu.global.cut",shortCut:`${pn?"⌘":"Ctrl"} + X`,when:o=>!o.isReadonly,callback:o=>{o.executeCut()}},{key:hf,i18nPath:"contextmenu.global.copy",shortCut:`${pn?"⌘":"Ctrl"} + C`,when:o=>o.editorHasSelection||o.isCrossRowCol,callback:o=>{o.executeCopy()}},{key:Rf,i18nPath:"contextmenu.global.paste",shortCut:`${pn?"⌘":"Ctrl"} + V`,when:o=>!o.isReadonly&&o.editorTextFocus,callback:o=>{o.executePaste()}},{key:gf,i18nPath:"contextmenu.global.selectAll",shortCut:`${pn?"⌘":"Ctrl"} + A`,when:o=>o.editorTextFocus,callback:o=>{o.executeSelectAll()}},{isDivider:!0},{key:Tf,i18nPath:"contextmenu.global.print",icon:"print",when:()=>!0,callback:o=>{o.executePrint()}}],{HYPERLINK:{DELETE:mf,CANCEL:Cf,EDIT:pf}}=no,If=[{key:mf,i18nPath:"contextmenu.hyperlink.delete",when:o=>!o.isReadonly&&o.startElement?.type===s.ElementType.HYPERLINK,callback:o=>{o.executeDeleteHyperlink()}},{key:Cf,i18nPath:"contextmenu.hyperlink.cancel",when:o=>!o.isReadonly&&o.startElement?.type===s.ElementType.HYPERLINK,callback:o=>{o.executeCancelHyperlink()}},{key:pf,i18nPath:"contextmenu.hyperlink.edit",when:o=>!o.isReadonly&&o.startElement?.type===s.ElementType.HYPERLINK,callback:(o,t)=>{const e=window.prompt(o.executeTranslate("contextmenu.hyperlink.edit"),t.startElement?.url);e&&o.executeEditHyperlink(e)}}],{IMAGE:{CHANGE:Ef,SAVE_AS:Lf,TEXT_WRAP:Pf,TEXT_WRAP_EMBED:Mf,TEXT_WRAP_UP_DOWN:Of,TEXT_WRAP_SURROUND:Sf,TEXT_WRAP_FLOAT_TOP:Df,TEXT_WRAP_FLOAT_BOTTOM:Ff}}=no,Xf=[{key:Ef,i18nPath:"contextmenu.image.change",icon:"image-change",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===s.ElementType.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:Lf,i18nPath:"contextmenu.image.saveAs",icon:"image",when:o=>!o.editorHasSelection&&o.startElement?.type===s.ElementType.IMAGE,callback:o=>{o.executeSaveAsImageElement()}},{key:Pf,i18nPath:"contextmenu.image.textWrap",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===s.ElementType.IMAGE,childMenus:[{key:Mf,i18nPath:"contextmenu.image.textWrapType.embed",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,s.ImageDisplay.BLOCK)}},{key:Of,i18nPath:"contextmenu.image.textWrapType.upDown",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,s.ImageDisplay.INLINE)}},{key:Sf,i18nPath:"contextmenu.image.textWrapType.surround",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,s.ImageDisplay.SURROUND)}},{key:Df,i18nPath:"contextmenu.image.textWrapType.floatTop",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,s.ImageDisplay.FLOAT_TOP)}},{key:Ff,i18nPath:"contextmenu.image.textWrapType.floatBottom",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,s.ImageDisplay.FLOAT_BOTTOM)}}]}],{TABLE:{BORDER:yf,BORDER_ALL:Nf,BORDER_EMPTY:bf,BORDER_DASH:Vf,BORDER_EXTERNAL:Wf,BORDER_INTERNAL:Uf,BORDER_TD:Yf,BORDER_TD_TOP:wf,BORDER_TD_LEFT:vf,BORDER_TD_BOTTOM:Zf,BORDER_TD_RIGHT:Qf,BORDER_TD_BACK:Kf,BORDER_TD_FORWARD:Hf,VERTICAL_ALIGN:Af,VERTICAL_ALIGN_TOP:_f,VERTICAL_ALIGN_MIDDLE:Bf,VERTICAL_ALIGN_BOTTOM:kf,INSERT_ROW_COL:Gf,INSERT_TOP_ROW:xf,INSERT_BOTTOM_ROW:Jf,INSERT_LEFT_COL:$f,INSERT_RIGHT_COL:zf,DELETE_ROW_COL:jf,DELETE_ROW:qf,DELETE_COL:tm,DELETE_TABLE:em,MERGE_CELL:nm,CANCEL_MERGE_CELL:om}}=no,im=[{isDivider:!0},{key:yf,i18nPath:"contextmenu.table.border",icon:"border-all",when:o=>!o.isReadonly&&o.isInTable,childMenus:[{key:Nf,i18nPath:"contextmenu.table.borderAll",icon:"border-all",when:()=>!0,callback:o=>{o.executeTableBorderType(s.TableBorder.ALL)}},{key:bf,i18nPath:"contextmenu.table.borderEmpty",icon:"border-empty",when:()=>!0,callback:o=>{o.executeTableBorderType(s.TableBorder.EMPTY)}},{key:Vf,i18nPath:"contextmenu.table.borderDash",icon:"border-dash",when:()=>!0,callback:o=>{o.executeTableBorderType(s.TableBorder.DASH)}},{key:Wf,i18nPath:"contextmenu.table.borderExternal",icon:"border-external",when:()=>!0,callback:o=>{o.executeTableBorderType(s.TableBorder.EXTERNAL)}},{key:Uf,i18nPath:"contextmenu.table.borderInternal",icon:"border-internal",when:()=>!0,callback:o=>{o.executeTableBorderType(s.TableBorder.INTERNAL)}},{key:Yf,i18nPath:"contextmenu.table.borderTd",icon:"border-td",when:()=>!0,childMenus:[{key:wf,i18nPath:"contextmenu.table.borderTdTop",icon:"border-td-top",when:()=>!0,callback:o=>{o.executeTableTdBorderType(s.TdBorder.TOP)}},{key:Qf,i18nPath:"contextmenu.table.borderTdRight",icon:"border-td-right",when:()=>!0,callback:o=>{o.executeTableTdBorderType(s.TdBorder.RIGHT)}},{key:Zf,i18nPath:"contextmenu.table.borderTdBottom",icon:"border-td-bottom",when:()=>!0,callback:o=>{o.executeTableTdBorderType(s.TdBorder.BOTTOM)}},{key:vf,i18nPath:"contextmenu.table.borderTdLeft",icon:"border-td-left",when:()=>!0,callback:o=>{o.executeTableTdBorderType(s.TdBorder.LEFT)}},{key:Hf,i18nPath:"contextmenu.table.borderTdForward",icon:"border-td-forward",when:()=>!0,callback:o=>{o.executeTableTdSlashType(s.TdSlash.FORWARD)}},{key:Kf,i18nPath:"contextmenu.table.borderTdBack",icon:"border-td-back",when:()=>!0,callback:o=>{o.executeTableTdSlashType(s.TdSlash.BACK)}}]}]},{key:Af,i18nPath:"contextmenu.table.verticalAlign",icon:"vertical-align",when:o=>!o.isReadonly&&o.isInTable,childMenus:[{key:_f,i18nPath:"contextmenu.table.verticalAlignTop",icon:"vertical-align-top",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(s.VerticalAlign.TOP)}},{key:Bf,i18nPath:"contextmenu.table.verticalAlignMiddle",icon:"vertical-align-middle",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(s.VerticalAlign.MIDDLE)}},{key:kf,i18nPath:"contextmenu.table.verticalAlignBottom",icon:"vertical-align-bottom",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(s.VerticalAlign.BOTTOM)}}]},{key:Gf,i18nPath:"contextmenu.table.insertRowCol",icon:"insert-row-col",when:o=>!o.isReadonly&&o.isInTable,childMenus:[{key:xf,i18nPath:"contextmenu.table.insertTopRow",icon:"insert-top-row",when:()=>!0,callback:o=>{o.executeInsertTableTopRow()}},{key:Jf,i18nPath:"contextmenu.table.insertBottomRow",icon:"insert-bottom-row",when:()=>!0,callback:o=>{o.executeInsertTableBottomRow()}},{key:$f,i18nPath:"contextmenu.table.insertLeftCol",icon:"insert-left-col",when:()=>!0,callback:o=>{o.executeInsertTableLeftCol()}},{key:zf,i18nPath:"contextmenu.table.insertRightCol",icon:"insert-right-col",when:()=>!0,callback:o=>{o.executeInsertTableRightCol()}}]},{key:jf,i18nPath:"contextmenu.table.deleteRowCol",icon:"delete-row-col",when:o=>!o.isReadonly&&o.isInTable,childMenus:[{key:qf,i18nPath:"contextmenu.table.deleteRow",icon:"delete-row",when:()=>!0,callback:o=>{o.executeDeleteTableRow()}},{key:tm,i18nPath:"contextmenu.table.deleteCol",icon:"delete-col",when:()=>!0,callback:o=>{o.executeDeleteTableCol()}},{key:em,i18nPath:"contextmenu.table.deleteTable",icon:"delete-table",when:()=>!0,callback:o=>{o.executeDeleteTable()}}]},{key:nm,i18nPath:"contextmenu.table.mergeCell",icon:"merge-cell",when:o=>!o.isReadonly&&o.isCrossRowCol,callback:o=>{o.executeMergeTableCell()}},{key:om,i18nPath:"contextmenu.table.mergeCancelCell",icon:"merge-cancel-cell",when:o=>!o.isReadonly&&o.isInTable,callback:o=>{o.executeCancelMergeTableCell()}}];class sm{options;draw;command;range;position;i18n;container;contextMenuList;contextMenuContainerList;contextMenuRelationShip;context;constructor(t,e){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=[...ff,...im,...Xf,...df,...If],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){const{contextMenuDisableKeys:e}=this.options,n=[];for(let i=0;i<t.length;i++){const l=t[i];l.disable||l.key&&e.includes(l.key)||(l.isDivider||l.when?.(this.context))&&n.push(l)}return n}_proxyContextMenuEvent=t=>{this.context=this._getContext(t);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()};_handleSideEffect=t=>{const e=t.target;this.contextMenuContainerList.some(i=>i.contains(e))||this.dispose()};_getContext(t){const e=this.draw.isReadonly(),{isCrossRowCol:n,startIndex:i,endIndex:l}=this.range.getRange(),r=!!(~i||~l),a=r&&i!==l,{isTable:c,trIndex:d,tdIndex:u,index:h}=this.position.getPositionContext(),R=t?this.command.getPositionContextByEvent(t,{isMustDirectHit:!0}):null;let T=null;if(c){const P=this.draw.getOriginalElementList()[h]||null;P&&(T=Ut([P],{extraPickAttrs:["id"]})[0])}const g=c&&!!n,f=this.draw.getElementList();let C=f[i]||null,p=f[l]||null;R?.element&&(C=R.element,p=R.element);const I=R?.element||null,m=R?.tableInfo?.element||null;R?.tableInfo?.element&&(T=R.tableInfo.element);const L=this.draw.getZone().getZone();return{startElement:C,endElement:p,hitElement:I,hitTableElement:m,isReadonly:e,editorHasSelection:a,editorTextFocus:r,isCrossRowCol:g,zone:L,isInTable:c,trIndex:d??null,tdIndex:u??null,tableElement:T,options:this.options}}_createContextMenuContainer(){const t=document.createElement("div");return t.classList.add(`${st}-contextmenu-container`),t.setAttribute(ve,s.EditorComponent.CONTEXTMENU),this.container.append(t),t}_render(t){const{contextMenuList:e,left:n,top:i,parentMenuContainer:l}=t,r=this._createContextMenuContainer(),a=document.createElement("div");a.classList.add(`${st}-contextmenu-content`);let c=null;l&&this.contextMenuRelationShip.set(l,r);for(let L=0;L<e.length;L++){const O=e[L];if(O.isDivider){if(L!==0&&L!==e.length-1&&!e[L-1]?.isDivider){const P=document.createElement("div");P.classList.add(`${st}-contextmenu-divider`),a.append(P)}}else{const P=document.createElement("div");if(P.classList.add(`${st}-contextmenu-item`),O.childMenus){const b=this._filterMenuList(O.childMenus);b.some(V=>!V.isDivider)&&(P.classList.add(`${st}-contextmenu-sub-item`),P.onmouseenter=()=>{this._setHoverStatus(P,!0),this._removeSubMenu(r);const V=P.getBoundingClientRect(),N=V.left+V.width,X=V.top;c=this._render({contextMenuList:b,left:N,top:X,parentMenuContainer:r})},P.onmouseleave=V=>{(!c||!c.contains(V.relatedTarget))&&this._setHoverStatus(P,!1)})}else P.onmouseenter=()=>{this._setHoverStatus(P,!0),this._removeSubMenu(r)},P.onmouseleave=()=>{this._setHoverStatus(P,!1)},P.onclick=()=>{O.callback&&this.context&&O.callback(this.command,this.context),this.dispose()};const S=document.createElement("i");P.append(S),O.icon&&S.classList.add(`${st}-contextmenu-${O.icon}`);const y=document.createElement("span"),Y=O.i18nPath?this._formatName(this.i18n.t(O.i18nPath)):this._formatName(O.name||"");if(y.append(document.createTextNode(Y)),P.append(y),O.shortCut){const b=document.createElement("span");b.classList.add(`${st}-shortcut`),b.append(document.createTextNode(O.shortCut)),P.append(b)}a.append(P)}}const d=document.createElement("div");d.classList.add(`${st}-contextmenu-divider`),a.append(d);const u=document.createElement("div");u.classList.add(`${st}-contextmenu-item`),u.onmouseenter=()=>{this._setHoverStatus(u,!0),this._removeSubMenu(r)},u.onmouseleave=()=>{this._setHoverStatus(u,!1)},u.onclick=()=>{this.dispose()};const h=document.createElement("i");u.append(h);const R=document.createElement("span");R.append(document.createTextNode(this.i18n.t("contextmenu.global.cancel"))),u.append(R),a.append(u),r.append(a),r.style.display="block";const T=window.innerWidth,g=r.getBoundingClientRect(),f=g.width,C=n+f>T?n-f:n;r.style.left=`${C}px`;const p=window.innerHeight,I=g.height,m=i+I>p?i-I:i;return r.style.top=`${m}px`,this.contextMenuContainerList.push(r),r}_removeSubMenu(t){const e=this.contextMenuRelationShip.get(t);e&&(this._removeSubMenu(e),e.remove(),this.contextMenuRelationShip.delete(t))}_setHoverStatus(t,e){e?(t.parentNode?.querySelectorAll(`${st}-contextmenu-item`).forEach(n=>n.classList.remove("hover")),t.classList.add("hover")):t.classList.remove("hover")}_formatName(t){const e=Object.values(jl),n=new RegExp(`${e.join("|")}`);let i=t;if(n.test(i)){const l=new RegExp(jl.SELECTED_TEXT,"g");if(l.test(i)){const r=this.range.toString();i=i.replace(l,r)}}return i}registerContextMenuList(t){this.contextMenuList.push(...t)}dispose(){this.contextMenuContainerList.forEach(t=>t.remove()),this.contextMenuContainerList=[],this.contextMenuRelationShip.clear()}}const rm=[{key:s.KeyMap.X,ctrl:!0,shift:!0,callback:o=>{o.executeStrikeout()}},{key:s.KeyMap.LEFT_BRACKET,mod:!0,callback:o=>{o.executeSizeAdd()}},{key:s.KeyMap.RIGHT_BRACKET,mod:!0,callback:o=>{o.executeSizeMinus()}},{key:s.KeyMap.B,mod:!0,callback:o=>{o.executeBold()}},{key:s.KeyMap.I,mod:!0,callback:o=>{o.executeItalic()}},{key:s.KeyMap.U,mod:!0,callback:o=>{o.executeUnderline()}},{key:pn?s.KeyMap.COMMA:s.KeyMap.RIGHT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSuperscript()}},{key:pn?s.KeyMap.PERIOD:s.KeyMap.LEFT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSubscript()}},{key:s.KeyMap.L,mod:!0,callback:o=>{o.executeRowFlex(s.RowFlex.LEFT)}},{key:s.KeyMap.E,mod:!0,callback:o=>{o.executeRowFlex(s.RowFlex.CENTER)}},{key:s.KeyMap.R,mod:!0,callback:o=>{o.executeRowFlex(s.RowFlex.RIGHT)}},{key:s.KeyMap.J,mod:!0,callback:o=>{o.executeRowFlex(s.RowFlex.ALIGNMENT)}},{key:s.KeyMap.J,mod:!0,shift:!0,callback:o=>{o.executeRowFlex(s.RowFlex.JUSTIFY)}}],lm=[{key:s.KeyMap.ZERO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(null)}},{key:s.KeyMap.ONE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.FIRST)}},{key:s.KeyMap.TWO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.SECOND)}},{key:s.KeyMap.THREE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.THIRD)}},{key:s.KeyMap.FOUR,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.FOURTH)}},{key:s.KeyMap.FIVE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.FIFTH)}},{key:s.KeyMap.SIX,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.SIXTH)}}],am=[{key:s.KeyMap.I,shift:!0,mod:!0,callback:o=>{o.executeList(s.ListType.UL,s.ListStyle.DISC)}},{key:s.KeyMap.U,shift:!0,mod:!0,callback:o=>{o.executeList(s.ListType.OL)}}];class cm{draw;command;globalShortcutList;agentShortcutList;constructor(t,e){this.draw=t,this.command=e,this.globalShortcutList=[],this.agentShortcutList=[],this._addShortcutList([...rm,...lm,...am]),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)}_globalKeydown=t=>{this.globalShortcutList.length&&this.draw.isGlobalShortcutActive()&&this.draw.isTargetInsideEditor(t.target)&&this._execute(t,this.globalShortcutList)};_agentKeydown(t){this.agentShortcutList.length&&(this.draw.isInteractionSuspended()||this._execute(t,this.agentShortcutList))}_execute(t,e){for(let n=0;n<e.length;n++){const i=e[n];if((i.mod?Ae(t)===!!i.mod:t.ctrlKey===!!i.ctrl&&t.metaKey===!!i.meta)&&t.shiftKey===!!i.shift&&t.altKey===!!i.alt&&t.key.toLowerCase()===i.key.toLowerCase()){i.disable||(i?.callback?.(this.command),t.preventDefault());break}}}}class dm{editor;constructor(t){this.editor=t}use(t,e){t(this.editor,e)}}class um{eventHub;constructor(){this.eventHub=new Map}on(t,e){if(!t||typeof e!="function")return;const n=this.eventHub.get(t)||new Set;n.add(e),this.eventHub.set(t,n)}emit(t,e){if(!t)return;const n=this.eventHub.get(t);if(n){if(n.size===1)return[...n][0](e);n.forEach(i=>i(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}dangerouslyClearAll(){this.eventHub.clear()}}class hm{paste;copy;drop}class ta{command;version;listener;eventBus;override;register;destroy;use;draw;constructor(t,e,n={}){const i=yo(n);e=rt(e);let l=[],r=[],a=[],c=[];Array.isArray(e)?r=e:(l=e.header||[],r=e.main,a=e.footer||[],c=e.graffiti||[]),[l,r,a].forEach(g=>{ee(g,{editorOptions:i,isForceCompensation:!0})}),this.version=Cn,this.listener=new tf,this.eventBus=new um,this.override=new hm,this.draw=new GT(t,i,{header:l,main:r,footer:a,graffiti:c},this.listener,this.eventBus,this.override);const u=this.draw;this.command=new $l(new qT(u)),u.setCommand(this.command);const h=new sm(u,this.command),R=new cm(u,this.command);this.register=new ef({contextMenu:h,shortcut:R,i18n:u.getI18n()}),this.destroy=()=>{u.destroy(),R.removeEvent(),h.removeEvent(),this.eventBus.dangerouslyClearAll()};const T=new dm(this);this.use=T.use.bind(T)}setFormModeTrace(t){this.command.executeSetFormModeTrace(t)}pauseInteraction(){this.draw.pauseInteraction()}resumeInteraction(){this.draw.resumeInteraction()}setOverlayActive(t){this.draw.setOverlayActive(t)}suspendGlobalShortcut(t){this.draw.suspendGlobalShortcut(t)}}s.Command=$l,s.EDITOR_CLIPBOARD=so,s.EDITOR_COMPONENT=ve,s.Editor=ta,s.INTERNAL_CONTEXT_MENU_KEY=no,s.INTERNAL_SHORTCUT_KEY=br,s.LETTER_CLASS=Ti,s.createDomFromElementList=Kn,s.default=ta,s.getElementListByHTML=Hn,s.getTextFromElementList=Pn,s.splitText=Nt,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
584
+ `?_:l[d];e.splice(c+d,0,{...a,value:u})}}}const{endIndex:i}=this.range.getRange();this.draw.render({curIndex:i,isSetCursor:!0})}}delButton(t,e){return new Promise(n=>{for(let i=t.length-1;i>=0;i--)e.some(r=>r.controlId===t[i].controlId&&r.type===t[i].type)&&t.splice(i,1);n(!0)})}editButton(t,e,n){const i=this.draw.getElementList();n=n+1;for(let d=0;d<e.label.length;d++){const u={value:e.label[d],controlId:e.controlId,type:s.ElementType.CONTROL,control:{type:"button",buttonLabel:e.label,code:e.code,value:[{value:e.label}],label:e.label,hide:!1},controlComponent:"value",color:"#fff",highlight:"#1677FF",style:"16px Microsoft YaHei",hide:!1};i.splice(n+d,0,u)}const{startIndex:l,endIndex:r}=this.range.getRange(),a=!0,c=r;this.draw.render({curIndex:c,isSetCursor:a})}removeButtonElementsByControlId(t){return new Promise(e=>{const n=this.draw.getElementList();for(let c=n.length-1;c>=0;c--)n[c].controlId===t&&n.splice(c,1);const{startIndex:i,endIndex:l}=this.range.getRange(),r=!0,a=l;this.draw.render({curIndex:a,isSetCursor:r}),e(!0)})}removeByValue(t,e){return new Promise(n=>{for(let c=t.length-1;c>=0;c--)(t[c].type=="control"||t[c].type=="text"||t[c].type=="buttonText")&&t[c].control?.buttonLabel===e&&t[c].control?.buttonText&&t.splice(c,1);const{startIndex:i,endIndex:l}=this.range.getRange(),r=!0,a=l;this.draw.render({curIndex:a,isSetCursor:r}),n(!0)})}insertButtonValue(t){const e=this.draw.getElementList(),n=t.controlId,l=(Array.isArray(t.element)?t.element:t.elementList||[t.element])[0],r=l.newButtonValue,a=l.control.buttonLabel,c=l.control.code;if(!r||!r.length)return;let d=-1;for(let I=0;I<e.length;I++)if(e[I].controlId===n&&e[I].control?.type==="button"){d=I;break}if(d===-1)return;const u=n+"_text",h=[];for(let I=0;I<r.length;I++){const m=r[I];h.push({value:m.value,code:m.code})}const R={type:"button",buttonLabel:a,buttonText:!0,label:a,code:c,value:h,hide:!1},T=[];T.push({value:"[",controlId:u,type:s.ElementType.CONTROL,control:R,controlComponent:s.ControlComponent.PREFIX,color:"#1677FF",hide:!1});for(let I=0;I<r.length;I++){const m=r[I],L=r.length>1?`${I+1}.${m.value}`:m.value,O=Nt(L);for(let P=0;P<O.length;P++)T.push({value:O[P],controlId:u,type:s.ElementType.CONTROL,control:R,controlComponent:s.ControlComponent.VALUE,color:"#000",hide:!1});r.length>1&&I<r.length-1&&T.push({value:_,controlId:u,type:s.ElementType.CONTROL,control:R,controlComponent:s.ControlComponent.VALUE,color:"#000",hide:!1})}T.push({value:"]",controlId:u,type:s.ElementType.CONTROL,control:R,controlComponent:s.ControlComponent.POSTFIX,color:"#1677FF",hide:!1});for(let I=0;I<T.length;I++)e.splice(d+I,0,T[I]);const{startIndex:g,endIndex:f}=this.range.getRange(),C=!0,p=f;this.draw.render({curIndex:p,isSetCursor:C})}font(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length)l.forEach(r=>{r.font=t}),this.draw.render({isSetCursor:!1});else{let r=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({font:t}),d?.value===_?d.font=t:r=!1,this.draw.render({isSubmitHistory:r,curIndex:a,isCompute:!1})}}size(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{minSize:l,maxSize:r,defaultSize:a}=this.options;if(t<l||t>r)return;let c={},d=[];const u=this.range.getTextLikeSelectionElementList();if(u?.length)d=u,c={isSetCursor:!1};else{const{endIndex:R}=this.range.getRange(),g=this.draw.getElementList()[R];this.range.setDefaultStyle({size:t}),g?.value===_?(d.push(g),c={curIndex:R}):this.draw.render({curIndex:R,isCompute:!1,isSubmitHistory:!1})}if(!d.length)return;let h=!1;d.forEach(R=>{!R.size&&t===a||R.size&&R.size===t||(R.size=t,h=!0)}),h&&this.draw.render(c)}sizeAdd(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,maxSize:l}=this.options,r=this.range.getTextLikeSelectionElementList();let a={},c=[];if(r?.length)c=r,a={isSetCursor:!1};else{const{endIndex:u}=this.range.getRange(),R=this.draw.getElementList()[u],g=this.range.getDefaultStyle()?.size||R.size||i;this.range.setDefaultStyle({size:g+2>l?l:g+2}),R?.value===_?(c.push(R),a={curIndex:u}):this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(u=>{u.size||(u.size=i),!(u.size>=l)&&(u.size+2>l?u.size=l:u.size+=2,d=!0)}),d&&this.draw.render(a)}sizeMinus(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,minSize:l}=this.options,r=this.range.getTextLikeSelectionElementList();let a={},c=[];if(r?.length)c=r,a={isSetCursor:!1};else{const{endIndex:u}=this.range.getRange(),R=this.draw.getElementList()[u],g=this.range.getDefaultStyle()?.size||R.size||i;this.range.setDefaultStyle({size:g-2<l?l:g-2}),R?.value===_?(c.push(R),a={curIndex:u}):this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let d=!1;c.forEach(u=>{u.size||(u.size=i),!(u.size<=l)&&(u.size-2<l?u.size=l:u.size-=2,d=!0)}),d&&this.draw.render(a)}bold(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const l=i.findIndex(r=>!r.bold);i.forEach(r=>{r.bold=!!~l}),this.draw.render({isSetCursor:!1})}else{let l=!0;const{endIndex:r}=this.range.getRange(),c=this.draw.getElementList()[r];this.range.setDefaultStyle({bold:c.bold?!1:!this.range.getDefaultStyle()?.bold}),c?.value===_?c.bold=!c.bold:l=!1,this.draw.render({isSubmitHistory:l,curIndex:r,isCompute:!1})}}italic(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const l=i.findIndex(r=>!r.italic);i.forEach(r=>{r.italic=!!~l}),this.draw.render({isSetCursor:!1})}else{let l=!0;const{endIndex:r}=this.range.getRange(),c=this.draw.getElementList()[r];this.range.setDefaultStyle({italic:c.italic?!1:!this.range.getDefaultStyle()?.italic}),c?.value===_?c.italic=!c.italic:l=!1,this.draw.render({isSubmitHistory:l,curIndex:r,isCompute:!1})}}underline(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length){const r=l.some(a=>!a.underline||!t&&a.textDecoration||t&&!a.textDecoration||t&&a.textDecoration&&!Oa(a.textDecoration,t));l.forEach(a=>{a.underline=r,r&&t?a.textDecoration=t:delete a.textDecoration}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let r=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({underline:d?.underline?!1:!this.range.getDefaultStyle()?.underline}),d?.value===_?d.underline=!d.underline:r=!1,this.draw.render({isSubmitHistory:r,curIndex:a,isCompute:!1})}}strikeout(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const l=i.findIndex(r=>!r.strikeout);i.forEach(r=>{r.strikeout=!!~l}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let l=!0;const{endIndex:r}=this.range.getRange(),c=this.draw.getElementList()[r];this.range.setDefaultStyle({strikeout:c.strikeout?!1:!this.range.getDefaultStyle()?.strikeout}),c?.value===_?c.strikeout=!c.strikeout:l=!1,this.draw.render({isSubmitHistory:l,curIndex:r,isCompute:!1})}}superscript(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(!i)return;const l=i.findIndex(r=>r.type===s.ElementType.SUPERSCRIPT);i.forEach(r=>{~l?r.type===s.ElementType.SUPERSCRIPT&&(r.type=s.ElementType.TEXT,delete r.actualSize):(!r.type||r.type===s.ElementType.TEXT||r.type===s.ElementType.SUBSCRIPT)&&(r.type=s.ElementType.SUPERSCRIPT)}),this.draw.render({isSetCursor:!1})}subscript(t){const{isIgnoreDisabledRule:e=!1}=t||{};if(!e&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(!i)return;const l=i.findIndex(r=>r.type===s.ElementType.SUBSCRIPT);i.forEach(r=>{~l?r.type===s.ElementType.SUBSCRIPT&&(r.type=s.ElementType.TEXT,delete r.actualSize):(!r.type||r.type===s.ElementType.TEXT||r.type===s.ElementType.SUPERSCRIPT)&&(r.type=s.ElementType.SUBSCRIPT)}),this.draw.render({isSetCursor:!1})}color(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length)l.forEach(r=>{t?r.color=t:delete r.color}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let r=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({color:t||void 0}),d?.value===_?t?d.color=t:delete d.color:r=!1,this.draw.render({isSubmitHistory:r,curIndex:a,isCompute:!1})}}highlight(t,e){const{isIgnoreDisabledRule:n=!1}=e||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length)l.forEach(r=>{t?r.highlight=t:delete r.highlight}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let r=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];this.range.setDefaultStyle({highlight:t||void 0}),d?.value===_?t?d.highlight=t:delete d.highlight:r=!1,this.draw.render({isSubmitHistory:r,curIndex:a,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 l=this.draw.getElementList(),r=n===i?this.range.getRangeParagraphElementList():l.slice(n+1,i+1);if(!r||!r.length)return;const a=ft(),c=this.draw.getOptions().title;r.forEach(h=>{!h.type&&h.value===_||(t?(h.level=t,h.titleId=a,Yo(h)&&(h.size=c[er[t]],h.bold=!0)):h.titleId&&(delete h.titleId,delete h.title,delete h.level,delete h.size,delete h.bold))});const d=n===i,u=d?i:n;this.draw.render({curIndex:u,isSetCursor:d})}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 l=this.range.getRangeRowElementList();if(!l)return;l.forEach(c=>{c.rowFlex=t});const r=n===i,a=r?i:n;this.draw.render({curIndex:a,isSetCursor:r})}vertical(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const l=this.range.getRangeRowElementList();if(!l)return;l.forEach(c=>{c.vertical=t});const r=n===i,a=r?i:n;this.draw.render({curIndex:a,isSetCursor:r})}rowMargin(t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const l=this.range.getRangeRowElementList();if(!l)return;l.forEach(c=>{c.rowMargin=t});const r=n===i,a=r?i:n;this.draw.render({curIndex:a,isSetCursor:r})}insertTable(t,e,n=!1){this.draw.isReadonly()||this.draw.isDisabled()||this.getIsRangeInTextField()||this.control.getActiveControl()||this.tableOperate.insertTable(t,e,n)}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()}splitVerticalTableCell(){this.draw.isReadonly()||this.tableOperate.splitVerticalTableCell()}splitHorizontalTableCell(){this.draw.isReadonly()||this.tableOperate.splitHorizontalTableCell()}tableTdVerticalAlign(t){this.draw.isReadonly()||this.tableOperate.tableTdVerticalAlign(t)}tableBorderType(t){this.draw.isReadonly()||this.tableOperate.tableBorderType(t)}tableBorderColor(t){this.draw.isReadonly()||this.tableOperate.tableBorderColor(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()}tableProperties(){this.draw.isReadonly()||this.tableOperate.tableProperties()}hyperlink(t){const{valueList:e,url:n,hyperlinkId:i}=t;if(!n||!e?.length||this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl())return;const{startIndex:a,endIndex:c}=this.range.getRange();!~a&&!~c||this.insertElementList([{type:s.ElementType.HYPERLINK,value:"",valueList:e,url:n,hyperlinkId:i||ft()}])}getHyperlinkRange(){let t=-1,e=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const l=this.draw.getElementList(),r=l[n];if(r.type!==s.ElementType.HYPERLINK)return null;let a=n;for(;a>0;){if(l[a].hyperlinkId!==r.hyperlinkId){t=a+1;break}a--}let c=n+1;for(;c<l.length;){if(l[c].hyperlinkId!==r.hyperlinkId){e=c-1;break}c++}return c===l.length&&(e=c-1),!~t||!~e?null:[t,e]}deleteHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.getHyperlinkRange();if(!e)return;const n=this.draw.getElementList(),[i,l]=e;this.draw.spliceElementList(n,i,l-i+1),this.draw.getHyperlinkParticle().clearHyperlinkPopup();const r=i-1;this.range.setRange(r,r),this.draw.render({curIndex:r})}cancelHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const e=this.getHyperlinkRange();if(!e)return;const n=this.draw.getElementList(),[i,l]=e;for(let a=i;a<=l;a++){const c=n[a];delete c.type,delete c.url,delete c.hyperlinkId,delete c.underline}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r,isCompute:!1})}editHyperlink(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=this.getHyperlinkRange();if(!n)return;const i=this.draw.getElementList(),[l,r]=n;for(let c=l;c<=r;c++){const d=i[c];d.url=t}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:a}=this.range.getRange();this.draw.render({curIndex:a,isCompute:!1})}separator(t,e){if(this.draw.isReadonly()||this.draw.isDisabled()||this.getIsRangeInTextField()||this.control.getActiveControl())return;const{startIndex:l,endIndex:r}=this.range.getRange();if(!~l&&!~r)return;const a=this.draw.getElementList();let c=-1;const d=a[r+1];if(d&&d.type===s.ElementType.SEPARATOR){if(d.dashArray&&d.dashArray.join()===t.join())return;c=r,Object.assign(d,{dashArray:t,...e})}else{const u={value:Zs,type:s.ElementType.SEPARATOR,dashArray:t,...e};le(a,[u],l,{editorOptions:this.options}),l!==0&&a[l].value===_?(this.draw.spliceElementList(a,l,1,[u]),c=l-1):(this.draw.spliceElementList(a,l+1,0,[u]),c=l)}this.range.setRange(c,c),this.draw.render({curIndex:c})}pageBreak(){this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl()||this.insertElementList([{type:s.ElementType.PAGE_BREAK,value:Zs}])}addWatermark(t){if(this.draw.isReadonly())return;const n=this.draw.getOptions(),{color:i,size:l,opacity:r,font:a,gap:c}=Vi;n.watermark.data=t.data,n.watermark.type=t.type||s.WatermarkType.TEXT,t.width&&(n.watermark.width=t.width),t.height&&(n.watermark.height=t.height),n.watermark.color=t.color||i,n.watermark.opacity=t.opacity||r,n.watermark.size=t.size||l,n.watermark.font=t.font||a,n.watermark.repeat=!!t.repeat,t.numberType&&(n.watermark.numberType=t.numberType),n.watermark.gap=t.gap||c,this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1})}deleteWatermark(){if(this.draw.isReadonly())return;const e=this.draw.getOptions();e.watermark&&e.watermark.data&&(e.watermark={...Vi},this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1}))}image(t){if(this.draw.isReadonly()||this.draw.isDisabled())return null;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=this.draw.getElementList()[n],a=r?.control?.type===s.ControlType.TEXT||r?.control?.type===s.ControlType.TEXTFIELD;a&&this.range.getRangeRowElementList()?.forEach(d=>{d.vertical=s.VerticalAlign.MIDDLE});const c=t.id||ft();return this.insertElementList([{...t,id:c,type:s.ElementType.IMAGE,vertical:a?s.VerticalAlign.MIDDLE:void 0}]),c}search(t,e){this.searchManager.setSearchKeyword(t,e),this.draw.render({isSubmitHistory:!1})}searchNavigatePre(){this.searchManager.searchNavigatePre()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}searchNavigateNext(){this.searchManager.searchNavigateNext()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}getSearchNavigateInfo(){return this.searchManager.getSearchNavigateInfo()}replace(t,e){this.draw.getSearch().replace(t,e)}async print(){const{scale:t,printPixelRatio:e,paperDirection:n,width:i,height:l}=this.options;t!==1&&this.draw.setPageScale(1);const r=await this.draw.getDataURL({pixelRatio:e,mode:s.EditorMode.PRINT});JT(r,{width:i,height:l,direction:n}),t!==1&&this.draw.setPageScale(t)}replaceImageElement(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==s.ElementType.IMAGE||(i.value=t,this.draw.render({isSetCursor:!1}))}saveAsImageElement(){const{startIndex:t}=this.range.getRange(),n=this.draw.getElementList()[t];!n||n.type!==s.ElementType.IMAGE||As(n.value,`${n.id}.png`)}setImageCrop(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==s.ElementType.IMAGE||(i.imgCrop=t,this.draw.render({isSetCursor:!1,isCompute:!1}))}setImageCaption(t){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];i?.type===s.ElementType.IMAGE&&(i.imgCaption=t,this.draw.render({isSetCursor:!1}))}changeImageDisplay(t,e){if(t.imgDisplay===e)return;t.imgDisplay=e;const{startIndex:n,endIndex:i}=this.range.getRange();if(e===s.ImageDisplay.SURROUND||e===s.ImageDisplay.FLOAT_TOP||e===s.ImageDisplay.FLOAT_BOTTOM){const l=this.position.getPositionList(),{pageNo:r,coordinate:{leftTop:a}}=l[n];t.imgFloatPosition={pageNo:r,x:a[0],y:a[1]}}else delete t.imgFloatPosition;this.draw.getPreviewer().clearResizer(),this.draw.render({isSetCursor:!0,curIndex:i})}getImage(t){return this.draw.getDataURL(t)}getPageMode(){return this.options}getOptions(){return this.options}getValue(t){return this.draw.getValue(t)}getValueAsync(t){return this.draw.getWorkerManager().getValue(t)}getAreaValue(t){return this.draw.getArea().getAreaValue(t)}getHTML(){const t=this.options,e=this.draw.getHeaderElementList(),n=this.draw.getOriginalMainElementList(),i=this.draw.getFooterElementList();return{header:Hn(e,t).innerHTML,main:Hn(n,t).innerHTML,footer:Hn(i,t).innerHTML}}getText(){const t=this.options,e=this.draw.getHeaderElementList(),n=this.draw.getOriginalMainElementList(),i=this.draw.getFooterElementList();return{header:Pn(e,t),main:Pn(n,t),footer:Pn(i,t)}}getWordCount(){return this.workerManager.getWordCount()}getCursorPosition(){return this.position.getCursorPosition()}getRemainingContentHeight(){if(!this.draw.getIsPagingMode())return 0;const t=this.draw.getPageRowList(),e=t.length-1,i=(t[e]||[]).reduce((c,d)=>c+d.height+(d.offsetY||0),0),l=this.draw.getHeight(),r=this.draw.getMainOuterHeight(),a=l-(r+i);return a>0?a:0}computeElementListHeight(t){if(!t.length)return 0;const e=this.draw.getInnerWidth();if(e<=0)return 0;const n=rt(t);ee(n,{isHandleFirstElement:!1,editorOptions:this.options});const i=Qi(n);return this.draw.computeRowList({innerWidth:e,elementList:n,surroundElementList:i}).reduce((r,a)=>r+a.height+(a.offsetY||0),0)}getRange(){return rt(this.range.getRange())}getRangeText(){return this.range.toString()}getRangeContext(){const t=this.range.getRange(),{startIndex:e,endIndex:n}=t;if(!~e&&!~n)return null;const i=e===n,l=this.range.toString(),r=Ut(this.range.getSelectionElementList()||[]),a=this.draw.getElementList(),c=hn(a[i?e:e+1],{extraPickAttrs:["id","controlComponent"]}),d=hn(a[n],{extraPickAttrs:["id","controlComponent"]}),u=this.draw.getRowList(),h=this.position.getPositionList(),R=h[e],T=h[n],g=R?.pageNo,f=T?.pageNo,C=R?.rowIndex,p=T?.rowIndex,I=u[C],m=u[p];let L=0,O=0;this.draw.getCursor().getHitLineStartIndex()||(L=I?.elementList[0]?.value===_?R?.index-I?.startIndex:R?.index-I?.startIndex+1),R===T?O=L:O=m.elementList[0]?.value===_?T.index-m.startIndex:T.index-m.startIndex+1;const P=[],S=this.draw.getOriginalHeight(),y=this.draw.getOriginalPageGap(),Y=this.position.getSelectionPositionList();if(Y){let Z=null,Q=0,W=null;for(let K=0;K<Y.length;K++){const{rowNo:k,pageNo:B,coordinate:{leftTop:H,rightTop:A},lineHeight:v}=Y[K];Z===null||Z!==k?(W&&P.push(W),W={x:H[0],y:H[1]+B*(S+y),width:A[0]-H[0],height:v},Z=k,Q=H[0]):W.width=A[0]-Q,K===Y.length-1&&W&&P.push(W)}}else{const Q=this.position.getPositionList()[n],{coordinate:{rightTop:W},pageNo:K,lineHeight:k}=Q;P.push({x:W[0],y:W[1]+K*(S+y),width:0,height:k})}const b=this.draw.getZone().getZone(),{isTable:M,trIndex:V,tdIndex:N,index:X}=this.position.getPositionContext();let D=null;if(M){const Q=this.draw.getOriginalElementList()[X]||null;Q&&(D=Ut([Q])[0])}let E=null,U=null,F=e-1;for(;F>0;){const Z=a[F],Q=a[F-1];if(Z.titleId&&Z.titleId!==Q?.titleId){E=Z.titleId,U=h[F].pageNo;break}F--}return rt({isCollapsed:i,startElement:c,endElement:d,startPageNo:g,endPageNo:f,startRowNo:C,endRowNo:p,startColNo:L,endColNo:O,rangeRects:P,zone:b,isTable:M,trIndex:V??null,tdIndex:N??null,tableElement:D,selectionText:l,selectionElementList:r,titleId:E,titleStartPageNo:U})}getRangeRow(){const t=this.range.getRangeRowElementList();return t?Ut(t):null}getRangeParagraph(){const t=this.range.getRangeParagraphElementList();return t?Ut(t):null}getKeywordRangeList(t){return this.range.getKeywordRangeList(t)}getKeywordContext(t){const e=this.getKeywordRangeList(t);if(!e.length)return null;const n=[],i=this.position.getOriginalMainPositionList(),l=this.draw.getOriginalMainElementList();for(let r=0;r<e.length;r++){const a=e[r],{startIndex:c,endIndex:d,tableId:u,startTrIndex:h,startTdIndex:R}=a;let T=i;if(a.tableId){const C=l.find(p=>p.id===u);C&&(T=C.trList?.[h]?.tdList?.[R]?.positionList||[])}const g=rt(T[c]),f=rt(T[d]);n.push({range:a,startPosition:g,endPosition:f})}return n}pageMode(t){this.draw.setPageMode(t)}pageScale(t){t!==this.options.scale&&this.draw.setPageScale(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)}setMainBadge(t){this.draw.getBadge().setMainBadge(t),this.draw.render({isCompute:!1,isSubmitHistory:!1})}setAreaBadge(t){this.draw.getBadge().setAreaBadgeMap(t),this.draw.render({isCompute:!1,isSubmitHistory:!1})}insertElementList(t,e={}){if(!t.length||this.draw.isReadonly()||this.draw.isDisabled())return;const{isReplace:i=!0,ignoreContextKeys:l}=e;i||this.range.shrinkRange();const r=rt(t),{startIndex:a}=this.range.getRange(),c=this.draw.getElementList();le(c,r,a,{ignoreContextKeys:l,isBreakWhenWrap:!0,editorOptions:this.options}),this.draw.insertElementList(r,e)}appendElementList(t,e){!t.length||this.draw.isReadonly()||this.draw.appendElementList(rt(t),e)}updateElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;const i=[];function l(a,c=!1){let d=0;for(;d<a.length;){const u=a[d];if(d++,u.type===s.ElementType.TABLE){const h=u.trList;for(let R=0;R<h.length;R++){const T=h[R];for(let g=0;g<T.tdList.length;g++){const f=T.tdList[g];l(f.value,c)}}}u.type===s.ElementType.CONTROL&&u.control?.value&&l(u.control.value,!0),(e&&u.id===e||n&&u.conceptId===n)&&i.push({elementList:a,index:d-1,isInsideControl:c})}}const r=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const a of r)l(a);if(i.length){for(let a=0;a<i.length;a++){const{elementList:c,index:d,isInsideControl:u}=i[a],h=c[d],R=h.controlId&&h.controlComponent===s.ControlComponent.VALUE;if(u||R){if(Object.assign(h,t.properties),h.id){const T=sr(h.id);T&&Object.assign(T,t.properties)}}else{const T=Ut([{...h,...t.properties}],{extraPickAttrs:["id"]});T.length>0&&T[0]?(dn(un,h,T[0]),ee(T,{isHandleFirstElement:!1,editorOptions:this.options}),c[d]=T[0]):Object.assign(h,t.properties)}}this.draw.render({isSetCursor:!1})}}deleteElementById(t){const{id:e,conceptId:n}=t;if(!e&&!n)return;let i=!1;function l(a){let c=0;for(;c<a.length;){const d=a[c];if(d.type===s.ElementType.TABLE){const u=d.trList;for(let h=0;h<u.length;h++){const R=u[h];for(let T=0;T<R.tdList.length;T++){const g=R.tdList[T];l(g.value)}}}d.type===s.ElementType.CONTROL&&d.control?.value&&l(d.control.value),(e&&d.id===e||n&&d.conceptId===n)&&(i=!0,a.splice(c,1),c--),c++}}const r=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const a of r)l(a);i&&this.draw.render({isSetCursor:!1})}getElementById(t){const{id:e,conceptId:n}=t,i=[];if(!e&&!n)return i;const l=new Set,r=new Set,a=d=>{let u=0;for(;u<d.length;){const h=d[u];if(u++,!l.has(h)){if(l.add(h),h.type===s.ElementType.TABLE){const R=h.trList;for(let T=0;T<R.length;T++){const g=R[T];for(let f=0;f<g.tdList.length;f++){const C=g.tdList[f];a(C.value)}}}if(h.valueList?.length&&a(h.valueList),h.control?.value?.length&&a(h.control.value),!(e&&h.id!==e||n&&h.conceptId!==n)){if(e&&h.id){if(r.has(h.id))continue;r.add(h.id)}i.push(h)}}}},c=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const d of c)a(d);return Ut(i,{extraPickAttrs:["id"]})}setValue(t,e){this.draw.setValue(t,e)}removeControl(t){if(t?.id||t?.conceptId){const{id:e,conceptId:n}=t;let i=!1;const l=a=>{let c=a.length-1;for(;c>=0;){const d=a[c];if(d.type===s.ElementType.TABLE){const u=d.trList;for(let h=0;h<u.length;h++){const R=u[h];for(let T=0;T<R.tdList.length;T++){const g=R.tdList[T];l(g.value)}}}c--,!(!d.control||e&&d.controlId!==e||n&&d.control.conceptId!==n)&&(i=!0,a.splice(c+1,1))}},r=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const a of r)l(a);i&&this.draw.render({isSetCursor:!1})}else{const{startIndex:e,endIndex:n}=this.range.getRange();if(e!==n)return;const i=this.draw.getElementList(),l=i[e],r=vo(i,e,"leading");if(r!==-1){const u=On(i,r,this.draw);if(u===null)return;this.range.setRange(u,u),this.draw.render({curIndex:u});return}if(l?.type===s.ElementType.MENSTRUAL_HISTORY||l?.type===s.ElementType.FETAL_HEART_POSITION||l?.type===s.ElementType.TOOTH_POSITION||l?.type===s.ElementType.IMAGE&&!!l.controlId&&l.controlComponent==="value"){this.draw.spliceElementList(i,e,1);const u=Math.max(0,e-1);this.range.setRange(u,u),this.draw.render({curIndex:u});return}if(!l?.controlId)return;const d=this.draw.getControl().removeControl(e);if(d===null)return;this.range.setRange(d,d),this.draw.render({curIndex:d})}}translate(t){return this.i18n.t(t)}setLocale(t){this.i18n.setLocale(t)}getLocale(){return this.i18n.getLocale()}getCatalog(){return this.workerManager.getCatalog()}locationCatalog(t){const e=this.draw.getOriginalElementList();function n(p,I){for(let m=0;m<p.length;m++){const L=p[m];if(L.type===s.ElementType.TABLE){const O=L.trList;for(let P=0;P<O.length;P++){const S=O[P];for(let y=0;y<S.tdList.length;y++){const Y=S.tdList[y],b=n(Y.value,I);if(b)return{...b,isTable:!0,index:m,trIndex:P,tdIndex:y,tdId:Y.id,trId:S.id,tableId:L.id}}}}if(L.titleId===I){let O=m;for(;O<p.length;){if(p[O+1]?.titleId!==I)return{isTable:!1,startIndex:O,endIndex:O};O++}}}return null}const i=n(e,t);if(!i)return;const{isTable:l,index:r,startTdIndex:a,endTdIndex:c,startTrIndex:d,endTrIndex:u,trIndex:h,tdIndex:R,tdId:T,trId:g,tableId:f,endIndex:C}=i;this.position.setPositionContext({isTable:l,index:r,trIndex:h,tdIndex:R,tdId:T,trId:g,tableId:f}),this.range.setRange(C,C,f,a,c,d,u),this.draw.render({curIndex:C,isCompute:!1,isSubmitHistory:!1})}wordTool(){const t=this.draw.getMainElementList();let e=!1;for(let n=0;n<t.length;n++)if(t[n].value===_)for(;n+1<t.length;){const l=t[n+1];if(l.value!==_&&l.value!==Ti)break;t.splice(n+1,1),e=!0}if(e)this.draw.render({isSetCursor:!1});else{const n=this.range.getIsCollapsed();this.draw.getCursor().drawCursor({isShow:n})}}setHTML(t){const{header:e,main:n,footer:i}=t,l=this.draw.getOriginalInnerWidth(),r=a=>a!==void 0?An(a,{innerWidth:l}):void 0;this.setValue({header:r(e),main:r(n),footer:r(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:l,trIndex:r,tdIndex:a,tdId:c,trId:d,tableId:u,endIndex:h}=n;this.position.setPositionContext({isTable:i,index:l,trIndex:r,tdIndex:a,tdId:c,trId:d,tableId:u}),this.range.setRange(h,h),this.draw.render({curIndex:h,isCompute:!1,isSubmitHistory:!1})}setZone(t){this.draw.getZone().setZone(t)}getControlValue(t){return this.draw.getControl().getValueById(t)}getButtonContent(t){const{controlId:e}=t;if(!e)return null;const n=this.findButtonControlContext(e);return n?this.getButtonContentResult(this.getButtonBusinessValue(n)):null}setButtonContent(t){if(!(this.draw.getMode()===s.EditorMode.FORM)&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{controlId:i,mode:l,isSubmitHistory:r=!0}=t;if(!i)return;const a=this.findButtonControlContext(i);if(!a)return;const c=this.getButtonBusinessValue(a),d=this.normalizeButtonContentValue(t.value),u=l==="append"?this.appendButtonContentValue(c,d):d;this.removeButtonBusinessElements(a);const h=this.findButtonControlContext(i);if(!h)return;const R=this.createButtonBusinessElements(h,u),T=this.replaceButtonRenderedValue(h,R,u);this.syncButtonPlaceholderElements(h.elementList,i,h.element.control?.placeholder||""),r||this.historyManager.recovery(),this.draw.render({curIndex:T,isSubmitHistory:r,isSetCursor:!0})}setControlValue(t){this.draw.getControl().setValueListById([t])}setControlValueList(t){this.draw.getControl().setValueListById(t)}setControlExtension(t){this.draw.getControl().setExtensionListById([t])}setControlExtensionList(t){this.draw.getControl().setExtensionListById(t)}setControlProperties(t){this.draw.getControl().setPropertiesListById([t])}setControlPropertiesList(t){this.draw.getControl().setPropertiesListById(t)}setControlHighlight(t){this.draw.getControl().setHighlightList(t),this.draw.render({isSubmitHistory:!1})}setControlQualityMarks(t){this.draw.getControl().setQualityMarks(t),this.draw.render({isSetCursor:!1,isSubmitHistory:!1})}updateOptions(t){const e=yo(t);Object.entries(e).forEach(([n,i])=>{Reflect.set(this.options,n,i)}),this.forceUpdate()}setFormModeTrace(t){Object.assign(this.options.modeRule.form,t),this.forceUpdate()}getControlList(){return this.draw.getControl().getList()}locationControl(t,e){if(!t)return;function n(r,a,c){let d=0;for(;d<r.length;){const u=r[d];if(d++,u.type===s.ElementType.TABLE){const R=u.trList;for(let T=0;T<R.length;T++){const g=R[T];for(let f=0;f<g.tdList.length;f++){const C=g.tdList[f],p=n(C.value,a,c);if(p)return{...p,positionContext:{isTable:!0,index:d-1,trIndex:T,tdIndex:f,tdId:C.id,trId:g.id,tableId:u.id}}}}}if(!c(u))continue;let h=d-1;if(e?.position===s.LocationPosition.OUTER_AFTER){if(!(u.controlComponent===s.ControlComponent.POSTFIX&&r[d+1]?.controlComponent!==s.ControlComponent.POST_TEXT))continue}else if(e?.position===s.LocationPosition.OUTER_BEFORE)h-=1;else if(e?.position===s.LocationPosition.AFTER){if(h-=1,u.controlComponent!==s.ControlComponent.PLACEHOLDER&&u.controlComponent!==s.ControlComponent.POSTFIX&&u.controlComponent!==s.ControlComponent.POST_TEXT)continue}else if(u.controlComponent!==s.ControlComponent.PREFIX&&u.controlComponent!==s.ControlComponent.PRE_TEXT||r[d]?.controlComponent===s.ControlComponent.PREFIX||r[d]?.controlComponent===s.ControlComponent.PRE_TEXT)continue;return{zone:a,range:{startIndex:h,endIndex:h},positionContext:{isTable:!1}}}return null}const i=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}],l=[r=>r.controlId===t,r=>r.control?.conceptId===t,r=>r.control?.code===t];for(let r=0;r<l.length;r++)for(const a of i){const c=n(a.elementList,a.zone,l[r]);if(c){this.setZone(c.zone),this.position.setPositionContext(c.positionContext),this.range.replaceRange(c.range),this.draw.render({curIndex:c.range.startIndex,isCompute:!1,isSubmitHistory:!1});return}}}insertTextField(t){if(this.draw.isReadonly()||this.draw.isDisabled()||!t)return;const n=rt(t),{startIndex:i}=this.range.getRange(),l=this.draw.getElementList(),r=Kn(l,i);if(!r)return;const a=[...In,...ce,...Un,...un];dn(a,r,n),this.draw.insertElementTextField([n])}insertControl(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=rt(t),{startIndex:i}=this.range.getRange(),l=this.draw.getElementList(),r=Kn(l,i);if(!r)return;const a=l[i],c=a?.controlComponent===s.ControlComponent.POSTFIX||a?.controlComponent===s.ControlComponent.POSTTEXTFIX;let d=!1;if(a?.controlId&&!c)for(let h=i;h>=0;h--){const R=l[h];if(R.controlId!==a.controlId)break;if(R.controlComponent===s.ControlComponent.PRETEXTFIX||R.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){R.control?.type===s.ControlType.TEXTFIELD&&(d=!0);break}}if(!d&&!c){const h=l[i-1];if(h?.controlId)for(let R=i-1;R>=0;R--){const T=l[R];if(T.controlId!==h.controlId)break;if(T.controlComponent===s.ControlComponent.PRETEXTFIX||T.controlComponent===s.ControlComponent.PRETEXTFIX_TEXT){T.control?.type===s.ControlType.TEXTFIELD&&(d=!0);break}}}if(d&&t.control?.type===s.ControlType.TEXTFIELD)return;const u=[...In,...ce,...Un,...un];dn(u,r,n),this.draw.insertElementList([n])}jumpControl(t){this.draw.getControl().initNextControl({direction:t?.direction})}getContainer(){return this.draw.getContainer()}getTitleValue(t){const{conceptId:e}=t,n=[],i=(r,a)=>{let c=0;for(;c<r.length;){const d=r[c];if(c++,d.type===s.ElementType.TABLE){const R=d.trList;for(let T=0;T<R.length;T++){const g=R[T];for(let f=0;f<g.tdList.length;f++){const C=g.tdList[f];i(C.value,a)}}}if(d?.title?.conceptId!==e)continue;const u=[];let h=c;for(;h<r.length;){const R=r[h];if(h++,d.titleId!==R.titleId){if(R.level&&bi[R.level]<=bi[d.level])break;u.push(R)}}n.push({...d.title,value:Pn(u),elementList:Ut(u),zone:a}),c=h}},l=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:r,elementList:a}of l)i(a,r);return n}getPositionContextByEvent(t,e={}){const n=t.target?.dataset.index;if(!n)return null;const{isMustDirectHit:i=!0}=e,l=Number(n),r=this.position.getPositionByXY({x:t.offsetX,y:t.offsetY,pageNo:l}),{isDirectHit:a,isTable:c,index:d,trIndex:u,tdIndex:h,tdValueIndex:R,zone:T}=r;if(i&&!a||T&&T!==this.zone.getZone())return null;let g=null,f=null;const C=this.draw.getOriginalElementList();let p=null;const I=this.position.getOriginalPositionList();if(c){const L=C[d].trList?.[u].tdList[h];f=L?.value[R]||null,p=L?.positionList?.[R]||null,g={element:C[d],trIndex:u,tdIndex:h}}else f=C[d]||null,p=I[d]||null;let m=null;if(p){const{pageNo:L,coordinate:{leftTop:O,rightTop:P},lineHeight:S}=p,y=this.draw.getOriginalHeight(),Y=this.draw.getOriginalPageGap();m={x:O[0],y:O[1]+L*(y+Y),width:P[0]-O[0],height:S}}return{pageNo:l,element:f,rangeRect:m,tableInfo:g}}insertTitle(t){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=rt(t),{startIndex:i}=this.range.getRange(),l=this.draw.getElementList(),r=Kn(l,i);if(!r)return;const a=[...In,...ce,...Un,...un];n.valueList?.forEach(c=>{dn(a,r,c)}),this.draw.insertElementList([n])}focus(t){const{position:e=s.LocationPosition.AFTER,isMoveCursorToVisible:n=!0,rowNo:i,range:l}=t||{};let r=-1;if(l)this.range.replaceRange(l),r=e===s.LocationPosition.BEFORE?l.startIndex:l.endIndex;else if(Li(i)){const c=this.draw.getOriginalRowList();if(r=e===s.LocationPosition.BEFORE?c[i]?.startIndex:c[i+1]?.startIndex-1,!Li(r))return;this.range.setRange(r,r)}else r=e===s.LocationPosition.BEFORE?0:this.draw.getOriginalMainElementList().length-1,this.range.setRange(r,r);const a={isCompute:!1,isSetCursor:!1,isSubmitHistory:!1};n&&~r&&this.range.getIsCollapsed()&&(a.curIndex=r,a.isSetCursor=!0),this.draw.render(a)}insertArea(t){return this.draw.getArea().insertArea(t)}setAreaValue(t){return this.draw.getArea().setAreaValue(t)}setAreaProperties(t){this.draw.getArea().setAreaProperties(t)}locationArea(t,e){if(e?.isAppendLastLineBreak&&e?.position===s.LocationPosition.OUTER_AFTER){const l=this.draw.getOriginalMainElementList();l[l.length-1].areaId===t&&this.draw.appendElementList([{value:_}],{isSubmitHistory:!1})}const n=this.draw.getArea().getContextByAreaId(t,e);if(!n)return;const{range:{endIndex:i}}=n;this.position.setPositionContext({isTable:!1}),this.range.setRange(i,i),this.draw.render({curIndex:i,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1})}clearGraffiti(){this.draw.getGraffiti().clear(),this.draw.isGraffitiMode()&&this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1})}getMacroValue(t){const{id:e,dictCode:n,label:i,areaId:l}=t,r=[],a=(d,u)=>{for(const h of d){if(h.type===s.ElementType.TABLE){const T=h.trList;for(const g of T)for(const f of g.tdList)a(f.value,u);continue}if(h.type!==s.ElementType.MACRO&&h.type!==s.ElementType.CUSTOM_MACRO&&h.type!==s.ElementType.REUSABLE_ITEM||e&&h.id!==e||n&&h.dictCode!==n||i&&h.label!==i||l&&h.areaId!==l)continue;const R={id:h.id,type:h.type,label:h.label,dictCode:h.dictCode,zone:u};h.type===s.ElementType.MACRO?R.value=h.value:h.type===s.ElementType.CUSTOM_MACRO?(R.macroConfig=h.macroConfig,R.value=h.macroConfig?.value):h.type===s.ElementType.REUSABLE_ITEM&&(R.reusableItemConfig=h.reusableItemConfig,R.value=h.reusableItemConfig?.value),r.push(R)}},c=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:d,elementList:u}of c)a(u,d);return r}getMacroList(){const t=[],e=i=>{for(const l of i){if(l.type===s.ElementType.TABLE){const r=l.trList;for(const a of r)for(const c of a.tdList)e(c.value);continue}(l.type===s.ElementType.MACRO||l.type===s.ElementType.CUSTOM_MACRO||l.type===s.ElementType.REUSABLE_ITEM)&&t.push(l)}},n=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const i of n)e(i);return t}setMacroValue(t){const{id:e,dictCode:n,label:i,areaId:l,value:r,code:a,isSubmitHistory:c=!0}=t;let d=!1;const u=R=>{for(let T=0;T<R.length;T++){const g=R[T];if(g.type===s.ElementType.TABLE){const f=g.trList;for(const C of f)for(const p of C.tdList)u(p.value);continue}g.type!==s.ElementType.MACRO&&g.type!==s.ElementType.CUSTOM_MACRO&&g.type!==s.ElementType.REUSABLE_ITEM||e&&g.id!==e||n&&g.dictCode!==n||i&&g.label!==i||l&&g.areaId!==l||(d=!0,g.type===s.ElementType.MACRO?g.value=r:g.type===s.ElementType.CUSTOM_MACRO?g.macroConfig?(g.macroConfig.value=r,a!==void 0&&(g.macroConfig.code=a)):g.macroConfig={type:"text",value:r}:g.type===s.ElementType.REUSABLE_ITEM&&(g.reusableItemConfig?g.reusableItemConfig.value=r:g.reusableItemConfig={value:r}))}},h=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const R of h)u(R);d&&this.draw.render({isSubmitHistory:c,isSetCursor:!1})}setMacroValueList(t){if(!t.length)return;let e=!1,n=!1;const i=r=>{for(let a=0;a<r.length;a++){const c=r[a];if(c.type===s.ElementType.TABLE){const T=c.trList;for(const g of T)for(const f of g.tdList)i(f.value);continue}if(c.type!==s.ElementType.MACRO&&c.type!==s.ElementType.CUSTOM_MACRO&&c.type!==s.ElementType.REUSABLE_ITEM)continue;const d=t.find(T=>T.id&&c.id===T.id||T.dictCode&&c.dictCode===T.dictCode||T.label&&c.label===T.label||T.areaId&&c.areaId===T.areaId);if(!d)continue;const{value:u,code:h,isSubmitHistory:R=!0}=d;e=!0,R&&(n=!0),c.type===s.ElementType.MACRO?c.value=u:c.type===s.ElementType.CUSTOM_MACRO?c.macroConfig?(c.macroConfig.value=u,h!==void 0&&(c.macroConfig.code=h)):c.macroConfig={type:"text",value:u}:c.type===s.ElementType.REUSABLE_ITEM&&(c.reusableItemConfig?c.reusableItemConfig.value=u:c.reusableItemConfig={value:u})}},l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const r of l)i(r);e&&(n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1}))}updateMacroProperties(t){const{id:e,dictCode:n,label:i,areaId:l,properties:r,isSubmitHistory:a=!0}=t;let c=!1;const d=h=>{for(let R=0;R<h.length;R++){const T=h[R];if(T.type===s.ElementType.TABLE){const g=T.trList;for(const f of g)for(const C of f.tdList)d(C.value);continue}T.type!==s.ElementType.MACRO&&T.type!==s.ElementType.CUSTOM_MACRO&&T.type!==s.ElementType.REUSABLE_ITEM||e&&T.id!==e||n&&T.dictCode!==n||i&&T.label!==i||l&&T.areaId!==l||(c=!0,Object.assign(T,r))}},u=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const h of u)d(h);c&&this.draw.render({isSubmitHistory:a,isSetCursor:!1})}locationMacro(t){const{id:e,dictCode:n,label:i,areaId:l}=t,r=(c,d)=>{for(let u=0;u<c.length;u++){const h=c[u];if(h.type===s.ElementType.TABLE){const R=h.trList;for(let T=0;T<R.length;T++){const g=R[T];for(let f=0;f<g.tdList.length;f++){const C=g.tdList[f],p=r(C.value,d);if(p)return{...p,isTable:!0,index:u,trIndex:T,tdIndex:f,tableId:h.tableId,trId:g.id,tdId:C.id}}}}if(!(h.type!==s.ElementType.MACRO&&h.type!==s.ElementType.CUSTOM_MACRO&&h.type!==s.ElementType.REUSABLE_ITEM)&&!(e&&h.id!==e)&&!(n&&h.dictCode!==n)&&!(i&&h.label!==i)&&!(l&&h.areaId!==l))return{zone:d,index:u}}return null},a=[{zone:s.EditorZone.HEADER,elementList:this.draw.getHeaderElementList()},{zone:s.EditorZone.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:s.EditorZone.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:c,elementList:d}of a){const u=r(d,c);if(u){this.setZone(u.zone),this.position.setPositionContext({isTable:u.isTable||!1,index:u.index,trIndex:u.trIndex,tdIndex:u.tdIndex,tableId:u.tableId,trId:u.trId,tdId:u.tdId}),this.range.replaceRange({startIndex:u.index,endIndex:u.index}),this.draw.render({curIndex:u.index,isCompute:!1,isSubmitHistory:!1});break}}}insertSubTemplate(t){const{label:e,templateId:n,content:i,conditions:l,relation:r="and",isSubmitHistory:a=!0}=t,c={id:ft(),value:e,type:s.ElementType.SUB_TEMPLATE,label:e,templateId:n,subTemplateContent:i?.map(d=>rt(d)),subTemplateRelation:r,subTemplateConditions:l?.map(d=>({...d})),subTemplateExpanded:this.options.mode===s.EditorMode.FORM&&!l?.length};this.insertElementList([c],{isSubmitHistory:a})}updateSubTemplate(t){const{id:e,properties:n,isSubmitHistory:i=!0}=t;if(!e)return;const l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];let r=!1;for(let a=0;a<l.length;a++)ui(l[a],c=>{c.id!==e||c.type!==s.ElementType.SUB_TEMPLATE||(Object.assign(c,{...n,value:n.label??c.value,subTemplateContent:n.subTemplateContent?n.subTemplateContent.map(d=>rt(d)):c.subTemplateContent?.map(d=>rt(d)),subTemplateConditions:n.subTemplateConditions?n.subTemplateConditions.map(d=>({...d})):c.subTemplateConditions?.map(d=>({...d}))}),r=!0)});r&&this.draw.render({isSubmitHistory:i,isCompute:!0})}expandSubTemplate(t){const{id:e,content:n,isSubmitHistory:i=!0}=t,l=this.draw.getOriginalMainElementList();for(let r=0;r<l.length;r++){const a=l[r];if(a.type===s.ElementType.SUB_TEMPLATE&&(!e||a.id===e)){const c=n||a.subTemplateContent;if(!c?.length){console.warn("子模板内容为空,无法展开");return}a.subTemplateExpanded=!0,a.hide=!0;const d=rt(c);ee(d,{isHandleFirstElement:!1,editorOptions:this.options}),Ws(d,a),l.splice(r+1,0,...d),this.draw.render({isSubmitHistory:i,isCompute:!0});return}}}collapseSubTemplate(t){const{id:e,isSubmitHistory:n=!0}=t;this.draw.syncSubTemplateRuntimeContent();const i=this.draw.getOriginalMainElementList();for(let l=0;l<i.length;l++){const r=i[l];if(r.type===s.ElementType.SUB_TEMPLATE&&(!e||r.id===e)){r.subTemplateExpanded=!1,r.hide=!1;const a=this.draw.getSubTemplateRuntimeEndIndex(i,l,r.id);a>l+1&&i.splice(l+1,a-l-1),this.draw.render({isSubmitHistory:n,isCompute:!0});return}}}toggleSubTemplate(t){const{id:e,content:n,isSubmitHistory:i=!0}=t,l=this.draw.getOriginalMainElementList();for(let r=0;r<l.length;r++){const a=l[r];if(a.type===s.ElementType.SUB_TEMPLATE&&(!e||a.id===e)){a.subTemplateExpanded?this.collapseSubTemplate({id:e,isSubmitHistory:i}):this.expandSubTemplate({id:e,content:n,isSubmitHistory:i});return}}}}class tf{rangeStyleChange;visiblePageNoListChange;intersectionPageNoChange;pageSizeChange;pageScaleChange;saved;contentChange;controlChange;controlContentChange;pageModeChange;zoneChange;constructor(){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.controlContentChange=null,this.pageModeChange=null,this.zoneChange=null}}class ef{contextMenu;contextMenuList;getContextMenuList;shortcutList;langMap;constructor(t){const{contextMenu:e,shortcut:n,i18n:i}=t;this.contextMenu=e,this.contextMenuList=e.registerContextMenuList.bind(e),this.getContextMenuList=e.getContextMenuList.bind(e),this.shortcutList=n.registerShortcutList.bind(n),this.langMap=i.registerLangMap.bind(i)}disposeContextMenu(){this.contextMenu.dispose()}}const jl={SELECTED_TEXT:"%s"},oo={GLOBAL:{CUT:"globalCut",COPY:"globalCopy",PASTE:"globalPaste",SELECT_ALL:"globalSelectAll",PRINT:"globalPrint"},CONTROL:{DELETE:"controlDelete",EDIT_ATTRIBUTE:"controlEditAttribute",COPY:"controlCopy",PASTE:"controlPaste"},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",TABLE_PROPERTIES:"tableProperties"}},{CONTROL:{DELETE:nf,EDIT_ATTRIBUTE:of,COPY:sf,PASTE:rf}}=oo;function lf(o,t){if(t!==s.EditorMode.EDIT)return!1;const n=o?.control?.type,i=o?.controlComponent,l=n===s.ControlType.TEXT||n===s.ControlType.TEXTFIELD||n===s.ControlType.NUMBER||n===s.ControlType.SELECT||n===s.ControlType.DATE||n===s.ControlType.CHECKBOX||n===s.ControlType.RADIO||n===s.ControlType.BUTTON,r=i==="prefix"||i==="preText"||i==="preTextFix"||i==="textFixLabel"||n===s.ControlType.BUTTON&&(i==="value"||i==="placeholder");return l&&r}function ql(o){return o.hitElement||o.hitTableElement}const af=[s.ElementType.MENSTRUAL_HISTORY,s.ElementType.FETAL_HEART_POSITION,s.ElementType.TOOTH_POSITION];function cf(o){return af.includes(o?.type)||o?.type===s.ElementType.IMAGE&&!!o.controlId&&o.controlComponent==="value"}const df=[{key:sf,name:"复制控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&lf(o.startElement,o.options.mode),callback:(o,t)=>{const e=t.startElement?.controlId;e&&o.executeCopyControl(e)}},{key:rf,name:"粘贴控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.editorTextFocus&&o.options.mode===s.EditorMode.EDIT&&Uc(),callback:o=>{o.executePasteControl()}},{key:nf,i18nPath:"contextmenu.control.delete",when:o=>{const t=cf(o.startElement);return!o.isReadonly&&!o.editorHasSelection&&(!!o.startElement?.controlId||t)&&(o.options.mode!==s.EditorMode.FORM||t)},callback:o=>{o.executeRemoveControl()}},{key:of,i18nPath:"contextmenu.control.editAttribute",when:o=>{const t=ql(o);return!o.isReadonly&&!o.editorHasSelection&&o.options.mode===s.EditorMode.EDIT&&!!t},callback:(o,t)=>{const e=ql(t);e&&o.executeTriggerControlEditAttribute(e.controlId,e)}}],{GLOBAL:{CUT:uf,COPY:hf,PASTE:Rf,SELECT_ALL:gf,PRINT:Tf}}=oo,ff=[{key:uf,i18nPath:"contextmenu.global.cut",shortCut:`${pn?"⌘":"Ctrl"} + X`,when:o=>!o.isReadonly,callback:o=>{o.executeCut()}},{key:hf,i18nPath:"contextmenu.global.copy",shortCut:`${pn?"⌘":"Ctrl"} + C`,when:o=>o.editorHasSelection||o.isCrossRowCol,callback:o=>{o.executeCopy()}},{key:Rf,i18nPath:"contextmenu.global.paste",shortCut:`${pn?"⌘":"Ctrl"} + V`,when:o=>!o.isReadonly&&o.editorTextFocus,callback:o=>{o.executePaste()}},{key:gf,i18nPath:"contextmenu.global.selectAll",shortCut:`${pn?"⌘":"Ctrl"} + A`,when:o=>o.editorTextFocus,callback:o=>{o.executeSelectAll()}},{isDivider:!0},{key:Tf,i18nPath:"contextmenu.global.print",icon:"print",when:()=>!0,callback:o=>{o.executePrint()}}],{HYPERLINK:{DELETE:mf,CANCEL:Cf,EDIT:pf}}=oo,If=[{key:mf,i18nPath:"contextmenu.hyperlink.delete",when:o=>!o.isReadonly&&o.startElement?.type===s.ElementType.HYPERLINK,callback:o=>{o.executeDeleteHyperlink()}},{key:Cf,i18nPath:"contextmenu.hyperlink.cancel",when:o=>!o.isReadonly&&o.startElement?.type===s.ElementType.HYPERLINK,callback:o=>{o.executeCancelHyperlink()}},{key:pf,i18nPath:"contextmenu.hyperlink.edit",when:o=>!o.isReadonly&&o.startElement?.type===s.ElementType.HYPERLINK,callback:(o,t)=>{const e=window.prompt(o.executeTranslate("contextmenu.hyperlink.edit"),t.startElement?.url);e&&o.executeEditHyperlink(e)}}],{IMAGE:{CHANGE:Ef,SAVE_AS:Lf,TEXT_WRAP:Pf,TEXT_WRAP_EMBED:Mf,TEXT_WRAP_UP_DOWN:Of,TEXT_WRAP_SURROUND:Sf,TEXT_WRAP_FLOAT_TOP:Df,TEXT_WRAP_FLOAT_BOTTOM:Ff}}=oo,Xf=[{key:Ef,i18nPath:"contextmenu.image.change",icon:"image-change",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===s.ElementType.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:Lf,i18nPath:"contextmenu.image.saveAs",icon:"image",when:o=>!o.editorHasSelection&&o.startElement?.type===s.ElementType.IMAGE,callback:o=>{o.executeSaveAsImageElement()}},{key:Pf,i18nPath:"contextmenu.image.textWrap",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===s.ElementType.IMAGE,childMenus:[{key:Mf,i18nPath:"contextmenu.image.textWrapType.embed",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,s.ImageDisplay.BLOCK)}},{key:Of,i18nPath:"contextmenu.image.textWrapType.upDown",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,s.ImageDisplay.INLINE)}},{key:Sf,i18nPath:"contextmenu.image.textWrapType.surround",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,s.ImageDisplay.SURROUND)}},{key:Df,i18nPath:"contextmenu.image.textWrapType.floatTop",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,s.ImageDisplay.FLOAT_TOP)}},{key:Ff,i18nPath:"contextmenu.image.textWrapType.floatBottom",when:()=>!0,callback:(o,t)=>{o.executeChangeImageDisplay(t.startElement,s.ImageDisplay.FLOAT_BOTTOM)}}]}],{TABLE:{BORDER:yf,BORDER_ALL:Nf,BORDER_EMPTY:bf,BORDER_DASH:Vf,BORDER_EXTERNAL:Wf,BORDER_INTERNAL:Uf,BORDER_TD:Yf,BORDER_TD_TOP:wf,BORDER_TD_LEFT:vf,BORDER_TD_BOTTOM:Zf,BORDER_TD_RIGHT:Qf,BORDER_TD_BACK:Kf,BORDER_TD_FORWARD:Hf,VERTICAL_ALIGN:Af,VERTICAL_ALIGN_TOP:_f,VERTICAL_ALIGN_MIDDLE:Bf,VERTICAL_ALIGN_BOTTOM:kf,INSERT_ROW_COL:Gf,INSERT_TOP_ROW:xf,INSERT_BOTTOM_ROW:Jf,INSERT_LEFT_COL:$f,INSERT_RIGHT_COL:zf,DELETE_ROW_COL:jf,DELETE_ROW:qf,DELETE_COL:tm,DELETE_TABLE:em,MERGE_CELL:nm,CANCEL_MERGE_CELL:om}}=oo,im=[{isDivider:!0},{key:yf,i18nPath:"contextmenu.table.border",icon:"border-all",when:o=>!o.isReadonly&&o.isInTable,childMenus:[{key:Nf,i18nPath:"contextmenu.table.borderAll",icon:"border-all",when:()=>!0,callback:o=>{o.executeTableBorderType(s.TableBorder.ALL)}},{key:bf,i18nPath:"contextmenu.table.borderEmpty",icon:"border-empty",when:()=>!0,callback:o=>{o.executeTableBorderType(s.TableBorder.EMPTY)}},{key:Vf,i18nPath:"contextmenu.table.borderDash",icon:"border-dash",when:()=>!0,callback:o=>{o.executeTableBorderType(s.TableBorder.DASH)}},{key:Wf,i18nPath:"contextmenu.table.borderExternal",icon:"border-external",when:()=>!0,callback:o=>{o.executeTableBorderType(s.TableBorder.EXTERNAL)}},{key:Uf,i18nPath:"contextmenu.table.borderInternal",icon:"border-internal",when:()=>!0,callback:o=>{o.executeTableBorderType(s.TableBorder.INTERNAL)}},{key:Yf,i18nPath:"contextmenu.table.borderTd",icon:"border-td",when:()=>!0,childMenus:[{key:wf,i18nPath:"contextmenu.table.borderTdTop",icon:"border-td-top",when:()=>!0,callback:o=>{o.executeTableTdBorderType(s.TdBorder.TOP)}},{key:Qf,i18nPath:"contextmenu.table.borderTdRight",icon:"border-td-right",when:()=>!0,callback:o=>{o.executeTableTdBorderType(s.TdBorder.RIGHT)}},{key:Zf,i18nPath:"contextmenu.table.borderTdBottom",icon:"border-td-bottom",when:()=>!0,callback:o=>{o.executeTableTdBorderType(s.TdBorder.BOTTOM)}},{key:vf,i18nPath:"contextmenu.table.borderTdLeft",icon:"border-td-left",when:()=>!0,callback:o=>{o.executeTableTdBorderType(s.TdBorder.LEFT)}},{key:Hf,i18nPath:"contextmenu.table.borderTdForward",icon:"border-td-forward",when:()=>!0,callback:o=>{o.executeTableTdSlashType(s.TdSlash.FORWARD)}},{key:Kf,i18nPath:"contextmenu.table.borderTdBack",icon:"border-td-back",when:()=>!0,callback:o=>{o.executeTableTdSlashType(s.TdSlash.BACK)}}]}]},{key:Af,i18nPath:"contextmenu.table.verticalAlign",icon:"vertical-align",when:o=>!o.isReadonly&&o.isInTable,childMenus:[{key:_f,i18nPath:"contextmenu.table.verticalAlignTop",icon:"vertical-align-top",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(s.VerticalAlign.TOP)}},{key:Bf,i18nPath:"contextmenu.table.verticalAlignMiddle",icon:"vertical-align-middle",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(s.VerticalAlign.MIDDLE)}},{key:kf,i18nPath:"contextmenu.table.verticalAlignBottom",icon:"vertical-align-bottom",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(s.VerticalAlign.BOTTOM)}}]},{key:Gf,i18nPath:"contextmenu.table.insertRowCol",icon:"insert-row-col",when:o=>!o.isReadonly&&o.isInTable,childMenus:[{key:xf,i18nPath:"contextmenu.table.insertTopRow",icon:"insert-top-row",when:()=>!0,callback:o=>{o.executeInsertTableTopRow()}},{key:Jf,i18nPath:"contextmenu.table.insertBottomRow",icon:"insert-bottom-row",when:()=>!0,callback:o=>{o.executeInsertTableBottomRow()}},{key:$f,i18nPath:"contextmenu.table.insertLeftCol",icon:"insert-left-col",when:()=>!0,callback:o=>{o.executeInsertTableLeftCol()}},{key:zf,i18nPath:"contextmenu.table.insertRightCol",icon:"insert-right-col",when:()=>!0,callback:o=>{o.executeInsertTableRightCol()}}]},{key:jf,i18nPath:"contextmenu.table.deleteRowCol",icon:"delete-row-col",when:o=>!o.isReadonly&&o.isInTable,childMenus:[{key:qf,i18nPath:"contextmenu.table.deleteRow",icon:"delete-row",when:()=>!0,callback:o=>{o.executeDeleteTableRow()}},{key:tm,i18nPath:"contextmenu.table.deleteCol",icon:"delete-col",when:()=>!0,callback:o=>{o.executeDeleteTableCol()}},{key:em,i18nPath:"contextmenu.table.deleteTable",icon:"delete-table",when:()=>!0,callback:o=>{o.executeDeleteTable()}}]},{key:nm,i18nPath:"contextmenu.table.mergeCell",icon:"merge-cell",when:o=>!o.isReadonly&&o.isCrossRowCol,callback:o=>{o.executeMergeTableCell()}},{key:om,i18nPath:"contextmenu.table.mergeCancelCell",icon:"merge-cancel-cell",when:o=>!o.isReadonly&&o.isInTable,callback:o=>{o.executeCancelMergeTableCell()}}];class sm{options;draw;command;range;position;i18n;container;contextMenuList;contextMenuContainerList;contextMenuRelationShip;context;constructor(t,e){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=[...ff,...im,...Xf,...df,...If],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){const{contextMenuDisableKeys:e}=this.options,n=[];for(let i=0;i<t.length;i++){const l=t[i];l.disable||l.key&&e.includes(l.key)||(l.isDivider||l.when?.(this.context))&&n.push(l)}return n}_proxyContextMenuEvent=t=>{this.context=this._getContext(t);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()};_handleSideEffect=t=>{const e=t.target;this.contextMenuContainerList.some(i=>i.contains(e))||this.dispose()};_getContext(t){const e=this.draw.isReadonly(),{isCrossRowCol:n,startIndex:i,endIndex:l}=this.range.getRange(),r=!!(~i||~l),a=r&&i!==l,{isTable:c,trIndex:d,tdIndex:u,index:h}=this.position.getPositionContext(),R=t?this.command.getPositionContextByEvent(t,{isMustDirectHit:!0}):null;let T=null;if(c){const P=this.draw.getOriginalElementList()[h]||null;P&&(T=Ut([P],{extraPickAttrs:["id"]})[0])}const g=c&&!!n,f=this.draw.getElementList();let C=f[i]||null,p=f[l]||null;R?.element&&(C=R.element,p=R.element);const I=R?.element||null,m=R?.tableInfo?.element||null;R?.tableInfo?.element&&(T=R.tableInfo.element);const L=this.draw.getZone().getZone();return{startElement:C,endElement:p,hitElement:I,hitTableElement:m,isReadonly:e,editorHasSelection:a,editorTextFocus:r,isCrossRowCol:g,zone:L,isInTable:c,trIndex:d??null,tdIndex:u??null,tableElement:T,options:this.options}}_createContextMenuContainer(){const t=document.createElement("div");return t.classList.add(`${st}-contextmenu-container`),t.setAttribute(ve,s.EditorComponent.CONTEXTMENU),this.container.append(t),t}_render(t){const{contextMenuList:e,left:n,top:i,parentMenuContainer:l}=t,r=this._createContextMenuContainer(),a=document.createElement("div");a.classList.add(`${st}-contextmenu-content`);let c=null;l&&this.contextMenuRelationShip.set(l,r);for(let L=0;L<e.length;L++){const O=e[L];if(O.isDivider){if(L!==0&&L!==e.length-1&&!e[L-1]?.isDivider){const P=document.createElement("div");P.classList.add(`${st}-contextmenu-divider`),a.append(P)}}else{const P=document.createElement("div");if(P.classList.add(`${st}-contextmenu-item`),O.childMenus){const b=this._filterMenuList(O.childMenus);b.some(V=>!V.isDivider)&&(P.classList.add(`${st}-contextmenu-sub-item`),P.onmouseenter=()=>{this._setHoverStatus(P,!0),this._removeSubMenu(r);const V=P.getBoundingClientRect(),N=V.left+V.width,X=V.top;c=this._render({contextMenuList:b,left:N,top:X,parentMenuContainer:r})},P.onmouseleave=V=>{(!c||!c.contains(V.relatedTarget))&&this._setHoverStatus(P,!1)})}else P.onmouseenter=()=>{this._setHoverStatus(P,!0),this._removeSubMenu(r)},P.onmouseleave=()=>{this._setHoverStatus(P,!1)},P.onclick=()=>{O.callback&&this.context&&O.callback(this.command,this.context),this.dispose()};const S=document.createElement("i");P.append(S),O.icon&&S.classList.add(`${st}-contextmenu-${O.icon}`);const y=document.createElement("span"),Y=O.i18nPath?this._formatName(this.i18n.t(O.i18nPath)):this._formatName(O.name||"");if(y.append(document.createTextNode(Y)),P.append(y),O.shortCut){const b=document.createElement("span");b.classList.add(`${st}-shortcut`),b.append(document.createTextNode(O.shortCut)),P.append(b)}a.append(P)}}const d=document.createElement("div");d.classList.add(`${st}-contextmenu-divider`),a.append(d);const u=document.createElement("div");u.classList.add(`${st}-contextmenu-item`),u.onmouseenter=()=>{this._setHoverStatus(u,!0),this._removeSubMenu(r)},u.onmouseleave=()=>{this._setHoverStatus(u,!1)},u.onclick=()=>{this.dispose()};const h=document.createElement("i");u.append(h);const R=document.createElement("span");R.append(document.createTextNode(this.i18n.t("contextmenu.global.cancel"))),u.append(R),a.append(u),r.append(a),r.style.display="block";const T=window.innerWidth,g=r.getBoundingClientRect(),f=g.width,C=n+f>T?n-f:n;r.style.left=`${C}px`;const p=window.innerHeight,I=g.height,m=i+I>p?i-I:i;return r.style.top=`${m}px`,this.contextMenuContainerList.push(r),r}_removeSubMenu(t){const e=this.contextMenuRelationShip.get(t);e&&(this._removeSubMenu(e),e.remove(),this.contextMenuRelationShip.delete(t))}_setHoverStatus(t,e){e?(t.parentNode?.querySelectorAll(`${st}-contextmenu-item`).forEach(n=>n.classList.remove("hover")),t.classList.add("hover")):t.classList.remove("hover")}_formatName(t){const e=Object.values(jl),n=new RegExp(`${e.join("|")}`);let i=t;if(n.test(i)){const l=new RegExp(jl.SELECTED_TEXT,"g");if(l.test(i)){const r=this.range.toString();i=i.replace(l,r)}}return i}registerContextMenuList(t){this.contextMenuList.push(...t)}dispose(){this.contextMenuContainerList.forEach(t=>t.remove()),this.contextMenuContainerList=[],this.contextMenuRelationShip.clear()}}const rm=[{key:s.KeyMap.X,ctrl:!0,shift:!0,callback:o=>{o.executeStrikeout()}},{key:s.KeyMap.LEFT_BRACKET,mod:!0,callback:o=>{o.executeSizeAdd()}},{key:s.KeyMap.RIGHT_BRACKET,mod:!0,callback:o=>{o.executeSizeMinus()}},{key:s.KeyMap.B,mod:!0,callback:o=>{o.executeBold()}},{key:s.KeyMap.I,mod:!0,callback:o=>{o.executeItalic()}},{key:s.KeyMap.U,mod:!0,callback:o=>{o.executeUnderline()}},{key:pn?s.KeyMap.COMMA:s.KeyMap.RIGHT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSuperscript()}},{key:pn?s.KeyMap.PERIOD:s.KeyMap.LEFT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSubscript()}},{key:s.KeyMap.L,mod:!0,callback:o=>{o.executeRowFlex(s.RowFlex.LEFT)}},{key:s.KeyMap.E,mod:!0,callback:o=>{o.executeRowFlex(s.RowFlex.CENTER)}},{key:s.KeyMap.R,mod:!0,callback:o=>{o.executeRowFlex(s.RowFlex.RIGHT)}},{key:s.KeyMap.J,mod:!0,callback:o=>{o.executeRowFlex(s.RowFlex.ALIGNMENT)}},{key:s.KeyMap.J,mod:!0,shift:!0,callback:o=>{o.executeRowFlex(s.RowFlex.JUSTIFY)}}],lm=[{key:s.KeyMap.ZERO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(null)}},{key:s.KeyMap.ONE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.FIRST)}},{key:s.KeyMap.TWO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.SECOND)}},{key:s.KeyMap.THREE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.THIRD)}},{key:s.KeyMap.FOUR,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.FOURTH)}},{key:s.KeyMap.FIVE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.FIFTH)}},{key:s.KeyMap.SIX,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(s.TitleLevel.SIXTH)}}],am=[{key:s.KeyMap.I,shift:!0,mod:!0,callback:o=>{o.executeList(s.ListType.UL,s.ListStyle.DISC)}},{key:s.KeyMap.U,shift:!0,mod:!0,callback:o=>{o.executeList(s.ListType.OL)}}];class cm{draw;command;globalShortcutList;agentShortcutList;constructor(t,e){this.draw=t,this.command=e,this.globalShortcutList=[],this.agentShortcutList=[],this._addShortcutList([...rm,...lm,...am]),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)}_globalKeydown=t=>{this.globalShortcutList.length&&this.draw.isGlobalShortcutActive()&&this.draw.isTargetInsideEditor(t.target)&&this._execute(t,this.globalShortcutList)};_agentKeydown(t){this.agentShortcutList.length&&(this.draw.isInteractionSuspended()||this._execute(t,this.agentShortcutList))}_execute(t,e){for(let n=0;n<e.length;n++){const i=e[n];if((i.mod?Ae(t)===!!i.mod:t.ctrlKey===!!i.ctrl&&t.metaKey===!!i.meta)&&t.shiftKey===!!i.shift&&t.altKey===!!i.alt&&t.key.toLowerCase()===i.key.toLowerCase()){i.disable||(i?.callback?.(this.command),t.preventDefault());break}}}}class dm{editor;constructor(t){this.editor=t}use(t,e){t(this.editor,e)}}class um{eventHub;constructor(){this.eventHub=new Map}on(t,e){if(!t||typeof e!="function")return;const n=this.eventHub.get(t)||new Set;n.add(e),this.eventHub.set(t,n)}emit(t,e){if(!t)return;const n=this.eventHub.get(t);if(n){if(n.size===1)return[...n][0](e);n.forEach(i=>i(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}dangerouslyClearAll(){this.eventHub.clear()}}class hm{paste;copy;drop}class ta{command;version;listener;eventBus;override;register;destroy;use;draw;constructor(t,e,n={}){const i=yo(n);e=rt(e);let l=[],r=[],a=[],c=[];Array.isArray(e)?r=e:(l=e.header||[],r=e.main,a=e.footer||[],c=e.graffiti||[]),[l,r,a].forEach(g=>{ee(g,{editorOptions:i,isForceCompensation:!0})}),this.version=Cn,this.listener=new tf,this.eventBus=new um,this.override=new hm,this.draw=new GT(t,i,{header:l,main:r,footer:a,graffiti:c},this.listener,this.eventBus,this.override);const u=this.draw;this.command=new $l(new qT(u)),u.setCommand(this.command);const h=new sm(u,this.command),R=new cm(u,this.command);this.register=new ef({contextMenu:h,shortcut:R,i18n:u.getI18n()}),this.destroy=()=>{u.destroy(),R.removeEvent(),h.removeEvent(),this.eventBus.dangerouslyClearAll()};const T=new dm(this);this.use=T.use.bind(T)}setFormModeTrace(t){this.command.executeSetFormModeTrace(t)}pauseInteraction(){this.draw.pauseInteraction()}resumeInteraction(){this.draw.resumeInteraction()}setOverlayActive(t){this.draw.setOverlayActive(t)}suspendGlobalShortcut(t){this.draw.suspendGlobalShortcut(t)}}s.Command=$l,s.EDITOR_CLIPBOARD=so,s.EDITOR_COMPONENT=ve,s.Editor=ta,s.INTERNAL_CONTEXT_MENU_KEY=oo,s.INTERNAL_SHORTCUT_KEY=br,s.LETTER_CLASS=fi,s.createDomFromElementList=Hn,s.default=ta,s.getElementListByHTML=An,s.getTextFromElementList=Pn,s.splitText=Nt,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));