dwt 17.2.4 → 17.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +19 -16
- package/README.md +1 -1
- package/dist/dynamsoft.webtwain.min.js +259 -251
- package/dist/dynamsoft.webtwain.min.mjs +261 -252
- package/dist/src/{dynamsoft.crypto-1.7.2.wasm → dynamsoft.crypto-1.7.2.2.wasm} +0 -0
- package/dist/src/{dynamsoft.imageProc-1.7.2.wasm → dynamsoft.imageProc-1.7.2.2.wasm} +0 -0
- package/dist/src/{dynamsoft.imageProc-sn-1.7.2.wasm → dynamsoft.imageProc-sn-1.7.2.2.wasm} +0 -0
- package/dist/src/{dynamsoft.imagecore-1.7.2.wasm → dynamsoft.imagecore-1.7.2.2.wasm} +0 -0
- package/dist/src/dynamsoft.imageio-1.7.2.2.wasm +0 -0
- package/dist/src/dynamsoft.imageio_wasm-1.7.2.2.js +115 -0
- package/dist/src/dynamsoft.lts.js +32 -32
- package/dist/src/{dynamsoft.pdfReader-1.7.2.wasm → dynamsoft.pdfReader-1.7.2.2.wasm} +0 -0
- package/dist/src/{dynamsoft.pdfReader_wasm-1.7.2.js → dynamsoft.pdfReader_wasm-1.7.2.2.js} +80 -80
- package/dist/src/{dynamsoft.pdfWriter-1.7.2.wasm → dynamsoft.pdfWriter-1.7.2.2.wasm} +0 -0
- package/dist/src/dynamsoft.viewer.css +3 -3
- package/dist/src/dynamsoft.viewer.js +2 -2
- package/dist/src/dynamsoft.webtwain.css +1 -1
- package/dist/src/fastcomp/{dynamsoft.crypto-1.7.2.wasm → dynamsoft.crypto-1.7.2.2.wasm} +0 -0
- package/dist/src/fastcomp/{dynamsoft.imageProc-1.7.2.wasm → dynamsoft.imageProc-1.7.2.2.wasm} +0 -0
- package/dist/src/fastcomp/{dynamsoft.imagecore-1.7.2.wasm → dynamsoft.imagecore-1.7.2.2.wasm} +0 -0
- package/dist/src/fastcomp/dynamsoft.imageio-1.7.2.2.wasm +0 -0
- package/dist/src/fastcomp/dynamsoft.imageio_wasm-1.7.2.2.js +115 -0
- package/dist/src/fastcomp/{dynamsoft.pdfWriter-1.7.2.wasm → dynamsoft.pdfWriter-1.7.2.2.wasm} +0 -0
- package/dist/types/WebTwain.Viewer.d.ts +1 -1
- package/package.json +2 -2
- package/samples/{1.AcquireImage.html → AcquireImage.html} +1 -1
- package/samples/{2.CustomScan.html → CustomScan.html} +1 -1
- package/samples/{5.Edit.html → Edit.html} +1 -1
- package/samples/{3.LoadAndSaveImages.html → LoadAndSaveImages.html} +1 -1
- package/samples/{6.Navigation.html → Navigation.html} +1 -1
- package/samples/{4.PDFRasterizer.html → PDFRasterizer.html} +1 -1
- package/samples/{9.ReadBarcode.html → ReadBarcode.html} +1 -1
- package/samples/{10.ScanOrCapture.html → ScanOrCapture.html} +1 -1
- package/samples/{7.Thumbnail.html → Thumbnail.html} +1 -1
- package/samples/{11.mobilebrowsercapture.html → mobilebrowsercapture.html} +3 -0
- package/dist/src/dynamsoft.imageio-1.7.2.wasm +0 -0
- package/dist/src/dynamsoft.imageio_wasm-1.7.2.js +0 -115
- package/dist/src/fastcomp/dynamsoft.imageio-1.7.2.wasm +0 -0
- package/dist/src/fastcomp/dynamsoft.imageio_wasm-1.7.2.js +0 -115
- package/samples/8.OCRADocument.html +0 -160
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! Date:
|
|
2
|
-
!function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=8)}([function(t,e,i){"use strict";i.d(e,"e",(function(){return o})),i.d(e,"c",(function(){return r})),i.d(e,"g",(function(){return s})),i.d(e,"d",(function(){return a})),i.d(e,"f",(function(){return l})),i.d(e,"b",(function(){return h})),i.d(e,"a",(function(){return u}));var n="undefined"!=typeof window,o=(n&&window,!!n&&window.document.documentElement,{PREVIOUS:"prev",NEXT:"next"}),r={CLICK:"click",KEYDOWN:"keydown",TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_UP:"mouseup",MOUSE_OVER:"mouseover",MOUSE_OUT:"mouseout",CHANGE:"change",SCROLL:"scroll",CONTEXTMENU:"contextmenu",RESIZE:"resize"},s={IMAGE_SELECTED:"imageSelected",PAGE_CLICK:"click",PAGE_MOUSE_DOWN:"mousedown",PAGE_MOUSE_MOVE:"mousemove",PAGE_MOUSE_UP:"mouseup",PAGE_MOUSE_OVER:"mouseover",PAGE_MOUSE_OUT:"mouseout",PAGE_DOUBLE_CLICK:"dblclick",PAGE_RIGHT_CLICK:"rightclick",PAGE_CONTEXTMENU:"contextmenu",DRAG_START:"dragstart",DRAG_MOVE:"dragmove",DRAG_DONE:"dragdone",KEY_DOWN:"keydown",KEY_UP:"keyup",RESIZE:"resize",TOP_PAGE_CHANGED:"topPageChanged",BUFFER_CHANGED:"bufferChanged",THUMBNAIL_STRETCH:"resize",REMOVE_PAGE:"removePage",FILE_KEY_UP:"fileKeyUp",FILE_LIST_CLICK:"fileListClick",FILE_LIST_RIGHT_CLICK:"fileListRightClick",TAG_KEY_UP:"tagKeyUp",TAG_LIST_CLICK:"tagListClick",TAG_LIST_RIGHT_CLICK:"tagListRightClick",PAGE_AREA_SELECTED:"pageAreaSelected",PAGE_AREA_UNSELECTED:"pageAreaUnselected",VIEWER_PAGE_RENDERED:"pageRendered",DOCUMENT_KEY_UP:"onDocumentKeyUp",DOCUMENT_POINTER_UP:"onDocumentPointerUp",DOCUMENT_POINTER_MOVE:"onDocumentPointerMove",DOCUMENT_CLICK:"onDocumentClick",SIDEBAR_CLICK:"onSidebarClick",FILE_DROP:"onDrop",WHEEL:"wheel"},a={APPEND_SYNC_DROP:"_appendSyncDrop",UPDATE_UI_SETTING:"_updateUISetting",UPDATE_FOCUS:"_updateFocus",CANVAS_VISIBILITY_CHANGED:"_canvasVisibilityChanged",SET_SELECTED_INDEXES:"_SetSelectedIndexes",DOCUMENT_UP:"_documentUp",DOCUMENT_MOVE:"_documentMove",DISPLAYED_IMAGE_CHANGED:"_displayedImageChanged",REORDER_THUMBNAIL:"_onReOrderThumbnail",CHANGE_THUMBNAIL_VIEW_PROP:"_changeThumbnailViewProp",UPDATE_INNER_THUMBNAIL_PAGE:"_updateInnerThumbnailPage",ERROR:"_updateErrorMessage",LOG:"_updateLogMessage",CLEAR_SLT_BOX:"_clearSltBox",DIRECTORY_CHANGED:"_DirectoryChanged",BIND_SLIDE_COMPONENT:"_bindSlideComponent",UNBIND_SLIDE_COMPONENT:"_unbindSlideComponent",BIND_CANVAS:"_bindCanvas",UNBIND_CANVAS:"_unbindCanvas",SET_CANVAS_SIZE:"_setCanvasSize",CANVAS_TOUCH_START:"_canvasTouchstart",CANVAS_TOUCH_MOVE:"_canvasTouchmove",CANVAS_TOUCH_END:"_canvasTouchend",CANVAS_MOUSE_DOWN:"_canvasMousedown",CANVAS_MOUSE_UP:"_canvasMouseup",CANVAS_MOUSE_MOVE:"_canvasMousemove",CANVAS_MOUSE_OVER:"_canvasMouseOver",CANVAS_MOUSE_OUT:"_canvasMouseOut",CANVAS_WHEEL:"_canvasWheel",CANVAS_SCROLL:"_canvasScroll",CANVAS_CLICK:"_canvasClick",CANVAS_DOUBLE_CLICK:"_canvasDoubleClick",CANVAS_RIGHT_CLICK:"_canvasRightClick",CANVAS_KEY_DOWN:"_canvasKeyDown",CANVAS_KEY_UP:"_canvasKeyUp",CANVAS_RESIZE:"_canvasResize",CANVAS_DRAG_START:"_canvasDragStart",CANVAS_DRAG_MOVE:"_canvasDragMove",CANVAS_DRAG_DONE:"_canvasDragDone",CANVAS_DEFAULT_CURSOR:"_canvasDefaultCursor",SHOW_CANVAS_LOADING:"_showCanvasLoading",DB_SAVE_OK:"_addDataToDBSuccess",DB_SAVE_FAILED:"_addDataToDBFailed",AFTER_RENDER:"_afterRender",CURRENT_CHANGED:"_currentChanged"},l={VIEWER_RESIZE:"_viewerResizeUI",VIEWER_CLICK:"_mouseClickUI",VIEWER_RIGHT_CLICK:"_viewerRightClickUI",VIEWER_MOVE:"_mouseMoveUI",SHOW_LATEST_PAGE:"_showLatestPage",UPDATE_PAGES_LAYOUT:"_updatePagesLayout",DOCUMENT_POINTER_MOVE:"_documentPointerMoveUI",DOCUMENT_POINTER_UP:"_documentPointerUpUI",DOCUMENT_KEY_DOWN:"_documentKeyDownUI",DOCUMENT_KEY_UP:"_documentKeyUpUI",DOCUMENT_CLICK:"_documentClickUI",SIDEBAR_CLICK:"_sideBarClickUI",SIDEBAR_STRETCH_START:"_sidebarStretchStartUI",FILE_LIST_CLICK:"_fileListClickUI",FILE_LIST_RIGHT_CLICK:"_fileListRightClickUI",FILE_KEY_UP:"_fileListKeyUpUI",ADD_NEW_FOLDER:"_addNewFolderUI",FILE_REFRESH:"_directoryRefreshUI",FILE_SELECTED:"_fileSelectedUI",TAG_LIST_CLICK:"_tagListClickUI",TAG_LIST_RIGHT_CLICK:"tagListRightClickUI",TAG_KEY_UP:"_tagKeyUpUI",ADD_NEW_TAG:"_addNewTagUI",TAG_REFRESH:"_tagRefreshUI",TAG_SELECTED:"_tagSelectedUI",OPEN_DEFAULT_TAG:"_openDefaultTagUI",IMAGE_SELECTED:"_imageSelectedUI",THUMBNAIL_CHANGED:"_thumbnailChangedUI",UPDATE_THB_ITEM:"_updateThbItem",UPDATE_THUMBNAIL_PROP:"_updateThumbnailPropUI",SCROLL_TO:"_scrollToUI",SET_VIEW_MODE:"_setViewModeUI",MERGE_DISPLAYED_UIDS:"_mergeDisplayedUidsUi",PAGER_BLUR:"_pagerBlurUI",PAGER_CHANGED:"_pagerChangedUI",SET_SCROLLER_SIZE:"_setScrollerSizeUI",CHANGE_CANVAS_CURSOR:"_changeCanvasCursorUI",TAB_CHANGED:"_tabChangedUI",TAB_LIST_CLICK:"_tabListClickUI",CLOSE_SAVE_SETTING_BOX:"_closeSaveSettingBoxUI",CUSTOM_BUTTON_CLICK:"_customButtonClickUI"},h={UPDATE_FOR_VIEWER:"_updateForViewer",LOAD_TO_VIEWER:"_loadToViewer",OPEN_TO_VIEWER:"_openToViewer",LOAD_PAGE:"_loadPage",LOAD_PAGE_OK:"_loadPageOk",SET_CURRENT_INDEX:"_setCurrentIndex",REMOVE_VIEWER_UID:"_removeViewerUid",GOTO_PAGE:"_gotoPage",CHANGE_PAGE:"_changePage",REORDER_PAGE:"_reorderPage",REMOVE_PAGE:"_removePage",OVERLAY_RECTANGLE:"_overlayRectangle",EDIT:"_editPage",UPDATE_THUMBNAIL_PAGE:"_updateThumbnailPage",REMOVE_FROM_TAG:"_removeFromTag",LOAD_TAG:"_loadToTag",OPEN_TAG:"_openTag",REMOVE_PAGE_TAG:"_removePageTag",ADD_PAGE_TAG:"_addPageTag",EMPTY_TAG:"_emptyTag",RENAME_TAG:"_renameTag",TAG_CHANGED:"_tagChanged",APPEND_SYNC:"_appendSync",UPDATE_SYNC:"_updateSync",REMOVE_FROM_FILE:"_removeFromFile",LOAD_FILE:"_loadToFile",APPEND_TO_OPEN_TAG:"_appendToOpenTag",APPEND_TO_OPEN_ALL:"_appendToOpenAll",REMOVE_FROM_ALL:"_removeFromAll",REMOVE_FILE:"_removeFile"},u={OK:{code:0,message:"ok."},PARAM_TYPE:{code:80001,message:"The parameter type is wrong."},PARAMETER_RANGE:{code:80002,message:"The parameter is out of range."},IMG_NOT_EXIST:{code:80003,message:"The image does not exist."},IMG_LOAD_FAILED:{code:80004,message:"The image load failed."},BACK_TO_TOP:{code:80005,message:"The current folder is root folder."},FILE_NOT_EXIST:{code:80006,message:"The file does not exist."},IMG_HAVE_EXIST:{code:80007,message:"The image has existed."},EMPTY_IN_ARRAY:{code:80008,message:"There is some empty element in array."},TAG_NOT_EXIST:{code:80009,message:"Tag does not exist."},TAG_HAVE_EXIST:{code:80010,message:"The tag already exists."},ELEMENT_NOT_EXIST:{code:80011,message:"Element does not exist."},PAGE_NOT_EXIST:{code:80012,message:"Page does not exist."},PARAMETER_INVALID:{code:80013,message:"The parameter is invalid."},URL_INVALID:{code:80014,message:"The url is invalid."},FOLDER_NOT_EXIST:{code:80015,message:"The folder does not exist."},COLOR_INVALID:{code:80016,message:"The color is invalid."},IMG_STORAGE_FAILED:{code:80017,message:"Failed to save image to database."},IMG_REMOVE_FAILED:{code:80018,message:"Failed to remove image from database by uid."},PATH_ERROR:{code:80019,message:"The path of file or folder does not exist."},BROWSER_NOT_SUPPORT:{code:80020,message:"Your browser does not support full screen."},SIZE_INVALID:{code:80021,message:"The size is invalid."},OPERATION_MODE_ERROR:{code:80022,message:"The operation mode is error."},BORDER_INVALID:{code:80023,message:"The border is invalid."},CAMERA_CLASS_REQUIRE:{code:80025,message:"The camera class is required."},VIEW_UI_REQUIRE:{code:80026,message:"The constructor of view ui is required."},WEBCAM_LICENSE_INVALID:{code:80027,message:"The license of webcam is invalid."},CAMERA_EXIST:{code:80028,message:"The video is shown."},CAMERA_CLASS_INVALID:{code:80029,message:"The camera class is invalid."},META_DATA_NOT_EXIST:{code:80030,message:"The metadata is not exist."},CAMERA_NOT_EXIST:{code:80031,message:"The video is not shown."},FILE_EXIST:{code:80032,message:"The file already exists."}}},function(t,e,i){"use strict";function n(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function o(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)for(var i=e+1;i<t.length;i++)t[e]===t[i]&&(t.splice(i,1),i--);return t}}function r(t){return"[object Object]"===Object.prototype.toString.call(t)}function s(t){return"function"==typeof t}function a(t){return"string"==typeof t}function l(t){var e=String(t);return!!/^\d+(px|em)$|^\d+$|^(100|[1-9]?\d(\.\d\d?\d?)?)%$/.test(e)}function h(t){return"number"==typeof t&&!isNaN(t)}function u(t){return"[object Boolean]"===Object.prototype.toString.call(t)}function c(t){var e=document.createElement("span");return e.style.background=t,!!e.style.background}function d(t){var e=document.createElement("span");return e.style.border=t,!(!e.style.border&&""!==t)}function p(){return"ontouchstart"in document.documentElement}function _(){return document.documentMode!==undefined}function v(t){return t instanceof HTMLElement||"[object ShadowRoot]"===Object.prototype.toString.call(t)}function f(t,e){if(a(e))t.style.cssText=e;else for(var i in e)t.style[i]=e[i]}function m(t,e,i,n){if(t)return t.addEventListener(e,i,n),function(){t.removeEventListener(e,i)}}function g(t,e){for(var i in t)e[i]===undefined?e[i]=t[i]:r(t[i])&&r(e[i])?g(t[i],e[i]):e[i]=t[i]}function y(t,e){for(var i in t){var n=t[i],o=e[i];o===undefined?e[i]=t[i]:u(n)&&r(o)?o.visibility=n:r(n)&&r(o)?y(t[i],e[i]):e[i]=t[i]}}function b(t,e){var i=this,n=0,o=null;return function(){var r=+new Date;r-n<e?(clearTimeout(o),o=setTimeout((function(){n=r,t.apply(i)}),e)):(n=r,t.apply(i))}}function E(t){t&&t.stopPropagation?t.stopPropagation():t&&(t.cancelBubble=!0)}function C(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function S(t){return""===t||t===undefined?null:document.getElementById(t)}function I(){var t=window.document;return t.fullscreenElement||t.msFullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement||!1}function T(t){return t.requestFullscreen?(t.requestFullscreen(),!0):t.mozRequestFullScreen?(t.mozRequestFullScreen(),!0):t.msRequestFullscreen?(t.msRequestFullscreen(),!0):t.oRequestFullscreen?(t.oRequestFullscreen(),!0):t.webkitRequestFullscreen?(t.webkitRequestFullScreen(),!0):(alert("Your browser does not support full screen!"),!1)}function w(){var t=window.document;return t.exitFullScreen?(t.exitFullScreen(),!0):t.mozCancelFullScreen?(t.mozCancelFullScreen(),!0):t.webkitExitFullscreen?(t.webkitExitFullscreen(),!0):t.msExitFullscreen?(t.msExitFullscreen(),!0):void 0}function O(t){for(var e=t.parentNode.children,i=0;i<e.length;i++)if(e[i]===t)return i}function R(t,e){for(var i=t.parentNode,n=i.children,o=0,r=0;r<n.length;r++){var a=n[r];if(s(e)){if(!e(a,i))continue;if(a===t)return o;o++}else if(a===t)return r}return-1}function x(t,e){var i=e.parentNode;i.lastChild==e?i.appendChild(t):P(t,e.nextSibling,i)}function P(t,e,i){e===undefined?i.appendChild(t):i.insertBefore(t,e)}function L(t){var e=Math.random().toString(35).substring(2);return e.length<11&&(e+=Math.random().toString(35).substring(2)),t=Math.max(Math.min(Math.round(t),11),8),e=e.substring(0,t)}function A(t){var e;if(n(t))e=[];else{if(!r(t))return t;e={}}for(var i in t){var o=t[i];n(t)||r(t)?e[i]=A(o):e[i]=o}return e}function M(t){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame,i=!!e;if(e&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(e.toString())&&(i=!1),i)return e(t);var n={},o=1,r=null,s=+new Date;return function(t,e){var i=o++;return n[i]=t,null===r&&(r=setInterval((function(){var t=+new Date,e=n;for(var i in n={},0,e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i](t),s=t);t-s>2500&&(clearInterval(r),r=null)}),1e3/60)),i}(t)}function D(){var t=window;return t?t.devicePixelRatio?t.devicePixelRatio:t.screen.deviceXDPI&&t.screen.logicalXDPI?t.screen.deviceXDPI/t.screen.logicalXDPI:1:1}function B(t){var e=new Date,i={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),i)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[n]:("00"+i[n]).substr((""+i[n]).length)));return t}function U(t,e,i,n,o){var r=t+i/2,s=e+n/2,a=N(t,e,r,s,o),l=N(t+i,e,r,s,o),h=N(t+i,e+n,r,s,o),u=N(t,e+n,r,s,o),c=[l.x,a.x,u.x,h.x].sort((function(t,e){return t-e})),d=[l.y,a.y,u.y,h.y].sort((function(t,e){return t-e}));return{x:c[0],y:d[0],width:c[3]-c[0],height:d[3]-d[0]}}function N(t,e,i,n,o){return o=o/180*Math.PI,{x:(t-i)*Math.cos(o)-(e-n)*Math.sin(o)+i,y:(t-i)*Math.sin(o)+(e-n)*Math.cos(o)+n}}i.d(e,"m",(function(){return n})),i.d(e,"J",(function(){return o})),i.d(e,"w",(function(){return r})),i.d(e,"s",(function(){return s})),i.d(e,"y",(function(){return a})),i.d(e,"x",(function(){return l})),i.d(e,"v",(function(){return h})),i.d(e,"n",(function(){return u})),i.d(e,"p",(function(){return c})),i.d(e,"o",(function(){return d})),i.d(e,"u",(function(){return p})),i.d(e,"t",(function(){return _})),i.d(e,"q",(function(){return v})),i.d(e,"F",(function(){return f})),i.d(e,"c",(function(){return m})),i.d(e,"A",(function(){return g})),i.d(e,"B",(function(){return y})),i.d(e,"H",(function(){return b})),i.d(e,"G",(function(){return E})),i.d(e,"C",(function(){return C})),i.d(e,"j",(function(){return S})),i.d(e,"r",(function(){return I})),i.d(e,"z",(function(){return T})),i.d(e,"f",(function(){return w})),i.d(e,"h",(function(){return O})),i.d(e,"i",(function(){return R})),i.d(e,"k",(function(){return x})),i.d(e,"l",(function(){return P})),i.d(e,"I",(function(){return L})),i.d(e,"d",(function(){return A})),i.d(e,"D",(function(){return M})),i.d(e,"e",(function(){return D})),i.d(e,"g",(function(){return B})),i.d(e,"E",(function(){return U})),i.d(e,"b",(function(){return k})),i.d(e,"a",(function(){return V}));var k={log:function(t){window.Dynamsoft&&window.Dynamsoft.Lib.debug&&window.Dynamsoft.Lib.log(t)}},V={windowURL:window.URL||window.webkitURL,createURL:function(t){return a(t)?t:V.createURLWithType(t).data},createURLWithType:function(t){if(a(t)||undefined===t)return{type:"string",data:t};if(t instanceof Blob)return{type:"object",data:V.createObjectURL(t)};if(t.imageData&&t.imageData instanceof Blob)return{type:"object",data:V.createObjectURL(t.imageData)};if(t.imageData){var e=Object.prototype.toString.call(t.imageData);if(/\[object \w+Array\]/.test(e))return{type:"object",data:V.createObjectURL(new Blob([t.imageData]))}}else{e=Object.prototype.toString.call(t);if(/\[object \w+Array\]/.test(e))return{type:"object",data:V.createObjectURL(new Blob([t]))}}return/data:image\/\w+;base64/.test(t)?{type:"string",data:t}:{type:"object",data:t}},createObjectURL:function(t){if(!t)return"";var e=V.windowURL.createObjectURL(t);return k.log("createObjectURL:"+e),e},revokeObjectURL:function(t){k.log("revokeObjectURL:"+t),a(t)&&0==t.indexOf("blob:http")&&V.windowURL.revokeObjectURL(t)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return s}));var n=i(1),o=undefined&&undefined.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,o++)n[o]=r[s];return n},r=function(){function t(t){this._evtIds=[],this._oPub=null,this._bDisposePub=!1,t?this._oPub=t:(this._oPub=new s,this._bDisposePub=!0)}return t.prototype.getPublishSubscribe=function(){return this._oPub},t.prototype._on=function(t,e){var i=this._oPub.on(t,e);this.push(t,i)},t.prototype._emit=function(t){for(var e,i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];null===(e=this._oPub)||void 0===e||e.emit.apply(e,o([t],i))},t.prototype._off=function(t,e){var i;null===(i=this._oPub)||void 0===i||i.off(t,e)},t.prototype.push=function(t,e){this._evtIds.push({name:t,id:e})},t.prototype.dispose=function(){if(this._oPub){for(var t=this._evtIds.length,e=0;e<t;e++){var i=this._evtIds[e];this._oPub.offById(i.name,i.id)}this._bDisposePub&&this._oPub&&this._oPub.dispose()}this._oPub=null},t}(),s=function(){function t(){this._events={}}return t.prototype.on=function(t,e){this._events[t]||(this._events[t]=[]);var i=Object(n.I)(10);return this._events[t].push({fn:e,evtId:i}),i},t.prototype.emit=function(t){for(var e,i,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var s=this._events[t];if(!s||0===s.length)return!1;for(var a=s.length,l=0;l<a;l++)null===(i=s[l])||void 0===i||(e=i.fn).call.apply(e,o([null],n))},t.prototype.emitEx=function(t){for(var e,i,n,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var a=this._events[t];if(!a||0===a.length)return Promise.resolve(!0);var l=a.length,h=Promise.resolve(!0);if(1===a.length){var u=null===(i=a[0])||void 0===i?void 0:(e=i.fn).call.apply(e,o([null],r));return u instanceof Promise?u:h}for(var c=function(t){var e,i=null===(n=a[t])||void 0===n?void 0:(e=n.fn).call.apply(e,o([null],r));i instanceof Promise&&(h=h.then((function(){return i})))},d=0;d<l;d++)c(d);return h},t.prototype.off=function(t,e){var i=this._events[t];if(!i)return!1;if(e)for(var n=i.length,o=0;o<n;o++){var r=i[o];r&&r.fn===e&&i.splice(o,1),r=null}else i&&(i.length=0);i=null},t.prototype.offById=function(t,e){var i=this._events[t];if(!i)return!1;if(e)for(var n=i.length,o=0;o<n;o++){var r=i[o];if(r&&r.evtId===e){i.splice(o,1);break}r=null}else i&&(i.length=0);i=null},t.prototype.dispose=function(){for(var t=Object.keys(this._events),e=0,i=t.length;e<i;e++){var n=t[e],o=this._events[n];o&&o.splice(0),o=null}this._events={}},t}()},function(t,e,i){"use strict";var n=i(1),o=function(){function t(t){var e=this;this.uid=null,this.mode="normal",this.vertexes=[],this.midpoints=[],this.probePoints=[],this.slopeRatio=[],this.isCrop=!1,this.ctrlRadius=4,this.sensorRadius=4,this.defaultLineColor="rgba(0,0,0,1)",this.defaultFirstPointColor="rgba(255,0,0,1)",this.invalidLineColor="rgba(255,0,0,1)",this.invalidFirstPointColor="rgba(0,0,0,1)",this.lineColor="rgba(0,0,0,1)",this.firstPointColor="rgba(0,0,0,1)",this.pointFillColor="rgba(255,255,255,0)",this.lineWidth=1,this.dashLine=[4,2],this.isPointSelected=!1,this.activeProbePoint=null,this.moveLeft=0,this.moveTop=0,this.isMoveBox=!1,this.width=0,this.height=0,this.type="bottomRight",this.keepAspectRatio=!1,this.aspectRatio=0,this._startX=null,this._startY=null,this._lastX=null,this._lastY=null,this._lastWhr=1,this.zoom=1,this.dpr=1,this.uid=Object(n.I)(11),Object.keys(t).forEach((function(i){e[i]=t[i]})),this._initBox()}return t.prototype.getRect=function(){if("free"===this.mode)return null;var t=this._getMaxPoint(),e=t.minX,i=t.maxX,n=t.minY,o=t.maxY;return{x:Math.floor(e),y:Math.floor(n),width:Math.floor(i-e),height:Math.floor(o-n)}},t.prototype._initBox=function(){this.midpoints=this._calcMidpoint(this.vertexes),this.probePoints=this.vertexes.slice().concat(this.midpoints.slice()),this.slopeRatio=this._calcSlopeRatio(this.vertexes)},t.prototype._getMaxPoint=function(){return{minX:Math.min(this.probePoints[0],this.probePoints[2],this.probePoints[4],this.probePoints[6]),maxX:Math.max(this.probePoints[0],this.probePoints[2],this.probePoints[4],this.probePoints[6]),minY:Math.min(this.probePoints[1],this.probePoints[3],this.probePoints[5],this.probePoints[7]),maxY:Math.max(this.probePoints[1],this.probePoints[3],this.probePoints[5],this.probePoints[7])}},t.prototype.checkPointPosition=function(t){var e=this._getMaxPoint(),i=e.minX,n=e.maxX,o=e.minY,r=e.maxY,s=this.probePoints[2*t],a=this.probePoints[2*t+1];return t<4?s===n&&a===r?"se":s===n&&a===o?"ne":s===i&&a===o?"nw":s===i&&a===r?"sw":null:s===n?"e":a===r?"s":s===i?"w":a===o?"n":null},t.prototype.onStartHandler=function(t,e,i){var n=this.isBoxSelected(t,e);if(i!==undefined&&(n=i),null!==n&&(this._startX=t,this._startY=e,this._lastX=t,this._lastY=e,-1===n?(this.isPointSelected=!1,this.activeProbePoint=null,"normal"===this.mode&&(this.isMoveBox=!0)):(this.isPointSelected=!0,this.activeProbePoint=n,this.isMoveBox=!1),"free"===this.mode&&n>3)){var o=n-4;this.k1=this.slopeRatio[(o+1)%4],this.b1=this.probePoints[(2*o+3)%8]-this.k1*this.probePoints[(2*o+2)%8],this.k2=this.slopeRatio[(o+3)%4],this.b2=this.probePoints[(2*o+1)%8]-this.k2*this.probePoints[(2*o+0)%8]}},t.prototype.onMoveHandler=function(t,e,i){if(this.isPointSelected||this.isMoveBox){var n=this.probePoints.slice();if(this.isPointSelected){var o=this.activeProbePoint;i!==undefined&&(o=i),"normal"===this.mode?n=this._movePointNormal(n,o,t,e):(n=this._movePointFree(n,o,t,e),this.slopeRatio=this._calcSlopeRatio(this.probePoints).slice(0,4)),this.probePoints=n.slice(),this._checkRectConvexity(this.probePoints)?(this.lineColor=this.defaultLineColor,this.firstPointColor=this.defaultFirstPointColor):(this.lineColor=this.invalidLineColor,this.firstPointColor=this.invalidFirstPointColor)}else if(this.isMoveBox){var r=t-this._lastX,s=e-this._lastY;if(0===r&&0===s)return;n=this._moveBox(n,r,s),this.probePoints=n.slice()}var a=this._calcMidpoint(this.probePoints);this.probePoints=this.probePoints.slice(0,8).concat(a),this.midpoints=a,this._lastX=t,this._lastY=e}},t.prototype.onEndHandler=function(){this.lineColor=this.defaultLineColor,this.firstPointColor=this.defaultFirstPointColor;var t=this._startX,e=this._startY;this._startX=0,this._startY=0;var i=this._lastX,n=this._lastY;if(this.isPointSelected||this.isMoveBox){this.isPointSelected=!1,this.isMoveBox=!1,this.activeProbePoint=null;var o=this._checkRectConvexity(this.probePoints);(t===i&&e===n||!o)&&(this.probePoints=this.vertexes.slice().concat(this.midpoints)),this.vertexes=this.probePoints.slice(0,8),this.midpoints=this._calcMidpoint(this.probePoints),this.probePoints=this.probePoints.slice(0,8).concat(this.midpoints),this.slopeRatio=this._calcSlopeRatio(this.probePoints).slice(0,4)}},t.prototype._checkEdge=function(t,e){return t>=0&&t<=this.width&&e>=0&&e<this.height},t.prototype._movePointNormal=function(t,e,i,n){i=Math.max(0,Math.min(this.width,i)),n=Math.max(0,Math.min(this.height,n));var o=0,r=0;if(this.keepAspectRatio){var s=this._getMaxPoint(),a=s.minX,l=s.maxX,h=s.minY,u=s.maxY,c=this.checkPointPosition(e),d=(l-a)/(u-h);0===d||d===Infinity||d===-Infinity||isNaN(d)?d=this._lastWhr:this._lastWhr=d,o=0,r=0;var p="width";if(e<4){if(o=i-t[2*e],r=n-t[2*e+1],0===o||0===r)return t;p="width"}else{var _=e-4;if("e"===c?(e=(_+1)%4,p="width"):"s"===c?(e=_,p="height"):"w"===c?(e=_,p="width"):"n"===c&&(e=(_+1)%4,p="height"),o=i-t[2*_],r=n-t[2*_+1],0===o||0===r)return t}"height"===p?(o=r*d,"ne"!==c&&"sw"!==c&&"n"!==c&&"w"!==c||(o=-o)):(r=o/d,"ne"!==c&&"sw"!==c&&"n"!==c&&"w"!==c||(r=-r));var v=t[2*e]+o,f=t[2*e+1]+r;v<0?(o=0-t[2*e],r=0):v>this.width?(o=this.width-t[2*e],r=0):f<0?(r=0-t[2*e+1],o=0):f>this.height&&(r=this.height-t[2*e+1],o=0),t[2*e]+=o,t[2*e+1]+=r;m=(e+1)%4,g=(e+3)%4;e%2?(t[2*m]+=o,t[2*g+1]+=r):(t[2*m+1]+=r,t[2*g]+=o)}else if(e<4){if(o=i-t[2*e],r=n-t[2*e+1],0===o&&0===r)return t;t[2*e]=i,t[2*e+1]=n;var m=(e+1)%4,g=(e+3)%4;e%2?(t[2*m]=i,t[2*g+1]=n):(t[2*m+1]=n,t[2*g]=i)}else{var y=e-4,b=this.slopeRatio[y%4];0===b?(t[(2*y+3)%8]=n,t[(2*y+1)%8]=n):b!==Infinity&&b!==-Infinity||(t[(2*y+2)%8]=i,t[(2*y+0)%8]=i)}return t},t.prototype._movePointFree=function(t,e,i,n){i=Math.max(0,Math.min(this.width,i)),n=Math.max(0,Math.min(this.height,n));var o=t.slice();if(e<4){var r=i-t[2*e],s=n-t[2*e+1];if(0===r&&0===s)return t;t[2*e]=i,t[2*e+1]=n}else{var a=e-4,l=this.slopeRatio[a%4],h=n-l*i,u=-h/l,c=h,d=t[(2*a+9)%8]-l*t[(2*a+8)%8],p=-d/l,_=this,v=_.k1,f=_.b1,m=_.k2,g=_.b2;0===l?(t[(2*a+3)%8]=n,v!==Infinity&&v!==-Infinity&&(t[(2*a+2)%8]=(n-f)/v),t[(2*a+1)%8]=n,m!==Infinity&&m!==-Infinity&&(t[(2*a+0)%8]=(n-g)/m)):l===Infinity||l===-Infinity?(t[(2*a+2)%8]=i,t[(2*a+3)%8]=v*i+f,t[(2*a+0)%8]=i,t[(2*a+1)%8]=m*i+g):(0===v?t[(2*a+2)%8]+=u-p:v===Infinity||v===-Infinity?t[(2*a+3)%8]+=c-d:(t[(2*a+2)%8]=(f-h)/(l-v),t[(2*a+3)%8]=(l*f-v*h)/(l-v)),0===m?t[(2*a+0)%8]+=u-p:m===Infinity||m===-Infinity?t[(2*a+1)%8]+=c-d:(t[(2*a+0)%8]=(g-h)/(l-m),t[(2*a+1)%8]=(l*g-m*h)/(l-m)));for(var y=0;y<4;y++){var b=t[2*y],E=t[2*y+1];if(b<0||b>this.width||E<0||E>this.height)return o}}return t},t.prototype._moveBox=function(t,e,i){if("normal"===this.mode){var n=Math.min(t[0],t[2],t[4],t[6]),o=Math.max(t[0],t[2],t[4],t[6]),r=Math.min(t[1],t[3],t[5],t[7]),s=Math.max(t[1],t[3],t[5],t[7]);n+e<0&&(e=-n),o+e>this.width&&(e=this.width-o),r+i<0&&(i=-r),s+i>this.height&&(i=this.height-s);for(var a=0;a<4;a++)t[2*a]+=e,t[2*a+1]+=i}return t},t.prototype._isPointOnBox=function(t,e){if("normal"===this.mode){var i=this._getMaxPoint(),n=i.minX,o=i.maxX,r=i.minY,s=i.maxY;return t>=n&&t<=o&&e>=r&&e<=s}return!1},t.prototype.isBoxSelected=function(t,e){var i=this._isPointOnBox(t,e),n=this.isCtrlPointSelected(t,e);return null!==n?n:i?-1:null},t.prototype.isCtrlPointSelected=function(t,e){var i=this.sensorRadius/this.zoom,n=this._getMaxPoint(),o=n.minX,r=n.maxX,s=n.minY,a=n.maxY,l=Math.min(Math.max(i,.1*(r-o)),3*i)*this.dpr,h=Math.min(Math.max(i,.1*(a-s)),3*i)*this.dpr,u=8;"free"===this.mode&&(u=8);for(var c=0;c<u;c++){var d=this.probePoints[2*c],p=this.probePoints[2*c+1];if(t<=d+l&&t>=d-l&&e<=p+h&&e>=p-h&&t>=0&&t<=this.width&&e>=0&&e<=this.height)return c}return null},t.prototype._checkRectConvexity=function(t){var e=(t[6]-t[0])*(t[3]-t[1])-(t[7]-t[1])*(t[2]-t[0]),i=(t[0]-t[2])*(t[5]-t[3])-(t[1]-t[3])*(t[4]-t[2]),n=(t[2]-t[4])*(t[7]-t[5])-(t[3]-t[5])*(t[6]-t[4]),o=(t[4]-t[6])*(t[1]-t[7])-(t[5]-t[7])*(t[0]-t[6]);if(e*i*n*o<0)return!1;var r=t.slice().concat(t.slice(0,2));if(this.slopeRatio.length)for(var s=0;s<2;s++){if(this.slopeRatio[s]!==this.slopeRatio[s+2])if(this._calcIntersection(r.slice(2*s,2*s+2),r.slice(2*s+2,2*s+4),r.slice(2*s+4,2*s+6),r.slice(2*s+6,2*s+8)))return!1}return e*i*n*o>0},t.prototype._calcMidpoint=function(t){for(var e=t.slice(0,8).concat(t[0],t[1]),i=[],n=0;n<4;n++){var o=(e[2*n]+e[2*n+2])/2,r=(e[2*n+1]+e[2*n+3])/2;i.push(o,r)}return i},t.prototype._calcSlopeRatio=function(t){for(var e=[],i=null,n=t.slice(0,8).concat(t[0],t[1]),o=0;o<4;o++)i=n[2*o+3]-n[2*o+1]==0&&n[2*o+2]-n[2*o]==0?0:(n[2*o+3]-n[2*o+1])/(n[2*o+2]-n[2*o]),e.push(i);return e},t.prototype._calcIntersection=function(t,e,i,n){if(this._isRectCross(t,e,i,n)&&this._isLineSegmentCross(t,e,i,n)){var o,r=void 0,s=void 0;if(r=(n[0]-i[0])*(t[1]-e[1])-(e[0]-t[0])*(i[1]-n[1]),s=(t[1]-i[1])*(e[0]-t[0])*(n[0]-i[0])+i[0]*(n[1]-i[1])*(e[0]-t[0])-t[0]*(e[1]-t[1])*(n[0]-i[0]),0===r||0===s){var a=this._getLine(t,e),l=this._getLine(i,n),h=a[0],u=a[1],c=l[0],d=l[1];if(u[0]===c[0]&&u[1]===c[1])return u;if(h[0]===d[0]&&h[1]===d[1])return h;if(this._isOnLine(u,l)&&this._isOnLine(c,a))return[c,u];if(this._isOnLine(h,l)&&this._isOnLine(d,a))return[h,d];if(this._isOnLine(h,l)&&this._isOnLine(u,l))return[h,u];if(this._isOnLine(c,l)&&this._isOnLine(d,l))return[c,d]}return o=s/r,r=(t[0]-e[0])*(n[1]-i[1])-(e[1]-t[1])*(i[0]-n[0]),[o,(s=e[1]*(t[0]-e[0])*(n[1]-i[1])+(n[0]-e[0])*(n[1]-i[1])*(t[1]-e[1])-n[1]*(i[0]-n[0])*(e[1]-t[1]))/r]}return!1},t.prototype._getLine=function(t,e){return t[0]===e[0]?t[1]<e[1]?[t,e]:[e,t]:t[0]<e[0]?[t,e]:[e,t]},t.prototype._isOnLine=function(t,e){return e[0][0]===e[1][0]?t[1]>=e[0][1]&&t[1]<=e[1][1]:t[0]>=e[0][0]&&t[0]<=e[1][0]},t.prototype._isRectCross=function(t,e,i,n){var o=Math.min,r=Math.max;return o(t[0],e[0])<=r(i[0],n[0])&&o(i[0],n[0])<=r(t[0],e[0])&&o(t[1],e[1])<=r(i[1],n[1])&&o(i[1],n[1])<=r(t[1],e[1])},t.prototype._isLineSegmentCross=function(t,e,i,n){var o,r;return!(((o=t[0]*(i[1]-e[1])+e[0]*(t[1]-i[1])+i[0]*(e[1]-t[1]))^(r=t[0]*(n[1]-e[1])+e[0]*(t[1]-n[1])+n[0]*(e[1]-t[1])))>=0&&0!==o&&0!==r)&&!(((o=i[0]*(t[1]-n[1])+n[0]*(i[1]-t[1])+t[0]*(n[1]-i[1]))^(r=i[0]*(e[1]-n[1])+n[0]*(i[1]-e[1])+e[0]*(n[1]-i[1])))>=0&&0!==o&&0!==r)},t}();i.d(e,"a",(function(){return r}));var r=function(){function t(t,e){this._activeBoxId=null,this._startX=null,this._startY=null,this._addNewFlag=null,this._drawingFlag=!1,this.cropBoxes=[],this.width=0,this.height=0,this.zoom=1,this.aspectRatio=0,this.keepAspectRatio=!1,this.mouseDown=!1,this.unselectedCallback=null,this.selectedCallback=null,this.width=t,this.height=e}return t.prototype.setKeepAspectRatio=function(t){this.keepAspectRatio=t,this._drawingFlag||this.cropBoxes.forEach((function(e){e.keepAspectRatio=t}))},t.prototype.setAspectRatio=function(t){this.aspectRatio=t},t.prototype.setZoom=function(t){this.zoom=t,this.cropBoxes.forEach((function(e){e.zoom=t}))},t.prototype.setPageSize=function(t,e){this.width=t,this.height=e},t.prototype.getRectArr=function(){var t=[];return this.cropBoxes.forEach((function(e,i){var n=Object.assign({index:i},e.getRect());t.push(n)})),t},t.prototype.clear=function(){var t;this.cropBoxes.length>0&&(null===(t=this.unselectedCallback)||void 0===t||t.call(this)),this.cropBoxes=[]},t.prototype.addFreeBox=function(t){var e=Object(n.e)(),i=new o({vertexes:t.slice(),width:this.width,height:this.height,mode:"free",dpr:e});return this.cropBoxes.push(i),i},t.prototype.addBox=function(t,e){var i=Object(n.e)(),r=new o({vertexes:t.slice(),width:this.width,height:this.height,type:e,mode:"normal",aspectRatio:this.aspectRatio,keepAspectRatio:this.keepAspectRatio,zoom:this.zoom,dpr:i});return this.cropBoxes.push(r),r},t.prototype.removeBox=function(t){return t===undefined&&this.clear(),!(t<0||t>=this.cropBoxes.length)&&(this.cropBoxes.splice(t,1),!0)},t.prototype.getBoxByUid=function(t){for(var e=this.cropBoxes.length,i=0;i<e;i++)if(this.cropBoxes[i].uid===t)return this.cropBoxes[i];return null},t.prototype.onStartHandler=function(t,e,i){this._startX=t,this._startY=e,this.mouseDown=!0;var n=this.checkSelect(t,e);if(null===n)return i||this.clear(),void(this._activeBoxId=null);this._activeBoxId=this.cropBoxes[n].uid,this.getBoxByUid(this._activeBoxId).onStartHandler(t,e)},t.prototype.onMoveHandler=function(t,e,i){if(this.mouseDown){var n=null,o=t-this._startX,r=e-this._startY,s=null,a=2/this.zoom;!this._activeBoxId&&t-this._startX<-a&&e-this._startY<-a?(s=0,this.aspectRatio>0&&(r=o/this.aspectRatio)):!this._activeBoxId&&t-this._startX>a&&e-this._startY<-a?(s=1,this.aspectRatio>0&&(r=-o/this.aspectRatio)):!this._activeBoxId&&t-this._startX>a&&e-this._startY>a?(s=2,this.aspectRatio>0&&(r=o/this.aspectRatio)):!this._activeBoxId&&t-this._startX<-a&&e-this._startY>a&&(s=3,this.aspectRatio>0&&(r=-o/this.aspectRatio));var l=[t,this._startY+r,this._startX,this._startY+r,this._startX,this._startY,t,this._startY],h=[this._startX,this._startY,this._startX,this._startY+r,t,this._startY+r,t,this._startY];if(null!==s){for(var u=[],c=0;c<4;c++)s%2?(u.push(h[2*(s+c)%8]),u.push(h[(2*(s+c)+1)%8])):(u.push(l[2*(s+c)%8]),u.push(l[(2*(s+c)+1)%8]));return n=this.addBox(u,["topLeft","topRight","bottomRight","bottomLeft"][s]),this.aspectRatio>0?n.keepAspectRatio=!0:n.keepAspectRatio=!1,this._drawingFlag=!0,this._addNewFlag=this.keepAspectRatio,this._activeBoxId=n.uid,n.onStartHandler(this._startX,this._startY,s),n.onMoveHandler(t,e,s),void(s=null)}this._activeBoxId&&(n=this.getBoxByUid(this._activeBoxId)),n&&n.onMoveHandler(t,e)}},t.prototype.onEndHandler=function(){var t;if(this.mouseDown&&(this.mouseDown=!1,this._drawingFlag=!1,this._activeBoxId)){var e=this.getBoxByUid(this._activeBoxId);null!==this._addNewFlag&&(e.keepAspectRatio=this._addNewFlag,this._addNewFlag=null),e.onEndHandler(),this.cropBoxes.length>0&&(null===(t=this.selectedCallback)||void 0===t||t.call(this,this.getRectArr())),this._activeBoxId=null}},t.prototype.checkSelect=function(t,e){var i=this.cropBoxes.length;if(0===i)return null;for(var n=i-1;n>=0;n--){if(null!==this.cropBoxes[n].isBoxSelected(t,e))return n}return null},t.prototype.checkSelectForCursor=function(t,e){var i=this.cropBoxes.length;if(0===i)return null;for(var n=i-1;n>=0;n--){var o=this.cropBoxes[n],r=o.isBoxSelected(t,e);if(null!==r){var s="move";return-1!==r&&(s=o.checkPointPosition(r)),{part:r,type:o.type,position:s}}}return null},t.prototype.dispose=function(){this.unselectedCallback=null,this.selectedCallback=null},t}()},,,function(t,e,i){},,function(t,e,i){"use strict";i.r(e);i(6);var n,o=i(1),r=i(0),s=function(){function t(t){this._clickItem=null,this._clickTimer=null,this._rightClickItem=null,this._rightClickTimer=null,this._mouseDownItem=null,this._startX=0,this._startY=0,this._mouseUpItem=null,this._evtList=[],this.onClick=null,this.onRightClick=null,this.onDoubleClick=null,this.onPointDown=null,this.onPointMove=null,this.onPointUp=null,this.onPointOver=null,this.onPointOut=null,this._element=t,this._registerEvents()}return t.prototype._registerEvents=function(){var t,e=this,i=this._element,n=Object(o.u)(),r="mousedown",s="mousemove",a="mouseup";n&&(r="touchstart",s="touchmove",a="touchend",n=!0),t=Object(o.c)(i,r,(function(t){var i,o=e._packageEvent(t);e._mouseDownItem=e.getTarget(t),e._startX=o.clientX,e._startY=o.clientY,null===(i=e.onPointDown)||void 0===i||i.call(e,o),n?e._rightClickTimer=setTimeout((function(){var t;null===(t=e.onRightClick)||void 0===t||t.call(e,o),e._mouseDownItem=null}),500):2===o.button&&(e._rightClickItem=e.getTarget(o))}),{passive:!1}),this._evtList.push(t),t=Object(o.c)(i,s,(function(t){var i,n=e._packageEvent(t);null===(i=e.onPointMove)||void 0===i||i.call(e,n);var r=Math.abs(n.clientX-e._startX),s=Math.abs(n.clientY-e._startY);(r>5||s>5)&&(clearTimeout(e._rightClickTimer),Object(o.u)()&&(e._mouseDownItem=null))}),{passive:!1}),this._evtList.push(t),t=Object(o.c)(i,a,(function(t){var i,n,o=e._packageEvent(t);e._mouseUpItem=e.getTarget(o),null===(i=e.onPointUp)||void 0===i||i.call(e,o),clearTimeout(e._rightClickTimer),e.getTarget(o)===e._rightClickItem&&2===o.button?null===(n=e.onRightClick)||void 0===n||n.call(e,o):e._mouseDownItem===e._mouseUpItem&&e._clickHandler(o),e._rightClickItem=null})),this._evtList.push(t),t=Object(o.c)(i,"mouseover",(function(t){var i;if(!Object(o.u)()){var n=t.fromElement;n===undefined&&(n=t.relatedTarget);var r=t.toElement;r===undefined&&(r=t.target),e.getTarget(t,n)!==e.getTarget(t,r)&&(null===(i=e.onPointOver)||void 0===i||i.call(e,t))}})),this._evtList.push(t),t=Object(o.c)(i,"mouseout",(function(t){var i;if(!Object(o.u)()){var n=t.fromElement;n===undefined&&(n=t.target);var r=t.toElement;r===undefined&&(r=t.relatedTarget),e.getTarget(t,n)!==e.getTarget(t,r)&&(null===(i=e.onPointOut)||void 0===i||i.call(e,t))}})),this._evtList.push(t)},t.prototype._unregisterEvents=function(){this._evtList.forEach((function(t){Object(o.s)(t)&&t()})),this._evtList.splice(0)},t.prototype._clickHandler=function(t){var e=this,i=this._packageEvent(t);clearTimeout(this._clickTimer),this.getTarget(t)===this._clickItem?(this._clickItem=null,setTimeout((function(){var t;null===(t=e.onDoubleClick)||void 0===t||t.call(e,i)}))):this._mouseDownItem===this._mouseUpItem&&(this._clickItem=this.getTarget(i),setTimeout((function(){var t;null===(t=e.onClick)||void 0===t||t.call(e,i)}))),this._mouseDownItem=null,this._mouseUpItem=null,this._clickTimer=setTimeout((function(){e._clickItem=null}),500)},t.prototype._packageEvent=function(t){var e,i=null===(e=t.changedTouches)||void 0===e?void 0:e[0];if(!i)return t;for(var n in i)t[n]===undefined&&(t[n]=i[n]);return t},t.prototype.getTarget=function(t,e){return e!==undefined?e:t.target},t.prototype.dispose=function(){this._unregisterEvents(),this._element=null,this._clickItem=null,this._clickTimer=null,this._rightClickItem=null,this._rightClickTimer=null,this._mouseDownItem=null,this._mouseUpItem=null,this.onClick=null,this.onRightClick=null,this.onDoubleClick=null,this.onPointDown=null,this.onPointMove=null,this.onPointUp=null,this.onPointOver=null,this.onPointOut=null},t}(),a=i(2),l=undefined&&undefined.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),h=function(t){function e(e,i,n){var o=t.call(this,i)||this;return o.useMyEvent=!0,o._unbindList=[],o._customCanvas=null,o._viewerContainer=null,o._postfix=e,o._viewerContainer=n,o}return l(e,t),e.prototype.uiEventInit=function(){var e=this,i=function(t){var i,n,o="#"+t+e._postfix;return null===(n=null===(i=e._viewerContainer)||void 0===i?void 0:i.el)||void 0===n?void 0:n.querySelector(o)},n=r.c.CLICK,a=(r.c.MOUSE_DOWN,r.c.MOUSE_MOVE),l=r.c.MOUSE_UP;"ontouchend"in document.documentElement&&(r.c.TOUCH_START,a=r.c.TOUCH_MOVE,l=r.c.TOUCH_END);var h,u=this._unbindList;h=Object(o.c)(window,r.c.RESIZE,o.H.call(this,this._viewerResize,40)),u.push(h),h=Object(o.c)(window,"load",(function(t){e._viewerResize(t)})),u.push(h),h=Object(o.c)(document,a,(function(t){e._documentMouseMove(t)})),u.push(h),h=Object(o.c)(document,l,(function(t){e._documentMouseUp(t)})),u.push(h),h=Object(o.c)(window,"message",(function(t){"up"===t.data.type&&e._documentMouseUp()})),u.push(h),h=Object(o.c)(document,r.c.CLICK,(function(t){e._documentClick(t)})),u.push(h),h=Object(o.c)(document,"keydown",(function(i){t.prototype._emit.call(e,r.f.DOCUMENT_KEY_DOWN,i)})),u.push(h),h=Object(o.c)(document,"keyup",(function(i){t.prototype._emit.call(e,r.f.DOCUMENT_KEY_UP,i)})),u.push(h);var c=this._viewerContainer.el;h=Object(o.c)(c,"dragstart",(function(){return!1})),u.push(h),h=Object(o.c)(c,n,(function(t){e._viewerClick(t)})),u.push(h),h=Object(o.c)(c,r.c.CONTEXTMENU,(function(t){e._viewerRightClick(t)})),u.push(h),h=Object(o.c)(c,"dragover",(function(t){Object(o.C)(t)})),u.push(h),h=Object(o.c)(c,"drop",(function(t){e._dropFile(t)})),u.push(h),h=Object(o.c)(i("navChange"),n,(function(t){e._setSelectedSidetype(t)})),u.push(h),h=Object(o.c)(i("besides"),n,(function(t){e._sidebarClick(t)})),u.push(h),h=Object(o.c)(i("stretchBar"),r.c.MOUSE_DOWN,(function(t){e._sidebarStretchStart(t)})),u.push(h),h=Object(o.c)(i("defaultTag"),n,(function(){e._openDefaultTag()})),u.push(h),h=Object(o.c)(i("treeLists"),n,(function(t){e._fileListClick(t)})),u.push(h),h=Object(o.c)(i("treeLists"),r.c.CONTEXTMENU,(function(t){e._fileListRightClick(t)})),u.push(h),h=Object(o.c)(i("treeLists"),"keyup",(function(t){e._fileListKeyUp(t)})),u.push(h),h=Object(o.c)(i("addFolder"),r.c.CLICK,(function(t){e._addNewFolder(t)})),u.push(h),h=Object(o.c)(i("tagLists"),n,(function(t){e._tagListClick(t)})),u.push(h),h=Object(o.c)(i("tagLists"),r.c.CONTEXTMENU,(function(t){e._tagListRightClick(t)})),u.push(h),h=Object(o.c)(i("tagLists"),"keyup",(function(t){e._tagListKeyUp(t)})),u.push(h),h=Object(o.c)(i("addTag"),n,(function(t){e._addNewTag(t)})),u.push(h);var d=i("canvasEventLayer");h=Object(o.c)(d,"touchstart",(function(t){e._canvasTouchStart(t)}),{passive:!1}),u.push(h),h=Object(o.c)(d,"mousedown",(function(t){e._canvasMouseDown(t)})),u.push(h),h=Object(o.c)(d,"touchmove",(function(t){e._canvasTouchMove(t)}),{passive:!1}),u.push(h),h=Object(o.c)(d,"mousemove",(function(t){e._canvasMouseMove(t)})),u.push(h),h=Object(o.c)(d,"touchend",(function(t){e._canvasTouchEnd(t)})),u.push(h),h=Object(o.c)(d,"mouseup",(function(t){e._canvasMouseUp(t)})),u.push(h),h=Object(o.c)(d,"wheel",(function(t){e._canvasWheel(t)}),{passive:!1}),u.push(h),h=Object(o.c)(d,"click",(function(t){Object(o.G)(t)})),u.push(h);var p=new s(i("canvasEventLayer"));p.onClick=function(i){t.prototype._emit.call(e,r.d.CANVAS_CLICK,i)},p.onRightClick=function(i){t.prototype._emit.call(e,r.d.CANVAS_RIGHT_CLICK,i)},p.onDoubleClick=function(i){t.prototype._emit.call(e,r.d.CANVAS_DOUBLE_CLICK,i)},p.onPointOver=function(i){t.prototype._emit.call(e,r.d.CANVAS_MOUSE_OVER,i)},p.onPointOut=function(i){t.prototype._emit.call(e,r.d.CANVAS_MOUSE_OUT,i)},this._customCanvas=p,p=null,h=Object(o.c)(i("canvasScroll"),"scroll",(function(t){e._canvasScroll(t)})),u.push(h),h=Object(o.c)(i("tabList"),n,(function(t){e._tabListClick(t)})),u.push(h),h=Object(o.c)(i("pagerInput"),"blur",(function(t){e._pagerBlur(t)})),u.push(h),h=Object(o.c)(i("pagerInput"),"keyup",(function(t){13===t.keyCode&&t.target.blur()})),u.push(h)},e.prototype.unbindEvents=function(){this._unbindList.forEach((function(t){Object(o.s)(t)&&t()})),this._unbindList=[],this._customCanvas&&(this._customCanvas.dispose(),this._customCanvas=null)},e.prototype._viewerResize=function(e){t.prototype._emit.call(this,r.f.VIEWER_RESIZE,e)},e.prototype._documentMouseUp=function(e){t.prototype._emit.call(this,r.f.DOCUMENT_POINTER_UP,e),t.prototype._emit.call(this,r.d.DOCUMENT_UP,e),t.prototype._emit.call(this,r.g.DOCUMENT_POINTER_UP,e)},e.prototype._documentMouseMove=function(e){t.prototype._emit.call(this,r.f.DOCUMENT_POINTER_MOVE,e),t.prototype._emit.call(this,r.d.DOCUMENT_MOVE,e),t.prototype._emit.call(this,r.g.DOCUMENT_POINTER_MOVE,e)},e.prototype._documentClick=function(e){t.prototype._emit.call(this,r.f.DOCUMENT_CLICK,e),t.prototype._emit.call(this,r.g.DOCUMENT_CLICK,e)},e.prototype._viewerClick=function(e){t.prototype._emit.call(this,r.f.VIEWER_CLICK,e)},e.prototype._viewerRightClick=function(e){Object(o.C)(e),t.prototype._emit.call(this,r.f.VIEWER_RIGHT_CLICK,e)},e.prototype._viewerMove=function(e){t.prototype._emit.call(this,r.f.VIEWER_MOVE,e)},e.prototype._dropFile=function(e){Object(o.C)(e),t.prototype._emit.call(this,r.g.FILE_DROP,e)},e.prototype._setSelectedSidetype=function(t){},e.prototype._sidebarClick=function(e){Object(o.G)(e),t.prototype._emit.call(this,r.f.SIDEBAR_CLICK),t.prototype._emit.call(this,r.g.SIDEBAR_CLICK)},e.prototype._sidebarStretchStart=function(e){t.prototype._emit.call(this,r.f.SIDEBAR_STRETCH_START,e)},e.prototype._openDefaultTag=function(){t.prototype._emit.call(this,r.f.OPEN_DEFAULT_TAG)},e.prototype._fileListClick=function(e){t.prototype._emit.call(this,r.f.FILE_LIST_CLICK,e),t.prototype._emit.call(this,r.g.FILE_LIST_CLICK,e)},e.prototype._fileListRightClick=function(e){t.prototype._emit.call(this,r.f.FILE_LIST_RIGHT_CLICK,e),t.prototype._emit.call(this,r.g.FILE_LIST_RIGHT_CLICK,e)},e.prototype._fileListKeyUp=function(e){t.prototype._emit.call(this,r.f.FILE_KEY_UP,e),t.prototype._emit.call(this,r.g.FILE_KEY_UP,e)},e.prototype._addNewFolder=function(e){t.prototype._emit.call(this,r.f.ADD_NEW_FOLDER,e)},e.prototype._tagListClick=function(e){t.prototype._emit.call(this,r.f.TAG_LIST_CLICK,e),t.prototype._emit.call(this,r.g.TAG_LIST_CLICK,e)},e.prototype._tagListRightClick=function(e){t.prototype._emit.call(this,r.f.TAG_LIST_RIGHT_CLICK,e),t.prototype._emit.call(this,r.g.TAG_LIST_RIGHT_CLICK,e)},e.prototype._tagListKeyUp=function(e){t.prototype._emit.call(this,r.f.TAG_KEY_UP,e),t.prototype._emit.call(this,r.g.TAG_KEY_UP,e)},e.prototype._addNewTag=function(e){t.prototype._emit.call(this,r.f.ADD_NEW_TAG,e)},e.prototype._canvasTouchStart=function(e){t.prototype._emit.call(this,r.d.CANVAS_TOUCH_START,e)},e.prototype._canvasTouchMove=function(e){t.prototype._emit.call(this,r.d.CANVAS_TOUCH_MOVE,e)},e.prototype._canvasTouchEnd=function(e){t.prototype._emit.call(this,r.d.CANVAS_TOUCH_END,e)},e.prototype._canvasMouseDown=function(e){t.prototype._emit.call(this,r.d.CANVAS_MOUSE_DOWN,e)},e.prototype._canvasMouseMove=function(e){t.prototype._emit.call(this,r.d.CANVAS_MOUSE_MOVE,e)},e.prototype._canvasMouseUp=function(e){t.prototype._emit.call(this,r.d.CANVAS_MOUSE_UP,e)},e.prototype._canvasWheel=function(e){t.prototype._emit.call(this,r.d.CANVAS_WHEEL,e)},e.prototype._canvasScroll=function(e){t.prototype._emit.call(this,r.d.CANVAS_SCROLL,e)},e.prototype._tabListClick=function(e){t.prototype._emit.call(this,r.f.TAB_LIST_CLICK,e)},e.prototype._pagerBlur=function(e){t.prototype._emit.call(this,r.f.PAGER_BLUR,e)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.unbindEvents()},e}(a.a),u=function(){function t(t,e,i){this._pubsub=null,this.element=null,this.containerEl=null,this.location="",this.visibility=!0,this.cssStyle="",this.tagName="div",this.name="",this._postfix=t,this._pubsub=i,this.element=this._createElement(e)}return t.prototype.bindElement=function(t,e){var i=this._createElement(e);return this.containerEl=t,!!i&&(t.appendChild(i),!0)},t.prototype.setAttributes=function(t){return!!Object(o.w)(t)&&(this._initConfig(t),this._updateAttributes(),!0)},t.prototype._createElement=function(t){var e,i;this.element&&(null===(i=null===(e=this.containerEl)||void 0===e?void 0:e.removeChild)||void 0===i||i.call(e,this.element),this.element=null),this._initConfig(t);var n=document.createElement(this.tagName);return this._updateAttributes(n),n},t.prototype._initConfig=function(t){if(!Object(o.w)(t))return!1;for(var e in t)t[e]!==undefined&&(this[e]=t[e]);return!0},t.prototype._updateAttributes=function(t){if(Object(o.q)(t)||(t=this.element),!t)return!1;if(t.className=this.visibility?"":" dvs-disabled",this.name&&t.classList.add("dvs-"+this.name),this.cssStyle&&t.classList.add(this.cssStyle),this.name&&(t.id=""+(this.name+this._postfix)),this.sequence!==undefined){var e=null==t?void 0:t.style;"string"==typeof e.msFlexOrder?e.msFlexOrder=this.sequence:e.order=this.sequence}return!0},t}(),c=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),d=function(t){function e(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.apply(this,e)||this}return c(e,t),e}(u),p=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_=function(t){function e(e,i,n){var o=t.call(this,e,i,n)||this;return o.groups={},o}return p(e,t),e}(u),v=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),f=function(t){function e(e,i,n){var o=t.call(this,e,i,n)||this;return o.buttons={},o._setGroupClass(),o}return v(e,t),e.prototype._setGroupClass=function(){var t;null===(t=this.element)||void 0===t||t.classList.add("dvs-groupType")},e}(u),m=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),g=function(t){function e(e,i,n){var o=t.call(this,e,i,n)||this;return o.onButtonClick="",o.iconClass="",o.text="",o.title="",o}return m(e,t),e.prototype._updateAttributes=function(t){var e=this;if(Object(o.q)(t)||(t=this.element),!t)return!1;if(t.className=("ds-dvs-ui-iconfont dvs-"+this.name+" "+(this.cssStyle||"")+" "+(this.iconClass||"")+" "+(this.visibility?"":"dvs-nodisplay")).trim(),t.id=""+(this.name+this._postfix),this.text&&Object(o.y)(this.text))if("input"===this.tagName)t.value=this.text||"";else{var i=document.createElement("span");i.innerText=this.text||"",t.appendChild(i)}var n=null==t?void 0:t.style;return"string"==typeof n.msFlexOrder?n.msFlexOrder=this.sequence:n.order=this.sequence,this.title&&(t.title=this.title),this.onButtonClick?t.onclick=function(t){e.onButtonClick&&e._pubsub.emit(r.f.CUSTOM_BUTTON_CLICK,e.onButtonClick,t)}:t.onclick=null,!0},e}(u),y=function(){function t(t){var e=t.el,i=t.sequence,n=t.isFull,r=t.pubsub,s=t.container;this.uid="",this.element=null,this.sequence=0,this.isFull=!1,this._visibility=!0,this.uid=Object(o.I)(11),this.element=e,this.sequence=i,this._pubsub=r,this.isFull=n,this._container=s,this._bindElement()}return t.prototype.show=function(){var t,e;return!this._visibility&&(this._visibility=!0,null===(e=null===(t=this.element)||void 0===t?void 0:t.classList)||void 0===e||e.remove("dvs-nodisplay"),this._pubsub.emit(r.f.VIEWER_RESIZE),!0)},t.prototype.hide=function(){var t,e;return!!this._visibility&&(this._visibility=!1,null===(e=null===(t=this.element)||void 0===t?void 0:t.classList)||void 0===e||e.add("dvs-nodisplay"),this._pubsub.emit(r.f.VIEWER_RESIZE),!0)},t.prototype.dispose=function(){var t,e;for(var i in null===(e=null===(t=this.element)||void 0===t?void 0:t.parentNode)||void 0===e||e.removeChild(this.element),this._pubsub.emit(r.f.VIEWER_RESIZE),this)delete this[i];return!0},t.prototype._bindElement=function(){var t=this._container;if(!t)return!1;var e=this.element;this.isFull?e.classList.add("dvs-upper-full"):e.classList.remove("dvs-upper-full"),e.style.order=String(this.sequence),e.style.msFlexOrder=String(this.sequence),e.classList.add("dvs-customElement"),this._visibility||e.classList.add("dvs-nodisplay"),t.appendChild(e),this._container=null,this._pubsub.emit(r.f.VIEWER_RESIZE)},t}(),b=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),E=function(t){function e(e){var i=e.postfix,n=e.container,o=e.uiConfig,r=e.pubsub,s=t.call(this,r)||this;return s._postfix="",s.uiConfig=null,s._assembledConfig={},s._customElements={},s.contentContainer=null,s.viewerContainer=null,s._postfix=i,s.uiConfig=o,s.viewerContainer={el:s.initUi(n)},s}return b(e,t),e.prototype._myQueryById=function(t){var e,i;return null===(i=null===(e=this.viewerContainer)||void 0===e?void 0:e.el)||void 0===i?void 0:i.querySelector("#"+t)},e.prototype.initUi=function(t,e){if(e){if(!Object(o.w)(e))return null;Object(o.B)(e,this.uiConfig)}if(Object(o.y)(t)&&(t=document.getElementById(t)),!Object(o.q)(t))return null;var i=this._assemblyConfig(this.uiConfig);this._assembledConfig=i;var n=new d(this._postfix,{name:"WebViewer"});return this._createContainers({header:{},body:{sidebar:{},showImageArea:{content:{topMenu:{},tabList:{},middle:{asideMenu:{},container:{viewPort:{canvasWrapper:{canvasEventLayer:{},loadingLayer:{loadingImage:"img"}},canvasScroll:{scrollInner:{}}},videoContainer:{videoImage:"img"},innerThumbnail:{}}},bottomMenu:{}}}},hiddenBox:{}},n.element),t.appendChild(n.element),n.element},e.prototype._createContainers=function(t,e){for(var i in t){var n=null,r=t[i];if("sidebar"===i)n=this._initSidebar();else if("hiddenBox"===i)n=this._initHiddenBox();else if(this._assembledConfig[i]){var s=this._initToolbarItem(this._assembledConfig[i]);n=null==s?void 0:s.element}else{n=new d(this._postfix,{name:i,tagName:Object(o.y)(r)?r:undefined,visibility:this.uiConfig.toolbars[i]===undefined||this.uiConfig.toolbars[i]}).element}n&&(Object(o.w)(t[i])&&this._createContainers(r,n),e.appendChild(n))}return!0},e.prototype._initToolbarItem=function(t){if(!t.visibility)return null;var e=new _(this._postfix,t,this._oPub);for(var i in t.groups){var n=t.groups[i];!n.name&&(n.name=i);var o=this._initGroupItem(n);o&&e.element.appendChild(o.element)}return e},e.prototype._initGroupItem=function(t){if(!1===t.visibility)return null;t.visibility=!0;var e=new f(this._postfix,t,this._oPub);for(var i in t.buttons){var n=t.buttons[i];!n.name&&(n.name=i);var o=this._initButtonItem(n);o&&o.forEach((function(t){e.element.appendChild(t.element)}))}var r=new g(this._postfix,{name:"showBefore",visibility:!0,location:e.name,tagName:"SPAN",iconClass:"ds-dvs-ui-move_right dvs-nodisplay"},this._oPub),s=new g(this._postfix,{name:"showAfter",visibility:!0,location:e.name,tagName:"SPAN",iconClass:"ds-dvs-ui-move_left dvs-nodisplay"},this._oPub);return e.element.appendChild(r.element),e.element.appendChild(s.element),e},e.prototype._initButtonItem=function(t){var e=this;if(!1!==t.visibility){t.visibility=!0;var i=this.uiConfig.tipsConfig;if("pagination"===t.name){var n=[{name:"pagerInput",sequence:t.sequence,tagName:"input",text:"0"},{name:"pageBreak",sequence:t.sequence,tagName:"p",text:""},{name:"pagerLabel",sequence:t.sequence,tagName:"label",text:"0"}],r=[];return n.forEach((function(n){r.push(new g(e._postfix,{visibility:t.visibility,name:n.name,sequence:n.sequence,location:t.location,text:n.text||"",tagName:n.tagName,title:i[t.name]}))})),r}return Object(o.A)({title:i[t.name]},t),[new g(this._postfix,t,this._oPub)]}},e.prototype._assemblyConfig=function(t){var e,i,n,s={},a={},l=t.toolbars,h=t.groups,u=t.buttons;for(var c in l){var d=Boolean(l[c]);s[c]={name:c,visibility:d,groups:(null===(n=l[c])||void 0===n?void 0:n.groups)||{}}}for(var p in h)a[p]=h[p];for(var _ in u){var v=u[_];(f=a[p=v.location])?(f.buttons=f.buttons||{},Object(o.B)(((e={})[_]=v,e),f.buttons)):this._emit(r.d.ERROR,{code:80024,message:"The group "+p+" is not exist."})}for(var p in a){var f,m=s[c=(f=a[p]).location];m?Object(o.B)(((i={})[p]=f,i),m.groups):this._emit(r.d.ERROR,{code:80024,message:"The toolbar "+c+" is not exist."})}return s},e.prototype._initSidebar=function(){var t=this.uiConfig,e=0,i=t.tree&&t.tree.visibility,n=t.tag&&t.tag.visibility;if(!i&&!n)return null;var o=new d(this._postfix,{name:"sidebar",visibility:t.showSidebar&&(i||n)}),r="",s='<ul id="navChange'+this._postfix+'" class="dvs-navChange">',a='<ul id="paneShow'+this._postfix+'" class="dvs-paneShow">';return s+='<li id="DirctoryTreeNav'+this._postfix+'" sidetype="tree" class="dvs-DirctoryTreeNav'+(0===e?" activeTab":"")+" "+(i?"":"dvs-disabled")+'">\n <div class="ds-dvs-ui-iconfont '+t.tree.iconClass+'"></div>\n </li>',a+='<li id="DirctoryTree'+this._postfix+'" sidetype="tree" class="dvs-DirctoryTree'+(e?" dvs-nodisplay":"")+" "+(i?"":"dvs-disabled")+'">\n <ul class="treeLists" id="treeLists'+this._postfix+"\"></ul>\n <div id='addFolderBox"+this._postfix+"' class='dvs-addFolderBox'>\n <div id='addFolder"+this._postfix+"' class='dvs-addFolder'>Add folder</div>\n </div>\n </li>\n ",i&&e++,s+='<li id="TagsNav'+this._postfix+'" sidetype="tag" class="dvs-TagsNav'+(0===e?" activeTab":"")+" "+(n?"":"dvs-disabled")+' ">\n <div class="ds-dvs-ui-iconfont '+t.tag.iconClass+'"></div>\n </li>',a+='<li id="Tags'+this._postfix+'" sidetype="tag" class="dvs-Tags'+(e?" dvs-nodisplay":"")+" "+(n?"":"dvs-disabled")+'">\n \n <ul id="tagLists'+this._postfix+'" class="tagLists"></ul>\n <div id=\'addTagBox'+this._postfix+"' class='dvs-addTagBox'>\n <div id='addTag"+this._postfix+"' class='dvs-addTag'>Add tag</div>\n </div>\n </li>",n&&e++,r+=(s+="</ul>")+(a+="</ul>"),r+='<div id="stretchBar'+this._postfix+'" class="dvs-stretchBar"></div>',o.element.innerHTML=r,o.element},e.prototype._initHiddenBox=function(){this.uiConfig;return new d(this._postfix,{name:"hiddenBox"}).element},e.prototype.bindContent=function(t){var e=this._myQueryById("content"+this._postfix),i=this._myQueryById("header"+this._postfix);if(!t||!i||!e)return!1;var n=document.createElement("div");return n.setAttribute("style","display:flex;flex-direction:column;width:100%;height:100%;"),n.id="contentContainer"+this._postfix,n.appendChild(i),n.appendChild(e),t.appendChild(n),this.contentContainer=n,!0},e.prototype.unbindContent=function(t){var e;void 0===t&&(t=!1);var i=null===(e=this.viewerContainer)||void 0===e?void 0:e.el,n=this.contentContainer;if(!i||!n)return!1;var r=n.querySelector("#content"+this._postfix),s=n.querySelector("#header"+this._postfix),a=this._myQueryById("showImageArea"+this._postfix);return s&&Object(o.l)(s,i.children[0],i),a&&r&&a.appendChild(r),n&&n.parentNode&&n.parentNode.removeChild(n),this.contentContainer=null,!0},e.prototype.createCustomElement=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=!1),Object(o.y)(t)&&(t=document.getElementById(t)),!Object(o.q)(t))return null;var n=new y({el:t,sequence:e,isFull:i,pubsub:this._oPub,container:this._myQueryById("container"+this._postfix)}),r=n.uid;return this._customElements[r]=n,n},e.prototype.removeAllCustomElements=function(){for(var t in this._customElements)this._customElements[t].element=null,this._customElements[t]=null;this._customElements=null},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.uiConfig=null,this._assembledConfig=null;for(var e=Object.keys(this._customElements),i=0,n=e.length;i<n;i++){var o=e[i],r=this._customElements[o];r&&r.dispose(),r=null}this._customElements=null,this.contentContainer=null,this.viewerContainer&&(this.viewerContainer.el=null),this.viewerContainer=null},e}(a.a),C=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),S=function(t){function e(e,i,n){var r=t.call(this,i)||this;return r._canvasItem=null,r.renderImg=null,r.imgSrc=null,r.uid="",r.tags=[],r.optimization=!1,r._dataStore=null,r._showPage=!1,r._showSelectBox=!1,r._currentPage=-1,r._isSelected=!1,r._checkboxColor="#333",r._tempData={currentPage:-1,showPage:!1,showSelectBox:!1,isSelected:!1,checkboxColor:"#333"},r.allowCrossOrigin=!0,r.fitRatio=0,r._canvasWidth=0,r._canvasHeight=0,r._devicePixelRatio=1,r._rectArr=[],r._dataStore=n,r._devicePixelRatio=Object(o.e)(),e&&r.init(e),r}return C(e,t),e.prototype.init=function(t){for(var e in t)e!==undefined&&t[e]&&(this[e]=t[e]);this.renderImg=null},e.prototype.updateData=function(t){var e=t.data,i=t.tags,n=t.optimization;e!==this.imgSrc&&(this.imgSrc=e,this.renderImg&&(this.renderImg.onload=null),this.renderImg=null,this.tags=i,this.optimization=n)},e.prototype.emptyPage=function(){this.renderImg&&(this.renderImg.onload=null),this.renderImg=null,this._canvasItem&&(this._canvasItem.width=1,this._canvasItem.height=1,this._canvasItem.getContext("2d").clearRect(0,0,1,1),this._canvasItem.width=0,this._canvasItem.height=0)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.emptyPage(),this.imgSrc=null,this._canvasItem=null},e.prototype.render=function(t){var e=this;if(void 0===t&&(t=!0),!this._canvasItem||this._canvasItem.clientWidth<=0||this._canvasItem.clientHeight<=0)return!1;if(this.renderImg)this.renderImg.complete&&(this.renderImg.onload=null,this._renderImage(t));else{if(!this.imgSrc)return this._clearCanvas(),!1;var i=this.renderImg||new Image;this.allowCrossOrigin&&(i.crossOrigin="anonymous");var n=this.width,o=this.height,r=this._devicePixelRatio,s=this._dataStore.getMid(this.uid);if((null==s?void 0:s.tempWidth)&&(null==s?void 0:s.tempHeight)){var a=Math.min(n/r/s.tempWidth,o/r/s.tempHeight,1);n=Math.floor(a*s.tempWidth),o=Math.floor(a*s.tempHeight)}var l=this.imgSrc;i.src=l,i.onload=function(){e._renderImage(t),i.onload=null},this.renderImg=i}},e.prototype.renderPage=function(){if(this.renderImg&&this._showPage&&this._canvasItem){var t=this.width,e=this.height,i=this._devicePixelRatio,n=Math.min(t,e)/10;n=Math.max(10*i,n),n=Math.min(20*i,n);var o=this._canvasItem.getContext("2d"),r=.99*t-n,s=.99*e-n;o.save(),o.beginPath(),o.lineWidth=i,o.fillStyle="rgba(255,255,255,0.8)",o.strokeStyle="#a79898",o.arc(r,s,n,0,2*Math.PI),o.closePath(),o.fill(),o.stroke(),o.textAlign="center",o.textBaseline="middle",o.fillStyle="#333",o.font=n+"px normal",o.fillText(String(this._currentPage),r,s+n/8,n),o.restore()}},e.prototype.renderBox=function(){if(this.renderImg&&this._showSelectBox&&this._canvasItem){var t=this.width,e=this.height,i=Math.min(t,e)/7,n=this._devicePixelRatio;i=Math.max(15*n,i),i=Math.min(40*n,i);var o=this._canvasItem.getContext("2d"),r=.01*t,s=.01*e;o.save(),o.lineWidth=i/10,o.fillStyle="rgba(255,255,255,0.8)",o.strokeStyle=this._checkboxColor,o.fillRect(r,s,i,i),o.strokeRect(r,s,i,i),this._isSelected&&(o.save(),o.beginPath(),o.lineCap="round",o.lineJoin="round",o.moveTo(r+.25*i,s+.5*i),o.lineTo(r+.5*i,s+.7*i),o.lineTo(r+5*i/6,s+.3*i),o.stroke(),o.closePath(),o.restore()),o.restore()}},e.prototype.renderOptimizedPage=function(t,e,i,n){var o=this;if(void 0===n&&(n=0),!(n>=2))if(this.renderImg&&(this.renderImg.onload=null),0!==this.width&&0!==this.height){var r=(this.width-e)/2,s=(this.height-i)/2,a=this._canvasItem;if(a){var l=a.getContext("2d");if(l){l.save(),l.clearRect(0,0,a.width,a.height);for(var h=0;h<t.length;h++){var u=t[h];l.putImageData(u.target,r,s+u.start_y)}l.restore(),this.renderPage(),this.renderBox(),this.drawRect()}}}else setTimeout((function(){o.renderOptimizedPage(t,e,i,n++)}),20)},e.prototype._renderImage=function(e){void 0===e&&(e=!0);var i=this.renderImg;if(i&&this._canvasItem){var n=this._canvasItem.getContext("2d");if(n){n.save(),n.clearRect(0,0,this._canvasItem.width,this._canvasItem.height);var o=this._calDrawImagePos(i),s=o.left,a=o.top,l=o.width,h=o.height;n.drawImage(i,s,a,l,h),n.restore(),this.renderPage(),this.renderBox(),this.drawRect(),e&&t.prototype._emit.call(this,r.g.VIEWER_PAGE_RENDERED,this._currentPage-1)}}},e.prototype._calDrawImagePos=function(t){var e=t.naturalWidth,i=t.naturalHeight,n={left:0,top:0,width:0,height:0};if(this.width<=0||this.height<=0)return n;var o=this._devicePixelRatio;if(!this.optimization){var r=this.width,s=this.height,a=this._dataStore.getMid(this.uid);if((null==a?void 0:a.tempWidth)&&(null==a?void 0:a.tempHeight)){var l=Math.min(r/o/a.tempWidth,s/o/a.tempHeight,1);r=Math.floor(l*a.tempWidth),s=Math.floor(l*a.tempHeight)}var h=Math.max(e/r,i/s);this.fitRatio=h,e/=h,i/=h}return n={left:Math.floor((this.width-e*o)/2),top:Math.floor((this.height-i*o)/2),width:Math.floor(e*o),height:Math.floor(i*o)}},e.prototype._clearCanvas=function(){if(this._canvasItem){var t=this._canvasItem.getContext("2d");t&&t.clearRect(0,0,this._canvasItem.width,this._canvasItem.height)}},Object.defineProperty(e.prototype,"width",{get:function(){return this._canvasItem?this._canvasItem.width:0},set:function(t){this._setCanvasWidth(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._canvasItem?this._canvasItem.height:0},set:function(t){this._setCanvasHeight(t)},enumerable:!1,configurable:!0}),e.prototype.setTempData=function(t){this._tempData=t},e.prototype._setCanvasWidth=function(t){this._canvasItem&&(this._canvasWidth=t,this._canvasItem.width=t)},e.prototype._setCanvasHeight=function(t){this._canvasItem&&(this._canvasHeight=t,this._canvasItem.height=t)},e.prototype.resizeCanvasSize=function(t){void 0===t&&(t=!1);var e=this._canvasItem;if(!e||!this.renderImg&&!this.imgSrc)return!1;var i=e.clientWidth*this._devicePixelRatio,n=e.clientHeight*this._devicePixelRatio;if(i<=0||n<=0)return!1;var o=this._checkIfRenderPageOrBox();if(Math.abs(i-this.width)<=2&&Math.abs(n-this.height)<=2&&this.renderImg&&!o)return!1;this.width!==i&&(this.width=i),this.height!==n&&(this.height=n),t&&-1===this.imgSrc.indexOf("blob:")&&(this.renderImg=null),this.render()},e.prototype._checkIfRenderPageOrBox=function(){var t=!1;for(var e in this._tempData){var i=this["_"+e],n=this._tempData[e];if(n===i)this._tempData[e]=i;else switch(this["_"+e]=n,e){case"currentPage":this._showPage&&(t=!0);break;case"isSelected":this._showSelectBox&&(t=!0);break;default:t=!0}}return t},e.prototype.setRect=function(t,e){this._rectArr=t,e&&(this._boxColor=e)},e.prototype.drawRect=function(){var t=this._rectArr;if(0!==t.length&&this.renderImg){var e=this._boxColor,i=this._dataStore.getMid(this.uid);if((null==i?void 0:i.tempWidth)&&(null==i?void 0:i.tempHeight))for(var n=i.tempWidth/this.renderImg.naturalWidth,o=0;o<t.length;o++)for(var r=t[o],s=0;s+1<8;s+=2){var a=e,l=r.probePoints[s]/n,h=r.probePoints[s+1]/n,u=r.midpoints[s]/n,c=r.midpoints[s+1]/n;this._drawPoint(this._transformRect(l,h),a),this._drawPoint(this._transformRect(u,c),e);var d=r.probePoints[(s+2)%8]/n,p=r.probePoints[(s+3)%8]/n;d!==undefined&&p!==undefined&&this._drawLine(this._transformRect(l,h),this._transformRect(d,p),e,r.dashLine)}}},e.prototype._transformRect=function(t,e){var i=this.renderImg,n=i.naturalWidth,o=i.naturalHeight,r=this.fitRatio;return{x:this.width/2+(t-n/2)/r*this._devicePixelRatio,y:this.height/2+(e-o/2)/r*this._devicePixelRatio}},e.prototype._drawPoint=function(t,e){var i=t.x,n=t.y;if(this._canvasItem){var o=this._canvasItem.getContext("2d");o.save(),o.lineWidth=this._devicePixelRatio,o.strokeStyle=e,o.strokeRect(i-4*this._devicePixelRatio,n-4*this._devicePixelRatio,8*this._devicePixelRatio,8*this._devicePixelRatio),o.restore()}},e.prototype._drawLine=function(t,e,i,n){var o=this,r=t.x,s=t.y,a=e.x,l=e.y;if(this._canvasItem){var h=this._canvasItem.getContext("2d");h.save();try{h.setLineDash(n.map((function(t){return t*o._devicePixelRatio})))}catch(u){}h.lineWidth=this._devicePixelRatio,h.strokeStyle=i,h.beginPath(),h.moveTo(r,s),h.lineTo(a,l),h.stroke(),h.restore()}},e}(a.a),I=function(){function t(t){void 0===t&&(t=[]),this.array=[],this.array=Object(o.J)(t)}return t.prototype.add=function(t){return!~this.array.indexOf(t)&&(this.array.push(t),!0)},t.prototype["delete"]=function(t){var e=this.array.indexOf(t);return!!~e&&(this.array.splice(e,1),!0)},t.prototype.concat=function(t){return Object(o.J)(this.array.concat(t))},t.prototype.equal=function(t){if(t.length!==this.array.length)return!1;if(!t.length)return!0;for(var e=0;e<this.array.length;e++)if(this.array[e]!==t[e])return!1;return!0},t}(),T=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),w=undefined&&undefined.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,o++)n[o]=r[s];return n},O=function(t){function e(e,i,n,o,r){var s=t.call(this,i)||this;return s.uid="",s._pubSub=null,s._viewerContainer=null,s._postfix="",s._thumbnailElement=null,s._dataStore=null,s.isInner=!1,s._iObserver=null,s._customThumbnailEvent=null,s._size=180,s._mouseShape="pointer",s._scrollDirection="vertical",s._sequence=0,s._location="horizontal",s._showThumbnail=!0,s._showPageNumber=!1,s._showSelectBox=!1,s._checkboxColor="",s._showRemoveBtn=!1,s._fullThumbnail=!1,s._multipleMode=!1,s.allowPageDragging=!0,s._allowResizing=!1,s.allowHover=!0,s.allowKeyboardControl=!0,s.autoChangeIndex=!1,s.rows=1,s.columns=1,s._background="rgba(67,66,70,1)",s._border="1px solid rgba(27,27,29,1)",s._pageBackground="rgba(0,0,0,0)",s._pageBorder="1px solid rgba(128,128,128,1)",s._selectedPageBackground="rgba(127,133,251,1)",s._selectedPageBorder="1px solid rgba(255,0,0,1)",s.hoverPageBackground="rgba(196,250,248,1)",s.hoverPageBorder="1px solid rgba(255,255,0,1)",s.placeholderBackground="rgba(255,192,203,1)",s._pageMargin=10,s._pageMarginNumber=0,s._currentPageMargin=-1,s.isDrag=!1,s.ifDragMoves=!1,s._dragTimer=null,s._dragStart=!1,s.needClick=!0,s.thumbMoveOption={napX:0,napY:0,clickX:0,clickY:0,target:null},s._stretchItem=null,s._isStretching=!1,s._isCrop=!1,s._topImageIndex=-1,s._prtScrollOnce=!1,s._calculateTopIndex=-1,s._showUids=new I,s._showIndexes=new I,s._renderIndexes=new I,s._renderUids=new I,s._tempThumbnailSize={width:1,height:1},s._splitTimer=null,s.selectedIndexes=[],s.currentIndex=-1,s._thumbnailCanvas=[],s._uidTbCanvas={},s._eventList={},s._renderTimer=null,s.isDragUp=!1,s._viewerContainer=n,s._postfix=o,s._dataStore=r,s._thumbnailInit(e),s._pubQuery=function(t){var e;return null===(e=null==n?void 0:n.el)||void 0===e?void 0:e.querySelector("#"+t)},s}return T(e,t),e.prototype._thumbnailInit=function(t){this._initThumbnailUi(t.uid),this._initThumbnailConfig(t),this._initIntersectionObserver(),this._bindSelfEvents(),this._bindUiEvent()},e.prototype._initThumbnailConfig=function(t){for(var e in this._pubSub=new a.a(t.pubsub),t)"pubsub"!==(e=e.replace("canvas",""))&&(this[e]=t[e])},e.prototype._initThumbnailUi=function(t){var e=new d(t,{name:"Thumbnail"}),i="horizontal"===this.location?"":"dvs-nodisplay",n="vertical"===this.location?"":"dvs-nodisplay";e.element.innerHTML="\n <div id='stretchBarLeft"+t+"' class='dvs-stretchBar dvs-stretchLeft "+i+"'></div>\n <div id='stretchBarTop"+t+"' class='dvs-stretchBar dvs-stretchTop "+n+"'></div>\n <div id='stretchBarRight"+t+"' class='dvs-stretchBar dvs-stretchRight "+i+"'></div>\n <div id='stretchBarBottom"+t+"' class='dvs-stretchBar dvs-stretchBottom "+n+"'></div>\n <ul id=\"thumbLists"+t+'" class="dvs-thumbLists"></ul>\n ',this._thumbnailElement=e.element,this._myQuery=function(t){var e;return null===(e=this._thumbnailElement)||void 0===e?void 0:e.querySelector("#"+t)},this._myQueryAll=function(t){var e;return null===(e=this._thumbnailElement)||void 0===e?void 0:e.querySelectorAll("#"+t)}},e.prototype._initIntersectionObserver=function(){var t=this;if(window.IntersectionObserver&&this._thumbnailElement){var e=new IntersectionObserver((function(e){t._handleObservePages(e)}),{root:this._thumbnailElement.querySelector(".dvs-thumbLists")});this._iObserver=e}},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(t){this._size=t,t=String(t),this._fullThumbnail?t="100%":/\d+$/.test(t)&&(t+="px");var e=this._thumbnailElement;e&&(e.style.flex="0 0 "+t,e.style.msFlex="0 0 "+t,"vertical"===this.location?(e.style.width="100%",e.style.maxWidth="100%",e.style.height=t,e.style.maxHeight=t):(e.style.width=t,e.style.maxWidth=t,e.style.height="100%",e.style.maxHeight="100%"),this._resizeViewer())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mouseShape",{get:function(){return this._mouseShape},set:function(t){this._mouseShape=t;var e=this._thumbnailElement;e&&(e.style.cursor=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollDirection",{get:function(){return this._scrollDirection},set:function(t){this._scrollDirection=t;var e=this._thumbnailElement;if(e){var i=e.querySelector("#thumbLists"+this.uid);"vertical"===t?(i.style.flexDirection="row",i.style.overflowX="hidden",i.style.overflowY="auto"):(i.style.flexDirection="column",i.style.overflowX="auto",i.style.overflowY="hidden"),this._resizeViewer(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sequence",{get:function(){return this._sequence},set:function(t){this._sequence=t;var e=this._thumbnailElement;e&&(e.style.order=String(t),e.style.msFlexOrder=t,this._updateStretchBars(),this._setSplitBarDelay())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return this._location},set:function(t){var e;this._location=t;var i=null,n=null===(e=this._viewerContainer)||void 0===e?void 0:e.el;if(n&&this._thumbnailElement){var o={vertical:"#content"+this._postfix,horizontal:"#middle"+this._postfix,canvas:"#innerThumbnail"+this._postfix};(i=null==n?void 0:n.querySelector(o[t]))&&i.appendChild(this._thumbnailElement),this._updateStretchBars(),this.size=this._size,this._setSplitBarDelay(),this._resizeViewer(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showThumbnail",{get:function(){return this._showThumbnail},set:function(t){this._showThumbnail=t;var e=this._thumbnailElement;e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this.updatePageLayout(),this._resizeViewer(!0),this._setSplitBarDelay())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showPageNumber",{get:function(){return this._showPageNumber},set:function(t){this._showPageNumber=t,this.renderCanvas()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showSelectBox",{get:function(){return this._showSelectBox},set:function(t){this._showSelectBox=t,this.renderCanvas()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fullThumbnail",{get:function(){return this._fullThumbnail},set:function(t){this._fullThumbnail=t,this.size=this._size;var e=this._myQuery("thumbnailStretchBarRight"+this.uid);e&&(t?e.classList.add("dvs-nodisplay"):e.classList.remove("dvs-nodisplay"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this._background},set:function(t){this._background=t;var e=this._myQuery("thumbLists"+this.uid);e&&(e.style.background=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"border",{get:function(){return this._border},set:function(t){this._border=t;var e=this._thumbnailElement;e&&(e.style.border=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedPageBorder",{get:function(){return this._selectedPageBorder},set:function(t){this._selectedPageBorder=t;for(var e=this._myQueryAll("thumbLists"+this.uid+">li.dvs-activeThumb"),i=0;i<e.length;i++){e[i].style.border=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedPageBackground",{get:function(){return this._selectedPageBackground},set:function(t){this._selectedPageBackground=t;for(var e=this._myQueryAll("thumbLists"+this.uid+">li.dvs-activeThumb"),i=0;i<e.length;i++){e[i].style.background=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageBackground",{get:function(){return this._pageBackground},set:function(t){this._pageBackground=t;var e=this._myQuery("thumbLists"+this.uid);if(e&&e.children)for(var i=e.children,n=0;n<i.length;n++){var o=i[n];o.classList.contains("dvs-activeThumb")||(o.style.background=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageBorder",{get:function(){return this._pageBorder},set:function(t){this._pageBorder=t;var e=this._myQuery("thumbLists"+this.uid);if(e&&e.children)for(var i=e.children,n=0;n<i.length;n++){var o=i[n];o.classList.contains("dvs-activeThumb")||(o.style.border=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageMargin",{get:function(){return this._pageMargin},set:function(t){this._pageMargin=t,this._currentPageMargin=-1,this._resizeViewer(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowResizing",{get:function(){return this._allowResizing},set:function(t){this._allowResizing=t,this._updateStretchBars()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showRemoveBtn",{get:function(){return this._showRemoveBtn},set:function(t){var e,i;this._showRemoveBtn=t,t?null===(e=this._thumbnailElement)||void 0===e||e.classList.remove("dvs-hide-remove-btn"):null===(i=this._thumbnailElement)||void 0===i||i.classList.add("dvs-hide-remove-btn")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multipleMode",{get:function(){return this._multipleMode},set:function(t){t!==this._multipleMode&&(this._multipleMode=t,this._showSelectBox=t,this.renderCanvas())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkboxColor",{get:function(){return this._checkboxColor},set:function(t){t!==this._checkboxColor&&(this._checkboxColor=t,this.renderCanvas())},enumerable:!1,configurable:!0}),e.prototype._bindSelfEvents=function(){var e,i=this,n=((e={})[r.f.UPDATE_THUMBNAIL_PROP]=this._updateProps,e[r.f.SCROLL_TO]=this.scrollTo,e[r.f.SET_VIEW_MODE]=this.setViewMode,e);for(var o in this._eventList=n,n)this._pubSub._on(o,n[o].bind(this));t.prototype._on.call(this,r.f.DOCUMENT_POINTER_MOVE,this._documentMouseMove.bind(this)),t.prototype._on.call(this,r.f.DOCUMENT_POINTER_UP,this._documentMouseUp.bind(this)),t.prototype._on.call(this,r.g.BUFFER_CHANGED,(function(t){"remove"===t.action&&(i._prtScrollOnce=!0)}))},e.prototype._bindUiEvent=function(){var e=this,i=this._thumbnailElement;if(i){var n=new s(i);n.onPointDown=function(t){e._thumbnailDragStart(t),e._thumbnailPointerDown(t)},n.onPointMove=function(t){e._thumbnailDragMove(t),e._thumbnailPointerMove(t)},n.onPointUp=function(t){e._thumbnailPointerUp(t)},n.onClick=function(t){e._thumbnailClick(t)},n.onRightClick=function(t){e._thumbnailRightClick(t)},n.onDoubleClick=function(t){e._thumbnailDoubleClick(t)},n.onPointOver=function(t){e._thumbnailMouseOver(t)},n.onPointOut=function(t){e._thumbnailMouseOut(t)},n.getTarget=function(t,i){return i!==undefined?e.getImageItem(i):e.getImageItem(t)},this._customThumbnailEvent=n,Object(o.c)(i.querySelector(".dvs-thumbLists"),"scroll",(function(){e._thumbnailScroll()})),Object(o.c)(i,Object(o.u)()?"touchstart":"mousedown",(function(t){e._thumbnailStretchStart(t)}),{passive:!1}),Object(o.c)(i,"click",(function(i){t.prototype._emit.call(e,r.d.UPDATE_FOCUS,{viewerId:e._postfix.replace("-",""),thumbnailId:e.uid}),Object(o.G)(i)}))}},e.prototype.unbindEvents=function(){var t;if(null===(t=this._customThumbnailEvent)||void 0===t||t.dispose(),this._customThumbnailEvent=null,this._pubSub)for(var e in this._eventList)this._pubSub._off(e)},e.prototype.unbindUi=function(){var t,e,i;this.unbindEvents();var n=this._thumbnailCanvas;if(n)for(var o=0;o<n.length;o++){var r=n[o];r&&r.dispose()}this._thumbnailCanvas=null,this._viewerContainer=null,this._stretchItem=null,null===(t=this._iObserver)||void 0===t||t.disconnect(),this._iObserver=null,null===(i=null===(e=this._thumbnailElement)||void 0===e?void 0:e.parentElement)||void 0===i||i.removeChild(this._thumbnailElement),this._thumbnailElement=null},e.prototype.updateContent=function(t){void 0===t&&(t=[]),this._patch(t),this._updateElements(),this.renderCanvas()},e.prototype.updatePageItem=function(t){var e=this._thumbnailCanvas;if(e)for(var i=0;i<e.length;i++){var n=e[i];if(n.uid===t.uid){n.updateData(t),-1!==this._renderUids.array.indexOf(t.uid)&&n.resizeCanvasSize(this.isInner&&1===this.rows&&1===this.columns);break}}},e.prototype.renderCanvas=function(){var t=this;this._renderTimer&&clearTimeout(this._renderTimer),this._renderTimer=setTimeout((function(){var e=t.selectedIndexes;if(t._thumbnailCanvas)for(var i=t._renderUids.array,n=t._thumbnailCanvas.length,o=0;o<n;o++){var r=t._thumbnailCanvas[o];~i.indexOf(r.uid)?(r.setTempData({showPage:t.showPageNumber,showSelectBox:t.showSelectBox,currentPage:o+1,isSelected:-1!==e.indexOf(o),checkboxColor:t.checkboxColor}),r.resizeCanvasSize(1===t.rows&&1===t.columns&&t.isInner)):null==r||r.emptyPage()}}),100)},e.prototype.keydownCallBack=function(t){this.selectImageByKey(t),this._pubSub._emit(r.g.KEY_DOWN,t)},e.prototype.keyupCallBack=function(t){this._pubSub._emit(r.g.KEY_UP,t)},e.prototype.selectImageByKey=function(t){if(this.allowKeyboardControl&&this._thumbnailCanvas.length){var e=this.selectedIndexes.slice().pop(),i=this.rows,n=this.columns,s="vertical"===this.scrollDirection,a=e;switch(t.key){case"ArrowUp":case"Up":if(s)a-=n;else{if(Math.floor((a-1)/i)!==Math.floor(a/i))return;a-=1}break;case"ArrowDown":case"Down":if(s)a+=n;else{if(Math.floor((a+1)/i)!==Math.floor(a/i))return;a+=1}break;case"ArrowLeft":case"Left":if(s){if(Math.floor((a-1)/n)!==Math.floor(a/n))return;a-=1}else a-=i;break;case"ArrowRight":case"Right":if(s){if(Math.floor((a+1)/n)!==Math.floor(a/n))return;a+=1}else a+=i;break;default:return}this._viewerEmit(r.b.GOTO_PAGE,a),Object(o.C)(t)}},e.prototype._updateElements=function(){var t=this._myQuery("thumbLists"+this.uid);if(!t)return!1;for(var e=0;e<t.children.length;e++){var i=t.children[e],n=this._thumbnailCanvas[e];n&&i&&(i["dvs-defaultIndex"]=e,i["dvs-tags"]=n.tags,i["dvs-uid"]=n.uid)}},e.prototype.handleInnerProp=function(t,e){t in this&&(this[t]=e)},e.prototype.setHoverColor=function(t){if(this.allowHover){var e=this.getImageItem(t);e&&(e.classList.contains("dvs-activeThumb")||(e.style.background=this.hoverPageBackground,e.style.border=this.hoverPageBorder))}},e.prototype.setImageColor=function(t){if(this.allowHover){var e=this.getImageItem(t);e&&(e.classList.contains("dvs-activeThumb")?(e.style.background=this.selectedPageBackground,e.style.border=this.selectedPageBorder):(e.style.background=this._pageBackground,e.style.border=this.pageBorder))}},e.prototype._addNodes=function(t,e,i){var n,s,a=this,l=[],h=this._myQuery("thumbLists"+this.uid);if(h){for(var u=h.children[e],c=document.createDocumentFragment(),d=function(e){var i=t[e],n=p._initNode(i);l.push(n);var h=document.createElement("li");h.style.background=p.pageBackground,h.style.border=p.pageBorder;var u=document.createElement("canvas");if(u.className="dvs-thumbnailCanvas",u.width=0,u.height=0,h.appendChild(u),n._canvasItem=u,!p.isInner){var d=document.createElement("span");d.className="dvs-thumbnail-remove",d.onclick=function(){var t=Object(o.h)(h);a._pubSub._emit(r.g.REMOVE_PAGE,t)},h.appendChild(d)}null===(s=p._iObserver)||void 0===s||s.observe(h),c.appendChild(h)},p=this,_=e;_<=i;_++)d(_);Object(o.l)(c,u,h),(n=this._thumbnailCanvas).splice.apply(n,w([e,0],l))}},e.prototype._removeNodes=function(t,e,i){var n,o=t.splice(e,i-e+1),r=this._myQuery("thumbLists"+this.uid);if(r&&r.children&&r.children.length){for(var s=e;s<=i;s++){var a=r.children[e];if(a){var l=a["dvs-uid"];this._showUids["delete"](l),this._renderUids["delete"](l),this._getViewIndexesByUids(),null===(n=this._iObserver)||void 0===n||n.unobserve(a),r.removeChild(a)}}o.forEach((function(t){return t.dispose()}))}},e.prototype._patch=function(t){for(var e=this._thumbnailCanvas,i=0,n=e.length-1,o=0,r=t.length-1;i<=n&&o<=r;){var s=e[i],a=e[n],l=t[o],h=t[r];if(this._sameNode(s,l))++i,++o,s.updateData(l);else if(this._sameNode(a,h))--n,--r,a.updateData(h);else if(this._sameNode(s,h))s.updateData(h),this._moveNode(e,i,n);else if(this._sameNode(a,l))a.updateData(l),this._moveNode(e,n,i);else{for(var u=void 0,c=i;c<=n;c++){if(e[c].uid===(null==l?void 0:l.uid)){u=c;break}}u!==undefined?(e[u].updateData(l),this._moveNode(e,u,i)):(this._addNodes(t,o,o),n++),++o,++i}}i>n?this._addNodes(t,o,r):o>r&&this._removeNodes(e,i,n)},e.prototype._sameNode=function(t,e){return(null==t?void 0:t.uid)===(null==e?void 0:e.uid)},e.prototype._moveNode=function(t,e,i){var n=t.splice(e,1)[0];t.splice(i,0,n);var r=this._myQuery("thumbLists"+this.uid),s=r.removeChild(r.children[e]);s&&Object(o.l)(s,r.children[i],r)},e.prototype._initNode=function(t,e){var i={uid:t.uid,imgSrc:t.data,tags:t.tags};if(!e)return new S(i,this._pubSub.getPublishSubscribe(),this._dataStore);e.init(i)},e.prototype._createKeyHashList=function(t,e,i){var n,o,r,s={};for(n=e;n<=i;++n)(o=null==(r=t[n])?void 0:r.uid)&&(s[o]=n);return s},e.prototype.selectThumbnailByIndexes=function(t){Object(o.m)(t)?this.selectedIndexes=t:t=this.selectedIndexes,this.clearAbsolute(),this._updateSelectedPageStyle(),(this.showPageNumber||this.showSelectBox)&&this.renderCanvas()},e.prototype._updateSelectedPageStyle=function(){var t=this._myQuery("thumbLists"+this.uid);if(!t)return!1;var e=this.selectedIndexes,i=t.children;if(i&&i.length)for(var n=i.length,o=0;o<n;o++){var r=i[o],s=-1!==e.indexOf(o);this._selectThumbnailByNode(r,s)}},e.prototype._selectThumbnailByNode=function(t,e){t&&(e?(t.classList.add("dvs-activeThumb"),t.style.border=this.selectedPageBorder,t.style.background=this.selectedPageBackground):(t.classList.remove("dvs-activeThumb"),t.style.border=this.pageBorder,t.style.background=this.pageBackground))},e.prototype.setViewMode=function(t,e){var i,n;if(this.rows=e,this.columns=t,1===e&&1===t?null===(i=this._thumbnailElement)||void 0===i||i.classList.add("dvs-hide-remove-btn"):this.showRemoveBtn&&(null===(n=this._thumbnailElement)||void 0===n||n.classList.remove("dvs-hide-remove-btn")),10===document.documentMode){var o=this._myQuery("thumbLists"+this.uid);if(!o)return;o.style.marginTop=o.style.marginTop?"":"0.1px",this.renderCanvas()}return this.showLatestPage(),!0},e.prototype.updatePageLayout=function(){var t;if(!this.showThumbnail)return!1;var e=this._myQuery("thumbLists"+this.uid);if(!(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.length))return!1;var i=e.clientWidth-1,n=e.clientHeight-1,o=this._getCurrentPageMargin(i,n,e);this._pageMarginNumber=o,this._setPageSize(i,n,e,o);var r=e.clientWidth-1,s=e.clientHeight-1;r===i&&s===n||this._setPageSize(r,s,e,o),this.renderCanvas()},e.prototype.calculateSize=function(){var t=this._thumbnailElement;if(t){var e=t.getBoundingClientRect();if(0==e.width||0==e.height)return!1;var i=this._tempThumbnailSize,n=t.clientWidth,o=t.clientHeight;i.width===n&&i.height===o||(i.width=n,i.height=o,this._pubSub._emit(r.g.THUMBNAIL_STRETCH,e.width,e.height))}return this.updatePageLayout(),!0},e.prototype._getCurrentPageMargin=function(t,e,i){var n=this.rows,o=this.columns,r=this._pageMargin;if(r=String(r),/%$/.test(r)){var s=parseInt(r),a=Math.min(1/(o+1),1/(n+1));r=(s=Math.min(s/100,a))*e-1}else if(/em$/.test(r)){if(this._currentPageMargin<0){var l=parseInt(r),h=parseInt(window.getComputedStyle(i).fontSize);this._currentPageMargin=l*h}r=this._currentPageMargin}else r=parseInt(r);return t&&r*(o+1)>t+5&&(r=t/(o+1)),e&&r*(n+1)>e+5&&(r=e/(n+1)),r},e.prototype._setPageSize=function(t,e,i,n){if(null==i?void 0:i.children)for(var o=this.rows,r=this.columns,s=1===this.columns&&1===this.rows,a=Math.floor((t-(r+1)*n)/r),l=Math.floor((e-(o+1)*n)/o),h=i.children,u="vertical"===this._scrollDirection,c=0;c<h.length;c++){var d=h[c];s?(d.style.width=u?Math.floor(t)+"px":"100%",d.style.height=u?"100%":Math.floor(e)+"px",i.style.padding="0px",d.style.margin=0===c?"0px":u?n+"px 0px 0px":"0px 0px 0px "+n+"px "):(d.style.margin="0px "+n+"px "+n+"px 0px",i.style.padding=n+"px 0px 0px "+n+"px",c===h.length-1&&(d.style[u?"marginBottom":"marginRight"]=n+1+"px"),d.style.width=a+"px",d.style.height=l+"px")}},e.prototype.updateDisplayedUidsIE=function(){var t=this;if(window.IntersectionObserver)return!1;if(!this.showThumbnail||!this._thumbnailCanvas)return!1;var e=this._getDisplayedImagesIE(),i=this._getRenderIndexes(e);this._renderIndexes.array=i;var n=i.map((function(e){var i;return null===(i=t._thumbnailCanvas[e])||void 0===i?void 0:i.uid}));this._renderUids.array=n,this.renderCanvas(),this._viewerEmit(r.f.MERGE_DISPLAYED_UIDS,n.slice(),this.uid)},e.prototype.updateDisplayedUids=function(){if(!this.showThumbnail)return!1;var t=this._thumbnailCanvas;if(!t.length)return this._showIndexes.array=[],this._renderIndexes.array=[],void(this._renderUids.array=[]);var e=this._renderIndexes.array.slice(0),i=[];e.forEach((function(e){t[e]&&i.push(t[e].uid)})),this._renderUids.array=i,this._viewerEmit(r.f.MERGE_DISPLAYED_UIDS,i,this.uid)},e.prototype._handleObservePages=function(t){var e=this;t.forEach((function(t){var i=t.intersectionRect,n=t.target,o=null==n?void 0:n["dvs-uid"];null==n||n["dvs-defaultIndex"];(null==i?void 0:i.width)>0||(null==i?void 0:i.height)>0?e._showUids.add(o):e._showUids["delete"](o)})),this._getViewIndexesByUids(),this.updateDisplayedUids(),this.renderCanvas()},e.prototype._getRenderIndexes=function(t){var e=this,i=e.rows,n=e.columns,o=e.scrollDirection,r=e._thumbnailCanvas;if(!r)return[];var s=this._thumbnailCanvas.length,a=0;t.forEach((function(t){s=Math.min(t,s),a=Math.max(t,a)}));for(var l=[],h=s;h<=a;h++)r[h]&&l.push(h);if("vertical"===o){for(h=s-3*n;h<s;h++)r[h]&&l.push(h);for(var u=a+1;u<a+3*n;u++)r[u]&&l.push(u)}else{for(h=s-3*i;h<s;h++)r[h]&&l.push(h);for(u=a+1;u<a+3*i;u++)r[u]&&l.push(u)}return l},e.prototype._getViewIndexesByUids=function(){var t=this._showUids,e=[];this._thumbnailCanvas.forEach((function(i,n){t.array.indexOf(i.uid)>-1&&e.push(n)})),this._showIndexes.array=e;var i=this._getRenderIndexes(e.slice());this._renderIndexes.array=i},e.prototype.triggerTopImageChange=function(t){void 0===t&&(t=""),this.updateDisplayedUidsIE(),this._updateTopPageIndex(t)},e.prototype.scrollTo=function(t,e){if(void 0===e&&(e=""),!this.showThumbnail||this._prtScrollOnce)return this._prtScrollOnce=!1,!0;var i=this._myQuery("thumbLists"+this.uid);if(!i||i.clientWidth<=0||i.clientHeight<=0||t>i.children.length-1||i.children.length<=0||t<0)return!1;if(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth){var n=i.getBoundingClientRect(),o=this.scrollDirection,r=-1,s=-1,a=i.children[t],l=a.getBoundingClientRect(),h=parseInt(i.style.padding);"vertical"===o?(s=0,l.top<=n.top?r=a.offsetTop-h+1:l.bottom>=n.bottom&&(r=a.offsetTop-n.height+l.height+h+1)):(r=0,l.left<=n.left?s=a.offsetLeft-h+1:l.right>=n.right&&(s=a.offsetLeft-n.width+l.width+h+1)),-1!==r&&(i.scrollTop=r),-1!==s&&(i.scrollLeft=s)}return this.triggerTopImageChange(e),!0},e.prototype.showLatestPage=function(t){var e;t===undefined&&(t=this.currentIndex),this.currentIndex=t,(null===(e=this._thumbnailCanvas)||void 0===e?void 0:e.length)?(this.updatePageLayout(),this.scrollTo(t)):this.triggerTopImageChange()},e.prototype._updateTopPageIndex=function(t){void 0===t&&(t="");var e=this._thumbnailElement;if(!this.showThumbnail||!e)return!1;if(window.IntersectionObserver){var i=this._calDisplayedIndexes()[0];this._calculateTopIndex=i}var n=this._calculateTopIndex;if(this._thumbnailCanvas[n]||(n=-1,t=""),this._topImageIndex===n)return!1;this._topImageIndex=n,this._pubSub._emit(r.g.TOP_PAGE_CHANGED,n,t),"scroll"===t&&this.autoChangeIndex&&(this._prtScrollOnce=!0,this._viewerEmit(r.d.SET_SELECTED_INDEXES,[n]))},e.prototype._getDisplayedImagesIE=function(){for(var t=this._calDisplayedIndexes(),e=t[0],i=t[1],n=[],o=e;o<=i;o++)o>=0&&n.push(o);return this._calculateTopIndex=e,n},e.prototype._calDisplayedIndexes=function(){var t=this._myQuery("thumbLists"+this.uid),e=null==t?void 0:t.getBoundingClientRect();if(!e||!e.width)return[-1,-1];var i=t.children[0];if(!i)return[-1,-1];var n=i.getBoundingClientRect(),o=-1,r=0,s=this.rows,a=this.columns;if("vertical"===this.scrollDirection){var l=t.scrollTop,h=Math.floor(n.height),u=(l+1-h-(parseInt(i.style.marginTop)||parseInt(i.style.marginBottom)))/(h+this._pageMarginNumber);r=(o=((u=Math.floor(u))+1)*this.columns)+(s+1)*a-1}else{var c=t.scrollLeft,d=Math.floor(n.width);u=(c+1-d-(parseInt(i.style.marginLeft)||parseInt(i.style.marginRight)))/(d+this._pageMarginNumber);r=(o=((u=Math.floor(u))+1)*this.rows)+s*(a+1)-1}for(;!this._thumbnailCanvas[o]&&o>-1;)o--;for(;!this._thumbnailCanvas[r]&&r>o;)r--;return[o,r]},e.prototype.emptyHiddenPages=function(){},e.prototype.dragThumbnail=function(t){return this.isDragUp=!1,!(t.ctrlKey||t.shiftKey||t.metaKey)&&(0===t.button&&this._dragStartFunction(t))},e.prototype.dragStartMobile=function(t){var e=this;this.isDragUp=!1;var i=t.changedTouches[0];return this.needClick=!0,this._dragTimer=setTimeout((function(){document.addEventListener("touchmove",o.C,{passive:!1}),e._dragStartFunction(i)}),300),!0},e.prototype._dragStartFunction=function(t){if(!this.allowPageDragging||this._isCrop)return!1;var e=this.rows,i=this.columns;if(1===e&&1===i)return!1;var n=this.getImageItem(t);if(!n)return!1;this._multipleMode||n.classList.contains("dvs-activeThumb")||(this.selectedIndexes=[Object(o.h)(n)],this._updateSelectedPageStyle(),this.needClick=!1);var r=n.getBoundingClientRect(),s=t.clientX-r.left,a=t.clientY-r.top;return this.thumbMoveOption={napX:s,napY:a,clickX:t.pageX,clickY:t.pageY,target:n},this.isDrag=!0,this._dragStart=!0,!0},e.prototype._initReplaceBlocks=function(){for(var t=this._myQuery("thumbLists"+this.uid),e=t.querySelectorAll(".dvs-activeThumb"),i=0;i<e.length;i++){var n=e[i],r=document.createElement("li");r.className="dvs-replaceBlock",Object(o.F)(r,{backgroundColor:this.placeholderBackground,margin:n.style.margin,width:n.style.width,height:n.style.height}),r["dvs-defaultIndex"]=n["dvs-defaultIndex"],Object(o.l)(r,n,t)}t.classList.add("hideReplaceBlock")},e.prototype.dragMove=function(t){return this._dragMoveFunction(t)},e.prototype.dragMoveMobile=function(t){var e=t.changedTouches[0];return clearTimeout(this._dragTimer),this._dragMoveFunction(e)},e.prototype._dragMoveFunction=function(t){if(this.selectedIndexes.length&&this.isDrag){var e=this.thumbMoveOption,i=e.napX,n=e.napY,s=e.clickX,a=e.clickY,l=e.target,h=t.pageX,u=t.pageY;if(Math.abs(h-s)<10&&Math.abs(u-a)<10&&!this.ifDragMoves)return;var c=l["dvs-defaultIndex"],d=this._myQuery("thumbLists"+this.uid);if(!d)return;this._dragStart&&(this._dragStart=!1,this._initReplaceBlocks(),this._thumbnailCanvas.length<=this.rows*this.columns&&(d.style.overflow="hidden"),this._pubSub._emit(r.g.DRAG_START,{index:c,pageX:t.pageX,pageY:t.pageY},t)),this.ifDragMoves=!0;for(var p=d.scrollTop,_=d.scrollLeft,v=l.getBoundingClientRect(),f=this._renderUids.array.slice(),m=0,g=0;m<this._thumbnailCanvas.length&&g<f.length&&0!==f.length;m++){var y=this._thumbnailCanvas[m];if(-1!==f.indexOf(y.uid)){var b=y._canvasItem.parentNode;if(!b.classList.contains("dvs-activeThumb")){var E=b.getBoundingClientRect(),C=E.left-v.left,S=E.top-v.top;if(Math.abs(C)<=v.width/2&&Math.abs(S)<=v.height/2){for(var I=Object(o.h)(b),T=d.querySelectorAll("li.dvs-replaceBlock"),w=Object(o.h)(T[0]),O=0;O<T.length;O++){var R=T[O];I<w?Object(o.l)(R,b,d):Object(o.k)(R,b)}return d.scrollTop=p,d.scrollLeft=_,!0}g++}}}var x=d.getBoundingClientRect(),P=t.clientY-x.top-n,L=t.clientX-x.left-i+_,A=P+p;d.classList.remove("hideReplaceBlock");for(var M=this._myQueryAll("thumbLists"+this.uid+">li.dvs-activeThumb"),D=0;D<M.length;D++){var B=M[D];B.classList.add("dvs-absolute"),B.style.left=L+5*D+"px",B.style.top=A+5*D+"px"}this._pubSub._emit(r.g.DRAG_MOVE,{index:c,pageX:t.pageX,pageY:t.pageY},t),Object(o.C)(t)}},e.prototype.dragUp=function(){return this._dragUpFunction()},e.prototype.dragUpMobile=function(){return document.removeEventListener("touchmove",o.C),clearTimeout(this._dragTimer),this._dragUpFunction()},e.prototype._dragUpFunction=function(){if(this.isDrag){this.thumbMoveOption=null,this.isDrag=!1;var t=this.ifDragMoves;if(this.clearAbsolute(),!t)return!1;this.isDragUp=!0;for(var e=this._myQuery("thumbLists"+this.uid),i=e.children.length,n=[],o=[],s=[],a=this.selectedIndexes.slice(0),l=[],h=0;h<i;h++){var u=e.children[h],c=u["dvs-defaultIndex"];if(s.push(c),u.classList.contains("dvs-activeThumb")){var d=a.indexOf(c);-1!==d&&(l[d]=h,c!==h&&o.push([c,h]))}n[h]=this._thumbnailCanvas[c]}this._thumbnailCanvas=n,this.selectedIndexes=l,this._updateElements(),this._viewerEmit(r.d.REORDER_THUMBNAIL,s,l.slice()),o.length&&this._pubSub._emit(r.g.DRAG_DONE,o)}},e.prototype.stretchStart=function(t){if(1===t.button)return!1;var e=t.target;if(!(null==e?void 0:e.classList.contains("dvs-stretchBar")))return!1;this.fullThumbnail||(e.classList.add("dvs-streching"),this._stretchItem=e,this._isStretching=!0,Object(o.C)(t))},e.prototype.stretchMove=function(t){if(!this._isStretching)return!1;var e,i,n=this._stretchItem;if(!n||!this._thumbnailElement)return!1;var o=this._thumbnailElement.getBoundingClientRect(),r=n.classList;r.contains("dvs-stretchRight")?(e=t.clientX-o.left<0?0:t.clientX-o.left,n.style.left=e+"px"):r.contains("dvs-stretchLeft")?(e=o.right-t.clientX<0?0:o.right-t.clientX,n.style.left=o.width-e+"px"):r.contains("dvs-stretchTop")?(i=o.bottom-t.clientY<0?0:o.bottom-t.clientY,n.style.top=o.height-i+"px"):(i=t.clientY-o.top<0?0:t.clientY-o.top,n.style.top=i+"px")},e.prototype.stretchEnd=function(){var t;if(!this._isStretching||!this._thumbnailElement)return!1;var e=this._stretchItem;if(!e)return!1;this._stretchItem=null,this._isStretching=!1;var i=parseInt(e.style.left),n=parseInt(e.style.top),o=0,s=this._thumbnailElement.getBoundingClientRect(),a=s.width-i,l=s.height-n,h=null===(t=this._pubQuery("showImageArea"+this._postfix))||void 0===t?void 0:t.getBoundingClientRect();i=Math.min(i,h.width),n=Math.min(n,h.height),o=e.classList.contains("dvs-stretchRight")?i/h.width:e.classList.contains("dvs-stretchLeft")?a/h.width:e.classList.contains("dvs-stretchTop")?l/h.height:n/h.height,e.style.left=null,e.style.top=null,e.classList.remove("dvs-streching"),this.size=Math.min(100*o,100).toFixed(2)+"%",this._pubSub._emit(r.d.CHANGE_THUMBNAIL_VIEW_PROP,{_size:this.size}),this._resizeViewer()},e.prototype._updateStretchBars=function(){var t=this._allowResizing,e=this._location,i=this._sequence,n="horizontal"===e&&t&&i>=0?"remove":"add",o="vertical"===e&&t&&i>=0?"remove":"add",r="horizontal"===e&&t&&i<0?"remove":"add",s="vertical"===e&&t&&i<0?"remove":"add",a=this.uid,l=this._myQuery("stretchBarLeft"+a),h=this._myQuery("stretchBarRight"+a),u=this._myQuery("stretchBarTop"+a),c=this._myQuery("stretchBarBottom"+a);null==l||l.classList[n]("dvs-nodisplay"),null==h||h.classList[r]("dvs-nodisplay"),null==u||u.classList[o]("dvs-nodisplay"),null==c||c.classList[s]("dvs-nodisplay")},e.prototype._updateProps=function(t){for(var e in t)this[e]=t[e]},e.prototype._imageClickCallback=function(t,e){var i=this.selectedIndexes.slice();if((e.ctrlKey||e.metaKey||this._multipleMode)&&!e.shiftKey){var n=i.indexOf(t);if(-1===n)i.push(t);else{if(this.isDragUp)return void(this.isDragUp=!1);if(1===i.length&&!this._multipleMode)return!1;i.splice(n,1),this._prtScrollOnce=!0}}else if(!e.shiftKey||e.ctrlKey||e.metaKey)if((e.ctrlKey||e.metaKey)&&e.shiftKey){var o=i.slice(0);h=o[o.length-1];o.push(t);var s=t,a=t;o.forEach((function(t){t<s?s=t:t>a&&(a=t)}));var l=[];for(c=s;c<=a;c++)c!==h&&l.push(c);h>=0&&l.push(h),i=l}else this.needClick?i=[t]:this.needClick=!0;else{var h;if((h=i[i.length-1])===undefined)i.push(t);else{var u=[];if(h<t)for(var c=t;c>=h;c--)u.push(c);else for(var d=t;d<=h;d++)u.push(d);i=u}}return this._viewerEmit(r.d.SET_SELECTED_INDEXES,i),!0},e.prototype._thumbnailDragStart=function(t){return Object(o.u)()?this.dragStartMobile(t):this.dragThumbnail(t)},e.prototype._thumbnailDragMove=function(t){return Object(o.u)()?this.dragMoveMobile(t):this.dragMove(t)},e.prototype._thumbnailDragUp=function(){return Object(o.u)()?this.dragUpMobile():this.dragUp()},e.prototype._thumbnailMouseOver=function(t){if(this.allowHover&&!this.ifDragMoves){var e=this.getImageItem(t);if(e){e.classList.contains("dvs-activeThumb")||(e.style.background=this.hoverPageBackground,e.style.border=this.hoverPageBorder);var i=e["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_MOUSE_OVER,{index:i,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_MOUSE_OVER,{index:-1,pageX:t.pageX,pageY:t.pageY},t)}},e.prototype._thumbnailMouseOut=function(t){if(this.allowHover&&!this.ifDragMoves){var e=this.getImageItem(t);if(e){var i=e["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_MOUSE_OUT,{index:i,pageX:t.pageX,pageY:t.pageY},t),e.classList.contains("dvs-activeThumb")?(e.style.background=this.selectedPageBackground,e.style.border=this.selectedPageBorder):(e.style.background=this._pageBackground,e.style.border=this.pageBorder)}else this._pubSub._emit(r.g.PAGE_MOUSE_OUT,{index:-1,pageX:t.pageX,pageY:t.pageY},t)}},e.prototype._thumbnailClick=function(t){if(!this.ifDragMoves&&!this.isDragUp){var e=this.getImageItem(t);if(e){var i=e["dvs-defaultIndex"];this._imageClickCallback(i,t),this._pubSub._emit(r.g.PAGE_CLICK,{index:i,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_CLICK,{index:-1,pageX:t.pageX,pageY:t.pageY},t)}},e.prototype._thumbnailRightClick=function(t){var e=this.getImageItem(t);if(e){if(this.ifDragMoves)return!1;var i=e["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_RIGHT_CLICK,{index:i,pageX:t.pageX,pageY:t.pageY},t),this._pubSub._emit(r.g.PAGE_CONTEXTMENU,{index:i,pageX:t.pageX,pageY:t.pageY},t),-1!==this.selectedIndexes.indexOf(i)||Object(o.u)()&&this.allowPageDragging||this._pubSub._emit(r.d.SET_SELECTED_INDEXES,[i])}else this._pubSub._emit(r.g.PAGE_RIGHT_CLICK,{index:-1,pageX:t.pageX,pageY:t.pageY},t),this._pubSub._emit(r.g.PAGE_CONTEXTMENU,{index:-1,pageX:t.pageX,pageY:t.pageY},t)},e.prototype._thumbnailDoubleClick=function(t){var e=this.getImageItem(t);if(e){var i=e["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_DOUBLE_CLICK,{index:i,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_DOUBLE_CLICK,{index:-1,pageX:t.pageX,pageY:t.pageY},t)},e.prototype._thumbnailPointerDown=function(t){var e=this.getImageItem(t);if(e){var i=e["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_MOUSE_DOWN,{index:i,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_MOUSE_DOWN,{index:-1,pageX:t.pageX,pageY:t.pageY},t)},e.prototype._thumbnailPointerMove=function(t){var e,i,n,o,s,a,l;if(this.ifDragMoves){if(!(this.isInner?null===(n=null===(i=null===(e=this._oPub)||void 0===e?void 0:e._events)||void 0===i?void 0:i[r.g.PAGE_MOUSE_MOVE])||void 0===n?void 0:n.length:null===(l=null===(a=null===(s=null===(o=this._pubSub)||void 0===o?void 0:o.getPublishSubscribe())||void 0===s?void 0:s._events)||void 0===a?void 0:a[r.g.PAGE_MOUSE_MOVE])||void 0===l?void 0:l.length))return;var h=this._getPointIndex(t);this._pubSub._emit(r.g.PAGE_MOUSE_MOVE,{index:h,pageX:t.pageX,pageY:t.pageY},t)}else{var u=this.getImageItem(t);if(u){var c=u["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_MOUSE_MOVE,{index:c,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_MOUSE_MOVE,{index:-1,pageX:t.pageX,pageY:t.pageY},t)}},e.prototype._thumbnailPointerUp=function(t){if(this.ifDragMoves){var e=this._getPointIndex(t);this._pubSub._emit(r.g.PAGE_MOUSE_UP,{index:e,pageX:t.pageX,pageY:t.pageY},t)}else{var i=this.getImageItem(t);if(i){var n=i["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_MOUSE_UP,{index:n,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_MOUSE_UP,{index:-1,pageX:t.pageX,pageY:t.pageY},t)}},e.prototype._thumbnailScroll=function(){this.triggerTopImageChange("scroll")},e.prototype._thumbnailStretchStart=function(t){this.stretchStart(t)},e.prototype._documentMouseMove=function(t){this.stretchMove(t)},e.prototype._documentMouseUp=function(){this.stretchEnd(),this._thumbnailDragUp()},e.prototype.getImageItem=function(t){var e,i,n;if(!t)return null;if(!(n=Object(o.q)(t)?t:t.target)||(null===(e=n.classList)||void 0===e?void 0:e.contains("dvs-replaceBlock")))return null;if("CANVAS"===n.tagName)n=n.parentNode;else{if(n===(null===(i=this._thumbnailElement)||void 0===i?void 0:i.querySelector(".dvs-thumbLists")))return!1;if("LI"!==n.tagName)return null}return n},e.prototype._getPointIndex=function(t){var e,i,n=null===(e=this._thumbnailElement)||void 0===e?void 0:e.querySelector(".dvs-thumbLists");if(!n)return-1;for(var r=n.children,s=0;s<r.length;s++){var a=r[s];if(this._checkPointOnElement(t,a)&&!(null===(i=a.classList)||void 0===i?void 0:i.contains("dvs-activeThumb")))return Object(o.i)(a,(function(t){var e;return!(null===(e=t.classList)||void 0===e?void 0:e.contains("dvs-activeThumb"))}))}return-1},e.prototype.clearAbsolute=function(){var t=this._myQuery("thumbLists"+this.uid);if(!t)return!1;var e=this._myQueryAll("thumbLists"+this.uid+">li.dvs-replaceBlock");this.ifDragMoves=!1,this.isDrag=!1;for(var i=this._myQueryAll("thumbLists"+this.uid+">li.dvs-absolute"),n=0;n<i.length;n++){var r=i[n];Object(o.l)(r,e[n],t),r.classList.remove("dvs-absolute"),r.style.left=null,r.style.top=null}for(var s=0;s<e.length;s++){var a=e[s];t.removeChild(a)}"vertical"===this.scrollDirection?t.style.overflowY="auto":t.style.overflowX="auto"},e.prototype.setPercent=function(t){var e=this._thumbnailElement;e&&(e.style.flex="0 0 "+t+"%",e.style.msFlex="0 0 "+t+"%")},e.prototype.getIndexByUid=function(t){for(var e,i=0;i<this._thumbnailCanvas.length;i++)if(t===(null===(e=this._thumbnailCanvas[i])||void 0===e?void 0:e.uid))return i;return-1},e.prototype.getUidByIndex=function(t){var e;return null===(e=this._thumbnailCanvas[t])||void 0===e?void 0:e.uid},e.prototype._resizeViewer=function(t){void 0===t&&(t=!1),t?this._viewerEmit(r.f.VIEWER_RESIZE,this.uid,this.showLatestPage.bind(this)):this._viewerEmit(r.f.VIEWER_RESIZE)},e.prototype._setSplitBarDelay=function(){var t=this;this.isInner||(clearTimeout(this._splitTimer),this._splitTimer=setTimeout((function(){t._viewerEmit("onSetSplitBar")}),50))},e.prototype._checkPointOnElement=function(t,e){var i,n;if(!t||!e)return!1;var o=-1,r=-1;if(null===(i=t.changedTouches)||void 0===i?void 0:i[0]){var s=null===(n=t.changedTouches)||void 0===n?void 0:n[0];o=s.clientX,r=s.clientY}else{var a=t;o=a.clientX,r=a.clientY}var l=e.getBoundingClientRect();return o>=l.left&&r>=l.top&&o<=l.right&&r<=l.bottom},e.prototype._viewerEmit=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];t.prototype._emit.apply(this,w([e],i))},e.prototype.dispose=function(){var e;this.unbindUi(),t.prototype.dispose.call(this),null===(e=this._pubSub)||void 0===e||e.dispose(),this._pubSub=null,this._viewerContainer=null,this._thumbnailElement=null},e}(a.a),R=i(3),x=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),P=function(t){function e(e,i,n,o,s){var a=t.call(this,e,i,n,o,s)||this;return a.isInner=!0,a._isCrop=!1,a.cropIndex=-1,a.cropUid="",a._originEvents=[],a._tbEvents=[],a._viewerEvents=[],a.cropManager=new R.a(0,0),a.cropManager.selectedCallback=function(e){var i=a.selectedIndexes.slice().pop(),n=a._thumbnailCanvas[i];n&&n.renderImg&&t.prototype._emit.call(a,r.g.PAGE_AREA_SELECTED,i,e)},a.cropManager.unselectedCallback=function(){for(var e=a.cropIndex,i=a._thumbnailCanvas.length,n=0;n<i;n++){var o=a._thumbnailCanvas[n];a.cropUid===o.uid&&(a.cropManager.cropBoxes=[],o.renderImg?a.setPageRect(o):o.setRect([]))}t.prototype._emit.call(a,r.g.PAGE_AREA_UNSELECTED,e)},a._initEvents(),a}return x(e,t),e.prototype._initEvents=function(){var e=this,i=[r.d.CANVAS_MOUSE_DOWN,r.d.CANVAS_MOUSE_MOVE,r.d.CANVAS_MOUSE_UP,r.d.CANVAS_CLICK,r.d.CANVAS_RIGHT_CLICK,r.d.CANVAS_DOUBLE_CLICK,r.d.CANVAS_MOUSE_OVER,r.d.CANVAS_MOUSE_OUT],n=[r.g.PAGE_MOUSE_DOWN,r.g.PAGE_MOUSE_MOVE,r.g.PAGE_MOUSE_UP,r.g.PAGE_CLICK,r.g.PAGE_RIGHT_CLICK,r.g.PAGE_DOUBLE_CLICK,r.g.PAGE_MOUSE_OVER,r.g.PAGE_MOUSE_OUT];this._originEvents=n;for(var o=0;o<i.length;o++)this._packageEvent(n[o],i[o]);this._tbEvents=[[r.g.DRAG_DONE,function(i){t.prototype._emit.call(e,r.d.CANVAS_DRAG_DONE,i)}],[r.g.TOP_PAGE_CHANGED,function(i,n){t.prototype._emit.call(e,r.g.TOP_PAGE_CHANGED,i,n)}],[r.g.PAGE_MOUSE_DOWN,function(t,i){e._cropStart(t,i)}],[r.f.DOCUMENT_POINTER_UP,function(t){e._cropUp(t)}],[r.g.VIEWER_PAGE_RENDERED,function(i){t.prototype._emit.call(e,r.g.VIEWER_PAGE_RENDERED,i)}]],this._tbEvents.forEach((function(t){var i;null===(i=e._pubSub)||void 0===i||i._on(t[0],t[1])})),this._viewerEvents=[[r.f.DOCUMENT_POINTER_MOVE,function(t){e._cropMove(t)}],[r.f.DOCUMENT_POINTER_UP,function(t){e._cropUp(t)}],[r.d.CLEAR_SLT_BOX,function(){e.cropManager.clear()}]],this._viewerEvents.forEach((function(t){e._on(t[0],t[1])}))},e.prototype._initThumbnailConfig=function(t){this._pubSub=new a.a(t.pubsub);for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i],o=t[n];"pubsub"!==n&&o!==undefined&&(this[n]=o)}},e.prototype.dispose=function(){var e,i=this;this._viewerEvents.forEach((function(t){i._off(t[0])})),t.prototype.dispose.call(this),this._pubSub&&(this._originEvents.forEach((function(t){i._pubSub._off(t)})),this._tbEvents.forEach((function(t){i._pubSub._off(t[0])}))),this._originEvents=[],this._tbEvents=[],this._viewerEvents=[],null===(e=this.cropManager)||void 0===e||e.dispose(),this.cropManager=null},e.prototype._packageEvent=function(e,i){var n=this;this._pubSub._on(e,(function(e,o){var r=e.index,s=e.pageX,a=e.pageY;if(-1===r)t.prototype._emit.call(n,i,o,{index:r,imageX:-1,imageY:-1,pageX:s,pageY:a});else{if(!n._thumbnailCanvas[r])return;var l=n._getOriginPosition(r,o),h=l.imageX,u=l.imageY;t.prototype._emit.call(n,i,o,{index:r,imageX:h,imageY:u,pageX:s,pageY:a})}}))},e.prototype._getOriginPosition=function(t,e,i){var n;void 0===i&&(i=!0);var o=null,r=null,s=null===(n=this._thumbnailElement.querySelector(".dvs-thumbLists"))||void 0===n?void 0:n.children;if(s){if(this.ifDragMoves)for(var a=-1,l=0;l<s.length;l++){var h=s[l];if(!(null==h?void 0:h.classList.contains("dvs-activeThumb"))&&t===++a){o=h,r=this._thumbnailCanvas[h["dvs-defaultIndex"]];break}}else o=s[t],r=this._thumbnailCanvas[t];if(o){var u=o.getBoundingClientRect(),c=this._dataStore.getMetadata(r.uid);if(!r.renderImg||!(null==c?void 0:c.width)||!(null==c?void 0:c.height))return{imageX:-1,imageY:-1};var d=e.clientX-u.left,p=e.clientY-u.top,_=r.renderImg.naturalWidth,v=r.renderImg.naturalHeight,f=r.fitRatio,m=d-(u.width-_/f)/2,g=p-(u.height-v/f)/2;if(i&&(m<0||g<0||m>_/f||g>v/f))return{imageX:-1,imageY:-1};var y=c.width/_;return{imageX:Math.floor(m*f*y),imageY:Math.floor(g*f*y)}}}},e.prototype._cropStart=function(t,e){var i=t.index,n=this.selectedIndexes.slice().pop();if(-1!==i&&n===i&&this._isCrop){var s=this._thumbnailCanvas[i];if(s&&s.renderImg){var a=this._getOriginPosition(i,e),l=a.imageX,h=a.imageY;if(-1!==l&&-1!==h){var u=this._dataStore.getMetadata(s.uid);if(!(null==u?void 0:u.width)||!u.height)return this._pubSub._emit(r.d.ERROR,r.a.META_DATA_NOT_EXIST),!1;var c=u.width/s.renderImg.naturalWidth,d=s.fitRatio,p=this.cropManager;p.setZoom(1/d/c),p.setPageSize(u.width,u.height),p.onStartHandler(l,h,e.ctrlKey),s.setRect(p.cropBoxes,this.selectedBoxLineColor),Object(o.C)(e)}}}},e.prototype._cropMove=function(e){if(this.showThumbnail&&this._isCrop){var i=this.selectedIndexes.slice().pop();if(-1!==i){var n=this._thumbnailCanvas[i];if(n){var o=this._getOriginPosition(i,e,!1),s=o.imageX,a=o.imageY,l=this.cropManager,h=l.checkSelectForCursor(s,a);if(h){var u="move"===h.position?"move":h.position+"-resize";t.prototype._emit.call(this,r.f.CHANGE_CANVAS_CURSOR,u)}else t.prototype._emit.call(this,r.f.CHANGE_CANVAS_CURSOR,"");l.mouseDown&&(l.setKeepAspectRatio(e.shiftKey),l.onMoveHandler(s,a,!1),this.setPageRect(n))}}}},e.prototype._cropUp=function(t){if(this._isCrop&&this.cropManager.mouseDown){this.selectedIndexes.slice().pop();this.cropManager.onEndHandler()}},e.prototype.setPageRect=function(t,e){if(void 0===e&&(e=this.selectedBoxLineColor),t){var i=this.cropManager.cropBoxes;t.setRect(i,e),t.render(!1)}},e.prototype._updateInnerPage=function(t){t.data,t.index,t.uid,t.width,t.height;return!1},e.prototype.setSelectedBoxLineColor=function(t){this.selectedBoxLineColor=t;var e=this.selectedIndexes.slice().pop(),i=this._thumbnailCanvas[e];i&&this._isCrop&&this.setPageRect(i,t)},e.prototype.setOperationMode=function(t){1===t?this._isCrop=!0:(this._isCrop=!1,this.clearSelectedBoxes())},e.prototype.setSelectedBoxes=function(e,i){i||this.cropManager.clear(),Object(o.m)(e)||(e=[e]);var n=this.selectedIndexes.slice().pop(),s=this._thumbnailCanvas[n],a=this._dataStore.getMetadata(s.uid);this.cropManager.setPageSize(a.width,a.height);for(var l=e.length,h=0;h<l;h++){var u=e[h];this.cropManager.addBox([u.left,u.top,u.left+u.width,u.top,u.left+u.width,u.top+u.height,u.left,u.top+u.height],"bottomRight")}var c=this.cropManager.getRectArr();this.setPageRect(s),t.prototype._emit.call(this,r.g.PAGE_AREA_SELECTED,n,c),t.prototype._emit.call(this,r.g.VIEWER_PAGE_RENDERED,n,c)},e.prototype.setKeepAspectRatio=function(t){},e.prototype.setAspectRatio=function(t){this.cropManager.setAspectRatio(t)},e.prototype.clearSelectedBoxes=function(t){this.cropManager.clear()},e}(O),L=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),A=function(t){function e(e,i,n,o){var r=t.call(this,i)||this;return r._viewerContainer=null,r._dataStore=null,r._thumbnails={},r.innerThumbnail=null,r._selectedIndexes=[],r._displayedUidsManage={},r._thumbnailContents=[],r._lastShowUid="",r._displayTimer=null,r.postfix=e,r._viewerContainer=n,r._dataStore=o,r._bindEvents(),r}return L(e,t),e.prototype.createThumbnail=function(t){var e=t.uid;e||(e=Object(o.I)(11),t.uid=e);var i=new O(t,this._oPub,this._viewerContainer,this.postfix,this._dataStore);return this._thumbnails[e]=i,i.updateContent(this._thumbnailContents),i.selectThumbnailByIndexes(this._selectedIndexes),!0},e.prototype.createInnerThumbnail=function(t){var e={uid:this.postfix,pubsub:new a.b,size:"100%",background:t.canvasBackground,mouseShape:t.canvasMouseShape,border:t.canvasBorder,location:"canvas",allowResizing:!1,showThumbnail:!1};Object(o.A)(t,e),this.innerThumbnail=new P(e,this._oPub,this._viewerContainer,this.postfix,this._dataStore)},e.prototype.removeThumbnail=function(e){var i=this._thumbnails[e];return!!i&&(i.unbindUi(),t.prototype._emit.call(this,"onSetSplitBar"),delete this._thumbnails[e],!0)},e.prototype.removeAllThumbnail=function(){var t,e;for(var i in this._thumbnails)this.removeThumbnail(i);null===(t=this.innerThumbnail)||void 0===t||t.unbindUi(),null===(e=this.innerThumbnail)||void 0===e||e.dispose(),this._thumbnails={},this._viewerContainer=null,this._off(r.f.MERGE_DISPLAYED_UIDS),this._off(r.f.UPDATE_THB_ITEM)},e.prototype.on=function(t,e){this._on(t,e.bind(this))},e.prototype._bindEvents=function(){var e=this;this.on(r.f.MERGE_DISPLAYED_UIDS,(function(i,n){e._displayedUidsManage[n]=i,clearTimeout(e._displayTimer),e._displayTimer=setTimeout((function(){var i=new I;for(var n in e._displayedUidsManage){var o=e._displayedUidsManage[n];i.array=i.concat(o)}t.prototype._emit.call(e,r.d.DISPLAYED_IMAGE_CHANGED,i.array.slice())}),100)})),this.on(r.f.UPDATE_THB_ITEM,(function(t){e._updatePageItem(t)}))},e.prototype.calculateSize=function(){var t;for(var e in this._thumbnails)this._thumbnails[e].calculateSize();null===(t=this.innerThumbnail)||void 0===t||t.calculateSize()},e.prototype.updateAllDisplayed=function(){var t;for(var e in this._thumbnails)this._thumbnails[e].updateDisplayedUidsIE();null===(t=this.innerThumbnail)||void 0===t||t.updateDisplayedUidsIE()},e.prototype.showLatestPage=function(t){var e;for(var i in this._thumbnails)this._thumbnails[i].showLatestPage(t);null===(e=this.innerThumbnail)||void 0===e||e.showLatestPage(t)},e.prototype.updatePagesLayout=function(){var t;for(var e in this._thumbnails)this._thumbnails[e].updatePageLayout();null===(t=this.innerThumbnail)||void 0===t||t.updatePageLayout()},e.prototype.updateContents=function(t){var e;for(var i in this._thumbnailContents=t,this._thumbnails)this._thumbnails[i].updateContent(t);null===(e=this.innerThumbnail)||void 0===e||e.updateContent(t)},e.prototype._updatePageItem=function(t){for(var e,i=this._thumbnailContents,n=0;n<i.length;n++)if(i[n].uid===t.uid){i[n]=t;break}for(var o in this._thumbnails)this._thumbnails[o].updatePageItem(t);null===(e=this.innerThumbnail)||void 0===e||e.updatePageItem(t)},e.prototype.updateSelectedIndexes=function(t){var e;for(var i in this._selectedIndexes=t,this._thumbnails)this._thumbnails[i].selectThumbnailByIndexes(t);null===(e=this.innerThumbnail)||void 0===e||e.selectThumbnailByIndexes(t)},e.prototype.pageChangeCallback=function(t,e,i){var n,o=this._thumbnailContents,r=this.innerThumbnail,s=this._lastShowUid,a=null===(n=o[e])||void 0===n?void 0:n.uid;a!==undefined&&s===a||(r.clearSelectedBoxes(),r.cropIndex=e,r.cropUid=a,this._lastShowUid=a)},e.prototype.keydownCallback=function(e,i){var n=this._thumbnails[i];n?n.keydownCallBack(e):i===this.innerThumbnail.uid&&(this.innerThumbnail.keydownCallBack(e),t.prototype._emit.call(this,r.d.CANVAS_KEY_DOWN,e))},e.prototype.keyupCallback=function(e,i){var n=this._thumbnails[i];n?n.keyupCallBack(e):i===this.innerThumbnail.uid&&(this.innerThumbnail.keyupCallBack(e),t.prototype._emit.call(this,r.d.CANVAS_KEY_UP,e))},e.prototype.dispose=function(){var e;t.prototype.dispose.call(this);for(var i=Object.keys(this._thumbnails),n=0,o=i.length;n<o;n++){var r=i[n],s=this._thumbnails[r];s&&s.dispose(),s=null}this._thumbnails=null,null===(e=this.innerThumbnail)||void 0===e||e.dispose(),this.innerThumbnail=null,this._viewerContainer=null,this._dataStore=null},e}(a.a),M=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),D=function(t){function e(e,i,n){var o=t.call(this,i)||this;return o._xOver=!1,o._yOver=!1,o.isMyScroll=!1,o.buttonMove=!1,o._isButtonScroll=!1,o._unbindList=[],o._postfix=e,o._myQuery=function(t,e){var i;return void 0===e&&(e="#"),null===(i=null==n?void 0:n.el)||void 0===i?void 0:i.querySelector(e+t)},o._myQueryAll=function(t,e){var i;return void 0===e&&(e="#"),null===(i=null==n?void 0:n.el)||void 0===i?void 0:i.querySelectorAll(e+t)},o}return M(e,t),e.prototype.getImageSize=function(e){var i=this,n=this.setOuterSize(e.width,e.height);return this.setScroller(e.x,e.y),n&&setTimeout((function(){i.setViewPort(),t.prototype._emit.call(i,"_onCanvasResize")})),n},e.prototype.setScroller=function(t,e){var i=Object(o.j)("outer"+this._postfix);if(!i)return!1;var n=i.scrollLeft,r=i.scrollTop;return n===t&&r===e||(this.isMyScroll=!0),i.scrollLeft=t,i.scrollTop=e,!0},e.prototype.setOuterSize=function(t,e){var i=Object(o.j)("outer"+this._postfix),n=Object(o.j)("inner"+this._postfix),r=!1,s=!1;if(!i||!n)return!1;t>i.offsetWidth?(i.style.overflowX="auto",r=!0):i.style.overflowX="hidden",e>i.offsetHeight?(i.style.overflowY="auto",s=!0):i.style.overflowY="hidden",n.style.width=t+"px",n.style.height=e+"px";var a=this._xOver!==r,l=this._yOver!==s;return this._xOver=r,this._yOver=s,a||l},e.prototype.setViewPort=function(){var t=Object(o.j)("outer"+this._postfix),e=Object(o.j)("viewPort"+this._postfix);if(!t||!e)return!1;var i=t.offsetWidth-t.clientWidth,n=t.offsetHeight-t.clientHeight;e.style.width="calc(100% - "+i+"px)",e.style.height="calc(100% - "+n+"px)"},e.prototype._addButtonScroll=function(){var t=this,e=[],i=this._myQueryAll("dvs-groupType",".");if(i){var n=Object(o.u)();this._on(r.f.DOCUMENT_POINTER_MOVE,(function(e){n?t.buttonScrollMoveMobile(e):t.buttonScrollMove(e)})),this._on(r.f.DOCUMENT_POINTER_UP,(function(){t.buttonScrollEndFun()})),[].forEach.call(i,(function(i){"ontouchstart"in document.documentElement?Object(o.c)(i,r.c.TOUCH_START,(function(e){t.buttonScrollStartMobile(e)})):Object(o.c)(i,r.c.MOUSE_DOWN,(function(e){t.buttonScrollStart(e)})),t._unbindList=e;var n=i.querySelector(".dvs-showBefore");n&&(n.onclick=function(){i.scrollLeft=0,t._updateShowMore(i)});var s=i.querySelector(".dvs-showAfter");s&&(s.onclick=function(){i.scrollLeft=i.scrollWidth-i.clientWidth,t._updateShowMore(i)})}))}},e.prototype.buttonScrollStart=function(t){return(!t.button||0===t.button)&&(this._buttonScrollStartFun(t),!0)},e.prototype.buttonScrollStartMobile=function(t){var e=t.changedTouches[0];return!!e&&(this._buttonScrollStartFun(e),!0)},e.prototype._buttonScrollStartFun=function(t){var e,i=t.target;if(i&&i.classList.contains("dvs-groupType"))e=i;else{if(!(i&&i.parentNode&&i.parentNode.classList.contains("dvs-groupType")))return!1;e=i.parentNode}this._isButtonScroll=!0,this._scrollStartInfo={x:t.clientX,y:t.clientY,left:e.scrollLeft,top:e.scrollTop,item:e}},e.prototype.buttonScrollMove=function(t){return this._buttonScrollMoveFun(t),!0},e.prototype.buttonScrollMoveMobile=function(t){var e=t.changedTouches[0];return!!e&&(this._buttonScrollMoveFun(e),!0)},e.prototype._buttonScrollMoveFun=function(t){if(!this._isButtonScroll)return!1;var e=this._scrollStartInfo,i=e.x,n=e.y,r=e.left,s=e.top,a=e.item;if(a.scrollWidth>a.clientWidth){var l=t.clientX-i,h=t.clientY-n;(Math.abs(l)>5||Math.abs(h)>5)&&(this.buttonMove=!0,a.scrollLeft=r-l,a.scrollTop=s-h,this._updateShowMore(a),Object(o.C)(t))}},e.prototype.buttonScrollEndFun=function(){this._isButtonScroll=!1,this._scrollStartInfo={},document.removeEventListener(r.c.TOUCH_MOVE,o.C)},e.prototype._updateShowMore=function(t){if(!t)return!1;if(0==t.children.length)return!1;t.scrollWidth-t.clientWidth>=5?t.style.justifyContent="flex-start":t.style.justifyContent="";var e=t.scrollLeft,i=e>=5,n=e+t.clientWidth<t.scrollWidth-5,o=t.querySelector(".dvs-showBefore");if(!o||"SPAN"!==o.tagName)return!1;i&&t.clientWidth>=60?o.classList.remove("dvs-nodisplay"):o.classList.add("dvs-nodisplay");t.children.length;var r=t.querySelector(".dvs-showAfter");n&&t.clientWidth>=60?r.classList.remove("dvs-nodisplay"):r.classList.add("dvs-nodisplay"),e=t.scrollLeft,o.style.left=e+"px",r.style.right=-e+"px"},e.prototype.updateAllGroupShowMore=function(){var t=this,e=this._myQueryAll("dvs-groupType",".");e&&[].forEach.call(e,(function(e){t._updateShowMore(e)}))},e.prototype.unbindEvents=function(){this._unbindList.forEach((function(t){null==t||t()}))},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.unbindEvents()},e}(a.a),B=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),U=function(t){function e(e,i){var n=t.call(this,i)||this;return n._currentPage=-1,n._totalPage=0,n._postfix=e,n}return B(e,t),e.prototype.goToPage=function(t){this._emit(r.b.GOTO_PAGE,t)},e.prototype.getCurrentPage=function(){return this._currentPage},e.prototype.setCurrentPage=function(t){return!!Object(o.v)(t)&&(this._currentPage=t,!0)},e.prototype.getTotalPage=function(){return this._totalPage},e.prototype.setTotalPage=function(t){return!!Object(o.v)(t)&&(this._totalPage=t,!0)},e.prototype.updatePage=function(t){var e=document.getElementById("pagerInput"+this._postfix),i=document.getElementById("pagerLabel"+this._postfix),n=t.cur,o=t.total;this.setCurrentPage(n),this.setTotalPage(o);var r=o?n+1:0;if(e&&i){e.value=r,i.innerText=String(o),e.style.fontSize="16px";var s=16*String(o).length+"px";e.style.width=s}},e.prototype.pageBlur=function(t){var e=t.target,i=parseInt(e.value);e.value=String(this._currentPage+1),this.goToPage(i-1)},e}(a.a),N=function(){function t(t){this.id="",this.name="",this.type="",this.iconClass="",this._init(t)}return t.prototype._init=function(t){if(o.w)for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];n!==undefined&&(this[n]=t[n])}},t}(),k=function(){function t(t,e,i,n,o){return this.createVNode(t,e,i,n,o)}return t.prototype.createVNode=function(t,e,i,n,o){void 0===e&&(e={}),void 0===i&&(i=[]),void 0===o&&(o="");var r={el:n,tagName:t,sel:"",data:e,children:i,text:o};return this._updateVNode(r)},t.prototype._updateVNode=function(t){var e=this;Object(o.w)(t.data)||(t.data={}),Object(o.m)(t.children)||(t.children=[]);var i=t.data.id,n=t.tagName;return i?(n+="#"+i,t.sel=n):t.data["class"]&&(n+="."+t.data["class"],t.sel=n),t.children.forEach((function(t){return e._updateVNode(t)})),t},t}(),V={createVnode:function(t,e,i,n,r){if(void 0===e&&(e={}),void 0===i&&(i=[]),Object(o.w)(e)&&Object(o.m)(i))return new k(t,e,i,n,r)},sameVnode:function(t,e){return e.data.key===t.data.key&&e.data.key!==undefined||(e.tagName===t.tagName||e.text===t.text&&t.text!==undefined)},createKeyHashList:function(t,e,i){var n,o,r,s={};for(n=e;n<=i;++n)(r=t[n])&&r.data&&(o=r.data.key)&&(s[o]=n);return s},removeVnodes:function(t,e,i){for(;e<=i;){var n=t[e];if(null!=n&&n.el){var o=n.el.parentElement;o&&o.removeChild(n.el)}++e}},addVnodes:function(t,e,i,n,r){for(var s=function(){var r=i[n];if(r){if(!r.el)r.el=document.createElement(r.tagName),Object.keys(r.data).forEach((function(t){"class"===t?r.el.className=r.data[t]:"style"===t?r.el.setAttribute(t,r.data[t]):r.el[t]=r.data[t]}));r.text&&(r.el.textContent=r.text),Object(o.l)(r.el,e,t);var s=r.children;s&&s.length&&a.addVnodes(r.el,null,s,0,s.length)}++n},a=this;n<=r;)s()},addOneVnode:function(t,e,i){if(!t||!t.children)return!1;var n=t.children[e]&&t.children[e].el;return t.children.splice(e,0,i),this.addVnodes(t.el,n,[i],0,0)},patchVnode:function(t,e){var i=e.el=t.el;Object.keys(e.data).forEach((function(i){t.el[i]!==e.data[i]&&("class"===i||"style"===i?t.el.setAttribute(i,e.data[i]):t.el[i]=e.data[i],t.data[i]=e.data[i])}));var n=t.children,o=e.children;t!==e&&(""!==e.text&&t.text!==e.text?i.textContent=e.text:n.length&&o.length&&n!==o?this.updateChildren(i,n,o):o&&o.length?this.addVnodes(i,null,o,0,o.length):n&&n.length&&this.removeVnodes(n,0,n.length))},updateChildren:function(t,e,i){for(var n,r,s,a,l=0,h=0,u=e.length-1,c=i.length-1,d=e[0],p=e[u],_=i[0],v=i[c];l<=u&&h<=c;)null==d?d=e[++l]:null==p?p=e[--u]:null==_?_=i[++h]:null==v?v=i[--c]:this.sameVnode(d,_)?(this.patchVnode(d,_),d=e[++l],_=i[++h]):this.sameVnode(p,v)?(this.patchVnode(p,v),p=e[--u],v=i[--c]):this.sameVnode(d,v)?(this.patchVnode(d,v),Object(o.l)(d.el,p.el.nextSibling,t),d=e[++l],v=i[--c]):this.sameVnode(p,_)?(this.patchVnode(p,_),Object(o.l)(p.el,d.el,t),p=e[--u],_=i[++h]):(n===undefined&&(n=this.createKeyHashList(e,l,u)),(r=n[_.data.key])===undefined?(this.addVnodes(t,d.el,i,h,h),_=i[++h]):((s=e[r]).sel!==_.sel?this.addVnodes(t,d.el,e,r,r):(this.patchVnode(s,_),Object(o.l)(_.el,d.el,t),e[r]=null),_=i[++h]));l>u?(a=i[c+1]?i[c+1].el:null,this.addVnodes(t,a,i,h,c)):h>c&&this.removeVnodes(e,l,u)},patch:function(t,e){if(this.sameVnode(t,e))this.patchVnode(t,e);else{var i=t.el,n=i.parentNode;null!==n&&(Object(o.l)(e.el,i.nextSibling,n),n.removeChild(t.el),t=null)}return e}},j=function(){function t(t,e,i){this._viewerContainer=null,this._postfix="",this._tabList=[],this._tabVNode=null,this._selectedTabId="",this._postfix=t,this._viewerContainer=i}return t.prototype.tabRenderInit=function(){var t,e,i=null===(e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el)||void 0===e?void 0:e.querySelector("#tabList"+this._postfix);this._tabVNode=V.createVnode("DIV",{},[],i)},t.prototype.tabDestroy=function(){this._tabVNode=null},t.prototype.updateTabList=function(t){var e=t.selectedTabId,i=t.tabs;this._updateTabData(i);var n=this._createVirtualTab(i);this._tabVNode=V.patch(this._tabVNode,n),this.selectTabById(e)},t.prototype.getSelectedIndex=function(){for(var t,e=0;e<this._tabList.length;e++)if((null===(t=this._tabList[e])||void 0===t?void 0:t.id)===this._selectedTabId)return e;return-1},t.prototype.selectTabByIndex=function(t){var e;return this._tabList[t]!==undefined&&(this._selectedTabId=null===(e=this._tabList[t])||void 0===e?void 0:e.id,this._updateSelectedStyle(),!0)},t.prototype.selectTabById=function(t){this._selectedTabId=t,this._updateSelectedStyle()},t.prototype.closeTabById=function(t){},t.prototype._updateSelectedStyle=function(){var t,e,i=null===(e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el)||void 0===e?void 0:e.querySelector("#tabList"+this._postfix);if(i)for(var n=null==i?void 0:i.children,o=0;o<n.length;o++){var r=n[o];null==r||r.classList[(null==r?void 0:r.id)===this._selectedTabId?"add":"remove"]("dvs-activeTab")}},t.prototype._updateTabData=function(t){for(var e=[],i=0;i<t.length;i++){var n=this._createTabItem(t[i]);e.push(n)}this._tabList=e},t.prototype._createTabItem=function(t){return new N(t)},t.prototype._createVirtualTab=function(t){for(var e,i=V.createVnode,n=i("DIV"),o=0,r=t.length;o<r;o++){var s=t[o],a=i("DIV",{"class":"dvs-tabItem "+(s.id===this._selectedTabId?"activeTab":""),id:s.uid,key:s.uid,title:s.name},[i("SPAN",{"class":s.iconClass||""}),i("SPAN",{"class":"dvs-tabText"},[],null,s.name),i("A",{"class":"ds-dvs-ui-iconfont ds-dvs-ui-cancle dvs-closeTab","dvs-id":s.uid})]);null===(e=n.children)||void 0===e||e.push(a)}return n},t.prototype.dispose=function(){},t}(),G=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),H=function(t){function e(e){var i=e.postfix,n=e.pubsub,o=e.viewerContainer,r=t.call(this,n)||this;return r._postfix="",r._viewerContainer=null,r._width=0,r._height=0,r._innerWidth=0,r._innerHeight=0,r._scrollLeft=0,r._scrollTop=0,r._canvasList=[],r._postfix=i,r._viewerContainer=o,r}return G(e,t),e.prototype._query=function(t){var e,i;return null===(i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el)||void 0===i?void 0:i.querySelector("#"+t+this._postfix)},e.prototype.canvasRenderInit=function(){this._createCanvas("main"),this._createCanvas("cropper"),this._createSlider()},e.prototype.updateCanvasInnerSize=function(){var e,i=this._query("canvasScroll"),n=null===(e=this._query("innerThumbnail"))||void 0===e?void 0:e.querySelector(".dvs-thumbLists");if(!i||!n)return!1;var o=i.offsetWidth||n.offsetWidth,r=i.offsetHeight||n.offsetHeight;if(0===o||0===r)return!1;t.prototype._emit.call(this,"_setCanvasSize",{width:o,height:r})},e.prototype.updateScrollSize=function(t){var e=t.width,i=t.height,n=t.x,r=t.y;if(e>0&&i>0){this._innerWidth=e,this._innerHeight=i;var s=this._query("scrollInner");s&&(s.style.width=e-1+"px",s.style.height=i-1+"px")}if(n!==this._scrollLeft||r!==this._scrollTop){var a=this._query("canvasScroll");a&&(this._scrollLeft=a.scrollLeft=n,this._scrollTop=a.scrollTop=r),a=null}var l=this._query("canvasWrapper"),h=this._query("canvasScroll");if(l&&h){var u=h.clientWidth,c=h.clientHeight;l.style.width=u+"px",l.style.height=c+"px";for(var d=Object(o.e)(),p=null==l?void 0:l.children,_=0;_<p.length;_++){var v=p[_];if("CANVAS"===v.tagName){var f=u*d,m=c*d;v.width!==f&&(v.width=f),v.height!==m&&(v.height=m)}v=null}}},e.prototype._createSlider=function(){var e=this._query("viewPort");if(!e)return null;var i=document.createElement("div");i.className="dvs-slideWrapper";for(var n=0;n++<3;){var o=document.createElement("div"),s=document.createElement("img");o.className="dvs-slideItem",s.className="dvs-slideImg",o.appendChild(s),i.appendChild(o)}e.appendChild(i),e=null,t.prototype._emit.call(this,r.d.BIND_SLIDE_COMPONENT,i),i=null},e.prototype._removeSlider=function(){var e=this._query("viewPort");if(!e)return null;var i=e.querySelector(".dvs-slideWrapper");t.prototype._emit.call(this,r.d.UNBIND_SLIDE_COMPONENT),i&&e.removeChild(i),i=null},e.prototype._createCanvas=function(e){var i,n=this._query("canvasWrapper");if(!n)return null;var o=document.createElement("canvas");o.id=e+"Canvas"+this._postfix,o.className="dvs-canvas dvs-"+e,n.appendChild(o),t.prototype._emit.call(this,"_bindCanvas",((i={})[e]=o,i)),this._canvasList.push(e),o=null},e.prototype._removeCanvas=function(e){var i=this._query("canvasWrapper");if(!i)return null;var n=this._query(e+"Canvas");if(!n)return null;i.removeChild(n),t.prototype._emit.call(this,"_unbindCanvas",e);for(var o=0;o<this._canvasList.length;o++)if(this._canvasList[o]===e){this._canvasList.splice(o,1);break}return n},e.prototype.removeAllCanvas=function(){for(var t=0;t<this._canvasList.length;t++)this._removeCanvas(this._canvasList[t])&&t--;this._removeSlider()},e.prototype.dispose=function(){t.prototype.dispose.call(this)},e}(a.a),F=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Y=undefined&&undefined.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,o++)n[o]=r[s];return n},W=function(t){function e(e,i,n,o,r){var s=t.call(this,o)||this;return s._sideRender=null,s._thumbnailRender=null,s._directoryRender=null,s._tagRender=null,s._scrollRender=null,s._pagerRender=null,s._tabRender=null,s._canvasRender=null,s._cameraRender=null,s._uiRender=null,s._dataStore=null,s._uiEventControl=null,s.uiConfig=null,s._viewerContainer=null,s.containerBox=null,s.useMyEvent=!0,s.topMenuColor="#3a393b",s.topMenuBorder="1px solid #1b1b1d",s.headerColor="#2a292b",s.footerColor="#434246",s.asideMenuColor="#434246",s.viewerBorderColor="#1b1b1d",s.canvasBackground="#434246",s.canvasBorder="0px solid #1b1b1d",s.canvasMouseShape="default",s.outerBorder="1px solid #1b1b1d",s._webcamItem=null,s._videoImageReady=!0,s._updateVideoTimer=null,s.showViewer=!0,s.showTopMenu=!0,s.showHeader=!0,s.showSidebar=!1,s.showTab=!1,s.showAside=!1,s.showMain=!0,s.showFooter=!0,s.showVideoContainer=!1,s.width="100%",s.height="100%",s.showWidth=-1,s.showHeight=-1,s._eventList={},s._resizeTimer=null,s._showLatestQueue={},s.postfix=n,s.uiConfig=i,s._dataStore=r,s._initViewer(e,i),s}return F(e,t),e.prototype._myQuery=function(t){var e,i;return null===(i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el)||void 0===i?void 0:i.querySelector("#"+t)},e.prototype._myQueryAll=function(t){var e,i;return null===(i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el)||void 0===i?void 0:i.querySelectorAll("#"+t)},e.prototype._initViewer=function(t,e){if(!t)return!1;if(Object(o.y)(t))t=document.getElementById(t);else if(!Object(o.q)(t))return!1;return this.containerBox=t,this._createMember(e,t),this._initMember(),this._initStatus(e),this._bindUiEvent(),this._bindButtonEvent(),!0},e.prototype._createMember=function(t,e){var i=this.postfix,n=this._oPub;this._uiRender=new E({postfix:i,container:e,uiConfig:t,pubsub:n});var o=this._uiRender.viewerContainer;this._viewerContainer=o,this._thumbnailRender=new A(i,n,o,this._dataStore),this._scrollRender=new D(i,n,o),this._pagerRender=new U(i,n),this._uiEventControl=new h(i,n,o),this._tabRender=new j(i,n,o),this._canvasRender=new H({postfix:i,pubsub:n,viewerContainer:o})},e.prototype._initMember=function(){var t;null===(t=this._sideRender)||void 0===t||t.sidebarInit(),this._scrollRender._addButtonScroll(),this._uiEventControl.uiEventInit(),this._tabRender.tabRenderInit(),this._canvasRender.canvasRenderInit()},e.prototype._initStatus=function(t){this.setViewerWidth(t.width),this.setViewerHeight(t.height),this.setShowViewer(t.showViewer),this.setOuterBorder(t.outerBorder),this.setFooterColor(t.footerColor),this.setHeaderColor(t.headerColor),this.setTopMenuColor(t.topMenuColor),this.setTopMenuBorder(t.topMenuBorder),this.setShowMain(t.showMain),this.setSidebarWidth(t.sidebarWidth),this.setShowVideoContainer(t.showVideoContainer),this.setShowTab(t.showTab),this.setCanvasBackground(t.canvasConfig.canvasBackground),this.setCanvasMouseShape(t.canvasConfig.canvasMouseShape),this.setCanvasBorder(t.canvasConfig.canvasBorder),this.setLoadingImage(t.canvasConfig.loadingImageUrl),this._setShowLoadingImage(!1)},e.prototype.unbindView=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;if(!e)return!1;var i=e.parentNode;return i&&(this._unbindStatus(),i.removeChild(e),i=e=null,this._viewerContainer.el=null),!0},e.prototype.updateUiSetting=function(t){},e.prototype._bindUiEvent=function(){var t,e=((t={})[r.f.VIEWER_RESIZE]=this._resizeViewer,t[r.f.DOCUMENT_POINTER_MOVE]=this._documentMouseMove,t[r.f.DOCUMENT_POINTER_UP]=this._documentMouseUp,t[r.f.DOCUMENT_CLICK]=this._documentClick,t[r.f.VIEWER_CLICK]=this._viewerClick,t[r.f.VIEWER_RIGHT_CLICK]=this._viewerRightClick,t[r.f.VIEWER_MOVE]=this._viewerMove,t[r.f.SIDEBAR_CLICK]=this._sideBarClick,t[r.f.SIDEBAR_STRETCH_START]=this._sidebarStretchStart,t[r.f.OPEN_DEFAULT_TAG]=this._openDefaultTag,t[r.f.FILE_LIST_CLICK]=this._fileListClick,t[r.f.FILE_LIST_RIGHT_CLICK]=this._fileListRightClick,t[r.f.FILE_KEY_UP]=this._fileListKeyUp,t[r.f.ADD_NEW_FOLDER]=this._addNewFolder,t[r.f.TAG_LIST_CLICK]=this._tagListClick,t[r.f.TAG_LIST_RIGHT_CLICK]=this._tagListRightClick,t[r.f.TAG_KEY_UP]=this._tagListKeyUp,t[r.f.ADD_NEW_TAG]=this._addNewTag,t[r.f.PAGER_BLUR]=this._pagerBlur,t[r.f.SET_SCROLLER_SIZE]=this._setScrollerSize,t[r.f.CHANGE_CANVAS_CURSOR]=this.setCanvasCursorTemp,t[r.d.SHOW_CANVAS_LOADING]=this._setShowLoadingImage,t[r.f.TAB_CHANGED]=this._tabChanged,t[r.f.TAB_LIST_CLICK]=this._tabListClick,t[r.f.CLOSE_SAVE_SETTING_BOX]=this._closeSaveSettingBox,t.onPanelChange=this._togglePaneBox,t.onSetSplitBar=this._setSplitBar,t[r.f.SHOW_LATEST_PAGE]=this._showLatestPage,t[r.f.UPDATE_PAGES_LAYOUT]=this._updatePagesLayout,t[r.f.CUSTOM_BUTTON_CLICK]=this._customButtonClick,t[r.f.TAG_REFRESH]=this._tagRefresh,t[r.f.TAG_SELECTED]=this._tagSelectedCallback,t[r.f.IMAGE_SELECTED]=this._imageSelectedCallback,t[r.f.FILE_REFRESH]=this._directoryRefresh,t[r.f.FILE_SELECTED]=this._fileSelectedCallback,t[r.f.PAGER_CHANGED]=this._pagerRefresh,t[r.f.THUMBNAIL_CHANGED]=this._thumbnailRefresh,t);for(var i in e)this._viewOn(i,e[i]);this._eventList=e},e.prototype._unbindStatus=function(){for(var t=Object.keys(this._eventList),e=0;e<t.length;e++){var i=t[e];this._viewOff(i)}this._eventList=null,this._uiEventControl.unbindEvents(),this._tabRender=null,this._tagRender=null,this._directoryRender=null,this._thumbnailRender.removeAllThumbnail(),this._canvasRender.removeAllCanvas(),this._scrollRender.unbindEvents(),this._uiRender.unbindContent(),this._cameraRender=null,this._webcamItem=null},e.prototype._bindButtonEvent=function(){var t=this,e=this.uiConfig.buttons;Object.keys(e).forEach((function(i){var n,s,a=e[i],l=null===(s=null===(n=t._viewerContainer)||void 0===n?void 0:n.el)||void 0===s?void 0:s.querySelector("#"+i+t.postfix);if(!l)return!1;l.classList.add("dvs-iconColor"),a.iconClass===undefined&&l.classList.add("dvs-emptyBtn"),a.onButtonClick&&Object(o.c)(l,r.c.CLICK,(function(e){t._scrollRender.buttonMove?t._scrollRender.buttonMove=!1:(e.changedTouches,t._viewEmit(a.onButtonClick,e))}))}))},e.prototype._viewOn=function(t,e){this._on(t,e.bind(this))},e.prototype._viewOff=function(t,e){this._off(t,e)},e.prototype._viewEmit=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];this._emit.apply(this,Y([t],e))},e.prototype.setShowViewer=function(t){var e,i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el;return this.showViewer=t,!!i&&(this._viewEmit(r.d.CANVAS_VISIBILITY_CHANGED,this.showViewer&&this.showMain),t?(i.classList.remove("dvs-disabled"),this._resizeViewer(),this._showLatestPage()):i.classList.add("dvs-disabled"),!0)},e.prototype.setShowTopMenu=function(t){var e=this._myQuery("topMenu"+this.postfix);return this.showTopMenu=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._resizeViewer(),!0)},e.prototype.setShowHeader=function(t){var e=this._myQuery("header"+this.postfix);return this.showHeader=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._resizeViewer(),!0)},e.prototype.setShowSidebar=function(t){var e;this.showSidebar=t;var i=null===(e=this._sideRender)||void 0===e?void 0:e.setShowSidebar(t);return this._resizeViewer(),i},e.prototype.setShowAside=function(t){var e=this._myQuery("asideMenu"+this.postfix);return this.showAside=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._resizeViewer(),!0)},e.prototype.setShowMain=function(t){var e=this._myQuery("container"+this.postfix);return this.showMain=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._viewEmit(r.d.CANVAS_VISIBILITY_CHANGED,this.showMain&&this.showViewer),this._resizeViewer(),!0)},e.prototype.setShowFooter=function(t){var e=this._myQuery("bottomMenu"+this.postfix);return this.showFooter=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._resizeViewer(),!0)},e.prototype.setShowTab=function(t){var e=this._myQuery("tabList"+this.postfix);return this.showTab=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._resizeViewer(),!0)},e.prototype.setHeaderColor=function(t){var e=this._myQuery("header"+this.postfix);return this.headerColor=t,e&&(e.style.background=t),!0},e.prototype.setTopMenuColor=function(t){var e=this._myQuery("topMenu"+this.postfix);return this.topMenuColor=t,e&&(e.style.background=t),!0},e.prototype.setTopMenuBorder=function(t){var e=this._myQuery("topMenu"+this.postfix);return this.topMenuBorder=t,e&&(e.style.border=t),this._resizeViewer(),!0},e.prototype.setFooterColor=function(t){var e=this._myQuery("bottomMenu"+this.postfix);return this.footerColor=t,e&&(e.style.background=t),!0},e.prototype.setAsideMenuColor=function(t){this.asideMenuColor=t;var e=this._myQuery("asideMenu"+this.postfix);return e&&(e.style.background=t),!0},e.prototype.setViewerBorderColor=function(t){var e,i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el,n=this._myQuery("Thumbnail"+this.postfix),o=this._myQuery("content"+this.postfix),r=this._myQuery("middle"+this.postfix);i&&(i.style.borderColor=t),n&&(n.style.borderColor=t),o&&(o.style.borderColor=t),r&&(r.style.borderColor=t),this.viewerBorderColor=t},e.prototype.setOuterBorder=function(t){var e;this.outerBorder=t;var i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el;i&&(i.style.border=t);var n=this._myQuery("container"+this.postfix),o=this._myQuery("middle"+this.postfix);if(n&&o){var r=t.split(" ");n.style.borderStyle=r[1],n.style.borderColor=r[2],o.style.borderStyle=r[1],o.style.borderColor=r[2],this._setSplitBar()}this._resizeViewer()},e.prototype.setViewerWidth=function(t){var e,i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el;if(this.width=t,!i)return!1;var n=String(t);return/\d+$/.test(n)&&(t=n+"px"),i.style.width=""+t,this._resizeViewer(),this._showLatestPage(),!0},e.prototype.getViewerWidth=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;return e?e.offsetWidth:this.width},e.prototype.setViewerHeight=function(t){var e,i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el;if(this.height=t,!i)return!1;var n=String(t);return/\d+$/.test(n)&&(t=n+"px"),i.style.height=""+t,this._resizeViewer(),this._showLatestPage(),!0},e.prototype.getViewerHeight=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;return e?e.offsetHeight:this.height},e.prototype.setSidebarWidth=function(t){var e,i=null===(e=this._sideRender)||void 0===e?void 0:e.setSidebarWidth(t);return this._resizeViewer(),i},e.prototype.getSidebarWidth=function(){var t;return null===(t=this._sideRender)||void 0===t?void 0:t.getSidebarWidth()},e.prototype.setShowVideoContainer=function(t){var e=this._myQuery("container"+this.postfix);if(!e)return!1;for(var i=e.children,n=0,o=i.length;n<o;n++){var r=i[n];if(null==r?void 0:r.classList.contains("dvs-customElement"))break;r.classList.contains("dvs-videoContainer")?t?r.classList.remove("dvs-hideVideoContainer"):r.classList.add("dvs-hideVideoContainer"):t?r.classList.add("dvs-hideVideoContainer"):r.classList.remove("dvs-hideVideoContainer")}return this.showVideoContainer=t,t||(this._resizeViewer(),this._showLatestPage()),!0},e.prototype.switchToTagTab=function(){var t=this._myQuery("TagsNav"+this.postfix),e=t&&t.children[0];return!!e&&(e.click(),!0)},e.prototype.switchToTreeTab=function(){var t=this._myQuery("DirctoryTreeNav"+this.postfix),e=t&&t.children[0];return!!e&&(e.click(),!0)},e.prototype.showGroup=function(t){var e=this._myQuery(t+this.postfix);return!!e&&(e.classList.remove("dvs-disabled"),e.classList.remove("dvs-noDisplay"),!0)},e.prototype.hideGroup=function(t){var e=this._myQuery(t+this.postfix);return!!e&&(e.classList.add("dvs-disabled"),e.classList.add("dvs-noDisplay"),!0)},e.prototype._documentMouseMove=function(t){this._cameraRender&&this._cameraRender.mouseMoveCallback(t)},e.prototype._documentMouseUp=function(t){var e,i;return!(!(null===(e=this._viewerContainer)||void 0===e?void 0:e.el)||!t)&&((!t.button||0===t.button)&&(this._cameraRender&&this._cameraRender.mouseUpCallback(t),void(null===(i=this._sideRender)||void 0===i||i.stretchMouseUp())))},e.prototype.documentKeyDown=function(t,e){e?this._thumbnailRender.keydownCallback(t,e):this._viewEmit(r.d.CANVAS_KEY_DOWN,t)},e.prototype.documentKeyUp=function(t,e){e?this._thumbnailRender.keyupCallback(t,e):this._viewEmit(r.d.CANVAS_KEY_UP,t)},e.prototype._documentClick=function(t){this._viewEmit(r.d.UPDATE_FOCUS,{viewerId:undefined,thumbnailId:undefined})},e.prototype.styleChange=function(){var t;if(!this.showViewer)return!1;if(this.uiConfig.buttonResize.ifResize)if(Object(o.u)()){var e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;if(!e)return;e.classList.add("DWT_imageEditor"),e=null}else this._changeButtonSize();var i=this._myQuery("topMenuRight"+this.postfix);i&&(i.parentElement.style.paddingRight=(i.getBoundingClientRect().width||0)+"px"),this._thumbnailRender.calculateSize(),this._thumbnailRender.updateAllDisplayed(),this.updateVideoSize(),this._scrollRender.updateAllGroupShowMore(),this._canvasRender.updateCanvasInnerSize(),this._sendViewSize()},e.prototype._viewerClick=function(t){},e.prototype._viewerRightClick=function(t){},e.prototype._viewerMove=function(t){var e;null===(e=this._sideRender)||void 0===e||e.stretchMouseMove(t)},e.prototype._dropFile=function(t){for(var e=t.dataTransfer.files,i=[],n=0;n<e.length;n++){var s=e[n];if(/^image\/(?!tiff)/.test(s.type)){var a={oriData:o.a.createObjectURL(s),minData:null,metadata:{width:500,height:600},tags:[]};i.push(a)}}this._viewEmit(r.d.APPEND_SYNC_DROP,i)},e.prototype._sendViewSize=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;if(!e)return!1;var i=e.getBoundingClientRect();if(0===i.width||0===i.height||Math.round(i.width)===Math.round(this.showWidth)&&Math.round(i.height)===Math.round(this.showHeight))return!1;this.showWidth=Math.round(i.width),this.showHeight=Math.round(i.height),this._viewEmit(r.g.RESIZE,i.width,i.height)},e.prototype.createThumbnail=function(t){return this._thumbnailRender.createThumbnail(t)},e.prototype.createInnerThumbnail=function(){this._thumbnailRender.createInnerThumbnail(this.uiConfig.canvasConfig)},e.prototype.removeThumbnail=function(t){var e=this._thumbnailRender.removeThumbnail(t);return this._setSplitBar(),e},e.prototype._sideBarClick=function(t){var e;null===(e=this._sideRender)||void 0===e||e.setShowNavigationBox(!1)},e.prototype._sidebarStretchStart=function(t){var e;null===(e=this._sideRender)||void 0===e||e.stretchMouseDown(t)},e.prototype._openDefaultTag=function(){this._directoryRender&&this._tagRender&&(this._viewEmit("_onOpenAll"),this._myQuery("defaultTag"+this.postfix).classList.add("dvs-activeAllImage"),this._tagRender.selectTagByName(""),this._directoryRender.selectFileByName(""))},e.prototype._fileListClick=function(t){var e=this._directoryRender;e&&(e.confirmFolder(t),e.cancelFolder(t),e.enterFolder(t))},e.prototype._fileListRightClick=function(t){},e.prototype._fileListKeyUp=function(t){if(13===t.keyCode){var e=t.target.nextSibling.children[0];e&&e.click()}else if(27===t.keyCode){var i=t.target.nextSibling.children[1];i&&i.click()}},e.prototype._addNewFolder=function(t){var e;null===(e=this._directoryRender)||void 0===e||e.addNewFolder(t)},e.prototype._tagListClick=function(t){var e=t.target,i=this._tagRender;if(!e||!i)return!1;e.classList.contains("confirmTag")||e.classList.contains("renameConfirmTag")?i.confirmTag(e):e.classList.contains("cancelTag")?i.cancelTag(e):e.classList.contains("dvs-quickEdit")?i.quickRenameTag(e):e.classList.contains("dvs-quickDel")?i.quickDelTag(e):i.showTagContent(t)},e.prototype._tagListRightClick=function(t){},e.prototype._tagListKeyUp=function(t){if(13===t.keyCode){var e=t.target.nextSibling.children[0];e&&e.click()}else if(27===t.keyCode){var i=t.target.nextSibling.children[1];i&&i.click()}},e.prototype._addNewTag=function(t){var e;null===(e=this._tagRender)||void 0===e||e.addNewTag(t)},e.prototype._pagerBlur=function(t){this._pagerRender.pageBlur(t)},e.prototype.setInnerTbProp=function(t,e){var i;this._handleInnerProp(t,e),null===(i=this._thumbnailRender.innerThumbnail)||void 0===i||i.handleInnerProp(t,e)},e.prototype._handleInnerProp=function(t,e){this[t]=e;var i="set"+t.replace(/^[a-z]{1}/,(function(t){return t.toUpperCase()}));Object(o.s)(this[i])&&this[i](e)},e.prototype.setCanvasBackground=function(t){var e;this.canvasBackground=t;var i=this._myQuery("mainCanvas"+this.postfix);i&&(i.style.background="",setTimeout((function(){i.style.background=t}))),this._thumbnailRender.innerThumbnail&&(this._thumbnailRender.innerThumbnail.background=t);var n=null===(e=this._viewerContainer.el)||void 0===e?void 0:e.querySelector(".dvs-slideWrapper");n&&(n.style.background=t)},e.prototype.setCanvasBorder=function(t){this.canvasBorder=t;var e=this._myQuery("viewPort"+this.postfix);e&&(e.style.border=t),this._thumbnailRender.innerThumbnail&&(this._thumbnailRender.innerThumbnail.border=t),this._resizeViewer()},e.prototype.setCanvasMouseShape=function(t,e){void 0===e&&(e=!1),e||(this.canvasMouseShape=t,this._viewEmit(r.d.CANVAS_DEFAULT_CURSOR,t));var i=this._myQuery("canvasWrapper"+this.postfix);i&&(i.style.cursor=t),this._thumbnailRender.innerThumbnail&&(this._thumbnailRender.innerThumbnail.mouseShape=t)},e.prototype.setCanvasCursorTemp=function(t){this.setCanvasMouseShape(t||this.canvasMouseShape,!0)},e.prototype.setSelectedBoxLineColor=function(t){var e;this._thumbnailRender.innerThumbnail.setSelectedBoxLineColor(t),null===(e=this._cameraRender)||void 0===e||e.setSelectedBoxColor(t)},e.prototype.setOperationMode=function(t){this._thumbnailRender.innerThumbnail.setOperationMode(t)},e.prototype.setSelectedBoxes=function(t,e){this._thumbnailRender.innerThumbnail.setSelectedBoxes(t,e)},e.prototype.clearSelectedBoxes=function(t){this._thumbnailRender.innerThumbnail.clearSelectedBoxes(t)},e.prototype.setKeepAspectRatio=function(t){this._thumbnailRender.innerThumbnail.setKeepAspectRatio(t)},e.prototype.setAspectRatio=function(t){this._thumbnailRender.innerThumbnail.setAspectRatio(t)},e.prototype._setScrollerSize=function(t){this._canvasRender.updateScrollSize(t)},e.prototype._tabChanged=function(t){this._tabRender.updateTabList(t)},e.prototype._tabListClick=function(t){var e=t.target;if(null==e?void 0:e.classList.contains("dvs-closeTab"))null==e||e["dvs-id"]},e.prototype._tagRefresh=function(t){var e;null===(e=this._tagRender)||void 0===e||e.updateTagList(t)},e.prototype._tagSelectedCallback=function(t){var e;null===(e=this._tagRender)||void 0===e||e.selectTagByName(t)},e.prototype._imageSelectedCallback=function(t){return this._thumbnailRender.updateSelectedIndexes(t)},e.prototype._directoryRefresh=function(t){if(!this._myQuery("treeLists"+this.postfix)||!this._directoryRender)return!1;this._directoryRender.updateDirectory(t);var e=this._myQuery("addFolder"+this.postfix);e&&e.style&&(e.style.pointerEvents="auto")},e.prototype._fileSelectedCallback=function(t){var e;null===(e=this._directoryRender)||void 0===e||e.selectFileByName(t)},e.prototype._pagerRefresh=function(t){var e=t.cur,i=t.total,n=this._pagerRender.getCurrentPage();this._pagerRender.getTotalPage();this._thumbnailRender.pageChangeCallback(n,e,i),this._pagerRender.updatePage(t),this._showLatestPage(e)},e.prototype._thumbnailRefresh=function(t){this._thumbnailRender.updateContents(t)},e.prototype.setDisplayMode=function(t){var e,i,n=this._myQuery("viewPort"+this.postfix),o=this._thumbnailRender.innerThumbnail;if("single"===t)o.clearSelectedBoxes(),null===(e=this._myQuery("innerThumbnail"+this.postfix))||void 0===e||e.classList.add("dvs-disabled"),null==n||n.classList.remove("dvs-disabled"),o.showThumbnail=!1;else{if("continuous"!==t)return!1;null==n||n.classList.add("dvs-disabled"),null===(i=this._myQuery("innerThumbnail"+this.postfix))||void 0===i||i.classList.remove("dvs-disabled"),o.showThumbnail=!0}return this._resizeViewer(),!0},e.prototype.setViewMode=function(t,e){return this._thumbnailRender.innerThumbnail.setViewMode(t,e)},e.prototype._togglePaneBox=function(){var t,e,i=null===(t=this._sideRender)||void 0===t?void 0:t.getShowNavigation();null===(e=this._sideRender)||void 0===e||e.setShowNavigationBox(!i)},e.prototype._customButtonClick=function(t,e){this._scrollRender.buttonMove?this._scrollRender.buttonMove=!1:this._viewEmit(t,e)},e.prototype._closeSaveSettingBox=function(){},e.prototype._setSplitBar=function(){var t,e=this._myQuery("container"+this.postfix),i=this._myQuery("middle"+this.postfix);if(!e||!i)return!1;var n=Object.keys(this._thumbnailRender._thumbnails),o=this._thumbnailRender._thumbnails[n[0]];if(!o||!(null==o?void 0:o.showThumbnail)||(null==o?void 0:o.fullThumbnail)||(null===(t=this._cameraRender)||void 0===t?void 0:t.isVideoShow))e.style.borderWidth="0px",i.style.borderWidth="0px";else{var r=this.outerBorder.split(" ")[0],s="horizontal"===o.location,a=o.sequence,l=this._getBorderWidth(r,s,a);s?(e.style.borderWidth=l,i.style.borderWidth="0px"):(i.style.borderWidth=l,e.style.borderWidth="0px")}this._resizeViewer()},e.prototype._changeButtonSize=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;if(!e)return!1;e.classList.add("dvs-buttonResize");var i=e.clientWidth,n=e.clientHeight,r=36*(i/1920<n/1080?i/1920:n/1080)*window.devicePixelRatio,s=this._myQuery("topMenu"+this.postfix),a=this._myQuery("bottomMenu"+this.postfix),l=this.uiConfig.buttonResize,h=l.maxSize,u=l.minSize,c=Math.max(Math.min(r,h),u),d=Math.floor(1.875*c);if(s&&s.clientWidth>0){s.classList.add("dvs-resizeButton"),Object(o.F)(s,{flexBasis:d+"px",height:d+"px"});for(var p=0;p<s.children.length;p++){s.children[p].style.fontSize=c+"px"}}if(a&&a.clientWidth>0){a.classList.add("dvs-resizeButton"),Object(o.F)(a,{fontSize:c+"px",flexBasis:d+"px",height:d+"px",justifyContent:"flex-start"});for(p=0;p<a.children.length;p++){a.children[p].style.fontSize=c+"px"}}},e.prototype._resizeViewer=function(t,e){var i=this;t&&e&&(this._showLatestQueue[t]=e),clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout((function(){var t,e;for(var n in i.styleChange(),i._showLatestQueue)null===(e=(t=i._showLatestQueue)[n])||void 0===e||e.call(t,i._pagerRender.getCurrentPage());i._showLatestQueue={}}),20)},e.prototype._getBorderWidth=function(t,e,i){var n="";return n+=!e&&i<0?t:"0px",n+=" ",n+=e&&i>=0?t:"0px",n+=" ",n+=!e&&i>=0?t:"0px",n+=" ",n+=e&&i<0?t:"0px"},e.prototype._updatePagesLayout=function(){this._thumbnailRender.updatePagesLayout()},e.prototype._showLatestPage=function(t){this._thumbnailRender.showLatestPage(t)},e.prototype.setButtonClass=function(t){var e=this.uiConfig.buttons,i=this._myQuery(""+t+this.postfix);if(i){var n=e[t],o=n.iconClass?" "+n.iconClass:"",r=n.cssStyle?" "+n.cssStyle:"",s=i.classList.contains("dvs-disabled")?" dvs-disabled":"",a=n.setClass||"";return i.className="ds-dvs-ui-iconfont dvs-iconColor dvs-"+t+s+o+r+" "+a,!0}return!1},e.prototype.setGroupClass=function(t,e){var i=this.uiConfig.groups,n=this._myQuery(t+this.postfix);if(n){var o=i[t].cssStyle?" "+i[t].cssStyle:"",r=n.classList.contains("dvs-disabled")?" dvs-disabled":"";return n.className="dvs-"+t+" dvs-groupType"+r+o+" "+e,!0}return!1},e.prototype.fullScreen=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el,i=Object(o.z)(e);return this._resizeViewer(),i},e.prototype.cancelFullScreen=function(){var t=Object(o.r)()&&Object(o.f)();return this._resizeViewer(),t},e.prototype.fullPage=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;return!!e&&(e.classList.add("fitPage"),this.cancelFullScreen(),this._resizeViewer(),!0)},e.prototype.cancelFullPage=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;return!!e&&(e.classList.remove("fitPage"),this.cancelFullScreen(),this._resizeViewer(),!0)},e.prototype.createCustomElement=function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=!1),this._uiRender.createCustomElement(t,e,i)},e.prototype.updateVideoSize=function(){if(this._videoSize&&this.showVideoContainer){var t=this._myQuery("videoContainer"+this.postfix),e=this._myQuery("videoImage"+this.postfix);if(!t||!e)return!1;var i=t.clientWidth,n=t.clientHeight,o=this._videoSize,r=o.imageWidth,s=o.imageHeight;if(i/r-1<n/s-1){var a=i/r;e.style.width=i+"px",e.style.height=s*a+"px"}else{a=n/s;e.style.width=r*a+"px",e.style.height=n+"px"}this._videoSize.imageBoxWidth=e.clientWidth,this._videoSize.imageBoxHeight=e.clientHeight}},e.prototype.updateVideoContainer=function(t){var e=this;return this._videoImageReady?this._updateVideoImage(t):(clearTimeout(this._updateVideoTimer),this._updateVideoTimer=setTimeout((function(){e._updateVideoImage(t)}),200),!0)},e.prototype._updateVideoImage=function(t){var e=this,i=this._myQuery("videoImage"+this.postfix);if(!i)return!1;i.src=t,clearTimeout(this._updateVideoTimer),this._videoImageReady=!1,i.onload=function(){e._videoImageReady=!0,i.style.display="",e._videoSize&&e._videoSize.imageWidth===i.naturalWidth&&e._videoSize.imageHeight===i.naturalHeight&&e._videoSize.imageBoxWidth===i.clientWidth&&e._videoSize.imageBoxHeight===i.clientHeight||(e._videoSize={imageWidth:i.naturalWidth,imageHeight:i.naturalHeight,imageBoxWidth:i.clientWidth,imageBoxHeight:i.clientHeight},e.updateVideoSize())},i.onerror=function(){e._videoImageReady=!0,i.style.display="none",i.onload=null}},e.prototype.getViewerElement=function(){var t;return(null===(t=this._viewerContainer)||void 0===t?void 0:t.el)||null},e.prototype.bindContent=function(t){return this._uiRender.bindContent(t)},e.prototype.unbindContent=function(){return this._uiRender.unbindContent()},e.prototype.setLoadingImage=function(t){if(!t)return!1;var e=this._myQuery("loadingImage"+this.postfix);return e&&(e.src=t),!0},e.prototype._setShowLoadingImage=function(t){var e=this._myQuery("loadingLayer"+this.postfix);e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"))},e.prototype.dispose=function(){var e,i,n,o,r,s,a,l,h,u,c;t.prototype.dispose.call(this),this.unbindView(),this.unbindContent(),null===(e=this._uiRender)||void 0===e||e.dispose(),this._uiRender=null,null===(i=this._thumbnailRender)||void 0===i||i.dispose(),this._thumbnailRender=null,null===(n=this._scrollRender)||void 0===n||n.dispose(),this._scrollRender=null,null===(o=this._pagerRender)||void 0===o||o.dispose(),this._pagerRender=null,null===(r=this._uiEventControl)||void 0===r||r.dispose(),this._uiEventControl=null,null===(s=this._tabRender)||void 0===s||s.dispose(),this._tabRender=null,null===(a=this._canvasRender)||void 0===a||a.dispose(),this._canvasRender=null,null===(l=this._sideRender)||void 0===l||l.dispose(),this._sideRender=null,null===(h=this._directoryRender)||void 0===h||h.dispose(),this._directoryRender=null,null===(u=this._tagRender)||void 0===u||u.dispose(),this._tagRender=null,null===(c=this._cameraRender)||void 0===c||c.dispose(),this._cameraRender=null,this._viewerContainer=null,this.containerBox=null},e}(a.a);i.d(e,"ViewUi",(function(){return W})),window.Dynamsoft=window.Dynamsoft||{},window.Dynamsoft.ViewUi=W}]);
|
|
1
|
+
/*! Date: 03/22/2022 14:31:46 */
|
|
2
|
+
!function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=8)}([function(t,e,i){"use strict";i.d(e,"e",(function(){return o})),i.d(e,"c",(function(){return r})),i.d(e,"g",(function(){return s})),i.d(e,"d",(function(){return a})),i.d(e,"f",(function(){return l})),i.d(e,"b",(function(){return u})),i.d(e,"a",(function(){return h}));var n="undefined"!=typeof window,o=(n&&window,!!n&&window.document.documentElement,{PREVIOUS:"prev",NEXT:"next"}),r={CLICK:"click",KEYDOWN:"keydown",TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_UP:"mouseup",MOUSE_OVER:"mouseover",MOUSE_OUT:"mouseout",CHANGE:"change",SCROLL:"scroll",CONTEXTMENU:"contextmenu",RESIZE:"resize"},s={IMAGE_SELECTED:"imageSelected",PAGE_CLICK:"click",PAGE_MOUSE_DOWN:"mousedown",PAGE_MOUSE_MOVE:"mousemove",PAGE_MOUSE_UP:"mouseup",PAGE_MOUSE_OVER:"mouseover",PAGE_MOUSE_OUT:"mouseout",PAGE_DOUBLE_CLICK:"dblclick",PAGE_RIGHT_CLICK:"rightclick",PAGE_CONTEXTMENU:"contextmenu",DRAG_START:"dragstart",DRAG_MOVE:"dragmove",DRAG_DONE:"dragdone",KEY_DOWN:"keydown",KEY_UP:"keyup",RESIZE:"resize",TOP_PAGE_CHANGED:"topPageChanged",BUFFER_CHANGED:"bufferChanged",THUMBNAIL_STRETCH:"resize",REMOVE_PAGE:"removePage",FILE_KEY_UP:"fileKeyUp",FILE_LIST_CLICK:"fileListClick",FILE_LIST_RIGHT_CLICK:"fileListRightClick",TAG_KEY_UP:"tagKeyUp",TAG_LIST_CLICK:"tagListClick",TAG_LIST_RIGHT_CLICK:"tagListRightClick",PAGE_AREA_SELECTED:"pageAreaSelected",PAGE_AREA_UNSELECTED:"pageAreaUnselected",VIEWER_PAGE_RENDERED:"pageRendered",DOCUMENT_KEY_UP:"onDocumentKeyUp",DOCUMENT_POINTER_UP:"onDocumentPointerUp",DOCUMENT_POINTER_MOVE:"onDocumentPointerMove",DOCUMENT_CLICK:"onDocumentClick",SIDEBAR_CLICK:"onSidebarClick",FILE_DROP:"onDrop",WHEEL:"wheel"},a={APPEND_SYNC_DROP:"_appendSyncDrop",UPDATE_UI_SETTING:"_updateUISetting",UPDATE_FOCUS:"_updateFocus",CANVAS_VISIBILITY_CHANGED:"_canvasVisibilityChanged",SET_SELECTED_INDEXES:"_SetSelectedIndexes",DOCUMENT_UP:"_documentUp",DOCUMENT_MOVE:"_documentMove",DISPLAYED_IMAGE_CHANGED:"_displayedImageChanged",REORDER_THUMBNAIL:"_onReOrderThumbnail",CHANGE_THUMBNAIL_VIEW_PROP:"_changeThumbnailViewProp",UPDATE_INNER_THUMBNAIL_PAGE:"_updateInnerThumbnailPage",ERROR:"_updateErrorMessage",LOG:"_updateLogMessage",CLEAR_SLT_BOX:"_clearSltBox",DIRECTORY_CHANGED:"_DirectoryChanged",BIND_SLIDE_COMPONENT:"_bindSlideComponent",UNBIND_SLIDE_COMPONENT:"_unbindSlideComponent",BIND_CANVAS:"_bindCanvas",UNBIND_CANVAS:"_unbindCanvas",SET_CANVAS_SIZE:"_setCanvasSize",CANVAS_TOUCH_START:"_canvasTouchstart",CANVAS_TOUCH_MOVE:"_canvasTouchmove",CANVAS_TOUCH_END:"_canvasTouchend",CANVAS_MOUSE_DOWN:"_canvasMousedown",CANVAS_MOUSE_UP:"_canvasMouseup",CANVAS_MOUSE_MOVE:"_canvasMousemove",CANVAS_MOUSE_OVER:"_canvasMouseOver",CANVAS_MOUSE_OUT:"_canvasMouseOut",CANVAS_WHEEL:"_canvasWheel",CANVAS_SCROLL:"_canvasScroll",CANVAS_CLICK:"_canvasClick",CANVAS_DOUBLE_CLICK:"_canvasDoubleClick",CANVAS_RIGHT_CLICK:"_canvasRightClick",CANVAS_KEY_DOWN:"_canvasKeyDown",CANVAS_KEY_UP:"_canvasKeyUp",CANVAS_RESIZE:"_canvasResize",CANVAS_DRAG_START:"_canvasDragStart",CANVAS_DRAG_MOVE:"_canvasDragMove",CANVAS_DRAG_DONE:"_canvasDragDone",CANVAS_DEFAULT_CURSOR:"_canvasDefaultCursor",SHOW_CANVAS_LOADING:"_showCanvasLoading",DB_SAVE_OK:"_addDataToDBSuccess",DB_SAVE_FAILED:"_addDataToDBFailed",AFTER_RENDER:"_afterRender",CURRENT_CHANGED:"_currentChanged"},l={VIEWER_RESIZE:"_viewerResizeUI",VIEWER_CLICK:"_mouseClickUI",VIEWER_RIGHT_CLICK:"_viewerRightClickUI",VIEWER_MOVE:"_mouseMoveUI",SHOW_LATEST_PAGE:"_showLatestPage",UPDATE_PAGES_LAYOUT:"_updatePagesLayout",DOCUMENT_POINTER_MOVE:"_documentPointerMoveUI",DOCUMENT_POINTER_UP:"_documentPointerUpUI",DOCUMENT_KEY_DOWN:"_documentKeyDownUI",DOCUMENT_KEY_UP:"_documentKeyUpUI",DOCUMENT_CLICK:"_documentClickUI",SIDEBAR_CLICK:"_sideBarClickUI",SIDEBAR_STRETCH_START:"_sidebarStretchStartUI",FILE_LIST_CLICK:"_fileListClickUI",FILE_LIST_RIGHT_CLICK:"_fileListRightClickUI",FILE_KEY_UP:"_fileListKeyUpUI",ADD_NEW_FOLDER:"_addNewFolderUI",FILE_REFRESH:"_directoryRefreshUI",FILE_SELECTED:"_fileSelectedUI",TAG_LIST_CLICK:"_tagListClickUI",TAG_LIST_RIGHT_CLICK:"tagListRightClickUI",TAG_KEY_UP:"_tagKeyUpUI",ADD_NEW_TAG:"_addNewTagUI",TAG_REFRESH:"_tagRefreshUI",TAG_SELECTED:"_tagSelectedUI",OPEN_DEFAULT_TAG:"_openDefaultTagUI",IMAGE_SELECTED:"_imageSelectedUI",THUMBNAIL_CHANGED:"_thumbnailChangedUI",UPDATE_THB_ITEM:"_updateThbItem",UPDATE_THUMBNAIL_PROP:"_updateThumbnailPropUI",SCROLL_TO:"_scrollToUI",SET_VIEW_MODE:"_setViewModeUI",MERGE_DISPLAYED_UIDS:"_mergeDisplayedUidsUi",PAGER_BLUR:"_pagerBlurUI",PAGER_CHANGED:"_pagerChangedUI",SET_SCROLLER_SIZE:"_setScrollerSizeUI",CHANGE_CANVAS_CURSOR:"_changeCanvasCursorUI",TAB_CHANGED:"_tabChangedUI",TAB_LIST_CLICK:"_tabListClickUI",CLOSE_SAVE_SETTING_BOX:"_closeSaveSettingBoxUI",CUSTOM_BUTTON_CLICK:"_customButtonClickUI"},u={UPDATE_FOR_VIEWER:"_updateForViewer",LOAD_TO_VIEWER:"_loadToViewer",OPEN_TO_VIEWER:"_openToViewer",LOAD_PAGE:"_loadPage",LOAD_PAGE_OK:"_loadPageOk",SET_CURRENT_INDEX:"_setCurrentIndex",REMOVE_VIEWER_UID:"_removeViewerUid",GOTO_PAGE:"_gotoPage",CHANGE_PAGE:"_changePage",REORDER_PAGE:"_reorderPage",REMOVE_PAGE:"_removePage",OVERLAY_RECTANGLE:"_overlayRectangle",EDIT:"_editPage",UPDATE_THUMBNAIL_PAGE:"_updateThumbnailPage",REMOVE_FROM_TAG:"_removeFromTag",LOAD_TAG:"_loadToTag",OPEN_TAG:"_openTag",REMOVE_PAGE_TAG:"_removePageTag",ADD_PAGE_TAG:"_addPageTag",EMPTY_TAG:"_emptyTag",RENAME_TAG:"_renameTag",TAG_CHANGED:"_tagChanged",APPEND_SYNC:"_appendSync",UPDATE_SYNC:"_updateSync",REMOVE_FROM_FILE:"_removeFromFile",LOAD_FILE:"_loadToFile",APPEND_TO_OPEN_TAG:"_appendToOpenTag",APPEND_TO_OPEN_ALL:"_appendToOpenAll",REMOVE_FROM_ALL:"_removeFromAll",REMOVE_FILE:"_removeFile"},h={OK:{code:0,message:"ok."},PARAM_TYPE:{code:80001,message:"The parameter type is wrong."},PARAMETER_RANGE:{code:80002,message:"The parameter is out of range."},IMG_NOT_EXIST:{code:80003,message:"The image does not exist."},IMG_LOAD_FAILED:{code:80004,message:"The image load failed."},BACK_TO_TOP:{code:80005,message:"The current folder is root folder."},FILE_NOT_EXIST:{code:80006,message:"The file does not exist."},IMG_HAVE_EXIST:{code:80007,message:"The image has existed."},EMPTY_IN_ARRAY:{code:80008,message:"There is some empty element in array."},TAG_NOT_EXIST:{code:80009,message:"Tag does not exist."},TAG_HAVE_EXIST:{code:80010,message:"The tag already exists."},ELEMENT_NOT_EXIST:{code:80011,message:"Element does not exist."},PAGE_NOT_EXIST:{code:80012,message:"Page does not exist."},PARAMETER_INVALID:{code:80013,message:"The parameter is invalid."},URL_INVALID:{code:80014,message:"The url is invalid."},FOLDER_NOT_EXIST:{code:80015,message:"The folder does not exist."},COLOR_INVALID:{code:80016,message:"The color is invalid."},IMG_STORAGE_FAILED:{code:80017,message:"Failed to save image to database."},IMG_REMOVE_FAILED:{code:80018,message:"Failed to remove image from database by uid."},PATH_ERROR:{code:80019,message:"The path of file or folder does not exist."},BROWSER_NOT_SUPPORT:{code:80020,message:"Your browser does not support full screen."},SIZE_INVALID:{code:80021,message:"The size is invalid."},OPERATION_MODE_ERROR:{code:80022,message:"The operation mode is error."},BORDER_INVALID:{code:80023,message:"The border is invalid."},CAMERA_CLASS_REQUIRE:{code:80025,message:"The camera class is required."},VIEW_UI_REQUIRE:{code:80026,message:"The constructor of view ui is required."},WEBCAM_LICENSE_INVALID:{code:80027,message:"The license of webcam is invalid."},CAMERA_EXIST:{code:80028,message:"The video is shown."},CAMERA_CLASS_INVALID:{code:80029,message:"The camera class is invalid."},META_DATA_NOT_EXIST:{code:80030,message:"The metadata is not exist."},CAMERA_NOT_EXIST:{code:80031,message:"The video is not shown."},FILE_EXIST:{code:80032,message:"The file already exists."}}},function(t,e,i){"use strict";function n(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function o(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)for(var i=e+1;i<t.length;i++)t[e]===t[i]&&(t.splice(i,1),i--);return t}}function r(t){return"[object Object]"===Object.prototype.toString.call(t)}function s(t){return"function"==typeof t}function a(t){return"string"==typeof t}function l(t){var e=String(t);return!!/^\d+(px|em)$|^\d+$|^(100|[1-9]?\d(\.\d\d?\d?)?)%$/.test(e)}function u(t){return"number"==typeof t&&!isNaN(t)}function h(t){return"[object Boolean]"===Object.prototype.toString.call(t)}function c(t){var e=document.createElement("span");return e.style.background=t,!!e.style.background}function d(t){var e=document.createElement("span");return e.style.border=t,!(!e.style.border&&""!==t)}function p(){return"ontouchstart"in document.documentElement}function _(){return document.documentMode!==undefined}function v(t){return t instanceof HTMLElement||"[object ShadowRoot]"===Object.prototype.toString.call(t)}function f(t,e){if(a(e))t.style.cssText=e;else for(var i in e)t.style[i]=e[i]}function m(t,e,i,n){if(t)return t.addEventListener(e,i,n),function(){t.removeEventListener(e,i)}}function g(t,e){for(var i in t)e[i]===undefined?e[i]=t[i]:r(t[i])&&r(e[i])?g(t[i],e[i]):e[i]=t[i]}function y(t,e){for(var i in t){var n=t[i],o=e[i];o===undefined?e[i]=t[i]:h(n)&&r(o)?o.visibility=n:r(n)&&r(o)?y(t[i],e[i]):e[i]=t[i]}}function b(t,e){var i=this,n=0,o=null;return function(){var r=+new Date;r-n<e?(clearTimeout(o),o=setTimeout((function(){n=r,t.apply(i)}),e)):(n=r,t.apply(i))}}function E(t){t&&t.stopPropagation?t.stopPropagation():t&&(t.cancelBubble=!0)}function C(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function S(t){return""===t||t===undefined?null:document.getElementById(t)}function I(){var t=window.document;return t.fullscreenElement||t.msFullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement||!1}function T(t){return t.requestFullscreen?(t.requestFullscreen(),!0):t.mozRequestFullScreen?(t.mozRequestFullScreen(),!0):t.msRequestFullscreen?(t.msRequestFullscreen(),!0):t.oRequestFullscreen?(t.oRequestFullscreen(),!0):t.webkitRequestFullscreen?(t.webkitRequestFullScreen(),!0):(alert("Your browser does not support full screen!"),!1)}function w(){var t=window.document;return t.exitFullScreen?(t.exitFullScreen(),!0):t.mozCancelFullScreen?(t.mozCancelFullScreen(),!0):t.webkitExitFullscreen?(t.webkitExitFullscreen(),!0):t.msExitFullscreen?(t.msExitFullscreen(),!0):void 0}function O(t){for(var e=t.parentNode.children,i=0;i<e.length;i++)if(e[i]===t)return i}function R(t,e){for(var i=t.parentNode,n=i.children,o=0,r=0;r<n.length;r++){var a=n[r];if(s(e)){if(!e(a,i))continue;if(a===t)return o;o++}else if(a===t)return r}return-1}function x(t,e){var i=e.parentNode;i.lastChild==e?i.appendChild(t):P(t,e.nextSibling,i)}function P(t,e,i){e===undefined?i.appendChild(t):i.insertBefore(t,e)}function L(t){var e=Math.random().toString(35).substring(2);return e.length<11&&(e+=Math.random().toString(35).substring(2)),t=Math.max(Math.min(Math.round(t),11),8),e=e.substring(0,t)}function A(t){var e;if(n(t))e=[];else{if(!r(t))return t;e={}}for(var i in t){var o=t[i];n(t)||r(t)?e[i]=A(o):e[i]=o}return e}function M(t){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame,i=!!e;if(e&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(e.toString())&&(i=!1),i)return e(t);var n={},o=1,r=null,s=+new Date;return function(t,e){var i=o++;return n[i]=t,null===r&&(r=setInterval((function(){var t=+new Date,e=n;for(var i in n={},0,e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i](t),s=t);t-s>2500&&(clearInterval(r),r=null)}),1e3/60)),i}(t)}function D(){var t=window;return t?t.devicePixelRatio?t.devicePixelRatio:t.screen.deviceXDPI&&t.screen.logicalXDPI?t.screen.deviceXDPI/t.screen.logicalXDPI:1:1}function B(t){var e=new Date,i={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),i)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[n]:("00"+i[n]).substr((""+i[n]).length)));return t}function U(t,e,i,n,o){var r=t+i/2,s=e+n/2,a=N(t,e,r,s,o),l=N(t+i,e,r,s,o),u=N(t+i,e+n,r,s,o),h=N(t,e+n,r,s,o),c=[l.x,a.x,h.x,u.x].sort((function(t,e){return t-e})),d=[l.y,a.y,h.y,u.y].sort((function(t,e){return t-e}));return{x:c[0],y:d[0],width:c[3]-c[0],height:d[3]-d[0]}}function N(t,e,i,n,o){return o=o/180*Math.PI,{x:(t-i)*Math.cos(o)-(e-n)*Math.sin(o)+i,y:(t-i)*Math.sin(o)+(e-n)*Math.cos(o)+n}}i.d(e,"m",(function(){return n})),i.d(e,"J",(function(){return o})),i.d(e,"w",(function(){return r})),i.d(e,"s",(function(){return s})),i.d(e,"y",(function(){return a})),i.d(e,"x",(function(){return l})),i.d(e,"v",(function(){return u})),i.d(e,"n",(function(){return h})),i.d(e,"p",(function(){return c})),i.d(e,"o",(function(){return d})),i.d(e,"u",(function(){return p})),i.d(e,"t",(function(){return _})),i.d(e,"q",(function(){return v})),i.d(e,"F",(function(){return f})),i.d(e,"c",(function(){return m})),i.d(e,"A",(function(){return g})),i.d(e,"B",(function(){return y})),i.d(e,"H",(function(){return b})),i.d(e,"G",(function(){return E})),i.d(e,"C",(function(){return C})),i.d(e,"j",(function(){return S})),i.d(e,"r",(function(){return I})),i.d(e,"z",(function(){return T})),i.d(e,"f",(function(){return w})),i.d(e,"h",(function(){return O})),i.d(e,"i",(function(){return R})),i.d(e,"k",(function(){return x})),i.d(e,"l",(function(){return P})),i.d(e,"I",(function(){return L})),i.d(e,"d",(function(){return A})),i.d(e,"D",(function(){return M})),i.d(e,"e",(function(){return D})),i.d(e,"g",(function(){return B})),i.d(e,"E",(function(){return U})),i.d(e,"b",(function(){return k})),i.d(e,"a",(function(){return V}));var k={log:function(t){window.Dynamsoft&&window.Dynamsoft.Lib.debug&&window.Dynamsoft.Lib.log(t)}},V={windowURL:window.URL||window.webkitURL,createURL:function(t){return a(t)?t:V.createURLWithType(t).data},createURLWithType:function(t){if(a(t)||undefined===t)return{type:"string",data:t};if(t instanceof Blob)return{type:"object",data:V.createObjectURL(t)};if(t.imageData&&t.imageData instanceof Blob)return{type:"object",data:V.createObjectURL(t.imageData)};if(t.imageData){var e=Object.prototype.toString.call(t.imageData);if(/\[object \w+Array\]/.test(e))return{type:"object",data:V.createObjectURL(new Blob([t.imageData]))}}else{e=Object.prototype.toString.call(t);if(/\[object \w+Array\]/.test(e))return{type:"object",data:V.createObjectURL(new Blob([t]))}}return/data:image\/\w+;base64/.test(t)?{type:"string",data:t}:{type:"object",data:t}},createObjectURL:function(t){if(!t)return"";var e=V.windowURL.createObjectURL(t);return k.log("createObjectURL:"+e),e},revokeObjectURL:function(t){k.log("revokeObjectURL:"+t),a(t)&&0==t.indexOf("blob:http")&&V.windowURL.revokeObjectURL(t)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return s}));var n=i(1),o=undefined&&undefined.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,o++)n[o]=r[s];return n},r=function(){function t(t){this._evtIds=[],this._oPub=null,this._bDisposePub=!1,t?this._oPub=t:(this._oPub=new s,this._bDisposePub=!0)}return t.prototype.getPublishSubscribe=function(){return this._oPub},t.prototype._on=function(t,e){var i=this._oPub.on(t,e);this.push(t,i)},t.prototype._emit=function(t){for(var e,i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];null===(e=this._oPub)||void 0===e||e.emit.apply(e,o([t],i))},t.prototype._off=function(t,e){var i;null===(i=this._oPub)||void 0===i||i.off(t,e)},t.prototype.push=function(t,e){this._evtIds.push({name:t,id:e})},t.prototype.dispose=function(){if(this._oPub){for(var t=this._evtIds.length,e=0;e<t;e++){var i=this._evtIds[e];this._oPub.offById(i.name,i.id)}this._bDisposePub&&this._oPub&&this._oPub.dispose()}this._oPub=null},t}(),s=function(){function t(){this._events={}}return t.prototype.on=function(t,e){this._events[t]||(this._events[t]=[]);var i=Object(n.I)(10);return this._events[t].push({fn:e,evtId:i}),i},t.prototype.emit=function(t){for(var e,i,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var s=this._events[t];if(!s||0===s.length)return!1;for(var a=s.length,l=0;l<a;l++)null===(i=s[l])||void 0===i||(e=i.fn).call.apply(e,o([null],n))},t.prototype.emitEx=function(t){for(var e,i,n,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var a=this._events[t];if(!a||0===a.length)return Promise.resolve(!0);var l=a.length,u=Promise.resolve(!0);if(1===a.length){var h=null===(i=a[0])||void 0===i?void 0:(e=i.fn).call.apply(e,o([null],r));return h instanceof Promise?h:u}for(var c=function(t){var e,i=null===(n=a[t])||void 0===n?void 0:(e=n.fn).call.apply(e,o([null],r));i instanceof Promise&&(u=u.then((function(){return i})))},d=0;d<l;d++)c(d);return u},t.prototype.off=function(t,e){var i=this._events[t];if(!i)return!1;if(e)for(var n=i.length,o=0;o<n;o++){var r=i[o];r&&r.fn===e&&i.splice(o,1),r=null}else i&&(i.length=0);i=null},t.prototype.offById=function(t,e){var i=this._events[t];if(!i)return!1;if(e)for(var n=i.length,o=0;o<n;o++){var r=i[o];if(r&&r.evtId===e){i.splice(o,1);break}r=null}else i&&(i.length=0);i=null},t.prototype.dispose=function(){for(var t=Object.keys(this._events),e=0,i=t.length;e<i;e++){var n=t[e],o=this._events[n];o&&o.splice(0),o=null}this._events={}},t}()},function(t,e,i){"use strict";var n=i(1),o=function(){function t(t){var e=this;this.uid=null,this.mode="normal",this.vertexes=[],this.midpoints=[],this.probePoints=[],this.slopeRatio=[],this.isCrop=!1,this.ctrlRadius=4,this.sensorRadius=4,this.defaultLineColor="rgba(0,0,0,1)",this.defaultFirstPointColor="rgba(255,0,0,1)",this.invalidLineColor="rgba(255,0,0,1)",this.invalidFirstPointColor="rgba(0,0,0,1)",this.lineColor="rgba(0,0,0,1)",this.firstPointColor="rgba(0,0,0,1)",this.pointFillColor="rgba(255,255,255,0)",this.lineWidth=1,this.dashLine=[4,2],this.isPointSelected=!1,this.activeProbePoint=null,this.moveLeft=0,this.moveTop=0,this.isMoveBox=!1,this.width=0,this.height=0,this.type="bottomRight",this.keepAspectRatio=!1,this.aspectRatio=0,this._startX=null,this._startY=null,this._lastX=null,this._lastY=null,this._lastWhr=1,this.zoom=1,this.dpr=1,this.uid=Object(n.I)(11),Object.keys(t).forEach((function(i){e[i]=t[i]})),this._initBox()}return t.prototype.getRect=function(){if("free"===this.mode)return null;var t=this._getMaxPoint(),e=t.minX,i=t.maxX,n=t.minY,o=t.maxY;return{x:Math.floor(e),y:Math.floor(n),width:Math.floor(i-e),height:Math.floor(o-n)}},t.prototype._initBox=function(){this.midpoints=this._calcMidpoint(this.vertexes),this.probePoints=this.vertexes.slice().concat(this.midpoints.slice()),this.slopeRatio=this._calcSlopeRatio(this.vertexes)},t.prototype._getMaxPoint=function(){return{minX:Math.min(this.probePoints[0],this.probePoints[2],this.probePoints[4],this.probePoints[6]),maxX:Math.max(this.probePoints[0],this.probePoints[2],this.probePoints[4],this.probePoints[6]),minY:Math.min(this.probePoints[1],this.probePoints[3],this.probePoints[5],this.probePoints[7]),maxY:Math.max(this.probePoints[1],this.probePoints[3],this.probePoints[5],this.probePoints[7])}},t.prototype.checkPointPosition=function(t){var e=this._getMaxPoint(),i=e.minX,n=e.maxX,o=e.minY,r=e.maxY,s=this.probePoints[2*t],a=this.probePoints[2*t+1];return t<4?s===n&&a===r?"se":s===n&&a===o?"ne":s===i&&a===o?"nw":s===i&&a===r?"sw":null:s===n?"e":a===r?"s":s===i?"w":a===o?"n":null},t.prototype.onStartHandler=function(t,e,i){var n=this.isBoxSelected(t,e);if(i!==undefined&&(n=i),null!==n&&(this._startX=t,this._startY=e,this._lastX=t,this._lastY=e,-1===n?(this.isPointSelected=!1,this.activeProbePoint=null,"normal"===this.mode&&(this.isMoveBox=!0)):(this.isPointSelected=!0,this.activeProbePoint=n,this.isMoveBox=!1),"free"===this.mode&&n>3)){var o=n-4;this.k1=this.slopeRatio[(o+1)%4],this.b1=this.probePoints[(2*o+3)%8]-this.k1*this.probePoints[(2*o+2)%8],this.k2=this.slopeRatio[(o+3)%4],this.b2=this.probePoints[(2*o+1)%8]-this.k2*this.probePoints[(2*o+0)%8]}},t.prototype.onMoveHandler=function(t,e,i){if(this.isPointSelected||this.isMoveBox){var n=this.probePoints.slice();if(this.isPointSelected){var o=this.activeProbePoint;i!==undefined&&(o=i),"normal"===this.mode?n=this._movePointNormal(n,o,t,e):(n=this._movePointFree(n,o,t,e),this.slopeRatio=this._calcSlopeRatio(this.probePoints).slice(0,4)),this.probePoints=n.slice(),this._checkRectConvexity(this.probePoints)?(this.lineColor=this.defaultLineColor,this.firstPointColor=this.defaultFirstPointColor):(this.lineColor=this.invalidLineColor,this.firstPointColor=this.invalidFirstPointColor)}else if(this.isMoveBox){var r=t-this._lastX,s=e-this._lastY;if(0===r&&0===s)return;n=this._moveBox(n,r,s),this.probePoints=n.slice()}var a=this._calcMidpoint(this.probePoints);this.probePoints=this.probePoints.slice(0,8).concat(a),this.midpoints=a,this._lastX=t,this._lastY=e}},t.prototype.onEndHandler=function(){this.lineColor=this.defaultLineColor,this.firstPointColor=this.defaultFirstPointColor;var t=this._startX,e=this._startY;this._startX=0,this._startY=0;var i=this._lastX,n=this._lastY;if(this.isPointSelected||this.isMoveBox){this.isPointSelected=!1,this.isMoveBox=!1,this.activeProbePoint=null;var o=this._checkRectConvexity(this.probePoints);(t===i&&e===n||!o)&&(this.probePoints=this.vertexes.slice().concat(this.midpoints)),this.vertexes=this.probePoints.slice(0,8),this.midpoints=this._calcMidpoint(this.probePoints),this.probePoints=this.probePoints.slice(0,8).concat(this.midpoints),this.slopeRatio=this._calcSlopeRatio(this.probePoints).slice(0,4)}},t.prototype._checkEdge=function(t,e){return t>=0&&t<=this.width&&e>=0&&e<this.height},t.prototype._movePointNormal=function(t,e,i,n){i=Math.max(0,Math.min(this.width,i)),n=Math.max(0,Math.min(this.height,n));var o=0,r=0;if(this.keepAspectRatio){var s=this._getMaxPoint(),a=s.minX,l=s.maxX,u=s.minY,h=s.maxY,c=this.checkPointPosition(e),d=(l-a)/(h-u);0===d||d===Infinity||d===-Infinity||isNaN(d)?d=this._lastWhr:this._lastWhr=d,o=0,r=0;var p="width";if(e<4){if(o=i-t[2*e],r=n-t[2*e+1],0===o||0===r)return t;p="width"}else{var _=e-4;if("e"===c?(e=(_+1)%4,p="width"):"s"===c?(e=_,p="height"):"w"===c?(e=_,p="width"):"n"===c&&(e=(_+1)%4,p="height"),o=i-t[2*_],r=n-t[2*_+1],0===o||0===r)return t}"height"===p?(o=r*d,"ne"!==c&&"sw"!==c&&"n"!==c&&"w"!==c||(o=-o)):(r=o/d,"ne"!==c&&"sw"!==c&&"n"!==c&&"w"!==c||(r=-r));var v=t[2*e]+o,f=t[2*e+1]+r;v<0?(o=0-t[2*e],r=0):v>this.width?(o=this.width-t[2*e],r=0):f<0?(r=0-t[2*e+1],o=0):f>this.height&&(r=this.height-t[2*e+1],o=0),t[2*e]+=o,t[2*e+1]+=r;m=(e+1)%4,g=(e+3)%4;e%2?(t[2*m]+=o,t[2*g+1]+=r):(t[2*m+1]+=r,t[2*g]+=o)}else if(e<4){if(o=i-t[2*e],r=n-t[2*e+1],0===o&&0===r)return t;t[2*e]=i,t[2*e+1]=n;var m=(e+1)%4,g=(e+3)%4;e%2?(t[2*m]=i,t[2*g+1]=n):(t[2*m+1]=n,t[2*g]=i)}else{var y=e-4,b=this.slopeRatio[y%4];0===b?(t[(2*y+3)%8]=n,t[(2*y+1)%8]=n):b!==Infinity&&b!==-Infinity||(t[(2*y+2)%8]=i,t[(2*y+0)%8]=i)}return t},t.prototype._movePointFree=function(t,e,i,n){i=Math.max(0,Math.min(this.width,i)),n=Math.max(0,Math.min(this.height,n));var o=t.slice();if(e<4){var r=i-t[2*e],s=n-t[2*e+1];if(0===r&&0===s)return t;t[2*e]=i,t[2*e+1]=n}else{var a=e-4,l=this.slopeRatio[a%4],u=n-l*i,h=-u/l,c=u,d=t[(2*a+9)%8]-l*t[(2*a+8)%8],p=-d/l,_=this,v=_.k1,f=_.b1,m=_.k2,g=_.b2;0===l?(t[(2*a+3)%8]=n,v!==Infinity&&v!==-Infinity&&(t[(2*a+2)%8]=(n-f)/v),t[(2*a+1)%8]=n,m!==Infinity&&m!==-Infinity&&(t[(2*a+0)%8]=(n-g)/m)):l===Infinity||l===-Infinity?(t[(2*a+2)%8]=i,t[(2*a+3)%8]=v*i+f,t[(2*a+0)%8]=i,t[(2*a+1)%8]=m*i+g):(0===v?t[(2*a+2)%8]+=h-p:v===Infinity||v===-Infinity?t[(2*a+3)%8]+=c-d:(t[(2*a+2)%8]=(f-u)/(l-v),t[(2*a+3)%8]=(l*f-v*u)/(l-v)),0===m?t[(2*a+0)%8]+=h-p:m===Infinity||m===-Infinity?t[(2*a+1)%8]+=c-d:(t[(2*a+0)%8]=(g-u)/(l-m),t[(2*a+1)%8]=(l*g-m*u)/(l-m)));for(var y=0;y<4;y++){var b=t[2*y],E=t[2*y+1];if(b<0||b>this.width||E<0||E>this.height)return o}}return t},t.prototype._moveBox=function(t,e,i){if("normal"===this.mode){var n=Math.min(t[0],t[2],t[4],t[6]),o=Math.max(t[0],t[2],t[4],t[6]),r=Math.min(t[1],t[3],t[5],t[7]),s=Math.max(t[1],t[3],t[5],t[7]);n+e<0&&(e=-n),o+e>this.width&&(e=this.width-o),r+i<0&&(i=-r),s+i>this.height&&(i=this.height-s);for(var a=0;a<4;a++)t[2*a]+=e,t[2*a+1]+=i}return t},t.prototype._isPointOnBox=function(t,e){if("normal"===this.mode){var i=this._getMaxPoint(),n=i.minX,o=i.maxX,r=i.minY,s=i.maxY;return t>=n&&t<=o&&e>=r&&e<=s}return!1},t.prototype.isBoxSelected=function(t,e){var i=this._isPointOnBox(t,e),n=this.isCtrlPointSelected(t,e);return null!==n?n:i?-1:null},t.prototype.isCtrlPointSelected=function(t,e){var i=this.sensorRadius/this.zoom,n=this._getMaxPoint(),o=n.minX,r=n.maxX,s=n.minY,a=n.maxY,l=Math.min(Math.max(i,.1*(r-o)),3*i)*this.dpr,u=Math.min(Math.max(i,.1*(a-s)),3*i)*this.dpr,h=8;"free"===this.mode&&(h=8);for(var c=0;c<h;c++){var d=this.probePoints[2*c],p=this.probePoints[2*c+1];if(t<=d+l&&t>=d-l&&e<=p+u&&e>=p-u&&t>=0&&t<=this.width&&e>=0&&e<=this.height)return c}return null},t.prototype._checkRectConvexity=function(t){var e=(t[6]-t[0])*(t[3]-t[1])-(t[7]-t[1])*(t[2]-t[0]),i=(t[0]-t[2])*(t[5]-t[3])-(t[1]-t[3])*(t[4]-t[2]),n=(t[2]-t[4])*(t[7]-t[5])-(t[3]-t[5])*(t[6]-t[4]),o=(t[4]-t[6])*(t[1]-t[7])-(t[5]-t[7])*(t[0]-t[6]);if(e*i*n*o<0)return!1;var r=t.slice().concat(t.slice(0,2));if(this.slopeRatio.length)for(var s=0;s<2;s++){if(this.slopeRatio[s]!==this.slopeRatio[s+2])if(this._calcIntersection(r.slice(2*s,2*s+2),r.slice(2*s+2,2*s+4),r.slice(2*s+4,2*s+6),r.slice(2*s+6,2*s+8)))return!1}return e*i*n*o>0},t.prototype._calcMidpoint=function(t){for(var e=t.slice(0,8).concat(t[0],t[1]),i=[],n=0;n<4;n++){var o=(e[2*n]+e[2*n+2])/2,r=(e[2*n+1]+e[2*n+3])/2;i.push(o,r)}return i},t.prototype._calcSlopeRatio=function(t){for(var e=[],i=null,n=t.slice(0,8).concat(t[0],t[1]),o=0;o<4;o++)i=n[2*o+3]-n[2*o+1]==0&&n[2*o+2]-n[2*o]==0?0:(n[2*o+3]-n[2*o+1])/(n[2*o+2]-n[2*o]),e.push(i);return e},t.prototype._calcIntersection=function(t,e,i,n){if(this._isRectCross(t,e,i,n)&&this._isLineSegmentCross(t,e,i,n)){var o,r=void 0,s=void 0;if(r=(n[0]-i[0])*(t[1]-e[1])-(e[0]-t[0])*(i[1]-n[1]),s=(t[1]-i[1])*(e[0]-t[0])*(n[0]-i[0])+i[0]*(n[1]-i[1])*(e[0]-t[0])-t[0]*(e[1]-t[1])*(n[0]-i[0]),0===r||0===s){var a=this._getLine(t,e),l=this._getLine(i,n),u=a[0],h=a[1],c=l[0],d=l[1];if(h[0]===c[0]&&h[1]===c[1])return h;if(u[0]===d[0]&&u[1]===d[1])return u;if(this._isOnLine(h,l)&&this._isOnLine(c,a))return[c,h];if(this._isOnLine(u,l)&&this._isOnLine(d,a))return[u,d];if(this._isOnLine(u,l)&&this._isOnLine(h,l))return[u,h];if(this._isOnLine(c,l)&&this._isOnLine(d,l))return[c,d]}return o=s/r,r=(t[0]-e[0])*(n[1]-i[1])-(e[1]-t[1])*(i[0]-n[0]),[o,(s=e[1]*(t[0]-e[0])*(n[1]-i[1])+(n[0]-e[0])*(n[1]-i[1])*(t[1]-e[1])-n[1]*(i[0]-n[0])*(e[1]-t[1]))/r]}return!1},t.prototype._getLine=function(t,e){return t[0]===e[0]?t[1]<e[1]?[t,e]:[e,t]:t[0]<e[0]?[t,e]:[e,t]},t.prototype._isOnLine=function(t,e){return e[0][0]===e[1][0]?t[1]>=e[0][1]&&t[1]<=e[1][1]:t[0]>=e[0][0]&&t[0]<=e[1][0]},t.prototype._isRectCross=function(t,e,i,n){var o=Math.min,r=Math.max;return o(t[0],e[0])<=r(i[0],n[0])&&o(i[0],n[0])<=r(t[0],e[0])&&o(t[1],e[1])<=r(i[1],n[1])&&o(i[1],n[1])<=r(t[1],e[1])},t.prototype._isLineSegmentCross=function(t,e,i,n){var o,r;return!(((o=t[0]*(i[1]-e[1])+e[0]*(t[1]-i[1])+i[0]*(e[1]-t[1]))^(r=t[0]*(n[1]-e[1])+e[0]*(t[1]-n[1])+n[0]*(e[1]-t[1])))>=0&&0!==o&&0!==r)&&!(((o=i[0]*(t[1]-n[1])+n[0]*(i[1]-t[1])+t[0]*(n[1]-i[1]))^(r=i[0]*(e[1]-n[1])+n[0]*(i[1]-e[1])+e[0]*(n[1]-i[1])))>=0&&0!==o&&0!==r)},t}();i.d(e,"a",(function(){return r}));var r=function(){function t(t,e){this._activeBoxId=null,this._startX=null,this._startY=null,this._addNewFlag=null,this._drawingFlag=!1,this.cropBoxes=[],this.width=0,this.height=0,this.zoom=1,this.aspectRatio=0,this.keepAspectRatio=!1,this.mouseDown=!1,this.unselectedCallback=null,this.selectedCallback=null,this.width=t,this.height=e}return t.prototype.updateDpr=function(t){this.cropBoxes.forEach((function(e){e.dpr=t}))},t.prototype.setKeepAspectRatio=function(t){this.keepAspectRatio=t,this._drawingFlag||this.cropBoxes.forEach((function(e){e.keepAspectRatio=t}))},t.prototype.setAspectRatio=function(t){this.aspectRatio=t},t.prototype.setZoom=function(t){this.zoom=t,this.cropBoxes.forEach((function(e){e.zoom=t}))},t.prototype.setPageSize=function(t,e){this.width=t,this.height=e},t.prototype.getRectArr=function(){var t=[];return this.cropBoxes.forEach((function(e,i){var n=Object.assign({index:i},e.getRect());t.push(n)})),t},t.prototype.clear=function(){var t;this.cropBoxes.length>0&&(null===(t=this.unselectedCallback)||void 0===t||t.call(this)),this.cropBoxes=[]},t.prototype.addFreeBox=function(t){var e=Object(n.e)(),i=new o({vertexes:t.slice(),width:this.width,height:this.height,mode:"free",dpr:e});return this.cropBoxes.push(i),i},t.prototype.addBox=function(t,e){var i=Object(n.e)(),r=new o({vertexes:t.slice(),width:this.width,height:this.height,type:e,mode:"normal",aspectRatio:this.aspectRatio,keepAspectRatio:this.keepAspectRatio,zoom:this.zoom,dpr:i});return this.cropBoxes.push(r),r},t.prototype.removeBox=function(t){return t===undefined&&this.clear(),!(t<0||t>=this.cropBoxes.length)&&(this.cropBoxes.splice(t,1),!0)},t.prototype.getBoxByUid=function(t){for(var e=this.cropBoxes.length,i=0;i<e;i++)if(this.cropBoxes[i].uid===t)return this.cropBoxes[i];return null},t.prototype.onStartHandler=function(t,e,i){this._startX=t,this._startY=e,this.mouseDown=!0;var n=this.checkSelect(t,e);if(null===n)return i||this.clear(),void(this._activeBoxId=null);this._activeBoxId=this.cropBoxes[n].uid,this.getBoxByUid(this._activeBoxId).onStartHandler(t,e)},t.prototype.onMoveHandler=function(t,e,i){if(this.mouseDown){var n=null,o=t-this._startX,r=e-this._startY,s=null,a=2/this.zoom;!this._activeBoxId&&t-this._startX<-a&&e-this._startY<-a?(s=0,this.aspectRatio>0&&(r=o/this.aspectRatio)):!this._activeBoxId&&t-this._startX>a&&e-this._startY<-a?(s=1,this.aspectRatio>0&&(r=-o/this.aspectRatio)):!this._activeBoxId&&t-this._startX>a&&e-this._startY>a?(s=2,this.aspectRatio>0&&(r=o/this.aspectRatio)):!this._activeBoxId&&t-this._startX<-a&&e-this._startY>a&&(s=3,this.aspectRatio>0&&(r=-o/this.aspectRatio));var l=[t,this._startY+r,this._startX,this._startY+r,this._startX,this._startY,t,this._startY],u=[this._startX,this._startY,this._startX,this._startY+r,t,this._startY+r,t,this._startY];if(null!==s){for(var h=[],c=0;c<4;c++)s%2?(h.push(u[2*(s+c)%8]),h.push(u[(2*(s+c)+1)%8])):(h.push(l[2*(s+c)%8]),h.push(l[(2*(s+c)+1)%8]));return n=this.addBox(h,["topLeft","topRight","bottomRight","bottomLeft"][s]),this.aspectRatio>0?n.keepAspectRatio=!0:n.keepAspectRatio=!1,this._drawingFlag=!0,this._addNewFlag=this.keepAspectRatio,this._activeBoxId=n.uid,n.onStartHandler(this._startX,this._startY,s),n.onMoveHandler(t,e,s),void(s=null)}this._activeBoxId&&(n=this.getBoxByUid(this._activeBoxId)),n&&n.onMoveHandler(t,e)}},t.prototype.onEndHandler=function(){var t;if(this.mouseDown&&(this.mouseDown=!1,this._drawingFlag=!1,this._activeBoxId)){var e=this.getBoxByUid(this._activeBoxId);null!==this._addNewFlag&&(e.keepAspectRatio=this._addNewFlag,this._addNewFlag=null),e.onEndHandler(),this.cropBoxes.length>0&&(null===(t=this.selectedCallback)||void 0===t||t.call(this,this.getRectArr())),this._activeBoxId=null}},t.prototype.checkSelect=function(t,e){var i=this.cropBoxes.length;if(0===i)return null;for(var n=i-1;n>=0;n--){if(null!==this.cropBoxes[n].isBoxSelected(t,e))return n}return null},t.prototype.checkSelectForCursor=function(t,e){var i=this.cropBoxes.length;if(0===i)return null;for(var n=i-1;n>=0;n--){var o=this.cropBoxes[n],r=o.isBoxSelected(t,e);if(null!==r){var s="move";return-1!==r&&(s=o.checkPointPosition(r)),{part:r,type:o.type,position:s}}}return null},t.prototype.dispose=function(){this.unselectedCallback=null,this.selectedCallback=null},t}()},,,function(t,e,i){},,function(t,e,i){"use strict";i.r(e);i(6);var n,o=i(1),r=i(0),s=function(){function t(t){this._clickItem=null,this._clickTimer=null,this._rightClickItem=null,this._rightClickTimer=null,this._mouseDownItem=null,this._startX=0,this._startY=0,this._mouseUpItem=null,this._evtList=[],this.onClick=null,this.onRightClick=null,this.onDoubleClick=null,this.onPointDown=null,this.onPointMove=null,this.onPointUp=null,this.onPointOver=null,this.onPointOut=null,this._element=t,this._registerEvents()}return t.prototype._registerEvents=function(){var t,e=this,i=this._element,n=Object(o.u)(),r="mousedown",s="mousemove",a="mouseup";n&&(r="touchstart",s="touchmove",a="touchend",n=!0),t=Object(o.c)(i,r,(function(t){var i,o=e._packageEvent(t);e._mouseDownItem=e.getTarget(t),e._startX=o.clientX,e._startY=o.clientY,null===(i=e.onPointDown)||void 0===i||i.call(e,o),n?e._rightClickTimer=setTimeout((function(){var t;null===(t=e.onRightClick)||void 0===t||t.call(e,o),e._mouseDownItem=null}),500):2===o.button&&(e._rightClickItem=e.getTarget(o))}),{passive:!1}),this._evtList.push(t),t=Object(o.c)(i,s,(function(t){var i,n=e._packageEvent(t);null===(i=e.onPointMove)||void 0===i||i.call(e,n);var r=Math.abs(n.clientX-e._startX),s=Math.abs(n.clientY-e._startY);(r>5||s>5)&&(clearTimeout(e._rightClickTimer),Object(o.u)()&&(e._mouseDownItem=null))}),{passive:!1}),this._evtList.push(t),t=Object(o.c)(i,a,(function(t){var i,n,o=e._packageEvent(t);e._mouseUpItem=e.getTarget(o),null===(i=e.onPointUp)||void 0===i||i.call(e,o),clearTimeout(e._rightClickTimer),e.getTarget(o)===e._rightClickItem&&2===o.button?null===(n=e.onRightClick)||void 0===n||n.call(e,o):e._mouseDownItem===e._mouseUpItem&&e._clickHandler(o),e._rightClickItem=null})),this._evtList.push(t),t=Object(o.c)(i,"mouseover",(function(t){var i;if(!Object(o.u)()){var n=t.fromElement;n===undefined&&(n=t.relatedTarget);var r=t.toElement;r===undefined&&(r=t.target),e.getTarget(t,n)!==e.getTarget(t,r)&&(null===(i=e.onPointOver)||void 0===i||i.call(e,t))}})),this._evtList.push(t),t=Object(o.c)(i,"mouseout",(function(t){var i;if(!Object(o.u)()){var n=t.fromElement;n===undefined&&(n=t.target);var r=t.toElement;r===undefined&&(r=t.relatedTarget),e.getTarget(t,n)!==e.getTarget(t,r)&&(null===(i=e.onPointOut)||void 0===i||i.call(e,t))}})),this._evtList.push(t)},t.prototype._unregisterEvents=function(){this._evtList.forEach((function(t){Object(o.s)(t)&&t()})),this._evtList.splice(0)},t.prototype._clickHandler=function(t){var e=this,i=this._packageEvent(t);clearTimeout(this._clickTimer),this.getTarget(t)===this._clickItem?(this._clickItem=null,setTimeout((function(){var t;null===(t=e.onDoubleClick)||void 0===t||t.call(e,i)}))):this._mouseDownItem===this._mouseUpItem&&(this._clickItem=this.getTarget(i),setTimeout((function(){var t;null===(t=e.onClick)||void 0===t||t.call(e,i)}))),this._mouseDownItem=null,this._mouseUpItem=null,this._clickTimer=setTimeout((function(){e._clickItem=null}),500)},t.prototype._packageEvent=function(t){var e,i=null===(e=t.changedTouches)||void 0===e?void 0:e[0];if(!i)return t;for(var n in i)t[n]===undefined&&(t[n]=i[n]);return t},t.prototype.getTarget=function(t,e){return e!==undefined?e:t.target},t.prototype.dispose=function(){this._unregisterEvents(),this._element=null,this._clickItem=null,this._clickTimer=null,this._rightClickItem=null,this._rightClickTimer=null,this._mouseDownItem=null,this._mouseUpItem=null,this.onClick=null,this.onRightClick=null,this.onDoubleClick=null,this.onPointDown=null,this.onPointMove=null,this.onPointUp=null,this.onPointOver=null,this.onPointOut=null},t}(),a=i(2),l=undefined&&undefined.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),u=function(t){function e(e,i,n){var o=t.call(this,i)||this;return o.useMyEvent=!0,o._unbindList=[],o._customCanvas=null,o._viewerContainer=null,o._postfix=e,o._viewerContainer=n,o}return l(e,t),e.prototype.uiEventInit=function(){var e=this,i=function(t){var i,n,o="#"+t+e._postfix;return null===(n=null===(i=e._viewerContainer)||void 0===i?void 0:i.el)||void 0===n?void 0:n.querySelector(o)},n=r.c.CLICK,a=(r.c.MOUSE_DOWN,r.c.MOUSE_MOVE),l=r.c.MOUSE_UP;"ontouchend"in document.documentElement&&(r.c.TOUCH_START,a=r.c.TOUCH_MOVE,l=r.c.TOUCH_END);var u,h=this._unbindList;u=Object(o.c)(window,r.c.RESIZE,o.H.call(this,this._viewerResize,40)),h.push(u),u=Object(o.c)(window,"load",(function(t){e._viewerResize(t)})),h.push(u),u=Object(o.c)(document,a,(function(t){e._documentMouseMove(t)})),h.push(u),u=Object(o.c)(document,l,(function(t){e._documentMouseUp(t)})),h.push(u),u=Object(o.c)(window,"message",(function(t){"up"===t.data.type&&e._documentMouseUp()})),h.push(u),u=Object(o.c)(document,r.c.CLICK,(function(t){e._documentClick(t)})),h.push(u),u=Object(o.c)(document,"keydown",(function(i){t.prototype._emit.call(e,r.f.DOCUMENT_KEY_DOWN,i)})),h.push(u),u=Object(o.c)(document,"keyup",(function(i){t.prototype._emit.call(e,r.f.DOCUMENT_KEY_UP,i)})),h.push(u);var c=this._viewerContainer.el;u=Object(o.c)(c,"dragstart",(function(){return!1})),h.push(u),u=Object(o.c)(c,n,(function(t){e._viewerClick(t)})),h.push(u),u=Object(o.c)(c,r.c.CONTEXTMENU,(function(t){e._viewerRightClick(t)})),h.push(u),u=Object(o.c)(c,"dragover",(function(t){Object(o.C)(t)})),h.push(u),u=Object(o.c)(c,"drop",(function(t){e._dropFile(t)})),h.push(u),u=Object(o.c)(i("navChange"),n,(function(t){e._setSelectedSidetype(t)})),h.push(u),u=Object(o.c)(i("besides"),n,(function(t){e._sidebarClick(t)})),h.push(u),u=Object(o.c)(i("stretchBar"),r.c.MOUSE_DOWN,(function(t){e._sidebarStretchStart(t)})),h.push(u),u=Object(o.c)(i("defaultTag"),n,(function(){e._openDefaultTag()})),h.push(u),u=Object(o.c)(i("treeLists"),n,(function(t){e._fileListClick(t)})),h.push(u),u=Object(o.c)(i("treeLists"),r.c.CONTEXTMENU,(function(t){e._fileListRightClick(t)})),h.push(u),u=Object(o.c)(i("treeLists"),"keyup",(function(t){e._fileListKeyUp(t)})),h.push(u),u=Object(o.c)(i("addFolder"),r.c.CLICK,(function(t){e._addNewFolder(t)})),h.push(u),u=Object(o.c)(i("tagLists"),n,(function(t){e._tagListClick(t)})),h.push(u),u=Object(o.c)(i("tagLists"),r.c.CONTEXTMENU,(function(t){e._tagListRightClick(t)})),h.push(u),u=Object(o.c)(i("tagLists"),"keyup",(function(t){e._tagListKeyUp(t)})),h.push(u),u=Object(o.c)(i("addTag"),n,(function(t){e._addNewTag(t)})),h.push(u);var d=i("canvasEventLayer");u=Object(o.c)(d,"touchstart",(function(t){e._canvasTouchStart(t)}),{passive:!1}),h.push(u),u=Object(o.c)(d,"mousedown",(function(t){e._canvasMouseDown(t)})),h.push(u),u=Object(o.c)(d,"touchmove",(function(t){e._canvasTouchMove(t)}),{passive:!1}),h.push(u),u=Object(o.c)(d,"mousemove",(function(t){e._canvasMouseMove(t)})),h.push(u),u=Object(o.c)(d,"touchend",(function(t){e._canvasTouchEnd(t)})),h.push(u),u=Object(o.c)(d,"mouseup",(function(t){e._canvasMouseUp(t)})),h.push(u),u=Object(o.c)(d,"wheel",(function(t){e._canvasWheel(t)}),{passive:!1}),h.push(u),u=Object(o.c)(d,"click",(function(t){Object(o.G)(t)})),h.push(u);var p=new s(i("canvasEventLayer"));p.onClick=function(i){t.prototype._emit.call(e,r.d.CANVAS_CLICK,i)},p.onRightClick=function(i){t.prototype._emit.call(e,r.d.CANVAS_RIGHT_CLICK,i)},p.onDoubleClick=function(i){t.prototype._emit.call(e,r.d.CANVAS_DOUBLE_CLICK,i)},p.onPointOver=function(i){t.prototype._emit.call(e,r.d.CANVAS_MOUSE_OVER,i)},p.onPointOut=function(i){t.prototype._emit.call(e,r.d.CANVAS_MOUSE_OUT,i)},this._customCanvas=p,p=null,u=Object(o.c)(i("canvasScroll"),"scroll",(function(t){e._canvasScroll(t)})),h.push(u),u=Object(o.c)(i("tabList"),n,(function(t){e._tabListClick(t)})),h.push(u),u=Object(o.c)(i("pagerInput"),"blur",(function(t){e._pagerBlur(t)})),h.push(u),u=Object(o.c)(i("pagerInput"),"keyup",(function(t){13===t.keyCode&&t.target.blur()})),h.push(u)},e.prototype.unbindEvents=function(){this._unbindList.forEach((function(t){Object(o.s)(t)&&t()})),this._unbindList=[],this._customCanvas&&(this._customCanvas.dispose(),this._customCanvas=null)},e.prototype._viewerResize=function(e){t.prototype._emit.call(this,r.f.VIEWER_RESIZE,e)},e.prototype._documentMouseUp=function(e){t.prototype._emit.call(this,r.f.DOCUMENT_POINTER_UP,e),t.prototype._emit.call(this,r.d.DOCUMENT_UP,e),t.prototype._emit.call(this,r.g.DOCUMENT_POINTER_UP,e)},e.prototype._documentMouseMove=function(e){t.prototype._emit.call(this,r.f.DOCUMENT_POINTER_MOVE,e),t.prototype._emit.call(this,r.d.DOCUMENT_MOVE,e),t.prototype._emit.call(this,r.g.DOCUMENT_POINTER_MOVE,e)},e.prototype._documentClick=function(e){t.prototype._emit.call(this,r.f.DOCUMENT_CLICK,e),t.prototype._emit.call(this,r.g.DOCUMENT_CLICK,e)},e.prototype._viewerClick=function(e){t.prototype._emit.call(this,r.f.VIEWER_CLICK,e)},e.prototype._viewerRightClick=function(e){Object(o.C)(e),t.prototype._emit.call(this,r.f.VIEWER_RIGHT_CLICK,e)},e.prototype._viewerMove=function(e){t.prototype._emit.call(this,r.f.VIEWER_MOVE,e)},e.prototype._dropFile=function(e){Object(o.C)(e),t.prototype._emit.call(this,r.g.FILE_DROP,e)},e.prototype._setSelectedSidetype=function(t){},e.prototype._sidebarClick=function(e){Object(o.G)(e),t.prototype._emit.call(this,r.f.SIDEBAR_CLICK),t.prototype._emit.call(this,r.g.SIDEBAR_CLICK)},e.prototype._sidebarStretchStart=function(e){t.prototype._emit.call(this,r.f.SIDEBAR_STRETCH_START,e)},e.prototype._openDefaultTag=function(){t.prototype._emit.call(this,r.f.OPEN_DEFAULT_TAG)},e.prototype._fileListClick=function(e){t.prototype._emit.call(this,r.f.FILE_LIST_CLICK,e),t.prototype._emit.call(this,r.g.FILE_LIST_CLICK,e)},e.prototype._fileListRightClick=function(e){t.prototype._emit.call(this,r.f.FILE_LIST_RIGHT_CLICK,e),t.prototype._emit.call(this,r.g.FILE_LIST_RIGHT_CLICK,e)},e.prototype._fileListKeyUp=function(e){t.prototype._emit.call(this,r.f.FILE_KEY_UP,e),t.prototype._emit.call(this,r.g.FILE_KEY_UP,e)},e.prototype._addNewFolder=function(e){t.prototype._emit.call(this,r.f.ADD_NEW_FOLDER,e)},e.prototype._tagListClick=function(e){t.prototype._emit.call(this,r.f.TAG_LIST_CLICK,e),t.prototype._emit.call(this,r.g.TAG_LIST_CLICK,e)},e.prototype._tagListRightClick=function(e){t.prototype._emit.call(this,r.f.TAG_LIST_RIGHT_CLICK,e),t.prototype._emit.call(this,r.g.TAG_LIST_RIGHT_CLICK,e)},e.prototype._tagListKeyUp=function(e){t.prototype._emit.call(this,r.f.TAG_KEY_UP,e),t.prototype._emit.call(this,r.g.TAG_KEY_UP,e)},e.prototype._addNewTag=function(e){t.prototype._emit.call(this,r.f.ADD_NEW_TAG,e)},e.prototype._canvasTouchStart=function(e){t.prototype._emit.call(this,r.d.CANVAS_TOUCH_START,e)},e.prototype._canvasTouchMove=function(e){t.prototype._emit.call(this,r.d.CANVAS_TOUCH_MOVE,e)},e.prototype._canvasTouchEnd=function(e){t.prototype._emit.call(this,r.d.CANVAS_TOUCH_END,e)},e.prototype._canvasMouseDown=function(e){t.prototype._emit.call(this,r.d.CANVAS_MOUSE_DOWN,e)},e.prototype._canvasMouseMove=function(e){t.prototype._emit.call(this,r.d.CANVAS_MOUSE_MOVE,e)},e.prototype._canvasMouseUp=function(e){t.prototype._emit.call(this,r.d.CANVAS_MOUSE_UP,e)},e.prototype._canvasWheel=function(e){t.prototype._emit.call(this,r.d.CANVAS_WHEEL,e)},e.prototype._canvasScroll=function(e){t.prototype._emit.call(this,r.d.CANVAS_SCROLL,e)},e.prototype._tabListClick=function(e){t.prototype._emit.call(this,r.f.TAB_LIST_CLICK,e)},e.prototype._pagerBlur=function(e){t.prototype._emit.call(this,r.f.PAGER_BLUR,e)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.unbindEvents()},e}(a.a),h=function(){function t(t,e,i){this._pubsub=null,this.element=null,this.containerEl=null,this.location="",this.visibility=!0,this.cssStyle="",this.tagName="div",this.name="",this._postfix=t,this._pubsub=i,this.element=this._createElement(e)}return t.prototype.bindElement=function(t,e){var i=this._createElement(e);return this.containerEl=t,!!i&&(t.appendChild(i),!0)},t.prototype.setAttributes=function(t){return!!Object(o.w)(t)&&(this._initConfig(t),this._updateAttributes(),!0)},t.prototype._createElement=function(t){var e,i;this.element&&(null===(i=null===(e=this.containerEl)||void 0===e?void 0:e.removeChild)||void 0===i||i.call(e,this.element),this.element=null),this._initConfig(t);var n=document.createElement(this.tagName);return this._updateAttributes(n),n},t.prototype._initConfig=function(t){if(!Object(o.w)(t))return!1;for(var e in t)t[e]!==undefined&&(this[e]=t[e]);return!0},t.prototype._updateAttributes=function(t){if(Object(o.q)(t)||(t=this.element),!t)return!1;if(t.className=this.visibility?"":" dvs-disabled",this.name&&t.classList.add("dvs-"+this.name),this.cssStyle&&t.classList.add(this.cssStyle),this.name&&(t.id=""+(this.name+this._postfix)),this.sequence!==undefined){var e=null==t?void 0:t.style;"string"==typeof e.msFlexOrder?e.msFlexOrder=this.sequence:e.order=this.sequence}return!0},t}(),c=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),d=function(t){function e(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.apply(this,e)||this}return c(e,t),e}(h),p=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_=function(t){function e(e,i,n){var o=t.call(this,e,i,n)||this;return o.groups={},o}return p(e,t),e}(h),v=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),f=function(t){function e(e,i,n){var o=t.call(this,e,i,n)||this;return o.buttons={},o._setGroupClass(),o}return v(e,t),e.prototype._setGroupClass=function(){var t;null===(t=this.element)||void 0===t||t.classList.add("dvs-groupType")},e}(h),m=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),g=function(t){function e(e,i,n){var o=t.call(this,e,i,n)||this;return o.onButtonClick="",o.iconClass="",o.text="",o.title="",o}return m(e,t),e.prototype._updateAttributes=function(t){var e=this;if(Object(o.q)(t)||(t=this.element),!t)return!1;if(t.className=("ds-dvs-ui-iconfont dvs-"+this.name+" "+(this.cssStyle||"")+" "+(this.iconClass||"")+" "+(this.visibility?"":"dvs-nodisplay")).trim(),t.id=""+(this.name+this._postfix),this.text&&Object(o.y)(this.text))if("input"===this.tagName)t.value=this.text||"";else{var i=document.createElement("span");i.innerText=this.text||"",t.appendChild(i)}var n=null==t?void 0:t.style;return"string"==typeof n.msFlexOrder?n.msFlexOrder=this.sequence:n.order=this.sequence,this.title&&(t.title=this.title),this.onButtonClick?t.onclick=function(t){e.onButtonClick&&e._pubsub.emit(r.f.CUSTOM_BUTTON_CLICK,e.onButtonClick,t)}:t.onclick=null,!0},e}(h),y=function(){function t(t){var e=t.el,i=t.sequence,n=t.isFull,r=t.pubsub,s=t.container;this.uid="",this.element=null,this.sequence=0,this.isFull=!1,this._visibility=!0,this.uid=Object(o.I)(11),this.element=e,this.sequence=i,this._pubsub=r,this.isFull=n,this._container=s,this._bindElement()}return t.prototype.show=function(){var t,e;return!this._visibility&&(this._visibility=!0,null===(e=null===(t=this.element)||void 0===t?void 0:t.classList)||void 0===e||e.remove("dvs-nodisplay"),this._pubsub.emit(r.f.VIEWER_RESIZE),!0)},t.prototype.hide=function(){var t,e;return!!this._visibility&&(this._visibility=!1,null===(e=null===(t=this.element)||void 0===t?void 0:t.classList)||void 0===e||e.add("dvs-nodisplay"),this._pubsub.emit(r.f.VIEWER_RESIZE),!0)},t.prototype.dispose=function(){var t,e;for(var i in null===(e=null===(t=this.element)||void 0===t?void 0:t.parentNode)||void 0===e||e.removeChild(this.element),this._pubsub.emit(r.f.VIEWER_RESIZE),this)delete this[i];return!0},t.prototype._bindElement=function(){var t=this._container;if(!t)return!1;var e=this.element;this.isFull?e.classList.add("dvs-upper-full"):e.classList.remove("dvs-upper-full"),e.style.order=String(this.sequence),e.style.msFlexOrder=String(this.sequence),e.classList.add("dvs-customElement"),this._visibility||e.classList.add("dvs-nodisplay"),t.appendChild(e),this._container=null,this._pubsub.emit(r.f.VIEWER_RESIZE)},t}(),b=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),E=function(t){function e(e){var i=e.postfix,n=e.container,o=e.uiConfig,r=e.pubsub,s=t.call(this,r)||this;return s._postfix="",s.uiConfig=null,s._assembledConfig={},s._customElements={},s.contentContainer=null,s.viewerContainer=null,s._postfix=i,s.uiConfig=o,s.viewerContainer={el:s.initUi(n)},s}return b(e,t),e.prototype._myQueryById=function(t){var e,i;return null===(i=null===(e=this.viewerContainer)||void 0===e?void 0:e.el)||void 0===i?void 0:i.querySelector("#"+t)},e.prototype.initUi=function(t,e){if(e){if(!Object(o.w)(e))return null;Object(o.B)(e,this.uiConfig)}if(Object(o.y)(t)&&(t=document.getElementById(t)),!Object(o.q)(t))return null;var i=this._assemblyConfig(this.uiConfig);this._assembledConfig=i;var n=new d(this._postfix,{name:"WebViewer"});return this._createContainers({header:{},body:{sidebar:{},showImageArea:{content:{topMenu:{},tabList:{},middle:{asideMenu:{},container:{viewPort:{canvasWrapper:{canvasEventLayer:{},loadingLayer:{loadingImage:"img"}},canvasScroll:{scrollInner:{}}},videoContainer:{videoImage:"img"},innerThumbnail:{}}},bottomMenu:{}}}},hiddenBox:{}},n.element),t.appendChild(n.element),n.element},e.prototype._createContainers=function(t,e){for(var i in t){var n=null,r=t[i];if("sidebar"===i)n=this._initSidebar();else if("hiddenBox"===i)n=this._initHiddenBox();else if(this._assembledConfig[i]){var s=this._initToolbarItem(this._assembledConfig[i]);n=null==s?void 0:s.element}else{n=new d(this._postfix,{name:i,tagName:Object(o.y)(r)?r:undefined,visibility:this.uiConfig.toolbars[i]===undefined||this.uiConfig.toolbars[i]}).element}n&&(Object(o.w)(t[i])&&this._createContainers(r,n),e.appendChild(n))}return!0},e.prototype._initToolbarItem=function(t){if(!t.visibility)return null;var e=new _(this._postfix,t,this._oPub);for(var i in t.groups){var n=t.groups[i];!n.name&&(n.name=i);var o=this._initGroupItem(n);o&&e.element.appendChild(o.element)}return e},e.prototype._initGroupItem=function(t){if(!1===t.visibility)return null;t.visibility=!0;var e=new f(this._postfix,t,this._oPub);for(var i in t.buttons){var n=t.buttons[i];!n.name&&(n.name=i);var o=this._initButtonItem(n);o&&o.forEach((function(t){e.element.appendChild(t.element)}))}var r=new g(this._postfix,{name:"showBefore",visibility:!0,location:e.name,tagName:"SPAN",iconClass:"ds-dvs-ui-move_right dvs-nodisplay"},this._oPub),s=new g(this._postfix,{name:"showAfter",visibility:!0,location:e.name,tagName:"SPAN",iconClass:"ds-dvs-ui-move_left dvs-nodisplay"},this._oPub);return e.element.appendChild(r.element),e.element.appendChild(s.element),e},e.prototype._initButtonItem=function(t){var e=this;if(!1!==t.visibility){t.visibility=!0;var i=this.uiConfig.tipsConfig;if("pagination"===t.name){var n=[{name:"pagerInput",sequence:t.sequence,tagName:"input",text:"0"},{name:"pageBreak",sequence:t.sequence,tagName:"p",text:""},{name:"pagerLabel",sequence:t.sequence,tagName:"label",text:"0"}],r=[];return n.forEach((function(n){r.push(new g(e._postfix,{visibility:t.visibility,name:n.name,sequence:n.sequence,location:t.location,text:n.text||"",tagName:n.tagName,title:i[t.name]}))})),r}return Object(o.A)({title:i[t.name]},t),[new g(this._postfix,t,this._oPub)]}},e.prototype._assemblyConfig=function(t){var e,i,n,s={},a={},l=t.toolbars,u=t.groups,h=t.buttons;for(var c in l){var d=Boolean(l[c]);s[c]={name:c,visibility:d,groups:(null===(n=l[c])||void 0===n?void 0:n.groups)||{}}}for(var p in u)a[p]=u[p];for(var _ in h){var v=h[_];(f=a[p=v.location])?(f.buttons=f.buttons||{},Object(o.B)(((e={})[_]=v,e),f.buttons)):this._emit(r.d.ERROR,{code:80024,message:"The group "+p+" is not exist."})}for(var p in a){var f,m=s[c=(f=a[p]).location];m?Object(o.B)(((i={})[p]=f,i),m.groups):this._emit(r.d.ERROR,{code:80024,message:"The toolbar "+c+" is not exist."})}return s},e.prototype._initSidebar=function(){var t=this.uiConfig,e=0,i=t.tree&&t.tree.visibility,n=t.tag&&t.tag.visibility;if(!i&&!n)return null;var o=new d(this._postfix,{name:"sidebar",visibility:t.showSidebar&&(i||n)}),r="",s='<ul id="navChange'+this._postfix+'" class="dvs-navChange">',a='<ul id="paneShow'+this._postfix+'" class="dvs-paneShow">';return s+='<li id="DirctoryTreeNav'+this._postfix+'" sidetype="tree" class="dvs-DirctoryTreeNav'+(0===e?" activeTab":"")+" "+(i?"":"dvs-disabled")+'">\n <div class="ds-dvs-ui-iconfont '+t.tree.iconClass+'"></div>\n </li>',a+='<li id="DirctoryTree'+this._postfix+'" sidetype="tree" class="dvs-DirctoryTree'+(e?" dvs-nodisplay":"")+" "+(i?"":"dvs-disabled")+'">\n <ul class="treeLists" id="treeLists'+this._postfix+"\"></ul>\n <div id='addFolderBox"+this._postfix+"' class='dvs-addFolderBox'>\n <div id='addFolder"+this._postfix+"' class='dvs-addFolder'>Add folder</div>\n </div>\n </li>\n ",i&&e++,s+='<li id="TagsNav'+this._postfix+'" sidetype="tag" class="dvs-TagsNav'+(0===e?" activeTab":"")+" "+(n?"":"dvs-disabled")+' ">\n <div class="ds-dvs-ui-iconfont '+t.tag.iconClass+'"></div>\n </li>',a+='<li id="Tags'+this._postfix+'" sidetype="tag" class="dvs-Tags'+(e?" dvs-nodisplay":"")+" "+(n?"":"dvs-disabled")+'">\n \n <ul id="tagLists'+this._postfix+'" class="tagLists"></ul>\n <div id=\'addTagBox'+this._postfix+"' class='dvs-addTagBox'>\n <div id='addTag"+this._postfix+"' class='dvs-addTag'>Add tag</div>\n </div>\n </li>",n&&e++,r+=(s+="</ul>")+(a+="</ul>"),r+='<div id="stretchBar'+this._postfix+'" class="dvs-stretchBar"></div>',o.element.innerHTML=r,o.element},e.prototype._initHiddenBox=function(){this.uiConfig;return new d(this._postfix,{name:"hiddenBox"}).element},e.prototype.bindContent=function(t){var e=this._myQueryById("content"+this._postfix),i=this._myQueryById("header"+this._postfix);if(!t||!i||!e)return!1;var n=document.createElement("div");return n.setAttribute("style","display:flex;flex-direction:column;width:100%;height:100%;"),n.id="contentContainer"+this._postfix,n.appendChild(i),n.appendChild(e),t.appendChild(n),this.contentContainer=n,!0},e.prototype.unbindContent=function(t){var e;void 0===t&&(t=!1);var i=null===(e=this.viewerContainer)||void 0===e?void 0:e.el,n=this.contentContainer;if(!i||!n)return!1;var r=n.querySelector("#content"+this._postfix),s=n.querySelector("#header"+this._postfix),a=this._myQueryById("showImageArea"+this._postfix);return s&&Object(o.l)(s,i.children[0],i),a&&r&&a.appendChild(r),n&&n.parentNode&&n.parentNode.removeChild(n),this.contentContainer=null,!0},e.prototype.createCustomElement=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=!1),Object(o.y)(t)&&(t=document.getElementById(t)),!Object(o.q)(t))return null;var n=new y({el:t,sequence:e,isFull:i,pubsub:this._oPub,container:this._myQueryById("container"+this._postfix)}),r=n.uid;return this._customElements[r]=n,n},e.prototype.removeAllCustomElements=function(){for(var t in this._customElements)this._customElements[t].element=null,this._customElements[t]=null;this._customElements=null},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.uiConfig=null,this._assembledConfig=null;for(var e=Object.keys(this._customElements),i=0,n=e.length;i<n;i++){var o=e[i],r=this._customElements[o];r&&r.dispose(),r=null}this._customElements=null,this.contentContainer=null,this.viewerContainer&&(this.viewerContainer.el=null),this.viewerContainer=null},e}(a.a),C=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),S=function(t){function e(e,i,n){var r=t.call(this,i)||this;return r._canvasItem=null,r.renderImg=null,r.imgSrc=null,r.uid="",r.tags=[],r.optimization=!1,r._dataStore=null,r._showPage=!1,r._showSelectBox=!1,r._currentPage=-1,r._isSelected=!1,r._checkboxColor="#333",r._tempData={currentPage:-1,showPage:!1,showSelectBox:!1,isSelected:!1,checkboxColor:"#333"},r.allowCrossOrigin=!0,r.fitRatio=0,r._canvasWidth=0,r._canvasHeight=0,r._devicePixelRatio=1,r._rectArr=[],r._dataStore=n,r._devicePixelRatio=Object(o.e)(),e&&r.init(e),r}return C(e,t),e.prototype.init=function(t){for(var e in t)e!==undefined&&t[e]&&(this[e]=t[e]);this.renderImg=null},e.prototype.updateData=function(t){var e=t.data,i=t.tags,n=t.optimization;e!==this.imgSrc&&(this.imgSrc=e,this.renderImg&&(this.renderImg.onload=null),this.renderImg=null,this.tags=i,this.optimization=n)},e.prototype.emptyPage=function(){this.renderImg&&(this.renderImg.onload=null),this.renderImg=null,this._canvasItem&&(this._canvasItem.width=1,this._canvasItem.height=1,this._canvasItem.getContext("2d").clearRect(0,0,1,1),this._canvasItem.width=0,this._canvasItem.height=0)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.emptyPage(),this.imgSrc=null,this._canvasItem=null},e.prototype.render=function(t){var e=this;if(void 0===t&&(t=!0),!this._canvasItem||this._canvasItem.clientWidth<=0||this._canvasItem.clientHeight<=0)return!1;if(this.renderImg)this.renderImg.complete&&(this.renderImg.onload=null,this._renderImage(t));else{if(!this.imgSrc)return this._clearCanvas(),!1;var i=this.renderImg||new Image;this.allowCrossOrigin&&(i.crossOrigin="anonymous");var n=this.width,o=this.height,r=this._devicePixelRatio,s=this._dataStore.getMid(this.uid);if((null==s?void 0:s.tempWidth)&&(null==s?void 0:s.tempHeight)){var a=Math.min(n/r/s.tempWidth,o/r/s.tempHeight,1);n=Math.floor(a*s.tempWidth),o=Math.floor(a*s.tempHeight)}var l=this.imgSrc;i.src=l,i.onload=function(){e._renderImage(t),i.onload=null},this.renderImg=i}},e.prototype.renderPage=function(){if(this.renderImg&&this._showPage&&this._canvasItem){var t=this.width,e=this.height,i=this._devicePixelRatio,n=Math.min(t,e)/10;n=Math.max(10*i,n),n=Math.min(20*i,n);var o=this._canvasItem.getContext("2d"),r=.99*t-n,s=.99*e-n;o.save(),o.beginPath(),o.lineWidth=i,o.fillStyle="rgba(255,255,255,0.8)",o.strokeStyle="#a79898",o.arc(r,s,n,0,2*Math.PI),o.closePath(),o.fill(),o.stroke(),o.textAlign="center",o.textBaseline="middle",o.fillStyle="#333",o.font=n+"px normal",o.fillText(String(this._currentPage),r,s+n/8,n),o.restore()}},e.prototype.renderBox=function(){if(this.renderImg&&this._showSelectBox&&this._canvasItem){var t=this.width,e=this.height,i=Math.min(t,e)/7,n=this._devicePixelRatio;i=Math.max(15*n,i),i=Math.min(40*n,i);var o=this._canvasItem.getContext("2d"),r=.01*t,s=.01*e;o.save(),o.lineWidth=i/10,o.fillStyle="rgba(255,255,255,0.8)",o.strokeStyle=this._checkboxColor,o.fillRect(r,s,i,i),o.strokeRect(r,s,i,i),this._isSelected&&(o.save(),o.beginPath(),o.lineCap="round",o.lineJoin="round",o.moveTo(r+.25*i,s+.5*i),o.lineTo(r+.5*i,s+.7*i),o.lineTo(r+5*i/6,s+.3*i),o.stroke(),o.closePath(),o.restore()),o.restore()}},e.prototype.renderOptimizedPage=function(t,e,i,n){var o=this;if(void 0===n&&(n=0),!(n>=2))if(this.renderImg&&(this.renderImg.onload=null),0!==this.width&&0!==this.height){var r=(this.width-e)/2,s=(this.height-i)/2,a=this._canvasItem;if(a){var l=a.getContext("2d");if(l){l.save(),l.clearRect(0,0,a.width,a.height);for(var u=0;u<t.length;u++){var h=t[u];l.putImageData(h.target,r,s+h.start_y)}l.restore(),this.renderPage(),this.renderBox(),this.drawRect()}}}else setTimeout((function(){o.renderOptimizedPage(t,e,i,n++)}),20)},e.prototype._renderImage=function(e){void 0===e&&(e=!0);var i=this.renderImg;if(i&&this._canvasItem){var n=this._canvasItem.getContext("2d");if(n){n.save(),n.clearRect(0,0,this._canvasItem.width,this._canvasItem.height);var o=this._calDrawImagePos(i),s=o.left,a=o.top,l=o.width,u=o.height;n.drawImage(i,s,a,l,u),n.restore(),this.renderPage(),this.renderBox(),this.drawRect(),e&&t.prototype._emit.call(this,r.g.VIEWER_PAGE_RENDERED,this._currentPage-1)}}},e.prototype._calDrawImagePos=function(t){var e=t.naturalWidth,i=t.naturalHeight,n={left:0,top:0,width:0,height:0};if(this.width<=0||this.height<=0)return n;var o=this._devicePixelRatio;if(!this.optimization){var r=this.width,s=this.height,a=this._dataStore.getMid(this.uid);if((null==a?void 0:a.tempWidth)&&(null==a?void 0:a.tempHeight)){var l=Math.min(r/o/a.tempWidth,s/o/a.tempHeight,1);r=Math.floor(l*a.tempWidth),s=Math.floor(l*a.tempHeight)}var u=Math.max(e/r,i/s);this.fitRatio=u,e/=u,i/=u}return n={left:Math.floor((this.width-e*o)/2),top:Math.floor((this.height-i*o)/2),width:Math.floor(e*o),height:Math.floor(i*o)}},e.prototype._clearCanvas=function(){if(this._canvasItem){var t=this._canvasItem.getContext("2d");t&&t.clearRect(0,0,this._canvasItem.width,this._canvasItem.height)}},Object.defineProperty(e.prototype,"width",{get:function(){return this._canvasItem?this._canvasItem.width:0},set:function(t){this._setCanvasWidth(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._canvasItem?this._canvasItem.height:0},set:function(t){this._setCanvasHeight(t)},enumerable:!1,configurable:!0}),e.prototype.setTempData=function(t){this._tempData=t},e.prototype._setCanvasWidth=function(t){this._canvasItem&&(this._canvasWidth=t,this._canvasItem.width=t)},e.prototype._setCanvasHeight=function(t){this._canvasItem&&(this._canvasHeight=t,this._canvasItem.height=t)},e.prototype.resizeCanvasSize=function(t){void 0===t&&(t=!1);var e=this._canvasItem;if(!e||!this.renderImg&&!this.imgSrc)return!1;var i=e.clientWidth*this._devicePixelRatio,n=e.clientHeight*this._devicePixelRatio;if(i<=0||n<=0)return!1;var o=this._checkIfRenderPageOrBox();if(Math.abs(i-this.width)<=2&&Math.abs(n-this.height)<=2&&this.renderImg&&!o)return!1;this.width!==i&&(this.width=i),this.height!==n&&(this.height=n),t&&-1===this.imgSrc.indexOf("blob:")&&(this.renderImg=null),this.render()},e.prototype._checkIfRenderPageOrBox=function(){var t=!1;for(var e in this._tempData){var i=this["_"+e],n=this._tempData[e];if(n===i)this._tempData[e]=i;else switch(this["_"+e]=n,e){case"currentPage":this._showPage&&(t=!0);break;case"isSelected":this._showSelectBox&&(t=!0);break;default:t=!0}}return t},e.prototype.setRect=function(t,e){this._rectArr=t,e&&(this._boxColor=e)},e.prototype.drawRect=function(){var t=this._rectArr;if(0!==t.length&&this.renderImg){var e=this._boxColor,i=this._dataStore.getMid(this.uid);if((null==i?void 0:i.tempWidth)&&(null==i?void 0:i.tempHeight))for(var n=i.tempWidth/this.renderImg.naturalWidth,o=0;o<t.length;o++)for(var r=t[o],s=0;s+1<8;s+=2){var a=e,l=r.probePoints[s]/n,u=r.probePoints[s+1]/n,h=r.midpoints[s]/n,c=r.midpoints[s+1]/n;this._drawPoint(this._transformRect(l,u),a),this._drawPoint(this._transformRect(h,c),e);var d=r.probePoints[(s+2)%8]/n,p=r.probePoints[(s+3)%8]/n;d!==undefined&&p!==undefined&&this._drawLine(this._transformRect(l,u),this._transformRect(d,p),e,r.dashLine)}}},e.prototype._transformRect=function(t,e){var i=this.renderImg,n=i.naturalWidth,o=i.naturalHeight,r=this.fitRatio;return{x:this.width/2+(t-n/2)/r*this._devicePixelRatio,y:this.height/2+(e-o/2)/r*this._devicePixelRatio}},e.prototype._drawPoint=function(t,e){var i=t.x,n=t.y;if(this._canvasItem){var o=this._canvasItem.getContext("2d");o.save(),o.lineWidth=this._devicePixelRatio,o.strokeStyle=e,o.strokeRect(i-4*this._devicePixelRatio,n-4*this._devicePixelRatio,8*this._devicePixelRatio,8*this._devicePixelRatio),o.restore()}},e.prototype._drawLine=function(t,e,i,n){var o=this,r=t.x,s=t.y,a=e.x,l=e.y;if(this._canvasItem){var u=this._canvasItem.getContext("2d");u.save();try{u.setLineDash(n.map((function(t){return t*o._devicePixelRatio})))}catch(h){}u.lineWidth=this._devicePixelRatio,u.strokeStyle=i,u.beginPath(),u.moveTo(r,s),u.lineTo(a,l),u.stroke(),u.restore()}},e}(a.a),I=function(){function t(t){void 0===t&&(t=[]),this.array=[],this.array=Object(o.J)(t)}return t.prototype.add=function(t){return!~this.array.indexOf(t)&&(this.array.push(t),!0)},t.prototype["delete"]=function(t){var e=this.array.indexOf(t);return!!~e&&(this.array.splice(e,1),!0)},t.prototype.concat=function(t){return Object(o.J)(this.array.concat(t))},t.prototype.equal=function(t){if(t.length!==this.array.length)return!1;if(!t.length)return!0;for(var e=0;e<this.array.length;e++)if(this.array[e]!==t[e])return!1;return!0},t}(),T=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),w=undefined&&undefined.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,o++)n[o]=r[s];return n},O=function(t){function e(e,i,n,o,r){var s=t.call(this,i)||this;return s.uid="",s._pubSub=null,s._viewerContainer=null,s._postfix="",s._thumbnailElement=null,s._dataStore=null,s.isInner=!1,s._iObserver=null,s._customThumbnailEvent=null,s._size=180,s._mouseShape="pointer",s._scrollDirection="vertical",s._sequence=0,s._location="horizontal",s._showThumbnail=!0,s._showPageNumber=!1,s._showSelectBox=!1,s._checkboxColor="",s._showRemoveBtn=!1,s._fullThumbnail=!1,s._multipleMode=!1,s.allowPageDragging=!0,s._allowResizing=!1,s.allowHover=!0,s.allowKeyboardControl=!0,s.autoChangeIndex=!1,s.rows=1,s.columns=1,s._background="rgba(67,66,70,1)",s._border="1px solid rgba(27,27,29,1)",s._pageBackground="rgba(0,0,0,0)",s._pageBorder="1px solid rgba(128,128,128,1)",s._selectedPageBackground="rgba(127,133,251,1)",s._selectedPageBorder="1px solid rgba(255,0,0,1)",s.hoverPageBackground="rgba(196,250,248,1)",s.hoverPageBorder="1px solid rgba(255,255,0,1)",s.placeholderBackground="rgba(255,192,203,1)",s._pageMargin=10,s._pageMarginNumber=0,s._currentPageMargin=-1,s.isDrag=!1,s.ifDragMoves=!1,s._dragTimer=null,s._dragStart=!1,s.needClick=!0,s.thumbMoveOption={napX:0,napY:0,clickX:0,clickY:0,target:null},s._stretchItem=null,s._isStretching=!1,s._isCrop=!1,s._topImageIndex=-1,s._prtScrollOnce=!1,s._calculateTopIndex=-1,s._showUids=new I,s._showIndexes=new I,s._renderIndexes=new I,s._renderUids=new I,s._tempThumbnailSize={width:1,height:1},s._splitTimer=null,s.selectedIndexes=[],s.currentIndex=-1,s._thumbnailCanvas=[],s._uidTbCanvas={},s._eventList={},s._renderTimer=null,s.isDragUp=!1,s._viewerContainer=n,s._postfix=o,s._dataStore=r,s._thumbnailInit(e),s._pubQuery=function(t){var e;return null===(e=null==n?void 0:n.el)||void 0===e?void 0:e.querySelector("#"+t)},s}return T(e,t),e.prototype._thumbnailInit=function(t){this._initThumbnailUi(t.uid),this._initThumbnailConfig(t),this._initIntersectionObserver(),this._bindSelfEvents(),this._bindUiEvent()},e.prototype._initThumbnailConfig=function(t){for(var e in this._pubSub=new a.a(t.pubsub),t)"pubsub"!==(e=e.replace("canvas",""))&&(this[e]=t[e])},e.prototype._initThumbnailUi=function(t){var e=new d(t,{name:"Thumbnail"}),i="horizontal"===this.location?"":"dvs-nodisplay",n="vertical"===this.location?"":"dvs-nodisplay";e.element.innerHTML="\n <div id='stretchBarLeft"+t+"' class='dvs-stretchBar dvs-stretchLeft "+i+"'></div>\n <div id='stretchBarTop"+t+"' class='dvs-stretchBar dvs-stretchTop "+n+"'></div>\n <div id='stretchBarRight"+t+"' class='dvs-stretchBar dvs-stretchRight "+i+"'></div>\n <div id='stretchBarBottom"+t+"' class='dvs-stretchBar dvs-stretchBottom "+n+"'></div>\n <ul id=\"thumbLists"+t+'" class="dvs-thumbLists"></ul>\n ',this._thumbnailElement=e.element,this._myQuery=function(t){var e;return null===(e=this._thumbnailElement)||void 0===e?void 0:e.querySelector("#"+t)},this._myQueryAll=function(t){var e;return null===(e=this._thumbnailElement)||void 0===e?void 0:e.querySelectorAll("#"+t)}},e.prototype._initIntersectionObserver=function(){var t=this;if(window.IntersectionObserver&&this._thumbnailElement){var e=new IntersectionObserver((function(e){t._handleObservePages(e)}),{root:this._thumbnailElement.querySelector(".dvs-thumbLists")});this._iObserver=e}},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(t){this._size=t,t=String(t),this._fullThumbnail?t="100%":/\d+$/.test(t)&&(t+="px");var e=this._thumbnailElement;e&&(e.style.flex="0 0 "+t,e.style.msFlex="0 0 "+t,"vertical"===this.location?(e.style.width="100%",e.style.maxWidth="100%",e.style.height=t,e.style.maxHeight=t):(e.style.width=t,e.style.maxWidth=t,e.style.height="100%",e.style.maxHeight="100%"),this._resizeViewer())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mouseShape",{get:function(){return this._mouseShape},set:function(t){this._mouseShape=t;var e=this._thumbnailElement;e&&(e.style.cursor=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollDirection",{get:function(){return this._scrollDirection},set:function(t){this._scrollDirection=t;var e=this._thumbnailElement;if(e){var i=e.querySelector("#thumbLists"+this.uid);"vertical"===t?(i.style.flexDirection="row",i.style.overflowX="hidden",i.style.overflowY="auto"):(i.style.flexDirection="column",i.style.overflowX="auto",i.style.overflowY="hidden"),this._resizeViewer(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sequence",{get:function(){return this._sequence},set:function(t){this._sequence=t;var e=this._thumbnailElement;e&&(e.style.order=String(t),e.style.msFlexOrder=t,this._updateStretchBars(),this._setSplitBarDelay())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return this._location},set:function(t){var e;this._location=t;var i=null,n=null===(e=this._viewerContainer)||void 0===e?void 0:e.el;if(n&&this._thumbnailElement){var o={vertical:"#content"+this._postfix,horizontal:"#middle"+this._postfix,canvas:"#innerThumbnail"+this._postfix};(i=null==n?void 0:n.querySelector(o[t]))&&i.appendChild(this._thumbnailElement),this._updateStretchBars(),this.size=this._size,this._setSplitBarDelay(),this._resizeViewer(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showThumbnail",{get:function(){return this._showThumbnail},set:function(t){this._showThumbnail=t;var e=this._thumbnailElement;e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this.updatePageLayout(),this._resizeViewer(!0),this._setSplitBarDelay())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showPageNumber",{get:function(){return this._showPageNumber},set:function(t){this._showPageNumber=t,this.renderCanvas()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showSelectBox",{get:function(){return this._showSelectBox},set:function(t){this._showSelectBox=t,this.renderCanvas()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fullThumbnail",{get:function(){return this._fullThumbnail},set:function(t){this._fullThumbnail=t,this.size=this._size;var e=this._myQuery("thumbnailStretchBarRight"+this.uid);e&&(t?e.classList.add("dvs-nodisplay"):e.classList.remove("dvs-nodisplay"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this._background},set:function(t){this._background=t;var e=this._myQuery("thumbLists"+this.uid);e&&(e.style.background=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"border",{get:function(){return this._border},set:function(t){this._border=t;var e=this._thumbnailElement;e&&(e.style.border=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedPageBorder",{get:function(){return this._selectedPageBorder},set:function(t){this._selectedPageBorder=t;for(var e=this._myQueryAll("thumbLists"+this.uid+">li.dvs-activeThumb"),i=0;i<e.length;i++){e[i].style.border=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedPageBackground",{get:function(){return this._selectedPageBackground},set:function(t){this._selectedPageBackground=t;for(var e=this._myQueryAll("thumbLists"+this.uid+">li.dvs-activeThumb"),i=0;i<e.length;i++){e[i].style.background=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageBackground",{get:function(){return this._pageBackground},set:function(t){this._pageBackground=t;var e=this._myQuery("thumbLists"+this.uid);if(e&&e.children)for(var i=e.children,n=0;n<i.length;n++){var o=i[n];o.classList.contains("dvs-activeThumb")||(o.style.background=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageBorder",{get:function(){return this._pageBorder},set:function(t){this._pageBorder=t;var e=this._myQuery("thumbLists"+this.uid);if(e&&e.children)for(var i=e.children,n=0;n<i.length;n++){var o=i[n];o.classList.contains("dvs-activeThumb")||(o.style.border=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageMargin",{get:function(){return this._pageMargin},set:function(t){this._pageMargin=t,this._currentPageMargin=-1,this._resizeViewer(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowResizing",{get:function(){return this._allowResizing},set:function(t){this._allowResizing=t,this._updateStretchBars()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showRemoveBtn",{get:function(){return this._showRemoveBtn},set:function(t){var e,i;this._showRemoveBtn=t,t?null===(e=this._thumbnailElement)||void 0===e||e.classList.remove("dvs-hide-remove-btn"):null===(i=this._thumbnailElement)||void 0===i||i.classList.add("dvs-hide-remove-btn")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multipleMode",{get:function(){return this._multipleMode},set:function(t){t!==this._multipleMode&&(this._multipleMode=t,this._showSelectBox=t,this.renderCanvas())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkboxColor",{get:function(){return this._checkboxColor},set:function(t){t!==this._checkboxColor&&(this._checkboxColor=t,this.renderCanvas())},enumerable:!1,configurable:!0}),e.prototype._bindSelfEvents=function(){var e,i=this,n=((e={})[r.f.UPDATE_THUMBNAIL_PROP]=this._updateProps,e[r.f.SCROLL_TO]=this.scrollTo,e[r.f.SET_VIEW_MODE]=this.setViewMode,e);for(var o in this._eventList=n,n)this._pubSub._on(o,n[o].bind(this));t.prototype._on.call(this,r.f.DOCUMENT_POINTER_MOVE,this._documentMouseMove.bind(this)),t.prototype._on.call(this,r.f.DOCUMENT_POINTER_UP,this._documentMouseUp.bind(this)),t.prototype._on.call(this,r.g.BUFFER_CHANGED,(function(t){"remove"===t.action&&(i._prtScrollOnce=!0)}))},e.prototype._bindUiEvent=function(){var e=this,i=this._thumbnailElement;if(i){var n=new s(i);n.onPointDown=function(t){e._thumbnailDragStart(t),e._thumbnailPointerDown(t)},n.onPointMove=function(t){e._thumbnailDragMove(t),e._thumbnailPointerMove(t)},n.onPointUp=function(t){e._thumbnailPointerUp(t)},n.onClick=function(t){e._thumbnailClick(t)},n.onRightClick=function(t){e._thumbnailRightClick(t)},n.onDoubleClick=function(t){e._thumbnailDoubleClick(t)},n.onPointOver=function(t){e._thumbnailMouseOver(t)},n.onPointOut=function(t){e._thumbnailMouseOut(t)},n.getTarget=function(t,i){return i!==undefined?e.getImageItem(i):e.getImageItem(t)},this._customThumbnailEvent=n,Object(o.c)(i.querySelector(".dvs-thumbLists"),"scroll",(function(){e._thumbnailScroll()})),Object(o.c)(i,Object(o.u)()?"touchstart":"mousedown",(function(t){e._thumbnailStretchStart(t)}),{passive:!1}),Object(o.c)(i,"click",(function(i){t.prototype._emit.call(e,r.d.UPDATE_FOCUS,{viewerId:e._postfix.replace("-",""),thumbnailId:e.uid}),Object(o.G)(i)}))}},e.prototype.unbindEvents=function(){var t;if(null===(t=this._customThumbnailEvent)||void 0===t||t.dispose(),this._customThumbnailEvent=null,this._pubSub)for(var e in this._eventList)this._pubSub._off(e)},e.prototype.unbindUi=function(){var t,e,i;this.unbindEvents();var n=this._thumbnailCanvas;if(n)for(var o=0;o<n.length;o++){var r=n[o];r&&r.dispose()}this._thumbnailCanvas=null,this._viewerContainer=null,this._stretchItem=null,null===(t=this._iObserver)||void 0===t||t.disconnect(),this._iObserver=null,null===(i=null===(e=this._thumbnailElement)||void 0===e?void 0:e.parentElement)||void 0===i||i.removeChild(this._thumbnailElement),this._thumbnailElement=null},e.prototype.updateContent=function(t){void 0===t&&(t=[]),this._patch(t),this._updateElements(),this.renderCanvas()},e.prototype.updatePageItem=function(t){var e=this._thumbnailCanvas;if(e)for(var i=0;i<e.length;i++){var n=e[i];if(n.uid===t.uid){n.updateData(t),-1!==this._renderUids.array.indexOf(t.uid)&&n.resizeCanvasSize(this.isInner&&1===this.rows&&1===this.columns);break}}},e.prototype.renderCanvas=function(){var t=this;this._renderTimer&&clearTimeout(this._renderTimer),this._renderTimer=setTimeout((function(){var e=t.selectedIndexes;if(t._thumbnailCanvas)for(var i=t._renderUids.array,n=t._thumbnailCanvas.length,o=0;o<n;o++){var r=t._thumbnailCanvas[o];~i.indexOf(r.uid)?(r.setTempData({showPage:t.showPageNumber,showSelectBox:t.showSelectBox,currentPage:o+1,isSelected:-1!==e.indexOf(o),checkboxColor:t.checkboxColor}),r.resizeCanvasSize(1===t.rows&&1===t.columns&&t.isInner)):null==r||r.emptyPage()}}),100)},e.prototype.keydownCallBack=function(t){this.selectImageByKey(t),this._pubSub._emit(r.g.KEY_DOWN,t)},e.prototype.keyupCallBack=function(t){this._pubSub._emit(r.g.KEY_UP,t)},e.prototype.selectImageByKey=function(t){if(this.allowKeyboardControl&&this._thumbnailCanvas.length){var e=this.selectedIndexes.slice().pop(),i=this.rows,n=this.columns,s="vertical"===this.scrollDirection,a=e;switch(t.key){case"ArrowUp":case"Up":if(s)a-=n;else{if(Math.floor((a-1)/i)!==Math.floor(a/i))return;a-=1}break;case"ArrowDown":case"Down":if(s)a+=n;else{if(Math.floor((a+1)/i)!==Math.floor(a/i))return;a+=1}break;case"ArrowLeft":case"Left":if(s){if(Math.floor((a-1)/n)!==Math.floor(a/n))return;a-=1}else a-=i;break;case"ArrowRight":case"Right":if(s){if(Math.floor((a+1)/n)!==Math.floor(a/n))return;a+=1}else a+=i;break;default:return}this._viewerEmit(r.b.GOTO_PAGE,a),Object(o.C)(t)}},e.prototype._updateElements=function(){var t=this._myQuery("thumbLists"+this.uid);if(!t)return!1;for(var e=0;e<t.children.length;e++){var i=t.children[e],n=this._thumbnailCanvas[e];n&&i&&(i["dvs-defaultIndex"]=e,i["dvs-tags"]=n.tags,i["dvs-uid"]=n.uid)}},e.prototype.handleInnerProp=function(t,e){t in this&&(this[t]=e)},e.prototype.setHoverColor=function(t){if(this.allowHover){var e=this.getImageItem(t);e&&(e.classList.contains("dvs-activeThumb")||(e.style.background=this.hoverPageBackground,e.style.border=this.hoverPageBorder))}},e.prototype.setImageColor=function(t){if(this.allowHover){var e=this.getImageItem(t);e&&(e.classList.contains("dvs-activeThumb")?(e.style.background=this.selectedPageBackground,e.style.border=this.selectedPageBorder):(e.style.background=this._pageBackground,e.style.border=this.pageBorder))}},e.prototype._addNodes=function(t,e,i){var n,s,a=this,l=[],u=this._myQuery("thumbLists"+this.uid);if(u){for(var h=u.children[e],c=document.createDocumentFragment(),d=function(e){var i=t[e],n=p._initNode(i);l.push(n);var u=document.createElement("li");u.style.background=p.pageBackground,u.style.border=p.pageBorder;var h=document.createElement("canvas");if(h.className="dvs-thumbnailCanvas",h.width=0,h.height=0,u.appendChild(h),n._canvasItem=h,!p.isInner){var d=document.createElement("span");d.className="dvs-thumbnail-remove",d.onclick=function(){var t=Object(o.h)(u);a._pubSub._emit(r.g.REMOVE_PAGE,t)},u.appendChild(d)}null===(s=p._iObserver)||void 0===s||s.observe(u),c.appendChild(u)},p=this,_=e;_<=i;_++)d(_);Object(o.l)(c,h,u),(n=this._thumbnailCanvas).splice.apply(n,w([e,0],l))}},e.prototype._removeNodes=function(t,e,i){var n,o=t.splice(e,i-e+1),r=this._myQuery("thumbLists"+this.uid);if(r&&r.children&&r.children.length){for(var s=e;s<=i;s++){var a=r.children[e];if(a){var l=a["dvs-uid"];this._showUids["delete"](l),this._renderUids["delete"](l),this._getViewIndexesByUids(),null===(n=this._iObserver)||void 0===n||n.unobserve(a),r.removeChild(a)}}o.forEach((function(t){return t.dispose()}))}},e.prototype._patch=function(t){for(var e=this._thumbnailCanvas,i=0,n=e.length-1,o=0,r=t.length-1;i<=n&&o<=r;){var s=e[i],a=e[n],l=t[o],u=t[r];if(this._sameNode(s,l))++i,++o,s.updateData(l);else if(this._sameNode(a,u))--n,--r,a.updateData(u);else if(this._sameNode(s,u))s.updateData(u),this._moveNode(e,i,n);else if(this._sameNode(a,l))a.updateData(l),this._moveNode(e,n,i);else{for(var h=void 0,c=i;c<=n;c++){if(e[c].uid===(null==l?void 0:l.uid)){h=c;break}}h!==undefined?(e[h].updateData(l),this._moveNode(e,h,i)):(this._addNodes(t,o,o),n++),++o,++i}}i>n?this._addNodes(t,o,r):o>r&&this._removeNodes(e,i,n)},e.prototype._sameNode=function(t,e){return(null==t?void 0:t.uid)===(null==e?void 0:e.uid)},e.prototype._moveNode=function(t,e,i){var n=t.splice(e,1)[0];t.splice(i,0,n);var r=this._myQuery("thumbLists"+this.uid),s=r.removeChild(r.children[e]);s&&Object(o.l)(s,r.children[i],r)},e.prototype._initNode=function(t,e){var i={uid:t.uid,imgSrc:t.data,tags:t.tags};if(!e)return new S(i,this._pubSub.getPublishSubscribe(),this._dataStore);e.init(i)},e.prototype._createKeyHashList=function(t,e,i){var n,o,r,s={};for(n=e;n<=i;++n)(o=null==(r=t[n])?void 0:r.uid)&&(s[o]=n);return s},e.prototype.selectThumbnailByIndexes=function(t){Object(o.m)(t)?this.selectedIndexes=t:t=this.selectedIndexes,this.clearAbsolute(),this._updateSelectedPageStyle(),(this.showPageNumber||this.showSelectBox)&&this.renderCanvas()},e.prototype._updateSelectedPageStyle=function(){var t=this._myQuery("thumbLists"+this.uid);if(!t)return!1;var e=this.selectedIndexes,i=t.children;if(i&&i.length)for(var n=i.length,o=0;o<n;o++){var r=i[o],s=-1!==e.indexOf(o);this._selectThumbnailByNode(r,s)}},e.prototype._selectThumbnailByNode=function(t,e){t&&(e?(t.classList.add("dvs-activeThumb"),t.style.border=this.selectedPageBorder,t.style.background=this.selectedPageBackground):(t.classList.remove("dvs-activeThumb"),t.style.border=this.pageBorder,t.style.background=this.pageBackground))},e.prototype.setViewMode=function(t,e){var i,n;if(this.rows=e,this.columns=t,1===e&&1===t?null===(i=this._thumbnailElement)||void 0===i||i.classList.add("dvs-hide-remove-btn"):this.showRemoveBtn&&(null===(n=this._thumbnailElement)||void 0===n||n.classList.remove("dvs-hide-remove-btn")),10===document.documentMode){var o=this._myQuery("thumbLists"+this.uid);if(!o)return;o.style.marginTop=o.style.marginTop?"":"0.1px",this.renderCanvas()}return this.showLatestPage(),!0},e.prototype.updatePageLayout=function(){var t;if(!this.showThumbnail)return!1;var e=this._myQuery("thumbLists"+this.uid);if(!(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.length))return!1;var i=e.clientWidth-1,n=e.clientHeight-1,o=this._getCurrentPageMargin(i,n,e);this._pageMarginNumber=o,this._setPageSize(i,n,e,o);var r=e.clientWidth-1,s=e.clientHeight-1;r===i&&s===n||this._setPageSize(r,s,e,o),this.renderCanvas()},e.prototype.calculateSize=function(){var t=this._thumbnailElement;if(t){var e=t.getBoundingClientRect();if(0==e.width||0==e.height)return!1;var i=this._tempThumbnailSize,n=t.clientWidth,o=t.clientHeight;i.width===n&&i.height===o||(i.width=n,i.height=o,this._pubSub._emit(r.g.THUMBNAIL_STRETCH,e.width,e.height))}return this.updatePageLayout(),!0},e.prototype._getCurrentPageMargin=function(t,e,i){var n=this.rows,o=this.columns,r=this._pageMargin;if(r=String(r),/%$/.test(r)){var s=parseInt(r),a=Math.min(1/(o+1),1/(n+1));r=(s=Math.min(s/100,a))*e-1}else if(/em$/.test(r)){if(this._currentPageMargin<0){var l=parseInt(r),u=parseInt(window.getComputedStyle(i).fontSize);this._currentPageMargin=l*u}r=this._currentPageMargin}else r=parseInt(r);return t&&r*(o+1)>t+5&&(r=t/(o+1)),e&&r*(n+1)>e+5&&(r=e/(n+1)),r},e.prototype._setPageSize=function(t,e,i,n){if(null==i?void 0:i.children)for(var o=this.rows,r=this.columns,s=1===this.columns&&1===this.rows,a=Math.floor((t-(r+1)*n)/r),l=Math.floor((e-(o+1)*n)/o),u=i.children,h="vertical"===this._scrollDirection,c=0;c<u.length;c++){var d=u[c];s?(d.style.width=h?Math.floor(t)+"px":"100%",d.style.height=h?"100%":Math.floor(e)+"px",i.style.padding="0px",d.style.margin=0===c?"0px":h?n+"px 0px 0px":"0px 0px 0px "+n+"px "):(d.style.margin="0px "+n+"px "+n+"px 0px",i.style.padding=n+"px 0px 0px "+n+"px",c===u.length-1&&(d.style[h?"marginBottom":"marginRight"]=n+1+"px"),d.style.width=a+"px",d.style.height=l+"px")}},e.prototype.updateDisplayedUidsIE=function(){var t=this;if(window.IntersectionObserver)return!1;if(!this.showThumbnail||!this._thumbnailCanvas)return!1;var e=this._getDisplayedImagesIE(),i=this._getRenderIndexes(e);this._renderIndexes.array=i;var n=i.map((function(e){var i;return null===(i=t._thumbnailCanvas[e])||void 0===i?void 0:i.uid}));this._renderUids.array=n,this.renderCanvas(),this._viewerEmit(r.f.MERGE_DISPLAYED_UIDS,n.slice(),this.uid)},e.prototype.updateDisplayedUids=function(){if(!this.showThumbnail)return!1;var t=this._thumbnailCanvas;if(!t.length)return this._showIndexes.array=[],this._renderIndexes.array=[],void(this._renderUids.array=[]);var e=this._renderIndexes.array.slice(0),i=[];e.forEach((function(e){t[e]&&i.push(t[e].uid)})),this._renderUids.array=i,this._viewerEmit(r.f.MERGE_DISPLAYED_UIDS,i,this.uid)},e.prototype._handleObservePages=function(t){var e=this;t.forEach((function(t){var i=t.intersectionRect,n=t.target,o=null==n?void 0:n["dvs-uid"];null==n||n["dvs-defaultIndex"];(null==i?void 0:i.width)>0||(null==i?void 0:i.height)>0?e._showUids.add(o):e._showUids["delete"](o)})),this._getViewIndexesByUids(),this.updateDisplayedUids(),this.renderCanvas()},e.prototype._getRenderIndexes=function(t){var e=this,i=e.rows,n=e.columns,o=e.scrollDirection,r=e._thumbnailCanvas;if(!r)return[];var s=this._thumbnailCanvas.length,a=0;t.forEach((function(t){s=Math.min(t,s),a=Math.max(t,a)}));for(var l=[],u=s;u<=a;u++)r[u]&&l.push(u);if("vertical"===o){for(u=s-3*n;u<s;u++)r[u]&&l.push(u);for(var h=a+1;h<a+3*n;h++)r[h]&&l.push(h)}else{for(u=s-3*i;u<s;u++)r[u]&&l.push(u);for(h=a+1;h<a+3*i;h++)r[h]&&l.push(h)}return l},e.prototype._getViewIndexesByUids=function(){var t=this._showUids,e=[];this._thumbnailCanvas.forEach((function(i,n){t.array.indexOf(i.uid)>-1&&e.push(n)})),this._showIndexes.array=e;var i=this._getRenderIndexes(e.slice());this._renderIndexes.array=i},e.prototype.triggerTopImageChange=function(t){void 0===t&&(t=""),this.updateDisplayedUidsIE(),this._updateTopPageIndex(t)},e.prototype.scrollTo=function(t,e){if(void 0===e&&(e=""),!this.showThumbnail||this._prtScrollOnce)return this._prtScrollOnce=!1,!0;var i=this._myQuery("thumbLists"+this.uid);if(!i||i.clientWidth<=0||i.clientHeight<=0||t>i.children.length-1||i.children.length<=0||t<0)return!1;if(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth){var n=i.getBoundingClientRect(),o=this.scrollDirection,r=-1,s=-1,a=i.children[t],l=a.getBoundingClientRect(),u=parseInt(i.style.padding);"vertical"===o?(s=0,l.top<=n.top?r=a.offsetTop-u+1:l.bottom>=n.bottom&&(r=a.offsetTop-n.height+l.height+u+1)):(r=0,l.left<=n.left?s=a.offsetLeft-u+1:l.right>=n.right&&(s=a.offsetLeft-n.width+l.width+u+1)),-1!==r&&(i.scrollTop=r),-1!==s&&(i.scrollLeft=s)}return this.triggerTopImageChange(e),!0},e.prototype.showLatestPage=function(t){var e;t===undefined&&(t=this.currentIndex),this.currentIndex=t,(null===(e=this._thumbnailCanvas)||void 0===e?void 0:e.length)?(this.updatePageLayout(),this.scrollTo(t)):this.triggerTopImageChange()},e.prototype._updateTopPageIndex=function(t){void 0===t&&(t="");var e=this._thumbnailElement;if(!this.showThumbnail||!e)return!1;if(window.IntersectionObserver){var i=this._calDisplayedIndexes()[0];this._calculateTopIndex=i}var n=this._calculateTopIndex;if(this._thumbnailCanvas[n]||(n=-1,t=""),this._topImageIndex===n)return!1;this._topImageIndex=n,this._pubSub._emit(r.g.TOP_PAGE_CHANGED,n,t),"scroll"===t&&this.autoChangeIndex&&(this._prtScrollOnce=!0,this._viewerEmit(r.d.SET_SELECTED_INDEXES,[n]))},e.prototype._getDisplayedImagesIE=function(){for(var t=this._calDisplayedIndexes(),e=t[0],i=t[1],n=[],o=e;o<=i;o++)o>=0&&n.push(o);return this._calculateTopIndex=e,n},e.prototype._calDisplayedIndexes=function(){var t=this._myQuery("thumbLists"+this.uid),e=null==t?void 0:t.getBoundingClientRect();if(!e||!e.width)return[-1,-1];var i=t.children[0];if(!i)return[-1,-1];var n=i.getBoundingClientRect(),o=-1,r=0,s=this.rows,a=this.columns;if("vertical"===this.scrollDirection){var l=t.scrollTop,u=Math.floor(n.height),h=(l+1-u-(parseInt(i.style.marginTop)||parseInt(i.style.marginBottom)))/(u+this._pageMarginNumber);r=(o=((h=Math.floor(h))+1)*this.columns)+(s+1)*a-1}else{var c=t.scrollLeft,d=Math.floor(n.width);h=(c+1-d-(parseInt(i.style.marginLeft)||parseInt(i.style.marginRight)))/(d+this._pageMarginNumber);r=(o=((h=Math.floor(h))+1)*this.rows)+s*(a+1)-1}for(;!this._thumbnailCanvas[o]&&o>-1;)o--;for(;!this._thumbnailCanvas[r]&&r>o;)r--;return[o,r]},e.prototype.emptyHiddenPages=function(){},e.prototype.dragThumbnail=function(t){return this.isDragUp=!1,!(t.ctrlKey||t.shiftKey||t.metaKey)&&(0===t.button&&this._dragStartFunction(t))},e.prototype.dragStartMobile=function(t){var e=this;this.isDragUp=!1;var i=t.changedTouches[0];return this.needClick=!0,this._dragTimer=setTimeout((function(){document.addEventListener("touchmove",o.C,{passive:!1}),e._dragStartFunction(i)}),300),!0},e.prototype._dragStartFunction=function(t){if(!this.allowPageDragging||this._isCrop)return!1;var e=this.rows,i=this.columns;if(1===e&&1===i)return!1;var n=this.getImageItem(t);if(!n)return!1;this._multipleMode||n.classList.contains("dvs-activeThumb")||(this.selectedIndexes=[Object(o.h)(n)],this._updateSelectedPageStyle(),this.needClick=!1);var r=n.getBoundingClientRect(),s=t.clientX-r.left,a=t.clientY-r.top;return this.thumbMoveOption={napX:s,napY:a,clickX:t.pageX,clickY:t.pageY,target:n},this.isDrag=!0,this._dragStart=!0,!0},e.prototype._initReplaceBlocks=function(){for(var t=this._myQuery("thumbLists"+this.uid),e=t.querySelectorAll(".dvs-activeThumb"),i=0;i<e.length;i++){var n=e[i],r=document.createElement("li");r.className="dvs-replaceBlock",Object(o.F)(r,{backgroundColor:this.placeholderBackground,margin:n.style.margin,width:n.style.width,height:n.style.height}),r["dvs-defaultIndex"]=n["dvs-defaultIndex"],Object(o.l)(r,n,t)}t.classList.add("hideReplaceBlock")},e.prototype.dragMove=function(t){return this._dragMoveFunction(t)},e.prototype.dragMoveMobile=function(t){var e=t.changedTouches[0];return clearTimeout(this._dragTimer),this._dragMoveFunction(e)},e.prototype._dragMoveFunction=function(t){if(this.selectedIndexes.length&&this.isDrag){var e=this.thumbMoveOption,i=e.napX,n=e.napY,s=e.clickX,a=e.clickY,l=e.target,u=t.pageX,h=t.pageY;if(Math.abs(u-s)<10&&Math.abs(h-a)<10&&!this.ifDragMoves)return;var c=l["dvs-defaultIndex"],d=this._myQuery("thumbLists"+this.uid);if(!d)return;this._dragStart&&(this._dragStart=!1,this._initReplaceBlocks(),this._thumbnailCanvas.length<=this.rows*this.columns&&(d.style.overflow="hidden"),this._pubSub._emit(r.g.DRAG_START,{index:c,pageX:t.pageX,pageY:t.pageY},t)),this.ifDragMoves=!0;for(var p=d.scrollTop,_=d.scrollLeft,v=l.getBoundingClientRect(),f=this._renderUids.array.slice(),m=0,g=0;m<this._thumbnailCanvas.length&&g<f.length&&0!==f.length;m++){var y=this._thumbnailCanvas[m];if(-1!==f.indexOf(y.uid)){var b=y._canvasItem.parentNode;if(!b.classList.contains("dvs-activeThumb")){var E=b.getBoundingClientRect(),C=E.left-v.left,S=E.top-v.top;if(Math.abs(C)<=v.width/2&&Math.abs(S)<=v.height/2){for(var I=Object(o.h)(b),T=d.querySelectorAll("li.dvs-replaceBlock"),w=Object(o.h)(T[0]),O=0;O<T.length;O++){var R=T[O];I<w?Object(o.l)(R,b,d):Object(o.k)(R,b)}return d.scrollTop=p,d.scrollLeft=_,!0}g++}}}var x=d.getBoundingClientRect(),P=t.clientY-x.top-n,L=t.clientX-x.left-i+_,A=P+p;d.classList.remove("hideReplaceBlock");for(var M=this._myQueryAll("thumbLists"+this.uid+">li.dvs-activeThumb"),D=0;D<M.length;D++){var B=M[D];B.classList.add("dvs-absolute"),B.style.left=L+5*D+"px",B.style.top=A+5*D+"px"}this._pubSub._emit(r.g.DRAG_MOVE,{index:c,pageX:t.pageX,pageY:t.pageY},t),Object(o.C)(t)}},e.prototype.dragUp=function(){return this._dragUpFunction()},e.prototype.dragUpMobile=function(){return document.removeEventListener("touchmove",o.C),clearTimeout(this._dragTimer),this._dragUpFunction()},e.prototype._dragUpFunction=function(){if(this.isDrag){this.thumbMoveOption=null,this.isDrag=!1;var t=this.ifDragMoves;if(this.clearAbsolute(),!t)return!1;this.isDragUp=!0;for(var e=this._myQuery("thumbLists"+this.uid),i=e.children.length,n=[],o=[],s=[],a=this.selectedIndexes.slice(0),l=[],u=0;u<i;u++){var h=e.children[u],c=h["dvs-defaultIndex"];if(s.push(c),h.classList.contains("dvs-activeThumb")){var d=a.indexOf(c);-1!==d&&(l[d]=u,c!==u&&o.push([c,u]))}n[u]=this._thumbnailCanvas[c]}this._thumbnailCanvas=n,this.selectedIndexes=l,this._updateElements(),this._viewerEmit(r.d.REORDER_THUMBNAIL,s,l.slice()),o.length&&this._pubSub._emit(r.g.DRAG_DONE,o)}},e.prototype.stretchStart=function(t){if(1===t.button)return!1;var e=t.target;if(!(null==e?void 0:e.classList.contains("dvs-stretchBar")))return!1;this.fullThumbnail||(e.classList.add("dvs-streching"),this._stretchItem=e,this._isStretching=!0,Object(o.C)(t))},e.prototype.stretchMove=function(t){if(!this._isStretching)return!1;var e,i,n=this._stretchItem;if(!n||!this._thumbnailElement)return!1;var o=this._thumbnailElement.getBoundingClientRect(),r=n.classList;r.contains("dvs-stretchRight")?(e=t.clientX-o.left<0?0:t.clientX-o.left,n.style.left=e+"px"):r.contains("dvs-stretchLeft")?(e=o.right-t.clientX<0?0:o.right-t.clientX,n.style.left=o.width-e+"px"):r.contains("dvs-stretchTop")?(i=o.bottom-t.clientY<0?0:o.bottom-t.clientY,n.style.top=o.height-i+"px"):(i=t.clientY-o.top<0?0:t.clientY-o.top,n.style.top=i+"px")},e.prototype.stretchEnd=function(){var t;if(!this._isStretching||!this._thumbnailElement)return!1;var e=this._stretchItem;if(!e)return!1;this._stretchItem=null,this._isStretching=!1;var i=parseInt(e.style.left),n=parseInt(e.style.top),o=0,s=this._thumbnailElement.getBoundingClientRect(),a=s.width-i,l=s.height-n,u=null===(t=this._pubQuery("showImageArea"+this._postfix))||void 0===t?void 0:t.getBoundingClientRect();i=Math.min(i,u.width),n=Math.min(n,u.height),o=e.classList.contains("dvs-stretchRight")?i/u.width:e.classList.contains("dvs-stretchLeft")?a/u.width:e.classList.contains("dvs-stretchTop")?l/u.height:n/u.height,e.style.left=null,e.style.top=null,e.classList.remove("dvs-streching"),this.size=Math.min(100*o,100).toFixed(2)+"%",this._pubSub._emit(r.d.CHANGE_THUMBNAIL_VIEW_PROP,{_size:this.size}),this._resizeViewer()},e.prototype._updateStretchBars=function(){var t=this._allowResizing,e=this._location,i=this._sequence,n="horizontal"===e&&t&&i>=0?"remove":"add",o="vertical"===e&&t&&i>=0?"remove":"add",r="horizontal"===e&&t&&i<0?"remove":"add",s="vertical"===e&&t&&i<0?"remove":"add",a=this.uid,l=this._myQuery("stretchBarLeft"+a),u=this._myQuery("stretchBarRight"+a),h=this._myQuery("stretchBarTop"+a),c=this._myQuery("stretchBarBottom"+a);null==l||l.classList[n]("dvs-nodisplay"),null==u||u.classList[r]("dvs-nodisplay"),null==h||h.classList[o]("dvs-nodisplay"),null==c||c.classList[s]("dvs-nodisplay")},e.prototype._updateProps=function(t){for(var e in t)this[e]=t[e]},e.prototype._imageClickCallback=function(t,e){var i=this.selectedIndexes.slice();if((e.ctrlKey||e.metaKey||this._multipleMode)&&!e.shiftKey){var n=i.indexOf(t);if(-1===n)i.push(t);else{if(this.isDragUp)return void(this.isDragUp=!1);if(1===i.length&&!this._multipleMode)return!1;i.splice(n,1),this._prtScrollOnce=!0}}else if(!e.shiftKey||e.ctrlKey||e.metaKey)if((e.ctrlKey||e.metaKey)&&e.shiftKey){var o=i.slice(0);u=o[o.length-1];o.push(t);var s=t,a=t;o.forEach((function(t){t<s?s=t:t>a&&(a=t)}));var l=[];for(c=s;c<=a;c++)c!==u&&l.push(c);u>=0&&l.push(u),i=l}else this.needClick?i=[t]:this.needClick=!0;else{var u;if((u=i[i.length-1])===undefined)i.push(t);else{var h=[];if(u<t)for(var c=t;c>=u;c--)h.push(c);else for(var d=t;d<=u;d++)h.push(d);i=h}}return this._viewerEmit(r.d.SET_SELECTED_INDEXES,i),!0},e.prototype._thumbnailDragStart=function(t){return Object(o.u)()?this.dragStartMobile(t):this.dragThumbnail(t)},e.prototype._thumbnailDragMove=function(t){return Object(o.u)()?this.dragMoveMobile(t):this.dragMove(t)},e.prototype._thumbnailDragUp=function(){return Object(o.u)()?this.dragUpMobile():this.dragUp()},e.prototype._thumbnailMouseOver=function(t){if(this.allowHover&&!this.ifDragMoves){var e=this.getImageItem(t);if(e){e.classList.contains("dvs-activeThumb")||(e.style.background=this.hoverPageBackground,e.style.border=this.hoverPageBorder);var i=e["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_MOUSE_OVER,{index:i,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_MOUSE_OVER,{index:-1,pageX:t.pageX,pageY:t.pageY},t)}},e.prototype._thumbnailMouseOut=function(t){if(this.allowHover&&!this.ifDragMoves){var e=this.getImageItem(t);if(e){var i=e["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_MOUSE_OUT,{index:i,pageX:t.pageX,pageY:t.pageY},t),e.classList.contains("dvs-activeThumb")?(e.style.background=this.selectedPageBackground,e.style.border=this.selectedPageBorder):(e.style.background=this._pageBackground,e.style.border=this.pageBorder)}else this._pubSub._emit(r.g.PAGE_MOUSE_OUT,{index:-1,pageX:t.pageX,pageY:t.pageY},t)}},e.prototype._thumbnailClick=function(t){if(!this.ifDragMoves&&!this.isDragUp){var e=this.getImageItem(t);if(e){var i=e["dvs-defaultIndex"];this._imageClickCallback(i,t),this._pubSub._emit(r.g.PAGE_CLICK,{index:i,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_CLICK,{index:-1,pageX:t.pageX,pageY:t.pageY},t)}},e.prototype._thumbnailRightClick=function(t){var e=this.getImageItem(t);if(e){if(this.ifDragMoves)return!1;var i=e["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_RIGHT_CLICK,{index:i,pageX:t.pageX,pageY:t.pageY},t),this._pubSub._emit(r.g.PAGE_CONTEXTMENU,{index:i,pageX:t.pageX,pageY:t.pageY},t),-1!==this.selectedIndexes.indexOf(i)||Object(o.u)()&&this.allowPageDragging||this._pubSub._emit(r.d.SET_SELECTED_INDEXES,[i])}else this._pubSub._emit(r.g.PAGE_RIGHT_CLICK,{index:-1,pageX:t.pageX,pageY:t.pageY},t),this._pubSub._emit(r.g.PAGE_CONTEXTMENU,{index:-1,pageX:t.pageX,pageY:t.pageY},t)},e.prototype._thumbnailDoubleClick=function(t){var e=this.getImageItem(t);if(e){var i=e["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_DOUBLE_CLICK,{index:i,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_DOUBLE_CLICK,{index:-1,pageX:t.pageX,pageY:t.pageY},t)},e.prototype._thumbnailPointerDown=function(t){var e=this.getImageItem(t);if(e){var i=e["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_MOUSE_DOWN,{index:i,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_MOUSE_DOWN,{index:-1,pageX:t.pageX,pageY:t.pageY},t)},e.prototype._thumbnailPointerMove=function(t){var e,i,n,o,s,a,l;if(this.ifDragMoves){if(!(this.isInner?null===(n=null===(i=null===(e=this._oPub)||void 0===e?void 0:e._events)||void 0===i?void 0:i[r.g.PAGE_MOUSE_MOVE])||void 0===n?void 0:n.length:null===(l=null===(a=null===(s=null===(o=this._pubSub)||void 0===o?void 0:o.getPublishSubscribe())||void 0===s?void 0:s._events)||void 0===a?void 0:a[r.g.PAGE_MOUSE_MOVE])||void 0===l?void 0:l.length))return;var u=this._getPointIndex(t);this._pubSub._emit(r.g.PAGE_MOUSE_MOVE,{index:u,pageX:t.pageX,pageY:t.pageY},t)}else{var h=this.getImageItem(t);if(h){var c=h["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_MOUSE_MOVE,{index:c,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_MOUSE_MOVE,{index:-1,pageX:t.pageX,pageY:t.pageY},t)}},e.prototype._thumbnailPointerUp=function(t){if(this.ifDragMoves){var e=this._getPointIndex(t);this._pubSub._emit(r.g.PAGE_MOUSE_UP,{index:e,pageX:t.pageX,pageY:t.pageY},t)}else{var i=this.getImageItem(t);if(i){var n=i["dvs-defaultIndex"];this._pubSub._emit(r.g.PAGE_MOUSE_UP,{index:n,pageX:t.pageX,pageY:t.pageY},t)}else this._pubSub._emit(r.g.PAGE_MOUSE_UP,{index:-1,pageX:t.pageX,pageY:t.pageY},t)}},e.prototype._thumbnailScroll=function(){this.triggerTopImageChange("scroll")},e.prototype._thumbnailStretchStart=function(t){this.stretchStart(t)},e.prototype._documentMouseMove=function(t){this.stretchMove(t)},e.prototype._documentMouseUp=function(){this.stretchEnd(),this._thumbnailDragUp()},e.prototype.getImageItem=function(t){var e,i,n;if(!t)return null;if(!(n=Object(o.q)(t)?t:t.target)||(null===(e=n.classList)||void 0===e?void 0:e.contains("dvs-replaceBlock")))return null;if("CANVAS"===n.tagName)n=n.parentNode;else{if(n===(null===(i=this._thumbnailElement)||void 0===i?void 0:i.querySelector(".dvs-thumbLists")))return!1;if("LI"!==n.tagName)return null}return n},e.prototype._getPointIndex=function(t){var e,i,n=null===(e=this._thumbnailElement)||void 0===e?void 0:e.querySelector(".dvs-thumbLists");if(!n)return-1;for(var r=n.children,s=0;s<r.length;s++){var a=r[s];if(this._checkPointOnElement(t,a)&&!(null===(i=a.classList)||void 0===i?void 0:i.contains("dvs-activeThumb")))return Object(o.i)(a,(function(t){var e;return!(null===(e=t.classList)||void 0===e?void 0:e.contains("dvs-activeThumb"))}))}return-1},e.prototype.clearAbsolute=function(){var t=this._myQuery("thumbLists"+this.uid);if(!t)return!1;var e=this._myQueryAll("thumbLists"+this.uid+">li.dvs-replaceBlock");this.ifDragMoves=!1,this.isDrag=!1;for(var i=this._myQueryAll("thumbLists"+this.uid+">li.dvs-absolute"),n=0;n<i.length;n++){var r=i[n];Object(o.l)(r,e[n],t),r.classList.remove("dvs-absolute"),r.style.left=null,r.style.top=null}for(var s=0;s<e.length;s++){var a=e[s];t.removeChild(a)}"vertical"===this.scrollDirection?t.style.overflowY="auto":t.style.overflowX="auto"},e.prototype.setPercent=function(t){var e=this._thumbnailElement;e&&(e.style.flex="0 0 "+t+"%",e.style.msFlex="0 0 "+t+"%")},e.prototype.getIndexByUid=function(t){for(var e,i=0;i<this._thumbnailCanvas.length;i++)if(t===(null===(e=this._thumbnailCanvas[i])||void 0===e?void 0:e.uid))return i;return-1},e.prototype.getUidByIndex=function(t){var e;return null===(e=this._thumbnailCanvas[t])||void 0===e?void 0:e.uid},e.prototype._resizeViewer=function(t){void 0===t&&(t=!1),t?this._viewerEmit(r.f.VIEWER_RESIZE,this.uid,this.showLatestPage.bind(this)):this._viewerEmit(r.f.VIEWER_RESIZE)},e.prototype._setSplitBarDelay=function(){var t=this;this.isInner||(clearTimeout(this._splitTimer),this._splitTimer=setTimeout((function(){t._viewerEmit("onSetSplitBar")}),50))},e.prototype._checkPointOnElement=function(t,e){var i,n;if(!t||!e)return!1;var o=-1,r=-1;if(null===(i=t.changedTouches)||void 0===i?void 0:i[0]){var s=null===(n=t.changedTouches)||void 0===n?void 0:n[0];o=s.clientX,r=s.clientY}else{var a=t;o=a.clientX,r=a.clientY}var l=e.getBoundingClientRect();return o>=l.left&&r>=l.top&&o<=l.right&&r<=l.bottom},e.prototype._viewerEmit=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];t.prototype._emit.apply(this,w([e],i))},e.prototype.dispose=function(){var e;this.unbindUi(),t.prototype.dispose.call(this),null===(e=this._pubSub)||void 0===e||e.dispose(),this._pubSub=null,this._viewerContainer=null,this._thumbnailElement=null},e}(a.a),R=i(3),x=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),P=function(t){function e(e,i,n,o,s){var a=t.call(this,e,i,n,o,s)||this;return a.isInner=!0,a._isCrop=!1,a.cropIndex=-1,a.cropUid="",a._originEvents=[],a._tbEvents=[],a._viewerEvents=[],a.cropManager=new R.a(0,0),a.cropManager.selectedCallback=function(e){var i=a.selectedIndexes.slice().pop(),n=a._thumbnailCanvas[i];n&&n.renderImg&&t.prototype._emit.call(a,r.g.PAGE_AREA_SELECTED,i,e)},a.cropManager.unselectedCallback=function(){for(var e=a.cropIndex,i=a._thumbnailCanvas.length,n=0;n<i;n++){var o=a._thumbnailCanvas[n];a.cropUid===o.uid&&(a.cropManager.cropBoxes=[],o.renderImg?a.setPageRect(o):o.setRect([]))}t.prototype._emit.call(a,r.g.PAGE_AREA_UNSELECTED,e)},a._initEvents(),a}return x(e,t),e.prototype._initEvents=function(){var e=this,i=[r.d.CANVAS_MOUSE_DOWN,r.d.CANVAS_MOUSE_MOVE,r.d.CANVAS_MOUSE_UP,r.d.CANVAS_CLICK,r.d.CANVAS_RIGHT_CLICK,r.d.CANVAS_DOUBLE_CLICK,r.d.CANVAS_MOUSE_OVER,r.d.CANVAS_MOUSE_OUT],n=[r.g.PAGE_MOUSE_DOWN,r.g.PAGE_MOUSE_MOVE,r.g.PAGE_MOUSE_UP,r.g.PAGE_CLICK,r.g.PAGE_RIGHT_CLICK,r.g.PAGE_DOUBLE_CLICK,r.g.PAGE_MOUSE_OVER,r.g.PAGE_MOUSE_OUT];this._originEvents=n;for(var o=0;o<i.length;o++)this._packageEvent(n[o],i[o]);this._tbEvents=[[r.g.DRAG_DONE,function(i){t.prototype._emit.call(e,r.d.CANVAS_DRAG_DONE,i)}],[r.g.TOP_PAGE_CHANGED,function(i,n){t.prototype._emit.call(e,r.g.TOP_PAGE_CHANGED,i,n)}],[r.g.PAGE_MOUSE_DOWN,function(t,i){e._cropStart(t,i)}],[r.f.DOCUMENT_POINTER_UP,function(t){e._cropUp(t)}],[r.g.VIEWER_PAGE_RENDERED,function(i){t.prototype._emit.call(e,r.g.VIEWER_PAGE_RENDERED,i)}]],this._tbEvents.forEach((function(t){var i;null===(i=e._pubSub)||void 0===i||i._on(t[0],t[1])})),this._viewerEvents=[[r.f.DOCUMENT_POINTER_MOVE,function(t){e._cropMove(t)}],[r.f.DOCUMENT_POINTER_UP,function(t){e._cropUp(t)}],[r.d.CLEAR_SLT_BOX,function(){e.cropManager.clear()}]],this._viewerEvents.forEach((function(t){e._on(t[0],t[1])}))},e.prototype._initThumbnailConfig=function(t){this._pubSub=new a.a(t.pubsub);for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i],o=t[n];"pubsub"!==n&&o!==undefined&&(this[n]=o)}},e.prototype.dispose=function(){var e,i=this;this._viewerEvents.forEach((function(t){i._off(t[0])})),t.prototype.dispose.call(this),this._pubSub&&(this._originEvents.forEach((function(t){i._pubSub._off(t)})),this._tbEvents.forEach((function(t){i._pubSub._off(t[0])}))),this._originEvents=[],this._tbEvents=[],this._viewerEvents=[],null===(e=this.cropManager)||void 0===e||e.dispose(),this.cropManager=null},e.prototype._packageEvent=function(e,i){var n=this;this._pubSub._on(e,(function(e,o){var r=e.index,s=e.pageX,a=e.pageY;if(-1===r)t.prototype._emit.call(n,i,o,{index:r,imageX:-1,imageY:-1,pageX:s,pageY:a});else{if(!n._thumbnailCanvas[r])return;var l=n._getOriginPosition(r,o),u=l.imageX,h=l.imageY;t.prototype._emit.call(n,i,o,{index:r,imageX:u,imageY:h,pageX:s,pageY:a})}}))},e.prototype._getOriginPosition=function(t,e,i){var n;void 0===i&&(i=!0);var o=null,r=null,s=null===(n=this._thumbnailElement.querySelector(".dvs-thumbLists"))||void 0===n?void 0:n.children;if(s){if(this.ifDragMoves)for(var a=-1,l=0;l<s.length;l++){var u=s[l];if(!(null==u?void 0:u.classList.contains("dvs-activeThumb"))&&t===++a){o=u,r=this._thumbnailCanvas[u["dvs-defaultIndex"]];break}}else o=s[t],r=this._thumbnailCanvas[t];if(o){var h=o.getBoundingClientRect(),c=this._dataStore.getMetadata(r.uid);if(!r.renderImg||!(null==c?void 0:c.width)||!(null==c?void 0:c.height))return{imageX:-1,imageY:-1};var d=e.clientX-h.left,p=e.clientY-h.top,_=r.renderImg.naturalWidth,v=r.renderImg.naturalHeight,f=r.fitRatio,m=d-(h.width-_/f)/2,g=p-(h.height-v/f)/2;if(i&&(m<0||g<0||m>_/f||g>v/f))return{imageX:-1,imageY:-1};var y=c.width/_;return{imageX:Math.floor(m*f*y),imageY:Math.floor(g*f*y)}}}},e.prototype._cropStart=function(t,e){var i=t.index,n=this.selectedIndexes.slice().pop();if(-1!==i&&n===i&&this._isCrop){var s=this._thumbnailCanvas[i];if(s&&s.renderImg){var a=this._getOriginPosition(i,e),l=a.imageX,u=a.imageY;if(-1!==l&&-1!==u){var h=this._dataStore.getMetadata(s.uid);if(!(null==h?void 0:h.width)||!h.height)return this._pubSub._emit(r.d.ERROR,r.a.META_DATA_NOT_EXIST),!1;var c=h.width/s.renderImg.naturalWidth,d=s.fitRatio,p=this.cropManager;p.setZoom(1/d/c),p.setPageSize(h.width,h.height),p.onStartHandler(l,u,e.ctrlKey),s.setRect(p.cropBoxes,this.selectedBoxLineColor),Object(o.C)(e)}}}},e.prototype._cropMove=function(e){if(this.showThumbnail&&this._isCrop){var i=this.selectedIndexes.slice().pop();if(-1!==i){var n=this._thumbnailCanvas[i];if(n){var o=this._getOriginPosition(i,e,!1),s=o.imageX,a=o.imageY,l=this.cropManager,u=l.checkSelectForCursor(s,a);if(u){var h="move"===u.position?"move":u.position+"-resize";t.prototype._emit.call(this,r.f.CHANGE_CANVAS_CURSOR,h)}else t.prototype._emit.call(this,r.f.CHANGE_CANVAS_CURSOR,"");l.mouseDown&&(l.setKeepAspectRatio(e.shiftKey),l.onMoveHandler(s,a,!1),this.setPageRect(n))}}}},e.prototype._cropUp=function(t){if(this._isCrop&&this.cropManager.mouseDown){this.selectedIndexes.slice().pop();this.cropManager.onEndHandler()}},e.prototype.setPageRect=function(t,e){if(void 0===e&&(e=this.selectedBoxLineColor),t){var i=this.cropManager.cropBoxes;t.setRect(i,e),t.render(!1)}},e.prototype._updateInnerPage=function(t){t.data,t.index,t.uid,t.width,t.height;return!1},e.prototype.setSelectedBoxLineColor=function(t){this.selectedBoxLineColor=t;var e=this.selectedIndexes.slice().pop(),i=this._thumbnailCanvas[e];i&&this._isCrop&&this.setPageRect(i,t)},e.prototype.setOperationMode=function(t){1===t?this._isCrop=!0:(this._isCrop=!1,this.clearSelectedBoxes())},e.prototype.setSelectedBoxes=function(e,i){i||this.cropManager.clear(),Object(o.m)(e)||(e=[e]);var n=this.selectedIndexes.slice().pop(),s=this._thumbnailCanvas[n],a=this._dataStore.getMetadata(s.uid);this.cropManager.setPageSize(a.width,a.height);for(var l=e.length,u=0;u<l;u++){var h=e[u];this.cropManager.addBox([h.left,h.top,h.left+h.width,h.top,h.left+h.width,h.top+h.height,h.left,h.top+h.height],"bottomRight")}var c=this.cropManager.getRectArr();this.setPageRect(s),t.prototype._emit.call(this,r.g.PAGE_AREA_SELECTED,n,c),t.prototype._emit.call(this,r.g.VIEWER_PAGE_RENDERED,n,c)},e.prototype.setKeepAspectRatio=function(t){},e.prototype.setAspectRatio=function(t){this.cropManager.setAspectRatio(t)},e.prototype.clearSelectedBoxes=function(t){this.cropManager.clear()},e}(O),L=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),A=function(t){function e(e,i,n,o){var r=t.call(this,i)||this;return r._viewerContainer=null,r._dataStore=null,r._thumbnails={},r.innerThumbnail=null,r._selectedIndexes=[],r._displayedUidsManage={},r._thumbnailContents=[],r._lastShowUid="",r._displayTimer=null,r.postfix=e,r._viewerContainer=n,r._dataStore=o,r._bindEvents(),r}return L(e,t),e.prototype.createThumbnail=function(t){var e=t.uid;e||(e=Object(o.I)(11),t.uid=e);var i=new O(t,this._oPub,this._viewerContainer,this.postfix,this._dataStore);return this._thumbnails[e]=i,i.updateContent(this._thumbnailContents),i.selectThumbnailByIndexes(this._selectedIndexes),!0},e.prototype.createInnerThumbnail=function(t){var e={uid:this.postfix,pubsub:new a.b,size:"100%",background:t.canvasBackground,mouseShape:t.canvasMouseShape,border:t.canvasBorder,location:"canvas",allowResizing:!1,showThumbnail:!1};Object(o.A)(t,e),this.innerThumbnail=new P(e,this._oPub,this._viewerContainer,this.postfix,this._dataStore)},e.prototype.removeThumbnail=function(e){var i=this._thumbnails[e];return!!i&&(i.unbindUi(),t.prototype._emit.call(this,"onSetSplitBar"),delete this._thumbnails[e],!0)},e.prototype.removeAllThumbnail=function(){var t,e;for(var i in this._thumbnails)this.removeThumbnail(i);null===(t=this.innerThumbnail)||void 0===t||t.unbindUi(),null===(e=this.innerThumbnail)||void 0===e||e.dispose(),this._thumbnails={},this._viewerContainer=null,this._off(r.f.MERGE_DISPLAYED_UIDS),this._off(r.f.UPDATE_THB_ITEM)},e.prototype.on=function(t,e){this._on(t,e.bind(this))},e.prototype._bindEvents=function(){var e=this;this.on(r.f.MERGE_DISPLAYED_UIDS,(function(i,n){e._displayedUidsManage[n]=i,clearTimeout(e._displayTimer),e._displayTimer=setTimeout((function(){var i=new I;for(var n in e._displayedUidsManage){var o=e._displayedUidsManage[n];i.array=i.concat(o)}t.prototype._emit.call(e,r.d.DISPLAYED_IMAGE_CHANGED,i.array.slice())}),100)})),this.on(r.f.UPDATE_THB_ITEM,(function(t){e._updatePageItem(t)}))},e.prototype.calculateSize=function(){var t;for(var e in this._thumbnails)this._thumbnails[e].calculateSize();null===(t=this.innerThumbnail)||void 0===t||t.calculateSize()},e.prototype.updateAllDisplayed=function(){var t;for(var e in this._thumbnails)this._thumbnails[e].updateDisplayedUidsIE();null===(t=this.innerThumbnail)||void 0===t||t.updateDisplayedUidsIE()},e.prototype.showLatestPage=function(t){var e;for(var i in this._thumbnails)this._thumbnails[i].showLatestPage(t);null===(e=this.innerThumbnail)||void 0===e||e.showLatestPage(t)},e.prototype.updatePagesLayout=function(){var t;for(var e in this._thumbnails)this._thumbnails[e].updatePageLayout();null===(t=this.innerThumbnail)||void 0===t||t.updatePageLayout()},e.prototype.updateContents=function(t){var e;for(var i in this._thumbnailContents=t,this._thumbnails)this._thumbnails[i].updateContent(t);null===(e=this.innerThumbnail)||void 0===e||e.updateContent(t)},e.prototype._updatePageItem=function(t){for(var e,i=this._thumbnailContents,n=0;n<i.length;n++)if(i[n].uid===t.uid){i[n]=t;break}for(var o in this._thumbnails)this._thumbnails[o].updatePageItem(t);null===(e=this.innerThumbnail)||void 0===e||e.updatePageItem(t)},e.prototype.updateSelectedIndexes=function(t){var e;for(var i in this._selectedIndexes=t,this._thumbnails)this._thumbnails[i].selectThumbnailByIndexes(t);null===(e=this.innerThumbnail)||void 0===e||e.selectThumbnailByIndexes(t)},e.prototype.pageChangeCallback=function(t,e,i){var n,o=this._thumbnailContents,r=this.innerThumbnail,s=this._lastShowUid,a=null===(n=o[e])||void 0===n?void 0:n.uid;a!==undefined&&s===a||(r.clearSelectedBoxes(),r.cropIndex=e,r.cropUid=a,this._lastShowUid=a)},e.prototype.keydownCallback=function(e,i){var n=this._thumbnails[i];n?n.keydownCallBack(e):i===this.innerThumbnail.uid&&(this.innerThumbnail.keydownCallBack(e),t.prototype._emit.call(this,r.d.CANVAS_KEY_DOWN,e))},e.prototype.keyupCallback=function(e,i){var n=this._thumbnails[i];n?n.keyupCallBack(e):i===this.innerThumbnail.uid&&(this.innerThumbnail.keyupCallBack(e),t.prototype._emit.call(this,r.d.CANVAS_KEY_UP,e))},e.prototype.dispose=function(){var e;t.prototype.dispose.call(this);for(var i=Object.keys(this._thumbnails),n=0,o=i.length;n<o;n++){var r=i[n],s=this._thumbnails[r];s&&s.dispose(),s=null}this._thumbnails=null,null===(e=this.innerThumbnail)||void 0===e||e.dispose(),this.innerThumbnail=null,this._viewerContainer=null,this._dataStore=null},e}(a.a),M=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),D=function(t){function e(e,i,n){var o=t.call(this,i)||this;return o._xOver=!1,o._yOver=!1,o.isMyScroll=!1,o.buttonMove=!1,o._isButtonScroll=!1,o._unbindList=[],o._postfix=e,o._myQuery=function(t,e){var i;return void 0===e&&(e="#"),null===(i=null==n?void 0:n.el)||void 0===i?void 0:i.querySelector(e+t)},o._myQueryAll=function(t,e){var i;return void 0===e&&(e="#"),null===(i=null==n?void 0:n.el)||void 0===i?void 0:i.querySelectorAll(e+t)},o}return M(e,t),e.prototype.getImageSize=function(e){var i=this,n=this.setOuterSize(e.width,e.height);return this.setScroller(e.x,e.y),n&&setTimeout((function(){i.setViewPort(),t.prototype._emit.call(i,"_onCanvasResize")})),n},e.prototype.setScroller=function(t,e){var i=Object(o.j)("outer"+this._postfix);if(!i)return!1;var n=i.scrollLeft,r=i.scrollTop;return n===t&&r===e||(this.isMyScroll=!0),i.scrollLeft=t,i.scrollTop=e,!0},e.prototype.setOuterSize=function(t,e){var i=Object(o.j)("outer"+this._postfix),n=Object(o.j)("inner"+this._postfix),r=!1,s=!1;if(!i||!n)return!1;t>i.offsetWidth?(i.style.overflowX="auto",r=!0):i.style.overflowX="hidden",e>i.offsetHeight?(i.style.overflowY="auto",s=!0):i.style.overflowY="hidden",n.style.width=t+"px",n.style.height=e+"px";var a=this._xOver!==r,l=this._yOver!==s;return this._xOver=r,this._yOver=s,a||l},e.prototype.setViewPort=function(){var t=Object(o.j)("outer"+this._postfix),e=Object(o.j)("viewPort"+this._postfix);if(!t||!e)return!1;var i=t.offsetWidth-t.clientWidth,n=t.offsetHeight-t.clientHeight;e.style.width="calc(100% - "+i+"px)",e.style.height="calc(100% - "+n+"px)"},e.prototype._addButtonScroll=function(){var t=this,e=[],i=this._myQueryAll("dvs-groupType",".");if(i){var n=Object(o.u)();this._on(r.f.DOCUMENT_POINTER_MOVE,(function(e){n?t.buttonScrollMoveMobile(e):t.buttonScrollMove(e)})),this._on(r.f.DOCUMENT_POINTER_UP,(function(){t.buttonScrollEndFun()})),[].forEach.call(i,(function(i){"ontouchstart"in document.documentElement?Object(o.c)(i,r.c.TOUCH_START,(function(e){t.buttonScrollStartMobile(e)})):Object(o.c)(i,r.c.MOUSE_DOWN,(function(e){t.buttonScrollStart(e)})),t._unbindList=e;var n=i.querySelector(".dvs-showBefore");n&&(n.onclick=function(){i.scrollLeft=0,t._updateShowMore(i)});var s=i.querySelector(".dvs-showAfter");s&&(s.onclick=function(){i.scrollLeft=i.scrollWidth-i.clientWidth,t._updateShowMore(i)})}))}},e.prototype.buttonScrollStart=function(t){return(!t.button||0===t.button)&&(this._buttonScrollStartFun(t),!0)},e.prototype.buttonScrollStartMobile=function(t){var e=t.changedTouches[0];return!!e&&(this._buttonScrollStartFun(e),!0)},e.prototype._buttonScrollStartFun=function(t){var e,i=t.target;if(i&&i.classList.contains("dvs-groupType"))e=i;else{if(!(i&&i.parentNode&&i.parentNode.classList.contains("dvs-groupType")))return!1;e=i.parentNode}this._isButtonScroll=!0,this._scrollStartInfo={x:t.clientX,y:t.clientY,left:e.scrollLeft,top:e.scrollTop,item:e}},e.prototype.buttonScrollMove=function(t){return this._buttonScrollMoveFun(t),!0},e.prototype.buttonScrollMoveMobile=function(t){var e=t.changedTouches[0];return!!e&&(this._buttonScrollMoveFun(e),!0)},e.prototype._buttonScrollMoveFun=function(t){if(!this._isButtonScroll)return!1;var e=this._scrollStartInfo,i=e.x,n=e.y,r=e.left,s=e.top,a=e.item;if(a.scrollWidth>a.clientWidth){var l=t.clientX-i,u=t.clientY-n;(Math.abs(l)>5||Math.abs(u)>5)&&(this.buttonMove=!0,a.scrollLeft=r-l,a.scrollTop=s-u,this._updateShowMore(a),Object(o.C)(t))}},e.prototype.buttonScrollEndFun=function(){this._isButtonScroll=!1,this._scrollStartInfo={},document.removeEventListener(r.c.TOUCH_MOVE,o.C)},e.prototype._updateShowMore=function(t){if(!t)return!1;if(0==t.children.length)return!1;t.scrollWidth-t.clientWidth>=5?t.style.justifyContent="flex-start":t.style.justifyContent="";var e=t.scrollLeft,i=e>=5,n=e+t.clientWidth<t.scrollWidth-5,o=t.querySelector(".dvs-showBefore");if(!o||"SPAN"!==o.tagName)return!1;i&&t.clientWidth>=60?o.classList.remove("dvs-nodisplay"):o.classList.add("dvs-nodisplay");t.children.length;var r=t.querySelector(".dvs-showAfter");n&&t.clientWidth>=60?r.classList.remove("dvs-nodisplay"):r.classList.add("dvs-nodisplay"),e=t.scrollLeft,o.style.left=e+"px",r.style.right=-e+"px"},e.prototype.updateAllGroupShowMore=function(){var t=this,e=this._myQueryAll("dvs-groupType",".");e&&[].forEach.call(e,(function(e){t._updateShowMore(e)}))},e.prototype.unbindEvents=function(){this._unbindList.forEach((function(t){null==t||t()}))},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.unbindEvents()},e}(a.a),B=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),U=function(t){function e(e,i){var n=t.call(this,i)||this;return n._currentPage=-1,n._totalPage=0,n._postfix=e,n}return B(e,t),e.prototype.goToPage=function(t){this._emit(r.b.GOTO_PAGE,t)},e.prototype.getCurrentPage=function(){return this._currentPage},e.prototype.setCurrentPage=function(t){return!!Object(o.v)(t)&&(this._currentPage=t,!0)},e.prototype.getTotalPage=function(){return this._totalPage},e.prototype.setTotalPage=function(t){return!!Object(o.v)(t)&&(this._totalPage=t,!0)},e.prototype.updatePage=function(t){var e=document.getElementById("pagerInput"+this._postfix),i=document.getElementById("pagerLabel"+this._postfix),n=t.cur,o=t.total;this.setCurrentPage(n),this.setTotalPage(o);var r=o?n+1:0;if(e&&i){e.value=r,i.innerText=String(o),e.style.fontSize="16px";var s=16*String(o).length+"px";e.style.width=s}},e.prototype.pageBlur=function(t){var e=t.target,i=parseInt(e.value);e.value=String(this._currentPage+1),this.goToPage(i-1)},e}(a.a),N=function(){function t(t){this.id="",this.name="",this.type="",this.iconClass="",this._init(t)}return t.prototype._init=function(t){if(o.w)for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];n!==undefined&&(this[n]=t[n])}},t}(),k=function(){function t(t,e,i,n,o){return this.createVNode(t,e,i,n,o)}return t.prototype.createVNode=function(t,e,i,n,o){void 0===e&&(e={}),void 0===i&&(i=[]),void 0===o&&(o="");var r={el:n,tagName:t,sel:"",data:e,children:i,text:o};return this._updateVNode(r)},t.prototype._updateVNode=function(t){var e=this;Object(o.w)(t.data)||(t.data={}),Object(o.m)(t.children)||(t.children=[]);var i=t.data.id,n=t.tagName;return i?(n+="#"+i,t.sel=n):t.data["class"]&&(n+="."+t.data["class"],t.sel=n),t.children.forEach((function(t){return e._updateVNode(t)})),t},t}(),V={createVnode:function(t,e,i,n,r){if(void 0===e&&(e={}),void 0===i&&(i=[]),Object(o.w)(e)&&Object(o.m)(i))return new k(t,e,i,n,r)},sameVnode:function(t,e){return e.data.key===t.data.key&&e.data.key!==undefined||(e.tagName===t.tagName||e.text===t.text&&t.text!==undefined)},createKeyHashList:function(t,e,i){var n,o,r,s={};for(n=e;n<=i;++n)(r=t[n])&&r.data&&(o=r.data.key)&&(s[o]=n);return s},removeVnodes:function(t,e,i){for(;e<=i;){var n=t[e];if(null!=n&&n.el){var o=n.el.parentElement;o&&o.removeChild(n.el)}++e}},addVnodes:function(t,e,i,n,r){for(var s=function(){var r=i[n];if(r){if(!r.el)r.el=document.createElement(r.tagName),Object.keys(r.data).forEach((function(t){"class"===t?r.el.className=r.data[t]:"style"===t?r.el.setAttribute(t,r.data[t]):r.el[t]=r.data[t]}));r.text&&(r.el.textContent=r.text),Object(o.l)(r.el,e,t);var s=r.children;s&&s.length&&a.addVnodes(r.el,null,s,0,s.length)}++n},a=this;n<=r;)s()},addOneVnode:function(t,e,i){if(!t||!t.children)return!1;var n=t.children[e]&&t.children[e].el;return t.children.splice(e,0,i),this.addVnodes(t.el,n,[i],0,0)},patchVnode:function(t,e){var i=e.el=t.el;Object.keys(e.data).forEach((function(i){t.el[i]!==e.data[i]&&("class"===i||"style"===i?t.el.setAttribute(i,e.data[i]):t.el[i]=e.data[i],t.data[i]=e.data[i])}));var n=t.children,o=e.children;t!==e&&(""!==e.text&&t.text!==e.text?i.textContent=e.text:n.length&&o.length&&n!==o?this.updateChildren(i,n,o):o&&o.length?this.addVnodes(i,null,o,0,o.length):n&&n.length&&this.removeVnodes(n,0,n.length))},updateChildren:function(t,e,i){for(var n,r,s,a,l=0,u=0,h=e.length-1,c=i.length-1,d=e[0],p=e[h],_=i[0],v=i[c];l<=h&&u<=c;)null==d?d=e[++l]:null==p?p=e[--h]:null==_?_=i[++u]:null==v?v=i[--c]:this.sameVnode(d,_)?(this.patchVnode(d,_),d=e[++l],_=i[++u]):this.sameVnode(p,v)?(this.patchVnode(p,v),p=e[--h],v=i[--c]):this.sameVnode(d,v)?(this.patchVnode(d,v),Object(o.l)(d.el,p.el.nextSibling,t),d=e[++l],v=i[--c]):this.sameVnode(p,_)?(this.patchVnode(p,_),Object(o.l)(p.el,d.el,t),p=e[--h],_=i[++u]):(n===undefined&&(n=this.createKeyHashList(e,l,h)),(r=n[_.data.key])===undefined?(this.addVnodes(t,d.el,i,u,u),_=i[++u]):((s=e[r]).sel!==_.sel?this.addVnodes(t,d.el,e,r,r):(this.patchVnode(s,_),Object(o.l)(_.el,d.el,t),e[r]=null),_=i[++u]));l>h?(a=i[c+1]?i[c+1].el:null,this.addVnodes(t,a,i,u,c)):u>c&&this.removeVnodes(e,l,h)},patch:function(t,e){if(this.sameVnode(t,e))this.patchVnode(t,e);else{var i=t.el,n=i.parentNode;null!==n&&(Object(o.l)(e.el,i.nextSibling,n),n.removeChild(t.el),t=null)}return e}},j=function(){function t(t,e,i){this._viewerContainer=null,this._postfix="",this._tabList=[],this._tabVNode=null,this._selectedTabId="",this._postfix=t,this._viewerContainer=i}return t.prototype.tabRenderInit=function(){var t,e,i=null===(e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el)||void 0===e?void 0:e.querySelector("#tabList"+this._postfix);this._tabVNode=V.createVnode("DIV",{},[],i)},t.prototype.tabDestroy=function(){this._tabVNode=null},t.prototype.updateTabList=function(t){var e=t.selectedTabId,i=t.tabs;this._updateTabData(i);var n=this._createVirtualTab(i);this._tabVNode=V.patch(this._tabVNode,n),this.selectTabById(e)},t.prototype.getSelectedIndex=function(){for(var t,e=0;e<this._tabList.length;e++)if((null===(t=this._tabList[e])||void 0===t?void 0:t.id)===this._selectedTabId)return e;return-1},t.prototype.selectTabByIndex=function(t){var e;return this._tabList[t]!==undefined&&(this._selectedTabId=null===(e=this._tabList[t])||void 0===e?void 0:e.id,this._updateSelectedStyle(),!0)},t.prototype.selectTabById=function(t){this._selectedTabId=t,this._updateSelectedStyle()},t.prototype.closeTabById=function(t){},t.prototype._updateSelectedStyle=function(){var t,e,i=null===(e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el)||void 0===e?void 0:e.querySelector("#tabList"+this._postfix);if(i)for(var n=null==i?void 0:i.children,o=0;o<n.length;o++){var r=n[o];null==r||r.classList[(null==r?void 0:r.id)===this._selectedTabId?"add":"remove"]("dvs-activeTab")}},t.prototype._updateTabData=function(t){for(var e=[],i=0;i<t.length;i++){var n=this._createTabItem(t[i]);e.push(n)}this._tabList=e},t.prototype._createTabItem=function(t){return new N(t)},t.prototype._createVirtualTab=function(t){for(var e,i=V.createVnode,n=i("DIV"),o=0,r=t.length;o<r;o++){var s=t[o],a=i("DIV",{"class":"dvs-tabItem "+(s.id===this._selectedTabId?"activeTab":""),id:s.uid,key:s.uid,title:s.name},[i("SPAN",{"class":s.iconClass||""}),i("SPAN",{"class":"dvs-tabText"},[],null,s.name),i("A",{"class":"ds-dvs-ui-iconfont ds-dvs-ui-cancle dvs-closeTab","dvs-id":s.uid})]);null===(e=n.children)||void 0===e||e.push(a)}return n},t.prototype.dispose=function(){},t}(),G=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),H=function(t){function e(e){var i=e.postfix,n=e.pubsub,o=e.viewerContainer,r=t.call(this,n)||this;return r._postfix="",r._viewerContainer=null,r._width=0,r._height=0,r._innerWidth=0,r._innerHeight=0,r._scrollLeft=0,r._scrollTop=0,r._canvasList=[],r._postfix=i,r._viewerContainer=o,r}return G(e,t),e.prototype._query=function(t){var e,i;return null===(i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el)||void 0===i?void 0:i.querySelector("#"+t+this._postfix)},e.prototype.canvasRenderInit=function(){this._createCanvas("main"),this._createCanvas("cropper"),this._createSlider()},e.prototype.updateCanvasInnerSize=function(){var e,i=this._query("canvasScroll"),n=null===(e=this._query("innerThumbnail"))||void 0===e?void 0:e.querySelector(".dvs-thumbLists");if(!i||!n)return!1;var o=i.offsetWidth||n.offsetWidth,r=i.offsetHeight||n.offsetHeight;if(0===o||0===r)return!1;t.prototype._emit.call(this,"_setCanvasSize",{width:o,height:r})},e.prototype.updateScrollSize=function(t){var e=t.width,i=t.height,n=t.x,r=t.y;if(e>0&&i>0){this._innerWidth=e,this._innerHeight=i;var s=this._query("scrollInner");s&&(s.style.width=e-1+"px",s.style.height=i-1+"px")}if(n!==this._scrollLeft||r!==this._scrollTop){var a=this._query("canvasScroll");a&&(this._scrollLeft=a.scrollLeft=n,this._scrollTop=a.scrollTop=r),a=null}var l=this._query("canvasWrapper"),u=this._query("canvasScroll");if(l&&u){var h=u.clientWidth,c=u.clientHeight;l.style.width=h+"px",l.style.height=c+"px";for(var d=Object(o.e)(),p=null==l?void 0:l.children,_=0;_<p.length;_++){var v=p[_];if("CANVAS"===v.tagName){var f=h*d,m=c*d;v.width!==f&&(v.width=f),v.height!==m&&(v.height=m)}v=null}}},e.prototype._createSlider=function(){var e=this._query("viewPort");if(!e)return null;var i=document.createElement("div");i.className="dvs-slideWrapper";for(var n=0;n++<3;){var o=document.createElement("div"),s=document.createElement("img");o.className="dvs-slideItem",s.className="dvs-slideImg",o.appendChild(s),i.appendChild(o)}e.appendChild(i),e=null,t.prototype._emit.call(this,r.d.BIND_SLIDE_COMPONENT,i),i=null},e.prototype._removeSlider=function(){var e=this._query("viewPort");if(!e)return null;var i=e.querySelector(".dvs-slideWrapper");t.prototype._emit.call(this,r.d.UNBIND_SLIDE_COMPONENT),i&&e.removeChild(i),i=null},e.prototype._createCanvas=function(e){var i,n=this._query("canvasWrapper");if(!n)return null;var o=document.createElement("canvas");o.id=e+"Canvas"+this._postfix,o.className="dvs-canvas dvs-"+e,n.appendChild(o),t.prototype._emit.call(this,"_bindCanvas",((i={})[e]=o,i)),this._canvasList.push(e),o=null},e.prototype._removeCanvas=function(e){var i=this._query("canvasWrapper");if(!i)return null;var n=this._query(e+"Canvas");if(!n)return null;i.removeChild(n),t.prototype._emit.call(this,"_unbindCanvas",e);for(var o=0;o<this._canvasList.length;o++)if(this._canvasList[o]===e){this._canvasList.splice(o,1);break}return n},e.prototype.removeAllCanvas=function(){for(var t=0;t<this._canvasList.length;t++)this._removeCanvas(this._canvasList[t])&&t--;this._removeSlider()},e.prototype.dispose=function(){t.prototype.dispose.call(this)},e}(a.a),F=undefined&&undefined.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Y=undefined&&undefined.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var r=arguments[e],s=0,a=r.length;s<a;s++,o++)n[o]=r[s];return n},W=function(t){function e(e,i,n,o,r){var s=t.call(this,o)||this;return s._sideRender=null,s._thumbnailRender=null,s._directoryRender=null,s._tagRender=null,s._scrollRender=null,s._pagerRender=null,s._tabRender=null,s._canvasRender=null,s._cameraRender=null,s._uiRender=null,s._dataStore=null,s._uiEventControl=null,s.uiConfig=null,s._viewerContainer=null,s.containerBox=null,s.useMyEvent=!0,s.topMenuColor="#3a393b",s.topMenuBorder="1px solid #1b1b1d",s.headerColor="#2a292b",s.footerColor="#434246",s.asideMenuColor="#434246",s.viewerBorderColor="#1b1b1d",s.canvasBackground="#434246",s.canvasBorder="0px solid #1b1b1d",s.canvasMouseShape="default",s.outerBorder="1px solid #1b1b1d",s._webcamItem=null,s._videoImageReady=!0,s._updateVideoTimer=null,s.showViewer=!0,s.showTopMenu=!0,s.showHeader=!0,s.showSidebar=!1,s.showTab=!1,s.showAside=!1,s.showMain=!0,s.showFooter=!0,s.showVideoContainer=!1,s.width="100%",s.height="100%",s.showWidth=-1,s.showHeight=-1,s._eventList={},s._resizeTimer=null,s._showLatestQueue={},s.postfix=n,s.uiConfig=i,s._dataStore=r,s._initViewer(e,i),s}return F(e,t),e.prototype._myQuery=function(t){var e,i;return null===(i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el)||void 0===i?void 0:i.querySelector("#"+t)},e.prototype._myQueryAll=function(t){var e,i;return null===(i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el)||void 0===i?void 0:i.querySelectorAll("#"+t)},e.prototype._initViewer=function(t,e){if(!t)return!1;if(Object(o.y)(t))t=document.getElementById(t);else if(!Object(o.q)(t))return!1;return this.containerBox=t,this._createMember(e,t),this._initMember(),this._initStatus(e),this._bindUiEvent(),this._bindButtonEvent(),!0},e.prototype._createMember=function(t,e){var i=this.postfix,n=this._oPub;this._uiRender=new E({postfix:i,container:e,uiConfig:t,pubsub:n});var o=this._uiRender.viewerContainer;this._viewerContainer=o,this._thumbnailRender=new A(i,n,o,this._dataStore),this._scrollRender=new D(i,n,o),this._pagerRender=new U(i,n),this._uiEventControl=new u(i,n,o),this._tabRender=new j(i,n,o),this._canvasRender=new H({postfix:i,pubsub:n,viewerContainer:o})},e.prototype._initMember=function(){var t;null===(t=this._sideRender)||void 0===t||t.sidebarInit(),this._scrollRender._addButtonScroll(),this._uiEventControl.uiEventInit(),this._tabRender.tabRenderInit(),this._canvasRender.canvasRenderInit()},e.prototype._initStatus=function(t){this.setViewerWidth(t.width),this.setViewerHeight(t.height),this.setShowViewer(t.showViewer),this.setOuterBorder(t.outerBorder),this.setFooterColor(t.footerColor),this.setHeaderColor(t.headerColor),this.setTopMenuColor(t.topMenuColor),this.setTopMenuBorder(t.topMenuBorder),this.setShowMain(t.showMain),this.setSidebarWidth(t.sidebarWidth),this.setShowVideoContainer(t.showVideoContainer),this.setShowTab(t.showTab),this.setCanvasBackground(t.canvasConfig.canvasBackground),this.setCanvasMouseShape(t.canvasConfig.canvasMouseShape),this.setCanvasBorder(t.canvasConfig.canvasBorder),this.setLoadingImage(t.canvasConfig.loadingImageUrl),this._setShowLoadingImage(!1)},e.prototype.unbindView=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;if(!e)return!1;var i=e.parentNode;return i&&(this._unbindStatus(),i.removeChild(e),i=e=null,this._viewerContainer.el=null),!0},e.prototype.updateUiSetting=function(t){},e.prototype._bindUiEvent=function(){var t,e=((t={})[r.f.VIEWER_RESIZE]=this._resizeViewer,t[r.f.DOCUMENT_POINTER_MOVE]=this._documentMouseMove,t[r.f.DOCUMENT_POINTER_UP]=this._documentMouseUp,t[r.f.DOCUMENT_CLICK]=this._documentClick,t[r.f.VIEWER_CLICK]=this._viewerClick,t[r.f.VIEWER_RIGHT_CLICK]=this._viewerRightClick,t[r.f.VIEWER_MOVE]=this._viewerMove,t[r.f.SIDEBAR_CLICK]=this._sideBarClick,t[r.f.SIDEBAR_STRETCH_START]=this._sidebarStretchStart,t[r.f.OPEN_DEFAULT_TAG]=this._openDefaultTag,t[r.f.FILE_LIST_CLICK]=this._fileListClick,t[r.f.FILE_LIST_RIGHT_CLICK]=this._fileListRightClick,t[r.f.FILE_KEY_UP]=this._fileListKeyUp,t[r.f.ADD_NEW_FOLDER]=this._addNewFolder,t[r.f.TAG_LIST_CLICK]=this._tagListClick,t[r.f.TAG_LIST_RIGHT_CLICK]=this._tagListRightClick,t[r.f.TAG_KEY_UP]=this._tagListKeyUp,t[r.f.ADD_NEW_TAG]=this._addNewTag,t[r.f.PAGER_BLUR]=this._pagerBlur,t[r.f.SET_SCROLLER_SIZE]=this._setScrollerSize,t[r.f.CHANGE_CANVAS_CURSOR]=this.setCanvasCursorTemp,t[r.d.SHOW_CANVAS_LOADING]=this._setShowLoadingImage,t[r.f.TAB_CHANGED]=this._tabChanged,t[r.f.TAB_LIST_CLICK]=this._tabListClick,t[r.f.CLOSE_SAVE_SETTING_BOX]=this._closeSaveSettingBox,t.onPanelChange=this._togglePaneBox,t.onSetSplitBar=this._setSplitBar,t[r.f.SHOW_LATEST_PAGE]=this._showLatestPage,t[r.f.UPDATE_PAGES_LAYOUT]=this._updatePagesLayout,t[r.f.CUSTOM_BUTTON_CLICK]=this._customButtonClick,t[r.f.TAG_REFRESH]=this._tagRefresh,t[r.f.TAG_SELECTED]=this._tagSelectedCallback,t[r.f.IMAGE_SELECTED]=this._imageSelectedCallback,t[r.f.FILE_REFRESH]=this._directoryRefresh,t[r.f.FILE_SELECTED]=this._fileSelectedCallback,t[r.f.PAGER_CHANGED]=this._pagerRefresh,t[r.f.THUMBNAIL_CHANGED]=this._thumbnailRefresh,t);for(var i in e)this._viewOn(i,e[i]);this._eventList=e},e.prototype._unbindStatus=function(){for(var t=Object.keys(this._eventList),e=0;e<t.length;e++){var i=t[e];this._viewOff(i)}this._eventList=null,this._uiEventControl.unbindEvents(),this._tabRender=null,this._tagRender=null,this._directoryRender=null,this._thumbnailRender.removeAllThumbnail(),this._canvasRender.removeAllCanvas(),this._scrollRender.unbindEvents(),this._uiRender.unbindContent(),this._cameraRender=null,this._webcamItem=null},e.prototype._bindButtonEvent=function(){var t=this,e=this.uiConfig.buttons;Object.keys(e).forEach((function(i){var n,s,a=e[i],l=null===(s=null===(n=t._viewerContainer)||void 0===n?void 0:n.el)||void 0===s?void 0:s.querySelector("#"+i+t.postfix);if(!l)return!1;l.classList.add("dvs-iconColor"),a.iconClass===undefined&&l.classList.add("dvs-emptyBtn"),a.onButtonClick&&Object(o.c)(l,r.c.CLICK,(function(e){t._scrollRender.buttonMove?t._scrollRender.buttonMove=!1:(e.changedTouches,t._viewEmit(a.onButtonClick,e))}))}))},e.prototype._viewOn=function(t,e){this._on(t,e.bind(this))},e.prototype._viewOff=function(t,e){this._off(t,e)},e.prototype._viewEmit=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];this._emit.apply(this,Y([t],e))},e.prototype.setShowViewer=function(t){var e,i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el;return this.showViewer=t,!!i&&(this._viewEmit(r.d.CANVAS_VISIBILITY_CHANGED,this.showViewer&&this.showMain),t?(i.classList.remove("dvs-disabled"),this._resizeViewer(),this._showLatestPage()):i.classList.add("dvs-disabled"),!0)},e.prototype.setShowTopMenu=function(t){var e=this._myQuery("topMenu"+this.postfix);return this.showTopMenu=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._resizeViewer(),!0)},e.prototype.setShowHeader=function(t){var e=this._myQuery("header"+this.postfix);return this.showHeader=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._resizeViewer(),!0)},e.prototype.setShowSidebar=function(t){var e;this.showSidebar=t;var i=null===(e=this._sideRender)||void 0===e?void 0:e.setShowSidebar(t);return this._resizeViewer(),i},e.prototype.setShowAside=function(t){var e=this._myQuery("asideMenu"+this.postfix);return this.showAside=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._resizeViewer(),!0)},e.prototype.setShowMain=function(t){var e=this._myQuery("container"+this.postfix);return this.showMain=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._viewEmit(r.d.CANVAS_VISIBILITY_CHANGED,this.showMain&&this.showViewer),this._resizeViewer(),!0)},e.prototype.setShowFooter=function(t){var e=this._myQuery("bottomMenu"+this.postfix);return this.showFooter=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._resizeViewer(),!0)},e.prototype.setShowTab=function(t){var e=this._myQuery("tabList"+this.postfix);return this.showTab=t,!!e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"),this._resizeViewer(),!0)},e.prototype.setHeaderColor=function(t){if(!t)return!0;var e=this._myQuery("header"+this.postfix);return this.headerColor=t,e&&(e.style.background=t),!0},e.prototype.setTopMenuColor=function(t){if(!t)return!0;var e=this._myQuery("topMenu"+this.postfix);return this.topMenuColor=t,e&&(e.style.background=t),!0},e.prototype.setTopMenuBorder=function(t){if(!t)return!0;var e=this._myQuery("topMenu"+this.postfix);return this.topMenuBorder=t,e&&(e.style.border=t),this._resizeViewer(),!0},e.prototype.setFooterColor=function(t){if(!t)return!0;var e=this._myQuery("bottomMenu"+this.postfix);return this.footerColor=t,e&&(e.style.background=t),!0},e.prototype.setAsideMenuColor=function(t){if(!t)return!0;this.asideMenuColor=t;var e=this._myQuery("asideMenu"+this.postfix);return e&&(e.style.background=t),!0},e.prototype.setViewerBorderColor=function(t){var e;if(t){var i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el,n=this._myQuery("Thumbnail"+this.postfix),o=this._myQuery("content"+this.postfix),r=this._myQuery("middle"+this.postfix);i&&(i.style.borderColor=t),n&&(n.style.borderColor=t),o&&(o.style.borderColor=t),r&&(r.style.borderColor=t),this.viewerBorderColor=t}},e.prototype.setOuterBorder=function(t){var e;if(t){this.outerBorder=t;var i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el;i&&(i.style.border=t);var n=this._myQuery("container"+this.postfix),o=this._myQuery("middle"+this.postfix);if(n&&o){var r=t.split(" ");n.style.borderStyle=r[1],n.style.borderColor=r[2],o.style.borderStyle=r[1],o.style.borderColor=r[2],this._setSplitBar()}this._resizeViewer()}},e.prototype.setViewerWidth=function(t){var e,i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el;if(this.width=t,!i)return!1;var n=String(t);return/\d+$/.test(n)&&(t=n+"px"),i.style.width=""+t,this._resizeViewer(),this._showLatestPage(),!0},e.prototype.getViewerWidth=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;return e?e.offsetWidth:this.width},e.prototype.setViewerHeight=function(t){var e,i=null===(e=this._viewerContainer)||void 0===e?void 0:e.el;if(this.height=t,!i)return!1;var n=String(t);return/\d+$/.test(n)&&(t=n+"px"),i.style.height=""+t,this._resizeViewer(),this._showLatestPage(),!0},e.prototype.getViewerHeight=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;return e?e.offsetHeight:this.height},e.prototype.setSidebarWidth=function(t){var e,i=null===(e=this._sideRender)||void 0===e?void 0:e.setSidebarWidth(t);return this._resizeViewer(),i},e.prototype.getSidebarWidth=function(){var t;return null===(t=this._sideRender)||void 0===t?void 0:t.getSidebarWidth()},e.prototype.setShowVideoContainer=function(t){var e=this._myQuery("container"+this.postfix);if(!e)return!1;for(var i=e.children,n=0,o=i.length;n<o;n++){var r=i[n];if(null==r?void 0:r.classList.contains("dvs-customElement"))break;r.classList.contains("dvs-videoContainer")?t?r.classList.remove("dvs-hideVideoContainer"):r.classList.add("dvs-hideVideoContainer"):t?r.classList.add("dvs-hideVideoContainer"):r.classList.remove("dvs-hideVideoContainer")}return this.showVideoContainer=t,t||(this._resizeViewer(),this._showLatestPage()),!0},e.prototype.switchToTagTab=function(){var t=this._myQuery("TagsNav"+this.postfix),e=t&&t.children[0];return!!e&&(e.click(),!0)},e.prototype.switchToTreeTab=function(){var t=this._myQuery("DirctoryTreeNav"+this.postfix),e=t&&t.children[0];return!!e&&(e.click(),!0)},e.prototype.showGroup=function(t){var e=this._myQuery(t+this.postfix);return!!e&&(e.classList.remove("dvs-disabled"),e.classList.remove("dvs-noDisplay"),!0)},e.prototype.hideGroup=function(t){var e=this._myQuery(t+this.postfix);return!!e&&(e.classList.add("dvs-disabled"),e.classList.add("dvs-noDisplay"),!0)},e.prototype._documentMouseMove=function(t){this._cameraRender&&this._cameraRender.mouseMoveCallback(t)},e.prototype._documentMouseUp=function(t){var e,i;return!(!(null===(e=this._viewerContainer)||void 0===e?void 0:e.el)||!t)&&((!t.button||0===t.button)&&(this._cameraRender&&this._cameraRender.mouseUpCallback(t),void(null===(i=this._sideRender)||void 0===i||i.stretchMouseUp())))},e.prototype.documentKeyDown=function(t,e){e?this._thumbnailRender.keydownCallback(t,e):this._viewEmit(r.d.CANVAS_KEY_DOWN,t)},e.prototype.documentKeyUp=function(t,e){e?this._thumbnailRender.keyupCallback(t,e):this._viewEmit(r.d.CANVAS_KEY_UP,t)},e.prototype._documentClick=function(t){this._viewEmit(r.d.UPDATE_FOCUS,{viewerId:undefined,thumbnailId:undefined})},e.prototype.styleChange=function(){var t;if(!this.showViewer)return!1;if(this.uiConfig.buttonResize.ifResize)if(Object(o.u)()){var e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;if(!e)return;e.classList.add("DWT_imageEditor"),e=null}else this._changeButtonSize();var i=this._myQuery("topMenuRight"+this.postfix);i&&(i.parentElement.style.paddingRight=(i.getBoundingClientRect().width||0)+"px"),this._thumbnailRender.calculateSize(),this._thumbnailRender.updateAllDisplayed(),this.updateVideoSize(),this._scrollRender.updateAllGroupShowMore(),this._canvasRender.updateCanvasInnerSize(),this._sendViewSize()},e.prototype._viewerClick=function(t){},e.prototype._viewerRightClick=function(t){},e.prototype._viewerMove=function(t){var e;null===(e=this._sideRender)||void 0===e||e.stretchMouseMove(t)},e.prototype._dropFile=function(t){for(var e=t.dataTransfer.files,i=[],n=0;n<e.length;n++){var s=e[n];if(/^image\/(?!tiff)/.test(s.type)){var a={oriData:o.a.createObjectURL(s),minData:null,metadata:{width:500,height:600},tags:[]};i.push(a)}}this._viewEmit(r.d.APPEND_SYNC_DROP,i)},e.prototype._sendViewSize=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;if(!e)return!1;var i=e.getBoundingClientRect();if(0===i.width||0===i.height||Math.round(i.width)===Math.round(this.showWidth)&&Math.round(i.height)===Math.round(this.showHeight))return!1;this.showWidth=Math.round(i.width),this.showHeight=Math.round(i.height),this._viewEmit(r.g.RESIZE,i.width,i.height)},e.prototype.createThumbnail=function(t){return this._thumbnailRender.createThumbnail(t)},e.prototype.createInnerThumbnail=function(){this._thumbnailRender.createInnerThumbnail(this.uiConfig.canvasConfig)},e.prototype.removeThumbnail=function(t){var e=this._thumbnailRender.removeThumbnail(t);return this._setSplitBar(),e},e.prototype._sideBarClick=function(t){var e;null===(e=this._sideRender)||void 0===e||e.setShowNavigationBox(!1)},e.prototype._sidebarStretchStart=function(t){var e;null===(e=this._sideRender)||void 0===e||e.stretchMouseDown(t)},e.prototype._openDefaultTag=function(){this._directoryRender&&this._tagRender&&(this._viewEmit("_onOpenAll"),this._myQuery("defaultTag"+this.postfix).classList.add("dvs-activeAllImage"),this._tagRender.selectTagByName(""),this._directoryRender.selectFileByName(""))},e.prototype._fileListClick=function(t){var e=this._directoryRender;e&&(e.confirmFolder(t),e.cancelFolder(t),e.enterFolder(t))},e.prototype._fileListRightClick=function(t){},e.prototype._fileListKeyUp=function(t){if(13===t.keyCode){var e=t.target.nextSibling.children[0];e&&e.click()}else if(27===t.keyCode){var i=t.target.nextSibling.children[1];i&&i.click()}},e.prototype._addNewFolder=function(t){var e;null===(e=this._directoryRender)||void 0===e||e.addNewFolder(t)},e.prototype._tagListClick=function(t){var e=t.target,i=this._tagRender;if(!e||!i)return!1;e.classList.contains("confirmTag")||e.classList.contains("renameConfirmTag")?i.confirmTag(e):e.classList.contains("cancelTag")?i.cancelTag(e):e.classList.contains("dvs-quickEdit")?i.quickRenameTag(e):e.classList.contains("dvs-quickDel")?i.quickDelTag(e):i.showTagContent(t)},e.prototype._tagListRightClick=function(t){},e.prototype._tagListKeyUp=function(t){if(13===t.keyCode){var e=t.target.nextSibling.children[0];e&&e.click()}else if(27===t.keyCode){var i=t.target.nextSibling.children[1];i&&i.click()}},e.prototype._addNewTag=function(t){var e;null===(e=this._tagRender)||void 0===e||e.addNewTag(t)},e.prototype._pagerBlur=function(t){this._pagerRender.pageBlur(t)},e.prototype.setInnerTbProp=function(t,e){var i;this._handleInnerProp(t,e),null===(i=this._thumbnailRender.innerThumbnail)||void 0===i||i.handleInnerProp(t,e)},e.prototype._handleInnerProp=function(t,e){this[t]=e;var i="set"+t.replace(/^[a-z]{1}/,(function(t){return t.toUpperCase()}));Object(o.s)(this[i])&&this[i](e)},e.prototype.setCanvasBackground=function(t){var e;this.canvasBackground=t;var i=this._myQuery("mainCanvas"+this.postfix);i&&(i.style.background="",setTimeout((function(){i.style.background=t}))),this._thumbnailRender.innerThumbnail&&(this._thumbnailRender.innerThumbnail.background=t);var n=null===(e=this._viewerContainer.el)||void 0===e?void 0:e.querySelector(".dvs-slideWrapper");n&&(n.style.background=t)},e.prototype.setCanvasBorder=function(t){this.canvasBorder=t;var e=this._myQuery("viewPort"+this.postfix);e&&(e.style.border=t),this._thumbnailRender.innerThumbnail&&(this._thumbnailRender.innerThumbnail.border=t),this._resizeViewer()},e.prototype.setCanvasMouseShape=function(t,e){void 0===e&&(e=!1),e||(this.canvasMouseShape=t,this._viewEmit(r.d.CANVAS_DEFAULT_CURSOR,t));var i=this._myQuery("canvasWrapper"+this.postfix);i&&(i.style.cursor=t),this._thumbnailRender.innerThumbnail&&(this._thumbnailRender.innerThumbnail.mouseShape=t)},e.prototype.setCanvasCursorTemp=function(t){this.setCanvasMouseShape(t||this.canvasMouseShape,!0)},e.prototype.setSelectedBoxLineColor=function(t){var e;this._thumbnailRender.innerThumbnail.setSelectedBoxLineColor(t),null===(e=this._cameraRender)||void 0===e||e.setSelectedBoxColor(t)},e.prototype.setOperationMode=function(t){this._thumbnailRender.innerThumbnail.setOperationMode(t)},e.prototype.setSelectedBoxes=function(t,e){this._thumbnailRender.innerThumbnail.setSelectedBoxes(t,e)},e.prototype.clearSelectedBoxes=function(t){this._thumbnailRender.innerThumbnail.clearSelectedBoxes(t)},e.prototype.setKeepAspectRatio=function(t){this._thumbnailRender.innerThumbnail.setKeepAspectRatio(t)},e.prototype.setAspectRatio=function(t){this._thumbnailRender.innerThumbnail.setAspectRatio(t)},e.prototype._setScrollerSize=function(t){this._canvasRender.updateScrollSize(t)},e.prototype._tabChanged=function(t){this._tabRender.updateTabList(t)},e.prototype._tabListClick=function(t){var e=t.target;if(null==e?void 0:e.classList.contains("dvs-closeTab"))null==e||e["dvs-id"]},e.prototype._tagRefresh=function(t){var e;null===(e=this._tagRender)||void 0===e||e.updateTagList(t)},e.prototype._tagSelectedCallback=function(t){var e;null===(e=this._tagRender)||void 0===e||e.selectTagByName(t)},e.prototype._imageSelectedCallback=function(t){return this._thumbnailRender.updateSelectedIndexes(t)},e.prototype._directoryRefresh=function(t){if(!this._myQuery("treeLists"+this.postfix)||!this._directoryRender)return!1;this._directoryRender.updateDirectory(t);var e=this._myQuery("addFolder"+this.postfix);e&&e.style&&(e.style.pointerEvents="auto")},e.prototype._fileSelectedCallback=function(t){var e;null===(e=this._directoryRender)||void 0===e||e.selectFileByName(t)},e.prototype._pagerRefresh=function(t){var e=t.cur,i=t.total,n=this._pagerRender.getCurrentPage();this._pagerRender.getTotalPage();this._thumbnailRender.pageChangeCallback(n,e,i),this._pagerRender.updatePage(t),this._showLatestPage(e)},e.prototype._thumbnailRefresh=function(t){this._thumbnailRender.updateContents(t)},e.prototype.setDisplayMode=function(t){var e,i,n=this._myQuery("viewPort"+this.postfix),o=this._thumbnailRender.innerThumbnail;if("single"===t)o.clearSelectedBoxes(),null===(e=this._myQuery("innerThumbnail"+this.postfix))||void 0===e||e.classList.add("dvs-disabled"),null==n||n.classList.remove("dvs-disabled"),o.showThumbnail=!1;else{if("continuous"!==t)return!1;null==n||n.classList.add("dvs-disabled"),null===(i=this._myQuery("innerThumbnail"+this.postfix))||void 0===i||i.classList.remove("dvs-disabled"),o.showThumbnail=!0}return this._resizeViewer(),!0},e.prototype.setViewMode=function(t,e){return this._thumbnailRender.innerThumbnail.setViewMode(t,e)},e.prototype._togglePaneBox=function(){var t,e,i=null===(t=this._sideRender)||void 0===t?void 0:t.getShowNavigation();null===(e=this._sideRender)||void 0===e||e.setShowNavigationBox(!i)},e.prototype._customButtonClick=function(t,e){this._scrollRender.buttonMove?this._scrollRender.buttonMove=!1:this._viewEmit(t,e)},e.prototype._closeSaveSettingBox=function(){},e.prototype._setSplitBar=function(){var t,e=this._myQuery("container"+this.postfix),i=this._myQuery("middle"+this.postfix);if(!e||!i)return!1;var n=Object.keys(this._thumbnailRender._thumbnails),o=this._thumbnailRender._thumbnails[n[0]];if(!o||!(null==o?void 0:o.showThumbnail)||(null==o?void 0:o.fullThumbnail)||(null===(t=this._cameraRender)||void 0===t?void 0:t.isVideoShow))e.style.borderWidth="0px",i.style.borderWidth="0px";else{var r=this.outerBorder.split(" ")[0],s="horizontal"===o.location,a=o.sequence,l=this._getBorderWidth(r,s,a);s?(e.style.borderWidth=l,i.style.borderWidth="0px"):(i.style.borderWidth=l,e.style.borderWidth="0px")}this._resizeViewer()},e.prototype._changeButtonSize=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;if(!e)return!1;e.classList.add("dvs-buttonResize");var i=e.clientWidth,n=e.clientHeight,r=36*(i/1920<n/1080?i/1920:n/1080)*window.devicePixelRatio,s=this._myQuery("topMenu"+this.postfix),a=this._myQuery("bottomMenu"+this.postfix),l=this.uiConfig.buttonResize,u=l.maxSize,h=l.minSize,c=Math.max(Math.min(r,u),h),d=Math.floor(1.875*c);if(s&&s.clientWidth>0){s.classList.add("dvs-resizeButton"),Object(o.F)(s,{flexBasis:d+"px",height:d+"px"});for(var p=0;p<s.children.length;p++){s.children[p].style.fontSize=c+"px"}}if(a&&a.clientWidth>0){a.classList.add("dvs-resizeButton"),Object(o.F)(a,{fontSize:c+"px",flexBasis:d+"px",height:d+"px",justifyContent:"flex-start"});for(p=0;p<a.children.length;p++){a.children[p].style.fontSize=c+"px"}}},e.prototype._resizeViewer=function(t,e){var i=this;t&&e&&(this._showLatestQueue[t]=e),clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout((function(){var t,e;for(var n in i.styleChange(),i._showLatestQueue)null===(e=(t=i._showLatestQueue)[n])||void 0===e||e.call(t,i._pagerRender.getCurrentPage());i._showLatestQueue={}}),20)},e.prototype._getBorderWidth=function(t,e,i){var n="";return n+=!e&&i<0?t:"0px",n+=" ",n+=e&&i>=0?t:"0px",n+=" ",n+=!e&&i>=0?t:"0px",n+=" ",n+=e&&i<0?t:"0px"},e.prototype._updatePagesLayout=function(){this._thumbnailRender.updatePagesLayout()},e.prototype._showLatestPage=function(t){this._thumbnailRender.showLatestPage(t)},e.prototype.setButtonClass=function(t){var e=this.uiConfig.buttons,i=this._myQuery(""+t+this.postfix);if(i){var n=e[t],o=n.iconClass?" "+n.iconClass:"",r=n.cssStyle?" "+n.cssStyle:"",s=i.classList.contains("dvs-disabled")?" dvs-disabled":"",a=n.setClass||"";return i.className="ds-dvs-ui-iconfont dvs-iconColor dvs-"+t+s+o+r+" "+a,!0}return!1},e.prototype.setGroupClass=function(t,e){var i=this.uiConfig.groups,n=this._myQuery(t+this.postfix);if(n){var o=i[t].cssStyle?" "+i[t].cssStyle:"",r=n.classList.contains("dvs-disabled")?" dvs-disabled":"";return n.className="dvs-"+t+" dvs-groupType"+r+o+" "+e,!0}return!1},e.prototype.fullScreen=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el,i=Object(o.z)(e);return this._resizeViewer(),i},e.prototype.cancelFullScreen=function(){var t=Object(o.r)()&&Object(o.f)();return this._resizeViewer(),t},e.prototype.fullPage=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;return!!e&&(e.classList.add("fitPage"),this.cancelFullScreen(),this._resizeViewer(),!0)},e.prototype.cancelFullPage=function(){var t,e=null===(t=this._viewerContainer)||void 0===t?void 0:t.el;return!!e&&(e.classList.remove("fitPage"),this.cancelFullScreen(),this._resizeViewer(),!0)},e.prototype.createCustomElement=function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=!1),this._uiRender.createCustomElement(t,e,i)},e.prototype.updateVideoSize=function(){if(this._videoSize&&this.showVideoContainer){var t=this._myQuery("videoContainer"+this.postfix),e=this._myQuery("videoImage"+this.postfix);if(!t||!e)return!1;var i=t.clientWidth,n=t.clientHeight,o=this._videoSize,r=o.imageWidth,s=o.imageHeight;if(i/r-1<n/s-1){var a=i/r;e.style.width=i+"px",e.style.height=s*a+"px"}else{a=n/s;e.style.width=r*a+"px",e.style.height=n+"px"}this._videoSize.imageBoxWidth=e.clientWidth,this._videoSize.imageBoxHeight=e.clientHeight}},e.prototype.updateVideoContainer=function(t){var e=this;return this._videoImageReady?this._updateVideoImage(t):(clearTimeout(this._updateVideoTimer),this._updateVideoTimer=setTimeout((function(){e._updateVideoImage(t)}),200),!0)},e.prototype._updateVideoImage=function(t){var e=this,i=this._myQuery("videoImage"+this.postfix);if(!i)return!1;i.src=t,clearTimeout(this._updateVideoTimer),this._videoImageReady=!1,i.onload=function(){e._videoImageReady=!0,i.style.display="",e._videoSize&&e._videoSize.imageWidth===i.naturalWidth&&e._videoSize.imageHeight===i.naturalHeight&&e._videoSize.imageBoxWidth===i.clientWidth&&e._videoSize.imageBoxHeight===i.clientHeight||(e._videoSize={imageWidth:i.naturalWidth,imageHeight:i.naturalHeight,imageBoxWidth:i.clientWidth,imageBoxHeight:i.clientHeight},e.updateVideoSize())},i.onerror=function(){e._videoImageReady=!0,i.style.display="none",i.onload=null}},e.prototype.getViewerElement=function(){var t;return(null===(t=this._viewerContainer)||void 0===t?void 0:t.el)||null},e.prototype.bindContent=function(t){return this._uiRender.bindContent(t)},e.prototype.unbindContent=function(){return this._uiRender.unbindContent()},e.prototype.setLoadingImage=function(t){if(!t)return!1;var e=this._myQuery("loadingImage"+this.postfix);return e&&(e.src=t),!0},e.prototype._setShowLoadingImage=function(t){var e=this._myQuery("loadingLayer"+this.postfix);e&&(t?e.classList.remove("dvs-disabled"):e.classList.add("dvs-disabled"))},e.prototype.dispose=function(){var e,i,n,o,r,s,a,l,u,h,c;t.prototype.dispose.call(this),this.unbindView(),this.unbindContent(),null===(e=this._uiRender)||void 0===e||e.dispose(),this._uiRender=null,null===(i=this._thumbnailRender)||void 0===i||i.dispose(),this._thumbnailRender=null,null===(n=this._scrollRender)||void 0===n||n.dispose(),this._scrollRender=null,null===(o=this._pagerRender)||void 0===o||o.dispose(),this._pagerRender=null,null===(r=this._uiEventControl)||void 0===r||r.dispose(),this._uiEventControl=null,null===(s=this._tabRender)||void 0===s||s.dispose(),this._tabRender=null,null===(a=this._canvasRender)||void 0===a||a.dispose(),this._canvasRender=null,null===(l=this._sideRender)||void 0===l||l.dispose(),this._sideRender=null,null===(u=this._directoryRender)||void 0===u||u.dispose(),this._directoryRender=null,null===(h=this._tagRender)||void 0===h||h.dispose(),this._tagRender=null,null===(c=this._cameraRender)||void 0===c||c.dispose(),this._cameraRender=null,this._viewerContainer=null,this.containerBox=null},e}(a.a);i.d(e,"ViewUi",(function(){return W})),window.Dynamsoft=window.Dynamsoft||{},window.Dynamsoft.ViewUi=W}]);
|