print-designer 1.0.6 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/{index-C_oUIZvI.mjs → index-Dj2CdLWM.mjs} +1156 -1154
- package/dist/index-Dj2CdLWM.mjs.map +1 -0
- package/dist/{index.es-U6l-9Pv9.mjs → index.es-2f8Iz56U.mjs} +2 -2
- package/dist/{index.es-U6l-9Pv9.mjs.map → index.es-2f8Iz56U.mjs.map} +1 -1
- package/dist/index.html +5 -20
- package/dist/manifest.json +3 -3
- package/dist/print-designer.es.js +2 -2
- package/dist/print-designer.umd.js +16 -16
- package/dist/print-designer.umd.js.map +1 -1
- package/package.json +2 -1
- package/dist/index-C_oUIZvI.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.react-band-designer{display:flex;flex-direction:column;height:100vh;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:#f5f5f5}.toolbar{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;background:#fff;border-bottom:1px solid #ddd;box-shadow:0 2px 4px #0000001a}.toolbar-left,.toolbar-right{display:flex;align-items:center;gap:10px}.btn{padding:6px 12px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer;font-size:14px;transition:all .2s}.btn:hover{background:#f0f0f0}.btn-primary{background:#4d90fe;color:#fff;border-color:#357ae8}.btn-primary:hover{background:#357ae8}.btn-danger{background:#ff6b6b;color:#fff;border-color:#ff5252}.btn-danger:hover{background:#ff5252}.btn-small{padding:3px 8px;font-size:12px}.checkbox{display:flex;align-items:center;gap:5px;font-size:14px;cursor:pointer}.workspace{display:flex;flex:1;overflow:hidden}.control-panel{width:155px;background:#fafafa;border-right:1px solid #ddd;padding:15px;overflow-y:auto}.control-panel h3{margin:0 0 15px;font-size:16px;color:#333}.control-group{margin-bottom:20px}.control-group h4{margin:0 0 10px;font-size:14px;color:#666;font-weight:500}.control-list{display:flex;flex-direction:row;gap:8px;flex-wrap:wrap}.control-item{display:flex;align-items:center;flex-direction:column;justify-content:center;background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;transition:all .2s;width:48px;font-size:12px;padding:8px}.control-item:hover{border-color:#4d90fe;background:#f0f7ff}.control-icon{width:24px;height:24px;background:#4d90fe;color:#fff;border-radius:3px;display:flex;align-items:center;justify-content:center;font-size:12px}.data-fields-panel{margin-top:20px;padding-top:20px;border-top:1px solid #eee}.panel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.panel-header h4{margin:0;font-size:14px;color:#333}.field-list{display:flex;flex-direction:column;gap:6px}.field-item{padding:6px 10px;background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;font-size:13px;transition:all .2s;margin-bottom:6px}.field-item:last-child{margin-bottom:0}.field-item:hover{border-color:#4d90fe;background:#f0f7ff}.field-group{margin-bottom:12px}.field-group-title{font-size:12px;color:#666;font-weight:500;padding:4px 0;margin-bottom:6px;border-bottom:1px solid #eee}.field-item.detail-field{background:#fff8e6;border-color:#ffd666}.field-item.detail-field:hover{background:#fff2cc;border-color:#faad14}.design-area{flex:1;display:flex;flex-direction:column;background:#f9f9f9}.canvas-nav{padding:10px 20px;background:#fff;border-bottom:1px solid #ddd;display:flex;justify-content:space-between;align-items:center;font-size:14px;color:#666}.position-info,.selected-info{display:flex;align-items:center;gap:5px}.canvas-wrapper{flex:1;overflow:auto;position:relative}.canvas-container{position:relative;width:100%;height:100%;margin:0 auto;background:#fff;box-shadow:0 2px 10px #0000001a}.grid-layer{position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(to right,rgba(0,0,0,.1) 1px,transparent 1px),linear-gradient(to bottom,rgba(0,0,0,.1) 1px,transparent 1px);pointer-events:none;opacity:.3}.boundary-layer{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:auto}.boundary-line{position:absolute;left:0;right:0;height:4px;cursor:ns-resize;z-index:100}.boundary-line:hover,.boundary-line.dragging{background-color:#666!important}.boundary-label{position:absolute;left:10px;top:-20px;background:inherit;color:#fff;padding:2px 8px;font-size:12px;border-radius:3px;pointer-events:none}.band-layer{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none}.band-placeholder{position:absolute;left:0;right:0;height:2px;background:repeating-linear-gradient(90deg,#999,#999 5px,transparent 5px,transparent 10px);cursor:pointer}.band-placeholder:hover{background:#ff6b6b!important}.band-area{position:absolute;left:0;right:0;box-sizing:border-box;cursor:pointer;overflow:hidden;opacity:.85;transition:all .3s}.band-area:hover,.band-area.selected{opacity:.95}.band-area.selected{border-color:#ff6b6b!important}.band-label{position:absolute;top:5px;left:5px;background:#ffffffe6;padding:2px 6px;font-size:12px;color:#333;border-radius:3px;pointer-events:none}.object-layer{position:absolute;top:0;left:0;right:0;bottom:0}.design-object{position:absolute;cursor:move;-webkit-user-select:none;user-select:none}.band-controls{padding:10px 20px;background:#fff;border-top:1px solid #ddd;display:flex;gap:20px;flex-wrap:wrap}.band-control{display:flex;align-items:center;gap:10px;padding:8px 12px;background:#f8f9fa;border-radius:4px;font-size:14px}.band-name{font-weight:500;min-width:60px}.band-height{min-width:50px;text-align:right;color:#666}.property-panel{width:300px;background:#fafafa;border-left:1px solid #ddd;overflow-y:auto}.property-panel h3{margin:0 0 15px;font-size:16px;color:#333}.property-editor{display:flex;flex-direction:column;gap:20px}.property-group{border:1px solid #eee}.property-group h4{margin:0 0 10px;font-size:14px;color:#333;font-weight:500}.property-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.property-row:last-child{margin-bottom:0}.property-row label{font-size:14px;color:#666;min-width:80px}.property-row input[type=text],.property-row input[type=number]{width:150px;padding:4px 8px;border:1px solid #ddd;border-radius:4px;font-size:14px}.property-row input[type=color]{width:50px;height:30px;border:1px solid #ddd;border-radius:4px;cursor:pointer}.color-input-wrapper{display:flex;align-items:center;gap:4px}.btn-clear-color{width:24px;height:24px;padding:0;border:1px solid #ddd;border-radius:4px;background:#fff;color:#999;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease}.btn-clear-color:hover{background:#fff1f0;border-color:#ff4d4f;color:#ff4d4f}.property-row input[type=checkbox]{width:16px;height:16px;cursor:pointer}.property-value{font-size:14px;color:#333;font-weight:500}.property-actions{margin-top:20px;padding-top:20px;border-top:1px solid #eee;text-align:center}.empty-state{color:#999;text-align:center;padding:40px 20px}.empty-state p{margin:10px 0 0}.status-bar{padding:8px 20px;background:#fff;border-top:1px solid #ddd;display:flex;gap:30px;font-size:13px;color:#666}.status-item{display:flex;align-items:center;gap:5px}.status-item span:first-child{font-weight:500;color:#333}@media(max-width:1200px){.canvas-container{width:600px;height:900px}}@media(max-width:900px){.workspace{flex-direction:column}.control-panel{width:100%;height:200px;border-right:none;border-bottom:1px solid #ddd}.property-panel{width:100%;height:300px;border-left:none;border-top:1px solid #ddd}.canvas-container{width:100%;height:600px}}.band-area.dragging{transition:all .1s ease}.band-object-count{position:absolute;bottom:5px;right:5px;background:#0000001a;padding:2px 6px;font-size:10px;border-radius:3px;color:#666}.boundary-line{position:absolute;left:0;right:0;height:20px;background-color:#f3f3f3;cursor:ns-resize;z-index:1000;transition:background-color .2s ease;border-top:1px solid #aeadad;border-bottom:1px solid #aeadad}.boundary-label{position:absolute;top:50%;left:0%;transform:translateY(-50%);padding:2px 8px;border-radius:4px;font-size:12px;color:#c3c3c3;white-space:nowrap;background:transparent}.text-content-wrapper{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;margin:0;padding:0}.text-content{box-sizing:border-box;white-space:pre-wrap;word-break:break-word;overflow:hidden;width:100%}.multi-selection-info{margin-top:15px;padding:10px;background:#f5f5f5;border-radius:4px;border-left:3px solid #4d90fe}.multi-selection-info p{margin:5px 0;font-size:12px;color:#666}.multi-selection-info .btn-small{margin-top:8px;padding:4px 12px;font-size:12px}.status-bar .status-item:last-child{color:#4d90fe;font-weight:700}.toolbar .selected-count{background:#4d90fe;color:#fff;padding:2px 8px;border-radius:10px;font-size:12px;margin-left:5px}.band-controls{max-height:200px;overflow-y:auto}@keyframes object-focus-blink{0%,to{outline:2px solid #4d90fe;outline-offset:2px;box-shadow:0 0 8px #4d90fe99}50%{outline:2px solid #ff9800;outline-offset:2px;box-shadow:0 0 12px #ff9800cc}}.object-focus-blink{animation:object-focus-blink .5s ease-in-out 3;z-index:9999!important}.context-menu{background:#fff;border:1px solid #d9d9d9;border-radius:6px;box-shadow:0 6px 16px #0000001f;min-width:180px;padding:4px 0;font-size:13px;-webkit-user-select:none;user-select:none}.context-menu-item{display:flex;align-items:center;padding:6px 12px;cursor:pointer;position:relative;transition:background-color .15s}.context-menu-item:hover{background-color:#f5f5f5}.context-menu-item[data-disabled=true]{opacity:.4;cursor:not-allowed;pointer-events:none}.context-menu-item.delete:hover{background-color:#fff1f0;color:#ff4d4f}.menu-icon{width:20px;margin-right:8px;text-align:center;font-size:12px}.menu-label{flex:1}.menu-shortcut{color:#999;font-size:11px;margin-left:16px}.menu-arrow{color:#999;font-size:10px;margin-left:8px}.context-menu-divider{height:1px;background-color:#e8e8e8;margin:4px 0}.context-menu-submenu{position:relative}.context-submenu{position:absolute;left:100%;top:-4px;background:#fff;border:1px solid #d9d9d9;border-radius:6px;box-shadow:0 6px 16px #0000001f;min-width:150px;padding:4px 0;display:none;z-index:1}.context-menu-submenu:hover>.context-submenu{display:block}.context-submenu .context-menu-item{padding:6px 16px}.context-submenu .context-menu-item:hover{background-color:#f5f5f5}@keyframes contextMenuFadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.context-menu{animation:contextMenuFadeIn .1s ease-out}.selection-rect{box-sizing:border-box}.selected-object-border{box-sizing:border-box;animation:pulse-border 2s infinite}@keyframes pulse-border{0%{border-color:#4d90fe}50%{border-color:#4d90fe80}to{border-color:#4d90fe}}.canvas-nav{display:flex;justify-content:space-between;align-items:center;padding:8px 16px;background:#f5f5f5;border-bottom:1px solid #ddd}.keyboard-hint{font-size:12px;color:#666;background:#fff;padding:4px 8px;border-radius:4px;border:1px solid #ddd}.canvas-container.selecting{cursor:crosshair!important}.canvas-container.moving{cursor:move!important}.shortcut-hint{position:fixed;bottom:20px;right:20px;background:#000c;color:#fff;padding:10px 15px;border-radius:6px;font-size:12px;z-index:3000}.shortcut-hint kbd{background:#333;padding:2px 6px;border-radius:3px;margin:0 2px;font-family:monospace}.rich-text-content{width:100%;height:100%;overflow:hidden}.rich-text-content p{margin:0 0 .3em}.rich-text-content p:last-child{margin-bottom:0}.rich-text-content ul,.rich-text-content ol{margin:.3em 0;padding-left:1.2em}.rich-text-content li{margin:.1em 0}.rich-text-content b,.rich-text-content strong{font-weight:700}.rich-text-content i,.rich-text-content em{font-style:italic}.rich-text-content u{text-decoration:underline}.rich-text-content strike,.rich-text-content s{text-decoration:line-through}.color-picker{position:relative;display:inline-flex}.color-picker.disabled{opacity:.6;cursor:not-allowed}.color-preview-btn{display:flex;align-items:center;gap:4px;padding:2px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;cursor:pointer;transition:border-color .2s}.color-preview-btn:hover{border-color:#1890ff}.color-picker.disabled .color-preview-btn{cursor:not-allowed;background:#f5f5f5}.color-swatch{width:24px;height:20px;border-radius:2px;border:1px solid #e8e8e8;display:flex;align-items:center;justify-content:center}.no-color-icon{font-size:18px;color:#999}.dropdown-arrow{display:flex;align-items:center;color:#999;margin-left:2px}.color-panel{position:absolute;top:100%;left:0;margin-top:4px;padding:8px;background:#fff;border:1px solid #e8e8e8;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:10000;width:190px}.preset-colors{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;margin-bottom:8px}.color-item{width:24px;height:24px;border-radius:4px;cursor:pointer;border:2px solid transparent;transition:all .15s}.color-item:hover{transform:scale(1.1);border-color:#1890ff}.color-item.active{border-color:#1890ff;box-shadow:0 0 0 2px #1890ff4d}.color-item.clear-color{background:#fff!important;border:1px solid #d9d9d9!important;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.color-item.clear-color:after{content:"";position:absolute;width:30px;height:2px;background:#ff4d4f;transform:rotate(-45deg);left:50%;top:50%;margin-left:-15px;margin-top:-1px}.color-item.clear-color:hover{border-color:#ff4d4f!important}.clear-icon{display:none}.custom-color-row{border-top:1px solid #f0f0f0;padding-top:8px}.btn-custom-color{width:100%;padding:6px 12px;border:1px solid #d9d9d9;border-radius:4px;background:#fafafa;color:#666;font-size:12px;cursor:pointer;transition:all .15s}.btn-custom-color:hover{background:#e6f7ff;border-color:#1890ff;color:#1890ff}.band-property-panel{width:300px;background:#fafafa;border-left:1px solid #e8e8e8;display:flex;flex-direction:column;height:100%;overflow:hidden}.band-property-panel h3{margin:0;padding:12px 16px;font-size:14px;font-weight:600;color:#333;background:#fff;border-bottom:1px solid #e8e8e8;flex-shrink:0}.band-property-editor{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:12px}.band-property-editor::-webkit-scrollbar{width:6px}.band-property-editor::-webkit-scrollbar-track{background:transparent}.band-property-editor::-webkit-scrollbar-thumb{background:#d9d9d9;border-radius:3px}.band-property-editor::-webkit-scrollbar-thumb:hover{background:#bfbfbf}.band-property-group{background:#fff;border:1px solid #e8e8e8;border-radius:6px;flex-shrink:0}.band-property-group.control-list-group{flex:1;flex-shrink:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.band-property-group.control-list-group .object-list{flex:1;min-height:0;overflow-y:auto;border-top:1px solid #e8e8e8;background-color:#fafafa}.band-property-group.control-list-group .object-list::-webkit-scrollbar{width:6px}.band-property-group.control-list-group .object-list::-webkit-scrollbar-track{background:transparent}.band-property-group.control-list-group .object-list::-webkit-scrollbar-thumb{background:#d9d9d9;border-radius:3px}.band-property-group.control-list-group .object-list::-webkit-scrollbar-thumb:hover{background:#bfbfbf}.band-property-group h4{margin:0;padding:10px 12px;font-size:13px;font-weight:600;color:#333;background:#fafafa;border-bottom:1px solid #e8e8e8}.band-property-row{display:flex;align-items:center;padding:10px 12px;border-bottom:1px solid #f0f0f0;gap:8px}.band-property-row:last-child{border-bottom:none}.band-property-row label{font-size:13px;color:#666;width:80px;flex-shrink:0}.band-property-row>div{flex:1;min-width:0}.band-property-value{font-size:13px;color:#333;padding:4px 8px;background:#f5f5f5;border-radius:4px}.band-property-row input[type=text],.band-property-row input[type=number]{padding:6px 10px;border:1px solid #d9d9d9;border-radius:4px;font-size:13px;color:#333;background:#fff;outline:none;transition:border-color .2s;min-width:0}.band-property-row input[type=number]{width:80px}.band-property-row input[type=text]{flex:1}.band-property-row input[type=text]:hover,.band-property-row input[type=number]:hover{border-color:#40a9ff}.band-property-row input[type=text]:focus,.band-property-row input[type=number]:focus{border-color:#40a9ff;box-shadow:0 0 0 2px #1890ff1a}.band-property-row select{flex:1;padding:6px 10px;border:1px solid #d9d9d9;border-radius:4px;font-size:13px;color:#333;background:#fff;cursor:pointer;outline:none}.band-property-row select:hover{border-color:#40a9ff}.band-property-row select:focus{border-color:#40a9ff;box-shadow:0 0 0 2px #1890ff1a}.band-property-row input[type=color]{width:32px;height:24px;padding:0;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer}@media(max-width:1200px){.band-property-panel{width:280px}}.rich-text-editor{border:1px solid #d9d9d9;border-radius:4px;background:#fff}.rte-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:2px;padding:4px 6px;background:#fafafa;border-bottom:1px solid #e8e8e8}.rte-btn{display:flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:1px solid transparent;border-radius:4px;background:transparent;color:#333;font-size:13px;cursor:pointer;transition:all .15s}.rte-btn:hover{background:#e6f7ff;border-color:#91d5ff}.rte-btn:active{background:#bae7ff}.rte-select{height:26px;min-width:80px!important;padding:0 6px!important;border:1px solid #d9d9d9;border-radius:4px;font-size:12px;cursor:pointer;background:#fff}.rte-select:focus{outline:none;border-color:#1890ff}.rte-color{width:26px;height:26px;padding:2px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;background:#fff}.rte-color::-webkit-color-swatch-wrapper{padding:2px}.rte-color::-webkit-color-swatch{border:none;border-radius:2px}.rte-separator{width:1px;height:20px;margin:0 4px;background:#e8e8e8}.rte-content{padding:8px 10px;min-height:120px;max-height:300px;overflow-y:auto;font-size:14px;line-height:1.6;outline:none}.rte-content:empty:before{content:attr(data-placeholder);color:#bfbfbf;pointer-events:none}.rte-content:focus{background:#fafafa}.rte-content p{margin:0 0 .5em}.rte-content ul,.rte-content ol{margin:.5em 0;padding-left:1.5em}.rte-content li{margin:.25em 0}.property-panel{width:300px;background:linear-gradient(180deg,#fafbfc,#f6f8fa);border-left:1px solid #e1e4e8;display:flex;flex-direction:column;height:100%;overflow:hidden}.property-panel-header{display:flex;align-items:center;gap:10px;padding:8px;flex-shrink:0}.property-panel-header .type-icon{width:36px;height:36px;background:#4d90fe;border-radius:8px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:16px;font-weight:600}.property-panel-header .type-info{flex:1}.property-panel-header .type-name{font-size:15px;font-weight:600;color:#24292e;margin:0 0 2px}.property-panel-header .type-id{font-size:11px;color:#6a737d;font-family:SFMono-Regular,Consolas,monospace}.property-editor{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.property-editor::-webkit-scrollbar{width:6px}.property-editor::-webkit-scrollbar-track{background:transparent}.property-editor::-webkit-scrollbar-thumb{background:#d1d5da;border-radius:3px}.property-editor::-webkit-scrollbar-thumb:hover{background:#959da5}.property-group{background:#fff;border:1px solid #e1e4e8;box-shadow:0 1px 3px #0000000a}.property-group-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;background:linear-gradient(180deg,#fafbfc,#f6f8fa);border-bottom:1px solid #e1e4e8;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .15s ease}.property-group-header:hover{background:linear-gradient(180deg,#f3f4f6,#ebedf0)}.property-group-header h4{margin:0;font-size:12px;font-weight:600;color:#24292e;text-transform:uppercase;letter-spacing:.5px;display:flex;align-items:center;gap:6px}.property-group-header h4:before{content:"";width:3px;height:12px;background:linear-gradient(180deg,#667eea,#764ba2);border-radius:2px}.property-group-header .collapse-icon{font-size:10px;color:#6a737d;transition:transform .2s ease}.property-group-header .collapse-icon.collapsed{transform:rotate(-90deg)}.property-group-content{padding:12px}.property-group-content.collapsed{display:none}.property-panel .property-row{display:flex;align-items:center;margin-bottom:12px}.property-panel .property-row:last-child{margin-bottom:0}.property-panel .property-row label{font-size:13px;color:#586069;width:72px;flex-shrink:0}.property-panel .property-row .property-value{font-size:13px;color:#24292e;font-weight:500;padding:6px 10px;background:#f6f8fa;border-radius:4px;flex:1}.property-panel .property-row input[type=text],.property-panel .property-row textarea{flex:1;padding:6px 10px;border:1px solid #d1d5da;border-radius:4px;font-size:13px;color:#24292e;background:#fff;outline:none;min-width:0}.property-panel .property-row input[type=number]{flex:1;flex-shrink:0;padding:6px 10px;border:1px solid #d1d5da;border-radius:4px;font-size:13px;color:#24292e;background:#fff;outline:none}.property-panel .property-row input:hover,.property-panel .property-row textarea:hover,.property-panel .property-row select:hover{border-color:#0366d6}.property-panel .property-row input:focus,.property-panel .property-row textarea:focus,.property-panel .property-row select:focus{border-color:#0366d6;box-shadow:0 0 0 2px #0366d61a}.property-panel .property-row input:disabled{background:#f6f8fa;color:#6a737d;cursor:not-allowed}.property-panel .property-row select{flex:1;padding:6px 10px;border:1px solid #d1d5da;border-radius:4px;font-size:13px;color:#24292e;background:#fff;cursor:pointer;outline:none;min-width:0}.property-panel .property-row input[type=checkbox]{width:16px;height:16px;cursor:pointer;accent-color:#0366d6;flex-shrink:0}.property-panel .checkbox-wrapper{display:flex;align-items:center;gap:8px}.property-panel .checkbox-wrapper .checkbox-label{font-size:12px;color:#586069}.property-panel .color-input-wrapper{display:flex;align-items:center;gap:6px;flex:1}.property-panel .property-row input[type=color]{width:36px;height:32px;border:1px solid #d1d5da;border-radius:6px;cursor:pointer;padding:2px;background:#fff;flex-shrink:0}.property-panel .property-row input[type=color]:hover{border-color:#0366d6}.property-panel .color-value{font-size:11px;color:#6a737d;font-family:SFMono-Regular,Consolas,monospace;background:#f6f8fa;padding:4px 8px;border-radius:4px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.property-panel .btn-clear-color{width:28px;height:28px;padding:0;border:1px solid #d1d5da;border-radius:6px;background:#fff;color:#6a737d;font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease;flex-shrink:0}.property-panel .btn-clear-color:hover{background:#ffeef0;border-color:#d73a49;color:#d73a49}.btn-sm{padding:5px 12px;font-size:12px;font-weight:500;border-radius:6px;border:1px solid transparent;cursor:pointer;transition:all .15s ease}.btn-primary{background:linear-gradient(180deg,#0366d6,#0256b9);color:#fff;border-color:#0256b9}.btn-primary:hover{background:linear-gradient(180deg,#0256b9,#044289)}.btn-secondary{background:#f6f8fa;color:#24292e;border-color:#d1d5da}.btn-secondary:hover{background:#e1e4e8}.alignment-buttons{display:flex;gap:4px;flex:1}.alignment-btn{flex:1;height:32px;border:1px solid #d1d5da;border-radius:6px;background:#fff;color:#6a737d;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease}.alignment-btn:hover{border-color:#0366d6;color:#0366d6}.alignment-btn.active{background:linear-gradient(180deg,#0366d6,#0256b9);border-color:#0256b9;color:#fff}.padding-inputs{display:grid;grid-template-columns:1fr 1fr;gap:8px;flex:1}.padding-input-item{display:flex;align-items:center;gap:4px}.padding-input-item .padding-label{font-size:11px;color:#6a737d;min-width:16px}.padding-inputs input{width:50px!important;text-align:center;padding:4px 6px!important;font-size:12px}.padding-hint{display:none}.zindex-controls{display:flex;align-items:center;gap:6px;flex:1}.zindex-controls input{width:60px!important}.zindex-btn{padding:4px 8px;font-size:11px;border:1px solid #d1d5da;border-radius:4px;background:#f6f8fa;color:#586069;cursor:pointer;transition:all .15s ease;display:flex;align-items:center;gap:3px}.zindex-btn:hover{background:#e1e4e8;border-color:#959da5}.image-preview-container{width:100%;height:80px;border:1px solid #e1e4e8;border-radius:6px;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#f6f8fa;margin-top:8px}.image-preview-container img{max-width:100%;max-height:100%;object-fit:contain}.file-upload-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:linear-gradient(180deg,#0366d6,#0256b9);color:#fff;border-radius:6px;font-size:12px;font-weight:500;cursor:pointer;transition:all .15s ease}.file-upload-btn:hover{background:linear-gradient(180deg,#0256b9,#044289)}.file-clear-btn{padding:6px 10px;background:#fff;color:#d73a49;border:1px solid #d73a49;border-radius:6px;font-size:12px;cursor:pointer;transition:all .15s ease}.file-clear-btn:hover{background:#ffeef0}.formula-input-wrapper{display:flex;gap:6px;flex:1;min-width:0}.formula-input-wrapper input{flex:1;min-width:0}.btn-edit-formula{padding:6px 12px;background:linear-gradient(180deg,#28a745,#22863a);color:#fff;border:none;border-radius:6px;font-size:12px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all .15s ease;flex-shrink:0}.btn-edit-formula:hover{background:linear-gradient(180deg,#22863a,#176f2c)}.property-actions{padding:12px;background:#fff;border-top:1px solid #e1e4e8;flex-shrink:0}.btn-danger{width:100%;padding:10px;background:linear-gradient(180deg,#d73a49,#cb2431);color:#fff;border:none;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:all .15s ease;display:flex;align-items:center;justify-content:center;gap:6px}.btn-danger:hover{background:linear-gradient(180deg,#cb2431,#9e1c23)}.btn-danger:before{content:"🗑";font-size:14px}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;color:#6a737d;text-align:center}.empty-state-icon{font-size:48px;margin-bottom:16px;opacity:.5}.empty-state-text{font-size:14px;line-height:1.5}@media(max-width:1200px){.property-panel{width:280px}}@media(max-width:900px){.property-panel{width:100%;height:300px;border-left:none;border-top:1px solid #e1e4e8}}.multi-select-toolbar{display:flex;align-items:center;padding:8px 12px;background:#fff;border-bottom:1px solid #e8e8e8;flex-wrap:wrap;width:100%;box-sizing:border-box;gap:4px}.toolbar-section{display:flex;align-items:center;gap:8px}.toolbar-section:last-child{border-right:none}.section-label{font-size:12px;font-weight:600;color:#1890ff;white-space:nowrap;margin-right:4px}.type-hint{font-size:11px;color:#999;margin-left:4px}.section-title{font-size:12px;color:#666;font-weight:500}.toolbar-buttons{display:flex;align-items:center;gap:2px}.toolbar-btn{display:flex;align-items:center;justify-content:center;min-width:28px;height:28px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;color:#333;font-size:12px;cursor:pointer;transition:all .15s ease}.toolbar-btn:hover{background:#e6f7ff;border-color:#1890ff;color:#1890ff}.toolbar-btn:active{background:#bae7ff}.toolbar-btn:disabled{background:#f5f5f5;border-color:#d9d9d9;color:#bfbfbf;cursor:not-allowed;opacity:.6}.toolbar-btn:disabled:hover{background:#f5f5f5;border-color:#d9d9d9;color:#bfbfbf}.toolbar-btn.active{background:#1890ff;border-color:#1890ff;color:#fff}.toolbar-btn svg{flex-shrink:0}.toolbar-btn.btn-clear{background:#fff;border-color:#ff7875;color:#ff4d4f}.toolbar-btn.btn-clear:hover{background:#fff1f0;border-color:#ff4d4f}.toolbar-btn.btn-delete{display:flex;align-items:center;gap:4px;background:#fff;border-color:#d9d9d9;color:#333}.toolbar-btn.btn-delete:hover:not(:disabled){background:#fff1f0;border-color:#ff4d4f;color:#ff4d4f}.toolbar-btn.btn-delete:disabled{background:#f5f5f5;border-color:#d9d9d9;color:#bfbfbf}.separator{width:1px;height:20px;background:#e8e8e8;margin:0 4px}.toolbar-controls{display:flex;align-items:center;gap:6px}.toolbar-control-item{display:flex;align-items:center;gap:4px;font-size:12px;color:#666}.toolbar-control-item span{font-size:12px;color:#666}.toolbar-control-item input[type=number]{width:56px;height:26px;border:1px solid #d9d9d9;border-radius:4px;font-size:12px;text-align:center;margin:0;padding:0}.toolbar-control-item input[type=number]:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px #1890ff1a}.toolbar-control-item input[type=color]{width:28px;height:26px;padding:2px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;overflow:hidden}.toolbar-control-item input[type=color]::-webkit-color-swatch-wrapper{padding:2px}.toolbar-control-item input[type=color]::-webkit-color-swatch{border:none;border-radius:2px}.toolbar-control-item input:disabled,.toolbar-control-item select:disabled{background:#f5f5f5;border-color:#d9d9d9;color:#bfbfbf;cursor:not-allowed;opacity:.6}.toolbar-control-item select{height:26px;padding:2px 8px;border:1px solid #d9d9d9;border-radius:4px;font-size:12px;background:#fff;cursor:pointer}.toolbar-control-item select:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px #1890ff1a}.toolbar-actions{display:flex;align-items:center}.color-input-group{display:flex;align-items:center;gap:2px}.btn-clear-sm{width:20px;height:20px;padding:0;border:1px solid #d9d9d9;border-radius:4px;background:#fff;color:#999;font-size:12px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease}.btn-clear-sm:hover:not(:disabled){background:#fff1f0;border-color:#ff4d4f;color:#ff4d4f}.btn-clear-sm:disabled{background:#f5f5f5;border-color:#d9d9d9;color:#d9d9d9;cursor:not-allowed}@media(max-width:1400px){.multi-select-toolbar{gap:4px;padding:8px 12px}.toolbar-section{padding:4px 8px}}@media(max-width:1200px){.section-title{display:none}}.toolbar-dropdown-btn{gap:4px;padding:0 8px}.dropdown-arrow{font-size:8px;color:#999;margin-left:2px}.toolbar-dropdown-menu{position:fixed;margin-top:4px;background:#fff;border:1px solid #e8e8e8;border-radius:6px;box-shadow:0 6px 16px #0000001f;z-index:10000;min-width:160px;padding:4px 0}.control-dropdown{min-width:180px}.dropdown-category{padding:4px 0}.category-title{padding:6px 12px 4px;font-size:11px;color:#999;font-weight:500;text-transform:uppercase;letter-spacing:.5px}.dropdown-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;transition:background .15s}.dropdown-item:hover{background:#e6f7ff}.item-icon{width:24px;font-size:14px;text-align:center;margin-right:8px}.item-name{font-size:13px;color:#333}.dropdown-divider{height:1px;background:#e8e8e8;margin:4px 0}.toolbar-section{position:relative}.field-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:2000}.field-modal{background:#fff;border-radius:8px;box-shadow:0 8px 24px #0003;width:520px;max-height:80vh;display:flex;flex-direction:column;animation:modalFadeIn .2s ease-out}@keyframes modalFadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.field-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e8e8e8}.field-modal-header h3{margin:0;font-size:16px;font-weight:600;color:#333}.modal-close-btn{width:28px;height:28px;border:none;background:transparent;font-size:20px;color:#999;cursor:pointer;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:all .15s}.modal-close-btn:hover{background:#f5f5f5;color:#333}.field-modal-body{padding:16px 20px;max-height:400px;overflow-y:auto}.field-group{margin-bottom:16px}.field-group:last-child{margin-bottom:0}.field-group-title{font-size:13px;font-weight:600;color:#333;margin-bottom:8px;padding:4px 8px;background:#f5f5f5;border-radius:4px}.field-list{display:flex;flex-wrap:wrap;gap:8px}.field-item{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;transition:all .15s;flex:0 0 calc(50% - 4px);box-sizing:border-box}.field-item:hover,.field-item.selected{border-color:#1890ff;background:#e6f7ff}.field-item input[type=checkbox]{width:16px;height:16px;cursor:pointer}.field-label{font-size:13px;color:#333;font-weight:500}.field-name{font-size:11px;color:#999;margin-left:auto}.field-modal-footer{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-top:1px solid #e8e8e8;background:#fafafa;border-radius:0 0 8px 8px}.arrangement-options{display:flex;align-items:center;gap:12px;font-size:13px;color:#666}.arrangement-options label{display:flex;align-items:center;gap:4px;cursor:pointer}.arrangement-options input[type=radio]{width:14px;height:14px;cursor:pointer}.modal-buttons{display:flex;gap:8px}.modal-buttons .btn{padding:6px 16px;border-radius:4px;font-size:13px;cursor:pointer;transition:all .15s}.modal-buttons .btn-cancel{border:1px solid #d9d9d9;background:#fff;color:#666}.modal-buttons .btn-cancel:hover{border-color:#40a9ff;color:#40a9ff}.modal-buttons .btn-confirm{border:1px solid #1890ff;background:#1890ff;color:#fff}.modal-buttons .btn-confirm:hover{background:#40a9ff;border-color:#40a9ff}.modal-buttons .btn-confirm:disabled{background:#f5f5f5;border-color:#d9d9d9;color:#bfbfbf;cursor:not-allowed}.toolbar-btn.btn-primary{background:#1890ff;border-color:#1890ff;color:#fff}.toolbar-btn.btn-primary:hover{background:#40a9ff;border-color:#40a9ff}.print-preview-modal{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10000;display:flex;justify-content:center;align-items:center;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.preview-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#0009;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.preview-container{position:relative;background:#fff;border-radius:12px;box-shadow:0 10px 40px #0003,0 0 0 1px #ffffff1a;width:900px;max-width:95%;height:95vh;display:flex;flex-direction:column;animation:slideIn .3s ease-out}@keyframes slideIn{0%{opacity:0;transform:translateY(20px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.preview-toolbar{padding:12px 20px;background:linear-gradient(135deg,#f8f9fa,#e9ecef);border-bottom:1px solid #dee2e6;display:flex;justify-content:space-between;align-items:center;flex-shrink:0;min-height:60px;box-shadow:0 2px 8px #0000000d}.toolbar-left,.toolbar-center,.toolbar-right{display:flex;align-items:center;gap:12px}.btn{padding:8px 16px;border:1px solid #d9d9d9;background:#fff;border-radius:6px;cursor:pointer;font-size:14px;font-weight:500;transition:all .2s cubic-bezier(.645,.045,.355,1);color:#333;display:inline-flex;align-items:center;justify-content:center;gap:6px;position:relative;overflow:hidden}.btn:before{content:"";position:absolute;top:50%;left:50%;width:0;height:0;border-radius:50%;background:#0000001a;transform:translate(-50%,-50%);transition:width .4s,height .4s}.btn:hover:before{width:200px;height:200px}.btn:hover{border-color:#40a9ff;color:#40a9ff;transform:translateY(-1px);box-shadow:0 4px 12px #1890ff33}.btn:active{transform:translateY(0);box-shadow:0 2px 6px #1890ff33}.btn-primary{background:linear-gradient(135deg,#1890ff,#096dd9);color:#fff;border:none;box-shadow:0 2px 8px #1890ff4d}.btn-primary:hover{background:linear-gradient(135deg,#40a9ff,#1890ff);color:#fff;border:none;box-shadow:0 4px 12px #1890ff66}.btn-danger{background:#ff4d4f;color:#fff;border:none}.btn-danger:hover{background:#ff7875;color:#fff;border:none}.btn-small{padding:4px 12px;font-size:13px;min-height:28px}.zoom-select{padding:6px 10px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;font-size:14px;color:#333;cursor:pointer;transition:all .2s;min-width:90px}.zoom-select:hover{border-color:#40a9ff}.zoom-select:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px #1890ff33}.page-controls{display:flex;align-items:center;gap:8px;margin-left:20px;background:#fffc;padding:6px 12px;border-radius:8px;border:1px solid #e8e8e8}.page-info{display:flex;align-items:center;gap:8px;font-size:14px;color:#595959;font-weight:500}.page-input{width:60px;padding:4px 8px;border:1px solid #d9d9d9;border-radius:4px;text-align:center;font-size:14px;color:#333;transition:all .2s}.page-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px #1890ff33}.data-info{font-size:14px;color:#595959;background:#fff;padding:6px 12px;border-radius:6px;border:1px solid #e8e8e8;display:flex;align-items:center;gap:8px}.data-info:before{content:"📊";font-size:16px}.preview-content{flex:1;padding:20px;background:linear-gradient(135deg,#f5f5f5,#f0f0f0);position:relative;overflow-y:scroll}.preview-page{width:794px;height:1123px;background-color:#fff;box-shadow:0 8px 32px #00000026;position:relative;margin:0 auto;transform-origin:top center;border-radius:2px;overflow:hidden;border:1px solid #e0e0e0}.page-margins{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none}.margin-top{position:absolute;top:0;left:0;right:0;height:40px;border-bottom:2px dashed rgba(64,169,255,.3)}.margin-bottom{position:absolute;bottom:0;left:0;right:0;height:40px;border-top:2px dashed rgba(64,169,255,.3)}.margin-left{position:absolute;top:0;bottom:0;left:0;width:30px;border-right:2px dashed rgba(64,169,255,.3)}.margin-right{position:absolute;top:0;bottom:0;right:0;width:30px;border-left:2px dashed rgba(64,169,255,.3)}.preview-band{position:absolute;overflow:visible}.detail-row{position:absolute;left:0;width:100%}.page-number{position:absolute;bottom:15px;right:35px;font-size:12px;color:#8c8c8c;background:#ffffffe6;padding:4px 12px;border-radius:12px;border:1px solid #f0f0f0;font-family:Arial,sans-serif}.preview-stats{padding:16px 20px;background:linear-gradient(135deg,#fafafa,#f5f5f5);border-top:1px solid #f0f0f0;display:flex;gap:32px;flex-shrink:0;justify-content:center;align-items:center}.stat-item{display:flex;align-items:center;gap:8px;font-size:13px;color:#666;padding:8px 16px;background:#fff;border-radius:8px;border:1px solid #e8e8e8;box-shadow:0 2px 4px #00000005;transition:all .2s}.stat-item:hover{transform:translateY(-1px);box-shadow:0 4px 8px #0000000d;border-color:#d9d9d9}.stat-item span:first-child{color:#8c8c8c;font-weight:500}.stat-item span:last-child{color:#1890ff;font-weight:600}.preview-content::-webkit-scrollbar{width:8px;height:8px}.preview-content::-webkit-scrollbar-track{background:#0000000d;border-radius:4px}.preview-content::-webkit-scrollbar-thumb{background:#0003;border-radius:4px}.preview-content::-webkit-scrollbar-thumb:hover{background:#0000004d}@media(max-width:1400px){.preview-container{width:98%}.preview-page{transform:scale(.9)}}@media(max-width:1200px){.preview-page{transform:scale(.8)}.preview-toolbar{flex-wrap:wrap;gap:10px}.toolbar-center{order:3;width:100%;justify-content:center;margin-top:10px}}@media(max-width:768px){.preview-container{height:95vh;border-radius:0;width:100%}.preview-page{transform:scale(.7)}.preview-stats{flex-wrap:wrap;gap:12px;justify-content:flex-start;overflow-x:auto}.stat-item{flex-shrink:0}}@media print{.print-preview-modal{position:static;background:#fff}.preview-overlay,.preview-toolbar,.preview-stats,.page-margins,.margin-top,.margin-bottom,.margin-left,.margin-right,.data-info,.page-controls,.multi-select-toolbar,.status-bar{display:none!important}.preview-container{width:100%;height:auto;box-shadow:none;border:none;border-radius:0}.preview-content{padding:0;background:#fff}.preview-page{box-shadow:none!important;margin:0!important;transform:none!important;page-break-after:always;border:none}.preview-page:last-child{page-break-after:auto}.page-margins{display:none!important}}@page{margin:0}@keyframes pulse{0%,to{opacity:1}50%{opacity:.6}}.loading{animation:pulse 1.5s ease-in-out infinite}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;height:200px;color:#bfbfbf;gap:16px}.empty-state svg{width:64px;height:64px;opacity:.3}.empty-state p{font-size:16px;font-weight:500}.tooltip{position:relative;display:inline-block}.tooltip .tooltip-text{visibility:hidden;width:200px;background-color:#333;color:#fff;text-align:center;border-radius:6px;padding:8px;position:absolute;z-index:1;bottom:125%;left:50%;margin-left:-100px;opacity:0;transition:opacity .3s;font-size:12px;line-height:1.4}.tooltip:hover .tooltip-text{visibility:visible;opacity:.9}.custom-scrollbar{scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.2) transparent}.page-settings-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000}.page-settings-panel{background:#fff;border-radius:8px;box-shadow:0 4px 20px #00000026;width:400px;max-height:90vh;display:flex;flex-direction:column}.page-settings-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #eee}.page-settings-header h3{margin:0;font-size:16px;font-weight:600;color:#333}.page-settings-header .close-btn{background:none;border:none;font-size:20px;color:#999;cursor:pointer;padding:0;line-height:1}.page-settings-header .close-btn:hover{color:#333}.page-settings-content{padding:20px;overflow-y:auto;flex:1}.settings-section{margin-bottom:20px}.settings-section:last-child{margin-bottom:0}.section-label{display:block;font-size:13px;font-weight:500;color:#333;margin-bottom:8px}.settings-select{width:100%;padding:8px 12px;border:1px solid #ddd;border-radius:4px;font-size:14px;color:#333;background:#fff;cursor:pointer}.settings-select:focus{outline:none;border-color:#4a90d9}.dimensions-section .dimension-row{display:flex;align-items:center;gap:10px;margin-bottom:10px}.dimensions-section .dimension-row:last-child{margin-bottom:0}.dimensions-section .dimension-row label{width:40px;font-size:13px;color:#666}.dimensions-section .dimension-row input{flex:1;padding:6px 10px;border:1px solid #ddd;border-radius:4px;font-size:14px}.dimensions-section .dimension-row input:disabled{background:#f5f5f5;color:#999}.dimensions-section .dimension-row .unit{width:30px;font-size:12px;color:#999}.orientation-options{display:flex;gap:20px}.orientation-option{display:flex;align-items:center;gap:8px;cursor:pointer}.orientation-option input{margin:0}.orientation-icon{display:flex;align-items:center;justify-content:center;color:#666}.orientation-option input:checked+.orientation-icon{color:#4a90d9}.orientation-icon.landscape svg{transform:rotate(90deg)}.margins-section .margins-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.margin-input{display:flex;align-items:center;gap:4px}.margin-input label{width:16px;flex-shrink:0;font-size:13px;color:#666}.margin-input input{flex:1;min-width:0;width:50px;padding:6px 8px;border:1px solid #ddd;border-radius:4px;font-size:13px;box-sizing:border-box}.margin-input input:focus{outline:none;border-color:#4a90d9}.margin-input .unit{width:24px;flex-shrink:0;font-size:12px;color:#999}.preview-section{margin-top:20px;padding-top:20px;border-top:1px solid #eee}.page-preview-container{display:flex;flex-direction:column;align-items:center;gap:10px}.page-preview{width:100px;max-height:150px;background:#fff;border:1px solid #ccc;box-shadow:0 2px 8px #0000001a;position:relative}.page-preview-content{position:absolute;background:#f0f7ff;border:1px dashed #4a90d9}.page-preview-info{font-size:12px;color:#666}.page-settings-footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 20px;border-top:1px solid #eee}.btn{padding:8px 20px;border-radius:4px;font-size:14px;cursor:pointer;transition:all .2s}.btn-cancel{background:#fff;border:1px solid #ddd;color:#666}.btn-cancel:hover{background:#f5f5f5;border-color:#ccc}.btn-apply{background:#4a90d9;border:1px solid #4a90d9;color:#fff}.btn-apply:hover{background:#3a7bc8;border-color:#3a7bc8}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.react-band-designer{display:flex;flex-direction:column;height:100vh;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:#f5f5f5}.toolbar{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;background:#fff;border-bottom:1px solid #ddd;box-shadow:0 2px 4px #0000001a}.toolbar-left,.toolbar-right{display:flex;align-items:center;gap:10px}.btn{padding:6px 12px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer;font-size:14px;transition:all .2s}.btn:hover{background:#f0f0f0}.btn-primary{background:#4d90fe;color:#fff;border-color:#357ae8}.btn-primary:hover{background:#357ae8}.btn-danger{background:#ff6b6b;color:#fff;border-color:#ff5252}.btn-danger:hover{background:#ff5252}.btn-small{padding:3px 8px;font-size:12px}.checkbox{display:flex;align-items:center;gap:5px;font-size:14px;cursor:pointer}.workspace{display:flex;flex:1;overflow:hidden}.control-panel{width:155px;background:#fafafa;border-right:1px solid #ddd;padding:15px;overflow-y:auto}.control-panel h3{margin:0 0 15px;font-size:16px;color:#333}.control-group{margin-bottom:20px}.control-group h4{margin:0 0 10px;font-size:14px;color:#666;font-weight:500}.control-list{display:flex;flex-direction:row;gap:8px;flex-wrap:wrap}.control-item{display:flex;align-items:center;flex-direction:column;justify-content:center;background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;transition:all .2s;width:48px;font-size:12px;padding:8px}.control-item:hover{border-color:#4d90fe;background:#f0f7ff}.control-icon{width:24px;height:24px;background:#4d90fe;color:#fff;border-radius:3px;display:flex;align-items:center;justify-content:center;font-size:12px}.data-fields-panel{margin-top:20px;padding-top:20px;border-top:1px solid #eee}.panel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.panel-header h4{margin:0;font-size:14px;color:#333}.field-list{display:flex;flex-direction:column;gap:6px}.field-item{padding:6px 10px;background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;font-size:13px;transition:all .2s;margin-bottom:6px}.field-item:last-child{margin-bottom:0}.field-item:hover{border-color:#4d90fe;background:#f0f7ff}.field-group{margin-bottom:12px}.field-group-title{font-size:12px;color:#666;font-weight:500;padding:4px 0;margin-bottom:6px;border-bottom:1px solid #eee}.field-item.detail-field{background:#fff8e6;border-color:#ffd666}.field-item.detail-field:hover{background:#fff2cc;border-color:#faad14}.design-area{flex:1;display:flex;flex-direction:column;background:#f9f9f9}.canvas-nav{padding:10px 20px;background:#fff;border-bottom:1px solid #ddd;display:flex;justify-content:space-between;align-items:center;font-size:14px;color:#666}.position-info,.selected-info{display:flex;align-items:center;gap:5px}.canvas-wrapper{flex:1;overflow:auto;position:relative}.canvas-container{position:relative;width:100%;height:100%;margin:0 auto;background:#fff;box-shadow:0 2px 10px #0000001a}.grid-layer{position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(to right,rgba(0,0,0,.1) 1px,transparent 1px),linear-gradient(to bottom,rgba(0,0,0,.1) 1px,transparent 1px);pointer-events:none;opacity:.3}.boundary-layer{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:auto}.boundary-line{position:absolute;left:0;right:0;height:4px;cursor:ns-resize;z-index:100}.boundary-line:hover,.boundary-line.dragging{background-color:#666!important}.boundary-label{position:absolute;left:10px;top:-20px;background:inherit;color:#fff;padding:2px 8px;font-size:12px;border-radius:3px;pointer-events:none}.band-layer{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none}.band-placeholder{position:absolute;left:0;right:0;height:2px;background:repeating-linear-gradient(90deg,#999,#999 5px,transparent 5px,transparent 10px);cursor:pointer}.band-placeholder:hover{background:#ff6b6b!important}.band-area{position:absolute;left:0;right:0;box-sizing:border-box;cursor:pointer;overflow:hidden;opacity:.85;transition:all .3s}.band-area:hover,.band-area.selected{opacity:.95}.band-area.selected{border-color:#ff6b6b!important}.band-label{position:absolute;top:5px;left:5px;background:#ffffffe6;padding:2px 6px;font-size:12px;color:#333;border-radius:3px;pointer-events:none}.object-layer{position:absolute;top:0;left:0;right:0;bottom:0}.design-object{position:absolute;cursor:move;-webkit-user-select:none;user-select:none}.band-controls{padding:10px 20px;background:#fff;border-top:1px solid #ddd;display:flex;gap:20px;flex-wrap:wrap}.band-control{display:flex;align-items:center;gap:10px;padding:8px 12px;background:#f8f9fa;border-radius:4px;font-size:14px}.band-name{font-weight:500;min-width:60px}.band-height{min-width:50px;text-align:right;color:#666}.property-panel{width:300px;background:#fafafa;border-left:1px solid #ddd;overflow-y:auto}.property-panel h3{margin:0 0 15px;font-size:16px;color:#333}.property-editor{display:flex;flex-direction:column;gap:20px}.property-group{border:1px solid #eee}.property-group h4{margin:0 0 10px;font-size:14px;color:#333;font-weight:500}.property-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.property-row:last-child{margin-bottom:0}.property-row label{font-size:14px;color:#666;min-width:80px}.property-row input[type=text],.property-row input[type=number]{width:150px;padding:4px 8px;border:1px solid #ddd;border-radius:4px;font-size:14px}.property-row input[type=color]{width:50px;height:30px;border:1px solid #ddd;border-radius:4px;cursor:pointer}.color-input-wrapper{display:flex;align-items:center;gap:4px}.btn-clear-color{width:24px;height:24px;padding:0;border:1px solid #ddd;border-radius:4px;background:#fff;color:#999;font-size:16px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease}.btn-clear-color:hover{background:#fff1f0;border-color:#ff4d4f;color:#ff4d4f}.property-row input[type=checkbox]{width:16px;height:16px;cursor:pointer}.property-value{font-size:14px;color:#333;font-weight:500}.property-actions{margin-top:20px;padding-top:20px;border-top:1px solid #eee;text-align:center}.empty-state{color:#999;text-align:center;padding:40px 20px}.empty-state p{margin:10px 0 0}.status-bar{padding:8px 20px;background:#fff;border-top:1px solid #ddd;display:flex;gap:30px;font-size:13px;color:#666}.status-item{display:flex;align-items:center;gap:5px}.status-item span:first-child{font-weight:500;color:#333}@media(max-width:1200px){.canvas-container{width:600px;height:900px}}@media(max-width:900px){.workspace{flex-direction:column}.control-panel{width:100%;height:200px;border-right:none;border-bottom:1px solid #ddd}.property-panel{width:100%;height:300px;border-left:none;border-top:1px solid #ddd}.canvas-container{width:100%;height:600px}}.band-area.dragging{transition:all .1s ease}.band-object-count{position:absolute;bottom:5px;right:5px;background:#0000001a;padding:2px 6px;font-size:10px;border-radius:3px;color:#666}.boundary-line{position:absolute;left:0;right:0;height:20px;background-color:#f3f3f3;cursor:ns-resize;z-index:1000;transition:background-color .2s ease;border-top:1px solid #aeadad;border-bottom:1px solid #aeadad}.boundary-label{position:absolute;top:50%;left:0%;transform:translateY(-50%);padding:2px 8px;border-radius:4px;font-size:12px;color:#c3c3c3;white-space:nowrap;background:transparent}.text-content-wrapper{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;margin:0;padding:0}.text-content{box-sizing:border-box;white-space:pre-wrap;word-break:break-word;overflow:hidden;width:100%}.multi-selection-info{margin-top:15px;padding:10px;background:#f5f5f5;border-radius:4px;border-left:3px solid #4d90fe}.multi-selection-info p{margin:5px 0;font-size:12px;color:#666}.multi-selection-info .btn-small{margin-top:8px;padding:4px 12px;font-size:12px}.status-bar .status-item:last-child{color:#4d90fe;font-weight:700}.toolbar .selected-count{background:#4d90fe;color:#fff;padding:2px 8px;border-radius:10px;font-size:12px;margin-left:5px}.band-controls{max-height:200px;overflow-y:auto}@keyframes object-focus-blink{0%,to{outline:2px solid #4d90fe;outline-offset:2px;box-shadow:0 0 8px #4d90fe99}50%{outline:2px solid #ff9800;outline-offset:2px;box-shadow:0 0 12px #ff9800cc}}.object-focus-blink{animation:object-focus-blink .5s ease-in-out 3;z-index:9999!important}.context-menu{background:#fff;border:1px solid #d9d9d9;border-radius:6px;box-shadow:0 6px 16px #0000001f;min-width:180px;padding:4px 0;font-size:13px;-webkit-user-select:none;user-select:none}.context-menu-item{display:flex;align-items:center;padding:6px 12px;cursor:pointer;position:relative;transition:background-color .15s}.context-menu-item:hover{background-color:#f5f5f5}.context-menu-item[data-disabled=true]{opacity:.4;cursor:not-allowed;pointer-events:none}.context-menu-item.delete:hover{background-color:#fff1f0;color:#ff4d4f}.menu-icon{width:20px;margin-right:8px;text-align:center;font-size:12px}.menu-label{flex:1}.menu-shortcut{color:#999;font-size:11px;margin-left:16px}.menu-arrow{color:#999;font-size:10px;margin-left:8px}.context-menu-divider{height:1px;background-color:#e8e8e8;margin:4px 0}.context-menu-submenu{position:relative}.context-submenu{position:absolute;left:100%;top:-4px;background:#fff;border:1px solid #d9d9d9;border-radius:6px;box-shadow:0 6px 16px #0000001f;min-width:150px;padding:4px 0;display:none;z-index:1}.context-menu-submenu:hover>.context-submenu{display:block}.context-submenu .context-menu-item{padding:6px 16px}.context-submenu .context-menu-item:hover{background-color:#f5f5f5}@keyframes contextMenuFadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.context-menu{animation:contextMenuFadeIn .1s ease-out}.selection-rect{box-sizing:border-box}.selected-object-border{box-sizing:border-box;animation:pulse-border 2s infinite}@keyframes pulse-border{0%{border-color:#4d90fe}50%{border-color:#4d90fe80}to{border-color:#4d90fe}}.canvas-nav{display:flex;justify-content:space-between;align-items:center;padding:8px 16px;background:#f5f5f5;border-bottom:1px solid #ddd}.keyboard-hint{font-size:12px;color:#666;background:#fff;padding:4px 8px;border-radius:4px;border:1px solid #ddd}.canvas-container.selecting{cursor:crosshair!important}.canvas-container.moving{cursor:move!important}.shortcut-hint{position:fixed;bottom:20px;right:20px;background:#000c;color:#fff;padding:10px 15px;border-radius:6px;font-size:12px;z-index:3000}.shortcut-hint kbd{background:#333;padding:2px 6px;border-radius:3px;margin:0 2px;font-family:monospace}.rich-text-content{width:100%;height:100%;overflow:hidden}.rich-text-content p{margin:0 0 .3em}.rich-text-content p:last-child{margin-bottom:0}.rich-text-content ul,.rich-text-content ol{margin:.3em 0;padding-left:1.2em}.rich-text-content li{margin:.1em 0}.rich-text-content b,.rich-text-content strong{font-weight:700}.rich-text-content i,.rich-text-content em{font-style:italic}.rich-text-content u{text-decoration:underline}.rich-text-content strike,.rich-text-content s{text-decoration:line-through}.color-picker{position:relative;display:inline-flex}.color-picker.disabled{opacity:.6;cursor:not-allowed}.color-preview-btn{display:flex;align-items:center;gap:4px;padding:2px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;cursor:pointer;transition:border-color .2s}.color-preview-btn:hover{border-color:#1890ff}.color-picker.disabled .color-preview-btn{cursor:not-allowed;background:#f5f5f5}.color-swatch{width:24px;height:20px;border-radius:2px;border:1px solid #e8e8e8;display:flex;align-items:center;justify-content:center}.no-color-icon{font-size:18px;color:#999}.dropdown-arrow{display:flex;align-items:center;color:#999;margin-left:2px}.color-panel{position:absolute;top:100%;left:0;margin-top:4px;padding:8px;background:#fff;border:1px solid #e8e8e8;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:10000;width:190px}.preset-colors{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;margin-bottom:8px}.color-item{width:24px;height:24px;border-radius:4px;cursor:pointer;border:2px solid transparent;transition:all .15s}.color-item:hover{transform:scale(1.1);border-color:#1890ff}.color-item.active{border-color:#1890ff;box-shadow:0 0 0 2px #1890ff4d}.color-item.clear-color{background:#fff!important;border:1px solid #d9d9d9!important;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.color-item.clear-color:after{content:"";position:absolute;width:30px;height:2px;background:#ff4d4f;transform:rotate(-45deg);left:50%;top:50%;margin-left:-15px;margin-top:-1px}.color-item.clear-color:hover{border-color:#ff4d4f!important}.clear-icon{display:none}.custom-color-row{border-top:1px solid #f0f0f0;padding-top:8px}.btn-custom-color{width:100%;padding:6px 12px;border:1px solid #d9d9d9;border-radius:4px;background:#fafafa;color:#666;font-size:12px;cursor:pointer;transition:all .15s}.btn-custom-color:hover{background:#e6f7ff;border-color:#1890ff;color:#1890ff}.band-property-panel{width:300px;background:#fafafa;border-left:1px solid #e8e8e8;display:flex;flex-direction:column;height:100%;overflow:hidden}.band-property-panel h3{margin:0;padding:12px 16px;font-size:14px;font-weight:600;color:#333;background:#fff;border-bottom:1px solid #e8e8e8;flex-shrink:0}.band-property-editor{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:12px}.band-property-editor::-webkit-scrollbar{width:6px}.band-property-editor::-webkit-scrollbar-track{background:transparent}.band-property-editor::-webkit-scrollbar-thumb{background:#d9d9d9;border-radius:3px}.band-property-editor::-webkit-scrollbar-thumb:hover{background:#bfbfbf}.band-property-group{background:#fff;border:1px solid #e8e8e8;border-radius:6px;flex-shrink:0}.band-property-group.control-list-group{flex:1;flex-shrink:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.band-property-group.control-list-group .object-list{flex:1;min-height:0;overflow-y:auto;border-top:1px solid #e8e8e8;background-color:#fafafa}.band-property-group.control-list-group .object-list::-webkit-scrollbar{width:6px}.band-property-group.control-list-group .object-list::-webkit-scrollbar-track{background:transparent}.band-property-group.control-list-group .object-list::-webkit-scrollbar-thumb{background:#d9d9d9;border-radius:3px}.band-property-group.control-list-group .object-list::-webkit-scrollbar-thumb:hover{background:#bfbfbf}.band-property-group h4{margin:0;padding:10px 12px;font-size:13px;font-weight:600;color:#333;background:#fafafa;border-bottom:1px solid #e8e8e8}.band-property-row{display:flex;align-items:center;padding:10px 12px;border-bottom:1px solid #f0f0f0;gap:8px}.band-property-row:last-child{border-bottom:none}.band-property-row label{font-size:13px;color:#666;width:80px;flex-shrink:0}.band-property-row>div{flex:1;min-width:0}.band-property-value{font-size:13px;color:#333;padding:4px 8px;background:#f5f5f5;border-radius:4px}.band-property-row input[type=text],.band-property-row input[type=number]{padding:6px 10px;border:1px solid #d9d9d9;border-radius:4px;font-size:13px;color:#333;background:#fff;outline:none;transition:border-color .2s;min-width:0}.band-property-row input[type=number]{width:80px}.band-property-row input[type=text]{flex:1}.band-property-row input[type=text]:hover,.band-property-row input[type=number]:hover{border-color:#40a9ff}.band-property-row input[type=text]:focus,.band-property-row input[type=number]:focus{border-color:#40a9ff;box-shadow:0 0 0 2px #1890ff1a}.band-property-row select{flex:1;padding:6px 10px;border:1px solid #d9d9d9;border-radius:4px;font-size:13px;color:#333;background:#fff;cursor:pointer;outline:none}.band-property-row select:hover{border-color:#40a9ff}.band-property-row select:focus{border-color:#40a9ff;box-shadow:0 0 0 2px #1890ff1a}.band-property-row input[type=color]{width:32px;height:24px;padding:0;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer}@media(max-width:1200px){.band-property-panel{width:280px}}.rich-text-editor{border:1px solid #d9d9d9;border-radius:4px;background:#fff}.rte-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:2px;padding:4px 6px;background:#fafafa;border-bottom:1px solid #e8e8e8}.rte-btn{display:flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:1px solid transparent;border-radius:4px;background:transparent;color:#333;font-size:13px;cursor:pointer;transition:all .15s}.rte-btn:hover{background:#e6f7ff;border-color:#91d5ff}.rte-btn:active{background:#bae7ff}.rte-select{height:26px;min-width:80px!important;padding:0 6px!important;border:1px solid #d9d9d9;border-radius:4px;font-size:12px;cursor:pointer;background:#fff}.rte-select:focus{outline:none;border-color:#1890ff}.rte-color{width:26px;height:26px;padding:2px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;background:#fff}.rte-color::-webkit-color-swatch-wrapper{padding:2px}.rte-color::-webkit-color-swatch{border:none;border-radius:2px}.rte-separator{width:1px;height:20px;margin:0 4px;background:#e8e8e8}.rte-content{padding:8px 10px;min-height:120px;max-height:300px;overflow-y:auto;font-size:14px;line-height:1.6;outline:none}.rte-content:empty:before{content:attr(data-placeholder);color:#bfbfbf;pointer-events:none}.rte-content:focus{background:#fafafa}.rte-content p{margin:0 0 .5em}.rte-content ul,.rte-content ol{margin:.5em 0;padding-left:1.5em}.rte-content li{margin:.25em 0}.property-panel{width:300px;background:linear-gradient(180deg,#fafbfc,#f6f8fa);border-left:1px solid #e1e4e8;display:flex;flex-direction:column;height:100%;overflow:hidden}.property-panel-header{display:flex;align-items:center;gap:10px;padding:8px;flex-shrink:0}.property-panel-header .type-icon{width:36px;height:36px;background:#4d90fe;border-radius:8px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:16px;font-weight:600}.property-panel-header .type-info{flex:1}.property-panel-header .type-name{font-size:15px;font-weight:600;color:#24292e;margin:0 0 2px}.property-panel-header .type-id{font-size:11px;color:#6a737d;font-family:SFMono-Regular,Consolas,monospace}.property-editor{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.property-editor::-webkit-scrollbar{width:6px}.property-editor::-webkit-scrollbar-track{background:transparent}.property-editor::-webkit-scrollbar-thumb{background:#d1d5da;border-radius:3px}.property-editor::-webkit-scrollbar-thumb:hover{background:#959da5}.property-group{background:#fff;border:1px solid #e1e4e8;box-shadow:0 1px 3px #0000000a}.property-group-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;background:linear-gradient(180deg,#fafbfc,#f6f8fa);border-bottom:1px solid #e1e4e8;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .15s ease}.property-group-header:hover{background:linear-gradient(180deg,#f3f4f6,#ebedf0)}.property-group-header h4{margin:0;font-size:12px;font-weight:600;color:#24292e;text-transform:uppercase;letter-spacing:.5px;display:flex;align-items:center;gap:6px}.property-group-header h4:before{content:"";width:3px;height:12px;background:linear-gradient(180deg,#667eea,#764ba2);border-radius:2px}.property-group-header .collapse-icon{font-size:10px;color:#6a737d;transition:transform .2s ease}.property-group-header .collapse-icon.collapsed{transform:rotate(-90deg)}.property-group-content{padding:12px}.property-group-content.collapsed{display:none}.property-panel .property-row{display:flex;align-items:center;margin-bottom:12px}.property-panel .property-row:last-child{margin-bottom:0}.property-panel .property-row label{font-size:13px;color:#586069;width:72px;flex-shrink:0}.property-panel .property-row .property-value{font-size:13px;color:#24292e;font-weight:500;padding:6px 10px;background:#f6f8fa;border-radius:4px;flex:1}.property-panel .property-row input[type=text],.property-panel .property-row textarea{flex:1;padding:6px 10px;border:1px solid #d1d5da;border-radius:4px;font-size:13px;color:#24292e;background:#fff;outline:none;min-width:0}.property-panel .property-row input[type=number]{flex:1;flex-shrink:0;padding:6px 10px;border:1px solid #d1d5da;border-radius:4px;font-size:13px;color:#24292e;background:#fff;outline:none}.property-panel .property-row input:hover,.property-panel .property-row textarea:hover,.property-panel .property-row select:hover{border-color:#0366d6}.property-panel .property-row input:focus,.property-panel .property-row textarea:focus,.property-panel .property-row select:focus{border-color:#0366d6;box-shadow:0 0 0 2px #0366d61a}.property-panel .property-row input:disabled{background:#f6f8fa;color:#6a737d;cursor:not-allowed}.property-panel .property-row select{flex:1;padding:6px 10px;border:1px solid #d1d5da;border-radius:4px;font-size:13px;color:#24292e;background:#fff;cursor:pointer;outline:none;min-width:0}.property-panel .property-row input[type=checkbox]{width:16px;height:16px;cursor:pointer;accent-color:#0366d6;flex-shrink:0}.property-panel .checkbox-wrapper{display:flex;align-items:center;gap:8px}.property-panel .checkbox-wrapper .checkbox-label{font-size:12px;color:#586069}.property-panel .color-input-wrapper{display:flex;align-items:center;gap:6px;flex:1}.property-panel .property-row input[type=color]{width:36px;height:32px;border:1px solid #d1d5da;border-radius:6px;cursor:pointer;padding:2px;background:#fff;flex-shrink:0}.property-panel .property-row input[type=color]:hover{border-color:#0366d6}.property-panel .color-value{font-size:11px;color:#6a737d;font-family:SFMono-Regular,Consolas,monospace;background:#f6f8fa;padding:4px 8px;border-radius:4px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.property-panel .btn-clear-color{width:28px;height:28px;padding:0;border:1px solid #d1d5da;border-radius:6px;background:#fff;color:#6a737d;font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease;flex-shrink:0}.property-panel .btn-clear-color:hover{background:#ffeef0;border-color:#d73a49;color:#d73a49}.btn-sm{padding:5px 12px;font-size:12px;font-weight:500;border-radius:6px;border:1px solid transparent;cursor:pointer;transition:all .15s ease}.btn-primary{background:linear-gradient(180deg,#0366d6,#0256b9);color:#fff;border-color:#0256b9}.btn-primary:hover{background:linear-gradient(180deg,#0256b9,#044289)}.btn-secondary{background:#f6f8fa;color:#24292e;border-color:#d1d5da}.btn-secondary:hover{background:#e1e4e8}.alignment-buttons{display:flex;gap:4px;flex:1}.alignment-btn{flex:1;height:32px;border:1px solid #d1d5da;border-radius:6px;background:#fff;color:#6a737d;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease}.alignment-btn:hover{border-color:#0366d6;color:#0366d6}.alignment-btn.active{background:linear-gradient(180deg,#0366d6,#0256b9);border-color:#0256b9;color:#fff}.padding-inputs{display:grid;grid-template-columns:1fr 1fr;gap:8px;flex:1}.padding-input-item{display:flex;align-items:center;gap:4px}.padding-input-item .padding-label{font-size:11px;color:#6a737d;min-width:16px}.padding-inputs input{width:50px!important;text-align:center;padding:4px 6px!important;font-size:12px}.padding-hint{display:none}.zindex-controls{display:flex;align-items:center;gap:6px;flex:1}.zindex-controls input{width:60px!important}.zindex-btn{padding:4px 8px;font-size:11px;border:1px solid #d1d5da;border-radius:4px;background:#f6f8fa;color:#586069;cursor:pointer;transition:all .15s ease;display:flex;align-items:center;gap:3px}.zindex-btn:hover{background:#e1e4e8;border-color:#959da5}.image-preview-container{width:100%;height:80px;border:1px solid #e1e4e8;border-radius:6px;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#f6f8fa;margin-top:8px}.image-preview-container img{max-width:100%;max-height:100%;object-fit:contain}.file-upload-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:linear-gradient(180deg,#0366d6,#0256b9);color:#fff;border-radius:6px;font-size:12px;font-weight:500;cursor:pointer;transition:all .15s ease}.file-upload-btn:hover{background:linear-gradient(180deg,#0256b9,#044289)}.file-clear-btn{padding:6px 10px;background:#fff;color:#d73a49;border:1px solid #d73a49;border-radius:6px;font-size:12px;cursor:pointer;transition:all .15s ease}.file-clear-btn:hover{background:#ffeef0}.formula-input-wrapper{display:flex;gap:6px;flex:1;min-width:0}.formula-input-wrapper input{flex:1;min-width:0}.btn-edit-formula{padding:6px 12px;background:linear-gradient(180deg,#28a745,#22863a);color:#fff;border:none;border-radius:6px;font-size:12px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all .15s ease;flex-shrink:0}.btn-edit-formula:hover{background:linear-gradient(180deg,#22863a,#176f2c)}.property-actions{padding:12px;background:#fff;border-top:1px solid #e1e4e8;flex-shrink:0}.btn-danger{width:100%;padding:10px;background:linear-gradient(180deg,#d73a49,#cb2431);color:#fff;border:none;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:all .15s ease;display:flex;align-items:center;justify-content:center;gap:6px}.btn-danger:hover{background:linear-gradient(180deg,#cb2431,#9e1c23)}.btn-danger:before{content:"🗑";font-size:14px}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;color:#6a737d;text-align:center}.empty-state-icon{font-size:48px;margin-bottom:16px;opacity:.5}.empty-state-text{font-size:14px;line-height:1.5}@media(max-width:1200px){.property-panel{width:280px}}@media(max-width:900px){.property-panel{width:100%;height:300px;border-left:none;border-top:1px solid #e1e4e8}}.multi-select-toolbar{display:flex;align-items:center;padding:8px 12px;background:#fff;border-bottom:1px solid #e8e8e8;flex-wrap:wrap;width:100%;box-sizing:border-box;gap:4px}.toolbar-section{display:flex;align-items:center;gap:8px}.toolbar-section:last-child{border-right:none}.section-label{font-size:12px;font-weight:600;color:#1890ff;white-space:nowrap;margin-right:4px}.type-hint{font-size:11px;color:#999;margin-left:4px}.section-title{font-size:12px;color:#666;font-weight:500}.toolbar-buttons{display:flex;align-items:center;gap:2px}.toolbar-btn{display:flex;align-items:center;justify-content:center;min-width:28px;height:28px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;color:#333;font-size:12px;cursor:pointer;transition:all .15s ease}.toolbar-btn:hover{background:#e6f7ff;border-color:#1890ff;color:#1890ff}.toolbar-btn:active{background:#bae7ff}.toolbar-btn:disabled{background:#f5f5f5;border-color:#d9d9d9;color:#bfbfbf;cursor:not-allowed;opacity:.6}.toolbar-btn:disabled:hover{background:#f5f5f5;border-color:#d9d9d9;color:#bfbfbf}.toolbar-btn.active{background:#1890ff;border-color:#1890ff;color:#fff}.toolbar-btn svg{flex-shrink:0}.toolbar-btn.btn-clear{background:#fff;border-color:#ff7875;color:#ff4d4f}.toolbar-btn.btn-clear:hover{background:#fff1f0;border-color:#ff4d4f}.toolbar-btn.btn-delete{display:flex;align-items:center;gap:4px;background:#fff;border-color:#d9d9d9;color:#333}.toolbar-btn.btn-delete:hover:not(:disabled){background:#fff1f0;border-color:#ff4d4f;color:#ff4d4f}.toolbar-btn.btn-delete:disabled{background:#f5f5f5;border-color:#d9d9d9;color:#bfbfbf}.separator{width:1px;height:20px;background:#e8e8e8;margin:0 4px}.toolbar-controls{display:flex;align-items:center;gap:6px}.toolbar-control-item{display:flex;align-items:center;gap:4px;font-size:12px;color:#666}.toolbar-control-item span{font-size:12px;color:#666}.toolbar-control-item input[type=number]{width:56px;height:26px;border:1px solid #d9d9d9;border-radius:4px;font-size:12px;text-align:center;margin:0;padding:0}.toolbar-control-item input[type=number]:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px #1890ff1a}.toolbar-control-item input[type=color]{width:28px;height:26px;padding:2px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;overflow:hidden}.toolbar-control-item input[type=color]::-webkit-color-swatch-wrapper{padding:2px}.toolbar-control-item input[type=color]::-webkit-color-swatch{border:none;border-radius:2px}.toolbar-control-item input:disabled,.toolbar-control-item select:disabled{background:#f5f5f5;border-color:#d9d9d9;color:#bfbfbf;cursor:not-allowed;opacity:.6}.toolbar-control-item select{height:26px;padding:2px 8px;border:1px solid #d9d9d9;border-radius:4px;font-size:12px;background:#fff;cursor:pointer}.toolbar-control-item select:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px #1890ff1a}.toolbar-actions{display:flex;align-items:center}.color-input-group{display:flex;align-items:center;gap:2px}.btn-clear-sm{width:20px;height:20px;padding:0;border:1px solid #d9d9d9;border-radius:4px;background:#fff;color:#999;font-size:12px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease}.btn-clear-sm:hover:not(:disabled){background:#fff1f0;border-color:#ff4d4f;color:#ff4d4f}.btn-clear-sm:disabled{background:#f5f5f5;border-color:#d9d9d9;color:#d9d9d9;cursor:not-allowed}@media(max-width:1400px){.multi-select-toolbar{gap:4px;padding:8px 12px}.toolbar-section{padding:4px 8px}}@media(max-width:1200px){.section-title{display:none}}.toolbar-dropdown-btn{gap:4px;padding:0 8px}.dropdown-arrow{font-size:8px;color:#999;margin-left:2px}.toolbar-dropdown-menu{position:fixed;margin-top:4px;background:#fff;border:1px solid #e8e8e8;border-radius:6px;box-shadow:0 6px 16px #0000001f;z-index:10000;min-width:160px;padding:4px 0}.control-dropdown{min-width:180px}.dropdown-category{padding:4px 0}.category-title{padding:6px 12px 4px;font-size:11px;color:#999;font-weight:500;text-transform:uppercase;letter-spacing:.5px}.dropdown-item{display:flex;align-items:center;padding:8px 12px;cursor:pointer;transition:background .15s}.dropdown-item:hover{background:#e6f7ff}.item-icon{width:24px;font-size:14px;text-align:center;margin-right:8px}.item-name{font-size:13px;color:#333}.dropdown-divider{height:1px;background:#e8e8e8;margin:4px 0}.toolbar-section{position:relative}.field-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:2000}.field-modal{background:#fff;border-radius:8px;box-shadow:0 8px 24px #0003;width:520px;max-height:80vh;display:flex;flex-direction:column;animation:modalFadeIn .2s ease-out}@keyframes modalFadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.field-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e8e8e8}.field-modal-header h3{margin:0;font-size:16px;font-weight:600;color:#333}.modal-close-btn{width:28px;height:28px;border:none;background:transparent;font-size:20px;color:#999;cursor:pointer;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:all .15s}.modal-close-btn:hover{background:#f5f5f5;color:#333}.field-modal-body{padding:16px 20px;max-height:400px;overflow-y:auto}.field-group{margin-bottom:16px}.field-group:last-child{margin-bottom:0}.field-group-title{font-size:13px;font-weight:600;color:#333;margin-bottom:8px;padding:4px 8px;background:#f5f5f5;border-radius:4px}.field-list{display:flex;flex-wrap:wrap;gap:8px}.field-item{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;transition:all .15s;flex:0 0 calc(50% - 4px);box-sizing:border-box}.field-item:hover,.field-item.selected{border-color:#1890ff;background:#e6f7ff}.field-item input[type=checkbox]{width:16px;height:16px;cursor:pointer}.field-label{font-size:13px;color:#333;font-weight:500}.field-name{font-size:11px;color:#999;margin-left:auto}.field-modal-footer{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-top:1px solid #e8e8e8;background:#fafafa;border-radius:0 0 8px 8px}.arrangement-options{display:flex;align-items:center;gap:12px;font-size:13px;color:#666}.arrangement-options label{display:flex;align-items:center;gap:4px;cursor:pointer}.arrangement-options input[type=radio]{width:14px;height:14px;cursor:pointer}.modal-buttons{display:flex;gap:8px}.modal-buttons .btn{padding:6px 16px;border-radius:4px;font-size:13px;cursor:pointer;transition:all .15s}.modal-buttons .btn-cancel{border:1px solid #d9d9d9;background:#fff;color:#666}.modal-buttons .btn-cancel:hover{border-color:#40a9ff;color:#40a9ff}.modal-buttons .btn-confirm{border:1px solid #1890ff;background:#1890ff;color:#fff}.modal-buttons .btn-confirm:hover{background:#40a9ff;border-color:#40a9ff}.modal-buttons .btn-confirm:disabled{background:#f5f5f5;border-color:#d9d9d9;color:#bfbfbf;cursor:not-allowed}.toolbar-btn.btn-primary{background:#1890ff;border-color:#1890ff;color:#fff}.toolbar-btn.btn-primary:hover{background:#40a9ff;border-color:#40a9ff}.print-preview-modal{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10000;display:flex;justify-content:center;align-items:center;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.preview-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#0009;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.preview-container{position:relative;background:#fff;border-radius:12px;box-shadow:0 10px 40px #0003,0 0 0 1px #ffffff1a;width:900px;max-width:95%;height:95vh;display:flex;flex-direction:column;animation:slideIn .3s ease-out}@keyframes slideIn{0%{opacity:0;transform:translateY(20px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.preview-toolbar{padding:12px 20px;background:linear-gradient(135deg,#f8f9fa,#e9ecef);border-bottom:1px solid #dee2e6;display:flex;justify-content:space-between;align-items:center;flex-shrink:0;min-height:60px;box-shadow:0 2px 8px #0000000d}.toolbar-left,.toolbar-center,.toolbar-right{display:flex;align-items:center;gap:12px}.btn{padding:8px 16px;border:1px solid #d9d9d9;background:#fff;border-radius:6px;cursor:pointer;font-size:14px;font-weight:500;transition:all .2s cubic-bezier(.645,.045,.355,1);color:#333;display:inline-flex;align-items:center;justify-content:center;gap:6px;position:relative;overflow:hidden}.btn:before{content:"";position:absolute;top:50%;left:50%;width:0;height:0;border-radius:50%;background:#0000001a;transform:translate(-50%,-50%);transition:width .4s,height .4s}.btn:hover:before{width:200px;height:200px}.btn:hover{border-color:#40a9ff;color:#40a9ff;transform:translateY(-1px);box-shadow:0 4px 12px #1890ff33}.btn:active{transform:translateY(0);box-shadow:0 2px 6px #1890ff33}.btn-primary{background:linear-gradient(135deg,#1890ff,#096dd9);color:#fff;border:none;box-shadow:0 2px 8px #1890ff4d}.btn-primary:hover{background:linear-gradient(135deg,#40a9ff,#1890ff);color:#fff;border:none;box-shadow:0 4px 12px #1890ff66}.btn-danger{background:#ff4d4f;color:#fff;border:none}.btn-danger:hover{background:#ff7875;color:#fff;border:none}.btn-small{padding:4px 12px;font-size:13px;min-height:28px}.btn:disabled{opacity:.5;cursor:not-allowed;transform:none;box-shadow:none}.btn:disabled:hover{transform:none;box-shadow:none}.btn-primary:disabled{background:#91caff}.zoom-select{padding:6px 10px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;font-size:14px;color:#333;cursor:pointer;transition:all .2s;min-width:90px}.zoom-select:hover{border-color:#40a9ff}.zoom-select:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px #1890ff33}.page-controls{display:flex;align-items:center;gap:8px;margin-left:20px;background:#fffc;padding:6px 12px;border-radius:8px;border:1px solid #e8e8e8}.page-info{display:flex;align-items:center;gap:8px;font-size:14px;color:#595959;font-weight:500}.page-input{width:60px;padding:4px 8px;border:1px solid #d9d9d9;border-radius:4px;text-align:center;font-size:14px;color:#333;transition:all .2s}.page-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px #1890ff33}.data-info{font-size:14px;color:#595959;background:#fff;padding:6px 12px;border-radius:6px;border:1px solid #e8e8e8;display:flex;align-items:center;gap:8px}.data-info:before{content:"📊";font-size:16px}.preview-content{flex:1;padding:20px;background:linear-gradient(135deg,#f5f5f5,#f0f0f0);position:relative;overflow-y:scroll}.preview-page{width:794px;height:1123px;background-color:#fff;box-shadow:0 8px 32px #00000026;position:relative;margin:0 auto;transform-origin:top center;border-radius:2px;overflow:hidden;border:1px solid #e0e0e0}.page-margins{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none}.margin-top{position:absolute;top:0;left:0;right:0;height:40px;border-bottom:2px dashed rgba(64,169,255,.3)}.margin-bottom{position:absolute;bottom:0;left:0;right:0;height:40px;border-top:2px dashed rgba(64,169,255,.3)}.margin-left{position:absolute;top:0;bottom:0;left:0;width:30px;border-right:2px dashed rgba(64,169,255,.3)}.margin-right{position:absolute;top:0;bottom:0;right:0;width:30px;border-left:2px dashed rgba(64,169,255,.3)}.preview-band{position:absolute;overflow:visible}.detail-row{position:absolute;left:0;width:100%}.page-number{position:absolute;bottom:15px;right:35px;font-size:12px;color:#8c8c8c;background:#ffffffe6;padding:4px 12px;border-radius:12px;border:1px solid #f0f0f0;font-family:Arial,sans-serif}.preview-stats{padding:16px 20px;background:linear-gradient(135deg,#fafafa,#f5f5f5);border-top:1px solid #f0f0f0;display:flex;gap:32px;flex-shrink:0;justify-content:center;align-items:center}.stat-item{display:flex;align-items:center;gap:8px;font-size:13px;color:#666;padding:8px 16px;background:#fff;border-radius:8px;border:1px solid #e8e8e8;box-shadow:0 2px 4px #00000005;transition:all .2s}.stat-item:hover{transform:translateY(-1px);box-shadow:0 4px 8px #0000000d;border-color:#d9d9d9}.stat-item span:first-child{color:#8c8c8c;font-weight:500}.stat-item span:last-child{color:#1890ff;font-weight:600}.preview-content::-webkit-scrollbar{width:8px;height:8px}.preview-content::-webkit-scrollbar-track{background:#0000000d;border-radius:4px}.preview-content::-webkit-scrollbar-thumb{background:#0003;border-radius:4px}.preview-content::-webkit-scrollbar-thumb:hover{background:#0000004d}@media(max-width:1400px){.preview-container{width:98%}.preview-page{transform:scale(.9)}}@media(max-width:1200px){.preview-page{transform:scale(.8)}.preview-toolbar{flex-wrap:wrap;gap:10px}.toolbar-center{order:3;width:100%;justify-content:center;margin-top:10px}}@media(max-width:768px){.preview-container{height:95vh;border-radius:0;width:100%}.preview-page{transform:scale(.7)}.preview-stats{flex-wrap:wrap;gap:12px;justify-content:flex-start;overflow-x:auto}.stat-item{flex-shrink:0}}@media print{.print-preview-modal{position:static;background:#fff}.preview-overlay,.preview-toolbar,.preview-stats,.page-margins,.margin-top,.margin-bottom,.margin-left,.margin-right,.data-info,.page-controls,.multi-select-toolbar,.status-bar{display:none!important}.preview-container{width:100%;height:auto;box-shadow:none;border:none;border-radius:0}.preview-content{padding:0;background:#fff}.preview-page{box-shadow:none!important;margin:0!important;transform:none!important;page-break-after:always;border:none}.preview-page:last-child{page-break-after:auto}.page-margins{display:none!important}}@page{margin:0}@keyframes pulse{0%,to{opacity:1}50%{opacity:.6}}.loading{animation:pulse 1.5s ease-in-out infinite}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;height:200px;color:#bfbfbf;gap:16px}.empty-state svg{width:64px;height:64px;opacity:.3}.empty-state p{font-size:16px;font-weight:500}.tooltip{position:relative;display:inline-block}.tooltip .tooltip-text{visibility:hidden;width:200px;background-color:#333;color:#fff;text-align:center;border-radius:6px;padding:8px;position:absolute;z-index:1;bottom:125%;left:50%;margin-left:-100px;opacity:0;transition:opacity .3s;font-size:12px;line-height:1.4}.tooltip:hover .tooltip-text{visibility:visible;opacity:.9}.custom-scrollbar{scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.2) transparent}.page-settings-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000}.page-settings-panel{background:#fff;border-radius:8px;box-shadow:0 4px 20px #00000026;width:400px;max-height:90vh;display:flex;flex-direction:column}.page-settings-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #eee}.page-settings-header h3{margin:0;font-size:16px;font-weight:600;color:#333}.page-settings-header .close-btn{background:none;border:none;font-size:20px;color:#999;cursor:pointer;padding:0;line-height:1}.page-settings-header .close-btn:hover{color:#333}.page-settings-content{padding:20px;overflow-y:auto;flex:1}.settings-section{margin-bottom:20px}.settings-section:last-child{margin-bottom:0}.section-label{display:block;font-size:13px;font-weight:500;color:#333;margin-bottom:8px}.settings-select{width:100%;padding:8px 12px;border:1px solid #ddd;border-radius:4px;font-size:14px;color:#333;background:#fff;cursor:pointer}.settings-select:focus{outline:none;border-color:#4a90d9}.dimensions-section .dimension-row{display:flex;align-items:center;gap:10px;margin-bottom:10px}.dimensions-section .dimension-row:last-child{margin-bottom:0}.dimensions-section .dimension-row label{width:40px;font-size:13px;color:#666}.dimensions-section .dimension-row input{flex:1;padding:6px 10px;border:1px solid #ddd;border-radius:4px;font-size:14px}.dimensions-section .dimension-row input:disabled{background:#f5f5f5;color:#999}.dimensions-section .dimension-row .unit{width:30px;font-size:12px;color:#999}.orientation-options{display:flex;gap:20px}.orientation-option{display:flex;align-items:center;gap:8px;cursor:pointer}.orientation-option input{margin:0}.orientation-icon{display:flex;align-items:center;justify-content:center;color:#666}.orientation-option input:checked+.orientation-icon{color:#4a90d9}.orientation-icon.landscape svg{transform:rotate(90deg)}.margins-section .margins-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.margin-input{display:flex;align-items:center;gap:4px}.margin-input label{width:16px;flex-shrink:0;font-size:13px;color:#666}.margin-input input{flex:1;min-width:0;width:50px;padding:6px 8px;border:1px solid #ddd;border-radius:4px;font-size:13px;box-sizing:border-box}.margin-input input:focus{outline:none;border-color:#4a90d9}.margin-input .unit{width:24px;flex-shrink:0;font-size:12px;color:#999}.preview-section{margin-top:20px;padding-top:20px;border-top:1px solid #eee}.page-preview-container{display:flex;flex-direction:column;align-items:center;gap:10px}.page-preview{width:100px;max-height:150px;background:#fff;border:1px solid #ccc;box-shadow:0 2px 8px #0000001a;position:relative}.page-preview-content{position:absolute;background:#f0f7ff;border:1px dashed #4a90d9}.page-preview-info{font-size:12px;color:#666}.page-settings-footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 20px;border-top:1px solid #eee}.btn{padding:8px 20px;border-radius:4px;font-size:14px;cursor:pointer;transition:all .2s}.btn-cancel{background:#fff;border:1px solid #ddd;color:#666}.btn-cancel:hover{background:#f5f5f5;border-color:#ccc}.btn-apply{background:#4a90d9;border:1px solid #4a90d9;color:#fff}.btn-apply:hover{background:#3a7bc8;border-color:#3a7bc8}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
(function(wt,ce){typeof exports=="object"&&typeof module<"u"?ce(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],ce):(wt=typeof globalThis<"u"?globalThis:wt||self,ce(wt.PrintDesigner={},wt.React,wt.ReactDOM))})(this,(function(wt,ce,ii){"use strict";var UM=Object.defineProperty;var _M=(wt,ce,ii)=>ce in wt?UM(wt,ce,{enumerable:!0,configurable:!0,writable:!0,value:ii}):wt[ce]=ii;var Ht=(wt,ce,ii)=>_M(wt,typeof ce!="symbol"?ce+"":ce,ii);var $f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ys(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function jS(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function A(){return this instanceof A?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(A){var n=Object.getOwnPropertyDescriptor(r,A);Object.defineProperty(t,A,n.get?n:{enumerable:!0,get:function(){return r[A]}})}),t}var Tl={exports:{}},$s={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -61,7 +61,7 @@ Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),A.put(i,13)}},Nh=t,N
|
|
|
61
61
|
The chosen QR Code version cannot contain this amount of data.
|
|
62
62
|
Minimum version required to store current data is: `+U+`.
|
|
63
63
|
`);const O=x(S,T,D),M=r.getSymbolSize(S),C=new A(M);return c(C,S),g(C),p(C,S),w(C,T,0),S>=7&&y(C,S),B(C,O),isNaN(_)&&(_=s.getBestMask(C,w.bind(null,C,T))),s.applyMask(_,C),w(C,T,_),{modules:C,version:S,errorCorrectionLevel:T,maskPattern:_,segments:D}}return dh.create=function(S,T){if(typeof S>"u"||S==="")throw new Error("No input text");let _=e.M,D,U;return typeof T<"u"&&(_=e.from(T.errorCorrectionLevel,e.M),D=l.from(T.version),U=s.from(T.maskPattern),T.toSJISFunc&&r.setToSJISFunction(T.toSJISFunc)),Q(S,D,_,U)},dh}var Th={},Lh={},fw;function hw(){return fw||(fw=1,(function(r){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let A=t.slice().replace("#","").split("");if(A.length<3||A.length===5||A.length>8)throw new Error("Invalid hex color: "+t);(A.length===3||A.length===4)&&(A=Array.prototype.concat.apply([],A.map(function(i){return[i,i]}))),A.length===6&&A.push("F","F");const n=parseInt(A.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+A.slice(0,6).join("")}}r.getOptions=function(A){A||(A={}),A.color||(A.color={});const n=typeof A.margin>"u"||A.margin===null||A.margin<0?4:A.margin,i=A.width&&A.width>=21?A.width:void 0,s=A.scale||4;return{width:i,scale:i?4:s,margin:n,color:{dark:e(A.color.dark||"#000000ff"),light:e(A.color.light||"#ffffffff")},type:A.type,rendererOpts:A.rendererOpts||{}}},r.getScale=function(A,n){return n.width&&n.width>=A+n.margin*2?n.width/(A+n.margin*2):n.scale},r.getImageWidth=function(A,n){const i=r.getScale(A,n);return Math.floor((A+n.margin*2)*i)},r.qrToImageData=function(A,n,i){const s=n.modules.size,a=n.modules.data,o=r.getScale(s,i),l=Math.floor((s+i.margin*2)*o),u=i.margin*o,f=[i.color.light,i.color.dark];for(let h=0;h<l;h++)for(let c=0;c<l;c++){let g=(h*l+c)*4,p=i.color.light;if(h>=u&&c>=u&&h<l-u&&c<l-u){const y=Math.floor((h-u)/o),w=Math.floor((c-u)/o);p=f[a[y*s+w]?1:0]}A[g++]=p.r,A[g++]=p.g,A[g++]=p.b,A[g]=p.a}}})(Lh)),Lh}var dw;function UU(){return dw||(dw=1,(function(r){const e=hw();function t(n,i,s){n.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=s,i.width=s,i.style.height=s+"px",i.style.width=s+"px"}function A(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(i,s,a){let o=a,l=s;typeof o>"u"&&(!s||!s.getContext)&&(o=s,s=void 0),s||(l=A()),o=e.getOptions(o);const u=e.getImageWidth(i.modules.size,o),f=l.getContext("2d"),h=f.createImageData(u,u);return e.qrToImageData(h.data,i,o),t(f,l,u),f.putImageData(h,0,0),l},r.renderToDataURL=function(i,s,a){let o=a;typeof o>"u"&&(!s||!s.getContext)&&(o=s,s=void 0),o||(o={});const l=r.render(i,s,o),u=o.type||"image/png",f=o.rendererOpts||{};return l.toDataURL(u,f.quality)}})(Th)),Th}var Ph={},gw;function _U(){if(gw)return Ph;gw=1;const r=hw();function e(n,i){const s=n.a/255,a=i+'="'+n.hex+'"';return s<1?a+" "+i+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function t(n,i,s){let a=n+i;return typeof s<"u"&&(a+=" "+s),a}function A(n,i,s){let a="",o=0,l=!1,u=0;for(let f=0;f<n.length;f++){const h=Math.floor(f%i),c=Math.floor(f/i);!h&&!l&&(l=!0),n[f]?(u++,f>0&&h>0&&n[f-1]||(a+=l?t("M",h+s,.5+c+s):t("m",o,0),o=0,l=!1),h+1<i&&n[f+1]||(a+=t("h",u),u=0)):o++}return a}return Ph.render=function(i,s,a){const o=r.getOptions(s),l=i.modules.size,u=i.modules.data,f=l+o.margin*2,h=o.color.light.a?"<path "+e(o.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",c="<path "+e(o.color.dark,"stroke")+' d="'+A(u,l,o.margin)+'"/>',g='viewBox="0 0 '+f+" "+f+'"',y='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+g+' shape-rendering="crispEdges">'+h+c+`</svg>
|
|
64
|
-
`;return typeof a=="function"&&a(null,y),y},Ph}var pw;function IU(){if(pw)return cs;pw=1;const r=uU(),e=SU(),t=UU(),A=_U();function n(i,s,a,o,l){const u=[].slice.call(arguments,1),f=u.length,h=typeof u[f-1]=="function";if(!h&&!r())throw new Error("Callback required as last argument");if(h){if(f<2)throw new Error("Too few arguments provided");f===2?(l=a,a=s,s=o=void 0):f===3&&(s.getContext&&typeof l>"u"?(l=o,o=void 0):(l=o,o=a,a=s,s=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(a=s,s=o=void 0):f===2&&!s.getContext&&(o=a,a=s,s=void 0),new Promise(function(c,g){try{const p=e.create(a,o);c(i(p,s,o))}catch(p){g(p)}})}try{const c=e.create(a,o);l(null,i(c,s,o))}catch(c){l(c)}}return cs.create=e.create,cs.toCanvas=n.bind(null,t.render),cs.toDataURL=n.bind(null,t.renderToDataURL),cs.toString=n.bind(null,function(i,s,a){return A.render(i,a)}),cs}var QU=IU();const Rh=Ys(QU),Mh=({value:r,type:e="CODE128",width:t,height:A,showText:n=!0,background:i="#FFFFFF",lineColor:s="#000000"})=>{const a=ce.useRef(null);return ce.useEffect(()=>{if(a.current&&r)try{for(;a.current.firstChild;)a.current.removeChild(a.current.firstChild);M2(a.current,r,{format:e,width:2,height:A?n?Math.max(A-20,20):A:40,displayValue:n,background:i,lineColor:s,margin:2,fontSize:12,textMargin:2})}catch(o){console.error("条码生成失败:",o)}},[r,e,A,n,i,s]),r?v.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:i,overflow:"hidden"},children:v.jsx("svg",{ref:a,preserveAspectRatio:"none",style:{width:"100%",height:"100%",pointerEvents:"none"}},`${e}-${r}-${n}`)}):v.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:i,color:"#999",fontSize:"12px"},children:"[条码]"})},Dh=({value:r,width:e,height:t,errorLevel:A="M",background:n="#FFFFFF",foreground:i="#000000"})=>{const s=ce.useRef(null);return ce.useEffect(()=>{if(s.current&&r){const a=Math.min(e||100,t||100);Rh.toCanvas(s.current,r,{width:a,margin:1,errorCorrectionLevel:A,color:{dark:i,light:n}}).catch(o=>{console.error("二维码生成失败:",o)})}},[r,e,t,A,n,i]),r?v.jsx("canvas",{ref:s,style:{width:"100%",height:"100%",pointerEvents:"none"}},`${r}-${A}`):v.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:n,color:"#999",fontSize:"12px"},children:"[二维码]"})},NU=({object:r,band:e,style:t,content:A,wrappedContent:n,isSelected:i,isFocused:s=!1,selectedObjectIds:a=[],onSelect:o,onUpdatePosition:l,onUpdateSize:u,onUpdate:f,onDragMultiple:h,minWidth:c=20,minHeight:g=20})=>{const p=ce.useRef(null),y=ce.useRef(!1),[w,B]=ce.useState(null),x=ce.useRef(null),E=ce.useRef(null),L=(J=>{if(!J||J==="none")return 0;const q=J.match(/(\d+)px/);return q?parseInt(q[1]):0})(t.border),S=r.type==="line",T=r.type==="image"&&r.floating,D=S||T?0:L+0,U=()=>S?{minW:20,minH:1}:{minW:c,minH:g},{minW:O,minH:M}=U(),C=ce.useCallback((J,q)=>{const W=E.current,te=W&&(Math.abs(q.x-W.x)>1||Math.abs(q.y-W.y)>1);te&&(y.current=!0,setTimeout(()=>{y.current=!1},0)),a.length>=1&&i&&h&&te&&h(0,0,!1),p.current=null,x.current=null,E.current=null,!(a.length>=1&&i)&&te&&l(r.id,q.x,q.y)},[r.id,l,a.length,i,h]),z=ce.useCallback((J,q)=>{p.current={x:q.x,y:q.y},E.current={x:q.x,y:q.y},x.current=null},[]),re=ce.useCallback((J,q)=>{if(a.length>=1&&i&&p.current&&h){let W=q.x-p.current.x,te=q.y-p.current.y;if(J.shiftKey&&E.current){const oe=q.x-E.current.x,we=q.y-E.current.y;x.current||(Math.abs(oe)>5||Math.abs(we)>5)&&(x.current=Math.abs(oe)>Math.abs(we)?"x":"y"),x.current==="x"?te=0:x.current==="y"&&(W=0)}else x.current=null;(W!==0||te!==0)&&(h(W,te,!0),p.current={x:q.x,y:q.y})}},[a.length,i,h]),ne=ce.useCallback((J,q,W,te,oe)=>{B(null);const we=parseInt(W.style.width),le=parseInt(W.style.height);let Be=we-D*2,ye=le-D*2;if(r.type==="qrcode"){const R=Math.max(Be,ye);Be=R,ye=R}f?f(r.id,{x:oe.x,y:oe.y,width:Be,height:ye}):(l(r.id,oe.x,oe.y),u&&u(r.id,Be,ye))},[r.id,r.type,f,l,u,D]),Z=ce.useCallback((J,q,W)=>{const te=parseInt(W.style.width),oe=parseInt(W.style.height);B({width:te,height:oe})},[]),Ae=r.width+D*2,V=r.height+D*2,k=(w==null?void 0:w.width)??Ae,I=(w==null?void 0:w.height)??V,P={fontSize:t.fontSize,color:t.color,backgroundColor:t.backgroundColor,fontWeight:t.fontWeight,fontStyle:t.fontStyle,textAlign:t.textAlign,lineHeight:t.lineHeight,padding:t.padding,border:t.border,borderRadius:t.borderRadius,clipPath:t.clipPath,display:t.display||"block",alignItems:t.alignItems,justifyContent:t.justifyContent,width:"100%",height:"100%",overflow:t.overflow||"hidden",boxSizing:"border-box",whiteSpace:t.whiteSpace,textOverflow:t.textOverflow,verticalAlign:t.verticalAlign,flexDirection:t.flexDirection,flexWrap:t.flexWrap},K=O+D*2,Y=M+D*2;return v.jsxs(C3,{size:{width:Ae,height:V},position:{x:r.x,y:r.y},onDragStart:z,onDrag:re,onDragStop:C,onResize:Z,onResizeStop:ne,minWidth:K,minHeight:Y,lockAspectRatio:r.type==="qrcode",bounds:"parent",disableDragging:!i,enableResizing:i&&!s?{bottom:!0,bottomLeft:!0,bottomRight:!0,left:!0,right:!0,top:!0,topLeft:!0,topRight:!0}:!1,resizeHandleStyles:{bottom:{opacity:0,cursor:"ns-resize"},bottomLeft:{opacity:0,cursor:"nesw-resize"},bottomRight:{opacity:0,cursor:"nwse-resize"},left:{opacity:0,cursor:"ew-resize"},right:{opacity:0,cursor:"ew-resize"},top:{opacity:0,cursor:"ns-resize"},topLeft:{opacity:0,cursor:"nwse-resize"},topRight:{opacity:0,cursor:"nesw-resize"}},onClick:J=>{J.stopPropagation(),!y.current&&o(J)},onMouseDown:J=>{J.button===2&&(J.stopPropagation(),o(J))},style:{position:"absolute",zIndex:r.type==="image"&&r.floating?i?10:1:i?1e3+(r.zIndex??100):r.zIndex??100,outline:i||s?"1px dashed #4d90fe":"1px dashed rgb(221, 221, 221)",boxSizing:"border-box",margin:0,padding:0,backgroundColor:i?"rgba(77, 144, 254, 0.05)":s?"rgba(82, 196, 26, 0.03)":"transparent"},children:[i&&!s&&v.jsxs("svg",{style:{position:"absolute",top:-5,left:-5,width:k+10,height:I+10,pointerEvents:"none",overflow:"visible",zIndex:1},children:[v.jsx("circle",{cx:5,cy:5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:k+5,cy:5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:5,cy:I+5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:k+5,cy:I+5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:k/2+5,cy:5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:k/2+5,cy:I+5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:5,cy:I/2+5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:k+5,cy:I/2+5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"})]}),v.jsx("div",{className:`design-object ${r.type} `,style:P,"data-object-id":`${e.id}-${r.id}`,children:r.type==="image"?r.src||r.imageUrl?r.objectFit==="repeat"?v.jsx("div",{style:{width:"100%",height:"100%",backgroundImage:`url(${r.src||r.imageUrl})`,backgroundRepeat:"repeat",backgroundSize:"auto",pointerEvents:"none"}}):v.jsx("img",{src:r.src||r.imageUrl,alt:r.alt||"图片",draggable:!1,style:{width:"100%",height:"100%",objectFit:r.objectFit||"contain",pointerEvents:"none"}}):v.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"[图片]"}):r.type==="barcode"?v.jsx(Mh,{value:r.text||"",type:r.barcodeType||"CODE128",width:r.width,height:r.height,showText:r.showText!==!1,background:r.background||"#FFFFFF",lineColor:r.lineColor||"#000000"}):r.type==="qrcode"?v.jsx(Dh,{value:r.text||"",width:r.width,height:r.height,errorLevel:r.errorLevel||"M",background:r.background||"#FFFFFF",foreground:r.foreground||"#000000"}):n||A})]})},OU=({object:r,band:e,isSelected:t,isFocused:A=!1,selectedObjectIds:n,onSelect:i,onUpdate:s,onDragMultiple:a})=>{const o=ce.useRef("none"),l=ce.useRef(null),u=ce.useRef(null),f=ce.useRef(!1),h=ce.useRef(null),c=ce.useRef(null),g=ce.useRef(null),p=ce.useRef(s);p.current=s;const y=ce.useRef(r);y.current=r;const w=e.top,B=e.actualBottom;let x=r.x1,E=r.y1,Q=r.x2,L=r.y2,S=!0;const T=Math.min(r.y1,r.y2),_=Math.max(r.y1,r.y2);if(!t)if(_<=w||T>=B)S=!1;else if(r.y1!==r.y2){const ue=r.x2-r.x1,fe=r.y2-r.y1;r.y1<w?(x=r.x1+ue*(w-r.y1)/fe,E=w):r.y1>B&&(x=r.x1+ue*(B-r.y1)/fe,E=B),r.y2<w?(Q=r.x2+ue*(w-r.y2)/fe,L=w):r.y2>B&&(Q=r.x2+ue*(B-r.y2)/fe,L=B)}else(r.y1<w||r.y1>B)&&(S=!1);const D=x,U=E,O=Q,M=L;let C,z,re,ne;h.current?(C=h.current.left,z=h.current.top,re=h.current.right,ne=h.current.bottom):(C=Math.min(r.x1,r.x2),z=Math.min(r.y1,r.y2),re=Math.max(r.x1,r.x2),ne=Math.max(r.y1,r.y2));const Z=re-C||1,Ae=ne-z||1,V=3,k=.5,I=r.color||"#000000",P=r.strokeWidth||1,K=r.lineStyle||"solid",Y=()=>K==="dashed"?`${P*4} ${P*2}`:K==="dotted"?`${P} ${P*2}`:"none",J=ue=>{if(ue.stopPropagation(),f.current){f.current=!1;return}i(ue)},q=ue=>{if(ue.button===2){ue.stopPropagation(),i(ue);return}t&&(ue.stopPropagation(),o.current="line",l.current={x:ue.clientX,y:ue.clientY,x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},u.current={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},c.current={x:ue.clientX,y:ue.clientY},g.current=null,document.addEventListener("mousemove",oe),document.addEventListener("mouseup",we))},W=ue=>{ue.stopPropagation(),o.current="start",l.current={x:ue.clientX,y:ue.clientY,x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},u.current={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},c.current={x:ue.clientX,y:ue.clientY},h.current={left:Math.min(r.x1,r.x2),top:Math.min(r.y1,r.y2),right:Math.max(r.x1,r.x2),bottom:Math.max(r.y1,r.y2)},document.addEventListener("mousemove",oe),document.addEventListener("mouseup",we)},te=ue=>{ue.stopPropagation(),o.current="end",l.current={x:ue.clientX,y:ue.clientY,x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},u.current={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},c.current={x:ue.clientX,y:ue.clientY},h.current={left:Math.min(r.x1,r.x2),top:Math.min(r.y1,r.y2),right:Math.max(r.x1,r.x2),bottom:Math.max(r.y1,r.y2)},document.addEventListener("mousemove",oe),document.addEventListener("mouseup",we)},oe=ue=>{const fe=o.current;if(!l.current||fe==="none")return;const Le=ue.clientX-c.current.x,Fe=ue.clientY-c.current.y;let Ne=Le,ve=Fe;if(ue.shiftKey&&(fe==="start"||fe==="end")&&u.current){const Qe=u.current,De=Math.abs(Qe.y1-Qe.y2)<5,it=Math.abs(Qe.x1-Qe.x2)<5;if(De)ve=0;else if(it)Ne=0;else{let et,Ge;fe==="start"?(et=Qe.x1-Qe.x2,Ge=Qe.y1-Qe.y2):(et=Qe.x2-Qe.x1,Ge=Qe.y2-Qe.y1);const At=Math.sqrt(et*et+Ge*Ge);if(At>0){const nt=et/At,tt=Ge/At,lt=Le*nt+Fe*tt;Ne=lt*nt,ve=lt*tt}}}if(fe==="line"){const Qe=`${e.id}-${r.id}`;if((n==null?void 0:n.includes(Qe))&&n&&n.length>=1&&a){let et=ue.clientX-l.current.x,Ge=ue.clientY-l.current.y;if(ue.shiftKey&&c.current){const At=ue.clientX-c.current.x,nt=ue.clientY-c.current.y;g.current||(Math.abs(At)>5||Math.abs(nt)>5)&&(g.current=Math.abs(At)>Math.abs(nt)?"x":"y"),g.current==="x"?Ge=0:g.current==="y"&&(et=0)}else g.current=null;l.current.x=ue.clientX,l.current.y=ue.clientY,(et!==0||Ge!==0)&&a(et,Ge,!0)}else{const et=u.current;p.current(y.current.id,{x1:et.x1+Le,y1:et.y1+Fe,x2:et.x2+Le,y2:et.y2+Fe},!0)}}else if(fe==="start"){const Qe=u.current,De=Qe.x1+Ne,it=Qe.y1+ve;p.current(y.current.id,{x1:De,y1:it,x2:Qe.x2,y2:Qe.y2},!0)}else if(fe==="end"){const Qe=u.current,De=Qe.x2+Ne,it=Qe.y2+ve;console.log("鼠标拖动终点:",{before:{x1:Qe.x1,y1:Qe.y1,x2:Qe.x2,y2:Qe.y2},delta:{deltaX:Ne,deltaY:ve},after:{x1:Qe.x1,y1:Qe.y1,x2:De,y2:it}}),p.current(y.current.id,{x1:Qe.x1,y1:Qe.y1,x2:De,y2:it},!0)}},we=ue=>{const fe=o.current,Le=`${e.id}-${r.id}`,Ne=(n==null?void 0:n.includes(Le))&&n&&n.length>=1;if(fe!=="none"&&u.current){const ve=u.current,Qe=y.current;(ve.x1!==Qe.x1||ve.y1!==Qe.y1||ve.x2!==Qe.x2||ve.y2!==Qe.y2)&&(fe==="line"&&Ne&&a?a(0,0,!1):p.current(Qe.id,{x1:Qe.x1,y1:Qe.y1,x2:Qe.x2,y2:Qe.y2},!1),f.current=!0,ue.stopPropagation(),ue.preventDefault())}o.current="none",l.current=null,u.current=null,c.current=null,g.current=null,h.current=null,document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",we)},le=V+k,Be=Z+le*2,ye=Ae+le*2,R=D-C+le,Ie=U-z+le,Ue=O-C+le,Re=M-z+le,Ee=r.x1-C+le,Ve=r.y1-z+le,Me=r.x2-C+le,ze=r.y2-z+le;let Ye=Ee,xe=Ve,Oe=Me,je=ze;const ge=Me-Ee,Pe=ze-Ve,Te=Math.sqrt(ge*ge+Pe*Pe);if(Te>0){const ue=ge/Te,fe=Pe/Te;Ye=Ee-ue*V,xe=Ve-fe*V,Oe=Me+ue*V,je=ze+fe*V}return S?v.jsxs("svg",{className:"design-object design-line",width:Be,height:ye,style:{overflow:"visible",pointerEvents:"none",position:"absolute",left:C-le,top:z-le,width:Be,height:ye,zIndex:t?1e3+(r.zIndex??1):r.zIndex??1,outline:"none",border:"none"},children:[v.jsx("line",{x1:R,y1:Ie,x2:Ue,y2:Re,stroke:"transparent",strokeWidth:Math.max(P+10,15),style:{cursor:t?"move":"pointer",pointerEvents:"auto"},onClick:J,onMouseDown:q}),v.jsx("line",{x1:R,y1:Ie,x2:Ue,y2:Re,stroke:t?"#4d90fe":A?"#52c41a":I,strokeWidth:A?P+1:P,strokeDasharray:t?"4 3":A?"6 3":Y(),strokeLinecap:"round",style:{pointerEvents:"none"}}),t&&!A&&v.jsxs(v.Fragment,{children:[v.jsx("circle",{cx:Ye,cy:xe,r:V,fill:"transparent",stroke:"#4d90fe",strokeWidth:k,strokeDasharray:"2 1",style:{cursor:"crosshair",pointerEvents:"auto"},onMouseDown:W}),v.jsx("circle",{cx:Oe,cy:je,r:V,fill:"transparent",stroke:"#4d90fe",strokeWidth:k,strokeDasharray:"2 1",style:{cursor:"crosshair",pointerEvents:"auto"},onMouseDown:te})]})]}):null},si=r=>{const e=r,t=2;if(r.type==="line"){const i=r,s=i.x1??r.x,a=i.y1??r.y,o=i.x2??r.x+r.width,l=i.y2??r.y,u=Math.min(s,o),f=Math.min(a,l),h=Math.max(s,o),c=Math.max(a,l);return{x:u,y:f,width:h-u||1,height:c-f||1,extra:0}}let A=0;e.border&&e.border.style!=="none"&&e.border.width?A=e.border.width:e.border||(r.type==="field"||r.type==="rectangle")&&(A=1);const n=A+t;return{x:r.x,y:r.y,width:r.width+n*2,height:r.height+n*2,extra:n}},TU=({visible:r,x:e,y:t,selectedObjectIds:A,bands:n,onClose:i,onUpdateObjects:s,onDeleteObjects:a,onClearSelection:o,onUndo:l,onRedo:u,canUndo:f,canRedo:h,onCopy:c,onPaste:g,canPaste:p=!1,pageWidth:y,pageMargins:w})=>{const B=ce.useRef(null),[x,E]=ce.useState({x:e,y:t});ce.useEffect(()=>{if(r&&B.current){const k=B.current.getBoundingClientRect(),I=window.innerWidth,P=window.innerHeight;let K=e,Y=t;e+k.width>I&&(K=I-k.width-8),t+k.height>P&&(Y=P-k.height-8),K=Math.max(8,K),Y=Math.max(8,Y),E({x:K,y:Y})}},[r,e,t]);const Q=ce.useMemo(()=>{const V=[];return A.forEach(k=>{const[I,P]=k.split("-"),K=n.find(J=>J.id===I),Y=K==null?void 0:K.objects.find(J=>J.id===P);Y&&K&&V.push({object:Y,bandId:I})}),V},[A,n]),L=A.length>=1,S=A.length>=2,T=A.length>=3;ce.useEffect(()=>{const V=k=>{B.current&&!B.current.contains(k.target)&&i()};return r&&(document.addEventListener("mousedown",V),document.addEventListener("contextmenu",V)),()=>{document.removeEventListener("mousedown",V),document.removeEventListener("contextmenu",V)}},[r,i]),ce.useEffect(()=>{const V=k=>{k.key==="Escape"&&i()};return r&&document.addEventListener("keydown",V),()=>{document.removeEventListener("keydown",V)}},[r,i]);const _=ce.useCallback(V=>{if(Q.length<2)return;const k=Q[0].object,I=si(k),P=[];Q.slice(1).forEach(({object:K,bandId:Y})=>{const J=si(K),q={};if(K.type==="line"){const W=K,te=W.x1??K.x,oe=W.y1??K.y,we=W.x2??K.x+K.width,le=W.y2??K.y;let Be=0,ye=0;switch(V){case"left":Be=I.x-J.x;break;case"right":Be=I.x+I.width-(J.x+J.width);break;case"top":ye=I.y-J.y;break;case"bottom":ye=I.y+I.height-(J.y+J.height);break;case"horizontal-center":Be=I.x+I.width/2-(J.x+J.width/2);break;case"vertical-center":ye=I.y+I.height/2-(J.y+J.height/2);break}q.x1=te+Be,q.y1=oe+ye,q.x2=we+Be,q.y2=le+ye,q.x=K.x+Be,q.y=K.y+ye}else switch(V){case"left":q.x=I.x;break;case"right":q.x=I.x+I.width-J.width;break;case"top":q.y=I.y;break;case"bottom":q.y=I.y+I.height-J.height;break;case"horizontal-center":q.x=I.x+(I.width-J.width)/2;break;case"vertical-center":q.y=I.y+(I.height-J.height)/2;break}P.push({bandId:Y,objectId:K.id,changes:q})}),s(P),i()},[Q,s,i]),D=ce.useCallback(V=>{if(Q.length<3)return;const k=[...Q].sort((oe,we)=>V==="horizontal"?oe.object.x-we.object.x:oe.object.y-we.object.y),I=k[0].object,P=k[k.length-1].object,K=si(P);let Y,J=0;V==="horizontal"?(Y=P.x+K.width-I.x,k.forEach(({object:oe})=>{J+=si(oe).width})):(Y=P.y+K.height-I.y,k.forEach(({object:oe})=>{J+=si(oe).height}));const q=(Y-J)/(k.length-1),W=[];let te=V==="horizontal"?I.x:I.y;k.forEach(({object:oe,bandId:we},le)=>{const Be=si(oe);if(le===0){te+=V==="horizontal"?Be.width:Be.height;return}const ye={};V==="horizontal"?(ye.x=te+q,te=ye.x+Be.width):(ye.y=te+q,te=ye.y+Be.height),W.push({bandId:we,objectId:oe.id,changes:ye})}),s(W),i()},[Q,s,i]),U=ce.useCallback(V=>{if(Q.length<2)return;const k=Q[0].object,I=si(k),P=[],K=k.type==="line";let Y=0;if(K){const J=k,q=J.x1??k.x,W=J.y1??k.y,te=J.x2??k.x+k.width,oe=J.y2??k.y;q===te?Y=Math.abs(oe-W):W===oe?Y=Math.abs(te-q):Y=Math.sqrt(Math.pow(te-q,2)+Math.pow(oe-W,2))}Q.slice(1).forEach(({object:J,bandId:q})=>{const W={};if(J.type==="line"){const oe=J,we=oe.x1??J.x,le=oe.y1??J.y,Be=oe.x2??J.x+J.width,ye=oe.y2??J.y,R=we===Be,Ie=le===ye;if(K){if(R&&(V==="height"||V==="both")){const Ue=Math.abs(ye-le),Re=Y-Ue;ye>=le?W.y2=ye+Re:W.y2=ye-Re}else if(Ie&&(V==="width"||V==="both")){const Ue=Math.abs(Be-we),Re=Y-Ue;Be>=we?W.x2=Be+Re:W.x2=Be-Re}}else if(R&&(V==="height"||V==="both")){const Ue=I.height-Math.abs(ye-le);ye>=le?W.y2=ye+Ue:W.y2=ye-Ue}else if(Ie&&(V==="width"||V==="both")){const Ue=I.width-Math.abs(Be-we);Be>=we?W.x2=Be+Ue:W.x2=Be-Ue}Object.keys(W).length>0&&P.push({bandId:q,objectId:J.id,changes:W});return}const te=si(J);(V==="width"||V==="both")&&(W.width=I.width-te.extra*2),(V==="height"||V==="both")&&(W.height=I.height-te.extra*2),P.push({bandId:q,objectId:J.id,changes:W})}),P.length>0&&s(P),i()},[Q,s,i]),O=1,M=ce.useCallback(()=>{if(Q.length===0)return;const V=[];Q.forEach(({object:k,bandId:I})=>{const P=k.zIndex??O;V.push({bandId:I,objectId:k.id,changes:{zIndex:P+1}})}),s(V),i()},[Q,s,i]),C=ce.useCallback(()=>{if(Q.length===0)return;const V=[];Q.forEach(({object:k,bandId:I})=>{const P=k.zIndex??O;V.push({bandId:I,objectId:k.id,changes:{zIndex:Math.max(O,P-1)}})}),s(V),i()},[Q,s,i]),z=ce.useCallback(()=>{if(Q.length===0)return;let V=0;Q.forEach(({bandId:I})=>{const P=n.find(K=>K.id===I);P&&P.objects.forEach(K=>{const Y=K.zIndex??0;Y>V&&(V=Y)})});const k=[];Q.forEach(({object:I,bandId:P},K)=>{k.push({bandId:P,objectId:I.id,changes:{zIndex:V+1+K}})}),s(k),i()},[Q,n,s,i]),re=ce.useCallback(()=>{if(Q.length===0)return;const V=[];Q.forEach(({object:k,bandId:I})=>{V.push({bandId:I,objectId:k.id,changes:{zIndex:O}})}),s(V),i()},[Q,s,i]),ne=ce.useCallback(V=>{if(Q.length===0||!y||!w)return;const k=y-w.left-w.right;let I=1/0,P=-1/0;Q.forEach(({object:q})=>{const W=si(q),te=W.x,oe=W.x+W.width;te<I&&(I=te),oe>P&&(P=oe)});const K=P-I;let Y;switch(V){case"page-left":Y=0-I;break;case"page-center":Y=(k-K)/2-I;break;case"page-right":Y=k-P;break}const J=[];Q.forEach(({object:q,bandId:W})=>{const te={};if(q.type==="line"){const oe=q,we=oe.x1??q.x,le=oe.x2??q.x+q.width;te.x1=we+Y,te.x2=le+Y,te.x=q.x+Y}else te.x=q.x+Y;J.push({bandId:W,objectId:q.id,changes:te})}),s(J),i()},[Q,y,w,s,i]),Z=V=>{V(),i()};if(!r)return null;const Ae={position:"fixed",left:x.x,top:x.y,zIndex:1e4};return v.jsxs("div",{ref:B,className:"context-menu",style:Ae,children:[v.jsxs("div",{className:"context-menu-item",onClick:()=>Z(l),"data-disabled":!f,children:[v.jsx("span",{className:"menu-icon",children:"↩"}),v.jsx("span",{className:"menu-label",children:"撤销"}),v.jsx("span",{className:"menu-shortcut",children:"Ctrl+Z"})]}),v.jsxs("div",{className:"context-menu-item",onClick:()=>Z(u),"data-disabled":!h,children:[v.jsx("span",{className:"menu-icon",children:"↪"}),v.jsx("span",{className:"menu-label",children:"恢复"}),v.jsx("span",{className:"menu-shortcut",children:"Ctrl+Shift+Z"})]}),v.jsx("div",{className:"context-menu-divider"}),c&&v.jsxs("div",{className:"context-menu-item",onClick:()=>Z(c),"data-disabled":!L,children:[v.jsx("span",{className:"menu-icon",children:"📋"}),v.jsx("span",{className:"menu-label",children:"复制"}),v.jsx("span",{className:"menu-shortcut",children:"Ctrl+C"})]}),g&&v.jsxs("div",{className:"context-menu-item",onClick:()=>Z(g),"data-disabled":!p,children:[v.jsx("span",{className:"menu-icon",children:"📄"}),v.jsx("span",{className:"menu-label",children:"粘贴"}),v.jsx("span",{className:"menu-shortcut",children:"Ctrl+V"})]}),(c||g)&&v.jsx("div",{className:"context-menu-divider"}),v.jsxs("div",{className:"context-menu-item context-menu-submenu","data-disabled":!S,children:[v.jsx("span",{className:"menu-icon",children:"⬛"}),v.jsx("span",{className:"menu-label",children:"对齐"}),v.jsx("span",{className:"menu-arrow",children:"▸"}),v.jsxs("div",{className:"context-submenu",children:[v.jsx("div",{className:"context-menu-item",onClick:()=>_("left"),children:v.jsx("span",{className:"menu-label",children:"左对齐"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>_("horizontal-center"),children:v.jsx("span",{className:"menu-label",children:"水平居中"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>_("right"),children:v.jsx("span",{className:"menu-label",children:"右对齐"})}),v.jsx("div",{className:"context-menu-divider"}),v.jsx("div",{className:"context-menu-item",onClick:()=>_("top"),children:v.jsx("span",{className:"menu-label",children:"顶部对齐"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>_("vertical-center"),children:v.jsx("span",{className:"menu-label",children:"垂直居中"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>_("bottom"),children:v.jsx("span",{className:"menu-label",children:"底部对齐"})})]})]}),v.jsxs("div",{className:"context-menu-item context-menu-submenu","data-disabled":!T,children:[v.jsx("span",{className:"menu-icon",children:"⋮⋮"}),v.jsx("span",{className:"menu-label",children:"分布"}),v.jsx("span",{className:"menu-arrow",children:"▸"}),v.jsxs("div",{className:"context-submenu",children:[v.jsx("div",{className:"context-menu-item",onClick:()=>D("horizontal"),children:v.jsx("span",{className:"menu-label",children:"水平均匀分布"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>D("vertical"),children:v.jsx("span",{className:"menu-label",children:"垂直均匀分布"})})]})]}),v.jsxs("div",{className:"context-menu-item context-menu-submenu","data-disabled":!S,children:[v.jsx("span",{className:"menu-icon",children:"⬜"}),v.jsx("span",{className:"menu-label",children:"尺寸"}),v.jsx("span",{className:"menu-arrow",children:"▸"}),v.jsxs("div",{className:"context-submenu",children:[v.jsx("div",{className:"context-menu-item",onClick:()=>U("width"),children:v.jsx("span",{className:"menu-label",children:"相同宽度"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>U("height"),children:v.jsx("span",{className:"menu-label",children:"相同高度"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>U("both"),children:v.jsx("span",{className:"menu-label",children:"相同尺寸"})})]})]}),v.jsxs("div",{className:"context-menu-item context-menu-submenu","data-disabled":!L,children:[v.jsx("span",{className:"menu-icon",children:"◇"}),v.jsx("span",{className:"menu-label",children:"层级"}),v.jsx("span",{className:"menu-arrow",children:"▸"}),v.jsxs("div",{className:"context-submenu",children:[v.jsx("div",{className:"context-menu-item",onClick:z,children:v.jsx("span",{className:"menu-label",children:"置于顶层"})}),v.jsx("div",{className:"context-menu-item",onClick:M,children:v.jsx("span",{className:"menu-label",children:"上移一层"})}),v.jsx("div",{className:"context-menu-item",onClick:C,children:v.jsx("span",{className:"menu-label",children:"下移一层"})}),v.jsx("div",{className:"context-menu-item",onClick:re,children:v.jsx("span",{className:"menu-label",children:"置于底层"})})]})]}),v.jsxs("div",{className:"context-menu-item context-menu-submenu","data-disabled":!L||!y,children:[v.jsx("span",{className:"menu-icon",children:"↔"}),v.jsx("span",{className:"menu-label",children:"页面位置"}),v.jsx("span",{className:"menu-arrow",children:"▸"}),v.jsxs("div",{className:"context-submenu",children:[v.jsx("div",{className:"context-menu-item",onClick:()=>ne("page-left"),children:v.jsx("span",{className:"menu-label",children:"居左"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>ne("page-center"),children:v.jsx("span",{className:"menu-label",children:"居中"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>ne("page-right"),children:v.jsx("span",{className:"menu-label",children:"居右"})})]})]}),v.jsx("div",{className:"context-menu-divider"}),v.jsxs("div",{className:"context-menu-item delete",onClick:()=>Z(a),"data-disabled":!L,children:[v.jsx("span",{className:"menu-icon",children:"🗑"}),v.jsx("span",{className:"menu-label",children:"删除"}),v.jsx("span",{className:"menu-shortcut",children:"Delete"})]}),v.jsxs("div",{className:"context-menu-item",onClick:()=>Z(o),"data-disabled":!L,children:[v.jsx("span",{className:"menu-icon",children:"✖"}),v.jsx("span",{className:"menu-label",children:"取消选择"}),v.jsx("span",{className:"menu-shortcut",children:"Esc"})]})]})},fs={ROUND:(r,e=0)=>{const t=Math.pow(10,e);return Math.round(r*t)/t},FLOOR:r=>Math.floor(r),CEIL:r=>Math.ceil(r),ABS:r=>Math.abs(r),MOD:(r,e)=>r%e,CONCAT:(...r)=>r.join(""),LEFT:(r,e)=>String(r).substring(0,e),RIGHT:(r,e)=>String(r).slice(-e),LEN:r=>String(r).length,TRIM:r=>String(r).trim(),UPPER:r=>String(r).toUpperCase(),LOWER:r=>String(r).toLowerCase(),NOW:()=>new Date().toLocaleString("zh-CN"),TODAY:()=>new Date().toLocaleDateString("zh-CN"),YEAR:r=>new Date(r).getFullYear(),MONTH:r=>new Date(r).getMonth()+1,DAY:r=>new Date(r).getDate(),IF:(r,e,t)=>r?e:t,IIF:(r,e,t)=>r?e:t,ISNULL:(r,e)=>r==null||r===""?e:r,FORMAT:(r,e)=>{switch(e){case"currency":return`¥${r.toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}`;case"percent":return`${(r*100).toFixed(2)}%`;default:return String(r)}},FIXED:(r,e=2)=>r.toFixed(e),PADLEFT:(r,e,t="0")=>String(r).padStart(e,t),PADRIGHT:(r,e,t=" ")=>String(r).padEnd(e,t),COUNT:r=>Array.isArray(r)?r.length:r==="*"||r==="ROWID"?"__COUNT_ALL__":1,SUM:(r,e)=>Array.isArray(r)?e?r.reduce((t,A)=>t+(Number(A[e])||0),0):r.reduce((t,A)=>t+(Number(A)||0),0):0,AVG:(r,e)=>!Array.isArray(r)||r.length===0?0:(e?r.reduce((A,n)=>A+(Number(n[e])||0),0):r.reduce((A,n)=>A+(Number(n)||0),0))/r.length,MAX:(r,e)=>{if(!Array.isArray(r)||r.length===0)return 0;const t=e?r.map(A=>Number(A[e])||0):r.map(A=>Number(A)||0);return Math.max(...t)},MIN:(r,e)=>{if(!Array.isArray(r)||r.length===0)return 0;const t=e?r.map(A=>Number(A[e])||0):r.map(A=>Number(A)||0);return Math.min(...t)},ROWID:()=>"ROWID",TOCHINESE:r=>{if(r===0)return"零元整";if(isNaN(r))return"";const e=["角","分"],t=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],A=[["","拾","佰","仟"],["","万","亿","兆"]],n=r<0?"负":"";r=Math.abs(r);let i="";const s=r.toFixed(2),[a,o]=s.split(".");for(let u=0;u<o.length;u++){const f=Number(o.charAt(u));f!==0&&(i+=t[f]+e[u])}i=i||"整";let l=parseInt(a);if(l>0){let u="";for(let f=0;f<A[1].length&&l>0;f++){let h="";for(let c=0;c<A[0].length&&l>0;c++)h=t[l%10]+A[0][c]+h,l=Math.floor(l/10);u=h.replace(/(零.)*零$/,"").replace(/^零+/,"")+A[1][f]+u}i=u.replace(/(零.)*零元/,"元").replace(/(零.)+/g,"零")+"元"+i}return n+i},CURRENCY:(r,e="¥",t=2)=>{if(isNaN(r))return"";const A=Math.abs(r).toFixed(t),[n,i]=A.split("."),s=n.replace(/\B(?=(\d{3})+(?!\d))/g,",");return`${r<0?"-":""}${e}${s}${i?"."+i:""}`},DISCOUNT:(r,e)=>r*(1-e/100),TAX:(r,e)=>r*e/100,WITHTAX:(r,e)=>r*(1+e/100),EXTRACTTAX:(r,e)=>r-r/(1+e/100)},kh=r=>r.replace(/,/g,",").replace(/(/g,"(").replace(/)/g,")").replace(/“/g,'"').replace(/”/g,'"').replace(/‘/g,"'").replace(/’/g,"'").replace(/;/g,";").replace(/:/g,":"),vw=(r,e)=>{const{currentPage:t=1,totalPages:A=1,rowIndex:n=0}=e;return r.replace(/\{currentDate\}/g,`"${new Date().toLocaleDateString("zh-CN")}"`).replace(/\{currentTime\}/g,`"${new Date().toLocaleTimeString("zh-CN")}"`).replace(/\{pageNumber\}/g,String(t)).replace(/\{totalPages\}/g,String(A)).replace(/\{rowIndex\}/g,String(n+1))},LU=(r,e,t)=>{var A;if(!(!r&&!t)){if(e.includes(".")){const[n,i]=e.split(".");return n==="products"&&t&&t[i]!==void 0?t[i]:r&&r[n]&&Array.isArray(r[n])?(A=r[n][0])==null?void 0:A[i]:void 0}if(t&&t[e]!==void 0)return t[e];if(r&&r[e]!==void 0)return r[e]}},mw=(r,e)=>{const{data:t={},currentItem:A}=e,n=/\{([^}]+)\}/g;let i=!1;return{expression:r.replace(n,(a,o)=>{const l=LU(t,o,A);return l!==void 0?typeof l=="number"?String(l):`"${l}"`:(i=!0,`"[${o}]"`)}),hasUnresolved:i}},ww=r=>{const e=Object.keys(fs).join("|"),t=new RegExp(`\\b(${e})\\s*\\(`,"g");return r.replace(t,"__fn.$1(")},yw=(r,e)=>{const{data:t={},startIndex:A=0,pageSize:n=0}=e,i=a=>{const o=a.includes(".")?a.split(".")[0]:null;if(o&&t[o]&&Array.isArray(t[o]))return t[o];for(const l of Object.keys(t))if(Array.isArray(t[l]))return t[l];return[]},s=a=>a.includes(".")?a.split(".")[1]:a;return r=r.replace(/\bPAGECOUNT\s*\(\s*\*\s*\)/gi,()=>String(n)),r=r.replace(/\bPAGECOUNT\s*\(\s*ROWID\s*\(\s*\)\s*\)/gi,()=>String(n)),r=r.replace(/\bPAGESUM\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const u=i(o).slice(A,A+n),f=s(o),h=u.reduce((c,g)=>c+(Number(g[f])||0),0);return String(h)}),r=r.replace(/\bPAGEAVG\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const u=i(o).slice(A,A+n),f=s(o);if(u.length===0)return"0";const h=u.reduce((c,g)=>c+(Number(g[f])||0),0);return String(h/u.length)}),r=r.replace(/\bPAGEMAX\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const u=i(o).slice(A,A+n),f=s(o);if(u.length===0)return"0";const h=u.map(c=>Number(c[f])||0);return String(Math.max(...h))}),r=r.replace(/\bPAGEMIN\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const u=i(o).slice(A,A+n),f=s(o);if(u.length===0)return"0";const h=u.map(c=>Number(c[f])||0);return String(Math.min(...h))}),r=r.replace(/\bCOUNT\s*\(\s*\*\s*\)/gi,()=>{for(const a of Object.keys(t))if(Array.isArray(t[a]))return String(t[a].length);return"0"}),r=r.replace(/\bCOUNT\s*\(\s*ROWID\s*\(\s*\)\s*\)/gi,()=>{for(const a of Object.keys(t))if(Array.isArray(t[a]))return String(t[a].length);return"0"}),r=r.replace(/\bSUM\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const l=i(o),u=s(o),f=l.reduce((h,c)=>h+(Number(c[u])||0),0);return String(f)}),r=r.replace(/\bAVG\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const l=i(o),u=s(o);if(l.length===0)return"0";const f=l.reduce((h,c)=>h+(Number(c[u])||0),0);return String(f/l.length)}),r=r.replace(/\bMAX\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const l=i(o),u=s(o);if(l.length===0)return"0";const f=l.map(h=>Number(h[u])||0);return String(Math.max(...f))}),r=r.replace(/\bMIN\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const l=i(o),u=s(o);if(l.length===0)return"0";const f=l.map(h=>Number(h[u])||0);return String(Math.min(...f))}),r},PU=(r,e)=>{const{formatType:t="text",decimalPlaces:A=2}=e;switch(t){case"currency":return`¥${r.toFixed(A).replace(/\B(?=(\d{3})+(?!\d))/g,",")}`;case"percent":return`${(r*100).toFixed(A)}%`;case"number":return r.toFixed(A).replace(/\B(?=(\d{3})+(?!\d))/g,",");case"text":default:return String(r)}},ho=(r,e={},t={})=>{if(!r||!r.trim())return"[公式]";r=kh(r);try{let A=vw(r,e);A=yw(A,e);const{expression:n,hasUnresolved:i}=mw(A,e);A=n;const s=/\b(SUM|COUNT|AVG|MAX|MIN|PAGESUM|PAGECOUNT|PAGEAVG|PAGEMAX|PAGEMIN|ROWID|ROUND|FLOOR|CEIL|ABS|MOD|CONCAT|LEFT|RIGHT|LEN|TRIM|UPPER|LOWER|NOW|TODAY|YEAR|MONTH|DAY|IF|IIF|ISNULL|FORMAT|FIXED|PADLEFT|PADRIGHT|TOCHINESE|CURRENCY|DISCOUNT|TAX|WITHTAX|EXTRACTTAX)\s*\(/i.test(A);if(i&&!s)try{const o=Function('"use strict"; return ('+A+")")();return String(o)}catch{return r.replace(/\{([^}]+)\}/g,"[$1]")}if(A=ww(A),A.includes('"')||A.includes("'")){if(!/^[\d\s+"'\u4e00-\u9fa5\w\-_.,:;=<>!&|\uff08\uff09\uff1a\uff0c\u3002\u3001()[\]]+$/.test(A))return console.error("[公式错误] 字符串公式包含不允许的字符:",A),"[公式错误]";const o=Function("__fn",'"use strict"; return ('+A+")")(fs);return String(o)}else{if(!/^[\d\s+\-*/().%<>=!&|?:\w]+$/.test(A))return console.error("数字公式包含不允许的字符:",A),"[公式错误]";const o=Function("__fn",'"use strict"; return ('+A+")")(fs);return typeof o=="number"&&!isNaN(o)&&isFinite(o)?PU(o,t):String(o)}}catch(A){return console.error("公式计算错误:",A),"[计算错误]"}},RU=(r,e)=>{fs[r.toUpperCase()]=e},MU=()=>Object.keys(fs),Bw=r=>{if(!r||!r.trim())return{valid:!1,message:"公式不能为空"};const e=kh(r);let t=0;for(const a of e)if(a==="("&&t++,a===")"&&t--,t<0)return{valid:!1,message:"括号不匹配:多余的右括号"};if(t!==0)return{valid:!1,message:"括号不匹配:缺少右括号"};let A=0;for(const a of e)if(a==="{"&&A++,a==="}"&&A--,A<0)return{valid:!1,message:"字段引用格式错误:多余的 }"};if(A!==0)return{valid:!1,message:"字段引用格式错误:缺少 }"};if(/^\s*[A-Z_][A-Z0-9_]*\s*\(/i.test(e)){let a=0,o=-1;for(let l=0;l<e.length;l++)if(e[l]==="("&&a++,e[l]===")"&&(a--,a===0)){o=l;break}if(o!==-1&&o<e.length-1){const l=e.substring(o+1).trim();if(l&&!/^[\s+\-*/&|<>=]+/.test(l))return{valid:!1,message:`公式语法错误:函数调用后有多余内容 "${l}"`}}}let i=!1,s="";for(let a=0;a<e.length;a++){const o=e[a];!i&&(o==='"'||o==="'")?(i=!0,s=o):i&&o===s&&e[a-1]!=="\\"&&(i=!1)}return i?{valid:!1,message:"字符串引号不匹配"}:{valid:!0,message:"公式格式正确"}},DU=(r,e,t)=>{if(!r||!r.trim())return{valid:!1,message:"公式不能为空"};const A=kh(r);try{let n=vw(A,{currentPage:1,totalPages:1,rowIndex:0});const i=e.products||[t];n=yw(n,{data:{...e,products:i},startIndex:0,pageSize:i.length});const{expression:s}=mw(n,{data:e,currentItem:t});n=s,n=ww(n);const a=Function("__fn",'"use strict"; return ('+n+")")(fs);return{valid:!0,message:"校验通过",result:String(a)}}catch(n){const i=n instanceof Error?n.message:String(n);if(i.includes("is not defined")){const s=i.match(/(\w+) is not defined/);if(s)return{valid:!1,message:`未定义的变量或函数: "${s[1]}",请检查拼写或使用 {字段名} 格式引用数据字段`}}if(i.includes("is not a function")){const s=i.match(/(\w+) is not a function/);if(s)return{valid:!1,message:`"${s[1]}" 不是有效的函数,请检查函数名拼写`}}return i.includes("Unexpected token")?{valid:!1,message:"语法错误: 意外的符号,请检查括号、引号、运算符是否正确"}:i.includes("Unexpected end")?{valid:!1,message:"语法错误: 公式不完整,请检查是否缺少括号或参数"}:{valid:!1,message:`执行错误: ${i}`}}},bw=(r,e)=>{const t=r.find(A=>A.name===e);return(t==null?void 0:t.type)||"string"},xw=(r,e)=>{const t=r.find(A=>A.name===e);if(t)return t.label;if(e.includes(".")){const A=e.split(".")[1],n=r.find(i=>i.name.endsWith("."+A));if(n)return n.label}return e},hs=(r,e)=>{if(r==null)return"";switch(e){case"currency":return typeof r=="number"?`¥${r.toLocaleString("zh-CN")}`:String(r);case"number":return typeof r=="number"?r.toLocaleString("zh-CN"):String(r);case"date":return r instanceof Date?r.toLocaleDateString("zh-CN"):String(r);case"string":default:return String(r)}},kU=(r,e)=>{const t=r.getFullYear(),A=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0"),i=String(r.getHours()).padStart(2,"0"),s=String(r.getMinutes()).padStart(2,"0"),a=String(r.getSeconds()).padStart(2,"0");return e.replace(/yyyy/g,String(t)).replace(/MM/g,A).replace(/dd/g,n).replace(/HH/g,i).replace(/mm/g,s).replace(/ss/g,a)},HU=(r,e)=>{const t=r.y,A=t+r.height,n=e.top,i=e.actualBottom;if(A>n&&t<i){const s=Math.max(t,n),a=Math.min(A,i),o=s-t,l=A-a;return`inset(${o}px 0 ${l}px 0)`}},Qu=(r,e={})=>{const{data:t={},currentPage:A=1,totalPages:n=1,startIndex:i=0,rowIndex:s=0,pageSize:a=0}=e,o=u=>t[u]&&Array.isArray(t[u])?t[u]:[],l=u=>o(u)[i+s]||null;switch(r.type){case"text":case"multiline_text":return r.text||"";case"field":const u=r.fieldName||"",f=bw(e.dataFields||[],u);if(u.includes(".")){const[g,p]=u.split("."),y=l(g);if(y&&y[p]!==void 0)return hs(y[p],f);const w=o(g);return w.length>0&&w[0][p]!==void 0?hs(w[0][p],f):`{${xw(e.dataFields||[],u)}}`}const h=t[u];return h!==void 0?hs(h,f):`{${xw(e.dataFields||[],u)}}`;case"calculated":return ho(r.formula||"",{data:t,currentPage:A,totalPages:n,rowIndex:i+s,startIndex:i,pageSize:a},{formatType:r.formatType,decimalPlaces:r.decimalPlaces});case"page_number":return`第${A}页/共${n}页`;case"current_date":return kU(new Date,r.text||"yyyy-MM-dd");case"image":return"[图片]";case"line":case"rectangle":return"";case"barcode":case"qrcode":const c=r.fieldName||"";if(c){const g=bw(e.dataFields||[],c);if(c.includes(".")){const[p,y]=c.split("."),w=l(p);if(w&&w[y]!==void 0)return hs(w[y],g);const B=o(p);if(B.length>0&&B[0][y]!==void 0)return hs(B[0][y],g)}else{const p=t[c];if(p!==void 0)return hs(p,g)}}return r.text||"";default:return""}},jU=(r,e)=>{const t=r.textVerticalAlign||e.verticalAlign||"middle",A=e.textAlign||"left";if(!["text","multiline_text","field","calculated","page_number","current_date"].includes(r.type))return{};switch(t){case"top":return{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:A==="center"?"center":A==="right"?"flex-end":"flex-start",width:"100%",height:"100%",boxSizing:"border-box",margin:0,padding:0};case"bottom":return{display:"flex",flexDirection:"column",justifyContent:"flex-end",alignItems:A==="center"?"center":A==="right"?"flex-end":"flex-start",width:"100%",height:"100%",boxSizing:"border-box",margin:0,padding:0};case"middle":default:return{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:A==="center"?"center":A==="right"?"flex-end":"flex-start",width:"100%",height:"100%",boxSizing:"border-box",margin:0,padding:0}}},Hh=(r,e={})=>{const{isSelected:t=!1,isPreview:A=!1}=e,n={fontSize:r.fontSize||12,color:r.color||"#000000",backgroundColor:r.background||"transparent",fontWeight:r.fontWeight||"normal",fontStyle:r.fontStyle||"normal",textAlign:r.textAlign||"left",lineHeight:r.lineHeight||1.2};if(typeof r.padding=="object"&&r.padding){const s=r.padding.top??0,a=r.padding.right??0,o=r.padding.bottom??0,l=r.padding.left??0;n.padding=`${s}px ${a}px ${o}px ${l}px`}else n.padding=r.padding??0;const i=r.border;if(i&&i.width&&i.width>0){const s=i.width,a=i.style&&i.style!=="none"?i.style:"solid",o=i.color&&i.color!=="transparent"?i.color:"#000000";n.border=`${s}px ${a} ${o}`}switch(r.type){case"multiline_text":n.whiteSpace="pre-wrap",n.wordBreak="break-word";break;case"field":case"calculated":break;case"page_number":case"current_date":n.color=n.color||"#666666";break;case"image":n.display="flex",n.alignItems="center",n.justifyContent="center",n.overflow="hidden";break;case"line":break;case"rectangle":r.border||(n.border="1px solid #000000"),r.borderRadius&&r.borderRadius>0&&(n.borderRadius=`${r.borderRadius}px`);break;case"ellipse":n.borderRadius="50%",(!i||!i.width||i.width<1)&&(n.border="1px solid #000000");break;case"star":n.clipPath="polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)",(!n.backgroundColor||n.backgroundColor==="transparent")&&(n.backgroundColor="#FFD700");break;case"triangle":n.clipPath="polygon(50% 0%, 0% 100%, 100% 100%)",(!n.backgroundColor||n.backgroundColor==="transparent")&&(n.backgroundColor="#000000");break;case"diamond":n.clipPath="polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",(!n.backgroundColor||n.backgroundColor==="transparent")&&(n.backgroundColor="#000000");break}return!A&&t&&(n.outline="1px solid #4d90fe",n.zIndex=1e3),n},Cw=(r,e,t)=>{if(!["text","multiline_text","field","calculated","page_number","current_date"].includes(e.type))return r;const n=jU(e,t);if(Object.keys(n).length>0){const i={padding:t.padding,boxSizing:"border-box",width:"100%",textAlign:t.textAlign,lineHeight:t.lineHeight,whiteSpace:e.type==="multiline_text"?"normal":"pre-wrap",wordBreak:"break-word",overflow:"hidden"};return e.type==="multiline_text"?ce.createElement("div",{style:n,className:"text-content-wrapper"},ce.createElement("div",{style:i,className:"text-content rich-text-content",dangerouslySetInnerHTML:{__html:r}})):ce.createElement("div",{style:n,className:"text-content-wrapper"},ce.createElement("div",{style:i,className:"text-content"},r))}return e.type==="multiline_text"?ce.createElement("div",{className:"rich-text-content",dangerouslySetInnerHTML:{__html:r}}):r},jh=(r,e,t=!1)=>{if(!t)return e;const A=r.textVerticalAlign||"middle",n=r.textAlign||"left";return{...e,display:"flex",flexDirection:"column",justifyContent:A==="top"?"flex-start":A==="bottom"?"flex-end":"center",alignItems:n==="center"?"center":n==="right"?"flex-end":"flex-start"}},Nu=(r,e,t={})=>{const{isSelected:A=!1,isPreview:n=!1,data:i={},currentPage:s=1,totalPages:a=1,startIndex:o=0,rowIndex:l=0,includeClipPath:u=!0,pageSize:f=0,dataFields:h=[]}=t,c=Qu(r,{data:i,currentPage:s,totalPages:a,startIndex:o,rowIndex:l,pageSize:f,dataFields:h}),g=Hh(r,{isSelected:A,isPreview:n}),y={...{position:"absolute",left:r.x,top:r.y-e.top,width:r.width,height:r.height,zIndex:r.zIndex??1},...g};["text","field","calculated","page_number","current_date"].includes(r.type)&&(delete y.display,delete y.alignItems,delete y.justifyContent,delete y.flexDirection);const B=["star","triangle","diamond"],x=r.type==="image"&&r.floating===!0;if(u&&!B.includes(r.type)&&!x){const Q=HU(r,e);Q&&(y.clipPath=Q)}const E=Cw(c,r,g);return{content:c,style:y,wrappedContent:E}},Ew=(r,e={})=>{const{isPreview:t=!1,data:A={},currentPage:n=1,totalPages:i=1,selectedObjectId:s="",products:a=[],startIndex:o=0,includeClipPath:l=!0,dataFields:u=[]}=e,f=[];return r.id==="detail"&&a.length>0?a.forEach((h,c)=>{r.objects.forEach(g=>{const p=Nu(g,r,{isSelected:s===g.id,isPreview:t,data:A,currentPage:n,totalPages:i,startIndex:o,rowIndex:c,includeClipPath:l,pageSize:a.length,dataFields:u});f.push({obj:g,renderData:p,isSelected:s===g.id,rowIndex:c})})}):r.objects.forEach(h=>{const c=Nu(h,r,{isSelected:s===h.id,isPreview:t,data:A,currentPage:n,totalPages:i,includeClipPath:l,dataFields:u});f.push({obj:h,renderData:c,isSelected:s===h.id})}),f};class KU{constructor(){this.selectedObjects=new Map,this.selectionRect=null,this.shiftKeyPressed=!1,this.ctrlKeyPressed=!1,this.isDraggingSelection=!1,this.dragStartX=0,this.dragStartY=0,this.clipboard=[],this.MOVE_STEP=1,this.keyState={},this.handleMouseDown=(e,t,A,n,i,s)=>{this.shiftKeyPressed=A,this.ctrlKeyPressed=n,this.selectionRect=null,this.dragStartX=e,this.dragStartY=t,this.isDraggingSelection=!0,!this.shiftKeyPressed&&!this.ctrlKeyPressed&&(this.selectedObjects.clear(),s&&s(this.getSelectedObjectIds())),this.selectionRect={x:this.dragStartX,y:this.dragStartY,width:0,height:0}},this.handleMouseMove=(e,t,A,n,i,s,a)=>{if(!this.isDraggingSelection||!this.selectionRect)return;this.shiftKeyPressed=A,this.ctrlKeyPressed=n,this.selectionRect.width=e-this.dragStartX,this.selectionRect.height=t-this.dragStartY;const o=this.getNormalizedRect(this.selectionRect),l=this.findObjectsInRect(o,i,s),u=this.selectedObjects.size;this.shiftKeyPressed||this.ctrlKeyPressed?l.forEach(h=>{const c=`${h.bandId}-${h.object.id}`;this.selectedObjects.has(c)||this.selectedObjects.set(c,h)}):(this.selectedObjects.clear(),l.forEach(h=>{const c=`${h.bandId}-${h.object.id}`;this.selectedObjects.set(c,h)}));const f=this.selectedObjects.size;u!==f&&a(this.getSelectedObjectIds())},this.handleMouseUp=(e,t,A)=>{this.shiftKeyPressed=e,this.ctrlKeyPressed=t,this.isDraggingSelection=!1;const n=this.getSelectedObjects();if(this.selectionRect=null,A){const i=this.getSelectedObjectIds();A(i)}return n},this.handleKeyDown=(e,t,A,n,i)=>{var l;const s=document.activeElement,a=(l=s==null?void 0:s.tagName)==null?void 0:l.toLowerCase();if(a==="input"||a==="textarea"||a==="select"||s!=null&&s.isContentEditable)return;this.keyState[e.key.toLowerCase()]=!0,this.shiftKeyPressed=e.shiftKey,this.ctrlKeyPressed=e.ctrlKey||e.metaKey;const o=e.altKey;if(["arrowup","arrowdown","arrowleft","arrowright"].includes(e.key.toLowerCase())){if(e.preventDefault(),this.selectedObjects.size===0)return;const u=this.shiftKeyPressed?10:this.MOVE_STEP;if(o&&A){let f=0,h=0;switch(e.key.toLowerCase()){case"arrowup":h=-u;break;case"arrowdown":h=u;break;case"arrowleft":f=-u;break;case"arrowright":f=u;break}const c=[];this.selectedObjects.forEach(g=>{c.push({objectId:g.object.id,bandId:g.bandId,deltaWidth:f,deltaHeight:h})}),A(c)}else{let f=0,h=0;switch(e.key.toLowerCase()){case"arrowup":h=-u;break;case"arrowdown":h=u;break;case"arrowleft":f=-u;break;case"arrowright":f=u;break}const c=[];this.selectedObjects.forEach(g=>{c.push({objectId:g.object.id,bandId:g.bandId,deltaX:f,deltaY:h})}),t(c)}}switch(e.key.toLowerCase()){case"escape":this.selectedObjects.clear();break;case"a":(e.ctrlKey||e.metaKey)&&e.preventDefault();break;case"c":(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.copySelectedObjects());break;case"v":if((e.ctrlKey||e.metaKey)&&n){e.preventDefault();const u=i?this.getClipboardObjects(i.id,{top:i.top,actualBottom:i.actualBottom}):this.getClipboardObjects();u.length>0&&n(u)}break}},this.handleKeyUp=e=>{this.keyState[e.key.toLowerCase()]=!1,this.shiftKeyPressed=e.shiftKey,this.ctrlKeyPressed=e.ctrlKey||e.metaKey},this.selectObject=(e,t,A=!1)=>{const n=`${t}-${e.id}`;return A?this.selectedObjects.has(n)?this.selectedObjects.delete(n):this.selectedObjects.set(n,{object:e,bandId:t,originalX:e.x,originalY:e.y}):(this.selectedObjects.clear(),this.selectedObjects.set(n,{object:e,bandId:t,originalX:e.x,originalY:e.y})),this.getSelectedObjectIds()},this.getSelectionRect=()=>this.selectionRect,this.getSelectedObjectIds=()=>Array.from(this.selectedObjects.keys()),this.getSelectedObjects=()=>Array.from(this.selectedObjects.values()),this.clearSelection=()=>{this.selectedObjects.clear(),this.selectionRect=null},this.isObjectSelected=(e,t)=>this.selectedObjects.has(`${t}-${e}`),this.getSelectionBounds=()=>{if(this.selectedObjects.size===0)return null;let e=1/0,t=1/0,A=-1/0,n=-1/0;return this.selectedObjects.forEach(i=>{const s=i.object;e=Math.min(e,s.x),t=Math.min(t,s.y),A=Math.max(A,s.x+s.width),n=Math.max(n,s.y+s.height)}),{x:e,y:t,width:A-e,height:n-t}},this.copySelectedObjects=()=>{this.clipboard=Array.from(this.selectedObjects.values()).map(e=>({...e,object:{...e.object}})),console.log(`已复制 ${this.clipboard.length} 个对象`)},this.getClipboardObjects=(e,t)=>this.clipboard.length===0?[]:this.clipboard.map(A=>{const n=A.bandId,i=e||n;let s=5;e&&t&&(s=t.top+5-A.object.y);const a={...A.object,x:A.object.x+5,y:A.object.y+s};if(A.object.type==="line"){const o=A.object;a.x1=(o.x1??A.object.x)+5,a.y1=(o.y1??A.object.y)+s,a.x2=(o.x2??A.object.x+A.object.width)+5,a.y2=(o.y2??A.object.y)+s}return{...A,bandId:i,object:a,originalX:A.object.x+5,originalY:A.object.y+s}}),this.hasClipboardContent=()=>this.clipboard.length>0}getNormalizedRect(e){const t=Math.min(e.x,e.x+e.width),A=Math.min(e.y,e.y+e.height),n=Math.abs(e.width),i=Math.abs(e.height);return{x:t,y:A,width:n,height:i}}findObjectsInRect(e,t,A){const n=[];if(!t||!Array.isArray(t))return console.log("bands 无效,无法进行框选检测"),n;const i=(A==null?void 0:A.left)||0,s=(A==null?void 0:A.top)||0,a=this.getNormalizedRect(e),o=a.x,l=a.y,u=o+a.width,f=l+a.height;for(const h of t)for(const c of h.objects){let g,p,y,w;if(c.type==="line"){const x=c,E=x.x1??c.x,Q=x.y1??c.y,L=x.x2??c.x+c.width,S=x.y2??c.y;g=i+Math.min(E,L),p=s+Math.min(Q,S),y=i+Math.max(E,L),w=s+Math.max(Q,S);const T=x.strokeWidth||2,_=Math.max(T*3,12),D=Math.abs(S-Q)<2,U=Math.abs(L-E)<2;D?(p-=_,w+=_,g-=_/2,y+=_/2):U?(g-=_,y+=_,p-=_/2,w+=_/2):(g-=_,p-=_,y+=_,w+=_)}else g=i+c.x,p=s+c.y,y=i+c.x+c.width+6,w=s+c.y+c.height+6;!(y<o||g>u||w<l||p>f)&&n.push({object:c,bandId:h.id,originalX:c.x,originalY:c.y})}return n}}const Fw=({bands:r,state:e,designerOptions:t,PAGE_WIDTH:A,PAGE_HEIGHT:n,PAGE_MARGINS:i,onSelectBand:s,onSelectObject:a,onUpdateObjectPosition:o,onUpdateObject:l,onMoveMultipleObjects:u,onResizeMultipleObjects:f,onPasteObjects:h,onBoundaryMouseDown:c,selectedObjectIds:g,focusedObjectId:p,onClearSelection:y,onMultiSelect:w,onClickPosition:B,onDeleteObjects:x,onUndo:E,onRedo:Q,canUndo:L=!1,canRedo:S=!1,onCopy:T,onPaste:_,canPaste:D=!1,onUpdateObjects:U,dataFields:O=[]})=>{const M=ce.useRef(null),[C]=ce.useState(()=>new KU),[z,re]=ce.useState(null),[ne,Z]=ce.useState(!1),[Ae,V]=ce.useState({visible:!1,x:0,y:0}),k=ce.useCallback(()=>{V({visible:!1,x:0,y:0})},[]),I=ce.useCallback(R=>{R.preventDefault(),R.stopPropagation(),V({visible:!0,x:R.clientX,y:R.clientY})},[]),P=ce.useRef(!1),K=ce.useRef(null),Y=R=>{if(!M.current)return{x:0,y:0};const Ue=M.current.getBoundingClientRect(),Re=e.zoomLevel||1,Ee=(R.clientX-Ue.left)/Re,Ve=(R.clientY-Ue.top)/Re;return{x:Ee,y:Ve}},J=R=>{if(R.target.closest(".boundary-line")||R.target.closest(".design-object")||R.target.closest(".react-draggable")||R.target.closest(".react-rnd"))return;const{x:Ie,y:Ue}=Y(R.nativeEvent),Re=R.shiftKey,Ee=R.ctrlKey||R.metaKey;Z(!0);const Ve=Ie,Me=Ue;K.current={x:Ve,y:Me},re({x:Ve,y:Me,width:0,height:0}),r&&Array.isArray(r)&&C.handleMouseDown(Ve,Me,Re,Ee,r,Ye=>{})},q=R=>{if(!ne||!M.current||!K.current)return;const{x:Ie,y:Ue}=Y(R.nativeEvent),Re=Ie,Ee=Ue,Ve=K.current.x,Me=K.current.y,ze={x:Ve,y:Me,width:Re-Ve,height:Ee-Me};re(ze),r&&Array.isArray(r)&&C.handleMouseMove(Re,Ee,R.shiftKey,R.ctrlKey||R.metaKey,r,i,Ye=>{w&&w(Ye)})},W=ce.useCallback(R=>{if(!ne)return;Z(!1),K.current=null;const Ie=z&&(Math.abs(z.width)>3||Math.abs(z.height)>3);P.current=Ie||!1;const Ue=C.handleMouseUp((R==null?void 0:R.shiftKey)||!1,(R==null?void 0:R.ctrlKey)||(R==null?void 0:R.metaKey)||!1,void 0);if(re(null),Ue.length>0){const Re=Ue.map(({object:Ee,bandId:Ve})=>`${Ve}-${Ee.id}`);Re.length>0&&w&&w(Re)}re(null)},[ne,z,C,w]),te=(R,Ie,Ue)=>{if(Ue.stopPropagation(),Ue.button===2){const Me=`${Ie}-${R}`;if(g!=null&&g.includes(Me))return}const Re=Ue.shiftKey||Ue.ctrlKey||Ue.metaKey,Ee=r.find(Me=>Me.id===Ie),Ve=Ee==null?void 0:Ee.objects.find(Me=>Me.id===R);Ve&&Ee&&(s(Ie,Ue),B&&B(Ve.x,Ve.y-Ee.top,Ie),a(R,Ie,Re))},oe=R=>{if(ne)return;if(P.current){P.current=!1;return}const Ue=R.currentTarget.getBoundingClientRect(),Re=e.zoomLevel||1,Ee=(R.clientX-Ue.left)/Re,Ve=(R.clientY-Ue.top)/Re,Me=Ee-i.left,ze=Ve-i.top,Ye=R.target.closest(".boundary-line");if(Ye){const Oe=Ye.getAttribute("data-band-id");if(Oe&&(s(Oe,R),B)){const je=r.find(ge=>ge.id===Oe);je&&B(Me,ze-je.top,Oe)}return}if(R.target.closest(".design-object")||R.target.closest(".react-draggable")||R.target.closest(".react-rnd"))return;if(Me<0||Me>A-i.left-i.right||ze<0||ze>n-i.top-i.bottom){!R.shiftKey&&!R.ctrlKey&&!R.metaKey&&(C.clearSelection(),y&&y());return}let xe=null;for(const Oe of r){const je=Oe.top,ge=Oe.actualBottom;if(ze>=je&&ze<=ge){xe=Oe;break}}xe?(!R.shiftKey&&!R.ctrlKey&&!R.metaKey&&(C.clearSelection(),y&&y()),s(xe.id,R),B&&B(Me,ze-xe.top,xe.id)):!R.shiftKey&&!R.ctrlKey&&!R.metaKey&&(C.clearSelection(),y&&y())};ce.useEffect(()=>{const R=Ie=>{ne&&W(Ie)};return window.addEventListener("mouseup",R),()=>{window.removeEventListener("mouseup",R)}},[W,ne]);const we=ce.useRef(g||[]);ce.useEffect(()=>{we.current=g||[]},[g]),ce.useEffect(()=>{if(ne)return;const R=we.current;R&&R.length>0&&(C.clearSelection(),R.forEach(Ie=>{const[Ue,Re]=Ie.split("-"),Ee=r.find(Me=>Me.id===Ue),Ve=Ee==null?void 0:Ee.objects.find(Me=>Me.id===Re);Ve&&Ee&&C.selectObject(Ve,Ue,!0)}))},[g,r,C,ne]);const le=()=>{if(!ne||!z)return null;const R={x:z.width>=0?z.x:z.x+z.width,y:z.height>=0?z.y:z.y+z.height,width:Math.abs(z.width),height:Math.abs(z.height)};return R.width<2||R.height<2?null:v.jsx("div",{className:"selection-rect",style:{position:"absolute",left:`${R.x}px`,top:`${R.y}px`,width:`${R.width}px`,height:`${R.height}px`,backgroundColor:"rgba(77, 144, 254, 0.1)",border:"1px solid #4d90fe",pointerEvents:"none",zIndex:2e3,boxShadow:"0 0 0 1px rgba(77, 144, 254, 0.3)"}})},Be=()=>r.map(R=>{const Ie=Math.max(0,R.actualBottom-R.top),Ue=e.draggingBoundary===R.id,Re=R.top+Ie;return v.jsx("div",{className:`boundary-line ${Ue?"dragging":""}`,"data-band-id":R.id,style:{position:"absolute",top:`${Re}px`,left:0,right:0,height:"20px",cursor:"ns-resize",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:Ue?"#666":"#f3f3f3",border:"1px solid #aeadad"},onMouseDown:Ee=>c(R.id,Ee),title:`拖动调整${R.name}高度 (当前: ${Ie.toFixed(1)}px)`,children:v.jsxs("div",{className:"boundary-label",style:{position:"absolute",top:"50%",left:"0%",transform:"translate(0, -50%)",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",color:"#c3c3c3",whiteSpace:"nowrap",background:"transparent"},children:["↑",R.name]})},`boundary-${R.id}`)});ce.useEffect(()=>{const R=Ue=>{const Re=e.selectedBand?r.find(Ee=>Ee.id===e.selectedBand):null;C.handleKeyDown(Ue,u,f,Ee=>{h&&h(Ee.map(Ve=>({object:Ve.object,bandId:Ve.bandId})))},Re?{id:Re.id,top:Re.top,actualBottom:Re.actualBottom}:null)},Ie=Ue=>{C.handleKeyUp(Ue)};return window.addEventListener("keydown",R),window.addEventListener("keyup",Ie),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",Ie)}},[u,f,h,C,e.selectedBand,r]);const ye=()=>r.flatMap(R=>Ew(R,{isPreview:!1,selectedObjectId:"",includeClipPath:!0,dataFields:O}).filter(({obj:Ue})=>{if(Ue.type==="image"&&Ue.floating===!0)return!0;if(Ue.type==="line"){const Re=Ue,Ee=Math.min(Re.y1||Ue.y,Re.y2||Ue.y);return Math.max(Re.y1||Ue.y,Re.y2||Ue.y)>=R.top&&Ee<R.actualBottom}return Ue.y>=R.top&&Ue.y<R.actualBottom}).map(({obj:Ue,renderData:Re,isSelected:Ee})=>{const Ve=`${R.id}-${Ue.id}`,ze=(g==null?void 0:g.includes(Ve))||!1,Ye=p===Ve;if(Ue.type==="line"){const Oe=Ue;return v.jsx(OU,{object:{id:Ue.id,type:"line",x1:Oe.x1??Ue.x,y1:Oe.y1??Ue.y,x2:Oe.x2??Ue.x+Ue.width,y2:Oe.y2??Ue.y,color:Oe.color,strokeWidth:Oe.strokeWidth,lineStyle:Oe.lineStyle,zIndex:Ue.zIndex},band:R,isSelected:ze,isFocused:Ye,selectedObjectIds:g,onSelect:je=>te(Ue.id,R.id,je),onUpdate:(je,ge,Pe)=>{l(je,R.id,ge,Pe)},onDragMultiple:(je,ge,Pe)=>{const Te=(g==null?void 0:g.map(ue=>{const[fe,Le]=ue.split("-");return{objectId:Le,bandId:fe,deltaX:je,deltaY:ge}}))||[];Te.length>0&&u(Te,Pe)}},Ue.id)}const xe=["text","multiline_text","field","calculated","page_number","current_date"].includes(Ue.type);return v.jsx(NU,{object:Ue,band:R,style:jh(Ue,Re.style,xe),content:Re.content,wrappedContent:Re.wrappedContent,isSelected:ze,isFocused:Ye,selectedObjectIds:g,onSelect:Oe=>te(Ue.id,R.id,Oe),onUpdatePosition:o,onUpdate:(Oe,je)=>{l(Oe,R.id,je)},onDragMultiple:(Oe,je,ge)=>{const Pe=(g==null?void 0:g.map(Te=>{const[ue,fe]=Te.split("-");return{objectId:fe,bandId:ue,deltaX:Oe,deltaY:je}}))||[];Pe.length>0&&u(Pe,ge)},minWidth:20,minHeight:20},Ue.id)})).filter(Boolean);return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"canvas-wrapper",children:v.jsxs("div",{ref:M,className:"canvas-container",style:{marginTop:`${i.top}px`,marginBottom:`${i.bottom}px`,width:`${A}px`,minHeight:`${n}px`,position:"relative",cursor:ne?"crosshair":"default"},onClick:oe,onMouseDown:J,onMouseMove:q,onMouseUp:W,onContextMenu:I,children:[le(),e.showRulers&&v.jsxs(v.Fragment,{children:[v.jsx(XS,{width:A,marginLeft:i.left,zoomLevel:e.zoomLevel}),v.jsx(YS,{height:n,marginTop:i.top,zoomLevel:e.zoomLevel})]}),e.showPageMargins&&v.jsx($S,{width:A,height:n,margins:i,zoomLevel:e.zoomLevel}),e.showGrid&&(()=>{const R=A-i.left-i.right,Ie=n-i.top-i.bottom,Ue=t.gridSize||10,Re=Math.round(R/Ue),Ee=Math.round(Ie/Ue),Ve=R/Re,Me=Ie/Ee;return v.jsx("div",{className:"grid-layer",style:{position:"absolute",top:`${i.top}px`,left:`${i.left}px`,width:`${R}px`,height:`${Ie}px`,backgroundSize:`${Ve}px ${Me}px`,backgroundImage:`
|
|
64
|
+
`;return typeof a=="function"&&a(null,y),y},Ph}var pw;function IU(){if(pw)return cs;pw=1;const r=uU(),e=SU(),t=UU(),A=_U();function n(i,s,a,o,l){const u=[].slice.call(arguments,1),f=u.length,h=typeof u[f-1]=="function";if(!h&&!r())throw new Error("Callback required as last argument");if(h){if(f<2)throw new Error("Too few arguments provided");f===2?(l=a,a=s,s=o=void 0):f===3&&(s.getContext&&typeof l>"u"?(l=o,o=void 0):(l=o,o=a,a=s,s=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(a=s,s=o=void 0):f===2&&!s.getContext&&(o=a,a=s,s=void 0),new Promise(function(c,g){try{const p=e.create(a,o);c(i(p,s,o))}catch(p){g(p)}})}try{const c=e.create(a,o);l(null,i(c,s,o))}catch(c){l(c)}}return cs.create=e.create,cs.toCanvas=n.bind(null,t.render),cs.toDataURL=n.bind(null,t.renderToDataURL),cs.toString=n.bind(null,function(i,s,a){return A.render(i,a)}),cs}var QU=IU();const Rh=Ys(QU),Mh=({value:r,type:e="CODE128",width:t,height:A,showText:n=!0,background:i="#FFFFFF",lineColor:s="#000000"})=>{const a=ce.useRef(null);return ce.useEffect(()=>{if(a.current&&r)try{for(;a.current.firstChild;)a.current.removeChild(a.current.firstChild);M2(a.current,r,{format:e,width:2,height:A?n?Math.max(A-20,20):A:40,displayValue:n,background:i,lineColor:s,margin:2,fontSize:12,textMargin:2})}catch(o){console.error("条码生成失败:",o)}},[r,e,A,n,i,s]),r?v.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:i,overflow:"hidden"},children:v.jsx("svg",{ref:a,preserveAspectRatio:"none",style:{width:"100%",height:"100%",pointerEvents:"none"}},`${e}-${r}-${n}`)}):v.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:i,color:"#999",fontSize:"12px"},children:"[条码]"})},Dh=({value:r,width:e,height:t,errorLevel:A="M",background:n="#FFFFFF",foreground:i="#000000"})=>{const s=ce.useRef(null);return ce.useEffect(()=>{if(s.current&&r){const a=Math.min(e||100,t||100);Rh.toCanvas(s.current,r,{width:a,margin:1,errorCorrectionLevel:A,color:{dark:i,light:n}}).catch(o=>{console.error("二维码生成失败:",o)})}},[r,e,t,A,n,i]),r?v.jsx("canvas",{ref:s,style:{width:"100%",height:"100%",pointerEvents:"none"}},`${r}-${A}`):v.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:n,color:"#999",fontSize:"12px"},children:"[二维码]"})},NU=({object:r,band:e,style:t,content:A,wrappedContent:n,isSelected:i,isFocused:s=!1,selectedObjectIds:a=[],onSelect:o,onUpdatePosition:l,onUpdateSize:u,onUpdate:f,onDragMultiple:h,minWidth:c=20,minHeight:g=20})=>{const p=ce.useRef(null),y=ce.useRef(!1),[w,B]=ce.useState(null),x=ce.useRef(null),E=ce.useRef(null),L=(J=>{if(!J||J==="none")return 0;const q=J.match(/(\d+)px/);return q?parseInt(q[1]):0})(t.border),S=r.type==="line",T=r.type==="image"&&r.floating,D=S||T?0:L+0,U=()=>S?{minW:20,minH:1}:{minW:c,minH:g},{minW:O,minH:M}=U(),C=ce.useCallback((J,q)=>{const W=E.current,te=W&&(Math.abs(q.x-W.x)>1||Math.abs(q.y-W.y)>1);te&&(y.current=!0,setTimeout(()=>{y.current=!1},0)),a.length>=1&&i&&h&&te&&h(0,0,!1),p.current=null,x.current=null,E.current=null,!(a.length>=1&&i)&&te&&l(r.id,q.x,q.y)},[r.id,l,a.length,i,h]),z=ce.useCallback((J,q)=>{p.current={x:q.x,y:q.y},E.current={x:q.x,y:q.y},x.current=null},[]),re=ce.useCallback((J,q)=>{if(a.length>=1&&i&&p.current&&h){let W=q.x-p.current.x,te=q.y-p.current.y;if(J.shiftKey&&E.current){const oe=q.x-E.current.x,we=q.y-E.current.y;x.current||(Math.abs(oe)>5||Math.abs(we)>5)&&(x.current=Math.abs(oe)>Math.abs(we)?"x":"y"),x.current==="x"?te=0:x.current==="y"&&(W=0)}else x.current=null;(W!==0||te!==0)&&(h(W,te,!0),p.current={x:q.x,y:q.y})}},[a.length,i,h]),ne=ce.useCallback((J,q,W,te,oe)=>{B(null);const we=parseInt(W.style.width),le=parseInt(W.style.height);let Be=we-D*2,ye=le-D*2;if(r.type==="qrcode"){const R=Math.max(Be,ye);Be=R,ye=R}f?f(r.id,{x:oe.x,y:oe.y,width:Be,height:ye}):(l(r.id,oe.x,oe.y),u&&u(r.id,Be,ye))},[r.id,r.type,f,l,u,D]),Z=ce.useCallback((J,q,W)=>{const te=parseInt(W.style.width),oe=parseInt(W.style.height);B({width:te,height:oe})},[]),Ae=r.width+D*2,V=r.height+D*2,k=(w==null?void 0:w.width)??Ae,I=(w==null?void 0:w.height)??V,P={fontSize:t.fontSize,color:t.color,backgroundColor:t.backgroundColor,fontWeight:t.fontWeight,fontStyle:t.fontStyle,textAlign:t.textAlign,lineHeight:t.lineHeight,padding:t.padding,border:t.border,borderRadius:t.borderRadius,clipPath:t.clipPath,display:t.display||"block",alignItems:t.alignItems,justifyContent:t.justifyContent,width:"100%",height:"100%",overflow:t.overflow||"hidden",boxSizing:"border-box",whiteSpace:t.whiteSpace,textOverflow:t.textOverflow,verticalAlign:t.verticalAlign,flexDirection:t.flexDirection,flexWrap:t.flexWrap},K=O+D*2,Y=M+D*2;return v.jsxs(C3,{size:{width:Ae,height:V},position:{x:r.x,y:r.y},onDragStart:z,onDrag:re,onDragStop:C,onResize:Z,onResizeStop:ne,minWidth:K,minHeight:Y,lockAspectRatio:r.type==="qrcode",bounds:"parent",disableDragging:!i,enableResizing:i&&!s?{bottom:!0,bottomLeft:!0,bottomRight:!0,left:!0,right:!0,top:!0,topLeft:!0,topRight:!0}:!1,resizeHandleStyles:{bottom:{opacity:0,cursor:"ns-resize"},bottomLeft:{opacity:0,cursor:"nesw-resize"},bottomRight:{opacity:0,cursor:"nwse-resize"},left:{opacity:0,cursor:"ew-resize"},right:{opacity:0,cursor:"ew-resize"},top:{opacity:0,cursor:"ns-resize"},topLeft:{opacity:0,cursor:"nwse-resize"},topRight:{opacity:0,cursor:"nesw-resize"}},onClick:J=>{J.stopPropagation(),!y.current&&o(J)},onMouseDown:J=>{J.button===2&&(J.stopPropagation(),o(J))},style:{position:"absolute",zIndex:r.type==="image"&&r.floating?i?10:1:i?1e3+(r.zIndex??100):r.zIndex??100,outline:i||s?"1px dashed #4d90fe":"1px dashed rgb(221, 221, 221)",boxSizing:"border-box",margin:0,padding:0,backgroundColor:i?"rgba(77, 144, 254, 0.05)":s?"rgba(82, 196, 26, 0.03)":"transparent"},children:[i&&!s&&v.jsxs("svg",{style:{position:"absolute",top:-5,left:-5,width:k+10,height:I+10,pointerEvents:"none",overflow:"visible",zIndex:1},children:[v.jsx("circle",{cx:5,cy:5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:k+5,cy:5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:5,cy:I+5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:k+5,cy:I+5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:k/2+5,cy:5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:k/2+5,cy:I+5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:5,cy:I/2+5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"}),v.jsx("circle",{cx:k+5,cy:I/2+5,r:3,fill:"white",stroke:"#4d90fe",strokeWidth:.5,strokeDasharray:"2 1"})]}),v.jsx("div",{className:`design-object ${r.type} `,style:P,"data-object-id":`${e.id}-${r.id}`,children:r.type==="image"?r.src||r.imageUrl?r.objectFit==="repeat"?v.jsx("div",{style:{width:"100%",height:"100%",backgroundImage:`url(${r.src||r.imageUrl})`,backgroundRepeat:"repeat",backgroundSize:"auto",pointerEvents:"none"}}):v.jsx("img",{src:r.src||r.imageUrl,alt:r.alt||"图片",draggable:!1,style:{width:"100%",height:"100%",objectFit:r.objectFit||"contain",pointerEvents:"none"}}):v.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"[图片]"}):r.type==="barcode"?v.jsx(Mh,{value:r.text||"",type:r.barcodeType||"CODE128",width:r.width,height:r.height,showText:r.showText!==!1,background:r.background||"#FFFFFF",lineColor:r.lineColor||"#000000"}):r.type==="qrcode"?v.jsx(Dh,{value:r.text||"",width:r.width,height:r.height,errorLevel:r.errorLevel||"M",background:r.background||"#FFFFFF",foreground:r.foreground||"#000000"}):n||A})]})},OU=({object:r,band:e,isSelected:t,isFocused:A=!1,selectedObjectIds:n,onSelect:i,onUpdate:s,onDragMultiple:a})=>{const o=ce.useRef("none"),l=ce.useRef(null),u=ce.useRef(null),f=ce.useRef(!1),h=ce.useRef(null),c=ce.useRef(null),g=ce.useRef(null),p=ce.useRef(s);p.current=s;const y=ce.useRef(r);y.current=r;const w=e.top,B=e.actualBottom;let x=r.x1,E=r.y1,Q=r.x2,L=r.y2,S=!0;const T=Math.min(r.y1,r.y2),_=Math.max(r.y1,r.y2);if(!t)if(_<=w||T>=B)S=!1;else if(r.y1!==r.y2){const ue=r.x2-r.x1,fe=r.y2-r.y1;r.y1<w?(x=r.x1+ue*(w-r.y1)/fe,E=w):r.y1>B&&(x=r.x1+ue*(B-r.y1)/fe,E=B),r.y2<w?(Q=r.x2+ue*(w-r.y2)/fe,L=w):r.y2>B&&(Q=r.x2+ue*(B-r.y2)/fe,L=B)}else(r.y1<w||r.y1>B)&&(S=!1);const D=x,U=E,O=Q,M=L;let C,z,re,ne;h.current?(C=h.current.left,z=h.current.top,re=h.current.right,ne=h.current.bottom):(C=Math.min(r.x1,r.x2),z=Math.min(r.y1,r.y2),re=Math.max(r.x1,r.x2),ne=Math.max(r.y1,r.y2));const Z=re-C||1,Ae=ne-z||1,V=3,k=.5,I=r.color||"#000000",P=r.strokeWidth||1,K=r.lineStyle||"solid",Y=()=>K==="dashed"?`${P*4} ${P*2}`:K==="dotted"?`${P} ${P*2}`:"none",J=ue=>{if(ue.stopPropagation(),f.current){f.current=!1;return}i(ue)},q=ue=>{if(ue.button===2){ue.stopPropagation(),i(ue);return}t&&(ue.stopPropagation(),o.current="line",l.current={x:ue.clientX,y:ue.clientY,x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},u.current={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},c.current={x:ue.clientX,y:ue.clientY},g.current=null,document.addEventListener("mousemove",oe),document.addEventListener("mouseup",we))},W=ue=>{ue.stopPropagation(),o.current="start",l.current={x:ue.clientX,y:ue.clientY,x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},u.current={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},c.current={x:ue.clientX,y:ue.clientY},h.current={left:Math.min(r.x1,r.x2),top:Math.min(r.y1,r.y2),right:Math.max(r.x1,r.x2),bottom:Math.max(r.y1,r.y2)},document.addEventListener("mousemove",oe),document.addEventListener("mouseup",we)},te=ue=>{ue.stopPropagation(),o.current="end",l.current={x:ue.clientX,y:ue.clientY,x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},u.current={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},c.current={x:ue.clientX,y:ue.clientY},h.current={left:Math.min(r.x1,r.x2),top:Math.min(r.y1,r.y2),right:Math.max(r.x1,r.x2),bottom:Math.max(r.y1,r.y2)},document.addEventListener("mousemove",oe),document.addEventListener("mouseup",we)},oe=ue=>{const fe=o.current;if(!l.current||fe==="none")return;const Pe=ue.clientX-c.current.x,Fe=ue.clientY-c.current.y;let Ne=Pe,ve=Fe;if(ue.shiftKey&&(fe==="start"||fe==="end")&&u.current){const Qe=u.current,De=Math.abs(Qe.y1-Qe.y2)<5,it=Math.abs(Qe.x1-Qe.x2)<5;if(De)ve=0;else if(it)Ne=0;else{let et,Ge;fe==="start"?(et=Qe.x1-Qe.x2,Ge=Qe.y1-Qe.y2):(et=Qe.x2-Qe.x1,Ge=Qe.y2-Qe.y1);const At=Math.sqrt(et*et+Ge*Ge);if(At>0){const nt=et/At,tt=Ge/At,lt=Pe*nt+Fe*tt;Ne=lt*nt,ve=lt*tt}}}if(fe==="line"){const Qe=`${e.id}-${r.id}`;if((n==null?void 0:n.includes(Qe))&&n&&n.length>=1&&a){let et=ue.clientX-l.current.x,Ge=ue.clientY-l.current.y;if(ue.shiftKey&&c.current){const At=ue.clientX-c.current.x,nt=ue.clientY-c.current.y;g.current||(Math.abs(At)>5||Math.abs(nt)>5)&&(g.current=Math.abs(At)>Math.abs(nt)?"x":"y"),g.current==="x"?Ge=0:g.current==="y"&&(et=0)}else g.current=null;l.current.x=ue.clientX,l.current.y=ue.clientY,(et!==0||Ge!==0)&&a(et,Ge,!0)}else{const et=u.current;p.current(y.current.id,{x1:et.x1+Pe,y1:et.y1+Fe,x2:et.x2+Pe,y2:et.y2+Fe},!0)}}else if(fe==="start"){const Qe=u.current,De=Qe.x1+Ne,it=Qe.y1+ve;p.current(y.current.id,{x1:De,y1:it,x2:Qe.x2,y2:Qe.y2},!0)}else if(fe==="end"){const Qe=u.current,De=Qe.x2+Ne,it=Qe.y2+ve;console.log("鼠标拖动终点:",{before:{x1:Qe.x1,y1:Qe.y1,x2:Qe.x2,y2:Qe.y2},delta:{deltaX:Ne,deltaY:ve},after:{x1:Qe.x1,y1:Qe.y1,x2:De,y2:it}}),p.current(y.current.id,{x1:Qe.x1,y1:Qe.y1,x2:De,y2:it},!0)}},we=ue=>{const fe=o.current,Pe=`${e.id}-${r.id}`,Ne=(n==null?void 0:n.includes(Pe))&&n&&n.length>=1;if(fe!=="none"&&u.current){const ve=u.current,Qe=y.current;(ve.x1!==Qe.x1||ve.y1!==Qe.y1||ve.x2!==Qe.x2||ve.y2!==Qe.y2)&&(fe==="line"&&Ne&&a?a(0,0,!1):p.current(Qe.id,{x1:Qe.x1,y1:Qe.y1,x2:Qe.x2,y2:Qe.y2},!1),f.current=!0,ue.stopPropagation(),ue.preventDefault())}o.current="none",l.current=null,u.current=null,c.current=null,g.current=null,h.current=null,document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",we)},le=V+k,Be=Z+le*2,ye=Ae+le*2,R=D-C+le,Ie=U-z+le,Ue=O-C+le,Te=M-z+le,Ee=r.x1-C+le,Ve=r.y1-z+le,Me=r.x2-C+le,ze=r.y2-z+le;let Ye=Ee,xe=Ve,Oe=Me,je=ze;const ge=Me-Ee,Re=ze-Ve,Le=Math.sqrt(ge*ge+Re*Re);if(Le>0){const ue=ge/Le,fe=Re/Le;Ye=Ee-ue*V,xe=Ve-fe*V,Oe=Me+ue*V,je=ze+fe*V}return S?v.jsxs("svg",{className:"design-object design-line",width:Be,height:ye,style:{overflow:"visible",pointerEvents:"none",position:"absolute",left:C-le,top:z-le,width:Be,height:ye,zIndex:t?1e3+(r.zIndex??1):r.zIndex??1,outline:"none",border:"none"},children:[v.jsx("line",{x1:R,y1:Ie,x2:Ue,y2:Te,stroke:"transparent",strokeWidth:Math.max(P+10,15),style:{cursor:t?"move":"pointer",pointerEvents:"auto"},onClick:J,onMouseDown:q}),v.jsx("line",{x1:R,y1:Ie,x2:Ue,y2:Te,stroke:t?"#4d90fe":A?"#52c41a":I,strokeWidth:A?P+1:P,strokeDasharray:t?"4 3":A?"6 3":Y(),strokeLinecap:"round",style:{pointerEvents:"none"}}),t&&!A&&v.jsxs(v.Fragment,{children:[v.jsx("circle",{cx:Ye,cy:xe,r:V,fill:"transparent",stroke:"#4d90fe",strokeWidth:k,strokeDasharray:"2 1",style:{cursor:"crosshair",pointerEvents:"auto"},onMouseDown:W}),v.jsx("circle",{cx:Oe,cy:je,r:V,fill:"transparent",stroke:"#4d90fe",strokeWidth:k,strokeDasharray:"2 1",style:{cursor:"crosshair",pointerEvents:"auto"},onMouseDown:te})]})]}):null},si=r=>{const e=r,t=2;if(r.type==="line"){const i=r,s=i.x1??r.x,a=i.y1??r.y,o=i.x2??r.x+r.width,l=i.y2??r.y,u=Math.min(s,o),f=Math.min(a,l),h=Math.max(s,o),c=Math.max(a,l);return{x:u,y:f,width:h-u||1,height:c-f||1,extra:0}}let A=0;e.border&&e.border.style!=="none"&&e.border.width?A=e.border.width:e.border||(r.type==="field"||r.type==="rectangle")&&(A=1);const n=A+t;return{x:r.x,y:r.y,width:r.width+n*2,height:r.height+n*2,extra:n}},TU=({visible:r,x:e,y:t,selectedObjectIds:A,bands:n,onClose:i,onUpdateObjects:s,onDeleteObjects:a,onClearSelection:o,onUndo:l,onRedo:u,canUndo:f,canRedo:h,onCopy:c,onPaste:g,canPaste:p=!1,pageWidth:y,pageMargins:w})=>{const B=ce.useRef(null),[x,E]=ce.useState({x:e,y:t});ce.useEffect(()=>{if(r&&B.current){const k=B.current.getBoundingClientRect(),I=window.innerWidth,P=window.innerHeight;let K=e,Y=t;e+k.width>I&&(K=I-k.width-8),t+k.height>P&&(Y=P-k.height-8),K=Math.max(8,K),Y=Math.max(8,Y),E({x:K,y:Y})}},[r,e,t]);const Q=ce.useMemo(()=>{const V=[];return A.forEach(k=>{const[I,P]=k.split("-"),K=n.find(J=>J.id===I),Y=K==null?void 0:K.objects.find(J=>J.id===P);Y&&K&&V.push({object:Y,bandId:I})}),V},[A,n]),L=A.length>=1,S=A.length>=2,T=A.length>=3;ce.useEffect(()=>{const V=k=>{B.current&&!B.current.contains(k.target)&&i()};return r&&(document.addEventListener("mousedown",V),document.addEventListener("contextmenu",V)),()=>{document.removeEventListener("mousedown",V),document.removeEventListener("contextmenu",V)}},[r,i]),ce.useEffect(()=>{const V=k=>{k.key==="Escape"&&i()};return r&&document.addEventListener("keydown",V),()=>{document.removeEventListener("keydown",V)}},[r,i]);const _=ce.useCallback(V=>{if(Q.length<2)return;const k=Q[0].object,I=si(k),P=[];Q.slice(1).forEach(({object:K,bandId:Y})=>{const J=si(K),q={};if(K.type==="line"){const W=K,te=W.x1??K.x,oe=W.y1??K.y,we=W.x2??K.x+K.width,le=W.y2??K.y;let Be=0,ye=0;switch(V){case"left":Be=I.x-J.x;break;case"right":Be=I.x+I.width-(J.x+J.width);break;case"top":ye=I.y-J.y;break;case"bottom":ye=I.y+I.height-(J.y+J.height);break;case"horizontal-center":Be=I.x+I.width/2-(J.x+J.width/2);break;case"vertical-center":ye=I.y+I.height/2-(J.y+J.height/2);break}q.x1=te+Be,q.y1=oe+ye,q.x2=we+Be,q.y2=le+ye,q.x=K.x+Be,q.y=K.y+ye}else switch(V){case"left":q.x=I.x;break;case"right":q.x=I.x+I.width-J.width;break;case"top":q.y=I.y;break;case"bottom":q.y=I.y+I.height-J.height;break;case"horizontal-center":q.x=I.x+(I.width-J.width)/2;break;case"vertical-center":q.y=I.y+(I.height-J.height)/2;break}P.push({bandId:Y,objectId:K.id,changes:q})}),s(P),i()},[Q,s,i]),D=ce.useCallback(V=>{if(Q.length<3)return;const k=[...Q].sort((oe,we)=>V==="horizontal"?oe.object.x-we.object.x:oe.object.y-we.object.y),I=k[0].object,P=k[k.length-1].object,K=si(P);let Y,J=0;V==="horizontal"?(Y=P.x+K.width-I.x,k.forEach(({object:oe})=>{J+=si(oe).width})):(Y=P.y+K.height-I.y,k.forEach(({object:oe})=>{J+=si(oe).height}));const q=(Y-J)/(k.length-1),W=[];let te=V==="horizontal"?I.x:I.y;k.forEach(({object:oe,bandId:we},le)=>{const Be=si(oe);if(le===0){te+=V==="horizontal"?Be.width:Be.height;return}const ye={};V==="horizontal"?(ye.x=te+q,te=ye.x+Be.width):(ye.y=te+q,te=ye.y+Be.height),W.push({bandId:we,objectId:oe.id,changes:ye})}),s(W),i()},[Q,s,i]),U=ce.useCallback(V=>{if(Q.length<2)return;const k=Q[0].object,I=si(k),P=[],K=k.type==="line";let Y=0;if(K){const J=k,q=J.x1??k.x,W=J.y1??k.y,te=J.x2??k.x+k.width,oe=J.y2??k.y;q===te?Y=Math.abs(oe-W):W===oe?Y=Math.abs(te-q):Y=Math.sqrt(Math.pow(te-q,2)+Math.pow(oe-W,2))}Q.slice(1).forEach(({object:J,bandId:q})=>{const W={};if(J.type==="line"){const oe=J,we=oe.x1??J.x,le=oe.y1??J.y,Be=oe.x2??J.x+J.width,ye=oe.y2??J.y,R=we===Be,Ie=le===ye;if(K){if(R&&(V==="height"||V==="both")){const Ue=Math.abs(ye-le),Te=Y-Ue;ye>=le?W.y2=ye+Te:W.y2=ye-Te}else if(Ie&&(V==="width"||V==="both")){const Ue=Math.abs(Be-we),Te=Y-Ue;Be>=we?W.x2=Be+Te:W.x2=Be-Te}}else if(R&&(V==="height"||V==="both")){const Ue=I.height-Math.abs(ye-le);ye>=le?W.y2=ye+Ue:W.y2=ye-Ue}else if(Ie&&(V==="width"||V==="both")){const Ue=I.width-Math.abs(Be-we);Be>=we?W.x2=Be+Ue:W.x2=Be-Ue}Object.keys(W).length>0&&P.push({bandId:q,objectId:J.id,changes:W});return}const te=si(J);(V==="width"||V==="both")&&(W.width=I.width-te.extra*2),(V==="height"||V==="both")&&(W.height=I.height-te.extra*2),P.push({bandId:q,objectId:J.id,changes:W})}),P.length>0&&s(P),i()},[Q,s,i]),O=1,M=ce.useCallback(()=>{if(Q.length===0)return;const V=[];Q.forEach(({object:k,bandId:I})=>{const P=k.zIndex??O;V.push({bandId:I,objectId:k.id,changes:{zIndex:P+1}})}),s(V),i()},[Q,s,i]),C=ce.useCallback(()=>{if(Q.length===0)return;const V=[];Q.forEach(({object:k,bandId:I})=>{const P=k.zIndex??O;V.push({bandId:I,objectId:k.id,changes:{zIndex:Math.max(O,P-1)}})}),s(V),i()},[Q,s,i]),z=ce.useCallback(()=>{if(Q.length===0)return;let V=0;Q.forEach(({bandId:I})=>{const P=n.find(K=>K.id===I);P&&P.objects.forEach(K=>{const Y=K.zIndex??0;Y>V&&(V=Y)})});const k=[];Q.forEach(({object:I,bandId:P},K)=>{k.push({bandId:P,objectId:I.id,changes:{zIndex:V+1+K}})}),s(k),i()},[Q,n,s,i]),re=ce.useCallback(()=>{if(Q.length===0)return;const V=[];Q.forEach(({object:k,bandId:I})=>{V.push({bandId:I,objectId:k.id,changes:{zIndex:O}})}),s(V),i()},[Q,s,i]),ne=ce.useCallback(V=>{if(Q.length===0||!y||!w)return;const k=y-w.left-w.right;let I=1/0,P=-1/0;Q.forEach(({object:q})=>{const W=si(q),te=W.x,oe=W.x+W.width;te<I&&(I=te),oe>P&&(P=oe)});const K=P-I;let Y;switch(V){case"page-left":Y=0-I;break;case"page-center":Y=(k-K)/2-I;break;case"page-right":Y=k-P;break}const J=[];Q.forEach(({object:q,bandId:W})=>{const te={};if(q.type==="line"){const oe=q,we=oe.x1??q.x,le=oe.x2??q.x+q.width;te.x1=we+Y,te.x2=le+Y,te.x=q.x+Y}else te.x=q.x+Y;J.push({bandId:W,objectId:q.id,changes:te})}),s(J),i()},[Q,y,w,s,i]),Z=V=>{V(),i()};if(!r)return null;const Ae={position:"fixed",left:x.x,top:x.y,zIndex:1e4};return v.jsxs("div",{ref:B,className:"context-menu",style:Ae,children:[v.jsxs("div",{className:"context-menu-item",onClick:()=>Z(l),"data-disabled":!f,children:[v.jsx("span",{className:"menu-icon",children:"↩"}),v.jsx("span",{className:"menu-label",children:"撤销"}),v.jsx("span",{className:"menu-shortcut",children:"Ctrl+Z"})]}),v.jsxs("div",{className:"context-menu-item",onClick:()=>Z(u),"data-disabled":!h,children:[v.jsx("span",{className:"menu-icon",children:"↪"}),v.jsx("span",{className:"menu-label",children:"恢复"}),v.jsx("span",{className:"menu-shortcut",children:"Ctrl+Shift+Z"})]}),v.jsx("div",{className:"context-menu-divider"}),c&&v.jsxs("div",{className:"context-menu-item",onClick:()=>Z(c),"data-disabled":!L,children:[v.jsx("span",{className:"menu-icon",children:"📋"}),v.jsx("span",{className:"menu-label",children:"复制"}),v.jsx("span",{className:"menu-shortcut",children:"Ctrl+C"})]}),g&&v.jsxs("div",{className:"context-menu-item",onClick:()=>Z(g),"data-disabled":!p,children:[v.jsx("span",{className:"menu-icon",children:"📄"}),v.jsx("span",{className:"menu-label",children:"粘贴"}),v.jsx("span",{className:"menu-shortcut",children:"Ctrl+V"})]}),(c||g)&&v.jsx("div",{className:"context-menu-divider"}),v.jsxs("div",{className:"context-menu-item context-menu-submenu","data-disabled":!S,children:[v.jsx("span",{className:"menu-icon",children:"⬛"}),v.jsx("span",{className:"menu-label",children:"对齐"}),v.jsx("span",{className:"menu-arrow",children:"▸"}),v.jsxs("div",{className:"context-submenu",children:[v.jsx("div",{className:"context-menu-item",onClick:()=>_("left"),children:v.jsx("span",{className:"menu-label",children:"左对齐"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>_("horizontal-center"),children:v.jsx("span",{className:"menu-label",children:"水平居中"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>_("right"),children:v.jsx("span",{className:"menu-label",children:"右对齐"})}),v.jsx("div",{className:"context-menu-divider"}),v.jsx("div",{className:"context-menu-item",onClick:()=>_("top"),children:v.jsx("span",{className:"menu-label",children:"顶部对齐"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>_("vertical-center"),children:v.jsx("span",{className:"menu-label",children:"垂直居中"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>_("bottom"),children:v.jsx("span",{className:"menu-label",children:"底部对齐"})})]})]}),v.jsxs("div",{className:"context-menu-item context-menu-submenu","data-disabled":!T,children:[v.jsx("span",{className:"menu-icon",children:"⋮⋮"}),v.jsx("span",{className:"menu-label",children:"分布"}),v.jsx("span",{className:"menu-arrow",children:"▸"}),v.jsxs("div",{className:"context-submenu",children:[v.jsx("div",{className:"context-menu-item",onClick:()=>D("horizontal"),children:v.jsx("span",{className:"menu-label",children:"水平均匀分布"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>D("vertical"),children:v.jsx("span",{className:"menu-label",children:"垂直均匀分布"})})]})]}),v.jsxs("div",{className:"context-menu-item context-menu-submenu","data-disabled":!S,children:[v.jsx("span",{className:"menu-icon",children:"⬜"}),v.jsx("span",{className:"menu-label",children:"尺寸"}),v.jsx("span",{className:"menu-arrow",children:"▸"}),v.jsxs("div",{className:"context-submenu",children:[v.jsx("div",{className:"context-menu-item",onClick:()=>U("width"),children:v.jsx("span",{className:"menu-label",children:"相同宽度"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>U("height"),children:v.jsx("span",{className:"menu-label",children:"相同高度"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>U("both"),children:v.jsx("span",{className:"menu-label",children:"相同尺寸"})})]})]}),v.jsxs("div",{className:"context-menu-item context-menu-submenu","data-disabled":!L,children:[v.jsx("span",{className:"menu-icon",children:"◇"}),v.jsx("span",{className:"menu-label",children:"层级"}),v.jsx("span",{className:"menu-arrow",children:"▸"}),v.jsxs("div",{className:"context-submenu",children:[v.jsx("div",{className:"context-menu-item",onClick:z,children:v.jsx("span",{className:"menu-label",children:"置于顶层"})}),v.jsx("div",{className:"context-menu-item",onClick:M,children:v.jsx("span",{className:"menu-label",children:"上移一层"})}),v.jsx("div",{className:"context-menu-item",onClick:C,children:v.jsx("span",{className:"menu-label",children:"下移一层"})}),v.jsx("div",{className:"context-menu-item",onClick:re,children:v.jsx("span",{className:"menu-label",children:"置于底层"})})]})]}),v.jsxs("div",{className:"context-menu-item context-menu-submenu","data-disabled":!L||!y,children:[v.jsx("span",{className:"menu-icon",children:"↔"}),v.jsx("span",{className:"menu-label",children:"页面位置"}),v.jsx("span",{className:"menu-arrow",children:"▸"}),v.jsxs("div",{className:"context-submenu",children:[v.jsx("div",{className:"context-menu-item",onClick:()=>ne("page-left"),children:v.jsx("span",{className:"menu-label",children:"居左"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>ne("page-center"),children:v.jsx("span",{className:"menu-label",children:"居中"})}),v.jsx("div",{className:"context-menu-item",onClick:()=>ne("page-right"),children:v.jsx("span",{className:"menu-label",children:"居右"})})]})]}),v.jsx("div",{className:"context-menu-divider"}),v.jsxs("div",{className:"context-menu-item delete",onClick:()=>Z(a),"data-disabled":!L,children:[v.jsx("span",{className:"menu-icon",children:"🗑"}),v.jsx("span",{className:"menu-label",children:"删除"}),v.jsx("span",{className:"menu-shortcut",children:"Delete"})]}),v.jsxs("div",{className:"context-menu-item",onClick:()=>Z(o),"data-disabled":!L,children:[v.jsx("span",{className:"menu-icon",children:"✖"}),v.jsx("span",{className:"menu-label",children:"取消选择"}),v.jsx("span",{className:"menu-shortcut",children:"Esc"})]})]})},fs={ROUND:(r,e=0)=>{const t=Math.pow(10,e);return Math.round(r*t)/t},FLOOR:r=>Math.floor(r),CEIL:r=>Math.ceil(r),ABS:r=>Math.abs(r),MOD:(r,e)=>r%e,CONCAT:(...r)=>r.join(""),LEFT:(r,e)=>String(r).substring(0,e),RIGHT:(r,e)=>String(r).slice(-e),LEN:r=>String(r).length,TRIM:r=>String(r).trim(),UPPER:r=>String(r).toUpperCase(),LOWER:r=>String(r).toLowerCase(),NOW:()=>new Date().toLocaleString("zh-CN"),TODAY:()=>new Date().toLocaleDateString("zh-CN"),YEAR:r=>new Date(r).getFullYear(),MONTH:r=>new Date(r).getMonth()+1,DAY:r=>new Date(r).getDate(),IF:(r,e,t)=>r?e:t,IIF:(r,e,t)=>r?e:t,ISNULL:(r,e)=>r==null||r===""?e:r,FORMAT:(r,e)=>{switch(e){case"currency":return`¥${r.toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}`;case"percent":return`${(r*100).toFixed(2)}%`;default:return String(r)}},FIXED:(r,e=2)=>r.toFixed(e),PADLEFT:(r,e,t="0")=>String(r).padStart(e,t),PADRIGHT:(r,e,t=" ")=>String(r).padEnd(e,t),COUNT:r=>Array.isArray(r)?r.length:r==="*"||r==="ROWID"?"__COUNT_ALL__":1,SUM:(r,e)=>Array.isArray(r)?e?r.reduce((t,A)=>t+(Number(A[e])||0),0):r.reduce((t,A)=>t+(Number(A)||0),0):0,AVG:(r,e)=>!Array.isArray(r)||r.length===0?0:(e?r.reduce((A,n)=>A+(Number(n[e])||0),0):r.reduce((A,n)=>A+(Number(n)||0),0))/r.length,MAX:(r,e)=>{if(!Array.isArray(r)||r.length===0)return 0;const t=e?r.map(A=>Number(A[e])||0):r.map(A=>Number(A)||0);return Math.max(...t)},MIN:(r,e)=>{if(!Array.isArray(r)||r.length===0)return 0;const t=e?r.map(A=>Number(A[e])||0):r.map(A=>Number(A)||0);return Math.min(...t)},ROWID:()=>"ROWID",TOCHINESE:r=>{if(r===0)return"零元整";if(isNaN(r))return"";const e=["角","分"],t=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],A=[["","拾","佰","仟"],["","万","亿","兆"]],n=r<0?"负":"";r=Math.abs(r);let i="";const s=r.toFixed(2),[a,o]=s.split(".");for(let u=0;u<o.length;u++){const f=Number(o.charAt(u));f!==0&&(i+=t[f]+e[u])}i=i||"整";let l=parseInt(a);if(l>0){let u="";for(let f=0;f<A[1].length&&l>0;f++){let h="";for(let c=0;c<A[0].length&&l>0;c++)h=t[l%10]+A[0][c]+h,l=Math.floor(l/10);u=h.replace(/(零.)*零$/,"").replace(/^零+/,"")+A[1][f]+u}i=u.replace(/(零.)*零元/,"元").replace(/(零.)+/g,"零")+"元"+i}return n+i},CURRENCY:(r,e="¥",t=2)=>{if(isNaN(r))return"";const A=Math.abs(r).toFixed(t),[n,i]=A.split("."),s=n.replace(/\B(?=(\d{3})+(?!\d))/g,",");return`${r<0?"-":""}${e}${s}${i?"."+i:""}`},DISCOUNT:(r,e)=>r*(1-e/100),TAX:(r,e)=>r*e/100,WITHTAX:(r,e)=>r*(1+e/100),EXTRACTTAX:(r,e)=>r-r/(1+e/100)},kh=r=>r.replace(/,/g,",").replace(/(/g,"(").replace(/)/g,")").replace(/“/g,'"').replace(/”/g,'"').replace(/‘/g,"'").replace(/’/g,"'").replace(/;/g,";").replace(/:/g,":"),vw=(r,e)=>{const{currentPage:t=1,totalPages:A=1,rowIndex:n=0}=e;return r.replace(/\{currentDate\}/g,`"${new Date().toLocaleDateString("zh-CN")}"`).replace(/\{currentTime\}/g,`"${new Date().toLocaleTimeString("zh-CN")}"`).replace(/\{pageNumber\}/g,String(t)).replace(/\{totalPages\}/g,String(A)).replace(/\{rowIndex\}/g,String(n+1))},LU=(r,e,t)=>{var A;if(!(!r&&!t)){if(e.includes(".")){const[n,i]=e.split(".");return n==="products"&&t&&t[i]!==void 0?t[i]:r&&r[n]&&Array.isArray(r[n])?(A=r[n][0])==null?void 0:A[i]:void 0}if(t&&t[e]!==void 0)return t[e];if(r&&r[e]!==void 0)return r[e]}},mw=(r,e)=>{const{data:t={},currentItem:A}=e,n=/\{([^}]+)\}/g;let i=!1;return{expression:r.replace(n,(a,o)=>{const l=LU(t,o,A);return l!==void 0?typeof l=="number"?String(l):`"${l}"`:(i=!0,`"[${o}]"`)}),hasUnresolved:i}},ww=r=>{const e=Object.keys(fs).join("|"),t=new RegExp(`\\b(${e})\\s*\\(`,"g");return r.replace(t,"__fn.$1(")},yw=(r,e)=>{const{data:t={},startIndex:A=0,pageSize:n=0}=e,i=a=>{const o=a.includes(".")?a.split(".")[0]:null;if(o&&t[o]&&Array.isArray(t[o]))return t[o];for(const l of Object.keys(t))if(Array.isArray(t[l]))return t[l];return[]},s=a=>a.includes(".")?a.split(".")[1]:a;return r=r.replace(/\bPAGECOUNT\s*\(\s*\*\s*\)/gi,()=>String(n)),r=r.replace(/\bPAGECOUNT\s*\(\s*ROWID\s*\(\s*\)\s*\)/gi,()=>String(n)),r=r.replace(/\bPAGESUM\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const u=i(o).slice(A,A+n),f=s(o),h=u.reduce((c,g)=>c+(Number(g[f])||0),0);return String(h)}),r=r.replace(/\bPAGEAVG\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const u=i(o).slice(A,A+n),f=s(o);if(u.length===0)return"0";const h=u.reduce((c,g)=>c+(Number(g[f])||0),0);return String(h/u.length)}),r=r.replace(/\bPAGEMAX\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const u=i(o).slice(A,A+n),f=s(o);if(u.length===0)return"0";const h=u.map(c=>Number(c[f])||0);return String(Math.max(...h))}),r=r.replace(/\bPAGEMIN\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const u=i(o).slice(A,A+n),f=s(o);if(u.length===0)return"0";const h=u.map(c=>Number(c[f])||0);return String(Math.min(...h))}),r=r.replace(/\bCOUNT\s*\(\s*\*\s*\)/gi,()=>{for(const a of Object.keys(t))if(Array.isArray(t[a]))return String(t[a].length);return"0"}),r=r.replace(/\bCOUNT\s*\(\s*ROWID\s*\(\s*\)\s*\)/gi,()=>{for(const a of Object.keys(t))if(Array.isArray(t[a]))return String(t[a].length);return"0"}),r=r.replace(/\bSUM\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const l=i(o),u=s(o),f=l.reduce((h,c)=>h+(Number(c[u])||0),0);return String(f)}),r=r.replace(/\bAVG\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const l=i(o),u=s(o);if(l.length===0)return"0";const f=l.reduce((h,c)=>h+(Number(c[u])||0),0);return String(f/l.length)}),r=r.replace(/\bMAX\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const l=i(o),u=s(o);if(l.length===0)return"0";const f=l.map(h=>Number(h[u])||0);return String(Math.max(...f))}),r=r.replace(/\bMIN\s*\(\s*\{?([\w.]+)\}?\s*\)/gi,(a,o)=>{const l=i(o),u=s(o);if(l.length===0)return"0";const f=l.map(h=>Number(h[u])||0);return String(Math.min(...f))}),r},PU=(r,e)=>{const{formatType:t="text",decimalPlaces:A=2}=e;switch(t){case"currency":return`¥${r.toFixed(A).replace(/\B(?=(\d{3})+(?!\d))/g,",")}`;case"percent":return`${(r*100).toFixed(A)}%`;case"number":return r.toFixed(A).replace(/\B(?=(\d{3})+(?!\d))/g,",");case"text":default:return String(r)}},ho=(r,e={},t={})=>{if(!r||!r.trim())return"[公式]";r=kh(r);try{let A=vw(r,e);A=yw(A,e);const{expression:n,hasUnresolved:i}=mw(A,e);A=n;const s=/\b(SUM|COUNT|AVG|MAX|MIN|PAGESUM|PAGECOUNT|PAGEAVG|PAGEMAX|PAGEMIN|ROWID|ROUND|FLOOR|CEIL|ABS|MOD|CONCAT|LEFT|RIGHT|LEN|TRIM|UPPER|LOWER|NOW|TODAY|YEAR|MONTH|DAY|IF|IIF|ISNULL|FORMAT|FIXED|PADLEFT|PADRIGHT|TOCHINESE|CURRENCY|DISCOUNT|TAX|WITHTAX|EXTRACTTAX)\s*\(/i.test(A);if(i&&!s)try{const o=Function('"use strict"; return ('+A+")")();return String(o)}catch{return r.replace(/\{([^}]+)\}/g,"[$1]")}if(A=ww(A),A.includes('"')||A.includes("'")){if(!/^[\d\s+"'\u4e00-\u9fa5\w\-_.,:;=<>!&|\uff08\uff09\uff1a\uff0c\u3002\u3001()[\]]+$/.test(A))return console.error("[公式错误] 字符串公式包含不允许的字符:",A),"[公式错误]";const o=Function("__fn",'"use strict"; return ('+A+")")(fs);return String(o)}else{if(!/^[\d\s+\-*/().%<>=!&|?:\w]+$/.test(A))return console.error("数字公式包含不允许的字符:",A),"[公式错误]";const o=Function("__fn",'"use strict"; return ('+A+")")(fs);return typeof o=="number"&&!isNaN(o)&&isFinite(o)?PU(o,t):String(o)}}catch(A){return console.error("公式计算错误:",A),"[计算错误]"}},RU=(r,e)=>{fs[r.toUpperCase()]=e},MU=()=>Object.keys(fs),Bw=r=>{if(!r||!r.trim())return{valid:!1,message:"公式不能为空"};const e=kh(r);let t=0;for(const a of e)if(a==="("&&t++,a===")"&&t--,t<0)return{valid:!1,message:"括号不匹配:多余的右括号"};if(t!==0)return{valid:!1,message:"括号不匹配:缺少右括号"};let A=0;for(const a of e)if(a==="{"&&A++,a==="}"&&A--,A<0)return{valid:!1,message:"字段引用格式错误:多余的 }"};if(A!==0)return{valid:!1,message:"字段引用格式错误:缺少 }"};if(/^\s*[A-Z_][A-Z0-9_]*\s*\(/i.test(e)){let a=0,o=-1;for(let l=0;l<e.length;l++)if(e[l]==="("&&a++,e[l]===")"&&(a--,a===0)){o=l;break}if(o!==-1&&o<e.length-1){const l=e.substring(o+1).trim();if(l&&!/^[\s+\-*/&|<>=]+/.test(l))return{valid:!1,message:`公式语法错误:函数调用后有多余内容 "${l}"`}}}let i=!1,s="";for(let a=0;a<e.length;a++){const o=e[a];!i&&(o==='"'||o==="'")?(i=!0,s=o):i&&o===s&&e[a-1]!=="\\"&&(i=!1)}return i?{valid:!1,message:"字符串引号不匹配"}:{valid:!0,message:"公式格式正确"}},DU=(r,e,t)=>{if(!r||!r.trim())return{valid:!1,message:"公式不能为空"};const A=kh(r);try{let n=vw(A,{currentPage:1,totalPages:1,rowIndex:0});const i=e.products||[t];n=yw(n,{data:{...e,products:i},startIndex:0,pageSize:i.length});const{expression:s}=mw(n,{data:e,currentItem:t});n=s,n=ww(n);const a=Function("__fn",'"use strict"; return ('+n+")")(fs);return{valid:!0,message:"校验通过",result:String(a)}}catch(n){const i=n instanceof Error?n.message:String(n);if(i.includes("is not defined")){const s=i.match(/(\w+) is not defined/);if(s)return{valid:!1,message:`未定义的变量或函数: "${s[1]}",请检查拼写或使用 {字段名} 格式引用数据字段`}}if(i.includes("is not a function")){const s=i.match(/(\w+) is not a function/);if(s)return{valid:!1,message:`"${s[1]}" 不是有效的函数,请检查函数名拼写`}}return i.includes("Unexpected token")?{valid:!1,message:"语法错误: 意外的符号,请检查括号、引号、运算符是否正确"}:i.includes("Unexpected end")?{valid:!1,message:"语法错误: 公式不完整,请检查是否缺少括号或参数"}:{valid:!1,message:`执行错误: ${i}`}}},bw=(r,e)=>{const t=r.find(A=>A.name===e);return(t==null?void 0:t.type)||"string"},xw=(r,e)=>{const t=r.find(A=>A.name===e);if(t)return t.label;if(e.includes(".")){const A=e.split(".")[1],n=r.find(i=>i.name.endsWith("."+A));if(n)return n.label}return e},hs=(r,e)=>{if(r==null)return"";switch(e){case"currency":return typeof r=="number"?`¥${r.toLocaleString("zh-CN")}`:String(r);case"number":return typeof r=="number"?r.toLocaleString("zh-CN"):String(r);case"date":return r instanceof Date?r.toLocaleDateString("zh-CN"):String(r);case"string":default:return String(r)}},kU=(r,e)=>{const t=r.getFullYear(),A=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0"),i=String(r.getHours()).padStart(2,"0"),s=String(r.getMinutes()).padStart(2,"0"),a=String(r.getSeconds()).padStart(2,"0");return e.replace(/yyyy/g,String(t)).replace(/MM/g,A).replace(/dd/g,n).replace(/HH/g,i).replace(/mm/g,s).replace(/ss/g,a)},HU=(r,e)=>{const t=r.y,A=t+r.height,n=e.top,i=e.actualBottom;if(A>n&&t<i){const s=Math.max(t,n),a=Math.min(A,i),o=s-t,l=A-a;return`inset(${o}px 0 ${l}px 0)`}},Qu=(r,e={})=>{const{data:t={},currentPage:A=1,totalPages:n=1,startIndex:i=0,rowIndex:s=0,pageSize:a=0}=e,o=u=>t[u]&&Array.isArray(t[u])?t[u]:[],l=u=>o(u)[i+s]||null;switch(r.type){case"text":case"multiline_text":return r.text||"";case"field":const u=r.fieldName||"",f=bw(e.dataFields||[],u);if(u.includes(".")){const[g,p]=u.split("."),y=l(g);if(y&&y[p]!==void 0)return hs(y[p],f);const w=o(g);return w.length>0&&w[0][p]!==void 0?hs(w[0][p],f):`{${xw(e.dataFields||[],u)}}`}const h=t[u];return h!==void 0?hs(h,f):`{${xw(e.dataFields||[],u)}}`;case"calculated":return ho(r.formula||"",{data:t,currentPage:A,totalPages:n,rowIndex:i+s,startIndex:i,pageSize:a},{formatType:r.formatType,decimalPlaces:r.decimalPlaces});case"page_number":return`第${A}页/共${n}页`;case"current_date":return kU(new Date,r.text||"yyyy-MM-dd");case"image":return"[图片]";case"line":case"rectangle":return"";case"barcode":case"qrcode":const c=r.fieldName||"";if(c){const g=bw(e.dataFields||[],c);if(c.includes(".")){const[p,y]=c.split("."),w=l(p);if(w&&w[y]!==void 0)return hs(w[y],g);const B=o(p);if(B.length>0&&B[0][y]!==void 0)return hs(B[0][y],g)}else{const p=t[c];if(p!==void 0)return hs(p,g)}}return r.text||"";default:return""}},jU=(r,e)=>{const t=r.textVerticalAlign||e.verticalAlign||"middle",A=e.textAlign||"left";if(!["text","multiline_text","field","calculated","page_number","current_date"].includes(r.type))return{};switch(t){case"top":return{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:A==="center"?"center":A==="right"?"flex-end":"flex-start",width:"100%",height:"100%",boxSizing:"border-box",margin:0,padding:0};case"bottom":return{display:"flex",flexDirection:"column",justifyContent:"flex-end",alignItems:A==="center"?"center":A==="right"?"flex-end":"flex-start",width:"100%",height:"100%",boxSizing:"border-box",margin:0,padding:0};case"middle":default:return{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:A==="center"?"center":A==="right"?"flex-end":"flex-start",width:"100%",height:"100%",boxSizing:"border-box",margin:0,padding:0}}},Hh=(r,e={})=>{const{isSelected:t=!1,isPreview:A=!1}=e,n={fontSize:r.fontSize||12,color:r.color||"#000000",backgroundColor:r.background||"transparent",fontWeight:r.fontWeight||"normal",fontStyle:r.fontStyle||"normal",textAlign:r.textAlign||"left",lineHeight:r.lineHeight||1.2};if(typeof r.padding=="object"&&r.padding){const s=r.padding.top??0,a=r.padding.right??0,o=r.padding.bottom??0,l=r.padding.left??0;n.padding=`${s}px ${a}px ${o}px ${l}px`}else n.padding=r.padding??0;const i=r.border;if(i&&i.width&&i.width>0){const s=i.width,a=i.style&&i.style!=="none"?i.style:"solid",o=i.color&&i.color!=="transparent"?i.color:"#000000";n.border=`${s}px ${a} ${o}`}switch(r.type){case"multiline_text":n.whiteSpace="pre-wrap",n.wordBreak="break-word";break;case"field":case"calculated":break;case"page_number":case"current_date":n.color=n.color||"#666666";break;case"image":n.display="flex",n.alignItems="center",n.justifyContent="center",n.overflow="hidden";break;case"line":break;case"rectangle":r.border||(n.border="1px solid #000000"),r.borderRadius&&r.borderRadius>0&&(n.borderRadius=`${r.borderRadius}px`);break;case"ellipse":n.borderRadius="50%",(!i||!i.width||i.width<1)&&(n.border="1px solid #000000");break;case"star":n.clipPath="polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)",(!n.backgroundColor||n.backgroundColor==="transparent")&&(n.backgroundColor="#FFD700");break;case"triangle":n.clipPath="polygon(50% 0%, 0% 100%, 100% 100%)",(!n.backgroundColor||n.backgroundColor==="transparent")&&(n.backgroundColor="#000000");break;case"diamond":n.clipPath="polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",(!n.backgroundColor||n.backgroundColor==="transparent")&&(n.backgroundColor="#000000");break}return!A&&t&&(n.outline="1px solid #4d90fe",n.zIndex=1e3),n},Cw=(r,e,t)=>{if(!["text","multiline_text","field","calculated","page_number","current_date"].includes(e.type))return r;const n=jU(e,t);if(Object.keys(n).length>0){const i={padding:t.padding,boxSizing:"border-box",width:"100%",textAlign:t.textAlign,lineHeight:t.lineHeight,whiteSpace:e.type==="multiline_text"?"normal":"pre-wrap",wordBreak:"break-word",overflow:"hidden"};return e.type==="multiline_text"?ce.createElement("div",{style:n,className:"text-content-wrapper"},ce.createElement("div",{style:i,className:"text-content rich-text-content",dangerouslySetInnerHTML:{__html:r}})):ce.createElement("div",{style:n,className:"text-content-wrapper"},ce.createElement("div",{style:i,className:"text-content"},r))}return e.type==="multiline_text"?ce.createElement("div",{className:"rich-text-content",dangerouslySetInnerHTML:{__html:r}}):r},jh=(r,e,t=!1)=>{if(!t)return e;const A=r.textVerticalAlign||"middle",n=r.textAlign||"left";return{...e,display:"flex",flexDirection:"column",justifyContent:A==="top"?"flex-start":A==="bottom"?"flex-end":"center",alignItems:n==="center"?"center":n==="right"?"flex-end":"flex-start"}},Nu=(r,e,t={})=>{const{isSelected:A=!1,isPreview:n=!1,data:i={},currentPage:s=1,totalPages:a=1,startIndex:o=0,rowIndex:l=0,includeClipPath:u=!0,pageSize:f=0,dataFields:h=[]}=t,c=Qu(r,{data:i,currentPage:s,totalPages:a,startIndex:o,rowIndex:l,pageSize:f,dataFields:h}),g=Hh(r,{isSelected:A,isPreview:n}),y={...{position:"absolute",left:r.x,top:r.y-e.top,width:r.width,height:r.height,zIndex:r.zIndex??1},...g};["text","field","calculated","page_number","current_date"].includes(r.type)&&(delete y.display,delete y.alignItems,delete y.justifyContent,delete y.flexDirection);const B=["star","triangle","diamond"],x=r.type==="image"&&r.floating===!0;if(u&&!B.includes(r.type)&&!x){const Q=HU(r,e);Q&&(y.clipPath=Q)}const E=Cw(c,r,g);return{content:c,style:y,wrappedContent:E}},Ew=(r,e={})=>{const{isPreview:t=!1,data:A={},currentPage:n=1,totalPages:i=1,selectedObjectId:s="",products:a=[],startIndex:o=0,includeClipPath:l=!0,dataFields:u=[]}=e,f=[];return r.id==="detail"&&a.length>0?a.forEach((h,c)=>{r.objects.forEach(g=>{const p=Nu(g,r,{isSelected:s===g.id,isPreview:t,data:A,currentPage:n,totalPages:i,startIndex:o,rowIndex:c,includeClipPath:l,pageSize:a.length,dataFields:u});f.push({obj:g,renderData:p,isSelected:s===g.id,rowIndex:c})})}):r.objects.forEach(h=>{const c=Nu(h,r,{isSelected:s===h.id,isPreview:t,data:A,currentPage:n,totalPages:i,includeClipPath:l,dataFields:u});f.push({obj:h,renderData:c,isSelected:s===h.id})}),f};class KU{constructor(){this.selectedObjects=new Map,this.selectionRect=null,this.shiftKeyPressed=!1,this.ctrlKeyPressed=!1,this.isDraggingSelection=!1,this.dragStartX=0,this.dragStartY=0,this.clipboard=[],this.MOVE_STEP=1,this.keyState={},this.handleMouseDown=(e,t,A,n,i,s)=>{this.shiftKeyPressed=A,this.ctrlKeyPressed=n,this.selectionRect=null,this.dragStartX=e,this.dragStartY=t,this.isDraggingSelection=!0,!this.shiftKeyPressed&&!this.ctrlKeyPressed&&(this.selectedObjects.clear(),s&&s(this.getSelectedObjectIds())),this.selectionRect={x:this.dragStartX,y:this.dragStartY,width:0,height:0}},this.handleMouseMove=(e,t,A,n,i,s,a)=>{if(!this.isDraggingSelection||!this.selectionRect)return;this.shiftKeyPressed=A,this.ctrlKeyPressed=n,this.selectionRect.width=e-this.dragStartX,this.selectionRect.height=t-this.dragStartY;const o=this.getNormalizedRect(this.selectionRect),l=this.findObjectsInRect(o,i,s),u=this.selectedObjects.size;this.shiftKeyPressed||this.ctrlKeyPressed?l.forEach(h=>{const c=`${h.bandId}-${h.object.id}`;this.selectedObjects.has(c)||this.selectedObjects.set(c,h)}):(this.selectedObjects.clear(),l.forEach(h=>{const c=`${h.bandId}-${h.object.id}`;this.selectedObjects.set(c,h)}));const f=this.selectedObjects.size;u!==f&&a(this.getSelectedObjectIds())},this.handleMouseUp=(e,t,A)=>{this.shiftKeyPressed=e,this.ctrlKeyPressed=t,this.isDraggingSelection=!1;const n=this.getSelectedObjects();if(this.selectionRect=null,A){const i=this.getSelectedObjectIds();A(i)}return n},this.handleKeyDown=(e,t,A,n,i)=>{var l;const s=document.activeElement,a=(l=s==null?void 0:s.tagName)==null?void 0:l.toLowerCase();if(a==="input"||a==="textarea"||a==="select"||s!=null&&s.isContentEditable)return;this.keyState[e.key.toLowerCase()]=!0,this.shiftKeyPressed=e.shiftKey,this.ctrlKeyPressed=e.ctrlKey||e.metaKey;const o=e.altKey;if(["arrowup","arrowdown","arrowleft","arrowright"].includes(e.key.toLowerCase())){if(e.preventDefault(),this.selectedObjects.size===0)return;const u=this.shiftKeyPressed?10:this.MOVE_STEP;if(o&&A){let f=0,h=0;switch(e.key.toLowerCase()){case"arrowup":h=-u;break;case"arrowdown":h=u;break;case"arrowleft":f=-u;break;case"arrowright":f=u;break}const c=[];this.selectedObjects.forEach(g=>{c.push({objectId:g.object.id,bandId:g.bandId,deltaWidth:f,deltaHeight:h})}),A(c)}else{let f=0,h=0;switch(e.key.toLowerCase()){case"arrowup":h=-u;break;case"arrowdown":h=u;break;case"arrowleft":f=-u;break;case"arrowright":f=u;break}const c=[];this.selectedObjects.forEach(g=>{c.push({objectId:g.object.id,bandId:g.bandId,deltaX:f,deltaY:h})}),t(c)}}switch(e.key.toLowerCase()){case"escape":this.selectedObjects.clear();break;case"a":(e.ctrlKey||e.metaKey)&&e.preventDefault();break;case"c":(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.copySelectedObjects());break;case"v":if((e.ctrlKey||e.metaKey)&&n){e.preventDefault();const u=i?this.getClipboardObjects(i.id,{top:i.top,actualBottom:i.actualBottom}):this.getClipboardObjects();u.length>0&&n(u)}break}},this.handleKeyUp=e=>{this.keyState[e.key.toLowerCase()]=!1,this.shiftKeyPressed=e.shiftKey,this.ctrlKeyPressed=e.ctrlKey||e.metaKey},this.selectObject=(e,t,A=!1)=>{const n=`${t}-${e.id}`;return A?this.selectedObjects.has(n)?this.selectedObjects.delete(n):this.selectedObjects.set(n,{object:e,bandId:t,originalX:e.x,originalY:e.y}):(this.selectedObjects.clear(),this.selectedObjects.set(n,{object:e,bandId:t,originalX:e.x,originalY:e.y})),this.getSelectedObjectIds()},this.getSelectionRect=()=>this.selectionRect,this.getSelectedObjectIds=()=>Array.from(this.selectedObjects.keys()),this.getSelectedObjects=()=>Array.from(this.selectedObjects.values()),this.clearSelection=()=>{this.selectedObjects.clear(),this.selectionRect=null},this.isObjectSelected=(e,t)=>this.selectedObjects.has(`${t}-${e}`),this.getSelectionBounds=()=>{if(this.selectedObjects.size===0)return null;let e=1/0,t=1/0,A=-1/0,n=-1/0;return this.selectedObjects.forEach(i=>{const s=i.object;e=Math.min(e,s.x),t=Math.min(t,s.y),A=Math.max(A,s.x+s.width),n=Math.max(n,s.y+s.height)}),{x:e,y:t,width:A-e,height:n-t}},this.copySelectedObjects=()=>{this.clipboard=Array.from(this.selectedObjects.values()).map(e=>({...e,object:{...e.object}})),console.log(`已复制 ${this.clipboard.length} 个对象`)},this.getClipboardObjects=(e,t)=>this.clipboard.length===0?[]:this.clipboard.map(A=>{const n=A.bandId,i=e||n;let s=5;e&&t&&(s=t.top+5-A.object.y);const a={...A.object,x:A.object.x+5,y:A.object.y+s};if(A.object.type==="line"){const o=A.object;a.x1=(o.x1??A.object.x)+5,a.y1=(o.y1??A.object.y)+s,a.x2=(o.x2??A.object.x+A.object.width)+5,a.y2=(o.y2??A.object.y)+s}return{...A,bandId:i,object:a,originalX:A.object.x+5,originalY:A.object.y+s}}),this.hasClipboardContent=()=>this.clipboard.length>0}getNormalizedRect(e){const t=Math.min(e.x,e.x+e.width),A=Math.min(e.y,e.y+e.height),n=Math.abs(e.width),i=Math.abs(e.height);return{x:t,y:A,width:n,height:i}}findObjectsInRect(e,t,A){const n=[];if(!t||!Array.isArray(t))return console.log("bands 无效,无法进行框选检测"),n;const i=(A==null?void 0:A.left)||0,s=(A==null?void 0:A.top)||0,a=this.getNormalizedRect(e),o=a.x,l=a.y,u=o+a.width,f=l+a.height;for(const h of t)for(const c of h.objects){let g,p,y,w;if(c.type==="line"){const x=c,E=x.x1??c.x,Q=x.y1??c.y,L=x.x2??c.x+c.width,S=x.y2??c.y;g=i+Math.min(E,L),p=s+Math.min(Q,S),y=i+Math.max(E,L),w=s+Math.max(Q,S);const T=x.strokeWidth||2,_=Math.max(T*3,12),D=Math.abs(S-Q)<2,U=Math.abs(L-E)<2;D?(p-=_,w+=_,g-=_/2,y+=_/2):U?(g-=_,y+=_,p-=_/2,w+=_/2):(g-=_,p-=_,y+=_,w+=_)}else g=i+c.x,p=s+c.y,y=i+c.x+c.width+6,w=s+c.y+c.height+6;!(y<o||g>u||w<l||p>f)&&n.push({object:c,bandId:h.id,originalX:c.x,originalY:c.y})}return n}}const Fw=({bands:r,state:e,designerOptions:t,PAGE_WIDTH:A,PAGE_HEIGHT:n,PAGE_MARGINS:i,onSelectBand:s,onSelectObject:a,onUpdateObjectPosition:o,onUpdateObject:l,onMoveMultipleObjects:u,onResizeMultipleObjects:f,onPasteObjects:h,onBoundaryMouseDown:c,selectedObjectIds:g,focusedObjectId:p,onClearSelection:y,onMultiSelect:w,onClickPosition:B,onDeleteObjects:x,onUndo:E,onRedo:Q,canUndo:L=!1,canRedo:S=!1,onCopy:T,onPaste:_,canPaste:D=!1,onUpdateObjects:U,dataFields:O=[]})=>{const M=ce.useRef(null),[C]=ce.useState(()=>new KU),[z,re]=ce.useState(null),[ne,Z]=ce.useState(!1),[Ae,V]=ce.useState({visible:!1,x:0,y:0}),k=ce.useCallback(()=>{V({visible:!1,x:0,y:0})},[]),I=ce.useCallback(R=>{R.preventDefault(),R.stopPropagation(),V({visible:!0,x:R.clientX,y:R.clientY})},[]),P=ce.useRef(!1),K=ce.useRef(null),Y=R=>{if(!M.current)return{x:0,y:0};const Ue=M.current.getBoundingClientRect(),Te=e.zoomLevel||1,Ee=(R.clientX-Ue.left)/Te,Ve=(R.clientY-Ue.top)/Te;return{x:Ee,y:Ve}},J=R=>{if(R.target.closest(".boundary-line")||R.target.closest(".design-object")||R.target.closest(".react-draggable")||R.target.closest(".react-rnd"))return;const{x:Ie,y:Ue}=Y(R.nativeEvent),Te=R.shiftKey,Ee=R.ctrlKey||R.metaKey;Z(!0);const Ve=Ie,Me=Ue;K.current={x:Ve,y:Me},re({x:Ve,y:Me,width:0,height:0}),r&&Array.isArray(r)&&C.handleMouseDown(Ve,Me,Te,Ee,r,Ye=>{})},q=R=>{if(!ne||!M.current||!K.current)return;const{x:Ie,y:Ue}=Y(R.nativeEvent),Te=Ie,Ee=Ue,Ve=K.current.x,Me=K.current.y,ze={x:Ve,y:Me,width:Te-Ve,height:Ee-Me};re(ze),r&&Array.isArray(r)&&C.handleMouseMove(Te,Ee,R.shiftKey,R.ctrlKey||R.metaKey,r,i,Ye=>{w&&w(Ye)})},W=ce.useCallback(R=>{if(!ne)return;Z(!1),K.current=null;const Ie=z&&(Math.abs(z.width)>3||Math.abs(z.height)>3);P.current=Ie||!1;const Ue=C.handleMouseUp((R==null?void 0:R.shiftKey)||!1,(R==null?void 0:R.ctrlKey)||(R==null?void 0:R.metaKey)||!1,void 0);if(re(null),Ue.length>0){const Te=Ue.map(({object:Ee,bandId:Ve})=>`${Ve}-${Ee.id}`);Te.length>0&&w&&w(Te)}re(null)},[ne,z,C,w]),te=(R,Ie,Ue)=>{if(Ue.stopPropagation(),Ue.button===2){const Me=`${Ie}-${R}`;if(g!=null&&g.includes(Me))return}const Te=Ue.shiftKey||Ue.ctrlKey||Ue.metaKey,Ee=r.find(Me=>Me.id===Ie),Ve=Ee==null?void 0:Ee.objects.find(Me=>Me.id===R);Ve&&Ee&&(s(Ie,Ue),B&&B(Ve.x,Ve.y-Ee.top,Ie),a(R,Ie,Te))},oe=R=>{if(ne)return;if(P.current){P.current=!1;return}const Ue=R.currentTarget.getBoundingClientRect(),Te=e.zoomLevel||1,Ee=(R.clientX-Ue.left)/Te,Ve=(R.clientY-Ue.top)/Te,Me=Ee-i.left,ze=Ve-i.top,Ye=R.target.closest(".boundary-line");if(Ye){const Oe=Ye.getAttribute("data-band-id");if(Oe&&(s(Oe,R),B)){const je=r.find(ge=>ge.id===Oe);je&&B(Me,ze-je.top,Oe)}return}if(R.target.closest(".design-object")||R.target.closest(".react-draggable")||R.target.closest(".react-rnd"))return;if(Me<0||Me>A-i.left-i.right||ze<0||ze>n-i.top-i.bottom){!R.shiftKey&&!R.ctrlKey&&!R.metaKey&&(C.clearSelection(),y&&y());return}let xe=null;for(const Oe of r){const je=Oe.top,ge=Oe.actualBottom;if(ze>=je&&ze<=ge){xe=Oe;break}}xe?(!R.shiftKey&&!R.ctrlKey&&!R.metaKey&&(C.clearSelection(),y&&y()),s(xe.id,R),B&&B(Me,ze-xe.top,xe.id)):!R.shiftKey&&!R.ctrlKey&&!R.metaKey&&(C.clearSelection(),y&&y())};ce.useEffect(()=>{const R=Ie=>{ne&&W(Ie)};return window.addEventListener("mouseup",R),()=>{window.removeEventListener("mouseup",R)}},[W,ne]);const we=ce.useRef(g||[]);ce.useEffect(()=>{we.current=g||[]},[g]),ce.useEffect(()=>{if(ne)return;const R=we.current;R&&R.length>0&&(C.clearSelection(),R.forEach(Ie=>{const[Ue,Te]=Ie.split("-"),Ee=r.find(Me=>Me.id===Ue),Ve=Ee==null?void 0:Ee.objects.find(Me=>Me.id===Te);Ve&&Ee&&C.selectObject(Ve,Ue,!0)}))},[g,r,C,ne]);const le=()=>{if(!ne||!z)return null;const R={x:z.width>=0?z.x:z.x+z.width,y:z.height>=0?z.y:z.y+z.height,width:Math.abs(z.width),height:Math.abs(z.height)};return R.width<2||R.height<2?null:v.jsx("div",{className:"selection-rect",style:{position:"absolute",left:`${R.x}px`,top:`${R.y}px`,width:`${R.width}px`,height:`${R.height}px`,backgroundColor:"rgba(77, 144, 254, 0.1)",border:"1px solid #4d90fe",pointerEvents:"none",zIndex:2e3,boxShadow:"0 0 0 1px rgba(77, 144, 254, 0.3)"}})},Be=()=>r.map(R=>{const Ie=Math.max(0,R.actualBottom-R.top),Ue=e.draggingBoundary===R.id,Te=e.selectedBand===R.id,Ee=R.top+Ie;return v.jsx("div",{className:`boundary-line ${Ue?"dragging":""}`,"data-band-id":R.id,style:{position:"absolute",top:`${Ee}px`,left:0,right:0,height:"20px",cursor:"ns-resize",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:Ue?"#666":Te?"#e6f4ff":"#f3f3f3",border:Te?"1px solid #1890ff":"1px solid #aeadad",transition:"background-color 0.15s, border-color 0.15s"},onMouseDown:Ve=>c(R.id,Ve),title:`拖动调整${R.name}高度 (当前: ${Ie.toFixed(1)}px)`,children:v.jsxs("div",{className:"boundary-label",style:{position:"absolute",top:"50%",left:"0%",transform:"translate(0, -50%)",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",color:Te?"#1890ff":"#c3c3c3",whiteSpace:"nowrap",background:"transparent",fontWeight:Te?500:400},children:["↑",R.name]})},`boundary-${R.id}`)});ce.useEffect(()=>{const R=Ue=>{const Te=e.selectedBand?r.find(Ee=>Ee.id===e.selectedBand):null;C.handleKeyDown(Ue,u,f,Ee=>{h&&h(Ee.map(Ve=>({object:Ve.object,bandId:Ve.bandId})))},Te?{id:Te.id,top:Te.top,actualBottom:Te.actualBottom}:null)},Ie=Ue=>{C.handleKeyUp(Ue)};return window.addEventListener("keydown",R),window.addEventListener("keyup",Ie),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",Ie)}},[u,f,h,C,e.selectedBand,r]);const ye=()=>r.flatMap(R=>Ew(R,{isPreview:!1,selectedObjectId:"",includeClipPath:!0,dataFields:O}).filter(({obj:Ue})=>{if(Ue.type==="image"&&Ue.floating===!0)return!0;if(Ue.type==="line"){const Te=Ue,Ee=Math.min(Te.y1||Ue.y,Te.y2||Ue.y);return Math.max(Te.y1||Ue.y,Te.y2||Ue.y)>=R.top&&Ee<R.actualBottom}return Ue.y>=R.top&&Ue.y<R.actualBottom}).map(({obj:Ue,renderData:Te,isSelected:Ee})=>{const Ve=`${R.id}-${Ue.id}`,ze=(g==null?void 0:g.includes(Ve))||!1,Ye=p===Ve;if(Ue.type==="line"){const Oe=Ue;return v.jsx(OU,{object:{id:Ue.id,type:"line",x1:Oe.x1??Ue.x,y1:Oe.y1??Ue.y,x2:Oe.x2??Ue.x+Ue.width,y2:Oe.y2??Ue.y,color:Oe.color,strokeWidth:Oe.strokeWidth,lineStyle:Oe.lineStyle,zIndex:Ue.zIndex},band:R,isSelected:ze,isFocused:Ye,selectedObjectIds:g,onSelect:je=>te(Ue.id,R.id,je),onUpdate:(je,ge,Re)=>{l(je,R.id,ge,Re)},onDragMultiple:(je,ge,Re)=>{const Le=(g==null?void 0:g.map(ue=>{const[fe,Pe]=ue.split("-");return{objectId:Pe,bandId:fe,deltaX:je,deltaY:ge}}))||[];Le.length>0&&u(Le,Re)}},Ue.id)}const xe=["text","multiline_text","field","calculated","page_number","current_date"].includes(Ue.type);return v.jsx(NU,{object:Ue,band:R,style:jh(Ue,Te.style,xe),content:Te.content,wrappedContent:Te.wrappedContent,isSelected:ze,isFocused:Ye,selectedObjectIds:g,onSelect:Oe=>te(Ue.id,R.id,Oe),onUpdatePosition:o,onUpdate:(Oe,je)=>{l(Oe,R.id,je)},onDragMultiple:(Oe,je,ge)=>{const Re=(g==null?void 0:g.map(Le=>{const[ue,fe]=Le.split("-");return{objectId:fe,bandId:ue,deltaX:Oe,deltaY:je}}))||[];Re.length>0&&u(Re,ge)},minWidth:20,minHeight:20},Ue.id)})).filter(Boolean);return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"canvas-wrapper",children:v.jsxs("div",{ref:M,className:"canvas-container",style:{marginTop:`${i.top}px`,marginBottom:`${i.bottom}px`,width:`${A}px`,minHeight:`${n}px`,position:"relative",cursor:ne?"crosshair":"default"},onClick:oe,onMouseDown:J,onMouseMove:q,onMouseUp:W,onContextMenu:I,children:[le(),e.showRulers&&v.jsxs(v.Fragment,{children:[v.jsx(XS,{width:A,marginLeft:i.left,zoomLevel:e.zoomLevel}),v.jsx(YS,{height:n,marginTop:i.top,zoomLevel:e.zoomLevel})]}),e.showPageMargins&&v.jsx($S,{width:A,height:n,margins:i,zoomLevel:e.zoomLevel}),e.showGrid&&(()=>{const R=A-i.left-i.right,Ie=n-i.top-i.bottom,Ue=t.gridSize||10,Te=Math.round(R/Ue),Ee=Math.round(Ie/Ue),Ve=R/Te,Me=Ie/Ee;return v.jsx("div",{className:"grid-layer",style:{position:"absolute",top:`${i.top}px`,left:`${i.left}px`,width:`${R}px`,height:`${Ie}px`,backgroundSize:`${Ve}px ${Me}px`,backgroundImage:`
|
|
65
65
|
linear-gradient(to right, rgba(0, 0, 0, 0.08) 1px, transparent 1px),
|
|
66
66
|
linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 1px, transparent 1px)
|
|
67
67
|
`,pointerEvents:"none"}})})(),e.showPageMargins&&v.jsxs("div",{className:"page-margins",children:[v.jsx("div",{className:"margin-top",style:{position:"absolute",top:0,left:0,right:0,height:`${i.top}px`,borderBottom:"1px dashed #ddd"}}),v.jsx("div",{className:"margin-bottom",style:{position:"absolute",bottom:0,left:0,right:0,height:`${i.bottom}px`,borderTop:"1px dashed #ddd"}}),v.jsx("div",{className:"margin-left",style:{position:"absolute",top:0,bottom:0,left:0,width:`${i.left}px`,borderRight:"1px dashed #ddd"}}),v.jsx("div",{className:"margin-right",style:{position:"absolute",top:0,bottom:0,right:0,width:`${i.right}px`,borderLeft:"1px dashed #ddd"}})]}),v.jsx("div",{className:"boundary-layer",style:{position:"absolute",top:`${i.top}px`,left:`${i.left}px`,width:`${A-i.left-i.right}px`,height:`${n-i.top-i.bottom}px`},children:Be()}),v.jsx("div",{className:"object-layer",style:{position:"absolute",top:`${i.top}px`,left:`${i.left}px`,width:`${A-i.left-i.right}px`,height:`${n-i.top-i.bottom}px`},children:ye()}),v.jsxs("div",{className:"page-info",style:{position:"absolute",bottom:"5px",right:"5px",fontSize:"11px",color:"#666",background:"rgba(255, 255, 255, 0.8)",padding:"2px 6px",borderRadius:"3px",border:"1px solid #ddd",zIndex:100},children:["A4 (210mm × 297mm) - 比例: ",e.zoomLevel.toFixed(2),"x"]})]})}),U&&x&&E&&Q&&v.jsx(TU,{visible:Ae.visible,x:Ae.x,y:Ae.y,selectedObjectIds:g||[],bands:r,onClose:k,onUpdateObjects:U,onDeleteObjects:()=>{x(),k()},onClearSelection:()=>{y&&y(),k()},onUndo:E,onRedo:Q,canUndo:L,canRedo:S,onCopy:T,onPaste:_,canPaste:D,pageWidth:A,pageMargins:{left:i.left,right:i.right}})]})},Sw=[{name:"currentDate",label:"当前日期",category:"system"},{name:"currentTime",label:"当前时间",category:"system"},{name:"pageNumber",label:"当前页码",category:"system"},{name:"totalPages",label:"总页数",category:"system"},{name:"rowIndex",label:"行号",category:"system"}],qU=[{symbol:"+",label:"加"},{symbol:"-",label:"减"},{symbol:"*",label:"乘"},{symbol:"/",label:"除"},{symbol:"(",label:"左括号"},{symbol:")",label:"右括号"}],Uw=[{name:"aggregate",label:"聚合函数",functions:[{name:"COUNT",syntax:"COUNT(*)",desc:"统计所有记录数",example:"COUNT(*)"},{name:"PAGECOUNT",syntax:"PAGECOUNT(*)",desc:"统计当前页记录数",example:"PAGECOUNT(*)"},{name:"SUM",syntax:"SUM({field})",desc:"所有记录求和",example:"SUM({products.amount})"},{name:"PAGESUM",syntax:"PAGESUM({field})",desc:"当前页求和",example:"PAGESUM({products.amount})"},{name:"AVG",syntax:"AVG({field})",desc:"所有记录平均值",example:"AVG({products.price})"},{name:"PAGEAVG",syntax:"PAGEAVG({field})",desc:"当前页平均值",example:"PAGEAVG({products.price})"},{name:"MAX",syntax:"MAX({field})",desc:"所有记录最大值",example:"MAX({products.quantity})"},{name:"PAGEMAX",syntax:"PAGEMAX({field})",desc:"当前页最大值",example:"PAGEMAX({products.quantity})"},{name:"MIN",syntax:"MIN({field})",desc:"所有记录最小值",example:"MIN({products.price})"},{name:"PAGEMIN",syntax:"PAGEMIN({field})",desc:"当前页最小值",example:"PAGEMIN({products.price})"}]},{name:"math",label:"数学函数",functions:[{name:"ROUND",syntax:"ROUND(value, decimals)",desc:"四舍五入,保留指定小数位",example:"ROUND({price} * 1.13, 2)"},{name:"FLOOR",syntax:"FLOOR(value)",desc:"向下取整",example:"FLOOR({amount})"},{name:"CEIL",syntax:"CEIL(value)",desc:"向上取整",example:"CEIL({amount})"},{name:"ABS",syntax:"ABS(value)",desc:"绝对值",example:"ABS({totalAmount})"},{name:"MOD",syntax:"MOD(a, b)",desc:"取余数",example:"MOD({rowIndex}, 2)"}]},{name:"string",label:"字符串函数",functions:[{name:"CONCAT",syntax:"CONCAT(str1, str2, ...)",desc:"字符串拼接",example:'CONCAT({customer}, "-出库单")'},{name:"LEFT",syntax:"LEFT(str, n)",desc:"取左边n个字符",example:"LEFT({invoiceNo}, 3)"},{name:"RIGHT",syntax:"RIGHT(str, n)",desc:"取右边n个字符",example:"RIGHT({invoiceNo}, 4)"},{name:"LEN",syntax:"LEN(str)",desc:"字符串长度",example:"LEN({name})"},{name:"TRIM",syntax:"TRIM(str)",desc:"去除首尾空格",example:"TRIM({remark})"}]},{name:"date",label:"日期函数",functions:[{name:"NOW",syntax:"NOW()",desc:"当前日期时间",example:"NOW()"},{name:"TODAY",syntax:"TODAY()",desc:"当前日期",example:"TODAY()"},{name:"YEAR",syntax:"YEAR(date)",desc:"提取年份",example:"YEAR({date})"},{name:"MONTH",syntax:"MONTH(date)",desc:"提取月份",example:"MONTH({date})"},{name:"DAY",syntax:"DAY(date)",desc:"提取日期",example:"DAY({date})"}]},{name:"logic",label:"逻辑函数",functions:[{name:"IF",syntax:"IF(condition, trueVal, falseVal)",desc:"条件判断",example:'IF({amount} > 1000, "大额", "普通")'},{name:"IIF",syntax:"IIF(condition, trueVal, falseVal)",desc:"简化条件",example:'IIF({quantity} < 10, "低库存", "")'},{name:"ISNULL",syntax:"ISNULL(value, default)",desc:"空值处理",example:'ISNULL({remark}, "无")'}]},{name:"format",label:"格式化函数",functions:[{name:"FORMAT",syntax:"FORMAT(value, type)",desc:"格式化数值",example:'FORMAT({amount}, "currency")'},{name:"FIXED",syntax:"FIXED(value, decimals)",desc:"固定小数位",example:"FIXED({price}, 2)"},{name:"PADLEFT",syntax:"PADLEFT(str, len, char)",desc:"左侧填充",example:'PADLEFT({rowIndex}, 4, "0")'}]},{name:"finance",label:"财务函数",functions:[{name:"TOCHINESE",syntax:"TOCHINESE(amount)",desc:"金额转中文大写",example:"TOCHINESE({totalAmount})"},{name:"CURRENCY",syntax:"CURRENCY(num, symbol, decimals)",desc:"货币格式化(带千分位)",example:'CURRENCY({amount}, "¥", 2)'},{name:"DISCOUNT",syntax:"DISCOUNT(amount, rate)",desc:"计算折扣后金额(rate为百分比)",example:"DISCOUNT({amount}, 10)"},{name:"TAX",syntax:"TAX(amount, rate)",desc:"计算税额(rate为税率百分比)",example:"TAX({amount}, 13)"},{name:"WITHTAX",syntax:"WITHTAX(amount, rate)",desc:"计算含税金额",example:"WITHTAX({amount}, 13)"},{name:"EXTRACTTAX",syntax:"EXTRACTTAX(amountWithTax, rate)",desc:"从含税金额提取税额",example:"EXTRACTTAX({totalAmount}, 13)"}]}],go=({value:r,dataFields:e,onConfirm:t,onCancel:A})=>{var L;const[n,i]=ce.useState(r||""),[s,a]=ce.useState(null),[o,l]=ce.useState("data"),[u,f]=ce.useState("aggregate"),[h,c]=ce.useState(null),g=ce.useRef(null),p=ce.useCallback(S=>{const T=g.current;if(!T){i(M=>M+S),a(null);return}const _=T.selectionStart,D=T.selectionEnd,U=n,O=U.substring(0,_)+S+U.substring(D);i(O),a(null),setTimeout(()=>{T.focus();const M=_+S.length;T.setSelectionRange(M,M)},0)},[n]),y=ce.useCallback(S=>{p(`{${S}}`)},[p]),w=ce.useCallback(S=>{p(` ${S} `)},[p]),B=ce.useCallback(S=>{p(S.syntax),c(S)},[p]),x=ce.useCallback(()=>{if(!n.trim())return a({valid:!1,message:"公式不能为空"}),!1;const S=Bw(n);if(!S.valid)return a(S),!1;const T=/\{([^}]+)\}/g,_=[];let D;for(;(D=T.exec(n))!==null;)_.push(D[1]);const U=[...Sw.map(re=>re.name),...e.map(re=>re.name)],O=_.filter(re=>!U.includes(re));if(O.length>0)return a({valid:!1,message:`未知变量: ${O.join(", ")}`}),!1;const z=DU(n,{customer:"测试客户",invoiceNo:"INV001",date:"2024-01-01",totalQuantity:100,totalAmount:1e4,totalChinese:"壹万元整",remark:"测试备注",creator:"张三",reviewer:"李四",receiver:"王五",receiveDate:"2024-01-02",products:[{name:"测试产品",spec:"规格型号",unit:"个",quantity:10,price:100,amount:1e3}]},{name:"测试产品",spec:"规格型号",unit:"个",quantity:10,price:100,amount:1e3});return z.valid?(a({valid:!0,message:`校验通过,预览结果: ${z.result}`}),!0):(a({valid:!1,message:z.message}),!1)},[n,e]),E=ce.useCallback(()=>{x()&&t(n)},[n,x,t]),Q=ce.useCallback(()=>{i(""),a(null)},[]);return v.jsxs("div",{className:"formula-editor-overlay",onClick:A,children:[v.jsxs("div",{className:"formula-editor-modal",onClick:S=>S.stopPropagation(),onKeyDown:S=>S.stopPropagation(),children:[v.jsxs("div",{className:"formula-editor-header",children:[v.jsx("h3",{children:"公式编辑器"}),v.jsx("button",{className:"close-btn",onClick:A,children:"×"})]}),v.jsxs("div",{className:"formula-editor-body",children:[v.jsxs("div",{className:"formula-variables",children:[v.jsxs("div",{className:"variable-tabs",children:[v.jsx("button",{className:`tab-btn ${o==="data"?"active":""}`,onClick:()=>l("data"),children:"数据字段"}),v.jsx("button",{className:`tab-btn ${o==="system"?"active":""}`,onClick:()=>l("system"),children:"系统变量"}),v.jsx("button",{className:`tab-btn ${o==="function"?"active":""}`,onClick:()=>l("function"),children:"函数"})]}),v.jsxs("div",{className:"variable-list",children:[o==="system"&&v.jsx(v.Fragment,{children:Sw.map(S=>v.jsx("button",{className:"variable-item",onClick:()=>y(S.name),title:`插入 {${S.name}}`,children:S.label},S.name))}),o==="data"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"field-group",children:[v.jsx("div",{className:"field-group-title",children:"主表字段"}),e.filter(S=>S.source==="master").map(S=>v.jsxs("button",{className:"variable-item",onClick:()=>y(S.name),title:`插入 {${S.name}}`,children:[v.jsx("span",{className:"field-label",children:S.label}),v.jsx("span",{className:"field-name",children:S.name})]},S.name))]}),v.jsxs("div",{className:"field-group",children:[v.jsx("div",{className:"field-group-title",children:"明细字段"}),e.filter(S=>S.source==="detail").map(S=>v.jsxs("button",{className:"variable-item detail-field",onClick:()=>y(S.name),title:`插入 {${S.name}}`,children:[v.jsx("span",{className:"field-label",children:S.label}),v.jsx("span",{className:"field-name",children:S.name})]},S.name))]})]}),o==="function"&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"func-category-tabs",children:Uw.map(S=>v.jsx("button",{className:`func-cat-btn ${u===S.name?"active":""}`,onClick:()=>f(S.name),children:S.label},S.name))}),v.jsx("div",{className:"func-list",children:(L=Uw.find(S=>S.name===u))==null?void 0:L.functions.map(S=>v.jsxs("button",{className:"func-item",onClick:()=>B(S),title:S.desc,children:[v.jsx("span",{className:"func-name",children:S.name}),v.jsx("span",{className:"func-desc",children:S.desc})]},S.name))})]})]}),o!=="function"&&v.jsxs("div",{className:"operator-section",children:[v.jsx("div",{className:"section-title",children:"运算符"}),v.jsx("div",{className:"operator-list",children:qU.map(S=>v.jsx("button",{className:"operator-btn",onClick:()=>w(S.symbol),title:S.label,children:S.symbol},S.symbol))})]})]}),v.jsxs("div",{className:"formula-input-area",children:[v.jsxs("div",{className:"input-header",children:[v.jsx("span",{children:"计算公式"}),v.jsx("button",{className:"clear-btn",onClick:Q,children:"清空"})]}),v.jsx("textarea",{ref:g,className:"formula-textarea",value:n,onChange:S=>{i(S.target.value),a(null)},onKeyDown:S=>S.stopPropagation(),placeholder:`点击左侧变量插入,或直接输入公式
|
|
@@ -492,7 +492,7 @@ Minimum version required to store current data is: `+U+`.
|
|
|
492
492
|
background: #73d13d;
|
|
493
493
|
border-color: #73d13d;
|
|
494
494
|
}
|
|
495
|
-
`})]})},VU=["#000000","#333333","#666666","#999999","#CCCCCC","#FFFFFF","#FF0000","#FF6600","#FFCC00","#FFFF00","#99CC00","#00CC00","#00CCCC","#0099FF","#0066CC","#0000FF","#6600CC","#CC00CC","#FF99CC","#FFCC99","#FFFF99","#CCFF99","#99FFCC","#99FFFF"],Di=({value:r,onChange:e,disabled:t=!1,placeholder:A="选择颜色"})=>{const[n,i]=ce.useState(!1),[s,a]=ce.useState({}),o=ce.useRef(null),l=ce.useRef(null),u=ce.useRef(null);ce.useEffect(()=>{const y=w=>{o.current&&!o.current.contains(w.target)&&i(!1)};return n&&document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]),ce.useEffect(()=>{if(n&&o.current){const y=o.current.getBoundingClientRect(),w=206,B=240,x=window.innerWidth,E=window.innerHeight;let Q=0,L="100%",S="auto";y.left+w>x&&(Q=x-y.left-w-8),y.bottom+B>E&&(L="auto",S=y.height+4),a({left:Q!==0?Q:void 0,top:L==="auto"?"auto":void 0,bottom:S!=="auto"?S:void 0})}},[n]);const f=y=>{e(y),i(!1)},h=()=>{e(""),i(!1)},c=()=>{i(!1),setTimeout(()=>{var y;(y=l.current)==null||y.click()},50)},g=r||"",p=g&&g!=="transparent";return v.jsxs("div",{className:`color-picker ${t?"disabled":""}`,ref:o,children:[v.jsxs("div",{className:"color-preview-btn",onClick:()=>!t&&i(!n),title:p?g:A,children:[v.jsx("div",{className:"color-swatch",style:{backgroundColor:p?g:"transparent"},children:!p&&v.jsx("span",{className:"no-color-icon",children:"∅"})}),v.jsx("span",{className:"dropdown-arrow",children:v.jsx("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M3 5l5 6 5-6z"})})})]}),v.jsx("input",{ref:l,type:"color",value:p?g:"#000000",onChange:y=>f(y.target.value),style:{position:"absolute",opacity:0,pointerEvents:"none"}}),n&&!t&&v.jsxs("div",{className:"color-panel",ref:u,style:s,children:[v.jsxs("div",{className:"preset-colors",children:[v.jsx("div",{className:"color-item clear-color",onClick:h,title:"清除颜色",children:v.jsx("span",{className:"clear-icon",children:"∅"})}),VU.map(y=>v.jsx("div",{className:`color-item ${g.toUpperCase()===y?"active":""}`,style:{backgroundColor:y},onClick:()=>f(y),title:y},y))]}),v.jsx("div",{className:"custom-color-row",children:v.jsx("button",{type:"button",className:"btn-custom-color",onClick:c,children:"自定义颜色..."})})]})]})},zU=r=>{const e=Zs.find(t=>t.id===r);return(e==null?void 0:e.icon)||"●"},GU=r=>{switch(r){case"text":return"文本";case"multiline_text":return"多行文本";case"field":return"数据字段";case"calculated":return"计算字段";case"image":return"图片";case"line":return"线条";case"rectangle":return"矩形";case"page_number":return"页码";case"current_date":return"日期时间";default:return r}},_w=({band:r,dataFields:e,onUpdate:t,onSelectObject:A,onFocusObject:n,selectedObjectIds:i=[],focusedObjectId:s=null,onDeleteObject:a})=>{const[o,l]=ce.useState(r),[u,f]=ce.useState(!1),[h,c]=ce.useState(!1),[g,p]=ce.useState(null),[y,w]=ce.useState(null),B=ce.useRef(null),x=r.id==="detail"||r.id==="summary";ce.useEffect(()=>{l(r)},[r]);const E=(L,S)=>{const T={...o,[L]:S};l(T),t({[L]:S})},Q=r.actualBottom-r.top;return v.jsxs("div",{className:"band-property-panel",children:[v.jsxs("h3",{children:[r.name," - 带区属性"]}),v.jsxs("div",{className:"band-property-editor",children:[v.jsxs("div",{className:"band-property-group",children:[v.jsx("h4",{children:"基本信息"}),v.jsxs("div",{className:"band-property-row",children:[v.jsx("label",{children:"类型:"}),v.jsx("span",{className:"band-property-value",children:r.type})]}),v.jsxs("div",{className:"band-property-row",children:[v.jsx("label",{children:"高度:"}),v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flex:1},children:[v.jsx("input",{type:"number",value:Q,onChange:L=>{const S=parseInt(L.target.value)||20;t({actualBottom:r.top+S})},min:"20",max:"500",style:{width:"80px"}}),v.jsx("span",{style:{color:"#666",fontSize:"12px"},children:"px"}),x&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",onClick:()=>f(!0),style:{padding:"2px 6px",border:"1px solid #1890ff",borderRadius:"4px",background:r.rowHeightFormula?"#1890ff":"white",color:r.rowHeightFormula?"white":"#1890ff",cursor:"pointer",fontSize:"11px",flexShrink:0},title:r.rowHeightFormula||"设置行高公式",children:"fx"}),r.rowHeightFormula&&v.jsx("button",{type:"button",onClick:()=>E("rowHeightFormula",""),style:{padding:"2px 6px",fontSize:"12px",flexShrink:0,border:"1px solid #ddd",borderRadius:"4px",background:"white",cursor:"pointer"},title:"清除行高公式",children:"×"})]})]})]})]}),v.jsxs("div",{className:"band-property-group",children:[v.jsx("h4",{children:"外观设置"}),v.jsxs("div",{className:"band-property-row",children:[v.jsx("label",{children:"背景色:"}),v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flex:1},children:[v.jsx(Di,{value:r.backgroundColor||"",onChange:L=>E("backgroundColor",L)}),x&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",onClick:()=>c(!0),style:{padding:"2px 6px",border:"1px solid #1890ff",borderRadius:"4px",background:r.backgroundColorFormula?"#1890ff":"white",color:r.backgroundColorFormula?"white":"#1890ff",cursor:"pointer",fontSize:"11px",flexShrink:0},title:r.backgroundColorFormula||"设置背景色公式",children:"fx"}),r.backgroundColorFormula&&v.jsx("button",{type:"button",onClick:()=>E("backgroundColorFormula",""),style:{padding:"2px 6px",fontSize:"12px",flexShrink:0,border:"1px solid #ddd",borderRadius:"4px",background:"white",cursor:"pointer"},title:"清除背景色公式",children:"×"})]})]})]})]}),r.id==="summary"&&v.jsxs("div",{className:"band-property-group",children:[v.jsx("h4",{children:"汇总带设置"}),v.jsxs("div",{className:"band-property-row",children:[v.jsx("label",{children:"显示模式:"}),v.jsxs("select",{value:r.summaryDisplayMode||"atEnd",onChange:L=>E("summaryDisplayMode",L.target.value),children:[v.jsx("option",{value:"atEnd",children:"在所有明细后显示"}),v.jsx("option",{value:"perPage",children:"每页底部显示"}),v.jsx("option",{value:"perGroup",children:"每组后显示"})]})]})]}),v.jsxs("div",{className:"band-property-group control-list-group",children:[v.jsxs("h4",{children:["控件列表 (",r.objects.length,")"]}),v.jsx("div",{className:"object-list",children:r.objects.length===0?v.jsx("div",{style:{padding:"8px",color:"#999",textAlign:"center"},children:"无控件"}):[...r.objects].sort((L,S)=>(S.zIndex??1)-(L.zIndex??1)).map((L,S)=>{const T=`${r.id}-${L.id}`,_=i.includes(T),D=s===T,U=g===L.id,O=y===L.id;let M=!1,C=!1;if(L.type==="line"){const z=L,re=Math.min(z.y1??L.y,z.y2??L.y),ne=Math.max(z.y1??L.y,z.y2??L.y);M=ne<=r.top||re>=r.actualBottom,C=ne<=r.top}else{const z=L.y+L.height;M=z<=r.top||L.y>=r.actualBottom,C=z<=r.top}return v.jsxs("div",{draggable:!0,onDragStart:z=>{p(L.id),B.current={startIndex:S,currentIndex:S},z.dataTransfer.effectAllowed="move"},onDragOver:z=>{z.preventDefault(),g&&g!==L.id&&(w(L.id),B.current&&(B.current.currentIndex=S))},onDragLeave:()=>{w(null)},onDrop:z=>{if(z.preventDefault(),g&&g!==L.id&&B.current){const re=[...r.objects].sort((I,P)=>(P.zIndex??1)-(I.zIndex??1)),ne=B.current.startIndex,Z=S,[Ae]=re.splice(ne,1);re.splice(Z,0,Ae);const V=re.length,k=r.objects.map(I=>{const P=re.findIndex(K=>K.id===I.id);return{...I,zIndex:V-P}});t({objects:k})}p(null),w(null),B.current=null},onDragEnd:()=>{p(null),w(null),B.current=null},onClick:()=>n==null?void 0:n(L.id,r.id),onDoubleClick:()=>A==null?void 0:A(L.id,r.id),title:"拖动调整层级,单击聚焦,双击选中",style:{display:"flex",alignItems:"center",padding:"6px 8px",cursor:"grab",borderBottom:"1px solid #e8e8e8",backgroundColor:U?"#e6f7ff":O?"#f0f5ff":_?"#e6f7ff":D?"#f6ffed":M?"#fff2f0":"transparent",opacity:U?.5:1,borderTop:O?"2px solid #1890ff":"none",borderLeft:D?"3px solid #52c41a":_?"3px solid #1890ff":"none",transition:"background-color 0.2s"},onMouseEnter:z=>{!_&&!D&&!M&&!U&&(z.currentTarget.style.backgroundColor="#f5f5f5")},onMouseLeave:z=>{!_&&!D&&!O&&(z.currentTarget.style.backgroundColor=M?"#fff2f0":"transparent")},children:[v.jsx("span",{style:{marginRight:"6px",color:"#bbb",cursor:"grab",fontSize:"12px"},children:"≡"}),v.jsx("span",{style:{marginRight:"8px",fontSize:"14px",width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#4d90fe",color:"white",borderRadius:"4px",flexShrink:0},children:zU(L.type)}),v.jsx("span",{style:{flex:1,fontSize:"12px",color:M?"#ff4d4f":"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:L.text||L.fieldName||L.id}),v.jsxs("span",{style:{fontSize:"10px",color:"#999",marginRight:"6px",backgroundColor:"#f0f0f0",padding:"1px 4px",borderRadius:"2px"},children:["z:",L.zIndex??1]}),M&&v.jsx("span",{style:{fontSize:"10px",color:"#ff4d4f",marginRight:"4px",padding:"1px 4px",backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"2px",cursor:"pointer"},title:"点击移回带区",onClick:z=>{z.stopPropagation();const re=r.top+10,ne=r.objects.map(Z=>{if(Z.id!==L.id)return Z;if(Z.type==="line"){const Ae=Z,V=Math.min(Ae.y1??Z.y,Ae.y2??Z.y),k=re-V;return{...Z,y:re,y1:(Ae.y1??Z.y)+k,y2:(Ae.y2??Z.y)+k}}return{...Z,y:re}});t({objects:ne})},children:C?"↑":"↓"}),v.jsx("span",{style:{fontSize:"10px",color:"#999",marginRight:"6px"},children:GU(L.type)}),v.jsx("button",{onClick:z=>{if(z.stopPropagation(),a)a(L.id,r.id);else{const re=r.objects.filter(ne=>ne.id!==L.id);t({objects:re})}},title:"删除控件",style:{padding:"2px 6px",fontSize:"12px",border:"none",background:"transparent",color:"#999",cursor:"pointer",borderRadius:"2px",transition:"all 0.2s"},onMouseEnter:z=>{z.currentTarget.style.backgroundColor="#ff4d4f",z.currentTarget.style.color="white"},onMouseLeave:z=>{z.currentTarget.style.backgroundColor="transparent",z.currentTarget.style.color="#999"},children:"×"})]},L.id)})})]}),u&&v.jsx(go,{dataFields:e,value:r.rowHeightFormula||"",onConfirm:L=>{E("rowHeightFormula",L),f(!1)},onCancel:()=>f(!1)}),h&&v.jsx(go,{dataFields:e,value:r.backgroundColorFormula||"",onConfirm:L=>{E("backgroundColorFormula",L),c(!1)},onCancel:()=>c(!1)})]})]})},WU=r=>["text","field","calculated","page_number","current_date"].includes(r.type),XU=r=>["text","field","calculated","rectangle","ellipse","star","triangle","diamond","page_number","current_date"].includes(r.type),YU=r=>["text","multiline_text","field","calculated","image","line","rectangle","ellipse","star","triangle","diamond","page_number","current_date","barcode","qrcode"].includes(r.type),Iw=({value:r,onChange:e,placeholder:t="请输入内容...",minHeight:A=120})=>{const n=ce.useRef(null),i=ce.useRef(!1);ce.useEffect(()=>{n.current&&!i.current&&n.current.innerHTML!==r&&(n.current.innerHTML=r||""),i.current=!1},[r]);const s=ce.useCallback(()=>{n.current&&(i.current=!0,e(n.current.innerHTML))},[e]),a=ce.useCallback((u,f)=>{var h;document.execCommand(u,!1,f),(h=n.current)==null||h.focus(),s()},[s]),o=[{command:"bold",icon:v.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M3 2h5.5c2.5 0 4 1.5 4 3.5 0 1.2-.6 2.2-1.6 2.8 1.4.5 2.4 1.7 2.4 3.2 0 2.2-1.7 3.5-4.2 3.5H3V2zm2.5 5h2.8c1 0 1.7-.6 1.7-1.5S9.3 4 8.3 4H5.5v3zm0 5h3.2c1.1 0 1.8-.6 1.8-1.6 0-1-.7-1.6-1.8-1.6H5.5v3.2z"})}),title:"加粗"},{command:"italic",icon:v.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M6 2h6v2h-2l-2 8h2v2H4v-2h2l2-8H6V2z"})}),title:"斜体"},{command:"underline",icon:v.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M3 13h10v2H3v-2zM8 2c2.2 0 4 1.8 4 4v4c0 2.2-1.8 4-4 4s-4-1.8-4-4V6c0-2.2 1.8-4 4-4zm0 2c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2s2-.9 2-2V6c0-1.1-.9-2-2-2z"})}),title:"下划线"},{command:"strikeThrough",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("path",{fill:"currentColor",d:"M2 7h12v2H2V7z"}),v.jsx("path",{fill:"currentColor",d:"M4 3h8v2H9v2H7V5H4V3zm4 8h2v3H8v-3z"})]}),title:"删除线"},{type:"separator"},{command:"justifyLeft",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"2",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"12",width:"10",height:"2",fill:"currentColor"})]}),title:"左对齐"},{command:"justifyCenter",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"4",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"3",y:"12",width:"10",height:"2",fill:"currentColor"})]}),title:"居中"},{command:"justifyRight",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"6",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"4",y:"12",width:"10",height:"2",fill:"currentColor"})]}),title:"右对齐"},{type:"separator"},{command:"insertUnorderedList",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("circle",{cx:"3",cy:"4",r:"1.5",fill:"currentColor"}),v.jsx("rect",{x:"6",y:"3",width:"8",height:"2",fill:"currentColor"}),v.jsx("circle",{cx:"3",cy:"8",r:"1.5",fill:"currentColor"}),v.jsx("rect",{x:"6",y:"7",width:"8",height:"2",fill:"currentColor"}),v.jsx("circle",{cx:"3",cy:"12",r:"1.5",fill:"currentColor"}),v.jsx("rect",{x:"6",y:"11",width:"8",height:"2",fill:"currentColor"})]}),title:"无序列表"},{command:"insertOrderedList",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("text",{x:"1",y:"5",fontSize:"5",fill:"currentColor",fontFamily:"Arial",children:"1."}),v.jsx("rect",{x:"6",y:"3",width:"8",height:"2",fill:"currentColor"}),v.jsx("text",{x:"1",y:"9",fontSize:"5",fill:"currentColor",fontFamily:"Arial",children:"2."}),v.jsx("rect",{x:"6",y:"7",width:"8",height:"2",fill:"currentColor"}),v.jsx("text",{x:"1",y:"13",fontSize:"5",fill:"currentColor",fontFamily:"Arial",children:"3."}),v.jsx("rect",{x:"6",y:"11",width:"8",height:"2",fill:"currentColor"})]}),title:"有序列表"},{type:"separator"},{command:"removeFormat",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("path",{fill:"currentColor",d:"M2 3h12v2H2V3z"}),v.jsx("path",{fill:"currentColor",d:"M7 5h2v8H7V5z"}),v.jsx("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"M3 13l10-10"})]}),title:"清除格式"}],l=[{value:"1",label:"10px"},{value:"2",label:"12px"},{value:"3",label:"14px"},{value:"4",label:"16px"},{value:"5",label:"18px"},{value:"6",label:"24px"},{value:"7",label:"32px"}];return v.jsxs("div",{className:"rich-text-editor",children:[v.jsxs("div",{className:"rte-toolbar",children:[v.jsx("select",{className:"rte-select",onChange:u=>a("fontSize",u.target.value),defaultValue:"3",title:"字号",children:l.map(u=>v.jsx("option",{value:u.value,children:u.label},u.value))}),v.jsx(Di,{value:"#000000",onChange:u=>{u&&a("foreColor",u)}}),v.jsx("span",{className:"rte-separator"}),o.map((u,f)=>u.type==="separator"?v.jsx("span",{className:"rte-separator"},f):v.jsx("button",{type:"button",className:"rte-btn",onClick:()=>a(u.command),title:u.title,children:u.icon},u.command))]}),v.jsx("div",{ref:n,className:"rte-content",contentEditable:!0,onInput:s,onBlur:s,style:{minHeight:A},"data-placeholder":t,suppressContentEditableWarning:!0})]})},$U=Zs.reduce((r,e)=>(r[e.id]={name:e.name,icon:e.icon},r),{}),Qw=({object:r,bandId:e,dataFields:t,onUpdateBands:A,onClearSelection:n})=>{var L,S,T,_,D,U,O,M;const[i,s]=ce.useState(r),[a,o]=ce.useState(!1),[l,u]=ce.useState({});ce.useEffect(()=>{s(r)},[r]);const f=ce.useCallback(C=>{u(z=>({...z,[C]:!z[C]}))},[]),h=(C,z)=>{const re={...i,[C]:z};s(re),A(ne=>ne.map(Z=>Z.id!==e?Z:{...Z,objects:Z.objects.map(Ae=>Ae.id===r.id?{...Ae,[C]:z}:Ae)}))},c=(C,z)=>{const re={...i.border,[C]:z},ne={...i,border:re};s(ne),A(Z=>Z.map(Ae=>Ae.id!==e?Ae:{...Ae,objects:Ae.objects.map(V=>V.id===r.id?{...V,border:re}:V)}))},g=C=>{var z;return((z=i.border)==null?void 0:z[C])||""},p=()=>{window.confirm("确定要删除这个对象吗?")&&(A(C=>C.map(z=>z.id!==e?z:{...z,objects:z.objects.filter(re=>re.id!==r.id)})),n())},y=WU(r),w=XU(r),B=YU(r),x=(C,z,re,ne)=>v.jsxs("div",{className:"property-row",children:[v.jsxs("label",{children:[C,":"]}),v.jsx(Di,{value:z||"",onChange:ne})]}),E=(C,z,re)=>v.jsxs("div",{className:"property-group",children:[v.jsxs("div",{className:"property-group-header",onClick:()=>f(C),children:[v.jsx("h4",{children:z}),v.jsx("span",{className:`collapse-icon ${l[C]?"collapsed":""}`,children:v.jsx("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M3 5l5 6 5-6z"})})})]}),v.jsx("div",{className:`property-group-content ${l[C]?"collapsed":""}`,children:re})]}),Q=$U[r.type]||{name:r.type,icon:"?"};return v.jsxs("div",{className:"property-panel",children:[v.jsxs("div",{className:"property-panel-header",children:[v.jsx("div",{className:"type-icon",children:Q.icon}),v.jsxs("div",{className:"type-info",children:[v.jsx("div",{className:"type-name",children:Q.name}),v.jsxs("div",{className:"type-id",children:["ID: ",r.id]})]})]}),v.jsxs("div",{className:"property-editor",children:[E("basic","基础属性",v.jsxs(v.Fragment,{children:[r.type==="line"?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"起点 X:"}),v.jsx("input",{type:"number",value:Math.round(i.x1??i.x??0),onChange:C=>h("x1",parseInt(C.target.value)||0)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"起点 Y:"}),v.jsx("input",{type:"number",value:Math.round(i.y1??i.y??0),onChange:C=>h("y1",parseInt(C.target.value)||0)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"终点 X:"}),v.jsx("input",{type:"number",value:Math.round(i.x2??(i.x||0)+(i.width||200)),onChange:C=>h("x2",parseInt(C.target.value)||0)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"终点 Y:"}),v.jsx("input",{type:"number",value:Math.round(i.y2??i.y??0),onChange:C=>h("y2",parseInt(C.target.value)||0)})]})]}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"位置 X:"}),v.jsx("input",{type:"number",value:i.x||0,onChange:C=>h("x",parseInt(C.target.value)||0)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"位置 Y:"}),v.jsx("input",{type:"number",value:i.y||0,onChange:C=>h("y",parseInt(C.target.value)||0)})]})]}),r.type!=="line"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"宽度:"}),v.jsx("input",{type:"number",value:i.width||0,onChange:C=>h("width",parseInt(C.target.value)||0)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"高度:"}),v.jsx("input",{type:"number",value:i.height||0,onChange:C=>h("height",parseInt(C.target.value)||0)})]})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"层级:"}),v.jsx("input",{type:"number",value:i.zIndex??1,onChange:C=>h("zIndex",parseInt(C.target.value)||1),min:1})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"打印可见:"}),v.jsxs("div",{className:"checkbox-wrapper",children:[v.jsx("input",{type:"checkbox",checked:i.printVisible!==!1,onChange:C=>h("printVisible",C.target.checked)}),v.jsx("span",{className:"checkbox-label",children:i.printVisible!==!1?"打印时显示":"打印时隐藏"})]})]})]})),r.type==="text"&&E("textContent","文本内容",v.jsx(v.Fragment,{children:v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"内容:"}),v.jsx("input",{type:"text",value:i.text||"",onChange:C=>h("text",C.target.value),placeholder:"请输入文本内容"})]})})),r.type==="multiline_text"&&E("multilineContent","富文本内容",v.jsx(v.Fragment,{children:v.jsx("div",{className:"property-row",style:{flexDirection:"column",alignItems:"stretch"},children:v.jsx(Iw,{value:i.text||"",onChange:C=>h("text",C),placeholder:"请输入富文本内容...",minHeight:150})})})),r.type==="page_number"&&E("pageNumberFormat","页码格式",v.jsx(v.Fragment,{children:v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"格式:"}),v.jsx("input",{type:"text",value:i.text||"第 {page} 页 / 共 {total} 页",onChange:C=>h("text",C.target.value),placeholder:"第 {page} 页 / 共 {total} 页"})]})})),r.type==="current_date"&&E("dateFormat","日期时间格式",v.jsx(v.Fragment,{children:v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"格式:"}),v.jsx("select",{value:i.text||"yyyy-MM-dd",onChange:C=>h("text",C.target.value),children:Vv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]})})),r.type==="field"&&E("fieldData","数据字段",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"字段名:"}),v.jsx("input",{type:"text",value:i.fieldName||"",readOnly:!0,disabled:!0,title:"数据字段名不可修改"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"默认文本:"}),v.jsx("input",{type:"text",value:i.text||"",onChange:C=>h("text",C.target.value),placeholder:"无数据时显示的文本"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"格式化:"}),v.jsx("select",{value:i.formatType||"text",onChange:C=>h("formatType",C.target.value),children:eh.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),(i.formatType==="number"||i.formatType==="currency"||i.formatType==="percent")&&v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"小数位:"}),v.jsx("input",{type:"number",value:i.decimalPlaces??2,onChange:C=>h("decimalPlaces",parseInt(C.target.value)||0),min:0,max:10})]})]})),r.type==="calculated"&&E("calculatedField","计算字段",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"计算公式:"}),v.jsxs("div",{className:"formula-input-wrapper",children:[v.jsx("input",{type:"text",value:i.formula||"",readOnly:!0,placeholder:"点击编辑按钮设置公式",title:i.formula||"未设置公式"}),v.jsx("button",{type:"button",className:"btn-edit-formula",onClick:()=>o(!0),children:"编辑"})]})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"默认文本:"}),v.jsx("input",{type:"text",value:i.text||"",onChange:C=>h("text",C.target.value),placeholder:"计算失败时显示的文本"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"格式化:"}),v.jsx("select",{value:i.formatType||"number",onChange:C=>h("formatType",C.target.value),children:eh.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),(i.formatType==="number"||i.formatType==="currency"||i.formatType==="percent"||!i.formatType)&&v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"小数位:"}),v.jsx("input",{type:"number",value:i.decimalPlaces??2,onChange:C=>h("decimalPlaces",parseInt(C.target.value)||0),min:0,max:10})]})]})),a&&v.jsx(go,{dataFields:t,value:i.formula||"",onConfirm:C=>{h("formula",C),o(!1)},onCancel:()=>o(!1)}),r.type==="barcode"&&E("barcodeBinding","字段绑定",v.jsx(v.Fragment,{children:v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"绑定字段:"}),v.jsxs("select",{value:i.fieldName||"",onChange:C=>h("fieldName",C.target.value),children:[v.jsx("option",{value:"",children:"不绑定(使用静态内容)"}),v.jsx("optgroup",{label:"主表字段",children:t.filter(C=>C.source==="master").map(C=>v.jsx("option",{value:C.name,children:C.label},C.name))}),v.jsx("optgroup",{label:"明细字段",children:t.filter(C=>C.source==="detail").map(C=>v.jsx("option",{value:C.name,children:C.label},C.name))})]})]})})),r.type==="image"&&E("imageSettings","图片设置",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"本地图片:"}),v.jsxs("div",{style:{display:"flex",gap:"4px",flex:1},children:[v.jsx("input",{type:"file",accept:"image/*",style:{display:"none"},id:`image-upload-${r.id}`,onChange:C=>{var re;const z=(re=C.target.files)==null?void 0:re[0];if(z){const ne=new FileReader;ne.onload=Z=>{var V;const Ae=(V=Z.target)==null?void 0:V.result;h("src",Ae),h("imageUrl",Ae)},ne.readAsDataURL(z)}}}),v.jsx("label",{htmlFor:`image-upload-${r.id}`,style:{padding:"4px 12px",border:"1px solid #1890ff",borderRadius:"4px",background:"#1890ff",color:"white",cursor:"pointer",fontSize:"12px",whiteSpace:"nowrap"},children:"选择图片"}),(i.src||i.imageUrl)&&v.jsx("button",{type:"button",onClick:()=>{h("src",""),h("imageUrl","")},style:{padding:"4px 8px",border:"1px solid #ff4d4f",borderRadius:"4px",background:"#fff",color:"#ff4d4f",cursor:"pointer",fontSize:"12px"},children:"清除"})]})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"图片地址:"}),v.jsx("input",{type:"text",value:(i.src||i.imageUrl||"").slice(0,50)+((i.src||i.imageUrl||"").length>50?"...":""),onChange:C=>{h("src",C.target.value),h("imageUrl",C.target.value)},placeholder:"输入URL或选择本地图片",title:i.src||i.imageUrl||""})]}),(i.src||i.imageUrl)&&v.jsxs("div",{className:"property-row",style:{flexDirection:"column",alignItems:"flex-start"},children:[v.jsx("label",{children:"预览:"}),v.jsx("div",{style:{width:"100%",height:"80px",border:"1px solid #d9d9d9",borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",background:"#f5f5f5"},children:v.jsx("img",{src:i.src||i.imageUrl,alt:"预览",style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"替代文本:"}),v.jsx("input",{type:"text",value:i.alt||"",onChange:C=>h("alt",C.target.value),placeholder:"图片加载失败时显示"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"显示方式:"}),v.jsx("select",{value:i.objectFit||"contain",onChange:C=>h("objectFit",C.target.value),children:zv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"内边距:"}),v.jsxs("div",{className:"padding-inputs",children:[v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"上"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((L=i.padding)==null?void 0:L.top)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,top:z}):h("padding",{top:z,right:z,bottom:z,left:z})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"右"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((S=i.padding)==null?void 0:S.right)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,right:z}):h("padding",{top:i.padding||0,right:z,bottom:i.padding||0,left:i.padding||0})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"下"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((T=i.padding)==null?void 0:T.bottom)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,bottom:z}):h("padding",{top:i.padding||0,right:i.padding||0,bottom:z,left:i.padding||0})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"左"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((_=i.padding)==null?void 0:_.left)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,left:z}):h("padding",{top:i.padding||0,right:i.padding||0,bottom:i.padding||0,left:z})},min:0,max:50})]})]})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"浮动图片:"}),v.jsxs("div",{className:"checkbox-wrapper",children:[v.jsx("input",{type:"checkbox",checked:i.floating===!0,onChange:C=>h("floating",C.target.checked)}),v.jsx("span",{className:"checkbox-label",children:i.floating?"以页面为基准定位":"以带区为基准定位"})]})]})]})),r.type==="barcode"&&E("barcodeSettings","条码设置",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"条码内容:"}),v.jsx("input",{type:"text",value:i.text||"",onChange:C=>h("text",C.target.value),placeholder:"输入条码内容"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"条码类型:"}),v.jsx("select",{value:i.barcodeType||"CODE128",onChange:C=>h("barcodeType",C.target.value),children:Gv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"显示文字:"}),v.jsxs("div",{className:"checkbox-wrapper",children:[v.jsx("input",{type:"checkbox",checked:i.showText!==!1,onChange:C=>h("showText",C.target.checked)}),v.jsx("span",{className:"checkbox-label",children:i.showText!==!1?"显示":"隐藏"})]})]}),x("条码颜色",i.lineColor,"#000000",C=>h("lineColor",C)),x("背景色",i.background,"#FFFFFF",C=>h("background",C))]})),r.type==="qrcode"&&E("qrcodeSettings","二维码设置",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"二维码内容:"}),v.jsx("input",{type:"text",value:i.text||"",onChange:C=>h("text",C.target.value),placeholder:"输入二维码内容"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"容错级别:"}),v.jsx("select",{value:i.errorLevel||"M",onChange:C=>h("errorLevel",C.target.value),children:Wv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),x("前景色",i.foreground,"#000000",C=>h("foreground",C)),x("背景色",i.background,"#FFFFFF",C=>h("background",C))]})),r.type==="line"&&E("lineStyle","线条样式",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"粗细:"}),v.jsx("input",{type:"number",value:i.strokeWidth||1,onChange:C=>h("strokeWidth",Math.max(1,parseInt(C.target.value)||1)),min:1,max:20})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"线段样式:"}),v.jsx("select",{value:i.lineStyle||"solid",onChange:C=>h("lineStyle",C.target.value),children:Xv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),x("线条颜色",i.color,"#000000",C=>h("color",C))]})),y&&E("textStyle","外观样式",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"字体大小:"}),v.jsx("input",{type:"number",value:i.fontSize||12,onChange:C=>h("fontSize",parseInt(C.target.value)||12),min:8,max:72})]}),x("文字颜色",i.color,"#000000",C=>h("color",C)),x("背景色",i.background,"#ffffff",C=>h("background",C)),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"字体粗细:"}),v.jsx("select",{value:i.fontWeight||"normal",onChange:C=>h("fontWeight",C.target.value),children:Kv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"字体样式:"}),v.jsx("select",{value:i.fontStyle||"normal",onChange:C=>h("fontStyle",C.target.value),children:qv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"行高:"}),v.jsx("input",{type:"number",value:i.lineHeight||1.2,onChange:C=>h("lineHeight",parseFloat(C.target.value)||1.2),step:.1,min:.5,max:3})]})]})),y&&E("alignment","对齐方式",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"水平对齐:"}),v.jsxs("div",{className:"alignment-buttons",children:[v.jsx("button",{type:"button",className:`alignment-btn ${i.textAlign==="left"||!i.textAlign?"active":""}`,onClick:()=>h("textAlign","left"),title:"左对齐",children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"2",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"12",width:"10",height:"2",fill:"currentColor"})]})}),v.jsx("button",{type:"button",className:`alignment-btn ${i.textAlign==="center"?"active":""}`,onClick:()=>h("textAlign","center"),title:"居中对齐",children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"4",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"3",y:"12",width:"10",height:"2",fill:"currentColor"})]})}),v.jsx("button",{type:"button",className:`alignment-btn ${i.textAlign==="right"?"active":""}`,onClick:()=>h("textAlign","right"),title:"右对齐",children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"6",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"4",y:"12",width:"10",height:"2",fill:"currentColor"})]})})]})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"垂直对齐:"}),v.jsx("select",{value:i.textVerticalAlign||"top",onChange:C=>h("textVerticalAlign",C.target.value),children:jv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]})]})),w&&!y&&E("background","外观样式",v.jsx(v.Fragment,{children:x("背景色",i.background,"#ffffff",C=>h("background",C))})),B&&r.type!=="line"&&E("border","边框边距",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"边框宽度:"}),v.jsx("input",{type:"number",value:g("width")||0,onChange:C=>c("width",parseInt(C.target.value)||0),min:0,max:10})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"边框样式:"}),v.jsx("select",{value:g("style")||"solid",onChange:C=>c("style",C.target.value),children:Hv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"边框颜色:"}),v.jsx(Di,{value:g("color")||"",onChange:C=>c("color",C)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"内边距:"}),v.jsxs("div",{className:"padding-inputs",children:[v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"上"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((D=i.padding)==null?void 0:D.top)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,top:z}):h("padding",{top:z,right:z,bottom:z,left:z})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"右"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((U=i.padding)==null?void 0:U.right)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,right:z}):h("padding",{top:i.padding||0,right:z,bottom:i.padding||0,left:i.padding||0})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"下"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((O=i.padding)==null?void 0:O.bottom)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,bottom:z}):h("padding",{top:i.padding||0,right:i.padding||0,bottom:z,left:i.padding||0})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"左"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((M=i.padding)==null?void 0:M.left)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,left:z}):h("padding",{top:i.padding||0,right:i.padding||0,bottom:i.padding||0,left:z})},min:0,max:50})]})]})]})]})),r.type==="rectangle"&&E("rectangleStyle","矩形样式",v.jsx(v.Fragment,{children:v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"圆角:"}),v.jsx("input",{type:"number",value:i.borderRadius||0,onChange:C=>h("borderRadius",parseInt(C.target.value)||0),min:0,max:100})]})})),v.jsx("div",{className:"property-actions",children:v.jsx("button",{className:"btn btn-danger",onClick:p,children:"删除对象"})})]})]})},ki=r=>{const e=r,t=2;if(r.type==="line"){const i=r,s=i.x1??r.x,a=i.y1??r.y,o=i.x2??r.x+r.width,l=i.y2??r.y,u=Math.min(s,o),f=Math.min(a,l),h=Math.max(s,o),c=Math.max(a,l);return{x:u,y:f,width:h-u||1,height:c-f||1,extra:0,borderWidth:0,padding:0}}let A=0;e.border&&e.border.style!=="none"&&e.border.width?A=e.border.width:e.border||(r.type==="field"||r.type==="rectangle")&&(A=1);const n=A+t;return{x:r.x,y:r.y,width:r.width+n*2,height:r.height+n*2,extra:n,borderWidth:A,padding:t}},JU=({selectedObjectIds:r,bands:e,onUpdateObjects:t,onUndo:A,onRedo:n,canUndo:i,canRedo:s,onSave:a,onPreview:o,showGrid:l,showRulers:u,showPageMargins:f,onToggleGrid:h,onToggleRulers:c,onTogglePageMargins:g,onPageSettings:p,onAddControl:y,onAddFields:w,selectedBandId:B,dataFields:x})=>{var Re,Ee,Ve,Me,ze,Ye,xe,Oe,je;const[E,Q]=ce.useState(!1),[L,S]=ce.useState({top:0,left:0}),T=ce.useRef(null),_=ce.useRef(null),[D,U]=ce.useState(!1),[O,M]=ce.useState([]),[C,z]=ce.useState("horizontal");ce.useEffect(()=>{const ge=Pe=>{T.current&&!T.current.contains(Pe.target)&&Q(!1)};return E&&document.addEventListener("mousedown",ge),()=>document.removeEventListener("mousedown",ge)},[E]);const re=ce.useCallback(()=>{if(!E&&_.current){const ge=_.current.getBoundingClientRect();S({top:ge.bottom+4,left:ge.left})}Q(!E)},[E]),ne=ce.useMemo(()=>{const ge={basic:[],system:[],decorator:[]};return Zs.forEach(Pe=>{Pe.id==="calculated"?ge.basic.push(Pe):Pe.category==="field"||ge[Pe.category]&&ge[Pe.category].push(Pe)}),ge},[]),Z=ce.useMemo(()=>{const ge=x.filter(Te=>Te.source==="master"),Pe=x.filter(Te=>Te.source==="detail");return{master:ge,detail:Pe}},[x]),Ae=ce.useCallback(ge=>{y(ge),Q(!1)},[y]),V=ce.useCallback(ge=>{M(Pe=>Pe.find(ue=>ue.name===ge.name)?Pe.filter(ue=>ue.name!==ge.name):[...Pe,ge])},[]),k=ce.useCallback(()=>{O.length>0&&w(O,C),U(!1),M([])},[O,C,w]),I=ce.useCallback(()=>{U(!1),M([])},[]),P=ce.useMemo(()=>{const ge=[];return r.forEach(Pe=>{const[Te,ue]=Pe.split("-"),fe=e.find(Fe=>Fe.id===Te),Le=fe==null?void 0:fe.objects.find(Fe=>Fe.id===ue);Le&&fe&&ge.push({object:Le,bandId:Te})}),ge},[r,e]),K=ce.useMemo(()=>{const ge=["text","field","calculated","page_number","current_date"];return P.every(({object:Pe})=>ge.includes(Pe.type))},[P]),Y=ce.useCallback(ge=>{if(P.length===0)return;const Te=P[0].object[ge];return P.every(({object:fe})=>fe[ge]===Te)?Te:void 0},[P]),J=ce.useCallback(ge=>{if(P.length<2)return;const Pe=P[0].object,Te=ki(Pe),ue=[];P.slice(1).forEach(({object:fe,bandId:Le})=>{const Fe=ki(fe),Ne={};if(fe.type==="line"){const ve=fe,Qe=ve.x1??fe.x,De=ve.y1??fe.y,it=ve.x2??fe.x+fe.width,et=ve.y2??fe.y;let Ge=0,At=0;switch(ge){case"left":Ge=Te.x-Fe.x;break;case"right":Ge=Te.x+Te.width-(Fe.x+Fe.width);break;case"top":At=Te.y-Fe.y;break;case"bottom":At=Te.y+Te.height-(Fe.y+Fe.height);break;case"horizontal-center":Ge=Te.x+Te.width/2-(Fe.x+Fe.width/2);break;case"vertical-center":At=Te.y+Te.height/2-(Fe.y+Fe.height/2);break}Ne.x1=Qe+Ge,Ne.y1=De+At,Ne.x2=it+Ge,Ne.y2=et+At,Ne.x=fe.x+Ge,Ne.y=fe.y+At}else switch(ge){case"left":Ne.x=Te.x;break;case"right":Ne.x=Te.x+Te.width-Fe.width;break;case"top":Ne.y=Te.y;break;case"bottom":Ne.y=Te.y+Te.height-Fe.height;break;case"horizontal-center":Ne.x=Te.x+(Te.width-Fe.width)/2;break;case"vertical-center":Ne.y=Te.y+(Te.height-Fe.height)/2;break}ue.push({bandId:Le,objectId:fe.id,changes:Ne})}),t(ue)},[P,t]),q=ce.useCallback(ge=>{if(P.length<3)return;const Pe=[...P].sort((De,it)=>ge==="horizontal"?De.object.x-it.object.x:De.object.y-it.object.y),Te=Pe[0].object,ue=Pe[Pe.length-1].object,fe=ki(ue);let Le,Fe=0;ge==="horizontal"?(Le=ue.x+fe.width-Te.x,Pe.forEach(({object:De})=>{Fe+=ki(De).width})):(Le=ue.y+fe.height-Te.y,Pe.forEach(({object:De})=>{Fe+=ki(De).height}));const Ne=(Le-Fe)/(Pe.length-1),ve=[];let Qe=ge==="horizontal"?Te.x:Te.y;Pe.forEach(({object:De,bandId:it},et)=>{const Ge=ki(De);if(et===0){Qe+=ge==="horizontal"?Ge.width:Ge.height;return}const At={};ge==="horizontal"?(At.x=Qe+Ne,Qe=At.x+Ge.width):(At.y=Qe+Ne,Qe=At.y+Ge.height),ve.push({bandId:it,objectId:De.id,changes:At})}),t(ve)},[P,t]),W=ce.useCallback(ge=>{if(P.length<2)return;const Pe=P[0].object,Te=ki(Pe),ue=[],fe=Pe.type==="line";let Le=0;if(fe){const Fe=Pe,Ne=Fe.x1??Pe.x,ve=Fe.y1??Pe.y,Qe=Fe.x2??Pe.x+Pe.width,De=Fe.y2??Pe.y;Ne===Qe?Le=Math.abs(De-ve):ve===De?Le=Math.abs(Qe-Ne):Le=Math.sqrt(Math.pow(Qe-Ne,2)+Math.pow(De-ve,2))}P.slice(1).forEach(({object:Fe,bandId:Ne})=>{const ve={};if(Fe.type==="line"){const De=Fe,it=De.x1??Fe.x,et=De.y1??Fe.y,Ge=De.x2??Fe.x+Fe.width,At=De.y2??Fe.y,nt=it===Ge,tt=et===At;if(fe){if(nt&&(ge==="height"||ge==="both")){const lt=Math.abs(At-et),ur=Le-lt;At>=et?ve.y2=At+ur:ve.y2=At-ur}else if(tt&&(ge==="width"||ge==="both")){const lt=Math.abs(Ge-it),ur=Le-lt;Ge>=it?ve.x2=Ge+ur:ve.x2=Ge-ur}}else if(nt&&(ge==="height"||ge==="both")){const lt=Te.height-Math.abs(At-et);At>=et?ve.y2=At+lt:ve.y2=At-lt}else if(tt&&(ge==="width"||ge==="both")){const lt=Te.width-Math.abs(Ge-it);Ge>=it?ve.x2=Ge+lt:ve.x2=Ge-lt}Object.keys(ve).length>0&&ue.push({bandId:Ne,objectId:Fe.id,changes:ve});return}const Qe=ki(Fe);(ge==="width"||ge==="both")&&(ve.width=Te.width-Qe.extra*2),(ge==="height"||ge==="both")&&(ve.height=Te.height-Qe.extra*2),ue.push({bandId:Ne,objectId:Fe.id,changes:ve})}),ue.length>0&&t(ue)},[P,t]),te=ce.useCallback((ge,Pe)=>{const Te=P.map(({object:ue,bandId:fe})=>({bandId:fe,objectId:ue.id,changes:{[ge]:Pe}}));t(Te)},[P,t]),oe=ce.useCallback((ge,Pe)=>{const Te=P.map(({object:ue,bandId:fe})=>{const Le=ue;return{bandId:fe,objectId:ue.id,changes:{border:{...Le.border,[ge]:Pe}}}});t(Te)},[P,t]),we=r.length>=2,le=r.length>=3,Be=r.length>=1,ye=Y("fontSize"),R=Y("color"),Ie=Y("background"),Ue=Y("textAlign");return v.jsxs("div",{className:"multi-select-toolbar",children:[v.jsx("div",{className:"toolbar-section",children:v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:"toolbar-btn btn-primary",onClick:a,title:"保存 (Ctrl+S)",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:o,title:"打印预览 (Ctrl+P)",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"})})})]})}),v.jsx("div",{className:"toolbar-section",children:v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:"toolbar-btn",onClick:A,title:"撤销 (Ctrl+Z)",disabled:!i,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:n,title:"恢复 (Ctrl+Shift+Z)",disabled:!s,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"})})})]})}),v.jsxs("div",{className:"toolbar-section",ref:T,children:[v.jsx("div",{className:"toolbar-buttons",children:v.jsxs("button",{ref:_,className:`toolbar-btn toolbar-dropdown-btn ${E?"active":""}`,onClick:re,title:"添加控件",disabled:!B,children:[v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})}),v.jsx("span",{className:"dropdown-arrow",children:"▼"})]})}),E&&v.jsxs("div",{className:"toolbar-dropdown-menu control-dropdown",style:{top:L.top,left:L.left},children:[v.jsxs("div",{className:"dropdown-category",children:[v.jsx("div",{className:"category-title",children:"基础控件"}),ne.basic.map(ge=>v.jsxs("div",{className:"dropdown-item",onClick:()=>Ae(ge.id),children:[v.jsx("span",{className:"item-icon",children:ge.icon}),v.jsx("span",{className:"item-name",children:ge.name})]},ge.id))]}),v.jsx("div",{className:"dropdown-divider"}),v.jsxs("div",{className:"dropdown-category",children:[v.jsx("div",{className:"category-title",children:"系统控件"}),ne.system.map(ge=>v.jsxs("div",{className:"dropdown-item",onClick:()=>Ae(ge.id),children:[v.jsx("span",{className:"item-icon",children:ge.icon}),v.jsx("span",{className:"item-name",children:ge.name})]},ge.id))]}),v.jsx("div",{className:"dropdown-divider"}),v.jsxs("div",{className:"dropdown-category",children:[v.jsx("div",{className:"category-title",children:"装饰控件"}),ne.decorator.map(ge=>v.jsxs("div",{className:"dropdown-item",onClick:()=>Ae(ge.id),children:[v.jsx("span",{className:"item-icon",children:ge.icon}),v.jsx("span",{className:"item-name",children:ge.name})]},ge.id))]})]})]}),v.jsx("div",{className:"toolbar-section",children:v.jsx("div",{className:"toolbar-buttons",children:v.jsxs("button",{className:"toolbar-btn",onClick:()=>U(!0),title:"插入数据字段",disabled:!B,children:[v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 9h-2v2H9v-2H7v-2h2V7h2v2h2v2zm0-6V3.5L18.5 9H13z"})}),v.jsx("span",{style:{marginLeft:4,fontSize:11},children:"字段"})]})})}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"对齐"}),v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:"toolbar-btn",onClick:()=>J("left"),title:"左对齐(以第一个选中的对象为参照)",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M4 22V2h2v20H4zm4-17v4h12V5H8zm0 14h8v-4H8v4z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>J("horizontal-center"),title:"水平居中对齐",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M11 2h2v5h6v4h-6v2h4v4h-4v5h-2v-5H7v-4h4v-2H5V7h6V2z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>J("right"),title:"右对齐",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M18 22V2h2v20h-2zM4 5v4h12V5H4zm4 14h8v-4H8v4z"})})}),v.jsx("span",{className:"separator"}),v.jsx("button",{className:"toolbar-btn",onClick:()=>J("top"),title:"顶部对齐",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M2 4h20v2H2V4zm3 4h4v12H5V8zm10 0h4v8h-4V8z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>J("vertical-center"),title:"垂直居中对齐",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M2 11h5V5h4v6h2V7h4v4h5v2h-5v4h-4v-4h-2v6H7v-6H2v-2z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>J("bottom"),title:"底部对齐",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M2 18h20v2H2v-2zM5 4h4v12H5V4zm10 4h4v8h-4V8z"})})})]})]}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"分布"}),v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:"toolbar-btn",onClick:()=>q("horizontal"),title:"水平均匀分布",disabled:!le,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M4 5v14h2V5H4zm14 0v14h2V5h-2zM9 7h2v10H9V7zm4 2h2v6h-2V9z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>q("vertical"),title:"垂直均匀分布",disabled:!le,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M5 4h14v2H5V4zm0 14h14v2H5v-2zm2-11h10v2H7V7zm2 4h6v2H9v-2z"})})})]})]}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"尺寸"}),v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:"toolbar-btn",onClick:()=>W("width"),title:"相同宽度",disabled:!we,children:v.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[v.jsx("path",{fill:"currentColor",d:"M4 9h16v2H4V9zm0 4h16v2H4v-2z"}),v.jsx("path",{fill:"currentColor",d:"M7 6l-3 3 3 3V6zm10 0v6l3-3-3-3z"})]})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>W("height"),title:"相同高度",disabled:!we,children:v.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[v.jsx("path",{fill:"currentColor",d:"M9 4v16h2V4H9zm4 0v16h2V4h-2z"}),v.jsx("path",{fill:"currentColor",d:"M6 7l3-3 3 3H6zm0 10h6l-3 3-3-3z"})]})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>W("both"),title:"相同尺寸",disabled:!we,children:v.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[v.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"2"}),v.jsx("path",{fill:"currentColor",d:"M8 11h8v2H8z"}),v.jsx("path",{fill:"currentColor",d:"M11 8v8h2V8z"})]})})]})]}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"文本"}),v.jsxs("div",{className:"toolbar-controls",children:[v.jsxs("label",{className:"toolbar-control-item",title:"字体大小",children:[v.jsx("span",{children:"大小"}),v.jsx("input",{type:"number",value:ye??"",placeholder:"-",min:8,max:72,onChange:ge=>te("fontSize",parseInt(ge.target.value)||12),disabled:!Be||!K})]}),v.jsxs("div",{className:"toolbar-control-item",title:"文字颜色",children:[v.jsx("span",{children:"颜色"}),v.jsx(Di,{value:R||"",onChange:ge=>te("color",ge),disabled:!Be||!K})]}),v.jsxs("div",{className:"toolbar-control-item",title:"背景颜色",children:[v.jsx("span",{children:"背景"}),v.jsx(Di,{value:Ie||"",onChange:ge=>te("background",ge),disabled:!Be||!K})]})]}),v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:`toolbar-btn ${Ue==="left"?"active":""}`,onClick:()=>te("textAlign","left"),title:"左对齐",disabled:!Be||!K,children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"2",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"12",width:"10",height:"2",fill:"currentColor"})]})}),v.jsx("button",{className:`toolbar-btn ${Ue==="center"?"active":""}`,onClick:()=>te("textAlign","center"),title:"居中",disabled:!Be||!K,children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"4",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"3",y:"12",width:"10",height:"2",fill:"currentColor"})]})}),v.jsx("button",{className:`toolbar-btn ${Ue==="right"?"active":""}`,onClick:()=>te("textAlign","right"),title:"右对齐",disabled:!Be||!K,children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"6",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"4",y:"12",width:"10",height:"2",fill:"currentColor"})]})})]})]}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"边框"}),v.jsxs("div",{className:"toolbar-controls",children:[v.jsxs("label",{className:"toolbar-control-item",title:"边框宽度",children:[v.jsx("span",{children:"宽度"}),v.jsxs("select",{value:((Ve=(Ee=(Re=P[0])==null?void 0:Re.object)==null?void 0:Ee.border)==null?void 0:Ve.width)??0,onChange:ge=>oe("width",parseInt(ge.target.value)),disabled:!Be,children:[v.jsx("option",{value:0,children:"无"}),v.jsx("option",{value:1,children:"1px"}),v.jsx("option",{value:2,children:"2px"}),v.jsx("option",{value:3,children:"3px"})]})]}),v.jsxs("label",{className:"toolbar-control-item",title:"边框样式",children:[v.jsx("span",{children:"样式"}),v.jsxs("select",{value:((Ye=(ze=(Me=P[0])==null?void 0:Me.object)==null?void 0:ze.border)==null?void 0:Ye.style)??"solid",onChange:ge=>oe("style",ge.target.value),disabled:!Be,children:[v.jsx("option",{value:"solid",children:"实线"}),v.jsx("option",{value:"dashed",children:"虚线"}),v.jsx("option",{value:"dotted",children:"点线"})]})]}),v.jsxs("div",{className:"toolbar-control-item",title:"边框颜色",children:[v.jsx("span",{children:"颜色"}),v.jsx(Di,{value:((je=(Oe=(xe=P[0])==null?void 0:xe.object)==null?void 0:Oe.border)==null?void 0:je.color)||"",onChange:ge=>oe("color",ge),disabled:!Be})]})]})]}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"显示"}),v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:`toolbar-btn ${l?"active":""}`,onClick:h,title:"显示网格",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"})})}),v.jsx("button",{className:`toolbar-btn ${u?"active":""}`,onClick:c,title:"显示标尺",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h2v4h2V8h2v4h2V8h2v4h2V8h2v4h2V8h2v8z"})})}),v.jsx("button",{className:`toolbar-btn ${f?"active":""}`,onClick:g,title:"显示边距",children:v.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[v.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",d:"M3 3h18v18H3z"}),v.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 2",d:"M6 6h12v12H6z"})]})}),v.jsx("button",{className:"toolbar-btn",onClick:p,title:"页面设置",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})})})]})]}),D&&v.jsx("div",{className:"field-modal-overlay",onClick:I,children:v.jsxs("div",{className:"field-modal",onClick:ge=>ge.stopPropagation(),children:[v.jsxs("div",{className:"field-modal-header",children:[v.jsx("h3",{children:"选择数据字段"}),v.jsx("button",{className:"modal-close-btn",onClick:I,children:"×"})]}),v.jsxs("div",{className:"field-modal-body",children:[v.jsxs("div",{className:"field-group",children:[v.jsx("div",{className:"field-group-title",children:"主表字段"}),v.jsx("div",{className:"field-list",children:Z.master.map(ge=>v.jsxs("label",{className:`field-item ${O.find(Pe=>Pe.name===ge.name)?"selected":""}`,children:[v.jsx("input",{type:"checkbox",checked:!!O.find(Pe=>Pe.name===ge.name),onChange:()=>V(ge)}),v.jsx("span",{className:"field-label",children:ge.label}),v.jsx("span",{className:"field-name",children:ge.name})]},ge.name))})]}),v.jsxs("div",{className:"field-group",children:[v.jsx("div",{className:"field-group-title",children:"明细字段"}),v.jsx("div",{className:"field-list",children:Z.detail.map(ge=>v.jsxs("label",{className:`field-item ${O.find(Pe=>Pe.name===ge.name)?"selected":""}`,children:[v.jsx("input",{type:"checkbox",checked:!!O.find(Pe=>Pe.name===ge.name),onChange:()=>V(ge)}),v.jsx("span",{className:"field-label",children:ge.label}),v.jsx("span",{className:"field-name",children:ge.name})]},ge.name))})]})]}),v.jsxs("div",{className:"field-modal-footer",children:[v.jsxs("div",{className:"arrangement-options",children:[v.jsx("span",{children:"排列方式:"}),v.jsxs("label",{children:[v.jsx("input",{type:"radio",name:"arrangement",checked:C==="horizontal",onChange:()=>z("horizontal")}),"横向"]}),v.jsxs("label",{children:[v.jsx("input",{type:"radio",name:"arrangement",checked:C==="vertical",onChange:()=>z("vertical")}),"纵向"]})]}),v.jsxs("div",{className:"modal-buttons",children:[v.jsx("button",{className:"btn btn-cancel",onClick:I,children:"取消"}),v.jsxs("button",{className:"btn btn-confirm",onClick:k,disabled:O.length===0,children:["插入 (",O.length,")"]})]})]})]})})]})};class iA{static setDPI(e){this.currentDPI=e,this.units.px.conversionFactor=25.4/e}static getDPI(){return this.currentDPI}static toMm(e,t){const A=this.units[t];return A?e*A.conversionFactor:e}static fromMm(e,t){const A=this.units[t];return A?e/A.conversionFactor:e}static convert(e,t,A){const n=this.toMm(e,t);return this.fromMm(n,A)}static toPx(e,t,A=1){return this.toMm(e,t)/this.units.px.conversionFactor*A}static fromPx(e,t,A=1){const i=e/A*this.units.px.conversionFactor;return this.fromMm(i,t)}static format(e,t){var n;const A=((n=this.units[t])==null?void 0:n.precision)||2;return`${e.toFixed(A)}${t}`}static convertMargins(e,t="mm",A="px",n=1){const i={};return e.top!==void 0&&(i.top=this.toPx(e.top,t,n)),e.bottom!==void 0&&(i.bottom=this.toPx(e.bottom,t,n)),e.left!==void 0&&(i.left=this.toPx(e.left,t,n)),e.right!==void 0&&(i.right=this.toPx(e.right,t,n)),i}static getContentArea(e,t,A="mm",n="px",i=1){if(!e||!e.width||!e.height)throw new Error("Page size must have width and height properties");const s=this.convertMargins(t,A,"px",i),a=this.toPx(e.width,A,i),o=this.toPx(e.height,A,i),l=a-(s.left||0)-(s.right||0),u=o-(s.top||0)-(s.bottom||0);return n==="px"?{width:l,height:u,margins:s,pageSize:{width:a,height:o}}:{width:this.fromPx(l,n,i),height:this.fromPx(u,n,i),margins:this.convertMargins(t,A,n),pageSize:{width:this.fromPx(a,n,i),height:this.fromPx(o,n,i)}}}static debugInfo(){return{dpi:this.currentDPI,pxConversionFactor:this.units.px.conversionFactor,sample:{"10mm_to_px":this.toPx(10,"mm"),"100px_to_mm":this.fromPx(100,"mm")}}}}Ht(iA,"currentDPI",96),Ht(iA,"units",{mm:{name:"mm",conversionFactor:1,precision:2},cm:{name:"cm",conversionFactor:10,precision:2},inch:{name:"inch",conversionFactor:25.4,precision:3},px:{name:"px",conversionFactor:25.4/96,precision:2}});function Dt(r){"@babel/helpers - typeof";return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dt(r)}var bn=Uint8Array,XA=Uint16Array,Kh=Int32Array,qh=new bn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Vh=new bn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Nw=new bn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ow=function(r,e){for(var t=new XA(31),A=0;A<31;++A)t[A]=e+=1<<r[A-1];for(var n=new Kh(t[30]),A=1;A<30;++A)for(var i=t[A];i<t[A+1];++i)n[i]=i-t[A]<<5|A;return{b:t,r:n}},Tw=Ow(qh,2),ZU=Tw.b,zh=Tw.r;ZU[28]=258,zh[258]=28;for(var e_=Ow(Vh,0),Lw=e_.r,Gh=new XA(32768),Ar=0;Ar<32768;++Ar){var Hi=(Ar&43690)>>1|(Ar&21845)<<1;Hi=(Hi&52428)>>2|(Hi&13107)<<2,Hi=(Hi&61680)>>4|(Hi&3855)<<4,Gh[Ar]=((Hi&65280)>>8|(Hi&255)<<8)>>1}for(var po=(function(r,e,t){for(var A=r.length,n=0,i=new XA(e);n<A;++n)r[n]&&++i[r[n]-1];var s=new XA(e);for(n=1;n<e;++n)s[n]=s[n-1]+i[n-1]<<1;var a;if(t){a=new XA(1<<e);var o=15-e;for(n=0;n<A;++n)if(r[n])for(var l=n<<4|r[n],u=e-r[n],f=s[r[n]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)a[Gh[f]>>o]=l}else for(a=new XA(A),n=0;n<A;++n)r[n]&&(a[n]=Gh[s[r[n]-1]++]>>15-r[n]);return a}),Ca=new bn(288),Ar=0;Ar<144;++Ar)Ca[Ar]=8;for(var Ar=144;Ar<256;++Ar)Ca[Ar]=9;for(var Ar=256;Ar<280;++Ar)Ca[Ar]=7;for(var Ar=280;Ar<288;++Ar)Ca[Ar]=8;for(var Ou=new bn(32),Ar=0;Ar<32;++Ar)Ou[Ar]=5;var t_=po(Ca,9,0),r_=po(Ou,5,0),Pw=function(r){return(r+7)/8|0},A_=function(r,e,t){return(t==null||t>r.length)&&(t=r.length),new bn(r.subarray(e,t))},oi=function(r,e,t){t<<=e&7;var A=e/8|0;r[A]|=t,r[A+1]|=t>>8},vo=function(r,e,t){t<<=e&7;var A=e/8|0;r[A]|=t,r[A+1]|=t>>8,r[A+2]|=t>>16},Wh=function(r,e){for(var t=[],A=0;A<r.length;++A)r[A]&&t.push({s:A,f:r[A]});var n=t.length,i=t.slice();if(!n)return{t:kw,l:0};if(n==1){var s=new bn(t[0].s+1);return s[t[0].s]=1,{t:s,l:1}}t.sort(function(Q,L){return Q.f-L.f}),t.push({s:-1,f:25001});var a=t[0],o=t[1],l=0,u=1,f=2;for(t[0]={s:-1,f:a.f+o.f,l:a,r:o};u!=n-1;)a=t[t[l].f<t[f].f?l++:f++],o=t[l!=u&&t[l].f<t[f].f?l++:f++],t[u++]={s:-1,f:a.f+o.f,l:a,r:o};for(var h=i[0].s,A=1;A<n;++A)i[A].s>h&&(h=i[A].s);var c=new XA(h+1),g=Xh(t[u-1],c,0);if(g>e){var A=0,p=0,y=g-e,w=1<<y;for(i.sort(function(L,S){return c[S.s]-c[L.s]||L.f-S.f});A<n;++A){var B=i[A].s;if(c[B]>e)p+=w-(1<<g-c[B]),c[B]=e;else break}for(p>>=y;p>0;){var x=i[A].s;c[x]<e?p-=1<<e-c[x]++-1:++A}for(;A>=0&&p;--A){var E=i[A].s;c[E]==e&&(--c[E],++p)}g=e}return{t:new bn(c),l:g}},Xh=function(r,e,t){return r.s==-1?Math.max(Xh(r.l,e,t+1),Xh(r.r,e,t+1)):e[r.s]=t},Rw=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new XA(++e),A=0,n=r[0],i=1,s=function(o){t[A++]=o},a=1;a<=e;++a)if(r[a]==n&&a!=e)++i;else{if(!n&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(n),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(n);i=1,n=r[a]}return{c:t.subarray(0,A),n:e}},mo=function(r,e){for(var t=0,A=0;A<e.length;++A)t+=r[A]*e[A];return t},Mw=function(r,e,t){var A=t.length,n=Pw(e+2);r[n]=A&255,r[n+1]=A>>8,r[n+2]=r[n]^255,r[n+3]=r[n+1]^255;for(var i=0;i<A;++i)r[n+i+4]=t[i];return(n+4+A)*8},Dw=function(r,e,t,A,n,i,s,a,o,l,u){oi(e,u++,t),++n[256];for(var f=Wh(n,15),h=f.t,c=f.l,g=Wh(i,15),p=g.t,y=g.l,w=Rw(h),B=w.c,x=w.n,E=Rw(p),Q=E.c,L=E.n,S=new XA(19),T=0;T<B.length;++T)++S[B[T]&31];for(var T=0;T<Q.length;++T)++S[Q[T]&31];for(var _=Wh(S,7),D=_.t,U=_.l,O=19;O>4&&!D[Nw[O-1]];--O);var M=l+5<<3,C=mo(n,Ca)+mo(i,Ou)+s,z=mo(n,h)+mo(i,p)+s+14+3*O+mo(S,D)+2*S[16]+3*S[17]+7*S[18];if(o>=0&&M<=C&&M<=z)return Mw(e,u,r.subarray(o,o+l));var re,ne,Z,Ae;if(oi(e,u,1+(z<C)),u+=2,z<C){re=po(h,c,0),ne=h,Z=po(p,y,0),Ae=p;var V=po(D,U,0);oi(e,u,x-257),oi(e,u+5,L-1),oi(e,u+10,O-4),u+=14;for(var T=0;T<O;++T)oi(e,u+3*T,D[Nw[T]]);u+=3*O;for(var k=[B,Q],I=0;I<2;++I)for(var P=k[I],T=0;T<P.length;++T){var K=P[T]&31;oi(e,u,V[K]),u+=D[K],K>15&&(oi(e,u,P[T]>>5&127),u+=P[T]>>12)}}else re=t_,ne=Ca,Z=r_,Ae=Ou;for(var T=0;T<a;++T){var Y=A[T];if(Y>255){var K=Y>>18&31;vo(e,u,re[K+257]),u+=ne[K+257],K>7&&(oi(e,u,Y>>23&31),u+=qh[K]);var J=Y&31;vo(e,u,Z[J]),u+=Ae[J],J>3&&(vo(e,u,Y>>5&8191),u+=Vh[J])}else vo(e,u,re[Y]),u+=ne[Y]}return vo(e,u,re[256]),u+ne[256]},n_=new Kh([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kw=new bn(0),i_=function(r,e,t,A,n,i){var s=i.z||r.length,a=new bn(A+s+5*(1+Math.ceil(s/7e3))+n),o=a.subarray(A,a.length-n),l=i.l,u=(i.r||0)&7;if(e){u&&(o[0]=i.r>>3);for(var f=n_[e-1],h=f>>13,c=f&8191,g=(1<<t)-1,p=i.p||new XA(32768),y=i.h||new XA(g+1),w=Math.ceil(t/3),B=2*w,x=function(ye){return(r[ye]^r[ye+1]<<w^r[ye+2]<<B)&g},E=new Kh(25e3),Q=new XA(288),L=new XA(32),S=0,T=0,_=i.i||0,D=0,U=i.w||0,O=0;_+2<s;++_){var M=x(_),C=_&32767,z=y[M];if(p[C]=z,y[M]=C,U<=_){var re=s-_;if((S>7e3||D>24576)&&(re>423||!l)){u=Dw(r,o,0,E,Q,L,T,D,O,_-O,u),D=S=T=0,O=_;for(var ne=0;ne<286;++ne)Q[ne]=0;for(var ne=0;ne<30;++ne)L[ne]=0}var Z=2,Ae=0,V=c,k=C-z&32767;if(re>2&&M==x(_-k))for(var I=Math.min(h,re)-1,P=Math.min(32767,_),K=Math.min(258,re);k<=P&&--V&&C!=z;){if(r[_+Z]==r[_+Z-k]){for(var Y=0;Y<K&&r[_+Y]==r[_+Y-k];++Y);if(Y>Z){if(Z=Y,Ae=k,Y>I)break;for(var J=Math.min(k,Y-2),q=0,ne=0;ne<J;++ne){var W=_-k+ne&32767,te=p[W],oe=W-te&32767;oe>q&&(q=oe,z=W)}}}C=z,z=p[C],k+=C-z&32767}if(Ae){E[D++]=268435456|zh[Z]<<18|Lw[Ae];var we=zh[Z]&31,le=Lw[Ae]&31;T+=qh[we]+Vh[le],++Q[257+we],++L[le],U=_+Z,++S}else E[D++]=r[_],++Q[r[_]]}}for(_=Math.max(_,U);_<s;++_)E[D++]=r[_],++Q[r[_]];u=Dw(r,o,l,E,Q,L,T,D,O,_-O,u),l||(i.r=u&7|o[u/8|0]<<3,u-=7,i.h=y,i.p=p,i.i=_,i.w=U)}else{for(var _=i.w||0;_<s+l;_+=65535){var Be=_+65535;Be>=s&&(o[u/8|0]=l,Be=s),u=Mw(o,u+1,r.subarray(_,Be))}i.i=s}return A_(a,0,A+Pw(u)+n)},Hw=function(){var r=1,e=0;return{p:function(t){for(var A=r,n=e,i=t.length|0,s=0;s!=i;){for(var a=Math.min(s+2655,i);s<a;++s)n+=A+=t[s];A=(A&65535)+15*(A>>16),n=(n&65535)+15*(n>>16)}r=A,e=n},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},a_=function(r,e,t,A,n){if(!n&&(n={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),s=new bn(i.length+r.length);s.set(i),s.set(r,i.length),r=s,n.w=i.length}return i_(r,e.level==null?6:e.level,e.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,A,n)},jw=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},s_=function(r,e){var t=e.level,A=t==0?0:t<6?1:t==9?3:2;if(r[0]=120,r[1]=A<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var n=Hw();n.p(e.dictionary),jw(r,2,n.d())}};function Yh(r,e){e||(e={});var t=Hw();t.p(r);var A=a_(r,e,e.dictionary?6:2,4);return s_(A,e),jw(A,A.length-4,t.d()),A}var o_=typeof TextDecoder<"u"&&new TextDecoder,l_=0;try{o_.decode(kw,{stream:!0}),l_=1}catch{}function u_(r){if(Array.isArray(r))return r}function c_(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var A,n,i,s,a=[],o=!0,l=!1;try{if(i=(t=t.call(r)).next,e!==0)for(;!(o=(A=i.call(t)).done)&&(a.push(A.value),a.length!==e);o=!0);}catch(u){l=!0,n=u}finally{try{if(!o&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw n}}return a}}function Kw(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,A=Array(e);t<e;t++)A[t]=r[t];return A}function f_(r,e){if(r){if(typeof r=="string")return Kw(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Kw(r,e):void 0}}function h_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
495
|
+
`})]})},VU=["#000000","#333333","#666666","#999999","#CCCCCC","#FFFFFF","#FF0000","#FF6600","#FFCC00","#FFFF00","#99CC00","#00CC00","#00CCCC","#0099FF","#0066CC","#0000FF","#6600CC","#CC00CC","#FF99CC","#FFCC99","#FFFF99","#CCFF99","#99FFCC","#99FFFF"],Di=({value:r,onChange:e,disabled:t=!1,placeholder:A="选择颜色"})=>{const[n,i]=ce.useState(!1),[s,a]=ce.useState({}),o=ce.useRef(null),l=ce.useRef(null),u=ce.useRef(null);ce.useEffect(()=>{const y=w=>{o.current&&!o.current.contains(w.target)&&i(!1)};return n&&document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]),ce.useEffect(()=>{if(n&&o.current){const y=o.current.getBoundingClientRect(),w=206,B=240,x=window.innerWidth,E=window.innerHeight;let Q=0,L="100%",S="auto";y.left+w>x&&(Q=x-y.left-w-8),y.bottom+B>E&&(L="auto",S=y.height+4),a({left:Q!==0?Q:void 0,top:L==="auto"?"auto":void 0,bottom:S!=="auto"?S:void 0})}},[n]);const f=y=>{e(y),i(!1)},h=()=>{e(""),i(!1)},c=()=>{i(!1),setTimeout(()=>{var y;(y=l.current)==null||y.click()},50)},g=r||"",p=g&&g!=="transparent";return v.jsxs("div",{className:`color-picker ${t?"disabled":""}`,ref:o,children:[v.jsxs("div",{className:"color-preview-btn",onClick:()=>!t&&i(!n),title:p?g:A,children:[v.jsx("div",{className:"color-swatch",style:{backgroundColor:p?g:"transparent"},children:!p&&v.jsx("span",{className:"no-color-icon",children:"∅"})}),v.jsx("span",{className:"dropdown-arrow",children:v.jsx("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M3 5l5 6 5-6z"})})})]}),v.jsx("input",{ref:l,type:"color",value:p?g:"#000000",onChange:y=>f(y.target.value),style:{position:"absolute",opacity:0,pointerEvents:"none"}}),n&&!t&&v.jsxs("div",{className:"color-panel",ref:u,style:s,children:[v.jsxs("div",{className:"preset-colors",children:[v.jsx("div",{className:"color-item clear-color",onClick:h,title:"清除颜色",children:v.jsx("span",{className:"clear-icon",children:"∅"})}),VU.map(y=>v.jsx("div",{className:`color-item ${g.toUpperCase()===y?"active":""}`,style:{backgroundColor:y},onClick:()=>f(y),title:y},y))]}),v.jsx("div",{className:"custom-color-row",children:v.jsx("button",{type:"button",className:"btn-custom-color",onClick:c,children:"自定义颜色..."})})]})]})},zU=r=>{const e=Zs.find(t=>t.id===r);return(e==null?void 0:e.icon)||"●"},GU=r=>{switch(r){case"text":return"文本";case"multiline_text":return"多行文本";case"field":return"数据字段";case"calculated":return"计算字段";case"image":return"图片";case"line":return"线条";case"rectangle":return"矩形";case"page_number":return"页码";case"current_date":return"日期时间";default:return r}},_w=({band:r,dataFields:e,onUpdate:t,onSelectObject:A,onFocusObject:n,selectedObjectIds:i=[],focusedObjectId:s=null,onDeleteObject:a})=>{const[o,l]=ce.useState(r),[u,f]=ce.useState(!1),[h,c]=ce.useState(!1),[g,p]=ce.useState(null),[y,w]=ce.useState(null),B=ce.useRef(null),x=r.id==="detail"||r.id==="summary";ce.useEffect(()=>{l(r)},[r]);const E=(L,S)=>{const T={...o,[L]:S};l(T),t({[L]:S})},Q=r.actualBottom-r.top;return v.jsxs("div",{className:"band-property-panel",children:[v.jsxs("h3",{children:[r.name," - 带区属性"]}),v.jsxs("div",{className:"band-property-editor",children:[v.jsxs("div",{className:"band-property-group",children:[v.jsx("h4",{children:"基本信息"}),v.jsxs("div",{className:"band-property-row",children:[v.jsx("label",{children:"类型:"}),v.jsx("span",{className:"band-property-value",children:r.type})]}),v.jsxs("div",{className:"band-property-row",children:[v.jsx("label",{children:"高度:"}),v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flex:1},children:[v.jsx("input",{type:"number",value:Q,onChange:L=>{const S=parseInt(L.target.value)||20;t({actualBottom:r.top+S})},min:"20",max:"500",style:{width:"80px"}}),v.jsx("span",{style:{color:"#666",fontSize:"12px"},children:"px"}),x&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",onClick:()=>f(!0),style:{padding:"2px 6px",border:"1px solid #1890ff",borderRadius:"4px",background:r.rowHeightFormula?"#1890ff":"white",color:r.rowHeightFormula?"white":"#1890ff",cursor:"pointer",fontSize:"11px",flexShrink:0},title:r.rowHeightFormula||"设置行高公式",children:"fx"}),r.rowHeightFormula&&v.jsx("button",{type:"button",onClick:()=>E("rowHeightFormula",""),style:{padding:"2px 6px",fontSize:"12px",flexShrink:0,border:"1px solid #ddd",borderRadius:"4px",background:"white",cursor:"pointer"},title:"清除行高公式",children:"×"})]})]})]})]}),v.jsxs("div",{className:"band-property-group",children:[v.jsx("h4",{children:"外观设置"}),v.jsxs("div",{className:"band-property-row",children:[v.jsx("label",{children:"背景色:"}),v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flex:1},children:[v.jsx(Di,{value:r.backgroundColor||"",onChange:L=>E("backgroundColor",L)}),x&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",onClick:()=>c(!0),style:{padding:"2px 6px",border:"1px solid #1890ff",borderRadius:"4px",background:r.backgroundColorFormula?"#1890ff":"white",color:r.backgroundColorFormula?"white":"#1890ff",cursor:"pointer",fontSize:"11px",flexShrink:0},title:r.backgroundColorFormula||"设置背景色公式",children:"fx"}),r.backgroundColorFormula&&v.jsx("button",{type:"button",onClick:()=>E("backgroundColorFormula",""),style:{padding:"2px 6px",fontSize:"12px",flexShrink:0,border:"1px solid #ddd",borderRadius:"4px",background:"white",cursor:"pointer"},title:"清除背景色公式",children:"×"})]})]})]})]}),r.id==="summary"&&v.jsxs("div",{className:"band-property-group",children:[v.jsx("h4",{children:"汇总带设置"}),v.jsxs("div",{className:"band-property-row",children:[v.jsx("label",{children:"显示模式:"}),v.jsxs("select",{value:r.summaryDisplayMode||"atEnd",onChange:L=>E("summaryDisplayMode",L.target.value),children:[v.jsx("option",{value:"atEnd",children:"在所有明细后显示"}),v.jsx("option",{value:"perPage",children:"每页底部显示"}),v.jsx("option",{value:"perGroup",children:"每组后显示"})]})]})]}),v.jsxs("div",{className:"band-property-group control-list-group",children:[v.jsxs("h4",{children:["控件列表 (",r.objects.length,")"]}),v.jsx("div",{className:"object-list",children:r.objects.length===0?v.jsx("div",{style:{padding:"8px",color:"#999",textAlign:"center"},children:"无控件"}):[...r.objects].sort((L,S)=>(S.zIndex??1)-(L.zIndex??1)).map((L,S)=>{const T=`${r.id}-${L.id}`,_=i.includes(T),D=s===T,U=g===L.id,O=y===L.id;let M=!1,C=!1;if(L.type==="line"){const z=L,re=Math.min(z.y1??L.y,z.y2??L.y),ne=Math.max(z.y1??L.y,z.y2??L.y);M=ne<=r.top||re>=r.actualBottom,C=ne<=r.top}else{const z=L.y+L.height;M=z<=r.top||L.y>=r.actualBottom,C=z<=r.top}return v.jsxs("div",{draggable:!0,onDragStart:z=>{p(L.id),B.current={startIndex:S,currentIndex:S},z.dataTransfer.effectAllowed="move"},onDragOver:z=>{z.preventDefault(),g&&g!==L.id&&(w(L.id),B.current&&(B.current.currentIndex=S))},onDragLeave:()=>{w(null)},onDrop:z=>{if(z.preventDefault(),g&&g!==L.id&&B.current){const re=[...r.objects].sort((I,P)=>(P.zIndex??1)-(I.zIndex??1)),ne=B.current.startIndex,Z=S,[Ae]=re.splice(ne,1);re.splice(Z,0,Ae);const V=re.length,k=r.objects.map(I=>{const P=re.findIndex(K=>K.id===I.id);return{...I,zIndex:V-P}});t({objects:k})}p(null),w(null),B.current=null},onDragEnd:()=>{p(null),w(null),B.current=null},onClick:()=>n==null?void 0:n(L.id,r.id),onDoubleClick:()=>A==null?void 0:A(L.id,r.id),title:"拖动调整层级,单击聚焦,双击选中",style:{display:"flex",alignItems:"center",padding:"6px 8px",cursor:"grab",borderBottom:"1px solid #e8e8e8",backgroundColor:U?"#e6f7ff":O?"#f0f5ff":_?"#e6f7ff":D?"#f6ffed":M?"#fff2f0":"transparent",opacity:U?.5:1,borderTop:O?"2px solid #1890ff":"none",borderLeft:D?"3px solid #52c41a":_?"3px solid #1890ff":"none",transition:"background-color 0.2s"},onMouseEnter:z=>{!_&&!D&&!M&&!U&&(z.currentTarget.style.backgroundColor="#f5f5f5")},onMouseLeave:z=>{!_&&!D&&!O&&(z.currentTarget.style.backgroundColor=M?"#fff2f0":"transparent")},children:[v.jsx("span",{style:{marginRight:"6px",color:"#bbb",cursor:"grab",fontSize:"12px"},children:"≡"}),v.jsx("span",{style:{marginRight:"8px",fontSize:"14px",width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#4d90fe",color:"white",borderRadius:"4px",flexShrink:0},children:zU(L.type)}),v.jsx("span",{style:{flex:1,fontSize:"12px",color:M?"#ff4d4f":"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:L.text||L.fieldName||L.id}),v.jsxs("span",{style:{fontSize:"10px",color:"#999",marginRight:"6px",backgroundColor:"#f0f0f0",padding:"1px 4px",borderRadius:"2px"},children:["z:",L.zIndex??1]}),M&&v.jsx("span",{style:{fontSize:"10px",color:"#ff4d4f",marginRight:"4px",padding:"1px 4px",backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"2px",cursor:"pointer"},title:"点击移回带区",onClick:z=>{z.stopPropagation();const re=r.top+10,ne=r.objects.map(Z=>{if(Z.id!==L.id)return Z;if(Z.type==="line"){const Ae=Z,V=Math.min(Ae.y1??Z.y,Ae.y2??Z.y),k=re-V;return{...Z,y:re,y1:(Ae.y1??Z.y)+k,y2:(Ae.y2??Z.y)+k}}return{...Z,y:re}});t({objects:ne})},children:C?"↑":"↓"}),v.jsx("span",{style:{fontSize:"10px",color:"#999",marginRight:"6px"},children:GU(L.type)}),v.jsx("button",{onClick:z=>{if(z.stopPropagation(),a)a(L.id,r.id);else{const re=r.objects.filter(ne=>ne.id!==L.id);t({objects:re})}},title:"删除控件",style:{padding:"2px 6px",fontSize:"12px",border:"none",background:"transparent",color:"#999",cursor:"pointer",borderRadius:"2px",transition:"all 0.2s"},onMouseEnter:z=>{z.currentTarget.style.backgroundColor="#ff4d4f",z.currentTarget.style.color="white"},onMouseLeave:z=>{z.currentTarget.style.backgroundColor="transparent",z.currentTarget.style.color="#999"},children:"×"})]},L.id)})})]}),u&&v.jsx(go,{dataFields:e,value:r.rowHeightFormula||"",onConfirm:L=>{E("rowHeightFormula",L),f(!1)},onCancel:()=>f(!1)}),h&&v.jsx(go,{dataFields:e,value:r.backgroundColorFormula||"",onConfirm:L=>{E("backgroundColorFormula",L),c(!1)},onCancel:()=>c(!1)})]})]})},WU=r=>["text","field","calculated","page_number","current_date"].includes(r.type),XU=r=>["text","field","calculated","rectangle","ellipse","star","triangle","diamond","page_number","current_date"].includes(r.type),YU=r=>["text","multiline_text","field","calculated","image","line","rectangle","ellipse","star","triangle","diamond","page_number","current_date","barcode","qrcode"].includes(r.type),Iw=({value:r,onChange:e,placeholder:t="请输入内容...",minHeight:A=120})=>{const n=ce.useRef(null),i=ce.useRef(!1);ce.useEffect(()=>{n.current&&!i.current&&n.current.innerHTML!==r&&(n.current.innerHTML=r||""),i.current=!1},[r]);const s=ce.useCallback(()=>{n.current&&(i.current=!0,e(n.current.innerHTML))},[e]),a=ce.useCallback((u,f)=>{var h;document.execCommand(u,!1,f),(h=n.current)==null||h.focus(),s()},[s]),o=[{command:"bold",icon:v.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M3 2h5.5c2.5 0 4 1.5 4 3.5 0 1.2-.6 2.2-1.6 2.8 1.4.5 2.4 1.7 2.4 3.2 0 2.2-1.7 3.5-4.2 3.5H3V2zm2.5 5h2.8c1 0 1.7-.6 1.7-1.5S9.3 4 8.3 4H5.5v3zm0 5h3.2c1.1 0 1.8-.6 1.8-1.6 0-1-.7-1.6-1.8-1.6H5.5v3.2z"})}),title:"加粗"},{command:"italic",icon:v.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M6 2h6v2h-2l-2 8h2v2H4v-2h2l2-8H6V2z"})}),title:"斜体"},{command:"underline",icon:v.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:v.jsx("path",{fill:"currentColor",d:"M3 13h10v2H3v-2zM8 2c2.2 0 4 1.8 4 4v4c0 2.2-1.8 4-4 4s-4-1.8-4-4V6c0-2.2 1.8-4 4-4zm0 2c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2s2-.9 2-2V6c0-1.1-.9-2-2-2z"})}),title:"下划线"},{command:"strikeThrough",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("path",{fill:"currentColor",d:"M2 7h12v2H2V7z"}),v.jsx("path",{fill:"currentColor",d:"M4 3h8v2H9v2H7V5H4V3zm4 8h2v3H8v-3z"})]}),title:"删除线"},{type:"separator"},{command:"justifyLeft",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"2",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"12",width:"10",height:"2",fill:"currentColor"})]}),title:"左对齐"},{command:"justifyCenter",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"4",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"3",y:"12",width:"10",height:"2",fill:"currentColor"})]}),title:"居中"},{command:"justifyRight",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"6",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"4",y:"12",width:"10",height:"2",fill:"currentColor"})]}),title:"右对齐"},{type:"separator"},{command:"insertUnorderedList",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("circle",{cx:"3",cy:"4",r:"1.5",fill:"currentColor"}),v.jsx("rect",{x:"6",y:"3",width:"8",height:"2",fill:"currentColor"}),v.jsx("circle",{cx:"3",cy:"8",r:"1.5",fill:"currentColor"}),v.jsx("rect",{x:"6",y:"7",width:"8",height:"2",fill:"currentColor"}),v.jsx("circle",{cx:"3",cy:"12",r:"1.5",fill:"currentColor"}),v.jsx("rect",{x:"6",y:"11",width:"8",height:"2",fill:"currentColor"})]}),title:"无序列表"},{command:"insertOrderedList",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("text",{x:"1",y:"5",fontSize:"5",fill:"currentColor",fontFamily:"Arial",children:"1."}),v.jsx("rect",{x:"6",y:"3",width:"8",height:"2",fill:"currentColor"}),v.jsx("text",{x:"1",y:"9",fontSize:"5",fill:"currentColor",fontFamily:"Arial",children:"2."}),v.jsx("rect",{x:"6",y:"7",width:"8",height:"2",fill:"currentColor"}),v.jsx("text",{x:"1",y:"13",fontSize:"5",fill:"currentColor",fontFamily:"Arial",children:"3."}),v.jsx("rect",{x:"6",y:"11",width:"8",height:"2",fill:"currentColor"})]}),title:"有序列表"},{type:"separator"},{command:"removeFormat",icon:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("path",{fill:"currentColor",d:"M2 3h12v2H2V3z"}),v.jsx("path",{fill:"currentColor",d:"M7 5h2v8H7V5z"}),v.jsx("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"M3 13l10-10"})]}),title:"清除格式"}],l=[{value:"1",label:"10px"},{value:"2",label:"12px"},{value:"3",label:"14px"},{value:"4",label:"16px"},{value:"5",label:"18px"},{value:"6",label:"24px"},{value:"7",label:"32px"}];return v.jsxs("div",{className:"rich-text-editor",children:[v.jsxs("div",{className:"rte-toolbar",children:[v.jsx("select",{className:"rte-select",onChange:u=>a("fontSize",u.target.value),defaultValue:"3",title:"字号",children:l.map(u=>v.jsx("option",{value:u.value,children:u.label},u.value))}),v.jsx(Di,{value:"#000000",onChange:u=>{u&&a("foreColor",u)}}),v.jsx("span",{className:"rte-separator"}),o.map((u,f)=>u.type==="separator"?v.jsx("span",{className:"rte-separator"},f):v.jsx("button",{type:"button",className:"rte-btn",onClick:()=>a(u.command),title:u.title,children:u.icon},u.command))]}),v.jsx("div",{ref:n,className:"rte-content",contentEditable:!0,onInput:s,onBlur:s,style:{minHeight:A},"data-placeholder":t,suppressContentEditableWarning:!0})]})},$U=Zs.reduce((r,e)=>(r[e.id]={name:e.name,icon:e.icon},r),{}),Qw=({object:r,bandId:e,dataFields:t,onUpdateBands:A,onClearSelection:n})=>{var L,S,T,_,D,U,O,M;const[i,s]=ce.useState(r),[a,o]=ce.useState(!1),[l,u]=ce.useState({});ce.useEffect(()=>{s(r)},[r]);const f=ce.useCallback(C=>{u(z=>({...z,[C]:!z[C]}))},[]),h=(C,z)=>{const re={...i,[C]:z};s(re),A(ne=>ne.map(Z=>Z.id!==e?Z:{...Z,objects:Z.objects.map(Ae=>Ae.id===r.id?{...Ae,[C]:z}:Ae)}))},c=(C,z)=>{const re={...i.border,[C]:z},ne={...i,border:re};s(ne),A(Z=>Z.map(Ae=>Ae.id!==e?Ae:{...Ae,objects:Ae.objects.map(V=>V.id===r.id?{...V,border:re}:V)}))},g=C=>{var z;return((z=i.border)==null?void 0:z[C])||""},p=()=>{window.confirm("确定要删除这个对象吗?")&&(A(C=>C.map(z=>z.id!==e?z:{...z,objects:z.objects.filter(re=>re.id!==r.id)})),n())},y=WU(r),w=XU(r),B=YU(r),x=(C,z,re,ne)=>v.jsxs("div",{className:"property-row",children:[v.jsxs("label",{children:[C,":"]}),v.jsx(Di,{value:z||"",onChange:ne})]}),E=(C,z,re)=>v.jsxs("div",{className:"property-group",children:[v.jsxs("div",{className:"property-group-header",onClick:()=>f(C),children:[v.jsx("h4",{children:z}),v.jsx("span",{className:`collapse-icon ${l[C]?"collapsed":""}`,children:v.jsx("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M3 5l5 6 5-6z"})})})]}),v.jsx("div",{className:`property-group-content ${l[C]?"collapsed":""}`,children:re})]}),Q=$U[r.type]||{name:r.type,icon:"?"};return v.jsxs("div",{className:"property-panel",children:[v.jsxs("div",{className:"property-panel-header",children:[v.jsx("div",{className:"type-icon",children:Q.icon}),v.jsxs("div",{className:"type-info",children:[v.jsx("div",{className:"type-name",children:Q.name}),v.jsxs("div",{className:"type-id",children:["ID: ",r.id]})]})]}),v.jsxs("div",{className:"property-editor",children:[E("basic","基础属性",v.jsxs(v.Fragment,{children:[r.type==="line"?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"起点 X:"}),v.jsx("input",{type:"number",value:Math.round(i.x1??i.x??0),onChange:C=>h("x1",parseInt(C.target.value)||0)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"起点 Y:"}),v.jsx("input",{type:"number",value:Math.round(i.y1??i.y??0),onChange:C=>h("y1",parseInt(C.target.value)||0)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"终点 X:"}),v.jsx("input",{type:"number",value:Math.round(i.x2??(i.x||0)+(i.width||200)),onChange:C=>h("x2",parseInt(C.target.value)||0)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"终点 Y:"}),v.jsx("input",{type:"number",value:Math.round(i.y2??i.y??0),onChange:C=>h("y2",parseInt(C.target.value)||0)})]})]}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"位置 X:"}),v.jsx("input",{type:"number",value:Math.round(i.x||0),onChange:C=>h("x",parseInt(C.target.value)||0)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"位置 Y:"}),v.jsx("input",{type:"number",value:Math.round(i.y||0),onChange:C=>h("y",parseInt(C.target.value)||0)})]})]}),r.type!=="line"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"宽度:"}),v.jsx("input",{type:"number",value:Math.round(i.width||0),onChange:C=>h("width",parseInt(C.target.value)||0)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"高度:"}),v.jsx("input",{type:"number",value:Math.round(i.height||0),onChange:C=>h("height",parseInt(C.target.value)||0)})]})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"层级:"}),v.jsx("input",{type:"number",value:i.zIndex??1,onChange:C=>h("zIndex",parseInt(C.target.value)||1),min:1})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"打印可见:"}),v.jsxs("div",{className:"checkbox-wrapper",children:[v.jsx("input",{type:"checkbox",checked:i.printVisible!==!1,onChange:C=>h("printVisible",C.target.checked)}),v.jsx("span",{className:"checkbox-label",children:i.printVisible!==!1?"打印时显示":"打印时隐藏"})]})]})]})),r.type==="text"&&E("textContent","文本内容",v.jsx(v.Fragment,{children:v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"内容:"}),v.jsx("input",{type:"text",value:i.text||"",onChange:C=>h("text",C.target.value),placeholder:"请输入文本内容"})]})})),r.type==="multiline_text"&&E("multilineContent","富文本内容",v.jsx(v.Fragment,{children:v.jsx("div",{className:"property-row",style:{flexDirection:"column",alignItems:"stretch"},children:v.jsx(Iw,{value:i.text||"",onChange:C=>h("text",C),placeholder:"请输入富文本内容...",minHeight:150})})})),r.type==="page_number"&&E("pageNumberFormat","页码格式",v.jsx(v.Fragment,{children:v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"格式:"}),v.jsx("input",{type:"text",value:i.text||"第 {page} 页 / 共 {total} 页",onChange:C=>h("text",C.target.value),placeholder:"第 {page} 页 / 共 {total} 页"})]})})),r.type==="current_date"&&E("dateFormat","日期时间格式",v.jsx(v.Fragment,{children:v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"格式:"}),v.jsx("select",{value:i.text||"yyyy-MM-dd",onChange:C=>h("text",C.target.value),children:Vv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]})})),r.type==="field"&&E("fieldData","数据字段",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"字段名:"}),v.jsx("input",{type:"text",value:i.fieldName||"",readOnly:!0,disabled:!0,title:"数据字段名不可修改"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"默认文本:"}),v.jsx("input",{type:"text",value:i.text||"",onChange:C=>h("text",C.target.value),placeholder:"无数据时显示的文本"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"格式化:"}),v.jsx("select",{value:i.formatType||"text",onChange:C=>h("formatType",C.target.value),children:eh.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),(i.formatType==="number"||i.formatType==="currency"||i.formatType==="percent")&&v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"小数位:"}),v.jsx("input",{type:"number",value:i.decimalPlaces??2,onChange:C=>h("decimalPlaces",parseInt(C.target.value)||0),min:0,max:10})]})]})),r.type==="calculated"&&E("calculatedField","计算字段",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"计算公式:"}),v.jsxs("div",{className:"formula-input-wrapper",children:[v.jsx("input",{type:"text",value:i.formula||"",readOnly:!0,placeholder:"点击编辑按钮设置公式",title:i.formula||"未设置公式"}),v.jsx("button",{type:"button",className:"btn-edit-formula",onClick:()=>o(!0),children:"编辑"})]})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"默认文本:"}),v.jsx("input",{type:"text",value:i.text||"",onChange:C=>h("text",C.target.value),placeholder:"计算失败时显示的文本"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"格式化:"}),v.jsx("select",{value:i.formatType||"number",onChange:C=>h("formatType",C.target.value),children:eh.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),(i.formatType==="number"||i.formatType==="currency"||i.formatType==="percent"||!i.formatType)&&v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"小数位:"}),v.jsx("input",{type:"number",value:i.decimalPlaces??2,onChange:C=>h("decimalPlaces",parseInt(C.target.value)||0),min:0,max:10})]})]})),a&&v.jsx(go,{dataFields:t,value:i.formula||"",onConfirm:C=>{h("formula",C),o(!1)},onCancel:()=>o(!1)}),r.type==="barcode"&&E("barcodeBinding","字段绑定",v.jsx(v.Fragment,{children:v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"绑定字段:"}),v.jsxs("select",{value:i.fieldName||"",onChange:C=>h("fieldName",C.target.value),children:[v.jsx("option",{value:"",children:"不绑定(使用静态内容)"}),v.jsx("optgroup",{label:"主表字段",children:t.filter(C=>C.source==="master").map(C=>v.jsx("option",{value:C.name,children:C.label},C.name))}),v.jsx("optgroup",{label:"明细字段",children:t.filter(C=>C.source==="detail").map(C=>v.jsx("option",{value:C.name,children:C.label},C.name))})]})]})})),r.type==="image"&&E("imageSettings","图片设置",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"本地图片:"}),v.jsxs("div",{style:{display:"flex",gap:"4px",flex:1},children:[v.jsx("input",{type:"file",accept:"image/*",style:{display:"none"},id:`image-upload-${r.id}`,onChange:C=>{var re;const z=(re=C.target.files)==null?void 0:re[0];if(z){const ne=new FileReader;ne.onload=Z=>{var V;const Ae=(V=Z.target)==null?void 0:V.result;h("src",Ae),h("imageUrl",Ae)},ne.readAsDataURL(z)}}}),v.jsx("label",{htmlFor:`image-upload-${r.id}`,style:{padding:"4px 12px",border:"1px solid #1890ff",borderRadius:"4px",background:"#1890ff",color:"white",cursor:"pointer",fontSize:"12px",whiteSpace:"nowrap"},children:"选择图片"}),(i.src||i.imageUrl)&&v.jsx("button",{type:"button",onClick:()=>{h("src",""),h("imageUrl","")},style:{padding:"4px 8px",border:"1px solid #ff4d4f",borderRadius:"4px",background:"#fff",color:"#ff4d4f",cursor:"pointer",fontSize:"12px"},children:"清除"})]})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"图片地址:"}),v.jsx("input",{type:"text",value:(i.src||i.imageUrl||"").slice(0,50)+((i.src||i.imageUrl||"").length>50?"...":""),onChange:C=>{h("src",C.target.value),h("imageUrl",C.target.value)},placeholder:"输入URL或选择本地图片",title:i.src||i.imageUrl||""})]}),(i.src||i.imageUrl)&&v.jsxs("div",{className:"property-row",style:{flexDirection:"column",alignItems:"flex-start"},children:[v.jsx("label",{children:"预览:"}),v.jsx("div",{style:{width:"100%",height:"80px",border:"1px solid #d9d9d9",borderRadius:"4px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",background:"#f5f5f5"},children:v.jsx("img",{src:i.src||i.imageUrl,alt:"预览",style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"替代文本:"}),v.jsx("input",{type:"text",value:i.alt||"",onChange:C=>h("alt",C.target.value),placeholder:"图片加载失败时显示"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"显示方式:"}),v.jsx("select",{value:i.objectFit||"contain",onChange:C=>h("objectFit",C.target.value),children:zv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"内边距:"}),v.jsxs("div",{className:"padding-inputs",children:[v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"上"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((L=i.padding)==null?void 0:L.top)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,top:z}):h("padding",{top:z,right:z,bottom:z,left:z})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"右"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((S=i.padding)==null?void 0:S.right)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,right:z}):h("padding",{top:i.padding||0,right:z,bottom:i.padding||0,left:i.padding||0})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"下"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((T=i.padding)==null?void 0:T.bottom)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,bottom:z}):h("padding",{top:i.padding||0,right:i.padding||0,bottom:z,left:i.padding||0})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"左"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((_=i.padding)==null?void 0:_.left)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,left:z}):h("padding",{top:i.padding||0,right:i.padding||0,bottom:i.padding||0,left:z})},min:0,max:50})]})]})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"浮动图片:"}),v.jsxs("div",{className:"checkbox-wrapper",children:[v.jsx("input",{type:"checkbox",checked:i.floating===!0,onChange:C=>h("floating",C.target.checked)}),v.jsx("span",{className:"checkbox-label",children:i.floating?"以页面为基准定位":"以带区为基准定位"})]})]})]})),r.type==="barcode"&&E("barcodeSettings","条码设置",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"条码内容:"}),v.jsx("input",{type:"text",value:i.text||"",onChange:C=>h("text",C.target.value),placeholder:"输入条码内容"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"条码类型:"}),v.jsx("select",{value:i.barcodeType||"CODE128",onChange:C=>h("barcodeType",C.target.value),children:Gv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"显示文字:"}),v.jsxs("div",{className:"checkbox-wrapper",children:[v.jsx("input",{type:"checkbox",checked:i.showText!==!1,onChange:C=>h("showText",C.target.checked)}),v.jsx("span",{className:"checkbox-label",children:i.showText!==!1?"显示":"隐藏"})]})]}),x("条码颜色",i.lineColor,"#000000",C=>h("lineColor",C)),x("背景色",i.background,"#FFFFFF",C=>h("background",C))]})),r.type==="qrcode"&&E("qrcodeSettings","二维码设置",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"二维码内容:"}),v.jsx("input",{type:"text",value:i.text||"",onChange:C=>h("text",C.target.value),placeholder:"输入二维码内容"})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"容错级别:"}),v.jsx("select",{value:i.errorLevel||"M",onChange:C=>h("errorLevel",C.target.value),children:Wv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),x("前景色",i.foreground,"#000000",C=>h("foreground",C)),x("背景色",i.background,"#FFFFFF",C=>h("background",C))]})),r.type==="line"&&E("lineStyle","线条样式",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"粗细:"}),v.jsx("input",{type:"number",value:i.strokeWidth||1,onChange:C=>h("strokeWidth",Math.max(1,parseInt(C.target.value)||1)),min:1,max:20})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"线段样式:"}),v.jsx("select",{value:i.lineStyle||"solid",onChange:C=>h("lineStyle",C.target.value),children:Xv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),x("线条颜色",i.color,"#000000",C=>h("color",C))]})),y&&E("textStyle","外观样式",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"字体大小:"}),v.jsx("input",{type:"number",value:i.fontSize||12,onChange:C=>h("fontSize",parseInt(C.target.value)||12),min:8,max:72})]}),x("文字颜色",i.color,"#000000",C=>h("color",C)),x("背景色",i.background,"#ffffff",C=>h("background",C)),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"字体粗细:"}),v.jsx("select",{value:i.fontWeight||"normal",onChange:C=>h("fontWeight",C.target.value),children:Kv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"字体样式:"}),v.jsx("select",{value:i.fontStyle||"normal",onChange:C=>h("fontStyle",C.target.value),children:qv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"行高:"}),v.jsx("input",{type:"number",value:i.lineHeight||1.2,onChange:C=>h("lineHeight",parseFloat(C.target.value)||1.2),step:.1,min:.5,max:3})]})]})),y&&E("alignment","对齐方式",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"水平对齐:"}),v.jsxs("div",{className:"alignment-buttons",children:[v.jsx("button",{type:"button",className:`alignment-btn ${i.textAlign==="left"||!i.textAlign?"active":""}`,onClick:()=>h("textAlign","left"),title:"左对齐",children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"2",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"12",width:"10",height:"2",fill:"currentColor"})]})}),v.jsx("button",{type:"button",className:`alignment-btn ${i.textAlign==="center"?"active":""}`,onClick:()=>h("textAlign","center"),title:"居中对齐",children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"4",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"3",y:"12",width:"10",height:"2",fill:"currentColor"})]})}),v.jsx("button",{type:"button",className:`alignment-btn ${i.textAlign==="right"?"active":""}`,onClick:()=>h("textAlign","right"),title:"右对齐",children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"6",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"4",y:"12",width:"10",height:"2",fill:"currentColor"})]})})]})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"垂直对齐:"}),v.jsx("select",{value:i.textVerticalAlign||"top",onChange:C=>h("textVerticalAlign",C.target.value),children:jv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]})]})),w&&!y&&E("background","外观样式",v.jsx(v.Fragment,{children:x("背景色",i.background,"#ffffff",C=>h("background",C))})),B&&r.type!=="line"&&E("border","边框边距",v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"边框宽度:"}),v.jsx("input",{type:"number",value:g("width")||0,onChange:C=>c("width",parseInt(C.target.value)||0),min:0,max:10})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"边框样式:"}),v.jsx("select",{value:g("style")||"solid",onChange:C=>c("style",C.target.value),children:Hv.map(C=>v.jsx("option",{value:C.value,children:C.label},C.value))})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"边框颜色:"}),v.jsx(Di,{value:g("color")||"",onChange:C=>c("color",C)})]}),v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"内边距:"}),v.jsxs("div",{className:"padding-inputs",children:[v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"上"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((D=i.padding)==null?void 0:D.top)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,top:z}):h("padding",{top:z,right:z,bottom:z,left:z})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"右"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((U=i.padding)==null?void 0:U.right)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,right:z}):h("padding",{top:i.padding||0,right:z,bottom:i.padding||0,left:i.padding||0})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"下"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((O=i.padding)==null?void 0:O.bottom)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,bottom:z}):h("padding",{top:i.padding||0,right:i.padding||0,bottom:z,left:i.padding||0})},min:0,max:50})]}),v.jsxs("div",{className:"padding-input-item",children:[v.jsx("span",{className:"padding-label",children:"左"}),v.jsx("input",{type:"number",value:typeof i.padding=="object"?((M=i.padding)==null?void 0:M.left)??0:i.padding||0,onChange:C=>{const z=parseInt(C.target.value)||0;typeof i.padding=="object"?h("padding",{...i.padding,left:z}):h("padding",{top:i.padding||0,right:i.padding||0,bottom:i.padding||0,left:z})},min:0,max:50})]})]})]})]})),r.type==="rectangle"&&E("rectangleStyle","矩形样式",v.jsx(v.Fragment,{children:v.jsxs("div",{className:"property-row",children:[v.jsx("label",{children:"圆角:"}),v.jsx("input",{type:"number",value:i.borderRadius||0,onChange:C=>h("borderRadius",parseInt(C.target.value)||0),min:0,max:100})]})})),v.jsx("div",{className:"property-actions",children:v.jsx("button",{className:"btn btn-danger",onClick:p,children:"删除对象"})})]})]})},ki=r=>{const e=r,t=2;if(r.type==="line"){const i=r,s=i.x1??r.x,a=i.y1??r.y,o=i.x2??r.x+r.width,l=i.y2??r.y,u=Math.min(s,o),f=Math.min(a,l),h=Math.max(s,o),c=Math.max(a,l);return{x:u,y:f,width:h-u||1,height:c-f||1,extra:0,borderWidth:0,padding:0}}let A=0;e.border&&e.border.style!=="none"&&e.border.width?A=e.border.width:e.border||(r.type==="field"||r.type==="rectangle")&&(A=1);const n=A+t;return{x:r.x,y:r.y,width:r.width+n*2,height:r.height+n*2,extra:n,borderWidth:A,padding:t}},JU=({selectedObjectIds:r,bands:e,onUpdateObjects:t,onUndo:A,onRedo:n,canUndo:i,canRedo:s,onSave:a,onPreview:o,showGrid:l,showRulers:u,showPageMargins:f,onToggleGrid:h,onToggleRulers:c,onTogglePageMargins:g,onPageSettings:p,onAddControl:y,onAddFields:w,selectedBandId:B,dataFields:x})=>{var Te,Ee,Ve,Me,ze,Ye,xe,Oe,je;const[E,Q]=ce.useState(!1),[L,S]=ce.useState({top:0,left:0}),T=ce.useRef(null),_=ce.useRef(null),[D,U]=ce.useState(!1),[O,M]=ce.useState([]),[C,z]=ce.useState("horizontal");ce.useEffect(()=>{const ge=Re=>{T.current&&!T.current.contains(Re.target)&&Q(!1)};return E&&document.addEventListener("mousedown",ge),()=>document.removeEventListener("mousedown",ge)},[E]);const re=ce.useCallback(()=>{if(!E&&_.current){const ge=_.current.getBoundingClientRect();S({top:ge.bottom+4,left:ge.left})}Q(!E)},[E]),ne=ce.useMemo(()=>{const ge={basic:[],system:[],decorator:[]};return Zs.forEach(Re=>{Re.id==="calculated"?ge.basic.push(Re):Re.category==="field"||ge[Re.category]&&ge[Re.category].push(Re)}),ge},[]),Z=ce.useMemo(()=>{const ge=x.filter(Le=>Le.source==="master"),Re=x.filter(Le=>Le.source==="detail");return{master:ge,detail:Re}},[x]),Ae=ce.useCallback(ge=>{y(ge),Q(!1)},[y]),V=ce.useCallback(ge=>{M(Re=>Re.find(ue=>ue.name===ge.name)?Re.filter(ue=>ue.name!==ge.name):[...Re,ge])},[]),k=ce.useCallback(()=>{O.length>0&&w(O,C),U(!1),M([])},[O,C,w]),I=ce.useCallback(()=>{U(!1),M([])},[]),P=ce.useMemo(()=>{const ge=[];return r.forEach(Re=>{const[Le,ue]=Re.split("-"),fe=e.find(Fe=>Fe.id===Le),Pe=fe==null?void 0:fe.objects.find(Fe=>Fe.id===ue);Pe&&fe&&ge.push({object:Pe,bandId:Le})}),ge},[r,e]),K=ce.useMemo(()=>{const ge=["text","field","calculated","page_number","current_date"];return P.every(({object:Re})=>ge.includes(Re.type))},[P]),Y=ce.useCallback(ge=>{if(P.length===0)return;const Le=P[0].object[ge];return P.every(({object:fe})=>fe[ge]===Le)?Le:void 0},[P]),J=ce.useCallback(ge=>{if(P.length<2)return;const Re=P[0].object,Le=ki(Re),ue=[];P.slice(1).forEach(({object:fe,bandId:Pe})=>{const Fe=ki(fe),Ne={};if(fe.type==="line"){const ve=fe,Qe=ve.x1??fe.x,De=ve.y1??fe.y,it=ve.x2??fe.x+fe.width,et=ve.y2??fe.y;let Ge=0,At=0;switch(ge){case"left":Ge=Le.x-Fe.x;break;case"right":Ge=Le.x+Le.width-(Fe.x+Fe.width);break;case"top":At=Le.y-Fe.y;break;case"bottom":At=Le.y+Le.height-(Fe.y+Fe.height);break;case"horizontal-center":Ge=Le.x+Le.width/2-(Fe.x+Fe.width/2);break;case"vertical-center":At=Le.y+Le.height/2-(Fe.y+Fe.height/2);break}Ne.x1=Qe+Ge,Ne.y1=De+At,Ne.x2=it+Ge,Ne.y2=et+At,Ne.x=fe.x+Ge,Ne.y=fe.y+At}else switch(ge){case"left":Ne.x=Le.x;break;case"right":Ne.x=Le.x+Le.width-Fe.width;break;case"top":Ne.y=Le.y;break;case"bottom":Ne.y=Le.y+Le.height-Fe.height;break;case"horizontal-center":Ne.x=Le.x+(Le.width-Fe.width)/2;break;case"vertical-center":Ne.y=Le.y+(Le.height-Fe.height)/2;break}ue.push({bandId:Pe,objectId:fe.id,changes:Ne})}),t(ue)},[P,t]),q=ce.useCallback(ge=>{if(P.length<3)return;const Re=[...P].sort((De,it)=>ge==="horizontal"?De.object.x-it.object.x:De.object.y-it.object.y),Le=Re[0].object,ue=Re[Re.length-1].object,fe=ki(ue);let Pe,Fe=0;ge==="horizontal"?(Pe=ue.x+fe.width-Le.x,Re.forEach(({object:De})=>{Fe+=ki(De).width})):(Pe=ue.y+fe.height-Le.y,Re.forEach(({object:De})=>{Fe+=ki(De).height}));const Ne=(Pe-Fe)/(Re.length-1),ve=[];let Qe=ge==="horizontal"?Le.x:Le.y;Re.forEach(({object:De,bandId:it},et)=>{const Ge=ki(De);if(et===0){Qe+=ge==="horizontal"?Ge.width:Ge.height;return}const At={};ge==="horizontal"?(At.x=Qe+Ne,Qe=At.x+Ge.width):(At.y=Qe+Ne,Qe=At.y+Ge.height),ve.push({bandId:it,objectId:De.id,changes:At})}),t(ve)},[P,t]),W=ce.useCallback(ge=>{if(P.length<2)return;const Re=P[0].object,Le=ki(Re),ue=[],fe=Re.type==="line";let Pe=0;if(fe){const Fe=Re,Ne=Fe.x1??Re.x,ve=Fe.y1??Re.y,Qe=Fe.x2??Re.x+Re.width,De=Fe.y2??Re.y;Ne===Qe?Pe=Math.abs(De-ve):ve===De?Pe=Math.abs(Qe-Ne):Pe=Math.sqrt(Math.pow(Qe-Ne,2)+Math.pow(De-ve,2))}P.slice(1).forEach(({object:Fe,bandId:Ne})=>{const ve={};if(Fe.type==="line"){const De=Fe,it=De.x1??Fe.x,et=De.y1??Fe.y,Ge=De.x2??Fe.x+Fe.width,At=De.y2??Fe.y,nt=it===Ge,tt=et===At;if(fe){if(nt&&(ge==="height"||ge==="both")){const lt=Math.abs(At-et),ur=Pe-lt;At>=et?ve.y2=At+ur:ve.y2=At-ur}else if(tt&&(ge==="width"||ge==="both")){const lt=Math.abs(Ge-it),ur=Pe-lt;Ge>=it?ve.x2=Ge+ur:ve.x2=Ge-ur}}else if(nt&&(ge==="height"||ge==="both")){const lt=Le.height-Math.abs(At-et);At>=et?ve.y2=At+lt:ve.y2=At-lt}else if(tt&&(ge==="width"||ge==="both")){const lt=Le.width-Math.abs(Ge-it);Ge>=it?ve.x2=Ge+lt:ve.x2=Ge-lt}Object.keys(ve).length>0&&ue.push({bandId:Ne,objectId:Fe.id,changes:ve});return}const Qe=ki(Fe);(ge==="width"||ge==="both")&&(ve.width=Le.width-Qe.extra*2),(ge==="height"||ge==="both")&&(ve.height=Le.height-Qe.extra*2),ue.push({bandId:Ne,objectId:Fe.id,changes:ve})}),ue.length>0&&t(ue)},[P,t]),te=ce.useCallback((ge,Re)=>{const Le=P.map(({object:ue,bandId:fe})=>({bandId:fe,objectId:ue.id,changes:{[ge]:Re}}));t(Le)},[P,t]),oe=ce.useCallback((ge,Re)=>{const Le=P.map(({object:ue,bandId:fe})=>{const Pe=ue;return{bandId:fe,objectId:ue.id,changes:{border:{...Pe.border,[ge]:Re}}}});t(Le)},[P,t]),we=r.length>=2,le=r.length>=3,Be=r.length>=1,ye=Y("fontSize"),R=Y("color"),Ie=Y("background"),Ue=Y("textAlign");return v.jsxs("div",{className:"multi-select-toolbar",children:[v.jsx("div",{className:"toolbar-section",children:v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:"toolbar-btn btn-primary",onClick:a,title:"保存 (Ctrl+S)",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:o,title:"打印预览 (Ctrl+P)",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"})})})]})}),v.jsx("div",{className:"toolbar-section",children:v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:"toolbar-btn",onClick:A,title:"撤销 (Ctrl+Z)",disabled:!i,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:n,title:"恢复 (Ctrl+Shift+Z)",disabled:!s,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"})})})]})}),v.jsxs("div",{className:"toolbar-section",ref:T,children:[v.jsx("div",{className:"toolbar-buttons",children:v.jsxs("button",{ref:_,className:`toolbar-btn toolbar-dropdown-btn ${E?"active":""}`,onClick:re,title:"添加控件",disabled:!B,children:[v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})}),v.jsx("span",{className:"dropdown-arrow",children:"▼"})]})}),E&&v.jsxs("div",{className:"toolbar-dropdown-menu control-dropdown",style:{top:L.top,left:L.left},children:[v.jsxs("div",{className:"dropdown-category",children:[v.jsx("div",{className:"category-title",children:"基础控件"}),ne.basic.map(ge=>v.jsxs("div",{className:"dropdown-item",onClick:()=>Ae(ge.id),children:[v.jsx("span",{className:"item-icon",children:ge.icon}),v.jsx("span",{className:"item-name",children:ge.name})]},ge.id))]}),v.jsx("div",{className:"dropdown-divider"}),v.jsxs("div",{className:"dropdown-category",children:[v.jsx("div",{className:"category-title",children:"系统控件"}),ne.system.map(ge=>v.jsxs("div",{className:"dropdown-item",onClick:()=>Ae(ge.id),children:[v.jsx("span",{className:"item-icon",children:ge.icon}),v.jsx("span",{className:"item-name",children:ge.name})]},ge.id))]}),v.jsx("div",{className:"dropdown-divider"}),v.jsxs("div",{className:"dropdown-category",children:[v.jsx("div",{className:"category-title",children:"装饰控件"}),ne.decorator.map(ge=>v.jsxs("div",{className:"dropdown-item",onClick:()=>Ae(ge.id),children:[v.jsx("span",{className:"item-icon",children:ge.icon}),v.jsx("span",{className:"item-name",children:ge.name})]},ge.id))]})]})]}),v.jsx("div",{className:"toolbar-section",children:v.jsx("div",{className:"toolbar-buttons",children:v.jsxs("button",{className:"toolbar-btn",onClick:()=>U(!0),title:"插入数据字段",disabled:!B,children:[v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 9h-2v2H9v-2H7v-2h2V7h2v2h2v2zm0-6V3.5L18.5 9H13z"})}),v.jsx("span",{style:{marginLeft:4,fontSize:11},children:"字段"})]})})}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"对齐"}),v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:"toolbar-btn",onClick:()=>J("left"),title:"左对齐(以第一个选中的对象为参照)",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M4 22V2h2v20H4zm4-17v4h12V5H8zm0 14h8v-4H8v4z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>J("horizontal-center"),title:"水平居中对齐",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M11 2h2v5h6v4h-6v2h4v4h-4v5h-2v-5H7v-4h4v-2H5V7h6V2z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>J("right"),title:"右对齐",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M18 22V2h2v20h-2zM4 5v4h12V5H4zm4 14h8v-4H8v4z"})})}),v.jsx("span",{className:"separator"}),v.jsx("button",{className:"toolbar-btn",onClick:()=>J("top"),title:"顶部对齐",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M2 4h20v2H2V4zm3 4h4v12H5V8zm10 0h4v8h-4V8z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>J("vertical-center"),title:"垂直居中对齐",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M2 11h5V5h4v6h2V7h4v4h5v2h-5v4h-4v-4h-2v6H7v-6H2v-2z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>J("bottom"),title:"底部对齐",disabled:!we,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M2 18h20v2H2v-2zM5 4h4v12H5V4zm10 4h4v8h-4V8z"})})})]})]}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"分布"}),v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:"toolbar-btn",onClick:()=>q("horizontal"),title:"水平均匀分布",disabled:!le,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M4 5v14h2V5H4zm14 0v14h2V5h-2zM9 7h2v10H9V7zm4 2h2v6h-2V9z"})})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>q("vertical"),title:"垂直均匀分布",disabled:!le,children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M5 4h14v2H5V4zm0 14h14v2H5v-2zm2-11h10v2H7V7zm2 4h6v2H9v-2z"})})})]})]}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"尺寸"}),v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:"toolbar-btn",onClick:()=>W("width"),title:"相同宽度",disabled:!we,children:v.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[v.jsx("path",{fill:"currentColor",d:"M4 9h16v2H4V9zm0 4h16v2H4v-2z"}),v.jsx("path",{fill:"currentColor",d:"M7 6l-3 3 3 3V6zm10 0v6l3-3-3-3z"})]})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>W("height"),title:"相同高度",disabled:!we,children:v.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[v.jsx("path",{fill:"currentColor",d:"M9 4v16h2V4H9zm4 0v16h2V4h-2z"}),v.jsx("path",{fill:"currentColor",d:"M6 7l3-3 3 3H6zm0 10h6l-3 3-3-3z"})]})}),v.jsx("button",{className:"toolbar-btn",onClick:()=>W("both"),title:"相同尺寸",disabled:!we,children:v.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[v.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"2"}),v.jsx("path",{fill:"currentColor",d:"M8 11h8v2H8z"}),v.jsx("path",{fill:"currentColor",d:"M11 8v8h2V8z"})]})})]})]}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"文本"}),v.jsxs("div",{className:"toolbar-controls",children:[v.jsxs("label",{className:"toolbar-control-item",title:"字体大小",children:[v.jsx("span",{children:"大小"}),v.jsx("input",{type:"number",value:ye??"",placeholder:"-",min:8,max:72,onChange:ge=>te("fontSize",parseInt(ge.target.value)||12),disabled:!Be||!K})]}),v.jsxs("div",{className:"toolbar-control-item",title:"文字颜色",children:[v.jsx("span",{children:"颜色"}),v.jsx(Di,{value:R||"",onChange:ge=>te("color",ge),disabled:!Be||!K})]}),v.jsxs("div",{className:"toolbar-control-item",title:"背景颜色",children:[v.jsx("span",{children:"背景"}),v.jsx(Di,{value:Ie||"",onChange:ge=>te("background",ge),disabled:!Be||!K})]})]}),v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:`toolbar-btn ${Ue==="left"?"active":""}`,onClick:()=>te("textAlign","left"),title:"左对齐",disabled:!Be||!K,children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"2",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"12",width:"10",height:"2",fill:"currentColor"})]})}),v.jsx("button",{className:`toolbar-btn ${Ue==="center"?"active":""}`,onClick:()=>te("textAlign","center"),title:"居中",disabled:!Be||!K,children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"4",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"3",y:"12",width:"10",height:"2",fill:"currentColor"})]})}),v.jsx("button",{className:`toolbar-btn ${Ue==="right"?"active":""}`,onClick:()=>te("textAlign","right"),title:"右对齐",disabled:!Be||!K,children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",children:[v.jsx("rect",{x:"6",y:"2",width:"8",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"2",y:"7",width:"12",height:"3",fill:"currentColor"}),v.jsx("rect",{x:"4",y:"12",width:"10",height:"2",fill:"currentColor"})]})})]})]}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"边框"}),v.jsxs("div",{className:"toolbar-controls",children:[v.jsxs("label",{className:"toolbar-control-item",title:"边框宽度",children:[v.jsx("span",{children:"宽度"}),v.jsxs("select",{value:((Ve=(Ee=(Te=P[0])==null?void 0:Te.object)==null?void 0:Ee.border)==null?void 0:Ve.width)??0,onChange:ge=>oe("width",parseInt(ge.target.value)),disabled:!Be,children:[v.jsx("option",{value:0,children:"无"}),v.jsx("option",{value:1,children:"1px"}),v.jsx("option",{value:2,children:"2px"}),v.jsx("option",{value:3,children:"3px"})]})]}),v.jsxs("label",{className:"toolbar-control-item",title:"边框样式",children:[v.jsx("span",{children:"样式"}),v.jsxs("select",{value:((Ye=(ze=(Me=P[0])==null?void 0:Me.object)==null?void 0:ze.border)==null?void 0:Ye.style)??"solid",onChange:ge=>oe("style",ge.target.value),disabled:!Be,children:[v.jsx("option",{value:"solid",children:"实线"}),v.jsx("option",{value:"dashed",children:"虚线"}),v.jsx("option",{value:"dotted",children:"点线"})]})]}),v.jsxs("div",{className:"toolbar-control-item",title:"边框颜色",children:[v.jsx("span",{children:"颜色"}),v.jsx(Di,{value:((je=(Oe=(xe=P[0])==null?void 0:xe.object)==null?void 0:Oe.border)==null?void 0:je.color)||"",onChange:ge=>oe("color",ge),disabled:!Be})]})]})]}),v.jsxs("div",{className:"toolbar-section",children:[v.jsx("span",{className:"section-title",children:"显示"}),v.jsxs("div",{className:"toolbar-buttons",children:[v.jsx("button",{className:`toolbar-btn ${l?"active":""}`,onClick:h,title:"显示网格",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"})})}),v.jsx("button",{className:`toolbar-btn ${u?"active":""}`,onClick:c,title:"显示标尺",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h2v4h2V8h2v4h2V8h2v4h2V8h2v4h2V8h2v8z"})})}),v.jsx("button",{className:`toolbar-btn ${f?"active":""}`,onClick:g,title:"显示边距",children:v.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[v.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",d:"M3 3h18v18H3z"}),v.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 2",d:"M6 6h12v12H6z"})]})}),v.jsx("button",{className:"toolbar-btn",onClick:p,title:"页面设置",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:v.jsx("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})})})]})]}),D&&v.jsx("div",{className:"field-modal-overlay",onClick:I,children:v.jsxs("div",{className:"field-modal",onClick:ge=>ge.stopPropagation(),children:[v.jsxs("div",{className:"field-modal-header",children:[v.jsx("h3",{children:"选择数据字段"}),v.jsx("button",{className:"modal-close-btn",onClick:I,children:"×"})]}),v.jsxs("div",{className:"field-modal-body",children:[v.jsxs("div",{className:"field-group",children:[v.jsx("div",{className:"field-group-title",children:"主表字段"}),v.jsx("div",{className:"field-list",children:Z.master.map(ge=>v.jsxs("label",{className:`field-item ${O.find(Re=>Re.name===ge.name)?"selected":""}`,children:[v.jsx("input",{type:"checkbox",checked:!!O.find(Re=>Re.name===ge.name),onChange:()=>V(ge)}),v.jsx("span",{className:"field-label",children:ge.label}),v.jsx("span",{className:"field-name",children:ge.name})]},ge.name))})]}),v.jsxs("div",{className:"field-group",children:[v.jsx("div",{className:"field-group-title",children:"明细字段"}),v.jsx("div",{className:"field-list",children:Z.detail.map(ge=>v.jsxs("label",{className:`field-item ${O.find(Re=>Re.name===ge.name)?"selected":""}`,children:[v.jsx("input",{type:"checkbox",checked:!!O.find(Re=>Re.name===ge.name),onChange:()=>V(ge)}),v.jsx("span",{className:"field-label",children:ge.label}),v.jsx("span",{className:"field-name",children:ge.name})]},ge.name))})]})]}),v.jsxs("div",{className:"field-modal-footer",children:[v.jsxs("div",{className:"arrangement-options",children:[v.jsx("span",{children:"排列方式:"}),v.jsxs("label",{children:[v.jsx("input",{type:"radio",name:"arrangement",checked:C==="horizontal",onChange:()=>z("horizontal")}),"横向"]}),v.jsxs("label",{children:[v.jsx("input",{type:"radio",name:"arrangement",checked:C==="vertical",onChange:()=>z("vertical")}),"纵向"]})]}),v.jsxs("div",{className:"modal-buttons",children:[v.jsx("button",{className:"btn btn-cancel",onClick:I,children:"取消"}),v.jsxs("button",{className:"btn btn-confirm",onClick:k,disabled:O.length===0,children:["插入 (",O.length,")"]})]})]})]})})]})};class iA{static setDPI(e){this.currentDPI=e,this.units.px.conversionFactor=25.4/e}static getDPI(){return this.currentDPI}static toMm(e,t){const A=this.units[t];return A?e*A.conversionFactor:e}static fromMm(e,t){const A=this.units[t];return A?e/A.conversionFactor:e}static convert(e,t,A){const n=this.toMm(e,t);return this.fromMm(n,A)}static toPx(e,t,A=1){return this.toMm(e,t)/this.units.px.conversionFactor*A}static fromPx(e,t,A=1){const i=e/A*this.units.px.conversionFactor;return this.fromMm(i,t)}static format(e,t){var n;const A=((n=this.units[t])==null?void 0:n.precision)||2;return`${e.toFixed(A)}${t}`}static convertMargins(e,t="mm",A="px",n=1){const i={};return e.top!==void 0&&(i.top=this.toPx(e.top,t,n)),e.bottom!==void 0&&(i.bottom=this.toPx(e.bottom,t,n)),e.left!==void 0&&(i.left=this.toPx(e.left,t,n)),e.right!==void 0&&(i.right=this.toPx(e.right,t,n)),i}static getContentArea(e,t,A="mm",n="px",i=1){if(!e||!e.width||!e.height)throw new Error("Page size must have width and height properties");const s=this.convertMargins(t,A,"px",i),a=this.toPx(e.width,A,i),o=this.toPx(e.height,A,i),l=a-(s.left||0)-(s.right||0),u=o-(s.top||0)-(s.bottom||0);return n==="px"?{width:l,height:u,margins:s,pageSize:{width:a,height:o}}:{width:this.fromPx(l,n,i),height:this.fromPx(u,n,i),margins:this.convertMargins(t,A,n),pageSize:{width:this.fromPx(a,n,i),height:this.fromPx(o,n,i)}}}static debugInfo(){return{dpi:this.currentDPI,pxConversionFactor:this.units.px.conversionFactor,sample:{"10mm_to_px":this.toPx(10,"mm"),"100px_to_mm":this.fromPx(100,"mm")}}}}Ht(iA,"currentDPI",96),Ht(iA,"units",{mm:{name:"mm",conversionFactor:1,precision:2},cm:{name:"cm",conversionFactor:10,precision:2},inch:{name:"inch",conversionFactor:25.4,precision:3},px:{name:"px",conversionFactor:25.4/96,precision:2}});function Dt(r){"@babel/helpers - typeof";return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dt(r)}var bn=Uint8Array,XA=Uint16Array,Kh=Int32Array,qh=new bn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Vh=new bn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Nw=new bn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ow=function(r,e){for(var t=new XA(31),A=0;A<31;++A)t[A]=e+=1<<r[A-1];for(var n=new Kh(t[30]),A=1;A<30;++A)for(var i=t[A];i<t[A+1];++i)n[i]=i-t[A]<<5|A;return{b:t,r:n}},Tw=Ow(qh,2),ZU=Tw.b,zh=Tw.r;ZU[28]=258,zh[258]=28;for(var e_=Ow(Vh,0),Lw=e_.r,Gh=new XA(32768),Ar=0;Ar<32768;++Ar){var Hi=(Ar&43690)>>1|(Ar&21845)<<1;Hi=(Hi&52428)>>2|(Hi&13107)<<2,Hi=(Hi&61680)>>4|(Hi&3855)<<4,Gh[Ar]=((Hi&65280)>>8|(Hi&255)<<8)>>1}for(var po=(function(r,e,t){for(var A=r.length,n=0,i=new XA(e);n<A;++n)r[n]&&++i[r[n]-1];var s=new XA(e);for(n=1;n<e;++n)s[n]=s[n-1]+i[n-1]<<1;var a;if(t){a=new XA(1<<e);var o=15-e;for(n=0;n<A;++n)if(r[n])for(var l=n<<4|r[n],u=e-r[n],f=s[r[n]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)a[Gh[f]>>o]=l}else for(a=new XA(A),n=0;n<A;++n)r[n]&&(a[n]=Gh[s[r[n]-1]++]>>15-r[n]);return a}),Ca=new bn(288),Ar=0;Ar<144;++Ar)Ca[Ar]=8;for(var Ar=144;Ar<256;++Ar)Ca[Ar]=9;for(var Ar=256;Ar<280;++Ar)Ca[Ar]=7;for(var Ar=280;Ar<288;++Ar)Ca[Ar]=8;for(var Ou=new bn(32),Ar=0;Ar<32;++Ar)Ou[Ar]=5;var t_=po(Ca,9,0),r_=po(Ou,5,0),Pw=function(r){return(r+7)/8|0},A_=function(r,e,t){return(t==null||t>r.length)&&(t=r.length),new bn(r.subarray(e,t))},oi=function(r,e,t){t<<=e&7;var A=e/8|0;r[A]|=t,r[A+1]|=t>>8},vo=function(r,e,t){t<<=e&7;var A=e/8|0;r[A]|=t,r[A+1]|=t>>8,r[A+2]|=t>>16},Wh=function(r,e){for(var t=[],A=0;A<r.length;++A)r[A]&&t.push({s:A,f:r[A]});var n=t.length,i=t.slice();if(!n)return{t:kw,l:0};if(n==1){var s=new bn(t[0].s+1);return s[t[0].s]=1,{t:s,l:1}}t.sort(function(Q,L){return Q.f-L.f}),t.push({s:-1,f:25001});var a=t[0],o=t[1],l=0,u=1,f=2;for(t[0]={s:-1,f:a.f+o.f,l:a,r:o};u!=n-1;)a=t[t[l].f<t[f].f?l++:f++],o=t[l!=u&&t[l].f<t[f].f?l++:f++],t[u++]={s:-1,f:a.f+o.f,l:a,r:o};for(var h=i[0].s,A=1;A<n;++A)i[A].s>h&&(h=i[A].s);var c=new XA(h+1),g=Xh(t[u-1],c,0);if(g>e){var A=0,p=0,y=g-e,w=1<<y;for(i.sort(function(L,S){return c[S.s]-c[L.s]||L.f-S.f});A<n;++A){var B=i[A].s;if(c[B]>e)p+=w-(1<<g-c[B]),c[B]=e;else break}for(p>>=y;p>0;){var x=i[A].s;c[x]<e?p-=1<<e-c[x]++-1:++A}for(;A>=0&&p;--A){var E=i[A].s;c[E]==e&&(--c[E],++p)}g=e}return{t:new bn(c),l:g}},Xh=function(r,e,t){return r.s==-1?Math.max(Xh(r.l,e,t+1),Xh(r.r,e,t+1)):e[r.s]=t},Rw=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new XA(++e),A=0,n=r[0],i=1,s=function(o){t[A++]=o},a=1;a<=e;++a)if(r[a]==n&&a!=e)++i;else{if(!n&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(n),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(n);i=1,n=r[a]}return{c:t.subarray(0,A),n:e}},mo=function(r,e){for(var t=0,A=0;A<e.length;++A)t+=r[A]*e[A];return t},Mw=function(r,e,t){var A=t.length,n=Pw(e+2);r[n]=A&255,r[n+1]=A>>8,r[n+2]=r[n]^255,r[n+3]=r[n+1]^255;for(var i=0;i<A;++i)r[n+i+4]=t[i];return(n+4+A)*8},Dw=function(r,e,t,A,n,i,s,a,o,l,u){oi(e,u++,t),++n[256];for(var f=Wh(n,15),h=f.t,c=f.l,g=Wh(i,15),p=g.t,y=g.l,w=Rw(h),B=w.c,x=w.n,E=Rw(p),Q=E.c,L=E.n,S=new XA(19),T=0;T<B.length;++T)++S[B[T]&31];for(var T=0;T<Q.length;++T)++S[Q[T]&31];for(var _=Wh(S,7),D=_.t,U=_.l,O=19;O>4&&!D[Nw[O-1]];--O);var M=l+5<<3,C=mo(n,Ca)+mo(i,Ou)+s,z=mo(n,h)+mo(i,p)+s+14+3*O+mo(S,D)+2*S[16]+3*S[17]+7*S[18];if(o>=0&&M<=C&&M<=z)return Mw(e,u,r.subarray(o,o+l));var re,ne,Z,Ae;if(oi(e,u,1+(z<C)),u+=2,z<C){re=po(h,c,0),ne=h,Z=po(p,y,0),Ae=p;var V=po(D,U,0);oi(e,u,x-257),oi(e,u+5,L-1),oi(e,u+10,O-4),u+=14;for(var T=0;T<O;++T)oi(e,u+3*T,D[Nw[T]]);u+=3*O;for(var k=[B,Q],I=0;I<2;++I)for(var P=k[I],T=0;T<P.length;++T){var K=P[T]&31;oi(e,u,V[K]),u+=D[K],K>15&&(oi(e,u,P[T]>>5&127),u+=P[T]>>12)}}else re=t_,ne=Ca,Z=r_,Ae=Ou;for(var T=0;T<a;++T){var Y=A[T];if(Y>255){var K=Y>>18&31;vo(e,u,re[K+257]),u+=ne[K+257],K>7&&(oi(e,u,Y>>23&31),u+=qh[K]);var J=Y&31;vo(e,u,Z[J]),u+=Ae[J],J>3&&(vo(e,u,Y>>5&8191),u+=Vh[J])}else vo(e,u,re[Y]),u+=ne[Y]}return vo(e,u,re[256]),u+ne[256]},n_=new Kh([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kw=new bn(0),i_=function(r,e,t,A,n,i){var s=i.z||r.length,a=new bn(A+s+5*(1+Math.ceil(s/7e3))+n),o=a.subarray(A,a.length-n),l=i.l,u=(i.r||0)&7;if(e){u&&(o[0]=i.r>>3);for(var f=n_[e-1],h=f>>13,c=f&8191,g=(1<<t)-1,p=i.p||new XA(32768),y=i.h||new XA(g+1),w=Math.ceil(t/3),B=2*w,x=function(ye){return(r[ye]^r[ye+1]<<w^r[ye+2]<<B)&g},E=new Kh(25e3),Q=new XA(288),L=new XA(32),S=0,T=0,_=i.i||0,D=0,U=i.w||0,O=0;_+2<s;++_){var M=x(_),C=_&32767,z=y[M];if(p[C]=z,y[M]=C,U<=_){var re=s-_;if((S>7e3||D>24576)&&(re>423||!l)){u=Dw(r,o,0,E,Q,L,T,D,O,_-O,u),D=S=T=0,O=_;for(var ne=0;ne<286;++ne)Q[ne]=0;for(var ne=0;ne<30;++ne)L[ne]=0}var Z=2,Ae=0,V=c,k=C-z&32767;if(re>2&&M==x(_-k))for(var I=Math.min(h,re)-1,P=Math.min(32767,_),K=Math.min(258,re);k<=P&&--V&&C!=z;){if(r[_+Z]==r[_+Z-k]){for(var Y=0;Y<K&&r[_+Y]==r[_+Y-k];++Y);if(Y>Z){if(Z=Y,Ae=k,Y>I)break;for(var J=Math.min(k,Y-2),q=0,ne=0;ne<J;++ne){var W=_-k+ne&32767,te=p[W],oe=W-te&32767;oe>q&&(q=oe,z=W)}}}C=z,z=p[C],k+=C-z&32767}if(Ae){E[D++]=268435456|zh[Z]<<18|Lw[Ae];var we=zh[Z]&31,le=Lw[Ae]&31;T+=qh[we]+Vh[le],++Q[257+we],++L[le],U=_+Z,++S}else E[D++]=r[_],++Q[r[_]]}}for(_=Math.max(_,U);_<s;++_)E[D++]=r[_],++Q[r[_]];u=Dw(r,o,l,E,Q,L,T,D,O,_-O,u),l||(i.r=u&7|o[u/8|0]<<3,u-=7,i.h=y,i.p=p,i.i=_,i.w=U)}else{for(var _=i.w||0;_<s+l;_+=65535){var Be=_+65535;Be>=s&&(o[u/8|0]=l,Be=s),u=Mw(o,u+1,r.subarray(_,Be))}i.i=s}return A_(a,0,A+Pw(u)+n)},Hw=function(){var r=1,e=0;return{p:function(t){for(var A=r,n=e,i=t.length|0,s=0;s!=i;){for(var a=Math.min(s+2655,i);s<a;++s)n+=A+=t[s];A=(A&65535)+15*(A>>16),n=(n&65535)+15*(n>>16)}r=A,e=n},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},a_=function(r,e,t,A,n){if(!n&&(n={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),s=new bn(i.length+r.length);s.set(i),s.set(r,i.length),r=s,n.w=i.length}return i_(r,e.level==null?6:e.level,e.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,A,n)},jw=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},s_=function(r,e){var t=e.level,A=t==0?0:t<6?1:t==9?3:2;if(r[0]=120,r[1]=A<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var n=Hw();n.p(e.dictionary),jw(r,2,n.d())}};function Yh(r,e){e||(e={});var t=Hw();t.p(r);var A=a_(r,e,e.dictionary?6:2,4);return s_(A,e),jw(A,A.length-4,t.d()),A}var o_=typeof TextDecoder<"u"&&new TextDecoder,l_=0;try{o_.decode(kw,{stream:!0}),l_=1}catch{}function u_(r){if(Array.isArray(r))return r}function c_(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var A,n,i,s,a=[],o=!0,l=!1;try{if(i=(t=t.call(r)).next,e!==0)for(;!(o=(A=i.call(t)).done)&&(a.push(A.value),a.length!==e);o=!0);}catch(u){l=!0,n=u}finally{try{if(!o&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw n}}return a}}function Kw(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,A=Array(e);t<e;t++)A[t]=r[t];return A}function f_(r,e){if(r){if(typeof r=="string")return Kw(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Kw(r,e):void 0}}function h_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
496
496
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qw(r,e){return u_(r)||c_(r,e)||f_(r,e)||h_()}function Vw(r,e="utf8"){return new TextDecoder(e).decode(r)}const d_=new TextEncoder;function g_(r){return d_.encode(r)}const p_=1024*8,v_=(()=>{const r=new Uint8Array(4),e=new Uint32Array(r.buffer);return!((e[0]=1)&r[0])})(),$h={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class Jh{constructor(e=p_,t={}){Ht(this,"buffer");Ht(this,"byteLength");Ht(this,"byteOffset");Ht(this,"length");Ht(this,"offset");Ht(this,"lastWrittenByte");Ht(this,"littleEndian");Ht(this,"_data");Ht(this,"_mark");Ht(this,"_marks");let A=!1;typeof e=="number"?e=new ArrayBuffer(e):(A=!0,this.lastWrittenByte=e.byteLength);const n=t.offset?t.offset>>>0:0,i=e.byteLength-n;let s=n;(ArrayBuffer.isView(e)||e instanceof Jh)&&(e.byteLength!==e.buffer.byteLength&&(s=e.byteOffset+n),e=e.buffer),A?this.lastWrittenByte=i:this.lastWrittenByte=0,this.buffer=e,this.length=i,this.byteLength=i,this.byteOffset=s,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,s,i),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const A=(this.offset+e)*2,n=new Uint8Array(A);n.set(new Uint8Array(this.buffer)),this.buffer=n.buffer,this.length=A,this.byteLength=A,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){const A=$h[t].BYTES_PER_ELEMENT*e,n=this.byteOffset+this.offset,i=this.buffer.slice(n,n+A);if(this.littleEndian===v_&&t!=="uint8"&&t!=="int8"){const a=new Uint8Array(this.buffer.slice(n,n+A));a.reverse();const o=new $h[t](a.buffer);return this.offset+=A,o.reverse(),o}const s=new $h[t](i);return this.offset+=A,s}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let A=0;A<e;A++)t+=this.readChar();return t}readUtf8(e=1){return Vw(this.readBytes(e))}decodeText(e=1,t="utf8"){return Vw(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){return this.writeBytes(g_(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function ds(r){let e=r.length;for(;--e>=0;)r[e]=0}const m_=3,w_=258,zw=29,y_=256+1+zw,Gw=30,B_=512,b_=new Array((y_+2)*2);ds(b_);const x_=new Array(Gw*2);ds(x_);const C_=new Array(B_);ds(C_);const E_=new Array(w_-m_+1);ds(E_);const F_=new Array(zw);ds(F_);const S_=new Array(Gw);ds(S_);var Zh=(r,e,t,A)=>{let n=r&65535|0,i=r>>>16&65535|0,s=0;for(;t!==0;){s=t>2e3?2e3:t,t-=s;do n=n+e[A++]|0,i=i+n|0;while(--s);n%=65521,i%=65521}return n|i<<16|0};const U_=()=>{let r,e=[];for(var t=0;t<256;t++){r=t;for(var A=0;A<8;A++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e},__=new Uint32Array(U_());var jn=(r,e,t,A)=>{const n=__,i=A+t;r^=-1;for(let s=A;s<i;s++)r=r>>>8^n[(r^e[s])&255];return r^-1},ed={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ww={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const I_=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var Q_=function(r){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const A in t)I_(t,A)&&(r[A]=t[A])}}return r},N_=r=>{let e=0;for(let A=0,n=r.length;A<n;A++)e+=r[A].length;const t=new Uint8Array(e);for(let A=0,n=0,i=r.length;A<i;A++){let s=r[A];t.set(s,n),n+=s.length}return t},Xw={assign:Q_,flattenChunks:N_};let Yw=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Yw=!1}const wo=new Uint8Array(256);for(let r=0;r<256;r++)wo[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;wo[254]=wo[254]=1;var O_=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let e,t,A,n,i,s=r.length,a=0;for(n=0;n<s;n++)t=r.charCodeAt(n),(t&64512)===55296&&n+1<s&&(A=r.charCodeAt(n+1),(A&64512)===56320&&(t=65536+(t-55296<<10)+(A-56320),n++)),a+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(a),i=0,n=0;i<a;n++)t=r.charCodeAt(n),(t&64512)===55296&&n+1<s&&(A=r.charCodeAt(n+1),(A&64512)===56320&&(t=65536+(t-55296<<10)+(A-56320),n++)),t<128?e[i++]=t:t<2048?(e[i++]=192|t>>>6,e[i++]=128|t&63):t<65536?(e[i++]=224|t>>>12,e[i++]=128|t>>>6&63,e[i++]=128|t&63):(e[i++]=240|t>>>18,e[i++]=128|t>>>12&63,e[i++]=128|t>>>6&63,e[i++]=128|t&63);return e};const T_=(r,e)=>{if(e<65534&&r.subarray&&Yw)return String.fromCharCode.apply(null,r.length===e?r:r.subarray(0,e));let t="";for(let A=0;A<e;A++)t+=String.fromCharCode(r[A]);return t};var L_=(r,e)=>{const t=e||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,e));let A,n;const i=new Array(t*2);for(n=0,A=0;A<t;){let s=r[A++];if(s<128){i[n++]=s;continue}let a=wo[s];if(a>4){i[n++]=65533,A+=a-1;continue}for(s&=a===2?31:a===3?15:7;a>1&&A<t;)s=s<<6|r[A++]&63,a--;if(a>1){i[n++]=65533;continue}s<65536?i[n++]=s:(s-=65536,i[n++]=55296|s>>10&1023,i[n++]=56320|s&1023)}return T_(i,n)},P_=(r,e)=>{e=e||r.length,e>r.length&&(e=r.length);let t=e-1;for(;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+wo[r[t]]>e?t:e},td={string2buf:O_,buf2string:L_,utf8border:P_};function R_(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var M_=R_;const Tu=16209,D_=16191;var k_=function(e,t){let A,n,i,s,a,o,l,u,f,h,c,g,p,y,w,B,x,E,Q,L,S,T,_,D;const U=e.state;A=e.next_in,_=e.input,n=A+(e.avail_in-5),i=e.next_out,D=e.output,s=i-(t-e.avail_out),a=i+(e.avail_out-257),o=U.dmax,l=U.wsize,u=U.whave,f=U.wnext,h=U.window,c=U.hold,g=U.bits,p=U.lencode,y=U.distcode,w=(1<<U.lenbits)-1,B=(1<<U.distbits)-1;e:do{g<15&&(c+=_[A++]<<g,g+=8,c+=_[A++]<<g,g+=8),x=p[c&w];t:for(;;){if(E=x>>>24,c>>>=E,g-=E,E=x>>>16&255,E===0)D[i++]=x&65535;else if(E&16){Q=x&65535,E&=15,E&&(g<E&&(c+=_[A++]<<g,g+=8),Q+=c&(1<<E)-1,c>>>=E,g-=E),g<15&&(c+=_[A++]<<g,g+=8,c+=_[A++]<<g,g+=8),x=y[c&B];r:for(;;){if(E=x>>>24,c>>>=E,g-=E,E=x>>>16&255,E&16){if(L=x&65535,E&=15,g<E&&(c+=_[A++]<<g,g+=8,g<E&&(c+=_[A++]<<g,g+=8)),L+=c&(1<<E)-1,L>o){e.msg="invalid distance too far back",U.mode=Tu;break e}if(c>>>=E,g-=E,E=i-s,L>E){if(E=L-E,E>u&&U.sane){e.msg="invalid distance too far back",U.mode=Tu;break e}if(S=0,T=h,f===0){if(S+=l-E,E<Q){Q-=E;do D[i++]=h[S++];while(--E);S=i-L,T=D}}else if(f<E){if(S+=l+f-E,E-=f,E<Q){Q-=E;do D[i++]=h[S++];while(--E);if(S=0,f<Q){E=f,Q-=E;do D[i++]=h[S++];while(--E);S=i-L,T=D}}}else if(S+=f-E,E<Q){Q-=E;do D[i++]=h[S++];while(--E);S=i-L,T=D}for(;Q>2;)D[i++]=T[S++],D[i++]=T[S++],D[i++]=T[S++],Q-=3;Q&&(D[i++]=T[S++],Q>1&&(D[i++]=T[S++]))}else{S=i-L;do D[i++]=D[S++],D[i++]=D[S++],D[i++]=D[S++],Q-=3;while(Q>2);Q&&(D[i++]=D[S++],Q>1&&(D[i++]=D[S++]))}}else if((E&64)===0){x=y[(x&65535)+(c&(1<<E)-1)];continue r}else{e.msg="invalid distance code",U.mode=Tu;break e}break}}else if((E&64)===0){x=p[(x&65535)+(c&(1<<E)-1)];continue t}else if(E&32){U.mode=D_;break e}else{e.msg="invalid literal/length code",U.mode=Tu;break e}break}}while(A<n&&i<a);Q=g>>3,A-=Q,g-=Q<<3,c&=(1<<g)-1,e.next_in=A,e.next_out=i,e.avail_in=A<n?5+(n-A):5-(A-n),e.avail_out=i<a?257+(a-i):257-(i-a),U.hold=c,U.bits=g};const gs=15,$w=852,Jw=592,Zw=0,rd=1,ey=2,H_=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),j_=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),K_=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),q_=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var yo=(r,e,t,A,n,i,s,a)=>{const o=a.bits;let l=0,u=0,f=0,h=0,c=0,g=0,p=0,y=0,w=0,B=0,x,E,Q,L,S,T=null,_;const D=new Uint16Array(gs+1),U=new Uint16Array(gs+1);let O=null,M,C,z;for(l=0;l<=gs;l++)D[l]=0;for(u=0;u<A;u++)D[e[t+u]]++;for(c=o,h=gs;h>=1&&D[h]===0;h--);if(c>h&&(c=h),h===0)return n[i++]=1<<24|64<<16|0,n[i++]=1<<24|64<<16|0,a.bits=1,0;for(f=1;f<h&&D[f]===0;f++);for(c<f&&(c=f),y=1,l=1;l<=gs;l++)if(y<<=1,y-=D[l],y<0)return-1;if(y>0&&(r===Zw||h!==1))return-1;for(U[1]=0,l=1;l<gs;l++)U[l+1]=U[l]+D[l];for(u=0;u<A;u++)e[t+u]!==0&&(s[U[e[t+u]]++]=u);if(r===Zw?(T=O=s,_=20):r===rd?(T=H_,O=j_,_=257):(T=K_,O=q_,_=0),B=0,u=0,l=f,S=i,g=c,p=0,Q=-1,w=1<<c,L=w-1,r===rd&&w>$w||r===ey&&w>Jw)return 1;for(;;){M=l-p,s[u]+1<_?(C=0,z=s[u]):s[u]>=_?(C=O[s[u]-_],z=T[s[u]-_]):(C=96,z=0),x=1<<l-p,E=1<<g,f=E;do E-=x,n[S+(B>>p)+E]=M<<24|C<<16|z|0;while(E!==0);for(x=1<<l-1;B&x;)x>>=1;if(x!==0?(B&=x-1,B+=x):B=0,u++,--D[l]===0){if(l===h)break;l=e[t+s[u]]}if(l>c&&(B&L)!==Q){for(p===0&&(p=c),S+=f,g=l-p,y=1<<g;g+p<h&&(y-=D[g+p],!(y<=0));)g++,y<<=1;if(w+=1<<g,r===rd&&w>$w||r===ey&&w>Jw)return 1;Q=B&L,n[Q]=c<<24|g<<16|S-i|0}}return B!==0&&(n[S+B]=l-p<<24|64<<16|0),a.bits=c,0};const V_=0,ty=1,ry=2,{Z_FINISH:Ay,Z_BLOCK:z_,Z_TREES:Lu,Z_OK:Ea,Z_STREAM_END:G_,Z_NEED_DICT:W_,Z_STREAM_ERROR:sn,Z_DATA_ERROR:ny,Z_MEM_ERROR:iy,Z_BUF_ERROR:X_,Z_DEFLATED:ay}=Ww,Pu=16180,sy=16181,oy=16182,ly=16183,uy=16184,cy=16185,fy=16186,hy=16187,dy=16188,gy=16189,Ru=16190,li=16191,Ad=16192,py=16193,nd=16194,vy=16195,my=16196,wy=16197,yy=16198,Mu=16199,Du=16200,By=16201,by=16202,xy=16203,Cy=16204,Ey=16205,id=16206,Fy=16207,Sy=16208,ar=16209,Uy=16210,_y=16211,Y_=852,$_=592,J_=15,Iy=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function Z_(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Fa=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.mode<Pu||e.mode>_y?1:0},Qy=r=>{if(Fa(r))return sn;const e=r.state;return r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=Pu,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Y_),e.distcode=e.distdyn=new Int32Array($_),e.sane=1,e.back=-1,Ea},Ny=r=>{if(Fa(r))return sn;const e=r.state;return e.wsize=0,e.whave=0,e.wnext=0,Qy(r)},Oy=(r,e)=>{let t;if(Fa(r))return sn;const A=r.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?sn:(A.window!==null&&A.wbits!==e&&(A.window=null),A.wrap=t,A.wbits=e,Ny(r))},Ty=(r,e)=>{if(!r)return sn;const t=new Z_;r.state=t,t.strm=r,t.window=null,t.mode=Pu;const A=Oy(r,e);return A!==Ea&&(r.state=null),A},eI=r=>Ty(r,J_);let Ly=!0,ad,sd;const tI=r=>{if(Ly){ad=new Int32Array(512),sd=new Int32Array(32);let e=0;for(;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(yo(ty,r.lens,0,288,ad,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;yo(ry,r.lens,0,32,sd,0,r.work,{bits:5}),Ly=!1}r.lencode=ad,r.lenbits=9,r.distcode=sd,r.distbits=5},Py=(r,e,t,A)=>{let n;const i=r.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),A>=i.wsize?(i.window.set(e.subarray(t-i.wsize,t),0),i.wnext=0,i.whave=i.wsize):(n=i.wsize-i.wnext,n>A&&(n=A),i.window.set(e.subarray(t-A,t-A+n),i.wnext),A-=n,A?(i.window.set(e.subarray(t-A,t),0),i.wnext=A,i.whave=i.wsize):(i.wnext+=n,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=n))),0},rI=(r,e)=>{let t,A,n,i,s,a,o,l,u,f,h,c,g,p,y=0,w,B,x,E,Q,L,S,T;const _=new Uint8Array(4);let D,U;const O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Fa(r)||!r.output||!r.input&&r.avail_in!==0)return sn;t=r.state,t.mode===li&&(t.mode=Ad),s=r.next_out,n=r.output,o=r.avail_out,i=r.next_in,A=r.input,a=r.avail_in,l=t.hold,u=t.bits,f=a,h=o,T=Ea;e:for(;;)switch(t.mode){case Pu:if(t.wrap===0){t.mode=Ad;break}for(;u<16;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}if(t.wrap&2&&l===35615){t.wbits===0&&(t.wbits=15),t.check=0,_[0]=l&255,_[1]=l>>>8&255,t.check=jn(t.check,_,2,0),l=0,u=0,t.mode=sy;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((l&255)<<8)+(l>>8))%31){r.msg="incorrect header check",t.mode=ar;break}if((l&15)!==ay){r.msg="unknown compression method",t.mode=ar;break}if(l>>>=4,u-=4,S=(l&15)+8,t.wbits===0&&(t.wbits=S),S>15||S>t.wbits){r.msg="invalid window size",t.mode=ar;break}t.dmax=1<<t.wbits,t.flags=0,r.adler=t.check=1,t.mode=l&512?gy:li,l=0,u=0;break;case sy:for(;u<16;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}if(t.flags=l,(t.flags&255)!==ay){r.msg="unknown compression method",t.mode=ar;break}if(t.flags&57344){r.msg="unknown header flags set",t.mode=ar;break}t.head&&(t.head.text=l>>8&1),t.flags&512&&t.wrap&4&&(_[0]=l&255,_[1]=l>>>8&255,t.check=jn(t.check,_,2,0)),l=0,u=0,t.mode=oy;case oy:for(;u<32;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}t.head&&(t.head.time=l),t.flags&512&&t.wrap&4&&(_[0]=l&255,_[1]=l>>>8&255,_[2]=l>>>16&255,_[3]=l>>>24&255,t.check=jn(t.check,_,4,0)),l=0,u=0,t.mode=ly;case ly:for(;u<16;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}t.head&&(t.head.xflags=l&255,t.head.os=l>>8),t.flags&512&&t.wrap&4&&(_[0]=l&255,_[1]=l>>>8&255,t.check=jn(t.check,_,2,0)),l=0,u=0,t.mode=uy;case uy:if(t.flags&1024){for(;u<16;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}t.length=l,t.head&&(t.head.extra_len=l),t.flags&512&&t.wrap&4&&(_[0]=l&255,_[1]=l>>>8&255,t.check=jn(t.check,_,2,0)),l=0,u=0}else t.head&&(t.head.extra=null);t.mode=cy;case cy:if(t.flags&1024&&(c=t.length,c>a&&(c=a),c&&(t.head&&(S=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(A.subarray(i,i+c),S)),t.flags&512&&t.wrap&4&&(t.check=jn(t.check,A,c,i)),a-=c,i+=c,t.length-=c),t.length))break e;t.length=0,t.mode=fy;case fy:if(t.flags&2048){if(a===0)break e;c=0;do S=A[i+c++],t.head&&S&&t.length<65536&&(t.head.name+=String.fromCharCode(S));while(S&&c<a);if(t.flags&512&&t.wrap&4&&(t.check=jn(t.check,A,c,i)),a-=c,i+=c,S)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=hy;case hy:if(t.flags&4096){if(a===0)break e;c=0;do S=A[i+c++],t.head&&S&&t.length<65536&&(t.head.comment+=String.fromCharCode(S));while(S&&c<a);if(t.flags&512&&t.wrap&4&&(t.check=jn(t.check,A,c,i)),a-=c,i+=c,S)break e}else t.head&&(t.head.comment=null);t.mode=dy;case dy:if(t.flags&512){for(;u<16;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}if(t.wrap&4&&l!==(t.check&65535)){r.msg="header crc mismatch",t.mode=ar;break}l=0,u=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=li;break;case gy:for(;u<32;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}r.adler=t.check=Iy(l),l=0,u=0,t.mode=Ru;case Ru:if(t.havedict===0)return r.next_out=s,r.avail_out=o,r.next_in=i,r.avail_in=a,t.hold=l,t.bits=u,W_;r.adler=t.check=1,t.mode=li;case li:if(e===z_||e===Lu)break e;case Ad:if(t.last){l>>>=u&7,u-=u&7,t.mode=id;break}for(;u<3;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}switch(t.last=l&1,l>>>=1,u-=1,l&3){case 0:t.mode=py;break;case 1:if(tI(t),t.mode=Mu,e===Lu){l>>>=2,u-=2;break e}break;case 2:t.mode=my;break;case 3:r.msg="invalid block type",t.mode=ar}l>>>=2,u-=2;break;case py:for(l>>>=u&7,u-=u&7;u<32;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}if((l&65535)!==(l>>>16^65535)){r.msg="invalid stored block lengths",t.mode=ar;break}if(t.length=l&65535,l=0,u=0,t.mode=nd,e===Lu)break e;case nd:t.mode=vy;case vy:if(c=t.length,c){if(c>a&&(c=a),c>o&&(c=o),c===0)break e;n.set(A.subarray(i,i+c),s),a-=c,i+=c,o-=c,s+=c,t.length-=c;break}t.mode=li;break;case my:for(;u<14;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}if(t.nlen=(l&31)+257,l>>>=5,u-=5,t.ndist=(l&31)+1,l>>>=5,u-=5,t.ncode=(l&15)+4,l>>>=4,u-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=ar;break}t.have=0,t.mode=wy;case wy:for(;t.have<t.ncode;){for(;u<3;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}t.lens[O[t.have++]]=l&7,l>>>=3,u-=3}for(;t.have<19;)t.lens[O[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,D={bits:t.lenbits},T=yo(V_,t.lens,0,19,t.lencode,0,t.work,D),t.lenbits=D.bits,T){r.msg="invalid code lengths set",t.mode=ar;break}t.have=0,t.mode=yy;case yy:for(;t.have<t.nlen+t.ndist;){for(;y=t.lencode[l&(1<<t.lenbits)-1],w=y>>>24,B=y>>>16&255,x=y&65535,!(w<=u);){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}if(x<16)l>>>=w,u-=w,t.lens[t.have++]=x;else{if(x===16){for(U=w+2;u<U;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}if(l>>>=w,u-=w,t.have===0){r.msg="invalid bit length repeat",t.mode=ar;break}S=t.lens[t.have-1],c=3+(l&3),l>>>=2,u-=2}else if(x===17){for(U=w+3;u<U;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}l>>>=w,u-=w,S=0,c=3+(l&7),l>>>=3,u-=3}else{for(U=w+7;u<U;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}l>>>=w,u-=w,S=0,c=11+(l&127),l>>>=7,u-=7}if(t.have+c>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=ar;break}for(;c--;)t.lens[t.have++]=S}}if(t.mode===ar)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=ar;break}if(t.lenbits=9,D={bits:t.lenbits},T=yo(ty,t.lens,0,t.nlen,t.lencode,0,t.work,D),t.lenbits=D.bits,T){r.msg="invalid literal/lengths set",t.mode=ar;break}if(t.distbits=6,t.distcode=t.distdyn,D={bits:t.distbits},T=yo(ry,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,D),t.distbits=D.bits,T){r.msg="invalid distances set",t.mode=ar;break}if(t.mode=Mu,e===Lu)break e;case Mu:t.mode=Du;case Du:if(a>=6&&o>=258){r.next_out=s,r.avail_out=o,r.next_in=i,r.avail_in=a,t.hold=l,t.bits=u,k_(r,h),s=r.next_out,n=r.output,o=r.avail_out,i=r.next_in,A=r.input,a=r.avail_in,l=t.hold,u=t.bits,t.mode===li&&(t.back=-1);break}for(t.back=0;y=t.lencode[l&(1<<t.lenbits)-1],w=y>>>24,B=y>>>16&255,x=y&65535,!(w<=u);){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}if(B&&(B&240)===0){for(E=w,Q=B,L=x;y=t.lencode[L+((l&(1<<E+Q)-1)>>E)],w=y>>>24,B=y>>>16&255,x=y&65535,!(E+w<=u);){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}l>>>=E,u-=E,t.back+=E}if(l>>>=w,u-=w,t.back+=w,t.length=x,B===0){t.mode=Ey;break}if(B&32){t.back=-1,t.mode=li;break}if(B&64){r.msg="invalid literal/length code",t.mode=ar;break}t.extra=B&15,t.mode=By;case By:if(t.extra){for(U=t.extra;u<U;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}t.length+=l&(1<<t.extra)-1,l>>>=t.extra,u-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=by;case by:for(;y=t.distcode[l&(1<<t.distbits)-1],w=y>>>24,B=y>>>16&255,x=y&65535,!(w<=u);){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}if((B&240)===0){for(E=w,Q=B,L=x;y=t.distcode[L+((l&(1<<E+Q)-1)>>E)],w=y>>>24,B=y>>>16&255,x=y&65535,!(E+w<=u);){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}l>>>=E,u-=E,t.back+=E}if(l>>>=w,u-=w,t.back+=w,B&64){r.msg="invalid distance code",t.mode=ar;break}t.offset=x,t.extra=B&15,t.mode=xy;case xy:if(t.extra){for(U=t.extra;u<U;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}t.offset+=l&(1<<t.extra)-1,l>>>=t.extra,u-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=ar;break}t.mode=Cy;case Cy:if(o===0)break e;if(c=h-o,t.offset>c){if(c=t.offset-c,c>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=ar;break}c>t.wnext?(c-=t.wnext,g=t.wsize-c):g=t.wnext-c,c>t.length&&(c=t.length),p=t.window}else p=n,g=s-t.offset,c=t.length;c>o&&(c=o),o-=c,t.length-=c;do n[s++]=p[g++];while(--c);t.length===0&&(t.mode=Du);break;case Ey:if(o===0)break e;n[s++]=t.length,o--,t.mode=Du;break;case id:if(t.wrap){for(;u<32;){if(a===0)break e;a--,l|=A[i++]<<u,u+=8}if(h-=o,r.total_out+=h,t.total+=h,t.wrap&4&&h&&(r.adler=t.check=t.flags?jn(t.check,n,h,s-h):Zh(t.check,n,h,s-h)),h=o,t.wrap&4&&(t.flags?l:Iy(l))!==t.check){r.msg="incorrect data check",t.mode=ar;break}l=0,u=0}t.mode=Fy;case Fy:if(t.wrap&&t.flags){for(;u<32;){if(a===0)break e;a--,l+=A[i++]<<u,u+=8}if(t.wrap&4&&l!==(t.total&4294967295)){r.msg="incorrect length check",t.mode=ar;break}l=0,u=0}t.mode=Sy;case Sy:T=G_;break e;case ar:T=ny;break e;case Uy:return iy;case _y:default:return sn}return r.next_out=s,r.avail_out=o,r.next_in=i,r.avail_in=a,t.hold=l,t.bits=u,(t.wsize||h!==r.avail_out&&t.mode<ar&&(t.mode<id||e!==Ay))&&Py(r,r.output,r.next_out,h-r.avail_out),f-=r.avail_in,h-=r.avail_out,r.total_in+=f,r.total_out+=h,t.total+=h,t.wrap&4&&h&&(r.adler=t.check=t.flags?jn(t.check,n,h,r.next_out-h):Zh(t.check,n,h,r.next_out-h)),r.data_type=t.bits+(t.last?64:0)+(t.mode===li?128:0)+(t.mode===Mu||t.mode===nd?256:0),(f===0&&h===0||e===Ay)&&T===Ea&&(T=X_),T},AI=r=>{if(Fa(r))return sn;let e=r.state;return e.window&&(e.window=null),r.state=null,Ea},nI=(r,e)=>{if(Fa(r))return sn;const t=r.state;return(t.wrap&2)===0?sn:(t.head=e,e.done=!1,Ea)},iI=(r,e)=>{const t=e.length;let A,n,i;return Fa(r)||(A=r.state,A.wrap!==0&&A.mode!==Ru)?sn:A.mode===Ru&&(n=1,n=Zh(n,e,t,0),n!==A.check)?ny:(i=Py(r,e,t,t),i?(A.mode=Uy,iy):(A.havedict=1,Ea))};var aI=Ny,sI=Oy,oI=Qy,lI=eI,uI=Ty,cI=rI,fI=AI,hI=nI,dI=iI,gI="pako inflate (from Nodeca project)",ui={inflateReset:aI,inflateReset2:sI,inflateResetKeep:oI,inflateInit:lI,inflateInit2:uI,inflate:cI,inflateEnd:fI,inflateGetHeader:hI,inflateSetDictionary:dI,inflateInfo:gI};function pI(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var vI=pI;const Ry=Object.prototype.toString,{Z_NO_FLUSH:mI,Z_FINISH:wI,Z_OK:Bo,Z_STREAM_END:od,Z_NEED_DICT:ld,Z_STREAM_ERROR:yI,Z_DATA_ERROR:My,Z_MEM_ERROR:BI}=Ww;function bo(r){this.options=Xw.assign({chunkSize:1024*64,windowBits:15,to:""},r||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new M_,this.strm.avail_out=0;let t=ui.inflateInit2(this.strm,e.windowBits);if(t!==Bo)throw new Error(ed[t]);if(this.header=new vI,ui.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=td.string2buf(e.dictionary):Ry.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=ui.inflateSetDictionary(this.strm,e.dictionary),t!==Bo)))throw new Error(ed[t])}bo.prototype.push=function(r,e){const t=this.strm,A=this.options.chunkSize,n=this.options.dictionary;let i,s,a;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?wI:mI,Ry.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(A),t.next_out=0,t.avail_out=A),i=ui.inflate(t,s),i===ld&&n&&(i=ui.inflateSetDictionary(t,n),i===Bo?i=ui.inflate(t,s):i===My&&(i=ld));t.avail_in>0&&i===od&&t.state.wrap>0&&r[t.next_in]!==0;)ui.inflateReset(t),i=ui.inflate(t,s);switch(i){case yI:case My:case ld:case BI:return this.onEnd(i),this.ended=!0,!1}if(a=t.avail_out,t.next_out&&(t.avail_out===0||i===od))if(this.options.to==="string"){let o=td.utf8border(t.output,t.next_out),l=t.next_out-o,u=td.buf2string(t.output,o);t.next_out=l,t.avail_out=A-l,l&&t.output.set(t.output.subarray(o,o+l),0),this.onData(u)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(i===Bo&&a===0)){if(i===od)return i=ui.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},bo.prototype.onData=function(r){this.chunks.push(r)},bo.prototype.onEnd=function(r){r===Bo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Xw.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function bI(r,e){const t=new bo(e);if(t.push(r),t.err)throw t.msg||ed[t.err];return t.result}var xI=bo,CI=bI,EI={Inflate:xI,inflate:CI};const{Inflate:FI,inflate:SI}=EI;var Dy=FI,UI=SI;const ky=[];for(let r=0;r<256;r++){let e=r;for(let t=0;t<8;t++)e&1?e=3988292384^e>>>1:e=e>>>1;ky[r]=e}const Hy=4294967295;function _I(r,e,t){let A=r;for(let n=0;n<t;n++)A=ky[(A^e[n])&255]^A>>>8;return A}function II(r,e){return(_I(Hy,r,e)^Hy)>>>0}function jy(r,e,t){const A=r.readUint32(),n=II(new Uint8Array(r.buffer,r.byteOffset+r.offset-e-4,e),e);if(n!==A)throw new Error(`CRC mismatch for chunk ${t}. Expected ${A}, found ${n}`)}function Ky(r,e,t){for(let A=0;A<t;A++)e[A]=r[A]}function qy(r,e,t,A){let n=0;for(;n<A;n++)e[n]=r[n];for(;n<t;n++)e[n]=r[n]+e[n-A]&255}function Vy(r,e,t,A){let n=0;if(t.length===0)for(;n<A;n++)e[n]=r[n];else for(;n<A;n++)e[n]=r[n]+t[n]&255}function zy(r,e,t,A,n){let i=0;if(t.length===0){for(;i<n;i++)e[i]=r[i];for(;i<A;i++)e[i]=r[i]+(e[i-n]>>1)&255}else{for(;i<n;i++)e[i]=r[i]+(t[i]>>1)&255;for(;i<A;i++)e[i]=r[i]+(e[i-n]+t[i]>>1)&255}}function Gy(r,e,t,A,n){let i=0;if(t.length===0){for(;i<n;i++)e[i]=r[i];for(;i<A;i++)e[i]=r[i]+e[i-n]&255}else{for(;i<n;i++)e[i]=r[i]+t[i]&255;for(;i<A;i++)e[i]=r[i]+QI(e[i-n],t[i],t[i-n])&255}}function QI(r,e,t){const A=r+e-t,n=Math.abs(A-r),i=Math.abs(A-e),s=Math.abs(A-t);return n<=i&&n<=s?r:i<=s?e:t}function NI(r,e,t,A,n,i){switch(r){case 0:Ky(e,t,n);break;case 1:qy(e,t,n,i);break;case 2:Vy(e,t,A,n);break;case 3:zy(e,t,A,n,i);break;case 4:Gy(e,t,A,n,i);break;default:throw new Error(`Unsupported filter: ${r}`)}}const OI=new Uint16Array([255]),TI=new Uint8Array(OI.buffer)[0]===255;function LI(r){const{data:e,width:t,height:A,channels:n,depth:i}=r,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],a=Math.ceil(i/8)*n,o=new Uint8Array(A*t*a);let l=0;for(let u=0;u<7;u++){const f=s[u],h=Math.ceil((t-f.x)/f.xStep),c=Math.ceil((A-f.y)/f.yStep);if(h<=0||c<=0)continue;const g=h*a,p=new Uint8Array(g);for(let y=0;y<c;y++){const w=e[l++],B=e.subarray(l,l+g);l+=g;const x=new Uint8Array(g);NI(w,B,x,p,g,a),p.set(x);for(let E=0;E<h;E++){const Q=f.x+E*f.xStep,L=f.y+y*f.yStep;if(!(Q>=t||L>=A))for(let S=0;S<a;S++)o[(L*t+Q)*a+S]=x[E*a+S]}}}if(i===16){const u=new Uint16Array(o.buffer);if(TI)for(let f=0;f<u.length;f++)u[f]=PI(u[f]);return u}else return o}function PI(r){return(r&255)<<8|r>>8&255}const RI=new Uint16Array([255]),MI=new Uint8Array(RI.buffer)[0]===255,DI=new Uint8Array(0);function Wy(r){const{data:e,width:t,height:A,channels:n,depth:i}=r,s=Math.ceil(i/8)*n,a=Math.ceil(i/8*n*t),o=new Uint8Array(A*a);let l=DI,u=0,f,h;for(let c=0;c<A;c++){switch(f=e.subarray(u+1,u+1+a),h=o.subarray(c*a,(c+1)*a),e[u]){case 0:Ky(f,h,a);break;case 1:qy(f,h,a,s);break;case 2:Vy(f,h,l,a);break;case 3:zy(f,h,l,a,s);break;case 4:Gy(f,h,l,a,s);break;default:throw new Error(`Unsupported filter: ${e[u]}`)}l=h,u+=a+1}if(i===16){const c=new Uint16Array(o.buffer);if(MI)for(let g=0;g<c.length;g++)c[g]=kI(c[g]);return c}else return o}function kI(r){return(r&255)<<8|r>>8&255}const ku=Uint8Array.of(137,80,78,71,13,10,26,10);function Xy(r){if(!HI(r.readBytes(ku.length)))throw new Error("wrong PNG signature")}function HI(r){if(r.length<ku.length)return!1;for(let e=0;e<ku.length;e++)if(r[e]!==ku[e])return!1;return!0}const jI="tEXt",KI=0,Yy=new TextDecoder("latin1");function qI(r){if(zI(r),r.length===0||r.length>79)throw new Error("keyword length must be between 1 and 79")}const VI=/^[\u0000-\u00FF]*$/;function zI(r){if(!VI.test(r))throw new Error("invalid latin1 text")}function GI(r,e,t){const A=$y(e);r[A]=WI(e,t-A.length-1)}function $y(r){for(r.mark();r.readByte()!==KI;);const e=r.offset;r.reset();const t=Yy.decode(r.readBytes(e-r.offset-1));return r.skip(1),qI(t),t}function WI(r,e){return Yy.decode(r.readBytes(e))}const YA={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},ud={UNKNOWN:-1,DEFLATE:0},Jy={UNKNOWN:-1,ADAPTIVE:0},cd={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},Hu={NONE:0,BACKGROUND:1,PREVIOUS:2},fd={SOURCE:0,OVER:1};class XI extends Jh{constructor(t,A={}){super(t);Ht(this,"_checkCrc");Ht(this,"_inflator");Ht(this,"_png");Ht(this,"_apng");Ht(this,"_end");Ht(this,"_hasPalette");Ht(this,"_palette");Ht(this,"_hasTransparency");Ht(this,"_transparency");Ht(this,"_compressionMethod");Ht(this,"_filterMethod");Ht(this,"_interlaceMethod");Ht(this,"_colorType");Ht(this,"_isAnimated");Ht(this,"_numberOfFrames");Ht(this,"_numberOfPlays");Ht(this,"_frames");Ht(this,"_writingDataChunks");const{checkCrc:n=!1}=A;this._checkCrc=n,this._inflator=new Dy,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=ud.UNKNOWN,this._filterMethod=Jy.UNKNOWN,this._interlaceMethod=cd.UNKNOWN,this._colorType=YA.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Xy(this);!this._end;){const t=this.readUint32(),A=this.readChars(4);this.decodeChunk(t,A)}return this.decodeImage(),this._png}decodeApng(){for(Xy(this);!this._end;){const t=this.readUint32(),A=this.readChars(4);this.decodeApngChunk(t,A)}return this.decodeApngImage(),this._apng}decodeChunk(t,A){const n=this.offset;switch(A){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case jI:GI(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t);break}if(this.offset-n!==t)throw new Error(`Length mismatch while decoding chunk ${A}`);this._checkCrc?jy(this,t+4,A):this.skip(4)}decodeApngChunk(t,A){const n=this.offset;switch(A!=="fdAT"&&A!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),A){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,A),this.offset=n+t;break}if(this.offset-n!==t)throw new Error(`Length mismatch while decoding chunk ${A}`);this._checkCrc?jy(this,t+4,A):this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=YI(this.readUint8());const A=this.readUint8();this._colorType=A;let n;switch(A){case YA.GREYSCALE:n=1;break;case YA.TRUECOLOUR:n=3;break;case YA.INDEXED_COLOUR:n=1;break;case YA.GREYSCALE_ALPHA:n=2;break;case YA.TRUECOLOUR_ALPHA:n=4;break;case YA.UNKNOWN:default:throw new Error(`Unknown color type: ${A}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==ud.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const A=t/3;this._hasPalette=!0;const n=[];this._palette=n;for(let i=0;i<A;i++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._writingDataChunks=!0;const A=t,n=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,n,A)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodeFDAT(t){this._writingDataChunks=!0;let A=t,n=this.offset+this.byteOffset;if(n+=4,A-=4,this._inflator.push(new Uint8Array(this.buffer,n,A)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodetRNS(t){switch(this._colorType){case YA.GREYSCALE:case YA.TRUECOLOUR:{if(t%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);if(t/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let A=0;A<t/2;A++)this._transparency[A]=this.readUint16();break}case YA.INDEXED_COLOUR:{if(t>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let A=0;for(;A<t;A++){const n=this.readByte();this._palette[A].push(n)}for(;A<this._palette.length;A++)this._palette[A].push(255);break}case YA.UNKNOWN:case YA.GREYSCALE_ALPHA:case YA.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(t){const A=$y(this),n=this.readUint8();if(n!==ud.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${n}`);const i=this.readBytes(t-A.length-2);this._png.iccEmbeddedProfile={name:A,profile:UI(i)}}decodepHYs(){const t=this.readUint32(),A=this.readUint32(),n=this.readByte();this._png.resolution={x:t,y:A,unit:n}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let t=0;t<this._numberOfFrames;t++){const A={sequenceNumber:this._frames[t].sequenceNumber,delayNumber:this._frames[t].delayNumber,delayDenominator:this._frames[t].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},n=this._frames.at(t);if(n){if(n.data=Wy({data:n.data,width:n.width,height:n.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),t===0||n.xOffset===0&&n.yOffset===0&&n.width===this._png.width&&n.height===this._png.height)A.data=n.data;else{const i=this._apng.frames.at(t-1);this.disposeFrame(n,i,A),this.addFrameDataToCanvas(A,n)}this._apng.frames.push(A)}}return this._apng}disposeFrame(t,A,n){switch(t.disposeOp){case Hu.NONE:break;case Hu.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let s=0;s<this._png.width;s++){const a=(i*t.width+s)*this._png.channels;for(let o=0;o<this._png.channels;o++)n.data[a+o]=0}break;case Hu.PREVIOUS:n.data.set(A.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(t,A){const n=1<<this._png.depth,i=(s,a)=>{const o=((s+A.yOffset)*this._png.width+A.xOffset+a)*this._png.channels,l=(s*A.width+a)*this._png.channels;return{index:o,frameIndex:l}};switch(A.blendOp){case fd.SOURCE:for(let s=0;s<A.height;s++)for(let a=0;a<A.width;a++){const{index:o,frameIndex:l}=i(s,a);for(let u=0;u<this._png.channels;u++)t.data[o+u]=A.data[l+u]}break;case fd.OVER:for(let s=0;s<A.height;s++)for(let a=0;a<A.width;a++){const{index:o,frameIndex:l}=i(s,a);for(let u=0;u<this._png.channels;u++){const f=A.data[l+this._png.channels-1]/n,h=u%(this._png.channels-1)===0?1:A.data[l+u],c=Math.floor(f*h+(1-f)*t.data[o+u]);t.data[o+u]+=c}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var A;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const t=this._isAnimated?((A=this._frames)==null?void 0:A.at(0)).data:this._inflator.result;if(this._filterMethod!==Jy.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===cd.NO_INTERLACE)this._png.data=Wy({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===cd.ADAM7)this._png.data=LI({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const t=this._inflator.result,A=this._frames.at(-1);A?A.data=t:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:Hu.NONE,blendOp:fd.SOURCE,data:t}),this._inflator=new Dy,this._writingDataChunks=!1}}function YI(r){if(r!==1&&r!==2&&r!==4&&r!==8&&r!==16)throw new Error(`invalid bit depth: ${r}`);return r}var Zy;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.METRE=1]="METRE"})(Zy||(Zy={}));function $I(r,e){return new XI(r,e).decode()}/** @license
|
|
497
497
|
*
|
|
498
498
|
* jsPDF - PDF Document creation from JavaScript
|
|
@@ -571,27 +571,27 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
571
571
|
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
|
|
572
572
|
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
|
|
573
573
|
* http://www.fpdf.org/en/script/script37.php
|
|
574
|
-
*/var iB={print:4,modify:8,copy:16,"annot-forms":32};function ps(r,e,t,A){this.v=1,this.r=2;var n=192;r.forEach(function(a){if(iB.perm!==void 0)throw new Error("Invalid permission: "+a);n+=iB[a]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var i=(e+this.padding).substr(0,32),s=(t+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,s),this.P=-(1+(255^n)),this.encryptionKey=pd(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(A)).substr(0,5),this.U=vd(this.encryptionKey,this.padding)}function vs(r){if(/[^\u0000-\u00ff]/.test(r))throw new Error("Invalid PDF Name Object: "+r+", Only accept ASCII characters.");for(var e="",t=r.length,A=0;A<t;A++){var n=r.charCodeAt(A);e+=n<33||n===35||n===37||n===40||n===41||n===47||n===60||n===62||n===91||n===93||n===123||n===125||n>126?"#"+("0"+n.toString(16)).slice(-2):r[A]}return e}function aB(r){if(Dt(r)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,A,n){if(n=n||!1,typeof t!="string"||typeof A!="function"||typeof n!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var i=Math.random().toString(35);return e[t][i]=[A,!!n],i},this.unsubscribe=function(t){for(var A in e)if(e[A][t])return delete e[A][t],Object.keys(e[A]).length===0&&delete e[A],!0;return!1},this.publish=function(t){if(e.hasOwnProperty(t)){var A=Array.prototype.slice.call(arguments,1),n=[];for(var i in e[t]){var s=e[t][i];try{s[0].apply(r,A)}catch(a){bt.console&&$t.error("jsPDF PubSub Error",a.message,a)}s[1]&&n.push(i)}n.length&&n.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function Vu(r){if(!(this instanceof Vu))return new Vu(r);var e="opacity,stroke-opacity".split(",");for(var t in r)r.hasOwnProperty(t)&&e.indexOf(t)>=0&&(this[t]=r[t]);this.id="",this.objectNumber=-1}function sB(r,e){this.gState=r,this.matrix=e,this.id="",this.objectNumber=-1}function Ua(r,e,t,A,n){if(!(this instanceof Ua))return new Ua(r,e,t,A,n);this.type=r==="axial"?2:3,this.coords=e,this.colors=t,sB.call(this,A,n)}function ms(r,e,t,A,n){if(!(this instanceof ms))return new ms(r,e,t,A,n);this.boundingBox=r,this.xStep=e,this.yStep=t,this.stream="",this.cloneIndex=0,sB.call(this,A,n)}function pt(r){var e,t=typeof arguments[0]=="string"?arguments[0]:"p",A=arguments[1],n=arguments[2],i=arguments[3],s=[],a=1,o=16,l="S",u=null;Dt(r=r||{})==="object"&&(t=r.orientation,A=r.unit||A,n=r.format||n,i=r.compress||r.compressPdf||i,(u=r.encryption||null)!==null&&(u.userPassword=u.userPassword||"",u.ownerPassword=u.ownerPassword||"",u.userPermissions=u.userPermissions||[]),a=typeof r.userUnit=="number"?Math.abs(r.userUnit):1,r.precision!==void 0&&(e=r.precision),r.floatPrecision!==void 0&&(o=r.floatPrecision),l=r.defaultPathOperation||"S"),s=r.filters||(i===!0?["FlateEncode"]:s),A=A||"mm",t=(""+(t||"P")).toLowerCase();var f=r.putOnlyUsedFonts||!1,h={},c={internal:{},__private__:{}};c.__private__.PubSub=aB;var g="1.3",p=c.__private__.getPdfVersion=function(){return g};c.__private__.setPdfVersion=function(b){g=b};var y={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};c.__private__.getPageFormats=function(){return y};var w=c.__private__.getPageFormat=function(b){return y[b]};n=n||"a4";var B="compat",x="advanced",E=B;function Q(){this.saveGraphicsState(),R(new Bt(ue,0,0,-ue,0,$a()*ue).toString()+" cm"),this.setFontSize(this.getFontSize()/ue),l="n",E=x}function L(){this.restoreGraphicsState(),l="S",E=B}var S=c.__private__.combineFontStyleAndFontWeight=function(b,H){if(b=="bold"&&H=="normal"||b=="bold"&&H==400||b=="normal"&&H=="italic"||b=="bold"&&H=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return H&&(b=H==400||H==="normal"?b==="italic"?"italic":"normal":H!=700&&H!=="bold"||b!=="normal"?(H==700?"bold":H)+""+b:"bold"),b};c.advancedAPI=function(b){var H=E===B;return H&&Q.call(this),typeof b!="function"||(b(this),H&&L.call(this)),this},c.compatAPI=function(b){var H=E===x;return H&&L.call(this),typeof b!="function"||(b(this),H&&Q.call(this)),this},c.isAdvancedAPI=function(){return E===x};var T,_=function(b){if(E!==x)throw new Error(b+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},D=c.roundToPrecision=c.__private__.roundToPrecision=function(b,H){var se=e||H;if(isNaN(b)||isNaN(se))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return b.toFixed(se).replace(/0+$/,"")};T=c.hpf=c.__private__.hpf=typeof o=="number"?function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.hpf");return D(b,o)}:o==="smart"?function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.hpf");return D(b,b>-1&&b<1?16:5)}:function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.hpf");return D(b,16)};var U=c.f2=c.__private__.f2=function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.f2");return D(b,2)},O=c.__private__.f3=function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.f3");return D(b,3)},M=c.scale=c.__private__.scale=function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.scale");return E===B?b*ue:E===x?b:void 0},C=function(b){return M((function(H){return E===B?$a()-H:E===x?H:void 0})(b))};c.__private__.setPrecision=c.setPrecision=function(b){typeof parseInt(b,10)=="number"&&(e=parseInt(b,10))};var z,re="00000000000000000000000000000000",ne=c.__private__.getFileId=function(){return re},Z=c.__private__.setFileId=function(b){return re=b!==void 0&&/^[a-fA-F0-9]{32}$/.test(b)?b.toUpperCase():re.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),u!==null&&(Wr=new ps(u.userPermissions,u.userPassword,u.ownerPassword,re)),re};c.setFileId=function(b){return Z(b),this},c.getFileId=function(){return ne()};var Ae=c.__private__.convertDateToPDFDate=function(b){var H=b.getTimezoneOffset(),se=H<0?"+":"-",he=Math.floor(Math.abs(H/60)),be=Math.abs(H%60),Ke=[se,K(he),"'",K(be),"'"].join("");return["D:",b.getFullYear(),K(b.getMonth()+1),K(b.getDate()),K(b.getHours()),K(b.getMinutes()),K(b.getSeconds()),Ke].join("")},V=c.__private__.convertPDFDateToDate=function(b){var H=parseInt(b.substr(2,4),10),se=parseInt(b.substr(6,2),10)-1,he=parseInt(b.substr(8,2),10),be=parseInt(b.substr(10,2),10),Ke=parseInt(b.substr(12,2),10),We=parseInt(b.substr(14,2),10);return new Date(H,se,he,be,Ke,We,0)},k=c.__private__.setCreationDate=function(b){var H;if(b===void 0&&(b=new Date),b instanceof Date)H=Ae(b);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(b))throw new Error("Invalid argument passed to jsPDF.setCreationDate");H=b}return z=H},I=c.__private__.getCreationDate=function(b){var H=z;return b==="jsDate"&&(H=V(z)),H};c.setCreationDate=function(b){return k(b),this},c.getCreationDate=function(b){return I(b)};var P,K=c.__private__.padd2=function(b){return("0"+parseInt(b)).slice(-2)},Y=c.__private__.padd2Hex=function(b){return("00"+(b=b.toString())).substr(b.length)},J=0,q=[],W=[],te=0,oe=[],we=[],le=!1,Be=W;c.__private__.setCustomOutputDestination=function(b){le=!0,Be=b};var ye=function(b){le||(Be=b)};c.__private__.resetCustomOutputDestination=function(){le=!1,Be=W};var R=c.__private__.out=function(b){return b=b.toString(),te+=b.length+1,Be.push(b),Be},Ie=c.__private__.write=function(b){return R(arguments.length===1?b.toString():Array.prototype.join.call(arguments," "))},Ue=c.__private__.getArrayBuffer=function(b){for(var H=b.length,se=new ArrayBuffer(H),he=new Uint8Array(se);H--;)he[H]=b.charCodeAt(H);return se},Re=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];c.__private__.getStandardFonts=function(){return Re};var Ee=r.fontSize||16;c.__private__.setFontSize=c.setFontSize=function(b){return Ee=E===x?b/ue:b,this};var Ve,Me=c.__private__.getFontSize=c.getFontSize=function(){return E===B?Ee:Ee*ue},ze=r.R2L||!1;c.__private__.setR2L=c.setR2L=function(b){return ze=b,this},c.__private__.getR2L=c.getR2L=function(){return ze};var Ye,xe=c.__private__.setZoomMode=function(b){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(b))Ve=b;else if(isNaN(b)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(b)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+b+'" is not recognized.');Ve=b}else Ve=parseInt(b,10)};c.__private__.getZoomMode=function(){return Ve};var Oe,je=c.__private__.setPageMode=function(b){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(b)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+b+'" is not recognized.');Ye=b};c.__private__.getPageMode=function(){return Ye};var ge=c.__private__.setLayoutMode=function(b){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(b)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+b+'" is not recognized.');Oe=b};c.__private__.getLayoutMode=function(){return Oe},c.__private__.setDisplayMode=c.setDisplayMode=function(b,H,se){return xe(b),ge(H),je(se),this};var Pe={title:"",subject:"",author:"",keywords:"",creator:""};c.__private__.getDocumentProperty=function(b){if(Object.keys(Pe).indexOf(b)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Pe[b]},c.__private__.getDocumentProperties=function(){return Pe},c.__private__.setDocumentProperties=c.setProperties=c.setDocumentProperties=function(b){for(var H in Pe)Pe.hasOwnProperty(H)&&b[H]&&(Pe[H]=b[H]);return this},c.__private__.setDocumentProperty=function(b,H){if(Object.keys(Pe).indexOf(b)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Pe[b]=H};var Te,ue,fe,Le,Fe,Ne={},ve={},Qe=[],De={},it={},et={},Ge={},At=null,nt=0,tt=[],lt=new aB(c),ur=r.hotfixes||[],_t={},AA={},Vr=[],Bt=function b(H,se,he,be,Ke,We){if(!(this instanceof b))return new b(H,se,he,be,Ke,We);isNaN(H)&&(H=1),isNaN(se)&&(se=0),isNaN(he)&&(he=0),isNaN(be)&&(be=1),isNaN(Ke)&&(Ke=0),isNaN(We)&&(We=0),this._matrix=[H,se,he,be,Ke,We]};Object.defineProperty(Bt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(b){this._matrix[0]=b}}),Object.defineProperty(Bt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(b){this._matrix[1]=b}}),Object.defineProperty(Bt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(b){this._matrix[2]=b}}),Object.defineProperty(Bt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(b){this._matrix[3]=b}}),Object.defineProperty(Bt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(b){this._matrix[4]=b}}),Object.defineProperty(Bt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(b){this._matrix[5]=b}}),Object.defineProperty(Bt.prototype,"a",{get:function(){return this._matrix[0]},set:function(b){this._matrix[0]=b}}),Object.defineProperty(Bt.prototype,"b",{get:function(){return this._matrix[1]},set:function(b){this._matrix[1]=b}}),Object.defineProperty(Bt.prototype,"c",{get:function(){return this._matrix[2]},set:function(b){this._matrix[2]=b}}),Object.defineProperty(Bt.prototype,"d",{get:function(){return this._matrix[3]},set:function(b){this._matrix[3]=b}}),Object.defineProperty(Bt.prototype,"e",{get:function(){return this._matrix[4]},set:function(b){this._matrix[4]=b}}),Object.defineProperty(Bt.prototype,"f",{get:function(){return this._matrix[5]},set:function(b){this._matrix[5]=b}}),Object.defineProperty(Bt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Bt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Bt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Bt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Bt.prototype.join=function(b){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(T).join(b)},Bt.prototype.multiply=function(b){var H=b.sx*this.sx+b.shy*this.shx,se=b.sx*this.shy+b.shy*this.sy,he=b.shx*this.sx+b.sy*this.shx,be=b.shx*this.shy+b.sy*this.sy,Ke=b.tx*this.sx+b.ty*this.shx+this.tx,We=b.tx*this.shy+b.ty*this.sy+this.ty;return new Bt(H,se,he,be,Ke,We)},Bt.prototype.decompose=function(){var b=this.sx,H=this.shy,se=this.shx,he=this.sy,be=this.tx,Ke=this.ty,We=Math.sqrt(b*b+H*H),ht=(b/=We)*se+(H/=We)*he;se-=b*ht,he-=H*ht;var vt=Math.sqrt(se*se+he*he);return ht/=vt,b*(he/=vt)<H*(se/=vt)&&(b=-b,H=-H,ht=-ht,We=-We),{scale:new Bt(We,0,0,vt,0,0),translate:new Bt(1,0,0,1,be,Ke),rotate:new Bt(b,H,-H,b,0,0),skew:new Bt(1,0,ht,1,0,0)}},Bt.prototype.toString=function(b){return this.join(" ")},Bt.prototype.inversed=function(){var b=this.sx,H=this.shy,se=this.shx,he=this.sy,be=this.tx,Ke=this.ty,We=1/(b*he-H*se),ht=he*We,vt=-H*We,xt=-se*We,Ut=b*We;return new Bt(ht,vt,xt,Ut,-ht*be-xt*Ke,-vt*be-Ut*Ke)},Bt.prototype.applyToPoint=function(b){var H=b.x*this.sx+b.y*this.shx+this.tx,se=b.x*this.shy+b.y*this.sy+this.ty;return new Ei(H,se)},Bt.prototype.applyToRectangle=function(b){var H=this.applyToPoint(b),se=this.applyToPoint(new Ei(b.x+b.w,b.y+b.h));return new dl(H.x,H.y,se.x-H.x,se.y-H.y)},Bt.prototype.clone=function(){var b=this.sx,H=this.shy,se=this.shx,he=this.sy,be=this.tx,Ke=this.ty;return new Bt(b,H,se,he,be,Ke)},c.Matrix=Bt;var Mr=c.matrixMult=function(b,H){return H.multiply(b)},nA=new Bt(1,0,0,1,0,0);c.unitMatrix=c.identityMatrix=nA;var zr=function(b,H){if(!it[b]){var se=(H instanceof Ua?"Sh":"P")+(Object.keys(De).length+1).toString(10);H.id=se,it[b]=se,De[se]=H,lt.publish("addPattern",H)}};c.ShadingPattern=Ua,c.TilingPattern=ms,c.addShadingPattern=function(b,H){return _("addShadingPattern()"),zr(b,H),this},c.beginTilingPattern=function(b){_("beginTilingPattern()"),gl(b.boundingBox[0],b.boundingBox[1],b.boundingBox[2]-b.boundingBox[0],b.boundingBox[3]-b.boundingBox[1],b.matrix)},c.endTilingPattern=function(b,H){_("endTilingPattern()"),H.stream=we[P].join(`
|
|
574
|
+
*/var iB={print:4,modify:8,copy:16,"annot-forms":32};function ps(r,e,t,A){this.v=1,this.r=2;var n=192;r.forEach(function(a){if(iB.perm!==void 0)throw new Error("Invalid permission: "+a);n+=iB[a]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var i=(e+this.padding).substr(0,32),s=(t+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,s),this.P=-(1+(255^n)),this.encryptionKey=pd(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(A)).substr(0,5),this.U=vd(this.encryptionKey,this.padding)}function vs(r){if(/[^\u0000-\u00ff]/.test(r))throw new Error("Invalid PDF Name Object: "+r+", Only accept ASCII characters.");for(var e="",t=r.length,A=0;A<t;A++){var n=r.charCodeAt(A);e+=n<33||n===35||n===37||n===40||n===41||n===47||n===60||n===62||n===91||n===93||n===123||n===125||n>126?"#"+("0"+n.toString(16)).slice(-2):r[A]}return e}function aB(r){if(Dt(r)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,A,n){if(n=n||!1,typeof t!="string"||typeof A!="function"||typeof n!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var i=Math.random().toString(35);return e[t][i]=[A,!!n],i},this.unsubscribe=function(t){for(var A in e)if(e[A][t])return delete e[A][t],Object.keys(e[A]).length===0&&delete e[A],!0;return!1},this.publish=function(t){if(e.hasOwnProperty(t)){var A=Array.prototype.slice.call(arguments,1),n=[];for(var i in e[t]){var s=e[t][i];try{s[0].apply(r,A)}catch(a){bt.console&&$t.error("jsPDF PubSub Error",a.message,a)}s[1]&&n.push(i)}n.length&&n.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function Vu(r){if(!(this instanceof Vu))return new Vu(r);var e="opacity,stroke-opacity".split(",");for(var t in r)r.hasOwnProperty(t)&&e.indexOf(t)>=0&&(this[t]=r[t]);this.id="",this.objectNumber=-1}function sB(r,e){this.gState=r,this.matrix=e,this.id="",this.objectNumber=-1}function Ua(r,e,t,A,n){if(!(this instanceof Ua))return new Ua(r,e,t,A,n);this.type=r==="axial"?2:3,this.coords=e,this.colors=t,sB.call(this,A,n)}function ms(r,e,t,A,n){if(!(this instanceof ms))return new ms(r,e,t,A,n);this.boundingBox=r,this.xStep=e,this.yStep=t,this.stream="",this.cloneIndex=0,sB.call(this,A,n)}function pt(r){var e,t=typeof arguments[0]=="string"?arguments[0]:"p",A=arguments[1],n=arguments[2],i=arguments[3],s=[],a=1,o=16,l="S",u=null;Dt(r=r||{})==="object"&&(t=r.orientation,A=r.unit||A,n=r.format||n,i=r.compress||r.compressPdf||i,(u=r.encryption||null)!==null&&(u.userPassword=u.userPassword||"",u.ownerPassword=u.ownerPassword||"",u.userPermissions=u.userPermissions||[]),a=typeof r.userUnit=="number"?Math.abs(r.userUnit):1,r.precision!==void 0&&(e=r.precision),r.floatPrecision!==void 0&&(o=r.floatPrecision),l=r.defaultPathOperation||"S"),s=r.filters||(i===!0?["FlateEncode"]:s),A=A||"mm",t=(""+(t||"P")).toLowerCase();var f=r.putOnlyUsedFonts||!1,h={},c={internal:{},__private__:{}};c.__private__.PubSub=aB;var g="1.3",p=c.__private__.getPdfVersion=function(){return g};c.__private__.setPdfVersion=function(b){g=b};var y={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};c.__private__.getPageFormats=function(){return y};var w=c.__private__.getPageFormat=function(b){return y[b]};n=n||"a4";var B="compat",x="advanced",E=B;function Q(){this.saveGraphicsState(),R(new Bt(ue,0,0,-ue,0,$a()*ue).toString()+" cm"),this.setFontSize(this.getFontSize()/ue),l="n",E=x}function L(){this.restoreGraphicsState(),l="S",E=B}var S=c.__private__.combineFontStyleAndFontWeight=function(b,H){if(b=="bold"&&H=="normal"||b=="bold"&&H==400||b=="normal"&&H=="italic"||b=="bold"&&H=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return H&&(b=H==400||H==="normal"?b==="italic"?"italic":"normal":H!=700&&H!=="bold"||b!=="normal"?(H==700?"bold":H)+""+b:"bold"),b};c.advancedAPI=function(b){var H=E===B;return H&&Q.call(this),typeof b!="function"||(b(this),H&&L.call(this)),this},c.compatAPI=function(b){var H=E===x;return H&&L.call(this),typeof b!="function"||(b(this),H&&Q.call(this)),this},c.isAdvancedAPI=function(){return E===x};var T,_=function(b){if(E!==x)throw new Error(b+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},D=c.roundToPrecision=c.__private__.roundToPrecision=function(b,H){var se=e||H;if(isNaN(b)||isNaN(se))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return b.toFixed(se).replace(/0+$/,"")};T=c.hpf=c.__private__.hpf=typeof o=="number"?function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.hpf");return D(b,o)}:o==="smart"?function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.hpf");return D(b,b>-1&&b<1?16:5)}:function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.hpf");return D(b,16)};var U=c.f2=c.__private__.f2=function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.f2");return D(b,2)},O=c.__private__.f3=function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.f3");return D(b,3)},M=c.scale=c.__private__.scale=function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.scale");return E===B?b*ue:E===x?b:void 0},C=function(b){return M((function(H){return E===B?$a()-H:E===x?H:void 0})(b))};c.__private__.setPrecision=c.setPrecision=function(b){typeof parseInt(b,10)=="number"&&(e=parseInt(b,10))};var z,re="00000000000000000000000000000000",ne=c.__private__.getFileId=function(){return re},Z=c.__private__.setFileId=function(b){return re=b!==void 0&&/^[a-fA-F0-9]{32}$/.test(b)?b.toUpperCase():re.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),u!==null&&(Wr=new ps(u.userPermissions,u.userPassword,u.ownerPassword,re)),re};c.setFileId=function(b){return Z(b),this},c.getFileId=function(){return ne()};var Ae=c.__private__.convertDateToPDFDate=function(b){var H=b.getTimezoneOffset(),se=H<0?"+":"-",he=Math.floor(Math.abs(H/60)),be=Math.abs(H%60),Ke=[se,K(he),"'",K(be),"'"].join("");return["D:",b.getFullYear(),K(b.getMonth()+1),K(b.getDate()),K(b.getHours()),K(b.getMinutes()),K(b.getSeconds()),Ke].join("")},V=c.__private__.convertPDFDateToDate=function(b){var H=parseInt(b.substr(2,4),10),se=parseInt(b.substr(6,2),10)-1,he=parseInt(b.substr(8,2),10),be=parseInt(b.substr(10,2),10),Ke=parseInt(b.substr(12,2),10),We=parseInt(b.substr(14,2),10);return new Date(H,se,he,be,Ke,We,0)},k=c.__private__.setCreationDate=function(b){var H;if(b===void 0&&(b=new Date),b instanceof Date)H=Ae(b);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(b))throw new Error("Invalid argument passed to jsPDF.setCreationDate");H=b}return z=H},I=c.__private__.getCreationDate=function(b){var H=z;return b==="jsDate"&&(H=V(z)),H};c.setCreationDate=function(b){return k(b),this},c.getCreationDate=function(b){return I(b)};var P,K=c.__private__.padd2=function(b){return("0"+parseInt(b)).slice(-2)},Y=c.__private__.padd2Hex=function(b){return("00"+(b=b.toString())).substr(b.length)},J=0,q=[],W=[],te=0,oe=[],we=[],le=!1,Be=W;c.__private__.setCustomOutputDestination=function(b){le=!0,Be=b};var ye=function(b){le||(Be=b)};c.__private__.resetCustomOutputDestination=function(){le=!1,Be=W};var R=c.__private__.out=function(b){return b=b.toString(),te+=b.length+1,Be.push(b),Be},Ie=c.__private__.write=function(b){return R(arguments.length===1?b.toString():Array.prototype.join.call(arguments," "))},Ue=c.__private__.getArrayBuffer=function(b){for(var H=b.length,se=new ArrayBuffer(H),he=new Uint8Array(se);H--;)he[H]=b.charCodeAt(H);return se},Te=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];c.__private__.getStandardFonts=function(){return Te};var Ee=r.fontSize||16;c.__private__.setFontSize=c.setFontSize=function(b){return Ee=E===x?b/ue:b,this};var Ve,Me=c.__private__.getFontSize=c.getFontSize=function(){return E===B?Ee:Ee*ue},ze=r.R2L||!1;c.__private__.setR2L=c.setR2L=function(b){return ze=b,this},c.__private__.getR2L=c.getR2L=function(){return ze};var Ye,xe=c.__private__.setZoomMode=function(b){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(b))Ve=b;else if(isNaN(b)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(b)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+b+'" is not recognized.');Ve=b}else Ve=parseInt(b,10)};c.__private__.getZoomMode=function(){return Ve};var Oe,je=c.__private__.setPageMode=function(b){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(b)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+b+'" is not recognized.');Ye=b};c.__private__.getPageMode=function(){return Ye};var ge=c.__private__.setLayoutMode=function(b){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(b)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+b+'" is not recognized.');Oe=b};c.__private__.getLayoutMode=function(){return Oe},c.__private__.setDisplayMode=c.setDisplayMode=function(b,H,se){return xe(b),ge(H),je(se),this};var Re={title:"",subject:"",author:"",keywords:"",creator:""};c.__private__.getDocumentProperty=function(b){if(Object.keys(Re).indexOf(b)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Re[b]},c.__private__.getDocumentProperties=function(){return Re},c.__private__.setDocumentProperties=c.setProperties=c.setDocumentProperties=function(b){for(var H in Re)Re.hasOwnProperty(H)&&b[H]&&(Re[H]=b[H]);return this},c.__private__.setDocumentProperty=function(b,H){if(Object.keys(Re).indexOf(b)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Re[b]=H};var Le,ue,fe,Pe,Fe,Ne={},ve={},Qe=[],De={},it={},et={},Ge={},At=null,nt=0,tt=[],lt=new aB(c),ur=r.hotfixes||[],_t={},AA={},Vr=[],Bt=function b(H,se,he,be,Ke,We){if(!(this instanceof b))return new b(H,se,he,be,Ke,We);isNaN(H)&&(H=1),isNaN(se)&&(se=0),isNaN(he)&&(he=0),isNaN(be)&&(be=1),isNaN(Ke)&&(Ke=0),isNaN(We)&&(We=0),this._matrix=[H,se,he,be,Ke,We]};Object.defineProperty(Bt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(b){this._matrix[0]=b}}),Object.defineProperty(Bt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(b){this._matrix[1]=b}}),Object.defineProperty(Bt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(b){this._matrix[2]=b}}),Object.defineProperty(Bt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(b){this._matrix[3]=b}}),Object.defineProperty(Bt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(b){this._matrix[4]=b}}),Object.defineProperty(Bt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(b){this._matrix[5]=b}}),Object.defineProperty(Bt.prototype,"a",{get:function(){return this._matrix[0]},set:function(b){this._matrix[0]=b}}),Object.defineProperty(Bt.prototype,"b",{get:function(){return this._matrix[1]},set:function(b){this._matrix[1]=b}}),Object.defineProperty(Bt.prototype,"c",{get:function(){return this._matrix[2]},set:function(b){this._matrix[2]=b}}),Object.defineProperty(Bt.prototype,"d",{get:function(){return this._matrix[3]},set:function(b){this._matrix[3]=b}}),Object.defineProperty(Bt.prototype,"e",{get:function(){return this._matrix[4]},set:function(b){this._matrix[4]=b}}),Object.defineProperty(Bt.prototype,"f",{get:function(){return this._matrix[5]},set:function(b){this._matrix[5]=b}}),Object.defineProperty(Bt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Bt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Bt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Bt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Bt.prototype.join=function(b){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(T).join(b)},Bt.prototype.multiply=function(b){var H=b.sx*this.sx+b.shy*this.shx,se=b.sx*this.shy+b.shy*this.sy,he=b.shx*this.sx+b.sy*this.shx,be=b.shx*this.shy+b.sy*this.sy,Ke=b.tx*this.sx+b.ty*this.shx+this.tx,We=b.tx*this.shy+b.ty*this.sy+this.ty;return new Bt(H,se,he,be,Ke,We)},Bt.prototype.decompose=function(){var b=this.sx,H=this.shy,se=this.shx,he=this.sy,be=this.tx,Ke=this.ty,We=Math.sqrt(b*b+H*H),ht=(b/=We)*se+(H/=We)*he;se-=b*ht,he-=H*ht;var vt=Math.sqrt(se*se+he*he);return ht/=vt,b*(he/=vt)<H*(se/=vt)&&(b=-b,H=-H,ht=-ht,We=-We),{scale:new Bt(We,0,0,vt,0,0),translate:new Bt(1,0,0,1,be,Ke),rotate:new Bt(b,H,-H,b,0,0),skew:new Bt(1,0,ht,1,0,0)}},Bt.prototype.toString=function(b){return this.join(" ")},Bt.prototype.inversed=function(){var b=this.sx,H=this.shy,se=this.shx,he=this.sy,be=this.tx,Ke=this.ty,We=1/(b*he-H*se),ht=he*We,vt=-H*We,xt=-se*We,Ut=b*We;return new Bt(ht,vt,xt,Ut,-ht*be-xt*Ke,-vt*be-Ut*Ke)},Bt.prototype.applyToPoint=function(b){var H=b.x*this.sx+b.y*this.shx+this.tx,se=b.x*this.shy+b.y*this.sy+this.ty;return new Ei(H,se)},Bt.prototype.applyToRectangle=function(b){var H=this.applyToPoint(b),se=this.applyToPoint(new Ei(b.x+b.w,b.y+b.h));return new dl(H.x,H.y,se.x-H.x,se.y-H.y)},Bt.prototype.clone=function(){var b=this.sx,H=this.shy,se=this.shx,he=this.sy,be=this.tx,Ke=this.ty;return new Bt(b,H,se,he,be,Ke)},c.Matrix=Bt;var Mr=c.matrixMult=function(b,H){return H.multiply(b)},nA=new Bt(1,0,0,1,0,0);c.unitMatrix=c.identityMatrix=nA;var zr=function(b,H){if(!it[b]){var se=(H instanceof Ua?"Sh":"P")+(Object.keys(De).length+1).toString(10);H.id=se,it[b]=se,De[se]=H,lt.publish("addPattern",H)}};c.ShadingPattern=Ua,c.TilingPattern=ms,c.addShadingPattern=function(b,H){return _("addShadingPattern()"),zr(b,H),this},c.beginTilingPattern=function(b){_("beginTilingPattern()"),gl(b.boundingBox[0],b.boundingBox[1],b.boundingBox[2]-b.boundingBox[0],b.boundingBox[3]-b.boundingBox[1],b.matrix)},c.endTilingPattern=function(b,H){_("endTilingPattern()"),H.stream=we[P].join(`
|
|
575
575
|
`),zr(b,H),lt.publish("endTilingPattern",H),Vr.pop().restore()};var bA,Tt=c.__private__.newObject=function(){var b=kt();return mr(b,!0),b},kt=c.__private__.newObjectDeferred=function(){return J++,q[J]=function(){return te},J},mr=function(b,H){return H=typeof H=="boolean"&&H,q[b]=te,H&&R(b+" 0 obj"),b},lA=c.__private__.newAdditionalObject=function(){var b={objId:kt(),content:""};return oe.push(b),b},QA=kt(),HA=kt(),Dr=c.__private__.decodeColorString=function(b){var H=b.split(" ");if(H.length!==2||H[1]!=="g"&&H[1]!=="G")H.length!==5||H[4]!=="k"&&H[4]!=="K"||(H=[(1-H[0])*(1-H[3]),(1-H[1])*(1-H[3]),(1-H[2])*(1-H[3]),"r"]);else{var se=parseFloat(H[0]);H=[se,se,se,"r"]}for(var he="#",be=0;be<3;be++)he+=("0"+Math.floor(255*parseFloat(H[be])).toString(16)).slice(-2);return he},jA=c.__private__.encodeColorString=function(b){var H;typeof b=="string"&&(b={ch1:b});var se=b.ch1,he=b.ch2,be=b.ch3,Ke=b.ch4,We=b.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof se=="string"&&se.charAt(0)!=="#"){var ht=new tB(se);if(ht.ok)se=ht.toHex();else if(!/^\d*\.?\d*$/.test(se))throw new Error('Invalid color "'+se+'" passed to jsPDF.encodeColorString.')}if(typeof se=="string"&&/^#[0-9A-Fa-f]{3}$/.test(se)&&(se="#"+se[1]+se[1]+se[2]+se[2]+se[3]+se[3]),typeof se=="string"&&/^#[0-9A-Fa-f]{6}$/.test(se)){var vt=parseInt(se.substr(1),16);se=vt>>16&255,he=vt>>8&255,be=255&vt}if(he===void 0||Ke===void 0&&se===he&&he===be)H=typeof se=="string"?se+" "+We[0]:b.precision===2?U(se/255)+" "+We[0]:O(se/255)+" "+We[0];else if(Ke===void 0||Dt(Ke)==="object"){if(Ke&&!isNaN(Ke.a)&&Ke.a===0)return["1.","1.","1.",We[1]].join(" ");H=typeof se=="string"?[se,he,be,We[1]].join(" "):b.precision===2?[U(se/255),U(he/255),U(be/255),We[1]].join(" "):[O(se/255),O(he/255),O(be/255),We[1]].join(" ")}else H=typeof se=="string"?[se,he,be,Ke,We[2]].join(" "):b.precision===2?[U(se),U(he),U(be),U(Ke),We[2]].join(" "):[O(se),O(he),O(be),O(Ke),We[2]].join(" ");return H},KA=c.__private__.getFilters=function(){return s},NA=c.__private__.putStream=function(b){var H=(b=b||{}).data||"",se=b.filters||KA(),he=b.alreadyAppliedFilters||[],be=b.addLength1||!1,Ke=H.length,We=b.objectId,ht=function(Xr){return Xr};if(u!==null&&We===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");u!==null&&(ht=Wr.encryptor(We,0));var vt={};se===!0&&(se=["FlateEncode"]);var xt=b.additionalKeyValues||[],Ut=(vt=pt.API.processDataByFilters!==void 0?pt.API.processDataByFilters(H,se):{data:H,reverseChain:[]}).reverseChain+(Array.isArray(he)?he.join(" "):he.toString());if(vt.data.length!==0&&(xt.push({key:"Length",value:vt.data.length}),be===!0&&xt.push({key:"Length1",value:Ke})),Ut.length!=0)if(Ut.split("/").length-1==1)xt.push({key:"Filter",value:Ut});else{xt.push({key:"Filter",value:"["+Ut+"]"});for(var Rt=0;Rt<xt.length;Rt+=1)if(xt[Rt].key==="DecodeParms"){for(var fr=[],Hr=0;Hr<vt.reverseChain.split("/").length-1;Hr+=1)fr.push("null");fr.push(xt[Rt].value),xt[Rt].value="["+fr.join(" ")+"]"}}R("<<");for(var tr=0;tr<xt.length;tr++)R("/"+xt[tr].key+" "+xt[tr].value);R(">>"),vt.data.length!==0&&(R("stream"),R(ht(vt.data)),R("endstream"))},Jn=c.__private__.putPage=function(b){var H=b.number,se=b.data,he=b.objId,be=b.contentsObjId;mr(he,!0),R("<</Type /Page"),R("/Parent "+b.rootDictionaryObjId+" 0 R"),R("/Resources "+b.resourceDictionaryObjId+" 0 R"),R("/MediaBox ["+parseFloat(T(b.mediaBox.bottomLeftX))+" "+parseFloat(T(b.mediaBox.bottomLeftY))+" "+T(b.mediaBox.topRightX)+" "+T(b.mediaBox.topRightY)+"]"),b.cropBox!==null&&R("/CropBox ["+T(b.cropBox.bottomLeftX)+" "+T(b.cropBox.bottomLeftY)+" "+T(b.cropBox.topRightX)+" "+T(b.cropBox.topRightY)+"]"),b.bleedBox!==null&&R("/BleedBox ["+T(b.bleedBox.bottomLeftX)+" "+T(b.bleedBox.bottomLeftY)+" "+T(b.bleedBox.topRightX)+" "+T(b.bleedBox.topRightY)+"]"),b.trimBox!==null&&R("/TrimBox ["+T(b.trimBox.bottomLeftX)+" "+T(b.trimBox.bottomLeftY)+" "+T(b.trimBox.topRightX)+" "+T(b.trimBox.topRightY)+"]"),b.artBox!==null&&R("/ArtBox ["+T(b.artBox.bottomLeftX)+" "+T(b.artBox.bottomLeftY)+" "+T(b.artBox.topRightX)+" "+T(b.artBox.topRightY)+"]"),typeof b.userUnit=="number"&&b.userUnit!==1&&R("/UserUnit "+b.userUnit),lt.publish("putPage",{objId:he,pageContext:tt[H],pageNumber:H,page:se}),R("/Contents "+be+" 0 R"),R(">>"),R("endobj");var Ke=se.join(`
|
|
576
576
|
`);return E===x&&(Ke+=`
|
|
577
577
|
Q`),mr(be,!0),NA({data:Ke,filters:KA(),objectId:be}),R("endobj"),he},dn=c.__private__.putPages=function(){var b,H,se=[];for(b=1;b<=nt;b++)tt[b].objId=kt(),tt[b].contentsObjId=kt();for(b=1;b<=nt;b++)se.push(Jn({number:b,data:we[b],objId:tt[b].objId,contentsObjId:tt[b].contentsObjId,mediaBox:tt[b].mediaBox,cropBox:tt[b].cropBox,bleedBox:tt[b].bleedBox,trimBox:tt[b].trimBox,artBox:tt[b].artBox,userUnit:tt[b].userUnit,rootDictionaryObjId:QA,resourceDictionaryObjId:HA}));mr(QA,!0),R("<</Type /Pages");var he="/Kids [";for(H=0;H<nt;H++)he+=se[H]+" 0 R ";R(he+"]"),R("/Count "+nt),R(">>"),R("endobj"),lt.publish("postPutPages")},ft=function(b){lt.publish("putFont",{font:b,out:R,newObject:Tt,putStream:NA}),b.isAlreadyPutted!==!0&&(b.objectNumber=Tt(),R("<<"),R("/Type /Font"),R("/BaseFont /"+vs(b.postScriptName)),R("/Subtype /Type1"),typeof b.encoding=="string"&&R("/Encoding /"+b.encoding),R("/FirstChar 32"),R("/LastChar 255"),R(">>"),R("endobj"))},de=function(b){b.objectNumber=Tt();var H=[];H.push({key:"Type",value:"/XObject"}),H.push({key:"Subtype",value:"/Form"}),H.push({key:"BBox",value:"["+[T(b.x),T(b.y),T(b.x+b.width),T(b.y+b.height)].join(" ")+"]"}),H.push({key:"Matrix",value:"["+b.matrix.toString()+"]"});var se=b.pages[1].join(`
|
|
578
|
-
`);NA({data:se,additionalKeyValues:H,objectId:b.objectNumber}),R("endobj")},Je=function(b,H){H||(H=21);var se=Tt(),he=(function(We,ht){var vt,xt=[],Ut=1/(ht-1);for(vt=0;vt<1;vt+=Ut)xt.push(vt);if(xt.push(1),We[0].offset!=0){var Rt={offset:0,color:We[0].color};We.unshift(Rt)}if(We[We.length-1].offset!=1){var fr={offset:1,color:We[We.length-1].color};We.push(fr)}for(var Hr="",tr=0,Xr=0;Xr<xt.length;Xr++){for(vt=xt[Xr];vt>We[tr+1].offset;)tr++;var jr=We[tr].offset,uA=(vt-jr)/(We[tr+1].offset-jr),Ui=We[tr].color,Ln=We[tr+1].color;Hr+=Y(Math.round((1-uA)*Ui[0]+uA*Ln[0]).toString(16))+Y(Math.round((1-uA)*Ui[1]+uA*Ln[1]).toString(16))+Y(Math.round((1-uA)*Ui[2]+uA*Ln[2]).toString(16))}return Hr.trim()})(b.colors,H),be=[];be.push({key:"FunctionType",value:"0"}),be.push({key:"Domain",value:"[0.0 1.0]"}),be.push({key:"Size",value:"["+H+"]"}),be.push({key:"BitsPerSample",value:"8"}),be.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),be.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),NA({data:he,additionalKeyValues:be,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:se}),R("endobj"),b.objectNumber=Tt(),R("<< /ShadingType "+b.type),R("/ColorSpace /DeviceRGB");var Ke="/Coords ["+T(parseFloat(b.coords[0]))+" "+T(parseFloat(b.coords[1]))+" ";b.type===2?Ke+=T(parseFloat(b.coords[2]))+" "+T(parseFloat(b.coords[3])):Ke+=T(parseFloat(b.coords[2]))+" "+T(parseFloat(b.coords[3]))+" "+T(parseFloat(b.coords[4]))+" "+T(parseFloat(b.coords[5])),R(Ke+="]"),b.matrix&&R("/Matrix ["+b.matrix.toString()+"]"),R("/Function "+se+" 0 R"),R("/Extend [true true]"),R(">>"),R("endobj")},ot=function(b,H){var se=kt(),he=Tt();H.push({resourcesOid:se,objectOid:he}),b.objectNumber=he;var be=[];be.push({key:"Type",value:"/Pattern"}),be.push({key:"PatternType",value:"1"}),be.push({key:"PaintType",value:"1"}),be.push({key:"TilingType",value:"1"}),be.push({key:"BBox",value:"["+b.boundingBox.map(T).join(" ")+"]"}),be.push({key:"XStep",value:T(b.xStep)}),be.push({key:"YStep",value:T(b.yStep)}),be.push({key:"Resources",value:se+" 0 R"}),b.matrix&&be.push({key:"Matrix",value:"["+b.matrix.toString()+"]"}),NA({data:b.stream,additionalKeyValues:be,objectId:b.objectNumber}),R("endobj")},Yt=function(b){for(var H in b.objectNumber=Tt(),R("<<"),b)switch(H){case"opacity":R("/ca "+U(b[H]));break;case"stroke-opacity":R("/CA "+U(b[H]))}R(">>"),R("endobj")},wr=function(b){mr(b.resourcesOid,!0),R("<<"),R("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),(function(){for(var H in R("/Font <<"),Ne)Ne.hasOwnProperty(H)&&(f===!1||f===!0&&h.hasOwnProperty(H))&&R("/"+H+" "+Ne[H].objectNumber+" 0 R");R(">>")})(),(function(){if(Object.keys(De).length>0){for(var H in R("/Shading <<"),De)De.hasOwnProperty(H)&&De[H]instanceof Ua&&De[H].objectNumber>=0&&R("/"+H+" "+De[H].objectNumber+" 0 R");lt.publish("putShadingPatternDict"),R(">>")}})(),(function(H){if(Object.keys(De).length>0){for(var se in R("/Pattern <<"),De)De.hasOwnProperty(se)&&De[se]instanceof c.TilingPattern&&De[se].objectNumber>=0&&De[se].objectNumber<H&&R("/"+se+" "+De[se].objectNumber+" 0 R");lt.publish("putTilingPatternDict"),R(">>")}})(b.objectOid),(function(){if(Object.keys(et).length>0){var H;for(H in R("/ExtGState <<"),et)et.hasOwnProperty(H)&&et[H].objectNumber>=0&&R("/"+H+" "+et[H].objectNumber+" 0 R");lt.publish("putGStateDict"),R(">>")}})(),(function(){for(var H in R("/XObject <<"),_t)_t.hasOwnProperty(H)&&_t[H].objectNumber>=0&&R("/"+H+" "+_t[H].objectNumber+" 0 R");lt.publish("putXobjectDict"),R(">>")})(),R(">>"),R("endobj")},nr=function(b){ve[b.fontName]=ve[b.fontName]||{},ve[b.fontName][b.fontStyle]=b.id},Gr=function(b,H,se,he,be){var Ke={id:"F"+(Object.keys(Ne).length+1).toString(10),postScriptName:b,fontName:H,fontStyle:se,encoding:he,isStandardFont:be||!1,metadata:{}};return lt.publish("addFont",{font:Ke,instance:this}),Ne[Ke.id]=Ke,nr(Ke),Ke.id},yr=c.__private__.pdfEscape=c.pdfEscape=function(b,H){return(function(se,he){var be,Ke,We,ht,vt,xt,Ut,Rt,fr;if(We=(he=he||{}).sourceEncoding||"Unicode",vt=he.outputEncoding,(he.autoencode||vt)&&Ne[
|
|
578
|
+
`);NA({data:se,additionalKeyValues:H,objectId:b.objectNumber}),R("endobj")},Je=function(b,H){H||(H=21);var se=Tt(),he=(function(We,ht){var vt,xt=[],Ut=1/(ht-1);for(vt=0;vt<1;vt+=Ut)xt.push(vt);if(xt.push(1),We[0].offset!=0){var Rt={offset:0,color:We[0].color};We.unshift(Rt)}if(We[We.length-1].offset!=1){var fr={offset:1,color:We[We.length-1].color};We.push(fr)}for(var Hr="",tr=0,Xr=0;Xr<xt.length;Xr++){for(vt=xt[Xr];vt>We[tr+1].offset;)tr++;var jr=We[tr].offset,uA=(vt-jr)/(We[tr+1].offset-jr),Ui=We[tr].color,Ln=We[tr+1].color;Hr+=Y(Math.round((1-uA)*Ui[0]+uA*Ln[0]).toString(16))+Y(Math.round((1-uA)*Ui[1]+uA*Ln[1]).toString(16))+Y(Math.round((1-uA)*Ui[2]+uA*Ln[2]).toString(16))}return Hr.trim()})(b.colors,H),be=[];be.push({key:"FunctionType",value:"0"}),be.push({key:"Domain",value:"[0.0 1.0]"}),be.push({key:"Size",value:"["+H+"]"}),be.push({key:"BitsPerSample",value:"8"}),be.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),be.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),NA({data:he,additionalKeyValues:be,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:se}),R("endobj"),b.objectNumber=Tt(),R("<< /ShadingType "+b.type),R("/ColorSpace /DeviceRGB");var Ke="/Coords ["+T(parseFloat(b.coords[0]))+" "+T(parseFloat(b.coords[1]))+" ";b.type===2?Ke+=T(parseFloat(b.coords[2]))+" "+T(parseFloat(b.coords[3])):Ke+=T(parseFloat(b.coords[2]))+" "+T(parseFloat(b.coords[3]))+" "+T(parseFloat(b.coords[4]))+" "+T(parseFloat(b.coords[5])),R(Ke+="]"),b.matrix&&R("/Matrix ["+b.matrix.toString()+"]"),R("/Function "+se+" 0 R"),R("/Extend [true true]"),R(">>"),R("endobj")},ot=function(b,H){var se=kt(),he=Tt();H.push({resourcesOid:se,objectOid:he}),b.objectNumber=he;var be=[];be.push({key:"Type",value:"/Pattern"}),be.push({key:"PatternType",value:"1"}),be.push({key:"PaintType",value:"1"}),be.push({key:"TilingType",value:"1"}),be.push({key:"BBox",value:"["+b.boundingBox.map(T).join(" ")+"]"}),be.push({key:"XStep",value:T(b.xStep)}),be.push({key:"YStep",value:T(b.yStep)}),be.push({key:"Resources",value:se+" 0 R"}),b.matrix&&be.push({key:"Matrix",value:"["+b.matrix.toString()+"]"}),NA({data:b.stream,additionalKeyValues:be,objectId:b.objectNumber}),R("endobj")},Yt=function(b){for(var H in b.objectNumber=Tt(),R("<<"),b)switch(H){case"opacity":R("/ca "+U(b[H]));break;case"stroke-opacity":R("/CA "+U(b[H]))}R(">>"),R("endobj")},wr=function(b){mr(b.resourcesOid,!0),R("<<"),R("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),(function(){for(var H in R("/Font <<"),Ne)Ne.hasOwnProperty(H)&&(f===!1||f===!0&&h.hasOwnProperty(H))&&R("/"+H+" "+Ne[H].objectNumber+" 0 R");R(">>")})(),(function(){if(Object.keys(De).length>0){for(var H in R("/Shading <<"),De)De.hasOwnProperty(H)&&De[H]instanceof Ua&&De[H].objectNumber>=0&&R("/"+H+" "+De[H].objectNumber+" 0 R");lt.publish("putShadingPatternDict"),R(">>")}})(),(function(H){if(Object.keys(De).length>0){for(var se in R("/Pattern <<"),De)De.hasOwnProperty(se)&&De[se]instanceof c.TilingPattern&&De[se].objectNumber>=0&&De[se].objectNumber<H&&R("/"+se+" "+De[se].objectNumber+" 0 R");lt.publish("putTilingPatternDict"),R(">>")}})(b.objectOid),(function(){if(Object.keys(et).length>0){var H;for(H in R("/ExtGState <<"),et)et.hasOwnProperty(H)&&et[H].objectNumber>=0&&R("/"+H+" "+et[H].objectNumber+" 0 R");lt.publish("putGStateDict"),R(">>")}})(),(function(){for(var H in R("/XObject <<"),_t)_t.hasOwnProperty(H)&&_t[H].objectNumber>=0&&R("/"+H+" "+_t[H].objectNumber+" 0 R");lt.publish("putXobjectDict"),R(">>")})(),R(">>"),R("endobj")},nr=function(b){ve[b.fontName]=ve[b.fontName]||{},ve[b.fontName][b.fontStyle]=b.id},Gr=function(b,H,se,he,be){var Ke={id:"F"+(Object.keys(Ne).length+1).toString(10),postScriptName:b,fontName:H,fontStyle:se,encoding:he,isStandardFont:be||!1,metadata:{}};return lt.publish("addFont",{font:Ke,instance:this}),Ne[Ke.id]=Ke,nr(Ke),Ke.id},yr=c.__private__.pdfEscape=c.pdfEscape=function(b,H){return(function(se,he){var be,Ke,We,ht,vt,xt,Ut,Rt,fr;if(We=(he=he||{}).sourceEncoding||"Unicode",vt=he.outputEncoding,(he.autoencode||vt)&&Ne[Le].metadata&&Ne[Le].metadata[We]&&Ne[Le].metadata[We].encoding&&(ht=Ne[Le].metadata[We].encoding,!vt&&Ne[Le].encoding&&(vt=Ne[Le].encoding),!vt&&ht.codePages&&(vt=ht.codePages[0]),typeof vt=="string"&&(vt=ht[vt]),vt)){for(Ut=!1,xt=[],be=0,Ke=se.length;be<Ke;be++)(Rt=vt[se.charCodeAt(be)])?xt.push(String.fromCharCode(Rt)):xt.push(se[be]),xt[be].charCodeAt(0)>>8&&(Ut=!0);se=xt.join("")}for(be=se.length;Ut===void 0&&be!==0;)se.charCodeAt(be-1)>>8&&(Ut=!0),be--;if(!Ut)return se;for(xt=he.noBOM?[]:[254,255],be=0,Ke=se.length;be<Ke;be++){if((fr=(Rt=se.charCodeAt(be))>>8)>>8)throw new Error("Character at position "+be+" of string '"+se+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");xt.push(fr),xt.push(Rt-(fr<<8))}return String.fromCharCode.apply(void 0,xt)})(b,H).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},gn=c.__private__.beginPage=function(b){we[++nt]=[],tt[nt]={objId:0,contentsObjId:0,userUnit:Number(a),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(b[0]),topRightY:Number(b[1])}},Va(nt),ye(we[P])},na=function(b,H){var se,he,be;switch(t=H||t,typeof b=="string"&&(se=w(b.toLowerCase()),Array.isArray(se)&&(he=se[0],be=se[1])),Array.isArray(b)&&(he=b[0]*ue,be=b[1]*ue),isNaN(he)&&(he=n[0],be=n[1]),(he>14400||be>14400)&&($t.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),he=Math.min(14400,he),be=Math.min(14400,be)),n=[he,be],t.substr(0,1)){case"l":be>he&&(n=[be,he]);break;case"p":he>be&&(n=[be,he])}gn(n),Ct(ul),R(Ks),fl!==0&&R(fl+" J"),hl!==0&&R(hl+" j"),lt.publish("addPage",{pageNumber:nt})},cr=function(b){b>0&&b<=nt&&(we.splice(b,1),tt.splice(b,1),nt--,P>nt&&(P=nt),this.setPage(P))},Va=function(b){b>0&&b<=nt&&(P=b)},za=c.__private__.getNumberOfPages=c.getNumberOfPages=function(){return we.length-1},yf=function(b,H,se){var he,be=void 0;return se=se||{},b=b!==void 0?b:Ne[Le].fontName,H=H!==void 0?H:Ne[Le].fontStyle,he=b.toLowerCase(),ve[he]!==void 0&&ve[he][H]!==void 0?be=ve[he][H]:ve[b]!==void 0&&ve[b][H]!==void 0?be=ve[b][H]:se.disableWarning===!1&&$t.warn("Unable to look up font label for font '"+b+"', '"+H+"'. Refer to getFontList() for available fonts."),be||se.noFallback||(be=ve.times[H])==null&&(be=ve.times.normal),be},Zn=c.__private__.putInfo=function(){var b=Tt(),H=function(he){return he};for(var se in u!==null&&(H=Wr.encryptor(b,0)),R("<<"),R("/Producer ("+yr(H("jsPDF "+pt.version))+")"),Re)Re.hasOwnProperty(se)&&Re[se]&&R("/"+se.substr(0,1).toUpperCase()+se.substr(1)+" ("+yr(H(Re[se]))+")");R("/CreationDate ("+yr(H(z))+")"),R(">>"),R("endobj")},ks=c.__private__.putCatalog=function(b){var H=(b=b||{}).rootDictionaryObjId||QA;switch(Tt(),R("<<"),R("/Type /Catalog"),R("/Pages "+H+" 0 R"),Ve||(Ve="fullwidth"),Ve){case"fullwidth":R("/OpenAction [3 0 R /FitH null]");break;case"fullheight":R("/OpenAction [3 0 R /FitV null]");break;case"fullpage":R("/OpenAction [3 0 R /Fit]");break;case"original":R("/OpenAction [3 0 R /XYZ null null 1]");break;default:var se=""+Ve;se.substr(se.length-1)==="%"&&(Ve=parseInt(Ve)/100),typeof Ve=="number"&&R("/OpenAction [3 0 R /XYZ null null "+U(Ve)+"]")}switch(Oe||(Oe="continuous"),Oe){case"continuous":R("/PageLayout /OneColumn");break;case"single":R("/PageLayout /SinglePage");break;case"two":case"twoleft":R("/PageLayout /TwoColumnLeft");break;case"tworight":R("/PageLayout /TwoColumnRight")}Ye&&R("/PageMode /"+Ye),lt.publish("putCatalog"),R(">>"),R("endobj")},iv=c.__private__.putTrailer=function(){R("trailer"),R("<<"),R("/Size "+(J+1)),R("/Root "+J+" 0 R"),R("/Info "+(J-1)+" 0 R"),u!==null&&R("/Encrypt "+Wr.oid+" 0 R"),R("/ID [ <"+re+"> <"+re+"> ]"),R(">>")},kr=c.__private__.putHeader=function(){R("%PDF-"+g),R("%ºß¬à")},Bf=c.__private__.putXRef=function(){var b="0000000000";R("xref"),R("0 "+(J+1)),R("0000000000 65535 f ");for(var H=1;H<=J;H++)typeof q[H]=="function"?R((b+q[H]()).slice(-10)+" 00000 n "):q[H]!==void 0?R((b+q[H]).slice(-10)+" 00000 n "):R("0000000000 00000 n ")},ei=c.__private__.buildDocument=function(){var b;J=0,te=0,W=[],q=[],oe=[],QA=kt(),HA=kt(),ye(W),lt.publish("buildDocument"),kr(),dn(),(function(){lt.publish("putAdditionalObjects");for(var se=0;se<oe.length;se++){var he=oe[se];mr(he.objId,!0),R(he.content),R("endobj")}lt.publish("postPutAdditionalObjects")})(),b=[],(function(){for(var se in Ne)Ne.hasOwnProperty(se)&&(f===!1||f===!0&&h.hasOwnProperty(se))&&ft(Ne[se])})(),(function(){var se;for(se in et)et.hasOwnProperty(se)&&Yt(et[se])})(),(function(){for(var se in _t)_t.hasOwnProperty(se)&&de(_t[se])})(),(function(se){var he;for(he in De)De.hasOwnProperty(he)&&(De[he]instanceof Ua?Je(De[he]):De[he]instanceof ms&&ot(De[he],se))})(b),lt.publish("putResources"),b.forEach(wr),wr({resourcesOid:HA,objectOid:Number.MAX_SAFE_INTEGER}),lt.publish("postPutResources"),u!==null&&(Wr.oid=Tt(),R("<<"),R("/Filter /Standard"),R("/V "+Wr.v),R("/R "+Wr.r),R("/U <"+Wr.toHexString(Wr.U)+">"),R("/O <"+Wr.toHexString(Wr.O)+">"),R("/P "+Wr.P),R(">>"),R("endobj")),Zn(),ks();var H=te;return Bf(),iv(),R("startxref"),R(""+H),R("%%EOF"),ye(we[P]),W.join(`
|
|
579
579
|
`)},Hs=c.__private__.getBlob=function(b){return new Blob([Ue(b)],{type:"application/pdf"})},bf=c.output=c.__private__.output=(bA=function(b,H){switch(typeof(H=H||{})=="string"?H={filename:H}:H.filename=H.filename||"generated.pdf",b){case void 0:return ei();case"save":c.save(H.filename);break;case"arraybuffer":return Ue(ei());case"blob":return Hs(ei());case"bloburi":case"bloburl":if(bt.URL!==void 0&&typeof bt.URL.createObjectURL=="function")return bt.URL&&bt.URL.createObjectURL(Hs(ei()))||void 0;$t.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var se="",he=ei();try{se=rB(he)}catch{se=rB(unescape(encodeURIComponent(he)))}return"data:application/pdf;filename="+H.filename+";base64,"+se;case"pdfobjectnewwindow":if(Object.prototype.toString.call(bt)==="[object Window]"){var be="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Ke=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';H.pdfObjectUrl&&(be=H.pdfObjectUrl,Ke="");var We='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+be+'"'+Ke+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(H)+");<\/script></body></html>",ht=bt.open();return ht!==null&&ht.document.write(We),ht}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(bt)==="[object Window]"){var vt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(H.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+H.filename+'" width="500px" height="400px" /></body></html>',xt=bt.open();if(xt!==null){xt.document.write(vt);var Ut=this;xt.document.documentElement.querySelector("#pdfViewer").onload=function(){xt.document.title=H.filename,xt.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(Ut.output("bloburl"))}}return xt}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(bt)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Rt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",H)+'"></iframe></body></html>',fr=bt.open();if(fr!==null&&(fr.document.write(Rt),fr.document.title=H.filename),fr||typeof safari>"u")return fr;break;case"datauri":case"dataurl":return bt.document.location.href=this.output("datauristring",H);default:return null}},bA.foo=function(){try{return bA.apply(this,arguments)}catch(se){var b=se.stack||"";~b.indexOf(" at ")&&(b=b.split(" at ")[1]);var H="Error in function "+b.split(`
|
|
580
|
-
`)[0].split("<")[0]+": "+se.message;if(!bt.console)throw new Error(H);bt.console.error(H,se),bt.alert&&alert(H)}},bA.foo.bar=bA,bA.foo),pn=function(b){return Array.isArray(ur)===!0&&ur.indexOf(b)>-1};switch(A){case"pt":ue=1;break;case"mm":ue=72/25.4;break;case"cm":ue=72/2.54;break;case"in":ue=72;break;case"px":ue=pn("px_scaling")==1?.75:96/72;break;case"pc":case"em":ue=12;break;case"ex":ue=6;break;default:if(typeof A!="number")throw new Error("Invalid unit: "+A);ue=A}var Wr=null;k(),Z();var Bi=c.__private__.getPageInfo=c.getPageInfo=function(b){if(isNaN(b)||b%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:tt[b].objId,pageNumber:b,pageContext:tt[b]}},xf=c.__private__.getPageInfoByObjId=function(b){if(isNaN(b)||b%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var H in tt)if(tt[H].objId===b)break;return Bi(H)},av=c.__private__.getCurrentPageInfo=c.getCurrentPageInfo=function(){return{objId:tt[P].objId,pageNumber:P,pageContext:tt[P]}};c.addPage=function(){return na.apply(this,arguments),this},c.setPage=function(){return Va.apply(this,arguments),ye.call(this,we[P]),this},c.insertPage=function(b){return this.addPage(),this.movePage(P,b),this},c.movePage=function(b,H){var se,he;if(b>H){se=we[b],he=tt[b];for(var be=b;be>H;be--)we[be]=we[be-1],tt[be]=tt[be-1];we[H]=se,tt[H]=he,this.setPage(H)}else if(b<H){se=we[b],he=tt[b];for(var Ke=b;Ke<H;Ke++)we[Ke]=we[Ke+1],tt[Ke]=tt[Ke+1];we[H]=se,tt[H]=he,this.setPage(H)}return this},c.deletePage=function(){return cr.apply(this,arguments),this},c.__private__.text=c.text=function(b,H,se,he,be){var Ke,We,ht,vt,xt,Ut,Rt,fr,Hr,tr=(he=he||{}).scope||this;if(typeof b=="number"&&typeof H=="number"&&(typeof se=="string"||Array.isArray(se))){var Xr=se;se=H,H=b,b=Xr}if(arguments[3]instanceof Bt==0?(ht=arguments[4],vt=arguments[5],Dt(Rt=arguments[3])==="object"&&Rt!==null||(typeof ht=="string"&&(vt=ht,ht=null),typeof Rt=="string"&&(vt=Rt,Rt=null),typeof Rt=="number"&&(ht=Rt,Rt=null),he={flags:Rt,angle:ht,align:vt})):(_("The transform parameter of text() with a Matrix value"),Hr=be),isNaN(H)||isNaN(se)||b==null)throw new Error("Invalid arguments passed to jsPDF.text");if(b.length===0)return tr;var jr,uA="",Ui=typeof he.lineHeightFactor=="number"?he.lineHeightFactor:Wa,Ln=tr.internal.scaleFactor;function _i(zt){return zt=zt.split(" ").join(Array(he.TabLen||9).join(" ")),yr(zt,Rt)}function vl(zt){for(var Jt,Qr=zt.concat(),Yr=[],Ni=Qr.length;Ni--;)typeof(Jt=Qr.shift())=="string"?Yr.push(Jt):Array.isArray(zt)&&(Jt.length===1||Jt[1]===void 0&&Jt[2]===void 0)?Yr.push(Jt[0]):Yr.push([Jt[0],Jt[1],Jt[2]]);return Yr}function Vs(zt,Jt){var Qr;if(typeof zt=="string")Qr=Jt(zt)[0];else if(Array.isArray(zt)){for(var Yr,Ni,Sl=zt.concat(),Ws=[],Tf=Sl.length;Tf--;)typeof(Yr=Sl.shift())=="string"?Ws.push(Jt(Yr)[0]):Array.isArray(Yr)&&typeof Yr[0]=="string"&&(Ni=Jt(Yr[0],Yr[1],Yr[2]),Ws.push([Ni[0],Ni[1],Ni[2]]));Qr=Ws}return Qr}var ia=!1,Ja=!0;if(typeof b=="string")ia=!0;else if(Array.isArray(b)){var Za=b.concat();We=[];for(var aa,cA=Za.length;cA--;)(typeof(aa=Za.shift())!="string"||Array.isArray(aa)&&typeof aa[0]!="string")&&(Ja=!1);ia=Ja}if(ia===!1)throw new Error('Type of text must be string or Array. "'+b+'" is not recognized.');typeof b=="string"&&(b=b.match(/[\r?\n]/)?b.split(/\r\n|\r|\n/g):[b]);var es=Ee/tr.internal.scaleFactor,ts=es*(Ui-1);switch(he.baseline){case"bottom":se-=ts;break;case"top":se+=es-ts;break;case"hanging":se+=es-2*ts;break;case"middle":se+=es/2-ts}if((Ut=he.maxWidth||0)>0&&(typeof b=="string"?b=tr.splitTextToSize(b,Ut):Object.prototype.toString.call(b)==="[object Array]"&&(b=b.reduce(function(zt,Jt){return zt.concat(tr.splitTextToSize(Jt,Ut))},[]))),Ke={text:b,x:H,y:se,options:he,mutex:{pdfEscape:yr,activeFontKey:
|
|
580
|
+
`)[0].split("<")[0]+": "+se.message;if(!bt.console)throw new Error(H);bt.console.error(H,se),bt.alert&&alert(H)}},bA.foo.bar=bA,bA.foo),pn=function(b){return Array.isArray(ur)===!0&&ur.indexOf(b)>-1};switch(A){case"pt":ue=1;break;case"mm":ue=72/25.4;break;case"cm":ue=72/2.54;break;case"in":ue=72;break;case"px":ue=pn("px_scaling")==1?.75:96/72;break;case"pc":case"em":ue=12;break;case"ex":ue=6;break;default:if(typeof A!="number")throw new Error("Invalid unit: "+A);ue=A}var Wr=null;k(),Z();var Bi=c.__private__.getPageInfo=c.getPageInfo=function(b){if(isNaN(b)||b%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:tt[b].objId,pageNumber:b,pageContext:tt[b]}},xf=c.__private__.getPageInfoByObjId=function(b){if(isNaN(b)||b%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var H in tt)if(tt[H].objId===b)break;return Bi(H)},av=c.__private__.getCurrentPageInfo=c.getCurrentPageInfo=function(){return{objId:tt[P].objId,pageNumber:P,pageContext:tt[P]}};c.addPage=function(){return na.apply(this,arguments),this},c.setPage=function(){return Va.apply(this,arguments),ye.call(this,we[P]),this},c.insertPage=function(b){return this.addPage(),this.movePage(P,b),this},c.movePage=function(b,H){var se,he;if(b>H){se=we[b],he=tt[b];for(var be=b;be>H;be--)we[be]=we[be-1],tt[be]=tt[be-1];we[H]=se,tt[H]=he,this.setPage(H)}else if(b<H){se=we[b],he=tt[b];for(var Ke=b;Ke<H;Ke++)we[Ke]=we[Ke+1],tt[Ke]=tt[Ke+1];we[H]=se,tt[H]=he,this.setPage(H)}return this},c.deletePage=function(){return cr.apply(this,arguments),this},c.__private__.text=c.text=function(b,H,se,he,be){var Ke,We,ht,vt,xt,Ut,Rt,fr,Hr,tr=(he=he||{}).scope||this;if(typeof b=="number"&&typeof H=="number"&&(typeof se=="string"||Array.isArray(se))){var Xr=se;se=H,H=b,b=Xr}if(arguments[3]instanceof Bt==0?(ht=arguments[4],vt=arguments[5],Dt(Rt=arguments[3])==="object"&&Rt!==null||(typeof ht=="string"&&(vt=ht,ht=null),typeof Rt=="string"&&(vt=Rt,Rt=null),typeof Rt=="number"&&(ht=Rt,Rt=null),he={flags:Rt,angle:ht,align:vt})):(_("The transform parameter of text() with a Matrix value"),Hr=be),isNaN(H)||isNaN(se)||b==null)throw new Error("Invalid arguments passed to jsPDF.text");if(b.length===0)return tr;var jr,uA="",Ui=typeof he.lineHeightFactor=="number"?he.lineHeightFactor:Wa,Ln=tr.internal.scaleFactor;function _i(zt){return zt=zt.split(" ").join(Array(he.TabLen||9).join(" ")),yr(zt,Rt)}function vl(zt){for(var Jt,Qr=zt.concat(),Yr=[],Ni=Qr.length;Ni--;)typeof(Jt=Qr.shift())=="string"?Yr.push(Jt):Array.isArray(zt)&&(Jt.length===1||Jt[1]===void 0&&Jt[2]===void 0)?Yr.push(Jt[0]):Yr.push([Jt[0],Jt[1],Jt[2]]);return Yr}function Vs(zt,Jt){var Qr;if(typeof zt=="string")Qr=Jt(zt)[0];else if(Array.isArray(zt)){for(var Yr,Ni,Sl=zt.concat(),Ws=[],Tf=Sl.length;Tf--;)typeof(Yr=Sl.shift())=="string"?Ws.push(Jt(Yr)[0]):Array.isArray(Yr)&&typeof Yr[0]=="string"&&(Ni=Jt(Yr[0],Yr[1],Yr[2]),Ws.push([Ni[0],Ni[1],Ni[2]]));Qr=Ws}return Qr}var ia=!1,Ja=!0;if(typeof b=="string")ia=!0;else if(Array.isArray(b)){var Za=b.concat();We=[];for(var aa,cA=Za.length;cA--;)(typeof(aa=Za.shift())!="string"||Array.isArray(aa)&&typeof aa[0]!="string")&&(Ja=!1);ia=Ja}if(ia===!1)throw new Error('Type of text must be string or Array. "'+b+'" is not recognized.');typeof b=="string"&&(b=b.match(/[\r?\n]/)?b.split(/\r\n|\r|\n/g):[b]);var es=Ee/tr.internal.scaleFactor,ts=es*(Ui-1);switch(he.baseline){case"bottom":se-=ts;break;case"top":se+=es-ts;break;case"hanging":se+=es-2*ts;break;case"middle":se+=es/2-ts}if((Ut=he.maxWidth||0)>0&&(typeof b=="string"?b=tr.splitTextToSize(b,Ut):Object.prototype.toString.call(b)==="[object Array]"&&(b=b.reduce(function(zt,Jt){return zt.concat(tr.splitTextToSize(Jt,Ut))},[]))),Ke={text:b,x:H,y:se,options:he,mutex:{pdfEscape:yr,activeFontKey:Le,fonts:Ne,activeFontSize:Ee}},lt.publish("preProcessText",Ke),b=Ke.text,ht=(he=Ke.options).angle,Hr instanceof Bt==0&&ht&&typeof ht=="number"){ht*=Math.PI/180,he.rotationDirection===0&&(ht=-ht),E===x&&(ht=-ht);var ml=Math.cos(ht),wl=Math.sin(ht);Hr=new Bt(ml,wl,-wl,ml,0,0)}else ht&&ht instanceof Bt&&(Hr=ht);E!==x||Hr||(Hr=nA),(xt=he.charSpace||Ci)!==void 0&&(uA+=T(M(xt))+` Tc
|
|
581
581
|
`,this.setCharSpace(this.getCharSpace()||0)),(fr=he.horizontalScale)!==void 0&&(uA+=T(100*fr)+` Tz
|
|
582
582
|
`),he.lang;var OA=-1,Ii=he.renderingMode!==void 0?he.renderingMode:he.stroke,zs=tr.internal.getCurrentPageInfo().pageContext;switch(Ii){case 0:case!1:case"fill":OA=0;break;case 1:case!0:case"stroke":OA=1;break;case 2:case"fillThenStroke":OA=2;break;case 3:case"invisible":OA=3;break;case 4:case"fillAndAddForClipping":OA=4;break;case 5:case"strokeAndAddPathForClipping":OA=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":OA=6;break;case 7:case"addToPathForClipping":OA=7}var Nf=zs.usedRenderingMode!==void 0?zs.usedRenderingMode:-1;OA!==-1?uA+=OA+` Tr
|
|
583
583
|
`:Nf!==-1&&(uA+=`0 Tr
|
|
584
|
-
`),OA!==-1&&(zs.usedRenderingMode=OA),vt=he.align||"left";var vn,rs=Ee*Ui,yl=tr.internal.pageSize.getWidth(),Bl=Ne[
|
|
584
|
+
`),OA!==-1&&(zs.usedRenderingMode=OA),vt=he.align||"left";var vn,rs=Ee*Ui,yl=tr.internal.pageSize.getWidth(),Bl=Ne[Le];xt=he.charSpace||Ci,Ut=he.maxWidth||0,Rt=Object.assign({autoencode:!0,noBOM:!0},he.flags);var sa=[],As=function(zt){return tr.getStringUnitWidth(zt,{font:Bl,charSpace:xt,fontSize:Ee,doKerning:!1})*Ee/Ln};if(Object.prototype.toString.call(b)==="[object Array]"){var JA;We=vl(b),vt!=="left"&&(vn=We.map(As));var ZA,oa=0;if(vt==="right"){H-=vn[0],b=[],cA=We.length;for(var Qi=0;Qi<cA;Qi++)Qi===0?(ZA=bi(H),JA=xi(se)):(ZA=M(oa-vn[Qi]),JA=-rs),b.push([We[Qi],ZA,JA]),oa=vn[Qi]}else if(vt==="center"){H-=vn[0]/2,b=[],cA=We.length;for(var la=0;la<cA;la++)la===0?(ZA=bi(H),JA=xi(se)):(ZA=M((oa-vn[la])/2),JA=-rs),b.push([We[la],ZA,JA]),oa=vn[la]}else if(vt==="left"){b=[],cA=We.length;for(var bl=0;bl<cA;bl++)b.push(We[bl])}else if(vt==="justify"&&Bl.encoding==="Identity-H"){b=[],cA=We.length,Ut=Ut!==0?Ut:yl;for(var Gs=0,Ir=0;Ir<cA;Ir++)if(JA=Ir===0?xi(se):-rs,ZA=Ir===0?bi(H):Gs,Ir<cA-1){var Of=M((Ut-vn[Ir])/(We[Ir].split(" ").length-1)),ri=We[Ir].split(" ");b.push([ri[0]+" ",ZA,JA]),Gs=0;for(var Ai=1;Ai<ri.length;Ai++){var xl=(As(ri[Ai-1]+" "+ri[Ai])-As(ri[Ai]))*Ln+Of;Ai==ri.length-1?b.push([ri[Ai],xl,0]):b.push([ri[Ai]+" ",xl,0]),Gs-=xl}}else b.push([We[Ir],ZA,JA]);b.push(["",Gs,0])}else{if(vt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(b=[],cA=We.length,Ut=Ut!==0?Ut:yl,Ir=0;Ir<cA;Ir++){JA=Ir===0?xi(se):-rs,ZA=Ir===0?bi(H):0;var Cl=We[Ir].split(" ").length-1,El=Cl>0?(Ut-vn[Ir])/Cl:0;Ir<cA-1?sa.push(T(M(El))):sa.push(0),b.push([We[Ir],ZA,JA])}}}(typeof he.R2L=="boolean"?he.R2L:ze)===!0&&(b=Vs(b,function(zt,Jt,Qr){return[zt.split("").reverse().join(""),Jt,Qr]})),Ke={text:b,x:H,y:se,options:he,mutex:{pdfEscape:yr,activeFontKey:Le,fonts:Ne,activeFontSize:Ee}},lt.publish("postProcessText",Ke),b=Ke.text,jr=Ke.mutex.isHex||!1;var Fl=Ne[Le].encoding;Fl!=="WinAnsiEncoding"&&Fl!=="StandardEncoding"||(b=Vs(b,function(zt,Jt,Qr){return[_i(zt),Jt,Qr]})),We=vl(b),b=[];for(var ua,ca,fa,ns=Array.isArray(We[0])?1:0,ha="",is=function(zt,Jt,Qr){var Yr="";return Qr instanceof Bt?(Qr=typeof he.angle=="number"?Mr(Qr,new Bt(1,0,0,1,zt,Jt)):Mr(new Bt(1,0,0,1,zt,Jt),Qr),E===x&&(Qr=Mr(new Bt(1,0,0,-1,0,0),Qr)),Yr=Qr.join(" ")+` Tm
|
|
585
585
|
`):Yr=T(zt)+" "+T(Jt)+` Td
|
|
586
586
|
`,Yr},mn=0;mn<We.length;mn++){switch(ha="",ns){case 1:fa=(jr?"<":"(")+We[mn][0]+(jr?">":")"),ua=parseFloat(We[mn][1]),ca=parseFloat(We[mn][2]);break;case 0:fa=(jr?"<":"(")+We[mn]+(jr?">":")"),ua=bi(H),ca=xi(se)}sa!==void 0&&sa[mn]!==void 0&&(ha=sa[mn]+` Tw
|
|
587
587
|
`),mn===0?b.push(ha+is(ua,ca,Hr)+fa):ns===0?b.push(ha+fa):ns===1&&b.push(ha+is(ua,ca,Hr)+fa)}b=ns===0?b.join(` Tj
|
|
588
588
|
T* `):b.join(` Tj
|
|
589
589
|
`),b+=` Tj
|
|
590
590
|
`;var ni=`BT
|
|
591
|
-
/`;return ni+=
|
|
591
|
+
/`;return ni+=Le+" "+Ee+` Tf
|
|
592
592
|
`,ni+=T(Ee*Ui)+` TL
|
|
593
593
|
`,ni+=Xa+`
|
|
594
|
-
`,ni+=uA,ni+=b,R(ni+="ET"),h[Te]=!0,tr};var sv=c.__private__.clip=c.clip=function(b){return R(b==="evenodd"?"W*":"W"),this};c.clipEvenOdd=function(){return sv("evenodd")},c.__private__.discardPath=c.discardPath=function(){return R("n"),this};var ti=c.__private__.isValidStyle=function(b){var H=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(b)!==-1&&(H=!0),H};c.__private__.setDefaultPathOperation=c.setDefaultPathOperation=function(b){return ti(b)&&(l=b),this};var Cf=c.__private__.getStyle=c.getStyle=function(b){var H=l;switch(b){case"D":case"S":H="S";break;case"F":H="f";break;case"FD":case"DF":H="B";break;case"f":case"f*":case"B":case"B*":H=b}return H},Ef=c.close=function(){return R("h"),this};c.stroke=function(){return R("S"),this},c.fill=function(b){return js("f",b),this},c.fillEvenOdd=function(b){return js("f*",b),this},c.fillStroke=function(b){return js("B",b),this},c.fillStrokeEvenOdd=function(b){return js("B*",b),this};var js=function(b,H){Dt(H)==="object"?lv(H,b):R(b)},Ga=function(b){b===null||E===x&&b===void 0||(b=Cf(b),R(b))};function ov(b,H,se,he,be){var Ke=new ms(H||this.boundingBox,se||this.xStep,he||this.yStep,this.gState,be||this.matrix);Ke.stream=this.stream;var We=b+"$$"+this.cloneIndex+++"$$";return zr(We,Ke),Ke}var lv=function(b,H){var se=it[b.key],he=De[se];if(he instanceof Ua)R("q"),R(uv(H)),he.gState&&c.setGState(he.gState),R(b.matrix.toString()+" cm"),R("/"+se+" sh"),R("Q");else if(he instanceof ms){var be=new Bt(1,0,0,-1,0,$a());b.matrix&&(be=be.multiply(b.matrix||nA),se=ov.call(he,b.key,b.boundingBox,b.xStep,b.yStep,be).id),R("q"),R("/Pattern cs"),R("/"+se+" scn"),he.gState&&c.setGState(he.gState),R(H),R("Q")}},uv=function(b){switch(b){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},ll=c.moveTo=function(b,H){return R(T(M(b))+" "+T(C(H))+" m"),this},Ff=c.lineTo=function(b,H){return R(T(M(b))+" "+T(C(H))+" l"),this},Tn=c.curveTo=function(b,H,se,he,be,Ke){return R([T(M(b)),T(C(H)),T(M(se)),T(C(he)),T(M(be)),T(C(Ke)),"c"].join(" ")),this};c.__private__.line=c.line=function(b,H,se,he,be){if(isNaN(b)||isNaN(H)||isNaN(se)||isNaN(he)||!ti(be))throw new Error("Invalid arguments passed to jsPDF.line");return E===B?this.lines([[se-b,he-H]],b,H,[1,1],be||"S"):this.lines([[se-b,he-H]],b,H,[1,1]).stroke()},c.__private__.lines=c.lines=function(b,H,se,he,be,Ke){var We,ht,vt,xt,Ut,Rt,fr,Hr,tr,Xr,jr,uA;if(typeof b=="number"&&(uA=se,se=H,H=b,b=uA),he=he||[1,1],Ke=Ke||!1,isNaN(H)||isNaN(se)||!Array.isArray(b)||!Array.isArray(he)||!ti(be)||typeof Ke!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(ll(H,se),We=he[0],ht=he[1],xt=b.length,Xr=H,jr=se,vt=0;vt<xt;vt++)(Ut=b[vt]).length===2?(Xr=Ut[0]*We+Xr,jr=Ut[1]*ht+jr,Ff(Xr,jr)):(Rt=Ut[0]*We+Xr,fr=Ut[1]*ht+jr,Hr=Ut[2]*We+Xr,tr=Ut[3]*ht+jr,Xr=Ut[4]*We+Xr,jr=Ut[5]*ht+jr,Tn(Rt,fr,Hr,tr,Xr,jr));return Ke&&Ef(),Ga(be),this},c.path=function(b){for(var H=0;H<b.length;H++){var se=b[H],he=se.c;switch(se.op){case"m":ll(he[0],he[1]);break;case"l":Ff(he[0],he[1]);break;case"c":Tn.apply(this,he);break;case"h":Ef()}}return this},c.__private__.rect=c.rect=function(b,H,se,he,be){if(isNaN(b)||isNaN(H)||isNaN(se)||isNaN(he)||!ti(be))throw new Error("Invalid arguments passed to jsPDF.rect");return E===B&&(he=-he),R([T(M(b)),T(C(H)),T(M(se)),T(M(he)),"re"].join(" ")),Ga(be),this},c.__private__.triangle=c.triangle=function(b,H,se,he,be,Ke,We){if(isNaN(b)||isNaN(H)||isNaN(se)||isNaN(he)||isNaN(be)||isNaN(Ke)||!ti(We))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[se-b,he-H],[be-se,Ke-he],[b-be,H-Ke]],b,H,[1,1],We,!0),this},c.__private__.roundedRect=c.roundedRect=function(b,H,se,he,be,Ke,We){if(isNaN(b)||isNaN(H)||isNaN(se)||isNaN(he)||isNaN(be)||isNaN(Ke)||!ti(We))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var ht=4/3*(Math.SQRT2-1);return be=Math.min(be,.5*se),Ke=Math.min(Ke,.5*he),this.lines([[se-2*be,0],[be*ht,0,be,Ke-Ke*ht,be,Ke],[0,he-2*Ke],[0,Ke*ht,-be*ht,Ke,-be,Ke],[2*be-se,0],[-be*ht,0,-be,-Ke*ht,-be,-Ke],[0,2*Ke-he],[0,-Ke*ht,be*ht,-Ke,be,-Ke]],b+be,H,[1,1],We,!0),this},c.__private__.ellipse=c.ellipse=function(b,H,se,he,be){if(isNaN(b)||isNaN(H)||isNaN(se)||isNaN(he)||!ti(be))throw new Error("Invalid arguments passed to jsPDF.ellipse");var Ke=4/3*(Math.SQRT2-1)*se,We=4/3*(Math.SQRT2-1)*he;return ll(b+se,H),Tn(b+se,H-We,b+Ke,H-he,b,H-he),Tn(b-Ke,H-he,b-se,H-We,b-se,H),Tn(b-se,H+We,b-Ke,H+he,b,H+he),Tn(b+Ke,H+he,b+se,H+We,b+se,H),Ga(be),this},c.__private__.circle=c.circle=function(b,H,se,he){if(isNaN(b)||isNaN(H)||isNaN(se)||!ti(he))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(b,H,se,se,he)},c.setFont=function(b,H,se){return se&&(H=S(H,se)),Te=yf(b,H,{disableWarning:!1}),this};var cv=c.__private__.getFont=c.getFont=function(){return Ne[yf.apply(c,arguments)]};c.__private__.getFontList=c.getFontList=function(){var b,H,se={};for(b in ve)if(ve.hasOwnProperty(b))for(H in se[b]=[],ve[b])ve[b].hasOwnProperty(H)&&se[b].push(H);return se},c.addFont=function(b,H,se,he,be){var Ke=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&Ke.indexOf(arguments[3])!==-1?be=arguments[3]:arguments[3]&&Ke.indexOf(arguments[3])==-1&&(se=S(se,he)),Gr.call(this,b,H,se,be=be||"Identity-H")};var Wa,ul=r.lineWidth||.200025,fv=c.__private__.getLineWidth=c.getLineWidth=function(){return ul},Ct=c.__private__.setLineWidth=c.setLineWidth=function(b){return ul=b,R(T(M(b))+" w"),this};c.__private__.setLineDash=pt.API.setLineDash=pt.API.setLineDashPattern=function(b,H){if(b=b||[],H=H||0,isNaN(H)||!Array.isArray(b))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return b=b.map(function(se){return T(M(se))}).join(" "),H=T(M(H)),R("["+b+"] "+H+" d"),this};var hv=c.__private__.getLineHeight=c.getLineHeight=function(){return Ee*Wa};c.__private__.getLineHeight=c.getLineHeight=function(){return Ee*Wa};var dv=c.__private__.setLineHeightFactor=c.setLineHeightFactor=function(b){return typeof(b=b||1.15)=="number"&&(Wa=b),this},gv=c.__private__.getLineHeightFactor=c.getLineHeightFactor=function(){return Wa};dv(r.lineHeight);var bi=c.__private__.getHorizontalCoordinate=function(b){return M(b)},xi=c.__private__.getVerticalCoordinate=function(b){return E===x?b:tt[P].mediaBox.topRightY-tt[P].mediaBox.bottomLeftY-M(b)},pv=c.__private__.getHorizontalCoordinateString=c.getHorizontalCoordinateString=function(b){return T(bi(b))},vv=c.__private__.getVerticalCoordinateString=c.getVerticalCoordinateString=function(b){return T(xi(b))},Ks=r.strokeColor||"0 G";c.__private__.getStrokeColor=c.getDrawColor=function(){return Dr(Ks)},c.__private__.setStrokeColor=c.setDrawColor=function(b,H,se,he){return Ks=jA({ch1:b,ch2:H,ch3:se,ch4:he,pdfColorType:"draw",precision:2}),R(Ks),this};var cl=r.fillColor||"0 g";c.__private__.getFillColor=c.getFillColor=function(){return Dr(cl)},c.__private__.setFillColor=c.setFillColor=function(b,H,se,he){return cl=jA({ch1:b,ch2:H,ch3:se,ch4:he,pdfColorType:"fill",precision:2}),R(cl),this};var Xa=r.textColor||"0 g",mv=c.__private__.getTextColor=c.getTextColor=function(){return Dr(Xa)};c.__private__.setTextColor=c.setTextColor=function(b,H,se,he){return Xa=jA({ch1:b,ch2:H,ch3:se,ch4:he,pdfColorType:"text",precision:3}),this};var Ci=r.charSpace,wv=c.__private__.getCharSpace=c.getCharSpace=function(){return parseFloat(Ci||0)};c.__private__.setCharSpace=c.setCharSpace=function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Ci=b,this};var fl=0;c.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},c.__private__.setLineCap=c.setLineCap=function(b){var H=c.CapJoinStyles[b];if(H===void 0)throw new Error("Line cap style of '"+b+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return fl=H,R(H+" J"),this};var hl=0;c.__private__.setLineJoin=c.setLineJoin=function(b){var H=c.CapJoinStyles[b];if(H===void 0)throw new Error("Line join style of '"+b+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return hl=H,R(H+" j"),this},c.__private__.setLineMiterLimit=c.__private__.setMiterLimit=c.setLineMiterLimit=c.setMiterLimit=function(b){if(b=b||0,isNaN(b))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return R(T(M(b))+" M"),this},c.GState=Vu,c.setGState=function(b){(b=typeof b=="string"?et[Ge[b]]:Sf(null,b)).equals(At)||(R("/"+b.id+" gs"),At=b)};var Sf=function(b,H){if(!b||!Ge[b]){var se=!1;for(var he in et)if(et.hasOwnProperty(he)&&et[he].equals(H)){se=!0;break}if(se)H=et[he];else{var be="GS"+(Object.keys(et).length+1).toString(10);et[be]=H,H.id=be}return b&&(Ge[b]=H.id),lt.publish("addGState",H),H}};c.addGState=function(b,H){return Sf(b,H),this},c.saveGraphicsState=function(){return R("q"),Qe.push({key:Te,size:Ee,color:Xa}),this},c.restoreGraphicsState=function(){R("Q");var b=Qe.pop();return Te=b.key,Ee=b.size,Xa=b.color,At=null,this},c.setCurrentTransformationMatrix=function(b){return R(b.toString()+" cm"),this},c.comment=function(b){return R("#"+b),this};var Ei=function(b,H){var se=b||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return se},set:function(Ke){isNaN(Ke)||(se=parseFloat(Ke))}});var he=H||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return he},set:function(Ke){isNaN(Ke)||(he=parseFloat(Ke))}});var be="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return be},set:function(Ke){be=Ke.toString()}}),this},dl=function(b,H,se,he){Ei.call(this,b,H),this.type="rect";var be=se||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return be},set:function(We){isNaN(We)||(be=parseFloat(We))}});var Ke=he||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return Ke},set:function(We){isNaN(We)||(Ke=parseFloat(We))}}),this},qs=function(){this.page=nt,this.currentPage=P,this.pages=we.slice(0),this.pagesContext=tt.slice(0),this.x=fe,this.y=Le,this.matrix=Fe,this.width=pl(P),this.height=_f(P),this.outputDestination=Be,this.id="",this.objectNumber=-1};qs.prototype.restore=function(){nt=this.page,P=this.currentPage,tt=this.pagesContext,we=this.pages,fe=this.x,Le=this.y,Fe=this.matrix,Uf(P,this.width),Fi(P,this.height),Be=this.outputDestination};var gl=function(b,H,se,he,be){Vr.push(new qs),nt=P=0,we=[],fe=b,Le=H,Fe=be,gn([se,he])};for(var Ya in c.beginFormObject=function(b,H,se,he,be){return gl(b,H,se,he,be),this},c.endFormObject=function(b){return(function(H){if(AA[H])Vr.pop().restore();else{var se=new qs,he="Xo"+(Object.keys(_t).length+1).toString(10);se.id=he,AA[H]=he,_t[he]=se,lt.publish("addFormObject",se),Vr.pop().restore()}})(b),this},c.doFormObject=function(b,H){var se=_t[AA[b]];return R("q"),R(H.toString()+" cm"),R("/"+se.id+" Do"),R("Q"),this},c.getFormObject=function(b){var H=_t[AA[b]];return{x:H.x,y:H.y,width:H.width,height:H.height,matrix:H.matrix}},c.save=function(b,H){return b=b||"generated.pdf",(H=H||{}).returnPromise=H.returnPromise||!1,H.returnPromise===!1?(Sa(Hs(ei()),b),typeof Sa.unload=="function"&&bt.setTimeout&&setTimeout(Sa.unload,911),this):new Promise(function(se,he){try{var be=Sa(Hs(ei()),b);typeof Sa.unload=="function"&&bt.setTimeout&&setTimeout(Sa.unload,911),se(be)}catch(Ke){he(Ke.message)}})},pt.API)pt.API.hasOwnProperty(Ya)&&(Ya==="events"&&pt.API.events.length?(function(b,H){var se,he,be;for(be=H.length-1;be!==-1;be--)se=H[be][0],he=H[be][1],b.subscribe.apply(b,[se].concat(typeof he=="function"?[he]:he))})(lt,pt.API.events):c[Ya]=pt.API[Ya]);function pl(b){return tt[b].mediaBox.topRightX-tt[b].mediaBox.bottomLeftX}function Uf(b,H){tt[b].mediaBox.topRightX=H+tt[b].mediaBox.bottomLeftX}function _f(b){return tt[b].mediaBox.topRightY-tt[b].mediaBox.bottomLeftY}function Fi(b,H){tt[b].mediaBox.topRightY=H+tt[b].mediaBox.bottomLeftY}var Si=c.getPageWidth=function(b){return pl(b=b||P)/ue},If=c.setPageWidth=function(b,H){Uf(b,H*ue)},$a=c.getPageHeight=function(b){return _f(b=b||P)/ue},Qf=c.setPageHeight=function(b,H){Fi(b,H*ue)};return c.internal={pdfEscape:yr,getStyle:Cf,getFont:cv,getFontSize:Me,getCharSpace:wv,getTextColor:mv,getLineHeight:hv,getLineHeightFactor:gv,getLineWidth:fv,write:Ie,getHorizontalCoordinate:bi,getVerticalCoordinate:xi,getCoordinateString:pv,getVerticalCoordinateString:vv,collections:{},newObject:Tt,newAdditionalObject:lA,newObjectDeferred:kt,newObjectDeferredBegin:mr,getFilters:KA,putStream:NA,events:lt,scaleFactor:ue,pageSize:{getWidth:function(){return Si(P)},setWidth:function(b){If(P,b)},getHeight:function(){return $a(P)},setHeight:function(b){Qf(P,b)}},encryptionOptions:u,encryption:Wr,getEncryptor:function(b){return u!==null?Wr.encryptor(b,0):function(H){return H}},output:bf,getNumberOfPages:za,get pages(){return we},out:R,f2:U,f3:O,getPageInfo:Bi,getPageInfoByObjId:xf,getCurrentPageInfo:av,getPDFVersion:p,Point:Ei,Rectangle:dl,Matrix:Bt,hasHotfix:pn},Object.defineProperty(c.internal.pageSize,"width",{get:function(){return Si(P)},set:function(b){If(P,b)},enumerable:!0,configurable:!0}),Object.defineProperty(c.internal.pageSize,"height",{get:function(){return $a(P)},set:function(b){Qf(P,b)},enumerable:!0,configurable:!0}),(function(b){for(var H=0,se=Re.length;H<se;H++){var he=Gr.call(this,b[H][0],b[H][1],b[H][2],Re[H][3],!0);f===!1&&(h[he]=!0);var be=b[H][0].split("-");nr({id:he,fontName:be[0],fontStyle:be[1]||""})}lt.publish("addFonts",{fonts:Ne,dictionary:ve})}).call(c,Re),Te="F1",na(n,t),lt.publish("initialized"),c}ps.prototype.lsbFirstWord=function(r){return String.fromCharCode(255&r,r>>8&255,r>>16&255,r>>24&255)},ps.prototype.toHexString=function(r){return r.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},ps.prototype.hexToBytes=function(r){for(var e=[],t=0;t<r.length;t+=2)e.push(String.fromCharCode(parseInt(r.substr(t,2),16)));return e.join("")},ps.prototype.processOwnerPassword=function(r,e){return vd(pd(e).substr(0,5),r)},ps.prototype.encryptor=function(r,e){var t=pd(this.encryptionKey+String.fromCharCode(255&r,r>>8&255,r>>16&255,255&e,e>>8&255)).substr(0,10);return function(A){return vd(t,A)}},Vu.prototype.equals=function(r){var e,t="id,objectNumber,equals";if(!r||Dt(r)!==Dt(this))return!1;var A=0;for(e in this)if(!(t.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!r.hasOwnProperty(e)||this[e]!==r[e])return!1;A++}for(e in r)r.hasOwnProperty(e)&&t.indexOf(e)<0&&A--;return A===0},pt.API={events:[]},pt.version="4.0.0";var dr=pt.API,md=1,_a=function(r){return r.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ws=function(r){return r.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Et=function(r){return r.toFixed(2)},Ki=function(r){return r.toFixed(5)};dr.__acroform__={};var RA=function(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r},oB=function(r){return r*md},Kn=function(r){var e=new uB,t=ct.internal.getHeight(r)||0,A=ct.internal.getWidth(r)||0;return e.BBox=[0,0,Number(Et(A)),Number(Et(t))],e},rQ=dr.__acroform__.setBit=function(r,e){if(r=r||0,e=e||0,isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return r|1<<e},AQ=dr.__acroform__.clearBit=function(r,e){if(r=r||0,e=e||0,isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return r&~(1<<e)},nQ=dr.__acroform__.getBit=function(r,e){if(isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return r&1<<e?1:0},Cr=dr.__acroform__.getBitForPdf=function(r,e){if(isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return nQ(r,e-1)},Er=dr.__acroform__.setBitForPdf=function(r,e){if(isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return rQ(r,e-1)},Fr=dr.__acroform__.clearBitForPdf=function(r,e){if(isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return AQ(r,e-1)},iQ=dr.__acroform__.calculateCoordinates=function(r,e){var t=e.internal.getHorizontalCoordinate,A=e.internal.getVerticalCoordinate,n=r[0],i=r[1],s=r[2],a=r[3],o={};return o.lowerLeft_X=t(n)||0,o.lowerLeft_Y=A(i+a)||0,o.upperRight_X=t(n+s)||0,o.upperRight_Y=A(i)||0,[Number(Et(o.lowerLeft_X)),Number(Et(o.lowerLeft_Y)),Number(Et(o.upperRight_X)),Number(Et(o.upperRight_Y))]},aQ=function(r){if(r.appearanceStreamContent)return r.appearanceStreamContent;if(r.V||r.DV){var e=[],t=r._V||r.DV,A=wd(r,t),n=r.scope.internal.getFont(r.fontName,r.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(r.scope.__private__.encodeColorString(r.color)),e.push("/"+n+" "+Et(A.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(A.text),e.push("ET"),e.push("Q"),e.push("EMC");var i=Kn(r);return i.scope=r.scope,i.stream=e.join(`
|
|
594
|
+
`,ni+=uA,ni+=b,R(ni+="ET"),h[Le]=!0,tr};var sv=c.__private__.clip=c.clip=function(b){return R(b==="evenodd"?"W*":"W"),this};c.clipEvenOdd=function(){return sv("evenodd")},c.__private__.discardPath=c.discardPath=function(){return R("n"),this};var ti=c.__private__.isValidStyle=function(b){var H=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(b)!==-1&&(H=!0),H};c.__private__.setDefaultPathOperation=c.setDefaultPathOperation=function(b){return ti(b)&&(l=b),this};var Cf=c.__private__.getStyle=c.getStyle=function(b){var H=l;switch(b){case"D":case"S":H="S";break;case"F":H="f";break;case"FD":case"DF":H="B";break;case"f":case"f*":case"B":case"B*":H=b}return H},Ef=c.close=function(){return R("h"),this};c.stroke=function(){return R("S"),this},c.fill=function(b){return js("f",b),this},c.fillEvenOdd=function(b){return js("f*",b),this},c.fillStroke=function(b){return js("B",b),this},c.fillStrokeEvenOdd=function(b){return js("B*",b),this};var js=function(b,H){Dt(H)==="object"?lv(H,b):R(b)},Ga=function(b){b===null||E===x&&b===void 0||(b=Cf(b),R(b))};function ov(b,H,se,he,be){var Ke=new ms(H||this.boundingBox,se||this.xStep,he||this.yStep,this.gState,be||this.matrix);Ke.stream=this.stream;var We=b+"$$"+this.cloneIndex+++"$$";return zr(We,Ke),Ke}var lv=function(b,H){var se=it[b.key],he=De[se];if(he instanceof Ua)R("q"),R(uv(H)),he.gState&&c.setGState(he.gState),R(b.matrix.toString()+" cm"),R("/"+se+" sh"),R("Q");else if(he instanceof ms){var be=new Bt(1,0,0,-1,0,$a());b.matrix&&(be=be.multiply(b.matrix||nA),se=ov.call(he,b.key,b.boundingBox,b.xStep,b.yStep,be).id),R("q"),R("/Pattern cs"),R("/"+se+" scn"),he.gState&&c.setGState(he.gState),R(H),R("Q")}},uv=function(b){switch(b){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},ll=c.moveTo=function(b,H){return R(T(M(b))+" "+T(C(H))+" m"),this},Ff=c.lineTo=function(b,H){return R(T(M(b))+" "+T(C(H))+" l"),this},Tn=c.curveTo=function(b,H,se,he,be,Ke){return R([T(M(b)),T(C(H)),T(M(se)),T(C(he)),T(M(be)),T(C(Ke)),"c"].join(" ")),this};c.__private__.line=c.line=function(b,H,se,he,be){if(isNaN(b)||isNaN(H)||isNaN(se)||isNaN(he)||!ti(be))throw new Error("Invalid arguments passed to jsPDF.line");return E===B?this.lines([[se-b,he-H]],b,H,[1,1],be||"S"):this.lines([[se-b,he-H]],b,H,[1,1]).stroke()},c.__private__.lines=c.lines=function(b,H,se,he,be,Ke){var We,ht,vt,xt,Ut,Rt,fr,Hr,tr,Xr,jr,uA;if(typeof b=="number"&&(uA=se,se=H,H=b,b=uA),he=he||[1,1],Ke=Ke||!1,isNaN(H)||isNaN(se)||!Array.isArray(b)||!Array.isArray(he)||!ti(be)||typeof Ke!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(ll(H,se),We=he[0],ht=he[1],xt=b.length,Xr=H,jr=se,vt=0;vt<xt;vt++)(Ut=b[vt]).length===2?(Xr=Ut[0]*We+Xr,jr=Ut[1]*ht+jr,Ff(Xr,jr)):(Rt=Ut[0]*We+Xr,fr=Ut[1]*ht+jr,Hr=Ut[2]*We+Xr,tr=Ut[3]*ht+jr,Xr=Ut[4]*We+Xr,jr=Ut[5]*ht+jr,Tn(Rt,fr,Hr,tr,Xr,jr));return Ke&&Ef(),Ga(be),this},c.path=function(b){for(var H=0;H<b.length;H++){var se=b[H],he=se.c;switch(se.op){case"m":ll(he[0],he[1]);break;case"l":Ff(he[0],he[1]);break;case"c":Tn.apply(this,he);break;case"h":Ef()}}return this},c.__private__.rect=c.rect=function(b,H,se,he,be){if(isNaN(b)||isNaN(H)||isNaN(se)||isNaN(he)||!ti(be))throw new Error("Invalid arguments passed to jsPDF.rect");return E===B&&(he=-he),R([T(M(b)),T(C(H)),T(M(se)),T(M(he)),"re"].join(" ")),Ga(be),this},c.__private__.triangle=c.triangle=function(b,H,se,he,be,Ke,We){if(isNaN(b)||isNaN(H)||isNaN(se)||isNaN(he)||isNaN(be)||isNaN(Ke)||!ti(We))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[se-b,he-H],[be-se,Ke-he],[b-be,H-Ke]],b,H,[1,1],We,!0),this},c.__private__.roundedRect=c.roundedRect=function(b,H,se,he,be,Ke,We){if(isNaN(b)||isNaN(H)||isNaN(se)||isNaN(he)||isNaN(be)||isNaN(Ke)||!ti(We))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var ht=4/3*(Math.SQRT2-1);return be=Math.min(be,.5*se),Ke=Math.min(Ke,.5*he),this.lines([[se-2*be,0],[be*ht,0,be,Ke-Ke*ht,be,Ke],[0,he-2*Ke],[0,Ke*ht,-be*ht,Ke,-be,Ke],[2*be-se,0],[-be*ht,0,-be,-Ke*ht,-be,-Ke],[0,2*Ke-he],[0,-Ke*ht,be*ht,-Ke,be,-Ke]],b+be,H,[1,1],We,!0),this},c.__private__.ellipse=c.ellipse=function(b,H,se,he,be){if(isNaN(b)||isNaN(H)||isNaN(se)||isNaN(he)||!ti(be))throw new Error("Invalid arguments passed to jsPDF.ellipse");var Ke=4/3*(Math.SQRT2-1)*se,We=4/3*(Math.SQRT2-1)*he;return ll(b+se,H),Tn(b+se,H-We,b+Ke,H-he,b,H-he),Tn(b-Ke,H-he,b-se,H-We,b-se,H),Tn(b-se,H+We,b-Ke,H+he,b,H+he),Tn(b+Ke,H+he,b+se,H+We,b+se,H),Ga(be),this},c.__private__.circle=c.circle=function(b,H,se,he){if(isNaN(b)||isNaN(H)||isNaN(se)||!ti(he))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(b,H,se,se,he)},c.setFont=function(b,H,se){return se&&(H=S(H,se)),Le=yf(b,H,{disableWarning:!1}),this};var cv=c.__private__.getFont=c.getFont=function(){return Ne[yf.apply(c,arguments)]};c.__private__.getFontList=c.getFontList=function(){var b,H,se={};for(b in ve)if(ve.hasOwnProperty(b))for(H in se[b]=[],ve[b])ve[b].hasOwnProperty(H)&&se[b].push(H);return se},c.addFont=function(b,H,se,he,be){var Ke=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&Ke.indexOf(arguments[3])!==-1?be=arguments[3]:arguments[3]&&Ke.indexOf(arguments[3])==-1&&(se=S(se,he)),Gr.call(this,b,H,se,be=be||"Identity-H")};var Wa,ul=r.lineWidth||.200025,fv=c.__private__.getLineWidth=c.getLineWidth=function(){return ul},Ct=c.__private__.setLineWidth=c.setLineWidth=function(b){return ul=b,R(T(M(b))+" w"),this};c.__private__.setLineDash=pt.API.setLineDash=pt.API.setLineDashPattern=function(b,H){if(b=b||[],H=H||0,isNaN(H)||!Array.isArray(b))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return b=b.map(function(se){return T(M(se))}).join(" "),H=T(M(H)),R("["+b+"] "+H+" d"),this};var hv=c.__private__.getLineHeight=c.getLineHeight=function(){return Ee*Wa};c.__private__.getLineHeight=c.getLineHeight=function(){return Ee*Wa};var dv=c.__private__.setLineHeightFactor=c.setLineHeightFactor=function(b){return typeof(b=b||1.15)=="number"&&(Wa=b),this},gv=c.__private__.getLineHeightFactor=c.getLineHeightFactor=function(){return Wa};dv(r.lineHeight);var bi=c.__private__.getHorizontalCoordinate=function(b){return M(b)},xi=c.__private__.getVerticalCoordinate=function(b){return E===x?b:tt[P].mediaBox.topRightY-tt[P].mediaBox.bottomLeftY-M(b)},pv=c.__private__.getHorizontalCoordinateString=c.getHorizontalCoordinateString=function(b){return T(bi(b))},vv=c.__private__.getVerticalCoordinateString=c.getVerticalCoordinateString=function(b){return T(xi(b))},Ks=r.strokeColor||"0 G";c.__private__.getStrokeColor=c.getDrawColor=function(){return Dr(Ks)},c.__private__.setStrokeColor=c.setDrawColor=function(b,H,se,he){return Ks=jA({ch1:b,ch2:H,ch3:se,ch4:he,pdfColorType:"draw",precision:2}),R(Ks),this};var cl=r.fillColor||"0 g";c.__private__.getFillColor=c.getFillColor=function(){return Dr(cl)},c.__private__.setFillColor=c.setFillColor=function(b,H,se,he){return cl=jA({ch1:b,ch2:H,ch3:se,ch4:he,pdfColorType:"fill",precision:2}),R(cl),this};var Xa=r.textColor||"0 g",mv=c.__private__.getTextColor=c.getTextColor=function(){return Dr(Xa)};c.__private__.setTextColor=c.setTextColor=function(b,H,se,he){return Xa=jA({ch1:b,ch2:H,ch3:se,ch4:he,pdfColorType:"text",precision:3}),this};var Ci=r.charSpace,wv=c.__private__.getCharSpace=c.getCharSpace=function(){return parseFloat(Ci||0)};c.__private__.setCharSpace=c.setCharSpace=function(b){if(isNaN(b))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Ci=b,this};var fl=0;c.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},c.__private__.setLineCap=c.setLineCap=function(b){var H=c.CapJoinStyles[b];if(H===void 0)throw new Error("Line cap style of '"+b+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return fl=H,R(H+" J"),this};var hl=0;c.__private__.setLineJoin=c.setLineJoin=function(b){var H=c.CapJoinStyles[b];if(H===void 0)throw new Error("Line join style of '"+b+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return hl=H,R(H+" j"),this},c.__private__.setLineMiterLimit=c.__private__.setMiterLimit=c.setLineMiterLimit=c.setMiterLimit=function(b){if(b=b||0,isNaN(b))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return R(T(M(b))+" M"),this},c.GState=Vu,c.setGState=function(b){(b=typeof b=="string"?et[Ge[b]]:Sf(null,b)).equals(At)||(R("/"+b.id+" gs"),At=b)};var Sf=function(b,H){if(!b||!Ge[b]){var se=!1;for(var he in et)if(et.hasOwnProperty(he)&&et[he].equals(H)){se=!0;break}if(se)H=et[he];else{var be="GS"+(Object.keys(et).length+1).toString(10);et[be]=H,H.id=be}return b&&(Ge[b]=H.id),lt.publish("addGState",H),H}};c.addGState=function(b,H){return Sf(b,H),this},c.saveGraphicsState=function(){return R("q"),Qe.push({key:Le,size:Ee,color:Xa}),this},c.restoreGraphicsState=function(){R("Q");var b=Qe.pop();return Le=b.key,Ee=b.size,Xa=b.color,At=null,this},c.setCurrentTransformationMatrix=function(b){return R(b.toString()+" cm"),this},c.comment=function(b){return R("#"+b),this};var Ei=function(b,H){var se=b||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return se},set:function(Ke){isNaN(Ke)||(se=parseFloat(Ke))}});var he=H||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return he},set:function(Ke){isNaN(Ke)||(he=parseFloat(Ke))}});var be="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return be},set:function(Ke){be=Ke.toString()}}),this},dl=function(b,H,se,he){Ei.call(this,b,H),this.type="rect";var be=se||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return be},set:function(We){isNaN(We)||(be=parseFloat(We))}});var Ke=he||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return Ke},set:function(We){isNaN(We)||(Ke=parseFloat(We))}}),this},qs=function(){this.page=nt,this.currentPage=P,this.pages=we.slice(0),this.pagesContext=tt.slice(0),this.x=fe,this.y=Pe,this.matrix=Fe,this.width=pl(P),this.height=_f(P),this.outputDestination=Be,this.id="",this.objectNumber=-1};qs.prototype.restore=function(){nt=this.page,P=this.currentPage,tt=this.pagesContext,we=this.pages,fe=this.x,Pe=this.y,Fe=this.matrix,Uf(P,this.width),Fi(P,this.height),Be=this.outputDestination};var gl=function(b,H,se,he,be){Vr.push(new qs),nt=P=0,we=[],fe=b,Pe=H,Fe=be,gn([se,he])};for(var Ya in c.beginFormObject=function(b,H,se,he,be){return gl(b,H,se,he,be),this},c.endFormObject=function(b){return(function(H){if(AA[H])Vr.pop().restore();else{var se=new qs,he="Xo"+(Object.keys(_t).length+1).toString(10);se.id=he,AA[H]=he,_t[he]=se,lt.publish("addFormObject",se),Vr.pop().restore()}})(b),this},c.doFormObject=function(b,H){var se=_t[AA[b]];return R("q"),R(H.toString()+" cm"),R("/"+se.id+" Do"),R("Q"),this},c.getFormObject=function(b){var H=_t[AA[b]];return{x:H.x,y:H.y,width:H.width,height:H.height,matrix:H.matrix}},c.save=function(b,H){return b=b||"generated.pdf",(H=H||{}).returnPromise=H.returnPromise||!1,H.returnPromise===!1?(Sa(Hs(ei()),b),typeof Sa.unload=="function"&&bt.setTimeout&&setTimeout(Sa.unload,911),this):new Promise(function(se,he){try{var be=Sa(Hs(ei()),b);typeof Sa.unload=="function"&&bt.setTimeout&&setTimeout(Sa.unload,911),se(be)}catch(Ke){he(Ke.message)}})},pt.API)pt.API.hasOwnProperty(Ya)&&(Ya==="events"&&pt.API.events.length?(function(b,H){var se,he,be;for(be=H.length-1;be!==-1;be--)se=H[be][0],he=H[be][1],b.subscribe.apply(b,[se].concat(typeof he=="function"?[he]:he))})(lt,pt.API.events):c[Ya]=pt.API[Ya]);function pl(b){return tt[b].mediaBox.topRightX-tt[b].mediaBox.bottomLeftX}function Uf(b,H){tt[b].mediaBox.topRightX=H+tt[b].mediaBox.bottomLeftX}function _f(b){return tt[b].mediaBox.topRightY-tt[b].mediaBox.bottomLeftY}function Fi(b,H){tt[b].mediaBox.topRightY=H+tt[b].mediaBox.bottomLeftY}var Si=c.getPageWidth=function(b){return pl(b=b||P)/ue},If=c.setPageWidth=function(b,H){Uf(b,H*ue)},$a=c.getPageHeight=function(b){return _f(b=b||P)/ue},Qf=c.setPageHeight=function(b,H){Fi(b,H*ue)};return c.internal={pdfEscape:yr,getStyle:Cf,getFont:cv,getFontSize:Me,getCharSpace:wv,getTextColor:mv,getLineHeight:hv,getLineHeightFactor:gv,getLineWidth:fv,write:Ie,getHorizontalCoordinate:bi,getVerticalCoordinate:xi,getCoordinateString:pv,getVerticalCoordinateString:vv,collections:{},newObject:Tt,newAdditionalObject:lA,newObjectDeferred:kt,newObjectDeferredBegin:mr,getFilters:KA,putStream:NA,events:lt,scaleFactor:ue,pageSize:{getWidth:function(){return Si(P)},setWidth:function(b){If(P,b)},getHeight:function(){return $a(P)},setHeight:function(b){Qf(P,b)}},encryptionOptions:u,encryption:Wr,getEncryptor:function(b){return u!==null?Wr.encryptor(b,0):function(H){return H}},output:bf,getNumberOfPages:za,get pages(){return we},out:R,f2:U,f3:O,getPageInfo:Bi,getPageInfoByObjId:xf,getCurrentPageInfo:av,getPDFVersion:p,Point:Ei,Rectangle:dl,Matrix:Bt,hasHotfix:pn},Object.defineProperty(c.internal.pageSize,"width",{get:function(){return Si(P)},set:function(b){If(P,b)},enumerable:!0,configurable:!0}),Object.defineProperty(c.internal.pageSize,"height",{get:function(){return $a(P)},set:function(b){Qf(P,b)},enumerable:!0,configurable:!0}),(function(b){for(var H=0,se=Te.length;H<se;H++){var he=Gr.call(this,b[H][0],b[H][1],b[H][2],Te[H][3],!0);f===!1&&(h[he]=!0);var be=b[H][0].split("-");nr({id:he,fontName:be[0],fontStyle:be[1]||""})}lt.publish("addFonts",{fonts:Ne,dictionary:ve})}).call(c,Te),Le="F1",na(n,t),lt.publish("initialized"),c}ps.prototype.lsbFirstWord=function(r){return String.fromCharCode(255&r,r>>8&255,r>>16&255,r>>24&255)},ps.prototype.toHexString=function(r){return r.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},ps.prototype.hexToBytes=function(r){for(var e=[],t=0;t<r.length;t+=2)e.push(String.fromCharCode(parseInt(r.substr(t,2),16)));return e.join("")},ps.prototype.processOwnerPassword=function(r,e){return vd(pd(e).substr(0,5),r)},ps.prototype.encryptor=function(r,e){var t=pd(this.encryptionKey+String.fromCharCode(255&r,r>>8&255,r>>16&255,255&e,e>>8&255)).substr(0,10);return function(A){return vd(t,A)}},Vu.prototype.equals=function(r){var e,t="id,objectNumber,equals";if(!r||Dt(r)!==Dt(this))return!1;var A=0;for(e in this)if(!(t.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!r.hasOwnProperty(e)||this[e]!==r[e])return!1;A++}for(e in r)r.hasOwnProperty(e)&&t.indexOf(e)<0&&A--;return A===0},pt.API={events:[]},pt.version="4.0.0";var dr=pt.API,md=1,_a=function(r){return r.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ws=function(r){return r.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Et=function(r){return r.toFixed(2)},Ki=function(r){return r.toFixed(5)};dr.__acroform__={};var RA=function(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r},oB=function(r){return r*md},Kn=function(r){var e=new uB,t=ct.internal.getHeight(r)||0,A=ct.internal.getWidth(r)||0;return e.BBox=[0,0,Number(Et(A)),Number(Et(t))],e},rQ=dr.__acroform__.setBit=function(r,e){if(r=r||0,e=e||0,isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return r|1<<e},AQ=dr.__acroform__.clearBit=function(r,e){if(r=r||0,e=e||0,isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return r&~(1<<e)},nQ=dr.__acroform__.getBit=function(r,e){if(isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return r&1<<e?1:0},Cr=dr.__acroform__.getBitForPdf=function(r,e){if(isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return nQ(r,e-1)},Er=dr.__acroform__.setBitForPdf=function(r,e){if(isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return rQ(r,e-1)},Fr=dr.__acroform__.clearBitForPdf=function(r,e){if(isNaN(r)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return AQ(r,e-1)},iQ=dr.__acroform__.calculateCoordinates=function(r,e){var t=e.internal.getHorizontalCoordinate,A=e.internal.getVerticalCoordinate,n=r[0],i=r[1],s=r[2],a=r[3],o={};return o.lowerLeft_X=t(n)||0,o.lowerLeft_Y=A(i+a)||0,o.upperRight_X=t(n+s)||0,o.upperRight_Y=A(i)||0,[Number(Et(o.lowerLeft_X)),Number(Et(o.lowerLeft_Y)),Number(Et(o.upperRight_X)),Number(Et(o.upperRight_Y))]},aQ=function(r){if(r.appearanceStreamContent)return r.appearanceStreamContent;if(r.V||r.DV){var e=[],t=r._V||r.DV,A=wd(r,t),n=r.scope.internal.getFont(r.fontName,r.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(r.scope.__private__.encodeColorString(r.color)),e.push("/"+n+" "+Et(A.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(A.text),e.push("ET"),e.push("Q"),e.push("EMC");var i=Kn(r);return i.scope=r.scope,i.stream=e.join(`
|
|
595
595
|
`),i}},wd=function(r,e){var t=r.fontSize===0?r.maxFontSize:r.fontSize,A={text:"",fontSize:""},n=(e=(e=e.substr(0,1)=="("?e.substr(1):e).substr(e.length-1)==")"?e.substr(0,e.length-1):e).split(" ");n=r.multiline?n.map(function(U){return U.split(`
|
|
596
596
|
`)}):n.map(function(U){return[U]});var i=t,s=ct.internal.getHeight(r)||0;s=s<0?-s:s;var a=ct.internal.getWidth(r)||0;a=a<0?-a:a;var o=function(U,O,M){if(U+1<n.length){var C=O+" "+n[U+1][0];return zu(C,r,M).width<=a-4}return!1};i++;e:for(;i>0;){e="",i--;var l,u,f=zu("3",r,i).height,h=r.multiline?s-i:(s-f)/2,c=h+=2,g=0,p=0,y=0;if(i<=0){e=`(...) Tj
|
|
597
597
|
`,e+="% Width of Text: "+zu(e,r,i=12).width+", FieldWidth:"+a+`
|
|
@@ -641,13 +641,13 @@ T* `):b.join(` Tj
|
|
|
641
641
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
642
642
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
643
643
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
644
|
-
*/function Ed(r){var e,t,A,n,i,s=Math.floor,a=new Array(64),o=new Array(64),l=new Array(64),u=new Array(64),f=new Array(65535),h=new Array(65535),c=new Array(64),g=new Array(64),p=[],y=0,w=7,B=new Array(64),x=new Array(64),E=new Array(64),Q=new Array(256),L=new Array(2048),S=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],T=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],_=[0,1,2,3,4,5,6,7,8,9,10,11],D=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],U=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],O=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],M=[0,1,2,3,4,5,6,7,8,9,10,11],C=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],z=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function re(I,P){for(var K=0,Y=0,J=new Array,q=1;q<=16;q++){for(var W=1;W<=I[q];W++)J[P[Y]]=[],J[P[Y]][0]=K,J[P[Y]][1]=q,Y++,K++;K*=2}return J}function ne(I){for(var P=I[0],K=I[1]-1;K>=0;)P&1<<K&&(y|=1<<w),K--,--w<0&&(y==255?(Z(255),Z(0)):Z(y),w=7,y=0)}function Z(I){p.push(I)}function Ae(I){Z(I>>8&255),Z(255&I)}function V(I,P,K,Y,J){for(var q,W=J[0],te=J[240],oe=(function(Ee,Ve){var Me,ze,Ye,xe,Oe,je,ge,
|
|
644
|
+
*/function Ed(r){var e,t,A,n,i,s=Math.floor,a=new Array(64),o=new Array(64),l=new Array(64),u=new Array(64),f=new Array(65535),h=new Array(65535),c=new Array(64),g=new Array(64),p=[],y=0,w=7,B=new Array(64),x=new Array(64),E=new Array(64),Q=new Array(256),L=new Array(2048),S=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],T=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],_=[0,1,2,3,4,5,6,7,8,9,10,11],D=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],U=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],O=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],M=[0,1,2,3,4,5,6,7,8,9,10,11],C=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],z=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function re(I,P){for(var K=0,Y=0,J=new Array,q=1;q<=16;q++){for(var W=1;W<=I[q];W++)J[P[Y]]=[],J[P[Y]][0]=K,J[P[Y]][1]=q,Y++,K++;K*=2}return J}function ne(I){for(var P=I[0],K=I[1]-1;K>=0;)P&1<<K&&(y|=1<<w),K--,--w<0&&(y==255?(Z(255),Z(0)):Z(y),w=7,y=0)}function Z(I){p.push(I)}function Ae(I){Z(I>>8&255),Z(255&I)}function V(I,P,K,Y,J){for(var q,W=J[0],te=J[240],oe=(function(Ee,Ve){var Me,ze,Ye,xe,Oe,je,ge,Re,Le,ue,fe=0;for(Le=0;Le<8;++Le){Me=Ee[fe],ze=Ee[fe+1],Ye=Ee[fe+2],xe=Ee[fe+3],Oe=Ee[fe+4],je=Ee[fe+5],ge=Ee[fe+6];var Pe=Me+(Re=Ee[fe+7]),Fe=Me-Re,Ne=ze+ge,ve=ze-ge,Qe=Ye+je,De=Ye-je,it=xe+Oe,et=xe-Oe,Ge=Pe+it,At=Pe-it,nt=Ne+Qe,tt=Ne-Qe;Ee[fe]=Ge+nt,Ee[fe+4]=Ge-nt;var lt=.707106781*(tt+At);Ee[fe+2]=At+lt,Ee[fe+6]=At-lt;var ur=.382683433*((Ge=et+De)-(tt=ve+Fe)),_t=.5411961*Ge+ur,AA=1.306562965*tt+ur,Vr=.707106781*(nt=De+ve),Bt=Fe+Vr,Mr=Fe-Vr;Ee[fe+5]=Mr+_t,Ee[fe+3]=Mr-_t,Ee[fe+1]=Bt+AA,Ee[fe+7]=Bt-AA,fe+=8}for(fe=0,Le=0;Le<8;++Le){Me=Ee[fe],ze=Ee[fe+8],Ye=Ee[fe+16],xe=Ee[fe+24],Oe=Ee[fe+32],je=Ee[fe+40],ge=Ee[fe+48];var nA=Me+(Re=Ee[fe+56]),zr=Me-Re,bA=ze+ge,Tt=ze-ge,kt=Ye+je,mr=Ye-je,lA=xe+Oe,QA=xe-Oe,HA=nA+lA,Dr=nA-lA,jA=bA+kt,KA=bA-kt;Ee[fe]=HA+jA,Ee[fe+32]=HA-jA;var NA=.707106781*(KA+Dr);Ee[fe+16]=Dr+NA,Ee[fe+48]=Dr-NA;var Jn=.382683433*((HA=QA+mr)-(KA=Tt+zr)),dn=.5411961*HA+Jn,ft=1.306562965*KA+Jn,de=.707106781*(jA=mr+Tt),Je=zr+de,ot=zr-de;Ee[fe+40]=ot+dn,Ee[fe+24]=ot-dn,Ee[fe+8]=Je+ft,Ee[fe+56]=Je-ft,fe++}for(Le=0;Le<64;++Le)ue=Ee[Le]*Ve[Le],c[Le]=ue>0?ue+.5|0:ue-.5|0;return c})(I,P),we=0;we<64;++we)g[S[we]]=oe[we];var le=g[0]-K;K=g[0],le==0?ne(Y[0]):(ne(Y[h[q=32767+le]]),ne(f[q]));for(var Be=63;Be>0&&g[Be]==0;)Be--;if(Be==0)return ne(W),K;for(var ye,R=1;R<=Be;){for(var Ie=R;g[R]==0&&R<=Be;)++R;var Ue=R-Ie;if(Ue>=16){ye=Ue>>4;for(var Te=1;Te<=ye;++Te)ne(te);Ue&=15}q=32767+g[R],ne(J[(Ue<<4)+h[q]]),ne(f[q]),R++}return Be!=63&&ne(W),K}function k(I){I=Math.min(Math.max(I,1),100),i!=I&&((function(P){for(var K=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],Y=0;Y<64;Y++){var J=s((K[Y]*P+50)/100);J=Math.min(Math.max(J,1),255),a[S[Y]]=J}for(var q=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],W=0;W<64;W++){var te=s((q[W]*P+50)/100);te=Math.min(Math.max(te,1),255),o[S[W]]=te}for(var oe=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],we=0,le=0;le<8;le++)for(var Be=0;Be<8;Be++)l[we]=1/(a[S[we]]*oe[le]*oe[Be]*8),u[we]=1/(o[S[we]]*oe[le]*oe[Be]*8),we++})(I<50?Math.floor(5e3/I):Math.floor(200-2*I)),i=I)}this.encode=function(I,P){P&&k(P),p=new Array,y=0,w=7,Ae(65496),Ae(65504),Ae(16),Z(74),Z(70),Z(73),Z(70),Z(0),Z(1),Z(1),Z(0),Ae(1),Ae(1),Z(0),Z(0),(function(){Ae(65499),Ae(132),Z(0);for(var ze=0;ze<64;ze++)Z(a[ze]);Z(1);for(var Ye=0;Ye<64;Ye++)Z(o[Ye])})(),(function(ze,Ye){Ae(65472),Ae(17),Z(8),Ae(Ye),Ae(ze),Z(3),Z(1),Z(17),Z(0),Z(2),Z(17),Z(1),Z(3),Z(17),Z(1)})(I.width,I.height),(function(){Ae(65476),Ae(418),Z(0);for(var ze=0;ze<16;ze++)Z(T[ze+1]);for(var Ye=0;Ye<=11;Ye++)Z(_[Ye]);Z(16);for(var xe=0;xe<16;xe++)Z(D[xe+1]);for(var Oe=0;Oe<=161;Oe++)Z(U[Oe]);Z(1);for(var je=0;je<16;je++)Z(O[je+1]);for(var ge=0;ge<=11;ge++)Z(M[ge]);Z(17);for(var Re=0;Re<16;Re++)Z(C[Re+1]);for(var Le=0;Le<=161;Le++)Z(z[Le])})(),Ae(65498),Ae(12),Z(3),Z(1),Z(0),Z(2),Z(17),Z(3),Z(17),Z(0),Z(63),Z(0);var K=0,Y=0,J=0;y=0,w=7,this.encode.displayName="_encode_";for(var q,W,te,oe,we,le,Be,ye,R,Ie=I.data,Ue=I.width,Te=I.height,Ee=4*Ue,Ve=0;Ve<Te;){for(q=0;q<Ee;){for(we=Ee*Ve+q,Be=-1,ye=0,R=0;R<64;R++)le=we+(ye=R>>3)*Ee+(Be=4*(7&R)),Ve+ye>=Te&&(le-=Ee*(Ve+1+ye-Te)),q+Be>=Ee&&(le-=q+Be-Ee+4),W=Ie[le++],te=Ie[le++],oe=Ie[le++],B[R]=(L[W]+L[te+256|0]+L[oe+512|0]>>16)-128,x[R]=(L[W+768|0]+L[te+1024|0]+L[oe+1280|0]>>16)-128,E[R]=(L[W+1280|0]+L[te+1536|0]+L[oe+1792|0]>>16)-128;K=V(B,l,K,e,A),Y=V(x,u,Y,t,n),J=V(E,u,J,t,n),q+=32}Ve+=8}if(w>=0){var Me=[];Me[1]=w+1,Me[0]=(1<<w+1)-1,ne(Me)}return Ae(65497),new Uint8Array(p)},r=r||50,(function(){for(var I=String.fromCharCode,P=0;P<256;P++)Q[P]=I(P)})(),e=re(T,_),t=re(O,M),A=re(D,U),n=re(C,z),(function(){for(var I=1,P=2,K=1;K<=15;K++){for(var Y=I;Y<P;Y++)h[32767+Y]=K,f[32767+Y]=[],f[32767+Y][1]=K,f[32767+Y][0]=Y;for(var J=-(P-1);J<=-I;J++)h[32767+J]=K,f[32767+J]=[],f[32767+J][1]=K,f[32767+J][0]=P-1+J;I<<=1,P<<=1}})(),(function(){for(var I=0;I<256;I++)L[I]=19595*I,L[I+256|0]=38470*I,L[I+512|0]=7471*I+32768,L[I+768|0]=-11059*I,L[I+1024|0]=-21709*I,L[I+1280|0]=32768*I+8421375,L[I+1536|0]=-27439*I,L[I+1792|0]=-5329*I})(),k(r)}/**
|
|
645
645
|
* @license
|
|
646
646
|
* Copyright (c) 2017 Aras Abbasi
|
|
647
647
|
*
|
|
648
648
|
* Licensed under the MIT License.
|
|
649
649
|
* http://opensource.org/licenses/mit-license
|
|
650
|
-
*/function Cn(r,e){if(this.pos=0,this.buffer=r,this.datav=new DataView(r.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function OB(r){function e(_){if(!_)throw Error("assert :P")}function t(_,D,U){for(var O=0;4>O;O++)if(_[D+O]!=U.charCodeAt(O))return!0;return!1}function A(_,D,U,O,M){for(var C=0;C<M;C++)_[D+C]=U[O+C]}function n(_,D,U,O){for(var M=0;M<O;M++)_[D+M]=U}function i(_){return new Int32Array(_)}function s(_,D){for(var U=[],O=0;O<_;O++)U.push(new D);return U}function a(_,D){var U=[];return(function O(M,C,z){for(var re=z[C],ne=0;ne<re&&(M.push(z.length>C+1?[]:new D),!(z.length<C+1));ne++)O(M[ne],C+1,z)})(U,0,_),U}var o=function(){var _=this;function D(d,m){for(var F=1<<m-1>>>0;d&F;)F>>>=1;return F?(d&F-1)+F:d}function U(d,m,F,N,j){e(!(N%F));do d[m+(N-=F)]=j;while(0<N)}function O(d,m,F,N,j){if(e(2328>=j),512>=j)var G=i(512);else if((G=i(j))==null)return 0;return(function(X,$,ee,ie,pe,_e){var ae,me,Ce=$,ke=1<<ee,Se=i(16),He=i(16);for(e(pe!=0),e(ie!=null),e(X!=null),e(0<ee),me=0;me<pe;++me){if(15<ie[me])return 0;++Se[ie[me]]}if(Se[0]==pe)return 0;for(He[1]=0,ae=1;15>ae;++ae){if(Se[ae]>1<<ae)return 0;He[ae+1]=He[ae]+Se[ae]}for(me=0;me<pe;++me)ae=ie[me],0<ie[me]&&(_e[He[ae]++]=me);if(He[15]==1)return(ie=new M).g=0,ie.value=_e[0],U(X,Ce,1,ke,ie),ke;var qe,Ze=-1,Xe=ke-1,mt=0,ut=1,It=1,dt=1<<ee;for(me=0,ae=1,pe=2;ae<=ee;++ae,pe<<=1){if(ut+=It<<=1,0>(It-=Se[ae]))return 0;for(;0<Se[ae];--Se[ae])(ie=new M).g=ae,ie.value=_e[me++],U(X,Ce+mt,pe,dt,ie),mt=D(mt,ae)}for(ae=ee+1,pe=2;15>=ae;++ae,pe<<=1){if(ut+=It<<=1,0>(It-=Se[ae]))return 0;for(;0<Se[ae];--Se[ae]){if(ie=new M,(mt&Xe)!=Ze){for(Ce+=dt,qe=1<<(Ze=ae)-ee;15>Ze&&!(0>=(qe-=Se[Ze]));)++Ze,qe<<=1;ke+=dt=1<<(qe=Ze-ee),X[$+(Ze=mt&Xe)].g=qe+ee,X[$+Ze].value=Ce-$-Ze}ie.g=ae-ee,ie.value=_e[me++],U(X,Ce+(mt>>ee),pe,dt,ie),mt=D(mt,ae)}}return ut!=2*He[15]-1?0:ke})(d,m,F,N,j,G)}function M(){this.value=this.g=0}function C(){this.value=this.g=0}function z(){this.G=s(5,M),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=s(As,C)}function re(d,m,F,N){e(d!=null),e(m!=null),e(2147483648>N),d.Ca=254,d.I=0,d.b=-8,d.Ka=0,d.oa=m,d.pa=F,d.Jd=m,d.Yc=F+N,d.Zc=4<=N?F+N-4+1:F,W(d)}function ne(d,m){for(var F=0;0<m--;)F|=oe(d,128)<<m;return F}function Z(d,m){var F=ne(d,m);return te(d)?-F:F}function Ae(d,m,F,N){var j,G=0;for(e(d!=null),e(m!=null),e(4294967288>N),d.Sb=N,d.Ra=0,d.u=0,d.h=0,4<N&&(N=4),j=0;j<N;++j)G+=m[F+j]<<8*j;d.Ra=G,d.bb=N,d.oa=m,d.pa=F}function V(d){for(;8<=d.u&&d.bb<d.Sb;)d.Ra>>>=8,d.Ra+=d.oa[d.pa+d.bb]<<oa-8>>>0,++d.bb,d.u-=8;Y(d)&&(d.h=1,d.u=0)}function k(d,m){if(e(0<=m),!d.h&&m<=ZA){var F=K(d)&JA[m];return d.u+=m,V(d),F}return d.h=1,d.u=0}function I(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function P(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function K(d){return d.Ra>>>(d.u&oa-1)>>>0}function Y(d){return e(d.bb<=d.Sb),d.h||d.bb==d.Sb&&d.u>oa}function J(d,m){d.u=m,d.h=Y(d)}function q(d){d.u>=Qi&&(e(d.u>=Qi),V(d))}function W(d){e(d!=null&&d.oa!=null),d.pa<d.Zc?(d.I=(d.oa[d.pa++]|d.I<<8)>>>0,d.b+=8):(e(d!=null&&d.oa!=null),d.pa<d.Yc?(d.b+=8,d.I=d.oa[d.pa++]|d.I<<8):d.Ka?d.b=0:(d.I<<=8,d.b+=8,d.Ka=1))}function te(d){return ne(d,1)}function oe(d,m){var F=d.Ca;0>d.b&&W(d);var N=d.b,j=F*m>>>8,G=(d.I>>>N>j)+0;for(G?(F-=j,d.I-=j+1<<N>>>0):F=j+1,N=F,j=0;256<=N;)j+=8,N>>=8;return N=7^j+la[N],d.b-=N,d.Ca=(F<<N)-1,G}function we(d,m,F){d[m+0]=F>>24&255,d[m+1]=F>>16&255,d[m+2]=F>>8&255,d[m+3]=255&F}function le(d,m){return d[m+0]|d[m+1]<<8}function Be(d,m){return le(d,m)|d[m+2]<<16}function ye(d,m){return le(d,m)|le(d,m+2)<<16}function R(d,m){var F=1<<m;return e(d!=null),e(0<m),d.X=i(F),d.X==null?0:(d.Mb=32-m,d.Xa=m,1)}function Ie(d,m){e(d!=null),e(m!=null),e(d.Xa==m.Xa),A(m.X,0,d.X,0,1<<m.Xa)}function Ue(){this.X=[],this.Xa=this.Mb=0}function Re(d,m,F,N){e(F!=null),e(N!=null);var j=F[0],G=N[0];return j==0&&(j=(d*G+m/2)/m),G==0&&(G=(m*j+d/2)/d),0>=j||0>=G?0:(F[0]=j,N[0]=G,1)}function Ee(d,m){return d+(1<<m)-1>>>m}function Ve(d,m){return((4278255360&d)+(4278255360&m)>>>0&4278255360)+((16711935&d)+(16711935&m)>>>0&16711935)>>>0}function Me(d,m){_[m]=function(F,N,j,G,X,$,ee){var ie;for(ie=0;ie<X;++ie){var pe=_[d]($[ee+ie-1],j,G+ie);$[ee+ie]=Ve(F[N+ie],pe)}}}function ze(){this.ud=this.hd=this.jd=0}function Ye(d,m){return((4278124286&(d^m))>>>1)+(d&m)>>>0}function xe(d){return 0<=d&&256>d?d:0>d?0:255<d?255:void 0}function Oe(d,m){return xe(d+(d-m+.5>>1))}function je(d,m,F){return Math.abs(m-F)-Math.abs(d-F)}function ge(d,m,F,N,j,G,X){for(N=G[X-1],F=0;F<j;++F)G[X+F]=N=Ve(d[m+F],N)}function Pe(d,m,F,N,j){var G;for(G=0;G<F;++G){var X=d[m+G],$=X>>8&255,ee=16711935&(ee=(ee=16711935&X)+(($<<16)+$));N[j+G]=(4278255360&X)+ee>>>0}}function Te(d,m){m.jd=255&d,m.hd=d>>8&255,m.ud=d>>16&255}function ue(d,m,F,N,j,G){var X;for(X=0;X<N;++X){var $=m[F+X],ee=$>>>8,ie=$,pe=255&(pe=(pe=$>>>16)+((d.jd<<24>>24)*(ee<<24>>24)>>>5));ie=255&(ie=(ie+=(d.hd<<24>>24)*(ee<<24>>24)>>>5)+((d.ud<<24>>24)*(pe<<24>>24)>>>5)),j[G+X]=(4278255360&$)+(pe<<16)+ie}}function fe(d,m,F,N,j){_[m]=function(G,X,$,ee,ie,pe,_e,ae,me){for(ee=_e;ee<ae;++ee)for(_e=0;_e<me;++_e)ie[pe++]=j($[N(G[X++])])},_[d]=function(G,X,$,ee,ie,pe,_e){var ae=8>>G.b,me=G.Ea,Ce=G.K[0],ke=G.w;if(8>ae)for(G=(1<<G.b)-1,ke=(1<<ae)-1;X<$;++X){var Se,He=0;for(Se=0;Se<me;++Se)Se&G||(He=N(ee[ie++])),pe[_e++]=j(Ce[He&ke]),He>>=ae}else _["VP8LMapColor"+F](ee,ie,Ce,ke,pe,_e,X,$,me)}}function Le(d,m,F,N,j){for(F=m+F;m<F;){var G=d[m++];N[j++]=G>>16&255,N[j++]=G>>8&255,N[j++]=255&G}}function Fe(d,m,F,N,j){for(F=m+F;m<F;){var G=d[m++];N[j++]=G>>16&255,N[j++]=G>>8&255,N[j++]=255&G,N[j++]=G>>24&255}}function Ne(d,m,F,N,j){for(F=m+F;m<F;){var G=(X=d[m++])>>16&240|X>>12&15,X=240&X|X>>28&15;N[j++]=G,N[j++]=X}}function ve(d,m,F,N,j){for(F=m+F;m<F;){var G=(X=d[m++])>>16&248|X>>13&7,X=X>>5&224|X>>3&31;N[j++]=G,N[j++]=X}}function Qe(d,m,F,N,j){for(F=m+F;m<F;){var G=d[m++];N[j++]=255&G,N[j++]=G>>8&255,N[j++]=G>>16&255}}function De(d,m,F,N,j,G){if(G==0)for(F=m+F;m<F;)we(N,((G=d[m++])[0]>>24|G[1]>>8&65280|G[2]<<8&16711680|G[3]<<24)>>>0),j+=32;else A(N,j,d,m,F)}function it(d,m){_[m][0]=_[d+"0"],_[m][1]=_[d+"1"],_[m][2]=_[d+"2"],_[m][3]=_[d+"3"],_[m][4]=_[d+"4"],_[m][5]=_[d+"5"],_[m][6]=_[d+"6"],_[m][7]=_[d+"7"],_[m][8]=_[d+"8"],_[m][9]=_[d+"9"],_[m][10]=_[d+"10"],_[m][11]=_[d+"11"],_[m][12]=_[d+"12"],_[m][13]=_[d+"13"],_[m][14]=_[d+"0"],_[m][15]=_[d+"0"]}function et(d){return d==bv||d==xv||d==kf||d==Cv}function Ge(){this.eb=[],this.size=this.A=this.fb=0}function At(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function nt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Ge,this.f.kb=new At,this.sd=null}function tt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function lt(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function ur(d){return alert("todo:WebPSamplerProcessPlane"),d.T}function _t(d,m){var F=d.T,N=m.ba.f.RGBA,j=N.eb,G=N.fb+d.ka*N.A,X=yn[m.ba.S],$=d.y,ee=d.O,ie=d.f,pe=d.N,_e=d.ea,ae=d.W,me=m.cc,Ce=m.dc,ke=m.Mc,Se=m.Nc,He=d.ka,qe=d.ka+d.T,Ze=d.U,Xe=Ze+1>>1;for(He==0?X($,ee,null,null,ie,pe,_e,ae,ie,pe,_e,ae,j,G,null,null,Ze):(X(m.ec,m.fc,$,ee,me,Ce,ke,Se,ie,pe,_e,ae,j,G-N.A,j,G,Ze),++F);He+2<qe;He+=2)me=ie,Ce=pe,ke=_e,Se=ae,pe+=d.Rc,ae+=d.Rc,G+=2*N.A,X($,(ee+=2*d.fa)-d.fa,$,ee,me,Ce,ke,Se,ie,pe,_e,ae,j,G-N.A,j,G,Ze);return ee+=d.fa,d.j+qe<d.o?(A(m.ec,m.fc,$,ee,Ze),A(m.cc,m.dc,ie,pe,Xe),A(m.Mc,m.Nc,_e,ae,Xe),F--):1&qe||X($,ee,null,null,ie,pe,_e,ae,ie,pe,_e,ae,j,G+N.A,null,null,Ze),F}function AA(d,m,F){var N=d.F,j=[d.J];if(N!=null){var G=d.U,X=m.ba.S,$=X==Df||X==kf;m=m.ba.f.RGBA;var ee=[0],ie=d.ka;ee[0]=d.T,d.Kb&&(ie==0?--ee[0]:(--ie,j[0]-=d.width),d.j+d.ka+d.T==d.o&&(ee[0]=d.o-d.j-ie));var pe=m.eb;ie=m.fb+ie*m.A,d=fS(N,j[0],d.width,G,ee,pe,ie+($?0:3),m.A),e(F==ee),d&&et(X)&&Ul(pe,ie,$,G,ee,m.A)}return 0}function Vr(d){var m=d.ma,F=m.ba.S,N=11>F,j=F==Rf||F==Mf||F==Df||F==Bv||F==12||et(F);if(m.memory=null,m.Ib=null,m.Jb=null,m.Nd=null,!yl(m.Oa,d,j?11:12))return 0;if(j&&et(F)&&vl(),d.da)alert("todo:use_scaling");else{if(N){if(m.Ib=ur,d.Kb){if(F=d.U+1>>1,m.memory=i(d.U+2*F),m.memory==null)return 0;m.ec=m.memory,m.fc=0,m.cc=m.ec,m.dc=m.fc+d.U,m.Mc=m.cc,m.Nc=m.dc+F,m.Ib=_t,vl()}}else alert("todo:EmitYUV");j&&(m.Jb=AA,N&&Ln())}if(N&&!US){for(d=0;256>d;++d)lM[d]=89858*(d-128)+jf>>Hf,fM[d]=-22014*(d-128)+jf,cM[d]=-45773*(d-128),uM[d]=113618*(d-128)+jf>>Hf;for(d=Il;d<Sv;++d)m=76283*(d-16)+jf>>Hf,hM[d-Il]=Zn(m,255),dM[d-Il]=Zn(m+8>>4,15);US=1}return 1}function Bt(d){var m=d.ma,F=d.U,N=d.T;return e(!(1&d.ka)),0>=F||0>=N?0:(F=m.Ib(d,m),m.Jb!=null&&m.Jb(d,m,F),m.Dc+=F,1)}function Mr(d){d.ma.memory=null}function nA(d,m,F,N){return k(d,8)!=47?0:(m[0]=k(d,14)+1,F[0]=k(d,14)+1,N[0]=k(d,1),k(d,3)!=0?0:!d.h)}function zr(d,m){if(4>d)return d+1;var F=d-2>>1;return(2+(1&d)<<F)+k(m,F)+1}function bA(d,m){return 120<m?m-120:1<=(F=((F=X8[m-1])>>4)*d+(8-(15&F)))?F:1;var F}function Tt(d,m,F){var N=K(F),j=d[m+=255&N].g-8;return 0<j&&(J(F,F.u+8),N=K(F),m+=d[m].value,m+=N&(1<<j)-1),J(F,F.u+d[m].g),d[m].value}function kt(d,m,F){return F.g+=d.g,F.value+=d.value<<m>>>0,e(8>=F.g),d.g}function mr(d,m,F){var N=d.xc;return e((m=N==0?0:d.vc[d.md*(F>>N)+(m>>N)])<d.Wb),d.Ya[m]}function lA(d,m,F,N){var j=d.ab,G=d.c*m,X=d.C;m=X+m;var $=F,ee=N;for(N=d.Ta,F=d.Ua;0<j--;){var ie=d.gc[j],pe=X,_e=m,ae=$,me=ee,Ce=(ee=N,$=F,ie.Ea);switch(e(pe<_e),e(_e<=ie.nc),ie.hc){case 2:Ir(ae,me,(_e-pe)*Ce,ee,$);break;case 0:var ke=pe,Se=_e,He=ee,qe=$,Ze=(dt=ie).Ea;ke==0&&(bl(ae,me,null,null,1,He,qe),ge(ae,me+1,0,0,Ze-1,He,qe+1),me+=Ze,qe+=Ze,++ke);for(var Xe=1<<dt.b,mt=Xe-1,ut=Ee(Ze,dt.b),It=dt.K,dt=dt.w+(ke>>dt.b)*ut;ke<Se;){var Lt=It,$r=dt,Qt=1;for(Gs(ae,me,He,qe-Ze,1,He,qe);Qt<Ze;){var gt=(Qt&~mt)+Xe;gt>Ze&&(gt=Ze),(0,Cl[Lt[$r++]>>8&15])(ae,me+ +Qt,He,qe+Qt-Ze,gt-Qt,He,qe+Qt),Qt=gt}me+=Ze,qe+=Ze,++ke&mt||(dt+=ut)}_e!=ie.nc&&A(ee,$-Ce,ee,$+(_e-pe-1)*Ce,Ce);break;case 1:for(Ce=ae,Se=me,Ze=(ae=ie.Ea)-(qe=ae&~(He=(me=1<<ie.b)-1)),ke=Ee(ae,ie.b),Xe=ie.K,ie=ie.w+(pe>>ie.b)*ke;pe<_e;){for(mt=Xe,ut=ie,It=new ze,dt=Se+qe,Lt=Se+ae;Se<dt;)Te(mt[ut++],It),El(It,Ce,Se,me,ee,$),Se+=me,$+=me;Se<Lt&&(Te(mt[ut++],It),El(It,Ce,Se,Ze,ee,$),Se+=Ze,$+=Ze),++pe&He||(ie+=ke)}break;case 3:if(ae==ee&&me==$&&0<ie.b){for(Se=ee,ae=Ce=$+(_e-pe)*Ce-(qe=(_e-pe)*Ee(ie.Ea,ie.b)),me=ee,He=$,ke=[],qe=(Ze=qe)-1;0<=qe;--qe)ke[qe]=me[He+qe];for(qe=Ze-1;0<=qe;--qe)Se[ae+qe]=ke[qe];Of(ie,pe,_e,ee,Ce,ee,$)}else Of(ie,pe,_e,ae,me,ee,$)}$=N,ee=F}ee!=F&&A(N,F,$,ee,G)}function QA(d,m){var F=d.V,N=d.Ba+d.c*d.C,j=m-d.C;if(e(m<=d.l.o),e(16>=j),0<j){var G=d.l,X=d.Ta,$=d.Ua,ee=G.width;if(lA(d,j,F,N),j=$=[$],e((F=d.C)<(N=m)),e(G.v<G.va),N>G.o&&(N=G.o),F<G.j){var ie=G.j-F;F=G.j,j[0]+=ie*ee}if(F>=N?F=0:(j[0]+=4*G.v,G.ka=F-G.j,G.U=G.va-G.v,G.T=N-F,F=1),F){if($=$[0],11>(F=d.ca).S){var pe=F.f.RGBA,_e=(N=F.S,j=G.U,G=G.T,ie=pe.eb,pe.A),ae=G;for(pe=pe.fb+d.Ma*pe.A;0<ae--;){var me=X,Ce=$,ke=j,Se=ie,He=pe;switch(N){case Pf:Fl(me,Ce,ke,Se,He);break;case Rf:ua(me,Ce,ke,Se,He);break;case bv:ua(me,Ce,ke,Se,He),Ul(Se,He,0,ke,1,0);break;case wS:ns(me,Ce,ke,Se,He);break;case Mf:De(me,Ce,ke,Se,He,1);break;case xv:De(me,Ce,ke,Se,He,1),Ul(Se,He,0,ke,1,0);break;case Df:De(me,Ce,ke,Se,He,0);break;case kf:De(me,Ce,ke,Se,He,0),Ul(Se,He,1,ke,1,0);break;case Bv:ca(me,Ce,ke,Se,He);break;case Cv:ca(me,Ce,ke,Se,He),cS(Se,He,ke,1,0);break;case yS:fa(me,Ce,ke,Se,He);break;default:e(0)}$+=ee,pe+=_e}d.Ma+=G}else alert("todo:EmitRescaledRowsYUVA");e(d.Ma<=F.height)}}d.C=m,e(d.C<=d.i)}function HA(d){var m;if(0<d.ua)return 0;for(m=0;m<d.Wb;++m){var F=d.Ya[m].G,N=d.Ya[m].H;if(0<F[1][N[1]+0].g||0<F[2][N[2]+0].g||0<F[3][N[3]+0].g)return 0}return 1}function Dr(d,m,F,N,j,G){if(d.Z!=0){var X=d.qd,$=d.rd;for(e(ga[d.Z]!=null);m<F;++m)ga[d.Z](X,$,N,j,N,j,G),X=N,$=j,j+=G;d.qd=X,d.rd=$}}function jA(d,m){var F=d.l.ma,N=F.Z==0||F.Z==1?d.l.j:d.C;if(N=d.C<N?N:d.C,e(m<=d.l.o),m>N){var j=d.l.width,G=F.ca,X=F.tb+j*N,$=d.V,ee=d.Ba+d.c*N,ie=d.gc;e(d.ab==1),e(ie[0].hc==3),Ai(ie[0],N,m,$,ee,G,X),Dr(F,N,m,G,X,j)}d.C=d.Ma=m}function KA(d,m,F,N,j,G,X){var $=d.$/N,ee=d.$%N,ie=d.m,pe=d.s,_e=F+d.$,ae=_e;j=F+N*j;var me=F+N*G,Ce=280+pe.ua,ke=d.Pb?$:16777216,Se=0<pe.ua?pe.Wa:null,He=pe.wc,qe=_e<me?mr(pe,ee,$):null;e(d.C<G),e(me<=j);var Ze=!1;e:for(;;){for(;Ze||_e<me;){var Xe=0;if($>=ke){var mt=_e-F;e((ke=d).Pb),ke.wd=ke.m,ke.xd=mt,0<ke.s.ua&&Ie(ke.s.Wa,ke.s.vb),ke=$+$8}if(ee&He||(qe=mr(pe,ee,$)),e(qe!=null),qe.Qb&&(m[_e]=qe.qb,Ze=!0),!Ze)if(q(ie),qe.jc){Xe=ie,mt=m;var ut=_e,It=qe.pd[K(Xe)&As-1];e(qe.jc),256>It.g?(J(Xe,Xe.u+It.g),mt[ut]=It.value,Xe=0):(J(Xe,Xe.u+It.g-256),e(256<=It.value),Xe=It.value),Xe==0&&(Ze=!0)}else Xe=Tt(qe.G[0],qe.H[0],ie);if(ie.h)break;if(Ze||256>Xe){if(!Ze)if(qe.nd)m[_e]=(qe.qb|Xe<<8)>>>0;else{if(q(ie),Ze=Tt(qe.G[1],qe.H[1],ie),q(ie),mt=Tt(qe.G[2],qe.H[2],ie),ut=Tt(qe.G[3],qe.H[3],ie),ie.h)break;m[_e]=(ut<<24|Ze<<16|Xe<<8|mt)>>>0}if(Ze=!1,++_e,++ee>=N&&(ee=0,++$,X!=null&&$<=G&&!($%16)&&X(d,$),Se!=null))for(;ae<_e;)Xe=m[ae++],Se.X[(506832829*Xe&4294967295)>>>Se.Mb]=Xe}else if(280>Xe){if(Xe=zr(Xe-256,ie),mt=Tt(qe.G[4],qe.H[4],ie),q(ie),mt=bA(N,mt=zr(mt,ie)),ie.h)break;if(_e-F<mt||j-_e<Xe)break e;for(ut=0;ut<Xe;++ut)m[_e+ut]=m[_e+ut-mt];for(_e+=Xe,ee+=Xe;ee>=N;)ee-=N,++$,X!=null&&$<=G&&!($%16)&&X(d,$);if(e(_e<=j),ee&He&&(qe=mr(pe,ee,$)),Se!=null)for(;ae<_e;)Xe=m[ae++],Se.X[(506832829*Xe&4294967295)>>>Se.Mb]=Xe}else{if(!(Xe<Ce))break e;for(Ze=Xe-280,e(Se!=null);ae<_e;)Xe=m[ae++],Se.X[(506832829*Xe&4294967295)>>>Se.Mb]=Xe;Xe=_e,e(!(Ze>>>(mt=Se).Xa)),m[Xe]=mt.X[Ze],Ze=!0}Ze||e(ie.h==Y(ie))}if(d.Pb&&ie.h&&_e<j)e(d.m.h),d.a=5,d.m=d.wd,d.$=d.xd,0<d.s.ua&&Ie(d.s.vb,d.s.Wa);else{if(ie.h)break e;X!=null&&X(d,$>G?G:$),d.a=0,d.$=_e-F}return 1}return d.a=3,0}function NA(d){e(d!=null),d.vc=null,d.yc=null,d.Ya=null;var m=d.Wa;m!=null&&(m.X=null),d.vb=null,e(d!=null)}function Jn(){var d=new xt;return d==null?null:(d.a=0,d.xb=xS,it("Predictor","VP8LPredictors"),it("Predictor","VP8LPredictors_C"),it("PredictorAdd","VP8LPredictorsAdd"),it("PredictorAdd","VP8LPredictorsAdd_C"),Ir=Pe,El=ue,Fl=Le,ua=Fe,ca=Ne,fa=ve,ns=Qe,_.VP8LMapColor32b=ri,_.VP8LMapColor8b=xl,d)}function dn(d,m,F,N,j){var G=1,X=[d],$=[m],ee=N.m,ie=N.s,pe=null,_e=0;e:for(;;){if(F)for(;G&&k(ee,1);){var ae=X,me=$,Ce=N,ke=1,Se=Ce.m,He=Ce.gc[Ce.ab],qe=k(Se,2);if(Ce.Oc&1<<qe)G=0;else{switch(Ce.Oc|=1<<qe,He.hc=qe,He.Ea=ae[0],He.nc=me[0],He.K=[null],++Ce.ab,e(4>=Ce.ab),qe){case 0:case 1:He.b=k(Se,3)+2,ke=dn(Ee(He.Ea,He.b),Ee(He.nc,He.b),0,Ce,He.K),He.K=He.K[0];break;case 3:var Ze,Xe=k(Se,8)+1,mt=16<Xe?0:4<Xe?1:2<Xe?2:3;if(ae[0]=Ee(He.Ea,mt),He.b=mt,Ze=ke=dn(Xe,1,0,Ce,He.K)){var ut,It=Xe,dt=He,Lt=1<<(8>>dt.b),$r=i(Lt);if($r==null)Ze=0;else{var Qt=dt.K[0],gt=dt.w;for($r[0]=dt.K[0][0],ut=1;ut<1*It;++ut)$r[ut]=Ve(Qt[gt+ut],$r[ut-1]);for(;ut<4*Lt;++ut)$r[ut]=0;dt.K[0]=null,dt.K[0]=$r,Ze=1}}ke=Ze;break;case 2:break;default:e(0)}G=ke}}if(X=X[0],$=$[0],G&&k(ee,1)&&!(G=1<=(_e=k(ee,4))&&11>=_e)){N.a=3;break e}var rt;if(rt=G)t:{var Nr,St,Pt,ir=N,fA=X,TA=$,Br=_e,xA=F,LA=ir.m,Jr=ir.s,Mt=[null],Gt=1,br=0,Wt=Y8[Br];r:for(;;){if(xA&&k(LA,1)){var hA=k(LA,3)+2,Rn=Ee(fA,hA),Or=Ee(TA,hA),qA=Rn*Or;if(!dn(Rn,Or,0,ir,Mt))break r;for(Mt=Mt[0],Jr.xc=hA,Nr=0;Nr<qA;++Nr){var Zt=Mt[Nr]>>8&65535;Mt[Nr]=Zt,Zt>=Gt&&(Gt=Zt+1)}}if(LA.h)break r;for(St=0;5>St;++St){var Zr=BS[St];!St&&0<Br&&(Zr+=1<<Br),br<Zr&&(br=Zr)}var tn=s(Gt*Wt,M),PA=Gt,rn=s(PA,z);if(rn==null)var An=null;else e(65536>=PA),An=rn;var VA=i(br);if(An==null||VA==null||tn==null){ir.a=1;break r}var nn=tn;for(Nr=Pt=0;Nr<Gt;++Nr){var rr=An[Nr],an=rr.G,Mn=rr.H,as=0,Ti=1,dA=0;for(St=0;5>St;++St){Zr=BS[St],an[St]=nn,Mn[St]=Pt,!St&&0<Br&&(Zr+=1<<Br);n:{var qf,Uv=Zr,Vf=ir,Ql=VA,vM=nn,mM=Pt,_v=0,pa=Vf.m,wM=k(pa,1);if(n(Ql,0,0,Uv),wM){var yM=k(pa,1)+1,BM=k(pa,1),QS=k(pa,BM==0?1:8);Ql[QS]=1,yM==2&&(Ql[QS=k(pa,8)]=1);var zf=1}else{var NS=i(19),OS=k(pa,4)+4;if(19<OS){Vf.a=3;var Gf=0;break n}for(qf=0;qf<OS;++qf)NS[W8[qf]]=k(pa,3);var Iv=void 0,Nl=void 0,TS=Vf,bM=NS,Wf=Uv,LS=Ql,Qv=0,va=TS.m,PS=8,RS=s(128,M);A:for(;O(RS,0,7,bM,19);){if(k(va,1)){var xM=2+2*k(va,3);if((Iv=2+k(va,xM))>Wf)break A}else Iv=Wf;for(Nl=0;Nl<Wf&&Iv--;){q(va);var MS=RS[0+(127&K(va))];J(va,va.u+MS.g);var Xs=MS.value;if(16>Xs)LS[Nl++]=Xs,Xs!=0&&(PS=Xs);else{var CM=Xs==16,DS=Xs-16,EM=z8[DS],kS=k(va,V8[DS])+EM;if(Nl+kS>Wf)break A;for(var FM=CM?PS:0;0<kS--;)LS[Nl++]=FM}}Qv=1;break A}Qv||(TS.a=3),zf=Qv}(zf=zf&&!pa.h)&&(_v=O(vM,mM,8,Ql,Uv)),zf&&_v!=0?Gf=_v:(Vf.a=3,Gf=0)}if(Gf==0)break r;if(Ti&&G8[St]==1&&(Ti=nn[Pt].g==0),as+=nn[Pt].g,Pt+=Gf,3>=St){var Ol,Nv=VA[0];for(Ol=1;Ol<Zr;++Ol)VA[Ol]>Nv&&(Nv=VA[Ol]);dA+=Nv}}if(rr.nd=Ti,rr.Qb=0,Ti&&(rr.qb=(an[3][Mn[3]+0].value<<24|an[1][Mn[1]+0].value<<16|an[2][Mn[2]+0].value)>>>0,as==0&&256>an[0][Mn[0]+0].value&&(rr.Qb=1,rr.qb+=an[0][Mn[0]+0].value<<8)),rr.jc=!rr.Qb&&6>dA,rr.jc){var Xf,Li=rr;for(Xf=0;Xf<As;++Xf){var ma=Xf,wa=Li.pd[ma],Yf=Li.G[0][Li.H[0]+ma];256<=Yf.value?(wa.g=Yf.g+256,wa.value=Yf.value):(wa.g=0,wa.value=0,ma>>=kt(Yf,8,wa),ma>>=kt(Li.G[1][Li.H[1]+ma],16,wa),ma>>=kt(Li.G[2][Li.H[2]+ma],0,wa),kt(Li.G[3][Li.H[3]+ma],24,wa))}}}Jr.vc=Mt,Jr.Wb=Gt,Jr.Ya=An,Jr.yc=tn,rt=1;break t}rt=0}if(!(G=rt)){N.a=3;break e}if(0<_e){if(ie.ua=1<<_e,!R(ie.Wa,_e)){N.a=1,G=0;break e}}else ie.ua=0;var Ov=N,HS=X,SM=$,Tv=Ov.s,Lv=Tv.xc;if(Ov.c=HS,Ov.i=SM,Tv.md=Ee(HS,Lv),Tv.wc=Lv==0?-1:(1<<Lv)-1,F){N.xb=nM;break e}if((pe=i(X*$))==null){N.a=1,G=0;break e}G=(G=KA(N,pe,0,X,$,$,null))&&!ee.h;break e}return G?(j!=null?j[0]=pe:(e(pe==null),e(F)),N.$=0,F||NA(ie)):NA(ie),G}function ft(d,m){var F=d.c*d.i,N=F+m+16*m;return e(d.c<=m),d.V=i(N),d.V==null?(d.Ta=null,d.Ua=0,d.a=1,0):(d.Ta=d.V,d.Ua=d.Ba+F+m,1)}function de(d,m){var F=d.C,N=m-F,j=d.V,G=d.Ba+d.c*F;for(e(m<=d.l.o);0<N;){var X=16<N?16:N,$=d.l.ma,ee=d.l.width,ie=ee*X,pe=$.ca,_e=$.tb+ee*F,ae=d.Ta,me=d.Ua;lA(d,X,j,G),hS(ae,me,pe,_e,ie),Dr($,F,F+X,pe,_e,ee),N-=X,j+=X*d.c,F+=X}e(F==m),d.C=d.Ma=m}function Je(){this.ub=this.yd=this.td=this.Rb=0}function ot(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Yt(){this.Fb=this.Bb=this.Cb=0,this.Zb=i(4),this.Lb=i(4)}function wr(){this.Yb=(function(){var d=[];return(function m(F,N,j){for(var G=j[N],X=0;X<G&&(F.push(j.length>N+1?[]:0),!(j.length<N+1));X++)m(F[X],N+1,j)})(d,0,[3,11]),d})()}function nr(){this.jb=i(3),this.Wc=a([4,8],wr),this.Xc=a([4,17],wr)}function Gr(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new i(4),this.od=new i(4)}function yr(){this.ld=this.La=this.dd=this.tc=0}function gn(){this.Na=this.la=0}function na(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function cr(){this.ad=i(384),this.Za=0,this.Ob=i(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Va(){this.uc=this.M=this.Nb=0,this.wa=Array(new yr),this.Y=0,this.ya=Array(new cr),this.aa=0,this.l=new ks}function za(){this.y=i(16),this.f=i(8),this.ea=i(8)}function yf(){this.cb=this.a=0,this.sc="",this.m=new I,this.Od=new Je,this.Kc=new ot,this.ed=new Gr,this.Qa=new Yt,this.Ic=this.$c=this.Aa=0,this.D=new Va,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=s(8,I),this.ia=0,this.pb=s(4,na),this.Pa=new nr,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new za),this.Hd=0,this.rb=Array(new gn),this.sb=0,this.wa=Array(new yr),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new cr),this.L=this.aa=0,this.gd=a([4,2],yr),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Zn(d,m){return 0>d?0:d>m?m:d}function ks(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function iv(){var d=new yf;return d!=null&&(d.a=0,d.sc="OK",d.cb=0,d.Xb=0,_l||(_l=Hs)),d}function kr(d,m,F){return d.a==0&&(d.a=m,d.sc=F,d.cb=0),0}function Bf(d,m,F){return 3<=F&&d[m+0]==157&&d[m+1]==1&&d[m+2]==42}function ei(d,m){if(d==null)return 0;if(d.a=0,d.sc="OK",m==null)return kr(d,2,"null VP8Io passed to VP8GetHeaders()");var F=m.data,N=m.w,j=m.ha;if(4>j)return kr(d,7,"Truncated header.");var G=F[N+0]|F[N+1]<<8|F[N+2]<<16,X=d.Od;if(X.Rb=!(1&G),X.td=G>>1&7,X.yd=G>>4&1,X.ub=G>>5,3<X.td)return kr(d,3,"Incorrect keyframe parameters.");if(!X.yd)return kr(d,4,"Frame not displayable.");N+=3,j-=3;var $=d.Kc;if(X.Rb){if(7>j)return kr(d,7,"cannot parse picture header");if(!Bf(F,N,j))return kr(d,3,"Bad code word");$.c=16383&(F[N+4]<<8|F[N+3]),$.Td=F[N+4]>>6,$.i=16383&(F[N+6]<<8|F[N+5]),$.Ud=F[N+6]>>6,N+=7,j-=7,d.za=$.c+15>>4,d.Ub=$.i+15>>4,m.width=$.c,m.height=$.i,m.Da=0,m.j=0,m.v=0,m.va=m.width,m.o=m.height,m.da=0,m.ib=m.width,m.hb=m.height,m.U=m.width,m.T=m.height,n((G=d.Pa).jb,0,255,G.jb.length),e((G=d.Qa)!=null),G.Cb=0,G.Bb=0,G.Fb=1,n(G.Zb,0,0,G.Zb.length),n(G.Lb,0,0,G.Lb)}if(X.ub>j)return kr(d,7,"bad partition length");re(G=d.m,F,N,X.ub),N+=X.ub,j-=X.ub,X.Rb&&($.Ld=te(G),$.Kd=te(G)),$=d.Qa;var ee,ie=d.Pa;if(e(G!=null),e($!=null),$.Cb=te(G),$.Cb){if($.Bb=te(G),te(G)){for($.Fb=te(G),ee=0;4>ee;++ee)$.Zb[ee]=te(G)?Z(G,7):0;for(ee=0;4>ee;++ee)$.Lb[ee]=te(G)?Z(G,6):0}if($.Bb)for(ee=0;3>ee;++ee)ie.jb[ee]=te(G)?ne(G,8):255}else $.Bb=0;if(G.Ka)return kr(d,3,"cannot parse segment header");if(($=d.ed).zd=te(G),$.Tb=ne(G,6),$.wb=ne(G,3),$.Pc=te(G),$.Pc&&te(G)){for(ie=0;4>ie;++ie)te(G)&&($.vd[ie]=Z(G,6));for(ie=0;4>ie;++ie)te(G)&&($.od[ie]=Z(G,6))}if(d.L=$.Tb==0?0:$.zd?1:2,G.Ka)return kr(d,3,"cannot parse filter header");var pe=j;if(j=ee=N,N=ee+pe,$=pe,d.Xb=(1<<ne(d.m,2))-1,pe<3*(ie=d.Xb))F=7;else{for(ee+=3*ie,$-=3*ie,pe=0;pe<ie;++pe){var _e=F[j+0]|F[j+1]<<8|F[j+2]<<16;_e>$&&(_e=$),re(d.Jc[+pe],F,ee,_e),ee+=_e,$-=_e,j+=3}re(d.Jc[+ie],F,ee,$),F=ee<N?0:5}if(F!=0)return kr(d,F,"cannot parse partitions");for(F=ne(ee=d.m,7),j=te(ee)?Z(ee,4):0,N=te(ee)?Z(ee,4):0,$=te(ee)?Z(ee,4):0,ie=te(ee)?Z(ee,4):0,ee=te(ee)?Z(ee,4):0,pe=d.Qa,_e=0;4>_e;++_e){if(pe.Cb){var ae=pe.Zb[_e];pe.Fb||(ae+=F)}else{if(0<_e){d.pb[_e]=d.pb[0];continue}ae=F}var me=d.pb[_e];me.Sc[0]=Ev[Zn(ae+j,127)],me.Sc[1]=Fv[Zn(ae+0,127)],me.Eb[0]=2*Ev[Zn(ae+N,127)],me.Eb[1]=101581*Fv[Zn(ae+$,127)]>>16,8>me.Eb[1]&&(me.Eb[1]=8),me.Qc[0]=Ev[Zn(ae+ie,117)],me.Qc[1]=Fv[Zn(ae+ee,127)],me.lc=ae+ee}if(!X.Rb)return kr(d,4,"Not a key frame.");for(te(G),X=d.Pa,F=0;4>F;++F){for(j=0;8>j;++j)for(N=0;3>N;++N)for($=0;11>$;++$)ie=oe(G,rM[F][j][N][$])?ne(G,8):eM[F][j][N][$],X.Wc[F][j].Yb[N][$]=ie;for(j=0;17>j;++j)X.Xc[F][j]=X.Wc[F][AM[j]]}return d.kc=te(G),d.kc&&(d.Bd=ne(G,8)),d.cb=1}function Hs(d,m,F,N,j,G,X){var $=m[j].Yb[F];for(F=0;16>j;++j){if(!oe(d,$[F+0]))return j;for(;!oe(d,$[F+1]);)if($=m[++j].Yb[0],F=0,j==16)return 16;var ee=m[j+1].Yb;if(oe(d,$[F+2])){var ie=d,pe=0;if(oe(ie,(ae=$)[(_e=F)+3]))if(oe(ie,ae[_e+6])){for($=0,_e=2*(pe=oe(ie,ae[_e+8]))+(ae=oe(ie,ae[_e+9+pe])),pe=0,ae=J8[_e];ae[$];++$)pe+=pe+oe(ie,ae[$]);pe+=3+(8<<_e)}else oe(ie,ae[_e+7])?(pe=7+2*oe(ie,165),pe+=oe(ie,145)):pe=5+oe(ie,159);else pe=oe(ie,ae[_e+4])?3+oe(ie,ae[_e+5]):2;$=ee[2]}else pe=1,$=ee[1];ee=X+Z8[j],0>(ie=d).b&&W(ie);var _e,ae=ie.b,me=(_e=ie.Ca>>1)-(ie.I>>ae)>>31;--ie.b,ie.Ca+=me,ie.Ca|=1,ie.I-=(_e+1&me)<<ae,G[ee]=((pe^me)-me)*N[(0<j)+0]}return 16}function bf(d){var m=d.rb[d.sb-1];m.la=0,m.Na=0,n(d.zc,0,0,d.zc.length),d.ja=0}function pn(d,m,F,N,j){j=d[m+F+32*N]+(j>>3),d[m+F+32*N]=-256&j?0>j?0:255:j}function Wr(d,m,F,N,j,G){pn(d,m,0,F,N+j),pn(d,m,1,F,N+G),pn(d,m,2,F,N-G),pn(d,m,3,F,N-j)}function Bi(d){return(20091*d>>16)+d}function xf(d,m,F,N){var j,G=0,X=i(16);for(j=0;4>j;++j){var $=d[m+0]+d[m+8],ee=d[m+0]-d[m+8],ie=(35468*d[m+4]>>16)-Bi(d[m+12]),pe=Bi(d[m+4])+(35468*d[m+12]>>16);X[G+0]=$+pe,X[G+1]=ee+ie,X[G+2]=ee-ie,X[G+3]=$-pe,G+=4,m++}for(j=G=0;4>j;++j)$=(d=X[G+0]+4)+X[G+8],ee=d-X[G+8],ie=(35468*X[G+4]>>16)-Bi(X[G+12]),pn(F,N,0,0,$+(pe=Bi(X[G+4])+(35468*X[G+12]>>16))),pn(F,N,1,0,ee+ie),pn(F,N,2,0,ee-ie),pn(F,N,3,0,$-pe),G++,N+=32}function av(d,m,F,N){var j=d[m+0]+4,G=35468*d[m+4]>>16,X=Bi(d[m+4]),$=35468*d[m+1]>>16;Wr(F,N,0,j+X,d=Bi(d[m+1]),$),Wr(F,N,1,j+G,d,$),Wr(F,N,2,j-G,d,$),Wr(F,N,3,j-X,d,$)}function sv(d,m,F,N,j){xf(d,m,F,N),j&&xf(d,m+16,F,N+4)}function ti(d,m,F,N){is(d,m+0,F,N,1),is(d,m+32,F,N+128,1)}function Cf(d,m,F,N){var j;for(d=d[m+0]+4,j=0;4>j;++j)for(m=0;4>m;++m)pn(F,N,m,j,d)}function Ef(d,m,F,N){d[m+0]&&zt(d,m+0,F,N),d[m+16]&&zt(d,m+16,F,N+4),d[m+32]&&zt(d,m+32,F,N+128),d[m+48]&&zt(d,m+48,F,N+128+4)}function js(d,m,F,N){var j,G=i(16);for(j=0;4>j;++j){var X=d[m+0+j]+d[m+12+j],$=d[m+4+j]+d[m+8+j],ee=d[m+4+j]-d[m+8+j],ie=d[m+0+j]-d[m+12+j];G[0+j]=X+$,G[8+j]=X-$,G[4+j]=ie+ee,G[12+j]=ie-ee}for(j=0;4>j;++j)X=(d=G[0+4*j]+3)+G[3+4*j],$=G[1+4*j]+G[2+4*j],ee=G[1+4*j]-G[2+4*j],ie=d-G[3+4*j],F[N+0]=X+$>>3,F[N+16]=ie+ee>>3,F[N+32]=X-$>>3,F[N+48]=ie-ee>>3,N+=64}function Ga(d,m,F){var N,j=m-32,G=en,X=255-d[j-1];for(N=0;N<F;++N){var $,ee=G,ie=X+d[m-1];for($=0;$<F;++$)d[m+$]=ee[ie+d[j+$]];m+=32}}function ov(d,m){Ga(d,m,4)}function lv(d,m){Ga(d,m,8)}function uv(d,m){Ga(d,m,16)}function ll(d,m){var F;for(F=0;16>F;++F)A(d,m+32*F,d,m-32,16)}function Ff(d,m){var F;for(F=16;0<F;--F)n(d,m,d[m-1],16),m+=32}function Tn(d,m,F){var N;for(N=0;16>N;++N)n(m,F+32*N,d,16)}function cv(d,m){var F,N=16;for(F=0;16>F;++F)N+=d[m-1+32*F]+d[m+F-32];Tn(N>>5,d,m)}function Wa(d,m){var F,N=8;for(F=0;16>F;++F)N+=d[m-1+32*F];Tn(N>>4,d,m)}function ul(d,m){var F,N=8;for(F=0;16>F;++F)N+=d[m+F-32];Tn(N>>4,d,m)}function fv(d,m){Tn(128,d,m)}function Ct(d,m,F){return d+2*m+F+2>>2}function hv(d,m){var F,N=m-32;for(N=new Uint8Array([Ct(d[N-1],d[N+0],d[N+1]),Ct(d[N+0],d[N+1],d[N+2]),Ct(d[N+1],d[N+2],d[N+3]),Ct(d[N+2],d[N+3],d[N+4])]),F=0;4>F;++F)A(d,m+32*F,N,0,N.length)}function dv(d,m){var F=d[m-1],N=d[m-1+32],j=d[m-1+64],G=d[m-1+96];we(d,m+0,16843009*Ct(d[m-1-32],F,N)),we(d,m+32,16843009*Ct(F,N,j)),we(d,m+64,16843009*Ct(N,j,G)),we(d,m+96,16843009*Ct(j,G,G))}function gv(d,m){var F,N=4;for(F=0;4>F;++F)N+=d[m+F-32]+d[m-1+32*F];for(N>>=3,F=0;4>F;++F)n(d,m+32*F,N,4)}function bi(d,m){var F=d[m-1+0],N=d[m-1+32],j=d[m-1+64],G=d[m-1-32],X=d[m+0-32],$=d[m+1-32],ee=d[m+2-32],ie=d[m+3-32];d[m+0+96]=Ct(N,j,d[m-1+96]),d[m+1+96]=d[m+0+64]=Ct(F,N,j),d[m+2+96]=d[m+1+64]=d[m+0+32]=Ct(G,F,N),d[m+3+96]=d[m+2+64]=d[m+1+32]=d[m+0+0]=Ct(X,G,F),d[m+3+64]=d[m+2+32]=d[m+1+0]=Ct($,X,G),d[m+3+32]=d[m+2+0]=Ct(ee,$,X),d[m+3+0]=Ct(ie,ee,$)}function xi(d,m){var F=d[m+1-32],N=d[m+2-32],j=d[m+3-32],G=d[m+4-32],X=d[m+5-32],$=d[m+6-32],ee=d[m+7-32];d[m+0+0]=Ct(d[m+0-32],F,N),d[m+1+0]=d[m+0+32]=Ct(F,N,j),d[m+2+0]=d[m+1+32]=d[m+0+64]=Ct(N,j,G),d[m+3+0]=d[m+2+32]=d[m+1+64]=d[m+0+96]=Ct(j,G,X),d[m+3+32]=d[m+2+64]=d[m+1+96]=Ct(G,X,$),d[m+3+64]=d[m+2+96]=Ct(X,$,ee),d[m+3+96]=Ct($,ee,ee)}function pv(d,m){var F=d[m-1+0],N=d[m-1+32],j=d[m-1+64],G=d[m-1-32],X=d[m+0-32],$=d[m+1-32],ee=d[m+2-32],ie=d[m+3-32];d[m+0+0]=d[m+1+64]=G+X+1>>1,d[m+1+0]=d[m+2+64]=X+$+1>>1,d[m+2+0]=d[m+3+64]=$+ee+1>>1,d[m+3+0]=ee+ie+1>>1,d[m+0+96]=Ct(j,N,F),d[m+0+64]=Ct(N,F,G),d[m+0+32]=d[m+1+96]=Ct(F,G,X),d[m+1+32]=d[m+2+96]=Ct(G,X,$),d[m+2+32]=d[m+3+96]=Ct(X,$,ee),d[m+3+32]=Ct($,ee,ie)}function vv(d,m){var F=d[m+0-32],N=d[m+1-32],j=d[m+2-32],G=d[m+3-32],X=d[m+4-32],$=d[m+5-32],ee=d[m+6-32],ie=d[m+7-32];d[m+0+0]=F+N+1>>1,d[m+1+0]=d[m+0+64]=N+j+1>>1,d[m+2+0]=d[m+1+64]=j+G+1>>1,d[m+3+0]=d[m+2+64]=G+X+1>>1,d[m+0+32]=Ct(F,N,j),d[m+1+32]=d[m+0+96]=Ct(N,j,G),d[m+2+32]=d[m+1+96]=Ct(j,G,X),d[m+3+32]=d[m+2+96]=Ct(G,X,$),d[m+3+64]=Ct(X,$,ee),d[m+3+96]=Ct($,ee,ie)}function Ks(d,m){var F=d[m-1+0],N=d[m-1+32],j=d[m-1+64],G=d[m-1+96];d[m+0+0]=F+N+1>>1,d[m+2+0]=d[m+0+32]=N+j+1>>1,d[m+2+32]=d[m+0+64]=j+G+1>>1,d[m+1+0]=Ct(F,N,j),d[m+3+0]=d[m+1+32]=Ct(N,j,G),d[m+3+32]=d[m+1+64]=Ct(j,G,G),d[m+3+64]=d[m+2+64]=d[m+0+96]=d[m+1+96]=d[m+2+96]=d[m+3+96]=G}function cl(d,m){var F=d[m-1+0],N=d[m-1+32],j=d[m-1+64],G=d[m-1+96],X=d[m-1-32],$=d[m+0-32],ee=d[m+1-32],ie=d[m+2-32];d[m+0+0]=d[m+2+32]=F+X+1>>1,d[m+0+32]=d[m+2+64]=N+F+1>>1,d[m+0+64]=d[m+2+96]=j+N+1>>1,d[m+0+96]=G+j+1>>1,d[m+3+0]=Ct($,ee,ie),d[m+2+0]=Ct(X,$,ee),d[m+1+0]=d[m+3+32]=Ct(F,X,$),d[m+1+32]=d[m+3+64]=Ct(N,F,X),d[m+1+64]=d[m+3+96]=Ct(j,N,F),d[m+1+96]=Ct(G,j,N)}function Xa(d,m){var F;for(F=0;8>F;++F)A(d,m+32*F,d,m-32,8)}function mv(d,m){var F;for(F=0;8>F;++F)n(d,m,d[m-1],8),m+=32}function Ci(d,m,F){var N;for(N=0;8>N;++N)n(m,F+32*N,d,8)}function wv(d,m){var F,N=8;for(F=0;8>F;++F)N+=d[m+F-32]+d[m-1+32*F];Ci(N>>4,d,m)}function fl(d,m){var F,N=4;for(F=0;8>F;++F)N+=d[m+F-32];Ci(N>>3,d,m)}function hl(d,m){var F,N=4;for(F=0;8>F;++F)N+=d[m-1+32*F];Ci(N>>3,d,m)}function Sf(d,m){Ci(128,d,m)}function Ei(d,m,F){var N=d[m-F],j=d[m+0],G=3*(j-N)+yv[1020+d[m-2*F]-d[m+F]],X=Lf[112+(G+4>>3)];d[m-F]=en[255+N+Lf[112+(G+3>>3)]],d[m+0]=en[255+j-X]}function dl(d,m,F,N){var j=d[m+0],G=d[m+F];return wn[255+d[m-2*F]-d[m-F]]>N||wn[255+G-j]>N}function qs(d,m,F,N){return 4*wn[255+d[m-F]-d[m+0]]+wn[255+d[m-2*F]-d[m+F]]<=N}function gl(d,m,F,N,j){var G=d[m-3*F],X=d[m-2*F],$=d[m-F],ee=d[m+0],ie=d[m+F],pe=d[m+2*F],_e=d[m+3*F];return 4*wn[255+$-ee]+wn[255+X-ie]>N?0:wn[255+d[m-4*F]-G]<=j&&wn[255+G-X]<=j&&wn[255+X-$]<=j&&wn[255+_e-pe]<=j&&wn[255+pe-ie]<=j&&wn[255+ie-ee]<=j}function Ya(d,m,F,N){var j=2*N+1;for(N=0;16>N;++N)qs(d,m+N,F,j)&&Ei(d,m+N,F)}function pl(d,m,F,N){var j=2*N+1;for(N=0;16>N;++N)qs(d,m+N*F,1,j)&&Ei(d,m+N*F,1)}function Uf(d,m,F,N){var j;for(j=3;0<j;--j)Ya(d,m+=4*F,F,N)}function _f(d,m,F,N){var j;for(j=3;0<j;--j)pl(d,m+=4,F,N)}function Fi(d,m,F,N,j,G,X,$){for(G=2*G+1;0<j--;){if(gl(d,m,F,G,X))if(dl(d,m,F,$))Ei(d,m,F);else{var ee=d,ie=m,pe=F,_e=ee[ie-2*pe],ae=ee[ie-pe],me=ee[ie+0],Ce=ee[ie+pe],ke=ee[ie+2*pe],Se=27*(qe=yv[1020+3*(me-ae)+yv[1020+_e-Ce]])+63>>7,He=18*qe+63>>7,qe=9*qe+63>>7;ee[ie-3*pe]=en[255+ee[ie-3*pe]+qe],ee[ie-2*pe]=en[255+_e+He],ee[ie-pe]=en[255+ae+Se],ee[ie+0]=en[255+me-Se],ee[ie+pe]=en[255+Ce-He],ee[ie+2*pe]=en[255+ke-qe]}m+=N}}function Si(d,m,F,N,j,G,X,$){for(G=2*G+1;0<j--;){if(gl(d,m,F,G,X))if(dl(d,m,F,$))Ei(d,m,F);else{var ee=d,ie=m,pe=F,_e=ee[ie-pe],ae=ee[ie+0],me=ee[ie+pe],Ce=Lf[112+(4+(ke=3*(ae-_e))>>3)],ke=Lf[112+(ke+3>>3)],Se=Ce+1>>1;ee[ie-2*pe]=en[255+ee[ie-2*pe]+Se],ee[ie-pe]=en[255+_e+ke],ee[ie+0]=en[255+ae-Ce],ee[ie+pe]=en[255+me-Se]}m+=N}}function If(d,m,F,N,j,G){Fi(d,m,F,1,16,N,j,G)}function $a(d,m,F,N,j,G){Fi(d,m,1,F,16,N,j,G)}function Qf(d,m,F,N,j,G){var X;for(X=3;0<X;--X)Si(d,m+=4*F,F,1,16,N,j,G)}function b(d,m,F,N,j,G){var X;for(X=3;0<X;--X)Si(d,m+=4,1,F,16,N,j,G)}function H(d,m,F,N,j,G,X,$){Fi(d,m,j,1,8,G,X,$),Fi(F,N,j,1,8,G,X,$)}function se(d,m,F,N,j,G,X,$){Fi(d,m,1,j,8,G,X,$),Fi(F,N,1,j,8,G,X,$)}function he(d,m,F,N,j,G,X,$){Si(d,m+4*j,j,1,8,G,X,$),Si(F,N+4*j,j,1,8,G,X,$)}function be(d,m,F,N,j,G,X,$){Si(d,m+4,1,j,8,G,X,$),Si(F,N+4,1,j,8,G,X,$)}function Ke(){this.ba=new nt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new lt,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function We(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function ht(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function vt(){this.ua=0,this.Wa=new Ue,this.vb=new Ue,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new z,this.yc=new M}function xt(){this.xb=this.a=0,this.l=new ks,this.ca=new nt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new P,this.Pb=0,this.wd=new P,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new vt,this.ab=0,this.gc=s(4,ht),this.Oc=0}function Ut(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new ks,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Rt(d,m,F,N,j,G,X){for(d=d==null?0:d[m+0],m=0;m<X;++m)j[G+m]=d+F[N+m]&255,d=j[G+m]}function fr(d,m,F,N,j,G,X){var $;if(d==null)Rt(null,null,F,N,j,G,X);else for($=0;$<X;++$)j[G+$]=d[m+$]+F[N+$]&255}function Hr(d,m,F,N,j,G,X){if(d==null)Rt(null,null,F,N,j,G,X);else{var $,ee=d[m+0],ie=ee,pe=ee;for($=0;$<X;++$)ie=pe+(ee=d[m+$])-ie,pe=F[N+$]+(-256&ie?0>ie?0:255:ie)&255,ie=ee,j[G+$]=pe}}function tr(d,m,F,N){var j=m.width,G=m.o;if(e(d!=null&&m!=null),0>F||0>=N||F+N>G)return null;if(!d.Cc){if(d.ga==null){var X;if(d.ga=new Ut,(X=d.ga==null)||(X=m.width*m.o,e(d.Gb.length==0),d.Gb=i(X),d.Uc=0,d.Gb==null?X=0:(d.mb=d.Gb,d.nb=d.Uc,d.rc=null,X=1),X=!X),!X){X=d.ga;var $=d.Fa,ee=d.P,ie=d.qc,pe=d.mb,_e=d.nb,ae=ee+1,me=ie-1,Ce=X.l;if(e($!=null&&pe!=null&&m!=null),ga[0]=null,ga[1]=Rt,ga[2]=fr,ga[3]=Hr,X.ca=pe,X.tb=_e,X.c=m.width,X.i=m.height,e(0<X.c&&0<X.i),1>=ie)m=0;else if(X.$a=3&$[ee+0],X.Z=$[ee+0]>>2&3,X.Lc=$[ee+0]>>4&3,ee=$[ee+0]>>6&3,0>X.$a||1<X.$a||4<=X.Z||1<X.Lc||ee)m=0;else if(Ce.put=Bt,Ce.ac=Vr,Ce.bc=Mr,Ce.ma=X,Ce.width=m.width,Ce.height=m.height,Ce.Da=m.Da,Ce.v=m.v,Ce.va=m.va,Ce.j=m.j,Ce.o=m.o,X.$a)e:{e(X.$a==1),m=Jn();t:for(;;){if(m==null){m=0;break e}if(e(X!=null),X.mc=m,m.c=X.c,m.i=X.i,m.l=X.l,m.l.ma=X,m.l.width=X.c,m.l.height=X.i,m.a=0,Ae(m.m,$,ae,me),!dn(X.c,X.i,1,m,null)||(m.ab==1&&m.gc[0].hc==3&&HA(m.s)?(X.ic=1,$=m.c*m.i,m.Ta=null,m.Ua=0,m.V=i($),m.Ba=0,m.V==null?(m.a=1,m=0):m=1):(X.ic=0,m=ft(m,X.c)),!m))break t;m=1;break e}X.mc=null,m=0}else m=me>=X.c*X.i;X=!m}if(X)return null;d.ga.Lc!=1?d.Ga=0:N=G-F}e(d.ga!=null),e(F+N<=G);e:{if(m=($=d.ga).c,G=$.l.o,$.$a==0){if(ae=d.rc,me=d.Vc,Ce=d.Fa,ee=d.P+1+F*m,ie=d.mb,pe=d.nb+F*m,e(ee<=d.P+d.qc),$.Z!=0)for(e(ga[$.Z]!=null),X=0;X<N;++X)ga[$.Z](ae,me,Ce,ee,ie,pe,m),ae=ie,me=pe,pe+=m,ee+=m;else for(X=0;X<N;++X)A(ie,pe,Ce,ee,m),ae=ie,me=pe,pe+=m,ee+=m;d.rc=ae,d.Vc=me}else{if(e($.mc!=null),m=F+N,e((X=$.mc)!=null),e(m<=X.i),X.C>=m)m=1;else if($.ic||Ln(),$.ic){$=X.V,ae=X.Ba,me=X.c;var ke=X.i,Se=(Ce=1,ee=X.$/me,ie=X.$%me,pe=X.m,_e=X.s,X.$),He=me*ke,qe=me*m,Ze=_e.wc,Xe=Se<qe?mr(_e,ie,ee):null;e(Se<=He),e(m<=ke),e(HA(_e));t:for(;;){for(;!pe.h&&Se<qe;){if(ie&Ze||(Xe=mr(_e,ie,ee)),e(Xe!=null),q(pe),256>(ke=Tt(Xe.G[0],Xe.H[0],pe)))$[ae+Se]=ke,++Se,++ie>=me&&(ie=0,++ee<=m&&!(ee%16)&&jA(X,ee));else{if(!(280>ke)){Ce=0;break t}ke=zr(ke-256,pe);var mt,ut=Tt(Xe.G[4],Xe.H[4],pe);if(q(pe),!(Se>=(ut=bA(me,ut=zr(ut,pe)))&&He-Se>=ke)){Ce=0;break t}for(mt=0;mt<ke;++mt)$[ae+Se+mt]=$[ae+Se+mt-ut];for(Se+=ke,ie+=ke;ie>=me;)ie-=me,++ee<=m&&!(ee%16)&&jA(X,ee);Se<qe&&ie&Ze&&(Xe=mr(_e,ie,ee))}e(pe.h==Y(pe))}jA(X,ee>m?m:ee);break t}!Ce||pe.h&&Se<He?(Ce=0,X.a=pe.h?5:3):X.$=Se,m=Ce}else m=KA(X,X.V,X.Ba,X.c,X.i,m,de);if(!m){N=0;break e}}F+N>=G&&(d.Cc=1),N=1}if(!N)return null;if(d.Cc&&((N=d.ga)!=null&&(N.mc=null),d.ga=null,0<d.Ga))return alert("todo:WebPDequantizeLevels"),null}return d.nb+F*j}function Xr(d,m,F,N,j,G){for(;0<j--;){var X,$=d,ee=m+(F?1:0),ie=d,pe=m+(F?0:3);for(X=0;X<N;++X){var _e=ie[pe+4*X];_e!=255&&(_e*=32897,$[ee+4*X+0]=$[ee+4*X+0]*_e>>23,$[ee+4*X+1]=$[ee+4*X+1]*_e>>23,$[ee+4*X+2]=$[ee+4*X+2]*_e>>23)}m+=G}}function jr(d,m,F,N,j){for(;0<N--;){var G;for(G=0;G<F;++G){var X=d[m+2*G+0],$=15&(ie=d[m+2*G+1]),ee=4369*$,ie=(240&ie|ie>>4)*ee>>16;d[m+2*G+0]=(240&X|X>>4)*ee>>16&240|(15&X|X<<4)*ee>>16>>4&15,d[m+2*G+1]=240&ie|$}m+=j}}function uA(d,m,F,N,j,G,X,$){var ee,ie,pe=255;for(ie=0;ie<j;++ie){for(ee=0;ee<N;++ee){var _e=d[m+ee];G[X+4*ee]=_e,pe&=_e}m+=F,X+=$}return pe!=255}function Ui(d,m,F,N,j){var G;for(G=0;G<j;++G)F[N+G]=d[m+G]>>8}function Ln(){Ul=Xr,cS=jr,fS=uA,hS=Ui}function _i(d,m,F){_[d]=function(N,j,G,X,$,ee,ie,pe,_e,ae,me,Ce,ke,Se,He,qe,Ze){var Xe,mt=Ze-1>>1,ut=$[ee+0]|ie[pe+0]<<16,It=_e[ae+0]|me[Ce+0]<<16;e(N!=null);var dt=3*ut+It+131074>>2;for(m(N[j+0],255&dt,dt>>16,ke,Se),G!=null&&(dt=3*It+ut+131074>>2,m(G[X+0],255&dt,dt>>16,He,qe)),Xe=1;Xe<=mt;++Xe){var Lt=$[ee+Xe]|ie[pe+Xe]<<16,$r=_e[ae+Xe]|me[Ce+Xe]<<16,Qt=ut+Lt+It+$r+524296,gt=Qt+2*(Lt+It)>>3;dt=gt+ut>>1,ut=(Qt=Qt+2*(ut+$r)>>3)+Lt>>1,m(N[j+2*Xe-1],255&dt,dt>>16,ke,Se+(2*Xe-1)*F),m(N[j+2*Xe-0],255&ut,ut>>16,ke,Se+(2*Xe-0)*F),G!=null&&(dt=Qt+It>>1,ut=gt+$r>>1,m(G[X+2*Xe-1],255&dt,dt>>16,He,qe+(2*Xe-1)*F),m(G[X+2*Xe+0],255&ut,ut>>16,He,qe+(2*Xe+0)*F)),ut=Lt,It=$r}1&Ze||(dt=3*ut+It+131074>>2,m(N[j+Ze-1],255&dt,dt>>16,ke,Se+(Ze-1)*F),G!=null&&(dt=3*It+ut+131074>>2,m(G[X+Ze-1],255&dt,dt>>16,He,qe+(Ze-1)*F)))}}function vl(){yn[Pf]=iM,yn[Rf]=CS,yn[wS]=aM,yn[Mf]=ES,yn[Df]=FS,yn[Bv]=SS,yn[yS]=sM,yn[bv]=CS,yn[xv]=ES,yn[kf]=FS,yn[Cv]=SS}function Vs(d){return d&-16384?0>d?0:255:d>>oM}function ia(d,m){return Vs((19077*d>>8)+(26149*m>>8)-14234)}function Ja(d,m,F){return Vs((19077*d>>8)-(6419*m>>8)-(13320*F>>8)+8708)}function Za(d,m){return Vs((19077*d>>8)+(33050*m>>8)-17685)}function aa(d,m,F,N,j){N[j+0]=ia(d,F),N[j+1]=Ja(d,m,F),N[j+2]=Za(d,m)}function cA(d,m,F,N,j){N[j+0]=Za(d,m),N[j+1]=Ja(d,m,F),N[j+2]=ia(d,F)}function es(d,m,F,N,j){var G=Ja(d,m,F);m=G<<3&224|Za(d,m)>>3,N[j+0]=248&ia(d,F)|G>>5,N[j+1]=m}function ts(d,m,F,N,j){var G=240&Za(d,m)|15;N[j+0]=240&ia(d,F)|Ja(d,m,F)>>4,N[j+1]=G}function ml(d,m,F,N,j){N[j+0]=255,aa(d,m,F,N,j+1)}function wl(d,m,F,N,j){cA(d,m,F,N,j),N[j+3]=255}function OA(d,m,F,N,j){aa(d,m,F,N,j),N[j+3]=255}function Ii(d,m,F){_[d]=function(N,j,G,X,$,ee,ie,pe,_e){for(var ae=pe+(-2&_e)*F;pe!=ae;)m(N[j+0],G[X+0],$[ee+0],ie,pe),m(N[j+1],G[X+0],$[ee+0],ie,pe+F),j+=2,++X,++ee,pe+=2*F;1&_e&&m(N[j+0],G[X+0],$[ee+0],ie,pe)}}function zs(d,m,F){return F==0?d==0?m==0?6:5:m==0?4:0:F}function Nf(d,m,F,N,j){switch(d>>>30){case 3:is(m,F,N,j,0);break;case 2:mn(m,F,N,j);break;case 1:zt(m,F,N,j)}}function vn(d,m){var F,N,j=m.M,G=m.Nb,X=d.oc,$=d.pc+40,ee=d.oc,ie=d.pc+584,pe=d.oc,_e=d.pc+600;for(F=0;16>F;++F)X[$+32*F-1]=129;for(F=0;8>F;++F)ee[ie+32*F-1]=129,pe[_e+32*F-1]=129;for(0<j?X[$-1-32]=ee[ie-1-32]=pe[_e-1-32]=129:(n(X,$-32-1,127,21),n(ee,ie-32-1,127,9),n(pe,_e-32-1,127,9)),N=0;N<d.za;++N){var ae=m.ya[m.aa+N];if(0<N){for(F=-1;16>F;++F)A(X,$+32*F-4,X,$+32*F+12,4);for(F=-1;8>F;++F)A(ee,ie+32*F-4,ee,ie+32*F+4,4),A(pe,_e+32*F-4,pe,_e+32*F+4,4)}var me=d.Gd,Ce=d.Hd+N,ke=ae.ad,Se=ae.Hc;if(0<j&&(A(X,$-32,me[Ce].y,0,16),A(ee,ie-32,me[Ce].f,0,8),A(pe,_e-32,me[Ce].ea,0,8)),ae.Za){var He=X,qe=$-32+16;for(0<j&&(N>=d.za-1?n(He,qe,me[Ce].y[15],4):A(He,qe,me[Ce+1].y,0,4)),F=0;4>F;F++)He[qe+128+F]=He[qe+256+F]=He[qe+384+F]=He[qe+0+F];for(F=0;16>F;++F,Se<<=2)He=X,qe=$+_S[F],Pn[ae.Ob[F]](He,qe),Nf(Se,ke,16*+F,He,qe)}else if(He=zs(N,j,ae.Ob[0]),da[He](X,$),Se!=0)for(F=0;16>F;++F,Se<<=2)Nf(Se,ke,16*+F,X,$+_S[F]);for(F=ae.Gc,He=zs(N,j,ae.Dd),Oi[He](ee,ie),Oi[He](pe,_e),Se=ke,He=ee,qe=ie,255&(ae=0|F)&&(170&ae?ni(Se,256,He,qe):Jt(Se,256,He,qe)),ae=pe,Se=_e,255&(F>>=8)&&(170&F?ni(ke,320,ae,Se):Jt(ke,320,ae,Se)),j<d.Ub-1&&(A(me[Ce].y,0,X,$+480,16),A(me[Ce].f,0,ee,ie+224,8),A(me[Ce].ea,0,pe,_e+224,8)),F=8*G*d.B,me=d.sa,Ce=d.ta+16*N+16*G*d.R,ke=d.qa,ae=d.ra+8*N+F,Se=d.Ha,He=d.Ia+8*N+F,F=0;16>F;++F)A(me,Ce+F*d.R,X,$+32*F,16);for(F=0;8>F;++F)A(ke,ae+F*d.B,ee,ie+32*F,8),A(Se,He+F*d.B,pe,_e+32*F,8)}}function rs(d,m,F,N,j,G,X,$,ee){var ie=[0],pe=[0],_e=0,ae=ee!=null?ee.kd:0,me=ee??new We;if(d==null||12>F)return 7;me.data=d,me.w=m,me.ha=F,m=[m],F=[F],me.gb=[me.gb];e:{var Ce=m,ke=F,Se=me.gb;if(e(d!=null),e(ke!=null),e(Se!=null),Se[0]=0,12<=ke[0]&&!t(d,Ce[0],"RIFF")){if(t(d,Ce[0]+8,"WEBP")){Se=3;break e}var He=ye(d,Ce[0]+4);if(12>He||4294967286<He){Se=3;break e}if(ae&&He>ke[0]-8){Se=7;break e}Se[0]=He,Ce[0]+=12,ke[0]-=12}Se=0}if(Se!=0)return Se;for(He=0<me.gb[0],F=F[0];;){e:{var qe=d;ke=m,Se=F;var Ze=ie,Xe=pe,mt=Ce=[0];if((dt=_e=[_e])[0]=0,8>Se[0])Se=7;else{if(!t(qe,ke[0],"VP8X")){if(ye(qe,ke[0]+4)!=10){Se=3;break e}if(18>Se[0]){Se=7;break e}var ut=ye(qe,ke[0]+8),It=1+Be(qe,ke[0]+12);if(2147483648<=It*(qe=1+Be(qe,ke[0]+15))){Se=3;break e}mt!=null&&(mt[0]=ut),Ze!=null&&(Ze[0]=It),Xe!=null&&(Xe[0]=qe),ke[0]+=18,Se[0]-=18,dt[0]=1}Se=0}}if(_e=_e[0],Ce=Ce[0],Se!=0)return Se;if(ke=!!(2&Ce),!He&&_e)return 3;if(G!=null&&(G[0]=!!(16&Ce)),X!=null&&(X[0]=ke),$!=null&&($[0]=0),X=ie[0],Ce=pe[0],_e&&ke&&ee==null){Se=0;break}if(4>F){Se=7;break}if(He&&_e||!He&&!_e&&!t(d,m[0],"ALPH")){F=[F],me.na=[me.na],me.P=[me.P],me.Sa=[me.Sa];e:{ut=d,Se=m,He=F;var dt=me.gb;Ze=me.na,Xe=me.P,mt=me.Sa,It=22,e(ut!=null),e(He!=null),qe=Se[0];var Lt=He[0];for(e(Ze!=null),e(mt!=null),Ze[0]=null,Xe[0]=null,mt[0]=0;;){if(Se[0]=qe,He[0]=Lt,8>Lt){Se=7;break e}var $r=ye(ut,qe+4);if(4294967286<$r){Se=3;break e}var Qt=8+$r+1&-2;if(It+=Qt,0<dt&&It>dt){Se=3;break e}if(!t(ut,qe,"VP8 ")||!t(ut,qe,"VP8L")){Se=0;break e}if(Lt[0]<Qt){Se=7;break e}t(ut,qe,"ALPH")||(Ze[0]=ut,Xe[0]=qe+8,mt[0]=$r),qe+=Qt,Lt-=Qt}}if(F=F[0],me.na=me.na[0],me.P=me.P[0],me.Sa=me.Sa[0],Se!=0)break}F=[F],me.Ja=[me.Ja],me.xa=[me.xa];e:if(dt=d,Se=m,He=F,Ze=me.gb[0],Xe=me.Ja,mt=me.xa,ut=Se[0],qe=!t(dt,ut,"VP8 "),It=!t(dt,ut,"VP8L"),e(dt!=null),e(He!=null),e(Xe!=null),e(mt!=null),8>He[0])Se=7;else{if(qe||It){if(dt=ye(dt,ut+4),12<=Ze&&dt>Ze-12){Se=3;break e}if(ae&&dt>He[0]-8){Se=7;break e}Xe[0]=dt,Se[0]+=8,He[0]-=8,mt[0]=It}else mt[0]=5<=He[0]&&dt[ut+0]==47&&!(dt[ut+4]>>5),Xe[0]=He[0];Se=0}if(F=F[0],me.Ja=me.Ja[0],me.xa=me.xa[0],m=m[0],Se!=0)break;if(4294967286<me.Ja)return 3;if($==null||ke||($[0]=me.xa?2:1),X=[X],Ce=[Ce],me.xa){if(5>F){Se=7;break}$=X,ae=Ce,ke=G,d==null||5>F?d=0:5<=F&&d[m+0]==47&&!(d[m+4]>>5)?(He=[0],dt=[0],Ze=[0],Ae(Xe=new P,d,m,F),nA(Xe,He,dt,Ze)?($!=null&&($[0]=He[0]),ae!=null&&(ae[0]=dt[0]),ke!=null&&(ke[0]=Ze[0]),d=1):d=0):d=0}else{if(10>F){Se=7;break}$=Ce,d==null||10>F||!Bf(d,m+3,F-3)?d=0:(ae=d[m+0]|d[m+1]<<8|d[m+2]<<16,ke=16383&(d[m+7]<<8|d[m+6]),d=16383&(d[m+9]<<8|d[m+8]),1&ae||3<(ae>>1&7)||!(ae>>4&1)||ae>>5>=me.Ja||!ke||!d?d=0:(X&&(X[0]=ke),$&&($[0]=d),d=1))}if(!d||(X=X[0],Ce=Ce[0],_e&&(ie[0]!=X||pe[0]!=Ce)))return 3;ee!=null&&(ee[0]=me,ee.offset=m-ee.w,e(4294967286>m-ee.w),e(ee.offset==ee.ha-F));break}return Se==0||Se==7&&_e&&ee==null?(G!=null&&(G[0]|=me.na!=null&&0<me.na.length),N!=null&&(N[0]=X),j!=null&&(j[0]=Ce),0):Se}function yl(d,m,F){var N=m.width,j=m.height,G=0,X=0,$=N,ee=j;if(m.Da=d!=null&&0<d.Da,m.Da&&($=d.cd,ee=d.bd,G=d.v,X=d.j,11>F||(G&=-2,X&=-2),0>G||0>X||0>=$||0>=ee||G+$>N||X+ee>j))return 0;if(m.v=G,m.j=X,m.va=G+$,m.o=X+ee,m.U=$,m.T=ee,m.da=d!=null&&0<d.da,m.da){if(!Re($,ee,F=[d.ib],G=[d.hb]))return 0;m.ib=F[0],m.hb=G[0]}return m.ob=d!=null&&d.ob,m.Kb=d==null||!d.Sd,m.da&&(m.ob=m.ib<3*N/4&&m.hb<3*j/4,m.Kb=0),1}function Bl(d){if(d==null)return 2;if(11>d.S){var m=d.f.RGBA;m.fb+=(d.height-1)*m.A,m.A=-m.A}else m=d.f.kb,d=d.height,m.O+=(d-1)*m.fa,m.fa=-m.fa,m.N+=(d-1>>1)*m.Ab,m.Ab=-m.Ab,m.W+=(d-1>>1)*m.Db,m.Db=-m.Db,m.F!=null&&(m.J+=(d-1)*m.lb,m.lb=-m.lb);return 0}function sa(d,m,F,N){if(N==null||0>=d||0>=m)return 2;if(F!=null){if(F.Da){var j=F.cd,G=F.bd,X=-2&F.v,$=-2&F.j;if(0>X||0>$||0>=j||0>=G||X+j>d||$+G>m)return 2;d=j,m=G}if(F.da){if(!Re(d,m,j=[F.ib],G=[F.hb]))return 2;d=j[0],m=G[0]}}N.width=d,N.height=m;e:{var ee=N.width,ie=N.height;if(d=N.S,0>=ee||0>=ie||!(d>=Pf&&13>d))d=2;else{if(0>=N.Rd&&N.sd==null){X=G=j=m=0;var pe=($=ee*IS[d])*ie;if(11>d||(G=(ie+1)/2*(m=(ee+1)/2),d==12&&(X=(j=ee)*ie)),(ie=i(pe+2*G+X))==null){d=1;break e}N.sd=ie,11>d?((ee=N.f.RGBA).eb=ie,ee.fb=0,ee.A=$,ee.size=pe):((ee=N.f.kb).y=ie,ee.O=0,ee.fa=$,ee.Fd=pe,ee.f=ie,ee.N=0+pe,ee.Ab=m,ee.Cd=G,ee.ea=ie,ee.W=0+pe+G,ee.Db=m,ee.Ed=G,d==12&&(ee.F=ie,ee.J=0+pe+2*G),ee.Tc=X,ee.lb=j)}if(m=1,j=N.S,G=N.width,X=N.height,j>=Pf&&13>j)if(11>j)d=N.f.RGBA,m&=($=Math.abs(d.A))*(X-1)+G<=d.size,m&=$>=G*IS[j],m&=d.eb!=null;else{d=N.f.kb,$=(G+1)/2,pe=(X+1)/2,ee=Math.abs(d.fa),ie=Math.abs(d.Ab);var _e=Math.abs(d.Db),ae=Math.abs(d.lb),me=ae*(X-1)+G;m&=ee*(X-1)+G<=d.Fd,m&=ie*(pe-1)+$<=d.Cd,m=(m&=_e*(pe-1)+$<=d.Ed)&ee>=G&ie>=$&_e>=$,m&=d.y!=null,m&=d.f!=null,m&=d.ea!=null,j==12&&(m&=ae>=G,m&=me<=d.Tc,m&=d.F!=null)}else m=0;d=m?0:2}}return d!=0||F!=null&&F.fd&&(d=Bl(N)),d}var As=64,JA=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],ZA=24,oa=32,Qi=8,la=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Me("Predictor0","PredictorAdd0"),_.Predictor0=function(){return 4278190080},_.Predictor1=function(d){return d},_.Predictor2=function(d,m,F){return m[F+0]},_.Predictor3=function(d,m,F){return m[F+1]},_.Predictor4=function(d,m,F){return m[F-1]},_.Predictor5=function(d,m,F){return Ye(Ye(d,m[F+1]),m[F+0])},_.Predictor6=function(d,m,F){return Ye(d,m[F-1])},_.Predictor7=function(d,m,F){return Ye(d,m[F+0])},_.Predictor8=function(d,m,F){return Ye(m[F-1],m[F+0])},_.Predictor9=function(d,m,F){return Ye(m[F+0],m[F+1])},_.Predictor10=function(d,m,F){return Ye(Ye(d,m[F-1]),Ye(m[F+0],m[F+1]))},_.Predictor11=function(d,m,F){var N=m[F+0];return 0>=je(N>>24&255,d>>24&255,(m=m[F-1])>>24&255)+je(N>>16&255,d>>16&255,m>>16&255)+je(N>>8&255,d>>8&255,m>>8&255)+je(255&N,255&d,255&m)?N:d},_.Predictor12=function(d,m,F){var N=m[F+0];return(xe((d>>24&255)+(N>>24&255)-((m=m[F-1])>>24&255))<<24|xe((d>>16&255)+(N>>16&255)-(m>>16&255))<<16|xe((d>>8&255)+(N>>8&255)-(m>>8&255))<<8|xe((255&d)+(255&N)-(255&m)))>>>0},_.Predictor13=function(d,m,F){var N=m[F-1];return(Oe((d=Ye(d,m[F+0]))>>24&255,N>>24&255)<<24|Oe(d>>16&255,N>>16&255)<<16|Oe(d>>8&255,N>>8&255)<<8|Oe(255&d,255&N))>>>0};var bl=_.PredictorAdd0;_.PredictorAdd1=ge,Me("Predictor2","PredictorAdd2"),Me("Predictor3","PredictorAdd3"),Me("Predictor4","PredictorAdd4"),Me("Predictor5","PredictorAdd5"),Me("Predictor6","PredictorAdd6"),Me("Predictor7","PredictorAdd7"),Me("Predictor8","PredictorAdd8"),Me("Predictor9","PredictorAdd9"),Me("Predictor10","PredictorAdd10"),Me("Predictor11","PredictorAdd11"),Me("Predictor12","PredictorAdd12"),Me("Predictor13","PredictorAdd13");var Gs=_.PredictorAdd2;fe("ColorIndexInverseTransform","MapARGB","32b",function(d){return d>>8&255},function(d){return d}),fe("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(d){return d},function(d){return d>>8&255});var Ir,Of=_.ColorIndexInverseTransform,ri=_.MapARGB,Ai=_.VP8LColorIndexInverseTransformAlpha,xl=_.MapAlpha,Cl=_.VP8LPredictorsAdd=[];Cl.length=16,(_.VP8LPredictors=[]).length=16,(_.VP8LPredictorsAdd_C=[]).length=16,(_.VP8LPredictors_C=[]).length=16;var El,Fl,ua,ca,fa,ns,ha,is,mn,ni,zt,Jt,Qr,Yr,Ni,Sl,Ws,Tf,iS,aS,sS,oS,lS,uS,Ul,cS,fS,hS,dS=i(511),gS=i(2041),pS=i(225),vS=i(767),mS=0,yv=gS,Lf=pS,en=vS,wn=dS,Pf=0,Rf=1,wS=2,Mf=3,Df=4,Bv=5,yS=6,bv=7,xv=8,kf=9,Cv=10,V8=[2,3,7],z8=[3,3,11],BS=[280,256,256,256,40],G8=[0,1,1,1,0],W8=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],X8=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Y8=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],$8=8,Ev=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Fv=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],_l=null,J8=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Z8=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],bS=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],eM=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],tM=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],rM=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],AM=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],da=[],Pn=[],Oi=[],nM=1,xS=2,ga=[],yn=[];_i("UpsampleRgbLinePair",aa,3),_i("UpsampleBgrLinePair",cA,3),_i("UpsampleRgbaLinePair",OA,4),_i("UpsampleBgraLinePair",wl,4),_i("UpsampleArgbLinePair",ml,4),_i("UpsampleRgba4444LinePair",ts,2),_i("UpsampleRgb565LinePair",es,2);var iM=_.UpsampleRgbLinePair,aM=_.UpsampleBgrLinePair,CS=_.UpsampleRgbaLinePair,ES=_.UpsampleBgraLinePair,FS=_.UpsampleArgbLinePair,SS=_.UpsampleRgba4444LinePair,sM=_.UpsampleRgb565LinePair,Hf=16,jf=1<<Hf-1,Il=-227,Sv=482,oM=6,US=0,lM=i(256),uM=i(256),cM=i(256),fM=i(256),hM=i(Sv-Il),dM=i(Sv-Il);Ii("YuvToRgbRow",aa,3),Ii("YuvToBgrRow",cA,3),Ii("YuvToRgbaRow",OA,4),Ii("YuvToBgraRow",wl,4),Ii("YuvToArgbRow",ml,4),Ii("YuvToRgba4444Row",ts,2),Ii("YuvToRgb565Row",es,2);var _S=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Kf=[0,2,8],gM=[8,7,6,4,4,2,2,2,1,1,1,1],pM=1;this.WebPDecodeRGBA=function(d,m,F,N,j){var G=Rf,X=new Ke,$=new nt;X.ba=$,$.S=G,$.width=[$.width],$.height=[$.height];var ee=$.width,ie=$.height,pe=new tt;if(pe==null||d==null)var _e=2;else e(pe!=null),_e=rs(d,m,F,pe.width,pe.height,pe.Pd,pe.Qd,pe.format,null);if(_e!=0?ee=0:(ee!=null&&(ee[0]=pe.width[0]),ie!=null&&(ie[0]=pe.height[0]),ee=1),ee){$.width=$.width[0],$.height=$.height[0],N!=null&&(N[0]=$.width),j!=null&&(j[0]=$.height);e:{if(N=new ks,(j=new We).data=d,j.w=m,j.ha=F,j.kd=1,m=[0],e(j!=null),((d=rs(j.data,j.w,j.ha,null,null,null,m,null,j))==0||d==7)&&m[0]&&(d=4),(m=d)==0){if(e(X!=null),N.data=j.data,N.w=j.w+j.offset,N.ha=j.ha-j.offset,N.put=Bt,N.ac=Vr,N.bc=Mr,N.ma=X,j.xa){if((d=Jn())==null){X=1;break e}if((function(ae,me){var Ce=[0],ke=[0],Se=[0];t:for(;;){if(ae==null)return 0;if(me==null)return ae.a=2,0;if(ae.l=me,ae.a=0,Ae(ae.m,me.data,me.w,me.ha),!nA(ae.m,Ce,ke,Se)){ae.a=3;break t}if(ae.xb=xS,me.width=Ce[0],me.height=ke[0],!dn(Ce[0],ke[0],1,ae,null))break t;return 1}return e(ae.a!=0),0})(d,N)){if(N=(m=sa(N.width,N.height,X.Oa,X.ba))==0){t:{N=d;r:for(;;){if(N==null){N=0;break t}if(e(N.s.yc!=null),e(N.s.Ya!=null),e(0<N.s.Wb),e((F=N.l)!=null),e((j=F.ma)!=null),N.xb!=0){if(N.ca=j.ba,N.tb=j.tb,e(N.ca!=null),!yl(j.Oa,F,Mf)){N.a=2;break r}if(!ft(N,F.width)||F.da)break r;if((F.da||et(N.ca.S))&&Ln(),11>N.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),N.ca.f.kb.F!=null&&Ln()),N.Pb&&0<N.s.ua&&N.s.vb.X==null&&!R(N.s.vb,N.s.Wa.Xa)){N.a=1;break r}N.xb=0}if(!KA(N,N.V,N.Ba,N.c,N.i,F.o,QA))break r;j.Dc=N.Ma,N=1;break t}e(N.a!=0),N=0}N=!N}N&&(m=d.a)}else m=d.a}else{if((d=new iv)==null){X=1;break e}if(d.Fa=j.na,d.P=j.P,d.qc=j.Sa,ei(d,N)){if((m=sa(N.width,N.height,X.Oa,X.ba))==0){if(d.Aa=0,F=X.Oa,e((j=d)!=null),F!=null){if(0<(ee=0>(ee=F.Md)?0:100<ee?255:255*ee/100)){for(ie=pe=0;4>ie;++ie)12>(_e=j.pb[ie]).lc&&(_e.ia=ee*gM[0>_e.lc?0:_e.lc]>>3),pe|=_e.ia;pe&&(alert("todo:VP8InitRandom"),j.ia=1)}j.Ga=F.Id,100<j.Ga?j.Ga=100:0>j.Ga&&(j.Ga=0)}(function(ae,me){if(ae==null)return 0;if(me==null)return kr(ae,2,"NULL VP8Io parameter in VP8Decode().");if(!ae.cb&&!ei(ae,me))return 0;if(e(ae.cb),me.ac==null||me.ac(me)){me.ob&&(ae.L=0);var Ce=Kf[ae.L];if(ae.L==2?(ae.yb=0,ae.zb=0):(ae.yb=me.v-Ce>>4,ae.zb=me.j-Ce>>4,0>ae.yb&&(ae.yb=0),0>ae.zb&&(ae.zb=0)),ae.Va=me.o+15+Ce>>4,ae.Hb=me.va+15+Ce>>4,ae.Hb>ae.za&&(ae.Hb=ae.za),ae.Va>ae.Ub&&(ae.Va=ae.Ub),0<ae.L){var ke=ae.ed;for(Ce=0;4>Ce;++Ce){var Se;if(ae.Qa.Cb){var He=ae.Qa.Lb[Ce];ae.Qa.Fb||(He+=ke.Tb)}else He=ke.Tb;for(Se=0;1>=Se;++Se){var qe=ae.gd[Ce][Se],Ze=He;if(ke.Pc&&(Ze+=ke.vd[0],Se&&(Ze+=ke.od[0])),0<(Ze=0>Ze?0:63<Ze?63:Ze)){var Xe=Ze;0<ke.wb&&(Xe=4<ke.wb?Xe>>2:Xe>>1)>9-ke.wb&&(Xe=9-ke.wb),1>Xe&&(Xe=1),qe.dd=Xe,qe.tc=2*Ze+Xe,qe.ld=40<=Ze?2:15<=Ze?1:0}else qe.tc=0;qe.La=Se}}}Ce=0}else kr(ae,6,"Frame setup failed"),Ce=ae.a;if(Ce=Ce==0){if(Ce){ae.$c=0,0<ae.Aa||(ae.Ic=pM);t:{Ce=ae.Ic,ke=4*(Xe=ae.za);var mt=32*Xe,ut=Xe+1,It=0<ae.L?Xe*(0<ae.Aa?2:1):0,dt=(ae.Aa==2?2:1)*Xe;if((qe=ke+832+(Se=3*(16*Ce+Kf[ae.L])/2*mt)+(He=ae.Fa!=null&&0<ae.Fa.length?ae.Kc.c*ae.Kc.i:0))!=qe)Ce=0;else{if(qe>ae.Vb){if(ae.Vb=0,ae.Ec=i(qe),ae.Fc=0,ae.Ec==null){Ce=kr(ae,1,"no memory during frame initialization.");break t}ae.Vb=qe}qe=ae.Ec,Ze=ae.Fc,ae.Ac=qe,ae.Bc=Ze,Ze+=ke,ae.Gd=s(mt,za),ae.Hd=0,ae.rb=s(ut+1,gn),ae.sb=1,ae.wa=It?s(It,yr):null,ae.Y=0,ae.D.Nb=0,ae.D.wa=ae.wa,ae.D.Y=ae.Y,0<ae.Aa&&(ae.D.Y+=Xe),e(!0),ae.oc=qe,ae.pc=Ze,Ze+=832,ae.ya=s(dt,cr),ae.aa=0,ae.D.ya=ae.ya,ae.D.aa=ae.aa,ae.Aa==2&&(ae.D.aa+=Xe),ae.R=16*Xe,ae.B=8*Xe,Xe=(mt=Kf[ae.L])*ae.R,mt=mt/2*ae.B,ae.sa=qe,ae.ta=Ze+Xe,ae.qa=ae.sa,ae.ra=ae.ta+16*Ce*ae.R+mt,ae.Ha=ae.qa,ae.Ia=ae.ra+8*Ce*ae.B+mt,ae.$c=0,Ze+=Se,ae.mb=He?qe:null,ae.nb=He?Ze:null,e(Ze+He<=ae.Fc+ae.Vb),bf(ae),n(ae.Ac,ae.Bc,0,ke),Ce=1}}if(Ce){if(me.ka=0,me.y=ae.sa,me.O=ae.ta,me.f=ae.qa,me.N=ae.ra,me.ea=ae.Ha,me.Vd=ae.Ia,me.fa=ae.R,me.Rc=ae.B,me.F=null,me.J=0,!mS){for(Ce=-255;255>=Ce;++Ce)dS[255+Ce]=0>Ce?-Ce:Ce;for(Ce=-1020;1020>=Ce;++Ce)gS[1020+Ce]=-128>Ce?-128:127<Ce?127:Ce;for(Ce=-112;112>=Ce;++Ce)pS[112+Ce]=-16>Ce?-16:15<Ce?15:Ce;for(Ce=-255;510>=Ce;++Ce)vS[255+Ce]=0>Ce?0:255<Ce?255:Ce;mS=1}ha=js,is=sv,ni=ti,zt=Cf,Jt=Ef,mn=av,Qr=If,Yr=$a,Ni=H,Sl=se,Ws=Qf,Tf=b,iS=he,aS=be,sS=Ya,oS=pl,lS=Uf,uS=_f,Pn[0]=gv,Pn[1]=ov,Pn[2]=hv,Pn[3]=dv,Pn[4]=bi,Pn[5]=pv,Pn[6]=xi,Pn[7]=vv,Pn[8]=cl,Pn[9]=Ks,da[0]=cv,da[1]=uv,da[2]=ll,da[3]=Ff,da[4]=Wa,da[5]=ul,da[6]=fv,Oi[0]=wv,Oi[1]=lv,Oi[2]=Xa,Oi[3]=mv,Oi[4]=hl,Oi[5]=fl,Oi[6]=Sf,Ce=1}else Ce=0}Ce&&(Ce=(function(Lt,$r){for(Lt.M=0;Lt.M<Lt.Va;++Lt.M){var Qt,gt=Lt.Jc[Lt.M&Lt.Xb],rt=Lt.m,Nr=Lt;for(Qt=0;Qt<Nr.za;++Qt){var St=rt,Pt=Nr,ir=Pt.Ac,fA=Pt.Bc+4*Qt,TA=Pt.zc,Br=Pt.ya[Pt.aa+Qt];if(Pt.Qa.Bb?Br.$b=oe(St,Pt.Pa.jb[0])?2+oe(St,Pt.Pa.jb[2]):oe(St,Pt.Pa.jb[1]):Br.$b=0,Pt.kc&&(Br.Ad=oe(St,Pt.Bd)),Br.Za=!oe(St,145)+0,Br.Za){var xA=Br.Ob,LA=0;for(Pt=0;4>Pt;++Pt){var Jr,Mt=TA[0+Pt];for(Jr=0;4>Jr;++Jr){Mt=tM[ir[fA+Jr]][Mt];for(var Gt=bS[oe(St,Mt[0])];0<Gt;)Gt=bS[2*Gt+oe(St,Mt[Gt])];Mt=-Gt,ir[fA+Jr]=Mt}A(xA,LA,ir,fA,4),LA+=4,TA[0+Pt]=Mt}}else Mt=oe(St,156)?oe(St,128)?1:3:oe(St,163)?2:0,Br.Ob[0]=Mt,n(ir,fA,Mt,4),n(TA,0,Mt,4);Br.Dd=oe(St,142)?oe(St,114)?oe(St,183)?1:3:2:0}if(Nr.m.Ka)return kr(Lt,7,"Premature end-of-partition0 encountered.");for(;Lt.ja<Lt.za;++Lt.ja){if(Nr=gt,St=(rt=Lt).rb[rt.sb-1],ir=rt.rb[rt.sb+rt.ja],Qt=rt.ya[rt.aa+rt.ja],fA=rt.kc?Qt.Ad:0)St.la=ir.la=0,Qt.Za||(St.Na=ir.Na=0),Qt.Hc=0,Qt.Gc=0,Qt.ia=0;else{var br,Wt;if(St=ir,ir=Nr,fA=rt.Pa.Xc,TA=rt.ya[rt.aa+rt.ja],Br=rt.pb[TA.$b],Pt=TA.ad,xA=0,LA=rt.rb[rt.sb-1],Mt=Jr=0,n(Pt,xA,0,384),TA.Za)var hA=0,Rn=fA[3];else{Gt=i(16);var Or=St.Na+LA.Na;if(Or=_l(ir,fA[1],Or,Br.Eb,0,Gt,0),St.Na=LA.Na=(0<Or)+0,1<Or)ha(Gt,0,Pt,xA);else{var qA=Gt[0]+3>>3;for(Gt=0;256>Gt;Gt+=16)Pt[xA+Gt]=qA}hA=1,Rn=fA[0]}var Zt=15&St.la,Zr=15&LA.la;for(Gt=0;4>Gt;++Gt){var tn=1&Zr;for(qA=Wt=0;4>qA;++qA)Zt=Zt>>1|(tn=(Or=_l(ir,Rn,Or=tn+(1&Zt),Br.Sc,hA,Pt,xA))>hA)<<7,Wt=Wt<<2|(3<Or?3:1<Or?2:Pt[xA+0]!=0),xA+=16;Zt>>=4,Zr=Zr>>1|tn<<7,Jr=(Jr<<8|Wt)>>>0}for(Rn=Zt,hA=Zr>>4,br=0;4>br;br+=2){for(Wt=0,Zt=St.la>>4+br,Zr=LA.la>>4+br,Gt=0;2>Gt;++Gt){for(tn=1&Zr,qA=0;2>qA;++qA)Or=tn+(1&Zt),Zt=Zt>>1|(tn=0<(Or=_l(ir,fA[2],Or,Br.Qc,0,Pt,xA)))<<3,Wt=Wt<<2|(3<Or?3:1<Or?2:Pt[xA+0]!=0),xA+=16;Zt>>=2,Zr=Zr>>1|tn<<5}Mt|=Wt<<4*br,Rn|=Zt<<4<<br,hA|=(240&Zr)<<br}St.la=Rn,LA.la=hA,TA.Hc=Jr,TA.Gc=Mt,TA.ia=43690&Mt?0:Br.ia,fA=!(Jr|Mt)}if(0<rt.L&&(rt.wa[rt.Y+rt.ja]=rt.gd[Qt.$b][Qt.Za],rt.wa[rt.Y+rt.ja].La|=!fA),Nr.Ka)return kr(Lt,7,"Premature end-of-file encountered.")}if(bf(Lt),rt=$r,Nr=1,Qt=(gt=Lt).D,St=0<gt.L&>.M>=gt.zb&>.M<=gt.Va,gt.Aa==0)t:{if(Qt.M=gt.M,Qt.uc=St,vn(gt,Qt),Nr=1,Qt=(Wt=gt.D).Nb,St=(Mt=Kf[gt.L])*gt.R,ir=Mt/2*gt.B,Gt=16*Qt*gt.R,qA=8*Qt*gt.B,fA=gt.sa,TA=gt.ta-St+Gt,Br=gt.qa,Pt=gt.ra-ir+qA,xA=gt.Ha,LA=gt.Ia-ir+qA,Zr=(Zt=Wt.M)==0,Jr=Zt>=gt.Va-1,gt.Aa==2&&vn(gt,Wt),Wt.uc)for(tn=(Or=gt).D.M,e(Or.D.uc),Wt=Or.yb;Wt<Or.Hb;++Wt){hA=Wt,Rn=tn;var PA=(rn=(dA=Or).D).Nb;br=dA.R;var rn=rn.wa[rn.Y+hA],An=dA.sa,VA=dA.ta+16*PA*br+16*hA,nn=rn.dd,rr=rn.tc;if(rr!=0)if(e(3<=rr),dA.L==1)0<hA&&oS(An,VA,br,rr+4),rn.La&&uS(An,VA,br,rr),0<Rn&&sS(An,VA,br,rr+4),rn.La&&lS(An,VA,br,rr);else{var an=dA.B,Mn=dA.qa,as=dA.ra+8*PA*an+8*hA,Ti=dA.Ha,dA=dA.Ia+8*PA*an+8*hA;PA=rn.ld,0<hA&&(Yr(An,VA,br,rr+4,nn,PA),Sl(Mn,as,Ti,dA,an,rr+4,nn,PA)),rn.La&&(Tf(An,VA,br,rr,nn,PA),aS(Mn,as,Ti,dA,an,rr,nn,PA)),0<Rn&&(Qr(An,VA,br,rr+4,nn,PA),Ni(Mn,as,Ti,dA,an,rr+4,nn,PA)),rn.La&&(Ws(An,VA,br,rr,nn,PA),iS(Mn,as,Ti,dA,an,rr,nn,PA))}}if(gt.ia&&alert("todo:DitherRow"),rt.put!=null){if(Wt=16*Zt,Zt=16*(Zt+1),Zr?(rt.y=gt.sa,rt.O=gt.ta+Gt,rt.f=gt.qa,rt.N=gt.ra+qA,rt.ea=gt.Ha,rt.W=gt.Ia+qA):(Wt-=Mt,rt.y=fA,rt.O=TA,rt.f=Br,rt.N=Pt,rt.ea=xA,rt.W=LA),Jr||(Zt-=Mt),Zt>rt.o&&(Zt=rt.o),rt.F=null,rt.J=null,gt.Fa!=null&&0<gt.Fa.length&&Wt<Zt&&(rt.J=tr(gt,rt,Wt,Zt-Wt),rt.F=gt.mb,rt.F==null&&rt.F.length==0)){Nr=kr(gt,3,"Could not decode alpha data.");break t}Wt<rt.j&&(Mt=rt.j-Wt,Wt=rt.j,e(!(1&Mt)),rt.O+=gt.R*Mt,rt.N+=gt.B*(Mt>>1),rt.W+=gt.B*(Mt>>1),rt.F!=null&&(rt.J+=rt.width*Mt)),Wt<Zt&&(rt.O+=rt.v,rt.N+=rt.v>>1,rt.W+=rt.v>>1,rt.F!=null&&(rt.J+=rt.v),rt.ka=Wt-rt.j,rt.U=rt.va-rt.v,rt.T=Zt-Wt,Nr=rt.put(rt))}Qt+1!=gt.Ic||Jr||(A(gt.sa,gt.ta-St,fA,TA+16*gt.R,St),A(gt.qa,gt.ra-ir,Br,Pt+8*gt.B,ir),A(gt.Ha,gt.Ia-ir,xA,LA+8*gt.B,ir))}if(!Nr)return kr(Lt,6,"Output aborted.")}return 1})(ae,me)),me.bc!=null&&me.bc(me),Ce&=1}return Ce?(ae.cb=0,Ce):0})(d,N)||(m=d.a)}}else m=d.a}m==0&&X.Oa!=null&&X.Oa.fd&&(m=Bl(X.ba))}X=m}G=X!=0?null:11>G?$.f.RGBA.eb:$.f.kb.y}else G=null;return G};var IS=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function l(_,D){for(var U="",O=0;O<4;O++)U+=String.fromCharCode(_[D++]);return U}function u(_,D){return _[D+0]|_[D+1]<<8}function f(_,D){return(_[D+0]|_[D+1]<<8|_[D+2]<<16)>>>0}function h(_,D){return(_[D+0]|_[D+1]<<8|_[D+2]<<16|_[D+3]<<24)>>>0}new o;var c=[0],g=[0],p=[],y=new o,w=r,B=(function(_,D){var U={},O=0,M=!1,C=0,z=0;if(U.frames=[],!(function(I,P){for(var K=0;K<4;K++)if(I[P+K]!="RIFF".charCodeAt(K))return!0;return!1})(_,D)){for(h(_,D+=4),D+=8;D<_.length;){var re=l(_,D),ne=h(_,D+=4);D+=4;var Z=ne+(1&ne);switch(re){case"VP8 ":case"VP8L":U.frames[O]===void 0&&(U.frames[O]={}),(k=U.frames[O]).src_off=M?z:D-8,k.src_size=C+ne+8,O++,M&&(M=!1,C=0,z=0);break;case"VP8X":(k=U.header={}).feature_flags=_[D];var Ae=D+4;k.canvas_width=1+f(_,Ae),Ae+=3,k.canvas_height=1+f(_,Ae),Ae+=3;break;case"ALPH":M=!0,C=Z+8,z=D-8;break;case"ANIM":(k=U.header).bgcolor=h(_,D),Ae=D+4,k.loop_count=u(_,Ae),Ae+=2;break;case"ANMF":var V,k;(k=U.frames[O]={}).offset_x=2*f(_,D),D+=3,k.offset_y=2*f(_,D),D+=3,k.width=1+f(_,D),D+=3,k.height=1+f(_,D),D+=3,k.duration=f(_,D),D+=3,V=_[D++],k.dispose=1&V,k.blend=V>>1&1}re!="ANMF"&&(D+=Z)}return U}})(w,0);B.response=w,B.rgbaoutput=!0,B.dataurl=!1;var x=B.header?B.header:null,E=B.frames?B.frames:null;if(x){x.loop_counter=x.loop_count,c=[x.canvas_height],g=[x.canvas_width];for(var Q=0;Q<E.length&&E[Q].blend!=0;Q++);}var L=E[0],S=y.WebPDecodeRGBA(w,L.src_off,L.src_size,g,c);L.rgba=S,L.imgwidth=g[0],L.imgheight=c[0];for(var T=0;T<g[0]*c[0]*4;T++)p[T]=S[T];return this.width=g,this.height=c,this.data=p,this}(function(r){var e,t,A,n,i,s,a,o,l,u=function(I){return I=I||{},this.isStrokeTransparent=I.isStrokeTransparent||!1,this.strokeOpacity=I.strokeOpacity||1,this.strokeStyle=I.strokeStyle||"#000000",this.fillStyle=I.fillStyle||"#000000",this.isFillTransparent=I.isFillTransparent||!1,this.fillOpacity=I.fillOpacity||1,this.font=I.font||"10px sans-serif",this.textBaseline=I.textBaseline||"alphabetic",this.textAlign=I.textAlign||"left",this.lineWidth=I.lineWidth||1,this.lineJoin=I.lineJoin||"miter",this.lineCap=I.lineCap||"butt",this.path=I.path||[],this.transform=I.transform!==void 0?I.transform.clone():new o,this.globalCompositeOperation=I.globalCompositeOperation||"normal",this.globalAlpha=I.globalAlpha||1,this.clip_path=I.clip_path||[],this.currentPoint=I.currentPoint||new s,this.miterLimit=I.miterLimit||10,this.lastPoint=I.lastPoint||new s,this.lineDashOffset=I.lineDashOffset||0,this.lineDash=I.lineDash||[],this.margin=I.margin||[0,0,0,0],this.prevPageLastElemOffset=I.prevPageLastElemOffset||0,this.ignoreClearRect=typeof I.ignoreClearRect!="boolean"||I.ignoreClearRect,this};r.events.push(["initialized",function(){this.context2d=new f(this),e=this.internal.f2,t=this.internal.getCoordinateString,A=this.internal.getVerticalCoordinateString,n=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,s=this.internal.Point,a=this.internal.Rectangle,o=this.internal.Matrix,l=new u}]);var f=function(I){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var P=I;Object.defineProperty(this,"pdf",{get:function(){return P}});var K=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return K},set:function(R){K=!!R}});var Y=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return Y},set:function(R){Y=!!R}});var J=0;Object.defineProperty(this,"posX",{get:function(){return J},set:function(R){isNaN(R)||(J=R)}});var q=0;Object.defineProperty(this,"posY",{get:function(){return q},set:function(R){isNaN(R)||(q=R)}}),Object.defineProperty(this,"margin",{get:function(){return l.margin},set:function(R){var Ie;typeof R=="number"?Ie=[R,R,R,R]:((Ie=new Array(4))[0]=R[0],Ie[1]=R.length>=2?R[1]:Ie[0],Ie[2]=R.length>=3?R[2]:Ie[0],Ie[3]=R.length>=4?R[3]:Ie[1]),l.margin=Ie}});var W=!1;Object.defineProperty(this,"autoPaging",{get:function(){return W},set:function(R){W=R}});var te=0;Object.defineProperty(this,"lastBreak",{get:function(){return te},set:function(R){te=R}});var oe=[];Object.defineProperty(this,"pageBreaks",{get:function(){return oe},set:function(R){oe=R}}),Object.defineProperty(this,"ctx",{get:function(){return l},set:function(R){R instanceof u&&(l=R)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(R){l.path=R}});var we=[];Object.defineProperty(this,"ctxStack",{get:function(){return we},set:function(R){we=R}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(R){var Ie;Ie=h(R),this.ctx.fillStyle=Ie.style,this.ctx.isFillTransparent=Ie.a===0,this.ctx.fillOpacity=Ie.a,this.pdf.setFillColor(Ie.r,Ie.g,Ie.b,{a:Ie.a}),this.pdf.setTextColor(Ie.r,Ie.g,Ie.b,{a:Ie.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(R){var Ie=h(R);this.ctx.strokeStyle=Ie.style,this.ctx.isStrokeTransparent=Ie.a===0,this.ctx.strokeOpacity=Ie.a,Ie.a===0?this.pdf.setDrawColor(255,255,255):(Ie.a,this.pdf.setDrawColor(Ie.r,Ie.g,Ie.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(R){["butt","round","square"].indexOf(R)!==-1&&(this.ctx.lineCap=R,this.pdf.setLineCap(R))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(R){isNaN(R)||(this.ctx.lineWidth=R,this.pdf.setLineWidth(R))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(R){["bevel","round","miter"].indexOf(R)!==-1&&(this.ctx.lineJoin=R,this.pdf.setLineJoin(R))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(R){isNaN(R)||(this.ctx.miterLimit=R,this.pdf.setMiterLimit(R))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(R){this.ctx.textBaseline=R}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(R){["right","end","center","left","start"].indexOf(R)!==-1&&(this.ctx.textAlign=R)}});var le=null,Be=null,ye=null;Object.defineProperty(this,"fontFaces",{get:function(){return ye},set:function(R){le=null,Be=null,ye=R}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(R){var Ie;if(this.ctx.font=R,(Ie=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(R))!==null){var Ue=Ie[1];Ie[2];var Re=Ie[3],Ee=Ie[4];Ie[5];var Ve=Ie[6],Me=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Ee)[2];Ee=Math.floor(Me==="px"?parseFloat(Ee)*this.pdf.internal.scaleFactor:Me==="em"?parseFloat(Ee)*this.pdf.getFontSize():parseFloat(Ee)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Ee);var ze=(function(fe){var Le,Fe,Ne=[],ve=fe.trim();if(ve==="")return xd;if(ve in vB)return[vB[ve]];for(;ve!=="";){switch(Fe=null,Le=(ve=wB(ve)).charAt(0)){case'"':case"'":Fe=hQ(ve.substring(1),Le);break;default:Fe=dQ(ve)}if(Fe===null||(Ne.push(Fe[0]),(ve=wB(Fe[1]))!==""&&ve.charAt(0)!==","))return xd;ve=ve.replace(/^,/,"")}return Ne})(Ve);if(this.fontFaces){var Ye=(function(fe,Le){var Fe=fe.getFontList(),Ne=JSON.stringify(Fe);if(le===null||Be!==Ne){var ve=(function(Qe){var De=[];return Object.keys(Qe).forEach(function(it){Qe[it].forEach(function(et){var Ge=null;switch(et){case"bold":Ge={family:it,weight:"bold"};break;case"italic":Ge={family:it,style:"italic"};break;case"bolditalic":Ge={family:it,weight:"bold",style:"italic"};break;case"":case"normal":Ge={family:it}}Ge!==null&&(Ge.ref={name:it,style:et},De.push(Ge))})}),De})(Fe);le=(function(Qe){for(var De={},it=0;it<Qe.length;++it){var et=bd(Qe[it]),Ge=et.family,At=et.stretch,nt=et.style,tt=et.weight;De[Ge]=De[Ge]||{},De[Ge][At]=De[Ge][At]||{},De[Ge][At][nt]=De[Ge][At][nt]||{},De[Ge][At][nt][tt]=et}return De})(ve.concat(Le)),Be=Ne}return le})(this.pdf,this.fontFaces),xe=ze.map(function(fe){return{family:fe,stretch:"normal",weight:Re,style:Ue}}),Oe=(function(fe,Le,Fe){for(var Ne=(Fe=Fe||{}).defaultFontFamily||"times",ve=Object.assign({},fQ,Fe.genericFontFamilies||{}),Qe=null,De=null,it=0;it<Le.length;++it)if(ve[(Qe=bd(Le[it])).family]&&(Qe.family=ve[Qe.family]),fe.hasOwnProperty(Qe.family)){De=fe[Qe.family];break}if(!(De=De||fe[Ne]))throw new Error("Could not find a font-family for the rule '"+mB(Qe)+"' and default family '"+Ne+"'.");if(De=(function(et,Ge){if(Ge[et])return Ge[et];var At=Bd[et],nt=At<=Bd.normal?-1:1,tt=pB(Ge,dB,At,nt);if(!tt)throw new Error("Could not find a matching font-stretch value for "+et);return tt})(Qe.stretch,De),De=(function(et,Ge){if(Ge[et])return Ge[et];for(var At=hB[et],nt=0;nt<At.length;++nt)if(Ge[At[nt]])return Ge[At[nt]];throw new Error("Could not find a matching font-style for "+et)})(Qe.style,De),!(De=(function(et,Ge){if(Ge[et])return Ge[et];if(et===400&&Ge[500])return Ge[500];if(et===500&&Ge[400])return Ge[400];var At=cQ[et],nt=pB(Ge,gB,At,et<400?-1:1);if(!nt)throw new Error("Could not find a matching font-weight for value "+et);return nt})(Qe.weight,De)))throw new Error("Failed to resolve a font for the rule '"+mB(Qe)+"'.");return De})(Ye,xe);this.pdf.setFont(Oe.ref.name,Oe.ref.style)}else{var je="";(Re==="bold"||parseInt(Re,10)>=700||Ue==="bold")&&(je="bold"),Ue==="italic"&&(je+="italic"),je.length===0&&(je="normal");for(var ge="",Pe={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Te=0;Te<ze.length;Te++){if(this.pdf.internal.getFont(ze[Te],je,{noFallback:!0,disableWarning:!0})!==void 0){ge=ze[Te];break}if(je==="bolditalic"&&this.pdf.internal.getFont(ze[Te],"bold",{noFallback:!0,disableWarning:!0})!==void 0)ge=ze[Te],je="bold";else if(this.pdf.internal.getFont(ze[Te],"normal",{noFallback:!0,disableWarning:!0})!==void 0){ge=ze[Te],je="normal";break}}if(ge===""){for(var ue=0;ue<ze.length;ue++)if(Pe[ze[ue]]){ge=Pe[ze[ue]];break}}ge=ge===""?"Times":ge,this.pdf.setFont(ge,je)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(R){this.ctx.globalCompositeOperation=R}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(R){this.ctx.globalAlpha=R}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(R){this.ctx.lineDashOffset=R,k.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(R){this.ctx.lineDash=R,k.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(R){this.ctx.ignoreClearRect=!!R}})};f.prototype.setLineDash=function(I){this.lineDash=I},f.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},f.prototype.fill=function(){E.call(this,"fill",!1)},f.prototype.stroke=function(){E.call(this,"stroke",!1)},f.prototype.beginPath=function(){this.path=[{type:"begin"}]},f.prototype.moveTo=function(I,P){if(isNaN(I)||isNaN(P))throw $t.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var K=this.ctx.transform.applyToPoint(new s(I,P));this.path.push({type:"mt",x:K.x,y:K.y}),this.ctx.lastPoint=new s(I,P)},f.prototype.closePath=function(){var I=new s(0,0),P=0;for(P=this.path.length-1;P!==-1;P--)if(this.path[P].type==="begin"&&Dt(this.path[P+1])==="object"&&typeof this.path[P+1].x=="number"){I=new s(this.path[P+1].x,this.path[P+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new s(I.x,I.y)},f.prototype.lineTo=function(I,P){if(isNaN(I)||isNaN(P))throw $t.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var K=this.ctx.transform.applyToPoint(new s(I,P));this.path.push({type:"lt",x:K.x,y:K.y}),this.ctx.lastPoint=new s(K.x,K.y)},f.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),E.call(this,null,!0)},f.prototype.quadraticCurveTo=function(I,P,K,Y){if(isNaN(K)||isNaN(Y)||isNaN(I)||isNaN(P))throw $t.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var J=this.ctx.transform.applyToPoint(new s(K,Y)),q=this.ctx.transform.applyToPoint(new s(I,P));this.path.push({type:"qct",x1:q.x,y1:q.y,x:J.x,y:J.y}),this.ctx.lastPoint=new s(J.x,J.y)},f.prototype.bezierCurveTo=function(I,P,K,Y,J,q){if(isNaN(J)||isNaN(q)||isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y))throw $t.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var W=this.ctx.transform.applyToPoint(new s(J,q)),te=this.ctx.transform.applyToPoint(new s(I,P)),oe=this.ctx.transform.applyToPoint(new s(K,Y));this.path.push({type:"bct",x1:te.x,y1:te.y,x2:oe.x,y2:oe.y,x:W.x,y:W.y}),this.ctx.lastPoint=new s(W.x,W.y)},f.prototype.arc=function(I,P,K,Y,J,q){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y)||isNaN(J))throw $t.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(q=!!q,!this.ctx.transform.isIdentity){var W=this.ctx.transform.applyToPoint(new s(I,P));I=W.x,P=W.y;var te=this.ctx.transform.applyToPoint(new s(0,K)),oe=this.ctx.transform.applyToPoint(new s(0,0));K=Math.sqrt(Math.pow(te.x-oe.x,2)+Math.pow(te.y-oe.y,2))}Math.abs(J-Y)>=2*Math.PI&&(Y=0,J=2*Math.PI),this.path.push({type:"arc",x:I,y:P,radius:K,startAngle:Y,endAngle:J,counterclockwise:q})},f.prototype.arcTo=function(I,P,K,Y,J){throw new Error("arcTo not implemented.")},f.prototype.rect=function(I,P,K,Y){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y))throw $t.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(I,P),this.lineTo(I+K,P),this.lineTo(I+K,P+Y),this.lineTo(I,P+Y),this.lineTo(I,P),this.lineTo(I+K,P),this.lineTo(I,P)},f.prototype.fillRect=function(I,P,K,Y){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y))throw $t.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!c.call(this)){var J={};this.lineCap!=="butt"&&(J.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(J.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(I,P,K,Y),this.fill(),J.hasOwnProperty("lineCap")&&(this.lineCap=J.lineCap),J.hasOwnProperty("lineJoin")&&(this.lineJoin=J.lineJoin)}},f.prototype.strokeRect=function(I,P,K,Y){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y))throw $t.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");g.call(this)||(this.beginPath(),this.rect(I,P,K,Y),this.stroke())},f.prototype.clearRect=function(I,P,K,Y){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y))throw $t.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(I,P,K,Y))},f.prototype.save=function(I){I=typeof I!="boolean"||I;for(var P=this.pdf.internal.getCurrentPageInfo().pageNumber,K=0;K<this.pdf.internal.getNumberOfPages();K++)this.pdf.setPage(K+1),this.pdf.internal.out("q");if(this.pdf.setPage(P),I){this.ctx.fontSize=this.pdf.internal.getFontSize();var Y=new u(this.ctx);this.ctxStack.push(this.ctx),this.ctx=Y}},f.prototype.restore=function(I){I=typeof I!="boolean"||I;for(var P=this.pdf.internal.getCurrentPageInfo().pageNumber,K=0;K<this.pdf.internal.getNumberOfPages();K++)this.pdf.setPage(K+1),this.pdf.internal.out("Q");this.pdf.setPage(P),I&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},f.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var h=function(I){var P,K,Y,J;if(I.isCanvasGradient===!0&&(I=I.getColor()),!I)return{r:0,g:0,b:0,a:0,style:I};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(I))P=0,K=0,Y=0,J=0;else{var q=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(I);if(q!==null)P=parseInt(q[1]),K=parseInt(q[2]),Y=parseInt(q[3]),J=1;else if((q=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(I))!==null)P=parseInt(q[1]),K=parseInt(q[2]),Y=parseInt(q[3]),J=parseFloat(q[4]);else{if(J=1,typeof I=="string"&&I.charAt(0)!=="#"){var W=new tB(I);I=W.ok?W.toHex():"#000000"}I.length===4?(P=I.substring(1,2),P+=P,K=I.substring(2,3),K+=K,Y=I.substring(3,4),Y+=Y):(P=I.substring(1,3),K=I.substring(3,5),Y=I.substring(5,7)),P=parseInt(P,16),K=parseInt(K,16),Y=parseInt(Y,16)}}return{r:P,g:K,b:Y,a:J,style:I}},c=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},g=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};f.prototype.fillText=function(I,P,K,Y){if(isNaN(P)||isNaN(K)||typeof I!="string")throw $t.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(Y=isNaN(Y)?void 0:Y,!c.call(this)){var J=Z(this.ctx.transform.rotation),q=this.ctx.transform.scaleX;O.call(this,{text:I,x:P,y:K,scale:q,angle:J,align:this.textAlign,maxWidth:Y})}},f.prototype.strokeText=function(I,P,K,Y){if(isNaN(P)||isNaN(K)||typeof I!="string")throw $t.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!g.call(this)){Y=isNaN(Y)?void 0:Y;var J=Z(this.ctx.transform.rotation),q=this.ctx.transform.scaleX;O.call(this,{text:I,x:P,y:K,scale:q,renderingMode:"stroke",angle:J,align:this.textAlign,maxWidth:Y})}},f.prototype.measureText=function(I){if(typeof I!="string")throw $t.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var P=this.pdf,K=this.pdf.internal.scaleFactor,Y=P.internal.getFontSize(),J=P.getStringUnitWidth(I)*Y/P.internal.scaleFactor;return new function(q){var W=(q=q||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return W}}),this}({width:J*=Math.round(96*K/72*1e4)/1e4})},f.prototype.scale=function(I,P){if(isNaN(I)||isNaN(P))throw $t.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var K=new o(I,0,0,P,0,0);this.ctx.transform=this.ctx.transform.multiply(K)},f.prototype.rotate=function(I){if(isNaN(I))throw $t.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var P=new o(Math.cos(I),Math.sin(I),-Math.sin(I),Math.cos(I),0,0);this.ctx.transform=this.ctx.transform.multiply(P)},f.prototype.translate=function(I,P){if(isNaN(I)||isNaN(P))throw $t.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var K=new o(1,0,0,1,I,P);this.ctx.transform=this.ctx.transform.multiply(K)},f.prototype.transform=function(I,P,K,Y,J,q){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y)||isNaN(J)||isNaN(q))throw $t.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var W=new o(I,P,K,Y,J,q);this.ctx.transform=this.ctx.transform.multiply(W)},f.prototype.setTransform=function(I,P,K,Y,J,q){I=isNaN(I)?1:I,P=isNaN(P)?0:P,K=isNaN(K)?0:K,Y=isNaN(Y)?1:Y,J=isNaN(J)?0:J,q=isNaN(q)?0:q,this.ctx.transform=new o(I,P,K,Y,J,q)};var p=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};f.prototype.drawImage=function(I,P,K,Y,J,q,W,te,oe){var we=this.pdf.getImageProperties(I),le=1,Be=1,ye=1,R=1;Y!==void 0&&te!==void 0&&(ye=te/Y,R=oe/J,le=we.width/Y*te/Y,Be=we.height/J*oe/J),q===void 0&&(q=P,W=K,P=0,K=0),Y!==void 0&&te===void 0&&(te=Y,oe=J),Y===void 0&&te===void 0&&(te=we.width,oe=we.height);var Ie=this.ctx.transform.decompose(),Ue=Z(Ie.rotate.shx),Re=new o,Ee=(Re=(Re=(Re=Re.multiply(Ie.translate)).multiply(Ie.skew)).multiply(Ie.scale)).applyToRectangle(new a(q-P*ye,W-K*R,Y*le,J*Be));if(this.autoPaging){for(var Ve,Me=y.call(this,Ee),ze=[],Ye=0;Ye<Me.length;Ye+=1)ze.indexOf(Me[Ye])===-1&&ze.push(Me[Ye]);x(ze);for(var xe=ze[0],Oe=ze[ze.length-1],je=xe;je<Oe+1;je++){this.pdf.setPage(je);var ge=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Pe=je===1?this.posY+this.margin[0]:this.margin[0],Te=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ue=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],fe=je===1?0:Te+(je-2)*ue;if(this.ctx.clip_path.length!==0){var Le=this.path;Ve=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=B(Ve,this.posX+this.margin[3],-fe+Pe+this.ctx.prevPageLastElemOffset),Q.call(this,"fill",!0),this.path=Le}var Fe=JSON.parse(JSON.stringify(Ee));Fe=B([Fe],this.posX+this.margin[3],-fe+Pe+this.ctx.prevPageLastElemOffset)[0];var Ne=(je>xe||je<Oe)&&p.call(this);Ne&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ge,ue,null).clip().discardPath()),this.pdf.addImage(I,"JPEG",Fe.x,Fe.y,Fe.w,Fe.h,null,null,Ue),Ne&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(I,"JPEG",Ee.x,Ee.y,Ee.w,Ee.h,null,null,Ue)};var y=function(I,P,K){var Y=[];P=P||this.pdf.internal.pageSize.width,K=K||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var J=this.posY+this.ctx.prevPageLastElemOffset;switch(I.type){default:case"mt":case"lt":Y.push(Math.floor((I.y+J)/K)+1);break;case"arc":Y.push(Math.floor((I.y+J-I.radius)/K)+1),Y.push(Math.floor((I.y+J+I.radius)/K)+1);break;case"qct":var q=Ae(this.ctx.lastPoint.x,this.ctx.lastPoint.y,I.x1,I.y1,I.x,I.y);Y.push(Math.floor((q.y+J)/K)+1),Y.push(Math.floor((q.y+q.h+J)/K)+1);break;case"bct":var W=V(this.ctx.lastPoint.x,this.ctx.lastPoint.y,I.x1,I.y1,I.x2,I.y2,I.x,I.y);Y.push(Math.floor((W.y+J)/K)+1),Y.push(Math.floor((W.y+W.h+J)/K)+1);break;case"rect":Y.push(Math.floor((I.y+J)/K)+1),Y.push(Math.floor((I.y+I.h+J)/K)+1)}for(var te=0;te<Y.length;te+=1)for(;this.pdf.internal.getNumberOfPages()<Y[te];)w.call(this);return Y},w=function(){var I=this.fillStyle,P=this.strokeStyle,K=this.font,Y=this.lineCap,J=this.lineWidth,q=this.lineJoin;this.pdf.addPage(),this.fillStyle=I,this.strokeStyle=P,this.font=K,this.lineCap=Y,this.lineWidth=J,this.lineJoin=q},B=function(I,P,K){for(var Y=0;Y<I.length;Y++)switch(I[Y].type){case"bct":I[Y].x2+=P,I[Y].y2+=K;case"qct":I[Y].x1+=P,I[Y].y1+=K;default:I[Y].x+=P,I[Y].y+=K}return I},x=function(I){return I.sort(function(P,K){return P-K})},E=function(I,P){var K=this.fillStyle,Y=this.strokeStyle,J=this.lineCap,q=this.lineWidth,W=Math.abs(q*this.ctx.transform.scaleX),te=this.lineJoin;if(this.autoPaging){for(var oe,we,le=JSON.parse(JSON.stringify(this.path)),Be=JSON.parse(JSON.stringify(this.path)),ye=[],R=0;R<Be.length;R++)if(Be[R].x!==void 0)for(var Ie=y.call(this,Be[R]),Ue=0;Ue<Ie.length;Ue+=1)ye.indexOf(Ie[Ue])===-1&&ye.push(Ie[Ue]);for(var Re=0;Re<ye.length;Re++)for(;this.pdf.internal.getNumberOfPages()<ye[Re];)w.call(this);x(ye);for(var Ee=ye[0],Ve=ye[ye.length-1],Me=Ee;Me<Ve+1;Me++){this.pdf.setPage(Me),this.fillStyle=K,this.strokeStyle=Y,this.lineCap=J,this.lineWidth=W,this.lineJoin=te;var ze=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ye=Me===1?this.posY+this.margin[0]:this.margin[0],xe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Oe=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],je=Me===1?0:xe+(Me-2)*Oe;if(this.ctx.clip_path.length!==0){var ge=this.path;oe=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=B(oe,this.posX+this.margin[3],-je+Ye+this.ctx.prevPageLastElemOffset),Q.call(this,I,!0),this.path=ge}if(we=JSON.parse(JSON.stringify(le)),this.path=B(we,this.posX+this.margin[3],-je+Ye+this.ctx.prevPageLastElemOffset),P===!1||Me===0){var Pe=(Me>Ee||Me<Ve)&&p.call(this);Pe&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ze,Oe,null).clip().discardPath()),Q.call(this,I,P),Pe&&this.pdf.restoreGraphicsState()}this.lineWidth=q}this.path=le}else this.lineWidth=W,Q.call(this,I,P),this.lineWidth=q},Q=function(I,P){if((I!=="stroke"||P||!g.call(this))&&(I==="stroke"||P||!c.call(this))){for(var K,Y,J=[],q=this.path,W=0;W<q.length;W++){var te=q[W];switch(te.type){case"begin":J.push({begin:!0});break;case"close":J.push({close:!0});break;case"mt":J.push({start:te,deltas:[],abs:[]});break;case"lt":var oe=J.length;if(q[W-1]&&!isNaN(q[W-1].x)&&(K=[te.x-q[W-1].x,te.y-q[W-1].y],oe>0)){for(;oe>=0;oe--)if(J[oe-1].close!==!0&&J[oe-1].begin!==!0){J[oe-1].deltas.push(K),J[oe-1].abs.push(te);break}}break;case"bct":K=[te.x1-q[W-1].x,te.y1-q[W-1].y,te.x2-q[W-1].x,te.y2-q[W-1].y,te.x-q[W-1].x,te.y-q[W-1].y],J[J.length-1].deltas.push(K);break;case"qct":var we=q[W-1].x+2/3*(te.x1-q[W-1].x),le=q[W-1].y+2/3*(te.y1-q[W-1].y),Be=te.x+2/3*(te.x1-te.x),ye=te.y+2/3*(te.y1-te.y),R=te.x,Ie=te.y;K=[we-q[W-1].x,le-q[W-1].y,Be-q[W-1].x,ye-q[W-1].y,R-q[W-1].x,Ie-q[W-1].y],J[J.length-1].deltas.push(K);break;case"arc":J.push({deltas:[],abs:[],arc:!0}),Array.isArray(J[J.length-1].abs)&&J[J.length-1].abs.push(te)}}Y=P?null:I==="stroke"?"stroke":"fill";for(var Ue=!1,Re=0;Re<J.length;Re++)if(J[Re].arc)for(var Ee=J[Re].abs,Ve=0;Ve<Ee.length;Ve++){var Me=Ee[Ve];Me.type==="arc"?T.call(this,Me.x,Me.y,Me.radius,Me.startAngle,Me.endAngle,Me.counterclockwise,void 0,P,!Ue):M.call(this,Me.x,Me.y),Ue=!0}else if(J[Re].close===!0)this.pdf.internal.out("h"),Ue=!1;else if(J[Re].begin!==!0){var ze=J[Re].start.x,Ye=J[Re].start.y;C.call(this,J[Re].deltas,ze,Ye),Ue=!0}Y&&_.call(this,Y),P&&D.call(this)}},L=function(I){var P=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,K=P*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return I-K;case"top":return I+P-K;case"hanging":return I+P-2*K;case"middle":return I+P/2-K;default:return I}},S=function(I){return I+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};f.prototype.createLinearGradient=function(){var I=function(){};return I.colorStops=[],I.addColorStop=function(P,K){this.colorStops.push([P,K])},I.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},I.isCanvasGradient=!0,I},f.prototype.createPattern=function(){return this.createLinearGradient()},f.prototype.createRadialGradient=function(){return this.createLinearGradient()};var T=function(I,P,K,Y,J,q,W,te,oe){for(var we=re.call(this,K,Y,J,q),le=0;le<we.length;le++){var Be=we[le];le===0&&(oe?U.call(this,Be.x1+I,Be.y1+P):M.call(this,Be.x1+I,Be.y1+P)),z.call(this,I,P,Be.x2,Be.y2,Be.x3,Be.y3,Be.x4,Be.y4)}te?D.call(this):_.call(this,W)},_=function(I){switch(I){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},D=function(){this.pdf.clip(),this.pdf.discardPath()},U=function(I,P){this.pdf.internal.out(t(I)+" "+A(P)+" m")},O=function(I){var P;switch(I.align){case"right":case"end":P="right";break;case"center":P="center";break;default:P="left"}var K,Y,J,q=this.pdf.getTextDimensions(I.text),W=L.call(this,I.y),te=S.call(this,W)-q.h,oe=this.ctx.transform.applyToPoint(new s(I.x,W));if(this.autoPaging){var we=this.ctx.transform.decompose(),le=new o;le=(le=(le=le.multiply(we.translate)).multiply(we.skew)).multiply(we.scale);for(var Be=this.ctx.transform.applyToRectangle(new a(I.x,W,q.w,q.h)),ye=le.applyToRectangle(new a(I.x,te,q.w,q.h)),R=y.call(this,ye),Ie=[],Ue=0;Ue<R.length;Ue+=1)Ie.indexOf(R[Ue])===-1&&Ie.push(R[Ue]);x(Ie);for(var Re=Ie[0],Ee=Ie[Ie.length-1],Ve=Re;Ve<Ee+1;Ve++){this.pdf.setPage(Ve);var Me=Ve===1?this.posY+this.margin[0]:this.margin[0],ze=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ye=this.pdf.internal.pageSize.height-this.margin[2],xe=Ye-this.margin[0],Oe=this.pdf.internal.pageSize.width-this.margin[1],je=Oe-this.margin[3],ge=Ve===1?0:ze+(Ve-2)*xe;if(this.ctx.clip_path.length!==0){var Pe=this.path;K=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=B(K,this.posX+this.margin[3],-1*ge+Me),Q.call(this,"fill",!0),this.path=Pe}var Te=B([JSON.parse(JSON.stringify(ye))],this.posX+this.margin[3],-ge+Me+this.ctx.prevPageLastElemOffset)[0];I.scale>=.01&&(Y=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Y*I.scale),J=this.lineWidth,this.lineWidth=J*I.scale);var ue=this.autoPaging!=="text";if(ue||Te.y+Te.h<=Ye){if(ue||Te.y>=Me&&Te.x<=Oe){var fe=ue?I.text:this.pdf.splitTextToSize(I.text,I.maxWidth||Oe-Te.x)[0],Le=B([JSON.parse(JSON.stringify(Be))],this.posX+this.margin[3],-ge+Me+this.ctx.prevPageLastElemOffset)[0],Fe=ue&&(Ve>Re||Ve<Ee)&&p.call(this);Fe&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],je,xe,null).clip().discardPath()),this.pdf.text(fe,Le.x,Le.y,{angle:I.angle,align:P,renderingMode:I.renderingMode}),Fe&&this.pdf.restoreGraphicsState()}}else Te.y<Ye&&(this.ctx.prevPageLastElemOffset+=Ye-Te.y);I.scale>=.01&&(this.pdf.setFontSize(Y),this.lineWidth=J)}}else I.scale>=.01&&(Y=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Y*I.scale),J=this.lineWidth,this.lineWidth=J*I.scale),this.pdf.text(I.text,oe.x+this.posX,oe.y+this.posY,{angle:I.angle,align:P,renderingMode:I.renderingMode,maxWidth:I.maxWidth}),I.scale>=.01&&(this.pdf.setFontSize(Y),this.lineWidth=J)},M=function(I,P,K,Y){K=K||0,Y=Y||0,this.pdf.internal.out(t(I+K)+" "+A(P+Y)+" l")},C=function(I,P,K){return this.pdf.lines(I,P,K,null,null)},z=function(I,P,K,Y,J,q,W,te){this.pdf.internal.out([e(n(K+I)),e(i(Y+P)),e(n(J+I)),e(i(q+P)),e(n(W+I)),e(i(te+P)),"c"].join(" "))},re=function(I,P,K,Y){for(var J=2*Math.PI,q=Math.PI/2;P>K;)P-=J;var W=Math.abs(K-P);W<J&&Y&&(W=J-W);for(var te=[],oe=Y?-1:1,we=P;W>1e-5;){var le=we+oe*Math.min(W,q);te.push(ne.call(this,I,we,le)),W-=Math.abs(le-we),we=le}return te},ne=function(I,P,K){var Y=(K-P)/2,J=I*Math.cos(Y),q=I*Math.sin(Y),W=J,te=-q,oe=W*W+te*te,we=oe+W*J+te*q,le=4/3*(Math.sqrt(2*oe*we)-we)/(W*q-te*J),Be=W-le*te,ye=te+le*W,R=Be,Ie=-ye,Ue=Y+P,Re=Math.cos(Ue),Ee=Math.sin(Ue);return{x1:I*Math.cos(P),y1:I*Math.sin(P),x2:Be*Re-ye*Ee,y2:Be*Ee+ye*Re,x3:R*Re-Ie*Ee,y3:R*Ee+Ie*Re,x4:I*Math.cos(K),y4:I*Math.sin(K)}},Z=function(I){return 180*I/Math.PI},Ae=function(I,P,K,Y,J,q){var W=I+.5*(K-I),te=P+.5*(Y-P),oe=J+.5*(K-J),we=q+.5*(Y-q),le=Math.min(I,J,W,oe),Be=Math.max(I,J,W,oe),ye=Math.min(P,q,te,we),R=Math.max(P,q,te,we);return new a(le,ye,Be-le,R-ye)},V=function(I,P,K,Y,J,q,W,te){var oe,we,le,Be,ye,R,Ie,Ue,Re,Ee,Ve,Me,ze,Ye,xe=K-I,Oe=Y-P,je=J-K,ge=q-Y,Pe=W-J,Te=te-q;for(we=0;we<41;we++)Re=(Ie=(le=I+(oe=we/40)*xe)+oe*((ye=K+oe*je)-le))+oe*(ye+oe*(J+oe*Pe-ye)-Ie),Ee=(Ue=(Be=P+oe*Oe)+oe*((R=Y+oe*ge)-Be))+oe*(R+oe*(q+oe*Te-R)-Ue),we==0?(Ve=Re,Me=Ee,ze=Re,Ye=Ee):(Ve=Math.min(Ve,Re),Me=Math.min(Me,Ee),ze=Math.max(ze,Re),Ye=Math.max(Ye,Ee));return new a(Math.round(Ve),Math.round(Me),Math.round(ze-Ve),Math.round(Ye-Me))},k=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var I,P,K=(I=this.ctx.lineDash,P=this.ctx.lineDashOffset,JSON.stringify({lineDash:I,lineDashOffset:P}));this.prevLineDash!==K&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=K)}}})(pt.API),(function(r){var e=function(s){var a,o,l,u,f,h,c,g,p,y;for(o=[],l=0,u=(s+=a="\0\0\0\0".slice(s.length%4||4)).length;u>l;l+=4)(f=(s.charCodeAt(l)<<24)+(s.charCodeAt(l+1)<<16)+(s.charCodeAt(l+2)<<8)+s.charCodeAt(l+3))!==0?(h=(f=((f=((f=((f=(f-(y=f%85))/85)-(p=f%85))/85)-(g=f%85))/85)-(c=f%85))/85)%85,o.push(h+33,c+33,g+33,p+33,y+33)):o.push(122);return(function(w,B){for(var x=B;x>0;x--)w.pop()})(o,a.length),String.fromCharCode.apply(String,o)+"~>"},t=function(s){var a,o,l,u,f,h=String,c="length",g=255,p="charCodeAt",y="slice",w="replace";for(s[y](-2),s=s[y](0,-2)[w](/\s/g,"")[w]("z","!!!!!"),l=[],u=0,f=(s+=a="uuuuu"[y](s[c]%5||5))[c];f>u;u+=5)o=52200625*(s[p](u)-33)+614125*(s[p](u+1)-33)+7225*(s[p](u+2)-33)+85*(s[p](u+3)-33)+(s[p](u+4)-33),l.push(g&o>>24,g&o>>16,g&o>>8,g&o);return(function(B,x){for(var E=x;E>0;E--)B.pop()})(l,a[c]),h.fromCharCode.apply(h,l)},A=function(s){return s.split("").map(function(a){return("0"+a.charCodeAt().toString(16)).slice(-2)}).join("")+">"},n=function(s){var a=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((s=s.replace(/\s/g,"")).indexOf(">")!==-1&&(s=s.substr(0,s.indexOf(">"))),s.length%2&&(s+="0"),a.test(s)===!1)return"";for(var o="",l=0;l<s.length;l+=2)o+=String.fromCharCode("0x"+(s[l]+s[l+1]));return o},i=function(s){for(var a=new Uint8Array(s.length),o=s.length;o--;)a[o]=s.charCodeAt(o);return(a=Yh(a)).reduce(function(l,u){return l+String.fromCharCode(u)},"")};r.processDataByFilters=function(s,a){var o=0,l=s||"",u=[];for(typeof(a=a||[])=="string"&&(a=[a]),o=0;o<a.length;o+=1)switch(a[o]){case"ASCII85Decode":case"/ASCII85Decode":l=t(l),u.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":l=e(l),u.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":l=n(l),u.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":l=A(l),u.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":l=i(l),u.push("/FlateDecode");break;default:throw new Error('The filter: "'+a[o]+'" is not implemented')}return{data:l,reverseChain:u.reverse().join(" ")}}})(pt.API),(function(r){r.loadFile=function(e,t,A){return(function(n,i,s){i=i!==!1,s=typeof s=="function"?s:function(){};var a=void 0;try{a=(function(o,l,u){var f=new XMLHttpRequest,h=0,c=function(g){var p=g.length,y=[],w=String.fromCharCode;for(h=0;h<p;h+=1)y.push(w(255&g.charCodeAt(h)));return y.join("")};if(f.open("GET",o,!l),f.overrideMimeType("text/plain; charset=x-user-defined"),l===!1&&(f.onload=function(){f.status===200?u(c(this.responseText)):u(void 0)}),f.send(null),l&&f.status===200)return c(f.responseText)})(n,i,s)}catch{}return a})(e,t,A)},r.allowFsRead=void 0,r.loadImageFile=r.loadFile})(pt.API),(function(r){function e(){return(bt.html2canvas?Promise.resolve(bt.html2canvas):Promise.resolve().then(()=>nP)).catch(function(a){return Promise.reject(new Error("Could not load html2canvas: "+a))}).then(function(a){return a.default?a.default:a})}function t(){return(bt.DOMPurify?Promise.resolve(bt.DOMPurify):Promise.resolve().then(()=>RP)).catch(function(a){return Promise.reject(new Error("Could not load dompurify: "+a))}).then(function(a){return a.default?a.default:a})}var A=function(a){var o=Dt(a);return o==="undefined"?"undefined":o==="string"||a instanceof String?"string":o==="number"||a instanceof Number?"number":o==="function"||a instanceof Function?"function":a&&a.constructor===Array?"array":a&&a.nodeType===1?"element":o==="object"?"object":"unknown"},n=function(a,o){var l=document.createElement(a);for(var u in o.className&&(l.className=o.className),o.innerHTML&&o.dompurify&&(l.innerHTML=o.dompurify.sanitize(o.innerHTML)),o.style)l.style[u]=o.style[u];return l},i=function a(o,l){for(var u=o.nodeType===3?document.createTextNode(o.nodeValue):o.cloneNode(!1),f=o.firstChild;f;f=f.nextSibling)l!==!0&&f.nodeType===1&&f.nodeName==="SCRIPT"||u.appendChild(a(f,l));return o.nodeType===1&&(o.nodeName==="CANVAS"?(u.width=o.width,u.height=o.height,u.getContext("2d").drawImage(o,0,0)):o.nodeName!=="TEXTAREA"&&o.nodeName!=="SELECT"||(u.value=o.value),u.addEventListener("load",function(){u.scrollTop=o.scrollTop,u.scrollLeft=o.scrollLeft},!0)),u},s=function a(o){var l=Object.assign(a.convert(Promise.resolve()),JSON.parse(JSON.stringify(a.template))),u=a.convert(Promise.resolve(),l);return(u=u.setProgress(1,a,1,[a])).set(o)};(s.prototype=Object.create(Promise.prototype)).constructor=s,s.convert=function(a,o){return a.__proto__=o||s.prototype,a},s.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},s.prototype.from=function(a,o){return this.then(function(){switch(o=o||(function(l){switch(A(l)){case"string":return"string";case"element":return l.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}})(a),o){case"string":return this.then(t).then(function(l){return this.set({src:n("div",{innerHTML:a,dompurify:l})})});case"element":return this.set({src:a});case"canvas":return this.set({canvas:a});case"img":return this.set({img:a});default:return this.error("Unknown source type.")}})},s.prototype.to=function(a){switch(a){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},s.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var a={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},o=i(this.prop.src,this.opt.html2canvas.javascriptEnabled);o.tagName==="BODY"&&(a.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=n("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=n("div",{className:"html2pdf__container",style:a}),this.prop.container.appendChild(o),this.prop.container.firstChild.appendChild(n("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},s.prototype.toCanvas=function(){var a=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(a).then(e).then(function(o){var l=Object.assign({},this.opt.html2canvas);return delete l.onrendered,o(this.prop.container,l)}).then(function(o){(this.opt.html2canvas.onrendered||function(){})(o),this.prop.canvas=o,document.body.removeChild(this.prop.overlay)})},s.prototype.toContext2d=function(){var a=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(a).then(e).then(function(o){var l=this.opt.jsPDF,u=this.opt.fontFaces,f=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,h=Object.assign({async:!0,allowTaint:!0,scale:f,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete h.onrendered,l.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,l.context2d.posX=this.opt.x,l.context2d.posY=this.opt.y,l.context2d.margin=this.opt.margin,l.context2d.fontFaces=u,u)for(var c=0;c<u.length;++c){var g=u[c],p=g.src.find(function(y){return y.format==="truetype"});p&&l.addFont(p.url,g.ref.name,g.ref.style)}return h.windowHeight=h.windowHeight||0,h.windowHeight=h.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):h.windowHeight,l.context2d.save(!0),o(this.prop.container,h)}).then(function(o){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(o),this.prop.canvas=o,document.body.removeChild(this.prop.overlay)})},s.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var a=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=a})},s.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},s.prototype.output=function(a,o,l){return(l=l||"pdf").toLowerCase()==="img"||l.toLowerCase()==="image"?this.outputImg(a,o):this.outputPdf(a,o)},s.prototype.outputPdf=function(a,o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(a,o)})},s.prototype.outputImg=function(a){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(a){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+a+'" is not supported.'}})},s.prototype.save=function(a){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(a?{filename:a}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},s.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},s.prototype.set=function(a){if(A(a)!=="object")return this;var o=Object.keys(a||{}).map(function(l){if(l in s.template.prop)return function(){this.prop[l]=a[l]};switch(l){case"margin":return this.setMargin.bind(this,a.margin);case"jsPDF":return function(){return this.opt.jsPDF=a.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,a.pageSize);default:return function(){this.opt[l]=a[l]}}},this);return this.then(function(){return this.thenList(o)})},s.prototype.get=function(a,o){return this.then(function(){var l=a in s.template.prop?this.prop[a]:this.opt[a];return o?o(l):l})},s.prototype.setMargin=function(a){return this.then(function(){switch(A(a)){case"number":a=[a,a,a,a];case"array":if(a.length===2&&(a=[a[0],a[1],a[0],a[1]]),a.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=a}).then(this.setPageSize)},s.prototype.setPageSize=function(a){function o(l,u){return Math.floor(l*u/72*96)}return this.then(function(){(a=a||pt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(a.inner={width:a.width-this.opt.margin[1]-this.opt.margin[3],height:a.height-this.opt.margin[0]-this.opt.margin[2]},a.inner.px={width:o(a.inner.width,a.k),height:o(a.inner.height,a.k)},a.inner.ratio=a.inner.height/a.inner.width),this.prop.pageSize=a})},s.prototype.setProgress=function(a,o,l,u){return a!=null&&(this.progress.val=a),o!=null&&(this.progress.state=o),l!=null&&(this.progress.n=l),u!=null&&(this.progress.stack=u),this.progress.ratio=this.progress.val/this.progress.state,this},s.prototype.updateProgress=function(a,o,l,u){return this.setProgress(a?this.progress.val+a:null,o||null,l?this.progress.n+l:null,u?this.progress.stack.concat(u):null)},s.prototype.then=function(a,o){var l=this;return this.thenCore(a,o,function(u,f){return l.updateProgress(null,null,1,[u]),Promise.prototype.then.call(this,function(h){return l.updateProgress(null,u),h}).then(u,f).then(function(h){return l.updateProgress(1),h})})},s.prototype.thenCore=function(a,o,l){l=l||Promise.prototype.then;var u=this;a&&(a=a.bind(u)),o&&(o=o.bind(u));var f=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?u:s.convert(Object.assign({},u),Promise.prototype),h=l.call(f,a,o);return s.convert(h,u.__proto__)},s.prototype.thenExternal=function(a,o){return Promise.prototype.then.call(this,a,o)},s.prototype.thenList=function(a){var o=this;return a.forEach(function(l){o=o.thenCore(l)}),o},s.prototype.catch=function(a){a&&(a=a.bind(this));var o=Promise.prototype.catch.call(this,a);return s.convert(o,this)},s.prototype.catchExternal=function(a){return Promise.prototype.catch.call(this,a)},s.prototype.error=function(a){return this.then(function(){throw new Error(a)})},s.prototype.using=s.prototype.set,s.prototype.saveAs=s.prototype.save,s.prototype.export=s.prototype.output,s.prototype.run=s.prototype.then,pt.getPageSize=function(a,o,l){if(Dt(a)==="object"){var u=a;a=u.orientation,o=u.unit||o,l=u.format||l}o=o||"mm",l=l||"a4",a=(""+(a||"P")).toLowerCase();var f,h=(""+l).toLowerCase(),c={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(o){case"pt":f=1;break;case"mm":f=72/25.4;break;case"cm":f=72/2.54;break;case"in":f=72;break;case"px":f=.75;break;case"pc":case"em":f=12;break;case"ex":f=6;break;default:throw"Invalid unit: "+o}var g,p=0,y=0;if(c.hasOwnProperty(h))p=c[h][1]/f,y=c[h][0]/f;else try{p=l[1],y=l[0]}catch{throw new Error("Invalid format: "+l)}if(a==="p"||a==="portrait")a="p",y>p&&(g=y,y=p,p=g);else{if(a!=="l"&&a!=="landscape")throw"Invalid orientation: "+a;a="l",p>y&&(g=y,y=p,p=g)}return{width:y,height:p,unit:o,k:f,orientation:a}},r.html=function(a,o){(o=o||{}).callback=o.callback||function(){},o.html2canvas=o.html2canvas||{},o.html2canvas.canvas=o.html2canvas.canvas||this.canvas,o.jsPDF=o.jsPDF||this,o.fontFaces=o.fontFaces?o.fontFaces.map(bd):null;var l=new s(o);return o.worker?l:l.from(a).doCallback()}})(pt.API),pt.API.addJS=function(r){return BB=r,this.internal.events.subscribe("postPutResources",function(){Ju=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Ju+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),yB=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+BB+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){Ju!==void 0&&yB!==void 0&&this.internal.out("/Names <</JavaScript "+Ju+" 0 R>>")}),this},(function(r){var e;r.events.push(["postPutResources",function(){var t=this,A=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var n=t.outline.render().split(/\r\n/),i=0;i<n.length;i++){var s=n[i],a=A.exec(s);if(a!=null){var o=a[1];t.internal.newObjectDeferredBegin(o,!1)}t.internal.write(s)}if(this.outline.createNamedDestinations){var l=this.internal.pages.length,u=[];for(i=0;i<l;i++){var f=t.internal.newObject();u.push(f);var h=t.internal.getPageInfo(i+1);t.internal.write("<< /D["+h.objId+" 0 R /XYZ null null null]>> endobj")}var c=t.internal.newObject();for(t.internal.write("<< /Names [ "),i=0;i<u.length;i++)t.internal.write("(page_"+(i+1)+")"+u[i]+" 0 R");t.internal.write(" ] >>","endobj"),e=t.internal.newObject(),t.internal.write("<< /Dests "+c+" 0 R"),t.internal.write(">>","endobj")}}]),r.events.push(["putCatalog",function(){var t=this;t.outline.root.children.length>0&&(t.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&t.internal.write("/Names "+e+" 0 R"))}]),r.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(A,n,i){var s={title:n,options:i,children:[]};return A==null&&(A=this.root),A.children.push(s),s},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(A){A.id=t.internal.newObjectDeferred();for(var n=0;n<A.children.length;n++)this.genIds_r(A.children[n])},t.outline.renderRoot=function(A){this.objStart(A),this.line("/Type /Outlines"),A.children.length>0&&(this.line("/First "+this.makeRef(A.children[0])),this.line("/Last "+this.makeRef(A.children[A.children.length-1]))),this.line("/Count "+this.count_r({count:0},A)),this.objEnd()},t.outline.renderItems=function(A){for(var n=this.ctx.pdf.internal.getVerticalCoordinateString,i=0;i<A.children.length;i++){var s=A.children[i];this.objStart(s),this.line("/Title "+this.makeString(s.title)),this.line("/Parent "+this.makeRef(A)),i>0&&this.line("/Prev "+this.makeRef(A.children[i-1])),i<A.children.length-1&&this.line("/Next "+this.makeRef(A.children[i+1])),s.children.length>0&&(this.line("/First "+this.makeRef(s.children[0])),this.line("/Last "+this.makeRef(s.children[s.children.length-1])));var a=this.count=this.count_r({count:0},s);if(a>0&&this.line("/Count "+a),s.options&&s.options.pageNumber){var o=t.internal.getPageInfo(s.options.pageNumber);this.line("/Dest ["+o.objId+" 0 R /XYZ 0 "+n(0)+" 0]")}this.objEnd()}for(var l=0;l<A.children.length;l++)this.renderItems(A.children[l])},t.outline.line=function(A){this.ctx.val+=A+`\r
|
|
650
|
+
*/function Cn(r,e){if(this.pos=0,this.buffer=r,this.datav=new DataView(r.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function OB(r){function e(_){if(!_)throw Error("assert :P")}function t(_,D,U){for(var O=0;4>O;O++)if(_[D+O]!=U.charCodeAt(O))return!0;return!1}function A(_,D,U,O,M){for(var C=0;C<M;C++)_[D+C]=U[O+C]}function n(_,D,U,O){for(var M=0;M<O;M++)_[D+M]=U}function i(_){return new Int32Array(_)}function s(_,D){for(var U=[],O=0;O<_;O++)U.push(new D);return U}function a(_,D){var U=[];return(function O(M,C,z){for(var re=z[C],ne=0;ne<re&&(M.push(z.length>C+1?[]:new D),!(z.length<C+1));ne++)O(M[ne],C+1,z)})(U,0,_),U}var o=function(){var _=this;function D(d,m){for(var F=1<<m-1>>>0;d&F;)F>>>=1;return F?(d&F-1)+F:d}function U(d,m,F,N,j){e(!(N%F));do d[m+(N-=F)]=j;while(0<N)}function O(d,m,F,N,j){if(e(2328>=j),512>=j)var G=i(512);else if((G=i(j))==null)return 0;return(function(X,$,ee,ie,pe,_e){var ae,me,Ce=$,ke=1<<ee,Se=i(16),He=i(16);for(e(pe!=0),e(ie!=null),e(X!=null),e(0<ee),me=0;me<pe;++me){if(15<ie[me])return 0;++Se[ie[me]]}if(Se[0]==pe)return 0;for(He[1]=0,ae=1;15>ae;++ae){if(Se[ae]>1<<ae)return 0;He[ae+1]=He[ae]+Se[ae]}for(me=0;me<pe;++me)ae=ie[me],0<ie[me]&&(_e[He[ae]++]=me);if(He[15]==1)return(ie=new M).g=0,ie.value=_e[0],U(X,Ce,1,ke,ie),ke;var qe,Ze=-1,Xe=ke-1,mt=0,ut=1,It=1,dt=1<<ee;for(me=0,ae=1,pe=2;ae<=ee;++ae,pe<<=1){if(ut+=It<<=1,0>(It-=Se[ae]))return 0;for(;0<Se[ae];--Se[ae])(ie=new M).g=ae,ie.value=_e[me++],U(X,Ce+mt,pe,dt,ie),mt=D(mt,ae)}for(ae=ee+1,pe=2;15>=ae;++ae,pe<<=1){if(ut+=It<<=1,0>(It-=Se[ae]))return 0;for(;0<Se[ae];--Se[ae]){if(ie=new M,(mt&Xe)!=Ze){for(Ce+=dt,qe=1<<(Ze=ae)-ee;15>Ze&&!(0>=(qe-=Se[Ze]));)++Ze,qe<<=1;ke+=dt=1<<(qe=Ze-ee),X[$+(Ze=mt&Xe)].g=qe+ee,X[$+Ze].value=Ce-$-Ze}ie.g=ae-ee,ie.value=_e[me++],U(X,Ce+(mt>>ee),pe,dt,ie),mt=D(mt,ae)}}return ut!=2*He[15]-1?0:ke})(d,m,F,N,j,G)}function M(){this.value=this.g=0}function C(){this.value=this.g=0}function z(){this.G=s(5,M),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=s(As,C)}function re(d,m,F,N){e(d!=null),e(m!=null),e(2147483648>N),d.Ca=254,d.I=0,d.b=-8,d.Ka=0,d.oa=m,d.pa=F,d.Jd=m,d.Yc=F+N,d.Zc=4<=N?F+N-4+1:F,W(d)}function ne(d,m){for(var F=0;0<m--;)F|=oe(d,128)<<m;return F}function Z(d,m){var F=ne(d,m);return te(d)?-F:F}function Ae(d,m,F,N){var j,G=0;for(e(d!=null),e(m!=null),e(4294967288>N),d.Sb=N,d.Ra=0,d.u=0,d.h=0,4<N&&(N=4),j=0;j<N;++j)G+=m[F+j]<<8*j;d.Ra=G,d.bb=N,d.oa=m,d.pa=F}function V(d){for(;8<=d.u&&d.bb<d.Sb;)d.Ra>>>=8,d.Ra+=d.oa[d.pa+d.bb]<<oa-8>>>0,++d.bb,d.u-=8;Y(d)&&(d.h=1,d.u=0)}function k(d,m){if(e(0<=m),!d.h&&m<=ZA){var F=K(d)&JA[m];return d.u+=m,V(d),F}return d.h=1,d.u=0}function I(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function P(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function K(d){return d.Ra>>>(d.u&oa-1)>>>0}function Y(d){return e(d.bb<=d.Sb),d.h||d.bb==d.Sb&&d.u>oa}function J(d,m){d.u=m,d.h=Y(d)}function q(d){d.u>=Qi&&(e(d.u>=Qi),V(d))}function W(d){e(d!=null&&d.oa!=null),d.pa<d.Zc?(d.I=(d.oa[d.pa++]|d.I<<8)>>>0,d.b+=8):(e(d!=null&&d.oa!=null),d.pa<d.Yc?(d.b+=8,d.I=d.oa[d.pa++]|d.I<<8):d.Ka?d.b=0:(d.I<<=8,d.b+=8,d.Ka=1))}function te(d){return ne(d,1)}function oe(d,m){var F=d.Ca;0>d.b&&W(d);var N=d.b,j=F*m>>>8,G=(d.I>>>N>j)+0;for(G?(F-=j,d.I-=j+1<<N>>>0):F=j+1,N=F,j=0;256<=N;)j+=8,N>>=8;return N=7^j+la[N],d.b-=N,d.Ca=(F<<N)-1,G}function we(d,m,F){d[m+0]=F>>24&255,d[m+1]=F>>16&255,d[m+2]=F>>8&255,d[m+3]=255&F}function le(d,m){return d[m+0]|d[m+1]<<8}function Be(d,m){return le(d,m)|d[m+2]<<16}function ye(d,m){return le(d,m)|le(d,m+2)<<16}function R(d,m){var F=1<<m;return e(d!=null),e(0<m),d.X=i(F),d.X==null?0:(d.Mb=32-m,d.Xa=m,1)}function Ie(d,m){e(d!=null),e(m!=null),e(d.Xa==m.Xa),A(m.X,0,d.X,0,1<<m.Xa)}function Ue(){this.X=[],this.Xa=this.Mb=0}function Te(d,m,F,N){e(F!=null),e(N!=null);var j=F[0],G=N[0];return j==0&&(j=(d*G+m/2)/m),G==0&&(G=(m*j+d/2)/d),0>=j||0>=G?0:(F[0]=j,N[0]=G,1)}function Ee(d,m){return d+(1<<m)-1>>>m}function Ve(d,m){return((4278255360&d)+(4278255360&m)>>>0&4278255360)+((16711935&d)+(16711935&m)>>>0&16711935)>>>0}function Me(d,m){_[m]=function(F,N,j,G,X,$,ee){var ie;for(ie=0;ie<X;++ie){var pe=_[d]($[ee+ie-1],j,G+ie);$[ee+ie]=Ve(F[N+ie],pe)}}}function ze(){this.ud=this.hd=this.jd=0}function Ye(d,m){return((4278124286&(d^m))>>>1)+(d&m)>>>0}function xe(d){return 0<=d&&256>d?d:0>d?0:255<d?255:void 0}function Oe(d,m){return xe(d+(d-m+.5>>1))}function je(d,m,F){return Math.abs(m-F)-Math.abs(d-F)}function ge(d,m,F,N,j,G,X){for(N=G[X-1],F=0;F<j;++F)G[X+F]=N=Ve(d[m+F],N)}function Re(d,m,F,N,j){var G;for(G=0;G<F;++G){var X=d[m+G],$=X>>8&255,ee=16711935&(ee=(ee=16711935&X)+(($<<16)+$));N[j+G]=(4278255360&X)+ee>>>0}}function Le(d,m){m.jd=255&d,m.hd=d>>8&255,m.ud=d>>16&255}function ue(d,m,F,N,j,G){var X;for(X=0;X<N;++X){var $=m[F+X],ee=$>>>8,ie=$,pe=255&(pe=(pe=$>>>16)+((d.jd<<24>>24)*(ee<<24>>24)>>>5));ie=255&(ie=(ie+=(d.hd<<24>>24)*(ee<<24>>24)>>>5)+((d.ud<<24>>24)*(pe<<24>>24)>>>5)),j[G+X]=(4278255360&$)+(pe<<16)+ie}}function fe(d,m,F,N,j){_[m]=function(G,X,$,ee,ie,pe,_e,ae,me){for(ee=_e;ee<ae;++ee)for(_e=0;_e<me;++_e)ie[pe++]=j($[N(G[X++])])},_[d]=function(G,X,$,ee,ie,pe,_e){var ae=8>>G.b,me=G.Ea,Ce=G.K[0],ke=G.w;if(8>ae)for(G=(1<<G.b)-1,ke=(1<<ae)-1;X<$;++X){var Se,He=0;for(Se=0;Se<me;++Se)Se&G||(He=N(ee[ie++])),pe[_e++]=j(Ce[He&ke]),He>>=ae}else _["VP8LMapColor"+F](ee,ie,Ce,ke,pe,_e,X,$,me)}}function Pe(d,m,F,N,j){for(F=m+F;m<F;){var G=d[m++];N[j++]=G>>16&255,N[j++]=G>>8&255,N[j++]=255&G}}function Fe(d,m,F,N,j){for(F=m+F;m<F;){var G=d[m++];N[j++]=G>>16&255,N[j++]=G>>8&255,N[j++]=255&G,N[j++]=G>>24&255}}function Ne(d,m,F,N,j){for(F=m+F;m<F;){var G=(X=d[m++])>>16&240|X>>12&15,X=240&X|X>>28&15;N[j++]=G,N[j++]=X}}function ve(d,m,F,N,j){for(F=m+F;m<F;){var G=(X=d[m++])>>16&248|X>>13&7,X=X>>5&224|X>>3&31;N[j++]=G,N[j++]=X}}function Qe(d,m,F,N,j){for(F=m+F;m<F;){var G=d[m++];N[j++]=255&G,N[j++]=G>>8&255,N[j++]=G>>16&255}}function De(d,m,F,N,j,G){if(G==0)for(F=m+F;m<F;)we(N,((G=d[m++])[0]>>24|G[1]>>8&65280|G[2]<<8&16711680|G[3]<<24)>>>0),j+=32;else A(N,j,d,m,F)}function it(d,m){_[m][0]=_[d+"0"],_[m][1]=_[d+"1"],_[m][2]=_[d+"2"],_[m][3]=_[d+"3"],_[m][4]=_[d+"4"],_[m][5]=_[d+"5"],_[m][6]=_[d+"6"],_[m][7]=_[d+"7"],_[m][8]=_[d+"8"],_[m][9]=_[d+"9"],_[m][10]=_[d+"10"],_[m][11]=_[d+"11"],_[m][12]=_[d+"12"],_[m][13]=_[d+"13"],_[m][14]=_[d+"0"],_[m][15]=_[d+"0"]}function et(d){return d==bv||d==xv||d==kf||d==Cv}function Ge(){this.eb=[],this.size=this.A=this.fb=0}function At(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function nt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Ge,this.f.kb=new At,this.sd=null}function tt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function lt(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function ur(d){return alert("todo:WebPSamplerProcessPlane"),d.T}function _t(d,m){var F=d.T,N=m.ba.f.RGBA,j=N.eb,G=N.fb+d.ka*N.A,X=yn[m.ba.S],$=d.y,ee=d.O,ie=d.f,pe=d.N,_e=d.ea,ae=d.W,me=m.cc,Ce=m.dc,ke=m.Mc,Se=m.Nc,He=d.ka,qe=d.ka+d.T,Ze=d.U,Xe=Ze+1>>1;for(He==0?X($,ee,null,null,ie,pe,_e,ae,ie,pe,_e,ae,j,G,null,null,Ze):(X(m.ec,m.fc,$,ee,me,Ce,ke,Se,ie,pe,_e,ae,j,G-N.A,j,G,Ze),++F);He+2<qe;He+=2)me=ie,Ce=pe,ke=_e,Se=ae,pe+=d.Rc,ae+=d.Rc,G+=2*N.A,X($,(ee+=2*d.fa)-d.fa,$,ee,me,Ce,ke,Se,ie,pe,_e,ae,j,G-N.A,j,G,Ze);return ee+=d.fa,d.j+qe<d.o?(A(m.ec,m.fc,$,ee,Ze),A(m.cc,m.dc,ie,pe,Xe),A(m.Mc,m.Nc,_e,ae,Xe),F--):1&qe||X($,ee,null,null,ie,pe,_e,ae,ie,pe,_e,ae,j,G+N.A,null,null,Ze),F}function AA(d,m,F){var N=d.F,j=[d.J];if(N!=null){var G=d.U,X=m.ba.S,$=X==Df||X==kf;m=m.ba.f.RGBA;var ee=[0],ie=d.ka;ee[0]=d.T,d.Kb&&(ie==0?--ee[0]:(--ie,j[0]-=d.width),d.j+d.ka+d.T==d.o&&(ee[0]=d.o-d.j-ie));var pe=m.eb;ie=m.fb+ie*m.A,d=fS(N,j[0],d.width,G,ee,pe,ie+($?0:3),m.A),e(F==ee),d&&et(X)&&Ul(pe,ie,$,G,ee,m.A)}return 0}function Vr(d){var m=d.ma,F=m.ba.S,N=11>F,j=F==Rf||F==Mf||F==Df||F==Bv||F==12||et(F);if(m.memory=null,m.Ib=null,m.Jb=null,m.Nd=null,!yl(m.Oa,d,j?11:12))return 0;if(j&&et(F)&&vl(),d.da)alert("todo:use_scaling");else{if(N){if(m.Ib=ur,d.Kb){if(F=d.U+1>>1,m.memory=i(d.U+2*F),m.memory==null)return 0;m.ec=m.memory,m.fc=0,m.cc=m.ec,m.dc=m.fc+d.U,m.Mc=m.cc,m.Nc=m.dc+F,m.Ib=_t,vl()}}else alert("todo:EmitYUV");j&&(m.Jb=AA,N&&Ln())}if(N&&!US){for(d=0;256>d;++d)lM[d]=89858*(d-128)+jf>>Hf,fM[d]=-22014*(d-128)+jf,cM[d]=-45773*(d-128),uM[d]=113618*(d-128)+jf>>Hf;for(d=Il;d<Sv;++d)m=76283*(d-16)+jf>>Hf,hM[d-Il]=Zn(m,255),dM[d-Il]=Zn(m+8>>4,15);US=1}return 1}function Bt(d){var m=d.ma,F=d.U,N=d.T;return e(!(1&d.ka)),0>=F||0>=N?0:(F=m.Ib(d,m),m.Jb!=null&&m.Jb(d,m,F),m.Dc+=F,1)}function Mr(d){d.ma.memory=null}function nA(d,m,F,N){return k(d,8)!=47?0:(m[0]=k(d,14)+1,F[0]=k(d,14)+1,N[0]=k(d,1),k(d,3)!=0?0:!d.h)}function zr(d,m){if(4>d)return d+1;var F=d-2>>1;return(2+(1&d)<<F)+k(m,F)+1}function bA(d,m){return 120<m?m-120:1<=(F=((F=X8[m-1])>>4)*d+(8-(15&F)))?F:1;var F}function Tt(d,m,F){var N=K(F),j=d[m+=255&N].g-8;return 0<j&&(J(F,F.u+8),N=K(F),m+=d[m].value,m+=N&(1<<j)-1),J(F,F.u+d[m].g),d[m].value}function kt(d,m,F){return F.g+=d.g,F.value+=d.value<<m>>>0,e(8>=F.g),d.g}function mr(d,m,F){var N=d.xc;return e((m=N==0?0:d.vc[d.md*(F>>N)+(m>>N)])<d.Wb),d.Ya[m]}function lA(d,m,F,N){var j=d.ab,G=d.c*m,X=d.C;m=X+m;var $=F,ee=N;for(N=d.Ta,F=d.Ua;0<j--;){var ie=d.gc[j],pe=X,_e=m,ae=$,me=ee,Ce=(ee=N,$=F,ie.Ea);switch(e(pe<_e),e(_e<=ie.nc),ie.hc){case 2:Ir(ae,me,(_e-pe)*Ce,ee,$);break;case 0:var ke=pe,Se=_e,He=ee,qe=$,Ze=(dt=ie).Ea;ke==0&&(bl(ae,me,null,null,1,He,qe),ge(ae,me+1,0,0,Ze-1,He,qe+1),me+=Ze,qe+=Ze,++ke);for(var Xe=1<<dt.b,mt=Xe-1,ut=Ee(Ze,dt.b),It=dt.K,dt=dt.w+(ke>>dt.b)*ut;ke<Se;){var Lt=It,$r=dt,Qt=1;for(Gs(ae,me,He,qe-Ze,1,He,qe);Qt<Ze;){var gt=(Qt&~mt)+Xe;gt>Ze&&(gt=Ze),(0,Cl[Lt[$r++]>>8&15])(ae,me+ +Qt,He,qe+Qt-Ze,gt-Qt,He,qe+Qt),Qt=gt}me+=Ze,qe+=Ze,++ke&mt||(dt+=ut)}_e!=ie.nc&&A(ee,$-Ce,ee,$+(_e-pe-1)*Ce,Ce);break;case 1:for(Ce=ae,Se=me,Ze=(ae=ie.Ea)-(qe=ae&~(He=(me=1<<ie.b)-1)),ke=Ee(ae,ie.b),Xe=ie.K,ie=ie.w+(pe>>ie.b)*ke;pe<_e;){for(mt=Xe,ut=ie,It=new ze,dt=Se+qe,Lt=Se+ae;Se<dt;)Le(mt[ut++],It),El(It,Ce,Se,me,ee,$),Se+=me,$+=me;Se<Lt&&(Le(mt[ut++],It),El(It,Ce,Se,Ze,ee,$),Se+=Ze,$+=Ze),++pe&He||(ie+=ke)}break;case 3:if(ae==ee&&me==$&&0<ie.b){for(Se=ee,ae=Ce=$+(_e-pe)*Ce-(qe=(_e-pe)*Ee(ie.Ea,ie.b)),me=ee,He=$,ke=[],qe=(Ze=qe)-1;0<=qe;--qe)ke[qe]=me[He+qe];for(qe=Ze-1;0<=qe;--qe)Se[ae+qe]=ke[qe];Of(ie,pe,_e,ee,Ce,ee,$)}else Of(ie,pe,_e,ae,me,ee,$)}$=N,ee=F}ee!=F&&A(N,F,$,ee,G)}function QA(d,m){var F=d.V,N=d.Ba+d.c*d.C,j=m-d.C;if(e(m<=d.l.o),e(16>=j),0<j){var G=d.l,X=d.Ta,$=d.Ua,ee=G.width;if(lA(d,j,F,N),j=$=[$],e((F=d.C)<(N=m)),e(G.v<G.va),N>G.o&&(N=G.o),F<G.j){var ie=G.j-F;F=G.j,j[0]+=ie*ee}if(F>=N?F=0:(j[0]+=4*G.v,G.ka=F-G.j,G.U=G.va-G.v,G.T=N-F,F=1),F){if($=$[0],11>(F=d.ca).S){var pe=F.f.RGBA,_e=(N=F.S,j=G.U,G=G.T,ie=pe.eb,pe.A),ae=G;for(pe=pe.fb+d.Ma*pe.A;0<ae--;){var me=X,Ce=$,ke=j,Se=ie,He=pe;switch(N){case Pf:Fl(me,Ce,ke,Se,He);break;case Rf:ua(me,Ce,ke,Se,He);break;case bv:ua(me,Ce,ke,Se,He),Ul(Se,He,0,ke,1,0);break;case wS:ns(me,Ce,ke,Se,He);break;case Mf:De(me,Ce,ke,Se,He,1);break;case xv:De(me,Ce,ke,Se,He,1),Ul(Se,He,0,ke,1,0);break;case Df:De(me,Ce,ke,Se,He,0);break;case kf:De(me,Ce,ke,Se,He,0),Ul(Se,He,1,ke,1,0);break;case Bv:ca(me,Ce,ke,Se,He);break;case Cv:ca(me,Ce,ke,Se,He),cS(Se,He,ke,1,0);break;case yS:fa(me,Ce,ke,Se,He);break;default:e(0)}$+=ee,pe+=_e}d.Ma+=G}else alert("todo:EmitRescaledRowsYUVA");e(d.Ma<=F.height)}}d.C=m,e(d.C<=d.i)}function HA(d){var m;if(0<d.ua)return 0;for(m=0;m<d.Wb;++m){var F=d.Ya[m].G,N=d.Ya[m].H;if(0<F[1][N[1]+0].g||0<F[2][N[2]+0].g||0<F[3][N[3]+0].g)return 0}return 1}function Dr(d,m,F,N,j,G){if(d.Z!=0){var X=d.qd,$=d.rd;for(e(ga[d.Z]!=null);m<F;++m)ga[d.Z](X,$,N,j,N,j,G),X=N,$=j,j+=G;d.qd=X,d.rd=$}}function jA(d,m){var F=d.l.ma,N=F.Z==0||F.Z==1?d.l.j:d.C;if(N=d.C<N?N:d.C,e(m<=d.l.o),m>N){var j=d.l.width,G=F.ca,X=F.tb+j*N,$=d.V,ee=d.Ba+d.c*N,ie=d.gc;e(d.ab==1),e(ie[0].hc==3),Ai(ie[0],N,m,$,ee,G,X),Dr(F,N,m,G,X,j)}d.C=d.Ma=m}function KA(d,m,F,N,j,G,X){var $=d.$/N,ee=d.$%N,ie=d.m,pe=d.s,_e=F+d.$,ae=_e;j=F+N*j;var me=F+N*G,Ce=280+pe.ua,ke=d.Pb?$:16777216,Se=0<pe.ua?pe.Wa:null,He=pe.wc,qe=_e<me?mr(pe,ee,$):null;e(d.C<G),e(me<=j);var Ze=!1;e:for(;;){for(;Ze||_e<me;){var Xe=0;if($>=ke){var mt=_e-F;e((ke=d).Pb),ke.wd=ke.m,ke.xd=mt,0<ke.s.ua&&Ie(ke.s.Wa,ke.s.vb),ke=$+$8}if(ee&He||(qe=mr(pe,ee,$)),e(qe!=null),qe.Qb&&(m[_e]=qe.qb,Ze=!0),!Ze)if(q(ie),qe.jc){Xe=ie,mt=m;var ut=_e,It=qe.pd[K(Xe)&As-1];e(qe.jc),256>It.g?(J(Xe,Xe.u+It.g),mt[ut]=It.value,Xe=0):(J(Xe,Xe.u+It.g-256),e(256<=It.value),Xe=It.value),Xe==0&&(Ze=!0)}else Xe=Tt(qe.G[0],qe.H[0],ie);if(ie.h)break;if(Ze||256>Xe){if(!Ze)if(qe.nd)m[_e]=(qe.qb|Xe<<8)>>>0;else{if(q(ie),Ze=Tt(qe.G[1],qe.H[1],ie),q(ie),mt=Tt(qe.G[2],qe.H[2],ie),ut=Tt(qe.G[3],qe.H[3],ie),ie.h)break;m[_e]=(ut<<24|Ze<<16|Xe<<8|mt)>>>0}if(Ze=!1,++_e,++ee>=N&&(ee=0,++$,X!=null&&$<=G&&!($%16)&&X(d,$),Se!=null))for(;ae<_e;)Xe=m[ae++],Se.X[(506832829*Xe&4294967295)>>>Se.Mb]=Xe}else if(280>Xe){if(Xe=zr(Xe-256,ie),mt=Tt(qe.G[4],qe.H[4],ie),q(ie),mt=bA(N,mt=zr(mt,ie)),ie.h)break;if(_e-F<mt||j-_e<Xe)break e;for(ut=0;ut<Xe;++ut)m[_e+ut]=m[_e+ut-mt];for(_e+=Xe,ee+=Xe;ee>=N;)ee-=N,++$,X!=null&&$<=G&&!($%16)&&X(d,$);if(e(_e<=j),ee&He&&(qe=mr(pe,ee,$)),Se!=null)for(;ae<_e;)Xe=m[ae++],Se.X[(506832829*Xe&4294967295)>>>Se.Mb]=Xe}else{if(!(Xe<Ce))break e;for(Ze=Xe-280,e(Se!=null);ae<_e;)Xe=m[ae++],Se.X[(506832829*Xe&4294967295)>>>Se.Mb]=Xe;Xe=_e,e(!(Ze>>>(mt=Se).Xa)),m[Xe]=mt.X[Ze],Ze=!0}Ze||e(ie.h==Y(ie))}if(d.Pb&&ie.h&&_e<j)e(d.m.h),d.a=5,d.m=d.wd,d.$=d.xd,0<d.s.ua&&Ie(d.s.vb,d.s.Wa);else{if(ie.h)break e;X!=null&&X(d,$>G?G:$),d.a=0,d.$=_e-F}return 1}return d.a=3,0}function NA(d){e(d!=null),d.vc=null,d.yc=null,d.Ya=null;var m=d.Wa;m!=null&&(m.X=null),d.vb=null,e(d!=null)}function Jn(){var d=new xt;return d==null?null:(d.a=0,d.xb=xS,it("Predictor","VP8LPredictors"),it("Predictor","VP8LPredictors_C"),it("PredictorAdd","VP8LPredictorsAdd"),it("PredictorAdd","VP8LPredictorsAdd_C"),Ir=Re,El=ue,Fl=Pe,ua=Fe,ca=Ne,fa=ve,ns=Qe,_.VP8LMapColor32b=ri,_.VP8LMapColor8b=xl,d)}function dn(d,m,F,N,j){var G=1,X=[d],$=[m],ee=N.m,ie=N.s,pe=null,_e=0;e:for(;;){if(F)for(;G&&k(ee,1);){var ae=X,me=$,Ce=N,ke=1,Se=Ce.m,He=Ce.gc[Ce.ab],qe=k(Se,2);if(Ce.Oc&1<<qe)G=0;else{switch(Ce.Oc|=1<<qe,He.hc=qe,He.Ea=ae[0],He.nc=me[0],He.K=[null],++Ce.ab,e(4>=Ce.ab),qe){case 0:case 1:He.b=k(Se,3)+2,ke=dn(Ee(He.Ea,He.b),Ee(He.nc,He.b),0,Ce,He.K),He.K=He.K[0];break;case 3:var Ze,Xe=k(Se,8)+1,mt=16<Xe?0:4<Xe?1:2<Xe?2:3;if(ae[0]=Ee(He.Ea,mt),He.b=mt,Ze=ke=dn(Xe,1,0,Ce,He.K)){var ut,It=Xe,dt=He,Lt=1<<(8>>dt.b),$r=i(Lt);if($r==null)Ze=0;else{var Qt=dt.K[0],gt=dt.w;for($r[0]=dt.K[0][0],ut=1;ut<1*It;++ut)$r[ut]=Ve(Qt[gt+ut],$r[ut-1]);for(;ut<4*Lt;++ut)$r[ut]=0;dt.K[0]=null,dt.K[0]=$r,Ze=1}}ke=Ze;break;case 2:break;default:e(0)}G=ke}}if(X=X[0],$=$[0],G&&k(ee,1)&&!(G=1<=(_e=k(ee,4))&&11>=_e)){N.a=3;break e}var rt;if(rt=G)t:{var Nr,St,Pt,ir=N,fA=X,TA=$,Br=_e,xA=F,LA=ir.m,Jr=ir.s,Mt=[null],Gt=1,br=0,Wt=Y8[Br];r:for(;;){if(xA&&k(LA,1)){var hA=k(LA,3)+2,Rn=Ee(fA,hA),Or=Ee(TA,hA),qA=Rn*Or;if(!dn(Rn,Or,0,ir,Mt))break r;for(Mt=Mt[0],Jr.xc=hA,Nr=0;Nr<qA;++Nr){var Zt=Mt[Nr]>>8&65535;Mt[Nr]=Zt,Zt>=Gt&&(Gt=Zt+1)}}if(LA.h)break r;for(St=0;5>St;++St){var Zr=BS[St];!St&&0<Br&&(Zr+=1<<Br),br<Zr&&(br=Zr)}var tn=s(Gt*Wt,M),PA=Gt,rn=s(PA,z);if(rn==null)var An=null;else e(65536>=PA),An=rn;var VA=i(br);if(An==null||VA==null||tn==null){ir.a=1;break r}var nn=tn;for(Nr=Pt=0;Nr<Gt;++Nr){var rr=An[Nr],an=rr.G,Mn=rr.H,as=0,Ti=1,dA=0;for(St=0;5>St;++St){Zr=BS[St],an[St]=nn,Mn[St]=Pt,!St&&0<Br&&(Zr+=1<<Br);n:{var qf,Uv=Zr,Vf=ir,Ql=VA,vM=nn,mM=Pt,_v=0,pa=Vf.m,wM=k(pa,1);if(n(Ql,0,0,Uv),wM){var yM=k(pa,1)+1,BM=k(pa,1),QS=k(pa,BM==0?1:8);Ql[QS]=1,yM==2&&(Ql[QS=k(pa,8)]=1);var zf=1}else{var NS=i(19),OS=k(pa,4)+4;if(19<OS){Vf.a=3;var Gf=0;break n}for(qf=0;qf<OS;++qf)NS[W8[qf]]=k(pa,3);var Iv=void 0,Nl=void 0,TS=Vf,bM=NS,Wf=Uv,LS=Ql,Qv=0,va=TS.m,PS=8,RS=s(128,M);A:for(;O(RS,0,7,bM,19);){if(k(va,1)){var xM=2+2*k(va,3);if((Iv=2+k(va,xM))>Wf)break A}else Iv=Wf;for(Nl=0;Nl<Wf&&Iv--;){q(va);var MS=RS[0+(127&K(va))];J(va,va.u+MS.g);var Xs=MS.value;if(16>Xs)LS[Nl++]=Xs,Xs!=0&&(PS=Xs);else{var CM=Xs==16,DS=Xs-16,EM=z8[DS],kS=k(va,V8[DS])+EM;if(Nl+kS>Wf)break A;for(var FM=CM?PS:0;0<kS--;)LS[Nl++]=FM}}Qv=1;break A}Qv||(TS.a=3),zf=Qv}(zf=zf&&!pa.h)&&(_v=O(vM,mM,8,Ql,Uv)),zf&&_v!=0?Gf=_v:(Vf.a=3,Gf=0)}if(Gf==0)break r;if(Ti&&G8[St]==1&&(Ti=nn[Pt].g==0),as+=nn[Pt].g,Pt+=Gf,3>=St){var Ol,Nv=VA[0];for(Ol=1;Ol<Zr;++Ol)VA[Ol]>Nv&&(Nv=VA[Ol]);dA+=Nv}}if(rr.nd=Ti,rr.Qb=0,Ti&&(rr.qb=(an[3][Mn[3]+0].value<<24|an[1][Mn[1]+0].value<<16|an[2][Mn[2]+0].value)>>>0,as==0&&256>an[0][Mn[0]+0].value&&(rr.Qb=1,rr.qb+=an[0][Mn[0]+0].value<<8)),rr.jc=!rr.Qb&&6>dA,rr.jc){var Xf,Li=rr;for(Xf=0;Xf<As;++Xf){var ma=Xf,wa=Li.pd[ma],Yf=Li.G[0][Li.H[0]+ma];256<=Yf.value?(wa.g=Yf.g+256,wa.value=Yf.value):(wa.g=0,wa.value=0,ma>>=kt(Yf,8,wa),ma>>=kt(Li.G[1][Li.H[1]+ma],16,wa),ma>>=kt(Li.G[2][Li.H[2]+ma],0,wa),kt(Li.G[3][Li.H[3]+ma],24,wa))}}}Jr.vc=Mt,Jr.Wb=Gt,Jr.Ya=An,Jr.yc=tn,rt=1;break t}rt=0}if(!(G=rt)){N.a=3;break e}if(0<_e){if(ie.ua=1<<_e,!R(ie.Wa,_e)){N.a=1,G=0;break e}}else ie.ua=0;var Ov=N,HS=X,SM=$,Tv=Ov.s,Lv=Tv.xc;if(Ov.c=HS,Ov.i=SM,Tv.md=Ee(HS,Lv),Tv.wc=Lv==0?-1:(1<<Lv)-1,F){N.xb=nM;break e}if((pe=i(X*$))==null){N.a=1,G=0;break e}G=(G=KA(N,pe,0,X,$,$,null))&&!ee.h;break e}return G?(j!=null?j[0]=pe:(e(pe==null),e(F)),N.$=0,F||NA(ie)):NA(ie),G}function ft(d,m){var F=d.c*d.i,N=F+m+16*m;return e(d.c<=m),d.V=i(N),d.V==null?(d.Ta=null,d.Ua=0,d.a=1,0):(d.Ta=d.V,d.Ua=d.Ba+F+m,1)}function de(d,m){var F=d.C,N=m-F,j=d.V,G=d.Ba+d.c*F;for(e(m<=d.l.o);0<N;){var X=16<N?16:N,$=d.l.ma,ee=d.l.width,ie=ee*X,pe=$.ca,_e=$.tb+ee*F,ae=d.Ta,me=d.Ua;lA(d,X,j,G),hS(ae,me,pe,_e,ie),Dr($,F,F+X,pe,_e,ee),N-=X,j+=X*d.c,F+=X}e(F==m),d.C=d.Ma=m}function Je(){this.ub=this.yd=this.td=this.Rb=0}function ot(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Yt(){this.Fb=this.Bb=this.Cb=0,this.Zb=i(4),this.Lb=i(4)}function wr(){this.Yb=(function(){var d=[];return(function m(F,N,j){for(var G=j[N],X=0;X<G&&(F.push(j.length>N+1?[]:0),!(j.length<N+1));X++)m(F[X],N+1,j)})(d,0,[3,11]),d})()}function nr(){this.jb=i(3),this.Wc=a([4,8],wr),this.Xc=a([4,17],wr)}function Gr(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new i(4),this.od=new i(4)}function yr(){this.ld=this.La=this.dd=this.tc=0}function gn(){this.Na=this.la=0}function na(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function cr(){this.ad=i(384),this.Za=0,this.Ob=i(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Va(){this.uc=this.M=this.Nb=0,this.wa=Array(new yr),this.Y=0,this.ya=Array(new cr),this.aa=0,this.l=new ks}function za(){this.y=i(16),this.f=i(8),this.ea=i(8)}function yf(){this.cb=this.a=0,this.sc="",this.m=new I,this.Od=new Je,this.Kc=new ot,this.ed=new Gr,this.Qa=new Yt,this.Ic=this.$c=this.Aa=0,this.D=new Va,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=s(8,I),this.ia=0,this.pb=s(4,na),this.Pa=new nr,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new za),this.Hd=0,this.rb=Array(new gn),this.sb=0,this.wa=Array(new yr),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new cr),this.L=this.aa=0,this.gd=a([4,2],yr),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Zn(d,m){return 0>d?0:d>m?m:d}function ks(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function iv(){var d=new yf;return d!=null&&(d.a=0,d.sc="OK",d.cb=0,d.Xb=0,_l||(_l=Hs)),d}function kr(d,m,F){return d.a==0&&(d.a=m,d.sc=F,d.cb=0),0}function Bf(d,m,F){return 3<=F&&d[m+0]==157&&d[m+1]==1&&d[m+2]==42}function ei(d,m){if(d==null)return 0;if(d.a=0,d.sc="OK",m==null)return kr(d,2,"null VP8Io passed to VP8GetHeaders()");var F=m.data,N=m.w,j=m.ha;if(4>j)return kr(d,7,"Truncated header.");var G=F[N+0]|F[N+1]<<8|F[N+2]<<16,X=d.Od;if(X.Rb=!(1&G),X.td=G>>1&7,X.yd=G>>4&1,X.ub=G>>5,3<X.td)return kr(d,3,"Incorrect keyframe parameters.");if(!X.yd)return kr(d,4,"Frame not displayable.");N+=3,j-=3;var $=d.Kc;if(X.Rb){if(7>j)return kr(d,7,"cannot parse picture header");if(!Bf(F,N,j))return kr(d,3,"Bad code word");$.c=16383&(F[N+4]<<8|F[N+3]),$.Td=F[N+4]>>6,$.i=16383&(F[N+6]<<8|F[N+5]),$.Ud=F[N+6]>>6,N+=7,j-=7,d.za=$.c+15>>4,d.Ub=$.i+15>>4,m.width=$.c,m.height=$.i,m.Da=0,m.j=0,m.v=0,m.va=m.width,m.o=m.height,m.da=0,m.ib=m.width,m.hb=m.height,m.U=m.width,m.T=m.height,n((G=d.Pa).jb,0,255,G.jb.length),e((G=d.Qa)!=null),G.Cb=0,G.Bb=0,G.Fb=1,n(G.Zb,0,0,G.Zb.length),n(G.Lb,0,0,G.Lb)}if(X.ub>j)return kr(d,7,"bad partition length");re(G=d.m,F,N,X.ub),N+=X.ub,j-=X.ub,X.Rb&&($.Ld=te(G),$.Kd=te(G)),$=d.Qa;var ee,ie=d.Pa;if(e(G!=null),e($!=null),$.Cb=te(G),$.Cb){if($.Bb=te(G),te(G)){for($.Fb=te(G),ee=0;4>ee;++ee)$.Zb[ee]=te(G)?Z(G,7):0;for(ee=0;4>ee;++ee)$.Lb[ee]=te(G)?Z(G,6):0}if($.Bb)for(ee=0;3>ee;++ee)ie.jb[ee]=te(G)?ne(G,8):255}else $.Bb=0;if(G.Ka)return kr(d,3,"cannot parse segment header");if(($=d.ed).zd=te(G),$.Tb=ne(G,6),$.wb=ne(G,3),$.Pc=te(G),$.Pc&&te(G)){for(ie=0;4>ie;++ie)te(G)&&($.vd[ie]=Z(G,6));for(ie=0;4>ie;++ie)te(G)&&($.od[ie]=Z(G,6))}if(d.L=$.Tb==0?0:$.zd?1:2,G.Ka)return kr(d,3,"cannot parse filter header");var pe=j;if(j=ee=N,N=ee+pe,$=pe,d.Xb=(1<<ne(d.m,2))-1,pe<3*(ie=d.Xb))F=7;else{for(ee+=3*ie,$-=3*ie,pe=0;pe<ie;++pe){var _e=F[j+0]|F[j+1]<<8|F[j+2]<<16;_e>$&&(_e=$),re(d.Jc[+pe],F,ee,_e),ee+=_e,$-=_e,j+=3}re(d.Jc[+ie],F,ee,$),F=ee<N?0:5}if(F!=0)return kr(d,F,"cannot parse partitions");for(F=ne(ee=d.m,7),j=te(ee)?Z(ee,4):0,N=te(ee)?Z(ee,4):0,$=te(ee)?Z(ee,4):0,ie=te(ee)?Z(ee,4):0,ee=te(ee)?Z(ee,4):0,pe=d.Qa,_e=0;4>_e;++_e){if(pe.Cb){var ae=pe.Zb[_e];pe.Fb||(ae+=F)}else{if(0<_e){d.pb[_e]=d.pb[0];continue}ae=F}var me=d.pb[_e];me.Sc[0]=Ev[Zn(ae+j,127)],me.Sc[1]=Fv[Zn(ae+0,127)],me.Eb[0]=2*Ev[Zn(ae+N,127)],me.Eb[1]=101581*Fv[Zn(ae+$,127)]>>16,8>me.Eb[1]&&(me.Eb[1]=8),me.Qc[0]=Ev[Zn(ae+ie,117)],me.Qc[1]=Fv[Zn(ae+ee,127)],me.lc=ae+ee}if(!X.Rb)return kr(d,4,"Not a key frame.");for(te(G),X=d.Pa,F=0;4>F;++F){for(j=0;8>j;++j)for(N=0;3>N;++N)for($=0;11>$;++$)ie=oe(G,rM[F][j][N][$])?ne(G,8):eM[F][j][N][$],X.Wc[F][j].Yb[N][$]=ie;for(j=0;17>j;++j)X.Xc[F][j]=X.Wc[F][AM[j]]}return d.kc=te(G),d.kc&&(d.Bd=ne(G,8)),d.cb=1}function Hs(d,m,F,N,j,G,X){var $=m[j].Yb[F];for(F=0;16>j;++j){if(!oe(d,$[F+0]))return j;for(;!oe(d,$[F+1]);)if($=m[++j].Yb[0],F=0,j==16)return 16;var ee=m[j+1].Yb;if(oe(d,$[F+2])){var ie=d,pe=0;if(oe(ie,(ae=$)[(_e=F)+3]))if(oe(ie,ae[_e+6])){for($=0,_e=2*(pe=oe(ie,ae[_e+8]))+(ae=oe(ie,ae[_e+9+pe])),pe=0,ae=J8[_e];ae[$];++$)pe+=pe+oe(ie,ae[$]);pe+=3+(8<<_e)}else oe(ie,ae[_e+7])?(pe=7+2*oe(ie,165),pe+=oe(ie,145)):pe=5+oe(ie,159);else pe=oe(ie,ae[_e+4])?3+oe(ie,ae[_e+5]):2;$=ee[2]}else pe=1,$=ee[1];ee=X+Z8[j],0>(ie=d).b&&W(ie);var _e,ae=ie.b,me=(_e=ie.Ca>>1)-(ie.I>>ae)>>31;--ie.b,ie.Ca+=me,ie.Ca|=1,ie.I-=(_e+1&me)<<ae,G[ee]=((pe^me)-me)*N[(0<j)+0]}return 16}function bf(d){var m=d.rb[d.sb-1];m.la=0,m.Na=0,n(d.zc,0,0,d.zc.length),d.ja=0}function pn(d,m,F,N,j){j=d[m+F+32*N]+(j>>3),d[m+F+32*N]=-256&j?0>j?0:255:j}function Wr(d,m,F,N,j,G){pn(d,m,0,F,N+j),pn(d,m,1,F,N+G),pn(d,m,2,F,N-G),pn(d,m,3,F,N-j)}function Bi(d){return(20091*d>>16)+d}function xf(d,m,F,N){var j,G=0,X=i(16);for(j=0;4>j;++j){var $=d[m+0]+d[m+8],ee=d[m+0]-d[m+8],ie=(35468*d[m+4]>>16)-Bi(d[m+12]),pe=Bi(d[m+4])+(35468*d[m+12]>>16);X[G+0]=$+pe,X[G+1]=ee+ie,X[G+2]=ee-ie,X[G+3]=$-pe,G+=4,m++}for(j=G=0;4>j;++j)$=(d=X[G+0]+4)+X[G+8],ee=d-X[G+8],ie=(35468*X[G+4]>>16)-Bi(X[G+12]),pn(F,N,0,0,$+(pe=Bi(X[G+4])+(35468*X[G+12]>>16))),pn(F,N,1,0,ee+ie),pn(F,N,2,0,ee-ie),pn(F,N,3,0,$-pe),G++,N+=32}function av(d,m,F,N){var j=d[m+0]+4,G=35468*d[m+4]>>16,X=Bi(d[m+4]),$=35468*d[m+1]>>16;Wr(F,N,0,j+X,d=Bi(d[m+1]),$),Wr(F,N,1,j+G,d,$),Wr(F,N,2,j-G,d,$),Wr(F,N,3,j-X,d,$)}function sv(d,m,F,N,j){xf(d,m,F,N),j&&xf(d,m+16,F,N+4)}function ti(d,m,F,N){is(d,m+0,F,N,1),is(d,m+32,F,N+128,1)}function Cf(d,m,F,N){var j;for(d=d[m+0]+4,j=0;4>j;++j)for(m=0;4>m;++m)pn(F,N,m,j,d)}function Ef(d,m,F,N){d[m+0]&&zt(d,m+0,F,N),d[m+16]&&zt(d,m+16,F,N+4),d[m+32]&&zt(d,m+32,F,N+128),d[m+48]&&zt(d,m+48,F,N+128+4)}function js(d,m,F,N){var j,G=i(16);for(j=0;4>j;++j){var X=d[m+0+j]+d[m+12+j],$=d[m+4+j]+d[m+8+j],ee=d[m+4+j]-d[m+8+j],ie=d[m+0+j]-d[m+12+j];G[0+j]=X+$,G[8+j]=X-$,G[4+j]=ie+ee,G[12+j]=ie-ee}for(j=0;4>j;++j)X=(d=G[0+4*j]+3)+G[3+4*j],$=G[1+4*j]+G[2+4*j],ee=G[1+4*j]-G[2+4*j],ie=d-G[3+4*j],F[N+0]=X+$>>3,F[N+16]=ie+ee>>3,F[N+32]=X-$>>3,F[N+48]=ie-ee>>3,N+=64}function Ga(d,m,F){var N,j=m-32,G=en,X=255-d[j-1];for(N=0;N<F;++N){var $,ee=G,ie=X+d[m-1];for($=0;$<F;++$)d[m+$]=ee[ie+d[j+$]];m+=32}}function ov(d,m){Ga(d,m,4)}function lv(d,m){Ga(d,m,8)}function uv(d,m){Ga(d,m,16)}function ll(d,m){var F;for(F=0;16>F;++F)A(d,m+32*F,d,m-32,16)}function Ff(d,m){var F;for(F=16;0<F;--F)n(d,m,d[m-1],16),m+=32}function Tn(d,m,F){var N;for(N=0;16>N;++N)n(m,F+32*N,d,16)}function cv(d,m){var F,N=16;for(F=0;16>F;++F)N+=d[m-1+32*F]+d[m+F-32];Tn(N>>5,d,m)}function Wa(d,m){var F,N=8;for(F=0;16>F;++F)N+=d[m-1+32*F];Tn(N>>4,d,m)}function ul(d,m){var F,N=8;for(F=0;16>F;++F)N+=d[m+F-32];Tn(N>>4,d,m)}function fv(d,m){Tn(128,d,m)}function Ct(d,m,F){return d+2*m+F+2>>2}function hv(d,m){var F,N=m-32;for(N=new Uint8Array([Ct(d[N-1],d[N+0],d[N+1]),Ct(d[N+0],d[N+1],d[N+2]),Ct(d[N+1],d[N+2],d[N+3]),Ct(d[N+2],d[N+3],d[N+4])]),F=0;4>F;++F)A(d,m+32*F,N,0,N.length)}function dv(d,m){var F=d[m-1],N=d[m-1+32],j=d[m-1+64],G=d[m-1+96];we(d,m+0,16843009*Ct(d[m-1-32],F,N)),we(d,m+32,16843009*Ct(F,N,j)),we(d,m+64,16843009*Ct(N,j,G)),we(d,m+96,16843009*Ct(j,G,G))}function gv(d,m){var F,N=4;for(F=0;4>F;++F)N+=d[m+F-32]+d[m-1+32*F];for(N>>=3,F=0;4>F;++F)n(d,m+32*F,N,4)}function bi(d,m){var F=d[m-1+0],N=d[m-1+32],j=d[m-1+64],G=d[m-1-32],X=d[m+0-32],$=d[m+1-32],ee=d[m+2-32],ie=d[m+3-32];d[m+0+96]=Ct(N,j,d[m-1+96]),d[m+1+96]=d[m+0+64]=Ct(F,N,j),d[m+2+96]=d[m+1+64]=d[m+0+32]=Ct(G,F,N),d[m+3+96]=d[m+2+64]=d[m+1+32]=d[m+0+0]=Ct(X,G,F),d[m+3+64]=d[m+2+32]=d[m+1+0]=Ct($,X,G),d[m+3+32]=d[m+2+0]=Ct(ee,$,X),d[m+3+0]=Ct(ie,ee,$)}function xi(d,m){var F=d[m+1-32],N=d[m+2-32],j=d[m+3-32],G=d[m+4-32],X=d[m+5-32],$=d[m+6-32],ee=d[m+7-32];d[m+0+0]=Ct(d[m+0-32],F,N),d[m+1+0]=d[m+0+32]=Ct(F,N,j),d[m+2+0]=d[m+1+32]=d[m+0+64]=Ct(N,j,G),d[m+3+0]=d[m+2+32]=d[m+1+64]=d[m+0+96]=Ct(j,G,X),d[m+3+32]=d[m+2+64]=d[m+1+96]=Ct(G,X,$),d[m+3+64]=d[m+2+96]=Ct(X,$,ee),d[m+3+96]=Ct($,ee,ee)}function pv(d,m){var F=d[m-1+0],N=d[m-1+32],j=d[m-1+64],G=d[m-1-32],X=d[m+0-32],$=d[m+1-32],ee=d[m+2-32],ie=d[m+3-32];d[m+0+0]=d[m+1+64]=G+X+1>>1,d[m+1+0]=d[m+2+64]=X+$+1>>1,d[m+2+0]=d[m+3+64]=$+ee+1>>1,d[m+3+0]=ee+ie+1>>1,d[m+0+96]=Ct(j,N,F),d[m+0+64]=Ct(N,F,G),d[m+0+32]=d[m+1+96]=Ct(F,G,X),d[m+1+32]=d[m+2+96]=Ct(G,X,$),d[m+2+32]=d[m+3+96]=Ct(X,$,ee),d[m+3+32]=Ct($,ee,ie)}function vv(d,m){var F=d[m+0-32],N=d[m+1-32],j=d[m+2-32],G=d[m+3-32],X=d[m+4-32],$=d[m+5-32],ee=d[m+6-32],ie=d[m+7-32];d[m+0+0]=F+N+1>>1,d[m+1+0]=d[m+0+64]=N+j+1>>1,d[m+2+0]=d[m+1+64]=j+G+1>>1,d[m+3+0]=d[m+2+64]=G+X+1>>1,d[m+0+32]=Ct(F,N,j),d[m+1+32]=d[m+0+96]=Ct(N,j,G),d[m+2+32]=d[m+1+96]=Ct(j,G,X),d[m+3+32]=d[m+2+96]=Ct(G,X,$),d[m+3+64]=Ct(X,$,ee),d[m+3+96]=Ct($,ee,ie)}function Ks(d,m){var F=d[m-1+0],N=d[m-1+32],j=d[m-1+64],G=d[m-1+96];d[m+0+0]=F+N+1>>1,d[m+2+0]=d[m+0+32]=N+j+1>>1,d[m+2+32]=d[m+0+64]=j+G+1>>1,d[m+1+0]=Ct(F,N,j),d[m+3+0]=d[m+1+32]=Ct(N,j,G),d[m+3+32]=d[m+1+64]=Ct(j,G,G),d[m+3+64]=d[m+2+64]=d[m+0+96]=d[m+1+96]=d[m+2+96]=d[m+3+96]=G}function cl(d,m){var F=d[m-1+0],N=d[m-1+32],j=d[m-1+64],G=d[m-1+96],X=d[m-1-32],$=d[m+0-32],ee=d[m+1-32],ie=d[m+2-32];d[m+0+0]=d[m+2+32]=F+X+1>>1,d[m+0+32]=d[m+2+64]=N+F+1>>1,d[m+0+64]=d[m+2+96]=j+N+1>>1,d[m+0+96]=G+j+1>>1,d[m+3+0]=Ct($,ee,ie),d[m+2+0]=Ct(X,$,ee),d[m+1+0]=d[m+3+32]=Ct(F,X,$),d[m+1+32]=d[m+3+64]=Ct(N,F,X),d[m+1+64]=d[m+3+96]=Ct(j,N,F),d[m+1+96]=Ct(G,j,N)}function Xa(d,m){var F;for(F=0;8>F;++F)A(d,m+32*F,d,m-32,8)}function mv(d,m){var F;for(F=0;8>F;++F)n(d,m,d[m-1],8),m+=32}function Ci(d,m,F){var N;for(N=0;8>N;++N)n(m,F+32*N,d,8)}function wv(d,m){var F,N=8;for(F=0;8>F;++F)N+=d[m+F-32]+d[m-1+32*F];Ci(N>>4,d,m)}function fl(d,m){var F,N=4;for(F=0;8>F;++F)N+=d[m+F-32];Ci(N>>3,d,m)}function hl(d,m){var F,N=4;for(F=0;8>F;++F)N+=d[m-1+32*F];Ci(N>>3,d,m)}function Sf(d,m){Ci(128,d,m)}function Ei(d,m,F){var N=d[m-F],j=d[m+0],G=3*(j-N)+yv[1020+d[m-2*F]-d[m+F]],X=Lf[112+(G+4>>3)];d[m-F]=en[255+N+Lf[112+(G+3>>3)]],d[m+0]=en[255+j-X]}function dl(d,m,F,N){var j=d[m+0],G=d[m+F];return wn[255+d[m-2*F]-d[m-F]]>N||wn[255+G-j]>N}function qs(d,m,F,N){return 4*wn[255+d[m-F]-d[m+0]]+wn[255+d[m-2*F]-d[m+F]]<=N}function gl(d,m,F,N,j){var G=d[m-3*F],X=d[m-2*F],$=d[m-F],ee=d[m+0],ie=d[m+F],pe=d[m+2*F],_e=d[m+3*F];return 4*wn[255+$-ee]+wn[255+X-ie]>N?0:wn[255+d[m-4*F]-G]<=j&&wn[255+G-X]<=j&&wn[255+X-$]<=j&&wn[255+_e-pe]<=j&&wn[255+pe-ie]<=j&&wn[255+ie-ee]<=j}function Ya(d,m,F,N){var j=2*N+1;for(N=0;16>N;++N)qs(d,m+N,F,j)&&Ei(d,m+N,F)}function pl(d,m,F,N){var j=2*N+1;for(N=0;16>N;++N)qs(d,m+N*F,1,j)&&Ei(d,m+N*F,1)}function Uf(d,m,F,N){var j;for(j=3;0<j;--j)Ya(d,m+=4*F,F,N)}function _f(d,m,F,N){var j;for(j=3;0<j;--j)pl(d,m+=4,F,N)}function Fi(d,m,F,N,j,G,X,$){for(G=2*G+1;0<j--;){if(gl(d,m,F,G,X))if(dl(d,m,F,$))Ei(d,m,F);else{var ee=d,ie=m,pe=F,_e=ee[ie-2*pe],ae=ee[ie-pe],me=ee[ie+0],Ce=ee[ie+pe],ke=ee[ie+2*pe],Se=27*(qe=yv[1020+3*(me-ae)+yv[1020+_e-Ce]])+63>>7,He=18*qe+63>>7,qe=9*qe+63>>7;ee[ie-3*pe]=en[255+ee[ie-3*pe]+qe],ee[ie-2*pe]=en[255+_e+He],ee[ie-pe]=en[255+ae+Se],ee[ie+0]=en[255+me-Se],ee[ie+pe]=en[255+Ce-He],ee[ie+2*pe]=en[255+ke-qe]}m+=N}}function Si(d,m,F,N,j,G,X,$){for(G=2*G+1;0<j--;){if(gl(d,m,F,G,X))if(dl(d,m,F,$))Ei(d,m,F);else{var ee=d,ie=m,pe=F,_e=ee[ie-pe],ae=ee[ie+0],me=ee[ie+pe],Ce=Lf[112+(4+(ke=3*(ae-_e))>>3)],ke=Lf[112+(ke+3>>3)],Se=Ce+1>>1;ee[ie-2*pe]=en[255+ee[ie-2*pe]+Se],ee[ie-pe]=en[255+_e+ke],ee[ie+0]=en[255+ae-Ce],ee[ie+pe]=en[255+me-Se]}m+=N}}function If(d,m,F,N,j,G){Fi(d,m,F,1,16,N,j,G)}function $a(d,m,F,N,j,G){Fi(d,m,1,F,16,N,j,G)}function Qf(d,m,F,N,j,G){var X;for(X=3;0<X;--X)Si(d,m+=4*F,F,1,16,N,j,G)}function b(d,m,F,N,j,G){var X;for(X=3;0<X;--X)Si(d,m+=4,1,F,16,N,j,G)}function H(d,m,F,N,j,G,X,$){Fi(d,m,j,1,8,G,X,$),Fi(F,N,j,1,8,G,X,$)}function se(d,m,F,N,j,G,X,$){Fi(d,m,1,j,8,G,X,$),Fi(F,N,1,j,8,G,X,$)}function he(d,m,F,N,j,G,X,$){Si(d,m+4*j,j,1,8,G,X,$),Si(F,N+4*j,j,1,8,G,X,$)}function be(d,m,F,N,j,G,X,$){Si(d,m+4,1,j,8,G,X,$),Si(F,N+4,1,j,8,G,X,$)}function Ke(){this.ba=new nt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new lt,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function We(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function ht(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function vt(){this.ua=0,this.Wa=new Ue,this.vb=new Ue,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new z,this.yc=new M}function xt(){this.xb=this.a=0,this.l=new ks,this.ca=new nt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new P,this.Pb=0,this.wd=new P,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new vt,this.ab=0,this.gc=s(4,ht),this.Oc=0}function Ut(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new ks,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Rt(d,m,F,N,j,G,X){for(d=d==null?0:d[m+0],m=0;m<X;++m)j[G+m]=d+F[N+m]&255,d=j[G+m]}function fr(d,m,F,N,j,G,X){var $;if(d==null)Rt(null,null,F,N,j,G,X);else for($=0;$<X;++$)j[G+$]=d[m+$]+F[N+$]&255}function Hr(d,m,F,N,j,G,X){if(d==null)Rt(null,null,F,N,j,G,X);else{var $,ee=d[m+0],ie=ee,pe=ee;for($=0;$<X;++$)ie=pe+(ee=d[m+$])-ie,pe=F[N+$]+(-256&ie?0>ie?0:255:ie)&255,ie=ee,j[G+$]=pe}}function tr(d,m,F,N){var j=m.width,G=m.o;if(e(d!=null&&m!=null),0>F||0>=N||F+N>G)return null;if(!d.Cc){if(d.ga==null){var X;if(d.ga=new Ut,(X=d.ga==null)||(X=m.width*m.o,e(d.Gb.length==0),d.Gb=i(X),d.Uc=0,d.Gb==null?X=0:(d.mb=d.Gb,d.nb=d.Uc,d.rc=null,X=1),X=!X),!X){X=d.ga;var $=d.Fa,ee=d.P,ie=d.qc,pe=d.mb,_e=d.nb,ae=ee+1,me=ie-1,Ce=X.l;if(e($!=null&&pe!=null&&m!=null),ga[0]=null,ga[1]=Rt,ga[2]=fr,ga[3]=Hr,X.ca=pe,X.tb=_e,X.c=m.width,X.i=m.height,e(0<X.c&&0<X.i),1>=ie)m=0;else if(X.$a=3&$[ee+0],X.Z=$[ee+0]>>2&3,X.Lc=$[ee+0]>>4&3,ee=$[ee+0]>>6&3,0>X.$a||1<X.$a||4<=X.Z||1<X.Lc||ee)m=0;else if(Ce.put=Bt,Ce.ac=Vr,Ce.bc=Mr,Ce.ma=X,Ce.width=m.width,Ce.height=m.height,Ce.Da=m.Da,Ce.v=m.v,Ce.va=m.va,Ce.j=m.j,Ce.o=m.o,X.$a)e:{e(X.$a==1),m=Jn();t:for(;;){if(m==null){m=0;break e}if(e(X!=null),X.mc=m,m.c=X.c,m.i=X.i,m.l=X.l,m.l.ma=X,m.l.width=X.c,m.l.height=X.i,m.a=0,Ae(m.m,$,ae,me),!dn(X.c,X.i,1,m,null)||(m.ab==1&&m.gc[0].hc==3&&HA(m.s)?(X.ic=1,$=m.c*m.i,m.Ta=null,m.Ua=0,m.V=i($),m.Ba=0,m.V==null?(m.a=1,m=0):m=1):(X.ic=0,m=ft(m,X.c)),!m))break t;m=1;break e}X.mc=null,m=0}else m=me>=X.c*X.i;X=!m}if(X)return null;d.ga.Lc!=1?d.Ga=0:N=G-F}e(d.ga!=null),e(F+N<=G);e:{if(m=($=d.ga).c,G=$.l.o,$.$a==0){if(ae=d.rc,me=d.Vc,Ce=d.Fa,ee=d.P+1+F*m,ie=d.mb,pe=d.nb+F*m,e(ee<=d.P+d.qc),$.Z!=0)for(e(ga[$.Z]!=null),X=0;X<N;++X)ga[$.Z](ae,me,Ce,ee,ie,pe,m),ae=ie,me=pe,pe+=m,ee+=m;else for(X=0;X<N;++X)A(ie,pe,Ce,ee,m),ae=ie,me=pe,pe+=m,ee+=m;d.rc=ae,d.Vc=me}else{if(e($.mc!=null),m=F+N,e((X=$.mc)!=null),e(m<=X.i),X.C>=m)m=1;else if($.ic||Ln(),$.ic){$=X.V,ae=X.Ba,me=X.c;var ke=X.i,Se=(Ce=1,ee=X.$/me,ie=X.$%me,pe=X.m,_e=X.s,X.$),He=me*ke,qe=me*m,Ze=_e.wc,Xe=Se<qe?mr(_e,ie,ee):null;e(Se<=He),e(m<=ke),e(HA(_e));t:for(;;){for(;!pe.h&&Se<qe;){if(ie&Ze||(Xe=mr(_e,ie,ee)),e(Xe!=null),q(pe),256>(ke=Tt(Xe.G[0],Xe.H[0],pe)))$[ae+Se]=ke,++Se,++ie>=me&&(ie=0,++ee<=m&&!(ee%16)&&jA(X,ee));else{if(!(280>ke)){Ce=0;break t}ke=zr(ke-256,pe);var mt,ut=Tt(Xe.G[4],Xe.H[4],pe);if(q(pe),!(Se>=(ut=bA(me,ut=zr(ut,pe)))&&He-Se>=ke)){Ce=0;break t}for(mt=0;mt<ke;++mt)$[ae+Se+mt]=$[ae+Se+mt-ut];for(Se+=ke,ie+=ke;ie>=me;)ie-=me,++ee<=m&&!(ee%16)&&jA(X,ee);Se<qe&&ie&Ze&&(Xe=mr(_e,ie,ee))}e(pe.h==Y(pe))}jA(X,ee>m?m:ee);break t}!Ce||pe.h&&Se<He?(Ce=0,X.a=pe.h?5:3):X.$=Se,m=Ce}else m=KA(X,X.V,X.Ba,X.c,X.i,m,de);if(!m){N=0;break e}}F+N>=G&&(d.Cc=1),N=1}if(!N)return null;if(d.Cc&&((N=d.ga)!=null&&(N.mc=null),d.ga=null,0<d.Ga))return alert("todo:WebPDequantizeLevels"),null}return d.nb+F*j}function Xr(d,m,F,N,j,G){for(;0<j--;){var X,$=d,ee=m+(F?1:0),ie=d,pe=m+(F?0:3);for(X=0;X<N;++X){var _e=ie[pe+4*X];_e!=255&&(_e*=32897,$[ee+4*X+0]=$[ee+4*X+0]*_e>>23,$[ee+4*X+1]=$[ee+4*X+1]*_e>>23,$[ee+4*X+2]=$[ee+4*X+2]*_e>>23)}m+=G}}function jr(d,m,F,N,j){for(;0<N--;){var G;for(G=0;G<F;++G){var X=d[m+2*G+0],$=15&(ie=d[m+2*G+1]),ee=4369*$,ie=(240&ie|ie>>4)*ee>>16;d[m+2*G+0]=(240&X|X>>4)*ee>>16&240|(15&X|X<<4)*ee>>16>>4&15,d[m+2*G+1]=240&ie|$}m+=j}}function uA(d,m,F,N,j,G,X,$){var ee,ie,pe=255;for(ie=0;ie<j;++ie){for(ee=0;ee<N;++ee){var _e=d[m+ee];G[X+4*ee]=_e,pe&=_e}m+=F,X+=$}return pe!=255}function Ui(d,m,F,N,j){var G;for(G=0;G<j;++G)F[N+G]=d[m+G]>>8}function Ln(){Ul=Xr,cS=jr,fS=uA,hS=Ui}function _i(d,m,F){_[d]=function(N,j,G,X,$,ee,ie,pe,_e,ae,me,Ce,ke,Se,He,qe,Ze){var Xe,mt=Ze-1>>1,ut=$[ee+0]|ie[pe+0]<<16,It=_e[ae+0]|me[Ce+0]<<16;e(N!=null);var dt=3*ut+It+131074>>2;for(m(N[j+0],255&dt,dt>>16,ke,Se),G!=null&&(dt=3*It+ut+131074>>2,m(G[X+0],255&dt,dt>>16,He,qe)),Xe=1;Xe<=mt;++Xe){var Lt=$[ee+Xe]|ie[pe+Xe]<<16,$r=_e[ae+Xe]|me[Ce+Xe]<<16,Qt=ut+Lt+It+$r+524296,gt=Qt+2*(Lt+It)>>3;dt=gt+ut>>1,ut=(Qt=Qt+2*(ut+$r)>>3)+Lt>>1,m(N[j+2*Xe-1],255&dt,dt>>16,ke,Se+(2*Xe-1)*F),m(N[j+2*Xe-0],255&ut,ut>>16,ke,Se+(2*Xe-0)*F),G!=null&&(dt=Qt+It>>1,ut=gt+$r>>1,m(G[X+2*Xe-1],255&dt,dt>>16,He,qe+(2*Xe-1)*F),m(G[X+2*Xe+0],255&ut,ut>>16,He,qe+(2*Xe+0)*F)),ut=Lt,It=$r}1&Ze||(dt=3*ut+It+131074>>2,m(N[j+Ze-1],255&dt,dt>>16,ke,Se+(Ze-1)*F),G!=null&&(dt=3*It+ut+131074>>2,m(G[X+Ze-1],255&dt,dt>>16,He,qe+(Ze-1)*F)))}}function vl(){yn[Pf]=iM,yn[Rf]=CS,yn[wS]=aM,yn[Mf]=ES,yn[Df]=FS,yn[Bv]=SS,yn[yS]=sM,yn[bv]=CS,yn[xv]=ES,yn[kf]=FS,yn[Cv]=SS}function Vs(d){return d&-16384?0>d?0:255:d>>oM}function ia(d,m){return Vs((19077*d>>8)+(26149*m>>8)-14234)}function Ja(d,m,F){return Vs((19077*d>>8)-(6419*m>>8)-(13320*F>>8)+8708)}function Za(d,m){return Vs((19077*d>>8)+(33050*m>>8)-17685)}function aa(d,m,F,N,j){N[j+0]=ia(d,F),N[j+1]=Ja(d,m,F),N[j+2]=Za(d,m)}function cA(d,m,F,N,j){N[j+0]=Za(d,m),N[j+1]=Ja(d,m,F),N[j+2]=ia(d,F)}function es(d,m,F,N,j){var G=Ja(d,m,F);m=G<<3&224|Za(d,m)>>3,N[j+0]=248&ia(d,F)|G>>5,N[j+1]=m}function ts(d,m,F,N,j){var G=240&Za(d,m)|15;N[j+0]=240&ia(d,F)|Ja(d,m,F)>>4,N[j+1]=G}function ml(d,m,F,N,j){N[j+0]=255,aa(d,m,F,N,j+1)}function wl(d,m,F,N,j){cA(d,m,F,N,j),N[j+3]=255}function OA(d,m,F,N,j){aa(d,m,F,N,j),N[j+3]=255}function Ii(d,m,F){_[d]=function(N,j,G,X,$,ee,ie,pe,_e){for(var ae=pe+(-2&_e)*F;pe!=ae;)m(N[j+0],G[X+0],$[ee+0],ie,pe),m(N[j+1],G[X+0],$[ee+0],ie,pe+F),j+=2,++X,++ee,pe+=2*F;1&_e&&m(N[j+0],G[X+0],$[ee+0],ie,pe)}}function zs(d,m,F){return F==0?d==0?m==0?6:5:m==0?4:0:F}function Nf(d,m,F,N,j){switch(d>>>30){case 3:is(m,F,N,j,0);break;case 2:mn(m,F,N,j);break;case 1:zt(m,F,N,j)}}function vn(d,m){var F,N,j=m.M,G=m.Nb,X=d.oc,$=d.pc+40,ee=d.oc,ie=d.pc+584,pe=d.oc,_e=d.pc+600;for(F=0;16>F;++F)X[$+32*F-1]=129;for(F=0;8>F;++F)ee[ie+32*F-1]=129,pe[_e+32*F-1]=129;for(0<j?X[$-1-32]=ee[ie-1-32]=pe[_e-1-32]=129:(n(X,$-32-1,127,21),n(ee,ie-32-1,127,9),n(pe,_e-32-1,127,9)),N=0;N<d.za;++N){var ae=m.ya[m.aa+N];if(0<N){for(F=-1;16>F;++F)A(X,$+32*F-4,X,$+32*F+12,4);for(F=-1;8>F;++F)A(ee,ie+32*F-4,ee,ie+32*F+4,4),A(pe,_e+32*F-4,pe,_e+32*F+4,4)}var me=d.Gd,Ce=d.Hd+N,ke=ae.ad,Se=ae.Hc;if(0<j&&(A(X,$-32,me[Ce].y,0,16),A(ee,ie-32,me[Ce].f,0,8),A(pe,_e-32,me[Ce].ea,0,8)),ae.Za){var He=X,qe=$-32+16;for(0<j&&(N>=d.za-1?n(He,qe,me[Ce].y[15],4):A(He,qe,me[Ce+1].y,0,4)),F=0;4>F;F++)He[qe+128+F]=He[qe+256+F]=He[qe+384+F]=He[qe+0+F];for(F=0;16>F;++F,Se<<=2)He=X,qe=$+_S[F],Pn[ae.Ob[F]](He,qe),Nf(Se,ke,16*+F,He,qe)}else if(He=zs(N,j,ae.Ob[0]),da[He](X,$),Se!=0)for(F=0;16>F;++F,Se<<=2)Nf(Se,ke,16*+F,X,$+_S[F]);for(F=ae.Gc,He=zs(N,j,ae.Dd),Oi[He](ee,ie),Oi[He](pe,_e),Se=ke,He=ee,qe=ie,255&(ae=0|F)&&(170&ae?ni(Se,256,He,qe):Jt(Se,256,He,qe)),ae=pe,Se=_e,255&(F>>=8)&&(170&F?ni(ke,320,ae,Se):Jt(ke,320,ae,Se)),j<d.Ub-1&&(A(me[Ce].y,0,X,$+480,16),A(me[Ce].f,0,ee,ie+224,8),A(me[Ce].ea,0,pe,_e+224,8)),F=8*G*d.B,me=d.sa,Ce=d.ta+16*N+16*G*d.R,ke=d.qa,ae=d.ra+8*N+F,Se=d.Ha,He=d.Ia+8*N+F,F=0;16>F;++F)A(me,Ce+F*d.R,X,$+32*F,16);for(F=0;8>F;++F)A(ke,ae+F*d.B,ee,ie+32*F,8),A(Se,He+F*d.B,pe,_e+32*F,8)}}function rs(d,m,F,N,j,G,X,$,ee){var ie=[0],pe=[0],_e=0,ae=ee!=null?ee.kd:0,me=ee??new We;if(d==null||12>F)return 7;me.data=d,me.w=m,me.ha=F,m=[m],F=[F],me.gb=[me.gb];e:{var Ce=m,ke=F,Se=me.gb;if(e(d!=null),e(ke!=null),e(Se!=null),Se[0]=0,12<=ke[0]&&!t(d,Ce[0],"RIFF")){if(t(d,Ce[0]+8,"WEBP")){Se=3;break e}var He=ye(d,Ce[0]+4);if(12>He||4294967286<He){Se=3;break e}if(ae&&He>ke[0]-8){Se=7;break e}Se[0]=He,Ce[0]+=12,ke[0]-=12}Se=0}if(Se!=0)return Se;for(He=0<me.gb[0],F=F[0];;){e:{var qe=d;ke=m,Se=F;var Ze=ie,Xe=pe,mt=Ce=[0];if((dt=_e=[_e])[0]=0,8>Se[0])Se=7;else{if(!t(qe,ke[0],"VP8X")){if(ye(qe,ke[0]+4)!=10){Se=3;break e}if(18>Se[0]){Se=7;break e}var ut=ye(qe,ke[0]+8),It=1+Be(qe,ke[0]+12);if(2147483648<=It*(qe=1+Be(qe,ke[0]+15))){Se=3;break e}mt!=null&&(mt[0]=ut),Ze!=null&&(Ze[0]=It),Xe!=null&&(Xe[0]=qe),ke[0]+=18,Se[0]-=18,dt[0]=1}Se=0}}if(_e=_e[0],Ce=Ce[0],Se!=0)return Se;if(ke=!!(2&Ce),!He&&_e)return 3;if(G!=null&&(G[0]=!!(16&Ce)),X!=null&&(X[0]=ke),$!=null&&($[0]=0),X=ie[0],Ce=pe[0],_e&&ke&&ee==null){Se=0;break}if(4>F){Se=7;break}if(He&&_e||!He&&!_e&&!t(d,m[0],"ALPH")){F=[F],me.na=[me.na],me.P=[me.P],me.Sa=[me.Sa];e:{ut=d,Se=m,He=F;var dt=me.gb;Ze=me.na,Xe=me.P,mt=me.Sa,It=22,e(ut!=null),e(He!=null),qe=Se[0];var Lt=He[0];for(e(Ze!=null),e(mt!=null),Ze[0]=null,Xe[0]=null,mt[0]=0;;){if(Se[0]=qe,He[0]=Lt,8>Lt){Se=7;break e}var $r=ye(ut,qe+4);if(4294967286<$r){Se=3;break e}var Qt=8+$r+1&-2;if(It+=Qt,0<dt&&It>dt){Se=3;break e}if(!t(ut,qe,"VP8 ")||!t(ut,qe,"VP8L")){Se=0;break e}if(Lt[0]<Qt){Se=7;break e}t(ut,qe,"ALPH")||(Ze[0]=ut,Xe[0]=qe+8,mt[0]=$r),qe+=Qt,Lt-=Qt}}if(F=F[0],me.na=me.na[0],me.P=me.P[0],me.Sa=me.Sa[0],Se!=0)break}F=[F],me.Ja=[me.Ja],me.xa=[me.xa];e:if(dt=d,Se=m,He=F,Ze=me.gb[0],Xe=me.Ja,mt=me.xa,ut=Se[0],qe=!t(dt,ut,"VP8 "),It=!t(dt,ut,"VP8L"),e(dt!=null),e(He!=null),e(Xe!=null),e(mt!=null),8>He[0])Se=7;else{if(qe||It){if(dt=ye(dt,ut+4),12<=Ze&&dt>Ze-12){Se=3;break e}if(ae&&dt>He[0]-8){Se=7;break e}Xe[0]=dt,Se[0]+=8,He[0]-=8,mt[0]=It}else mt[0]=5<=He[0]&&dt[ut+0]==47&&!(dt[ut+4]>>5),Xe[0]=He[0];Se=0}if(F=F[0],me.Ja=me.Ja[0],me.xa=me.xa[0],m=m[0],Se!=0)break;if(4294967286<me.Ja)return 3;if($==null||ke||($[0]=me.xa?2:1),X=[X],Ce=[Ce],me.xa){if(5>F){Se=7;break}$=X,ae=Ce,ke=G,d==null||5>F?d=0:5<=F&&d[m+0]==47&&!(d[m+4]>>5)?(He=[0],dt=[0],Ze=[0],Ae(Xe=new P,d,m,F),nA(Xe,He,dt,Ze)?($!=null&&($[0]=He[0]),ae!=null&&(ae[0]=dt[0]),ke!=null&&(ke[0]=Ze[0]),d=1):d=0):d=0}else{if(10>F){Se=7;break}$=Ce,d==null||10>F||!Bf(d,m+3,F-3)?d=0:(ae=d[m+0]|d[m+1]<<8|d[m+2]<<16,ke=16383&(d[m+7]<<8|d[m+6]),d=16383&(d[m+9]<<8|d[m+8]),1&ae||3<(ae>>1&7)||!(ae>>4&1)||ae>>5>=me.Ja||!ke||!d?d=0:(X&&(X[0]=ke),$&&($[0]=d),d=1))}if(!d||(X=X[0],Ce=Ce[0],_e&&(ie[0]!=X||pe[0]!=Ce)))return 3;ee!=null&&(ee[0]=me,ee.offset=m-ee.w,e(4294967286>m-ee.w),e(ee.offset==ee.ha-F));break}return Se==0||Se==7&&_e&&ee==null?(G!=null&&(G[0]|=me.na!=null&&0<me.na.length),N!=null&&(N[0]=X),j!=null&&(j[0]=Ce),0):Se}function yl(d,m,F){var N=m.width,j=m.height,G=0,X=0,$=N,ee=j;if(m.Da=d!=null&&0<d.Da,m.Da&&($=d.cd,ee=d.bd,G=d.v,X=d.j,11>F||(G&=-2,X&=-2),0>G||0>X||0>=$||0>=ee||G+$>N||X+ee>j))return 0;if(m.v=G,m.j=X,m.va=G+$,m.o=X+ee,m.U=$,m.T=ee,m.da=d!=null&&0<d.da,m.da){if(!Te($,ee,F=[d.ib],G=[d.hb]))return 0;m.ib=F[0],m.hb=G[0]}return m.ob=d!=null&&d.ob,m.Kb=d==null||!d.Sd,m.da&&(m.ob=m.ib<3*N/4&&m.hb<3*j/4,m.Kb=0),1}function Bl(d){if(d==null)return 2;if(11>d.S){var m=d.f.RGBA;m.fb+=(d.height-1)*m.A,m.A=-m.A}else m=d.f.kb,d=d.height,m.O+=(d-1)*m.fa,m.fa=-m.fa,m.N+=(d-1>>1)*m.Ab,m.Ab=-m.Ab,m.W+=(d-1>>1)*m.Db,m.Db=-m.Db,m.F!=null&&(m.J+=(d-1)*m.lb,m.lb=-m.lb);return 0}function sa(d,m,F,N){if(N==null||0>=d||0>=m)return 2;if(F!=null){if(F.Da){var j=F.cd,G=F.bd,X=-2&F.v,$=-2&F.j;if(0>X||0>$||0>=j||0>=G||X+j>d||$+G>m)return 2;d=j,m=G}if(F.da){if(!Te(d,m,j=[F.ib],G=[F.hb]))return 2;d=j[0],m=G[0]}}N.width=d,N.height=m;e:{var ee=N.width,ie=N.height;if(d=N.S,0>=ee||0>=ie||!(d>=Pf&&13>d))d=2;else{if(0>=N.Rd&&N.sd==null){X=G=j=m=0;var pe=($=ee*IS[d])*ie;if(11>d||(G=(ie+1)/2*(m=(ee+1)/2),d==12&&(X=(j=ee)*ie)),(ie=i(pe+2*G+X))==null){d=1;break e}N.sd=ie,11>d?((ee=N.f.RGBA).eb=ie,ee.fb=0,ee.A=$,ee.size=pe):((ee=N.f.kb).y=ie,ee.O=0,ee.fa=$,ee.Fd=pe,ee.f=ie,ee.N=0+pe,ee.Ab=m,ee.Cd=G,ee.ea=ie,ee.W=0+pe+G,ee.Db=m,ee.Ed=G,d==12&&(ee.F=ie,ee.J=0+pe+2*G),ee.Tc=X,ee.lb=j)}if(m=1,j=N.S,G=N.width,X=N.height,j>=Pf&&13>j)if(11>j)d=N.f.RGBA,m&=($=Math.abs(d.A))*(X-1)+G<=d.size,m&=$>=G*IS[j],m&=d.eb!=null;else{d=N.f.kb,$=(G+1)/2,pe=(X+1)/2,ee=Math.abs(d.fa),ie=Math.abs(d.Ab);var _e=Math.abs(d.Db),ae=Math.abs(d.lb),me=ae*(X-1)+G;m&=ee*(X-1)+G<=d.Fd,m&=ie*(pe-1)+$<=d.Cd,m=(m&=_e*(pe-1)+$<=d.Ed)&ee>=G&ie>=$&_e>=$,m&=d.y!=null,m&=d.f!=null,m&=d.ea!=null,j==12&&(m&=ae>=G,m&=me<=d.Tc,m&=d.F!=null)}else m=0;d=m?0:2}}return d!=0||F!=null&&F.fd&&(d=Bl(N)),d}var As=64,JA=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],ZA=24,oa=32,Qi=8,la=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Me("Predictor0","PredictorAdd0"),_.Predictor0=function(){return 4278190080},_.Predictor1=function(d){return d},_.Predictor2=function(d,m,F){return m[F+0]},_.Predictor3=function(d,m,F){return m[F+1]},_.Predictor4=function(d,m,F){return m[F-1]},_.Predictor5=function(d,m,F){return Ye(Ye(d,m[F+1]),m[F+0])},_.Predictor6=function(d,m,F){return Ye(d,m[F-1])},_.Predictor7=function(d,m,F){return Ye(d,m[F+0])},_.Predictor8=function(d,m,F){return Ye(m[F-1],m[F+0])},_.Predictor9=function(d,m,F){return Ye(m[F+0],m[F+1])},_.Predictor10=function(d,m,F){return Ye(Ye(d,m[F-1]),Ye(m[F+0],m[F+1]))},_.Predictor11=function(d,m,F){var N=m[F+0];return 0>=je(N>>24&255,d>>24&255,(m=m[F-1])>>24&255)+je(N>>16&255,d>>16&255,m>>16&255)+je(N>>8&255,d>>8&255,m>>8&255)+je(255&N,255&d,255&m)?N:d},_.Predictor12=function(d,m,F){var N=m[F+0];return(xe((d>>24&255)+(N>>24&255)-((m=m[F-1])>>24&255))<<24|xe((d>>16&255)+(N>>16&255)-(m>>16&255))<<16|xe((d>>8&255)+(N>>8&255)-(m>>8&255))<<8|xe((255&d)+(255&N)-(255&m)))>>>0},_.Predictor13=function(d,m,F){var N=m[F-1];return(Oe((d=Ye(d,m[F+0]))>>24&255,N>>24&255)<<24|Oe(d>>16&255,N>>16&255)<<16|Oe(d>>8&255,N>>8&255)<<8|Oe(255&d,255&N))>>>0};var bl=_.PredictorAdd0;_.PredictorAdd1=ge,Me("Predictor2","PredictorAdd2"),Me("Predictor3","PredictorAdd3"),Me("Predictor4","PredictorAdd4"),Me("Predictor5","PredictorAdd5"),Me("Predictor6","PredictorAdd6"),Me("Predictor7","PredictorAdd7"),Me("Predictor8","PredictorAdd8"),Me("Predictor9","PredictorAdd9"),Me("Predictor10","PredictorAdd10"),Me("Predictor11","PredictorAdd11"),Me("Predictor12","PredictorAdd12"),Me("Predictor13","PredictorAdd13");var Gs=_.PredictorAdd2;fe("ColorIndexInverseTransform","MapARGB","32b",function(d){return d>>8&255},function(d){return d}),fe("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(d){return d},function(d){return d>>8&255});var Ir,Of=_.ColorIndexInverseTransform,ri=_.MapARGB,Ai=_.VP8LColorIndexInverseTransformAlpha,xl=_.MapAlpha,Cl=_.VP8LPredictorsAdd=[];Cl.length=16,(_.VP8LPredictors=[]).length=16,(_.VP8LPredictorsAdd_C=[]).length=16,(_.VP8LPredictors_C=[]).length=16;var El,Fl,ua,ca,fa,ns,ha,is,mn,ni,zt,Jt,Qr,Yr,Ni,Sl,Ws,Tf,iS,aS,sS,oS,lS,uS,Ul,cS,fS,hS,dS=i(511),gS=i(2041),pS=i(225),vS=i(767),mS=0,yv=gS,Lf=pS,en=vS,wn=dS,Pf=0,Rf=1,wS=2,Mf=3,Df=4,Bv=5,yS=6,bv=7,xv=8,kf=9,Cv=10,V8=[2,3,7],z8=[3,3,11],BS=[280,256,256,256,40],G8=[0,1,1,1,0],W8=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],X8=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Y8=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],$8=8,Ev=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Fv=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],_l=null,J8=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Z8=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],bS=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],eM=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],tM=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],rM=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],AM=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],da=[],Pn=[],Oi=[],nM=1,xS=2,ga=[],yn=[];_i("UpsampleRgbLinePair",aa,3),_i("UpsampleBgrLinePair",cA,3),_i("UpsampleRgbaLinePair",OA,4),_i("UpsampleBgraLinePair",wl,4),_i("UpsampleArgbLinePair",ml,4),_i("UpsampleRgba4444LinePair",ts,2),_i("UpsampleRgb565LinePair",es,2);var iM=_.UpsampleRgbLinePair,aM=_.UpsampleBgrLinePair,CS=_.UpsampleRgbaLinePair,ES=_.UpsampleBgraLinePair,FS=_.UpsampleArgbLinePair,SS=_.UpsampleRgba4444LinePair,sM=_.UpsampleRgb565LinePair,Hf=16,jf=1<<Hf-1,Il=-227,Sv=482,oM=6,US=0,lM=i(256),uM=i(256),cM=i(256),fM=i(256),hM=i(Sv-Il),dM=i(Sv-Il);Ii("YuvToRgbRow",aa,3),Ii("YuvToBgrRow",cA,3),Ii("YuvToRgbaRow",OA,4),Ii("YuvToBgraRow",wl,4),Ii("YuvToArgbRow",ml,4),Ii("YuvToRgba4444Row",ts,2),Ii("YuvToRgb565Row",es,2);var _S=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Kf=[0,2,8],gM=[8,7,6,4,4,2,2,2,1,1,1,1],pM=1;this.WebPDecodeRGBA=function(d,m,F,N,j){var G=Rf,X=new Ke,$=new nt;X.ba=$,$.S=G,$.width=[$.width],$.height=[$.height];var ee=$.width,ie=$.height,pe=new tt;if(pe==null||d==null)var _e=2;else e(pe!=null),_e=rs(d,m,F,pe.width,pe.height,pe.Pd,pe.Qd,pe.format,null);if(_e!=0?ee=0:(ee!=null&&(ee[0]=pe.width[0]),ie!=null&&(ie[0]=pe.height[0]),ee=1),ee){$.width=$.width[0],$.height=$.height[0],N!=null&&(N[0]=$.width),j!=null&&(j[0]=$.height);e:{if(N=new ks,(j=new We).data=d,j.w=m,j.ha=F,j.kd=1,m=[0],e(j!=null),((d=rs(j.data,j.w,j.ha,null,null,null,m,null,j))==0||d==7)&&m[0]&&(d=4),(m=d)==0){if(e(X!=null),N.data=j.data,N.w=j.w+j.offset,N.ha=j.ha-j.offset,N.put=Bt,N.ac=Vr,N.bc=Mr,N.ma=X,j.xa){if((d=Jn())==null){X=1;break e}if((function(ae,me){var Ce=[0],ke=[0],Se=[0];t:for(;;){if(ae==null)return 0;if(me==null)return ae.a=2,0;if(ae.l=me,ae.a=0,Ae(ae.m,me.data,me.w,me.ha),!nA(ae.m,Ce,ke,Se)){ae.a=3;break t}if(ae.xb=xS,me.width=Ce[0],me.height=ke[0],!dn(Ce[0],ke[0],1,ae,null))break t;return 1}return e(ae.a!=0),0})(d,N)){if(N=(m=sa(N.width,N.height,X.Oa,X.ba))==0){t:{N=d;r:for(;;){if(N==null){N=0;break t}if(e(N.s.yc!=null),e(N.s.Ya!=null),e(0<N.s.Wb),e((F=N.l)!=null),e((j=F.ma)!=null),N.xb!=0){if(N.ca=j.ba,N.tb=j.tb,e(N.ca!=null),!yl(j.Oa,F,Mf)){N.a=2;break r}if(!ft(N,F.width)||F.da)break r;if((F.da||et(N.ca.S))&&Ln(),11>N.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),N.ca.f.kb.F!=null&&Ln()),N.Pb&&0<N.s.ua&&N.s.vb.X==null&&!R(N.s.vb,N.s.Wa.Xa)){N.a=1;break r}N.xb=0}if(!KA(N,N.V,N.Ba,N.c,N.i,F.o,QA))break r;j.Dc=N.Ma,N=1;break t}e(N.a!=0),N=0}N=!N}N&&(m=d.a)}else m=d.a}else{if((d=new iv)==null){X=1;break e}if(d.Fa=j.na,d.P=j.P,d.qc=j.Sa,ei(d,N)){if((m=sa(N.width,N.height,X.Oa,X.ba))==0){if(d.Aa=0,F=X.Oa,e((j=d)!=null),F!=null){if(0<(ee=0>(ee=F.Md)?0:100<ee?255:255*ee/100)){for(ie=pe=0;4>ie;++ie)12>(_e=j.pb[ie]).lc&&(_e.ia=ee*gM[0>_e.lc?0:_e.lc]>>3),pe|=_e.ia;pe&&(alert("todo:VP8InitRandom"),j.ia=1)}j.Ga=F.Id,100<j.Ga?j.Ga=100:0>j.Ga&&(j.Ga=0)}(function(ae,me){if(ae==null)return 0;if(me==null)return kr(ae,2,"NULL VP8Io parameter in VP8Decode().");if(!ae.cb&&!ei(ae,me))return 0;if(e(ae.cb),me.ac==null||me.ac(me)){me.ob&&(ae.L=0);var Ce=Kf[ae.L];if(ae.L==2?(ae.yb=0,ae.zb=0):(ae.yb=me.v-Ce>>4,ae.zb=me.j-Ce>>4,0>ae.yb&&(ae.yb=0),0>ae.zb&&(ae.zb=0)),ae.Va=me.o+15+Ce>>4,ae.Hb=me.va+15+Ce>>4,ae.Hb>ae.za&&(ae.Hb=ae.za),ae.Va>ae.Ub&&(ae.Va=ae.Ub),0<ae.L){var ke=ae.ed;for(Ce=0;4>Ce;++Ce){var Se;if(ae.Qa.Cb){var He=ae.Qa.Lb[Ce];ae.Qa.Fb||(He+=ke.Tb)}else He=ke.Tb;for(Se=0;1>=Se;++Se){var qe=ae.gd[Ce][Se],Ze=He;if(ke.Pc&&(Ze+=ke.vd[0],Se&&(Ze+=ke.od[0])),0<(Ze=0>Ze?0:63<Ze?63:Ze)){var Xe=Ze;0<ke.wb&&(Xe=4<ke.wb?Xe>>2:Xe>>1)>9-ke.wb&&(Xe=9-ke.wb),1>Xe&&(Xe=1),qe.dd=Xe,qe.tc=2*Ze+Xe,qe.ld=40<=Ze?2:15<=Ze?1:0}else qe.tc=0;qe.La=Se}}}Ce=0}else kr(ae,6,"Frame setup failed"),Ce=ae.a;if(Ce=Ce==0){if(Ce){ae.$c=0,0<ae.Aa||(ae.Ic=pM);t:{Ce=ae.Ic,ke=4*(Xe=ae.za);var mt=32*Xe,ut=Xe+1,It=0<ae.L?Xe*(0<ae.Aa?2:1):0,dt=(ae.Aa==2?2:1)*Xe;if((qe=ke+832+(Se=3*(16*Ce+Kf[ae.L])/2*mt)+(He=ae.Fa!=null&&0<ae.Fa.length?ae.Kc.c*ae.Kc.i:0))!=qe)Ce=0;else{if(qe>ae.Vb){if(ae.Vb=0,ae.Ec=i(qe),ae.Fc=0,ae.Ec==null){Ce=kr(ae,1,"no memory during frame initialization.");break t}ae.Vb=qe}qe=ae.Ec,Ze=ae.Fc,ae.Ac=qe,ae.Bc=Ze,Ze+=ke,ae.Gd=s(mt,za),ae.Hd=0,ae.rb=s(ut+1,gn),ae.sb=1,ae.wa=It?s(It,yr):null,ae.Y=0,ae.D.Nb=0,ae.D.wa=ae.wa,ae.D.Y=ae.Y,0<ae.Aa&&(ae.D.Y+=Xe),e(!0),ae.oc=qe,ae.pc=Ze,Ze+=832,ae.ya=s(dt,cr),ae.aa=0,ae.D.ya=ae.ya,ae.D.aa=ae.aa,ae.Aa==2&&(ae.D.aa+=Xe),ae.R=16*Xe,ae.B=8*Xe,Xe=(mt=Kf[ae.L])*ae.R,mt=mt/2*ae.B,ae.sa=qe,ae.ta=Ze+Xe,ae.qa=ae.sa,ae.ra=ae.ta+16*Ce*ae.R+mt,ae.Ha=ae.qa,ae.Ia=ae.ra+8*Ce*ae.B+mt,ae.$c=0,Ze+=Se,ae.mb=He?qe:null,ae.nb=He?Ze:null,e(Ze+He<=ae.Fc+ae.Vb),bf(ae),n(ae.Ac,ae.Bc,0,ke),Ce=1}}if(Ce){if(me.ka=0,me.y=ae.sa,me.O=ae.ta,me.f=ae.qa,me.N=ae.ra,me.ea=ae.Ha,me.Vd=ae.Ia,me.fa=ae.R,me.Rc=ae.B,me.F=null,me.J=0,!mS){for(Ce=-255;255>=Ce;++Ce)dS[255+Ce]=0>Ce?-Ce:Ce;for(Ce=-1020;1020>=Ce;++Ce)gS[1020+Ce]=-128>Ce?-128:127<Ce?127:Ce;for(Ce=-112;112>=Ce;++Ce)pS[112+Ce]=-16>Ce?-16:15<Ce?15:Ce;for(Ce=-255;510>=Ce;++Ce)vS[255+Ce]=0>Ce?0:255<Ce?255:Ce;mS=1}ha=js,is=sv,ni=ti,zt=Cf,Jt=Ef,mn=av,Qr=If,Yr=$a,Ni=H,Sl=se,Ws=Qf,Tf=b,iS=he,aS=be,sS=Ya,oS=pl,lS=Uf,uS=_f,Pn[0]=gv,Pn[1]=ov,Pn[2]=hv,Pn[3]=dv,Pn[4]=bi,Pn[5]=pv,Pn[6]=xi,Pn[7]=vv,Pn[8]=cl,Pn[9]=Ks,da[0]=cv,da[1]=uv,da[2]=ll,da[3]=Ff,da[4]=Wa,da[5]=ul,da[6]=fv,Oi[0]=wv,Oi[1]=lv,Oi[2]=Xa,Oi[3]=mv,Oi[4]=hl,Oi[5]=fl,Oi[6]=Sf,Ce=1}else Ce=0}Ce&&(Ce=(function(Lt,$r){for(Lt.M=0;Lt.M<Lt.Va;++Lt.M){var Qt,gt=Lt.Jc[Lt.M&Lt.Xb],rt=Lt.m,Nr=Lt;for(Qt=0;Qt<Nr.za;++Qt){var St=rt,Pt=Nr,ir=Pt.Ac,fA=Pt.Bc+4*Qt,TA=Pt.zc,Br=Pt.ya[Pt.aa+Qt];if(Pt.Qa.Bb?Br.$b=oe(St,Pt.Pa.jb[0])?2+oe(St,Pt.Pa.jb[2]):oe(St,Pt.Pa.jb[1]):Br.$b=0,Pt.kc&&(Br.Ad=oe(St,Pt.Bd)),Br.Za=!oe(St,145)+0,Br.Za){var xA=Br.Ob,LA=0;for(Pt=0;4>Pt;++Pt){var Jr,Mt=TA[0+Pt];for(Jr=0;4>Jr;++Jr){Mt=tM[ir[fA+Jr]][Mt];for(var Gt=bS[oe(St,Mt[0])];0<Gt;)Gt=bS[2*Gt+oe(St,Mt[Gt])];Mt=-Gt,ir[fA+Jr]=Mt}A(xA,LA,ir,fA,4),LA+=4,TA[0+Pt]=Mt}}else Mt=oe(St,156)?oe(St,128)?1:3:oe(St,163)?2:0,Br.Ob[0]=Mt,n(ir,fA,Mt,4),n(TA,0,Mt,4);Br.Dd=oe(St,142)?oe(St,114)?oe(St,183)?1:3:2:0}if(Nr.m.Ka)return kr(Lt,7,"Premature end-of-partition0 encountered.");for(;Lt.ja<Lt.za;++Lt.ja){if(Nr=gt,St=(rt=Lt).rb[rt.sb-1],ir=rt.rb[rt.sb+rt.ja],Qt=rt.ya[rt.aa+rt.ja],fA=rt.kc?Qt.Ad:0)St.la=ir.la=0,Qt.Za||(St.Na=ir.Na=0),Qt.Hc=0,Qt.Gc=0,Qt.ia=0;else{var br,Wt;if(St=ir,ir=Nr,fA=rt.Pa.Xc,TA=rt.ya[rt.aa+rt.ja],Br=rt.pb[TA.$b],Pt=TA.ad,xA=0,LA=rt.rb[rt.sb-1],Mt=Jr=0,n(Pt,xA,0,384),TA.Za)var hA=0,Rn=fA[3];else{Gt=i(16);var Or=St.Na+LA.Na;if(Or=_l(ir,fA[1],Or,Br.Eb,0,Gt,0),St.Na=LA.Na=(0<Or)+0,1<Or)ha(Gt,0,Pt,xA);else{var qA=Gt[0]+3>>3;for(Gt=0;256>Gt;Gt+=16)Pt[xA+Gt]=qA}hA=1,Rn=fA[0]}var Zt=15&St.la,Zr=15&LA.la;for(Gt=0;4>Gt;++Gt){var tn=1&Zr;for(qA=Wt=0;4>qA;++qA)Zt=Zt>>1|(tn=(Or=_l(ir,Rn,Or=tn+(1&Zt),Br.Sc,hA,Pt,xA))>hA)<<7,Wt=Wt<<2|(3<Or?3:1<Or?2:Pt[xA+0]!=0),xA+=16;Zt>>=4,Zr=Zr>>1|tn<<7,Jr=(Jr<<8|Wt)>>>0}for(Rn=Zt,hA=Zr>>4,br=0;4>br;br+=2){for(Wt=0,Zt=St.la>>4+br,Zr=LA.la>>4+br,Gt=0;2>Gt;++Gt){for(tn=1&Zr,qA=0;2>qA;++qA)Or=tn+(1&Zt),Zt=Zt>>1|(tn=0<(Or=_l(ir,fA[2],Or,Br.Qc,0,Pt,xA)))<<3,Wt=Wt<<2|(3<Or?3:1<Or?2:Pt[xA+0]!=0),xA+=16;Zt>>=2,Zr=Zr>>1|tn<<5}Mt|=Wt<<4*br,Rn|=Zt<<4<<br,hA|=(240&Zr)<<br}St.la=Rn,LA.la=hA,TA.Hc=Jr,TA.Gc=Mt,TA.ia=43690&Mt?0:Br.ia,fA=!(Jr|Mt)}if(0<rt.L&&(rt.wa[rt.Y+rt.ja]=rt.gd[Qt.$b][Qt.Za],rt.wa[rt.Y+rt.ja].La|=!fA),Nr.Ka)return kr(Lt,7,"Premature end-of-file encountered.")}if(bf(Lt),rt=$r,Nr=1,Qt=(gt=Lt).D,St=0<gt.L&>.M>=gt.zb&>.M<=gt.Va,gt.Aa==0)t:{if(Qt.M=gt.M,Qt.uc=St,vn(gt,Qt),Nr=1,Qt=(Wt=gt.D).Nb,St=(Mt=Kf[gt.L])*gt.R,ir=Mt/2*gt.B,Gt=16*Qt*gt.R,qA=8*Qt*gt.B,fA=gt.sa,TA=gt.ta-St+Gt,Br=gt.qa,Pt=gt.ra-ir+qA,xA=gt.Ha,LA=gt.Ia-ir+qA,Zr=(Zt=Wt.M)==0,Jr=Zt>=gt.Va-1,gt.Aa==2&&vn(gt,Wt),Wt.uc)for(tn=(Or=gt).D.M,e(Or.D.uc),Wt=Or.yb;Wt<Or.Hb;++Wt){hA=Wt,Rn=tn;var PA=(rn=(dA=Or).D).Nb;br=dA.R;var rn=rn.wa[rn.Y+hA],An=dA.sa,VA=dA.ta+16*PA*br+16*hA,nn=rn.dd,rr=rn.tc;if(rr!=0)if(e(3<=rr),dA.L==1)0<hA&&oS(An,VA,br,rr+4),rn.La&&uS(An,VA,br,rr),0<Rn&&sS(An,VA,br,rr+4),rn.La&&lS(An,VA,br,rr);else{var an=dA.B,Mn=dA.qa,as=dA.ra+8*PA*an+8*hA,Ti=dA.Ha,dA=dA.Ia+8*PA*an+8*hA;PA=rn.ld,0<hA&&(Yr(An,VA,br,rr+4,nn,PA),Sl(Mn,as,Ti,dA,an,rr+4,nn,PA)),rn.La&&(Tf(An,VA,br,rr,nn,PA),aS(Mn,as,Ti,dA,an,rr,nn,PA)),0<Rn&&(Qr(An,VA,br,rr+4,nn,PA),Ni(Mn,as,Ti,dA,an,rr+4,nn,PA)),rn.La&&(Ws(An,VA,br,rr,nn,PA),iS(Mn,as,Ti,dA,an,rr,nn,PA))}}if(gt.ia&&alert("todo:DitherRow"),rt.put!=null){if(Wt=16*Zt,Zt=16*(Zt+1),Zr?(rt.y=gt.sa,rt.O=gt.ta+Gt,rt.f=gt.qa,rt.N=gt.ra+qA,rt.ea=gt.Ha,rt.W=gt.Ia+qA):(Wt-=Mt,rt.y=fA,rt.O=TA,rt.f=Br,rt.N=Pt,rt.ea=xA,rt.W=LA),Jr||(Zt-=Mt),Zt>rt.o&&(Zt=rt.o),rt.F=null,rt.J=null,gt.Fa!=null&&0<gt.Fa.length&&Wt<Zt&&(rt.J=tr(gt,rt,Wt,Zt-Wt),rt.F=gt.mb,rt.F==null&&rt.F.length==0)){Nr=kr(gt,3,"Could not decode alpha data.");break t}Wt<rt.j&&(Mt=rt.j-Wt,Wt=rt.j,e(!(1&Mt)),rt.O+=gt.R*Mt,rt.N+=gt.B*(Mt>>1),rt.W+=gt.B*(Mt>>1),rt.F!=null&&(rt.J+=rt.width*Mt)),Wt<Zt&&(rt.O+=rt.v,rt.N+=rt.v>>1,rt.W+=rt.v>>1,rt.F!=null&&(rt.J+=rt.v),rt.ka=Wt-rt.j,rt.U=rt.va-rt.v,rt.T=Zt-Wt,Nr=rt.put(rt))}Qt+1!=gt.Ic||Jr||(A(gt.sa,gt.ta-St,fA,TA+16*gt.R,St),A(gt.qa,gt.ra-ir,Br,Pt+8*gt.B,ir),A(gt.Ha,gt.Ia-ir,xA,LA+8*gt.B,ir))}if(!Nr)return kr(Lt,6,"Output aborted.")}return 1})(ae,me)),me.bc!=null&&me.bc(me),Ce&=1}return Ce?(ae.cb=0,Ce):0})(d,N)||(m=d.a)}}else m=d.a}m==0&&X.Oa!=null&&X.Oa.fd&&(m=Bl(X.ba))}X=m}G=X!=0?null:11>G?$.f.RGBA.eb:$.f.kb.y}else G=null;return G};var IS=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function l(_,D){for(var U="",O=0;O<4;O++)U+=String.fromCharCode(_[D++]);return U}function u(_,D){return _[D+0]|_[D+1]<<8}function f(_,D){return(_[D+0]|_[D+1]<<8|_[D+2]<<16)>>>0}function h(_,D){return(_[D+0]|_[D+1]<<8|_[D+2]<<16|_[D+3]<<24)>>>0}new o;var c=[0],g=[0],p=[],y=new o,w=r,B=(function(_,D){var U={},O=0,M=!1,C=0,z=0;if(U.frames=[],!(function(I,P){for(var K=0;K<4;K++)if(I[P+K]!="RIFF".charCodeAt(K))return!0;return!1})(_,D)){for(h(_,D+=4),D+=8;D<_.length;){var re=l(_,D),ne=h(_,D+=4);D+=4;var Z=ne+(1&ne);switch(re){case"VP8 ":case"VP8L":U.frames[O]===void 0&&(U.frames[O]={}),(k=U.frames[O]).src_off=M?z:D-8,k.src_size=C+ne+8,O++,M&&(M=!1,C=0,z=0);break;case"VP8X":(k=U.header={}).feature_flags=_[D];var Ae=D+4;k.canvas_width=1+f(_,Ae),Ae+=3,k.canvas_height=1+f(_,Ae),Ae+=3;break;case"ALPH":M=!0,C=Z+8,z=D-8;break;case"ANIM":(k=U.header).bgcolor=h(_,D),Ae=D+4,k.loop_count=u(_,Ae),Ae+=2;break;case"ANMF":var V,k;(k=U.frames[O]={}).offset_x=2*f(_,D),D+=3,k.offset_y=2*f(_,D),D+=3,k.width=1+f(_,D),D+=3,k.height=1+f(_,D),D+=3,k.duration=f(_,D),D+=3,V=_[D++],k.dispose=1&V,k.blend=V>>1&1}re!="ANMF"&&(D+=Z)}return U}})(w,0);B.response=w,B.rgbaoutput=!0,B.dataurl=!1;var x=B.header?B.header:null,E=B.frames?B.frames:null;if(x){x.loop_counter=x.loop_count,c=[x.canvas_height],g=[x.canvas_width];for(var Q=0;Q<E.length&&E[Q].blend!=0;Q++);}var L=E[0],S=y.WebPDecodeRGBA(w,L.src_off,L.src_size,g,c);L.rgba=S,L.imgwidth=g[0],L.imgheight=c[0];for(var T=0;T<g[0]*c[0]*4;T++)p[T]=S[T];return this.width=g,this.height=c,this.data=p,this}(function(r){var e,t,A,n,i,s,a,o,l,u=function(I){return I=I||{},this.isStrokeTransparent=I.isStrokeTransparent||!1,this.strokeOpacity=I.strokeOpacity||1,this.strokeStyle=I.strokeStyle||"#000000",this.fillStyle=I.fillStyle||"#000000",this.isFillTransparent=I.isFillTransparent||!1,this.fillOpacity=I.fillOpacity||1,this.font=I.font||"10px sans-serif",this.textBaseline=I.textBaseline||"alphabetic",this.textAlign=I.textAlign||"left",this.lineWidth=I.lineWidth||1,this.lineJoin=I.lineJoin||"miter",this.lineCap=I.lineCap||"butt",this.path=I.path||[],this.transform=I.transform!==void 0?I.transform.clone():new o,this.globalCompositeOperation=I.globalCompositeOperation||"normal",this.globalAlpha=I.globalAlpha||1,this.clip_path=I.clip_path||[],this.currentPoint=I.currentPoint||new s,this.miterLimit=I.miterLimit||10,this.lastPoint=I.lastPoint||new s,this.lineDashOffset=I.lineDashOffset||0,this.lineDash=I.lineDash||[],this.margin=I.margin||[0,0,0,0],this.prevPageLastElemOffset=I.prevPageLastElemOffset||0,this.ignoreClearRect=typeof I.ignoreClearRect!="boolean"||I.ignoreClearRect,this};r.events.push(["initialized",function(){this.context2d=new f(this),e=this.internal.f2,t=this.internal.getCoordinateString,A=this.internal.getVerticalCoordinateString,n=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,s=this.internal.Point,a=this.internal.Rectangle,o=this.internal.Matrix,l=new u}]);var f=function(I){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var P=I;Object.defineProperty(this,"pdf",{get:function(){return P}});var K=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return K},set:function(R){K=!!R}});var Y=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return Y},set:function(R){Y=!!R}});var J=0;Object.defineProperty(this,"posX",{get:function(){return J},set:function(R){isNaN(R)||(J=R)}});var q=0;Object.defineProperty(this,"posY",{get:function(){return q},set:function(R){isNaN(R)||(q=R)}}),Object.defineProperty(this,"margin",{get:function(){return l.margin},set:function(R){var Ie;typeof R=="number"?Ie=[R,R,R,R]:((Ie=new Array(4))[0]=R[0],Ie[1]=R.length>=2?R[1]:Ie[0],Ie[2]=R.length>=3?R[2]:Ie[0],Ie[3]=R.length>=4?R[3]:Ie[1]),l.margin=Ie}});var W=!1;Object.defineProperty(this,"autoPaging",{get:function(){return W},set:function(R){W=R}});var te=0;Object.defineProperty(this,"lastBreak",{get:function(){return te},set:function(R){te=R}});var oe=[];Object.defineProperty(this,"pageBreaks",{get:function(){return oe},set:function(R){oe=R}}),Object.defineProperty(this,"ctx",{get:function(){return l},set:function(R){R instanceof u&&(l=R)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(R){l.path=R}});var we=[];Object.defineProperty(this,"ctxStack",{get:function(){return we},set:function(R){we=R}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(R){var Ie;Ie=h(R),this.ctx.fillStyle=Ie.style,this.ctx.isFillTransparent=Ie.a===0,this.ctx.fillOpacity=Ie.a,this.pdf.setFillColor(Ie.r,Ie.g,Ie.b,{a:Ie.a}),this.pdf.setTextColor(Ie.r,Ie.g,Ie.b,{a:Ie.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(R){var Ie=h(R);this.ctx.strokeStyle=Ie.style,this.ctx.isStrokeTransparent=Ie.a===0,this.ctx.strokeOpacity=Ie.a,Ie.a===0?this.pdf.setDrawColor(255,255,255):(Ie.a,this.pdf.setDrawColor(Ie.r,Ie.g,Ie.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(R){["butt","round","square"].indexOf(R)!==-1&&(this.ctx.lineCap=R,this.pdf.setLineCap(R))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(R){isNaN(R)||(this.ctx.lineWidth=R,this.pdf.setLineWidth(R))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(R){["bevel","round","miter"].indexOf(R)!==-1&&(this.ctx.lineJoin=R,this.pdf.setLineJoin(R))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(R){isNaN(R)||(this.ctx.miterLimit=R,this.pdf.setMiterLimit(R))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(R){this.ctx.textBaseline=R}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(R){["right","end","center","left","start"].indexOf(R)!==-1&&(this.ctx.textAlign=R)}});var le=null,Be=null,ye=null;Object.defineProperty(this,"fontFaces",{get:function(){return ye},set:function(R){le=null,Be=null,ye=R}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(R){var Ie;if(this.ctx.font=R,(Ie=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(R))!==null){var Ue=Ie[1];Ie[2];var Te=Ie[3],Ee=Ie[4];Ie[5];var Ve=Ie[6],Me=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Ee)[2];Ee=Math.floor(Me==="px"?parseFloat(Ee)*this.pdf.internal.scaleFactor:Me==="em"?parseFloat(Ee)*this.pdf.getFontSize():parseFloat(Ee)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Ee);var ze=(function(fe){var Pe,Fe,Ne=[],ve=fe.trim();if(ve==="")return xd;if(ve in vB)return[vB[ve]];for(;ve!=="";){switch(Fe=null,Pe=(ve=wB(ve)).charAt(0)){case'"':case"'":Fe=hQ(ve.substring(1),Pe);break;default:Fe=dQ(ve)}if(Fe===null||(Ne.push(Fe[0]),(ve=wB(Fe[1]))!==""&&ve.charAt(0)!==","))return xd;ve=ve.replace(/^,/,"")}return Ne})(Ve);if(this.fontFaces){var Ye=(function(fe,Pe){var Fe=fe.getFontList(),Ne=JSON.stringify(Fe);if(le===null||Be!==Ne){var ve=(function(Qe){var De=[];return Object.keys(Qe).forEach(function(it){Qe[it].forEach(function(et){var Ge=null;switch(et){case"bold":Ge={family:it,weight:"bold"};break;case"italic":Ge={family:it,style:"italic"};break;case"bolditalic":Ge={family:it,weight:"bold",style:"italic"};break;case"":case"normal":Ge={family:it}}Ge!==null&&(Ge.ref={name:it,style:et},De.push(Ge))})}),De})(Fe);le=(function(Qe){for(var De={},it=0;it<Qe.length;++it){var et=bd(Qe[it]),Ge=et.family,At=et.stretch,nt=et.style,tt=et.weight;De[Ge]=De[Ge]||{},De[Ge][At]=De[Ge][At]||{},De[Ge][At][nt]=De[Ge][At][nt]||{},De[Ge][At][nt][tt]=et}return De})(ve.concat(Pe)),Be=Ne}return le})(this.pdf,this.fontFaces),xe=ze.map(function(fe){return{family:fe,stretch:"normal",weight:Te,style:Ue}}),Oe=(function(fe,Pe,Fe){for(var Ne=(Fe=Fe||{}).defaultFontFamily||"times",ve=Object.assign({},fQ,Fe.genericFontFamilies||{}),Qe=null,De=null,it=0;it<Pe.length;++it)if(ve[(Qe=bd(Pe[it])).family]&&(Qe.family=ve[Qe.family]),fe.hasOwnProperty(Qe.family)){De=fe[Qe.family];break}if(!(De=De||fe[Ne]))throw new Error("Could not find a font-family for the rule '"+mB(Qe)+"' and default family '"+Ne+"'.");if(De=(function(et,Ge){if(Ge[et])return Ge[et];var At=Bd[et],nt=At<=Bd.normal?-1:1,tt=pB(Ge,dB,At,nt);if(!tt)throw new Error("Could not find a matching font-stretch value for "+et);return tt})(Qe.stretch,De),De=(function(et,Ge){if(Ge[et])return Ge[et];for(var At=hB[et],nt=0;nt<At.length;++nt)if(Ge[At[nt]])return Ge[At[nt]];throw new Error("Could not find a matching font-style for "+et)})(Qe.style,De),!(De=(function(et,Ge){if(Ge[et])return Ge[et];if(et===400&&Ge[500])return Ge[500];if(et===500&&Ge[400])return Ge[400];var At=cQ[et],nt=pB(Ge,gB,At,et<400?-1:1);if(!nt)throw new Error("Could not find a matching font-weight for value "+et);return nt})(Qe.weight,De)))throw new Error("Failed to resolve a font for the rule '"+mB(Qe)+"'.");return De})(Ye,xe);this.pdf.setFont(Oe.ref.name,Oe.ref.style)}else{var je="";(Te==="bold"||parseInt(Te,10)>=700||Ue==="bold")&&(je="bold"),Ue==="italic"&&(je+="italic"),je.length===0&&(je="normal");for(var ge="",Re={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Le=0;Le<ze.length;Le++){if(this.pdf.internal.getFont(ze[Le],je,{noFallback:!0,disableWarning:!0})!==void 0){ge=ze[Le];break}if(je==="bolditalic"&&this.pdf.internal.getFont(ze[Le],"bold",{noFallback:!0,disableWarning:!0})!==void 0)ge=ze[Le],je="bold";else if(this.pdf.internal.getFont(ze[Le],"normal",{noFallback:!0,disableWarning:!0})!==void 0){ge=ze[Le],je="normal";break}}if(ge===""){for(var ue=0;ue<ze.length;ue++)if(Re[ze[ue]]){ge=Re[ze[ue]];break}}ge=ge===""?"Times":ge,this.pdf.setFont(ge,je)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(R){this.ctx.globalCompositeOperation=R}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(R){this.ctx.globalAlpha=R}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(R){this.ctx.lineDashOffset=R,k.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(R){this.ctx.lineDash=R,k.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(R){this.ctx.ignoreClearRect=!!R}})};f.prototype.setLineDash=function(I){this.lineDash=I},f.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},f.prototype.fill=function(){E.call(this,"fill",!1)},f.prototype.stroke=function(){E.call(this,"stroke",!1)},f.prototype.beginPath=function(){this.path=[{type:"begin"}]},f.prototype.moveTo=function(I,P){if(isNaN(I)||isNaN(P))throw $t.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var K=this.ctx.transform.applyToPoint(new s(I,P));this.path.push({type:"mt",x:K.x,y:K.y}),this.ctx.lastPoint=new s(I,P)},f.prototype.closePath=function(){var I=new s(0,0),P=0;for(P=this.path.length-1;P!==-1;P--)if(this.path[P].type==="begin"&&Dt(this.path[P+1])==="object"&&typeof this.path[P+1].x=="number"){I=new s(this.path[P+1].x,this.path[P+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new s(I.x,I.y)},f.prototype.lineTo=function(I,P){if(isNaN(I)||isNaN(P))throw $t.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var K=this.ctx.transform.applyToPoint(new s(I,P));this.path.push({type:"lt",x:K.x,y:K.y}),this.ctx.lastPoint=new s(K.x,K.y)},f.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),E.call(this,null,!0)},f.prototype.quadraticCurveTo=function(I,P,K,Y){if(isNaN(K)||isNaN(Y)||isNaN(I)||isNaN(P))throw $t.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var J=this.ctx.transform.applyToPoint(new s(K,Y)),q=this.ctx.transform.applyToPoint(new s(I,P));this.path.push({type:"qct",x1:q.x,y1:q.y,x:J.x,y:J.y}),this.ctx.lastPoint=new s(J.x,J.y)},f.prototype.bezierCurveTo=function(I,P,K,Y,J,q){if(isNaN(J)||isNaN(q)||isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y))throw $t.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var W=this.ctx.transform.applyToPoint(new s(J,q)),te=this.ctx.transform.applyToPoint(new s(I,P)),oe=this.ctx.transform.applyToPoint(new s(K,Y));this.path.push({type:"bct",x1:te.x,y1:te.y,x2:oe.x,y2:oe.y,x:W.x,y:W.y}),this.ctx.lastPoint=new s(W.x,W.y)},f.prototype.arc=function(I,P,K,Y,J,q){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y)||isNaN(J))throw $t.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(q=!!q,!this.ctx.transform.isIdentity){var W=this.ctx.transform.applyToPoint(new s(I,P));I=W.x,P=W.y;var te=this.ctx.transform.applyToPoint(new s(0,K)),oe=this.ctx.transform.applyToPoint(new s(0,0));K=Math.sqrt(Math.pow(te.x-oe.x,2)+Math.pow(te.y-oe.y,2))}Math.abs(J-Y)>=2*Math.PI&&(Y=0,J=2*Math.PI),this.path.push({type:"arc",x:I,y:P,radius:K,startAngle:Y,endAngle:J,counterclockwise:q})},f.prototype.arcTo=function(I,P,K,Y,J){throw new Error("arcTo not implemented.")},f.prototype.rect=function(I,P,K,Y){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y))throw $t.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(I,P),this.lineTo(I+K,P),this.lineTo(I+K,P+Y),this.lineTo(I,P+Y),this.lineTo(I,P),this.lineTo(I+K,P),this.lineTo(I,P)},f.prototype.fillRect=function(I,P,K,Y){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y))throw $t.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!c.call(this)){var J={};this.lineCap!=="butt"&&(J.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(J.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(I,P,K,Y),this.fill(),J.hasOwnProperty("lineCap")&&(this.lineCap=J.lineCap),J.hasOwnProperty("lineJoin")&&(this.lineJoin=J.lineJoin)}},f.prototype.strokeRect=function(I,P,K,Y){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y))throw $t.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");g.call(this)||(this.beginPath(),this.rect(I,P,K,Y),this.stroke())},f.prototype.clearRect=function(I,P,K,Y){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y))throw $t.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(I,P,K,Y))},f.prototype.save=function(I){I=typeof I!="boolean"||I;for(var P=this.pdf.internal.getCurrentPageInfo().pageNumber,K=0;K<this.pdf.internal.getNumberOfPages();K++)this.pdf.setPage(K+1),this.pdf.internal.out("q");if(this.pdf.setPage(P),I){this.ctx.fontSize=this.pdf.internal.getFontSize();var Y=new u(this.ctx);this.ctxStack.push(this.ctx),this.ctx=Y}},f.prototype.restore=function(I){I=typeof I!="boolean"||I;for(var P=this.pdf.internal.getCurrentPageInfo().pageNumber,K=0;K<this.pdf.internal.getNumberOfPages();K++)this.pdf.setPage(K+1),this.pdf.internal.out("Q");this.pdf.setPage(P),I&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},f.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var h=function(I){var P,K,Y,J;if(I.isCanvasGradient===!0&&(I=I.getColor()),!I)return{r:0,g:0,b:0,a:0,style:I};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(I))P=0,K=0,Y=0,J=0;else{var q=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(I);if(q!==null)P=parseInt(q[1]),K=parseInt(q[2]),Y=parseInt(q[3]),J=1;else if((q=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(I))!==null)P=parseInt(q[1]),K=parseInt(q[2]),Y=parseInt(q[3]),J=parseFloat(q[4]);else{if(J=1,typeof I=="string"&&I.charAt(0)!=="#"){var W=new tB(I);I=W.ok?W.toHex():"#000000"}I.length===4?(P=I.substring(1,2),P+=P,K=I.substring(2,3),K+=K,Y=I.substring(3,4),Y+=Y):(P=I.substring(1,3),K=I.substring(3,5),Y=I.substring(5,7)),P=parseInt(P,16),K=parseInt(K,16),Y=parseInt(Y,16)}}return{r:P,g:K,b:Y,a:J,style:I}},c=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},g=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};f.prototype.fillText=function(I,P,K,Y){if(isNaN(P)||isNaN(K)||typeof I!="string")throw $t.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(Y=isNaN(Y)?void 0:Y,!c.call(this)){var J=Z(this.ctx.transform.rotation),q=this.ctx.transform.scaleX;O.call(this,{text:I,x:P,y:K,scale:q,angle:J,align:this.textAlign,maxWidth:Y})}},f.prototype.strokeText=function(I,P,K,Y){if(isNaN(P)||isNaN(K)||typeof I!="string")throw $t.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!g.call(this)){Y=isNaN(Y)?void 0:Y;var J=Z(this.ctx.transform.rotation),q=this.ctx.transform.scaleX;O.call(this,{text:I,x:P,y:K,scale:q,renderingMode:"stroke",angle:J,align:this.textAlign,maxWidth:Y})}},f.prototype.measureText=function(I){if(typeof I!="string")throw $t.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var P=this.pdf,K=this.pdf.internal.scaleFactor,Y=P.internal.getFontSize(),J=P.getStringUnitWidth(I)*Y/P.internal.scaleFactor;return new function(q){var W=(q=q||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return W}}),this}({width:J*=Math.round(96*K/72*1e4)/1e4})},f.prototype.scale=function(I,P){if(isNaN(I)||isNaN(P))throw $t.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var K=new o(I,0,0,P,0,0);this.ctx.transform=this.ctx.transform.multiply(K)},f.prototype.rotate=function(I){if(isNaN(I))throw $t.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var P=new o(Math.cos(I),Math.sin(I),-Math.sin(I),Math.cos(I),0,0);this.ctx.transform=this.ctx.transform.multiply(P)},f.prototype.translate=function(I,P){if(isNaN(I)||isNaN(P))throw $t.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var K=new o(1,0,0,1,I,P);this.ctx.transform=this.ctx.transform.multiply(K)},f.prototype.transform=function(I,P,K,Y,J,q){if(isNaN(I)||isNaN(P)||isNaN(K)||isNaN(Y)||isNaN(J)||isNaN(q))throw $t.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var W=new o(I,P,K,Y,J,q);this.ctx.transform=this.ctx.transform.multiply(W)},f.prototype.setTransform=function(I,P,K,Y,J,q){I=isNaN(I)?1:I,P=isNaN(P)?0:P,K=isNaN(K)?0:K,Y=isNaN(Y)?1:Y,J=isNaN(J)?0:J,q=isNaN(q)?0:q,this.ctx.transform=new o(I,P,K,Y,J,q)};var p=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};f.prototype.drawImage=function(I,P,K,Y,J,q,W,te,oe){var we=this.pdf.getImageProperties(I),le=1,Be=1,ye=1,R=1;Y!==void 0&&te!==void 0&&(ye=te/Y,R=oe/J,le=we.width/Y*te/Y,Be=we.height/J*oe/J),q===void 0&&(q=P,W=K,P=0,K=0),Y!==void 0&&te===void 0&&(te=Y,oe=J),Y===void 0&&te===void 0&&(te=we.width,oe=we.height);var Ie=this.ctx.transform.decompose(),Ue=Z(Ie.rotate.shx),Te=new o,Ee=(Te=(Te=(Te=Te.multiply(Ie.translate)).multiply(Ie.skew)).multiply(Ie.scale)).applyToRectangle(new a(q-P*ye,W-K*R,Y*le,J*Be));if(this.autoPaging){for(var Ve,Me=y.call(this,Ee),ze=[],Ye=0;Ye<Me.length;Ye+=1)ze.indexOf(Me[Ye])===-1&&ze.push(Me[Ye]);x(ze);for(var xe=ze[0],Oe=ze[ze.length-1],je=xe;je<Oe+1;je++){this.pdf.setPage(je);var ge=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Re=je===1?this.posY+this.margin[0]:this.margin[0],Le=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ue=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],fe=je===1?0:Le+(je-2)*ue;if(this.ctx.clip_path.length!==0){var Pe=this.path;Ve=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=B(Ve,this.posX+this.margin[3],-fe+Re+this.ctx.prevPageLastElemOffset),Q.call(this,"fill",!0),this.path=Pe}var Fe=JSON.parse(JSON.stringify(Ee));Fe=B([Fe],this.posX+this.margin[3],-fe+Re+this.ctx.prevPageLastElemOffset)[0];var Ne=(je>xe||je<Oe)&&p.call(this);Ne&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ge,ue,null).clip().discardPath()),this.pdf.addImage(I,"JPEG",Fe.x,Fe.y,Fe.w,Fe.h,null,null,Ue),Ne&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(I,"JPEG",Ee.x,Ee.y,Ee.w,Ee.h,null,null,Ue)};var y=function(I,P,K){var Y=[];P=P||this.pdf.internal.pageSize.width,K=K||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var J=this.posY+this.ctx.prevPageLastElemOffset;switch(I.type){default:case"mt":case"lt":Y.push(Math.floor((I.y+J)/K)+1);break;case"arc":Y.push(Math.floor((I.y+J-I.radius)/K)+1),Y.push(Math.floor((I.y+J+I.radius)/K)+1);break;case"qct":var q=Ae(this.ctx.lastPoint.x,this.ctx.lastPoint.y,I.x1,I.y1,I.x,I.y);Y.push(Math.floor((q.y+J)/K)+1),Y.push(Math.floor((q.y+q.h+J)/K)+1);break;case"bct":var W=V(this.ctx.lastPoint.x,this.ctx.lastPoint.y,I.x1,I.y1,I.x2,I.y2,I.x,I.y);Y.push(Math.floor((W.y+J)/K)+1),Y.push(Math.floor((W.y+W.h+J)/K)+1);break;case"rect":Y.push(Math.floor((I.y+J)/K)+1),Y.push(Math.floor((I.y+I.h+J)/K)+1)}for(var te=0;te<Y.length;te+=1)for(;this.pdf.internal.getNumberOfPages()<Y[te];)w.call(this);return Y},w=function(){var I=this.fillStyle,P=this.strokeStyle,K=this.font,Y=this.lineCap,J=this.lineWidth,q=this.lineJoin;this.pdf.addPage(),this.fillStyle=I,this.strokeStyle=P,this.font=K,this.lineCap=Y,this.lineWidth=J,this.lineJoin=q},B=function(I,P,K){for(var Y=0;Y<I.length;Y++)switch(I[Y].type){case"bct":I[Y].x2+=P,I[Y].y2+=K;case"qct":I[Y].x1+=P,I[Y].y1+=K;default:I[Y].x+=P,I[Y].y+=K}return I},x=function(I){return I.sort(function(P,K){return P-K})},E=function(I,P){var K=this.fillStyle,Y=this.strokeStyle,J=this.lineCap,q=this.lineWidth,W=Math.abs(q*this.ctx.transform.scaleX),te=this.lineJoin;if(this.autoPaging){for(var oe,we,le=JSON.parse(JSON.stringify(this.path)),Be=JSON.parse(JSON.stringify(this.path)),ye=[],R=0;R<Be.length;R++)if(Be[R].x!==void 0)for(var Ie=y.call(this,Be[R]),Ue=0;Ue<Ie.length;Ue+=1)ye.indexOf(Ie[Ue])===-1&&ye.push(Ie[Ue]);for(var Te=0;Te<ye.length;Te++)for(;this.pdf.internal.getNumberOfPages()<ye[Te];)w.call(this);x(ye);for(var Ee=ye[0],Ve=ye[ye.length-1],Me=Ee;Me<Ve+1;Me++){this.pdf.setPage(Me),this.fillStyle=K,this.strokeStyle=Y,this.lineCap=J,this.lineWidth=W,this.lineJoin=te;var ze=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ye=Me===1?this.posY+this.margin[0]:this.margin[0],xe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Oe=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],je=Me===1?0:xe+(Me-2)*Oe;if(this.ctx.clip_path.length!==0){var ge=this.path;oe=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=B(oe,this.posX+this.margin[3],-je+Ye+this.ctx.prevPageLastElemOffset),Q.call(this,I,!0),this.path=ge}if(we=JSON.parse(JSON.stringify(le)),this.path=B(we,this.posX+this.margin[3],-je+Ye+this.ctx.prevPageLastElemOffset),P===!1||Me===0){var Re=(Me>Ee||Me<Ve)&&p.call(this);Re&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ze,Oe,null).clip().discardPath()),Q.call(this,I,P),Re&&this.pdf.restoreGraphicsState()}this.lineWidth=q}this.path=le}else this.lineWidth=W,Q.call(this,I,P),this.lineWidth=q},Q=function(I,P){if((I!=="stroke"||P||!g.call(this))&&(I==="stroke"||P||!c.call(this))){for(var K,Y,J=[],q=this.path,W=0;W<q.length;W++){var te=q[W];switch(te.type){case"begin":J.push({begin:!0});break;case"close":J.push({close:!0});break;case"mt":J.push({start:te,deltas:[],abs:[]});break;case"lt":var oe=J.length;if(q[W-1]&&!isNaN(q[W-1].x)&&(K=[te.x-q[W-1].x,te.y-q[W-1].y],oe>0)){for(;oe>=0;oe--)if(J[oe-1].close!==!0&&J[oe-1].begin!==!0){J[oe-1].deltas.push(K),J[oe-1].abs.push(te);break}}break;case"bct":K=[te.x1-q[W-1].x,te.y1-q[W-1].y,te.x2-q[W-1].x,te.y2-q[W-1].y,te.x-q[W-1].x,te.y-q[W-1].y],J[J.length-1].deltas.push(K);break;case"qct":var we=q[W-1].x+2/3*(te.x1-q[W-1].x),le=q[W-1].y+2/3*(te.y1-q[W-1].y),Be=te.x+2/3*(te.x1-te.x),ye=te.y+2/3*(te.y1-te.y),R=te.x,Ie=te.y;K=[we-q[W-1].x,le-q[W-1].y,Be-q[W-1].x,ye-q[W-1].y,R-q[W-1].x,Ie-q[W-1].y],J[J.length-1].deltas.push(K);break;case"arc":J.push({deltas:[],abs:[],arc:!0}),Array.isArray(J[J.length-1].abs)&&J[J.length-1].abs.push(te)}}Y=P?null:I==="stroke"?"stroke":"fill";for(var Ue=!1,Te=0;Te<J.length;Te++)if(J[Te].arc)for(var Ee=J[Te].abs,Ve=0;Ve<Ee.length;Ve++){var Me=Ee[Ve];Me.type==="arc"?T.call(this,Me.x,Me.y,Me.radius,Me.startAngle,Me.endAngle,Me.counterclockwise,void 0,P,!Ue):M.call(this,Me.x,Me.y),Ue=!0}else if(J[Te].close===!0)this.pdf.internal.out("h"),Ue=!1;else if(J[Te].begin!==!0){var ze=J[Te].start.x,Ye=J[Te].start.y;C.call(this,J[Te].deltas,ze,Ye),Ue=!0}Y&&_.call(this,Y),P&&D.call(this)}},L=function(I){var P=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,K=P*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return I-K;case"top":return I+P-K;case"hanging":return I+P-2*K;case"middle":return I+P/2-K;default:return I}},S=function(I){return I+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};f.prototype.createLinearGradient=function(){var I=function(){};return I.colorStops=[],I.addColorStop=function(P,K){this.colorStops.push([P,K])},I.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},I.isCanvasGradient=!0,I},f.prototype.createPattern=function(){return this.createLinearGradient()},f.prototype.createRadialGradient=function(){return this.createLinearGradient()};var T=function(I,P,K,Y,J,q,W,te,oe){for(var we=re.call(this,K,Y,J,q),le=0;le<we.length;le++){var Be=we[le];le===0&&(oe?U.call(this,Be.x1+I,Be.y1+P):M.call(this,Be.x1+I,Be.y1+P)),z.call(this,I,P,Be.x2,Be.y2,Be.x3,Be.y3,Be.x4,Be.y4)}te?D.call(this):_.call(this,W)},_=function(I){switch(I){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},D=function(){this.pdf.clip(),this.pdf.discardPath()},U=function(I,P){this.pdf.internal.out(t(I)+" "+A(P)+" m")},O=function(I){var P;switch(I.align){case"right":case"end":P="right";break;case"center":P="center";break;default:P="left"}var K,Y,J,q=this.pdf.getTextDimensions(I.text),W=L.call(this,I.y),te=S.call(this,W)-q.h,oe=this.ctx.transform.applyToPoint(new s(I.x,W));if(this.autoPaging){var we=this.ctx.transform.decompose(),le=new o;le=(le=(le=le.multiply(we.translate)).multiply(we.skew)).multiply(we.scale);for(var Be=this.ctx.transform.applyToRectangle(new a(I.x,W,q.w,q.h)),ye=le.applyToRectangle(new a(I.x,te,q.w,q.h)),R=y.call(this,ye),Ie=[],Ue=0;Ue<R.length;Ue+=1)Ie.indexOf(R[Ue])===-1&&Ie.push(R[Ue]);x(Ie);for(var Te=Ie[0],Ee=Ie[Ie.length-1],Ve=Te;Ve<Ee+1;Ve++){this.pdf.setPage(Ve);var Me=Ve===1?this.posY+this.margin[0]:this.margin[0],ze=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ye=this.pdf.internal.pageSize.height-this.margin[2],xe=Ye-this.margin[0],Oe=this.pdf.internal.pageSize.width-this.margin[1],je=Oe-this.margin[3],ge=Ve===1?0:ze+(Ve-2)*xe;if(this.ctx.clip_path.length!==0){var Re=this.path;K=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=B(K,this.posX+this.margin[3],-1*ge+Me),Q.call(this,"fill",!0),this.path=Re}var Le=B([JSON.parse(JSON.stringify(ye))],this.posX+this.margin[3],-ge+Me+this.ctx.prevPageLastElemOffset)[0];I.scale>=.01&&(Y=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Y*I.scale),J=this.lineWidth,this.lineWidth=J*I.scale);var ue=this.autoPaging!=="text";if(ue||Le.y+Le.h<=Ye){if(ue||Le.y>=Me&&Le.x<=Oe){var fe=ue?I.text:this.pdf.splitTextToSize(I.text,I.maxWidth||Oe-Le.x)[0],Pe=B([JSON.parse(JSON.stringify(Be))],this.posX+this.margin[3],-ge+Me+this.ctx.prevPageLastElemOffset)[0],Fe=ue&&(Ve>Te||Ve<Ee)&&p.call(this);Fe&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],je,xe,null).clip().discardPath()),this.pdf.text(fe,Pe.x,Pe.y,{angle:I.angle,align:P,renderingMode:I.renderingMode}),Fe&&this.pdf.restoreGraphicsState()}}else Le.y<Ye&&(this.ctx.prevPageLastElemOffset+=Ye-Le.y);I.scale>=.01&&(this.pdf.setFontSize(Y),this.lineWidth=J)}}else I.scale>=.01&&(Y=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Y*I.scale),J=this.lineWidth,this.lineWidth=J*I.scale),this.pdf.text(I.text,oe.x+this.posX,oe.y+this.posY,{angle:I.angle,align:P,renderingMode:I.renderingMode,maxWidth:I.maxWidth}),I.scale>=.01&&(this.pdf.setFontSize(Y),this.lineWidth=J)},M=function(I,P,K,Y){K=K||0,Y=Y||0,this.pdf.internal.out(t(I+K)+" "+A(P+Y)+" l")},C=function(I,P,K){return this.pdf.lines(I,P,K,null,null)},z=function(I,P,K,Y,J,q,W,te){this.pdf.internal.out([e(n(K+I)),e(i(Y+P)),e(n(J+I)),e(i(q+P)),e(n(W+I)),e(i(te+P)),"c"].join(" "))},re=function(I,P,K,Y){for(var J=2*Math.PI,q=Math.PI/2;P>K;)P-=J;var W=Math.abs(K-P);W<J&&Y&&(W=J-W);for(var te=[],oe=Y?-1:1,we=P;W>1e-5;){var le=we+oe*Math.min(W,q);te.push(ne.call(this,I,we,le)),W-=Math.abs(le-we),we=le}return te},ne=function(I,P,K){var Y=(K-P)/2,J=I*Math.cos(Y),q=I*Math.sin(Y),W=J,te=-q,oe=W*W+te*te,we=oe+W*J+te*q,le=4/3*(Math.sqrt(2*oe*we)-we)/(W*q-te*J),Be=W-le*te,ye=te+le*W,R=Be,Ie=-ye,Ue=Y+P,Te=Math.cos(Ue),Ee=Math.sin(Ue);return{x1:I*Math.cos(P),y1:I*Math.sin(P),x2:Be*Te-ye*Ee,y2:Be*Ee+ye*Te,x3:R*Te-Ie*Ee,y3:R*Ee+Ie*Te,x4:I*Math.cos(K),y4:I*Math.sin(K)}},Z=function(I){return 180*I/Math.PI},Ae=function(I,P,K,Y,J,q){var W=I+.5*(K-I),te=P+.5*(Y-P),oe=J+.5*(K-J),we=q+.5*(Y-q),le=Math.min(I,J,W,oe),Be=Math.max(I,J,W,oe),ye=Math.min(P,q,te,we),R=Math.max(P,q,te,we);return new a(le,ye,Be-le,R-ye)},V=function(I,P,K,Y,J,q,W,te){var oe,we,le,Be,ye,R,Ie,Ue,Te,Ee,Ve,Me,ze,Ye,xe=K-I,Oe=Y-P,je=J-K,ge=q-Y,Re=W-J,Le=te-q;for(we=0;we<41;we++)Te=(Ie=(le=I+(oe=we/40)*xe)+oe*((ye=K+oe*je)-le))+oe*(ye+oe*(J+oe*Re-ye)-Ie),Ee=(Ue=(Be=P+oe*Oe)+oe*((R=Y+oe*ge)-Be))+oe*(R+oe*(q+oe*Le-R)-Ue),we==0?(Ve=Te,Me=Ee,ze=Te,Ye=Ee):(Ve=Math.min(Ve,Te),Me=Math.min(Me,Ee),ze=Math.max(ze,Te),Ye=Math.max(Ye,Ee));return new a(Math.round(Ve),Math.round(Me),Math.round(ze-Ve),Math.round(Ye-Me))},k=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var I,P,K=(I=this.ctx.lineDash,P=this.ctx.lineDashOffset,JSON.stringify({lineDash:I,lineDashOffset:P}));this.prevLineDash!==K&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=K)}}})(pt.API),(function(r){var e=function(s){var a,o,l,u,f,h,c,g,p,y;for(o=[],l=0,u=(s+=a="\0\0\0\0".slice(s.length%4||4)).length;u>l;l+=4)(f=(s.charCodeAt(l)<<24)+(s.charCodeAt(l+1)<<16)+(s.charCodeAt(l+2)<<8)+s.charCodeAt(l+3))!==0?(h=(f=((f=((f=((f=(f-(y=f%85))/85)-(p=f%85))/85)-(g=f%85))/85)-(c=f%85))/85)%85,o.push(h+33,c+33,g+33,p+33,y+33)):o.push(122);return(function(w,B){for(var x=B;x>0;x--)w.pop()})(o,a.length),String.fromCharCode.apply(String,o)+"~>"},t=function(s){var a,o,l,u,f,h=String,c="length",g=255,p="charCodeAt",y="slice",w="replace";for(s[y](-2),s=s[y](0,-2)[w](/\s/g,"")[w]("z","!!!!!"),l=[],u=0,f=(s+=a="uuuuu"[y](s[c]%5||5))[c];f>u;u+=5)o=52200625*(s[p](u)-33)+614125*(s[p](u+1)-33)+7225*(s[p](u+2)-33)+85*(s[p](u+3)-33)+(s[p](u+4)-33),l.push(g&o>>24,g&o>>16,g&o>>8,g&o);return(function(B,x){for(var E=x;E>0;E--)B.pop()})(l,a[c]),h.fromCharCode.apply(h,l)},A=function(s){return s.split("").map(function(a){return("0"+a.charCodeAt().toString(16)).slice(-2)}).join("")+">"},n=function(s){var a=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((s=s.replace(/\s/g,"")).indexOf(">")!==-1&&(s=s.substr(0,s.indexOf(">"))),s.length%2&&(s+="0"),a.test(s)===!1)return"";for(var o="",l=0;l<s.length;l+=2)o+=String.fromCharCode("0x"+(s[l]+s[l+1]));return o},i=function(s){for(var a=new Uint8Array(s.length),o=s.length;o--;)a[o]=s.charCodeAt(o);return(a=Yh(a)).reduce(function(l,u){return l+String.fromCharCode(u)},"")};r.processDataByFilters=function(s,a){var o=0,l=s||"",u=[];for(typeof(a=a||[])=="string"&&(a=[a]),o=0;o<a.length;o+=1)switch(a[o]){case"ASCII85Decode":case"/ASCII85Decode":l=t(l),u.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":l=e(l),u.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":l=n(l),u.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":l=A(l),u.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":l=i(l),u.push("/FlateDecode");break;default:throw new Error('The filter: "'+a[o]+'" is not implemented')}return{data:l,reverseChain:u.reverse().join(" ")}}})(pt.API),(function(r){r.loadFile=function(e,t,A){return(function(n,i,s){i=i!==!1,s=typeof s=="function"?s:function(){};var a=void 0;try{a=(function(o,l,u){var f=new XMLHttpRequest,h=0,c=function(g){var p=g.length,y=[],w=String.fromCharCode;for(h=0;h<p;h+=1)y.push(w(255&g.charCodeAt(h)));return y.join("")};if(f.open("GET",o,!l),f.overrideMimeType("text/plain; charset=x-user-defined"),l===!1&&(f.onload=function(){f.status===200?u(c(this.responseText)):u(void 0)}),f.send(null),l&&f.status===200)return c(f.responseText)})(n,i,s)}catch{}return a})(e,t,A)},r.allowFsRead=void 0,r.loadImageFile=r.loadFile})(pt.API),(function(r){function e(){return(bt.html2canvas?Promise.resolve(bt.html2canvas):Promise.resolve().then(()=>nP)).catch(function(a){return Promise.reject(new Error("Could not load html2canvas: "+a))}).then(function(a){return a.default?a.default:a})}function t(){return(bt.DOMPurify?Promise.resolve(bt.DOMPurify):Promise.resolve().then(()=>RP)).catch(function(a){return Promise.reject(new Error("Could not load dompurify: "+a))}).then(function(a){return a.default?a.default:a})}var A=function(a){var o=Dt(a);return o==="undefined"?"undefined":o==="string"||a instanceof String?"string":o==="number"||a instanceof Number?"number":o==="function"||a instanceof Function?"function":a&&a.constructor===Array?"array":a&&a.nodeType===1?"element":o==="object"?"object":"unknown"},n=function(a,o){var l=document.createElement(a);for(var u in o.className&&(l.className=o.className),o.innerHTML&&o.dompurify&&(l.innerHTML=o.dompurify.sanitize(o.innerHTML)),o.style)l.style[u]=o.style[u];return l},i=function a(o,l){for(var u=o.nodeType===3?document.createTextNode(o.nodeValue):o.cloneNode(!1),f=o.firstChild;f;f=f.nextSibling)l!==!0&&f.nodeType===1&&f.nodeName==="SCRIPT"||u.appendChild(a(f,l));return o.nodeType===1&&(o.nodeName==="CANVAS"?(u.width=o.width,u.height=o.height,u.getContext("2d").drawImage(o,0,0)):o.nodeName!=="TEXTAREA"&&o.nodeName!=="SELECT"||(u.value=o.value),u.addEventListener("load",function(){u.scrollTop=o.scrollTop,u.scrollLeft=o.scrollLeft},!0)),u},s=function a(o){var l=Object.assign(a.convert(Promise.resolve()),JSON.parse(JSON.stringify(a.template))),u=a.convert(Promise.resolve(),l);return(u=u.setProgress(1,a,1,[a])).set(o)};(s.prototype=Object.create(Promise.prototype)).constructor=s,s.convert=function(a,o){return a.__proto__=o||s.prototype,a},s.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},s.prototype.from=function(a,o){return this.then(function(){switch(o=o||(function(l){switch(A(l)){case"string":return"string";case"element":return l.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}})(a),o){case"string":return this.then(t).then(function(l){return this.set({src:n("div",{innerHTML:a,dompurify:l})})});case"element":return this.set({src:a});case"canvas":return this.set({canvas:a});case"img":return this.set({img:a});default:return this.error("Unknown source type.")}})},s.prototype.to=function(a){switch(a){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},s.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var a={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},o=i(this.prop.src,this.opt.html2canvas.javascriptEnabled);o.tagName==="BODY"&&(a.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=n("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=n("div",{className:"html2pdf__container",style:a}),this.prop.container.appendChild(o),this.prop.container.firstChild.appendChild(n("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},s.prototype.toCanvas=function(){var a=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(a).then(e).then(function(o){var l=Object.assign({},this.opt.html2canvas);return delete l.onrendered,o(this.prop.container,l)}).then(function(o){(this.opt.html2canvas.onrendered||function(){})(o),this.prop.canvas=o,document.body.removeChild(this.prop.overlay)})},s.prototype.toContext2d=function(){var a=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(a).then(e).then(function(o){var l=this.opt.jsPDF,u=this.opt.fontFaces,f=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,h=Object.assign({async:!0,allowTaint:!0,scale:f,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete h.onrendered,l.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,l.context2d.posX=this.opt.x,l.context2d.posY=this.opt.y,l.context2d.margin=this.opt.margin,l.context2d.fontFaces=u,u)for(var c=0;c<u.length;++c){var g=u[c],p=g.src.find(function(y){return y.format==="truetype"});p&&l.addFont(p.url,g.ref.name,g.ref.style)}return h.windowHeight=h.windowHeight||0,h.windowHeight=h.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):h.windowHeight,l.context2d.save(!0),o(this.prop.container,h)}).then(function(o){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(o),this.prop.canvas=o,document.body.removeChild(this.prop.overlay)})},s.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var a=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=a})},s.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},s.prototype.output=function(a,o,l){return(l=l||"pdf").toLowerCase()==="img"||l.toLowerCase()==="image"?this.outputImg(a,o):this.outputPdf(a,o)},s.prototype.outputPdf=function(a,o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(a,o)})},s.prototype.outputImg=function(a){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(a){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+a+'" is not supported.'}})},s.prototype.save=function(a){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(a?{filename:a}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},s.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},s.prototype.set=function(a){if(A(a)!=="object")return this;var o=Object.keys(a||{}).map(function(l){if(l in s.template.prop)return function(){this.prop[l]=a[l]};switch(l){case"margin":return this.setMargin.bind(this,a.margin);case"jsPDF":return function(){return this.opt.jsPDF=a.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,a.pageSize);default:return function(){this.opt[l]=a[l]}}},this);return this.then(function(){return this.thenList(o)})},s.prototype.get=function(a,o){return this.then(function(){var l=a in s.template.prop?this.prop[a]:this.opt[a];return o?o(l):l})},s.prototype.setMargin=function(a){return this.then(function(){switch(A(a)){case"number":a=[a,a,a,a];case"array":if(a.length===2&&(a=[a[0],a[1],a[0],a[1]]),a.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=a}).then(this.setPageSize)},s.prototype.setPageSize=function(a){function o(l,u){return Math.floor(l*u/72*96)}return this.then(function(){(a=a||pt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(a.inner={width:a.width-this.opt.margin[1]-this.opt.margin[3],height:a.height-this.opt.margin[0]-this.opt.margin[2]},a.inner.px={width:o(a.inner.width,a.k),height:o(a.inner.height,a.k)},a.inner.ratio=a.inner.height/a.inner.width),this.prop.pageSize=a})},s.prototype.setProgress=function(a,o,l,u){return a!=null&&(this.progress.val=a),o!=null&&(this.progress.state=o),l!=null&&(this.progress.n=l),u!=null&&(this.progress.stack=u),this.progress.ratio=this.progress.val/this.progress.state,this},s.prototype.updateProgress=function(a,o,l,u){return this.setProgress(a?this.progress.val+a:null,o||null,l?this.progress.n+l:null,u?this.progress.stack.concat(u):null)},s.prototype.then=function(a,o){var l=this;return this.thenCore(a,o,function(u,f){return l.updateProgress(null,null,1,[u]),Promise.prototype.then.call(this,function(h){return l.updateProgress(null,u),h}).then(u,f).then(function(h){return l.updateProgress(1),h})})},s.prototype.thenCore=function(a,o,l){l=l||Promise.prototype.then;var u=this;a&&(a=a.bind(u)),o&&(o=o.bind(u));var f=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?u:s.convert(Object.assign({},u),Promise.prototype),h=l.call(f,a,o);return s.convert(h,u.__proto__)},s.prototype.thenExternal=function(a,o){return Promise.prototype.then.call(this,a,o)},s.prototype.thenList=function(a){var o=this;return a.forEach(function(l){o=o.thenCore(l)}),o},s.prototype.catch=function(a){a&&(a=a.bind(this));var o=Promise.prototype.catch.call(this,a);return s.convert(o,this)},s.prototype.catchExternal=function(a){return Promise.prototype.catch.call(this,a)},s.prototype.error=function(a){return this.then(function(){throw new Error(a)})},s.prototype.using=s.prototype.set,s.prototype.saveAs=s.prototype.save,s.prototype.export=s.prototype.output,s.prototype.run=s.prototype.then,pt.getPageSize=function(a,o,l){if(Dt(a)==="object"){var u=a;a=u.orientation,o=u.unit||o,l=u.format||l}o=o||"mm",l=l||"a4",a=(""+(a||"P")).toLowerCase();var f,h=(""+l).toLowerCase(),c={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(o){case"pt":f=1;break;case"mm":f=72/25.4;break;case"cm":f=72/2.54;break;case"in":f=72;break;case"px":f=.75;break;case"pc":case"em":f=12;break;case"ex":f=6;break;default:throw"Invalid unit: "+o}var g,p=0,y=0;if(c.hasOwnProperty(h))p=c[h][1]/f,y=c[h][0]/f;else try{p=l[1],y=l[0]}catch{throw new Error("Invalid format: "+l)}if(a==="p"||a==="portrait")a="p",y>p&&(g=y,y=p,p=g);else{if(a!=="l"&&a!=="landscape")throw"Invalid orientation: "+a;a="l",p>y&&(g=y,y=p,p=g)}return{width:y,height:p,unit:o,k:f,orientation:a}},r.html=function(a,o){(o=o||{}).callback=o.callback||function(){},o.html2canvas=o.html2canvas||{},o.html2canvas.canvas=o.html2canvas.canvas||this.canvas,o.jsPDF=o.jsPDF||this,o.fontFaces=o.fontFaces?o.fontFaces.map(bd):null;var l=new s(o);return o.worker?l:l.from(a).doCallback()}})(pt.API),pt.API.addJS=function(r){return BB=r,this.internal.events.subscribe("postPutResources",function(){Ju=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Ju+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),yB=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+BB+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){Ju!==void 0&&yB!==void 0&&this.internal.out("/Names <</JavaScript "+Ju+" 0 R>>")}),this},(function(r){var e;r.events.push(["postPutResources",function(){var t=this,A=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var n=t.outline.render().split(/\r\n/),i=0;i<n.length;i++){var s=n[i],a=A.exec(s);if(a!=null){var o=a[1];t.internal.newObjectDeferredBegin(o,!1)}t.internal.write(s)}if(this.outline.createNamedDestinations){var l=this.internal.pages.length,u=[];for(i=0;i<l;i++){var f=t.internal.newObject();u.push(f);var h=t.internal.getPageInfo(i+1);t.internal.write("<< /D["+h.objId+" 0 R /XYZ null null null]>> endobj")}var c=t.internal.newObject();for(t.internal.write("<< /Names [ "),i=0;i<u.length;i++)t.internal.write("(page_"+(i+1)+")"+u[i]+" 0 R");t.internal.write(" ] >>","endobj"),e=t.internal.newObject(),t.internal.write("<< /Dests "+c+" 0 R"),t.internal.write(">>","endobj")}}]),r.events.push(["putCatalog",function(){var t=this;t.outline.root.children.length>0&&(t.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&t.internal.write("/Names "+e+" 0 R"))}]),r.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(A,n,i){var s={title:n,options:i,children:[]};return A==null&&(A=this.root),A.children.push(s),s},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(A){A.id=t.internal.newObjectDeferred();for(var n=0;n<A.children.length;n++)this.genIds_r(A.children[n])},t.outline.renderRoot=function(A){this.objStart(A),this.line("/Type /Outlines"),A.children.length>0&&(this.line("/First "+this.makeRef(A.children[0])),this.line("/Last "+this.makeRef(A.children[A.children.length-1]))),this.line("/Count "+this.count_r({count:0},A)),this.objEnd()},t.outline.renderItems=function(A){for(var n=this.ctx.pdf.internal.getVerticalCoordinateString,i=0;i<A.children.length;i++){var s=A.children[i];this.objStart(s),this.line("/Title "+this.makeString(s.title)),this.line("/Parent "+this.makeRef(A)),i>0&&this.line("/Prev "+this.makeRef(A.children[i-1])),i<A.children.length-1&&this.line("/Next "+this.makeRef(A.children[i+1])),s.children.length>0&&(this.line("/First "+this.makeRef(s.children[0])),this.line("/Last "+this.makeRef(s.children[s.children.length-1])));var a=this.count=this.count_r({count:0},s);if(a>0&&this.line("/Count "+a),s.options&&s.options.pageNumber){var o=t.internal.getPageInfo(s.options.pageNumber);this.line("/Dest ["+o.objId+" 0 R /XYZ 0 "+n(0)+" 0]")}this.objEnd()}for(var l=0;l<A.children.length;l++)this.renderItems(A.children[l])},t.outline.line=function(A){this.ctx.val+=A+`\r
|
|
651
651
|
`},t.outline.makeRef=function(A){return A.id+" 0 R"},t.outline.makeString=function(A){return"("+t.internal.pdfEscape(A)+")"},t.outline.objStart=function(A){this.ctx.val+=`\r
|
|
652
652
|
`+A.id+` 0 obj\r
|
|
653
653
|
<<\r
|
|
@@ -705,7 +705,7 @@ end`};e.events.push(["putFont",function(i){(function(s){var a=s.font,o=s.out,l=s
|
|
|
705
705
|
content: "" !important;
|
|
706
706
|
display: none !important;
|
|
707
707
|
}`,w6=function(r){y6(r,"."+vg+v6+Ux+`
|
|
708
|
-
.`+mg+m6+Ux)},y6=function(r,e){var t=r.ownerDocument;if(t){var A=t.createElement("style");A.textContent=e,r.appendChild(A)}},_x=(function(){function r(){}return r.getOrigin=function(e){var t=r._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},r.isSameOrigin=function(e){return r.getOrigin(e)===r._origin},r.setContext=function(e){r._link=e.document.createElement("a"),r._origin=r.getOrigin(e.location.href)},r._origin="about:blank",r})(),B6=(function(){function r(e,t){this.context=e,this._options=t,this._cache={}}return r.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(yg(e)||E6(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},r.prototype.match=function(e){return this._cache[e]},r.prototype.loadImage=function(e){return EA(this,void 0,void 0,function(){var t,A,n,i,s=this;return wA(this,function(a){switch(a.label){case 0:return t=_x.isSameOrigin(e),A=!wg(e)&&this._options.useCORS===!0&&sA.SUPPORT_CORS_IMAGES&&!t,n=!wg(e)&&!t&&!yg(e)&&typeof this._options.proxy=="string"&&sA.SUPPORT_CORS_XHR&&!A,!t&&this._options.allowTaint===!1&&!wg(e)&&!yg(e)&&!n&&!A?[2]:(i=e,n?[4,this.proxy(i)]:[3,2]);case 1:i=a.sent(),a.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(o,l){var u=new Image;u.onload=function(){return o(u)},u.onerror=l,(F6(i)||A)&&(u.crossOrigin="anonymous"),u.src=i,u.complete===!0&&setTimeout(function(){return o(u)},500),s._options.imageTimeout>0&&setTimeout(function(){return l("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,a.sent()]}})})},r.prototype.has=function(e){return typeof this._cache[e]<"u"},r.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},r.prototype.proxy=function(e){var t=this,A=this._options.proxy;if(!A)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(i,s){var a=sA.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(o.status===200)if(a==="text")i(o.response);else{var f=new FileReader;f.addEventListener("load",function(){return i(f.result)},!1),f.addEventListener("error",function(h){return s(h)},!1),f.readAsDataURL(o.response)}else s("Failed to proxy resource "+n+" with status code "+o.status)},o.onerror=s;var l=A.indexOf("?")>-1?"&":"?";if(o.open("GET",""+A+l+"url="+encodeURIComponent(e)+"&responseType="+a),a!=="text"&&o instanceof XMLHttpRequest&&(o.responseType=a),t._options.imageTimeout){var u=t._options.imageTimeout;o.timeout=u,o.ontimeout=function(){return s("Timed out ("+u+"ms) proxying "+n)}}o.send()})},r})(),b6=/^data:image\/svg\+xml/i,x6=/^data:image\/.*;base64,/i,C6=/^data:image\/.*/i,E6=function(r){return sA.SUPPORT_SVG_DRAWING||!S6(r)},wg=function(r){return C6.test(r)},F6=function(r){return x6.test(r)},yg=function(r){return r.substr(0,4)==="blob"},S6=function(r){return r.substr(-3).toLowerCase()==="svg"||b6.test(r)},at=(function(){function r(e,t){this.type=0,this.x=e,this.y=t}return r.prototype.add=function(e,t){return new r(this.x+e,this.y+t)},r})(),Ts=function(r,e,t){return new at(r.x+(e.x-r.x)*t,r.y+(e.y-r.y)*t)},kc=(function(){function r(e,t,A,n){this.type=1,this.start=e,this.startControl=t,this.endControl=A,this.end=n}return r.prototype.subdivide=function(e,t){var A=Ts(this.start,this.startControl,e),n=Ts(this.startControl,this.endControl,e),i=Ts(this.endControl,this.end,e),s=Ts(A,n,e),a=Ts(n,i,e),o=Ts(s,a,e);return t?new r(this.start,A,s,o):new r(o,a,i,this.end)},r.prototype.add=function(e,t){return new r(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},r.prototype.reverse=function(){return new r(this.end,this.endControl,this.startControl,this.start)},r})(),un=function(r){return r.type===1},U6=(function(){function r(e){var t=e.styles,A=e.bounds,n=Po(t.borderTopLeftRadius,A.width,A.height),i=n[0],s=n[1],a=Po(t.borderTopRightRadius,A.width,A.height),o=a[0],l=a[1],u=Po(t.borderBottomRightRadius,A.width,A.height),f=u[0],h=u[1],c=Po(t.borderBottomLeftRadius,A.width,A.height),g=c[0],p=c[1],y=[];y.push((i+o)/A.width),y.push((g+f)/A.width),y.push((s+p)/A.height),y.push((l+h)/A.height);var w=Math.max.apply(Math,y);w>1&&(i/=w,s/=w,o/=w,l/=w,f/=w,h/=w,g/=w,p/=w);var B=A.width-o,x=A.height-h,E=A.width-f,Q=A.height-p,L=t.borderTopWidth,S=t.borderRightWidth,T=t.borderBottomWidth,_=t.borderLeftWidth,D=er(t.paddingTop,e.bounds.width),U=er(t.paddingRight,e.bounds.width),O=er(t.paddingBottom,e.bounds.width),M=er(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||s>0?sr(A.left+_/3,A.top+L/3,i-_/3,s-L/3,qt.TOP_LEFT):new at(A.left+_/3,A.top+L/3),this.topRightBorderDoubleOuterBox=i>0||s>0?sr(A.left+B,A.top+L/3,o-S/3,l-L/3,qt.TOP_RIGHT):new at(A.left+A.width-S/3,A.top+L/3),this.bottomRightBorderDoubleOuterBox=f>0||h>0?sr(A.left+E,A.top+x,f-S/3,h-T/3,qt.BOTTOM_RIGHT):new at(A.left+A.width-S/3,A.top+A.height-T/3),this.bottomLeftBorderDoubleOuterBox=g>0||p>0?sr(A.left+_/3,A.top+Q,g-_/3,p-T/3,qt.BOTTOM_LEFT):new at(A.left+_/3,A.top+A.height-T/3),this.topLeftBorderDoubleInnerBox=i>0||s>0?sr(A.left+_*2/3,A.top+L*2/3,i-_*2/3,s-L*2/3,qt.TOP_LEFT):new at(A.left+_*2/3,A.top+L*2/3),this.topRightBorderDoubleInnerBox=i>0||s>0?sr(A.left+B,A.top+L*2/3,o-S*2/3,l-L*2/3,qt.TOP_RIGHT):new at(A.left+A.width-S*2/3,A.top+L*2/3),this.bottomRightBorderDoubleInnerBox=f>0||h>0?sr(A.left+E,A.top+x,f-S*2/3,h-T*2/3,qt.BOTTOM_RIGHT):new at(A.left+A.width-S*2/3,A.top+A.height-T*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||p>0?sr(A.left+_*2/3,A.top+Q,g-_*2/3,p-T*2/3,qt.BOTTOM_LEFT):new at(A.left+_*2/3,A.top+A.height-T*2/3),this.topLeftBorderStroke=i>0||s>0?sr(A.left+_/2,A.top+L/2,i-_/2,s-L/2,qt.TOP_LEFT):new at(A.left+_/2,A.top+L/2),this.topRightBorderStroke=i>0||s>0?sr(A.left+B,A.top+L/2,o-S/2,l-L/2,qt.TOP_RIGHT):new at(A.left+A.width-S/2,A.top+L/2),this.bottomRightBorderStroke=f>0||h>0?sr(A.left+E,A.top+x,f-S/2,h-T/2,qt.BOTTOM_RIGHT):new at(A.left+A.width-S/2,A.top+A.height-T/2),this.bottomLeftBorderStroke=g>0||p>0?sr(A.left+_/2,A.top+Q,g-_/2,p-T/2,qt.BOTTOM_LEFT):new at(A.left+_/2,A.top+A.height-T/2),this.topLeftBorderBox=i>0||s>0?sr(A.left,A.top,i,s,qt.TOP_LEFT):new at(A.left,A.top),this.topRightBorderBox=o>0||l>0?sr(A.left+B,A.top,o,l,qt.TOP_RIGHT):new at(A.left+A.width,A.top),this.bottomRightBorderBox=f>0||h>0?sr(A.left+E,A.top+x,f,h,qt.BOTTOM_RIGHT):new at(A.left+A.width,A.top+A.height),this.bottomLeftBorderBox=g>0||p>0?sr(A.left,A.top+Q,g,p,qt.BOTTOM_LEFT):new at(A.left,A.top+A.height),this.topLeftPaddingBox=i>0||s>0?sr(A.left+_,A.top+L,Math.max(0,i-_),Math.max(0,s-L),qt.TOP_LEFT):new at(A.left+_,A.top+L),this.topRightPaddingBox=o>0||l>0?sr(A.left+Math.min(B,A.width-S),A.top+L,B>A.width+S?0:Math.max(0,o-S),Math.max(0,l-L),qt.TOP_RIGHT):new at(A.left+A.width-S,A.top+L),this.bottomRightPaddingBox=f>0||h>0?sr(A.left+Math.min(E,A.width-_),A.top+Math.min(x,A.height-T),Math.max(0,f-S),Math.max(0,h-T),qt.BOTTOM_RIGHT):new at(A.left+A.width-S,A.top+A.height-T),this.bottomLeftPaddingBox=g>0||p>0?sr(A.left+_,A.top+Math.min(Q,A.height-T),Math.max(0,g-_),Math.max(0,p-T),qt.BOTTOM_LEFT):new at(A.left+_,A.top+A.height-T),this.topLeftContentBox=i>0||s>0?sr(A.left+_+M,A.top+L+D,Math.max(0,i-(_+M)),Math.max(0,s-(L+D)),qt.TOP_LEFT):new at(A.left+_+M,A.top+L+D),this.topRightContentBox=o>0||l>0?sr(A.left+Math.min(B,A.width+_+M),A.top+L+D,B>A.width+_+M?0:o-_+M,l-(L+D),qt.TOP_RIGHT):new at(A.left+A.width-(S+U),A.top+L+D),this.bottomRightContentBox=f>0||h>0?sr(A.left+Math.min(E,A.width-(_+M)),A.top+Math.min(x,A.height+L+D),Math.max(0,f-(S+U)),h-(T+O),qt.BOTTOM_RIGHT):new at(A.left+A.width-(S+U),A.top+A.height-(T+O)),this.bottomLeftContentBox=g>0||p>0?sr(A.left+_+M,A.top+Q,Math.max(0,g-(_+M)),p-(T+O),qt.BOTTOM_LEFT):new at(A.left+_+M,A.top+A.height-(T+O))}return r})(),qt;(function(r){r[r.TOP_LEFT=0]="TOP_LEFT",r[r.TOP_RIGHT=1]="TOP_RIGHT",r[r.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",r[r.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(qt||(qt={}));var sr=function(r,e,t,A,n){var i=4*((Math.sqrt(2)-1)/3),s=t*i,a=A*i,o=r+t,l=e+A;switch(n){case qt.TOP_LEFT:return new kc(new at(r,l),new at(r,l-a),new at(o-s,e),new at(o,e));case qt.TOP_RIGHT:return new kc(new at(r,e),new at(r+s,e),new at(o,l-a),new at(o,l));case qt.BOTTOM_RIGHT:return new kc(new at(o,e),new at(o,e+a),new at(r+s,l),new at(r,l));case qt.BOTTOM_LEFT:default:return new kc(new at(o,l),new at(o-s,l),new at(r,e+a),new at(r,e))}},Hc=function(r){return[r.topLeftBorderBox,r.topRightBorderBox,r.bottomRightBorderBox,r.bottomLeftBorderBox]},_6=function(r){return[r.topLeftContentBox,r.topRightContentBox,r.bottomRightContentBox,r.bottomLeftContentBox]},jc=function(r){return[r.topLeftPaddingBox,r.topRightPaddingBox,r.bottomRightPaddingBox,r.bottomLeftPaddingBox]},I6=(function(){function r(e,t,A){this.offsetX=e,this.offsetY=t,this.matrix=A,this.type=0,this.target=6}return r})(),Kc=(function(){function r(e,t){this.path=e,this.target=t,this.type=1}return r})(),Q6=(function(){function r(e){this.opacity=e,this.type=2,this.target=6}return r})(),N6=function(r){return r.type===0},Ix=function(r){return r.type===1},O6=function(r){return r.type===2},Qx=function(r,e){return r.length===e.length?r.some(function(t,A){return t===e[A]}):!1},T6=function(r,e,t,A,n){return r.map(function(i,s){switch(s){case 0:return i.add(e,t);case 1:return i.add(e+A,t);case 2:return i.add(e+A,t+n);case 3:return i.add(e,t+n)}return i})},Nx=(function(){function r(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return r})(),Ox=(function(){function r(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new U6(this.container),this.container.styles.opacity<1&&this.effects.push(new Q6(this.container.styles.opacity)),this.container.styles.transform!==null){var A=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new I6(A,n,i))}if(this.container.styles.overflowX!==0){var s=Hc(this.curves),a=jc(this.curves);Qx(s,a)?this.effects.push(new Kc(s,6)):(this.effects.push(new Kc(s,2)),this.effects.push(new Kc(a,4)))}}return r.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,A=this.parent,n=this.effects.slice(0);A;){var i=A.effects.filter(function(o){return!Ix(o)});if(t||A.container.styles.position!==0||!A.parent){if(n.unshift.apply(n,i),t=[2,3].indexOf(A.container.styles.position)===-1,A.container.styles.overflowX!==0){var s=Hc(A.curves),a=jc(A.curves);Qx(s,a)||n.unshift(new Kc(a,6))}}else n.unshift.apply(n,i);A=A.parent}return n.filter(function(o){return qr(o.target,e)})},r})(),Bg=function(r,e,t,A){r.container.elements.forEach(function(n){var i=qr(n.flags,4),s=qr(n.flags,2),a=new Ox(n,r);qr(n.styles.display,2048)&&A.push(a);var o=qr(n.flags,8)?[]:A;if(i||s){var l=i||n.styles.isPositioned()?t:e,u=new Nx(a);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var f=n.styles.zIndex.order;if(f<0){var h=0;l.negativeZIndex.some(function(g,p){return f>g.element.container.styles.zIndex.order?(h=p,!1):h>0}),l.negativeZIndex.splice(h,0,u)}else if(f>0){var c=0;l.positiveZIndex.some(function(g,p){return f>=g.element.container.styles.zIndex.order?(c=p+1,!1):c>0}),l.positiveZIndex.splice(c,0,u)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else n.styles.isFloating()?l.nonPositionedFloats.push(u):l.nonPositionedInlineLevel.push(u);Bg(a,u,i?u:t,o)}else n.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),Bg(a,e,t,o);qr(n.flags,8)&&Tx(n,o)})},Tx=function(r,e){for(var t=r instanceof ug?r.start:1,A=r instanceof ug?r.reversed:!1,n=0;n<e.length;n++){var i=e[n];i.container instanceof ix&&typeof i.container.value=="number"&&i.container.value!==0&&(t=i.container.value),i.listValue=jo(t,i.container.styles.listStyleType,!0),t+=A?-1:1}},L6=function(r){var e=new Ox(r,null),t=new Nx(e),A=[];return Bg(e,t,t,A),Tx(e.container,A),t},Lx=function(r,e){switch(e){case 0:return cn(r.topLeftBorderBox,r.topLeftPaddingBox,r.topRightBorderBox,r.topRightPaddingBox);case 1:return cn(r.topRightBorderBox,r.topRightPaddingBox,r.bottomRightBorderBox,r.bottomRightPaddingBox);case 2:return cn(r.bottomRightBorderBox,r.bottomRightPaddingBox,r.bottomLeftBorderBox,r.bottomLeftPaddingBox);case 3:default:return cn(r.bottomLeftBorderBox,r.bottomLeftPaddingBox,r.topLeftBorderBox,r.topLeftPaddingBox)}},P6=function(r,e){switch(e){case 0:return cn(r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox,r.topRightBorderBox,r.topRightBorderDoubleOuterBox);case 1:return cn(r.topRightBorderBox,r.topRightBorderDoubleOuterBox,r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox);case 2:return cn(r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox,r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox);case 3:default:return cn(r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox,r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox)}},R6=function(r,e){switch(e){case 0:return cn(r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox,r.topRightBorderDoubleInnerBox,r.topRightPaddingBox);case 1:return cn(r.topRightBorderDoubleInnerBox,r.topRightPaddingBox,r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox);case 2:return cn(r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox,r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox);case 3:default:return cn(r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox,r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox)}},M6=function(r,e){switch(e){case 0:return qc(r.topLeftBorderStroke,r.topRightBorderStroke);case 1:return qc(r.topRightBorderStroke,r.bottomRightBorderStroke);case 2:return qc(r.bottomRightBorderStroke,r.bottomLeftBorderStroke);case 3:default:return qc(r.bottomLeftBorderStroke,r.topLeftBorderStroke)}},qc=function(r,e){var t=[];return un(r)?t.push(r.subdivide(.5,!1)):t.push(r),un(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},cn=function(r,e,t,A){var n=[];return un(r)?n.push(r.subdivide(.5,!1)):n.push(r),un(t)?n.push(t.subdivide(.5,!0)):n.push(t),un(A)?n.push(A.subdivide(.5,!0).reverse()):n.push(A),un(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},Px=function(r){var e=r.bounds,t=r.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Vc=function(r){var e=r.styles,t=r.bounds,A=er(e.paddingLeft,t.width),n=er(e.paddingRight,t.width),i=er(e.paddingTop,t.width),s=er(e.paddingBottom,t.width);return t.add(A+e.borderLeftWidth,i+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+A+n),-(e.borderTopWidth+e.borderBottomWidth+i+s))},D6=function(r,e){return r===0?e.bounds:r===2?Vc(e):Px(e)},k6=function(r,e){return r===0?e.bounds:r===2?Vc(e):Px(e)},bg=function(r,e,t){var A=D6(Ps(r.styles.backgroundOrigin,e),r),n=k6(Ps(r.styles.backgroundClip,e),r),i=H6(Ps(r.styles.backgroundSize,e),t,A),s=i[0],a=i[1],o=Po(Ps(r.styles.backgroundPosition,e),A.width-s,A.height-a),l=j6(Ps(r.styles.backgroundRepeat,e),o,i,A,n),u=Math.round(A.left+o[0]),f=Math.round(A.top+o[1]);return[l,u,f,s,a]},Ls=function(r){return Xt(r)&&r.value===Is.AUTO},zc=function(r){return typeof r=="number"},H6=function(r,e,t){var A=e[0],n=e[1],i=e[2],s=r[0],a=r[1];if(!s)return[0,0];if(Lr(s)&&a&&Lr(a))return[er(s,t.width),er(a,t.height)];var o=zc(i);if(Xt(s)&&(s.value===Is.CONTAIN||s.value===Is.COVER)){if(zc(i)){var l=t.width/t.height;return l<i!=(s.value===Is.COVER)?[t.width,t.width/i]:[t.height*i,t.height]}return[t.width,t.height]}var u=zc(A),f=zc(n),h=u||f;if(Ls(s)&&(!a||Ls(a))){if(u&&f)return[A,n];if(!o&&!h)return[t.width,t.height];if(h&&o){var c=u?A:n*i,g=f?n:A/i;return[c,g]}var p=u?A:t.width,y=f?n:t.height;return[p,y]}if(o){var w=0,B=0;return Lr(s)?w=er(s,t.width):Lr(a)&&(B=er(a,t.height)),Ls(s)?w=B*i:(!a||Ls(a))&&(B=w/i),[w,B]}var x=null,E=null;if(Lr(s)?x=er(s,t.width):a&&Lr(a)&&(E=er(a,t.height)),x!==null&&(!a||Ls(a))&&(E=u&&f?x/A*n:t.height),E!==null&&Ls(s)&&(x=u&&f?E/n*A:t.width),x!==null&&E!==null)return[x,E];throw new Error("Unable to calculate background-size for element")},Ps=function(r,e){var t=r[e];return typeof t>"u"?r[0]:t},j6=function(r,e,t,A,n){var i=e[0],s=e[1],a=t[0],o=t[1];switch(r){case 2:return[new at(Math.round(A.left),Math.round(A.top+s)),new at(Math.round(A.left+A.width),Math.round(A.top+s)),new at(Math.round(A.left+A.width),Math.round(o+A.top+s)),new at(Math.round(A.left),Math.round(o+A.top+s))];case 3:return[new at(Math.round(A.left+i),Math.round(A.top)),new at(Math.round(A.left+i+a),Math.round(A.top)),new at(Math.round(A.left+i+a),Math.round(A.height+A.top)),new at(Math.round(A.left+i),Math.round(A.height+A.top))];case 1:return[new at(Math.round(A.left+i),Math.round(A.top+s)),new at(Math.round(A.left+i+a),Math.round(A.top+s)),new at(Math.round(A.left+i+a),Math.round(A.top+s+o)),new at(Math.round(A.left+i),Math.round(A.top+s+o))];default:return[new at(Math.round(n.left),Math.round(n.top)),new at(Math.round(n.left+n.width),Math.round(n.top)),new at(Math.round(n.left+n.width),Math.round(n.height+n.top)),new at(Math.round(n.left),Math.round(n.height+n.top))]}},K6="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Rx="Hidden Text",q6=(function(){function r(e){this._data={},this._document=e}return r.prototype.parseMetrics=function(e,t){var A=this._document.createElement("div"),n=this._document.createElement("img"),i=this._document.createElement("span"),s=this._document.body;A.style.visibility="hidden",A.style.fontFamily=e,A.style.fontSize=t,A.style.margin="0",A.style.padding="0",A.style.whiteSpace="nowrap",s.appendChild(A),n.src=K6,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",i.style.fontFamily=e,i.style.fontSize=t,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(Rx)),A.appendChild(i),A.appendChild(n);var a=n.offsetTop-i.offsetTop+2;A.removeChild(i),A.appendChild(this._document.createTextNode(Rx)),A.style.lineHeight="normal",n.style.verticalAlign="super";var o=n.offsetTop-A.offsetTop+2;return s.removeChild(A),{baseline:a,middle:o}},r.prototype.getMetrics=function(e,t){var A=e+" "+t;return typeof this._data[A]>"u"&&(this._data[A]=this.parseMetrics(e,t)),this._data[A]},r})(),Mx=(function(){function r(e,t){this.context=e,this.options=t}return r})(),V6=1e4,z6=(function(r){Fn(e,r);function e(t,A){var n=r.call(this,t,A)||this;return n._activeEffects=[],n.canvas=A.canvas?A.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),A.canvas||(n.canvas.width=Math.floor(A.width*A.scale),n.canvas.height=Math.floor(A.height*A.scale),n.canvas.style.width=A.width+"px",n.canvas.style.height=A.height+"px"),n.fontMetrics=new q6(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-A.x,-A.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+A.width+"x"+A.height+") with scale "+A.scale),n}return e.prototype.applyEffects=function(t){for(var A=this;this._activeEffects.length;)this.popEffect();t.forEach(function(n){return A.applyEffect(n)})},e.prototype.applyEffect=function(t){this.ctx.save(),O6(t)&&(this.ctx.globalAlpha=t.opacity),N6(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Ix(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return EA(this,void 0,void 0,function(){var A;return wA(this,function(n){switch(n.label){case 0:return A=t.element.container.styles,A.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return EA(this,void 0,void 0,function(){return wA(this,function(A){switch(A.label){case 0:if(qr(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return A.sent(),[4,this.renderNodeContent(t)];case 2:A.sent(),A.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,A,n){var i=this;if(A===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+n);else{var s=lg(t.text);s.reduce(function(a,o){return i.ctx.fillText(o,a,t.bounds.top+n),a+i.ctx.measureText(o).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var A=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),n=$6(t.fontFamily).join(", "),i=Lo(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,A,t.fontWeight,i,n].join(" "),n,i]},e.prototype.renderTextNode=function(t,A){return EA(this,void 0,void 0,function(){var n,i,s,a,o,l,u,f,h=this;return wA(this,function(c){return n=this.createFontStyle(A),i=n[0],s=n[1],a=n[2],this.ctx.font=i,this.ctx.direction=A.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",o=this.fontMetrics.getMetrics(s,a),l=o.baseline,u=o.middle,f=A.paintOrder,t.textBounds.forEach(function(g){f.forEach(function(p){switch(p){case 0:h.ctx.fillStyle=tA(A.color),h.renderTextWithLetterSpacing(g,A.letterSpacing,l);var y=A.textShadow;y.length&&g.text.trim().length&&(y.slice(0).reverse().forEach(function(w){h.ctx.shadowColor=tA(w.color),h.ctx.shadowOffsetX=w.offsetX.number*h.options.scale,h.ctx.shadowOffsetY=w.offsetY.number*h.options.scale,h.ctx.shadowBlur=w.blur.number,h.renderTextWithLetterSpacing(g,A.letterSpacing,l)}),h.ctx.shadowColor="",h.ctx.shadowOffsetX=0,h.ctx.shadowOffsetY=0,h.ctx.shadowBlur=0),A.textDecorationLine.length&&(h.ctx.fillStyle=tA(A.textDecorationColor||A.color),A.textDecorationLine.forEach(function(w){switch(w){case 1:h.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+l),g.bounds.width,1);break;case 2:h.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:h.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+u),g.bounds.width,1);break}}));break;case 1:A.webkitTextStrokeWidth&&g.text.trim().length&&(h.ctx.strokeStyle=tA(A.webkitTextStrokeColor),h.ctx.lineWidth=A.webkitTextStrokeWidth,h.ctx.lineJoin=window.chrome?"miter":"round",h.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+l)),h.ctx.strokeStyle="",h.ctx.lineWidth=0,h.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,A,n){if(n&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var i=Vc(t),s=jc(A);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,t.intrinsicWidth,t.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return EA(this,void 0,void 0,function(){var A,n,i,s,a,o,B,B,l,u,f,h,E,c,g,Q,p,y,w,B,x,E,Q;return wA(this,function(L){switch(L.label){case 0:this.applyEffects(t.getEffects(4)),A=t.container,n=t.curves,i=A.styles,s=0,a=A.textNodes,L.label=1;case 1:return s<a.length?(o=a[s],[4,this.renderTextNode(o,i)]):[3,4];case 2:L.sent(),L.label=3;case 3:return s++,[3,1];case 4:if(!(A instanceof rx))return[3,8];L.label=5;case 5:return L.trys.push([5,7,,8]),[4,this.context.cache.match(A.src)];case 6:return B=L.sent(),this.renderReplacedElement(A,n,B),[3,8];case 7:return L.sent(),this.context.logger.error("Error loading image "+A.src),[3,8];case 8:if(A instanceof Ax&&this.renderReplacedElement(A,n,A.canvas),!(A instanceof nx))return[3,12];L.label=9;case 9:return L.trys.push([9,11,,12]),[4,this.context.cache.match(A.svg)];case 10:return B=L.sent(),this.renderReplacedElement(A,n,B),[3,12];case 11:return L.sent(),this.context.logger.error("Error loading svg "+A.svg.substring(0,255)),[3,12];case 12:return A instanceof lx&&A.tree?(l=new e(this.context,{scale:this.options.scale,backgroundColor:A.backgroundColor,x:0,y:0,width:A.width,height:A.height}),[4,l.render(A.tree)]):[3,14];case 13:u=L.sent(),A.width&&A.height&&this.ctx.drawImage(u,0,0,A.width,A.height,A.bounds.left,A.bounds.top,A.bounds.width,A.bounds.height),L.label=14;case 14:if(A instanceof cg&&(f=Math.min(A.bounds.width,A.bounds.height),A.type===Tc?A.checked&&(this.ctx.save(),this.path([new at(A.bounds.left+f*.39363,A.bounds.top+f*.79),new at(A.bounds.left+f*.16,A.bounds.top+f*.5549),new at(A.bounds.left+f*.27347,A.bounds.top+f*.44071),new at(A.bounds.left+f*.39694,A.bounds.top+f*.5649),new at(A.bounds.left+f*.72983,A.bounds.top+f*.23),new at(A.bounds.left+f*.84,A.bounds.top+f*.34085),new at(A.bounds.left+f*.39363,A.bounds.top+f*.79)]),this.ctx.fillStyle=tA(ax),this.ctx.fill(),this.ctx.restore()):A.type===Lc&&A.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(A.bounds.left+f/2,A.bounds.top+f/2,f/4,0,Math.PI*2,!0),this.ctx.fillStyle=tA(ax),this.ctx.fill(),this.ctx.restore())),G6(A)&&A.value.length){switch(h=this.createFontStyle(i),E=h[0],c=h[1],g=this.fontMetrics.getMetrics(E,c).baseline,this.ctx.font=E,this.ctx.fillStyle=tA(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=X6(A.styles.textAlign),Q=Vc(A),p=0,A.styles.textAlign){case 1:p+=Q.width/2;break;case 2:p+=Q.width;break}y=Q.add(p,0,0,-Q.height/2+1),this.ctx.save(),this.path([new at(Q.left,Q.top),new at(Q.left+Q.width,Q.top),new at(Q.left+Q.width,Q.top+Q.height),new at(Q.left,Q.top+Q.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new ko(A.value,y),i.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!qr(A.styles.display,2048))return[3,20];if(A.styles.listStyleImage===null)return[3,19];if(w=A.styles.listStyleImage,w.type!==0)return[3,18];B=void 0,x=w.url,L.label=15;case 15:return L.trys.push([15,17,,18]),[4,this.context.cache.match(x)];case 16:return B=L.sent(),this.ctx.drawImage(B,A.bounds.left-(B.width+10),A.bounds.top),[3,18];case 17:return L.sent(),this.context.logger.error("Error loading list-style-image "+x),[3,18];case 18:return[3,20];case 19:t.listValue&&A.styles.listStyleType!==-1&&(E=this.createFontStyle(i)[0],this.ctx.font=E,this.ctx.fillStyle=tA(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",Q=new ci(A.bounds.left,A.bounds.top+er(A.styles.paddingTop,A.bounds.width),A.bounds.width,Rb(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new ko(t.listValue,Q),i.letterSpacing,Rb(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),L.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return EA(this,void 0,void 0,function(){var A,n,w,i,s,w,a,o,w,l,u,w,f,h,w,c,g,w,p,y,w;return wA(this,function(B){switch(B.label){case 0:if(qr(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:B.sent(),A=0,n=t.negativeZIndex,B.label=2;case 2:return A<n.length?(w=n[A],[4,this.renderStack(w)]):[3,5];case 3:B.sent(),B.label=4;case 4:return A++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:B.sent(),i=0,s=t.nonInlineLevel,B.label=7;case 7:return i<s.length?(w=s[i],[4,this.renderNode(w)]):[3,10];case 8:B.sent(),B.label=9;case 9:return i++,[3,7];case 10:a=0,o=t.nonPositionedFloats,B.label=11;case 11:return a<o.length?(w=o[a],[4,this.renderStack(w)]):[3,14];case 12:B.sent(),B.label=13;case 13:return a++,[3,11];case 14:l=0,u=t.nonPositionedInlineLevel,B.label=15;case 15:return l<u.length?(w=u[l],[4,this.renderStack(w)]):[3,18];case 16:B.sent(),B.label=17;case 17:return l++,[3,15];case 18:f=0,h=t.inlineLevel,B.label=19;case 19:return f<h.length?(w=h[f],[4,this.renderNode(w)]):[3,22];case 20:B.sent(),B.label=21;case 21:return f++,[3,19];case 22:c=0,g=t.zeroOrAutoZIndexOrTransformedOrOpacity,B.label=23;case 23:return c<g.length?(w=g[c],[4,this.renderStack(w)]):[3,26];case 24:B.sent(),B.label=25;case 25:return c++,[3,23];case 26:p=0,y=t.positiveZIndex,B.label=27;case 27:return p<y.length?(w=y[p],[4,this.renderStack(w)]):[3,30];case 28:B.sent(),B.label=29;case 29:return p++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var A=this;t.forEach(function(n,i){var s=un(n)?n.start:n;i===0?A.ctx.moveTo(s.x,s.y):A.ctx.lineTo(s.x,s.y),un(n)&&A.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},e.prototype.renderRepeat=function(t,A,n,i){this.path(t),this.ctx.fillStyle=A,this.ctx.translate(n,i),this.ctx.fill(),this.ctx.translate(-n,-i)},e.prototype.resizeImage=function(t,A,n){var i;if(t.width===A&&t.height===n)return t;var s=(i=this.canvas.ownerDocument)!==null&&i!==void 0?i:document,a=s.createElement("canvas");a.width=Math.max(1,A),a.height=Math.max(1,n);var o=a.getContext("2d");return o.drawImage(t,0,0,t.width,t.height,0,0,A,n),a},e.prototype.renderBackgroundImage=function(t){return EA(this,void 0,void 0,function(){var A,n,i,s,a,o;return wA(this,function(l){switch(l.label){case 0:A=t.styles.backgroundImage.length-1,n=function(u){var f,h,c,D,re,ne,M,C,T,g,D,re,ne,M,C,p,y,w,B,x,E,Q,L,S,T,_,D,U,O,M,C,z,re,ne,Z,Ae,V,k,I,P,K,Y;return wA(this,function(J){switch(J.label){case 0:if(u.type!==0)return[3,5];f=void 0,h=u.url,J.label=1;case 1:return J.trys.push([1,3,,4]),[4,i.context.cache.match(h)];case 2:return f=J.sent(),[3,4];case 3:return J.sent(),i.context.logger.error("Error loading background-image "+h),[3,4];case 4:return f&&(c=bg(t,A,[f.width,f.height,f.width/f.height]),D=c[0],re=c[1],ne=c[2],M=c[3],C=c[4],T=i.ctx.createPattern(i.resizeImage(f,M,C),"repeat"),i.renderRepeat(D,T,re,ne)),[3,6];case 5:NO(u)?(g=bg(t,A,[null,null,null]),D=g[0],re=g[1],ne=g[2],M=g[3],C=g[4],p=SO(u.angle,M,C),y=p[0],w=p[1],B=p[2],x=p[3],E=p[4],Q=document.createElement("canvas"),Q.width=M,Q.height=C,L=Q.getContext("2d"),S=L.createLinearGradient(w,x,B,E),Fb(u.stops,y).forEach(function(q){return S.addColorStop(q.stop,tA(q.color))}),L.fillStyle=S,L.fillRect(0,0,M,C),M>0&&C>0&&(T=i.ctx.createPattern(Q,"repeat"),i.renderRepeat(D,T,re,ne))):OO(u)&&(_=bg(t,A,[null,null,null]),D=_[0],U=_[1],O=_[2],M=_[3],C=_[4],z=u.position.length===0?[Wd]:u.position,re=er(z[0],M),ne=er(z[z.length-1],C),Z=UO(u,re,ne,M,C),Ae=Z[0],V=Z[1],Ae>0&&V>0&&(k=i.ctx.createRadialGradient(U+re,O+ne,0,U+re,O+ne,Ae),Fb(u.stops,Ae*2).forEach(function(q){return k.addColorStop(q.stop,tA(q.color))}),i.path(D),i.ctx.fillStyle=k,Ae!==V?(I=t.bounds.left+.5*t.bounds.width,P=t.bounds.top+.5*t.bounds.height,K=V/Ae,Y=1/K,i.ctx.save(),i.ctx.translate(I,P),i.ctx.transform(1,0,0,K,0,0),i.ctx.translate(-I,-P),i.ctx.fillRect(U,Y*(O-P)+P,M,C*Y),i.ctx.restore()):i.ctx.fill())),J.label=6;case 6:return A--,[2]}})},i=this,s=0,a=t.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return s<a.length?(o=a[s],[5,n(o)]):[3,4];case 2:l.sent(),l.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,A,n){return EA(this,void 0,void 0,function(){return wA(this,function(i){return this.path(Lx(n,A)),this.ctx.fillStyle=tA(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,A,n,i){return EA(this,void 0,void 0,function(){var s,a;return wA(this,function(o){switch(o.label){case 0:return A<3?[4,this.renderSolidBorder(t,n,i)]:[3,2];case 1:return o.sent(),[2];case 2:return s=P6(i,n),this.path(s),this.ctx.fillStyle=tA(t),this.ctx.fill(),a=R6(i,n),this.path(a),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return EA(this,void 0,void 0,function(){var A,n,i,s,a,o,l,u,f=this;return wA(this,function(h){switch(h.label){case 0:return this.applyEffects(t.getEffects(2)),A=t.container.styles,n=!Yi(A.backgroundColor)||A.backgroundImage.length,i=[{style:A.borderTopStyle,color:A.borderTopColor,width:A.borderTopWidth},{style:A.borderRightStyle,color:A.borderRightColor,width:A.borderRightWidth},{style:A.borderBottomStyle,color:A.borderBottomColor,width:A.borderBottomWidth},{style:A.borderLeftStyle,color:A.borderLeftColor,width:A.borderLeftWidth}],s=W6(Ps(A.backgroundClip,0),t.curves),n||A.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),Yi(A.backgroundColor)||(this.ctx.fillStyle=tA(A.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:h.sent(),this.ctx.restore(),A.boxShadow.slice(0).reverse().forEach(function(c){f.ctx.save();var g=Hc(t.curves),p=c.inset?0:V6,y=T6(g,-p+(c.inset?1:-1)*c.spread.number,(c.inset?1:-1)*c.spread.number,c.spread.number*(c.inset?-2:2),c.spread.number*(c.inset?-2:2));c.inset?(f.path(g),f.ctx.clip(),f.mask(y)):(f.mask(g),f.ctx.clip(),f.path(y)),f.ctx.shadowOffsetX=c.offsetX.number+p,f.ctx.shadowOffsetY=c.offsetY.number,f.ctx.shadowColor=tA(c.color),f.ctx.shadowBlur=c.blur.number,f.ctx.fillStyle=c.inset?tA(c.color):"rgba(0,0,0,1)",f.ctx.fill(),f.ctx.restore()}),h.label=2;case 2:a=0,o=0,l=i,h.label=3;case 3:return o<l.length?(u=l[o],u.style!==0&&!Yi(u.color)&&u.width>0?u.style!==2?[3,5]:[4,this.renderDashedDottedBorder(u.color,u.width,a,t.curves,2)]:[3,11]):[3,13];case 4:return h.sent(),[3,11];case 5:return u.style!==3?[3,7]:[4,this.renderDashedDottedBorder(u.color,u.width,a,t.curves,3)];case 6:return h.sent(),[3,11];case 7:return u.style!==4?[3,9]:[4,this.renderDoubleBorder(u.color,u.width,a,t.curves)];case 8:return h.sent(),[3,11];case 9:return[4,this.renderSolidBorder(u.color,a,t.curves)];case 10:h.sent(),h.label=11;case 11:a++,h.label=12;case 12:return o++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,A,n,i,s){return EA(this,void 0,void 0,function(){var a,o,l,u,f,h,c,g,p,y,w,B,x,E,Q,L,Q,L;return wA(this,function(S){return this.ctx.save(),a=M6(i,n),o=Lx(i,n),s===2&&(this.path(o),this.ctx.clip()),un(o[0])?(l=o[0].start.x,u=o[0].start.y):(l=o[0].x,u=o[0].y),un(o[1])?(f=o[1].end.x,h=o[1].end.y):(f=o[1].x,h=o[1].y),n===0||n===2?c=Math.abs(l-f):c=Math.abs(u-h),this.ctx.beginPath(),s===3?this.formatPath(a):this.formatPath(o.slice(0,2)),g=A<3?A*3:A*2,p=A<3?A*2:A,s===3&&(g=A,p=A),y=!0,c<=g*2?y=!1:c<=g*2+p?(w=c/(2*g+p),g*=w,p*=w):(B=Math.floor((c+p)/(g+p)),x=(c-B*g)/(B-1),E=(c-(B+1)*g)/B,p=E<=0||Math.abs(p-x)<Math.abs(p-E)?x:E),y&&(s===3?this.ctx.setLineDash([0,g+p]):this.ctx.setLineDash([g,p])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=A):this.ctx.lineWidth=A*2+1.1,this.ctx.strokeStyle=tA(t),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(un(o[0])&&(Q=o[3],L=o[0],this.ctx.beginPath(),this.formatPath([new at(Q.end.x,Q.end.y),new at(L.start.x,L.start.y)]),this.ctx.stroke()),un(o[1])&&(Q=o[1],L=o[2],this.ctx.beginPath(),this.formatPath([new at(Q.end.x,Q.end.y),new at(L.start.x,L.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return EA(this,void 0,void 0,function(){var A;return wA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=tA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),A=L6(t),[4,this.renderStack(A)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},e})(Mx),G6=function(r){return r instanceof ox||r instanceof sx?!0:r instanceof cg&&r.type!==Lc&&r.type!==Tc},W6=function(r,e){switch(r){case 0:return Hc(e);case 2:return _6(e);case 1:default:return jc(e)}},X6=function(r){switch(r){case 1:return"center";case 2:return"right";case 0:default:return"left"}},Y6=["-apple-system","system-ui"],$6=function(r){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?r.filter(function(e){return Y6.indexOf(e)===-1}):r},J6=(function(r){Fn(e,r);function e(t,A){var n=r.call(this,t,A)||this;return n.canvas=A.canvas?A.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=A,n.canvas.width=Math.floor(A.width*A.scale),n.canvas.height=Math.floor(A.height*A.scale),n.canvas.style.width=A.width+"px",n.canvas.style.height=A.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-A.x,-A.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale),n}return e.prototype.render=function(t){return EA(this,void 0,void 0,function(){var A,n;return wA(this,function(i){switch(i.label){case 0:return A=og(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Z6(A)];case 1:return n=i.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=tA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e})(Mx),Z6=function(r){return new Promise(function(e,t){var A=new Image;A.onload=function(){e(A)},A.onerror=t,A.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(r))})},eP=(function(){function r(e){var t=e.id,A=e.enabled;this.id=t,this.enabled=A,this.start=Date.now()}return r.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,ec([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},r.prototype.getTime=function(){return Date.now()-this.start},r.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,ec([this.id,this.getTime()+"ms"],e))},r.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,ec([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},r.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,ec([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},r.instances={},r})(),tP=(function(){function r(e,t){var A;this.windowBounds=t,this.instanceName="#"+r.instanceCount++,this.logger=new eP({id:this.instanceName,enabled:e.logging}),this.cache=(A=e.cache)!==null&&A!==void 0?A:new B6(this,e)}return r.instanceCount=1,r})(),xg=function(r,e){return e===void 0&&(e={}),rP(r,e)};typeof window<"u"&&_x.setContext(window);var rP=function(r,e){return EA(void 0,void 0,void 0,function(){var t,A,n,i,s,a,o,l,u,f,h,c,g,p,y,w,B,x,E,Q,S,L,S,T,_,D,U,O,M,C,z,re,ne,Z,Ae,V,k,I,P,K;return wA(this,function(Y){switch(Y.label){case 0:if(!r||typeof r!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=r.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(A=t.defaultView,!A)throw new Error("Document is not attached to a Window");return n={allowTaint:(T=e.allowTaint)!==null&&T!==void 0?T:!1,imageTimeout:(_=e.imageTimeout)!==null&&_!==void 0?_:15e3,proxy:e.proxy,useCORS:(D=e.useCORS)!==null&&D!==void 0?D:!1},i=Sd({logging:(U=e.logging)!==null&&U!==void 0?U:!0,cache:e.cache},n),s={windowWidth:(O=e.windowWidth)!==null&&O!==void 0?O:A.innerWidth,windowHeight:(M=e.windowHeight)!==null&&M!==void 0?M:A.innerHeight,scrollX:(C=e.scrollX)!==null&&C!==void 0?C:A.pageXOffset,scrollY:(z=e.scrollY)!==null&&z!==void 0?z:A.pageYOffset},a=new ci(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),o=new tP(i,a),l=(re=e.foreignObjectRendering)!==null&&re!==void 0?re:!1,u={allowTaint:(ne=e.allowTaint)!==null&&ne!==void 0?ne:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:l,copyStyles:l},o.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),f=new Sx(o,r,u),h=f.clonedReferenceElement,h?[4,f.toIFrame(t,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return c=Y.sent(),g=hg(h)||n6(h)?TQ(h.ownerDocument):tc(o,h),p=g.width,y=g.height,w=g.left,B=g.top,x=AP(o,h,e.backgroundColor),E={canvas:e.canvas,backgroundColor:x,scale:(Ae=(Z=e.scale)!==null&&Z!==void 0?Z:A.devicePixelRatio)!==null&&Ae!==void 0?Ae:1,x:((V=e.x)!==null&&V!==void 0?V:0)+w,y:((k=e.y)!==null&&k!==void 0?k:0)+B,width:(I=e.width)!==null&&I!==void 0?I:Math.ceil(p),height:(P=e.height)!==null&&P!==void 0?P:Math.ceil(y)},l?(o.logger.debug("Document cloned, using foreign object rendering"),S=new J6(o,E),[4,S.render(h)]):[3,3];case 2:return Q=Y.sent(),[3,5];case 3:return o.logger.debug("Document cloned, element located at "+w+","+B+" with size "+p+"x"+y+" using computed rendering"),o.logger.debug("Starting DOM parsing"),L=cx(o,h),x===L.styles.backgroundColor&&(L.styles.backgroundColor=hi.TRANSPARENT),o.logger.debug("Starting renderer for element at "+E.x+","+E.y+" with size "+E.width+"x"+E.height),S=new z6(o,E),[4,S.render(L)];case 4:Q=Y.sent(),Y.label=5;case 5:return(!((K=e.removeContainer)!==null&&K!==void 0)||K)&&(Sx.destroy(c)||o.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),o.logger.debug("Finished rendering"),[2,Q]}})})},AP=function(r,e,t){var A=e.ownerDocument,n=A.documentElement?Ro(r,getComputedStyle(A.documentElement).backgroundColor):hi.TRANSPARENT,i=A.body?Ro(r,getComputedStyle(A.body).backgroundColor):hi.TRANSPARENT,s=typeof t=="string"?Ro(r,t):t===null?hi.TRANSPARENT:4294967295;return e===A.documentElement?Yi(n)?Yi(i)?s:i:n:s};const nP=Object.freeze(Object.defineProperty({__proto__:null,default:xg},Symbol.toStringTag,{value:"Module"})),Dx=({bands:r,data:e,dataFields:t,onClose:A,pageWidth:n=794,pageHeight:i=1123,showPageNumbers:s=!0,pageMargins:a={top:40,bottom:40,left:40,right:40},paperWidthMm:o=210,paperHeightMm:l=297})=>{const[u,f]=ce.useState(1),[h,c]=ce.useState(1),[g,p]=ce.useState(!0),[y,w]=ce.useState(!1),B=ce.useRef([]),x=ce.useRef(null),E=Zf(t)||"products",{headerBand:Q,detailBand:L,summaryBand:S,footerBand:T}=ce.useMemo(()=>({headerBand:r.find(q=>q.id==="header"),detailBand:r.find(q=>q.id==="detail"),summaryBand:r.find(q=>q.id==="summary"),footerBand:r.find(q=>q.id==="footer")}),[r]),{rowsPerPage:_,totalPages:D,singleRowHeight:U,minTopOffset:O,hasFooterOnlyPage:M,footerSplitY:C}=ce.useMemo(()=>{var Ye;if(!L||!(e!=null&&e[E]))return{rowsPerPage:0,totalPages:1,singleRowHeight:0,minTopOffset:0,hasFooterOnlyPage:!1,footerSplitY:0};const q=L.actualBottom-L.top,W=((Ye=L.objects)==null?void 0:Ye.filter(xe=>xe.y>=L.top&&xe.y<L.actualBottom))||[],te=W.length>0?Math.min(...W.map(xe=>xe.y-L.top)):0,oe=q-te,we=i-a.top-a.bottom;let le=0;Q&&(le+=Q.actualBottom-Q.top);const Be=(S==null?void 0:S.summaryDisplayMode)||"atEnd";S&&Be==="perPage"&&(le+=S.actualBottom-S.top);const ye=we-le,R=Math.max(1,Math.floor(ye/oe)),Ue=e[E].length;let Re=Math.max(1,Math.ceil(Ue/R)),Ee=!1,Ve=0;const Me=S&&Be==="atEnd"?S.actualBottom-S.top:0,ze=T?T.actualBottom-T.top:0;if(ze>0&&Ue>0){const xe=(Re-1)*R,je=(Ue-xe)*oe;let ge=we-le-je-Me;if(ge<ze)if(ge>0&&T){const Te=[...T.objects||[]].map(ue=>{let fe,Le;if(ue.type==="line"){const Fe=ue,Ne=Fe.y1??ue.y,ve=Fe.y2??ue.y;fe=Math.min(Ne,ve)-T.top,Le=Math.max(Ne,ve)-T.top}else fe=ue.y-T.top,Le=fe+ue.height;return{obj:ue,objTop:fe,objBottom:Le}}).sort((ue,fe)=>ue.objBottom-fe.objBottom);Ve=0;for(const{objBottom:ue}of Te)if(ue<=ge)Ve=ue;else break;Ve>0?(Ee=!0,Re=Re+1):(Ee=!0,Re=Re+1,Ve=0)}else Ee=!0,Re=Re+1,Ve=0}return{rowsPerPage:R,totalPages:Re,singleRowHeight:oe,minTopOffset:te,hasFooterOnlyPage:Ee,footerSplitY:Ve}},[L,e,i,a,Q,S,T,E]),z=ce.useMemo(()=>{const q=e==null?void 0:e[E];if(!L||!q)return[];const W=[],te=M?D-1:D;for(let oe=1;oe<=te;oe++){const we=(oe-1)*_,le=Math.min(we+_,q.length);W.push({pageNumber:oe,items:q.slice(we,le),startIndex:we,totalItems:q.length,isFooterOnlyPage:!1})}return M&&W.push({pageNumber:D,items:[],startIndex:q.length,totalItems:q.length,isFooterOnlyPage:!0}),W},[L,e,_,D,E,M]),re=ce.useMemo(()=>{const q=[];return r.forEach(W=>{W.objects.forEach(te=>{te.type==="image"&&te.floating===!0&&q.push({obj:te,bandId:W.id})})}),q},[r]),ne=ce.useCallback(q=>{const W=B.current[q-1];W&&x.current&&W.scrollIntoView({behavior:"auto",block:"start"}),f(q)},[]),Z=ce.useCallback(async()=>{if(y)return;w(!0);const q=g;p(!1),await new Promise(W=>setTimeout(W,100));try{const W=o>l,te=new pt({orientation:W?"landscape":"portrait",unit:"mm",format:[Math.min(o,l),Math.max(o,l)]}),oe=o,we=l;for(let Be=0;Be<D;Be++){const ye=B.current[Be];if(!ye)continue;const R=await xg(ye,{scale:2,useCORS:!0,allowTaint:!0,backgroundColor:"#ffffff",logging:!1}),Ie=R.toDataURL("image/png"),Ue=oe,Re=R.height*oe/R.width;Be>0&&te.addPage(),te.addImage(Ie,"PNG",0,0,Ue,Math.min(Re,we))}const le=`报表_${new Date().toLocaleDateString("zh-CN").replace(/\//g,"-")}.pdf`;te.save(le),console.log("PDF 导出成功:",le)}catch(W){console.error("PDF 导出失败:",W),alert("PDF 导出失败,请重试")}finally{p(q),w(!1)}},[y,D,g,o,l]),Ae=ce.useCallback((q,W)=>{if(q.backgroundColorFormula&&(q.id==="detail"||q.id==="summary")){const te=ho(q.backgroundColorFormula,{data:(W==null?void 0:W.data)||e,currentPage:(W==null?void 0:W.currentPage)||1,totalPages:(W==null?void 0:W.totalPages)||D,rowIndex:(W==null?void 0:W.rowIndex)??0},{});if(console.log("[BgColor] rowIndex:",W==null?void 0:W.rowIndex,"formula:",q.backgroundColorFormula,"result:",te),te&&!te.includes("错误")&&!te.includes("公式"))return te.replace(/^["']|["']$/g,"")}return q.backgroundColor},[e,D]),V=ce.useCallback((q,W,te)=>{if(q.rowHeightFormula&&(q.id==="detail"||q.id==="summary")){const oe=ho(q.rowHeightFormula,{data:(te==null?void 0:te.data)||e,currentPage:(te==null?void 0:te.currentPage)||1,totalPages:(te==null?void 0:te.totalPages)||D,rowIndex:W},{}),we=parseFloat(oe);if(!isNaN(we)&&we>0)return we}return U},[e,D,U]),k=ce.useCallback((q,W,te,oe,we)=>{const le=Ae(q,{rowIndex:te+W,data:e,currentPage:oe,totalPages:D}),Be=V(q,te+W,{data:e,currentPage:oe,totalPages:D});return v.jsx("div",{className:"detail-row",style:{position:"absolute",top:`${W*Be}px`,left:"0px",width:"100%",height:`${Be}px`,boxSizing:"border-box",overflow:"hidden",backgroundColor:le},children:q.objects.filter(ye=>ye.printVisible!==!1&&!(ye.floating===!0&&ye.type==="image")).map(ye=>{if(ye.type==="line"){const xe=ye,Oe=xe.x1??ye.x,je=(xe.y1??ye.y)-q.top-O,ge=xe.x2??ye.x+ye.width,Pe=(xe.y2??ye.y)-q.top-O,Te=xe.color||"#000000",ue=xe.strokeWidth||1,fe=xe.lineStyle||"solid",Le=ge-Oe,Fe=Pe-je,Ne=Math.sqrt(Le*Le+Fe*Fe),ve=Math.atan2(Fe,Le)*(180/Math.PI),Qe=()=>fe==="dashed"?"dashed":fe==="dotted"?"dotted":"solid";return v.jsx("div",{style:{position:"absolute",left:Oe,top:je,width:Ne,height:0,borderTop:`${ue}px ${Qe()} ${Te}`,transformOrigin:"0 0",transform:`rotate(${ve}deg)`,zIndex:(ye.zIndex??1)+100}},`${ye.id}-${W}`)}const R=Qu(ye,{data:e,currentPage:oe,totalPages:D,startIndex:te,rowIndex:W,pageSize:we}),Ie=Hh(ye,{isPreview:!0}),Ue=["text","multiline_text","field","page_number","current_date"].includes(ye.type),Me=(xe=>{if(!xe||xe==="none")return 0;const Oe=xe.match(/(\d+)px/);return Oe?parseInt(Oe[1]):0})(Ie.border)+2,ze=ye.y-q.top-O,Ye={position:"absolute",left:ye.x,top:ze,width:ye.width+Me*2,height:ye.height+Me*2,zIndex:(ye.zIndex??1)+100,...Ie,boxSizing:"border-box"};return v.jsx("div",{style:jh(ye,Ye,Ue),title:`${ye.fieldName}: ${R}`,children:ye.type==="image"?ye.src||ye.imageUrl?ye.objectFit==="repeat"?v.jsx("div",{style:{width:"100%",height:"100%",backgroundImage:`url(${ye.src||ye.imageUrl})`,backgroundRepeat:"repeat",backgroundSize:"auto"}}):v.jsx("img",{src:ye.src||ye.imageUrl,alt:ye.alt||"图片",style:{width:"100%",height:"100%",objectFit:ye.objectFit||"contain"}}):v.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"[图片]"}):ye.type==="barcode"?v.jsx(Mh,{value:R,type:ye.barcodeType||"CODE128",width:ye.width,height:ye.height,showText:ye.showText!==!1,background:ye.background||"#FFFFFF",lineColor:ye.lineColor||"#000000"}):ye.type==="qrcode"?v.jsx(Dh,{value:R,width:ye.width,height:ye.height,errorLevel:ye.errorLevel||"M",background:ye.background||"#FFFFFF",foreground:ye.foreground||"#000000"}):Cw(R,ye,Ie)},`${ye.id}-${W}`)})},`detail-row-${W}`)},[O,D,e,Ae,V]),I=ce.useCallback((q,W,te,oe,we)=>{const le=q.actualBottom-q.top;if(W.type==="line"){const R=W,Ie=(R.y1??W.y)-q.top,Ue=(R.y2??W.y)-q.top,Re=R.x1??W.x,Ee=R.x2??W.x+W.width,Ve=R.color||"#000000",Me=R.strokeWidth||1,ze=R.lineStyle||"solid";let Ye=Re,xe=Ie,Oe=Ee,je=Ue;const ge=Math.min(Ie,Ue);if(Math.max(Ie,Ue)<=0||ge>=le)return null;if(Ie!==Ue){const Ne=Ee-Re,ve=Ue-Ie;Ie<0?(Ye=Re+Ne*(0-Ie)/ve,xe=0):Ie>le&&(Ye=Re+Ne*(le-Ie)/ve,xe=le),Ue<0?(Oe=Ee+Ne*(0-Ue)/ve,je=0):Ue>le&&(Oe=Ee+Ne*(le-Ue)/ve,je=le)}else if(Ie<0||Ie>le)return null;const Te=Oe-Ye,ue=je-xe,fe=Math.sqrt(Te*Te+ue*ue),Le=Math.atan2(ue,Te)*(180/Math.PI),Fe=()=>ze==="dashed"?"dashed":ze==="dotted"?"dotted":"solid";return v.jsx("div",{style:{position:"absolute",left:Ye,top:xe,width:fe,height:0,borderTop:`${Me}px ${Fe()} ${Ve}`,transformOrigin:"0 0",transform:`rotate(${Le}deg)`,zIndex:(W.zIndex??1)+100}},`${q.id}-${W.id}-${te}`)}const Be=Nu(W,q,{isSelected:!1,isPreview:!0,data:e,currentPage:oe,totalPages:D,includeClipPath:!0,pageSize:we}),ye=["text","multiline_text","field","page_number","current_date"].includes(W.type);return v.jsx("div",{style:jh(W,Be.style,ye),children:W.type==="image"?W.src||W.imageUrl?W.objectFit==="repeat"?v.jsx("div",{style:{width:"100%",height:"100%",backgroundImage:`url(${W.src||W.imageUrl})`,backgroundRepeat:"repeat",backgroundSize:"auto"}}):v.jsx("img",{src:W.src||W.imageUrl,alt:W.alt||"图片",style:{width:"100%",height:"100%",objectFit:W.objectFit||"contain"}}):v.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"[图片]"}):W.type==="barcode"?v.jsx(Mh,{value:Be.content,type:W.barcodeType||"CODE128",width:W.width,height:W.height,showText:W.showText!==!1,background:W.background||"#FFFFFF",lineColor:W.lineColor||"#000000"}):W.type==="qrcode"?v.jsx(Dh,{value:Be.content,width:W.width,height:W.height,errorLevel:W.errorLevel||"M",background:W.background||"#FFFFFF",foreground:W.foreground||"#000000"}):Be.wrappedContent||Be.content},`${q.id}-${W.id}-${te}`)},[e,D]),P=ce.useCallback((q,W)=>{var ye;const te=[];let oe=a.top;const we=q===D,le=(S==null?void 0:S.summaryDisplayMode)||"atEnd";if((W==null?void 0:W.isFooterOnlyPage)===!0){if(T){const R=T.actualBottom-T.top,Ie=C>0?R-C:R;te.push({band:T,top:oe,height:Ie,isDetail:!1,pageData:W,footerPart:"after",footerSplitY:C})}return te}if(Q){const R=Q.actualBottom-Q.top;te.push({band:Q,top:oe,height:R,isDetail:!1,pageData:W}),oe+=R}if(L){const R=U*(((ye=W.items)==null?void 0:ye.length)||0);te.push({band:L,top:oe,height:R,isDetail:!0,pageData:W}),oe+=R}if(S){let R=!1;switch(le){case"perPage":R=!0;break;case"perGroup":R=M?q===D-1:we;break;case"atEnd":default:R=M?q===D-1:we;break}if(R){const Ie=S.actualBottom-S.top;te.push({band:S,top:oe,height:Ie,isDetail:!1,pageData:W}),oe+=Ie}}if(T){const R=T.actualBottom-T.top;M&&C>0&&q===D-1?te.push({band:T,top:oe,height:C,isDetail:!1,pageData:W,footerPart:"before",footerSplitY:C}):we&&!M&&te.push({band:T,top:oe,height:R,isDetail:!1,pageData:W})}return te},[Q,L,S,T,a,D,U,M,C]),K=ce.useCallback((q,W)=>{var Re,Ee;const{band:te,top:oe,height:we,isDetail:le,pageData:Be,footerPart:ye,footerSplitY:R}=q,Ie=((Re=Be==null?void 0:Be.items)==null?void 0:Re.length)||0,Ue=Ae(te,{data:e,currentPage:W,totalPages:D});if(le)return v.jsx("div",{className:`preview-band preview-band-${te.id}`,style:{position:"absolute",top:`${oe}px`,left:`${a.left}px`,right:`${a.right}px`,height:`${we}px`,backgroundColor:Ue,overflow:"hidden",clipPath:"inset(0)"},children:(Ee=Be==null?void 0:Be.items)==null?void 0:Ee.map((Ve,Me)=>k(te,Me,Be.startIndex,W,Ie))},`${te.id}-page${W}`);{const Ve=ye==="before"||ye==="after",Me=R||0;return v.jsx("div",{className:`preview-band preview-band-${te.id}`,style:{position:"absolute",top:`${oe}px`,left:`${a.left}px`,right:`${a.right}px`,height:`${we}px`,backgroundColor:Ue,overflow:"hidden",clipPath:"inset(0)"},children:te.objects.filter(ze=>{if(ze.printVisible===!1||ze.floating===!0&&ze.type==="image")return!1;let Ye,xe;if(ze.type==="line"){const je=ze;Ye=Math.min(je.y1??ze.y,je.y2??ze.y)-te.top,xe=Math.max(je.y1??ze.y,je.y2??ze.y)-te.top}else Ye=ze.y-te.top,xe=Ye+ze.height;if(Ve&&Me>0){if(ye==="before")return xe<=Me;if(ye==="after")return xe>Me}const Oe=te.actualBottom-te.top;return!(xe<=0||Ye>=Oe)}).map((ze,Ye)=>{if(ye==="after"&&Me>0){const xe={...ze};if(ze.type==="line"){const Oe=xe;Oe.y1!==void 0&&(Oe.y1=Oe.y1-Me),Oe.y2!==void 0&&(Oe.y2=Oe.y2-Me),xe.y=xe.y-Me}else xe.y=xe.y-Me;return I(te,xe,Ye,W,Ie)}return I(te,ze,Ye,W,Ie)})},`${te.id}-page${W}${ye?`-${ye}`:""}`)}},[a,k,I,Ae,e,D]),Y=ce.useCallback(q=>{const W=z[q-1],te=P(q,W);return v.jsxs("div",{ref:oe=>{B.current[q-1]=oe},className:"preview-page",style:{width:`${n}px`,height:`${i}px`,backgroundColor:"white",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",position:"relative",marginBottom:"20px"},children:[g&&v.jsxs("div",{className:"page-margins",children:[v.jsx("div",{className:"margin-top",style:{position:"absolute",top:0,left:0,right:0,height:`${a.top}px`,borderBottom:"1px dashed #ddd"}}),v.jsx("div",{className:"margin-bottom",style:{position:"absolute",bottom:0,left:0,right:0,height:`${a.bottom}px`,borderTop:"1px dashed #ddd"}}),v.jsx("div",{className:"margin-left",style:{position:"absolute",top:0,bottom:0,left:0,width:`${a.left}px`,borderRight:"1px dashed #ddd"}}),v.jsx("div",{className:"margin-right",style:{position:"absolute",top:0,bottom:0,right:0,width:`${a.right}px`,borderLeft:"1px dashed #ddd"}})]}),re.map(({obj:oe},we)=>{const le=oe;if(le.printVisible===!1)return null;const Be={position:"absolute",left:le.x+a.left,top:le.y+a.top,width:le.width,height:le.height,zIndex:1,overflow:"hidden"};return v.jsx("div",{style:Be,children:le.src||le.imageUrl?le.objectFit==="repeat"?v.jsx("div",{style:{width:"100%",height:"100%",backgroundImage:`url(${le.src||le.imageUrl})`,backgroundRepeat:"repeat",backgroundSize:"auto"}}):v.jsx("img",{src:le.src||le.imageUrl,alt:le.alt||"图片",style:{width:"100%",height:"100%",objectFit:le.objectFit||"contain"}}):v.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"[图片]"})},`floating-${oe.id}-${q}-${we}`)}),te.map(oe=>K(oe,q)),s&&v.jsxs("div",{className:"page-number",style:{position:"absolute",bottom:`${a.bottom/2}px`,right:`${a.right}px`,fontSize:"12px",color:"#666"},children:[q," / ",D]})]},`page-${q}`)},[z,P,n,i,g,a,s,D,K,re]),J=ce.useCallback(()=>v.jsx("div",{className:"all-pages-container",style:{display:"flex",flexDirection:"column",alignItems:"center",transform:`scale(${h})`,transformOrigin:"top center"},children:Array.from({length:D},(q,W)=>Y(W+1))}),[D,h,Y]);return v.jsxs("div",{className:"print-preview-modal",children:[v.jsx("div",{className:"preview-overlay",onClick:A}),v.jsxs("div",{className:"preview-container",style:{minWidth:`${n+100}px`},children:[v.jsxs("div",{className:"preview-toolbar",children:[v.jsxs("div",{className:"toolbar-left",children:[v.jsx("button",{className:"btn",onClick:A,title:"关闭",children:"✕"}),v.jsx("button",{className:"btn btn-primary",onClick:()=>window.print(),title:"打印",children:"🖨️"}),v.jsx("button",{className:"btn btn-primary",onClick:Z,disabled:y,title:"导出 PDF",children:y?"⏳ 导出中...":"📄 导出 PDF"}),v.jsx("button",{className:"btn",onClick:()=>p(!g),title:g?"隐藏边距":"显示边距",children:g?"👁🗨":"👁"})]}),v.jsxs("div",{className:"toolbar-center",children:[v.jsx("span",{children:"🔍"}),v.jsxs("select",{value:h,onChange:q=>c(parseFloat(q.target.value)),className:"zoom-select",children:[v.jsx("option",{value:"0.5",children:"50%"}),v.jsx("option",{value:"0.75",children:"75%"}),v.jsx("option",{value:"1",children:"100%"}),v.jsx("option",{value:"1.25",children:"125%"}),v.jsx("option",{value:"1.5",children:"150%"})]}),v.jsxs("div",{className:"page-controls",children:[v.jsx("button",{className:"btn btn-small",onClick:()=>ne(Math.max(1,u-1)),disabled:u===1,title:"上一页",children:"◀"}),v.jsxs("span",{className:"page-info",children:["第",v.jsx("input",{type:"number",min:"1",max:D,value:u,onChange:q=>{const W=parseInt(q.target.value);!isNaN(W)&&W>=1&&W<=D&&ne(W)},className:"page-input"}),"页 / 共 ",D," 页"]}),v.jsx("button",{className:"btn btn-small",onClick:()=>ne(Math.min(D,u+1)),disabled:u===D,title:"下一页",children:"▶"})]})]})]}),v.jsx("div",{className:"preview-content",ref:x,children:J()})]})]})},kx=({pageSettings:r,onSettingsChange:e,onClose:t})=>{const[A,n]=ce.useState({...r}),[i,s]=ce.useState("custom");ce.useEffect(()=>{const{margins:w}=A;for(const[B,x]of Object.entries(Pl))if(B!=="custom"&&w.top===x.top&&w.bottom===x.bottom&&w.left===x.left&&w.right===x.right){s(B);return}s("custom")},[A]);const a=w=>{if(w==="Custom")n(B=>({...B,paperSize:"Custom"}));else{const B=Ll[w];B&&n(x=>({...x,paperSize:w,width:B.width,height:B.height,unit:B.unit}))}},o=w=>{if(s(w),w!=="custom"){const B=Pl[w];n(x=>({...x,margins:{top:B.top,bottom:B.bottom,left:B.left,right:B.right}}))}},l=(w,B)=>{n(x=>({...x,margins:{...x.margins,[w]:B}}))},u=w=>{n(B=>({...B,orientation:w}))},f=(w,B)=>{n(x=>({...x,paperSize:"Custom",[w]:B}))},h=()=>{e(A),t()},c=()=>{t()},g=()=>{const{width:w,height:B,orientation:x}=A;return x==="landscape"?{displayWidth:B,displayHeight:w}:{displayWidth:w,displayHeight:B}},{displayWidth:p,displayHeight:y}=g();return v.jsx("div",{className:"page-settings-overlay",children:v.jsxs("div",{className:"page-settings-panel",children:[v.jsxs("div",{className:"page-settings-header",children:[v.jsx("h3",{children:"页面设置"}),v.jsx("button",{className:"close-btn",onClick:c,children:"×"})]}),v.jsxs("div",{className:"page-settings-content",children:[v.jsxs("div",{className:"settings-section",children:[v.jsx("label",{className:"section-label",children:"纸张大小"}),v.jsxs("select",{value:A.paperSize,onChange:w=>a(w.target.value),className:"settings-select",children:[Object.entries(Ll).map(([w,B])=>v.jsx("option",{value:w,children:B.name},w)),v.jsx("option",{value:"Custom",children:"自定义"})]})]}),v.jsxs("div",{className:"settings-section dimensions-section",children:[v.jsxs("div",{className:"dimension-row",children:[v.jsx("label",{children:"宽度"}),v.jsx("input",{type:"number",value:A.width,onChange:w=>f("width",parseFloat(w.target.value)||0),disabled:A.paperSize!=="Custom",step:"0.1"}),v.jsx("span",{className:"unit",children:A.unit})]}),v.jsxs("div",{className:"dimension-row",children:[v.jsx("label",{children:"高度"}),v.jsx("input",{type:"number",value:A.height,onChange:w=>f("height",parseFloat(w.target.value)||0),disabled:A.paperSize!=="Custom",step:"0.1"}),v.jsx("span",{className:"unit",children:A.unit})]})]}),v.jsxs("div",{className:"settings-section",children:[v.jsx("label",{className:"section-label",children:"纸张方向"}),v.jsx("div",{className:"orientation-options",children:$v.map(w=>v.jsxs("label",{className:"orientation-option",children:[v.jsx("input",{type:"radio",name:"orientation",value:w.value,checked:A.orientation===w.value,onChange:()=>u(w.value)}),v.jsx("span",{className:`orientation-icon ${w.value}`,children:v.jsx("svg",{viewBox:"0 0 24 32",width:"24",height:"32",children:w.value==="portrait"?v.jsx("rect",{x:"2",y:"2",width:"20",height:"28",fill:"none",stroke:"currentColor",strokeWidth:"2",rx:"2"}):v.jsx("rect",{x:"2",y:"6",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"2",rx:"2"})})}),v.jsx("span",{children:w.label})]},w.value))})]}),v.jsxs("div",{className:"settings-section",children:[v.jsx("label",{className:"section-label",children:"页边距"}),v.jsx("select",{value:i,onChange:w=>o(w.target.value),className:"settings-select",children:Object.entries(Pl).map(([w,B])=>v.jsx("option",{value:w,children:B.name},w))})]}),v.jsx("div",{className:"settings-section margins-section",children:v.jsxs("div",{className:"margins-grid",children:[v.jsxs("div",{className:"margin-input",children:[v.jsx("label",{children:"上"}),v.jsx("input",{type:"number",value:A.margins.top,onChange:w=>l("top",parseFloat(w.target.value)||0),min:"0",step:"1"}),v.jsx("span",{className:"unit",children:"mm"})]}),v.jsxs("div",{className:"margin-input",children:[v.jsx("label",{children:"下"}),v.jsx("input",{type:"number",value:A.margins.bottom,onChange:w=>l("bottom",parseFloat(w.target.value)||0),min:"0",step:"1"}),v.jsx("span",{className:"unit",children:"mm"})]}),v.jsxs("div",{className:"margin-input",children:[v.jsx("label",{children:"左"}),v.jsx("input",{type:"number",value:A.margins.left,onChange:w=>l("left",parseFloat(w.target.value)||0),min:"0",step:"1"}),v.jsx("span",{className:"unit",children:"mm"})]}),v.jsxs("div",{className:"margin-input",children:[v.jsx("label",{children:"右"}),v.jsx("input",{type:"number",value:A.margins.right,onChange:w=>l("right",parseFloat(w.target.value)||0),min:"0",step:"1"}),v.jsx("span",{className:"unit",children:"mm"})]})]})}),v.jsxs("div",{className:"settings-section preview-section",children:[v.jsx("label",{className:"section-label",children:"预览"}),v.jsxs("div",{className:"page-preview-container",children:[v.jsx("div",{className:"page-preview",style:{aspectRatio:`${p} / ${y}`},children:v.jsx("div",{className:"page-preview-content",style:{top:`${A.margins.top/y*100}%`,bottom:`${A.margins.bottom/y*100}%`,left:`${A.margins.left/p*100}%`,right:`${A.margins.right/p*100}%`}})}),v.jsxs("div",{className:"page-preview-info",children:[p.toFixed(1)," × ",y.toFixed(1)," ",A.unit]})]})]})]}),v.jsxs("div",{className:"page-settings-footer",children:[v.jsx("button",{className:"btn btn-cancel",onClick:c,children:"取消"}),v.jsx("button",{className:"btn btn-apply",onClick:h,children:"应用"})]})]})})},iP=({options:r={},initialDesign:e,onDesignChange:t,onSave:A,data:n,dataFields:i,initialPageSettings:s,onPageSettingsChange:a})=>{const{bands:o,setBands:l,state:u,updateState:f,designerOptions:h,selectBand:c,updateObjectPosition:g,deleteSelectedObject:p,handleSave:y,updateBands:w,PAGE_WIDTH:B,PAGE_HEIGHT:x,PAGE_MARGINS:E,pageSettings:Q,setPageSettings:L,undo:S,redo:T,canUndo:_,canRedo:D}=Zv({options:r,initialDesign:e,onDesignChange:t,initialPageSettings:s,onPageSettingsChange:a}),U=ce.useRef(null),[O,M]=ce.useState(!1),[C,z]=ce.useState(!1),[re,ne]=ce.useState([]),[Z,Ae]=ce.useState(null),[V,k]=ce.useState(null),[I,P]=ce.useState(!1),[K,Y]=ce.useState(null),J=ce.useCallback(()=>{M(!1)},[]),q=ce.useCallback((ue,fe,Le)=>{k({x:ue,y:fe})},[]);ce.useEffect(()=>{const ue=fe=>{if((fe.ctrlKey||fe.metaKey)&&fe.key==="z"&&!fe.shiftKey&&(fe.preventDefault(),_&&S()),(fe.ctrlKey||fe.metaKey)&&(fe.key==="z"&&fe.shiftKey||fe.key==="y")&&(fe.preventDefault(),D&&T()),fe.key==="Delete"||fe.key==="Backspace"){const Le=fe.target;if(Le.tagName==="INPUT"||Le.tagName==="TEXTAREA")return;if(re.length>0){fe.preventDefault();const Fe=new Map;re.forEach(Ne=>{const[ve,Qe]=Ne.split("-");Fe.has(ve)||Fe.set(ve,new Set),Fe.get(ve).add(Qe)}),l(Ne=>Ne.map(ve=>{const Qe=Fe.get(ve.id);return Qe?{...ve,objects:ve.objects.filter(De=>!Qe.has(De.id))}:ve})),ne([]),f({selectedObject:null,selectedBand:null})}}};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[S,T,_,D,re,l,f]);const W=ce.useCallback((ue,fe)=>{fe.preventDefault();const Le=o.findIndex(Qe=>Qe.id===ue);if(Le===-1)return;const Fe=JSON.parse(JSON.stringify(o));U.current={bandIndex:Le,startY:fe.clientY,originalBands:Fe},f({draggingBoundary:ue});const Ne=Qe=>{if(!U.current)return;const{bandIndex:De,startY:it,originalBands:et}=U.current,Ge=Qe.clientY-it;Math.abs(Ge)<.5||l(At=>{const nt=et[De],tt=nt.actualBottom;let lt=tt+Ge;if(lt=Math.max(nt.top+0,lt),De>0){const Mr=At[De-1],nA=h.bandSpacing;lt=Math.max(lt,Mr.actualBottom+nA)}const AA=iA.toPx(x)-iA.toPx(E.top)-iA.toPx(E.bottom)-20;lt=Math.min(lt,AA);const Vr=lt-tt,Bt=At.map((Mr,nA)=>{if(nA===De)return{...Mr,actualBottom:lt,bottom:lt};if(nA>De){const zr=et[nA],bA=zr.top+Vr,Tt=zr.actualBottom+Vr;return{...Mr,top:bA,actualBottom:Tt,bottom:Tt,objects:Mr.objects.map((kt,mr)=>{const lA=zr.objects[mr];if(lA){if(kt.type==="line"){const QA=lA;return{...kt,y:lA.y+Vr,y1:(QA.y1??lA.y)+Vr,y2:(QA.y2??lA.y)+Vr}}return{...kt,y:lA.y+Vr}}return kt})}}return Mr});return U.current={bandIndex:De,startY:Qe.clientY,originalBands:JSON.parse(JSON.stringify(Bt))},Bt})},ve=()=>{U.current=null,f({draggingBoundary:null}),window.removeEventListener("mousemove",Ne),window.removeEventListener("mouseup",ve)};window.addEventListener("mousemove",Ne),window.addEventListener("mouseup",ve)},[o,h.bandSpacing,l,f,x,E]),te=ce.useCallback((ue,fe=!1)=>{l(Le=>Le.map(Fe=>{const Ne=ue.filter(ve=>ve.bandId===Fe.id);return Ne.length===0?Fe:{...Fe,objects:Fe.objects.map(ve=>{const Qe=Ne.find(De=>De.objectId===ve.id);if(!Qe)return ve;if(ve.type==="line"){const De=ve;return{...ve,x:ve.x+Qe.deltaX,y:ve.y+Qe.deltaY,x1:(De.x1??ve.x)+Qe.deltaX,y1:(De.y1??ve.y)+Qe.deltaY,x2:(De.x2??ve.x+ve.width)+Qe.deltaX,y2:(De.y2??ve.y)+Qe.deltaY}}return{...ve,x:ve.x+Qe.deltaX,y:ve.y+Qe.deltaY}})}}),fe)},[l]),oe=ce.useCallback(ue=>{l(fe=>fe.map(Le=>{const Fe=ue.filter(Ne=>Ne.bandId===Le.id);return Fe.length===0?Le:{...Le,objects:Le.objects.map(Ne=>{const ve=Fe.find(Qe=>Qe.objectId===Ne.id);if(!ve)return Ne;if(Ne.type==="line"){const Qe=Ne;let De=Qe.x1??Ne.x,it=Qe.y1??Ne.y,et=Qe.x2??Ne.x+Ne.width,Ge=Qe.y2??Ne.y;return ve.deltaWidth!==0&&(De<=et?et+=ve.deltaWidth:De+=ve.deltaWidth),ve.deltaHeight!==0&&(it<=Ge?Ge+=ve.deltaHeight:it+=ve.deltaHeight),{...Ne,x1:De,y1:it,x2:et,y2:Ge}}return{...Ne,width:Math.max(20,Ne.width+ve.deltaWidth),height:Math.max(20,Ne.height+ve.deltaHeight)}})}}))},[l]),we=ce.useCallback(ue=>{if(ue.length===0)return;const fe=()=>`obj_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,Le=new Map;ue.forEach(({object:Ne,bandId:ve})=>{Le.has(ve)||Le.set(ve,[]),Le.get(ve).push({...Ne,id:fe()})}),l(Ne=>Ne.map(ve=>{const Qe=Le.get(ve.id);return Qe?{...ve,objects:[...ve.objects,...Qe]}:ve}));const Fe=[];Le.forEach((Ne,ve)=>{Ne.forEach(Qe=>{Fe.push(`${ve}-${Qe.id}`)})}),ne(Fe),console.log(`已粘贴 ${ue.length} 个对象`)},[l]),le=ce.useCallback((ue,fe,Le=!1)=>{const Fe=`${fe}-${ue}`,Ne=re.includes(Fe);if(Le){const ve=Ne?re.filter(Qe=>Qe!==Fe):[...re,Fe];if(ne(ve),ve.length===0)f({selectedObject:null,selectedBand:null});else if(ve.length===1){const[Qe]=ve,[De,it]=Qe.split("-");f({selectedObject:it,selectedBand:De})}else{const Qe=ve[ve.length-1],[De,it]=Qe.split("-");f({selectedObject:it,selectedBand:De})}}else if(console.log("单选模式:",{selectedCount:re.length,isAlreadySelected:Ne,key:Fe}),re.length>1&&Ne){console.log("取消选中:",Fe);const ve=re.filter(Qe=>Qe!==Fe);if(ne(ve),ve.length===1){const[Qe]=ve,[De,it]=Qe.split("-");f({selectedObject:it,selectedBand:De})}else if(ve.length>1){const Qe=ve[ve.length-1],[De,it]=Qe.split("-");f({selectedObject:it,selectedBand:De})}}else ne([Fe]),f({selectedObject:ue,selectedBand:fe})},[re,f]),Be=ce.useCallback(ue=>{if(ue.length===0){ne([]),f({selectedObject:null,selectedBand:null});return}if(ne(ue),ue.length===1){const[fe]=ue,[Le,Fe]=fe.split("-");f({selectedObject:Fe,selectedBand:Le})}else{const[fe]=ue,[Le,Fe]=fe.split("-");f({selectedObject:Fe,selectedBand:Le})}},[f]),ye=ce.useCallback(()=>{ne([]),Ae(null),f({selectedObject:null,selectedBand:null})},[f]),R=ce.useCallback(()=>{ne([]),Ae(null),f({selectedObject:null})},[f]),Ie=ce.useCallback(ue=>{l(fe=>fe.map(Fe=>{const Ne=ue.filter(ve=>ve.bandId===Fe.id);return Ne.length===0?Fe:{...Fe,objects:Fe.objects.map(ve=>{const Qe=Ne.find(De=>De.objectId===ve.id);return Qe?{...ve,...Qe.changes}:ve})}}))},[l]),Ue=ce.useCallback(()=>{const ue=y();A?A(ue):(localStorage.setItem("bandDesignerData",JSON.stringify(ue)),alert("设计已保存到本地存储"))},[y,A]),Re=()=>{if(re.length>0){if(window.confirm(`确定要删除选中的 ${re.length} 个对象吗?`)){const ue=new Map;re.forEach(fe=>{const[Le,Fe]=fe.split("-");ue.has(Le)||ue.set(Le,new Set),ue.get(Le).add(Fe)}),l(fe=>fe.map(Le=>{const Fe=ue.get(Le.id);return Fe?{...Le,objects:Le.objects.filter(Ne=>!Fe.has(Ne.id))}:Le})),ye()}}else p()},Ee=ce.useCallback((ue,fe)=>{const Le=u.selectedBand;if(!Le){alert("请先选择一个带区");return}const Fe=o.findIndex(At=>At.id===Le);if(Fe===-1)return;const Ne=o[Fe],ve=Zs.find(At=>At.id===ue);if(!ve)return;const Qe=(V==null?void 0:V.x)??20,De=((V==null?void 0:V.y)??10)+Ne.top,et=Ne.objects.reduce((At,nt)=>{const tt=nt.zIndex??1;return tt>At?tt:At},0)+1,Ge={id:`${ue}_${Date.now()}`,type:ue,x:Qe,y:De,width:ve.defaultWidth,height:ve.defaultHeight,zIndex:et};if(ue==="text")Object.assign(Ge,{text:"文本",fontSize:14,color:"#000000",textAlign:"left"});else if(ue==="field")Object.assign(Ge,{fieldName:fe||"field",color:"#000000",background:"transparent"});else if(ue==="calculated"){Object.assign(Ge,{formula:"",text:"[计算]",color:"#000000",background:"transparent",formatType:"number",decimalPlaces:2}),Y({...Ge,bandId:Le}),P(!0);return}else ue==="page_number"?Object.assign(Ge,{text:"第1页/共1页",fontSize:12,color:"#000000",textAlign:"center"}):ue==="current_date"?Object.assign(Ge,{text:new Date().toLocaleDateString(),fontSize:12,color:"#000000",textAlign:"right"}):ue==="line"?(Object.assign(Ge,{x1:Qe,y1:De,x2:Qe+ve.defaultWidth,y2:De,strokeWidth:1,color:"#000000",lineStyle:"solid"}),console.log("添加线条:",{bandId:Le,bandTop:Ne.top,bandBottom:Ne.actualBottom,posX:Qe,posY:De,x1:Qe,y1:De,x2:Qe+ve.defaultWidth,y2:De,lastClickPosition:V})):ue==="rectangle"&&Object.assign(Ge,{background:"transparent"});l(At=>At.map(nt=>nt.id!==Le?nt:{...nt,objects:[...nt.objects,Ge]})),le(Ge.id,Le)},[o,u.selectedBand,V,l,le]),Ve=ce.useCallback((ue,fe)=>{const Le=u.selectedBand;if(!Le){alert("请先选择一个带区");return}const Fe=o.findIndex(tt=>tt.id===Le);if(Fe===-1)return;const Ne=o[Fe],ve=(V==null?void 0:V.x)??20,Qe=((V==null?void 0:V.y)??10)+Ne.top,De=Ne.objects.reduce((tt,lt)=>{const ur=lt.zIndex??1;return ur>tt?ur:tt},0),it=120,et=25,Ge=8,At=ue.map((tt,lt)=>{let ur,_t;return fe==="horizontal"?(ur=ve+lt*(it+Ge),_t=Qe):(ur=ve,_t=Qe+lt*(et+Ge)),{id:`field_${Date.now()}_${lt}`,type:"field",fieldName:tt.name,x:ur,y:_t,width:it,height:et,zIndex:De+1+lt,color:"#000000",background:"transparent"}});l(tt=>tt.map(lt=>lt.id!==Le?lt:{...lt,objects:[...lt.objects,...At]}));const nt=At.map(tt=>`${Le}-${tt.id}`);ne(nt),console.log(`已添加 ${ue.length} 个数据字段`)},[o,u.selectedBand,V,l]),Me=ce.useCallback(ue=>{if(!K)return;const{bandId:fe,...Le}=K,Fe={...Le,formula:ue};l(Ne=>Ne.map(ve=>ve.id!==fe?ve:{...ve,objects:[...ve.objects,Fe]})),le(Fe.id,fe),P(!1),Y(null)},[K,l,le]),ze=ce.useCallback(()=>{P(!1),Y(null)},[]),Ye=()=>{f({showRulers:!u.showRulers})},xe=()=>{f({showPageMargins:!u.showPageMargins})},Oe=u.selectedBand?o.find(ue=>ue.id===u.selectedBand):null,je=u.selectedObject&&Oe?Oe.objects.find(ue=>ue.id===u.selectedObject):null,ge=ce.useCallback(()=>{M(!0)},[]),Pe=ce.useRef(Ue),Te=ce.useRef(ge);return Pe.current=Ue,Te.current=ge,ce.useEffect(()=>{const ue=fe=>{const Le=fe.target;Le.tagName==="INPUT"||Le.tagName==="TEXTAREA"||((fe.ctrlKey||fe.metaKey)&&fe.key==="s"&&(fe.preventDefault(),Pe.current()),(fe.ctrlKey||fe.metaKey)&&fe.key==="p"&&(fe.preventDefault(),Te.current()))};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[]),v.jsxs("div",{className:"react-band-designer",children:[v.jsx(JU,{selectedObjectIds:re,bands:o,onUpdateObjects:Ie,onClearSelection:ye,onDeleteObjects:Re,onUndo:S,onRedo:T,canUndo:_,canRedo:D,onSave:Ue,onPreview:ge,showGrid:u.showGrid,showRulers:u.showRulers,showPageMargins:u.showPageMargins,onToggleGrid:()=>f({showGrid:!u.showGrid}),onToggleRulers:Ye,onTogglePageMargins:xe,onPageSettings:()=>z(!0),onAddControl:Ee,onAddFields:Ve,selectedBandId:u.selectedBand,dataFields:i||[]}),v.jsxs("div",{className:"workspace",children:[v.jsx("div",{className:"design-area",children:v.jsx(Fw,{bands:o,state:u,designerOptions:h,PAGE_WIDTH:iA.toPx(B),PAGE_HEIGHT:iA.toPx(x),PAGE_MARGINS:iA.convertMargins(E),onSelectBand:(ue,fe)=>{c(ue),!(fe!=null&&fe.shiftKey)&&!(fe!=null&&fe.ctrlKey)&&!(fe!=null&&fe.metaKey)&&ne([])},onSelectObject:le,onMultiSelect:Be,onUpdateObjectPosition:g,onUpdateObject:(ue,fe,Le,Fe)=>{l(Ne=>Ne.map(ve=>ve.id!==fe?ve:{...ve,objects:ve.objects.map(Qe=>Qe.id===ue?{...Qe,...Le}:Qe)}),Fe)},onBoundaryMouseDown:W,onMoveMultipleObjects:te,onResizeMultipleObjects:oe,onPasteObjects:we,selectedObjectIds:re,focusedObjectId:Z,onClearSelection:R,onClickPosition:q,onDeleteObjects:Re,onUndo:S,onRedo:T,canUndo:_,canRedo:D,onUpdateObjects:Ie,dataFields:i||[]})}),je?v.jsx(Qw,{object:je,bandId:u.selectedBand,dataFields:i||[],onUpdateBands:w,onClearSelection:()=>{ye(),f({selectedObject:null})}}):Oe?v.jsx(_w,{dataFields:i||[],band:Oe,onUpdate:ue=>{w(fe=>fe.map(Le=>Le.id===Oe.id?{...Le,...ue}:Le))},onFocusObject:(ue,fe)=>{const Le=`${fe}-${ue}`;Ae(Le),ne([]),f({selectedObject:null});const Fe=document.querySelector(`[data-object-id="${Le}"]`);Fe&&Fe.scrollIntoView({behavior:"smooth",block:"center"})},onSelectObject:(ue,fe)=>{const Le=`${fe}-${ue}`;ne([Le]),Ae(null),f({selectedBand:fe,selectedObject:ue})},selectedObjectIds:re,focusedObjectId:Z,onDeleteObject:(ue,fe)=>{l(Le=>Le.map(Fe=>Fe.id!==fe?Fe:{...Fe,objects:Fe.objects.filter(Ne=>Ne.id!==ue)})),ne(Le=>Le.filter(Fe=>Fe!==`${fe}-${ue}`)),Ae(null)}}):v.jsxs("div",{className:"property-panel",children:[v.jsx("h3",{children:"属性"}),v.jsxs("div",{className:"empty-state",children:[v.jsx("p",{children:re.length>0?`已选中 ${re.length} 个对象`:"请选择一个对象或带区"}),re.length>0&&v.jsxs("div",{className:"multi-selection-info",children:[v.jsx("p",{children:"按住Shift/Ctrl点击可多选"}),v.jsx("p",{children:"使用方向键微调位置"}),v.jsx("button",{className:"btn btn-small",onClick:ye,children:"清除选择"})]})]})]})]}),v.jsxs("div",{className:"status-bar",children:[v.jsxs("div",{className:"status-item",children:[v.jsx("span",{children:"提示:"})," 拖动带区边界线定义区域高度"]}),v.jsxs("div",{className:"status-item",children:[v.jsx("span",{children:"带区数:"})," ",o.length]}),v.jsxs("div",{className:"status-item",children:[v.jsx("span",{children:"控件总数:"})," ",o.reduce((ue,fe)=>ue+fe.objects.length,0)]}),v.jsxs("div",{className:"status-item",children:[v.jsx("span",{children:"选中对象:"})," ",re.length," 个"]})]}),O&&v.jsx(Dx,{bands:o,dataFields:i||[],pageWidth:iA.toPx(B),pageHeight:iA.toPx(x),pageMargins:iA.convertMargins(E),paperWidthMm:B,paperHeightMm:x,data:n,onClose:J}),I&&v.jsx(go,{dataFields:i||[],value:"",onConfirm:Me,onCancel:ze}),C&&v.jsx(kx,{pageSettings:Q,onSettingsChange:L,onClose:()=>z(!1)})]})},aP=({onSave:r,onPreview:e,onLoadSample:t,onClearDesign:A,showGrid:n,showBands:i,showRulers:s,showPageMargins:a,onToggleGrid:o,onToggleBands:l,onToggleRulers:u,onTogglePageMargins:f,onHandlePreview:h})=>v.jsxs("div",{className:"toolbar",children:[v.jsxs("div",{className:"toolbar-left",children:[v.jsx("button",{className:"btn btn-primary",onClick:r,children:"保存设计"}),v.jsx("button",{className:"btn",onClick:t,children:"加载示例"}),v.jsx("button",{className:"btn",onClick:A,children:"清空设计"}),v.jsx("button",{className:"btn",onClick:e,children:"预览"}),v.jsx("button",{className:"btn",onClick:h,children:"打印预览"})]}),v.jsxs("div",{className:"toolbar-right",children:[v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:n,onChange:c=>o(c.target.checked)}),"显示网格"]}),v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:i,onChange:c=>l(c.target.checked)}),"显示带区"]}),v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:s,onChange:u}),"显示标尺"]}),v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:a,onChange:f}),"显示边距"]})]})]});function Gc(r){const{pageSettings:e}=r;if(e){const t=e.orientation==="landscape"?Math.max(e.width,e.height):Math.min(e.width,e.height),A=e.orientation==="landscape"?Math.min(e.width,e.height):Math.max(e.width,e.height);return{pageWidth:Math.round(iA.toPx(t,"mm")),pageHeight:Math.round(iA.toPx(A,"mm")),pageMargins:{top:Math.round(iA.toPx(e.margins.top,"mm")),bottom:Math.round(iA.toPx(e.margins.bottom,"mm")),left:Math.round(iA.toPx(e.margins.left,"mm")),right:Math.round(iA.toPx(e.margins.right,"mm"))},paperWidthMm:t,paperHeightMm:A}}return{pageWidth:r.pageWidth??794,pageHeight:r.pageHeight??1123,pageMargins:r.pageMargins??{top:40,bottom:40,left:40,right:40},paperWidthMm:210,paperHeightMm:297}}function sP(r){var D;const{template:e,data:t,dataFields:A=[]}=r,{pageHeight:n,pageMargins:i}=Gc(r),s=e.find(U=>U.id==="header"),a=e.find(U=>U.id==="detail"),o=e.find(U=>U.id==="summary"),l=e.find(U=>U.id==="footer"),u=Zf(A)||"products";if(!a||!(t!=null&&t[u]))return{rowsPerPage:0,totalPages:1,singleRowHeight:0,minTopOffset:0,detailDataKey:u,hasFooterOnlyPage:!1};const f=a.actualBottom-a.top,h=((D=a.objects)==null?void 0:D.filter(U=>U.y>=a.top&&U.y<a.actualBottom))||[],c=h.length>0?Math.min(...h.map(U=>U.y-a.top)):0,g=f-c,p=n-i.top-i.bottom;let y=0;s&&(y+=s.actualBottom-s.top);const w=(o==null?void 0:o.summaryDisplayMode)||"atEnd";o&&w==="perPage"&&(y+=o.actualBottom-o.top);const B=p-y,x=Math.max(1,Math.floor(B/g)),Q=t[u].length;let L=Math.max(1,Math.ceil(Q/x)),S=!1;const T=o&&w==="atEnd"?o.actualBottom-o.top:0,_=l?l.actualBottom-l.top:0;if(_>0&&Q>0){const U=(L-1)*x,M=(Q-U)*g,C=p-y-M,z=T+_;C<z&&(C>=T&&T>0?(L=L+1,S=!0):C<T&&T>0?(L=L+1,S=!1):(L=L+1,S=!0))}return{rowsPerPage:x,totalPages:L,singleRowHeight:g,minTopOffset:c,detailDataKey:u,hasFooterOnlyPage:S}}function oP(r){return Object.entries(r).filter(([e,t])=>t!=null).map(([e,t])=>{const A=e.replace(/([A-Z])/g,"-$1").toLowerCase(),n=typeof t=="number"&&!["z-index","opacity","line-height","font-weight"].includes(A);return`${A}:${t}${n?"px":""}`}).join(";")}function lP(r,e,t){const A=r,n=A.x1??r.x,i=(A.y1??r.y)-e-t,s=A.x2??r.x+r.width,a=(A.y2??r.y)-e-t,o=A.color||"#000000",l=A.strokeWidth||1,u=A.lineStyle||"solid",f=s-n,h=a-i,c=Math.sqrt(f*f+h*h),g=Math.atan2(h,f)*(180/Math.PI);return`<div style="position:absolute;left:${n}px;top:${i}px;width:${c}px;height:0;border-top:${l}px ${u==="dashed"?"dashed":u==="dotted"?"dotted":"solid"} ${o};transform-origin:0 0;transform:rotate(${g}deg);z-index:${(r.zIndex??1)+100}"></div>`}function uP(r,e,t,A){const n=Hh(r,{isPreview:!0}),i=["text","multiline_text","field","calculated","page_number","current_date"].includes(r.type),s=r.y-t-A,a={position:"absolute",left:r.x,top:s,width:r.width,height:r.height,zIndex:(r.zIndex??1)+100,boxSizing:"border-box",overflow:"hidden",...n};if(i){const u=r.textVerticalAlign||"middle",f=r.textAlign||"left";a.display="flex",a.flexDirection="column",a.justifyContent=u==="top"?"flex-start":u==="bottom"?"flex-end":"center",a.alignItems=f==="center"?"center":f==="right"?"flex-end":"flex-start"}const o=oP(a);if(r.type==="image"){const u=r,f=u.src||u.imageUrl;return f?u.objectFit==="repeat"?`<div style="${o}"><div style="width:100%;height:100%;background-image:url(${f});background-repeat:repeat;background-size:auto"></div></div>`:`<div style="${o}"><img src="${f}" alt="${u.alt||"图片"}" style="width:100%;height:100%;object-fit:${u.objectFit||"contain"}"/></div>`:`<div style="${o}"><span style="color:#999;font-size:12px">[图片]</span></div>`}if(r.type==="barcode"){const u=r,f=u.barcodeType||"CODE128",h=u.showText!==!1,c=u.background||"#FFFFFF",g=u.lineColor||"#000000";if(!e)return`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:${c};color:#999;font-size:12px">[条码]</div></div>`;try{const p=document.createElementNS("http://www.w3.org/2000/svg","svg");return M2(p,e,{format:f,width:2,height:h?Math.max(r.height-20,20):r.height,displayValue:h,background:c,lineColor:g,margin:2,fontSize:12,textMargin:2}),p.setAttribute("width","100%"),p.setAttribute("height","100%"),p.setAttribute("preserveAspectRatio","none"),`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden">${p.outerHTML}</div></div>`}catch(p){return console.error("条码生成失败:",p),`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:#f00;font-size:12px">[条码错误]</div></div>`}}if(r.type==="qrcode"){const u=r,f=u.background||"#FFFFFF",h=u.foreground||"#000000",c=u.errorLevel||"M";if(!e)return`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:${f};color:#999;font-size:12px">[二维码]</div></div>`;try{const p=Rh.create(e,{errorCorrectionLevel:c}).modules,y=p.size,w=1,B=10,x=(y+w*2)*B;let E="";for(let L=0;L<y;L++)for(let S=0;S<y;S++)if(p.get(L,S)){const T=(S+w)*B,_=(L+w)*B;E+=`M${T},${_}h${B}v${B}h-${B}z`}const Q=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${x} ${x}" width="100%" height="100%" preserveAspectRatio="xMidYMid meet"><rect width="100%" height="100%" fill="${f}"/><path d="${E}" fill="${h}"/></svg>`;return`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:${f}">${Q}</div></div>`}catch(g){return console.error("二维码生成失败:",g),`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:#f00;font-size:12px">[二维码错误]</div></div>`}}if(r.type==="multiline_text")return`<div style="${o}"><div style="width:100%;word-break:break-word;white-space:normal">${e}</div></div>`;const l=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br/>");return`<div style="${o}"><span style="white-space:nowrap">${l}</span></div>`}function qo(r,e){const{data:t,currentPage:A,totalPages:n,startIndex:i=0,rowIndex:s=0,pageSize:a=0,minTopOffset:o=0,dataFields:l=[]}=e;let u="";return r.objects.filter(f=>f.printVisible!==!1&&!(f.floating===!0&&f.type==="image")).forEach(f=>{if(f.type==="line")u+=lP(f,r.top,o);else{const h=Qu(f,{data:t,currentPage:A,totalPages:n,startIndex:i,rowIndex:s,pageSize:a,dataFields:l});u+=uP(f,h,r.top,o)}}),u}function cP(r,e,t){const{template:A,data:n,dataFields:i=[]}=r,{pageWidth:s,pageHeight:a,pageMargins:o}=Gc(r),{rowsPerPage:l,totalPages:u,singleRowHeight:f,minTopOffset:h,detailDataKey:c,hasFooterOnlyPage:g}=t,p=A.find(C=>C.id==="header"),y=A.find(C=>C.id==="detail"),w=A.find(C=>C.id==="summary"),B=A.find(C=>C.id==="footer"),x=s-o.left-o.right;let E=o.top,Q="";const L=e===u;if(g&&L){if(B){const C=B.actualBottom-B.top,z=B.backgroundColor?`background-color:${B.backgroundColor};`:"";Q+=`<div style="position:absolute;top:${E}px;left:${o.left}px;width:${x}px;height:${C}px;overflow:hidden;${z}">`,Q+=qo(B,{data:n,currentPage:e,totalPages:u,dataFields:i}),Q+="</div>"}return`<div class="print-page" style="position:relative;width:${s}px;height:${a}px;background:#fff;box-sizing:border-box;page-break-after:always">${Q}</div>`}const T=n==null?void 0:n[c],_=g?u-1:u,D=(e-1)*l,U=e<=_&&T?T.slice(D,D+l):[];if(p){const C=p.actualBottom-p.top,z=p.backgroundColor?`background-color:${p.backgroundColor};`:"";Q+=`<div style="position:absolute;top:${E}px;left:${o.left}px;width:${x}px;height:${C}px;overflow:hidden;${z}">`,Q+=qo(p,{data:n,currentPage:e,totalPages:u,dataFields:i}),Q+="</div>",E+=C}if(y&&U.length>0){const C=U.length*f;Q+=`<div style="position:absolute;top:${E}px;left:${o.left}px;width:${x}px;height:${C}px;overflow:hidden">`,U.forEach((z,re)=>{const ne=D+re;let Z="";if(y.backgroundColorFormula){const V=ho(y.backgroundColorFormula,{data:n,currentPage:e,totalPages:u,rowIndex:ne},{});V&&!V.includes("错误")&&(Z=V.replace(/^["']|["']$/g,""))}else y.backgroundColor&&(Z=y.backgroundColor);const Ae=`position:absolute;top:${re*f}px;left:0;width:100%;height:${f}px;overflow:hidden;${Z?`background-color:${Z};`:""}`;Q+=`<div style="${Ae}">`,Q+=qo(y,{data:n,currentPage:e,totalPages:u,startIndex:D,rowIndex:re,pageSize:l,minTopOffset:h,dataFields:i}),Q+="</div>"}),Q+="</div>",E+=C}const O=(w==null?void 0:w.summaryDisplayMode)||"atEnd",M=O==="perPage"||O==="atEnd"&&(g?e===u-1:L);if(w&&M){const C=w.actualBottom-w.top,z=w.backgroundColor?`background-color:${w.backgroundColor};`:"";Q+=`<div style="position:absolute;top:${E}px;left:${o.left}px;width:${x}px;height:${C}px;overflow:hidden;${z}">`,Q+=qo(w,{data:n,currentPage:e,totalPages:u,startIndex:D,pageSize:U.length,dataFields:i}),Q+="</div>",E+=C}if(B&&L&&!g){const C=B.actualBottom-B.top,z=B.backgroundColor?`background-color:${B.backgroundColor};`:"";Q+=`<div style="position:absolute;top:${E}px;left:${o.left}px;width:${x}px;height:${C}px;overflow:hidden;${z}">`,Q+=qo(B,{data:n,currentPage:e,totalPages:u,startIndex:D,pageSize:U.length,dataFields:i}),Q+="</div>"}return`<div class="print-page" style="position:relative;width:${s}px;height:${a}px;background:#fff;box-sizing:border-box;page-break-after:always">${Q}</div>`}function Cg(r){const{pageWidth:e,pageHeight:t,paperWidthMm:A,paperHeightMm:n}=Gc(r),i=sP(r),{totalPages:s}=i;let a="";for(let o=1;o<=s;o++)a+=cP(r,o,i);return{html:a,totalPages:s,pageWidth:e,pageHeight:t,paperWidthMm:A,paperHeightMm:n}}async function fP(r,e){const t=document.createElement("div");t.style.cssText=`position:absolute;left:-9999px;top:0;width:${e}px;`,t.innerHTML=r,document.body.appendChild(t);const A=t.querySelectorAll('[data-qrcode="true"]'),n=[];return A.forEach(i=>{const s=decodeURIComponent(i.getAttribute("data-value")||""),a=i.getAttribute("data-bg")||"#FFFFFF",o=i.getAttribute("data-fg")||"#000000",l=i.getAttribute("data-level")||"M",u=parseInt(i.getAttribute("data-size")||"100",10),f=i.querySelector("canvas");if(f&&s){const h=Rh.toCanvas(f,s,{width:u,margin:1,errorCorrectionLevel:l,color:{dark:o,light:a}}).catch(c=>console.error("二维码生成失败:",c));n.push(h)}}),await Promise.all(n),t}async function hP(r){const{fileName:e=`报表_${new Date().toLocaleDateString("zh-CN").replace(/\//g,"-")}`,download:t=!0,scale:A=2}=r,{pageWidth:n,paperWidthMm:i,paperHeightMm:s}=Gc(r),{html:a}=Cg(r),o=await fP(a,n);try{const l=i>s,u=new pt({orientation:l?"landscape":"portrait",unit:"mm",format:[Math.min(i,s),Math.max(i,s)]}),f=i,h=s,c=o.querySelectorAll(".print-page");for(let g=0;g<c.length;g++){const p=c[g],y=await xg(p,{scale:A,useCORS:!0,allowTaint:!0,backgroundColor:"#ffffff",logging:!1}),w=y.toDataURL("image/png"),B=f,x=y.height*f/y.width;g>0&&u.addPage(),u.addImage(w,"PNG",0,0,B,Math.min(x,h))}if(t)u.save(`${e}.pdf`);else return u.output("blob")}finally{document.body.removeChild(o)}}function Hx(r){const{html:e,pageWidth:t,pageHeight:A}=Cg(r);return`<!DOCTYPE html>
|
|
708
|
+
.`+mg+m6+Ux)},y6=function(r,e){var t=r.ownerDocument;if(t){var A=t.createElement("style");A.textContent=e,r.appendChild(A)}},_x=(function(){function r(){}return r.getOrigin=function(e){var t=r._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},r.isSameOrigin=function(e){return r.getOrigin(e)===r._origin},r.setContext=function(e){r._link=e.document.createElement("a"),r._origin=r.getOrigin(e.location.href)},r._origin="about:blank",r})(),B6=(function(){function r(e,t){this.context=e,this._options=t,this._cache={}}return r.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(yg(e)||E6(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},r.prototype.match=function(e){return this._cache[e]},r.prototype.loadImage=function(e){return EA(this,void 0,void 0,function(){var t,A,n,i,s=this;return wA(this,function(a){switch(a.label){case 0:return t=_x.isSameOrigin(e),A=!wg(e)&&this._options.useCORS===!0&&sA.SUPPORT_CORS_IMAGES&&!t,n=!wg(e)&&!t&&!yg(e)&&typeof this._options.proxy=="string"&&sA.SUPPORT_CORS_XHR&&!A,!t&&this._options.allowTaint===!1&&!wg(e)&&!yg(e)&&!n&&!A?[2]:(i=e,n?[4,this.proxy(i)]:[3,2]);case 1:i=a.sent(),a.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(o,l){var u=new Image;u.onload=function(){return o(u)},u.onerror=l,(F6(i)||A)&&(u.crossOrigin="anonymous"),u.src=i,u.complete===!0&&setTimeout(function(){return o(u)},500),s._options.imageTimeout>0&&setTimeout(function(){return l("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,a.sent()]}})})},r.prototype.has=function(e){return typeof this._cache[e]<"u"},r.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},r.prototype.proxy=function(e){var t=this,A=this._options.proxy;if(!A)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(i,s){var a=sA.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(o.status===200)if(a==="text")i(o.response);else{var f=new FileReader;f.addEventListener("load",function(){return i(f.result)},!1),f.addEventListener("error",function(h){return s(h)},!1),f.readAsDataURL(o.response)}else s("Failed to proxy resource "+n+" with status code "+o.status)},o.onerror=s;var l=A.indexOf("?")>-1?"&":"?";if(o.open("GET",""+A+l+"url="+encodeURIComponent(e)+"&responseType="+a),a!=="text"&&o instanceof XMLHttpRequest&&(o.responseType=a),t._options.imageTimeout){var u=t._options.imageTimeout;o.timeout=u,o.ontimeout=function(){return s("Timed out ("+u+"ms) proxying "+n)}}o.send()})},r})(),b6=/^data:image\/svg\+xml/i,x6=/^data:image\/.*;base64,/i,C6=/^data:image\/.*/i,E6=function(r){return sA.SUPPORT_SVG_DRAWING||!S6(r)},wg=function(r){return C6.test(r)},F6=function(r){return x6.test(r)},yg=function(r){return r.substr(0,4)==="blob"},S6=function(r){return r.substr(-3).toLowerCase()==="svg"||b6.test(r)},at=(function(){function r(e,t){this.type=0,this.x=e,this.y=t}return r.prototype.add=function(e,t){return new r(this.x+e,this.y+t)},r})(),Ts=function(r,e,t){return new at(r.x+(e.x-r.x)*t,r.y+(e.y-r.y)*t)},kc=(function(){function r(e,t,A,n){this.type=1,this.start=e,this.startControl=t,this.endControl=A,this.end=n}return r.prototype.subdivide=function(e,t){var A=Ts(this.start,this.startControl,e),n=Ts(this.startControl,this.endControl,e),i=Ts(this.endControl,this.end,e),s=Ts(A,n,e),a=Ts(n,i,e),o=Ts(s,a,e);return t?new r(this.start,A,s,o):new r(o,a,i,this.end)},r.prototype.add=function(e,t){return new r(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},r.prototype.reverse=function(){return new r(this.end,this.endControl,this.startControl,this.start)},r})(),un=function(r){return r.type===1},U6=(function(){function r(e){var t=e.styles,A=e.bounds,n=Po(t.borderTopLeftRadius,A.width,A.height),i=n[0],s=n[1],a=Po(t.borderTopRightRadius,A.width,A.height),o=a[0],l=a[1],u=Po(t.borderBottomRightRadius,A.width,A.height),f=u[0],h=u[1],c=Po(t.borderBottomLeftRadius,A.width,A.height),g=c[0],p=c[1],y=[];y.push((i+o)/A.width),y.push((g+f)/A.width),y.push((s+p)/A.height),y.push((l+h)/A.height);var w=Math.max.apply(Math,y);w>1&&(i/=w,s/=w,o/=w,l/=w,f/=w,h/=w,g/=w,p/=w);var B=A.width-o,x=A.height-h,E=A.width-f,Q=A.height-p,L=t.borderTopWidth,S=t.borderRightWidth,T=t.borderBottomWidth,_=t.borderLeftWidth,D=er(t.paddingTop,e.bounds.width),U=er(t.paddingRight,e.bounds.width),O=er(t.paddingBottom,e.bounds.width),M=er(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||s>0?sr(A.left+_/3,A.top+L/3,i-_/3,s-L/3,qt.TOP_LEFT):new at(A.left+_/3,A.top+L/3),this.topRightBorderDoubleOuterBox=i>0||s>0?sr(A.left+B,A.top+L/3,o-S/3,l-L/3,qt.TOP_RIGHT):new at(A.left+A.width-S/3,A.top+L/3),this.bottomRightBorderDoubleOuterBox=f>0||h>0?sr(A.left+E,A.top+x,f-S/3,h-T/3,qt.BOTTOM_RIGHT):new at(A.left+A.width-S/3,A.top+A.height-T/3),this.bottomLeftBorderDoubleOuterBox=g>0||p>0?sr(A.left+_/3,A.top+Q,g-_/3,p-T/3,qt.BOTTOM_LEFT):new at(A.left+_/3,A.top+A.height-T/3),this.topLeftBorderDoubleInnerBox=i>0||s>0?sr(A.left+_*2/3,A.top+L*2/3,i-_*2/3,s-L*2/3,qt.TOP_LEFT):new at(A.left+_*2/3,A.top+L*2/3),this.topRightBorderDoubleInnerBox=i>0||s>0?sr(A.left+B,A.top+L*2/3,o-S*2/3,l-L*2/3,qt.TOP_RIGHT):new at(A.left+A.width-S*2/3,A.top+L*2/3),this.bottomRightBorderDoubleInnerBox=f>0||h>0?sr(A.left+E,A.top+x,f-S*2/3,h-T*2/3,qt.BOTTOM_RIGHT):new at(A.left+A.width-S*2/3,A.top+A.height-T*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||p>0?sr(A.left+_*2/3,A.top+Q,g-_*2/3,p-T*2/3,qt.BOTTOM_LEFT):new at(A.left+_*2/3,A.top+A.height-T*2/3),this.topLeftBorderStroke=i>0||s>0?sr(A.left+_/2,A.top+L/2,i-_/2,s-L/2,qt.TOP_LEFT):new at(A.left+_/2,A.top+L/2),this.topRightBorderStroke=i>0||s>0?sr(A.left+B,A.top+L/2,o-S/2,l-L/2,qt.TOP_RIGHT):new at(A.left+A.width-S/2,A.top+L/2),this.bottomRightBorderStroke=f>0||h>0?sr(A.left+E,A.top+x,f-S/2,h-T/2,qt.BOTTOM_RIGHT):new at(A.left+A.width-S/2,A.top+A.height-T/2),this.bottomLeftBorderStroke=g>0||p>0?sr(A.left+_/2,A.top+Q,g-_/2,p-T/2,qt.BOTTOM_LEFT):new at(A.left+_/2,A.top+A.height-T/2),this.topLeftBorderBox=i>0||s>0?sr(A.left,A.top,i,s,qt.TOP_LEFT):new at(A.left,A.top),this.topRightBorderBox=o>0||l>0?sr(A.left+B,A.top,o,l,qt.TOP_RIGHT):new at(A.left+A.width,A.top),this.bottomRightBorderBox=f>0||h>0?sr(A.left+E,A.top+x,f,h,qt.BOTTOM_RIGHT):new at(A.left+A.width,A.top+A.height),this.bottomLeftBorderBox=g>0||p>0?sr(A.left,A.top+Q,g,p,qt.BOTTOM_LEFT):new at(A.left,A.top+A.height),this.topLeftPaddingBox=i>0||s>0?sr(A.left+_,A.top+L,Math.max(0,i-_),Math.max(0,s-L),qt.TOP_LEFT):new at(A.left+_,A.top+L),this.topRightPaddingBox=o>0||l>0?sr(A.left+Math.min(B,A.width-S),A.top+L,B>A.width+S?0:Math.max(0,o-S),Math.max(0,l-L),qt.TOP_RIGHT):new at(A.left+A.width-S,A.top+L),this.bottomRightPaddingBox=f>0||h>0?sr(A.left+Math.min(E,A.width-_),A.top+Math.min(x,A.height-T),Math.max(0,f-S),Math.max(0,h-T),qt.BOTTOM_RIGHT):new at(A.left+A.width-S,A.top+A.height-T),this.bottomLeftPaddingBox=g>0||p>0?sr(A.left+_,A.top+Math.min(Q,A.height-T),Math.max(0,g-_),Math.max(0,p-T),qt.BOTTOM_LEFT):new at(A.left+_,A.top+A.height-T),this.topLeftContentBox=i>0||s>0?sr(A.left+_+M,A.top+L+D,Math.max(0,i-(_+M)),Math.max(0,s-(L+D)),qt.TOP_LEFT):new at(A.left+_+M,A.top+L+D),this.topRightContentBox=o>0||l>0?sr(A.left+Math.min(B,A.width+_+M),A.top+L+D,B>A.width+_+M?0:o-_+M,l-(L+D),qt.TOP_RIGHT):new at(A.left+A.width-(S+U),A.top+L+D),this.bottomRightContentBox=f>0||h>0?sr(A.left+Math.min(E,A.width-(_+M)),A.top+Math.min(x,A.height+L+D),Math.max(0,f-(S+U)),h-(T+O),qt.BOTTOM_RIGHT):new at(A.left+A.width-(S+U),A.top+A.height-(T+O)),this.bottomLeftContentBox=g>0||p>0?sr(A.left+_+M,A.top+Q,Math.max(0,g-(_+M)),p-(T+O),qt.BOTTOM_LEFT):new at(A.left+_+M,A.top+A.height-(T+O))}return r})(),qt;(function(r){r[r.TOP_LEFT=0]="TOP_LEFT",r[r.TOP_RIGHT=1]="TOP_RIGHT",r[r.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",r[r.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(qt||(qt={}));var sr=function(r,e,t,A,n){var i=4*((Math.sqrt(2)-1)/3),s=t*i,a=A*i,o=r+t,l=e+A;switch(n){case qt.TOP_LEFT:return new kc(new at(r,l),new at(r,l-a),new at(o-s,e),new at(o,e));case qt.TOP_RIGHT:return new kc(new at(r,e),new at(r+s,e),new at(o,l-a),new at(o,l));case qt.BOTTOM_RIGHT:return new kc(new at(o,e),new at(o,e+a),new at(r+s,l),new at(r,l));case qt.BOTTOM_LEFT:default:return new kc(new at(o,l),new at(o-s,l),new at(r,e+a),new at(r,e))}},Hc=function(r){return[r.topLeftBorderBox,r.topRightBorderBox,r.bottomRightBorderBox,r.bottomLeftBorderBox]},_6=function(r){return[r.topLeftContentBox,r.topRightContentBox,r.bottomRightContentBox,r.bottomLeftContentBox]},jc=function(r){return[r.topLeftPaddingBox,r.topRightPaddingBox,r.bottomRightPaddingBox,r.bottomLeftPaddingBox]},I6=(function(){function r(e,t,A){this.offsetX=e,this.offsetY=t,this.matrix=A,this.type=0,this.target=6}return r})(),Kc=(function(){function r(e,t){this.path=e,this.target=t,this.type=1}return r})(),Q6=(function(){function r(e){this.opacity=e,this.type=2,this.target=6}return r})(),N6=function(r){return r.type===0},Ix=function(r){return r.type===1},O6=function(r){return r.type===2},Qx=function(r,e){return r.length===e.length?r.some(function(t,A){return t===e[A]}):!1},T6=function(r,e,t,A,n){return r.map(function(i,s){switch(s){case 0:return i.add(e,t);case 1:return i.add(e+A,t);case 2:return i.add(e+A,t+n);case 3:return i.add(e,t+n)}return i})},Nx=(function(){function r(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return r})(),Ox=(function(){function r(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new U6(this.container),this.container.styles.opacity<1&&this.effects.push(new Q6(this.container.styles.opacity)),this.container.styles.transform!==null){var A=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new I6(A,n,i))}if(this.container.styles.overflowX!==0){var s=Hc(this.curves),a=jc(this.curves);Qx(s,a)?this.effects.push(new Kc(s,6)):(this.effects.push(new Kc(s,2)),this.effects.push(new Kc(a,4)))}}return r.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,A=this.parent,n=this.effects.slice(0);A;){var i=A.effects.filter(function(o){return!Ix(o)});if(t||A.container.styles.position!==0||!A.parent){if(n.unshift.apply(n,i),t=[2,3].indexOf(A.container.styles.position)===-1,A.container.styles.overflowX!==0){var s=Hc(A.curves),a=jc(A.curves);Qx(s,a)||n.unshift(new Kc(a,6))}}else n.unshift.apply(n,i);A=A.parent}return n.filter(function(o){return qr(o.target,e)})},r})(),Bg=function(r,e,t,A){r.container.elements.forEach(function(n){var i=qr(n.flags,4),s=qr(n.flags,2),a=new Ox(n,r);qr(n.styles.display,2048)&&A.push(a);var o=qr(n.flags,8)?[]:A;if(i||s){var l=i||n.styles.isPositioned()?t:e,u=new Nx(a);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var f=n.styles.zIndex.order;if(f<0){var h=0;l.negativeZIndex.some(function(g,p){return f>g.element.container.styles.zIndex.order?(h=p,!1):h>0}),l.negativeZIndex.splice(h,0,u)}else if(f>0){var c=0;l.positiveZIndex.some(function(g,p){return f>=g.element.container.styles.zIndex.order?(c=p+1,!1):c>0}),l.positiveZIndex.splice(c,0,u)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else n.styles.isFloating()?l.nonPositionedFloats.push(u):l.nonPositionedInlineLevel.push(u);Bg(a,u,i?u:t,o)}else n.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),Bg(a,e,t,o);qr(n.flags,8)&&Tx(n,o)})},Tx=function(r,e){for(var t=r instanceof ug?r.start:1,A=r instanceof ug?r.reversed:!1,n=0;n<e.length;n++){var i=e[n];i.container instanceof ix&&typeof i.container.value=="number"&&i.container.value!==0&&(t=i.container.value),i.listValue=jo(t,i.container.styles.listStyleType,!0),t+=A?-1:1}},L6=function(r){var e=new Ox(r,null),t=new Nx(e),A=[];return Bg(e,t,t,A),Tx(e.container,A),t},Lx=function(r,e){switch(e){case 0:return cn(r.topLeftBorderBox,r.topLeftPaddingBox,r.topRightBorderBox,r.topRightPaddingBox);case 1:return cn(r.topRightBorderBox,r.topRightPaddingBox,r.bottomRightBorderBox,r.bottomRightPaddingBox);case 2:return cn(r.bottomRightBorderBox,r.bottomRightPaddingBox,r.bottomLeftBorderBox,r.bottomLeftPaddingBox);case 3:default:return cn(r.bottomLeftBorderBox,r.bottomLeftPaddingBox,r.topLeftBorderBox,r.topLeftPaddingBox)}},P6=function(r,e){switch(e){case 0:return cn(r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox,r.topRightBorderBox,r.topRightBorderDoubleOuterBox);case 1:return cn(r.topRightBorderBox,r.topRightBorderDoubleOuterBox,r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox);case 2:return cn(r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox,r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox);case 3:default:return cn(r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox,r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox)}},R6=function(r,e){switch(e){case 0:return cn(r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox,r.topRightBorderDoubleInnerBox,r.topRightPaddingBox);case 1:return cn(r.topRightBorderDoubleInnerBox,r.topRightPaddingBox,r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox);case 2:return cn(r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox,r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox);case 3:default:return cn(r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox,r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox)}},M6=function(r,e){switch(e){case 0:return qc(r.topLeftBorderStroke,r.topRightBorderStroke);case 1:return qc(r.topRightBorderStroke,r.bottomRightBorderStroke);case 2:return qc(r.bottomRightBorderStroke,r.bottomLeftBorderStroke);case 3:default:return qc(r.bottomLeftBorderStroke,r.topLeftBorderStroke)}},qc=function(r,e){var t=[];return un(r)?t.push(r.subdivide(.5,!1)):t.push(r),un(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},cn=function(r,e,t,A){var n=[];return un(r)?n.push(r.subdivide(.5,!1)):n.push(r),un(t)?n.push(t.subdivide(.5,!0)):n.push(t),un(A)?n.push(A.subdivide(.5,!0).reverse()):n.push(A),un(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},Px=function(r){var e=r.bounds,t=r.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Vc=function(r){var e=r.styles,t=r.bounds,A=er(e.paddingLeft,t.width),n=er(e.paddingRight,t.width),i=er(e.paddingTop,t.width),s=er(e.paddingBottom,t.width);return t.add(A+e.borderLeftWidth,i+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+A+n),-(e.borderTopWidth+e.borderBottomWidth+i+s))},D6=function(r,e){return r===0?e.bounds:r===2?Vc(e):Px(e)},k6=function(r,e){return r===0?e.bounds:r===2?Vc(e):Px(e)},bg=function(r,e,t){var A=D6(Ps(r.styles.backgroundOrigin,e),r),n=k6(Ps(r.styles.backgroundClip,e),r),i=H6(Ps(r.styles.backgroundSize,e),t,A),s=i[0],a=i[1],o=Po(Ps(r.styles.backgroundPosition,e),A.width-s,A.height-a),l=j6(Ps(r.styles.backgroundRepeat,e),o,i,A,n),u=Math.round(A.left+o[0]),f=Math.round(A.top+o[1]);return[l,u,f,s,a]},Ls=function(r){return Xt(r)&&r.value===Is.AUTO},zc=function(r){return typeof r=="number"},H6=function(r,e,t){var A=e[0],n=e[1],i=e[2],s=r[0],a=r[1];if(!s)return[0,0];if(Lr(s)&&a&&Lr(a))return[er(s,t.width),er(a,t.height)];var o=zc(i);if(Xt(s)&&(s.value===Is.CONTAIN||s.value===Is.COVER)){if(zc(i)){var l=t.width/t.height;return l<i!=(s.value===Is.COVER)?[t.width,t.width/i]:[t.height*i,t.height]}return[t.width,t.height]}var u=zc(A),f=zc(n),h=u||f;if(Ls(s)&&(!a||Ls(a))){if(u&&f)return[A,n];if(!o&&!h)return[t.width,t.height];if(h&&o){var c=u?A:n*i,g=f?n:A/i;return[c,g]}var p=u?A:t.width,y=f?n:t.height;return[p,y]}if(o){var w=0,B=0;return Lr(s)?w=er(s,t.width):Lr(a)&&(B=er(a,t.height)),Ls(s)?w=B*i:(!a||Ls(a))&&(B=w/i),[w,B]}var x=null,E=null;if(Lr(s)?x=er(s,t.width):a&&Lr(a)&&(E=er(a,t.height)),x!==null&&(!a||Ls(a))&&(E=u&&f?x/A*n:t.height),E!==null&&Ls(s)&&(x=u&&f?E/n*A:t.width),x!==null&&E!==null)return[x,E];throw new Error("Unable to calculate background-size for element")},Ps=function(r,e){var t=r[e];return typeof t>"u"?r[0]:t},j6=function(r,e,t,A,n){var i=e[0],s=e[1],a=t[0],o=t[1];switch(r){case 2:return[new at(Math.round(A.left),Math.round(A.top+s)),new at(Math.round(A.left+A.width),Math.round(A.top+s)),new at(Math.round(A.left+A.width),Math.round(o+A.top+s)),new at(Math.round(A.left),Math.round(o+A.top+s))];case 3:return[new at(Math.round(A.left+i),Math.round(A.top)),new at(Math.round(A.left+i+a),Math.round(A.top)),new at(Math.round(A.left+i+a),Math.round(A.height+A.top)),new at(Math.round(A.left+i),Math.round(A.height+A.top))];case 1:return[new at(Math.round(A.left+i),Math.round(A.top+s)),new at(Math.round(A.left+i+a),Math.round(A.top+s)),new at(Math.round(A.left+i+a),Math.round(A.top+s+o)),new at(Math.round(A.left+i),Math.round(A.top+s+o))];default:return[new at(Math.round(n.left),Math.round(n.top)),new at(Math.round(n.left+n.width),Math.round(n.top)),new at(Math.round(n.left+n.width),Math.round(n.height+n.top)),new at(Math.round(n.left),Math.round(n.height+n.top))]}},K6="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Rx="Hidden Text",q6=(function(){function r(e){this._data={},this._document=e}return r.prototype.parseMetrics=function(e,t){var A=this._document.createElement("div"),n=this._document.createElement("img"),i=this._document.createElement("span"),s=this._document.body;A.style.visibility="hidden",A.style.fontFamily=e,A.style.fontSize=t,A.style.margin="0",A.style.padding="0",A.style.whiteSpace="nowrap",s.appendChild(A),n.src=K6,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",i.style.fontFamily=e,i.style.fontSize=t,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(Rx)),A.appendChild(i),A.appendChild(n);var a=n.offsetTop-i.offsetTop+2;A.removeChild(i),A.appendChild(this._document.createTextNode(Rx)),A.style.lineHeight="normal",n.style.verticalAlign="super";var o=n.offsetTop-A.offsetTop+2;return s.removeChild(A),{baseline:a,middle:o}},r.prototype.getMetrics=function(e,t){var A=e+" "+t;return typeof this._data[A]>"u"&&(this._data[A]=this.parseMetrics(e,t)),this._data[A]},r})(),Mx=(function(){function r(e,t){this.context=e,this.options=t}return r})(),V6=1e4,z6=(function(r){Fn(e,r);function e(t,A){var n=r.call(this,t,A)||this;return n._activeEffects=[],n.canvas=A.canvas?A.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),A.canvas||(n.canvas.width=Math.floor(A.width*A.scale),n.canvas.height=Math.floor(A.height*A.scale),n.canvas.style.width=A.width+"px",n.canvas.style.height=A.height+"px"),n.fontMetrics=new q6(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-A.x,-A.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+A.width+"x"+A.height+") with scale "+A.scale),n}return e.prototype.applyEffects=function(t){for(var A=this;this._activeEffects.length;)this.popEffect();t.forEach(function(n){return A.applyEffect(n)})},e.prototype.applyEffect=function(t){this.ctx.save(),O6(t)&&(this.ctx.globalAlpha=t.opacity),N6(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Ix(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return EA(this,void 0,void 0,function(){var A;return wA(this,function(n){switch(n.label){case 0:return A=t.element.container.styles,A.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return EA(this,void 0,void 0,function(){return wA(this,function(A){switch(A.label){case 0:if(qr(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return A.sent(),[4,this.renderNodeContent(t)];case 2:A.sent(),A.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,A,n){var i=this;if(A===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+n);else{var s=lg(t.text);s.reduce(function(a,o){return i.ctx.fillText(o,a,t.bounds.top+n),a+i.ctx.measureText(o).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var A=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),n=$6(t.fontFamily).join(", "),i=Lo(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,A,t.fontWeight,i,n].join(" "),n,i]},e.prototype.renderTextNode=function(t,A){return EA(this,void 0,void 0,function(){var n,i,s,a,o,l,u,f,h=this;return wA(this,function(c){return n=this.createFontStyle(A),i=n[0],s=n[1],a=n[2],this.ctx.font=i,this.ctx.direction=A.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",o=this.fontMetrics.getMetrics(s,a),l=o.baseline,u=o.middle,f=A.paintOrder,t.textBounds.forEach(function(g){f.forEach(function(p){switch(p){case 0:h.ctx.fillStyle=tA(A.color),h.renderTextWithLetterSpacing(g,A.letterSpacing,l);var y=A.textShadow;y.length&&g.text.trim().length&&(y.slice(0).reverse().forEach(function(w){h.ctx.shadowColor=tA(w.color),h.ctx.shadowOffsetX=w.offsetX.number*h.options.scale,h.ctx.shadowOffsetY=w.offsetY.number*h.options.scale,h.ctx.shadowBlur=w.blur.number,h.renderTextWithLetterSpacing(g,A.letterSpacing,l)}),h.ctx.shadowColor="",h.ctx.shadowOffsetX=0,h.ctx.shadowOffsetY=0,h.ctx.shadowBlur=0),A.textDecorationLine.length&&(h.ctx.fillStyle=tA(A.textDecorationColor||A.color),A.textDecorationLine.forEach(function(w){switch(w){case 1:h.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+l),g.bounds.width,1);break;case 2:h.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:h.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+u),g.bounds.width,1);break}}));break;case 1:A.webkitTextStrokeWidth&&g.text.trim().length&&(h.ctx.strokeStyle=tA(A.webkitTextStrokeColor),h.ctx.lineWidth=A.webkitTextStrokeWidth,h.ctx.lineJoin=window.chrome?"miter":"round",h.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+l)),h.ctx.strokeStyle="",h.ctx.lineWidth=0,h.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,A,n){if(n&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var i=Vc(t),s=jc(A);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,t.intrinsicWidth,t.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return EA(this,void 0,void 0,function(){var A,n,i,s,a,o,B,B,l,u,f,h,E,c,g,Q,p,y,w,B,x,E,Q;return wA(this,function(L){switch(L.label){case 0:this.applyEffects(t.getEffects(4)),A=t.container,n=t.curves,i=A.styles,s=0,a=A.textNodes,L.label=1;case 1:return s<a.length?(o=a[s],[4,this.renderTextNode(o,i)]):[3,4];case 2:L.sent(),L.label=3;case 3:return s++,[3,1];case 4:if(!(A instanceof rx))return[3,8];L.label=5;case 5:return L.trys.push([5,7,,8]),[4,this.context.cache.match(A.src)];case 6:return B=L.sent(),this.renderReplacedElement(A,n,B),[3,8];case 7:return L.sent(),this.context.logger.error("Error loading image "+A.src),[3,8];case 8:if(A instanceof Ax&&this.renderReplacedElement(A,n,A.canvas),!(A instanceof nx))return[3,12];L.label=9;case 9:return L.trys.push([9,11,,12]),[4,this.context.cache.match(A.svg)];case 10:return B=L.sent(),this.renderReplacedElement(A,n,B),[3,12];case 11:return L.sent(),this.context.logger.error("Error loading svg "+A.svg.substring(0,255)),[3,12];case 12:return A instanceof lx&&A.tree?(l=new e(this.context,{scale:this.options.scale,backgroundColor:A.backgroundColor,x:0,y:0,width:A.width,height:A.height}),[4,l.render(A.tree)]):[3,14];case 13:u=L.sent(),A.width&&A.height&&this.ctx.drawImage(u,0,0,A.width,A.height,A.bounds.left,A.bounds.top,A.bounds.width,A.bounds.height),L.label=14;case 14:if(A instanceof cg&&(f=Math.min(A.bounds.width,A.bounds.height),A.type===Tc?A.checked&&(this.ctx.save(),this.path([new at(A.bounds.left+f*.39363,A.bounds.top+f*.79),new at(A.bounds.left+f*.16,A.bounds.top+f*.5549),new at(A.bounds.left+f*.27347,A.bounds.top+f*.44071),new at(A.bounds.left+f*.39694,A.bounds.top+f*.5649),new at(A.bounds.left+f*.72983,A.bounds.top+f*.23),new at(A.bounds.left+f*.84,A.bounds.top+f*.34085),new at(A.bounds.left+f*.39363,A.bounds.top+f*.79)]),this.ctx.fillStyle=tA(ax),this.ctx.fill(),this.ctx.restore()):A.type===Lc&&A.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(A.bounds.left+f/2,A.bounds.top+f/2,f/4,0,Math.PI*2,!0),this.ctx.fillStyle=tA(ax),this.ctx.fill(),this.ctx.restore())),G6(A)&&A.value.length){switch(h=this.createFontStyle(i),E=h[0],c=h[1],g=this.fontMetrics.getMetrics(E,c).baseline,this.ctx.font=E,this.ctx.fillStyle=tA(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=X6(A.styles.textAlign),Q=Vc(A),p=0,A.styles.textAlign){case 1:p+=Q.width/2;break;case 2:p+=Q.width;break}y=Q.add(p,0,0,-Q.height/2+1),this.ctx.save(),this.path([new at(Q.left,Q.top),new at(Q.left+Q.width,Q.top),new at(Q.left+Q.width,Q.top+Q.height),new at(Q.left,Q.top+Q.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new ko(A.value,y),i.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!qr(A.styles.display,2048))return[3,20];if(A.styles.listStyleImage===null)return[3,19];if(w=A.styles.listStyleImage,w.type!==0)return[3,18];B=void 0,x=w.url,L.label=15;case 15:return L.trys.push([15,17,,18]),[4,this.context.cache.match(x)];case 16:return B=L.sent(),this.ctx.drawImage(B,A.bounds.left-(B.width+10),A.bounds.top),[3,18];case 17:return L.sent(),this.context.logger.error("Error loading list-style-image "+x),[3,18];case 18:return[3,20];case 19:t.listValue&&A.styles.listStyleType!==-1&&(E=this.createFontStyle(i)[0],this.ctx.font=E,this.ctx.fillStyle=tA(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",Q=new ci(A.bounds.left,A.bounds.top+er(A.styles.paddingTop,A.bounds.width),A.bounds.width,Rb(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new ko(t.listValue,Q),i.letterSpacing,Rb(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),L.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return EA(this,void 0,void 0,function(){var A,n,w,i,s,w,a,o,w,l,u,w,f,h,w,c,g,w,p,y,w;return wA(this,function(B){switch(B.label){case 0:if(qr(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:B.sent(),A=0,n=t.negativeZIndex,B.label=2;case 2:return A<n.length?(w=n[A],[4,this.renderStack(w)]):[3,5];case 3:B.sent(),B.label=4;case 4:return A++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:B.sent(),i=0,s=t.nonInlineLevel,B.label=7;case 7:return i<s.length?(w=s[i],[4,this.renderNode(w)]):[3,10];case 8:B.sent(),B.label=9;case 9:return i++,[3,7];case 10:a=0,o=t.nonPositionedFloats,B.label=11;case 11:return a<o.length?(w=o[a],[4,this.renderStack(w)]):[3,14];case 12:B.sent(),B.label=13;case 13:return a++,[3,11];case 14:l=0,u=t.nonPositionedInlineLevel,B.label=15;case 15:return l<u.length?(w=u[l],[4,this.renderStack(w)]):[3,18];case 16:B.sent(),B.label=17;case 17:return l++,[3,15];case 18:f=0,h=t.inlineLevel,B.label=19;case 19:return f<h.length?(w=h[f],[4,this.renderNode(w)]):[3,22];case 20:B.sent(),B.label=21;case 21:return f++,[3,19];case 22:c=0,g=t.zeroOrAutoZIndexOrTransformedOrOpacity,B.label=23;case 23:return c<g.length?(w=g[c],[4,this.renderStack(w)]):[3,26];case 24:B.sent(),B.label=25;case 25:return c++,[3,23];case 26:p=0,y=t.positiveZIndex,B.label=27;case 27:return p<y.length?(w=y[p],[4,this.renderStack(w)]):[3,30];case 28:B.sent(),B.label=29;case 29:return p++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var A=this;t.forEach(function(n,i){var s=un(n)?n.start:n;i===0?A.ctx.moveTo(s.x,s.y):A.ctx.lineTo(s.x,s.y),un(n)&&A.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},e.prototype.renderRepeat=function(t,A,n,i){this.path(t),this.ctx.fillStyle=A,this.ctx.translate(n,i),this.ctx.fill(),this.ctx.translate(-n,-i)},e.prototype.resizeImage=function(t,A,n){var i;if(t.width===A&&t.height===n)return t;var s=(i=this.canvas.ownerDocument)!==null&&i!==void 0?i:document,a=s.createElement("canvas");a.width=Math.max(1,A),a.height=Math.max(1,n);var o=a.getContext("2d");return o.drawImage(t,0,0,t.width,t.height,0,0,A,n),a},e.prototype.renderBackgroundImage=function(t){return EA(this,void 0,void 0,function(){var A,n,i,s,a,o;return wA(this,function(l){switch(l.label){case 0:A=t.styles.backgroundImage.length-1,n=function(u){var f,h,c,D,re,ne,M,C,T,g,D,re,ne,M,C,p,y,w,B,x,E,Q,L,S,T,_,D,U,O,M,C,z,re,ne,Z,Ae,V,k,I,P,K,Y;return wA(this,function(J){switch(J.label){case 0:if(u.type!==0)return[3,5];f=void 0,h=u.url,J.label=1;case 1:return J.trys.push([1,3,,4]),[4,i.context.cache.match(h)];case 2:return f=J.sent(),[3,4];case 3:return J.sent(),i.context.logger.error("Error loading background-image "+h),[3,4];case 4:return f&&(c=bg(t,A,[f.width,f.height,f.width/f.height]),D=c[0],re=c[1],ne=c[2],M=c[3],C=c[4],T=i.ctx.createPattern(i.resizeImage(f,M,C),"repeat"),i.renderRepeat(D,T,re,ne)),[3,6];case 5:NO(u)?(g=bg(t,A,[null,null,null]),D=g[0],re=g[1],ne=g[2],M=g[3],C=g[4],p=SO(u.angle,M,C),y=p[0],w=p[1],B=p[2],x=p[3],E=p[4],Q=document.createElement("canvas"),Q.width=M,Q.height=C,L=Q.getContext("2d"),S=L.createLinearGradient(w,x,B,E),Fb(u.stops,y).forEach(function(q){return S.addColorStop(q.stop,tA(q.color))}),L.fillStyle=S,L.fillRect(0,0,M,C),M>0&&C>0&&(T=i.ctx.createPattern(Q,"repeat"),i.renderRepeat(D,T,re,ne))):OO(u)&&(_=bg(t,A,[null,null,null]),D=_[0],U=_[1],O=_[2],M=_[3],C=_[4],z=u.position.length===0?[Wd]:u.position,re=er(z[0],M),ne=er(z[z.length-1],C),Z=UO(u,re,ne,M,C),Ae=Z[0],V=Z[1],Ae>0&&V>0&&(k=i.ctx.createRadialGradient(U+re,O+ne,0,U+re,O+ne,Ae),Fb(u.stops,Ae*2).forEach(function(q){return k.addColorStop(q.stop,tA(q.color))}),i.path(D),i.ctx.fillStyle=k,Ae!==V?(I=t.bounds.left+.5*t.bounds.width,P=t.bounds.top+.5*t.bounds.height,K=V/Ae,Y=1/K,i.ctx.save(),i.ctx.translate(I,P),i.ctx.transform(1,0,0,K,0,0),i.ctx.translate(-I,-P),i.ctx.fillRect(U,Y*(O-P)+P,M,C*Y),i.ctx.restore()):i.ctx.fill())),J.label=6;case 6:return A--,[2]}})},i=this,s=0,a=t.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return s<a.length?(o=a[s],[5,n(o)]):[3,4];case 2:l.sent(),l.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,A,n){return EA(this,void 0,void 0,function(){return wA(this,function(i){return this.path(Lx(n,A)),this.ctx.fillStyle=tA(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,A,n,i){return EA(this,void 0,void 0,function(){var s,a;return wA(this,function(o){switch(o.label){case 0:return A<3?[4,this.renderSolidBorder(t,n,i)]:[3,2];case 1:return o.sent(),[2];case 2:return s=P6(i,n),this.path(s),this.ctx.fillStyle=tA(t),this.ctx.fill(),a=R6(i,n),this.path(a),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return EA(this,void 0,void 0,function(){var A,n,i,s,a,o,l,u,f=this;return wA(this,function(h){switch(h.label){case 0:return this.applyEffects(t.getEffects(2)),A=t.container.styles,n=!Yi(A.backgroundColor)||A.backgroundImage.length,i=[{style:A.borderTopStyle,color:A.borderTopColor,width:A.borderTopWidth},{style:A.borderRightStyle,color:A.borderRightColor,width:A.borderRightWidth},{style:A.borderBottomStyle,color:A.borderBottomColor,width:A.borderBottomWidth},{style:A.borderLeftStyle,color:A.borderLeftColor,width:A.borderLeftWidth}],s=W6(Ps(A.backgroundClip,0),t.curves),n||A.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),Yi(A.backgroundColor)||(this.ctx.fillStyle=tA(A.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:h.sent(),this.ctx.restore(),A.boxShadow.slice(0).reverse().forEach(function(c){f.ctx.save();var g=Hc(t.curves),p=c.inset?0:V6,y=T6(g,-p+(c.inset?1:-1)*c.spread.number,(c.inset?1:-1)*c.spread.number,c.spread.number*(c.inset?-2:2),c.spread.number*(c.inset?-2:2));c.inset?(f.path(g),f.ctx.clip(),f.mask(y)):(f.mask(g),f.ctx.clip(),f.path(y)),f.ctx.shadowOffsetX=c.offsetX.number+p,f.ctx.shadowOffsetY=c.offsetY.number,f.ctx.shadowColor=tA(c.color),f.ctx.shadowBlur=c.blur.number,f.ctx.fillStyle=c.inset?tA(c.color):"rgba(0,0,0,1)",f.ctx.fill(),f.ctx.restore()}),h.label=2;case 2:a=0,o=0,l=i,h.label=3;case 3:return o<l.length?(u=l[o],u.style!==0&&!Yi(u.color)&&u.width>0?u.style!==2?[3,5]:[4,this.renderDashedDottedBorder(u.color,u.width,a,t.curves,2)]:[3,11]):[3,13];case 4:return h.sent(),[3,11];case 5:return u.style!==3?[3,7]:[4,this.renderDashedDottedBorder(u.color,u.width,a,t.curves,3)];case 6:return h.sent(),[3,11];case 7:return u.style!==4?[3,9]:[4,this.renderDoubleBorder(u.color,u.width,a,t.curves)];case 8:return h.sent(),[3,11];case 9:return[4,this.renderSolidBorder(u.color,a,t.curves)];case 10:h.sent(),h.label=11;case 11:a++,h.label=12;case 12:return o++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,A,n,i,s){return EA(this,void 0,void 0,function(){var a,o,l,u,f,h,c,g,p,y,w,B,x,E,Q,L,Q,L;return wA(this,function(S){return this.ctx.save(),a=M6(i,n),o=Lx(i,n),s===2&&(this.path(o),this.ctx.clip()),un(o[0])?(l=o[0].start.x,u=o[0].start.y):(l=o[0].x,u=o[0].y),un(o[1])?(f=o[1].end.x,h=o[1].end.y):(f=o[1].x,h=o[1].y),n===0||n===2?c=Math.abs(l-f):c=Math.abs(u-h),this.ctx.beginPath(),s===3?this.formatPath(a):this.formatPath(o.slice(0,2)),g=A<3?A*3:A*2,p=A<3?A*2:A,s===3&&(g=A,p=A),y=!0,c<=g*2?y=!1:c<=g*2+p?(w=c/(2*g+p),g*=w,p*=w):(B=Math.floor((c+p)/(g+p)),x=(c-B*g)/(B-1),E=(c-(B+1)*g)/B,p=E<=0||Math.abs(p-x)<Math.abs(p-E)?x:E),y&&(s===3?this.ctx.setLineDash([0,g+p]):this.ctx.setLineDash([g,p])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=A):this.ctx.lineWidth=A*2+1.1,this.ctx.strokeStyle=tA(t),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(un(o[0])&&(Q=o[3],L=o[0],this.ctx.beginPath(),this.formatPath([new at(Q.end.x,Q.end.y),new at(L.start.x,L.start.y)]),this.ctx.stroke()),un(o[1])&&(Q=o[1],L=o[2],this.ctx.beginPath(),this.formatPath([new at(Q.end.x,Q.end.y),new at(L.start.x,L.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return EA(this,void 0,void 0,function(){var A;return wA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=tA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),A=L6(t),[4,this.renderStack(A)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},e})(Mx),G6=function(r){return r instanceof ox||r instanceof sx?!0:r instanceof cg&&r.type!==Lc&&r.type!==Tc},W6=function(r,e){switch(r){case 0:return Hc(e);case 2:return _6(e);case 1:default:return jc(e)}},X6=function(r){switch(r){case 1:return"center";case 2:return"right";case 0:default:return"left"}},Y6=["-apple-system","system-ui"],$6=function(r){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?r.filter(function(e){return Y6.indexOf(e)===-1}):r},J6=(function(r){Fn(e,r);function e(t,A){var n=r.call(this,t,A)||this;return n.canvas=A.canvas?A.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=A,n.canvas.width=Math.floor(A.width*A.scale),n.canvas.height=Math.floor(A.height*A.scale),n.canvas.style.width=A.width+"px",n.canvas.style.height=A.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-A.x,-A.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale),n}return e.prototype.render=function(t){return EA(this,void 0,void 0,function(){var A,n;return wA(this,function(i){switch(i.label){case 0:return A=og(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,Z6(A)];case 1:return n=i.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=tA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e})(Mx),Z6=function(r){return new Promise(function(e,t){var A=new Image;A.onload=function(){e(A)},A.onerror=t,A.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(r))})},eP=(function(){function r(e){var t=e.id,A=e.enabled;this.id=t,this.enabled=A,this.start=Date.now()}return r.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,ec([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},r.prototype.getTime=function(){return Date.now()-this.start},r.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,ec([this.id,this.getTime()+"ms"],e))},r.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,ec([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},r.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,ec([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},r.instances={},r})(),tP=(function(){function r(e,t){var A;this.windowBounds=t,this.instanceName="#"+r.instanceCount++,this.logger=new eP({id:this.instanceName,enabled:e.logging}),this.cache=(A=e.cache)!==null&&A!==void 0?A:new B6(this,e)}return r.instanceCount=1,r})(),xg=function(r,e){return e===void 0&&(e={}),rP(r,e)};typeof window<"u"&&_x.setContext(window);var rP=function(r,e){return EA(void 0,void 0,void 0,function(){var t,A,n,i,s,a,o,l,u,f,h,c,g,p,y,w,B,x,E,Q,S,L,S,T,_,D,U,O,M,C,z,re,ne,Z,Ae,V,k,I,P,K;return wA(this,function(Y){switch(Y.label){case 0:if(!r||typeof r!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=r.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(A=t.defaultView,!A)throw new Error("Document is not attached to a Window");return n={allowTaint:(T=e.allowTaint)!==null&&T!==void 0?T:!1,imageTimeout:(_=e.imageTimeout)!==null&&_!==void 0?_:15e3,proxy:e.proxy,useCORS:(D=e.useCORS)!==null&&D!==void 0?D:!1},i=Sd({logging:(U=e.logging)!==null&&U!==void 0?U:!0,cache:e.cache},n),s={windowWidth:(O=e.windowWidth)!==null&&O!==void 0?O:A.innerWidth,windowHeight:(M=e.windowHeight)!==null&&M!==void 0?M:A.innerHeight,scrollX:(C=e.scrollX)!==null&&C!==void 0?C:A.pageXOffset,scrollY:(z=e.scrollY)!==null&&z!==void 0?z:A.pageYOffset},a=new ci(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),o=new tP(i,a),l=(re=e.foreignObjectRendering)!==null&&re!==void 0?re:!1,u={allowTaint:(ne=e.allowTaint)!==null&&ne!==void 0?ne:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:l,copyStyles:l},o.logger.debug("Starting document clone with size "+a.width+"x"+a.height+" scrolled to "+-a.left+","+-a.top),f=new Sx(o,r,u),h=f.clonedReferenceElement,h?[4,f.toIFrame(t,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return c=Y.sent(),g=hg(h)||n6(h)?TQ(h.ownerDocument):tc(o,h),p=g.width,y=g.height,w=g.left,B=g.top,x=AP(o,h,e.backgroundColor),E={canvas:e.canvas,backgroundColor:x,scale:(Ae=(Z=e.scale)!==null&&Z!==void 0?Z:A.devicePixelRatio)!==null&&Ae!==void 0?Ae:1,x:((V=e.x)!==null&&V!==void 0?V:0)+w,y:((k=e.y)!==null&&k!==void 0?k:0)+B,width:(I=e.width)!==null&&I!==void 0?I:Math.ceil(p),height:(P=e.height)!==null&&P!==void 0?P:Math.ceil(y)},l?(o.logger.debug("Document cloned, using foreign object rendering"),S=new J6(o,E),[4,S.render(h)]):[3,3];case 2:return Q=Y.sent(),[3,5];case 3:return o.logger.debug("Document cloned, element located at "+w+","+B+" with size "+p+"x"+y+" using computed rendering"),o.logger.debug("Starting DOM parsing"),L=cx(o,h),x===L.styles.backgroundColor&&(L.styles.backgroundColor=hi.TRANSPARENT),o.logger.debug("Starting renderer for element at "+E.x+","+E.y+" with size "+E.width+"x"+E.height),S=new z6(o,E),[4,S.render(L)];case 4:Q=Y.sent(),Y.label=5;case 5:return(!((K=e.removeContainer)!==null&&K!==void 0)||K)&&(Sx.destroy(c)||o.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),o.logger.debug("Finished rendering"),[2,Q]}})})},AP=function(r,e,t){var A=e.ownerDocument,n=A.documentElement?Ro(r,getComputedStyle(A.documentElement).backgroundColor):hi.TRANSPARENT,i=A.body?Ro(r,getComputedStyle(A.body).backgroundColor):hi.TRANSPARENT,s=typeof t=="string"?Ro(r,t):t===null?hi.TRANSPARENT:4294967295;return e===A.documentElement?Yi(n)?Yi(i)?s:i:n:s};const nP=Object.freeze(Object.defineProperty({__proto__:null,default:xg},Symbol.toStringTag,{value:"Module"})),Dx=({bands:r,data:e,dataFields:t,onClose:A,pageWidth:n=794,pageHeight:i=1123,showPageNumbers:s=!0,pageMargins:a={top:40,bottom:40,left:40,right:40},paperWidthMm:o=210,paperHeightMm:l=297})=>{const[u,f]=ce.useState(1),[h,c]=ce.useState(1),[g,p]=ce.useState(!0),[y,w]=ce.useState(!1),B=ce.useRef([]),x=ce.useRef(null),E=Zf(t)||"products",{headerBand:Q,detailBand:L,summaryBand:S,footerBand:T}=ce.useMemo(()=>({headerBand:r.find(q=>q.id==="header"),detailBand:r.find(q=>q.id==="detail"),summaryBand:r.find(q=>q.id==="summary"),footerBand:r.find(q=>q.id==="footer")}),[r]),{rowsPerPage:_,totalPages:D,singleRowHeight:U,minTopOffset:O,hasFooterOnlyPage:M,footerSplitY:C}=ce.useMemo(()=>{var Ye;if(!L||!(e!=null&&e[E]))return{rowsPerPage:0,totalPages:1,singleRowHeight:0,minTopOffset:0,hasFooterOnlyPage:!1,footerSplitY:0};const q=L.actualBottom-L.top,W=((Ye=L.objects)==null?void 0:Ye.filter(xe=>xe.y>=L.top&&xe.y<L.actualBottom))||[],te=W.length>0?Math.min(...W.map(xe=>xe.y-L.top)):0,oe=q-te,we=i-a.top-a.bottom;let le=0;Q&&(le+=Q.actualBottom-Q.top);const Be=(S==null?void 0:S.summaryDisplayMode)||"atEnd";S&&Be==="perPage"&&(le+=S.actualBottom-S.top);const ye=we-le,R=Math.max(1,Math.floor(ye/oe)),Ue=e[E].length;let Te=Math.max(1,Math.ceil(Ue/R)),Ee=!1,Ve=0;const Me=S&&Be==="atEnd"?S.actualBottom-S.top:0,ze=T?T.actualBottom-T.top:0;if(ze>0&&Ue>0){const xe=(Te-1)*R,je=(Ue-xe)*oe;let ge=we-le-je-Me;if(ge<ze)if(ge>0&&T){const Le=[...T.objects||[]].map(ue=>{let fe,Pe;if(ue.type==="line"){const Fe=ue,Ne=Fe.y1??ue.y,ve=Fe.y2??ue.y;fe=Math.min(Ne,ve)-T.top,Pe=Math.max(Ne,ve)-T.top}else fe=ue.y-T.top,Pe=fe+ue.height;return{obj:ue,objTop:fe,objBottom:Pe}}).sort((ue,fe)=>ue.objBottom-fe.objBottom);Ve=0;for(const{objBottom:ue}of Le)if(ue<=ge)Ve=ue;else break;Ve>0?(Ee=!0,Te=Te+1):(Ee=!0,Te=Te+1,Ve=0)}else Ee=!0,Te=Te+1,Ve=0}return{rowsPerPage:R,totalPages:Te,singleRowHeight:oe,minTopOffset:te,hasFooterOnlyPage:Ee,footerSplitY:Ve}},[L,e,i,a,Q,S,T,E]),z=ce.useMemo(()=>{const q=e==null?void 0:e[E];if(!L||!q)return[];const W=[],te=M?D-1:D;for(let oe=1;oe<=te;oe++){const we=(oe-1)*_,le=Math.min(we+_,q.length);W.push({pageNumber:oe,items:q.slice(we,le),startIndex:we,totalItems:q.length,isFooterOnlyPage:!1})}return M&&W.push({pageNumber:D,items:[],startIndex:q.length,totalItems:q.length,isFooterOnlyPage:!0}),W},[L,e,_,D,E,M]),re=ce.useMemo(()=>{const q=[];return r.forEach(W=>{W.objects.forEach(te=>{te.type==="image"&&te.floating===!0&&q.push({obj:te,bandId:W.id})})}),q},[r]),ne=ce.useCallback(q=>{const W=B.current[q-1];W&&x.current&&W.scrollIntoView({behavior:"auto",block:"start"}),f(q)},[]),Z=ce.useCallback(async()=>{if(y)return;w(!0);const q=g;p(!1),await new Promise(W=>setTimeout(W,100));try{const W=o>l,te=new pt({orientation:W?"landscape":"portrait",unit:"mm",format:[Math.min(o,l),Math.max(o,l)]}),oe=o,we=l;for(let Be=0;Be<D;Be++){const ye=B.current[Be];if(!ye)continue;const R=await xg(ye,{scale:2,useCORS:!0,allowTaint:!0,backgroundColor:"#ffffff",logging:!1}),Ie=R.toDataURL("image/png"),Ue=oe,Te=R.height*oe/R.width;Be>0&&te.addPage(),te.addImage(Ie,"PNG",0,0,Ue,Math.min(Te,we))}const le=`报表_${new Date().toLocaleDateString("zh-CN").replace(/\//g,"-")}.pdf`;te.save(le),console.log("PDF 导出成功:",le)}catch(W){console.error("PDF 导出失败:",W),alert("PDF 导出失败,请重试")}finally{p(q),w(!1)}},[y,D,g,o,l]),Ae=ce.useCallback((q,W)=>{if(q.backgroundColorFormula&&(q.id==="detail"||q.id==="summary")){const te=ho(q.backgroundColorFormula,{data:(W==null?void 0:W.data)||e,currentPage:(W==null?void 0:W.currentPage)||1,totalPages:(W==null?void 0:W.totalPages)||D,rowIndex:(W==null?void 0:W.rowIndex)??0},{});if(console.log("[BgColor] rowIndex:",W==null?void 0:W.rowIndex,"formula:",q.backgroundColorFormula,"result:",te),te&&!te.includes("错误")&&!te.includes("公式"))return te.replace(/^["']|["']$/g,"")}return q.backgroundColor},[e,D]),V=ce.useCallback((q,W,te)=>{if(q.rowHeightFormula&&(q.id==="detail"||q.id==="summary")){const oe=ho(q.rowHeightFormula,{data:(te==null?void 0:te.data)||e,currentPage:(te==null?void 0:te.currentPage)||1,totalPages:(te==null?void 0:te.totalPages)||D,rowIndex:W},{}),we=parseFloat(oe);if(!isNaN(we)&&we>0)return we}return U},[e,D,U]),k=ce.useCallback((q,W,te,oe,we)=>{const le=Ae(q,{rowIndex:te+W,data:e,currentPage:oe,totalPages:D}),Be=V(q,te+W,{data:e,currentPage:oe,totalPages:D});return v.jsx("div",{className:"detail-row",style:{position:"absolute",top:`${W*Be}px`,left:"0px",width:"100%",height:`${Be}px`,boxSizing:"border-box",overflow:"hidden",backgroundColor:le},children:q.objects.filter(ye=>ye.printVisible!==!1&&!(ye.floating===!0&&ye.type==="image")).map(ye=>{if(ye.type==="line"){const xe=ye,Oe=xe.x1??ye.x,je=(xe.y1??ye.y)-q.top-O,ge=xe.x2??ye.x+ye.width,Re=(xe.y2??ye.y)-q.top-O,Le=xe.color||"#000000",ue=xe.strokeWidth||1,fe=xe.lineStyle||"solid",Pe=ge-Oe,Fe=Re-je,Ne=Math.sqrt(Pe*Pe+Fe*Fe),ve=Math.atan2(Fe,Pe)*(180/Math.PI),Qe=()=>fe==="dashed"?"dashed":fe==="dotted"?"dotted":"solid";return v.jsx("div",{style:{position:"absolute",left:Oe,top:je,width:Ne,height:0,borderTop:`${ue}px ${Qe()} ${Le}`,transformOrigin:"0 0",transform:`rotate(${ve}deg)`,zIndex:(ye.zIndex??1)+100}},`${ye.id}-${W}`)}const R=Qu(ye,{data:e,currentPage:oe,totalPages:D,startIndex:te,rowIndex:W,pageSize:we}),Ie=Hh(ye,{isPreview:!0}),Ue=["text","multiline_text","field","page_number","current_date"].includes(ye.type),Me=(xe=>{if(!xe||xe==="none")return 0;const Oe=xe.match(/(\d+)px/);return Oe?parseInt(Oe[1]):0})(Ie.border)+2,ze=ye.y-q.top-O,Ye={position:"absolute",left:ye.x,top:ze,width:ye.width+Me*2,height:ye.height+Me*2,zIndex:(ye.zIndex??1)+100,...Ie,boxSizing:"border-box"};return v.jsx("div",{style:jh(ye,Ye,Ue),title:`${ye.fieldName}: ${R}`,children:ye.type==="image"?ye.src||ye.imageUrl?ye.objectFit==="repeat"?v.jsx("div",{style:{width:"100%",height:"100%",backgroundImage:`url(${ye.src||ye.imageUrl})`,backgroundRepeat:"repeat",backgroundSize:"auto"}}):v.jsx("img",{src:ye.src||ye.imageUrl,alt:ye.alt||"图片",style:{width:"100%",height:"100%",objectFit:ye.objectFit||"contain"}}):v.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"[图片]"}):ye.type==="barcode"?v.jsx(Mh,{value:R,type:ye.barcodeType||"CODE128",width:ye.width,height:ye.height,showText:ye.showText!==!1,background:ye.background||"#FFFFFF",lineColor:ye.lineColor||"#000000"}):ye.type==="qrcode"?v.jsx(Dh,{value:R,width:ye.width,height:ye.height,errorLevel:ye.errorLevel||"M",background:ye.background||"#FFFFFF",foreground:ye.foreground||"#000000"}):Cw(R,ye,Ie)},`${ye.id}-${W}`)})},`detail-row-${W}`)},[O,D,e,Ae,V]),I=ce.useCallback((q,W,te,oe,we)=>{const le=q.actualBottom-q.top;if(W.type==="line"){const R=W,Ie=(R.y1??W.y)-q.top,Ue=(R.y2??W.y)-q.top,Te=R.x1??W.x,Ee=R.x2??W.x+W.width,Ve=R.color||"#000000",Me=R.strokeWidth||1,ze=R.lineStyle||"solid";let Ye=Te,xe=Ie,Oe=Ee,je=Ue;const ge=Math.min(Ie,Ue);if(Math.max(Ie,Ue)<=0||ge>=le)return null;if(Ie!==Ue){const Ne=Ee-Te,ve=Ue-Ie;Ie<0?(Ye=Te+Ne*(0-Ie)/ve,xe=0):Ie>le&&(Ye=Te+Ne*(le-Ie)/ve,xe=le),Ue<0?(Oe=Ee+Ne*(0-Ue)/ve,je=0):Ue>le&&(Oe=Ee+Ne*(le-Ue)/ve,je=le)}else if(Ie<0||Ie>le)return null;const Le=Oe-Ye,ue=je-xe,fe=Math.sqrt(Le*Le+ue*ue),Pe=Math.atan2(ue,Le)*(180/Math.PI),Fe=()=>ze==="dashed"?"dashed":ze==="dotted"?"dotted":"solid";return v.jsx("div",{style:{position:"absolute",left:Ye,top:xe,width:fe,height:0,borderTop:`${Me}px ${Fe()} ${Ve}`,transformOrigin:"0 0",transform:`rotate(${Pe}deg)`,zIndex:(W.zIndex??1)+100}},`${q.id}-${W.id}-${te}`)}const Be=Nu(W,q,{isSelected:!1,isPreview:!0,data:e,currentPage:oe,totalPages:D,includeClipPath:!0,pageSize:we}),ye=["text","multiline_text","field","page_number","current_date"].includes(W.type);return v.jsx("div",{style:jh(W,Be.style,ye),children:W.type==="image"?W.src||W.imageUrl?W.objectFit==="repeat"?v.jsx("div",{style:{width:"100%",height:"100%",backgroundImage:`url(${W.src||W.imageUrl})`,backgroundRepeat:"repeat",backgroundSize:"auto"}}):v.jsx("img",{src:W.src||W.imageUrl,alt:W.alt||"图片",style:{width:"100%",height:"100%",objectFit:W.objectFit||"contain"}}):v.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"[图片]"}):W.type==="barcode"?v.jsx(Mh,{value:Be.content,type:W.barcodeType||"CODE128",width:W.width,height:W.height,showText:W.showText!==!1,background:W.background||"#FFFFFF",lineColor:W.lineColor||"#000000"}):W.type==="qrcode"?v.jsx(Dh,{value:Be.content,width:W.width,height:W.height,errorLevel:W.errorLevel||"M",background:W.background||"#FFFFFF",foreground:W.foreground||"#000000"}):Be.wrappedContent||Be.content},`${q.id}-${W.id}-${te}`)},[e,D]),P=ce.useCallback((q,W)=>{var ye;const te=[];let oe=a.top;const we=q===D,le=(S==null?void 0:S.summaryDisplayMode)||"atEnd";if((W==null?void 0:W.isFooterOnlyPage)===!0){if(T){const R=T.actualBottom-T.top,Ie=C>0?R-C:R;te.push({band:T,top:oe,height:Ie,isDetail:!1,pageData:W,footerPart:"after",footerSplitY:C})}return te}if(Q){const R=Q.actualBottom-Q.top;te.push({band:Q,top:oe,height:R,isDetail:!1,pageData:W}),oe+=R}if(L){const R=U*(((ye=W.items)==null?void 0:ye.length)||0);te.push({band:L,top:oe,height:R,isDetail:!0,pageData:W}),oe+=R}if(S){let R=!1;switch(le){case"perPage":R=!0;break;case"perGroup":R=M?q===D-1:we;break;case"atEnd":default:R=M?q===D-1:we;break}if(R){const Ie=S.actualBottom-S.top;te.push({band:S,top:oe,height:Ie,isDetail:!1,pageData:W}),oe+=Ie}}if(T){const R=T.actualBottom-T.top;M&&C>0&&q===D-1?te.push({band:T,top:oe,height:C,isDetail:!1,pageData:W,footerPart:"before",footerSplitY:C}):we&&!M&&te.push({band:T,top:oe,height:R,isDetail:!1,pageData:W})}return te},[Q,L,S,T,a,D,U,M,C]),K=ce.useCallback((q,W)=>{var Te,Ee;const{band:te,top:oe,height:we,isDetail:le,pageData:Be,footerPart:ye,footerSplitY:R}=q,Ie=((Te=Be==null?void 0:Be.items)==null?void 0:Te.length)||0,Ue=Ae(te,{data:e,currentPage:W,totalPages:D});if(le)return v.jsx("div",{className:`preview-band preview-band-${te.id}`,style:{position:"absolute",top:`${oe}px`,left:`${a.left}px`,right:`${a.right}px`,height:`${we}px`,backgroundColor:Ue,overflow:"hidden",clipPath:"inset(0)"},children:(Ee=Be==null?void 0:Be.items)==null?void 0:Ee.map((Ve,Me)=>k(te,Me,Be.startIndex,W,Ie))},`${te.id}-page${W}`);{const Ve=ye==="before"||ye==="after",Me=R||0;return v.jsx("div",{className:`preview-band preview-band-${te.id}`,style:{position:"absolute",top:`${oe}px`,left:`${a.left}px`,right:`${a.right}px`,height:`${we}px`,backgroundColor:Ue,overflow:"hidden",clipPath:"inset(0)"},children:te.objects.filter(ze=>{if(ze.printVisible===!1||ze.floating===!0&&ze.type==="image")return!1;let Ye,xe;if(ze.type==="line"){const je=ze;Ye=Math.min(je.y1??ze.y,je.y2??ze.y)-te.top,xe=Math.max(je.y1??ze.y,je.y2??ze.y)-te.top}else Ye=ze.y-te.top,xe=Ye+ze.height;if(Ve&&Me>0){if(ye==="before")return xe<=Me;if(ye==="after")return xe>Me}const Oe=te.actualBottom-te.top;return!(xe<=0||Ye>=Oe)}).map((ze,Ye)=>{if(ye==="after"&&Me>0){const xe={...ze};if(ze.type==="line"){const Oe=xe;Oe.y1!==void 0&&(Oe.y1=Oe.y1-Me),Oe.y2!==void 0&&(Oe.y2=Oe.y2-Me),xe.y=xe.y-Me}else xe.y=xe.y-Me;return I(te,xe,Ye,W,Ie)}return I(te,ze,Ye,W,Ie)})},`${te.id}-page${W}${ye?`-${ye}`:""}`)}},[a,k,I,Ae,e,D]),Y=ce.useCallback(q=>{const W=z[q-1],te=P(q,W);return v.jsxs("div",{ref:oe=>{B.current[q-1]=oe},className:"preview-page",style:{width:`${n}px`,height:`${i}px`,backgroundColor:"white",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",position:"relative",marginBottom:"20px"},children:[g&&v.jsxs("div",{className:"page-margins",children:[v.jsx("div",{className:"margin-top",style:{position:"absolute",top:0,left:0,right:0,height:`${a.top}px`,borderBottom:"1px dashed #ddd"}}),v.jsx("div",{className:"margin-bottom",style:{position:"absolute",bottom:0,left:0,right:0,height:`${a.bottom}px`,borderTop:"1px dashed #ddd"}}),v.jsx("div",{className:"margin-left",style:{position:"absolute",top:0,bottom:0,left:0,width:`${a.left}px`,borderRight:"1px dashed #ddd"}}),v.jsx("div",{className:"margin-right",style:{position:"absolute",top:0,bottom:0,right:0,width:`${a.right}px`,borderLeft:"1px dashed #ddd"}})]}),re.map(({obj:oe},we)=>{const le=oe;if(le.printVisible===!1)return null;const Be={position:"absolute",left:le.x+a.left,top:le.y+a.top,width:le.width,height:le.height,zIndex:1,overflow:"hidden"};return v.jsx("div",{style:Be,children:le.src||le.imageUrl?le.objectFit==="repeat"?v.jsx("div",{style:{width:"100%",height:"100%",backgroundImage:`url(${le.src||le.imageUrl})`,backgroundRepeat:"repeat",backgroundSize:"auto"}}):v.jsx("img",{src:le.src||le.imageUrl,alt:le.alt||"图片",style:{width:"100%",height:"100%",objectFit:le.objectFit||"contain"}}):v.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"[图片]"})},`floating-${oe.id}-${q}-${we}`)}),te.map(oe=>K(oe,q)),s&&v.jsxs("div",{className:"page-number",style:{position:"absolute",bottom:`${a.bottom/2}px`,right:`${a.right}px`,fontSize:"12px",color:"#666"},children:[q," / ",D]})]},`page-${q}`)},[z,P,n,i,g,a,s,D,K,re]),J=ce.useCallback(()=>v.jsx("div",{className:"all-pages-container",style:{display:"flex",flexDirection:"column",alignItems:"center",transform:`scale(${h})`,transformOrigin:"top center"},children:Array.from({length:D},(q,W)=>Y(W+1))}),[D,h,Y]);return v.jsxs("div",{className:"print-preview-modal",children:[v.jsx("div",{className:"preview-overlay",onClick:A}),v.jsxs("div",{className:"preview-container",style:{minWidth:`${n+100}px`},children:[v.jsxs("div",{className:"preview-toolbar",children:[v.jsxs("div",{className:"toolbar-left",children:[v.jsx("button",{className:"btn",onClick:A,title:"关闭",children:"✕"}),v.jsx("button",{className:"btn btn-primary",onClick:()=>window.print(),title:"打印",children:"🖨️"}),v.jsx("button",{className:"btn btn-primary",onClick:Z,disabled:y,title:"导出 PDF",children:y?"⏳ 导出中...":"📄 导出 PDF"}),v.jsx("button",{className:"btn",onClick:()=>p(!g),title:g?"隐藏边距":"显示边距",children:g?"👁🗨":"👁"})]}),v.jsxs("div",{className:"toolbar-center",children:[v.jsx("span",{children:"🔍"}),v.jsxs("select",{value:h,onChange:q=>c(parseFloat(q.target.value)),className:"zoom-select",children:[v.jsx("option",{value:"0.5",children:"50%"}),v.jsx("option",{value:"0.75",children:"75%"}),v.jsx("option",{value:"1",children:"100%"}),v.jsx("option",{value:"1.25",children:"125%"}),v.jsx("option",{value:"1.5",children:"150%"})]}),v.jsxs("div",{className:"page-controls",children:[v.jsx("button",{className:"btn btn-small btn-primary",onClick:()=>ne(Math.max(1,u-1)),disabled:u===1,title:"上一页",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor",children:v.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),v.jsxs("span",{className:"page-info",children:["第",v.jsx("input",{type:"number",min:"1",max:D,value:u,onChange:q=>{const W=parseInt(q.target.value);!isNaN(W)&&W>=1&&W<=D&&ne(W)},className:"page-input"}),"页 / 共 ",D," 页"]}),v.jsx("button",{className:"btn btn-small btn-primary",onClick:()=>ne(Math.min(D,u+1)),disabled:u===D,title:"下一页",children:v.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor",children:v.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})})})]})]})]}),v.jsx("div",{className:"preview-content",ref:x,children:J()})]})]})},kx=({pageSettings:r,onSettingsChange:e,onClose:t})=>{const[A,n]=ce.useState({...r}),[i,s]=ce.useState("custom");ce.useEffect(()=>{const{margins:w}=A;for(const[B,x]of Object.entries(Pl))if(B!=="custom"&&w.top===x.top&&w.bottom===x.bottom&&w.left===x.left&&w.right===x.right){s(B);return}s("custom")},[A]);const a=w=>{if(w==="Custom")n(B=>({...B,paperSize:"Custom"}));else{const B=Ll[w];B&&n(x=>({...x,paperSize:w,width:B.width,height:B.height,unit:B.unit}))}},o=w=>{if(s(w),w!=="custom"){const B=Pl[w];n(x=>({...x,margins:{top:B.top,bottom:B.bottom,left:B.left,right:B.right}}))}},l=(w,B)=>{n(x=>({...x,margins:{...x.margins,[w]:B}}))},u=w=>{n(B=>({...B,orientation:w}))},f=(w,B)=>{n(x=>({...x,paperSize:"Custom",[w]:B}))},h=()=>{e(A),t()},c=()=>{t()},g=()=>{const{width:w,height:B,orientation:x}=A;return x==="landscape"?{displayWidth:B,displayHeight:w}:{displayWidth:w,displayHeight:B}},{displayWidth:p,displayHeight:y}=g();return v.jsx("div",{className:"page-settings-overlay",children:v.jsxs("div",{className:"page-settings-panel",children:[v.jsxs("div",{className:"page-settings-header",children:[v.jsx("h3",{children:"页面设置"}),v.jsx("button",{className:"close-btn",onClick:c,children:"×"})]}),v.jsxs("div",{className:"page-settings-content",children:[v.jsxs("div",{className:"settings-section",children:[v.jsx("label",{className:"section-label",children:"纸张大小"}),v.jsxs("select",{value:A.paperSize,onChange:w=>a(w.target.value),className:"settings-select",children:[Object.entries(Ll).map(([w,B])=>v.jsx("option",{value:w,children:B.name},w)),v.jsx("option",{value:"Custom",children:"自定义"})]})]}),v.jsxs("div",{className:"settings-section dimensions-section",children:[v.jsxs("div",{className:"dimension-row",children:[v.jsx("label",{children:"宽度"}),v.jsx("input",{type:"number",value:A.width,onChange:w=>f("width",parseFloat(w.target.value)||0),disabled:A.paperSize!=="Custom",step:"0.1"}),v.jsx("span",{className:"unit",children:A.unit})]}),v.jsxs("div",{className:"dimension-row",children:[v.jsx("label",{children:"高度"}),v.jsx("input",{type:"number",value:A.height,onChange:w=>f("height",parseFloat(w.target.value)||0),disabled:A.paperSize!=="Custom",step:"0.1"}),v.jsx("span",{className:"unit",children:A.unit})]})]}),v.jsxs("div",{className:"settings-section",children:[v.jsx("label",{className:"section-label",children:"纸张方向"}),v.jsx("div",{className:"orientation-options",children:$v.map(w=>v.jsxs("label",{className:"orientation-option",children:[v.jsx("input",{type:"radio",name:"orientation",value:w.value,checked:A.orientation===w.value,onChange:()=>u(w.value)}),v.jsx("span",{className:`orientation-icon ${w.value}`,children:v.jsx("svg",{viewBox:"0 0 24 32",width:"24",height:"32",children:w.value==="portrait"?v.jsx("rect",{x:"2",y:"2",width:"20",height:"28",fill:"none",stroke:"currentColor",strokeWidth:"2",rx:"2"}):v.jsx("rect",{x:"2",y:"6",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"2",rx:"2"})})}),v.jsx("span",{children:w.label})]},w.value))})]}),v.jsxs("div",{className:"settings-section",children:[v.jsx("label",{className:"section-label",children:"页边距"}),v.jsx("select",{value:i,onChange:w=>o(w.target.value),className:"settings-select",children:Object.entries(Pl).map(([w,B])=>v.jsx("option",{value:w,children:B.name},w))})]}),v.jsx("div",{className:"settings-section margins-section",children:v.jsxs("div",{className:"margins-grid",children:[v.jsxs("div",{className:"margin-input",children:[v.jsx("label",{children:"上"}),v.jsx("input",{type:"number",value:A.margins.top,onChange:w=>l("top",parseFloat(w.target.value)||0),min:"0",step:"1"}),v.jsx("span",{className:"unit",children:"mm"})]}),v.jsxs("div",{className:"margin-input",children:[v.jsx("label",{children:"下"}),v.jsx("input",{type:"number",value:A.margins.bottom,onChange:w=>l("bottom",parseFloat(w.target.value)||0),min:"0",step:"1"}),v.jsx("span",{className:"unit",children:"mm"})]}),v.jsxs("div",{className:"margin-input",children:[v.jsx("label",{children:"左"}),v.jsx("input",{type:"number",value:A.margins.left,onChange:w=>l("left",parseFloat(w.target.value)||0),min:"0",step:"1"}),v.jsx("span",{className:"unit",children:"mm"})]}),v.jsxs("div",{className:"margin-input",children:[v.jsx("label",{children:"右"}),v.jsx("input",{type:"number",value:A.margins.right,onChange:w=>l("right",parseFloat(w.target.value)||0),min:"0",step:"1"}),v.jsx("span",{className:"unit",children:"mm"})]})]})}),v.jsxs("div",{className:"settings-section preview-section",children:[v.jsx("label",{className:"section-label",children:"预览"}),v.jsxs("div",{className:"page-preview-container",children:[v.jsx("div",{className:"page-preview",style:{aspectRatio:`${p} / ${y}`},children:v.jsx("div",{className:"page-preview-content",style:{top:`${A.margins.top/y*100}%`,bottom:`${A.margins.bottom/y*100}%`,left:`${A.margins.left/p*100}%`,right:`${A.margins.right/p*100}%`}})}),v.jsxs("div",{className:"page-preview-info",children:[p.toFixed(1)," × ",y.toFixed(1)," ",A.unit]})]})]})]}),v.jsxs("div",{className:"page-settings-footer",children:[v.jsx("button",{className:"btn btn-cancel",onClick:c,children:"取消"}),v.jsx("button",{className:"btn btn-apply",onClick:h,children:"应用"})]})]})})},iP=({options:r={},initialDesign:e,onDesignChange:t,onSave:A,data:n,dataFields:i,initialPageSettings:s,onPageSettingsChange:a})=>{const{bands:o,setBands:l,state:u,updateState:f,designerOptions:h,selectBand:c,updateObjectPosition:g,deleteSelectedObject:p,handleSave:y,updateBands:w,PAGE_WIDTH:B,PAGE_HEIGHT:x,PAGE_MARGINS:E,pageSettings:Q,setPageSettings:L,undo:S,redo:T,canUndo:_,canRedo:D}=Zv({options:r,initialDesign:e,onDesignChange:t,initialPageSettings:s,onPageSettingsChange:a}),U=ce.useRef(null),[O,M]=ce.useState(!1),[C,z]=ce.useState(!1),[re,ne]=ce.useState([]),[Z,Ae]=ce.useState(null),[V,k]=ce.useState(null),[I,P]=ce.useState(!1),[K,Y]=ce.useState(null),J=ce.useCallback(()=>{M(!1)},[]),q=ce.useCallback((ue,fe,Pe)=>{k({x:ue,y:fe})},[]);ce.useEffect(()=>{const ue=fe=>{if((fe.ctrlKey||fe.metaKey)&&fe.key==="z"&&!fe.shiftKey&&(fe.preventDefault(),_&&S()),(fe.ctrlKey||fe.metaKey)&&(fe.key==="z"&&fe.shiftKey||fe.key==="y")&&(fe.preventDefault(),D&&T()),fe.key==="Delete"||fe.key==="Backspace"){const Pe=fe.target;if(Pe.tagName==="INPUT"||Pe.tagName==="TEXTAREA")return;if(re.length>0){fe.preventDefault();const Fe=new Map;re.forEach(Ne=>{const[ve,Qe]=Ne.split("-");Fe.has(ve)||Fe.set(ve,new Set),Fe.get(ve).add(Qe)}),l(Ne=>Ne.map(ve=>{const Qe=Fe.get(ve.id);return Qe?{...ve,objects:ve.objects.filter(De=>!Qe.has(De.id))}:ve})),ne([]),f({selectedObject:null,selectedBand:null})}}};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[S,T,_,D,re,l,f]);const W=ce.useCallback((ue,fe)=>{fe.preventDefault();const Pe=o.findIndex(Qe=>Qe.id===ue);if(Pe===-1)return;const Fe=JSON.parse(JSON.stringify(o));U.current={bandIndex:Pe,startY:fe.clientY,originalBands:Fe},f({draggingBoundary:ue});const Ne=Qe=>{if(!U.current)return;const{bandIndex:De,startY:it,originalBands:et}=U.current,Ge=Qe.clientY-it;Math.abs(Ge)<.5||l(At=>{const nt=et[De],tt=nt.actualBottom;let lt=tt+Ge;if(lt=Math.max(nt.top+0,lt),De>0){const Mr=At[De-1],nA=h.bandSpacing;lt=Math.max(lt,Mr.actualBottom+nA)}const AA=iA.toPx(x)-iA.toPx(E.top)-iA.toPx(E.bottom)-20;lt=Math.min(lt,AA);const Vr=lt-tt,Bt=At.map((Mr,nA)=>{if(nA===De)return{...Mr,actualBottom:lt,bottom:lt};if(nA>De){const zr=et[nA],bA=zr.top+Vr,Tt=zr.actualBottom+Vr;return{...Mr,top:bA,actualBottom:Tt,bottom:Tt,objects:Mr.objects.map((kt,mr)=>{const lA=zr.objects[mr];if(lA){if(kt.type==="line"){const QA=lA;return{...kt,y:lA.y+Vr,y1:(QA.y1??lA.y)+Vr,y2:(QA.y2??lA.y)+Vr}}return{...kt,y:lA.y+Vr}}return kt})}}return Mr});return U.current={bandIndex:De,startY:Qe.clientY,originalBands:JSON.parse(JSON.stringify(Bt))},Bt})},ve=()=>{U.current=null,f({draggingBoundary:null}),window.removeEventListener("mousemove",Ne),window.removeEventListener("mouseup",ve)};window.addEventListener("mousemove",Ne),window.addEventListener("mouseup",ve)},[o,h.bandSpacing,l,f,x,E]),te=ce.useCallback((ue,fe=!1)=>{l(Pe=>Pe.map(Fe=>{const Ne=ue.filter(ve=>ve.bandId===Fe.id);return Ne.length===0?Fe:{...Fe,objects:Fe.objects.map(ve=>{const Qe=Ne.find(De=>De.objectId===ve.id);if(!Qe)return ve;if(ve.type==="line"){const De=ve;return{...ve,x:ve.x+Qe.deltaX,y:ve.y+Qe.deltaY,x1:(De.x1??ve.x)+Qe.deltaX,y1:(De.y1??ve.y)+Qe.deltaY,x2:(De.x2??ve.x+ve.width)+Qe.deltaX,y2:(De.y2??ve.y)+Qe.deltaY}}return{...ve,x:ve.x+Qe.deltaX,y:ve.y+Qe.deltaY}})}}),fe)},[l]),oe=ce.useCallback(ue=>{l(fe=>fe.map(Pe=>{const Fe=ue.filter(Ne=>Ne.bandId===Pe.id);return Fe.length===0?Pe:{...Pe,objects:Pe.objects.map(Ne=>{const ve=Fe.find(Qe=>Qe.objectId===Ne.id);if(!ve)return Ne;if(Ne.type==="line"){const Qe=Ne;let De=Qe.x1??Ne.x,it=Qe.y1??Ne.y,et=Qe.x2??Ne.x+Ne.width,Ge=Qe.y2??Ne.y;return ve.deltaWidth!==0&&(De<=et?et+=ve.deltaWidth:De+=ve.deltaWidth),ve.deltaHeight!==0&&(it<=Ge?Ge+=ve.deltaHeight:it+=ve.deltaHeight),{...Ne,x1:De,y1:it,x2:et,y2:Ge}}return{...Ne,width:Math.max(20,Ne.width+ve.deltaWidth),height:Math.max(20,Ne.height+ve.deltaHeight)}})}}))},[l]),we=ce.useCallback(ue=>{if(ue.length===0)return;const fe=()=>`obj_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,Pe=new Map;ue.forEach(({object:Ne,bandId:ve})=>{Pe.has(ve)||Pe.set(ve,[]),Pe.get(ve).push({...Ne,id:fe()})}),l(Ne=>Ne.map(ve=>{const Qe=Pe.get(ve.id);return Qe?{...ve,objects:[...ve.objects,...Qe]}:ve}));const Fe=[];Pe.forEach((Ne,ve)=>{Ne.forEach(Qe=>{Fe.push(`${ve}-${Qe.id}`)})}),ne(Fe),console.log(`已粘贴 ${ue.length} 个对象`)},[l]),le=ce.useCallback((ue,fe,Pe=!1)=>{const Fe=`${fe}-${ue}`,Ne=re.includes(Fe);if(Pe){const ve=Ne?re.filter(Qe=>Qe!==Fe):[...re,Fe];if(ne(ve),ve.length===0)f({selectedObject:null,selectedBand:null});else if(ve.length===1){const[Qe]=ve,[De,it]=Qe.split("-");f({selectedObject:it,selectedBand:De})}else{const Qe=ve[ve.length-1],[De,it]=Qe.split("-");f({selectedObject:it,selectedBand:De})}}else if(console.log("单选模式:",{selectedCount:re.length,isAlreadySelected:Ne,key:Fe}),re.length>1&&Ne){console.log("取消选中:",Fe);const ve=re.filter(Qe=>Qe!==Fe);if(ne(ve),ve.length===1){const[Qe]=ve,[De,it]=Qe.split("-");f({selectedObject:it,selectedBand:De})}else if(ve.length>1){const Qe=ve[ve.length-1],[De,it]=Qe.split("-");f({selectedObject:it,selectedBand:De})}}else ne([Fe]),f({selectedObject:ue,selectedBand:fe})},[re,f]),Be=ce.useCallback(ue=>{if(ue.length===0){ne([]),f({selectedObject:null,selectedBand:null});return}if(ne(ue),ue.length===1){const[fe]=ue,[Pe,Fe]=fe.split("-");f({selectedObject:Fe,selectedBand:Pe})}else{const[fe]=ue,[Pe,Fe]=fe.split("-");f({selectedObject:Fe,selectedBand:Pe})}},[f]),ye=ce.useCallback(()=>{ne([]),Ae(null),f({selectedObject:null,selectedBand:null})},[f]),R=ce.useCallback(()=>{ne([]),Ae(null),f({selectedObject:null})},[f]),Ie=ce.useCallback(ue=>{l(fe=>fe.map(Fe=>{const Ne=ue.filter(ve=>ve.bandId===Fe.id);return Ne.length===0?Fe:{...Fe,objects:Fe.objects.map(ve=>{const Qe=Ne.find(De=>De.objectId===ve.id);return Qe?{...ve,...Qe.changes}:ve})}}))},[l]),Ue=ce.useCallback(()=>{const ue=y();A?A(ue):(localStorage.setItem("bandDesignerData",JSON.stringify(ue)),alert("设计已保存到本地存储"))},[y,A]),Te=()=>{if(re.length>0){if(window.confirm(`确定要删除选中的 ${re.length} 个对象吗?`)){const ue=new Map;re.forEach(fe=>{const[Pe,Fe]=fe.split("-");ue.has(Pe)||ue.set(Pe,new Set),ue.get(Pe).add(Fe)}),l(fe=>fe.map(Pe=>{const Fe=ue.get(Pe.id);return Fe?{...Pe,objects:Pe.objects.filter(Ne=>!Fe.has(Ne.id))}:Pe})),ye()}}else p()},Ee=ce.useCallback((ue,fe)=>{const Pe=u.selectedBand;if(!Pe){alert("请先选择一个带区");return}const Fe=o.findIndex(At=>At.id===Pe);if(Fe===-1)return;const Ne=o[Fe],ve=Zs.find(At=>At.id===ue);if(!ve)return;const Qe=(V==null?void 0:V.x)??20,De=((V==null?void 0:V.y)??10)+Ne.top,et=Ne.objects.reduce((At,nt)=>{const tt=nt.zIndex??1;return tt>At?tt:At},0)+1,Ge={id:`${ue}_${Date.now()}`,type:ue,x:Qe,y:De,width:ve.defaultWidth,height:ve.defaultHeight,zIndex:et};if(ue==="text")Object.assign(Ge,{text:"文本",fontSize:14,color:"#000000",textAlign:"left"});else if(ue==="field")Object.assign(Ge,{fieldName:fe||"field",color:"#000000",background:"transparent"});else if(ue==="calculated"){Object.assign(Ge,{formula:"",text:"[计算]",color:"#000000",background:"transparent",formatType:"number",decimalPlaces:2}),Y({...Ge,bandId:Pe}),P(!0);return}else ue==="page_number"?Object.assign(Ge,{text:"第1页/共1页",fontSize:12,color:"#000000",textAlign:"center"}):ue==="current_date"?Object.assign(Ge,{text:new Date().toLocaleDateString(),fontSize:12,color:"#000000",textAlign:"right"}):ue==="line"?(Object.assign(Ge,{x1:Qe,y1:De,x2:Qe+ve.defaultWidth,y2:De,strokeWidth:1,color:"#000000",lineStyle:"solid"}),console.log("添加线条:",{bandId:Pe,bandTop:Ne.top,bandBottom:Ne.actualBottom,posX:Qe,posY:De,x1:Qe,y1:De,x2:Qe+ve.defaultWidth,y2:De,lastClickPosition:V})):ue==="rectangle"&&Object.assign(Ge,{background:"transparent"});l(At=>At.map(nt=>nt.id!==Pe?nt:{...nt,objects:[...nt.objects,Ge]})),le(Ge.id,Pe)},[o,u.selectedBand,V,l,le]),Ve=ce.useCallback((ue,fe)=>{const Pe=u.selectedBand;if(!Pe){alert("请先选择一个带区");return}const Fe=o.findIndex(tt=>tt.id===Pe);if(Fe===-1)return;const Ne=o[Fe],ve=(V==null?void 0:V.x)??20,Qe=((V==null?void 0:V.y)??10)+Ne.top,De=Ne.objects.reduce((tt,lt)=>{const ur=lt.zIndex??1;return ur>tt?ur:tt},0),it=120,et=25,Ge=8,At=ue.map((tt,lt)=>{let ur,_t;return fe==="horizontal"?(ur=ve+lt*(it+Ge),_t=Qe):(ur=ve,_t=Qe+lt*(et+Ge)),{id:`field_${Date.now()}_${lt}`,type:"field",fieldName:tt.name,x:ur,y:_t,width:it,height:et,zIndex:De+1+lt,color:"#000000",background:"transparent"}});l(tt=>tt.map(lt=>lt.id!==Pe?lt:{...lt,objects:[...lt.objects,...At]}));const nt=At.map(tt=>`${Pe}-${tt.id}`);ne(nt),console.log(`已添加 ${ue.length} 个数据字段`)},[o,u.selectedBand,V,l]),Me=ce.useCallback(ue=>{if(!K)return;const{bandId:fe,...Pe}=K,Fe={...Pe,formula:ue};l(Ne=>Ne.map(ve=>ve.id!==fe?ve:{...ve,objects:[...ve.objects,Fe]})),le(Fe.id,fe),P(!1),Y(null)},[K,l,le]),ze=ce.useCallback(()=>{P(!1),Y(null)},[]),Ye=()=>{f({showRulers:!u.showRulers})},xe=()=>{f({showPageMargins:!u.showPageMargins})},Oe=u.selectedBand?o.find(ue=>ue.id===u.selectedBand):null,je=u.selectedObject&&Oe?Oe.objects.find(ue=>ue.id===u.selectedObject):null,ge=ce.useCallback(()=>{M(!0)},[]),Re=ce.useRef(Ue),Le=ce.useRef(ge);return Re.current=Ue,Le.current=ge,ce.useEffect(()=>{const ue=fe=>{const Pe=fe.target;Pe.tagName==="INPUT"||Pe.tagName==="TEXTAREA"||((fe.ctrlKey||fe.metaKey)&&fe.key==="s"&&(fe.preventDefault(),Re.current()),(fe.ctrlKey||fe.metaKey)&&fe.key==="p"&&(fe.preventDefault(),Le.current()))};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[]),v.jsxs("div",{className:"react-band-designer",children:[v.jsx(JU,{selectedObjectIds:re,bands:o,onUpdateObjects:Ie,onClearSelection:ye,onDeleteObjects:Te,onUndo:S,onRedo:T,canUndo:_,canRedo:D,onSave:Ue,onPreview:ge,showGrid:u.showGrid,showRulers:u.showRulers,showPageMargins:u.showPageMargins,onToggleGrid:()=>f({showGrid:!u.showGrid}),onToggleRulers:Ye,onTogglePageMargins:xe,onPageSettings:()=>z(!0),onAddControl:Ee,onAddFields:Ve,selectedBandId:u.selectedBand,dataFields:i||[]}),v.jsxs("div",{className:"workspace",children:[v.jsx("div",{className:"design-area",children:v.jsx(Fw,{bands:o,state:u,designerOptions:h,PAGE_WIDTH:iA.toPx(B),PAGE_HEIGHT:iA.toPx(x),PAGE_MARGINS:iA.convertMargins(E),onSelectBand:(ue,fe)=>{c(ue),!(fe!=null&&fe.shiftKey)&&!(fe!=null&&fe.ctrlKey)&&!(fe!=null&&fe.metaKey)&&ne([])},onSelectObject:le,onMultiSelect:Be,onUpdateObjectPosition:g,onUpdateObject:(ue,fe,Pe,Fe)=>{l(Ne=>Ne.map(ve=>ve.id!==fe?ve:{...ve,objects:ve.objects.map(Qe=>Qe.id===ue?{...Qe,...Pe}:Qe)}),Fe)},onBoundaryMouseDown:W,onMoveMultipleObjects:te,onResizeMultipleObjects:oe,onPasteObjects:we,selectedObjectIds:re,focusedObjectId:Z,onClearSelection:R,onClickPosition:q,onDeleteObjects:Te,onUndo:S,onRedo:T,canUndo:_,canRedo:D,onUpdateObjects:Ie,dataFields:i||[]})}),je?v.jsx(Qw,{object:je,bandId:u.selectedBand,dataFields:i||[],onUpdateBands:w,onClearSelection:()=>{ye(),f({selectedObject:null})}}):Oe?v.jsx(_w,{dataFields:i||[],band:Oe,onUpdate:ue=>{w(fe=>fe.map(Pe=>Pe.id===Oe.id?{...Pe,...ue}:Pe))},onFocusObject:(ue,fe)=>{const Pe=`${fe}-${ue}`;Ae(Pe),ne([]),f({selectedObject:null});const Fe=document.querySelector(`[data-object-id="${Pe}"]`);Fe&&Fe.scrollIntoView({behavior:"smooth",block:"center"})},onSelectObject:(ue,fe)=>{const Pe=`${fe}-${ue}`;ne([Pe]),Ae(null),f({selectedBand:fe,selectedObject:ue})},selectedObjectIds:re,focusedObjectId:Z,onDeleteObject:(ue,fe)=>{l(Pe=>Pe.map(Fe=>Fe.id!==fe?Fe:{...Fe,objects:Fe.objects.filter(Ne=>Ne.id!==ue)})),ne(Pe=>Pe.filter(Fe=>Fe!==`${fe}-${ue}`)),Ae(null)}}):v.jsxs("div",{className:"property-panel",children:[v.jsx("h3",{children:"属性"}),v.jsxs("div",{className:"empty-state",children:[v.jsx("p",{children:re.length>0?`已选中 ${re.length} 个对象`:"请选择一个对象或带区"}),re.length>0&&v.jsxs("div",{className:"multi-selection-info",children:[v.jsx("p",{children:"按住Shift/Ctrl点击可多选"}),v.jsx("p",{children:"使用方向键微调位置"}),v.jsx("button",{className:"btn btn-small",onClick:ye,children:"清除选择"})]})]})]})]}),v.jsxs("div",{className:"status-bar",children:[v.jsxs("div",{className:"status-item",children:[v.jsx("span",{children:"提示:"})," 拖动带区边界线定义区域高度"]}),v.jsxs("div",{className:"status-item",children:[v.jsx("span",{children:"带区数:"})," ",o.length]}),v.jsxs("div",{className:"status-item",children:[v.jsx("span",{children:"控件总数:"})," ",o.reduce((ue,fe)=>ue+fe.objects.length,0)]}),v.jsxs("div",{className:"status-item",children:[v.jsx("span",{children:"选中对象:"})," ",re.length," 个"]})]}),O&&v.jsx(Dx,{bands:o,dataFields:i||[],pageWidth:iA.toPx(B),pageHeight:iA.toPx(x),pageMargins:iA.convertMargins(E),paperWidthMm:B,paperHeightMm:x,data:n,onClose:J}),I&&v.jsx(go,{dataFields:i||[],value:"",onConfirm:Me,onCancel:ze}),C&&v.jsx(kx,{pageSettings:Q,onSettingsChange:L,onClose:()=>z(!1)})]})},aP=({onSave:r,onPreview:e,onLoadSample:t,onClearDesign:A,showGrid:n,showBands:i,showRulers:s,showPageMargins:a,onToggleGrid:o,onToggleBands:l,onToggleRulers:u,onTogglePageMargins:f,onHandlePreview:h})=>v.jsxs("div",{className:"toolbar",children:[v.jsxs("div",{className:"toolbar-left",children:[v.jsx("button",{className:"btn btn-primary",onClick:r,children:"保存设计"}),v.jsx("button",{className:"btn",onClick:t,children:"加载示例"}),v.jsx("button",{className:"btn",onClick:A,children:"清空设计"}),v.jsx("button",{className:"btn",onClick:e,children:"预览"}),v.jsx("button",{className:"btn",onClick:h,children:"打印预览"})]}),v.jsxs("div",{className:"toolbar-right",children:[v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:n,onChange:c=>o(c.target.checked)}),"显示网格"]}),v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:i,onChange:c=>l(c.target.checked)}),"显示带区"]}),v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:s,onChange:u}),"显示标尺"]}),v.jsxs("label",{className:"checkbox",children:[v.jsx("input",{type:"checkbox",checked:a,onChange:f}),"显示边距"]})]})]});function Gc(r){const{pageSettings:e}=r;if(e){const t=e.orientation==="landscape"?Math.max(e.width,e.height):Math.min(e.width,e.height),A=e.orientation==="landscape"?Math.min(e.width,e.height):Math.max(e.width,e.height);return{pageWidth:Math.round(iA.toPx(t,"mm")),pageHeight:Math.round(iA.toPx(A,"mm")),pageMargins:{top:Math.round(iA.toPx(e.margins.top,"mm")),bottom:Math.round(iA.toPx(e.margins.bottom,"mm")),left:Math.round(iA.toPx(e.margins.left,"mm")),right:Math.round(iA.toPx(e.margins.right,"mm"))},paperWidthMm:t,paperHeightMm:A}}return{pageWidth:r.pageWidth??794,pageHeight:r.pageHeight??1123,pageMargins:r.pageMargins??{top:40,bottom:40,left:40,right:40},paperWidthMm:210,paperHeightMm:297}}function sP(r){var D;const{template:e,data:t,dataFields:A=[]}=r,{pageHeight:n,pageMargins:i}=Gc(r),s=e.find(U=>U.id==="header"),a=e.find(U=>U.id==="detail"),o=e.find(U=>U.id==="summary"),l=e.find(U=>U.id==="footer"),u=Zf(A)||"products";if(!a||!(t!=null&&t[u]))return{rowsPerPage:0,totalPages:1,singleRowHeight:0,minTopOffset:0,detailDataKey:u,hasFooterOnlyPage:!1};const f=a.actualBottom-a.top,h=((D=a.objects)==null?void 0:D.filter(U=>U.y>=a.top&&U.y<a.actualBottom))||[],c=h.length>0?Math.min(...h.map(U=>U.y-a.top)):0,g=f-c,p=n-i.top-i.bottom;let y=0;s&&(y+=s.actualBottom-s.top);const w=(o==null?void 0:o.summaryDisplayMode)||"atEnd";o&&w==="perPage"&&(y+=o.actualBottom-o.top);const B=p-y,x=Math.max(1,Math.floor(B/g)),Q=t[u].length;let L=Math.max(1,Math.ceil(Q/x)),S=!1;const T=o&&w==="atEnd"?o.actualBottom-o.top:0,_=l?l.actualBottom-l.top:0;if(_>0&&Q>0){const U=(L-1)*x,M=(Q-U)*g,C=p-y-M,z=T+_;C<z&&(C>=T&&T>0?(L=L+1,S=!0):C<T&&T>0?(L=L+1,S=!1):(L=L+1,S=!0))}return{rowsPerPage:x,totalPages:L,singleRowHeight:g,minTopOffset:c,detailDataKey:u,hasFooterOnlyPage:S}}function oP(r){return Object.entries(r).filter(([e,t])=>t!=null).map(([e,t])=>{const A=e.replace(/([A-Z])/g,"-$1").toLowerCase(),n=typeof t=="number"&&!["z-index","opacity","line-height","font-weight"].includes(A);return`${A}:${t}${n?"px":""}`}).join(";")}function lP(r,e,t){const A=r,n=A.x1??r.x,i=(A.y1??r.y)-e-t,s=A.x2??r.x+r.width,a=(A.y2??r.y)-e-t,o=A.color||"#000000",l=A.strokeWidth||1,u=A.lineStyle||"solid",f=s-n,h=a-i,c=Math.sqrt(f*f+h*h),g=Math.atan2(h,f)*(180/Math.PI);return`<div style="position:absolute;left:${n}px;top:${i}px;width:${c}px;height:0;border-top:${l}px ${u==="dashed"?"dashed":u==="dotted"?"dotted":"solid"} ${o};transform-origin:0 0;transform:rotate(${g}deg);z-index:${(r.zIndex??1)+100}"></div>`}function uP(r,e,t,A){const n=Hh(r,{isPreview:!0}),i=["text","multiline_text","field","calculated","page_number","current_date"].includes(r.type),s=r.y-t-A,a={position:"absolute",left:r.x,top:s,width:r.width,height:r.height,zIndex:(r.zIndex??1)+100,boxSizing:"border-box",overflow:"hidden",...n};if(i){const u=r.textVerticalAlign||"middle",f=r.textAlign||"left";a.display="flex",a.flexDirection="column",a.justifyContent=u==="top"?"flex-start":u==="bottom"?"flex-end":"center",a.alignItems=f==="center"?"center":f==="right"?"flex-end":"flex-start"}const o=oP(a);if(r.type==="image"){const u=r,f=u.src||u.imageUrl;return f?u.objectFit==="repeat"?`<div style="${o}"><div style="width:100%;height:100%;background-image:url(${f});background-repeat:repeat;background-size:auto"></div></div>`:`<div style="${o}"><img src="${f}" alt="${u.alt||"图片"}" style="width:100%;height:100%;object-fit:${u.objectFit||"contain"}"/></div>`:`<div style="${o}"><span style="color:#999;font-size:12px">[图片]</span></div>`}if(r.type==="barcode"){const u=r,f=u.barcodeType||"CODE128",h=u.showText!==!1,c=u.background||"#FFFFFF",g=u.lineColor||"#000000";if(!e)return`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:${c};color:#999;font-size:12px">[条码]</div></div>`;try{const p=document.createElementNS("http://www.w3.org/2000/svg","svg");return M2(p,e,{format:f,width:2,height:h?Math.max(r.height-20,20):r.height,displayValue:h,background:c,lineColor:g,margin:2,fontSize:12,textMargin:2}),p.setAttribute("width","100%"),p.setAttribute("height","100%"),p.setAttribute("preserveAspectRatio","none"),`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden">${p.outerHTML}</div></div>`}catch(p){return console.error("条码生成失败:",p),`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:#f00;font-size:12px">[条码错误]</div></div>`}}if(r.type==="qrcode"){const u=r,f=u.background||"#FFFFFF",h=u.foreground||"#000000",c=u.errorLevel||"M";if(!e)return`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:${f};color:#999;font-size:12px">[二维码]</div></div>`;try{const p=Rh.create(e,{errorCorrectionLevel:c}).modules,y=p.size,w=1,B=10,x=(y+w*2)*B;let E="";for(let L=0;L<y;L++)for(let S=0;S<y;S++)if(p.get(L,S)){const T=(S+w)*B,_=(L+w)*B;E+=`M${T},${_}h${B}v${B}h-${B}z`}const Q=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${x} ${x}" width="100%" height="100%" preserveAspectRatio="xMidYMid meet"><rect width="100%" height="100%" fill="${f}"/><path d="${E}" fill="${h}"/></svg>`;return`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:${f}">${Q}</div></div>`}catch(g){return console.error("二维码生成失败:",g),`<div style="${o}"><div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:#f00;font-size:12px">[二维码错误]</div></div>`}}if(r.type==="multiline_text")return`<div style="${o}"><div style="width:100%;word-break:break-word;white-space:normal">${e}</div></div>`;const l=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br/>");return`<div style="${o}"><span style="white-space:nowrap">${l}</span></div>`}function qo(r,e){const{data:t,currentPage:A,totalPages:n,startIndex:i=0,rowIndex:s=0,pageSize:a=0,minTopOffset:o=0,dataFields:l=[]}=e;let u="";return r.objects.filter(f=>f.printVisible!==!1&&!(f.floating===!0&&f.type==="image")).forEach(f=>{if(f.type==="line")u+=lP(f,r.top,o);else{const h=Qu(f,{data:t,currentPage:A,totalPages:n,startIndex:i,rowIndex:s,pageSize:a,dataFields:l});u+=uP(f,h,r.top,o)}}),u}function cP(r,e,t){const{template:A,data:n,dataFields:i=[]}=r,{pageWidth:s,pageHeight:a,pageMargins:o}=Gc(r),{rowsPerPage:l,totalPages:u,singleRowHeight:f,minTopOffset:h,detailDataKey:c,hasFooterOnlyPage:g}=t,p=A.find(C=>C.id==="header"),y=A.find(C=>C.id==="detail"),w=A.find(C=>C.id==="summary"),B=A.find(C=>C.id==="footer"),x=s-o.left-o.right;let E=o.top,Q="";const L=e===u;if(g&&L){if(B){const C=B.actualBottom-B.top,z=B.backgroundColor?`background-color:${B.backgroundColor};`:"";Q+=`<div style="position:absolute;top:${E}px;left:${o.left}px;width:${x}px;height:${C}px;overflow:hidden;${z}">`,Q+=qo(B,{data:n,currentPage:e,totalPages:u,dataFields:i}),Q+="</div>"}return`<div class="print-page" style="position:relative;width:${s}px;height:${a}px;background:#fff;box-sizing:border-box;page-break-after:always">${Q}</div>`}const T=n==null?void 0:n[c],_=g?u-1:u,D=(e-1)*l,U=e<=_&&T?T.slice(D,D+l):[];if(p){const C=p.actualBottom-p.top,z=p.backgroundColor?`background-color:${p.backgroundColor};`:"";Q+=`<div style="position:absolute;top:${E}px;left:${o.left}px;width:${x}px;height:${C}px;overflow:hidden;${z}">`,Q+=qo(p,{data:n,currentPage:e,totalPages:u,dataFields:i}),Q+="</div>",E+=C}if(y&&U.length>0){const C=U.length*f;Q+=`<div style="position:absolute;top:${E}px;left:${o.left}px;width:${x}px;height:${C}px;overflow:hidden">`,U.forEach((z,re)=>{const ne=D+re;let Z="";if(y.backgroundColorFormula){const V=ho(y.backgroundColorFormula,{data:n,currentPage:e,totalPages:u,rowIndex:ne},{});V&&!V.includes("错误")&&(Z=V.replace(/^["']|["']$/g,""))}else y.backgroundColor&&(Z=y.backgroundColor);const Ae=`position:absolute;top:${re*f}px;left:0;width:100%;height:${f}px;overflow:hidden;${Z?`background-color:${Z};`:""}`;Q+=`<div style="${Ae}">`,Q+=qo(y,{data:n,currentPage:e,totalPages:u,startIndex:D,rowIndex:re,pageSize:l,minTopOffset:h,dataFields:i}),Q+="</div>"}),Q+="</div>",E+=C}const O=(w==null?void 0:w.summaryDisplayMode)||"atEnd",M=O==="perPage"||O==="atEnd"&&(g?e===u-1:L);if(w&&M){const C=w.actualBottom-w.top,z=w.backgroundColor?`background-color:${w.backgroundColor};`:"";Q+=`<div style="position:absolute;top:${E}px;left:${o.left}px;width:${x}px;height:${C}px;overflow:hidden;${z}">`,Q+=qo(w,{data:n,currentPage:e,totalPages:u,startIndex:D,pageSize:U.length,dataFields:i}),Q+="</div>",E+=C}if(B&&L&&!g){const C=B.actualBottom-B.top,z=B.backgroundColor?`background-color:${B.backgroundColor};`:"";Q+=`<div style="position:absolute;top:${E}px;left:${o.left}px;width:${x}px;height:${C}px;overflow:hidden;${z}">`,Q+=qo(B,{data:n,currentPage:e,totalPages:u,startIndex:D,pageSize:U.length,dataFields:i}),Q+="</div>"}return`<div class="print-page" style="position:relative;width:${s}px;height:${a}px;background:#fff;box-sizing:border-box;page-break-after:always">${Q}</div>`}function Cg(r){const{pageWidth:e,pageHeight:t,paperWidthMm:A,paperHeightMm:n}=Gc(r),i=sP(r),{totalPages:s}=i;let a="";for(let o=1;o<=s;o++)a+=cP(r,o,i);return{html:a,totalPages:s,pageWidth:e,pageHeight:t,paperWidthMm:A,paperHeightMm:n}}async function fP(r,e){const t=document.createElement("div");t.style.cssText=`position:absolute;left:-9999px;top:0;width:${e}px;`,t.innerHTML=r,document.body.appendChild(t);const A=t.querySelectorAll('[data-qrcode="true"]'),n=[];return A.forEach(i=>{const s=decodeURIComponent(i.getAttribute("data-value")||""),a=i.getAttribute("data-bg")||"#FFFFFF",o=i.getAttribute("data-fg")||"#000000",l=i.getAttribute("data-level")||"M",u=parseInt(i.getAttribute("data-size")||"100",10),f=i.querySelector("canvas");if(f&&s){const h=Rh.toCanvas(f,s,{width:u,margin:1,errorCorrectionLevel:l,color:{dark:o,light:a}}).catch(c=>console.error("二维码生成失败:",c));n.push(h)}}),await Promise.all(n),t}async function hP(r){const{fileName:e=`报表_${new Date().toLocaleDateString("zh-CN").replace(/\//g,"-")}`,download:t=!0,scale:A=2}=r,{pageWidth:n,paperWidthMm:i,paperHeightMm:s}=Gc(r),{html:a}=Cg(r),o=await fP(a,n);try{const l=i>s,u=new pt({orientation:l?"landscape":"portrait",unit:"mm",format:[Math.min(i,s),Math.max(i,s)]}),f=i,h=s,c=o.querySelectorAll(".print-page");for(let g=0;g<c.length;g++){const p=c[g],y=await xg(p,{scale:A,useCORS:!0,allowTaint:!0,backgroundColor:"#ffffff",logging:!1}),w=y.toDataURL("image/png"),B=f,x=y.height*f/y.width;g>0&&u.addPage(),u.addImage(w,"PNG",0,0,B,Math.min(x,h))}if(t)u.save(`${e}.pdf`);else return u.output("blob")}finally{document.body.removeChild(o)}}function Hx(r){const{html:e,pageWidth:t,pageHeight:A}=Cg(r);return`<!DOCTYPE html>
|
|
709
709
|
<html>
|
|
710
710
|
<head>
|
|
711
711
|
<meta charset="UTF-8">
|
|
@@ -776,10 +776,10 @@ ${e}
|
|
|
776
776
|
});
|
|
777
777
|
<\/script>
|
|
778
778
|
</body>
|
|
779
|
-
</html>`}function dP(r){const e=Hx(r),t=window.open("","_blank");t&&(t.document.write(e),t.document.close(),t.onload=()=>{t.print()})}/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:jx,setPrototypeOf:Kx,isFrozen:gP,getPrototypeOf:pP,getOwnPropertyDescriptor:vP}=Object;let{freeze:FA,seal:fn,create:Eg}=Object,{apply:Fg,construct:Sg}=typeof Reflect<"u"&&Reflect;FA||(FA=function(e){return e}),fn||(fn=function(e){return e}),Fg||(Fg=function(e,t){for(var A=arguments.length,n=new Array(A>2?A-2:0),i=2;i<A;i++)n[i-2]=arguments[i];return e.apply(t,n)}),Sg||(Sg=function(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),n=1;n<t;n++)A[n-1]=arguments[n];return new e(...A)});const Wc=UA(Array.prototype.forEach),mP=UA(Array.prototype.lastIndexOf),qx=UA(Array.prototype.pop),Vo=UA(Array.prototype.push),wP=UA(Array.prototype.splice),Xc=UA(String.prototype.toLowerCase),Ug=UA(String.prototype.toString),_g=UA(String.prototype.match),zo=UA(String.prototype.replace),yP=UA(String.prototype.indexOf),BP=UA(String.prototype.trim),Un=UA(Object.prototype.hasOwnProperty),SA=UA(RegExp.prototype.test),Go=bP(TypeError);function UA(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,A=new Array(t>1?t-1:0),n=1;n<t;n++)A[n-1]=arguments[n];return Fg(r,e,A)}}function bP(r){return function(){for(var e=arguments.length,t=new Array(e),A=0;A<e;A++)t[A]=arguments[A];return Sg(r,t)}}function Nt(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xc;Kx&&Kx(r,null);let A=e.length;for(;A--;){let n=e[A];if(typeof n=="string"){const i=t(n);i!==n&&(gP(e)||(e[A]=i),n=i)}r[n]=!0}return r}function xP(r){for(let e=0;e<r.length;e++)Un(r,e)||(r[e]=null);return r}function Xn(r){const e=Eg(null);for(const[t,A]of jx(r))Un(r,t)&&(Array.isArray(A)?e[t]=xP(A):A&&typeof A=="object"&&A.constructor===Object?e[t]=Xn(A):e[t]=A);return e}function Wo(r,e){for(;r!==null;){const A=vP(r,e);if(A){if(A.get)return UA(A.get);if(typeof A.value=="function")return UA(A.value)}r=pP(r)}function t(){return null}return t}const Vx=FA(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ig=FA(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Qg=FA(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),CP=FA(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ng=FA(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),EP=FA(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zx=FA(["#text"]),Gx=FA(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Og=FA(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wx=FA(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Yc=FA(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),FP=fn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),SP=fn(/<%[\w\W]*|[\w\W]*%>/gm),UP=fn(/\$\{[\w\W]*/gm),_P=fn(/^data-[\-\w.\u00B7-\uFFFF]+$/),IP=fn(/^aria-[\-\w]+$/),Xx=fn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),QP=fn(/^(?:\w+script|data):/i),NP=fn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yx=fn(/^html$/i),OP=fn(/^[a-z][.\w]*(-[.\w]+)+$/i);var $x=Object.freeze({__proto__:null,ARIA_ATTR:IP,ATTR_WHITESPACE:NP,CUSTOM_ELEMENT:OP,DATA_ATTR:_P,DOCTYPE_NAME:Yx,ERB_EXPR:SP,IS_ALLOWED_URI:Xx,IS_SCRIPT_OR_DATA:QP,MUSTACHE_EXPR:FP,TMPLIT_EXPR:UP});const Xo={element:1,text:3,progressingInstruction:7,comment:8,document:9},TP=function(){return typeof window>"u"?null:window},LP=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let A=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(A=t.getAttribute(n));const i="dompurify"+(A?"#"+A:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Jx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Zx(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:TP();const e=ft=>Zx(ft);if(e.version="3.3.1",e.removed=[],!r||!r.document||r.document.nodeType!==Xo.document||!r.Element)return e.isSupported=!1,e;let{document:t}=r;const A=t,n=A.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:o,NodeFilter:l,NamedNodeMap:u=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:c}=r,g=o.prototype,p=Wo(g,"cloneNode"),y=Wo(g,"remove"),w=Wo(g,"nextSibling"),B=Wo(g,"childNodes"),x=Wo(g,"parentNode");if(typeof s=="function"){const ft=t.createElement("template");ft.content&&ft.content.ownerDocument&&(t=ft.content.ownerDocument)}let E,Q="";const{implementation:L,createNodeIterator:S,createDocumentFragment:T,getElementsByTagName:_}=t,{importNode:D}=A;let U=Jx();e.isSupported=typeof jx=="function"&&typeof x=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:M,TMPLIT_EXPR:C,DATA_ATTR:z,ARIA_ATTR:re,IS_SCRIPT_OR_DATA:ne,ATTR_WHITESPACE:Z,CUSTOM_ELEMENT:Ae}=$x;let{IS_ALLOWED_URI:V}=$x,k=null;const I=Nt({},[...Vx,...Ig,...Qg,...Ng,...zx]);let P=null;const K=Nt({},[...Gx,...Og,...Wx,...Yc]);let Y=Object.seal(Eg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),J=null,q=null;const W=Object.seal(Eg(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let te=!0,oe=!0,we=!1,le=!0,Be=!1,ye=!0,R=!1,Ie=!1,Ue=!1,Re=!1,Ee=!1,Ve=!1,Me=!0,ze=!1;const Ye="user-content-";let xe=!0,Oe=!1,je={},ge=null;const Pe=Nt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Te=null;const ue=Nt({},["audio","video","img","source","image","track"]);let fe=null;const Le=Nt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fe="http://www.w3.org/1998/Math/MathML",Ne="http://www.w3.org/2000/svg",ve="http://www.w3.org/1999/xhtml";let Qe=ve,De=!1,it=null;const et=Nt({},[Fe,Ne,ve],Ug);let Ge=Nt({},["mi","mo","mn","ms","mtext"]),At=Nt({},["annotation-xml"]);const nt=Nt({},["title","style","font","a","script"]);let tt=null;const lt=["application/xhtml+xml","text/html"],ur="text/html";let _t=null,AA=null;const Vr=t.createElement("form"),Bt=function(de){return de instanceof RegExp||de instanceof Function},Mr=function(){let de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(AA&&AA===de)){if((!de||typeof de!="object")&&(de={}),de=Xn(de),tt=lt.indexOf(de.PARSER_MEDIA_TYPE)===-1?ur:de.PARSER_MEDIA_TYPE,_t=tt==="application/xhtml+xml"?Ug:Xc,k=Un(de,"ALLOWED_TAGS")?Nt({},de.ALLOWED_TAGS,_t):I,P=Un(de,"ALLOWED_ATTR")?Nt({},de.ALLOWED_ATTR,_t):K,it=Un(de,"ALLOWED_NAMESPACES")?Nt({},de.ALLOWED_NAMESPACES,Ug):et,fe=Un(de,"ADD_URI_SAFE_ATTR")?Nt(Xn(Le),de.ADD_URI_SAFE_ATTR,_t):Le,Te=Un(de,"ADD_DATA_URI_TAGS")?Nt(Xn(ue),de.ADD_DATA_URI_TAGS,_t):ue,ge=Un(de,"FORBID_CONTENTS")?Nt({},de.FORBID_CONTENTS,_t):Pe,J=Un(de,"FORBID_TAGS")?Nt({},de.FORBID_TAGS,_t):Xn({}),q=Un(de,"FORBID_ATTR")?Nt({},de.FORBID_ATTR,_t):Xn({}),je=Un(de,"USE_PROFILES")?de.USE_PROFILES:!1,te=de.ALLOW_ARIA_ATTR!==!1,oe=de.ALLOW_DATA_ATTR!==!1,we=de.ALLOW_UNKNOWN_PROTOCOLS||!1,le=de.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Be=de.SAFE_FOR_TEMPLATES||!1,ye=de.SAFE_FOR_XML!==!1,R=de.WHOLE_DOCUMENT||!1,Re=de.RETURN_DOM||!1,Ee=de.RETURN_DOM_FRAGMENT||!1,Ve=de.RETURN_TRUSTED_TYPE||!1,Ue=de.FORCE_BODY||!1,Me=de.SANITIZE_DOM!==!1,ze=de.SANITIZE_NAMED_PROPS||!1,xe=de.KEEP_CONTENT!==!1,Oe=de.IN_PLACE||!1,V=de.ALLOWED_URI_REGEXP||Xx,Qe=de.NAMESPACE||ve,Ge=de.MATHML_TEXT_INTEGRATION_POINTS||Ge,At=de.HTML_INTEGRATION_POINTS||At,Y=de.CUSTOM_ELEMENT_HANDLING||{},de.CUSTOM_ELEMENT_HANDLING&&Bt(de.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Y.tagNameCheck=de.CUSTOM_ELEMENT_HANDLING.tagNameCheck),de.CUSTOM_ELEMENT_HANDLING&&Bt(de.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Y.attributeNameCheck=de.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),de.CUSTOM_ELEMENT_HANDLING&&typeof de.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Y.allowCustomizedBuiltInElements=de.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Be&&(oe=!1),Ee&&(Re=!0),je&&(k=Nt({},zx),P=[],je.html===!0&&(Nt(k,Vx),Nt(P,Gx)),je.svg===!0&&(Nt(k,Ig),Nt(P,Og),Nt(P,Yc)),je.svgFilters===!0&&(Nt(k,Qg),Nt(P,Og),Nt(P,Yc)),je.mathMl===!0&&(Nt(k,Ng),Nt(P,Wx),Nt(P,Yc))),de.ADD_TAGS&&(typeof de.ADD_TAGS=="function"?W.tagCheck=de.ADD_TAGS:(k===I&&(k=Xn(k)),Nt(k,de.ADD_TAGS,_t))),de.ADD_ATTR&&(typeof de.ADD_ATTR=="function"?W.attributeCheck=de.ADD_ATTR:(P===K&&(P=Xn(P)),Nt(P,de.ADD_ATTR,_t))),de.ADD_URI_SAFE_ATTR&&Nt(fe,de.ADD_URI_SAFE_ATTR,_t),de.FORBID_CONTENTS&&(ge===Pe&&(ge=Xn(ge)),Nt(ge,de.FORBID_CONTENTS,_t)),de.ADD_FORBID_CONTENTS&&(ge===Pe&&(ge=Xn(ge)),Nt(ge,de.ADD_FORBID_CONTENTS,_t)),xe&&(k["#text"]=!0),R&&Nt(k,["html","head","body"]),k.table&&(Nt(k,["tbody"]),delete J.tbody),de.TRUSTED_TYPES_POLICY){if(typeof de.TRUSTED_TYPES_POLICY.createHTML!="function")throw Go('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof de.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Go('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=de.TRUSTED_TYPES_POLICY,Q=E.createHTML("")}else E===void 0&&(E=LP(c,n)),E!==null&&typeof Q=="string"&&(Q=E.createHTML(""));FA&&FA(de),AA=de}},nA=Nt({},[...Ig,...Qg,...CP]),zr=Nt({},[...Ng,...EP]),bA=function(de){let Je=x(de);(!Je||!Je.tagName)&&(Je={namespaceURI:Qe,tagName:"template"});const ot=Xc(de.tagName),Yt=Xc(Je.tagName);return it[de.namespaceURI]?de.namespaceURI===Ne?Je.namespaceURI===ve?ot==="svg":Je.namespaceURI===Fe?ot==="svg"&&(Yt==="annotation-xml"||Ge[Yt]):!!nA[ot]:de.namespaceURI===Fe?Je.namespaceURI===ve?ot==="math":Je.namespaceURI===Ne?ot==="math"&&At[Yt]:!!zr[ot]:de.namespaceURI===ve?Je.namespaceURI===Ne&&!At[Yt]||Je.namespaceURI===Fe&&!Ge[Yt]?!1:!zr[ot]&&(nt[ot]||!nA[ot]):!!(tt==="application/xhtml+xml"&&it[de.namespaceURI]):!1},Tt=function(de){Vo(e.removed,{element:de});try{x(de).removeChild(de)}catch{y(de)}},kt=function(de,Je){try{Vo(e.removed,{attribute:Je.getAttributeNode(de),from:Je})}catch{Vo(e.removed,{attribute:null,from:Je})}if(Je.removeAttribute(de),de==="is")if(Re||Ee)try{Tt(Je)}catch{}else try{Je.setAttribute(de,"")}catch{}},mr=function(de){let Je=null,ot=null;if(Ue)de="<remove></remove>"+de;else{const nr=_g(de,/^[\r\n\t ]+/);ot=nr&&nr[0]}tt==="application/xhtml+xml"&&Qe===ve&&(de='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+de+"</body></html>");const Yt=E?E.createHTML(de):de;if(Qe===ve)try{Je=new h().parseFromString(Yt,tt)}catch{}if(!Je||!Je.documentElement){Je=L.createDocument(Qe,"template",null);try{Je.documentElement.innerHTML=De?Q:Yt}catch{}}const wr=Je.body||Je.documentElement;return de&&ot&&wr.insertBefore(t.createTextNode(ot),wr.childNodes[0]||null),Qe===ve?_.call(Je,R?"html":"body")[0]:R?Je.documentElement:wr},lA=function(de){return S.call(de.ownerDocument||de,de,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},QA=function(de){return de instanceof f&&(typeof de.nodeName!="string"||typeof de.textContent!="string"||typeof de.removeChild!="function"||!(de.attributes instanceof u)||typeof de.removeAttribute!="function"||typeof de.setAttribute!="function"||typeof de.namespaceURI!="string"||typeof de.insertBefore!="function"||typeof de.hasChildNodes!="function")},HA=function(de){return typeof a=="function"&&de instanceof a};function Dr(ft,de,Je){Wc(ft,ot=>{ot.call(e,de,Je,AA)})}const jA=function(de){let Je=null;if(Dr(U.beforeSanitizeElements,de,null),QA(de))return Tt(de),!0;const ot=_t(de.nodeName);if(Dr(U.uponSanitizeElement,de,{tagName:ot,allowedTags:k}),ye&&de.hasChildNodes()&&!HA(de.firstElementChild)&&SA(/<[/\w!]/g,de.innerHTML)&&SA(/<[/\w!]/g,de.textContent)||de.nodeType===Xo.progressingInstruction||ye&&de.nodeType===Xo.comment&&SA(/<[/\w]/g,de.data))return Tt(de),!0;if(!(W.tagCheck instanceof Function&&W.tagCheck(ot))&&(!k[ot]||J[ot])){if(!J[ot]&&NA(ot)&&(Y.tagNameCheck instanceof RegExp&&SA(Y.tagNameCheck,ot)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(ot)))return!1;if(xe&&!ge[ot]){const Yt=x(de)||de.parentNode,wr=B(de)||de.childNodes;if(wr&&Yt){const nr=wr.length;for(let Gr=nr-1;Gr>=0;--Gr){const yr=p(wr[Gr],!0);yr.__removalCount=(de.__removalCount||0)+1,Yt.insertBefore(yr,w(de))}}}return Tt(de),!0}return de instanceof o&&!bA(de)||(ot==="noscript"||ot==="noembed"||ot==="noframes")&&SA(/<\/no(script|embed|frames)/i,de.innerHTML)?(Tt(de),!0):(Be&&de.nodeType===Xo.text&&(Je=de.textContent,Wc([O,M,C],Yt=>{Je=zo(Je,Yt," ")}),de.textContent!==Je&&(Vo(e.removed,{element:de.cloneNode()}),de.textContent=Je)),Dr(U.afterSanitizeElements,de,null),!1)},KA=function(de,Je,ot){if(Me&&(Je==="id"||Je==="name")&&(ot in t||ot in Vr))return!1;if(!(oe&&!q[Je]&&SA(z,Je))){if(!(te&&SA(re,Je))){if(!(W.attributeCheck instanceof Function&&W.attributeCheck(Je,de))){if(!P[Je]||q[Je]){if(!(NA(de)&&(Y.tagNameCheck instanceof RegExp&&SA(Y.tagNameCheck,de)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(de))&&(Y.attributeNameCheck instanceof RegExp&&SA(Y.attributeNameCheck,Je)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(Je,de))||Je==="is"&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&SA(Y.tagNameCheck,ot)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(ot))))return!1}else if(!fe[Je]){if(!SA(V,zo(ot,Z,""))){if(!((Je==="src"||Je==="xlink:href"||Je==="href")&&de!=="script"&&yP(ot,"data:")===0&&Te[de])){if(!(we&&!SA(ne,zo(ot,Z,"")))){if(ot)return!1}}}}}}}return!0},NA=function(de){return de!=="annotation-xml"&&_g(de,Ae)},Jn=function(de){Dr(U.beforeSanitizeAttributes,de,null);const{attributes:Je}=de;if(!Je||QA(de))return;const ot={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0};let Yt=Je.length;for(;Yt--;){const wr=Je[Yt],{name:nr,namespaceURI:Gr,value:yr}=wr,gn=_t(nr),na=yr;let cr=nr==="value"?na:BP(na);if(ot.attrName=gn,ot.attrValue=cr,ot.keepAttr=!0,ot.forceKeepAttr=void 0,Dr(U.uponSanitizeAttribute,de,ot),cr=ot.attrValue,ze&&(gn==="id"||gn==="name")&&(kt(nr,de),cr=Ye+cr),ye&&SA(/((--!?|])>)|<\/(style|title|textarea)/i,cr)){kt(nr,de);continue}if(gn==="attributename"&&_g(cr,"href")){kt(nr,de);continue}if(ot.forceKeepAttr)continue;if(!ot.keepAttr){kt(nr,de);continue}if(!le&&SA(/\/>/i,cr)){kt(nr,de);continue}Be&&Wc([O,M,C],za=>{cr=zo(cr,za," ")});const Va=_t(de.nodeName);if(!KA(Va,gn,cr)){kt(nr,de);continue}if(E&&typeof c=="object"&&typeof c.getAttributeType=="function"&&!Gr)switch(c.getAttributeType(Va,gn)){case"TrustedHTML":{cr=E.createHTML(cr);break}case"TrustedScriptURL":{cr=E.createScriptURL(cr);break}}if(cr!==na)try{Gr?de.setAttributeNS(Gr,nr,cr):de.setAttribute(nr,cr),QA(de)?Tt(de):qx(e.removed)}catch{kt(nr,de)}}Dr(U.afterSanitizeAttributes,de,null)},dn=function ft(de){let Je=null;const ot=lA(de);for(Dr(U.beforeSanitizeShadowDOM,de,null);Je=ot.nextNode();)Dr(U.uponSanitizeShadowNode,Je,null),jA(Je),Jn(Je),Je.content instanceof i&&ft(Je.content);Dr(U.afterSanitizeShadowDOM,de,null)};return e.sanitize=function(ft){let de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Je=null,ot=null,Yt=null,wr=null;if(De=!ft,De&&(ft="<!-->"),typeof ft!="string"&&!HA(ft))if(typeof ft.toString=="function"){if(ft=ft.toString(),typeof ft!="string")throw Go("dirty is not a string, aborting")}else throw Go("toString is not a function");if(!e.isSupported)return ft;if(Ie||Mr(de),e.removed=[],typeof ft=="string"&&(Oe=!1),Oe){if(ft.nodeName){const yr=_t(ft.nodeName);if(!k[yr]||J[yr])throw Go("root node is forbidden and cannot be sanitized in-place")}}else if(ft instanceof a)Je=mr("<!---->"),ot=Je.ownerDocument.importNode(ft,!0),ot.nodeType===Xo.element&&ot.nodeName==="BODY"||ot.nodeName==="HTML"?Je=ot:Je.appendChild(ot);else{if(!Re&&!Be&&!R&&ft.indexOf("<")===-1)return E&&Ve?E.createHTML(ft):ft;if(Je=mr(ft),!Je)return Re?null:Ve?Q:""}Je&&Ue&&Tt(Je.firstChild);const nr=lA(Oe?ft:Je);for(;Yt=nr.nextNode();)jA(Yt),Jn(Yt),Yt.content instanceof i&&dn(Yt.content);if(Oe)return ft;if(Re){if(Ee)for(wr=T.call(Je.ownerDocument);Je.firstChild;)wr.appendChild(Je.firstChild);else wr=Je;return(P.shadowroot||P.shadowrootmode)&&(wr=D.call(A,wr,!0)),wr}let Gr=R?Je.outerHTML:Je.innerHTML;return R&&k["!doctype"]&&Je.ownerDocument&&Je.ownerDocument.doctype&&Je.ownerDocument.doctype.name&&SA(Yx,Je.ownerDocument.doctype.name)&&(Gr="<!DOCTYPE "+Je.ownerDocument.doctype.name+`>
|
|
780
|
-
`+Gr),Be&&Wc([O,M,C],yr=>{Gr=zo(Gr,yr," ")}),E&&Ve?E.createHTML(Gr):Gr},e.setConfig=function(){let ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mr(ft),Ie=!0},e.clearConfig=function(){AA=null,Ie=!1},e.isValidAttribute=function(ft,de,Je){AA||Mr({});const ot=_t(ft),Yt=_t(de);return KA(ot,Yt,Je)},e.addHook=function(ft,de){typeof de=="function"&&Vo(U[ft],de)},e.removeHook=function(ft,de){if(de!==void 0){const Je=mP(U[ft],de);return Je===-1?void 0:wP(U[ft],Je,1)[0]}return qx(U[ft])},e.removeHooks=function(ft){U[ft]=[]},e.removeAllHooks=function(){U=Jx()},e}var PP=Zx();const RP=Object.freeze(Object.defineProperty({__proto__:null,default:PP},Symbol.toStringTag,{value:"Module"}));var e5={},t5={},Yo,r5;function or(){if(r5)return Yo;r5=1;var r=function(e){return e&&e.Math===Math&&e};return Yo=r(typeof globalThis=="object"&&globalThis)||r(typeof window=="object"&&window)||r(typeof self=="object"&&self)||r(typeof $f=="object"&&$f)||r(typeof Yo=="object"&&Yo)||(function(){return this})()||Function("return this")(),Yo}var Tg={},Lg,A5;function gr(){return A5||(A5=1,Lg=function(r){try{return!!r()}catch{return!0}}),Lg}var Pg,n5;function _n(){if(n5)return Pg;n5=1;var r=gr();return Pg=!r(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Pg}var Rg,i5;function $c(){if(i5)return Rg;i5=1;var r=gr();return Rg=!r(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Rg}var Mg,a5;function oA(){if(a5)return Mg;a5=1;var r=$c(),e=Function.prototype.call;return Mg=r?e.bind(e):function(){return e.apply(e,arguments)},Mg}var Dg={},s5;function MP(){if(s5)return Dg;s5=1;var r={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,t=e&&!r.call({1:2},1);return Dg.f=t?function(n){var i=e(this,n);return!!i&&i.enumerable}:r,Dg}var kg,o5;function Hg(){return o5||(o5=1,kg=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}),kg}var jg,l5;function pr(){if(l5)return jg;l5=1;var r=$c(),e=Function.prototype,t=e.call,A=r&&e.bind.bind(t,t);return jg=r?A:function(n){return function(){return t.apply(n,arguments)}},jg}var Kg,u5;function Pa(){if(u5)return Kg;u5=1;var r=pr(),e=r({}.toString),t=r("".slice);return Kg=function(A){return t(e(A),8,-1)},Kg}var qg,c5;function f5(){if(c5)return qg;c5=1;var r=pr(),e=gr(),t=Pa(),A=Object,n=r("".split);return qg=e(function(){return!A("z").propertyIsEnumerable(0)})?function(i){return t(i)==="String"?n(i,""):A(i)}:A,qg}var Vg,h5;function Jc(){return h5||(h5=1,Vg=function(r){return r==null}),Vg}var zg,d5;function In(){if(d5)return zg;d5=1;var r=Jc(),e=TypeError;return zg=function(t){if(r(t))throw new e("Can't call method on "+t);return t},zg}var Gg,g5;function $o(){if(g5)return Gg;g5=1;var r=f5(),e=In();return Gg=function(t){return r(e(t))},Gg}var Wg,p5;function _r(){if(p5)return Wg;p5=1;var r=typeof document=="object"&&document.all;return Wg=typeof r>"u"&&r!==void 0?function(e){return typeof e=="function"||e===r}:function(e){return typeof e=="function"},Wg}var Xg,v5;function DA(){if(v5)return Xg;v5=1;var r=_r();return Xg=function(e){return typeof e=="object"?e!==null:r(e)},Xg}var Yg,m5;function Ra(){if(m5)return Yg;m5=1;var r=or(),e=_r(),t=function(A){return e(A)?A:void 0};return Yg=function(A,n){return arguments.length<2?t(r[A]):r[A]&&r[A][n]},Yg}var $g,w5;function Zc(){if(w5)return $g;w5=1;var r=pr();return $g=r({}.isPrototypeOf),$g}var Jg,y5;function Jo(){if(y5)return Jg;y5=1;var r=or(),e=r.navigator,t=e&&e.userAgent;return Jg=t?String(t):"",Jg}var Zg,B5;function ep(){if(B5)return Zg;B5=1;var r=or(),e=Jo(),t=r.process,A=r.Deno,n=t&&t.versions||A&&A.version,i=n&&n.v8,s,a;return i&&(s=i.split("."),a=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!a&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(a=+s[1]))),Zg=a,Zg}var tp,b5;function x5(){if(b5)return tp;b5=1;var r=ep(),e=gr(),t=or(),A=t.String;return tp=!!Object.getOwnPropertySymbols&&!e(function(){var n=Symbol("symbol detection");return!A(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&r&&r<41}),tp}var rp,C5;function E5(){if(C5)return rp;C5=1;var r=x5();return rp=r&&!Symbol.sham&&typeof Symbol.iterator=="symbol",rp}var Ap,F5;function S5(){if(F5)return Ap;F5=1;var r=Ra(),e=_r(),t=Zc(),A=E5(),n=Object;return Ap=A?function(i){return typeof i=="symbol"}:function(i){var s=r("Symbol");return e(s)&&t(s.prototype,n(i))},Ap}var np,U5;function ef(){if(U5)return np;U5=1;var r=String;return np=function(e){try{return r(e)}catch{return"Object"}},np}var ip,_5;function gi(){if(_5)return ip;_5=1;var r=_r(),e=ef(),t=TypeError;return ip=function(A){if(r(A))return A;throw new t(e(A)+" is not a function")},ip}var ap,I5;function Rs(){if(I5)return ap;I5=1;var r=gi(),e=Jc();return ap=function(t,A){var n=t[A];return e(n)?void 0:r(n)},ap}var sp,Q5;function DP(){if(Q5)return sp;Q5=1;var r=oA(),e=_r(),t=DA(),A=TypeError;return sp=function(n,i){var s,a;if(i==="string"&&e(s=n.toString)&&!t(a=r(s,n))||e(s=n.valueOf)&&!t(a=r(s,n))||i!=="string"&&e(s=n.toString)&&!t(a=r(s,n)))return a;throw new A("Can't convert object to primitive value")},sp}var op={exports:{}},lp,N5;function Yn(){return N5||(N5=1,lp=!1),lp}var up,O5;function cp(){if(O5)return up;O5=1;var r=or(),e=Object.defineProperty;return up=function(t,A){try{e(r,t,{value:A,configurable:!0,writable:!0})}catch{r[t]=A}return A},up}var T5;function fp(){if(T5)return op.exports;T5=1;var r=Yn(),e=or(),t=cp(),A="__core-js_shared__",n=op.exports=e[A]||t(A,{});return(n.versions||(n.versions=[])).push({version:"3.47.0",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"}),op.exports}var hp,L5;function dp(){if(L5)return hp;L5=1;var r=fp();return hp=function(e,t){return r[e]||(r[e]=t||{})},hp}var gp,P5;function tf(){if(P5)return gp;P5=1;var r=In(),e=Object;return gp=function(t){return e(r(t))},gp}var pp,R5;function Qn(){if(R5)return pp;R5=1;var r=pr(),e=tf(),t=r({}.hasOwnProperty);return pp=Object.hasOwn||function(n,i){return t(e(n),i)},pp}var vp,M5;function D5(){if(M5)return vp;M5=1;var r=pr(),e=0,t=Math.random(),A=r(1.1.toString);return vp=function(n){return"Symbol("+(n===void 0?"":n)+")_"+A(++e+t,36)},vp}var mp,k5;function rA(){if(k5)return mp;k5=1;var r=or(),e=dp(),t=Qn(),A=D5(),n=x5(),i=E5(),s=r.Symbol,a=e("wks"),o=i?s.for||s:s&&s.withoutSetter||A;return mp=function(l){return t(a,l)||(a[l]=n&&t(s,l)?s[l]:o("Symbol."+l)),a[l]},mp}var wp,H5;function kP(){if(H5)return wp;H5=1;var r=oA(),e=DA(),t=S5(),A=Rs(),n=DP(),i=rA(),s=TypeError,a=i("toPrimitive");return wp=function(o,l){if(!e(o)||t(o))return o;var u=A(o,a),f;if(u){if(l===void 0&&(l="default"),f=r(u,o,l),!e(f)||t(f))return f;throw new s("Can't convert object to primitive value")}return l===void 0&&(l="number"),n(o,l)},wp}var yp,j5;function K5(){if(j5)return yp;j5=1;var r=kP(),e=S5();return yp=function(t){var A=r(t,"string");return e(A)?A:A+""},yp}var Bp,q5;function rf(){if(q5)return Bp;q5=1;var r=or(),e=DA(),t=r.document,A=e(t)&&e(t.createElement);return Bp=function(n){return A?t.createElement(n):{}},Bp}var bp,V5;function z5(){if(V5)return bp;V5=1;var r=_n(),e=gr(),t=rf();return bp=!r&&!e(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),bp}var G5;function Af(){if(G5)return Tg;G5=1;var r=_n(),e=oA(),t=MP(),A=Hg(),n=$o(),i=K5(),s=Qn(),a=z5(),o=Object.getOwnPropertyDescriptor;return Tg.f=r?o:function(u,f){if(u=n(u),f=i(f),a)try{return o(u,f)}catch{}if(s(u,f))return A(!e(t.f,u,f),u[f])},Tg}var xp={},Cp,W5;function X5(){if(W5)return Cp;W5=1;var r=_n(),e=gr();return Cp=r&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Cp}var Ep,Y5;function _A(){if(Y5)return Ep;Y5=1;var r=DA(),e=String,t=TypeError;return Ep=function(A){if(r(A))return A;throw new t(e(A)+" is not an object")},Ep}var $5;function ea(){if($5)return xp;$5=1;var r=_n(),e=z5(),t=X5(),A=_A(),n=K5(),i=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o="enumerable",l="configurable",u="writable";return xp.f=r?t?function(h,c,g){if(A(h),c=n(c),A(g),typeof h=="function"&&c==="prototype"&&"value"in g&&u in g&&!g[u]){var p=a(h,c);p&&p[u]&&(h[c]=g.value,g={configurable:l in g?g[l]:p[l],enumerable:o in g?g[o]:p[o],writable:!1})}return s(h,c,g)}:s:function(h,c,g){if(A(h),c=n(c),A(g),e)try{return s(h,c,g)}catch{}if("get"in g||"set"in g)throw new i("Accessors not supported");return"value"in g&&(h[c]=g.value),h},xp}var Fp,J5;function Zo(){if(J5)return Fp;J5=1;var r=_n(),e=ea(),t=Hg();return Fp=r?function(A,n,i){return e.f(A,n,t(1,i))}:function(A,n,i){return A[n]=i,A},Fp}var Sp={exports:{}},Up,Z5;function nf(){if(Z5)return Up;Z5=1;var r=_n(),e=Qn(),t=Function.prototype,A=r&&Object.getOwnPropertyDescriptor,n=e(t,"name"),i=n&&(function(){}).name==="something",s=n&&(!r||r&&A(t,"name").configurable);return Up={EXISTS:n,PROPER:i,CONFIGURABLE:s},Up}var _p,eC;function Ip(){if(eC)return _p;eC=1;var r=pr(),e=_r(),t=fp(),A=r(Function.toString);return e(t.inspectSource)||(t.inspectSource=function(n){return A(n)}),_p=t.inspectSource,_p}var Qp,tC;function HP(){if(tC)return Qp;tC=1;var r=or(),e=_r(),t=r.WeakMap;return Qp=e(t)&&/native code/.test(String(t)),Qp}var Np,rC;function Op(){if(rC)return Np;rC=1;var r=dp(),e=D5(),t=r("keys");return Np=function(A){return t[A]||(t[A]=e(A))},Np}var Tp,AC;function Lp(){return AC||(AC=1,Tp={}),Tp}var Pp,nC;function af(){if(nC)return Pp;nC=1;var r=HP(),e=or(),t=DA(),A=Zo(),n=Qn(),i=fp(),s=Op(),a=Lp(),o="Object already initialized",l=e.TypeError,u=e.WeakMap,f,h,c,g=function(B){return c(B)?h(B):f(B,{})},p=function(B){return function(x){var E;if(!t(x)||(E=h(x)).type!==B)throw new l("Incompatible receiver, "+B+" required");return E}};if(r||i.state){var y=i.state||(i.state=new u);y.get=y.get,y.has=y.has,y.set=y.set,f=function(B,x){if(y.has(B))throw new l(o);return x.facade=B,y.set(B,x),x},h=function(B){return y.get(B)||{}},c=function(B){return y.has(B)}}else{var w=s("state");a[w]=!0,f=function(B,x){if(n(B,w))throw new l(o);return x.facade=B,A(B,w,x),x},h=function(B){return n(B,w)?B[w]:{}},c=function(B){return n(B,w)}}return Pp={set:f,get:h,has:c,enforce:g,getterFor:p},Pp}var iC;function aC(){if(iC)return Sp.exports;iC=1;var r=pr(),e=gr(),t=_r(),A=Qn(),n=_n(),i=nf().CONFIGURABLE,s=Ip(),a=af(),o=a.enforce,l=a.get,u=String,f=Object.defineProperty,h=r("".slice),c=r("".replace),g=r([].join),p=n&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),y=String(String).split("String"),w=Sp.exports=function(B,x,E){h(u(x),0,7)==="Symbol("&&(x="["+c(u(x),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),E&&E.getter&&(x="get "+x),E&&E.setter&&(x="set "+x),(!A(B,"name")||i&&B.name!==x)&&(n?f(B,"name",{value:x,configurable:!0}):B.name=x),p&&E&&A(E,"arity")&&B.length!==E.arity&&f(B,"length",{value:E.arity});try{E&&A(E,"constructor")&&E.constructor?n&&f(B,"prototype",{writable:!1}):B.prototype&&(B.prototype=void 0)}catch{}var Q=o(B);return A(Q,"source")||(Q.source=g(y,typeof x=="string"?x:"")),B};return Function.prototype.toString=w(function(){return t(this)&&l(this).source||s(this)},"toString"),Sp.exports}var Rp,sC;function Ma(){if(sC)return Rp;sC=1;var r=_r(),e=ea(),t=aC(),A=cp();return Rp=function(n,i,s,a){a||(a={});var o=a.enumerable,l=a.name!==void 0?a.name:i;if(r(s)&&t(s,l,a),a.global)o?n[i]=s:A(i,s);else{try{a.unsafe?n[i]&&(o=!0):delete n[i]}catch{}o?n[i]=s:e.f(n,i,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return n},Rp}var Mp={},Dp,oC;function jP(){if(oC)return Dp;oC=1;var r=Math.ceil,e=Math.floor;return Dp=Math.trunc||function(A){var n=+A;return(n>0?e:r)(n)},Dp}var kp,lC;function sf(){if(lC)return kp;lC=1;var r=jP();return kp=function(e){var t=+e;return t!==t||t===0?0:r(t)},kp}var Hp,uC;function KP(){if(uC)return Hp;uC=1;var r=sf(),e=Math.max,t=Math.min;return Hp=function(A,n){var i=r(A);return i<0?e(i+n,0):t(i,n)},Hp}var jp,cC;function Ms(){if(cC)return jp;cC=1;var r=sf(),e=Math.min;return jp=function(t){var A=r(t);return A>0?e(A,9007199254740991):0},jp}var Kp,fC;function qp(){if(fC)return Kp;fC=1;var r=Ms();return Kp=function(e){return r(e.length)},Kp}var Vp,hC;function dC(){if(hC)return Vp;hC=1;var r=$o(),e=KP(),t=qp(),A=function(n){return function(i,s,a){var o=r(i),l=t(o);if(l===0)return!n&&-1;var u=e(a,l),f;if(n&&s!==s){for(;l>u;)if(f=o[u++],f!==f)return!0}else for(;l>u;u++)if((n||u in o)&&o[u]===s)return n||u||0;return!n&&-1}};return Vp={includes:A(!0),indexOf:A(!1)},Vp}var zp,gC;function pC(){if(gC)return zp;gC=1;var r=pr(),e=Qn(),t=$o(),A=dC().indexOf,n=Lp(),i=r([].push);return zp=function(s,a){var o=t(s),l=0,u=[],f;for(f in o)!e(n,f)&&e(o,f)&&i(u,f);for(;a.length>l;)e(o,f=a[l++])&&(~A(u,f)||i(u,f));return u},zp}var Gp,vC;function Wp(){return vC||(vC=1,Gp=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Gp}var mC;function qP(){if(mC)return Mp;mC=1;var r=pC(),e=Wp(),t=e.concat("length","prototype");return Mp.f=Object.getOwnPropertyNames||function(n){return r(n,t)},Mp}var Xp={},wC;function VP(){return wC||(wC=1,Xp.f=Object.getOwnPropertySymbols),Xp}var Yp,yC;function zP(){if(yC)return Yp;yC=1;var r=Ra(),e=pr(),t=qP(),A=VP(),n=_A(),i=e([].concat);return Yp=r("Reflect","ownKeys")||function(a){var o=t.f(n(a)),l=A.f;return l?i(o,l(a)):o},Yp}var $p,BC;function GP(){if(BC)return $p;BC=1;var r=Qn(),e=zP(),t=Af(),A=ea();return $p=function(n,i,s){for(var a=e(i),o=A.f,l=t.f,u=0;u<a.length;u++){var f=a[u];!r(n,f)&&!(s&&r(s,f))&&o(n,f,l(i,f))}},$p}var Jp,bC;function xC(){if(bC)return Jp;bC=1;var r=gr(),e=_r(),t=/#|\.prototype\./,A=function(o,l){var u=i[n(o)];return u===a?!0:u===s?!1:e(l)?r(l):!!l},n=A.normalize=function(o){return String(o).replace(t,".").toLowerCase()},i=A.data={},s=A.NATIVE="N",a=A.POLYFILL="P";return Jp=A,Jp}var Zp,CC;function IA(){if(CC)return Zp;CC=1;var r=or(),e=Af().f,t=Zo(),A=Ma(),n=cp(),i=GP(),s=xC();return Zp=function(a,o){var l=a.target,u=a.global,f=a.stat,h,c,g,p,y,w;if(u?c=r:f?c=r[l]||n(l,{}):c=r[l]&&r[l].prototype,c)for(g in o){if(y=o[g],a.dontCallGetSet?(w=e(c,g),p=w&&w.value):p=c[g],h=s(u?g:l+(f?".":"#")+g,a.forced),!h&&p!==void 0){if(typeof y==typeof p)continue;i(y,p)}(a.sham||p&&p.sham)&&t(y,"sham",!0),A(c,g,y,a)}},Zp}var e0,EC;function FC(){if(EC)return e0;EC=1;var r=or(),e=Jo(),t=Pa(),A=function(n){return e.slice(0,n.length)===n};return e0=(function(){return A("Bun/")?"BUN":A("Cloudflare-Workers")?"CLOUDFLARE":A("Deno/")?"DENO":A("Node.js/")?"NODE":r.Bun&&typeof Bun.version=="string"?"BUN":r.Deno&&typeof Deno.version=="object"?"DENO":t(r.process)==="process"?"NODE":r.window&&r.document?"BROWSER":"REST"})(),e0}var t0,SC;function of(){if(SC)return t0;SC=1;var r=FC();return t0=r==="NODE",t0}var r0,UC;function WP(){if(UC)return r0;UC=1;var r=or();return r0=r,r0}var A0,_C;function XP(){if(_C)return A0;_C=1;var r=pr(),e=gi();return A0=function(t,A,n){try{return r(e(Object.getOwnPropertyDescriptor(t,A)[n]))}catch{}},A0}var n0,IC;function YP(){if(IC)return n0;IC=1;var r=DA();return n0=function(e){return r(e)||e===null},n0}var i0,QC;function $P(){if(QC)return i0;QC=1;var r=YP(),e=String,t=TypeError;return i0=function(A){if(r(A))return A;throw new t("Can't set "+e(A)+" as a prototype")},i0}var a0,NC;function OC(){if(NC)return a0;NC=1;var r=XP(),e=DA(),t=In(),A=$P();return a0=Object.setPrototypeOf||("__proto__"in{}?(function(){var n=!1,i={},s;try{s=r(Object.prototype,"__proto__","set"),s(i,[]),n=i instanceof Array}catch{}return function(o,l){return t(o),A(l),e(o)&&(n?s(o,l):o.__proto__=l),o}})():void 0),a0}var s0,TC;function lf(){if(TC)return s0;TC=1;var r=ea().f,e=Qn(),t=rA(),A=t("toStringTag");return s0=function(n,i,s){n&&!s&&(n=n.prototype),n&&!e(n,A)&&r(n,A,{configurable:!0,value:i})},s0}var o0,LC;function JP(){if(LC)return o0;LC=1;var r=aC(),e=ea();return o0=function(t,A,n){return n.get&&r(n.get,A,{getter:!0}),n.set&&r(n.set,A,{setter:!0}),e.f(t,A,n)},o0}var l0,PC;function ZP(){if(PC)return l0;PC=1;var r=Ra(),e=JP(),t=rA(),A=_n(),n=t("species");return l0=function(i){var s=r(i);A&&s&&!s[n]&&e(s,n,{configurable:!0,get:function(){return this}})},l0}var u0,RC;function eR(){if(RC)return u0;RC=1;var r=Zc(),e=TypeError;return u0=function(t,A){if(r(A,t))return t;throw new e("Incorrect invocation")},u0}var c0,MC;function tR(){if(MC)return c0;MC=1;var r=rA(),e=r("toStringTag"),t={};return t[e]="z",c0=String(t)==="[object z]",c0}var f0,DC;function h0(){if(DC)return f0;DC=1;var r=tR(),e=_r(),t=Pa(),A=rA(),n=A("toStringTag"),i=Object,s=t((function(){return arguments})())==="Arguments",a=function(o,l){try{return o[l]}catch{}};return f0=r?t:function(o){var l,u,f;return o===void 0?"Undefined":o===null?"Null":typeof(u=a(l=i(o),n))=="string"?u:s?t(l):(f=t(l))==="Object"&&e(l.callee)?"Arguments":f},f0}var d0,kC;function rR(){if(kC)return d0;kC=1;var r=pr(),e=gr(),t=_r(),A=h0(),n=Ra(),i=Ip(),s=function(){},a=n("Reflect","construct"),o=/^\s*(?:class|function)\b/,l=r(o.exec),u=!o.test(s),f=function(g){if(!t(g))return!1;try{return a(s,[],g),!0}catch{return!1}},h=function(g){if(!t(g))return!1;switch(A(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return u||!!l(o,i(g))}catch{return!0}};return h.sham=!0,d0=!a||e(function(){var c;return f(f.call)||!f(Object)||!f(function(){c=!0})||c})?h:f,d0}var g0,HC;function AR(){if(HC)return g0;HC=1;var r=rR(),e=ef(),t=TypeError;return g0=function(A){if(r(A))return A;throw new t(e(A)+" is not a constructor")},g0}var p0,jC;function KC(){if(jC)return p0;jC=1;var r=_A(),e=AR(),t=Jc(),A=rA(),n=A("species");return p0=function(i,s){var a=r(i).constructor,o;return a===void 0||t(o=r(a)[n])?s:e(o)},p0}var v0,qC;function VC(){if(qC)return v0;qC=1;var r=$c(),e=Function.prototype,t=e.apply,A=e.call;return v0=typeof Reflect=="object"&&Reflect.apply||(r?A.bind(t):function(){return A.apply(t,arguments)}),v0}var m0,zC;function uf(){if(zC)return m0;zC=1;var r=Pa(),e=pr();return m0=function(t){if(r(t)==="Function")return e(t)},m0}var w0,GC;function y0(){if(GC)return w0;GC=1;var r=uf(),e=gi(),t=$c(),A=r(r.bind);return w0=function(n,i){return e(n),i===void 0?n:t?A(n,i):function(){return n.apply(i,arguments)}},w0}var B0,WC;function XC(){if(WC)return B0;WC=1;var r=Ra();return B0=r("document","documentElement"),B0}var b0,YC;function nR(){if(YC)return b0;YC=1;var r=pr();return b0=r([].slice),b0}var x0,$C;function iR(){if($C)return x0;$C=1;var r=TypeError;return x0=function(e,t){if(e<t)throw new r("Not enough arguments");return e},x0}var C0,JC;function ZC(){if(JC)return C0;JC=1;var r=Jo();return C0=/(?:ipad|iphone|ipod).*applewebkit/i.test(r),C0}var E0,eE;function tE(){if(eE)return E0;eE=1;var r=or(),e=VC(),t=y0(),A=_r(),n=Qn(),i=gr(),s=XC(),a=nR(),o=rf(),l=iR(),u=ZC(),f=of(),h=r.setImmediate,c=r.clearImmediate,g=r.process,p=r.Dispatch,y=r.Function,w=r.MessageChannel,B=r.String,x=0,E={},Q="onreadystatechange",L,S,T,_;i(function(){L=r.location});var D=function(C){if(n(E,C)){var z=E[C];delete E[C],z()}},U=function(C){return function(){D(C)}},O=function(C){D(C.data)},M=function(C){r.postMessage(B(C),L.protocol+"//"+L.host)};return(!h||!c)&&(h=function(z){l(arguments.length,1);var re=A(z)?z:y(z),ne=a(arguments,1);return E[++x]=function(){e(re,void 0,ne)},S(x),x},c=function(z){delete E[z]},f?S=function(C){g.nextTick(U(C))}:p&&p.now?S=function(C){p.now(U(C))}:w&&!u?(T=new w,_=T.port2,T.port1.onmessage=O,S=t(_.postMessage,_)):r.addEventListener&&A(r.postMessage)&&!r.importScripts&&L&&L.protocol!=="file:"&&!i(M)?(S=M,r.addEventListener("message",O,!1)):Q in o("script")?S=function(C){s.appendChild(o("script"))[Q]=function(){s.removeChild(this),D(C)}}:S=function(C){setTimeout(U(C),0)}),E0={set:h,clear:c},E0}var F0,rE;function aR(){if(rE)return F0;rE=1;var r=or(),e=_n(),t=Object.getOwnPropertyDescriptor;return F0=function(A){if(!e)return r[A];var n=t(r,A);return n&&n.value},F0}var S0,AE;function nE(){if(AE)return S0;AE=1;var r=function(){this.head=null,this.tail=null};return r.prototype={add:function(e){var t={item:e,next:null},A=this.tail;A?A.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e){var t=this.head=e.next;return t===null&&(this.tail=null),e.item}}},S0=r,S0}var U0,iE;function sR(){if(iE)return U0;iE=1;var r=Jo();return U0=/ipad|iphone|ipod/i.test(r)&&typeof Pebble<"u",U0}var _0,aE;function oR(){if(aE)return _0;aE=1;var r=Jo();return _0=/web0s(?!.*chrome)/i.test(r),_0}var I0,sE;function lR(){if(sE)return I0;sE=1;var r=or(),e=aR(),t=y0(),A=tE().set,n=nE(),i=ZC(),s=sR(),a=oR(),o=of(),l=r.MutationObserver||r.WebKitMutationObserver,u=r.document,f=r.process,h=r.Promise,c=e("queueMicrotask"),g,p,y,w,B;if(!c){var x=new n,E=function(){var Q,L;for(o&&(Q=f.domain)&&Q.exit();L=x.get();)try{L()}catch(S){throw x.head&&g(),S}Q&&Q.enter()};!i&&!o&&!a&&l&&u?(p=!0,y=u.createTextNode(""),new l(E).observe(y,{characterData:!0}),g=function(){y.data=p=!p}):!s&&h&&h.resolve?(w=h.resolve(void 0),w.constructor=h,B=t(w.then,w),g=function(){B(E)}):o?g=function(){f.nextTick(E)}:(A=t(A,r),g=function(){A(E)}),c=function(Q){x.head||g(),x.add(Q)}}return I0=c,I0}var Q0,oE;function uR(){return oE||(oE=1,Q0=function(r,e){try{arguments.length===1?console.error(r):console.error(r,e)}catch{}}),Q0}var N0,lE;function O0(){return lE||(lE=1,N0=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}),N0}var T0,uE;function el(){if(uE)return T0;uE=1;var r=or();return T0=r.Promise,T0}var L0,cE;function tl(){if(cE)return L0;cE=1;var r=or(),e=el(),t=_r(),A=xC(),n=Ip(),i=rA(),s=FC(),a=Yn(),o=ep(),l=e&&e.prototype,u=i("species"),f=!1,h=t(r.PromiseRejectionEvent),c=A("Promise",function(){var g=n(e),p=g!==String(e);if(!p&&o===66||a&&!(l.catch&&l.finally))return!0;if(!o||o<51||!/native code/.test(g)){var y=new e(function(x){x(1)}),w=function(x){x(function(){},function(){})},B=y.constructor={};if(B[u]=w,f=y.then(function(){})instanceof w,!f)return!0}return!p&&(s==="BROWSER"||s==="DENO")&&!h});return L0={CONSTRUCTOR:c,REJECTION_EVENT:h,SUBCLASSING:f},L0}var P0={},fE;function rl(){if(fE)return P0;fE=1;var r=gi(),e=TypeError,t=function(A){var n,i;this.promise=new A(function(s,a){if(n!==void 0||i!==void 0)throw new e("Bad Promise constructor");n=s,i=a}),this.resolve=r(n),this.reject=r(i)};return P0.f=function(A){return new t(A)},P0}var hE;function cR(){if(hE)return t5;hE=1;var r=IA(),e=Yn(),t=of(),A=or(),n=WP(),i=oA(),s=Ma(),a=OC(),o=lf(),l=ZP(),u=gi(),f=_r(),h=DA(),c=eR(),g=KC(),p=tE().set,y=lR(),w=uR(),B=O0(),x=nE(),E=af(),Q=el(),L=tl(),S=rl(),T="Promise",_=L.CONSTRUCTOR,D=L.REJECTION_EVENT,U=L.SUBCLASSING,O=E.getterFor(T),M=E.set,C=Q&&Q.prototype,z=Q,re=C,ne=A.TypeError,Z=A.document,Ae=A.process,V=S.f,k=V,I=!!(Z&&Z.createEvent&&A.dispatchEvent),P="unhandledrejection",K="rejectionhandled",Y=0,J=1,q=2,W=1,te=2,oe,we,le,Be,ye=function(xe){var Oe;return h(xe)&&f(Oe=xe.then)?Oe:!1},R=function(xe,Oe){var je=Oe.value,ge=Oe.state===J,Pe=ge?xe.ok:xe.fail,Te=xe.resolve,ue=xe.reject,fe=xe.domain,Le,Fe,Ne;try{Pe?(ge||(Oe.rejection===te&&Ve(Oe),Oe.rejection=W),Pe===!0?Le=je:(fe&&fe.enter(),Le=Pe(je),fe&&(fe.exit(),Ne=!0)),Le===xe.promise?ue(new ne("Promise-chain cycle")):(Fe=ye(Le))?i(Fe,Le,Te,ue):Te(Le)):ue(je)}catch(ve){fe&&!Ne&&fe.exit(),ue(ve)}},Ie=function(xe,Oe){xe.notified||(xe.notified=!0,y(function(){for(var je=xe.reactions,ge;ge=je.get();)R(ge,xe);xe.notified=!1,Oe&&!xe.rejection&&Re(xe)}))},Ue=function(xe,Oe,je){var ge,Pe;I?(ge=Z.createEvent("Event"),ge.promise=Oe,ge.reason=je,ge.initEvent(xe,!1,!0),A.dispatchEvent(ge)):ge={promise:Oe,reason:je},!D&&(Pe=A["on"+xe])?Pe(ge):xe===P&&w("Unhandled promise rejection",je)},Re=function(xe){i(p,A,function(){var Oe=xe.facade,je=xe.value,ge=Ee(xe),Pe;if(ge&&(Pe=B(function(){t?Ae.emit("unhandledRejection",je,Oe):Ue(P,Oe,je)}),xe.rejection=t||Ee(xe)?te:W,Pe.error))throw Pe.value})},Ee=function(xe){return xe.rejection!==W&&!xe.parent},Ve=function(xe){i(p,A,function(){var Oe=xe.facade;t?Ae.emit("rejectionHandled",Oe):Ue(K,Oe,xe.value)})},Me=function(xe,Oe,je){return function(ge){xe(Oe,ge,je)}},ze=function(xe,Oe,je){xe.done||(xe.done=!0,je&&(xe=je),xe.value=Oe,xe.state=q,Ie(xe,!0))},Ye=function(xe,Oe,je){if(!xe.done){xe.done=!0,je&&(xe=je);try{if(xe.facade===Oe)throw new ne("Promise can't be resolved itself");var ge=ye(Oe);ge?y(function(){var Pe={done:!1};try{i(ge,Oe,Me(Ye,Pe,xe),Me(ze,Pe,xe))}catch(Te){ze(Pe,Te,xe)}}):(xe.value=Oe,xe.state=J,Ie(xe,!1))}catch(Pe){ze({done:!1},Pe,xe)}}};if(_&&(z=function(Oe){c(this,re),u(Oe),i(oe,this);var je=O(this);try{Oe(Me(Ye,je),Me(ze,je))}catch(ge){ze(je,ge)}},re=z.prototype,oe=function(Oe){M(this,{type:T,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:Y,value:null})},oe.prototype=s(re,"then",function(Oe,je){var ge=O(this),Pe=V(g(this,z));return ge.parent=!0,Pe.ok=f(Oe)?Oe:!0,Pe.fail=f(je)&&je,Pe.domain=t?Ae.domain:void 0,ge.state===Y?ge.reactions.add(Pe):y(function(){R(Pe,ge)}),Pe.promise}),we=function(){var xe=new oe,Oe=O(xe);this.promise=xe,this.resolve=Me(Ye,Oe),this.reject=Me(ze,Oe)},S.f=V=function(xe){return xe===z||xe===le?new we(xe):k(xe)},!e&&f(Q)&&C!==Object.prototype)){Be=C.then,U||s(C,"then",function(Oe,je){var ge=this;return new z(function(Pe,Te){i(Be,ge,Pe,Te)}).then(Oe,je)},{unsafe:!0});try{delete C.constructor}catch{}a&&a(C,re)}return r({global:!0,constructor:!0,wrap:!0,forced:_},{Promise:z}),le=n.Promise,o(z,T,!1,!0),l(T),t5}var dE={},R0,gE;function Al(){return gE||(gE=1,R0={}),R0}var M0,pE;function fR(){if(pE)return M0;pE=1;var r=rA(),e=Al(),t=r("iterator"),A=Array.prototype;return M0=function(n){return n!==void 0&&(e.Array===n||A[t]===n)},M0}var D0,vE;function mE(){if(vE)return D0;vE=1;var r=h0(),e=Rs(),t=Jc(),A=Al(),n=rA(),i=n("iterator");return D0=function(s){if(!t(s))return e(s,i)||e(s,"@@iterator")||A[r(s)]},D0}var k0,wE;function hR(){if(wE)return k0;wE=1;var r=oA(),e=gi(),t=_A(),A=ef(),n=mE(),i=TypeError;return k0=function(s,a){var o=arguments.length<2?n(s):a;if(e(o))return t(r(o,s));throw new i(A(s)+" is not iterable")},k0}var H0,yE;function dR(){if(yE)return H0;yE=1;var r=oA(),e=_A(),t=Rs();return H0=function(A,n,i){var s,a;e(A);try{if(s=t(A,"return"),!s){if(n==="throw")throw i;return i}s=r(s,A)}catch(o){a=!0,s=o}if(n==="throw")throw i;if(a)throw s;return e(s),i},H0}var j0,BE;function bE(){if(BE)return j0;BE=1;var r=y0(),e=oA(),t=_A(),A=ef(),n=fR(),i=qp(),s=Zc(),a=hR(),o=mE(),l=dR(),u=TypeError,f=function(c,g){this.stopped=c,this.result=g},h=f.prototype;return j0=function(c,g,p){var y=p&&p.that,w=!!(p&&p.AS_ENTRIES),B=!!(p&&p.IS_RECORD),x=!!(p&&p.IS_ITERATOR),E=!!(p&&p.INTERRUPTED),Q=r(g,y),L,S,T,_,D,U,O,M=function(z){return L&&l(L,"normal"),new f(!0,z)},C=function(z){return w?(t(z),E?Q(z[0],z[1],M):Q(z[0],z[1])):E?Q(z,M):Q(z)};if(B)L=c.iterator;else if(x)L=c;else{if(S=o(c),!S)throw new u(A(c)+" is not iterable");if(n(S)){for(T=0,_=i(c);_>T;T++)if(D=C(c[T]),D&&s(h,D))return D;return new f(!1)}L=a(c,S)}for(U=B?c.next:L.next;!(O=e(U,L)).done;){try{D=C(O.value)}catch(z){l(L,"throw",z)}if(typeof D=="object"&&D&&s(h,D))return D}return new f(!1)},j0}var K0,xE;function gR(){if(xE)return K0;xE=1;var r=rA(),e=r("iterator"),t=!1;try{var A=0,n={next:function(){return{done:!!A++}},return:function(){t=!0}};n[e]=function(){return this},Array.from(n,function(){throw 2})}catch{}return K0=function(i,s){try{if(!s&&!t)return!1}catch{return!1}var a=!1;try{var o={};o[e]=function(){return{next:function(){return{done:a=!0}}}},i(o)}catch{}return a},K0}var q0,CE;function EE(){if(CE)return q0;CE=1;var r=el(),e=gR(),t=tl().CONSTRUCTOR;return q0=t||!e(function(A){r.all(A).then(void 0,function(){})}),q0}var FE;function pR(){if(FE)return dE;FE=1;var r=IA(),e=oA(),t=gi(),A=rl(),n=O0(),i=bE(),s=EE();return r({target:"Promise",stat:!0,forced:s},{all:function(o){var l=this,u=A.f(l),f=u.resolve,h=u.reject,c=n(function(){var g=t(l.resolve),p=[],y=0,w=1;i(o,function(B){var x=y++,E=!1;w++,e(g,l,B).then(function(Q){E||(E=!0,p[x]=Q,--w||f(p))},h)}),--w||f(p)});return c.error&&h(c.value),u.promise}}),dE}var SE={},UE;function vR(){if(UE)return SE;UE=1;var r=IA(),e=Yn(),t=tl().CONSTRUCTOR,A=el(),n=Ra(),i=_r(),s=Ma(),a=A&&A.prototype;if(r({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(l){return this.then(void 0,l)}}),!e&&i(A)){var o=n("Promise").prototype.catch;a.catch!==o&&s(a,"catch",o,{unsafe:!0})}return SE}var _E={},IE;function mR(){if(IE)return _E;IE=1;var r=IA(),e=oA(),t=gi(),A=rl(),n=O0(),i=bE(),s=EE();return r({target:"Promise",stat:!0,forced:s},{race:function(o){var l=this,u=A.f(l),f=u.reject,h=n(function(){var c=t(l.resolve);i(o,function(g){e(c,l,g).then(u.resolve,f)})});return h.error&&f(h.value),u.promise}}),_E}var QE={},NE;function wR(){if(NE)return QE;NE=1;var r=IA(),e=rl(),t=tl().CONSTRUCTOR;return r({target:"Promise",stat:!0,forced:t},{reject:function(n){var i=e.f(this),s=i.reject;return s(n),i.promise}}),QE}var OE={},V0,TE;function yR(){if(TE)return V0;TE=1;var r=_A(),e=DA(),t=rl();return V0=function(A,n){if(r(A),e(n)&&n.constructor===A)return n;var i=t.f(A),s=i.resolve;return s(n),i.promise},V0}var LE;function BR(){if(LE)return OE;LE=1;var r=IA(),e=Ra(),t=Yn(),A=el(),n=tl().CONSTRUCTOR,i=yR(),s=e("Promise"),a=t&&!n;return r({target:"Promise",stat:!0,forced:t||n},{resolve:function(l){return i(a&&this===s?A:this,l)}}),OE}var PE;function bR(){return PE||(PE=1,cR(),pR(),vR(),mR(),wR(),BR()),e5}bR();function RE(r,e,t,A,n,i,s){try{var a=r[i](s),o=a.value}catch(l){return void t(l)}a.done?e(o):Promise.resolve(o).then(A,n)}function pi(r){return function(){var e=this,t=arguments;return new Promise(function(A,n){var i=r.apply(e,t);function s(o){RE(i,A,n,s,a,"next",o)}function a(o){RE(i,A,n,s,a,"throw",o)}s(void 0)})}}var ME={},DE={},z0,kE;function $n(){if(kE)return z0;kE=1;var r=h0(),e=String;return z0=function(t){if(r(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(t)},z0}var G0,HE;function jE(){if(HE)return G0;HE=1;var r=_A();return G0=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},G0}var W0,KE;function qE(){if(KE)return W0;KE=1;var r=gr(),e=or(),t=e.RegExp,A=r(function(){var s=t("a","y");return s.lastIndex=2,s.exec("abcd")!==null}),n=A||r(function(){return!t("a","y").sticky}),i=A||r(function(){var s=t("^r","gy");return s.lastIndex=2,s.exec("str")!==null});return W0={BROKEN_CARET:i,MISSED_STICKY:n,UNSUPPORTED_Y:A},W0}var X0={},Y0,VE;function xR(){if(VE)return Y0;VE=1;var r=pC(),e=Wp();return Y0=Object.keys||function(A){return r(A,e)},Y0}var zE;function CR(){if(zE)return X0;zE=1;var r=_n(),e=X5(),t=ea(),A=_A(),n=$o(),i=xR();return X0.f=r&&!e?Object.defineProperties:function(a,o){A(a);for(var l=n(o),u=i(o),f=u.length,h=0,c;f>h;)t.f(a,c=u[h++],l[c]);return a},X0}var $0,GE;function cf(){if(GE)return $0;GE=1;var r=_A(),e=CR(),t=Wp(),A=Lp(),n=XC(),i=rf(),s=Op(),a=">",o="<",l="prototype",u="script",f=s("IE_PROTO"),h=function(){},c=function(B){return o+u+a+B+o+"/"+u+a},g=function(B){B.write(c("")),B.close();var x=B.parentWindow.Object;return B=null,x},p=function(){var B=i("iframe"),x="java"+u+":",E;return B.style.display="none",n.appendChild(B),B.src=String(x),E=B.contentWindow.document,E.open(),E.write(c("document.F=Object")),E.close(),E.F},y,w=function(){try{y=new ActiveXObject("htmlfile")}catch{}w=typeof document<"u"?document.domain&&y?g(y):p():g(y);for(var B=t.length;B--;)delete w[l][t[B]];return w()};return A[f]=!0,$0=Object.create||function(x,E){var Q;return x!==null?(h[l]=r(x),Q=new h,h[l]=null,Q[f]=x):Q=w(),E===void 0?Q:e.f(Q,E)},$0}var J0,WE;function ER(){if(WE)return J0;WE=1;var r=gr(),e=or(),t=e.RegExp;return J0=r(function(){var A=t(".","s");return!(A.dotAll&&A.test(`
|
|
779
|
+
</html>`}function dP(r){const e=Hx(r),t=window.open("","_blank");t&&(t.document.write(e),t.document.close(),t.onload=()=>{t.print()})}/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:jx,setPrototypeOf:Kx,isFrozen:gP,getPrototypeOf:pP,getOwnPropertyDescriptor:vP}=Object;let{freeze:FA,seal:fn,create:Eg}=Object,{apply:Fg,construct:Sg}=typeof Reflect<"u"&&Reflect;FA||(FA=function(e){return e}),fn||(fn=function(e){return e}),Fg||(Fg=function(e,t){for(var A=arguments.length,n=new Array(A>2?A-2:0),i=2;i<A;i++)n[i-2]=arguments[i];return e.apply(t,n)}),Sg||(Sg=function(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),n=1;n<t;n++)A[n-1]=arguments[n];return new e(...A)});const Wc=UA(Array.prototype.forEach),mP=UA(Array.prototype.lastIndexOf),qx=UA(Array.prototype.pop),Vo=UA(Array.prototype.push),wP=UA(Array.prototype.splice),Xc=UA(String.prototype.toLowerCase),Ug=UA(String.prototype.toString),_g=UA(String.prototype.match),zo=UA(String.prototype.replace),yP=UA(String.prototype.indexOf),BP=UA(String.prototype.trim),Un=UA(Object.prototype.hasOwnProperty),SA=UA(RegExp.prototype.test),Go=bP(TypeError);function UA(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,A=new Array(t>1?t-1:0),n=1;n<t;n++)A[n-1]=arguments[n];return Fg(r,e,A)}}function bP(r){return function(){for(var e=arguments.length,t=new Array(e),A=0;A<e;A++)t[A]=arguments[A];return Sg(r,t)}}function Nt(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xc;Kx&&Kx(r,null);let A=e.length;for(;A--;){let n=e[A];if(typeof n=="string"){const i=t(n);i!==n&&(gP(e)||(e[A]=i),n=i)}r[n]=!0}return r}function xP(r){for(let e=0;e<r.length;e++)Un(r,e)||(r[e]=null);return r}function Xn(r){const e=Eg(null);for(const[t,A]of jx(r))Un(r,t)&&(Array.isArray(A)?e[t]=xP(A):A&&typeof A=="object"&&A.constructor===Object?e[t]=Xn(A):e[t]=A);return e}function Wo(r,e){for(;r!==null;){const A=vP(r,e);if(A){if(A.get)return UA(A.get);if(typeof A.value=="function")return UA(A.value)}r=pP(r)}function t(){return null}return t}const Vx=FA(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ig=FA(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Qg=FA(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),CP=FA(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ng=FA(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),EP=FA(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zx=FA(["#text"]),Gx=FA(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Og=FA(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wx=FA(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Yc=FA(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),FP=fn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),SP=fn(/<%[\w\W]*|[\w\W]*%>/gm),UP=fn(/\$\{[\w\W]*/gm),_P=fn(/^data-[\-\w.\u00B7-\uFFFF]+$/),IP=fn(/^aria-[\-\w]+$/),Xx=fn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),QP=fn(/^(?:\w+script|data):/i),NP=fn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yx=fn(/^html$/i),OP=fn(/^[a-z][.\w]*(-[.\w]+)+$/i);var $x=Object.freeze({__proto__:null,ARIA_ATTR:IP,ATTR_WHITESPACE:NP,CUSTOM_ELEMENT:OP,DATA_ATTR:_P,DOCTYPE_NAME:Yx,ERB_EXPR:SP,IS_ALLOWED_URI:Xx,IS_SCRIPT_OR_DATA:QP,MUSTACHE_EXPR:FP,TMPLIT_EXPR:UP});const Xo={element:1,text:3,progressingInstruction:7,comment:8,document:9},TP=function(){return typeof window>"u"?null:window},LP=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let A=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(A=t.getAttribute(n));const i="dompurify"+(A?"#"+A:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Jx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Zx(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:TP();const e=ft=>Zx(ft);if(e.version="3.3.1",e.removed=[],!r||!r.document||r.document.nodeType!==Xo.document||!r.Element)return e.isSupported=!1,e;let{document:t}=r;const A=t,n=A.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:o,NodeFilter:l,NamedNodeMap:u=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:c}=r,g=o.prototype,p=Wo(g,"cloneNode"),y=Wo(g,"remove"),w=Wo(g,"nextSibling"),B=Wo(g,"childNodes"),x=Wo(g,"parentNode");if(typeof s=="function"){const ft=t.createElement("template");ft.content&&ft.content.ownerDocument&&(t=ft.content.ownerDocument)}let E,Q="";const{implementation:L,createNodeIterator:S,createDocumentFragment:T,getElementsByTagName:_}=t,{importNode:D}=A;let U=Jx();e.isSupported=typeof jx=="function"&&typeof x=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:M,TMPLIT_EXPR:C,DATA_ATTR:z,ARIA_ATTR:re,IS_SCRIPT_OR_DATA:ne,ATTR_WHITESPACE:Z,CUSTOM_ELEMENT:Ae}=$x;let{IS_ALLOWED_URI:V}=$x,k=null;const I=Nt({},[...Vx,...Ig,...Qg,...Ng,...zx]);let P=null;const K=Nt({},[...Gx,...Og,...Wx,...Yc]);let Y=Object.seal(Eg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),J=null,q=null;const W=Object.seal(Eg(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let te=!0,oe=!0,we=!1,le=!0,Be=!1,ye=!0,R=!1,Ie=!1,Ue=!1,Te=!1,Ee=!1,Ve=!1,Me=!0,ze=!1;const Ye="user-content-";let xe=!0,Oe=!1,je={},ge=null;const Re=Nt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Le=null;const ue=Nt({},["audio","video","img","source","image","track"]);let fe=null;const Pe=Nt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fe="http://www.w3.org/1998/Math/MathML",Ne="http://www.w3.org/2000/svg",ve="http://www.w3.org/1999/xhtml";let Qe=ve,De=!1,it=null;const et=Nt({},[Fe,Ne,ve],Ug);let Ge=Nt({},["mi","mo","mn","ms","mtext"]),At=Nt({},["annotation-xml"]);const nt=Nt({},["title","style","font","a","script"]);let tt=null;const lt=["application/xhtml+xml","text/html"],ur="text/html";let _t=null,AA=null;const Vr=t.createElement("form"),Bt=function(de){return de instanceof RegExp||de instanceof Function},Mr=function(){let de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(AA&&AA===de)){if((!de||typeof de!="object")&&(de={}),de=Xn(de),tt=lt.indexOf(de.PARSER_MEDIA_TYPE)===-1?ur:de.PARSER_MEDIA_TYPE,_t=tt==="application/xhtml+xml"?Ug:Xc,k=Un(de,"ALLOWED_TAGS")?Nt({},de.ALLOWED_TAGS,_t):I,P=Un(de,"ALLOWED_ATTR")?Nt({},de.ALLOWED_ATTR,_t):K,it=Un(de,"ALLOWED_NAMESPACES")?Nt({},de.ALLOWED_NAMESPACES,Ug):et,fe=Un(de,"ADD_URI_SAFE_ATTR")?Nt(Xn(Pe),de.ADD_URI_SAFE_ATTR,_t):Pe,Le=Un(de,"ADD_DATA_URI_TAGS")?Nt(Xn(ue),de.ADD_DATA_URI_TAGS,_t):ue,ge=Un(de,"FORBID_CONTENTS")?Nt({},de.FORBID_CONTENTS,_t):Re,J=Un(de,"FORBID_TAGS")?Nt({},de.FORBID_TAGS,_t):Xn({}),q=Un(de,"FORBID_ATTR")?Nt({},de.FORBID_ATTR,_t):Xn({}),je=Un(de,"USE_PROFILES")?de.USE_PROFILES:!1,te=de.ALLOW_ARIA_ATTR!==!1,oe=de.ALLOW_DATA_ATTR!==!1,we=de.ALLOW_UNKNOWN_PROTOCOLS||!1,le=de.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Be=de.SAFE_FOR_TEMPLATES||!1,ye=de.SAFE_FOR_XML!==!1,R=de.WHOLE_DOCUMENT||!1,Te=de.RETURN_DOM||!1,Ee=de.RETURN_DOM_FRAGMENT||!1,Ve=de.RETURN_TRUSTED_TYPE||!1,Ue=de.FORCE_BODY||!1,Me=de.SANITIZE_DOM!==!1,ze=de.SANITIZE_NAMED_PROPS||!1,xe=de.KEEP_CONTENT!==!1,Oe=de.IN_PLACE||!1,V=de.ALLOWED_URI_REGEXP||Xx,Qe=de.NAMESPACE||ve,Ge=de.MATHML_TEXT_INTEGRATION_POINTS||Ge,At=de.HTML_INTEGRATION_POINTS||At,Y=de.CUSTOM_ELEMENT_HANDLING||{},de.CUSTOM_ELEMENT_HANDLING&&Bt(de.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Y.tagNameCheck=de.CUSTOM_ELEMENT_HANDLING.tagNameCheck),de.CUSTOM_ELEMENT_HANDLING&&Bt(de.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Y.attributeNameCheck=de.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),de.CUSTOM_ELEMENT_HANDLING&&typeof de.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Y.allowCustomizedBuiltInElements=de.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Be&&(oe=!1),Ee&&(Te=!0),je&&(k=Nt({},zx),P=[],je.html===!0&&(Nt(k,Vx),Nt(P,Gx)),je.svg===!0&&(Nt(k,Ig),Nt(P,Og),Nt(P,Yc)),je.svgFilters===!0&&(Nt(k,Qg),Nt(P,Og),Nt(P,Yc)),je.mathMl===!0&&(Nt(k,Ng),Nt(P,Wx),Nt(P,Yc))),de.ADD_TAGS&&(typeof de.ADD_TAGS=="function"?W.tagCheck=de.ADD_TAGS:(k===I&&(k=Xn(k)),Nt(k,de.ADD_TAGS,_t))),de.ADD_ATTR&&(typeof de.ADD_ATTR=="function"?W.attributeCheck=de.ADD_ATTR:(P===K&&(P=Xn(P)),Nt(P,de.ADD_ATTR,_t))),de.ADD_URI_SAFE_ATTR&&Nt(fe,de.ADD_URI_SAFE_ATTR,_t),de.FORBID_CONTENTS&&(ge===Re&&(ge=Xn(ge)),Nt(ge,de.FORBID_CONTENTS,_t)),de.ADD_FORBID_CONTENTS&&(ge===Re&&(ge=Xn(ge)),Nt(ge,de.ADD_FORBID_CONTENTS,_t)),xe&&(k["#text"]=!0),R&&Nt(k,["html","head","body"]),k.table&&(Nt(k,["tbody"]),delete J.tbody),de.TRUSTED_TYPES_POLICY){if(typeof de.TRUSTED_TYPES_POLICY.createHTML!="function")throw Go('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof de.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Go('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=de.TRUSTED_TYPES_POLICY,Q=E.createHTML("")}else E===void 0&&(E=LP(c,n)),E!==null&&typeof Q=="string"&&(Q=E.createHTML(""));FA&&FA(de),AA=de}},nA=Nt({},[...Ig,...Qg,...CP]),zr=Nt({},[...Ng,...EP]),bA=function(de){let Je=x(de);(!Je||!Je.tagName)&&(Je={namespaceURI:Qe,tagName:"template"});const ot=Xc(de.tagName),Yt=Xc(Je.tagName);return it[de.namespaceURI]?de.namespaceURI===Ne?Je.namespaceURI===ve?ot==="svg":Je.namespaceURI===Fe?ot==="svg"&&(Yt==="annotation-xml"||Ge[Yt]):!!nA[ot]:de.namespaceURI===Fe?Je.namespaceURI===ve?ot==="math":Je.namespaceURI===Ne?ot==="math"&&At[Yt]:!!zr[ot]:de.namespaceURI===ve?Je.namespaceURI===Ne&&!At[Yt]||Je.namespaceURI===Fe&&!Ge[Yt]?!1:!zr[ot]&&(nt[ot]||!nA[ot]):!!(tt==="application/xhtml+xml"&&it[de.namespaceURI]):!1},Tt=function(de){Vo(e.removed,{element:de});try{x(de).removeChild(de)}catch{y(de)}},kt=function(de,Je){try{Vo(e.removed,{attribute:Je.getAttributeNode(de),from:Je})}catch{Vo(e.removed,{attribute:null,from:Je})}if(Je.removeAttribute(de),de==="is")if(Te||Ee)try{Tt(Je)}catch{}else try{Je.setAttribute(de,"")}catch{}},mr=function(de){let Je=null,ot=null;if(Ue)de="<remove></remove>"+de;else{const nr=_g(de,/^[\r\n\t ]+/);ot=nr&&nr[0]}tt==="application/xhtml+xml"&&Qe===ve&&(de='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+de+"</body></html>");const Yt=E?E.createHTML(de):de;if(Qe===ve)try{Je=new h().parseFromString(Yt,tt)}catch{}if(!Je||!Je.documentElement){Je=L.createDocument(Qe,"template",null);try{Je.documentElement.innerHTML=De?Q:Yt}catch{}}const wr=Je.body||Je.documentElement;return de&&ot&&wr.insertBefore(t.createTextNode(ot),wr.childNodes[0]||null),Qe===ve?_.call(Je,R?"html":"body")[0]:R?Je.documentElement:wr},lA=function(de){return S.call(de.ownerDocument||de,de,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},QA=function(de){return de instanceof f&&(typeof de.nodeName!="string"||typeof de.textContent!="string"||typeof de.removeChild!="function"||!(de.attributes instanceof u)||typeof de.removeAttribute!="function"||typeof de.setAttribute!="function"||typeof de.namespaceURI!="string"||typeof de.insertBefore!="function"||typeof de.hasChildNodes!="function")},HA=function(de){return typeof a=="function"&&de instanceof a};function Dr(ft,de,Je){Wc(ft,ot=>{ot.call(e,de,Je,AA)})}const jA=function(de){let Je=null;if(Dr(U.beforeSanitizeElements,de,null),QA(de))return Tt(de),!0;const ot=_t(de.nodeName);if(Dr(U.uponSanitizeElement,de,{tagName:ot,allowedTags:k}),ye&&de.hasChildNodes()&&!HA(de.firstElementChild)&&SA(/<[/\w!]/g,de.innerHTML)&&SA(/<[/\w!]/g,de.textContent)||de.nodeType===Xo.progressingInstruction||ye&&de.nodeType===Xo.comment&&SA(/<[/\w]/g,de.data))return Tt(de),!0;if(!(W.tagCheck instanceof Function&&W.tagCheck(ot))&&(!k[ot]||J[ot])){if(!J[ot]&&NA(ot)&&(Y.tagNameCheck instanceof RegExp&&SA(Y.tagNameCheck,ot)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(ot)))return!1;if(xe&&!ge[ot]){const Yt=x(de)||de.parentNode,wr=B(de)||de.childNodes;if(wr&&Yt){const nr=wr.length;for(let Gr=nr-1;Gr>=0;--Gr){const yr=p(wr[Gr],!0);yr.__removalCount=(de.__removalCount||0)+1,Yt.insertBefore(yr,w(de))}}}return Tt(de),!0}return de instanceof o&&!bA(de)||(ot==="noscript"||ot==="noembed"||ot==="noframes")&&SA(/<\/no(script|embed|frames)/i,de.innerHTML)?(Tt(de),!0):(Be&&de.nodeType===Xo.text&&(Je=de.textContent,Wc([O,M,C],Yt=>{Je=zo(Je,Yt," ")}),de.textContent!==Je&&(Vo(e.removed,{element:de.cloneNode()}),de.textContent=Je)),Dr(U.afterSanitizeElements,de,null),!1)},KA=function(de,Je,ot){if(Me&&(Je==="id"||Je==="name")&&(ot in t||ot in Vr))return!1;if(!(oe&&!q[Je]&&SA(z,Je))){if(!(te&&SA(re,Je))){if(!(W.attributeCheck instanceof Function&&W.attributeCheck(Je,de))){if(!P[Je]||q[Je]){if(!(NA(de)&&(Y.tagNameCheck instanceof RegExp&&SA(Y.tagNameCheck,de)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(de))&&(Y.attributeNameCheck instanceof RegExp&&SA(Y.attributeNameCheck,Je)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(Je,de))||Je==="is"&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&SA(Y.tagNameCheck,ot)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(ot))))return!1}else if(!fe[Je]){if(!SA(V,zo(ot,Z,""))){if(!((Je==="src"||Je==="xlink:href"||Je==="href")&&de!=="script"&&yP(ot,"data:")===0&&Le[de])){if(!(we&&!SA(ne,zo(ot,Z,"")))){if(ot)return!1}}}}}}}return!0},NA=function(de){return de!=="annotation-xml"&&_g(de,Ae)},Jn=function(de){Dr(U.beforeSanitizeAttributes,de,null);const{attributes:Je}=de;if(!Je||QA(de))return;const ot={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0};let Yt=Je.length;for(;Yt--;){const wr=Je[Yt],{name:nr,namespaceURI:Gr,value:yr}=wr,gn=_t(nr),na=yr;let cr=nr==="value"?na:BP(na);if(ot.attrName=gn,ot.attrValue=cr,ot.keepAttr=!0,ot.forceKeepAttr=void 0,Dr(U.uponSanitizeAttribute,de,ot),cr=ot.attrValue,ze&&(gn==="id"||gn==="name")&&(kt(nr,de),cr=Ye+cr),ye&&SA(/((--!?|])>)|<\/(style|title|textarea)/i,cr)){kt(nr,de);continue}if(gn==="attributename"&&_g(cr,"href")){kt(nr,de);continue}if(ot.forceKeepAttr)continue;if(!ot.keepAttr){kt(nr,de);continue}if(!le&&SA(/\/>/i,cr)){kt(nr,de);continue}Be&&Wc([O,M,C],za=>{cr=zo(cr,za," ")});const Va=_t(de.nodeName);if(!KA(Va,gn,cr)){kt(nr,de);continue}if(E&&typeof c=="object"&&typeof c.getAttributeType=="function"&&!Gr)switch(c.getAttributeType(Va,gn)){case"TrustedHTML":{cr=E.createHTML(cr);break}case"TrustedScriptURL":{cr=E.createScriptURL(cr);break}}if(cr!==na)try{Gr?de.setAttributeNS(Gr,nr,cr):de.setAttribute(nr,cr),QA(de)?Tt(de):qx(e.removed)}catch{kt(nr,de)}}Dr(U.afterSanitizeAttributes,de,null)},dn=function ft(de){let Je=null;const ot=lA(de);for(Dr(U.beforeSanitizeShadowDOM,de,null);Je=ot.nextNode();)Dr(U.uponSanitizeShadowNode,Je,null),jA(Je),Jn(Je),Je.content instanceof i&&ft(Je.content);Dr(U.afterSanitizeShadowDOM,de,null)};return e.sanitize=function(ft){let de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Je=null,ot=null,Yt=null,wr=null;if(De=!ft,De&&(ft="<!-->"),typeof ft!="string"&&!HA(ft))if(typeof ft.toString=="function"){if(ft=ft.toString(),typeof ft!="string")throw Go("dirty is not a string, aborting")}else throw Go("toString is not a function");if(!e.isSupported)return ft;if(Ie||Mr(de),e.removed=[],typeof ft=="string"&&(Oe=!1),Oe){if(ft.nodeName){const yr=_t(ft.nodeName);if(!k[yr]||J[yr])throw Go("root node is forbidden and cannot be sanitized in-place")}}else if(ft instanceof a)Je=mr("<!---->"),ot=Je.ownerDocument.importNode(ft,!0),ot.nodeType===Xo.element&&ot.nodeName==="BODY"||ot.nodeName==="HTML"?Je=ot:Je.appendChild(ot);else{if(!Te&&!Be&&!R&&ft.indexOf("<")===-1)return E&&Ve?E.createHTML(ft):ft;if(Je=mr(ft),!Je)return Te?null:Ve?Q:""}Je&&Ue&&Tt(Je.firstChild);const nr=lA(Oe?ft:Je);for(;Yt=nr.nextNode();)jA(Yt),Jn(Yt),Yt.content instanceof i&&dn(Yt.content);if(Oe)return ft;if(Te){if(Ee)for(wr=T.call(Je.ownerDocument);Je.firstChild;)wr.appendChild(Je.firstChild);else wr=Je;return(P.shadowroot||P.shadowrootmode)&&(wr=D.call(A,wr,!0)),wr}let Gr=R?Je.outerHTML:Je.innerHTML;return R&&k["!doctype"]&&Je.ownerDocument&&Je.ownerDocument.doctype&&Je.ownerDocument.doctype.name&&SA(Yx,Je.ownerDocument.doctype.name)&&(Gr="<!DOCTYPE "+Je.ownerDocument.doctype.name+`>
|
|
780
|
+
`+Gr),Be&&Wc([O,M,C],yr=>{Gr=zo(Gr,yr," ")}),E&&Ve?E.createHTML(Gr):Gr},e.setConfig=function(){let ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mr(ft),Ie=!0},e.clearConfig=function(){AA=null,Ie=!1},e.isValidAttribute=function(ft,de,Je){AA||Mr({});const ot=_t(ft),Yt=_t(de);return KA(ot,Yt,Je)},e.addHook=function(ft,de){typeof de=="function"&&Vo(U[ft],de)},e.removeHook=function(ft,de){if(de!==void 0){const Je=mP(U[ft],de);return Je===-1?void 0:wP(U[ft],Je,1)[0]}return qx(U[ft])},e.removeHooks=function(ft){U[ft]=[]},e.removeAllHooks=function(){U=Jx()},e}var PP=Zx();const RP=Object.freeze(Object.defineProperty({__proto__:null,default:PP},Symbol.toStringTag,{value:"Module"}));var e5={},t5={},Yo,r5;function or(){if(r5)return Yo;r5=1;var r=function(e){return e&&e.Math===Math&&e};return Yo=r(typeof globalThis=="object"&&globalThis)||r(typeof window=="object"&&window)||r(typeof self=="object"&&self)||r(typeof $f=="object"&&$f)||r(typeof Yo=="object"&&Yo)||(function(){return this})()||Function("return this")(),Yo}var Tg={},Lg,A5;function gr(){return A5||(A5=1,Lg=function(r){try{return!!r()}catch{return!0}}),Lg}var Pg,n5;function _n(){if(n5)return Pg;n5=1;var r=gr();return Pg=!r(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Pg}var Rg,i5;function $c(){if(i5)return Rg;i5=1;var r=gr();return Rg=!r(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Rg}var Mg,a5;function oA(){if(a5)return Mg;a5=1;var r=$c(),e=Function.prototype.call;return Mg=r?e.bind(e):function(){return e.apply(e,arguments)},Mg}var Dg={},s5;function MP(){if(s5)return Dg;s5=1;var r={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,t=e&&!r.call({1:2},1);return Dg.f=t?function(n){var i=e(this,n);return!!i&&i.enumerable}:r,Dg}var kg,o5;function Hg(){return o5||(o5=1,kg=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}),kg}var jg,l5;function pr(){if(l5)return jg;l5=1;var r=$c(),e=Function.prototype,t=e.call,A=r&&e.bind.bind(t,t);return jg=r?A:function(n){return function(){return t.apply(n,arguments)}},jg}var Kg,u5;function Pa(){if(u5)return Kg;u5=1;var r=pr(),e=r({}.toString),t=r("".slice);return Kg=function(A){return t(e(A),8,-1)},Kg}var qg,c5;function f5(){if(c5)return qg;c5=1;var r=pr(),e=gr(),t=Pa(),A=Object,n=r("".split);return qg=e(function(){return!A("z").propertyIsEnumerable(0)})?function(i){return t(i)==="String"?n(i,""):A(i)}:A,qg}var Vg,h5;function Jc(){return h5||(h5=1,Vg=function(r){return r==null}),Vg}var zg,d5;function In(){if(d5)return zg;d5=1;var r=Jc(),e=TypeError;return zg=function(t){if(r(t))throw new e("Can't call method on "+t);return t},zg}var Gg,g5;function $o(){if(g5)return Gg;g5=1;var r=f5(),e=In();return Gg=function(t){return r(e(t))},Gg}var Wg,p5;function _r(){if(p5)return Wg;p5=1;var r=typeof document=="object"&&document.all;return Wg=typeof r>"u"&&r!==void 0?function(e){return typeof e=="function"||e===r}:function(e){return typeof e=="function"},Wg}var Xg,v5;function DA(){if(v5)return Xg;v5=1;var r=_r();return Xg=function(e){return typeof e=="object"?e!==null:r(e)},Xg}var Yg,m5;function Ra(){if(m5)return Yg;m5=1;var r=or(),e=_r(),t=function(A){return e(A)?A:void 0};return Yg=function(A,n){return arguments.length<2?t(r[A]):r[A]&&r[A][n]},Yg}var $g,w5;function Zc(){if(w5)return $g;w5=1;var r=pr();return $g=r({}.isPrototypeOf),$g}var Jg,y5;function Jo(){if(y5)return Jg;y5=1;var r=or(),e=r.navigator,t=e&&e.userAgent;return Jg=t?String(t):"",Jg}var Zg,B5;function ep(){if(B5)return Zg;B5=1;var r=or(),e=Jo(),t=r.process,A=r.Deno,n=t&&t.versions||A&&A.version,i=n&&n.v8,s,a;return i&&(s=i.split("."),a=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!a&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(a=+s[1]))),Zg=a,Zg}var tp,b5;function x5(){if(b5)return tp;b5=1;var r=ep(),e=gr(),t=or(),A=t.String;return tp=!!Object.getOwnPropertySymbols&&!e(function(){var n=Symbol("symbol detection");return!A(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&r&&r<41}),tp}var rp,C5;function E5(){if(C5)return rp;C5=1;var r=x5();return rp=r&&!Symbol.sham&&typeof Symbol.iterator=="symbol",rp}var Ap,F5;function S5(){if(F5)return Ap;F5=1;var r=Ra(),e=_r(),t=Zc(),A=E5(),n=Object;return Ap=A?function(i){return typeof i=="symbol"}:function(i){var s=r("Symbol");return e(s)&&t(s.prototype,n(i))},Ap}var np,U5;function ef(){if(U5)return np;U5=1;var r=String;return np=function(e){try{return r(e)}catch{return"Object"}},np}var ip,_5;function gi(){if(_5)return ip;_5=1;var r=_r(),e=ef(),t=TypeError;return ip=function(A){if(r(A))return A;throw new t(e(A)+" is not a function")},ip}var ap,I5;function Rs(){if(I5)return ap;I5=1;var r=gi(),e=Jc();return ap=function(t,A){var n=t[A];return e(n)?void 0:r(n)},ap}var sp,Q5;function DP(){if(Q5)return sp;Q5=1;var r=oA(),e=_r(),t=DA(),A=TypeError;return sp=function(n,i){var s,a;if(i==="string"&&e(s=n.toString)&&!t(a=r(s,n))||e(s=n.valueOf)&&!t(a=r(s,n))||i!=="string"&&e(s=n.toString)&&!t(a=r(s,n)))return a;throw new A("Can't convert object to primitive value")},sp}var op={exports:{}},lp,N5;function Yn(){return N5||(N5=1,lp=!1),lp}var up,O5;function cp(){if(O5)return up;O5=1;var r=or(),e=Object.defineProperty;return up=function(t,A){try{e(r,t,{value:A,configurable:!0,writable:!0})}catch{r[t]=A}return A},up}var T5;function fp(){if(T5)return op.exports;T5=1;var r=Yn(),e=or(),t=cp(),A="__core-js_shared__",n=op.exports=e[A]||t(A,{});return(n.versions||(n.versions=[])).push({version:"3.47.0",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"}),op.exports}var hp,L5;function dp(){if(L5)return hp;L5=1;var r=fp();return hp=function(e,t){return r[e]||(r[e]=t||{})},hp}var gp,P5;function tf(){if(P5)return gp;P5=1;var r=In(),e=Object;return gp=function(t){return e(r(t))},gp}var pp,R5;function Qn(){if(R5)return pp;R5=1;var r=pr(),e=tf(),t=r({}.hasOwnProperty);return pp=Object.hasOwn||function(n,i){return t(e(n),i)},pp}var vp,M5;function D5(){if(M5)return vp;M5=1;var r=pr(),e=0,t=Math.random(),A=r(1.1.toString);return vp=function(n){return"Symbol("+(n===void 0?"":n)+")_"+A(++e+t,36)},vp}var mp,k5;function rA(){if(k5)return mp;k5=1;var r=or(),e=dp(),t=Qn(),A=D5(),n=x5(),i=E5(),s=r.Symbol,a=e("wks"),o=i?s.for||s:s&&s.withoutSetter||A;return mp=function(l){return t(a,l)||(a[l]=n&&t(s,l)?s[l]:o("Symbol."+l)),a[l]},mp}var wp,H5;function kP(){if(H5)return wp;H5=1;var r=oA(),e=DA(),t=S5(),A=Rs(),n=DP(),i=rA(),s=TypeError,a=i("toPrimitive");return wp=function(o,l){if(!e(o)||t(o))return o;var u=A(o,a),f;if(u){if(l===void 0&&(l="default"),f=r(u,o,l),!e(f)||t(f))return f;throw new s("Can't convert object to primitive value")}return l===void 0&&(l="number"),n(o,l)},wp}var yp,j5;function K5(){if(j5)return yp;j5=1;var r=kP(),e=S5();return yp=function(t){var A=r(t,"string");return e(A)?A:A+""},yp}var Bp,q5;function rf(){if(q5)return Bp;q5=1;var r=or(),e=DA(),t=r.document,A=e(t)&&e(t.createElement);return Bp=function(n){return A?t.createElement(n):{}},Bp}var bp,V5;function z5(){if(V5)return bp;V5=1;var r=_n(),e=gr(),t=rf();return bp=!r&&!e(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),bp}var G5;function Af(){if(G5)return Tg;G5=1;var r=_n(),e=oA(),t=MP(),A=Hg(),n=$o(),i=K5(),s=Qn(),a=z5(),o=Object.getOwnPropertyDescriptor;return Tg.f=r?o:function(u,f){if(u=n(u),f=i(f),a)try{return o(u,f)}catch{}if(s(u,f))return A(!e(t.f,u,f),u[f])},Tg}var xp={},Cp,W5;function X5(){if(W5)return Cp;W5=1;var r=_n(),e=gr();return Cp=r&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Cp}var Ep,Y5;function _A(){if(Y5)return Ep;Y5=1;var r=DA(),e=String,t=TypeError;return Ep=function(A){if(r(A))return A;throw new t(e(A)+" is not an object")},Ep}var $5;function ea(){if($5)return xp;$5=1;var r=_n(),e=z5(),t=X5(),A=_A(),n=K5(),i=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o="enumerable",l="configurable",u="writable";return xp.f=r?t?function(h,c,g){if(A(h),c=n(c),A(g),typeof h=="function"&&c==="prototype"&&"value"in g&&u in g&&!g[u]){var p=a(h,c);p&&p[u]&&(h[c]=g.value,g={configurable:l in g?g[l]:p[l],enumerable:o in g?g[o]:p[o],writable:!1})}return s(h,c,g)}:s:function(h,c,g){if(A(h),c=n(c),A(g),e)try{return s(h,c,g)}catch{}if("get"in g||"set"in g)throw new i("Accessors not supported");return"value"in g&&(h[c]=g.value),h},xp}var Fp,J5;function Zo(){if(J5)return Fp;J5=1;var r=_n(),e=ea(),t=Hg();return Fp=r?function(A,n,i){return e.f(A,n,t(1,i))}:function(A,n,i){return A[n]=i,A},Fp}var Sp={exports:{}},Up,Z5;function nf(){if(Z5)return Up;Z5=1;var r=_n(),e=Qn(),t=Function.prototype,A=r&&Object.getOwnPropertyDescriptor,n=e(t,"name"),i=n&&(function(){}).name==="something",s=n&&(!r||r&&A(t,"name").configurable);return Up={EXISTS:n,PROPER:i,CONFIGURABLE:s},Up}var _p,eC;function Ip(){if(eC)return _p;eC=1;var r=pr(),e=_r(),t=fp(),A=r(Function.toString);return e(t.inspectSource)||(t.inspectSource=function(n){return A(n)}),_p=t.inspectSource,_p}var Qp,tC;function HP(){if(tC)return Qp;tC=1;var r=or(),e=_r(),t=r.WeakMap;return Qp=e(t)&&/native code/.test(String(t)),Qp}var Np,rC;function Op(){if(rC)return Np;rC=1;var r=dp(),e=D5(),t=r("keys");return Np=function(A){return t[A]||(t[A]=e(A))},Np}var Tp,AC;function Lp(){return AC||(AC=1,Tp={}),Tp}var Pp,nC;function af(){if(nC)return Pp;nC=1;var r=HP(),e=or(),t=DA(),A=Zo(),n=Qn(),i=fp(),s=Op(),a=Lp(),o="Object already initialized",l=e.TypeError,u=e.WeakMap,f,h,c,g=function(B){return c(B)?h(B):f(B,{})},p=function(B){return function(x){var E;if(!t(x)||(E=h(x)).type!==B)throw new l("Incompatible receiver, "+B+" required");return E}};if(r||i.state){var y=i.state||(i.state=new u);y.get=y.get,y.has=y.has,y.set=y.set,f=function(B,x){if(y.has(B))throw new l(o);return x.facade=B,y.set(B,x),x},h=function(B){return y.get(B)||{}},c=function(B){return y.has(B)}}else{var w=s("state");a[w]=!0,f=function(B,x){if(n(B,w))throw new l(o);return x.facade=B,A(B,w,x),x},h=function(B){return n(B,w)?B[w]:{}},c=function(B){return n(B,w)}}return Pp={set:f,get:h,has:c,enforce:g,getterFor:p},Pp}var iC;function aC(){if(iC)return Sp.exports;iC=1;var r=pr(),e=gr(),t=_r(),A=Qn(),n=_n(),i=nf().CONFIGURABLE,s=Ip(),a=af(),o=a.enforce,l=a.get,u=String,f=Object.defineProperty,h=r("".slice),c=r("".replace),g=r([].join),p=n&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),y=String(String).split("String"),w=Sp.exports=function(B,x,E){h(u(x),0,7)==="Symbol("&&(x="["+c(u(x),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),E&&E.getter&&(x="get "+x),E&&E.setter&&(x="set "+x),(!A(B,"name")||i&&B.name!==x)&&(n?f(B,"name",{value:x,configurable:!0}):B.name=x),p&&E&&A(E,"arity")&&B.length!==E.arity&&f(B,"length",{value:E.arity});try{E&&A(E,"constructor")&&E.constructor?n&&f(B,"prototype",{writable:!1}):B.prototype&&(B.prototype=void 0)}catch{}var Q=o(B);return A(Q,"source")||(Q.source=g(y,typeof x=="string"?x:"")),B};return Function.prototype.toString=w(function(){return t(this)&&l(this).source||s(this)},"toString"),Sp.exports}var Rp,sC;function Ma(){if(sC)return Rp;sC=1;var r=_r(),e=ea(),t=aC(),A=cp();return Rp=function(n,i,s,a){a||(a={});var o=a.enumerable,l=a.name!==void 0?a.name:i;if(r(s)&&t(s,l,a),a.global)o?n[i]=s:A(i,s);else{try{a.unsafe?n[i]&&(o=!0):delete n[i]}catch{}o?n[i]=s:e.f(n,i,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return n},Rp}var Mp={},Dp,oC;function jP(){if(oC)return Dp;oC=1;var r=Math.ceil,e=Math.floor;return Dp=Math.trunc||function(A){var n=+A;return(n>0?e:r)(n)},Dp}var kp,lC;function sf(){if(lC)return kp;lC=1;var r=jP();return kp=function(e){var t=+e;return t!==t||t===0?0:r(t)},kp}var Hp,uC;function KP(){if(uC)return Hp;uC=1;var r=sf(),e=Math.max,t=Math.min;return Hp=function(A,n){var i=r(A);return i<0?e(i+n,0):t(i,n)},Hp}var jp,cC;function Ms(){if(cC)return jp;cC=1;var r=sf(),e=Math.min;return jp=function(t){var A=r(t);return A>0?e(A,9007199254740991):0},jp}var Kp,fC;function qp(){if(fC)return Kp;fC=1;var r=Ms();return Kp=function(e){return r(e.length)},Kp}var Vp,hC;function dC(){if(hC)return Vp;hC=1;var r=$o(),e=KP(),t=qp(),A=function(n){return function(i,s,a){var o=r(i),l=t(o);if(l===0)return!n&&-1;var u=e(a,l),f;if(n&&s!==s){for(;l>u;)if(f=o[u++],f!==f)return!0}else for(;l>u;u++)if((n||u in o)&&o[u]===s)return n||u||0;return!n&&-1}};return Vp={includes:A(!0),indexOf:A(!1)},Vp}var zp,gC;function pC(){if(gC)return zp;gC=1;var r=pr(),e=Qn(),t=$o(),A=dC().indexOf,n=Lp(),i=r([].push);return zp=function(s,a){var o=t(s),l=0,u=[],f;for(f in o)!e(n,f)&&e(o,f)&&i(u,f);for(;a.length>l;)e(o,f=a[l++])&&(~A(u,f)||i(u,f));return u},zp}var Gp,vC;function Wp(){return vC||(vC=1,Gp=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Gp}var mC;function qP(){if(mC)return Mp;mC=1;var r=pC(),e=Wp(),t=e.concat("length","prototype");return Mp.f=Object.getOwnPropertyNames||function(n){return r(n,t)},Mp}var Xp={},wC;function VP(){return wC||(wC=1,Xp.f=Object.getOwnPropertySymbols),Xp}var Yp,yC;function zP(){if(yC)return Yp;yC=1;var r=Ra(),e=pr(),t=qP(),A=VP(),n=_A(),i=e([].concat);return Yp=r("Reflect","ownKeys")||function(a){var o=t.f(n(a)),l=A.f;return l?i(o,l(a)):o},Yp}var $p,BC;function GP(){if(BC)return $p;BC=1;var r=Qn(),e=zP(),t=Af(),A=ea();return $p=function(n,i,s){for(var a=e(i),o=A.f,l=t.f,u=0;u<a.length;u++){var f=a[u];!r(n,f)&&!(s&&r(s,f))&&o(n,f,l(i,f))}},$p}var Jp,bC;function xC(){if(bC)return Jp;bC=1;var r=gr(),e=_r(),t=/#|\.prototype\./,A=function(o,l){var u=i[n(o)];return u===a?!0:u===s?!1:e(l)?r(l):!!l},n=A.normalize=function(o){return String(o).replace(t,".").toLowerCase()},i=A.data={},s=A.NATIVE="N",a=A.POLYFILL="P";return Jp=A,Jp}var Zp,CC;function IA(){if(CC)return Zp;CC=1;var r=or(),e=Af().f,t=Zo(),A=Ma(),n=cp(),i=GP(),s=xC();return Zp=function(a,o){var l=a.target,u=a.global,f=a.stat,h,c,g,p,y,w;if(u?c=r:f?c=r[l]||n(l,{}):c=r[l]&&r[l].prototype,c)for(g in o){if(y=o[g],a.dontCallGetSet?(w=e(c,g),p=w&&w.value):p=c[g],h=s(u?g:l+(f?".":"#")+g,a.forced),!h&&p!==void 0){if(typeof y==typeof p)continue;i(y,p)}(a.sham||p&&p.sham)&&t(y,"sham",!0),A(c,g,y,a)}},Zp}var e0,EC;function FC(){if(EC)return e0;EC=1;var r=or(),e=Jo(),t=Pa(),A=function(n){return e.slice(0,n.length)===n};return e0=(function(){return A("Bun/")?"BUN":A("Cloudflare-Workers")?"CLOUDFLARE":A("Deno/")?"DENO":A("Node.js/")?"NODE":r.Bun&&typeof Bun.version=="string"?"BUN":r.Deno&&typeof Deno.version=="object"?"DENO":t(r.process)==="process"?"NODE":r.window&&r.document?"BROWSER":"REST"})(),e0}var t0,SC;function of(){if(SC)return t0;SC=1;var r=FC();return t0=r==="NODE",t0}var r0,UC;function WP(){if(UC)return r0;UC=1;var r=or();return r0=r,r0}var A0,_C;function XP(){if(_C)return A0;_C=1;var r=pr(),e=gi();return A0=function(t,A,n){try{return r(e(Object.getOwnPropertyDescriptor(t,A)[n]))}catch{}},A0}var n0,IC;function YP(){if(IC)return n0;IC=1;var r=DA();return n0=function(e){return r(e)||e===null},n0}var i0,QC;function $P(){if(QC)return i0;QC=1;var r=YP(),e=String,t=TypeError;return i0=function(A){if(r(A))return A;throw new t("Can't set "+e(A)+" as a prototype")},i0}var a0,NC;function OC(){if(NC)return a0;NC=1;var r=XP(),e=DA(),t=In(),A=$P();return a0=Object.setPrototypeOf||("__proto__"in{}?(function(){var n=!1,i={},s;try{s=r(Object.prototype,"__proto__","set"),s(i,[]),n=i instanceof Array}catch{}return function(o,l){return t(o),A(l),e(o)&&(n?s(o,l):o.__proto__=l),o}})():void 0),a0}var s0,TC;function lf(){if(TC)return s0;TC=1;var r=ea().f,e=Qn(),t=rA(),A=t("toStringTag");return s0=function(n,i,s){n&&!s&&(n=n.prototype),n&&!e(n,A)&&r(n,A,{configurable:!0,value:i})},s0}var o0,LC;function JP(){if(LC)return o0;LC=1;var r=aC(),e=ea();return o0=function(t,A,n){return n.get&&r(n.get,A,{getter:!0}),n.set&&r(n.set,A,{setter:!0}),e.f(t,A,n)},o0}var l0,PC;function ZP(){if(PC)return l0;PC=1;var r=Ra(),e=JP(),t=rA(),A=_n(),n=t("species");return l0=function(i){var s=r(i);A&&s&&!s[n]&&e(s,n,{configurable:!0,get:function(){return this}})},l0}var u0,RC;function eR(){if(RC)return u0;RC=1;var r=Zc(),e=TypeError;return u0=function(t,A){if(r(A,t))return t;throw new e("Incorrect invocation")},u0}var c0,MC;function tR(){if(MC)return c0;MC=1;var r=rA(),e=r("toStringTag"),t={};return t[e]="z",c0=String(t)==="[object z]",c0}var f0,DC;function h0(){if(DC)return f0;DC=1;var r=tR(),e=_r(),t=Pa(),A=rA(),n=A("toStringTag"),i=Object,s=t((function(){return arguments})())==="Arguments",a=function(o,l){try{return o[l]}catch{}};return f0=r?t:function(o){var l,u,f;return o===void 0?"Undefined":o===null?"Null":typeof(u=a(l=i(o),n))=="string"?u:s?t(l):(f=t(l))==="Object"&&e(l.callee)?"Arguments":f},f0}var d0,kC;function rR(){if(kC)return d0;kC=1;var r=pr(),e=gr(),t=_r(),A=h0(),n=Ra(),i=Ip(),s=function(){},a=n("Reflect","construct"),o=/^\s*(?:class|function)\b/,l=r(o.exec),u=!o.test(s),f=function(g){if(!t(g))return!1;try{return a(s,[],g),!0}catch{return!1}},h=function(g){if(!t(g))return!1;switch(A(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return u||!!l(o,i(g))}catch{return!0}};return h.sham=!0,d0=!a||e(function(){var c;return f(f.call)||!f(Object)||!f(function(){c=!0})||c})?h:f,d0}var g0,HC;function AR(){if(HC)return g0;HC=1;var r=rR(),e=ef(),t=TypeError;return g0=function(A){if(r(A))return A;throw new t(e(A)+" is not a constructor")},g0}var p0,jC;function KC(){if(jC)return p0;jC=1;var r=_A(),e=AR(),t=Jc(),A=rA(),n=A("species");return p0=function(i,s){var a=r(i).constructor,o;return a===void 0||t(o=r(a)[n])?s:e(o)},p0}var v0,qC;function VC(){if(qC)return v0;qC=1;var r=$c(),e=Function.prototype,t=e.apply,A=e.call;return v0=typeof Reflect=="object"&&Reflect.apply||(r?A.bind(t):function(){return A.apply(t,arguments)}),v0}var m0,zC;function uf(){if(zC)return m0;zC=1;var r=Pa(),e=pr();return m0=function(t){if(r(t)==="Function")return e(t)},m0}var w0,GC;function y0(){if(GC)return w0;GC=1;var r=uf(),e=gi(),t=$c(),A=r(r.bind);return w0=function(n,i){return e(n),i===void 0?n:t?A(n,i):function(){return n.apply(i,arguments)}},w0}var B0,WC;function XC(){if(WC)return B0;WC=1;var r=Ra();return B0=r("document","documentElement"),B0}var b0,YC;function nR(){if(YC)return b0;YC=1;var r=pr();return b0=r([].slice),b0}var x0,$C;function iR(){if($C)return x0;$C=1;var r=TypeError;return x0=function(e,t){if(e<t)throw new r("Not enough arguments");return e},x0}var C0,JC;function ZC(){if(JC)return C0;JC=1;var r=Jo();return C0=/(?:ipad|iphone|ipod).*applewebkit/i.test(r),C0}var E0,eE;function tE(){if(eE)return E0;eE=1;var r=or(),e=VC(),t=y0(),A=_r(),n=Qn(),i=gr(),s=XC(),a=nR(),o=rf(),l=iR(),u=ZC(),f=of(),h=r.setImmediate,c=r.clearImmediate,g=r.process,p=r.Dispatch,y=r.Function,w=r.MessageChannel,B=r.String,x=0,E={},Q="onreadystatechange",L,S,T,_;i(function(){L=r.location});var D=function(C){if(n(E,C)){var z=E[C];delete E[C],z()}},U=function(C){return function(){D(C)}},O=function(C){D(C.data)},M=function(C){r.postMessage(B(C),L.protocol+"//"+L.host)};return(!h||!c)&&(h=function(z){l(arguments.length,1);var re=A(z)?z:y(z),ne=a(arguments,1);return E[++x]=function(){e(re,void 0,ne)},S(x),x},c=function(z){delete E[z]},f?S=function(C){g.nextTick(U(C))}:p&&p.now?S=function(C){p.now(U(C))}:w&&!u?(T=new w,_=T.port2,T.port1.onmessage=O,S=t(_.postMessage,_)):r.addEventListener&&A(r.postMessage)&&!r.importScripts&&L&&L.protocol!=="file:"&&!i(M)?(S=M,r.addEventListener("message",O,!1)):Q in o("script")?S=function(C){s.appendChild(o("script"))[Q]=function(){s.removeChild(this),D(C)}}:S=function(C){setTimeout(U(C),0)}),E0={set:h,clear:c},E0}var F0,rE;function aR(){if(rE)return F0;rE=1;var r=or(),e=_n(),t=Object.getOwnPropertyDescriptor;return F0=function(A){if(!e)return r[A];var n=t(r,A);return n&&n.value},F0}var S0,AE;function nE(){if(AE)return S0;AE=1;var r=function(){this.head=null,this.tail=null};return r.prototype={add:function(e){var t={item:e,next:null},A=this.tail;A?A.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e){var t=this.head=e.next;return t===null&&(this.tail=null),e.item}}},S0=r,S0}var U0,iE;function sR(){if(iE)return U0;iE=1;var r=Jo();return U0=/ipad|iphone|ipod/i.test(r)&&typeof Pebble<"u",U0}var _0,aE;function oR(){if(aE)return _0;aE=1;var r=Jo();return _0=/web0s(?!.*chrome)/i.test(r),_0}var I0,sE;function lR(){if(sE)return I0;sE=1;var r=or(),e=aR(),t=y0(),A=tE().set,n=nE(),i=ZC(),s=sR(),a=oR(),o=of(),l=r.MutationObserver||r.WebKitMutationObserver,u=r.document,f=r.process,h=r.Promise,c=e("queueMicrotask"),g,p,y,w,B;if(!c){var x=new n,E=function(){var Q,L;for(o&&(Q=f.domain)&&Q.exit();L=x.get();)try{L()}catch(S){throw x.head&&g(),S}Q&&Q.enter()};!i&&!o&&!a&&l&&u?(p=!0,y=u.createTextNode(""),new l(E).observe(y,{characterData:!0}),g=function(){y.data=p=!p}):!s&&h&&h.resolve?(w=h.resolve(void 0),w.constructor=h,B=t(w.then,w),g=function(){B(E)}):o?g=function(){f.nextTick(E)}:(A=t(A,r),g=function(){A(E)}),c=function(Q){x.head||g(),x.add(Q)}}return I0=c,I0}var Q0,oE;function uR(){return oE||(oE=1,Q0=function(r,e){try{arguments.length===1?console.error(r):console.error(r,e)}catch{}}),Q0}var N0,lE;function O0(){return lE||(lE=1,N0=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}),N0}var T0,uE;function el(){if(uE)return T0;uE=1;var r=or();return T0=r.Promise,T0}var L0,cE;function tl(){if(cE)return L0;cE=1;var r=or(),e=el(),t=_r(),A=xC(),n=Ip(),i=rA(),s=FC(),a=Yn(),o=ep(),l=e&&e.prototype,u=i("species"),f=!1,h=t(r.PromiseRejectionEvent),c=A("Promise",function(){var g=n(e),p=g!==String(e);if(!p&&o===66||a&&!(l.catch&&l.finally))return!0;if(!o||o<51||!/native code/.test(g)){var y=new e(function(x){x(1)}),w=function(x){x(function(){},function(){})},B=y.constructor={};if(B[u]=w,f=y.then(function(){})instanceof w,!f)return!0}return!p&&(s==="BROWSER"||s==="DENO")&&!h});return L0={CONSTRUCTOR:c,REJECTION_EVENT:h,SUBCLASSING:f},L0}var P0={},fE;function rl(){if(fE)return P0;fE=1;var r=gi(),e=TypeError,t=function(A){var n,i;this.promise=new A(function(s,a){if(n!==void 0||i!==void 0)throw new e("Bad Promise constructor");n=s,i=a}),this.resolve=r(n),this.reject=r(i)};return P0.f=function(A){return new t(A)},P0}var hE;function cR(){if(hE)return t5;hE=1;var r=IA(),e=Yn(),t=of(),A=or(),n=WP(),i=oA(),s=Ma(),a=OC(),o=lf(),l=ZP(),u=gi(),f=_r(),h=DA(),c=eR(),g=KC(),p=tE().set,y=lR(),w=uR(),B=O0(),x=nE(),E=af(),Q=el(),L=tl(),S=rl(),T="Promise",_=L.CONSTRUCTOR,D=L.REJECTION_EVENT,U=L.SUBCLASSING,O=E.getterFor(T),M=E.set,C=Q&&Q.prototype,z=Q,re=C,ne=A.TypeError,Z=A.document,Ae=A.process,V=S.f,k=V,I=!!(Z&&Z.createEvent&&A.dispatchEvent),P="unhandledrejection",K="rejectionhandled",Y=0,J=1,q=2,W=1,te=2,oe,we,le,Be,ye=function(xe){var Oe;return h(xe)&&f(Oe=xe.then)?Oe:!1},R=function(xe,Oe){var je=Oe.value,ge=Oe.state===J,Re=ge?xe.ok:xe.fail,Le=xe.resolve,ue=xe.reject,fe=xe.domain,Pe,Fe,Ne;try{Re?(ge||(Oe.rejection===te&&Ve(Oe),Oe.rejection=W),Re===!0?Pe=je:(fe&&fe.enter(),Pe=Re(je),fe&&(fe.exit(),Ne=!0)),Pe===xe.promise?ue(new ne("Promise-chain cycle")):(Fe=ye(Pe))?i(Fe,Pe,Le,ue):Le(Pe)):ue(je)}catch(ve){fe&&!Ne&&fe.exit(),ue(ve)}},Ie=function(xe,Oe){xe.notified||(xe.notified=!0,y(function(){for(var je=xe.reactions,ge;ge=je.get();)R(ge,xe);xe.notified=!1,Oe&&!xe.rejection&&Te(xe)}))},Ue=function(xe,Oe,je){var ge,Re;I?(ge=Z.createEvent("Event"),ge.promise=Oe,ge.reason=je,ge.initEvent(xe,!1,!0),A.dispatchEvent(ge)):ge={promise:Oe,reason:je},!D&&(Re=A["on"+xe])?Re(ge):xe===P&&w("Unhandled promise rejection",je)},Te=function(xe){i(p,A,function(){var Oe=xe.facade,je=xe.value,ge=Ee(xe),Re;if(ge&&(Re=B(function(){t?Ae.emit("unhandledRejection",je,Oe):Ue(P,Oe,je)}),xe.rejection=t||Ee(xe)?te:W,Re.error))throw Re.value})},Ee=function(xe){return xe.rejection!==W&&!xe.parent},Ve=function(xe){i(p,A,function(){var Oe=xe.facade;t?Ae.emit("rejectionHandled",Oe):Ue(K,Oe,xe.value)})},Me=function(xe,Oe,je){return function(ge){xe(Oe,ge,je)}},ze=function(xe,Oe,je){xe.done||(xe.done=!0,je&&(xe=je),xe.value=Oe,xe.state=q,Ie(xe,!0))},Ye=function(xe,Oe,je){if(!xe.done){xe.done=!0,je&&(xe=je);try{if(xe.facade===Oe)throw new ne("Promise can't be resolved itself");var ge=ye(Oe);ge?y(function(){var Re={done:!1};try{i(ge,Oe,Me(Ye,Re,xe),Me(ze,Re,xe))}catch(Le){ze(Re,Le,xe)}}):(xe.value=Oe,xe.state=J,Ie(xe,!1))}catch(Re){ze({done:!1},Re,xe)}}};if(_&&(z=function(Oe){c(this,re),u(Oe),i(oe,this);var je=O(this);try{Oe(Me(Ye,je),Me(ze,je))}catch(ge){ze(je,ge)}},re=z.prototype,oe=function(Oe){M(this,{type:T,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:Y,value:null})},oe.prototype=s(re,"then",function(Oe,je){var ge=O(this),Re=V(g(this,z));return ge.parent=!0,Re.ok=f(Oe)?Oe:!0,Re.fail=f(je)&&je,Re.domain=t?Ae.domain:void 0,ge.state===Y?ge.reactions.add(Re):y(function(){R(Re,ge)}),Re.promise}),we=function(){var xe=new oe,Oe=O(xe);this.promise=xe,this.resolve=Me(Ye,Oe),this.reject=Me(ze,Oe)},S.f=V=function(xe){return xe===z||xe===le?new we(xe):k(xe)},!e&&f(Q)&&C!==Object.prototype)){Be=C.then,U||s(C,"then",function(Oe,je){var ge=this;return new z(function(Re,Le){i(Be,ge,Re,Le)}).then(Oe,je)},{unsafe:!0});try{delete C.constructor}catch{}a&&a(C,re)}return r({global:!0,constructor:!0,wrap:!0,forced:_},{Promise:z}),le=n.Promise,o(z,T,!1,!0),l(T),t5}var dE={},R0,gE;function Al(){return gE||(gE=1,R0={}),R0}var M0,pE;function fR(){if(pE)return M0;pE=1;var r=rA(),e=Al(),t=r("iterator"),A=Array.prototype;return M0=function(n){return n!==void 0&&(e.Array===n||A[t]===n)},M0}var D0,vE;function mE(){if(vE)return D0;vE=1;var r=h0(),e=Rs(),t=Jc(),A=Al(),n=rA(),i=n("iterator");return D0=function(s){if(!t(s))return e(s,i)||e(s,"@@iterator")||A[r(s)]},D0}var k0,wE;function hR(){if(wE)return k0;wE=1;var r=oA(),e=gi(),t=_A(),A=ef(),n=mE(),i=TypeError;return k0=function(s,a){var o=arguments.length<2?n(s):a;if(e(o))return t(r(o,s));throw new i(A(s)+" is not iterable")},k0}var H0,yE;function dR(){if(yE)return H0;yE=1;var r=oA(),e=_A(),t=Rs();return H0=function(A,n,i){var s,a;e(A);try{if(s=t(A,"return"),!s){if(n==="throw")throw i;return i}s=r(s,A)}catch(o){a=!0,s=o}if(n==="throw")throw i;if(a)throw s;return e(s),i},H0}var j0,BE;function bE(){if(BE)return j0;BE=1;var r=y0(),e=oA(),t=_A(),A=ef(),n=fR(),i=qp(),s=Zc(),a=hR(),o=mE(),l=dR(),u=TypeError,f=function(c,g){this.stopped=c,this.result=g},h=f.prototype;return j0=function(c,g,p){var y=p&&p.that,w=!!(p&&p.AS_ENTRIES),B=!!(p&&p.IS_RECORD),x=!!(p&&p.IS_ITERATOR),E=!!(p&&p.INTERRUPTED),Q=r(g,y),L,S,T,_,D,U,O,M=function(z){return L&&l(L,"normal"),new f(!0,z)},C=function(z){return w?(t(z),E?Q(z[0],z[1],M):Q(z[0],z[1])):E?Q(z,M):Q(z)};if(B)L=c.iterator;else if(x)L=c;else{if(S=o(c),!S)throw new u(A(c)+" is not iterable");if(n(S)){for(T=0,_=i(c);_>T;T++)if(D=C(c[T]),D&&s(h,D))return D;return new f(!1)}L=a(c,S)}for(U=B?c.next:L.next;!(O=e(U,L)).done;){try{D=C(O.value)}catch(z){l(L,"throw",z)}if(typeof D=="object"&&D&&s(h,D))return D}return new f(!1)},j0}var K0,xE;function gR(){if(xE)return K0;xE=1;var r=rA(),e=r("iterator"),t=!1;try{var A=0,n={next:function(){return{done:!!A++}},return:function(){t=!0}};n[e]=function(){return this},Array.from(n,function(){throw 2})}catch{}return K0=function(i,s){try{if(!s&&!t)return!1}catch{return!1}var a=!1;try{var o={};o[e]=function(){return{next:function(){return{done:a=!0}}}},i(o)}catch{}return a},K0}var q0,CE;function EE(){if(CE)return q0;CE=1;var r=el(),e=gR(),t=tl().CONSTRUCTOR;return q0=t||!e(function(A){r.all(A).then(void 0,function(){})}),q0}var FE;function pR(){if(FE)return dE;FE=1;var r=IA(),e=oA(),t=gi(),A=rl(),n=O0(),i=bE(),s=EE();return r({target:"Promise",stat:!0,forced:s},{all:function(o){var l=this,u=A.f(l),f=u.resolve,h=u.reject,c=n(function(){var g=t(l.resolve),p=[],y=0,w=1;i(o,function(B){var x=y++,E=!1;w++,e(g,l,B).then(function(Q){E||(E=!0,p[x]=Q,--w||f(p))},h)}),--w||f(p)});return c.error&&h(c.value),u.promise}}),dE}var SE={},UE;function vR(){if(UE)return SE;UE=1;var r=IA(),e=Yn(),t=tl().CONSTRUCTOR,A=el(),n=Ra(),i=_r(),s=Ma(),a=A&&A.prototype;if(r({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(l){return this.then(void 0,l)}}),!e&&i(A)){var o=n("Promise").prototype.catch;a.catch!==o&&s(a,"catch",o,{unsafe:!0})}return SE}var _E={},IE;function mR(){if(IE)return _E;IE=1;var r=IA(),e=oA(),t=gi(),A=rl(),n=O0(),i=bE(),s=EE();return r({target:"Promise",stat:!0,forced:s},{race:function(o){var l=this,u=A.f(l),f=u.reject,h=n(function(){var c=t(l.resolve);i(o,function(g){e(c,l,g).then(u.resolve,f)})});return h.error&&f(h.value),u.promise}}),_E}var QE={},NE;function wR(){if(NE)return QE;NE=1;var r=IA(),e=rl(),t=tl().CONSTRUCTOR;return r({target:"Promise",stat:!0,forced:t},{reject:function(n){var i=e.f(this),s=i.reject;return s(n),i.promise}}),QE}var OE={},V0,TE;function yR(){if(TE)return V0;TE=1;var r=_A(),e=DA(),t=rl();return V0=function(A,n){if(r(A),e(n)&&n.constructor===A)return n;var i=t.f(A),s=i.resolve;return s(n),i.promise},V0}var LE;function BR(){if(LE)return OE;LE=1;var r=IA(),e=Ra(),t=Yn(),A=el(),n=tl().CONSTRUCTOR,i=yR(),s=e("Promise"),a=t&&!n;return r({target:"Promise",stat:!0,forced:t||n},{resolve:function(l){return i(a&&this===s?A:this,l)}}),OE}var PE;function bR(){return PE||(PE=1,cR(),pR(),vR(),mR(),wR(),BR()),e5}bR();function RE(r,e,t,A,n,i,s){try{var a=r[i](s),o=a.value}catch(l){return void t(l)}a.done?e(o):Promise.resolve(o).then(A,n)}function pi(r){return function(){var e=this,t=arguments;return new Promise(function(A,n){var i=r.apply(e,t);function s(o){RE(i,A,n,s,a,"next",o)}function a(o){RE(i,A,n,s,a,"throw",o)}s(void 0)})}}var ME={},DE={},z0,kE;function $n(){if(kE)return z0;kE=1;var r=h0(),e=String;return z0=function(t){if(r(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(t)},z0}var G0,HE;function jE(){if(HE)return G0;HE=1;var r=_A();return G0=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},G0}var W0,KE;function qE(){if(KE)return W0;KE=1;var r=gr(),e=or(),t=e.RegExp,A=r(function(){var s=t("a","y");return s.lastIndex=2,s.exec("abcd")!==null}),n=A||r(function(){return!t("a","y").sticky}),i=A||r(function(){var s=t("^r","gy");return s.lastIndex=2,s.exec("str")!==null});return W0={BROKEN_CARET:i,MISSED_STICKY:n,UNSUPPORTED_Y:A},W0}var X0={},Y0,VE;function xR(){if(VE)return Y0;VE=1;var r=pC(),e=Wp();return Y0=Object.keys||function(A){return r(A,e)},Y0}var zE;function CR(){if(zE)return X0;zE=1;var r=_n(),e=X5(),t=ea(),A=_A(),n=$o(),i=xR();return X0.f=r&&!e?Object.defineProperties:function(a,o){A(a);for(var l=n(o),u=i(o),f=u.length,h=0,c;f>h;)t.f(a,c=u[h++],l[c]);return a},X0}var $0,GE;function cf(){if(GE)return $0;GE=1;var r=_A(),e=CR(),t=Wp(),A=Lp(),n=XC(),i=rf(),s=Op(),a=">",o="<",l="prototype",u="script",f=s("IE_PROTO"),h=function(){},c=function(B){return o+u+a+B+o+"/"+u+a},g=function(B){B.write(c("")),B.close();var x=B.parentWindow.Object;return B=null,x},p=function(){var B=i("iframe"),x="java"+u+":",E;return B.style.display="none",n.appendChild(B),B.src=String(x),E=B.contentWindow.document,E.open(),E.write(c("document.F=Object")),E.close(),E.F},y,w=function(){try{y=new ActiveXObject("htmlfile")}catch{}w=typeof document<"u"?document.domain&&y?g(y):p():g(y);for(var B=t.length;B--;)delete w[l][t[B]];return w()};return A[f]=!0,$0=Object.create||function(x,E){var Q;return x!==null?(h[l]=r(x),Q=new h,h[l]=null,Q[f]=x):Q=w(),E===void 0?Q:e.f(Q,E)},$0}var J0,WE;function ER(){if(WE)return J0;WE=1;var r=gr(),e=or(),t=e.RegExp;return J0=r(function(){var A=t(".","s");return!(A.dotAll&&A.test(`
|
|
781
781
|
`)&&A.flags==="s")}),J0}var Z0,XE;function FR(){if(XE)return Z0;XE=1;var r=gr(),e=or(),t=e.RegExp;return Z0=r(function(){var A=t("(?<a>b)","g");return A.exec("b").groups.a!=="b"||"b".replace(A,"$<a>c")!=="bc"}),Z0}var e1,YE;function t1(){if(YE)return e1;YE=1;var r=oA(),e=pr(),t=$n(),A=jE(),n=qE(),i=dp(),s=cf(),a=af().get,o=ER(),l=FR(),u=i("native-string-replace",String.prototype.replace),f=RegExp.prototype.exec,h=f,c=e("".charAt),g=e("".indexOf),p=e("".replace),y=e("".slice),w=(function(){var Q=/a/,L=/b*/g;return r(f,Q,"a"),r(f,L,"a"),Q.lastIndex!==0||L.lastIndex!==0})(),B=n.BROKEN_CARET,x=/()??/.exec("")[1]!==void 0,E=w||x||B||o||l;return E&&(h=function(L){var S=this,T=a(S),_=t(L),D=T.raw,U,O,M,C,z,re,ne;if(D)return D.lastIndex=S.lastIndex,U=r(h,D,_),S.lastIndex=D.lastIndex,U;var Z=T.groups,Ae=B&&S.sticky,V=r(A,S),k=S.source,I=0,P=_;if(Ae&&(V=p(V,"y",""),g(V,"g")===-1&&(V+="g"),P=y(_,S.lastIndex),S.lastIndex>0&&(!S.multiline||S.multiline&&c(_,S.lastIndex-1)!==`
|
|
782
|
-
`)&&(k="(?: "+k+")",P=" "+P,I++),O=new RegExp("^(?:"+k+")",V)),x&&(O=new RegExp("^"+k+"$(?!\\s)",V)),w&&(M=S.lastIndex),C=r(f,Ae?O:S,P),Ae?C?(C.input=y(C.input,I),C[0]=y(C[0],I),C.index=S.lastIndex,S.lastIndex+=C[0].length):S.lastIndex=0:w&&C&&(S.lastIndex=S.global?C.index+C[0].length:M),x&&C&&C.length>1&&r(u,C[0],O,function(){for(z=1;z<arguments.length-2;z++)arguments[z]===void 0&&(C[z]=void 0)}),C&&Z)for(C.groups=re=s(null),z=0;z<Z.length;z++)ne=Z[z],re[ne[0]]=C[ne[1]];return C}),e1=h,e1}var $E;function SR(){if($E)return DE;$E=1;var r=IA(),e=t1();return r({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e}),DE}var r1,JE;function A1(){if(JE)return r1;JE=1,SR();var r=oA(),e=Ma(),t=t1(),A=gr(),n=rA(),i=Zo(),s=n("species"),a=RegExp.prototype;return r1=function(o,l,u,f){var h=n(o),c=!A(function(){var w={};return w[h]=function(){return 7},""[o](w)!==7}),g=c&&!A(function(){var w=!1,B=/a/;if(o==="split"){var x={};x[s]=function(){return B},B={constructor:x,flags:""},B[h]=/./[h]}return B.exec=function(){return w=!0,null},B[h](""),!w});if(!c||!g||u){var p=/./[h],y=l(h,""[o],function(w,B,x,E,Q){var L=B.exec;return L===t||L===a.exec?c&&!Q?{done:!0,value:r(p,B,x,E)}:{done:!0,value:r(w,x,B,E)}:{done:!1}});e(String.prototype,o,y[0]),e(a,h,y[1])}f&&i(a[h],"sham",!0)},r1}var n1,ZE;function UR(){if(ZE)return n1;ZE=1;var r=pr(),e=sf(),t=$n(),A=In(),n=r("".charAt),i=r("".charCodeAt),s=r("".slice),a=function(o){return function(l,u){var f=t(A(l)),h=e(u),c=f.length,g,p;return h<0||h>=c?o?"":void 0:(g=i(f,h),g<55296||g>56319||h+1===c||(p=i(f,h+1))<56320||p>57343?o?n(f,h):g:o?s(f,h,h+2):(g-55296<<10)+(p-56320)+65536)}};return n1={codeAt:a(!1),charAt:a(!0)},n1}var i1,e4;function a1(){if(e4)return i1;e4=1;var r=UR().charAt;return i1=function(e,t,A){return t+(A?r(e,t).length:1)},i1}var s1,t4;function _R(){if(t4)return s1;t4=1;var r=or(),e=gr(),t=r.RegExp,A=!e(function(){var n=!0;try{t(".","d")}catch{n=!1}var i={},s="",a=n?"dgimsy":"gimsy",o=function(h,c){Object.defineProperty(i,h,{get:function(){return s+=c,!0}})},l={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};n&&(l.hasIndices="d");for(var u in l)o(u,l[u]);var f=Object.getOwnPropertyDescriptor(t.prototype,"flags").get.call(i);return f!==a||s!==a});return s1={correct:A},s1}var o1,r4;function l1(){if(r4)return o1;r4=1;var r=oA(),e=Qn(),t=Zc(),A=_R(),n=jE(),i=RegExp.prototype;return o1=A.correct?function(s){return s.flags}:function(s){return!A.correct&&t(i,s)&&!e(s,"flags")?r(n,s):s.flags},o1}var u1,A4;function c1(){if(A4)return u1;A4=1;var r=oA(),e=_A(),t=_r(),A=Pa(),n=t1(),i=TypeError;return u1=function(s,a){var o=s.exec;if(t(o)){var l=r(o,s,a);return l!==null&&e(l),l}if(A(s)==="RegExp")return r(n,s,a);throw new i("RegExp#exec called on incompatible receiver")},u1}var n4;function IR(){if(n4)return ME;n4=1;var r=oA(),e=pr(),t=A1(),A=_A(),n=DA(),i=Ms(),s=$n(),a=In(),o=Rs(),l=a1(),u=l1(),f=c1(),h=e("".indexOf);return t("match",function(c,g,p){return[function(w){var B=a(this),x=n(w)?o(w,c):void 0;return x?r(x,w,B):new RegExp(w)[c](s(B))},function(y){var w=A(this),B=s(y),x=p(g,w,B);if(x.done)return x.value;var E=s(u(w));if(h(E,"g")===-1)return f(w,B);var Q=h(E,"u")!==-1;w.lastIndex=0;for(var L=[],S=0,T;(T=f(w,B))!==null;){var _=s(T[0]);L[S]=_,_===""&&(w.lastIndex=l(B,i(w.lastIndex),Q)),S++}return S===0?null:L}]}),ME}IR();var i4={},f1,a4;function QR(){if(a4)return f1;a4=1;var r=pr(),e=tf(),t=Math.floor,A=r("".charAt),n=r("".replace),i=r("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;return f1=function(o,l,u,f,h,c){var g=u+o.length,p=f.length,y=a;return h!==void 0&&(h=e(h),y=s),n(c,y,function(w,B){var x;switch(A(B,0)){case"$":return"$";case"&":return o;case"`":return i(l,0,u);case"'":return i(l,g);case"<":x=h[i(B,1,-1)];break;default:var E=+B;if(E===0)return w;if(E>p){var Q=t(E/10);return Q===0?w:Q<=p?f[Q-1]===void 0?A(B,1):f[Q-1]+A(B,1):w}x=f[E-1]}return x===void 0?"":x})},f1}var s4;function NR(){if(s4)return i4;s4=1;var r=VC(),e=oA(),t=pr(),A=A1(),n=gr(),i=_A(),s=_r(),a=DA(),o=sf(),l=Ms(),u=$n(),f=In(),h=a1(),c=Rs(),g=QR(),p=l1(),y=c1(),w=rA(),B=w("replace"),x=Math.max,E=Math.min,Q=t([].concat),L=t([].push),S=t("".indexOf),T=t("".slice),_=function(M){return M===void 0?M:String(M)},D=(function(){return"a".replace(/./,"$0")==="$0"})(),U=(function(){return/./[B]?/./[B]("a","$0")==="":!1})(),O=!n(function(){var M=/./;return M.exec=function(){var C=[];return C.groups={a:"7"},C},"".replace(M,"$<a>")!=="7"});return A("replace",function(M,C,z){var re=U?"$":"$0";return[function(Z,Ae){var V=f(this),k=a(Z)?c(Z,B):void 0;return k?e(k,Z,V,Ae):e(C,u(V),Z,Ae)},function(ne,Z){var Ae=i(this),V=u(ne);if(typeof Z=="string"&&S(Z,re)===-1&&S(Z,"$<")===-1){var k=z(C,Ae,V,Z);if(k.done)return k.value}var I=s(Z);I||(Z=u(Z));var P=u(p(Ae)),K=S(P,"g")!==-1,Y;K&&(Y=S(P,"u")!==-1,Ae.lastIndex=0);for(var J=[],q;q=y(Ae,V),!(q===null||(L(J,q),!K));){var W=u(q[0]);W===""&&(Ae.lastIndex=h(V,l(Ae.lastIndex),Y))}for(var te="",oe=0,we=0;we<J.length;we++){q=J[we];for(var le=u(q[0]),Be=x(E(o(q.index),V.length),0),ye=[],R,Ie=1;Ie<q.length;Ie++)L(ye,_(q[Ie]));var Ue=q.groups;if(I){var Re=Q([le],ye,Be,V);Ue!==void 0&&L(Re,Ue),R=u(r(Z,void 0,Re))}else R=g(le,V,Be,ye,Ue,Z);Be>=oe&&(te+=T(V,oe,Be)+R,oe=Be+le.length)}return te+T(V,oe)}]},!O||!D||U),i4}NR();var o4={},h1,l4;function OR(){if(l4)return h1;l4=1;var r=DA(),e=Pa(),t=rA(),A=t("match");return h1=function(n){var i;return r(n)&&((i=n[A])!==void 0?!!i:e(n)==="RegExp")},h1}var d1,u4;function g1(){if(u4)return d1;u4=1;var r=OR(),e=TypeError;return d1=function(t){if(r(t))throw new e("The method doesn't accept regular expressions");return t},d1}var p1,c4;function v1(){if(c4)return p1;c4=1;var r=rA(),e=r("match");return p1=function(t){var A=/./;try{"/./"[t](A)}catch{try{return A[e]=!1,"/./"[t](A)}catch{}}return!1},p1}var f4;function TR(){if(f4)return o4;f4=1;var r=IA(),e=uf(),t=Af().f,A=Ms(),n=$n(),i=g1(),s=In(),a=v1(),o=Yn(),l=e("".slice),u=Math.min,f=a("startsWith"),h=!o&&!f&&!!(function(){var c=t(String.prototype,"startsWith");return c&&!c.writable})();return r({target:"String",proto:!0,forced:!h&&!f},{startsWith:function(g){var p=n(s(this));i(g);var y=A(u(arguments.length>1?arguments[1]:void 0,p.length)),w=n(g);return l(p,y,y+w.length)===w}}),o4}TR();var m1,h4;function LR(){if(h4)return m1;h4=1;var r=rA(),e=cf(),t=ea().f,A=r("unscopables"),n=Array.prototype;return n[A]===void 0&&t(n,A,{configurable:!0,value:e(null)}),m1=function(i){n[A][i]=!0},m1}var w1,d4;function PR(){if(d4)return w1;d4=1;var r=gr();return w1=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),w1}var y1,g4;function p4(){if(g4)return y1;g4=1;var r=Qn(),e=_r(),t=tf(),A=Op(),n=PR(),i=A("IE_PROTO"),s=Object,a=s.prototype;return y1=n?s.getPrototypeOf:function(o){var l=t(o);if(r(l,i))return l[i];var u=l.constructor;return e(u)&&l instanceof u?u.prototype:l instanceof s?a:null},y1}var B1,v4;function m4(){if(v4)return B1;v4=1;var r=gr(),e=_r(),t=DA(),A=cf(),n=p4(),i=Ma(),s=rA(),a=Yn(),o=s("iterator"),l=!1,u,f,h;[].keys&&(h=[].keys(),"next"in h?(f=n(n(h)),f!==Object.prototype&&(u=f)):l=!0);var c=!t(u)||r(function(){var g={};return u[o].call(g)!==g});return c?u={}:a&&(u=A(u)),e(u[o])||i(u,o,function(){return this}),B1={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:l},B1}var b1,w4;function RR(){if(w4)return b1;w4=1;var r=m4().IteratorPrototype,e=cf(),t=Hg(),A=lf(),n=Al(),i=function(){return this};return b1=function(s,a,o,l){var u=a+" Iterator";return s.prototype=e(r,{next:t(+!l,o)}),A(s,u,!1,!0),n[u]=i,s},b1}var x1,y4;function MR(){if(y4)return x1;y4=1;var r=IA(),e=oA(),t=Yn(),A=nf(),n=_r(),i=RR(),s=p4(),a=OC(),o=lf(),l=Zo(),u=Ma(),f=rA(),h=Al(),c=m4(),g=A.PROPER,p=A.CONFIGURABLE,y=c.IteratorPrototype,w=c.BUGGY_SAFARI_ITERATORS,B=f("iterator"),x="keys",E="values",Q="entries",L=function(){return this};return x1=function(S,T,_,D,U,O,M){i(_,T,D);var C=function(K){if(K===U&&Ae)return Ae;if(!w&&K&&K in ne)return ne[K];switch(K){case x:return function(){return new _(this,K)};case E:return function(){return new _(this,K)};case Q:return function(){return new _(this,K)}}return function(){return new _(this)}},z=T+" Iterator",re=!1,ne=S.prototype,Z=ne[B]||ne["@@iterator"]||U&&ne[U],Ae=!w&&Z||C(U),V=T==="Array"&&ne.entries||Z,k,I,P;if(V&&(k=s(V.call(new S)),k!==Object.prototype&&k.next&&(!t&&s(k)!==y&&(a?a(k,y):n(k[B])||u(k,B,L)),o(k,z,!0,!0),t&&(h[z]=L))),g&&U===E&&Z&&Z.name!==E&&(!t&&p?l(ne,"name",E):(re=!0,Ae=function(){return e(Z,this)})),U)if(I={values:C(E),keys:O?Ae:C(x),entries:C(Q)},M)for(P in I)(w||re||!(P in ne))&&u(ne,P,I[P]);else r({target:T,proto:!0,forced:w||re},I);return(!t||M)&&ne[B]!==Ae&&u(ne,B,Ae,{name:U}),h[T]=Ae,I},x1}var C1,B4;function DR(){return B4||(B4=1,C1=function(r,e){return{value:r,done:e}}),C1}var E1,b4;function x4(){if(b4)return E1;b4=1;var r=$o(),e=LR(),t=Al(),A=af(),n=ea().f,i=MR(),s=DR(),a=Yn(),o=_n(),l="Array Iterator",u=A.set,f=A.getterFor(l);E1=i(Array,"Array",function(c,g){u(this,{type:l,target:r(c),index:0,kind:g})},function(){var c=f(this),g=c.target,p=c.index++;if(!g||p>=g.length)return c.target=null,s(void 0,!0);switch(c.kind){case"keys":return s(p,!1);case"values":return s(g[p],!1)}return s([p,g[p]],!1)},"values");var h=t.Arguments=t.Array;if(e("keys"),e("values"),e("entries"),!a&&o&&h.name!=="values")try{n(h,"name",{value:"values"})}catch{}return E1}x4();var C4={},F1,E4;function kR(){return E4||(E4=1,F1={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),F1}var S1,F4;function HR(){if(F4)return S1;F4=1;var r=rf(),e=r("span").classList,t=e&&e.constructor&&e.constructor.prototype;return S1=t===Object.prototype?void 0:t,S1}var S4;function jR(){if(S4)return C4;S4=1;var r=or(),e=kR(),t=HR(),A=x4(),n=Zo(),i=lf(),s=rA(),a=s("iterator"),o=A.values,l=function(f,h){if(f){if(f[a]!==o)try{n(f,a,o)}catch{f[a]=o}if(i(f,h,!0),e[h]){for(var c in A)if(f[c]!==A[c])try{n(f,c,A[c])}catch{f[c]=A[c]}}}};for(var u in e)l(r[u]&&r[u].prototype,u);return l(t,"DOMTokenList"),C4}jR();function KR(r,e){if(Dt(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var A=t.call(r,e);if(Dt(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function qR(r){var e=KR(r,"string");return Dt(e)=="symbol"?e:e+""}function U1(r,e,t){return(e=qR(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var U4={},_1,_4;function VR(){if(_4)return _1;_4=1;var r=gi(),e=tf(),t=f5(),A=qp(),n=TypeError,i="Reduce of empty array with no initial value",s=function(a){return function(o,l,u,f){var h=e(o),c=t(h),g=A(h);if(r(l),g===0&&u<2)throw new n(i);var p=a?g-1:0,y=a?-1:1;if(u<2)for(;;){if(p in c){f=c[p],p+=y;break}if(p+=y,a?p<0:g<=p)throw new n(i)}for(;a?p>=0:g>p;p+=y)p in c&&(f=l(f,c[p],p,h));return f}};return _1={left:s(!1),right:s(!0)},_1}var I1,I4;function Q4(){if(I4)return I1;I4=1;var r=gr();return I1=function(e,t){var A=[][e];return!!A&&r(function(){A.call(null,t||function(){return 1},1)})},I1}var N4;function zR(){if(N4)return U4;N4=1;var r=IA(),e=VR().left,t=Q4(),A=ep(),n=of(),i=!n&&A>79&&A<83,s=i||!t("reduce");return r({target:"Array",proto:!0,forced:s},{reduce:function(o){var l=arguments.length;return e(this,o,l,l>1?arguments[1]:void 0)}}),U4}zR();var O4={},T4;function GR(){if(T4)return O4;T4=1;var r=IA(),e=uf(),t=Af().f,A=Ms(),n=$n(),i=g1(),s=In(),a=v1(),o=Yn(),l=e("".slice),u=Math.min,f=a("endsWith"),h=!o&&!f&&!!(function(){var c=t(String.prototype,"endsWith");return c&&!c.writable})();return r({target:"String",proto:!0,forced:!h&&!f},{endsWith:function(g){var p=n(s(this));i(g);var y=arguments.length>1?arguments[1]:void 0,w=p.length,B=y===void 0?w:u(A(y),w),x=n(g);return l(p,B-x.length,B)===x}}),O4}GR();var L4={},P4;function WR(){if(P4)return L4;P4=1;var r=oA(),e=pr(),t=A1(),A=_A(),n=DA(),i=In(),s=KC(),a=a1(),o=Ms(),l=$n(),u=Rs(),f=c1(),h=qE(),c=gr(),g=h.UNSUPPORTED_Y,p=4294967295,y=Math.min,w=e([].push),B=e("".slice),x=!c(function(){var Q=/(?:)/,L=Q.exec;Q.exec=function(){return L.apply(this,arguments)};var S="ab".split(Q);return S.length!==2||S[0]!=="a"||S[1]!=="b"}),E="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;return t("split",function(Q,L,S){var T="0".split(void 0,0).length?function(_,D){return _===void 0&&D===0?[]:r(L,this,_,D)}:L;return[function(D,U){var O=i(this),M=n(D)?u(D,Q):void 0;return M?r(M,D,O,U):r(T,l(O),D,U)},function(_,D){var U=A(this),O=l(_);if(!E){var M=S(T,U,O,D,T!==L);if(M.done)return M.value}var C=s(U,RegExp),z=U.unicode,re=(U.ignoreCase?"i":"")+(U.multiline?"m":"")+(U.unicode?"u":"")+(g?"g":"y"),ne=new C(g?"^(?:"+U.source+")":U,re),Z=D===void 0?p:D>>>0;if(Z===0)return[];if(O.length===0)return f(ne,O)===null?[O]:[];for(var Ae=0,V=0,k=[];V<O.length;){ne.lastIndex=g?0:V;var I=f(ne,g?B(O,V):O),P;if(I===null||(P=y(o(ne.lastIndex+(g?V:0)),O.length))===Ae)V=a(O,V,z);else{if(w(k,B(O,Ae,V)),k.length===Z)return k;for(var K=1;K<=I.length-1;K++)if(w(k,I[K]),k.length===Z)return k;V=Ae=P}}return w(k,B(O,Ae)),k}]},E||!x,g),L4}WR();var nl={exports:{}},Da={exports:{}},XR=Da.exports,R4;function YR(){return R4||(R4=1,(function(){var r,e,t,A,n,i;typeof performance<"u"&&performance!==null&&performance.now?Da.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Da.exports=function(){return(r()-n)/1e6},e=process.hrtime,r=function(){var s;return s=e(),s[0]*1e9+s[1]},A=r(),i=process.uptime()*1e9,n=A-i):Date.now?(Da.exports=function(){return Date.now()-t},t=Date.now()):(Da.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(XR)),Da.exports}var M4;function $R(){if(M4)return nl.exports;M4=1;for(var r=YR(),e=typeof window>"u"?$f:window,t=["moz","webkit"],A="AnimationFrame",n=e["request"+A],i=e["cancel"+A]||e["cancelRequest"+A],s=0;!n&&s<t.length;s++)n=e[t[s]+"Request"+A],i=e[t[s]+"Cancel"+A]||e[t[s]+"CancelRequest"+A];if(!n||!i){var a=0,o=0,l=[],u=1e3/60;n=function(f){if(l.length===0){var h=r(),c=Math.max(0,u-(h-a));a=c+h,setTimeout(function(){var g=l.slice(0);l.length=0;for(var p=0;p<g.length;p++)if(!g[p].cancelled)try{g[p].callback(a)}catch(y){setTimeout(function(){throw y},0)}},Math.round(c))}return l.push({handle:++o,callback:f,cancelled:!1}),o},i=function(f){for(var h=0;h<l.length;h++)l[h].handle===f&&(l[h].cancelled=!0)}}return nl.exports=function(f){return n.call(e,f)},nl.exports.cancel=function(){i.apply(e,arguments)},nl.exports.polyfill=function(f){f||(f=e),f.requestAnimationFrame=n,f.cancelAnimationFrame=i},nl.exports}var JR=$R();const Q1=Ys(JR);var D4={},N1,k4;function H4(){return k4||(k4=1,N1=`
|
|
782
|
+
`)&&(k="(?: "+k+")",P=" "+P,I++),O=new RegExp("^(?:"+k+")",V)),x&&(O=new RegExp("^"+k+"$(?!\\s)",V)),w&&(M=S.lastIndex),C=r(f,Ae?O:S,P),Ae?C?(C.input=y(C.input,I),C[0]=y(C[0],I),C.index=S.lastIndex,S.lastIndex+=C[0].length):S.lastIndex=0:w&&C&&(S.lastIndex=S.global?C.index+C[0].length:M),x&&C&&C.length>1&&r(u,C[0],O,function(){for(z=1;z<arguments.length-2;z++)arguments[z]===void 0&&(C[z]=void 0)}),C&&Z)for(C.groups=re=s(null),z=0;z<Z.length;z++)ne=Z[z],re[ne[0]]=C[ne[1]];return C}),e1=h,e1}var $E;function SR(){if($E)return DE;$E=1;var r=IA(),e=t1();return r({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e}),DE}var r1,JE;function A1(){if(JE)return r1;JE=1,SR();var r=oA(),e=Ma(),t=t1(),A=gr(),n=rA(),i=Zo(),s=n("species"),a=RegExp.prototype;return r1=function(o,l,u,f){var h=n(o),c=!A(function(){var w={};return w[h]=function(){return 7},""[o](w)!==7}),g=c&&!A(function(){var w=!1,B=/a/;if(o==="split"){var x={};x[s]=function(){return B},B={constructor:x,flags:""},B[h]=/./[h]}return B.exec=function(){return w=!0,null},B[h](""),!w});if(!c||!g||u){var p=/./[h],y=l(h,""[o],function(w,B,x,E,Q){var L=B.exec;return L===t||L===a.exec?c&&!Q?{done:!0,value:r(p,B,x,E)}:{done:!0,value:r(w,x,B,E)}:{done:!1}});e(String.prototype,o,y[0]),e(a,h,y[1])}f&&i(a[h],"sham",!0)},r1}var n1,ZE;function UR(){if(ZE)return n1;ZE=1;var r=pr(),e=sf(),t=$n(),A=In(),n=r("".charAt),i=r("".charCodeAt),s=r("".slice),a=function(o){return function(l,u){var f=t(A(l)),h=e(u),c=f.length,g,p;return h<0||h>=c?o?"":void 0:(g=i(f,h),g<55296||g>56319||h+1===c||(p=i(f,h+1))<56320||p>57343?o?n(f,h):g:o?s(f,h,h+2):(g-55296<<10)+(p-56320)+65536)}};return n1={codeAt:a(!1),charAt:a(!0)},n1}var i1,e4;function a1(){if(e4)return i1;e4=1;var r=UR().charAt;return i1=function(e,t,A){return t+(A?r(e,t).length:1)},i1}var s1,t4;function _R(){if(t4)return s1;t4=1;var r=or(),e=gr(),t=r.RegExp,A=!e(function(){var n=!0;try{t(".","d")}catch{n=!1}var i={},s="",a=n?"dgimsy":"gimsy",o=function(h,c){Object.defineProperty(i,h,{get:function(){return s+=c,!0}})},l={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};n&&(l.hasIndices="d");for(var u in l)o(u,l[u]);var f=Object.getOwnPropertyDescriptor(t.prototype,"flags").get.call(i);return f!==a||s!==a});return s1={correct:A},s1}var o1,r4;function l1(){if(r4)return o1;r4=1;var r=oA(),e=Qn(),t=Zc(),A=_R(),n=jE(),i=RegExp.prototype;return o1=A.correct?function(s){return s.flags}:function(s){return!A.correct&&t(i,s)&&!e(s,"flags")?r(n,s):s.flags},o1}var u1,A4;function c1(){if(A4)return u1;A4=1;var r=oA(),e=_A(),t=_r(),A=Pa(),n=t1(),i=TypeError;return u1=function(s,a){var o=s.exec;if(t(o)){var l=r(o,s,a);return l!==null&&e(l),l}if(A(s)==="RegExp")return r(n,s,a);throw new i("RegExp#exec called on incompatible receiver")},u1}var n4;function IR(){if(n4)return ME;n4=1;var r=oA(),e=pr(),t=A1(),A=_A(),n=DA(),i=Ms(),s=$n(),a=In(),o=Rs(),l=a1(),u=l1(),f=c1(),h=e("".indexOf);return t("match",function(c,g,p){return[function(w){var B=a(this),x=n(w)?o(w,c):void 0;return x?r(x,w,B):new RegExp(w)[c](s(B))},function(y){var w=A(this),B=s(y),x=p(g,w,B);if(x.done)return x.value;var E=s(u(w));if(h(E,"g")===-1)return f(w,B);var Q=h(E,"u")!==-1;w.lastIndex=0;for(var L=[],S=0,T;(T=f(w,B))!==null;){var _=s(T[0]);L[S]=_,_===""&&(w.lastIndex=l(B,i(w.lastIndex),Q)),S++}return S===0?null:L}]}),ME}IR();var i4={},f1,a4;function QR(){if(a4)return f1;a4=1;var r=pr(),e=tf(),t=Math.floor,A=r("".charAt),n=r("".replace),i=r("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;return f1=function(o,l,u,f,h,c){var g=u+o.length,p=f.length,y=a;return h!==void 0&&(h=e(h),y=s),n(c,y,function(w,B){var x;switch(A(B,0)){case"$":return"$";case"&":return o;case"`":return i(l,0,u);case"'":return i(l,g);case"<":x=h[i(B,1,-1)];break;default:var E=+B;if(E===0)return w;if(E>p){var Q=t(E/10);return Q===0?w:Q<=p?f[Q-1]===void 0?A(B,1):f[Q-1]+A(B,1):w}x=f[E-1]}return x===void 0?"":x})},f1}var s4;function NR(){if(s4)return i4;s4=1;var r=VC(),e=oA(),t=pr(),A=A1(),n=gr(),i=_A(),s=_r(),a=DA(),o=sf(),l=Ms(),u=$n(),f=In(),h=a1(),c=Rs(),g=QR(),p=l1(),y=c1(),w=rA(),B=w("replace"),x=Math.max,E=Math.min,Q=t([].concat),L=t([].push),S=t("".indexOf),T=t("".slice),_=function(M){return M===void 0?M:String(M)},D=(function(){return"a".replace(/./,"$0")==="$0"})(),U=(function(){return/./[B]?/./[B]("a","$0")==="":!1})(),O=!n(function(){var M=/./;return M.exec=function(){var C=[];return C.groups={a:"7"},C},"".replace(M,"$<a>")!=="7"});return A("replace",function(M,C,z){var re=U?"$":"$0";return[function(Z,Ae){var V=f(this),k=a(Z)?c(Z,B):void 0;return k?e(k,Z,V,Ae):e(C,u(V),Z,Ae)},function(ne,Z){var Ae=i(this),V=u(ne);if(typeof Z=="string"&&S(Z,re)===-1&&S(Z,"$<")===-1){var k=z(C,Ae,V,Z);if(k.done)return k.value}var I=s(Z);I||(Z=u(Z));var P=u(p(Ae)),K=S(P,"g")!==-1,Y;K&&(Y=S(P,"u")!==-1,Ae.lastIndex=0);for(var J=[],q;q=y(Ae,V),!(q===null||(L(J,q),!K));){var W=u(q[0]);W===""&&(Ae.lastIndex=h(V,l(Ae.lastIndex),Y))}for(var te="",oe=0,we=0;we<J.length;we++){q=J[we];for(var le=u(q[0]),Be=x(E(o(q.index),V.length),0),ye=[],R,Ie=1;Ie<q.length;Ie++)L(ye,_(q[Ie]));var Ue=q.groups;if(I){var Te=Q([le],ye,Be,V);Ue!==void 0&&L(Te,Ue),R=u(r(Z,void 0,Te))}else R=g(le,V,Be,ye,Ue,Z);Be>=oe&&(te+=T(V,oe,Be)+R,oe=Be+le.length)}return te+T(V,oe)}]},!O||!D||U),i4}NR();var o4={},h1,l4;function OR(){if(l4)return h1;l4=1;var r=DA(),e=Pa(),t=rA(),A=t("match");return h1=function(n){var i;return r(n)&&((i=n[A])!==void 0?!!i:e(n)==="RegExp")},h1}var d1,u4;function g1(){if(u4)return d1;u4=1;var r=OR(),e=TypeError;return d1=function(t){if(r(t))throw new e("The method doesn't accept regular expressions");return t},d1}var p1,c4;function v1(){if(c4)return p1;c4=1;var r=rA(),e=r("match");return p1=function(t){var A=/./;try{"/./"[t](A)}catch{try{return A[e]=!1,"/./"[t](A)}catch{}}return!1},p1}var f4;function TR(){if(f4)return o4;f4=1;var r=IA(),e=uf(),t=Af().f,A=Ms(),n=$n(),i=g1(),s=In(),a=v1(),o=Yn(),l=e("".slice),u=Math.min,f=a("startsWith"),h=!o&&!f&&!!(function(){var c=t(String.prototype,"startsWith");return c&&!c.writable})();return r({target:"String",proto:!0,forced:!h&&!f},{startsWith:function(g){var p=n(s(this));i(g);var y=A(u(arguments.length>1?arguments[1]:void 0,p.length)),w=n(g);return l(p,y,y+w.length)===w}}),o4}TR();var m1,h4;function LR(){if(h4)return m1;h4=1;var r=rA(),e=cf(),t=ea().f,A=r("unscopables"),n=Array.prototype;return n[A]===void 0&&t(n,A,{configurable:!0,value:e(null)}),m1=function(i){n[A][i]=!0},m1}var w1,d4;function PR(){if(d4)return w1;d4=1;var r=gr();return w1=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),w1}var y1,g4;function p4(){if(g4)return y1;g4=1;var r=Qn(),e=_r(),t=tf(),A=Op(),n=PR(),i=A("IE_PROTO"),s=Object,a=s.prototype;return y1=n?s.getPrototypeOf:function(o){var l=t(o);if(r(l,i))return l[i];var u=l.constructor;return e(u)&&l instanceof u?u.prototype:l instanceof s?a:null},y1}var B1,v4;function m4(){if(v4)return B1;v4=1;var r=gr(),e=_r(),t=DA(),A=cf(),n=p4(),i=Ma(),s=rA(),a=Yn(),o=s("iterator"),l=!1,u,f,h;[].keys&&(h=[].keys(),"next"in h?(f=n(n(h)),f!==Object.prototype&&(u=f)):l=!0);var c=!t(u)||r(function(){var g={};return u[o].call(g)!==g});return c?u={}:a&&(u=A(u)),e(u[o])||i(u,o,function(){return this}),B1={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:l},B1}var b1,w4;function RR(){if(w4)return b1;w4=1;var r=m4().IteratorPrototype,e=cf(),t=Hg(),A=lf(),n=Al(),i=function(){return this};return b1=function(s,a,o,l){var u=a+" Iterator";return s.prototype=e(r,{next:t(+!l,o)}),A(s,u,!1,!0),n[u]=i,s},b1}var x1,y4;function MR(){if(y4)return x1;y4=1;var r=IA(),e=oA(),t=Yn(),A=nf(),n=_r(),i=RR(),s=p4(),a=OC(),o=lf(),l=Zo(),u=Ma(),f=rA(),h=Al(),c=m4(),g=A.PROPER,p=A.CONFIGURABLE,y=c.IteratorPrototype,w=c.BUGGY_SAFARI_ITERATORS,B=f("iterator"),x="keys",E="values",Q="entries",L=function(){return this};return x1=function(S,T,_,D,U,O,M){i(_,T,D);var C=function(K){if(K===U&&Ae)return Ae;if(!w&&K&&K in ne)return ne[K];switch(K){case x:return function(){return new _(this,K)};case E:return function(){return new _(this,K)};case Q:return function(){return new _(this,K)}}return function(){return new _(this)}},z=T+" Iterator",re=!1,ne=S.prototype,Z=ne[B]||ne["@@iterator"]||U&&ne[U],Ae=!w&&Z||C(U),V=T==="Array"&&ne.entries||Z,k,I,P;if(V&&(k=s(V.call(new S)),k!==Object.prototype&&k.next&&(!t&&s(k)!==y&&(a?a(k,y):n(k[B])||u(k,B,L)),o(k,z,!0,!0),t&&(h[z]=L))),g&&U===E&&Z&&Z.name!==E&&(!t&&p?l(ne,"name",E):(re=!0,Ae=function(){return e(Z,this)})),U)if(I={values:C(E),keys:O?Ae:C(x),entries:C(Q)},M)for(P in I)(w||re||!(P in ne))&&u(ne,P,I[P]);else r({target:T,proto:!0,forced:w||re},I);return(!t||M)&&ne[B]!==Ae&&u(ne,B,Ae,{name:U}),h[T]=Ae,I},x1}var C1,B4;function DR(){return B4||(B4=1,C1=function(r,e){return{value:r,done:e}}),C1}var E1,b4;function x4(){if(b4)return E1;b4=1;var r=$o(),e=LR(),t=Al(),A=af(),n=ea().f,i=MR(),s=DR(),a=Yn(),o=_n(),l="Array Iterator",u=A.set,f=A.getterFor(l);E1=i(Array,"Array",function(c,g){u(this,{type:l,target:r(c),index:0,kind:g})},function(){var c=f(this),g=c.target,p=c.index++;if(!g||p>=g.length)return c.target=null,s(void 0,!0);switch(c.kind){case"keys":return s(p,!1);case"values":return s(g[p],!1)}return s([p,g[p]],!1)},"values");var h=t.Arguments=t.Array;if(e("keys"),e("values"),e("entries"),!a&&o&&h.name!=="values")try{n(h,"name",{value:"values"})}catch{}return E1}x4();var C4={},F1,E4;function kR(){return E4||(E4=1,F1={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),F1}var S1,F4;function HR(){if(F4)return S1;F4=1;var r=rf(),e=r("span").classList,t=e&&e.constructor&&e.constructor.prototype;return S1=t===Object.prototype?void 0:t,S1}var S4;function jR(){if(S4)return C4;S4=1;var r=or(),e=kR(),t=HR(),A=x4(),n=Zo(),i=lf(),s=rA(),a=s("iterator"),o=A.values,l=function(f,h){if(f){if(f[a]!==o)try{n(f,a,o)}catch{f[a]=o}if(i(f,h,!0),e[h]){for(var c in A)if(f[c]!==A[c])try{n(f,c,A[c])}catch{f[c]=A[c]}}}};for(var u in e)l(r[u]&&r[u].prototype,u);return l(t,"DOMTokenList"),C4}jR();function KR(r,e){if(Dt(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var A=t.call(r,e);if(Dt(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function qR(r){var e=KR(r,"string");return Dt(e)=="symbol"?e:e+""}function U1(r,e,t){return(e=qR(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var U4={},_1,_4;function VR(){if(_4)return _1;_4=1;var r=gi(),e=tf(),t=f5(),A=qp(),n=TypeError,i="Reduce of empty array with no initial value",s=function(a){return function(o,l,u,f){var h=e(o),c=t(h),g=A(h);if(r(l),g===0&&u<2)throw new n(i);var p=a?g-1:0,y=a?-1:1;if(u<2)for(;;){if(p in c){f=c[p],p+=y;break}if(p+=y,a?p<0:g<=p)throw new n(i)}for(;a?p>=0:g>p;p+=y)p in c&&(f=l(f,c[p],p,h));return f}};return _1={left:s(!1),right:s(!0)},_1}var I1,I4;function Q4(){if(I4)return I1;I4=1;var r=gr();return I1=function(e,t){var A=[][e];return!!A&&r(function(){A.call(null,t||function(){return 1},1)})},I1}var N4;function zR(){if(N4)return U4;N4=1;var r=IA(),e=VR().left,t=Q4(),A=ep(),n=of(),i=!n&&A>79&&A<83,s=i||!t("reduce");return r({target:"Array",proto:!0,forced:s},{reduce:function(o){var l=arguments.length;return e(this,o,l,l>1?arguments[1]:void 0)}}),U4}zR();var O4={},T4;function GR(){if(T4)return O4;T4=1;var r=IA(),e=uf(),t=Af().f,A=Ms(),n=$n(),i=g1(),s=In(),a=v1(),o=Yn(),l=e("".slice),u=Math.min,f=a("endsWith"),h=!o&&!f&&!!(function(){var c=t(String.prototype,"endsWith");return c&&!c.writable})();return r({target:"String",proto:!0,forced:!h&&!f},{endsWith:function(g){var p=n(s(this));i(g);var y=arguments.length>1?arguments[1]:void 0,w=p.length,B=y===void 0?w:u(A(y),w),x=n(g);return l(p,B-x.length,B)===x}}),O4}GR();var L4={},P4;function WR(){if(P4)return L4;P4=1;var r=oA(),e=pr(),t=A1(),A=_A(),n=DA(),i=In(),s=KC(),a=a1(),o=Ms(),l=$n(),u=Rs(),f=c1(),h=qE(),c=gr(),g=h.UNSUPPORTED_Y,p=4294967295,y=Math.min,w=e([].push),B=e("".slice),x=!c(function(){var Q=/(?:)/,L=Q.exec;Q.exec=function(){return L.apply(this,arguments)};var S="ab".split(Q);return S.length!==2||S[0]!=="a"||S[1]!=="b"}),E="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;return t("split",function(Q,L,S){var T="0".split(void 0,0).length?function(_,D){return _===void 0&&D===0?[]:r(L,this,_,D)}:L;return[function(D,U){var O=i(this),M=n(D)?u(D,Q):void 0;return M?r(M,D,O,U):r(T,l(O),D,U)},function(_,D){var U=A(this),O=l(_);if(!E){var M=S(T,U,O,D,T!==L);if(M.done)return M.value}var C=s(U,RegExp),z=U.unicode,re=(U.ignoreCase?"i":"")+(U.multiline?"m":"")+(U.unicode?"u":"")+(g?"g":"y"),ne=new C(g?"^(?:"+U.source+")":U,re),Z=D===void 0?p:D>>>0;if(Z===0)return[];if(O.length===0)return f(ne,O)===null?[O]:[];for(var Ae=0,V=0,k=[];V<O.length;){ne.lastIndex=g?0:V;var I=f(ne,g?B(O,V):O),P;if(I===null||(P=y(o(ne.lastIndex+(g?V:0)),O.length))===Ae)V=a(O,V,z);else{if(w(k,B(O,Ae,V)),k.length===Z)return k;for(var K=1;K<=I.length-1;K++)if(w(k,I[K]),k.length===Z)return k;V=Ae=P}}return w(k,B(O,Ae)),k}]},E||!x,g),L4}WR();var nl={exports:{}},Da={exports:{}},XR=Da.exports,R4;function YR(){return R4||(R4=1,(function(){var r,e,t,A,n,i;typeof performance<"u"&&performance!==null&&performance.now?Da.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Da.exports=function(){return(r()-n)/1e6},e=process.hrtime,r=function(){var s;return s=e(),s[0]*1e9+s[1]},A=r(),i=process.uptime()*1e9,n=A-i):Date.now?(Da.exports=function(){return Date.now()-t},t=Date.now()):(Da.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(XR)),Da.exports}var M4;function $R(){if(M4)return nl.exports;M4=1;for(var r=YR(),e=typeof window>"u"?$f:window,t=["moz","webkit"],A="AnimationFrame",n=e["request"+A],i=e["cancel"+A]||e["cancelRequest"+A],s=0;!n&&s<t.length;s++)n=e[t[s]+"Request"+A],i=e[t[s]+"Cancel"+A]||e[t[s]+"CancelRequest"+A];if(!n||!i){var a=0,o=0,l=[],u=1e3/60;n=function(f){if(l.length===0){var h=r(),c=Math.max(0,u-(h-a));a=c+h,setTimeout(function(){var g=l.slice(0);l.length=0;for(var p=0;p<g.length;p++)if(!g[p].cancelled)try{g[p].callback(a)}catch(y){setTimeout(function(){throw y},0)}},Math.round(c))}return l.push({handle:++o,callback:f,cancelled:!1}),o},i=function(f){for(var h=0;h<l.length;h++)l[h].handle===f&&(l[h].cancelled=!0)}}return nl.exports=function(f){return n.call(e,f)},nl.exports.cancel=function(){i.apply(e,arguments)},nl.exports.polyfill=function(f){f||(f=e),f.requestAnimationFrame=n,f.cancelAnimationFrame=i},nl.exports}var JR=$R();const Q1=Ys(JR);var D4={},N1,k4;function H4(){return k4||(k4=1,N1=`
|
|
783
783
|
\v\f\r \u2028\u2029\uFEFF`),N1}var O1,j4;function ZR(){if(j4)return O1;j4=1;var r=pr(),e=In(),t=$n(),A=H4(),n=r("".replace),i=RegExp("^["+A+"]+"),s=RegExp("(^|[^"+A+"])["+A+"]+$"),a=function(o){return function(l){var u=t(e(l));return o&1&&(u=n(u,i,"")),o&2&&(u=n(u,s,"$1")),u}};return O1={start:a(1),end:a(2),trim:a(3)},O1}var T1,K4;function e8(){if(K4)return T1;K4=1;var r=nf().PROPER,e=gr(),t=H4(),A="
";return T1=function(n){return e(function(){return!!t[n]()||A[n]()!==A||r&&t[n].name!==n})},T1}var q4;function t8(){if(q4)return D4;q4=1;var r=IA(),e=ZR().trim,t=e8();return r({target:"String",proto:!0,forced:t("trim")},{trim:function(){return e(this)}}),D4}t8();var L1,V4;function r8(){return V4||(V4=1,L1=function(r){this.ok=!1,this.alpha=1,r.charAt(0)=="#"&&(r=r.substr(1,6)),r=r.replace(/ /g,""),r=r.toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};r=e[r]||r;for(var t=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),parseFloat(o[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}}],A=0;A<t.length;A++){var n=t[A].re,i=t[A].process,s=n.exec(r);if(s){var a=i(s);this.r=a[0],this.g=a[1],this.b=a[2],a.length>3&&(this.alpha=a[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var o=this.r.toString(16),l=this.g.toString(16),u=this.b.toString(16);return o.length==1&&(o="0"+o),l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),"#"+o+l+u},this.getHelpXML=function(){for(var o=new Array,l=0;l<t.length;l++)for(var u=t[l].example,f=0;f<u.length;f++)o[o.length]=u[f];for(var h in e)o[o.length]=h;var c=document.createElement("ul");c.setAttribute("id","rgbcolor-examples");for(var l=0;l<o.length;l++)try{var g=document.createElement("li"),p=new RGBColor(o[l]),y=document.createElement("div");y.style.cssText="margin: 3px; border: 1px solid black; background:"+p.toHex()+"; color:"+p.toHex(),y.appendChild(document.createTextNode("test"));var w=document.createTextNode(" "+o[l]+" -> "+p.toRGB()+" -> "+p.toHex());g.appendChild(y),g.appendChild(w),c.appendChild(g)}catch{}return c}}),L1}var A8=r8();const P1=Ys(A8);var z4={},G4;function n8(){if(G4)return z4;G4=1;var r=IA(),e=uf(),t=dC().indexOf,A=Q4(),n=e([].indexOf),i=!!n&&1/n([1],1,-0)<0,s=i||!A("indexOf");return r({target:"Array",proto:!0,forced:s},{indexOf:function(o){var l=arguments.length>1?arguments[1]:void 0;return i?n(this,o,l)||0:t(this,o,l)}}),z4}n8();var W4={},X4;function i8(){if(X4)return W4;X4=1;var r=IA(),e=pr(),t=g1(),A=In(),n=$n(),i=v1(),s=e("".indexOf);return r({target:"String",proto:!0,forced:!i("includes")},{includes:function(o){return!!~s(n(A(this)),n(t(o)),arguments.length>1?arguments[1]:void 0)}}),W4}i8();var Y4={},R1,$4;function a8(){if($4)return R1;$4=1;var r=Pa();return R1=Array.isArray||function(t){return r(t)==="Array"},R1}var J4;function s8(){if(J4)return Y4;J4=1;var r=IA(),e=pr(),t=a8(),A=e([].reverse),n=[1,2];return r({target:"Array",proto:!0,forced:String(n)===String(n.reverse())},{reverse:function(){return t(this)&&(this.length=this.length),A(this)}}),Y4}s8();/*! *****************************************************************************
|
|
784
784
|
Copyright (c) Microsoft Corporation.
|
|
785
785
|
|
|
@@ -794,5 +794,5 @@ ${e}
|
|
|
794
794
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
795
795
|
PERFORMANCE OF THIS SOFTWARE.
|
|
796
796
|
***************************************************************************** */var Z4=function(r,e){return(Z4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,A){t.__proto__=A}||function(t,A){for(var n in A)Object.prototype.hasOwnProperty.call(A,n)&&(t[n]=A[n])})(r,e)};function eF(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=r}Z4(r,e),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function o8(r){var e="";Array.isArray(r)||(r=[r]);for(var t=0;t<r.length;t++){var A=r[t];if(A.type===$e.CLOSE_PATH)e+="z";else if(A.type===$e.HORIZ_LINE_TO)e+=(A.relative?"h":"H")+A.x;else if(A.type===$e.VERT_LINE_TO)e+=(A.relative?"v":"V")+A.y;else if(A.type===$e.MOVE_TO)e+=(A.relative?"m":"M")+A.x+" "+A.y;else if(A.type===$e.LINE_TO)e+=(A.relative?"l":"L")+A.x+" "+A.y;else if(A.type===$e.CURVE_TO)e+=(A.relative?"c":"C")+A.x1+" "+A.y1+" "+A.x2+" "+A.y2+" "+A.x+" "+A.y;else if(A.type===$e.SMOOTH_CURVE_TO)e+=(A.relative?"s":"S")+A.x2+" "+A.y2+" "+A.x+" "+A.y;else if(A.type===$e.QUAD_TO)e+=(A.relative?"q":"Q")+A.x1+" "+A.y1+" "+A.x+" "+A.y;else if(A.type===$e.SMOOTH_QUAD_TO)e+=(A.relative?"t":"T")+A.x+" "+A.y;else{if(A.type!==$e.ARC)throw new Error('Unexpected command type "'+A.type+'" at index '+t+".");e+=(A.relative?"a":"A")+A.rX+" "+A.rY+" "+A.xRot+" "+ +A.lArcFlag+" "+ +A.sweepFlag+" "+A.x+" "+A.y}}return e}function M1(r,e){var t=r[0],A=r[1];return[t*Math.cos(e)-A*Math.sin(e),t*Math.sin(e)+A*Math.cos(e)]}function Nn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];for(var t=0;t<r.length;t++)if(typeof r[t]!="number")throw new Error("assertNumbers arguments["+t+"] is not a number. "+typeof r[t]+" == typeof "+r[t]);return!0}var ta=Math.PI;function D1(r,e,t){r.lArcFlag=r.lArcFlag===0?0:1,r.sweepFlag=r.sweepFlag===0?0:1;var A=r.rX,n=r.rY,i=r.x,s=r.y;A=Math.abs(r.rX),n=Math.abs(r.rY);var a=M1([(e-i)/2,(t-s)/2],-r.xRot/180*ta),o=a[0],l=a[1],u=Math.pow(o,2)/Math.pow(A,2)+Math.pow(l,2)/Math.pow(n,2);1<u&&(A*=Math.sqrt(u),n*=Math.sqrt(u)),r.rX=A,r.rY=n;var f=Math.pow(A,2)*Math.pow(l,2)+Math.pow(n,2)*Math.pow(o,2),h=(r.lArcFlag!==r.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(A,2)*Math.pow(n,2)-f)/f)),c=A*l/n*h,g=-n*o/A*h,p=M1([c,g],r.xRot/180*ta);r.cX=p[0]+(e+i)/2,r.cY=p[1]+(t+s)/2,r.phi1=Math.atan2((l-g)/n,(o-c)/A),r.phi2=Math.atan2((-l-g)/n,(-o-c)/A),r.sweepFlag===0&&r.phi2>r.phi1&&(r.phi2-=2*ta),r.sweepFlag===1&&r.phi2<r.phi1&&(r.phi2+=2*ta),r.phi1*=180/ta,r.phi2*=180/ta}function tF(r,e,t){Nn(r,e,t);var A=r*r+e*e-t*t;if(0>A)return[];if(A===0)return[[r*t/(r*r+e*e),e*t/(r*r+e*e)]];var n=Math.sqrt(A);return[[(r*t+e*n)/(r*r+e*e),(e*t-r*n)/(r*r+e*e)],[(r*t-e*n)/(r*r+e*e),(e*t+r*n)/(r*r+e*e)]]}var Pr,vi=Math.PI/180;function rF(r,e,t){return(1-t)*r+t*e}function AF(r,e,t,A){return r+Math.cos(A/180*ta)*e+Math.sin(A/180*ta)*t}function nF(r,e,t,A){var n=1e-6,i=e-r,s=t-e,a=3*i+3*(A-t)-6*s,o=6*(s-i),l=3*i;return Math.abs(a)<n?[-l/o]:(function(u,f,h){var c=u*u/4-f;if(c<-h)return[];if(c<=h)return[-u/2];var g=Math.sqrt(c);return[-u/2-g,-u/2+g]})(o/a,l/a,n)}function iF(r,e,t,A,n){var i=1-n;return r*(i*i*i)+e*(3*i*i*n)+t*(3*i*n*n)+A*(n*n*n)}(function(r){function e(){return n((function(a,o,l){return a.relative&&(a.x1!==void 0&&(a.x1+=o),a.y1!==void 0&&(a.y1+=l),a.x2!==void 0&&(a.x2+=o),a.y2!==void 0&&(a.y2+=l),a.x!==void 0&&(a.x+=o),a.y!==void 0&&(a.y+=l),a.relative=!1),a}))}function t(){var a=NaN,o=NaN,l=NaN,u=NaN;return n((function(f,h,c){return f.type&$e.SMOOTH_CURVE_TO&&(f.type=$e.CURVE_TO,a=isNaN(a)?h:a,o=isNaN(o)?c:o,f.x1=f.relative?h-a:2*h-a,f.y1=f.relative?c-o:2*c-o),f.type&$e.CURVE_TO?(a=f.relative?h+f.x2:f.x2,o=f.relative?c+f.y2:f.y2):(a=NaN,o=NaN),f.type&$e.SMOOTH_QUAD_TO&&(f.type=$e.QUAD_TO,l=isNaN(l)?h:l,u=isNaN(u)?c:u,f.x1=f.relative?h-l:2*h-l,f.y1=f.relative?c-u:2*c-u),f.type&$e.QUAD_TO?(l=f.relative?h+f.x1:f.x1,u=f.relative?c+f.y1:f.y1):(l=NaN,u=NaN),f}))}function A(){var a=NaN,o=NaN;return n((function(l,u,f){if(l.type&$e.SMOOTH_QUAD_TO&&(l.type=$e.QUAD_TO,a=isNaN(a)?u:a,o=isNaN(o)?f:o,l.x1=l.relative?u-a:2*u-a,l.y1=l.relative?f-o:2*f-o),l.type&$e.QUAD_TO){a=l.relative?u+l.x1:l.x1,o=l.relative?f+l.y1:l.y1;var h=l.x1,c=l.y1;l.type=$e.CURVE_TO,l.x1=((l.relative?0:u)+2*h)/3,l.y1=((l.relative?0:f)+2*c)/3,l.x2=(l.x+2*h)/3,l.y2=(l.y+2*c)/3}else a=NaN,o=NaN;return l}))}function n(a){var o=0,l=0,u=NaN,f=NaN;return function(h){if(isNaN(u)&&!(h.type&$e.MOVE_TO))throw new Error("path must start with moveto");var c=a(h,o,l,u,f);return h.type&$e.CLOSE_PATH&&(o=u,l=f),h.x!==void 0&&(o=h.relative?o+h.x:h.x),h.y!==void 0&&(l=h.relative?l+h.y:h.y),h.type&$e.MOVE_TO&&(u=o,f=l),c}}function i(a,o,l,u,f,h){return Nn(a,o,l,u,f,h),n((function(c,g,p,y){var w=c.x1,B=c.x2,x=c.relative&&!isNaN(y),E=c.x!==void 0?c.x:x?0:g,Q=c.y!==void 0?c.y:x?0:p;function L(I){return I*I}c.type&$e.HORIZ_LINE_TO&&o!==0&&(c.type=$e.LINE_TO,c.y=c.relative?0:p),c.type&$e.VERT_LINE_TO&&l!==0&&(c.type=$e.LINE_TO,c.x=c.relative?0:g),c.x!==void 0&&(c.x=c.x*a+Q*l+(x?0:f)),c.y!==void 0&&(c.y=E*o+c.y*u+(x?0:h)),c.x1!==void 0&&(c.x1=c.x1*a+c.y1*l+(x?0:f)),c.y1!==void 0&&(c.y1=w*o+c.y1*u+(x?0:h)),c.x2!==void 0&&(c.x2=c.x2*a+c.y2*l+(x?0:f)),c.y2!==void 0&&(c.y2=B*o+c.y2*u+(x?0:h));var S=a*u-o*l;if(c.xRot!==void 0&&(a!==1||o!==0||l!==0||u!==1))if(S===0)delete c.rX,delete c.rY,delete c.xRot,delete c.lArcFlag,delete c.sweepFlag,c.type=$e.LINE_TO;else{var T=c.xRot*Math.PI/180,_=Math.sin(T),D=Math.cos(T),U=1/L(c.rX),O=1/L(c.rY),M=L(D)*U+L(_)*O,C=2*_*D*(U-O),z=L(_)*U+L(D)*O,re=M*u*u-C*o*u+z*o*o,ne=C*(a*u+o*l)-2*(M*l*u+z*a*o),Z=M*l*l-C*a*l+z*a*a,Ae=(Math.atan2(ne,re-Z)+Math.PI)%Math.PI/2,V=Math.sin(Ae),k=Math.cos(Ae);c.rX=Math.abs(S)/Math.sqrt(re*L(k)+ne*V*k+Z*L(V)),c.rY=Math.abs(S)/Math.sqrt(re*L(V)-ne*V*k+Z*L(k)),c.xRot=180*Ae/Math.PI}return c.sweepFlag!==void 0&&0>S&&(c.sweepFlag=+!c.sweepFlag),c}))}function s(){return function(a){var o={};for(var l in a)o[l]=a[l];return o}}r.ROUND=function(a){function o(l){return Math.round(l*a)/a}return a===void 0&&(a=1e13),Nn(a),function(l){return l.x1!==void 0&&(l.x1=o(l.x1)),l.y1!==void 0&&(l.y1=o(l.y1)),l.x2!==void 0&&(l.x2=o(l.x2)),l.y2!==void 0&&(l.y2=o(l.y2)),l.x!==void 0&&(l.x=o(l.x)),l.y!==void 0&&(l.y=o(l.y)),l.rX!==void 0&&(l.rX=o(l.rX)),l.rY!==void 0&&(l.rY=o(l.rY)),l}},r.TO_ABS=e,r.TO_REL=function(){return n((function(a,o,l){return a.relative||(a.x1!==void 0&&(a.x1-=o),a.y1!==void 0&&(a.y1-=l),a.x2!==void 0&&(a.x2-=o),a.y2!==void 0&&(a.y2-=l),a.x!==void 0&&(a.x-=o),a.y!==void 0&&(a.y-=l),a.relative=!0),a}))},r.NORMALIZE_HVZ=function(a,o,l){return a===void 0&&(a=!0),o===void 0&&(o=!0),l===void 0&&(l=!0),n((function(u,f,h,c,g){if(isNaN(c)&&!(u.type&$e.MOVE_TO))throw new Error("path must start with moveto");return o&&u.type&$e.HORIZ_LINE_TO&&(u.type=$e.LINE_TO,u.y=u.relative?0:h),l&&u.type&$e.VERT_LINE_TO&&(u.type=$e.LINE_TO,u.x=u.relative?0:f),a&&u.type&$e.CLOSE_PATH&&(u.type=$e.LINE_TO,u.x=u.relative?c-f:c,u.y=u.relative?g-h:g),u.type&$e.ARC&&(u.rX===0||u.rY===0)&&(u.type=$e.LINE_TO,delete u.rX,delete u.rY,delete u.xRot,delete u.lArcFlag,delete u.sweepFlag),u}))},r.NORMALIZE_ST=t,r.QT_TO_C=A,r.INFO=n,r.SANITIZE=function(a){a===void 0&&(a=0),Nn(a);var o=NaN,l=NaN,u=NaN,f=NaN;return n((function(h,c,g,p,y){var w=Math.abs,B=!1,x=0,E=0;if(h.type&$e.SMOOTH_CURVE_TO&&(x=isNaN(o)?0:c-o,E=isNaN(l)?0:g-l),h.type&($e.CURVE_TO|$e.SMOOTH_CURVE_TO)?(o=h.relative?c+h.x2:h.x2,l=h.relative?g+h.y2:h.y2):(o=NaN,l=NaN),h.type&$e.SMOOTH_QUAD_TO?(u=isNaN(u)?c:2*c-u,f=isNaN(f)?g:2*g-f):h.type&$e.QUAD_TO?(u=h.relative?c+h.x1:h.x1,f=h.relative?g+h.y1:h.y2):(u=NaN,f=NaN),h.type&$e.LINE_COMMANDS||h.type&$e.ARC&&(h.rX===0||h.rY===0||!h.lArcFlag)||h.type&$e.CURVE_TO||h.type&$e.SMOOTH_CURVE_TO||h.type&$e.QUAD_TO||h.type&$e.SMOOTH_QUAD_TO){var Q=h.x===void 0?0:h.relative?h.x:h.x-c,L=h.y===void 0?0:h.relative?h.y:h.y-g;x=isNaN(u)?h.x1===void 0?x:h.relative?h.x:h.x1-c:u-c,E=isNaN(f)?h.y1===void 0?E:h.relative?h.y:h.y1-g:f-g;var S=h.x2===void 0?0:h.relative?h.x:h.x2-c,T=h.y2===void 0?0:h.relative?h.y:h.y2-g;w(Q)<=a&&w(L)<=a&&w(x)<=a&&w(E)<=a&&w(S)<=a&&w(T)<=a&&(B=!0)}return h.type&$e.CLOSE_PATH&&w(c-p)<=a&&w(g-y)<=a&&(B=!0),B?[]:h}))},r.MATRIX=i,r.ROTATE=function(a,o,l){o===void 0&&(o=0),l===void 0&&(l=0),Nn(a,o,l);var u=Math.sin(a),f=Math.cos(a);return i(f,u,-u,f,o-o*f+l*u,l-o*u-l*f)},r.TRANSLATE=function(a,o){return o===void 0&&(o=0),Nn(a,o),i(1,0,0,1,a,o)},r.SCALE=function(a,o){return o===void 0&&(o=a),Nn(a,o),i(a,0,0,o,0,0)},r.SKEW_X=function(a){return Nn(a),i(1,0,Math.atan(a),1,0,0)},r.SKEW_Y=function(a){return Nn(a),i(1,Math.atan(a),0,1,0,0)},r.X_AXIS_SYMMETRY=function(a){return a===void 0&&(a=0),Nn(a),i(-1,0,0,1,a,0)},r.Y_AXIS_SYMMETRY=function(a){return a===void 0&&(a=0),Nn(a),i(1,0,0,-1,0,a)},r.A_TO_C=function(){return n((function(a,o,l){return $e.ARC===a.type?(function(u,f,h){var c,g,p,y;u.cX||D1(u,f,h);for(var w=Math.min(u.phi1,u.phi2),B=Math.max(u.phi1,u.phi2)-w,x=Math.ceil(B/90),E=new Array(x),Q=f,L=h,S=0;S<x;S++){var T=rF(u.phi1,u.phi2,S/x),_=rF(u.phi1,u.phi2,(S+1)/x),D=_-T,U=4/3*Math.tan(D*vi/4),O=[Math.cos(T*vi)-U*Math.sin(T*vi),Math.sin(T*vi)+U*Math.cos(T*vi)],M=O[0],C=O[1],z=[Math.cos(_*vi),Math.sin(_*vi)],re=z[0],ne=z[1],Z=[re+U*Math.sin(_*vi),ne-U*Math.cos(_*vi)],Ae=Z[0],V=Z[1];E[S]={relative:u.relative,type:$e.CURVE_TO};var k=function(I,P){var K=M1([I*u.rX,P*u.rY],u.xRot),Y=K[0],J=K[1];return[u.cX+Y,u.cY+J]};c=k(M,C),E[S].x1=c[0],E[S].y1=c[1],g=k(Ae,V),E[S].x2=g[0],E[S].y2=g[1],p=k(re,ne),E[S].x=p[0],E[S].y=p[1],u.relative&&(E[S].x1-=Q,E[S].y1-=L,E[S].x2-=Q,E[S].y2-=L,E[S].x-=Q,E[S].y-=L),Q=(y=[E[S].x,E[S].y])[0],L=y[1]}return E})(a,a.relative?0:o,a.relative?0:l):a}))},r.ANNOTATE_ARCS=function(){return n((function(a,o,l){return a.relative&&(o=0,l=0),$e.ARC===a.type&&D1(a,o,l),a}))},r.CLONE=s,r.CALCULATE_BOUNDS=function(){var a=function(h){var c={};for(var g in h)c[g]=h[g];return c},o=e(),l=A(),u=t(),f=n((function(h,c,g){var p=u(l(o(a(h))));function y(V){V>f.maxX&&(f.maxX=V),V<f.minX&&(f.minX=V)}function w(V){V>f.maxY&&(f.maxY=V),V<f.minY&&(f.minY=V)}if(p.type&$e.DRAWING_COMMANDS&&(y(c),w(g)),p.type&$e.HORIZ_LINE_TO&&y(p.x),p.type&$e.VERT_LINE_TO&&w(p.y),p.type&$e.LINE_TO&&(y(p.x),w(p.y)),p.type&$e.CURVE_TO){y(p.x),w(p.y);for(var B=0,x=nF(c,p.x1,p.x2,p.x);B<x.length;B++)0<(Ae=x[B])&&1>Ae&&y(iF(c,p.x1,p.x2,p.x,Ae));for(var E=0,Q=nF(g,p.y1,p.y2,p.y);E<Q.length;E++)0<(Ae=Q[E])&&1>Ae&&w(iF(g,p.y1,p.y2,p.y,Ae))}if(p.type&$e.ARC){y(p.x),w(p.y),D1(p,c,g);for(var L=p.xRot/180*Math.PI,S=Math.cos(L)*p.rX,T=Math.sin(L)*p.rX,_=-Math.sin(L)*p.rY,D=Math.cos(L)*p.rY,U=p.phi1<p.phi2?[p.phi1,p.phi2]:-180>p.phi2?[p.phi2+360,p.phi1+360]:[p.phi2,p.phi1],O=U[0],M=U[1],C=function(V){var k=V[0],I=V[1],P=180*Math.atan2(I,k)/Math.PI;return P<O?P+360:P},z=0,re=tF(_,-S,0).map(C);z<re.length;z++)(Ae=re[z])>O&&Ae<M&&y(AF(p.cX,S,_,Ae));for(var ne=0,Z=tF(D,-T,0).map(C);ne<Z.length;ne++){var Ae;(Ae=Z[ne])>O&&Ae<M&&w(AF(p.cY,T,D,Ae))}}return h}));return f.minX=1/0,f.maxX=-1/0,f.minY=1/0,f.maxY=-1/0,f}})(Pr||(Pr={}));var On,aF=(function(){function r(){}return r.prototype.round=function(e){return this.transform(Pr.ROUND(e))},r.prototype.toAbs=function(){return this.transform(Pr.TO_ABS())},r.prototype.toRel=function(){return this.transform(Pr.TO_REL())},r.prototype.normalizeHVZ=function(e,t,A){return this.transform(Pr.NORMALIZE_HVZ(e,t,A))},r.prototype.normalizeST=function(){return this.transform(Pr.NORMALIZE_ST())},r.prototype.qtToC=function(){return this.transform(Pr.QT_TO_C())},r.prototype.aToC=function(){return this.transform(Pr.A_TO_C())},r.prototype.sanitize=function(e){return this.transform(Pr.SANITIZE(e))},r.prototype.translate=function(e,t){return this.transform(Pr.TRANSLATE(e,t))},r.prototype.scale=function(e,t){return this.transform(Pr.SCALE(e,t))},r.prototype.rotate=function(e,t,A){return this.transform(Pr.ROTATE(e,t,A))},r.prototype.matrix=function(e,t,A,n,i,s){return this.transform(Pr.MATRIX(e,t,A,n,i,s))},r.prototype.skewX=function(e){return this.transform(Pr.SKEW_X(e))},r.prototype.skewY=function(e){return this.transform(Pr.SKEW_Y(e))},r.prototype.xSymmetry=function(e){return this.transform(Pr.X_AXIS_SYMMETRY(e))},r.prototype.ySymmetry=function(e){return this.transform(Pr.Y_AXIS_SYMMETRY(e))},r.prototype.annotateArcs=function(){return this.transform(Pr.ANNOTATE_ARCS())},r})(),l8=function(r){return r===" "||r===" "||r==="\r"||r===`
|
|
797
|
-
`},sF=function(r){return 48<=r.charCodeAt(0)&&r.charCodeAt(0)<=57},u8=(function(r){function e(){var t=r.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return eF(e,r),e.prototype.finish=function(t){if(t===void 0&&(t=[]),this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,A){var n=this;A===void 0&&(A=[]);for(var i=function(f){A.push(f),n.curArgs.length=0,n.canParseCommandOrComma=!0},s=0;s<t.length;s++){var a=t[s],o=!(this.curCommandType!==$e.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),l=sF(a)&&(this.curNumber==="0"&&a==="0"||o);if(!sF(a)||l)if(a!=="e"&&a!=="E")if(a!=="-"&&a!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(a!=="."||this.curNumberHasExp||this.curNumberHasDecimal||o){if(this.curNumber&&this.curCommandType!==-1){var u=Number(this.curNumber);if(isNaN(u))throw new SyntaxError("Invalid number ending at "+s);if(this.curCommandType===$e.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>u)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+s+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+s+'"')}this.curArgs.push(u),this.curArgs.length===c8[this.curCommandType]&&($e.HORIZ_LINE_TO===this.curCommandType?i({type:$e.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):$e.VERT_LINE_TO===this.curCommandType?i({type:$e.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===$e.MOVE_TO||this.curCommandType===$e.LINE_TO||this.curCommandType===$e.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),$e.MOVE_TO===this.curCommandType&&(this.curCommandType=$e.LINE_TO)):this.curCommandType===$e.CURVE_TO?i({type:$e.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===$e.SMOOTH_CURVE_TO?i({type:$e.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===$e.QUAD_TO?i({type:$e.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===$e.ARC&&i({type:$e.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!l8(a))if(a===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(a!=="+"&&a!=="-"&&a!==".")if(l)this.curNumber=a,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+s+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+a+'" at index '+s+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,a!=="z"&&a!=="Z")if(a==="h"||a==="H")this.curCommandType=$e.HORIZ_LINE_TO,this.curCommandRelative=a==="h";else if(a==="v"||a==="V")this.curCommandType=$e.VERT_LINE_TO,this.curCommandRelative=a==="v";else if(a==="m"||a==="M")this.curCommandType=$e.MOVE_TO,this.curCommandRelative=a==="m";else if(a==="l"||a==="L")this.curCommandType=$e.LINE_TO,this.curCommandRelative=a==="l";else if(a==="c"||a==="C")this.curCommandType=$e.CURVE_TO,this.curCommandRelative=a==="c";else if(a==="s"||a==="S")this.curCommandType=$e.SMOOTH_CURVE_TO,this.curCommandRelative=a==="s";else if(a==="q"||a==="Q")this.curCommandType=$e.QUAD_TO,this.curCommandRelative=a==="q";else if(a==="t"||a==="T")this.curCommandType=$e.SMOOTH_QUAD_TO,this.curCommandRelative=a==="t";else{if(a!=="a"&&a!=="A")throw new SyntaxError('Unexpected character "'+a+'" at index '+s+".");this.curCommandType=$e.ARC,this.curCommandRelative=a==="a"}else A.push({type:$e.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=a,this.curNumberHasDecimal=a==="."}else this.curNumber+=a,this.curNumberHasDecimal=!0;else this.curNumber+=a;else this.curNumber+=a,this.curNumberHasExp=!0;else this.curNumber+=a,this.curNumberHasExpDigits=this.curNumberHasExp}return A},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(A,n){n===void 0&&(n=[]);for(var i=0,s=Object.getPrototypeOf(this).parse.call(this,A);i<s.length;i++){var a=s[i],o=t(a);Array.isArray(o)?n.push.apply(n,o):n.push(o)}return n}}})},e})(aF),$e=(function(r){function e(t){var A=r.call(this)||this;return A.commands=typeof t=="string"?e.parse(t):t,A}return eF(e,r),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=Pr.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var A=[],n=0,i=this.commands;n<i.length;n++){var s=t(i[n]);Array.isArray(s)?A.push.apply(A,s):A.push(s)}return this.commands=A,this},e.encode=function(t){return o8(t)},e.parse=function(t){var A=new u8,n=[];return A.parse(t,n),A.finish(n),n},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e})(aF),c8=((On={})[$e.MOVE_TO]=2,On[$e.LINE_TO]=2,On[$e.HORIZ_LINE_TO]=1,On[$e.VERT_LINE_TO]=1,On[$e.CLOSE_PATH]=0,On[$e.QUAD_TO]=4,On[$e.SMOOTH_QUAD_TO]=2,On[$e.CURVE_TO]=6,On[$e.SMOOTH_CURVE_TO]=4,On[$e.ARC]=7,On),oF={},lF;function f8(){if(lF)return oF;lF=1;var r=nf().PROPER,e=Ma(),t=_A(),A=$n(),n=gr(),i=l1(),s="toString",a=RegExp.prototype,o=a[s],l=n(function(){return o.call({source:"a",flags:"b"})!=="/a/b"}),u=r&&o.name!==s;return(l||u)&&e(a,s,function(){var h=t(this),c=A(h.source),g=A(i(h));return"/"+c+"/"+g},{unsafe:!0}),oF}f8();function ff(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ff=function(e){return typeof e}:ff=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ff(r)}function h8(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var d8=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],g8=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function p8(r,e,t,A,n){if(typeof r=="string"&&(r=document.getElementById(r)),!r||ff(r)!=="object"||!("getContext"in r))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var i=r.getContext("2d");try{return i.getImageData(e,t,A,n)}catch(s){throw new Error("unable to access image data: "+s)}}function v8(r,e,t,A,n,i){if(!(isNaN(i)||i<1)){i|=0;var s=p8(r,e,t,A,n);s=m8(s,e,t,A,n,i),r.getContext("2d").putImageData(s,e,t)}}function m8(r,e,t,A,n,i){for(var s=r.data,a=2*i+1,o=A-1,l=n-1,u=i+1,f=u*(u+1)/2,h=new uF,c=h,g,p=1;p<a;p++)c=c.next=new uF,p===u&&(g=c);c.next=h;for(var y=null,w=null,B=0,x=0,E=d8[i],Q=g8[i],L=0;L<n;L++){c=h;for(var S=s[x],T=s[x+1],_=s[x+2],D=s[x+3],U=0;U<u;U++)c.r=S,c.g=T,c.b=_,c.a=D,c=c.next;for(var O=0,M=0,C=0,z=0,re=u*S,ne=u*T,Z=u*_,Ae=u*D,V=f*S,k=f*T,I=f*_,P=f*D,K=1;K<u;K++){var Y=x+((o<K?o:K)<<2),J=s[Y],q=s[Y+1],W=s[Y+2],te=s[Y+3],oe=u-K;V+=(c.r=J)*oe,k+=(c.g=q)*oe,I+=(c.b=W)*oe,P+=(c.a=te)*oe,O+=J,M+=q,C+=W,z+=te,c=c.next}y=h,w=g;for(var we=0;we<A;we++){var le=P*E>>>Q;if(s[x+3]=le,le!==0){var Be=255/le;s[x]=(V*E>>>Q)*Be,s[x+1]=(k*E>>>Q)*Be,s[x+2]=(I*E>>>Q)*Be}else s[x]=s[x+1]=s[x+2]=0;V-=re,k-=ne,I-=Z,P-=Ae,re-=y.r,ne-=y.g,Z-=y.b,Ae-=y.a;var ye=we+i+1;ye=B+(ye<o?ye:o)<<2,O+=y.r=s[ye],M+=y.g=s[ye+1],C+=y.b=s[ye+2],z+=y.a=s[ye+3],V+=O,k+=M,I+=C,P+=z,y=y.next;var R=w,Ie=R.r,Ue=R.g,Re=R.b,Ee=R.a;re+=Ie,ne+=Ue,Z+=Re,Ae+=Ee,O-=Ie,M-=Ue,C-=Re,z-=Ee,w=w.next,x+=4}B+=A}for(var Ve=0;Ve<A;Ve++){x=Ve<<2;var Me=s[x],ze=s[x+1],Ye=s[x+2],xe=s[x+3],Oe=u*Me,je=u*ze,ge=u*Ye,Pe=u*xe,Te=f*Me,ue=f*ze,fe=f*Ye,Le=f*xe;c=h;for(var Fe=0;Fe<u;Fe++)c.r=Me,c.g=ze,c.b=Ye,c.a=xe,c=c.next;for(var Ne=A,ve=0,Qe=0,De=0,it=0,et=1;et<=i;et++){x=Ne+Ve<<2;var Ge=u-et;Te+=(c.r=Me=s[x])*Ge,ue+=(c.g=ze=s[x+1])*Ge,fe+=(c.b=Ye=s[x+2])*Ge,Le+=(c.a=xe=s[x+3])*Ge,it+=Me,ve+=ze,Qe+=Ye,De+=xe,c=c.next,et<l&&(Ne+=A)}x=Ve,y=h,w=g;for(var At=0;At<n;At++){var nt=x<<2;s[nt+3]=xe=Le*E>>>Q,xe>0?(xe=255/xe,s[nt]=(Te*E>>>Q)*xe,s[nt+1]=(ue*E>>>Q)*xe,s[nt+2]=(fe*E>>>Q)*xe):s[nt]=s[nt+1]=s[nt+2]=0,Te-=Oe,ue-=je,fe-=ge,Le-=Pe,Oe-=y.r,je-=y.g,ge-=y.b,Pe-=y.a,nt=Ve+((nt=At+u)<l?nt:l)*A<<2,Te+=it+=y.r=s[nt],ue+=ve+=y.g=s[nt+1],fe+=Qe+=y.b=s[nt+2],Le+=De+=y.a=s[nt+3],y=y.next,Oe+=Me=w.r,je+=ze=w.g,ge+=Ye=w.b,Pe+=xe=w.a,it-=Me,ve-=ze,Qe-=Ye,De-=xe,w=w.next,x+=A}}return r}var uF=function r(){h8(this,r),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function w8(){var{DOMParser:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:r,createCanvas(t,A){return new OffscreenCanvas(t,A)},createImage(t){return pi(function*(){var A=yield fetch(t),n=yield A.blob(),i=yield createImageBitmap(n);return i})()}};return(typeof DOMParser<"u"||typeof r>"u")&&Reflect.deleteProperty(e,"DOMParser"),e}function y8(r){var{DOMParser:e,canvas:t,fetch:A}=r;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:A,createCanvas:t.createCanvas,createImage:t.loadImage}}var B8=Object.freeze({__proto__:null,offscreen:w8,node:y8});function ka(r){return r.replace(/(?!\u3000)\s+/gm," ")}function cF(r){return r.replace(/^[\n \t]+/,"")}function fF(r){return r.replace(/[\n \t]+$/,"")}function kA(r){var e=(r||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return e.map(parseFloat)}var b8=/^[A-Z-]+$/;function hF(r){return b8.test(r)?r.toLowerCase():r}function k1(r){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(r)||[];return e[2]||e[3]||e[4]}function dF(r){if(!r.startsWith("rgb"))return r;var e=3,t=r.replace(/\d+(\.\d+)?/g,(A,n)=>e--&&n?String(Math.round(parseFloat(A))):A);return t}var x8=/(\[[^\]]+\])/g,C8=/(#[^\s+>~.[:]+)/g,E8=/(\.[^\s+>~.[:]+)/g,F8=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,S8=/(:[\w-]+\([^)]*\))/gi,U8=/(:[^\s+>~.[:]+)/g,_8=/([^\s+>~.[:]+)/g;function Ha(r,e){var t=e.exec(r);return t?[r.replace(e," "),t.length]:[r,0]}function gF(r){var e=[0,0,0],t=r.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),A=0;return[t,A]=Ha(t,x8),e[1]+=A,[t,A]=Ha(t,C8),e[0]+=A,[t,A]=Ha(t,E8),e[1]+=A,[t,A]=Ha(t,F8),e[2]+=A,[t,A]=Ha(t,S8),e[1]+=A,[t,A]=Ha(t,U8),e[1]+=A,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,A]=Ha(t,_8),e[2]+=A,e.join("")}var ja=1e-8;function H1(r){return Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2))}function hf(r,e){return(r[0]*e[0]+r[1]*e[1])/(H1(r)*H1(e))}function j1(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(hf(r,e))}function K1(r){return r*r*r}function q1(r){return 3*r*r*(1-r)}function V1(r){return 3*r*(1-r)*(1-r)}function z1(r){return(1-r)*(1-r)*(1-r)}function G1(r){return r*r}function W1(r){return 2*r*(1-r)}function X1(r){return(1-r)*(1-r)}class yt{constructor(e,t,A){this.document=e,this.name=t,this.value=A,this.isNormalizedColor=!1}static empty(e){return new yt(e,"EMPTY","")}split(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ",{document:t,name:A}=this;return ka(this.getString()).trim().split(e).map(n=>new yt(t,A,n))}hasValue(e){var{value:t}=this;return t!==null&&t!==""&&(e||t!==0)&&typeof t<"u"}isString(e){var{value:t}=this,A=typeof t=="string";return!A||!e?A:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);var{value:t}=this,A=parseFloat(t);return this.isString(/%$/)&&(A/=100),A}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=dF(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[A,n]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:i}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(i.computeSize("x"),i.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(i.computeSize("x"),i.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*i.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*i.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&n):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*i.computeSize(A);default:{var s=this.getNumber();return t&&s<1?s*i.computeSize(A):s}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var A=this.getDefinition();if(!A)return null;if(typeof A.createGradient=="function")return A.createGradient(this.document.ctx,e,t);if(typeof A.createPattern=="function"){if(A.getHrefAttribute().hasValue()){var n=A.getAttribute("patternTransform");A=A.getHrefAttribute().getDefinition(),n.hasValue()&&A.getAttribute("patternTransform",!0).setValue(n.value)}return A.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){return this.hasValue()?yt.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var t=this.getColor(),A=t.length,n=0,i=0;i<A&&(t[i]===","&&n++,n!==3);i++);if(e.hasValue()&&this.isString()&&n!==3){var s=new P1(t);s.ok&&(s.alpha=e.getNumber(),t=s.toRGBA())}return new yt(this.document,this.name,t)}}yt.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class pF{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:e}=this;return e[e.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return typeof e=="number"?e:e==="x"?this.width:e==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class vr{constructor(e,t){this.x=e,this.y=t}static parse(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,[A=t,n=t]=kA(e);return new vr(A,n)}static parseScale(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[A=t,n=A]=kA(e);return new vr(A,n)}static parsePath(e){for(var t=kA(e),A=t.length,n=[],i=0;i<A;i+=2)n.push(new vr(t[i],t[i+1]));return n}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){var{x:t,y:A}=this,n=t*e[0]+A*e[2]+e[4],i=t*e[1]+A*e[3]+e[5];this.x=n,this.y=i}}class vF{constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:e,onClick:t,onMouseMove:A}=this,n=e.ctx.canvas;n.onclick=t,n.onmousemove=A,this.working=!0}}stop(){if(this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:e,events:t,eventElements:A}=this,{style:n}=e.ctx.canvas;n&&(n.cursor=""),t.forEach((i,s)=>{for(var{run:a}=i,o=A[s];o;)a(o),o=o.parent}),this.events=[],this.eventElements=[]}}checkPath(e,t){if(!(!this.working||!t)){var{events:A,eventElements:n}=this;A.forEach((i,s)=>{var{x:a,y:o}=i;!n[s]&&t.isPointInPath&&t.isPointInPath(a,o)&&(n[s]=e)})}}checkBoundingBox(e,t){if(!(!this.working||!t)){var{events:A,eventElements:n}=this;A.forEach((i,s)=>{var{x:a,y:o}=i;!n[s]&&t.isPointInBox(a,o)&&(n[s]=e)})}}mapXY(e,t){for(var{window:A,ctx:n}=this.screen,i=new vr(e,t),s=n.canvas;s;)i.x-=s.offsetLeft,i.y-=s.offsetTop,s=s.offsetParent;return A.scrollX&&(i.x+=A.scrollX),A.scrollY&&(i.y+=A.scrollY),i}onClick(e){var{x:t,y:A}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:A,run(n){n.onClick&&n.onClick()}})}onMouseMove(e){var{x:t,y:A}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:A,run(n){n.onMouseMove&&n.onMouseMove()}})}}var mF=typeof window<"u"?window:null,wF=typeof fetch<"u"?fetch.bind(void 0):null;class il{constructor(e){var{fetch:t=wF,window:A=mF}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new pF,this.mouse=new vF(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=A,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:t,ctx:A,aspectRatio:n,width:i,desiredWidth:s,height:a,desiredHeight:o,minX:l=0,minY:u=0,refX:f,refY:h,clip:c=!1,clipX:g=0,clipY:p=0}=e,y=ka(n).replace(/^defer\s/,""),[w,B]=y.split(" "),x=w||"xMidYMid",E=B||"meet",Q=i/s,L=a/o,S=Math.min(Q,L),T=Math.max(Q,L),_=s,D=o;E==="meet"&&(_*=S,D*=S),E==="slice"&&(_*=T,D*=T);var U=new yt(t,"refX",f),O=new yt(t,"refY",h),M=U.hasValue()&&O.hasValue();if(M&&A.translate(-S*U.getPixels("x"),-S*O.getPixels("y")),c){var C=S*g,z=S*p;A.beginPath(),A.moveTo(C,z),A.lineTo(i,z),A.lineTo(i,a),A.lineTo(C,a),A.closePath(),A.clip()}if(!M){var re=E==="meet"&&S===L,ne=E==="slice"&&T===L,Z=E==="meet"&&S===Q,Ae=E==="slice"&&T===Q;x.startsWith("xMid")&&(re||ne)&&A.translate(i/2-_/2,0),x.endsWith("YMid")&&(Z||Ae)&&A.translate(0,a/2-D/2),x.startsWith("xMax")&&(re||ne)&&A.translate(i-_,0),x.endsWith("YMax")&&(Z||Ae)&&A.translate(0,a-D)}switch(!0){case x==="none":A.scale(Q,L);break;case E==="meet":A.scale(S,S);break;case E==="slice":A.scale(T,T);break}A.translate(-l,-u)}start(e){var{enableRedraw:t=!1,ignoreMouse:A=!1,ignoreAnimation:n=!1,ignoreDimensions:i=!1,ignoreClear:s=!1,forceRedraw:a,scaleWidth:o,scaleHeight:l,offsetX:u,offsetY:f}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:h,mouse:c}=this,g=1e3/h;if(this.frameDuration=g,this.readyPromise=new Promise(x=>{this.resolveReady=x}),this.isReady()&&this.render(e,i,s,o,l,u,f),!!t){var p=Date.now(),y=p,w=0,B=()=>{p=Date.now(),w=p-y,w>=g&&(y=p-w%g,this.shouldUpdate(n,a)&&(this.render(e,i,s,o,l,u,f),c.runEvents())),this.intervalId=Q1(B)};A||c.start(),this.intervalId=Q1(B)}}stop(){this.intervalId&&(Q1.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:A}=this,n=this.animations.reduce((i,s)=>s.update(A)||i,!1);if(n)return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,A,n,i,s,a){var{CLIENT_WIDTH:o,CLIENT_HEIGHT:l,viewPort:u,ctx:f,isFirstRender:h}=this,c=f.canvas;u.clear(),c.width&&c.height?u.setCurrent(c.width,c.height):u.setCurrent(o,l);var g=e.getStyle("width"),p=e.getStyle("height");!t&&(h||typeof n!="number"&&typeof i!="number")&&(g.hasValue()&&(c.width=g.getPixels("x"),c.style&&(c.style.width="".concat(c.width,"px"))),p.hasValue()&&(c.height=p.getPixels("y"),c.style&&(c.style.height="".concat(c.height,"px"))));var y=c.clientWidth||c.width,w=c.clientHeight||c.height;if(t&&g.hasValue()&&p.hasValue()&&(y=g.getPixels("x"),w=p.getPixels("y")),u.setCurrent(y,w),typeof s=="number"&&e.getAttribute("x",!0).setValue(s),typeof a=="number"&&e.getAttribute("y",!0).setValue(a),typeof n=="number"||typeof i=="number"){var B=kA(e.getAttribute("viewBox").getString()),x=0,E=0;if(typeof n=="number"){var Q=e.getStyle("width");Q.hasValue()?x=Q.getPixels("x")/n:isNaN(B[2])||(x=B[2]/n)}if(typeof i=="number"){var L=e.getStyle("height");L.hasValue()?E=L.getPixels("y")/i:isNaN(B[3])||(E=B[3]/i)}x||(x=E),E||(E=x),e.getAttribute("width",!0).setValue(n),e.getAttribute("height",!0).setValue(i);var S=e.getStyle("transform",!0,!0);S.setValue("".concat(S.getString()," scale(").concat(1/x,", ").concat(1/E,")"))}A||f.clearRect(0,0,y,w),e.render(f),h&&(this.isFirstRender=!1)}}il.defaultWindow=mF,il.defaultFetch=wF;var{defaultFetch:I8}=il,Q8=typeof DOMParser<"u"?DOMParser:null;class df{constructor(){var{fetch:e=I8,DOMParser:t=Q8}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return pi(function*(){return e.startsWith("<")?t.parseFromString(e):t.load(e)})()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}load(e){var t=this;return pi(function*(){var A=yield t.fetch(e),n=yield A.text();return t.parseFromString(n)})()}}class yF{constructor(e,t){this.type="translate",this.point=null,this.point=vr.parse(t)}apply(e){var{x:t,y:A}=this.point;e.translate(t||0,A||0)}unapply(e){var{x:t,y:A}=this.point;e.translate(-1*t||0,-1*A||0)}applyToPoint(e){var{x:t,y:A}=this.point;e.applyTransform([1,0,0,1,t||0,A||0])}}class BF{constructor(e,t,A){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var n=kA(t);this.angle=new yt(e,"angle",n[0]),this.originX=A[0],this.originY=A[1],this.cx=n[1]||0,this.cy=n[2]||0}apply(e){var{cx:t,cy:A,originX:n,originY:i,angle:s}=this,a=t+n.getPixels("x"),o=A+i.getPixels("y");e.translate(a,o),e.rotate(s.getRadians()),e.translate(-a,-o)}unapply(e){var{cx:t,cy:A,originX:n,originY:i,angle:s}=this,a=t+n.getPixels("x"),o=A+i.getPixels("y");e.translate(a,o),e.rotate(-1*s.getRadians()),e.translate(-a,-o)}applyToPoint(e){var{cx:t,cy:A,angle:n}=this,i=n.getRadians();e.applyTransform([1,0,0,1,t||0,A||0]),e.applyTransform([Math.cos(i),Math.sin(i),-Math.sin(i),Math.cos(i),0,0]),e.applyTransform([1,0,0,1,-t||0,-A||0])}}class bF{constructor(e,t,A){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var n=vr.parseScale(t);(n.x===0||n.y===0)&&(n.x=ja,n.y=ja),this.scale=n,this.originX=A[0],this.originY=A[1]}apply(e){var{scale:{x:t,y:A},originX:n,originY:i}=this,s=n.getPixels("x"),a=i.getPixels("y");e.translate(s,a),e.scale(t,A||t),e.translate(-s,-a)}unapply(e){var{scale:{x:t,y:A},originX:n,originY:i}=this,s=n.getPixels("x"),a=i.getPixels("y");e.translate(s,a),e.scale(1/t,1/A||t),e.translate(-s,-a)}applyToPoint(e){var{x:t,y:A}=this.scale;e.applyTransform([t||0,0,0,A||0,0,0])}}class Y1{constructor(e,t,A){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=kA(t),this.originX=A[0],this.originY=A[1]}apply(e){var{originX:t,originY:A,matrix:n}=this,i=t.getPixels("x"),s=A.getPixels("y");e.translate(i,s),e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),e.translate(-i,-s)}unapply(e){var{originX:t,originY:A,matrix:n}=this,i=n[0],s=n[2],a=n[4],o=n[1],l=n[3],u=n[5],f=0,h=0,c=1,g=1/(i*(l*c-u*h)-s*(o*c-u*f)+a*(o*h-l*f)),p=t.getPixels("x"),y=A.getPixels("y");e.translate(p,y),e.transform(g*(l*c-u*h),g*(u*f-o*c),g*(a*h-s*c),g*(i*c-a*f),g*(s*u-a*l),g*(a*o-i*u)),e.translate(-p,-y)}applyToPoint(e){e.applyTransform(this.matrix)}}class $1 extends Y1{constructor(e,t,A){super(e,t,A),this.type="skew",this.angle=null,this.angle=new yt(e,"angle",t)}}class xF extends $1{constructor(e,t,A){super(e,t,A),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class CF extends $1{constructor(e,t,A){super(e,t,A),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function N8(r){return ka(r).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function O8(r){var[e,t]=r.split("(");return[e.trim(),t.trim().replace(")","")]}class ra{constructor(e,t,A){this.document=e,this.transforms=[];var n=N8(t);n.forEach(i=>{if(i!=="none"){var[s,a]=O8(i),o=ra.transformTypes[s];typeof o<"u"&&this.transforms.push(new o(this.document,a,A))}})}static fromElement(e,t){var A=t.getStyle("transform",!1,!0),[n,i=n]=t.getStyle("transform-origin",!1,!0).split(),s=[n,i];return A.hasValue()?new ra(e,A.getString(),s):null}apply(e){for(var{transforms:t}=this,A=t.length,n=0;n<A;n++)t[n].apply(e)}unapply(e){for(var{transforms:t}=this,A=t.length,n=A-1;n>=0;n--)t[n].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,A=t.length,n=0;n<A;n++)t[n].applyToPoint(e)}}ra.transformTypes={translate:yF,rotate:BF,scale:bF,matrix:Y1,skewX:xF,skewY:CF};let lr=class Pv{constructor(e,t){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=e,this.node=t,this.captureTextNodes=A,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!t||t.nodeType!==1)){if(Array.from(t.attributes).forEach(a=>{var o=hF(a.nodeName);this.attributes[o]=new yt(e,o,a.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var n=this.getAttribute("style").getString().split(";").map(a=>a.trim());n.forEach(a=>{if(a){var[o,l]=a.split(":").map(u=>u.trim());this.styles[o]=new yt(e,o,l)}})}var{definitions:i}=e,s=this.getAttribute("id");s.hasValue()&&(i[s.getString()]||(i[s.getString()]=this)),Array.from(t.childNodes).forEach(a=>{if(a.nodeType===1)this.addChild(a);else if(A&&(a.nodeType===3||a.nodeType===4)){var o=e.createTextNode(a);o.getText().length>0&&this.addChild(o)}})}}getAttribute(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,A=this.attributes[e];if(!A&&t){var n=new yt(this.document,e,"");return this.attributes[e]=n,n}return A||yt.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if(e==="href"||e.endsWith(":href"))return this.attributes[e];return yt.empty(this.document)}getStyle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=this.styles[e];if(n)return n;var i=this.getAttribute(e);if(i!=null&&i.hasValue())return this.styles[e]=i,i;if(!A){var{parent:s}=this;if(s){var a=s.getStyle(e);if(a!=null&&a.hasValue())return a}}if(t){var o=new yt(this.document,e,"");return this.styles[e]=o,o}return n||yt.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var A=this.getStyle("filter").getDefinition();A&&(this.applyEffects(e),A.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var t=ra.fromElement(this.document,this);t&&t.apply(e);var A=this.getStyle("clip-path",!1,!0);if(A.hasValue()){var n=A.getDefinition();n&&n.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){var t=e instanceof Pv?e:this.document.createElement(e);t.parent=this,Pv.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t,{node:A}=this;if(typeof A.matches=="function")return A.matches(e);var n=(t=A.getAttribute)===null||t===void 0?void 0:t.call(A,"class");return!n||n===""?!1:n.split(" ").some(i=>".".concat(i)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var A in e)if(!A.startsWith("@")&&this.matchesSelector(A)){var n=e[A],i=t[A];if(n)for(var s in n){var a=this.stylesSpecificity[s];typeof a>"u"&&(a="000"),i>=a&&(this.styles[s]=n[s],this.stylesSpecificity[s]=i)}}}removeStyles(e,t){var A=t.reduce((n,i)=>{var s=e.getStyle(i);if(!s.hasValue())return n;var a=s.getString();return s.setValue(""),[...n,[i,a]]},[]);return A}restoreStyles(e,t){t.forEach(A=>{var[n,i]=A;e.getStyle(n,!0).setValue(i)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}};lr.ignoreChildTypes=["title"];class EF extends lr{constructor(e,t,A){super(e,t,A)}}function T8(r){var e=r.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function L8(r){return typeof process>"u"?r:r.trim().split(",").map(T8).join(",")}function P8(r){if(!r)return"";var e=r.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function R8(r){if(!r)return"";var e=r.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class BA{constructor(e,t,A,n,i,s){var a=s?typeof s=="string"?BA.parse(s):s:{};this.fontFamily=i||a.fontFamily,this.fontSize=n||a.fontSize,this.fontStyle=e||a.fontStyle,this.fontWeight=A||a.fontWeight,this.fontVariant=t||a.fontVariant}static parse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,A="",n="",i="",s="",a="",o=ka(e).trim().split(" "),l={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return o.forEach(u=>{switch(!0){case(!l.fontStyle&&BA.styles.includes(u)):u!=="inherit"&&(A=u),l.fontStyle=!0;break;case(!l.fontVariant&&BA.variants.includes(u)):u!=="inherit"&&(n=u),l.fontStyle=!0,l.fontVariant=!0;break;case(!l.fontWeight&&BA.weights.includes(u)):u!=="inherit"&&(i=u),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0;break;case!l.fontSize:u!=="inherit"&&([s]=u.split("/")),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0,l.fontSize=!0;break;default:u!=="inherit"&&(a+=u)}}),new BA(A,n,i,s,a,t)}toString(){return[P8(this.fontStyle),this.fontVariant,R8(this.fontWeight),this.fontSize,L8(this.fontFamily)].join(" ").trim()}}BA.styles="normal|italic|oblique|inherit",BA.variants="normal|small-caps|inherit",BA.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class hn{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=e,this.y1=t,this.x2=A,this.y2=n,this.addPoint(e,t),this.addPoint(A,n)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:t,y1:A,x2:n,y2:i}=e;this.addPoint(t,A),this.addPoint(n,i)}}sumCubic(e,t,A,n,i){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*A+3*(1-e)*Math.pow(e,2)*n+Math.pow(e,3)*i}bezierCurveAdd(e,t,A,n,i){var s=6*t-12*A+6*n,a=-3*t+9*A-9*n+3*i,o=3*A-3*t;if(a===0){if(s===0)return;var l=-o/s;0<l&&l<1&&(e?this.addX(this.sumCubic(l,t,A,n,i)):this.addY(this.sumCubic(l,t,A,n,i)));return}var u=Math.pow(s,2)-4*o*a;if(!(u<0)){var f=(-s+Math.sqrt(u))/(2*a);0<f&&f<1&&(e?this.addX(this.sumCubic(f,t,A,n,i)):this.addY(this.sumCubic(f,t,A,n,i)));var h=(-s-Math.sqrt(u))/(2*a);0<h&&h<1&&(e?this.addX(this.sumCubic(h,t,A,n,i)):this.addY(this.sumCubic(h,t,A,n,i)))}}addBezierCurve(e,t,A,n,i,s,a,o){this.addPoint(e,t),this.addPoint(a,o),this.bezierCurveAdd(!0,e,A,i,a),this.bezierCurveAdd(!1,t,n,s,o)}addQuadraticCurve(e,t,A,n,i,s){var a=e+.6666666666666666*(A-e),o=t+2/3*(n-t),l=a+1/3*(i-e),u=o+1/3*(s-t);this.addBezierCurve(e,t,a,l,o,u,i,s)}isPointInBox(e,t){var{x1:A,y1:n,x2:i,y2:s}=this;return A<=e&&e<=i&&n<=t&&t<=s}}class Ft extends $e{constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new vr(0,0),this.control=new vr(0,0),this.current=new vr(0,0),this.points=[],this.angles=[]}isEnd(){var{i:e,commands:t}=this;return e>=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",A=new vr(this.command[e],this.command[t]);return this.makeAbsolute(A)}getAsControlPoint(e,t){var A=this.getPoint(e,t);return this.control=A,A}getAsCurrentPoint(e,t){var A=this.getPoint(e,t);return this.current=A,A}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==$e.CURVE_TO&&e!==$e.SMOOTH_CURVE_TO&&e!==$e.QUAD_TO&&e!==$e.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:A},control:{x:n,y:i}}=this,s=new vr(2*t-n,2*A-i);return s}makeAbsolute(e){if(this.command.relative){var{x:t,y:A}=this.current;e.x+=t,e.y+=A}return e}addMarker(e,t,A){var{points:n,angles:i}=this;A&&i.length>0&&!i[i.length-1]&&(i[i.length-1]=n[n.length-1].angleTo(A)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,A=0;A<t;A++)if(!e[A]){for(var n=A+1;n<t;n++)if(e[n]){e[A]=e[n];break}}return e}}class Aa extends lr{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var e=1,t=this;t;){var A=t.getStyle("opacity",!1,!0);A.hasValue(!0)&&(e*=A.getNumber()),t=t.parent}return e}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!t){var A=this.getStyle("fill"),n=this.getStyle("fill-opacity"),i=this.getStyle("stroke"),s=this.getStyle("stroke-opacity");if(A.isUrlDefinition()){var a=A.getFillStyleDefinition(this,n);a&&(e.fillStyle=a)}else if(A.hasValue()){A.getString()==="currentColor"&&A.setValue(this.getStyle("color").getColor());var o=A.getColor();o!=="inherit"&&(e.fillStyle=o==="none"?"rgba(0,0,0,0)":o)}if(n.hasValue()){var l=new yt(this.document,"fill",e.fillStyle).addOpacity(n).getColor();e.fillStyle=l}if(i.isUrlDefinition()){var u=i.getFillStyleDefinition(this,s);u&&(e.strokeStyle=u)}else if(i.hasValue()){i.getString()==="currentColor"&&i.setValue(this.getStyle("color").getColor());var f=i.getString();f!=="inherit"&&(e.strokeStyle=f==="none"?"rgba(0,0,0,0)":f)}if(s.hasValue()){var h=new yt(this.document,"stroke",e.strokeStyle).addOpacity(s).getString();e.strokeStyle=h}var c=this.getStyle("stroke-width");if(c.hasValue()){var g=c.getPixels();e.lineWidth=g||ja}var p=this.getStyle("stroke-linecap"),y=this.getStyle("stroke-linejoin"),w=this.getStyle("stroke-miterlimit"),B=this.getStyle("stroke-dasharray"),x=this.getStyle("stroke-dashoffset");if(p.hasValue()&&(e.lineCap=p.getString()),y.hasValue()&&(e.lineJoin=y.getString()),w.hasValue()&&(e.miterLimit=w.getNumber()),B.hasValue()&&B.getString()!=="none"){var E=kA(B.getString());typeof e.setLineDash<"u"?e.setLineDash(E):typeof e.webkitLineDash<"u"?e.webkitLineDash=E:typeof e.mozDash<"u"&&!(E.length===1&&E[0]===0)&&(e.mozDash=E);var Q=x.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=Q:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=Q:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=Q)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){var L=this.getStyle("font"),S=this.getStyle("font-style"),T=this.getStyle("font-variant"),_=this.getStyle("font-weight"),D=this.getStyle("font-size"),U=this.getStyle("font-family"),O=new BA(S.getString(),T.getString(),_.getString(),D.hasValue()?"".concat(D.getPixels(!0),"px"):"",U.getString(),BA.parse(L.getString(),e.font));S.setValue(O.fontStyle),T.setValue(O.fontVariant),_.setValue(O.fontWeight),D.setValue(O.fontSize),U.setValue(O.fontFamily),e.font=O.toString(),D.isPixels()&&(this.document.emSize=D.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class Vt extends Aa{constructor(e,t,A){super(e,t,A),this.type="path",this.pathParser=null,this.pathParser=new Ft(this.getAttribute("d").getString())}path(e){var{pathParser:t}=this,A=new hn;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case Ft.MOVE_TO:this.pathM(e,A);break;case Ft.LINE_TO:this.pathL(e,A);break;case Ft.HORIZ_LINE_TO:this.pathH(e,A);break;case Ft.VERT_LINE_TO:this.pathV(e,A);break;case Ft.CURVE_TO:this.pathC(e,A);break;case Ft.SMOOTH_CURVE_TO:this.pathS(e,A);break;case Ft.QUAD_TO:this.pathQ(e,A);break;case Ft.SMOOTH_QUAD_TO:this.pathT(e,A);break;case Ft.ARC:this.pathA(e,A);break;case Ft.CLOSE_PATH:this.pathZ(e,A);break}return A}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),A=e.getMarkerAngles(),n=t.map((i,s)=>[i,A[s]]);return n}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var A=this.getMarkers();if(A){var n=A.length-1,i=this.getStyle("marker-start"),s=this.getStyle("marker-mid"),a=this.getStyle("marker-end");if(i.isUrlDefinition()){var o=i.getDefinition(),[l,u]=A[0];o.render(e,l,u)}if(s.isUrlDefinition())for(var f=s.getDefinition(),h=1;h<n;h++){var[c,g]=A[h];f.render(e,c,g)}if(a.isUrlDefinition()){var p=a.getDefinition(),[y,w]=A[n];p.render(e,y,w)}}}static pathM(e){var t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){var{pathParser:A}=this,{point:n}=Vt.pathM(A),{x:i,y:s}=n;A.addMarker(n),t.addPoint(i,s),e&&e.moveTo(i,s)}static pathL(e){var{current:t}=e,A=e.getAsCurrentPoint();return{current:t,point:A}}pathL(e,t){var{pathParser:A}=this,{current:n,point:i}=Vt.pathL(A),{x:s,y:a}=i;A.addMarker(i,n),t.addPoint(s,a),e&&e.lineTo(s,a)}static pathH(e){var{current:t,command:A}=e,n=new vr((A.relative?t.x:0)+A.x,t.y);return e.current=n,{current:t,point:n}}pathH(e,t){var{pathParser:A}=this,{current:n,point:i}=Vt.pathH(A),{x:s,y:a}=i;A.addMarker(i,n),t.addPoint(s,a),e&&e.lineTo(s,a)}static pathV(e){var{current:t,command:A}=e,n=new vr(t.x,(A.relative?t.y:0)+A.y);return e.current=n,{current:t,point:n}}pathV(e,t){var{pathParser:A}=this,{current:n,point:i}=Vt.pathV(A),{x:s,y:a}=i;A.addMarker(i,n),t.addPoint(s,a),e&&e.lineTo(s,a)}static pathC(e){var{current:t}=e,A=e.getPoint("x1","y1"),n=e.getAsControlPoint("x2","y2"),i=e.getAsCurrentPoint();return{current:t,point:A,controlPoint:n,currentPoint:i}}pathC(e,t){var{pathParser:A}=this,{current:n,point:i,controlPoint:s,currentPoint:a}=Vt.pathC(A);A.addMarker(a,s,i),t.addBezierCurve(n.x,n.y,i.x,i.y,s.x,s.y,a.x,a.y),e&&e.bezierCurveTo(i.x,i.y,s.x,s.y,a.x,a.y)}static pathS(e){var{current:t}=e,A=e.getReflectedControlPoint(),n=e.getAsControlPoint("x2","y2"),i=e.getAsCurrentPoint();return{current:t,point:A,controlPoint:n,currentPoint:i}}pathS(e,t){var{pathParser:A}=this,{current:n,point:i,controlPoint:s,currentPoint:a}=Vt.pathS(A);A.addMarker(a,s,i),t.addBezierCurve(n.x,n.y,i.x,i.y,s.x,s.y,a.x,a.y),e&&e.bezierCurveTo(i.x,i.y,s.x,s.y,a.x,a.y)}static pathQ(e){var{current:t}=e,A=e.getAsControlPoint("x1","y1"),n=e.getAsCurrentPoint();return{current:t,controlPoint:A,currentPoint:n}}pathQ(e,t){var{pathParser:A}=this,{current:n,controlPoint:i,currentPoint:s}=Vt.pathQ(A);A.addMarker(s,i,i),t.addQuadraticCurve(n.x,n.y,i.x,i.y,s.x,s.y),e&&e.quadraticCurveTo(i.x,i.y,s.x,s.y)}static pathT(e){var{current:t}=e,A=e.getReflectedControlPoint();e.control=A;var n=e.getAsCurrentPoint();return{current:t,controlPoint:A,currentPoint:n}}pathT(e,t){var{pathParser:A}=this,{current:n,controlPoint:i,currentPoint:s}=Vt.pathT(A);A.addMarker(s,i,i),t.addQuadraticCurve(n.x,n.y,i.x,i.y,s.x,s.y),e&&e.quadraticCurveTo(i.x,i.y,s.x,s.y)}static pathA(e){var{current:t,command:A}=e,{rX:n,rY:i,xRot:s,lArcFlag:a,sweepFlag:o}=A,l=s*(Math.PI/180),u=e.getAsCurrentPoint(),f=new vr(Math.cos(l)*(t.x-u.x)/2+Math.sin(l)*(t.y-u.y)/2,-Math.sin(l)*(t.x-u.x)/2+Math.cos(l)*(t.y-u.y)/2),h=Math.pow(f.x,2)/Math.pow(n,2)+Math.pow(f.y,2)/Math.pow(i,2);h>1&&(n*=Math.sqrt(h),i*=Math.sqrt(h));var c=(a===o?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(i,2)-Math.pow(n,2)*Math.pow(f.y,2)-Math.pow(i,2)*Math.pow(f.x,2))/(Math.pow(n,2)*Math.pow(f.y,2)+Math.pow(i,2)*Math.pow(f.x,2)));isNaN(c)&&(c=0);var g=new vr(c*n*f.y/i,c*-i*f.x/n),p=new vr((t.x+u.x)/2+Math.cos(l)*g.x-Math.sin(l)*g.y,(t.y+u.y)/2+Math.sin(l)*g.x+Math.cos(l)*g.y),y=j1([1,0],[(f.x-g.x)/n,(f.y-g.y)/i]),w=[(f.x-g.x)/n,(f.y-g.y)/i],B=[(-f.x-g.x)/n,(-f.y-g.y)/i],x=j1(w,B);return hf(w,B)<=-1&&(x=Math.PI),hf(w,B)>=1&&(x=0),{currentPoint:u,rX:n,rY:i,sweepFlag:o,xAxisRotation:l,centp:p,a1:y,ad:x}}pathA(e,t){var{pathParser:A}=this,{currentPoint:n,rX:i,rY:s,sweepFlag:a,xAxisRotation:o,centp:l,a1:u,ad:f}=Vt.pathA(A),h=1-a?1:-1,c=u+h*(f/2),g=new vr(l.x+i*Math.cos(c),l.y+s*Math.sin(c));if(A.addMarkerAngle(g,c-h*Math.PI/2),A.addMarkerAngle(n,c-h*Math.PI),t.addPoint(n.x,n.y),e&&!isNaN(u)&&!isNaN(f)){var p=i>s?i:s,y=i>s?1:i/s,w=i>s?s/i:1;e.translate(l.x,l.y),e.rotate(o),e.scale(y,w),e.arc(0,0,p,u,u+f,!!(1-a)),e.scale(1/y,1/w),e.rotate(-o),e.translate(-l.x,-l.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){Vt.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class J1 extends Vt{constructor(e,t,A){super(e,t,A),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class mi extends Aa{constructor(e,t,A){super(e,t,new.target===mi?!0:A),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,t);var A=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();A&&(e.textBaseline=A)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach((A,n)=>{var i=this.getChildBoundingBox(e,this,this,n);t?t.addBoundingBox(i):t=i}),t}getFontSize(){var{document:e,parent:t}=this,A=BA.parse(e.ctx.font).fontSize,n=t.getStyle("font-size").getNumber(A);return n}getTElementBoundingBox(e){var t=this.getFontSize();return new hn(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,A){var n=t[A],i=null;if(e.isArabic){var s=t.length,a=t[A-1],o=t[A+1],l="isolated";if((A===0||a===" ")&&A<s-1&&o!==" "&&(l="terminal"),A>0&&a!==" "&&A<s-1&&o!==" "&&(l="medial"),A>0&&a!==" "&&(A===s-1||o===" ")&&(l="initial"),typeof e.glyphs[n]<"u"){var u=e.glyphs[n];i=u instanceof J1?u:u[l]}}else i=e.glyphs[n];return i||(i=e.missingGlyph),i}getText(){return""}getTextFromNode(e){var t=e||this.node,A=Array.from(t.parentNode.childNodes),n=A.indexOf(t),i=A.length-1,s=ka(t.textContent||"");return n===0&&(s=cF(s)),n===i&&(s=fF(s)),s}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((A,n)=>{this.renderChild(e,this,this,n)});var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){var{document:t,parent:A}=this,n=this.getText(),i=A.getStyle("font-family").getDefinition();if(i){for(var{unitsPerEm:s}=i.fontFace,a=BA.parse(t.ctx.font),o=A.getStyle("font-size").getNumber(a.fontSize),l=A.getStyle("font-style").getString(a.fontStyle),u=o/s,f=i.isRTL?n.split("").reverse().join(""):n,h=kA(A.getAttribute("dx").getString()),c=f.length,g=0;g<c;g++){var p=this.getGlyph(i,f,g);e.translate(this.x,this.y),e.scale(u,-u);var y=e.lineWidth;e.lineWidth=e.lineWidth*s/o,l==="italic"&&e.transform(1,0,.4,1,0,0),p.render(e),l==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=y,e.scale(1/u,-1/u),e.translate(-this.x,-this.y),this.x+=o*(p.horizAdvX||i.horizAdvX)/s,typeof h[g]<"u"&&!isNaN(h[g])&&(this.x+=h[g])}return}var{x:w,y:B}=this;e.fillStyle&&e.fillText(n,w,B),e.strokeStyle&&e.strokeText(n,w,B)}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),A=!1,n=0;t==="start"&&!A||t==="end"&&A?n=e.x-this.minX:t==="end"&&!A||t==="start"&&A?n=e.x-this.maxX:n=e.x-(this.minX+this.maxX)/2;for(var i=this.textChunkStart;i<this.leafTexts.length;i++)this.leafTexts[i].x+=n;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(e){this.children.forEach((t,A)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,A)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,A,n){var i=A.children[n];i.children.length>0?i.children.forEach((s,a)=>{t.adjustChildCoordinatesRecursiveCore(e,t,i,a)}):this.adjustChildCoordinates(e,t,A,n)}adjustChildCoordinates(e,t,A,n){var i=A.children[n];if(typeof i.measureText!="function")return i;e.save(),i.setContext(e,!0);var s=i.getAttribute("x"),a=i.getAttribute("y"),o=i.getAttribute("dx"),l=i.getAttribute("dy"),u=i.getStyle("font-family").getDefinition(),f=!!u&&u.isRTL;n===0&&(s.hasValue()||s.setValue(i.getInheritedAttribute("x")),a.hasValue()||a.setValue(i.getInheritedAttribute("y")),o.hasValue()||o.setValue(i.getInheritedAttribute("dx")),l.hasValue()||l.setValue(i.getInheritedAttribute("dy")));var h=i.measureText(e);return f&&(t.x-=h),s.hasValue()?(t.applyAnchoring(),i.x=s.getPixels("x"),o.hasValue()&&(i.x+=o.getPixels("x"))):(o.hasValue()&&(t.x+=o.getPixels("x")),i.x=t.x),t.x=i.x,f||(t.x+=h),a.hasValue()?(i.y=a.getPixels("y"),l.hasValue()&&(i.y+=l.getPixels("y"))):(l.hasValue()&&(t.y+=l.getPixels("y")),i.y=t.y),t.y=i.y,t.leafTexts.push(i),t.minX=Math.min(t.minX,i.x,i.x+h),t.maxX=Math.max(t.maxX,i.x,i.x+h),i.clearContext(e),e.restore(),i}getChildBoundingBox(e,t,A,n){var i=A.children[n];if(typeof i.getBoundingBox!="function")return null;var s=i.getBoundingBox(e);return s?(i.children.forEach((a,o)=>{var l=t.getChildBoundingBox(e,t,i,o);s.addBoundingBox(l)}),s):null}renderChild(e,t,A,n){var i=A.children[n];i.render(e),i.children.forEach((s,a)=>{t.renderChild(e,t,i,a)})}measureText(e){var{measureCache:t}=this;if(~t)return t;var A=this.getText(),n=this.measureTargetText(e,A);return this.measureCache=n,n}measureTargetText(e,t){if(!t.length)return 0;var{parent:A}=this,n=A.getStyle("font-family").getDefinition();if(n){for(var i=this.getFontSize(),s=n.isRTL?t.split("").reverse().join(""):t,a=kA(A.getAttribute("dx").getString()),o=s.length,l=0,u=0;u<o;u++){var f=this.getGlyph(n,s,u);l+=(f.horizAdvX||n.horizAdvX)*i/n.fontFace.unitsPerEm,typeof a[u]<"u"&&!isNaN(a[u])&&(l+=a[u])}return l}if(!e.measureText)return t.length*10;e.save(),this.setContext(e,!0);var{width:h}=e.measureText(t);return this.clearContext(e),e.restore(),h}getInheritedAttribute(e){for(var t=this;t instanceof mi&&t.isFirstChild();){var A=t.parent.getAttribute(e);if(A.hasValue(!0))return A.getValue("0");t=t.parent}return null}}class al extends mi{constructor(e,t,A){super(e,t,new.target===al?!0:A),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class M8 extends al{constructor(){super(...arguments),this.type="textNode"}}let Ds=class extends Aa{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var t,{document:A}=this,{screen:n,window:i}=A,s=e.canvas;if(n.setDefaults(e),s.style&&typeof e.font<"u"&&i&&typeof i.getComputedStyle<"u"){e.font=i.getComputedStyle(s).getPropertyValue("font");var a=new yt(A,"fontSize",BA.parse(e.font).fontSize);a.hasValue()&&(A.rootEmSize=a.getPixels("y"),A.emSize=A.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:o,height:l}=n.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var u=this.getAttribute("refX"),f=this.getAttribute("refY"),h=this.getAttribute("viewBox"),c=h.hasValue()?kA(h.getString()):null,g=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",p=0,y=0,w=0,B=0;c&&(p=c[0],y=c[1]),this.root||(o=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y"),this.type==="marker"&&(w=p,B=y,p=0,y=0)),n.viewPort.setCurrent(o,l),this.node&&(!this.parent||((t=this.node.parentNode)===null||t===void 0?void 0:t.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),c&&(o=c[2],l=c[3]),A.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:n.viewPort.width,desiredWidth:o,height:n.viewPort.height,desiredHeight:l,minX:p,minY:y,refX:u.getValue(),refY:f.getValue(),clip:g,clipX:w,clipY:B}),c&&(n.viewPort.removeCurrent(),n.viewPort.setCurrent(o,l))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=this.getAttribute("width",!0),i=this.getAttribute("height",!0),s=this.getAttribute("viewBox"),a=this.getAttribute("style"),o=n.getNumber(0),l=i.getNumber(0);if(A)if(typeof A=="string")this.getAttribute("preserveAspectRatio",!0).setValue(A);else{var u=this.getAttribute("preserveAspectRatio");u.hasValue()&&u.setValue(u.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(n.setValue(e),i.setValue(t),s.hasValue()||s.setValue("0 0 ".concat(o||e," ").concat(l||t)),a.hasValue()){var f=this.getStyle("width"),h=this.getStyle("height");f.hasValue()&&f.setValue("".concat(e,"px")),h.hasValue()&&h.setValue("".concat(t,"px"))}}};class Z1 extends Vt{constructor(){super(...arguments),this.type="rect"}path(e){var t=this.getAttribute("x").getPixels("x"),A=this.getAttribute("y").getPixels("y"),n=this.getStyle("width",!1,!0).getPixels("x"),i=this.getStyle("height",!1,!0).getPixels("y"),s=this.getAttribute("rx"),a=this.getAttribute("ry"),o=s.getPixels("x"),l=a.getPixels("y");if(s.hasValue()&&!a.hasValue()&&(l=o),a.hasValue()&&!s.hasValue()&&(o=l),o=Math.min(o,n/2),l=Math.min(l,i/2),e){var u=4*((Math.sqrt(2)-1)/3);e.beginPath(),i>0&&n>0&&(e.moveTo(t+o,A),e.lineTo(t+n-o,A),e.bezierCurveTo(t+n-o+u*o,A,t+n,A+l-u*l,t+n,A+l),e.lineTo(t+n,A+i-l),e.bezierCurveTo(t+n,A+i-l+u*l,t+n-o+u*o,A+i,t+n-o,A+i),e.lineTo(t+o,A+i),e.bezierCurveTo(t+o-u*o,A+i,t,A+i-l+u*l,t,A+i-l),e.lineTo(t,A+l),e.bezierCurveTo(t,A+l-u*l,t+o-u*o,A,t+o,A),e.closePath())}return new hn(t,A,t+n,A+i)}getMarkers(){return null}}class FF extends Vt{constructor(){super(...arguments),this.type="circle"}path(e){var t=this.getAttribute("cx").getPixels("x"),A=this.getAttribute("cy").getPixels("y"),n=this.getAttribute("r").getPixels();return e&&n>0&&(e.beginPath(),e.arc(t,A,n,0,Math.PI*2,!1),e.closePath()),new hn(t-n,A-n,t+n,A+n)}getMarkers(){return null}}class SF extends Vt{constructor(){super(...arguments),this.type="ellipse"}path(e){var t=4*((Math.sqrt(2)-1)/3),A=this.getAttribute("rx").getPixels("x"),n=this.getAttribute("ry").getPixels("y"),i=this.getAttribute("cx").getPixels("x"),s=this.getAttribute("cy").getPixels("y");return e&&A>0&&n>0&&(e.beginPath(),e.moveTo(i+A,s),e.bezierCurveTo(i+A,s+t*n,i+t*A,s+n,i,s+n),e.bezierCurveTo(i-t*A,s+n,i-A,s+t*n,i-A,s),e.bezierCurveTo(i-A,s-t*n,i-t*A,s-n,i,s-n),e.bezierCurveTo(i+t*A,s-n,i+A,s-t*n,i+A,s),e.closePath()),new hn(i-A,s-n,i+A,s+n)}getMarkers(){return null}}class UF extends Vt{constructor(){super(...arguments),this.type="line"}getPoints(){return[new vr(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new vr(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:t,y:A},{x:n,y:i}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,A),e.lineTo(n,i)),new hn(t,A,n,i)}getMarkers(){var[e,t]=this.getPoints(),A=e.angleTo(t);return[[e,A],[t,A]]}}class ev extends Vt{constructor(e,t,A){super(e,t,A),this.type="polyline",this.points=[],this.points=vr.parsePath(this.getAttribute("points").getString())}path(e){var{points:t}=this,[{x:A,y:n}]=t,i=new hn(A,n);return e&&(e.beginPath(),e.moveTo(A,n)),t.forEach(s=>{var{x:a,y:o}=s;i.addPoint(a,o),e&&e.lineTo(a,o)}),i}getMarkers(){var{points:e}=this,t=e.length-1,A=[];return e.forEach((n,i)=>{i!==t&&A.push([n,n.angleTo(e[i+1])])}),A.length>0&&A.push([e[e.length-1],A[A.length-1][1]]),A}}class _F extends ev{constructor(){super(...arguments),this.type="polygon"}path(e){var t=super.path(e),[{x:A,y:n}]=this.points;return e&&(e.lineTo(A,n),e.closePath()),t}}class IF extends lr{constructor(){super(...arguments),this.type="pattern"}createPattern(e,t,A){var n=this.getStyle("width").getPixels("x",!0),i=this.getStyle("height").getPixels("y",!0),s=new Ds(this.document,null);s.attributes.viewBox=new yt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),s.attributes.width=new yt(this.document,"width","".concat(n,"px")),s.attributes.height=new yt(this.document,"height","".concat(i,"px")),s.attributes.transform=new yt(this.document,"transform",this.getAttribute("patternTransform").getValue()),s.children=this.children;var a=this.document.createCanvas(n,i),o=a.getContext("2d"),l=this.getAttribute("x"),u=this.getAttribute("y");l.hasValue()&&u.hasValue()&&o.translate(l.getPixels("x",!0),u.getPixels("y",!0)),A.hasValue()?this.styles["fill-opacity"]=A:Reflect.deleteProperty(this.styles,"fill-opacity");for(var f=-1;f<=1;f++)for(var h=-1;h<=1;h++)o.save(),s.attributes.x=new yt(this.document,"x",f*a.width),s.attributes.y=new yt(this.document,"y",h*a.height),s.render(o),o.restore();var c=e.createPattern(a,"repeat");return c}}class QF extends lr{constructor(){super(...arguments),this.type="marker"}render(e,t,A){if(t){var{x:n,y:i}=t,s=this.getAttribute("orient").getString("auto"),a=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(n,i),s==="auto"&&e.rotate(A),a==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();var o=new Ds(this.document,null);o.type=this.type,o.attributes.viewBox=new yt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.refX=new yt(this.document,"refX",this.getAttribute("refX").getValue()),o.attributes.refY=new yt(this.document,"refY",this.getAttribute("refY").getValue()),o.attributes.width=new yt(this.document,"width",this.getAttribute("markerWidth").getValue()),o.attributes.height=new yt(this.document,"height",this.getAttribute("markerHeight").getValue()),o.attributes.overflow=new yt(this.document,"overflow",this.getAttribute("overflow").getValue()),o.attributes.fill=new yt(this.document,"fill",this.getAttribute("fill").getColor("black")),o.attributes.stroke=new yt(this.document,"stroke",this.getAttribute("stroke").getValue("none")),o.children=this.children,o.render(e),e.restore(),a==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),s==="auto"&&e.rotate(-A),e.translate(-n,-i)}}}class NF extends lr{constructor(){super(...arguments),this.type="defs"}render(){}}class gf extends Aa{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var t=new hn;return this.children.forEach(A=>{t.addBoundingBox(A.getBoundingBox(e))}),t}}class tv extends lr{constructor(e,t,A){super(e,t,A),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:n,children:i}=this;i.forEach(s=>{s.type==="stop"&&n.push(s)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,A){var n=this;this.getHrefAttribute().hasValue()&&(n=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(n));var{stops:i}=n,s=this.getGradient(e,t);if(!s)return this.addParentOpacity(A,i[i.length-1].color);if(i.forEach(y=>{s.addColorStop(y.offset,this.addParentOpacity(A,y.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:a}=this,{MAX_VIRTUAL_PIXELS:o,viewPort:l}=a.screen,[u]=l.viewPorts,f=new Z1(a,null);f.attributes.x=new yt(a,"x",-o/3),f.attributes.y=new yt(a,"y",-o/3),f.attributes.width=new yt(a,"width",o),f.attributes.height=new yt(a,"height",o);var h=new gf(a,null);h.attributes.transform=new yt(a,"transform",this.getAttribute("gradientTransform").getValue()),h.children=[f];var c=new Ds(a,null);c.attributes.x=new yt(a,"x",0),c.attributes.y=new yt(a,"y",0),c.attributes.width=new yt(a,"width",u.width),c.attributes.height=new yt(a,"height",u.height),c.children=[h];var g=a.createCanvas(u.width,u.height),p=g.getContext("2d");return p.fillStyle=s,c.render(p),p.createPattern(g,"no-repeat")}return s}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){if(e.hasValue()){var A=new yt(this.document,"color",t);return A.addOpacity(e).getColor()}return t}}class OF extends tv{constructor(e,t,A){super(e,t,A),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){var A=this.getGradientUnits()==="objectBoundingBox",n=A?t.getBoundingBox(e):null;if(A&&!n)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var i=A?n.x+n.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),s=A?n.y+n.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),a=A?n.x+n.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),o=A?n.y+n.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return i===a&&s===o?null:e.createLinearGradient(i,s,a,o)}}class TF extends tv{constructor(e,t,A){super(e,t,A),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){var A=this.getGradientUnits()==="objectBoundingBox",n=t.getBoundingBox(e);if(A&&!n)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var i=A?n.x+n.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),s=A?n.y+n.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),a=i,o=s;this.getAttribute("fx").hasValue()&&(a=A?n.x+n.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(o=A?n.y+n.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var l=A?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),u=this.getAttribute("fr").getPixels();return e.createRadialGradient(a,o,u,i,s,l)}}class LF extends lr{constructor(e,t,A){super(e,t,A),this.type="stop";var n=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),i=this.getStyle("stop-opacity"),s=this.getStyle("stop-color",!0);s.getString()===""&&s.setValue("#000"),i.hasValue()&&(s=s.addOpacity(i)),this.offset=n,this.color=s.getColor()}}class pf extends lr{constructor(e,t,A){super(e,t,A),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new yt(e,"values",null);var n=this.getAttribute("values");n.hasValue()&&this.values.setValue(n.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:A,to:n}=this.getProgress(),i=A.getNumber()+(n.getNumber()-A.getNumber())*t;return e==="%"&&(i*=100),"".concat(i).concat(e)}update(e){var{parent:t}=this,A=this.getProperty();if(this.initialValue||(this.initialValue=A.getString(),this.initialUnits=A.getUnits()),this.duration>this.maxDuration){var n=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(n==="freeze"&&!this.frozen)this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=A.getString();else if(n==="remove"&&!this.removed)return this.removed=!0,A.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var i=!1;if(this.begin<this.duration){var s=this.calcValue(),a=this.getAttribute("type");if(a.hasValue()){var o=a.getString();s="".concat(o,"(").concat(s,")")}A.setValue(s),i=!0}return i}getProgress(){var{document:e,values:t}=this,A={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(t.hasValue()){var n=A.progress*(t.getValue().length-1),i=Math.floor(n),s=Math.ceil(n);A.from=new yt(e,"from",parseFloat(t.getValue()[i])),A.to=new yt(e,"to",parseFloat(t.getValue()[s])),A.progress=(n-i)/(s-i)}else A.from=this.from,A.to=this.to;return A}}class PF extends pf{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:e,from:t,to:A}=this.getProgress(),n=new P1(t.getColor()),i=new P1(A.getColor());if(n.ok&&i.ok){var s=n.r+(i.r-n.r)*e,a=n.g+(i.g-n.g)*e,o=n.b+(i.b-n.b)*e;return"rgb(".concat(Math.floor(s),", ").concat(Math.floor(a),", ").concat(Math.floor(o),")")}return this.getAttribute("from").getColor()}}class RF extends pf{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:e,from:t,to:A}=this.getProgress(),n=kA(t.getString()),i=kA(A.getString()),s=n.map((a,o)=>{var l=i[o];return a+(l-a)*e}).join(" ");return s}}class MF extends lr{constructor(e,t,A){super(e,t,A),this.type="font",this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:n}=e,{children:i}=this;for(var s of i)switch(s.type){case"font-face":{this.fontFace=s;var a=s.getStyle("font-family");a.hasValue()&&(n[a.getString()]=this);break}case"missing-glyph":this.missingGlyph=s;break;case"glyph":{var o=s;o.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[o.unicode]>"u"&&(this.glyphs[o.unicode]=Object.create(null)),this.glyphs[o.unicode][o.arabicForm]=o):this.glyphs[o.unicode]=o;break}}}render(){}}class DF extends lr{constructor(e,t,A){super(e,t,A),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class kF extends Vt{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class HF extends mi{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}class jF extends mi{constructor(e,t,A){super(e,t,A),this.type="a";var{childNodes:n}=t,i=n[0],s=n.length>0&&Array.from(n).every(a=>a.nodeType===3);this.hasText=s,this.text=s?this.getTextFromNode(i):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:A,y:n}=this,{mouse:i}=t.screen,s=new yt(t,"fontSize",BA.parse(t.ctx.font).fontSize);i.isWorking()&&i.checkBoundingBox(this,new hn(A,n-s.getPixels("y"),A+this.measureText(e),n))}else if(this.children.length>0){var a=new gf(this.document,null);a.children=this.children,a.parent=this,a.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){var e=this.document.ctx;e.canvas.style.cursor="pointer"}}function KF(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(r);e&&(A=A.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,A)}return t}function vf(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?KF(Object(t),!0).forEach(function(A){U1(r,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):KF(Object(t)).forEach(function(A){Object.defineProperty(r,A,Object.getOwnPropertyDescriptor(t,A))})}return r}class qF extends mi{constructor(e,t,A){super(e,t,A),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var n=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(n)}getText(){return this.text}path(e){var{dataArray:t}=this;e&&e.beginPath(),t.forEach(A=>{var{type:n,points:i}=A;switch(n){case Ft.LINE_TO:e&&e.lineTo(i[0],i[1]);break;case Ft.MOVE_TO:e&&e.moveTo(i[0],i[1]);break;case Ft.CURVE_TO:e&&e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case Ft.QUAD_TO:e&&e.quadraticCurveTo(i[0],i[1],i[2],i[3]);break;case Ft.ARC:{var[s,a,o,l,u,f,h,c]=i,g=o>l?o:l,p=o>l?1:o/l,y=o>l?l/o:1;e&&(e.translate(s,a),e.rotate(h),e.scale(p,y),e.arc(0,0,g,u,u+f,!!(1-c)),e.scale(1/p,1/y),e.rotate(-h),e.translate(-s,-a));break}case Ft.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),A=this.getFontSize(),{glyphInfo:n}=this,i=e.fillStyle;t==="underline"&&e.beginPath(),n.forEach((s,a)=>{var{p0:o,p1:l,rotation:u,text:f}=s;e.save(),e.translate(o.x,o.y),e.rotate(u),e.fillStyle&&e.fillText(f,0,0),e.strokeStyle&&e.strokeText(f,0,0),e.restore(),t==="underline"&&(a===0&&e.moveTo(o.x,o.y+A/8),e.lineTo(l.x,l.y+A/5))}),t==="underline"&&(e.lineWidth=A/20,e.strokeStyle=i,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,A,n,i,s,a,o,l){var u=s,f=this.measureText(e,o);o===" "&&t==="justify"&&A<n&&(f+=(n-A)/i),l>-1&&(u+=this.getLetterSpacingAt(l));var h=this.textHeight/20,c=this.getEquidistantPointOnPath(u,h,0),g=this.getEquidistantPointOnPath(u+f,h,0),p={p0:c,p1:g},y=c&&g?Math.atan2(g.y-c.y,g.x-c.x):0;if(a){var w=Math.cos(Math.PI/2+y)*a,B=Math.cos(-y)*a;p.p0=vf(vf({},c),{},{x:c.x+w,y:c.y+B}),p.p1=vf(vf({},g),{},{x:g.x+w,y:g.y+B})}return u+=f,{offset:u,segment:p,rotation:y}}measureText(e,t){var{measuresCache:A}=this,n=t||this.getText();if(A.has(n))return A.get(n);var i=this.measureTargetText(e,n);return A.set(n,i),i}setTextData(e){if(!this.glyphInfo){var t=this.getText(),A=t.split(""),n=t.split(" ").length-1,i=this.parent.getAttribute("dx").split().map(E=>E.getPixels("x")),s=this.parent.getAttribute("dy").getPixels("y"),a=this.parent.getStyle("text-anchor").getString("start"),o=this.getStyle("letter-spacing"),l=this.parent.getStyle("letter-spacing"),u=0;!o.hasValue()||o.getValue()==="inherit"?u=l.getPixels():o.hasValue()&&o.getValue()!=="initial"&&o.getValue()!=="unset"&&(u=o.getPixels());var f=[],h=t.length;this.letterSpacingCache=f;for(var c=0;c<h;c++)f.push(typeof i[c]<"u"?i[c]:u);var g=f.reduce((E,Q,L)=>L===0?0:E+Q||0,0),p=this.measureText(e),y=Math.max(p+g,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];var w=this.getPathLength(),B=this.getStyle("startOffset").getNumber(0)*w,x=0;(a==="middle"||a==="center")&&(x=-y/2),(a==="end"||a==="right")&&(x=-y),x+=B,A.forEach((E,Q)=>{var{offset:L,segment:S,rotation:T}=this.findSegmentToFitChar(e,a,y,w,n,x,s,E,Q);x=L,!(!S.p0||!S.p1)&&this.glyphInfo.push({text:A[Q],p0:S.p0,p1:S.p1,rotation:T})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:A}=e;for(A.reset();!A.isEnd();){var{current:n}=A,i=n?n.x:0,s=n?n.y:0,a=A.next(),o=a.type,l=[];switch(a.type){case Ft.MOVE_TO:this.pathM(A,l);break;case Ft.LINE_TO:o=this.pathL(A,l);break;case Ft.HORIZ_LINE_TO:o=this.pathH(A,l);break;case Ft.VERT_LINE_TO:o=this.pathV(A,l);break;case Ft.CURVE_TO:this.pathC(A,l);break;case Ft.SMOOTH_CURVE_TO:o=this.pathS(A,l);break;case Ft.QUAD_TO:this.pathQ(A,l);break;case Ft.SMOOTH_QUAD_TO:o=this.pathT(A,l);break;case Ft.ARC:l=this.pathA(A);break;case Ft.CLOSE_PATH:Vt.pathZ(A);break}a.type!==Ft.CLOSE_PATH?t.push({type:o,points:l,start:{x:i,y:s},pathLength:this.calcLength(i,s,o,l)}):t.push({type:Ft.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){var{x:A,y:n}=Vt.pathM(e).point;t.push(A,n)}pathL(e,t){var{x:A,y:n}=Vt.pathL(e).point;return t.push(A,n),Ft.LINE_TO}pathH(e,t){var{x:A,y:n}=Vt.pathH(e).point;return t.push(A,n),Ft.LINE_TO}pathV(e,t){var{x:A,y:n}=Vt.pathV(e).point;return t.push(A,n),Ft.LINE_TO}pathC(e,t){var{point:A,controlPoint:n,currentPoint:i}=Vt.pathC(e);t.push(A.x,A.y,n.x,n.y,i.x,i.y)}pathS(e,t){var{point:A,controlPoint:n,currentPoint:i}=Vt.pathS(e);return t.push(A.x,A.y,n.x,n.y,i.x,i.y),Ft.CURVE_TO}pathQ(e,t){var{controlPoint:A,currentPoint:n}=Vt.pathQ(e);t.push(A.x,A.y,n.x,n.y)}pathT(e,t){var{controlPoint:A,currentPoint:n}=Vt.pathT(e);return t.push(A.x,A.y,n.x,n.y),Ft.QUAD_TO}pathA(e){var{rX:t,rY:A,sweepFlag:n,xAxisRotation:i,centp:s,a1:a,ad:o}=Vt.pathA(e);return n===0&&o>0&&(o-=2*Math.PI),n===1&&o<0&&(o+=2*Math.PI),[s.x,s.y,t,A,a,o,i,n]}calcLength(e,t,A,n){var i=0,s=null,a=null,o=0;switch(A){case Ft.LINE_TO:return this.getLineLength(e,t,n[0],n[1]);case Ft.CURVE_TO:for(i=0,s=this.getPointOnCubicBezier(0,e,t,n[0],n[1],n[2],n[3],n[4],n[5]),o=.01;o<=1;o+=.01)a=this.getPointOnCubicBezier(o,e,t,n[0],n[1],n[2],n[3],n[4],n[5]),i+=this.getLineLength(s.x,s.y,a.x,a.y),s=a;return i;case Ft.QUAD_TO:for(i=0,s=this.getPointOnQuadraticBezier(0,e,t,n[0],n[1],n[2],n[3]),o=.01;o<=1;o+=.01)a=this.getPointOnQuadraticBezier(o,e,t,n[0],n[1],n[2],n[3]),i+=this.getLineLength(s.x,s.y,a.x,a.y),s=a;return i;case Ft.ARC:{i=0;var l=n[4],u=n[5],f=n[4]+u,h=Math.PI/180;if(Math.abs(l-f)<h&&(h=Math.abs(l-f)),s=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],l,0),u<0)for(o=l-h;o>f;o-=h)a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],o,0),i+=this.getLineLength(s.x,s.y,a.x,a.y),s=a;else for(o=l+h;o<f;o+=h)a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],o,0),i+=this.getLineLength(s.x,s.y,a.x,a.y),s=a;return a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],f,0),i+=this.getLineLength(s.x,s.y,a.x,a.y),i}}return 0}getPointOnLine(e,t,A,n,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:t,a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:A,o=(i-A)/(n-t+ja),l=Math.sqrt(e*e/(1+o*o));n<t&&(l*=-1);var u=o*l,f=null;if(n===t)f={x:s,y:a+u};else if((a-A)/(s-t+ja)===o)f={x:s+l,y:a+u};else{var h=0,c=0,g=this.getLineLength(t,A,n,i);if(g<ja)return null;var p=(s-t)*(n-t)+(a-A)*(i-A);p/=g*g,h=t+p*(n-t),c=A+p*(i-A);var y=this.getLineLength(s,a,h,c),w=Math.sqrt(e*e-y*y);l=Math.sqrt(w*w/(1+o*o)),n<t&&(l*=-1),u=o*l,f={x:h+l,y:c+u}}return f}getPointOnPath(e){var t=this.getPathLength(),A=0,n=null;if(e<-5e-5||e-5e-5>t)return null;var{dataArray:i}=this;for(var s of i){if(s&&(s.pathLength<5e-5||A+s.pathLength+5e-5<e)){A+=s.pathLength;continue}var a=e-A,o=0;switch(s.type){case Ft.LINE_TO:n=this.getPointOnLine(a,s.start.x,s.start.y,s.points[0],s.points[1],s.start.x,s.start.y);break;case Ft.ARC:{var l=s.points[4],u=s.points[5],f=s.points[4]+u;if(o=l+a/s.pathLength*u,u<0&&o<f||u>=0&&o>f)break;n=this.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],o,s.points[6]);break}case Ft.CURVE_TO:o=a/s.pathLength,o>1&&(o=1),n=this.getPointOnCubicBezier(o,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3],s.points[4],s.points[5]);break;case Ft.QUAD_TO:o=a/s.pathLength,o>1&&(o=1),n=this.getPointOnQuadraticBezier(o,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3]);break}if(n)return n;break}return null}getLineLength(e,t,A,n){return Math.sqrt((A-e)*(A-e)+(n-t)*(n-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,A,n,i,s,a,o,l){var u=o*K1(e)+s*q1(e)+n*V1(e)+t*z1(e),f=l*K1(e)+a*q1(e)+i*V1(e)+A*z1(e);return{x:u,y:f}}getPointOnQuadraticBezier(e,t,A,n,i,s,a){var o=s*G1(e)+n*W1(e)+t*X1(e),l=a*G1(e)+i*W1(e)+A*X1(e);return{x:o,y:l}}getPointOnEllipticalArc(e,t,A,n,i,s){var a=Math.cos(s),o=Math.sin(s),l={x:A*Math.cos(i),y:n*Math.sin(i)};return{x:e+(l.x*a-l.y*o),y:t+(l.x*o+l.y*a)}}buildEquidistantCache(e,t){var A=this.getPathLength(),n=t||.25,i=e||A/100;if(!this.equidistantCache||this.equidistantCache.step!==i||this.equidistantCache.precision!==n){this.equidistantCache={step:i,precision:n,points:[]};for(var s=0,a=0;a<=A;a+=n){var o=this.getPointOnPath(a),l=this.getPointOnPath(a+n);!o||!l||(s+=this.getLineLength(o.x,o.y,l.x,l.y),s>=i&&(this.equidistantCache.points.push({x:o.x,y:o.y,distance:a}),s-=i))}}}getEquidistantPointOnPath(e,t,A){if(this.buildEquidistantCache(t,A),e<0||e-this.getPathLength()>5e-5)return null;var n=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[n]||null}}var D8=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class VF extends Aa{constructor(e,t,A){super(e,t,A),this.type="image",this.loaded=!1;var n=this.getHrefAttribute().getString();if(n){var i=n.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(n);e.images.push(this),i?this.loadSvg(n):this.loadImage(n),this.isSvg=i}}loadImage(e){var t=this;return pi(function*(){try{var A=yield t.document.createImage(e);t.image=A}catch(n){console.error('Error while loading image "'.concat(e,'":'),n)}t.loaded=!0})()}loadSvg(e){var t=this;return pi(function*(){var A=D8.exec(e);if(A){var n=A[5];A[4]==="base64"?t.image=atob(n):t.image=decodeURIComponent(n)}else try{var i=yield t.document.fetch(e),s=yield i.text();t.image=s}catch(a){console.error('Error while loading image "'.concat(e,'":'),a)}t.loaded=!0})()}renderChildren(e){var{document:t,image:A,loaded:n}=this,i=this.getAttribute("x").getPixels("x"),s=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(!(!n||!A||!a||!o)){if(e.save(),e.translate(i,s),this.isSvg){var l=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:a,scaleHeight:o});l.document.documentElement.parent=this,l.render()}else{var u=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:a,desiredWidth:u.width,height:o,desiredHeight:u.height}),this.loaded&&(typeof u.complete>"u"||u.complete)&&e.drawImage(u,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),A=this.getStyle("width").getPixels("x"),n=this.getStyle("height").getPixels("y");return new hn(e,t,e+A,t+n)}}class zF extends Aa{constructor(){super(...arguments),this.type="symbol"}render(e){}}class GF{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var A=this;return pi(function*(){try{var{document:n}=A,i=yield n.canvg.parser.load(t),s=i.getElementsByTagName("font");Array.from(s).forEach(a=>{var o=n.createElement(a);n.definitions[e]=o})}catch(a){console.error('Error while loading font "'.concat(t,'":'),a)}A.loaded=!0})()}}class rv extends lr{constructor(e,t,A){super(e,t,A),this.type="style";var n=ka(Array.from(t.childNodes).map(s=>s.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),i=n.split("}");i.forEach(s=>{var a=s.trim();if(a){var o=a.split("{"),l=o[0].split(","),u=o[1].split(";");l.forEach(f=>{var h=f.trim();if(h){var c=e.styles[h]||{};if(u.forEach(y=>{var w=y.indexOf(":"),B=y.substr(0,w).trim(),x=y.substr(w+1,y.length-w).trim();B&&x&&(c[B]=new yt(e,B,x))}),e.styles[h]=c,e.stylesSpecificity[h]=gF(h),h==="@font-face"){var g=c["font-family"].getString().replace(/"|'/g,""),p=c.src.getString().split(",");p.forEach(y=>{if(y.indexOf('format("svg")')>0){var w=k1(y);w&&new GF(e).load(g,w)}})}}})}})}}rv.parseExternalUrl=k1;class WF extends Aa{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var t=this.getAttribute("x"),A=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),A.hasValue()&&e.translate(0,A.getPixels("y"))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:A}=this;if(A){var n=A;if(A.type==="symbol"&&(n=new Ds(t,null),n.attributes.viewBox=new yt(t,"viewBox",A.getAttribute("viewBox").getString()),n.attributes.preserveAspectRatio=new yt(t,"preserveAspectRatio",A.getAttribute("preserveAspectRatio").getString()),n.attributes.overflow=new yt(t,"overflow",A.getAttribute("overflow").getString()),n.children=A.children,A.styles.opacity=new yt(t,"opacity",this.calculateOpacity())),n.type==="svg"){var i=this.getStyle("width",!1,!0),s=this.getStyle("height",!1,!0);i.hasValue()&&(n.attributes.width=new yt(t,"width",i.getString())),s.hasValue()&&(n.attributes.height=new yt(t,"height",s.getString()))}var a=n.parent;n.parent=this,n.render(e),n.parent=a}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return ra.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function mf(r,e,t,A,n,i){return r[t*A*4+e*4+i]}function wf(r,e,t,A,n,i,s){r[t*A*4+e*4+i]=s}function Rr(r,e,t){var A=r[e];return A*t}function wi(r,e,t,A){return e+Math.cos(r)*t+Math.sin(r)*A}class Av extends lr{constructor(e,t,A){super(e,t,A),this.type="feColorMatrix";var n=kA(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var i=n[0];n=[.213+.787*i,.715-.715*i,.072-.072*i,0,0,.213-.213*i,.715+.285*i,.072-.072*i,0,0,.213-.213*i,.715-.715*i,.072+.928*i,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var s=n[0]*Math.PI/180;n=[wi(s,.213,.787,-.213),wi(s,.715,-.715,-.715),wi(s,.072,-.072,.928),0,0,wi(s,.213,-.213,.143),wi(s,.715,.285,.14),wi(s,.072,-.072,-.283),0,0,wi(s,.213,-.213,-.787),wi(s,.715,-.715,.715),wi(s,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=n,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,A,n,i){for(var{includeOpacity:s,matrix:a}=this,o=e.getImageData(0,0,n,i),l=0;l<i;l++)for(var u=0;u<n;u++){var f=mf(o.data,u,l,n,i,0),h=mf(o.data,u,l,n,i,1),c=mf(o.data,u,l,n,i,2),g=mf(o.data,u,l,n,i,3),p=Rr(a,0,f)+Rr(a,1,h)+Rr(a,2,c)+Rr(a,3,g)+Rr(a,4,1),y=Rr(a,5,f)+Rr(a,6,h)+Rr(a,7,c)+Rr(a,8,g)+Rr(a,9,1),w=Rr(a,10,f)+Rr(a,11,h)+Rr(a,12,c)+Rr(a,13,g)+Rr(a,14,1),B=Rr(a,15,f)+Rr(a,16,h)+Rr(a,17,c)+Rr(a,18,g)+Rr(a,19,1);s&&(p=0,y=0,w=0,B*=g/255),wf(o.data,u,l,n,i,0,p),wf(o.data,u,l,n,i,1,y),wf(o.data,u,l,n,i,2,w),wf(o.data,u,l,n,i,3,B)}e.clearRect(0,0,n,i),e.putImageData(o,0,0)}}class sl extends lr{constructor(){super(...arguments),this.type="mask"}apply(e,t){var{document:A}=this,n=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y");if(!s&&!a){var o=new hn;this.children.forEach(g=>{o.addBoundingBox(g.getBoundingBox(e))}),n=Math.floor(o.x1),i=Math.floor(o.y1),s=Math.floor(o.width),a=Math.floor(o.height)}var l=this.removeStyles(t,sl.ignoreStyles),u=A.createCanvas(n+s,i+a),f=u.getContext("2d");A.screen.setDefaults(f),this.renderChildren(f),new Av(A,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(f,0,0,n+s,i+a);var h=A.createCanvas(n+s,i+a),c=h.getContext("2d");A.screen.setDefaults(c),t.render(c),c.globalCompositeOperation="destination-in",c.fillStyle=f.createPattern(u,"no-repeat"),c.fillRect(0,0,n+s,i+a),e.fillStyle=c.createPattern(h,"no-repeat"),e.fillRect(0,0,n+s,i+a),this.restoreStyles(t,l)}render(e){}}sl.ignoreStyles=["mask","transform","clip-path"];var XF=()=>{};class YF extends lr{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:t}=this,A=Reflect.getPrototypeOf(e),{beginPath:n,closePath:i}=e;A&&(A.beginPath=XF,A.closePath=XF),Reflect.apply(n,e,[]),this.children.forEach(s=>{if(!(typeof s.path>"u")){var a=typeof s.elementTransform<"u"?s.elementTransform():null;a||(a=ra.fromElement(t,s)),a&&a.apply(e),s.path(e),A&&(A.closePath=i),a&&a.unapply(e)}}),Reflect.apply(i,e,[]),e.clip(),A&&(A.beginPath=n,A.closePath=i)}render(e){}}class ol extends lr{constructor(){super(...arguments),this.type="filter"}apply(e,t){var{document:A,children:n}=this,i=t.getBoundingBox(e);if(i){var s=0,a=0;n.forEach(w=>{var B=w.extraFilterDistance||0;s=Math.max(s,B),a=Math.max(a,B)});var o=Math.floor(i.width),l=Math.floor(i.height),u=o+2*s,f=l+2*a;if(!(u<1||f<1)){var h=Math.floor(i.x),c=Math.floor(i.y),g=this.removeStyles(t,ol.ignoreStyles),p=A.createCanvas(u,f),y=p.getContext("2d");A.screen.setDefaults(y),y.translate(-h+s,-c+a),t.render(y),n.forEach(w=>{typeof w.apply=="function"&&w.apply(y,0,0,u,f)}),e.drawImage(p,0,0,u,f,h-s,c-a,u,f),this.restoreStyles(t,g)}}}render(e){}}ol.ignoreStyles=["filter","transform","clip-path"];class $F extends lr{constructor(e,t,A){super(e,t,A),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,t,A,n,i){}}class JF extends lr{constructor(){super(...arguments),this.type="feMorphology"}apply(e,t,A,n,i){}}class ZF extends lr{constructor(){super(...arguments),this.type="feComposite"}apply(e,t,A,n,i){}}class eS extends lr{constructor(e,t,A){super(e,t,A),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,A,n,i){var{document:s,blurRadius:a}=this,o=s.window?s.window.document.body:null,l=e.canvas;l.id=s.getUniqueId(),o&&(l.style.display="none",o.appendChild(l)),v8(l,t,A,n,i,a),o&&o.removeChild(l)}}class tS extends lr{constructor(){super(...arguments),this.type="title"}}class rS extends lr{constructor(){super(...arguments),this.type="desc"}}var k8={svg:Ds,rect:Z1,circle:FF,ellipse:SF,line:UF,polyline:ev,polygon:_F,path:Vt,pattern:IF,marker:QF,defs:NF,linearGradient:OF,radialGradient:TF,stop:LF,animate:pf,animateColor:PF,animateTransform:RF,font:MF,"font-face":DF,"missing-glyph":kF,glyph:J1,text:mi,tspan:al,tref:HF,a:jF,textPath:qF,image:VF,g:gf,symbol:zF,style:rv,use:WF,mask:sl,clipPath:YF,filter:ol,feDropShadow:$F,feMorphology:JF,feComposite:ZF,feColorMatrix:Av,feGaussianBlur:eS,title:tS,desc:rS};function AS(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(r);e&&(A=A.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,A)}return t}function H8(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?AS(Object(t),!0).forEach(function(A){U1(r,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):AS(Object(t)).forEach(function(A){Object.defineProperty(r,A,Object.getOwnPropertyDescriptor(t,A))})}return r}function j8(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,t}function K8(r){return nv.apply(this,arguments)}function nv(){return nv=pi(function*(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((A,n)=>{t.onload=()=>{A(t)},t.onerror=(i,s,a,o,l)=>{n(l)},t.src=r})}),nv.apply(this,arguments)}class yi{constructor(e){var{rootEmSize:t=12,emSize:A=12,createCanvas:n=yi.createCanvas,createImage:i=yi.createImage,anonymousCrossOrigin:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=e,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=A,this.createCanvas=n,this.createImage=this.bindCreateImage(i,s),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return typeof t=="boolean"?(A,n)=>e(A,typeof n=="boolean"?n:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){var t=e.nodeName.replace(/^[^:]+:/,""),A=yi.elementTypes[t];return typeof A<"u"?new A(this,e):new EF(this,e)}createTextNode(e){return new M8(this,e)}setViewBox(e){this.screen.setViewBox(H8({document:this},e))}}yi.createCanvas=j8,yi.createImage=K8,yi.elementTypes=k8;function nS(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(r);e&&(A=A.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,A)}return t}function Ka(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nS(Object(t),!0).forEach(function(A){U1(r,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):nS(Object(t)).forEach(function(A){Object.defineProperty(r,A,Object.getOwnPropertyDescriptor(t,A))})}return r}class qa{constructor(e,t){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new df(A),this.screen=new il(e,A),this.options=A;var n=new yi(this,A),i=n.createDocumentElement(t);this.document=n,this.documentElement=i}static from(e,t){var A=arguments;return pi(function*(){var n=A.length>2&&A[2]!==void 0?A[2]:{},i=new df(n),s=yield i.parse(t);return new qa(e,s,n)})()}static fromString(e,t){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new df(A),i=n.parseFromString(t);return new qa(e,i,A)}fork(e,t){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return qa.from(e,t,Ka(Ka({},this.options),A))}forkString(e,t){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return qa.fromString(e,t,Ka(Ka({},this.options),A))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return pi(function*(){var A=e.length>0&&e[0]!==void 0?e[0]:{};t.start(Ka({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},A)),yield t.ready(),t.stop()})()}start(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:t,screen:A,options:n}=this;A.start(t,Ka(Ka({enableRedraw:!0},n),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,t,A)}}const q8=Object.freeze(Object.defineProperty({__proto__:null,AElement:jF,AnimateColorElement:PF,AnimateElement:pf,AnimateTransformElement:RF,BoundingBox:hn,CB1:K1,CB2:q1,CB3:V1,CB4:z1,Canvg:qa,CircleElement:FF,ClipPathElement:YF,DefsElement:NF,DescElement:rS,Document:yi,Element:lr,EllipseElement:SF,FeColorMatrixElement:Av,FeCompositeElement:ZF,FeDropShadowElement:$F,FeGaussianBlurElement:eS,FeMorphologyElement:JF,FilterElement:ol,Font:BA,FontElement:MF,FontFaceElement:DF,GElement:gf,GlyphElement:J1,GradientElement:tv,ImageElement:VF,LineElement:UF,LinearGradientElement:OF,MarkerElement:QF,MaskElement:sl,Matrix:Y1,MissingGlyphElement:kF,Mouse:vF,PSEUDO_ZERO:ja,Parser:df,PathElement:Vt,PathParser:Ft,PatternElement:IF,Point:vr,PolygonElement:_F,PolylineElement:ev,Property:yt,QB1:G1,QB2:W1,QB3:X1,RadialGradientElement:TF,RectElement:Z1,RenderedElement:Aa,Rotate:BF,SVGElement:Ds,SVGFontLoader:GF,Scale:bF,Screen:il,Skew:$1,SkewX:xF,SkewY:CF,StopElement:LF,StyleElement:rv,SymbolElement:zF,TRefElement:HF,TSpanElement:al,TextElement:mi,TextPathElement:qF,TitleElement:tS,Transform:ra,Translate:yF,UnknownElement:EF,UseElement:WF,ViewPort:pF,compressSpaces:ka,default:qa,getSelectorSpecificity:gF,normalizeAttributeName:hF,normalizeColor:dF,parseExternalUrl:k1,presets:B8,toNumbers:kA,trimLeft:cF,trimRight:fF,vectorMagnitude:H1,vectorsAngle:j1,vectorsRatio:hf},Symbol.toStringTag,{value:"Module"}));wt.BandBoundaryDesigner=iP,wt.BandPropertyPanel=_w,wt.CanvasArea=Fw,wt.ColorPicker=Di,wt.FormulaEditor=go,wt.ObjectPropertyPanel=Qw,wt.PageSettingsPanel=kx,wt.PrintPreview=Dx,wt.RichTextEditor=Iw,wt.Toolbar=aP,wt.bandTypeOptions=GS,wt.barcodeTypeOptions=Gv,wt.borderStyles=Hv,wt.controlTypes=Zs,wt.dateFormatOptions=Vv,wt.defaultBands=Jf,wt.defaultFontSettings=WS,wt.defaultOptions=kv,wt.defaultPageSettings=Yv,wt.evaluateFormula=ho,wt.exportToPdf=hP,wt.fontStyleOptions=qv,wt.fontWeightOptions=Kv,wt.formatTypeOptions=eh,wt.getBandObjectsRenderData=Ew,wt.getDetailDataKey=Zf,wt.getObjectContent=Qu,wt.getObjectRenderData=Nu,wt.getPrintableHtml=Hx,wt.getRegisteredFunctions=MU,wt.imageObjectFitOptions=zv,wt.lineStyleOptions=Xv,wt.marginPresets=Pl,wt.openPrintWindow=dP,wt.orientationOptions=$v,wt.pageSizePresets=Ll,wt.qrcodeErrorLevelOptions=Wv,wt.registerFunction=RU,wt.renderToHtml=Cg,wt.textAlignOptions=zS,wt.textVerticalAlignOptions=jv,wt.useBandDesigner=Zv,wt.useHistory=Jv,wt.validateFormula=Bw,Object.defineProperty(wt,Symbol.toStringTag,{value:"Module"})}));
|
|
797
|
+
`},sF=function(r){return 48<=r.charCodeAt(0)&&r.charCodeAt(0)<=57},u8=(function(r){function e(){var t=r.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return eF(e,r),e.prototype.finish=function(t){if(t===void 0&&(t=[]),this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,A){var n=this;A===void 0&&(A=[]);for(var i=function(f){A.push(f),n.curArgs.length=0,n.canParseCommandOrComma=!0},s=0;s<t.length;s++){var a=t[s],o=!(this.curCommandType!==$e.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),l=sF(a)&&(this.curNumber==="0"&&a==="0"||o);if(!sF(a)||l)if(a!=="e"&&a!=="E")if(a!=="-"&&a!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(a!=="."||this.curNumberHasExp||this.curNumberHasDecimal||o){if(this.curNumber&&this.curCommandType!==-1){var u=Number(this.curNumber);if(isNaN(u))throw new SyntaxError("Invalid number ending at "+s);if(this.curCommandType===$e.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>u)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+s+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+s+'"')}this.curArgs.push(u),this.curArgs.length===c8[this.curCommandType]&&($e.HORIZ_LINE_TO===this.curCommandType?i({type:$e.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):$e.VERT_LINE_TO===this.curCommandType?i({type:$e.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===$e.MOVE_TO||this.curCommandType===$e.LINE_TO||this.curCommandType===$e.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),$e.MOVE_TO===this.curCommandType&&(this.curCommandType=$e.LINE_TO)):this.curCommandType===$e.CURVE_TO?i({type:$e.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===$e.SMOOTH_CURVE_TO?i({type:$e.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===$e.QUAD_TO?i({type:$e.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===$e.ARC&&i({type:$e.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!l8(a))if(a===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(a!=="+"&&a!=="-"&&a!==".")if(l)this.curNumber=a,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+s+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+a+'" at index '+s+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,a!=="z"&&a!=="Z")if(a==="h"||a==="H")this.curCommandType=$e.HORIZ_LINE_TO,this.curCommandRelative=a==="h";else if(a==="v"||a==="V")this.curCommandType=$e.VERT_LINE_TO,this.curCommandRelative=a==="v";else if(a==="m"||a==="M")this.curCommandType=$e.MOVE_TO,this.curCommandRelative=a==="m";else if(a==="l"||a==="L")this.curCommandType=$e.LINE_TO,this.curCommandRelative=a==="l";else if(a==="c"||a==="C")this.curCommandType=$e.CURVE_TO,this.curCommandRelative=a==="c";else if(a==="s"||a==="S")this.curCommandType=$e.SMOOTH_CURVE_TO,this.curCommandRelative=a==="s";else if(a==="q"||a==="Q")this.curCommandType=$e.QUAD_TO,this.curCommandRelative=a==="q";else if(a==="t"||a==="T")this.curCommandType=$e.SMOOTH_QUAD_TO,this.curCommandRelative=a==="t";else{if(a!=="a"&&a!=="A")throw new SyntaxError('Unexpected character "'+a+'" at index '+s+".");this.curCommandType=$e.ARC,this.curCommandRelative=a==="a"}else A.push({type:$e.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=a,this.curNumberHasDecimal=a==="."}else this.curNumber+=a,this.curNumberHasDecimal=!0;else this.curNumber+=a;else this.curNumber+=a,this.curNumberHasExp=!0;else this.curNumber+=a,this.curNumberHasExpDigits=this.curNumberHasExp}return A},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(A,n){n===void 0&&(n=[]);for(var i=0,s=Object.getPrototypeOf(this).parse.call(this,A);i<s.length;i++){var a=s[i],o=t(a);Array.isArray(o)?n.push.apply(n,o):n.push(o)}return n}}})},e})(aF),$e=(function(r){function e(t){var A=r.call(this)||this;return A.commands=typeof t=="string"?e.parse(t):t,A}return eF(e,r),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=Pr.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var A=[],n=0,i=this.commands;n<i.length;n++){var s=t(i[n]);Array.isArray(s)?A.push.apply(A,s):A.push(s)}return this.commands=A,this},e.encode=function(t){return o8(t)},e.parse=function(t){var A=new u8,n=[];return A.parse(t,n),A.finish(n),n},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e})(aF),c8=((On={})[$e.MOVE_TO]=2,On[$e.LINE_TO]=2,On[$e.HORIZ_LINE_TO]=1,On[$e.VERT_LINE_TO]=1,On[$e.CLOSE_PATH]=0,On[$e.QUAD_TO]=4,On[$e.SMOOTH_QUAD_TO]=2,On[$e.CURVE_TO]=6,On[$e.SMOOTH_CURVE_TO]=4,On[$e.ARC]=7,On),oF={},lF;function f8(){if(lF)return oF;lF=1;var r=nf().PROPER,e=Ma(),t=_A(),A=$n(),n=gr(),i=l1(),s="toString",a=RegExp.prototype,o=a[s],l=n(function(){return o.call({source:"a",flags:"b"})!=="/a/b"}),u=r&&o.name!==s;return(l||u)&&e(a,s,function(){var h=t(this),c=A(h.source),g=A(i(h));return"/"+c+"/"+g},{unsafe:!0}),oF}f8();function ff(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ff=function(e){return typeof e}:ff=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ff(r)}function h8(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var d8=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],g8=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function p8(r,e,t,A,n){if(typeof r=="string"&&(r=document.getElementById(r)),!r||ff(r)!=="object"||!("getContext"in r))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var i=r.getContext("2d");try{return i.getImageData(e,t,A,n)}catch(s){throw new Error("unable to access image data: "+s)}}function v8(r,e,t,A,n,i){if(!(isNaN(i)||i<1)){i|=0;var s=p8(r,e,t,A,n);s=m8(s,e,t,A,n,i),r.getContext("2d").putImageData(s,e,t)}}function m8(r,e,t,A,n,i){for(var s=r.data,a=2*i+1,o=A-1,l=n-1,u=i+1,f=u*(u+1)/2,h=new uF,c=h,g,p=1;p<a;p++)c=c.next=new uF,p===u&&(g=c);c.next=h;for(var y=null,w=null,B=0,x=0,E=d8[i],Q=g8[i],L=0;L<n;L++){c=h;for(var S=s[x],T=s[x+1],_=s[x+2],D=s[x+3],U=0;U<u;U++)c.r=S,c.g=T,c.b=_,c.a=D,c=c.next;for(var O=0,M=0,C=0,z=0,re=u*S,ne=u*T,Z=u*_,Ae=u*D,V=f*S,k=f*T,I=f*_,P=f*D,K=1;K<u;K++){var Y=x+((o<K?o:K)<<2),J=s[Y],q=s[Y+1],W=s[Y+2],te=s[Y+3],oe=u-K;V+=(c.r=J)*oe,k+=(c.g=q)*oe,I+=(c.b=W)*oe,P+=(c.a=te)*oe,O+=J,M+=q,C+=W,z+=te,c=c.next}y=h,w=g;for(var we=0;we<A;we++){var le=P*E>>>Q;if(s[x+3]=le,le!==0){var Be=255/le;s[x]=(V*E>>>Q)*Be,s[x+1]=(k*E>>>Q)*Be,s[x+2]=(I*E>>>Q)*Be}else s[x]=s[x+1]=s[x+2]=0;V-=re,k-=ne,I-=Z,P-=Ae,re-=y.r,ne-=y.g,Z-=y.b,Ae-=y.a;var ye=we+i+1;ye=B+(ye<o?ye:o)<<2,O+=y.r=s[ye],M+=y.g=s[ye+1],C+=y.b=s[ye+2],z+=y.a=s[ye+3],V+=O,k+=M,I+=C,P+=z,y=y.next;var R=w,Ie=R.r,Ue=R.g,Te=R.b,Ee=R.a;re+=Ie,ne+=Ue,Z+=Te,Ae+=Ee,O-=Ie,M-=Ue,C-=Te,z-=Ee,w=w.next,x+=4}B+=A}for(var Ve=0;Ve<A;Ve++){x=Ve<<2;var Me=s[x],ze=s[x+1],Ye=s[x+2],xe=s[x+3],Oe=u*Me,je=u*ze,ge=u*Ye,Re=u*xe,Le=f*Me,ue=f*ze,fe=f*Ye,Pe=f*xe;c=h;for(var Fe=0;Fe<u;Fe++)c.r=Me,c.g=ze,c.b=Ye,c.a=xe,c=c.next;for(var Ne=A,ve=0,Qe=0,De=0,it=0,et=1;et<=i;et++){x=Ne+Ve<<2;var Ge=u-et;Le+=(c.r=Me=s[x])*Ge,ue+=(c.g=ze=s[x+1])*Ge,fe+=(c.b=Ye=s[x+2])*Ge,Pe+=(c.a=xe=s[x+3])*Ge,it+=Me,ve+=ze,Qe+=Ye,De+=xe,c=c.next,et<l&&(Ne+=A)}x=Ve,y=h,w=g;for(var At=0;At<n;At++){var nt=x<<2;s[nt+3]=xe=Pe*E>>>Q,xe>0?(xe=255/xe,s[nt]=(Le*E>>>Q)*xe,s[nt+1]=(ue*E>>>Q)*xe,s[nt+2]=(fe*E>>>Q)*xe):s[nt]=s[nt+1]=s[nt+2]=0,Le-=Oe,ue-=je,fe-=ge,Pe-=Re,Oe-=y.r,je-=y.g,ge-=y.b,Re-=y.a,nt=Ve+((nt=At+u)<l?nt:l)*A<<2,Le+=it+=y.r=s[nt],ue+=ve+=y.g=s[nt+1],fe+=Qe+=y.b=s[nt+2],Pe+=De+=y.a=s[nt+3],y=y.next,Oe+=Me=w.r,je+=ze=w.g,ge+=Ye=w.b,Re+=xe=w.a,it-=Me,ve-=ze,Qe-=Ye,De-=xe,w=w.next,x+=A}}return r}var uF=function r(){h8(this,r),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function w8(){var{DOMParser:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:r,createCanvas(t,A){return new OffscreenCanvas(t,A)},createImage(t){return pi(function*(){var A=yield fetch(t),n=yield A.blob(),i=yield createImageBitmap(n);return i})()}};return(typeof DOMParser<"u"||typeof r>"u")&&Reflect.deleteProperty(e,"DOMParser"),e}function y8(r){var{DOMParser:e,canvas:t,fetch:A}=r;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:A,createCanvas:t.createCanvas,createImage:t.loadImage}}var B8=Object.freeze({__proto__:null,offscreen:w8,node:y8});function ka(r){return r.replace(/(?!\u3000)\s+/gm," ")}function cF(r){return r.replace(/^[\n \t]+/,"")}function fF(r){return r.replace(/[\n \t]+$/,"")}function kA(r){var e=(r||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return e.map(parseFloat)}var b8=/^[A-Z-]+$/;function hF(r){return b8.test(r)?r.toLowerCase():r}function k1(r){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(r)||[];return e[2]||e[3]||e[4]}function dF(r){if(!r.startsWith("rgb"))return r;var e=3,t=r.replace(/\d+(\.\d+)?/g,(A,n)=>e--&&n?String(Math.round(parseFloat(A))):A);return t}var x8=/(\[[^\]]+\])/g,C8=/(#[^\s+>~.[:]+)/g,E8=/(\.[^\s+>~.[:]+)/g,F8=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,S8=/(:[\w-]+\([^)]*\))/gi,U8=/(:[^\s+>~.[:]+)/g,_8=/([^\s+>~.[:]+)/g;function Ha(r,e){var t=e.exec(r);return t?[r.replace(e," "),t.length]:[r,0]}function gF(r){var e=[0,0,0],t=r.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),A=0;return[t,A]=Ha(t,x8),e[1]+=A,[t,A]=Ha(t,C8),e[0]+=A,[t,A]=Ha(t,E8),e[1]+=A,[t,A]=Ha(t,F8),e[2]+=A,[t,A]=Ha(t,S8),e[1]+=A,[t,A]=Ha(t,U8),e[1]+=A,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,A]=Ha(t,_8),e[2]+=A,e.join("")}var ja=1e-8;function H1(r){return Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2))}function hf(r,e){return(r[0]*e[0]+r[1]*e[1])/(H1(r)*H1(e))}function j1(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(hf(r,e))}function K1(r){return r*r*r}function q1(r){return 3*r*r*(1-r)}function V1(r){return 3*r*(1-r)*(1-r)}function z1(r){return(1-r)*(1-r)*(1-r)}function G1(r){return r*r}function W1(r){return 2*r*(1-r)}function X1(r){return(1-r)*(1-r)}class yt{constructor(e,t,A){this.document=e,this.name=t,this.value=A,this.isNormalizedColor=!1}static empty(e){return new yt(e,"EMPTY","")}split(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ",{document:t,name:A}=this;return ka(this.getString()).trim().split(e).map(n=>new yt(t,A,n))}hasValue(e){var{value:t}=this;return t!==null&&t!==""&&(e||t!==0)&&typeof t<"u"}isString(e){var{value:t}=this,A=typeof t=="string";return!A||!e?A:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);var{value:t}=this,A=parseFloat(t);return this.isString(/%$/)&&(A/=100),A}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=dF(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[A,n]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:i}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(i.computeSize("x"),i.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(i.computeSize("x"),i.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*i.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*i.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&n):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*i.computeSize(A);default:{var s=this.getNumber();return t&&s<1?s*i.computeSize(A):s}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var A=this.getDefinition();if(!A)return null;if(typeof A.createGradient=="function")return A.createGradient(this.document.ctx,e,t);if(typeof A.createPattern=="function"){if(A.getHrefAttribute().hasValue()){var n=A.getAttribute("patternTransform");A=A.getHrefAttribute().getDefinition(),n.hasValue()&&A.getAttribute("patternTransform",!0).setValue(n.value)}return A.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){return this.hasValue()?yt.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var t=this.getColor(),A=t.length,n=0,i=0;i<A&&(t[i]===","&&n++,n!==3);i++);if(e.hasValue()&&this.isString()&&n!==3){var s=new P1(t);s.ok&&(s.alpha=e.getNumber(),t=s.toRGBA())}return new yt(this.document,this.name,t)}}yt.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class pF{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:e}=this;return e[e.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return typeof e=="number"?e:e==="x"?this.width:e==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class vr{constructor(e,t){this.x=e,this.y=t}static parse(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,[A=t,n=t]=kA(e);return new vr(A,n)}static parseScale(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[A=t,n=A]=kA(e);return new vr(A,n)}static parsePath(e){for(var t=kA(e),A=t.length,n=[],i=0;i<A;i+=2)n.push(new vr(t[i],t[i+1]));return n}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){var{x:t,y:A}=this,n=t*e[0]+A*e[2]+e[4],i=t*e[1]+A*e[3]+e[5];this.x=n,this.y=i}}class vF{constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:e,onClick:t,onMouseMove:A}=this,n=e.ctx.canvas;n.onclick=t,n.onmousemove=A,this.working=!0}}stop(){if(this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:e,events:t,eventElements:A}=this,{style:n}=e.ctx.canvas;n&&(n.cursor=""),t.forEach((i,s)=>{for(var{run:a}=i,o=A[s];o;)a(o),o=o.parent}),this.events=[],this.eventElements=[]}}checkPath(e,t){if(!(!this.working||!t)){var{events:A,eventElements:n}=this;A.forEach((i,s)=>{var{x:a,y:o}=i;!n[s]&&t.isPointInPath&&t.isPointInPath(a,o)&&(n[s]=e)})}}checkBoundingBox(e,t){if(!(!this.working||!t)){var{events:A,eventElements:n}=this;A.forEach((i,s)=>{var{x:a,y:o}=i;!n[s]&&t.isPointInBox(a,o)&&(n[s]=e)})}}mapXY(e,t){for(var{window:A,ctx:n}=this.screen,i=new vr(e,t),s=n.canvas;s;)i.x-=s.offsetLeft,i.y-=s.offsetTop,s=s.offsetParent;return A.scrollX&&(i.x+=A.scrollX),A.scrollY&&(i.y+=A.scrollY),i}onClick(e){var{x:t,y:A}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:A,run(n){n.onClick&&n.onClick()}})}onMouseMove(e){var{x:t,y:A}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:A,run(n){n.onMouseMove&&n.onMouseMove()}})}}var mF=typeof window<"u"?window:null,wF=typeof fetch<"u"?fetch.bind(void 0):null;class il{constructor(e){var{fetch:t=wF,window:A=mF}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new pF,this.mouse=new vF(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=A,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:t,ctx:A,aspectRatio:n,width:i,desiredWidth:s,height:a,desiredHeight:o,minX:l=0,minY:u=0,refX:f,refY:h,clip:c=!1,clipX:g=0,clipY:p=0}=e,y=ka(n).replace(/^defer\s/,""),[w,B]=y.split(" "),x=w||"xMidYMid",E=B||"meet",Q=i/s,L=a/o,S=Math.min(Q,L),T=Math.max(Q,L),_=s,D=o;E==="meet"&&(_*=S,D*=S),E==="slice"&&(_*=T,D*=T);var U=new yt(t,"refX",f),O=new yt(t,"refY",h),M=U.hasValue()&&O.hasValue();if(M&&A.translate(-S*U.getPixels("x"),-S*O.getPixels("y")),c){var C=S*g,z=S*p;A.beginPath(),A.moveTo(C,z),A.lineTo(i,z),A.lineTo(i,a),A.lineTo(C,a),A.closePath(),A.clip()}if(!M){var re=E==="meet"&&S===L,ne=E==="slice"&&T===L,Z=E==="meet"&&S===Q,Ae=E==="slice"&&T===Q;x.startsWith("xMid")&&(re||ne)&&A.translate(i/2-_/2,0),x.endsWith("YMid")&&(Z||Ae)&&A.translate(0,a/2-D/2),x.startsWith("xMax")&&(re||ne)&&A.translate(i-_,0),x.endsWith("YMax")&&(Z||Ae)&&A.translate(0,a-D)}switch(!0){case x==="none":A.scale(Q,L);break;case E==="meet":A.scale(S,S);break;case E==="slice":A.scale(T,T);break}A.translate(-l,-u)}start(e){var{enableRedraw:t=!1,ignoreMouse:A=!1,ignoreAnimation:n=!1,ignoreDimensions:i=!1,ignoreClear:s=!1,forceRedraw:a,scaleWidth:o,scaleHeight:l,offsetX:u,offsetY:f}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:h,mouse:c}=this,g=1e3/h;if(this.frameDuration=g,this.readyPromise=new Promise(x=>{this.resolveReady=x}),this.isReady()&&this.render(e,i,s,o,l,u,f),!!t){var p=Date.now(),y=p,w=0,B=()=>{p=Date.now(),w=p-y,w>=g&&(y=p-w%g,this.shouldUpdate(n,a)&&(this.render(e,i,s,o,l,u,f),c.runEvents())),this.intervalId=Q1(B)};A||c.start(),this.intervalId=Q1(B)}}stop(){this.intervalId&&(Q1.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:A}=this,n=this.animations.reduce((i,s)=>s.update(A)||i,!1);if(n)return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,A,n,i,s,a){var{CLIENT_WIDTH:o,CLIENT_HEIGHT:l,viewPort:u,ctx:f,isFirstRender:h}=this,c=f.canvas;u.clear(),c.width&&c.height?u.setCurrent(c.width,c.height):u.setCurrent(o,l);var g=e.getStyle("width"),p=e.getStyle("height");!t&&(h||typeof n!="number"&&typeof i!="number")&&(g.hasValue()&&(c.width=g.getPixels("x"),c.style&&(c.style.width="".concat(c.width,"px"))),p.hasValue()&&(c.height=p.getPixels("y"),c.style&&(c.style.height="".concat(c.height,"px"))));var y=c.clientWidth||c.width,w=c.clientHeight||c.height;if(t&&g.hasValue()&&p.hasValue()&&(y=g.getPixels("x"),w=p.getPixels("y")),u.setCurrent(y,w),typeof s=="number"&&e.getAttribute("x",!0).setValue(s),typeof a=="number"&&e.getAttribute("y",!0).setValue(a),typeof n=="number"||typeof i=="number"){var B=kA(e.getAttribute("viewBox").getString()),x=0,E=0;if(typeof n=="number"){var Q=e.getStyle("width");Q.hasValue()?x=Q.getPixels("x")/n:isNaN(B[2])||(x=B[2]/n)}if(typeof i=="number"){var L=e.getStyle("height");L.hasValue()?E=L.getPixels("y")/i:isNaN(B[3])||(E=B[3]/i)}x||(x=E),E||(E=x),e.getAttribute("width",!0).setValue(n),e.getAttribute("height",!0).setValue(i);var S=e.getStyle("transform",!0,!0);S.setValue("".concat(S.getString()," scale(").concat(1/x,", ").concat(1/E,")"))}A||f.clearRect(0,0,y,w),e.render(f),h&&(this.isFirstRender=!1)}}il.defaultWindow=mF,il.defaultFetch=wF;var{defaultFetch:I8}=il,Q8=typeof DOMParser<"u"?DOMParser:null;class df{constructor(){var{fetch:e=I8,DOMParser:t=Q8}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return pi(function*(){return e.startsWith("<")?t.parseFromString(e):t.load(e)})()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}load(e){var t=this;return pi(function*(){var A=yield t.fetch(e),n=yield A.text();return t.parseFromString(n)})()}}class yF{constructor(e,t){this.type="translate",this.point=null,this.point=vr.parse(t)}apply(e){var{x:t,y:A}=this.point;e.translate(t||0,A||0)}unapply(e){var{x:t,y:A}=this.point;e.translate(-1*t||0,-1*A||0)}applyToPoint(e){var{x:t,y:A}=this.point;e.applyTransform([1,0,0,1,t||0,A||0])}}class BF{constructor(e,t,A){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var n=kA(t);this.angle=new yt(e,"angle",n[0]),this.originX=A[0],this.originY=A[1],this.cx=n[1]||0,this.cy=n[2]||0}apply(e){var{cx:t,cy:A,originX:n,originY:i,angle:s}=this,a=t+n.getPixels("x"),o=A+i.getPixels("y");e.translate(a,o),e.rotate(s.getRadians()),e.translate(-a,-o)}unapply(e){var{cx:t,cy:A,originX:n,originY:i,angle:s}=this,a=t+n.getPixels("x"),o=A+i.getPixels("y");e.translate(a,o),e.rotate(-1*s.getRadians()),e.translate(-a,-o)}applyToPoint(e){var{cx:t,cy:A,angle:n}=this,i=n.getRadians();e.applyTransform([1,0,0,1,t||0,A||0]),e.applyTransform([Math.cos(i),Math.sin(i),-Math.sin(i),Math.cos(i),0,0]),e.applyTransform([1,0,0,1,-t||0,-A||0])}}class bF{constructor(e,t,A){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var n=vr.parseScale(t);(n.x===0||n.y===0)&&(n.x=ja,n.y=ja),this.scale=n,this.originX=A[0],this.originY=A[1]}apply(e){var{scale:{x:t,y:A},originX:n,originY:i}=this,s=n.getPixels("x"),a=i.getPixels("y");e.translate(s,a),e.scale(t,A||t),e.translate(-s,-a)}unapply(e){var{scale:{x:t,y:A},originX:n,originY:i}=this,s=n.getPixels("x"),a=i.getPixels("y");e.translate(s,a),e.scale(1/t,1/A||t),e.translate(-s,-a)}applyToPoint(e){var{x:t,y:A}=this.scale;e.applyTransform([t||0,0,0,A||0,0,0])}}class Y1{constructor(e,t,A){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=kA(t),this.originX=A[0],this.originY=A[1]}apply(e){var{originX:t,originY:A,matrix:n}=this,i=t.getPixels("x"),s=A.getPixels("y");e.translate(i,s),e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),e.translate(-i,-s)}unapply(e){var{originX:t,originY:A,matrix:n}=this,i=n[0],s=n[2],a=n[4],o=n[1],l=n[3],u=n[5],f=0,h=0,c=1,g=1/(i*(l*c-u*h)-s*(o*c-u*f)+a*(o*h-l*f)),p=t.getPixels("x"),y=A.getPixels("y");e.translate(p,y),e.transform(g*(l*c-u*h),g*(u*f-o*c),g*(a*h-s*c),g*(i*c-a*f),g*(s*u-a*l),g*(a*o-i*u)),e.translate(-p,-y)}applyToPoint(e){e.applyTransform(this.matrix)}}class $1 extends Y1{constructor(e,t,A){super(e,t,A),this.type="skew",this.angle=null,this.angle=new yt(e,"angle",t)}}class xF extends $1{constructor(e,t,A){super(e,t,A),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class CF extends $1{constructor(e,t,A){super(e,t,A),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function N8(r){return ka(r).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function O8(r){var[e,t]=r.split("(");return[e.trim(),t.trim().replace(")","")]}class ra{constructor(e,t,A){this.document=e,this.transforms=[];var n=N8(t);n.forEach(i=>{if(i!=="none"){var[s,a]=O8(i),o=ra.transformTypes[s];typeof o<"u"&&this.transforms.push(new o(this.document,a,A))}})}static fromElement(e,t){var A=t.getStyle("transform",!1,!0),[n,i=n]=t.getStyle("transform-origin",!1,!0).split(),s=[n,i];return A.hasValue()?new ra(e,A.getString(),s):null}apply(e){for(var{transforms:t}=this,A=t.length,n=0;n<A;n++)t[n].apply(e)}unapply(e){for(var{transforms:t}=this,A=t.length,n=A-1;n>=0;n--)t[n].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,A=t.length,n=0;n<A;n++)t[n].applyToPoint(e)}}ra.transformTypes={translate:yF,rotate:BF,scale:bF,matrix:Y1,skewX:xF,skewY:CF};let lr=class Pv{constructor(e,t){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=e,this.node=t,this.captureTextNodes=A,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!t||t.nodeType!==1)){if(Array.from(t.attributes).forEach(a=>{var o=hF(a.nodeName);this.attributes[o]=new yt(e,o,a.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var n=this.getAttribute("style").getString().split(";").map(a=>a.trim());n.forEach(a=>{if(a){var[o,l]=a.split(":").map(u=>u.trim());this.styles[o]=new yt(e,o,l)}})}var{definitions:i}=e,s=this.getAttribute("id");s.hasValue()&&(i[s.getString()]||(i[s.getString()]=this)),Array.from(t.childNodes).forEach(a=>{if(a.nodeType===1)this.addChild(a);else if(A&&(a.nodeType===3||a.nodeType===4)){var o=e.createTextNode(a);o.getText().length>0&&this.addChild(o)}})}}getAttribute(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,A=this.attributes[e];if(!A&&t){var n=new yt(this.document,e,"");return this.attributes[e]=n,n}return A||yt.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if(e==="href"||e.endsWith(":href"))return this.attributes[e];return yt.empty(this.document)}getStyle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=this.styles[e];if(n)return n;var i=this.getAttribute(e);if(i!=null&&i.hasValue())return this.styles[e]=i,i;if(!A){var{parent:s}=this;if(s){var a=s.getStyle(e);if(a!=null&&a.hasValue())return a}}if(t){var o=new yt(this.document,e,"");return this.styles[e]=o,o}return n||yt.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var A=this.getStyle("filter").getDefinition();A&&(this.applyEffects(e),A.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var t=ra.fromElement(this.document,this);t&&t.apply(e);var A=this.getStyle("clip-path",!1,!0);if(A.hasValue()){var n=A.getDefinition();n&&n.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){var t=e instanceof Pv?e:this.document.createElement(e);t.parent=this,Pv.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t,{node:A}=this;if(typeof A.matches=="function")return A.matches(e);var n=(t=A.getAttribute)===null||t===void 0?void 0:t.call(A,"class");return!n||n===""?!1:n.split(" ").some(i=>".".concat(i)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var A in e)if(!A.startsWith("@")&&this.matchesSelector(A)){var n=e[A],i=t[A];if(n)for(var s in n){var a=this.stylesSpecificity[s];typeof a>"u"&&(a="000"),i>=a&&(this.styles[s]=n[s],this.stylesSpecificity[s]=i)}}}removeStyles(e,t){var A=t.reduce((n,i)=>{var s=e.getStyle(i);if(!s.hasValue())return n;var a=s.getString();return s.setValue(""),[...n,[i,a]]},[]);return A}restoreStyles(e,t){t.forEach(A=>{var[n,i]=A;e.getStyle(n,!0).setValue(i)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}};lr.ignoreChildTypes=["title"];class EF extends lr{constructor(e,t,A){super(e,t,A)}}function T8(r){var e=r.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function L8(r){return typeof process>"u"?r:r.trim().split(",").map(T8).join(",")}function P8(r){if(!r)return"";var e=r.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function R8(r){if(!r)return"";var e=r.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class BA{constructor(e,t,A,n,i,s){var a=s?typeof s=="string"?BA.parse(s):s:{};this.fontFamily=i||a.fontFamily,this.fontSize=n||a.fontSize,this.fontStyle=e||a.fontStyle,this.fontWeight=A||a.fontWeight,this.fontVariant=t||a.fontVariant}static parse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,A="",n="",i="",s="",a="",o=ka(e).trim().split(" "),l={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return o.forEach(u=>{switch(!0){case(!l.fontStyle&&BA.styles.includes(u)):u!=="inherit"&&(A=u),l.fontStyle=!0;break;case(!l.fontVariant&&BA.variants.includes(u)):u!=="inherit"&&(n=u),l.fontStyle=!0,l.fontVariant=!0;break;case(!l.fontWeight&&BA.weights.includes(u)):u!=="inherit"&&(i=u),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0;break;case!l.fontSize:u!=="inherit"&&([s]=u.split("/")),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0,l.fontSize=!0;break;default:u!=="inherit"&&(a+=u)}}),new BA(A,n,i,s,a,t)}toString(){return[P8(this.fontStyle),this.fontVariant,R8(this.fontWeight),this.fontSize,L8(this.fontFamily)].join(" ").trim()}}BA.styles="normal|italic|oblique|inherit",BA.variants="normal|small-caps|inherit",BA.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class hn{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=e,this.y1=t,this.x2=A,this.y2=n,this.addPoint(e,t),this.addPoint(A,n)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:t,y1:A,x2:n,y2:i}=e;this.addPoint(t,A),this.addPoint(n,i)}}sumCubic(e,t,A,n,i){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*A+3*(1-e)*Math.pow(e,2)*n+Math.pow(e,3)*i}bezierCurveAdd(e,t,A,n,i){var s=6*t-12*A+6*n,a=-3*t+9*A-9*n+3*i,o=3*A-3*t;if(a===0){if(s===0)return;var l=-o/s;0<l&&l<1&&(e?this.addX(this.sumCubic(l,t,A,n,i)):this.addY(this.sumCubic(l,t,A,n,i)));return}var u=Math.pow(s,2)-4*o*a;if(!(u<0)){var f=(-s+Math.sqrt(u))/(2*a);0<f&&f<1&&(e?this.addX(this.sumCubic(f,t,A,n,i)):this.addY(this.sumCubic(f,t,A,n,i)));var h=(-s-Math.sqrt(u))/(2*a);0<h&&h<1&&(e?this.addX(this.sumCubic(h,t,A,n,i)):this.addY(this.sumCubic(h,t,A,n,i)))}}addBezierCurve(e,t,A,n,i,s,a,o){this.addPoint(e,t),this.addPoint(a,o),this.bezierCurveAdd(!0,e,A,i,a),this.bezierCurveAdd(!1,t,n,s,o)}addQuadraticCurve(e,t,A,n,i,s){var a=e+.6666666666666666*(A-e),o=t+2/3*(n-t),l=a+1/3*(i-e),u=o+1/3*(s-t);this.addBezierCurve(e,t,a,l,o,u,i,s)}isPointInBox(e,t){var{x1:A,y1:n,x2:i,y2:s}=this;return A<=e&&e<=i&&n<=t&&t<=s}}class Ft extends $e{constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new vr(0,0),this.control=new vr(0,0),this.current=new vr(0,0),this.points=[],this.angles=[]}isEnd(){var{i:e,commands:t}=this;return e>=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",A=new vr(this.command[e],this.command[t]);return this.makeAbsolute(A)}getAsControlPoint(e,t){var A=this.getPoint(e,t);return this.control=A,A}getAsCurrentPoint(e,t){var A=this.getPoint(e,t);return this.current=A,A}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==$e.CURVE_TO&&e!==$e.SMOOTH_CURVE_TO&&e!==$e.QUAD_TO&&e!==$e.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:A},control:{x:n,y:i}}=this,s=new vr(2*t-n,2*A-i);return s}makeAbsolute(e){if(this.command.relative){var{x:t,y:A}=this.current;e.x+=t,e.y+=A}return e}addMarker(e,t,A){var{points:n,angles:i}=this;A&&i.length>0&&!i[i.length-1]&&(i[i.length-1]=n[n.length-1].angleTo(A)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,A=0;A<t;A++)if(!e[A]){for(var n=A+1;n<t;n++)if(e[n]){e[A]=e[n];break}}return e}}class Aa extends lr{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var e=1,t=this;t;){var A=t.getStyle("opacity",!1,!0);A.hasValue(!0)&&(e*=A.getNumber()),t=t.parent}return e}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!t){var A=this.getStyle("fill"),n=this.getStyle("fill-opacity"),i=this.getStyle("stroke"),s=this.getStyle("stroke-opacity");if(A.isUrlDefinition()){var a=A.getFillStyleDefinition(this,n);a&&(e.fillStyle=a)}else if(A.hasValue()){A.getString()==="currentColor"&&A.setValue(this.getStyle("color").getColor());var o=A.getColor();o!=="inherit"&&(e.fillStyle=o==="none"?"rgba(0,0,0,0)":o)}if(n.hasValue()){var l=new yt(this.document,"fill",e.fillStyle).addOpacity(n).getColor();e.fillStyle=l}if(i.isUrlDefinition()){var u=i.getFillStyleDefinition(this,s);u&&(e.strokeStyle=u)}else if(i.hasValue()){i.getString()==="currentColor"&&i.setValue(this.getStyle("color").getColor());var f=i.getString();f!=="inherit"&&(e.strokeStyle=f==="none"?"rgba(0,0,0,0)":f)}if(s.hasValue()){var h=new yt(this.document,"stroke",e.strokeStyle).addOpacity(s).getString();e.strokeStyle=h}var c=this.getStyle("stroke-width");if(c.hasValue()){var g=c.getPixels();e.lineWidth=g||ja}var p=this.getStyle("stroke-linecap"),y=this.getStyle("stroke-linejoin"),w=this.getStyle("stroke-miterlimit"),B=this.getStyle("stroke-dasharray"),x=this.getStyle("stroke-dashoffset");if(p.hasValue()&&(e.lineCap=p.getString()),y.hasValue()&&(e.lineJoin=y.getString()),w.hasValue()&&(e.miterLimit=w.getNumber()),B.hasValue()&&B.getString()!=="none"){var E=kA(B.getString());typeof e.setLineDash<"u"?e.setLineDash(E):typeof e.webkitLineDash<"u"?e.webkitLineDash=E:typeof e.mozDash<"u"&&!(E.length===1&&E[0]===0)&&(e.mozDash=E);var Q=x.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=Q:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=Q:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=Q)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){var L=this.getStyle("font"),S=this.getStyle("font-style"),T=this.getStyle("font-variant"),_=this.getStyle("font-weight"),D=this.getStyle("font-size"),U=this.getStyle("font-family"),O=new BA(S.getString(),T.getString(),_.getString(),D.hasValue()?"".concat(D.getPixels(!0),"px"):"",U.getString(),BA.parse(L.getString(),e.font));S.setValue(O.fontStyle),T.setValue(O.fontVariant),_.setValue(O.fontWeight),D.setValue(O.fontSize),U.setValue(O.fontFamily),e.font=O.toString(),D.isPixels()&&(this.document.emSize=D.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class Vt extends Aa{constructor(e,t,A){super(e,t,A),this.type="path",this.pathParser=null,this.pathParser=new Ft(this.getAttribute("d").getString())}path(e){var{pathParser:t}=this,A=new hn;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case Ft.MOVE_TO:this.pathM(e,A);break;case Ft.LINE_TO:this.pathL(e,A);break;case Ft.HORIZ_LINE_TO:this.pathH(e,A);break;case Ft.VERT_LINE_TO:this.pathV(e,A);break;case Ft.CURVE_TO:this.pathC(e,A);break;case Ft.SMOOTH_CURVE_TO:this.pathS(e,A);break;case Ft.QUAD_TO:this.pathQ(e,A);break;case Ft.SMOOTH_QUAD_TO:this.pathT(e,A);break;case Ft.ARC:this.pathA(e,A);break;case Ft.CLOSE_PATH:this.pathZ(e,A);break}return A}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),A=e.getMarkerAngles(),n=t.map((i,s)=>[i,A[s]]);return n}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var A=this.getMarkers();if(A){var n=A.length-1,i=this.getStyle("marker-start"),s=this.getStyle("marker-mid"),a=this.getStyle("marker-end");if(i.isUrlDefinition()){var o=i.getDefinition(),[l,u]=A[0];o.render(e,l,u)}if(s.isUrlDefinition())for(var f=s.getDefinition(),h=1;h<n;h++){var[c,g]=A[h];f.render(e,c,g)}if(a.isUrlDefinition()){var p=a.getDefinition(),[y,w]=A[n];p.render(e,y,w)}}}static pathM(e){var t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){var{pathParser:A}=this,{point:n}=Vt.pathM(A),{x:i,y:s}=n;A.addMarker(n),t.addPoint(i,s),e&&e.moveTo(i,s)}static pathL(e){var{current:t}=e,A=e.getAsCurrentPoint();return{current:t,point:A}}pathL(e,t){var{pathParser:A}=this,{current:n,point:i}=Vt.pathL(A),{x:s,y:a}=i;A.addMarker(i,n),t.addPoint(s,a),e&&e.lineTo(s,a)}static pathH(e){var{current:t,command:A}=e,n=new vr((A.relative?t.x:0)+A.x,t.y);return e.current=n,{current:t,point:n}}pathH(e,t){var{pathParser:A}=this,{current:n,point:i}=Vt.pathH(A),{x:s,y:a}=i;A.addMarker(i,n),t.addPoint(s,a),e&&e.lineTo(s,a)}static pathV(e){var{current:t,command:A}=e,n=new vr(t.x,(A.relative?t.y:0)+A.y);return e.current=n,{current:t,point:n}}pathV(e,t){var{pathParser:A}=this,{current:n,point:i}=Vt.pathV(A),{x:s,y:a}=i;A.addMarker(i,n),t.addPoint(s,a),e&&e.lineTo(s,a)}static pathC(e){var{current:t}=e,A=e.getPoint("x1","y1"),n=e.getAsControlPoint("x2","y2"),i=e.getAsCurrentPoint();return{current:t,point:A,controlPoint:n,currentPoint:i}}pathC(e,t){var{pathParser:A}=this,{current:n,point:i,controlPoint:s,currentPoint:a}=Vt.pathC(A);A.addMarker(a,s,i),t.addBezierCurve(n.x,n.y,i.x,i.y,s.x,s.y,a.x,a.y),e&&e.bezierCurveTo(i.x,i.y,s.x,s.y,a.x,a.y)}static pathS(e){var{current:t}=e,A=e.getReflectedControlPoint(),n=e.getAsControlPoint("x2","y2"),i=e.getAsCurrentPoint();return{current:t,point:A,controlPoint:n,currentPoint:i}}pathS(e,t){var{pathParser:A}=this,{current:n,point:i,controlPoint:s,currentPoint:a}=Vt.pathS(A);A.addMarker(a,s,i),t.addBezierCurve(n.x,n.y,i.x,i.y,s.x,s.y,a.x,a.y),e&&e.bezierCurveTo(i.x,i.y,s.x,s.y,a.x,a.y)}static pathQ(e){var{current:t}=e,A=e.getAsControlPoint("x1","y1"),n=e.getAsCurrentPoint();return{current:t,controlPoint:A,currentPoint:n}}pathQ(e,t){var{pathParser:A}=this,{current:n,controlPoint:i,currentPoint:s}=Vt.pathQ(A);A.addMarker(s,i,i),t.addQuadraticCurve(n.x,n.y,i.x,i.y,s.x,s.y),e&&e.quadraticCurveTo(i.x,i.y,s.x,s.y)}static pathT(e){var{current:t}=e,A=e.getReflectedControlPoint();e.control=A;var n=e.getAsCurrentPoint();return{current:t,controlPoint:A,currentPoint:n}}pathT(e,t){var{pathParser:A}=this,{current:n,controlPoint:i,currentPoint:s}=Vt.pathT(A);A.addMarker(s,i,i),t.addQuadraticCurve(n.x,n.y,i.x,i.y,s.x,s.y),e&&e.quadraticCurveTo(i.x,i.y,s.x,s.y)}static pathA(e){var{current:t,command:A}=e,{rX:n,rY:i,xRot:s,lArcFlag:a,sweepFlag:o}=A,l=s*(Math.PI/180),u=e.getAsCurrentPoint(),f=new vr(Math.cos(l)*(t.x-u.x)/2+Math.sin(l)*(t.y-u.y)/2,-Math.sin(l)*(t.x-u.x)/2+Math.cos(l)*(t.y-u.y)/2),h=Math.pow(f.x,2)/Math.pow(n,2)+Math.pow(f.y,2)/Math.pow(i,2);h>1&&(n*=Math.sqrt(h),i*=Math.sqrt(h));var c=(a===o?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(i,2)-Math.pow(n,2)*Math.pow(f.y,2)-Math.pow(i,2)*Math.pow(f.x,2))/(Math.pow(n,2)*Math.pow(f.y,2)+Math.pow(i,2)*Math.pow(f.x,2)));isNaN(c)&&(c=0);var g=new vr(c*n*f.y/i,c*-i*f.x/n),p=new vr((t.x+u.x)/2+Math.cos(l)*g.x-Math.sin(l)*g.y,(t.y+u.y)/2+Math.sin(l)*g.x+Math.cos(l)*g.y),y=j1([1,0],[(f.x-g.x)/n,(f.y-g.y)/i]),w=[(f.x-g.x)/n,(f.y-g.y)/i],B=[(-f.x-g.x)/n,(-f.y-g.y)/i],x=j1(w,B);return hf(w,B)<=-1&&(x=Math.PI),hf(w,B)>=1&&(x=0),{currentPoint:u,rX:n,rY:i,sweepFlag:o,xAxisRotation:l,centp:p,a1:y,ad:x}}pathA(e,t){var{pathParser:A}=this,{currentPoint:n,rX:i,rY:s,sweepFlag:a,xAxisRotation:o,centp:l,a1:u,ad:f}=Vt.pathA(A),h=1-a?1:-1,c=u+h*(f/2),g=new vr(l.x+i*Math.cos(c),l.y+s*Math.sin(c));if(A.addMarkerAngle(g,c-h*Math.PI/2),A.addMarkerAngle(n,c-h*Math.PI),t.addPoint(n.x,n.y),e&&!isNaN(u)&&!isNaN(f)){var p=i>s?i:s,y=i>s?1:i/s,w=i>s?s/i:1;e.translate(l.x,l.y),e.rotate(o),e.scale(y,w),e.arc(0,0,p,u,u+f,!!(1-a)),e.scale(1/y,1/w),e.rotate(-o),e.translate(-l.x,-l.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){Vt.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class J1 extends Vt{constructor(e,t,A){super(e,t,A),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class mi extends Aa{constructor(e,t,A){super(e,t,new.target===mi?!0:A),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,t);var A=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();A&&(e.textBaseline=A)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach((A,n)=>{var i=this.getChildBoundingBox(e,this,this,n);t?t.addBoundingBox(i):t=i}),t}getFontSize(){var{document:e,parent:t}=this,A=BA.parse(e.ctx.font).fontSize,n=t.getStyle("font-size").getNumber(A);return n}getTElementBoundingBox(e){var t=this.getFontSize();return new hn(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,A){var n=t[A],i=null;if(e.isArabic){var s=t.length,a=t[A-1],o=t[A+1],l="isolated";if((A===0||a===" ")&&A<s-1&&o!==" "&&(l="terminal"),A>0&&a!==" "&&A<s-1&&o!==" "&&(l="medial"),A>0&&a!==" "&&(A===s-1||o===" ")&&(l="initial"),typeof e.glyphs[n]<"u"){var u=e.glyphs[n];i=u instanceof J1?u:u[l]}}else i=e.glyphs[n];return i||(i=e.missingGlyph),i}getText(){return""}getTextFromNode(e){var t=e||this.node,A=Array.from(t.parentNode.childNodes),n=A.indexOf(t),i=A.length-1,s=ka(t.textContent||"");return n===0&&(s=cF(s)),n===i&&(s=fF(s)),s}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((A,n)=>{this.renderChild(e,this,this,n)});var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){var{document:t,parent:A}=this,n=this.getText(),i=A.getStyle("font-family").getDefinition();if(i){for(var{unitsPerEm:s}=i.fontFace,a=BA.parse(t.ctx.font),o=A.getStyle("font-size").getNumber(a.fontSize),l=A.getStyle("font-style").getString(a.fontStyle),u=o/s,f=i.isRTL?n.split("").reverse().join(""):n,h=kA(A.getAttribute("dx").getString()),c=f.length,g=0;g<c;g++){var p=this.getGlyph(i,f,g);e.translate(this.x,this.y),e.scale(u,-u);var y=e.lineWidth;e.lineWidth=e.lineWidth*s/o,l==="italic"&&e.transform(1,0,.4,1,0,0),p.render(e),l==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=y,e.scale(1/u,-1/u),e.translate(-this.x,-this.y),this.x+=o*(p.horizAdvX||i.horizAdvX)/s,typeof h[g]<"u"&&!isNaN(h[g])&&(this.x+=h[g])}return}var{x:w,y:B}=this;e.fillStyle&&e.fillText(n,w,B),e.strokeStyle&&e.strokeText(n,w,B)}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),A=!1,n=0;t==="start"&&!A||t==="end"&&A?n=e.x-this.minX:t==="end"&&!A||t==="start"&&A?n=e.x-this.maxX:n=e.x-(this.minX+this.maxX)/2;for(var i=this.textChunkStart;i<this.leafTexts.length;i++)this.leafTexts[i].x+=n;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(e){this.children.forEach((t,A)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,A)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,A,n){var i=A.children[n];i.children.length>0?i.children.forEach((s,a)=>{t.adjustChildCoordinatesRecursiveCore(e,t,i,a)}):this.adjustChildCoordinates(e,t,A,n)}adjustChildCoordinates(e,t,A,n){var i=A.children[n];if(typeof i.measureText!="function")return i;e.save(),i.setContext(e,!0);var s=i.getAttribute("x"),a=i.getAttribute("y"),o=i.getAttribute("dx"),l=i.getAttribute("dy"),u=i.getStyle("font-family").getDefinition(),f=!!u&&u.isRTL;n===0&&(s.hasValue()||s.setValue(i.getInheritedAttribute("x")),a.hasValue()||a.setValue(i.getInheritedAttribute("y")),o.hasValue()||o.setValue(i.getInheritedAttribute("dx")),l.hasValue()||l.setValue(i.getInheritedAttribute("dy")));var h=i.measureText(e);return f&&(t.x-=h),s.hasValue()?(t.applyAnchoring(),i.x=s.getPixels("x"),o.hasValue()&&(i.x+=o.getPixels("x"))):(o.hasValue()&&(t.x+=o.getPixels("x")),i.x=t.x),t.x=i.x,f||(t.x+=h),a.hasValue()?(i.y=a.getPixels("y"),l.hasValue()&&(i.y+=l.getPixels("y"))):(l.hasValue()&&(t.y+=l.getPixels("y")),i.y=t.y),t.y=i.y,t.leafTexts.push(i),t.minX=Math.min(t.minX,i.x,i.x+h),t.maxX=Math.max(t.maxX,i.x,i.x+h),i.clearContext(e),e.restore(),i}getChildBoundingBox(e,t,A,n){var i=A.children[n];if(typeof i.getBoundingBox!="function")return null;var s=i.getBoundingBox(e);return s?(i.children.forEach((a,o)=>{var l=t.getChildBoundingBox(e,t,i,o);s.addBoundingBox(l)}),s):null}renderChild(e,t,A,n){var i=A.children[n];i.render(e),i.children.forEach((s,a)=>{t.renderChild(e,t,i,a)})}measureText(e){var{measureCache:t}=this;if(~t)return t;var A=this.getText(),n=this.measureTargetText(e,A);return this.measureCache=n,n}measureTargetText(e,t){if(!t.length)return 0;var{parent:A}=this,n=A.getStyle("font-family").getDefinition();if(n){for(var i=this.getFontSize(),s=n.isRTL?t.split("").reverse().join(""):t,a=kA(A.getAttribute("dx").getString()),o=s.length,l=0,u=0;u<o;u++){var f=this.getGlyph(n,s,u);l+=(f.horizAdvX||n.horizAdvX)*i/n.fontFace.unitsPerEm,typeof a[u]<"u"&&!isNaN(a[u])&&(l+=a[u])}return l}if(!e.measureText)return t.length*10;e.save(),this.setContext(e,!0);var{width:h}=e.measureText(t);return this.clearContext(e),e.restore(),h}getInheritedAttribute(e){for(var t=this;t instanceof mi&&t.isFirstChild();){var A=t.parent.getAttribute(e);if(A.hasValue(!0))return A.getValue("0");t=t.parent}return null}}class al extends mi{constructor(e,t,A){super(e,t,new.target===al?!0:A),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class M8 extends al{constructor(){super(...arguments),this.type="textNode"}}let Ds=class extends Aa{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var t,{document:A}=this,{screen:n,window:i}=A,s=e.canvas;if(n.setDefaults(e),s.style&&typeof e.font<"u"&&i&&typeof i.getComputedStyle<"u"){e.font=i.getComputedStyle(s).getPropertyValue("font");var a=new yt(A,"fontSize",BA.parse(e.font).fontSize);a.hasValue()&&(A.rootEmSize=a.getPixels("y"),A.emSize=A.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:o,height:l}=n.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var u=this.getAttribute("refX"),f=this.getAttribute("refY"),h=this.getAttribute("viewBox"),c=h.hasValue()?kA(h.getString()):null,g=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",p=0,y=0,w=0,B=0;c&&(p=c[0],y=c[1]),this.root||(o=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y"),this.type==="marker"&&(w=p,B=y,p=0,y=0)),n.viewPort.setCurrent(o,l),this.node&&(!this.parent||((t=this.node.parentNode)===null||t===void 0?void 0:t.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),c&&(o=c[2],l=c[3]),A.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:n.viewPort.width,desiredWidth:o,height:n.viewPort.height,desiredHeight:l,minX:p,minY:y,refX:u.getValue(),refY:f.getValue(),clip:g,clipX:w,clipY:B}),c&&(n.viewPort.removeCurrent(),n.viewPort.setCurrent(o,l))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=this.getAttribute("width",!0),i=this.getAttribute("height",!0),s=this.getAttribute("viewBox"),a=this.getAttribute("style"),o=n.getNumber(0),l=i.getNumber(0);if(A)if(typeof A=="string")this.getAttribute("preserveAspectRatio",!0).setValue(A);else{var u=this.getAttribute("preserveAspectRatio");u.hasValue()&&u.setValue(u.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(n.setValue(e),i.setValue(t),s.hasValue()||s.setValue("0 0 ".concat(o||e," ").concat(l||t)),a.hasValue()){var f=this.getStyle("width"),h=this.getStyle("height");f.hasValue()&&f.setValue("".concat(e,"px")),h.hasValue()&&h.setValue("".concat(t,"px"))}}};class Z1 extends Vt{constructor(){super(...arguments),this.type="rect"}path(e){var t=this.getAttribute("x").getPixels("x"),A=this.getAttribute("y").getPixels("y"),n=this.getStyle("width",!1,!0).getPixels("x"),i=this.getStyle("height",!1,!0).getPixels("y"),s=this.getAttribute("rx"),a=this.getAttribute("ry"),o=s.getPixels("x"),l=a.getPixels("y");if(s.hasValue()&&!a.hasValue()&&(l=o),a.hasValue()&&!s.hasValue()&&(o=l),o=Math.min(o,n/2),l=Math.min(l,i/2),e){var u=4*((Math.sqrt(2)-1)/3);e.beginPath(),i>0&&n>0&&(e.moveTo(t+o,A),e.lineTo(t+n-o,A),e.bezierCurveTo(t+n-o+u*o,A,t+n,A+l-u*l,t+n,A+l),e.lineTo(t+n,A+i-l),e.bezierCurveTo(t+n,A+i-l+u*l,t+n-o+u*o,A+i,t+n-o,A+i),e.lineTo(t+o,A+i),e.bezierCurveTo(t+o-u*o,A+i,t,A+i-l+u*l,t,A+i-l),e.lineTo(t,A+l),e.bezierCurveTo(t,A+l-u*l,t+o-u*o,A,t+o,A),e.closePath())}return new hn(t,A,t+n,A+i)}getMarkers(){return null}}class FF extends Vt{constructor(){super(...arguments),this.type="circle"}path(e){var t=this.getAttribute("cx").getPixels("x"),A=this.getAttribute("cy").getPixels("y"),n=this.getAttribute("r").getPixels();return e&&n>0&&(e.beginPath(),e.arc(t,A,n,0,Math.PI*2,!1),e.closePath()),new hn(t-n,A-n,t+n,A+n)}getMarkers(){return null}}class SF extends Vt{constructor(){super(...arguments),this.type="ellipse"}path(e){var t=4*((Math.sqrt(2)-1)/3),A=this.getAttribute("rx").getPixels("x"),n=this.getAttribute("ry").getPixels("y"),i=this.getAttribute("cx").getPixels("x"),s=this.getAttribute("cy").getPixels("y");return e&&A>0&&n>0&&(e.beginPath(),e.moveTo(i+A,s),e.bezierCurveTo(i+A,s+t*n,i+t*A,s+n,i,s+n),e.bezierCurveTo(i-t*A,s+n,i-A,s+t*n,i-A,s),e.bezierCurveTo(i-A,s-t*n,i-t*A,s-n,i,s-n),e.bezierCurveTo(i+t*A,s-n,i+A,s-t*n,i+A,s),e.closePath()),new hn(i-A,s-n,i+A,s+n)}getMarkers(){return null}}class UF extends Vt{constructor(){super(...arguments),this.type="line"}getPoints(){return[new vr(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new vr(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:t,y:A},{x:n,y:i}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,A),e.lineTo(n,i)),new hn(t,A,n,i)}getMarkers(){var[e,t]=this.getPoints(),A=e.angleTo(t);return[[e,A],[t,A]]}}class ev extends Vt{constructor(e,t,A){super(e,t,A),this.type="polyline",this.points=[],this.points=vr.parsePath(this.getAttribute("points").getString())}path(e){var{points:t}=this,[{x:A,y:n}]=t,i=new hn(A,n);return e&&(e.beginPath(),e.moveTo(A,n)),t.forEach(s=>{var{x:a,y:o}=s;i.addPoint(a,o),e&&e.lineTo(a,o)}),i}getMarkers(){var{points:e}=this,t=e.length-1,A=[];return e.forEach((n,i)=>{i!==t&&A.push([n,n.angleTo(e[i+1])])}),A.length>0&&A.push([e[e.length-1],A[A.length-1][1]]),A}}class _F extends ev{constructor(){super(...arguments),this.type="polygon"}path(e){var t=super.path(e),[{x:A,y:n}]=this.points;return e&&(e.lineTo(A,n),e.closePath()),t}}class IF extends lr{constructor(){super(...arguments),this.type="pattern"}createPattern(e,t,A){var n=this.getStyle("width").getPixels("x",!0),i=this.getStyle("height").getPixels("y",!0),s=new Ds(this.document,null);s.attributes.viewBox=new yt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),s.attributes.width=new yt(this.document,"width","".concat(n,"px")),s.attributes.height=new yt(this.document,"height","".concat(i,"px")),s.attributes.transform=new yt(this.document,"transform",this.getAttribute("patternTransform").getValue()),s.children=this.children;var a=this.document.createCanvas(n,i),o=a.getContext("2d"),l=this.getAttribute("x"),u=this.getAttribute("y");l.hasValue()&&u.hasValue()&&o.translate(l.getPixels("x",!0),u.getPixels("y",!0)),A.hasValue()?this.styles["fill-opacity"]=A:Reflect.deleteProperty(this.styles,"fill-opacity");for(var f=-1;f<=1;f++)for(var h=-1;h<=1;h++)o.save(),s.attributes.x=new yt(this.document,"x",f*a.width),s.attributes.y=new yt(this.document,"y",h*a.height),s.render(o),o.restore();var c=e.createPattern(a,"repeat");return c}}class QF extends lr{constructor(){super(...arguments),this.type="marker"}render(e,t,A){if(t){var{x:n,y:i}=t,s=this.getAttribute("orient").getString("auto"),a=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(n,i),s==="auto"&&e.rotate(A),a==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();var o=new Ds(this.document,null);o.type=this.type,o.attributes.viewBox=new yt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.refX=new yt(this.document,"refX",this.getAttribute("refX").getValue()),o.attributes.refY=new yt(this.document,"refY",this.getAttribute("refY").getValue()),o.attributes.width=new yt(this.document,"width",this.getAttribute("markerWidth").getValue()),o.attributes.height=new yt(this.document,"height",this.getAttribute("markerHeight").getValue()),o.attributes.overflow=new yt(this.document,"overflow",this.getAttribute("overflow").getValue()),o.attributes.fill=new yt(this.document,"fill",this.getAttribute("fill").getColor("black")),o.attributes.stroke=new yt(this.document,"stroke",this.getAttribute("stroke").getValue("none")),o.children=this.children,o.render(e),e.restore(),a==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),s==="auto"&&e.rotate(-A),e.translate(-n,-i)}}}class NF extends lr{constructor(){super(...arguments),this.type="defs"}render(){}}class gf extends Aa{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var t=new hn;return this.children.forEach(A=>{t.addBoundingBox(A.getBoundingBox(e))}),t}}class tv extends lr{constructor(e,t,A){super(e,t,A),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:n,children:i}=this;i.forEach(s=>{s.type==="stop"&&n.push(s)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,A){var n=this;this.getHrefAttribute().hasValue()&&(n=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(n));var{stops:i}=n,s=this.getGradient(e,t);if(!s)return this.addParentOpacity(A,i[i.length-1].color);if(i.forEach(y=>{s.addColorStop(y.offset,this.addParentOpacity(A,y.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:a}=this,{MAX_VIRTUAL_PIXELS:o,viewPort:l}=a.screen,[u]=l.viewPorts,f=new Z1(a,null);f.attributes.x=new yt(a,"x",-o/3),f.attributes.y=new yt(a,"y",-o/3),f.attributes.width=new yt(a,"width",o),f.attributes.height=new yt(a,"height",o);var h=new gf(a,null);h.attributes.transform=new yt(a,"transform",this.getAttribute("gradientTransform").getValue()),h.children=[f];var c=new Ds(a,null);c.attributes.x=new yt(a,"x",0),c.attributes.y=new yt(a,"y",0),c.attributes.width=new yt(a,"width",u.width),c.attributes.height=new yt(a,"height",u.height),c.children=[h];var g=a.createCanvas(u.width,u.height),p=g.getContext("2d");return p.fillStyle=s,c.render(p),p.createPattern(g,"no-repeat")}return s}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){if(e.hasValue()){var A=new yt(this.document,"color",t);return A.addOpacity(e).getColor()}return t}}class OF extends tv{constructor(e,t,A){super(e,t,A),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){var A=this.getGradientUnits()==="objectBoundingBox",n=A?t.getBoundingBox(e):null;if(A&&!n)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var i=A?n.x+n.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),s=A?n.y+n.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),a=A?n.x+n.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),o=A?n.y+n.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return i===a&&s===o?null:e.createLinearGradient(i,s,a,o)}}class TF extends tv{constructor(e,t,A){super(e,t,A),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){var A=this.getGradientUnits()==="objectBoundingBox",n=t.getBoundingBox(e);if(A&&!n)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var i=A?n.x+n.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),s=A?n.y+n.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),a=i,o=s;this.getAttribute("fx").hasValue()&&(a=A?n.x+n.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(o=A?n.y+n.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var l=A?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),u=this.getAttribute("fr").getPixels();return e.createRadialGradient(a,o,u,i,s,l)}}class LF extends lr{constructor(e,t,A){super(e,t,A),this.type="stop";var n=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),i=this.getStyle("stop-opacity"),s=this.getStyle("stop-color",!0);s.getString()===""&&s.setValue("#000"),i.hasValue()&&(s=s.addOpacity(i)),this.offset=n,this.color=s.getColor()}}class pf extends lr{constructor(e,t,A){super(e,t,A),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new yt(e,"values",null);var n=this.getAttribute("values");n.hasValue()&&this.values.setValue(n.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:A,to:n}=this.getProgress(),i=A.getNumber()+(n.getNumber()-A.getNumber())*t;return e==="%"&&(i*=100),"".concat(i).concat(e)}update(e){var{parent:t}=this,A=this.getProperty();if(this.initialValue||(this.initialValue=A.getString(),this.initialUnits=A.getUnits()),this.duration>this.maxDuration){var n=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(n==="freeze"&&!this.frozen)this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=A.getString();else if(n==="remove"&&!this.removed)return this.removed=!0,A.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var i=!1;if(this.begin<this.duration){var s=this.calcValue(),a=this.getAttribute("type");if(a.hasValue()){var o=a.getString();s="".concat(o,"(").concat(s,")")}A.setValue(s),i=!0}return i}getProgress(){var{document:e,values:t}=this,A={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(t.hasValue()){var n=A.progress*(t.getValue().length-1),i=Math.floor(n),s=Math.ceil(n);A.from=new yt(e,"from",parseFloat(t.getValue()[i])),A.to=new yt(e,"to",parseFloat(t.getValue()[s])),A.progress=(n-i)/(s-i)}else A.from=this.from,A.to=this.to;return A}}class PF extends pf{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:e,from:t,to:A}=this.getProgress(),n=new P1(t.getColor()),i=new P1(A.getColor());if(n.ok&&i.ok){var s=n.r+(i.r-n.r)*e,a=n.g+(i.g-n.g)*e,o=n.b+(i.b-n.b)*e;return"rgb(".concat(Math.floor(s),", ").concat(Math.floor(a),", ").concat(Math.floor(o),")")}return this.getAttribute("from").getColor()}}class RF extends pf{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:e,from:t,to:A}=this.getProgress(),n=kA(t.getString()),i=kA(A.getString()),s=n.map((a,o)=>{var l=i[o];return a+(l-a)*e}).join(" ");return s}}class MF extends lr{constructor(e,t,A){super(e,t,A),this.type="font",this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:n}=e,{children:i}=this;for(var s of i)switch(s.type){case"font-face":{this.fontFace=s;var a=s.getStyle("font-family");a.hasValue()&&(n[a.getString()]=this);break}case"missing-glyph":this.missingGlyph=s;break;case"glyph":{var o=s;o.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[o.unicode]>"u"&&(this.glyphs[o.unicode]=Object.create(null)),this.glyphs[o.unicode][o.arabicForm]=o):this.glyphs[o.unicode]=o;break}}}render(){}}class DF extends lr{constructor(e,t,A){super(e,t,A),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class kF extends Vt{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class HF extends mi{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}class jF extends mi{constructor(e,t,A){super(e,t,A),this.type="a";var{childNodes:n}=t,i=n[0],s=n.length>0&&Array.from(n).every(a=>a.nodeType===3);this.hasText=s,this.text=s?this.getTextFromNode(i):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:A,y:n}=this,{mouse:i}=t.screen,s=new yt(t,"fontSize",BA.parse(t.ctx.font).fontSize);i.isWorking()&&i.checkBoundingBox(this,new hn(A,n-s.getPixels("y"),A+this.measureText(e),n))}else if(this.children.length>0){var a=new gf(this.document,null);a.children=this.children,a.parent=this,a.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){var e=this.document.ctx;e.canvas.style.cursor="pointer"}}function KF(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(r);e&&(A=A.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,A)}return t}function vf(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?KF(Object(t),!0).forEach(function(A){U1(r,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):KF(Object(t)).forEach(function(A){Object.defineProperty(r,A,Object.getOwnPropertyDescriptor(t,A))})}return r}class qF extends mi{constructor(e,t,A){super(e,t,A),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var n=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(n)}getText(){return this.text}path(e){var{dataArray:t}=this;e&&e.beginPath(),t.forEach(A=>{var{type:n,points:i}=A;switch(n){case Ft.LINE_TO:e&&e.lineTo(i[0],i[1]);break;case Ft.MOVE_TO:e&&e.moveTo(i[0],i[1]);break;case Ft.CURVE_TO:e&&e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case Ft.QUAD_TO:e&&e.quadraticCurveTo(i[0],i[1],i[2],i[3]);break;case Ft.ARC:{var[s,a,o,l,u,f,h,c]=i,g=o>l?o:l,p=o>l?1:o/l,y=o>l?l/o:1;e&&(e.translate(s,a),e.rotate(h),e.scale(p,y),e.arc(0,0,g,u,u+f,!!(1-c)),e.scale(1/p,1/y),e.rotate(-h),e.translate(-s,-a));break}case Ft.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),A=this.getFontSize(),{glyphInfo:n}=this,i=e.fillStyle;t==="underline"&&e.beginPath(),n.forEach((s,a)=>{var{p0:o,p1:l,rotation:u,text:f}=s;e.save(),e.translate(o.x,o.y),e.rotate(u),e.fillStyle&&e.fillText(f,0,0),e.strokeStyle&&e.strokeText(f,0,0),e.restore(),t==="underline"&&(a===0&&e.moveTo(o.x,o.y+A/8),e.lineTo(l.x,l.y+A/5))}),t==="underline"&&(e.lineWidth=A/20,e.strokeStyle=i,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,A,n,i,s,a,o,l){var u=s,f=this.measureText(e,o);o===" "&&t==="justify"&&A<n&&(f+=(n-A)/i),l>-1&&(u+=this.getLetterSpacingAt(l));var h=this.textHeight/20,c=this.getEquidistantPointOnPath(u,h,0),g=this.getEquidistantPointOnPath(u+f,h,0),p={p0:c,p1:g},y=c&&g?Math.atan2(g.y-c.y,g.x-c.x):0;if(a){var w=Math.cos(Math.PI/2+y)*a,B=Math.cos(-y)*a;p.p0=vf(vf({},c),{},{x:c.x+w,y:c.y+B}),p.p1=vf(vf({},g),{},{x:g.x+w,y:g.y+B})}return u+=f,{offset:u,segment:p,rotation:y}}measureText(e,t){var{measuresCache:A}=this,n=t||this.getText();if(A.has(n))return A.get(n);var i=this.measureTargetText(e,n);return A.set(n,i),i}setTextData(e){if(!this.glyphInfo){var t=this.getText(),A=t.split(""),n=t.split(" ").length-1,i=this.parent.getAttribute("dx").split().map(E=>E.getPixels("x")),s=this.parent.getAttribute("dy").getPixels("y"),a=this.parent.getStyle("text-anchor").getString("start"),o=this.getStyle("letter-spacing"),l=this.parent.getStyle("letter-spacing"),u=0;!o.hasValue()||o.getValue()==="inherit"?u=l.getPixels():o.hasValue()&&o.getValue()!=="initial"&&o.getValue()!=="unset"&&(u=o.getPixels());var f=[],h=t.length;this.letterSpacingCache=f;for(var c=0;c<h;c++)f.push(typeof i[c]<"u"?i[c]:u);var g=f.reduce((E,Q,L)=>L===0?0:E+Q||0,0),p=this.measureText(e),y=Math.max(p+g,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];var w=this.getPathLength(),B=this.getStyle("startOffset").getNumber(0)*w,x=0;(a==="middle"||a==="center")&&(x=-y/2),(a==="end"||a==="right")&&(x=-y),x+=B,A.forEach((E,Q)=>{var{offset:L,segment:S,rotation:T}=this.findSegmentToFitChar(e,a,y,w,n,x,s,E,Q);x=L,!(!S.p0||!S.p1)&&this.glyphInfo.push({text:A[Q],p0:S.p0,p1:S.p1,rotation:T})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:A}=e;for(A.reset();!A.isEnd();){var{current:n}=A,i=n?n.x:0,s=n?n.y:0,a=A.next(),o=a.type,l=[];switch(a.type){case Ft.MOVE_TO:this.pathM(A,l);break;case Ft.LINE_TO:o=this.pathL(A,l);break;case Ft.HORIZ_LINE_TO:o=this.pathH(A,l);break;case Ft.VERT_LINE_TO:o=this.pathV(A,l);break;case Ft.CURVE_TO:this.pathC(A,l);break;case Ft.SMOOTH_CURVE_TO:o=this.pathS(A,l);break;case Ft.QUAD_TO:this.pathQ(A,l);break;case Ft.SMOOTH_QUAD_TO:o=this.pathT(A,l);break;case Ft.ARC:l=this.pathA(A);break;case Ft.CLOSE_PATH:Vt.pathZ(A);break}a.type!==Ft.CLOSE_PATH?t.push({type:o,points:l,start:{x:i,y:s},pathLength:this.calcLength(i,s,o,l)}):t.push({type:Ft.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){var{x:A,y:n}=Vt.pathM(e).point;t.push(A,n)}pathL(e,t){var{x:A,y:n}=Vt.pathL(e).point;return t.push(A,n),Ft.LINE_TO}pathH(e,t){var{x:A,y:n}=Vt.pathH(e).point;return t.push(A,n),Ft.LINE_TO}pathV(e,t){var{x:A,y:n}=Vt.pathV(e).point;return t.push(A,n),Ft.LINE_TO}pathC(e,t){var{point:A,controlPoint:n,currentPoint:i}=Vt.pathC(e);t.push(A.x,A.y,n.x,n.y,i.x,i.y)}pathS(e,t){var{point:A,controlPoint:n,currentPoint:i}=Vt.pathS(e);return t.push(A.x,A.y,n.x,n.y,i.x,i.y),Ft.CURVE_TO}pathQ(e,t){var{controlPoint:A,currentPoint:n}=Vt.pathQ(e);t.push(A.x,A.y,n.x,n.y)}pathT(e,t){var{controlPoint:A,currentPoint:n}=Vt.pathT(e);return t.push(A.x,A.y,n.x,n.y),Ft.QUAD_TO}pathA(e){var{rX:t,rY:A,sweepFlag:n,xAxisRotation:i,centp:s,a1:a,ad:o}=Vt.pathA(e);return n===0&&o>0&&(o-=2*Math.PI),n===1&&o<0&&(o+=2*Math.PI),[s.x,s.y,t,A,a,o,i,n]}calcLength(e,t,A,n){var i=0,s=null,a=null,o=0;switch(A){case Ft.LINE_TO:return this.getLineLength(e,t,n[0],n[1]);case Ft.CURVE_TO:for(i=0,s=this.getPointOnCubicBezier(0,e,t,n[0],n[1],n[2],n[3],n[4],n[5]),o=.01;o<=1;o+=.01)a=this.getPointOnCubicBezier(o,e,t,n[0],n[1],n[2],n[3],n[4],n[5]),i+=this.getLineLength(s.x,s.y,a.x,a.y),s=a;return i;case Ft.QUAD_TO:for(i=0,s=this.getPointOnQuadraticBezier(0,e,t,n[0],n[1],n[2],n[3]),o=.01;o<=1;o+=.01)a=this.getPointOnQuadraticBezier(o,e,t,n[0],n[1],n[2],n[3]),i+=this.getLineLength(s.x,s.y,a.x,a.y),s=a;return i;case Ft.ARC:{i=0;var l=n[4],u=n[5],f=n[4]+u,h=Math.PI/180;if(Math.abs(l-f)<h&&(h=Math.abs(l-f)),s=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],l,0),u<0)for(o=l-h;o>f;o-=h)a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],o,0),i+=this.getLineLength(s.x,s.y,a.x,a.y),s=a;else for(o=l+h;o<f;o+=h)a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],o,0),i+=this.getLineLength(s.x,s.y,a.x,a.y),s=a;return a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],f,0),i+=this.getLineLength(s.x,s.y,a.x,a.y),i}}return 0}getPointOnLine(e,t,A,n,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:t,a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:A,o=(i-A)/(n-t+ja),l=Math.sqrt(e*e/(1+o*o));n<t&&(l*=-1);var u=o*l,f=null;if(n===t)f={x:s,y:a+u};else if((a-A)/(s-t+ja)===o)f={x:s+l,y:a+u};else{var h=0,c=0,g=this.getLineLength(t,A,n,i);if(g<ja)return null;var p=(s-t)*(n-t)+(a-A)*(i-A);p/=g*g,h=t+p*(n-t),c=A+p*(i-A);var y=this.getLineLength(s,a,h,c),w=Math.sqrt(e*e-y*y);l=Math.sqrt(w*w/(1+o*o)),n<t&&(l*=-1),u=o*l,f={x:h+l,y:c+u}}return f}getPointOnPath(e){var t=this.getPathLength(),A=0,n=null;if(e<-5e-5||e-5e-5>t)return null;var{dataArray:i}=this;for(var s of i){if(s&&(s.pathLength<5e-5||A+s.pathLength+5e-5<e)){A+=s.pathLength;continue}var a=e-A,o=0;switch(s.type){case Ft.LINE_TO:n=this.getPointOnLine(a,s.start.x,s.start.y,s.points[0],s.points[1],s.start.x,s.start.y);break;case Ft.ARC:{var l=s.points[4],u=s.points[5],f=s.points[4]+u;if(o=l+a/s.pathLength*u,u<0&&o<f||u>=0&&o>f)break;n=this.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],o,s.points[6]);break}case Ft.CURVE_TO:o=a/s.pathLength,o>1&&(o=1),n=this.getPointOnCubicBezier(o,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3],s.points[4],s.points[5]);break;case Ft.QUAD_TO:o=a/s.pathLength,o>1&&(o=1),n=this.getPointOnQuadraticBezier(o,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3]);break}if(n)return n;break}return null}getLineLength(e,t,A,n){return Math.sqrt((A-e)*(A-e)+(n-t)*(n-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,A,n,i,s,a,o,l){var u=o*K1(e)+s*q1(e)+n*V1(e)+t*z1(e),f=l*K1(e)+a*q1(e)+i*V1(e)+A*z1(e);return{x:u,y:f}}getPointOnQuadraticBezier(e,t,A,n,i,s,a){var o=s*G1(e)+n*W1(e)+t*X1(e),l=a*G1(e)+i*W1(e)+A*X1(e);return{x:o,y:l}}getPointOnEllipticalArc(e,t,A,n,i,s){var a=Math.cos(s),o=Math.sin(s),l={x:A*Math.cos(i),y:n*Math.sin(i)};return{x:e+(l.x*a-l.y*o),y:t+(l.x*o+l.y*a)}}buildEquidistantCache(e,t){var A=this.getPathLength(),n=t||.25,i=e||A/100;if(!this.equidistantCache||this.equidistantCache.step!==i||this.equidistantCache.precision!==n){this.equidistantCache={step:i,precision:n,points:[]};for(var s=0,a=0;a<=A;a+=n){var o=this.getPointOnPath(a),l=this.getPointOnPath(a+n);!o||!l||(s+=this.getLineLength(o.x,o.y,l.x,l.y),s>=i&&(this.equidistantCache.points.push({x:o.x,y:o.y,distance:a}),s-=i))}}}getEquidistantPointOnPath(e,t,A){if(this.buildEquidistantCache(t,A),e<0||e-this.getPathLength()>5e-5)return null;var n=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[n]||null}}var D8=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class VF extends Aa{constructor(e,t,A){super(e,t,A),this.type="image",this.loaded=!1;var n=this.getHrefAttribute().getString();if(n){var i=n.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(n);e.images.push(this),i?this.loadSvg(n):this.loadImage(n),this.isSvg=i}}loadImage(e){var t=this;return pi(function*(){try{var A=yield t.document.createImage(e);t.image=A}catch(n){console.error('Error while loading image "'.concat(e,'":'),n)}t.loaded=!0})()}loadSvg(e){var t=this;return pi(function*(){var A=D8.exec(e);if(A){var n=A[5];A[4]==="base64"?t.image=atob(n):t.image=decodeURIComponent(n)}else try{var i=yield t.document.fetch(e),s=yield i.text();t.image=s}catch(a){console.error('Error while loading image "'.concat(e,'":'),a)}t.loaded=!0})()}renderChildren(e){var{document:t,image:A,loaded:n}=this,i=this.getAttribute("x").getPixels("x"),s=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(!(!n||!A||!a||!o)){if(e.save(),e.translate(i,s),this.isSvg){var l=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:a,scaleHeight:o});l.document.documentElement.parent=this,l.render()}else{var u=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:a,desiredWidth:u.width,height:o,desiredHeight:u.height}),this.loaded&&(typeof u.complete>"u"||u.complete)&&e.drawImage(u,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),A=this.getStyle("width").getPixels("x"),n=this.getStyle("height").getPixels("y");return new hn(e,t,e+A,t+n)}}class zF extends Aa{constructor(){super(...arguments),this.type="symbol"}render(e){}}class GF{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var A=this;return pi(function*(){try{var{document:n}=A,i=yield n.canvg.parser.load(t),s=i.getElementsByTagName("font");Array.from(s).forEach(a=>{var o=n.createElement(a);n.definitions[e]=o})}catch(a){console.error('Error while loading font "'.concat(t,'":'),a)}A.loaded=!0})()}}class rv extends lr{constructor(e,t,A){super(e,t,A),this.type="style";var n=ka(Array.from(t.childNodes).map(s=>s.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),i=n.split("}");i.forEach(s=>{var a=s.trim();if(a){var o=a.split("{"),l=o[0].split(","),u=o[1].split(";");l.forEach(f=>{var h=f.trim();if(h){var c=e.styles[h]||{};if(u.forEach(y=>{var w=y.indexOf(":"),B=y.substr(0,w).trim(),x=y.substr(w+1,y.length-w).trim();B&&x&&(c[B]=new yt(e,B,x))}),e.styles[h]=c,e.stylesSpecificity[h]=gF(h),h==="@font-face"){var g=c["font-family"].getString().replace(/"|'/g,""),p=c.src.getString().split(",");p.forEach(y=>{if(y.indexOf('format("svg")')>0){var w=k1(y);w&&new GF(e).load(g,w)}})}}})}})}}rv.parseExternalUrl=k1;class WF extends Aa{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var t=this.getAttribute("x"),A=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),A.hasValue()&&e.translate(0,A.getPixels("y"))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:A}=this;if(A){var n=A;if(A.type==="symbol"&&(n=new Ds(t,null),n.attributes.viewBox=new yt(t,"viewBox",A.getAttribute("viewBox").getString()),n.attributes.preserveAspectRatio=new yt(t,"preserveAspectRatio",A.getAttribute("preserveAspectRatio").getString()),n.attributes.overflow=new yt(t,"overflow",A.getAttribute("overflow").getString()),n.children=A.children,A.styles.opacity=new yt(t,"opacity",this.calculateOpacity())),n.type==="svg"){var i=this.getStyle("width",!1,!0),s=this.getStyle("height",!1,!0);i.hasValue()&&(n.attributes.width=new yt(t,"width",i.getString())),s.hasValue()&&(n.attributes.height=new yt(t,"height",s.getString()))}var a=n.parent;n.parent=this,n.render(e),n.parent=a}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return ra.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function mf(r,e,t,A,n,i){return r[t*A*4+e*4+i]}function wf(r,e,t,A,n,i,s){r[t*A*4+e*4+i]=s}function Rr(r,e,t){var A=r[e];return A*t}function wi(r,e,t,A){return e+Math.cos(r)*t+Math.sin(r)*A}class Av extends lr{constructor(e,t,A){super(e,t,A),this.type="feColorMatrix";var n=kA(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var i=n[0];n=[.213+.787*i,.715-.715*i,.072-.072*i,0,0,.213-.213*i,.715+.285*i,.072-.072*i,0,0,.213-.213*i,.715-.715*i,.072+.928*i,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var s=n[0]*Math.PI/180;n=[wi(s,.213,.787,-.213),wi(s,.715,-.715,-.715),wi(s,.072,-.072,.928),0,0,wi(s,.213,-.213,.143),wi(s,.715,.285,.14),wi(s,.072,-.072,-.283),0,0,wi(s,.213,-.213,-.787),wi(s,.715,-.715,.715),wi(s,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=n,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,A,n,i){for(var{includeOpacity:s,matrix:a}=this,o=e.getImageData(0,0,n,i),l=0;l<i;l++)for(var u=0;u<n;u++){var f=mf(o.data,u,l,n,i,0),h=mf(o.data,u,l,n,i,1),c=mf(o.data,u,l,n,i,2),g=mf(o.data,u,l,n,i,3),p=Rr(a,0,f)+Rr(a,1,h)+Rr(a,2,c)+Rr(a,3,g)+Rr(a,4,1),y=Rr(a,5,f)+Rr(a,6,h)+Rr(a,7,c)+Rr(a,8,g)+Rr(a,9,1),w=Rr(a,10,f)+Rr(a,11,h)+Rr(a,12,c)+Rr(a,13,g)+Rr(a,14,1),B=Rr(a,15,f)+Rr(a,16,h)+Rr(a,17,c)+Rr(a,18,g)+Rr(a,19,1);s&&(p=0,y=0,w=0,B*=g/255),wf(o.data,u,l,n,i,0,p),wf(o.data,u,l,n,i,1,y),wf(o.data,u,l,n,i,2,w),wf(o.data,u,l,n,i,3,B)}e.clearRect(0,0,n,i),e.putImageData(o,0,0)}}class sl extends lr{constructor(){super(...arguments),this.type="mask"}apply(e,t){var{document:A}=this,n=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y");if(!s&&!a){var o=new hn;this.children.forEach(g=>{o.addBoundingBox(g.getBoundingBox(e))}),n=Math.floor(o.x1),i=Math.floor(o.y1),s=Math.floor(o.width),a=Math.floor(o.height)}var l=this.removeStyles(t,sl.ignoreStyles),u=A.createCanvas(n+s,i+a),f=u.getContext("2d");A.screen.setDefaults(f),this.renderChildren(f),new Av(A,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(f,0,0,n+s,i+a);var h=A.createCanvas(n+s,i+a),c=h.getContext("2d");A.screen.setDefaults(c),t.render(c),c.globalCompositeOperation="destination-in",c.fillStyle=f.createPattern(u,"no-repeat"),c.fillRect(0,0,n+s,i+a),e.fillStyle=c.createPattern(h,"no-repeat"),e.fillRect(0,0,n+s,i+a),this.restoreStyles(t,l)}render(e){}}sl.ignoreStyles=["mask","transform","clip-path"];var XF=()=>{};class YF extends lr{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:t}=this,A=Reflect.getPrototypeOf(e),{beginPath:n,closePath:i}=e;A&&(A.beginPath=XF,A.closePath=XF),Reflect.apply(n,e,[]),this.children.forEach(s=>{if(!(typeof s.path>"u")){var a=typeof s.elementTransform<"u"?s.elementTransform():null;a||(a=ra.fromElement(t,s)),a&&a.apply(e),s.path(e),A&&(A.closePath=i),a&&a.unapply(e)}}),Reflect.apply(i,e,[]),e.clip(),A&&(A.beginPath=n,A.closePath=i)}render(e){}}class ol extends lr{constructor(){super(...arguments),this.type="filter"}apply(e,t){var{document:A,children:n}=this,i=t.getBoundingBox(e);if(i){var s=0,a=0;n.forEach(w=>{var B=w.extraFilterDistance||0;s=Math.max(s,B),a=Math.max(a,B)});var o=Math.floor(i.width),l=Math.floor(i.height),u=o+2*s,f=l+2*a;if(!(u<1||f<1)){var h=Math.floor(i.x),c=Math.floor(i.y),g=this.removeStyles(t,ol.ignoreStyles),p=A.createCanvas(u,f),y=p.getContext("2d");A.screen.setDefaults(y),y.translate(-h+s,-c+a),t.render(y),n.forEach(w=>{typeof w.apply=="function"&&w.apply(y,0,0,u,f)}),e.drawImage(p,0,0,u,f,h-s,c-a,u,f),this.restoreStyles(t,g)}}}render(e){}}ol.ignoreStyles=["filter","transform","clip-path"];class $F extends lr{constructor(e,t,A){super(e,t,A),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,t,A,n,i){}}class JF extends lr{constructor(){super(...arguments),this.type="feMorphology"}apply(e,t,A,n,i){}}class ZF extends lr{constructor(){super(...arguments),this.type="feComposite"}apply(e,t,A,n,i){}}class eS extends lr{constructor(e,t,A){super(e,t,A),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,A,n,i){var{document:s,blurRadius:a}=this,o=s.window?s.window.document.body:null,l=e.canvas;l.id=s.getUniqueId(),o&&(l.style.display="none",o.appendChild(l)),v8(l,t,A,n,i,a),o&&o.removeChild(l)}}class tS extends lr{constructor(){super(...arguments),this.type="title"}}class rS extends lr{constructor(){super(...arguments),this.type="desc"}}var k8={svg:Ds,rect:Z1,circle:FF,ellipse:SF,line:UF,polyline:ev,polygon:_F,path:Vt,pattern:IF,marker:QF,defs:NF,linearGradient:OF,radialGradient:TF,stop:LF,animate:pf,animateColor:PF,animateTransform:RF,font:MF,"font-face":DF,"missing-glyph":kF,glyph:J1,text:mi,tspan:al,tref:HF,a:jF,textPath:qF,image:VF,g:gf,symbol:zF,style:rv,use:WF,mask:sl,clipPath:YF,filter:ol,feDropShadow:$F,feMorphology:JF,feComposite:ZF,feColorMatrix:Av,feGaussianBlur:eS,title:tS,desc:rS};function AS(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(r);e&&(A=A.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,A)}return t}function H8(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?AS(Object(t),!0).forEach(function(A){U1(r,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):AS(Object(t)).forEach(function(A){Object.defineProperty(r,A,Object.getOwnPropertyDescriptor(t,A))})}return r}function j8(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,t}function K8(r){return nv.apply(this,arguments)}function nv(){return nv=pi(function*(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((A,n)=>{t.onload=()=>{A(t)},t.onerror=(i,s,a,o,l)=>{n(l)},t.src=r})}),nv.apply(this,arguments)}class yi{constructor(e){var{rootEmSize:t=12,emSize:A=12,createCanvas:n=yi.createCanvas,createImage:i=yi.createImage,anonymousCrossOrigin:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=e,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=A,this.createCanvas=n,this.createImage=this.bindCreateImage(i,s),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return typeof t=="boolean"?(A,n)=>e(A,typeof n=="boolean"?n:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){var t=e.nodeName.replace(/^[^:]+:/,""),A=yi.elementTypes[t];return typeof A<"u"?new A(this,e):new EF(this,e)}createTextNode(e){return new M8(this,e)}setViewBox(e){this.screen.setViewBox(H8({document:this},e))}}yi.createCanvas=j8,yi.createImage=K8,yi.elementTypes=k8;function nS(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(r);e&&(A=A.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,A)}return t}function Ka(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nS(Object(t),!0).forEach(function(A){U1(r,A,t[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):nS(Object(t)).forEach(function(A){Object.defineProperty(r,A,Object.getOwnPropertyDescriptor(t,A))})}return r}class qa{constructor(e,t){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new df(A),this.screen=new il(e,A),this.options=A;var n=new yi(this,A),i=n.createDocumentElement(t);this.document=n,this.documentElement=i}static from(e,t){var A=arguments;return pi(function*(){var n=A.length>2&&A[2]!==void 0?A[2]:{},i=new df(n),s=yield i.parse(t);return new qa(e,s,n)})()}static fromString(e,t){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new df(A),i=n.parseFromString(t);return new qa(e,i,A)}fork(e,t){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return qa.from(e,t,Ka(Ka({},this.options),A))}forkString(e,t){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return qa.fromString(e,t,Ka(Ka({},this.options),A))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return pi(function*(){var A=e.length>0&&e[0]!==void 0?e[0]:{};t.start(Ka({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},A)),yield t.ready(),t.stop()})()}start(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:t,screen:A,options:n}=this;A.start(t,Ka(Ka({enableRedraw:!0},n),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,t,A)}}const q8=Object.freeze(Object.defineProperty({__proto__:null,AElement:jF,AnimateColorElement:PF,AnimateElement:pf,AnimateTransformElement:RF,BoundingBox:hn,CB1:K1,CB2:q1,CB3:V1,CB4:z1,Canvg:qa,CircleElement:FF,ClipPathElement:YF,DefsElement:NF,DescElement:rS,Document:yi,Element:lr,EllipseElement:SF,FeColorMatrixElement:Av,FeCompositeElement:ZF,FeDropShadowElement:$F,FeGaussianBlurElement:eS,FeMorphologyElement:JF,FilterElement:ol,Font:BA,FontElement:MF,FontFaceElement:DF,GElement:gf,GlyphElement:J1,GradientElement:tv,ImageElement:VF,LineElement:UF,LinearGradientElement:OF,MarkerElement:QF,MaskElement:sl,Matrix:Y1,MissingGlyphElement:kF,Mouse:vF,PSEUDO_ZERO:ja,Parser:df,PathElement:Vt,PathParser:Ft,PatternElement:IF,Point:vr,PolygonElement:_F,PolylineElement:ev,Property:yt,QB1:G1,QB2:W1,QB3:X1,RadialGradientElement:TF,RectElement:Z1,RenderedElement:Aa,Rotate:BF,SVGElement:Ds,SVGFontLoader:GF,Scale:bF,Screen:il,Skew:$1,SkewX:xF,SkewY:CF,StopElement:LF,StyleElement:rv,SymbolElement:zF,TRefElement:HF,TSpanElement:al,TextElement:mi,TextPathElement:qF,TitleElement:tS,Transform:ra,Translate:yF,UnknownElement:EF,UseElement:WF,ViewPort:pF,compressSpaces:ka,default:qa,getSelectorSpecificity:gF,normalizeAttributeName:hF,normalizeColor:dF,parseExternalUrl:k1,presets:B8,toNumbers:kA,trimLeft:cF,trimRight:fF,vectorMagnitude:H1,vectorsAngle:j1,vectorsRatio:hf},Symbol.toStringTag,{value:"Module"}));wt.BandBoundaryDesigner=iP,wt.BandPropertyPanel=_w,wt.CanvasArea=Fw,wt.ColorPicker=Di,wt.FormulaEditor=go,wt.ObjectPropertyPanel=Qw,wt.PageSettingsPanel=kx,wt.PrintPreview=Dx,wt.RichTextEditor=Iw,wt.Toolbar=aP,wt.bandTypeOptions=GS,wt.barcodeTypeOptions=Gv,wt.borderStyles=Hv,wt.controlTypes=Zs,wt.dateFormatOptions=Vv,wt.defaultBands=Jf,wt.defaultFontSettings=WS,wt.defaultOptions=kv,wt.defaultPageSettings=Yv,wt.evaluateFormula=ho,wt.exportToPdf=hP,wt.fontStyleOptions=qv,wt.fontWeightOptions=Kv,wt.formatTypeOptions=eh,wt.getBandObjectsRenderData=Ew,wt.getDetailDataKey=Zf,wt.getObjectContent=Qu,wt.getObjectRenderData=Nu,wt.getPrintableHtml=Hx,wt.getRegisteredFunctions=MU,wt.imageObjectFitOptions=zv,wt.lineStyleOptions=Xv,wt.marginPresets=Pl,wt.openPrintWindow=dP,wt.orientationOptions=$v,wt.pageSizePresets=Ll,wt.qrcodeErrorLevelOptions=Wv,wt.registerFunction=RU,wt.renderToHtml=Cg,wt.textAlignOptions=zS,wt.textVerticalAlignOptions=jv,wt.useBandDesigner=Zv,wt.useHistory=Jv,wt.validateFormula=Bw,Object.defineProperty(wt,Symbol.toStringTag,{value:"Module"})}));
|
|
798
798
|
//# sourceMappingURL=print-designer.umd.js.map
|