@compdfkit_pdf_sdk/webviewer 2.7.5 → 2.7.6

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.
@@ -2191,7 +2191,7 @@ function print() { __p += __j.call(arguments, '') }
2191
2191
  </svg>`,TextSelection=function(){return _createClass(function e(n){_classCallCheck(this,e),_TextSelection_pagePtr.set(this,void 0),_TextSelection_textPtr.set(this,void 0),this._tool=null,this.color=null,this.selecting=!1,this.documentViewer=n.documentViewer,this._selection=null,this.leftSelectedPointer=this.rightSelectedPointer=null,this.messageHandler=n.messageHandler,this.container=n.container||null,__classPrivateFieldSet(this,_TextSelection_textPtr,n.pagePtr.textPtr,"f"),__classPrivateFieldSet(this,_TextSelection_pagePtr,n.pagePtr.pagePtr,"f"),this.selected=n.selected,this.viewport=n.viewport,this.scale=n.scale,this.eventBus=n.eventBus,this.pageIndex=n.pageIndex,this.pageViewer=n.pageViewer,this.handleTool=this.handleTool.bind(this),this.handleToolMode=this.handleToolMode.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleDobuleClick=this.handleDobuleClick.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleTextPopup=this.handleTextPopup.bind(this),this.handleLeftPointerMouseDown=this.handleLeftPointerMouseDown.bind(this),this.handleRightPointerMouseDown=this.handleRightPointerMouseDown.bind(this),this.toolMode=n.toolMode,this.tool=n.tool,this.color=n.color,this.eventBus._on("toolChanged",this.handleTool),this.eventBus._on("toolModeChanged",this.handleToolMode),this.eventBus._on("textPopupClicked",this.handleTextPopup)},[{key:"handleToolMode",value:function(e){e!==this.toolMode&&(this.toolMode=e,document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("touchstart",this.handleMouseDown),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("touchmove",this.handleMouseMove),document.removeEventListener("dblclick",this.handleDobuleClick),["view","annotation","redaction"].includes(this.toolMode)&&(document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("touchstart",this.handleMouseDown),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleMouseMove),document.addEventListener("dblclick",this.handleDobuleClick)))}},{key:"handleTool",value:function(e){var n=e.tool,o=e.color;this.tool=n,this.color=o,markupType.includes(this.tool)?(document.body.style.userSelect="auto",document.body.style.webkitUserSelect="auto"):(document.body.style.userSelect="none",document.body.style.webkitUserSelect="none")}},{key:"tool",get:function(){return this._tool},set:function(e){if(e!==this._tool||e===""){if(!markupType.includes(e)||this.toolMode==="editor")return document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("touchstart",this.handleMouseDown),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("touchmove",this.handleMouseMove),document.removeEventListener("dblclick",this.handleDobuleClick),void(this._tool=e);markupType.includes(e)&&markupType.includes(this.tool)||(document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("touchstart",this.handleMouseDown),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleMouseMove),document.addEventListener("dblclick",this.handleDobuleClick)),this._tool=e}}},{key:"testPoint",value:function(e){var n=getAbsoluteCoordinate(this.container,e),o=n.x,r=n.y,f=n.width,s=n.height;return!(o<0||r<0||o>f||r>s)&&{x:o,y:r}}},{key:"handleKeyDown",value:function(e){var n;if(e.key.toLocaleLowerCase()==="c"&&(e.ctrlKey||e.metaKey)){var o=(n=this._selection)===null||n===void 0?void 0:n.textContent;if(o){var r=this.documentViewer.getPermission("allowsCopying");if(!r)return this.documentViewer.permissionPasswordCallback(),{type:"permission",message:"The document contains a permission password."};r&&copyToClipboard$1(o)}}}},{key:"handleMouseDown",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v;return _regeneratorRuntime().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(!this.isTargetInElement(e.target,".text-popup")){d.next=2;break}return d.abrupt("return");case 2:if(this.cleanSelection(),o=this.tool,!(r=document.querySelectorAll(".dialog")).length){d.next=13;break}f=0;case 7:if(!(f<r.length)){d.next=13;break}if(!r[f].contains(e.target)){d.next=10;break}return d.abrupt("return");case 10:f++,d.next=7;break;case 13:if(e.target.className==="annotationContainer"||!this.isTargetInElement(e.target,".annotationContainer")||this.isTargetInElement(e.target,".markup")){d.next=15;break}return d.abrupt("return");case 15:if(!this.isTargetInElement(e.target,".text-editor-container")){d.next=17;break}return d.abrupt("return");case 17:if(this.isTargetInElement(e.target,".document-container")||this.isTargetInElement(e.target,".compare-document-container")){d.next=19;break}return d.abrupt("return");case 19:if(markupType.includes(o)){d.next=21;break}return d.abrupt("return");case 21:if(s=this.testPoint(e)){d.next=24;break}return d.abrupt("return");case 24:return m=s.x,w=s.y,g=getInitialPoint$1({x:m,y:w},this.scale),this.startPoint=g,d.next=29,this.isTextAtPoint(g);case 29:v=d.sent,this.selecting=!!v,document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleMouseUp);case 33:case"end":return d.stop()}},n,this)}))}},{key:"handleMouseMove",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v,d,u;return _regeneratorRuntime().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(!this.pageViewer.documentViewer.pdfCursorTools.active){y.next=2;break}return y.abrupt("return");case 2:if(!this.isTargetInElement(e.target,".redaction-confirm-dialog")&&!this.isTargetInElement(e.target,".mask")){y.next=4;break}return y.abrupt("return");case 4:if((m=this.testPoint(e))&&!document.querySelector(".annotationContainer .outline-container")){y.next=8;break}return(o=this.container)===null||o===void 0||o.classList.remove("text"),y.abrupt("return");case 8:return w=m.x,g=m.y,v=getInitialPoint$1({x:w,y:g},this.scale),y.next=12,this.isTextAtPoint(v);case 12:if(!(d=y.sent)){y.next=17;break}(r=this.container)===null||r===void 0||r.classList.add("text"),y.next=19;break;case 17:return(f=this.container)===null||f===void 0||f.classList.remove("text"),y.abrupt("return");case 19:if(this.selecting){y.next=21;break}return y.abrupt("return");case 21:if(this.selecting&&d&&(this.selecting==="left"?this.startPoint=v:this.endPoint=v),!this.startPoint||this.startPoint.x!==this.endPoint.x||this.startPoint.y!==this.endPoint.y){y.next=24;break}return y.abrupt("return");case 24:return(s=this.container)===null||s===void 0||s.classList.add("selecting"),y.next=27,this.messageHandler.sendWithPromise("GetCharsRangeAtPos",{pagePtr:__classPrivateFieldGet(this,_TextSelection_pagePtr,"f"),textPtr:__classPrivateFieldGet(this,_TextSelection_textPtr,"f"),start:this.startPoint,end:this.endPoint});case 27:u=y.sent,this._selection=u,this.updateSelection();case 30:case"end":return y.stop()}},n,this)}))}},{key:"handleDobuleClick",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g;return _regeneratorRuntime().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(!this.pageViewer.documentViewer.pdfCursorTools.active){v.next=2;break}return v.abrupt("return");case 2:if(e.stopPropagation(),e.preventDefault(),(r=this.testPoint(e))&&!document.querySelector(".annotationContainer .outline-container")){v.next=8;break}return(o=this.container)===null||o===void 0||o.classList.remove("text"),v.abrupt("return");case 8:return f=r.x,s=r.y,m=getInitialPoint$1({x:f,y:s},this.scale),v.next=12,this.isTextAtPoint(m);case 12:if(v.sent){v.next=15;break}return v.abrupt("return");case 15:return v.next=17,this.messageHandler.sendWithPromise("GetSelectionForWordAtPos",{pagePtr:__classPrivateFieldGet(this,_TextSelection_pagePtr,"f"),textPtr:__classPrivateFieldGet(this,_TextSelection_textPtr,"f"),start:m,end:m});case 17:w=v.sent,this._selection=w,this.updateSelection(),this._selection&&this.textContainer&&["redaction","remove"].includes(this.tool)?(g={operate:"add-annot",type:"redact",pageIndex:this.pageIndex,date:new Date,rect:this.rect,rects:this.rects,color:this.color,erasure:this.tool==="remove",quadPoints:this.quadPoints,contents:this._selection.textContent||void 0},this.tool==="redaction"&&(g.fillColor="rgb(0, 0, 0)"),this.eventBus.dispatch("annotationChange",{type:"add",annotation:g}),this.cleanSelection()):this._selection&&this.textContainer&&this.showTextPopup();case 21:case"end":return v.stop()}},n,this)}))}},{key:"handleMouseUp",value:function(){if(this.selecting&&this._selection&&markupTypeNotNull.includes(this.tool)){var e={operate:"add-annot",type:this.tool,pageIndex:this.pageIndex,date:new Date,opacity:1,quadPoints:this.quadPoints,rect:this.rect,color:this.color,contents:this._selection.textContent||void 0};this.tool!=="redaction"&&this.tool!=="remove"||(e.type="redact",e.rects=this.rects,e.erasure=this.tool==="remove",this.tool==="redaction"&&(e.fillColor="rgb(0, 0, 0)"),delete e.opacity),this.eventBus.dispatch("annotationChange",{type:"add",annotation:e}),this.cleanSelection()}this.selecting=!1,this._selection&&this.textContainer&&this.showTextPopup()}},{key:"updateSelection",value:function(){var e,n,o,r=this._selection.textRects;(e=this.textContainer)===null||e===void 0||(e.textContent=""),!this.leftSelectedPointer&&(this.leftSelectedPointer=this.createSelectionPointer(!0)),!this.rightSelectedPointer&&(this.rightSelectedPointer=this.createSelectionPointer()),(n=this.textContainer)===null||n===void 0||n.append(this.leftSelectedPointer),(o=this.textContainer)===null||o===void 0||o.append(this.rightSelectedPointer);for(var f=[],s=[],m=[],w=[],g=[],v=[],d=0;d<r.length;d++){var u=r[d],y=u.Left,x=u.Top,k=u.Right,P=u.Bottom,S={left:y*this.scale,top:x*this.scale,right:k*this.scale,bottom:P*this.scale};m.push(x),w.push(P),g.push(y),v.push(k);var E={PointX:y,PointY:x},M={PointX:k,PointY:x},T={PointX:y,PointY:P},D={PointX:k,PointY:P};s.push(E,M,T,D),f.push({top:x,left:y,right:k,bottom:P}),d===0&&(this.leftSelectedPointer.style.left=S.left-10+"px",this.leftSelectedPointer.style.top=S.top+"px",this.leftSelectedPointer.style.height=S.bottom-S.top+10+"px"),d===r.length-1&&(this.rightSelectedPointer.style.left=S.right+"px",this.rightSelectedPointer.style.top=S.top+"px",this.rightSelectedPointer.style.height=S.bottom-S.top+10+"px"),this.drawSelection(S)}this.quadPoints=s,this.rects=f;var N=Math.min.apply(Math,m),F=Math.max.apply(Math,w),O=Math.min.apply(Math,g),I=Math.max.apply(Math,v);this.rect={left:O,top:N,right:I,bottom:F}}},{key:"drawSelection",value:function(e){var n,o;this.textContainer||(this.textContainer=document.createElement("div"),this.textContainer.classList.add("text-container"),(n=this.container)===null||n===void 0||n.appendChild(this.textContainer));var r=e.left,f=e.top,s=e.right,m=e.bottom,w=document.createElement("div");return w.classList.add("text-selection"),w.style.left="".concat(r,"px"),w.style.top="".concat(f,"px"),w.style.width="".concat(s-r,"px"),w.style.height="".concat(m-f,"px"),(o=this.textContainer)===null||o===void 0||o.appendChild(w),w}},{key:"createSelectionPointer",value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n=createElement("div",{width:"10px",display:"flex",justifyContent:"center",alignItems:"flex-end",position:"absolute",zIndex:122,cursor:"pointer"},{class:"pointer"});return e?(n.innerHTML=leftSelectedPointerStr,n.addEventListener("mousedown",this.handleLeftPointerMouseDown),n.addEventListener("touchstart",this.handleLeftPointerMouseDown)):(n.innerHTML=rightSelectedPointerStr,n.addEventListener("mousedown",this.handleRightPointerMouseDown),n.addEventListener("touchstart",this.handleRightPointerMouseDown)),n}},{key:"handleLeftPointerMouseDown",value:function(e){e.stopPropagation(),this.eventBus.dispatch("showTextPopup",{show:!1}),this.selecting="left"}},{key:"handleRightPointerMouseDown",value:function(e){e.stopPropagation(),this.eventBus.dispatch("showTextPopup",{show:!1}),this.selecting="right"}},{key:"cleanSelection",value:function(){var e,n,o,r,f,s;this.startPoint=null,this.endPoint=null,this.selecting=!1,(e=this.container)===null||e===void 0||e.classList.remove("selecting"),(n=this.textContainer)===null||n===void 0||n.remove(),this.textContainer=null,this._selection=null,(o=this.leftSelectedPointer)===null||o===void 0||o.addEventListener("mousedown",this.handleLeftPointerMouseDown),(r=this.leftSelectedPointer)===null||r===void 0||r.addEventListener("touchstart",this.handleLeftPointerMouseDown),(f=this.rightSelectedPointer)===null||f===void 0||f.addEventListener("mousedown",this.handleRightPointerMouseDown),(s=this.rightSelectedPointer)===null||s===void 0||s.addEventListener("touchstart",this.handleRightPointerMouseDown),this.leftSelectedPointer=this.rightSelectedPointer=null,document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleMouseUp),this.eventBus.dispatch("showTextPopup",{show:!1})}},{key:"destroy",value:function(){this.cleanSelection(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("touchstart",this.handleMouseDown),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("touchmove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleMouseUp),document.removeEventListener("dblclick",this.handleDobuleClick),this.eventBus._off("toolChanged",this.handleTool),this.eventBus._off("toolModeChanged",this.handleToolMode),this.eventBus._off("textPopupClicked",this.handleTextPopup)}},{key:"showTextPopup",value:function(){var e,n,o=this.container.getBoundingClientRect(),r={left:this.rect.left*this.scale+o.left,top:this.rect.top*this.scale+o.top,right:this.rect.right*this.scale+o.left,bottom:this.rect.bottom*this.scale+o.top};this.eventBus.dispatch("showTextPopup",{show:!0,rect:r,text:(e=this._selection)===null||e===void 0?void 0:e.textContent});for(var f=[],s=0;s<this._selection.textRects.length;s++){var m=this._selection.textRects[s],w=m.Left,g=m.Top,v=m.Right,d=m.Bottom;f.push({left:w,top:g,right:v,bottom:d})}var u={selectedText:(n=this._selection)===null||n===void 0?void 0:n.textContent,pageNumber:this.pageIndex+1,textRects:f};this.eventBus.dispatch("textSelected",u)}},{key:"handleTextPopup",value:function(e){var n;if(this._selection){var o=e.tool,r=e.color,f=(n=this._selection)===null||n===void 0?void 0:n.textContent;if(markupTypeNotNull.includes(o)){var s={operate:"add-annot",type:o,pageIndex:this.pageIndex,date:new Date,opacity:.5,quadPoints:this.quadPoints,rect:this.rect,color:r||"#ff0000",contents:f};this.eventBus.dispatch("annotationChange",{type:"add",annotation:s}),this.cleanSelection(),this.endPoint=null}}}},{key:"isTargetInElement",value:function(e,n){var o=document.querySelector(n);return!(!o||!o.contains(e))}},{key:"isTextAtPoint",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){return _regeneratorRuntime().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.messageHandler.sendWithPromise("GetCharIndexAtPos",{pagePtr:__classPrivateFieldGet(this,_TextSelection_pagePtr,"f"),textPtr:__classPrivateFieldGet(this,_TextSelection_textPtr,"f"),point:e});case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}},n,this)}))}}])}();_TextSelection_pagePtr=new WeakMap,_TextSelection_textPtr=new WeakMap;var TextSearch=function(){return _createClass(function e(n){var o=n.container,r=n.viewport,f=n.scale,s=n.pageIndex,m=n.results;_classCallCheck(this,e),this.searchContainer=null,this.activeIndex=0,this.container=null,this.scale=0,this.pageIndex=0,this._searchResults=[],this.color="rgba(255, 255, 0, 0.25)",this.container=o,this.viewport=r,this.scale=f,this.pageIndex=s,this._searchResults=m,m&&m.length&&this.renderSearchResults()},[{key:"searchResults",get:function(){return this._searchResults},set:function(e){this._searchResults=e,this.renderSearchResults()}},{key:"setActiveSearchResult",value:function(e){var n=e.pageNum;e&&(this.searchContainer&&this.searchContainer.querySelectorAll(".searchItems")[e.pageSearchIndex].classList.add("selected"),this.activeIndex=n-1)}},{key:"clearActiveSearchResult",value:function(e){if(this.searchContainer){var n=e.pageSearchIndex;this.searchContainer.querySelectorAll(".searchItems")[n].classList.remove("selected")}}},{key:"renderSearchResults",value:function(){var e=this.scale;if(!this.searchContainer){var n=document.createElement("div");n.className="searchContainer",this.container.appendChild(n),this.searchContainer=n}this.searchContainer.textContent="";for(var o=0;o<this.searchResults.length;o++)if(this.searchResults[o].pageNum===this.pageIndex+1){var r=this.searchResults[o],f=document.createElement("div");f.className="searchItems";for(var s=0;s<r.quads.length;s++){var m=r.quads[s],w=m.left,g=m.top,v={left:w*e,top:g*e,width:m.right*e-w*e,height:m.bottom*e-g*e},d=document.createElement("div");d.className="highlight",d.style.position="absolute",d.style.left="".concat(v.left,"px"),d.style.top="".concat(v.top,"px"),d.style.width="".concat(v.width,"px"),d.style.height="".concat(v.height,"px"),f.appendChild(d)}this.searchContainer.appendChild(f)}}},{key:"destroy",value:function(){this.searchContainer&&(this.searchContainer.parentNode.removeChild(this.searchContainer),this.searchContainer=null)}}])}(),CropPage=function(){return _createClass(function n(o){var r=o.container,f=o.viewport,s=o.scale,m=o.pageIndex,w=o.pagePtr,g=o.eventBus,v=o.messageHandler,d=o.pageViewer,u=o.annotationStore;_classCallCheck(this,n),this.container=r,this.viewport=f,this.scale=s,this.pageIndex=m,this.pagePtr=w.pagePtr,this.eventBus=g,this.messageHandler=v,this.pageViewer=d,this.annotationStore=u,this.startPoint=null,this.endPoint=null,this.listener=null,this.moved=!1,this.mousedown=isMobileDevice$1?"touchstart":"mousedown",this.mouseup=isMobileDevice$1?"touchend":"mouseup",this.mousemove=isMobileDevice$1?"touchmove":"mousemove",this.onDrawMousedown=this.handleDrawMouseDown.bind(this),this.onDrawMouseup=this.handleDrawMouseUp.bind(this),this.onDrawMousemove=this.handleDrawMouseMove.bind(this),this.onMousedown=this.handleMouseDown.bind(this),this.onMouseup=this.handleMouseUp.bind(this),this.onMousemove=this.handleMouseMove.bind(this),this.handlePopup=this.handlePopup.bind(this)},[{key:"init",value:function(){var n=this;this.container.removeEventListener(this.mousedown,this.onDrawMousedown),this.container.addEventListener(this.mousedown,this.onDrawMousedown),setTimeout(function(){n.cropping||(n.container.style.cursor="crosshair"),n.container.style.touchAction="none"}),document.removeEventListener(this.mousemove,this.onDrawMousemove),document.removeEventListener(this.mouseup,this.onDrawMouseup)}},{key:"resetDraw",value:function(){this.startPoint=null,this.endPoint=null,this.container.style.cursor="",document.removeEventListener(this.mousemove,this.onDrawMousemove),document.removeEventListener(this.mouseup,this.onDrawMouseup),this.container.removeEventListener(this.mousedown,this.onDrawMousedown)}},{key:"reset",value:function(){this.startPoint=null,this.endPoint=null,this.cropContainer&&this.cropContainer.remove(),this.cropContainer=null,this.container.style.cursor="auto",this.container.style.touchAction="",document.removeEventListener(this.mousemove,this.onMousemove),document.removeEventListener(this.mouseup,this.onMouseup),this.container.removeEventListener(this.mousedown,this.onDrawMousedown),this.eventBus.dispatch("snipSelected",{rect:null,pageNumber:0}),this.eventBus.dispatch("pageCropped",{rect:null,pageNumber:0}),this.eventBus._off("cropPagePopupClicked",this.handlePopup),this.cropping=!1,this.annotationStore.cropping=!1,document.removeEventListener(this.mousedown,this.listener)}},{key:"getMouseLocation",value:function(n){var o=this.pageViewer.documentViewer.getScrollViewElement(),r=o.scrollLeft||0,f=o.scrollTop||0,s=getClickPoint(n);return{x:s.pageX+r,y:s.pageY+f}}},{key:"handleDrawMouseDown",value:function(n){if(!this.annotationStore.cropping){var o=this.getMouseLocation(n),r=this.pageViewer.documentViewer.windowToPage({x:o.x,y:o.y},this.pageIndex+1),f=r.x,s=r.y;this.startPoint={x:f,y:s},document.addEventListener(this.mousemove,this.onDrawMousemove),document.addEventListener(this.mouseup,this.onDrawMouseup)}}},{key:"handleDrawMouseMove",value:function(n){var o=this.getMouseLocation(n),r=this.pageViewer.documentViewer.windowToPage({x:o.x,y:o.y},this.pageIndex+1),f=r.x,s=r.y,m=this.viewport.viewBox[2],w=this.viewport.viewBox[3];if(f=Math.min(m,f),f=Math.max(0,f),s=Math.min(w,s),s=Math.max(0,s),this.endPoint={x:f,y:s},this.startPoint.x!==this.endPoint.x&&this.startPoint.y!==this.endPoint.y)if(this.cropContainer){var g=this.rectCalc(this.startPoint,this.endPoint),v=this.cropContainer;v.style.top="".concat(g.top,"px"),v.style.left="".concat(g.left,"px"),v.style.width="".concat(Math.abs(g.width-1),"px"),v.style.height="".concat(Math.abs(g.height-1),"px")}else{var d=createElement("div",{position:"absolute",border:"1px solid #1460F3",cursor:"all-scroll",zIndex:2},{class:"crop-box","data-id":"move"});this.cropContainer=d,this.container.append(this.cropContainer)}}},{key:"handleDrawMouseUp",value:function(){var n=this.startPoint,o=this.endPoint;if(this.resetDraw(),!o||n.x===o.x||n.y===o.y)return this.container.style.cursor="crosshair",void this.container.addEventListener(this.mousedown,this.onDrawMousedown);var r={x:Math.min(n.x,o.x),y:Math.min(n.y,o.y)},f={x:Math.max(n.x,o.x),y:Math.max(n.y,o.y)},s={left:r.x,top:r.y,right:f.x,bottom:f.y};this.rect=s,this.start=r,this.end=f,this.renderCropBox()}},{key:"rectCalc",value:function(n,o){var r=this.viewport.scale,f=(n.y<o.y?n.y:o.y)*r,s=(n.x<o.x?n.x:o.x)*r,m=(n.x>o.x?n.x:o.x)*r,w=(n.y>o.y?n.y:o.y)*r;return{top:f,left:s,right:m,bottom:w,width:m-s,height:w-f}}},{key:"renderCropBox",value:function(){var n=10;this.tl=createElement("div",{position:"absolute",top:"".concat(-5,"px"),left:"".concat(-5,"px"),width:"".concat(n,"px"),height:"".concat(n,"px"),background:"#1460F3",cursor:"nw-resize"},{class:"handle handle-tl","data-id":"nw-resize"}),this.tm=createElement("div",{position:"absolute",top:"".concat(-5,"px"),left:"50%",transform:"translateX(".concat(-5,"px)"),width:"".concat(n,"px"),height:"".concat(n,"px"),background:"#1460F3",cursor:"n-resize"},{class:"handle handle-tm","data-id":"n-resize"}),this.tr=createElement("div",{position:"absolute",top:"".concat(-5,"px"),right:"".concat(-5,"px"),width:"".concat(n,"px"),height:"".concat(n,"px"),background:"#1460F3",cursor:"ne-resize"},{class:"handle handle-tr","data-id":"ne-resize"}),this.mr=createElement("div",{position:"absolute",top:"50%",right:"".concat(-5,"px"),transform:"translateY(".concat(-5,"px)"),width:"".concat(n,"px"),height:"".concat(n,"px"),background:"#1460F3",cursor:"e-resize"},{class:"handle handle-mr","data-id":"e-resize"}),this.br=createElement("div",{position:"absolute",bottom:"".concat(-5,"px"),right:"".concat(-5,"px"),width:"".concat(n,"px"),height:"".concat(n,"px"),background:"#1460F3",cursor:"se-resize"},{class:"handle handle-br","data-id":"se-resize"}),this.bm=createElement("div",{position:"absolute",bottom:"".concat(-5,"px"),left:"50%",transform:"translateX(".concat(-5,"px)"),width:"".concat(n,"px"),height:"".concat(n,"px"),background:"#1460F3",cursor:"s-resize"},{class:"handle handle-bm","data-id":"s-resize"}),this.bl=createElement("div",{position:"absolute",bottom:"".concat(-5,"px"),left:"".concat(-5,"px"),width:"".concat(n,"px"),height:"".concat(n,"px"),background:"#1460F3",cursor:"sw-resize"},{class:"handle handle-bl","data-id":"sw-resize"}),this.ml=createElement("div",{position:"absolute",top:"50%",left:"".concat(-5,"px"),transform:"translateY(".concat(-5,"px)"),width:"".concat(n,"px"),height:"".concat(n,"px"),background:"#1460F3",cursor:"w-resize"},{class:"handle handle-ml","data-id":"w-resize"}),this.cropContainer.append(this.tl),this.cropContainer.append(this.tm),this.cropContainer.append(this.tr),this.cropContainer.append(this.mr),this.cropContainer.append(this.br),this.cropContainer.append(this.bm),this.cropContainer.append(this.bl),this.cropContainer.append(this.ml),this.cropContainer.addEventListener(this.mousedown,this.onMousedown),this.showPopup(),this.eventBus._on("cropPagePopupClicked",this.handlePopup),this.eventBus.dispatch("pageCropped",{rect:this.rect,pageNumber:this.pageIndex+1}),this.cropping=!0,this.annotationStore.cropping=!0,this.listener=onClickOutside$1([this.cropContainer],this.handleOutside.bind(this))}},{key:"handleMouseDown",value:function(n){var o=n.target.getAttribute("data-id"),r=this.getMouseLocation(n),f=this.pageViewer.documentViewer;this.moved=!1;var s=f.windowToPage({x:r.x,y:r.y},this.pageIndex+1),m=s.x,w=s.y;this.startState={operator:o,x:m,y:w},document.addEventListener(this.mousemove,this.onMousemove),document.addEventListener(this.mouseup,this.onMouseup)}},{key:"handleMouseMove",value:function(n){n.type==="touchmove"&&(document.body.style.overscrollBehavior="none");var o=this.getMouseLocation(n),r=this.pageViewer.documentViewer.windowToPage({x:o.x,y:o.y},this.pageIndex+1),f=r.x,s=r.y,m=this.start,w=this.end,g=this.startState,v=this.viewport.viewBox[2],d=this.viewport.viewBox[3];if(this.moved=!0,g.operator==="nw-resize"){var u=f-(g.x-this.start.x),y=s-(g.y-this.start.y);u=Math.min(w.x-5,u),u=Math.max(0,u),y=Math.min(w.y-5,y),y=Math.max(0,y),this.update({start:{x:u,y},end:w})}else if(g.operator==="w-resize"){var x=f-(g.x-this.start.x);x=Math.min(w.x-5,x),x=Math.max(0,x),this.update({start:{x,y:m.y},end:w})}else if(g.operator==="sw-resize"){var k=f-(g.x-this.start.x),P=s-(g.y-this.end.y);k=Math.min(w.x-5,k),k=Math.max(0,k),P=Math.min(d,P),P=Math.max(m.y+5,P),this.update({start:{x:k,y:m.y},end:{x:w.x,y:P}})}else if(g.operator==="s-resize"){var S=s-(g.y-this.end.y);S=Math.min(d,S),S=Math.max(m.y+5,S),this.update({start:m,end:{x:w.x,y:S}})}else if(g.operator==="se-resize"){var E=(g.x,this.end.x),M=(g.y,this.end.y);E=Math.max(m.x+5,f),M=Math.max(m.y+5,s),this.update({start:m,end:{x:E,y:M}})}else if(g.operator==="e-resize"){var T=(g.x,this.end.x);T=Math.max(m.x+5,f),this.update({start:m,end:{x:T,y:w.y}})}else if(g.operator==="ne-resize"){var D=(g.x,this.end.x),N=(g.y,this.start.y);D=Math.max(m.x+5,f),Math.min(w.y-5,s),N=Math.max(0,s),this.update({start:{x:m.x,y:N},end:{x:D,y:w.y}})}else if(g.operator==="n-resize"){var F=(g.y,this.start.y);Math.min(w.y-5,s),F=Math.max(0,s),this.update({start:{x:m.x,y:F},end:w})}else if(g.operator==="move"){var O=f-(g.x-this.start.x),I=s-(g.y-this.start.y),X=f-(g.x-this.end.x),ne=s-(g.y-this.end.y),ye={width:Math.abs(m.x-w.x),height:Math.abs(m.y-w.y)};O<X?(O=Math.max(0,O),O=Math.min(v-ye.width,O),X=Math.max(ye.width,X),X=Math.min(v,X)):(X=Math.max(0,X),X=Math.min(v-ye.width,X),O=Math.max(ye.width,O),O=Math.min(v,O)),I<ne?(I=Math.max(0,I),I=Math.min(d-ye.height,I),ne=Math.max(ye.height,ne),ne=Math.min(d,ne)):(ne=Math.max(0,ne),ne=Math.min(d-ye.height,ne),I=Math.max(ye.height,I),I=Math.min(d,I)),this.update({start:{x:O,y:I},end:{x:X,y:ne}})}}},{key:"handleMouseUp",value:function(n){if(n.type==="touchend"&&(this.layer.pageDiv.style.touchAction=""),document.removeEventListener(this.mousemove,this.onMousemove),document.removeEventListener(this.mouseup,this.onMouseup),this.moved){var o=getClickPoint(n),r=o.pageX,f=o.pageY;r!==this.startState.x||f!==this.startState.y?(this.start=this.newStart,this.end=this.newEnd,this.rect={left:this.start.x,top:this.start.y,right:this.end.x,bottom:this.end.y},this.showPopup(),this.eventBus.dispatch("pageCropped",{rect:this.rect,pageNumber:this.pageIndex+1})):this.showPopup()}}},{key:"update",value:function(n){var o=n.start,r=n.end,f=this.rectCalc(o,r);this.newStart=o,this.newEnd=r,this.cropContainer.style.top=f.top+"px",this.cropContainer.style.left=f.left+"px",this.cropContainer.style.width=f.width+"px",this.cropContainer.style.height=f.height+"px",this.cropContainer.style.width="".concat(f.width,"px"),this.cropContainer.style.height="".concat(f.height,"px"),this.showPopup({left:o.x,top:o.y,right:r.x,bottom:r.y})}},{key:"showPopup",value:function(n){this.eventBus.dispatch("snipSelected",{rect:n||this.rect,pageNumber:this.pageIndex+1})}},{key:"handlePopup",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function n(o){return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:o==="close"&&(this.reset(),this.init());case 1:case"end":return r.stop()}},n,this)})),function(n){return e.apply(this,arguments)})},{key:"draw",value:function(){document.removeEventListener(this.mousedown,this.listener);var n=this.viewport.scale,o=this.rect,r=o.left,f=o.top,s=o.right,m=o.bottom,w=createElement("div",{position:"absolute",border:"1px solid #1460F3",cursor:"all-scroll",top:"".concat(f*n,"px"),left:"".concat(r*n,"px"),width:"".concat((s-r)*n,"px"),height:"".concat((m-f)*n,"px"),zIndex:2},{class:"crop-box","data-id":"move"});this.cropContainer=w,this.container.append(this.cropContainer),this.renderCropBox()}},{key:"handleOutside",value:function(){this.reset(),this.init()}},{key:"updateInitialProps",value:function(){this.container=this.pageViewer.div,this.viewport=this.pageViewer.viewport,this.scale=this.pageViewer.scale,this.pageIndex=this.pageViewer.pageIndex,this.pagePtr=this.pageViewer.pagesPtr[this.pageViewer.pageIndex].pagePtr,this.eventBus=this.pageViewer.eventBus,this.messageHandler=this.pageViewer.messageHandler,this.annotationStore=this.pageViewer.annotationStore}}]);var e}(),Separation=function(){return _createClass(function e(n){_classCallCheck(this,e),this.iccData=null,this.isClearData=!1,this.latestRequestPoint=null,this.isRequestInProgress=!1,this.colorList=[],this.onMousemove=this.handleMouseMove.bind(this),this.onClick=this.handleClick.bind(this),this.onUpdateCanvas=this.updateCanvas.bind(this),this.documentViewer=n.documentViewer,this.container=n.container,this.pageViewer=n.pageViewer,this.pagePtr=n.pagePtr},[{key:"init",value:function(){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function e(){return _regeneratorRuntime().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.initColorsList();case 2:this.documentViewer.eventBus._on("updateSeparationView",this.onUpdateCanvas),document.addEventListener("mousemove",this.onMousemove);case 4:case"end":return n.stop()}},e,this)}))}},{key:"initColorsList",value:function(){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function e(){var n,o,r,f,s,m,w=this;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return n=this.documentViewer,o=n.messageHandler,r=n.doc,f=n.eventBus,s=n.colorFile,o.sendWithPromise("InitColorList",r),g.next=4,o.sendWithPromise("GetPDFSeparationColor",{pagePtr:this.pagePtr.pagePtr,fileData:s});case 4:return m=g.sent,this.pagePtr.sepColorPtr=m,g.next=8,o.sendWithPromise("GetColorsList",r);case 8:this.colorList=g.sent,f.dispatch("colorSeparationUpdate",this.colorList),!this.documentViewer.colorList.length&&this.colorList.length&&(this.documentViewer.colorList=this.colorList,setTimeout(function(){f.dispatch("colorSeparationAdded",w.colorList)},100));case 11:case"end":return g.stop()}},e,this)}))}},{key:"destroy",value:function(){this.documentViewer.eventBus._off("updateSeparationView",this.onUpdateCanvas),document.removeEventListener("mousemove",this.onMousemove)}},{key:"handleMouseMove",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s;return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(this.documentViewer.doc===this.pagePtr.doc){m.next=2;break}return m.abrupt("return");case 2:if(this.testPoint(e)){m.next=7;break}return!this.isClearData&&this.documentViewer.eventBus.dispatch("colorSeparationUpdate",this.colorList),this.isClearData=!0,m.abrupt("return");case 7:if(o=getAbsoluteCoordinate(this.container,e),r=o.x,f=o.y,s=getInitialPoint$1({x:r,y:f},this.pageViewer.viewport.scale),this.latestRequestPoint=s,!this.isRequestInProgress){m.next=12;break}return m.abrupt("return");case 12:return m.next=14,this.processLatestRequest();case 14:case"end":return m.stop()}},n,this)}))}},{key:"handleClick",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f;return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:o=getAbsoluteCoordinate(this.container,e),r=o.x,f=o.y,getInitialPoint$1({x:r,y:f},this.pageViewer.viewport.scale);case 2:case"end":return s.stop()}},n,this)}))}},{key:"getSelectPointColor",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f;return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.documentViewer.messageHandler.sendWithPromise("GetSelectPointColor",{pagePtr:this.pagePtr.pagePtr,sepColorPtr:this.pagePtr.sepColorPtr,point:e});case 2:if(!(o=s.sent).length){s.next=12;break}return r=this.colorList.map(function(m){return Object.assign({},m)}),f=[],o.forEach(function(m){r[m.Index].intensity=m.ColorIntensity,f.push({name:r[m.Index].name,value:m.ColorIntensity})}),this.documentViewer.eventBus.dispatch("colorSeparationUpdate",r),this.isClearData=!1,s.abrupt("return",f);case 12:return this.isClearData||this.documentViewer.eventBus.dispatch("colorSeparationUpdate",this.colorList),this.isClearData=!0,s.abrupt("return",o);case 15:case"end":return s.stop()}},n,this)}))}},{key:"updateCanvas",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v,d,u,y;return _regeneratorRuntime().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(this.pageViewer.canvas){x.next=2;break}return x.abrupt("return");case 2:return r=window.devicePixelRatio||1,f=this.pageViewer.viewport,s=f.width,m=f.height,w=Math.round(s*r),g=Math.round(m*r),x.next=8,this.documentViewer.messageHandler.sendWithPromise("RenderPageAndIgnoreColorByIndex",{sepColorPtr:this.pagePtr.sepColorPtr,width:w,height:g,indexs:e});case 8:if(v=x.sent,d=v.imageArray,u=(o=this.pageViewer.canvas)===null||o===void 0?void 0:o.getContext("2d")){x.next=13;break}return x.abrupt("return");case 13:u.clearRect(0,0,w,g),(y=u.createImageData(w,g)).data.set(d),u.putImageData(y,0,0),this.documentViewer.eventBus.dispatch("redrawMarkups",{pageIndex:this.pageViewer.pageIndex,isRestorePage:!1}),this.documentViewer.eventBus.dispatch("finishUpdateSeparationView");case 19:case"end":return x.stop()}},n,this)}))}},{key:"testPoint",value:function(e){var n=getAbsoluteCoordinate(this.container,e),o=n.x,r=n.y,f=n.width,s=n.height;return!(o<0||r<0||o>f||r>s)&&{x:o,y:r}}},{key:"processLatestRequest",value:function(){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function e(){var n;return _regeneratorRuntime().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.isRequestInProgress=!0,!(n=this.latestRequestPoint)){o.next=11;break}return o.prev=3,o.next=6,this.getSelectPointColor(n);case 6:o.next=11;break;case 8:o.prev=8,o.t0=o.catch(3),console.error("\u8BF7\u6C42\u51FA\u9519:",o.t0);case 11:this.isRequestInProgress=!1;case 12:case"end":return o.stop()}},e,this,[[3,8]])}))}}])}(),MAX_CANVAS_PIXELS=maxCanvasPixels,_previousRotation=new WeakMap,_useThumbnailCanvas=new WeakMap,_PDFPageView_brand=new WeakSet,PDFPageView=function(){return _createClass(function s(m){var w;_classCallCheck(this,s),_classPrivateMethodInitSpec(this,_PDFPageView_brand),_classPrivateFieldInitSpec(this,_previousRotation,null),_classPrivateFieldInitSpec(this,_useThumbnailCanvas,{initialOptionalContent:!0,regularAnnotations:!0}),_defineProperty$1(this,"_activeSearch",null),this.documentViewer=m.documentViewer,this._loadingId=null;var g=m.container,v=m.defaultViewport;this.id=m.id,this.pageIndex=m.pageIndex,this.renderingId="page"+this.id,this.layerProperties=m.layerProperties,this.doc=m.doc,this.messageHandler=m.messageHandler,this.pagesPtr=m.pagesPtr,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.annotationStore=m.annotationStore,this.tool="",this.color="",this.toolMode="",this.enableReply=m.enableReply,this.scale=m.scale||DEFAULT_SCALE,this.viewport=v,this.pdfPageRotate=v.rotation,this.hasRestrictedScaling=!1,this.textLayerMode=(w=m.textLayerMode)!==null&&w!==void 0?w:TextLayerMode.ENABLE,this.imageResourcesPath=m.imageResourcesPath||"",this.useOnlyCssZoom=m.useOnlyCssZoom||!1,this.isOffscreenCanvasSupported=!0,this.maxCanvasPixels=m.maxCanvasPixels||MAX_CANVAS_PIXELS,this.pageColors=m.pageColors||null,this.eventBus=m.eventBus,this._annotations=m.annotations,this._annotationsAll=m.annotationsAll,this.pagesPtr=m.pagesPtr,(typeof PDFJSDev>"u"||PDFJSDev.test("!PRODUCTION || GENERIC"))&&(this.renderer=m.renderer||RendererType.CANVAS),this.l10n=m.l10n,this.paintTask=null,this.paintedViewportMap=new WeakMap,this._renderingState=RenderingStates$1.INITIAL,this.resume=null,this._renderError=null,this._annotationCanvasMap=null,this.annotationLayer=null,this.compdfAnnotationLayer=null,this.annotationEditorLayer=null,this.textSelect=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null,this.contentContainer=null,this.textSelection=null,this.textSearch=null,this.searchResults=null,this.cropPage=null,this.separation=null;var d=document.createElement("div");d.className="page page-number"+this.id,d.setAttribute("data-page-number",this.id),d.setAttribute("role","region"),this.pagePressHandle=this.pagePressHandle.bind(this),d.addEventListener("click",this.pagePressHandle),this.div=d,_assertClassBrand(_PDFPageView_brand,this,_setDimensions).call(this),g==null||g.append(d),this.selected=m.selected,this.$t=m.$t,this.eventBus._on("toolChanged",this.handleTool.bind(this)),this.eventBus._on("toolModeChanged",this.handleToolMode.bind(this)),this.eventBus._on("search",this.handleSearch.bind(this)),this.mode=null,this.contentEditHistoryManager=m.contentEditHistoryManager,g==null||g.style.setProperty("--scale-factor",this.scale*PixelsPerInch.PDF_TO_CSS_UNITS)},[{key:"pagePressHandle",value:(f=_asyncToGenerator(_regeneratorRuntime().mark(function s(m){var w,g,v,d,u,y,x,k,P,S,E,M,T,D,N,F,O,I,X,ne;return _regeneratorRuntime().wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:if(w=m.currentTarget,g=this.id,v=this.pageIndex,g&&(d=document.getElementById("sign-image-save"))){if(u=d.getAttribute("src"),y=w.getBoundingClientRect(),x=d.getBoundingClientRect(),k=x.x-y.x,P=x.y-y.y,S=k+d.width,E=P+d.height,M=k/this.scale,T=P/this.scale,D=S/this.scale,N=E/this.scale,F=null,d.inkPath){for(O=[],I=0;I<d.inkPath.length;I++){for(X=[],ne=0;ne<d.inkPath[I].length;ne++)X.push({PointX:d.inkPath[I][ne].x/this.scale+M,PointY:T+d.inkPath[I][ne].y/this.scale});O.push(X)}F={operate:"add-annot",type:"ink",pageIndex:v,inkPointes:O,rect:{left:M,top:T,right:D,bottom:N},targetPage:g,borderWidth:d.inkParam.width||1,borderColor:d.inkParam.color||"#000",date:new Date,name:v4()}}else F={operate:"add-annot",type:"stamp",stampType:"image",pageIndex:v,imageBase64:u,rect:{left:M,top:T,right:D,bottom:N},targetPage:g,date:new Date,name:v4()};F&&this.eventBus.dispatch("createSignature",F),d.remove(),document.querySelector(".content").onmousemove=null}case 4:case"end":return ye.stop()}},s,this)})),function(s){return f.apply(this,arguments)})},{key:"handleTool",value:function(s){var m=s.tool,w=s.color;this.cropPage&&(m==="cropPage"?this.cropPage.init():this.cropPage.reset()),this.compdfAnnotationLayer||(this.tool=m,this.color=w)}},{key:"handleToolMode",value:(r=_asyncToGenerator(_regeneratorRuntime().mark(function s(m){var w;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(w=this.mode,this.mode=m,this.toolMode=m,!this.contentContainer){g.next=10;break}if(m!=="editor"){g.next=9;break}return g.next=7,this.contentContainer.init();case 7:g.next=10;break;case 9:this.contentContainer.destroy();case 10:this.separation&&(w!=="separation"&&m==="separation"?(this.separation.init(),document.querySelector(".document").classList.add("color-separation")):w==="separation"&&m!=="separation"&&(this.separation.destroy(),document.querySelector(".document").classList.remove("color-separation")));case 11:case"end":return g.stop()}},s,this)})),function(s){return r.apply(this,arguments)})},{key:"handleSearch",value:function(s,m){this.searchResults=s,this.textSearch&&(this.textSearch.color=m||"rgba(255, 255, 0, 0.25)",this.textSearch.searchResults=s)}},{key:"annotations",get:function(){return this._annotations},set:function(s){this._annotations=s,this.compdfAnnotationLayer&&(this.compdfAnnotationLayer.annotations=this.annotations)}},{key:"annotationsAll",get:function(){return this._annotationsAll},set:function(s){this._annotationsAll=s,this.compdfAnnotationLayer&&(this.compdfAnnotationLayer.annotationsAll=this.annotationsAll)}},{key:"renderingState",get:function(){return this._renderingState},set:function(s){var m=this;if(s!==this._renderingState)switch(this._renderingState=s,this._loadingId&&(clearTimeout(this._loadingId),this._loadingId=null),s){case RenderingStates$1.PAUSED:this.div.classList.remove("loading");break;case RenderingStates$1.RUNNING:this.div.classList.add("loadingIcon"),this._loadingId=setTimeout(function(){m.div.classList.add("loading"),m._loadingId=null},0);break;case RenderingStates$1.INITIAL:case RenderingStates$1.FINISHED:this.div.classList.remove("loadingIcon","loading")}}},{key:"selectedText",get:function(){if(!this.textSelection)return null;var s=this.textSelection._selection;return s?s.textContent:null}},{key:"selectedTextQuads",get:function(){var s=this.textSelection;return s&&s._selection?{textQuads:s.rects,rect:s.rect,pageIndex:this.pageIndex}:null}},{key:"setPdfPage",value:function(s){this.pdfPage=s,this.pdfPageRotate=s.rotate;var m=(this.rotation+this.pdfPageRotate)%360;this.viewport=s.getViewport({scale:this.scale*PixelsPerInch.PDF_TO_CSS_UNITS,rotation:m}),_assertClassBrand(_PDFPageView_brand,this,_setDimensions).call(this),this.reset()}},{key:"destroy",value:function(){var s;this.reset(),(s=this.pdfPage)===null||s===void 0||s.cleanup()}},{key:"clearSearchResults",value:function(){this.searchResults=null,this.textSearch&&this.textSearch.destroy()}},{key:"_renderAnnotationLayer",value:(o=_asyncToGenerator(_regeneratorRuntime().mark(function s(){var m;return _regeneratorRuntime().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return m=null,w.prev=1,w.next=4,this.annotationLayer.render(this.viewport,"display");case 4:w.next=10;break;case 6:w.prev=6,w.t0=w.catch(1),console.error('_renderAnnotationLayer: "'.concat(w.t0,'".')),m=w.t0;case 10:return w.prev=10,this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:m}),w.finish(10);case 13:case"end":return w.stop()}},s,this,[[1,6,10,13]])})),function(){return o.apply(this,arguments)})},{key:"emptyAnnotations",value:function(){this.compdfAnnotationLayer&&this.compdfAnnotationLayer.emptyAnnotations()}},{key:"_renderAnnotationEditorLayer",value:function(){this.annotationEditorLayer.render(this.viewport,"display")}},{key:"selectAnnotation",value:function(s){var m=this;s.name&&(this.annotationStore.toSelectAnnotationName=s.name);var w=this.compdfAnnotationLayer;if(w){var g=w.annotationsArray,v=g.findIndex(function(u){return u.annotation.name===m.annotationStore.toSelectAnnotationName});if(this.annotationStore.selectedElementName){var d=g.findIndex(function(u){return u.annotation.name===m.annotationStore.selectedElementName});d>-1&&w.annotationsArray[d].handleOutside()}v>-1&&(w.annotationsArray[v].selectAnnotation(),this.annotationStore.toSelectAnnotationName=null)}}},{key:"deselectAnnotation",value:function(s){var m=this.annotationStore.selectedElementName;s.name===m&&this.getAnnotationWithName(s.name).handleOutside()}},{key:"getAnnotationWithName",value:function(s){var m=this.compdfAnnotationLayer;if(m){var w=m.annotationsArray.findIndex(function(g){return g.annotation.name===s});return w>-1?m.annotationsArray[w]:void 0}}},{key:"finishRenderTask",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(this.renderTask=null,this._renderError=s,this.renderingState=RenderingStates$1.FINISHED,this._resetZoomLayer(!0),this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:this._renderError}),s)throw s}},{key:"_resetZoomLayer",value:function(){var s=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(this.zoomLayer){var m=this.zoomLayer.firstChild;this.paintedViewportMap.delete(m),m.width=0,m.height=0,s&&this.zoomLayer.remove(),this.zoomLayer=null}}},{key:"reset",value:function(){var s,m,w,g,v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=v.keepZoomLayer,u=d!==void 0&&d,y=v.keepAnnotationLayer,x=y!==void 0&&y,k=v.keepAnnotationEditorLayer,P=k!==void 0&&k,S=v.keepXfaLayer,E=S!==void 0&&S,M=v.keepTextLayer,T=M!==void 0&&M;this.cancelRendering({keepAnnotationLayer:x,keepAnnotationEditorLayer:P,keepXfaLayer:E,keepTextLayer:T}),this.renderingState=RenderingStates$1.INITIAL;for(var D,N=this.div,F=N.childNodes,O=u&&this.zoomLayer||null,I=x&&((s=this.annotationLayer)===null||s===void 0?void 0:s.div)||null,X=P&&((m=this.annotationEditorLayer)===null||m===void 0?void 0:m.div)||null,ne=T&&((w=this.textLayer)===null||w===void 0?void 0:w.div)||null,ye=F.length-1;ye>=0;ye--){var J=F[ye];switch(J){case O:case ne:case I:case X:continue}J.remove()}N.removeAttribute("data-loaded"),I&&this.annotationLayer.hide(),X?this.annotationEditorLayer.hide():(D=this.annotationEditorLayer)===null||D===void 0||D.destroy(),ne&&this.textLayer.hide(),(g=this.structTreeLayer)===null||g===void 0||g.hide(),O||(this.canvas&&(this.paintedViewportMap.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer())}},{key:"update",value:function(s){var m,w=s.scale,g=w===void 0?0:w,v=s.rotation,d=v===void 0?null:v,u=s.drawingDelay,y=u===void 0?-1:u;this.scale=g||this.scale,typeof d=="number"&&(this.rotation=d);var x=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:this.scale*PixelsPerInch.PDF_TO_CSS_UNITS,rotation:x}),_assertClassBrand(_PDFPageView_brand,this,_setDimensions).call(this),(m=this.div.parentNode)===null||m===void 0||m.style.setProperty("--scale-factor",this.viewport.scale);var k=y>=0&&y<1e3;if(this.canvas){if(k||this.useOnlyCssZoom||this.hasRestrictedScaling&&isScalingRestricted)return k&&this.renderingState!==RenderingStates$1.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:y}),this.renderingState=RenderingStates$1.FINISHED),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!k,hideTextLayer:k}),this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError}),void this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0});this.zoomLayer||this.canvas.hidden||(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}},{key:"cancelRendering",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},m=s.keepAnnotationLayer,w=m!==void 0&&m,g=s.keepAnnotationEditorLayer,v=g!==void 0&&g,d=s.cancelExtraDelay,u=d===void 0?0:d;this.paintTask&&(this.paintTask.cancel(u),this.paintTask=null),this.resume=null,this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),!this.annotationLayer||w&&this.annotationLayer.div||(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.compdfAnnotationLayer&&(this.compdfAnnotationLayer.cancel(),this.compdfAnnotationLayer=null),!this.annotationEditorLayer||v&&this.annotationEditorLayer.div||(this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.contentContainer&&this.contentContainer.cancel(),this.textSelection&&(this.textSelection.destroy(),this.textSelection=null),this.textSearch&&(this.textSearch.destroy(),this.textSearch=null),this.separation&&(this.separation.destroy(),this.separation=null)}},{key:"cssTransform",value:function(s){var m=s.target,w=s.redrawAnnotationLayer,g=w!==void 0&&w,v=s.redrawAnnotationEditorLayer,d=v!==void 0&&v;s.redrawXfaLayer;var u=s.redrawTextLayer,y=u!==void 0&&u,x=s.hideTextLayer,k=x!==void 0&&x;if(m instanceof HTMLCanvasElement)m.hasAttribute("zooming")||m.setAttribute("zooming",!0);else{var P=this.div,S=this.viewport,E=S.width,M=S.height;m.style.width=m.parentNode.style.width=P.style.width=Math.floor(E)+"px",m.style.height=m.parentNode.style.height=P.style.height=Math.floor(M)+"px"}var T,D=this.paintedViewportMap.get(m);if(this.viewport!==D){var N=this.viewport.rotation-D.rotation,F=Math.abs(N),O=1,I=1;if(F===90||F===270){var X=this.viewport,ne=X.width,ye=X.height;O=ye/ne,I=ne/ye}F!==0&&(m.style.transform="rotate(".concat(N,"deg) scale(").concat(O,", ").concat(I,")"))}g&&this.annotationLayer&&this._renderAnnotationLayer(),d&&this.annotationEditorLayer&&this._renderAnnotationEditorLayer(),this.textLayer&&(k?(this.textLayer.hide(),(T=this.structTreeLayer)===null||T===void 0||T.hide()):y&&_assertClassBrand(_PDFPageView_brand,this,_renderTextLayer).call(this))}},{key:"width",get:function(){return this.viewport.width}},{key:"height",get:function(){return this.viewport.height}},{key:"getPagePoint",value:function(s,m){return this.viewport.convertToPdfPoint(s,m)}},{key:"addTextEditor",value:(n=_asyncToGenerator(_regeneratorRuntime().mark(function s(m){var w,g,v,d;return _regeneratorRuntime().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.contentContainer){u.next=5;break}return w=this.div,g=this.annotationStore,v=this.annotations,d=this.annotationsAll,this.contentContainer=new ContentContainer({annotationStore:g,pageViewer:this,annotations:v,annotationsAll:d,viewport:this.viewport,scale:this.scale,pageIndex:this.pageIndex,pageDiv:w,eventBus:this.eventBus,selected:this.selected,pagePtr:this.pagesPtr[this.pageIndex].pagePtr,rotation:this.pagesPtr[this.pageIndex].rotation,messageHandler:this.messageHandler,$t:this.$t,contentEditHistoryManager:this.contentEditHistoryManager}),u.next=5,this.contentContainer.init();case 5:return u.abrupt("return",this.contentContainer.addTextEditor(m));case 6:case"end":return u.stop()}},s,this)})),function(s){return n.apply(this,arguments)})},{key:"getEditAnnotation",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function s(){var m,w,g,v;return _regeneratorRuntime().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(this.contentContainer){d.next=5;break}return m=this.div,w=this.annotationStore,g=this.annotations,v=this.annotationsAll,this.contentContainer=new ContentContainer({annotationStore:w,pageViewer:this,annotations:g,annotationsAll:v,viewport:this.viewport,scale:this.scale,pageIndex:this.pageIndex,pageDiv:m,eventBus:this.eventBus,selected:this.selected,pagePtr:this.pagesPtr[this.pageIndex].pagePtr,rotation:this.pagesPtr[this.pageIndex].rotation,messageHandler:this.messageHandler,$t:this.$t,contentEditHistoryManager:this.contentEditHistoryManager}),d.next=5,this.contentContainer.init();case 5:return d.abrupt("return",this.contentContainer);case 6:case"end":return d.stop()}},s,this)})),function(){return e.apply(this,arguments)})},{key:"draw",value:function(){var s=this;this.renderingState!==RenderingStates$1.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());var m=this.div,w=this.pdfPage,g=this.annotations,v=this.annotationsAll;if(!w)return this.renderingState=RenderingStates$1.FINISHED,Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=RenderingStates$1.RUNNING;var d=null;this.zoomLayer||((d=document.createElement("div")).classList.add("canvasWrapper"),m.append(d),this.zoomLayer=d),d=this.zoomLayer,this.canvas&&this.viewport;var u=function(){var k=_asyncToGenerator(_regeneratorRuntime().mark(function P(){var S,E=arguments;return _regeneratorRuntime().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(S=E.length>0&&E[0]!==void 0?E[0]:null,y===s.paintTask&&(s.paintTask=null),!(S instanceof pdfExports.RenderingCancelledException)){M.next=5;break}return s._renderError=null,M.abrupt("return");case 5:if(s._renderError=S,s.renderingState=RenderingStates$1.FINISHED,_classPrivateFieldGet2(_useThumbnailCanvas,s).regularAnnotations=!y.separateAnnots,s.eventBus.dispatch("pagerendered",{source:s,pageNumber:s.id,cssTransform:!1,timestamp:performance.now(),error:s._renderError}),!S){M.next=11;break}throw S;case 11:case"end":return M.stop()}},P)}));return function(){return k.apply(this,arguments)}}(),y=this.paintOnCanvas(d);y.onRenderContinue=null,this.paintTask=y;var x=y.promise.then(function(){return u(null).then(_asyncToGenerator(_regeneratorRuntime().mark(function k(){var P,S,E,M;return _regeneratorRuntime().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(_assertClassBrand(_PDFPageView_brand,s,_renderTextLayer).call(s),!s.annotationLayer){T.next=4;break}return T.next=4,s._renderAnnotationLayer();case 4:if(s.annotationEditorLayer){T.next=9;break}if(S=s.layerProperties(),E=S.annotationEditorUIManager,M=S.annotationStorage,E){T.next=8;break}return T.abrupt("return");case 8:s.annotationEditorLayer=new PDFAnnotationLayer({uiManager:E,annotationStorage:M,pageIndex:s.pageIndex,pageDiv:m,viewport:s.viewport,scale:s.scale,annotations:g,accessibilityManager:s._accessibilityManager});case 9:if(s._renderAnnotationEditorLayer(),s.compdfAnnotationLayer?s.compdfAnnotationLayer.destroy():s.compdfAnnotationLayer=new ComPDFAnnotationLayer({documentViewer:s.documentViewer,annotationStore:s.annotationStore,messageHandler:s.messageHandler,pageViewer:s,annotations:g,annotationsAll:v,viewport:s.viewport,scale:s.scale,pageIndex:s.pageIndex,pageDiv:m,eventBus:s.eventBus,selected:s.selected,enableReply:s.enableReply,$t:s.$t}),s.compdfAnnotationLayer.render(s.viewport),s.contentContainer){T.next=17;break}s.contentContainer=new ContentContainer({annotationStore:s.annotationStore,pageViewer:s,annotations:g,annotationsAll:v,viewport:s.viewport,scale:s.scale,pageIndex:s.pageIndex,pageDiv:m,eventBus:s.eventBus,selected:s.selected,pagePtr:s.pagesPtr[s.pageIndex].pagePtr,rotation:s.pagesPtr[s.pageIndex].rotation,messageHandler:s.messageHandler,$t:s.$t,contentEditHistoryManager:s.contentEditHistoryManager}),s.mode==="editor"&&s.contentContainer.init(),T.next=20;break;case 17:if(s.mode!=="editor"){T.next=20;break}return T.next=20,s.contentContainer.render();case 20:if(!s.contentContainer||s.contentContainer.pagePtr===s.pagesPtr[s.pageIndex].pagePtr){T.next=24;break}return s.contentContainer.pagePtr=s.pagesPtr[s.pageIndex].pagePtr,T.next=24,s.contentContainer.update();case 24:s.textSelection||(s.textSelection=new TextSelection({documentViewer:s.documentViewer,viewport:s.viewport,scale:s.scale,pageIndex:s.pageIndex,container:m,eventBus:s.eventBus,selected:s.selected,pagePtr:s.pagesPtr[s.pageIndex],messageHandler:s.messageHandler,tool:s.tool,toolMode:s.toolMode,color:s.color,pageViewer:s})),s.textSearch||(s.textSearch=new TextSearch({viewport:s.viewport,scale:s.scale,pageIndex:s.pageIndex,container:m,results:s.searchResults}),s._activeSearch&&s.textSearch.setActiveSearchResult(s._activeSearch)),(P=s.cropPage)!==null&&P!==void 0&&P.cropping&&s.cropPage.draw(),s.cropPage?s.cropPage.updateInitialProps():s.cropPage=new CropPage({viewport:s.viewport,scale:s.scale,pageIndex:s.pageIndex,container:m,eventBus:s.eventBus,selected:s.selected,pagePtr:s.pagesPtr[s.pageIndex],messageHandler:s.messageHandler,tool:s.tool,toolMode:s.toolMode,color:s.color,pageViewer:s,annotationStore:s.annotationStore}),s.tool==="cropPage"&&s.cropPage.init();case 29:case"end":return T.stop()}},k)})))},function(k){return u(k)});return m.setAttribute("data-loaded",!0),x}},{key:"paintOnCanvas",value:function(s){var m=this,w=pdfExports.createPromiseCapability(),g={promise:w.promise,onRenderContinue:function(E){E()},cancel:function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;S.cancel(E)},get separateAnnots(){return S.separateAnnots}},v=window.devicePixelRatio||1;this.radio=v;var d=this.viewport,u=d.width,y=d.height,x=d.scale,k=Math.ceil(u*v),P=Math.ceil(y*v),S=new PromiseExt;return S.cancel=function(){},S.resolve(),S.promise.then(_asyncToGenerator(_regeneratorRuntime().mark(function E(){var M,T,D,N,F,O,I,X,ne,ye,J,te;return _regeneratorRuntime().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:if(M=null,m.separation){q.next=7;break}if(m.separation=new Separation({documentViewer:m.documentViewer,container:m.div,pagePtr:m.pagesPtr[m.pageIndex],pageViewer:m}),q.t0=m.mode==="separation",!q.t0){q.next=7;break}return q.next=7,m.separation.init();case 7:if(T={x1:0,y1:0,x2:k,y2:P,width:k,height:P},m.documentViewer.scale>m.documentViewer.maxViewportZoom&&(D=m.documentViewer.getVisibleRegionRect(0,0),T=m.documentViewer.calculatePageVisibility(m.pageIndex+1,D)),m.toolMode!=="separation"||!m.annotationStore.ignoreColors.length){q.next=15;break}return q.next=12,m.messageHandler.sendWithPromise("RenderPageAndIgnoreColorByIndex",{sepColorPtr:m.pagesPtr[m.pageIndex].sepColorPtr,x:T.x1,y:T.y1,width:T.width,height:T.height,indexs:m.annotationStore.ignoreColors});case 12:M=q.sent,q.next=24;break;case 15:if(!m.documentViewer.renderLayerPermission||!m.documentViewer.layers.length){q.next=21;break}return q.next=18,m.messageHandler.sendWithPromise("RenderLayerBitmapWithMatrix",{pagePtr:m.pagesPtr[m.pageIndex].pagePtr,left:T.x1,top:T.y1,right:T.x2,bottom:T.y2,scale:x*v,ocgsPtr:_toConsumableArray$1(m.documentViewer.ocgsPtr)});case 18:M=q.sent,q.next=24;break;case 21:return q.next=23,m.messageHandler.sendWithPromise("PushRenderTask",{pagePtr:m.pagesPtr[m.pageIndex].pagePtr,left:T.x1,top:T.y1,right:T.x2,bottom:T.y2,scale:x*v});case 23:M=q.sent;case 24:if(!M||!M.code){q.next=28;break}return m.eventBus.dispatch("message",{type:"ERROR",message:M.message}),console.log(M.message),q.abrupt("return");case 28:(N=document.createElement("canvas")).setAttribute("role","presentation"),m.canvas=N,F="calc(var(--scale-factor) * ".concat(T.width/(v*x),"px)"),O="calc(var(--scale-factor) * ".concat(T.height/(v*x),"px)"),I="calc(var(--scale-factor) * ".concat(T.x1/(v*x),"px)"),X="calc(var(--scale-factor) * ".concat(T.y1/(v*x),"px)"),ne=N.getContext("2d"),(ye=N.style).width=F,ye.height=O,ye.position="absolute",ye.left=I,ye.top=X,m.paintedViewportMap.set(N,d),J=M.imageArray,N.width=T.width,N.height=T.height,(te=ne.createImageData(T.width,T.height)).data.set(J),ne.putImageData(te,0,0),m.baseImageData=te,s.children[0]&&s.removeChild(s.children[0]),s.append(N),w.resolve();case 53:case"end":return q.stop()}},E)})),function(E){console.log(E),E instanceof pdfExports.RenderingCancelledException||showCanvas(),w.reject(E)}),g}},{key:"setActiveSearchResult",value:function(s){this._activeSearch=s,this.textSearch&&this.textSearch.setActiveSearchResult(s)}},{key:"clearActiveSearchResult",value:function(s){this._activeSearch=null,this.textSearch&&this.textSearch.clearActiveSearchResult(s)}},{key:"setPageLabel",value:function(s){this.pageLabel=typeof s=="string"?s:null,this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}},{key:"thumbnailCanvas",get:function(){return this.canvas}},{key:"fontFile",get:function(){return this._fontFile},set:function(s){this._fontFile=s}},{key:"redrawCanvas",value:function(){var s=this;this.renderingState=RenderingStates$1.RUNNING;var m=pdfExports.createPromiseCapability(),w={promise:m.promise,onRenderContinue:function(S){S()},cancel:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;P.cancel(S)},get separateAnnots(){return P.separateAnnots}},g=window.devicePixelRatio||1;this.radio=g;var v=this.viewport,d=v.width,u=v.height,y=v.scale,x=Math.round(d*g),k=Math.round(u*g),P=new PromiseExt;return P.cancel=function(){},P.resolve(),P.promise.then(_asyncToGenerator(_regeneratorRuntime().mark(function S(){var E,M,T,D,N,F,O,I;return _regeneratorRuntime().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:if(E=null,M={x1:0,y1:0,x2:x,y2:k,width:x,height:k},s.documentViewer.scale>s.documentViewer.maxViewportZoom&&(T=s.documentViewer.getVisibleRegionRect(0,0),M=s.documentViewer.calculatePageVisibility(s.pageIndex+1,T)),s.toolMode!=="separation"||!s.annotationStore.ignoreColors.length){X.next=9;break}return X.next=6,s.messageHandler.sendWithPromise("RenderPageAndIgnoreColorByIndex",{sepColorPtr:s.pagesPtr[s.pageIndex].sepColorPtr,x:M.x1,y:M.y1,width:M.width,height:M.height,indexs:s.annotationStore.ignoreColors});case 6:E=X.sent,X.next=18;break;case 9:if(!s.documentViewer.renderLayerPermission||!s.documentViewer.layers.length){X.next=15;break}return X.next=12,s.messageHandler.sendWithPromise("RenderLayerBitmapWithMatrix",{pagePtr:s.pagesPtr[s.pageIndex].pagePtr,left:M.x1,top:M.y1,right:M.x2,bottom:M.y2,scale:y*g,ocgsPtr:_toConsumableArray$1(s.documentViewer.ocgsPtr)});case 12:E=X.sent,X.next=18;break;case 15:return X.next=17,s.messageHandler.sendWithPromise("PushRenderTask",{pagePtr:s.pagesPtr[s.pageIndex].pagePtr,left:M.x1,top:M.y1,right:M.x2,bottom:M.y2,scale:y*g});case 17:E=X.sent;case 18:if(!E||!E.code){X.next=22;break}return s.eventBus.dispatch("message",{type:"ERROR",message:E.message}),console.log(E.message),X.abrupt("return");case 22:D=s.canvas,N=D.getContext("2d"),(F=D.style).width=Math.round(d)+"px",F.height=Math.round(u)+"px",s.paintedViewportMap.set(D,v),O=E.imageArray,D.width=x,D.height=k,(I=N.createImageData(x,k)).data.set(O),N.putImageData(I,0,0),s.baseImageData=I,s.eventBus.dispatch("redrawMarkups",{pageIndex:s.pageIndex,isRestorePage:!1}),m.resolve(),s.renderingState=RenderingStates$1.FINISHED;case 38:case"end":return X.stop()}},S)})),function(S){console.log(S),m.reject(S)}),w}}]);var e,n,o,r,f}();function _setDimensions(){var e=this.viewport;if(this.pdfPage){if(_classPrivateFieldGet2(_previousRotation,this)===e.rotation)return;_classPrivateFieldSet2(_previousRotation,this,e.rotation)}pdfExports.setLayerDimensions(this.div,e,!0,!1)}function _renderTextLayer(){return _renderTextLayer2.apply(this,arguments)}function _renderTextLayer2(){return(_renderTextLayer2=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var n,o,r,f,s;return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(n=this.pdfPage,o=this.textLayer,r=this.viewport,o){m.next=3;break}return m.abrupt("return");case 3:return f=null,m.prev=4,o.renderingDone||(s=n.streamTextContent({includeMarkedContent:!0}),o.setTextContentSource(s)),m.next=8,o.render(r);case 8:m.next=16;break;case 10:if(m.prev=10,m.t0=m.catch(4),!(m.t0 instanceof pdfExports.AbortException)){m.next=14;break}return m.abrupt("return");case 14:console.error('#renderTextLayer: "'.concat(m.t0,'".')),f=m.t0;case 16:this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.id,numTextDivs:o.numTextDivs,error:f});case 17:case"end":return m.stop()}},e,this,[[4,10]])}))).apply(this,arguments)}var ContentEditHistoryManager=function(){return _createClass(function s(m){_classCallCheck(this,s),this.messageHandler=m.messageHandler,this.eventBus=m.eventBus,this.pdfViewer=m.pdfViewer,this.undoList=[],this.redoList=[],this.eventBus._on("toolModeChanged",this.handleToolMode.bind(this))},[{key:"canRedo",value:(f=_asyncToGenerator(_regeneratorRuntime().mark(function s(m){var w;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(m){g.next=2;break}return g.abrupt("return",this.redoList.length>0);case 2:if(m.editPagePtr){g.next=4;break}return g.abrupt("return",!1);case 4:return g.next=6,this.messageHandler.sendWithPromise("CanRedo",m.editPagePtr);case 6:return w=g.sent,g.abrupt("return",!!w);case 8:case"end":return g.stop()}},s,this)})),function(s){return f.apply(this,arguments)})},{key:"canUndo",value:(r=_asyncToGenerator(_regeneratorRuntime().mark(function s(m){var w;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(m){g.next=2;break}return g.abrupt("return",this.undoList.length>0);case 2:if(m.editPagePtr){g.next=4;break}return g.abrupt("return",!1);case 4:return g.next=6,this.messageHandler.sendWithPromise("CanUndo",m.editPagePtr);case 6:return w=g.sent,g.abrupt("return",!!w);case 8:case"end":return g.stop()}},s,this)})),function(s){return r.apply(this,arguments)})},{key:"redo",value:(o=_asyncToGenerator(_regeneratorRuntime().mark(function s(){var m,w;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(m=this.redoList.pop()){g.next=4;break}return console.warn("No actions to redo"),g.abrupt("return",!1);case 4:return g.next=6,this.messageHandler.sendWithPromise("Redo",m.editPagePtr);case 6:w=g.sent,this.undoList.push(m),this.updateView(m.pageIndex,w),this.eventBus.dispatch("undoRedoStatusChanged");case 10:case"end":return g.stop()}},s,this)})),function(){return o.apply(this,arguments)})},{key:"undo",value:(n=_asyncToGenerator(_regeneratorRuntime().mark(function s(){var m,w;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(m=this.undoList.pop()){g.next=4;break}return console.warn("No actions to undo"),g.abrupt("return",!1);case 4:return g.next=6,this.messageHandler.sendWithPromise("Undo",m.editPagePtr);case 6:return w=g.sent,g.next=9,this.canRedo(m);case 9:g.sent&&this.redoList.push(m),this.updateView(m.pageIndex,w),this.eventBus.dispatch("undoRedoStatusChanged");case 13:case"end":return g.stop()}},s,this)})),function(){return n.apply(this,arguments)})},{key:"updateView",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function s(m,w){return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,this.pdfViewer._pages[m].contentContainer.updateFrameEditor(w);case 2:this.eventBus.dispatch("changeOperateList",{undoListLength:this.undoList.length,redoListLength:this.redoList.length});case 3:case"end":return g.stop()}},s,this)})),function(s,m){return e.apply(this,arguments)})},{key:"handleToolMode",value:function(s){s!=="editor"&&(this.undoList.length||this.redoList.length)&&(this.undoList.length=0,this.redoList.length=0)}}]);var e,n,o,r,f}(),AreaMeasurementCreateTool=function(){return _createClass(function e(n){var o;_classCallCheck(this,e),this.drawingPageIndex=-1,this.drawingLayer=null,this.realStartPoint=null,this.realEndPoint=null,this.oriStartPoint=null,this.oriEndPoint=null,this.shapeEle=null,this.textEle=null,this.annotation=null,this.onMousedown=this.handleMouseDown.bind(this),this.onMousemove=this.handleMouseMove.bind(this),this.onMouseup=this.handleMouseUp.bind(this),this.handleTool=this.handleTool.bind(this),this.documentViewer=n.documentViewer,this.tool=n.documentViewer.activeTool,this.eventBus=n.documentViewer.eventBus,this.annotationStore=n.annotationStore,this.measureType="area",this.defaults={scale:{base:1,baseUnit:"cm",translate:1,translateUnit:"cm"},precision:.1},this.defaultStyles={borderWidth:2,opacity:1,fillTransparency:1,color:"#FF0000",borderColor:"#FF0000",borderStyle:"solid",dashes:[],fontName:"Helvetica",fontSize:14,fontStyle:"regular",labelPosition:"inside"},this.decimalPlaces=((o=this.defaults.precision.toString().split(".")[1])===null||o===void 0?void 0:o.length)||0,this.showPerimeter=!0,this.showArea=!0,this.eventBus._on("toolChanged",this.handleTool)},[{key:"handleTool",value:function(e){var n=e.tool;e.color,this.tool,this.tool=n}},{key:"init",value:function(){document.removeEventListener("mousedown",this.onMousedown),document.removeEventListener("mousemove",this.onMousemove),document.removeEventListener("mouseup",this.onMouseup),document.addEventListener("mousedown",this.onMousedown),this.documentViewer.viewerContainer.classList.add("annotation-edit")}},{key:"reset",value:function(){this.realStartPoint=null,this.realEndPoint=null,this.oriStartPoint=null,this.oriEndPoint=null,this.shapeEle=null,this.textEle=null,document.removeEventListener("mousedown",this.onMousedown),document.removeEventListener("mousemove",this.onMousemove),document.removeEventListener("mouseup",this.onMouseup),this.documentViewer.viewerContainer.classList.remove("annotation-edit")}},{key:"handleMouseDown",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v;return _regeneratorRuntime().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(e.target.className==="annotationContainer"){d.next=2;break}return d.abrupt("return");case 2:if(o=this.getMouseLocation(e),r=this.documentViewer.getSelectedPage(o,o),!((f=r.first-1)<0)){d.next=7;break}return d.abrupt("return");case 7:if(!(this.annotationStore.selectedElementName&&this.drawingPageIndex<0)){d.next=9;break}return d.abrupt("return");case 9:return s=this.documentViewer.pdfViewer._pages[f].compdfAnnotationLayer,m=getAbsoluteCoordinate(s.pageDiv,e),w=this.documentViewer.windowToPage(o,f+1),this.drawingPageIndex=f,this.drawingLayer=s,this.realStartPoint={x:m.x,y:m.y},this.oriStartPoint={x:w.x,y:w.y},this.oriStartPoint,g=Object.assign(Object.assign({measure:1,operate:"add-annot",type:"polygon",measureType:this.measureType,pageIndex:f,date:new Date},this.defaults),this.defaultStyles),d.next=20,this.documentViewer.annotationManager.createMeasurementAnnotation(g);case 20:v=d.sent,this.annotation=v[0],document.addEventListener("mousemove",this.onMousemove),document.addEventListener("mouseup",this.onMouseup),this.updateMeasureData();case 25:case"end":return d.stop()}},n,this)}))}},{key:"handleMouseMove",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v,d,u,y,x,k,P,S,E,M,T,D;return _regeneratorRuntime().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(!(this.drawingPageIndex<0)){N.next=2;break}return N.abrupt("return");case 2:return f=getAbsoluteCoordinate(this.drawingLayer.pageDiv,e),s=f.x,m=f.y,w=this.drawingLayer.viewport,g=w.width,v=w.height,d=w.scale,s=Math.max(0,Math.min(g,s)),m=Math.max(0,Math.min(v,m)),this.realEndPoint={x:s,y:m},((o=this.realStartPoint)===null||o===void 0?void 0:o.x)===this.realEndPoint.x&&(this.realEndPoint.x+=1),((r=this.realStartPoint)===null||r===void 0?void 0:r.y)===this.realEndPoint.y&&(this.realEndPoint.y+=1),u=getInitialPoint$1({x:s,y:m},d),this.oriEndPoint={x:u.x,y:u.y},y=this.oriStartPoint,x=this.oriEndPoint,k={left:Math.min(y.x,x.x),top:Math.min(y.y,x.y),right:Math.max(y.x,x.x),bottom:Math.max(y.y,x.y)},P=[{x:k.left,y:k.top},{x:k.right,y:k.top},{x:k.right,y:k.bottom},{x:k.left,y:k.bottom}],S={pagePtr:this.annotation.pagePtr,annotPtr:this.annotation.annotPtr,rulerPtr:this.annotation.rulerPtr,pageIndex:this.annotation.pageIndex,rect:k,vertices:P},this.annotation.contents&&(S.contents=this.annotation.contents,S.labelPosition=this.annotation.labelPosition),this.annotation.rect=k,this.annotation.vertices=P,N.next=21,this.documentViewer.annotationManager.editMeasurementAnnotation(S);case 21:return N.next=23,this.getResult();case 23:E=[],this.showPerimeter&&E.push(this.annotation.perimeter+this.defaults.scale.translateUnit),this.showArea&&E.push(this.annotation.area+this.defaults.scale.translateUnit+"\xB2"),this.annotation.contents=E.join(`
2192
2192
  `),this.shapeEle||(this.shapeEle=createSvg("rect",{fill:"none",stroke:this.defaultStyles.borderColor,"stroke-width":2*d,"stroke-opacity":.8}),this.drawingLayer.svgElement.append(this.shapeEle)),this.textEle||(this.textEle=createSvg("text",{fill:this.defaultStyles.color||this.defaultStyles.borderColor,"text-anchor":"middle","dominant-baseline":"middle","font-size":this.defaultStyles.fontSize+"px"}),this.drawingLayer.svgElement.append(this.textEle)),M={x:(this.realStartPoint.x+this.realEndPoint.x)/2-this.annotation.borderWidth,y:(this.realStartPoint.y+this.realEndPoint.y)/2-this.annotation.borderWidth},this.shapeEle.setAttribute("x",Math.min(this.realStartPoint.x,this.realEndPoint.x)-this.annotation.borderWidth),this.shapeEle.setAttribute("y",Math.min(this.realStartPoint.y,this.realEndPoint.y)-this.annotation.borderWidth),this.shapeEle.setAttribute("width","".concat(Math.abs(this.realEndPoint.x-this.realStartPoint.x)+2*this.annotation.borderWidth,"px")),this.shapeEle.setAttribute("height","".concat(Math.abs(this.realEndPoint.y-this.realStartPoint.y)+2*this.annotation.borderWidth,"px")),this.textEle.textContent="",this.showPerimeter&&((T=createSvg("tspan",{x:M.x,y:M.y,dy:"0em"})).textContent=this.annotation.perimeter+this.defaults.scale.translateUnit,this.textEle.appendChild(T)),this.showArea&&((D=createSvg("tspan",{x:M.x,y:M.y,dy:"1em"})).textContent=this.annotation.area+this.defaults.scale.translateUnit+"\xB2",this.textEle.appendChild(D)),this.updateMeasureData();case 38:case"end":return N.stop()}},n,this)}))}},{key:"handleMouseUp",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v,d,u,y,x,k,P,S;return _regeneratorRuntime().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(f=getAbsoluteCoordinate(this.drawingLayer.pageDiv,e),s=f.x,m=f.y,w=this.drawingLayer.viewport,g=w.width,v=w.height,d=w.scale,s=Math.max(0,Math.min(g,s)),m=Math.max(0,Math.min(v,m)),this.realEndPoint={x:s,y:m},this.drawingPageIndex=-1,u=getInitialPoint$1({x:s,y:m},d),this.oriEndPoint={x:u.x,y:u.y},!this.realEndPoint||((o=this.realStartPoint)===null||o===void 0?void 0:o.x)===this.realEndPoint.x||((r=this.realStartPoint)===null||r===void 0?void 0:r.y)===this.realEndPoint.y){E.next=29;break}if(y=this.oriStartPoint,x=this.oriEndPoint,y){E.next=13;break}return E.abrupt("return");case 13:return k={left:Math.min(y.x,x.x),top:Math.min(y.y,x.y),right:Math.max(y.x,x.x),bottom:Math.max(y.y,x.y)},P=[{x:k.left,y:k.top},{x:k.right,y:k.top},{x:k.right,y:k.bottom},{x:k.left,y:k.bottom}],S={pagePtr:this.annotation.pagePtr,annotPtr:this.annotation.annotPtr,rulerPtr:this.annotation.rulerPtr,pageIndex:this.annotation.pageIndex,rect:k,vertices:P,labelPosition:this.annotation.labelPosition,contents:this.annotation.contents},this.annotation.rect=k,this.annotation.vertices=P,this.annotation.showPerimeter=this.showPerimeter,this.annotation.showArea=this.showArea,E.next=22,this.documentViewer.messageHandler.sendWithPromise("GetFactor",this.annotation.rulerPtr);case 22:return this.annotation.factor=E.sent,E.next=25,this.documentViewer.annotationManager.editMeasurementAnnotation(S);case 25:return E.next=27,this.documentViewer.annotationManager.drawAnnotationsFromList(this.annotation);case 27:E.next=30;break;case 29:this.documentViewer.deleteAnnotations(this.annotation);case 30:this.annotation=null,this.realStartPoint=null,this.realEndPoint=null,this.oriStartPoint=null,this.oriEndPoint=null,this.shapeEle=null,this.textEle=null,this.drawingLayer.svgElement.innerHTML="",document.removeEventListener("mousemove",this.onMousemove),document.removeEventListener("mouseup",this.onMouseup),this.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:this.documentViewer.annotations});case 41:case"end":return E.stop()}},n,this)}))}},{key:"destroy",value:function(){this.reset(),this.eventBus._off("toolChanged",this.handleTool)}},{key:"getMouseLocation",value:function(e){var n,o=this.documentViewer.getScrollViewElement(),r=((n=document.querySelector(".document-container"))===null||n===void 0?void 0:n.style.marginLeft)||0;r=parseFloat(r);var f=o.scrollLeft||0,s=o.scrollTop||0,m=getClickPoint(e);return{x:m.pageX+f-r,y:m.pageY+s}}},{key:"getResult",value:function(){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function e(){var n,o,r,f,s=this;return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return n=this.annotation.rulerPtr,m.next=3,this.documentViewer.messageHandler.sendWithPromise("GetMeasurementResult",{rulerPtr:n,captionType:"area"});case 3:return o=m.sent,m.next=6,this.documentViewer.messageHandler.sendWithPromise("GetMeasurementResult",{rulerPtr:n,captionType:"length"});case 6:r=m.sent,f=function(w){return w%1==0?w:Number(w.toFixed(s.decimalPlaces))},this.annotation.area=f(o),this.annotation.perimeter=f(r);case 10:case"end":return m.stop()}},e,this)}))}},{key:"updateMeasureData",value:function(){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function e(){return _regeneratorRuntime().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:this.documentViewer.eventBus.dispatch("updateMeasureData",{scale:this.defaults.scale,precision:this.defaults.precision,perimeter:this.annotation.perimeter||0,area:this.annotation.area||0});case 1:case"end":return n.stop()}},e,this)}))}},{key:"setDefaults",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w=this;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(e.showPerimeter===void 0&&e.showArea===void 0||(this.showPerimeter=(o=e.showPerimeter)!==null&&o!==void 0?o:this.showPerimeter,this.showArea=(r=e.showArea)!==null&&r!==void 0?r:this.showArea),Object.entries(e).forEach(function(v){var d=_slicedToArray(v,2),u=d[0],y=d[1];Object.entries(w.defaults).forEach(function(x){var k,P=_slicedToArray(x,2),S=P[0],E=P[1];u!==S||E===y||["showPerimeter","showArea"].includes(u)||(w.defaults[S]=y,S==="precision"&&(w.decimalPlaces=((k=y.toString().split(".")[1])===null||k===void 0?void 0:k.length)||0))})}),!this.annotationStore.selectedElementName){g.next=4;break}return g.abrupt("return");case 4:if(f={scale:this.defaults.scale,precision:this.defaults.precision,perimeter:0,area:0},!this.annotation){g.next=17;break}return g.next=8,this.getResult();case 8:if(s=[],this.showPerimeter&&s.push(this.annotation.perimeter+this.defaults.scale.translateUnit),this.showArea&&s.push(this.annotation.area+this.defaults.scale.translateUnit+"\xB2"),this.annotation.contents=s.join(`
2193
2193
  `),!this.annotation.rulerPtr||!this.oriEndPoint){g.next=17;break}return g.next=15,this.documentViewer.messageHandler.sendWithPromise("GetFactor",this.annotation.rulerPtr);case 15:m=g.sent,this.annotation.factor=m;case 17:this.documentViewer.eventBus.dispatch("updateMeasureData",f);case 18:case"end":return g.stop()}},n,this)}))}}])}(),LineCreateTool=function(){return _createClass(function e(n){var o;_classCallCheck(this,e),this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,this.onMousemove=this.handleMouseMove.bind(this),this.documentViewer=n.documentViewer,this.eventBus=n.documentViewer.eventBus,this.annotationStore=n.annotationStore,this.defaults={scale:{base:1,baseUnit:"cm",translate:1,translateUnit:"cm"},precision:.1,factor:.0352778},this.defaultStyles={borderWidth:2,opacity:1,color:"#FF0000",borderColor:"#FF0000",borderStyle:"solid",dashes:[],head:"openarrow",tail:"openarrow",fontName:"Helvetica",fontSize:14,fontStyle:"regular",contents:""},this.leaderLineDefaultOptions={leadLength:9,leadOffset:-9,leadExtension:6,labelPosition:"inside"},this.decimalPlaces=((o=this.defaults.precision.toString().split(".")[1])===null||o===void 0?void 0:o.length)||0},[{key:"reset",value:function(){this.annotationStore.creating&&this.drawingAnnot.delete(),this.annotationStore.creating=!1,this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,document.removeEventListener("mousemove",this.onMousemove)}},{key:"handleClick",value:function(e){return __awaiter(this,arguments,void 0,function(n){var o=this,r=n.pageIndex,f=n.oriPoint,s=n.realPoint,m=n.layer;return _regeneratorRuntime().mark(function w(){var g,v,d,u,y,x,k,P,S;return _regeneratorRuntime().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(!o.annotationStore.selectedElementName){E.next=2;break}return E.abrupt("return");case 2:if(o.layer=m,o.annotationStore.creating){E.next=17;break}return o.annotationStore.creating=!0,o.realStartPoint={x:s.x,y:s.y},d=f.x,u=f.y,y=f.x+1,x=f.y+1,k={left:d,top:u,right:y,bottom:x},P=[d,x,y,u],S=Object.assign(Object.assign(Object.assign({measure:1,type:"line",measureType:"distance",pageIndex:r,rect:k,linePoints:P},o.defaults),o.defaultStyles),o.leaderLineDefaultOptions),o.drawingAnnot=new Line({annotation:S,documentViewer:o.documentViewer,highlight:o.annotationStore.highlightLink}),o.drawingAnnot.draw(),document.addEventListener("mousemove",o.onMousemove),E.abrupt("return");case 17:if(o.drawingAnnot.layer.div){E.next=20;break}return o.reset(),E.abrupt("return");case 20:if(o.annotationStore.creating=!1,!s||((g=o.realStartPoint)===null||g===void 0?void 0:g.x)===s.x&&((v=o.realStartPoint)===null||v===void 0?void 0:v.y)===s.y){E.next=30;break}return E.next=24,o.documentViewer.annotationManager.createMeasurementAnnotation(o.drawingAnnot.annotation);case 24:E.sent,o.drawingAnnot.selectAnnotation(),o.documentViewer.getAnnotationManager().addAnnotation(o.drawingAnnot),o.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:o.documentViewer.annotations}),E.next=31;break;case 30:o.drawingAnnot.delete();case 31:o.reset();case 32:case"end":return E.stop()}},w)})()})}},{key:"handleMouseMove",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v;return _regeneratorRuntime().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(this.annotationStore.creating){d.next=2;break}return d.abrupt("return");case 2:f=getAbsoluteCoordinate(this.layer.pageDiv,e),s=f.x,m=f.y,w=this.layer.viewport,g=w.width,v=w.height,w.scale,s=Math.max(0,Math.min(g,s)),m=Math.max(0,Math.min(v,m)),this.realEndPoint={x:s,y:m},((o=this.realStartPoint)===null||o===void 0?void 0:o.x)===this.realEndPoint.x&&(this.realEndPoint.x+=1),((r=this.realStartPoint)===null||r===void 0?void 0:r.y)===this.realEndPoint.y&&(this.realEndPoint.y+=1),this.drawingAnnot.update({start:this.drawingAnnot.start,end:this.realEndPoint});case 10:case"end":return d.stop()}},n,this)}))}},{key:"setDefaults",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o=this;return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:Object.entries(e).forEach(function(f){var s,m=_slicedToArray(f,2),w=m[0],g=m[1];Object.hasOwn(o.defaults,w)&&o.defaults[w]!==g&&(o.defaults[w]=g,w==="precision"&&(o.decimalPlaces=((s=g.toString().split(".")[1])===null||s===void 0?void 0:s.length)||0)),Object.hasOwn(o.defaultStyles,w)&&o.defaultStyles[w]!==g&&(o.defaultStyles[w]=g)}),this.updateMeasureData(!this.annotationStore.selectedElementName);case 2:case"end":return r.stop()}},n,this)}))}},{key:"updateMeasureData",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],n={scale:this.defaults.scale,precision:this.defaults.precision};e&&(n.length=0,n.angle=0,n.X=0,n.Y=0),this.documentViewer.eventBus.dispatch("updateMeasureData",n)}}])}(),PolylineCreateTool=function(){return _createClass(function e(n){var o;_classCallCheck(this,e),this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,this.clickTimeId=null,this.addedBeforeMove=!1,this.onMousemove=this.handleMouseMove.bind(this),this.onKeydown=this.handleKeyDown.bind(this),this.documentViewer=n.documentViewer,this.eventBus=n.documentViewer.eventBus,this.annotationStore=n.annotationStore,this.measure=+n.measure||0,this.defaults={scale:{base:1,baseUnit:"cm",translate:1,translateUnit:"cm"},precision:.1,factor:.0352778},this.defaultStyles={borderWidth:2,opacity:1,color:"#FF0000",borderColor:"#FF0000",borderStyle:"solid",dashes:[],fontName:"Helvetica",fontSize:14,fontStyle:"regular",contents:""},this.decimalPlaces=((o=this.defaults.precision.toString().split(".")[1])===null||o===void 0?void 0:o.length)||0},[{key:"reset",value:function(){this.annotationStore.creating&&this.drawingAnnot.delete(),this.annotationStore.creating=!1,this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,document.removeEventListener("mousemove",this.onMousemove),document.removeEventListener("keydown",this.onKeydown)}},{key:"handleClick",value:function(e){return __awaiter(this,arguments,void 0,function(n){var o=this,r=n.pageIndex,f=n.oriPoint,s=n.realPoint,m=n.layer;return _regeneratorRuntime().mark(function w(){var g,v,d,u;return _regeneratorRuntime().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(!o.clickTimeId){y.next=4;break}return clearTimeout(o.clickTimeId),o.clickTimeId=null,y.abrupt("return");case 4:if(!o.annotationStore.selectedElementName){y.next=6;break}return y.abrupt("return");case 6:if(o.layer=m,o.annotationStore.creating){y.next=18;break}return o.annotationStore.creating=!0,o.addedBeforeMove=!1,o.realStartPoint={x:s.x,y:s.y},u=Object.assign({measure:o.measure,type:"polyline",pageIndex:r,vertices:[{x:f.x,y:f.y}]},o.defaultStyles),o.measure&&Object.assign(u,Object.assign({measureType:"perimeter"},o.defaults)),o.drawingAnnot=new Polyline({annotation:u,documentViewer:o.documentViewer,highlight:o.annotationStore.highlightLink}),o.drawingAnnot.draw(),document.addEventListener("mousemove",o.onMousemove),document.addEventListener("keydown",o.onKeydown),y.abrupt("return");case 18:if(!((g=o.drawingAnnot.layer)===null||g===void 0)&&g.div){y.next=21;break}return o.reset(),y.abrupt("return");case 21:if(o.clickTimeId=setTimeout(function(){o.realEndPoint={x:s.x,y:s.y},o.realStartPoint=o.realEndPoint,o.clickTimeId=null},250),s&&!(Math.abs(((v=o.realStartPoint)===null||v===void 0?void 0:v.x)-s.x)<=5&&Math.abs(((d=o.realStartPoint)===null||d===void 0?void 0:d.y)-s.y)<=5)){y.next=24;break}return y.abrupt("return");case 24:o.drawingAnnot.setPathPoint(o.drawingAnnot.realVertices.length-1,s.x,s.y),o.addedBeforeMove=!1;case 26:case"end":return y.stop()}},w)})()})}},{key:"handleKeyDown",value:function(e){(e.keyCode||e.which)===27&&(e.preventDefault(),this.reset())}},{key:"handleMouseMove",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v,d;return _regeneratorRuntime().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.annotationStore.creating){u.next=2;break}return u.abrupt("return");case 2:if(f=getAbsoluteCoordinate(this.layer.pageDiv,e),s=f.x,m=f.y,w=this.layer.viewport,g=w.width,v=w.height,w.scale,s=Math.max(0,Math.min(g,s)),m=Math.max(0,Math.min(v,m)),this.realEndPoint={x:s,y:m},!(Math.abs(((o=this.realStartPoint)===null||o===void 0?void 0:o.x)-s)<=5&&Math.abs(((r=this.realStartPoint)===null||r===void 0?void 0:r.y)-m)<=5)){u.next=9;break}return u.abrupt("return");case 9:!this.addedBeforeMove&&this.drawingAnnot.addPathPoint(s,m),this.addedBeforeMove=!0,d=this.drawingAnnot.realVertices.length-1,this.drawingAnnot.setPathPoint(d,s,m),this.drawingAnnot.update(d,!1);case 14:case"end":return u.stop()}},n,this)}))}},{key:"setDefaults",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o=this;return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:Object.entries(e).forEach(function(f){var s,m=_slicedToArray(f,2),w=m[0],g=m[1];Object.hasOwn(o.defaults,w)&&o.defaults[w]!==g&&(o.defaults[w]=g,w==="precision"&&(o.decimalPlaces=((s=g.toString().split(".")[1])===null||s===void 0?void 0:s.length)||0)),Object.hasOwn(o.defaultStyles,w)&&o.defaultStyles[w]!==g&&(o.defaultStyles[w]=g)}),this.updateMeasureData(!this.annotationStore.selectedElementName);case 2:case"end":return r.stop()}},n,this)}))}},{key:"updateMeasureData",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],n={scale:this.defaults.scale,precision:this.defaults.precision};e&&(n.length=0,n.angle=0),this.documentViewer.eventBus.dispatch("updateMeasureData",n)}},{key:"handleDoubleClick",value:function(e){return __awaiter(this,arguments,void 0,function(n){var o=this,r=n.realPoint;return _regeneratorRuntime().mark(function f(){var s,m,w,g,v,d,u,y,x,k;return _regeneratorRuntime().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(o.clickTimeId&&(clearTimeout(o.clickTimeId),o.clickTimeId=null),o.annotationStore.creating=!1,!r||((s=o.realStartPoint)===null||s===void 0?void 0:s.x)===r.x&&((m=o.realStartPoint)===null||m===void 0?void 0:m.y)===r.y||o.drawingAnnot.setPathPoint(o.drawingAnnot.realVertices.length-1,r.x,r.y),o.drawingAnnot.update(),o.drawingAnnot.realVertices.length>=2&&(w=o.drawingAnnot.realVertices.slice(-2),g=_slicedToArray(w,2),v=g[0],d=v.x,u=v.y,y=g[1],x=y.x,k=y.y,Math.abs(parseInt(d)-parseInt(x))<=1&&Math.abs(parseInt(u)-parseInt(k))<=1&&(o.drawingAnnot.realVertices.pop(),o.drawingAnnot.annotation.vertices.pop(),o.drawingAnnot.renderAnnot())),!(o.drawingAnnot.realVertices.length<2)){P.next=9;break}o.drawingAnnot.delete(),P.next=19;break;case 9:if(!o.measure){P.next=16;break}return P.next=12,o.documentViewer.annotationManager.createMeasurementAnnotation(o.drawingAnnot.annotation);case 12:P.sent,o.eventBus.dispatch("updateMeasureData",{angle:0}),P.next=19;break;case 16:return P.next=18,o.documentViewer.annotationManager.createAnnotation(o.drawingAnnot.annotation);case 18:P.sent;case 19:o.drawingAnnot.selectAnnotation(),o.documentViewer.getAnnotationManager().addAnnotation(o.drawingAnnot),o.reset(),o.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:o.documentViewer.annotations});case 23:case"end":return P.stop()}},f)})()})}}])}(),CurveCreateTool=function(){return _createClass(function e(n){var o;_classCallCheck(this,e),this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,this.onMousemove=this.handleMouseMove.bind(this),this.documentViewer=n.documentViewer,this.eventBus=n.documentViewer.eventBus,this.annotationStore=n.annotationStore,this.defaults={scale:{base:1,baseUnit:"cm",translate:1,translateUnit:"cm"},precision:.1,factor:.0352778},this.defaultStyles={borderWidth:2,opacity:1,color:"#FF0000",borderColor:"#FF0000",borderStyle:"solid",dashes:[],fontName:"Helvetica",fontSize:14,fontStyle:"regular",contents:""},this.decimalPlaces=((o=this.defaults.precision.toString().split(".")[1])===null||o===void 0?void 0:o.length)||0},[{key:"reset",value:function(){this.annotationStore.creating&&this.drawingAnnot.delete(),this.annotationStore.creating=!1,this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,document.removeEventListener("mousemove",this.onMousemove)}},{key:"handleClick",value:function(e){return __awaiter(this,arguments,void 0,function(n){var o=this,r=n.pageIndex,f=n.oriPoint,s=n.realPoint,m=n.layer;return _regeneratorRuntime().mark(function w(){var g,v,d;return _regeneratorRuntime().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!o.annotationStore.selectedElementName){u.next=2;break}return u.abrupt("return");case 2:if(o.layer=m,o.annotationStore.creating){u.next=11;break}return o.annotationStore.creating=!0,o.realStartPoint={x:s.x,y:s.y},d=Object.assign(Object.assign({measure:1,type:"ink",measureType:"arc",captionType:"generic",pageIndex:r,inkPointes:[[{PointX:f.x,PointY:f.y},{PointX:f.x+1,PointY:f.y+1},{PointX:f.x+2,PointY:f.y+2},{PointX:f.x+3,PointY:f.y+3}]]},o.defaults),o.defaultStyles),o.drawingAnnot=new Curve({annotation:d,documentViewer:o.documentViewer,highlight:o.annotationStore.highlightLink}),o.drawingAnnot.draw(),document.addEventListener("mousemove",o.onMousemove),u.abrupt("return");case 11:if(o.drawingAnnot.layer.div){u.next=14;break}return o.reset(),u.abrupt("return");case 14:if(o.annotationStore.creating=!1,!s||((g=o.realStartPoint)===null||g===void 0?void 0:g.x)===s.x&&((v=o.realStartPoint)===null||v===void 0?void 0:v.y)===s.y){u.next=27;break}return o.drawingAnnot.setPathPoint(o.drawingAnnot.realVertices.length-1,s.x,s.y),o.drawingAnnot.calculateEqualPoints(),o.drawingAnnot.update(),u.next=21,o.documentViewer.annotationManager.createMeasurementAnnotation(o.drawingAnnot.annotation);case 21:u.sent,o.drawingAnnot.selectAnnotation(),o.documentViewer.getAnnotationManager().addAnnotation(o.drawingAnnot),o.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:o.documentViewer.annotations}),u.next=28;break;case 27:o.drawingAnnot.delete();case 28:o.reset();case 29:case"end":return u.stop()}},w)})()})}},{key:"handleMouseMove",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(this.annotationStore.creating){g.next=2;break}return g.abrupt("return");case 2:if(o=getAbsoluteCoordinate(this.layer.pageDiv,e),r=o.x,f=o.y,s=this.layer.viewport,m=s.width,w=s.height,s.scale,r=Math.max(0,Math.min(m,r)),f=Math.max(0,Math.min(w,f)),this.realEndPoint={x:r,y:f},this.realStartPoint.x!==this.realEndPoint.x||this.realStartPoint.y!==this.realEndPoint.y){g.next=9;break}return g.abrupt("return");case 9:this.drawingAnnot.setPathPoint(this.drawingAnnot.realVertices.length-1,r,f),this.drawingAnnot.calculateEqualPoints();case 11:case"end":return g.stop()}},n,this)}))}},{key:"setDefaults",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o=this;return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:Object.entries(e).forEach(function(f){var s,m=_slicedToArray(f,2),w=m[0],g=m[1];Object.hasOwn(o.defaults,w)&&o.defaults[w]!==g&&(o.defaults[w]=g,w==="precision"&&(o.decimalPlaces=((s=g.toString().split(".")[1])===null||s===void 0?void 0:s.length)||0)),Object.hasOwn(o.defaultStyles,w)&&o.defaultStyles[w]!==g&&(o.defaultStyles[w]=g)}),this.updateMeasureData(!this.annotationStore.selectedElementName);case 2:case"end":return r.stop()}},n,this)}))}},{key:"updateMeasureData",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],n={scale:this.defaults.scale,precision:this.defaults.precision};e&&(n.length=0),this.documentViewer.eventBus.dispatch("updateMeasureData",n)}}])}(),ArcCreateTool=function(){return _createClass(function e(n){var o;_classCallCheck(this,e),this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.clickId=0,this.addedBeforeMove=!1,this.layer=null,this.onMousemove=this.handleMouseMove.bind(this),this.documentViewer=n.documentViewer,this.eventBus=n.documentViewer.eventBus,this.annotationStore=n.annotationStore,this.measure=+n.measure||0,this.defaults={scale:{base:1,baseUnit:"cm",translate:1,translateUnit:"cm"},precision:.1,factor:.0352778},this.defaultStyles={borderWidth:2,opacity:1,color:"#FF0000",borderColor:"#FF0000",borderStyle:"solid",dashes:[],fontName:"Helvetica",fontSize:14,fontStyle:"regular",contents:""},this.decimalPlaces=((o=this.defaults.precision.toString().split(".")[1])===null||o===void 0?void 0:o.length)||0,this.showOption=this.annotationStore.arc},[{key:"reset",value:function(){this.annotationStore.creating&&this.drawingAnnot.delete(),this.annotationStore.creating=!1,this.realStartPoint=null,this.realEndPoint=null,this.clickId=0,this.drawingAnnot=null,this.layer=null,document.removeEventListener("mousemove",this.onMousemove)}},{key:"handleClick",value:function(e){return __awaiter(this,arguments,void 0,function(n){var o=this,r=n.pageIndex,f=n.oriPoint,s=n.realPoint,m=n.layer;return _regeneratorRuntime().mark(function w(){var g,v,d,u,y,x;return _regeneratorRuntime().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(!o.annotationStore.selectedElementName){k.next=2;break}return k.abrupt("return");case 2:if(o.layer=m,o.annotationStore.creating||o.clickId){k.next=23;break}if(o.annotationStore.creating=!0,o.clickId=1,o.addedBeforeMove=!1,o.realStartPoint={x:s.x,y:s.y},y=Object.assign({measure:o.measure,type:"arc",pageIndex:r,arcPoints:[{x:f.x,y:f.y}],inkPointes:[]},o.defaultStyles),o.measure&&Object.assign(y,Object.assign(Object.assign({type:"ink",measureType:"arc"},o.defaults),{showRadius:o.showOption.showRadius,showAngle:o.showOption.showAngle,showArcLength:o.showOption.showArcLength})),!isMobileDevice$1){k.next=20;break}return f.x,f.y,f.x<100&&(f.x=100),f.y<50&&(f.y=50),x=Object.assign(Object.assign({},y),{arcPoints:[{x:f.x,y:f.y},{x:f.x-50,y:f.y-50},{x:f.x,y:f.y-100}],operate:"add-annot"}),o.documentViewer.handleAnnotationChange({type:"add",show:!0,annotation:x}),o.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:o.documentViewer.annotations}),o.annotationStore.creating=!1,o.reset(),k.abrupt("return");case 20:return o.drawingAnnot=new Arc({annotation:y,documentViewer:o.documentViewer,highlight:o.annotationStore.highlightLink}),document.addEventListener("mousemove",o.onMousemove),k.abrupt("return");case 23:if(o.drawingAnnot.layer.div){k.next=26;break}return o.reset(),k.abrupt("return");case 26:if(o.clickId!==1){k.next=34;break}if(s&&!(Math.abs(((g=o.realStartPoint)===null||g===void 0?void 0:g.x)-s.x)<=5&&Math.abs(((v=o.realStartPoint)===null||v===void 0?void 0:v.y)-s.y)<=5)){k.next=29;break}return k.abrupt("return");case 29:return o.clickId=2,o.drawingAnnot.setPathPoint(o.drawingAnnot.realVertices.length-1,s.x,s.y),o.addedBeforeMove=!1,document.addEventListener("mousemove",o.onMousemove),k.abrupt("return");case 34:if(o.addedBeforeMove&&!(o.drawingAnnot.realVertices.length<3)){k.next=36;break}return k.abrupt("return");case 36:if(o.annotationStore.creating=!1,!s||((d=o.realStartPoint)===null||d===void 0?void 0:d.x)===s.x&&((u=o.realStartPoint)===null||u===void 0?void 0:u.y)===s.y){k.next=55;break}if(o.drawingAnnot.setPathPoint(o.drawingAnnot.realVertices.length-1,s.x,s.y),Object.assign(o.drawingAnnot.annotation,{arcPoints:o.drawingAnnot.changedArcPoints}),o.drawingAnnot.update(),!o.measure){k.next=47;break}return k.next=44,o.documentViewer.annotationManager.createMeasurementAnnotation(o.drawingAnnot.annotation);case 44:k.sent,k.next=50;break;case 47:return k.next=49,o.documentViewer.annotationManager.createAnnotation(o.drawingAnnot.annotation);case 49:k.sent;case 50:o.drawingAnnot.selectAnnotation(),o.documentViewer.getAnnotationManager().addAnnotation(o.drawingAnnot),o.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:o.documentViewer.annotations}),k.next=56;break;case 55:o.drawingAnnot.delete();case 56:o.reset();case 57:case"end":return k.stop()}},w)})()})}},{key:"handleMouseMove",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(this.annotationStore.creating&&this.clickId){g.next=2;break}return g.abrupt("return");case 2:if(o=getAbsoluteCoordinate(this.layer.pageDiv,e),r=o.x,f=o.y,s=this.layer.viewport,m=s.width,w=s.height,s.scale,r=Math.max(0,Math.min(m,r)),f=Math.max(0,Math.min(w,f)),this.realEndPoint={x:r,y:f},this.realStartPoint.x!==this.realEndPoint.x||this.realStartPoint.y!==this.realEndPoint.y){g.next=9;break}return g.abrupt("return");case 9:this.addedBeforeMove||(this.drawingAnnot.addPathPoint(r,f),this.clickId===1&&this.drawingAnnot.draw()),this.addedBeforeMove=!0,this.drawingAnnot.setPathPoint(this.drawingAnnot.realVertices.length-1,r,f),this.clickId===2&&this.drawingAnnot.update(null,!1);case 13:case"end":return g.stop()}},n,this)}))}},{key:"setDefaults",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o=this;return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:["showAngle","showArcLength","showRadius"].forEach(function(f){var s;e[f]!==void 0&&(o.showOption[f]=(s=e[f])!==null&&s!==void 0?s:o.showOption[f])}),Object.entries(e).forEach(function(f){var s,m=_slicedToArray(f,2),w=m[0],g=m[1];Object.hasOwn(o.defaults,w)&&o.defaults[w]!==g&&(o.defaults[w]=g,w==="precision"&&(o.decimalPlaces=((s=g.toString().split(".")[1])===null||s===void 0?void 0:s.length)||0)),Object.hasOwn(o.defaultStyles,w)&&o.defaultStyles[w]!==g&&(o.defaultStyles[w]=g)}),this.updateMeasureData(!this.annotationStore.selectedElementName);case 4:case"end":return r.stop()}},n,this)}))}},{key:"updateMeasureData",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],n={scale:this.defaults.scale,precision:this.defaults.precision,showRadius:this.showOption.showRadius,showAngle:this.showOption.showAngle,showArcLength:this.showOption.showArcLength};e&&(n.radius=0,n.arcLength=0,n.angle=0),this.documentViewer.eventBus.dispatch("updateMeasureData",n)}}])}(),CircleCreateTool=function(){return _createClass(function e(n){var o;_classCallCheck(this,e),this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,this.onMousemove=this.handleMouseMove.bind(this),this.onMouseup=this.handleMouseUp.bind(this),this.documentViewer=n.documentViewer,this.eventBus=n.documentViewer.eventBus,this.annotationStore=n.annotationStore,this.defaults={scale:{base:1,baseUnit:"cm",translate:1,translateUnit:"cm"},precision:.1,factor:.0352778},this.defaultStyles={borderWidth:2,opacity:1,fillTransparency:1,color:"#FF0000",borderColor:"#FF0000",borderStyle:"solid",dashes:[],fillColor:"",fontName:"Helvetica",fontSize:14,fontStyle:"regular",contents:"",labelPosition:"inside"},this.decimalPlaces=((o=this.defaults.precision.toString().split(".")[1])===null||o===void 0?void 0:o.length)||0,this.showOption=this.annotationStore.circle},[{key:"reset",value:function(){this.annotationStore.creating&&this.drawingAnnot.delete(),this.annotationStore.creating=!1,this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,document.removeEventListener("mousemove",this.onMousemove),document.removeEventListener("mouseup",this.onMouseup)}},{key:"handleMouseDown",value:function(e){return __awaiter(this,arguments,void 0,function(n){var o=this,r=n.pageIndex,f=n.oriPoint,s=n.realPoint,m=n.layer;return _regeneratorRuntime().mark(function w(){var g,v,d,u,y,x;return _regeneratorRuntime().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(!o.annotationStore.selectedElementName&&!o.annotationStore.creating){k.next=2;break}return k.abrupt("return");case 2:o.layer=m,o.annotationStore.creating=!0,o.realStartPoint={x:s.x,y:s.y},g=f.x,v=f.y,d=f.x+1,u=f.y+1,y={left:g,top:v,right:d,bottom:u},x=Object.assign(Object.assign(Object.assign({measure:1,type:"circle",measureType:"area",pageIndex:r,rect:y},o.defaults),o.defaultStyles),{showRadius:o.showOption.showRadius,showPerimeter:o.showOption.showPerimeter,showArea:o.showOption.showArea}),o.drawingAnnot=new Circle({annotation:x,documentViewer:o.documentViewer,highlight:o.annotationStore.highlightLink}),o.drawingAnnot.draw(),document.addEventListener("mousemove",o.onMousemove),document.addEventListener("mouseup",o.onMouseup);case 15:case"end":return k.stop()}},w)})()})}},{key:"handleMouseMove",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v,d,u,y;return _regeneratorRuntime().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(this.annotationStore.creating){x.next=2;break}return x.abrupt("return");case 2:f=getAbsoluteCoordinate(this.layer.pageDiv,e),s=f.x,m=f.y,w=this.layer.viewport,g=w.width,v=w.height,w.scale,s=Math.max(0,Math.min(g,s)),m=Math.max(0,Math.min(v,m)),this.realEndPoint={x:s,y:m},((o=this.realStartPoint)===null||o===void 0?void 0:o.x)===this.realEndPoint.x&&(this.realEndPoint.x+=1),((r=this.realStartPoint)===null||r===void 0?void 0:r.y)===this.realEndPoint.y&&(this.realEndPoint.y+=1),e.shiftKey&&(d=Math.abs(this.realEndPoint.x-this.realStartPoint.x),u=Math.abs(this.realEndPoint.y-this.realStartPoint.y),y=Math.min(d,u),this.realStartPoint.x<this.realEndPoint.x?this.realEndPoint.x=this.realStartPoint.x+y:this.realEndPoint.x=this.realStartPoint.x-y,this.realStartPoint.y<this.realEndPoint.y?this.realEndPoint.y=this.realStartPoint.y+y:this.realEndPoint.y=this.realStartPoint.y-y),this.drawingAnnot.update({start:this.drawingAnnot.start,end:this.realEndPoint});case 11:case"end":return x.stop()}},n,this)}))}},{key:"handleMouseUp",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r;return _regeneratorRuntime().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.annotationStore.creating=!1,!this.realEndPoint||((o=this.realStartPoint)===null||o===void 0?void 0:o.x)===this.realEndPoint.x||((r=this.realStartPoint)===null||r===void 0?void 0:r.y)===this.realEndPoint.y){f.next=10;break}return f.next=4,this.documentViewer.annotationManager.createMeasurementAnnotation(this.drawingAnnot.annotation);case 4:f.sent,this.drawingAnnot.selectAnnotation(),this.documentViewer.getAnnotationManager().addAnnotation(this.drawingAnnot),this.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:this.documentViewer.annotations}),f.next=11;break;case 10:this.drawingAnnot.delete();case 11:this.reset();case 12:case"end":return f.stop()}},n,this)}))}},{key:"setDefaults",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o=this;return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:["showPerimeter","showArea","showRadius"].forEach(function(f){var s;e[f]!==void 0&&(o.showOption[f]=(s=e[f])!==null&&s!==void 0?s:o.showOption[f])}),Object.entries(e).forEach(function(f){var s,m=_slicedToArray(f,2),w=m[0],g=m[1];Object.hasOwn(o.defaults,w)&&o.defaults[w]!==g&&(o.defaults[w]=g,w==="precision"&&(o.decimalPlaces=((s=g.toString().split(".")[1])===null||s===void 0?void 0:s.length)||0)),Object.hasOwn(o.defaultStyles,w)&&o.defaultStyles[w]!==g&&(o.defaultStyles[w]=g)}),this.updateMeasureData(!this.annotationStore.selectedElementName);case 4:case"end":return r.stop()}},n,this)}))}},{key:"updateMeasureData",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],n={scale:this.defaults.scale,precision:this.defaults.precision,showRadius:this.showOption.showRadius,showPerimeter:this.showOption.showPerimeter,showArea:this.showOption.showArea};e&&(n.radius=0,n.perimeter=0,n.area=0),this.documentViewer.eventBus.dispatch("updateMeasureData",n)}}])}(),RectangleCreateTool=function(){return _createClass(function e(n){var o;_classCallCheck(this,e),this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,this.onMousemove=this.handleMouseMove.bind(this),this.onMouseup=this.handleMouseUp.bind(this),this.documentViewer=n.documentViewer,this.eventBus=n.documentViewer.eventBus,this.annotationStore=n.annotationStore,this.defaults={scale:{base:1,baseUnit:"cm",translate:1,translateUnit:"cm"},precision:.1,factor:.0352778},this.defaultStyles={borderWidth:2,opacity:1,fillTransparency:1,color:"#FF0000",borderColor:"#FF0000",borderStyle:"solid",dashes:[],fillColor:"",fontName:"Helvetica",fontSize:14,fontStyle:"regular",contents:"",labelPosition:"inside"},this.decimalPlaces=((o=this.defaults.precision.toString().split(".")[1])===null||o===void 0?void 0:o.length)||0,this.showOption=this.annotationStore.rectangle},[{key:"reset",value:function(){this.annotationStore.creating&&this.drawingAnnot.delete(),this.annotationStore.creating=!1,this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,document.removeEventListener("mousemove",this.onMousemove),document.removeEventListener("mouseup",this.onMouseup)}},{key:"handleMouseDown",value:function(e){return __awaiter(this,arguments,void 0,function(n){var o=this,r=n.pageIndex,f=n.oriPoint,s=n.realPoint,m=n.layer;return _regeneratorRuntime().mark(function w(){var g,v,d,u,y,x,k;return _regeneratorRuntime().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(!o.annotationStore.selectedElementName&&!o.annotationStore.creating){P.next=2;break}return P.abrupt("return");case 2:o.layer=m,o.annotationStore.creating=!0,o.realStartPoint={x:s.x,y:s.y},g=f.x,v=f.y,d=f.x+1,u=f.y+1,y={left:g,top:v,right:d,bottom:u},x=[{x:g,y:v},{x:d,y:v},{x:d,y:u},{x:g,y:u}],k=Object.assign(Object.assign(Object.assign({measure:1,type:"rectangle",measureType:"area",pageIndex:r,rect:y,vertices:x},o.defaults),o.defaultStyles),{showPerimeter:o.showOption.showPerimeter,showArea:o.showOption.showArea}),o.drawingAnnot=new Rectangle({annotation:k,documentViewer:o.documentViewer,highlight:o.annotationStore.highlightLink}),o.drawingAnnot.draw(),document.addEventListener("mousemove",o.onMousemove),document.addEventListener("mouseup",o.onMouseup);case 16:case"end":return P.stop()}},w)})()})}},{key:"handleMouseMove",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v;return _regeneratorRuntime().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(this.annotationStore.creating){d.next=2;break}return d.abrupt("return");case 2:f=getAbsoluteCoordinate(this.layer.pageDiv,e),s=f.x,m=f.y,w=this.layer.viewport,g=w.width,v=w.height,w.scale,s=Math.max(0,Math.min(g,s)),m=Math.max(0,Math.min(v,m)),this.realEndPoint={x:s,y:m},((o=this.realStartPoint)===null||o===void 0?void 0:o.x)===this.realEndPoint.x&&(this.realEndPoint.x+=1),((r=this.realStartPoint)===null||r===void 0?void 0:r.y)===this.realEndPoint.y&&(this.realEndPoint.y+=1),this.drawingAnnot.update({start:this.drawingAnnot.start,end:this.realEndPoint});case 10:case"end":return d.stop()}},n,this)}))}},{key:"handleMouseUp",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v,d,u;return _regeneratorRuntime().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(f=getAbsoluteCoordinate(this.layer.pageDiv,e),s=f.x,m=f.y,w=this.layer.viewport,g=w.width,v=w.height,d=w.scale,s=Math.max(0,Math.min(g,s)),m=Math.max(0,Math.min(v,m)),this.realEndPoint={x:s,y:m},this.annotationStore.creating=!1,u=getInitialPoint$1({x:s,y:m},d),this.oriEndPoint={x:u.x,y:u.y},!this.realEndPoint||((o=this.realStartPoint)===null||o===void 0?void 0:o.x)===this.realEndPoint.x||((r=this.realStartPoint)===null||r===void 0?void 0:r.y)===this.realEndPoint.y){y.next=17;break}return y.next=11,this.documentViewer.annotationManager.createMeasurementAnnotation(this.drawingAnnot.annotation);case 11:y.sent,this.drawingAnnot.selectAnnotation(),this.documentViewer.getAnnotationManager().addAnnotation(this.drawingAnnot),this.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:this.documentViewer.annotations}),y.next=18;break;case 17:this.drawingAnnot.delete();case 18:this.reset();case 19:case"end":return y.stop()}},n,this)}))}},{key:"updateMeasureData",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],n={scale:this.defaults.scale,precision:this.defaults.precision,showPerimeter:this.showOption.showPerimeter,showArea:this.showOption.showArea};e&&(n.perimeter=0,n.area=0,n.length=0,n.width=0),this.documentViewer.eventBus.dispatch("updateMeasureData",n)}},{key:"setDefaults",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f=this;return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:e.showPerimeter===void 0&&e.showArea===void 0||(this.showOption.showPerimeter=(o=e.showPerimeter)!==null&&o!==void 0?o:this.showOption.showPerimeter,this.showOption.showArea=(r=e.showArea)!==null&&r!==void 0?r:this.showOption.showArea),Object.entries(e).forEach(function(m){var w,g=_slicedToArray(m,2),v=g[0],d=g[1];Object.hasOwn(f.defaults,v)&&f.defaults[v]!==d&&(f.defaults[v]=d,v==="precision"&&(f.decimalPlaces=((w=d.toString().split(".")[1])===null||w===void 0?void 0:w.length)||0)),Object.hasOwn(f.defaultStyles,v)&&f.defaultStyles[v]!==d&&(f.defaultStyles[v]=d)}),this.updateMeasureData(!this.annotationStore.selectedElementName);case 3:case"end":return s.stop()}},n,this)}))}}])}(),PolygonCreateTool=function(){return _createClass(function e(n){var o;_classCallCheck(this,e),this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,this.clickTimeId=null,this.addedBeforeMove=!1,this.onMousemove=this.handleMouseMove.bind(this),this.onKeydown=this.handleKeyDown.bind(this),this.documentViewer=n.documentViewer,this.eventBus=n.documentViewer.eventBus,this.annotationStore=n.annotationStore,this.measure=+n.measure||0,this.defaults={scale:{base:1,baseUnit:"cm",translate:1,translateUnit:"cm"},precision:.1,factor:.0352778},this.defaultStyles={borderWidth:2,opacity:1,fillTransparency:1,color:"#FF0000",fillColor:"",borderColor:"#FF0000",borderStyle:"solid",dashes:[],fontName:"Helvetica",fontSize:14,fontStyle:"regular",contents:""},this.decimalPlaces=((o=this.defaults.precision.toString().split(".")[1])===null||o===void 0?void 0:o.length)||0,this.showOption=this.annotationStore.polygon},[{key:"reset",value:function(){this.annotationStore.creating&&this.drawingAnnot.delete(),this.annotationStore.creating=!1,this.realStartPoint=null,this.realEndPoint=null,this.drawingAnnot=null,this.layer=null,document.removeEventListener("mousemove",this.onMousemove),document.removeEventListener("keydown",this.onKeydown)}},{key:"handleClick",value:function(e){return __awaiter(this,arguments,void 0,function(n){var o=this,r=n.pageIndex,f=n.oriPoint,s=n.realPoint,m=n.layer;return _regeneratorRuntime().mark(function w(){var g,v,d;return _regeneratorRuntime().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!o.clickTimeId){u.next=4;break}return clearTimeout(o.clickTimeId),o.clickTimeId=null,u.abrupt("return");case 4:if(!o.annotationStore.selectedElementName){u.next=6;break}return u.abrupt("return");case 6:if(o.layer=m,o.annotationStore.creating){u.next=18;break}return o.annotationStore.creating=!0,o.addedBeforeMove=!1,o.realStartPoint={x:s.x,y:s.y},d=Object.assign({measure:o.measure,type:"polygon",pageIndex:r,vertices:[{x:f.x,y:f.y}]},o.defaultStyles),o.measure&&Object.assign(d,Object.assign(Object.assign({measureType:"area"},o.defaults),{showPerimeter:o.showOption.showPerimeter,showArea:o.showOption.showArea})),o.drawingAnnot=new Polygon({annotation:d,documentViewer:o.documentViewer,highlight:o.annotationStore.highlightLink,creating:!0}),o.drawingAnnot.draw(),document.addEventListener("keydown",o.onKeydown),document.addEventListener("mousemove",o.onMousemove),u.abrupt("return");case 18:if(o.drawingAnnot.layer.div){u.next=21;break}return o.reset(),u.abrupt("return");case 21:if(o.clickTimeId=setTimeout(function(){o.realEndPoint={x:s.x,y:s.y},o.realStartPoint=o.realEndPoint,o.clickTimeId=null},250),s&&!(Math.abs(((g=o.realStartPoint)===null||g===void 0?void 0:g.x)-s.x)<=5&&Math.abs(((v=o.realStartPoint)===null||v===void 0?void 0:v.y)-s.y)<=5)){u.next=24;break}return u.abrupt("return");case 24:o.drawingAnnot.setPathPoint(o.drawingAnnot.realVertices.length-1,s.x,s.y),o.addedBeforeMove=!1;case 26:case"end":return u.stop()}},w)})()})}},{key:"handleKeyDown",value:function(e){(e.keyCode||e.which)===27&&(e.preventDefault(),this.reset())}},{key:"handleMouseMove",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(this.annotationStore.creating){g.next=2;break}return g.abrupt("return");case 2:if(o=getAbsoluteCoordinate(this.layer.pageDiv,e),r=o.x,f=o.y,s=this.layer.viewport,m=s.width,w=s.height,s.scale,r=Math.max(0,Math.min(m,r)),f=Math.max(0,Math.min(w,f)),this.realEndPoint={x:r,y:f},this.realStartPoint.x!==this.realEndPoint.x||this.realStartPoint.y!==this.realEndPoint.y){g.next=9;break}return g.abrupt("return");case 9:!this.addedBeforeMove&&this.drawingAnnot.addPathPoint(r,f),this.addedBeforeMove=!0,this.drawingAnnot.setPathPoint(this.drawingAnnot.realVertices.length-1,r,f),this.drawingAnnot.update(this.drawingAnnot.realVertices.length-1);case 13:case"end":return g.stop()}},n,this)}))}},{key:"setDefaults",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f=this;return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:e.showPerimeter===void 0&&e.showArea===void 0||(this.showOption.showPerimeter=(o=e.showPerimeter)!==null&&o!==void 0?o:this.showOption.showPerimeter,this.showOption.showArea=(r=e.showArea)!==null&&r!==void 0?r:this.showOption.showArea),Object.entries(e).forEach(function(m){var w,g=_slicedToArray(m,2),v=g[0],d=g[1];Object.hasOwn(f.defaults,v)&&f.defaults[v]!==d&&(f.defaults[v]=d,v==="precision"&&(f.decimalPlaces=((w=d.toString().split(".")[1])===null||w===void 0?void 0:w.length)||0)),Object.hasOwn(f.defaultStyles,v)&&f.defaultStyles[v]!==d&&(f.defaultStyles[v]=d)}),this.updateMeasureData(!this.annotationStore.selectedElementName);case 3:case"end":return s.stop()}},n,this)}))}},{key:"updateMeasureData",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],n={scale:this.defaults.scale,precision:this.defaults.precision,showPerimeter:this.showOption.showPerimeter,showArea:this.showOption.showArea};e&&(n.perimeter=0,n.area=0),this.documentViewer.eventBus.dispatch("updateMeasureData",n)}},{key:"handleDoubleClick",value:function(e){return __awaiter(this,arguments,void 0,function(n){var o=this,r=n.realPoint;return _regeneratorRuntime().mark(function f(){var s,m;return _regeneratorRuntime().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(o.clickTimeId&&(clearTimeout(o.clickTimeId),o.clickTimeId=null),o.annotationStore.creating=!1,!r||((s=o.realStartPoint)===null||s===void 0?void 0:s.x)===r.x&&((m=o.realStartPoint)===null||m===void 0?void 0:m.y)===r.y||o.drawingAnnot.setPathPoint(o.drawingAnnot.realVertices.length-1,r.x,r.y),r&&(Math.abs(o.drawingAnnot.realVertices[0].x-r.x)<=5&&Math.abs(o.drawingAnnot.realVertices[0].y-r.y)<=5||Math.abs(o.drawingAnnot.realVertices[o.drawingAnnot.realVertices.length-2].x-r.x)<=2&&Math.abs(o.drawingAnnot.realVertices[o.drawingAnnot.realVertices.length-2].y-r.y)<=2)&&(o.drawingAnnot.realVertices.pop(),o.drawingAnnot.annotation.vertices.pop()),o.drawingAnnot.creating=!1,!(o.drawingAnnot.realVertices.length<3)){w.next=9;break}o.drawingAnnot.delete(),w.next=22;break;case 9:if(o.drawingAnnot.renderAnnot(),o.drawingAnnot.update(),!o.measure){w.next=17;break}return w.next=14,o.documentViewer.annotationManager.createMeasurementAnnotation(o.drawingAnnot.annotation);case 14:w.sent,w.next=20;break;case 17:return w.next=19,o.documentViewer.annotationManager.createAnnotation(o.drawingAnnot.annotation);case 19:w.sent;case 20:o.drawingAnnot.selectAnnotation(),o.documentViewer.getAnnotationManager().addAnnotation(o.drawingAnnot);case 22:o.reset(),o.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:o.documentViewer.annotations});case 24:case"end":return w.stop()}},f)})()})}}])}(),MeasurementTool=function(){return _createClass(function e(n){_classCallCheck(this,e),this.onHandleTool=this.handleTool.bind(this),this.onHandleToolMode=this.handleToolMode.bind(this),this.onClick=this.handleClick.bind(this),this.onDbclick=this.handleDbclick.bind(this),this.onMousedown=this.handleMousedown.bind(this),this.onKeydown=this.handleKeyDown.bind(this),this.documentViewer=n.documentViewer,this.tool=n.documentViewer.activeTool,this.eventBus=n.documentViewer.eventBus,this.annotationStore=n.annotationStore,this.eventBus._on("toolChanged",this.onHandleTool),this.eventBus._on("toolModeChanged",this.onHandleToolMode),this.eventBus._on("pdfClick",this.onClick),this.eventBus._on("pdfDbclick",this.onDbclick),this.eventBus._on("pdfMousedown",this.onMousedown),this.lineCreateTool=new LineCreateTool(n),this.polylineCreateTool=new PolylineCreateTool(n),this.curveCreateTool=new CurveCreateTool(n),this.arcCreateTool=new ArcCreateTool(n),this.circleCreateTool=new CircleCreateTool(n),this.rectangleCreateTool=new RectangleCreateTool(n),this.polygonCreateTool=new PolygonCreateTool(n),this.createTools=[this.lineCreateTool,this.polylineCreateTool,this.curveCreateTool,this.arcCreateTool,this.circleCreateTool,this.rectangleCreateTool,this.polygonCreateTool],this.toolMapping={line:"lineCreateTool",polyline:"polylineCreateTool",curve:"curveCreateTool",arc:"arcCreateTool",circle:"circleCreateTool",rectangle:"rectangleCreateTool",polygon:"polygonCreateTool"},this.activeTool=null},[{key:"handleTool",value:function(e){var n=e.tool;e.color;var o=this.tool;this.tool=n,this.activeTool=null;var r=this.documentViewer.toolMode==="measurement"?1:0;this.toolMapping[o]&&this.tool!==o&&this[this.toolMapping[o]].reset(),(r||["polyline","arc","polygon"].includes(n))&&(n&&this.toolMapping[this.tool]?(this.activeTool=this[this.toolMapping[this.tool]],this.activeTool.measure=r,document.querySelector(".document").classList.add("annotation-edit"),r&&this.updateMeasurePanel(),document.addEventListener("keydown",this.onKeydown)):(this.eventBus.dispatch("measurePropertyChange",{isOpen:!1}),document.removeEventListener("keydown",this.onKeydown)))}},{key:"handleToolMode",value:function(e){var n,o=this.toolMode;this.toolMode=e,o==="measurement"&&e!==o&&(this.eventBus.dispatch("measurePropertyChange",{isOpen:!1}),(n=this[this.toolMapping[this.tool]])===null||n===void 0||n.reset())}},{key:"destroy",value:function(){this.createTools.forEach(function(e){e.reset(),e=null}),this.eventBus._off("toolChanged",this.onHandleTool),this.eventBus._off("toolModeChanged",this.onHandleToolMode),this.eventBus._off("pdfClick",this.onClick),this.eventBus._off("pdfDbclick",this.onDbclick),this.eventBus._off("pdfMousedown",this.onMousedown)}},{key:"setDefaults",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o;return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if((e.scale||e.precision)&&(o={},e.scale&&(o.scale=e.scale,delete e.scale),e.precision&&(o.precision=e.precision,delete e.precision),this.createTools.forEach(function(f){f.setDefaults(o)})),Object.keys(e).length!==0||e.constructor!==Object){r.next=3;break}return r.abrupt("return");case 3:this.activeTool&&this.activeTool.setDefaults&&this.activeTool.setDefaults(e);case 4:case"end":return r.stop()}},n,this)}))}},{key:"handleClick",value:function(e){this.handleEvent(e,"handleClick")}},{key:"handleDbclick",value:function(e){this.handleEvent(e,"handleDoubleClick")}},{key:"handleMousedown",value:function(e){this.handleEvent(e,"handleMouseDown")}},{key:"handleEvent",value:function(e,n){var o=e.pageNumber,r=e.x,f=e.y,s=e.event;if(!this.annotationStore.selectedElementName){var m=o-1,w=this.documentViewer.pdfViewer._pages[m].compdfAnnotationLayer;if(w){var g=getAbsoluteCoordinate(w.pageDiv,s);this.activeTool&&this.activeTool[n]&&this.activeTool[n]({pageIndex:m,oriPoint:{x:r,y:f},realPoint:g,layer:w})}}}},{key:"updateMeasurePanel",value:function(){this.activeTool&&(this.eventBus.dispatch("measurePropertyChange",Object.assign(Object.assign({},this.activeTool.defaultStyles),{measure:1})),this.activeTool.updateMeasureData())}},{key:"handleKeyDown",value:function(e){(e.keyCode||e.which)===27&&(e.preventDefault(),this.activeTool&&this.activeTool.drawingAnnot&&(this.annotationStore.creating=!1,this.activeTool.drawingAnnot.delete(),this.activeTool.reset()))}}])}(),DEFAULT_CACHE_SIZE=3,ENABLE_PERMISSIONS_CLASS="enablePermissions",PagesCountLimit={FORCE_SCROLL_MODE_PAGE:15e3,FORCE_LAZY_PAGE_INIT:7500,PAUSE_EAGER_PAGE_INIT:250};function isValidAnnotationEditorMode(e){return Object.values(pdfExports.AnnotationEditorType).includes(e)&&e!==pdfExports.AnnotationEditorType.DISABLE}var _buf=new WeakMap,_size=new WeakMap,_PDFPageViewBuffer_brand=new WeakSet,PDFPageViewBuffer=function(){return _createClass(function e(n){_classCallCheck(this,e),_classPrivateMethodInitSpec(this,_PDFPageViewBuffer_brand),_classPrivateFieldInitSpec(this,_buf,new Set),_classPrivateFieldInitSpec(this,_size,0),_classPrivateFieldSet2(_size,this,n)},[{key:"push",value:function(e){var n=_classPrivateFieldGet2(_buf,this);n.has(e)&&n.delete(e),n.add(e),n.size>_classPrivateFieldGet2(_size,this)&&_assertClassBrand(_PDFPageViewBuffer_brand,this,_destroyFirstView).call(this)}},{key:"resize",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;_classPrivateFieldSet2(_size,this,e);var o=_classPrivateFieldGet2(_buf,this);if(n){var r,f=o.size,s=1,m=_createForOfIteratorHelper(o);try{for(m.s();!(r=m.n()).done;){var w=r.value;if(n.has(w.id)&&(o.delete(w),o.add(w)),++s>f)break}}catch(g){m.e(g)}finally{m.f()}}for(;o.size>_classPrivateFieldGet2(_size,this);)_assertClassBrand(_PDFPageViewBuffer_brand,this,_destroyFirstView).call(this)}},{key:"has",value:function(e){return _classPrivateFieldGet2(_buf,this).has(e)}},{key:Symbol.iterator,value:function(){return _classPrivateFieldGet2(_buf,this).keys()}}])}();function _destroyFirstView(){var e=_classPrivateFieldGet2(_buf,this).keys().next().value;e==null||e.destroy(),_classPrivateFieldGet2(_buf,this).delete(e)}var _buffer=new WeakMap,_enablePermissions=new WeakMap,_scrollModePageState=new WeakMap,_onVisibilityChange=new WeakMap,_scaleTimeoutId=new WeakMap,_renderedPagesView=new WeakMap,_rendering=new WeakMap,_cacheTask=new WeakMap,_PDFViewer_brand=new WeakSet,PDFViewer=function(){return _createClass(function r(f){var s,m,w,g,v;if(_classCallCheck(this,r),_classPrivateMethodInitSpec(this,_PDFViewer_brand),_classPrivateFieldInitSpec(this,_buffer,null),_classPrivateFieldInitSpec(this,_enablePermissions,!1),_classPrivateFieldInitSpec(this,_scrollModePageState,null),_classPrivateFieldInitSpec(this,_onVisibilityChange,null),_classPrivateFieldInitSpec(this,_scaleTimeoutId,null),_classPrivateFieldInitSpec(this,_renderedPagesView,[]),_classPrivateFieldInitSpec(this,_rendering,!1),_classPrivateFieldInitSpec(this,_cacheTask,[]),this.documentViewer=f.documentViewer,this.eventBus=f.eventBus,this._annotationEditorUIManager=null,this.container=f.container,this.viewer=f.viewer||f.container.firstElementChild,this.annotationStore=f.annotationStore,this.messageHandler=f.messageHandler,this.exitPresentationMode=!1,((s=this.container)===null||s===void 0?void 0:s.tagName)!=="DIV"||((m=this.viewer)===null||m===void 0?void 0:m.tagName)!=="DIV")throw new Error("Invalid `container` and/or `viewer` option.");this.linkService=f.linkService,this.removePageBorders=!1,this.textLayerMode=(w=f.textLayerMode)!==null&&w!==void 0?w:TextLayerMode.ENABLE,this._annotationEditorMode=(g=f.annotationEditorMode)!==null&&g!==void 0?g:pdfExports.AnnotationEditorType.NONE,this.imageResourcesPath=f.imageResourcesPath||"",this.enablePrintAutoRotate=f.enablePrintAutoRotate||!1,this.renderer=f.renderer||RendererType.CANVAS,this.useOnlyCssZoom=f.useOnlyCssZoom||!1,this.isOffscreenCanvasSupported=(v=f.isOffscreenCanvasSupported)===null||v===void 0||v,this.maxCanvasPixels=maxCanvasPixels,_classPrivateFieldSet2(_enablePermissions,this,f.enablePermissions||!1),this.pageColors=f.pageColors||null,this.$t=f.$t,this.doc=f.doc,this.messageHandler=f.messageHandler,this._fontFile=null,this.contentEditHistoryManager=null,this.areaMeasurementCreateTool=null,this.measurementTool=null,!this.pageColors||CSS.supports("color",this.pageColors.background)&&CSS.supports("color",this.pageColors.foreground)||((this.pageColors.background||this.pageColors.foreground)&&console.warn("PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."),this.pageColors=null),this.renderingQueue=f.renderingQueue,this.scroll=watchScroll(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders")},[{key:"pagesCount",get:function(){return this._pages.length}},{key:"getPageView",value:function(r){return this._pages[r]}},{key:"pageViewsReady",get:function(){return!!this._pagesCapability.settled&&this._pages.every(function(r){return r==null?void 0:r.pdfPage})}},{key:"currentPageNumber",get:function(){return this._currentPageNumber},set:function(r){if(!Number.isInteger(r))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(r,!0)||console.error('currentPageNumber: "'.concat(r,'" is not a valid page.')))}},{key:"_setCurrentPageNumber",value:function(r){var f,s,m=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this._currentPageNumber===r)return m&&this._resetCurrentPageView(),!0;if(!(0<r&&r<=this.pagesCount))return!1;var w=this._currentPageNumber;return this._currentPageNumber=r,this.eventBus.dispatch("onPageNumberUpdated",{source:this,pageNumber:r,pageLabel:(f=(s=this._pageLabels)===null||s===void 0?void 0:s[r-1])!==null&&f!==void 0?f:null,previous:w}),this.eventBus.dispatch("pageNumberUpdated",r),m&&this._resetCurrentPageView(),!0}},{key:"currentPageLabel",get:function(){var r,f;return(r=(f=this._pageLabels)===null||f===void 0?void 0:f[this._currentPageNumber-1])!==null&&r!==void 0?r:null},set:function(r){if(this.pdfDocument){var f=0|r;if(this._pageLabels){var s=this._pageLabels.indexOf(r);s>=0&&(f=s+1)}this._setCurrentPageNumber(f,!0)||console.error('currentPageLabel: "'.concat(r,'" is not a valid page.'))}}},{key:"currentScale",get:function(){return this._currentScale!==UNKNOWN_SCALE?this._currentScale:DEFAULT_SCALE},set:function(r){if(isNaN(r))throw new Error("Invalid numeric scale.");this.pdfDocument&&this._setScale(r,{noScroll:!1})}},{key:"currentScaleValue",get:function(){return this._currentScaleValue},set:function(r){this.pdfDocument&&this._setScale(r,{noScroll:!1,drawingDelay:400,origin:{x:window.innerWidth/2,y:window.innerHeight/2}})}},{key:"pagesRotation",get:function(){return this._pagesRotation},set:function(r){if(!isValidRotation(r))throw new Error("Invalid pages rotation angle.");if(this.pdfDocument&&((r%=360)<0&&(r+=360),this._pagesRotation!==r)){this._pagesRotation=r;var f=this._currentPageNumber;this.refresh(!0,{rotation:r}),this._currentScaleValue&&this._setScale(this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:r,pageNumber:f})}}},{key:"firstPagePromise",get:function(){return this.pdfDocument?this._firstPageCapability.promise:null}},{key:"onePageRendered",get:function(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}},{key:"pagesPromise",get:function(){return this.pdfDocument?this._pagesCapability.promise:null}},{key:"setDocument",value:function(r,f,s,m){var w=this;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),this._annotationEditorUIManager&&(this._annotationEditorUIManager.destroy(),this._annotationEditorUIManager=null)),this.pdfDocument=r,r){var g=r.numPages,v=r.getPage(1),d=r.getOptionalContentConfig(),u=_classPrivateFieldGet2(_enablePermissions,this)?r.getPermissions():Promise.resolve();if(g>PagesCountLimit.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");var y=this._scrollMode=ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:y})}this._pagesCapability.promise.then(function(){w.eventBus.dispatch("pagesloaded",{source:w,pagesCount:g})},function(){}),this._onBeforeDraw=function(x){w._pages[x.pageNumber-1]},this._onAfterDraw=function(x){x.cssTransform||w._onePageRenderedCapability.settled||(w._onePageRenderedCapability.resolve({timestamp:x.timestamp}),w.eventBus._off("pagerendered",w._onAfterDraw),w._onAfterDraw=null,_classPrivateFieldGet2(_onVisibilityChange,w)&&(document.removeEventListener("visibilitychange",_classPrivateFieldGet2(_onVisibilityChange,w)),_classPrivateFieldSet2(_onVisibilityChange,w,null)))},this.eventBus._on("pagerendered",this._onAfterDraw),Promise.all([v,u]).then(function(x){var k=_slicedToArray(x,2),P=k[0],S=k[1];if(r===w.pdfDocument){w._firstPageCapability.resolve(P),w._optionalContentConfigPromise=d;var E=_assertClassBrand(_PDFViewer_brand,w,_initializePermissions).call(w,S),M=E.annotationEditorMode,T=E.textLayerMode;if(M!==pdfExports.AnnotationEditorType.DISABLE){var D=M;r.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):isValidAnnotationEditorMode(D)?(w._annotationEditorUIManager=new pdfExports.AnnotationEditorUIManager(w.container,w.eventBus,r==null?void 0:r.annotationStorage),D!==pdfExports.AnnotationEditorType.NONE&&w._annotationEditorUIManager.updateMode(D)):console.error("Invalid AnnotationEditor mode: ".concat(D))}var N=_assertClassBrand(_PDFViewer_brand,w,_layerProperties).bind(w),F=w._scrollMode===ScrollMode.PAGE?null:w.viewer,O=w.currentScale,I=P.getViewport({scale:O*PixelsPerInch.PDF_TO_CSS_UNITS});I.rotation!==0&&(I.rotation=0),w.viewer.style.setProperty("--scale-factor",I.scale),w.contentEditHistoryManager=new ContentEditHistoryManager({messageHandler:w.messageHandler,eventBus:w.eventBus,pdfViewer:w}),w.areaMeasurementCreateTool=new AreaMeasurementCreateTool({documentViewer:w.documentViewer,annotationStore:w.annotationStore}),w.measurementTool=new MeasurementTool({documentViewer:w.documentViewer,annotationStore:w.annotationStore});for(var X=1;X<=g;++X){var ne=X-1,ye=new PDFPageView(_defineProperty$1(_defineProperty$1(_defineProperty$1({documentViewer:w.documentViewer,container:F,eventBus:w.eventBus,id:X,pageIndex:ne,scale:O,messageHandler:w.messageHandler,annotationStore:w.annotationStore,annotations:f&&f[ne]||null,annotationsAll:f,pagesPtr:s,defaultViewport:I.clone(),optionalContentConfigPromise:d,renderingQueue:w.renderingQueue,textLayerMode:T,imageResourcesPath:w.imageResourcesPath,renderer:typeof PDFJSDev>"u"||PDFJSDev.test("!PRODUCTION || GENERIC")?w.renderer:null,useOnlyCssZoom:w.useOnlyCssZoom,isOffscreenCanvasSupported:w.isOffscreenCanvasSupported,maxCanvasPixels:w.maxCanvasPixels,pageColors:w.pageColors,layerProperties:N,l10n:w.l10n,$t:w.$t,doc:w.doc},"messageHandler",w.messageHandler),"contentEditHistoryManager",w.contentEditHistoryManager),"enableReply",m));w._pages.push(ye)}var J=w._pages[0];J&&(J.setPdfPage(P),w.linkService.cachePageRef(1,P.ref)),w._scrollMode===ScrollMode.PAGE?_assertClassBrand(_PDFViewer_brand,w,_ensurePageViewVisible).call(w):w._spreadMode!==SpreadMode.NONE&&w._updateSpreadMode(),_assertClassBrand(_PDFViewer_brand,w,_onePageRenderedOrForceFetch).call(w).then(_asyncToGenerator(_regeneratorRuntime().mark(function te(){var q,re,U;return _regeneratorRuntime().wrap(function(H){for(;;)switch(H.prev=H.next){case 0:if(w._annotationEditorUIManager&&w.eventBus.dispatch("annotationeditormodechanged",{source:w,mode:w._annotationEditorMode}),!(r.loadingParams.disableAutoFetch||g>PagesCountLimit.FORCE_LAZY_PAGE_INIT)){H.next=4;break}return w._pagesCapability.resolve(),H.abrupt("return");case 4:if(!((q=g-1)<=0)){H.next=8;break}return w._pagesCapability.resolve(),H.abrupt("return");case 8:re=_regeneratorRuntime().mark(function Z(Y){var W;return _regeneratorRuntime().wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:if(W=r.getPage(Y).then(function(oe){var Ce=w._pages[Y-1];Ce.pdfPage||Ce.setPdfPage(oe),w.linkService.cachePageRef(Y,oe.ref),--q==0&&w._pagesCapability.resolve()},function(oe){console.error("Unable to get page ".concat(Y," to initialize viewer"),oe),--q==0&&w._pagesCapability.resolve()}),Y%PagesCountLimit.PAUSE_EAGER_PAGE_INIT!=0){Q.next=4;break}return Q.next=4,W;case 4:case"end":return Q.stop()}},Z)}),U=2;case 10:if(!(U<=g)){H.next=15;break}return H.delegateYield(re(U),"t0",12);case 12:++U,H.next=10;break;case 15:case"end":return H.stop()}},te)}))),w.eventBus.dispatch("pagesinit",{source:w}),r.getMetadata().then(function(te){var q=te.info;r===w.pdfDocument&&q.Language&&(w.viewer.lang=q.Language)})}}).catch(function(x){console.error("Unable to initialize viewer",x),w._pagesCapability.reject(x)})}}},{key:"setPageLabels",value:function(r){if(this.pdfDocument){r?Array.isArray(r)&&this.pdfDocument.numPages===r.length?this._pageLabels=r:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(var f=0,s=this._pages.length;f<s;f++){var m,w;this._pages[f].setPageLabel((m=(w=this._pageLabels)===null||w===void 0?void 0:w[f])!==null&&m!==void 0?m:null)}}}},{key:"renderAnnotation",value:function(r,f){var s=this._pages[r.pageIndex];s&&s.compdfAnnotationLayer&&(s.textSelection&&s.textSelection.cleanSelection(),s.compdfAnnotationLayer.renderAnnotation(r,f))}},{key:"getAnnotation",value:function(r){var f=r.pageIndex,s=this._pages[f];return s&&s.compdfAnnotationLayer?s.compdfAnnotationLayer.getAnnotation(r):null}},{key:"deleteAnnotations",value:function(r){for(var f=Array.isArray(r)?r:[r],s=0;s<f.length;s++){var m=f[s],w=m.pageIndex,g=this._pages[w];g&&g.compdfAnnotationLayer&&g.compdfAnnotationLayer.deleteAnnotation(m)}}},{key:"_resetView",value:function(){this._pages=[],this._currentPageNumber=1,this._currentScale=UNKNOWN_SCALE,this._currentScaleValue=null,this._pageLabels=null,_classPrivateFieldSet2(_buffer,this,new PDFPageViewBuffer(DEFAULT_CACHE_SIZE)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=pdfExports.createPromiseCapability(),this._onePageRenderedCapability=pdfExports.createPromiseCapability(),this._pagesCapability=pdfExports.createPromiseCapability(),this._scrollMode=ScrollMode.VERTICAL,this._previousScrollMode=ScrollMode.UNKNOWN,this._spreadMode=SpreadMode.NONE,this.contentEditHistoryManager=null,_classPrivateFieldSet2(_scrollModePageState,this,{previousPageNumber:1,scrollDown:!0,pages:[]}),this._onBeforeDraw&&(this._onBeforeDraw=null),this._onAfterDraw&&(this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null),_classPrivateFieldGet2(_onVisibilityChange,this)&&(document.removeEventListener("visibilitychange",_classPrivateFieldGet2(_onVisibilityChange,this)),_classPrivateFieldSet2(_onVisibilityChange,this,null)),this.areaMeasurementCreateTool&&(this.areaMeasurementCreateTool.destroy(),this.areaMeasurementCreateTool=null),this.measurementTool&&(this.measurementTool.destroy(),this.measurementTool=null),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),this.viewer.classList.remove(ENABLE_PERMISSIONS_CLASS)}},{key:"_scrollUpdate",value:function(){this.pagesCount!==0&&this.update()}},{key:"_scrollIntoView",value:function(r){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(r){var s=r.div,m=r.id;if(this._currentPageNumber!==m&&this._setCurrentPageNumber(m),this._scrollMode===ScrollMode.PAGE&&(_assertClassBrand(_PDFViewer_brand,this,_ensurePageViewVisible).call(this),this.update()),!f&&!this.isInPresentationMode){var w=s.offsetLeft+s.clientLeft,g=w+s.clientWidth,v=this.container,d=v.scrollLeft,u=v.clientWidth;(this._scrollMode===ScrollMode.HORIZONTAL||w<d||g>d+u)&&(f={left:0,top:0})}scrollIntoView(s,f),!this._currentScaleValue&&this._location&&(this._location=null)}}},{key:"_setScaleUpdatePages",value:function(r,f,s){var m=this,w=s.noScroll,g=w!==void 0&&w,v=s.preset,d=v!==void 0&&v,u=s.drawingDelay,y=u===void 0?-1:u,x=s.origin,k=x===void 0?null:x;if(this._currentScaleValue=f.toString(),_assertClassBrand(_PDFViewer_brand,this,_isSameScale).call(this,r))d&&this.eventBus.dispatch("scalechanging",{source:this,scale:r,presetValue:f});else{var P=this._currentScale;if(k&&(k.x||k.y)){k.x=k.x||0,k.y=k.y||0;var S=r/P,E=this.documentViewer.getScrollViewElement(),M=this.documentViewer.getViewerElement();k.x=(k.x+this.container.scrollLeft-M.offsetLeft-E.offsetLeft)*S-k.x+E.offsetLeft,k.y=(k.y+this.container.scrollTop-M.offsetTop-E.offsetTop)*S-k.y+E.offsetTop}this.viewer.style.setProperty("--scale-factor",r*PixelsPerInch.PDF_TO_CSS_UNITS);var T=y>=0&&y<1e3;if(this.refresh(!0,{scale:r,drawingDelay:T?y:-1}),T&&_classPrivateFieldSet2(_scaleTimeoutId,this,setTimeout(function(){_classPrivateFieldSet2(_scaleTimeoutId,m,null),m.refresh(),m.exitPresentationMode=!1},y)),this._currentScale=r,!g){var D,N=this._currentPageNumber;!this._location||this.isInPresentationMode||this.isChangingPresentationMode||(N=this._location.pageNumber,D=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:N,destArray:D,allowNegativeOffset:!0}),k&&(k.x||k.y)&&(k.x=k.x||0,k.y=k.y||0,this.container.offsetTop,this.container.offsetLeft,this.container.scrollLeft=k.x,this.container.scrollTop=k.y)}this.eventBus.dispatch("scalechanging",{source:this,scale:r,presetValue:d?f:void 0})}}},{key:"_pageWidthScaleFactor",get:function(){return this._spreadMode!==SpreadMode.NONE&&this._scrollMode!==ScrollMode.HORIZONTAL?2:1}},{key:"_setScale",value:function(r,f){var s=parseFloat(r);if(s>0)f.preset=!1,this._setScaleUpdatePages(s,r,f);else{var m=this._pages[this._currentPageNumber-1];if(!m)return;var w=SCROLLBAR_PADDING,g=VERTICAL_PADDING;if(this.isInPresentationMode)w=g=4,this._spreadMode!==SpreadMode.NONE&&(w*=2);else if(this.removePageBorders)w=g=0;else if(this._scrollMode===ScrollMode.HORIZONTAL){var v=[g,w];w=v[0],g=v[1]}var d=(this.container.clientWidth-w)/m.width*m.scale/this._pageWidthScaleFactor,u=(this.container.clientHeight-g)/m.height*m.scale;switch(r){case"page-actual":s=1;break;case"page-width":s=d;break;case"page-height":s=u;break;case"page-fit":s=Math.min(d,u);break;case"auto":var y=isPortraitOrientation(m)?d:Math.min(u,d);s=Math.min(MAX_AUTO_SCALE,y);break;default:return void console.error('_setScale: "'.concat(r,'" is an unknown zoom value.'))}f.preset=!0,this._setScaleUpdatePages(s,r,f)}}},{key:"_resetCurrentPageView",value:function(){var r=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this._setScale(this._currentScaleValue,{noScroll:!0}),this._scrollIntoView(r)}},{key:"pageLabelToPageNumber",value:function(r){if(!this._pageLabels)return null;var f=this._pageLabels.indexOf(r);return f<0?null:f+1}},{key:"scrollPageIntoView",value:function(r){var f=r.pageNumber,s=r.destArray,m=s===void 0?null:s,w=r.allowNegativeOffset,g=w!==void 0&&w,v=r.ignoreDestinationZoom,d=v!==void 0&&v;if(this.pdfDocument&&(!this._pages||this._pages.length)){var u=Number.isInteger(f)&&this._pages[f-1];if(u)if(!this.isInPresentationMode&&m){var y,x,k=0,P=0,S=0,E=0,M=u.rotation%180!=0,T=(M?u.height:u.width)/u.scale/PixelsPerInch.PDF_TO_CSS_UNITS,D=(M?u.width:u.height)/u.scale/PixelsPerInch.PDF_TO_CSS_UNITS,N=0;switch(m[1].name){case"XYZ":k=m[2],P=m[3],N=m[4],k=k!==null?k:0,P=P!==null?P:D;break;case"Fit":case"FitB":N="page-fit";break;case"FitH":case"FitBH":N="page-width",(P=m[2])===null&&this._location?(k=this._location.left,P=this._location.top):(typeof P!="number"||P<0)&&(P=D);break;case"FitV":case"FitBV":k=m[2],S=T,E=D,N="page-height";break;case"FitR":k=m[2],P=m[3],S=m[4]-k,E=m[5]-P;var F=this.removePageBorders?0:SCROLLBAR_PADDING,O=this.removePageBorders?0:VERTICAL_PADDING;y=(this.container.clientWidth-F)/S/PixelsPerInch.PDF_TO_CSS_UNITS,x=(this.container.clientHeight-O)/E/PixelsPerInch.PDF_TO_CSS_UNITS,N=Math.min(Math.abs(y),Math.abs(x));break;default:return void console.error('scrollPageIntoView: "'.concat(m[1].name,'" is not a valid destination type.'))}if(d||(N&&N!==this._currentScale?this.currentScaleValue=N:this._currentScale===UNKNOWN_SCALE&&(this.currentScaleValue=DEFAULT_SCALE_VALUE)),N!=="page-fit"||m[4]){var I=[u.viewport.convertToViewportPoint(k,P),u.viewport.convertToViewportPoint(k+S,P+E)],X=Math.min(I[0][0],I[1][0]),ne=Math.min(I[0][1],I[1][1]);g||(X=Math.max(X,0),ne=Math.max(ne,0)),this._scrollIntoView(u,{left:X,top:ne})}else this._scrollIntoView(u)}else this._setCurrentPageNumber(f,!0);else console.error('scrollPageIntoView: "'.concat(f,'" is not a valid pageNumber parameter.'))}}},{key:"_updateLocation",value:function(r){var f=this._currentScale,s=this._currentScaleValue,m=parseFloat(s)===f?Math.round(1e4*f)/100:s,w=r.id,g=this._pages[w-1],v=this.container,d=g.getPagePoint(v.scrollLeft-r.x,v.scrollTop-r.y),u=Math.round(d[0]),y=Math.round(d[1]),x="#page=".concat(w);this.isInPresentationMode||(x+="&zoom=".concat(m,",").concat(u,",").concat(y)),this._location={pageNumber:w,scale:m,top:y,left:u,rotation:this._pagesRotation,pdfOpenParams:x}}},{key:"cleanupPages",value:function(){var r=this._getVisiblePages(),f=r.views;if(f.length!==0){for(var s=0;s<_classPrivateFieldGet2(_renderedPagesView,this).length;s++){var m=_classPrivateFieldGet2(_renderedPagesView,this)[s];r.ids.has(m.id)||m.destroy()}var w,g=this._spreadMode===SpreadMode.NONE&&(this._scrollMode===ScrollMode.PAGE||this._scrollMode===ScrollMode.VERTICAL),v=this._currentPageNumber,d=!1,u=_createForOfIteratorHelper(f);try{for(u.s();!(w=u.n()).done;){var y=w.value;if(y.percent<100)break;if(y.id===v&&g){d=!0;break}}}catch(x){u.e(x)}finally{u.f()}this._setCurrentPageNumber(d?v:f[0].id),this._updateLocation(r.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}}},{key:"update",value:(o=_asyncToGenerator(_regeneratorRuntime().mark(function r(){var f,s;return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(_classPrivateFieldGet2(_scaleTimeoutId,this)===null||this.isInPresentationMode||this.exitPresentationMode||(clearTimeout(_classPrivateFieldGet2(_scaleTimeoutId,this)),_classPrivateFieldSet2(_scaleTimeoutId,this,null)),f=this._getVisiblePages(),f.views.length!==0){m.next=5;break}return m.abrupt("return");case 5:return s=DEFAULT_CACHE_SIZE,_classPrivateFieldGet2(_buffer,this).resize(s,f.ids),m.next=9,this.forceRendering(f);case 9:this.cleanupPages();case 10:case"end":return m.stop()}},r,this)})),function(){return o.apply(this,arguments)})},{key:"containsElement",value:function(r){return this.container.contains(r)}},{key:"focus",value:function(){this.container.focus()}},{key:"_isContainerRtl",get:function(){return getComputedStyle(this.container).direction==="rtl"}},{key:"isInPresentationMode",get:function(){return this.presentationModeState===PresentationModeState.FULLSCREEN}},{key:"isChangingPresentationMode",get:function(){return this.presentationModeState===PresentationModeState.CHANGING}},{key:"isHorizontalScrollbarEnabled",get:function(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}},{key:"isVerticalScrollbarEnabled",get:function(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}},{key:"_getVisiblePages",value:function(){var r=this._scrollMode===ScrollMode.PAGE?_classPrivateFieldGet2(_scrollModePageState,this).pages:this._pages,f=this._scrollMode===ScrollMode.HORIZONTAL,s=f&&this._isContainerRtl;return getVisibleElements({scrollEl:this.container,views:r,sortByVisibility:!0,horizontal:f,rtl:s})}},{key:"isPageVisible",value:function(r){return!!this.pdfDocument&&(Number.isInteger(r)&&r>0&&r<=this.pagesCount?this._getVisiblePages().ids.has(r):(console.error('isPageVisible: "'.concat(r,'" is not a valid page.')),!1))}},{key:"isPageCached",value:function(r){if(!this.pdfDocument)return!1;if(!(Number.isInteger(r)&&r>0&&r<=this.pagesCount))return console.error('isPageCached: "'.concat(r,'" is not a valid page.')),!1;var f=this._pages[r-1];return _classPrivateFieldGet2(_buffer,this).has(f)}},{key:"cleanup",value:function(){var r,f=_createForOfIteratorHelper(this._pages);try{for(f.s();!(r=f.n()).done;){var s=r.value;s.renderingState!==RenderingStates$1.FINISHED&&s.reset()}}catch(m){f.e(m)}finally{f.f()}}},{key:"_cancelRendering",value:function(){var r,f=_createForOfIteratorHelper(this._pages);try{for(f.s();!(r=f.n()).done;){var s,m=r.value;(s=m.contentContainer)===null||s===void 0||s.destroy(),m.contentContainer=null,m.cancelRendering()}}catch(w){f.e(w)}finally{f.f()}}},{key:"forceRendering",value:function(){var r=_asyncToGenerator(_regeneratorRuntime().mark(function f(s){var m,w,g,v,d,u=this;return _regeneratorRuntime().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(m=s||this._getVisiblePages(),!_classPrivateFieldGet2(_rendering,this)){y.next=4;break}return _classPrivateFieldGet2(_cacheTask,this).push({visiblePages:m}),y.abrupt("return");case 4:_classPrivateFieldSet2(_rendering,this,!0),w=[],g=_regeneratorRuntime().mark(function x(){var k;return _regeneratorRuntime().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(!((k=m.views[v].view).renderingState===RenderingStates$1.FINISHED&&u.documentViewer.scale>u.documentViewer.maxViewportZoom)){P.next=5;break}k.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0}),P.next=10;break;case 5:if(k.renderingState!==RenderingStates$1.FINISHED||!k.canvas){P.next=9;break}return P.abrupt("return",1);case 9:k.renderingState===RenderingStates$1.FINISHED&&k.reset();case 10:return P.next=12,_assertClassBrand(_PDFViewer_brand,u,_ensurePdfPageLoaded$1).call(u,k).then(function(){w.push(k.draw()),_classPrivateFieldGet2(_renderedPagesView,u).push(k)});case 12:case"end":return P.stop()}},x)}),v=0;case 8:if(!(v<m.views.length)){y.next=15;break}return y.delegateYield(g(),"t0",10);case 10:if(!y.t0){y.next=12;break}return y.abrupt("continue",12);case 12:v++,y.next=8;break;case 15:return y.next=17,Promise.all(w);case 17:if(_classPrivateFieldSet2(_rendering,this,!1),!_classPrivateFieldGet2(_cacheTask,this).length){y.next=24;break}return d=_classPrivateFieldGet2(_cacheTask,this).pop(),_classPrivateFieldSet2(_cacheTask,this,[]),y.next=23,this.forceRendering(d.visiblePages);case 23:return y.abrupt("return",!0);case 24:return y.abrupt("return",!1);case 25:case"end":return y.stop()}},f,this)}));return function(f){return r.apply(this,arguments)}}()},{key:"hasEqualPageSizes",get:function(){for(var r=this._pages[0],f=1,s=this._pages.length;f<s;++f){var m=this._pages[f];if(m.width!==r.width||m.height!==r.height)return!1}return!0}},{key:"getPagesOverview",value:function(){var r=this;return this._pages.map(function(f){var s=f.pdfPage.getViewport({scale:1});return!r.enablePrintAutoRotate||isPortraitOrientation(s)?{width:s.width,height:s.height,rotation:s.rotation}:{width:s.height,height:s.width,rotation:(s.rotation-90)%360}})}},{key:"optionalContentConfigPromise",get:function(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig()):Promise.resolve(null)},set:function(r){if(!(r instanceof Promise))throw new Error("Invalid optionalContentConfigPromise: ".concat(r));this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=r,this.refresh(!1,{optionalContentConfigPromise:r}))}},{key:"scrollMode",get:function(){return this._scrollMode},set:function(r){if(this._scrollMode!==r){if(!isValidScrollMode(r))throw new Error("Invalid scroll mode: ".concat(r));this.pagesCount>PagesCountLimit.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=r,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:r}),this._updateScrollMode(this._currentPageNumber))}}},{key:"_updateScrollMode",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,f=this._scrollMode,s=this.viewer;s.classList.toggle("scrollHorizontal",f===ScrollMode.HORIZONTAL),s.classList.toggle("scrollWrapped",f===ScrollMode.WRAPPED),this.pdfDocument&&r&&(f===ScrollMode.PAGE?_assertClassBrand(_PDFViewer_brand,this,_ensurePageViewVisible).call(this):this._previousScrollMode===ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(r,!0),this.update())}},{key:"spreadMode",get:function(){return this._spreadMode},set:function(r){if(this._spreadMode!==r){if(!isValidSpreadMode(r))throw new Error("Invalid spread mode: ".concat(r));this._spreadMode=r,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:r}),this._updateSpreadMode(this._currentPageNumber)}}},{key:"_updateSpreadMode",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(this.pdfDocument){var f=this.viewer,s=this._pages;if(this._scrollMode===ScrollMode.PAGE)_assertClassBrand(_PDFViewer_brand,this,_ensurePageViewVisible).call(this);else if(f.textContent="",this._spreadMode===SpreadMode.NONE){var m,w=_createForOfIteratorHelper(this._pages);try{for(w.s();!(m=w.n()).done;){var g=m.value;f.append(g.div)}}catch(x){w.e(x)}finally{w.f()}}else for(var v=this._spreadMode-1,d=null,u=0,y=s.length;u<y;++u)d===null?((d=document.createElement("div")).className="spread",f.append(d)):u%2===v&&(d=d.cloneNode(!1),f.append(d)),d.append(s[u].div);r&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(r,!0),this.update())}}},{key:"_getPageAdvance",value:function(r){var f=arguments.length>1&&arguments[1]!==void 0&&arguments[1];switch(this._scrollMode){case ScrollMode.WRAPPED:var s,m=this._getVisiblePages().views,w=new Map,g=_createForOfIteratorHelper(m);try{for(g.s();!(s=g.n()).done;){var v=s.value,d=v.id,u=v.y,y=v.percent,x=v.widthPercent;if(!(y===0||x<100)){var k=w.get(u);k||w.set(u,k||(k=[])),k.push(d)}}}catch(Q){g.e(Q)}finally{g.f()}var P,S=_createForOfIteratorHelper(w.values());try{for(S.s();!(P=S.n()).done;){var E=P.value,M=E.indexOf(r);if(M!==-1){var T=E.length;if(T===1)break;if(f)for(var D=M-1;D>=0;D--){var N=E[D],F=E[D+1]-1;if(N<F)return r-F}else for(var O=M+1,I=T;O<I;O++){var X=E[O],ne=E[O-1]+1;if(X>ne)return ne-r}if(f){var ye=E[0];if(ye<r)return r-ye+1}else{var J=E[T-1];if(J>r)return J-r+1}break}}}catch(Q){S.e(Q)}finally{S.f()}break;case ScrollMode.HORIZONTAL:break;case ScrollMode.PAGE:case ScrollMode.VERTICAL:if(this._spreadMode===SpreadMode.NONE)break;var te=this._spreadMode-1;if(f&&r%2!==te||!f&&r%2===te)break;var q,re=f?r-1:r+1,U=_createForOfIteratorHelper(this._getVisiblePages().views);try{for(U.s();!(q=U.n()).done;){var H=q.value,Z=H.id,Y=H.percent,W=H.widthPercent;if(Z===re){if(Y>0&&W===100)return 2;break}}}catch(Q){U.e(Q)}finally{U.f()}}return 1}},{key:"nextPage",value:function(){var r=this._currentPageNumber,f=this.pagesCount;if(r>=f)return!1;var s=this._getPageAdvance(r,!1)||1;return this.currentPageNumber=Math.min(r+s,f),!0}},{key:"previousPage",value:function(){var r=this._currentPageNumber;if(r<=1)return!1;var f=this._getPageAdvance(r,!0)||1;return this.currentPageNumber=Math.max(r-f,1),!0}},{key:"increaseScale",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(typeof r=="number"&&(console.error("The `increaseScale` method-signature was updated, please use an object instead."),r={steps:r}),this.pdfDocument){r||(r=Object.create(null));var f=this._currentScale;if(r.scaleFactor>1)f=Math.min(MAX_SCALE,Math.round(f*r.scaleFactor*100)/100);else{var s,m=(s=r.steps)!==null&&s!==void 0?s:1;do f=(f*DEFAULT_SCALE_DELTA).toFixed(2),f=Math.ceil(10*f)/10,f=Math.min(MAX_SCALE,f);while(--m>0&&f<MAX_SCALE)}r.noScroll=!0,this._setScale(f,r),_classPrivateFieldSet2(_rendering,this,!1)}}},{key:"decreaseScale",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(typeof r=="number"&&(console.error("The `decreaseScale` method-signature was updated, please use an object instead."),r={steps:r}),this.pdfDocument){r||(r=Object.create(null));var f=this._currentScale;if(r.scaleFactor>0&&r.scaleFactor<1)f=Math.max(MIN_SCALE,Math.round(f*r.scaleFactor*100)/100);else{var s,m=(s=r.steps)!==null&&s!==void 0?s:1;do f=(f/DEFAULT_SCALE_DELTA).toFixed(2),f=Math.floor(10*f)/10,f=Math.max(MIN_SCALE,f);while(--m>0&&f>MIN_SCALE)}r.noScroll=!0,this._setScale(f,r),_classPrivateFieldSet2(_rendering,this,!1)}}},{key:"updateScale",value:function(r){var f=r.drawingDelay,s=r.scaleFactor,m=s===void 0?null:s,w=r.steps,g=w===void 0?null:w,v=r.origin;if(g===null&&m===null)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(this.pdfDocument){var d=this._currentScale;if(m>0&&m!==1)d=Math.round(d*m*100)/100;else if(g){var u=g>0?DEFAULT_SCALE_DELTA:1/DEFAULT_SCALE_DELTA,y=g>0?Math.ceil:Math.floor;g=Math.abs(g);do d=y(10*(d*u).toFixed(2))/10;while(--g>0)}d=Math.max(MIN_SCALE,Math.min(MAX_SCALE,d)),this._setScale(d,{noScroll:!1,drawingDelay:f,origin:v})}}},{key:"resize",value:function(r){this._setScale(r,{noScroll:!1,drawingDelay:400}),_classPrivateFieldSet2(_rendering,this,!1)}},{key:"annotationEditorMode",get:function(){return this._annotationEditorUIManager?this._annotationEditorMode:pdfExports.AnnotationEditorType.DISABLE},set:function(r){if(!this._annotationEditorUIManager)throw new Error("The AnnotationEditor is not enabled.");if(this._annotationEditorMode!==r){if(!isValidAnnotationEditorMode(r))throw new Error("Invalid AnnotationEditor mode: ".concat(r));this.pdfDocument&&(this._annotationEditorMode=r,this.eventBus.dispatch("annotationeditormodechanged",{source:this,mode:r}),this._annotationEditorUIManager.updateMode(r))}}},{key:"refresh",value:function(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0],f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Object.create(null);if(this.pdfDocument){var s,m=_createForOfIteratorHelper(this._pages);try{for(m.s();!(s=m.n()).done;)s.value.update(f)}catch(w){m.e(w)}finally{m.f()}_classPrivateFieldGet2(_scaleTimeoutId,this)===null||this.isInPresentationMode||this.exitPresentationMode||(clearTimeout(_classPrivateFieldGet2(_scaleTimeoutId,this)),_classPrivateFieldSet2(_scaleTimeoutId,this,null)),r||this.update()}}},{key:"setFontFile",value:function(r){var f,s=_createForOfIteratorHelper(this._pages);try{for(s.s();!(f=s.n()).done;)f.value.fontFile=r}catch(m){s.e(m)}finally{s.f()}}},{key:"refreshCanvas",value:(n=_asyncToGenerator(_regeneratorRuntime().mark(function r(){var f;return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if((f=this._getVisiblePages()).views.length!==0){s.next=3;break}return s.abrupt("return");case 3:return s.next=5,this.renderCanvas(f);case 5:case"end":return s.stop()}},r,this)})),function(){return n.apply(this,arguments)})},{key:"renderCanvas",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function r(f){var s,m,w,g,v;return _regeneratorRuntime().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(s=f||this._getVisiblePages(),!_classPrivateFieldGet2(_rendering,this)){d.next=4;break}return _classPrivateFieldGet2(_cacheTask,this).push({visiblePages:s}),d.abrupt("return");case 4:for(_classPrivateFieldSet2(_rendering,this,!0),m=[],w=0;w<s.views.length;w++)g=s.views[w].view,m.push(g.redrawCanvas());return d.next=9,Promise.all(m);case 9:if(_classPrivateFieldSet2(_rendering,this,!1),!_classPrivateFieldGet2(_cacheTask,this).length){d.next=16;break}return v=_classPrivateFieldGet2(_cacheTask,this).pop(),_classPrivateFieldSet2(_cacheTask,this,[]),d.next=15,this.renderCanvas(v.visiblePages);case 15:return d.abrupt("return",!0);case 16:return d.abrupt("return",!1);case 17:case"end":return d.stop()}},r,this)})),function(r){return e.apply(this,arguments)})}]);var e,n,o}();function _layerProperties(){var e=this;return{get annotationEditorUIManager(){return e._annotationEditorUIManager},get annotationStorage(){var n;return(n=e.pdfDocument)===null||n===void 0?void 0:n.annotationStorage},get fieldObjectsPromise(){var n;return(n=e.pdfDocument)===null||n===void 0?void 0:n.getFieldObjects()},get hasJSActionsPromise(){var n;return(n=e.pdfDocument)===null||n===void 0?void 0:n.hasJSActions()},get linkService(){return e.linkService}}}function _initializePermissions(e){var n={annotationEditorMode:this._annotationEditorMode,textLayerMode:this.textLayerMode};return e&&(e.includes(pdfExports.PermissionFlag.COPY)||this.viewer.classList.add(ENABLE_PERMISSIONS_CLASS),e.includes(pdfExports.PermissionFlag.MODIFY_CONTENTS)||(n.annotationEditorMode=pdfExports.AnnotationEditorType.DISABLE),e.includes(pdfExports.PermissionFlag.MODIFY_ANNOTATIONS)||e.includes(pdfExports.PermissionFlag.FILL_INTERACTIVE_FORMS)||(n.annotationMode=pdfExports.AnnotationMode.ENABLE)),n}function _onePageRenderedOrForceFetch(){var e=this;if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return Promise.resolve();var n=new Promise(function(o){_classPrivateFieldSet2(_onVisibilityChange,e,function(){document.visibilityState==="hidden"&&(o(),document.removeEventListener("visibilitychange",_classPrivateFieldGet2(_onVisibilityChange,e)),_classPrivateFieldSet2(_onVisibilityChange,e,null))}),document.addEventListener("visibilitychange",_classPrivateFieldGet2(_onVisibilityChange,e))});return Promise.race([this._onePageRenderedCapability.promise,n])}function _ensurePageViewVisible(){if(this._scrollMode!==ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");var e=this._currentPageNumber,n=_classPrivateFieldGet2(_scrollModePageState,this),o=this.viewer;if(o.textContent="",n.pages.length=0,this._spreadMode!==SpreadMode.NONE||this.isInPresentationMode){var r=new Set,f=this._spreadMode-1;f===-1?r.add(e-1):e%2!==f?(r.add(e-1),r.add(e)):(r.add(e-2),r.add(e-1));var s=document.createElement("div");s.className="spread",this.isInPresentationMode;var m,w=_createForOfIteratorHelper(r);try{for(w.s();!(m=w.n()).done;){var g=m.value,v=this._pages[g];v&&(s.append(v.div),n.pages.push(v))}}catch(u){w.e(u)}finally{w.f()}o.append(s)}else{var d=this._pages[e-1];o.append(d.div),n.pages.push(d)}n.scrollDown=e>=n.previousPageNumber,n.previousPageNumber=e}function _isSameScale(e){return e===this._currentScale||Math.abs(e-this._currentScale)<1e-15}function _ensurePdfPageLoaded$1(e){return _ensurePdfPageLoaded2$1.apply(this,arguments)}function _ensurePdfPageLoaded2$1(){return(_ensurePdfPageLoaded2$1=_asyncToGenerator(_regeneratorRuntime().mark(function e(n){var o,r,f;return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!n.pdfPage){s.next=2;break}return s.abrupt("return",n.pdfPage);case 2:return s.prev=2,s.next=5,this.pdfDocument.getPage(n.id);case 5:return f=s.sent,n.pdfPage||n.setPdfPage(f),(o=(r=this.linkService)._cachedPageNumber)!==null&&o!==void 0&&o.call(r,f.ref)||this.linkService.cachePageRef(n.id,f.ref),s.abrupt("return",f);case 11:return s.prev=11,s.t0=s.catch(2),console.error("Unable to get page for page view",s.t0),s.abrupt("return",null);case 15:case"end":return s.stop()}},e,this,[[2,11]])}))).apply(this,arguments)}var DRAW_UPSCALE_FACTOR=2,MAX_NUM_SCALING_STEPS=3,THUMBNAIL_CANVAS_BORDER_WIDTH=0,THUMBNAIL_WIDTH=120,TempImageFactory=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"getCanvas",value:function(n,o){var r=_assertClassBrand(e,this,_tempCanvas)._||(_tempCanvas._=_assertClassBrand(e,this,document.createElement("canvas")));r.width=n,r.height=o;var f=r.getContext("2d",{alpha:!1});return f.save(),f.fillStyle="rgb(255, 255, 255)",f.fillRect(0,0,n,o),f.restore(),[r,r.getContext("2d")]}},{key:"destroyCanvas",value:function(){var n=_assertClassBrand(e,this,_tempCanvas)._;n&&(n.width=0,n.height=0),_tempCanvas._=_assertClassBrand(e,this,null)}}])}(),_tempCanvas={_:null},PDFThumbnailView=function(){return _createClass(function e(n){var o=n.container,r=n.id,f=n.defaultViewport,s=n.linkService,m=n.renderingQueue,w=n.pageColors;_classCallCheck(this,e),this.id=r,this.renderingId="thumbnail"+r,this.pageLabel=null,this.pdfPage=null,this.rotation=0,this.viewport=f,this.pdfPageRotate=f.rotation,this.pageColors=w||null,this.linkService=s,this.renderingQueue=m,this.renderTask=null,this.renderingState=RenderingStates$1.INITIAL,this.resume=null;var g=this.viewport.width,v=g/this.viewport.height;this.canvasWidth=THUMBNAIL_WIDTH,this.canvasHeight=this.canvasWidth/v|0,this.scale=this.canvasWidth/g;var d=document.createElement("div");d.onclick=function(){return s.goToPage(r),isMobile$1&&window.instance.UI.closeElement("leftPanel"),!1},this.anchor=d;var u=document.createElement("div");u.className="thumbnail",u.setAttribute("data-page-number",this.id),this.div=u;var y=document.createElement("div");y.className="thumbnailSelectionRing";var x=2*THUMBNAIL_CANVAS_BORDER_WIDTH;y.style.width=this.canvasWidth+x+"px",y.style.height=this.canvasHeight+x+"px",this.ring=y,u.append(y);var k=document.createElement("div");k.className="box-thumbnail",k.textContent=this.id,u.append(k),d.append(u),o.append(d)},[{key:"setPdfPage",value:function(e){this.pdfPage=e,this.pdfPageRotate=e.rotate;var n=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:1,rotation:n}),this.reset()}},{key:"reset",value:function(){this.cancelRendering(),this.renderingState=RenderingStates$1.INITIAL;var e=this.viewport.width,n=e/this.viewport.height;this.canvasHeight=this.canvasWidth/n|0,this.scale=this.canvasWidth/e,this.div.removeAttribute("data-loaded");var o=this.ring;o.textContent="";var r=2*THUMBNAIL_CANVAS_BORDER_WIDTH;o.style.width=this.canvasWidth+r+"px",o.style.height=this.canvasHeight+r+"px",this.canvas&&(this.canvas.width=0,this.canvas.height=0,delete this.canvas),this.image&&(this.image.removeAttribute("src"),delete this.image)}},{key:"update",value:function(e){var n=e.rotation,o=n===void 0?null:n;typeof o=="number"&&(this.rotation=o);var r=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:r}),this.reset()}},{key:"cancelRendering",value:function(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null),this.resume=null}},{key:"_getPageDrawContext",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,n=document.createElement("canvas"),o=n.getContext("2d",{alpha:!1}),r=new OutputScale;return n.width=e*this.canvasWidth*r.sx|0,n.height=e*this.canvasHeight*r.sy|0,{ctx:o,canvas:n,transform:r.scaled?[r.sx,0,0,r.sy,0,0]:null}}},{key:"_convertCanvasToImage",value:function(e){if(this.renderingState!==RenderingStates$1.FINISHED)throw new Error("_convertCanvasToImage: Rendering has not finished.");var n=this._reduceImage(e),o=document.createElement("img");o.className="thumbnailImage",this._thumbPageCanvas.then(function(r){o.setAttribute("aria-label",r)}),o.style.width=this.canvasWidth+"px",o.style.height=this.canvasHeight+"px",o.src=n.toDataURL(),this.image=o,this.div.setAttribute("data-loaded",!0),this.ring.append(o),n.width=0,n.height=0}},{key:"draw",value:function(){var e=this;if(this.renderingState!==RenderingStates$1.INITIAL)return console.error("Must be in new state before drawing"),Promise.resolve();var n=this.pdfPage;if(!n)return this.renderingState=RenderingStates$1.FINISHED,Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=RenderingStates$1.RUNNING;var o=function(){var v=_asyncToGenerator(_regeneratorRuntime().mark(function d(){var u,y=arguments;return _regeneratorRuntime().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(u=y.length>0&&y[0]!==void 0?y[0]:null,w===e.renderTask&&(e.renderTask=null),!(u instanceof pdfExports.RenderingCancelledException)){x.next=4;break}return x.abrupt("return");case 4:if(e.renderingState=RenderingStates$1.FINISHED,e._convertCanvasToImage(s),!u){x.next=8;break}throw u;case 8:case"end":return x.stop()}},d)}));return function(){return v.apply(this,arguments)}}(),r=this._getPageDrawContext(DRAW_UPSCALE_FACTOR),f=r.ctx,s=r.canvas,m={canvasContext:f,transform:r.transform,viewport:this.viewport.clone({scale:DRAW_UPSCALE_FACTOR*this.scale}),pageColors:this.pageColors},w=this.renderTask=n.render(m);w.onContinue=function(v){if(!e.renderingQueue.isHighestPriority(e))return e.renderingState=RenderingStates$1.PAUSED,void(e.resume=function(){e.renderingState=RenderingStates$1.RUNNING,v()});v()};var g=w.promise.then(function(){return o(null)},function(v){return o(v)});return g.finally(function(){var v;s.width=0,s.height=0,e.linkService.isPageCached(e.id)||(v=e.pdfPage)===null||v===void 0||v.cleanup()}),g}},{key:"setImage",value:function(e){if(this.renderingState===RenderingStates$1.INITIAL){var n=e.thumbnailCanvas,o=e.pdfPage,r=e.scale;n&&(this.pdfPage||this.setPdfPage(o),r<this.scale||(this.renderingState=RenderingStates$1.FINISHED,this._convertCanvasToImage(n)))}}},{key:"_reduceImage",value:function(e){var n=this._getPageDrawContext(),o=n.ctx,r=n.canvas;if(e.width<=2*r.width)return o.drawImage(e,0,0,e.width,e.height,0,0,r.width,r.height),r;for(var f=r.width<<MAX_NUM_SCALING_STEPS,s=r.height<<MAX_NUM_SCALING_STEPS,m=_slicedToArray(TempImageFactory.getCanvas(f,s),2),w=m[0],g=m[1];f>e.width||s>e.height;)f>>=1,s>>=1;for(g.drawImage(e,0,0,e.width,e.height,0,0,f,s);f>2*r.width;)g.drawImage(w,0,0,f,s,0,0,f>>1,s>>1),f>>=1,s>>=1;return o.drawImage(w,0,0,f,s,0,0,r.width,r.height),r}},{key:"_thumbPageTitle",get:function(){var e;return Promise.resolve("Page ".concat((e=this.pageLabel)!==null&&e!==void 0?e:this.id))}},{key:"_thumbPageCanvas",get:function(){var e;return Promise.resolve("Thumbnail of Page ".concat((e=this.pageLabel)!==null&&e!==void 0?e:this.id))}},{key:"setPageLabel",value:function(e){var n=this;this.pageLabel=typeof e=="string"?e:null,this._thumbPageTitle.then(function(o){n.anchor.title=o}),this.renderingState===RenderingStates$1.FINISHED&&this._thumbPageCanvas.then(function(o){var r;(r=n.image)===null||r===void 0||r.setAttribute("aria-label",o)})}}])}(),THUMBNAIL_SCROLL_MARGIN=-19,THUMBNAIL_SELECTED_CLASS="selected",_PDFThumbnailViewer_brand=new WeakSet,PDFThumbnailViewer=function(){return _createClass(function e(n){var o=n.container,r=n.renderingQueue,f=n.linkService;_classCallCheck(this,e),_classPrivateMethodInitSpec(this,_PDFThumbnailViewer_brand),this.container=o,this.linkService=f,this.renderingQueue=r,this.pageColors=null,typeof PDFJSDev<"u"&&PDFJSDev.test("MOZCENTRAL")||!this.pageColors||CSS.supports("color",this.pageColors.background)&&CSS.supports("color",this.pageColors.foreground)||((this.pageColors.background||this.pageColors.foreground)&&console.warn("PDFThumbnailViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."),this.pageColors=null),this.scroll=watchScroll(this.container,this._scrollUpdated.bind(this)),this._resetView()},[{key:"_scrollUpdated",value:function(){this.renderingQueue.renderHighestPriority()}},{key:"getThumbnail",value:function(e){return this._thumbnails[e]}},{key:"_getVisibleThumbs",value:function(){return getVisibleElements({scrollEl:this.container,views:this._thumbnails})}},{key:"scrollThumbnailIntoView",value:function(e){if(this.pdfDocument){var n=this._thumbnails[e-1];if(n){e!==this._currentPageNumber&&(this._thumbnails[this._currentPageNumber-1].div.classList.remove(THUMBNAIL_SELECTED_CLASS),n.div.classList.add(THUMBNAIL_SELECTED_CLASS));var o=this._getVisibleThumbs(),r=o.first,f=o.last,s=o.views;if(s.length>0){var m=!1;if(e<=r.id||e>=f.id)m=!0;else{var w,g=_createForOfIteratorHelper(s);try{for(g.s();!(w=g.n()).done;){var v=w.value,d=v.id,u=v.percent;if(d===e){m=u<100;break}}}catch(y){g.e(y)}finally{g.f()}}this._scrollUpdated(),m&&scrollIntoView(n.div,{top:THUMBNAIL_SCROLL_MARGIN})}this._currentPageNumber=e}else console.warn('scrollThumbnailIntoView: Invalid "pageNumber" parameter.')}}},{key:"pagesRotation",get:function(){return this._pagesRotation},set:function(e){if(!isValidRotation(e))throw new Error("Invalid thumbnails rotation angle.");if(this.pdfDocument&&this._pagesRotation!==e){this._pagesRotation=e;var n,o={rotation:e},r=_createForOfIteratorHelper(this._thumbnails);try{for(r.s();!(n=r.n()).done;)n.value.update(o)}catch(f){r.e(f)}finally{r.f()}}}},{key:"cleanup",value:function(){var e,n=_createForOfIteratorHelper(this._thumbnails);try{for(n.s();!(e=n.n()).done;){var o=e.value;o.renderingState!==RenderingStates$1.FINISHED&&o.reset()}}catch(r){n.e(r)}finally{n.f()}TempImageFactory.destroyCanvas()}},{key:"_resetView",value:function(){this._thumbnails=[],this._currentPageNumber=1,this._pageLabels=null,this._pagesRotation=0,this.container.textContent=""}},{key:"setDocument",value:function(e){var n=this;this.pdfDocument&&(this._cancelRendering(),this._resetView()),this.pdfDocument=e,e&&e.getPage(1).then(function(o){for(var r,f=e.numPages,s=o.getViewport({scale:1}),m=1;m<=f;++m){var w=new PDFThumbnailView({container:n.container,id:m,defaultViewport:s.clone(),linkService:n.linkService,renderingQueue:n.renderingQueue,pageColors:n.pageColors});n._thumbnails.push(w)}(r=n._thumbnails[0])===null||r===void 0||r.setPdfPage(o),n._thumbnails[n._currentPageNumber-1].div.classList.add(THUMBNAIL_SELECTED_CLASS)}).catch(function(o){console.error("Unable to initialize thumbnail viewer",o)})}},{key:"_cancelRendering",value:function(){var e,n=_createForOfIteratorHelper(this._thumbnails);try{for(n.s();!(e=n.n()).done;)e.value.cancelRendering()}catch(o){n.e(o)}finally{n.f()}}},{key:"setPageLabels",value:function(e){if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.")):this._pageLabels=null;for(var n=0,o=this._thumbnails.length;n<o;n++){var r,f;this._thumbnails[n].setPageLabel((r=(f=this._pageLabels)===null||f===void 0?void 0:f[n])!==null&&r!==void 0?r:null)}}}},{key:"forceRendering",value:function(){var e=this,n=this._getVisibleThumbs(),o=_assertClassBrand(_PDFThumbnailViewer_brand,this,_getScrollAhead).call(this,n),r=this.renderingQueue.getHighestPriority(n,this._thumbnails,o);return!!r&&(_assertClassBrand(_PDFThumbnailViewer_brand,this,_ensurePdfPageLoaded).call(this,r).then(function(){e.renderingQueue.renderView(r)}),!0)}}])}();function _ensurePdfPageLoaded(e){return _ensurePdfPageLoaded2.apply(this,arguments)}function _ensurePdfPageLoaded2(){return(_ensurePdfPageLoaded2=_asyncToGenerator(_regeneratorRuntime().mark(function e(n){var o;return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!n.pdfPage){r.next=2;break}return r.abrupt("return",n.pdfPage);case 2:return r.prev=2,r.next=5,this.pdfDocument.getPage(n.id);case 5:return o=r.sent,n.pdfPage||n.setPdfPage(o),r.abrupt("return",o);case 10:return r.prev=10,r.t0=r.catch(2),console.error("Unable to get page for thumb view",r.t0),r.abrupt("return",null);case 14:case"end":return r.stop()}},e,this,[[2,10]])}))).apply(this,arguments)}function _getScrollAhead(e){var n,o;return((n=e.first)===null||n===void 0?void 0:n.id)===1||((o=e.last)===null||o===void 0?void 0:o.id)!==this._thumbnails.length&&this.scroll.down}var CLEANUP_TIMEOUT=3e4,PDFRenderingQueue=function(){return _createClass(function n(){_classCallCheck(this,n),this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1},[{key:"setViewer",value:function(n){this.pdfViewer=n}},{key:"setThumbnailViewer",value:function(n){this.pdfThumbnailViewer=n}},{key:"isHighestPriority",value:function(n){return this.highestPriorityPage===n.renderingId}},{key:"hasViewer",value:function(){return!!this.pdfViewer}},{key:"renderHighestPriority",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function n(o){var r;return _regeneratorRuntime().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),f.next=3,this.pdfViewer.forceRendering(o);case 3:if(!f.sent){f.next=5;break}return f.abrupt("return");case 5:if(!this.isThumbnailViewEnabled||(r=this.pdfThumbnailViewer)===null||r===void 0||!r.forceRendering()){f.next=7;break}return f.abrupt("return");case 7:if(!this.printing){f.next=9;break}return f.abrupt("return");case 9:this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),CLEANUP_TIMEOUT));case 10:case"end":return f.stop()}},n,this)})),function(n){return e.apply(this,arguments)})},{key:"getHighestPriority",value:function(n,o,r){var f=arguments.length>3&&arguments[3]!==void 0&&arguments[3],s=n.views,m=s.length;if(m===0)return null;for(var w=0;w<m;w++){var g=s[w].view;if(!this.isViewFinished(g))return g}var v=n.first.id,d=n.last.id;if(d-v+1>m)for(var u=n.ids,y=1,x=d-v;y<x;y++){var k=r?v+y:d-y;if(!u.has(k)){var P=o[k-1];if(!this.isViewFinished(P))return P}}var S=r?d:v-2,E=o[S];return E&&!this.isViewFinished(E)||f&&(E=o[S+=r?1:-1])&&!this.isViewFinished(E)?E:null}},{key:"isViewFinished",value:function(n){return n.renderingState===RenderingStates.FINISHED}},{key:"renderView",value:function(n){var o=this;switch(n.renderingState){case RenderingStates.FINISHED:return!1;case RenderingStates.PAUSED:this.highestPriorityPage=n.renderingId,n.resume();break;case RenderingStates.RUNNING:this.highestPriorityPage=n.renderingId;break;case RenderingStates.INITIAL:this.highestPriorityPage=n.renderingId,n.draw().finally(function(){o.renderHighestPriority()})}return!0}}]);var e}(),UI_NOTIFICATION_CLASS="pdfSidebarNotification",_PDFSidebar_brand=new WeakSet,PDFSidebar=function(){return _createClass(function e(n){var o=n.elements,r=n.pdfViewer,f=n.pdfThumbnailViewer,s=n.eventBus,m=n.l10n;_classCallCheck(this,e),_classPrivateMethodInitSpec(this,_PDFSidebar_brand),this.isOpen=!1,this.active=SidebarView.THUMBS,this.isInitialViewSet=!1,this.isInitialEventDispatched=!1,this.onToggled=null,this.pdfViewer=r,this.pdfThumbnailViewer=f,this.outerContainer=o.outerContainer,this.sidebarContainer=o.sidebarContainer,this.toggleButton=o.toggleButton,this.thumbnailButton=o.thumbnailButton,this.outlineButton=o.outlineButton,this.attachmentsButton=o.attachmentsButton,this.layersButton=o.layersButton,this.thumbnailView=o.thumbnailView,this.outlineView=o.outlineView,this.attachmentsView=o.attachmentsView,this.layersView=o.layersView,this._outlineOptionsContainer=o.outlineOptionsContainer,this._currentOutlineItemButton=o.currentOutlineItemButton,this.eventBus=s,this.l10n=m,this.eventBus._on("pagesloaded",function(){})},[{key:"reset",value:function(){this.isInitialViewSet=!1,this.isInitialEventDispatched=!1,_assertClassBrand(_PDFSidebar_brand,this,_hideUINotification).call(this,!0),this.switchView(SidebarView.THUMBS)}},{key:"visibleView",get:function(){return this.isOpen?this.active:SidebarView.NONE}},{key:"setInitialView",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:SidebarView.NONE;this.isInitialViewSet||(this.isInitialViewSet=!0,e!==SidebarView.NONE&&e!==SidebarView.UNKNOWN?(this.switchView(e,!0),this.isInitialEventDispatched||_assertClassBrand(_PDFSidebar_brand,this,_dispatchEvent$1).call(this)):_assertClassBrand(_PDFSidebar_brand,this,_dispatchEvent$1).call(this))}},{key:"switchView",value:function(e){var n,o,r,f,s,m,w,g,v,d,u,y,x,k=arguments.length>1&&arguments[1]!==void 0&&arguments[1],P=e!==this.active,S=!1;switch(e){case SidebarView.NONE:return void(this.isOpen&&this.close());case SidebarView.THUMBS:this.isOpen&&P&&(S=!0);break;case SidebarView.ATTACHMENTS:if(this.attachmentsButton.disabled)return;break;case SidebarView.OUTLINE:case SidebarView.LAYERS:break;default:return void console.error('PDFSidebar.switchView: "'.concat(e,'" is not a valid view.'))}this.active=e;var E=e===SidebarView.THUMBS,M=e===SidebarView.OUTLINE,T=e===SidebarView.ATTACHMENTS,D=e===SidebarView.LAYERS;(n=this.thumbnailButton)===null||n===void 0||n.classList.toggle("toggled",E),(o=this.outlineButton)===null||o===void 0||o.classList.toggle("toggled",M),(r=this.attachmentsButton)===null||r===void 0||r.classList.toggle("toggled",T),(f=this.layersButton)===null||f===void 0||f.classList.toggle("toggled",D),(s=this.thumbnailButton)===null||s===void 0||s.setAttribute("aria-checked",E),(m=this.outlineButton)===null||m===void 0||m.setAttribute("aria-checked",M),(w=this.attachmentsButton)===null||w===void 0||w.setAttribute("aria-checked",T),(g=this.layersButton)===null||g===void 0||g.setAttribute("aria-checked",D),(v=this.thumbnailView)===null||v===void 0||v.classList.toggle("hidden",!E),(d=this.outlineView)===null||d===void 0||d.classList.toggle("hidden",!M),(u=this.attachmentsView)===null||u===void 0||u.classList.toggle("hidden",!T),(y=this.layersView)===null||y===void 0||y.classList.toggle("hidden",!D),(x=this._outlineOptionsContainer)===null||x===void 0||x.classList.toggle("hidden",!M),!k||this.isOpen?(S&&(_assertClassBrand(_PDFSidebar_brand,this,_updateThumbnailViewer).call(this),_assertClassBrand(_PDFSidebar_brand,this,_forceRendering).call(this)),P&&_assertClassBrand(_PDFSidebar_brand,this,_dispatchEvent$1).call(this)):this.open()}},{key:"open",value:function(){var e,n,o;this.isOpen||(this.isOpen=!0,(e=this.toggleButton)===null||e===void 0||e.classList.add("toggled"),(n=this.toggleButton)===null||n===void 0||n.setAttribute("aria-expanded","true"),(o=this.outerContainer)===null||o===void 0||o.classList.add("sidebarMoving","sidebarOpen"),this.active===SidebarView.THUMBS&&_assertClassBrand(_PDFSidebar_brand,this,_updateThumbnailViewer).call(this),_assertClassBrand(_PDFSidebar_brand,this,_forceRendering).call(this),_assertClassBrand(_PDFSidebar_brand,this,_dispatchEvent$1).call(this),_assertClassBrand(_PDFSidebar_brand,this,_hideUINotification).call(this))}},{key:"close",value:function(){var e,n,o,r;this.isOpen&&(this.isOpen=!1,(e=this.toggleButton)===null||e===void 0||e.classList.remove("toggled"),(n=this.toggleButton)===null||n===void 0||n.setAttribute("aria-expanded","false"),(o=this.outerContainer)===null||o===void 0||o.classList.add("sidebarMoving"),(r=this.outerContainer)===null||r===void 0||r.classList.remove("sidebarOpen"),_assertClassBrand(_PDFSidebar_brand,this,_forceRendering).call(this),_assertClassBrand(_PDFSidebar_brand,this,_dispatchEvent$1).call(this))}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}}])}();function _dispatchEvent$1(){this.isInitialViewSet&&!this.isInitialEventDispatched&&(this.isInitialEventDispatched=!0),this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.visibleView})}function _forceRendering(){this.onToggled?this.onToggled():(this.pdfViewer.forceRendering(),this.pdfThumbnailViewer.forceRendering())}function _updateThumbnailViewer(){for(var e=this.pdfViewer,n=this.pdfThumbnailViewer,o=e.pagesCount,r=0;r<o;r++){var f=e.getPageView(r);(f==null?void 0:f.renderingState)===RenderingStates$1.FINISHED&&n.getThumbnail(r).setImage(f)}n.scrollThumbnailIntoView(e.currentPageNumber)}function _hideUINotification(){var e,n,o=arguments.length>0&&arguments[0]!==void 0&&arguments[0];(this.isOpen||o)&&((e=this.toggleButton)===null||e===void 0||e.classList.remove(UI_NOTIFICATION_CLASS)),o&&((n=this.toggleButton)===null||n===void 0||n.setAttribute("data-l10n-id","toggle_sidebar"))}function _download(e,n){var o=document.createElement("a");if(!o.click)throw new Error('DownloadManager: "a.click()" is not supported.');o.href=e,o.target="_parent","download"in o&&(o.download=n),(document.body||document.documentElement).append(o),o.click(),o.remove()}var _openBlobUrls=new WeakMap,DownloadManager=function(){return _createClass(function e(){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_openBlobUrls,new WeakMap)},[{key:"downloadUrl",value:function(e,n){pdfExports.createValidAbsoluteUrl(e,"http://example.com")?_download(e+"#pdfjs.action=download",n):console.error("downloadUrl - not a valid URL: ".concat(e))}},{key:"downloadData",value:function(e,n,o){_download(URL.createObjectURL(new Blob([e],{type:o})),n)}},{key:"openOrDownloadData",value:function(e,n,o){var r=pdfExports.isPdfFile(o),f=r?"application/pdf":"";if(r){var s,m=_classPrivateFieldGet2(_openBlobUrls,this).get(e);m||(m=URL.createObjectURL(new Blob([n],{type:f})),_classPrivateFieldGet2(_openBlobUrls,this).set(e,m)),typeof PDFJSDev>"u"||PDFJSDev.test("GENERIC")?s="?file="+encodeURIComponent(m+"#"+o):PDFJSDev.test("CHROME")&&(s=chrome.runtime.getURL("/content/web/viewer.html")+"?file="+encodeURIComponent(m+"#"+o));try{return window.open(s),!0}catch(w){console.error("openOrDownloadData: ".concat(w)),URL.revokeObjectURL(m),_classPrivateFieldGet2(_openBlobUrls,this).delete(e)}}return this.downloadData(n,o,f),!1}},{key:"download",value:function(e,n,o){_download(URL.createObjectURL(e),o)}}])}(),DefaultExternalServices=function(){return _createClass(function e(){throw _classCallCheck(this,e),new Error("Cannot initialize DefaultExternalServices.")},null,[{key:"updateFindControlState",value:function(e){}},{key:"updateFindMatchesCount",value:function(e){}},{key:"initPassiveLoading",value:function(e){}},{key:"reportTelemetry",value:function(e){}},{key:"createDownloadManager",value:function(){throw new Error("Not implemented: createDownloadManager")}},{key:"createPreferences",value:function(){throw new Error("Not implemented: createPreferences")}},{key:"createL10n",value:function(e){throw new Error("Not implemented: createL10n")}},{key:"createScripting",value:function(e){throw new Error("Not implemented: createScripting")}},{key:"supportsIntegratedFind",get:function(){return shadow(this,"supportsIntegratedFind",!1)}},{key:"supportsDocumentFonts",get:function(){return shadow(this,"supportsDocumentFonts",!0)}},{key:"supportedMouseWheelZoomModifierKeys",get:function(){return shadow(this,"supportedMouseWheelZoomModifierKeys",{ctrlKey:!0,metaKey:!0})}},{key:"isInAutomation",get:function(){return shadow(this,"isInAutomation",!1)}},{key:"updateEditorStates",value:function(e){throw new Error("Not implemented: updateEditorStates")}}])}(),GenericExternalServices=function(e){function n(){return _classCallCheck(this,n),_callSuper(this,n,arguments)}return _inherits(n,DefaultExternalServices),_createClass(n,null,[{key:"createDownloadManager",value:function(){return new DownloadManager}}])}(),CSS_CLASS_GRAB="grab-to-pan-grab",_GrabToPan_brand=new WeakSet,GrabToPan=function(){return _createClass(function e(n){_classCallCheck(this,e),_classPrivateMethodInitSpec(this,_GrabToPan_brand),this.element=n.element,this.document=n.element.ownerDocument,typeof n.ignoreTarget=="function"&&(this.ignoreTarget=n.ignoreTarget),this.onActiveChanged=n.onActiveChanged,this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.toggle=this.toggle.bind(this),this._onMouseDown=_assertClassBrand(_GrabToPan_brand,this,_onMouseDown).bind(this),this._onMouseMove=_assertClassBrand(_GrabToPan_brand,this,_onMouseMove).bind(this),this._endPan=_assertClassBrand(_GrabToPan_brand,this,_endPan).bind(this),(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"},[{key:"activate",value:function(){var e;this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onMouseDown,!0),this.element.classList.add(CSS_CLASS_GRAB),(e=this.onActiveChanged)===null||e===void 0||e.call(this,!0))}},{key:"deactivate",value:function(){var e;this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onMouseDown,!0),this._endPan(),this.element.classList.remove(CSS_CLASS_GRAB),(e=this.onActiveChanged)===null||e===void 0||e.call(this,!1))}},{key:"toggle",value:function(){this.active?this.deactivate():this.activate()}},{key:"ignoreTarget",value:function(e){return e.matches("a[href], a[href] *, input, textarea, button, button *, select, option")}}])}();function _onMouseDown(e){if(e.button===0&&!this.ignoreTarget(e.target)){if(e.originalTarget)try{e.originalTarget.tagName}catch{return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=e.clientX,this.clientYStart=e.clientY,this.document.addEventListener("mousemove",this._onMouseMove,!0),this.document.addEventListener("mouseup",this._endPan,!0),this.element.addEventListener("scroll",this._endPan,!0),e.preventDefault(),e.stopPropagation();var n=document.activeElement;n&&!n.contains(e.target)&&n.blur()}}function _onMouseMove(e){if(this.element.removeEventListener("scroll",this._endPan,!0),1&e.buttons){var n=e.clientX-this.clientXStart,o=e.clientY-this.clientYStart,r=this.scrollTopStart-o,f=this.scrollLeftStart-n;this.element.scrollTo?this.element.scrollTo({top:r,left:f,behavior:"instant"}):(this.element.scrollTop=r,this.element.scrollLeft=f),this.overlay.parentNode||document.body.append(this.overlay)}else this._endPan()}function _endPan(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onMouseMove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.remove()}var CursorTool={SELECT:0,HAND:1,ZOOM:2},_PDFCursorTools_brand=new WeakSet,PDFCursorTools=function(){return _createClass(function e(n){var o=this,r=n.container,f=n.eventBus,s=n.cursorToolOnLoad,m=s===void 0?CursorTool.SELECT:s;_classCallCheck(this,e),_classPrivateMethodInitSpec(this,_PDFCursorTools_brand),this.container=r,this.eventBus=f,this.active=CursorTool.SELECT,this.previouslyActive=null,this.handTool=new GrabToPan({element:this.container}),_assertClassBrand(_PDFCursorTools_brand,this,_addEventListeners).call(this),Promise.resolve().then(function(){o.switchTool(m)})},[{key:"activeTool",get:function(){return this.active}},{key:"switchTool",value:function(e){var n=this;if(this.previouslyActive===null&&e!==this.active){var o=function(){switch(n.active){case CursorTool.SELECT:break;case CursorTool.HAND:n.handTool.deactivate()}};switch(e){case CursorTool.SELECT:o();break;case CursorTool.HAND:o(),this.handTool.activate();break;case CursorTool.ZOOM:default:return void console.error('switchTool: "'.concat(e,'" is an unsupported value.'))}this.active=e,_assertClassBrand(_PDFCursorTools_brand,this,_dispatchEvent$2).call(this)}}}])}();function _dispatchEvent$2(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}function _addEventListeners(){var e=this;this.eventBus._on("switchcursortool",function(s){e.switchTool(s.tool)});var n=pdfExports.AnnotationEditorType.NONE,o=PresentationModeState.NORMAL,r=function(){var s,m=e.active;e.switchTool(CursorTool.SELECT),(s=e.previouslyActive)!==null&&s!==void 0||(e.previouslyActive=m)},f=function(){var s=e.previouslyActive;s!==null&&n===pdfExports.AnnotationEditorType.NONE&&o===PresentationModeState.NORMAL&&(e.previouslyActive=null,e.switchTool(s))};this.eventBus._on("secondarytoolbarreset",function(s){e.previouslyActive!==null&&(n=pdfExports.AnnotationEditorType.NONE,o=PresentationModeState.NORMAL,f())}),this.eventBus._on("annotationeditormodechanged",function(s){var m=s.mode;n=m,m===pdfExports.AnnotationEditorType.NONE?f():r()}),this.eventBus._on("presentationmodechanged",function(s){var m=s.state;o=m,m===PresentationModeState.NORMAL?f():m===PresentationModeState.FULLSCREEN&&r()})}var DELAY_BEFORE_HIDING_CONTROLS=3e3,ACTIVE_SELECTOR="pdfPresentationMode",CONTROLS_SELECTOR="pdfPresentationModeControls",MOUSE_SCROLL_COOLDOWN_TIME=50,PAGE_SWITCH_THRESHOLD=.1,SWIPE_MIN_DISTANCE_THRESHOLD=50,SWIPE_ANGLE_THRESHOLD=Math.PI/6,_state=new WeakMap,_args=new WeakMap,_PDFPresentationMode_brand=new WeakSet,PDFPresentationMode=function(){return _createClass(function n(o){var r=o.container,f=o.pdfViewer,s=o.eventBus;_classCallCheck(this,n),_classPrivateMethodInitSpec(this,_PDFPresentationMode_brand),_classPrivateFieldInitSpec(this,_state,PresentationModeState.UNKNOWN),_classPrivateFieldInitSpec(this,_args,null),this.container=r,this.pdfViewer=f,this.eventBus=s,this.contextMenuOpen=!1,this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0,this.touchSwipeState=null,this.isHandlingFullScreen=!1},[{key:"request",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function n(){var o,r,f;return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(o=this.container,r=this.pdfViewer,!this.active&&r.pagesCount){s.next=3;break}return s.abrupt("return",!1);case 3:return _assertClassBrand(_PDFPresentationMode_brand,this,_addFullscreenChangeListeners).call(this),_assertClassBrand(_PDFPresentationMode_brand,this,_notifyStateChange).call(this,PresentationModeState.CHANGING),f=null,o.webkitRequestFullScreen?f=o.webkitRequestFullScreen():o.mozRequestFullScreen?f=o.mozRequestFullScreen():o.requestFullscreen&&(f=o.requestFullscreen()),_classPrivateFieldSet2(_args,this,{pageNumber:r.currentPageNumber,scaleValue:r.currentScaleValue,scrollMode:r.scrollMode,spreadMode:null,annotationEditorMode:null}),r.spreadMode===SpreadMode.NONE||r.pageViewsReady&&r.hasEqualPageSizes||(console.warn("Ignoring Spread modes when entering PresentationMode, since the document may contain varying page sizes."),_classPrivateFieldGet2(_args,this).spreadMode=r.spreadMode),r.annotationEditorMode!==pdfExports.AnnotationEditorType.DISABLE&&(_classPrivateFieldGet2(_args,this).annotationEditorMode=r.annotationEditorMode),s.prev=10,s.next=13,f;case 13:return r.focus(),s.abrupt("return",!0);case 17:s.prev=17,s.t0=s.catch(10),_assertClassBrand(_PDFPresentationMode_brand,this,_removeFullscreenChangeListeners).call(this),_assertClassBrand(_PDFPresentationMode_brand,this,_notifyStateChange).call(this,PresentationModeState.NORMAL);case 21:return s.abrupt("return",!1);case 22:case"end":return s.stop()}},n,this,[[10,17]])})),function(){return e.apply(this,arguments)})},{key:"active",get:function(){return _classPrivateFieldGet2(_state,this)===PresentationModeState.CHANGING||_classPrivateFieldGet2(_state,this)===PresentationModeState.FULLSCREEN}}]);var e}();function _mouseWheel(e){if(this.active){e.preventDefault();var n=normalizeWheelEventDelta(e),o=Date.now(),r=this.mouseScrollTimeStamp;if(!(o>r&&o-r<MOUSE_SCROLL_COOLDOWN_TIME)&&((this.mouseScrollDelta>0&&n<0||this.mouseScrollDelta<0&&n>0)&&_assertClassBrand(_PDFPresentationMode_brand,this,_resetMouseScrollState).call(this),this.mouseScrollDelta+=n,Math.abs(this.mouseScrollDelta)>=PAGE_SWITCH_THRESHOLD)){var f=this.mouseScrollDelta;_assertClassBrand(_PDFPresentationMode_brand,this,_resetMouseScrollState).call(this),(f>0?this.pdfViewer.previousPage():this.pdfViewer.nextPage())&&(this.mouseScrollTimeStamp=o)}}}function _notifyStateChange(e){_classPrivateFieldSet2(_state,this,e),this.eventBus.dispatch("presentationmodechanged",{source:this,state:e})}function _enter(){var e=this;_assertClassBrand(_PDFPresentationMode_brand,this,_notifyStateChange).call(this,PresentationModeState.FULLSCREEN),this.container.classList.add(ACTIVE_SELECTOR),setTimeout(function(){e.pdfViewer.scrollMode=ScrollMode.PAGE,_classPrivateFieldGet2(_args,e).spreadMode!==null&&(e.pdfViewer.spreadMode=SpreadMode.NONE),e.pdfViewer.currentPageNumber=_classPrivateFieldGet2(_args,e).pageNumber,e.pdfViewer.currentScaleValue="page-fit",_classPrivateFieldGet2(_args,e).annotationEditorMode!==null&&(e.pdfViewer.annotationEditorMode=pdfExports.AnnotationEditorType.NONE)},0),_assertClassBrand(_PDFPresentationMode_brand,this,_addWindowListeners).call(this),_assertClassBrand(_PDFPresentationMode_brand,this,_showControls).call(this),this.contextMenuOpen=!1,window.getSelection().removeAllRanges()}function _exit(){var e=this,n=this.pdfViewer.currentPageNumber;this.container.classList.remove(ACTIVE_SELECTOR),setTimeout(function(){_assertClassBrand(_PDFPresentationMode_brand,e,_removeFullscreenChangeListeners).call(e),_assertClassBrand(_PDFPresentationMode_brand,e,_notifyStateChange).call(e,PresentationModeState.NORMAL),e.pdfViewer.scrollMode=_classPrivateFieldGet2(_args,e).scrollMode,_classPrivateFieldGet2(_args,e).spreadMode!==null&&(e.pdfViewer.spreadMode=_classPrivateFieldGet2(_args,e).spreadMode),e.pdfViewer.exitPresentationMode=!0,e.pdfViewer.currentPageNumber=n,e.pdfViewer.currentScaleValue=_classPrivateFieldGet2(_args,e).scaleValue,_classPrivateFieldGet2(_args,e).annotationEditorMode!==null&&(e.pdfViewer.annotationEditorMode=_classPrivateFieldGet2(_args,e).annotationEditorMode),_classPrivateFieldSet2(_args,e,null)},0),_assertClassBrand(_PDFPresentationMode_brand,this,_removeWindowListeners).call(this),_assertClassBrand(_PDFPresentationMode_brand,this,_hideControls).call(this),_assertClassBrand(_PDFPresentationMode_brand,this,_resetMouseScrollState).call(this),this.contextMenuOpen=!1}function _mouseDown(e){var n;if(this.contextMenuOpen)return this.contextMenuOpen=!1,void e.preventDefault();e.button===0&&(e.target.href&&(n=e.target.parentNode)!==null&&n!==void 0&&n.hasAttribute("data-internal-link")||(e.preventDefault(),e.shiftKey?this.pdfViewer.previousPage():this.pdfViewer.nextPage()))}function _contextMenu(){this.contextMenuOpen=!0}function _showControls(){var e=this;this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(CONTROLS_SELECTOR),this.controlsTimeout=setTimeout(function(){e.container.classList.remove(CONTROLS_SELECTOR),delete e.controlsTimeout},DELAY_BEFORE_HIDING_CONTROLS)}function _hideControls(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove(CONTROLS_SELECTOR),delete this.controlsTimeout)}function _resetMouseScrollState(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0}function _touchSwipe(e){if(this.active)if(e.touches.length>1)this.touchSwipeState=null;else switch(e.type){case"touchstart":this.touchSwipeState={startX:e.touches[0].pageX,startY:e.touches[0].pageY,endX:e.touches[0].pageX,endY:e.touches[0].pageY};break;case"touchmove":if(this.touchSwipeState===null)return;this.touchSwipeState.endX=e.touches[0].pageX,this.touchSwipeState.endY=e.touches[0].pageY,e.preventDefault();break;case"touchend":if(this.touchSwipeState===null)return;var n=0,o=this.touchSwipeState.endX-this.touchSwipeState.startX,r=this.touchSwipeState.endY-this.touchSwipeState.startY,f=Math.abs(Math.atan2(r,o));Math.abs(o)>SWIPE_MIN_DISTANCE_THRESHOLD&&(f<=SWIPE_ANGLE_THRESHOLD||f>=Math.PI-SWIPE_ANGLE_THRESHOLD)?n=o:Math.abs(r)>SWIPE_MIN_DISTANCE_THRESHOLD&&Math.abs(f-Math.PI/2)<=SWIPE_ANGLE_THRESHOLD&&(n=r),n>0?this.pdfViewer.previousPage():n<0&&this.pdfViewer.nextPage()}}function _addWindowListeners(){this.showControlsBind=_assertClassBrand(_PDFPresentationMode_brand,this,_showControls).bind(this),this.mouseDownBind=_assertClassBrand(_PDFPresentationMode_brand,this,_mouseDown).bind(this),this.mouseWheelBind=_assertClassBrand(_PDFPresentationMode_brand,this,_mouseWheel).bind(this),this.resetMouseScrollStateBind=_assertClassBrand(_PDFPresentationMode_brand,this,_resetMouseScrollState).bind(this),this.contextMenuBind=_assertClassBrand(_PDFPresentationMode_brand,this,_contextMenu).bind(this),this.touchSwipeBind=_assertClassBrand(_PDFPresentationMode_brand,this,_touchSwipe).bind(this),window.addEventListener("mousemove",this.showControlsBind),window.addEventListener("mousedown",this.mouseDownBind),window.addEventListener("wheel",this.mouseWheelBind,{passive:!1}),window.addEventListener("keydown",this.resetMouseScrollStateBind),window.addEventListener("contextmenu",this.contextMenuBind),window.addEventListener("touchstart",this.touchSwipeBind),window.addEventListener("touchmove",this.touchSwipeBind),window.addEventListener("touchend",this.touchSwipeBind)}function _removeWindowListeners(){window.removeEventListener("mousemove",this.showControlsBind),window.removeEventListener("mousedown",this.mouseDownBind),window.removeEventListener("wheel",this.mouseWheelBind,{passive:!1}),window.removeEventListener("keydown",this.resetMouseScrollStateBind),window.removeEventListener("contextmenu",this.contextMenuBind),window.removeEventListener("touchstart",this.touchSwipeBind),window.removeEventListener("touchmove",this.touchSwipeBind),window.removeEventListener("touchend",this.touchSwipeBind),delete this.showControlsBind,delete this.mouseDownBind,delete this.mouseWheelBind,delete this.resetMouseScrollStateBind,delete this.contextMenuBind,delete this.touchSwipeBind}function _fullscreenChange(){var e=this;this.isHandlingFullScreen||(this.isHandlingFullScreen=!0,document.fullscreenElement?_assertClassBrand(_PDFPresentationMode_brand,this,_enter).call(this):_assertClassBrand(_PDFPresentationMode_brand,this,_exit).call(this),setTimeout(function(){e.isHandlingFullScreen=!1},0))}function _addFullscreenChangeListeners(){this.fullscreenChangeBind=_assertClassBrand(_PDFPresentationMode_brand,this,_fullscreenChange).bind(this),window.addEventListener("fullscreenchange",this.fullscreenChangeBind),window.addEventListener("webkitfullscreenchange",this.fullscreenChangeBind),window.addEventListener("mozfullscreenchange",this.fullscreenChangeBind)}function _removeFullscreenChangeListeners(){window.removeEventListener("fullscreenchange",this.fullscreenChangeBind),window.removeEventListener("webkitfullscreenchange",this.fullscreenChangeBind),window.removeEventListener("mozfullscreenchange",this.fullscreenChangeBind),delete this.fullscreenChangeBind}var annotationStore={selectedName:null,annotationsAll:null,notFirstRender:!1,creating:!1,fileData:null,$t:null,signatures:[],highlightLink:!0,highlightForm:!0,cropping:!1,ignoreColors:[],freetextDefault:{fontName:"Helvetica",fontStyle:"normal",fontWeight:"normal",fontSize:14,textAlignment:"left",color:"rgb(0, 0, 0)",borderWidth:0,borderColor:"rgb(0, 0, 0)",fillColor:""},polygon:{showPerimeter:!0,showArea:!0},rectangle:{showPerimeter:!0,showArea:!0},circle:{showRadius:!1,showPerimeter:!1,showArea:!0},arc:{showRadius:!1,showAngle:!0,showArcLength:!1}},Signatures=function(){return _createClass(function n(o){var r=o.pdfViewer,f=o.eventBus,s=o.type;_classCallCheck(this,n),this.pdfViewer=r,this.eventBus=f,this.type=s,this.path=[],this.inkPath=[],this.currentPath=[],this.areaBound=[NaN,NaN,NaN,NaN],this.inkPadding={x:10,y:10},this.strokeWidth=5,this.strokColor="#000",this.onMousedown=this.handleMouseDown.bind(this),this.onMousemove=this.handleMouseMove.bind(this),this.onMouseup=this.handleMouseUp.bind(this),this.onHandleGetSignData=this.getData.bind(this),this.onHandleInitCursorStyle=this.initCursorStyle.bind(this),this.init()},[{key:"init",value:function(){var n=document.getElementById("digitalTrackpadCanvas"),o=document.getElementById("electronicTrackpadCanvas");this.canvas=this.type?n:o,this.canvas||(this.canvas=document.createElement("canvas"),this.canvas.width=578,this.canvas.height=270),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cursor="crosshair",this.canvas.addEventListener("mousedown",this.onMousedown),this.canvas.addEventListener("touchstart",this.onMousedown),this.eventBus._on("getSignData",this.onHandleGetSignData),this.eventBus._on("initCursorStyle",this.onHandleInitCursorStyle)}},{key:"handleMouseDown",value:function(n){if(!n.changedTouches||n.changedTouches.length===1){var o,r,f=n.clientX||n.changedTouches[0].clientX,s=n.clientY||n.changedTouches[0].clientY;isMobile$1&&this.type?(o=s-this.canvas.getBoundingClientRect().top,r=this.canvas.height-(f-this.canvas.getBoundingClientRect().left)):(o=f-this.canvas.getBoundingClientRect().left,r=s-this.canvas.getBoundingClientRect().top),this.ctx.lineWidth=this.strokeWidth,this.ctx.strokeStyle=this.strokColor,this.ctx.lineJoin="round",this.ctx.lineCap="round",this.currentPath.length>0&&(this.inkPath.push(this.currentPath),this.currentPath=[]),this.ctx.beginPath(),this.ctx.moveTo(o,r),this.mousedown=!0,this.pressPoint={x:o,y:r},document.addEventListener("mousemove",this.onMousemove),document.addEventListener("mouseup",this.onMouseup),document.addEventListener("touchmove",this.onMousemove),document.addEventListener("touchend",this.onMouseup)}}},{key:"handleMouseMove",value:function(n){var o,r,f=n.clientX||n.changedTouches[0].clientX,s=n.clientY||n.changedTouches[0].clientY;if(isMobile$1&&this.type?(o=s-this.canvas.getBoundingClientRect().top,r=this.canvas.height-(f-this.canvas.getBoundingClientRect().left)):(o=f-this.canvas.getBoundingClientRect().left,r=s-this.canvas.getBoundingClientRect().top),!(o>this.canvas.width||r>this.canvas.height||o<0||r<0)){var m=!0;this.mousedown&&this.pressPoint&&o==this.pressPoint.x&&r==this.pressPoint.y&&(m=!1),m&&(this.ctx.lineTo(o,r),this.ctx.stroke(),this.path.push([o,r]),this.currentPath.push({x:o,y:r}))}}},{key:"handleMouseUp",value:function(){document.removeEventListener("mousemove",this.onMousemove),document.removeEventListener("mouseup",this.onMouseup),document.removeEventListener("touchmove",this.onMousemove),document.removeEventListener("touchend",this.onMouseup),this.mousedown=!1,this.pressPoint={x:-1,y:-1};var n=this.getRect();this.rect=n,this.currentPath.length>0&&(this.inkPath.push(this.currentPath),this.currentPath=[],this.eventBus.dispatch("signaturesImageChanged",{type:"addSignature",imageBase64:this.getImageBase64()}))}},{key:"clear",value:function(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.path=[],this.inkPath=[],this.currentPath=[],this.areaBound=[NaN,NaN,NaN,NaN],this.initCursorStyle(),this.eventBus.dispatch("signaturesImageChanged",{type:"clear",imageBase64:null})}},{key:"reset",value:function(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.path=[],this.inkPath=[],this.currentPath=[],this.areaBound=[NaN,NaN,NaN,NaN],this.onMousedown=null,this.onMousemove=null,this.onMouseup=null,this.onHandleGetSignData=null,this.onHandleInitCursorStyle=null,this.eventBus.dispatch("signaturesImageChanged",{type:"reset",imageBase64:null})}},{key:"getRect",value:function(){var n=[],o=[];this.path.forEach(function(w){n.push(w[0]),o.push(w[1])});var r=Math.min.apply(Math,o),f=Math.min.apply(Math,n),s=Math.max.apply(Math,o),m=Math.max.apply(Math,n);return{left:f,top:r,bottom:s,right:m,width:m-f,height:s-r}}},{key:"getImageBase64",value:function(){var n=null;if(this.path.length!==0){var o=this.getInkPathData();n=o.toDataURL("image/png"),o||(n=(o=this.paintFinalCanvas()).toDataURL("image/jpeg"))}return n}},{key:"toImage",value:function(n){var o=n.annotation,r=n.imageBase64,f=o.annotPtr,s=o.rect,m=o.pagePtr,w=null;if(this.path.length!==0){var g=this.getInkPathData(),v=g.toDataURL("image/png");g||(v=(g=this.paintFinalCanvas()).toDataURL("image/jpeg")),w=v}this.dataURL=w||r;var d=w?this.dataURLToArrayBuffer(w):null;if(f&&(d||r)&&!this.type)return this.eventBus.dispatch("updateSignatureAp",{type:this.type,annotPtr:f,pagePtr:m,rect:s,imageArray:d,imageBase64:r,annotation:o}),w}},{key:"getData",value:function(n){if(this.path.length!==0){this.layerData=n;var o={operate:"add-annot",type:"image",pageIndex:this.layerData.page+1,imageBase64:this.dataURL,date:new Date},r=this.formatPath();r.path;var f=r.rect;o.rect=f,this.eventBus.dispatch("createSignature",o)}}},{key:"calcInkPath",value:function(){if(this.inkPath.length>0){for(var n=[NaN,NaN,NaN,NaN],o=[],r=0;r<this.inkPath.length;r++)for(var f=0;f<this.inkPath[r].length;f++)isNaN(n[0])?(n[0]=this.inkPath[r][f].x,n[1]=this.inkPath[r][f].y,n[2]=this.inkPath[r][f].x,n[3]=this.inkPath[r][f].y):(n[0]>this.inkPath[r][f].x&&(n[0]=this.inkPath[r][f].x),n[1]>this.inkPath[r][f].y&&(n[1]=this.inkPath[r][f].y),n[2]<this.inkPath[r][f].x&&(n[2]=this.inkPath[r][f].x),n[3]<this.inkPath[r][f].y&&(n[3]=this.inkPath[r][f].y));if(!isNaN(n[0]))for(var s={x:this.inkPadding.x-n[0],y:this.inkPadding.y-n[1]},m=0;m<this.inkPath.length;m++){var w=[];o.push(w);for(var g=0;g<this.inkPath[m].length;g++)w.push({x:this.inkPath[m][g].x+s.x,y:this.inkPath[m][g].y+s.y})}return{areaBound:n,inkPaths:o}}}},{key:"getInkPathData",value:function(){var n=this.calcInkPath(),o=n.areaBound,r=n.inkPaths;if(!isNaN(o[0])){var f=document.createElement("canvas"),s=f.getContext("2d");f.width=o[2]-o[0]+2*this.inkPadding.x,f.height=o[3]-o[1]+2*this.inkPadding.y,s.strokeStyle=this.strokColor,s.lineWidth=this.strokeWidth;for(var m=0;m<r.length;m++)if(r[m].length==1&&(s.beginPath(),s.fillStyle=this.strokColor,s.ellipse(r[m][0].x,r[m][0].y,this.strokeWidth/2,this.strokeWidth/2,0,0,360,!1),s.fill(),s.closePath()),r[m].length>1){s.beginPath(),s.moveTo(r[m][0].x,r[m][0].y);for(var w=1;w<r[m].length;w++)s.lineTo(r[m][w].x,r[m][w].y);s.stroke(),s.closePath()}return f}return null}},{key:"formatPath",value:function(){for(var n="",o=this.path.length,r=[],f=[],s=0;s<o;s+=2){var m=this.handlePoint(this.path[s]);if(r.push(m.x),f.push(m.y),n+=m.x.toFixed(2)+","+m.y.toFixed(2),s+1<o){var w=this.handlePoint(this.path[s]);r.push(w.x),f.push(w.y),n+=";"+w.x.toFixed(2)+","+w.y.toFixed(2),s+2<o&&(n+=";")}}var g=Math.min.apply(Math,r),v=Math.min.apply(Math,f),d=Math.max.apply(Math,r),u=Math.max.apply(Math,f);return{path:n,rect:"".concat(g,",").concat(v,",").concat(d,",").concat(u)}}},{key:"handlePoint",value:function(n){var o=getInitialPoint$1({x:n[0]+this.layerData.clickX-this.rect.width/2,y:n[1]+this.layerData.clickY-this.rect.height/2},this.layerData.viewport.scale);return{x:o.x,y:o.y}}},{key:"initCursorStyle",value:function(){this.img&&this.img.remove()}},{key:"paintFinalCanvas",value:function(){var n=document.createElement("canvas"),o=n.getContext("2d");return n.width=this.rect.width,n.height=this.rect.height,o.fillStyle="white",o.fillRect(0,0,n.width,n.height),o.lineWidth=3,o.strokeStyle="black",o.drawImage(this.canvas,this.rect.left,this.rect.top,n.width,n.height,0,0,n.width,n.height),n}},{key:"update",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function n(o){var r,f,s,m;return _regeneratorRuntime().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(this.type&&this.toImage(o),r=o.width,f=o.color,r&&(this.strokeWidth=r),f&&(this.strokColor=f),this.inkPath){for(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.lineWidth=this.strokeWidth,this.ctx.strokeStyle=this.strokColor,s=0;s<this.inkPath.length;s++)if(this.inkPath[s].length==1&&(this.ctx.beginPath(),this.ctx.fillStyle=this.strokColor,this.ctx.ellipse(this.inkPath[s][0].x,this.inkPath[s][0].y,this.strokeWidth/2,this.strokeWidth/2,0,0,360,!1),this.ctx.fill(),this.ctx.closePath()),this.inkPath[s].length>1){for(this.ctx.beginPath(),this.ctx.moveTo(this.inkPath[s][0].x,this.inkPath[s][0].y),m=1;m<this.inkPath[s].length;m++)this.ctx.lineTo(this.inkPath[s][m].x,this.inkPath[s][m].y);this.ctx.stroke(),this.ctx.closePath()}}case 5:case"end":return w.stop()}},n,this)})),function(n){return e.apply(this,arguments)})},{key:"dataURLToArrayBuffer",value:function(n){var o=atob(n.split(",")[1]);n.split(";")[0].split(":")[1];for(var r=new ArrayBuffer(o.length),f=new Uint8Array(r),s=0;s<o.length;s++)f[s]=o.charCodeAt(s);return f}},{key:"updateSignature",value:function(n){}}]);var e}(),MessageHandler=function(){return _createClass(function e(n,o,r){var f=this;_classCallCheck(this,e),this.sourceName=n,this.targetName=o,this.comObj=r,this.callbackId=1,this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=function(s){var m=s.data;if(m.targetName===f.sourceName)if(m.callback){var w=m.callbackId,g=f.callbackCapabilities[w];if(!g)throw new Error("Cannot resolve callback ".concat(w));if(delete f.callbackCapabilities[w],m.callback!=="resolve")throw console.log({data:{action:m.data.action,data:m.data.data},message:m.reason&&m.reason.message}),new Error("Unexpected callback case");g.resolve(m.data)}else{var v=f.actionHandler[m.action];if(!v)throw new Error("Unknown action from worker: ".concat(m.action));if(m.callbackId){var d=f.sourceName,u=m.sourceName;new Promise(function(y){y(v(m.data))}).then(function(y){r.postMessage({sourceName:d,targetName:u,callback:"resolve",callbackId:m.callbackId,data:y})},function(y){r.postMessage({data:m,sourceName:d,targetName:u,callback:"reject",callbackId:m.callbackId,reason:y})})}else v(m.data)}},r.addEventListener("message",this._onComObjOnMessage)},[{key:"on",value:function(e,n){var o=this.actionHandler;if(o[e])throw new Error('There is already an actionName called "'.concat(e,'"'));o[e]=n}},{key:"send",value:function(e,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:n})}},{key:"sendWithPromise",value:function(e,n){var o=this.callbackId++,r=new PromiseExt;this.callbackCapabilities[o]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:o,data:n})}catch(f){r.reject(f)}return r.promise}},{key:"destroy",value:function(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}])}(),jszip_minExports={},jszip_min={get exports(){return jszip_minExports},set exports(e){jszip_minExports=e}};jszip_min.exports=function e(n,o,r){function f(w,g){if(!o[w]){if(!n[w]){var v=typeof commonjsRequire=="function"&&commonjsRequire;if(!g&&v)return v(w,!0);if(s)return s(w,!0);var d=new Error("Cannot find module '"+w+"'");throw d.code="MODULE_NOT_FOUND",d}var u=o[w]={exports:{}};n[w][0].call(u.exports,function(y){return f(n[w][1][y]||y)},u,u.exports,e,n,o,r)}return o[w].exports}for(var s=typeof commonjsRequire=="function"&&commonjsRequire,m=0;m<r.length;m++)f(r[m]);return f}({1:[function(e,n,o){var r=e("./utils"),f=e("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(m){for(var w,g,v,d,u,y,x,k=[],P=0,S=m.length,E=S,M=r.getTypeOf(m)!=="string";P<m.length;)E=S-P,v=M?(w=m[P++],g=P<S?m[P++]:0,P<S?m[P++]:0):(w=m.charCodeAt(P++),g=P<S?m.charCodeAt(P++):0,P<S?m.charCodeAt(P++):0),d=w>>2,u=(3&w)<<4|g>>4,y=1<E?(15&g)<<2|v>>6:64,x=2<E?63&v:64,k.push(s.charAt(d)+s.charAt(u)+s.charAt(y)+s.charAt(x));return k.join("")},o.decode=function(m){var w,g,v,d,u,y,x=0,k=0,P="data:";if(m.substr(0,P.length)===P)throw new Error("Invalid base64 input, it looks like a data url.");var S,E=3*(m=m.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(m.charAt(m.length-1)===s.charAt(64)&&E--,m.charAt(m.length-2)===s.charAt(64)&&E--,E%1!=0)throw new Error("Invalid base64 input, bad content length.");for(S=f.uint8array?new Uint8Array(0|E):new Array(0|E);x<m.length;)w=s.indexOf(m.charAt(x++))<<2|(d=s.indexOf(m.charAt(x++)))>>4,g=(15&d)<<4|(u=s.indexOf(m.charAt(x++)))>>2,v=(3&u)<<6|(y=s.indexOf(m.charAt(x++))),S[k++]=w,u!==64&&(S[k++]=g),y!==64&&(S[k++]=v);return S}},{"./support":30,"./utils":32}],2:[function(e,n,o){var r=e("./external"),f=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),m=e("./stream/DataLengthProbe");function w(g,v,d,u,y){this.compressedSize=g,this.uncompressedSize=v,this.crc32=d,this.compression=u,this.compressedContent=y}w.prototype={getContentWorker:function(){var g=new f(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new m("data_length")),v=this;return g.on("end",function(){if(this.streamInfo.data_length!==v.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),g},getCompressedWorker:function(){return new f(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},w.createWorkerFrom=function(g,v,d){return g.pipe(new s).pipe(new m("uncompressedSize")).pipe(v.compressWorker(d)).pipe(new m("compressedSize")).withStreamInfo("compression",v)},n.exports=w},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,n,o){var r=e("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},o.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,n,o){var r=e("./utils"),f=function(){for(var s,m=[],w=0;w<256;w++){s=w;for(var g=0;g<8;g++)s=1&s?3988292384^s>>>1:s>>>1;m[w]=s}return m}();n.exports=function(s,m){return s!==void 0&&s.length?r.getTypeOf(s)!=="string"?function(w,g,v,d){var u=f,y=d+v;w^=-1;for(var x=d;x<y;x++)w=w>>>8^u[255&(w^g[x])];return~w}(0|m,s,s.length,0):function(w,g,v,d){var u=f,y=d+v;w^=-1;for(var x=d;x<y;x++)w=w>>>8^u[255&(w^g.charCodeAt(x))];return~w}(0|m,s,s.length,0):0}},{"./utils":32}],5:[function(e,n,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(e,n,o){var r=null;r=typeof Promise<"u"?Promise:e("lie"),n.exports={Promise:r}},{lie:37}],7:[function(e,n,o){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",f=e("pako"),s=e("./utils"),m=e("./stream/GenericWorker"),w=r?"uint8array":"array";function g(v,d){m.call(this,"FlateWorker/"+v),this._pako=null,this._pakoAction=v,this._pakoOptions=d,this.meta={}}o.magic="\b\0",s.inherits(g,m),g.prototype.processChunk=function(v){this.meta=v.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(w,v.data),!1)},g.prototype.flush=function(){m.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},g.prototype.cleanUp=function(){m.prototype.cleanUp.call(this),this._pako=null},g.prototype._createPako=function(){this._pako=new f[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var v=this;this._pako.onData=function(d){v.push({data:d,meta:v.meta})}},o.compressWorker=function(v){return new g("Deflate",v)},o.uncompressWorker=function(){return new g("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,n,o){function r(u,y){var x,k="";for(x=0;x<y;x++)k+=String.fromCharCode(255&u),u>>>=8;return k}function f(u,y,x,k,P,S){var E,M,T=u.file,D=u.compression,N=S!==w.utf8encode,F=s.transformTo("string",S(T.name)),O=s.transformTo("string",w.utf8encode(T.name)),I=T.comment,X=s.transformTo("string",S(I)),ne=s.transformTo("string",w.utf8encode(I)),ye=O.length!==T.name.length,J=ne.length!==I.length,te="",q="",re="",U=T.dir,H=T.date,Z={crc32:0,compressedSize:0,uncompressedSize:0};y&&!x||(Z.crc32=u.crc32,Z.compressedSize=u.compressedSize,Z.uncompressedSize=u.uncompressedSize);var Y=0;y&&(Y|=8),N||!ye&&!J||(Y|=2048);var W=0,Q=0;U&&(W|=16),P==="UNIX"?(Q=798,W|=function(Ce,Se){var fe=Ce;return Ce||(fe=Se?16893:33204),(65535&fe)<<16}(T.unixPermissions,U)):(Q=20,W|=function(Ce){return 63&(Ce||0)}(T.dosPermissions)),E=H.getUTCHours(),E<<=6,E|=H.getUTCMinutes(),E<<=5,E|=H.getUTCSeconds()/2,M=H.getUTCFullYear()-1980,M<<=4,M|=H.getUTCMonth()+1,M<<=5,M|=H.getUTCDate(),ye&&(q=r(1,1)+r(g(F),4)+O,te+="up"+r(q.length,2)+q),J&&(re=r(1,1)+r(g(X),4)+ne,te+="uc"+r(re.length,2)+re);var oe="";return oe+=`
2194
- \0`,oe+=r(Y,2),oe+=D.magic,oe+=r(E,2),oe+=r(M,2),oe+=r(Z.crc32,4),oe+=r(Z.compressedSize,4),oe+=r(Z.uncompressedSize,4),oe+=r(F.length,2),oe+=r(te.length,2),{fileRecord:v.LOCAL_FILE_HEADER+oe+F+te,dirRecord:v.CENTRAL_FILE_HEADER+r(Q,2)+oe+r(X.length,2)+"\0\0\0\0"+r(W,4)+r(k,4)+F+te+X}}var s=e("../utils"),m=e("../stream/GenericWorker"),w=e("../utf8"),g=e("../crc32"),v=e("../signature");function d(u,y,x,k){m.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=x,this.encodeFileName=k,this.streamFiles=u,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(d,m),d.prototype.push=function(u){var y=u.meta.percent||0,x=this.entriesCount,k=this._sources.length;this.accumulate?this.contentBuffer.push(u):(this.bytesWritten+=u.data.length,m.prototype.push.call(this,{data:u.data,meta:{currentFile:this.currentFile,percent:x?(y+100*(x-k-1))/x:100}}))},d.prototype.openedSource=function(u){this.currentSourceOffset=this.bytesWritten,this.currentFile=u.file.name;var y=this.streamFiles&&!u.file.dir;if(y){var x=f(u,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:x.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(u){this.accumulate=!1;var y=this.streamFiles&&!u.file.dir,x=f(u,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(x.dirRecord),y)this.push({data:function(k){return v.DATA_DESCRIPTOR+r(k.crc32,4)+r(k.compressedSize,4)+r(k.uncompressedSize,4)}(u),meta:{percent:100}});else for(this.push({data:x.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var u=this.bytesWritten,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var x=this.bytesWritten-u,k=function(P,S,E,M,T){var D=s.transformTo("string",T(M));return v.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(P,2)+r(P,2)+r(S,4)+r(E,4)+r(D.length,2)+D}(this.dirRecords.length,x,u,this.zipComment,this.encodeFileName);this.push({data:k,meta:{percent:100}})},d.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},d.prototype.registerPrevious=function(u){this._sources.push(u);var y=this;return u.on("data",function(x){y.processChunk(x)}),u.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),u.on("error",function(x){y.error(x)}),this},d.prototype.resume=function(){return!!m.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},d.prototype.error=function(u){var y=this._sources;if(!m.prototype.error.call(this,u))return!1;for(var x=0;x<y.length;x++)try{y[x].error(u)}catch{}return!0},d.prototype.lock=function(){m.prototype.lock.call(this);for(var u=this._sources,y=0;y<u.length;y++)u[y].lock()},n.exports=d},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,n,o){var r=e("../compressions"),f=e("./ZipFileWorker");o.generateWorker=function(s,m,w){var g=new f(m.streamFiles,w,m.platform,m.encodeFileName),v=0;try{s.forEach(function(d,u){v++;var y=function(S,E){var M=S||E,T=r[M];if(!T)throw new Error(M+" is not a valid compression method !");return T}(u.options.compression,m.compression),x=u.options.compressionOptions||m.compressionOptions||{},k=u.dir,P=u.date;u._compressWorker(y,x).withStreamInfo("file",{name:d,dir:k,date:P,comment:u.comment||"",unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions}).pipe(g)}),g.entriesCount=v}catch(d){g.error(d)}return g}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,n,o){function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var f=new r;for(var s in this)typeof this[s]!="function"&&(f[s]=this[s]);return f}}(r.prototype=e("./object")).loadAsync=e("./load"),r.support=e("./support"),r.defaults=e("./defaults"),r.version="3.10.1",r.loadAsync=function(f,s){return new r().loadAsync(f,s)},r.external=e("./external"),n.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,n,o){var r=e("./utils"),f=e("./external"),s=e("./utf8"),m=e("./zipEntries"),w=e("./stream/Crc32Probe"),g=e("./nodejsUtils");function v(d){return new f.Promise(function(u,y){var x=d.decompressed.getContentWorker().pipe(new w);x.on("error",function(k){y(k)}).on("end",function(){x.streamInfo.crc32!==d.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):u()}).resume()})}n.exports=function(d,u){var y=this;return u=r.extend(u||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),g.isNode&&g.isStream(d)?f.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip file",d,!0,u.optimizedBinaryString,u.base64).then(function(x){var k=new m(u);return k.load(x),k}).then(function(x){var k=[f.Promise.resolve(x)],P=x.files;if(u.checkCRC32)for(var S=0;S<P.length;S++)k.push(v(P[S]));return f.Promise.all(k)}).then(function(x){for(var k=x.shift(),P=k.files,S=0;S<P.length;S++){var E=P[S],M=E.fileNameStr,T=r.resolve(E.fileNameStr);y.file(T,E.decompressed,{binary:!0,optimizedBinaryString:!0,date:E.date,dir:E.dir,comment:E.fileCommentStr.length?E.fileCommentStr:null,unixPermissions:E.unixPermissions,dosPermissions:E.dosPermissions,createFolders:u.createFolders}),E.dir||(y.file(T).unsafeOriginalName=M)}return k.zipComment.length&&(y.comment=k.zipComment),y})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,n,o){var r=e("../utils"),f=e("../stream/GenericWorker");function s(m,w){f.call(this,"Nodejs stream input adapter for "+m),this._upstreamEnded=!1,this._bindStream(w)}r.inherits(s,f),s.prototype._bindStream=function(m){var w=this;(this._stream=m).pause(),m.on("data",function(g){w.push({data:g,meta:{percent:0}})}).on("error",function(g){w.isPaused?this.generatedError=g:w.error(g)}).on("end",function(){w.isPaused?w._upstreamEnded=!0:w.end()})},s.prototype.pause=function(){return!!f.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,n,o){var r=e("readable-stream").Readable;function f(s,m,w){r.call(this,m),this._helper=s;var g=this;s.on("data",function(v,d){g.push(v)||g._helper.pause(),w&&w(d)}).on("error",function(v){g.emit("error",v)}).on("end",function(){g.push(null)})}e("../utils").inherits(f,r),f.prototype._read=function(){this._helper.resume()},n.exports=f},{"../utils":32,"readable-stream":16}],14:[function(e,n,o){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(r,f){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(r,f);if(typeof r=="number")throw new Error('The "data" argument must not be a number');return new Buffer(r,f)},allocBuffer:function(r){if(Buffer.alloc)return Buffer.alloc(r);var f=new Buffer(r);return f.fill(0),f},isBuffer:function(r){return Buffer.isBuffer(r)},isStream:function(r){return r&&typeof r.on=="function"&&typeof r.pause=="function"&&typeof r.resume=="function"}}},{}],15:[function(e,n,o){function r(T,D,N){var F,O=s.getTypeOf(D),I=s.extend(N||{},g);I.date=I.date||new Date,I.compression!==null&&(I.compression=I.compression.toUpperCase()),typeof I.unixPermissions=="string"&&(I.unixPermissions=parseInt(I.unixPermissions,8)),I.unixPermissions&&16384&I.unixPermissions&&(I.dir=!0),I.dosPermissions&&16&I.dosPermissions&&(I.dir=!0),I.dir&&(T=P(T)),I.createFolders&&(F=k(T))&&S.call(this,F,!0);var X=O==="string"&&I.binary===!1&&I.base64===!1;N&&N.binary!==void 0||(I.binary=!X),(D instanceof v&&D.uncompressedSize===0||I.dir||!D||D.length===0)&&(I.base64=!1,I.binary=!0,D="",I.compression="STORE",O="string");var ne=null;ne=D instanceof v||D instanceof m?D:y.isNode&&y.isStream(D)?new x(T,D):s.prepareContent(T,D,I.binary,I.optimizedBinaryString,I.base64);var ye=new d(T,ne,I);this.files[T]=ye}var f=e("./utf8"),s=e("./utils"),m=e("./stream/GenericWorker"),w=e("./stream/StreamHelper"),g=e("./defaults"),v=e("./compressedObject"),d=e("./zipObject"),u=e("./generate"),y=e("./nodejsUtils"),x=e("./nodejs/NodejsStreamInputAdapter"),k=function(T){T.slice(-1)==="/"&&(T=T.substring(0,T.length-1));var D=T.lastIndexOf("/");return 0<D?T.substring(0,D):""},P=function(T){return T.slice(-1)!=="/"&&(T+="/"),T},S=function(T,D){return D=D!==void 0?D:g.createFolders,T=P(T),this.files[T]||r.call(this,T,null,{dir:!0,createFolders:D}),this.files[T]};function E(T){return Object.prototype.toString.call(T)==="[object RegExp]"}var M={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(T){var D,N,F;for(D in this.files)F=this.files[D],(N=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&T(N,F)},filter:function(T){var D=[];return this.forEach(function(N,F){T(N,F)&&D.push(F)}),D},file:function(T,D,N){if(arguments.length!==1)return T=this.root+T,r.call(this,T,D,N),this;if(E(T)){var F=T;return this.filter(function(I,X){return!X.dir&&F.test(I)})}var O=this.files[this.root+T];return O&&!O.dir?O:null},folder:function(T){if(!T)return this;if(E(T))return this.filter(function(O,I){return I.dir&&T.test(O)});var D=this.root+T,N=S.call(this,D),F=this.clone();return F.root=N.name,F},remove:function(T){T=this.root+T;var D=this.files[T];if(D||(T.slice(-1)!=="/"&&(T+="/"),D=this.files[T]),D&&!D.dir)delete this.files[T];else for(var N=this.filter(function(O,I){return I.name.slice(0,T.length)===T}),F=0;F<N.length;F++)delete this.files[N[F].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(T){var D,N={};try{if((N=s.extend(T||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:f.utf8encode})).type=N.type.toLowerCase(),N.compression=N.compression.toUpperCase(),N.type==="binarystring"&&(N.type="string"),!N.type)throw new Error("No output type specified.");s.checkSupport(N.type),N.platform!=="darwin"&&N.platform!=="freebsd"&&N.platform!=="linux"&&N.platform!=="sunos"||(N.platform="UNIX"),N.platform==="win32"&&(N.platform="DOS");var F=N.comment||this.comment||"";D=u.generateWorker(this,N,F)}catch(O){(D=new m("error")).error(O)}return new w(D,N.type||"string",N.mimeType)},generateAsync:function(T,D){return this.generateInternalStream(T).accumulate(D)},generateNodeStream:function(T,D){return(T=T||{}).type||(T.type="nodebuffer"),this.generateInternalStream(T).toNodejsStream(D)}};n.exports=M},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,n,o){n.exports=e("stream")},{stream:void 0}],17:[function(e,n,o){var r=e("./DataReader");function f(s){r.call(this,s);for(var m=0;m<this.data.length;m++)s[m]=255&s[m]}e("../utils").inherits(f,r),f.prototype.byteAt=function(s){return this.data[this.zero+s]},f.prototype.lastIndexOfSignature=function(s){for(var m=s.charCodeAt(0),w=s.charCodeAt(1),g=s.charCodeAt(2),v=s.charCodeAt(3),d=this.length-4;0<=d;--d)if(this.data[d]===m&&this.data[d+1]===w&&this.data[d+2]===g&&this.data[d+3]===v)return d-this.zero;return-1},f.prototype.readAndCheckSignature=function(s){var m=s.charCodeAt(0),w=s.charCodeAt(1),g=s.charCodeAt(2),v=s.charCodeAt(3),d=this.readData(4);return m===d[0]&&w===d[1]&&g===d[2]&&v===d[3]},f.prototype.readData=function(s){if(this.checkOffset(s),s===0)return[];var m=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,m},n.exports=f},{"../utils":32,"./DataReader":18}],18:[function(e,n,o){var r=e("../utils");function f(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}f.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(){},readInt:function(s){var m,w=0;for(this.checkOffset(s),m=this.index+s-1;m>=this.index;m--)w=(w<<8)+this.byteAt(m);return this.index+=s,w},readString:function(s){return r.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},n.exports=f},{"../utils":32}],19:[function(e,n,o){var r=e("./Uint8ArrayReader");function f(s){r.call(this,s)}e("../utils").inherits(f,r),f.prototype.readData=function(s){this.checkOffset(s);var m=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,m},n.exports=f},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,n,o){var r=e("./DataReader");function f(s){r.call(this,s)}e("../utils").inherits(f,r),f.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},f.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},f.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},f.prototype.readData=function(s){this.checkOffset(s);var m=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,m},n.exports=f},{"../utils":32,"./DataReader":18}],21:[function(e,n,o){var r=e("./ArrayReader");function f(s){r.call(this,s)}e("../utils").inherits(f,r),f.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var m=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,m},n.exports=f},{"../utils":32,"./ArrayReader":17}],22:[function(e,n,o){var r=e("../utils"),f=e("../support"),s=e("./ArrayReader"),m=e("./StringReader"),w=e("./NodeBufferReader"),g=e("./Uint8ArrayReader");n.exports=function(v){var d=r.getTypeOf(v);return r.checkSupport(d),d!=="string"||f.uint8array?d==="nodebuffer"?new w(v):f.uint8array?new g(r.transformTo("uint8array",v)):new s(r.transformTo("array",v)):new m(v)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,n,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,n,o){var r=e("./GenericWorker"),f=e("../utils");function s(m){r.call(this,"ConvertWorker to "+m),this.destType=m}f.inherits(s,r),s.prototype.processChunk=function(m){this.push({data:f.transformTo(this.destType,m.data),meta:m.meta})},n.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(e,n,o){var r=e("./GenericWorker"),f=e("../crc32");function s(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(s,r),s.prototype.processChunk=function(m){this.streamInfo.crc32=f(m.data,this.streamInfo.crc32||0),this.push(m)},n.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,n,o){var r=e("../utils"),f=e("./GenericWorker");function s(m){f.call(this,"DataLengthProbe for "+m),this.propName=m,this.withStreamInfo(m,0)}r.inherits(s,f),s.prototype.processChunk=function(m){if(m){var w=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=w+m.data.length}f.prototype.processChunk.call(this,m)},n.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(e,n,o){var r=e("../utils"),f=e("./GenericWorker");function s(m){f.call(this,"DataWorker");var w=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,m.then(function(g){w.dataIsReady=!0,w.data=g,w.max=g&&g.length||0,w.type=r.getTypeOf(g),w.isPaused||w._tickAndRepeat()},function(g){w.error(g)})}r.inherits(s,f),s.prototype.cleanUp=function(){f.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var m=null,w=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":m=this.data.substring(this.index,w);break;case"uint8array":m=this.data.subarray(this.index,w);break;case"array":case"nodebuffer":m=this.data.slice(this.index,w)}return this.index=w,this.push({data:m,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(e,n,o){function r(f){this.name=f||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(f){this.emit("data",f)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(f){this.emit("error",f)}return!0},error:function(f){return!this.isFinished&&(this.isPaused?this.generatedError=f:(this.isFinished=!0,this.emit("error",f),this.previous&&this.previous.error(f),this.cleanUp()),!0)},on:function(f,s){return this._listeners[f].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(f,s){if(this._listeners[f])for(var m=0;m<this._listeners[f].length;m++)this._listeners[f][m].call(this,s)},pipe:function(f){return f.registerPrevious(this)},registerPrevious:function(f){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=f.streamInfo,this.mergeStreamInfo(),this.previous=f;var s=this;return f.on("data",function(m){s.processChunk(m)}),f.on("end",function(){s.end()}),f.on("error",function(m){s.error(m)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var f=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),f=!0),this.previous&&this.previous.resume(),!f},flush:function(){},processChunk:function(f){this.push(f)},withStreamInfo:function(f,s){return this.extraStreamInfo[f]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var f in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,f)&&(this.streamInfo[f]=this.extraStreamInfo[f])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var f="Worker "+this.name;return this.previous?this.previous+" -> "+f:f}},n.exports=r},{}],29:[function(e,n,o){var r=e("../utils"),f=e("./ConvertWorker"),s=e("./GenericWorker"),m=e("../base64"),w=e("../support"),g=e("../external"),v=null;if(w.nodestream)try{v=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(y,x){return new g.Promise(function(k,P){var S=[],E=y._internalType,M=y._outputType,T=y._mimeType;y.on("data",function(D,N){S.push(D),x&&x(N)}).on("error",function(D){S=[],P(D)}).on("end",function(){try{var D=function(N,F,O){switch(N){case"blob":return r.newBlob(r.transformTo("arraybuffer",F),O);case"base64":return m.encode(F);default:return r.transformTo(N,F)}}(M,function(N,F){var O,I=0,X=null,ne=0;for(O=0;O<F.length;O++)ne+=F[O].length;switch(N){case"string":return F.join("");case"array":return Array.prototype.concat.apply([],F);case"uint8array":for(X=new Uint8Array(ne),O=0;O<F.length;O++)X.set(F[O],I),I+=F[O].length;return X;case"nodebuffer":return Buffer.concat(F);default:throw new Error("concat : unsupported type '"+N+"'")}}(E,S),T);k(D)}catch(N){P(N)}S=[]}).resume()})}function u(y,x,k){var P=x;switch(x){case"blob":case"arraybuffer":P="uint8array";break;case"base64":P="string"}try{this._internalType=P,this._outputType=x,this._mimeType=k,r.checkSupport(P),this._worker=y.pipe(new f(P)),y.lock()}catch(S){this._worker=new s("error"),this._worker.error(S)}}u.prototype={accumulate:function(y){return d(this,y)},on:function(y,x){var k=this;return y==="data"?this._worker.on(y,function(P){x.call(k,P.data,P.meta)}):this._worker.on(y,function(){r.delay(x,arguments,k)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(y){if(r.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new v(this,{objectMode:this._outputType!=="nodebuffer"},y)}},n.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,n,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var r=new ArrayBuffer(0);try{o.blob=new Blob([r],{type:"application/zip"}).size===0}catch{try{var f=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);f.append(r),o.blob=f.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!e("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(e,n,o){for(var r=e("./utils"),f=e("./support"),s=e("./nodejsUtils"),m=e("./stream/GenericWorker"),w=new Array(256),g=0;g<256;g++)w[g]=252<=g?6:248<=g?5:240<=g?4:224<=g?3:192<=g?2:1;function v(){m.call(this,"utf-8 decode"),this.leftOver=null}function d(){m.call(this,"utf-8 encode")}w[254]=w[254]=1,o.utf8encode=function(u){return f.nodebuffer?s.newBufferFrom(u,"utf-8"):function(y){var x,k,P,S,E,M=y.length,T=0;for(S=0;S<M;S++)(64512&(k=y.charCodeAt(S)))==55296&&S+1<M&&(64512&(P=y.charCodeAt(S+1)))==56320&&(k=65536+(k-55296<<10)+(P-56320),S++),T+=k<128?1:k<2048?2:k<65536?3:4;for(x=f.uint8array?new Uint8Array(T):new Array(T),S=E=0;E<T;S++)(64512&(k=y.charCodeAt(S)))==55296&&S+1<M&&(64512&(P=y.charCodeAt(S+1)))==56320&&(k=65536+(k-55296<<10)+(P-56320),S++),k<128?x[E++]=k:(k<2048?x[E++]=192|k>>>6:(k<65536?x[E++]=224|k>>>12:(x[E++]=240|k>>>18,x[E++]=128|k>>>12&63),x[E++]=128|k>>>6&63),x[E++]=128|63&k);return x}(u)},o.utf8decode=function(u){return f.nodebuffer?r.transformTo("nodebuffer",u).toString("utf-8"):function(y){var x,k,P,S,E=y.length,M=new Array(2*E);for(x=k=0;x<E;)if((P=y[x++])<128)M[k++]=P;else if(4<(S=w[P]))M[k++]=65533,x+=S-1;else{for(P&=S===2?31:S===3?15:7;1<S&&x<E;)P=P<<6|63&y[x++],S--;1<S?M[k++]=65533:P<65536?M[k++]=P:(P-=65536,M[k++]=55296|P>>10&1023,M[k++]=56320|1023&P)}return M.length!==k&&(M.subarray?M=M.subarray(0,k):M.length=k),r.applyFromCharCode(M)}(u=r.transformTo(f.uint8array?"uint8array":"array",u))},r.inherits(v,m),v.prototype.processChunk=function(u){var y=r.transformTo(f.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(f.uint8array){var x=y;(y=new Uint8Array(x.length+this.leftOver.length)).set(this.leftOver,0),y.set(x,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var k=function(S,E){var M;for((E=E||S.length)>S.length&&(E=S.length),M=E-1;0<=M&&(192&S[M])==128;)M--;return M<0||M===0?E:M+w[S[M]]>E?M:E}(y),P=y;k!==y.length&&(f.uint8array?(P=y.subarray(0,k),this.leftOver=y.subarray(k,y.length)):(P=y.slice(0,k),this.leftOver=y.slice(k,y.length))),this.push({data:o.utf8decode(P),meta:u.meta})},v.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=v,r.inherits(d,m),d.prototype.processChunk=function(u){this.push({data:o.utf8encode(u.data),meta:u.meta})},o.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,n,o){var r=e("./support"),f=e("./base64"),s=e("./nodejsUtils"),m=e("./external");function w(x){return x}function g(x,k){for(var P=0;P<x.length;++P)k[P]=255&x.charCodeAt(P);return k}e("setimmediate"),o.newBlob=function(x,k){o.checkSupport("blob");try{return new Blob([x],{type:k})}catch{try{var P=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return P.append(x),P.getBlob(k)}catch{throw new Error("Bug : can't construct the Blob.")}}};var v={stringifyByChunk:function(x,k,P){var S=[],E=0,M=x.length;if(M<=P)return String.fromCharCode.apply(null,x);for(;E<M;)k==="array"||k==="nodebuffer"?S.push(String.fromCharCode.apply(null,x.slice(E,Math.min(E+P,M)))):S.push(String.fromCharCode.apply(null,x.subarray(E,Math.min(E+P,M)))),E+=P;return S.join("")},stringifyByChar:function(x){for(var k="",P=0;P<x.length;P++)k+=String.fromCharCode(x[P]);return k},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}}()}};function d(x){var k=65536,P=o.getTypeOf(x),S=!0;if(P==="uint8array"?S=v.applyCanBeUsed.uint8array:P==="nodebuffer"&&(S=v.applyCanBeUsed.nodebuffer),S)for(;1<k;)try{return v.stringifyByChunk(x,P,k)}catch{k=Math.floor(k/2)}return v.stringifyByChar(x)}function u(x,k){for(var P=0;P<x.length;P++)k[P]=x[P];return k}o.applyFromCharCode=d;var y={};y.string={string:w,array:function(x){return g(x,new Array(x.length))},arraybuffer:function(x){return y.string.uint8array(x).buffer},uint8array:function(x){return g(x,new Uint8Array(x.length))},nodebuffer:function(x){return g(x,s.allocBuffer(x.length))}},y.array={string:d,array:w,arraybuffer:function(x){return new Uint8Array(x).buffer},uint8array:function(x){return new Uint8Array(x)},nodebuffer:function(x){return s.newBufferFrom(x)}},y.arraybuffer={string:function(x){return d(new Uint8Array(x))},array:function(x){return u(new Uint8Array(x),new Array(x.byteLength))},arraybuffer:w,uint8array:function(x){return new Uint8Array(x)},nodebuffer:function(x){return s.newBufferFrom(new Uint8Array(x))}},y.uint8array={string:d,array:function(x){return u(x,new Array(x.length))},arraybuffer:function(x){return x.buffer},uint8array:w,nodebuffer:function(x){return s.newBufferFrom(x)}},y.nodebuffer={string:d,array:function(x){return u(x,new Array(x.length))},arraybuffer:function(x){return y.nodebuffer.uint8array(x).buffer},uint8array:function(x){return u(x,new Uint8Array(x.length))},nodebuffer:w},o.transformTo=function(x,k){if(k=k||"",!x)return k;o.checkSupport(x);var P=o.getTypeOf(k);return y[P][x](k)},o.resolve=function(x){for(var k=x.split("/"),P=[],S=0;S<k.length;S++){var E=k[S];E==="."||E===""&&S!==0&&S!==k.length-1||(E===".."?P.pop():P.push(E))}return P.join("/")},o.getTypeOf=function(x){return typeof x=="string"?"string":Object.prototype.toString.call(x)==="[object Array]"?"array":r.nodebuffer&&s.isBuffer(x)?"nodebuffer":r.uint8array&&x instanceof Uint8Array?"uint8array":r.arraybuffer&&x instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(x){if(!r[x.toLowerCase()])throw new Error(x+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(x){var k,P,S="";for(P=0;P<(x||"").length;P++)S+="\\x"+((k=x.charCodeAt(P))<16?"0":"")+k.toString(16).toUpperCase();return S},o.delay=function(x,k,P){setImmediate(function(){x.apply(P||null,k||[])})},o.inherits=function(x,k){function P(){}P.prototype=k.prototype,x.prototype=new P},o.extend=function(){var x,k,P={};for(x=0;x<arguments.length;x++)for(k in arguments[x])Object.prototype.hasOwnProperty.call(arguments[x],k)&&P[k]===void 0&&(P[k]=arguments[x][k]);return P},o.prepareContent=function(x,k,P,S,E){return m.Promise.resolve(k).then(function(M){return r.blob&&(M instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(M))!==-1)&&typeof FileReader<"u"?new m.Promise(function(T,D){var N=new FileReader;N.onload=function(F){T(F.target.result)},N.onerror=function(F){D(F.target.error)},N.readAsArrayBuffer(M)}):M}).then(function(M){var T=o.getTypeOf(M);return T?(T==="arraybuffer"?M=o.transformTo("uint8array",M):T==="string"&&(E?M=f.decode(M):P&&S!==!0&&(M=function(D){return g(D,r.uint8array?new Uint8Array(D.length):new Array(D.length))}(M))),M):m.Promise.reject(new Error("Can't read the data of '"+x+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,n,o){var r=e("./reader/readerFor"),f=e("./utils"),s=e("./signature"),m=e("./zipEntry"),w=e("./support");function g(v){this.files=[],this.loadOptions=v}g.prototype={checkSignature:function(v){if(!this.reader.readAndCheckSignature(v)){this.reader.index-=4;var d=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+f.pretty(d)+", expected "+f.pretty(v)+")")}},isSignature:function(v,d){var u=this.reader.index;this.reader.setIndex(v);var y=this.reader.readString(4)===d;return this.reader.setIndex(u),y},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var v=this.reader.readData(this.zipCommentLength),d=w.uint8array?"uint8array":"array",u=f.transformTo(d,v);this.zipComment=this.loadOptions.decodeFileName(u)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var v,d,u,y=this.zip64EndOfCentralSize-44;0<y;)v=this.reader.readInt(2),d=this.reader.readInt(4),u=this.reader.readData(d),this.zip64ExtensibleData[v]={id:v,length:d,value:u}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var v,d;for(v=0;v<this.files.length;v++)d=this.files[v],this.reader.setIndex(d.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),d.readLocalPart(this.reader),d.handleUTF8(),d.processAttributes()},readCentralDir:function(){var v;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(v=new m({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(v);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var v=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(v<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(v);var d=v;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===f.MAX_VALUE_16BITS||this.diskWithCentralDirStart===f.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===f.MAX_VALUE_16BITS||this.centralDirRecords===f.MAX_VALUE_16BITS||this.centralDirSize===f.MAX_VALUE_32BITS||this.centralDirOffset===f.MAX_VALUE_32BITS){if(this.zip64=!0,(v=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(v),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var u=this.centralDirOffset+this.centralDirSize;this.zip64&&(u+=20,u+=12+this.zip64EndOfCentralSize);var y=d-u;if(0<y)this.isSignature(d,s.CENTRAL_FILE_HEADER)||(this.reader.zero=y);else if(y<0)throw new Error("Corrupted zip: missing "+Math.abs(y)+" bytes.")},prepareReader:function(v){this.reader=r(v)},load:function(v){this.prepareReader(v),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=g},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,n,o){var r=e("./reader/readerFor"),f=e("./utils"),s=e("./compressedObject"),m=e("./crc32"),w=e("./utf8"),g=e("./compressions"),v=e("./support");function d(u,y){this.options=u,this.loadOptions=y}d.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(u){var y,x;if(u.skip(22),this.fileNameLength=u.readInt(2),x=u.readInt(2),this.fileName=u.readData(this.fileNameLength),u.skip(x),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((y=function(k){for(var P in g)if(Object.prototype.hasOwnProperty.call(g,P)&&g[P].magic===k)return g[P];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+f.pretty(this.compressionMethod)+" unknown (inner file : "+f.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,y,u.readData(this.compressedSize))},readCentralPart:function(u){this.versionMadeBy=u.readInt(2),u.skip(2),this.bitFlag=u.readInt(2),this.compressionMethod=u.readString(2),this.date=u.readDate(),this.crc32=u.readInt(4),this.compressedSize=u.readInt(4),this.uncompressedSize=u.readInt(4);var y=u.readInt(2);if(this.extraFieldsLength=u.readInt(2),this.fileCommentLength=u.readInt(2),this.diskNumberStart=u.readInt(2),this.internalFileAttributes=u.readInt(2),this.externalFileAttributes=u.readInt(4),this.localHeaderOffset=u.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");u.skip(y),this.readExtraFields(u),this.parseZIP64ExtraField(u),this.fileComment=u.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var u=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),u==0&&(this.dosPermissions=63&this.externalFileAttributes),u==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=r(this.extraFields[1].value);this.uncompressedSize===f.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===f.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===f.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===f.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var y,x,k,P=u.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});u.index+4<P;)y=u.readInt(2),x=u.readInt(2),k=u.readData(x),this.extraFields[y]={id:y,length:x,value:k};u.setIndex(P)},handleUTF8:function(){var u=v.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=w.utf8decode(this.fileName),this.fileCommentStr=w.utf8decode(this.fileComment);else{var y=this.findExtraFieldUnicodePath();if(y!==null)this.fileNameStr=y;else{var x=f.transformTo(u,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(x)}var k=this.findExtraFieldUnicodeComment();if(k!==null)this.fileCommentStr=k;else{var P=f.transformTo(u,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(P)}}},findExtraFieldUnicodePath:function(){var u=this.extraFields[28789];if(u){var y=r(u.value);return y.readInt(1)!==1||m(this.fileName)!==y.readInt(4)?null:w.utf8decode(y.readData(u.length-5))}return null},findExtraFieldUnicodeComment:function(){var u=this.extraFields[25461];if(u){var y=r(u.value);return y.readInt(1)!==1||m(this.fileComment)!==y.readInt(4)?null:w.utf8decode(y.readData(u.length-5))}return null}},n.exports=d},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,n,o){function r(y,x,k){this.name=y,this.dir=k.dir,this.date=k.date,this.comment=k.comment,this.unixPermissions=k.unixPermissions,this.dosPermissions=k.dosPermissions,this._data=x,this._dataBinary=k.binary,this.options={compression:k.compression,compressionOptions:k.compressionOptions}}var f=e("./stream/StreamHelper"),s=e("./stream/DataWorker"),m=e("./utf8"),w=e("./compressedObject"),g=e("./stream/GenericWorker");r.prototype={internalStream:function(y){var x=null,k="string";try{if(!y)throw new Error("No output type specified.");var P=(k=y.toLowerCase())==="string"||k==="text";k!=="binarystring"&&k!=="text"||(k="string"),x=this._decompressWorker();var S=!this._dataBinary;S&&!P&&(x=x.pipe(new m.Utf8EncodeWorker)),!S&&P&&(x=x.pipe(new m.Utf8DecodeWorker))}catch(E){(x=new g("error")).error(E)}return new f(x,k,"")},async:function(y,x){return this.internalStream(y).accumulate(x)},nodeStream:function(y,x){return this.internalStream(y||"nodebuffer").toNodejsStream(x)},_compressWorker:function(y,x){if(this._data instanceof w&&this._data.compression.magic===y.magic)return this._data.getCompressedWorker();var k=this._decompressWorker();return this._dataBinary||(k=k.pipe(new m.Utf8EncodeWorker)),w.createWorkerFrom(k,y,x)},_decompressWorker:function(){return this._data instanceof w?this._data.getContentWorker():this._data instanceof g?this._data:new s(this._data)}};for(var v=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],d=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<v.length;u++)r.prototype[v[u]]=d;n.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,n,o){(function(r){var f,s,m=r.MutationObserver||r.WebKitMutationObserver;if(m){var w=0,g=new m(y),v=r.document.createTextNode("");g.observe(v,{characterData:!0}),f=function(){v.data=w=++w%2}}else if(r.setImmediate||r.MessageChannel===void 0)f="document"in r&&"onreadystatechange"in r.document.createElement("script")?function(){var x=r.document.createElement("script");x.onreadystatechange=function(){y(),x.onreadystatechange=null,x.parentNode.removeChild(x),x=null},r.document.documentElement.appendChild(x)}:function(){setTimeout(y,0)};else{var d=new r.MessageChannel;d.port1.onmessage=y,f=function(){d.port2.postMessage(0)}}var u=[];function y(){var x,k;s=!0;for(var P=u.length;P;){for(k=u,u=[],x=-1;++x<P;)k[x]();P=u.length}s=!1}n.exports=function(x){u.push(x)!==1||s||f()}}).call(this,commonjsGlobal$1!==void 0?commonjsGlobal$1:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(e,n,o){var r=e("immediate");function f(){}var s={},m=["REJECTED"],w=["FULFILLED"],g=["PENDING"];function v(P){if(typeof P!="function")throw new TypeError("resolver must be a function");this.state=g,this.queue=[],this.outcome=void 0,P!==f&&x(this,P)}function d(P,S,E){this.promise=P,typeof S=="function"&&(this.onFulfilled=S,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}function u(P,S,E){r(function(){var M;try{M=S(E)}catch(T){return s.reject(P,T)}M===P?s.reject(P,new TypeError("Cannot resolve promise with itself")):s.resolve(P,M)})}function y(P){var S=P&&P.then;if(P&&(_typeof$1(P)=="object"||typeof P=="function")&&typeof S=="function")return function(){S.apply(P,arguments)}}function x(P,S){var E=!1;function M(N){E||(E=!0,s.reject(P,N))}function T(N){E||(E=!0,s.resolve(P,N))}var D=k(function(){S(T,M)});D.status==="error"&&M(D.value)}function k(P,S){var E={};try{E.value=P(S),E.status="success"}catch(M){E.status="error",E.value=M}return E}(n.exports=v).prototype.finally=function(P){if(typeof P!="function")return this;var S=this.constructor;return this.then(function(E){return S.resolve(P()).then(function(){return E})},function(E){return S.resolve(P()).then(function(){throw E})})},v.prototype.catch=function(P){return this.then(null,P)},v.prototype.then=function(P,S){if(typeof P!="function"&&this.state===w||typeof S!="function"&&this.state===m)return this;var E=new this.constructor(f);return this.state!==g?u(E,this.state===w?P:S,this.outcome):this.queue.push(new d(E,P,S)),E},d.prototype.callFulfilled=function(P){s.resolve(this.promise,P)},d.prototype.otherCallFulfilled=function(P){u(this.promise,this.onFulfilled,P)},d.prototype.callRejected=function(P){s.reject(this.promise,P)},d.prototype.otherCallRejected=function(P){u(this.promise,this.onRejected,P)},s.resolve=function(P,S){var E=k(y,S);if(E.status==="error")return s.reject(P,E.value);var M=E.value;if(M)x(P,M);else{P.state=w,P.outcome=S;for(var T=-1,D=P.queue.length;++T<D;)P.queue[T].callFulfilled(S)}return P},s.reject=function(P,S){P.state=m,P.outcome=S;for(var E=-1,M=P.queue.length;++E<M;)P.queue[E].callRejected(S);return P},v.resolve=function(P){return P instanceof this?P:s.resolve(new this(f),P)},v.reject=function(P){var S=new this(f);return s.reject(S,P)},v.all=function(P){var S=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=P.length,M=!1;if(!E)return this.resolve([]);for(var T=new Array(E),D=0,N=-1,F=new this(f);++N<E;)O(P[N],N);return F;function O(I,X){S.resolve(I).then(function(ne){T[X]=ne,++D!==E||M||(M=!0,s.resolve(F,T))},function(ne){M||(M=!0,s.reject(F,ne))})}},v.race=function(P){var S=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=P.length,M=!1;if(!E)return this.resolve([]);for(var T,D=-1,N=new this(f);++D<E;)T=P[D],S.resolve(T).then(function(F){M||(M=!0,s.resolve(N,F))},function(F){M||(M=!0,s.reject(N,F))});return N}},{immediate:36}],38:[function(e,n,o){var r={};(0,e("./lib/utils/common").assign)(r,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),n.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,n,o){var r=e("./zlib/deflate"),f=e("./utils/common"),s=e("./utils/strings"),m=e("./zlib/messages"),w=e("./zlib/zstream"),g=Object.prototype.toString,v=0,d=-1,u=0,y=8;function x(P){if(!(this instanceof x))return new x(P);this.options=f.assign({level:d,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},P||{});var S=this.options;S.raw&&0<S.windowBits?S.windowBits=-S.windowBits:S.gzip&&0<S.windowBits&&S.windowBits<16&&(S.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new w,this.strm.avail_out=0;var E=r.deflateInit2(this.strm,S.level,S.method,S.windowBits,S.memLevel,S.strategy);if(E!==v)throw new Error(m[E]);if(S.header&&r.deflateSetHeader(this.strm,S.header),S.dictionary){var M;if(M=typeof S.dictionary=="string"?s.string2buf(S.dictionary):g.call(S.dictionary)==="[object ArrayBuffer]"?new Uint8Array(S.dictionary):S.dictionary,(E=r.deflateSetDictionary(this.strm,M))!==v)throw new Error(m[E]);this._dict_set=!0}}function k(P,S){var E=new x(S);if(E.push(P,!0),E.err)throw E.msg||m[E.err];return E.result}x.prototype.push=function(P,S){var E,M,T=this.strm,D=this.options.chunkSize;if(this.ended)return!1;M=S===~~S?S:S===!0?4:0,typeof P=="string"?T.input=s.string2buf(P):g.call(P)==="[object ArrayBuffer]"?T.input=new Uint8Array(P):T.input=P,T.next_in=0,T.avail_in=T.input.length;do{if(T.avail_out===0&&(T.output=new f.Buf8(D),T.next_out=0,T.avail_out=D),(E=r.deflate(T,M))!==1&&E!==v)return this.onEnd(E),!(this.ended=!0);T.avail_out!==0&&(T.avail_in!==0||M!==4&&M!==2)||(this.options.to==="string"?this.onData(s.buf2binstring(f.shrinkBuf(T.output,T.next_out))):this.onData(f.shrinkBuf(T.output,T.next_out)))}while((0<T.avail_in||T.avail_out===0)&&E!==1);return M===4?(E=r.deflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===v):M!==2||(this.onEnd(v),!(T.avail_out=0))},x.prototype.onData=function(P){this.chunks.push(P)},x.prototype.onEnd=function(P){P===v&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=f.flattenChunks(this.chunks)),this.chunks=[],this.err=P,this.msg=this.strm.msg},o.Deflate=x,o.deflate=k,o.deflateRaw=function(P,S){return(S=S||{}).raw=!0,k(P,S)},o.gzip=function(P,S){return(S=S||{}).gzip=!0,k(P,S)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,n,o){var r=e("./zlib/inflate"),f=e("./utils/common"),s=e("./utils/strings"),m=e("./zlib/constants"),w=e("./zlib/messages"),g=e("./zlib/zstream"),v=e("./zlib/gzheader"),d=Object.prototype.toString;function u(x){if(!(this instanceof u))return new u(x);this.options=f.assign({chunkSize:16384,windowBits:0,to:""},x||{});var k=this.options;k.raw&&0<=k.windowBits&&k.windowBits<16&&(k.windowBits=-k.windowBits,k.windowBits===0&&(k.windowBits=-15)),!(0<=k.windowBits&&k.windowBits<16)||x&&x.windowBits||(k.windowBits+=32),15<k.windowBits&&k.windowBits<48&&!(15&k.windowBits)&&(k.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new g,this.strm.avail_out=0;var P=r.inflateInit2(this.strm,k.windowBits);if(P!==m.Z_OK)throw new Error(w[P]);this.header=new v,r.inflateGetHeader(this.strm,this.header)}function y(x,k){var P=new u(k);if(P.push(x,!0),P.err)throw P.msg||w[P.err];return P.result}u.prototype.push=function(x,k){var P,S,E,M,T,D,N=this.strm,F=this.options.chunkSize,O=this.options.dictionary,I=!1;if(this.ended)return!1;S=k===~~k?k:k===!0?m.Z_FINISH:m.Z_NO_FLUSH,typeof x=="string"?N.input=s.binstring2buf(x):d.call(x)==="[object ArrayBuffer]"?N.input=new Uint8Array(x):N.input=x,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new f.Buf8(F),N.next_out=0,N.avail_out=F),(P=r.inflate(N,m.Z_NO_FLUSH))===m.Z_NEED_DICT&&O&&(D=typeof O=="string"?s.string2buf(O):d.call(O)==="[object ArrayBuffer]"?new Uint8Array(O):O,P=r.inflateSetDictionary(this.strm,D)),P===m.Z_BUF_ERROR&&I===!0&&(P=m.Z_OK,I=!1),P!==m.Z_STREAM_END&&P!==m.Z_OK)return this.onEnd(P),!(this.ended=!0);N.next_out&&(N.avail_out!==0&&P!==m.Z_STREAM_END&&(N.avail_in!==0||S!==m.Z_FINISH&&S!==m.Z_SYNC_FLUSH)||(this.options.to==="string"?(E=s.utf8border(N.output,N.next_out),M=N.next_out-E,T=s.buf2string(N.output,E),N.next_out=M,N.avail_out=F-M,M&&f.arraySet(N.output,N.output,E,M,0),this.onData(T)):this.onData(f.shrinkBuf(N.output,N.next_out)))),N.avail_in===0&&N.avail_out===0&&(I=!0)}while((0<N.avail_in||N.avail_out===0)&&P!==m.Z_STREAM_END);return P===m.Z_STREAM_END&&(S=m.Z_FINISH),S===m.Z_FINISH?(P=r.inflateEnd(this.strm),this.onEnd(P),this.ended=!0,P===m.Z_OK):S!==m.Z_SYNC_FLUSH||(this.onEnd(m.Z_OK),!(N.avail_out=0))},u.prototype.onData=function(x){this.chunks.push(x)},u.prototype.onEnd=function(x){x===m.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=f.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg},o.Inflate=u,o.inflate=y,o.inflateRaw=function(x,k){return(k=k||{}).raw=!0,y(x,k)},o.ungzip=y},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,n,o){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(m){for(var w=Array.prototype.slice.call(arguments,1);w.length;){var g=w.shift();if(g){if(_typeof$1(g)!="object")throw new TypeError(g+"must be non-object");for(var v in g)g.hasOwnProperty(v)&&(m[v]=g[v])}}return m},o.shrinkBuf=function(m,w){return m.length===w?m:m.subarray?m.subarray(0,w):(m.length=w,m)};var f={arraySet:function(m,w,g,v,d){if(w.subarray&&m.subarray)m.set(w.subarray(g,g+v),d);else for(var u=0;u<v;u++)m[d+u]=w[g+u]},flattenChunks:function(m){var w,g,v,d,u,y;for(w=v=0,g=m.length;w<g;w++)v+=m[w].length;for(y=new Uint8Array(v),w=d=0,g=m.length;w<g;w++)u=m[w],y.set(u,d),d+=u.length;return y}},s={arraySet:function(m,w,g,v,d){for(var u=0;u<v;u++)m[d+u]=w[g+u]},flattenChunks:function(m){return[].concat.apply([],m)}};o.setTyped=function(m){m?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,f)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,s))},o.setTyped(r)},{}],42:[function(e,n,o){var r=e("./common"),f=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var m=new r.Buf8(256),w=0;w<256;w++)m[w]=252<=w?6:248<=w?5:240<=w?4:224<=w?3:192<=w?2:1;function g(v,d){if(d<65537&&(v.subarray&&s||!v.subarray&&f))return String.fromCharCode.apply(null,r.shrinkBuf(v,d));for(var u="",y=0;y<d;y++)u+=String.fromCharCode(v[y]);return u}m[254]=m[254]=1,o.string2buf=function(v){var d,u,y,x,k,P=v.length,S=0;for(x=0;x<P;x++)(64512&(u=v.charCodeAt(x)))==55296&&x+1<P&&(64512&(y=v.charCodeAt(x+1)))==56320&&(u=65536+(u-55296<<10)+(y-56320),x++),S+=u<128?1:u<2048?2:u<65536?3:4;for(d=new r.Buf8(S),x=k=0;k<S;x++)(64512&(u=v.charCodeAt(x)))==55296&&x+1<P&&(64512&(y=v.charCodeAt(x+1)))==56320&&(u=65536+(u-55296<<10)+(y-56320),x++),u<128?d[k++]=u:(u<2048?d[k++]=192|u>>>6:(u<65536?d[k++]=224|u>>>12:(d[k++]=240|u>>>18,d[k++]=128|u>>>12&63),d[k++]=128|u>>>6&63),d[k++]=128|63&u);return d},o.buf2binstring=function(v){return g(v,v.length)},o.binstring2buf=function(v){for(var d=new r.Buf8(v.length),u=0,y=d.length;u<y;u++)d[u]=v.charCodeAt(u);return d},o.buf2string=function(v,d){var u,y,x,k,P=d||v.length,S=new Array(2*P);for(u=y=0;u<P;)if((x=v[u++])<128)S[y++]=x;else if(4<(k=m[x]))S[y++]=65533,u+=k-1;else{for(x&=k===2?31:k===3?15:7;1<k&&u<P;)x=x<<6|63&v[u++],k--;1<k?S[y++]=65533:x<65536?S[y++]=x:(x-=65536,S[y++]=55296|x>>10&1023,S[y++]=56320|1023&x)}return g(S,y)},o.utf8border=function(v,d){var u;for((d=d||v.length)>v.length&&(d=v.length),u=d-1;0<=u&&(192&v[u])==128;)u--;return u<0||u===0?d:u+m[v[u]]>d?u:d}},{"./common":41}],43:[function(e,n,o){n.exports=function(r,f,s,m){for(var w=65535&r,g=r>>>16&65535,v=0;s!==0;){for(s-=v=2e3<s?2e3:s;g=g+(w=w+f[m++]|0)|0,--v;);w%=65521,g%=65521}return w|g<<16}},{}],44:[function(e,n,o){n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,n,o){var r=function(){for(var f,s=[],m=0;m<256;m++){f=m;for(var w=0;w<8;w++)f=1&f?3988292384^f>>>1:f>>>1;s[m]=f}return s}();n.exports=function(f,s,m,w){var g=r,v=w+m;f^=-1;for(var d=w;d<v;d++)f=f>>>8^g[255&(f^s[d])];return~f}},{}],46:[function(e,n,o){var r,f=e("../utils/common"),s=e("./trees"),m=e("./adler32"),w=e("./crc32"),g=e("./messages"),v=0,d=4,u=0,y=-2,x=-1,k=4,P=2,S=8,E=9,M=286,T=30,D=19,N=2*M+1,F=15,O=3,I=258,X=I+O+1,ne=42,ye=113,J=1,te=2,q=3,re=4;function U(_e,ve){return _e.msg=g[ve],ve}function H(_e){return(_e<<1)-(4<_e?9:0)}function Z(_e){for(var ve=_e.length;0<=--ve;)_e[ve]=0}function Y(_e){var ve=_e.state,be=ve.pending;be>_e.avail_out&&(be=_e.avail_out),be!==0&&(f.arraySet(_e.output,ve.pending_buf,ve.pending_out,be,_e.next_out),_e.next_out+=be,ve.pending_out+=be,_e.total_out+=be,_e.avail_out-=be,ve.pending-=be,ve.pending===0&&(ve.pending_out=0))}function W(_e,ve){s._tr_flush_block(_e,0<=_e.block_start?_e.block_start:-1,_e.strstart-_e.block_start,ve),_e.block_start=_e.strstart,Y(_e.strm)}function Q(_e,ve){_e.pending_buf[_e.pending++]=ve}function oe(_e,ve){_e.pending_buf[_e.pending++]=ve>>>8&255,_e.pending_buf[_e.pending++]=255&ve}function Ce(_e,ve){var be,ke,Me=_e.max_chain_length,Le=_e.strstart,Oe=_e.prev_length,ze=_e.nice_match,We=_e.strstart>_e.w_size-X?_e.strstart-(_e.w_size-X):0,Ge=_e.window,Xe=_e.w_mask,qe=_e.prev,Ke=_e.strstart+I,Qe=Ge[Le+Oe-1],at=Ge[Le+Oe];_e.prev_length>=_e.good_match&&(Me>>=2),ze>_e.lookahead&&(ze=_e.lookahead);do if(Ge[(be=ve)+Oe]===at&&Ge[be+Oe-1]===Qe&&Ge[be]===Ge[Le]&&Ge[++be]===Ge[Le+1]){Le+=2,be++;do;while(Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Le<Ke);if(ke=I-(Ke-Le),Le=Ke-I,Oe<ke){if(_e.match_start=ve,ze<=(Oe=ke))break;Qe=Ge[Le+Oe-1],at=Ge[Le+Oe]}}while((ve=qe[ve&Xe])>We&&--Me!=0);return Oe<=_e.lookahead?Oe:_e.lookahead}function Se(_e){var ve,be,ke,Me,Le,Oe,ze,We,Ge,Xe,qe=_e.w_size;do{if(Me=_e.window_size-_e.lookahead-_e.strstart,_e.strstart>=qe+(qe-X)){for(f.arraySet(_e.window,_e.window,qe,qe,0),_e.match_start-=qe,_e.strstart-=qe,_e.block_start-=qe,ve=be=_e.hash_size;ke=_e.head[--ve],_e.head[ve]=qe<=ke?ke-qe:0,--be;);for(ve=be=qe;ke=_e.prev[--ve],_e.prev[ve]=qe<=ke?ke-qe:0,--be;);Me+=qe}if(_e.strm.avail_in===0)break;if(Oe=_e.strm,ze=_e.window,We=_e.strstart+_e.lookahead,Xe=void 0,(Ge=Me)<(Xe=Oe.avail_in)&&(Xe=Ge),be=Xe===0?0:(Oe.avail_in-=Xe,f.arraySet(ze,Oe.input,Oe.next_in,Xe,We),Oe.state.wrap===1?Oe.adler=m(Oe.adler,ze,Xe,We):Oe.state.wrap===2&&(Oe.adler=w(Oe.adler,ze,Xe,We)),Oe.next_in+=Xe,Oe.total_in+=Xe,Xe),_e.lookahead+=be,_e.lookahead+_e.insert>=O)for(Le=_e.strstart-_e.insert,_e.ins_h=_e.window[Le],_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[Le+1])&_e.hash_mask;_e.insert&&(_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[Le+O-1])&_e.hash_mask,_e.prev[Le&_e.w_mask]=_e.head[_e.ins_h],_e.head[_e.ins_h]=Le,Le++,_e.insert--,!(_e.lookahead+_e.insert<O)););}while(_e.lookahead<X&&_e.strm.avail_in!==0)}function fe(_e,ve){for(var be,ke;;){if(_e.lookahead<X){if(Se(_e),_e.lookahead<X&&ve===v)return J;if(_e.lookahead===0)break}if(be=0,_e.lookahead>=O&&(_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[_e.strstart+O-1])&_e.hash_mask,be=_e.prev[_e.strstart&_e.w_mask]=_e.head[_e.ins_h],_e.head[_e.ins_h]=_e.strstart),be!==0&&_e.strstart-be<=_e.w_size-X&&(_e.match_length=Ce(_e,be)),_e.match_length>=O)if(ke=s._tr_tally(_e,_e.strstart-_e.match_start,_e.match_length-O),_e.lookahead-=_e.match_length,_e.match_length<=_e.max_lazy_match&&_e.lookahead>=O){for(_e.match_length--;_e.strstart++,_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[_e.strstart+O-1])&_e.hash_mask,be=_e.prev[_e.strstart&_e.w_mask]=_e.head[_e.ins_h],_e.head[_e.ins_h]=_e.strstart,--_e.match_length!=0;);_e.strstart++}else _e.strstart+=_e.match_length,_e.match_length=0,_e.ins_h=_e.window[_e.strstart],_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[_e.strstart+1])&_e.hash_mask;else ke=s._tr_tally(_e,0,_e.window[_e.strstart]),_e.lookahead--,_e.strstart++;if(ke&&(W(_e,!1),_e.strm.avail_out===0))return J}return _e.insert=_e.strstart<O-1?_e.strstart:O-1,ve===d?(W(_e,!0),_e.strm.avail_out===0?q:re):_e.last_lit&&(W(_e,!1),_e.strm.avail_out===0)?J:te}function Pe(_e,ve){for(var be,ke,Me;;){if(_e.lookahead<X){if(Se(_e),_e.lookahead<X&&ve===v)return J;if(_e.lookahead===0)break}if(be=0,_e.lookahead>=O&&(_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[_e.strstart+O-1])&_e.hash_mask,be=_e.prev[_e.strstart&_e.w_mask]=_e.head[_e.ins_h],_e.head[_e.ins_h]=_e.strstart),_e.prev_length=_e.match_length,_e.prev_match=_e.match_start,_e.match_length=O-1,be!==0&&_e.prev_length<_e.max_lazy_match&&_e.strstart-be<=_e.w_size-X&&(_e.match_length=Ce(_e,be),_e.match_length<=5&&(_e.strategy===1||_e.match_length===O&&4096<_e.strstart-_e.match_start)&&(_e.match_length=O-1)),_e.prev_length>=O&&_e.match_length<=_e.prev_length){for(Me=_e.strstart+_e.lookahead-O,ke=s._tr_tally(_e,_e.strstart-1-_e.prev_match,_e.prev_length-O),_e.lookahead-=_e.prev_length-1,_e.prev_length-=2;++_e.strstart<=Me&&(_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[_e.strstart+O-1])&_e.hash_mask,be=_e.prev[_e.strstart&_e.w_mask]=_e.head[_e.ins_h],_e.head[_e.ins_h]=_e.strstart),--_e.prev_length!=0;);if(_e.match_available=0,_e.match_length=O-1,_e.strstart++,ke&&(W(_e,!1),_e.strm.avail_out===0))return J}else if(_e.match_available){if((ke=s._tr_tally(_e,0,_e.window[_e.strstart-1]))&&W(_e,!1),_e.strstart++,_e.lookahead--,_e.strm.avail_out===0)return J}else _e.match_available=1,_e.strstart++,_e.lookahead--}return _e.match_available&&(ke=s._tr_tally(_e,0,_e.window[_e.strstart-1]),_e.match_available=0),_e.insert=_e.strstart<O-1?_e.strstart:O-1,ve===d?(W(_e,!0),_e.strm.avail_out===0?q:re):_e.last_lit&&(W(_e,!1),_e.strm.avail_out===0)?J:te}function Ae(_e,ve,be,ke,Me){this.good_length=_e,this.max_lazy=ve,this.nice_length=be,this.max_chain=ke,this.func=Me}function Te(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=S,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new f.Buf16(2*N),this.dyn_dtree=new f.Buf16(2*(2*T+1)),this.bl_tree=new f.Buf16(2*(2*D+1)),Z(this.dyn_ltree),Z(this.dyn_dtree),Z(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new f.Buf16(F+1),this.heap=new f.Buf16(2*M+1),Z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new f.Buf16(2*M+1),Z(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ee(_e){var ve;return _e&&_e.state?(_e.total_in=_e.total_out=0,_e.data_type=P,(ve=_e.state).pending=0,ve.pending_out=0,ve.wrap<0&&(ve.wrap=-ve.wrap),ve.status=ve.wrap?ne:ye,_e.adler=ve.wrap===2?0:1,ve.last_flush=v,s._tr_init(ve),u):U(_e,y)}function Be(_e){var ve=Ee(_e);return ve===u&&function(be){be.window_size=2*be.w_size,Z(be.head),be.max_lazy_match=r[be.level].max_lazy,be.good_match=r[be.level].good_length,be.nice_match=r[be.level].nice_length,be.max_chain_length=r[be.level].max_chain,be.strstart=0,be.block_start=0,be.lookahead=0,be.insert=0,be.match_length=be.prev_length=O-1,be.match_available=0,be.ins_h=0}(_e.state),ve}function Ve(_e,ve,be,ke,Me,Le){if(!_e)return y;var Oe=1;if(ve===x&&(ve=6),ke<0?(Oe=0,ke=-ke):15<ke&&(Oe=2,ke-=16),Me<1||E<Me||be!==S||ke<8||15<ke||ve<0||9<ve||Le<0||k<Le)return U(_e,y);ke===8&&(ke=9);var ze=new Te;return(_e.state=ze).strm=_e,ze.wrap=Oe,ze.gzhead=null,ze.w_bits=ke,ze.w_size=1<<ze.w_bits,ze.w_mask=ze.w_size-1,ze.hash_bits=Me+7,ze.hash_size=1<<ze.hash_bits,ze.hash_mask=ze.hash_size-1,ze.hash_shift=~~((ze.hash_bits+O-1)/O),ze.window=new f.Buf8(2*ze.w_size),ze.head=new f.Buf16(ze.hash_size),ze.prev=new f.Buf16(ze.w_size),ze.lit_bufsize=1<<Me+6,ze.pending_buf_size=4*ze.lit_bufsize,ze.pending_buf=new f.Buf8(ze.pending_buf_size),ze.d_buf=1*ze.lit_bufsize,ze.l_buf=3*ze.lit_bufsize,ze.level=ve,ze.strategy=Le,ze.method=be,Be(_e)}r=[new Ae(0,0,0,0,function(_e,ve){var be=65535;for(be>_e.pending_buf_size-5&&(be=_e.pending_buf_size-5);;){if(_e.lookahead<=1){if(Se(_e),_e.lookahead===0&&ve===v)return J;if(_e.lookahead===0)break}_e.strstart+=_e.lookahead,_e.lookahead=0;var ke=_e.block_start+be;if((_e.strstart===0||_e.strstart>=ke)&&(_e.lookahead=_e.strstart-ke,_e.strstart=ke,W(_e,!1),_e.strm.avail_out===0)||_e.strstart-_e.block_start>=_e.w_size-X&&(W(_e,!1),_e.strm.avail_out===0))return J}return _e.insert=0,ve===d?(W(_e,!0),_e.strm.avail_out===0?q:re):(_e.strstart>_e.block_start&&(W(_e,!1),_e.strm.avail_out),J)}),new Ae(4,4,8,4,fe),new Ae(4,5,16,8,fe),new Ae(4,6,32,32,fe),new Ae(4,4,16,16,Pe),new Ae(8,16,32,32,Pe),new Ae(8,16,128,128,Pe),new Ae(8,32,128,256,Pe),new Ae(32,128,258,1024,Pe),new Ae(32,258,258,4096,Pe)],o.deflateInit=function(_e,ve){return Ve(_e,ve,S,15,8,0)},o.deflateInit2=Ve,o.deflateReset=Be,o.deflateResetKeep=Ee,o.deflateSetHeader=function(_e,ve){return _e&&_e.state?_e.state.wrap!==2?y:(_e.state.gzhead=ve,u):y},o.deflate=function(_e,ve){var be,ke,Me,Le;if(!_e||!_e.state||5<ve||ve<0)return _e?U(_e,y):y;if(ke=_e.state,!_e.output||!_e.input&&_e.avail_in!==0||ke.status===666&&ve!==d)return U(_e,_e.avail_out===0?-5:y);if(ke.strm=_e,be=ke.last_flush,ke.last_flush=ve,ke.status===ne)if(ke.wrap===2)_e.adler=0,Q(ke,31),Q(ke,139),Q(ke,8),ke.gzhead?(Q(ke,(ke.gzhead.text?1:0)+(ke.gzhead.hcrc?2:0)+(ke.gzhead.extra?4:0)+(ke.gzhead.name?8:0)+(ke.gzhead.comment?16:0)),Q(ke,255&ke.gzhead.time),Q(ke,ke.gzhead.time>>8&255),Q(ke,ke.gzhead.time>>16&255),Q(ke,ke.gzhead.time>>24&255),Q(ke,ke.level===9?2:2<=ke.strategy||ke.level<2?4:0),Q(ke,255&ke.gzhead.os),ke.gzhead.extra&&ke.gzhead.extra.length&&(Q(ke,255&ke.gzhead.extra.length),Q(ke,ke.gzhead.extra.length>>8&255)),ke.gzhead.hcrc&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending,0)),ke.gzindex=0,ke.status=69):(Q(ke,0),Q(ke,0),Q(ke,0),Q(ke,0),Q(ke,0),Q(ke,ke.level===9?2:2<=ke.strategy||ke.level<2?4:0),Q(ke,3),ke.status=ye);else{var Oe=S+(ke.w_bits-8<<4)<<8;Oe|=(2<=ke.strategy||ke.level<2?0:ke.level<6?1:ke.level===6?2:3)<<6,ke.strstart!==0&&(Oe|=32),Oe+=31-Oe%31,ke.status=ye,oe(ke,Oe),ke.strstart!==0&&(oe(ke,_e.adler>>>16),oe(ke,65535&_e.adler)),_e.adler=1}if(ke.status===69)if(ke.gzhead.extra){for(Me=ke.pending;ke.gzindex<(65535&ke.gzhead.extra.length)&&(ke.pending!==ke.pending_buf_size||(ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),Y(_e),Me=ke.pending,ke.pending!==ke.pending_buf_size));)Q(ke,255&ke.gzhead.extra[ke.gzindex]),ke.gzindex++;ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),ke.gzindex===ke.gzhead.extra.length&&(ke.gzindex=0,ke.status=73)}else ke.status=73;if(ke.status===73)if(ke.gzhead.name){Me=ke.pending;do{if(ke.pending===ke.pending_buf_size&&(ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),Y(_e),Me=ke.pending,ke.pending===ke.pending_buf_size)){Le=1;break}Le=ke.gzindex<ke.gzhead.name.length?255&ke.gzhead.name.charCodeAt(ke.gzindex++):0,Q(ke,Le)}while(Le!==0);ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),Le===0&&(ke.gzindex=0,ke.status=91)}else ke.status=91;if(ke.status===91)if(ke.gzhead.comment){Me=ke.pending;do{if(ke.pending===ke.pending_buf_size&&(ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),Y(_e),Me=ke.pending,ke.pending===ke.pending_buf_size)){Le=1;break}Le=ke.gzindex<ke.gzhead.comment.length?255&ke.gzhead.comment.charCodeAt(ke.gzindex++):0,Q(ke,Le)}while(Le!==0);ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),Le===0&&(ke.status=103)}else ke.status=103;if(ke.status===103&&(ke.gzhead.hcrc?(ke.pending+2>ke.pending_buf_size&&Y(_e),ke.pending+2<=ke.pending_buf_size&&(Q(ke,255&_e.adler),Q(ke,_e.adler>>8&255),_e.adler=0,ke.status=ye)):ke.status=ye),ke.pending!==0){if(Y(_e),_e.avail_out===0)return ke.last_flush=-1,u}else if(_e.avail_in===0&&H(ve)<=H(be)&&ve!==d)return U(_e,-5);if(ke.status===666&&_e.avail_in!==0)return U(_e,-5);if(_e.avail_in!==0||ke.lookahead!==0||ve!==v&&ke.status!==666){var ze=ke.strategy===2?function(We,Ge){for(var Xe;;){if(We.lookahead===0&&(Se(We),We.lookahead===0)){if(Ge===v)return J;break}if(We.match_length=0,Xe=s._tr_tally(We,0,We.window[We.strstart]),We.lookahead--,We.strstart++,Xe&&(W(We,!1),We.strm.avail_out===0))return J}return We.insert=0,Ge===d?(W(We,!0),We.strm.avail_out===0?q:re):We.last_lit&&(W(We,!1),We.strm.avail_out===0)?J:te}(ke,ve):ke.strategy===3?function(We,Ge){for(var Xe,qe,Ke,Qe,at=We.window;;){if(We.lookahead<=I){if(Se(We),We.lookahead<=I&&Ge===v)return J;if(We.lookahead===0)break}if(We.match_length=0,We.lookahead>=O&&0<We.strstart&&(qe=at[Ke=We.strstart-1])===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]){Qe=We.strstart+I;do;while(qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&Ke<Qe);We.match_length=I-(Qe-Ke),We.match_length>We.lookahead&&(We.match_length=We.lookahead)}if(We.match_length>=O?(Xe=s._tr_tally(We,1,We.match_length-O),We.lookahead-=We.match_length,We.strstart+=We.match_length,We.match_length=0):(Xe=s._tr_tally(We,0,We.window[We.strstart]),We.lookahead--,We.strstart++),Xe&&(W(We,!1),We.strm.avail_out===0))return J}return We.insert=0,Ge===d?(W(We,!0),We.strm.avail_out===0?q:re):We.last_lit&&(W(We,!1),We.strm.avail_out===0)?J:te}(ke,ve):r[ke.level].func(ke,ve);if(ze!==q&&ze!==re||(ke.status=666),ze===J||ze===q)return _e.avail_out===0&&(ke.last_flush=-1),u;if(ze===te&&(ve===1?s._tr_align(ke):ve!==5&&(s._tr_stored_block(ke,0,0,!1),ve===3&&(Z(ke.head),ke.lookahead===0&&(ke.strstart=0,ke.block_start=0,ke.insert=0))),Y(_e),_e.avail_out===0))return ke.last_flush=-1,u}return ve!==d?u:ke.wrap<=0?1:(ke.wrap===2?(Q(ke,255&_e.adler),Q(ke,_e.adler>>8&255),Q(ke,_e.adler>>16&255),Q(ke,_e.adler>>24&255),Q(ke,255&_e.total_in),Q(ke,_e.total_in>>8&255),Q(ke,_e.total_in>>16&255),Q(ke,_e.total_in>>24&255)):(oe(ke,_e.adler>>>16),oe(ke,65535&_e.adler)),Y(_e),0<ke.wrap&&(ke.wrap=-ke.wrap),ke.pending!==0?u:1)},o.deflateEnd=function(_e){var ve;return _e&&_e.state?(ve=_e.state.status)!==ne&&ve!==69&&ve!==73&&ve!==91&&ve!==103&&ve!==ye&&ve!==666?U(_e,y):(_e.state=null,ve===ye?U(_e,-3):u):y},o.deflateSetDictionary=function(_e,ve){var be,ke,Me,Le,Oe,ze,We,Ge,Xe=ve.length;if(!_e||!_e.state||(Le=(be=_e.state).wrap)===2||Le===1&&be.status!==ne||be.lookahead)return y;for(Le===1&&(_e.adler=m(_e.adler,ve,Xe,0)),be.wrap=0,Xe>=be.w_size&&(Le===0&&(Z(be.head),be.strstart=0,be.block_start=0,be.insert=0),Ge=new f.Buf8(be.w_size),f.arraySet(Ge,ve,Xe-be.w_size,be.w_size,0),ve=Ge,Xe=be.w_size),Oe=_e.avail_in,ze=_e.next_in,We=_e.input,_e.avail_in=Xe,_e.next_in=0,_e.input=ve,Se(be);be.lookahead>=O;){for(ke=be.strstart,Me=be.lookahead-(O-1);be.ins_h=(be.ins_h<<be.hash_shift^be.window[ke+O-1])&be.hash_mask,be.prev[ke&be.w_mask]=be.head[be.ins_h],be.head[be.ins_h]=ke,ke++,--Me;);be.strstart=ke,be.lookahead=O-1,Se(be)}return be.strstart+=be.lookahead,be.block_start=be.strstart,be.insert=be.lookahead,be.lookahead=0,be.match_length=be.prev_length=O-1,be.match_available=0,_e.next_in=ze,_e.input=We,_e.avail_in=Oe,be.wrap=Le,u},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,n,o){n.exports=function(){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}},{}],48:[function(e,n,o){n.exports=function(r,f){var s,m,w,g,v,d,u,y,x,k,P,S,E,M,T,D,N,F,O,I,X,ne,ye,J,te;s=r.state,m=r.next_in,J=r.input,w=m+(r.avail_in-5),g=r.next_out,te=r.output,v=g-(f-r.avail_out),d=g+(r.avail_out-257),u=s.dmax,y=s.wsize,x=s.whave,k=s.wnext,P=s.window,S=s.hold,E=s.bits,M=s.lencode,T=s.distcode,D=(1<<s.lenbits)-1,N=(1<<s.distbits)-1;e:do{E<15&&(S+=J[m++]<<E,E+=8,S+=J[m++]<<E,E+=8),F=M[S&D];t:for(;;){if(S>>>=O=F>>>24,E-=O,(O=F>>>16&255)==0)te[g++]=65535&F;else{if(!(16&O)){if(!(64&O)){F=M[(65535&F)+(S&(1<<O)-1)];continue t}if(32&O){s.mode=12;break e}r.msg="invalid literal/length code",s.mode=30;break e}I=65535&F,(O&=15)&&(E<O&&(S+=J[m++]<<E,E+=8),I+=S&(1<<O)-1,S>>>=O,E-=O),E<15&&(S+=J[m++]<<E,E+=8,S+=J[m++]<<E,E+=8),F=T[S&N];n:for(;;){if(S>>>=O=F>>>24,E-=O,!(16&(O=F>>>16&255))){if(!(64&O)){F=T[(65535&F)+(S&(1<<O)-1)];continue n}r.msg="invalid distance code",s.mode=30;break e}if(X=65535&F,E<(O&=15)&&(S+=J[m++]<<E,(E+=8)<O&&(S+=J[m++]<<E,E+=8)),u<(X+=S&(1<<O)-1)){r.msg="invalid distance too far back",s.mode=30;break e}if(S>>>=O,E-=O,(O=g-v)<X){if(x<(O=X-O)&&s.sane){r.msg="invalid distance too far back",s.mode=30;break e}if(ye=P,(ne=0)===k){if(ne+=y-O,O<I){for(I-=O;te[g++]=P[ne++],--O;);ne=g-X,ye=te}}else if(k<O){if(ne+=y+k-O,(O-=k)<I){for(I-=O;te[g++]=P[ne++],--O;);if(ne=0,k<I){for(I-=O=k;te[g++]=P[ne++],--O;);ne=g-X,ye=te}}}else if(ne+=k-O,O<I){for(I-=O;te[g++]=P[ne++],--O;);ne=g-X,ye=te}for(;2<I;)te[g++]=ye[ne++],te[g++]=ye[ne++],te[g++]=ye[ne++],I-=3;I&&(te[g++]=ye[ne++],1<I&&(te[g++]=ye[ne++]))}else{for(ne=g-X;te[g++]=te[ne++],te[g++]=te[ne++],te[g++]=te[ne++],2<(I-=3););I&&(te[g++]=te[ne++],1<I&&(te[g++]=te[ne++]))}break}}break}}while(m<w&&g<d);m-=I=E>>3,S&=(1<<(E-=I<<3))-1,r.next_in=m,r.next_out=g,r.avail_in=m<w?w-m+5:5-(m-w),r.avail_out=g<d?d-g+257:257-(g-d),s.hold=S,s.bits=E}},{}],49:[function(e,n,o){var r=e("../utils/common"),f=e("./adler32"),s=e("./crc32"),m=e("./inffast"),w=e("./inftrees"),g=1,v=2,d=0,u=-2,y=1,x=852,k=592;function P(ne){return(ne>>>24&255)+(ne>>>8&65280)+((65280&ne)<<8)+((255&ne)<<24)}function S(){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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function E(ne){var ye;return ne&&ne.state?(ye=ne.state,ne.total_in=ne.total_out=ye.total=0,ne.msg="",ye.wrap&&(ne.adler=1&ye.wrap),ye.mode=y,ye.last=0,ye.havedict=0,ye.dmax=32768,ye.head=null,ye.hold=0,ye.bits=0,ye.lencode=ye.lendyn=new r.Buf32(x),ye.distcode=ye.distdyn=new r.Buf32(k),ye.sane=1,ye.back=-1,d):u}function M(ne){var ye;return ne&&ne.state?((ye=ne.state).wsize=0,ye.whave=0,ye.wnext=0,E(ne)):u}function T(ne,ye){var J,te;return ne&&ne.state?(te=ne.state,ye<0?(J=0,ye=-ye):(J=1+(ye>>4),ye<48&&(ye&=15)),ye&&(ye<8||15<ye)?u:(te.window!==null&&te.wbits!==ye&&(te.window=null),te.wrap=J,te.wbits=ye,M(ne))):u}function D(ne,ye){var J,te;return ne?(te=new S,(ne.state=te).window=null,(J=T(ne,ye))!==d&&(ne.state=null),J):u}var N,F,O=!0;function I(ne){if(O){var ye;for(N=new r.Buf32(512),F=new r.Buf32(32),ye=0;ye<144;)ne.lens[ye++]=8;for(;ye<256;)ne.lens[ye++]=9;for(;ye<280;)ne.lens[ye++]=7;for(;ye<288;)ne.lens[ye++]=8;for(w(g,ne.lens,0,288,N,0,ne.work,{bits:9}),ye=0;ye<32;)ne.lens[ye++]=5;w(v,ne.lens,0,32,F,0,ne.work,{bits:5}),O=!1}ne.lencode=N,ne.lenbits=9,ne.distcode=F,ne.distbits=5}function X(ne,ye,J,te){var q,re=ne.state;return re.window===null&&(re.wsize=1<<re.wbits,re.wnext=0,re.whave=0,re.window=new r.Buf8(re.wsize)),te>=re.wsize?(r.arraySet(re.window,ye,J-re.wsize,re.wsize,0),re.wnext=0,re.whave=re.wsize):(te<(q=re.wsize-re.wnext)&&(q=te),r.arraySet(re.window,ye,J-te,q,re.wnext),(te-=q)?(r.arraySet(re.window,ye,J-te,te,0),re.wnext=te,re.whave=re.wsize):(re.wnext+=q,re.wnext===re.wsize&&(re.wnext=0),re.whave<re.wsize&&(re.whave+=q))),0}o.inflateReset=M,o.inflateReset2=T,o.inflateResetKeep=E,o.inflateInit=function(ne){return D(ne,15)},o.inflateInit2=D,o.inflate=function(ne,ye){var J,te,q,re,U,H,Z,Y,W,Q,oe,Ce,Se,fe,Pe,Ae,Te,Ee,Be,Ve,_e,ve,be,ke,Me=0,Le=new r.Buf8(4),Oe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ne||!ne.state||!ne.output||!ne.input&&ne.avail_in!==0)return u;(J=ne.state).mode===12&&(J.mode=13),U=ne.next_out,q=ne.output,Z=ne.avail_out,re=ne.next_in,te=ne.input,H=ne.avail_in,Y=J.hold,W=J.bits,Q=H,oe=Z,ve=d;e:for(;;)switch(J.mode){case y:if(J.wrap===0){J.mode=13;break}for(;W<16;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(2&J.wrap&&Y===35615){Le[J.check=0]=255&Y,Le[1]=Y>>>8&255,J.check=s(J.check,Le,2,0),W=Y=0,J.mode=2;break}if(J.flags=0,J.head&&(J.head.done=!1),!(1&J.wrap)||(((255&Y)<<8)+(Y>>8))%31){ne.msg="incorrect header check",J.mode=30;break}if((15&Y)!=8){ne.msg="unknown compression method",J.mode=30;break}if(W-=4,_e=8+(15&(Y>>>=4)),J.wbits===0)J.wbits=_e;else if(_e>J.wbits){ne.msg="invalid window size",J.mode=30;break}J.dmax=1<<_e,ne.adler=J.check=1,J.mode=512&Y?10:12,W=Y=0;break;case 2:for(;W<16;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(J.flags=Y,(255&J.flags)!=8){ne.msg="unknown compression method",J.mode=30;break}if(57344&J.flags){ne.msg="unknown header flags set",J.mode=30;break}J.head&&(J.head.text=Y>>8&1),512&J.flags&&(Le[0]=255&Y,Le[1]=Y>>>8&255,J.check=s(J.check,Le,2,0)),W=Y=0,J.mode=3;case 3:for(;W<32;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.head&&(J.head.time=Y),512&J.flags&&(Le[0]=255&Y,Le[1]=Y>>>8&255,Le[2]=Y>>>16&255,Le[3]=Y>>>24&255,J.check=s(J.check,Le,4,0)),W=Y=0,J.mode=4;case 4:for(;W<16;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.head&&(J.head.xflags=255&Y,J.head.os=Y>>8),512&J.flags&&(Le[0]=255&Y,Le[1]=Y>>>8&255,J.check=s(J.check,Le,2,0)),W=Y=0,J.mode=5;case 5:if(1024&J.flags){for(;W<16;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.length=Y,J.head&&(J.head.extra_len=Y),512&J.flags&&(Le[0]=255&Y,Le[1]=Y>>>8&255,J.check=s(J.check,Le,2,0)),W=Y=0}else J.head&&(J.head.extra=null);J.mode=6;case 6:if(1024&J.flags&&(H<(Ce=J.length)&&(Ce=H),Ce&&(J.head&&(_e=J.head.extra_len-J.length,J.head.extra||(J.head.extra=new Array(J.head.extra_len)),r.arraySet(J.head.extra,te,re,Ce,_e)),512&J.flags&&(J.check=s(J.check,te,Ce,re)),H-=Ce,re+=Ce,J.length-=Ce),J.length))break e;J.length=0,J.mode=7;case 7:if(2048&J.flags){if(H===0)break e;for(Ce=0;_e=te[re+Ce++],J.head&&_e&&J.length<65536&&(J.head.name+=String.fromCharCode(_e)),_e&&Ce<H;);if(512&J.flags&&(J.check=s(J.check,te,Ce,re)),H-=Ce,re+=Ce,_e)break e}else J.head&&(J.head.name=null);J.length=0,J.mode=8;case 8:if(4096&J.flags){if(H===0)break e;for(Ce=0;_e=te[re+Ce++],J.head&&_e&&J.length<65536&&(J.head.comment+=String.fromCharCode(_e)),_e&&Ce<H;);if(512&J.flags&&(J.check=s(J.check,te,Ce,re)),H-=Ce,re+=Ce,_e)break e}else J.head&&(J.head.comment=null);J.mode=9;case 9:if(512&J.flags){for(;W<16;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(Y!==(65535&J.check)){ne.msg="header crc mismatch",J.mode=30;break}W=Y=0}J.head&&(J.head.hcrc=J.flags>>9&1,J.head.done=!0),ne.adler=J.check=0,J.mode=12;break;case 10:for(;W<32;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}ne.adler=J.check=P(Y),W=Y=0,J.mode=11;case 11:if(J.havedict===0)return ne.next_out=U,ne.avail_out=Z,ne.next_in=re,ne.avail_in=H,J.hold=Y,J.bits=W,2;ne.adler=J.check=1,J.mode=12;case 12:if(ye===5||ye===6)break e;case 13:if(J.last){Y>>>=7&W,W-=7&W,J.mode=27;break}for(;W<3;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}switch(J.last=1&Y,W-=1,3&(Y>>>=1)){case 0:J.mode=14;break;case 1:if(I(J),J.mode=20,ye!==6)break;Y>>>=2,W-=2;break e;case 2:J.mode=17;break;case 3:ne.msg="invalid block type",J.mode=30}Y>>>=2,W-=2;break;case 14:for(Y>>>=7&W,W-=7&W;W<32;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if((65535&Y)!=(Y>>>16^65535)){ne.msg="invalid stored block lengths",J.mode=30;break}if(J.length=65535&Y,W=Y=0,J.mode=15,ye===6)break e;case 15:J.mode=16;case 16:if(Ce=J.length){if(H<Ce&&(Ce=H),Z<Ce&&(Ce=Z),Ce===0)break e;r.arraySet(q,te,re,Ce,U),H-=Ce,re+=Ce,Z-=Ce,U+=Ce,J.length-=Ce;break}J.mode=12;break;case 17:for(;W<14;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(J.nlen=257+(31&Y),Y>>>=5,W-=5,J.ndist=1+(31&Y),Y>>>=5,W-=5,J.ncode=4+(15&Y),Y>>>=4,W-=4,286<J.nlen||30<J.ndist){ne.msg="too many length or distance symbols",J.mode=30;break}J.have=0,J.mode=18;case 18:for(;J.have<J.ncode;){for(;W<3;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.lens[Oe[J.have++]]=7&Y,Y>>>=3,W-=3}for(;J.have<19;)J.lens[Oe[J.have++]]=0;if(J.lencode=J.lendyn,J.lenbits=7,be={bits:J.lenbits},ve=w(0,J.lens,0,19,J.lencode,0,J.work,be),J.lenbits=be.bits,ve){ne.msg="invalid code lengths set",J.mode=30;break}J.have=0,J.mode=19;case 19:for(;J.have<J.nlen+J.ndist;){for(;Ae=(Me=J.lencode[Y&(1<<J.lenbits)-1])>>>16&255,Te=65535&Me,!((Pe=Me>>>24)<=W);){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(Te<16)Y>>>=Pe,W-=Pe,J.lens[J.have++]=Te;else{if(Te===16){for(ke=Pe+2;W<ke;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(Y>>>=Pe,W-=Pe,J.have===0){ne.msg="invalid bit length repeat",J.mode=30;break}_e=J.lens[J.have-1],Ce=3+(3&Y),Y>>>=2,W-=2}else if(Te===17){for(ke=Pe+3;W<ke;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}W-=Pe,_e=0,Ce=3+(7&(Y>>>=Pe)),Y>>>=3,W-=3}else{for(ke=Pe+7;W<ke;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}W-=Pe,_e=0,Ce=11+(127&(Y>>>=Pe)),Y>>>=7,W-=7}if(J.have+Ce>J.nlen+J.ndist){ne.msg="invalid bit length repeat",J.mode=30;break}for(;Ce--;)J.lens[J.have++]=_e}}if(J.mode===30)break;if(J.lens[256]===0){ne.msg="invalid code -- missing end-of-block",J.mode=30;break}if(J.lenbits=9,be={bits:J.lenbits},ve=w(g,J.lens,0,J.nlen,J.lencode,0,J.work,be),J.lenbits=be.bits,ve){ne.msg="invalid literal/lengths set",J.mode=30;break}if(J.distbits=6,J.distcode=J.distdyn,be={bits:J.distbits},ve=w(v,J.lens,J.nlen,J.ndist,J.distcode,0,J.work,be),J.distbits=be.bits,ve){ne.msg="invalid distances set",J.mode=30;break}if(J.mode=20,ye===6)break e;case 20:J.mode=21;case 21:if(6<=H&&258<=Z){ne.next_out=U,ne.avail_out=Z,ne.next_in=re,ne.avail_in=H,J.hold=Y,J.bits=W,m(ne,oe),U=ne.next_out,q=ne.output,Z=ne.avail_out,re=ne.next_in,te=ne.input,H=ne.avail_in,Y=J.hold,W=J.bits,J.mode===12&&(J.back=-1);break}for(J.back=0;Ae=(Me=J.lencode[Y&(1<<J.lenbits)-1])>>>16&255,Te=65535&Me,!((Pe=Me>>>24)<=W);){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(Ae&&!(240&Ae)){for(Ee=Pe,Be=Ae,Ve=Te;Ae=(Me=J.lencode[Ve+((Y&(1<<Ee+Be)-1)>>Ee)])>>>16&255,Te=65535&Me,!(Ee+(Pe=Me>>>24)<=W);){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}Y>>>=Ee,W-=Ee,J.back+=Ee}if(Y>>>=Pe,W-=Pe,J.back+=Pe,J.length=Te,Ae===0){J.mode=26;break}if(32&Ae){J.back=-1,J.mode=12;break}if(64&Ae){ne.msg="invalid literal/length code",J.mode=30;break}J.extra=15&Ae,J.mode=22;case 22:if(J.extra){for(ke=J.extra;W<ke;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.length+=Y&(1<<J.extra)-1,Y>>>=J.extra,W-=J.extra,J.back+=J.extra}J.was=J.length,J.mode=23;case 23:for(;Ae=(Me=J.distcode[Y&(1<<J.distbits)-1])>>>16&255,Te=65535&Me,!((Pe=Me>>>24)<=W);){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(!(240&Ae)){for(Ee=Pe,Be=Ae,Ve=Te;Ae=(Me=J.distcode[Ve+((Y&(1<<Ee+Be)-1)>>Ee)])>>>16&255,Te=65535&Me,!(Ee+(Pe=Me>>>24)<=W);){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}Y>>>=Ee,W-=Ee,J.back+=Ee}if(Y>>>=Pe,W-=Pe,J.back+=Pe,64&Ae){ne.msg="invalid distance code",J.mode=30;break}J.offset=Te,J.extra=15&Ae,J.mode=24;case 24:if(J.extra){for(ke=J.extra;W<ke;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.offset+=Y&(1<<J.extra)-1,Y>>>=J.extra,W-=J.extra,J.back+=J.extra}if(J.offset>J.dmax){ne.msg="invalid distance too far back",J.mode=30;break}J.mode=25;case 25:if(Z===0)break e;if(Ce=oe-Z,J.offset>Ce){if((Ce=J.offset-Ce)>J.whave&&J.sane){ne.msg="invalid distance too far back",J.mode=30;break}Se=Ce>J.wnext?(Ce-=J.wnext,J.wsize-Ce):J.wnext-Ce,Ce>J.length&&(Ce=J.length),fe=J.window}else fe=q,Se=U-J.offset,Ce=J.length;for(Z<Ce&&(Ce=Z),Z-=Ce,J.length-=Ce;q[U++]=fe[Se++],--Ce;);J.length===0&&(J.mode=21);break;case 26:if(Z===0)break e;q[U++]=J.length,Z--,J.mode=21;break;case 27:if(J.wrap){for(;W<32;){if(H===0)break e;H--,Y|=te[re++]<<W,W+=8}if(oe-=Z,ne.total_out+=oe,J.total+=oe,oe&&(ne.adler=J.check=J.flags?s(J.check,q,oe,U-oe):f(J.check,q,oe,U-oe)),oe=Z,(J.flags?Y:P(Y))!==J.check){ne.msg="incorrect data check",J.mode=30;break}W=Y=0}J.mode=28;case 28:if(J.wrap&&J.flags){for(;W<32;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(Y!==(4294967295&J.total)){ne.msg="incorrect length check",J.mode=30;break}W=Y=0}J.mode=29;case 29:ve=1;break e;case 30:ve=-3;break e;case 31:return-4;default:return u}return ne.next_out=U,ne.avail_out=Z,ne.next_in=re,ne.avail_in=H,J.hold=Y,J.bits=W,(J.wsize||oe!==ne.avail_out&&J.mode<30&&(J.mode<27||ye!==4))&&X(ne,ne.output,ne.next_out,oe-ne.avail_out)?(J.mode=31,-4):(Q-=ne.avail_in,oe-=ne.avail_out,ne.total_in+=Q,ne.total_out+=oe,J.total+=oe,J.wrap&&oe&&(ne.adler=J.check=J.flags?s(J.check,q,oe,ne.next_out-oe):f(J.check,q,oe,ne.next_out-oe)),ne.data_type=J.bits+(J.last?64:0)+(J.mode===12?128:0)+(J.mode===20||J.mode===15?256:0),(Q==0&&oe===0||ye===4)&&ve===d&&(ve=-5),ve)},o.inflateEnd=function(ne){if(!ne||!ne.state)return u;var ye=ne.state;return ye.window&&(ye.window=null),ne.state=null,d},o.inflateGetHeader=function(ne,ye){var J;return ne&&ne.state&&2&(J=ne.state).wrap?((J.head=ye).done=!1,d):u},o.inflateSetDictionary=function(ne,ye){var J,te=ye.length;return ne&&ne.state?(J=ne.state).wrap!==0&&J.mode!==11?u:J.mode===11&&f(1,ye,te,0)!==J.check?-3:X(ne,ye,te,te)?(J.mode=31,-4):(J.havedict=1,d):u},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,n,o){var r=e("../utils/common"),f=[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],s=[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],m=[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],w=[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];n.exports=function(g,v,d,u,y,x,k,P){var S,E,M,T,D,N,F,O,I,X=P.bits,ne=0,ye=0,J=0,te=0,q=0,re=0,U=0,H=0,Z=0,Y=0,W=null,Q=0,oe=new r.Buf16(16),Ce=new r.Buf16(16),Se=null,fe=0;for(ne=0;ne<=15;ne++)oe[ne]=0;for(ye=0;ye<u;ye++)oe[v[d+ye]]++;for(q=X,te=15;1<=te&&oe[te]===0;te--);if(te<q&&(q=te),te===0)return y[x++]=20971520,y[x++]=20971520,P.bits=1,0;for(J=1;J<te&&oe[J]===0;J++);for(q<J&&(q=J),ne=H=1;ne<=15;ne++)if(H<<=1,(H-=oe[ne])<0)return-1;if(0<H&&(g===0||te!==1))return-1;for(Ce[1]=0,ne=1;ne<15;ne++)Ce[ne+1]=Ce[ne]+oe[ne];for(ye=0;ye<u;ye++)v[d+ye]!==0&&(k[Ce[v[d+ye]]++]=ye);if(N=g===0?(W=Se=k,19):g===1?(W=f,Q-=257,Se=s,fe-=257,256):(W=m,Se=w,-1),ne=J,D=x,U=ye=Y=0,M=-1,T=(Z=1<<(re=q))-1,g===1&&852<Z||g===2&&592<Z)return 1;for(;;){for(F=ne-U,I=k[ye]<N?(O=0,k[ye]):k[ye]>N?(O=Se[fe+k[ye]],W[Q+k[ye]]):(O=96,0),S=1<<ne-U,J=E=1<<re;y[D+(Y>>U)+(E-=S)]=F<<24|O<<16|I,E!==0;);for(S=1<<ne-1;Y&S;)S>>=1;if(S!==0?(Y&=S-1,Y+=S):Y=0,ye++,--oe[ne]==0){if(ne===te)break;ne=v[d+k[ye]]}if(q<ne&&(Y&T)!==M){for(U===0&&(U=q),D+=J,H=1<<(re=ne-U);re+U<te&&!((H-=oe[re+U])<=0);)re++,H<<=1;if(Z+=1<<re,g===1&&852<Z||g===2&&592<Z)return 1;y[M=Y&T]=q<<24|re<<16|D-x}}return Y!==0&&(y[D+Y]=ne-U<<24|64<<16),P.bits=q,0}},{"../utils/common":41}],51:[function(e,n,o){n.exports={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"}},{}],52:[function(e,n,o){var r=e("../utils/common"),f=0,s=1;function m(Me){for(var Le=Me.length;0<=--Le;)Me[Le]=0}var w=0,g=29,v=256,d=v+1+g,u=30,y=19,x=2*d+1,k=15,P=16,S=7,E=256,M=16,T=17,D=18,N=[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],F=[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],O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],X=new Array(2*(d+2));m(X);var ne=new Array(2*u);m(ne);var ye=new Array(512);m(ye);var J=new Array(256);m(J);var te=new Array(g);m(te);var q,re,U,H=new Array(u);function Z(Me,Le,Oe,ze,We){this.static_tree=Me,this.extra_bits=Le,this.extra_base=Oe,this.elems=ze,this.max_length=We,this.has_stree=Me&&Me.length}function Y(Me,Le){this.dyn_tree=Me,this.max_code=0,this.stat_desc=Le}function W(Me){return Me<256?ye[Me]:ye[256+(Me>>>7)]}function Q(Me,Le){Me.pending_buf[Me.pending++]=255&Le,Me.pending_buf[Me.pending++]=Le>>>8&255}function oe(Me,Le,Oe){Me.bi_valid>P-Oe?(Me.bi_buf|=Le<<Me.bi_valid&65535,Q(Me,Me.bi_buf),Me.bi_buf=Le>>P-Me.bi_valid,Me.bi_valid+=Oe-P):(Me.bi_buf|=Le<<Me.bi_valid&65535,Me.bi_valid+=Oe)}function Ce(Me,Le,Oe){oe(Me,Oe[2*Le],Oe[2*Le+1])}function Se(Me,Le){for(var Oe=0;Oe|=1&Me,Me>>>=1,Oe<<=1,0<--Le;);return Oe>>>1}function fe(Me,Le,Oe){var ze,We,Ge=new Array(k+1),Xe=0;for(ze=1;ze<=k;ze++)Ge[ze]=Xe=Xe+Oe[ze-1]<<1;for(We=0;We<=Le;We++){var qe=Me[2*We+1];qe!==0&&(Me[2*We]=Se(Ge[qe]++,qe))}}function Pe(Me){var Le;for(Le=0;Le<d;Le++)Me.dyn_ltree[2*Le]=0;for(Le=0;Le<u;Le++)Me.dyn_dtree[2*Le]=0;for(Le=0;Le<y;Le++)Me.bl_tree[2*Le]=0;Me.dyn_ltree[2*E]=1,Me.opt_len=Me.static_len=0,Me.last_lit=Me.matches=0}function Ae(Me){8<Me.bi_valid?Q(Me,Me.bi_buf):0<Me.bi_valid&&(Me.pending_buf[Me.pending++]=Me.bi_buf),Me.bi_buf=0,Me.bi_valid=0}function Te(Me,Le,Oe,ze){var We=2*Le,Ge=2*Oe;return Me[We]<Me[Ge]||Me[We]===Me[Ge]&&ze[Le]<=ze[Oe]}function Ee(Me,Le,Oe){for(var ze=Me.heap[Oe],We=Oe<<1;We<=Me.heap_len&&(We<Me.heap_len&&Te(Le,Me.heap[We+1],Me.heap[We],Me.depth)&&We++,!Te(Le,ze,Me.heap[We],Me.depth));)Me.heap[Oe]=Me.heap[We],Oe=We,We<<=1;Me.heap[Oe]=ze}function Be(Me,Le,Oe){var ze,We,Ge,Xe,qe=0;if(Me.last_lit!==0)for(;ze=Me.pending_buf[Me.d_buf+2*qe]<<8|Me.pending_buf[Me.d_buf+2*qe+1],We=Me.pending_buf[Me.l_buf+qe],qe++,ze===0?Ce(Me,We,Le):(Ce(Me,(Ge=J[We])+v+1,Le),(Xe=N[Ge])!==0&&oe(Me,We-=te[Ge],Xe),Ce(Me,Ge=W(--ze),Oe),(Xe=F[Ge])!==0&&oe(Me,ze-=H[Ge],Xe)),qe<Me.last_lit;);Ce(Me,E,Le)}function Ve(Me,Le){var Oe,ze,We,Ge=Le.dyn_tree,Xe=Le.stat_desc.static_tree,qe=Le.stat_desc.has_stree,Ke=Le.stat_desc.elems,Qe=-1;for(Me.heap_len=0,Me.heap_max=x,Oe=0;Oe<Ke;Oe++)Ge[2*Oe]!==0?(Me.heap[++Me.heap_len]=Qe=Oe,Me.depth[Oe]=0):Ge[2*Oe+1]=0;for(;Me.heap_len<2;)Ge[2*(We=Me.heap[++Me.heap_len]=Qe<2?++Qe:0)]=1,Me.depth[We]=0,Me.opt_len--,qe&&(Me.static_len-=Xe[2*We+1]);for(Le.max_code=Qe,Oe=Me.heap_len>>1;1<=Oe;Oe--)Ee(Me,Ge,Oe);for(We=Ke;Oe=Me.heap[1],Me.heap[1]=Me.heap[Me.heap_len--],Ee(Me,Ge,1),ze=Me.heap[1],Me.heap[--Me.heap_max]=Oe,Me.heap[--Me.heap_max]=ze,Ge[2*We]=Ge[2*Oe]+Ge[2*ze],Me.depth[We]=(Me.depth[Oe]>=Me.depth[ze]?Me.depth[Oe]:Me.depth[ze])+1,Ge[2*Oe+1]=Ge[2*ze+1]=We,Me.heap[1]=We++,Ee(Me,Ge,1),2<=Me.heap_len;);Me.heap[--Me.heap_max]=Me.heap[1],function(at,ut){var vt,_t,wt,bt,Rt,Fe,$e=ut.dyn_tree,Ie=ut.max_code,Re=ut.stat_desc.static_tree,He=ut.stat_desc.has_stree,je=ut.stat_desc.extra_bits,et=ut.stat_desc.extra_base,tt=ut.stat_desc.max_length,Ye=0;for(bt=0;bt<=k;bt++)at.bl_count[bt]=0;for($e[2*at.heap[at.heap_max]+1]=0,vt=at.heap_max+1;vt<x;vt++)tt<(bt=$e[2*$e[2*(_t=at.heap[vt])+1]+1]+1)&&(bt=tt,Ye++),$e[2*_t+1]=bt,Ie<_t||(at.bl_count[bt]++,Rt=0,et<=_t&&(Rt=je[_t-et]),Fe=$e[2*_t],at.opt_len+=Fe*(bt+Rt),He&&(at.static_len+=Fe*(Re[2*_t+1]+Rt)));if(Ye!==0){do{for(bt=tt-1;at.bl_count[bt]===0;)bt--;at.bl_count[bt]--,at.bl_count[bt+1]+=2,at.bl_count[tt]--,Ye-=2}while(0<Ye);for(bt=tt;bt!==0;bt--)for(_t=at.bl_count[bt];_t!==0;)Ie<(wt=at.heap[--vt])||($e[2*wt+1]!==bt&&(at.opt_len+=(bt-$e[2*wt+1])*$e[2*wt],$e[2*wt+1]=bt),_t--)}}(Me,Le),fe(Ge,Qe,Me.bl_count)}function _e(Me,Le,Oe){var ze,We,Ge=-1,Xe=Le[1],qe=0,Ke=7,Qe=4;for(Xe===0&&(Ke=138,Qe=3),Le[2*(Oe+1)+1]=65535,ze=0;ze<=Oe;ze++)We=Xe,Xe=Le[2*(ze+1)+1],++qe<Ke&&We===Xe||(qe<Qe?Me.bl_tree[2*We]+=qe:We!==0?(We!==Ge&&Me.bl_tree[2*We]++,Me.bl_tree[2*M]++):qe<=10?Me.bl_tree[2*T]++:Me.bl_tree[2*D]++,Ge=We,Qe=(qe=0)===Xe?(Ke=138,3):We===Xe?(Ke=6,3):(Ke=7,4))}function ve(Me,Le,Oe){var ze,We,Ge=-1,Xe=Le[1],qe=0,Ke=7,Qe=4;for(Xe===0&&(Ke=138,Qe=3),ze=0;ze<=Oe;ze++)if(We=Xe,Xe=Le[2*(ze+1)+1],!(++qe<Ke&&We===Xe)){if(qe<Qe)for(;Ce(Me,We,Me.bl_tree),--qe!=0;);else We!==0?(We!==Ge&&(Ce(Me,We,Me.bl_tree),qe--),Ce(Me,M,Me.bl_tree),oe(Me,qe-3,2)):qe<=10?(Ce(Me,T,Me.bl_tree),oe(Me,qe-3,3)):(Ce(Me,D,Me.bl_tree),oe(Me,qe-11,7));Ge=We,Qe=(qe=0)===Xe?(Ke=138,3):We===Xe?(Ke=6,3):(Ke=7,4)}}m(H);var be=!1;function ke(Me,Le,Oe,ze){oe(Me,(w<<1)+(ze?1:0),3),function(We,Ge,Xe,qe){Ae(We),qe&&(Q(We,Xe),Q(We,~Xe)),r.arraySet(We.pending_buf,We.window,Ge,Xe,We.pending),We.pending+=Xe}(Me,Le,Oe,!0)}o._tr_init=function(Me){be||(function(){var Le,Oe,ze,We,Ge,Xe=new Array(k+1);for(We=ze=0;We<g-1;We++)for(te[We]=ze,Le=0;Le<1<<N[We];Le++)J[ze++]=We;for(J[ze-1]=We,We=Ge=0;We<16;We++)for(H[We]=Ge,Le=0;Le<1<<F[We];Le++)ye[Ge++]=We;for(Ge>>=7;We<u;We++)for(H[We]=Ge<<7,Le=0;Le<1<<F[We]-7;Le++)ye[256+Ge++]=We;for(Oe=0;Oe<=k;Oe++)Xe[Oe]=0;for(Le=0;Le<=143;)X[2*Le+1]=8,Le++,Xe[8]++;for(;Le<=255;)X[2*Le+1]=9,Le++,Xe[9]++;for(;Le<=279;)X[2*Le+1]=7,Le++,Xe[7]++;for(;Le<=287;)X[2*Le+1]=8,Le++,Xe[8]++;for(fe(X,d+1,Xe),Le=0;Le<u;Le++)ne[2*Le+1]=5,ne[2*Le]=Se(Le,5);q=new Z(X,N,v+1,d,k),re=new Z(ne,F,0,u,k),U=new Z(new Array(0),O,0,y,S)}(),be=!0),Me.l_desc=new Y(Me.dyn_ltree,q),Me.d_desc=new Y(Me.dyn_dtree,re),Me.bl_desc=new Y(Me.bl_tree,U),Me.bi_buf=0,Me.bi_valid=0,Pe(Me)},o._tr_stored_block=ke,o._tr_flush_block=function(Me,Le,Oe,ze){var We,Ge,Xe=0;0<Me.level?(Me.strm.data_type===2&&(Me.strm.data_type=function(qe){var Ke,Qe=4093624447;for(Ke=0;Ke<=31;Ke++,Qe>>>=1)if(1&Qe&&qe.dyn_ltree[2*Ke]!==0)return f;if(qe.dyn_ltree[18]!==0||qe.dyn_ltree[20]!==0||qe.dyn_ltree[26]!==0)return s;for(Ke=32;Ke<v;Ke++)if(qe.dyn_ltree[2*Ke]!==0)return s;return f}(Me)),Ve(Me,Me.l_desc),Ve(Me,Me.d_desc),Xe=function(qe){var Ke;for(_e(qe,qe.dyn_ltree,qe.l_desc.max_code),_e(qe,qe.dyn_dtree,qe.d_desc.max_code),Ve(qe,qe.bl_desc),Ke=y-1;3<=Ke&&qe.bl_tree[2*I[Ke]+1]===0;Ke--);return qe.opt_len+=3*(Ke+1)+5+5+4,Ke}(Me),We=Me.opt_len+3+7>>>3,(Ge=Me.static_len+3+7>>>3)<=We&&(We=Ge)):We=Ge=Oe+5,Oe+4<=We&&Le!==-1?ke(Me,Le,Oe,ze):Me.strategy===4||Ge===We?(oe(Me,2+(ze?1:0),3),Be(Me,X,ne)):(oe(Me,4+(ze?1:0),3),function(qe,Ke,Qe,at){var ut;for(oe(qe,Ke-257,5),oe(qe,Qe-1,5),oe(qe,at-4,4),ut=0;ut<at;ut++)oe(qe,qe.bl_tree[2*I[ut]+1],3);ve(qe,qe.dyn_ltree,Ke-1),ve(qe,qe.dyn_dtree,Qe-1)}(Me,Me.l_desc.max_code+1,Me.d_desc.max_code+1,Xe+1),Be(Me,Me.dyn_ltree,Me.dyn_dtree)),Pe(Me),ze&&Ae(Me)},o._tr_tally=function(Me,Le,Oe){return Me.pending_buf[Me.d_buf+2*Me.last_lit]=Le>>>8&255,Me.pending_buf[Me.d_buf+2*Me.last_lit+1]=255&Le,Me.pending_buf[Me.l_buf+Me.last_lit]=255&Oe,Me.last_lit++,Le===0?Me.dyn_ltree[2*Oe]++:(Me.matches++,Le--,Me.dyn_ltree[2*(J[Oe]+v+1)]++,Me.dyn_dtree[2*W(Le)]++),Me.last_lit===Me.lit_bufsize-1},o._tr_align=function(Me){oe(Me,2,3),Ce(Me,E,X),function(Le){Le.bi_valid===16?(Q(Le,Le.bi_buf),Le.bi_buf=0,Le.bi_valid=0):8<=Le.bi_valid&&(Le.pending_buf[Le.pending++]=255&Le.bi_buf,Le.bi_buf>>=8,Le.bi_valid-=8)}(Me)}},{"../utils/common":41}],53:[function(e,n,o){n.exports=function(){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}},{}],54:[function(e,n,o){(function(r){(function(f,s){if(!f.setImmediate){var m,w,g,v,d=1,u={},y=!1,x=f.document,k=Object.getPrototypeOf&&Object.getPrototypeOf(f);k=k&&k.setTimeout?k:f,m={}.toString.call(f.process)==="[object process]"?function(M){process.nextTick(function(){S(M)})}:function(){if(f.postMessage&&!f.importScripts){var M=!0,T=f.onmessage;return f.onmessage=function(){M=!1},f.postMessage("","*"),f.onmessage=T,M}}()?(v="setImmediate$"+Math.random()+"$",f.addEventListener?f.addEventListener("message",E,!1):f.attachEvent("onmessage",E),function(M){f.postMessage(v+M,"*")}):f.MessageChannel?((g=new MessageChannel).port1.onmessage=function(M){S(M.data)},function(M){g.port2.postMessage(M)}):x&&"onreadystatechange"in x.createElement("script")?(w=x.documentElement,function(M){var T=x.createElement("script");T.onreadystatechange=function(){S(M),T.onreadystatechange=null,w.removeChild(T),T=null},w.appendChild(T)}):function(M){setTimeout(S,0,M)},k.setImmediate=function(M){typeof M!="function"&&(M=new Function(""+M));for(var T=new Array(arguments.length-1),D=0;D<T.length;D++)T[D]=arguments[D+1];var N={callback:M,args:T};return u[d]=N,m(d),d++},k.clearImmediate=P}function P(M){delete u[M]}function S(M){if(y)setTimeout(S,0,M);else{var T=u[M];if(T){y=!0;try{(function(D){var N=D.callback,F=D.args;switch(F.length){case 0:N();break;case 1:N(F[0]);break;case 2:N(F[0],F[1]);break;case 3:N(F[0],F[1],F[2]);break;default:N.apply(s,F)}})(T)}finally{P(M),y=!1}}}}function E(M){M.source===f&&typeof M.data=="string"&&M.data.indexOf(v)===0&&S(+M.data.slice(v.length))}})(typeof self>"u"?r===void 0?this:r:self)}).call(this,commonjsGlobal$1!==void 0?commonjsGlobal$1:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10);var JSZip=jszip_minExports,Outline=function(){return _createClass(function e(n){_classCallCheck(this,e),this.doc=n.doc,this.messageHandler=n.messageHandler,this.outline=n.outline,this.index=n.index,this.children=n.children||[],this.parent=n.parent},[{key:"pageNumber",get:function(){return this.outline.pageNumber}},{key:"title",get:function(){return this.outline.title}},{key:"level",get:function(){return this.outline.level}},{key:"getOutline",value:function(){return this.outline}}])}(),ContentEditManager=function(){return _createClass(function s(m){_classCallCheck(this,s),this.documentViewer=m,this.editAreaInfoPtr=null,this.selectedEditBox=null},[{key:"startContentEditMode",value:(f=_asyncToGenerator(_regeneratorRuntime().mark(function s(){return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:this.documentViewer.setToolMode("editor");case 1:case"end":return m.stop()}},s,this)})),function(){return f.apply(this,arguments)})},{key:"endContentEditMode",value:(r=_asyncToGenerator(_regeneratorRuntime().mark(function s(){return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:this.documentViewer.setToolMode("view");case 1:case"end":return m.stop()}},s,this)})),function(){return r.apply(this,arguments)})},{key:"getSelectedEditBox",value:function(){return this.selectedEditBox}},{key:"setSelectedEditBox",value:function(s){this.selectedEditBox=s}},{key:"getCopyArea",value:function(){return this.editAreaInfo}},{key:"setCopyArea",value:function(s){this.editAreaInfo=s}},{key:"pasteAreaInPage",value:(o=_asyncToGenerator(_regeneratorRuntime().mark(function s(m,w){var g,v,d,u,y,x,k,P;return _regeneratorRuntime().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(w){S.next=5;break}if(g=this.getCopyArea()){S.next=4;break}return S.abrupt("return");case 4:w={rect:g.rect,editAreaInfoPtr:g.editAreaInfoPtr};case 5:if(v=this.documentViewer,d=m-1,u=v.pdfViewer._pages[d],y=u.contentContainer,x=y&&y.editPagePtr){S.next=15;break}return S.next=13,u.getEditAnnotation();case 13:y=S.sent,x=y.editPagePtr;case 15:return S.next=17,v.messageHandler.sendWithPromise("PasteArea",{pagePtr:v.pagesPtr[d].pagePtr,editPagePtr:x,pageIndex:d,editAreaInfoPtr:w.editAreaInfoPtr,rect:w.rect});case 17:return k=S.sent,S.next=20,y.addEditArea(k);case 20:P=S.sent,y.handleOperateList({editPagePtr:x,editAreaIndex:P.editAreaIndex,editAreaPtr:k,pageIndex:d});case 22:case"end":return S.stop()}},s,this)})),function(s,m){return o.apply(this,arguments)})},{key:"getSelectedText",value:function(s){var m=this.documentViewer;if(s&&(s<1||s>m.pagesCount))return"";var w=m.pdfViewer._pages,g="";if(s)g+=this.getPageSelectedText(s);else for(var v=0;v<w.length;v++)w[v].contentContainer&&(g+=this.getPageSelectedText(v+1));return g}},{key:"getPageSelectedText",value:function(s){if(!s)return"";var m=s-1,w=this.documentViewer.pdfViewer._pages[m].contentContainer;if(!w)return"";for(var g=w.frameEditorList,v="",d=0;d<g.length;d++){var u=g[d];u.type==="text"&&u.selectedCharRange&&(v+=u.selectedText)}return v}},{key:"selectedEditBoxText",value:(n=_asyncToGenerator(_regeneratorRuntime().mark(function s(){var m;return _regeneratorRuntime().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if((m=this.getSelectedEditBox())&&m.type==="text"){w.next=3;break}return w.abrupt("return");case 3:if(w.t0=m.selectedAllText,!w.t0){w.next=7;break}return w.next=7,m.selectedAllText();case 7:case"end":return w.stop()}},s,this)})),function(){return n.apply(this,arguments)})},{key:"getEditBoxSelectedText",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function s(){var m,w;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(m=this.getSelectedEditBox()){g.next=3;break}return g.abrupt("return");case 3:if(m.selectedCharRange){g.next=5;break}return g.abrupt("return","");case 5:return g.next=7,m.getText();case 7:return w=g.sent,g.abrupt("return",w);case 9:case"end":return g.stop()}},s,this)})),function(){return e.apply(this,arguments)})}]);var e,n,o,r,f}();function convertFileToBuffer(e){return new Promise(function(n,o){var r=new FileReader;r.onload=function(){var f=new Uint8Array(r.result);n(f)},r.onerror=function(){o(r.error)},r.readAsArrayBuffer(e)})}var AnnotationManager=function(){return _createClass(function e(n){_classCallCheck(this,e),this.selectedAnnotations=[],this.documentViewer=n,this.annotations=[],this.annotationsType={custom:Shape,highlight:TextHighlightAnnotation,squiggly:TextSquigglyAnnotation,strikeout:TextStrikeoutAnnotation,underline:TextUnderlineAnnotation,line:Line,circle:Circle,square:Shape$1,rectangle:Rectangle,freetext:Freetext$1,stamp:Stamp,text:Text$1,ink:Ink,arc:Arc,polyline:Polyline,polygon:Polygon,redact:Redaction,link:Link,curv:Curve,textfield:TextField,checkbox:CheckBox$1,radiobutton:RadioButton,pushbutton:PushButton,listbox:ListBox,combobox:ComboBox,signatureFields:SignatureFields}},[{key:"getAnnotationsList",value:function(){return this.annotations}},{key:"createAnnotationReply",value:function(e,n){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function o(){var r,f,s;return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return n.author=n.author||this.documentViewer.annotator,n.rect=e.annotation.rect,n.pageIndex=e.pageIndex,!n.name&&(n.name=v4()),m.next=6,this.documentViewer.messageHandler.sendWithPromise("CreateReplyAnnotation",{pagePtr:e.pagePtr,annotPtr:e.annotPtr,replyAnnotation:n});case 6:r=m.sent,n.pagePtr=e.pagePtr,n.annotPtr=r,n.inReplyTo=e.name,n.stateModel||(f=n.state==="MARKED"||n.state==="UNMARKED"?"Marked":"Review",n.stateModel=f),s=new this.annotationsType.text({annotation:n,documentViewer:this.documentViewer}),e.addReply(s);case 13:case"end":return m.stop()}},o,this)}))}},{key:"addAnnotation",value:function(e){this.addAnnotations([e])}},{key:"addAnnotations",value:function(e){if(e){for(var n=[],o=0;o<e.length;o++){var r=e[o];r.pageIndex<0||(this.annotations.push(r),n.push(r))}n.length&&this.documentViewer.eventBus.dispatch("annotationChanged",n,"add")}}},{key:"hasAnnotation",value:function(e){return this.annotations.indexOf(e)>-1}},{key:"isAnnotationSelected",value:function(e){}},{key:"deleteAnnotation",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){return _regeneratorRuntime().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.deleteAnnotations(Array.isArray(e)?e:[e]);case 2:case"end":return o.stop()}},n,this)}))}},{key:"deleteAnnotations",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v,d,u=this;return _regeneratorRuntime().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:o=[],r=[],f=0;case 3:if(!(f<e.length)){y.next=40;break}if(s=e[f],m=this.hasAnnotation(s),w=null,!m){y.next=26;break}if(this.documentViewer.annotationStore.selectedElementName&&s.name===this.documentViewer.annotationStore.selectedElementName&&(r.push(s),this.deselectAnnotation(s)),g=this.annotations.splice(this.annotations.indexOf(s),1),o.push(g[0]),s.isDelete||s.handleDelete(),!(v=s.getReplies())){y.next=21;break}return y.next=17,this.documentViewer.messageHandler.sendWithPromise("RemoveFromPageIncludeReplyAnnot",{pagePtr:s.pagePtr,annotPtr:s.annotPtr});case 17:w=y.sent,v.forEach(function(x){u.annotations.splice(u.annotations.indexOf(x),1)}),y.next=24;break;case 21:return y.next=23,this.documentViewer.messageHandler.sendWithPromise("RemoveAnnot",{annotPtr:s.annotPtr});case 23:w=y.sent;case 24:y.next=33;break;case 26:if(!s.isReply()){y.next=33;break}return d=this.getRootAnnotation(s),this.documentViewer.eventBus.dispatch("deleteReply",s),d.deleteReplyAnnotation(s),y.next=32,this.documentViewer.messageHandler.sendWithPromise("RemoveAnnot",{annotPtr:s.annotPtr});case 32:w=y.sent;case 33:if(!w||!w.code){y.next=37;break}return this.documentViewer.eventBus.dispatch("message",{type:"ERROR",message:w.message}),console.log(w.message),y.abrupt("return");case 37:f++,y.next=3;break;case 40:0<o.length&&this.documentViewer.eventBus.dispatch("annotationChanged",o,"delete"),0<r.length&&this.documentViewer.eventBus.dispatch("annotationSelected",r,"deselected");case 42:case"end":return y.stop()}},n,this)}))}},{key:"getRootAnnotation",value:function(e){return e.isReply()?this.getAnnotationById(e.inReplyTo):e}},{key:"getAnnotationById",value:function(e,n){if(n=n||this.annotations,!e)return null;for(var o=0;o<n.length;o++)if(n[o].name===e)return n[o];return null}},{key:"selectAnnotation",value:function(e){if(e){var n=this.documentViewer.annotationStore.selectedElementName;if(n){var o=this.getAnnotationById(n);o.handleOutside&&o.handleOutside()}this.hasAnnotation(e)&&e.selectAnnotation()}}},{key:"deselectAnnotation",value:function(e){if(e){var n=this.documentViewer.annotationStore.selectedElementName;if(n&&e.name===n){var o=this.getAnnotationById(e.name);o.handleOutside&&o.handleOutside()}}}},{key:"getSelectedAnnotation",value:function(){var e=this.documentViewer.annotationStore.selectedElementName;return e?this.getAnnotationById(e):null}},{key:"setAnnotationStyles",value:function(e,n){Object.keys(n).forEach(function(o){e[o]=n[o]})}},{key:"getCurrentUser",value:function(){return this.author}},{key:"setCurrentUser",value:function(e){this.author}},{key:"createAnnotation",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f;return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.documentViewer.annotationHistory.push(e),!(Number(e.pageIndex)+1>this.documentViewer.pagesCount)){s.next=3;break}return s.abrupt("return");case 3:return!e.author&&(e.author=this.documentViewer.annotator),!e.date&&(e.date=new Date),!e.name&&(e.name=v4()),o=this.documentViewer.pagesPtr[e.pageIndex].pagePtr,s.next=9,this.documentViewer.messageHandler.sendWithPromise("CreateAnnotation",{doc:this.documentViewer.doc,pagePtr:o,annotation:e});case 9:if(!(r=s.sent)||!r.code){s.next=14;break}return this.documentViewer.eventBus.dispatch("message",{type:"ERROR",message:r.message}),console.log(r.message),s.abrupt("return",r);case 14:return f=r.annotPtr,e.doc=this.documentViewer.doc,e.pagePtr=o,e.annotPtr=f,s.abrupt("return",e);case 19:case"end":return s.stop()}},n,this)}))}},{key:"createMeasurementAnnotation",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s;return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(this.documentViewer.annotationHistory.push(e),!(Number(e.pageIndex)+1>this.documentViewer.pagesCount)){m.next=3;break}return m.abrupt("return");case 3:return!e.operate&&(e.operate="add-annot"),!e.author&&(e.author=this.documentViewer.annotator),!e.date&&(e.date=new Date),o=this.documentViewer.pagesPtr[e.pageIndex].pagePtr,m.next=9,this.documentViewer.messageHandler.sendWithPromise("CreateMeasurementAnnotation",{doc:this.documentViewer.doc,pagePtr:o,annotation:e});case 9:if(!(r=m.sent)||!r.code){m.next=14;break}return this.documentViewer.eventBus.dispatch("message",{type:"ERROR",message:r.message}),console.log(r.message),m.abrupt("return",r);case 14:return f=r.annotPtr,s=r.rulerPtr,e.doc=this.documentViewer.doc,e.pagePtr=o,e.annotPtr=f,e.rulerPtr=s,m.abrupt("return",e);case 20:case"end":return m.stop()}},n,this)}))}},{key:"editMeasurementAnnotation",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){return _regeneratorRuntime().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(e){o.next=2;break}return o.abrupt("return");case 2:return o.next=4,this.documentViewer.messageHandler.sendWithPromise("EditMeasurementAnnotation",{doc:this.documentViewer.doc,annotation:e});case 4:this.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:this.documentViewer.annotations});case 5:case"end":return o.stop()}},n,this)}))}},{key:"drawAnnotations",value:function(e){var n=e.pageNumber;this.getAnnotationsList().filter(function(o){return o.PageNumber===n}).forEach(function(o){o.draw()})}},{key:"drawAnnotationsFromList",value:function(e){Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++)e[n].draw()}},{key:"pushAnnotationToLayer",value:function(e){var n,o;if(this.addAnnotation(e),this.documentViewer.pdfViewer){var r=(o=(n=this.documentViewer.pdfViewer)===null||n===void 0?void 0:n._pages)===null||o===void 0?void 0:o[e.annotation.pageIndex];r&&r.compdfAnnotationLayer&&r.compdfAnnotationLayer.annotationsArray.push(e)}}},{key:"reset",value:function(){this.annotations=[],this.selectedAnnotations=[]}}])}();pdfExports.GlobalWorkerOptions.workerSrc="./lib/pdf.worker.min.js";var CMAP_URL="./cmaps/";function onKeyDown(e){if(this._isCtrlKeyDown=e.key==="Control",e.target.tagName!=="INPUT"&&e.target.tagName!=="TEXTAREA"){var n=e.keyCode||e.which;if(n===8||n===46){var o=annotationStore.selectedElementName;o&&this.deleteAnnotations({name:o})}else if(n===27){var r=annotationStore.selectedElementName;r&&this.deselectAnnotation({name:r})}}}function onKeyUp(e){e.key==="Control"&&(this._isCtrlKeyDown=!1)}function onWheel(e){if(this._isCtrlKeyDown){var n={x:e.clientX,y:e.clientY};if(e.preventDefault(),document.visibilityState!=="hidden"){var o=normalizeWheelEventDirection(e),r=e.deltaMode,f=0;r===WheelEvent.DOM_DELTA_LINE||r===WheelEvent.DOM_DELTA_PAGE?f=Math.abs(o)>=1?Math.sign(o):this._accumulateTicks(o):f=this._accumulateTicks(o/30),this.updateZoom(f,null,n)}}}var ComPDFKitViewer=function(){return _createClass(function Fe($e){_classCallCheck(this,Fe),_defineProperty$1(this,"_pwd",""),_defineProperty$1(this,"_oldPwd",""),_defineProperty$1(this,"_textSearch",null),_defineProperty$1(this,"_activeSearchIndex",0),_defineProperty$1(this,"_fileList",null),_defineProperty$1(this,"_version","2.7.5"),_defineProperty$1(this,"_wheelUnusedTicks",0),this.config=$e,this.annotationStore=annotationStore,this.viewerContainer=null,this.pdfLoadingTask=null,this.printService=null,this.pdfSidebar=null,this.pdfOutlineViewer=null,this.outlines=[],this.pdfLayerViewer=null,this.pdfDocument=null,this.downloadComplete=!1,this.isInitialViewSet=!1,this.pdfLinkService=null,this.externalServices=GenericExternalServices,this.percent=0,this.pageChangedCallback=null,this.scaleChangedCallback=null,this.annotationsNumChangedCallback=null,this.distanceChangedCallback=null,this.permissionPasswordCallback=null,this.verified=!1,this.isFillConsecutively=!1,this._license="",this._token=null,this._pdfId=null,this.annotations=null,this.annotationHistory=[],this._annotationMode=0,this._boundEvents=Object.create(null),this._title=document.title,this.activeTool="",this.color="color",this.pagesPtr=[],this.saveAction=null,this.enableReply=!0,this.isAnnotationPopup=!0,this.enableDefaultFont=!1,this.annotationPermission=!1,this.enableCustomFont=!1,this.fontsJson=null,this._permission={allowsPrinting:!0,allowsCopying:!0,allowsDocumentChanges:!0},this.webFontURL="https://www.compdf.com/fonts/",this.optionUrl={baseUrl:"https://wms.compdf.com",verifyUrl:"/api/license/verify/v2",webviewBaseUrl:"https://web-viewer-backend.compdf.com",uploadUrl:"/web-viewer/annotate/openPdfToAnnotate",editUrl:"/web-viewer/annotate/edit",saveUrl:"/web-viewer/annotate/save",flattenUrl:"/web-viewer/annotate/saveAndFlatten",uploadAnnotationsUrl:"/web-viewer/annotate/importAnnotateToPdf",downloadAnnotation:"/web-viewer/annotate/exportAnnotate",compareUrl:"/web-viewer/annotate/pdfCompare"},this.eventBus=new EventBus,this.toolMode="",this.$t=$e.$t,this.fontFileInited=!1,this.contentEditAnnotationsManager={},this.initWorker(),this.annotator="Guest",this.isAnnotationModified=!1,this.isContentEditModyfied=!1,this.redactionList=[],this.layers=[],this.ocgsPtr=null,this.isRenderAnnotations=!1,this.colorList=[],this.renderLayerPermission=!1,this.queue=[],this.isProcessing=!1},[{key:"enqueue",value:function(Fe){var $e=this;return new Promise(function(Ie,Re){var He=function(){var je=_asyncToGenerator(_regeneratorRuntime().mark(function et(){var tt;return _regeneratorRuntime().wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return Ye.prev=0,Ye.next=3,Fe();case 3:tt=Ye.sent,Ie(tt),Ye.next=10;break;case 7:Ye.prev=7,Ye.t0=Ye.catch(0),Re(Ye.t0);case 10:case"end":return Ye.stop()}},et,null,[[0,7]])}));return function(){return je.apply(this,arguments)}}();$e.queue.push(He),$e.processQueue()})}},{key:"_accumulateTicks",value:function(Fe){(this._wheelUnusedTicks>0&&Fe<0||this._wheelUnusedTicks<0&&Fe>0)&&(this._wheelUnusedTicks=0),this._wheelUnusedTicks+=Fe;var $e=Math.trunc(this._wheelUnusedTicks);return this._wheelUnusedTicks-=$e,$e}},{key:"processQueue",value:(Rt=_asyncToGenerator(_regeneratorRuntime().mark(function Fe(){var $e;return _regeneratorRuntime().wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:if(!this.isProcessing&&this.queue.length!==0){Ie.next=2;break}return Ie.abrupt("return");case 2:return this.isProcessing=!0,$e=this.queue.shift(),Ie.prev=4,Ie.next=7,$e();case 7:return Ie.prev=7,this.isProcessing=!1,this.processQueue(),Ie.finish(7);case 11:case"end":return Ie.stop()}},Fe,this,[[4,,7,11]])})),function(){return Rt.apply(this,arguments)})},{key:"pagesCount",get:function(){return this.doc?this._pagesCount:0}},{key:"annotationsCount",get:function(){return this.pdfViewer.annotationStorage?this.pdfViewer.annotationStorage.size:0}},{key:"page",get:function(){return this.pdfViewer.currentPageNumber},set:function(Fe){this.pdfViewer.currentPageNumber=Fe}},{key:"currentPageNumber",get:function(){return this.pdfViewer.currentPageNumber}},{key:"scale",get:function(){return this.pdfViewer.currentScale}},{key:"isDocumentModified",get:function(){return this.isAnnotationModified||this.isContentEditModyfied}},{key:"pagesRotation",get:function(){return this.pdfViewer.pagesRotation}},{key:"getPageWidth",value:function(Fe){return this.pagesPtr[Fe-1].width}},{key:"getPageHeight",value:function(Fe){return this.pagesPtr[Fe-1].height}},{key:"initWorker",value:function(){var Fe=new PDFWorker;this.worker=Fe;var $e=Fe.messageHandler;this.messageHandler=$e}},{key:"_decrypt",value:function(Fe){var $e=new JSEncrypt;$e.setPrivateKey(`MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCb9LJZzBAOR3YDT0/rLqY1pCu6
2194
+ \0`,oe+=r(Y,2),oe+=D.magic,oe+=r(E,2),oe+=r(M,2),oe+=r(Z.crc32,4),oe+=r(Z.compressedSize,4),oe+=r(Z.uncompressedSize,4),oe+=r(F.length,2),oe+=r(te.length,2),{fileRecord:v.LOCAL_FILE_HEADER+oe+F+te,dirRecord:v.CENTRAL_FILE_HEADER+r(Q,2)+oe+r(X.length,2)+"\0\0\0\0"+r(W,4)+r(k,4)+F+te+X}}var s=e("../utils"),m=e("../stream/GenericWorker"),w=e("../utf8"),g=e("../crc32"),v=e("../signature");function d(u,y,x,k){m.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=x,this.encodeFileName=k,this.streamFiles=u,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(d,m),d.prototype.push=function(u){var y=u.meta.percent||0,x=this.entriesCount,k=this._sources.length;this.accumulate?this.contentBuffer.push(u):(this.bytesWritten+=u.data.length,m.prototype.push.call(this,{data:u.data,meta:{currentFile:this.currentFile,percent:x?(y+100*(x-k-1))/x:100}}))},d.prototype.openedSource=function(u){this.currentSourceOffset=this.bytesWritten,this.currentFile=u.file.name;var y=this.streamFiles&&!u.file.dir;if(y){var x=f(u,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:x.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(u){this.accumulate=!1;var y=this.streamFiles&&!u.file.dir,x=f(u,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(x.dirRecord),y)this.push({data:function(k){return v.DATA_DESCRIPTOR+r(k.crc32,4)+r(k.compressedSize,4)+r(k.uncompressedSize,4)}(u),meta:{percent:100}});else for(this.push({data:x.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var u=this.bytesWritten,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var x=this.bytesWritten-u,k=function(P,S,E,M,T){var D=s.transformTo("string",T(M));return v.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(P,2)+r(P,2)+r(S,4)+r(E,4)+r(D.length,2)+D}(this.dirRecords.length,x,u,this.zipComment,this.encodeFileName);this.push({data:k,meta:{percent:100}})},d.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},d.prototype.registerPrevious=function(u){this._sources.push(u);var y=this;return u.on("data",function(x){y.processChunk(x)}),u.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),u.on("error",function(x){y.error(x)}),this},d.prototype.resume=function(){return!!m.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},d.prototype.error=function(u){var y=this._sources;if(!m.prototype.error.call(this,u))return!1;for(var x=0;x<y.length;x++)try{y[x].error(u)}catch{}return!0},d.prototype.lock=function(){m.prototype.lock.call(this);for(var u=this._sources,y=0;y<u.length;y++)u[y].lock()},n.exports=d},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,n,o){var r=e("../compressions"),f=e("./ZipFileWorker");o.generateWorker=function(s,m,w){var g=new f(m.streamFiles,w,m.platform,m.encodeFileName),v=0;try{s.forEach(function(d,u){v++;var y=function(S,E){var M=S||E,T=r[M];if(!T)throw new Error(M+" is not a valid compression method !");return T}(u.options.compression,m.compression),x=u.options.compressionOptions||m.compressionOptions||{},k=u.dir,P=u.date;u._compressWorker(y,x).withStreamInfo("file",{name:d,dir:k,date:P,comment:u.comment||"",unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions}).pipe(g)}),g.entriesCount=v}catch(d){g.error(d)}return g}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,n,o){function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var f=new r;for(var s in this)typeof this[s]!="function"&&(f[s]=this[s]);return f}}(r.prototype=e("./object")).loadAsync=e("./load"),r.support=e("./support"),r.defaults=e("./defaults"),r.version="3.10.1",r.loadAsync=function(f,s){return new r().loadAsync(f,s)},r.external=e("./external"),n.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,n,o){var r=e("./utils"),f=e("./external"),s=e("./utf8"),m=e("./zipEntries"),w=e("./stream/Crc32Probe"),g=e("./nodejsUtils");function v(d){return new f.Promise(function(u,y){var x=d.decompressed.getContentWorker().pipe(new w);x.on("error",function(k){y(k)}).on("end",function(){x.streamInfo.crc32!==d.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):u()}).resume()})}n.exports=function(d,u){var y=this;return u=r.extend(u||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),g.isNode&&g.isStream(d)?f.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip file",d,!0,u.optimizedBinaryString,u.base64).then(function(x){var k=new m(u);return k.load(x),k}).then(function(x){var k=[f.Promise.resolve(x)],P=x.files;if(u.checkCRC32)for(var S=0;S<P.length;S++)k.push(v(P[S]));return f.Promise.all(k)}).then(function(x){for(var k=x.shift(),P=k.files,S=0;S<P.length;S++){var E=P[S],M=E.fileNameStr,T=r.resolve(E.fileNameStr);y.file(T,E.decompressed,{binary:!0,optimizedBinaryString:!0,date:E.date,dir:E.dir,comment:E.fileCommentStr.length?E.fileCommentStr:null,unixPermissions:E.unixPermissions,dosPermissions:E.dosPermissions,createFolders:u.createFolders}),E.dir||(y.file(T).unsafeOriginalName=M)}return k.zipComment.length&&(y.comment=k.zipComment),y})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,n,o){var r=e("../utils"),f=e("../stream/GenericWorker");function s(m,w){f.call(this,"Nodejs stream input adapter for "+m),this._upstreamEnded=!1,this._bindStream(w)}r.inherits(s,f),s.prototype._bindStream=function(m){var w=this;(this._stream=m).pause(),m.on("data",function(g){w.push({data:g,meta:{percent:0}})}).on("error",function(g){w.isPaused?this.generatedError=g:w.error(g)}).on("end",function(){w.isPaused?w._upstreamEnded=!0:w.end()})},s.prototype.pause=function(){return!!f.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,n,o){var r=e("readable-stream").Readable;function f(s,m,w){r.call(this,m),this._helper=s;var g=this;s.on("data",function(v,d){g.push(v)||g._helper.pause(),w&&w(d)}).on("error",function(v){g.emit("error",v)}).on("end",function(){g.push(null)})}e("../utils").inherits(f,r),f.prototype._read=function(){this._helper.resume()},n.exports=f},{"../utils":32,"readable-stream":16}],14:[function(e,n,o){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(r,f){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(r,f);if(typeof r=="number")throw new Error('The "data" argument must not be a number');return new Buffer(r,f)},allocBuffer:function(r){if(Buffer.alloc)return Buffer.alloc(r);var f=new Buffer(r);return f.fill(0),f},isBuffer:function(r){return Buffer.isBuffer(r)},isStream:function(r){return r&&typeof r.on=="function"&&typeof r.pause=="function"&&typeof r.resume=="function"}}},{}],15:[function(e,n,o){function r(T,D,N){var F,O=s.getTypeOf(D),I=s.extend(N||{},g);I.date=I.date||new Date,I.compression!==null&&(I.compression=I.compression.toUpperCase()),typeof I.unixPermissions=="string"&&(I.unixPermissions=parseInt(I.unixPermissions,8)),I.unixPermissions&&16384&I.unixPermissions&&(I.dir=!0),I.dosPermissions&&16&I.dosPermissions&&(I.dir=!0),I.dir&&(T=P(T)),I.createFolders&&(F=k(T))&&S.call(this,F,!0);var X=O==="string"&&I.binary===!1&&I.base64===!1;N&&N.binary!==void 0||(I.binary=!X),(D instanceof v&&D.uncompressedSize===0||I.dir||!D||D.length===0)&&(I.base64=!1,I.binary=!0,D="",I.compression="STORE",O="string");var ne=null;ne=D instanceof v||D instanceof m?D:y.isNode&&y.isStream(D)?new x(T,D):s.prepareContent(T,D,I.binary,I.optimizedBinaryString,I.base64);var ye=new d(T,ne,I);this.files[T]=ye}var f=e("./utf8"),s=e("./utils"),m=e("./stream/GenericWorker"),w=e("./stream/StreamHelper"),g=e("./defaults"),v=e("./compressedObject"),d=e("./zipObject"),u=e("./generate"),y=e("./nodejsUtils"),x=e("./nodejs/NodejsStreamInputAdapter"),k=function(T){T.slice(-1)==="/"&&(T=T.substring(0,T.length-1));var D=T.lastIndexOf("/");return 0<D?T.substring(0,D):""},P=function(T){return T.slice(-1)!=="/"&&(T+="/"),T},S=function(T,D){return D=D!==void 0?D:g.createFolders,T=P(T),this.files[T]||r.call(this,T,null,{dir:!0,createFolders:D}),this.files[T]};function E(T){return Object.prototype.toString.call(T)==="[object RegExp]"}var M={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(T){var D,N,F;for(D in this.files)F=this.files[D],(N=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&T(N,F)},filter:function(T){var D=[];return this.forEach(function(N,F){T(N,F)&&D.push(F)}),D},file:function(T,D,N){if(arguments.length!==1)return T=this.root+T,r.call(this,T,D,N),this;if(E(T)){var F=T;return this.filter(function(I,X){return!X.dir&&F.test(I)})}var O=this.files[this.root+T];return O&&!O.dir?O:null},folder:function(T){if(!T)return this;if(E(T))return this.filter(function(O,I){return I.dir&&T.test(O)});var D=this.root+T,N=S.call(this,D),F=this.clone();return F.root=N.name,F},remove:function(T){T=this.root+T;var D=this.files[T];if(D||(T.slice(-1)!=="/"&&(T+="/"),D=this.files[T]),D&&!D.dir)delete this.files[T];else for(var N=this.filter(function(O,I){return I.name.slice(0,T.length)===T}),F=0;F<N.length;F++)delete this.files[N[F].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(T){var D,N={};try{if((N=s.extend(T||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:f.utf8encode})).type=N.type.toLowerCase(),N.compression=N.compression.toUpperCase(),N.type==="binarystring"&&(N.type="string"),!N.type)throw new Error("No output type specified.");s.checkSupport(N.type),N.platform!=="darwin"&&N.platform!=="freebsd"&&N.platform!=="linux"&&N.platform!=="sunos"||(N.platform="UNIX"),N.platform==="win32"&&(N.platform="DOS");var F=N.comment||this.comment||"";D=u.generateWorker(this,N,F)}catch(O){(D=new m("error")).error(O)}return new w(D,N.type||"string",N.mimeType)},generateAsync:function(T,D){return this.generateInternalStream(T).accumulate(D)},generateNodeStream:function(T,D){return(T=T||{}).type||(T.type="nodebuffer"),this.generateInternalStream(T).toNodejsStream(D)}};n.exports=M},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,n,o){n.exports=e("stream")},{stream:void 0}],17:[function(e,n,o){var r=e("./DataReader");function f(s){r.call(this,s);for(var m=0;m<this.data.length;m++)s[m]=255&s[m]}e("../utils").inherits(f,r),f.prototype.byteAt=function(s){return this.data[this.zero+s]},f.prototype.lastIndexOfSignature=function(s){for(var m=s.charCodeAt(0),w=s.charCodeAt(1),g=s.charCodeAt(2),v=s.charCodeAt(3),d=this.length-4;0<=d;--d)if(this.data[d]===m&&this.data[d+1]===w&&this.data[d+2]===g&&this.data[d+3]===v)return d-this.zero;return-1},f.prototype.readAndCheckSignature=function(s){var m=s.charCodeAt(0),w=s.charCodeAt(1),g=s.charCodeAt(2),v=s.charCodeAt(3),d=this.readData(4);return m===d[0]&&w===d[1]&&g===d[2]&&v===d[3]},f.prototype.readData=function(s){if(this.checkOffset(s),s===0)return[];var m=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,m},n.exports=f},{"../utils":32,"./DataReader":18}],18:[function(e,n,o){var r=e("../utils");function f(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}f.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(){},readInt:function(s){var m,w=0;for(this.checkOffset(s),m=this.index+s-1;m>=this.index;m--)w=(w<<8)+this.byteAt(m);return this.index+=s,w},readString:function(s){return r.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},n.exports=f},{"../utils":32}],19:[function(e,n,o){var r=e("./Uint8ArrayReader");function f(s){r.call(this,s)}e("../utils").inherits(f,r),f.prototype.readData=function(s){this.checkOffset(s);var m=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,m},n.exports=f},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,n,o){var r=e("./DataReader");function f(s){r.call(this,s)}e("../utils").inherits(f,r),f.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},f.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},f.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},f.prototype.readData=function(s){this.checkOffset(s);var m=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,m},n.exports=f},{"../utils":32,"./DataReader":18}],21:[function(e,n,o){var r=e("./ArrayReader");function f(s){r.call(this,s)}e("../utils").inherits(f,r),f.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var m=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,m},n.exports=f},{"../utils":32,"./ArrayReader":17}],22:[function(e,n,o){var r=e("../utils"),f=e("../support"),s=e("./ArrayReader"),m=e("./StringReader"),w=e("./NodeBufferReader"),g=e("./Uint8ArrayReader");n.exports=function(v){var d=r.getTypeOf(v);return r.checkSupport(d),d!=="string"||f.uint8array?d==="nodebuffer"?new w(v):f.uint8array?new g(r.transformTo("uint8array",v)):new s(r.transformTo("array",v)):new m(v)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,n,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,n,o){var r=e("./GenericWorker"),f=e("../utils");function s(m){r.call(this,"ConvertWorker to "+m),this.destType=m}f.inherits(s,r),s.prototype.processChunk=function(m){this.push({data:f.transformTo(this.destType,m.data),meta:m.meta})},n.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(e,n,o){var r=e("./GenericWorker"),f=e("../crc32");function s(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(s,r),s.prototype.processChunk=function(m){this.streamInfo.crc32=f(m.data,this.streamInfo.crc32||0),this.push(m)},n.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,n,o){var r=e("../utils"),f=e("./GenericWorker");function s(m){f.call(this,"DataLengthProbe for "+m),this.propName=m,this.withStreamInfo(m,0)}r.inherits(s,f),s.prototype.processChunk=function(m){if(m){var w=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=w+m.data.length}f.prototype.processChunk.call(this,m)},n.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(e,n,o){var r=e("../utils"),f=e("./GenericWorker");function s(m){f.call(this,"DataWorker");var w=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,m.then(function(g){w.dataIsReady=!0,w.data=g,w.max=g&&g.length||0,w.type=r.getTypeOf(g),w.isPaused||w._tickAndRepeat()},function(g){w.error(g)})}r.inherits(s,f),s.prototype.cleanUp=function(){f.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var m=null,w=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":m=this.data.substring(this.index,w);break;case"uint8array":m=this.data.subarray(this.index,w);break;case"array":case"nodebuffer":m=this.data.slice(this.index,w)}return this.index=w,this.push({data:m,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(e,n,o){function r(f){this.name=f||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(f){this.emit("data",f)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(f){this.emit("error",f)}return!0},error:function(f){return!this.isFinished&&(this.isPaused?this.generatedError=f:(this.isFinished=!0,this.emit("error",f),this.previous&&this.previous.error(f),this.cleanUp()),!0)},on:function(f,s){return this._listeners[f].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(f,s){if(this._listeners[f])for(var m=0;m<this._listeners[f].length;m++)this._listeners[f][m].call(this,s)},pipe:function(f){return f.registerPrevious(this)},registerPrevious:function(f){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=f.streamInfo,this.mergeStreamInfo(),this.previous=f;var s=this;return f.on("data",function(m){s.processChunk(m)}),f.on("end",function(){s.end()}),f.on("error",function(m){s.error(m)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var f=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),f=!0),this.previous&&this.previous.resume(),!f},flush:function(){},processChunk:function(f){this.push(f)},withStreamInfo:function(f,s){return this.extraStreamInfo[f]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var f in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,f)&&(this.streamInfo[f]=this.extraStreamInfo[f])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var f="Worker "+this.name;return this.previous?this.previous+" -> "+f:f}},n.exports=r},{}],29:[function(e,n,o){var r=e("../utils"),f=e("./ConvertWorker"),s=e("./GenericWorker"),m=e("../base64"),w=e("../support"),g=e("../external"),v=null;if(w.nodestream)try{v=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(y,x){return new g.Promise(function(k,P){var S=[],E=y._internalType,M=y._outputType,T=y._mimeType;y.on("data",function(D,N){S.push(D),x&&x(N)}).on("error",function(D){S=[],P(D)}).on("end",function(){try{var D=function(N,F,O){switch(N){case"blob":return r.newBlob(r.transformTo("arraybuffer",F),O);case"base64":return m.encode(F);default:return r.transformTo(N,F)}}(M,function(N,F){var O,I=0,X=null,ne=0;for(O=0;O<F.length;O++)ne+=F[O].length;switch(N){case"string":return F.join("");case"array":return Array.prototype.concat.apply([],F);case"uint8array":for(X=new Uint8Array(ne),O=0;O<F.length;O++)X.set(F[O],I),I+=F[O].length;return X;case"nodebuffer":return Buffer.concat(F);default:throw new Error("concat : unsupported type '"+N+"'")}}(E,S),T);k(D)}catch(N){P(N)}S=[]}).resume()})}function u(y,x,k){var P=x;switch(x){case"blob":case"arraybuffer":P="uint8array";break;case"base64":P="string"}try{this._internalType=P,this._outputType=x,this._mimeType=k,r.checkSupport(P),this._worker=y.pipe(new f(P)),y.lock()}catch(S){this._worker=new s("error"),this._worker.error(S)}}u.prototype={accumulate:function(y){return d(this,y)},on:function(y,x){var k=this;return y==="data"?this._worker.on(y,function(P){x.call(k,P.data,P.meta)}):this._worker.on(y,function(){r.delay(x,arguments,k)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(y){if(r.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new v(this,{objectMode:this._outputType!=="nodebuffer"},y)}},n.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,n,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var r=new ArrayBuffer(0);try{o.blob=new Blob([r],{type:"application/zip"}).size===0}catch{try{var f=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);f.append(r),o.blob=f.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!e("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(e,n,o){for(var r=e("./utils"),f=e("./support"),s=e("./nodejsUtils"),m=e("./stream/GenericWorker"),w=new Array(256),g=0;g<256;g++)w[g]=252<=g?6:248<=g?5:240<=g?4:224<=g?3:192<=g?2:1;function v(){m.call(this,"utf-8 decode"),this.leftOver=null}function d(){m.call(this,"utf-8 encode")}w[254]=w[254]=1,o.utf8encode=function(u){return f.nodebuffer?s.newBufferFrom(u,"utf-8"):function(y){var x,k,P,S,E,M=y.length,T=0;for(S=0;S<M;S++)(64512&(k=y.charCodeAt(S)))==55296&&S+1<M&&(64512&(P=y.charCodeAt(S+1)))==56320&&(k=65536+(k-55296<<10)+(P-56320),S++),T+=k<128?1:k<2048?2:k<65536?3:4;for(x=f.uint8array?new Uint8Array(T):new Array(T),S=E=0;E<T;S++)(64512&(k=y.charCodeAt(S)))==55296&&S+1<M&&(64512&(P=y.charCodeAt(S+1)))==56320&&(k=65536+(k-55296<<10)+(P-56320),S++),k<128?x[E++]=k:(k<2048?x[E++]=192|k>>>6:(k<65536?x[E++]=224|k>>>12:(x[E++]=240|k>>>18,x[E++]=128|k>>>12&63),x[E++]=128|k>>>6&63),x[E++]=128|63&k);return x}(u)},o.utf8decode=function(u){return f.nodebuffer?r.transformTo("nodebuffer",u).toString("utf-8"):function(y){var x,k,P,S,E=y.length,M=new Array(2*E);for(x=k=0;x<E;)if((P=y[x++])<128)M[k++]=P;else if(4<(S=w[P]))M[k++]=65533,x+=S-1;else{for(P&=S===2?31:S===3?15:7;1<S&&x<E;)P=P<<6|63&y[x++],S--;1<S?M[k++]=65533:P<65536?M[k++]=P:(P-=65536,M[k++]=55296|P>>10&1023,M[k++]=56320|1023&P)}return M.length!==k&&(M.subarray?M=M.subarray(0,k):M.length=k),r.applyFromCharCode(M)}(u=r.transformTo(f.uint8array?"uint8array":"array",u))},r.inherits(v,m),v.prototype.processChunk=function(u){var y=r.transformTo(f.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(f.uint8array){var x=y;(y=new Uint8Array(x.length+this.leftOver.length)).set(this.leftOver,0),y.set(x,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var k=function(S,E){var M;for((E=E||S.length)>S.length&&(E=S.length),M=E-1;0<=M&&(192&S[M])==128;)M--;return M<0||M===0?E:M+w[S[M]]>E?M:E}(y),P=y;k!==y.length&&(f.uint8array?(P=y.subarray(0,k),this.leftOver=y.subarray(k,y.length)):(P=y.slice(0,k),this.leftOver=y.slice(k,y.length))),this.push({data:o.utf8decode(P),meta:u.meta})},v.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=v,r.inherits(d,m),d.prototype.processChunk=function(u){this.push({data:o.utf8encode(u.data),meta:u.meta})},o.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,n,o){var r=e("./support"),f=e("./base64"),s=e("./nodejsUtils"),m=e("./external");function w(x){return x}function g(x,k){for(var P=0;P<x.length;++P)k[P]=255&x.charCodeAt(P);return k}e("setimmediate"),o.newBlob=function(x,k){o.checkSupport("blob");try{return new Blob([x],{type:k})}catch{try{var P=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return P.append(x),P.getBlob(k)}catch{throw new Error("Bug : can't construct the Blob.")}}};var v={stringifyByChunk:function(x,k,P){var S=[],E=0,M=x.length;if(M<=P)return String.fromCharCode.apply(null,x);for(;E<M;)k==="array"||k==="nodebuffer"?S.push(String.fromCharCode.apply(null,x.slice(E,Math.min(E+P,M)))):S.push(String.fromCharCode.apply(null,x.subarray(E,Math.min(E+P,M)))),E+=P;return S.join("")},stringifyByChar:function(x){for(var k="",P=0;P<x.length;P++)k+=String.fromCharCode(x[P]);return k},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}}()}};function d(x){var k=65536,P=o.getTypeOf(x),S=!0;if(P==="uint8array"?S=v.applyCanBeUsed.uint8array:P==="nodebuffer"&&(S=v.applyCanBeUsed.nodebuffer),S)for(;1<k;)try{return v.stringifyByChunk(x,P,k)}catch{k=Math.floor(k/2)}return v.stringifyByChar(x)}function u(x,k){for(var P=0;P<x.length;P++)k[P]=x[P];return k}o.applyFromCharCode=d;var y={};y.string={string:w,array:function(x){return g(x,new Array(x.length))},arraybuffer:function(x){return y.string.uint8array(x).buffer},uint8array:function(x){return g(x,new Uint8Array(x.length))},nodebuffer:function(x){return g(x,s.allocBuffer(x.length))}},y.array={string:d,array:w,arraybuffer:function(x){return new Uint8Array(x).buffer},uint8array:function(x){return new Uint8Array(x)},nodebuffer:function(x){return s.newBufferFrom(x)}},y.arraybuffer={string:function(x){return d(new Uint8Array(x))},array:function(x){return u(new Uint8Array(x),new Array(x.byteLength))},arraybuffer:w,uint8array:function(x){return new Uint8Array(x)},nodebuffer:function(x){return s.newBufferFrom(new Uint8Array(x))}},y.uint8array={string:d,array:function(x){return u(x,new Array(x.length))},arraybuffer:function(x){return x.buffer},uint8array:w,nodebuffer:function(x){return s.newBufferFrom(x)}},y.nodebuffer={string:d,array:function(x){return u(x,new Array(x.length))},arraybuffer:function(x){return y.nodebuffer.uint8array(x).buffer},uint8array:function(x){return u(x,new Uint8Array(x.length))},nodebuffer:w},o.transformTo=function(x,k){if(k=k||"",!x)return k;o.checkSupport(x);var P=o.getTypeOf(k);return y[P][x](k)},o.resolve=function(x){for(var k=x.split("/"),P=[],S=0;S<k.length;S++){var E=k[S];E==="."||E===""&&S!==0&&S!==k.length-1||(E===".."?P.pop():P.push(E))}return P.join("/")},o.getTypeOf=function(x){return typeof x=="string"?"string":Object.prototype.toString.call(x)==="[object Array]"?"array":r.nodebuffer&&s.isBuffer(x)?"nodebuffer":r.uint8array&&x instanceof Uint8Array?"uint8array":r.arraybuffer&&x instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(x){if(!r[x.toLowerCase()])throw new Error(x+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(x){var k,P,S="";for(P=0;P<(x||"").length;P++)S+="\\x"+((k=x.charCodeAt(P))<16?"0":"")+k.toString(16).toUpperCase();return S},o.delay=function(x,k,P){setImmediate(function(){x.apply(P||null,k||[])})},o.inherits=function(x,k){function P(){}P.prototype=k.prototype,x.prototype=new P},o.extend=function(){var x,k,P={};for(x=0;x<arguments.length;x++)for(k in arguments[x])Object.prototype.hasOwnProperty.call(arguments[x],k)&&P[k]===void 0&&(P[k]=arguments[x][k]);return P},o.prepareContent=function(x,k,P,S,E){return m.Promise.resolve(k).then(function(M){return r.blob&&(M instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(M))!==-1)&&typeof FileReader<"u"?new m.Promise(function(T,D){var N=new FileReader;N.onload=function(F){T(F.target.result)},N.onerror=function(F){D(F.target.error)},N.readAsArrayBuffer(M)}):M}).then(function(M){var T=o.getTypeOf(M);return T?(T==="arraybuffer"?M=o.transformTo("uint8array",M):T==="string"&&(E?M=f.decode(M):P&&S!==!0&&(M=function(D){return g(D,r.uint8array?new Uint8Array(D.length):new Array(D.length))}(M))),M):m.Promise.reject(new Error("Can't read the data of '"+x+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,n,o){var r=e("./reader/readerFor"),f=e("./utils"),s=e("./signature"),m=e("./zipEntry"),w=e("./support");function g(v){this.files=[],this.loadOptions=v}g.prototype={checkSignature:function(v){if(!this.reader.readAndCheckSignature(v)){this.reader.index-=4;var d=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+f.pretty(d)+", expected "+f.pretty(v)+")")}},isSignature:function(v,d){var u=this.reader.index;this.reader.setIndex(v);var y=this.reader.readString(4)===d;return this.reader.setIndex(u),y},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var v=this.reader.readData(this.zipCommentLength),d=w.uint8array?"uint8array":"array",u=f.transformTo(d,v);this.zipComment=this.loadOptions.decodeFileName(u)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var v,d,u,y=this.zip64EndOfCentralSize-44;0<y;)v=this.reader.readInt(2),d=this.reader.readInt(4),u=this.reader.readData(d),this.zip64ExtensibleData[v]={id:v,length:d,value:u}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var v,d;for(v=0;v<this.files.length;v++)d=this.files[v],this.reader.setIndex(d.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),d.readLocalPart(this.reader),d.handleUTF8(),d.processAttributes()},readCentralDir:function(){var v;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(v=new m({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(v);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var v=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(v<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(v);var d=v;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===f.MAX_VALUE_16BITS||this.diskWithCentralDirStart===f.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===f.MAX_VALUE_16BITS||this.centralDirRecords===f.MAX_VALUE_16BITS||this.centralDirSize===f.MAX_VALUE_32BITS||this.centralDirOffset===f.MAX_VALUE_32BITS){if(this.zip64=!0,(v=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(v),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var u=this.centralDirOffset+this.centralDirSize;this.zip64&&(u+=20,u+=12+this.zip64EndOfCentralSize);var y=d-u;if(0<y)this.isSignature(d,s.CENTRAL_FILE_HEADER)||(this.reader.zero=y);else if(y<0)throw new Error("Corrupted zip: missing "+Math.abs(y)+" bytes.")},prepareReader:function(v){this.reader=r(v)},load:function(v){this.prepareReader(v),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=g},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,n,o){var r=e("./reader/readerFor"),f=e("./utils"),s=e("./compressedObject"),m=e("./crc32"),w=e("./utf8"),g=e("./compressions"),v=e("./support");function d(u,y){this.options=u,this.loadOptions=y}d.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(u){var y,x;if(u.skip(22),this.fileNameLength=u.readInt(2),x=u.readInt(2),this.fileName=u.readData(this.fileNameLength),u.skip(x),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((y=function(k){for(var P in g)if(Object.prototype.hasOwnProperty.call(g,P)&&g[P].magic===k)return g[P];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+f.pretty(this.compressionMethod)+" unknown (inner file : "+f.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,y,u.readData(this.compressedSize))},readCentralPart:function(u){this.versionMadeBy=u.readInt(2),u.skip(2),this.bitFlag=u.readInt(2),this.compressionMethod=u.readString(2),this.date=u.readDate(),this.crc32=u.readInt(4),this.compressedSize=u.readInt(4),this.uncompressedSize=u.readInt(4);var y=u.readInt(2);if(this.extraFieldsLength=u.readInt(2),this.fileCommentLength=u.readInt(2),this.diskNumberStart=u.readInt(2),this.internalFileAttributes=u.readInt(2),this.externalFileAttributes=u.readInt(4),this.localHeaderOffset=u.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");u.skip(y),this.readExtraFields(u),this.parseZIP64ExtraField(u),this.fileComment=u.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var u=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),u==0&&(this.dosPermissions=63&this.externalFileAttributes),u==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=r(this.extraFields[1].value);this.uncompressedSize===f.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===f.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===f.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===f.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var y,x,k,P=u.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});u.index+4<P;)y=u.readInt(2),x=u.readInt(2),k=u.readData(x),this.extraFields[y]={id:y,length:x,value:k};u.setIndex(P)},handleUTF8:function(){var u=v.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=w.utf8decode(this.fileName),this.fileCommentStr=w.utf8decode(this.fileComment);else{var y=this.findExtraFieldUnicodePath();if(y!==null)this.fileNameStr=y;else{var x=f.transformTo(u,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(x)}var k=this.findExtraFieldUnicodeComment();if(k!==null)this.fileCommentStr=k;else{var P=f.transformTo(u,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(P)}}},findExtraFieldUnicodePath:function(){var u=this.extraFields[28789];if(u){var y=r(u.value);return y.readInt(1)!==1||m(this.fileName)!==y.readInt(4)?null:w.utf8decode(y.readData(u.length-5))}return null},findExtraFieldUnicodeComment:function(){var u=this.extraFields[25461];if(u){var y=r(u.value);return y.readInt(1)!==1||m(this.fileComment)!==y.readInt(4)?null:w.utf8decode(y.readData(u.length-5))}return null}},n.exports=d},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,n,o){function r(y,x,k){this.name=y,this.dir=k.dir,this.date=k.date,this.comment=k.comment,this.unixPermissions=k.unixPermissions,this.dosPermissions=k.dosPermissions,this._data=x,this._dataBinary=k.binary,this.options={compression:k.compression,compressionOptions:k.compressionOptions}}var f=e("./stream/StreamHelper"),s=e("./stream/DataWorker"),m=e("./utf8"),w=e("./compressedObject"),g=e("./stream/GenericWorker");r.prototype={internalStream:function(y){var x=null,k="string";try{if(!y)throw new Error("No output type specified.");var P=(k=y.toLowerCase())==="string"||k==="text";k!=="binarystring"&&k!=="text"||(k="string"),x=this._decompressWorker();var S=!this._dataBinary;S&&!P&&(x=x.pipe(new m.Utf8EncodeWorker)),!S&&P&&(x=x.pipe(new m.Utf8DecodeWorker))}catch(E){(x=new g("error")).error(E)}return new f(x,k,"")},async:function(y,x){return this.internalStream(y).accumulate(x)},nodeStream:function(y,x){return this.internalStream(y||"nodebuffer").toNodejsStream(x)},_compressWorker:function(y,x){if(this._data instanceof w&&this._data.compression.magic===y.magic)return this._data.getCompressedWorker();var k=this._decompressWorker();return this._dataBinary||(k=k.pipe(new m.Utf8EncodeWorker)),w.createWorkerFrom(k,y,x)},_decompressWorker:function(){return this._data instanceof w?this._data.getContentWorker():this._data instanceof g?this._data:new s(this._data)}};for(var v=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],d=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<v.length;u++)r.prototype[v[u]]=d;n.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,n,o){(function(r){var f,s,m=r.MutationObserver||r.WebKitMutationObserver;if(m){var w=0,g=new m(y),v=r.document.createTextNode("");g.observe(v,{characterData:!0}),f=function(){v.data=w=++w%2}}else if(r.setImmediate||r.MessageChannel===void 0)f="document"in r&&"onreadystatechange"in r.document.createElement("script")?function(){var x=r.document.createElement("script");x.onreadystatechange=function(){y(),x.onreadystatechange=null,x.parentNode.removeChild(x),x=null},r.document.documentElement.appendChild(x)}:function(){setTimeout(y,0)};else{var d=new r.MessageChannel;d.port1.onmessage=y,f=function(){d.port2.postMessage(0)}}var u=[];function y(){var x,k;s=!0;for(var P=u.length;P;){for(k=u,u=[],x=-1;++x<P;)k[x]();P=u.length}s=!1}n.exports=function(x){u.push(x)!==1||s||f()}}).call(this,commonjsGlobal$1!==void 0?commonjsGlobal$1:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(e,n,o){var r=e("immediate");function f(){}var s={},m=["REJECTED"],w=["FULFILLED"],g=["PENDING"];function v(P){if(typeof P!="function")throw new TypeError("resolver must be a function");this.state=g,this.queue=[],this.outcome=void 0,P!==f&&x(this,P)}function d(P,S,E){this.promise=P,typeof S=="function"&&(this.onFulfilled=S,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}function u(P,S,E){r(function(){var M;try{M=S(E)}catch(T){return s.reject(P,T)}M===P?s.reject(P,new TypeError("Cannot resolve promise with itself")):s.resolve(P,M)})}function y(P){var S=P&&P.then;if(P&&(_typeof$1(P)=="object"||typeof P=="function")&&typeof S=="function")return function(){S.apply(P,arguments)}}function x(P,S){var E=!1;function M(N){E||(E=!0,s.reject(P,N))}function T(N){E||(E=!0,s.resolve(P,N))}var D=k(function(){S(T,M)});D.status==="error"&&M(D.value)}function k(P,S){var E={};try{E.value=P(S),E.status="success"}catch(M){E.status="error",E.value=M}return E}(n.exports=v).prototype.finally=function(P){if(typeof P!="function")return this;var S=this.constructor;return this.then(function(E){return S.resolve(P()).then(function(){return E})},function(E){return S.resolve(P()).then(function(){throw E})})},v.prototype.catch=function(P){return this.then(null,P)},v.prototype.then=function(P,S){if(typeof P!="function"&&this.state===w||typeof S!="function"&&this.state===m)return this;var E=new this.constructor(f);return this.state!==g?u(E,this.state===w?P:S,this.outcome):this.queue.push(new d(E,P,S)),E},d.prototype.callFulfilled=function(P){s.resolve(this.promise,P)},d.prototype.otherCallFulfilled=function(P){u(this.promise,this.onFulfilled,P)},d.prototype.callRejected=function(P){s.reject(this.promise,P)},d.prototype.otherCallRejected=function(P){u(this.promise,this.onRejected,P)},s.resolve=function(P,S){var E=k(y,S);if(E.status==="error")return s.reject(P,E.value);var M=E.value;if(M)x(P,M);else{P.state=w,P.outcome=S;for(var T=-1,D=P.queue.length;++T<D;)P.queue[T].callFulfilled(S)}return P},s.reject=function(P,S){P.state=m,P.outcome=S;for(var E=-1,M=P.queue.length;++E<M;)P.queue[E].callRejected(S);return P},v.resolve=function(P){return P instanceof this?P:s.resolve(new this(f),P)},v.reject=function(P){var S=new this(f);return s.reject(S,P)},v.all=function(P){var S=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=P.length,M=!1;if(!E)return this.resolve([]);for(var T=new Array(E),D=0,N=-1,F=new this(f);++N<E;)O(P[N],N);return F;function O(I,X){S.resolve(I).then(function(ne){T[X]=ne,++D!==E||M||(M=!0,s.resolve(F,T))},function(ne){M||(M=!0,s.reject(F,ne))})}},v.race=function(P){var S=this;if(Object.prototype.toString.call(P)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=P.length,M=!1;if(!E)return this.resolve([]);for(var T,D=-1,N=new this(f);++D<E;)T=P[D],S.resolve(T).then(function(F){M||(M=!0,s.resolve(N,F))},function(F){M||(M=!0,s.reject(N,F))});return N}},{immediate:36}],38:[function(e,n,o){var r={};(0,e("./lib/utils/common").assign)(r,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),n.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,n,o){var r=e("./zlib/deflate"),f=e("./utils/common"),s=e("./utils/strings"),m=e("./zlib/messages"),w=e("./zlib/zstream"),g=Object.prototype.toString,v=0,d=-1,u=0,y=8;function x(P){if(!(this instanceof x))return new x(P);this.options=f.assign({level:d,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},P||{});var S=this.options;S.raw&&0<S.windowBits?S.windowBits=-S.windowBits:S.gzip&&0<S.windowBits&&S.windowBits<16&&(S.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new w,this.strm.avail_out=0;var E=r.deflateInit2(this.strm,S.level,S.method,S.windowBits,S.memLevel,S.strategy);if(E!==v)throw new Error(m[E]);if(S.header&&r.deflateSetHeader(this.strm,S.header),S.dictionary){var M;if(M=typeof S.dictionary=="string"?s.string2buf(S.dictionary):g.call(S.dictionary)==="[object ArrayBuffer]"?new Uint8Array(S.dictionary):S.dictionary,(E=r.deflateSetDictionary(this.strm,M))!==v)throw new Error(m[E]);this._dict_set=!0}}function k(P,S){var E=new x(S);if(E.push(P,!0),E.err)throw E.msg||m[E.err];return E.result}x.prototype.push=function(P,S){var E,M,T=this.strm,D=this.options.chunkSize;if(this.ended)return!1;M=S===~~S?S:S===!0?4:0,typeof P=="string"?T.input=s.string2buf(P):g.call(P)==="[object ArrayBuffer]"?T.input=new Uint8Array(P):T.input=P,T.next_in=0,T.avail_in=T.input.length;do{if(T.avail_out===0&&(T.output=new f.Buf8(D),T.next_out=0,T.avail_out=D),(E=r.deflate(T,M))!==1&&E!==v)return this.onEnd(E),!(this.ended=!0);T.avail_out!==0&&(T.avail_in!==0||M!==4&&M!==2)||(this.options.to==="string"?this.onData(s.buf2binstring(f.shrinkBuf(T.output,T.next_out))):this.onData(f.shrinkBuf(T.output,T.next_out)))}while((0<T.avail_in||T.avail_out===0)&&E!==1);return M===4?(E=r.deflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===v):M!==2||(this.onEnd(v),!(T.avail_out=0))},x.prototype.onData=function(P){this.chunks.push(P)},x.prototype.onEnd=function(P){P===v&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=f.flattenChunks(this.chunks)),this.chunks=[],this.err=P,this.msg=this.strm.msg},o.Deflate=x,o.deflate=k,o.deflateRaw=function(P,S){return(S=S||{}).raw=!0,k(P,S)},o.gzip=function(P,S){return(S=S||{}).gzip=!0,k(P,S)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,n,o){var r=e("./zlib/inflate"),f=e("./utils/common"),s=e("./utils/strings"),m=e("./zlib/constants"),w=e("./zlib/messages"),g=e("./zlib/zstream"),v=e("./zlib/gzheader"),d=Object.prototype.toString;function u(x){if(!(this instanceof u))return new u(x);this.options=f.assign({chunkSize:16384,windowBits:0,to:""},x||{});var k=this.options;k.raw&&0<=k.windowBits&&k.windowBits<16&&(k.windowBits=-k.windowBits,k.windowBits===0&&(k.windowBits=-15)),!(0<=k.windowBits&&k.windowBits<16)||x&&x.windowBits||(k.windowBits+=32),15<k.windowBits&&k.windowBits<48&&!(15&k.windowBits)&&(k.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new g,this.strm.avail_out=0;var P=r.inflateInit2(this.strm,k.windowBits);if(P!==m.Z_OK)throw new Error(w[P]);this.header=new v,r.inflateGetHeader(this.strm,this.header)}function y(x,k){var P=new u(k);if(P.push(x,!0),P.err)throw P.msg||w[P.err];return P.result}u.prototype.push=function(x,k){var P,S,E,M,T,D,N=this.strm,F=this.options.chunkSize,O=this.options.dictionary,I=!1;if(this.ended)return!1;S=k===~~k?k:k===!0?m.Z_FINISH:m.Z_NO_FLUSH,typeof x=="string"?N.input=s.binstring2buf(x):d.call(x)==="[object ArrayBuffer]"?N.input=new Uint8Array(x):N.input=x,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new f.Buf8(F),N.next_out=0,N.avail_out=F),(P=r.inflate(N,m.Z_NO_FLUSH))===m.Z_NEED_DICT&&O&&(D=typeof O=="string"?s.string2buf(O):d.call(O)==="[object ArrayBuffer]"?new Uint8Array(O):O,P=r.inflateSetDictionary(this.strm,D)),P===m.Z_BUF_ERROR&&I===!0&&(P=m.Z_OK,I=!1),P!==m.Z_STREAM_END&&P!==m.Z_OK)return this.onEnd(P),!(this.ended=!0);N.next_out&&(N.avail_out!==0&&P!==m.Z_STREAM_END&&(N.avail_in!==0||S!==m.Z_FINISH&&S!==m.Z_SYNC_FLUSH)||(this.options.to==="string"?(E=s.utf8border(N.output,N.next_out),M=N.next_out-E,T=s.buf2string(N.output,E),N.next_out=M,N.avail_out=F-M,M&&f.arraySet(N.output,N.output,E,M,0),this.onData(T)):this.onData(f.shrinkBuf(N.output,N.next_out)))),N.avail_in===0&&N.avail_out===0&&(I=!0)}while((0<N.avail_in||N.avail_out===0)&&P!==m.Z_STREAM_END);return P===m.Z_STREAM_END&&(S=m.Z_FINISH),S===m.Z_FINISH?(P=r.inflateEnd(this.strm),this.onEnd(P),this.ended=!0,P===m.Z_OK):S!==m.Z_SYNC_FLUSH||(this.onEnd(m.Z_OK),!(N.avail_out=0))},u.prototype.onData=function(x){this.chunks.push(x)},u.prototype.onEnd=function(x){x===m.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=f.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg},o.Inflate=u,o.inflate=y,o.inflateRaw=function(x,k){return(k=k||{}).raw=!0,y(x,k)},o.ungzip=y},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,n,o){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(m){for(var w=Array.prototype.slice.call(arguments,1);w.length;){var g=w.shift();if(g){if(_typeof$1(g)!="object")throw new TypeError(g+"must be non-object");for(var v in g)g.hasOwnProperty(v)&&(m[v]=g[v])}}return m},o.shrinkBuf=function(m,w){return m.length===w?m:m.subarray?m.subarray(0,w):(m.length=w,m)};var f={arraySet:function(m,w,g,v,d){if(w.subarray&&m.subarray)m.set(w.subarray(g,g+v),d);else for(var u=0;u<v;u++)m[d+u]=w[g+u]},flattenChunks:function(m){var w,g,v,d,u,y;for(w=v=0,g=m.length;w<g;w++)v+=m[w].length;for(y=new Uint8Array(v),w=d=0,g=m.length;w<g;w++)u=m[w],y.set(u,d),d+=u.length;return y}},s={arraySet:function(m,w,g,v,d){for(var u=0;u<v;u++)m[d+u]=w[g+u]},flattenChunks:function(m){return[].concat.apply([],m)}};o.setTyped=function(m){m?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,f)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,s))},o.setTyped(r)},{}],42:[function(e,n,o){var r=e("./common"),f=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var m=new r.Buf8(256),w=0;w<256;w++)m[w]=252<=w?6:248<=w?5:240<=w?4:224<=w?3:192<=w?2:1;function g(v,d){if(d<65537&&(v.subarray&&s||!v.subarray&&f))return String.fromCharCode.apply(null,r.shrinkBuf(v,d));for(var u="",y=0;y<d;y++)u+=String.fromCharCode(v[y]);return u}m[254]=m[254]=1,o.string2buf=function(v){var d,u,y,x,k,P=v.length,S=0;for(x=0;x<P;x++)(64512&(u=v.charCodeAt(x)))==55296&&x+1<P&&(64512&(y=v.charCodeAt(x+1)))==56320&&(u=65536+(u-55296<<10)+(y-56320),x++),S+=u<128?1:u<2048?2:u<65536?3:4;for(d=new r.Buf8(S),x=k=0;k<S;x++)(64512&(u=v.charCodeAt(x)))==55296&&x+1<P&&(64512&(y=v.charCodeAt(x+1)))==56320&&(u=65536+(u-55296<<10)+(y-56320),x++),u<128?d[k++]=u:(u<2048?d[k++]=192|u>>>6:(u<65536?d[k++]=224|u>>>12:(d[k++]=240|u>>>18,d[k++]=128|u>>>12&63),d[k++]=128|u>>>6&63),d[k++]=128|63&u);return d},o.buf2binstring=function(v){return g(v,v.length)},o.binstring2buf=function(v){for(var d=new r.Buf8(v.length),u=0,y=d.length;u<y;u++)d[u]=v.charCodeAt(u);return d},o.buf2string=function(v,d){var u,y,x,k,P=d||v.length,S=new Array(2*P);for(u=y=0;u<P;)if((x=v[u++])<128)S[y++]=x;else if(4<(k=m[x]))S[y++]=65533,u+=k-1;else{for(x&=k===2?31:k===3?15:7;1<k&&u<P;)x=x<<6|63&v[u++],k--;1<k?S[y++]=65533:x<65536?S[y++]=x:(x-=65536,S[y++]=55296|x>>10&1023,S[y++]=56320|1023&x)}return g(S,y)},o.utf8border=function(v,d){var u;for((d=d||v.length)>v.length&&(d=v.length),u=d-1;0<=u&&(192&v[u])==128;)u--;return u<0||u===0?d:u+m[v[u]]>d?u:d}},{"./common":41}],43:[function(e,n,o){n.exports=function(r,f,s,m){for(var w=65535&r,g=r>>>16&65535,v=0;s!==0;){for(s-=v=2e3<s?2e3:s;g=g+(w=w+f[m++]|0)|0,--v;);w%=65521,g%=65521}return w|g<<16}},{}],44:[function(e,n,o){n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,n,o){var r=function(){for(var f,s=[],m=0;m<256;m++){f=m;for(var w=0;w<8;w++)f=1&f?3988292384^f>>>1:f>>>1;s[m]=f}return s}();n.exports=function(f,s,m,w){var g=r,v=w+m;f^=-1;for(var d=w;d<v;d++)f=f>>>8^g[255&(f^s[d])];return~f}},{}],46:[function(e,n,o){var r,f=e("../utils/common"),s=e("./trees"),m=e("./adler32"),w=e("./crc32"),g=e("./messages"),v=0,d=4,u=0,y=-2,x=-1,k=4,P=2,S=8,E=9,M=286,T=30,D=19,N=2*M+1,F=15,O=3,I=258,X=I+O+1,ne=42,ye=113,J=1,te=2,q=3,re=4;function U(_e,ve){return _e.msg=g[ve],ve}function H(_e){return(_e<<1)-(4<_e?9:0)}function Z(_e){for(var ve=_e.length;0<=--ve;)_e[ve]=0}function Y(_e){var ve=_e.state,be=ve.pending;be>_e.avail_out&&(be=_e.avail_out),be!==0&&(f.arraySet(_e.output,ve.pending_buf,ve.pending_out,be,_e.next_out),_e.next_out+=be,ve.pending_out+=be,_e.total_out+=be,_e.avail_out-=be,ve.pending-=be,ve.pending===0&&(ve.pending_out=0))}function W(_e,ve){s._tr_flush_block(_e,0<=_e.block_start?_e.block_start:-1,_e.strstart-_e.block_start,ve),_e.block_start=_e.strstart,Y(_e.strm)}function Q(_e,ve){_e.pending_buf[_e.pending++]=ve}function oe(_e,ve){_e.pending_buf[_e.pending++]=ve>>>8&255,_e.pending_buf[_e.pending++]=255&ve}function Ce(_e,ve){var be,ke,Me=_e.max_chain_length,Le=_e.strstart,Oe=_e.prev_length,ze=_e.nice_match,We=_e.strstart>_e.w_size-X?_e.strstart-(_e.w_size-X):0,Ge=_e.window,Xe=_e.w_mask,qe=_e.prev,Ke=_e.strstart+I,Qe=Ge[Le+Oe-1],at=Ge[Le+Oe];_e.prev_length>=_e.good_match&&(Me>>=2),ze>_e.lookahead&&(ze=_e.lookahead);do if(Ge[(be=ve)+Oe]===at&&Ge[be+Oe-1]===Qe&&Ge[be]===Ge[Le]&&Ge[++be]===Ge[Le+1]){Le+=2,be++;do;while(Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Ge[++Le]===Ge[++be]&&Le<Ke);if(ke=I-(Ke-Le),Le=Ke-I,Oe<ke){if(_e.match_start=ve,ze<=(Oe=ke))break;Qe=Ge[Le+Oe-1],at=Ge[Le+Oe]}}while((ve=qe[ve&Xe])>We&&--Me!=0);return Oe<=_e.lookahead?Oe:_e.lookahead}function Se(_e){var ve,be,ke,Me,Le,Oe,ze,We,Ge,Xe,qe=_e.w_size;do{if(Me=_e.window_size-_e.lookahead-_e.strstart,_e.strstart>=qe+(qe-X)){for(f.arraySet(_e.window,_e.window,qe,qe,0),_e.match_start-=qe,_e.strstart-=qe,_e.block_start-=qe,ve=be=_e.hash_size;ke=_e.head[--ve],_e.head[ve]=qe<=ke?ke-qe:0,--be;);for(ve=be=qe;ke=_e.prev[--ve],_e.prev[ve]=qe<=ke?ke-qe:0,--be;);Me+=qe}if(_e.strm.avail_in===0)break;if(Oe=_e.strm,ze=_e.window,We=_e.strstart+_e.lookahead,Xe=void 0,(Ge=Me)<(Xe=Oe.avail_in)&&(Xe=Ge),be=Xe===0?0:(Oe.avail_in-=Xe,f.arraySet(ze,Oe.input,Oe.next_in,Xe,We),Oe.state.wrap===1?Oe.adler=m(Oe.adler,ze,Xe,We):Oe.state.wrap===2&&(Oe.adler=w(Oe.adler,ze,Xe,We)),Oe.next_in+=Xe,Oe.total_in+=Xe,Xe),_e.lookahead+=be,_e.lookahead+_e.insert>=O)for(Le=_e.strstart-_e.insert,_e.ins_h=_e.window[Le],_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[Le+1])&_e.hash_mask;_e.insert&&(_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[Le+O-1])&_e.hash_mask,_e.prev[Le&_e.w_mask]=_e.head[_e.ins_h],_e.head[_e.ins_h]=Le,Le++,_e.insert--,!(_e.lookahead+_e.insert<O)););}while(_e.lookahead<X&&_e.strm.avail_in!==0)}function fe(_e,ve){for(var be,ke;;){if(_e.lookahead<X){if(Se(_e),_e.lookahead<X&&ve===v)return J;if(_e.lookahead===0)break}if(be=0,_e.lookahead>=O&&(_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[_e.strstart+O-1])&_e.hash_mask,be=_e.prev[_e.strstart&_e.w_mask]=_e.head[_e.ins_h],_e.head[_e.ins_h]=_e.strstart),be!==0&&_e.strstart-be<=_e.w_size-X&&(_e.match_length=Ce(_e,be)),_e.match_length>=O)if(ke=s._tr_tally(_e,_e.strstart-_e.match_start,_e.match_length-O),_e.lookahead-=_e.match_length,_e.match_length<=_e.max_lazy_match&&_e.lookahead>=O){for(_e.match_length--;_e.strstart++,_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[_e.strstart+O-1])&_e.hash_mask,be=_e.prev[_e.strstart&_e.w_mask]=_e.head[_e.ins_h],_e.head[_e.ins_h]=_e.strstart,--_e.match_length!=0;);_e.strstart++}else _e.strstart+=_e.match_length,_e.match_length=0,_e.ins_h=_e.window[_e.strstart],_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[_e.strstart+1])&_e.hash_mask;else ke=s._tr_tally(_e,0,_e.window[_e.strstart]),_e.lookahead--,_e.strstart++;if(ke&&(W(_e,!1),_e.strm.avail_out===0))return J}return _e.insert=_e.strstart<O-1?_e.strstart:O-1,ve===d?(W(_e,!0),_e.strm.avail_out===0?q:re):_e.last_lit&&(W(_e,!1),_e.strm.avail_out===0)?J:te}function Pe(_e,ve){for(var be,ke,Me;;){if(_e.lookahead<X){if(Se(_e),_e.lookahead<X&&ve===v)return J;if(_e.lookahead===0)break}if(be=0,_e.lookahead>=O&&(_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[_e.strstart+O-1])&_e.hash_mask,be=_e.prev[_e.strstart&_e.w_mask]=_e.head[_e.ins_h],_e.head[_e.ins_h]=_e.strstart),_e.prev_length=_e.match_length,_e.prev_match=_e.match_start,_e.match_length=O-1,be!==0&&_e.prev_length<_e.max_lazy_match&&_e.strstart-be<=_e.w_size-X&&(_e.match_length=Ce(_e,be),_e.match_length<=5&&(_e.strategy===1||_e.match_length===O&&4096<_e.strstart-_e.match_start)&&(_e.match_length=O-1)),_e.prev_length>=O&&_e.match_length<=_e.prev_length){for(Me=_e.strstart+_e.lookahead-O,ke=s._tr_tally(_e,_e.strstart-1-_e.prev_match,_e.prev_length-O),_e.lookahead-=_e.prev_length-1,_e.prev_length-=2;++_e.strstart<=Me&&(_e.ins_h=(_e.ins_h<<_e.hash_shift^_e.window[_e.strstart+O-1])&_e.hash_mask,be=_e.prev[_e.strstart&_e.w_mask]=_e.head[_e.ins_h],_e.head[_e.ins_h]=_e.strstart),--_e.prev_length!=0;);if(_e.match_available=0,_e.match_length=O-1,_e.strstart++,ke&&(W(_e,!1),_e.strm.avail_out===0))return J}else if(_e.match_available){if((ke=s._tr_tally(_e,0,_e.window[_e.strstart-1]))&&W(_e,!1),_e.strstart++,_e.lookahead--,_e.strm.avail_out===0)return J}else _e.match_available=1,_e.strstart++,_e.lookahead--}return _e.match_available&&(ke=s._tr_tally(_e,0,_e.window[_e.strstart-1]),_e.match_available=0),_e.insert=_e.strstart<O-1?_e.strstart:O-1,ve===d?(W(_e,!0),_e.strm.avail_out===0?q:re):_e.last_lit&&(W(_e,!1),_e.strm.avail_out===0)?J:te}function Ae(_e,ve,be,ke,Me){this.good_length=_e,this.max_lazy=ve,this.nice_length=be,this.max_chain=ke,this.func=Me}function Te(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=S,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new f.Buf16(2*N),this.dyn_dtree=new f.Buf16(2*(2*T+1)),this.bl_tree=new f.Buf16(2*(2*D+1)),Z(this.dyn_ltree),Z(this.dyn_dtree),Z(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new f.Buf16(F+1),this.heap=new f.Buf16(2*M+1),Z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new f.Buf16(2*M+1),Z(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ee(_e){var ve;return _e&&_e.state?(_e.total_in=_e.total_out=0,_e.data_type=P,(ve=_e.state).pending=0,ve.pending_out=0,ve.wrap<0&&(ve.wrap=-ve.wrap),ve.status=ve.wrap?ne:ye,_e.adler=ve.wrap===2?0:1,ve.last_flush=v,s._tr_init(ve),u):U(_e,y)}function Be(_e){var ve=Ee(_e);return ve===u&&function(be){be.window_size=2*be.w_size,Z(be.head),be.max_lazy_match=r[be.level].max_lazy,be.good_match=r[be.level].good_length,be.nice_match=r[be.level].nice_length,be.max_chain_length=r[be.level].max_chain,be.strstart=0,be.block_start=0,be.lookahead=0,be.insert=0,be.match_length=be.prev_length=O-1,be.match_available=0,be.ins_h=0}(_e.state),ve}function Ve(_e,ve,be,ke,Me,Le){if(!_e)return y;var Oe=1;if(ve===x&&(ve=6),ke<0?(Oe=0,ke=-ke):15<ke&&(Oe=2,ke-=16),Me<1||E<Me||be!==S||ke<8||15<ke||ve<0||9<ve||Le<0||k<Le)return U(_e,y);ke===8&&(ke=9);var ze=new Te;return(_e.state=ze).strm=_e,ze.wrap=Oe,ze.gzhead=null,ze.w_bits=ke,ze.w_size=1<<ze.w_bits,ze.w_mask=ze.w_size-1,ze.hash_bits=Me+7,ze.hash_size=1<<ze.hash_bits,ze.hash_mask=ze.hash_size-1,ze.hash_shift=~~((ze.hash_bits+O-1)/O),ze.window=new f.Buf8(2*ze.w_size),ze.head=new f.Buf16(ze.hash_size),ze.prev=new f.Buf16(ze.w_size),ze.lit_bufsize=1<<Me+6,ze.pending_buf_size=4*ze.lit_bufsize,ze.pending_buf=new f.Buf8(ze.pending_buf_size),ze.d_buf=1*ze.lit_bufsize,ze.l_buf=3*ze.lit_bufsize,ze.level=ve,ze.strategy=Le,ze.method=be,Be(_e)}r=[new Ae(0,0,0,0,function(_e,ve){var be=65535;for(be>_e.pending_buf_size-5&&(be=_e.pending_buf_size-5);;){if(_e.lookahead<=1){if(Se(_e),_e.lookahead===0&&ve===v)return J;if(_e.lookahead===0)break}_e.strstart+=_e.lookahead,_e.lookahead=0;var ke=_e.block_start+be;if((_e.strstart===0||_e.strstart>=ke)&&(_e.lookahead=_e.strstart-ke,_e.strstart=ke,W(_e,!1),_e.strm.avail_out===0)||_e.strstart-_e.block_start>=_e.w_size-X&&(W(_e,!1),_e.strm.avail_out===0))return J}return _e.insert=0,ve===d?(W(_e,!0),_e.strm.avail_out===0?q:re):(_e.strstart>_e.block_start&&(W(_e,!1),_e.strm.avail_out),J)}),new Ae(4,4,8,4,fe),new Ae(4,5,16,8,fe),new Ae(4,6,32,32,fe),new Ae(4,4,16,16,Pe),new Ae(8,16,32,32,Pe),new Ae(8,16,128,128,Pe),new Ae(8,32,128,256,Pe),new Ae(32,128,258,1024,Pe),new Ae(32,258,258,4096,Pe)],o.deflateInit=function(_e,ve){return Ve(_e,ve,S,15,8,0)},o.deflateInit2=Ve,o.deflateReset=Be,o.deflateResetKeep=Ee,o.deflateSetHeader=function(_e,ve){return _e&&_e.state?_e.state.wrap!==2?y:(_e.state.gzhead=ve,u):y},o.deflate=function(_e,ve){var be,ke,Me,Le;if(!_e||!_e.state||5<ve||ve<0)return _e?U(_e,y):y;if(ke=_e.state,!_e.output||!_e.input&&_e.avail_in!==0||ke.status===666&&ve!==d)return U(_e,_e.avail_out===0?-5:y);if(ke.strm=_e,be=ke.last_flush,ke.last_flush=ve,ke.status===ne)if(ke.wrap===2)_e.adler=0,Q(ke,31),Q(ke,139),Q(ke,8),ke.gzhead?(Q(ke,(ke.gzhead.text?1:0)+(ke.gzhead.hcrc?2:0)+(ke.gzhead.extra?4:0)+(ke.gzhead.name?8:0)+(ke.gzhead.comment?16:0)),Q(ke,255&ke.gzhead.time),Q(ke,ke.gzhead.time>>8&255),Q(ke,ke.gzhead.time>>16&255),Q(ke,ke.gzhead.time>>24&255),Q(ke,ke.level===9?2:2<=ke.strategy||ke.level<2?4:0),Q(ke,255&ke.gzhead.os),ke.gzhead.extra&&ke.gzhead.extra.length&&(Q(ke,255&ke.gzhead.extra.length),Q(ke,ke.gzhead.extra.length>>8&255)),ke.gzhead.hcrc&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending,0)),ke.gzindex=0,ke.status=69):(Q(ke,0),Q(ke,0),Q(ke,0),Q(ke,0),Q(ke,0),Q(ke,ke.level===9?2:2<=ke.strategy||ke.level<2?4:0),Q(ke,3),ke.status=ye);else{var Oe=S+(ke.w_bits-8<<4)<<8;Oe|=(2<=ke.strategy||ke.level<2?0:ke.level<6?1:ke.level===6?2:3)<<6,ke.strstart!==0&&(Oe|=32),Oe+=31-Oe%31,ke.status=ye,oe(ke,Oe),ke.strstart!==0&&(oe(ke,_e.adler>>>16),oe(ke,65535&_e.adler)),_e.adler=1}if(ke.status===69)if(ke.gzhead.extra){for(Me=ke.pending;ke.gzindex<(65535&ke.gzhead.extra.length)&&(ke.pending!==ke.pending_buf_size||(ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),Y(_e),Me=ke.pending,ke.pending!==ke.pending_buf_size));)Q(ke,255&ke.gzhead.extra[ke.gzindex]),ke.gzindex++;ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),ke.gzindex===ke.gzhead.extra.length&&(ke.gzindex=0,ke.status=73)}else ke.status=73;if(ke.status===73)if(ke.gzhead.name){Me=ke.pending;do{if(ke.pending===ke.pending_buf_size&&(ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),Y(_e),Me=ke.pending,ke.pending===ke.pending_buf_size)){Le=1;break}Le=ke.gzindex<ke.gzhead.name.length?255&ke.gzhead.name.charCodeAt(ke.gzindex++):0,Q(ke,Le)}while(Le!==0);ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),Le===0&&(ke.gzindex=0,ke.status=91)}else ke.status=91;if(ke.status===91)if(ke.gzhead.comment){Me=ke.pending;do{if(ke.pending===ke.pending_buf_size&&(ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),Y(_e),Me=ke.pending,ke.pending===ke.pending_buf_size)){Le=1;break}Le=ke.gzindex<ke.gzhead.comment.length?255&ke.gzhead.comment.charCodeAt(ke.gzindex++):0,Q(ke,Le)}while(Le!==0);ke.gzhead.hcrc&&ke.pending>Me&&(_e.adler=w(_e.adler,ke.pending_buf,ke.pending-Me,Me)),Le===0&&(ke.status=103)}else ke.status=103;if(ke.status===103&&(ke.gzhead.hcrc?(ke.pending+2>ke.pending_buf_size&&Y(_e),ke.pending+2<=ke.pending_buf_size&&(Q(ke,255&_e.adler),Q(ke,_e.adler>>8&255),_e.adler=0,ke.status=ye)):ke.status=ye),ke.pending!==0){if(Y(_e),_e.avail_out===0)return ke.last_flush=-1,u}else if(_e.avail_in===0&&H(ve)<=H(be)&&ve!==d)return U(_e,-5);if(ke.status===666&&_e.avail_in!==0)return U(_e,-5);if(_e.avail_in!==0||ke.lookahead!==0||ve!==v&&ke.status!==666){var ze=ke.strategy===2?function(We,Ge){for(var Xe;;){if(We.lookahead===0&&(Se(We),We.lookahead===0)){if(Ge===v)return J;break}if(We.match_length=0,Xe=s._tr_tally(We,0,We.window[We.strstart]),We.lookahead--,We.strstart++,Xe&&(W(We,!1),We.strm.avail_out===0))return J}return We.insert=0,Ge===d?(W(We,!0),We.strm.avail_out===0?q:re):We.last_lit&&(W(We,!1),We.strm.avail_out===0)?J:te}(ke,ve):ke.strategy===3?function(We,Ge){for(var Xe,qe,Ke,Qe,at=We.window;;){if(We.lookahead<=I){if(Se(We),We.lookahead<=I&&Ge===v)return J;if(We.lookahead===0)break}if(We.match_length=0,We.lookahead>=O&&0<We.strstart&&(qe=at[Ke=We.strstart-1])===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]){Qe=We.strstart+I;do;while(qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&qe===at[++Ke]&&Ke<Qe);We.match_length=I-(Qe-Ke),We.match_length>We.lookahead&&(We.match_length=We.lookahead)}if(We.match_length>=O?(Xe=s._tr_tally(We,1,We.match_length-O),We.lookahead-=We.match_length,We.strstart+=We.match_length,We.match_length=0):(Xe=s._tr_tally(We,0,We.window[We.strstart]),We.lookahead--,We.strstart++),Xe&&(W(We,!1),We.strm.avail_out===0))return J}return We.insert=0,Ge===d?(W(We,!0),We.strm.avail_out===0?q:re):We.last_lit&&(W(We,!1),We.strm.avail_out===0)?J:te}(ke,ve):r[ke.level].func(ke,ve);if(ze!==q&&ze!==re||(ke.status=666),ze===J||ze===q)return _e.avail_out===0&&(ke.last_flush=-1),u;if(ze===te&&(ve===1?s._tr_align(ke):ve!==5&&(s._tr_stored_block(ke,0,0,!1),ve===3&&(Z(ke.head),ke.lookahead===0&&(ke.strstart=0,ke.block_start=0,ke.insert=0))),Y(_e),_e.avail_out===0))return ke.last_flush=-1,u}return ve!==d?u:ke.wrap<=0?1:(ke.wrap===2?(Q(ke,255&_e.adler),Q(ke,_e.adler>>8&255),Q(ke,_e.adler>>16&255),Q(ke,_e.adler>>24&255),Q(ke,255&_e.total_in),Q(ke,_e.total_in>>8&255),Q(ke,_e.total_in>>16&255),Q(ke,_e.total_in>>24&255)):(oe(ke,_e.adler>>>16),oe(ke,65535&_e.adler)),Y(_e),0<ke.wrap&&(ke.wrap=-ke.wrap),ke.pending!==0?u:1)},o.deflateEnd=function(_e){var ve;return _e&&_e.state?(ve=_e.state.status)!==ne&&ve!==69&&ve!==73&&ve!==91&&ve!==103&&ve!==ye&&ve!==666?U(_e,y):(_e.state=null,ve===ye?U(_e,-3):u):y},o.deflateSetDictionary=function(_e,ve){var be,ke,Me,Le,Oe,ze,We,Ge,Xe=ve.length;if(!_e||!_e.state||(Le=(be=_e.state).wrap)===2||Le===1&&be.status!==ne||be.lookahead)return y;for(Le===1&&(_e.adler=m(_e.adler,ve,Xe,0)),be.wrap=0,Xe>=be.w_size&&(Le===0&&(Z(be.head),be.strstart=0,be.block_start=0,be.insert=0),Ge=new f.Buf8(be.w_size),f.arraySet(Ge,ve,Xe-be.w_size,be.w_size,0),ve=Ge,Xe=be.w_size),Oe=_e.avail_in,ze=_e.next_in,We=_e.input,_e.avail_in=Xe,_e.next_in=0,_e.input=ve,Se(be);be.lookahead>=O;){for(ke=be.strstart,Me=be.lookahead-(O-1);be.ins_h=(be.ins_h<<be.hash_shift^be.window[ke+O-1])&be.hash_mask,be.prev[ke&be.w_mask]=be.head[be.ins_h],be.head[be.ins_h]=ke,ke++,--Me;);be.strstart=ke,be.lookahead=O-1,Se(be)}return be.strstart+=be.lookahead,be.block_start=be.strstart,be.insert=be.lookahead,be.lookahead=0,be.match_length=be.prev_length=O-1,be.match_available=0,_e.next_in=ze,_e.input=We,_e.avail_in=Oe,be.wrap=Le,u},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,n,o){n.exports=function(){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}},{}],48:[function(e,n,o){n.exports=function(r,f){var s,m,w,g,v,d,u,y,x,k,P,S,E,M,T,D,N,F,O,I,X,ne,ye,J,te;s=r.state,m=r.next_in,J=r.input,w=m+(r.avail_in-5),g=r.next_out,te=r.output,v=g-(f-r.avail_out),d=g+(r.avail_out-257),u=s.dmax,y=s.wsize,x=s.whave,k=s.wnext,P=s.window,S=s.hold,E=s.bits,M=s.lencode,T=s.distcode,D=(1<<s.lenbits)-1,N=(1<<s.distbits)-1;e:do{E<15&&(S+=J[m++]<<E,E+=8,S+=J[m++]<<E,E+=8),F=M[S&D];t:for(;;){if(S>>>=O=F>>>24,E-=O,(O=F>>>16&255)==0)te[g++]=65535&F;else{if(!(16&O)){if(!(64&O)){F=M[(65535&F)+(S&(1<<O)-1)];continue t}if(32&O){s.mode=12;break e}r.msg="invalid literal/length code",s.mode=30;break e}I=65535&F,(O&=15)&&(E<O&&(S+=J[m++]<<E,E+=8),I+=S&(1<<O)-1,S>>>=O,E-=O),E<15&&(S+=J[m++]<<E,E+=8,S+=J[m++]<<E,E+=8),F=T[S&N];n:for(;;){if(S>>>=O=F>>>24,E-=O,!(16&(O=F>>>16&255))){if(!(64&O)){F=T[(65535&F)+(S&(1<<O)-1)];continue n}r.msg="invalid distance code",s.mode=30;break e}if(X=65535&F,E<(O&=15)&&(S+=J[m++]<<E,(E+=8)<O&&(S+=J[m++]<<E,E+=8)),u<(X+=S&(1<<O)-1)){r.msg="invalid distance too far back",s.mode=30;break e}if(S>>>=O,E-=O,(O=g-v)<X){if(x<(O=X-O)&&s.sane){r.msg="invalid distance too far back",s.mode=30;break e}if(ye=P,(ne=0)===k){if(ne+=y-O,O<I){for(I-=O;te[g++]=P[ne++],--O;);ne=g-X,ye=te}}else if(k<O){if(ne+=y+k-O,(O-=k)<I){for(I-=O;te[g++]=P[ne++],--O;);if(ne=0,k<I){for(I-=O=k;te[g++]=P[ne++],--O;);ne=g-X,ye=te}}}else if(ne+=k-O,O<I){for(I-=O;te[g++]=P[ne++],--O;);ne=g-X,ye=te}for(;2<I;)te[g++]=ye[ne++],te[g++]=ye[ne++],te[g++]=ye[ne++],I-=3;I&&(te[g++]=ye[ne++],1<I&&(te[g++]=ye[ne++]))}else{for(ne=g-X;te[g++]=te[ne++],te[g++]=te[ne++],te[g++]=te[ne++],2<(I-=3););I&&(te[g++]=te[ne++],1<I&&(te[g++]=te[ne++]))}break}}break}}while(m<w&&g<d);m-=I=E>>3,S&=(1<<(E-=I<<3))-1,r.next_in=m,r.next_out=g,r.avail_in=m<w?w-m+5:5-(m-w),r.avail_out=g<d?d-g+257:257-(g-d),s.hold=S,s.bits=E}},{}],49:[function(e,n,o){var r=e("../utils/common"),f=e("./adler32"),s=e("./crc32"),m=e("./inffast"),w=e("./inftrees"),g=1,v=2,d=0,u=-2,y=1,x=852,k=592;function P(ne){return(ne>>>24&255)+(ne>>>8&65280)+((65280&ne)<<8)+((255&ne)<<24)}function S(){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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function E(ne){var ye;return ne&&ne.state?(ye=ne.state,ne.total_in=ne.total_out=ye.total=0,ne.msg="",ye.wrap&&(ne.adler=1&ye.wrap),ye.mode=y,ye.last=0,ye.havedict=0,ye.dmax=32768,ye.head=null,ye.hold=0,ye.bits=0,ye.lencode=ye.lendyn=new r.Buf32(x),ye.distcode=ye.distdyn=new r.Buf32(k),ye.sane=1,ye.back=-1,d):u}function M(ne){var ye;return ne&&ne.state?((ye=ne.state).wsize=0,ye.whave=0,ye.wnext=0,E(ne)):u}function T(ne,ye){var J,te;return ne&&ne.state?(te=ne.state,ye<0?(J=0,ye=-ye):(J=1+(ye>>4),ye<48&&(ye&=15)),ye&&(ye<8||15<ye)?u:(te.window!==null&&te.wbits!==ye&&(te.window=null),te.wrap=J,te.wbits=ye,M(ne))):u}function D(ne,ye){var J,te;return ne?(te=new S,(ne.state=te).window=null,(J=T(ne,ye))!==d&&(ne.state=null),J):u}var N,F,O=!0;function I(ne){if(O){var ye;for(N=new r.Buf32(512),F=new r.Buf32(32),ye=0;ye<144;)ne.lens[ye++]=8;for(;ye<256;)ne.lens[ye++]=9;for(;ye<280;)ne.lens[ye++]=7;for(;ye<288;)ne.lens[ye++]=8;for(w(g,ne.lens,0,288,N,0,ne.work,{bits:9}),ye=0;ye<32;)ne.lens[ye++]=5;w(v,ne.lens,0,32,F,0,ne.work,{bits:5}),O=!1}ne.lencode=N,ne.lenbits=9,ne.distcode=F,ne.distbits=5}function X(ne,ye,J,te){var q,re=ne.state;return re.window===null&&(re.wsize=1<<re.wbits,re.wnext=0,re.whave=0,re.window=new r.Buf8(re.wsize)),te>=re.wsize?(r.arraySet(re.window,ye,J-re.wsize,re.wsize,0),re.wnext=0,re.whave=re.wsize):(te<(q=re.wsize-re.wnext)&&(q=te),r.arraySet(re.window,ye,J-te,q,re.wnext),(te-=q)?(r.arraySet(re.window,ye,J-te,te,0),re.wnext=te,re.whave=re.wsize):(re.wnext+=q,re.wnext===re.wsize&&(re.wnext=0),re.whave<re.wsize&&(re.whave+=q))),0}o.inflateReset=M,o.inflateReset2=T,o.inflateResetKeep=E,o.inflateInit=function(ne){return D(ne,15)},o.inflateInit2=D,o.inflate=function(ne,ye){var J,te,q,re,U,H,Z,Y,W,Q,oe,Ce,Se,fe,Pe,Ae,Te,Ee,Be,Ve,_e,ve,be,ke,Me=0,Le=new r.Buf8(4),Oe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ne||!ne.state||!ne.output||!ne.input&&ne.avail_in!==0)return u;(J=ne.state).mode===12&&(J.mode=13),U=ne.next_out,q=ne.output,Z=ne.avail_out,re=ne.next_in,te=ne.input,H=ne.avail_in,Y=J.hold,W=J.bits,Q=H,oe=Z,ve=d;e:for(;;)switch(J.mode){case y:if(J.wrap===0){J.mode=13;break}for(;W<16;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(2&J.wrap&&Y===35615){Le[J.check=0]=255&Y,Le[1]=Y>>>8&255,J.check=s(J.check,Le,2,0),W=Y=0,J.mode=2;break}if(J.flags=0,J.head&&(J.head.done=!1),!(1&J.wrap)||(((255&Y)<<8)+(Y>>8))%31){ne.msg="incorrect header check",J.mode=30;break}if((15&Y)!=8){ne.msg="unknown compression method",J.mode=30;break}if(W-=4,_e=8+(15&(Y>>>=4)),J.wbits===0)J.wbits=_e;else if(_e>J.wbits){ne.msg="invalid window size",J.mode=30;break}J.dmax=1<<_e,ne.adler=J.check=1,J.mode=512&Y?10:12,W=Y=0;break;case 2:for(;W<16;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(J.flags=Y,(255&J.flags)!=8){ne.msg="unknown compression method",J.mode=30;break}if(57344&J.flags){ne.msg="unknown header flags set",J.mode=30;break}J.head&&(J.head.text=Y>>8&1),512&J.flags&&(Le[0]=255&Y,Le[1]=Y>>>8&255,J.check=s(J.check,Le,2,0)),W=Y=0,J.mode=3;case 3:for(;W<32;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.head&&(J.head.time=Y),512&J.flags&&(Le[0]=255&Y,Le[1]=Y>>>8&255,Le[2]=Y>>>16&255,Le[3]=Y>>>24&255,J.check=s(J.check,Le,4,0)),W=Y=0,J.mode=4;case 4:for(;W<16;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.head&&(J.head.xflags=255&Y,J.head.os=Y>>8),512&J.flags&&(Le[0]=255&Y,Le[1]=Y>>>8&255,J.check=s(J.check,Le,2,0)),W=Y=0,J.mode=5;case 5:if(1024&J.flags){for(;W<16;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.length=Y,J.head&&(J.head.extra_len=Y),512&J.flags&&(Le[0]=255&Y,Le[1]=Y>>>8&255,J.check=s(J.check,Le,2,0)),W=Y=0}else J.head&&(J.head.extra=null);J.mode=6;case 6:if(1024&J.flags&&(H<(Ce=J.length)&&(Ce=H),Ce&&(J.head&&(_e=J.head.extra_len-J.length,J.head.extra||(J.head.extra=new Array(J.head.extra_len)),r.arraySet(J.head.extra,te,re,Ce,_e)),512&J.flags&&(J.check=s(J.check,te,Ce,re)),H-=Ce,re+=Ce,J.length-=Ce),J.length))break e;J.length=0,J.mode=7;case 7:if(2048&J.flags){if(H===0)break e;for(Ce=0;_e=te[re+Ce++],J.head&&_e&&J.length<65536&&(J.head.name+=String.fromCharCode(_e)),_e&&Ce<H;);if(512&J.flags&&(J.check=s(J.check,te,Ce,re)),H-=Ce,re+=Ce,_e)break e}else J.head&&(J.head.name=null);J.length=0,J.mode=8;case 8:if(4096&J.flags){if(H===0)break e;for(Ce=0;_e=te[re+Ce++],J.head&&_e&&J.length<65536&&(J.head.comment+=String.fromCharCode(_e)),_e&&Ce<H;);if(512&J.flags&&(J.check=s(J.check,te,Ce,re)),H-=Ce,re+=Ce,_e)break e}else J.head&&(J.head.comment=null);J.mode=9;case 9:if(512&J.flags){for(;W<16;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(Y!==(65535&J.check)){ne.msg="header crc mismatch",J.mode=30;break}W=Y=0}J.head&&(J.head.hcrc=J.flags>>9&1,J.head.done=!0),ne.adler=J.check=0,J.mode=12;break;case 10:for(;W<32;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}ne.adler=J.check=P(Y),W=Y=0,J.mode=11;case 11:if(J.havedict===0)return ne.next_out=U,ne.avail_out=Z,ne.next_in=re,ne.avail_in=H,J.hold=Y,J.bits=W,2;ne.adler=J.check=1,J.mode=12;case 12:if(ye===5||ye===6)break e;case 13:if(J.last){Y>>>=7&W,W-=7&W,J.mode=27;break}for(;W<3;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}switch(J.last=1&Y,W-=1,3&(Y>>>=1)){case 0:J.mode=14;break;case 1:if(I(J),J.mode=20,ye!==6)break;Y>>>=2,W-=2;break e;case 2:J.mode=17;break;case 3:ne.msg="invalid block type",J.mode=30}Y>>>=2,W-=2;break;case 14:for(Y>>>=7&W,W-=7&W;W<32;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if((65535&Y)!=(Y>>>16^65535)){ne.msg="invalid stored block lengths",J.mode=30;break}if(J.length=65535&Y,W=Y=0,J.mode=15,ye===6)break e;case 15:J.mode=16;case 16:if(Ce=J.length){if(H<Ce&&(Ce=H),Z<Ce&&(Ce=Z),Ce===0)break e;r.arraySet(q,te,re,Ce,U),H-=Ce,re+=Ce,Z-=Ce,U+=Ce,J.length-=Ce;break}J.mode=12;break;case 17:for(;W<14;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(J.nlen=257+(31&Y),Y>>>=5,W-=5,J.ndist=1+(31&Y),Y>>>=5,W-=5,J.ncode=4+(15&Y),Y>>>=4,W-=4,286<J.nlen||30<J.ndist){ne.msg="too many length or distance symbols",J.mode=30;break}J.have=0,J.mode=18;case 18:for(;J.have<J.ncode;){for(;W<3;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.lens[Oe[J.have++]]=7&Y,Y>>>=3,W-=3}for(;J.have<19;)J.lens[Oe[J.have++]]=0;if(J.lencode=J.lendyn,J.lenbits=7,be={bits:J.lenbits},ve=w(0,J.lens,0,19,J.lencode,0,J.work,be),J.lenbits=be.bits,ve){ne.msg="invalid code lengths set",J.mode=30;break}J.have=0,J.mode=19;case 19:for(;J.have<J.nlen+J.ndist;){for(;Ae=(Me=J.lencode[Y&(1<<J.lenbits)-1])>>>16&255,Te=65535&Me,!((Pe=Me>>>24)<=W);){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(Te<16)Y>>>=Pe,W-=Pe,J.lens[J.have++]=Te;else{if(Te===16){for(ke=Pe+2;W<ke;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(Y>>>=Pe,W-=Pe,J.have===0){ne.msg="invalid bit length repeat",J.mode=30;break}_e=J.lens[J.have-1],Ce=3+(3&Y),Y>>>=2,W-=2}else if(Te===17){for(ke=Pe+3;W<ke;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}W-=Pe,_e=0,Ce=3+(7&(Y>>>=Pe)),Y>>>=3,W-=3}else{for(ke=Pe+7;W<ke;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}W-=Pe,_e=0,Ce=11+(127&(Y>>>=Pe)),Y>>>=7,W-=7}if(J.have+Ce>J.nlen+J.ndist){ne.msg="invalid bit length repeat",J.mode=30;break}for(;Ce--;)J.lens[J.have++]=_e}}if(J.mode===30)break;if(J.lens[256]===0){ne.msg="invalid code -- missing end-of-block",J.mode=30;break}if(J.lenbits=9,be={bits:J.lenbits},ve=w(g,J.lens,0,J.nlen,J.lencode,0,J.work,be),J.lenbits=be.bits,ve){ne.msg="invalid literal/lengths set",J.mode=30;break}if(J.distbits=6,J.distcode=J.distdyn,be={bits:J.distbits},ve=w(v,J.lens,J.nlen,J.ndist,J.distcode,0,J.work,be),J.distbits=be.bits,ve){ne.msg="invalid distances set",J.mode=30;break}if(J.mode=20,ye===6)break e;case 20:J.mode=21;case 21:if(6<=H&&258<=Z){ne.next_out=U,ne.avail_out=Z,ne.next_in=re,ne.avail_in=H,J.hold=Y,J.bits=W,m(ne,oe),U=ne.next_out,q=ne.output,Z=ne.avail_out,re=ne.next_in,te=ne.input,H=ne.avail_in,Y=J.hold,W=J.bits,J.mode===12&&(J.back=-1);break}for(J.back=0;Ae=(Me=J.lencode[Y&(1<<J.lenbits)-1])>>>16&255,Te=65535&Me,!((Pe=Me>>>24)<=W);){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(Ae&&!(240&Ae)){for(Ee=Pe,Be=Ae,Ve=Te;Ae=(Me=J.lencode[Ve+((Y&(1<<Ee+Be)-1)>>Ee)])>>>16&255,Te=65535&Me,!(Ee+(Pe=Me>>>24)<=W);){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}Y>>>=Ee,W-=Ee,J.back+=Ee}if(Y>>>=Pe,W-=Pe,J.back+=Pe,J.length=Te,Ae===0){J.mode=26;break}if(32&Ae){J.back=-1,J.mode=12;break}if(64&Ae){ne.msg="invalid literal/length code",J.mode=30;break}J.extra=15&Ae,J.mode=22;case 22:if(J.extra){for(ke=J.extra;W<ke;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.length+=Y&(1<<J.extra)-1,Y>>>=J.extra,W-=J.extra,J.back+=J.extra}J.was=J.length,J.mode=23;case 23:for(;Ae=(Me=J.distcode[Y&(1<<J.distbits)-1])>>>16&255,Te=65535&Me,!((Pe=Me>>>24)<=W);){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(!(240&Ae)){for(Ee=Pe,Be=Ae,Ve=Te;Ae=(Me=J.distcode[Ve+((Y&(1<<Ee+Be)-1)>>Ee)])>>>16&255,Te=65535&Me,!(Ee+(Pe=Me>>>24)<=W);){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}Y>>>=Ee,W-=Ee,J.back+=Ee}if(Y>>>=Pe,W-=Pe,J.back+=Pe,64&Ae){ne.msg="invalid distance code",J.mode=30;break}J.offset=Te,J.extra=15&Ae,J.mode=24;case 24:if(J.extra){for(ke=J.extra;W<ke;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}J.offset+=Y&(1<<J.extra)-1,Y>>>=J.extra,W-=J.extra,J.back+=J.extra}if(J.offset>J.dmax){ne.msg="invalid distance too far back",J.mode=30;break}J.mode=25;case 25:if(Z===0)break e;if(Ce=oe-Z,J.offset>Ce){if((Ce=J.offset-Ce)>J.whave&&J.sane){ne.msg="invalid distance too far back",J.mode=30;break}Se=Ce>J.wnext?(Ce-=J.wnext,J.wsize-Ce):J.wnext-Ce,Ce>J.length&&(Ce=J.length),fe=J.window}else fe=q,Se=U-J.offset,Ce=J.length;for(Z<Ce&&(Ce=Z),Z-=Ce,J.length-=Ce;q[U++]=fe[Se++],--Ce;);J.length===0&&(J.mode=21);break;case 26:if(Z===0)break e;q[U++]=J.length,Z--,J.mode=21;break;case 27:if(J.wrap){for(;W<32;){if(H===0)break e;H--,Y|=te[re++]<<W,W+=8}if(oe-=Z,ne.total_out+=oe,J.total+=oe,oe&&(ne.adler=J.check=J.flags?s(J.check,q,oe,U-oe):f(J.check,q,oe,U-oe)),oe=Z,(J.flags?Y:P(Y))!==J.check){ne.msg="incorrect data check",J.mode=30;break}W=Y=0}J.mode=28;case 28:if(J.wrap&&J.flags){for(;W<32;){if(H===0)break e;H--,Y+=te[re++]<<W,W+=8}if(Y!==(4294967295&J.total)){ne.msg="incorrect length check",J.mode=30;break}W=Y=0}J.mode=29;case 29:ve=1;break e;case 30:ve=-3;break e;case 31:return-4;default:return u}return ne.next_out=U,ne.avail_out=Z,ne.next_in=re,ne.avail_in=H,J.hold=Y,J.bits=W,(J.wsize||oe!==ne.avail_out&&J.mode<30&&(J.mode<27||ye!==4))&&X(ne,ne.output,ne.next_out,oe-ne.avail_out)?(J.mode=31,-4):(Q-=ne.avail_in,oe-=ne.avail_out,ne.total_in+=Q,ne.total_out+=oe,J.total+=oe,J.wrap&&oe&&(ne.adler=J.check=J.flags?s(J.check,q,oe,ne.next_out-oe):f(J.check,q,oe,ne.next_out-oe)),ne.data_type=J.bits+(J.last?64:0)+(J.mode===12?128:0)+(J.mode===20||J.mode===15?256:0),(Q==0&&oe===0||ye===4)&&ve===d&&(ve=-5),ve)},o.inflateEnd=function(ne){if(!ne||!ne.state)return u;var ye=ne.state;return ye.window&&(ye.window=null),ne.state=null,d},o.inflateGetHeader=function(ne,ye){var J;return ne&&ne.state&&2&(J=ne.state).wrap?((J.head=ye).done=!1,d):u},o.inflateSetDictionary=function(ne,ye){var J,te=ye.length;return ne&&ne.state?(J=ne.state).wrap!==0&&J.mode!==11?u:J.mode===11&&f(1,ye,te,0)!==J.check?-3:X(ne,ye,te,te)?(J.mode=31,-4):(J.havedict=1,d):u},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,n,o){var r=e("../utils/common"),f=[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],s=[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],m=[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],w=[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];n.exports=function(g,v,d,u,y,x,k,P){var S,E,M,T,D,N,F,O,I,X=P.bits,ne=0,ye=0,J=0,te=0,q=0,re=0,U=0,H=0,Z=0,Y=0,W=null,Q=0,oe=new r.Buf16(16),Ce=new r.Buf16(16),Se=null,fe=0;for(ne=0;ne<=15;ne++)oe[ne]=0;for(ye=0;ye<u;ye++)oe[v[d+ye]]++;for(q=X,te=15;1<=te&&oe[te]===0;te--);if(te<q&&(q=te),te===0)return y[x++]=20971520,y[x++]=20971520,P.bits=1,0;for(J=1;J<te&&oe[J]===0;J++);for(q<J&&(q=J),ne=H=1;ne<=15;ne++)if(H<<=1,(H-=oe[ne])<0)return-1;if(0<H&&(g===0||te!==1))return-1;for(Ce[1]=0,ne=1;ne<15;ne++)Ce[ne+1]=Ce[ne]+oe[ne];for(ye=0;ye<u;ye++)v[d+ye]!==0&&(k[Ce[v[d+ye]]++]=ye);if(N=g===0?(W=Se=k,19):g===1?(W=f,Q-=257,Se=s,fe-=257,256):(W=m,Se=w,-1),ne=J,D=x,U=ye=Y=0,M=-1,T=(Z=1<<(re=q))-1,g===1&&852<Z||g===2&&592<Z)return 1;for(;;){for(F=ne-U,I=k[ye]<N?(O=0,k[ye]):k[ye]>N?(O=Se[fe+k[ye]],W[Q+k[ye]]):(O=96,0),S=1<<ne-U,J=E=1<<re;y[D+(Y>>U)+(E-=S)]=F<<24|O<<16|I,E!==0;);for(S=1<<ne-1;Y&S;)S>>=1;if(S!==0?(Y&=S-1,Y+=S):Y=0,ye++,--oe[ne]==0){if(ne===te)break;ne=v[d+k[ye]]}if(q<ne&&(Y&T)!==M){for(U===0&&(U=q),D+=J,H=1<<(re=ne-U);re+U<te&&!((H-=oe[re+U])<=0);)re++,H<<=1;if(Z+=1<<re,g===1&&852<Z||g===2&&592<Z)return 1;y[M=Y&T]=q<<24|re<<16|D-x}}return Y!==0&&(y[D+Y]=ne-U<<24|64<<16),P.bits=q,0}},{"../utils/common":41}],51:[function(e,n,o){n.exports={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"}},{}],52:[function(e,n,o){var r=e("../utils/common"),f=0,s=1;function m(Me){for(var Le=Me.length;0<=--Le;)Me[Le]=0}var w=0,g=29,v=256,d=v+1+g,u=30,y=19,x=2*d+1,k=15,P=16,S=7,E=256,M=16,T=17,D=18,N=[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],F=[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],O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],X=new Array(2*(d+2));m(X);var ne=new Array(2*u);m(ne);var ye=new Array(512);m(ye);var J=new Array(256);m(J);var te=new Array(g);m(te);var q,re,U,H=new Array(u);function Z(Me,Le,Oe,ze,We){this.static_tree=Me,this.extra_bits=Le,this.extra_base=Oe,this.elems=ze,this.max_length=We,this.has_stree=Me&&Me.length}function Y(Me,Le){this.dyn_tree=Me,this.max_code=0,this.stat_desc=Le}function W(Me){return Me<256?ye[Me]:ye[256+(Me>>>7)]}function Q(Me,Le){Me.pending_buf[Me.pending++]=255&Le,Me.pending_buf[Me.pending++]=Le>>>8&255}function oe(Me,Le,Oe){Me.bi_valid>P-Oe?(Me.bi_buf|=Le<<Me.bi_valid&65535,Q(Me,Me.bi_buf),Me.bi_buf=Le>>P-Me.bi_valid,Me.bi_valid+=Oe-P):(Me.bi_buf|=Le<<Me.bi_valid&65535,Me.bi_valid+=Oe)}function Ce(Me,Le,Oe){oe(Me,Oe[2*Le],Oe[2*Le+1])}function Se(Me,Le){for(var Oe=0;Oe|=1&Me,Me>>>=1,Oe<<=1,0<--Le;);return Oe>>>1}function fe(Me,Le,Oe){var ze,We,Ge=new Array(k+1),Xe=0;for(ze=1;ze<=k;ze++)Ge[ze]=Xe=Xe+Oe[ze-1]<<1;for(We=0;We<=Le;We++){var qe=Me[2*We+1];qe!==0&&(Me[2*We]=Se(Ge[qe]++,qe))}}function Pe(Me){var Le;for(Le=0;Le<d;Le++)Me.dyn_ltree[2*Le]=0;for(Le=0;Le<u;Le++)Me.dyn_dtree[2*Le]=0;for(Le=0;Le<y;Le++)Me.bl_tree[2*Le]=0;Me.dyn_ltree[2*E]=1,Me.opt_len=Me.static_len=0,Me.last_lit=Me.matches=0}function Ae(Me){8<Me.bi_valid?Q(Me,Me.bi_buf):0<Me.bi_valid&&(Me.pending_buf[Me.pending++]=Me.bi_buf),Me.bi_buf=0,Me.bi_valid=0}function Te(Me,Le,Oe,ze){var We=2*Le,Ge=2*Oe;return Me[We]<Me[Ge]||Me[We]===Me[Ge]&&ze[Le]<=ze[Oe]}function Ee(Me,Le,Oe){for(var ze=Me.heap[Oe],We=Oe<<1;We<=Me.heap_len&&(We<Me.heap_len&&Te(Le,Me.heap[We+1],Me.heap[We],Me.depth)&&We++,!Te(Le,ze,Me.heap[We],Me.depth));)Me.heap[Oe]=Me.heap[We],Oe=We,We<<=1;Me.heap[Oe]=ze}function Be(Me,Le,Oe){var ze,We,Ge,Xe,qe=0;if(Me.last_lit!==0)for(;ze=Me.pending_buf[Me.d_buf+2*qe]<<8|Me.pending_buf[Me.d_buf+2*qe+1],We=Me.pending_buf[Me.l_buf+qe],qe++,ze===0?Ce(Me,We,Le):(Ce(Me,(Ge=J[We])+v+1,Le),(Xe=N[Ge])!==0&&oe(Me,We-=te[Ge],Xe),Ce(Me,Ge=W(--ze),Oe),(Xe=F[Ge])!==0&&oe(Me,ze-=H[Ge],Xe)),qe<Me.last_lit;);Ce(Me,E,Le)}function Ve(Me,Le){var Oe,ze,We,Ge=Le.dyn_tree,Xe=Le.stat_desc.static_tree,qe=Le.stat_desc.has_stree,Ke=Le.stat_desc.elems,Qe=-1;for(Me.heap_len=0,Me.heap_max=x,Oe=0;Oe<Ke;Oe++)Ge[2*Oe]!==0?(Me.heap[++Me.heap_len]=Qe=Oe,Me.depth[Oe]=0):Ge[2*Oe+1]=0;for(;Me.heap_len<2;)Ge[2*(We=Me.heap[++Me.heap_len]=Qe<2?++Qe:0)]=1,Me.depth[We]=0,Me.opt_len--,qe&&(Me.static_len-=Xe[2*We+1]);for(Le.max_code=Qe,Oe=Me.heap_len>>1;1<=Oe;Oe--)Ee(Me,Ge,Oe);for(We=Ke;Oe=Me.heap[1],Me.heap[1]=Me.heap[Me.heap_len--],Ee(Me,Ge,1),ze=Me.heap[1],Me.heap[--Me.heap_max]=Oe,Me.heap[--Me.heap_max]=ze,Ge[2*We]=Ge[2*Oe]+Ge[2*ze],Me.depth[We]=(Me.depth[Oe]>=Me.depth[ze]?Me.depth[Oe]:Me.depth[ze])+1,Ge[2*Oe+1]=Ge[2*ze+1]=We,Me.heap[1]=We++,Ee(Me,Ge,1),2<=Me.heap_len;);Me.heap[--Me.heap_max]=Me.heap[1],function(at,ut){var vt,_t,wt,bt,Rt,Fe,$e=ut.dyn_tree,Ie=ut.max_code,Re=ut.stat_desc.static_tree,He=ut.stat_desc.has_stree,je=ut.stat_desc.extra_bits,et=ut.stat_desc.extra_base,tt=ut.stat_desc.max_length,Ye=0;for(bt=0;bt<=k;bt++)at.bl_count[bt]=0;for($e[2*at.heap[at.heap_max]+1]=0,vt=at.heap_max+1;vt<x;vt++)tt<(bt=$e[2*$e[2*(_t=at.heap[vt])+1]+1]+1)&&(bt=tt,Ye++),$e[2*_t+1]=bt,Ie<_t||(at.bl_count[bt]++,Rt=0,et<=_t&&(Rt=je[_t-et]),Fe=$e[2*_t],at.opt_len+=Fe*(bt+Rt),He&&(at.static_len+=Fe*(Re[2*_t+1]+Rt)));if(Ye!==0){do{for(bt=tt-1;at.bl_count[bt]===0;)bt--;at.bl_count[bt]--,at.bl_count[bt+1]+=2,at.bl_count[tt]--,Ye-=2}while(0<Ye);for(bt=tt;bt!==0;bt--)for(_t=at.bl_count[bt];_t!==0;)Ie<(wt=at.heap[--vt])||($e[2*wt+1]!==bt&&(at.opt_len+=(bt-$e[2*wt+1])*$e[2*wt],$e[2*wt+1]=bt),_t--)}}(Me,Le),fe(Ge,Qe,Me.bl_count)}function _e(Me,Le,Oe){var ze,We,Ge=-1,Xe=Le[1],qe=0,Ke=7,Qe=4;for(Xe===0&&(Ke=138,Qe=3),Le[2*(Oe+1)+1]=65535,ze=0;ze<=Oe;ze++)We=Xe,Xe=Le[2*(ze+1)+1],++qe<Ke&&We===Xe||(qe<Qe?Me.bl_tree[2*We]+=qe:We!==0?(We!==Ge&&Me.bl_tree[2*We]++,Me.bl_tree[2*M]++):qe<=10?Me.bl_tree[2*T]++:Me.bl_tree[2*D]++,Ge=We,Qe=(qe=0)===Xe?(Ke=138,3):We===Xe?(Ke=6,3):(Ke=7,4))}function ve(Me,Le,Oe){var ze,We,Ge=-1,Xe=Le[1],qe=0,Ke=7,Qe=4;for(Xe===0&&(Ke=138,Qe=3),ze=0;ze<=Oe;ze++)if(We=Xe,Xe=Le[2*(ze+1)+1],!(++qe<Ke&&We===Xe)){if(qe<Qe)for(;Ce(Me,We,Me.bl_tree),--qe!=0;);else We!==0?(We!==Ge&&(Ce(Me,We,Me.bl_tree),qe--),Ce(Me,M,Me.bl_tree),oe(Me,qe-3,2)):qe<=10?(Ce(Me,T,Me.bl_tree),oe(Me,qe-3,3)):(Ce(Me,D,Me.bl_tree),oe(Me,qe-11,7));Ge=We,Qe=(qe=0)===Xe?(Ke=138,3):We===Xe?(Ke=6,3):(Ke=7,4)}}m(H);var be=!1;function ke(Me,Le,Oe,ze){oe(Me,(w<<1)+(ze?1:0),3),function(We,Ge,Xe,qe){Ae(We),qe&&(Q(We,Xe),Q(We,~Xe)),r.arraySet(We.pending_buf,We.window,Ge,Xe,We.pending),We.pending+=Xe}(Me,Le,Oe,!0)}o._tr_init=function(Me){be||(function(){var Le,Oe,ze,We,Ge,Xe=new Array(k+1);for(We=ze=0;We<g-1;We++)for(te[We]=ze,Le=0;Le<1<<N[We];Le++)J[ze++]=We;for(J[ze-1]=We,We=Ge=0;We<16;We++)for(H[We]=Ge,Le=0;Le<1<<F[We];Le++)ye[Ge++]=We;for(Ge>>=7;We<u;We++)for(H[We]=Ge<<7,Le=0;Le<1<<F[We]-7;Le++)ye[256+Ge++]=We;for(Oe=0;Oe<=k;Oe++)Xe[Oe]=0;for(Le=0;Le<=143;)X[2*Le+1]=8,Le++,Xe[8]++;for(;Le<=255;)X[2*Le+1]=9,Le++,Xe[9]++;for(;Le<=279;)X[2*Le+1]=7,Le++,Xe[7]++;for(;Le<=287;)X[2*Le+1]=8,Le++,Xe[8]++;for(fe(X,d+1,Xe),Le=0;Le<u;Le++)ne[2*Le+1]=5,ne[2*Le]=Se(Le,5);q=new Z(X,N,v+1,d,k),re=new Z(ne,F,0,u,k),U=new Z(new Array(0),O,0,y,S)}(),be=!0),Me.l_desc=new Y(Me.dyn_ltree,q),Me.d_desc=new Y(Me.dyn_dtree,re),Me.bl_desc=new Y(Me.bl_tree,U),Me.bi_buf=0,Me.bi_valid=0,Pe(Me)},o._tr_stored_block=ke,o._tr_flush_block=function(Me,Le,Oe,ze){var We,Ge,Xe=0;0<Me.level?(Me.strm.data_type===2&&(Me.strm.data_type=function(qe){var Ke,Qe=4093624447;for(Ke=0;Ke<=31;Ke++,Qe>>>=1)if(1&Qe&&qe.dyn_ltree[2*Ke]!==0)return f;if(qe.dyn_ltree[18]!==0||qe.dyn_ltree[20]!==0||qe.dyn_ltree[26]!==0)return s;for(Ke=32;Ke<v;Ke++)if(qe.dyn_ltree[2*Ke]!==0)return s;return f}(Me)),Ve(Me,Me.l_desc),Ve(Me,Me.d_desc),Xe=function(qe){var Ke;for(_e(qe,qe.dyn_ltree,qe.l_desc.max_code),_e(qe,qe.dyn_dtree,qe.d_desc.max_code),Ve(qe,qe.bl_desc),Ke=y-1;3<=Ke&&qe.bl_tree[2*I[Ke]+1]===0;Ke--);return qe.opt_len+=3*(Ke+1)+5+5+4,Ke}(Me),We=Me.opt_len+3+7>>>3,(Ge=Me.static_len+3+7>>>3)<=We&&(We=Ge)):We=Ge=Oe+5,Oe+4<=We&&Le!==-1?ke(Me,Le,Oe,ze):Me.strategy===4||Ge===We?(oe(Me,2+(ze?1:0),3),Be(Me,X,ne)):(oe(Me,4+(ze?1:0),3),function(qe,Ke,Qe,at){var ut;for(oe(qe,Ke-257,5),oe(qe,Qe-1,5),oe(qe,at-4,4),ut=0;ut<at;ut++)oe(qe,qe.bl_tree[2*I[ut]+1],3);ve(qe,qe.dyn_ltree,Ke-1),ve(qe,qe.dyn_dtree,Qe-1)}(Me,Me.l_desc.max_code+1,Me.d_desc.max_code+1,Xe+1),Be(Me,Me.dyn_ltree,Me.dyn_dtree)),Pe(Me),ze&&Ae(Me)},o._tr_tally=function(Me,Le,Oe){return Me.pending_buf[Me.d_buf+2*Me.last_lit]=Le>>>8&255,Me.pending_buf[Me.d_buf+2*Me.last_lit+1]=255&Le,Me.pending_buf[Me.l_buf+Me.last_lit]=255&Oe,Me.last_lit++,Le===0?Me.dyn_ltree[2*Oe]++:(Me.matches++,Le--,Me.dyn_ltree[2*(J[Oe]+v+1)]++,Me.dyn_dtree[2*W(Le)]++),Me.last_lit===Me.lit_bufsize-1},o._tr_align=function(Me){oe(Me,2,3),Ce(Me,E,X),function(Le){Le.bi_valid===16?(Q(Le,Le.bi_buf),Le.bi_buf=0,Le.bi_valid=0):8<=Le.bi_valid&&(Le.pending_buf[Le.pending++]=255&Le.bi_buf,Le.bi_buf>>=8,Le.bi_valid-=8)}(Me)}},{"../utils/common":41}],53:[function(e,n,o){n.exports=function(){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}},{}],54:[function(e,n,o){(function(r){(function(f,s){if(!f.setImmediate){var m,w,g,v,d=1,u={},y=!1,x=f.document,k=Object.getPrototypeOf&&Object.getPrototypeOf(f);k=k&&k.setTimeout?k:f,m={}.toString.call(f.process)==="[object process]"?function(M){process.nextTick(function(){S(M)})}:function(){if(f.postMessage&&!f.importScripts){var M=!0,T=f.onmessage;return f.onmessage=function(){M=!1},f.postMessage("","*"),f.onmessage=T,M}}()?(v="setImmediate$"+Math.random()+"$",f.addEventListener?f.addEventListener("message",E,!1):f.attachEvent("onmessage",E),function(M){f.postMessage(v+M,"*")}):f.MessageChannel?((g=new MessageChannel).port1.onmessage=function(M){S(M.data)},function(M){g.port2.postMessage(M)}):x&&"onreadystatechange"in x.createElement("script")?(w=x.documentElement,function(M){var T=x.createElement("script");T.onreadystatechange=function(){S(M),T.onreadystatechange=null,w.removeChild(T),T=null},w.appendChild(T)}):function(M){setTimeout(S,0,M)},k.setImmediate=function(M){typeof M!="function"&&(M=new Function(""+M));for(var T=new Array(arguments.length-1),D=0;D<T.length;D++)T[D]=arguments[D+1];var N={callback:M,args:T};return u[d]=N,m(d),d++},k.clearImmediate=P}function P(M){delete u[M]}function S(M){if(y)setTimeout(S,0,M);else{var T=u[M];if(T){y=!0;try{(function(D){var N=D.callback,F=D.args;switch(F.length){case 0:N();break;case 1:N(F[0]);break;case 2:N(F[0],F[1]);break;case 3:N(F[0],F[1],F[2]);break;default:N.apply(s,F)}})(T)}finally{P(M),y=!1}}}}function E(M){M.source===f&&typeof M.data=="string"&&M.data.indexOf(v)===0&&S(+M.data.slice(v.length))}})(typeof self>"u"?r===void 0?this:r:self)}).call(this,commonjsGlobal$1!==void 0?commonjsGlobal$1:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10);var JSZip=jszip_minExports,Outline=function(){return _createClass(function e(n){_classCallCheck(this,e),this.doc=n.doc,this.messageHandler=n.messageHandler,this.outline=n.outline,this.index=n.index,this.children=n.children||[],this.parent=n.parent},[{key:"pageNumber",get:function(){return this.outline.pageNumber}},{key:"title",get:function(){return this.outline.title}},{key:"level",get:function(){return this.outline.level}},{key:"getOutline",value:function(){return this.outline}}])}(),ContentEditManager=function(){return _createClass(function s(m){_classCallCheck(this,s),this.documentViewer=m,this.editAreaInfoPtr=null,this.selectedEditBox=null},[{key:"startContentEditMode",value:(f=_asyncToGenerator(_regeneratorRuntime().mark(function s(){return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:this.documentViewer.setToolMode("editor");case 1:case"end":return m.stop()}},s,this)})),function(){return f.apply(this,arguments)})},{key:"endContentEditMode",value:(r=_asyncToGenerator(_regeneratorRuntime().mark(function s(){return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:this.documentViewer.setToolMode("view");case 1:case"end":return m.stop()}},s,this)})),function(){return r.apply(this,arguments)})},{key:"getSelectedEditBox",value:function(){return this.selectedEditBox}},{key:"setSelectedEditBox",value:function(s){this.selectedEditBox=s}},{key:"getCopyArea",value:function(){return this.editAreaInfo}},{key:"setCopyArea",value:function(s){this.editAreaInfo=s}},{key:"pasteAreaInPage",value:(o=_asyncToGenerator(_regeneratorRuntime().mark(function s(m,w){var g,v,d,u,y,x,k,P;return _regeneratorRuntime().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(w){S.next=5;break}if(g=this.getCopyArea()){S.next=4;break}return S.abrupt("return");case 4:w={rect:g.rect,editAreaInfoPtr:g.editAreaInfoPtr};case 5:if(v=this.documentViewer,d=m-1,u=v.pdfViewer._pages[d],y=u.contentContainer,x=y&&y.editPagePtr){S.next=15;break}return S.next=13,u.getEditAnnotation();case 13:y=S.sent,x=y.editPagePtr;case 15:return S.next=17,v.messageHandler.sendWithPromise("PasteArea",{pagePtr:v.pagesPtr[d].pagePtr,editPagePtr:x,pageIndex:d,editAreaInfoPtr:w.editAreaInfoPtr,rect:w.rect});case 17:return k=S.sent,S.next=20,y.addEditArea(k);case 20:P=S.sent,y.handleOperateList({editPagePtr:x,editAreaIndex:P.editAreaIndex,editAreaPtr:k,pageIndex:d});case 22:case"end":return S.stop()}},s,this)})),function(s,m){return o.apply(this,arguments)})},{key:"getSelectedText",value:function(s){var m=this.documentViewer;if(s&&(s<1||s>m.pagesCount))return"";var w=m.pdfViewer._pages,g="";if(s)g+=this.getPageSelectedText(s);else for(var v=0;v<w.length;v++)w[v].contentContainer&&(g+=this.getPageSelectedText(v+1));return g}},{key:"getPageSelectedText",value:function(s){if(!s)return"";var m=s-1,w=this.documentViewer.pdfViewer._pages[m].contentContainer;if(!w)return"";for(var g=w.frameEditorList,v="",d=0;d<g.length;d++){var u=g[d];u.type==="text"&&u.selectedCharRange&&(v+=u.selectedText)}return v}},{key:"selectedEditBoxText",value:(n=_asyncToGenerator(_regeneratorRuntime().mark(function s(){var m;return _regeneratorRuntime().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if((m=this.getSelectedEditBox())&&m.type==="text"){w.next=3;break}return w.abrupt("return");case 3:if(w.t0=m.selectedAllText,!w.t0){w.next=7;break}return w.next=7,m.selectedAllText();case 7:case"end":return w.stop()}},s,this)})),function(){return n.apply(this,arguments)})},{key:"getEditBoxSelectedText",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function s(){var m,w;return _regeneratorRuntime().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(m=this.getSelectedEditBox()){g.next=3;break}return g.abrupt("return");case 3:if(m.selectedCharRange){g.next=5;break}return g.abrupt("return","");case 5:return g.next=7,m.getText();case 7:return w=g.sent,g.abrupt("return",w);case 9:case"end":return g.stop()}},s,this)})),function(){return e.apply(this,arguments)})}]);var e,n,o,r,f}();function convertFileToBuffer(e){return new Promise(function(n,o){var r=new FileReader;r.onload=function(){var f=new Uint8Array(r.result);n(f)},r.onerror=function(){o(r.error)},r.readAsArrayBuffer(e)})}var AnnotationManager=function(){return _createClass(function e(n){_classCallCheck(this,e),this.selectedAnnotations=[],this.documentViewer=n,this.annotations=[],this.annotationsType={custom:Shape,highlight:TextHighlightAnnotation,squiggly:TextSquigglyAnnotation,strikeout:TextStrikeoutAnnotation,underline:TextUnderlineAnnotation,line:Line,circle:Circle,square:Shape$1,rectangle:Rectangle,freetext:Freetext$1,stamp:Stamp,text:Text$1,ink:Ink,arc:Arc,polyline:Polyline,polygon:Polygon,redact:Redaction,link:Link,curv:Curve,textfield:TextField,checkbox:CheckBox$1,radiobutton:RadioButton,pushbutton:PushButton,listbox:ListBox,combobox:ComboBox,signatureFields:SignatureFields}},[{key:"getAnnotationsList",value:function(){return this.annotations}},{key:"createAnnotationReply",value:function(e,n){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function o(){var r,f,s;return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return n.author=n.author||this.documentViewer.annotator,n.rect=e.annotation.rect,n.pageIndex=e.pageIndex,!n.name&&(n.name=v4()),m.next=6,this.documentViewer.messageHandler.sendWithPromise("CreateReplyAnnotation",{pagePtr:e.pagePtr,annotPtr:e.annotPtr,replyAnnotation:n});case 6:r=m.sent,n.pagePtr=e.pagePtr,n.annotPtr=r,n.inReplyTo=e.name,n.stateModel||(f=n.state==="MARKED"||n.state==="UNMARKED"?"Marked":"Review",n.stateModel=f),s=new this.annotationsType.text({annotation:n,documentViewer:this.documentViewer}),e.addReply(s);case 13:case"end":return m.stop()}},o,this)}))}},{key:"addAnnotation",value:function(e){this.addAnnotations([e])}},{key:"addAnnotations",value:function(e){if(e){for(var n=[],o=0;o<e.length;o++){var r=e[o];r.pageIndex<0||(this.annotations.push(r),n.push(r))}n.length&&this.documentViewer.eventBus.dispatch("annotationChanged",n,"add")}}},{key:"hasAnnotation",value:function(e){return this.annotations.indexOf(e)>-1}},{key:"isAnnotationSelected",value:function(e){}},{key:"deleteAnnotation",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){return _regeneratorRuntime().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.deleteAnnotations(Array.isArray(e)?e:[e]);case 2:case"end":return o.stop()}},n,this)}))}},{key:"deleteAnnotations",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s,m,w,g,v,d,u=this;return _regeneratorRuntime().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:o=[],r=[],f=0;case 3:if(!(f<e.length)){y.next=40;break}if(s=e[f],m=this.hasAnnotation(s),w=null,!m){y.next=26;break}if(this.documentViewer.annotationStore.selectedElementName&&s.name===this.documentViewer.annotationStore.selectedElementName&&(r.push(s),this.deselectAnnotation(s)),g=this.annotations.splice(this.annotations.indexOf(s),1),o.push(g[0]),s.isDelete||s.handleDelete(),!(v=s.getReplies())){y.next=21;break}return y.next=17,this.documentViewer.messageHandler.sendWithPromise("RemoveFromPageIncludeReplyAnnot",{pagePtr:s.pagePtr,annotPtr:s.annotPtr});case 17:w=y.sent,v.forEach(function(x){u.annotations.splice(u.annotations.indexOf(x),1)}),y.next=24;break;case 21:return y.next=23,this.documentViewer.messageHandler.sendWithPromise("RemoveAnnot",{annotPtr:s.annotPtr});case 23:w=y.sent;case 24:y.next=33;break;case 26:if(!s.isReply()){y.next=33;break}return d=this.getRootAnnotation(s),this.documentViewer.eventBus.dispatch("deleteReply",s),d.deleteReplyAnnotation(s),y.next=32,this.documentViewer.messageHandler.sendWithPromise("RemoveAnnot",{annotPtr:s.annotPtr});case 32:w=y.sent;case 33:if(!w||!w.code){y.next=37;break}return this.documentViewer.eventBus.dispatch("message",{type:"ERROR",message:w.message}),console.log(w.message),y.abrupt("return");case 37:f++,y.next=3;break;case 40:0<o.length&&this.documentViewer.eventBus.dispatch("annotationChanged",o,"delete"),0<r.length&&this.documentViewer.eventBus.dispatch("annotationSelected",r,"deselected");case 42:case"end":return y.stop()}},n,this)}))}},{key:"getRootAnnotation",value:function(e){return e.isReply()?this.getAnnotationById(e.inReplyTo):e}},{key:"getAnnotationById",value:function(e,n){if(n=n||this.annotations,!e)return null;for(var o=0;o<n.length;o++)if(n[o].name===e)return n[o];return null}},{key:"selectAnnotation",value:function(e){if(e){var n=this.documentViewer.annotationStore.selectedElementName;if(n){var o=this.getAnnotationById(n);o.handleOutside&&o.handleOutside()}this.hasAnnotation(e)&&e.selectAnnotation()}}},{key:"deselectAnnotation",value:function(e){if(e){var n=this.documentViewer.annotationStore.selectedElementName;if(n&&e.name===n){var o=this.getAnnotationById(e.name);o.handleOutside&&o.handleOutside()}}}},{key:"getSelectedAnnotation",value:function(){var e=this.documentViewer.annotationStore.selectedElementName;return e?this.getAnnotationById(e):null}},{key:"setAnnotationStyles",value:function(e,n){Object.keys(n).forEach(function(o){e[o]=n[o]})}},{key:"getCurrentUser",value:function(){return this.author}},{key:"setCurrentUser",value:function(e){this.author}},{key:"createAnnotation",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f;return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.documentViewer.annotationHistory.push(e),!(Number(e.pageIndex)+1>this.documentViewer.pagesCount)){s.next=3;break}return s.abrupt("return");case 3:return!e.author&&(e.author=this.documentViewer.annotator),!e.date&&(e.date=new Date),!e.name&&(e.name=v4()),o=this.documentViewer.pagesPtr[e.pageIndex].pagePtr,s.next=9,this.documentViewer.messageHandler.sendWithPromise("CreateAnnotation",{doc:this.documentViewer.doc,pagePtr:o,annotation:e});case 9:if(!(r=s.sent)||!r.code){s.next=14;break}return this.documentViewer.eventBus.dispatch("message",{type:"ERROR",message:r.message}),console.log(r.message),s.abrupt("return",r);case 14:return f=r.annotPtr,e.doc=this.documentViewer.doc,e.pagePtr=o,e.annotPtr=f,s.abrupt("return",e);case 19:case"end":return s.stop()}},n,this)}))}},{key:"createMeasurementAnnotation",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){var o,r,f,s;return _regeneratorRuntime().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(this.documentViewer.annotationHistory.push(e),!(Number(e.pageIndex)+1>this.documentViewer.pagesCount)){m.next=3;break}return m.abrupt("return");case 3:return!e.operate&&(e.operate="add-annot"),!e.author&&(e.author=this.documentViewer.annotator),!e.date&&(e.date=new Date),o=this.documentViewer.pagesPtr[e.pageIndex].pagePtr,m.next=9,this.documentViewer.messageHandler.sendWithPromise("CreateMeasurementAnnotation",{doc:this.documentViewer.doc,pagePtr:o,annotation:e});case 9:if(!(r=m.sent)||!r.code){m.next=14;break}return this.documentViewer.eventBus.dispatch("message",{type:"ERROR",message:r.message}),console.log(r.message),m.abrupt("return",r);case 14:return f=r.annotPtr,s=r.rulerPtr,e.doc=this.documentViewer.doc,e.pagePtr=o,e.annotPtr=f,e.rulerPtr=s,m.abrupt("return",e);case 20:case"end":return m.stop()}},n,this)}))}},{key:"editMeasurementAnnotation",value:function(e){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark(function n(){return _regeneratorRuntime().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(e){o.next=2;break}return o.abrupt("return");case 2:return o.next=4,this.documentViewer.messageHandler.sendWithPromise("EditMeasurementAnnotation",{doc:this.documentViewer.doc,annotation:e});case 4:this.documentViewer.eventBus.dispatch("annotationUpdated",{annotations:this.documentViewer.annotations});case 5:case"end":return o.stop()}},n,this)}))}},{key:"drawAnnotations",value:function(e){var n=e.pageNumber;this.getAnnotationsList().filter(function(o){return o.PageNumber===n}).forEach(function(o){o.draw()})}},{key:"drawAnnotationsFromList",value:function(e){Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++)e[n].draw()}},{key:"pushAnnotationToLayer",value:function(e){var n,o;if(this.addAnnotation(e),this.documentViewer.pdfViewer){var r=(o=(n=this.documentViewer.pdfViewer)===null||n===void 0?void 0:n._pages)===null||o===void 0?void 0:o[e.annotation.pageIndex];r&&r.compdfAnnotationLayer&&r.compdfAnnotationLayer.annotationsArray.push(e)}}},{key:"reset",value:function(){this.annotations=[],this.selectedAnnotations=[]}}])}();pdfExports.GlobalWorkerOptions.workerSrc="./lib/pdf.worker.min.js";var CMAP_URL="./cmaps/";function onKeyDown(e){if(this._isCtrlKeyDown=e.key==="Control",e.target.tagName!=="INPUT"&&e.target.tagName!=="TEXTAREA"){var n=e.keyCode||e.which;if(n===8||n===46){var o=annotationStore.selectedElementName;o&&this.deleteAnnotations({name:o})}else if(n===27){var r=annotationStore.selectedElementName;r&&this.deselectAnnotation({name:r})}}}function onKeyUp(e){e.key==="Control"&&(this._isCtrlKeyDown=!1)}function onWheel(e){if(this._isCtrlKeyDown){var n={x:e.clientX,y:e.clientY};if(e.preventDefault(),document.visibilityState!=="hidden"){var o=normalizeWheelEventDirection(e),r=e.deltaMode,f=0;r===WheelEvent.DOM_DELTA_LINE||r===WheelEvent.DOM_DELTA_PAGE?f=Math.abs(o)>=1?Math.sign(o):this._accumulateTicks(o):f=this._accumulateTicks(o/30),this.updateZoom(f,null,n)}}}var ComPDFKitViewer=function(){return _createClass(function Fe($e){_classCallCheck(this,Fe),_defineProperty$1(this,"_pwd",""),_defineProperty$1(this,"_oldPwd",""),_defineProperty$1(this,"_textSearch",null),_defineProperty$1(this,"_activeSearchIndex",0),_defineProperty$1(this,"_fileList",null),_defineProperty$1(this,"_version","2.7.6"),_defineProperty$1(this,"_wheelUnusedTicks",0),this.config=$e,this.annotationStore=annotationStore,this.viewerContainer=null,this.pdfLoadingTask=null,this.printService=null,this.pdfSidebar=null,this.pdfOutlineViewer=null,this.outlines=[],this.pdfLayerViewer=null,this.pdfDocument=null,this.downloadComplete=!1,this.isInitialViewSet=!1,this.pdfLinkService=null,this.externalServices=GenericExternalServices,this.percent=0,this.pageChangedCallback=null,this.scaleChangedCallback=null,this.annotationsNumChangedCallback=null,this.distanceChangedCallback=null,this.permissionPasswordCallback=null,this.verified=!1,this.isFillConsecutively=!1,this._license="",this._token=null,this._pdfId=null,this.annotations=null,this.annotationHistory=[],this._annotationMode=0,this._boundEvents=Object.create(null),this._title=document.title,this.activeTool="",this.color="color",this.pagesPtr=[],this.saveAction=null,this.enableReply=!0,this.isAnnotationPopup=!0,this.enableDefaultFont=!1,this.annotationPermission=!1,this.enableCustomFont=!1,this.fontsJson=null,this._permission={allowsPrinting:!0,allowsCopying:!0,allowsDocumentChanges:!0},this.webFontURL="https://www.compdf.com/fonts/",this.optionUrl={baseUrl:"https://wms.compdf.com",verifyUrl:"/api/license/verify/v2",webviewBaseUrl:"https://web-viewer-backend.compdf.com",uploadUrl:"/web-viewer/annotate/openPdfToAnnotate",editUrl:"/web-viewer/annotate/edit",saveUrl:"/web-viewer/annotate/save",flattenUrl:"/web-viewer/annotate/saveAndFlatten",uploadAnnotationsUrl:"/web-viewer/annotate/importAnnotateToPdf",downloadAnnotation:"/web-viewer/annotate/exportAnnotate",compareUrl:"/web-viewer/annotate/pdfCompare"},this.eventBus=new EventBus,this.toolMode="",this.$t=$e.$t,this.fontFileInited=!1,this.contentEditAnnotationsManager={},this.initWorker(),this.annotator="Guest",this.isAnnotationModified=!1,this.isContentEditModyfied=!1,this.redactionList=[],this.layers=[],this.ocgsPtr=null,this.isRenderAnnotations=!1,this.colorList=[],this.renderLayerPermission=!1,this.queue=[],this.isProcessing=!1},[{key:"enqueue",value:function(Fe){var $e=this;return new Promise(function(Ie,Re){var He=function(){var je=_asyncToGenerator(_regeneratorRuntime().mark(function et(){var tt;return _regeneratorRuntime().wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return Ye.prev=0,Ye.next=3,Fe();case 3:tt=Ye.sent,Ie(tt),Ye.next=10;break;case 7:Ye.prev=7,Ye.t0=Ye.catch(0),Re(Ye.t0);case 10:case"end":return Ye.stop()}},et,null,[[0,7]])}));return function(){return je.apply(this,arguments)}}();$e.queue.push(He),$e.processQueue()})}},{key:"_accumulateTicks",value:function(Fe){(this._wheelUnusedTicks>0&&Fe<0||this._wheelUnusedTicks<0&&Fe>0)&&(this._wheelUnusedTicks=0),this._wheelUnusedTicks+=Fe;var $e=Math.trunc(this._wheelUnusedTicks);return this._wheelUnusedTicks-=$e,$e}},{key:"processQueue",value:(Rt=_asyncToGenerator(_regeneratorRuntime().mark(function Fe(){var $e;return _regeneratorRuntime().wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:if(!this.isProcessing&&this.queue.length!==0){Ie.next=2;break}return Ie.abrupt("return");case 2:return this.isProcessing=!0,$e=this.queue.shift(),Ie.prev=4,Ie.next=7,$e();case 7:return Ie.prev=7,this.isProcessing=!1,this.processQueue(),Ie.finish(7);case 11:case"end":return Ie.stop()}},Fe,this,[[4,,7,11]])})),function(){return Rt.apply(this,arguments)})},{key:"pagesCount",get:function(){return this.doc?this._pagesCount:0}},{key:"annotationsCount",get:function(){return this.pdfViewer.annotationStorage?this.pdfViewer.annotationStorage.size:0}},{key:"page",get:function(){return this.pdfViewer.currentPageNumber},set:function(Fe){this.pdfViewer.currentPageNumber=Fe}},{key:"currentPageNumber",get:function(){return this.pdfViewer.currentPageNumber}},{key:"scale",get:function(){return this.pdfViewer.currentScale}},{key:"isDocumentModified",get:function(){return this.isAnnotationModified||this.isContentEditModyfied}},{key:"pagesRotation",get:function(){return this.pdfViewer.pagesRotation}},{key:"getPageWidth",value:function(Fe){return this.pagesPtr[Fe-1].width}},{key:"getPageHeight",value:function(Fe){return this.pagesPtr[Fe-1].height}},{key:"initWorker",value:function(){var Fe=new PDFWorker;this.worker=Fe;var $e=Fe.messageHandler;this.messageHandler=$e}},{key:"_decrypt",value:function(Fe){var $e=new JSEncrypt;$e.setPrivateKey(`MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCb9LJZzBAOR3YDT0/rLqY1pCu6
2195
2195
  ge7lb0aU4k/aTnxSz10t/JUUtGMvQ2tBy36hjwulouM6xoFSm8gnjovALuVpTltRPPEfN+uX6AVy
2196
2196
  Wa58TsS2+Q9JRPHJlOb4sDEriUnzLtonahqF/S/EiijMAkNc2b1KNNUb2bDNmLi6YvT7d1sh3iIf
2197
2197
  kTggsyt3UVUjh2exEVpb8Ww4grmLJjFssi5nZksLDhlA0MUr4dPmIcDl0RlIwHTsxrJbewnX7kNd
@@ -2689,7 +2689,7 @@ ${f("signatures.appearance.date")}: ${I}`,ne=await core.getSignature({rect:{widt
2689
2689
  `),I.reason&&(Pe+=H("reason")+`
2690
2690
  `),I.dName&&(Pe+=H("dName")+`
2691
2691
  `),I.version&&(Pe+=H("version")+`
2692
- `),I.location&&(Pe+=H("location")),Pe},U=async Pe=>{const Ae=Z(Pe);Ae.rect={width:582,height:187,top:0,left:0,right:582,bottom:187};const Te=await core.getSignature(Ae);f.setDigitalSignaturePreview(Te)},H=Pe=>{let Ae={};switch(Pe){case"name":Ae.title=r("signatures.appearance.name"),Ae.value=S.value.CN;break;case"date":const Te=new Date,Ee=Te.getFullYear(),Be=Te.getMonth()+1<10?`0${Te.getMonth()+1}`:Te.getMonth()+1,Ve=Te.getDate()<10?`0${Te.getDate()}`:Te.getDate(),_e=Te.getHours()<10?`0${Te.getHours()}`:Te.getHours(),ve=Te.getMinutes()<10?`0${Te.getMinutes()}`:Te.getMinutes(),be=Te.getSeconds()<10?`0${Te.getSeconds()}`:Te.getSeconds(),ke=`${Ee}.${Be}.${Ve} ${_e}:${ve}:${be}`;Ae.title=r("signatures.appearance.date"),Ae.value=ke;break;case"reason":Ae.title=r("signatures.appearance.reason"),Ae.value=I.reasonText;break;case"dName":const Le=["CN","O","OU","email","L","ST","C"].map(Oe=>`${Oe}=${S.value[Oe]}`).join(",");Ae.title=r("signatures.appearance.distinguishableName"),Ae.value=Le;break;case"version":Ae.title=r("signatures.appearance.version"),Ae.value="2.7.5";break;case"location":Ae.title=r("signatures.appearance.location"),Ae.value=I.locationText;break}return I.labels?`${Ae.title}: ${Ae.value}`:Ae.value},Z=Pe=>{const Ae={content:Pe,isContentAlginLeft:I.alignment!=="left"};return v.value!=="keyboard"?Ae.text="":Ae.text=D.value,(v.value==="image"||v.value==="trackpad")&&(Ae.imageBase64=N.value),I.logo&&(Ae.isDrowLogo=!0,Ae.logoBase64="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAEYCAYAAACHjumMAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA9kSURBVHgB7d1vbJXlGcfx635KpUWqJWgiZGgxg2ZG52k1pmqmJdYl6kZwW8S5F4hlKvGFmG3RZWYU4wuX7QUsMdpsSn3j3LJMo3FLJobqMmMWpDUuS4BkdpKAyWAFi4JAz737Oj2Hlv45PX+e+/x57u8nOZ4/Lbw4nvPjuq77fp7HSAy67x9tPSWyzhhJpSNzhbGSsmJa3fNWAeqBtSNiZMSk7YfWyLCkZfD9gSUjgrIYKVEmVKLoUTG22/013QIkjBE7bK3dQdiUruiAyQWLFdlChYJgWBmQdHobQVOcogKm64HjWwkWBM1K3/svXrxNUJCCAqbr/tE20xC96sIlJUDorIy4amYN1cz8ovl+oav3sw02ioYIFyDLSJttiIZu7B1dJ8grb8BoS+TieoCWCDifK/1brUSvTnxHMJc5W6TMG2ekTwDkx1xmTrMGjJZ+ms4CoEDm/vdfuOglwXlmBIwOdHXmQlsEFM7NKI+Z8XQHg9/zzZzBRNFuwgUojs5kdKVVcJ7zAiY7d2kTAEXTldauB0b7BOeca5G0NZKG6GMBUDJtlZrH0ysHB5YcE0ypYFgxAsqmrdKpSLYIMjIVDNULEB+qmElR9r/dAiAWVDGTMgFjTPSoAIiPabhVIIb2CPCjaTy9JPQ2KaI9AvxwbVLwB0NGenpLARA7vlsuYGxkrhUAsUtHUZsELnJraisFQOxcBRP8P96RW0K6QgDEznJM3/xntANQGt0PI4EjYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANAQPAmwUCFGjZUiOXXRLJMr0tjTLPFy8y0uJu+ppa3DzxHBM6v/+8lTpgjYyIdbe0fOieDcu4DA7fsXlEykTAYAYNiK+uiGTVigZZ7e5XX94gl7lAITiSy1hpc3dtrqfpds8yvU1qV/+wpNM7ygkbAgaZ4PhGxwIXJg1yi7vX6gQwYlMSmZ0TYfP8gJyx24oNGtPVe7wuSjjEq6O9QW7taJROd6+VCvzofLtfksQa0zd820PbCv19AiYguVC586ZG2p0KSVrAZI3YM3ZNIdUMLVLCESrwoM00ypCb0Wwc7nnotXy/SMAkkAbJHS5QbnXzlM52/hfDB9PqZjSvpt7uz9sy8elLEA2We3oaZX3PQqoVVISxts+FjMwVMgRMAugelN61C+UuV7UAlZYJmV39I65demn6z1iPrGMaLM/+ZJH86ZnFhAuqykh6e+ovz7VNf50Kpg5RsaD2uJlMo3nVPeiY+ioVTB3RuUrv2gvkpZ9fSLigBtlU6q3n+qa+QsDUCd1h+9LWC2XT2iYGuKhZxsijqd07W3PPaZFqnLZDT25sYrkZdcK0ytlTW9yDPn1GBVPD1vdMtEOEC+rJ1CqGT24NompBfZusYvgE1xitWnSFiDkL6pkx5la9J2BqRG6FSHfhAgnQrW0SAVMDchvmOA8LEuXMqXUETJXp8vOTG5tpiZA8kUkRMFW0aa3OW5oESCJjbRsBUyVb7l3IvAXJZsy1BEyFaSv0zCPNLEEjAJYhbyXpMPcXLlw4By7CYAiYSmGlCCHi014BhAtCxSfeM8IFIeNT7xHhgtDxyfdEV4t0oEu4IGR8+j352cYmVosQPALGA91Epxc7A0JHwMRsE0dEA+cQMDHSAxc5tgiYRMDEZOIsdM0CYBIBEwNdMdLlaE65AJyPgImBnomO5WhgJr4VZbrz5kaGusAcCJgy6Nxly3qGusBcCJgy6KVFmLsAcyNgSqT7XThpFJAfAVMCbY3uYe4CzIuAKQEXRgMKQ8AUSVeN7rqJ44yAQhAwRdCqZdNaWiOgUARMEdb3NLKhDigC35YC6WCXAxmB4hAwBeqlNQKKRsAUQKsXBrtA8QiYAlC9AKUhYOZB9QKUjoCZB9ULUDoCJg+qF6A8BEweVC9AeQiYPDrbua4RUA4CZg56zBG7doHy8A2aw709FwiA8nDGpFmsXtHAZV8LdPjUmOz53yHZd+Jo5vEhdxs7czpzDxAws7jndqqXfD4YPSS7/zsig+5GkCAfAmYWDHdnGjv7pbx88J/y8icfZR4DhSBgptFwYbg7iWBBOQiYae68mfYoR0Ol/+MPCBaUjICZhvZIMnOVvn8Nyh43awHKQcBMQXtE1YJ4ETBT3NIR9nFHvzrwXiZggLgQMFOE3B5tdS3RG4f3CRAnAiZLj5wOdXPdvf/4o+wfOypA3FiPzVq1Isy3QisXwgW+EDBZIc5f+v+9h7YIXhEwWasDq2Byq0WATwSMTFyxMaT5i+5zIVxQCQSMhDd/+eHeN9jngoogYESCql5edzOXwyc5AhqVQcCI7n8JY7We1giVRsCI7oExEoKXD35E9YKKImAkjBZJq5c3Du0XoJKCDxjdwRsCPTKawS4qjYBZGkZ7xOwF1RB8wFx2SfLbIz2HLrMXVAMVTAAVzOuHmb2gOgiYAGYwe45xZjpUR/AB09Kc7ApGV49oj1AtwQfM4kWSaPvHjghQLVQwi5JdwezjXC+oIiqYRcl+C/SSrkC1EDDNkmiHubQrqogWKeEt0mdnTgtQLRyLlHBUMKgmAgaANwQMAG8IGADeEDAJt6ypRYBqCT5gxr6wkmQXNV4gQLUEHzAnTkqiUcGgmmiREm45AYMqCj5gDh8ZlyRbvXipANVCi/SFJNr1S5YLUC0MeU8me8i7vLmFOQyqhhbpSFqSbs2lbQJUAwFzNNkVjOomYFAlwQfMpwkf8iqdw7QsWChApVHBBFDBqPtWXC1ApREwbgaT9N286r7Lr6GKQcWx0c759GjyB70aLlQxqDQCxtl/MPkBo6hiUGkEjHPgk+QPepWGy4MrOwWoFALGOXAwjIBRP7j863Jd6zIBKoGAEQ2YMFqknG1XraFVQkUQMDJxTphQlquVHj5Aq4RKIGCy3h06IyHRVum+FdcI4BMBkxXKStJUP159k3xrWbsAvhAwWX8LrILJeeqqblndwjlj4AcBk6VzmJBWk6Z65YbvUcnACwJmir37wgwYpZXMgyuvEyBOBMwUoQ16p3v4yuvlR6tuZAkbsSFgptAKJoQDH/PR1aXf3fBdzoKHWBAw0/z5vbCrGKX7ZN68+T7p+1o3QYOyEDDThN4mTbV2ebv8pvPbmf0ytE0ohenqPR52TzCLv/66RVoWGcGkQyfHZM/oIen/+AM5fGpMgEI0fKXzp32C8yy9OJKrr2wQTGppXCjtLZe4Gc01cl32UihjZ0/LCXcD5rJAMIO2Set7uKbzXPQcv7nrLWlls+/EEdk/dtTdH8081+ChyoEiYGahq0l7952VznbenvnoQFhvay5dKZip8+1+CRlD3jm8O3RWAJSHgJmDLleHvicGKBcBMwcNlz/sYoAJlIOAyeP3BAxQFgImD61i3mRnL1AyAmYeL7z+pQAoDQEzD73yoy5ZAygeAVOAp3eeEgDFI2AKoFUMsxigeARMgXQWw74YoDgETIG0imFfDFAcAqYIui/m8NHwLm8ClIqAKYK2SNtfYeALFIqAKZIeBMmyNVAYAqYEumzNwBeYHwFTAh34vsgOX2BeBEyJXnEDX1olID8Cpgy0SkB+BEwZaJWA/AiYMmmrxHljgNkRMDHQwwjYgAfMRMDEQOcwj/zyC+YxwDQETEx0HvP0zpMCYBIBEyPd5csZ8IBJBEzMfusChqEvMIGA8UAPiGQTHkDAePPEsyflwMFxAUJGwHiiK0qPu5Bh+RohI2A80pUlXb4mZBAqAsYzQgYhI2AqgJBBqAiYCsmFDINfhCSyIscEFZELmXeGuMYSwhAZa48LKkZXl3QJm814CEFkjB0WVJxuxuOwAiRdJGkZEVSFHlbw+LMchY3kiqwRKpgq0gMkNzz1OStMSKSoKS2vCapKh78btn3OXAaJEw0OLHGrSGZQUFW5q0bqOWVomZAUE/tg7Pg7gprw5t/PZFomjsZGEmQCxrVJ29kPUzty+2V0lYlqBvUsEzDaJhmb3iGoKbrKpNXMm++xMQ/16dyhAlQxtSlzrt8XT2ZmM6w0od6cCxiqmNqWmc24lSY256GemOkv3Nh7fMhVMilBzVp2SSS9axfKXTc1Cmpb59v9ErIZR1PbxvTdtEq1Ldc2feeJE8xnUNPMbC92PTB6v5hop6AuUNHUrtArGDPXD7o2He8TK1sFdSMXNJ3tDbJsKaf6qQUETB6ETP266+ZGWd+zUFatIGiqiYCZx429o+vSEu10v9gqqDurVjTI+tsvoKqpEgKmAF0Pj7bJmWi3e9gmqFud7QvkTlfZEDaVQ8AUgZYpOTRsbulYkLmnjfKHgClStprpcw83CBJBh8PaSmngrHb3BE58CJgSZYLmtHS7v2KLGHOtIDFaFplM4GjQdLgKZ3kmgAidUhAwMciFjTFRylqru4DbXOhcIUgUndtotXOZuy1bajLPF7swasne9PHi5omAwgQCJnAdu57nfAiAJ9S9ALwhYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANASP2mADwgoAROS4AfBgJPmCsNcMCIH7W/ocKxsiIAIidNWaYgDGWCgbwwX23CJio6TUBEL9IBoMPmOE1G3UVaVAAxGl4eM1mhrzKWvuOAIiNNXaH3hMwakHTdvbDADGKJroCAkYm2iRrZYcAKJsxMqDtkT4mYHKoYoBYpCO7LfeYgMmiigHKZ6zdlqteMs8F5+nY1T/kKpmUACiOkZGh2x5eOfUlKphpbEP6bloloEjGHrORXTP9ZQJmGi3vrJHHBEDBrI02Tm2NcgiYWQzftnlAe0kBMK/M3KXnoVl3xDODyaPzref6rDFbBcCsNFz23r65b86fC/JK7epfZyS9071VrQJggpu5mHF5bO83Nw/k/TXBvFK7n2szabNbrLQJEDwzrIshs81cZvymoGC0TAiaVi1p2ZGvJZrxRwRFyVQz49Ln3roNAoQgGyzpBU3bs2cfKPyPCkqiQSNp6TbWbHFPrxUgaax9xwXEYCnBkkPAxCAXNpE1KWttyr2rbe6tvUKAeuAqFDdfPO5uw8aYkbSe5TFqeq3UUJnq/zPmsRQ9GquGAAAAAElFTkSuQmCC"),v.value==="none"&&(Ae.isDrawOnlyContent=!0),Ae},Y=async Pe=>{if(!(Pe===v.value&&["image","none"].includes(Pe))){if(core.handleSign({flag:"create",type:1}),f.setActiveSignWay(Pe),Pe==="trackpad"&&f.openElement("digitalSignCreatePanel"),Pe==="keyboard"){f.openElement("digitalKeyboardCreatePanel"),await nextTick();const Ae=document.querySelector(".digital-signature-dialog .keyboard-paint input");Ae.select(),Ae.focus()}Q()}},W=Pe=>{f.closeElement(dialogName$2),v.value!=="trackpad"&&Q(),core.handleSign({flag:"reset"}),document.body.style.overflow="",!d.value&&Pe==="cancel"&&k.value&&P.value&&f.openElement("selectSignTypeDialog"),f.setActiveSignWay("keyboard"),Object.assign(I,{name:!0,dName:!1,date:!0,version:!1,logo:!0,location:!1,reason:!1,labels:!0,alignment:"left",reasonText:r("signatures.none"),locationText:""})},Q=async()=>{N.value="",v.value==="trackpad"&&core.handleSign({flag:"clear"});const Pe=re();await U(Pe)},oe=()=>{M.value.click()},Ce=async Pe=>{let Ae=Pe.target.files[0];if(Ae.size>1024*1024){window.$message.error(r("signatures.uploadError"),{duration:5e3,icon:()=>h$1("img",{src:MessageError})}),Pe.target.value="";return}const Te=new FileReader,Be=await new Promise((_e,ve)=>{Te.addEventListener("load",async be=>{_e(be.target.result)}),Te.addEventListener("error",()=>{ve("Error reading the local image")}),Te.readAsDataURL(Ae)});N.value=Be;const Ve=re();await U(Ve)},Se=async()=>{f.setCommonLoading(!0);const Pe=re(),Ae=Z(Pe),Te=s.getPkcs12;await core.handleSign({type:1,flag:"save",param:{annotation:toRaw(f.getSelectedSignatureField),...Ae},pkcs12Buffer:Te.pkcs12Buffer,password:Te.password}),W(),f.setCommonLoading(!1),O.value&&T.value.length<5&&f.addDigitalSignature(u.value)},fe=()=>{v.value==="keyboard"&&Y("keyboard"),v.value==="trackpad"&&Y("trackpad")};return(Pe,Ae)=>{const Te=__unplugin_components_0$w,Ee=__unplugin_components_1$d,Be=__unplugin_components_2$e,Ve=__unplugin_components_14$3,_e=_sfc_main$4m,ve=__unplugin_components_1$f,be=__unplugin_components_6$a,ke=__unplugin_components_7$9,Me=__unplugin_components_0$s,Le=_sfc_main$4f,Oe=_sfc_main$1T,ze=_sfc_main$1U,We=__unplugin_components_2$f;return openBlock(),createElementBlock(Fragment,null,[g.value?(openBlock(),createElementBlock("div",_hoisted_1$1z,[createVNode(Le,{show:g.value,dialogName:dialogName$2,class:"appearance-dialog"},createSlots({header:withCtx(()=>[createBaseVNode("p",null,toDisplayString(unref(r)("signatures.appearance.title")),1),createVNode(Te,{class:"close",onClick:W})]),default:withCtx(()=>[createBaseVNode("div",_hoisted_2$1q,[createBaseVNode("div",_hoisted_3$1f,[createBaseVNode("div",{onClick:Ae[0]||(Ae[0]=Ge=>F.value="list"),class:normalizeClass({active:F.value==="list"})},toDisplayString(unref(r)("signatures.electronicSignature.mySignatures")),3),createBaseVNode("div",{onClick:Ae[1]||(Ae[1]=Ge=>F.value="create"),class:normalizeClass({active:F.value==="create"})},toDisplayString(unref(r)("signatures.electronicSignature.create")),3)]),F.value==="list"?(openBlock(),createElementBlock("div",_hoisted_4$p,[T.value.length===0?(openBlock(),createElementBlock("div",_hoisted_5$g,[createBaseVNode("div",_hoisted_6$c,[E.value==="Light"?(openBlock(),createBlock(Ee,{key:0})):(openBlock(),createBlock(Be,{key:1})),createBaseVNode("div",{onClick:Ae[2]||(Ae[2]=Ge=>F.value="create")},toDisplayString(unref(r)("signatures.electronicSignature.empty")),1)])])):(openBlock(),createElementBlock("div",_hoisted_7$b,[(openBlock(!0),createElementBlock(Fragment,null,renderList(T.value,(Ge,Xe)=>(openBlock(),createElementBlock("div",{class:"signatures-popup-list",key:Xe},[createBaseVNode("img",{onClick:qe=>J(Ge),src:Ge},null,8,_hoisted_8$8),createVNode(_e,{class:"close-button",onClick:qe=>X(Xe)},{default:withCtx(()=>[createVNode(Ve)]),_:2},1032,["onClick"])]))),128))]))])):(openBlock(),createElementBlock("div",_hoisted_9$8,[createBaseVNode("div",_hoisted_10$8,[createBaseVNode("div",{onClick:Ae[3]||(Ae[3]=Ge=>Y("keyboard")),class:normalizeClass({active:v.value==="keyboard"})},toDisplayString(unref(r)("signatures.keyboard")),3),createBaseVNode("div",{onClick:Ae[4]||(Ae[4]=Ge=>Y("trackpad")),class:normalizeClass({active:v.value==="trackpad"})},toDisplayString(unref(r)("signatures.trackpad")),3),createBaseVNode("div",{onClick:Ae[5]||(Ae[5]=Ge=>Y("image")),class:normalizeClass({active:v.value==="image"})},toDisplayString(unref(r)("signatures.image")),3),createBaseVNode("div",{onClick:Ae[6]||(Ae[6]=Ge=>Y("none")),class:normalizeClass({active:v.value==="none"})},toDisplayString(unref(r)("signatures.none")),3)]),createBaseVNode("div",{class:"preview-area",onClick:Ae[7]||(Ae[7]=Ge=>fe())},[createBaseVNode("img",{src:u.value},null,8,_hoisted_11$6)]),createBaseVNode("div",_hoisted_12$5,[v.value==="image"?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode("span",{class:"upload",onClick:oe},[createTextVNode(toDisplayString(unref(r)("common.actions.upload")),1),createBaseVNode("input",{ref_key:"uploadImageEl",ref:M,type:"file",onChange:Ce,accept:".png, .jpg, .jpeg",name:"signature"},null,544)]),createBaseVNode("span",{onClick:Q},toDisplayString(unref(r)("common.actions.clear")),1)],64)):createCommentVNode("",!0)]),createBaseVNode("p",_hoisted_13$5,toDisplayString(unref(r)("signatures.appearance.includeText")),1),createBaseVNode("div",_hoisted_14$5,[createBaseVNode("div",_hoisted_15$5,[createBaseVNode("div",_hoisted_16$4,[createBaseVNode("div",{class:"check-box",onClick:Ae[8]||(Ae[8]=Ge=>I.name=!I.name)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.name}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.name]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.name")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[9]||(Ae[9]=Ge=>I.dName=!I.dName)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.dName}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.dName]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.distinguishableName")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[10]||(Ae[10]=Ge=>I.date=!I.date)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.date}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.date]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.date")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[11]||(Ae[11]=Ge=>I.version=!I.version)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.version}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.version]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.version")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[12]||(Ae[12]=Ge=>I.logo=!I.logo)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.logo}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.logo]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.logo")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[13]||(Ae[13]=Ge=>I.location=!I.location)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.location}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.location]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.location")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[14]||(Ae[14]=Ge=>I.reason=!I.reason)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.reason}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.reason]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.reason")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[15]||(Ae[15]=Ge=>I.labels=!I.labels)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.labels}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.labels]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.labels")),1)])])]),createBaseVNode("div",_hoisted_17$3,[createBaseVNode("div",_hoisted_18$3,[createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.textAlignment")),1),createBaseVNode("div",_hoisted_19$2,[createBaseVNode("div",{class:normalizeClass({active:I.alignment==="left"}),onClick:Ae[16]||(Ae[16]=Ge=>I.alignment="left")},[createVNode(be)],2),createBaseVNode("div",{class:normalizeClass({active:I.alignment==="right"}),onClick:Ae[17]||(Ae[17]=Ge=>I.alignment="right")},[createVNode(ke)],2)])]),I.reason||I.location?(openBlock(),createElementBlock("div",_hoisted_20$2,[I.reason?(openBlock(),createElementBlock("div",_hoisted_21$2,[createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.reason")),1),createBaseVNode("div",_hoisted_22$2,[withDirectives(createBaseVNode("select",{"onUpdate:modelValue":Ae[18]||(Ae[18]=Ge=>I.reasonText=Ge)},[createBaseVNode("option",{value:unref(r)("signatures.none")},toDisplayString(unref(r)("signatures.none")),9,_hoisted_23$2),createBaseVNode("option",{value:unref(r)("signatures.appearance.docOwner")},toDisplayString(unref(r)("signatures.appearance.docOwner")),9,_hoisted_24$2),createBaseVNode("option",{value:unref(r)("signatures.appearance.approving")},toDisplayString(unref(r)("signatures.appearance.approving")),9,_hoisted_25$2),createBaseVNode("option",{value:unref(r)("signatures.appearance.reviewed")},toDisplayString(unref(r)("signatures.appearance.reviewed")),9,_hoisted_26$2)],512),[[vModelSelect,I.reasonText]]),createVNode(Me)])])):createCommentVNode("",!0),I.location?(openBlock(),createElementBlock("div",_hoisted_27$2,[createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.location")),1),withDirectives(createBaseVNode("input",{type:"text","onUpdate:modelValue":Ae[19]||(Ae[19]=Ge=>I.locationText=Ge),name:"signature"},null,512),[[vModelText,I.locationText]])])):createCommentVNode("",!0)])):createCommentVNode("",!0)])])]))])]),_:2},[F.value==="create"?{name:"footer",fn:withCtx(()=>[createBaseVNode("div",_hoisted_28$2,[createBaseVNode("div",{class:normalizeClass(["check",{active:O.value,disabled:T.value.length>=5}]),onClick:Ae[20]||(Ae[20]=Ge=>T.value.length<5&&(O.value=!O.value))},[withDirectives(createVNode(ve,null,null,512),[[vShow,O.value]])],2),T.value.length<5?(openBlock(),createElementBlock("span",_hoisted_29$2,toDisplayString(unref(r)("signatures.electronicSignature.saveTemplate")),1)):(openBlock(),createElementBlock("span",_hoisted_30$2,toDisplayString(unref(r)("signatures.fullStorage")),1))]),createBaseVNode("div",_hoisted_31$2,[createBaseVNode("div",{class:"rect-button white",onClick:Ae[21]||(Ae[21]=Ge=>W("cancel"))},toDisplayString(unref(r)("common.actions.cancel")),1),createBaseVNode("div",{class:"rect-button blue",onClick:Se},toDisplayString(unref(r)("common.actions.ok")),1)])]),key:"0"}:void 0]),1032,["show"]),withDirectives(createVNode(Oe,{onModifyImage:te},null,512),[[vShow,y.value]]),x.value?(openBlock(),createBlock(ze,{key:0,text:D.value,onModifyText:q},null,8,["text"])):createCommentVNode("",!0)])):createCommentVNode("",!0),m.value?(openBlock(),createElementBlock("div",_hoisted_32$1,[createVNode(Le,{show:m.value,dialogName:dialogName$2},{footer:withCtx(()=>[createBaseVNode("div",{class:"rect-button white",onClick:Ae[22]||(Ae[22]=Ge=>m.value=!1)},toDisplayString(unref(r)("common.actions.cancel")),1),createBaseVNode("div",{class:"rect-button blue",onClick:ne},toDisplayString(unref(r)("common.actions.ok")),1)]),default:withCtx(()=>[createVNode(We),createBaseVNode("p",null,toDisplayString(unref(r)("signatures.deleteConfirm")),1)]),_:1},8,["show"])])):createCommentVNode("",!0)],64)}}},SelectSignTypeDialog_vue_vue_type_style_index_0_lang="",_hoisted_1$1y={key:0,class:"select-type-popup"},_hoisted_2$1p={class:"title title-color"},_hoisted_3$1e={class:"select-text"},_hoisted_4$o={class:"text"},_hoisted_5$f={class:"title"},_hoisted_6$b={class:"text"},_hoisted_7$a={class:"title"},dialogName$1="selectSignTypeDialog",_sfc_main$1R={__name:"SelectSignTypeDialog",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=computed(()=>n.isElementOpen(dialogName$1)),f=computed(()=>o.getActiveTool),s=computed(()=>o.getDisableDigitalSignature),m=computed(()=>o.getDisableElectronicSignature),w=ref("electronic"),g=u=>{n.setSelectedSignatureField(u),f.value==="addDigitalSign"||!s.value&&m.value?n.openElement("addDigitalFileDialog"):f.value==="addElectronicSign"||s.value&&!m.value?d():n.openElement("selectSignTypeDialog")};core.addEvent("openSelectSignTypeDialog",g);const v=()=>{n.closeElement(dialogName$1),document.body.style.overflow="hidden",w.value==="digital"?n.openElement("addDigitalFileDialog"):d()},d=()=>{n.toggleElement("signCreatePanel"),n.setActiveToolMode("sign"),n.toggleActiveHand(!1),core.switchTool(0),core.switchAnnotationEditorMode(0)};return(u,y)=>{const x=__unplugin_components_0$u,k=__unplugin_components_1$9,P=_sfc_main$4f;return r.value?(openBlock(),createElementBlock("div",_hoisted_1$1y,[createVNode(P,{show:r.value,dialogName:dialogName$1,close:!0},{footer:withCtx(()=>[createBaseVNode("div",{class:"rect-button blue",onClick:v},toDisplayString(u.$t("signatures.startSigning")),1)]),default:withCtx(()=>[createBaseVNode("p",_hoisted_2$1p,toDisplayString(u.$t("signatures.electronicSignature.title")),1),createBaseVNode("div",_hoisted_3$1e,[createBaseVNode("div",{onClick:y[0]||(y[0]=S=>w.value="electronic"),class:"option"},[w.value==="electronic"?(openBlock(),createBlock(x,{key:0})):(openBlock(),createBlock(k,{key:1})),createBaseVNode("div",_hoisted_4$o,[createBaseVNode("p",_hoisted_5$f,toDisplayString(u.$t("signatures.electronic.title")),1),createBaseVNode("p",null,toDisplayString(u.$t("signatures.electronic.description")),1)])]),createBaseVNode("div",{onClick:y[1]||(y[1]=S=>w.value="digital"),class:"option"},[w.value==="digital"?(openBlock(),createBlock(x,{key:0})):(openBlock(),createBlock(k,{key:1})),createBaseVNode("div",_hoisted_6$b,[createBaseVNode("p",_hoisted_7$a,toDisplayString(u.$t("signatures.digital.title")),1),createBaseVNode("p",null,toDisplayString(u.$t("signatures.digital.description")),1)])])])]),_:1},8,["show"])])):createCommentVNode("",!0)}}},PreventDialog_vue_vue_type_style_index_0_lang="",_hoisted_1$1x={key:0,class:"edit-dialog"},_hoisted_2$1o={class:"edit"},_hoisted_3$1d={class:"close"},_hoisted_4$n={class:"warning"},_hoisted_5$e={class:"title"},_hoisted_6$a={class:"des"},_sfc_main$1Q={__name:"PreventDialog",setup(e){const n=useViewerStore(),o=computed(()=>n.isElementOpen("contentEditorPreventDialog")),r=computed(()=>n.isElementOpen("docEditorPreventDialog")),f=()=>n.closeElement(o.value?"contentEditorPreventDialog":"docEditorPreventDialog");return(s,m)=>{const w=__unplugin_components_14$3,g=__unplugin_components_2$f;return o.value||r.value?(openBlock(),createElementBlock("div",_hoisted_1$1x,[createBaseVNode("div",_hoisted_2$1o,[createBaseVNode("div",_hoisted_3$1d,[createVNode(w,{onClick:f})]),createBaseVNode("div",_hoisted_4$n,[createVNode(g)]),createBaseVNode("div",_hoisted_5$e,toDisplayString(s.$t("prevent.title")),1),createBaseVNode("div",_hoisted_6$a,toDisplayString(o.value?s.$t("prevent.description"):s.$t("prevent.description1")),1),createBaseVNode("div",{class:"button",onClick:f},toDisplayString(s.$t("common.actions.ok")),1)])])):createCommentVNode("",!0)}}},SettingsDialog_vue_vue_type_style_index_0_lang="",_hoisted_1$1w={class:"settings-popup"},_hoisted_2$1n={class:"title"},_hoisted_3$1c={class:"container"},_hoisted_4$m={class:"info"},_hoisted_5$d={class:"row"},_hoisted_6$9={class:"row"},_hoisted_7$9={class:"row"},_hoisted_8$7={class:"select-box"},_hoisted_9$7=["value"],_hoisted_10$7={class:"row"},_hoisted_11$5={class:"controller"},_hoisted_12$4={class:"row"},_hoisted_13$4={class:"controller"},_hoisted_14$4={class:"row"},_hoisted_15$4={class:"controller"},_hoisted_16$3={class:"title"},_hoisted_17$2={class:"version row"},_hoisted_18$2=createBaseVNode("span",null,"2.7.5",-1),_sfc_main$1P={__name:"SettingsDialog",setup(e){const{i18next:n}=useTranslation(),o=useViewerStore(),r=useDocumentStore(),f=ref(r.getAuthor),s=ref(r.getAnnotator),m=computed(()=>o.isElementOpen("settingsDialog")),w=computed(()=>r.getAuthor),g=computed(()=>r.getAnnotator),v=ref(n.language),d=ref(!0),u=ref(!0),y=ref(!1),x=ref(!1),k=computed(()=>o.getLanguages);watch(()=>m.value,(E,M)=>{E&&(d.value=r.getHighlightLink,u.value=r.getHighlightForm,y.value=!1)}),watch(()=>n.language,E=>{v.value=E}),watch(w,(E,M)=>{f.value=E}),watch(g,(E,M)=>{s.value=E}),watch(x,E=>{E?core.enableFillConsecutively():core.disableFillConsecutively(),y.value=!0}),watch([f,s,v,d,u],(E,M)=>{E[0]!==r.getAuthor||E[1]!==r.getAnnotator||E[2]!==n.language||E[3]!==r.getHighlightLink||E[4]!==r.getHighlightForm?y.value=!0:y.value=!1});const P=()=>{o.closeElement("settingsDialog"),v.value=n.language},S=async()=>{await n.changeLanguage(v.value),window.localStorage.setItem("language",v.value),o.closeElement("settingsDialog"),r.setAuthor(f.value?f.value:"ComPDFKit"),r.setAnnotator(s.value?s.value:"Guest"),r.setHighlightLink(d.value),r.setHighlightForm(u.value)};return(E,M)=>{const T=__unplugin_components_0$z,D=_sfc_main$4f;return openBlock(),createElementBlock("div",_hoisted_1$1w,[createVNode(D,{show:m.value},{footer:withCtx(()=>[createBaseVNode("div",{class:"rect-button white",onClick:P},toDisplayString(E.$t("common.actions.cancel")),1),createBaseVNode("div",{class:normalizeClass(["rect-button blue",{disabled:!y.value}]),onClick:S},toDisplayString(E.$t("common.actions.save")),3)]),default:withCtx(()=>[createBaseVNode("p",_hoisted_2$1n,toDisplayString(E.$t("toolbar.settings.title")),1),createBaseVNode("div",_hoisted_3$1c,[createBaseVNode("div",_hoisted_4$m,[createBaseVNode("div",_hoisted_5$d,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.author")),1),withDirectives(createBaseVNode("input",{type:"text",placeholder:"ComPDFKit","onUpdate:modelValue":M[0]||(M[0]=N=>f.value=N),name:"settings"},null,512),[[vModelText,f.value]])]),createBaseVNode("div",_hoisted_6$9,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.annotator")),1),withDirectives(createBaseVNode("input",{type:"text",placeholder:"Guest","onUpdate:modelValue":M[1]||(M[1]=N=>s.value=N),name:"settings"},null,512),[[vModelText,s.value]])]),createBaseVNode("div",_hoisted_7$9,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.language")),1),createBaseVNode("div",_hoisted_8$7,[withDirectives(createBaseVNode("select",{name:"language","onUpdate:modelValue":M[2]||(M[2]=N=>v.value=N)},[(openBlock(!0),createElementBlock(Fragment,null,renderList(k.value,N=>(openBlock(),createElementBlock("option",{value:N.code},toDisplayString(N.name),9,_hoisted_9$7))),256))],512),[[vModelSelect,v.value]]),createVNode(T)])])]),createBaseVNode("div",_hoisted_10$7,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.highlightLink")),1),createBaseVNode("div",_hoisted_11$5,[createVNode(unref(NSwitch),{value:d.value,"onUpdate:value":M[3]||(M[3]=N=>d.value=N)},null,8,["value"])])]),createBaseVNode("div",_hoisted_12$4,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.highlightForm")),1),createBaseVNode("div",_hoisted_13$4,[createVNode(unref(NSwitch),{value:u.value,"onUpdate:value":M[4]||(M[4]=N=>u.value=N)},null,8,["value"])])]),createBaseVNode("div",_hoisted_14$4,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.fillConsecutively")),1),createBaseVNode("div",_hoisted_15$4,[createVNode(unref(NSwitch),{value:x.value,"onUpdate:value":M[5]||(M[5]=N=>x.value=N)},null,8,["value"])])])]),createBaseVNode("p",_hoisted_16$3,toDisplayString(E.$t("toolbar.settings.creationInfo")),1),createBaseVNode("div",_hoisted_17$2,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.version")),1),_hoisted_18$2])]),_:1},8,["show"])])}}},_sfc_main$1O={},_hoisted_1$1v={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1m=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.3033 12.5962L3.40381 2.69666L2.6967 3.40376L12.5962 13.3033L13.3033 12.5962ZM2 7.99996C2 7.99996 2.69777 6.96095 3.82074 5.94202L9.58576 11.707C9.08063 11.8902 8.54892 12 8 12C4.68629 12 2 7.99996 2 7.99996ZM14 7.99996C14 7.99996 13.3022 9.03896 12.1793 10.0579L6.41424 4.29288C6.91937 4.10972 7.45108 3.99996 8 3.99996C11.3137 3.99996 14 7.99996 14 7.99996Z",fill:"currentColor"},null,-1),_hoisted_3$1b=[_hoisted_2$1m];function _sfc_render$W(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1v,_hoisted_3$1b)}const __unplugin_components_4$5=_export_sfc(_sfc_main$1O,[["render",_sfc_render$W]]),_sfc_main$1N={},_hoisted_1$1u={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1l=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 12C11.3137 12 14 8 14 8C14 8 11.3137 4 8 4C4.68629 4 2 8 2 8C2 8 4.68629 12 8 12ZM8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10Z",fill:"currentColor"},null,-1),_hoisted_3$1a=[_hoisted_2$1l];function _sfc_render$V(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1u,_hoisted_3$1a)}const __unplugin_components_3$5=_export_sfc(_sfc_main$1N,[["render",_sfc_render$V]]),_sfc_main$1M={},_hoisted_1$1t={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1k=createBaseVNode("path",{d:"M32.5 19.2321V13.1607C32.5 8.46629 28.6944 4.66071 24 4.66071V4.66071C19.3056 4.66071 15.5 8.46628 15.5 13.1607V19.2321",stroke:"#93B9FD","stroke-width":"4"},null,-1),_hoisted_3$19=createBaseVNode("rect",{x:"7",y:"16.8036",width:"34",height:"26.7143",rx:"2",fill:"currentColor"},null,-1),_hoisted_4$l=createBaseVNode("rect",{x:"15",y:"28",width:"18",height:"3",fill:"white"},null,-1),_hoisted_5$c=[_hoisted_2$1k,_hoisted_3$19,_hoisted_4$l];function _sfc_render$U(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1t,_hoisted_5$c)}const __unplugin_components_2$a=_export_sfc(_sfc_main$1M,[["render",_sfc_render$U]]),_sfc_main$1L={},_hoisted_1$1s={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1j=createBaseVNode("path",{d:"M13 1L1 13",stroke:"#BABABA","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),_hoisted_3$18=createBaseVNode("path",{d:"M1 1L13 13",stroke:"#BABABA","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),_hoisted_4$k=[_hoisted_2$1j,_hoisted_3$18];function _sfc_render$T(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1s,_hoisted_4$k)}const __unplugin_components_0$f=_export_sfc(_sfc_main$1L,[["render",_sfc_render$T]]),EnterDocumentPassword_vue_vue_type_style_index_0_lang="",_hoisted_1$1r={id:"passwordDialog",class:"enter-document-password-dialog"},_hoisted_2$1i={class:"password-container"},_hoisted_3$17={class:"modal-container"},_hoisted_4$j={class:"wrapper"},_hoisted_5$b={class:"header-container"},_hoisted_6$8=createBaseVNode("span",{class:"title"},null,-1),_hoisted_7$8={class:"password-title"},_hoisted_8$6={class:"input-container"},_hoisted_9$6=["type","placeholder"],_hoisted_10$6={class:"wrong-password",id:"passwordText"},_sfc_main$1K={__name:"EnterDocumentPassword",setup(e){const{t:n}=useTranslation(),o=useViewerStore(),r=ref(!1),f=ref(""),s=ref(""),m=computed(()=>o.isElementOpen("permissionPasswordDialog")),w=v=>{v.param===!0||v.param===!1?r.value=v.param:r.value=!r.value};watch(()=>f.value,()=>{s.value=""}),watch(()=>m.value,()=>{f.value="",s.value=""});const g=async()=>{if(!await core.checkPermissionPassword(f.value)){s.value=n("passwordDialog.wrongPwd");return}o.closeElement("permissionPasswordDialog")};return(v,d)=>{const u=__unplugin_components_0$f,y=_sfc_main$4m,x=__unplugin_components_2$a,k=__unplugin_components_3$5,P=__unplugin_components_4$5;return withDirectives((openBlock(),createElementBlock("div",_hoisted_1$1r,[createBaseVNode("div",_hoisted_2$1i,[createBaseVNode("div",_hoisted_3$17,[createBaseVNode("div",_hoisted_4$j,[createBaseVNode("div",_hoisted_5$b,[_hoisted_6$8,createVNode(y,{class:"close-button",id:"passwordCancel",onClick:d[0]||(d[0]=S=>unref(o).closeElement("permissionPasswordDialog"))},{default:withCtx(()=>[createVNode(u)]),_:1})]),createVNode(x,{class:"lock-icon"}),createBaseVNode("div",_hoisted_7$8,toDisplayString(v.$t("passwordDialog.enterPermissionPwd")),1),createBaseVNode("div",_hoisted_8$6,[withDirectives(createBaseVNode("input",{id:"permission-password","onUpdate:modelValue":d[1]||(d[1]=S=>f.value=S),type:r.value?"text":"password",name:"password",placeholder:v.$t("passwordDialog.placeholder")},null,8,_hoisted_9$6),[[vModelDynamic,f.value]]),createBaseVNode("span",{class:"eye-btn",id:"eyeVisible",onClick:w},[r.value?(openBlock(),createBlock(k,{key:0})):(openBlock(),createBlock(P,{key:1}))]),createBaseVNode("div",_hoisted_10$6,toDisplayString(s.value),1)]),createBaseVNode("span",{class:normalizeClass(["set-btn",!f.value.length&&"disabled"]),id:"passwordSubmit",onClick:g},toDisplayString(v.$t("common.actions.ok")),3)])])])],512)),[[vShow,m.value]])}}},ModalContainer_vue_vue_type_style_index_0_lang="",_hoisted_1$1q={className:"modal-container"},_hoisted_2$1h={className:"wrapper"},_hoisted_3$16={className:"header-container"},_hoisted_4$i={class:"title"},_sfc_main$1J={__name:"ModalContainer",props:["title","onCloseClick"],setup(e){return(n,o)=>{const r=__unplugin_components_0$f,f=_sfc_main$4m;return openBlock(),createElementBlock("div",_hoisted_1$1q,[createBaseVNode("div",_hoisted_2$1h,[createBaseVNode("div",_hoisted_3$16,[createBaseVNode("span",_hoisted_4$i,toDisplayString(e.title),1),createVNode(f,{className:"close-button",onClick:e.onCloseClick},{default:withCtx(()=>[createVNode(r)]),_:1},8,["onClick"])]),renderSlot(n.$slots,"default")])])}}},MessageSuccess=""+new URL("icon-message-success.c9ccee05.svg",import.meta.url).href,SetPassword_vue_vue_type_style_index_0_lang="",_hoisted_1$1p={class:"password-container"},_hoisted_2$1g={class:"encrypt-container"},_hoisted_3$15={class:"document"},_hoisted_4$h={class:"document-title"},_hoisted_5$a=["disabled","type","placeholder"],_hoisted_6$7={class:"wrong-password"},_hoisted_7$7={class:"permission"},_hoisted_8$5={class:"permission-title"},_hoisted_9$5=["disabled","type","placeholder"],_hoisted_10$5={class:"wrong-password"},_hoisted_11$4={class:"printing item"},_hoisted_12$3={class:"copy item"},_hoisted_13$3={class:"edit item"},_hoisted_14$3={class:"note"},_hoisted_15$3={class:"btn-container"},_sfc_main$1I={__name:"SetPassword",setup(e){const n=getCurrentInstance().appContext.app.config.globalProperties,o=useViewerStore(),r=ref(!1),f=ref(""),s=ref(""),m=ref(!1),w=ref(""),g=ref(""),v=ref(!1),d=ref(!1),u=ref(!1),y=ref(!1),x=reactive({allowsPrinting:!1,allowsCopying:!1,allowsDocumentChanges:!1}),k=computed(()=>o.isElementOpen("setPasswordModal"));watch(()=>f.value,(M,T)=>{M&&(M=M.replace(/\s/g,""),M=M.replace(/[^a-zA-Z0-9!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/,""),M=M.replace(/[\u4e00-\u9fa5\uFE30-\uFFA0]/,""),f.value=M),w.value=""}),watch(()=>s.value,(M,T)=>{M&&(M=M.replace(/\s/g,""),M=M.replace(/[^a-zA-Z0-9!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/,""),M=M.replace(/[\u4e00-\u9fa5\uFE30-\uFFA0]/,""),s.value=M),g.value=""});const P=()=>{o.closeElement("setPasswordModal"),r.value=!1,f.value="",v.value=!1,s.value="",d.value=!1,u.value=!1,x.allowsPrinting=!1,x.allowsCopying=!1,x.allowsDocumentChanges=!1},S=async()=>{if(!f.value.length&&!s.value.length||m.value)return;if(E())v.value=!1;else{v.value=!0;return}m.value=!0;const M={};d.value&&(M.password=f.value),u.value&&(M.permissionPassword=s.value,M.permission={allowsPrinting:x.allowsPrinting,allowsCopying:x.allowsCopying,allowsDocumentChanges:x.allowsDocumentChanges});const T=await core.setPassword(M);P(),T?window.$message.success(n.$t("passwordDialog.setSuccess"),{duration:3e3,icon:()=>h$1("img",{src:MessageSuccess})}):window.$message.error(n.$t("passwordDialog.setFailure"),{duration:3e3,icon:()=>h$1("img",{src:MessageError})}),m.value=!1},E=()=>{const M=/^(?=.*[a-zA-Z]+$|.*\d+$|.*[@$!%*?&]+$)[a-zA-Z\d@$!%*?&]{1,20}$/,T=M.test(f.value),D=M.test(s.value);return d.value&&!T&&(w.value=n.$t("passwordDialog.support")),u.value&&!D&&(g.value=n.$t("passwordDialog.support")),d.value&&u.value&&f.value===s.value?(w.value=n.$t("passwordDialog.samePwd"),g.value=n.$t("passwordDialog.samePwd"),!1):f.value.length>20||s.value.length>20?(d.value&&f.value.length>20&&(w.value=n.$t("passwordDialog.longPwd")),u.value&&s.value.length>20&&(g.value=n.$t("passwordDialog.longPwd")),!1):(!d.value||T)&&(!u.value||D)};return(M,T)=>{const D=__unplugin_components_1$f,N=__unplugin_components_3$5,F=__unplugin_components_4$5,O=_sfc_main$1J;return withDirectives((openBlock(),createElementBlock("div",_hoisted_1$1p,[createVNode(O,{onCloseClick:P,title:M.$t("passwordDialog.encryptTitle")},{default:withCtx(()=>[createBaseVNode("div",_hoisted_2$1g,[createBaseVNode("div",_hoisted_3$15,[createBaseVNode("div",_hoisted_4$h,[createBaseVNode("div",{class:normalizeClass(["check",{active:d.value}]),onClick:T[0]||(T[0]=I=>d.value=!d.value)},[withDirectives(createVNode(D,null,null,512),[[vShow,d.value]])],2),createBaseVNode("span",null,toDisplayString(M.$t("passwordDialog.documentPwd")),1)]),createBaseVNode("div",{class:normalizeClass(["input-container",!d.value&&"disable"])},[createBaseVNode("div",{class:normalizeClass(["input",!d.value&&"disabled"])},[withDirectives(createBaseVNode("input",{disabled:!d.value,type:r.value?"text":"password",name:"password","onUpdate:modelValue":T[1]||(T[1]=I=>f.value=I),placeholder:M.$t("passwordDialog.placeholder")},null,8,_hoisted_5$a),[[vModelDynamic,f.value]]),createBaseVNode("span",{class:"eye-btn",onClick:T[2]||(T[2]=I=>r.value=!r.value)},[r.value?(openBlock(),createBlock(N,{key:0})):(openBlock(),createBlock(F,{key:1}))])],2),withDirectives(createBaseVNode("div",_hoisted_6$7,[createBaseVNode("p",null,toDisplayString(w.value),1)],512),[[vShow,w.value]])],2)]),createBaseVNode("div",_hoisted_7$7,[createBaseVNode("div",_hoisted_8$5,[createBaseVNode("div",{class:normalizeClass(["check",{active:u.value}]),onClick:T[3]||(T[3]=I=>u.value=!u.value)},[withDirectives(createVNode(D,null,null,512),[[vShow,u.value]])],2),createBaseVNode("span",null,toDisplayString(M.$t("passwordDialog.permissionPwd")),1)]),createBaseVNode("div",{class:normalizeClass(["input-container",!u.value&&"disable"])},[createBaseVNode("div",{class:normalizeClass(["input",!u.value&&"disabled"])},[withDirectives(createBaseVNode("input",{disabled:!u.value,type:y.value?"text":"password",name:"password","onUpdate:modelValue":T[4]||(T[4]=I=>s.value=I),placeholder:M.$t("passwordDialog.placeholder")},null,8,_hoisted_9$5),[[vModelDynamic,s.value]]),createBaseVNode("span",{class:"eye-btn",onClick:T[5]||(T[5]=I=>y.value=!y.value)},[y.value?(openBlock(),createBlock(N,{key:0})):(openBlock(),createBlock(F,{key:1}))])],2),withDirectives(createBaseVNode("div",_hoisted_10$5,[createBaseVNode("p",null,toDisplayString(g.value),1)],512),[[vShow,g.value]])],2),createBaseVNode("div",{class:normalizeClass(["items",!u.value&&"disabled"])},[createBaseVNode("div",_hoisted_11$4,[createBaseVNode("div",{class:normalizeClass(["check",{active:x.allowsPrinting}]),onClick:T[6]||(T[6]=I=>u.value&&(x.allowsPrinting=!x.allowsPrinting))},[withDirectives(createVNode(D,null,null,512),[[vShow,x.allowsPrinting]])],2),createBaseVNode("span",null,toDisplayString(M.$t("passwordDialog.disablePrinting")),1)]),createBaseVNode("div",_hoisted_12$3,[createBaseVNode("div",{class:normalizeClass(["check",{active:x.allowsCopying}]),onClick:T[7]||(T[7]=I=>u.value&&(x.allowsCopying=!x.allowsCopying))},[withDirectives(createVNode(D,null,null,512),[[vShow,x.allowsCopying]])],2),createBaseVNode("span",null,toDisplayString(M.$t("passwordDialog.disableCopying")),1)]),createBaseVNode("div",_hoisted_13$3,[createBaseVNode("div",{class:normalizeClass(["check",{active:x.allowsDocumentChanges}]),onClick:T[8]||(T[8]=I=>u.value&&(x.allowsDocumentChanges=!x.allowsDocumentChanges))},[withDirectives(createVNode(D,null,null,512),[[vShow,x.allowsDocumentChanges]])],2),createBaseVNode("span",null,toDisplayString(M.$t("passwordDialog.disableEdit")),1)])],2)])]),createBaseVNode("div",_hoisted_14$3,[createBaseVNode("p",null,toDisplayString(M.$t("passwordDialog.notes")[0]),1),createBaseVNode("p",null,toDisplayString(M.$t("passwordDialog.notes")[1]),1),createBaseVNode("p",null,toDisplayString(M.$t("passwordDialog.notes")[2]),1)]),createBaseVNode("div",_hoisted_15$3,[createBaseVNode("span",{onClick:P},toDisplayString(M.$t("common.actions.cancel")),1),createBaseVNode("span",{class:normalizeClass(["blue",{disabled:!f.value&&d.value||!s.value&&u.value||!d.value&&!u.value||u.value&&!x.allowsPrinting&&!x.allowsCopying&&!x.allowsDocumentChanges}]),onClick:S},toDisplayString(M.$t("passwordDialog.encrypt")),3)])]),_:1},8,["title"])],512)),[[vShow,k.value]])}}},EnterPassword_vue_vue_type_style_index_0_lang="",_hoisted_1$1o={id:"passwordDialog",class:"password-dialog enter-password-dialog"},_hoisted_2$1f={class:"password-container"},_hoisted_3$14={class:"modal-container"},_hoisted_4$g={class:"wrapper"},_hoisted_5$9={class:"header-container"},_hoisted_6$6=createBaseVNode("span",{class:"title"},null,-1),_hoisted_7$6={class:"password-title"},_hoisted_8$4={class:"input-container"},_hoisted_9$4=["type","placeholder"],_hoisted_10$4=createBaseVNode("div",{class:"wrong-password",id:"passwordText"},null,-1),_hoisted_11$3={class:"set-btn",id:"passwordSubmit"},_sfc_main$1H={__name:"EnterPassword",setup(e){const n=ref(!1),o=r=>{r.param===!0||r.param===!1?n.value=r.param:n.value=!n.value};return(r,f)=>{const s=__unplugin_components_0$f,m=_sfc_main$4m,w=__unplugin_components_2$a,g=__unplugin_components_3$5,v=__unplugin_components_4$5;return openBlock(),createElementBlock("div",_hoisted_1$1o,[createBaseVNode("div",_hoisted_2$1f,[createBaseVNode("div",_hoisted_3$14,[createBaseVNode("div",_hoisted_4$g,[createBaseVNode("div",_hoisted_5$9,[_hoisted_6$6,createVNode(m,{class:"close-button",id:"passwordCancel"},{default:withCtx(()=>[createVNode(s)]),_:1})]),createVNode(w,{class:"lock-icon"}),createBaseVNode("div",_hoisted_7$6,toDisplayString(r.$t("passwordDialog.enterPwd")),1),createBaseVNode("div",_hoisted_8$4,[createBaseVNode("input",{id:"password",type:n.value?"text":"password",name:"password",placeholder:r.$t("passwordDialog.placeholder")},null,8,_hoisted_9$4),createBaseVNode("span",{class:"eye-btn",id:"eyeVisible",onClick:o},[n.value?(openBlock(),createBlock(g,{key:0})):(openBlock(),createBlock(v,{key:1}))]),_hoisted_10$4]),createBaseVNode("span",_hoisted_11$3,toDisplayString(r.$t("common.actions.ok")),1)])])])])}}},_sfc_main$1G={},_hoisted_1$1n={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1e=createBaseVNode("path",{d:"M7 4.07123L13 10.071L7 16.0709",stroke:"currentColor","stroke-width":"1.5"},null,-1),_hoisted_3$13=[_hoisted_2$1e];function _sfc_render$S(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1n,_hoisted_3$13)}const __unplugin_components_10$3=_export_sfc(_sfc_main$1G,[["render",_sfc_render$S]]),_sfc_main$1F={},_hoisted_1$1m={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1d=createBaseVNode("path",{d:"M13 4.07123L7 10.071L13 16.0709",stroke:"currentColor","stroke-width":"1.5"},null,-1),_hoisted_3$12=[_hoisted_2$1d];function _sfc_render$R(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1m,_hoisted_3$12)}const __unplugin_components_0$e=_export_sfc(_sfc_main$1F,[["render",_sfc_render$R]]),PageNavOverlay_vue_vue_type_style_index_0_lang="",_hoisted_1$1l={key:0,class:"page-nav","data-element":"pageNavOverlay"},_hoisted_2$1c={class:"form-container"},_sfc_main$1E={__name:"PageNavOverlay",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=ref(n.getCurrentPage);effect(()=>r.value=n.getCurrentPage);const f=computed(()=>n.getFullMode),s=computed(()=>n.getCurrentPage===1),m=computed(()=>o.getTotalPages),w=computed(()=>m.value===n.getCurrentPage);watch(r,(u,y)=>{u!==""&&m.value!==0&&(u>m.value||u<=0)&&(r.value=y)});const g=()=>{core.previousPage()&&n.setCurrentPage(core.getCurrentPage())},v=()=>{core.nextPage()&&n.setCurrentPage(core.getCurrentPage())},d=u=>{if(u.target.blur(),!u.target.value){r.value=n.getCurrentPage;return}core.pageNumberChanged(u.target)};return(u,y)=>{const x=__unplugin_components_0$e,k=_sfc_main$4m,P=__unplugin_components_10$3;return m.value>0&&!f.value?(openBlock(),createElementBlock("div",_hoisted_1$1l,[createVNode(k,{className:"side-arrow-container",img:"icon-previous-left",title:s.value?null:u.$t("common.navigation.previousPage"),onClick:g,disabled:s.value},{default:withCtx(()=>[createVNode(x)]),_:1},8,["title","disabled"]),createBaseVNode("div",_hoisted_2$1c,[withDirectives(createBaseVNode("input",{type:"number","onUpdate:modelValue":y[0]||(y[0]=S=>r.value=S),onInput:y[1]||(y[1]=(...S)=>u.onChange&&u.onChange(...S)),onBlur:d,onKeydown:withKeys(d,["enter"]),tabIndex:"-1",style:normalizeStyle({width:r.value.toString().length*8+2+"px"}),pattern:"\\d*",onkeypress:"return (/[\\d]/.test(String.fromCharCode(event.keyCode)))",name:"page-nav"},null,36),[[vModelText,r.value]]),createBaseVNode("span",null,toDisplayString(`/${m.value}`),1)]),createVNode(k,{className:"side-arrow-container",img:"icon-next-right",title:w.value?null:u.$t("common.navigation.nextPage"),onClick:v,disabled:w.value},{default:withCtx(()=>[createVNode(P)]),_:1},8,["title","disabled"])])):createCommentVNode("",!0)}}},DocumentContainer_vue_vue_type_style_index_0_lang="",_hoisted_1$1k=createStaticVNode('<div id="printServiceDialog" class="print-dialog"><div class="print-container"><div class="print-title">Preparing document for printing\u2026</div><div class="print-progress"><progress value="0" max="100"></progress><span class="relative-progress">0%</span></div></div></div>',1),_hoisted_2$1b=["innerHTML"],_hoisted_3$11={class:"loading"},_hoisted_4$f={class:"upload-container"},_hoisted_5$8={for:"fileInput"},_sfc_main$1D={__name:"DocumentContainer",props:["isHeaderDisabled"],setup(e){const{isHeaderDisabled:n}=e,{loadDocument:o,initializeViewer:r,initConfig:f,getDocumentViewer:s,switchTool:m,switchAnnotationEditorMode:w}=core,g=ref(),v=ref(),d=useViewerStore(),u=useDocumentStore();let y=null;useTranslation();const x=computed(()=>d.getCustomLoading),k=window.localStorage.getItem("customStamps"),P=window.localStorage.getItem("electronicSignatures"),S=window.localStorage.getItem("digitalSignatures");k&&d.setCustomStamps(JSON.parse(k)),P&&d.setElectronicSignature(JSON.parse(P)),S&&d.setDigitalSignature(JSON.parse(S));const E=computed(()=>d.getDisableSignatureTool),M=computed(()=>d.isElementOpen("leftPanel")),T=computed(()=>isMobileDevice?0:M.value?260:0),D=computed(()=>isMobileDevice?0:d.isElementOpen("rightPanel")||d.isElementOpen("pageModePanel")||d.isElementOpen("stampPanel")||d.isElementOpen("linkPanel")||d.isElementOpen("contentEditorPanel")||d.isElementOpen("colorSeparationPanel")||d.isElementOpen("measurePanel")||d.isElementOpen("freetextPanel")?260:0),N=computed(()=>d.getToolMode),F=computed(()=>d.getCompareStatus),O=computed(()=>n||["view","document","separation"].includes(d.getToolMode)||N.value==="compare"&&F.value!=="finished"?0:["redaction","remove"].includes(J.value)?window.innerWidth>500?44+48:44+88:N.value==="sign"&&E.value?0:q.value&&N.value==="sign"?44+44:44),I=computed(()=>d.getUploadLoading&&d.getUpload),X=computed(()=>d.getActiveElementTab("leftPanel")),ne=computed(()=>d.getUpload),ye=computed(()=>d.getDisabledElements("pageNavOverlay")),J=computed(()=>u.getActiveTool),te=computed(()=>d.getScale),q=computed(()=>d.getSignatureVerify),re=computed(()=>d.getCommonLoading),U=computed(()=>d.getVerified);let H=100,Z=0;const Y=getHashParameters("d","");function W(){if(!isMobileDevice||J.value==="polygon"||J.value==="polyline")return;const _e=50,ve=2,be=te.value<H+ve*_e?te.value+_e:H;d.setCurrentScale(be/100),core.scaleChanged(be/100)}function Q(_e){const ve=g.value.querySelector(".page-nav");if(_e.target.nodeName==="A"||(ve==null?void 0:ve.contains(_e.target))||_e.target.nodeName==="rect")return;const be=new Date().getTime();be-Z<300&&W(),Z=be}async function oe(_e){const ve=_e.target.files[0];if(!ve)return;M.value&&d.closeElement("leftPanel"),d.$patch({fullMode:!1,currentPage:0,scale:"",themeMode:"Light",pageMode:0,scrollMode:"Vertical",activeTab:0,searchStatus:!1,activeElements:{leftPanel:!1,rightPanel:!1,pageModePanel:!1},activeElementsTab:{leftPanel:"THUMBS",rightPanel:"GENERAL"},signatureVerify:0}),u.resetSetting(),core.clearSearchResults(),u.setToolState(""),d.setActiveToolMode("view"),d.setUploadLoading(!0);let be=ve.name;d.setUpload(!0);let ke=URL.createObjectURL(ve);await Se(ke,{filename:be}),d.setUploadLoading(!1),URL.revokeObjectURL(ke)}const Ce=computed(()=>u.getLoadingProgress);async function Se(_e,{filename:ve=null,password:be=""}){const ke={extension:getHashParameters("extension",null),filename:getHashParameters("filename",null)||ve,externalPath:getHashParameters("p",""),documentId:getHashParameters("did",null),progress:u.setLoadingProgress,pageChangedCallback:d.setCurrentPage,scaleChangedCallback:d.setCurrentScale,annotationsNumChangedCallback:u.setAnnotationsCount,distanceChangedCallback:u.setDistance,permissionPasswordCallback:()=>d.openElement("permissionPasswordDialog"),password:be};try{const Oe=await o(_e,ke);if(!Oe||!Oe.verified)return;U.value||(d.setVerified(Oe.verified),d.setLicense(s()._license));const{pwd:ze}=Oe;u.setFileHasPwd(!!ze),u.setPassword(ze),u.setCurrentPdfData(_e,ke),u.setOutline(core.getOutlines())}catch(Oe){if(console.log(Oe),Oe==="invalid_file_error"||Oe==="no_password_given"||Oe==="incorrect_password"){d.setUpload(!1),d.resetSetting();const ze=document.getElementById("fileInput");ze.value="",u.setCurrentPdfData();return}}const Me=core.getPagesCount(),Le=core.getScale();u.setTotalPages(Me),d.setCurrentPage(1),d.setCurrentScale(Le),H=Math.round(Le*100)}const fe=_e=>{u.setSelectedAnnotation(_e)},Pe=()=>{u.setSelectedAnnotation(null)},Ae=_e=>{X.value!=="ANNOTATION"&&d.setActiveElementTab("leftPanel","ANNOTATION"),M.value||d.openElement("leftPanel"),d.openElement("reply"),y&&(clearTimeout(y),y=null),setTimeout(()=>{const ve=document.querySelector(".annotation-item.selected");ve.scrollIntoView({behavior:"smooth"}),ve.classList.contains("flash-border")?(ve.classList.remove("flash-border"),clearTimeout(y),y=null):(ve.classList.add("flash-border"),y=setTimeout(()=>{var be;return(be=document.querySelector(".annotation-item.selected"))==null?void 0:be.classList.remove("flash-border")},2e3))},300)};function Te(_e){_e.isTrusted&&typeof _e.data=="object"&&_e.data.type==="viewerLoaded"&&Ee(_e.data.options)}const Ee=async _e=>{if(!_e)return;window.removeEventListener("message",Te),"isAnnotationPopup"in _e&&d.toggleAnnotationPopup(_e.isAnnotationPopup),d.setUpload(!0),d.setUploadLoading(!0),await f(_e),!Y&&!_e.initialDoc&&(d.setUpload(!1),d.setUploadLoading(!1)),_e.renderLayerPermission||d.setDisabledElements("layers");const ve=_e&&_e.webviewerServer?_e.webviewerServer:"Standalone";d.setWebviewerMode(ve);const be=We=>{We!==N.value&&d.setActiveToolMode(We)};core.addEvent("toolModeChanged",be);const ke=({tool:We})=>{u.setActiveTool(We)};core.addEvent("toolChanged",ke),core.addEvent("annotationSelected",fe),core.addEvent("annotationDeselected",Pe),core.addEvent("openAnnotationReply",Ae);const Me=document.querySelector(".thumbnail-view"),Le=document.querySelector(".outline-view"),Oe=document.querySelector(".findbar-view");r({container:g.value,viewer:v.value,thumbnailView:Me,outlineView:Le,findbarView:Oe,toggleButton:document.querySelector(".toggle-button")}),_e.autoJumpNextSign&&u.setAutoJumpNextSign(!0),_e.disableDigitalSignature&&u.setDisableDigitalSignature(_e.disableDigitalSignature),_e.disableElectronicSignature&&u.setDisableElectronicSignature(_e.disableElectronicSignature),core.addEvent("onPagesUpdated",We=>{const{pageNumber:Ge}=We;u.setOutline(core.getOutlines());const Xe=core.getPagesCount(),qe=core.getScale();u.setTotalPages(Xe),d.setCurrentPage(Ge||1),d.setCurrentScale(qe);const Ke=d.getScrollMode,Qe=d.getPageMode,at=Ke==="Vertical"?0:1;core.switchScrollMode(at),core.switchSpreadMode(Qe)});const ze=(We,Ge)=>{const Xe=core.getAnnotationsList();u.initAnnotations(Xe),setTimeout(()=>{if(Ge==="add"){const qe=document.getElementById(`annotationList-${We.name}`);qe&&qe.scrollIntoView({behavior:"smooth",block:"start"})}})};core.addEvent("annotationChanged",ze),core.addEvent("documentloaded",ze),_e.pdfUrl&&await window.instance.UI.loadDocument(_e.pdfUrl)};window.instance.UI.loadDocument=async(_e,{filename:ve="",password:be=""}={})=>{if(!_e)return;M.value&&d.closeElement("leftPanel"),d.$patch({fullMode:!1,currentPage:0,scale:"",themeMode:"Light",pageMode:0,scrollMode:"Vertical",activeTab:0,searchStatus:!1,activeElements:{leftPanel:!1,rightPanel:!1},activeElementsTab:{leftPanel:"THUMBS",rightPanel:"GENERAL"}}),u.resetSetting(),core.clearSearchResults(),u.setToolState(""),d.setActiveToolMode("view"),d.setUploadLoading(!0),d.setUpload(!0);let ke=typeof _e=="string"?_e:URL.createObjectURL(_e);await Se(ke,{filename:_e.name||ve,password:be}),d.setUploadLoading(!1)};const Be=(_e,ve)=>{const be=Ve(_e),Me=core.getSelectedPage(be,be).first;if(Me<1)return;const Le=core.windowToPage(be,Me);core.eventBus().dispatch(ve,{event:_e,...Le})},Ve=_e=>{var Le;const ve=core.getScrollViewElement();let be=((Le=g.value)==null?void 0:Le.style.marginLeft)||0;be=parseFloat(be);const ke=ve.scrollLeft||0,Me=ve.scrollTop||0;return{x:_e.pageX+ke-be,y:_e.pageY+Me}};return onMounted(()=>{document.documentElement.addEventListener("keydown",_e=>{if(_e.target.tagName==="INPUT"||_e.target.tagName==="TEXTAREA")return;(_e.keyCode||_e.which)===27&&J.value&&(u.setToolState(J.value),d.toggleActiveHand(!1),m(0),w(0))}),window.addEventListener("message",Te,!1)}),(_e,ve)=>{const be=_sfc_main$1E,ke=_sfc_main$1H,Me=_sfc_main$1I,Le=_sfc_main$1K,Oe=_sfc_main$1P,ze=_sfc_main$1Q,We=_sfc_main$1R,Ge=_sfc_main$1S,Xe=_sfc_main$1V,qe=_sfc_main$1Z,Ke=_sfc_main$20,Qe=_sfc_main$21,at=_sfc_main$22,ut=__unplugin_components_13$1,vt=_sfc_main$23,_t=_sfc_main$28,wt=_sfc_main$2g,bt=_sfc_main$2i,Rt=_sfc_main$2k,Fe=_sfc_main$2l,$e=_sfc_main$2m,Ie=_sfc_main$2x,Re=__unplugin_components_22$1,He=_sfc_main$2Z;return openBlock(),createElementBlock(Fragment,null,[createBaseVNode("div",{ref_key:"mainContainer",ref:g,class:normalizeClass(["document-container",{under:N.value==="compare"&&F.value!=="finished"||N.value==="document","no-touch":["selectText","highlight","underline","squiggly","strikeout"].includes(J.value),redact:["redaction","remove"].includes(J.value)}]),style:normalizeStyle({width:`calc(100% - ${T.value}px - ${D.value}px)`,"margin-left":`${T.value}px`,"margin-right":`${D.value}px`,"margin-top":`${O.value}px`,top:e.isHeaderDisabled?"0px":"44px"}),onDblclick:W,onClick:Q},[createBaseVNode("div",{ref_key:"viewerContainer",ref:v,class:"document",onClick:ve[0]||(ve[0]=je=>Be(je,"pdfClick")),onMousedown:ve[1]||(ve[1]=je=>Be(je,"pdfMousedown")),onDblclick:ve[2]||(ve[2]=je=>Be(je,"pdfDbclick"))},null,544),ye.value?createCommentVNode("",!0):(openBlock(),createBlock(be,{key:0,style:normalizeStyle({left:`calc(50% + ${T.value/2}px - ${D.value/2}px)`})},null,8,["style"]))],38),createVNode(ke),_hoisted_1$1k,createVNode(Me),createVNode(Le),createVNode(Oe),createVNode(ze),createVNode(We),createVNode(Ge),createVNode(Xe),createVNode(qe),createVNode(Ke),createVNode(Qe),createVNode(at),I.value&&Ce.value<100?(openBlock(),createElementBlock("div",{key:0,class:"loading-state",innerHTML:x.value?x.value.element:`${_e.$t("common.actions.loading")}...`,style:normalizeStyle(x.value&&x.value.styles?x.value.styles:"")},null,12,_hoisted_2$1b)):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(["mask",{active:re.value}])},[withDirectives(createBaseVNode("div",_hoisted_3$11,[createVNode(ut)],512),[[vShow,re.value]])],2),withDirectives(createBaseVNode("div",_hoisted_4$f,[createBaseVNode("input",{id:"fileInput",type:"file",accept:".pdf",onChange:oe,name:"document"},null,32),createBaseVNode("label",_hoisted_5$8,toDisplayString(_e.$t("common.actions.upload")),1)],512),[[vShow,!ne.value&&X.value!=="COMPARISON"&&["compare","view"].includes(N.value)]]),createVNode(vt),createVNode(_t),createVNode(wt),createVNode(bt),createVNode(Rt),createVNode(Fe),createVNode($e),createVNode(Ie),createVNode(Re),createVNode(He)],64)}}},SearchItem_vue_vue_type_style_index_0_lang="",_hoisted_1$1j={key:0,class:"page-title"},_hoisted_2$1a=["innerHTML"],_sfc_main$1C={__name:"SearchItem",props:["searchResults","result","currentIndex"],setup(e){const{searchResults:n,result:o,currentIndex:r}=e,f=r===0?r:r-1,s=n[r],m=n[f],w=m===s,g=m.pageNum!==s.pageNum,v=new RegExp(o.searchValue,"gi"),d=o.content.replace(v,function(x,k){return`<span class="highlight">${x}</span>`}),u=useDocumentStore(),y=x=>{core.setActiveSearchResult(toRaw(n[x]),x),u.setActiveSearchResult({index:x,searchResult:n[x]})};return(x,k)=>(openBlock(),createElementBlock(Fragment,null,[w||g?(openBlock(),createElementBlock("div",_hoisted_1$1j,toDisplayString(e.result.pageNum),1)):createCommentVNode("",!0),createBaseVNode("div",{class:"item-content",innerHTML:unref(d),onClick:k[0]||(k[0]=P=>y(e.currentIndex))},null,8,_hoisted_2$1a)],64))}},SearchContent_vue_vue_type_style_index_0_lang="",_hoisted_1$1i={class:"search-number"},_hoisted_2$19=createBaseVNode("div",{id:"findResultsCount",class:"toolbarLabel"},null,-1),_hoisted_3$10={class:"search-container"},_hoisted_4$e={key:1,class:"no-annotations"},_sfc_main$1B={__name:"SearchContent",setup(e){const n=useDocumentStore(),o=computed(()=>n.getSearchResults);return(r,f)=>{const s=_sfc_main$1C;return openBlock(),createElementBlock(Fragment,null,[withDirectives(createBaseVNode("div",_hoisted_1$1i,[_hoisted_2$19,createBaseVNode("div",null,toDisplayString(r.$t("panels.left.search.page")),1)],512),[[vShow,o.value.length]]),createBaseVNode("div",_hoisted_3$10,[o.value.length?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(o.value,(m,w)=>(openBlock(),createBlock(s,{key:m,searchResults:o.value,result:m,currentIndex:w},null,8,["searchResults","result","currentIndex"]))),128)):(openBlock(),createElementBlock("div",_hoisted_4$e,toDisplayString(r.$t("panels.left.search.noResults")),1))])],64)}}};var FUNC_ERROR_TEXT="Expected a function",NAN=0/0,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};function debounce(e,n,o){var r,f,s,m,w,g,v=0,d=!1,u=!1,y=!0;if(typeof e!="function")throw new TypeError(FUNC_ERROR_TEXT);n=toNumber(n)||0,isObject$1(o)&&(d=!!o.leading,u="maxWait"in o,s=u?nativeMax(toNumber(o.maxWait)||0,n):s,y="trailing"in o?!!o.trailing:y);function x(F){var O=r,I=f;return r=f=void 0,v=F,m=e.apply(I,O),m}function k(F){return v=F,w=setTimeout(E,n),d?x(F):m}function P(F){var O=F-g,I=F-v,X=n-O;return u?nativeMin(X,s-I):X}function S(F){var O=F-g,I=F-v;return g===void 0||O>=n||O<0||u&&I>=s}function E(){var F=now();if(S(F))return M(F);w=setTimeout(E,P(F))}function M(F){return w=void 0,y&&r?x(F):(r=f=void 0,m)}function T(){w!==void 0&&clearTimeout(w),v=0,r=g=f=w=void 0}function D(){return w===void 0?m:M(now())}function N(){var F=now(),O=S(F);if(r=arguments,f=this,g=F,O){if(w===void 0)return k(g);if(u)return w=setTimeout(E,n),x(g)}return w===void 0&&(w=setTimeout(E,n)),m}return N.cancel=T,N.flush=D,N}function isObject$1(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function isObjectLike(e){return!!e&&typeof e=="object"}function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&objectToString.call(e)==symbolTag}function toNumber(e){if(typeof e=="number")return e;if(isSymbol(e))return NAN;if(isObject$1(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=isObject$1(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=e.replace(reTrim,"");var o=reIsBinary.test(e);return o||reIsOctal.test(e)?freeParseInt(e.slice(2),o?2:8):reIsBadHex.test(e)?NAN:+e}var lodash_debounce=debounce;const SearchHeader_vue_vue_type_style_index_0_lang="",_hoisted_1$1h={id:"findbarInputContainer",class:"findbar-input-container"},_hoisted_2$18={class:"input-container"},_hoisted_3$$=["placeholder"],_hoisted_4$d={class:"button-container"},waitTime=200,_sfc_main$1A={__name:"SearchHeader",setup(e){const n=ref(!1),o=ref(""),r=useDocumentStore(),f=useViewerStore(),s=ref([]),m=ref(0),w=()=>{const k=s.value,P=m.value;if(k.length>0){const S=P<=0?k.length-1:P-1;core.setActiveSearchResult(toRaw(k[S]),S),r.setActiveSearchResult({index:S,searchResult:k[S]}),m.value=S}},g=()=>{const k=s.value,P=m.value;if(k.length>0){const S=P===k.length-1?0:P+1;core.setActiveSearchResult(toRaw(k[S]),S),r.setActiveSearchResult({index:S,searchResult:k[S]}),m.value=S}},v=()=>{n.value=!1,o.value="",r.setSearchResults([]),core.clearSearchResults(),s.value=[],r.setActiveSearchResult(null)},d=lodash_debounce(async k=>{if(k&&k.length>0){n.value=!0;const P=await core.search(k);r.setSearchResults(P),s.value=P,r.setActiveSearchResult({index:0,searchResult:P[0]})}else v()},waitTime),u=k=>{d(k)};watch(o,()=>{u(o.value),m.value=0});const y=computed(()=>f.getActiveElementTab("leftPanel")),x=computed(()=>f.isElementOpen("leftPanel"));return watch([y,x],()=>{(y.value!=="SEARCH"||!x.value)&&(core.clearSearchResults(),o.value="",m.value=0,r.setActiveSearchResult(null))}),(k,P)=>{const S=__unplugin_components_0$v,E=__unplugin_components_0$e,M=_sfc_main$4m,T=__unplugin_components_10$3;return openBlock(),createElementBlock("div",{id:"findbar",class:normalizeClass(["findbar",{mobile:unref(isMobileDevice)}])},[createBaseVNode("div",_hoisted_1$1h,[createBaseVNode("div",_hoisted_2$18,[withDirectives(createBaseVNode("input",{type:"text",autocomplete:"off",placeholder:k.$t("panels.left.search.placeholder"),"onUpdate:modelValue":P[0]||(P[0]=D=>o.value=D),name:"search"},null,8,_hoisted_3$$),[[vModelText,o.value]]),createVNode(S,{id:"emptyInput",class:normalizeClass(["empty-input",!o.value&&"hidden"]),onClick:v},null,8,["class"])]),createBaseVNode("div",_hoisted_4$d,[createVNode(M,{img:"icon-previous-left",id:"findPrevious",class:normalizeClass(["toolbarButton",!s.value.length&&"disabled"]),title:k.$t("panels.left.search.previous"),onClick:w},{default:withCtx(()=>[createVNode(E)]),_:1},8,["class","title"]),createVNode(M,{img:"icon-next-right",id:"findNext",class:normalizeClass(["toolbarButton",!s.value.length&&"disabled"]),title:k.$t("panels.left.search.next"),onClick:g},{default:withCtx(()=>[createVNode(T)]),_:1},8,["class","title"])])])],2)}}},_sfc_main$1z={};function _sfc_render$Q(e,n){const o=_sfc_main$1A,r=_sfc_main$1B;return openBlock(),createElementBlock(Fragment,null,[createVNode(o),createVNode(r)],64)}const __unplugin_components_6$1=_export_sfc(_sfc_main$1z,[["render",_sfc_render$Q]]),_sfc_main$1y={},_hoisted_1$1g={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$17=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11 6C11 6.55228 10.5523 7 10 7C9.44772 7 9 6.55228 9 6C9 5.44772 9.44772 5 10 5C10.5523 5 11 5.44772 11 6ZM11 10C11 10.5523 10.5523 11 10 11C9.44772 11 9 10.5523 9 10C9 9.44772 9.44772 9 10 9C10.5523 9 11 9.44772 11 10ZM10 15C10.5523 15 11 14.5523 11 14C11 13.4477 10.5523 13 10 13C9.44772 13 9 13.4477 9 14C9 14.5523 9.44772 15 10 15Z",fill:"currentColor"},null,-1),_hoisted_3$_=[_hoisted_2$17];function _sfc_render$P(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1g,_hoisted_3$_)}const __unplugin_components_4$4=_export_sfc(_sfc_main$1y,[["render",_sfc_render$P]]),SignatureContainer_vue_vue_type_style_index_0_lang="",_hoisted_1$1f={class:"container"},_hoisted_2$16={class:"signature-title"},_hoisted_3$Z={key:0,class:"signatures"},_hoisted_4$c=["onClick"],_hoisted_5$7=["title"],_hoisted_6$5={class:"drop-down medium"},_hoisted_7$5={key:1,class:"no-signatures"},_sfc_main$1x={__name:"SignatureContainer",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=computed(()=>o.getSignatures),f=computed(()=>o.getSelectedSignature),s=ref(!1),m=d=>{d<0||core.pageNumberChanged({value:(d*1+1).toString()})},w=()=>{s.value=!1,o.setSelectedSignature(null)},g=d=>{s.value=!1,n.openElement(d)},v=(d,u)=>{s.value=!0;const y=d.signature;y.index=u,o.setSelectedSignature(y)};return(d,u)=>{const y=__unplugin_components_0$g,x=__unplugin_components_1$2,k=__unplugin_components_2$b,P=__unplugin_components_4$4,S=_sfc_main$4m;return openBlock(),createElementBlock("div",_hoisted_1$1f,[createBaseVNode("div",_hoisted_2$16,toDisplayString(d.$t("panels.left.signatures.list")),1),r.value.length?(openBlock(),createElementBlock("div",_hoisted_3$Z,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,(E,M)=>(openBlock(),createElementBlock("div",{key:M,class:normalizeClass(["signature",{focus:f.value&&f.value.index===E.index}]),onClick:T=>m(E.pageIndex)},[(openBlock(!0),createElementBlock(Fragment,null,renderList(E.signature.signerList,(T,D)=>{var N;return openBlock(),createElementBlock(Fragment,null,[T.isCertTrusted&&T.isSignVerified?(openBlock(),createBlock(y,{key:0})):T.isCertTrusted||T.isSignVerified?(openBlock(),createBlock(x,{key:1})):(openBlock(),createBlock(k,{key:2})),createBaseVNode("span",{title:E.name},toDisplayString((T.certificateList[0].subject.CN?T.certificateList[0].subject.CN:"")+"'s signature"),9,_hoisted_5$7),createVNode(unref(NPopover),{placement:"bottom-start",trigger:"click","show-arrow":!1,to:"#outerContainer",raw:!0,show:((N=f.value)==null?void 0:N.index)===M&&s.value,onClickoutside:w},{trigger:withCtx(()=>[createVNode(S,{class:"more",onClick:withModifiers(F=>v(E,M),["stop"])},{default:withCtx(()=>[createVNode(P)]),_:2},1032,["onClick"])]),default:withCtx(()=>[createBaseVNode("div",_hoisted_6$5,[createBaseVNode("div",{class:"drop-item",onClick:u[0]||(u[0]=F=>g("signatureDetailsDialog"))},toDisplayString(d.$t("panels.left.signatures.details")),1),createBaseVNode("div",{class:"drop-item",onClick:u[1]||(u[1]=F=>g("certificateViewerDialog"))},toDisplayString(d.$t("panels.left.signatures.certification")),1),createBaseVNode("div",{class:"drop-item",onClick:u[2]||(u[2]=F=>g("deleteConfirmDialog"))},toDisplayString(d.$t("common.actions.delete")),1)])]),_:2},1032,["show"])],64)}),256))],10,_hoisted_4$c))),128))])):(openBlock(),createElementBlock("div",_hoisted_7$5,toDisplayString(d.$t("panels.left.signatures.empty")),1))])}}},Icon_vue_vue_type_style_index_0_lang="",_hoisted_1$1e=["xlink:href"],_sfc_main$1w={__name:"Icon",props:["className","color","glyph","fillColor","strokeColor","disabled"],setup(e){const n=e,o={filter:n.color};n.disabled||(o.color=n.color);const r=computed(()=>`#${n.glyph}`);return(f,s)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["icon",[e.className,{disabled:e.disabled}]]),style:o},[(openBlock(),createElementBlock("svg",mergeProps({class:"svg-icon","aria-hidden":"true"},toHandlers(f.$attrs,!0)),[createBaseVNode("use",{"xlink:href":r.value},null,8,_hoisted_1$1e)],16))],2))}};var axios$3={exports:{}},axios$2={exports:{}},bind$2=function e(n,o){return function(){for(var f=new Array(arguments.length),s=0;s<f.length;s++)f[s]=arguments[s];return n.apply(o,f)}},bind$1=bind$2,toString=Object.prototype.toString,kindOf=function(e){return function(n){var o=toString.call(n);return e[o]||(e[o]=o.slice(8,-1).toLowerCase())}}(Object.create(null));function kindOfTest(e){return e=e.toLowerCase(),function(o){return kindOf(o)===e}}function isArray(e){return Array.isArray(e)}function isUndefined(e){return typeof e>"u"}function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}var isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){var n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&isArrayBuffer(e.buffer),n}function isString(e){return typeof e=="string"}function isNumber(e){return typeof e=="number"}function isObject(e){return e!==null&&typeof e=="object"}function isPlainObject(e){if(kindOf(e)!=="object")return!1;var n=Object.getPrototypeOf(e);return n===null||n===Object.prototype}var isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList");function isFunction(e){return toString.call(e)==="[object Function]"}function isStream(e){return isObject(e)&&isFunction(e.pipe)}function isFormData(e){var n="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||toString.call(e)===n||isFunction(e.toString)&&e.toString()===n)}var isURLSearchParams=kindOfTest("URLSearchParams");function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function isStandardBrowserEnv(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function forEach(e,n){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),isArray(e))for(var o=0,r=e.length;o<r;o++)n.call(null,e[o],o,e);else for(var f in e)Object.prototype.hasOwnProperty.call(e,f)&&n.call(null,e[f],f,e)}function merge(){var e={};function n(f,s){isPlainObject(e[s])&&isPlainObject(f)?e[s]=merge(e[s],f):isPlainObject(f)?e[s]=merge({},f):isArray(f)?e[s]=f.slice():e[s]=f}for(var o=0,r=arguments.length;o<r;o++)forEach(arguments[o],n);return e}function extend$1(e,n,o){return forEach(n,function(f,s){o&&typeof f=="function"?e[s]=bind$1(f,o):e[s]=f}),e}function stripBOM(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}function inherits(e,n,o,r){e.prototype=Object.create(n.prototype,r),e.prototype.constructor=e,o&&Object.assign(e.prototype,o)}function toFlatObject(e,n,o){var r,f,s,m={};n=n||{};do{for(r=Object.getOwnPropertyNames(e),f=r.length;f-- >0;)s=r[f],m[s]||(n[s]=e[s],m[s]=!0);e=Object.getPrototypeOf(e)}while(e&&(!o||o(e,n))&&e!==Object.prototype);return n}function endsWith(e,n,o){e=String(e),(o===void 0||o>e.length)&&(o=e.length),o-=n.length;var r=e.indexOf(n,o);return r!==-1&&r===o}function toArray(e){if(!e)return null;var n=e.length;if(isUndefined(n))return null;for(var o=new Array(n);n-- >0;)o[n]=e[n];return o}var isTypedArray=function(e){return function(n){return e&&n instanceof e}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),utils$b={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isObject,isPlainObject,isUndefined,isDate,isFile,isBlob,isFunction,isStream,isURLSearchParams,isStandardBrowserEnv,forEach,merge,extend:extend$1,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,isTypedArray,isFileList},utils$a=utils$b;function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL$1=function e(n,o,r){if(!o)return n;var f;if(r)f=r(o);else if(utils$a.isURLSearchParams(o))f=o.toString();else{var s=[];utils$a.forEach(o,function(g,v){g===null||typeof g>"u"||(utils$a.isArray(g)?v=v+"[]":g=[g],utils$a.forEach(g,function(u){utils$a.isDate(u)?u=u.toISOString():utils$a.isObject(u)&&(u=JSON.stringify(u)),s.push(encode(v)+"="+encode(u))}))}),f=s.join("&")}if(f){var m=n.indexOf("#");m!==-1&&(n=n.slice(0,m)),n+=(n.indexOf("?")===-1?"?":"&")+f}return n},utils$9=utils$b;function InterceptorManager$1(){this.handlers=[]}InterceptorManager$1.prototype.use=function e(n,o,r){return this.handlers.push({fulfilled:n,rejected:o,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1};InterceptorManager$1.prototype.eject=function e(n){this.handlers[n]&&(this.handlers[n]=null)};InterceptorManager$1.prototype.forEach=function e(n){utils$9.forEach(this.handlers,function(r){r!==null&&n(r)})};var InterceptorManager_1=InterceptorManager$1,utils$8=utils$b,normalizeHeaderName$1=function e(n,o){utils$8.forEach(n,function(f,s){s!==o&&s.toUpperCase()===o.toUpperCase()&&(n[o]=f,delete n[s])})},utils$7=utils$b;function AxiosError$2(e,n,o,r,f){Error.call(this),this.message=e,this.name="AxiosError",n&&(this.code=n),o&&(this.config=o),r&&(this.request=r),f&&(this.response=f)}utils$7.inherits(AxiosError$2,Error,{toJSON:function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype=AxiosError$2.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){descriptors[e]={value:e}});Object.defineProperties(AxiosError$2,descriptors);Object.defineProperty(prototype,"isAxiosError",{value:!0});AxiosError$2.from=function(e,n,o,r,f,s){var m=Object.create(prototype);return utils$7.toFlatObject(e,m,function(g){return g!==Error.prototype}),AxiosError$2.call(m,e.message,n,o,r,f),m.name=e.name,s&&Object.assign(m,s),m};var AxiosError_1=AxiosError$2,transitional={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},utils$6=utils$b;function toFormData$1(e,n){n=n||new FormData;var o=[];function r(s){return s===null?"":utils$6.isDate(s)?s.toISOString():utils$6.isArrayBuffer(s)||utils$6.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function f(s,m){if(utils$6.isPlainObject(s)||utils$6.isArray(s)){if(o.indexOf(s)!==-1)throw Error("Circular reference detected in "+m);o.push(s),utils$6.forEach(s,function(g,v){if(!utils$6.isUndefined(g)){var d=m?m+"."+v:v,u;if(g&&!m&&typeof g=="object"){if(utils$6.endsWith(v,"{}"))g=JSON.stringify(g);else if(utils$6.endsWith(v,"[]")&&(u=utils$6.toArray(g))){u.forEach(function(y){!utils$6.isUndefined(y)&&n.append(d,r(y))});return}}f(g,d)}}),o.pop()}else n.append(m,r(s))}return f(e),n}var toFormData_1=toFormData$1,settle,hasRequiredSettle;function requireSettle(){if(hasRequiredSettle)return settle;hasRequiredSettle=1;var e=AxiosError_1;return settle=function(o,r,f){var s=f.config.validateStatus;!f.status||!s||s(f.status)?o(f):r(new e("Request failed with status code "+f.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(f.status/100)-4],f.config,f.request,f))},settle}var cookies,hasRequiredCookies;function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var e=utils$b;return cookies=e.isStandardBrowserEnv()?function(){return{write:function(r,f,s,m,w,g){var v=[];v.push(r+"="+encodeURIComponent(f)),e.isNumber(s)&&v.push("expires="+new Date(s).toGMTString()),e.isString(m)&&v.push("path="+m),e.isString(w)&&v.push("domain="+w),g===!0&&v.push("secure"),document.cookie=v.join("; ")},read:function(r){var f=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return f?decodeURIComponent(f[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),cookies}var isAbsoluteURL$1=function e(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)},combineURLs$1=function e(n,o){return o?n.replace(/\/+$/,"")+"/"+o.replace(/^\/+/,""):n},isAbsoluteURL=isAbsoluteURL$1,combineURLs=combineURLs$1,buildFullPath$1=function e(n,o){return n&&!isAbsoluteURL(o)?combineURLs(n,o):o},parseHeaders,hasRequiredParseHeaders;function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var e=utils$b,n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return parseHeaders=function(r){var f={},s,m,w;return r&&e.forEach(r.split(`
2692
+ `),I.location&&(Pe+=H("location")),Pe},U=async Pe=>{const Ae=Z(Pe);Ae.rect={width:582,height:187,top:0,left:0,right:582,bottom:187};const Te=await core.getSignature(Ae);f.setDigitalSignaturePreview(Te)},H=Pe=>{let Ae={};switch(Pe){case"name":Ae.title=r("signatures.appearance.name"),Ae.value=S.value.CN;break;case"date":const Te=new Date,Ee=Te.getFullYear(),Be=Te.getMonth()+1<10?`0${Te.getMonth()+1}`:Te.getMonth()+1,Ve=Te.getDate()<10?`0${Te.getDate()}`:Te.getDate(),_e=Te.getHours()<10?`0${Te.getHours()}`:Te.getHours(),ve=Te.getMinutes()<10?`0${Te.getMinutes()}`:Te.getMinutes(),be=Te.getSeconds()<10?`0${Te.getSeconds()}`:Te.getSeconds(),ke=`${Ee}.${Be}.${Ve} ${_e}:${ve}:${be}`;Ae.title=r("signatures.appearance.date"),Ae.value=ke;break;case"reason":Ae.title=r("signatures.appearance.reason"),Ae.value=I.reasonText;break;case"dName":const Le=["CN","O","OU","email","L","ST","C"].map(Oe=>`${Oe}=${S.value[Oe]}`).join(",");Ae.title=r("signatures.appearance.distinguishableName"),Ae.value=Le;break;case"version":Ae.title=r("signatures.appearance.version"),Ae.value="2.7.6";break;case"location":Ae.title=r("signatures.appearance.location"),Ae.value=I.locationText;break}return I.labels?`${Ae.title}: ${Ae.value}`:Ae.value},Z=Pe=>{const Ae={content:Pe,isContentAlginLeft:I.alignment!=="left"};return v.value!=="keyboard"?Ae.text="":Ae.text=D.value,(v.value==="image"||v.value==="trackpad")&&(Ae.imageBase64=N.value),I.logo&&(Ae.isDrowLogo=!0,Ae.logoBase64="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAEYCAYAAACHjumMAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA9kSURBVHgB7d1vbJXlGcfx635KpUWqJWgiZGgxg2ZG52k1pmqmJdYl6kZwW8S5F4hlKvGFmG3RZWYU4wuX7QUsMdpsSn3j3LJMo3FLJobqMmMWpDUuS4BkdpKAyWAFi4JAz737Oj2Hlv45PX+e+/x57u8nOZ4/Lbw4nvPjuq77fp7HSAy67x9tPSWyzhhJpSNzhbGSsmJa3fNWAeqBtSNiZMSk7YfWyLCkZfD9gSUjgrIYKVEmVKLoUTG22/013QIkjBE7bK3dQdiUruiAyQWLFdlChYJgWBmQdHobQVOcogKm64HjWwkWBM1K3/svXrxNUJCCAqbr/tE20xC96sIlJUDorIy4amYN1cz8ovl+oav3sw02ioYIFyDLSJttiIZu7B1dJ8grb8BoS+TieoCWCDifK/1brUSvTnxHMJc5W6TMG2ekTwDkx1xmTrMGjJZ+ms4CoEDm/vdfuOglwXlmBIwOdHXmQlsEFM7NKI+Z8XQHg9/zzZzBRNFuwgUojs5kdKVVcJ7zAiY7d2kTAEXTldauB0b7BOeca5G0NZKG6GMBUDJtlZrH0ysHB5YcE0ypYFgxAsqmrdKpSLYIMjIVDNULEB+qmElR9r/dAiAWVDGTMgFjTPSoAIiPabhVIIb2CPCjaTy9JPQ2KaI9AvxwbVLwB0NGenpLARA7vlsuYGxkrhUAsUtHUZsELnJraisFQOxcBRP8P96RW0K6QgDEznJM3/xntANQGt0PI4EjYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANAQPAmwUCFGjZUiOXXRLJMr0tjTLPFy8y0uJu+ppa3DzxHBM6v/+8lTpgjYyIdbe0fOieDcu4DA7fsXlEykTAYAYNiK+uiGTVigZZ7e5XX94gl7lAITiSy1hpc3dtrqfpds8yvU1qV/+wpNM7ygkbAgaZ4PhGxwIXJg1yi7vX6gQwYlMSmZ0TYfP8gJyx24oNGtPVe7wuSjjEq6O9QW7taJROd6+VCvzofLtfksQa0zd820PbCv19AiYguVC586ZG2p0KSVrAZI3YM3ZNIdUMLVLCESrwoM00ypCb0Wwc7nnotXy/SMAkkAbJHS5QbnXzlM52/hfDB9PqZjSvpt7uz9sy8elLEA2We3oaZX3PQqoVVISxts+FjMwVMgRMAugelN61C+UuV7UAlZYJmV39I65demn6z1iPrGMaLM/+ZJH86ZnFhAuqykh6e+ovz7VNf50Kpg5RsaD2uJlMo3nVPeiY+ioVTB3RuUrv2gvkpZ9fSLigBtlU6q3n+qa+QsDUCd1h+9LWC2XT2iYGuKhZxsijqd07W3PPaZFqnLZDT25sYrkZdcK0ytlTW9yDPn1GBVPD1vdMtEOEC+rJ1CqGT24NompBfZusYvgE1xitWnSFiDkL6pkx5la9J2BqRG6FSHfhAgnQrW0SAVMDchvmOA8LEuXMqXUETJXp8vOTG5tpiZA8kUkRMFW0aa3OW5oESCJjbRsBUyVb7l3IvAXJZsy1BEyFaSv0zCPNLEEjAJYhbyXpMPcXLlw4By7CYAiYSmGlCCHi014BhAtCxSfeM8IFIeNT7xHhgtDxyfdEV4t0oEu4IGR8+j352cYmVosQPALGA91Epxc7A0JHwMRsE0dEA+cQMDHSAxc5tgiYRMDEZOIsdM0CYBIBEwNdMdLlaE65AJyPgImBnomO5WhgJr4VZbrz5kaGusAcCJgy6Nxly3qGusBcCJgy6KVFmLsAcyNgSqT7XThpFJAfAVMCbY3uYe4CzIuAKQEXRgMKQ8AUSVeN7rqJ44yAQhAwRdCqZdNaWiOgUARMEdb3NLKhDigC35YC6WCXAxmB4hAwBeqlNQKKRsAUQKsXBrtA8QiYAlC9AKUhYOZB9QKUjoCZB9ULUDoCJg+qF6A8BEweVC9AeQiYPDrbua4RUA4CZg56zBG7doHy8A2aw709FwiA8nDGpFmsXtHAZV8LdPjUmOz53yHZd+Jo5vEhdxs7czpzDxAws7jndqqXfD4YPSS7/zsig+5GkCAfAmYWDHdnGjv7pbx88J/y8icfZR4DhSBgptFwYbg7iWBBOQiYae68mfYoR0Ol/+MPCBaUjICZhvZIMnOVvn8Nyh43awHKQcBMQXtE1YJ4ETBT3NIR9nFHvzrwXiZggLgQMFOE3B5tdS3RG4f3CRAnAiZLj5wOdXPdvf/4o+wfOypA3FiPzVq1Isy3QisXwgW+EDBZIc5f+v+9h7YIXhEwWasDq2Byq0WATwSMTFyxMaT5i+5zIVxQCQSMhDd/+eHeN9jngoogYESCql5edzOXwyc5AhqVQcCI7n8JY7We1giVRsCI7oExEoKXD35E9YKKImAkjBZJq5c3Du0XoJKCDxjdwRsCPTKawS4qjYBZGkZ7xOwF1RB8wFx2SfLbIz2HLrMXVAMVTAAVzOuHmb2gOgiYAGYwe45xZjpUR/AB09Kc7ApGV49oj1AtwQfM4kWSaPvHjghQLVQwi5JdwezjXC+oIiqYRcl+C/SSrkC1EDDNkmiHubQrqogWKeEt0mdnTgtQLRyLlHBUMKgmAgaANwQMAG8IGADeEDAJt6ypRYBqCT5gxr6wkmQXNV4gQLUEHzAnTkqiUcGgmmiREm45AYMqCj5gDh8ZlyRbvXipANVCi/SFJNr1S5YLUC0MeU8me8i7vLmFOQyqhhbpSFqSbs2lbQJUAwFzNNkVjOomYFAlwQfMpwkf8iqdw7QsWChApVHBBFDBqPtWXC1ApREwbgaT9N286r7Lr6GKQcWx0c759GjyB70aLlQxqDQCxtl/MPkBo6hiUGkEjHPgk+QPepWGy4MrOwWoFALGOXAwjIBRP7j863Jd6zIBKoGAEQ2YMFqknG1XraFVQkUQMDJxTphQlquVHj5Aq4RKIGCy3h06IyHRVum+FdcI4BMBkxXKStJUP159k3xrWbsAvhAwWX8LrILJeeqqblndwjlj4AcBk6VzmJBWk6Z65YbvUcnACwJmir37wgwYpZXMgyuvEyBOBMwUoQ16p3v4yuvlR6tuZAkbsSFgptAKJoQDH/PR1aXf3fBdzoKHWBAw0/z5vbCrGKX7ZN68+T7p+1o3QYOyEDDThN4mTbV2ebv8pvPbmf0ytE0ohenqPR52TzCLv/66RVoWGcGkQyfHZM/oIen/+AM5fGpMgEI0fKXzp32C8yy9OJKrr2wQTGppXCjtLZe4Gc01cl32UihjZ0/LCXcD5rJAMIO2Set7uKbzXPQcv7nrLWlls+/EEdk/dtTdH8081+ChyoEiYGahq0l7952VznbenvnoQFhvay5dKZip8+1+CRlD3jm8O3RWAJSHgJmDLleHvicGKBcBMwcNlz/sYoAJlIOAyeP3BAxQFgImD61i3mRnL1AyAmYeL7z+pQAoDQEzD73yoy5ZAygeAVOAp3eeEgDFI2AKoFUMsxigeARMgXQWw74YoDgETIG0imFfDFAcAqYIui/m8NHwLm8ClIqAKYK2SNtfYeALFIqAKZIeBMmyNVAYAqYEumzNwBeYHwFTAh34vsgOX2BeBEyJXnEDX1olID8Cpgy0SkB+BEwZaJWA/AiYMmmrxHljgNkRMDHQwwjYgAfMRMDEQOcwj/zyC+YxwDQETEx0HvP0zpMCYBIBEyPd5csZ8IBJBEzMfusChqEvMIGA8UAPiGQTHkDAePPEsyflwMFxAUJGwHiiK0qPu5Bh+RohI2A80pUlXb4mZBAqAsYzQgYhI2AqgJBBqAiYCsmFDINfhCSyIscEFZELmXeGuMYSwhAZa48LKkZXl3QJm814CEFkjB0WVJxuxuOwAiRdJGkZEVSFHlbw+LMchY3kiqwRKpgq0gMkNzz1OStMSKSoKS2vCapKh78btn3OXAaJEw0OLHGrSGZQUFW5q0bqOWVomZAUE/tg7Pg7gprw5t/PZFomjsZGEmQCxrVJ29kPUzty+2V0lYlqBvUsEzDaJhmb3iGoKbrKpNXMm++xMQ/16dyhAlQxtSlzrt8XT2ZmM6w0od6cCxiqmNqWmc24lSY256GemOkv3Nh7fMhVMilBzVp2SSS9axfKXTc1Cmpb59v9ErIZR1PbxvTdtEq1Ldc2feeJE8xnUNPMbC92PTB6v5hop6AuUNHUrtArGDPXD7o2He8TK1sFdSMXNJ3tDbJsKaf6qQUETB6ETP266+ZGWd+zUFatIGiqiYCZx429o+vSEu10v9gqqDurVjTI+tsvoKqpEgKmAF0Pj7bJmWi3e9gmqFud7QvkTlfZEDaVQ8AUgZYpOTRsbulYkLmnjfKHgClStprpcw83CBJBh8PaSmngrHb3BE58CJgSZYLmtHS7v2KLGHOtIDFaFplM4GjQdLgKZ3kmgAidUhAwMciFjTFRylqru4DbXOhcIUgUndtotXOZuy1bajLPF7swasne9PHi5omAwgQCJnAdu57nfAiAJ9S9ALwhYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANAQPAGwIGgDcEDABvCBgA3hAwALwhYAB4Q8AA8IaAAeANASP2mADwgoAROS4AfBgJPmCsNcMCIH7W/ocKxsiIAIidNWaYgDGWCgbwwX23CJio6TUBEL9IBoMPmOE1G3UVaVAAxGl4eM1mhrzKWvuOAIiNNXaH3hMwakHTdvbDADGKJroCAkYm2iRrZYcAKJsxMqDtkT4mYHKoYoBYpCO7LfeYgMmiigHKZ6zdlqteMs8F5+nY1T/kKpmUACiOkZGh2x5eOfUlKphpbEP6bloloEjGHrORXTP9ZQJmGi3vrJHHBEDBrI02Tm2NcgiYWQzftnlAe0kBMK/M3KXnoVl3xDODyaPzref6rDFbBcCsNFz23r65b86fC/JK7epfZyS9071VrQJggpu5mHF5bO83Nw/k/TXBvFK7n2szabNbrLQJEDwzrIshs81cZvymoGC0TAiaVi1p2ZGvJZrxRwRFyVQz49Ln3roNAoQgGyzpBU3bs2cfKPyPCkqiQSNp6TbWbHFPrxUgaax9xwXEYCnBkkPAxCAXNpE1KWttyr2rbe6tvUKAeuAqFDdfPO5uw8aYkbSe5TFqeq3UUJnq/zPmsRQ9GquGAAAAAElFTkSuQmCC"),v.value==="none"&&(Ae.isDrawOnlyContent=!0),Ae},Y=async Pe=>{if(!(Pe===v.value&&["image","none"].includes(Pe))){if(core.handleSign({flag:"create",type:1}),f.setActiveSignWay(Pe),Pe==="trackpad"&&f.openElement("digitalSignCreatePanel"),Pe==="keyboard"){f.openElement("digitalKeyboardCreatePanel"),await nextTick();const Ae=document.querySelector(".digital-signature-dialog .keyboard-paint input");Ae.select(),Ae.focus()}Q()}},W=Pe=>{f.closeElement(dialogName$2),v.value!=="trackpad"&&Q(),core.handleSign({flag:"reset"}),document.body.style.overflow="",!d.value&&Pe==="cancel"&&k.value&&P.value&&f.openElement("selectSignTypeDialog"),f.setActiveSignWay("keyboard"),Object.assign(I,{name:!0,dName:!1,date:!0,version:!1,logo:!0,location:!1,reason:!1,labels:!0,alignment:"left",reasonText:r("signatures.none"),locationText:""})},Q=async()=>{N.value="",v.value==="trackpad"&&core.handleSign({flag:"clear"});const Pe=re();await U(Pe)},oe=()=>{M.value.click()},Ce=async Pe=>{let Ae=Pe.target.files[0];if(Ae.size>1024*1024){window.$message.error(r("signatures.uploadError"),{duration:5e3,icon:()=>h$1("img",{src:MessageError})}),Pe.target.value="";return}const Te=new FileReader,Be=await new Promise((_e,ve)=>{Te.addEventListener("load",async be=>{_e(be.target.result)}),Te.addEventListener("error",()=>{ve("Error reading the local image")}),Te.readAsDataURL(Ae)});N.value=Be;const Ve=re();await U(Ve)},Se=async()=>{f.setCommonLoading(!0);const Pe=re(),Ae=Z(Pe),Te=s.getPkcs12;await core.handleSign({type:1,flag:"save",param:{annotation:toRaw(f.getSelectedSignatureField),...Ae},pkcs12Buffer:Te.pkcs12Buffer,password:Te.password}),W(),f.setCommonLoading(!1),O.value&&T.value.length<5&&f.addDigitalSignature(u.value)},fe=()=>{v.value==="keyboard"&&Y("keyboard"),v.value==="trackpad"&&Y("trackpad")};return(Pe,Ae)=>{const Te=__unplugin_components_0$w,Ee=__unplugin_components_1$d,Be=__unplugin_components_2$e,Ve=__unplugin_components_14$3,_e=_sfc_main$4m,ve=__unplugin_components_1$f,be=__unplugin_components_6$a,ke=__unplugin_components_7$9,Me=__unplugin_components_0$s,Le=_sfc_main$4f,Oe=_sfc_main$1T,ze=_sfc_main$1U,We=__unplugin_components_2$f;return openBlock(),createElementBlock(Fragment,null,[g.value?(openBlock(),createElementBlock("div",_hoisted_1$1z,[createVNode(Le,{show:g.value,dialogName:dialogName$2,class:"appearance-dialog"},createSlots({header:withCtx(()=>[createBaseVNode("p",null,toDisplayString(unref(r)("signatures.appearance.title")),1),createVNode(Te,{class:"close",onClick:W})]),default:withCtx(()=>[createBaseVNode("div",_hoisted_2$1q,[createBaseVNode("div",_hoisted_3$1f,[createBaseVNode("div",{onClick:Ae[0]||(Ae[0]=Ge=>F.value="list"),class:normalizeClass({active:F.value==="list"})},toDisplayString(unref(r)("signatures.electronicSignature.mySignatures")),3),createBaseVNode("div",{onClick:Ae[1]||(Ae[1]=Ge=>F.value="create"),class:normalizeClass({active:F.value==="create"})},toDisplayString(unref(r)("signatures.electronicSignature.create")),3)]),F.value==="list"?(openBlock(),createElementBlock("div",_hoisted_4$p,[T.value.length===0?(openBlock(),createElementBlock("div",_hoisted_5$g,[createBaseVNode("div",_hoisted_6$c,[E.value==="Light"?(openBlock(),createBlock(Ee,{key:0})):(openBlock(),createBlock(Be,{key:1})),createBaseVNode("div",{onClick:Ae[2]||(Ae[2]=Ge=>F.value="create")},toDisplayString(unref(r)("signatures.electronicSignature.empty")),1)])])):(openBlock(),createElementBlock("div",_hoisted_7$b,[(openBlock(!0),createElementBlock(Fragment,null,renderList(T.value,(Ge,Xe)=>(openBlock(),createElementBlock("div",{class:"signatures-popup-list",key:Xe},[createBaseVNode("img",{onClick:qe=>J(Ge),src:Ge},null,8,_hoisted_8$8),createVNode(_e,{class:"close-button",onClick:qe=>X(Xe)},{default:withCtx(()=>[createVNode(Ve)]),_:2},1032,["onClick"])]))),128))]))])):(openBlock(),createElementBlock("div",_hoisted_9$8,[createBaseVNode("div",_hoisted_10$8,[createBaseVNode("div",{onClick:Ae[3]||(Ae[3]=Ge=>Y("keyboard")),class:normalizeClass({active:v.value==="keyboard"})},toDisplayString(unref(r)("signatures.keyboard")),3),createBaseVNode("div",{onClick:Ae[4]||(Ae[4]=Ge=>Y("trackpad")),class:normalizeClass({active:v.value==="trackpad"})},toDisplayString(unref(r)("signatures.trackpad")),3),createBaseVNode("div",{onClick:Ae[5]||(Ae[5]=Ge=>Y("image")),class:normalizeClass({active:v.value==="image"})},toDisplayString(unref(r)("signatures.image")),3),createBaseVNode("div",{onClick:Ae[6]||(Ae[6]=Ge=>Y("none")),class:normalizeClass({active:v.value==="none"})},toDisplayString(unref(r)("signatures.none")),3)]),createBaseVNode("div",{class:"preview-area",onClick:Ae[7]||(Ae[7]=Ge=>fe())},[createBaseVNode("img",{src:u.value},null,8,_hoisted_11$6)]),createBaseVNode("div",_hoisted_12$5,[v.value==="image"?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode("span",{class:"upload",onClick:oe},[createTextVNode(toDisplayString(unref(r)("common.actions.upload")),1),createBaseVNode("input",{ref_key:"uploadImageEl",ref:M,type:"file",onChange:Ce,accept:".png, .jpg, .jpeg",name:"signature"},null,544)]),createBaseVNode("span",{onClick:Q},toDisplayString(unref(r)("common.actions.clear")),1)],64)):createCommentVNode("",!0)]),createBaseVNode("p",_hoisted_13$5,toDisplayString(unref(r)("signatures.appearance.includeText")),1),createBaseVNode("div",_hoisted_14$5,[createBaseVNode("div",_hoisted_15$5,[createBaseVNode("div",_hoisted_16$4,[createBaseVNode("div",{class:"check-box",onClick:Ae[8]||(Ae[8]=Ge=>I.name=!I.name)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.name}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.name]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.name")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[9]||(Ae[9]=Ge=>I.dName=!I.dName)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.dName}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.dName]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.distinguishableName")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[10]||(Ae[10]=Ge=>I.date=!I.date)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.date}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.date]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.date")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[11]||(Ae[11]=Ge=>I.version=!I.version)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.version}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.version]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.version")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[12]||(Ae[12]=Ge=>I.logo=!I.logo)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.logo}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.logo]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.logo")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[13]||(Ae[13]=Ge=>I.location=!I.location)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.location}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.location]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.location")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[14]||(Ae[14]=Ge=>I.reason=!I.reason)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.reason}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.reason]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.reason")),1)]),createBaseVNode("div",{class:"check-box",onClick:Ae[15]||(Ae[15]=Ge=>I.labels=!I.labels)},[createBaseVNode("div",{class:normalizeClass(["check",{active:I.labels}])},[withDirectives(createVNode(ve,null,null,512),[[vShow,I.labels]])],2),createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.labels")),1)])])]),createBaseVNode("div",_hoisted_17$3,[createBaseVNode("div",_hoisted_18$3,[createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.textAlignment")),1),createBaseVNode("div",_hoisted_19$2,[createBaseVNode("div",{class:normalizeClass({active:I.alignment==="left"}),onClick:Ae[16]||(Ae[16]=Ge=>I.alignment="left")},[createVNode(be)],2),createBaseVNode("div",{class:normalizeClass({active:I.alignment==="right"}),onClick:Ae[17]||(Ae[17]=Ge=>I.alignment="right")},[createVNode(ke)],2)])]),I.reason||I.location?(openBlock(),createElementBlock("div",_hoisted_20$2,[I.reason?(openBlock(),createElementBlock("div",_hoisted_21$2,[createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.reason")),1),createBaseVNode("div",_hoisted_22$2,[withDirectives(createBaseVNode("select",{"onUpdate:modelValue":Ae[18]||(Ae[18]=Ge=>I.reasonText=Ge)},[createBaseVNode("option",{value:unref(r)("signatures.none")},toDisplayString(unref(r)("signatures.none")),9,_hoisted_23$2),createBaseVNode("option",{value:unref(r)("signatures.appearance.docOwner")},toDisplayString(unref(r)("signatures.appearance.docOwner")),9,_hoisted_24$2),createBaseVNode("option",{value:unref(r)("signatures.appearance.approving")},toDisplayString(unref(r)("signatures.appearance.approving")),9,_hoisted_25$2),createBaseVNode("option",{value:unref(r)("signatures.appearance.reviewed")},toDisplayString(unref(r)("signatures.appearance.reviewed")),9,_hoisted_26$2)],512),[[vModelSelect,I.reasonText]]),createVNode(Me)])])):createCommentVNode("",!0),I.location?(openBlock(),createElementBlock("div",_hoisted_27$2,[createBaseVNode("span",null,toDisplayString(unref(r)("signatures.appearance.location")),1),withDirectives(createBaseVNode("input",{type:"text","onUpdate:modelValue":Ae[19]||(Ae[19]=Ge=>I.locationText=Ge),name:"signature"},null,512),[[vModelText,I.locationText]])])):createCommentVNode("",!0)])):createCommentVNode("",!0)])])]))])]),_:2},[F.value==="create"?{name:"footer",fn:withCtx(()=>[createBaseVNode("div",_hoisted_28$2,[createBaseVNode("div",{class:normalizeClass(["check",{active:O.value,disabled:T.value.length>=5}]),onClick:Ae[20]||(Ae[20]=Ge=>T.value.length<5&&(O.value=!O.value))},[withDirectives(createVNode(ve,null,null,512),[[vShow,O.value]])],2),T.value.length<5?(openBlock(),createElementBlock("span",_hoisted_29$2,toDisplayString(unref(r)("signatures.electronicSignature.saveTemplate")),1)):(openBlock(),createElementBlock("span",_hoisted_30$2,toDisplayString(unref(r)("signatures.fullStorage")),1))]),createBaseVNode("div",_hoisted_31$2,[createBaseVNode("div",{class:"rect-button white",onClick:Ae[21]||(Ae[21]=Ge=>W("cancel"))},toDisplayString(unref(r)("common.actions.cancel")),1),createBaseVNode("div",{class:"rect-button blue",onClick:Se},toDisplayString(unref(r)("common.actions.ok")),1)])]),key:"0"}:void 0]),1032,["show"]),withDirectives(createVNode(Oe,{onModifyImage:te},null,512),[[vShow,y.value]]),x.value?(openBlock(),createBlock(ze,{key:0,text:D.value,onModifyText:q},null,8,["text"])):createCommentVNode("",!0)])):createCommentVNode("",!0),m.value?(openBlock(),createElementBlock("div",_hoisted_32$1,[createVNode(Le,{show:m.value,dialogName:dialogName$2},{footer:withCtx(()=>[createBaseVNode("div",{class:"rect-button white",onClick:Ae[22]||(Ae[22]=Ge=>m.value=!1)},toDisplayString(unref(r)("common.actions.cancel")),1),createBaseVNode("div",{class:"rect-button blue",onClick:ne},toDisplayString(unref(r)("common.actions.ok")),1)]),default:withCtx(()=>[createVNode(We),createBaseVNode("p",null,toDisplayString(unref(r)("signatures.deleteConfirm")),1)]),_:1},8,["show"])])):createCommentVNode("",!0)],64)}}},SelectSignTypeDialog_vue_vue_type_style_index_0_lang="",_hoisted_1$1y={key:0,class:"select-type-popup"},_hoisted_2$1p={class:"title title-color"},_hoisted_3$1e={class:"select-text"},_hoisted_4$o={class:"text"},_hoisted_5$f={class:"title"},_hoisted_6$b={class:"text"},_hoisted_7$a={class:"title"},dialogName$1="selectSignTypeDialog",_sfc_main$1R={__name:"SelectSignTypeDialog",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=computed(()=>n.isElementOpen(dialogName$1)),f=computed(()=>o.getActiveTool),s=computed(()=>o.getDisableDigitalSignature),m=computed(()=>o.getDisableElectronicSignature),w=ref("electronic"),g=u=>{n.setSelectedSignatureField(u),f.value==="addDigitalSign"||!s.value&&m.value?n.openElement("addDigitalFileDialog"):f.value==="addElectronicSign"||s.value&&!m.value?d():n.openElement("selectSignTypeDialog")};core.addEvent("openSelectSignTypeDialog",g);const v=()=>{n.closeElement(dialogName$1),document.body.style.overflow="hidden",w.value==="digital"?n.openElement("addDigitalFileDialog"):d()},d=()=>{n.toggleElement("signCreatePanel"),n.setActiveToolMode("sign"),n.toggleActiveHand(!1),core.switchTool(0),core.switchAnnotationEditorMode(0)};return(u,y)=>{const x=__unplugin_components_0$u,k=__unplugin_components_1$9,P=_sfc_main$4f;return r.value?(openBlock(),createElementBlock("div",_hoisted_1$1y,[createVNode(P,{show:r.value,dialogName:dialogName$1,close:!0},{footer:withCtx(()=>[createBaseVNode("div",{class:"rect-button blue",onClick:v},toDisplayString(u.$t("signatures.startSigning")),1)]),default:withCtx(()=>[createBaseVNode("p",_hoisted_2$1p,toDisplayString(u.$t("signatures.electronicSignature.title")),1),createBaseVNode("div",_hoisted_3$1e,[createBaseVNode("div",{onClick:y[0]||(y[0]=S=>w.value="electronic"),class:"option"},[w.value==="electronic"?(openBlock(),createBlock(x,{key:0})):(openBlock(),createBlock(k,{key:1})),createBaseVNode("div",_hoisted_4$o,[createBaseVNode("p",_hoisted_5$f,toDisplayString(u.$t("signatures.electronic.title")),1),createBaseVNode("p",null,toDisplayString(u.$t("signatures.electronic.description")),1)])]),createBaseVNode("div",{onClick:y[1]||(y[1]=S=>w.value="digital"),class:"option"},[w.value==="digital"?(openBlock(),createBlock(x,{key:0})):(openBlock(),createBlock(k,{key:1})),createBaseVNode("div",_hoisted_6$b,[createBaseVNode("p",_hoisted_7$a,toDisplayString(u.$t("signatures.digital.title")),1),createBaseVNode("p",null,toDisplayString(u.$t("signatures.digital.description")),1)])])])]),_:1},8,["show"])])):createCommentVNode("",!0)}}},PreventDialog_vue_vue_type_style_index_0_lang="",_hoisted_1$1x={key:0,class:"edit-dialog"},_hoisted_2$1o={class:"edit"},_hoisted_3$1d={class:"close"},_hoisted_4$n={class:"warning"},_hoisted_5$e={class:"title"},_hoisted_6$a={class:"des"},_sfc_main$1Q={__name:"PreventDialog",setup(e){const n=useViewerStore(),o=computed(()=>n.isElementOpen("contentEditorPreventDialog")),r=computed(()=>n.isElementOpen("docEditorPreventDialog")),f=()=>n.closeElement(o.value?"contentEditorPreventDialog":"docEditorPreventDialog");return(s,m)=>{const w=__unplugin_components_14$3,g=__unplugin_components_2$f;return o.value||r.value?(openBlock(),createElementBlock("div",_hoisted_1$1x,[createBaseVNode("div",_hoisted_2$1o,[createBaseVNode("div",_hoisted_3$1d,[createVNode(w,{onClick:f})]),createBaseVNode("div",_hoisted_4$n,[createVNode(g)]),createBaseVNode("div",_hoisted_5$e,toDisplayString(s.$t("prevent.title")),1),createBaseVNode("div",_hoisted_6$a,toDisplayString(o.value?s.$t("prevent.description"):s.$t("prevent.description1")),1),createBaseVNode("div",{class:"button",onClick:f},toDisplayString(s.$t("common.actions.ok")),1)])])):createCommentVNode("",!0)}}},SettingsDialog_vue_vue_type_style_index_0_lang="",_hoisted_1$1w={class:"settings-popup"},_hoisted_2$1n={class:"title"},_hoisted_3$1c={class:"container"},_hoisted_4$m={class:"info"},_hoisted_5$d={class:"row"},_hoisted_6$9={class:"row"},_hoisted_7$9={class:"row"},_hoisted_8$7={class:"select-box"},_hoisted_9$7=["value"],_hoisted_10$7={class:"row"},_hoisted_11$5={class:"controller"},_hoisted_12$4={class:"row"},_hoisted_13$4={class:"controller"},_hoisted_14$4={class:"row"},_hoisted_15$4={class:"controller"},_hoisted_16$3={class:"title"},_hoisted_17$2={class:"version row"},_hoisted_18$2=createBaseVNode("span",null,"2.7.6",-1),_sfc_main$1P={__name:"SettingsDialog",setup(e){const{i18next:n}=useTranslation(),o=useViewerStore(),r=useDocumentStore(),f=ref(r.getAuthor),s=ref(r.getAnnotator),m=computed(()=>o.isElementOpen("settingsDialog")),w=computed(()=>r.getAuthor),g=computed(()=>r.getAnnotator),v=ref(n.language),d=ref(!0),u=ref(!0),y=ref(!1),x=ref(!1),k=computed(()=>o.getLanguages);watch(()=>m.value,(E,M)=>{E&&(d.value=r.getHighlightLink,u.value=r.getHighlightForm,y.value=!1)}),watch(()=>n.language,E=>{v.value=E}),watch(w,(E,M)=>{f.value=E}),watch(g,(E,M)=>{s.value=E}),watch(x,E=>{E?core.enableFillConsecutively():core.disableFillConsecutively(),y.value=!0}),watch([f,s,v,d,u],(E,M)=>{E[0]!==r.getAuthor||E[1]!==r.getAnnotator||E[2]!==n.language||E[3]!==r.getHighlightLink||E[4]!==r.getHighlightForm?y.value=!0:y.value=!1});const P=()=>{o.closeElement("settingsDialog"),v.value=n.language},S=async()=>{await n.changeLanguage(v.value),window.localStorage.setItem("language",v.value),o.closeElement("settingsDialog"),r.setAuthor(f.value?f.value:"ComPDFKit"),r.setAnnotator(s.value?s.value:"Guest"),r.setHighlightLink(d.value),r.setHighlightForm(u.value)};return(E,M)=>{const T=__unplugin_components_0$z,D=_sfc_main$4f;return openBlock(),createElementBlock("div",_hoisted_1$1w,[createVNode(D,{show:m.value},{footer:withCtx(()=>[createBaseVNode("div",{class:"rect-button white",onClick:P},toDisplayString(E.$t("common.actions.cancel")),1),createBaseVNode("div",{class:normalizeClass(["rect-button blue",{disabled:!y.value}]),onClick:S},toDisplayString(E.$t("common.actions.save")),3)]),default:withCtx(()=>[createBaseVNode("p",_hoisted_2$1n,toDisplayString(E.$t("toolbar.settings.title")),1),createBaseVNode("div",_hoisted_3$1c,[createBaseVNode("div",_hoisted_4$m,[createBaseVNode("div",_hoisted_5$d,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.author")),1),withDirectives(createBaseVNode("input",{type:"text",placeholder:"ComPDFKit","onUpdate:modelValue":M[0]||(M[0]=N=>f.value=N),name:"settings"},null,512),[[vModelText,f.value]])]),createBaseVNode("div",_hoisted_6$9,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.annotator")),1),withDirectives(createBaseVNode("input",{type:"text",placeholder:"Guest","onUpdate:modelValue":M[1]||(M[1]=N=>s.value=N),name:"settings"},null,512),[[vModelText,s.value]])]),createBaseVNode("div",_hoisted_7$9,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.language")),1),createBaseVNode("div",_hoisted_8$7,[withDirectives(createBaseVNode("select",{name:"language","onUpdate:modelValue":M[2]||(M[2]=N=>v.value=N)},[(openBlock(!0),createElementBlock(Fragment,null,renderList(k.value,N=>(openBlock(),createElementBlock("option",{value:N.code},toDisplayString(N.name),9,_hoisted_9$7))),256))],512),[[vModelSelect,v.value]]),createVNode(T)])])]),createBaseVNode("div",_hoisted_10$7,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.highlightLink")),1),createBaseVNode("div",_hoisted_11$5,[createVNode(unref(NSwitch),{value:d.value,"onUpdate:value":M[3]||(M[3]=N=>d.value=N)},null,8,["value"])])]),createBaseVNode("div",_hoisted_12$4,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.highlightForm")),1),createBaseVNode("div",_hoisted_13$4,[createVNode(unref(NSwitch),{value:u.value,"onUpdate:value":M[4]||(M[4]=N=>u.value=N)},null,8,["value"])])]),createBaseVNode("div",_hoisted_14$4,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.fillConsecutively")),1),createBaseVNode("div",_hoisted_15$4,[createVNode(unref(NSwitch),{value:x.value,"onUpdate:value":M[5]||(M[5]=N=>x.value=N)},null,8,["value"])])])]),createBaseVNode("p",_hoisted_16$3,toDisplayString(E.$t("toolbar.settings.creationInfo")),1),createBaseVNode("div",_hoisted_17$2,[createBaseVNode("span",null,toDisplayString(E.$t("toolbar.settings.version")),1),_hoisted_18$2])]),_:1},8,["show"])])}}},_sfc_main$1O={},_hoisted_1$1v={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1m=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.3033 12.5962L3.40381 2.69666L2.6967 3.40376L12.5962 13.3033L13.3033 12.5962ZM2 7.99996C2 7.99996 2.69777 6.96095 3.82074 5.94202L9.58576 11.707C9.08063 11.8902 8.54892 12 8 12C4.68629 12 2 7.99996 2 7.99996ZM14 7.99996C14 7.99996 13.3022 9.03896 12.1793 10.0579L6.41424 4.29288C6.91937 4.10972 7.45108 3.99996 8 3.99996C11.3137 3.99996 14 7.99996 14 7.99996Z",fill:"currentColor"},null,-1),_hoisted_3$1b=[_hoisted_2$1m];function _sfc_render$W(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1v,_hoisted_3$1b)}const __unplugin_components_4$5=_export_sfc(_sfc_main$1O,[["render",_sfc_render$W]]),_sfc_main$1N={},_hoisted_1$1u={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1l=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 12C11.3137 12 14 8 14 8C14 8 11.3137 4 8 4C4.68629 4 2 8 2 8C2 8 4.68629 12 8 12ZM8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10Z",fill:"currentColor"},null,-1),_hoisted_3$1a=[_hoisted_2$1l];function _sfc_render$V(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1u,_hoisted_3$1a)}const __unplugin_components_3$5=_export_sfc(_sfc_main$1N,[["render",_sfc_render$V]]),_sfc_main$1M={},_hoisted_1$1t={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1k=createBaseVNode("path",{d:"M32.5 19.2321V13.1607C32.5 8.46629 28.6944 4.66071 24 4.66071V4.66071C19.3056 4.66071 15.5 8.46628 15.5 13.1607V19.2321",stroke:"#93B9FD","stroke-width":"4"},null,-1),_hoisted_3$19=createBaseVNode("rect",{x:"7",y:"16.8036",width:"34",height:"26.7143",rx:"2",fill:"currentColor"},null,-1),_hoisted_4$l=createBaseVNode("rect",{x:"15",y:"28",width:"18",height:"3",fill:"white"},null,-1),_hoisted_5$c=[_hoisted_2$1k,_hoisted_3$19,_hoisted_4$l];function _sfc_render$U(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1t,_hoisted_5$c)}const __unplugin_components_2$a=_export_sfc(_sfc_main$1M,[["render",_sfc_render$U]]),_sfc_main$1L={},_hoisted_1$1s={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1j=createBaseVNode("path",{d:"M13 1L1 13",stroke:"#BABABA","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),_hoisted_3$18=createBaseVNode("path",{d:"M1 1L13 13",stroke:"#BABABA","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),_hoisted_4$k=[_hoisted_2$1j,_hoisted_3$18];function _sfc_render$T(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1s,_hoisted_4$k)}const __unplugin_components_0$f=_export_sfc(_sfc_main$1L,[["render",_sfc_render$T]]),EnterDocumentPassword_vue_vue_type_style_index_0_lang="",_hoisted_1$1r={id:"passwordDialog",class:"enter-document-password-dialog"},_hoisted_2$1i={class:"password-container"},_hoisted_3$17={class:"modal-container"},_hoisted_4$j={class:"wrapper"},_hoisted_5$b={class:"header-container"},_hoisted_6$8=createBaseVNode("span",{class:"title"},null,-1),_hoisted_7$8={class:"password-title"},_hoisted_8$6={class:"input-container"},_hoisted_9$6=["type","placeholder"],_hoisted_10$6={class:"wrong-password",id:"passwordText"},_sfc_main$1K={__name:"EnterDocumentPassword",setup(e){const{t:n}=useTranslation(),o=useViewerStore(),r=ref(!1),f=ref(""),s=ref(""),m=computed(()=>o.isElementOpen("permissionPasswordDialog")),w=v=>{v.param===!0||v.param===!1?r.value=v.param:r.value=!r.value};watch(()=>f.value,()=>{s.value=""}),watch(()=>m.value,()=>{f.value="",s.value=""});const g=async()=>{if(!await core.checkPermissionPassword(f.value)){s.value=n("passwordDialog.wrongPwd");return}o.closeElement("permissionPasswordDialog")};return(v,d)=>{const u=__unplugin_components_0$f,y=_sfc_main$4m,x=__unplugin_components_2$a,k=__unplugin_components_3$5,P=__unplugin_components_4$5;return withDirectives((openBlock(),createElementBlock("div",_hoisted_1$1r,[createBaseVNode("div",_hoisted_2$1i,[createBaseVNode("div",_hoisted_3$17,[createBaseVNode("div",_hoisted_4$j,[createBaseVNode("div",_hoisted_5$b,[_hoisted_6$8,createVNode(y,{class:"close-button",id:"passwordCancel",onClick:d[0]||(d[0]=S=>unref(o).closeElement("permissionPasswordDialog"))},{default:withCtx(()=>[createVNode(u)]),_:1})]),createVNode(x,{class:"lock-icon"}),createBaseVNode("div",_hoisted_7$8,toDisplayString(v.$t("passwordDialog.enterPermissionPwd")),1),createBaseVNode("div",_hoisted_8$6,[withDirectives(createBaseVNode("input",{id:"permission-password","onUpdate:modelValue":d[1]||(d[1]=S=>f.value=S),type:r.value?"text":"password",name:"password",placeholder:v.$t("passwordDialog.placeholder")},null,8,_hoisted_9$6),[[vModelDynamic,f.value]]),createBaseVNode("span",{class:"eye-btn",id:"eyeVisible",onClick:w},[r.value?(openBlock(),createBlock(k,{key:0})):(openBlock(),createBlock(P,{key:1}))]),createBaseVNode("div",_hoisted_10$6,toDisplayString(s.value),1)]),createBaseVNode("span",{class:normalizeClass(["set-btn",!f.value.length&&"disabled"]),id:"passwordSubmit",onClick:g},toDisplayString(v.$t("common.actions.ok")),3)])])])],512)),[[vShow,m.value]])}}},ModalContainer_vue_vue_type_style_index_0_lang="",_hoisted_1$1q={className:"modal-container"},_hoisted_2$1h={className:"wrapper"},_hoisted_3$16={className:"header-container"},_hoisted_4$i={class:"title"},_sfc_main$1J={__name:"ModalContainer",props:["title","onCloseClick"],setup(e){return(n,o)=>{const r=__unplugin_components_0$f,f=_sfc_main$4m;return openBlock(),createElementBlock("div",_hoisted_1$1q,[createBaseVNode("div",_hoisted_2$1h,[createBaseVNode("div",_hoisted_3$16,[createBaseVNode("span",_hoisted_4$i,toDisplayString(e.title),1),createVNode(f,{className:"close-button",onClick:e.onCloseClick},{default:withCtx(()=>[createVNode(r)]),_:1},8,["onClick"])]),renderSlot(n.$slots,"default")])])}}},MessageSuccess=""+new URL("icon-message-success.c9ccee05.svg",import.meta.url).href,SetPassword_vue_vue_type_style_index_0_lang="",_hoisted_1$1p={class:"password-container"},_hoisted_2$1g={class:"encrypt-container"},_hoisted_3$15={class:"document"},_hoisted_4$h={class:"document-title"},_hoisted_5$a=["disabled","type","placeholder"],_hoisted_6$7={class:"wrong-password"},_hoisted_7$7={class:"permission"},_hoisted_8$5={class:"permission-title"},_hoisted_9$5=["disabled","type","placeholder"],_hoisted_10$5={class:"wrong-password"},_hoisted_11$4={class:"printing item"},_hoisted_12$3={class:"copy item"},_hoisted_13$3={class:"edit item"},_hoisted_14$3={class:"note"},_hoisted_15$3={class:"btn-container"},_sfc_main$1I={__name:"SetPassword",setup(e){const n=getCurrentInstance().appContext.app.config.globalProperties,o=useViewerStore(),r=ref(!1),f=ref(""),s=ref(""),m=ref(!1),w=ref(""),g=ref(""),v=ref(!1),d=ref(!1),u=ref(!1),y=ref(!1),x=reactive({allowsPrinting:!1,allowsCopying:!1,allowsDocumentChanges:!1}),k=computed(()=>o.isElementOpen("setPasswordModal"));watch(()=>f.value,(M,T)=>{M&&(M=M.replace(/\s/g,""),M=M.replace(/[^a-zA-Z0-9!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/,""),M=M.replace(/[\u4e00-\u9fa5\uFE30-\uFFA0]/,""),f.value=M),w.value=""}),watch(()=>s.value,(M,T)=>{M&&(M=M.replace(/\s/g,""),M=M.replace(/[^a-zA-Z0-9!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/,""),M=M.replace(/[\u4e00-\u9fa5\uFE30-\uFFA0]/,""),s.value=M),g.value=""});const P=()=>{o.closeElement("setPasswordModal"),r.value=!1,f.value="",v.value=!1,s.value="",d.value=!1,u.value=!1,x.allowsPrinting=!1,x.allowsCopying=!1,x.allowsDocumentChanges=!1},S=async()=>{if(!f.value.length&&!s.value.length||m.value)return;if(E())v.value=!1;else{v.value=!0;return}m.value=!0;const M={};d.value&&(M.password=f.value),u.value&&(M.permissionPassword=s.value,M.permission={allowsPrinting:x.allowsPrinting,allowsCopying:x.allowsCopying,allowsDocumentChanges:x.allowsDocumentChanges});const T=await core.setPassword(M);P(),T?window.$message.success(n.$t("passwordDialog.setSuccess"),{duration:3e3,icon:()=>h$1("img",{src:MessageSuccess})}):window.$message.error(n.$t("passwordDialog.setFailure"),{duration:3e3,icon:()=>h$1("img",{src:MessageError})}),m.value=!1},E=()=>{const M=/^(?=.*[a-zA-Z]+$|.*\d+$|.*[@$!%*?&]+$)[a-zA-Z\d@$!%*?&]{1,20}$/,T=M.test(f.value),D=M.test(s.value);return d.value&&!T&&(w.value=n.$t("passwordDialog.support")),u.value&&!D&&(g.value=n.$t("passwordDialog.support")),d.value&&u.value&&f.value===s.value?(w.value=n.$t("passwordDialog.samePwd"),g.value=n.$t("passwordDialog.samePwd"),!1):f.value.length>20||s.value.length>20?(d.value&&f.value.length>20&&(w.value=n.$t("passwordDialog.longPwd")),u.value&&s.value.length>20&&(g.value=n.$t("passwordDialog.longPwd")),!1):(!d.value||T)&&(!u.value||D)};return(M,T)=>{const D=__unplugin_components_1$f,N=__unplugin_components_3$5,F=__unplugin_components_4$5,O=_sfc_main$1J;return withDirectives((openBlock(),createElementBlock("div",_hoisted_1$1p,[createVNode(O,{onCloseClick:P,title:M.$t("passwordDialog.encryptTitle")},{default:withCtx(()=>[createBaseVNode("div",_hoisted_2$1g,[createBaseVNode("div",_hoisted_3$15,[createBaseVNode("div",_hoisted_4$h,[createBaseVNode("div",{class:normalizeClass(["check",{active:d.value}]),onClick:T[0]||(T[0]=I=>d.value=!d.value)},[withDirectives(createVNode(D,null,null,512),[[vShow,d.value]])],2),createBaseVNode("span",null,toDisplayString(M.$t("passwordDialog.documentPwd")),1)]),createBaseVNode("div",{class:normalizeClass(["input-container",!d.value&&"disable"])},[createBaseVNode("div",{class:normalizeClass(["input",!d.value&&"disabled"])},[withDirectives(createBaseVNode("input",{disabled:!d.value,type:r.value?"text":"password",name:"password","onUpdate:modelValue":T[1]||(T[1]=I=>f.value=I),placeholder:M.$t("passwordDialog.placeholder")},null,8,_hoisted_5$a),[[vModelDynamic,f.value]]),createBaseVNode("span",{class:"eye-btn",onClick:T[2]||(T[2]=I=>r.value=!r.value)},[r.value?(openBlock(),createBlock(N,{key:0})):(openBlock(),createBlock(F,{key:1}))])],2),withDirectives(createBaseVNode("div",_hoisted_6$7,[createBaseVNode("p",null,toDisplayString(w.value),1)],512),[[vShow,w.value]])],2)]),createBaseVNode("div",_hoisted_7$7,[createBaseVNode("div",_hoisted_8$5,[createBaseVNode("div",{class:normalizeClass(["check",{active:u.value}]),onClick:T[3]||(T[3]=I=>u.value=!u.value)},[withDirectives(createVNode(D,null,null,512),[[vShow,u.value]])],2),createBaseVNode("span",null,toDisplayString(M.$t("passwordDialog.permissionPwd")),1)]),createBaseVNode("div",{class:normalizeClass(["input-container",!u.value&&"disable"])},[createBaseVNode("div",{class:normalizeClass(["input",!u.value&&"disabled"])},[withDirectives(createBaseVNode("input",{disabled:!u.value,type:y.value?"text":"password",name:"password","onUpdate:modelValue":T[4]||(T[4]=I=>s.value=I),placeholder:M.$t("passwordDialog.placeholder")},null,8,_hoisted_9$5),[[vModelDynamic,s.value]]),createBaseVNode("span",{class:"eye-btn",onClick:T[5]||(T[5]=I=>y.value=!y.value)},[y.value?(openBlock(),createBlock(N,{key:0})):(openBlock(),createBlock(F,{key:1}))])],2),withDirectives(createBaseVNode("div",_hoisted_10$5,[createBaseVNode("p",null,toDisplayString(g.value),1)],512),[[vShow,g.value]])],2),createBaseVNode("div",{class:normalizeClass(["items",!u.value&&"disabled"])},[createBaseVNode("div",_hoisted_11$4,[createBaseVNode("div",{class:normalizeClass(["check",{active:x.allowsPrinting}]),onClick:T[6]||(T[6]=I=>u.value&&(x.allowsPrinting=!x.allowsPrinting))},[withDirectives(createVNode(D,null,null,512),[[vShow,x.allowsPrinting]])],2),createBaseVNode("span",null,toDisplayString(M.$t("passwordDialog.disablePrinting")),1)]),createBaseVNode("div",_hoisted_12$3,[createBaseVNode("div",{class:normalizeClass(["check",{active:x.allowsCopying}]),onClick:T[7]||(T[7]=I=>u.value&&(x.allowsCopying=!x.allowsCopying))},[withDirectives(createVNode(D,null,null,512),[[vShow,x.allowsCopying]])],2),createBaseVNode("span",null,toDisplayString(M.$t("passwordDialog.disableCopying")),1)]),createBaseVNode("div",_hoisted_13$3,[createBaseVNode("div",{class:normalizeClass(["check",{active:x.allowsDocumentChanges}]),onClick:T[8]||(T[8]=I=>u.value&&(x.allowsDocumentChanges=!x.allowsDocumentChanges))},[withDirectives(createVNode(D,null,null,512),[[vShow,x.allowsDocumentChanges]])],2),createBaseVNode("span",null,toDisplayString(M.$t("passwordDialog.disableEdit")),1)])],2)])]),createBaseVNode("div",_hoisted_14$3,[createBaseVNode("p",null,toDisplayString(M.$t("passwordDialog.notes")[0]),1),createBaseVNode("p",null,toDisplayString(M.$t("passwordDialog.notes")[1]),1),createBaseVNode("p",null,toDisplayString(M.$t("passwordDialog.notes")[2]),1)]),createBaseVNode("div",_hoisted_15$3,[createBaseVNode("span",{onClick:P},toDisplayString(M.$t("common.actions.cancel")),1),createBaseVNode("span",{class:normalizeClass(["blue",{disabled:!f.value&&d.value||!s.value&&u.value||!d.value&&!u.value||u.value&&!x.allowsPrinting&&!x.allowsCopying&&!x.allowsDocumentChanges}]),onClick:S},toDisplayString(M.$t("passwordDialog.encrypt")),3)])]),_:1},8,["title"])],512)),[[vShow,k.value]])}}},EnterPassword_vue_vue_type_style_index_0_lang="",_hoisted_1$1o={id:"passwordDialog",class:"password-dialog enter-password-dialog"},_hoisted_2$1f={class:"password-container"},_hoisted_3$14={class:"modal-container"},_hoisted_4$g={class:"wrapper"},_hoisted_5$9={class:"header-container"},_hoisted_6$6=createBaseVNode("span",{class:"title"},null,-1),_hoisted_7$6={class:"password-title"},_hoisted_8$4={class:"input-container"},_hoisted_9$4=["type","placeholder"],_hoisted_10$4=createBaseVNode("div",{class:"wrong-password",id:"passwordText"},null,-1),_hoisted_11$3={class:"set-btn",id:"passwordSubmit"},_sfc_main$1H={__name:"EnterPassword",setup(e){const n=ref(!1),o=r=>{r.param===!0||r.param===!1?n.value=r.param:n.value=!n.value};return(r,f)=>{const s=__unplugin_components_0$f,m=_sfc_main$4m,w=__unplugin_components_2$a,g=__unplugin_components_3$5,v=__unplugin_components_4$5;return openBlock(),createElementBlock("div",_hoisted_1$1o,[createBaseVNode("div",_hoisted_2$1f,[createBaseVNode("div",_hoisted_3$14,[createBaseVNode("div",_hoisted_4$g,[createBaseVNode("div",_hoisted_5$9,[_hoisted_6$6,createVNode(m,{class:"close-button",id:"passwordCancel"},{default:withCtx(()=>[createVNode(s)]),_:1})]),createVNode(w,{class:"lock-icon"}),createBaseVNode("div",_hoisted_7$6,toDisplayString(r.$t("passwordDialog.enterPwd")),1),createBaseVNode("div",_hoisted_8$4,[createBaseVNode("input",{id:"password",type:n.value?"text":"password",name:"password",placeholder:r.$t("passwordDialog.placeholder")},null,8,_hoisted_9$4),createBaseVNode("span",{class:"eye-btn",id:"eyeVisible",onClick:o},[n.value?(openBlock(),createBlock(g,{key:0})):(openBlock(),createBlock(v,{key:1}))]),_hoisted_10$4]),createBaseVNode("span",_hoisted_11$3,toDisplayString(r.$t("common.actions.ok")),1)])])])])}}},_sfc_main$1G={},_hoisted_1$1n={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1e=createBaseVNode("path",{d:"M7 4.07123L13 10.071L7 16.0709",stroke:"currentColor","stroke-width":"1.5"},null,-1),_hoisted_3$13=[_hoisted_2$1e];function _sfc_render$S(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1n,_hoisted_3$13)}const __unplugin_components_10$3=_export_sfc(_sfc_main$1G,[["render",_sfc_render$S]]),_sfc_main$1F={},_hoisted_1$1m={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$1d=createBaseVNode("path",{d:"M13 4.07123L7 10.071L13 16.0709",stroke:"currentColor","stroke-width":"1.5"},null,-1),_hoisted_3$12=[_hoisted_2$1d];function _sfc_render$R(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1m,_hoisted_3$12)}const __unplugin_components_0$e=_export_sfc(_sfc_main$1F,[["render",_sfc_render$R]]),PageNavOverlay_vue_vue_type_style_index_0_lang="",_hoisted_1$1l={key:0,class:"page-nav","data-element":"pageNavOverlay"},_hoisted_2$1c={class:"form-container"},_sfc_main$1E={__name:"PageNavOverlay",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=ref(n.getCurrentPage);effect(()=>r.value=n.getCurrentPage);const f=computed(()=>n.getFullMode),s=computed(()=>n.getCurrentPage===1),m=computed(()=>o.getTotalPages),w=computed(()=>m.value===n.getCurrentPage);watch(r,(u,y)=>{u!==""&&m.value!==0&&(u>m.value||u<=0)&&(r.value=y)});const g=()=>{core.previousPage()&&n.setCurrentPage(core.getCurrentPage())},v=()=>{core.nextPage()&&n.setCurrentPage(core.getCurrentPage())},d=u=>{if(u.target.blur(),!u.target.value){r.value=n.getCurrentPage;return}core.pageNumberChanged(u.target)};return(u,y)=>{const x=__unplugin_components_0$e,k=_sfc_main$4m,P=__unplugin_components_10$3;return m.value>0&&!f.value?(openBlock(),createElementBlock("div",_hoisted_1$1l,[createVNode(k,{className:"side-arrow-container",img:"icon-previous-left",title:s.value?null:u.$t("common.navigation.previousPage"),onClick:g,disabled:s.value},{default:withCtx(()=>[createVNode(x)]),_:1},8,["title","disabled"]),createBaseVNode("div",_hoisted_2$1c,[withDirectives(createBaseVNode("input",{type:"number","onUpdate:modelValue":y[0]||(y[0]=S=>r.value=S),onInput:y[1]||(y[1]=(...S)=>u.onChange&&u.onChange(...S)),onBlur:d,onKeydown:withKeys(d,["enter"]),tabIndex:"-1",style:normalizeStyle({width:r.value.toString().length*8+2+"px"}),pattern:"\\d*",onkeypress:"return (/[\\d]/.test(String.fromCharCode(event.keyCode)))",name:"page-nav"},null,36),[[vModelText,r.value]]),createBaseVNode("span",null,toDisplayString(`/${m.value}`),1)]),createVNode(k,{className:"side-arrow-container",img:"icon-next-right",title:w.value?null:u.$t("common.navigation.nextPage"),onClick:v,disabled:w.value},{default:withCtx(()=>[createVNode(P)]),_:1},8,["title","disabled"])])):createCommentVNode("",!0)}}},DocumentContainer_vue_vue_type_style_index_0_lang="",_hoisted_1$1k=createStaticVNode('<div id="printServiceDialog" class="print-dialog"><div class="print-container"><div class="print-title">Preparing document for printing\u2026</div><div class="print-progress"><progress value="0" max="100"></progress><span class="relative-progress">0%</span></div></div></div>',1),_hoisted_2$1b=["innerHTML"],_hoisted_3$11={class:"loading"},_hoisted_4$f={class:"upload-container"},_hoisted_5$8={for:"fileInput"},_sfc_main$1D={__name:"DocumentContainer",props:["isHeaderDisabled"],setup(e){const{isHeaderDisabled:n}=e,{loadDocument:o,initializeViewer:r,initConfig:f,getDocumentViewer:s,switchTool:m,switchAnnotationEditorMode:w}=core,g=ref(),v=ref(),d=useViewerStore(),u=useDocumentStore();let y=null;useTranslation();const x=computed(()=>d.getCustomLoading),k=window.localStorage.getItem("customStamps"),P=window.localStorage.getItem("electronicSignatures"),S=window.localStorage.getItem("digitalSignatures");k&&d.setCustomStamps(JSON.parse(k)),P&&d.setElectronicSignature(JSON.parse(P)),S&&d.setDigitalSignature(JSON.parse(S));const E=computed(()=>d.getDisableSignatureTool),M=computed(()=>d.isElementOpen("leftPanel")),T=computed(()=>isMobileDevice?0:M.value?260:0),D=computed(()=>isMobileDevice?0:d.isElementOpen("rightPanel")||d.isElementOpen("pageModePanel")||d.isElementOpen("stampPanel")||d.isElementOpen("linkPanel")||d.isElementOpen("contentEditorPanel")||d.isElementOpen("colorSeparationPanel")||d.isElementOpen("measurePanel")||d.isElementOpen("freetextPanel")?260:0),N=computed(()=>d.getToolMode),F=computed(()=>d.getCompareStatus),O=computed(()=>n||["view","document","separation"].includes(d.getToolMode)||N.value==="compare"&&F.value!=="finished"?0:["redaction","remove"].includes(J.value)?window.innerWidth>500?44+48:44+88:N.value==="sign"&&E.value?0:q.value&&N.value==="sign"?44+44:44),I=computed(()=>d.getUploadLoading&&d.getUpload),X=computed(()=>d.getActiveElementTab("leftPanel")),ne=computed(()=>d.getUpload),ye=computed(()=>d.getDisabledElements("pageNavOverlay")),J=computed(()=>u.getActiveTool),te=computed(()=>d.getScale),q=computed(()=>d.getSignatureVerify),re=computed(()=>d.getCommonLoading),U=computed(()=>d.getVerified);let H=100,Z=0;const Y=getHashParameters("d","");function W(){if(!isMobileDevice||J.value==="polygon"||J.value==="polyline")return;const _e=50,ve=2,be=te.value<H+ve*_e?te.value+_e:H;d.setCurrentScale(be/100),core.scaleChanged(be/100)}function Q(_e){const ve=g.value.querySelector(".page-nav");if(_e.target.nodeName==="A"||(ve==null?void 0:ve.contains(_e.target))||_e.target.nodeName==="rect")return;const be=new Date().getTime();be-Z<300&&W(),Z=be}async function oe(_e){const ve=_e.target.files[0];if(!ve)return;M.value&&d.closeElement("leftPanel"),d.$patch({fullMode:!1,currentPage:0,scale:"",themeMode:"Light",pageMode:0,scrollMode:"Vertical",activeTab:0,searchStatus:!1,activeElements:{leftPanel:!1,rightPanel:!1,pageModePanel:!1},activeElementsTab:{leftPanel:"THUMBS",rightPanel:"GENERAL"},signatureVerify:0}),u.resetSetting(),core.clearSearchResults(),u.setToolState(""),d.setActiveToolMode("view"),d.setUploadLoading(!0);let be=ve.name;d.setUpload(!0);let ke=URL.createObjectURL(ve);await Se(ke,{filename:be}),d.setUploadLoading(!1),URL.revokeObjectURL(ke)}const Ce=computed(()=>u.getLoadingProgress);async function Se(_e,{filename:ve=null,password:be=""}){const ke={extension:getHashParameters("extension",null),filename:getHashParameters("filename",null)||ve,externalPath:getHashParameters("p",""),documentId:getHashParameters("did",null),progress:u.setLoadingProgress,pageChangedCallback:d.setCurrentPage,scaleChangedCallback:d.setCurrentScale,annotationsNumChangedCallback:u.setAnnotationsCount,distanceChangedCallback:u.setDistance,permissionPasswordCallback:()=>d.openElement("permissionPasswordDialog"),password:be};try{const Oe=await o(_e,ke);if(!Oe||!Oe.verified)return;U.value||(d.setVerified(Oe.verified),d.setLicense(s()._license));const{pwd:ze}=Oe;u.setFileHasPwd(!!ze),u.setPassword(ze),u.setCurrentPdfData(_e,ke),u.setOutline(core.getOutlines())}catch(Oe){if(console.log(Oe),Oe==="invalid_file_error"||Oe==="no_password_given"||Oe==="incorrect_password"){d.setUpload(!1),d.resetSetting();const ze=document.getElementById("fileInput");ze.value="",u.setCurrentPdfData();return}}const Me=core.getPagesCount(),Le=core.getScale();u.setTotalPages(Me),d.setCurrentPage(1),d.setCurrentScale(Le),H=Math.round(Le*100)}const fe=_e=>{u.setSelectedAnnotation(_e)},Pe=()=>{u.setSelectedAnnotation(null)},Ae=_e=>{X.value!=="ANNOTATION"&&d.setActiveElementTab("leftPanel","ANNOTATION"),M.value||d.openElement("leftPanel"),d.openElement("reply"),y&&(clearTimeout(y),y=null),setTimeout(()=>{const ve=document.querySelector(".annotation-item.selected");ve.scrollIntoView({behavior:"smooth"}),ve.classList.contains("flash-border")?(ve.classList.remove("flash-border"),clearTimeout(y),y=null):(ve.classList.add("flash-border"),y=setTimeout(()=>{var be;return(be=document.querySelector(".annotation-item.selected"))==null?void 0:be.classList.remove("flash-border")},2e3))},300)};function Te(_e){_e.isTrusted&&typeof _e.data=="object"&&_e.data.type==="viewerLoaded"&&Ee(_e.data.options)}const Ee=async _e=>{if(!_e)return;window.removeEventListener("message",Te),"isAnnotationPopup"in _e&&d.toggleAnnotationPopup(_e.isAnnotationPopup),d.setUpload(!0),d.setUploadLoading(!0),await f(_e),!Y&&!_e.initialDoc&&(d.setUpload(!1),d.setUploadLoading(!1)),_e.renderLayerPermission||d.setDisabledElements("layers");const ve=_e&&_e.webviewerServer?_e.webviewerServer:"Standalone";d.setWebviewerMode(ve);const be=We=>{We!==N.value&&d.setActiveToolMode(We)};core.addEvent("toolModeChanged",be);const ke=({tool:We})=>{u.setActiveTool(We)};core.addEvent("toolChanged",ke),core.addEvent("annotationSelected",fe),core.addEvent("annotationDeselected",Pe),core.addEvent("openAnnotationReply",Ae);const Me=document.querySelector(".thumbnail-view"),Le=document.querySelector(".outline-view"),Oe=document.querySelector(".findbar-view");r({container:g.value,viewer:v.value,thumbnailView:Me,outlineView:Le,findbarView:Oe,toggleButton:document.querySelector(".toggle-button")}),_e.autoJumpNextSign&&u.setAutoJumpNextSign(!0),_e.disableDigitalSignature&&u.setDisableDigitalSignature(_e.disableDigitalSignature),_e.disableElectronicSignature&&u.setDisableElectronicSignature(_e.disableElectronicSignature),core.addEvent("onPagesUpdated",We=>{const{pageNumber:Ge}=We;u.setOutline(core.getOutlines());const Xe=core.getPagesCount(),qe=core.getScale();u.setTotalPages(Xe),d.setCurrentPage(Ge||1),d.setCurrentScale(qe);const Ke=d.getScrollMode,Qe=d.getPageMode,at=Ke==="Vertical"?0:1;core.switchScrollMode(at),core.switchSpreadMode(Qe)});const ze=(We,Ge)=>{const Xe=core.getAnnotationsList();u.initAnnotations(Xe),setTimeout(()=>{if(Ge==="add"){const qe=document.getElementById(`annotationList-${We.name}`);qe&&qe.scrollIntoView({behavior:"smooth",block:"start"})}})};core.addEvent("annotationChanged",ze),core.addEvent("documentloaded",ze),_e.pdfUrl&&await window.instance.UI.loadDocument(_e.pdfUrl)};window.instance.UI.loadDocument=async(_e,{filename:ve="",password:be=""}={})=>{if(!_e)return;M.value&&d.closeElement("leftPanel"),d.$patch({fullMode:!1,currentPage:0,scale:"",themeMode:"Light",pageMode:0,scrollMode:"Vertical",activeTab:0,searchStatus:!1,activeElements:{leftPanel:!1,rightPanel:!1},activeElementsTab:{leftPanel:"THUMBS",rightPanel:"GENERAL"}}),u.resetSetting(),core.clearSearchResults(),u.setToolState(""),d.setActiveToolMode("view"),d.setUploadLoading(!0),d.setUpload(!0);let ke=typeof _e=="string"?_e:URL.createObjectURL(_e);await Se(ke,{filename:_e.name||ve,password:be}),d.setUploadLoading(!1)};const Be=(_e,ve)=>{const be=Ve(_e),Me=core.getSelectedPage(be,be).first;if(Me<1)return;const Le=core.windowToPage(be,Me);core.eventBus().dispatch(ve,{event:_e,...Le})},Ve=_e=>{var Le;const ve=core.getScrollViewElement();let be=((Le=g.value)==null?void 0:Le.style.marginLeft)||0;be=parseFloat(be);const ke=ve.scrollLeft||0,Me=ve.scrollTop||0;return{x:_e.pageX+ke-be,y:_e.pageY+Me}};return onMounted(()=>{document.documentElement.addEventListener("keydown",_e=>{if(_e.target.tagName==="INPUT"||_e.target.tagName==="TEXTAREA")return;(_e.keyCode||_e.which)===27&&J.value&&(u.setToolState(J.value),d.toggleActiveHand(!1),m(0),w(0))}),window.addEventListener("message",Te,!1)}),(_e,ve)=>{const be=_sfc_main$1E,ke=_sfc_main$1H,Me=_sfc_main$1I,Le=_sfc_main$1K,Oe=_sfc_main$1P,ze=_sfc_main$1Q,We=_sfc_main$1R,Ge=_sfc_main$1S,Xe=_sfc_main$1V,qe=_sfc_main$1Z,Ke=_sfc_main$20,Qe=_sfc_main$21,at=_sfc_main$22,ut=__unplugin_components_13$1,vt=_sfc_main$23,_t=_sfc_main$28,wt=_sfc_main$2g,bt=_sfc_main$2i,Rt=_sfc_main$2k,Fe=_sfc_main$2l,$e=_sfc_main$2m,Ie=_sfc_main$2x,Re=__unplugin_components_22$1,He=_sfc_main$2Z;return openBlock(),createElementBlock(Fragment,null,[createBaseVNode("div",{ref_key:"mainContainer",ref:g,class:normalizeClass(["document-container",{under:N.value==="compare"&&F.value!=="finished"||N.value==="document","no-touch":["selectText","highlight","underline","squiggly","strikeout"].includes(J.value),redact:["redaction","remove"].includes(J.value)}]),style:normalizeStyle({width:`calc(100% - ${T.value}px - ${D.value}px)`,"margin-left":`${T.value}px`,"margin-right":`${D.value}px`,"margin-top":`${O.value}px`,top:e.isHeaderDisabled?"0px":"44px"}),onDblclick:W,onClick:Q},[createBaseVNode("div",{ref_key:"viewerContainer",ref:v,class:"document",onClick:ve[0]||(ve[0]=je=>Be(je,"pdfClick")),onMousedown:ve[1]||(ve[1]=je=>Be(je,"pdfMousedown")),onDblclick:ve[2]||(ve[2]=je=>Be(je,"pdfDbclick"))},null,544),ye.value?createCommentVNode("",!0):(openBlock(),createBlock(be,{key:0,style:normalizeStyle({left:`calc(50% + ${T.value/2}px - ${D.value/2}px)`})},null,8,["style"]))],38),createVNode(ke),_hoisted_1$1k,createVNode(Me),createVNode(Le),createVNode(Oe),createVNode(ze),createVNode(We),createVNode(Ge),createVNode(Xe),createVNode(qe),createVNode(Ke),createVNode(Qe),createVNode(at),I.value&&Ce.value<100?(openBlock(),createElementBlock("div",{key:0,class:"loading-state",innerHTML:x.value?x.value.element:`${_e.$t("common.actions.loading")}...`,style:normalizeStyle(x.value&&x.value.styles?x.value.styles:"")},null,12,_hoisted_2$1b)):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(["mask",{active:re.value}])},[withDirectives(createBaseVNode("div",_hoisted_3$11,[createVNode(ut)],512),[[vShow,re.value]])],2),withDirectives(createBaseVNode("div",_hoisted_4$f,[createBaseVNode("input",{id:"fileInput",type:"file",accept:".pdf",onChange:oe,name:"document"},null,32),createBaseVNode("label",_hoisted_5$8,toDisplayString(_e.$t("common.actions.upload")),1)],512),[[vShow,!ne.value&&X.value!=="COMPARISON"&&["compare","view"].includes(N.value)]]),createVNode(vt),createVNode(_t),createVNode(wt),createVNode(bt),createVNode(Rt),createVNode(Fe),createVNode($e),createVNode(Ie),createVNode(Re),createVNode(He)],64)}}},SearchItem_vue_vue_type_style_index_0_lang="",_hoisted_1$1j={key:0,class:"page-title"},_hoisted_2$1a=["innerHTML"],_sfc_main$1C={__name:"SearchItem",props:["searchResults","result","currentIndex"],setup(e){const{searchResults:n,result:o,currentIndex:r}=e,f=r===0?r:r-1,s=n[r],m=n[f],w=m===s,g=m.pageNum!==s.pageNum,v=new RegExp(o.searchValue,"gi"),d=o.content.replace(v,function(x,k){return`<span class="highlight">${x}</span>`}),u=useDocumentStore(),y=x=>{core.setActiveSearchResult(toRaw(n[x]),x),u.setActiveSearchResult({index:x,searchResult:n[x]})};return(x,k)=>(openBlock(),createElementBlock(Fragment,null,[w||g?(openBlock(),createElementBlock("div",_hoisted_1$1j,toDisplayString(e.result.pageNum),1)):createCommentVNode("",!0),createBaseVNode("div",{class:"item-content",innerHTML:unref(d),onClick:k[0]||(k[0]=P=>y(e.currentIndex))},null,8,_hoisted_2$1a)],64))}},SearchContent_vue_vue_type_style_index_0_lang="",_hoisted_1$1i={class:"search-number"},_hoisted_2$19=createBaseVNode("div",{id:"findResultsCount",class:"toolbarLabel"},null,-1),_hoisted_3$10={class:"search-container"},_hoisted_4$e={key:1,class:"no-annotations"},_sfc_main$1B={__name:"SearchContent",setup(e){const n=useDocumentStore(),o=computed(()=>n.getSearchResults);return(r,f)=>{const s=_sfc_main$1C;return openBlock(),createElementBlock(Fragment,null,[withDirectives(createBaseVNode("div",_hoisted_1$1i,[_hoisted_2$19,createBaseVNode("div",null,toDisplayString(r.$t("panels.left.search.page")),1)],512),[[vShow,o.value.length]]),createBaseVNode("div",_hoisted_3$10,[o.value.length?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(o.value,(m,w)=>(openBlock(),createBlock(s,{key:m,searchResults:o.value,result:m,currentIndex:w},null,8,["searchResults","result","currentIndex"]))),128)):(openBlock(),createElementBlock("div",_hoisted_4$e,toDisplayString(r.$t("panels.left.search.noResults")),1))])],64)}}};var FUNC_ERROR_TEXT="Expected a function",NAN=0/0,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};function debounce(e,n,o){var r,f,s,m,w,g,v=0,d=!1,u=!1,y=!0;if(typeof e!="function")throw new TypeError(FUNC_ERROR_TEXT);n=toNumber(n)||0,isObject$1(o)&&(d=!!o.leading,u="maxWait"in o,s=u?nativeMax(toNumber(o.maxWait)||0,n):s,y="trailing"in o?!!o.trailing:y);function x(F){var O=r,I=f;return r=f=void 0,v=F,m=e.apply(I,O),m}function k(F){return v=F,w=setTimeout(E,n),d?x(F):m}function P(F){var O=F-g,I=F-v,X=n-O;return u?nativeMin(X,s-I):X}function S(F){var O=F-g,I=F-v;return g===void 0||O>=n||O<0||u&&I>=s}function E(){var F=now();if(S(F))return M(F);w=setTimeout(E,P(F))}function M(F){return w=void 0,y&&r?x(F):(r=f=void 0,m)}function T(){w!==void 0&&clearTimeout(w),v=0,r=g=f=w=void 0}function D(){return w===void 0?m:M(now())}function N(){var F=now(),O=S(F);if(r=arguments,f=this,g=F,O){if(w===void 0)return k(g);if(u)return w=setTimeout(E,n),x(g)}return w===void 0&&(w=setTimeout(E,n)),m}return N.cancel=T,N.flush=D,N}function isObject$1(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function isObjectLike(e){return!!e&&typeof e=="object"}function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&objectToString.call(e)==symbolTag}function toNumber(e){if(typeof e=="number")return e;if(isSymbol(e))return NAN;if(isObject$1(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=isObject$1(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=e.replace(reTrim,"");var o=reIsBinary.test(e);return o||reIsOctal.test(e)?freeParseInt(e.slice(2),o?2:8):reIsBadHex.test(e)?NAN:+e}var lodash_debounce=debounce;const SearchHeader_vue_vue_type_style_index_0_lang="",_hoisted_1$1h={id:"findbarInputContainer",class:"findbar-input-container"},_hoisted_2$18={class:"input-container"},_hoisted_3$$=["placeholder"],_hoisted_4$d={class:"button-container"},waitTime=200,_sfc_main$1A={__name:"SearchHeader",setup(e){const n=ref(!1),o=ref(""),r=useDocumentStore(),f=useViewerStore(),s=ref([]),m=ref(0),w=()=>{const k=s.value,P=m.value;if(k.length>0){const S=P<=0?k.length-1:P-1;core.setActiveSearchResult(toRaw(k[S]),S),r.setActiveSearchResult({index:S,searchResult:k[S]}),m.value=S}},g=()=>{const k=s.value,P=m.value;if(k.length>0){const S=P===k.length-1?0:P+1;core.setActiveSearchResult(toRaw(k[S]),S),r.setActiveSearchResult({index:S,searchResult:k[S]}),m.value=S}},v=()=>{n.value=!1,o.value="",r.setSearchResults([]),core.clearSearchResults(),s.value=[],r.setActiveSearchResult(null)},d=lodash_debounce(async k=>{if(k&&k.length>0){n.value=!0;const P=await core.search(k);r.setSearchResults(P),s.value=P,r.setActiveSearchResult({index:0,searchResult:P[0]})}else v()},waitTime),u=k=>{d(k)};watch(o,()=>{u(o.value),m.value=0});const y=computed(()=>f.getActiveElementTab("leftPanel")),x=computed(()=>f.isElementOpen("leftPanel"));return watch([y,x],()=>{(y.value!=="SEARCH"||!x.value)&&(core.clearSearchResults(),o.value="",m.value=0,r.setActiveSearchResult(null))}),(k,P)=>{const S=__unplugin_components_0$v,E=__unplugin_components_0$e,M=_sfc_main$4m,T=__unplugin_components_10$3;return openBlock(),createElementBlock("div",{id:"findbar",class:normalizeClass(["findbar",{mobile:unref(isMobileDevice)}])},[createBaseVNode("div",_hoisted_1$1h,[createBaseVNode("div",_hoisted_2$18,[withDirectives(createBaseVNode("input",{type:"text",autocomplete:"off",placeholder:k.$t("panels.left.search.placeholder"),"onUpdate:modelValue":P[0]||(P[0]=D=>o.value=D),name:"search"},null,8,_hoisted_3$$),[[vModelText,o.value]]),createVNode(S,{id:"emptyInput",class:normalizeClass(["empty-input",!o.value&&"hidden"]),onClick:v},null,8,["class"])]),createBaseVNode("div",_hoisted_4$d,[createVNode(M,{img:"icon-previous-left",id:"findPrevious",class:normalizeClass(["toolbarButton",!s.value.length&&"disabled"]),title:k.$t("panels.left.search.previous"),onClick:w},{default:withCtx(()=>[createVNode(E)]),_:1},8,["class","title"]),createVNode(M,{img:"icon-next-right",id:"findNext",class:normalizeClass(["toolbarButton",!s.value.length&&"disabled"]),title:k.$t("panels.left.search.next"),onClick:g},{default:withCtx(()=>[createVNode(T)]),_:1},8,["class","title"])])])],2)}}},_sfc_main$1z={};function _sfc_render$Q(e,n){const o=_sfc_main$1A,r=_sfc_main$1B;return openBlock(),createElementBlock(Fragment,null,[createVNode(o),createVNode(r)],64)}const __unplugin_components_6$1=_export_sfc(_sfc_main$1z,[["render",_sfc_render$Q]]),_sfc_main$1y={},_hoisted_1$1g={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$17=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11 6C11 6.55228 10.5523 7 10 7C9.44772 7 9 6.55228 9 6C9 5.44772 9.44772 5 10 5C10.5523 5 11 5.44772 11 6ZM11 10C11 10.5523 10.5523 11 10 11C9.44772 11 9 10.5523 9 10C9 9.44772 9.44772 9 10 9C10.5523 9 11 9.44772 11 10ZM10 15C10.5523 15 11 14.5523 11 14C11 13.4477 10.5523 13 10 13C9.44772 13 9 13.4477 9 14C9 14.5523 9.44772 15 10 15Z",fill:"currentColor"},null,-1),_hoisted_3$_=[_hoisted_2$17];function _sfc_render$P(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1g,_hoisted_3$_)}const __unplugin_components_4$4=_export_sfc(_sfc_main$1y,[["render",_sfc_render$P]]),SignatureContainer_vue_vue_type_style_index_0_lang="",_hoisted_1$1f={class:"container"},_hoisted_2$16={class:"signature-title"},_hoisted_3$Z={key:0,class:"signatures"},_hoisted_4$c=["onClick"],_hoisted_5$7=["title"],_hoisted_6$5={class:"drop-down medium"},_hoisted_7$5={key:1,class:"no-signatures"},_sfc_main$1x={__name:"SignatureContainer",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=computed(()=>o.getSignatures),f=computed(()=>o.getSelectedSignature),s=ref(!1),m=d=>{d<0||core.pageNumberChanged({value:(d*1+1).toString()})},w=()=>{s.value=!1,o.setSelectedSignature(null)},g=d=>{s.value=!1,n.openElement(d)},v=(d,u)=>{s.value=!0;const y=d.signature;y.index=u,o.setSelectedSignature(y)};return(d,u)=>{const y=__unplugin_components_0$g,x=__unplugin_components_1$2,k=__unplugin_components_2$b,P=__unplugin_components_4$4,S=_sfc_main$4m;return openBlock(),createElementBlock("div",_hoisted_1$1f,[createBaseVNode("div",_hoisted_2$16,toDisplayString(d.$t("panels.left.signatures.list")),1),r.value.length?(openBlock(),createElementBlock("div",_hoisted_3$Z,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,(E,M)=>(openBlock(),createElementBlock("div",{key:M,class:normalizeClass(["signature",{focus:f.value&&f.value.index===E.index}]),onClick:T=>m(E.pageIndex)},[(openBlock(!0),createElementBlock(Fragment,null,renderList(E.signature.signerList,(T,D)=>{var N;return openBlock(),createElementBlock(Fragment,null,[T.isCertTrusted&&T.isSignVerified?(openBlock(),createBlock(y,{key:0})):T.isCertTrusted||T.isSignVerified?(openBlock(),createBlock(x,{key:1})):(openBlock(),createBlock(k,{key:2})),createBaseVNode("span",{title:E.name},toDisplayString((T.certificateList[0].subject.CN?T.certificateList[0].subject.CN:"")+"'s signature"),9,_hoisted_5$7),createVNode(unref(NPopover),{placement:"bottom-start",trigger:"click","show-arrow":!1,to:"#outerContainer",raw:!0,show:((N=f.value)==null?void 0:N.index)===M&&s.value,onClickoutside:w},{trigger:withCtx(()=>[createVNode(S,{class:"more",onClick:withModifiers(F=>v(E,M),["stop"])},{default:withCtx(()=>[createVNode(P)]),_:2},1032,["onClick"])]),default:withCtx(()=>[createBaseVNode("div",_hoisted_6$5,[createBaseVNode("div",{class:"drop-item",onClick:u[0]||(u[0]=F=>g("signatureDetailsDialog"))},toDisplayString(d.$t("panels.left.signatures.details")),1),createBaseVNode("div",{class:"drop-item",onClick:u[1]||(u[1]=F=>g("certificateViewerDialog"))},toDisplayString(d.$t("panels.left.signatures.certification")),1),createBaseVNode("div",{class:"drop-item",onClick:u[2]||(u[2]=F=>g("deleteConfirmDialog"))},toDisplayString(d.$t("common.actions.delete")),1)])]),_:2},1032,["show"])],64)}),256))],10,_hoisted_4$c))),128))])):(openBlock(),createElementBlock("div",_hoisted_7$5,toDisplayString(d.$t("panels.left.signatures.empty")),1))])}}},Icon_vue_vue_type_style_index_0_lang="",_hoisted_1$1e=["xlink:href"],_sfc_main$1w={__name:"Icon",props:["className","color","glyph","fillColor","strokeColor","disabled"],setup(e){const n=e,o={filter:n.color};n.disabled||(o.color=n.color);const r=computed(()=>`#${n.glyph}`);return(f,s)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["icon",[e.className,{disabled:e.disabled}]]),style:o},[(openBlock(),createElementBlock("svg",mergeProps({class:"svg-icon","aria-hidden":"true"},toHandlers(f.$attrs,!0)),[createBaseVNode("use",{"xlink:href":r.value},null,8,_hoisted_1$1e)],16))],2))}};var axios$3={exports:{}},axios$2={exports:{}},bind$2=function e(n,o){return function(){for(var f=new Array(arguments.length),s=0;s<f.length;s++)f[s]=arguments[s];return n.apply(o,f)}},bind$1=bind$2,toString=Object.prototype.toString,kindOf=function(e){return function(n){var o=toString.call(n);return e[o]||(e[o]=o.slice(8,-1).toLowerCase())}}(Object.create(null));function kindOfTest(e){return e=e.toLowerCase(),function(o){return kindOf(o)===e}}function isArray(e){return Array.isArray(e)}function isUndefined(e){return typeof e>"u"}function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}var isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){var n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&isArrayBuffer(e.buffer),n}function isString(e){return typeof e=="string"}function isNumber(e){return typeof e=="number"}function isObject(e){return e!==null&&typeof e=="object"}function isPlainObject(e){if(kindOf(e)!=="object")return!1;var n=Object.getPrototypeOf(e);return n===null||n===Object.prototype}var isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList");function isFunction(e){return toString.call(e)==="[object Function]"}function isStream(e){return isObject(e)&&isFunction(e.pipe)}function isFormData(e){var n="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||toString.call(e)===n||isFunction(e.toString)&&e.toString()===n)}var isURLSearchParams=kindOfTest("URLSearchParams");function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function isStandardBrowserEnv(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function forEach(e,n){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),isArray(e))for(var o=0,r=e.length;o<r;o++)n.call(null,e[o],o,e);else for(var f in e)Object.prototype.hasOwnProperty.call(e,f)&&n.call(null,e[f],f,e)}function merge(){var e={};function n(f,s){isPlainObject(e[s])&&isPlainObject(f)?e[s]=merge(e[s],f):isPlainObject(f)?e[s]=merge({},f):isArray(f)?e[s]=f.slice():e[s]=f}for(var o=0,r=arguments.length;o<r;o++)forEach(arguments[o],n);return e}function extend$1(e,n,o){return forEach(n,function(f,s){o&&typeof f=="function"?e[s]=bind$1(f,o):e[s]=f}),e}function stripBOM(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}function inherits(e,n,o,r){e.prototype=Object.create(n.prototype,r),e.prototype.constructor=e,o&&Object.assign(e.prototype,o)}function toFlatObject(e,n,o){var r,f,s,m={};n=n||{};do{for(r=Object.getOwnPropertyNames(e),f=r.length;f-- >0;)s=r[f],m[s]||(n[s]=e[s],m[s]=!0);e=Object.getPrototypeOf(e)}while(e&&(!o||o(e,n))&&e!==Object.prototype);return n}function endsWith(e,n,o){e=String(e),(o===void 0||o>e.length)&&(o=e.length),o-=n.length;var r=e.indexOf(n,o);return r!==-1&&r===o}function toArray(e){if(!e)return null;var n=e.length;if(isUndefined(n))return null;for(var o=new Array(n);n-- >0;)o[n]=e[n];return o}var isTypedArray=function(e){return function(n){return e&&n instanceof e}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),utils$b={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isObject,isPlainObject,isUndefined,isDate,isFile,isBlob,isFunction,isStream,isURLSearchParams,isStandardBrowserEnv,forEach,merge,extend:extend$1,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,isTypedArray,isFileList},utils$a=utils$b;function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL$1=function e(n,o,r){if(!o)return n;var f;if(r)f=r(o);else if(utils$a.isURLSearchParams(o))f=o.toString();else{var s=[];utils$a.forEach(o,function(g,v){g===null||typeof g>"u"||(utils$a.isArray(g)?v=v+"[]":g=[g],utils$a.forEach(g,function(u){utils$a.isDate(u)?u=u.toISOString():utils$a.isObject(u)&&(u=JSON.stringify(u)),s.push(encode(v)+"="+encode(u))}))}),f=s.join("&")}if(f){var m=n.indexOf("#");m!==-1&&(n=n.slice(0,m)),n+=(n.indexOf("?")===-1?"?":"&")+f}return n},utils$9=utils$b;function InterceptorManager$1(){this.handlers=[]}InterceptorManager$1.prototype.use=function e(n,o,r){return this.handlers.push({fulfilled:n,rejected:o,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1};InterceptorManager$1.prototype.eject=function e(n){this.handlers[n]&&(this.handlers[n]=null)};InterceptorManager$1.prototype.forEach=function e(n){utils$9.forEach(this.handlers,function(r){r!==null&&n(r)})};var InterceptorManager_1=InterceptorManager$1,utils$8=utils$b,normalizeHeaderName$1=function e(n,o){utils$8.forEach(n,function(f,s){s!==o&&s.toUpperCase()===o.toUpperCase()&&(n[o]=f,delete n[s])})},utils$7=utils$b;function AxiosError$2(e,n,o,r,f){Error.call(this),this.message=e,this.name="AxiosError",n&&(this.code=n),o&&(this.config=o),r&&(this.request=r),f&&(this.response=f)}utils$7.inherits(AxiosError$2,Error,{toJSON:function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype=AxiosError$2.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){descriptors[e]={value:e}});Object.defineProperties(AxiosError$2,descriptors);Object.defineProperty(prototype,"isAxiosError",{value:!0});AxiosError$2.from=function(e,n,o,r,f,s){var m=Object.create(prototype);return utils$7.toFlatObject(e,m,function(g){return g!==Error.prototype}),AxiosError$2.call(m,e.message,n,o,r,f),m.name=e.name,s&&Object.assign(m,s),m};var AxiosError_1=AxiosError$2,transitional={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},utils$6=utils$b;function toFormData$1(e,n){n=n||new FormData;var o=[];function r(s){return s===null?"":utils$6.isDate(s)?s.toISOString():utils$6.isArrayBuffer(s)||utils$6.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function f(s,m){if(utils$6.isPlainObject(s)||utils$6.isArray(s)){if(o.indexOf(s)!==-1)throw Error("Circular reference detected in "+m);o.push(s),utils$6.forEach(s,function(g,v){if(!utils$6.isUndefined(g)){var d=m?m+"."+v:v,u;if(g&&!m&&typeof g=="object"){if(utils$6.endsWith(v,"{}"))g=JSON.stringify(g);else if(utils$6.endsWith(v,"[]")&&(u=utils$6.toArray(g))){u.forEach(function(y){!utils$6.isUndefined(y)&&n.append(d,r(y))});return}}f(g,d)}}),o.pop()}else n.append(m,r(s))}return f(e),n}var toFormData_1=toFormData$1,settle,hasRequiredSettle;function requireSettle(){if(hasRequiredSettle)return settle;hasRequiredSettle=1;var e=AxiosError_1;return settle=function(o,r,f){var s=f.config.validateStatus;!f.status||!s||s(f.status)?o(f):r(new e("Request failed with status code "+f.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(f.status/100)-4],f.config,f.request,f))},settle}var cookies,hasRequiredCookies;function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var e=utils$b;return cookies=e.isStandardBrowserEnv()?function(){return{write:function(r,f,s,m,w,g){var v=[];v.push(r+"="+encodeURIComponent(f)),e.isNumber(s)&&v.push("expires="+new Date(s).toGMTString()),e.isString(m)&&v.push("path="+m),e.isString(w)&&v.push("domain="+w),g===!0&&v.push("secure"),document.cookie=v.join("; ")},read:function(r){var f=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return f?decodeURIComponent(f[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),cookies}var isAbsoluteURL$1=function e(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)},combineURLs$1=function e(n,o){return o?n.replace(/\/+$/,"")+"/"+o.replace(/^\/+/,""):n},isAbsoluteURL=isAbsoluteURL$1,combineURLs=combineURLs$1,buildFullPath$1=function e(n,o){return n&&!isAbsoluteURL(o)?combineURLs(n,o):o},parseHeaders,hasRequiredParseHeaders;function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var e=utils$b,n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return parseHeaders=function(r){var f={},s,m,w;return r&&e.forEach(r.split(`
2693
2693
  `),function(v){if(w=v.indexOf(":"),s=e.trim(v.substr(0,w)).toLowerCase(),m=e.trim(v.substr(w+1)),s){if(f[s]&&n.indexOf(s)>=0)return;s==="set-cookie"?f[s]=(f[s]?f[s]:[]).concat([m]):f[s]=f[s]?f[s]+", "+m:m}}),f},parseHeaders}var isURLSameOrigin,hasRequiredIsURLSameOrigin;function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var e=utils$b;return isURLSameOrigin=e.isStandardBrowserEnv()?function(){var o=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),f;function s(m){var w=m;return o&&(r.setAttribute("href",w),w=r.href),r.setAttribute("href",w),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return f=s(window.location.href),function(w){var g=e.isString(w)?s(w):w;return g.protocol===f.protocol&&g.host===f.host}}():function(){return function(){return!0}}(),isURLSameOrigin}var CanceledError_1,hasRequiredCanceledError;function requireCanceledError(){if(hasRequiredCanceledError)return CanceledError_1;hasRequiredCanceledError=1;var e=AxiosError_1,n=utils$b;function o(r){e.call(this,r==null?"canceled":r,e.ERR_CANCELED),this.name="CanceledError"}return n.inherits(o,e,{__CANCEL__:!0}),CanceledError_1=o,CanceledError_1}var parseProtocol,hasRequiredParseProtocol;function requireParseProtocol(){return hasRequiredParseProtocol||(hasRequiredParseProtocol=1,parseProtocol=function(n){var o=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return o&&o[1]||""}),parseProtocol}var xhr,hasRequiredXhr;function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var e=utils$b,n=requireSettle(),o=requireCookies(),r=buildURL$1,f=buildFullPath$1,s=requireParseHeaders(),m=requireIsURLSameOrigin(),w=transitional,g=AxiosError_1,v=requireCanceledError(),d=requireParseProtocol();return xhr=function(y){return new Promise(function(k,P){var S=y.data,E=y.headers,M=y.responseType,T;function D(){y.cancelToken&&y.cancelToken.unsubscribe(T),y.signal&&y.signal.removeEventListener("abort",T)}e.isFormData(S)&&e.isStandardBrowserEnv()&&delete E["Content-Type"];var N=new XMLHttpRequest;if(y.auth){var F=y.auth.username||"",O=y.auth.password?unescape(encodeURIComponent(y.auth.password)):"";E.Authorization="Basic "+btoa(F+":"+O)}var I=f(y.baseURL,y.url);N.open(y.method.toUpperCase(),r(I,y.params,y.paramsSerializer),!0),N.timeout=y.timeout;function X(){if(!!N){var J="getAllResponseHeaders"in N?s(N.getAllResponseHeaders()):null,te=!M||M==="text"||M==="json"?N.responseText:N.response,q={data:te,status:N.status,statusText:N.statusText,headers:J,config:y,request:N};n(function(U){k(U),D()},function(U){P(U),D()},q),N=null}}if("onloadend"in N?N.onloadend=X:N.onreadystatechange=function(){!N||N.readyState!==4||N.status===0&&!(N.responseURL&&N.responseURL.indexOf("file:")===0)||setTimeout(X)},N.onabort=function(){!N||(P(new g("Request aborted",g.ECONNABORTED,y,N)),N=null)},N.onerror=function(){P(new g("Network Error",g.ERR_NETWORK,y,N,N)),N=null},N.ontimeout=function(){var te=y.timeout?"timeout of "+y.timeout+"ms exceeded":"timeout exceeded",q=y.transitional||w;y.timeoutErrorMessage&&(te=y.timeoutErrorMessage),P(new g(te,q.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,y,N)),N=null},e.isStandardBrowserEnv()){var ne=(y.withCredentials||m(I))&&y.xsrfCookieName?o.read(y.xsrfCookieName):void 0;ne&&(E[y.xsrfHeaderName]=ne)}"setRequestHeader"in N&&e.forEach(E,function(te,q){typeof S>"u"&&q.toLowerCase()==="content-type"?delete E[q]:N.setRequestHeader(q,te)}),e.isUndefined(y.withCredentials)||(N.withCredentials=!!y.withCredentials),M&&M!=="json"&&(N.responseType=y.responseType),typeof y.onDownloadProgress=="function"&&N.addEventListener("progress",y.onDownloadProgress),typeof y.onUploadProgress=="function"&&N.upload&&N.upload.addEventListener("progress",y.onUploadProgress),(y.cancelToken||y.signal)&&(T=function(J){!N||(P(!J||J&&J.type?new v:J),N.abort(),N=null)},y.cancelToken&&y.cancelToken.subscribe(T),y.signal&&(y.signal.aborted?T():y.signal.addEventListener("abort",T))),S||(S=null);var ye=d(I);if(ye&&["http","https","file"].indexOf(ye)===-1){P(new g("Unsupported protocol "+ye+":",g.ERR_BAD_REQUEST,y));return}N.send(S)})},xhr}var _null,hasRequired_null;function require_null(){return hasRequired_null||(hasRequired_null=1,_null=null),_null}var utils$5=utils$b,normalizeHeaderName=normalizeHeaderName$1,AxiosError$1=AxiosError_1,transitionalDefaults=transitional,toFormData=toFormData_1,DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,n){!utils$5.isUndefined(e)&&utils$5.isUndefined(e["Content-Type"])&&(e["Content-Type"]=n)}function getDefaultAdapter(){var e;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(e=requireXhr()),e}function stringifySafely(e,n,o){if(utils$5.isString(e))try{return(n||JSON.parse)(e),utils$5.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(o||JSON.stringify)(e)}var defaults$4={transitional:transitionalDefaults,adapter:getDefaultAdapter(),transformRequest:[function e(n,o){if(normalizeHeaderName(o,"Accept"),normalizeHeaderName(o,"Content-Type"),utils$5.isFormData(n)||utils$5.isArrayBuffer(n)||utils$5.isBuffer(n)||utils$5.isStream(n)||utils$5.isFile(n)||utils$5.isBlob(n))return n;if(utils$5.isArrayBufferView(n))return n.buffer;if(utils$5.isURLSearchParams(n))return setContentTypeIfUnset(o,"application/x-www-form-urlencoded;charset=utf-8"),n.toString();var r=utils$5.isObject(n),f=o&&o["Content-Type"],s;if((s=utils$5.isFileList(n))||r&&f==="multipart/form-data"){var m=this.env&&this.env.FormData;return toFormData(s?{"files[]":n}:n,m&&new m)}else if(r||f==="application/json")return setContentTypeIfUnset(o,"application/json"),stringifySafely(n);return n}],transformResponse:[function e(n){var o=this.transitional||defaults$4.transitional,r=o&&o.silentJSONParsing,f=o&&o.forcedJSONParsing,s=!r&&this.responseType==="json";if(s||f&&utils$5.isString(n)&&n.length)try{return JSON.parse(n)}catch(m){if(s)throw m.name==="SyntaxError"?AxiosError$1.from(m,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):m}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:require_null()},validateStatus:function e(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils$5.forEach(["delete","get","head"],function e(n){defaults$4.headers[n]={}});utils$5.forEach(["post","put","patch"],function e(n){defaults$4.headers[n]=utils$5.merge(DEFAULT_CONTENT_TYPE)});var defaults_1=defaults$4,utils$4=utils$b,defaults$3=defaults_1,transformData$1=function e(n,o,r){var f=this||defaults$3;return utils$4.forEach(r,function(m){n=m.call(f,n,o)}),n},isCancel$1,hasRequiredIsCancel;function requireIsCancel(){return hasRequiredIsCancel||(hasRequiredIsCancel=1,isCancel$1=function(n){return!!(n&&n.__CANCEL__)}),isCancel$1}var utils$3=utils$b,transformData=transformData$1,isCancel=requireIsCancel(),defaults$2=defaults_1,CanceledError=requireCanceledError();function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError}var dispatchRequest$1=function e(n){throwIfCancellationRequested(n),n.headers=n.headers||{},n.data=transformData.call(n,n.data,n.headers,n.transformRequest),n.headers=utils$3.merge(n.headers.common||{},n.headers[n.method]||{},n.headers),utils$3.forEach(["delete","get","head","post","put","patch","common"],function(f){delete n.headers[f]});var o=n.adapter||defaults$2.adapter;return o(n).then(function(f){return throwIfCancellationRequested(n),f.data=transformData.call(n,f.data,f.headers,n.transformResponse),f},function(f){return isCancel(f)||(throwIfCancellationRequested(n),f&&f.response&&(f.response.data=transformData.call(n,f.response.data,f.response.headers,n.transformResponse))),Promise.reject(f)})},utils$2=utils$b,mergeConfig$2=function e(n,o){o=o||{};var r={};function f(d,u){return utils$2.isPlainObject(d)&&utils$2.isPlainObject(u)?utils$2.merge(d,u):utils$2.isPlainObject(u)?utils$2.merge({},u):utils$2.isArray(u)?u.slice():u}function s(d){if(utils$2.isUndefined(o[d])){if(!utils$2.isUndefined(n[d]))return f(void 0,n[d])}else return f(n[d],o[d])}function m(d){if(!utils$2.isUndefined(o[d]))return f(void 0,o[d])}function w(d){if(utils$2.isUndefined(o[d])){if(!utils$2.isUndefined(n[d]))return f(void 0,n[d])}else return f(void 0,o[d])}function g(d){if(d in o)return f(n[d],o[d]);if(d in n)return f(void 0,n[d])}var v={url:m,method:m,data:m,baseURL:w,transformRequest:w,transformResponse:w,paramsSerializer:w,timeout:w,timeoutMessage:w,withCredentials:w,adapter:w,responseType:w,xsrfCookieName:w,xsrfHeaderName:w,onUploadProgress:w,onDownloadProgress:w,decompress:w,maxContentLength:w,maxBodyLength:w,beforeRedirect:w,transport:w,httpAgent:w,httpsAgent:w,cancelToken:w,socketPath:w,responseEncoding:w,validateStatus:g};return utils$2.forEach(Object.keys(n).concat(Object.keys(o)),function(u){var y=v[u]||s,x=y(u);utils$2.isUndefined(x)&&y!==g||(r[u]=x)}),r},data,hasRequiredData;function requireData(){return hasRequiredData||(hasRequiredData=1,data={version:"0.27.2"}),data}var VERSION=requireData().version,AxiosError=AxiosError_1,validators$1={};["object","boolean","number","function","string","symbol"].forEach(function(e,n){validators$1[e]=function(r){return typeof r===e||"a"+(n<1?"n ":" ")+e}});var deprecatedWarnings={};validators$1.transitional=function e(n,o,r){function f(s,m){return"[Axios v"+VERSION+"] Transitional option '"+s+"'"+m+(r?". "+r:"")}return function(s,m,w){if(n===!1)throw new AxiosError(f(m," has been removed"+(o?" in "+o:"")),AxiosError.ERR_DEPRECATED);return o&&!deprecatedWarnings[m]&&(deprecatedWarnings[m]=!0,console.warn(f(m," has been deprecated since v"+o+" and will be removed in the near future"))),n?n(s,m,w):!0}};function assertOptions(e,n,o){if(typeof e!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),f=r.length;f-- >0;){var s=r[f],m=n[s];if(m){var w=e[s],g=w===void 0||m(w,s,e);if(g!==!0)throw new AxiosError("option "+s+" must be "+g,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new AxiosError("Unknown option "+s,AxiosError.ERR_BAD_OPTION)}}var validator$1={assertOptions,validators:validators$1},utils$1=utils$b,buildURL=buildURL$1,InterceptorManager=InterceptorManager_1,dispatchRequest=dispatchRequest$1,mergeConfig$1=mergeConfig$2,buildFullPath=buildFullPath$1,validator=validator$1,validators=validator.validators;function Axios$1(e){this.defaults=e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios$1.prototype.request=function e(n,o){typeof n=="string"?(o=o||{},o.url=n):o=n||{},o=mergeConfig$1(this.defaults,o),o.method?o.method=o.method.toLowerCase():this.defaults.method?o.method=this.defaults.method.toLowerCase():o.method="get";var r=o.transitional;r!==void 0&&validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1);var f=[],s=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(o)===!1||(s=s&&x.synchronous,f.unshift(x.fulfilled,x.rejected))});var m=[];this.interceptors.response.forEach(function(x){m.push(x.fulfilled,x.rejected)});var w;if(!s){var g=[dispatchRequest,void 0];for(Array.prototype.unshift.apply(g,f),g=g.concat(m),w=Promise.resolve(o);g.length;)w=w.then(g.shift(),g.shift());return w}for(var v=o;f.length;){var d=f.shift(),u=f.shift();try{v=d(v)}catch(y){u(y);break}}try{w=dispatchRequest(v)}catch(y){return Promise.reject(y)}for(;m.length;)w=w.then(m.shift(),m.shift());return w};Axios$1.prototype.getUri=function e(n){n=mergeConfig$1(this.defaults,n);var o=buildFullPath(n.baseURL,n.url);return buildURL(o,n.params,n.paramsSerializer)};utils$1.forEach(["delete","get","head","options"],function e(n){Axios$1.prototype[n]=function(o,r){return this.request(mergeConfig$1(r||{},{method:n,url:o,data:(r||{}).data}))}});utils$1.forEach(["post","put","patch"],function e(n){function o(r){return function(s,m,w){return this.request(mergeConfig$1(w||{},{method:n,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:m}))}}Axios$1.prototype[n]=o(),Axios$1.prototype[n+"Form"]=o(!0)});var Axios_1=Axios$1,CancelToken_1,hasRequiredCancelToken;function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var e=requireCanceledError();function n(o){if(typeof o!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(m){r=m});var f=this;this.promise.then(function(s){if(!!f._listeners){var m,w=f._listeners.length;for(m=0;m<w;m++)f._listeners[m](s);f._listeners=null}}),this.promise.then=function(s){var m,w=new Promise(function(g){f.subscribe(g),m=g}).then(s);return w.cancel=function(){f.unsubscribe(m)},w},o(function(m){f.reason||(f.reason=new e(m),r(f.reason))})}return n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]},n.prototype.unsubscribe=function(r){if(!!this._listeners){var f=this._listeners.indexOf(r);f!==-1&&this._listeners.splice(f,1)}},n.source=function(){var r,f=new n(function(m){r=m});return{token:f,cancel:r}},CancelToken_1=n,CancelToken_1}var spread,hasRequiredSpread;function requireSpread(){return hasRequiredSpread||(hasRequiredSpread=1,spread=function(n){return function(r){return n.apply(null,r)}}),spread}var isAxiosError,hasRequiredIsAxiosError;function requireIsAxiosError(){if(hasRequiredIsAxiosError)return isAxiosError;hasRequiredIsAxiosError=1;var e=utils$b;return isAxiosError=function(o){return e.isObject(o)&&o.isAxiosError===!0},isAxiosError}var utils=utils$b,bind=bind$2,Axios=Axios_1,mergeConfig=mergeConfig$2,defaults$1=defaults_1;function createInstance(e){var n=new Axios(e),o=bind(Axios.prototype.request,n);return utils.extend(o,Axios.prototype,n),utils.extend(o,n),o.create=function(f){return createInstance(mergeConfig(e,f))},o}var axios$1=createInstance(defaults$1);axios$1.Axios=Axios;axios$1.CanceledError=requireCanceledError();axios$1.CancelToken=requireCancelToken();axios$1.isCancel=requireIsCancel();axios$1.VERSION=requireData().version;axios$1.toFormData=toFormData_1;axios$1.AxiosError=AxiosError_1;axios$1.Cancel=axios$1.CanceledError;axios$1.all=function e(n){return Promise.all(n)};axios$1.spread=requireSpread();axios$1.isAxiosError=requireIsAxiosError();axios$2.exports=axios$1;axios$2.exports.default=axios$1;(function(e){e.exports=axios$2.exports})(axios$3);const axios=getDefaultExportFromCjs(axios$3.exports);var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,n,o)=>n in e?__defProp(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,__spreadValues=(e,n)=>{for(var o in n||(n={}))__hasOwnProp.call(n,o)&&__defNormalProp(e,o,n[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(n))__propIsEnum.call(n,o)&&__defNormalProp(e,o,n[o]);return e},__spreadProps=(e,n)=>__defProps(e,__getOwnPropDescs(n));function useAxios(...e){const n=typeof e[0]=="string"?e[0]:void 0,o=isString$1(n)?1:0;let r={},f=axios,s={immediate:!!o,shallow:!0};const m=N=>!!(N!=null&&N.request);e.length>0+o&&(m(e[0+o])?f=e[0+o]:r=e[0+o]),e.length>1+o&&m(e[1+o])&&(f=e[1+o]),(e.length===2+o&&!m(e[1+o])||e.length===3+o)&&(s=e[e.length-1]);const w=shallowRef(),g=s.shallow?shallowRef():ref(),v=ref(!1),d=ref(!1),u=ref(!1),y=shallowRef(),x=axios.CancelToken.source;let k=x();const P=N=>{v.value||!d.value||(k.cancel(N),k=x(),u.value=!0,d.value=!1,v.value=!1)},S=N=>{d.value=N,v.value=!N},E=()=>new Promise((N,F)=>{until(v).toBe(!0).then(()=>N(D)).catch(F)}),M=(N,F)=>E().then(N,F),T=(N=n,F={})=>{y.value=void 0;const O=typeof N=="string"?N:n!=null?n:F.url;return O===void 0?(y.value=new axios$3.exports.AxiosError(axios$3.exports.AxiosError.ERR_INVALID_URL),v.value=!0,{then:M}):(P(),S(!0),f(O,__spreadProps(__spreadValues(__spreadValues({},r),typeof N=="object"?N:F),{cancelToken:k.token})).then(I=>{var X;w.value=I;const ne=I.data;g.value=ne,(X=s.onSuccess)==null||X.call(s,ne)}).catch(I=>{var X;y.value=I,(X=s.onError)==null||X.call(s,I)}).finally(()=>S(!1)),{then:M})};s.immediate&&n&&T();const D={response:w,data:g,error:y,finished:v,loading:d,isFinished:v,isLoading:d,cancel:P,isAborted:u,canceled:u,aborted:u,isCanceled:u,abort:P,execute:T};return __spreadProps(__spreadValues({},D),{then:M})}const Compare_vue_vue_type_style_index_0_lang="",_hoisted_1$1d=createBaseVNode("div",{class:"file-text"},[createBaseVNode("span",{class:"circle circle-red"}),createBaseVNode("p",null,"First File")],-1),_hoisted_2$15=createBaseVNode("div",{class:"file-text"},[createBaseVNode("span",{class:"circle circle-blue"}),createBaseVNode("p",null,"Second File")],-1),_sfc_main$1v={__name:"Compare",setup(e){const{loadDocument:n,getOptionUrl:o}=core,r=ref(),f=ref(),s=useViewerStore(),m=useDocumentStore();let w=reactive({firstFile:null,secondFile:null});const g=ref(!1),v=x=>x.click(),d=computed(()=>!(w.firstFile&&w.secondFile)),u=(x,k)=>{x.preventDefault(),w[k]=x.target.files[0]},y=async()=>{const x=o();if(!g.value&&!d.value){g.value=!0;const k=new FormData;k.append("firstFile",w.firstFile),k.append("secondFile",w.secondFile);const{data:P,isFinished:S}=await useAxios(`${x.compareBaseUrl||x.baseUrl}${x.compareUrl}`,{method:"POST",data:k,responseType:"arraybuffer"});if(S.value){g.value=!1;const E={progress:m.setLoadingProgress,pageChangedCallback:s.setCurrentPage,scaleChangedCallback:s.setCurrentScale,annotationsNumChangedCallback:m.setAnnotationsCount,distanceChangedCallback:m.setDistance};await n(P.value,E),s.toggleElement("leftPanel");const M=core.getPagesCount(),T=core.getScale();m.setTotalPages(M),s.setCurrentScale(T),s.setCurrentPage(1)}}};return(x,k)=>{const P=_sfc_main$1w;return openBlock(),createElementBlock(Fragment,null,[_hoisted_1$1d,createBaseVNode("button",{onClick:k[0]||(k[0]=S=>v(r.value))},"Select File"),createBaseVNode("input",{ref_key:"firstFileInput",ref:r,class:"hidden",type:"file",onChange:k[1]||(k[1]=S=>u(S,"firstFile")),accept:".pdf",name:"compare"},null,544),createBaseVNode("p",null,toDisplayString(unref(w).firstFile&&unref(w).firstFile.name),1),_hoisted_2$15,createBaseVNode("button",{onClick:k[2]||(k[2]=S=>v(f.value))},"Select File"),createBaseVNode("input",{ref_key:"secondFileInput",ref:f,class:"hidden",type:"file",onChange:k[3]||(k[3]=S=>u(S,"secondFile")),accept:".pdf",name:"compare"},null,544),createBaseVNode("p",null,toDisplayString(unref(w).secondFile&&unref(w).secondFile.name),1),createBaseVNode("button",{class:normalizeClass(["compare-button",{disabled:d.value}]),onClick:y},[createTextVNode(" Compare "),g.value?(openBlock(),createBlock(P,{key:0,glyph:"icon-loading",class:normalizeClass(x.iconClassName)},null,8,["class"])):createCommentVNode("",!0)],2)],64)}}},LayerPropertyDialog_vue_vue_type_style_index_0_lang="",_hoisted_1$1c={key:0,class:"layer-property-popup"},_hoisted_2$14={class:"title"},_hoisted_3$Y={class:"container"},_hoisted_4$b=["placeholder"],_hoisted_5$6={class:"text-start"},_hoisted_6$4={class:"select-container"},_hoisted_7$4={value:1},_hoisted_8$3={value:0},_hoisted_9$3={class:"select-container"},_hoisted_10$3={value:0},_hoisted_11$2={value:1},_hoisted_12$2={value:2},_hoisted_13$2={class:"select-container"},_hoisted_14$2={value:0},_hoisted_15$2={value:1},_hoisted_16$2={value:2},dialogName="layerPropertyDialog",_sfc_main$1u={__name:"LayerPropertyDialog",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=computed(()=>n.isElementOpen(dialogName)),f=computed(()=>o.getSelectedLayer),s=ref(""),m=ref(0),w=ref(0),g=ref(3),v=ref(3),d=ref(!1);watch(r,(x,k)=>{x&&(s.value=f.value.name,m.value=f.value.defaultVisible,w.value=f.value.isLocked,g.value=f.value.printState,v.value=f.value.exportState),d.value=!1}),watch([s,m,w,g,v],(x,k)=>{!f.value||(d.value=!((f.value.name===x[0]||x[0].trim()==="")&&f.value.defaultVisible===x[1]&&f.value.isLocked===x[2]&&f.value.printState===x[3]&&f.value.exportState===x[4]))});const u=()=>{n.closeElement(dialogName),o.setSelectedLayer(null)},y=async()=>{const x={node:f.value.node};s.value!==""&&s.value!==f.value.name&&(x.name=f.value.name=s.value),m.value!==f.value.defaultVisible&&(x.defaultVisible=f.value.defaultVisible=m.value),w.value!==f.value.isLocked&&(x.isLocked=f.value.isLocked=w.value),g.value!==f.value.printState&&(x.printState=f.value.printState=g.value),v.value!==f.value.exportState&&(x.exportState=f.value.exportState=v.value),m.value!==f.value.visible&&(x.visible=f.value.visible=m.value,x.ocg=f.value.ocg),core.setLayers(x),u()};return(x,k)=>{const P=__unplugin_components_0$s,S=__unplugin_components_1$f,E=_sfc_main$4f;return r.value?(openBlock(),createElementBlock("div",_hoisted_1$1c,[createVNode(E,{show:r.value,dialogName,close:u},{header:withCtx(()=>[createBaseVNode("p",_hoisted_2$14,toDisplayString(x.$t("layer.properties.layerProperty")),1)]),footer:withCtx(()=>[createBaseVNode("div",{class:normalizeClass(["rect-button blue",{disabled:!d.value}]),onClick:y},toDisplayString(x.$t("common.actions.ok")),3)]),default:withCtx(()=>[createBaseVNode("div",_hoisted_3$Y,[createBaseVNode("span",null,toDisplayString(x.$t("layer.properties.name")),1),withDirectives(createBaseVNode("input",{type:"text",placeholder:x.$t("layer.properties.namePlaceholder"),name:"layerName","onUpdate:modelValue":k[0]||(k[0]=M=>s.value=M),maxlength:"50"},null,8,_hoisted_4$b),[[vModelText,s.value]]),createBaseVNode("span",_hoisted_5$6,toDisplayString(x.$t("layer.properties.defaultSettings")),1),createBaseVNode("div",null,[createBaseVNode("div",_hoisted_6$4,[withDirectives(createBaseVNode("select",{name:"defaultSetting","onUpdate:modelValue":k[1]||(k[1]=M=>m.value=M)},[createBaseVNode("option",_hoisted_7$4,toDisplayString(x.$t("layer.properties.defaultShow")),1),createBaseVNode("option",_hoisted_8$3,toDisplayString(x.$t("layer.properties.defaultHide")),1)],512),[[vModelSelect,m.value]]),createVNode(P)]),createBaseVNode("div",{class:"check-box",onClick:k[2]||(k[2]=M=>w.value=(w.value+1)%2)},[createBaseVNode("div",{class:normalizeClass(["check",{active:w.value}])},[withDirectives(createVNode(S,null,null,512),[[vShow,w.value]])],2),createBaseVNode("span",null,toDisplayString(x.$t("layer.properties.lockLayer")),1)])]),createBaseVNode("span",null,toDisplayString(x.$t("layer.properties.printProperty")),1),createBaseVNode("div",_hoisted_9$3,[withDirectives(createBaseVNode("select",{name:"printProperty","onUpdate:modelValue":k[3]||(k[3]=M=>g.value=M)},[createBaseVNode("option",_hoisted_10$3,toDisplayString(x.$t("layer.properties.always")),1),createBaseVNode("option",_hoisted_11$2,toDisplayString(x.$t("layer.properties.never")),1),createBaseVNode("option",_hoisted_12$2,toDisplayString(x.$t("layer.properties.printVisible")),1)],512),[[vModelSelect,g.value]]),createVNode(P)]),createBaseVNode("span",null,toDisplayString(x.$t("layer.properties.exportProperty")),1),createBaseVNode("div",_hoisted_13$2,[withDirectives(createBaseVNode("select",{name:"exportProperty","onUpdate:modelValue":k[4]||(k[4]=M=>v.value=M)},[createBaseVNode("option",_hoisted_14$2,toDisplayString(x.$t("layer.properties.always")),1),createBaseVNode("option",_hoisted_15$2,toDisplayString(x.$t("layer.properties.never")),1),createBaseVNode("option",_hoisted_16$2,toDisplayString(x.$t("layer.properties.exportVisible")),1)],512),[[vModelSelect,v.value]]),createVNode(P)])])]),_:1},8,["show"])])):createCommentVNode("",!0)}}},_sfc_main$1t={},_hoisted_1$1b={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$13=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 8H12V7C12 5.89543 11.1046 5 10 5C8.89543 5 8 5.89543 8 7V8ZM7 8H6C5.44772 8 5 8.44772 5 9V15C5 15.5523 5.44772 16 6 16H14C14.5523 16 15 15.5523 15 15V9C15 8.44772 14.5523 8 14 8H13V7C13 5.34315 11.6569 4 10 4C8.34315 4 7 5.34315 7 7V8Z",fill:"currentColor"},null,-1),_hoisted_3$X=[_hoisted_2$13];function _sfc_render$O(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1b,_hoisted_3$X)}const __unplugin_components_3$4=_export_sfc(_sfc_main$1t,[["render",_sfc_render$O]]),_sfc_main$1s={},_hoisted_1$1a={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$12=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 3H17V17H3V3ZM2 3C2 2.44772 2.44772 2 3 2H17C17.5523 2 18 2.44772 18 3V17C18 17.5523 17.5523 18 17 18H3C2.44772 18 2 17.5523 2 17V3ZM5.40381 5L15.3033 14.8995L14.5962 15.6066L4.6967 5.70711L5.40381 5ZM5.82074 8.24536C4.69777 9.2643 4 10.3033 4 10.3033C4 10.3033 6.68629 14.3033 10 14.3033C10.5489 14.3033 11.0806 14.1935 11.5858 14.0104L5.82074 8.24536ZM14.1793 12.3612C15.3022 11.3423 16 10.3033 16 10.3033C16 10.3033 13.3137 6.3033 10 6.3033C9.45108 6.3033 8.91937 6.41306 8.41424 6.59622L14.1793 12.3612Z",fill:"currentColor"},null,-1),_hoisted_3$W=[_hoisted_2$12];function _sfc_render$N(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$1a,_hoisted_3$W)}const __unplugin_components_2$9=_export_sfc(_sfc_main$1s,[["render",_sfc_render$N]]),_sfc_main$1r={},_hoisted_1$19={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$11=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 3H17V17H3V3ZM2 3C2 2.44772 2.44772 2 3 2H17C17.5523 2 18 2.44772 18 3V17C18 17.5523 17.5523 18 17 18H3C2.44772 18 2 17.5523 2 17V3ZM16 10C16 10 13.3137 14 10 14C6.68629 14 4 10 4 10C4 10 6.68629 6 10 6C13.3137 6 16 10 16 10ZM12 10C12 11.1046 11.1046 12 10 12C8.89543 12 8 11.1046 8 10C8 8.89543 8.89543 8 10 8C11.1046 8 12 8.89543 12 10Z",fill:"currentColor"},null,-1),_hoisted_3$V=[_hoisted_2$11];function _sfc_render$M(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$19,_hoisted_3$V)}const __unplugin_components_1$1=_export_sfc(_sfc_main$1r,[["render",_sfc_render$M]]),_sfc_main$1q={},_hoisted_1$18={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$10=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.01025 4L11 8.0041L6 12L6.01025 4Z",fill:"currentColor"},null,-1),_hoisted_3$U=[_hoisted_2$10];function _sfc_render$L(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$18,_hoisted_3$U)}const __unplugin_components_0$d=_export_sfc(_sfc_main$1q,[["render",_sfc_render$L]]),Layer_vue_vue_type_style_index_0_lang="",_hoisted_1$17={class:"layer"},_hoisted_2$$=["title"],_hoisted_3$T={class:"drop-down medium"},_sfc_main$1p={__name:"Layer",props:["layer","level"],setup(e,{emit:n}){const o=n,r=useDocumentStore(),f=useViewerStore(),s=computed(()=>r.getSelectedLayer),m=ref(!1),w=ref(!1),g=ref(!1),v=ref(""),d=ref(null),u=N=>{N.stopPropagation(),m.value=!m.value},y=()=>{w.value=!1,r.setSelectedLayer(null)},x=N=>{w.value=!1,f.openElement(N)},k=N=>{w.value=!0,r.setSelectedLayer(N)},P=N=>{if(N.isLocked){S(N);return}N.visible=(N.visible+1)%2,core.setLayers({node:N.node,visible:N.visible,ocg:N.ocg})},S=N=>{r.setSelectedLayer(N),o("showTipDialog",N)},E=async N=>{w.value=!1,f.setCommonLoading(!0);const O=(I=>{for(;I;){if(I.ocg)return I.ocg;I=I.children[0]}})(N);if(!O){console.error("Unable to export."),r.setSelectedLayer(null),f.setCommonLoading(!1);return}await core.exportLayers(O,!0),r.setSelectedLayer(null),f.setCommonLoading(!1)},M=N=>{v.value=N,g.value=!0,nextTick(()=>{d.value.focus(),d.value.select()})},T=N=>{if(!v.value.trim()){g.value=!1;return}N.name=v.value,core.setLayers({node:N.node,name:v.value}),g.value=!1},D=N=>{g.value&&d.value&&!d.value.contains(N.target)&&(g.value=!1)};return onMounted(()=>{window.addEventListener("click",D)}),onBeforeUnmount(()=>{window.removeEventListener("click",D)}),(N,F)=>{var q;const O=__unplugin_components_0$d,I=__unplugin_components_1$1,X=__unplugin_components_2$9,ne=__unplugin_components_3$4,ye=__unplugin_components_4$4,J=_sfc_main$4m,te=resolveComponent("Layer",!0);return openBlock(),createElementBlock("div",_hoisted_1$17,[createBaseVNode("div",{class:normalizeClass(["layer-item",{focus:s.value&&s.value.node===e.layer.node}])},[createBaseVNode("div",{class:normalizeClass(["layer-item-toggle",m.value&&"active"]),style:normalizeStyle({marginLeft:12*e.level+"px"})},[e.layer.children.length?(openBlock(),createBlock(O,{key:0,onClick:u})):createCommentVNode("",!0)],6),e.layer.visible?(openBlock(),createBlock(I,{key:0,onClick:F[0]||(F[0]=re=>P(e.layer))})):(openBlock(),createBlock(X,{key:1,onClick:F[1]||(F[1]=re=>P(e.layer))})),createBaseVNode("div",{class:"layer-item-name",onClick:D},[g.value?withDirectives((openBlock(),createElementBlock("input",{key:1,type:"text","onUpdate:modelValue":F[3]||(F[3]=re=>v.value=re),onBlur:F[4]||(F[4]=re=>g.value=!1),onKeyup:F[5]||(F[5]=withKeys(re=>T(e.layer),["enter"])),ref_key:"nameInputRef",ref:d,maxlength:"50"},null,544)),[[vModelText,v.value]]):(openBlock(),createElementBlock("span",{key:0,onDblclick:F[2]||(F[2]=re=>M(e.layer.name)),title:e.layer.name},toDisplayString(e.layer.name),41,_hoisted_2$$))]),e.layer.isLocked?(openBlock(),createBlock(ne,{key:2,onClick:F[6]||(F[6]=re=>S(e.layer))})):createCommentVNode("",!0),createVNode(unref(NPopover),{placement:"bottom-start",trigger:"click","show-arrow":!1,to:"#outerContainer",raw:!0,show:((q=s.value)==null?void 0:q.name)===e.layer.name&&w.value,onClickoutside:y,class:"no-margin-top"},{trigger:withCtx(()=>[createVNode(J,{class:"more",onClick:F[7]||(F[7]=withModifiers(re=>k(e.layer),["stop"])),title:N.$t("panels.left.layers.menu")},{default:withCtx(()=>[createVNode(ye)]),_:1},8,["title"])]),default:withCtx(()=>[createBaseVNode("div",_hoisted_3$T,[createBaseVNode("div",{class:"drop-item",onClick:F[8]||(F[8]=re=>x("layerPropertyDialog"))},toDisplayString(N.$t("panels.left.layers.layerProperty")),1),createBaseVNode("div",{class:"drop-item",onClick:F[9]||(F[9]=re=>E(e.layer))},toDisplayString(N.$t("panels.left.layers.exportLayer")),1)])]),_:1},8,["show"])],2),m.value?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(e.layer.children,re=>(openBlock(),createBlock(te,{layer:re,level:e.level+1,onShowTipDialog:S},null,8,["layer","level"]))),256)):createCommentVNode("",!0)])}}},_sfc_main$1o={},_hoisted_1$16={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$_=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 5.25C3 4.83579 3.33579 4.5 3.75 4.5H16.2516C16.6659 4.5 17.0016 4.83579 17.0016 5.25C17.0016 5.66421 16.6659 6 16.2516 6H3.75C3.33579 6 3 5.66421 3 5.25ZM3 10.0006C3 9.58635 3.33579 9.25056 3.75 9.25056H16.2516C16.6659 9.25056 17.0016 9.58635 17.0016 10.0006C17.0016 10.4148 16.6659 10.7506 16.2516 10.7506H3.75C3.33579 10.7506 3 10.4148 3 10.0006ZM3.75 14.0012C3.33579 14.0012 3 14.337 3 14.7512C3 15.1654 3.33579 15.5012 3.75 15.5012H16.2516C16.6659 15.5012 17.0016 15.1654 17.0016 14.7512C17.0016 14.337 16.6659 14.0012 16.2516 14.0012H3.75Z",fill:"currentColor"},null,-1),_hoisted_3$S=[_hoisted_2$_];function _sfc_render$K(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$16,_hoisted_3$S)}const __unplugin_components_0$c=_export_sfc(_sfc_main$1o,[["render",_sfc_render$K]]),LayerContainer_vue_vue_type_style_index_0_lang="",_hoisted_1$15={class:"container"},_hoisted_2$Z={class:"layer-title"},_hoisted_3$R={class:"drop-down medium"},_hoisted_4$a={key:1,class:"no-layers"},_hoisted_5$5={key:0,class:"layer-locked-tip-popup"},_sfc_main$1n={__name:"LayerContainer",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=computed(()=>o.getLayers),f=computed(()=>{const P=S=>S.some(E=>{if(E.exportState===0||E.exportState!==1&&E.visible)return!0;if(Array.isArray(E.children)&&E.children.length)return P(E.children)});return P(r.value)}),s=computed(()=>k(!1)),m=computed(()=>k(!0)),w=ref(!1),g=ref(),v=ref(!1),d=P=>{o.setLayers(P),v.value=!P.some(S=>S.children.length)};core.addEvent("getLayers",d);const u=P=>{w.value=!1,P?n.openElement("layerPropertyDialog"):o.setSelectedLayer(null)},y=()=>{w.value=!0},x=async P=>{if(g.value.setShow(!1),P==="show"||P==="hide"){const S=[],E=(M,T)=>{M.forEach(D=>{D.isLocked||(D.visible=T,S.push({node:D.node,visible:T,ocg:D.ocg})),Array.isArray(D.children)&&D.children.length&&E(D.children,T)})};E(r.value,P==="show"?1:0),S.length&&core.setLayers(S)}if(P==="restore"){const S=[],E=M=>{M.forEach(T=>{T.visible!==T.defaultVisible&&(T.visible=T.defaultVisible,S.push({node:T.node,visible:T.defaultVisible,ocg:T.ocg})),Array.isArray(T.children)&&T.children.length&&E(T.children)})};E(r.value),S.length&&core.setLayers(S)}P==="export"&&(n.setCommonLoading(!0),await core.exportLayers(null,!0),n.setCommonLoading(!1))},k=P=>r.value.some(S=>(P?S.visible:!S.visible)?!0:Array.isArray(S.children)&&S.children.length?k(S.children):!1);return(P,S)=>{const E=__unplugin_components_0$c,M=_sfc_main$1p,T=__unplugin_components_2$f,D=_sfc_main$4f,N=_sfc_main$1u;return openBlock(),createElementBlock(Fragment,null,[createBaseVNode("div",_hoisted_1$15,[createBaseVNode("div",_hoisted_2$Z,[createTextVNode(toDisplayString(P.$t("panels.left.layers.title"))+" ",1),r.value.length?(openBlock(),createBlock(unref(NPopover),{key:0,placement:"bottom-start",trigger:"click","show-arrow":!1,to:"#outerContainer",raw:!0,class:"no-margin-top layer-title-popover",ref_key:"layersMenuPopover",ref:g},{trigger:withCtx(()=>[createVNode(E)]),default:withCtx(()=>[createBaseVNode("div",_hoisted_3$R,[createBaseVNode("div",{class:normalizeClass(["drop-item",{disabled:!s.value}]),onClick:S[0]||(S[0]=F=>x("show"))},toDisplayString(P.$t("panels.left.layers.showAll")),3),createBaseVNode("div",{class:normalizeClass(["drop-item",{disabled:!m.value}]),onClick:S[1]||(S[1]=F=>x("hide"))},toDisplayString(P.$t("panels.left.layers.hideAll")),3),createBaseVNode("div",{class:"drop-item",onClick:S[2]||(S[2]=F=>x("restore"))},toDisplayString(P.$t("panels.left.layers.restoreSettings")),1),createBaseVNode("div",{class:normalizeClass(["drop-item",{disabled:!f.value}]),onClick:S[3]||(S[3]=F=>x("export"))},toDisplayString(P.$t("panels.left.layers.exportLayers")),3)])]),_:1},512)):createCommentVNode("",!0)]),r.value.length?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["layers",{single:v.value}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,F=>(openBlock(),createBlock(M,{layer:F,level:0,onShowTipDialog:y},null,8,["layer"]))),256))],2)):(openBlock(),createElementBlock("div",_hoisted_4$a,toDisplayString(P.$t("panels.left.layers.empty")),1))]),w.value?(openBlock(),createElementBlock("div",_hoisted_5$5,[createVNode(D,{show:w.value,close:!1},{footer:withCtx(()=>[createBaseVNode("div",{class:"rect-button white",onClick:S[4]||(S[4]=F=>u())},toDisplayString(P.$t("common.actions.ok")),1),createBaseVNode("div",{class:"rect-button blue",onClick:S[5]||(S[5]=F=>u(!0))},toDisplayString(P.$t("layer.properties.title")),1)]),default:withCtx(()=>[createVNode(T),createBaseVNode("p",null,toDisplayString(P.$t("layer.lockedWarning")),1)]),_:1},8,["show"])])):createCommentVNode("",!0),createVNode(N)],64)}}},Outlines_vue_vue_type_style_index_0_lang="",_hoisted_1$14={class:"outlines"},_hoisted_2$Y={class:"outline-item-title"},splitter="-",_sfc_main$1m={__name:"Outlines",props:{outline:{type:Object,required:!0}},setup(e,{emit:n}){const o=useDocumentStore(),r=useViewerStore(),{outline:f}=e,s=x=>{const k=x.title;return`${m(x)}${splitter}${k}`},m=x=>w(x).reverse().join(splitter),w=x=>{const k=[];let P=x;for(;P;)k.push(P.index),P=P.parent;return k},g=computed(()=>s(f)),v=ref(!1),d=computed(()=>o.getActiveOutlineId===g.value),u=()=>{o.setActiveOutlineId(g.value),core.pageNumberChanged({value:f.pageNumber}),isMobile&&r.closeElement("leftPanel")},y=x=>{x.stopPropagation(),v.value=!v.value};return(x,k)=>{const P=__unplugin_components_0$d,S=resolveComponent("Outlines",!0);return openBlock(),createElementBlock("div",_hoisted_1$14,[createBaseVNode("div",{class:normalizeClass(["outline-item",d.value&&"selected"]),onClick:u},[createBaseVNode("div",{class:normalizeClass(["outline-item-toggle",v.value&&"active"]),style:normalizeStyle({marginLeft:12*e.outline.level+"px"})},[e.outline.children.length?(openBlock(),createBlock(P,{key:0,onClick:y})):createCommentVNode("",!0)],6),createBaseVNode("div",_hoisted_2$Y,toDisplayString(e.outline.title),1)],2),v.value?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(e.outline.children,E=>(openBlock(),createBlock(S,{outline:E},null,8,["outline"]))),256)):createCommentVNode("",!0)])}}},OutlinesPanel_vue_vue_type_style_index_0_lang="",_hoisted_1$13={class:"outline"},_hoisted_2$X={class:"outline-title"},_hoisted_3$Q={key:0,class:"outlines-container"},_hoisted_4$9={key:1,class:"no-outlines"},_sfc_main$1l={__name:"OutlinesPanel",setup(e){const n=useDocumentStore(),o=computed(()=>n.getOutlines);return(r,f)=>{const s=_sfc_main$1m;return openBlock(),createElementBlock("div",_hoisted_1$13,[createBaseVNode("div",_hoisted_2$X,toDisplayString(r.$t("panels.left.outlines.title")),1),o.value.length?(openBlock(),createElementBlock("div",_hoisted_3$Q,[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.value,m=>(openBlock(),createBlock(s,{outline:m},null,8,["outline"]))),256))])):(openBlock(),createElementBlock("div",_hoisted_4$9,toDisplayString(r.$t("panels.left.outlines.empty")),1))])}}},_sfc_main$1k={},_hoisted_1$12={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$W=createBaseVNode("path",{d:"M6.36661 7L3.19995 10.1667L6.36661 13.3333",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),_hoisted_3$P=createBaseVNode("path",{d:"M13.3333 3.2V7.63332C13.3333 8.3052 13.0664 8.94957 12.5913 9.42466C12.1162 9.89975 11.4718 10.1667 10.7999 10.1667H3.19995",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),_hoisted_4$8=[_hoisted_2$W,_hoisted_3$P];function _sfc_render$J(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$12,_hoisted_4$8)}const __unplugin_components_30=_export_sfc(_sfc_main$1k,[["render",_sfc_render$J]]),_sfc_main$1j={},_hoisted_1$11={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$V=createBaseVNode("path",{d:"M12.8 9.86666C12.8 10.1613 12.683 10.444 12.4746 10.6523C12.2662 10.8607 11.9836 10.9778 11.6889 10.9778H5.02227L2.80005 13.2V4.31111C2.80005 4.01642 2.91711 3.73381 3.12549 3.52543C3.33386 3.31706 3.61647 3.2 3.91116 3.2H11.6889C11.9836 3.2 12.2662 3.31706 12.4746 3.52543C12.683 3.73381 12.8 4.01642 12.8 4.31111V9.86666Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),_hoisted_3$O=[_hoisted_2$V];function _sfc_render$I(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$11,_hoisted_3$O)}const __unplugin_components_29=_export_sfc(_sfc_main$1j,[["render",_sfc_render$I]]),_sfc_main$1i={},_hoisted_1$10={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$U=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 4H15.5V15.5H4V4ZM2.5 2.5H4H15.5H17V4V15.5V17H15.5H4H2.5V15.5V4V2.5ZM7 9.25H6.25V10.75H7H13H13.75V9.25H13H7Z",fill:"currentColor"},null,-1),_hoisted_3$N=[_hoisted_2$U];function _sfc_render$H(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$10,_hoisted_3$N)}const __unplugin_components_28=_export_sfc(_sfc_main$1i,[["render",_sfc_render$H]]),_sfc_main$1h={},_hoisted_1$$={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$T=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 4H15.5V15.5H4V4ZM2.5 2.5H4H15.5H17V4V15.5V17H15.5H4H2.5V15.5V4V2.5ZM13.6441 8.40148L14.1745 7.87115L13.1138 6.81049L12.5835 7.34082L8.87115 11.0531L7.53033 9.71231L7 9.18198L5.93934 10.2426L6.46967 10.773L8.34082 12.6441L8.87115 13.1745L9.40148 12.6441L13.6441 8.40148Z",fill:"currentColor"},null,-1),_hoisted_3$M=[_hoisted_2$T];function _sfc_render$G(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$$,_hoisted_3$M)}const __unplugin_components_27=_export_sfc(_sfc_main$1h,[["render",_sfc_render$G]]),_sfc_main$1g={},_hoisted_1$_={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$S=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 4H15.5V15.5H4V4ZM2.5 2.5H4H15.5H17V4V15.5V17H15.5H4H2.5V15.5V4V2.5ZM7.06066 6L7.59099 6.53033L9.56066 8.5L11.5303 6.53033L12.0607 6L13.1213 7.06066L12.591 7.59099L10.6213 9.56066L12.591 11.5303L13.1213 12.0607L12.0607 13.1213L11.5303 12.591L9.56066 10.6213L7.59099 12.591L7.06066 13.1213L6 12.0607L6.53033 11.5303L8.5 9.56066L6.53033 7.59099L6 7.06066L7.06066 6Z",fill:"currentColor"},null,-1),_hoisted_3$L=[_hoisted_2$S];function _sfc_render$F(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$_,_hoisted_3$L)}const __unplugin_components_26=_export_sfc(_sfc_main$1g,[["render",_sfc_render$F]]),_sfc_main$1f={},_hoisted_1$Z={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$R=createBaseVNode("path",{d:"M13.5224 10.8835L10.6558 17.3333C10.0856 17.3333 9.53871 17.1068 9.13551 16.7036C8.73232 16.3004 8.5058 15.7536 8.5058 15.1834V12.3168H4.44954C4.24178 12.3191 4.03598 12.2763 3.84642 12.1912C3.65686 12.1061 3.48807 11.9808 3.35173 11.8241C3.21539 11.6673 3.11477 11.4827 3.05684 11.2832C2.99891 11.0836 2.98505 10.8739 3.01623 10.6685L4.00521 4.21857C4.05704 3.87679 4.23065 3.56526 4.49404 3.34138C4.75743 3.1175 5.09286 2.99635 5.43852 3.00026H13.5224M13.5224 10.8835V3.00026M13.5224 10.8835H15.4359C15.8415 10.8906 16.2356 10.7486 16.5434 10.4844C16.8512 10.2202 17.0513 9.85215 17.1057 9.45015V4.43357C17.0513 4.03157 16.8512 3.66352 16.5434 3.39931C16.2356 3.13509 15.8415 2.99309 15.4359 3.00026H13.5224",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),_hoisted_3$K=[_hoisted_2$R];function _sfc_render$E(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$Z,_hoisted_3$K)}const __unplugin_components_25=_export_sfc(_sfc_main$1f,[["render",_sfc_render$E]]),_sfc_main$1e={},_hoisted_1$Y={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$Q=createBaseVNode("path",{d:"M6.58333 8.44989L9.44994 1.99999C10.0202 1.99999 10.567 2.22651 10.9702 2.6297C11.3734 3.0329 11.5999 3.57975 11.5999 4.14996V7.01658H15.6562C15.8639 7.01422 16.0697 7.05707 16.2593 7.14215C16.4489 7.22722 16.6176 7.3525 16.754 7.50929C16.8903 7.66608 16.9909 7.85063 17.0489 8.05017C17.1068 8.24971 17.1207 8.45946 17.0895 8.66488L16.1005 15.1148C16.0487 15.4565 15.8751 15.7681 15.6117 15.992C15.3483 16.2158 15.0129 16.337 14.6672 16.3331H6.58333M6.58333 8.44989V16.3331M6.58333 8.44989H4.66986C4.26426 8.44271 3.87015 8.58471 3.56233 8.84893C3.25452 9.11315 3.05443 9.48119 3.00005 9.88319V14.8998C3.05443 15.3018 3.25452 15.6698 3.56233 15.934C3.87015 16.1983 4.26426 16.3403 4.66986 16.3331H6.58333",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),_hoisted_3$J=[_hoisted_2$Q];function _sfc_render$D(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$Y,_hoisted_3$J)}const __unplugin_components_24=_export_sfc(_sfc_main$1e,[["render",_sfc_render$D]]),_sfc_main$1d={},_hoisted_1$X={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$P=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.5 10C6.5 10.8284 5.82843 11.5 5 11.5C4.17157 11.5 3.5 10.8284 3.5 10C3.5 9.17157 4.17157 8.5 5 8.5C5.82843 8.5 6.5 9.17157 6.5 10ZM11.5 10C11.5 10.8284 10.8284 11.5 10 11.5C9.17157 11.5 8.5 10.8284 8.5 10C8.5 9.17157 9.17157 8.5 10 8.5C10.8284 8.5 11.5 9.17157 11.5 10ZM15 11.5C15.8284 11.5 16.5 10.8284 16.5 10C16.5 9.17157 15.8284 8.5 15 8.5C14.1716 8.5 13.5 9.17157 13.5 10C13.5 10.8284 14.1716 11.5 15 11.5Z",fill:"currentColor"},null,-1),_hoisted_3$I=[_hoisted_2$P];function _sfc_render$C(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$X,_hoisted_3$I)}const __unplugin_components_22=_export_sfc(_sfc_main$1d,[["render",_sfc_render$C]]),_sfc_main$1c={},_hoisted_1$W={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$O=createBaseVNode("path",{d:"M10.0282 2L18.2999 10.2717L1.75648 10.6988L10.0282 18.9706",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"},null,-1),_hoisted_3$H=[_hoisted_2$O];function _sfc_render$B(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$W,_hoisted_3$H)}const __unplugin_components_11=_export_sfc(_sfc_main$1c,[["render",_sfc_render$B]]),_sfc_main$1b={},_hoisted_1$V={width:"21",height:"20",viewBox:"5 5 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$N=createBaseVNode("path",{d:"M8.20577 10.933L15.25 6.86603L22.2942 10.933V19.067L15.25 23.134L8.20577 19.067V10.933Z",stroke:"currentColor","stroke-width":"1.5"},null,-1),_hoisted_3$G=[_hoisted_2$N];function _sfc_render$A(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$V,_hoisted_3$G)}const __unplugin_components_10$2=_export_sfc(_sfc_main$1b,[["render",_sfc_render$A]]),_sfc_main$1a={},_hoisted_1$U={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$M=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18 3H2V15H5V18L10 15H18V3ZM5 6H11V7.5H5V6ZM5 9.5H15V11H5V9.5Z",fill:"currentColor"},null,-1),_hoisted_3$F=[_hoisted_2$M];function _sfc_render$z(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$U,_hoisted_3$F)}const __unplugin_components_0$b=_export_sfc(_sfc_main$1a,[["render",_sfc_render$z]]),_sfc_main$19={},_hoisted_1$T={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$L=createBaseVNode("path",{d:"M3.25 18C3.25 9.71573 9.96573 3 18.25 3",stroke:"currentColor","stroke-width":"1.5"},null,-1),_hoisted_3$E=[_hoisted_2$L];function _sfc_render$y(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$T,_hoisted_3$E)}const __unplugin_components_8$2=_export_sfc(_sfc_main$19,[["render",_sfc_render$y]]),AnnotationContent_vue_vue_type_style_index_0_lang="",_hoisted_1$S={class:"page-title"},_hoisted_2$K=["id","onClick"],_hoisted_3$D={class:"item-header"},_hoisted_4$7={class:"info"},_hoisted_5$4={class:"name"},_hoisted_6$3={class:"date"},_hoisted_7$3={key:0,class:"content"},_hoisted_8$2=["onClick"],_hoisted_9$2={key:0,class:"item-reply"},_hoisted_10$2={key:0},_hoisted_11$1=["placeholder"],_hoisted_12$1={class:"buttons"},_hoisted_13$1=["onClick"],_hoisted_14$1={class:"replies"},_hoisted_15$1={key:0,class:"info"},_hoisted_16$1={class:"info-header"},_hoisted_17$1={class:"name"},_hoisted_18$1={class:"date"},_hoisted_19$1={key:0,class:"content"},_hoisted_20$1={class:"buttons"},_hoisted_21$1=["onClick"],_hoisted_22$1={key:1,class:"content"},_hoisted_23$1={class:"drop-down"},_hoisted_24$1=["onClick"],_hoisted_25$1=["onClick"],_hoisted_26$1={class:"item-footer"},_hoisted_27$1={class:"drop-down"},_hoisted_28$1=["onClick"],_hoisted_29$1=["onClick"],_hoisted_30$1=["onClick"],_hoisted_31$1=["onClick"],_hoisted_32=["onClick"],_hoisted_33={class:"re"},_hoisted_34={key:0},_hoisted_35={key:1,class:"no-annotations"},_sfc_main$18={__name:"AnnotationContent",setup(e){const n=useDocumentStore(),o=useViewerStore();let r=computed(()=>n.getAllAnnotations);const f=computed(()=>o.getActiveElementTab("leftPanel")),s=computed(()=>o.isElementOpen("leftPanel")),m=computed(()=>n.getAnnotator),w=computed(()=>o.getToolMode),g=computed(()=>n.getSelectedAnnotation),v=computed(()=>o.isElementOpen("reply")),d=ref(null),u=ref(null);let y=null;const x=ref(!1),k=ref(""),P=ref(!1),S=ref(""),E=ref(""),M=ref(!1),T=ref(0),D=ref(0),N=ref(!1);watch([f,s],(W,Q)=>{Q[0]==="ANNOTATION"&&Q[1]&&O()});const F=W=>{var Q;core.jumpToAnnotation(W),w.value!=="editor"&&core.selectAnnotation(W),((Q=d.value)==null?void 0:Q.name)!==W.name&&(k.value="",d.value=W,x.value=!1),isMobile&&o.closeElement("leftPanel")},O=()=>{x.value=!1,k.value=""},I=async(W,Q)=>{if(W=toRaw(W),W.getStatus()){let oe=W.getReplies().filter(Ce=>Ce.isReply&&Ce.stateModel==="Review");oe&&oe.length&&(oe.sort((Ce,Se)=>Se.dateCreated-Ce.dateCreated),oe[0].setState(Q))}else await core.getAnnotationManager().createAnnotationReply(W,{state:Q});E.value=""},X=W=>{E.value?E.value="":E.value=W.name},ne=(W,Q)=>{if(M.value){U();return}let oe=W.target;for(;oe.parentElement&&!oe.classList.contains("more");)oe=oe.parentElement;if(oe.classList.contains("more")){const Ce=oe.getBoundingClientRect();T.value=Ce.left,D.value=Ce.bottom,M.value=!0,u.value=Q,y=Q}},ye=async W=>{W=toRaw(W);const Q=W.getMarked();if(Q){let oe=W.getReplies().filter(Ce=>Ce.isReply&&Ce.stateModel==="Marked");if(oe&&oe.length){oe.sort((Se,fe)=>fe.dateCreated-Se.dateCreated);const Ce=Q==="MARKED"?"UNMARKED":"MARKED";oe[0].setState(Ce)}}else await core.getAnnotationManager().createAnnotationReply(W,{state:"MARKED"});N.value=!N.value},J=async W=>{if(k.value==="")return;W=toRaw(W),await core.getAnnotationManager().createAnnotationReply(W,{author:m.value,title:m.value,contents:k.value,date:new Date}),k.value=""},te=W=>{x.value=!1,M.value=!1,P.value&&S.value!==u.value.contents?(W.setContents(S.value),P.value=!1):(P.value=!0,S.value=u.value.contents,nextTick(()=>{const Q=document.querySelector(".replyEditInput");Q.focus(),Q.setSelectionRange(Q.value.length,Q.value.length)}))},q=()=>{core.getAnnotationManager().deleteAnnotation(y),U()},re=W=>{document.querySelector(".button.more.active").contains(W.target)||U()},U=()=>{M.value=!1,P.value||(u.value=null,y=null)},H=()=>{P.value=!1,S.value="",u.value=null,y=null},Z=W=>{document.querySelector(".button.state.active").contains(W.target)||(E.value="")},Y=(W,Q)=>{var oe;x.value=!0,((oe=d.value)==null?void 0:oe.name)!==W.name&&(d.value=W,k.value=""),!Q&&nextTick(()=>{var Ce;(Ce=document.querySelector(".annotReplyInput"))==null||Ce.focus()})};return watch(()=>v.value,W=>{W&&(d.value=g.value,x.value=!0)}),watch(()=>g.value,W=>{}),onMounted(()=>{g.value&&v.value&&(d.value=g.value,x.value=!0)}),(W,Q)=>{const oe=__unplugin_components_1$6,Ce=__unplugin_components_5$5,Se=__unplugin_components_4$9,fe=__unplugin_components_3$9,Pe=__unplugin_components_2$d,Ae=__unplugin_components_4$8,Te=__unplugin_components_3$7,Ee=__unplugin_components_8$2,Be=__unplugin_components_6$5,Ve=__unplugin_components_0$j,_e=__unplugin_components_13$2,ve=__unplugin_components_12,be=__unplugin_components_9$5,ke=__unplugin_components_5$4,Me=__unplugin_components_7$4,Le=__unplugin_components_14$1,Oe=__unplugin_components_0$b,ze=__unplugin_components_15,We=__unplugin_components_7$2,Ge=__unplugin_components_6$4,Xe=__unplugin_components_10$2,qe=__unplugin_components_11,Ke=__unplugin_components_22,Qe=_sfc_main$4m,at=__unplugin_components_24,ut=__unplugin_components_25,vt=__unplugin_components_26,_t=__unplugin_components_27,wt=__unplugin_components_28,bt=__unplugin_components_29,Rt=__unplugin_components_30;return openBlock(),createElementBlock("div",{class:normalizeClass(["annotation-view",{pb:!["view","sign","document"].includes(w.value)}])},[unref(r).annotationsCount>0?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(unref(r).annotations,(Fe,$e)=>(openBlock(),createElementBlock("div",null,[Fe.pageAnnotationsCount>0?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode("div",_hoisted_1$S,[createBaseVNode("span",null,toDisplayString(W.$t("panels.left.search.pageIndicator",{page:$e*1+1})),1),createBaseVNode("span",null,toDisplayString(Fe.pageAnnotationsCount),1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(Fe.annotations,(Ie,Re)=>{var He,je,et;return openBlock(),createElementBlock(Fragment,null,[!["link","reply"].includes(Ie.type)&&!Ie.isDelete&&!Ie.isHidden?(openBlock(),createElementBlock("div",{class:normalizeClass(["annotation-item",{selected:d.value&&d.value.name===Ie.name,"selected-annotation":g.value&&g.value.name===Ie.name}]),id:Ie.name?`annotationList-${Ie.name}`:null,onClick:tt=>F(Ie),key:Re},[createBaseVNode("div",_hoisted_3$D,[Ie.type==="highlight"?(openBlock(),createBlock(oe,{key:0})):Ie.type==="squiggly"?(openBlock(),createBlock(Ce,{key:1})):Ie.type==="strikeout"?(openBlock(),createBlock(Se,{key:2})):Ie.type==="underline"?(openBlock(),createBlock(fe,{key:3})):Ie.type==="polyline"&&Ie.measure?(openBlock(),createBlock(Pe,{key:4})):Ie.type==="ink"&&Ie.measure&&Ie.arcPoints?(openBlock(),createBlock(Ae,{key:5})):Ie.type==="ink"&&Ie.measure?(openBlock(),createBlock(Te,{key:6})):Ie.type==="arc"?(openBlock(),createBlock(Ee,{key:7})):Ie.type==="ink"?(openBlock(),createBlock(Be,{key:8})):Ie.type==="line"&&Ie.measure?(openBlock(),createBlock(Ve,{key:9})):Ie.type==="line"&&((Ie.tail==="none"||Ie.tail==="unknown")&&(Ie.head==="none"||Ie.head==="unknown")||!Ie.tail&&!Ie.head)?(openBlock(),createBlock(_e,{key:10})):Ie.type==="line"&&(Ie.tail==="openarrow"||Ie.head==="openarrow"||Ie.arrow)?(openBlock(),createBlock(ve,{key:11})):Ie.type==="square"||Ie.type==="rectangle"&&!Ie.measure?(openBlock(),createBlock(be,{key:12})):Ie.type==="circle"&&Ie.measure?(openBlock(),createBlock(ke,{key:13})):Ie.type==="circle"?(openBlock(),createBlock(Me,{key:14})):Ie.type==="freetext"?(openBlock(),createBlock(Le,{key:15})):Ie.type==="text"?(openBlock(),createBlock(Oe,{key:16})):Ie.type==="image"||Ie.type==="stamp"?(openBlock(),createBlock(ze,{key:17})):Ie.type==="polygon"&&Ie.measure?(openBlock(),createBlock(We,{key:18})):Ie.type==="rectangle"&&Ie.measure?(openBlock(),createBlock(Ge,{key:19})):Ie.type==="polygon"?(openBlock(),createBlock(Xe,{key:20})):Ie.type==="polyline"?(openBlock(),createBlock(qe,{key:21})):createCommentVNode("",!0),createBaseVNode("div",_hoisted_4$7,[createBaseVNode("p",_hoisted_5$4,toDisplayString(Ie.author||Ie.title||"Guest"),1),createBaseVNode("p",_hoisted_6$3,toDisplayString(unref(dayjs)(Ie.dateCreated).format("DD/MM/YYYY HH:mm:ss")),1),Ie.contents?(openBlock(),createElementBlock("div",_hoisted_7$3,toDisplayString(Ie.contents),1)):createCommentVNode("",!0)]),createVNode(unref(NPopover),{trigger:"hover",placement:"bottom",to:"#outerContainer",class:"mark-popover"},{trigger:withCtx(()=>[(openBlock(),createElementBlock("div",{class:normalizeClass(["mark-box",{marked:Ie.getMarked()==="MARKED"}]),onClick:withModifiers(tt=>ye(Ie),["stop"]),key:N.value},null,10,_hoisted_8$2))]),default:withCtx(()=>[createBaseVNode("span",null,toDisplayString(Ie.getMarked()==="MARKED"?W.$t("panels.left.reply.marked"):W.$t("panels.left.reply.unmarked")),1)]),_:2},1024)]),d.value&&d.value.name===Ie.name&&(x.value||((He=Ie.replies)==null?void 0:He.length))?(openBlock(),createElementBlock("div",_hoisted_9$2,[x.value?(openBlock(),createElementBlock("div",_hoisted_10$2,[withDirectives(createBaseVNode("textarea",{onClick:Q[0]||(Q[0]=withModifiers(()=>{},["stop"])),placeholder:W.$t("panels.left.reply.replyPlaceholder"),"onUpdate:modelValue":Q[1]||(Q[1]=tt=>k.value=tt),class:"annotReplyInput"},null,8,_hoisted_11$1),[[vModelText,k.value]]),createBaseVNode("div",_hoisted_12$1,[createBaseVNode("span",{onClick:withModifiers(O,["stop"])},toDisplayString(W.$t("common.actions.cancel")),1),createBaseVNode("button",{class:normalizeClass({active:k.value,disabled:!k.value}),onClick:tt=>J(Ie)},toDisplayString(W.$t("common.actions.reply")),11,_hoisted_13$1)])])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_14$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(Ie.replies,(tt,Ye)=>{var Ze,nt;return openBlock(),createElementBlock(Fragment,{key:Ye},[tt.contents?(openBlock(),createElementBlock("div",_hoisted_15$1,[createBaseVNode("div",_hoisted_16$1,[createBaseVNode("div",null,[createBaseVNode("p",_hoisted_17$1,toDisplayString(tt.author||tt.title||m.value),1),createBaseVNode("p",_hoisted_18$1,toDisplayString(unref(dayjs)(tt.dateCreated).format("DD/MM/YYYY HH:mm:ss")),1)]),createVNode(Qe,{class:normalizeClass(["more",{active:M.value&&tt.name===((Ze=u.value)==null?void 0:Ze.name)}]),onClick:ot=>ne(ot,tt)},{default:withCtx(()=>[createVNode(Ke)]),_:2},1032,["class","onClick"])]),P.value&&tt.name===((nt=u.value)==null?void 0:nt.name)?(openBlock(),createElementBlock("div",_hoisted_19$1,[withDirectives(createBaseVNode("textarea",{"onUpdate:modelValue":Q[2]||(Q[2]=ot=>S.value=ot),class:"replyEditInput"},null,512),[[vModelText,S.value]]),createBaseVNode("div",_hoisted_20$1,[createBaseVNode("span",{onClick:H},toDisplayString(W.$t("common.actions.cancel")),1),createBaseVNode("button",{class:normalizeClass([S.value&&S.value!==tt.contents?"active":"disabled"]),onClick:ot=>te(tt)},toDisplayString(W.$t("common.actions.confirm")),11,_hoisted_21$1)])])):(openBlock(),createElementBlock("div",_hoisted_22$1,toDisplayString(tt.contents),1))])):createCommentVNode("",!0)],64)}),128))]),createVNode(unref(NPopover),{placement:"bottom-start",trigger:"manual","show-arrow":!1,to:"#outerContainer",raw:!0,"z-index":96,class:"reply-popover",show:M.value,x:T.value,y:D.value,onClickoutside:re},{default:withCtx(()=>[createBaseVNode("div",_hoisted_23$1,[createBaseVNode("div",{class:"drop-item",onClick:tt=>te(Ie)},toDisplayString(W.$t("common.actions.edit")),9,_hoisted_24$1),createBaseVNode("div",{class:"drop-item",onClick:tt=>q(Ie)},toDisplayString(W.$t("common.actions.delete")),9,_hoisted_25$1)])]),_:2},1032,["show","x","y"])])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_26$1,[createVNode(unref(NPopover),{placement:"bottom",trigger:"click","show-arrow":!1,to:"#outerContainer",raw:!0,"z-index":96,class:"state-popover",show:E.value===Ie.name,onClickoutside:Z},{trigger:withCtx(()=>[createVNode(Qe,{class:normalizeClass(["state",{active:E.value===Ie.name}]),onClick:withModifiers(tt=>X(Ie),["stop"])},{default:withCtx(()=>[Ie.getStatus()==="ACCEPTED"?(openBlock(),createBlock(at,{key:0})):Ie.getStatus()==="REJECTED"?(openBlock(),createBlock(ut,{key:1})):Ie.getStatus()==="CANCELLED"?(openBlock(),createBlock(vt,{key:2})):Ie.getStatus()==="COMPLETED"?(openBlock(),createBlock(_t,{key:3})):(openBlock(),createBlock(wt,{key:4}))]),_:2},1032,["class","onClick"])]),default:withCtx(()=>[createBaseVNode("div",_hoisted_27$1,[createBaseVNode("div",{class:"drop-item",onClick:tt=>I(Ie,"ACCEPTED")},[createVNode(at),createTextVNode(toDisplayString(W.$t("panels.left.reply.accepted")),1)],8,_hoisted_28$1),createBaseVNode("div",{class:"drop-item",onClick:tt=>I(Ie,"REJECTED")},[createVNode(ut),createTextVNode(toDisplayString(W.$t("panels.left.reply.rejected")),1)],8,_hoisted_29$1),createBaseVNode("div",{class:"drop-item",onClick:tt=>I(Ie,"CANCELLED")},[createVNode(vt),createTextVNode(toDisplayString(W.$t("panels.left.reply.cancelled")),1)],8,_hoisted_30$1),createBaseVNode("div",{class:"drop-item",onClick:tt=>I(Ie,"COMPLETED")},[createVNode(_t),createTextVNode(toDisplayString(W.$t("panels.left.reply.completed")),1)],8,_hoisted_31$1),createBaseVNode("div",{class:"drop-item",onClick:tt=>I(Ie,"NONE")},[createVNode(wt),createTextVNode(toDisplayString(W.$t("panels.left.reply.none")),1)],8,_hoisted_32)])]),_:2},1032,["show"]),createBaseVNode("div",_hoisted_33,[createVNode(bt),(et=(je=Ie==null?void 0:Ie.replies)==null?void 0:je.filter(tt=>tt.contents))!=null&&et.length?(openBlock(),createElementBlock("span",_hoisted_34,toDisplayString(Ie.replies.filter(tt=>tt.contents).length),1)):createCommentVNode("",!0),createVNode(Rt,{class:"return",onClick:tt=>Y(Ie)},null,8,["onClick"])])])],10,_hoisted_2$K)):createCommentVNode("",!0)],64)}),256))],64)):createCommentVNode("",!0)]))),256)):(openBlock(),createElementBlock("div",_hoisted_35,toDisplayString(W.$t("panels.left.annotations.empty")),1))],2)}}},_sfc_main$17={},_hoisted_1$R={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$J=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.56181 13.8733C9.85977 14.1611 10.3429 14.1611 10.6408 13.8733L14.7421 9.91282C15.0401 9.62509 15.0401 9.15858 14.7421 8.87085C14.4442 8.58311 13.9611 8.58311 13.6631 8.87085L10.75 11.6839L10.75 4C10.75 3.58579 10.4142 3.25 10 3.25C9.58581 3.25 9.25002 3.58579 9.25002 4L9.25003 11.4883L6.53951 8.87085C6.24155 8.58311 5.75846 8.58311 5.46049 8.87085C5.16253 9.15858 5.16253 9.62509 5.46049 9.91282L9.56181 13.8733ZM4 15.7543C3.58579 15.7543 3.25 16.0901 3.25 16.5043C3.25 16.9185 3.58579 17.2543 4 17.2543H16C16.4142 17.2543 16.75 16.9185 16.75 16.5043C16.75 16.0901 16.4142 15.7543 16 15.7543H4Z",fill:"currentColor"},null,-1),_hoisted_3$C=[_hoisted_2$J];function _sfc_render$x(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$R,_hoisted_3$C)}const __unplugin_components_2$8=_export_sfc(_sfc_main$17,[["render",_sfc_render$x]]),_sfc_main$16={},_hoisted_1$Q={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$I=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.6374 2.96451C10.3413 2.67483 9.8613 2.67483 9.56523 2.96451L5.46391 6.97719C5.16784 7.26687 5.16784 7.73652 5.46391 8.0262C5.75999 8.31588 6.24002 8.31588 6.53609 8.0262L9.25012 5.37083L9.25012 12.8271C9.25012 13.2413 9.58591 13.5771 10.0001 13.5771C10.4143 13.5771 10.7501 13.2413 10.7501 12.8271L10.7501 5.17281L13.6665 8.0262C13.9626 8.31588 14.4426 8.31588 14.7387 8.0262C15.0348 7.73652 15.0348 7.26687 14.7387 6.97719L10.6374 2.96451ZM4 15.7516C3.58579 15.7516 3.25 16.0873 3.25 16.5016C3.25 16.9158 3.58579 17.2516 4 17.2516H16C16.4142 17.2516 16.75 16.9158 16.75 16.5016C16.75 16.0873 16.4142 15.7516 16 15.7516H4Z",fill:"currentColor"},null,-1),_hoisted_3$B=[_hoisted_2$I];function _sfc_render$w(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$Q,_hoisted_3$B)}const __unplugin_components_0$a=_export_sfc(_sfc_main$16,[["render",_sfc_render$w]]),AnnotationHeader_vue_vue_type_style_index_0_lang="",_hoisted_1$P={class:"annotation-header"},_hoisted_2$H={class:"annotation-title"},_hoisted_3$A={class:"annotation-header-buttons"},_sfc_main$15={__name:"AnnotationHeader",setup(e){const n=useDocumentStore(),o=useViewerStore(),r=computed(()=>o.isAnnotationExport),f=computed(()=>o.isAnnotationImport),{removeAllAnnotations:s,importAnnotations:m,exportXfdf:w}=core,g=()=>{uploadFile(isIOS$1?"":".xfdf").then(k=>{k.name.split(".").pop().toLowerCase()==="xfdf"&&m(k)})},v=computed(()=>n.getTotalPages),d=computed(()=>n.getAllAnnotations);computed(()=>n.getOptionUrl);const u=computed(()=>n.info);u.value&&u.value.token&&atob(u.value.token).replace(".pdf",".xfdf");const y=async()=>{try{o.setDownloading(!0);const x=await w(!0);o.setDownloading(!1),x||o.setDownloadError("Downloaded")}catch(x){console.log(x),o.setDownloading(!1),o.setDownloadError("Downloaded")}};return(x,k)=>{const P=__unplugin_components_0$a,S=_sfc_main$4m,E=__unplugin_components_2$8;return openBlock(),createElementBlock("div",_hoisted_1$P,[createBaseVNode("h2",_hoisted_2$H,toDisplayString(x.$t("panels.left.annotations.title")),1),createBaseVNode("div",_hoisted_3$A,[r.value?(openBlock(),createBlock(S,{key:0,className:"button-icon",img:"icon-import",onClick:y,title:x.$t("panels.left.annotations.export"),disabled:!d.value||d.value.annotationsCount===0},{default:withCtx(()=>[createVNode(P)]),_:1},8,["title","disabled"])):createCommentVNode("",!0),f.value?(openBlock(),createBlock(S,{key:1,className:"button-icon",img:"icon-export",onClick:g,title:x.$t("panels.left.annotations.import"),disabled:v.value<=0},{default:withCtx(()=>[createVNode(E)]),_:1},8,["title","disabled"])):createCommentVNode("",!0)])])}}},LeftPanel_vue_vue_type_style_index_0_lang="",_hoisted_1$O={class:"sidebar-content"},_hoisted_2$G=createBaseVNode("div",{class:"thumbnail-view"},null,-1),_sfc_main$14={__name:"LeftPanel",props:["isHeaderDisabled"],setup(e){const n=useViewerStore(),o=useDocumentStore(),r=computed(()=>n.getActiveElementTab("leftPanel")),f=computed(()=>n.isElementOpen("leftPanel")),s=computed(()=>o.getActiveTool);return watch(f,(m,w)=>{m&&s.value==="cropPage"&&o.setToolState("")}),(m,w)=>{const g=_sfc_main$15,v=_sfc_main$18,d=_sfc_main$1l,u=_sfc_main$1n,y=_sfc_main$1v,x=_sfc_main$1x,k=__unplugin_components_6$1;return openBlock(),createElementBlock("div",{class:normalizeClass(["left-panel",{closed:!f.value,mobile:unref(isMobileDevice)}]),id:"leftPanel",style:normalizeStyle({height:e.isHeaderDisabled?"100%":"calc(100% - 44px)"})},[createBaseVNode("div",_hoisted_1$O,[createBaseVNode("div",{class:normalizeClass(["thumbnail-container",{hidden:r.value!=="THUMBS"}])},[createBaseVNode("h2",null,toDisplayString(m.$t("panels.left.thumbnails")),1),_hoisted_2$G],2),r.value==="ANNOTATION"?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["annotation-container",{hidden:r.value!=="ANNOTATION"}])},[createVNode(g),createVNode(v)],2)):createCommentVNode("",!0),withDirectives(createVNode(d,null,null,512),[[vShow,r.value==="OUTLINE"]]),createBaseVNode("div",{class:normalizeClass(["layer-container",{hidden:r.value!=="LAYER"}])},[createVNode(u)],2),createBaseVNode("div",{class:normalizeClass(["compare-container",{hidden:r.value!=="COMPARISON"}])},[createVNode(y)],2),createBaseVNode("div",{class:normalizeClass(["signature-container",{hidden:r.value!=="SIGNATURE"}])},[createVNode(x)],2),createBaseVNode("div",{class:normalizeClass(["findbar-container",{hidden:r.value!=="SEARCH"}])},[createVNode(k)],2)])],6)}}},SecurityApplyBar_vue_vue_type_style_index_0_lang="",_hoisted_1$N={class:"security-apply-bar"},_hoisted_2$F={class:"buttons"},_sfc_main$13={__name:"SecurityApplyBar",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=ref(0),f=m=>{if(!r.value){o.setToolState(""),n.setActiveToolMode("view");return}n.setRedactionConfirmDialog(m)},s=m=>{r.value=m};return core.addEvent("redactAnnotationChanged",s),(m,w)=>(openBlock(),createElementBlock("div",_hoisted_1$N,[createBaseVNode("span",null,toDisplayString(m.$t("redaction.applyWarning")),1),createBaseVNode("div",_hoisted_2$F,[createBaseVNode("div",{class:"view-button",onClick:w[0]||(w[0]=g=>f(0))},toDisplayString(m.$t("common.actions.exit")),1),createBaseVNode("div",{class:normalizeClass(["view-button apply-btn",{disabled:!r.value}]),onClick:w[1]||(w[1]=g=>f(1))},toDisplayString(m.$t("common.actions.apply")),3)])]))}},SignatureVerifyBar_vue_vue_type_style_index_0_scoped_91ed1d2a_lang="",_hoisted_1$M={class:"signature-verify"},_hoisted_2$E={key:0},_hoisted_3$z={key:0},_hoisted_4$6={key:1},_hoisted_5$3={key:2},_sfc_main$12={__name:"SignatureVerifyBar",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=computed(()=>n.getSignatureVerify),f=computed(()=>o.getSignatures),s=()=>{n.openElement("leftPanel"),n.setActiveElementTab("leftPanel","SIGNATURE")};return(m,w)=>{const g=__unplugin_components_0$g,v=__unplugin_components_1$2,d=__unplugin_components_2$b;return openBlock(),createElementBlock("div",_hoisted_1$M,[r.value===1?(openBlock(),createElementBlock("div",_hoisted_2$E,[createVNode(g),createBaseVNode("span",null,toDisplayString(m.$t("signatures.details.validSignature")),1)])):f.value.length===1?(openBlock(),createElementBlock(Fragment,{key:1},[r.value===2?(openBlock(),createElementBlock("div",_hoisted_3$z,[createVNode(v),createBaseVNode("span",null,toDisplayString(m.$t("signatures.details.invalidSignature")),1)])):(openBlock(),createElementBlock("div",_hoisted_4$6,[createVNode(d),createBaseVNode("span",null,toDisplayString(m.$t("signatures.details.unknownSignature")),1)]))],64)):r.value===2||r.value===3?(openBlock(),createElementBlock("div",_hoisted_5$3,[createVNode(v),createBaseVNode("span",null,toDisplayString(m.$t("signatures.details.invalidSignatures")),1)])):createCommentVNode("",!0),createBaseVNode("div",{class:"view-button",onClick:s},toDisplayString(m.$t("signatures.details.viewAll")),1)])}}},__unplugin_components_2$7=_export_sfc(_sfc_main$12,[["__scopeId","data-v-91ed1d2a"]]),_sfc_main$11={},_hoisted_1$L={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$D=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.5663 0.846478C12.3457 0.625895 11.9792 0.658942 11.8017 0.915427L9.00221 4.95911C8.97541 4.99782 8.93581 5.02583 8.89039 5.03822L5.20212 6.04411C5.12329 6.06561 5.06548 6.13203 5.05485 6.21304C4.99741 6.65059 4.78835 8.10157 4.36452 9.61523C4.00509 10.8989 2.91361 13.3787 2.30714 14.7167C1.93791 14.5472 1.48666 14.6144 1.18254 14.9186C0.792017 15.3091 0.792017 15.9423 1.18254 16.3328C1.57307 16.7233 2.20623 16.7233 2.59676 16.3328C2.90731 16.0222 2.9709 15.5582 2.78754 15.1848C3.97427 14.6183 6.12247 13.6485 7.90006 13.1508C9.90855 12.5884 10.9209 12.4728 11.2798 12.4494C11.3716 12.4434 11.4526 12.3813 11.4768 12.2925L12.4771 8.6249C12.4895 8.57948 12.5175 8.53988 12.5562 8.51308L16.5999 5.71361C16.8563 5.53604 16.8894 5.16954 16.6688 4.94896L12.5663 0.846478ZM8.34417 7.93803C8.29817 7.89203 8.22119 7.90151 8.18771 7.95729L6.33809 11.04C6.28453 11.1293 6.38602 11.2308 6.47529 11.1772L9.558 9.32758C9.61378 9.2941 9.62326 9.21712 9.57726 9.17112L8.34417 7.93803ZM12.3814 12.3738C12.3814 12.1505 12.5293 11.9543 12.744 11.893L15.8033 11.0189C15.8931 10.9933 15.9883 10.9933 16.078 11.0189L19.1374 11.893C19.352 11.9543 19.5 12.1505 19.5 12.3738V15.913C19.5 16.0117 19.4713 16.1076 19.4146 16.1884C19.0137 16.7602 17.2809 19.1153 15.9407 19.1153C14.6004 19.1153 12.8677 16.7602 12.4667 16.1884C12.41 16.1076 12.3814 16.0117 12.3814 15.913V12.3738ZM14.9114 15.9254L14.9114 15.9255L15.6305 16.6446L17.9549 14.3201L17.2358 13.601L15.6305 15.2063L14.6993 14.2752L13.9802 14.9943L14.9114 15.9254Z",fill:"currentColor"},null,-1),_hoisted_3$y=[_hoisted_2$D];function _sfc_render$v(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$L,_hoisted_3$y)}const __unplugin_components_4$3=_export_sfc(_sfc_main$11,[["render",_sfc_render$v]]),_sfc_main$10={},_hoisted_1$K={width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$C=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.5623 7.9067L14.6557 3L11.5014 7.55623L7.64623 8.60766C7.64623 8.60766 7.44842 10.3155 6.94528 12.1125C6.58896 13.3851 5.50688 15.8434 4.90572 17.1698C4.5396 17.0014 4.09196 17.068 3.79034 17.3696C3.40322 17.7568 3.40322 18.3844 3.79034 18.7715C4.17746 19.1587 4.80511 19.1587 5.19223 18.7715C5.5 18.4638 5.56308 18.004 5.38149 17.6339C6.55777 17.0723 8.68764 16.1107 10.45 15.6172C13.034 14.8937 13.9547 14.9163 13.9547 14.9163L15.0061 11.061L19.5623 7.9067ZM10.7997 10.3601L12.2016 11.762L8.69685 13.8649L10.7997 10.3601ZM17.9547 17.5658C17.6177 16.9944 17.0028 16.7812 16.1476 16.8013C16.0495 16.8036 15.9455 16.8091 15.8353 16.8179L15.4861 16.854L15.0991 16.9101C15.0313 16.9211 14.962 16.933 14.891 16.9457L14.445 17.0323L13.9583 17.1398L13.4299 17.2684L12.8587 17.4186L12.2436 17.5906L11.2363 17.8906L10.5067 18.119L9.32254 18.5051L8.47165 18.7921L7.10044 19.2678L7.68591 21L8.57815 20.6888L9.82355 20.2659L10.5929 20.0127L11.3145 19.782L12.3087 19.4775L12.9138 19.3017L13.737 19.0778L14.2305 18.9546L14.6806 18.8519L15.088 18.7692L15.4535 18.7063L15.7779 18.6628C15.93 18.6459 16.0669 18.636 16.189 18.6332L16.3181 18.6327L16.2761 18.8388C16.2125 19.1636 16.1998 19.3368 16.2394 19.5948C16.324 20.1475 16.6955 20.5595 17.257 20.7155C17.7746 20.8593 18.5301 20.7995 19.6673 20.5229L20.2199 20.3798C20.4134 20.327 20.6166 20.2689 20.8298 20.2057L21.5002 20.0001L20.9702 18.2494L20.3733 18.4324L19.8368 18.5865L19.3603 18.7128L18.9431 18.8123C18.8784 18.8267 18.8163 18.8401 18.7565 18.8524L18.4273 18.9139C18.3273 18.9303 18.237 18.9427 18.1562 18.9514L18.0859 18.9576L18.118 18.7913C18.2062 18.2932 18.1885 17.9622 17.9547 17.5658Z",fill:"currentColor"},null,-1),_hoisted_3$x=[_hoisted_2$C];function _sfc_render$u(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$K,_hoisted_3$x)}const __unplugin_components_3$3=_export_sfc(_sfc_main$10,[["render",_sfc_render$u]]),_sfc_main$$={},_hoisted_1$J={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$B=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.5663 1.73124C12.3457 1.51066 11.9792 1.54371 11.8017 1.80019L9.00221 5.84387C8.97541 5.88258 8.93581 5.9106 8.89039 5.92298L5.20212 6.92888C5.12329 6.95038 5.06548 7.01679 5.05485 7.0978C4.99741 7.53536 4.78835 8.98634 4.36452 10.5C4.00509 11.7837 2.91361 14.2634 2.30714 15.6015C1.93791 15.4319 1.48666 15.4992 1.18254 15.8033C0.792017 16.1939 0.792017 16.827 1.18254 17.2175C1.57307 17.6081 2.20623 17.6081 2.59676 17.2175C2.90731 16.907 2.9709 16.443 2.78754 16.0696C3.97427 15.503 6.12247 14.5333 7.90006 14.0355C9.90855 13.4732 10.9209 13.3576 11.2798 13.3342C11.3716 13.3282 11.4526 13.266 11.4768 13.1773L12.4771 9.50966C12.4895 9.46424 12.5175 9.42465 12.5562 9.39785L16.5999 6.59838C16.8563 6.42081 16.8894 6.05431 16.6688 5.83373L12.5663 1.73124ZM8.34417 8.8228C8.29817 8.77679 8.22119 8.78627 8.18771 8.84206L6.33809 11.9248C6.28453 12.014 6.38602 12.1155 6.47529 12.062L9.558 10.2123C9.61378 10.1789 9.62326 10.1019 9.57726 10.0559L8.34417 8.8228ZM16.027 16.5933C15.9522 16.5981 15.8766 16.6005 15.8006 16.6005C15.7254 16.6005 15.6507 16.5982 15.5767 16.5935L14.0309 19.2709C13.9525 19.4067 13.7553 19.4035 13.6813 19.2651L13.0771 18.1343C13.0412 18.0671 12.9702 18.0262 12.8941 18.0287L11.6126 18.0708C11.4558 18.0759 11.3544 17.9067 11.4329 17.7709L12.9536 15.1369C12.5425 14.5632 12.3006 13.8601 12.3006 13.1005C12.3006 11.1675 13.8676 9.60053 15.8006 9.60053C17.7336 9.60053 19.3006 11.1675 19.3006 13.1005C19.3006 13.8592 19.0592 14.5615 18.649 15.1348L20.171 17.7709C20.2494 17.9067 20.148 18.0759 19.9912 18.0708L18.7098 18.0287C18.6336 18.0262 18.5627 18.0671 18.5268 18.1343L17.9225 19.2651C17.8486 19.4035 17.6514 19.4067 17.5729 19.2709L16.027 16.5933Z",fill:"currentColor"},null,-1),_hoisted_3$w=[_hoisted_2$B];function _sfc_render$t(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$J,_hoisted_3$w)}const __unplugin_components_2$6=_export_sfc(_sfc_main$$,[["render",_sfc_render$t]]),_sfc_main$_={},_hoisted_1$I={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$A=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 16V4H18V16H3ZM1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H18.5C19.0523 2.5 19.5 2.94772 19.5 3.5V16.5C19.5 17.0523 19.0523 17.5 18.5 17.5H2.5C1.94772 17.5 1.5 17.0523 1.5 16.5V3.5ZM10.3774 13.1117C9.88462 14.0732 9.12745 14.6461 8.15796 14.6461C7.29663 14.6461 6.83191 14.1213 6.83191 13.3C6.83191 13.2359 6.83592 13.1758 6.84393 13.1117H4V12.2865H7.06427C7.2766 11.8017 7.62113 11.305 8.06982 10.8523C7.13237 10.1151 6.27505 8.98137 6.27505 7.62728C6.27505 6.38937 7.09231 5.5 8.25811 5.5C9.79649 5.5 10.8862 7.10247 11.0304 9.27383C11.3268 9.21774 11.6313 9.1897 11.9398 9.1897C12.5407 9.1897 12.9093 9.49417 12.9093 10.003C12.9093 10.067 12.8995 10.1298 12.8864 10.1889L12.844 10.3525C12.8309 10.4018 12.8212 10.445 12.8212 10.4797C12.8212 10.5238 12.8372 10.5398 12.8732 10.5398C12.9385 10.5398 13.0642 10.443 13.2278 10.3047L13.4031 10.1546L13.5985 9.98918C13.9722 9.67931 14.4221 9.35395 14.8082 9.35395C15.3152 9.35395 15.4429 9.75975 15.5112 10.1168L15.5627 10.4004C15.5929 10.5465 15.6313 10.6479 15.7176 10.6479C15.7399 10.6479 15.7763 10.6396 15.8268 10.623L15.9467 10.5788L16.1042 10.5123L16.2995 10.4238L16.4637 11.245L16.2383 11.3483L16.0433 11.4309C15.8337 11.5152 15.6864 11.5574 15.6014 11.5574C15.0514 11.5574 14.8602 11.2147 14.7653 10.8984L14.7297 10.7655L14.6756 10.5353C14.6496 10.4385 14.6205 10.3755 14.5679 10.3755C14.501 10.3755 14.3806 10.4669 14.2239 10.6019L13.8668 10.916L13.6613 11.0903C13.2715 11.4106 12.8163 11.7176 12.4005 11.7176C12.0279 11.7176 11.7635 11.4812 11.7635 11.1207C11.7635 10.9165 11.8211 10.7485 11.8751 10.5908C11.9229 10.4515 11.9678 10.3202 11.9678 10.1792C11.9678 10.1151 11.9158 10.0711 11.8236 10.0711C11.5592 10.0711 11.2948 10.1031 11.0424 10.1552C11.0144 10.9484 10.9022 11.6695 10.7099 12.2865H16.6226V13.1117H10.3774ZM7.15643 7.61933C7.15643 8.80115 7.97369 9.69854 8.73086 10.2834C9.15551 9.96695 9.63625 9.70254 10.1611 9.51025C10.089 7.72749 9.32778 6.38542 8.26213 6.38542C7.60912 6.38542 7.15643 6.90222 7.15643 7.61933ZM8.07385 12.2865H9.76046C9.95676 11.7737 10.089 11.1528 10.141 10.4597C9.9207 10.5639 9.70837 10.684 9.51207 10.8122C9.58685 10.8763 9.70169 10.9542 9.85658 11.0458L9.22061 11.5887L8.82301 11.3611C8.51053 11.6576 8.25413 11.978 8.07385 12.2865ZM7.76133 13.2119C7.76133 13.5444 7.9336 13.7648 8.2621 13.7648C8.66673 13.7648 9.03129 13.5244 9.33176 13.1118H7.76934C7.76894 13.1154 7.76853 13.119 7.76813 13.1226C7.76457 13.1543 7.76133 13.1831 7.76133 13.2119Z",fill:"currentColor"},null,-1),_hoisted_3$v=[_hoisted_2$A];function _sfc_render$s(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$I,_hoisted_3$v)}const __unplugin_components_0$9=_export_sfc(_sfc_main$_,[["render",_sfc_render$s]]),Danger=""+new URL("icon-danger.e75f0c25.svg",import.meta.url).href,SignatureToolBar_vue_vue_type_style_index_0_lang="",_hoisted_1$H={key:0,class:"signature-tool"},_sfc_main$Z={__name:"SignatureToolBar",setup(e){const{t:n}=useTranslation(),{switchTool:o,switchAnnotationEditorMode:r,verifySignature:f}=core,s=useDocumentStore(),m=useViewerStore(),w=computed(()=>s.getActiveTool),g=computed(()=>s.getSignatures),v=computed(()=>s.getDisableDigitalSignature),d=computed(()=>s.getDisableElectronicSignature),u=computed(()=>m.getDisableSignatureTool);watch(()=>w.value,k=>{(k==="addDigitalSign"||k==="addElectronicSign")&&window.$message.warning(n("signatures.danger"),{duration:3e3,icon:()=>h$1("img",{src:Danger}),max:1,class:"sign-danger",style:{backgroundColor:"#FFF4E5"}})});const y=k=>{s.setToolState(k),m.toggleActiveHand(!1),o(0),r(0)},x=async()=>{y(""),await f();const k=g.value;if(k.length!==0){if(k.length===1){const P=k[0].signature,S=P.signerList[0].isSignVerified,E=P.signerList[0].isCertTrusted;S&&E?m.setSignatureVerify(1):S?S&&!E&&m.setSignatureVerify(3):m.setSignatureVerify(2);return}else for(let P=0;P<k.length;P++){const S=k[P].signature,E=S.signerList[0].isSignVerified,M=S.signerList[0].isCertTrusted;if(!(E&&M)&&(!E||!M)){m.setSignatureVerify(2);return}}m.setSignatureVerify(1)}};return(k,P)=>{const S=__unplugin_components_0$9,E=_sfc_main$4m,M=__unplugin_components_2$6,T=__unplugin_components_3$3,D=__unplugin_components_4$3;return u.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_1$H,[createVNode(E,{id:"createSignFieldButton",class:normalizeClass({active:w.value==="signatureFields"}),onClick:P[0]||(P[0]=N=>y("signatureFields")),title:k.$t("toolbar.signatureTools.createSignField")},{default:withCtx(()=>[createVNode(S),createBaseVNode("span",null,toDisplayString(k.$t("toolbar.signatureTools.createSignField")),1)]),_:1},8,["class","title"]),v.value?createCommentVNode("",!0):(openBlock(),createBlock(E,{key:0,class:normalizeClass({active:w.value==="addDigitalSign"}),onClick:P[1]||(P[1]=N=>y("addDigitalSign")),title:k.$t("toolbar.signatureTools.addDigitalSign")},{default:withCtx(()=>[createVNode(M),createBaseVNode("span",null,toDisplayString(k.$t("toolbar.signatureTools.addDigitalSign")),1)]),_:1},8,["class","title"])),d.value?createCommentVNode("",!0):(openBlock(),createBlock(E,{key:1,class:normalizeClass({active:w.value==="addElectronicSign"}),onClick:P[2]||(P[2]=N=>y("addElectronicSign")),title:k.$t("toolbar.signatureTools.addElectronicSign")},{default:withCtx(()=>[createVNode(T),createBaseVNode("span",null,toDisplayString(k.$t("toolbar.signatureTools.addElectronicSign")),1)]),_:1},8,["class","title"])),v.value?createCommentVNode("",!0):(openBlock(),createBlock(E,{key:2,onClick:x,title:k.$t("toolbar.signatureTools.verifyDigitalSign"),disabled:!g.value.length},{default:withCtx(()=>[createVNode(D),createBaseVNode("span",null,toDisplayString(k.$t("toolbar.signatureTools.verifyDigitalSign")),1)]),_:1},8,["title","disabled"]))]))}}},ComparedToolbar_vue_vue_type_style_index_0_lang="",_hoisted_1$G={class:"compare-toolbar"},_hoisted_2$z={class:"file-color"},_sfc_main$Y={__name:"ComparedToolbar",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=computed(()=>o.getCompareSetting("oldFileColor")),f=computed(()=>o.getCompareSetting("newFileColor")),s=()=>{n.setCompareStatus("end"),o.initCompareFiles()};return(m,w)=>{const g=_sfc_main$2$,v=__unplugin_components_1$g;return openBlock(),createElementBlock("div",_hoisted_1$G,[createVNode(g),createBaseVNode("div",_hoisted_2$z,[createBaseVNode("div",null,[createBaseVNode("div",{class:"color",style:normalizeStyle({"background-color":r.value})},null,4),createBaseVNode("span",null,toDisplayString(m.$t("compare.oldFile")),1)]),createBaseVNode("div",null,[createBaseVNode("div",{class:"color",style:normalizeStyle({"background-color":f.value})},null,4),createBaseVNode("span",null,toDisplayString(m.$t("compare.newFile")),1)])]),createVNode(v,{class:"close",onClick:s})])}}},_sfc_main$X={},_hoisted_1$F={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$y=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.3107 1.25H2.25V18.75H10V17.25H3.75V2.75H12.689L16.25 6.311V10H17.75V5.68934L13.3107 1.25ZM5 6H14V10H5V6ZM11.4945 15.1106L12.7372 13.5H17.5V16.5H12.6887L11.4945 15.1106ZM9.56053 15.1617L12 18H17.5H19V16.5V13.5V12H17.5H12L9.56053 15.1617Z",fill:"currentColor"},null,-1),_hoisted_3$u=[_hoisted_2$y];function _sfc_render$r(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$F,_hoisted_3$u)}const __unplugin_components_2$5=_export_sfc(_sfc_main$X,[["render",_sfc_render$r]]),_sfc_main$W={},_hoisted_1$E={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$x=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.3107 1.25H2.25V18.75H17.75V5.68934L13.3107 1.25ZM12.689 2.75L16.25 6.311V17.25H3.75V2.75H12.689ZM15 8H5V12H15V8Z",fill:"currentColor"},null,-1),_hoisted_3$t=[_hoisted_2$x];function _sfc_render$q(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$E,_hoisted_3$t)}const __unplugin_components_0$8=_export_sfc(_sfc_main$W,[["render",_sfc_render$q]]),RedactionToolbar_vue_vue_type_style_index_0_lang="",_hoisted_1$D={class:"redaction-toolbar"},_sfc_main$V={__name:"RedactionToolbar",props:["items"],setup(e){const n=useDocumentStore(),o=useViewerStore(),r=computed(()=>n.getActiveTool),f=computed(()=>n.getRedactionPrompted),s=m=>{f.value?r.value!==m&&(n.setToolState(m),o.resetPanels()):(n.setFirstEnterRedactionTool(m),o.openElement("redactionTipDialog"))};return(m,w)=>{const g=__unplugin_components_0$8,v=_sfc_main$4m,d=__unplugin_components_2$5,u=_sfc_main$2A;return openBlock(),createElementBlock("div",_hoisted_1$D,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.items,(y,x)=>(openBlock(),createElementBlock(Fragment,{key:x},[y.type==="fillBlack"?(openBlock(),createBlock(v,{key:0,"data-element":y.dataElement,class:normalizeClass(["with-text",{active:r.value==="redaction"}]),onClick:w[0]||(w[0]=k=>s("redaction")),title:m.$t(y.title)},{default:withCtx(()=>[createVNode(g),createBaseVNode("span",null,toDisplayString(m.$t(y.title)),1)]),_:2},1032,["data-element","class","title"])):y.type==="fillWhite"?(openBlock(),createBlock(v,{key:1,"data-element":y.dataElement,class:normalizeClass(["with-text",{active:r.value==="remove"}]),onClick:w[1]||(w[1]=k=>s("remove")),title:m.$t(y.title)},{default:withCtx(()=>[createVNode(d),createBaseVNode("span",null,toDisplayString(m.$t(y.title)),1)]),_:2},1032,["data-element","class","title"])):y.name==="customButton"&&!y.hidden&&!y.dropItem?(openBlock(),createBlock(u,{key:2,item:y},null,8,["item"])):createCommentVNode("",!0)],64))),128))])}}},_sfc_main$U={},_hoisted_1$C={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$w=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.8333 7.33333H15.8333H14.5H13.1666H11.8333H7.83331V6C7.83331 4.52724 9.02722 3.33333 10.5 3.33333C11.9727 3.33333 13.1666 4.52724 13.1666 6H14.5C14.5 3.79086 12.7091 2 10.5 2C8.29084 2 6.49998 3.79086 6.49998 6V7.33333H5.16665C4.43027 7.33333 3.83331 7.93029 3.83331 8.66667V16.6667C3.83331 17.403 4.43027 18 5.16665 18H15.8333C16.5697 18 17.1666 17.403 17.1666 16.6667V8.66667C17.1666 7.93029 16.5697 7.33333 15.8333 7.33333ZM6.49998 8.6784V8.66667H5.16665L5.16665 16.6667H15.8333L15.8333 8.66667H14.5V8.6784H13.1666H7.83331H6.49998Z",fill:"currentColor"},null,-1),_hoisted_3$s=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.1667 13.4263C11.8182 13.1626 12.2778 12.5238 12.2778 11.7778C12.2778 10.7959 11.4818 10 10.5 10C9.51817 10 8.72223 10.7959 8.72223 11.7778C8.72223 12.5239 9.18185 13.1626 9.83339 13.4264V14.6667C9.83339 15.0349 10.1319 15.3333 10.5001 15.3333C10.8683 15.3333 11.1667 15.0349 11.1667 14.6667V13.4263Z",fill:"currentColor"},null,-1),_hoisted_4$5=[_hoisted_2$w,_hoisted_3$s];function _sfc_render$p(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$C,_hoisted_4$5)}const __unplugin_components_2$4=_export_sfc(_sfc_main$U,[["render",_sfc_render$p]]),_sfc_main$T={},_hoisted_1$B={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$v=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.1666 7.25722V6C13.1666 4.52724 11.9727 3.33333 10.4999 3.33333C9.02716 3.33333 7.83325 4.52724 7.83325 6V7.25722H13.1666ZM10.4999 2C8.29078 2 6.49992 3.79086 6.49992 6V7.25722V7.33333H4.72214C4.23122 7.33333 3.83325 7.7313 3.83325 8.22222V17.1111C3.83325 17.602 4.23122 18 4.72214 18H16.2777C16.7686 18 17.1666 17.602 17.1666 17.1111V8.22222C17.1666 7.7313 16.7686 7.33333 16.2777 7.33333H14.4999V7.25722V6C14.4999 3.79086 12.7091 2 10.4999 2ZM5.16659 8.66667V16.6667H15.8333V8.66667H5.16659ZM7.50005 11.5707V13.0707H13.5001V11.5707H7.50005Z",fill:"currentColor"},null,-1),_hoisted_3$r=[_hoisted_2$v];function _sfc_render$o(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$B,_hoisted_3$r)}const __unplugin_components_0$7=_export_sfc(_sfc_main$T,[["render",_sfc_render$o]]),SecurityToolbar_vue_vue_type_style_index_0_lang="",_hoisted_1$A={class:"security-toolbar"},_sfc_main$S={__name:"SecurityToolbar",props:["items"],setup(e){const n=getCurrentInstance().appContext.app.config.globalProperties,o=ref(!1),r=useDocumentStore(),f=useViewerStore(),s=computed(()=>r.getFilehasPwd),m=computed(()=>f.getWebviewerMode),w=computed(()=>f.isElementOpen("setPasswordModal")),g=()=>{f.openElement("setPasswordModal")},v=async()=>{if(!s.value&&m.value!=="Standalone"||o.value)return;o.value=!0,await core.removePassword()?window.$message.success(n.$t("passwordDialog.removeSuccess"),{duration:3e3,icon:()=>h$1("img",{src:MessageSuccess})}):window.$message.error(n.$t("passwordDialog.removeFailure"),{duration:3e3,icon:()=>h$1("img",{src:MessageError})}),o.value=!1};return(d,u)=>{const y=__unplugin_components_0$7,x=_sfc_main$4m,k=__unplugin_components_2$4,P=_sfc_main$2A;return openBlock(),createElementBlock("div",_hoisted_1$A,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.items,(S,E)=>(openBlock(),createElementBlock(Fragment,{key:E},[S.type==="encryption"?(openBlock(),createBlock(x,{key:0,"data-element":S.dataElement,class:normalizeClass(["with-text",{active:w.value}]),onClick:g,title:d.$t(S.title)},{default:withCtx(()=>[createVNode(y),createBaseVNode("span",null,toDisplayString(d.$t(S.title)),1)]),_:2},1032,["data-element","class","title"])):S.type==="decryption"?(openBlock(),createBlock(x,{key:1,"data-element":S.dataElement,class:normalizeClass(["with-text",{disabled:!s.value&&m.value!=="Standalone"}]),onClick:v,title:d.$t(S.title)},{default:withCtx(()=>[createVNode(k),createBaseVNode("span",null,toDisplayString(d.$t(S.title)),1)]),_:2},1032,["data-element","class","title"])):S.name==="customButton"&&!S.hidden&&!S.dropItem?(openBlock(),createBlock(P,{key:2,item:S},null,8,["item"])):createCommentVNode("",!0)],64))),128))])}}},_sfc_main$R={__name:"PushButton",props:["item"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,r=useDocumentStore(),f=useViewerStore(),s=computed(()=>r.getActiveTool),m=w=>{r.setToolState(w),f.toggleActiveHand(!1),n(0),o(0)};return(w,g)=>{const v=__unplugin_components_0$q,d=_sfc_main$4m;return openBlock(),createBlock(d,{class:normalizeClass(["with-text",{active:s.value==="pushbutton"}]),title:w.$t("toolbar.formTools.button"),onClick:g[0]||(g[0]=u=>m("pushbutton"))},{default:withCtx(()=>[createVNode(v),createBaseVNode("span",null,toDisplayString(w.$t("toolbar.formTools.button")),1)]),_:1},8,["title","class"])}}},_sfc_main$Q={__name:"ComboBox",props:["item"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,r=useDocumentStore(),f=useViewerStore(),s=computed(()=>r.getActiveTool),m=w=>{r.setToolState(w),f.toggleActiveHand(!1),n(0),o(0)};return(w,g)=>{const v=__unplugin_components_0$p,d=_sfc_main$4m;return openBlock(),createBlock(d,{class:normalizeClass(["with-text",{active:s.value==="combobox"}]),title:w.$t("toolbar.formTools.comboButton"),onClick:g[0]||(g[0]=u=>m("combobox"))},{default:withCtx(()=>[createVNode(v),createBaseVNode("span",null,toDisplayString(w.$t("toolbar.formTools.comboButton")),1)]),_:1},8,["title","class"])}}},_sfc_main$P={__name:"ListBox",props:["item"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,r=useDocumentStore(),f=useViewerStore(),s=computed(()=>r.getActiveTool),m=w=>{r.setToolState(w),f.toggleActiveHand(!1),n(0),o(0)};return(w,g)=>{const v=__unplugin_components_0$o,d=_sfc_main$4m;return openBlock(),createBlock(d,{class:normalizeClass(["with-text",{active:s.value==="listbox"}]),title:w.$t("toolbar.formTools.listBox"),onClick:g[0]||(g[0]=u=>m("listbox"))},{default:withCtx(()=>[createVNode(v),createBaseVNode("span",null,toDisplayString(w.$t("toolbar.formTools.listBox")),1)]),_:1},8,["title","class"])}}},_sfc_main$O={__name:"RadioButton",props:["item"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,r=useDocumentStore(),f=useViewerStore(),s=computed(()=>r.getActiveTool),m=w=>{r.setToolState(w),f.toggleActiveHand(!1),n(0),o(0)};return(w,g)=>{const v=__unplugin_components_0$n,d=_sfc_main$4m;return openBlock(),createBlock(d,{class:normalizeClass(["with-text",{active:s.value==="radiobutton"}]),title:w.$t("toolbar.formTools.radioButton"),onClick:g[0]||(g[0]=u=>m("radiobutton"))},{default:withCtx(()=>[createVNode(v),createBaseVNode("span",null,toDisplayString(w.$t("toolbar.formTools.radioButton")),1)]),_:1},8,["title","class"])}}},_sfc_main$N={__name:"CheckBoxButton",props:["item"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,r=useDocumentStore(),f=useViewerStore(),s=computed(()=>r.getActiveTool),m=w=>{r.setToolState(w),f.toggleActiveHand(!1),n(0),o(0)};return(w,g)=>{const v=__unplugin_components_0$m,d=_sfc_main$4m;return openBlock(),createBlock(d,{class:normalizeClass(["with-text",{active:s.value==="checkbox"}]),title:w.$t("toolbar.formTools.checkbox"),onClick:g[0]||(g[0]=u=>m("checkbox"))},{default:withCtx(()=>[createVNode(v),createBaseVNode("span",null,toDisplayString(w.$t("toolbar.formTools.checkbox")),1)]),_:1},8,["title","class"])}}},_sfc_main$M={__name:"TextFieldButton",props:["item"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,r=useDocumentStore(),f=useViewerStore(),s=computed(()=>r.getActiveTool),m=w=>{r.setToolState(w),f.toggleActiveHand(!1),n(0),o(0)};return(w,g)=>{const v=__unplugin_components_0$l,d=_sfc_main$4m;return openBlock(),createBlock(d,{class:normalizeClass(["with-text",{active:s.value==="textfield"}]),title:w.$t("toolbar.formTools.textField"),onClick:g[0]||(g[0]=u=>m("textfield"))},{default:withCtx(()=>[createVNode(v),createBaseVNode("span",null,toDisplayString(w.$t("toolbar.formTools.textField")),1)]),_:1},8,["title","class"])}}},FormToolBar_vue_vue_type_style_index_0_scoped_8c65f27b_lang="",_hoisted_1$z={class:"form-tool"},_sfc_main$L={__name:"FormToolBar",props:["items"],setup(e){useDocumentStore();const n=useViewerStore(),o=computed(()=>n.getToolMode),r=computed(()=>n.getIsAnnotationPopup),f=computed(()=>n.isElementOpen("rightPanel")),s=ref(!0);let m=null;const w=["textfield","checkbox","radiobutton","listbox","combobox","pushbutton","signatureFields"],g=()=>{n.toggleElement("rightPanel")},v=u=>{m=u};core.addEvent("annotationSelected",v);const d=()=>{setTimeout(()=>{document.getElementsByClassName("outline-container").length&&w.includes(m==null?void 0:m.type)?s.value=!1:s.value=!0})};return core.addEvent("changeRightPanelBtnDisabled",d),(u,y)=>{const x=_sfc_main$M,k=_sfc_main$N,P=_sfc_main$O,S=_sfc_main$P,E=_sfc_main$Q,M=_sfc_main$R,T=_sfc_main$2A,D=__unplugin_components_19,N=_sfc_main$4m;return openBlock(),createElementBlock("div",_hoisted_1$z,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.items,(F,O)=>(openBlock(),createElementBlock(Fragment,{key:O},[F.type==="textFieldButton"&&!F.hidden?(openBlock(),createBlock(x,{key:0,item:F,"data-element":F.dataElement},null,8,["item","data-element"])):F.type==="checkBoxButton"&&!F.hidden?(openBlock(),createBlock(k,{key:1,item:F,"data-element":F.dataElement},null,8,["item","data-element"])):F.type==="radioButton"&&!F.hidden?(openBlock(),createBlock(P,{key:2,item:F,"data-element":F.dataElement},null,8,["item","data-element"])):F.type==="listBox"&&!F.hidden?(openBlock(),createBlock(S,{key:3,item:F,"data-element":F.dataElement},null,8,["item","data-element"])):F.type==="comboBox"&&!F.hidden?(openBlock(),createBlock(E,{key:4,item:F,"data-element":F.dataElement},null,8,["item","data-element"])):F.type==="pushButton"&&!F.hidden?(openBlock(),createBlock(M,{key:5,item:F,"data-element":F.dataElement},null,8,["item","data-element"])):F.name==="customButton"&&!F.hidden&&!F.dropItem?(openBlock(),createBlock(T,{key:6,item:F},null,8,["item"])):["spacer","divider"].includes(F.type)?(openBlock(),createElementBlock("div",{key:7,class:normalizeClass(F.type)},null,2)):F.type==="property"&&!F.hidden&&r.value?(openBlock(),createBlock(N,{key:8,onClick:g,title:u.$t(F.title),"data-element":F.dataElement,isActive:f.value,disabled:s.value&&o.value==="form",id:F.id,class:"property"},{default:withCtx(()=>[createVNode(D)]),_:2},1032,["title","data-element","isActive","disabled","id"])):createCommentVNode("",!0)],64))),128))])}}},__unplugin_components_5$1=_export_sfc(_sfc_main$L,[["__scopeId","data-v-8c65f27b"]]),MeasurementToolBar_vue_vue_type_style_index_0_scoped_c8b76144_lang="",_hoisted_1$y={class:"measurement-tool"},_sfc_main$K={__name:"MeasurementToolBar",props:["items"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,r=useDocumentStore(),f=useViewerStore(),s=computed(()=>r.getActiveTool),m=computed(()=>f.isElementOpen("measurePanel")),w=computed(()=>f.getIsAnnotationPopup),g=ref(!0);let v=null;const d=k=>{r.setToolState(k),f.toggleActiveHand(!1),n(0),o(0)},u=()=>{f.toggleElement("measurePanel")},y=k=>{v=k,setTimeout(()=>{document.getElementsByClassName("outline-container").length&&v&&v.measure?g.value=!1:g.value=!0})};core.addEvent("annotationSelected",y);const x=()=>{v=null,g.value=!0};return core.addEvent("annotationDeselected",x),(k,P)=>{const S=__unplugin_components_0$j,E=_sfc_main$4m,M=__unplugin_components_2$d,T=__unplugin_components_3$7,D=__unplugin_components_4$8,N=__unplugin_components_5$4,F=__unplugin_components_6$4,O=__unplugin_components_7$2,I=_sfc_main$2A,X=__unplugin_components_19;return openBlock(),createElementBlock("div",_hoisted_1$y,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.items,(ne,ye)=>(openBlock(),createElementBlock(Fragment,{key:ye},[ne.type==="line"&&!ne.hidden?(openBlock(),createBlock(E,{key:0,"data-element":ne.dataElement,class:normalizeClass(["with-text",{active:s.value==="line"}]),title:k.$t(ne.title),onClick:P[0]||(P[0]=J=>d("line"))},{default:withCtx(()=>[createVNode(S),createBaseVNode("span",null,toDisplayString(k.$t(ne.title)),1)]),_:2},1032,["data-element","class","title"])):ne.type==="polyline"&&!ne.hidden?(openBlock(),createBlock(E,{key:1,"data-element":ne.dataElement,class:normalizeClass(["with-text",{active:s.value==="polyline"}]),title:k.$t(ne.title),onClick:P[1]||(P[1]=J=>d("polyline"))},{default:withCtx(()=>[createVNode(M),createBaseVNode("span",null,toDisplayString(k.$t(ne.title)),1)]),_:2},1032,["data-element","class","title"])):ne.type==="curve"&&!ne.hidden?(openBlock(),createBlock(E,{key:2,"data-element":ne.dataElement,class:normalizeClass(["with-text",{active:s.value==="curve"}]),title:k.$t(ne.title),onClick:P[2]||(P[2]=J=>d("curve"))},{default:withCtx(()=>[createVNode(T),createBaseVNode("span",null,toDisplayString(k.$t(ne.title)),1)]),_:2},1032,["data-element","class","title"])):ne.type==="arc"&&!ne.hidden?(openBlock(),createBlock(E,{key:3,"data-element":ne.dataElement,class:normalizeClass(["with-text",{active:s.value==="arc"}]),title:k.$t(ne.title),onClick:P[3]||(P[3]=J=>d("arc"))},{default:withCtx(()=>[createVNode(D),createBaseVNode("span",null,toDisplayString(k.$t(ne.title)),1)]),_:2},1032,["data-element","class","title"])):ne.type==="circle"&&!ne.hidden?(openBlock(),createBlock(E,{key:4,"data-element":ne.dataElement,class:normalizeClass(["with-text",{active:s.value==="circle"}]),title:k.$t(ne.title),onClick:P[4]||(P[4]=J=>d("circle"))},{default:withCtx(()=>[createVNode(N),createBaseVNode("span",null,toDisplayString(k.$t(ne.title)),1)]),_:2},1032,["data-element","class","title"])):ne.type==="rectangle"&&!ne.hidden?(openBlock(),createBlock(E,{key:5,"data-element":ne.dataElement,class:normalizeClass(["with-text",{active:s.value==="rectangle"}]),title:k.$t(ne.title),onClick:P[5]||(P[5]=J=>d("rectangle"))},{default:withCtx(()=>[createVNode(F),createBaseVNode("span",null,toDisplayString(k.$t(ne.title)),1)]),_:2},1032,["data-element","class","title"])):ne.type==="polygon"&&!ne.hidden?(openBlock(),createBlock(E,{key:6,"data-element":ne.dataElement,class:normalizeClass(["with-text",{active:s.value==="polygon"}]),title:k.$t(ne.title),onClick:P[6]||(P[6]=J=>d("polygon"))},{default:withCtx(()=>[createVNode(O),createBaseVNode("span",null,toDisplayString(k.$t(ne.title)),1)]),_:2},1032,["data-element","class","title"])):ne.name==="customButton"&&!ne.hidden&&!ne.dropItem?(openBlock(),createBlock(I,{key:7,item:ne},null,8,["item"])):["spacer","divider"].includes(ne.type)?(openBlock(),createElementBlock("div",{key:8,class:normalizeClass(ne.type)},null,2)):ne.type==="property"&&!ne.hidden&&w.value?(openBlock(),createBlock(E,{key:9,onClick:u,title:k.$t(ne.title),"data-element":ne.dataElement,isActive:m.value,disabled:g.value&&!["line","polyline","curve","arc","circle","rectangle","polygon"].includes(s.value),id:ne.id,class:"property"},{default:withCtx(()=>[createVNode(X)]),_:2},1032,["title","data-element","isActive","disabled","id"])):createCommentVNode("",!0)],64))),128))])}}},__unplugin_components_4$2=_export_sfc(_sfc_main$K,[["__scopeId","data-v-c8b76144"]]),_sfc_main$J={},_hoisted_1$x={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$u=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.2802 7.62131L16.8105 8.15164L16.2802 8.68197L12.6589 12.3033L11.5982 11.2426L13.9392 8.90164H7.24989C5.7311 8.90164 4.49989 10.1329 4.49989 11.6516C4.49989 13.1704 5.7311 14.4016 7.24989 14.4016H14.7499V15.9016H7.24989C4.90268 15.9016 2.99989 13.9988 2.99989 11.6516C2.99989 9.30443 4.90268 7.40164 7.24989 7.40164H13.9392L11.5982 5.06066L12.6589 4L16.2802 7.62131Z",fill:"currentColor"},null,-1),_hoisted_3$q=[_hoisted_2$u];function _sfc_render$n(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$x,_hoisted_3$q)}const __unplugin_components_4$1=_export_sfc(_sfc_main$J,[["render",_sfc_render$n]]),_sfc_main$I={},_hoisted_1$w={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$t=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.53033 7.62131L3 8.15164L3.53033 8.68197L7.15164 12.3033L8.2123 11.2426L5.87132 8.90164H12.5607C14.0794 8.90164 15.3107 10.1329 15.3107 11.6516C15.3107 13.1704 14.0794 14.4016 12.5607 14.4016H5.06066V15.9016H12.5607C14.9079 15.9016 16.8107 13.9988 16.8107 11.6516C16.8107 9.30443 14.9079 7.40164 12.5607 7.40164H5.87132L8.2123 5.06066L7.15164 4L3.53033 7.62131Z",fill:"currentColor"},null,-1),_hoisted_3$p=[_hoisted_2$t];function _sfc_render$m(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$w,_hoisted_3$p)}const __unplugin_components_3$2=_export_sfc(_sfc_main$I,[["render",_sfc_render$m]]),_sfc_main$H={},_hoisted_1$v={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$s=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.5 3H1.75V3.75V16.25V17H2.5H19H19.75V16.25V10H18.25V15.5H18.2147L12.8718 10.8178L10.5643 13.25L6.29496 9.75L3.25 12.9595V4.5H13.75V3H2.5ZM14.5 8.25C14.5 9.07843 13.8284 9.75 13 9.75C12.1716 9.75 11.5 9.07843 11.5 8.25C11.5 7.42157 12.1716 6.75 13 6.75C13.8284 6.75 14.5 7.42157 14.5 8.25ZM16.75 6.75H14.5V5.25H16.75V3H18.25V5.25H20.5V6.75H18.25V9H16.75V6.75Z",fill:"currentColor"},null,-1),_hoisted_3$o=[_hoisted_2$s];function _sfc_render$l(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$v,_hoisted_3$o)}const __unplugin_components_2$3=_export_sfc(_sfc_main$H,[["render",_sfc_render$l]]),_sfc_main$G={},_hoisted_1$u={width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$r=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.25 3H1.5V3.75V16.25V17H2.25H18.75H19.5V16.25V10H18V15.5H3V4.5H13.5V3H2.25ZM12.5 8V5.5H4.5V8H6V7H7.75V13H7V14.5H10V13H9.25V7H11V8H12.5ZM16.75 6.75H14.5V5.25H16.75V3H18.25V5.25H20.5V6.75H18.25V9H16.75V6.75Z",fill:"currentColor"},null,-1),_hoisted_3$n=[_hoisted_2$r];function _sfc_render$k(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$u,_hoisted_3$n)}const __unplugin_components_0$6=_export_sfc(_sfc_main$G,[["render",_sfc_render$k]]),ContentEditorToolBar_vue_vue_type_style_index_0_scoped_10c19a71_lang="",_hoisted_1$t={class:"edit-tool"},_hoisted_2$q=["data-element"],_sfc_main$F={__name:"ContentEditorToolBar",props:["items"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o,resetOperate:r}=core,f=useDocumentStore(),s=useViewerStore(),m=computed(()=>s.getToolMode),w=computed(()=>f.getActiveTool),g=computed(()=>s.getCurrentPage),v=computed(()=>s.isElementOpen("contentEditorPanel")),d=ref(0),u=ref(0),y=ref(!0),x=ref(!0),k=()=>{s.toggleElement("contentEditorPanel")},P=N=>{m.value==="editor"&&(x.value=N)};core.addEvent("changeRightPanelBtnDisabled",P);const S=N=>{f.setToolState(N),s.toggleActiveHand(!1),n(0),o(0),w.value==="addImage"&&isMobileDevice&&document.getElementById("editorImageInput").click()},E=N=>{const F=N.target.files[0];if(!F)return;if(F.size>2*1024*1024){window.$message.error(instance.$t("contentEditor.imageProperties.maxSize"),{duration:3e3,icon:()=>h$1("img",{src:MessageError})}),N.target.value="";return}const O=new FileReader;O.onload=function(I){const X=new Image;X.onload=function(){const ne={imageBase64:I.target.result,width:X.width,height:X.height,pageNum:g.value};core.addEditorImage(ne)},X.onerror=function(ne){console.log(ne)},X.src=I.target.result},O.onerror=function(I){console.log(I)},O.readAsDataURL(F)},M=N=>{r({operation:N,pageNumber:g.value})},T=N=>{d.value=N.undoListLength,u.value=N.redoListLength};core.addEvent("changeOperateList",T);const D=N=>{if(!y.value)return;const F=N.key.toLowerCase();(N.ctrlKey||N.metaKey)&&F==="z"&&!N.shiftKey&&d.value&&M("undo"),(N.ctrlKey&&F==="y"||N.metaKey&&N.shiftKey&&F==="z")&&u.value&&M("redo")};return onMounted(()=>{document.addEventListener("keydown",D)}),onUnmounted(()=>{document.removeEventListener("keydown",D),y.value=!1}),(N,F)=>{const O=__unplugin_components_0$6,I=_sfc_main$4m,X=__unplugin_components_2$3,ne=__unplugin_components_3$2,ye=__unplugin_components_4$1,J=_sfc_main$2A,te=__unplugin_components_19;return openBlock(),createElementBlock("div",_hoisted_1$t,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.items,(q,re)=>(openBlock(),createElementBlock(Fragment,{key:re},[q.type==="addText"?(openBlock(),createBlock(I,{key:0,"data-element":q.dataElement,class:normalizeClass(["operate",{active:w.value==="addText"}]),onClick:F[0]||(F[0]=U=>S("addText")),title:N.$t(q.title)},{default:withCtx(()=>[createVNode(O),createTextVNode(toDisplayString(N.$t(q.title)),1)]),_:2},1032,["data-element","class","title"])):q.type==="addImage"?(openBlock(),createBlock(I,{key:1,"data-element":q.dataElement,class:normalizeClass(["operate",{active:w.value==="addImage"}]),onClick:F[1]||(F[1]=U=>S("addImage")),title:"Add Image"},{default:withCtx(()=>[createVNode(X),createTextVNode(toDisplayString(N.$t(q.title)),1),unref(isMobileDevice)?(openBlock(),createElementBlock("input",{key:0,type:"file",id:"editorImageInput",accept:".png, .jpg, .jpeg",style:{display:"none"},onChange:E,name:"editor"},null,32)):createCommentVNode("",!0)]),_:2},1032,["data-element","class"])):q.type==="divider"?(openBlock(),createElementBlock("div",{key:2,"data-element":q.dataElement,class:"divider pc"},null,8,_hoisted_2$q)):q.type==="undo"?(openBlock(),createBlock(I,{key:3,"data-element":q.dataElement,class:normalizeClass(["history",{disabled:!d.value}]),id:"undo",title:N.$t(q.title),onClick:F[2]||(F[2]=U=>M("undo"))},{default:withCtx(()=>[createVNode(ne)]),_:2},1032,["data-element","class","title"])):q.type==="redo"?(openBlock(),createBlock(I,{key:4,"data-element":q.dataElement,class:normalizeClass(["history",{disabled:!u.value}]),id:"redo",title:N.$t(q.title),onClick:F[3]||(F[3]=U=>M("redo"))},{default:withCtx(()=>[createVNode(ye)]),_:2},1032,["data-element","class","title"])):q.name==="customButton"&&!q.hidden&&!q.dropItem?(openBlock(),createBlock(J,{key:5,item:q},null,8,["item"])):["spacer","divider"].includes(q.type)?(openBlock(),createElementBlock("div",{key:6,class:normalizeClass(q.type)},null,2)):q.type==="property"&&!q.hidden?(openBlock(),createBlock(I,{key:7,onClick:k,title:N.$t(q.title),"data-element":q.dataElement,isActive:v.value,disabled:x.value&&m.value==="editor",id:q.id,class:"property"},{default:withCtx(()=>[createVNode(te)]),_:2},1032,["title","data-element","isActive","disabled","id"])):createCommentVNode("",!0)],64))),128))])}}},__unplugin_components_3$1=_export_sfc(_sfc_main$F,[["__scopeId","data-v-10c19a71"]]),_sfc_main$E={__name:"StickyNoteButton",props:["item"],setup(e){const{switchAnnotationEditorMode:n,switchTool:o}=core,r=useViewerStore(),f=useDocumentStore(),s=g=>{f.setToolState(g),r.toggleActiveHand(!1)},m=computed(()=>f.getActiveTool);computed(()=>r.getActiveStickNote);const w=()=>{s("text"),r.toggleActiveStickNote(),n(0),o(0),r.closeActiveHand(),r.closeActiveMeasure()};return(g,v)=>{const d=__unplugin_components_0$b,u=_sfc_main$4m;return openBlock(),createBlock(u,mergeProps({isActive:m.value==="text"},{...e.item},{onClick:w,title:g.$t("toolbar.annotationTools.note")}),{default:withCtx(()=>[createVNode(d)]),_:1},16,["isActive","title"])}}},Annotate_vue_vue_type_style_index_0_lang="",Annotate_vue_vue_type_style_index_1_scoped_3cba50de_lang="",_hoisted_1$s={key:1,class:"markup-container"},_hoisted_2$p={key:3,class:"shape-container"},_sfc_main$D={__name:"Annotate",props:["items"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,r=useDocumentStore(),f=useViewerStore(),s=computed(()=>r.getActiveTool),m=computed(()=>["highlight","underline","squiggly","strikeout"].includes(s.value)),w=computed(()=>["square","circle","arrow","line","arc","polygon","polyline"].includes(s.value)),g=computed(()=>r.getMarkupToolState),v=computed(()=>r.getShapeToolState),d=computed(()=>f.isElementOpen("measurePanel")||f.isElementOpen("freetextPanel")),u=computed(()=>f.getToolMode),y=computed(()=>f.getIsAnnotationPopup),x=ref(!0),k=["text","ink","highlight","underline","squiggly","strikeout","square","circle","arrow","line","arc","polygon","polyline","freetext","stamp","image"];let P=null;const S=O=>{r.setMarkupToolState(O),N(O)},E=O=>{r.setShapeToolState(O),N(O)},M=()=>{s.value==="image"&&N("image")};core.addEvent("imageChange",M),onUnmounted(()=>{core.removeEvent("imageChange",M)});const T=()=>{if(!P&&s.value==="freetext"){f.toggleElement("freetextPanel");return}P.type==="freetext"?f.toggleElement("freetextPanel"):f.toggleElement("measurePanel")};computed(()=>r.getActiveToolColor);const D=O=>{P=O,setTimeout(()=>{(document.getElementsByClassName("outline-container").length||document.getElementsByClassName("text-editor").length)&&k.includes(P==null?void 0:P.type)&&!P.measure?x.value=!1:x.value=!0})},N=O=>{if(r.setToolState(O),f.toggleActiveHand(!1),n(0),o(0),O==="stamp"?f.toggleElement("stampPanel"):f.closeElement("stampPanel"),s.value==="image"){const I=isMobileDevice?"annotaionImageInput":"signImageInput";document.getElementById(I).click()}};core.addEvent("annotationSelected",D);const F=()=>{P=null,x.value=!0};return core.addEvent("annotationDeselected",F),(O,I)=>{const X=_sfc_main$E,ne=__unplugin_components_1$6,ye=_sfc_main$4m,J=__unplugin_components_3$9,te=__unplugin_components_4$9,q=__unplugin_components_5$5,re=__unplugin_components_6$5,U=__unplugin_components_7$4,H=__unplugin_components_8$2,Z=__unplugin_components_9$5,Y=__unplugin_components_10$2,W=__unplugin_components_11,Q=__unplugin_components_12,oe=__unplugin_components_13$2,Ce=__unplugin_components_14$1,Se=__unplugin_components_15,fe=__unplugin_components_16,Pe=__unplugin_components_17,Ae=_sfc_main$2A,Te=__unplugin_components_19;return openBlock(!0),createElementBlock(Fragment,null,renderList(e.items,(Ee,Be)=>(openBlock(),createElementBlock(Fragment,{key:`${Ee.type}-${Ee.dataElement||Be}`},[Ee.type==="note"&&!Ee.hidden?(openBlock(),createBlock(X,{key:0,"data-element":Ee.dataElement},null,8,["data-element"])):createCommentVNode("",!0),["highlight","underline","strikeout","squiggly"].includes(Ee.type)?(openBlock(),createElementBlock("div",_hoisted_1$s,[Ee.type==="highlight"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:0,"data-element":Ee.dataElement,class:normalizeClass({active:m.value&&g.value==="highlight"}),onClick:I[0]||(I[0]=withModifiers(Ve=>S("highlight"),["stop"])),title:O.$t("toolbar.annotationTools.highlight")},{default:withCtx(()=>[createVNode(ne)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0),Ee.type==="underline"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:1,"data-element":Ee.dataElement,class:normalizeClass({active:m.value&&g.value==="underline"}),onClick:I[1]||(I[1]=withModifiers(Ve=>S("underline"),["stop"])),title:O.$t("toolbar.annotationTools.underline")},{default:withCtx(()=>[createVNode(J)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0),Ee.type==="strikeout"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:2,"data-element":Ee.dataElement,class:normalizeClass({active:m.value&&g.value==="strikeout"}),onClick:I[2]||(I[2]=withModifiers(Ve=>S("strikeout"),["stop"])),title:O.$t("toolbar.annotationTools.strikeout")},{default:withCtx(()=>[createVNode(te)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0),Ee.type==="squiggly"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:3,"data-element":Ee.dataElement,class:normalizeClass({active:m.value&&g.value==="squiggly"}),onClick:I[3]||(I[3]=withModifiers(Ve=>S("squiggly"),["stop"])),title:O.$t("toolbar.annotationTools.squiggly")},{default:withCtx(()=>[createVNode(q)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0)])):createCommentVNode("",!0),Ee.type==="ink"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:2,"data-element":Ee.dataElement,class:normalizeClass({active:s.value==="ink"}),onClick:I[4]||(I[4]=Ve=>N("ink")),title:O.$t("toolbar.annotationTools.ink")},{default:withCtx(()=>[createVNode(re)]),_:2},1032,["data-element","class","title"])):["circle","square","arrow","line","arc","polygon","polyline"].includes(Ee.type)?(openBlock(),createElementBlock("div",_hoisted_2$p,[Ee.type==="circle"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:0,"data-element":Ee.dataElement,class:normalizeClass({active:w.value&&v.value==="circle"}),onClick:I[5]||(I[5]=withModifiers(Ve=>E("circle"),["stop"])),title:O.$t("toolbar.annotationTools.circle")},{default:withCtx(()=>[createVNode(U)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0),Ee.type==="arc"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:1,"data-element":Ee.dataElement,class:normalizeClass({active:w.value&&v.value==="arc"}),onClick:I[6]||(I[6]=withModifiers(Ve=>E("arc"),["stop"])),title:O.$t("toolbar.annotationTools.arc")},{default:withCtx(()=>[createVNode(H)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0),Ee.type==="square"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:2,"data-element":Ee.dataElement,class:normalizeClass({active:w.value&&v.value==="square"}),onClick:I[7]||(I[7]=withModifiers(Ve=>E("square"),["stop"])),title:O.$t("toolbar.annotationTools.square")},{default:withCtx(()=>[createVNode(Z)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0),Ee.type==="polygon"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:3,"data-element":Ee.dataElement,class:normalizeClass({active:w.value&&v.value==="polygon"}),onClick:I[8]||(I[8]=withModifiers(Ve=>E("polygon"),["stop"])),title:O.$t("toolbar.annotationTools.polygon")},{default:withCtx(()=>[createVNode(Y)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0),Ee.type==="polyline"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:4,"data-element":Ee.dataElement,class:normalizeClass({active:w.value&&v.value==="polyline"}),onClick:I[9]||(I[9]=withModifiers(Ve=>E("polyline"),["stop"])),title:O.$t("toolbar.annotationTools.polyline")},{default:withCtx(()=>[createVNode(W)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0),Ee.type==="arrow"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:5,"data-element":Ee.dataElement,class:normalizeClass({active:w.value&&v.value==="arrow"}),onClick:I[10]||(I[10]=withModifiers(Ve=>E("arrow"),["stop"])),title:O.$t("toolbar.annotationTools.arrow")},{default:withCtx(()=>[createVNode(Q)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0),Ee.type==="line"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:6,"data-element":Ee.dataElement,class:normalizeClass({active:w.value&&v.value==="line"}),onClick:I[11]||(I[11]=withModifiers(Ve=>E("line"),["stop"])),title:O.$t("toolbar.annotationTools.line")},{default:withCtx(()=>[createVNode(oe)]),_:2},1032,["data-element","class","title"])):createCommentVNode("",!0)])):Ee.type==="freetext"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:4,"data-element":Ee.dataElement,class:normalizeClass({active:s.value==="freetext"}),onClick:I[12]||(I[12]=Ve=>N("freetext")),title:O.$t("toolbar.annotationTools.freetext")},{default:withCtx(()=>[createVNode(Ce)]),_:2},1032,["data-element","class","title"])):Ee.type==="stamp"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:5,"data-element":Ee.dataElement,class:normalizeClass({active:s.value==="stamp"}),onClick:I[13]||(I[13]=Ve=>N("stamp")),title:O.$t("toolbar.annotationTools.stamp")},{default:withCtx(()=>[createVNode(Se)]),_:2},1032,["data-element","class","title"])):Ee.type==="image"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:6,"data-element":Ee.dataElement,class:normalizeClass({active:s.value==="image"}),onClick:I[14]||(I[14]=Ve=>N("image")),title:O.$t("toolbar.annotationTools.image")},{default:withCtx(()=>[createVNode(fe)]),_:2},1032,["data-element","class","title"])):Ee.type==="link"&&!Ee.hidden?(openBlock(),createBlock(ye,{key:7,"data-element":Ee.dataElement,class:normalizeClass({active:s.value==="link"}),onClick:I[15]||(I[15]=Ve=>N("link")),title:O.$t("toolbar.annotationTools.link")},{default:withCtx(()=>[createVNode(Pe)]),_:2},1032,["data-element","class","title"])):Ee.name==="customButton"&&!Ee.hidden&&!Ee.dropItem?(openBlock(),createBlock(Ae,{key:8,item:Ee},null,8,["item"])):["spacer","divider"].includes(Ee.type)?(openBlock(),createElementBlock("div",{key:9,class:normalizeClass(Ee.type)},null,2)):Ee.type==="property"&&!Ee.hidden&&y.value?(openBlock(),createBlock(ye,{key:10,onClick:T,title:O.$t(Ee.title),"data-element":Ee.dataElement,isActive:d.value,disabled:x.value&&u.value==="annotation"&&s.value!=="freetext",id:Ee.id,class:"property sidebar-style"},{default:withCtx(()=>[createVNode(Te)]),_:2},1032,["title","data-element","isActive","disabled","id"])):createCommentVNode("",!0)],64))),128)}}},__unplugin_components_2$2=_export_sfc(_sfc_main$D,[["__scopeId","data-v-3cba50de"]]),Toolbar_vue_vue_type_style_index_0_scoped_717dbea3_lang="",_hoisted_1$r={class:"scroll-container left"},_hoisted_2$o={class:"scroll-container right"},_sfc_main$C={__name:"Toolbar",setup(e){const n=getCurrentInstance().appContext.app.config.globalProperties,o=useViewerStore(),r=useDocumentStore(),f=o.getToolItems,s=computed(()=>o.getCompareStatus),m=computed(()=>o.getDisabledHeader),w=computed(()=>o.getToolMode),g=computed(()=>r.getActiveTool),v=computed(()=>o.getCurrentPage),d=computed(()=>o.getDisableSignatureTool),u=ref(!1),y=ref(null),x=ref(!1),k=ref(!1);watch(w,async(N,F)=>{u.value=!(["view","document","separation"].includes(N)||N==="compare"&&s!=="finished"),x.value=!1,k.value=!1,await nextTick(),u.value&&(y.value&&y.value.scrollLeft>0&&(x.value=!0),y.value&&y.value.scrollLeft+y.value.clientWidth<y.value.scrollWidth&&(k.value=!0))}),watch(s,async(N,F)=>{u.value=!(["view","document"].includes(w.value)||w.value==="compare"&&N!=="finished"),x.value=!1,k.value=!1});const P=()=>{y.value.scrollTo({left:y.value.scrollLeft-y.value.clientWidth,behavior:"smooth"})},S=()=>{y.value.scrollTo({left:y.value.scrollLeft+y.value.clientWidth,behavior:"smooth"})},E=N=>{x.value=N.target.scrollLeft>0,k.value=N.target.scrollLeft+N.target.clientWidth<N.target.scrollWidth-1},M=N=>{let F=N.target.files[0];if(!F)return;if(F&&F.size>2*1024*1024){window.$message.error(n.$t("signatures.uploadError"),{duration:5e3,icon:()=>h("img",{src:MessageError})}),N.target.value="";return}if(w.value==="annotation"&&(r.setToolState("image"),core.handleCreateStatus({bool:!0,fileData:F})),g.value!=="image")return;const O=new FileReader;O.onload=function(I){const X=new Image;X.onload=function(){const ne={imageBase64:I.target.result,width:X.width,height:X.height,pageNum:v.value};core.addAnnotationImage(ne)},X.onerror=function(ne){console.log(ne)},X.src=I.target.result},O.onerror=function(I){console.log(I)},O.readAsDataURL(F)},T=()=>{r.setToolState("image")},D=()=>{o.toggleElement("measurePanel")};return core.addEvent("toggleAnnotAttrbutePanel",D),(N,F)=>{const O=__unplugin_components_0$e,I=_sfc_main$4m,X=__unplugin_components_2$2,ne=__unplugin_components_3$1,ye=__unplugin_components_4$2,J=__unplugin_components_5$1,te=_sfc_main$S,q=_sfc_main$V,re=_sfc_main$Y,U=_sfc_main$Z,H=__unplugin_components_10$3;return w.value==="sign"&&d.value?createCommentVNode("",!0):withDirectives((openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["toolbar",{security:w.value==="security",editor:w.value==="editor",disabled:m.value}])},[withDirectives(createBaseVNode("div",_hoisted_1$r,[createVNode(I,{class:"flip-button",onClick:P},{default:withCtx(()=>[createVNode(O)]),_:1})],512),[[vShow,unref(isMobileDevice)&&x.value]]),createBaseVNode("div",{class:"tools",ref_key:"toolbarRef",ref:y,onScroll:E},[w.value==="annotation"?(openBlock(),createBlock(X,{key:0,items:unref(f)[w.value]},null,8,["items"])):w.value==="editor"?(openBlock(),createBlock(ne,{key:1,items:unref(f)[w.value]},null,8,["items"])):w.value==="measurement"?(openBlock(),createBlock(ye,{key:2,items:unref(f)[w.value]},null,8,["items"])):w.value==="form"?(openBlock(),createBlock(J,{key:3,items:unref(f)[w.value]},null,8,["items"])):w.value==="security"?(openBlock(),createBlock(te,{key:4,items:unref(f)[w.value]},null,8,["items"])):w.value==="redaction"?(openBlock(),createBlock(q,{key:5,items:unref(f)[w.value]},null,8,["items"])):(openBlock(!0),createElementBlock(Fragment,{key:6},renderList(unref(f)[w.value],(Z,Y)=>(openBlock(),createElementBlock(Fragment,{key:`${Z.type}-${Z.dataElement||Y}`},[Z.type==="comparedToolbar"?(openBlock(),createBlock(re,{key:0})):Z.type==="signatureToolBar"?(openBlock(),createBlock(U,{key:1})):createCommentVNode("",!0)],64))),128))],544),withDirectives(createBaseVNode("div",_hoisted_2$o,[createVNode(I,{class:"flip-button",onClick:S},{default:withCtx(()=>[createVNode(H)]),_:1})],512),[[vShow,unref(isMobileDevice)&&k.value]]),unref(isMobileDevice)?(openBlock(),createElementBlock("input",{key:0,type:"file",id:"annotaionImageInput",accept:".png, .jpg, .jpeg",style:{display:"none"},onChange:M,onClick:T,name:"annotaion"},null,32)):createCommentVNode("",!0)],2)),[[vShow,u.value]])}}},__unplugin_components_1=_export_sfc(_sfc_main$C,[["__scopeId","data-v-717dbea3"]]),DocumentEditorHeader_vue_vue_type_style_index_0_lang="",_hoisted_1$q={class:"header-items document-editor-header"},_hoisted_2$n={class:"left-container"},_hoisted_3$m={class:"right-container"},_sfc_main$B={__name:"DocumentEditorHeader",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=computed(()=>o.getDocEditorOperationList),f=computed(()=>n.getToolMode),s=computed(()=>n.getScrollMode),m=computed(()=>n.getPageMode),w=computed(()=>n.getDocumentEditorSaveStatus),g=computed(()=>n.getDocumentEditorSaveAsStatus),v=computed(()=>n.getDocumentEditorHeaders);watch(f,(x,k)=>{k==="document"&&o.setDocEditorOperationList("reset")});const d=()=>{o.setToolState(""),n.setActiveToolMode("view"),n.setCompareStatus(""),core.saveDocumentEdit("common.actions.cancel")},u=async()=>{o.resetSetting(),o.setToolState(""),n.setActiveToolMode("view"),n.setUpload(!0),n.setUploadLoading(!0);const x=n.getScale,k=await core.saveDocumentEdit(),P=o.getPassword;await core.loadDocument(k,{password:P}),o.setCurrentPdfData(k);const S=core.getPagesCount();o.setTotalPages(S),o.setOutline(core.getOutlines()),n.setCurrentPage(1),core.switchScrollMode(s.value==="Vertical"?0:1),core.switchSpreadMode(m.value);const E=()=>{n.setCurrentScale(x/100),core.scaleChanged(x/100),core.removeEvent("documentloaded",E)};core.addEvent("documentloaded",E),n.setUploadLoading(!1)},y=async()=>{const{blobData:x,filename:k}=await core.saveDocumentEdit("saveAs");FileSaver_min.exports.saveAs(x,k)};return(x,k)=>{const P=_sfc_main$2A;return openBlock(),createElementBlock("div",_hoisted_1$q,[createBaseVNode("div",_hoisted_2$n,[(openBlock(!0),createElementBlock(Fragment,null,renderList(v.value.leftHeaders,(S,E)=>(openBlock(),createElementBlock(Fragment,null,[S.dataElement==="toggleCancelButton"?(openBlock(),createElementBlock("div",{key:0,class:"rect-button white",onClick:d},toDisplayString(x.$t("common.actions.cancel")),1)):S.name==="customButton"&&!S.hidden?(openBlock(),createBlock(P,{key:1,item:S,"data-element":S.dataElement},null,8,["item","data-element"])):createCommentVNode("",!0)],64))),256))]),createBaseVNode("div",_hoisted_3$m,[(openBlock(!0),createElementBlock(Fragment,null,renderList(v.value.rightHeaders,(S,E)=>(openBlock(),createElementBlock(Fragment,null,[S.dataElement==="toggleSaveButton"&&w.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["rect-button blue",{disabled:!r.value.length}]),onClick:u},toDisplayString(x.$t("common.actions.save")),3)):S.dataElement==="toggleSaveAsButton"&&g.value?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(["rect-button blue",{disabled:!r.value.length}]),onClick:y},toDisplayString(x.$t("documentEditor.saveAs")),3)):S.name==="customButton"&&!S.hidden?(openBlock(),createBlock(P,{key:2,item:S,"data-element":S.dataElement},null,8,["item","data-element"])):createCommentVNode("",!0)],64))),256))])])}}},_sfc_main$A={},_hoisted_1$p={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$m=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.25 1.25H5H15H15.75V2V5.25H18H18.75V6V15V15.75H18H15V17.5V19H13.5H6.5H5V17.5V15.75H2H1.25V15V6V5.25H2H4.25V2V1.25ZM14.25 2.75V5.25H5.75V2.75H14.25ZM15 14.25H17.25V6.75H2.75V14.25H5V12.5V11H6.5H13.5H15V12.5V14.25ZM6.5 12.5H13.5V17.5H6.5V12.5ZM15 10C15.5523 10 16 9.55229 16 9C16 8.44772 15.5523 8 15 8C14.4477 8 14 8.44772 14 9C14 9.55229 14.4477 10 15 10Z",fill:"currentColor"},null,-1),_hoisted_3$l=[_hoisted_2$m];function _sfc_render$j(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$p,_hoisted_3$l)}const __unplugin_components_0$5=_export_sfc(_sfc_main$A,[["render",_sfc_render$j]]),_sfc_main$z={__name:"PrintButton",props:["item"],setup(e){const n=useViewerStore(),o=computed(()=>n.getToolMode),r=computed(()=>n.getCompareMode),f=async()=>{if(o.value==="compare"&&r.value==="content"){n.openElement("printSettingDialog");return}n.setDownloading(!0);try{const s=await core.webViewerNamedAction("Print");n.setDownloading(!1),s||n.setDownloadError("Print")}catch(s){console.log(s)}};return(s,m)=>{const w=__unplugin_components_0$5,g=_sfc_main$4m;return openBlock(),createBlock(g,mergeProps({...e.item},{onClick:f,title:s.$t("toolbar.fileOperations.print")}),{default:withCtx(()=>[createVNode(w)]),_:1},16,["title"])}}},DownloadButton_vue_vue_type_style_index_0_lang="",_sfc_main$y={__name:"DownloadButton",setup(e){const n=useViewerStore(),o=computed(()=>n.getToolMode),r=computed(()=>n.getCompareMode),{download:f}=core,s=async()=>{if(o.value==="compare"&&r.value==="content"){n.openElement("downloadSettingDialog");return}n.setDownloading(!0);try{const m=await f();n.setDownloading(!1),m||n.setDownloadError("Downloaded")}catch(m){console.log(m)}};return(m,w)=>{const g=__unplugin_components_0$i,v=_sfc_main$4m;return openBlock(),createBlock(v,{onClick:s,title:m.$t("toolbar.fileOperations.download")},{default:withCtx(()=>[createVNode(g)]),_:1},8,["title"])}}},CompareButtons_vue_vue_type_style_index_0_lang="",_hoisted_1$o={class:"compare-buttons"},_sfc_main$x={__name:"CompareButtons",setup(e){const{loadDocument:n}=core,o=useViewerStore(),r=useDocumentStore(),f=computed(()=>o.getCompareStatus),s=computed(()=>r.getCompareFile("oldFile")&&r.getCompareFile("newFile")&&f.value!=="finished"),m=computed(()=>r.getCurrentPdfData),w=()=>{o.closeElement("compareSettingDialog"),r.setToolState(""),o.setActiveToolMode("view"),f.value&&g(),o.setCompareStatus("")},g=async()=>{if(m.value){o.setUploadLoading(!0),r.setTotalPages(0);try{const y=m.value;y.options.notUpdatePwd=!0,await n(y.pdf,y.options)}catch(y){if(console.log(y),y==="invalid_file_error"||y==="no_password_given"||y==="incorrect_password"){o.setUpload(!1),r.setLoadingProgress(0),o.resetSetting();const x=document.getElementById("fileInput");x.value="",r.setCurrentPdfData();return}}o.setUploadLoading(!1);const d=core.getPagesCount(),u=core.getScale();r.setTotalPages(d),o.setCurrentPage(1),o.setCurrentScale(u)}},v=()=>{o.openElement("compareSettingDialog"),r.initCompareSetting(),o.setCompareMode("content"),o.setShowCompareTip(!1)};return(d,u)=>(openBlock(),createElementBlock("div",_hoisted_1$o,[createBaseVNode("div",{class:normalizeClass(["rect-button blue",{disabled:!s.value}]),onClick:v},toDisplayString(d.$t("compare.startCompare")),3),createBaseVNode("div",{class:"rect-button white",onClick:w},toDisplayString(d.$t("common.actions.exit")),1)]))}},_sfc_main$w={},_hoisted_1$n={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$l=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.70581 6.36601L10 2.73204L16.2943 6.36601V13.634L10 17.2679L3.70581 13.634V6.36601ZM9.43754 1.32475C9.78562 1.12379 10.2145 1.12379 10.5625 1.32475L17.2318 5.17523C17.5798 5.37619 17.7943 5.74758 17.7943 6.14951V13.8505C17.7943 14.2524 17.5798 14.6238 17.2318 14.8247L10.5625 18.6752C10.2145 18.8762 9.78561 18.8762 9.43754 18.6752L2.76831 14.8247C2.42023 14.6238 2.20581 14.2524 2.20581 13.8505V6.14951C2.20581 5.74758 2.42023 5.37619 2.76831 5.17523L9.43754 1.32475ZM11.875 9.99999C11.875 11.0355 11.0356 11.875 10 11.875C8.96451 11.875 8.12504 11.0355 8.12504 9.99999C8.12504 8.96445 8.96451 8.12499 10 8.12499C11.0356 8.12499 11.875 8.96445 11.875 9.99999ZM13.375 9.99999C13.375 11.8639 11.864 13.375 10 13.375C8.13608 13.375 6.62504 11.8639 6.62504 9.99999C6.62504 8.13603 8.13608 6.62499 10 6.62499C11.864 6.62499 13.375 8.13603 13.375 9.99999Z",fill:"currentColor"},null,-1),_hoisted_3$k=[_hoisted_2$l];function _sfc_render$i(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$n,_hoisted_3$k)}const __unplugin_components_10$1=_export_sfc(_sfc_main$w,[["render",_sfc_render$i]]),_sfc_main$v={},_hoisted_1$m={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$k=createBaseVNode("path",{d:"M18.3327 10C18.3327 10 14.6017 16.25 9.99935 16.25C5.39698 16.25 1.66602 10 1.66602 10C1.66602 10 5.39698 3.75 9.99935 3.75C14.6017 3.75 18.3327 10 18.3327 10Z",stroke:"currentColor","stroke-width":"1.5"},null,-1),_hoisted_3$j=createBaseVNode("circle",{cx:"10",cy:"10",r:"2",stroke:"currentColor","stroke-width":"1.5"},null,-1),_hoisted_4$4=[_hoisted_2$k,_hoisted_3$j];function _sfc_render$h(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$m,_hoisted_4$4)}const __unplugin_components_9$1=_export_sfc(_sfc_main$v,[["render",_sfc_render$h]]),_sfc_main$u={},_hoisted_1$l={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$j=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.1722 3.67907C9.75796 3.67907 9.42218 3.34328 9.42218 2.92907V1.75C9.42218 1.33579 9.75796 1 10.1722 1C10.5864 1 10.9222 1.33579 10.9222 1.75V2.92907C10.9222 3.34328 10.5864 3.67907 10.1722 3.67907ZM10.0862 13.3672C11.9032 13.3672 13.3761 11.8942 13.3761 10.0772C13.3761 8.26024 11.9032 6.78727 10.0862 6.78727C8.26916 6.78727 6.79619 8.26024 6.79619 10.0772C6.79619 11.8942 8.26916 13.3672 10.0862 13.3672ZM10.0862 14.8672C12.7316 14.8672 14.8761 12.7227 14.8761 10.0772C14.8761 7.43181 12.7316 5.28727 10.0862 5.28727C7.44074 5.28727 5.29619 7.43181 5.29619 10.0772C5.29619 12.7227 7.44074 14.8672 10.0862 14.8672ZM14.7612 4.51466C14.468 4.80718 14.468 5.28144 14.7612 5.57395C15.0545 5.86646 15.53 5.86646 15.8233 5.57395L16.6592 4.74023C16.9524 4.44771 16.9524 3.97345 16.6592 3.68094C16.3659 3.38842 15.8904 3.38842 15.5971 3.68094L14.7612 4.51466ZM16.6633 10.1509C16.6633 9.73669 16.9991 9.4009 17.4133 9.4009H18.5954C19.0096 9.4009 19.3454 9.73669 19.3454 10.1509C19.3454 10.5651 19.0096 10.9009 18.5954 10.9009H17.4133C16.9991 10.9009 16.6633 10.5651 16.6633 10.1509ZM15.8233 14.7278C15.53 14.4353 15.0546 14.4353 14.7613 14.7278C14.468 15.0203 14.468 15.4946 14.7613 15.7871L15.5972 16.6208C15.8904 16.9134 16.3659 16.9134 16.6592 16.6208C16.9525 16.3283 16.9525 15.8541 16.6592 15.5615L15.8233 14.7278ZM10.1721 16.6227C10.5863 16.6227 10.9221 16.9585 10.9221 17.3727V18.5517C10.9221 18.966 10.5863 19.3017 10.1721 19.3017C9.75784 19.3017 9.42206 18.966 9.42206 18.5517V17.3727C9.42206 16.9585 9.75784 16.6227 10.1721 16.6227ZM5.58357 15.7871C5.87684 15.4946 5.87684 15.0204 5.58357 14.7279C5.2903 14.4353 4.81481 14.4353 4.52154 14.7279L3.68565 15.5616C3.39238 15.8541 3.39238 16.3284 3.68565 16.6209C3.97893 16.9134 4.45441 16.9134 4.74769 16.6209L5.58357 15.7871ZM3.68212 10.1509C3.68212 10.5651 3.34633 10.9009 2.93212 10.9009H1.75C1.33579 10.9009 1 10.5651 1 10.1509C1 9.7367 1.33579 9.40091 1.75 9.40091H2.93212C3.34633 9.40091 3.68212 9.7367 3.68212 10.1509ZM4.52151 5.57399C4.81478 5.8665 5.29027 5.8665 5.58354 5.57399C5.87681 5.28147 5.87681 4.80721 5.58354 4.5147L4.74765 3.68098C4.45438 3.38846 3.97889 3.38846 3.68562 3.68098C3.39235 3.97349 3.39235 4.44775 3.68562 4.74026L4.52151 5.57399Z",fill:"currentColor"},null,-1),_hoisted_3$i=[_hoisted_2$j];function _sfc_render$g(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$l,_hoisted_3$i)}const __unplugin_components_7$1=_export_sfc(_sfc_main$u,[["render",_sfc_render$g]]),_sfc_main$t={},_hoisted_1$k={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$i=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6 1.25H5.25V2V4H6.75V2.75H14.0533L17.25 6.75603V17.1111V17.25H6.75V16H5.25V18V18.75H6H18H18.75V18V17.1111V6.49346V6.23089L18.5862 6.02566L15.0005 1.5322L14.7753 1.25H14.4143H6ZM2 4.95819H1.25V5.70819V15V16.1967L2.32698 15.675L4.83876 14.4582H11.7778H12.5278V13.7082V5.70819V4.95819H11.7778H2ZM2.75 13.8033V6.45819H11.0278V12.9582H4.66667H4.49457L4.33969 13.0332L2.75 13.8033ZM9.11107 11.8166H4.66663V10.3166H9.11107V11.8166ZM4.66663 8.97222H9.11107V7.47222H4.66663V8.97222Z",fill:"currentColor"},null,-1),_hoisted_3$h=[_hoisted_2$i];function _sfc_render$f(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$k,_hoisted_3$h)}const __unplugin_components_0$4=_export_sfc(_sfc_main$t,[["render",_sfc_render$f]]),FlattenButton_vue_vue_type_style_index_0_lang="",_sfc_main$s={__name:"FlattenButton",props:["item"],setup(e){const n=useViewerStore(),{flattenPdfDownload:o}=core,r=async()=>{n.setDownloading(!0);try{const f=await o();n.setDownloading(!1),f||n.setDownloadError("Downloaded")}catch(f){console.log(f)}};return(f,s)=>{const m=__unplugin_components_0$4,w=_sfc_main$4m;return openBlock(),createBlock(w,mergeProps({...e.item},{onClick:r}),{default:withCtx(()=>[createVNode(m)]),_:1},16)}}},_sfc_main$r={},_hoisted_1$j={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$h=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.5 3V17H11.5625V18.5H3.5H2V17V3V1.5H3.5H11.5625L16.875 5.75V10H15.375V6.47094L11.0363 3H3.5ZM6.25001 6.0625H5.50001V7.5625H6.25001H8.37501H9.12501V6.0625H8.37501H6.25001ZM5.50001 9.25H6.25001H9.96876H10.7188V10.75H9.96876H6.25001H5.50001V9.25ZM6.25001 12.4375H5.50001V13.9375H6.25001H9.96876H10.7188V12.4375H9.96876H6.25001ZM12.5842 14.8916L13.62 13.8558V17.604V18.354H15.12V17.604V13.8558L16.1558 14.8916L17.2165 13.831L14.9003 11.5148L14.37 10.9845L13.8397 11.5148L11.5235 13.831L12.5842 14.8916Z",fill:"currentColor"},null,-1),_hoisted_3$g=[_hoisted_2$h];function _sfc_render$e(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$j,_hoisted_3$g)}const __unplugin_components_0$3=_export_sfc(_sfc_main$r,[["render",_sfc_render$e]]),_sfc_main$q={__name:"OpenFileButton",props:["item"],setup(e){return(n,o)=>{const r=__unplugin_components_0$3,f=_sfc_main$4m;return openBlock(),createBlock(f,mergeProps({...e.item},{title:n.$t("common.actions.upload")}),{default:withCtx(()=>[createVNode(r)]),_:1},16,["title"])}}},_sfc_main$p={},_hoisted_1$i={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$g=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.62109 10C2.62109 5.92468 5.9248 2.62097 10.0001 2.62097C14.0755 2.62097 17.3792 5.92468 17.3792 10C17.3792 14.0753 14.0755 17.379 10.0001 17.379C5.9248 17.379 2.62109 14.0753 2.62109 10ZM10.0001 1.12097C5.09637 1.12097 1.12109 5.09625 1.12109 10C1.12109 14.9038 5.09637 18.879 10.0001 18.879C14.9039 18.879 18.8792 14.9038 18.8792 10C18.8792 5.09625 14.9039 1.12097 10.0001 1.12097ZM6.02432 11.5C6.71468 11.5 7.27432 10.9404 7.27432 10.25C7.27432 9.55967 6.71468 9.00003 6.02432 9.00003C5.33396 9.00003 4.77432 9.55967 4.77432 10.25C4.77432 10.9404 5.33396 11.5 6.02432 11.5ZM10.0888 11.5C10.7792 11.5 11.3388 10.9404 11.3388 10.25C11.3388 9.55967 10.7792 9.00003 10.0888 9.00003C9.39848 9.00003 8.83884 9.55967 8.83884 10.25C8.83884 10.9404 9.39848 11.5 10.0888 11.5ZM15.4034 10.25C15.4034 10.9404 14.8437 11.5 14.1534 11.5C13.463 11.5 12.9034 10.9404 12.9034 10.25C12.9034 9.55967 13.463 9.00003 14.1534 9.00003C14.8437 9.00003 15.4034 9.55967 15.4034 10.25Z",fill:"currentColor"},null,-1),_hoisted_3$f=[_hoisted_2$g];function _sfc_render$d(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$i,_hoisted_3$f)}const __unplugin_components_0$2=_export_sfc(_sfc_main$p,[["render",_sfc_render$d]]),Dropdown_vue_vue_type_style_index_0_scoped_ece5736d_lang="",Dropdown_vue_vue_type_style_index_1_lang="",_hoisted_1$h={class:"drop-down"},_hoisted_2$f=["item","data-element"],_hoisted_3$e=["data-element"],_hoisted_4$3=["data-element"],_hoisted_5$2=["data-element"],_hoisted_6$2=["data-element"],_hoisted_7$2=["data-element"],_hoisted_8$1=["data-element"],_hoisted_9$1=["data-element"],_hoisted_10$1=["data-element"],_sfc_main$o={__name:"Dropdown",props:["rightItems"],setup(e){const n=e,o=useViewerStore(),r=ref(null),{download:f,webViewerNamedAction:s,flattenPdfDownload:m}=core,w=computed(()=>o.getPopoverChanged),g=computed(()=>r.value&&r.value.getMergedShow()),v=computed(()=>o.getUpload),d=computed(()=>o.getThemeMode),u=computed(()=>{const T=["downloadButton","flattenButton","printButton","settingButton"];return isMobileDevice&&T.push("themeMode","pageModeButton"),n.rightItems.filter(D=>T.includes(D.type)||D.name==="customButton"&&D.dropItem).every(D=>D.hidden)});watch(()=>w.value,(T,D)=>{T&&(r.value.setShow(!1),o.setPopoverChanged(!1))});const y=()=>{window.instance.changeFile(),r.value.setShow(!1)},x=async()=>{if(!core.getPermission("allowsCopying")){o.openElement("permissionPasswordDialog");return}r.value.setShow(!1),o.setDownloading(!0);try{const D=await f();o.setDownloading(!1),D||o.setDownloadError("Downloaded")}catch(D){console.log(D)}},k=async()=>{r.value.setShow(!1),o.setDownloading(!0);try{const T=await m();o.setDownloading(!1),T||o.setDownloadError("Downloaded")}catch(T){console.log(T)}},P=async()=>{if(!core.getPermission("allowsPrinting")){o.openElement("permissionPasswordDialog");return}r.value.setShow(!1),o.setDownloading(!0);try{const D=await s("Print");o.setDownloading(!1),D||o.setDownloadError("Print")}catch(D){console.log(D)}},S=()=>{r.value.setShow(!1),o.setPopoverChanged(!1),o.openElement("settingsDialog")},E=T=>{r.value.setShow(!1),T!==d.value&&o.setThemeMode(T)};watch(()=>d.value,T=>{THEME_CONFIG.mode=T,T==="Light"?document.documentElement.classList.remove("dark"):document.documentElement.classList.add("dark")});const M=()=>{r.value.setShow(!1),o.isElementOpen("pageModePanel")?o.closeElement("pageModePanel"):(o.openElement("pageModePanel"),o.closeElement("contentEditorPanel"))};return(T,D)=>{const N=__unplugin_components_0$2,F=__unplugin_components_11$1,O=_sfc_main$4m,I=_sfc_main$q,X=_sfc_main$y,ne=_sfc_main$s,ye=_sfc_main$z,J=__unplugin_components_7$1,te=__unplugin_components_8$6,q=__unplugin_components_9$1,re=__unplugin_components_10$1,U=_sfc_main$2A;return openBlock(),createBlock(unref(NPopover),{ref_key:"popover",ref:r,placement:"top-start",trigger:"click","show-arrow":!1,to:"#outerContainer",raw:!0,"z-index":4},{trigger:withCtx(()=>[withDirectives(createVNode(O,{class:normalizeClass(["more",{active:g.value,disabled:!v.value}])},{default:withCtx(()=>[createVNode(N),createVNode(F)]),_:1},8,["class"]),[[vShow,!u.value]])]),default:withCtx(()=>[createBaseVNode("div",_hoisted_1$h,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.rightItems,(H,Z)=>(openBlock(),createElementBlock(Fragment,{key:`${H.type}-${H.dataElement||Z}`},[H.type==="openFileButton"&&!H.hidden?(openBlock(),createElementBlock("div",{key:0,item:H,"data-element":H.dataElement,class:"drop-item",onClick:y},[createVNode(I),createTextVNode(toDisplayString(T.$t("toolbar.fileOperations.openFile")),1)],8,_hoisted_2$f)):createCommentVNode("",!0),H.type==="downloadButton"&&!H.hidden?(openBlock(),createElementBlock("div",{key:1,"data-element":H.dataElement,class:"drop-item",onClick:x},[createVNode(X),createTextVNode(toDisplayString(T.$t("toolbar.fileOperations.download")),1)],8,_hoisted_3$e)):createCommentVNode("",!0),H.type==="flattenButton"&&!H.hidden?(openBlock(),createElementBlock("div",{key:2,"data-element":H.dataElement,class:"drop-item",onClick:k},[createVNode(ne),createTextVNode(toDisplayString(T.$t("toolbar.fileOperations.flatten")),1)],8,_hoisted_4$3)):createCommentVNode("",!0),H.type==="printButton"&&!H.hidden?(openBlock(),createElementBlock("div",{key:3,"data-element":H.dataElement,class:"drop-item",onClick:P},[createVNode(ye),createTextVNode(toDisplayString(T.$t("toolbar.fileOperations.print")),1)],8,_hoisted_5$2)):createCommentVNode("",!0),H.type==="themeMode"&&!H.hidden?(openBlock(),createElementBlock("div",{key:4,"data-element":H.dataElement,class:"drop-item",onClick:D[0]||(D[0]=Y=>E("Light"))},[createVNode(O,null,{default:withCtx(()=>[createVNode(J)]),_:1}),createTextVNode(toDisplayString(T.$t("toolbar.themeSwitcher.lightMode")),1)],8,_hoisted_6$2)):createCommentVNode("",!0),H.type==="themeMode"&&!H.hidden?(openBlock(),createElementBlock("div",{key:5,"data-element":H.dataElement,class:"drop-item",onClick:D[1]||(D[1]=Y=>E("Dark"))},[createVNode(O,null,{default:withCtx(()=>[createVNode(te)]),_:1}),createTextVNode(toDisplayString(T.$t("toolbar.themeSwitcher.darkMode")),1)],8,_hoisted_7$2)):createCommentVNode("",!0)],64))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(e.rightItems,(H,Z)=>(openBlock(),createElementBlock(Fragment,{key:`${H.type}-${H.dataElement||Z}`},[H.type==="pageModeButton"&&!H.hidden?(openBlock(),createElementBlock("div",{key:0,"data-element":H.dataElement,class:"drop-item",onClick:M},[createVNode(O,null,{default:withCtx(()=>[createVNode(q)]),_:1}),createTextVNode(toDisplayString(T.$t("toolbar.viewControls.viewSetting")),1)],8,_hoisted_8$1)):createCommentVNode("",!0)],64))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(e.rightItems,(H,Z)=>(openBlock(),createElementBlock(Fragment,{key:`${H.type}-${H.dataElement||Z}`},[H.type==="settingButton"&&!H.hidden?(openBlock(),createElementBlock("div",{key:0,"data-element":H.dataElement,class:"drop-item",onClick:S},[createVNode(O,null,{default:withCtx(()=>[createVNode(re)]),_:1}),createTextVNode(toDisplayString(T.$t("toolbar.settings.title")),1)],8,_hoisted_9$1)):createCommentVNode("",!0),H.name==="customButton"&&H.dropItem&&!H.hidden?(openBlock(),createElementBlock("div",{key:1,"data-element":H.dataElement,class:"drop-item"},[createVNode(U,{item:H},null,8,["item"])],8,_hoisted_10$1)):createCommentVNode("",!0)],64))),128))])]),_:1},512)}}},__unplugin_components_14=_export_sfc(_sfc_main$o,[["__scopeId","data-v-ece5736d"]]),_sfc_main$n={},_hoisted_1$g={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$e=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.10986 13.9354C2.71178 11.5373 2.71178 7.64923 5.10986 5.25114C7.50795 2.85306 11.396 2.85306 13.7941 5.25114C16.1922 7.64923 16.1922 11.5373 13.7941 13.9354C11.396 16.3335 7.50795 16.3335 5.10986 13.9354ZM4.0492 4.19048C1.06533 7.17436 1.06533 12.0122 4.0492 14.996C6.85416 17.801 11.2974 17.9692 14.2988 15.5006L17.1989 18.4006C17.4918 18.6935 17.9666 18.6935 18.2595 18.4006C18.5524 18.1078 18.5524 17.6329 18.2595 17.34L15.3595 14.4399C17.8279 11.4385 17.6597 6.99539 14.8548 4.19048C11.8709 1.20661 7.03307 1.20661 4.0492 4.19048Z",fill:"currentColor"},null,-1),_hoisted_3$d=[_hoisted_2$e];function _sfc_render$c(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$g,_hoisted_3$d)}const __unplugin_components_0$1=_export_sfc(_sfc_main$n,[["render",_sfc_render$c]]),index_vue_vue_type_style_index_0_lang$1="",_hoisted_1$f={class:"search-container"},_sfc_main$m={__name:"index",props:["item"],setup(e){const n=useViewerStore(),o=computed(()=>n.getSearchStatus),r=computed(()=>n.getUpload),f=computed(()=>n.isElementOpen("leftPanel")),s=computed(()=>n.getActiveElementTab("leftPanel")),m=()=>{core.webViewerNamedAction("Find"),f.value&&s.value!=="SEARCH"?n.setSearchStatus(!0):f.value?(n.setSearchStatus(!1),n.toggleElement("leftPanel")):(n.setSearchStatus(!0),n.toggleElement("leftPanel")),n.setActiveElementTab("leftPanel","SEARCH")};return(w,g)=>{const v=__unplugin_components_0$1,d=_sfc_main$4m;return openBlock(),createElementBlock("div",_hoisted_1$f,[createVNode(d,mergeProps({id:"viewFind"},{...e.item},{isActive:o.value&&f.value,onClick:m,class:{disabled:!r.value},title:w.$t("toolbar.viewControls.search")}),{default:withCtx(()=>[createVNode(v)]),_:1},16,["isActive","class","title"])])}}},_sfc_main$l={},_hoisted_1$e={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$d=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.7463 7.94055L8.43134 3.20358C8.38986 2.6073 8.82031 2.08322 9.40947 2.01273L9.46546 2.00656C9.75502 1.97416 10.0451 2.06271 10.2681 2.25159C10.4911 2.44047 10.6276 2.71317 10.6457 3.00614L10.9886 8.17061C10.999 8.31659 11.1097 8.43516 11.2537 8.45444C11.3176 8.46288 11.382 8.44409 11.4315 8.40258C11.481 8.36108 11.5111 8.30063 11.5145 8.23584L11.7612 3.47595C11.7918 2.85998 12.3116 2.38523 12.923 2.41468H12.9309C13.5429 2.44972 14.0111 2.97745 13.9773 3.59407L13.7218 8.51438C13.7137 8.66679 13.8235 8.79975 13.9738 8.81936C14.1225 8.83876 14.2625 8.73915 14.2914 8.59018L14.8006 6.02337C14.9178 5.41517 15.497 5.01851 16.0954 5.13574L16.1041 5.13751C16.7058 5.25854 17.0969 5.84695 16.979 6.45353L16.3684 9.53687C15.8189 13.3474 15.0586 15.5052 14.3946 16.4246C13.3649 17.8508 11.5573 17.8667 10.1251 17.8667C8.69381 17.8667 7.16012 17.5291 6.44796 16.9993C5.73492 16.4696 4.77079 15.2575 4.15837 13.9327L4.16712 13.9283C4.11876 13.8639 4.0774 13.7945 4.04376 13.7212L3.105 11.685C2.84552 11.1243 3.08338 10.4577 3.63781 10.1918L3.64656 10.1874C3.91235 10.0626 4.21656 10.0497 4.49179 10.1517C4.76702 10.2536 4.99055 10.4619 5.11287 10.7304C5.62206 11.8234 5.94227 12.324 6.07526 12.2324C6.27386 12.0949 6.12075 11.7176 5.85478 9.21249C5.67578 7.53039 5.45319 5.85328 5.18724 4.18289C5.07653 3.5968 5.44002 3.02581 6.01489 2.88273L6.07526 2.86775C6.35866 2.79957 6.65742 2.85178 6.90147 3.01215C7.14552 3.17252 7.3134 3.42693 7.36572 3.71571L8.168 8.02341C8.19642 8.17613 8.33897 8.27937 8.49171 8.25787C8.64561 8.23564 8.75656 8.09774 8.7463 7.94143V7.94055Z",fill:"currentColor"},null,-1),_hoisted_3$c=[_hoisted_2$d];function _sfc_render$b(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$e,_hoisted_3$c)}const __unplugin_components_10=_export_sfc(_sfc_main$l,[["render",_sfc_render$b]]),_sfc_main$k={},_hoisted_1$d={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$c=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.33187 3.41643C4.74608 3.41643 5.08187 3.08064 5.08187 2.66643C5.08187 2.25221 4.74608 1.91643 4.33187 1.91643L1.66643 1.91643C1.25221 1.91643 0.916428 2.25221 0.916428 2.66643C0.916428 3.08064 1.25221 3.41643 1.66643 3.41643L2.35645 3.41643V3.8183L2.35645 15.3384V15.7404H1.66643C1.25221 15.7404 0.916428 16.0762 0.916428 16.4904C0.916428 16.9047 1.25221 17.2404 1.66643 17.2404H4.33187C4.74608 17.2404 5.08187 16.9047 5.08187 16.4904C5.08187 16.0762 4.74608 15.7404 4.33187 15.7404H3.85645V15.3384L3.85645 3.8183V3.41643H4.33187ZM7.30219 4.09613C7.10328 4.09613 6.91251 4.17515 6.77186 4.3158C6.63121 4.45645 6.55219 4.64722 6.55219 4.84613V12.8425C6.55219 13.1458 6.73492 13.4193 7.01518 13.5354C7.29543 13.6514 7.61802 13.5873 7.83252 13.3728L9.88684 11.3185L14.7821 16.2137C15.075 16.5066 15.5498 16.5066 15.8427 16.2137L18.6699 13.3866C18.8105 13.2459 18.8895 13.0551 18.8895 12.8562C18.8895 12.6573 18.8105 12.4665 18.6699 12.3259L13.7746 7.43067L15.8288 5.37646C16.0433 5.16196 16.1075 4.83937 15.9914 4.55912C15.8753 4.27886 15.6019 4.09613 15.2985 4.09613L7.30219 4.09613ZM9.35651 9.72747L8.05219 11.0318V5.59613L13.4879 5.59613L12.1836 6.90034C12.043 7.041 11.964 7.23176 11.964 7.43067C11.964 7.62959 12.043 7.82035 12.1836 7.961L17.0789 12.8562L15.3124 14.6227L10.4172 9.72747C10.1243 9.43458 9.64941 9.43458 9.35651 9.72747Z",fill:"currentColor"},null,-1),_hoisted_3$b=[_hoisted_2$c];function _sfc_render$a(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$d,_hoisted_3$b)}const __unplugin_components_9=_export_sfc(_sfc_main$k,[["render",_sfc_render$a]]),_sfc_main$j={},_hoisted_1$c={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$b=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.1142 2.47079H2V6.57766H6.1142V2.47079ZM18.0002 2.47076H13.886V6.57763H18.0002V2.47076ZM6.11436 13.4224H2.00016V17.5293H6.11436V13.4224ZM18.0002 13.4224H13.886V17.5293H18.0002V13.4224ZM9.08594 5.20866V3.8397H7.25741V5.20866H9.08594ZM12.743 5.20866V3.8397H10.9145V5.20866H12.743ZM4.74251 9.08729H3.3711V7.26201H4.74251V9.08729ZM4.74251 12.7379H3.3711V10.9126H4.74251V12.7379ZM15.2571 9.08734H16.6285V7.26206H15.2571V9.08734ZM15.2571 12.7379H16.6285V10.9126H15.2571V12.7379ZM9.08594 14.7913V16.1603H7.25741V14.7913H9.08594ZM12.743 14.7913V16.1603H10.9145V14.7913H12.743Z",fill:"currentColor"},null,-1),_hoisted_3$a=[_hoisted_2$b];function _sfc_render$9(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$c,_hoisted_3$a)}const __unplugin_components_8$1=_export_sfc(_sfc_main$j,[["render",_sfc_render$9]]),_sfc_main$i={__name:"ViewRotationControls",setup(e){const n=()=>{core.rotateCounterclockwise()},o=()=>{core.rotateClockwise()};return(r,f)=>{const s=_sfc_main$4m;return openBlock(),createElementBlock(Fragment,null,[createVNode(s,{img:"icon-header-counter-clockwise",title:"Rotate Counterclockwise",onClick:n}),createVNode(s,{img:"icon-header-clockwise",title:"Rotate Clockwise",onClick:o})],64)}}},_sfc_main$h={__name:"CropPageButton",props:["item","popoverTool"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,r=useViewerStore(),f=useDocumentStore(),{item:s,popoverTool:m}=e,w=computed(()=>f.getActiveTool),g=()=>{m&&m[0].setShow(!1),f.setToolState(w.value==="cropPage"?"":"cropPage"),w.value==="cropPage"&&(r.resetPanels(),r.setActiveToolMode("view")),n(0),o(0),r.closeActiveStickNote(),r.setSearchStatus(!1),r.toggleActiveHand(!1)};return(v,d)=>{const u=__unplugin_components_8$1,y=_sfc_main$4m;return openBlock(),createBlock(y,mergeProps({isActive:w.value==="cropPage"&&!unref(isMobileDevice)},{...e.item},{onClick:g,title:v.$t("toolbar.viewControls.cropPage")}),{default:withCtx(()=>[createVNode(u)]),_:1},16,["isActive","title"])}}},_sfc_main$g={__name:"HandButton",props:["item","popoverTool"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,r=useViewerStore(),f=useDocumentStore(),{item:s,popoverTool:m}=e,w=computed(()=>r.getActiveHand),g=()=>{m&&m[0].setShow(!1),window.getSelection().empty(),r.toggleActiveHand(!w.value);const v=w.value?1:0;n(v),o(0),r.closeActiveStickNote(),core.webViewerNamedAction("Find",4),f.setToolState(""),r.setSearchStatus(!1)};return(v,d)=>{const u=__unplugin_components_10,y=_sfc_main$4m;return openBlock(),createBlock(y,mergeProps({isActive:w.value&&!unref(isMobileDevice),img:"icon-hand-tool"},{...e.item},{onClick:g,title:v.$t("toolbar.viewControls.pan")}),{default:withCtx(()=>[createVNode(u)]),_:1},16,["isActive","title"])}}},_sfc_main$f={},_hoisted_1$b={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$a=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.5 3.5H16.5V16.5H3.5V3.5ZM2 2H3.5H16.5H18V3.5V16.5V18H16.5H3.5H2V16.5V3.5V2ZM14.2461 14.9961H11.6868V13.4961H13.4961V11.6893H14.9961V14.2461V14.9961H14.2461ZM13.4961 6.5H11.6868V5H14.2461H14.9961V5.75V8.3078H13.4961V6.5ZM6.5 6.5H8.30664V5H5.75H5V5.75V8.3078H6.5V6.5ZM5.75 14.9961H8.30664V13.4961H6.5V11.6893H5V14.2461V14.9961H5.75Z",fill:"currentColor"},null,-1),_hoisted_3$9=[_hoisted_2$a];function _sfc_render$8(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$b,_hoisted_3$9)}const __unplugin_components_0=_export_sfc(_sfc_main$f,[["render",_sfc_render$8]]),FullScreenButton_vue_vue_type_style_index_0_lang="",_sfc_main$e={__name:"FullScreenButton",props:["item"],setup(e){const{requestFullScreenMode:n}=core,o=useViewerStore(),r=useDocumentStore(),f=computed(()=>o.isElementOpen("leftPanel"));core.addEvent("presentationmodechanged",({state:m})=>{m===1?o.setFullMode(!1):m===3&&o.setFullMode(!0)});const s=()=>{const m=navigator.userAgent.match(/(iPad)/)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;f.value&&(window.innerWidth<930||m)&&o.toggleElement("leftPanel");const w=document.getElementById("sign-image-save");w&&w.remove(),n(),r.setToolState("")};return(m,w)=>{const g=__unplugin_components_0,v=_sfc_main$4m;return openBlock(),createBlock(v,mergeProps({img:"icon-full-screen",className:"full-screen"},{...e.item},{onClick:s,title:m.$t("toolbar.viewControls.fullScreen")}),{default:withCtx(()=>[createVNode(g)]),_:1},16,["title"])}}},_sfc_main$d={};function _sfc_render$7(e,n){return openBlock(),createElementBlock("div")}const __unplugin_components_2$1=_export_sfc(_sfc_main$d,[["render",_sfc_render$7]]),_sfc_main$c={},_hoisted_1$a={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$9=createBaseVNode("rect",{x:"2",y:"8",width:"6",height:"9",fill:"#999999"},null,-1),_hoisted_3$8=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.5 3.5H2.5V7.25H8H17.5V3.5ZM7.25 8.75H2.5V16.5H7.25V8.75ZM8.75 16.5V8.75H17.5V16.5H8.75ZM2.5 2H1V3.5V16.5V18H2.5H17.5H19V16.5V3.5V2H17.5H2.5Z",fill:"currentColor"},null,-1),_hoisted_4$2=[_hoisted_2$9,_hoisted_3$8];function _sfc_render$6(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$a,_hoisted_4$2)}const __unplugin_components_8=_export_sfc(_sfc_main$c,[["render",_sfc_render$6]]),_sfc_main$b={},_hoisted_1$9={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$8=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.11004 13.9353C2.71196 11.5372 2.71196 7.64917 5.11004 5.25108C7.50813 2.853 11.3962 2.853 13.7943 5.25108C16.1924 7.64917 16.1924 11.5372 13.7943 13.9353C11.3962 16.3334 7.50813 16.3334 5.11004 13.9353ZM4.04938 4.19042C1.06551 7.17429 1.06551 12.0121 4.04938 14.996C6.85434 17.8009 11.2976 17.9691 14.299 15.5005L17.1991 18.4006C17.4919 18.6935 17.9668 18.6935 18.2597 18.4006C18.5526 18.1077 18.5526 17.6328 18.2597 17.3399L15.3596 14.4399C17.8281 11.4384 17.6598 6.99532 14.8549 4.19042C11.8711 1.20655 7.03325 1.20655 4.04938 4.19042Z",fill:"currentColor"},null,-1),_hoisted_3$7=[_hoisted_2$8];function _sfc_render$5(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$9,_hoisted_3$7)}const __unplugin_components_7=_export_sfc(_sfc_main$b,[["render",_sfc_render$5]]),_sfc_main$a={},_hoisted_1$8={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$7=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.0663 1.73124C11.8457 1.51066 11.4792 1.54371 11.3017 1.80019L8.50221 5.84387C8.47541 5.88258 8.43581 5.9106 8.39039 5.92299L4.70212 6.92888C4.62329 6.95038 4.56548 7.01679 4.55485 7.0978C4.49741 7.53536 4.28835 8.98634 3.86452 10.5C3.50509 11.7837 2.41361 14.2634 1.80715 15.6014C1.43791 15.4319 0.986657 15.4992 0.682542 15.8033C0.292017 16.1938 0.292017 16.827 0.682542 17.2175C1.07307 17.6081 1.70623 17.6081 2.09676 17.2175C2.40731 16.907 2.4709 16.443 2.28754 16.0696C3.47428 15.503 5.62248 14.5333 7.40006 14.0355C9.40855 13.4732 10.4209 13.3576 10.7798 13.3342C10.8716 13.3282 10.9526 13.266 10.9768 13.1773L11.9771 9.50966C11.9895 9.46424 12.0175 9.42465 12.0562 9.39785L16.0999 6.59838C16.3563 6.42081 16.3894 6.05431 16.1688 5.83373L12.0663 1.73124ZM7.84432 8.82278C7.79831 8.77678 7.72133 8.78626 7.68786 8.84204L5.83823 11.9248C5.78467 12.014 5.88616 12.1155 5.97543 12.062L9.05814 10.2123C9.11392 10.1789 9.1234 10.1019 9.0774 10.0559L7.84432 8.82278ZM15.5271 16.5933C15.4522 16.5981 15.3767 16.6005 15.3006 16.6005C15.2254 16.6005 15.1508 16.5982 15.0768 16.5935L13.531 19.2708C13.4525 19.4067 13.2553 19.4035 13.1814 19.2651L12.5771 18.1343C12.5412 18.0671 12.4703 18.0261 12.3942 18.0286L11.1127 18.0707C10.9559 18.0759 10.8545 17.9067 10.9329 17.7708L12.4536 15.1369C12.0425 14.5632 11.8006 13.8601 11.8006 13.1005C11.8006 11.1675 13.3676 9.60052 15.3006 9.60052C17.2336 9.60052 18.8006 11.1675 18.8006 13.1005C18.8006 13.8592 18.5592 14.5614 18.1491 15.1347L19.671 17.7708C19.7495 17.9067 19.6481 18.0759 19.4912 18.0707L18.2098 18.0286C18.1336 18.0261 18.0627 18.0671 18.0268 18.1343L17.4225 19.2651C17.3486 19.4035 17.1514 19.4067 17.0729 19.2708L15.5271 16.5933Z",fill:"currentColor"},null,-1),_hoisted_3$6=[_hoisted_2$7];function _sfc_render$4(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$8,_hoisted_3$6)}const __unplugin_components_6=_export_sfc(_sfc_main$a,[["render",_sfc_render$4]]),_sfc_main$9={},_hoisted_1$7={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$6=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.5 3.5H13.3V13.3H3.5V3.5ZM2 2H3.5H13.3H14.8V3.5V5.2H16.5H18V6.7V16.5V18H16.5H6.7H5.2V16.5V14.8H3.5H2V13.3V3.5V2ZM6.7 14.8V16.5H16.5V6.7H14.8V13.3V14.8H13.3H6.7Z",fill:"currentColor"},null,-1),_hoisted_3$5=[_hoisted_2$6];function _sfc_render$3(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$7,_hoisted_3$5)}const __unplugin_components_5=_export_sfc(_sfc_main$9,[["render",_sfc_render$3]]),_sfc_main$8={},_hoisted_1$6={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$5=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20 1.25H2L0 18.75H18L20 1.25ZM10.4361 3.51788L15.0866 15.1442H16.5866V16.3942H12.7404V15.1442H13.7403L12.798 12.7885H6.91309L5.9711 15.1442H6.97115V16.3942H3.125V15.1442H4.62492L9.27547 3.51788H10.4361ZM9.85499 5.43124L12.298 11.5385H7.41292L9.85499 5.43124Z",fill:"currentColor"},null,-1),_hoisted_3$4=[_hoisted_2$5];function _sfc_render$2(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$6,_hoisted_3$4)}const __unplugin_components_4=_export_sfc(_sfc_main$8,[["render",_sfc_render$2]]),_sfc_main$7={},_hoisted_1$5={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$4=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 1.875H1.25V5.625H5V1.875ZM5 8.125H1.25V11.875H5V8.125ZM1.25 14.375H5V18.125H1.25V14.375ZM18.75 4.6875V2.8125H7.5V4.6875H18.75ZM18.75 9.0625V10.9375H7.5V9.0625H18.75ZM18.75 17.1875V15.3125H7.5V17.1875H18.75Z",fill:"currentColor"},null,-1),_hoisted_3$3=[_hoisted_2$4];function _sfc_render$1(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$5,_hoisted_3$3)}const __unplugin_components_3=_export_sfc(_sfc_main$7,[["render",_sfc_render$1]]),_sfc_main$6={},_hoisted_1$4={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$3=createBaseVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.4375 1.4375H2.6875V2.1875V17.8125V18.5625H3.4375H16.5612H17.3112V17.8125V10V7.07031V6.77538L17.1103 6.55944L12.5675 1.67663L12.345 1.4375H12.0184H9.99936H3.4375ZM4.1875 17.0625V2.9375H9.99936H10.5V7.5V8.25H11.25H15.8112V10V17.0625H4.1875ZM15.2388 6.75L12 3.2688V6.75H15.2388Z",fill:"currentColor"},null,-1),_hoisted_3$2=[_hoisted_2$3];function _sfc_render(e,n){return openBlock(),createElementBlock("svg",_hoisted_1$4,_hoisted_3$2)}const __unplugin_components_2=_export_sfc(_sfc_main$6,[["render",_sfc_render]]),_sfc_main$5={__name:"LeftPanelTabs",props:["activePanelTab","popover"],setup(e){const n=useViewerStore(),{popover:o}=e,r=computed(()=>n.isElementOpen("leftPanel")),f=computed(()=>n.getActiveElementTab("leftPanel")),s=computed(()=>n.getDisabledElements("thumbnails")),m=computed(()=>n.getDisabledElements("outlines")),w=computed(()=>n.getDisabledElements("annotation")),g=computed(()=>n.getDisabledElements("layers")),v=computed(()=>n.getDisabledElements("signature")),d=computed(()=>n.getDisabledElements("search")),u=y=>{o&&o.setShow(!1),r.value||n.openElement("leftPanel"),y!==f.value&&(n.setActiveElementTab("leftPanel",y),y==="SEARCH"?(core.webViewerNamedAction("FindOpen"),n.setSearchStatus(!0)):(core.clearSearchResults(),n.setSearchStatus(!1)))};return(y,x)=>{const k=__unplugin_components_2,P=__unplugin_components_3,S=__unplugin_components_4,E=__unplugin_components_5,M=__unplugin_components_6,T=__unplugin_components_7;return openBlock(),createElementBlock(Fragment,null,[s.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["drop-item",{active:f.value==="THUMBS"}]),"data-element":"THUMBS",onClick:x[0]||(x[0]=D=>u("THUMBS"))},[createVNode(k),createTextVNode(toDisplayString(y.$t("panels.left.thumbnails")),1)],2)),m.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(["drop-item",{active:f.value==="OUTLINE"}]),"data-element":"OUTLINE",onClick:x[1]||(x[1]=D=>u("OUTLINE"))},[createVNode(P),createTextVNode(toDisplayString(y.$t("panels.left.outlines.title")),1)],2)),w.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(["drop-item",{active:f.value==="ANNOTATION"}]),"data-element":"ANNOTATION",onClick:x[2]||(x[2]=D=>u("ANNOTATION"))},[createVNode(S),createTextVNode(toDisplayString(y.$t("panels.left.annotations.title")),1)],2)),g.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:3,class:normalizeClass(["drop-item",{active:f.value==="LAYER"}]),"data-element":"LAYER",onClick:x[3]||(x[3]=D=>u("LAYER"))},[createVNode(E),createTextVNode(toDisplayString(y.$t("panels.left.layers.title")),1)],2)),r.value&&f.value==="COMPARISON"?(openBlock(),createElementBlock("div",{key:4,class:normalizeClass(["drop-item",{active:f.value==="COMPARISON"}]),"data-element":"COMPARISON",onClick:x[4]||(x[4]=D=>u("COMPARISON"))},[createVNode(k),createTextVNode("Compare")],2)):createCommentVNode("",!0),v.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:5,"data-element":"SIGNATURE",class:normalizeClass(["drop-item",{active:f.value==="SIGNATURE"}]),onClick:x[5]||(x[5]=D=>u("SIGNATURE"))},[createVNode(M),createTextVNode(toDisplayString(y.$t("panels.left.signatures.title")),1)],2)),d.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:6,"data-element":"SEARCH",class:normalizeClass(["drop-item",{active:f.value==="SEARCH"}]),onClick:x[6]||(x[6]=D=>u("SEARCH"))},[createVNode(T),createTextVNode(toDisplayString(y.$t("panels.left.search.title")),1)],2))],64)}}},ToggleElementButton_vue_vue_type_style_index_0_lang="",_hoisted_1$3=["title"],_hoisted_2$2={class:"drop-down medium left-panel-button-popover"},_sfc_main$4={__name:"ToggleElementButton",props:["item"],setup(e){const n=useViewerStore(),{item:o}=e,r=computed(()=>n.isElementOpen(o.element)),f=computed(()=>n.getActiveElementTab("leftPanel")),s=computed(()=>n.getPopoverChanged),m=computed(()=>n.getDisabledElements("thumbnails")),w=computed(()=>n.getDisabledElements("outlines")),g=computed(()=>n.getDisabledElements("annotation")),v=computed(()=>n.getDisabledElements("layers")),d=computed(()=>n.getDisabledElements("signature")),u=computed(()=>n.getDisabledElements("search")),y=computed(()=>!m.value||!w.value||!g.value||!v.value||!d.value||!u.value),x=S=>{S.stopPropagation()},k=ref(null),P=()=>{f.value==="SEARCH"&&core.webViewerNamedAction("Find"),n.toggleElement(o.element)};return watch(()=>s.value,(S,E)=>{S&&(k.value.setShow(!1),n.setPopoverChanged(!1))}),(S,E)=>{const M=__unplugin_components_11$1,T=_sfc_main$5,D=__unplugin_components_2,N=__unplugin_components_3,F=__unplugin_components_4,O=__unplugin_components_5,I=__unplugin_components_6,X=__unplugin_components_7,ne=__unplugin_components_8,ye=_sfc_main$4m;return openBlock(),createElementBlock("div",{title:S.$t("toolbar.viewControls.leftPanel"),class:normalizeClass(["left-panel-button toggle-button",{active:r.value}]),onClick:P},[createVNode(unref(NPopover),{ref_key:"popover",ref:k,placement:"top-start",trigger:"click","show-arrow":!1,to:"#outerContainer",raw:!0,"z-index":4},{trigger:withCtx(()=>[createBaseVNode("div",{class:"arrow-container",onClick:x},[withDirectives(createVNode(M,{class:"arrow"},null,512),[[vShow,y.value]])])]),default:withCtx(()=>[createBaseVNode("div",_hoisted_2$2,[createVNode(T,{activePanelTab:f.value,popover:k.value},null,8,["activePanelTab","popover"])])]),_:1},512),createVNode(ye,{isActive:r.value},{default:withCtx(()=>[f.value==="THUMBS"?(openBlock(),createBlock(D,{key:0})):f.value==="OUTLINE"?(openBlock(),createBlock(N,{key:1})):f.value==="ANNOTATION"?(openBlock(),createBlock(F,{key:2})):f.value==="LAYER"?(openBlock(),createBlock(O,{key:3})):f.value==="SIGNATURE"?(openBlock(),createBlock(I,{key:4})):f.value==="SEARCH"?(openBlock(),createBlock(X,{key:5})):(openBlock(),createBlock(ne,{key:6}))]),_:1},8,["isActive"])],10,_hoisted_1$3)}}},HeaderItems_vue_vue_type_style_index_0_lang="",_hoisted_1$2=["data-element"],_hoisted_2$1={class:"drop-down narrower hand-tools"},_hoisted_3$1={class:"drop-menu"},_hoisted_4$1={class:"drop-down narrower"},_hoisted_5$1=["data-element"],_hoisted_6$1=["data-element"],_hoisted_7$1=["data-element"],_hoisted_8=["data-element"],_hoisted_9=["data-element"],_hoisted_10=["data-element"],_hoisted_11=["data-element"],_hoisted_12=["data-element"],_hoisted_13=["data-element"],_hoisted_14=["data-element"],_hoisted_15=["data-element"],_hoisted_16={key:0,class:"tool-menu"},_hoisted_17=["data-element"],_hoisted_18=["data-element"],_hoisted_19=["data-element"],_hoisted_20=["data-element"],_hoisted_21=["data-element"],_hoisted_22=["data-element"],_hoisted_23=["data-element"],_hoisted_24=["data-element"],_hoisted_25=["data-element"],_hoisted_26=["data-element"],_hoisted_27=["data-element"],_hoisted_28={class:"right-container"},_hoisted_29={key:1,class:"header-items"},_hoisted_30=createBaseVNode("div",{class:"divider"},null,-1),_hoisted_31={class:"right-container"},_sfc_main$3={__name:"HeaderItems",props:["items","rightItems","toolMode"],setup(e){const{switchTool:n,switchAnnotationEditorMode:o}=core,f=getCurrentInstance().appContext.app.config.globalProperties.$t,s=e,m=useViewerStore(),w=useDocumentStore(),g=computed(()=>m.getCompareStatus),v=computed(()=>m.getUpload&&m.getVerified&&!m.getUploadLoading),d=computed(()=>m.getTools);let u=computed(()=>{const D={view:f("toolbar.toolbarGroup.viewer"),form:f("toolbar.toolbarGroup.forms"),annotation:f("toolbar.toolbarGroup.annotations"),sign:f("toolbar.toolbarGroup.signatures"),security:f("toolbar.toolbarGroup.security"),redaction:f("toolbar.toolbarGroup.redaction"),compare:f("toolbar.toolbarGroup.compare"),editor:f("toolbar.toolbarGroup.editor"),document:f("toolbar.toolbarGroup.documentEditor"),separation:f("toolbar.toolbarGroup.separation"),measurement:f("toolbar.toolbarGroup.measurement")};return D[s.toolMode]?D[s.toolMode]:""});const y=computed(()=>m.getWebviewerMode),x=computed(()=>w.getActiveTool),k=computed(()=>w.getDisableDigitalSignature),P=ref(null),S=ref(null),E=D=>{if(y.value!=="Standalone"&&["editor","document"].includes(D)){D==="editor"?m.openElement("contentEditorPreventDialog"):m.openElement("docEditorPreventDialog");return}if(D==="sign"&&!k&&window.$message.info(f("signatures.tip"),{duration:3e3,showIcon:!1}),isMobileDevice&&["separation","measurement"].includes(D)){P.value.setShow(!1),m.openElement("unsupportedMobileDialog");return}m.setActiveToolMode(D),w.setToolState(""),m.toggleActiveHand(!1),n(0),o(0),P.value.setShow(!1),(D==="compare"||D==="document")&&m.resetPanels()},M=()=>{S.value[0].setShow(!1),w.setToolState("selectText"),n(0),o(0),m.closeActiveStickNote(),m.setSearchStatus(!1),m.toggleActiveHand(!1)},T=D=>!D.length||D.length&&D.every(N=>N.hidden);return(D,N)=>{const F=_sfc_main$2A,O=_sfc_main$4,I=__unplugin_components_2$1,X=_sfc_main$e,ne=_sfc_main$g,ye=_sfc_main$h,J=_sfc_main$2$,te=_sfc_main$i,q=__unplugin_components_8$1,re=__unplugin_components_9,U=__unplugin_components_10,H=__unplugin_components_11$1,Z=_sfc_main$4m,Y=_sfc_main$m,W=__unplugin_components_14,Q=_sfc_main$x,oe=_sfc_main$y,Ce=_sfc_main$z,Se=_sfc_main$B;return e.toolMode!=="compare"&&e.toolMode!=="document"?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["header-items",{mobile:unref(isMobileDevice)}])},[unref(isMobileDevice)?(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(e.items,(fe,Pe)=>(openBlock(),createElementBlock(Fragment,{key:`${fe.type}-${fe.dataElement||Pe}-mobile`},[fe.name==="customButton"&&!fe.hidden&&!fe.dropItem?(openBlock(),createBlock(F,{key:0,item:fe},null,8,["item"])):fe.type==="toggleElementButton"&&!fe.hidden?(openBlock(),createBlock(O,{key:1,item:fe,class:normalizeClass({disabled:!v.value}),"data-element":fe.dataElement},null,8,["item","class","data-element"])):fe.type==="selectTools"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(["hand-tools",{"events-none":!v.value}]),"data-element":fe.dataElement},[createVNode(unref(NPopover),{ref_for:!0,ref_key:"popoverTool",ref:S,placement:"bottom",trigger:"click","show-arrow":!1,to:"#outerContainer",raw:!0},{trigger:withCtx(()=>[createVNode(Z,{class:normalizeClass(["drop-menu",{disabled:!v.value}])},{default:withCtx(()=>[x.value==="cropPage"?(openBlock(),createBlock(q,{key:0})):["selectText","highlight","underline","squiggly","strikeout"].includes(x.value)?(openBlock(),createBlock(re,{key:1})):(openBlock(),createBlock(U,{key:2})),createVNode(H)]),_:1},8,["class"])]),default:withCtx(()=>[createBaseVNode("div",_hoisted_2$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.items,(Ae,Te)=>(openBlock(),createElementBlock(Fragment,{key:`${Ae.type}-${Ae.dataElement||Te}`},[Ae.type==="handToolButton"&&!Ae.hidden?(openBlock(),createBlock(ne,{key:0,item:Ae,"data-element":Ae.dataElement,popoverTool:S.value},null,8,["item","data-element","popoverTool"])):Ae.type==="cropPageButton"&&!Ae.hidden?(openBlock(),createBlock(ye,{key:1,item:Ae,"data-element":Ae.dataElement,popoverTool:S.value},null,8,["item","data-element","popoverTool"])):Ae.type==="selectTools"&&!Ae.hidden?(openBlock(),createBlock(Z,{key:2,"data-element":Ae.dataElement,onClick:M},{default:withCtx(()=>[createVNode(re)]),_:2},1032,["data-element"])):createCommentVNode("",!0)],64))),128))])]),_:2},1536)],10,_hoisted_1$2)):createCommentVNode("",!0)],64))),128)):(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(e.items,(fe,Pe)=>(openBlock(),createElementBlock(Fragment,{key:`${fe.type}-${fe.dataElement||Pe}`},[fe.name==="customButton"&&!fe.hidden&&!fe.dropItem?(openBlock(),createBlock(F,{key:0,item:fe},null,8,["item"])):fe.type==="toggleElementButton"&&!fe.hidden?(openBlock(),createBlock(O,{key:1,item:fe,class:normalizeClass({disabled:!v.value}),"data-element":fe.dataElement},null,8,["item","class","data-element"])):fe.type==="toolButton"&&!fe.hidden?(openBlock(),createBlock(I,{key:2,item:fe,"data-element":fe.dataElement},null,8,["item","data-element"])):fe.type==="fullScreenButton"&&!fe.hidden?(openBlock(),createBlock(X,{key:3,item:fe,class:normalizeClass({disabled:!v.value}),"data-element":fe.dataElement},null,8,["item","class","data-element"])):fe.type==="handToolButton"&&!fe.hidden?(openBlock(),createBlock(ne,{key:4,item:fe,class:normalizeClass({disabled:!v.value}),"data-element":fe.dataElement},null,8,["item","class","data-element"])):fe.type==="cropPageButton"&&!fe.hidden?(openBlock(),createBlock(ye,{key:5,item:fe,class:normalizeClass({disabled:!v.value}),"data-element":fe.dataElement},null,8,["item","class","data-element"])):fe.type==="zoomOverlay"&&!fe.hidden?(openBlock(),createBlock(J,{key:6,"data-element":fe.dataElement},null,8,["data-element"])):fe.type==="viewRotationControls"&&!fe.hidden?(openBlock(),createBlock(te,{key:7,"data-element":fe.dataElement},null,8,["data-element"])):["spacer","divider"].includes(fe.type)?(openBlock(),createElementBlock("div",{key:8,class:normalizeClass(fe.type)},null,2)):createCommentVNode("",!0)],64))),128)),createBaseVNode("div",{class:normalizeClass(["tool-container mobile",{"events-none":!v.value}])},[T(d.value)?createCommentVNode("",!0):(openBlock(),createBlock(unref(NPopover),{key:0,ref_key:"popoverMode",ref:P,placement:"bottom",trigger:"click","show-arrow":!1,to:"#outerContainer",raw:!0},{trigger:withCtx(()=>[createBaseVNode("div",_hoisted_3$1,[createBaseVNode("span",null,toDisplayString(unref(u)),1),createVNode(H,{class:"arrow-left"})])]),default:withCtx(()=>[createBaseVNode("div",_hoisted_4$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(d.value,(fe,Pe)=>(openBlock(),createElementBlock(Fragment,{key:`${fe.dataElement||Pe}`},[fe.element==="view"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:0,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="view"}]),onClick:N[0]||(N[0]=Ae=>E("view"))},toDisplayString(unref(f)("toolbar.toolbarGroup.viewer")),11,_hoisted_5$1)):fe.element==="annotation"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:1,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="annotation"}]),onClick:N[1]||(N[1]=Ae=>E("annotation"))},toDisplayString(unref(f)("toolbar.toolbarGroup.annotations")),11,_hoisted_6$1)):fe.element==="form"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:2,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="form"}]),onClick:N[2]||(N[2]=Ae=>E("form"))},toDisplayString(unref(f)("toolbar.toolbarGroup.forms")),11,_hoisted_7$1)):fe.element==="sign"&&!fe.hidden&&y.value==="Standalone"?(openBlock(),createElementBlock("div",{key:3,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="sign"}]),onClick:N[3]||(N[3]=Ae=>E("sign"))},toDisplayString(unref(f)("toolbar.toolbarGroup.signatures")),11,_hoisted_8)):fe.element==="security"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:4,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="security"}]),onClick:N[4]||(N[4]=Ae=>E("security"))},toDisplayString(unref(f)("toolbar.toolbarGroup.security")),11,_hoisted_9)):fe.element==="redaction"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:5,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="redaction"}]),onClick:N[5]||(N[5]=Ae=>E("redaction"))},toDisplayString(unref(f)("toolbar.toolbarGroup.redaction")),11,_hoisted_10)):fe.element==="compare"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:6,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="compare"}]),onClick:N[6]||(N[6]=Ae=>E("compare"))},toDisplayString(unref(f)("toolbar.toolbarGroup.compare")),11,_hoisted_11)):fe.element==="editor"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:7,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="editor"}]),onClick:N[7]||(N[7]=Ae=>E("editor"))},toDisplayString(unref(f)("toolbar.toolbarGroup.editor")),11,_hoisted_12)):fe.element==="document"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:8,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="document"}]),onClick:N[8]||(N[8]=Ae=>E("document"))},toDisplayString(unref(f)("toolbar.toolbarGroup.documentEditor")),11,_hoisted_13)):fe.element==="separation"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:9,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="separation"}]),onClick:N[9]||(N[9]=Ae=>E("separation"))},toDisplayString(unref(f)("toolbar.toolbarGroup.separation")),11,_hoisted_14)):fe.element==="measurement"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:10,"data-element":fe.dataElement,class:normalizeClass(["drop-item",{active:e.toolMode==="measurement"}]),onClick:N[10]||(N[10]=Ae=>E("measurement"))},toDisplayString(unref(f)("toolbar.toolbarGroup.measurement")),11,_hoisted_15)):createCommentVNode("",!0)],64))),128))])]),_:1},512))],2),createBaseVNode("div",{class:normalizeClass(["tool-container pc",{"events-none":!v.value}])},[T(d.value)?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_16,[(openBlock(!0),createElementBlock(Fragment,null,renderList(d.value,(fe,Pe)=>(openBlock(),createElementBlock(Fragment,{key:`${fe.dataElement||Pe}`},[fe.element==="view"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:0,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="view"}]),onClick:N[11]||(N[11]=Ae=>E("view"))},toDisplayString(unref(f)("toolbar.toolbarGroup.viewer")),11,_hoisted_17)):fe.element==="annotation"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:1,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="annotation"}]),onClick:N[12]||(N[12]=Ae=>E("annotation"))},toDisplayString(unref(f)("toolbar.toolbarGroup.annotations")),11,_hoisted_18)):fe.element==="form"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:2,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="form"}]),onClick:N[13]||(N[13]=Ae=>E("form"))},toDisplayString(unref(f)("toolbar.toolbarGroup.forms")),11,_hoisted_19)):fe.element==="sign"&&!fe.hidden&&y.value==="Standalone"?(openBlock(),createElementBlock("div",{key:3,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="sign"}]),onClick:N[14]||(N[14]=Ae=>E("sign"))},toDisplayString(unref(f)("toolbar.toolbarGroup.signatures")),11,_hoisted_20)):fe.element==="security"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:4,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="security"}]),onClick:N[15]||(N[15]=Ae=>E("security"))},toDisplayString(unref(f)("toolbar.toolbarGroup.security")),11,_hoisted_21)):fe.element==="redaction"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:5,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="redaction"}]),onClick:N[16]||(N[16]=Ae=>E("redaction"))},toDisplayString(unref(f)("toolbar.toolbarGroup.redaction")),11,_hoisted_22)):fe.element==="compare"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:6,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="compare"}]),onClick:N[17]||(N[17]=Ae=>E("compare"))},toDisplayString(unref(f)("toolbar.toolbarGroup.compare")),11,_hoisted_23)):fe.element==="editor"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:7,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="editor"}]),onClick:N[18]||(N[18]=Ae=>E("editor"))},toDisplayString(unref(f)("toolbar.toolbarGroup.editor")),11,_hoisted_24)):fe.element==="document"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:8,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="document"}]),onClick:N[19]||(N[19]=Ae=>E("document"))},toDisplayString(unref(f)("toolbar.toolbarGroup.documentEditor")),11,_hoisted_25)):fe.element==="separation"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:9,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="separation"}]),onClick:N[20]||(N[20]=Ae=>E("separation"))},toDisplayString(unref(f)("toolbar.toolbarGroup.separation")),11,_hoisted_26)):fe.element==="measurement"&&!fe.hidden?(openBlock(),createElementBlock("div",{key:10,"data-element":fe.dataElement,class:normalizeClass(["item",{active:e.toolMode==="measurement"}]),onClick:N[21]||(N[21]=Ae=>E("measurement"))},toDisplayString(unref(f)("toolbar.toolbarGroup.measurement")),11,_hoisted_27)):createCommentVNode("",!0)],64))),128))]))],2),createBaseVNode("div",_hoisted_28,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.rightItems,(fe,Pe)=>(openBlock(),createElementBlock(Fragment,{key:`${fe.type}-${fe.dataElement||Pe}`},[fe.name==="customButton"&&!fe.hidden&&!fe.dropItem?(openBlock(),createBlock(F,{key:0,item:fe,"data-element":fe.dataElement},null,8,["item","data-element"])):fe.type==="searchButton"&&!fe.hidden?(openBlock(),createBlock(Y,{key:1,item:fe,"data-element":fe.dataElement},null,8,["item","data-element"])):["spacer","divider"].includes(fe.type)?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(fe.type)},null,2)):createCommentVNode("",!0)],64))),128)),createVNode(W,{rightItems:e.rightItems},null,8,["rightItems"])])],2)):e.toolMode==="compare"?(openBlock(),createElementBlock("div",_hoisted_29,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.items,(fe,Pe)=>(openBlock(),createElementBlock(Fragment,{key:`${fe.type}-${fe.dataElement||Pe}`},[fe.type==="fullScreenButton"&&!fe.hidden?(openBlock(),createBlock(X,{key:0,item:fe,class:normalizeClass({disabled:g.value!=="finished"}),"data-element":fe.dataElement},null,8,["item","class","data-element"])):createCommentVNode("",!0)],64))),128)),_hoisted_30,createVNode(Q),createBaseVNode("div",_hoisted_31,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.rightItems,(fe,Pe)=>(openBlock(),createElementBlock(Fragment,{key:`${fe.type}-${fe.dataElement||Pe}`},[fe.type==="downloadButton"&&!fe.hidden?(openBlock(),createBlock(oe,{key:0,item:fe,class:normalizeClass({disabled:g.value!=="finished"&&g.value!=="next"}),"data-element":fe.dataElement},null,8,["item","class","data-element"])):createCommentVNode("",!0),fe.type==="printButton"&&!fe.hidden?(openBlock(),createBlock(Ce,{key:1,item:fe,class:normalizeClass({disabled:g.value!=="finished"&&g.value!=="next"}),"data-element":fe.dataElement},null,8,["item","class","data-element"])):createCommentVNode("",!0)],64))),128))])])):e.toolMode==="document"?(openBlock(),createBlock(Se,{key:2})):createCommentVNode("",!0)}}},Header_vue_vue_type_style_index_0_lang="",_hoisted_1$1={key:1,class:"click-tip"},_sfc_main$2={__name:"Header",setup(e){const n=useViewerStore(),o=useDocumentStore(),r=n.getActiveHeaderItems,f=n.getActiveRightHeaderItems,s=computed(()=>n.getToolMode),m=computed(()=>n.getSignatureVerify),w=computed(()=>n.getDisabledHeader),g=computed(()=>o.getActiveTool),v=computed(()=>n.isShowCompareTip),d=computed(()=>n.getCompareStatus),u=computed(()=>o.getCompareFile("oldFile")&&o.getCompareFile("newFile")&&d.value!=="finished");return(y,x)=>{const k=_sfc_main$3,P=__unplugin_components_1,S=__unplugin_components_2$7,E=_sfc_main$13;return openBlock(),createElementBlock(Fragment,null,[createBaseVNode("div",{class:normalizeClass(["header",{disabled:w.value||["redaction","remove"].includes(g.value)}]),"data-element":"header"},[createVNode(k,{items:unref(r),rightItems:unref(f),toolMode:s.value},null,8,["items","rightItems","toolMode"])],2),createVNode(P),m.value&&s.value==="sign"?(openBlock(),createBlock(S,{key:0})):createCommentVNode("",!0),withDirectives(createVNode(E,null,null,512),[[vShow,["redaction","remove"].includes(g.value)]]),s.value==="compare"&&u.value&&v.value?(openBlock(),createElementBlock("div",_hoisted_1$1,toDisplayString(y.$t("toolbar.compareTip")),1)):createCommentVNode("",!0)],64)}}},loadScript=(e,n)=>new Promise(o=>{e||o();const r=document.createElement("script");r.type="text/javascript",r.onload=function(){o()},r.onerror=function(){n&&console.warn(n),o()},r.src=e,document.querySelector("head").appendChild(r)}),loadConfig=()=>new Promise(e=>{window.parent===window?e():(window.addEventListener("message",async function n(o){if(o.data.type==="responseConfig"){const{value:r}=o.data;try{r&&(await loadScript(o.data.value,"Config script could not be loaded"),window.removeEventListener("message",n))}finally{e()}}}),window.parent.postMessage({type:"requestConfig",docId:parseInt(getHashParameters("docId"),10)},"*"))}),initDocument=(e={})=>{const n=new ComPDFKitViewer(e);core.setDocumentViewer(1,n)};function createEncapsulatedStore(e){return{dispatch(o){if(typeof e.dispatch=="function")return e.dispatch(o);throw new Error("Original store does not have a dispatch method.")},getState(o){if(typeof e.getState=="function")return JSON.parse(JSON.stringify(e.getState(o)));throw new Error("Original store does not have a getState method.")}}}const disableElements=e=>n=>{var r;const o=[...e.getActiveHeaderItems,...e.getTools,...e.getActiveRightHeaderItems,...e.getToolItems.annotation,...e.getToolItems.form,...e.getToolItems.security,...e.getToolItems.editor,...e.getToolItems.measurement,...e.getPopupItems("textPopup"),...e.getPopupItems("cropPagePopup")];if(Array.isArray(n))for(let f=0;f<o.length;f++)n.forEach(s=>{e.getDisabledElementsObj[s]?e.setDisabledElements(s):o[f].dataElement===s&&(o[f].hidden=!0)});else if(typeof n=="string"){if(e.getDisabledElementsObj[n]){e.setDisabledElements(n);return}const f=o.find(s=>s.dataElement===n);f?(f.hidden=!0,e.toolMode===f.element&&e.setActiveToolMode((r=e.tools[0])==null?void 0:r.element)):console.warn("DataElement not found.")}else console.error("Wrong dataElements type.")},enableElements=e=>n=>{const o=[...e.getActiveHeaderItems,...e.getTools,...e.getActiveRightHeaderItems,...e.getToolItems.annotation,...e.getToolItems.form,...e.getToolItems.security,...e.getToolItems.editor,...e.getToolItems.measurement,...e.getPopupItems("textPopup"),...e.getPopupItems("cropPagePopup")];if(Array.isArray(n))for(let r=0;r<o.length;r++)n.forEach(f=>{e.getDisabledElementsObj[f]?e.setEnabledElements(f):o[r].dataElement===f&&(o[r].hidden=!1)});else if(typeof n=="string"){if(e.getDisabledElementsObj[n]){e.setEnabledElements(n);return}const r=o.find(f=>f.dataElement===n);r?r.hidden=!1:console.warn("DataElement not found.")}else console.error("Wrong dataElements type.")},setHeaderItems=e=>n=>{const o={headers:e.headers,rightHeaders:e.rightHeaders,tools:e.tools,toolItems:e.toolItems},r=Object.create(Header).initialize(e,o);n(r),Object.keys(o).forEach(f=>{const s=o[f];e[f]=s})},Header={initialize(e){return this.headers={headers:e.headers,rightHeaders:e.rightHeaders,tools:e.tools,toolItems:e.toolItems,documentEditorHeaders:e.documentEditorHeaders},this.toolButtonObjects=e.toolItems,this.headerGroup="headers",this.index=-1,this},get(e){if(this.index!==-1){const n=this.headers[this.headerGroup][this.index];Object.keys(n).forEach(o=>{delete this[o]})}if(this._setIndex(e),this.index===-1)console.warn(`${e} does not exist in ${this.headerGroup} header`);else{const n=this.headers[this.headerGroup][this.index];Object.keys(n).forEach(o=>{this[o]=n[o]})}return this},getItems(){return this.headers[this.headerGroup]},getHeader(e){const n=Object.keys(this.headers);return n.includes(e)?(this.headerGroup=e,this._resetIndex()):console.warn(`Header must be one of: ${n.join(" or ")}.`),this},insertBefore(e){return this.index===-1?console.warn("Please use .get(dataElement) first before using insertBefore"):this.headers[this.headerGroup].splice(this.index,0,e),this},insertAfter(e){return this.index===-1?console.warn("Please use .get(dataElement) first before using insertAfter"):(this.index++,this.headers[this.headerGroup].splice(this.index,0,e)),this},delete(e){let n;return typeof e=="number"?n=e:typeof e=="string"?this._getIndexOfElement(e)===-1?console.warn(`${e} does not exist in ${this.headerGroup} header`):n=this._getIndexOfElement(e):typeof e>"u"?this.index===-1?console.warn("Please use .get(dataElement) first before using delete()"):n=this.index:Array.isArray(e)?e.forEach(o=>{(typeof o=="number"||typeof o=="string")&&this.delete(o)}):console.warn("Argument must be empty, a number, a string or an array"),n!==void 0&&n!==-1&&(this.headers[this.headerGroup].splice(n,1),this._resetIndex()),this},shift(){return this.headers[this.headerGroup].shift(),this},unshift(...e){return this.headers[this.headerGroup].unshift(...e),this},push(...e){return this.headers[this.headerGroup].push(...e),this},pop(){return this.headers[this.headerGroup].pop(),this},update(e){return Array.isArray(e)?this._updateItems(e):console.warn("Argument must be an array"),this},_updateItems(e){return this.headers[this.headerGroup].length=0,this.headers[this.headerGroup].push(...e),this},_setIndex(e){this.index=this._getIndexOfElement(e)},_getIndexOfElement(e){return this.headers[this.headerGroup].findIndex(n=>{let o;return n.type==="toolButton"?o=this.toolButtonObjects[n.toolName].dataElement:o=n.dataElement,o===e})},_resetIndex(){this.index=-1}},setActiveToolMode=e=>n=>{const o=e.tools.find(r=>r.dataElement===n);o?(o.hidden&&(o.hidden=!1),e.setActiveToolMode(o.element)):console.warn("DataElement not found.")},setActiveTool=(e,n)=>o=>{const r=e.getToolMode;if(r){if(!o){n.setToolState();return}const s=e.getToolItems[r].find(m=>m.dataElement===o);if(!s){console.warn("DataElement not match toolMode.");return}s.hidden&&(s.hidden=!1),n.setToolState(s.type)}else console.warn("DataElement not found.")},setLanguage=e=>async n=>{await instance$1.changeLanguage(n),e.setLanguage(n),window.localStorage.setItem("language",n)},getPassword=e=>()=>e.dispatch("getPassword"),createPopupAPI=(e,n)=>Object.create(PopupAPI).initialize(e,n),PopupAPI={initialize(e,n){return this.store=e,this.popupDataElement=n,this},add(e,n){Array.isArray(e)||(e=[e]);const o=this._getIndexByDataElement(n);this.getItems().splice(o+1,0,...e)},update(e){e||(e=[]),Array.isArray(e)||(e=[e]);const n=this.getItems();n.length=0,n.push(...e)},getItems(){return this.store.dispatch("getPopupItems")(this.popupDataElement)},_getIndexByDataElement(e){let n;return typeof e>"u"?n=-1:n=this.store.dispatch("getPopupItems")(this.popupDataElement).findIndex(o=>o.dataElement===e),n}},textPopup=e=>createPopupAPI(e,"textPopup"),openElement=e=>n=>{if(["rightPanel","contentEditorPanel","measurePanel","freetextPanel"].includes(n)&&e.getRightPanelButtonDisabled)return!1;e.dispatch("openElement")(n)},closeElement=e=>n=>e.dispatch("closeElement")(n),isElementOpen=e=>n=>e.dispatch("isElementOpen")(n),setActiveElementTab=e=>(n,o)=>{e.activeElementsTab.hasOwnProperty(n)?e.setActiveElementTab(n,o):console.warn("DataElement not found.")},setCustomFonts=e=>n=>{Array.isArray(n)?e.setCustomFonts(n):console.error("setCustomFonts: fonts must be an array")},setAnnotator=e=>n=>{e.setAnnotator(n||"Guest")},getToolColor=e=>n=>e[n].color,getTool=e=>n=>({...e[n]}),getActiveTool=e=>()=>e.getActiveTool,cropPagePopup=e=>createPopupAPI(e,"cropPagePopup"),setAutoJumpNextSign=e=>n=>{e.setAutoJumpNextSign(!!n)},setSignatureDialogTabs=e=>n=>{e.setSignatureDialogTabs(n)},setSignatureDialogProperties=e=>(n,o)=>{e.setSignatureDialogProperties(n,o)},setCustomLoading=e=>n=>{e.setCustomLoading(n)},disableAnnotationExport=e=>()=>{e.setAnnotationExport(!1)},disableAnnotationImport=e=>()=>{e.setAnnotationImport(!1)},enableAnnotationExport=e=>()=>{e.setAnnotationExport(!0)},enableAnnotationImport=e=>()=>{e.setAnnotationImport(!0)},enableSignatureTool=e=>()=>{e.setDisableSignatureTool(!1)},disableSignatureTool=e=>()=>{e.setDisableSignatureTool(!0)},setCustomStyle=e=>{const n=document.createElement("style");n.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(n)},setThemeMode=e=>n=>{e.setThemeMode(n)},disableDocumentEditorSave=e=>()=>{e.setDocumentEditorSaveStatus(!1)},disableDocumentEditorSaveAs=e=>()=>{e.setDocumentEditorSaveAsStatus(!1)},enableDocumentEditorSave=e=>()=>{e.setDocumentEditorSaveStatus(!0)},enableDocumentEditorSaveAs=e=>()=>{e.setDocumentEditorSaveAsStatus(!0)},saveDocumentEditor=(e,n,o)=>async()=>{const r=await o.saveDocumentEdit();if(!r)return;n.resetSetting(),n.setToolState(""),e.setActiveToolMode("view"),e.setUpload(!0),e.setUploadLoading(!0);const f=e.getScale,s=n.getPassword;await o.loadDocument(r,{password:s}),n.setCurrentPdfData(r);const m=o.getPagesCount();n.setTotalPages(m),n.setOutline(o.getOutlines()),e.setCurrentPage(1);const w=e.getScrollMode,g=e.getPageMode;o.switchScrollMode(w==="Vertical"?0:1),o.switchSpreadMode(g),e.setCurrentScale(f/100),o.scaleChanged(f/100),e.setUploadLoading(!1)},setAuthor=e=>n=>{e.setAuthor(n||"")},setHighlightForm=e=>n=>{e.setHighlightForm(n)},setHighlightLink=e=>n=>{e.setHighlightLink(n)},setEnableSignatureTemplates=e=>n=>{e.setEnableSignatureTemplates(n)},addLanguage=e=>n=>{e.addLanguage(n)},removeLanguage=e=>n=>{e.removeLanguage(n)},setLanguages=e=>n=>{e.setLanguages(n)},defineWebViewerInstanceUIAPIs=()=>{const e=useViewerStore(),n=useDocumentStore(),o=createEncapsulatedStore(e),r=createEncapsulatedStore(n);e.setLanguage(instance$1.language);const f="Core",s="UI",m={...core},w={disableElements:disableElements(e),enableElements:enableElements(e),setHeaderItems:setHeaderItems(e),setActiveToolMode:setActiveToolMode(e),setActiceToolMode:setActiveToolMode(e),setActiveTool:setActiveTool(e,n),setLanguage:setLanguage(e),getPassword:getPassword(r),textPopup:textPopup(o),openElement:openElement(e),closeElement:closeElement(e),isElementOpen:isElementOpen(e),setActiveElementTab:setActiveElementTab(e),setCustomFonts:setCustomFonts(e),setAnnotator:setAnnotator(n),getActiveTool:getActiveTool(n),getToolColor:getToolColor(n),getTool:getTool(n),cropPagePopup:cropPagePopup(o),setAutoJumpNextSign:setAutoJumpNextSign(n),setSignatureDialogTabs:setSignatureDialogTabs(e),setSignatureDialogProperties:setSignatureDialogProperties(e),setCustomLoading:setCustomLoading(e),disableAnnotationExport:disableAnnotationExport(e),disableAnnotationImport:disableAnnotationImport(e),enableAnnotationExport:enableAnnotationExport(e),enableAnnotationImport:enableAnnotationImport(e),enableSignatureTool:enableSignatureTool(e),disableSignatureTool:disableSignatureTool(e),setCustomStyle,setThemeMode:setThemeMode(e),disableDocumentEditorSave:disableDocumentEditorSave(e),disableDocumentEditorSaveAs:disableDocumentEditorSaveAs(e),enableDocumentEditorSave:enableDocumentEditorSave(e),enableDocumentEditorSaveAs:enableDocumentEditorSaveAs(e),saveDocumentEditor:saveDocumentEditor(e,n,core),setAuthor:setAuthor(n),setHighlightForm:setHighlightForm(n),setHighlightLink:setHighlightLink(n),setEnableSignatureTemplates:setEnableSignatureTemplates(e),addLanguage:addLanguage(e),removeLanguage:removeLanguage(e),setLanguages:setLanguages(e)};window.instance={docViewer:core.getDocumentViewer(),[f]:m,[s]:w}};/**!
2694
2694
  * Sortable 1.15.2
2695
2695
  * @author RubaXa <trash@rubaxa.org>